claude-code-best 2.6.10 → 2.6.12

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 (484) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-DYIf4o0g.js → AddWorkspaceDirectory-LhW1QZFL.js} +1 -1
  2. package/dist/chunks/{App-Bw4stCcv.js → App-DYMNbl0d.js} +1 -1
  3. package/dist/chunks/ApproveApiKey-B1XCQNW6.js +1 -0
  4. package/dist/chunks/{ApproveApiKey-CNBKF9de.js → ApproveApiKey-Bi2Iq_gN.js} +1 -1
  5. package/dist/chunks/{AssistantSessionChooser-DU5OOPwq.js → AssistantSessionChooser-Dv6yYR3s.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-qS15If6H.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-UOkwRr3W.js → BypassPermissionsModeDialog-Bhjd2F2o.js} +1 -1
  8. package/dist/chunks/{ClaudeInChromeOnboarding-6UL2_PCg.js → ClaudeInChromeOnboarding-CxBS5xZY.js} +1 -1
  9. package/dist/chunks/{ClaudeMdExternalIncludesDialog-DBfmH_dG.js → ClaudeMdExternalIncludesDialog-CiANFiNV.js} +1 -1
  10. package/dist/chunks/ClaudeMdExternalIncludesDialog-nuKXhM2t.js +1 -0
  11. package/dist/chunks/ConsoleOAuthFlow-C8FzG3uF.js +1 -0
  12. package/dist/chunks/{DesktopHandoff-B-ySC5nP.js → DesktopHandoff-BSpzQF0U.js} +1 -1
  13. package/dist/chunks/{DevChannelsDialog-DZMsKuak.js → DevChannelsDialog-B2xqlZtS.js} +1 -1
  14. package/dist/chunks/{DiffDialog-CeYcqIIw.js → DiffDialog-XmOsaUeN.js} +2 -2
  15. package/dist/chunks/Doctor-C6FXh99k.js +1 -0
  16. package/dist/chunks/Doctor-DLx7Z_sA.js +3 -0
  17. package/dist/chunks/{ExitFlow-gMv13EpM.js → ExitFlow-CHDj7fv7.js} +2 -2
  18. package/dist/chunks/{Feedback-CGRlFB5g.js → Feedback-CUjTJbIh.js} +2 -2
  19. package/dist/chunks/Grove-B8ZQOflC.js +1 -0
  20. package/dist/chunks/{Grove-CnHyPepC.js → Grove-fenDMHVw.js} +1 -1
  21. package/dist/chunks/{HybridTransport-CiY6jyhx.js → HybridTransport-CP63usH9.js} +1 -1
  22. package/dist/chunks/{ITermBackend-CG-a4QYW.js → ITermBackend-Bp_3qpix.js} +1 -1
  23. package/dist/chunks/{InvalidConfigDialog-umJZVrz-.js → InvalidConfigDialog-CgD7HSg0.js} +1 -1
  24. package/dist/chunks/{InvalidSettingsDialog-C62kuhHc.js → InvalidSettingsDialog-pYMa5Fp4.js} +1 -1
  25. package/dist/chunks/MCPConnectionManager-ip1xShU_.js +1 -0
  26. package/dist/chunks/{McpParsingWarnings-DW0d9Lsb.js → McpParsingWarnings-DhobExFM.js} +1 -1
  27. package/dist/chunks/MessageSelector-B2X6zrsb.js +3 -0
  28. package/dist/chunks/Messages-CmsZIA66.js +11 -0
  29. package/dist/chunks/{Onboarding-BRePz3fJ.js → Onboarding-BaoLhLiT.js} +1 -1
  30. package/dist/chunks/{OverageCreditUpsell-DEZsyI6y.js → OverageCreditUpsell-DnLMobAh.js} +1 -1
  31. package/dist/chunks/{PluginSettings-CuZtXDaS.js → PluginSettings-BetzicTb.js} +3 -3
  32. package/dist/chunks/{PromptInputFooterSuggestions-BrpVQJVn.js → PromptInputFooterSuggestions-D-1hRFAD.js} +1 -1
  33. package/dist/chunks/{PromptInputHelpMenu-BlGRpX1Q.js → PromptInputHelpMenu-DnQj3Hpq.js} +1 -1
  34. package/dist/chunks/QueryEngine-BwvqdZVN.js +1 -0
  35. package/dist/chunks/REPL-CCgaPc2g.js +1 -0
  36. package/dist/chunks/{REPL-D-t0XQx2.js → REPL-zS2s1JnV.js} +34 -34
  37. package/dist/chunks/{RemoteCallout-DvOZQWoG.js → RemoteCallout-B9hClSYj.js} +1 -1
  38. package/dist/chunks/{RemoteSessionManager-BlIA65dM.js → RemoteSessionManager-BgLIvi8Z.js} +2 -2
  39. package/dist/chunks/ResumeConversation-DAMMGHGc.js +1 -0
  40. package/dist/chunks/{SSETransport-CIvM80QS.js → SSETransport-CD7R7FfS.js} +1 -1
  41. package/dist/chunks/SearchExtraToolsTool-CP6G9xhL.js +1 -0
  42. package/dist/chunks/{SentryErrorBoundary-BK2HjzVw.js → SentryErrorBoundary-6dQQW6kh.js} +1 -1
  43. package/dist/chunks/SentryErrorBoundary-B2e3QmqR.js +1 -0
  44. package/dist/chunks/Settings-DgW58gbY.js +2 -0
  45. package/dist/chunks/{TeleportProgress-BFlMrsa_.js → TeleportProgress-D_USKi0I.js} +1 -1
  46. package/dist/chunks/TeleportRepoMismatchDialog-C1-iWmRP.js +1 -0
  47. package/dist/chunks/{TeleportResumeWrapper-CHfeyo9J.js → TeleportResumeWrapper-BX9nUVsC.js} +1 -1
  48. package/dist/chunks/{ThemePicker-a5n2EKgk.js → ThemePicker-C0JghXSS.js} +1 -1
  49. package/dist/chunks/{TmuxBackend-Ct9v-J78.js → TmuxBackend-BxPiis2l.js} +1 -1
  50. package/dist/chunks/{TrustDialog-e1nyM-Fp.js → TrustDialog-BZD-KGrA.js} +1 -1
  51. package/dist/chunks/{ValidationErrorsList-BHCepjdO.js → ValidationErrorsList-CTFdkGiH.js} +1 -1
  52. package/dist/chunks/{WelcomeV2-BnyziLbm.js → WelcomeV2-C7F1y8zh.js} +1 -1
  53. package/dist/chunks/{WindowsTerminalBackend-Dw6qjsBu.js → WindowsTerminalBackend-DLxmmXo4.js} +2 -2
  54. package/dist/chunks/{add-dir-CjnY5yfR.js → add-dir-Dhv9aEca.js} +1 -1
  55. package/dist/chunks/{agentDisplay-Dfx-axK9.js → agentDisplay-BoBFMmGh.js} +1 -1
  56. package/dist/chunks/{agents-lM-cxA8_.js → agents-Bt9kYpgi.js} +1 -1
  57. package/dist/chunks/{agents-CICHEOOq.js → agents-CdsfzK3E.js} +7 -7
  58. package/dist/chunks/{ant-JgExUpwJ.js → ant-Bo6XJuE9.js} +1 -1
  59. package/dist/chunks/api-CRPzfBL5.js +1 -0
  60. package/dist/chunks/{api-CClu711S.js → api-CslgFoHj.js} +1 -1
  61. package/dist/chunks/{assistant-D1XefK1z.js → assistant--L1Ll62G.js} +1 -1
  62. package/dist/chunks/assistant-DypEudjI.js +1 -0
  63. package/dist/chunks/{assistant-Bih7t52W.js → assistant-od6Nf6EJ.js} +1 -1
  64. package/dist/chunks/auth-BaaTtn3M.js +1 -0
  65. package/dist/chunks/{auth-CU6ArDos.js → auth-yKNn60lZ.js} +1 -1
  66. package/dist/chunks/{autoMode-DM9eDMmT.js → autoMode-C4b9u7WQ.js} +6 -6
  67. package/dist/chunks/{autonomy-DUfXLZfq.js → autonomy-7nZpCyNC.js} +12 -12
  68. package/dist/chunks/{autonomy-CZCZ9wlx.js → autonomy-rMsykUYN.js} +1 -1
  69. package/dist/chunks/{autonomyPanel-kUZwcjfu.js → autonomyPanel-j0q1dMDj.js} +1 -1
  70. package/dist/chunks/backgroundHousekeeping-DGAYPsK9.js +1 -0
  71. package/dist/chunks/backgroundHousekeeping-KCpR7i2h.js +17 -0
  72. package/dist/chunks/{branch-Ac3HXXs2.js → branch-GL4WvvLa.js} +2 -2
  73. package/dist/chunks/{bridge-Drt-UmFp.js → bridge-BVzpVEsr.js} +2 -2
  74. package/dist/chunks/bridgeConfig-B1OTOi0O.js +1 -0
  75. package/dist/chunks/{bridgeConfig-GQzZVhuF.js → bridgeConfig-C110hgnb.js} +1 -1
  76. package/dist/chunks/{bridgeEnabled-CDoXbe3S.js → bridgeEnabled-DrW-kkAr.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-Zk2slA-p.js +1 -0
  78. package/dist/chunks/bridgeMain-C-MUVlCX.js +68 -0
  79. package/dist/chunks/bridgeMain-L1ScqrgM.js +1 -0
  80. package/dist/chunks/{bridgeMessaging-gRm2WcIE.js → bridgeMessaging-DobCpZGY.js} +1 -1
  81. package/dist/chunks/{btw-B2Tq2ewP.js → btw-CSDRs-n8.js} +1 -1
  82. package/dist/chunks/{buddy-v00QHFZ6.js → buddy-D3Owb2U5.js} +1 -1
  83. package/dist/chunks/{bypassPermissionsKillswitch-DAr5U3Ep.js → bypassPermissionsKillswitch-B_5qku-e.js} +1 -1
  84. package/dist/chunks/caches-CpgRh__l.js +1 -0
  85. package/dist/chunks/{caches-DHUk9KMo.js → caches-Di_WVMtD.js} +2 -2
  86. package/dist/chunks/{ccrClient-1Q3C_3_r.js → ccrClient-CWH1f8Nk.js} +1 -1
  87. package/dist/chunks/changeDetector-DEStinxa.js +1 -0
  88. package/dist/chunks/channelNotification-DxAS15nL.js +1 -0
  89. package/dist/chunks/{channelNotification-d08DSK9u.js → channelNotification-Y5fNpq-B.js} +1 -1
  90. package/dist/chunks/{chrome-CKo0_n71.js → chrome-Cgl-Sq1y.js} +1 -1
  91. package/dist/chunks/clear-Dja0RB_p.js +1 -0
  92. package/dist/chunks/client-DuWXRBa0.js +1 -0
  93. package/dist/chunks/color-tvVGbuuv.js +1 -0
  94. package/dist/chunks/commands-ElmJnxRE.js +1 -0
  95. package/dist/chunks/{commitAttribution-BJvmLsVe.js → commitAttribution-CedoNRL0.js} +1 -1
  96. package/dist/chunks/commitAttribution-D6vYpAMS.js +1 -0
  97. package/dist/chunks/compact-BwsLImWZ.js +3 -0
  98. package/dist/chunks/{companion-C2CBSYiF.js → companion-C3hWMSgF.js} +1 -1
  99. package/dist/chunks/{config-Cht2x9n9.js → config-BHCIawwx.js} +1 -1
  100. package/dist/chunks/{config-DnWYFpDc.js → config-Dh0QGc4B.js} +1 -1
  101. package/dist/chunks/{context-CDz9HqRT.js → context-CSHiU4LG.js} +1 -1
  102. package/dist/chunks/{context-noninteractive-BUIf4IMX.js → context-noninteractive-CKFY_j1P.js} +2 -2
  103. package/dist/chunks/context-noninteractive-DirFwn0d.js +1 -0
  104. package/dist/chunks/conversation-DfIv8Jzc.js +1 -0
  105. package/dist/chunks/conversation-Dyb5kfil.js +1 -0
  106. package/dist/chunks/{copy-BgHTb1Z0.js → copy-BSyDpOx5.js} +2 -2
  107. package/dist/chunks/{createSSHSession-C_mpeqPy.js → createSSHSession-PfzB7zZR.js} +1 -1
  108. package/dist/chunks/{createSession-kVJBXQlZ.js → createSession-Bk6r39b1.js} +1 -1
  109. package/dist/chunks/createSession-DdsaDZoq.js +1 -0
  110. package/dist/chunks/{cronJitterConfig-SI7bYvJj.js → cronJitterConfig-BFVNIkjD.js} +3 -3
  111. package/dist/chunks/crossProjectResume-CdoH1cwH.js +40 -0
  112. package/dist/chunks/{daemon-VYRit6Aq.js → daemon-CCtZ9wY3.js} +1 -1
  113. package/dist/chunks/{datadog-Bd9AgZT-.js → datadog-By0GhDXI.js} +1 -1
  114. package/dist/chunks/datadog-CTRRIaBJ.js +1 -0
  115. package/dist/chunks/{desktop-BeUj2fqu.js → desktop-BV6CI329.js} +1 -1
  116. package/dist/chunks/{diff-BzgXDp1o.js → diff-qDuBFv-P.js} +1 -1
  117. package/dist/chunks/{doctor-HCOexiL5.js → doctor-BtTsew-G.js} +1 -1
  118. package/dist/chunks/earlyInput-RoVleNEN.js +1 -0
  119. package/dist/chunks/{effort-BaJU_k2K.js → effort-DSpAOBeU.js} +2 -2
  120. package/dist/chunks/{entry-BoXZIfxW.js → entry-CYCQJU7M.js} +8 -8
  121. package/dist/chunks/envLessBridgeConfig-B3o52JMX.js +1 -0
  122. package/dist/chunks/{envLessBridgeConfig-CnR1E53G.js → envLessBridgeConfig-BKs6Mk4e.js} +1 -1
  123. package/dist/chunks/exit-BgaIlRuS.js +1 -0
  124. package/dist/chunks/{export-p85q3g8t.js → export-BOQCWSMm.js} +1 -1
  125. package/dist/chunks/{exportRenderer-CUqd8PZM.js → exportRenderer-B-2J3ocI.js} +1 -1
  126. package/dist/chunks/extra-usage-BLVbAE1O.js +1 -0
  127. package/dist/chunks/{extra-usage-pPprHqwq.js → extra-usage-S4WYpDn5.js} +1 -1
  128. package/dist/chunks/{extra-usage-core-B9Fy8_RP.js → extra-usage-core-Sq4JALS7.js} +1 -1
  129. package/dist/chunks/{extra-usage-noninteractive-B4vaWh0y.js → extra-usage-noninteractive-BlJVTTwe.js} +1 -1
  130. package/dist/chunks/{extraUsage-CEHCMe7l.js → extraUsage-CMJ1LEPS.js} +1 -1
  131. package/dist/chunks/extractMemories-BpN0fQF-.js +1 -0
  132. package/dist/chunks/fast-B8a-zz4X.js +1 -0
  133. package/dist/chunks/{fast-CiSIZ5FI.js → fast-OzVowRYW.js} +1 -1
  134. package/dist/chunks/{feedback-C2QLdCfW.js → feedback-BZet1Qu_.js} +1 -1
  135. package/dist/chunks/{firstPartyEventLogger-CozFbFD9.js → firstPartyEventLogger-DeytNcUC.js} +1 -1
  136. package/dist/chunks/{flushGate-LXr8ynSz.js → flushGate-CeFJrqgK.js} +1 -1
  137. package/dist/chunks/{gates-BGfvIJXl.js → gates-Be4ovdxj.js} +1 -1
  138. package/dist/chunks/gates-WmmZ-8JT.js +1 -0
  139. package/dist/chunks/gemini-DExthrur.js +1 -0
  140. package/dist/chunks/{generateRecap-CLla3Ymz.js → generateRecap-BIFrnTIe.js} +1 -1
  141. package/dist/chunks/{generateSessionName-DF4I7gr2.js → generateSessionName-DlC0lhSv.js} +1 -1
  142. package/dist/chunks/{githubRepoPathMapping-C_5RCW_Z.js → githubRepoPathMapping-BKB2G52c.js} +1 -1
  143. package/dist/chunks/grok-BNxCseLh.js +1 -0
  144. package/dist/chunks/{growthbook-C39e6Byf.js → growthbook-B3_MJJ45.js} +1 -1
  145. package/dist/chunks/{heapdump-BRj4tC1y.js → heapdump-sPWpCjXq.js} +1 -1
  146. package/dist/chunks/{help-fH9LNwox.js → help-BuUi6cM0.js} +1 -1
  147. package/dist/chunks/{hooks-D22Uu3Vs.js → hooks-5vDlGpNp.js} +2 -2
  148. package/dist/chunks/hooks-CVJA4uQu.js +1 -0
  149. package/dist/chunks/{hostAdapter-CbXytx4y.js → hostAdapter-BfBHV5nj.js} +1 -1
  150. package/dist/chunks/{ide-DM5Tw70v.js → ide-DvUftvRn.js} +2 -2
  151. package/dist/chunks/inboundAttachments-CQyeysIk.js +1 -0
  152. package/dist/chunks/{inboundAttachments-2QIORKsd.js → inboundAttachments-CiF42Eku.js} +1 -1
  153. package/dist/chunks/initReplBridge-Bzg5Gx97.js +1 -0
  154. package/dist/chunks/{insights-B6ogyLuv.js → insights-CvwFcRQt.js} +64 -64
  155. package/dist/chunks/{install-github-app-CQ7vkhIX.js → install-github-app-DxxG2VlZ.js} +2 -2
  156. package/dist/chunks/{install-slack-app-By9_5YS7.js → install-slack-app-Bc5m1UFG.js} +1 -1
  157. package/dist/chunks/{install-DimDiHha.js → install-tclc0QHM.js} +1 -1
  158. package/dist/chunks/{instrumentation-DbKu2GCL.js → instrumentation-Dn_FDn6G.js} +3 -3
  159. package/dist/chunks/{job-D_DoFtev.js → job-ssZ2ESAX.js} +1 -1
  160. package/dist/chunks/{keybindings-DYRBv1bg.js → keybindings-DVZlobLM.js} +2 -2
  161. package/dist/chunks/{lang-CAMxxG9F.js → lang-BQ--zwb1.js} +1 -1
  162. package/dist/chunks/language-BM5numKK.js +1 -0
  163. package/dist/chunks/{language-CoHgN7rh.js → language-CcxtaVJA.js} +1 -1
  164. package/dist/chunks/{launchAgentsPlatform-9P8K66ku.js → launchAgentsPlatform-CLwlpK5C.js} +1 -1
  165. package/dist/chunks/{launchAutofixPr-BbsqqUMA.js → launchAutofixPr-vGLlC4Jm.js} +3 -3
  166. package/dist/chunks/{launchLocalMemory-K55Yo6JM.js → launchLocalMemory-DJ4pR8a2.js} +2 -2
  167. package/dist/chunks/{launchLocalVault-rrd1Q7jP.js → launchLocalVault-Cl7Dds3W.js} +3 -3
  168. package/dist/chunks/{launchMemoryStores-DMZ8GNQj.js → launchMemoryStores-Czk-a1P6.js} +1 -1
  169. package/dist/chunks/{launchOnboarding-Duz_huXl.js → launchOnboarding-66gN_781.js} +1 -1
  170. package/dist/chunks/{launchSchedule-7VlG_3M6.js → launchSchedule-Tx5efcfv.js} +1 -1
  171. package/dist/chunks/{launchSkillStore-CcJL8RT0.js → launchSkillStore-BGPd1KCD.js} +1 -1
  172. package/dist/chunks/{launchTeleport-C8h_4F_L.js → launchTeleport-DzXrNn2h.js} +2 -2
  173. package/dist/chunks/{launchVault-Bm1EeT2x.js → launchVault-C5djf6XO.js} +1 -1
  174. package/dist/chunks/{loadAgentsDir-HZ19tmOZ.js → loadAgentsDir-DaApSWNv.js} +807 -764
  175. package/dist/chunks/loadAgentsDir-_BePoo3r.js +1 -0
  176. package/dist/chunks/loadPluginHooks-GENkKqO8.js +1 -0
  177. package/dist/chunks/{localSearch-4cz5ia5a.js → localSearch-BQuH38SB.js} +1 -1
  178. package/dist/chunks/localSearch-BSR9byCr.js +1 -0
  179. package/dist/chunks/{login-D6ywctRr.js → login-C64M5OdJ.js} +1 -1
  180. package/dist/chunks/login-dkrrvdEl.js +1 -0
  181. package/dist/chunks/{logoV2Utils-jaFn88oE.js → logoV2Utils-D6ceZmK0.js} +1 -1
  182. package/dist/chunks/logout-BITK5qkB.js +1 -0
  183. package/dist/chunks/{magicDocs-DHGtJq0K.js → magicDocs-KPodA4bi.js} +2 -2
  184. package/dist/chunks/{main-Bv4AvaJk.js → main-wb2H0Xbt.js} +48 -48
  185. package/dist/chunks/{mappers-qcXgNBi5.js → mappers-D54WYYhL.js} +1 -1
  186. package/dist/chunks/mcp-Bgeq8jbd.js +6 -0
  187. package/dist/chunks/mcp-CJvRg7ft.js +2 -0
  188. package/dist/chunks/mcp-Ddvz5we7.js +1 -0
  189. package/dist/chunks/{mcpServer-Do9XTs2J.js → mcpServer-VYXTzAFl.js} +1 -1
  190. package/dist/chunks/{mcpServer-DcSto-Od.js → mcpServer-d0863d94.js} +1 -1
  191. package/dist/chunks/memory-BNyVCuw9.js +1 -0
  192. package/dist/chunks/mode-D_L3DNsz.js +2 -0
  193. package/dist/chunks/model-DevOJk2A.js +1 -0
  194. package/dist/chunks/{model-DwVGG0mc.js → model-Dy_oUo2C.js} +1 -1
  195. package/dist/chunks/{onChangeAppState-CHYSALjM.js → onChangeAppState-GPs10FBm.js} +1 -1
  196. package/dist/chunks/{openai-Brj68CWD.js → openai-C0CrRENO.js} +3 -3
  197. package/dist/chunks/{overageCreditGrant-D5X6-TcP.js → overageCreditGrant-DCiIf_SF.js} +1 -1
  198. package/dist/chunks/{panel-Bz_8td5D.js → panel-s9fbCKfl.js} +1 -1
  199. package/dist/chunks/{passes-B1f6NHWA.js → passes-C9oR06Fa.js} +1 -1
  200. package/dist/chunks/{paths-D8Fx3kUi.js → paths-BZbIj1Z1.js} +3 -3
  201. package/dist/chunks/permissions-DNb8DG22.js +3 -0
  202. package/dist/chunks/{pipeTransport-DAYnzvGK.js → pipeTransport-Cx55TUNu.js} +1 -1
  203. package/dist/chunks/{plan-B7EPetF0.js → plan-D-RJTUxb.js} +1 -1
  204. package/dist/chunks/{plugin-BRWx-_ZS.js → plugin-BV-DabiK.js} +1 -1
  205. package/dist/chunks/{pluginAutoupdate-BwxAsU2F.js → pluginAutoupdate-DPciQRLz.js} +1 -1
  206. package/dist/chunks/pluginBlocklist-CtSUf3sp.js +1 -0
  207. package/dist/chunks/{pluginCliCommands-CXANH43C.js → pluginCliCommands-Cbcc-AQq.js} +1 -1
  208. package/dist/chunks/{pluginFlagging-CBbUoCJ9.js → pluginFlagging-D2d7jd4v.js} +1 -1
  209. package/dist/chunks/pluginOperations-rU56uptC.js +2 -0
  210. package/dist/chunks/{pluginStartupCheck-BNfv-Pf4.js → pluginStartupCheck-DuhCLRbp.js} +1 -1
  211. package/dist/chunks/pluginStartupCheck-DwY7j_Cg.js +1 -0
  212. package/dist/chunks/plugins-LbLpZOhz.js +4 -0
  213. package/dist/chunks/policyLimits-Dl863Z85.js +1 -0
  214. package/dist/chunks/{pollConfig-BWY_xmk6.js → pollConfig-orFqIbGd.js} +1 -1
  215. package/dist/chunks/{poor-Bcu8JaV5.js → poor-2u_yWIRG.js} +1 -1
  216. package/dist/chunks/poorMode-BBr7GGQ3.js +1 -0
  217. package/dist/chunks/{poorMode-CDhhKGBw.js → poorMode-DtQVZvON.js} +1 -1
  218. package/dist/chunks/print-BgLbepaC.js +39 -0
  219. package/dist/chunks/{privacy-settings-CmHUlYoo.js → privacy-settings-CC_FyvjV.js} +1 -1
  220. package/dist/chunks/processBashCommand-DnekNzlT.js +1 -0
  221. package/dist/chunks/processSlashCommand-sLL0pyIW.js +6 -0
  222. package/dist/chunks/{projectContext-0fpRKUeH.js → projectContext-D5FgyE-d.js} +1 -1
  223. package/dist/chunks/{prompt-BxoRdmaw.js → prompt-DHHypkUR.js} +1 -1
  224. package/dist/chunks/prompt-Dexwn9YP.js +1 -0
  225. package/dist/chunks/prompt-DhaPVt1T.js +1 -0
  226. package/dist/chunks/{promptEditor-LQu9NhbN.js → promptEditor-I8ZpszKv.js} +2 -2
  227. package/dist/chunks/{protocolHandler-DYn2E9Yl.js → protocolHandler-CEsrhel_.js} +1 -1
  228. package/dist/chunks/rate-limit-options-B0Iyzr4x.js +1 -0
  229. package/dist/chunks/{rcDebugLog-5XEbz_Yg.js → rcDebugLog-CF73Wofq.js} +1 -1
  230. package/dist/chunks/{referral-BsAvaATn.js → referral-Nz20w4pB.js} +1 -1
  231. package/dist/chunks/refresh-DecpoOX1.js +1 -0
  232. package/dist/chunks/{registerProtocol-COUVHFku.js → registerProtocol-CAoaYyt8.js} +1 -1
  233. package/dist/chunks/registry-BQdQRu-K.js +1 -0
  234. package/dist/chunks/{release-notes-BDdughgu.js → release-notes-C0HeOmQY.js} +1 -1
  235. package/dist/chunks/{releaseNotes-Bd3zxid3.js → releaseNotes-BDzfbUAu.js} +2 -2
  236. package/dist/chunks/{reload-plugins-qUIybHNy.js → reload-plugins-BZ4LTYY3.js} +1 -1
  237. package/dist/chunks/{remote-env-GGlLNGsx.js → remote-env-CPalv-BL.js} +1 -1
  238. package/dist/chunks/{remoteBridgeCore-DpF5alU6.js → remoteBridgeCore-B2yFfG6S.js} +1 -1
  239. package/dist/chunks/{remoteControlServer-C32rxr3F.js → remoteControlServer-CsnLedUv.js} +2 -2
  240. package/dist/chunks/rename-CQPtjj_Q.js +1 -0
  241. package/dist/chunks/{resume-C6ereXig.js → resume-Ycuezjv2.js} +2 -2
  242. package/dist/chunks/{runtimeObserver-DBdzsp_h.js → runtimeObserver-CW0_wm1t.js} +1 -1
  243. package/dist/chunks/{runtimeObserver-jrNSkZU2.js → runtimeObserver-DnhLm9O1.js} +3 -3
  244. package/dist/chunks/sandbox-adapter-BOsa-en7.js +1 -0
  245. package/dist/chunks/{sandbox-toggle-Bfti5GKF.js → sandbox-toggle-Bl5Drxeo.js} +1 -1
  246. package/dist/chunks/searchExtraTools-CgdrY8XO.js +1 -0
  247. package/dist/chunks/{sentry-CZUyEC3A.js → sentry-BN3GTgYM.js} +1 -1
  248. package/dist/chunks/{session-DCIDa5dI.js → session-ULekTZVn.js} +2 -2
  249. package/dist/chunks/{sessionDiscovery-5m_pul65.js → sessionDiscovery-DAmbR6o-.js} +1 -1
  250. package/dist/chunks/sessionFileAccessHooks-C-o5001P.js +1 -0
  251. package/dist/chunks/sessionMemory-Bg458voj.js +1 -0
  252. package/dist/chunks/sessionMemory-DR-esdhZ.js +1 -0
  253. package/dist/chunks/sessionMemoryUtils-DgVGiwjB.js +1 -0
  254. package/dist/chunks/sessionObserver-C5cujEe6.js +1 -0
  255. package/dist/chunks/{sessionObserver-LBqNoak9.js → sessionObserver-CQ3PQWgU.js} +1 -1
  256. package/dist/chunks/sessionStorage-BIDUQ8wo.js +1 -0
  257. package/dist/chunks/{sessionTitle-BIykjtKk.js → sessionTitle-DyexSH43.js} +1 -1
  258. package/dist/chunks/{sessionTracing-Da_r0mIc.js → sessionTracing-gKle2qzF.js} +1 -1
  259. package/dist/chunks/{settingsSync-BE0PQqyo.js → settingsSync-BWW4FOMm.js} +1 -1
  260. package/dist/chunks/{setup-p04XtwYu.js → setup-DX6984LY.js} +1 -1
  261. package/dist/chunks/setup-OvlOCIFL.js +2 -0
  262. package/dist/chunks/{setup-CjA5bW6e.js → setup-n91rSYO2.js} +1 -1
  263. package/dist/chunks/{shadowedRuleDetection-Zqp1M5St.js → shadowedRuleDetection-uYIZBoii.js} +1 -1
  264. package/dist/chunks/{sideQuestion-DzJenEES.js → sideQuestion-DIMsNoEc.js} +2 -2
  265. package/dist/chunks/sink-BBn0HwoH.js +1 -0
  266. package/dist/chunks/{sink-N5XR8Zgp.js → sink-DLRpC2qX.js} +1 -1
  267. package/dist/chunks/{sinks-D8erzS9D.js → sinks-BI1hGD9c.js} +2 -2
  268. package/dist/chunks/sinks-DKGE2sSC.js +1 -0
  269. package/dist/chunks/{skill-learning-CbMQ8IsZ.js → skill-learning-Dz-Zq-xT.js} +1 -1
  270. package/dist/chunks/skillChangeDetector-C2Te20cK.js +1 -0
  271. package/dist/chunks/{skillGapStore-DbiDG9Pd.js → skillGapStore-BFpryJIe.js} +2 -2
  272. package/dist/chunks/{skillGapStore-Bp5IVfOx.js → skillGapStore-CxPjoWci.js} +1 -1
  273. package/dist/chunks/{skillGenerator-Bys7U1l_.js → skillGenerator-BGOIb5p-.js} +2 -2
  274. package/dist/chunks/skillLearning-BRvWwB8E.js +1 -0
  275. package/dist/chunks/skillLearning-DTo7lCKd.js +1 -0
  276. package/dist/chunks/{skillPanel-MIHU1PPp.js → skillPanel-DzYZLnuH.js} +3 -3
  277. package/dist/chunks/{skillSearchPanel-MFB-PzB1.js → skillSearchPanel-DrysL5R-.js} +3 -3
  278. package/dist/chunks/{skills-D4tZYFpd.js → skills-CTfNqisc.js} +1 -1
  279. package/dist/chunks/{sprites-B479AZSz.js → sprites-CHzZCAGE.js} +1 -1
  280. package/dist/chunks/{stats-B-ErfxCJ.js → stats-D2s-hIY8.js} +1 -1
  281. package/dist/chunks/{status-DVACJLsK.js → status-XxrX2kHw.js} +1 -1
  282. package/dist/chunks/statusNoticeHelpers-CUm1pflC.js +1 -0
  283. package/dist/chunks/{tag-YpE2D2ve.js → tag-FV031rKW.js} +2 -2
  284. package/dist/chunks/{tasks-7N7iSiEx.js → tasks-aK2rp8CW.js} +1 -1
  285. package/dist/chunks/{teamHelpers-BFdTH57t.js → teamHelpers-2m66Mr8w.js} +1 -1
  286. package/dist/chunks/teamHelpers-Bg3nHlWr.js +1 -0
  287. package/dist/chunks/{teammateModeSnapshot-CwacsQvD.js → teammateModeSnapshot-BtdUJBKp.js} +1 -1
  288. package/dist/chunks/teammateModeSnapshot-VojvAMbR.js +1 -0
  289. package/dist/chunks/teleport-4x9eIl8c.js +1 -0
  290. package/dist/chunks/{templateJobs-BM98KAEH.js → templateJobs-fEz4DGWh.js} +1 -1
  291. package/dist/chunks/{terminalSetup-CGiIwoIX.js → terminalSetup-Cjdlcznm.js} +1 -1
  292. package/dist/chunks/{terminalSetup-yQ0CoywX.js → terminalSetup-EirH-l0a.js} +1 -1
  293. package/dist/chunks/{theme-C5ULGNRs.js → theme-BjdEyakL.js} +1 -1
  294. package/dist/chunks/thinkback-CrW3VlCR.js +1 -0
  295. package/dist/chunks/thinkback-DHyz-lmU.js +1 -0
  296. package/dist/chunks/thinkback-play-B46ystVF.js +1 -0
  297. package/dist/chunks/{toolEventObserver-CuJbsUL0.js → toolEventObserver-CJ68x4wM.js} +1 -1
  298. package/dist/chunks/{toolEventObserver-CcLqNRcT.js → toolEventObserver-Dak6ETA6.js} +1 -1
  299. package/dist/chunks/toolPool-3CMCh3QU.js +1 -0
  300. package/dist/chunks/toolPool-BHdCDihh.js +1 -0
  301. package/dist/chunks/{trustedDevice-u2HpuTkN.js → trustedDevice-QhApqKq4.js} +1 -1
  302. package/dist/chunks/{trustedDevice-C4tvgByY.js → trustedDevice-oDn6E85N.js} +1 -1
  303. package/dist/chunks/{tui-BVc2q4Xv.js → tui-geoc3zxu.js} +1 -1
  304. package/dist/chunks/{ultrareviewCommand-CWLiiq-z.js → ultrareviewCommand-Ar9zzqz4.js} +2 -2
  305. package/dist/chunks/undercover-D1ieJ54D.js +1 -0
  306. package/dist/chunks/{undercover-CNlN7Xzl.js → undercover-DZq2Tf-o.js} +1 -1
  307. package/dist/chunks/{updateCCB-BWN4mOEz.js → updateCCB-Db3CfFcn.js} +1 -1
  308. package/dist/chunks/upgrade-B28O0zeQ.js +1 -0
  309. package/dist/chunks/{upgrade-CE25mJEk.js → upgrade-BZvNOhEJ.js} +1 -1
  310. package/dist/chunks/{upload-YpyOX2a-.js → upload-DAmbsBq4.js} +1 -1
  311. package/dist/chunks/{usage-Bw-kTwHb.js → usage-COv9UCxX.js} +1 -1
  312. package/dist/chunks/{usage-DNXwr_ep.js → usage-Dtv3YQf8.js} +1 -1
  313. package/dist/chunks/useMainLoopModel-BpM3dlzJ.js +1 -0
  314. package/dist/chunks/{useManagePlugins-hPG7UMWo.js → useManagePlugins-DZ-_Ll9E.js} +1 -1
  315. package/dist/chunks/useMergedTools-INKnp2ij.js +1 -0
  316. package/dist/chunks/{useSearchInput-CR9uhbA7.js → useSearchInput-DobM3JKI.js} +1 -1
  317. package/dist/chunks/useSettingsErrors-DjvaCC5-.js +1 -0
  318. package/dist/chunks/{useVoice-B5DQ5Tay.js → useVoice-exDfbv1t.js} +1 -1
  319. package/dist/chunks/{util-D_BHu06u.js → util-CDzNDmax.js} +1 -1
  320. package/dist/chunks/utils-B0iiiW_p.js +1 -0
  321. package/dist/chunks/validatePlugin-DaLnfLSC.js +1 -0
  322. package/dist/chunks/{vim-BGqKMQxl.js → vim-CPKu15l_.js} +1 -1
  323. package/dist/chunks/{voice-B2MWrkN3.js → voice-gNxUce-I.js} +2 -2
  324. package/dist/chunks/voiceModeEnabled-CwPbMJ9C.js +1 -0
  325. package/dist/chunks/{voiceModeEnabled-if9dV1bW.js → voiceModeEnabled-DEwGjUP6.js} +1 -1
  326. package/dist/chunks/voiceStreamSTT-6b3Oslnl.js +1 -0
  327. package/dist/chunks/{voiceStreamSTT-CWhKAxcp.js → voiceStreamSTT-BjX-mTB_.js} +1 -1
  328. package/dist/chunks/{workerRegistry-BANOcuS2.js → workerRegistry-Bc6t6VlK.js} +1 -1
  329. package/dist/chunks/worktree-NnuvJmoP.js +1 -0
  330. package/dist/chunks/{xml-DZp0WcWT.js → xml-Dg8-vY8G.js} +1 -1
  331. package/dist/cli.js +1 -1
  332. package/package.json +1 -1
  333. package/dist/chunks/ApproveApiKey-CBEOrsej.js +0 -1
  334. package/dist/chunks/BackgroundTasksDialog-ChDZ6M4c.js +0 -2
  335. package/dist/chunks/ClaudeMdExternalIncludesDialog-CG26Jg7h.js +0 -1
  336. package/dist/chunks/ConsoleOAuthFlow-1aq67dJV.js +0 -1
  337. package/dist/chunks/Doctor-ByQrTdef.js +0 -3
  338. package/dist/chunks/Doctor-DOil8Eh7.js +0 -1
  339. package/dist/chunks/Grove-CJn8QGFo.js +0 -1
  340. package/dist/chunks/MCPConnectionManager-BbGFGZTr.js +0 -1
  341. package/dist/chunks/MessageSelector-A-814zUi.js +0 -3
  342. package/dist/chunks/Messages-C4nIAGDL.js +0 -11
  343. package/dist/chunks/QueryEngine-CK9YRTZo.js +0 -1
  344. package/dist/chunks/REPL-DV96-Prr.js +0 -1
  345. package/dist/chunks/ResumeConversation-BTccgPK8.js +0 -1
  346. package/dist/chunks/SearchExtraToolsTool-CmyZbRut.js +0 -1
  347. package/dist/chunks/SentryErrorBoundary-B9sk4zvj.js +0 -1
  348. package/dist/chunks/Settings-D3Kpcb7q.js +0 -2
  349. package/dist/chunks/TeleportRepoMismatchDialog-BUeyIQCH.js +0 -1
  350. package/dist/chunks/api-DgzWK3bh.js +0 -1
  351. package/dist/chunks/assistant-Ojm6Wsb6.js +0 -1
  352. package/dist/chunks/auth-lQWhUjLX.js +0 -1
  353. package/dist/chunks/backgroundHousekeeping-BcLV1-Ap.js +0 -1
  354. package/dist/chunks/backgroundHousekeeping-KGRk7QeA.js +0 -17
  355. package/dist/chunks/bridgeConfig-ByjfIoJz.js +0 -1
  356. package/dist/chunks/bridgeEnabled-C7AI9y8g.js +0 -1
  357. package/dist/chunks/bridgeMain-B0fLyOLC.js +0 -68
  358. package/dist/chunks/bridgeMain-DKQ1u3k_.js +0 -1
  359. package/dist/chunks/caches-DbE9R4Zh.js +0 -1
  360. package/dist/chunks/changeDetector--9sSzU2e.js +0 -1
  361. package/dist/chunks/channelNotification-CLYOd2-R.js +0 -1
  362. package/dist/chunks/clear-Cf1D1WkR.js +0 -1
  363. package/dist/chunks/client-Bzn58Ea4.js +0 -1
  364. package/dist/chunks/color-DqtpdhFx.js +0 -1
  365. package/dist/chunks/commands-CJz20FMO.js +0 -1
  366. package/dist/chunks/commitAttribution-BgNel6QS.js +0 -1
  367. package/dist/chunks/compact-DLYic2Oa.js +0 -3
  368. package/dist/chunks/context-noninteractive-CzuLiIeO.js +0 -1
  369. package/dist/chunks/conversation-CLRfdC_V.js +0 -1
  370. package/dist/chunks/conversation-D2iFk7Te.js +0 -1
  371. package/dist/chunks/createSession-XhPMcSns.js +0 -1
  372. package/dist/chunks/crossProjectResume-BMWSw62A.js +0 -40
  373. package/dist/chunks/datadog-B5oHSyS1.js +0 -1
  374. package/dist/chunks/earlyInput-JGJo1zcC.js +0 -1
  375. package/dist/chunks/envLessBridgeConfig-DgdkC9jO.js +0 -1
  376. package/dist/chunks/exit-B-9k0zjK.js +0 -1
  377. package/dist/chunks/extra-usage-CsJ9Z2G1.js +0 -1
  378. package/dist/chunks/extractMemories-D34FfNYT.js +0 -1
  379. package/dist/chunks/fast-CxPB-PBH.js +0 -1
  380. package/dist/chunks/gates-D-kXXHiv.js +0 -1
  381. package/dist/chunks/gemini-BFBrPtVM.js +0 -1
  382. package/dist/chunks/grok-Dih61WOo.js +0 -1
  383. package/dist/chunks/hooks-Cw-F-1uO.js +0 -1
  384. package/dist/chunks/inboundAttachments-CZN_sUNx.js +0 -1
  385. package/dist/chunks/initReplBridge-D8sWx97P.js +0 -1
  386. package/dist/chunks/language-DB1HIsF8.js +0 -1
  387. package/dist/chunks/loadAgentsDir-DsskgPWe.js +0 -1
  388. package/dist/chunks/loadPluginHooks-DoFtrBWf.js +0 -1
  389. package/dist/chunks/localSearch-CScvVw0c.js +0 -1
  390. package/dist/chunks/login-FdPNsHJs.js +0 -1
  391. package/dist/chunks/logout-CulTqT7V.js +0 -1
  392. package/dist/chunks/mcp-BXPg0RPm.js +0 -1
  393. package/dist/chunks/mcp-iCbCqg7w.js +0 -6
  394. package/dist/chunks/mcp-yDWIJznG.js +0 -2
  395. package/dist/chunks/memory-B0YG4r65.js +0 -1
  396. package/dist/chunks/model-DG0v1297.js +0 -1
  397. package/dist/chunks/permissions-CYrv_WVH.js +0 -3
  398. package/dist/chunks/pluginBlocklist-BiRgxFei.js +0 -1
  399. package/dist/chunks/pluginOperations-B3gcFjVq.js +0 -2
  400. package/dist/chunks/pluginStartupCheck-Ga_XiMnA.js +0 -1
  401. package/dist/chunks/plugins-zHTS03v8.js +0 -4
  402. package/dist/chunks/policyLimits-Dsz-jkpD.js +0 -1
  403. package/dist/chunks/poorMode-BAuBNURJ.js +0 -1
  404. package/dist/chunks/print-DO52Fudu.js +0 -39
  405. package/dist/chunks/processBashCommand-DltW2Ubs.js +0 -1
  406. package/dist/chunks/processSlashCommand-JLJ_vF05.js +0 -6
  407. package/dist/chunks/prompt-D3rBUscf.js +0 -1
  408. package/dist/chunks/prompt-ohTcwieE.js +0 -1
  409. package/dist/chunks/rate-limit-options-OQt6LUP8.js +0 -1
  410. package/dist/chunks/refresh-TlNezXn4.js +0 -1
  411. package/dist/chunks/registry-m7JojEMY.js +0 -1
  412. package/dist/chunks/rename-CCF7A5mG.js +0 -1
  413. package/dist/chunks/sandbox-adapter-CQ0imVO1.js +0 -1
  414. package/dist/chunks/searchExtraTools-Ntz1u-YC.js +0 -1
  415. package/dist/chunks/sessionFileAccessHooks-DD2a-mTZ.js +0 -1
  416. package/dist/chunks/sessionMemory-BQP_RezB.js +0 -1
  417. package/dist/chunks/sessionMemory-hbxplpxs.js +0 -1
  418. package/dist/chunks/sessionMemoryUtils-DlW9hqOH.js +0 -1
  419. package/dist/chunks/sessionObserver-Lb1c5FPy.js +0 -1
  420. package/dist/chunks/sessionStorage-DG68Xvsy.js +0 -1
  421. package/dist/chunks/setup-lxzmZdw5.js +0 -2
  422. package/dist/chunks/sink-BdRlnpoG.js +0 -1
  423. package/dist/chunks/sinks-Bn0FK_Ab.js +0 -1
  424. package/dist/chunks/skillChangeDetector-4XWLpjQl.js +0 -1
  425. package/dist/chunks/skillLearning-702-D6Lq.js +0 -1
  426. package/dist/chunks/skillLearning-Cz7qU9V6.js +0 -1
  427. package/dist/chunks/statusNoticeHelpers-CwSCVvxP.js +0 -1
  428. package/dist/chunks/teamHelpers-CmDn2xyl.js +0 -1
  429. package/dist/chunks/teammateModeSnapshot-DXtG86pG.js +0 -1
  430. package/dist/chunks/teleport-CPB1CHBs.js +0 -1
  431. package/dist/chunks/thinkback-CF_sLFvX.js +0 -1
  432. package/dist/chunks/thinkback-D1Fv1QYl.js +0 -1
  433. package/dist/chunks/thinkback-play-syg_SJm8.js +0 -1
  434. package/dist/chunks/toolPool-C4CO158z.js +0 -1
  435. package/dist/chunks/toolPool-CRq0GSrk.js +0 -1
  436. package/dist/chunks/undercover-jZEIpxrJ.js +0 -1
  437. package/dist/chunks/upgrade-C_0-l0Zo.js +0 -1
  438. package/dist/chunks/useMainLoopModel-DPmF_cMn.js +0 -1
  439. package/dist/chunks/useMergedTools-BSO1NflP.js +0 -1
  440. package/dist/chunks/useSettingsErrors-453j5XuO.js +0 -1
  441. package/dist/chunks/utils--ZdihcLH.js +0 -1
  442. package/dist/chunks/validatePlugin-Dxm-5f8W.js +0 -1
  443. package/dist/chunks/voiceModeEnabled-0NU5pSM-.js +0 -1
  444. package/dist/chunks/voiceStreamSTT-yvcTWD7i.js +0 -1
  445. package/dist/chunks/worktree-CRn2SbHn.js +0 -1
  446. /package/dist/chunks/{InProcessTransport-DB52dh4f.js → InProcessTransport-gJLr5CIx.js} +0 -0
  447. /package/dist/chunks/{attributionHooks-PygdohOh.js → attributionHooks-Br5LZ6bk.js} +0 -0
  448. /package/dist/chunks/{attributionTrailer-BpvhXgRP.js → attributionTrailer-BMTuK4Ax.js} +0 -0
  449. /package/dist/chunks/{autoModeDenials-Cp6VFdsm.js → autoModeDenials-D8eQ1CoM.js} +0 -0
  450. /package/dist/chunks/{banner-CVXH2xts.js → banner-32EBTKI7.js} +0 -0
  451. /package/dist/chunks/{bedrockClient-qi1-JCOK.js → bedrockClient-Ci523Btx.js} +0 -0
  452. /package/dist/chunks/{ccshareResume-DWLjTF22.js → ccshareResume-CqNm2k-J.js} +0 -0
  453. /package/dist/chunks/{chromeNativeHost-4U39yLtd.js → chromeNativeHost-DX8f9Y2L.js} +0 -0
  454. /package/dist/chunks/{claudeDesktop-D0S1eq1F.js → claudeDesktop-C1qQs6os.js} +0 -0
  455. /package/dist/chunks/{cleanup-Bg_gFgcj.js → cleanup-Pv6U3HiI.js} +0 -0
  456. /package/dist/chunks/{connectHeadless-CwsFt-Mh.js → connectHeadless-DFCrE6O4.js} +0 -0
  457. /package/dist/chunks/{dangerousBackend-BU_PHGR2.js → dangerousBackend-Du0K4q5Z.js} +0 -0
  458. /package/dist/chunks/{earlyInput-tRkbxFv2.js → earlyInput-feVuZGzR.js} +0 -0
  459. /package/dist/chunks/{eventLoopStallDetector-Dnh1fc31.js → eventLoopStallDetector-XfubcyMN.js} +0 -0
  460. /package/dist/chunks/{fpsMetrics-DeezdcwV.js → fpsMetrics-CEQt6Tk1.js} +0 -0
  461. /package/dist/chunks/{fuse-Ch_OAlm3.js → fuse-TM-TeOo_.js} +0 -0
  462. /package/dist/chunks/{instinctParser-DHMa8xa0.js → instinctParser-CJPM8VjX.js} +0 -0
  463. /package/dist/chunks/{lockfile-DBwdlC3K.js → lockfile-Y1hwdHrQ.js} +0 -0
  464. /package/dist/chunks/{main-C6be1KFk.js → main-D9fUXJiD.js} +0 -0
  465. /package/dist/chunks/{observationStore-tvkldXUo.js → observationStore-gFvWXJmc.js} +0 -0
  466. /package/dist/chunks/{openaiShared-Bjrci9n8.js → openaiShared-Dy78YERG.js} +0 -0
  467. /package/dist/chunks/{output-style-XDb9-2Kk.js → output-style-BmEQscMd.js} +0 -0
  468. /package/dist/chunks/{parseConnectUrl-BS6i9JPo.js → parseConnectUrl-C6cvMkkH.js} +0 -0
  469. /package/dist/chunks/{poller-Ds0Y6Cir.js → poller-Dbo07OEA.js} +0 -0
  470. /package/dist/chunks/{postCommitAttribution-Ehmwzzuq.js → postCommitAttribution-DhFkZMxJ.js} +0 -0
  471. /package/dist/chunks/{projectContext-eXMSfgdZ.js → projectContext-iWPqcl0Z.js} +0 -0
  472. /package/dist/chunks/{renderOptions-BiyC2rj1.js → renderOptions-rmj4Mkls.js} +0 -0
  473. /package/dist/chunks/{rewind-CXplHgh_.js → rewind-DAn-nNs-.js} +0 -0
  474. /package/dist/chunks/{sanitization-CYp-9DbE.js → sanitization-JYRkZFrK.js} +0 -0
  475. /package/dist/chunks/{sdkHeapDumpMonitor--fevrC5z.js → sdkHeapDumpMonitor-DKtfJW5o.js} +0 -0
  476. /package/dist/chunks/{server-C5XZSlto.js → server-CswFAYwN.js} +0 -0
  477. /package/dist/chunks/{serverBanner-WlSYP-f8.js → serverBanner-CImTYGhY.js} +0 -0
  478. /package/dist/chunks/{serverLog-DtsUvDiY.js → serverLog-Bwt7XEmk.js} +0 -0
  479. /package/dist/chunks/{sessionDataUploader-Ctjo1bgR.js → sessionDataUploader-CKRXCBxI.js} +0 -0
  480. /package/dist/chunks/{sessionManager-Dw72ZUTg.js → sessionManager-Ca2O821f.js} +0 -0
  481. /package/dist/chunks/{stickers-2K05wjSp.js → stickers-BMh2qjgF.js} +0 -0
  482. /package/dist/chunks/{udsClient-BvG_Jip0.js → udsClient-BdPOrL1H.js} +0 -0
  483. /package/dist/chunks/{upstreamproxy-DcLeL2XX.js → upstreamproxy-Ci5T_JCo.js} +0 -0
  484. /package/dist/chunks/{voice-DXiiy8HX.js → voice-BcA5h8ya.js} +0 -0
@@ -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-D8Fx3kUi.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-BZbIj1Z1.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 +1 @@
1
- import{Jt as e,on as t}from"./paths-D8Fx3kUi.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-B0fLyOLC.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-BZbIj1Z1.js";import{L as n,V as r}from"./debug-UI3T040K.js";import{o as i,t as a}from"./bridgeMain-C-MUVlCX.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{Ct as e,Ot as t}from"./loadAgentsDir-DaApSWNv.js";t();export{e 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-D8Fx3kUi.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-BZbIj1Z1.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:(()=>{}),markResourceTiming:(()=>{}),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.10 (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-Do9XTs2J.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-DcSto-Od.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-BoXZIfxW.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-DnWYFpDc.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-BdRlnpoG.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-B5oHSyS1.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-CozFbFD9.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-CLYOd2-R.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.10`);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-BANOcuS2.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-DnWYFpDc.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-C7AI9y8g.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-DKQ1u3k_.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-CU6ArDos.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-ByjfIoJz.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-Dsz-jkpD.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-DnWYFpDc.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-Bn0FK_Ab.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-CZCZ9wlx.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-DnWYFpDc.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-DnWYFpDc.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-Bn0FK_Ab.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-BM98KAEH.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-BM98KAEH.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-DnWYFpDc.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-CRn2SbHn.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-Bv4AvaJk.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:(()=>{}),markResourceTiming:(()=>{}),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.12 (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-VYXTzAFl.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-DX8f9Y2L.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-d0863d94.js`);await e();return}if(process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-CYCQJU7M.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-Dh0QGc4B.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-BBn0HwoH.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-CTRRIaBJ.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-DeytNcUC.js`),{logForDebugging:s}=await import(`./chunks/debug-DM5ezCBS.js`),{ChannelPermissionRequestNotificationSchema:c}=await import(`./chunks/channelNotification-DxAS15nL.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.12`);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-Bc6t6VlK.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-Dh0QGc4B.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-Zk2slA-p.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-CQ1wrnQ0.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-L1ScqrgM.js`),{exitWithError:s}=await import(`./chunks/process-CWupreF6.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-yKNn60lZ.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-B1OTOi0O.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-Dl863Z85.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-Dh0QGc4B.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-C9CigqoF.js`);r();let{initSinks:i}=await import(`./chunks/sinks-DKGE2sSC.js`);i();let{daemonMain:a}=await import(`./chunks/main-D9fUXJiD.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-rMsykUYN.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-Dh0QGc4B.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-Dh0QGc4B.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-C9CigqoF.js`);i();let{initSinks:a}=await import(`./chunks/sinks-DKGE2sSC.js`);a();let{daemonMain:o}=await import(`./chunks/main-D9fUXJiD.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-fEz4DGWh.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-fEz4DGWh.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-Dh0QGc4B.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-THQb19xR.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-NnuvJmoP.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-RoVleNEN.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-wb2H0Xbt.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.10",
3
+ "version": "2.6.12",
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-CNBKF9de.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-D8Fx3kUi.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{AS as M,An as oe,BS as se,By as N,Cu as ce,Cy as P,Dn as le,Eh as ue,Eu as de,Fx as fe,Go as pe,Ja as me,Ku as he,LS as ge,Lo as _e,Lu as ve,Ly as ye,Mn as be,Nx as xe,Ny as Se,Oh as Ce,On as we,Ou as Te,Oy as Ee,Px as De,RS as Oe,Ru as ke,Rx as Ae,Ry as je,So as Me,Tg as Ne,Uw as Pe,Z_ as Fe,a_ as Ie,aa as Le,ap as Re,bu as ze,cp as Be,ev as Ve,hE as He,i_ as Ue,jS as We,lv as Ge,mE as Ke,mj as qe,nT as Je,op as Ye,pj as Xe,pv as Ze,qu as Qe,rT as $e,ra as et,sp as tt,tv as nt,wg as rt,wu as it,wy as F,zy as at}from"./loadAgentsDir-HZ19tmOZ.js";import{Bn as ot,Vn as st,Xt as ct,tn as lt,zn as ut}from"./prompt-BxoRdmaw.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-qcXgNBi5.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(),le(),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&&ke(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(!(!je(t)||process.env.USER_TYPE===`ant`&&Te(t))&&(n=!0,t.type!==`in_process_teammate`))return!1;return n}var Nt=t((()=>{i(),de(),ye(),ve()}));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=Me(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)(rt,{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(),_e(),Ne(),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:Xe(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=We().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(),M(),g(),ne(),qe(),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:N(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(),at(),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:N(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(),at(),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=Ve(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)(xe,{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)(xe,{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=Ve(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)(xe,{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)(xe,{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?[]:pe(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 Ze(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:Ve(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:Ve(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)(ue,{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(),nt(),S(),ct(),lt(),ft(),w(),j(),_t(),_e(),x(),Ge(),De(),Ce(),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=oe(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),Pe(),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(je).filter(e=>!(e.type===`local_agent`&&e.id===t))}function On({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=Oe(e=>e.tasks),i=Oe(e=>e.foregroundedTaskId),a=Oe(e=>e.expandedView)===`teammates`,o=se(),s=$e(`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);Ae(`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(je).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?Le(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 ze.kill(e,o)}async function A(e){await it.kill(e,o)}async function re(e){await Ee.kill(e,o)}async function ie(e){await tt.kill(e,o)}async function ae(e){await Fe.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`&&!je(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 Le(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`),N=O(x,e=>e.status===`running`||e.status===`pending`)+O(S,e=>e.status===`running`),ce=O(C,e=>e.status===`running`),P=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`)]:[],...N>0?[(0,Q.jsxs)(d,{children:[N,` `,N===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:P}),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=He();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),Ke(),Pe(),ge(),wt(),Be(),Se(),de(),ce(),nt(),ye(),ne(),mt(),et(),fe(),g(),I(),Je(),It(),Jt(),Zt(),en(),fn(),_n(),Q=v(),jn=(Cn(),e(bn)).WorkflowDetailDialog,Mn=(Ye(),e(Re)),Nn=Mn?.killWorkflowTask??null,Pn=Mn?.skipWorkflowAgent??null,Fn=Mn?.retryWorkflowAgent??null,$=(Ie(),e(Ue))?.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{n as e,t}from"./ClaudeMdExternalIncludesDialog-DBfmH_dG.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{_y as e,vy as t}from"./loadAgentsDir-HZ19tmOZ.js";t();export{e as ConsoleOAuthFlow};
@@ -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 ee}from"./state-sIHsFpDu.js";import{Dr as m,Ka as te,Po as h,Pr as g,Ro as _,Vo as v,al as y,cr as b,dr as x,el as S,jo as C,oo as w}from"./paths-D8Fx3kUi.js";import{BA as T,CT as E,Dk as D,Gb as ne,Gm as re,Jb as ie,Jm as O,Kb as ae,Km as oe,LS as se,Qf as ce,RS as k,ST as le,TT as ue,Tk as de,Uc as A,Wc as j,Xf as M,Ym as N,Zf as P,al as F,cT as I,dT as L,il as R,lT as z,qb as B,qm as V,sA as H,uA as U,uT as fe,wT as pe,wk as me,xT as W,xk as G,zA as he}from"./loadAgentsDir-HZ19tmOZ.js";import{t as ge}from"./useKeybinding-FsOnjW6T.js";import{l as _e,u as ve}from"./referral-BsAvaATn.js";import{a as ye,i as be}from"./xdg-CBxMmQux.js";import{n as xe,t as Se}from"./McpParsingWarnings-DW0d9Lsb.js";import{n as Ce,t as we}from"./PressEnterToContinue-BdA9zDGs.js";import{n as Te,t as Ee}from"./ValidationErrorsList-BHCepjdO.js";import{n as De,t as Oe}from"./useSettingsErrors-453j5XuO.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-Zqp1M5St.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-CwSCVvxP.js";import{join as q}from"path";function Ne(){if(!L())return null;let e=I();if(e.length===0)return null;let t=e.filter(e=>e.severity===`error`),n=e.filter(e=>e.severity===`warning`);return(0,J.jsxs)(d,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(s,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`Location: `}),(0,J.jsx)(s,{dimColor:!0,children:z()})]}),(0,J.jsxs)(d,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(d,{flexDirection:`column`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`└ `}),(0,J.jsx)(s,{color:`error`,children:`[Error]`}),(0,J.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(d,{marginLeft:3,children:(0,J.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(d,{flexDirection:`column`,children:[(0,J.jsxs)(d,{children:[(0,J.jsx)(s,{dimColor:!0,children:`└ `}),(0,J.jsx)(s,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(s,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(d,{marginLeft:3,children:(0,J.jsxs)(s,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{o(),u(),fe(),J=f()}));function Fe(){if(!H.isSupportedPlatform()||!H.isSandboxEnabledInSettings())return null;let e=H.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(d,{flexDirection:`column`,children:[(0,Y.jsx)(s,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(s,{children:[`└ Status: `,(0,Y.jsx)(s,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(s,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(s,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(s,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{o(),u(),U(),Y=f()}));async function Le(){let e=me(await de());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 > ${G.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${G.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:G}}async function X(e){if(!e)return null;let t=je(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 > ${K.toLocaleString()})`,details:r,currentValue:t,threshold:K}}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 R(e,t,n,m());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=Ae(await e(),{sandboxAutoAllowEnabled:H.isSandboxingEnabled()&&H.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${v(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${h(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([Le(),X(t),Re(e,n,t),ze(n)]);return{claudeMdWarning:r,agentWarning:i,mcpWarning:a,unreachableRulesWarning:o}}var Z,Ve=e((()=>{A(),F(),D(),g(),_(),ke(),U(),Me(),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=k(e=>e.agentDefinitions),r=k(e=>e.mcp.tools),i=k(e=>e.toolPermissionContext),o=k(e=>e.plugins.errors);ve();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[m,h]=(0,Q.useState)(null),[g,_]=(0,Q.useState)(null),[v,x]=(0,Q.useState)(null),S=De(),C=(0,Q.useMemo)(()=>W().then(e=>(e.installationType===`native`?E:pe)().catch(()=>({latest:null,stable:null}))),[]),w=te()?.autoUpdatesChannel??`latest`,T=S.filter(e=>e.mcpErrorMetadata===void 0),D=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:re,upperLimit:oe},{name:`TASK_MAX_OUTPUT_LENGTH`,default:M,upperLimit:P},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...b(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=N(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{W().then(p),(async()=>{let e=q(n(),`agents`),r=q(ee(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([y(e),y(r)]);if(h({activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s}),_(await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i)),ie()){let e=q(be(),`claude`,`locks`),t=ne(e);x({enabled:!0,locks:ae(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)(Ee,{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)(Fe,{}),(0,$.jsx)(Se,{}),(0,$.jsx)(Ne,{}),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))]}),v?.enabled&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Version Locks`}),v.staleLocksCleaned>0&&(0,$.jsxs)(s,{dimColor:!0,children:[`└ Cleaned `,v.staleLocksCleaned,` stale lock(s)`]}),v.locks.length===0?(0,$.jsx)(s,{dimColor:!0,children:`└ No active version locks`}):v.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))]}),m?.failedFiles&&m.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 `,m.failedFiles.length,` agent file(s):`]}),m.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}]`:``,`: `,he(e)]},t))]}),g?.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,` `,g.unreachableRulesWarning.message]})]}),g.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g&&(g.claudeMdWarning||g.agentWarning||g.mcpWarning)&&(0,$.jsxs)(d,{flexDirection:`column`,children:[(0,$.jsx)(s,{bold:!0,children:`Context Usage Warnings`}),g.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.claudeMdWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Files:`]}),g.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.agentWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ Top contributors:`]}),g.agentWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]}),g.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(s,{children:[`└`,` `,(0,$.jsxs)(s,{color:`warning`,children:[a.warning,` `,g.mcpWarning.message]})]}),(0,$.jsxs)(s,{children:[` `,`└ MCP servers:`]}),g.mcpWarning.details.map((e,t)=>(0,$.jsxs)(s,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(d,{children:(0,$.jsx)(we,{})})]}):(0,$.jsx)(l,{children:(0,$.jsx)(s,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(o(),1),Pe(),xe(),x(),r(),p(),u(),Ce(),Ie(),Te(),Oe(),_e(),ge(),se(),T(),ue(),Ve(),le(),O(),S(),B(),w(),V(),ce(),ye(),$=f()}));export{We as n,Ue as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-ByQrTdef.js";e();export{t as Doctor};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove-CnHyPepC.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 te}from"./paths-D8Fx3kUi.js";import{E as v,L as y,V as b,d as ne,s as x,w as S}from"./debug-UI3T040K.js";import{n as re,r as C}from"./analytics-DqMQntaB.js";import{c as w,l as T,o as ie}from"./log-CzsijfHZ.js";import{BS as E,Ex as D,FS as ae,LS as oe,Ox as O,PS as se,RS as k,Sw as ce,Sx as A,Tx as j,UC as le,YC as ue,bw as M,cw as de,dC as fe,dw as N,gw as P,hw as pe,jx as F,kx as me,lw as he,mO as I,nw as L,sw as R,uC as ge,ww as _e,wx as z,xO as ve,xw as ye,zS as be}from"./loadAgentsDir-HZ19tmOZ.js";import{o as xe,s as Se}from"./localSearch-4cz5ia5a.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-d08DSK9u.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=v(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((()=>{S(),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=be(),r=k(e=>e.authVersion),s=k(e=>e.mcp.pluginReconnectKey),c=E(),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}=ae(),g=(0,K.useRef)([]),_=(0,K.useRef)(null),v=(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=te(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=>le(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]),b=(0,K.useCallback)(e=>{g.current.push(e),_.current===null&&(_.current=setTimeout(v,16))},[v]),x=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(b({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:{fe(e.client,e.name,c),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(A(e.name,e.config).catch(()=>{ne(`Failed to invalidate the server cache: ${e.name}`)}),P(e.name)){w(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=Le(t);w(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(P(e.name)){w(e.name,`Server disabled during reconnection, stopping retry`),u.current.delete(e.name);return}b({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await F(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){w(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),u.current.delete(e.name),x(i);return}if(w(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){w(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),x(i);return}}catch(i){let a=Date.now()-r;if(T(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){w(e.name,`Max reconnection attempts (${J}) reached, giving up`),u.current.delete(e.name),b({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);w(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 b({...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`)&&C(`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`:w(e.name,`Channel notifications registered`),e.client.setNotificationHandler(De(),async t=>{let{content:i,meta:a}=t.params;w(e.name,`notifications/claude/channel: ${i.slice(0,80)}`),C(`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}),I({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;w(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),w(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()=>{w(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=D.cache.get(e.name);D.cache.delete(e.name);let n=await D(e),r=n.length;t?t.then(e=>{C(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{C(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):C(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),b({...e,tools:n})}catch(t){T(e.name,`Failed to refresh tools after list_changed notification: ${y(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(i,async()=>{w(e.name,`Received prompts/list_changed notification, refreshing prompts`),C(`tengu_mcp_list_changed`,{type:`prompts`});try{z.cache.delete(e.name);let[t,n]=await Promise.all([z(e),Promise.resolve([])]);b({...e,commands:[...t,...n]}),q?.()}catch(t){T(e.name,`Failed to refresh prompts after list_changed notification: ${y(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(a,async()=>{w(e.name,`Received resources/list_changed notification, refreshing resources`),C(`tengu_mcp_list_changed`,{type:`resources`});try{j.cache.delete(e.name);{let t=await j(e);b({...e,resources:t})}}catch(t){T(e.name,`Failed to refresh resources after list_changed notification: ${y(t)}`)}});break}case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[b]),S=l();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await N(e),i={...n,...e};G(c,r),c(e=>{let{stale:t,...n}=ue(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,A(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:P(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=>{T(`useManageMCPConnections`,`Failed to initialize servers as pending: ${y(e)}`)})},[t,e,c,S,s]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||de()?r=Promise.resolve({}):(ye(),r=ce());let{servers:i,errors:a}=t?{servers:{},errors:[]}:await N(e,r);if(n)return;G(c,a);let o={...i,...e};O(x,Object.fromEntries(Object.entries(o).filter(([e])=>!P(e)))).catch(e=>{T(`useManageMcpConnections`,`Failed to get MCP resources: ${y(e)}`)});let s={};if(!t){if(s=he(await r).allowed,n)return;if(Object.keys(s).length>0){let{servers:e}=R(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:P(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}}),O(x,Object.fromEntries(Object.entries(s).filter(([e])=>!P(e)))).catch(e=>{T(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${y(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`&&!P(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&d.push(Ae(t.command));C(`tengu_mcp_servers`,{...u,...process.env.USER_TYPE===`ant`&&d.length>0?{stdio_commands:d.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,x,c,r,S,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,v())}},[v]),{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 F(e,t.config);return x(i),i},[n,x]),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)),M(e,!1),t.type===`connected`&&await A(e,t.config),b({name:e,type:`disabled`,config:t.config})}else M(e,!0),b({name:e,type:`pending`,config:t.config}),x(await F(e,t.config))},[n,b,x])}}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(),me(),r(),g(),m(),re(),pe(),x(),se(),oe(),b(),ie(),ve(),Ce(),U(),_e(),ge(),_(),L(),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-D8Fx3kUi.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{BO as se,Dc as P,Ec as ce,Eo as F,GE as le,KE as ue,LS as de,Lo as I,Nx as fe,Px as pe,RO as L,RS as me,Rc as R,So as z,Sy as B,Ui as he,Uo as ge,Uw as _e,VO as ve,Vi as ye,Vo as be,Xi as xe,_o as Se,aC as Ce,an as we,bo as V,by as Te,ey as Ee,fo as De,hn as Oe,iu as H,kc as ke,la as Ae,nu as je,ny as Me,os as Ne,sC as Pe,sy as Fe,ty as Ie,yn as Le,zc as Re,zo as ze}from"./loadAgentsDir-HZ19tmOZ.js";import{E as Be,T as Ve,c as He,d as Ue,w as We}from"./sessionTracing-Da_r0mIc.js";import{t as Ge}from"./useKeybinding-FsOnjW6T.js";import{l as Ke,u as qe}from"./referral-BsAvaATn.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(),se(),We(),le(),Ce(),He(),je(),R(),ke(),Ne(),I(),xe(),Le(),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(),I();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=F(e)||``;for await(let t of we(x,y.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[Se(`${Oe(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(ce({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 ve(n);if(e.dimensions){let t=L(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 ve(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=L(e.dimensions,n);t&&b.push(t)}else if(t){let e=L(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?ye(e.commandName,r.options.commands):void 0;if(t){let n=he(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}),De(`<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-JLJ_vF05.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 ue(P(v,r,a??null,[],o,l)):[];if(H(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-DltW2Ubs.js`);return J(await e(v,y,A,r,n),b)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-JLJ_vF05.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.10`,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:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function Y(e){return e.type===`text`}function X(e){return e===`summarize`||e===`summarize_up_to`}function ut({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:a,onClose:o,preselectedMessage:u}){let p=me(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=Ie(),_=(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 Me(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 Me(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(X(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(),le=(0,Q.useCallback)(()=>{if(C&&!u){w(void 0);return}D(`tengu_message_selector_cancelled`,{}),o()},[o,C,u]),ue=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),de=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),I=(0,Q.useCallback)(()=>b(0),[]),pe=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),L=(0,Q.useCallback)(()=>{let e=v[y];e&&P(e)},[v,y,P]);d(`confirm:no`,le,{context:`Confirmation`,isActive:!C}),l({"messageSelector:up":ue,"messageSelector:down":de,"messageSelector:top":I,"messageSelector:bottom":pe,"messageSelector:select":L},{context:`MessageSelector`,isActive:!O&&!m&&!C&&S});let[R,z]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=Ee(p,t.uuid),i=v.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;z(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,he=!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)(ft,{selectedRestoreOption:ee,canRestoreCode:!!B,diffStatsForRestore:T}),O&&X(A)?(0,G.jsxs)(f,{flexDirection:`row`,gap:1,children:[(0,G.jsx)(Te,{}),(0,G.jsx)(s,{children:`Summarizing…`})]}):(0,G.jsx)(fe,{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.`]})})]}),he&&(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 R,c=R[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)(mt,{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 dt(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 ft({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:dt(e)}),!X(e)&&(r?(0,G.jsx)(pt,{diffStatsForRestore:n}):(0,G.jsx)(s,{dimColor:!0,children:`The code will be unchanged.`}))]})}function pt({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)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({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&&Y(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=z(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=z(u,A),r=z(u,`command-args`),i=z(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||!ge(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`||be(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&&Y(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&&!be(t)&&!ge(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(),de(),Fe(),Ke(),Ge(),I(),pe(),B(),_e(),$=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,ut as t,Qe as u};
@@ -1,11 +0,0 @@
1
- import{a as e,n as t,o as n,r}from"./chunk-DR8-3Aex.js";import{s as i,u as a}from"./envUtils-BWeoiL4Y.js";import{n as o,t as s}from"./figures-gfT9mM8P.js";import{B as c,Cn as l,F as u,Ft as d,In as f,Ln as p,Lt as m,Rn as h,W as g,b as _,m as v,t as y,v as b,x,y as S}from"./src-Di342QoJ.js";import{t as C}from"./jsx-runtime-D-D469L8.js";import{L as w,W as T,cn as E,y as D}from"./state-sIHsFpDu.js";import{Ac as O,Gs as k,Gt as ee,Hs as te,Ht as A,Ka as ne,Ko as re,Lr as j,Pc as M,Po as N,Pr as P,S as ie,Sc as F,Ur as ae,Zc as I,dn as L,el as oe,g as R,jo as se,on as ce,oo as le,qo as ue,qt as de}from"./paths-D8Fx3kUi.js";import{c as fe,d as z,i as pe,l as me,s as he}from"./debug-UI3T040K.js";import{n as ge,r as B}from"./analytics-DqMQntaB.js";import{n as _e,t as ve}from"./cwd--iizewsn.js";import{a as ye,n as be}from"./env-chR0gV31.js";import{H as V,V as xe,W as Se,et as Ce}from"./log-CzsijfHZ.js";import{C as we,g as Te,m as Ee,n as De,r as Oe,t as ke,x as Ae}from"./startupProfiler-DnXZaX4A.js";import{n as je,t as Me}from"./sleep-8Eb9j_Ly.js";import{$A as Ne,$o as Pe,$w as Fe,$x as Ie,Ah as Le,Ao as Re,Bg as ze,Bo as Be,Cu as Ve,Dh as He,Dk as Ue,Dv as We,Eh as Ge,Es as Ke,Ev as qe,Fu as Je,Go as Ye,Hx as Xe,Io as Ze,Iu as Qe,Jo as $e,Jw as et,LS as tt,Lo as nt,Lu as rt,MD as it,Mo as at,Ms as ot,Mu as st,Ng as ct,Nu as lt,Oh as ut,Oo as dt,Pg as ft,Pu as pt,Qg as mt,Qw as ht,Qy as gt,RS as _t,So as vt,Tk as yt,Uw as bt,Vg as xt,Vx as St,Wx as Ct,Xa as wt,Xw as Tt,Ya as Et,Yo as Dt,Za as Ot,Zg as kt,Zw as At,Zx as jt,cx as Mt,eT as Nt,hw as Pt,io as Ft,ix as It,jD as Lt,jo as Rt,kh as zt,ko as Bt,lo as Vt,nT as Ht,nx as Ut,pw as Wt,px as Gt,rT as Kt,rj as qt,ro as Jt,sA as Yt,uA as Xt,vx as Zt,wk as Qt,xk as $t,xo as en,yx as tn}from"./loadAgentsDir-HZ19tmOZ.js";import{Vn as nn,zn as rn}from"./prompt-BxoRdmaw.js";import{f as an,p as on}from"./xml-DZp0WcWT.js";import{C as sn,y as cn}from"./rcDebugLog-5XEbz_Yg.js";import{n as ln,r as un,t as dn}from"./browser-fLRXxIsQ.js";import{d as fn,f as pn,h as mn,p as hn}from"./terminalSetup-CGiIwoIX.js";import{a as gn,o as _n,r as vn,s as yn,t as bn}from"./referral-BsAvaATn.js";import{n as xn,t as Sn}from"./SentryErrorBoundary-BK2HjzVw.js";import{a as Cn,n as wn}from"./voiceModeEnabled-if9dV1bW.js";import{c as Tn,r as En}from"./releaseNotes-Bd3zxid3.js";import{a as Dn,c as On,d as kn,i as An,l as jn,n as Mn,o as Nn,r as Pn,t as Fn,u as In}from"./logoV2Utils-jaFn88oE.js";import{n as Ln,t as Rn}from"./systemTheme-dDbitcxB.js";import{n as zn,r as Bn}from"./PromptInputFooterSuggestions-BrpVQJVn.js";import{n as Vn,t as Hn}from"./useMainLoopModel-DPmF_cMn.js";import{n as Un,t as Wn}from"./modalContext-CmSKRyea.js";import{i as Gn,n as Kn,r as qn,s as Jn,t as Yn}from"./OverageCreditUpsell-DEZsyI6y.js";import{n as Xn,r as Zn,t as Qn}from"./statusNoticeHelpers-CwSCVvxP.js";import{homedir as $n}from"os";import{relative as er}from"path";import{fileURLToPath as tr}from"url";function nr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var rr=t((()=>{}));function ir(e){if(e.type!==`user`)return!1;let t=Array.isArray(e.message.content)?e.message.content[0]:void 0;return!t||typeof t==`string`||t?.type!==`text`||!t.text.includes(`<task-notification`)||vt(t.text,`status`)!==`completed`?!1:vt(t.text,`summary`)?.startsWith(`Background command `)??!1}function ar(e,t){if(!Ie()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(ir(t)){let i=0;for(;r<e.length&&ir(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${Se}><${xe}>completed</${xe}><${V}>${i} background commands completed</${V}></${Se}>`}]}})}else n.push(t),r++}return n}var or=t((()=>{Ce(),Ve(),jt(),nt()}));function sr(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function cr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(sr(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!sr(t)||t.hookLabel!==i)break;a.push(t),n++}a.length===1?t.push(r):t.push({...r,hookCount:a.reduce((e,t)=>e+t.hookCount,0),hookInfos:a.flatMap(e=>e.hookInfos),hookErrors:a.flatMap(e=>e.hookErrors),preventedContinuation:a.some(e=>e.preventedContinuation),hasOutput:a.some(e=>e.hasOutput),totalDurationMs:Math.max(...a.map(e=>e.totalDurationMs??0))})}else t.push(r),n++}return t}var lr=t((()=>{}));function ur(e){return e.type===`attachment`&&e.attachment.type===`task_status`&&e.attachment.taskType===`in_process_teammate`&&e.attachment.status===`completed`}function dr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(ur(r)){let i=0;for(;n<e.length&&ur(e[n]);)i++,n++;i===1?t.push(r):t.push({type:`attachment`,uuid:r.uuid,timestamp:r.timestamp,attachment:{type:`teammate_shutdown_batch`,count:i}})}else t.push(r),n++}return t}var fr=t((()=>{}));function pr(e){let t=gr.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),gr.set(e,t)),t}function mr(e){if(e.type===`assistant`&&e.message?.content&&Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_use`){let t=e.message.content[0];return{messageId:e.message.id,toolUseId:t.id,toolName:t.name}}return null}function hr(e,t,n=!1){if(n)return{messages:e};let r=pr(t),i=new Map;for(let t of e){let e=mr(t);if(e&&r.has(e.toolName)){let n=`${e.messageId}:${e.toolName}`,r=i.get(n)??[];r.push(t),i.set(n,r)}}let a=new Map,o=new Set;for(let[e,t]of i)if(t.length>=2){a.set(e,t);for(let e of t){let t=mr(e);t&&o.add(t.toolUseId)}}let s=new Map;for(let t of e)if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content))for(let e of t.message.content)e.type===`tool_result`&&o.has(e.tool_use_id)&&s.set(e.tool_use_id,t);let c=[],l=new Set;for(let t of e){let e=mr(t);if(e){let t=`${e.messageId}:${e.toolName}`,n=a.get(t);if(n){if(!l.has(t)){l.add(t);let r=n[0],i=[];for(let e of n){let t=e.message.content[0].id,n=s.get(t);n&&i.push(n)}let a={type:`grouped_tool_use`,toolName:e.toolName,messages:n,results:i,displayMessage:r,uuid:`grouped-${r.uuid}`,timestamp:r.timestamp,messageId:e.messageId};c.push(a)}continue}}if(t.type===`user`&&t.message?.content&&Array.isArray(t.message.content)){let e=t.message.content.filter(e=>e.type===`tool_result`);if(e.length>0&&e.every(e=>o.has(e.tool_use_id)))continue}c.push(t)}return{messages:c}}var gr,_r=t((()=>{gr=new WeakMap}));function vr(e){let t=wr.get(e);if(t!==void 0)return t;let n=yr(e).toLowerCase();return wr.set(e,n),n}function yr(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Cr.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Cr.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(xr(e.toolUseResult));t=r.join(`
2
- `)}break}case`assistant`:{let n=e.message.content;Array.isArray(n)&&(t=n.flatMap(e=>e.type===`text`?[e.text]:e.type===`tool_use`?[br(e.input)]:[]).join(`
3
- `));break}case`attachment`:if(e.attachment.type===`relevant_memories`)t=(e.attachment.memories??[]).map(e=>e.content).join(`
4
- `);else if(e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text]:[]).join(`
5
- `)}break;case`collapsed_read_search`:e.relevantMemories&&(t=e.relevantMemories.map(e=>e.content).join(`
6
- `));break;default:break}let n=t,r=n.indexOf(`<system-reminder>`);for(;r>=0;){let e=n.indexOf(Sr,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function br(e){if(!e||typeof e!=`object`)return``;let t=e,n=[];for(let e of[`command`,`pattern`,`file_path`,`path`,`prompt`,`description`,`query`,`url`,`skill`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`args`,`files`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(` `))}return n.join(`
7
- `)}function xr(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
8
- `+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
9
- `))}return n.join(`
10
- `)}var Sr,Cr,wr,Tr=t((()=>{nt(),Sr=`</system-reminder>`,Cr=new Set([wt,Ot]),wr=new WeakMap}));function Er({pose:e=`default`}={}){if(be.terminal===`Apple_Terminal`)return(0,H.jsx)(Dr,{pose:e});let t=Or[e];return(0,H.jsxs)(x,{flexDirection:`column`,children:[(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:t.r1L}),(0,H.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,H.jsx)(_,{color:`clawd_body`,children:t.r1R})]}),(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:t.r2L}),(0,H.jsx)(_,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,H.jsx)(_,{color:`clawd_body`,children:t.r2R})]}),(0,H.jsxs)(_,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Dr({pose:e}){return(0,H.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,H.jsxs)(_,{children:[(0,H.jsx)(_,{color:`clawd_body`,children:`▗`}),(0,H.jsx)(_,{color:`clawd_background`,backgroundColor:`clawd_body`,children:kr[e]}),(0,H.jsx)(_,{color:`clawd_body`,children:`▖`})]}),(0,H.jsx)(_,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,H.jsx)(_,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var H,Or,kr,Ar=t((()=>{h(),y(),ye(),H=C(),Or={default:{r1L:` ▐`,r1E:`▛███▜`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-left":{r1L:` ▐`,r1E:`▟███▟`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"look-right":{r1L:` ▐`,r1E:`▙███▙`,r1R:`▌`,r2L:`▝▜`,r2R:`▛▘`},"arms-up":{r1L:`▗▟`,r1E:`▛███▜`,r1R:`▙▖`,r2L:` ▜`,r2R:`▛ `}},kr={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function jr(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=l(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,l(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?l(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=l(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,l(r))),o}function Mr({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?l(e.timestamp):0));return(0,U.jsxs)(x,{flexDirection:`column`,width:t,children:[(0,U.jsx)(_,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(_,{dimColor:!0,italic:!0,children:we(i,t)})]}):r.length===0&&a?(0,U.jsx)(_,{dimColor:!0,children:we(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(_,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(_,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(_,{children:we(e.text,r)})]},n)}),i&&(0,U.jsx)(_,{dimColor:!0,italic:!0,children:we(i,t)})]})]})}var U,Nr=t((()=>{h(),y(),Ae(),U=C()}));function Pr({feeds:e,maxWidth:t}){let n=e.map(e=>jr(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Ir.jsx)(x,{flexDirection:`column`,children:e.map((t,n)=>(0,Ir.jsxs)(Fr.Fragment,{children:[(0,Ir.jsx)(Mr,{config:t,actualWidth:i}),n<e.length-1&&(0,Ir.jsx)(v,{color:`claude`,width:i})]},n))})}var Fr,Ir,Lr=t((()=>{Fr=n(h(),1),y(),Nr(),Ir=C()}));function Rr(e){let t=e.map(e=>{let t=Te(e.modified);return{text:(e.summary&&e.summary!==`No prompt`?e.summary:e.firstPrompt)||``,timestamp:t}});return{title:`Recent activity`,lines:t,footer:t.length>0?`/resume for more`:void 0,emptyMessage:`No recent activity`}}function zr(e){let t=e.map(e=>{if(process.env.USER_TYPE===`ant`){let t=e.match(/^(\d+\s+\w+\s+ago)\s+(.+)$/);if(t)return{timestamp:t[1],text:t[2]||``}}return{text:e}}),n=process.env.USER_TYPE===`ant`?`Unable to fetch latest claude-cli-internal commits`:`Check the Claude Code changelog for updates`;return{title:process.env.USER_TYPE===`ant`?`What's new [ANT-ONLY: Latest CC commits]`:`What's new`,lines:t,footer:t.length>0?`/release-notes for more`:void 0,emptyMessage:n}}function Br(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${s.tick} `:``}${e}`})),n=ve()===$n()?`Note: You have launched claude in your home directory. For the best experience, launch it in a project directory instead.`:void 0;return n&&t.push({text:n}),{title:`Tips for getting started`,lines:t}}function Vr(){let e=gn(),t=e?`Share Claude Code and earn ${vn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Hr.jsxs)(Hr.Fragment,{children:[(0,Hr.jsx)(x,{marginY:1,children:(0,Hr.jsx)(_,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Hr.jsx)(_,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Hr,Ur=t((()=>{o(),y(),yn(),_e(),Ae(),Hr=C()}));function Wr(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Gr(){let{pose:e,bounceOffset:t,onClick:n}=Kr();return(0,Jr.jsx)(x,{height:ei,flexDirection:`column`,onClick:n,children:(0,Jr.jsx)(x,{marginTop:t,flexShrink:0,children:(0,Jr.jsx)(Er,{pose:e})})})}function Kr(){let[e]=(0,qr.useState)(()=>ne().prefersReducedMotion??!1),[t,n]=(0,qr.useState)(-1),r=(0,qr.useRef)(Yr),i=()=>{e||t!==-1||(r.current=Xr[Math.floor(Math.random()*Xr.length)],n(0))};(0,qr.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Qr,$r);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Zr;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti=t((()=>{h(),qr=n(h(),1),y(),le(),Ar(),Jr=C(),Yr=[...Wr(`default`,1,2),...Wr(`arms-up`,0,3),...Wr(`default`,0,1),...Wr(`default`,1,2),...Wr(`arms-up`,0,3),...Wr(`default`,0,1)],Xr=[Yr,[...Wr(`look-right`,0,5),...Wr(`look-left`,0,5),...Wr(`default`,0,1)]],Zr={pose:`default`,offset:0},Qr=60,$r=e=>e+1,ei=3}));function ni(){let e=_n();e==null||e<=0||e>(F().passesLastSeenRemaining??0)&&M(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function ri(){let{eligible:e,hasCache:t}=bn();if(!e||!t)return!1;ni();let n=F();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function ii(){let[e]=(0,si.useState)(()=>ri());return e}function ai(){let e=0;M(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),B(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function oi(){let e=gn();return(0,ci.jsxs)(_,{dimColor:!0,children:[(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` `,(0,ci.jsx)(_,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${vn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var si,ci,li=t((()=>{h(),si=n(h(),1),y(),ge(),yn(),O(),ci=C()}));function ui(){let{columns:e}=u(),t=_t(e=>e.agent),n=_t(e=>e.effortValue),r=Vn(),i=ae(r),{version:a,cwd:o,billingType:s,agentName:c}=Nn(),d=t??c,f=ii(),p=Jn();(0,di.useEffect)(()=>{f&&ai()},[f]),(0,di.useEffect)(()=>{p&&!f&&qn()},[p,f]);let m=Math.max(e-15,20),h=we(a,Math.max(m-13,6)),{shouldSplit:g,truncatedModel:v,truncatedBilling:y}=Pn(i+Ne(r,n),s,m),b=d?m-1-l(d)-3:m,S=kn(o,Math.max(b,10));return(0,W.jsx)(zt,{children:(0,W.jsxs)(x,{flexDirection:`row`,gap:2,alignItems:`center`,children:[Ie()?(0,W.jsx)(Gr,{}):(0,W.jsx)(Er,{}),(0,W.jsxs)(x,{flexDirection:`column`,children:[(0,W.jsxs)(_,{children:[(0,W.jsx)(_,{bold:!0,children:`Claude Code`}),` `,(0,W.jsxs)(_,{dimColor:!0,children:[`v`,h]})]}),g?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(_,{dimColor:!0,children:v}),(0,W.jsx)(_,{dimColor:!0,children:y})]}):(0,W.jsxs)(_,{dimColor:!0,children:[v,` · `,y]}),(0,W.jsx)(_,{dimColor:!0,children:d?`@${d} · ${S}`:S}),f&&(0,W.jsx)(oi,{}),!f&&p&&(0,W.jsx)(Yn,{maxWidth:m,twoLine:!0})]})]})})}var di,W,fi=t((()=>{di=n(h(),1),Hn(),bt(),y(),tt(),qt(),Ae(),jt(),In(),P(),Le(),ti(),Ar(),li(),Gn(),W=C()}));function pi(){let e=(0,hi.useMemo)(mi,[]),t=(0,hi.useMemo)(()=>F().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,hi.useEffect)(()=>{n&&M(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,gi.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,gi.jsx)(_,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function mi(){return R(_i,vi)}var hi,gi,_i,vi,yi=t((()=>{h(),hi=n(h(),1),y(),ie(),O(),gi=C(),_i=`tengu-top-of-feed-tip`,vi={tip:``,color:`dim`}}));function bi({char:e=`✻`}){let[t]=(0,xi.useState)(()=>ne().prefersReducedMotion??!1),[n,r]=(0,xi.useState)(t),i=(0,xi.useRef)(null),[a,o]=c(n?null:50);return(0,xi.useEffect)(()=>{if(n)return;let e=setTimeout(r,wi,!0);return()=>clearTimeout(e)},[n]),n?(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:Ti,children:e})}):(i.current===null&&(i.current=o),(0,Si.jsx)(x,{ref:a,children:(0,Si.jsx)(_,{color:Ct(St((o-i.current)/Ci*360%360)),children:e})}))}var xi,Si,Ci,wi,Ti,Ei=t((()=>{h(),xi=n(h(),1),k(),y(),le(),Xe(),Si=C(),Ci=1500,wi=Ci*2,Ti=Ct({r:153,g:153,b:153})}));function Di(){return j()&&(F().opus1mMergeNoticeSeenCount??0)<ji}function Oi(){let[e]=(0,ki.useState)(Di);return(0,ki.useEffect)(()=>{if(!e)return;let t=(F().opus1mMergeNoticeSeenCount??0)+1;M(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Ai.jsxs)(x,{paddingLeft:2,children:[(0,Ai.jsx)(bi,{char:`↑`}),(0,Ai.jsx)(_,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ki,Ai,ji,Mi=t((()=>{h(),ki=n(h(),1),k(),y(),O(),P(),Ei(),Ai=C(),ji=6}));function Ni(){return(0,Ii.jsx)(Pi,{})}function Pi(){let[e]=(0,Fi.useState)(()=>Cn()&&ne().voiceEnabled!==!0&&(F().voiceNoticeSeenCount??0)<Li&&!Di());return(0,Fi.useEffect)(()=>{if(!e)return;let t=(F().voiceNoticeSeenCount??0)+1;M(e=>(e.voiceNoticeSeenCount??0)>=t?e:{...e,voiceNoticeSeenCount:t})},[e]),e?(0,Ii.jsxs)(x,{paddingLeft:2,children:[(0,Ii.jsx)(bi,{}),(0,Ii.jsx)(_,{dimColor:!0,children:` Voice mode is now available · /voice to enable`})]}):null}var Fi,Ii,Li,Ri=t((()=>{h(),Fi=n(h(),1),y(),O(),le(),wn(),Ei(),Mi(),Ii=C(),Li=3}));function zi(){return null}var Bi=t((()=>{}));function Vi(){return null}var Hi=t((()=>{})),Ui=r({ChannelsNotice:()=>Wi,findUnmatched:()=>Ki});function Wi(){let[{channels:e,list:t,unmatched:n}]=(0,qi.useState)(()=>{let e=D();return e.length===0?{channels:e,list:``,unmatched:[]}:{channels:e,list:e.map(Gi).join(`, `),unmatched:Ki(e)}});if(e.length===0)return null;let r=e.some(e=>!e.dev),i=w()&&r?`Channels`:w()?`--dangerously-load-development-channels`:`--channels`;return(0,Ji.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,Ji.jsxs)(_,{color:`error`,children:[`Listening for channel messages from: `,t]}),(0,Ji.jsxs)(_,{dimColor:!0,children:[`Experimental · inbound messages will be pushed into this session, this carries prompt injection risks. Restart Claude Code without `,i,` to disable.`]}),n.map(e=>(0,Ji.jsxs)(_,{color:`warning`,children:[Gi(e.entry),` · `,e.why]},`${Gi(e.entry)}:${e.why}`))]})}function Gi(e){return e.kind===`plugin`?`plugin:${e.name}@${e.marketplace}`:`server:${e.name}`}function Ki(e,t){let n=t?.configuredServerNames??(()=>{let e=[`enterprise`,`user`,`project`,`local`],t=new Set;for(let n of e)for(let e of Object.keys(Wt(n).servers))t.add(e);return t})(),r=t?.installedPluginIds??(()=>{let e=new Set(Object.keys(ot().plugins)),t=an();for(let n of[...t.enabled,...t.disabled])e.add(n.source);return e})(),i=[];for(let t of e){if(t.kind===`server`){n.has(t.name)||i.push({entry:t,why:`no MCP server configured with that name`});continue}r.has(`${t.name}@${t.marketplace}`)||i.push({entry:t,why:`plugin not installed`})}return i}var qi,Ji,Yi=t((()=>{h(),qi=n(h(),1),E(),on(),y(),Pt(),Ke(),Ji=C()}));function Xi(){let e=On(),t=F().oauthAccount?.displayName??``,{columns:n}=u(),r=mn(),i=Yt.isSandboxingEnabled(),o=ii(),s=Jn(),c=_t(e=>e.agent),d=_t(e=>e.effortValue),f=F(),p;try{p=jn(3)}catch{p=[]}let[m]=(0,Zi.useState)(()=>{let e=ne().companyAnnouncements;if(!(!e||e.length===0))return f.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:h}=En(f.lastReleaseNotesSeen);(0,Zi.useEffect)(()=>{F().lastReleaseNotesSeen!==`2.6.10`&&(M(e=>e.lastReleaseNotesSeen===`2.6.10`?e:{...e,lastReleaseNotesSeen:`2.6.10`}),r&&pn())},[f,r]);let g=!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Zi.useEffect)(()=>{o&&!r&&!g&&ai()},[o,r,g]),(0,Zi.useEffect)(()=>{s&&!r&&!o&&!g&&qn()},[s,r,o,g]);let v=Vn(),y=ae(v),{version:S,cwd:C,billingType:w,agentName:T}=Nn(),E=c??T,D=we(y+Ne(v,d),$i-20);if(!h&&!r&&!a(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ui,{}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),fe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,me()?`stderr`:pe()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,I(Lt())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,I(pe())]}),Oe()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,I(ke())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]});let O=Dn(n),k=Ln(F().theme),ee=` ${b(`claude`,k)(`Claude Code`)} ${b(`inactive`,k)(`v${S}`)} `,te=b(`claude`,k)(` Claude Code `);if(O===`compact`){let e=An(t);l(e)>n-4&&(e=An(null));let r=E?n-4-1-l(E)-3:n-4,a=kn(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(zt,{children:(0,G.jsxs)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:te,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(_,{bold:!0,children:e}),(0,G.jsx)(x,{marginY:1,children:(0,G.jsx)(Er,{})}),(0,G.jsx)(_,{dimColor:!0,children:D}),(0,G.jsx)(_,{dimColor:!0,children:w}),(0,G.jsx)(_,{dimColor:!0,children:E?`@${E} · ${a}`:a})]})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),i&&(0,G.jsx)(x,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}let A=An(t),re=!process.env.IS_DEMO&&f.oauthAccount?.organizationName?`${D} · ${w} · ${f.oauthAccount.organizationName}`:`${D} · ${w}`,j=E?$i-1-l(E)-3:$i,N=kn(C,Math.max(j,10)),P=E?`@${E} · ${N}`:N,{leftWidth:ie,rightWidth:L}=Fn(n,O,Mn(A,P,re));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(zt,{children:(0,G.jsx)(x,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:ee,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(x,{flexDirection:O===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(x,{flexDirection:`column`,width:ie,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(x,{marginTop:1,children:(0,G.jsx)(_,{bold:!0,children:A})}),(0,G.jsx)(Er,{}),(0,G.jsxs)(x,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(_,{dimColor:!0,children:re}),(0,G.jsx)(_,{dimColor:!0,children:P})]})]}),O===`horizontal`&&(0,G.jsx)(x,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),O===`horizontal`&&(0,G.jsx)(Pr,{feeds:r?[Br(fn()),Rr(e)]:o?[Rr(e),Vr()]:s?[Rr(e),Kn()]:[Rr(e),zr(p)],maxWidth:L})]})})}),(0,G.jsx)(Ni,{}),(0,G.jsx)(Oi,{}),Qi&&(0,G.jsx)(Qi.ChannelsNotice,{}),fe()&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(_,{dimColor:!0,children:[`Logging to: `,me()?`stderr`:pe()]})]}),(0,G.jsx)(pi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(_,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(_,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),m&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&f.oauthAccount?.organizationName&&(0,G.jsxs)(_,{dimColor:!0,children:[`Message from `,f.oauthAccount.organizationName,`:`]}),(0,G.jsx)(_,{children:m})]}),i&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(x,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(_,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(x,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(_,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(_,{dimColor:!0,children:[`API calls: `,I(Lt())]}),(0,G.jsxs)(_,{dimColor:!0,children:[`Debug logs: `,I(pe())]}),Oe()&&(0,G.jsxs)(_,{dimColor:!0,children:[`Startup Perf: `,I(ke())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Vi,{})]})}var Zi,G,Qi,$i,ea=t((()=>{h(),y(),bt(),In(),Ae(),oe(),Ar(),Lr(),Ur(),O(),Rn(),le(),he(),Zi=n(h(),1),hn(),fi(),Le(),Tn(),it(),i(),De(),yi(),Ri(),Mi(),Bi(),Hi(),G=C(),Xt(),li(),Gn(),tt(),qt(),Hn(),P(),Qi=(Yi(),e(Ui)),$i=50}));function ta({message:e,isTranscriptMode:t}){let n=e.message?.content,r=Array.isArray(n)?n:[];if(!(t&&e.type===`assistant`&&e.message?.model&&r.some(e=>e?.type===`text`)))return null;let i=e.message.model;return(0,na.jsx)(x,{minWidth:l(i)+8,children:(0,na.jsx)(_,{dimColor:!0,children:i})})}var na,ra=t((()=>{h(),y(),na=C()}));function ia({message:e,isTranscriptMode:t}){if(!(t&&e.timestamp&&e.type===`assistant`&&Array.isArray(e.message.content)&&e.message.content.some(e=>e.type===`text`)))return null;let n=new Date(e.timestamp).toLocaleTimeString(`en-US`,{hour:`2-digit`,minute:`2-digit`,hour12:!0});return(0,aa.jsx)(x,{minWidth:l(n),children:(0,aa.jsx)(_,{dimColor:!0,children:n})})}var aa,oa=t((()=>{h(),y(),aa=C()}));function sa(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=ma(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(pt(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&ma(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=ma(t.messages[0]?.message.content)?.input;if(pt(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function ca({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,onOpenRateLimitOptions:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(Qe(e,o)||m&&!n),S=v?e.displayMessage:y?lt(e):e,C=v||y?[]:Bt(e,h),w=Mo(e,s,o,v||y?Et:Re(e,h),c,h),T=!1;if(l)if(v)T=e.messages.some(e=>{let t=ma(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)T=Qe(e,o);else{let t=Rt(e);T=!t||o.has(t)}let E=_&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),D=(0,pa.jsx)(Ge,{message:e,lookups:h,addMargin:!E,containerWidth:E?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:T,shouldShowDot:!0,isTranscriptMode:_,isStatic:w,onOpenRateLimitOptions:u,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return E?(0,pa.jsx)(zt,{children:(0,pa.jsxs)(x,{width:p,flexDirection:`column`,children:[(0,pa.jsxs)(x,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,pa.jsx)(ia,{message:S,isTranscriptMode:_}),(0,pa.jsx)(ta,{message:S,isTranscriptMode:_})]}),D]})}):(0,pa.jsx)(zt,{children:D})}function la(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Je(e).some(e=>t.has(e));let n=Rt(e);return!!n&&t.has(n)}function ua(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=ma(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return Je(e).every(e=>t.has(e));if(e.type===`assistant`){let n=ma(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Rt(e);return!n||t.has(n)}function da(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&He(t.message))return!1;let n=la(e.message,e.streamingToolUseIDs),r=ua(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var fa,pa,ma,ha,ga=t((()=>{fa=n(h(),1),y(),rt(),nt(),ut(),pa=C(),ra(),Uo(),oa(),Le(),ma=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ha=fa.memo(ca,da)}));function _a(e){return e.type===`attachment`&&va.has(e.attachment.type)}var va,ya=t((()=>{va=new Set(`hook_success.hook_additional_context.hook_cancelled.command_permissions.agent_mention.budget_usd.critical_system_reminder.edited_image_file.edited_text_file.opened_file_in_ide.output_style.plan_mode.plan_mode_exit.plan_mode_reentry.structured_output.team_context.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.companion_intro.token_usage.ultrathink_effort.max_turns_reached.task_reminder.auto_mode.auto_mode_exit.output_token_usage.verify_plan_reminder.current_session_memory.compaction_reminder.date_change`.split(`.`))}));function ba(e){return Da.filter(t=>t.isActive(e))}var K,xa,Sa,Ca,wa,Ta,Ea,Da,Oa=t((()=>{y(),h(),Ue(),o(),_e(),Ae(),ce(),Zn(),It(),Zt(),K=C(),xa={id:`large-memory-files`,type:`warning`,isActive:e=>Qt(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:Qt(e.memoryFiles).map(e=>{let t=e.path.startsWith(ve())?er(ve(),e.path):e.path;return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large `,(0,K.jsx)(_,{bold:!0,children:t}),` will impact performance (`,Ee(e.content.length),` chars > `,Ee($t),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Sa={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=de();return L()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=de();return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Ca={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0});return!!ee()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(x,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},wa={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0}),t=de();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=A({skipRetrievingKeyFromApiKeyHelper:!0}),t=de();return(0,K.jsxs)(x,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(x,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(_,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Ta={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Xn(e.agentDefinitions)>Qn,render:e=>{let t=Xn(e.agentDefinitions);return(0,K.jsxs)(x,{flexDirection:`row`,children:[(0,K.jsx)(_,{color:`warning`,children:s.warning}),(0,K.jsxs)(_,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,Ee(t),` tokens > `,Ee(Qn),`)`,(0,K.jsx)(_,{dimColor:!0,children:` · /agents to manage`})]})]})}},Ea={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!Mt()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=Ut();return t!==null&&!tn(t)},render:()=>{let e=Gt(Ut());return(0,K.jsxs)(x,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(_,{color:`ide`,children:s.arrowUp}),(0,K.jsxs)(_,{children:[`Install the `,(0,K.jsx)(_,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(_,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},Da=[xa,Ta,Sa,Ca,wa,Ea]}));function ka({agentDefinitions:e}={}){let t={config:F(),agentDefinitions:e,memoryFiles:(0,ja.use)(yt())},n=ba(t);return n.length===0?null:(0,Ma.jsx)(x,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Ma.jsx)(Aa.Fragment,{children:e.render(t)},e.id))})}var Aa,ja,Ma,Na=t((()=>{Aa=n(h(),1),ja=n(h(),1),y(),Ue(),O(),Oa(),Ma=C()}));function Pa(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??Ha,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Ra);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??Fa);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-La),w=b;else{if(y){let e=v+Ia;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-Ia;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*Ia,y=Math.min(b,C+Ba),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Ia);)S+=r.current.get(t[w])??za,w++}let e=v+2*Ia,n=Math.max(0,w-Ba),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??za;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??za;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Va&&(C=e-Va),w>t+Va&&(w=t+Va),C>w&&(w=Math.min(C+Va,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>Ba){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Ba:D=O-Ba}let k=m.current,ee=x[D],te=D===0?0:ee+k,A=O===b?1/0:Math.max(ee,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(te,A)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let ne=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),re=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),j=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),M=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),N=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),P=S-x[O];return{range:[D,O],topSpacer:ee,bottomSpacer:P,measureRef:ne,spacerRef:h,offsets:x,getItemTop:re,getItemElement:j,getItemHeight:M,scrollToIndex:N}}var q,Fa,Ia,La,Ra,za,Ba,Va,Ha,Ua=t((()=>{q=n(h(),1),Fa=3,Ia=40,La=30,Ra=Ia>>1,za=1,Ba=200,Va=25,Ha=()=>{}}));function Wa({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,Ya.jsx)(Za.Provider,{value:n,children:(0,Ya.jsx)($a.Provider,{value:i,children:(0,Ya.jsx)(Xa.Provider,{value:t,children:(0,Ya.jsx)(Qa.Provider,{value:r,children:e})})})})}function Ga(){return(0,J.useContext)(Xa)}function Ka(){return(0,J.useContext)(Qa)}function qa(e){let t=(0,J.useContext)(Za);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Ja(e){let t=(0,J.useContext)($a);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,Ya,Xa,Za,Qa,$a,eo=t((()=>{J=n(h(),1),Ya=C(),Xa=(0,J.createContext)(null),Za=(0,J.createContext)(null),Qa=(0,J.createContext)(null),$a=(0,J.createContext)(null)}));function to(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function no(e,t){let n=0,r=!1;for(let i=t;i<e.length;i++){let t=e[i];if(t.type===`progress`||t.type===`assistant`&&!ro(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function ro(e){if(e.type!==`assistant`||!Array.isArray(e.message.content))return!1;for(let t of e.message.content)if(typeof t!=`string`&&t.type===`text`&&t.text.trim()!==``)return!0;return!1}function io(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||_a(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=no(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function ao({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:d=0,onPillClick:f}){let{rows:p,columns:h}=u(),[v,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!Ie())return;let e=m.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{un(tr(e))}catch{}else ln(e)},()=>{e.onHyperlinkClick=void 0}},[]),Ie()){let s=l?null:v,u=s!=null&&s!==`clicked`&&n==null?s:null,m=s!=null&&n==null;return(0,X.jsxs)(Wa,{children:[(0,X.jsx)(x,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(x,{flexDirection:`column`,flexGrow:1,width:h,overflow:`hidden`,children:[(0,X.jsxs)(x,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[u&&(0,X.jsx)(so,{text:u.text,onClick:u.scrollTo}),(0,X.jsxs)(g,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!m,stickyScroll:!0,children:[(0,X.jsx)(fo,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(oo,{count:d,onClick:f}),r!=null&&(0,X.jsx)(x,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(x,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(co,{}),(0,X.jsx)(lo,{}),(0,X.jsx)(x,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Wn,{value:{rows:p-uo-1,columns:h-4,scrollRef:a??null},children:(0,X.jsxs)(x,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:p-uo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(x,{flexShrink:0,children:(0,X.jsx)(_,{color:`permission`,children:`▔`.repeat(h)})}),(0,X.jsx)(x,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function oo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(x,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${N(e,`message`)}`:`Jump to bottom`,` `,s.arrowDown,` `]})})})}function so({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(x,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(_,{color:`subtle`,wrap:`truncate-end`,children:[s.pointer,` `,e]})})}function co(){let e=Ga();return!e||e.suggestions.length===0?null:(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(zn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function lo(){let e=Ka();return e?(0,X.jsx)(x,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,uo,fo,po=t((()=>{o(),Y=n(h(),1),Un(),eo(),bt(),y(),dn(),jt(),se(),ya(),Bn(),X=C(),uo=2,fo=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function mo(e){let t=So.get(e);if(t!==void 0)return t;let n=vr(e);return So.set(e,n),n}function ho(e){let t=wo.get(e);if(t!==void 0)return t;let n=go(e);return wo.set(e,n),n}function go(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
11
- `)}if(t===null)return null;let n=Fe(t);return n.startsWith(`<`)||n===``?null:n}function _o({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,bo.jsx)(x,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,bo.jsx)(S.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function vo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=mo,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:T,spacerRef:E,offsets:D,getItemTop:O,getItemElement:k,getItemHeight:ee,scrollToIndex:te}=Pa(t,b,n),[A,ne]=S,re=(0,Z.useCallback)(t=>ee(t)===0?!1:ht(e[t]),[ee,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:Nt(e)?.name}),r=u??-1,i=(t,r,i=re)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>re(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,re]);let j=(0,Z.useRef)({offsets:D,start:A,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:te});j.current={offsets:D,start:A,getItemElement:k,getItemTop:O,messages:e,scrollToIndex:te},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=j.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let M=(0,Z.useRef)(null),N=(0,Z.useRef)({msgIdx:-1,positions:[]}),P=(0,Z.useRef)(-1),ie=(0,Z.useRef)(0),F=(0,Z.useRef)(0),ae=(0,Z.useRef)(()=>{}),I=(0,Z.useRef)(()=>{}),L=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),oe=(0,Z.useRef)(-1),R=(0,Z.useRef)(!1);function se(e){let t=j.current.getItemTop(e);return Math.max(0,t-xo)}function ce(e){let n=t.current,{msgIdx:r,positions:i}=N.current;if(!n||i.length===0||r<0){g?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=j.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-xo)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=L.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),z(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}I.current=ce;let[le,ue]=(0,Z.useState)(0),de=(0,Z.useCallback)(()=>ue(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=M.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=j.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){M.current=null,z(`seek(i=${n}): no mount after scrollToIndex, skip`),ae.current(r?-1:1);return}M.current={idx:n,wantLast:r,tries:i+1},c(n),de();return}M.current=null,a.scrollTo(Math.max(0,s(n)-xo));let d=h?.(l)??[];if(N.current={msgIdx:n,positions:d},z(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ie.current>20){ie.current=0;return}ae.current(r?-1:1);return}ie.current=0;let f=r?d.length-1:0;L.current.screenOrd=f,P.current=-1,I.current(f);let p=F.current;p&&(F.current=0,ae.current(p))},[le]);function fe(e,n){let r=t.current;if(!r)return;let i=j.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),N.current={msgIdx:-1,positions:[]},M.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(se(e)):o(e),de()}function pe(e){let t=L.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(M.current){F.current=e;return}P.current<0&&(P.current=t.ptr);let{positions:a}=N.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,ce(o),P.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===P.current){g?.(null),P.current=-1,z(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,fe(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}ae.current=pe,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(se(e))},setSearchQuery:e=>{M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=j.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=j.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=oe.current>=0?oe.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}z(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}L.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?fe(r[o],!0):oe.current>=0&&s&&s.scrollTo(oe.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>pe(1),prevMatch:()=>pe(-1),setAnchor:()=>{let e=t.current;e&&(oe.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),M.current=null,N.current={msgIdx:-1,positions:[]},P.current=-1},warmSearchIndex:async()=>{if(R.current)return 0;let e=j.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await je(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return z(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),R.current=!0,Math.round(t)}}),[t]);let[me,he]=(0,Z.useState)(null),ge=(0,Z.useRef)({onItemClick:a,setHoveredKey:he});ge.current={onItemClick:a,setHoveredKey:he};let B=(0,Z.useCallback)((e,t)=>{let n=ge.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),_e=(0,Z.useCallback)(e=>{ge.current.setHoveredKey(e)},[]),ve=(0,Z.useCallback)(e=>{ge.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,bo.jsxs)(bo.Fragment,{children:[(0,bo.jsx)(x,{ref:E,height:C,flexShrink:0}),e.slice(A,ne).map((e,t)=>{let n=A+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&me===r,u=s?.(e);return(0,bo.jsx)(_o,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:B,onEnterK:_e,onLeaveK:ve,renderItem:i},r)}),w>0&&(0,bo.jsx)(x,{height:w,flexShrink:0}),l&&(0,bo.jsx)(yo,{messages:e,start:A,end:ne,offsets:D,getItemTop:O,getItemElement:k,scrollRef:t})]})}function yo({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(fo);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??To,[o]),()=>{let e=o.current;if(!e)return NaN;let t=e.getScrollTop()+e.getPendingDelta();return e.isSticky()?-1-t:t});let c=o.current?.isSticky()??!0,l=Math.max(0,(o.current?.getScrollTop()??0)+(o.current?.getPendingDelta()??0)),u=t,d=-1;for(let e=n-1;e>=t;e--){let t=i(e);if(t>=0){if(t<l)break;d=t}u=e}let f=-1,p=null;if(u>0&&!c)for(let t=u-1;t>=0;t--){let n=ho(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Co).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,bo,xo,So,Co,wo,To,Eo=t((()=>{h(),Z=n(h(),1),Ua(),y(),gt(),po(),bo=C(),he(),Me(),Tr(),At(),xo=3,So=new WeakMap,Co=500,wo=new WeakMap,To=()=>{}}));function Do(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function Oo(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function ko(e,t,n=zo,r=Bo){let i=t.current,a=i?e.findIndex(e=>e.uuid===i.uuid):-1,o=a>=0?a:i?Math.min(i.idx,Math.max(0,e.length-n)):0;e.length-o>n+r&&(o=e.length-n);let s=e[o];return s&&(i?.uuid!==s.uuid||i.idx!==o)?t.current={uuid:s.uuid,idx:o}:!s&&i&&(t.current=null),o}function Ao(e){return(e.type===`assistant`||e.type===`user`?Rt(e):null)??e.uuid}function jo(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Mo(e,t,n,r,i,a){if(i===`transcript`)return!0;switch(e.type){case`attachment`:case`user`:case`assistant`:{if(e.type===`assistant`){let t=e.message.content[0];if(t?.type===`server_tool_use`)return a.resolvedToolUseIDs.has(t.id)}let i=Rt(e);return i?t.has(i)||n.has(i)||Ze(i,`PostToolUse`,a)?!1:nr(r,a.resolvedToolUseIDs):!0}case`system`:return e.subtype!==`api_error`;case`grouped_tool_use`:return e.messages.every(e=>{let t=e.message.content[0];return t?.type===`tool_use`&&a.resolvedToolUseIDs.has(t.id)});case`collapsed_read_search`:return!1;default:return!0}}var No,Q,$,Po,Fo,Io,Lo,Ro,zo,Bo,Vo,Ho,Uo=t((()=>{p(),xn(),No=n(h(),1),Q=n(h(),1),rr(),E(),k(),bt(),y(),Ht(),nn(),kt(),or(),lr(),rt(),fr(),O(),i(),jt(),_r(),nt(),se(),Tr(),ea(),xt(),ga(),At(),ft(),ya(),Le(),Na(),$=C(),Eo(),Po=No.memo(function({agentDefinitions:e}){return(0,$.jsx)(zt,{children:(0,$.jsxs)(x,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Xi,{}),(0,$.jsx)(No.Suspense,{fallback:null,children:(0,$.jsx)(ka,{agentDefinitions:e})})]})})}),Fo=(cn(),e(sn)),Io=(re(),e(ue)).BRIEF_TOOL_NAME,Lo=(qe(),e(We)).SEND_USER_FILE_TOOL_NAME,Ro=30,zo=200,Bo=50,Vo=({messages:e,tools:t,commands:n,verbose:r,toolJSX:i,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:p,streamingToolUses:m,showAllInTranscript:h=!1,agentDefinitions:g,onOpenRateLimitOptions:y,hideLogo:b=!1,isLoading:S,hidePastThinking:C=!1,streamingThinking:w,streamingText:E,isBriefOnly:D=!1,unseenDivider:O,scrollRef:k,trackStickyPrompt:ee,jumpRef:A,onSearchMatchesChange:ne,scanElement:re,setPositions:j,disableRenderCap:M=!1,cursor:P=null,setCursor:ie,cursorNavRef:ae,renderRange:I})=>{let{columns:L}=u(),oe=Kt(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),R=(0,Q.useMemo)(()=>Ye(e).filter(Be),[e]),se=(0,Q.useMemo)(()=>w?w.isStreaming?!0:w.streamingEndedAt?Date.now()-w.streamingEndedAt<3e4:!1:!1,[w]),{lastThinkingBlockId:ce,latestBashOutputUUID:le}=(0,Q.useMemo)(()=>{let e=null,t=null,n=C&&!se;C&&se&&(e=`streaming`);for(let r=R.length-1;r>=0;r--){let i=R[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return C||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[R,C,se]),ue=(0,Q.useMemo)(()=>at(R),[R]),de=(0,Q.useMemo)(()=>m.filter(e=>!s.has(e.contentBlock.id)&&!ue.has(e.contentBlock.id)),[m,s,ue]),fe=(0,Q.useMemo)(()=>de.flatMap(e=>{let t=Vt({content:[e.contentBlock]});return t.uuid=en(e.contentBlock.id,0),Ye([t])}),[de]),z=p===`transcript`,pe=(0,Q.useMemo)(()=>a(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),me=k!=null&&!pe,he=z&&!h&&!me,ge=(0,Q.useRef)(null),B=(0,Q.useRef)(null),{collapsed:_e,lookups:ve,hasTruncatedMessages:ye,hiddenMessageCount:be}=(0,Q.useMemo)(()=>{let e=$e((r||Ie()?R:dt(R,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!_a(e)&&Dt(e,z)),fe),n=[Io,Lo].filter(e=>e!==null),i=[Io].filter(e=>e!==null),a=n.length>0&&!z?D?Do(e,n):i.length>0?Oo(e,i):e:e,o=he?a.slice(-Ro):a,s=he&&a.length>Ro,{messages:c}=hr(o,t,r),l=ar(cr(dr(st(c,t))),r),u=Ft(R,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(B.current&&B.current.key===u)f=B.current.lookups;else if(B.current&&R.length>=B.current.normalizedCount&&o.length>=B.current.messageCount&&B.current.lastAssistantMsgId===d){let e=Pe(B.current.lookups,B.current.normalizedCount,B.current.messageCount,R,o);e?(f=e,B.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Jt(R,o),B.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Jt(R,o),B.current={key:u,lookups:f,normalizedCount:R.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ro;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[r,R,z,fe,he,t,D]),V=(0,Q.useMemo)(()=>{let e=!me&&!M?ko(_e,ge):0;return I?_e.slice(I[0],I[1]):e>0?_e.slice(e):_e},[_e,I,me,M]),xe=(0,Q.useMemo)(()=>new Set(m.map(e=>e.contentBlock.id)),[m]),{dividerBeforeIndex:Se,selectedIdx:Ce}=(0,Q.useMemo)(()=>{if(!O&&!P)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=O?.firstUnseenUuid.slice(0,24);for(let r=0;r<V.length;r++){let i=V[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&P&&i.uuid===P.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[O,P,V]),[we,Te]=(0,Q.useState)(()=>new Set),Ee=(0,Q.useCallback)(e=>{let t=Ao(e);Te(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),De=(0,Q.useCallback)(e=>we.size>0&&we.has(Ao(e)),[we]),Oe=(0,Q.useRef)(ve);Oe.current=ve;let ke=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&mt(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=Oe.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?rn(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ae=(!i||!!i.shouldContinueAnimation)&&!o.length&&!c,je=s.size>0,{progress:Me}=d(),Ne=(0,Q.useRef)(null),Fe=F().terminalProgressBarEnabled&&!T()&&!(Fo?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Fe?je?`indeterminate`:`completed`:null;Ne.current!==e&&(Ne.current=e,Me(e))},[Me,Fe,je]),(0,Q.useEffect)(()=>()=>Me(null),[Me]);let Le=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Re=(e,i)=>{let a=i>0?V[i-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!E||sa(V,i,t,xe)),l=V.length-1-i>0,u=Le(e),d=(0,$.jsx)(ha,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:r||De(e)||P?.expanded===!0&&i===Ce,inProgressToolUseIDs:s,streamingToolUseIDs:xe,screen:p,canAnimate:Ae,onOpenRateLimitOptions:y,lastThinkingBlockId:ce,latestBashOutputUUID:le,columns:L,isLoading:S,lookups:ve,shouldCollapseDiffs:l},u),f=(0,$.jsx)(Tt.Provider,{value:i===Ce,children:d},u);return O&&i===Se?[(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(v,{title:`${O.count} new ${N(O.count,`message`)}`,width:L,color:`inactive`})},`unseen-divider`),f]:f},Ve=(0,Q.useRef)(new WeakMap),He=(0,Q.useCallback)(e=>{let n=Ve.current.get(e);if(n!==void 0)return n;let r=vr(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=ve.toolUseByToolUseID.get(n.tool_use_id),a=(i&&rn(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Ve.current.set(e,i),i},[t,ve]);return(0,$.jsxs)(Sn,{name:`MessagesBoundary`,children:[!b&&!(I&&I[0]>0)&&(0,$.jsx)(Po,{agentDefinitions:g}),ye&&(0,$.jsx)(v,{title:`${oe} to show ${f.bold(be)} previous messages`,width:L}),z&&h&&be>0&&!M&&(0,$.jsx)(v,{title:`${oe} to hide ${f.bold(be)} previous messages`,width:L}),me?(0,$.jsx)(et.Provider,{value:!0,children:(0,$.jsx)(vo,{messages:V,scrollRef:k,columns:L,itemKey:Le,renderItem:Re,onItemClick:Ee,isItemClickable:ke,isItemExpanded:De,trackStickyPrompt:ee,selectedIndex:Ce>=0?Ce:void 0,cursorNavRef:ae,setCursor:ie,jumpRef:A,onSearchMatchesChange:ne,scanElement:re,setPositions:j,extractSearchText:He})}):V.flatMap(Re),E&&!D&&(0,$.jsx)(x,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(x,{flexDirection:`row`,children:[(0,$.jsx)(x,{minWidth:2,children:(0,$.jsx)(_,{color:`text`,children:te})}),(0,$.jsx)(x,{flexDirection:`column`,children:(0,$.jsx)(ze,{children:E})})]})}),se&&w&&!D&&(0,$.jsx)(x,{marginTop:1,children:(0,$.jsx)(ct,{param:{type:`thinking`,thinking:w.thinking},addMargin:!1,isTranscriptMode:!0,verbose:r,hideInTranscript:!1})})]})},Ho=No.memo(Vo,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(r===`onOpenRateLimitOptions`||r===`scrollRef`||r===`trackStickyPrompt`||r===`setCursor`||r===`cursorNavRef`||r===`jumpRef`||r===`onSearchMatchesChange`||r===`scanElement`||r===`setPositions`)&&e[r]!==t[r]){if(r===`streamingToolUses`){let n=e.streamingToolUses,r=t.streamingToolUses;if(n.length===r.length&&n.every((e,t)=>e.contentBlock===r[t]?.contentBlock))continue}if(r===`inProgressToolUseIDs`&&jo(e.inProgressToolUseIDs,t.inProgressToolUseIDs))continue;if(r===`unseenDivider`){let n=e.unseenDivider,r=t.unseenDivider;if(n?.firstUnseenUuid===r?.firstUnseenUuid&&n?.count===r?.count)continue}if(r===`tools`){let n=e.tools,r=t.tools;if(n.length===r.length&&n.every((e,t)=>e.name===r[t]?.name))continue}return!1}return!0})}));export{po as a,qa as c,io as i,Ja as l,Uo as n,to as o,ao as r,eo as s,Ho as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./chunk-DR8-3Aex.js";import{c as t,s as n,u as r}from"./envUtils-BWeoiL4Y.js";import{n as i,t as a}from"./defineProperty-80gRi2ZW.js";import{Tn as o,wn as s}from"./src-Di342QoJ.js";import{Ct as c,Lt as l,Nt as u,cn as d,it as f,ln as ee}from"./state-sIHsFpDu.js";import{Ac as p,Br as m,Dr as h,Ll as g,Pr as _,Rl as v,Sc as te,a as y,i as ne,pi as b,vi as x}from"./paths-D8Fx3kUi.js";import{n as S,t as re}from"./cwd--iizewsn.js";import{et as C,i as w,o as T}from"./log-CzsijfHZ.js";import{Ar as E,FD as D,FE as ie,Fl as ae,Fn as oe,Hm as se,Il as ce,Ji as le,Kn as O,LD as k,LO as A,Lo as ue,ME as de,NE as fe,OD as j,OO as pe,PE as me,Rn as M,Sn as he,Vm as N,Xi as P,_j as ge,_k as F,ao as _e,at as ve,dt as ye,et as be,fs as I,ft as L,gm as R,iy as xe,kD as z,kO as Se,mE as Ce,mj as B,ms as we,no as Te,oi as V,pE as Ee,qn as De,sy as H,tt as Oe,ty as ke,ur as U,vk as Ae,xn as W,yk as G,zn as je}from"./loadAgentsDir-HZ19tmOZ.js";import{Hn as Me,Vn as Ne,ht as K,vt as Pe}from"./prompt-BxoRdmaw.js";import{i as Fe,o as Ie}from"./fileStateCache-C7-TxF8G.js";import{P as q,X as Le,Z as Re}from"./rcDebugLog-5XEbz_Yg.js";import{a as ze,n as Be,r as Ve}from"./mappers-qcXgNBi5.js";import{c as He,n as Ue,o as We,r as Ge,s as Ke}from"./MessageSelector-A-814zUi.js";import{n as qe,t as J}from"./systemTheme-dDbitcxB.js";import{randomUUID as Y}from"crypto";n(),i(),s(),d(),g(),S(),C(),T(),p(),x(),y(),Ne(),Pe(),Ie(),q(),Se(),k(),H(),R(),ae(),I(),ue(),P(),E(),O(),W(),Oe(),L(),G(),z(),_(),A(),B();async function Je({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?ye(e,t,n,r):Promise.resolve([]),Ae(),i===void 0?F():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ye({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=h(),f=a(),{defaultSystemPrompt:ee,userContext:p,systemContext:m}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),g=Le([...s===void 0?ee:[s],...c?[c]:[]]),_=r.at(-1),v=_?.type===`assistant`&&_.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:g,userContext:p,systemContext:m,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(ge()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:j(),readFileState:i,getAppState:a,setAppState:o,messages:v,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:v}}z(),_(),N(),A(),J(),B(),Be(),M(),fe();var Xe=()=>{try{return Ge(),e(Ue)}catch{return null}},Ze=(Ce(),e(Ee)).getCoordinatorUserContext,Qe=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??j(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Re}async*submitMessage(e,n){let{cwd:i,commands:a,tools:s,mcpClients:d,verbose:p=!1,thinkingConfig:g,maxTurns:_,maxBudgetUsd:y,taskBudget:x,canUseTool:S,customSystemPrompt:C,appendSystemPrompt:T,userSpecifiedModel:E,fallbackModel:ae,jsonSchema:O,getAppState:k,setAppState:A,replayUserMessages:ue=!1,includePartialMessages:fe=!1,agents:j=[],setSDKStatus:M,orphanedPermission:N}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],se(i);let P=!ee(),F=Date.now(),ye=async(e,t,n,r,i,a)=>{let o=await S(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Ke(e.name),tool_use_id:i,tool_input:t}),o},I=k(),L=E?m(E):h(),R=g||(ge()===!1?{type:`disabled`}:{type:`adaptive`});D(`before_getSystemPrompt`);let z=typeof C==`string`?C:void 0,{defaultSystemPrompt:Se,userContext:Ce,systemContext:B}=await Je({tools:s,mainLoopModel:L,additionalWorkingDirectories:Array.from(I.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:d,customSystemPrompt:z});D(`after_getSystemPrompt`);let Ee={...Ce,...Ze(d,je()?oe():void 0)},H=z!==void 0&&ne()?await De():null,Oe=Le([...z===void 0?Se:[z],...H?[H]:[],...T?[T]:[]]),Ae=s.some(e=>Me(e,K));O&&Ae&&he(A,c());let W={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:p,mainLoopModel:L,thinkingConfig:R,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:T,agentDefinitions:{activeAgents:j,allAgents:[]},theme:qe(te().theme),maxBudgetUsd:y},getAppState:k,setAppState:A,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{A(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{A(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:M};if(N&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of de(N,s,this.mutableMessages,W))yield e}let{messages:G,shouldQuery:Ne,allowedTools:Pe,model:Fe,resultText:Ie}=await He({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...W,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...G);let q=[...this.mutableMessages];if(P&&G.length>0){let e=V(q);t()||(await e,(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U())}let Be=Xe(),Ue=G.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Be?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),Ge=ue?Ue:[];A(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Pe}}}));let J=Fe??L;W={messages:q,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:s,verbose:p,mainLoopModel:J,thinkingConfig:R,mcpClients:d,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:T,theme:qe(te().theme),agentDefinitions:{activeAgents:j,allAgents:[]},maxBudgetUsd:y},getAppState:k,setAppState:A,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:W.updateFileHistoryState,updateAttributionState:W.updateAttributionState,setSDKStatus:M},D(`before_skills_plugins`);let[Ye,{enabled:Qe}]=await Promise.all([le(re()),we()]);if(D(`after_skills_plugins`),yield We({tools:s,mcpClients:d,model:J,permissionMode:I.toolPermissionContext.mode,commands:a,agents:j,skills:Ye,plugins:Qe,fastMode:I.fastMode}),D(`system_message_yielded`),!Ne){for(let e of G)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:o(e.message.content)},session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Ve(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:e.uuid,compact_metadata:ze(t.compactMetadata)}}P&&(await V(q),(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-F,duration_api_ms:u(),num_turns:q.length-1,result:Ie??``,stop_reason:null,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y()};return}if(ke()&&P){let e=Xe()?.selectableUserMessagesFilter??(e=>!0);G.filter(e).forEach(e=>{xe(e=>{A(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let X=Re,Z=1,$e=!1,et,Q=null,tt=w().at(-1),nt=O?_e(this.mutableMessages,K):0;for await(let e of ce({messages:q,systemPrompt:Oe,userContext:Ee,systemContext:B,canUseTool:ye,toolUseContext:W,fallbackModel:ae,querySource:`sdk`,maxTurns:_,taskBudget:x})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(P&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await V(this.mutableMessages.slice(0,e+1))}}if(q.push(e),P&&(e.type===`assistant`?V(q):await V(q)),!$e&&Ge.length>0){$e=!0;for(let e of Ge)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:c(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Z++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Q=n),this.mutableMessages.push(t),yield*ie(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),P&&(q.push(t),V(q)),yield*ie(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*ie(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){X=Re;let e=t.message;X=ve(X,e.usage)}if(t.type===`message_delta`){X=ve(X,t.usage);let e=t.delta;e.stop_reason!=null&&(Q=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=be(this.totalUsage,X)),fe&&(yield{type:`stream_event`,event:t,session_id:c(),parent_tool_use_id:null,uuid:Y()});break}case`attachment`:{let t=e;this.mutableMessages.push(t),P&&(q.push(t),V(q));let n=t.attachment;if(n.type===`structured_output`)et=n.data;else if(n.type===`max_turns_reached`){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:n.turnCount,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Reached maximum number of turns (${n.maxTurns})`]};return}else ue&&n.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:n.prompt},session_id:c(),parent_tool_use_id:null,uuid:n.source_uuid||t.uuid,timestamp:t.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=q.length-1;r>0&&q.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:c(),uuid:t.uuid,compact_metadata:ze(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:pe(e.error),session_id:c(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:c(),uuid:t.uuid};break}}if(y!==void 0&&l()>=y){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Reached maximum budget ($${y}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&O){let e=_e(this.mutableMessages,K)-nt,t=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=t){P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:[`Failed to provide valid structured output after ${t} attempts`]};return}}}let $=q.findLast(e=>e.type===`assistant`||e.type===`user`),rt=$?.type??`undefined`,it=$?.type===`assistant`?v($.message.content)?.type??`none`:`n/a`;if(P&&(r(process.env.CLAUDE_CODE_EAGER_FLUSH)||r(process.env.CLAUDE_CODE_IS_COWORK))&&await U(),!me($,Q)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-F,duration_api_ms:u(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,fast_mode_state:b(J,I.fastMode),uuid:Y(),errors:(()=>{let e=w(),t=tt?e.lastIndexOf(tt)+1:0;return[`[ede_diagnostic] result_type=${rt} last_content_type=${it} stop_reason=${Q}`,...e.slice(t).map(e=>e.error)]})()};return}let at=``,ot=!1;if($.type===`assistant`){let e=v($.message.content);e?.type===`text`&&!Te.has(e.text)&&(at=e.text),ot=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:ot,duration_ms:Date.now()-F,duration_api_ms:u(),num_turns:Z,result:at,stop_reason:Q,session_id:c(),total_cost_usd:l(),usage:this.totalUsage,modelUsage:f(),permission_denials:this.permissionDenials,structured_output:et,fast_mode_state:b(J,I.fastMode),uuid:Y()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=j()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return c()}setModel(e){this.config.userSpecifiedModel=e}};async function*X({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:f,mutableMessages:ee=[],getReadFileCache:p,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,jsonSchema:te,getAppState:y,setAppState:ne,abortController:b,replayUserMessages:x=!1,includePartialMessages:S=!1,handleElicitation:re,agents:C=[],setSDKStatus:w,orphanedPermission:T}){let E=new Qe({cwd:i,tools:a,commands:e,mcpClients:o,agents:C??[],canUseTool:f,getAppState:y,setAppState:ne,initialMessages:ee,readFileCache:Fe(p()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:te,verbose:s,handleElicitation:re,replayUserMessages:x,includePartialMessages:S,setSDKStatus:w,abortController:b,orphanedPermission:T});try{yield*E.submitMessage(t,{uuid:n,isMeta:r})}finally{m(E.getReadFileState())}}export{X as n,Ye as r,Qe as t};
@@ -1 +0,0 @@
1
- import{t as e}from"./REPL-D-t0XQx2.js";export{e as REPL};
@@ -1 +0,0 @@
1
- import{a as e,o as t}from"./chunk-DR8-3Aex.js";import{F as n,Rn as r,b as i,t as a,tn as o,tt as s,x as c}from"./src-Di342QoJ.js";import{t as l}from"./jsx-runtime-D-D469L8.js";import{cn as u,jr as ee,ot as te}from"./state-sIHsFpDu.js";import{n as d,r as f}from"./analytics-DqMQntaB.js";import{o as p,s as m}from"./log-CzsijfHZ.js";import{Ar as h,BS as ne,Kr as g,LS as _,Lo as v,Mr as re,RS as ie,SE as y,Sy as b,Tv as ae,Uw as x,Vr as S,Yn as C,_m as oe,_o as se,ar as ce,by as w,cd as T,di as le,ei as ue,fi as de,gm as E,mE as D,o as fe,pE as O,pd as pe,u as me,wi as he,wv as k,xE as ge}from"./loadAgentsDir-HZ19tmOZ.js";import{t as A}from"./useKeybinding-FsOnjW6T.js";import{r as j}from"./asciicast-DIsaWcsJ.js";import{a as M,n as N,s as P}from"./skillChangeDetector-4XWLpjQl.js";import{a as F,i as I,n as L,o as R,r as _e,t as ve}from"./crossProjectResume-BMWSw62A.js";import{t as ye}from"./REPL-D-t0XQx2.js";import{dirname as be}from"path";var z=t(r(),1);x(),u(),R(),b(),E(),a(),A(),d(),_(),y(),I(),T(),k(),L(),p(),v(),h();var B=l();function xe(e){let t=parseInt(e,10);if(!isNaN(t)&&t>0)return t;let n=e.match(/github\.com\/[^/]+\/[^/]+\/pull\/(\d+)/);return n?.[1]?parseInt(n[1],10):null}function V({commands:t,worktreePaths:r,initialTools:a,mcpClients:s,dynamicMcpConfig:l,debug:u,mainThreadAgentDefinition:d,autoConnectIdeFlag:p,strictMcpConfig:_=!1,systemPrompt:v,appendSystemPrompt:y,initialSearchQuery:b,disableSlashCommands:x=!1,forkSession:T,taskListId:E,filterByPr:k,thinkingConfig:A,onTurnComplete:I}){let{rows:L}=n(),R=ie(e=>e.agentDefinitions),V=ne(),[H,U]=z.useState([]),[we,W]=z.useState(!0),[Te,Ee]=z.useState(!1),[G,De]=z.useState(!1),[K,Oe]=z.useState(null),[q,J]=z.useState(null),Y=z.useRef(null),X=z.useRef(0),Z=z.useMemo(()=>{let e=H.filter(e=>!e.isSidechain);if(k!==void 0){if(k===!0)e=e.filter(e=>e.prNumber!==void 0);else if(typeof k==`number`)e=e.filter(e=>e.prNumber===k);else if(typeof k==`string`){let t=xe(k);t!==null&&(e=e.filter(e=>e.prNumber===t))}}return e},[H,k]),ke=re();z.useEffect(()=>{g(r).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs),W(!1)}).catch(e=>{m(e),W(!1)})},[r]);let Q=z.useCallback(e=>{let t=Y.current;!t||t.nextIndex>=t.allStatLogs.length||ce(t.allStatLogs,t.nextIndex,e).then(n=>{if(t.nextIndex=n.nextIndex,n.logs.length>0){let e=X.current;n.logs.forEach((t,n)=>{t.value=e+n}),U(e=>e.concat(n.logs)),X.current+=n.logs.length}else t.nextIndex<t.allStatLogs.length&&Q(e)})},[]),$=z.useCallback(e=>{W(!0),(e?S():g(r)).then(e=>{Y.current=e,X.current=e.logs.length,U(e.logs)}).catch(e=>{m(e)}).finally(()=>{W(!1)})},[r]),Ae=z.useCallback(()=>{let e=!G;De(e),$(e)},[G,$]);function je(){process.exit(1)}async function Me(t){Ee(!0);let n=performance.now(),i=ve(t,G,r);if(i.isCrossProject&&!i.isSameRepoWorktree){let e=i.command,t=await o(e);t&&process.stdout.write(t),J(e);return}try{let r=await ae(t,void 0);if(!r)throw Error(`Failed to load conversation`);{let t=(D(),e(O)).matchSessionMode(r.mode);if(t){let{getAgentDefinitionsWithOverrides:n,getActiveAgentsFromList:i}=(fe(),e(me));n.cache.clear?.();let a=await n(te());V(e=>({...e,agentDefinitions:{...a,allAgents:a.allAgents,activeAgents:i(a.allAgents)}})),r.messages.push(se(t,`warning`))}}r.sessionId&&!T?(ee(ge(r.sessionId),t.fullPath?be(t.fullPath):null),await j(),await le(),oe(r.sessionId)):T&&r.contentReplacements?.length&&await ue(r.contentReplacements);let{agentDefinition:i}=M(r.agentSetting,d,R);V(e=>({...e,agent:i?.agentType}));{let{saveMode:t}=(h(),e(he)),{isCoordinatorMode:n}=(D(),e(O));t(n()?`coordinator`:`normal`)}let a=N(r.agentName,r.agentColor);a&&V(e=>({...e,standaloneAgentContext:a})),pe(r.agentName),de(T?{...r,worktreeSession:void 0}:r),T||(P(r.worktreeSession),r.sessionId&&C()),f(`tengu_session_resumed`,{entrypoint:`picker`,success:!0,resume_duration_ms:Math.round(performance.now()-n)}),U([]),Oe({messages:r.messages,fileHistorySnapshots:r.fileHistorySnapshots,contentReplacements:r.contentReplacements,agentName:r.agentName,agentColor:r.agentColor===`default`?void 0:r.agentColor,mainThreadAgentDefinition:i})}catch(e){throw f(`tengu_session_resumed`,{entrypoint:`picker`,success:!1}),m(e),e}}return q?(0,B.jsx)(Ce,{command:q}):K?(0,B.jsx)(ye,{debug:u,commands:t,initialTools:a,initialMessages:K.messages,initialFileHistorySnapshots:K.fileHistorySnapshots,initialContentReplacements:K.contentReplacements,initialAgentName:K.agentName,initialAgentColor:K.agentColor,mcpClients:s,dynamicMcpConfig:l,strictMcpConfig:_,systemPrompt:v,appendSystemPrompt:y,mainThreadAgentDefinition:K.mainThreadAgentDefinition,autoConnectIdeFlag:p,disableSlashCommands:x,taskListId:E,thinkingConfig:A,onTurnComplete:I}):we?(0,B.jsxs)(c,{children:[(0,B.jsx)(w,{}),(0,B.jsx)(i,{children:` Loading conversations…`})]}):Te?(0,B.jsxs)(c,{children:[(0,B.jsx)(w,{}),(0,B.jsx)(i,{children:` Resuming conversation…`})]}):Z.length===0?(0,B.jsx)(Se,{}):(0,B.jsx)(F,{logs:Z,maxHeight:L,onCancel:je,onSelect:Me,onLogsChanged:ke?()=>$(G):void 0,onLoadMore:Q,initialSearchQuery:b,showAllProjects:G,onToggleAllProjects:Ae,onAgenticSearch:_e})}function Se(){return s(`app:interrupt`,()=>{process.exit(1)},{context:`Global`}),(0,B.jsxs)(c,{flexDirection:`column`,children:[(0,B.jsx)(i,{children:`No conversations found to resume.`}),(0,B.jsx)(i,{dimColor:!0,children:`Press Ctrl+C to exit and start a new conversation.`})]})}function Ce({command:e}){return z.useEffect(()=>{let e=setTimeout(()=>{process.exit(0)},100);return()=>clearTimeout(e)},[]),(0,B.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,B.jsx)(i,{children:`This conversation is from a different directory.`}),(0,B.jsxs)(c,{flexDirection:`column`,children:[(0,B.jsx)(i,{children:`To resume, run:`}),(0,B.jsxs)(i,{children:[` `,e]})]}),(0,B.jsx)(i,{dimColor:!0,children:`(Command copied to clipboard)`})]})}export{V as ResumeConversation};
@@ -1 +0,0 @@
1
- import{UO as e,WO as t}from"./loadAgentsDir-HZ19tmOZ.js";t();export{e as clearSearchExtraToolsDescriptionCache};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./SentryErrorBoundary-BK2HjzVw.js";e();export{t as SentryErrorBoundary};