@readmagic/workmate 0.0.1 → 0.0.3

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 (513) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-BSLHrjbt.js → AddWorkspaceDirectory-mANiG0xj.js} +1 -1
  2. package/dist/chunks/{App-DY5O6IKw.js → App-aUVaOLeo.js} +1 -1
  3. package/dist/chunks/{ApproveApiKey-BEzfC6r3.js → ApproveApiKey-36iUE5CW.js} +1 -1
  4. package/dist/chunks/ApproveApiKey-DPdcp1CQ.js +1 -0
  5. package/dist/chunks/{AssistantSessionChooser-Ce3PraaD.js → AssistantSessionChooser-BLcvdkgb.js} +1 -1
  6. package/dist/chunks/BackgroundTasksDialog-DyjVt81B.js +2 -0
  7. package/dist/chunks/{BypassPermissionsModeDialog-B68V1bCq.js → BypassPermissionsModeDialog-CTlpvTuz.js} +1 -1
  8. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CTWhpIm8.js → ClaudeMdExternalIncludesDialog-5pipE8m8.js} +1 -1
  9. package/dist/chunks/ClaudeMdExternalIncludesDialog-Dn7Le--z.js +1 -0
  10. package/dist/chunks/ConsoleOAuthFlow-BDr1Vx5K.js +1 -0
  11. package/dist/chunks/{DesktopHandoff-BRbU4is4.js → DesktopHandoff-Blg1TVut.js} +1 -1
  12. package/dist/chunks/{DiffDialog-CBluIK-x.js → DiffDialog-CUEpuocY.js} +2 -2
  13. package/dist/chunks/Doctor-B540I-gq.js +1 -0
  14. package/dist/chunks/Doctor-DlE1Mbb9.js +3 -0
  15. package/dist/chunks/ExitFlow-DCIhnP5h.js +2 -0
  16. package/dist/chunks/Feedback-CDTqPqsM.js +2 -0
  17. package/dist/chunks/{Grove--kttLxvs.js → Grove-D9lSG_Lh.js} +1 -1
  18. package/dist/chunks/Grove-DLYXL8hv.js +1 -0
  19. package/dist/chunks/{HybridTransport-BgV5_7Az.js → HybridTransport-8j0AviF6.js} +4 -4
  20. package/dist/chunks/{InvalidConfigDialog-DCGwXW_p.js → InvalidConfigDialog-I3t-0nU3.js} +1 -1
  21. package/dist/chunks/{InvalidSettingsDialog-jTwsdXWr.js → InvalidSettingsDialog-BnthOxGT.js} +1 -1
  22. package/dist/chunks/MCPConnectionManager-zdocEDgk.js +1 -0
  23. package/dist/chunks/{McpParsingWarnings-WQrWJeWP.js → McpParsingWarnings-D0XvLirX.js} +1 -1
  24. package/dist/chunks/MessageSelector-BBhCstBa.js +3 -0
  25. package/dist/chunks/Messages-Dv2VrytX.js +11 -0
  26. package/dist/chunks/{Onboarding-BoIVNCgc.js → Onboarding-B1WRpoBI.js} +1 -1
  27. package/dist/chunks/{OverageCreditUpsell-1FCN8bH3.js → OverageCreditUpsell-BSmgq089.js} +1 -1
  28. package/dist/chunks/PluginSettings-DN9rpwc_.js +17 -0
  29. package/dist/chunks/{PromptInputFooterSuggestions-CrGST0Cq.js → PromptInputFooterSuggestions-3rjz6zhK.js} +1 -1
  30. package/dist/chunks/{PromptInputHelpMenu-B2TDpbpw.js → PromptInputHelpMenu-DgDJHZqC.js} +1 -1
  31. package/dist/chunks/QueryEngine-BnaHDZVZ.js +1 -0
  32. package/dist/chunks/REPL-B3RbzeV7.js +1 -0
  33. package/dist/chunks/{REPL-BV4WyYMg.js → REPL-CA8FEO7J.js} +44 -44
  34. package/dist/chunks/{RemoteCallout-DS_EV6Fh.js → RemoteCallout-BFzCx_Pn.js} +1 -1
  35. package/dist/chunks/RemoteSessionManager-BhUrtejX.js +2 -0
  36. package/dist/chunks/ResumeConversation-BseKUFRI.js +1 -0
  37. package/dist/chunks/{SSETransport-BXiEBMpb.js → SSETransport-DGIytG74.js} +3 -3
  38. package/dist/chunks/SearchExtraToolsTool-h6OunbMd.js +1 -0
  39. package/dist/chunks/Settings-BvhG1XoW.js +2 -0
  40. package/dist/chunks/{TeleportProgress-CcDzMC5L.js → TeleportProgress-Bens06DU.js} +1 -1
  41. package/dist/chunks/{TeleportRepoMismatchDialog-DZbxl4sD.js → TeleportRepoMismatchDialog-BtLBCZUe.js} +1 -1
  42. package/dist/chunks/{TeleportResumeWrapper-EowJO5nm.js → TeleportResumeWrapper-t50LfWyN.js} +1 -1
  43. package/dist/chunks/{ThemePicker-BYbChJpu.js → ThemePicker-BTfuZZ7E.js} +1 -1
  44. package/dist/chunks/TrustDialog-CgE_pYUK.js +1 -0
  45. package/dist/chunks/{ValidationErrorsList-Cx-hoRwG.js → ValidationErrorsList-Bl68E-2-.js} +1 -1
  46. package/dist/chunks/WelcomeV2-C93xQYAF.js +1 -0
  47. package/dist/chunks/{add-dir-CWt69NAZ.js → add-dir-C3IhJYVH.js} +1 -1
  48. package/dist/chunks/{agentDisplay-CQ4mZWFH.js → agentDisplay-Cju-aXCx.js} +1 -1
  49. package/dist/chunks/{agents-D4clhuCl.js → agents-Bhg0CtXR.js} +7 -7
  50. package/dist/chunks/{agents-C6jzKOit.js → agents-Du3FQ82k.js} +1 -1
  51. package/dist/chunks/{allErrors-HMPqE0jK.js → allErrors-DJYCAtab.js} +1 -1
  52. package/dist/chunks/{ant-9Z5bppVC.js → ant-CVvy4SuO.js} +1 -1
  53. package/dist/chunks/api-CI8HXREw.js +1 -0
  54. package/dist/chunks/api-gJBnC8z3.js +1 -0
  55. package/dist/chunks/asciicast-BsWpcxrc.js +1 -0
  56. package/dist/chunks/{asciicast-n-BBfgDq.js → asciicast-CbAjUHT_.js} +4 -4
  57. package/dist/chunks/{assistant-BA9_Mo9U.js → assistant-C83quuNj.js} +1 -1
  58. package/dist/chunks/{assistant-BiNOSla3.js → assistant-C_SkUDk_.js} +1 -1
  59. package/dist/chunks/assistant-z2o4-UJe.js +1 -0
  60. package/dist/chunks/auth-B9V3i5oZ.js +1 -0
  61. package/dist/chunks/auth-CgEABs3i.js +15 -0
  62. package/dist/chunks/auth-fSFfSKy_.js +1 -0
  63. package/dist/chunks/{autoMode-Db4QrgFr.js → autoMode-CZyb-mMY.js} +7 -7
  64. package/dist/chunks/{autonomy-BkAMA7du.js → autonomy-BpINX4jw.js} +1 -1
  65. package/dist/chunks/{autonomy-D4Vy-RPQ.js → autonomy-DJZ25xZp.js} +7 -7
  66. package/dist/chunks/{autonomyPanel-EjfO8jvg.js → autonomyPanel-ssoiIOx5.js} +1 -1
  67. package/dist/chunks/{backgroundHousekeeping-hDDE8mJC.js → backgroundHousekeeping-BHncba6e.js} +3 -3
  68. package/dist/chunks/backgroundHousekeeping-QK8iEXoI.js +1 -0
  69. package/dist/chunks/{banner-hD6wZygx.js → banner-CWkrK10u.js} +1 -1
  70. package/dist/chunks/bg-B0iMGM9C.js +1 -0
  71. package/dist/chunks/{bg-DQ0Q3Qv-.js → bg-WnYN5ifx.js} +2 -2
  72. package/dist/chunks/{branch-CeQ9IyZk.js → branch-BXo5z2al.js} +1 -1
  73. package/dist/chunks/{break-cache-Bd0clV2N.js → break-cache-BQfgkNAo.js} +2 -2
  74. package/dist/chunks/{bridge-yerAiaK2.js → bridge-CbKc1HeD.js} +2 -2
  75. package/dist/chunks/bridgeConfig-CLHy-BiF.js +1 -0
  76. package/dist/chunks/{bridgeConfig-CCtXe8ak.js → bridgeConfig-DbqUHe0H.js} +1 -1
  77. package/dist/chunks/bridgeEnabled-BWSUZ7Xg.js +1 -0
  78. package/dist/chunks/{bridgeEnabled--F-6TUi4.js → bridgeEnabled-CM3SaumJ.js} +1 -1
  79. package/dist/chunks/bridgeMain-BESKzpm0.js +1 -0
  80. package/dist/chunks/bridgeMain-CzhBVCsN.js +68 -0
  81. package/dist/chunks/bridgeMessaging-lfa_v3oi.js +1 -0
  82. package/dist/chunks/bridgePointer-MqLe5Asm.js +1 -0
  83. package/dist/chunks/{browser-Bd7GeBH1.js → browser-BmZuQom6.js} +1 -1
  84. package/dist/chunks/{btw-CVGRmL9a.js → btw-Cp0whJaJ.js} +1 -1
  85. package/dist/chunks/{caches-BtmAri4e.js → caches-CmW7idg5.js} +2 -2
  86. package/dist/chunks/caches-CpqTC0Lb.js +1 -0
  87. package/dist/chunks/ccrClient-BPXmxWHw.js +1 -0
  88. package/dist/chunks/{claudeDesktop-aUMx06RK.js → claudeDesktop-Cx31Ugjp.js} +1 -1
  89. package/dist/chunks/{clear-C6nRzIQE.js → clear-DjGPxX7T.js} +1 -1
  90. package/dist/chunks/{cliLaunch-2AUoMnqx.js → cliLaunch-BkPAatcs.js} +1 -1
  91. package/dist/chunks/client-DPUvQ6Rf.js +1 -0
  92. package/dist/chunks/{color-DXI_4ibU.js → color-DYYBN52b.js} +1 -1
  93. package/dist/chunks/commands-D7l3P1k9.js +1 -0
  94. package/dist/chunks/commitAttribution-B7NUPJ8E.js +1 -0
  95. package/dist/chunks/{commitAttribution-Cm40fdNU.js → commitAttribution-Bmzgtqc6.js} +2 -2
  96. package/dist/chunks/compact-D6xqZN4Q.js +2 -0
  97. package/dist/chunks/{completionCache-BQaLkB4d.js → completionCache-MN3_MqK8.js} +2 -2
  98. package/dist/chunks/completionCache-c4aiyZ_f.js +1 -0
  99. package/dist/chunks/config-DiT2Z8dY.js +3 -0
  100. package/dist/chunks/config-huQaTcNb.js +1 -0
  101. package/dist/chunks/config-qLaiAn7z.js +1 -0
  102. package/dist/chunks/{context-C_cKrBUn.js → context-Bh_iUj76.js} +1 -1
  103. package/dist/chunks/context-noninteractive-CNot6jbs.js +1 -0
  104. package/dist/chunks/{context-noninteractive-DnH6Q9Lu.js → context-noninteractive-Cb3EM2Oz.js} +2 -2
  105. package/dist/chunks/conversation-CSpwF3Ha.js +1 -0
  106. package/dist/chunks/conversation-CvCQta8e.js +1 -0
  107. package/dist/chunks/{createSSHSession--bWmmIk9.js → createSSHSession-B0s839mX.js} +5 -5
  108. package/dist/chunks/createSession-GNSNbUbN.js +1 -0
  109. package/dist/chunks/{createSession-DIr4sUp6.js → createSession-VMTMXOHu.js} +1 -1
  110. package/dist/chunks/crossProjectResume-DGpgCUfk.js +40 -0
  111. package/dist/chunks/cwd--nvsx73T.js +1 -0
  112. package/dist/chunks/{cwd-BuJhkTrc.js → cwd-CYmmnQVS.js} +1 -1
  113. package/dist/chunks/{daemon-B9lBPdBJ.js → daemon-YtZbMQtn.js} +1 -1
  114. package/dist/chunks/datadog-D9rlcN12.js +1 -0
  115. package/dist/chunks/{debug-IKW-jE7K.js → debug-BrXObCdR.js} +2 -2
  116. package/dist/chunks/{debugUtils-D2981c0Z.js → debugUtils-NO5KtXqi.js} +1 -1
  117. package/dist/chunks/{desktop-B5cvrcOQ.js → desktop-DidI-4N5.js} +1 -1
  118. package/dist/chunks/{detached-rfIUyc-B.js → detached-TYk4hMFj.js} +1 -1
  119. package/dist/chunks/{detectRepository-ReZ0Fz8Z.js → detectRepository-BPr0VWNO.js} +1 -1
  120. package/dist/chunks/detectRepository-BTPgN89l.js +1 -0
  121. package/dist/chunks/{diff-cXAp9cNN.js → diff-CZg5qL2n.js} +1 -1
  122. package/dist/chunks/{directoryCompletion-DBM2o5kx.js → directoryCompletion-CW2ckkQg.js} +1 -1
  123. package/dist/chunks/doctor-CKUXGCri.js +1 -0
  124. package/dist/chunks/{effort-Br8KKHdx.js → effort-BcvNemuq.js} +2 -2
  125. package/dist/chunks/entry-dA1UCfC0.js +14 -0
  126. package/dist/chunks/envLessBridgeConfig-BFjJ8Kt4.js +1 -0
  127. package/dist/chunks/envLessBridgeConfig-bei51W3H.js +1 -0
  128. package/dist/chunks/esm-DjGYYlQe.js +1 -0
  129. package/dist/chunks/{execFileNoThrow-COKYqVQj.js → execFileNoThrow-D244NytW.js} +1 -1
  130. package/dist/chunks/execSyncWrapper-CCMQShK-.js +1 -0
  131. package/dist/chunks/exit-COMnVxzw.js +1 -0
  132. package/dist/chunks/extra-usage-BTv_OwGN.js +1 -0
  133. package/dist/chunks/extra-usage-By33zGLT.js +1 -0
  134. package/dist/chunks/{extra-usage-core-CdL1ltqq.js → extra-usage-core-RZMzaH0L.js} +1 -1
  135. package/dist/chunks/{extra-usage-noninteractive-DxxRI0Yx.js → extra-usage-noninteractive-BB-BQ3kh.js} +1 -1
  136. package/dist/chunks/{extraUsage-BYZdi44Y.js → extraUsage-CTn9FWSk.js} +1 -1
  137. package/dist/chunks/extractMemories-CXGZGe0h.js +1 -0
  138. package/dist/chunks/fast-BXzdzzXU.js +1 -0
  139. package/dist/chunks/{fast-DKqiojzf.js → fast-CNXgsvnE.js} +1 -1
  140. package/dist/chunks/{feedback-yB19xph5.js → feedback-DeJ2gvw2.js} +1 -1
  141. package/dist/chunks/{file-D1cN3LMK.js → file-DcZWPH2V.js} +5 -5
  142. package/dist/chunks/{files-DAzGtmzz.js → files-Cz1-PK3r.js} +1 -1
  143. package/dist/chunks/firstPartyEventLogger-CQdJn3LV.js +5 -0
  144. package/dist/chunks/firstPartyEventLogger-CdLshdJY.js +1 -0
  145. package/dist/chunks/{flushGate-ZFr8yv7F.js → flushGate-CJ73xcaK.js} +1 -1
  146. package/dist/chunks/gemini-Cn9bMXwP.js +1 -0
  147. package/dist/chunks/generateRecap-BO9kzRon.js +1 -0
  148. package/dist/chunks/{generateSessionName-48veu5dv.js → generateSessionName-CGpL6ATy.js} +1 -1
  149. package/dist/chunks/{genericProcessUtils-F1Qcb1sO.js → genericProcessUtils-CdQTApYX.js} +1 -1
  150. package/dist/chunks/git-CbcnOf0E.js +1 -0
  151. package/dist/chunks/git-Do0wJvux.js +6 -0
  152. package/dist/chunks/{githubRepoPathMapping-BlR0BphY.js → githubRepoPathMapping-C4umZ1oC.js} +1 -1
  153. package/dist/chunks/{goal-Bn8Kz2Dp.js → goal-C8Qzl7_i.js} +3 -3
  154. package/dist/chunks/{grok-DhnO_KDC.js → grok-CDT9P_BL.js} +1 -1
  155. package/dist/chunks/{grove-DotW04-v.js → grove-BGXzEyH9.js} +2 -2
  156. package/dist/chunks/{heapdump-DkZSKNbp.js → heapdump-CFHvdSZv.js} +5 -5
  157. package/dist/chunks/{help-DU_BcZtU.js → help-DUZ7Y7Em.js} +1 -1
  158. package/dist/chunks/{hooks-BTMWE5Qx.js → hooks-RHwUCXcT.js} +2 -2
  159. package/dist/chunks/hooks-fZ1r0jUF.js +1 -0
  160. package/dist/chunks/{hostGuard-Dh296c6q.js → hostGuard-C5xydXZI.js} +1 -1
  161. package/dist/chunks/inboundAttachments-Cfl4_n0S.js +1 -0
  162. package/dist/chunks/inboundAttachments-YMxf4fmR.js +1 -0
  163. package/dist/chunks/initReplBridge-GH3-LHF4.js +1 -0
  164. package/dist/chunks/install-OkuNmjmB.js +1 -0
  165. package/dist/chunks/{instrumentation-H0XRS1yG.js → instrumentation-hrXeo-G4.js} +6 -6
  166. package/dist/chunks/{job-DKtLkF8V.js → job-DjmIpwJl.js} +1 -1
  167. package/dist/chunks/jwtUtils-DE2GPUcx.js +1 -0
  168. package/dist/chunks/keybindings-B8U17bhs.js +2 -0
  169. package/dist/chunks/{language-BuRSO2sR.js → language-BA5WprZv.js} +1 -1
  170. package/dist/chunks/language-BbaOTWm3.js +1 -0
  171. package/dist/chunks/{launchAgentsPlatform-BQyPdrHp.js → launchAgentsPlatform-DnxH2SAn.js} +1 -1
  172. package/dist/chunks/{launchLocalMemory-CWHAj7CX.js → launchLocalMemory-CgXtGng1.js} +2 -2
  173. package/dist/chunks/{launchLocalVault-D8iJdtsP.js → launchLocalVault-Bs6Km3Ua.js} +3 -3
  174. package/dist/chunks/{launchMemoryStores-W7jWG2uH.js → launchMemoryStores-DxVAIJuB.js} +1 -1
  175. package/dist/chunks/{launchOnboarding-q__LaLy1.js → launchOnboarding-Cn0t_o2k.js} +1 -1
  176. package/dist/chunks/{launchSchedule-BWi9F5vh.js → launchSchedule-Chwr3Nzd.js} +1 -1
  177. package/dist/chunks/{launchSkillStore-4wd4MQBc.js → launchSkillStore-6zxJfWVU.js} +1 -1
  178. package/dist/chunks/{launchTeleport-BlCf2QM_.js → launchTeleport-Ba_Hj13c.js} +1 -1
  179. package/dist/chunks/{launchVault-C7u7LZV7.js → launchVault-hGVrHy33.js} +1 -1
  180. package/dist/chunks/{v4-jw6qOKwQ.js → lazySchema-DcIJE_0i.js} +1 -1
  181. package/dist/chunks/loadAgentsDir-BHOyHxwz.js +1 -0
  182. package/dist/chunks/{loadAgentsDir-nzr38hai.js → loadAgentsDir-DrDu5yYy.js} +691 -689
  183. package/dist/chunks/loadPluginHooks-s7bvGtns.js +1 -0
  184. package/dist/chunks/localSearch-CebU5BA9.js +1 -0
  185. package/dist/chunks/{localSearch-B-L_ldos.js → localSearch-_bQhk9W6.js} +1 -1
  186. package/dist/chunks/{log-B3eB4EFv.js → log-BMCygSzM.js} +1 -1
  187. package/dist/chunks/{logoV2Utils-RQ160dI2.js → logoV2Utils-CoC4nheD.js} +1 -1
  188. package/dist/chunks/{magicDocs-BqZ0GewA.js → magicDocs-kMjYpjCA.js} +3 -3
  189. package/dist/chunks/main-C_rVSWfm.js +859 -0
  190. package/dist/chunks/{main-DeFMhaFE.js → main-D862LI_d.js} +3 -3
  191. package/dist/chunks/{mappers-CWykjGfP.js → mappers-D0CNXG32.js} +1 -1
  192. package/dist/chunks/mcp-1ZuFesM9.js +2 -0
  193. package/dist/chunks/mcp-CKvGBEjz.js +1 -0
  194. package/dist/chunks/mcp-DtxIl6aN.js +6 -0
  195. package/dist/chunks/{memoize-BO31Ws9Q.js → memoize-B0zhbT8Z.js} +1 -1
  196. package/dist/chunks/{memory-DcpPpYN0.js → memory-DE2jtkd_.js} +1 -1
  197. package/dist/chunks/{mode-BkViT_0o.js → mode-B4WIxCMW.js} +2 -2
  198. package/dist/chunks/model-C4RHNhDQ.js +1 -0
  199. package/dist/chunks/model-fi472PRc.js +1 -0
  200. package/dist/chunks/{model-CZktWw6o.js → model-j9GNZDFr.js} +1 -1
  201. package/dist/chunks/nativeInstaller-DktvrWRd.js +1 -0
  202. package/dist/chunks/{onChangeAppState-DwGVi-BC.js → onChangeAppState-CGVeNkt7.js} +1 -1
  203. package/dist/chunks/{openai-B2wxZDQx.js → openai-BSVjSJiF.js} +3 -3
  204. package/dist/chunks/{overageCreditGrant-CjK49axw.js → overageCreditGrant-BVxlYgeU.js} +1 -1
  205. package/dist/chunks/{panel-R4ue6pSW.js → panel-Be-OxtqL.js} +1 -1
  206. package/dist/chunks/{panel-B-nrcHpm.js → panel-CrTPqXCv.js} +1 -1
  207. package/dist/chunks/{panelCall-I_fbgub5.js → panelCall-Cp6fpQeL.js} +1 -1
  208. package/dist/chunks/parser-Bf6iasPV.js +1 -0
  209. package/dist/chunks/{parser-CQrasoUB.js → parser-DFwaTGf7.js} +1 -1
  210. package/dist/chunks/{partition-CxRF7T-f.js → partition-RjCtgt9J.js} +1 -1
  211. package/dist/chunks/{passes-U_h-hNu-.js → passes-ByTLy6pj.js} +1 -1
  212. package/dist/chunks/{path-BCSE0S-c.js → path-D5U-tm91.js} +1 -1
  213. package/dist/chunks/permissions-B3df_htx.js +3 -0
  214. package/dist/chunks/pidLock-CdNZ0Wfg.js +3 -0
  215. package/dist/chunks/{pipeTransport-D3Qx9v1V.js → pipeTransport-CqCnc-Ys.js} +1 -1
  216. package/dist/chunks/{plan-BAhStVci.js → plan-BxTA-b4l.js} +1 -1
  217. package/dist/chunks/{platform-EtecGacO.js → platform-BrYefG_2.js} +1 -1
  218. package/dist/chunks/{plugin-D9huNnv6.js → plugin-DOpl5e1t.js} +1 -1
  219. package/dist/chunks/{pluginAutoupdate-BfmyxR5g.js → pluginAutoupdate-L09CQ-ph.js} +1 -1
  220. package/dist/chunks/pluginBlocklist-B32eWmzn.js +1 -0
  221. package/dist/chunks/pluginCliCommands-CDMWnO3d.js +1 -0
  222. package/dist/chunks/{pluginFlagging-BVy7Xv_0.js → pluginFlagging-3FQGvIfq.js} +1 -1
  223. package/dist/chunks/pluginOperations-ClzXYNQe.js +2 -0
  224. package/dist/chunks/{pluginStartupCheck-w24D-wwk.js → pluginStartupCheck-BNd2QNzZ.js} +1 -1
  225. package/dist/chunks/pluginStartupCheck-RiZxW-WU.js +1 -0
  226. package/dist/chunks/plugins-CcDG95Bs.js +4 -0
  227. package/dist/chunks/policyLimits-Bwi9VqDF.js +1 -0
  228. package/dist/chunks/pollConfig-DH2oCtFS.js +1 -0
  229. package/dist/chunks/{poor-CfbMKZNJ.js → poor-DekfGNT7.js} +1 -1
  230. package/dist/chunks/poorMode-AE4WNYZo.js +1 -0
  231. package/dist/chunks/{poorMode-Bsw2V-V_.js → poorMode-CtcqaiwD.js} +1 -1
  232. package/dist/chunks/print-Cc_QOSPF.js +23 -0
  233. package/dist/chunks/{privacy-settings-DeGoBRrZ.js → privacy-settings-ChNsgGUs.js} +1 -1
  234. package/dist/chunks/processBashCommand-Bx6_oZoE.js +1 -0
  235. package/dist/chunks/processSlashCommand-AltWgIFt.js +5 -0
  236. package/dist/chunks/prompt-C0nU0VK3.js +139 -0
  237. package/dist/chunks/prompt-CYx145pp.js +1 -0
  238. package/dist/chunks/prompt-DH3lKFag.js +1 -0
  239. package/dist/chunks/{promptEditor-foiayhdY.js → promptEditor-Cumef6hJ.js} +2 -2
  240. package/dist/chunks/{protocolHandler-BsiB1oW_.js → protocolHandler-z2zxAtB1.js} +4 -4
  241. package/dist/chunks/{proxy-Cn2YwITp.js → proxy-CRN7jYIi.js} +3 -3
  242. package/dist/chunks/{rate-limit-options-DTJPDcTr.js → rate-limit-options-VL7S3SCx.js} +1 -1
  243. package/dist/chunks/rcDebugLog-2-1XSyFV.js +11 -0
  244. package/dist/chunks/reconciler-DHRE_gV2.js +4 -0
  245. package/dist/chunks/{referral-DP_GshTS.js → referral-DrebVwqx.js} +1 -1
  246. package/dist/chunks/refresh-pFezssA8.js +1 -0
  247. package/dist/chunks/{registerProtocol-CjxlFsKw.js → registerProtocol-CukLQuxJ.js} +5 -5
  248. package/dist/chunks/{release-notes-BxgK8zWO.js → release-notes-D7vrFNXp.js} +1 -1
  249. package/dist/chunks/{releaseNotes-CbSktIJW.js → releaseNotes-CDx2P0fb.js} +2 -2
  250. package/dist/chunks/{reload-plugins-CDu6yU5-.js → reload-plugins-CltHfg-l.js} +1 -1
  251. package/dist/chunks/{remote-env-B4HnhISc.js → remote-env-SvvSuP0J.js} +1 -1
  252. package/dist/chunks/remoteBridgeCore-BOeljn2c.js +1 -0
  253. package/dist/chunks/remoteManagedSettings-CaY_ZH8r.js +1 -0
  254. package/dist/chunks/{rename-DlbMb24l.js → rename-CbqrCCBO.js} +1 -1
  255. package/dist/chunks/{renderOptions-5kWQpVr2.js → renderOptions-BUJB9nAm.js} +1 -1
  256. package/dist/chunks/{resume-BB5iBogS.js → resume-DockJaY9.js} +2 -2
  257. package/dist/chunks/{ripgrep-BvDwiKJ3.js → ripgrep-BXmXjAzA.js} +1 -1
  258. package/dist/chunks/ripgrep-BfIpz5uC.js +1 -0
  259. package/dist/chunks/{runtimeObserver-BNH2WGE3.js → runtimeObserver-DSUuYKfs.js} +1 -1
  260. package/dist/chunks/{runtimeObserver-Ci-5gvYg.js → runtimeObserver-XufSllVw.js} +4 -4
  261. package/dist/chunks/sandbox-adapter-CEZnHq0U.js +1 -0
  262. package/dist/chunks/{sandbox-toggle-B2Yk4y2V.js → sandbox-toggle-CZI5fuK3.js} +1 -1
  263. package/dist/chunks/searchExtraTools-iQfI39wB.js +1 -0
  264. package/dist/chunks/{session-Bmx7L3Mt.js → session-B-Z3DU9o.js} +2 -2
  265. package/dist/chunks/{sessionDiscovery-DcEAr5vJ.js → sessionDiscovery-C3pMZkBM.js} +1 -1
  266. package/dist/chunks/sessionFileAccessHooks-DyrZmoA7.js +1 -0
  267. package/dist/chunks/sessionMemory-CqRpgwtU.js +1 -0
  268. package/dist/chunks/sessionMemory-D_HQmhj7.js +1 -0
  269. package/dist/chunks/sessionMemoryUtils-CZOIKrn0.js +1 -0
  270. package/dist/chunks/sessionObserver-B400YG3s.js +1 -0
  271. package/dist/chunks/{sessionObserver-DQwHsDrM.js → sessionObserver-B_09FQKV.js} +1 -1
  272. package/dist/chunks/sessionStorage-DRnvtrpU.js +1 -0
  273. package/dist/chunks/sessionTitle-CmLWNFuX.js +14 -0
  274. package/dist/chunks/{sessionTracing-BuLsL6qA.js → sessionTracing-lArOaj9u.js} +3 -3
  275. package/dist/chunks/settings-DfWP5y6X.js +19 -0
  276. package/dist/chunks/settingsSync-BlDk6rsM.js +1 -0
  277. package/dist/chunks/setup-DdbmxSZh.js +3 -0
  278. package/dist/chunks/{shadowedRuleDetection-7Z8ezTKF.js → shadowedRuleDetection-E2wF1UjU.js} +1 -1
  279. package/dist/chunks/{shellQuote-fB02N16J.js → shellQuote-DkSy9MYE.js} +1 -1
  280. package/dist/chunks/{sideQuestion-CYdNATPW.js → sideQuestion-BjHCLSR9.js} +1 -1
  281. package/dist/chunks/sinks-Cb--pqr-.js +2 -0
  282. package/dist/chunks/sinks-DbwDBd-E.js +1 -0
  283. package/dist/chunks/{skill-learning-E8tQed-Q.js → skill-learning-B0dyBT1_.js} +1 -1
  284. package/dist/chunks/skillChangeDetector-DQof8SUY.js +1 -0
  285. package/dist/chunks/{skillGapStore-CjJrxxjk.js → skillGapStore-75ZYlfwi.js} +2 -2
  286. package/dist/chunks/{skillGapStore-B5rl12bV.js → skillGapStore-D2fqmnKx.js} +1 -1
  287. package/dist/chunks/{skillGenerator-BDR_z3-X.js → skillGenerator-CwXUfM4Y.js} +2 -2
  288. package/dist/chunks/{skillLearning-BQtfFE0g.js → skillLearning-CB-5fdMl.js} +1 -1
  289. package/dist/chunks/skillLearning-CSY5R5Jn.js +1 -0
  290. package/dist/chunks/{skillPanel-yR8Oi-mO.js → skillPanel-Bum7xpgo.js} +3 -3
  291. package/dist/chunks/{skillSearchPanel-DUQQUCUS.js → skillSearchPanel-LSPwZIOw.js} +6 -6
  292. package/dist/chunks/{skills-NAZQ3j-t.js → skills-G8WBeffd.js} +1 -1
  293. package/dist/chunks/startupProfiler-DIWVcO4e.js +1 -0
  294. package/dist/chunks/{startupProfiler-DxRQteII.js → startupProfiler-xa3NmN7Z.js} +2 -2
  295. package/dist/chunks/state-BOa-3Av3.js +1 -0
  296. package/dist/chunks/{state-4KQ3kaqz.js → state-ix0xIunV.js} +1 -1
  297. package/dist/chunks/{stats-h4yu84Q-.js → stats-DmFubHpI.js} +1 -1
  298. package/dist/chunks/{status-is_Bg_IB.js → status-ClSsvm1N.js} +2 -2
  299. package/dist/chunks/{status-BbdeubJG.js → status-i5beKggW.js} +1 -1
  300. package/dist/chunks/{statusNoticeHelpers-CQ7CUugR.js → statusNoticeHelpers-BK-54uGY.js} +1 -1
  301. package/dist/chunks/{stickers-qJoNhPk4.js → stickers-D5teCKMN.js} +1 -1
  302. package/dist/chunks/{stringUtils-CvXbHQRH.js → stringUtils-DGLPkqJ4.js} +1 -1
  303. package/dist/chunks/systemPromptSections-CR_AoPIX.js +1 -0
  304. package/dist/chunks/{systemPromptSections-CgpggIYX.js → systemPromptSections-DN0HGVye.js} +1 -1
  305. package/dist/chunks/{tag-i3HZ4lhj.js → tag-DYYq4H_i.js} +2 -2
  306. package/dist/chunks/{tasks-HzsYNTZ1.js → tasks-BySzm_YJ.js} +1 -1
  307. package/dist/chunks/teleport-dxtBcM01.js +1 -0
  308. package/dist/chunks/{templateJobs-CIv_ysje.js → templateJobs-CT5VxeRr.js} +1 -1
  309. package/dist/chunks/terminalSetup-BNs9nLbT.js +33 -0
  310. package/dist/chunks/{terminalSetup-CxniwSF-.js → terminalSetup-RDKg8dVa.js} +1 -1
  311. package/dist/chunks/{theme-BKIHX_Dx.js → theme-CVTVsRwt.js} +1 -1
  312. package/dist/chunks/thinkback-B-GpXG9U.js +1 -0
  313. package/dist/chunks/thinkback-CXsRbDYN.js +1 -0
  314. package/dist/chunks/thinkback-play-BhfCaIye.js +1 -0
  315. package/dist/chunks/{tmux-CbsW-VDJ.js → tmux-BY7IdQ1f.js} +1 -1
  316. package/dist/chunks/{toolEventObserver-B1xvyKdE.js → toolEventObserver--4fqXxQZ.js} +1 -1
  317. package/dist/chunks/{toolEventObserver-8FQtxeVv.js → toolEventObserver-DdhPsAs1.js} +1 -1
  318. package/dist/chunks/toolPool-DvHECcbN.js +1 -0
  319. package/dist/chunks/trustedDevice-DvpN4J1F.js +1 -0
  320. package/dist/chunks/trustedDevice-e6iF1X7C.js +1 -0
  321. package/dist/chunks/{tui-fTa_pzdA.js → tui-C2yuCuOU.js} +3 -3
  322. package/dist/chunks/{types-a7X-tJpJ.js → types-C-MRCL8J.js} +3 -3
  323. package/dist/chunks/udsClient-BuCtv7dN.js +1 -0
  324. package/dist/chunks/{ultrareviewCommand-DCFRZsKp.js → ultrareviewCommand-i3PfFKly.js} +2 -2
  325. package/dist/chunks/undercover-CPvoDtJ1.js +1 -0
  326. package/dist/chunks/{undercover-CsLPQb-a.js → undercover-Q24TWRw0.js} +3 -3
  327. package/dist/chunks/{up-dO5BcPaq.js → up-BHkC97_C.js} +1 -1
  328. package/dist/chunks/updateCCB-CEXA6dax.js +11 -0
  329. package/dist/chunks/{upgrade-kpttjebY.js → upgrade-7OrBbrzS.js} +1 -1
  330. package/dist/chunks/upgrade-uR7SIVtx.js +1 -0
  331. package/dist/chunks/upload-B-lNHpWe.js +1 -0
  332. package/dist/chunks/{upstreamproxy-CvcjNY7J.js → upstreamproxy-DyR_eXO8.js} +4 -4
  333. package/dist/chunks/usage-7jOeIVv9.js +1 -0
  334. package/dist/chunks/{usage-CJ5w0907.js → usage-CZdPfUqP.js} +1 -1
  335. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-yAroCqu4.js → useExitOnCtrlCDWithKeybindings-CzFtdlnD.js} +1 -1
  336. package/dist/chunks/useMainLoopModel-DegH12LZ.js +1 -0
  337. package/dist/chunks/useManagePlugins-BkK1zydO.js +1 -0
  338. package/dist/chunks/{useMergedTools-CZJffsmf.js → useMergedTools-DMGRA1ga.js} +1 -1
  339. package/dist/chunks/{useSearchInput-C-CqUK6w.js → useSearchInput-D5VU9IDU.js} +1 -1
  340. package/dist/chunks/{useSettingsErrors-BWlJCgYF.js → useSettingsErrors-B5PSF1va.js} +1 -1
  341. package/dist/chunks/{util-DJV0joAW.js → util-CNa1ib_4.js} +1 -1
  342. package/dist/chunks/validatePlugin-Dw-RGCrm.js +1 -0
  343. package/dist/chunks/{vim-n8-UT5w-.js → vim-C0KTnJJs.js} +1 -1
  344. package/dist/chunks/{which-BBCjXfI2.js → which-CKQnSouy.js} +1 -1
  345. package/dist/chunks/windowsPaths-9pEkw0oV.js +1 -0
  346. package/dist/chunks/windowsPaths-DtapVxOo.js +1 -0
  347. package/dist/chunks/{workSecret-C_lv0dRh.js → workSecret-CNWiR2uQ.js} +1 -1
  348. package/dist/chunks/{workerRegistry-BdHi7_sN.js → workerRegistry-B2QD2sKq.js} +1 -1
  349. package/dist/chunks/worktree-D38cJ23W.js +1 -0
  350. package/dist/cli.js +1 -1
  351. package/package.json +4 -5
  352. package/dist/chunks/ApproveApiKey-DfAPwDix.js +0 -1
  353. package/dist/chunks/BackgroundTasksDialog-Dvhcgahe.js +0 -2
  354. package/dist/chunks/ClaudeMdExternalIncludesDialog-BV7HHcgL.js +0 -1
  355. package/dist/chunks/ConsoleOAuthFlow-CU5fCPKq.js +0 -1
  356. package/dist/chunks/Doctor-B0CRtxi2.js +0 -1
  357. package/dist/chunks/Doctor-WxNv49HC.js +0 -3
  358. package/dist/chunks/ExitFlow-CRPgptCN.js +0 -2
  359. package/dist/chunks/Feedback-CEtzaLr3.js +0 -2
  360. package/dist/chunks/Grove-CelgLWH4.js +0 -1
  361. package/dist/chunks/MCPConnectionManager-BX0LMz9J.js +0 -1
  362. package/dist/chunks/MessageSelector-_UZB8cGb.js +0 -3
  363. package/dist/chunks/Messages-jCoW_1Rr.js +0 -11
  364. package/dist/chunks/PluginSettings-BD9JLV9-.js +0 -17
  365. package/dist/chunks/QueryEngine-D2HUnwmU.js +0 -1
  366. package/dist/chunks/REPL-DcpN3MRC.js +0 -1
  367. package/dist/chunks/RemoteSessionManager-Tx1N2uVL.js +0 -2
  368. package/dist/chunks/ResumeConversation-Cw3vP4G8.js +0 -1
  369. package/dist/chunks/SearchExtraToolsTool-D3VOFq9R.js +0 -1
  370. package/dist/chunks/Settings-ns6mRsDc.js +0 -2
  371. package/dist/chunks/TrustDialog-DA3YTk_k.js +0 -1
  372. package/dist/chunks/WelcomeV2-BTfttGcv.js +0 -1
  373. package/dist/chunks/ajv-5vMo9UcX.js +0 -8
  374. package/dist/chunks/api-L2IgleTV.js +0 -1
  375. package/dist/chunks/api-TgV7fl9V.js +0 -1
  376. package/dist/chunks/asciicast-DYbkzGCN.js +0 -1
  377. package/dist/chunks/assistant-YvbVKjVh.js +0 -1
  378. package/dist/chunks/auth-CEig4Gxp.js +0 -1
  379. package/dist/chunks/auth-CbGDlhyO.js +0 -1
  380. package/dist/chunks/auth-DHyCIxCk.js +0 -15
  381. package/dist/chunks/backgroundHousekeeping-BNEKWHhH.js +0 -1
  382. package/dist/chunks/bg-BzG63WOm.js +0 -1
  383. package/dist/chunks/bridgeConfig-D5dB38xD.js +0 -1
  384. package/dist/chunks/bridgeEnabled-DKX8-T_H.js +0 -1
  385. package/dist/chunks/bridgeMain--R1HFbOv.js +0 -68
  386. package/dist/chunks/bridgeMain-d06JByZn.js +0 -1
  387. package/dist/chunks/bridgeMessaging-CqbLTDcx.js +0 -1
  388. package/dist/chunks/bridgePointer-W_jdQ8zf.js +0 -1
  389. package/dist/chunks/caches-BuTIAOtY.js +0 -1
  390. package/dist/chunks/ccrClient-HqMi5Kfu.js +0 -1
  391. package/dist/chunks/client-BeET1hnC.js +0 -1
  392. package/dist/chunks/commands-VjcG4qFq.js +0 -1
  393. package/dist/chunks/commitAttribution-Lb3qUlAR.js +0 -1
  394. package/dist/chunks/compact-DPTVpJ4D.js +0 -2
  395. package/dist/chunks/completionCache-CW8lKIgy.js +0 -1
  396. package/dist/chunks/config-0cRberzR.js +0 -1
  397. package/dist/chunks/config-BrxKpHpR.js +0 -1
  398. package/dist/chunks/config-C7YHKCPV.js +0 -3
  399. package/dist/chunks/config-CLmFk-5V.js +0 -1
  400. package/dist/chunks/context-noninteractive-rUZ3ydmJ.js +0 -1
  401. package/dist/chunks/conversation-GJxfkr6M.js +0 -1
  402. package/dist/chunks/conversation-oK3aFzqO.js +0 -1
  403. package/dist/chunks/createSession-DM4acqaC.js +0 -1
  404. package/dist/chunks/crossProjectResume-DKrtjTpm.js +0 -40
  405. package/dist/chunks/cwd-D-tY2NKc.js +0 -1
  406. package/dist/chunks/datadog-ByS7LGGa.js +0 -1
  407. package/dist/chunks/datadog-DNCsyfSO.js +0 -1
  408. package/dist/chunks/debug-DzZUT2Wv.js +0 -1
  409. package/dist/chunks/detectRepository-6nw-Aw3v.js +0 -1
  410. package/dist/chunks/doctor-CTMHXZvQ.js +0 -1
  411. package/dist/chunks/entry-4lIRMrLI.js +0 -14
  412. package/dist/chunks/envLessBridgeConfig-CGuIxFzJ.js +0 -1
  413. package/dist/chunks/envLessBridgeConfig-D_Jg4fJy.js +0 -1
  414. package/dist/chunks/esm-C8Zkk1Ux.js +0 -1
  415. package/dist/chunks/execSyncWrapper-DZJ3tNWF.js +0 -1
  416. package/dist/chunks/exit-Z9oWrqE4.js +0 -1
  417. package/dist/chunks/extra-usage-BS4aVOt5.js +0 -1
  418. package/dist/chunks/extra-usage-DtAIhW74.js +0 -1
  419. package/dist/chunks/extractMemories-C4f9JWuI.js +0 -1
  420. package/dist/chunks/fast-B0OB4x7K.js +0 -1
  421. package/dist/chunks/firstPartyEventLogger-CdUpe6Lh.js +0 -1
  422. package/dist/chunks/firstPartyEventLogger-hU-LPkje.js +0 -5
  423. package/dist/chunks/gemini-DqAv8_GY.js +0 -1
  424. package/dist/chunks/generateRecap-lO2PDlx8.js +0 -1
  425. package/dist/chunks/git-BE_FiJZp.js +0 -1
  426. package/dist/chunks/git-tyaWOgRL.js +0 -6
  427. package/dist/chunks/hooks-DONAb_nq.js +0 -1
  428. package/dist/chunks/inboundAttachments-BcEgi49j.js +0 -1
  429. package/dist/chunks/inboundAttachments-DVs3_m48.js +0 -1
  430. package/dist/chunks/initReplBridge-D0Xec8S-.js +0 -1
  431. package/dist/chunks/install-BkfXeXpv.js +0 -1
  432. package/dist/chunks/jwtUtils-C-ojmb8W.js +0 -1
  433. package/dist/chunks/keybindings-ez51eHHp.js +0 -2
  434. package/dist/chunks/language-Da4KNbjm.js +0 -1
  435. package/dist/chunks/lazySchema-uxlVVNM1.js +0 -1
  436. package/dist/chunks/loadAgentsDir-Dgd-fzNt.js +0 -1
  437. package/dist/chunks/loadPluginHooks-z1-zvBLw.js +0 -1
  438. package/dist/chunks/localSearch-D-FprOMr.js +0 -1
  439. package/dist/chunks/main-y7LJ5qUc.js +0 -1243
  440. package/dist/chunks/mcp-CSFPAfaW.js +0 -2
  441. package/dist/chunks/mcp-DBwT4pa9.js +0 -6
  442. package/dist/chunks/mcp-DvZTaHZE.js +0 -1
  443. package/dist/chunks/metadata-BRLJvh61.js +0 -1
  444. package/dist/chunks/model--z4Di9QO.js +0 -1
  445. package/dist/chunks/model-DfFA3qMO.js +0 -1
  446. package/dist/chunks/nativeInstaller-GcIk7G2Y.js +0 -1
  447. package/dist/chunks/parser-BlM_Fk4J.js +0 -1
  448. package/dist/chunks/permissions-B8epy16o.js +0 -3
  449. package/dist/chunks/pidLock-CBJDnBG_.js +0 -3
  450. package/dist/chunks/pluginBlocklist-03sZaZa6.js +0 -1
  451. package/dist/chunks/pluginCliCommands-P2Ndi1r1.js +0 -1
  452. package/dist/chunks/pluginOperations-Cz37qcjF.js +0 -2
  453. package/dist/chunks/pluginStartupCheck-BqUwHcMD.js +0 -1
  454. package/dist/chunks/plugins-B0hiIN4q.js +0 -4
  455. package/dist/chunks/policyLimits-Dem-XJ_h.js +0 -1
  456. package/dist/chunks/pollConfig-C2Ac8WMU.js +0 -1
  457. package/dist/chunks/poorMode-jvImnkty.js +0 -1
  458. package/dist/chunks/print-ozjC0Mhg.js +0 -23
  459. package/dist/chunks/processBashCommand-loWZ8MSE.js +0 -1
  460. package/dist/chunks/processSlashCommand-BdouajZb.js +0 -5
  461. package/dist/chunks/prompt-Bef63FhB.js +0 -132
  462. package/dist/chunks/prompt-C7wd1H_i.js +0 -1
  463. package/dist/chunks/prompt-DIoNqZvO.js +0 -1
  464. package/dist/chunks/rcDebugLog-BUuD-X1D.js +0 -11
  465. package/dist/chunks/reconciler-DqXTmV3J.js +0 -4
  466. package/dist/chunks/refresh-CNzXPAFw.js +0 -1
  467. package/dist/chunks/remoteBridgeCore-D-wG5jau.js +0 -1
  468. package/dist/chunks/remoteManagedSettings-B7gt0VAX.js +0 -1
  469. package/dist/chunks/ripgrep-BQgJ02F9.js +0 -1
  470. package/dist/chunks/sandbox-adapter-Coe1GDAE.js +0 -1
  471. package/dist/chunks/searchExtraTools-BnWZ9roi.js +0 -1
  472. package/dist/chunks/sessionFileAccessHooks-BhdOmW9o.js +0 -1
  473. package/dist/chunks/sessionMemory-Bsg2unYX.js +0 -1
  474. package/dist/chunks/sessionMemory-CIbCojm-.js +0 -1
  475. package/dist/chunks/sessionMemoryUtils-Cjb57wtC.js +0 -1
  476. package/dist/chunks/sessionObserver-CRU1qWnP.js +0 -1
  477. package/dist/chunks/sessionStorage-BxDN8qRc.js +0 -1
  478. package/dist/chunks/sessionTitle-B8jcexkQ.js +0 -14
  479. package/dist/chunks/settings-5PQdphqC.js +0 -19
  480. package/dist/chunks/settingsSync-BDeuErb5.js +0 -1
  481. package/dist/chunks/setup-BKEnSLR9.js +0 -3
  482. package/dist/chunks/sink-DjKoYMsA.js +0 -1
  483. package/dist/chunks/sink-iYxWapbU.js +0 -1
  484. package/dist/chunks/sinks-GryGVRT8.js +0 -2
  485. package/dist/chunks/sinks-jfaIjsRJ.js +0 -1
  486. package/dist/chunks/skillChangeDetector-A8SAuyo9.js +0 -1
  487. package/dist/chunks/skillLearning-C8ihdryM.js +0 -1
  488. package/dist/chunks/src-xRRBgNzF.js +0 -25
  489. package/dist/chunks/startupProfiler-B0m6crkd.js +0 -1
  490. package/dist/chunks/state-53JDbNQM.js +0 -1
  491. package/dist/chunks/stdio-4S7b8Uhx.js +0 -1
  492. package/dist/chunks/stdio-W_Kokrkh.js +0 -3
  493. package/dist/chunks/systemPromptSections-IePG5K8r.js +0 -1
  494. package/dist/chunks/teleport-hN3cAbYC.js +0 -1
  495. package/dist/chunks/terminalSetup-C0PF87iu.js +0 -33
  496. package/dist/chunks/thinkback-BA4cMz4D.js +0 -1
  497. package/dist/chunks/thinkback-mT-8FIT-.js +0 -1
  498. package/dist/chunks/thinkback-play-Cfk49mvF.js +0 -1
  499. package/dist/chunks/toolPool-CHVDZqh7.js +0 -1
  500. package/dist/chunks/trustedDevice-BYCh1ff7.js +0 -1
  501. package/dist/chunks/trustedDevice-DnIWErCt.js +0 -1
  502. package/dist/chunks/udsClient-Cg9bBD0p.js +0 -1
  503. package/dist/chunks/undercover-B-kKUWtK.js +0 -1
  504. package/dist/chunks/updateCCB-CfUnkOLT.js +0 -11
  505. package/dist/chunks/upgrade-CngUwvY4.js +0 -1
  506. package/dist/chunks/upload-DDhQqV8n.js +0 -1
  507. package/dist/chunks/usage-eZRwLa77.js +0 -1
  508. package/dist/chunks/useMainLoopModel-BNFW-g8E.js +0 -1
  509. package/dist/chunks/useManagePlugins-CTtPaQRP.js +0 -1
  510. package/dist/chunks/validatePlugin-CRmpIGLV.js +0 -1
  511. package/dist/chunks/windowsPaths-D6T_3XaU.js +0 -1
  512. package/dist/chunks/windowsPaths-DUKTzBck.js +0 -1
  513. package/dist/chunks/worktree-YDeHMlHZ.js +0 -1
@@ -1 +1 @@
1
- import{n as e,t}from"./axios-DaWTGg7G.js";import{D as n,E as r,O as i}from"./debug-IKW-jE7K.js";t(),r();function a(e){let t=n(Buffer.from(e,`base64url`).toString(`utf-8`));if(!t||typeof t!=`object`||!(`version`in t)||t.version!==1)throw Error(`Unsupported work secret version: ${t&&typeof t==`object`&&`version`in t?t.version:`unknown`}`);let r=t;if(typeof r.session_ingress_token!=`string`||r.session_ingress_token.length===0)throw Error(`Invalid work secret: missing or empty session_ingress_token`);if(typeof r.api_base_url!=`string`)throw Error(`Invalid work secret: missing api_base_url`);return t}function o(e,t){let n=e.includes(`localhost`)||e.includes(`127.0.0.1`),r=e.startsWith(`https`)?`wss`:`ws`,i=n?`v2`:`v1`;return`${r}://${e.replace(/^https?:\/\//,``).replace(/\/+$/,``)}/${i}/session_ingress/ws/${t}`}function s(e,t){if(e===t)return!0;let n=e.slice(e.lastIndexOf(`_`)+1),r=t.slice(t.lastIndexOf(`_`)+1);return n.length>=4&&n===r}function c(e,t){return`${e.replace(/\/+$/,``)}/v1/code/sessions/${t}`}async function l(t,n){let r=await e.post(`${t}/worker/register`,{},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`},timeout:1e4}),a=r.data?.worker_epoch,o=typeof a==`string`?Number(a):a;if(typeof o!=`number`||!Number.isFinite(o)||!Number.isSafeInteger(o))throw Error(`registerWorker: invalid worker_epoch in response: ${i(r.data)}`);return o}export{s as a,l as i,o as n,a as r,c as t};
1
+ import{n as e,t}from"./axios-DaWTGg7G.js";import{C as n,S as r,w as i}from"./debug-BrXObCdR.js";t(),r();function a(e){let t=n(Buffer.from(e,`base64url`).toString(`utf-8`));if(!t||typeof t!=`object`||!(`version`in t)||t.version!==1)throw Error(`Unsupported work secret version: ${t&&typeof t==`object`&&`version`in t?t.version:`unknown`}`);let r=t;if(typeof r.session_ingress_token!=`string`||r.session_ingress_token.length===0)throw Error(`Invalid work secret: missing or empty session_ingress_token`);if(typeof r.api_base_url!=`string`)throw Error(`Invalid work secret: missing api_base_url`);return t}function o(e,t){let n=e.includes(`localhost`)||e.includes(`127.0.0.1`),r=e.startsWith(`https`)?`wss`:`ws`,i=n?`v2`:`v1`;return`${r}://${e.replace(/^https?:\/\//,``).replace(/\/+$/,``)}/${i}/session_ingress/ws/${t}`}function s(e,t){if(e===t)return!0;let n=e.slice(e.lastIndexOf(`_`)+1),r=t.slice(t.lastIndexOf(`_`)+1);return n.length>=4&&n===r}function c(e,t){return`${e.replace(/\/+$/,``)}/v1/code/sessions/${t}`}async function l(t,n){let r=await e.post(`${t}/worker/register`,{},{headers:{Authorization:`Bearer ${n}`,"Content-Type":`application/json`,"anthropic-version":`2023-06-01`},timeout:1e4}),a=r.data?.worker_epoch,o=typeof a==`string`?Number(a):a;if(typeof o!=`number`||!Number.isFinite(o)||!Number.isSafeInteger(o))throw Error(`registerWorker: invalid worker_epoch in response: ${i(r.data)}`);return o}export{s as a,l as i,o as n,a as r,c as t};
@@ -1 +1 @@
1
- import{U as e,z as t}from"./debug-IKW-jE7K.js";import{Vt as n,kt as r}from"./model-DfFA3qMO.js";import{o as i,t as a}from"./bridgeMain--R1HFbOv.js";import{resolve as o}from"path";n(),e();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 e=process.env.DAEMON_WORKER_DIR||o(`.`),n=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:e,name:n,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>r()?.accessToken,onAuth401:async e=>!!r()?.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: ${t(e)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
1
+ import{F as e,z as t}from"./debug-BrXObCdR.js";import{Vt as n,kt as r}from"./model-fi472PRc.js";import{o as i,t as a}from"./bridgeMain-CzhBVCsN.js";import{resolve as o}from"path";n(),t();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(`.`),n=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:n,spawnMode:l,capacity:u,permissionMode:d,sandbox:f,sessionTimeoutMs:p,createSessionOnStart:m,getAccessToken:()=>r()?.accessToken,onAuth401:async e=>!!r()?.accessToken,log:e=>{console.log(`[remoteControl] ${e}`)}};try{await i(_,h.signal)}catch(t){t instanceof a?(console.error(`[remoteControl] permanent error: ${t.message}`),process.exitCode=s):(console.error(`[remoteControl] transient error: ${e(t)}`),process.exitCode=c)}finally{process.off(`SIGTERM`,g),process.off(`SIGINT`,g)}}export{l as runDaemonWorker};
@@ -0,0 +1 @@
1
+ import{Et as e,xt as t}from"./loadAgentsDir-DrDu5yYy.js";e();export{t as execIntoTmuxWorktree};
package/dist/cli.js CHANGED
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env bun
2
- import{l as e,o as t}from"./chunks/envUtils-DSxRz_kt.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(),t(),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:``}),e(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(`0.0.1 (Claude Code)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-B0m6crkd.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-4lIRMrLI.js`);await e();return}if(e[0]===`weixin`){t(`cli_weixin_path`);let{handleWeixinCli:n}=await import(`./chunks/src-xRRBgNzF.js`),{enableConfigs:r}=await import(`./chunks/config-BrxKpHpR.js`),{initializeAnalyticsSink:i}=await import(`./chunks/sink-iYxWapbU.js`),{shutdownDatadog:a}=await import(`./chunks/datadog-ByS7LGGa.js`),{shutdown1PEventLogging:o}=await import(`./chunks/firstPartyEventLogger-CdUpe6Lh.js`),{logForDebugging:s}=await import(`./chunks/debug-DzZUT2Wv.js`);await n(e.slice(1),{enableConfigs:r,initializeAnalyticsSink:i,shutdownDatadog:a,shutdown1PEventLogging:o,logForDebugging:s},`0.0.1`);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-BdHi7_sN.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-BrxKpHpR.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-DKX8-T_H.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-BUyOCzUt.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-d06JByZn.js`),{exitWithError:s}=await import(`./chunks/process-CNfq37LF.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-CEig4Gxp.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-D5dB38xD.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-Dem-XJ_h.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-BrxKpHpR.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-DUKTzBck.js`);r();let{initSinks:i}=await import(`./chunks/sinks-jfaIjsRJ.js`);i();let{daemonMain:a}=await import(`./chunks/main-DeFMhaFE.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-BkAMA7du.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-BrxKpHpR.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-DUKTzBck.js`);r(),await(await import(`./chunks/bg-BzG63WOm.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-BrxKpHpR.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-DUKTzBck.js`);i();let{initSinks:a}=await import(`./chunks/sinks-jfaIjsRJ.js`);a();let{daemonMain:o}=await import(`./chunks/main-DeFMhaFE.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-CIv_ysje.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-CIv_ysje.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-BrxKpHpR.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-YDeHMlHZ.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.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-xcoTbKQn.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-y7LJ5qUc.js`);t(`cli_after_main_import`),await r(),t(`cli_after_main_complete`)}await m();export{};
2
+ import{l as e,o as t}from"./chunks/envUtils-DSxRz_kt.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(),t(),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:``}),e(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(`0.0.3 (Work Mate)`);return}let{profileCheckpoint:t}=await import(`./chunks/startupProfiler-DIWVcO4e.js`);if(t(`cli_entry`),process.argv[2]===`--acp`){t(`cli_acp_path`);let{runAcpAgent:e}=await import(`./chunks/entry-dA1UCfC0.js`);await e();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-B2QD2sKq.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-huQaTcNb.js`);n();let{getBridgeDisabledReason:r,checkBridgeMinVersion:i}=await import(`./chunks/bridgeEnabled-BWSUZ7Xg.js`),{BRIDGE_LOGIN_ERROR:a}=await import(`./chunks/types-BUyOCzUt.js`),{bridgeMain:o}=await import(`./chunks/bridgeMain-BESKzpm0.js`),{exitWithError:s}=await import(`./chunks/process-CNfq37LF.js`),{getClaudeAIOAuthTokens:c}=await import(`./chunks/auth-B9V3i5oZ.js`),{getBridgeAccessToken:l}=await import(`./chunks/bridgeConfig-CLHy-BiF.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-Bwi9VqDF.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-huQaTcNb.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r();let{initSinks:i}=await import(`./chunks/sinks-DbwDBd-E.js`);i();let{daemonMain:a}=await import(`./chunks/main-D862LI_d.js`);await a(e.slice(1));return}if(e[0]===`autonomy`){t(`cli_autonomy_path`);let{getAutonomyCommandText:n}=await import(`./chunks/autonomy-BpINX4jw.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-huQaTcNb.js`);n();let{setShellIfWindows:r}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);r(),await(await import(`./chunks/bg-B0iMGM9C.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-huQaTcNb.js`);r();let{setShellIfWindows:i}=await import(`./chunks/windowsPaths-9pEkw0oV.js`);i();let{initSinks:a}=await import(`./chunks/sinks-DbwDBd-E.js`);a();let{daemonMain:o}=await import(`./chunks/main-D862LI_d.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-CT5VxeRr.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-CT5VxeRr.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-huQaTcNb.js`);n();let{isWorktreeModeEnabled:r}=await import(`./chunks/worktreeModeEnabled-D68iEHpC.js`);if(r()){let{execIntoTmuxWorktree:t}=await import(`./chunks/worktree-D38cJ23W.js`),n=await t(e);if(n.handled)return;if(n.error){let{exitWithError:e}=await import(`./chunks/process-CNfq37LF.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-xcoTbKQn.js`);n(),t(`cli_before_main_import`);let{main:r}=await import(`./chunks/main-C_rVSWfm.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": "@readmagic/workmate",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "description": "workMate",
5
5
  "type": "module",
6
6
  "author": "Frandy",
@@ -89,10 +89,9 @@
89
89
  "@aws-sdk/credential-providers": "^3.1037.0",
90
90
  "@azure/identity": "^4.13.1",
91
91
  "@biomejs/biome": "^2.4.12",
92
- "@claude-code-best/agent-tools": "workspace:*",
93
- "@claude-code-best/builtin-tools": "workspace:*",
94
- "@claude-code-best/mcp-client": "workspace:*",
95
- "@claude-code-best/weixin": "workspace:*",
92
+ "@readmagic/workmate-agent-tools": "workspace:*",
93
+ "@readmagic/workmate-builtin-tools": "workspace:*",
94
+ "@readmagic/workmate-mcp-client": "workspace:*",
96
95
  "@commander-js/extra-typings": "^14.0.0",
97
96
  "@modelcontextprotocol/sdk": "^1.29.0",
98
97
  "@opentelemetry/api": "^1.9.1",
@@ -1 +0,0 @@
1
- import{t as e}from"./ApproveApiKey-BEzfC6r3.js";export{e as ApproveApiKey};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n,r}from"./rolldown-runtime-DaDcL9Zw.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{D as o,Gt as s,H as c,I as l,Lt as u,P as d,T as f,fi as p,mt as m,ot as h,t as g,y as _}from"./src-CDCSSo0U2.js";import{t as v}from"./jsx-runtime-Bb4Xn-E0.js";import{An as y,Au as b,Bb as ee,Bx as x,Cu as te,Dh as S,Eh as C,Eu as ne,Hv as w,Km as T,Lb as re,Mn as ie,Mu as ae,Nb as E,Pb as oe,Qa as se,Rv as ce,TS as D,Ub as O,Vv as k,Vx as le,Wb as ue,Xu as de,Yu as fe,Zv as pe,aO as me,df as he,fS as ge,ff as _e,ia as ve,jm as ye,km as be,ku as xe,lS as Se,na as Ce,nb as we,oO as Te,pf as Ee,qm as De,qo as Oe,qv as ke,rb as A,uS as Ae,uf as je,wo as Me,zo as Ne}from"./loadAgentsDir-nzr38hai.js";import{S as Pe,U as Fe,_ as Ie,z as Le}from"./debug-IKW-jE7K.js";import{Kt as Re,_n as ze,gn as j,nt as Be,vn as Ve}from"./settings-5PQdphqC.js";import{S as M,T as He,b as N,d as Ue,p as We,u as Ge}from"./startupProfiler-DxRQteII.js";import{l as P,o as Ke}from"./stringUtils-CvXbHQRH.js";import{Cn as qe,It as Je,Sn as Ye,Vt as Xe,xn as Ze}from"./prompt-Bef63FhB.js";import{u as F}from"./referral-DP_GshTS.js";import{n as Qe,t as $e}from"./browser-Bd7GeBH1.js";import{t as et}from"./Dialog-vfLXEPed.js";import{i as tt,n as nt}from"./mappers-CWykjGfP.js";function I(e,t,n=1e3,r=0,i){let a=()=>Ge(Math.max(0,(i??Date.now())-e-r));return(0,rt.useSyncExternalStore)((0,rt.useCallback)(e=>{if(!t)return()=>{};let r=setInterval(e,n);return()=>clearInterval(r)},[t,n]),a,a)}var rt,L=t((()=>{rt=n(p(),1),N()}));function it(e,t,n){let r=Ze(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,at.jsxs)(d,{children:[a,`(`,o,`)`]}):a}catch{return e.toolName}}var at,ot=t((()=>{p(),g(),qe(),at=v()}));function st(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 ct(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 lt(e,t){if(!t)return!1;let n=!1;for(let t of Object.values(e))if(!(!A(t)||process.env.USER_TYPE===`ant`&&ae(t)))return n=!0,!1;return n}var ut=t((()=>{i(),b(),we()}));function dt({agent:e,onDone:t,onKillAgent:n,onBack:r}){let[i]=c(),a=(0,ft.useMemo)(()=>fe(Ye()),[]),u=I(e.startTime,e.status===`running`,1e3,e.totalPausedMs??0);s({"confirm:yes":t},{context:`Confirmation`});let p=i=>{i.key===` `?(i.preventDefault(),t()):i.key===`left`&&r?(i.preventDefault(),r()):i.key===`x`&&e.status===`running`&&n&&(i.preventDefault(),n())},m=Me(e.prompt,`plan`),h=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,R.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:p,children:(0,R.jsx)(_,{title:(0,R.jsxs)(d,{children:[e.selectedAgent?.agentType??`agent`,` › `,e.description||`Async agent`]}),subtitle:(0,R.jsxs)(d,{children:[e.status!==`running`&&(0,R.jsxs)(d,{color:ct(e.status),children:[st(e.status),` `,e.status===`completed`?`Completed`:e.status===`failed`?`Failed`:`Stopped`,` · `]}),(0,R.jsxs)(d,{dimColor:!0,children:[u,g!==void 0&&g>0&&(0,R.jsxs)(R.Fragment,{children:[` · `,We(g),` tokens`]}),v!==void 0&&v>0&&(0,R.jsxs)(R.Fragment,{children:[` `,`· `,v,` `,v===1?`tool`:`tools`]})]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,R.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,R.jsxs)(f,{children:[r&&(0,R.jsx)(o,{shortcut:`←`,action:`go back`}),(0,R.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,R.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,R.jsxs)(l,{flexDirection:`column`,children:[e.status===`running`&&e.progress?.recentActivities&&e.progress.recentActivities.length>0&&(0,R.jsxs)(l,{flexDirection:`column`,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Progress`}),e.progress.recentActivities.map((t,n)=>(0,R.jsxs)(d,{dimColor:n<e.progress.recentActivities.length-1,wrap:`truncate-end`,children:[n===e.progress.recentActivities.length-1?`› `:` `,it(t,a,i)]},n))]}),m?(0,R.jsx)(l,{marginTop:1,children:(0,R.jsx)(T,{addMargin:!1,planContent:m})}):(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,dimColor:!0,children:`Prompt`}),(0,R.jsx)(d,{wrap:`wrap`,children:h})]}),e.status===`failed`&&e.error&&(0,R.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,R.jsx)(d,{bold:!0,color:`error`,children:`Error`}),(0,R.jsx)(d,{color:`error`,wrap:`wrap`,children:e.error})]})]})})})}var ft,R,pt=t((()=>{ft=n(p(),1),L(),g(),F(),qe(),de(),N(),Ne(),De(),ot(),ut(),R=v()}));function mt(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 ht({text:e,phase:t=0}){return(0,z.jsx)(z.Fragment,{children:[...e].map((e,n)=>(0,z.jsx)(d,{color:me(n+t),children:e},n))})}function gt(e,t,n){let r=(0,yt.useRef)(e),i=(0,yt.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 _t({session:e}){let t=le().prefersReducedMotion??!1,n=e.reviewProgress,r=e.status===`running`,[,i]=m(r&&!t?bt:null),a=n?.bugsFound??0,o=n?.bugsVerified??0,s=n?.bugsRefuted??0,c=t||!r,l=gt(a,i,c),u=gt(o,i,c),f=gt(s,i,c),p=Math.floor(i/(bt*3))%7;if(e.status===`completed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsx)(d,{dimColor:!0,children:` ready · shift+↓ to view`})]});if(e.status===`failed`)return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◆`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:0}),(0,z.jsxs)(d,{color:`error`,dimColor:!0,children:[` · `,`error`]})]});let h=n?mt(n.stage,l,u,f):`setting up`;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsxs)(d,{color:`background`,children:[`◇`,` `]}),(0,z.jsx)(ht,{text:`ultrareview`,phase:r?p:0}),(0,z.jsxs)(d,{dimColor:!0,children:[` · `,h]})]})}function vt({session:e}){if(e.isRemoteReview)return(0,z.jsx)(_t,{session:e});if(e.status===`completed`)return(0,z.jsx)(d,{bold:!0,color:`success`,dimColor:!0,children:`done`});if(e.status===`failed`)return(0,z.jsx)(d,{bold:!0,color:`error`,dimColor:!0,children:`error`});if(!e.todoList.length)return(0,z.jsxs)(d,{dimColor:!0,children:[e.status,`…`]});let t=j(e.todoList,e=>e.status===`completed`),n=e.todoList.length;return(0,z.jsxs)(d,{dimColor:!0,children:[t,`/`,n]})}var yt,z,bt,xt=t((()=>{yt=n(p(),1),Re(),x(),g(),ze(),Te(),z=v(),bt=80}));function B({status:e,label:t,suffix:n}){return(0,V.jsxs)(d,{color:e===`completed`?`success`:e===`failed`?`error`:e===`killed`?`warning`:void 0,dimColor:!0,children:[`(`,t??e,n,`)`]})}function St({shell:e}){switch(e.status){case`completed`:return(0,V.jsx)(B,{status:`completed`,label:`done`});case`failed`:return(0,V.jsx)(B,{status:`failed`,label:`error`});case`killed`:return(0,V.jsx)(B,{status:`killed`,label:`stopped`});case`running`:case`pending`:return(0,V.jsx)(B,{status:`running`})}}var V,Ct=t((()=>{g(),V=v()}));function wt({task:e,maxActivityWidth:t}){let n=t??40;switch(e.type){case`local_bash`:return(0,H.jsxs)(d,{children:[M(e.kind===`monitor`?e.description:e.command,n,!0),` `,(0,H.jsx)(St,{shell:e})]});case`remote_agent`:return e.isRemoteReview?(0,H.jsx)(d,{children:(0,H.jsx)(vt,{session:e})}):(0,H.jsxs)(d,{children:[(0,H.jsxs)(d,{dimColor:!0,children:[e.status===`running`||e.status===`pending`?`◇`:`◆`,` `]}),M(e.title,n,!0),(0,H.jsx)(d,{dimColor:!0,children:` · `}),(0,H.jsx)(vt,{session:e})]});case`local_agent`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]});case`local_workflow`:{let t=e;return(0,H.jsxs)(d,{children:[M(t.workflowName??e.summary??e.description,n,!0),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`running`?`${t.agentCount} ${P(t.agentCount,`agent`)}`:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}case`monitor_mcp`:return(0,H.jsxs)(d,{children:[M(e.description,n,!0),` `,(0,H.jsx)(B,{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} ${P(t,`file`)}`:`${e.sessionsReviewing} ${P(e.sessionsReviewing,`session`)}`;return(0,H.jsxs)(d,{children:[e.description,` `,(0,H.jsxs)(d,{dimColor:!0,children:[`· `,e.phase,` · `,n]}),` `,(0,H.jsx)(B,{status:e.status,label:e.status===`completed`?`done`:void 0,suffix:e.status===`completed`&&!e.notified?`, unread`:void 0})]})}}}var H,Tt=t((()=>{p(),g(),N(),Ke(),Re(),xt(),Ct(),H=v()}));function Et({task:e,onDone:t,onBack:n,onKill:r}){let i=I(e.startTime,e.status===`running`,1e3,0);s({"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())},c=e.turns.filter(e=>e.text!==``),u=c.slice(-6),p=c.length-u.length;return(0,U.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:a,children:(0,U.jsx)(_,{title:`Memory consolidation`,subtitle:(0,U.jsxs)(d,{dimColor:!0,children:[i,` · reviewing `,e.sessionsReviewing,` `,P(e.sessionsReviewing,`session`),e.filesTouched.length>0&&(0,U.jsxs)(U.Fragment,{children:[` `,`· `,e.filesTouched.length,` `,P(e.filesTouched.length,`file`),` touched`]})]}),onCancel:t,color:`background`,inputGuide:t=>t.pending?(0,U.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,U.jsxs)(f,{children:[n&&(0,U.jsx)(o,{shortcut:`←`,action:`go back`}),(0,U.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&r&&(0,U.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,U.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,U.jsxs)(d,{children:[(0,U.jsx)(d,{bold:!0,children:`Status:`}),` `,e.status===`running`?(0,U.jsx)(d,{color:`background`,children:`running`}):e.status===`completed`?(0,U.jsx)(d,{color:`success`,children:e.status}):(0,U.jsx)(d,{color:`error`,children:e.status})]}),u.length===0?(0,U.jsx)(d,{dimColor:!0,children:e.status===`running`?`Starting…`:`(no text output)`}):(0,U.jsxs)(U.Fragment,{children:[p>0&&(0,U.jsxs)(d,{dimColor:!0,children:[`(`,p,` earlier `,P(p,`turn`),`)`]}),u.map((e,t)=>(0,U.jsxs)(l,{flexDirection:`column`,children:[(0,U.jsx)(d,{wrap:`wrap`,children:e.text}),e.toolUseCount>0&&(0,U.jsxs)(d,{dimColor:!0,children:[` `,`(`,e.toolUseCount,` `,P(e.toolUseCount,`tool`),`)`]})]},t))]})]})})})}var U,Dt=t((()=>{p(),L(),g(),F(),Ke(),U=v()}));function Ot(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: ${He(t.replace(/\s+/g,` `).trim(),50)}`}}for(let n of Object.values(t))if(typeof n==`string`&&n.trim())return`${e} ${He(n.replace(/\s+/g,` `).trim(),60)}`;return e}function kt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`running`||e.status===`pending`,o=e.ultraplanPhase,s=i?o?Pt[o]:`running`:e.status,c=I(e.startTime,i,1e3,0,e.endTime),{agentsWorking:f,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?Ot(r.name,r.input):null}},[e.log]),h=k(e.sessionId),g=n??(()=>t(`Remote session details dismissed`,{display:`system`})),[v,y]=(0,W.useState)(!1);return v?(0,G.jsx)(_,{title:`Stop ultraplan?`,onCancel:()=>y(!1),color:`background`,children:(0,G.jsxs)(l,{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)(E,{options:[{label:`Terminate session`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),g()):y(!1)}})]})}):(0,G.jsx)(_,{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:[` · `,c,` · `,s]})]}),onCancel:g,color:`background`,children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsxs)(d,{children:[o===`plan_ready`&&(0,G.jsxs)(d,{color:`success`,children:[a.tick,` `]}),f,` `,P(f,`agent`),` `,o?Ft[o]:`working`,` · `,p,` tool`,` `,P(p,`call`)]}),m&&(0,G.jsx)(d,{dimColor:!0,children:m}),(0,G.jsx)(u,{url:h,children:(0,G.jsx)(d,{dimColor:!0,children:h})}),(0,G.jsx)(E,{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`:Qe(h),t();return;case`stop`:y(!0);return;case`back`:g();return}}})]})})}function At({stage:e,completed:t,hasProgress:n}){let r=e?It.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:` → `}),It.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:Lt[e]}):(0,G.jsx)(d,{dimColor:!0,children:Lt[e]})]},e)}),t&&(0,G.jsx)(d,{color:`success`,children:` ✓`})]})}function jt(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} ${P(n,`finding`)}`];return r>0&&e.push(`${r} refuted`),e.join(` · `)}return mt(t.stage,t.bugsFound,n,r)}function Mt({session:e,onDone:t,onBack:n,onKill:r}){let i=e.status===`completed`,a=e.status===`running`||e.status===`pending`,[s,c]=(0,W.useState)(!1),p=I(e.startTime,a,1e3,0,e.endTime),m=()=>t(`Remote session details dismissed`,{display:`system`}),h=n??m,g=k(e.sessionId),v=i?`ready`:a?`running`:e.status;if(s)return(0,G.jsx)(_,{title:`Stop ultrareview?`,onCancel:()=>c(!1),color:`background`,children:(0,G.jsxs)(l,{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)(E,{options:[{label:`Stop ultrareview`,value:`stop`},{label:`Back`,value:`back`}],onChange:e=>{e===`stop`?(r?.(),h()):c(!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)(_,{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:[` · `,p,` · `,v]})]}),onCancel:h,color:`background`,inputGuide:e=>e.pending?(0,G.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,G.jsxs)(f,{children:[(0,G.jsx)(o,{shortcut:`Enter`,action:`select`}),(0,G.jsx)(o,{shortcut:`Esc`,action:`go back`})]}),children:(0,G.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,G.jsx)(At,{stage:e.reviewProgress?.stage,completed:i,hasProgress:!!e.reviewProgress}),(0,G.jsxs)(l,{flexDirection:`column`,children:[(0,G.jsx)(d,{children:jt(e)}),(0,G.jsx)(u,{url:g,children:(0,G.jsx)(d,{dimColor:!0,children:g})})]}),(0,G.jsx)(E,{options:y,onChange:e=>{switch(e){case`open`:Qe(g),t();break;case`stop`:c(!0);break;case`back`:h();break;case`dismiss`:m();break}}})]})})}function Nt({session:e,toolUseContext:t,onDone:n,onBack:r,onKill:i}){let[a,s]=(0,W.useState)(!1),[c,p]=(0,W.useState)(null),m=(0,W.useMemo)(()=>e.isUltraplan||e.isRemoteReview?[]:Oe(tt(e.log)).filter(e=>e.type!==`progress`).slice(-3),[e]);if(e.isUltraplan)return(0,G.jsx)(kt,{session:e,onDone:n,onBack:r,onKill:i});if(e.isRemoteReview)return(0,G.jsx)(Mt,{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(){s(!0),p(null);try{await pe(e.sessionId)}catch(e){p(Le(e))}finally{s(!1)}}let y=He(e.title,50),b=e.status===`pending`?`starting`:e.status;return(0,G.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:g,children:(0,G.jsxs)(_,{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)(f,{children:[r&&(0,G.jsx)(o,{shortcut:`←`,action:`go back`}),(0,G.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),!a&&(0,G.jsx)(o,{shortcut:`t`,action:`teleport`})]}),children:[(0,G.jsxs)(l,{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`}),`: `,Ge((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)(u,{url:k(e.sessionId),children:(0,G.jsx)(d,{dimColor:!0,children:k(e.sessionId)})})]})]}),e.log.length>0&&(0,G.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(d,{children:[(0,G.jsx)(d,{bold:!0,children:`Recent messages`}),`:`]}),(0,G.jsx)(l,{flexDirection:`column`,height:10,overflowY:`hidden`,children:m.map((e,n)=>(0,G.jsx)(be,{message:e,lookups:se,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)(l,{marginTop:1,children:(0,G.jsxs)(d,{dimColor:!0,italic:!0,children:[`Showing last `,m.length,` of `,e.log.length,` messages`]})})]}),c&&(0,G.jsx)(l,{marginTop:1,children:(0,G.jsxs)(d,{color:`error`,children:[`Teleport failed: `,c]})}),a&&(0,G.jsx)(d,{color:`background`,children:`Teleporting to session…`})]})})}var W,G,Pt,Ft,It,Lt,Rt=t((()=>{i(),W=n(p(),1),Re(),L(),g(),w(),Be(),Je(),Xe(),$e(),Fe(),N(),nt(),Ne(),Ke(),ke(),oe(),ye(),xt(),G=v(),Pt={needs_input:`input required`,plan_ready:`ready`},Ft={needs_input:`waiting`,plan_ready:`done`},It=[`finding`,`verifying`,`synthesizing`],Lt={finding:`Find`,verifying:`Verify`,synthesizing:`Dedupe`}}));async function zt(e){let t=y(e.id);try{let e=await Pe(t,Ht);return{content:e.content,bytesTotal:e.bytesTotal}}catch{return{content:``,bytesTotal:0}}}function Bt({shell:e,onDone:t,onKillShell:n,onBack:r}){let{columns:i}=h(),[a,c]=(0,K.useState)(()=>zt(e)),u=(0,K.useDeferredValue)(a);(0,K.useEffect)(()=>{if(e.status!==`running`)return;let t=setInterval((e,t)=>e(zt(t)),1e3,c,e);return()=>clearInterval(t)},[e.id,e.status]);let p=()=>t(`Shell details dismissed`,{display:`system`});s({"confirm:yes":p},{context:`Confirmation`});let m=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=He(e.command,280);return(0,q.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:m,children:(0,q.jsxs)(_,{title:g?`Monitor details`:`Shell details`,onCancel:p,color:`background`,inputGuide:t=>t.pending?(0,q.jsxs)(d,{children:[`Press `,t.keyName,` again to exit`]}):(0,q.jsxs)(f,{children:[r&&(0,q.jsx)(o,{shortcut:`←`,action:`go back`}),(0,q.jsx)(o,{shortcut:`Esc/Enter/Space`,action:`close`}),e.status===`running`&&n&&(0,q.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:[(0,q.jsxs)(l,{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:`}),` `,Ge((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)(l,{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)(Vt,{outputPromise:u,columns:i})})]})]})})}function Vt({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)(l,{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 ${Ue(r)}`:``]})]})}var K,q,Ht,Ut=t((()=>{K=n(p(),1),D(),g(),F(),N(),Ie(),ie(),q=v(),Ht=8192})),Wt=t((()=>{g()})),Gt=t((()=>{g()})),Kt=r({MonitorMcpDetailDialog:()=>qt});function qt({task:e,onBack:t,onKill:n}){let r=I(e.startTime,e.status===`running`,1e3,0);return s({},{context:`MonitorMcpDetail`}),(0,J.jsx)(l,{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,J.jsx)(_,{title:`MCP Monitor`,subtitle:(0,J.jsxs)(d,{dimColor:!0,children:[r,` · `,e.serverName,`:`,e.resourceUri]}),onCancel:t??(()=>{}),inputGuide:()=>(0,J.jsxs)(f,{children:[t&&(0,J.jsx)(o,{shortcut:`←`,action:`go back`}),(0,J.jsx)(o,{shortcut:`Esc`,action:`close`}),e.status===`running`&&n&&(0,J.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:(0,J.jsxs)(l,{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:`Server:`}),` `,e.serverName]}),(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Resource:`}),` `,e.resourceUri]}),e.command&&(0,J.jsxs)(d,{children:[(0,J.jsx)(d,{bold:!0,children:`Command:`}),` `,e.command]})]})})})}var J,Jt=t((()=>{p(),L(),g(),F(),Wt(),et(),Gt(),J=v()}));function Yt(e,t){return Object.values(e??{}).filter(A).filter(e=>!(e.type===`local_agent`&&e.id===t))}function Xt({onDone:e,toolUseContext:t,initialDetailTaskId:n}){let r=Ae(e=>e.tasks),i=Ae(e=>e.foregroundedTaskId),a=ge(),c=ue(`chat:killAgents`,`Chat`,`ctrl+x ctrl+k`),u=r,p=(0,X.useRef)(!1),[m,h]=(0,X.useState)(()=>{if(n)return p.current=!0,{mode:`detail`,itemId:n};let e=Yt(u,i);return e.length===1?(p.current=!0,{mode:`detail`,itemId:e[0].id}):{mode:`list`}}),[g,v]=(0,X.useState)(0);ee(`background-tasks-dialog`);let{bashTasks:y,remoteSessions:b,agentTasks:x,workflowTasks:S,mcpMonitors:C,dreamTasks:ne,allSelectableItems:w}=(0,X.useMemo)(()=>{let e=Object.values(u??{}).filter(A).map(Zt).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),a=e.filter(e=>e.type===`local_workflow`),o=e.filter(e=>e.type===`monitor_mcp`),s=e.filter(e=>e.type===`dream`);return{bashTasks:t,remoteSessions:n,agentTasks:r,workflowTasks:a,mcpMonitors:o,dreamTasks:s,allSelectableItems:[...t,...o,...n,...r,...a,...s]}},[u,i]),T=w[g]??null;s({"confirm:previous":()=>v(e=>Math.max(0,e-1)),"confirm:next":()=>v(e=>Math.min(w.length-1,e+1)),"confirm:yes":()=>{let e=w[g];e&&h({mode:`detail`,itemId:e.id})}},{context:`Confirmation`,isActive:m.mode===`list`});let re=t=>{if(m.mode!==`list`)return;if(t.key===`left`){t.preventDefault(),e(`Background tasks dialog dismissed`,{display:`system`});return}let n=w[g];n&&t.key===`x`&&(t.preventDefault(),n.type===`local_bash`&&n.status===`running`?ie(n.id):n.type===`local_agent`&&n.status===`running`?ae(n.id):n.type===`local_workflow`&&n.status===`running`&&Q?Q(n.id,a):n.type===`monitor_mcp`&&n.status===`running`&&$?$(n.id,a):n.type===`dream`&&n.status===`running`?E(n.id):n.type===`remote_agent`&&n.status===`running`&&(n.task.isUltraplan?ve(n.id,n.task.sessionId,a):oe(n.id)))};async function ie(e){await te.kill(e,a)}async function ae(e){await xe.kill(e,a)}async function E(e){await _e.kill(e,a)}async function oe(e){await ce.kill(e,a)}let se=(0,X.useEffectEvent)(e);(0,X.useEffect)(()=>{if(m.mode!==`list`){let e=(u??{})[m.itemId];(!e||e.type!==`local_workflow`&&!A(e))&&(p.current?se(`Background tasks dialog dismissed`,{display:`system`}):h({mode:`list`}))}let e=w.length;g>=e&&e>0&&v(e-1)},[m,u,g,w,se]);let D=()=>{p.current&&w.length<=1?e(`Background tasks dialog dismissed`,{display:`system`}):(p.current=!1,h({mode:`list`}))};if(m.mode!==`list`&&u){let n=u[m.itemId];if(!n)return null;switch(n.type){case`local_bash`:return(0,Z.jsx)(Bt,{shell:n,onDone:e,onKillShell:()=>void ie(n.id),onBack:D},`shell-${n.id}`);case`local_agent`:return(0,Z.jsx)(dt,{agent:n,onDone:e,onKillAgent:()=>void ae(n.id),onBack:D},`agent-${n.id}`);case`remote_agent`:return(0,Z.jsx)(Nt,{session:n,onDone:e,toolUseContext:t,onBack:D,onKill:n.status===`running`?n.isUltraplan?()=>void ve(n.id,n.sessionId,a):()=>void oe(n.id):void 0},`session-${n.id}`);case`local_workflow`:{let e=n.status===`running`&&Q?()=>Q(n.id,a):void 0;return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,borderStyle:`round`,onKeyDown:t=>{t.key===`left`?(t.preventDefault(),D()):t.key===`x`&&e&&(t.preventDefault(),e())},children:(0,Z.jsx)(_,{title:n.workflowName,subtitle:(0,Z.jsxs)(d,{dimColor:!0,children:[n.status,n.summary?` · ${n.summary}`:``]}),onCancel:D,inputGuide:()=>(0,Z.jsxs)(f,{children:[(0,Z.jsx)(o,{shortcut:`←`,action:`go back`}),(0,Z.jsx)(o,{shortcut:`Esc`,action:`close`}),e&&(0,Z.jsx)(o,{shortcut:`x`,action:`stop`})]}),children:n.status===`failed`&&n.error?(0,Z.jsxs)(l,{flexDirection:`column`,children:[(0,Z.jsxs)(d,{color:`error`,children:[`失败原因:`,n.error]}),(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})]}):(0,Z.jsx)(d,{color:`subtle`,children:`用 /workflows 查看阶段与 agent 实时进度`})})},`workflow-${n.id}`)}case`monitor_mcp`:return Qt?(0,Z.jsx)(Qt,{task:n,onKill:n.status===`running`&&$?()=>$(n.id,a):void 0,onBack:D},`monitor-mcp-${n.id}`):null;case`dream`:return(0,Z.jsx)(Et,{task:n,onDone:()=>e(`Background tasks dialog dismissed`,{display:`system`}),onBack:D,onKill:n.status===`running`?()=>void E(n.id):void 0},`dream-${n.id}`)}}let O=j(y,e=>e.status===`running`),k=j(b,e=>e.status===`running`||e.status===`pending`)+j(x,e=>e.status===`running`),le=Ve([...O>0?[(0,Z.jsxs)(d,{children:[O,` `,O===1?`active shell`:`active shells`]},`shells`)]:[],...k>0?[(0,Z.jsxs)(d,{children:[k,` `,k===1?`active agent`:`active agents`]},`agents`)]:[]],e=>(0,Z.jsx)(d,{children:` · `},`separator-${e}`)),de=[(0,Z.jsx)(o,{shortcut:`↑/↓`,action:`select`},`upDown`),(0,Z.jsx)(o,{shortcut:`Enter`,action:`view`},`enter`),...(T?.type===`local_bash`||T?.type===`local_agent`||T?.type===`local_workflow`||T?.type===`monitor_mcp`||T?.type===`dream`||T?.type===`remote_agent`)&&T.status===`running`?[(0,Z.jsx)(o,{shortcut:`x`,action:`stop`},`kill`)]:[],...x.some(e=>e.status===`running`)?[(0,Z.jsx)(o,{shortcut:c,action:`stop all agents`},`kill-all`)]:[],(0,Z.jsx)(o,{shortcut:`←/Esc`,action:`close`},`esc`)],fe=()=>e(`Background tasks dialog dismissed`,{display:`system`});function pe(e){return e.pending?(0,Z.jsxs)(d,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(f,{children:de})}return(0,Z.jsx)(l,{flexDirection:`column`,tabIndex:0,autoFocus:!0,onKeyDown:re,children:(0,Z.jsx)(_,{title:`Background tasks`,subtitle:(0,Z.jsx)(Z.Fragment,{children:le}),onCancel:fe,color:`background`,inputGuide:pe,children:w.length===0?(0,Z.jsx)(d,{dimColor:!0,children:`No tasks currently running`}):(0,Z.jsxs)(l,{flexDirection:`column`,children:[y.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,children:[(b.length>0||x.length>0)&&(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Shells`]}),` (`,y.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:y.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),C.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Monitors`]}),` (`,C.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:C.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),b.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Remote agents`]}),` (`,b.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:b.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),x.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Local agents`]}),` (`,x.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:x.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),S.length>0&&(0,Z.jsxs)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0),children:[(0,Z.jsxs)(d,{dimColor:!0,children:[(0,Z.jsxs)(d,{bold:!0,children:[` `,`Workflows`]}),` (`,S.length,`)`]}),(0,Z.jsx)(l,{flexDirection:`column`,children:S.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})]}),ne.length>0&&(0,Z.jsx)(l,{flexDirection:`column`,marginTop:+(y.length>0||C.length>0||b.length>0||x.length>0||S.length>0),children:(0,Z.jsx)(l,{flexDirection:`column`,children:ne.map(e=>(0,Z.jsx)(Y,{item:e,isSelected:e.id===T?.id},e.id))})})]})})})}function Zt(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`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 Y({item:e,isSelected:t}){let{columns:n}=h(),r=Math.max(30,n-26);return(0,Z.jsxs)(l,{flexDirection:`row`,children:[(0,Z.jsx)(d,{children:t?a.pointer+` `:` `}),(0,Z.jsx)(d,{color:t?`suggestion`:void 0,children:(0,Z.jsx)(wt,{task:e.task,maxActivityWidth:r})})]})}var X,Z,Q,$,Qt,$t=t((()=>{i(),X=n(p(),1),D(),Se(),Ee(),b(),ne(),w(),we(),ze(),Ce(),re(),g(),F(),O(),pt(),Tt(),Dt(),Rt(),Ut(),Z=v(),Q=(he(),e(je))?.killWorkflowTask??null,$=(S(),e(C))?.killMonitorMcp??null,Qt=(Jt(),e(Kt)).MonitorMcpDetailDialog}));export{L as a,lt as i,$t as n,I as o,ut as r,Xt as t};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./ClaudeMdExternalIncludesDialog-CTWhpIm8.js";e();export{t as ClaudeMdExternalIncludesDialog};
@@ -1 +0,0 @@
1
- import{$b as e,Qb as t}from"./loadAgentsDir-nzr38hai.js";e();export{t as ConsoleOAuthFlow};
@@ -1 +0,0 @@
1
- import{n as e,t}from"./Doctor-WxNv49HC.js";e();export{t as Doctor};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,o as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Gt as o,I as s,P as c,fi as l,t as u,x as d}from"./src-CDCSSo0U2.js";import{t as f}from"./jsx-runtime-Bb4Xn-E0.js";import{en as p,nt as m}from"./state-4KQ3kaqz.js";import{$T as h,AD as g,IE as _,Jp as v,Jx as y,NE as b,QT as x,Qp as ee,Uc as S,Wc as C,Xp as w,Xx as T,YT as E,Yp as te,Yx as D,Zp as ne,Zx as re,al as ie,il as ae,kD as oe,lS as se,nf as ce,rf as le,tE as O,tf as k,uS as A}from"./loadAgentsDir-nzr38hai.js";import{B as j,L as M,g as N,n as P}from"./settings-5PQdphqC.js";import{_ as F,f as I}from"./file-D1cN3LMK.js";import{l as L,o as R}from"./stringUtils-CvXbHQRH.js";import{Wn as z,_ as B,qn as V,u as H}from"./model-DfFA3qMO.js";import{n as U,t as W}from"./ValidationErrorsList-Cx-hoRwG.js";import{u as ue}from"./referral-DP_GshTS.js";import{d as de,f as fe,h as pe,i as me,m as he,n as ge,o as _e,r as ve,u as G}from"./pidLock-CBJDnBG_.js";import{a as ye,i as be}from"./xdg-DcF9ejUM.js";import{n as xe,t as Se}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import{n as Ce,t as we}from"./McpParsingWarnings-WQrWJeWP.js";import{n as Te,t as Ee}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{n as De,t as Oe}from"./useSettingsErrors-BWlJCgYF.js";import{n as ke,t as Ae}from"./shadowedRuleDetection-7Z8ezTKF.js";import{n as je,r as Me,t as K}from"./statusNoticeHelpers-CQ7CUugR.js";import{join as q}from"path";function Ne(){if(!re())return null;let e=y();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)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,J.jsx)(c,{bold:!0,color:t.length>0?`error`:`warning`,children:`Keybinding Configuration Issues`}),(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`Location: `}),(0,J.jsx)(c,{dimColor:!0,children:D()})]}),(0,J.jsxs)(s,{marginLeft:1,flexDirection:`column`,marginTop:1,children:[t.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`error`,children:`[Error]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`error-${t}`)),n.map((e,t)=>(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsxs)(s,{children:[(0,J.jsx)(c,{dimColor:!0,children:`└ `}),(0,J.jsx)(c,{color:`warning`,children:`[Warning]`}),(0,J.jsxs)(c,{dimColor:!0,children:[` `,e.message]})]}),e.suggestion&&(0,J.jsx)(s,{marginLeft:3,children:(0,J.jsxs)(c,{dimColor:!0,children:[`→ `,e.suggestion]})})]},`warning-${t}`))]})]})}var J,Pe=e((()=>{l(),u(),T(),J=f()}));function Fe(){if(!b.isSupportedPlatform()||!b.isSandboxEnabledInSettings())return null;let e=b.checkDependencies(),t=e.errors.length>0,n=e.warnings.length>0;return!t&&!n?null:(0,Y.jsxs)(s,{flexDirection:`column`,children:[(0,Y.jsx)(c,{bold:!0,children:`Sandbox`}),(0,Y.jsxs)(c,{children:[`└ Status: `,(0,Y.jsx)(c,{color:t?`error`:`warning`,children:t?`Missing dependencies`:`Available (with warnings)`})]}),e.errors.map((e,t)=>(0,Y.jsxs)(c,{color:`error`,children:[`└ `,e]},t)),e.warnings.map((e,t)=>(0,Y.jsxs)(c,{color:`warning`,children:[`└ `,e]},t)),t&&(0,Y.jsx)(c,{dimColor:!0,children:`└ Run /sandbox for install instructions`})]})}var Y,Ie=e((()=>{l(),u(),_(),Y=f()}));async function Le(){let e=x(await h());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 > ${E.toLocaleString()})`:`${e.length} large CLAUDE.md files detected (each > ${E.toLocaleString()} chars)`,details:t,currentValue:e.length,threshold:E}}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:C(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 ae(e,t,n,H());if(r<=Z)return null;let a=new Map;for(let e of i){let t=e.name.split(`__`)[1]||`unknown`,n=a.get(t)||{count:0,tokens:0};a.set(t,{count:n.count+1,tokens:n.tokens+e.tokens})}let o=Array.from(a.entries()).sort((e,t)=>t[1].tokens-e[1].tokens),s=o.slice(0,5).map(([e,t])=>`${e}: ${t.count} tools (~${t.tokens.toLocaleString()} tokens)`);return o.length>5&&s.push(`(${o.length-5} more servers)`),{type:`mcp_tools`,severity:`warning`,message:`Large MCP tools context (~${r.toLocaleString()} tokens > ${Z.toLocaleString()})`,details:s,currentValue:r,threshold:Z}}catch{let e=r.reduce((e,t)=>e+C(((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:b.isSandboxingEnabled()&&b.isAutoAllowBashIfSandboxedEnabled()});if(t.length===0)return null;let n=t.flatMap(e=>[`${j(e.rule.ruleValue)}: ${e.reason}`,` Fix: ${e.fix}`]);return{type:`unreachable_rules`,severity:`warning`,message:`${t.length} ${L(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((()=>{S(),ie(),O(),B(),M(),ke(),_(),Me(),R(),Z=25e3}));function He({promise:e}){let t=(0,Q.use)(e);return t.latest?(0,$.jsxs)($.Fragment,{children:[t.stable&&(0,$.jsxs)(c,{children:[`└ Stable version: `,t.stable]}),(0,$.jsxs)(c,{children:[`└ Latest version: `,t.latest]})]}):(0,$.jsx)(c,{dimColor:!0,children:`└ Failed to fetch versions`})}function Ue({onDone:e}){let t=A(e=>e.agentDefinitions),r=A(e=>e.mcp.tools),i=A(e=>e.toolPermissionContext),l=A(e=>e.plugins.errors);xe();let u=(0,Q.useMemo)(()=>r||[],[r]),[f,p]=(0,Q.useState)(null),[h,g]=(0,Q.useState)(null),[_,y]=(0,Q.useState)(null),[b,x]=(0,Q.useState)(null),S=De(),C=(0,Q.useMemo)(()=>G().then(e=>(e.installationType===`native`?fe:he)().catch(()=>({latest:null,stable:null}))),[]),w=P()?.autoUpdatesChannel??`latest`,T=S.filter(e=>e.mcpErrorMetadata===void 0),E=(0,Q.useMemo)(()=>[{name:`BASH_MAX_OUTPUT_LENGTH`,default:v,upperLimit:te},{name:`TASK_MAX_OUTPUT_LENGTH`,default:k,upperLimit:ce},{name:`CLAUDE_CODE_MAX_OUTPUT_TOKENS`,...z(`claude-opus-4-7`)}].map(e=>{let t=process.env[e.name],n=ee(e.name,t,e.default,e.upperLimit);return{name:e.name,...n}}).filter(e=>e.status!==`valid`),[]);(0,Q.useEffect)(()=>{G().then(p),(async()=>{let e=q(n(),`agents`),r=q(m(),`.claude`,`agents`),{activeAgents:a,allAgents:o,failedFiles:s}=t,[c,l]=await Promise.all([F(e),F(r)]),d={activeAgents:a.map(e=>({agentType:e.agentType,source:e.source})),userAgentsDir:e,projectAgentsDir:r,userDirExists:c,projectDirExists:l,failedFiles:s};g(d);let f=await Be(u,{activeAgents:a,allAgents:o,failedFiles:s},async()=>i);if(y(f),_e()){let e=q(be(),`claude`,`locks`),t=ge(e),n=ve(e);x({enabled:!0,locks:n,locksDir:e,staleLocksCleaned:t})}else x({enabled:!1,locks:[],locksDir:``,staleLocksCleaned:0})})()},[i,u,t]);let D=(0,Q.useCallback)(()=>{e(`Claude Code diagnostics dismissed`,{display:`system`})},[e]);return o({"confirm:yes":D,"confirm:no":D},{context:`Confirmation`}),f?(0,$.jsxs)(d,{children:[(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Diagnostics`}),(0,$.jsxs)(c,{children:[`└ Currently running: `,f.installationType,` (`,f.version,`)`]}),f.packageManager&&(0,$.jsxs)(c,{children:[`└ Package manager: `,f.packageManager]}),(0,$.jsxs)(c,{children:[`└ Path: `,f.installationPath]}),(0,$.jsxs)(c,{children:[`└ Invoked: `,f.invokedBinary]}),(0,$.jsxs)(c,{children:[`└ Config install method: `,f.configInstallMethod]}),(0,$.jsxs)(c,{children:[`└ Search: `,f.ripgrepStatus.working?`OK`:`Not working`,` (`,f.ripgrepStatus.mode===`embedded`?`bundled`:f.ripgrepStatus.mode===`builtin`?`vendor`:f.ripgrepStatus.systemPath||`system`,`)`]}),f.ripgrepStatus.note&&(0,$.jsxs)(c,{color:`warning`,children:[`└ Note: `,f.ripgrepStatus.note]}),f.recommendation&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsxs)(c,{color:`warning`,children:[`Recommendation: `,f.recommendation.split(`
2
- `)[0]]}),(0,$.jsx)(c,{dimColor:!0,children:f.recommendation.split(`
3
- `)[1]})]}),f.multipleInstallations.length>1&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),(0,$.jsx)(c,{color:`warning`,children:`Warning: Multiple installations found`}),f.multipleInstallations.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.type,` at `,e.path]},t))]}),f.warnings.length>0&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsx)(c,{}),f.warnings.map((e,t)=>(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsxs)(c,{color:`warning`,children:[`Warning: `,e.issue]}),(0,$.jsxs)(c,{children:[`Fix: `,e.fix]})]},t))]}),T.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,$.jsx)(c,{bold:!0,children:`Invalid Settings`}),(0,$.jsx)(W,{errors:T})]})]}),(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Updates`}),(0,$.jsxs)(c,{children:[`└ Auto-updates: `,f.packageManager?`Managed by package manager`:f.autoUpdates]}),f.hasUpdatePermissions!==null&&(0,$.jsxs)(c,{children:[`└ Update permissions: `,f.hasUpdatePermissions?`Yes`:`No (requires sudo)`]}),(0,$.jsxs)(c,{children:[`└ Auto-update channel: `,w]}),(0,$.jsx)(Q.Suspense,{fallback:null,children:(0,$.jsx)(He,{promise:C})})]}),(0,$.jsx)(Fe,{}),(0,$.jsx)(we,{}),(0,$.jsx)(Ne,{}),E.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Environment Variables`}),E.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.name,`:`,` `,(0,$.jsx)(c,{color:e.status===`capped`?`warning`:`error`,children:e.message})]},t))]}),b?.enabled&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Version Locks`}),b.staleLocksCleaned>0&&(0,$.jsxs)(c,{dimColor:!0,children:[`└ Cleaned `,b.staleLocksCleaned,` stale lock(s)`]}),b.locks.length===0?(0,$.jsx)(c,{dimColor:!0,children:`└ No active version locks`}):b.locks.map((e,t)=>(0,$.jsxs)(c,{children:[`└ `,e.version,`: PID `,e.pid,` `,e.isProcessRunning?(0,$.jsx)(c,{children:`(running)`}):(0,$.jsx)(c,{color:`warning`,children:`(stale)`})]},t))]}),h?.failedFiles&&h.failedFiles.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Agent Parse Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ Failed to parse `,h.failedFiles.length,` agent file(s):`]}),h.failedFiles.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.path,`: `,e.error]},t))]}),l.length>0&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`error`,children:`Plugin Errors`}),(0,$.jsxs)(c,{color:`error`,children:[`└ `,l.length,` plugin error(s) detected:`]}),l.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e.source||`unknown`,`plugin`in e&&e.plugin?` [${e.plugin}]`:``,`: `,oe(e)]},t))]}),_?.unreachableRulesWarning&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,color:`warning`,children:`Unreachable Permission Rules`}),(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.unreachableRulesWarning.message]})]}),_.unreachableRulesWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_&&(_.claudeMdWarning||_.agentWarning||_.mcpWarning)&&(0,$.jsxs)(s,{flexDirection:`column`,children:[(0,$.jsx)(c,{bold:!0,children:`Context Usage Warnings`}),_.claudeMdWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.claudeMdWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Files:`]}),_.claudeMdWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.agentWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.agentWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ Top contributors:`]}),_.agentWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]}),_.mcpWarning&&(0,$.jsxs)($.Fragment,{children:[(0,$.jsxs)(c,{children:[`└`,` `,(0,$.jsxs)(c,{color:`warning`,children:[a.warning,` `,_.mcpWarning.message]})]}),(0,$.jsxs)(c,{children:[` `,`└ MCP servers:`]}),_.mcpWarning.details.map((e,t)=>(0,$.jsxs)(c,{dimColor:!0,children:[` `,`└ `,e]},t))]})]}),(0,$.jsx)(s,{children:(0,$.jsx)(Ee,{})})]}):(0,$.jsx)(d,{children:(0,$.jsx)(c,{dimColor:!0,children:`Checking installation status…`})})}var Q,$,We=e((()=>{i(),Q=t(l(),1),Pe(),Ce(),V(),r(),p(),u(),Te(),Ie(),U(),Oe(),Se(),ue(),se(),g(),pe(),Ve(),de(),ne(),I(),me(),N(),w(),le(),ye(),$=f()}));export{We as n,Ue as t};
@@ -1,2 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{I as r,P as i,fi as a,t as o,y as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{$y as l,Ct as u,ES as d,Ei as f,Et as p,Gp as m,My as h,Nb as g,OS as _,Ot as v,Pb as y,Wp as b,XE as x,YE as S,gt as C,jr as w,jy as T,kt as E,tb as D}from"./loadAgentsDir-nzr38hai.js";import{l as O,p as k}from"./debug-IKW-jE7K.js";import{r as A,t as j}from"./execFileNoThrow-COKYqVQj.js";import{n as M,r as N}from"./analytics-BotDBGh0.js";function P(){(w(),e(f)).saveWorktreeState(null)}function F({onDone:e,onCancel:t}){let[n,a]=(0,I.useState)(`loading`),[o,c]=(0,I.useState)([]),[d,f]=(0,I.useState)(0),[p,h]=(0,I.useState)(),_=u();if((0,I.useEffect)(()=>{async function e(){let e=[],t=await j(`git`,[`status`,`--porcelain`]);if(t.stdout&&(e=t.stdout.split(`
2
- `).filter(e=>e.trim()!==``),c(e)),_){let{stdout:t}=await j(`git`,[`rev-list`,`--count`,`${_.originalHeadCommit}..HEAD`]),n=parseInt(t.trim(),10)||0;if(f(n),e.length===0&&n===0){a(`removing`),C().then(()=>{process.chdir(_.originalCwd),m(_.originalCwd),P(),T.cache.clear?.(),h(`Worktree removed (no changes)`)}).catch(e=>{k(`Failed to clean up worktree: ${e}`,{level:`error`}),h(`Worktree cleanup failed, exiting anyway`)}).then(()=>{a(`done`)});return}else a(`asking`)}}e()},[_]),(0,I.useEffect)(()=>{n===`done`&&e(p)},[n,e,p]),!_)return e(`No active worktree session found`,{display:`system`}),null;if(n===`loading`||n===`done`)return null;async function y(e){if(!_)return;let t=!!_.tmuxSessionName;if(e===`keep`||e===`keep-with-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:d,changed_files:o.length}),await v(),process.chdir(_.originalCwd),m(_.originalCwd),P(),T.cache.clear?.(),h(t?`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}. Reattach to tmux session with: tmux attach -t ${_.tmuxSessionName}`:`Worktree kept. Your work is saved at ${_.worktreePath} on branch ${_.worktreeBranch}`),a(`done`);else if(e===`keep-kill-tmux`)a(`keeping`),N(`tengu_worktree_kept`,{commits:d,changed_files:o.length}),_.tmuxSessionName&&await E(_.tmuxSessionName),await v(),process.chdir(_.originalCwd),m(_.originalCwd),P(),T.cache.clear?.(),h(`Worktree kept at ${_.worktreePath} on branch ${_.worktreeBranch}. Tmux session terminated.`),a(`done`);else if(e===`remove`||e===`remove-with-tmux`){a(`removing`),N(`tengu_worktree_removed`,{commits:d,changed_files:o.length}),_.tmuxSessionName&&await E(_.tmuxSessionName);try{await C(),process.chdir(_.originalCwd),m(_.originalCwd),P(),T.cache.clear?.()}catch(e){k(`Failed to clean up worktree: ${e}`,{level:`error`}),h(`Worktree cleanup failed, exiting anyway`),a(`done`);return}let e=t?` Tmux session terminated.`:``;d>0&&o.length>0?h(`Worktree removed. ${d} ${d===1?`commit`:`commits`} and uncommitted changes were discarded.${e}`):d>0?h(`Worktree removed. ${d} ${d===1?`commit`:`commits`} on ${_.worktreeBranch} ${d===1?`was`:`were`} discarded.${e}`):o.length>0?h(`Worktree removed. Uncommitted changes were discarded.${e}`):h(`Worktree removed.${e}`),a(`done`)}}if(n===`keeping`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(l,{}),(0,L.jsx)(i,{children:`Keeping worktree…`})]});if(n===`removing`)return(0,L.jsxs)(r,{flexDirection:`row`,marginY:1,children:[(0,L.jsx)(l,{}),(0,L.jsx)(i,{children:`Removing worktree…`})]});let b=_.worktreeBranch,x=o.length>0,S=d>0,w=``;w=x&&S?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`} and ${d} ${d===1?`commit`:`commits`} on ${b}. All will be lost if you remove.`:x?`You have ${o.length} uncommitted ${o.length===1?`file`:`files`}. These will be lost if you remove the worktree.`:S?`You have ${d} ${d===1?`commit`:`commits`} on ${b}. The branch will be deleted if you remove the worktree.`:`You are working in a worktree. Keep it to continue working there, or remove it to clean up.`;function D(){if(t){t();return}y(`keep`)}let O=x||S?`All changes and commits will be lost.`:`Clean up the worktree directory.`,A=!!_.tmuxSessionName,M=A?[{label:`Keep worktree and tmux session`,value:`keep-with-tmux`,description:`Stays at ${_.worktreePath}. Reattach with: tmux attach -t ${_.tmuxSessionName}`},{label:`Keep worktree, kill tmux session`,value:`keep-kill-tmux`,description:`Keeps worktree at ${_.worktreePath}, terminates tmux session.`},{label:`Remove worktree and tmux session`,value:`remove-with-tmux`,description:O}]:[{label:`Keep worktree`,value:`keep`,description:`Stays at ${_.worktreePath}`},{label:`Remove worktree`,value:`remove`,description:O}];return(0,L.jsx)(s,{title:`Exiting worktree session`,subtitle:w,onCancel:D,children:(0,L.jsx)(g,{defaultFocusValue:A?`keep-with-tmux`:`keep`,options:M,onChange:y})})}var I,L,R=t((()=>{I=n(a(),1),M(),O(),o(),A(),h(),b(),p(),y(),D(),L=c()}));function z(){return x(H)??`Goodbye!`}function B({showWorktree:e,onDone:t,onCancel:n}){async function r(e){t(e??z()),await d(0,`prompt_input_exit`)}return e?(0,V.jsx)(F,{onDone:r,onCancel:n}):null}var V,H,U=t((()=>{S(),a(),_(),R(),V=c(),H=[`Goodbye!`,`See ya!`,`Bye!`,`Catch you later!`]}));export{U as n,B as t};
@@ -1,2 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./axios-DaWTGg7G.js";import{D as i,I as a,P as o,T as s,Wt as c,fi as l,hn as u,ot as d,t as f,y as ee}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{U as te,en as m}from"./state-4KQ3kaqz.js";import{Er as h,Hb as g,Jo as ne,TS as _,Ur as re,Vb as v,dT as y,et as b,ex as x,jr as S,ko as ie,nT as C,rT as w,tt as T,tx as E,zo as D}from"./loadAgentsDir-nzr38hai.js";import{E as O,O as k,l as A,p as ae}from"./debug-IKW-jE7K.js";import{Jt as j,Zt as oe}from"./settings-5PQdphqC.js";import{_ as se,c as ce,d as le}from"./git-tyaWOgRL.js";import{d as M,f as N,i as P,o as F,s as I}from"./log-B3eB4EFv.js";import{n as L,r as R}from"./analytics-BotDBGh0.js";import{Vt as z,er as B,ht as V,ir as H,nr as U}from"./model-DfFA3qMO.js";import{st as W}from"./rcDebugLog-BUuD-X1D.js";import{a as ue,n as de}from"./firstPartyEventLogger-hU-LPkje.js";import{u as fe}from"./referral-DP_GshTS.js";import{n as pe,t as me}from"./browser-Bd7GeBH1.js";import{readFile as he,stat as ge}from"fs/promises";function G(e){let t=e;return t=t.replace(/"(sk-ant[^\s"']{24,})"/g,`"[REDACTED_API_KEY]"`),t=t.replace(/(?<![A-Za-z0-9"'])(sk-ant-?[A-Za-z0-9_-]{10,})(?![A-Za-z0-9"'])/g,`[REDACTED_API_KEY]`),t=t.replace(/AWS key: "(AWS[A-Z0-9]{20,})"/g,`AWS key: "[REDACTED_AWS_KEY]"`),t=t.replace(/(AKIA[A-Z0-9]{16})/g,`[REDACTED_AWS_KEY]`),t=t.replace(/(?<![A-Za-z0-9])(AIza[A-Za-z0-9_-]{35})(?![A-Za-z0-9])/g,`[REDACTED_GCP_KEY]`),t=t.replace(/(?<![A-Za-z0-9])([a-z0-9-]+@[a-z0-9-]+\.iam\.gserviceaccount\.com)(?![A-Za-z0-9])/g,`[REDACTED_GCP_SERVICE_ACCOUNT]`),t=t.replace(/(["']?x-api-key["']?\s*[:=]\s*["']?)[^"',\s)}\]]+/gi,`$1[REDACTED_API_KEY]`),t=t.replace(/(["']?authorization["']?\s*[:=]\s*["']?(bearer\s+)?)[^"',\s)}\]]+/gi,`$1[REDACTED_TOKEN]`),t=t.replace(/(AWS[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_AWS_VALUE]`),t=t.replace(/(GOOGLE[_-][A-Za-z0-9_]+\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED_GCP_VALUE]`),t=t.replace(/((API[-_]?KEY|TOKEN|SECRET|PASSWORD)\s*[=:]\s*)["']?[^"',\s)}\]]+["']?/gi,`$1[REDACTED]`),t}function K(){return P().map(e=>{let t={...e};return t&&typeof t.error==`string`&&(t.error=G(t.error)),t})}async function _e(){try{let e=h(),{size:t}=await ge(e);return t>52428800?(ae(`Skipping raw transcript read: file too large (${t} bytes)`,{level:`warn`}),null):await he(e,`utf-8`)}catch{return null}}function ve({abortSignal:e,messages:t,initialDescription:n,onDone:r,backgroundTasks:l={}}){let[f,p]=(0,X.useState)(`userInput`),[m,h]=(0,X.useState)(0),[g,_]=(0,X.useState)(n??``),[y,b]=(0,X.useState)(null),[S,C]=(0,X.useState)(null),[w,T]=(0,X.useState)({isGit:!1,gitState:null}),[E,D]=(0,X.useState)(null),O=d().columns-4;(0,X.useEffect)(()=>{async function e(){let e=await le(),t=null;e&&(t=await ce()),T({isGit:e,gitState:t})}e()},[]);let k=(0,X.useCallback)(async()=>{p(`submitting`),C(null),b(null);let n=K(),r=ie(t)?.requestId??null,[i,a]=await Promise.all([re(),_e()]),o={...i},s={latestAssistantMessageId:r,message_count:t.length,datetime:new Date().toISOString(),description:g,platform:j.platform,gitRepo:w.isGit,terminal:j.terminal,version:`0.0.1`,transcript:ne(t),errors:n,lastApiRequest:te(),...Object.keys(o).length>0&&{subagentTranscripts:o},...a&&{rawTranscriptJsonl:a}},[c,l]=await Promise.all([Y(s,e),be(g,e)]);D(l),c.success?(c.feedbackId&&(b(c.feedbackId),R(`tengu_bug_report_submitted`,{feedback_id:c.feedbackId,last_assistant_message_id:r}),ue(`tengu_bug_report_description`,{feedback_id:c.feedbackId,description:G(g)})),p(`done`)):(c.isZdrOrg?C(`Feedback collection is not available for organizations with custom data retention policies.`):C(`Could not submit feedback. Please try again later.`),p(`userInput`))},[g,w.isGit,t]),A=(0,X.useCallback)(()=>{if(f===`done`){r(S?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}r(`Feedback / bug report cancelled`,{display:`system`})},[f,S,r]);return c(`confirm:no`,A,{context:`Settings`,isActive:f===`userInput`}),u((e,t)=>{if(f===`done`){t.return&&E&&pe(ye(y??``,E,g,K())),r(S?`Error submitting feedback / bug report`:`Feedback / bug report submitted`,{display:`system`});return}if(S&&f!==`userInput`){r(`Error submitting feedback / bug report`,{display:`system`});return}f===`consent`&&(t.return||e===` `)&&k()}),(0,Z.jsxs)(ee,{title:`Submit Feedback / Bug Report`,onCancel:A,isCancelActive:f!==`userInput`,inputGuide:e=>e.pending?(0,Z.jsxs)(o,{children:[`Press `,e.keyName,` again to exit`]}):f===`userInput`?(0,Z.jsxs)(s,{children:[(0,Z.jsx)(i,{shortcut:`Enter`,action:`continue`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):f===`consent`?(0,Z.jsxs)(s,{children:[(0,Z.jsx)(i,{shortcut:`Enter`,action:`submit`}),(0,Z.jsx)(v,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`cancel`})]}):null,children:[f===`userInput`&&(0,Z.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{children:`Describe the issue below:`}),(0,Z.jsx)(x,{value:g,onChange:e=>{_(e),S&&C(null)},columns:O,onSubmit:()=>p(`consent`),onExitMessage:()=>r(`Feedback cancelled`,{display:`system`}),cursorOffset:m,onChangeCursorOffset:h,showCursor:!0}),S&&(0,Z.jsxs)(a,{flexDirection:`column`,gap:1,children:[(0,Z.jsx)(o,{color:`error`,children:S}),(0,Z.jsx)(o,{dimColor:!0,children:`Edit and press Enter to retry, or Esc to cancel`})]})]}),f===`consent`&&(0,Z.jsxs)(a,{flexDirection:`column`,children:[(0,Z.jsx)(o,{children:`This report will include:`}),(0,Z.jsxs)(a,{marginLeft:2,flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[`- Your feedback / bug description: `,(0,Z.jsx)(o,{dimColor:!0,children:g})]}),(0,Z.jsxs)(o,{children:[`- Environment info:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[j.platform,`, `,j.terminal,`, v`,`0.0.1`]})]}),w.gitState&&(0,Z.jsxs)(o,{children:[`- Git repo metadata:`,` `,(0,Z.jsxs)(o,{dimColor:!0,children:[w.gitState.branchName,w.gitState.commitHash?`, ${w.gitState.commitHash.slice(0,7)}`:``,w.gitState.remoteUrl?` @ ${w.gitState.remoteUrl}`:``,!w.gitState.isHeadOnRemote&&`, not synced`,!w.gitState.isClean&&`, has local changes`]})]}),(0,Z.jsx)(o,{children:`- Current session transcript`})]}),(0,Z.jsx)(a,{marginTop:1,children:(0,Z.jsx)(o,{wrap:`wrap`,dimColor:!0,children:`We will use your feedback to debug related issues or to improve Claude Code's functionality (eg. to reduce the risk of bugs occurring in the future).`})}),(0,Z.jsx)(a,{marginTop:1,children:(0,Z.jsxs)(o,{children:[`Press `,(0,Z.jsx)(o,{bold:!0,children:`Enter`}),` to confirm and submit.`]})})]}),f===`submitting`&&(0,Z.jsx)(a,{flexDirection:`row`,gap:1,children:(0,Z.jsx)(o,{children:`Submitting report…`})}),f===`done`&&(0,Z.jsxs)(a,{flexDirection:`column`,children:[S?(0,Z.jsx)(o,{color:`error`,children:S}):(0,Z.jsx)(o,{color:`success`,children:`Thank you for your report!`}),y&&(0,Z.jsxs)(o,{dimColor:!0,children:[`Feedback ID: `,y]}),(0,Z.jsxs)(a,{marginTop:1,children:[(0,Z.jsx)(o,{children:`Press `}),(0,Z.jsx)(o,{bold:!0,children:`Enter `}),(0,Z.jsx)(o,{children:`to open your browser and draft a GitHub issue, or any other key to close.`})]})]})]})}function ye(e,t,n,r){let i=G(t),a=`**Bug Description**\n${G(n)}\n\n**Environment Info**\n- Platform: ${j.platform}\n- Terminal: ${j.terminal}\n- Version: 0.0.1\n- Feedback ID: ${e}\n\n**Errors**\n\`\`\`json\n`,o=k(r),s=`${$}/new?title=${encodeURIComponent(i)}&labels=user-reported,bug&body=`,c=encodeURIComponent(a),l=encodeURIComponent(o),u=Q-s.length-c.length-15-46;if(u<=0){let e=Q-s.length-9-46-50,t=a+o+"\n```\n",n=encodeURIComponent(t);if(n.length>e){n=n.slice(0,e);let t=n.lastIndexOf(`%`);t>=n.length-2&&(n=n.slice(0,t))}return s+n+`%E2%80%A6%0A**Note%3A**%20Content%20was%20truncated.%0A`}if(l.length<=u)return s+c+l+`%0A%60%60%60%0A`;let d=l.slice(0,u-9-50),f=d.lastIndexOf(`%`);return f>=d.length-2&&(d=d.slice(0,f)),s+c+d+`%E2%80%A6%0A%60%60%60%0A%0A**Note%3A**%20Content%20was%20truncated.%0A`}async function be(e,t){try{let n=(await T({systemPrompt:W([`Generate a concise, technical issue title (max 80 chars) for a public GitHub issue based on this bug report for Claude Code.`,`Claude Code is an agentic coding CLI based on the Anthropic API.`,`The title should:`,`- Include the type of issue [Bug] or [Feature Request] as the first thing in the title`,`- Be concise, specific and descriptive of the actual problem`,`- Use technical terminology appropriate for a software issue`,`- For error messages, extract the key error (e.g., "Missing Tool Result Block" rather than the full message)`,`- Be direct and clear for developers to understand the problem`,`- If you cannot determine a clear issue, use "Bug Report: [brief description]"`,`- Any LLM API errors are from the Anthropic API, not from any other model provider`,`Your response will be directly used as the title of the Github issue, and as such should not contain any other commentary or explaination`,`Examples of good titles include: "[Bug] Auto-Compact triggers to soon", "[Bug] Anthropic API Error: Missing Tool Result Block", "[Bug] Error: Invalid Model Name for Opus"`]),userPrompt:e,signal:t,options:{hasAppendSystemPrompt:!1,toolChoice:void 0,isNonInteractiveSession:!1,agents:[],querySource:`feedback`,mcpTools:[]}}))?.message?.content?.[0],r=n?.type===`text`?n.text:`Bug Report`;return w(r)?q(e):r}catch(t){return I(t),q(e)}}function q(e){let t=e.split(`
2
- `)[0]||``;if(t.length<=60&&t.length>5)return t;let n=t.slice(0,60);if(t.length>60){let e=n.lastIndexOf(` `);e>30&&(n=n.slice(0,e)),n+=`...`}return n.length<10?`Bug Report`:n}function J(e){if(e instanceof Error){let t=Error(G(e.message));e.stack&&(t.stack=G(e.stack)),I(t)}else{let t=G(String(e));I(Error(t))}}async function Y(e,t){if(N())return{success:!1};try{await V();let r=B();if(r.error)return{success:!1};let i={"Content-Type":`application/json`,"User-Agent":U(),...r.headers},a=await n.post(`https://api.anthropic.com/api/claude_cli_feedback`,{content:k(e)},{headers:i,timeout:3e4,signal:t});if(a.status===200){let e=a.data;return e?.feedback_id?{success:!0,feedbackId:e.feedback_id}:(J(Error(`Failed to submit feedback: request did not return feedback_id`)),{success:!1})}return J(Error(`Failed to submit feedback:`+a.status)),{success:!1}}catch(e){if(n.isCancel(e))return{success:!1};if(n.isAxiosError(e)&&e.response?.status===403){let t=e.response.data;if(t?.error?.type===`permission_error`&&t?.error?.message?.includes(`Custom data retention settings`))return J(Error(`Cannot submit feedback because custom data retention settings are enabled`)),{success:!1,isZdrOrg:!0}}return J(e),{success:!1}}}var X,Z,Q,$,xe=e((()=>{r(),l(),X=t(l(),1),m(),de(),L(),D(),_(),f(),fe(),b(),C(),z(),me(),A(),oe(),se(),H(),F(),M(),S(),O(),y(),g(),E(),Z=p(),Q=7250,$=process.env.USER_TYPE===`ant`?`https://github.com/anthropics/claude-cli-internal/issues`:`https://github.com/anthropics/claude-code/issues`}));export{xe as n,G as r,ve as t};
@@ -1 +0,0 @@
1
- import{r as e,t}from"./Grove--kttLxvs.js";e();export{t as GroveDialog};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{en as a,ht as o}from"./state-4KQ3kaqz.js";import{G_ as s,K_ as c,L_ as l,M_ as u,QE as d,Q_ as f,R_ as p,T_ as m,V_ as h,X_ as g,ZE as _,Z_ as ee,cg as v,dS as y,dg as b,ev as x,fS as S,gg as te,hg as C,ig as w,lS as T,oS as E,og as D,pg as O,sS as ne,sg as k,uS as A,ug as j,y_ as re,z_ as ie}from"./loadAgentsDir-nzr38hai.js";import{U as ae,l as oe,p as se,z as M}from"./debug-IKW-jE7K.js";import{ct as ce,ot as le}from"./settings-5PQdphqC.js";import{c as N,l as P,o as F}from"./log-B3eB4EFv.js";import{n as I,r as L}from"./analytics-BotDBGh0.js";import{c as R,s as z}from"./pluginFlagging-BVy7Xv_0.js";import{o as B,s as V}from"./localSearch-B-L_ldos.js";import{B as H,G as U,H as ue,K as de}from"./stdio-W_Kokrkh.js";import{basename as fe}from"path";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 pe(e,t=!1){let n=y(),r=A(e=>e.authVersion),i=A(e=>e.mcp.pluginReconnectKey),a=S(),s=(0,K.useRef)(new Map),{addNotification:u}=ne(),_=(0,K.useRef)([]),b=(0,K.useRef)(null),x=(0,K.useCallback)(()=>{b.current=null;let e=_.current;e.length!==0&&(_.current=[],a(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=le(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),f=o===void 0?n.tools:[...d(n.tools,e=>e.name?.startsWith(l)),...o],p=s===void 0?n.commands:[...d(n.commands,e=>re(e,a.name)),...s],m=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:R(n.resources,a.name)};n={...n,clients:u,tools:f,commands:p,resources:m}}return{...t,mcp:n}}))},[a]),C=(0,K.useCallback)(e=>{_.current.push(e),b.current===null&&(b.current=setTimeout(x,16))},[x]),T=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(C({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:te(e.client,e.name,a),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(w(e.name,e.config).catch(()=>{se(`Failed to invalidate the server cache: ${e.name}`)}),c(e.name)){N(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=me(t);N(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=s.current.get(e.name);r&&(clearTimeout(r),s.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(c(e.name)){N(e.name,`Server disabled during reconnection, stopping retry`),s.current.delete(e.name);return}C({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await O(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){N(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),s.current.delete(e.name),T(i);return}if(N(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){N(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),T(i);return}}catch(i){let a=Date.now()-r;if(P(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){N(e.name,`Max reconnection attempts (${J}) reached, giving up`),s.current.delete(e.name),C({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);N(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);s.current.set(e.name,n)})}})()}else C({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(U,async()=>{N(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=v.cache.get(e.name);v.cache.delete(e.name);let n=await v(e),r=n.length;t?t.then(e=>{L(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{L(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):L(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),C({...e,tools:n})}catch(t){P(e.name,`Failed to refresh tools after list_changed notification: ${M(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(H,async()=>{N(e.name,`Received prompts/list_changed notification, refreshing prompts`),L(`tengu_mcp_list_changed`,{type:`prompts`});try{D.cache.delete(e.name);let[t,n]=await Promise.all([D(e),Promise.resolve([])]);C({...e,commands:[...t,...n]}),q?.()}catch(t){P(e.name,`Failed to refresh prompts after list_changed notification: ${M(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(ue,async()=>{N(e.name,`Received resources/list_changed notification, refreshing resources`),L(`tengu_mcp_list_changed`,{type:`resources`});try{k.cache.delete(e.name);{let t=await k(e);C({...e,resources:t})}}catch(t){P(e.name,`Failed to refresh resources after list_changed notification: ${M(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[C]),E=o();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await h(e),i={...n,...e};G(a,r),a(e=>{let{stale:t,...n}=m(e.mcp,i);for(let e of t){let t=s.current.get(e.name);t&&(clearTimeout(t),s.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,w(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:c(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=>{P(`useManageMCPConnections`,`Failed to initialize servers as pending: ${M(e)}`)})},[t,e,a,E,i]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||p()?r=Promise.resolve({}):(ee(),r=f());let{servers:i,errors:o}=t?{servers:{},errors:[]}:await h(e,r);if(n)return;G(a,o);let s={...i,...e},u=Object.fromEntries(Object.entries(s).filter(([e])=>!c(e)));j(T,u).catch(e=>{P(`useManageMcpConnections`,`Failed to get MCP resources: ${M(e)}`)});let d={};if(!t){if(d=ie(await r).allowed,n)return;if(Object.keys(d).length>0){let{servers:e}=l(d,s);d=e}if(Object.keys(d).length>0){a(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(d).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:c(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(d).filter(([e])=>!c(e)));j(T,e).catch(e=>{P(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${M(e)}`)})}}let m={...s,...d},g={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},_=[];for(let[e,t]of Object.entries(m))t.scope===`enterprise`?g.enterprise++:t.scope===`user`?g.global++:t.scope===`project`?g.project++:t.scope===`local`?g.user++:t.scope===`dynamic`?g.plugin++:t.scope===`claudeai`&&g.claudeai++,process.env.USER_TYPE===`ant`&&!c(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&_.push(fe(t.command));L(`tengu_mcp_servers`,{...g,...process.env.USER_TYPE===`ant`&&_.length>0?{stdio_commands:_.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,T,a,r,E,i]),(0,K.useEffect)(()=>{let e=s.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),b.current!==null&&(clearTimeout(b.current),b.current=null,x())}},[x]),{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=s.current.get(e);r&&(clearTimeout(r),s.current.delete(e));let i=await O(e,t.config);return T(i),i},[n,T]),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=s.current.get(e);n&&(clearTimeout(n),s.current.delete(e)),g(e,!1),t.type===`connected`&&await w(e,t.config),C({name:e,type:`disabled`,config:t.config})}else{g(e,!0),C({name:e,type:`pending`,config:t.config});let n=await O(e,t.config);T(n)}},[n,C,T])}}function me(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,he=t((()=>{K=n(r(),1),a(),b(),de(),z(),_(),I(),s(),oe(),E(),T(),ae(),F(),C(),x(),ce(),u(),q=(B(),e(V)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ge(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function _e(){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}=pe(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ye=t((()=>{Z=n(r(),1),he(),Q=i(),$=(0,Z.createContext)(null)}));export{_e as i,ye as n,ge as r,ve as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{en as m,ht as h,nr as g,pt as _}from"./state-4KQ3kaqz.js";import{$y as v,By as y,Dc as b,Ec as x,Gi as S,Go as C,Gy as w,Nb as ee,Oo as T,Pb as E,Qi as D,Rc as O,Ry as te,SC as k,So as A,TS as j,Ui as ne,Uo as M,Vo as re,Yb as ie,Zb as ae,ca as oe,fT as N,hT as P,hn as se,ho as ce,kc as F,lS as le,lu as I,mT as ue,on as de,os as fe,su as pe,tb as me,uS as he,wo as L,xC as R,yn as ge,yo as z,zc as _e,zo as B,zy as ve}from"./loadAgentsDir-nzr38hai.js";import{n as ye,t as be}from"./cwd-BuJhkTrc.js";import{$ as xe,_n as Se,f as Ce,g as we,gn as Te,nt as Ee}from"./settings-5PQdphqC.js";import{Y as De,h as Oe,m as ke,o as Ae,s as V,w as je}from"./log-B3eB4EFv.js";import{n as H,r as U}from"./analytics-BotDBGh0.js";import{S as Me,b as Ne,h as Pe}from"./startupProfiler-DxRQteII.js";import{Ct as Fe,Vt as Ie,X as Le,tt as Re}from"./model-DfFA3qMO.js";import{E as ze,T as Be,c as Ve,d as He,w as Ue}from"./sessionTracing-BuLsL6qA.js";import{u as We}from"./referral-DP_GshTS.js";import{n as Ge,t as Ke}from"./slashCommandParsing-RQb_7Xzt.js";import{n as qe,t as Je}from"./useExitOnCtrlCDWithKeybindings-yAroCqu4.js";import*as W from"path";import{randomUUID as G}from"crypto";u();var K=p();r(),f(),m(),ye(),De(),ke(),Ae(),Se(),H(),Ne(),Ee(),we(),Ie(),ue(),Ue(),R(),ie(),Ve(),pe(),O(),F(),fe(),B(),D(),ge(),Ke();var Ye={"`":"`",'"':`"`,"<":`>`,"{":`}`,"[":`]`,"(":`)`,"'":`'`};function Xe(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!==Ye[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 Ye)&&(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 q(e){return Xe(e,`ultraplan`)}function Ze(e){return Xe(e,`ultrareview`)}function Qe(e){return q(e).length>0}function $e(e){let[t]=q(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 et(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 tt(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function nt(e,t,n,r,i,a,o){let s=G();g(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;He(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Be(`user_prompt`,{prompt_length:String(l.length),prompt:ze(l),"prompt.id":s}),U(`tengu_input_prompt`,{is_negative:et(c),is_keep_going:tt(c)}),t.length>0?{messages:[A({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:[A({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}H(),B();async function rt({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,y=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!y&&c?.(v),I(`query_process_user_input_base_start`);let b=i.getAppState(),S=await at(e,n,r,i,a,o,s,l,u,d,f,b.toolPermissionContext.mode,p,m,h,g,t,_);if(I(`query_process_user_input_base_end`),!S.shouldQuery)return S;I(`query_hooks_start`);let C=T(e)||``;for await(let t of de(C,b.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[z(`${se(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:S.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return S.messages.push(A({content:e})),S.shouldQuery=!1,S}if(t.additionalContexts&&t.additionalContexts.length>0&&S.messages.push(x({type:`hook_additional_context`,content:t.additionalContexts.map(it),hookName:`UserPromptSubmit`,toolUseID:`hook-${G()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;S.messages.push({...t.message,attachment:{...t.message.attachment,content:it(t.message.attachment.content)}});break;default:S.messages.push(t.message);break}}return I(`query_hooks_end`),S}var J=1e4;function it(e){return e.length>J?`${e.substring(0,J)}… [output truncated - exceeded ${J} characters]`:e}async function at(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],x=[],C=e;if(typeof e==`string`)v=e;else if(e.length>0){I(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await P(n);if(e.dimensions){let t=N(e.dimensions);t&&x.push(t)}t.push(e.block)}else t.push(n);C=t,I(`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 w=i?Object.values(i).filter(_e):[],ee=w.map(e=>e.id),T=i?await ae(i):new Map;I(`query_pasted_image_processing_start`);let E=await Promise.all(w.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return U(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await P(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??T.get(e.id)}})),D=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of E){if(e.dimensions){let t=N(e.dimensions,n);t&&x.push(t)}else if(t){let e=N(t,n);e&&x.push(e)}else n&&x.push(`[Image source: ${n}]`);D.push(e.block)}I(`query_pasted_image_processing_end`);let O=f;if(p&&v!==null&&v.startsWith(`/`)){let e=Ge(v),t=e?ne(e.commandName,r.options.commands):void 0;if(t){let n=S(t,e?.args??``);if(n.ok)O=!1;else{let e=n.reason??`/${oe(t)} isn't available over Remote Control.`;return{messages:[A({content:v,uuid:s}),ce(`<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&&Qe(g??v)){U(`tengu_ultraplan_keyword`,{});let e=$e(v).trim(),{processSlashCommand:t}=await import(`./processSlashCommand-BdouajZb.js`);return Y(await t(`/ultraplan ${e}`,y,D,[],r,n,s,c,u,_),x)}let te=!h&&v!==null&&(t!==`prompt`||O||!v.startsWith(`/`));I(`query_attachment_loading_start`);let j=te?await k(b(v,r,a??null,[],o,l)):[];if(I(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-loWZ8MSE.js`);return Y(await e(v,y,j,r,n),x)}if(v!==null&&!O&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-BdouajZb.js`);return Y(await e(v,y,D,j,r,n,s,c,u,_),x)}if(v!==null&&t===`prompt`){let e=v.trim(),t=j.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;U(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return Y(nt(C,D,ee,j,s,d,m),x)}function Y(e,t){return t.length>0&&e.messages.push(A({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Re();function ot(e){return e===`Agent`?xe:e}function st(e){let t=Ce()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:be(),session_id:h(),tools:e.tools.map(e=>ot(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:Fe().source,betas:_(),claude_code_version:`0.0.1`,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:G()};return n.fast_mode_state=Le(e.model,e.fastMode),n}var ct=n({MessageSelector:()=>ut,messagesAfterAreOnlySynthetic:()=>_t,selectableUserMessagesFilter:()=>Z});function lt(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:u,onClose:d,preselectedMessage:f}){let p=he(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=ve(),_=(0,Q.useMemo)(G,[]),b=(0,Q.useMemo)(()=>[...e.filter(Z),{...A({content:``}),uuid:_}],[e,_]),[x,S]=(0,Q.useState)(b.length-1),C=Math.max(0,Math.min(x-Math.floor($/2),b.length-$)),w=b.length>1,[T,E]=(0,Q.useState)(f),[D,O]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return y(p,f.uuid).then(t=>{e||O(t)}),()=>{e=!0}},[f,g,p]);let[k,j]=(0,Q.useState)(!1),[ne,M]=(0,Q.useState)(null),[re,ie]=(0,Q.useState)(`both`),[ae,oe]=(0,Q.useState)(``),[N,P]=(0,Q.useState)(``);function se(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:oe}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:P}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{U(`tengu_message_selector_opened`,{})},[]);async function ce(e){t(),j(!0);try{await n(e),j(!1),d()}catch(e){V(e),j(!1),h(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(U(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await ce(t);return}let r=await y(p,t.uuid);E(t),O(r)}async function le(e){if(U(`tengu_message_selector_restore_option_selected`,{option:e}),!T){h(`Message not found.`);return}if(e===`nevermind`){f?d():E(void 0);return}if(X(e)){t(),j(!0),M(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?N:ae).trim()||void 0;await u(T,n,t),j(!1),M(null),E(void 0),d()}catch(e){V(e),j(!1),M(null),E(void 0),h(`Failed to summarize:\n${e}`)}return}t(),j(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(T)}catch(e){i=e,V(i)}if(e===`conversation`||e===`both`)try{await n(T)}catch(e){a=e,V(a)}j(!1),E(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let I=qe(),ue=(0,Q.useCallback)(()=>{if(T&&!f){E(void 0);return}U(`tengu_message_selector_cancelled`,{}),d()},[d,T,f]),de=(0,Q.useCallback)(()=>S(e=>Math.max(0,e-1)),[]),fe=(0,Q.useCallback)(()=>S(e=>Math.min(b.length-1,e+1)),[b.length]),pe=(0,Q.useCallback)(()=>S(0),[]),me=(0,Q.useCallback)(()=>S(b.length-1),[b.length]),L=(0,Q.useCallback)(()=>{let e=b[x];e&&F(e)},[b,x,F]);l(`confirm:no`,ue,{context:`Confirmation`,isActive:!T}),o({"messageSelector:up":de,"messageSelector:down":fe,"messageSelector:top":pe,"messageSelector:bottom":me,"messageSelector:select":L},{context:`MessageSelector`,isActive:!k&&!m&&!T&&w});let[R,ge]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(b.map(async(t,n)=>{if(t.uuid!==_){let r=te(p,t.uuid),i=b.at(n+1),a=r?gt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;ge(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[b,e,_,p,g]);let z=g&&D?.filesChanged&&D.filesChanged.length>0,_e=!m&&!T&&!f&&w;return(0,K.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,K.jsx)(a,{color:`suggestion`}),(0,K.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,K.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!w&&(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&T&&w&&(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{children:[`Confirm you want to restore `,!D&&`the conversation `,`to the point before you sent this message:`]}),(0,K.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,K.jsx)(ht,{userMessage:T,color:`text`,isCurrent:!1}),(0,K.jsxs)(c,{dimColor:!0,children:[`(`,Pe(new Date(T.timestamp)),`)`]})]}),(0,K.jsx)(ft,{selectedRestoreOption:re,canRestoreCode:!!z,diffStatsForRestore:D}),k&&X(ne)?(0,K.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,K.jsx)(v,{}),(0,K.jsx)(c,{children:`Summarizing…`})]}):(0,K.jsx)(ee,{isDisabled:k,options:se(!!z),defaultFocusValue:z?`both`:`conversation`,onFocus:e=>ie(e),onChange:e=>le(e),onCancel:()=>f?d():E(void 0)}),z&&(0,K.jsx)(s,{marginBottom:1,children:(0,K.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),_e&&(0,K.jsxs)(K.Fragment,{children:[g?(0,K.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,K.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,K.jsx)(s,{width:`100%`,flexDirection:`column`,children:b.slice(C,C+$).map((e,t)=>{let n=C+t,r=n===x,a=e.uuid===_,o=n in R,l=R[n],u=l?.filesChanged&&l.filesChanged.length;return(0,K.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,K.jsx)(s,{width:2,minWidth:2,children:r?(0,K.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,K.jsx)(c,{children:` `})}),(0,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,K.jsx)(ht,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,K.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,K.jsx)(K.Fragment,{children:(0,K.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,K.jsxs)(K.Fragment,{children:[u===1&&l.filesChanged[0]?`${W.basename(l.filesChanged[0])} `:`${u} files changed `,(0,K.jsx)(mt,{diffStats:l})]}):(0,K.jsx)(K.Fragment,{children:`No code changes`})})}):(0,K.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!T&&(0,K.jsx)(c,{dimColor:!0,italic:!0,children:I.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,I.keyName,` again to exit`]}):(0,K.jsxs)(K.Fragment,{children:[!m&&w&&`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,K.jsxs)(s,{flexDirection:`column`,children:[(0,K.jsx)(c,{dimColor:!0,children:dt(e)}),!X(e)&&(r?(0,K.jsx)(pt,{diffStatsForRestore:n}):(0,K.jsx)(c,{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,K.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?W.basename(e.filesChanged[0]||``):t===2?`${W.basename(e.filesChanged[0]||``)} and ${W.basename(e.filesChanged[1]||``)}`:`${W.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,K.jsx)(K.Fragment,{children:(0,K.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,K.jsx)(mt,{diffStats:e}),` in `,n,`.`]})})}function mt({diffStats:e}){if(!(!e||!e.filesChanged))return(0,K.jsxs)(K.Fragment,{children:[(0,K.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,K.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function ht({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,K.jsx)(s,{width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Oe(typeof o==`string`?o.trim():l&&lt(l)?l.text.trim():`(no prompt)`);if(re(u))return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=L(u,`bash-input`);if(e)return(0,K.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,K.jsx)(c,{color:`bashBorder`,children:`!`}),(0,K.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=L(u,je),r=L(u,`command-args`),i=L(u,`skill-format`)===`true`;if(e)return i?(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,K.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,K.jsx)(c,{color:t,dimColor:n,children:i?Me(u,a-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||!C(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=Te(e.lines,e=>e.startsWith(`+`)),n=Te(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`||M(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&&lt(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)}function _t(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!M(t)&&!C(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(u(),1),H(),le(),w(),Je(),We(),B(),E(),me(),j(),$=7}));export{Z as a,rt as c,_t as i,q as l,ct as n,st as o,vt as r,ot as s,ut as t,Ze as u};
@@ -1,11 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{C as s,Gr as c,I as l,N as u,P as d,Pn as f,Rn as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,ui as b,xt as x}from"./src-CDCSSo0U2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{B as C,en as w}from"./state-4KQ3kaqz.js";import{$T as T,$a as E,$o as D,Am as O,Ao as ee,Bu as k,Co as te,Cv as ne,Eg as re,Eu as ie,Fu as A,GD as j,Hg as M,Ho as N,IE as ae,Iu as oe,Lg as se,Lm as ce,Lu as le,Mg as P,Mm as F,Mo as ue,NE as I,Nm as de,No as fe,Og as pe,Po as me,QT as he,Ro as ge,Ru as _e,Sv as ve,TS as ye,Ub as be,Ug as xe,Wb as Se,Xo as Ce,YD as we,YT as L,Zo as Te,bh as Ee,bv as De,cb as Oe,ch as ke,co as Ae,cw as je,cx as Me,dy as Ne,eo as Pe,jm as Fe,jo as Ie,km as Le,lS as Re,lb as ze,lh as Be,lx as Ve,nh as He,po as Ue,qo as We,so as Ge,sw as Ke,tE as qe,th as Je,to as Ye,uS as Xe,ub as Ze,uy as Qe,vv as $e,wo as et,wv as tt,xv as nt,yh as rt,zo as it,zu as at}from"./loadAgentsDir-nzr38hai.js";import{n as ot,t as st}from"./cwd-BuJhkTrc.js";import{d as ct,l as lt,o as ut,p as dt,u as ft}from"./debug-IKW-jE7K.js";import{G as pt,Jt as mt,K as ht,Kt as gt,Ut as _t,Zt as vt,g as yt,n as bt}from"./settings-5PQdphqC.js";import{b as xt,c as R,g as St}from"./config-C7YHKCPV.js";import{B as Ct,L as wt,R as Tt,Y as Et}from"./log-B3eB4EFv.js";import{f as Dt,l as Ot}from"./file-D1cN3LMK.js";import{n as kt,r as At}from"./analytics-BotDBGh0.js";import{S as jt,b as Mt,h as Nt,n as Pt,p as Ft,r as It,t as Lt}from"./startupProfiler-DxRQteII.js";import{l as Rt,o as zt}from"./stringUtils-CvXbHQRH.js";import{Ct as Bt,E as Vt,Et as Ht,Kt as Ut,Ot as Wt,Vt as Gt,_ as Kt,b as qt,vn as Jt,yn as Yt}from"./model-DfFA3qMO.js";import{Cn as Xt,xn as Zt}from"./prompt-Bef63FhB.js";import{C as Qt,y as $t}from"./rcDebugLog-BUuD-X1D.js";import{a as en,o as tn,r as nn,s as rn,t as an}from"./referral-DP_GshTS.js";import{d as on,f as sn,h as cn,p as ln}from"./terminalSetup-C0PF87iu.js";import{n as un,r as dn,t as fn}from"./browser-Bd7GeBH1.js";import{c as pn,r as mn}from"./releaseNotes-CbSktIJW.js";import{a as hn,c as gn,d as _n,i as vn,l as yn,n as bn,o as xn,r as Sn,t as Cn,u as wn}from"./logoV2Utils-RQ160dI2.js";import{n as Tn,t as En}from"./systemTheme-Ceakddth.js";import{n as Dn,r as On}from"./PromptInputFooterSuggestions-CrGST0Cq.js";import{n as kn,t as An}from"./useMainLoopModel-BNFW-g8E.js";import{n as jn,t as Mn}from"./modalContext-DFjKLCB6.js";import{i as Nn,n as Pn,r as Fn,s as In,t as Ln}from"./OverageCreditUpsell-1FCN8bH3.js";import{n as Rn,r as zn,t as Bn}from"./statusNoticeHelpers-CQ7CUugR.js";import{homedir as Vn}from"os";import{relative as Hn}from"path";import{fileURLToPath as Un}from"url";function Wn(e){return Array.isArray?Array.isArray(e):Qn(e)===`[object Array]`}function Gn(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function Kn(e){return e==null?``:Gn(e)}function z(e){return typeof e==`string`}function qn(e){return typeof e==`number`}function Jn(e){return e===!0||e===!1||Xn(e)&&Qn(e)==`[object Boolean]`}function Yn(e){return typeof e==`object`}function Xn(e){return Yn(e)&&e!==null}function B(e){return e!=null}function Zn(e){return!e.trim().length}function Qn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function $n(e){let t=null,n=null,r=null,i=1,a=null;if(z(e)||Wn(e))r=e,t=er(e),n=tr(e);else{if(!Lr.call(e,`name`))throw Error(Pr(`name`));let o=e.name;if(r=o,Lr.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(Fr(tr(o)));t=er(o),n=tr(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function er(e){return Wn(e)?e:e.split(`.`)}function tr(e){return Wn(e)?e.join(`.`):e}function nr(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(B(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!B(s))return;if(a===t.length-1&&(z(s)||qn(s)||Jn(s)||typeof s==`bigint`))n.push(o===void 0?Kn(s):{v:Kn(s),i:o});else if(Wn(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}};return i(e,z(t)?t.split(`.`):t,0),r?n:n[0]}function rr(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=1,a=!1;for(let e=0;e<t.length;e++)t.charCodeAt(e)===32?a||(i++,a=!0):a=!1;if(n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}function ir(e,t,{getFn:n=V.getFn,fieldNormWeight:r=V.fieldNormWeight}={}){let i=new Ur({getFn:n,fieldNormWeight:r});return i.setKeys(e.map($n)),i.setSources(t),i.create(),i}function ar(e,{getFn:t=V.getFn,fieldNormWeight:n=V.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new Ur({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function or(e=[],t=V.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function sr(e,t,n,{location:r=V.location,distance:i=V.distance,threshold:a=V.threshold,findAllMatches:o=V.findAllMatches,minMatchCharLength:s=V.minMatchCharLength,includeMatches:c=V.includeMatches,ignoreLocation:l=V.ignoreLocation}={}){if(t.length>32)throw Error(Nr(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=or(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function cr(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function lr(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}function ur(e){return e.startsWith(`inverse`)}function dr(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function fr(e,t){let n=e.match(t);return n?n[1]:null}function pr(e,t={}){return e.replace(/\\\|/g,Zr).split(Qr).map(e=>{let n=dr(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<Xr;){let e=Yr[o],n=fr(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<Xr;){let e=Yr[o],n=fr(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}function mr(...e){ei.push(...e)}function hr(e,t){for(let n=0,r=ei.length;n<r;n+=1){let r=ei[n];if(r.condition(e,t))return new r(e,t)}return new qr(e,t)}function gr(e,t,{auto:n=!0}={}){let r=e=>{if(z(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=hr(e,t)),r}let i=Object.keys(e),a=ii(e);if(!a&&i.length>1&&!ri(e))return r(oi(e));if(ai(e)){let r=a?e[ni.PATH]:i[0],o=a?e[ni.PATTERN]:e[r];if(!z(o))throw Error(Mr(r));let s={keyId:tr(r),pattern:o};return n&&(s.searcher=hr(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];Wn(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return ri(e)||(e=oi(e)),r(e)}function _r(e,{ignoreFieldNorm:t=V.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function vr(e,{ignoreFieldNorm:t=V.ignoreFieldNorm}){e.forEach(e=>{e.score=_r(e.matches,{ignoreFieldNorm:t})})}function yr(e){let t=[];return e.matches.forEach(e=>{if(!B(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function br(e,t,{includeMatches:n=V.includeMatches,includeScore:r=V.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=yr(e)),r&&(a.score=e.score),a})}function xr(e){li.has(e)||(li.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Sr(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||xr(e),t=>t.match(e)||[]):e=>e.match(ci)||[]}function Cr({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=Sr(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=Kr(n)),r(n)}}}function wr(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function Tr(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){wr(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n)if(Array.isArray(n))for(let t of n)wr(e,t.v,i,r);else wr(e,n.v,i,r)}}function Er(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)Tr(r,i,t,n);return r}function Dr(e,t,n,r){Tr(e,t,n,r)}function Or(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function kr(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Or(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr,Rr,zr,Br,Vr,Hr,V,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr,Qr,$r,ei,ti,ni,ri,ii,ai,oi,si,ci,li,ui,di,fi,pi=t((()=>{Ar=`Incorrect 'index' type`,jr=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,Mr=e=>`Invalid value for key ${e}`,Nr=e=>`Pattern length exceeds max of ${e}.`,Pr=e=>`Missing ${e} property in key`,Fr=e=>`Property 'weight' in key '${e}' must be a positive integer`,Ir=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,Lr=Object.prototype.hasOwnProperty,Rr=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=$n(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}},zr={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},Br={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},Vr={location:0,threshold:.6,distance:100},Hr={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:nr,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},V=Object.freeze({...Br,...zr,...Vr,...Hr}),Ur=class{constructor({getFn:e=V.getFn,fieldNormWeight:t=V.fieldNormWeight}={}){this.norm=rr(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(z(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(jr);if(z(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(jr);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!B(e)||Zn(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(B(i)){if(Wn(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(B(n)){if(z(n)){if(!Zn(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(B(n.v)){let t=z(n.v)?n.v:Kn(n.v);if(!Zn(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(z(i)&&!Zn(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}},Wr={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},Gr=RegExp(`[`+Object.keys(Wr).join(``)+`]`,`g`),Kr=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(Gr,e=>Wr[e]):e=>e,qr=class{constructor(e,{location:t=V.location,threshold:n=V.threshold,distance:r=V.distance,includeMatches:i=V.includeMatches,findAllMatches:a=V.findAllMatches,minMatchCharLength:o=V.minMatchCharLength,isCaseSensitive:s=V.isCaseSensitive,ignoreDiacritics:c=V.ignoreDiacritics,ignoreLocation:l=V.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?Kr(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:cr(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?Kr(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=sr(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=lr(u)),p}},Jr=new Set([`fuzzy`,`include`]),Yr=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new qr(e,{location:t.location??V.location,threshold:t.threshold??V.threshold,distance:t.distance??V.distance,includeMatches:t.includeMatches??V.includeMatches,findAllMatches:t.findAllMatches??V.findAllMatches,minMatchCharLength:t.minMatchCharLength??V.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??V.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??V.ignoreDiacritics,ignoreLocation:t.ignoreLocation??V.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],Xr=Yr.length,Zr=`\0`,Qr=`|`,$r=class{constructor(e,{isCaseSensitive:t=V.isCaseSensitive,ignoreDiacritics:n=V.ignoreDiacritics,includeMatches:r=V.includeMatches,minMatchCharLength:i=V.minMatchCharLength,ignoreLocation:a=V.ignoreLocation,findAllMatches:o=V.findAllMatches,location:s=V.location,threshold:c=V.threshold,distance:l=V.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?Kr(e):e,this.pattern=e,this.query=pr(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?Kr(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,ur(r.type)&&(c=!0),n&&(Jr.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=lr(o)),e}}return{isMatch:!1,score:1}}},ei=[],ti={AND:`$and`,OR:`$or`},ni={PATH:`$path`,PATTERN:`$val`},ri=e=>!!(e[ti.AND]||e[ti.OR]),ii=e=>!!e[ni.PATH],ai=e=>!Wn(e)&&Yn(e)&&!ri(e),oi=e=>({[ti.AND]:Object.keys(e).map(t=>({[t]:e[t]}))}),si=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(t[e].score<=t[n].score)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&t[i].score>t[r].score&&(r=i),a<n&&t[a].score>t[r].score&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}},ci=/[\p{L}\p{M}\p{N}_]+/gu,li=new WeakSet,ui=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=Cr({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new qr(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=lr(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}},di=class{constructor(e,t,n){this.options={...V,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new Rr(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=hr(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof Ur))throw Error(Ar);if(this._myIndex=t||ir(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=Cr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Er(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!B(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=Cr({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Dr(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&kr(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(jr);this._invertedIndex&&kr(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(z(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return qn(n)&&n>-1&&(e=e.slice(0,n)),e}let c=qn(n)&&n>0&&z(e),l;if(c){let t=new si(n);z(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),l=t.extractSorted(o)}else l=z(e)?z(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),vr(l,{ignoreFieldNorm:s}),a&&l.sort(o),qn(n)&&n>-1&&(l=l.slice(0,n));return br(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!B(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=_r(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=gr(e,this.options),n=(e,t,r)=>{if(!(`children`in e)){let{keyId:n,searcher:i}=e,a;return n===null?(a=[],this._myIndex.keys.forEach((e,n)=>{a.push(...this._findMatches({key:e,value:t[n],searcher:i}))})):a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i}),a&&a.length?[{idx:r,item:t,matches:a}]:[]}let{children:i,operator:a}=e,o=[];for(let e=0,s=i.length;e<s;e+=1){let s=i[e],c=n(s,t,r);if(c.length)o.push(...c);else if(a===ti.AND)return[]}return o},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:e,i:r})=>{if(B(e)){let o=n(t,e,r);o.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),a.push(i.get(r))),o.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{keys:a,records:o}=this._myIndex,s=t?null:[];return o.forEach(({$:e,i:o})=>{if(!B(e))return;let c=[],l=!1,u=!1;if(a.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:o,item:e,matches:c};t?(r.score=_r(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!B(t))return[];let r=[];if(Wn(t))t.forEach(({v:t,i,n:a})=>{if(!B(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}},di.version=`7.4.2`,di.createIndex=ir,di.parseIndex=ar,di.config=V,di.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(Ir);return hr(e,{...V,...n}).searchIn(t)},di.parseQuery=gr,mr($r),mr(ui),di.use=function(...e){e.forEach(e=>mr(e))},fi=di}));function mi(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var hi=t((()=>{}));function gi(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`)||et(t.text,`status`)!==`completed`?!1:et(t.text,`summary`)?.startsWith(`Background command `)??!1}function _i(e,t){if(!Ve()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(gi(t)){let i=0;for(;r<e.length&&gi(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${Ct}><${wt}>completed</${wt}><${Tt}>${i} background commands completed</${Tt}></${Ct}>`}]}})}else n.push(t),r++}return n}var vi=t((()=>{Et(),ie(),Me(),it()}));function yi(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function bi(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(yi(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!yi(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 xi=t((()=>{}));function Si(e){let t=Ti.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),Ti.set(e,t)),t}function Ci(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 wi(e,t,n=!1){if(n)return{messages:e};let r=Si(t),i=new Map;for(let t of e){let e=Ci(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=Ci(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=Ci(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 Ti,Ei=t((()=>{Ti=new WeakMap}));function Di(e){let t=Ni.get(e);if(t!==void 0)return t;let n=Oi(e).toLowerCase();return Ni.set(e,n),n}function Oi(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Mi.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Mi.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(Ai(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`?[ki(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(ji,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function ki(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 Ai(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 ji,Mi,Ni,Pi=t((()=>{it(),ji=`</system-reminder>`,Mi=new Set([Pe,Ye]),Ni=new WeakMap}));function Fi({pose:e=`default`}={}){if(mt.terminal===`Apple_Terminal`)return(0,H.jsx)(Ii,{pose:e});let t=Li[e];return(0,H.jsxs)(l,{flexDirection:`column`,children:[(0,H.jsxs)(d,{children:[(0,H.jsx)(d,{color:`clawd_body`,children:t.r1L}),(0,H.jsx)(d,{color:`clawd_body`,backgroundColor:`clawd_background`,children:t.r1E}),(0,H.jsx)(d,{color:`clawd_body`,children:t.r1R})]}),(0,H.jsxs)(d,{children:[(0,H.jsx)(d,{color:`clawd_body`,children:t.r2L}),(0,H.jsx)(d,{color:`clawd_body`,backgroundColor:`clawd_background`,children:`█████`}),(0,H.jsx)(d,{color:`clawd_body`,children:t.r2R})]}),(0,H.jsxs)(d,{color:`clawd_body`,children:[` `,`▘▘ ▝▝`,` `]})]})}function Ii({pose:e}){return(0,H.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,H.jsxs)(d,{children:[(0,H.jsx)(d,{color:`clawd_body`,children:`▗`}),(0,H.jsx)(d,{color:`clawd_background`,backgroundColor:`clawd_body`,children:Ri[e]}),(0,H.jsx)(d,{color:`clawd_body`,children:`▖`})]}),(0,H.jsx)(d,{backgroundColor:`clawd_body`,children:` `.repeat(7)}),(0,H.jsx)(d,{color:`clawd_body`,children:`▘▘ ▝▝`})]})}var H,Li,Ri,zi=t((()=>{h(),y(),vt(),H=S(),Li={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:`▛ `}},Ri={default:` ▗ ▖ `,"look-left":` ▘ ▘ `,"look-right":` ▝ ▝ `,"arms-up":` ▗ ▖ `}}));function Bi(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=c(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,c(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?c(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=c(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,c(r))),o}function Vi({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?c(e.timestamp):0));return(0,U.jsxs)(l,{flexDirection:`column`,width:t,children:[(0,U.jsx)(d,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:jt(i,t)})]}):r.length===0&&a?(0,U.jsx)(d,{dimColor:!0,children:jt(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)(d,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(d,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(d,{children:jt(e.text,r)})]},n)}),i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:jt(i,t)})]})]})}var U,Hi=t((()=>{h(),y(),Mt(),U=S()}));function Ui({feeds:e,maxWidth:t}){let n=e.map(e=>Bi(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Gi.jsx)(l,{flexDirection:`column`,children:e.map((t,n)=>(0,Gi.jsxs)(Wi.Fragment,{children:[(0,Gi.jsx)(Vi,{config:t,actualWidth:i}),n<e.length-1&&(0,Gi.jsx)(s,{color:`claude`,width:i})]},n))})}var Wi,Gi,Ki=t((()=>{Wi=n(h(),1),y(),Hi(),Gi=S()}));function qi(e){let t=e.map(e=>{let t=Nt(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 Ji(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 Yi(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=st()===Vn()?`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 Xi(){let e=en(),t=e?`Share Claude Code and earn ${nn(e)} of extra usage`:`Share Claude Code with friends`;return{title:`3 guest passes`,lines:[],customContent:{content:(0,Zi.jsxs)(Zi.Fragment,{children:[(0,Zi.jsx)(l,{marginY:1,children:(0,Zi.jsx)(d,{color:`claude`,children:`[✻] [✻] [✻]`})}),(0,Zi.jsx)(d,{dimColor:!0,children:t})]}),width:48},footer:`/passes`}}var Zi,Qi=t((()=>{a(),y(),rn(),ot(),Mt(),Zi=S()}));function $i(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function ea(){let{pose:e,bounceOffset:t,onClick:n}=ta();return(0,ra.jsx)(l,{height:la,flexDirection:`column`,onClick:n,children:(0,ra.jsx)(l,{marginTop:t,flexShrink:0,children:(0,ra.jsx)(Fi,{pose:e})})})}function ta(){let[e]=(0,na.useState)(()=>bt().prefersReducedMotion??!1),[t,n]=(0,na.useState)(-1),r=(0,na.useRef)(ia),i=()=>{e||t!==-1||(r.current=aa[Math.floor(Math.random()*aa.length)],n(0))};(0,na.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,sa,ca);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:oa;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var na,ra,ia,aa,oa,sa,ca,la,ua=t((()=>{h(),na=n(h(),1),y(),yt(),zi(),ra=S(),ia=[...$i(`default`,1,2),...$i(`arms-up`,0,3),...$i(`default`,0,1),...$i(`default`,1,2),...$i(`arms-up`,0,3),...$i(`default`,0,1)],aa=[ia,[...$i(`look-right`,0,5),...$i(`look-left`,0,5),...$i(`default`,0,1)]],oa={pose:`default`,offset:0},sa=60,ca=e=>e+1,la=3}));function da(){let e=tn();e==null||e<=0||e>(R().passesLastSeenRemaining??0)&&xt(t=>({...t,passesUpsellSeenCount:0,hasVisitedPasses:!1,passesLastSeenRemaining:e}))}function fa(){let{eligible:e,hasCache:t}=an();if(!e||!t)return!1;da();let n=R();return!((n.passesUpsellSeenCount??0)>=3||n.hasVisitedPasses)}function pa(){let[e]=(0,ga.useState)(()=>fa());return e}function ma(){let e=0;xt(t=>(e=(t.passesUpsellSeenCount??0)+1,{...t,passesUpsellSeenCount:e})),At(`tengu_guest_passes_upsell_shown`,{seen_count:e})}function ha(){let e=en();return(0,_a.jsxs)(d,{dimColor:!0,children:[(0,_a.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,_a.jsx)(d,{color:`claude`,children:`[✻]`}),` `,(0,_a.jsx)(d,{color:`claude`,children:`[✻]`}),` ·`,` `,e?`Share Claude Code and earn ${nn(e)} of extra usage · /passes`:`3 guest passes at /passes`]})}var ga,_a,va=t((()=>{h(),ga=n(h(),1),y(),kt(),rn(),St(),_a=S()}));function ya(){let{columns:e}=v(),t=Xe(e=>e.agent),n=Xe(e=>e.effortValue),r=kn(),i=Vt(r),{version:a,cwd:o,billingType:s,agentName:u}=xn(),f=t??u,p=pa(),m=In();(0,ba.useEffect)(()=>{p&&ma()},[p]),(0,ba.useEffect)(()=>{m&&!p&&Fn()},[m,p]);let h=Math.max(e-15,20),g=jt(a,Math.max(h-13,6)),{shouldSplit:_,truncatedModel:y,truncatedBilling:b}=Sn(i+j(r,n),s,h),x=f?h-1-c(f)-3:h,S=_n(o,Math.max(x,10));return(0,W.jsx)(F,{children:(0,W.jsxs)(l,{flexDirection:`row`,gap:2,alignItems:`center`,children:[Ve()?(0,W.jsx)(ea,{}):(0,W.jsx)(Fi,{}),(0,W.jsxs)(l,{flexDirection:`column`,children:[(0,W.jsxs)(d,{children:[(0,W.jsx)(d,{bold:!0,children:`Claude Code`}),` `,(0,W.jsxs)(d,{dimColor:!0,children:[`v`,g]})]}),_?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{dimColor:!0,children:y}),(0,W.jsx)(d,{dimColor:!0,children:b})]}):(0,W.jsxs)(d,{dimColor:!0,children:[y,` · `,b]}),(0,W.jsx)(d,{dimColor:!0,children:f?`@${f} · ${S}`:S}),p&&(0,W.jsx)(ha,{}),!p&&m&&(0,W.jsx)(Ln,{maxWidth:h,twoLine:!0})]})]})})}var ba,W,xa=t((()=>{ba=n(h(),1),An(),ye(),y(),Re(),we(),Mt(),Me(),wn(),Kt(),de(),ua(),zi(),va(),Nn(),W=S()}));function Sa(){let e=(0,wa.useMemo)(Ca,[]),t=(0,wa.useMemo)(()=>R().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,wa.useEffect)(()=>{n&&xt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Ta.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,Ta.jsx)(d,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Ca(){return Ea}var wa,Ta,Ea,Da=t((()=>{h(),wa=n(h(),1),y(),St(),Ta=S(),Ea={tip:``,color:`dim`}}));function Oa({char:e=`✻`}){let[t]=(0,ka.useState)(()=>bt().prefersReducedMotion??!1),[n,r]=(0,ka.useState)(t),i=(0,ka.useRef)(null),[a,o]=_(n?null:50);return(0,ka.useEffect)(()=>{if(n)return;let e=setTimeout(r,Ma,!0);return()=>clearTimeout(e)},[n]),n?(0,Aa.jsx)(l,{ref:a,children:(0,Aa.jsx)(d,{color:Na,children:e})}):(i.current===null&&(i.current=o),(0,Aa.jsx)(l,{ref:a,children:(0,Aa.jsx)(d,{color:Ze(Oe((o-i.current)/ja*360%360)),children:e})}))}var ka,Aa,ja,Ma,Na,Pa=t((()=>{h(),ka=n(h(),1),gt(),y(),yt(),ze(),Aa=S(),ja=1500,Ma=ja*2,Na=Ze({r:153,g:153,b:153})}));function Fa(){return qt()&&(R().opus1mMergeNoticeSeenCount??0)<za}function Ia(){let[e]=(0,La.useState)(Fa);return(0,La.useEffect)(()=>{if(!e)return;let t=(R().opus1mMergeNoticeSeenCount??0)+1;xt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Ra.jsxs)(l,{paddingLeft:2,children:[(0,Ra.jsx)(Oa,{char:`↑`}),(0,Ra.jsx)(d,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var La,Ra,za,Ba=t((()=>{h(),La=n(h(),1),gt(),y(),St(),Kt(),Pa(),Ra=S(),za=6}));function Va(){return null}var Ha=t((()=>{}));function Ua(){return null}var Wa=t((()=>{}));function Ga(){let e=gn(),t=R().oauthAccount?.displayName??``,{columns:n}=v(),i=cn(),a=I.isSandboxingEnabled(),o=pa(),s=In(),u=Xe(e=>e.agent),f=Xe(e=>e.effortValue),p=R(),m;try{m=yn(3)}catch{m=[]}let[h]=(0,Ka.useState)(()=>{let e=bt().companyAnnouncements;if(!(!e||e.length===0))return p.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]}),{hasReleaseNotes:_}=mn(p.lastReleaseNotesSeen);(0,Ka.useEffect)(()=>{R().lastReleaseNotesSeen!==`0.0.1`&&(xt(e=>e.lastReleaseNotesSeen===`0.0.1`?e:{...e,lastReleaseNotesSeen:`0.0.1`}),i&&sn())},[p,i]);let y=!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);(0,Ka.useEffect)(()=>{o&&!i&&!y&&ma()},[o,i,y]),(0,Ka.useEffect)(()=>{s&&!i&&!o&&!y&&Fn()},[s,i,o,y]);let b=kn(),x=Vt(b),{version:S,cwd:C,billingType:w,agentName:T}=xn(),E=u??T,D=jt(x+j(b,f),qa-20);if(!_&&!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(ya,{}),(0,G.jsx)(Ia,{}),ft()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,ct()?`stderr`:ut()]})]}),(0,G.jsx)(Sa,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{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`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Ot(Ke())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Ot(ut())]}),It()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Ot(Lt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Va,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ua,{})]});let O=hn(n),ee=Tn(R().theme),k=` ${g(`claude`,ee)(`Claude Code`)} ${g(`inactive`,ee)(`v${S}`)} `,te=g(`claude`,ee)(` Claude Code `);if(O===`compact`){let e=vn(t);c(e)>n-4&&(e=vn(null));let r=E?n-4-1-c(E)-3:n-4,i=_n(C,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F,{children:(0,G.jsxs)(l,{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)(d,{bold:!0,children:e}),(0,G.jsx)(l,{marginY:1,children:(0,G.jsx)(Fi,{})}),(0,G.jsx)(d,{dimColor:!0,children:D}),(0,G.jsx)(d,{dimColor:!0,children:w}),(0,G.jsx)(d,{dimColor:!0,children:E?`@${E} · ${i}`:i})]})}),(0,G.jsx)(Ia,{}),a&&(0,G.jsx)(l,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Va,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ua,{})]})}let ne=vn(t),re=!process.env.IS_DEMO&&p.oauthAccount?.organizationName?`${D} · ${w} · ${p.oauthAccount.organizationName}`:`${D} · ${w}`,ie=E?qa-1-c(E)-3:qa,A=_n(C,Math.max(ie,10)),M=E?`@${E} · ${A}`:A,{leftWidth:N,rightWidth:ae}=Cn(n,O,bn(ne,M,re));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F,{children:(0,G.jsx)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:k,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(l,{flexDirection:O===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(l,{flexDirection:`column`,width:N,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(l,{marginTop:1,children:(0,G.jsx)(d,{bold:!0,children:ne})}),(0,G.jsx)(Fi,{}),(0,G.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(d,{dimColor:!0,children:re}),(0,G.jsx)(d,{dimColor:!0,children:M})]})]}),O===`horizontal`&&(0,G.jsx)(l,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),O===`horizontal`&&(0,G.jsx)(Ui,{feeds:i?[Yi(on()),qi(e)]:o?[qi(e),Xi()]:s?[qi(e),Pn()]:[qi(e),Ji(m)],maxWidth:ae})]})})}),(0,G.jsx)(Ia,{}),ft()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,ct()?`stderr`:ut()]})]}),(0,G.jsx)(Sa,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{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`})]}),h&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&p.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,p.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:h})]}),a&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,Ot(Ke())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,Ot(ut())]}),It()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,Ot(Lt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Va,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Ua,{})]})}var Ka,G,qa,Ja=t((()=>{h(),y(),ye(),wn(),Mt(),Dt(),zi(),Ki(),Qi(),St(),En(),yt(),lt(),Ka=n(h(),1),ln(),xa(),de(),pn(),je(),i(),Pt(),Da(),Ba(),Ha(),Wa(),ae(),va(),Nn(),Re(),we(),An(),Kt(),G=S(),qa=50}));function Ya({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,Xa.jsx)(l,{minWidth:c(i)+8,children:(0,Xa.jsx)(d,{dimColor:!0,children:i})})}var Xa,Za=t((()=>{h(),y(),Xa=S()}));function Qa({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,$a.jsx)(l,{minWidth:c(n),children:(0,$a.jsx)(d,{dimColor:!0,children:n})})}var $a,eo=t((()=>{h(),y(),$a=S()}));function to(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=co(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(le(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&co(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=co(t.messages[0]?.message.content)?.input;if(le(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function no({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:u,onOpenRateLimitOptions:d,lastThinkingBlockId:f,latestBashOutputUUID:p,columns:m,isLoading:h,lookups:g,shouldCollapseDiffs:_}){let v=c===`transcript`,y=e.type===`grouped_tool_use`,b=e.type===`collapsed_read_search`,x=b&&(at(e,o)||h&&!n),S=y?e.displayMessage:b?oe(e):e,C=y||b?[]:Ie(e,g),w=Es(e,s,o,y||b?E:ue(e,g),c,g),T=!1;if(u)if(y)T=e.messages.some(e=>{let t=co(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(b)T=at(e,o);else{let t=fe(e);T=!t||o.has(t)}let D=v&&S.type===`assistant`&&Array.isArray(S.message.content)&&S.message.content.some(e=>e.type===`text`)&&(S.timestamp||S.message.model),O=(0,so.jsx)(Le,{message:e,lookups:g,addMargin:!D,containerWidth:D?void 0:m,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:C,shouldAnimate:T,shouldShowDot:!0,isTranscriptMode:v,isStatic:w,onOpenRateLimitOptions:d,isActiveCollapsedGroup:x,isUserContinuation:t,lastThinkingBlockId:f,latestBashOutputUUID:p,shouldCollapseDiffs:_});return D?(0,so.jsx)(F,{children:(0,so.jsxs)(l,{width:m,flexDirection:`column`,children:[(0,so.jsxs)(l,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,so.jsx)(Qa,{message:S,isTranscriptMode:v}),(0,so.jsx)(Ya,{message:S,isTranscriptMode:v})]}),O]})}):(0,so.jsx)(F,{children:O})}function ro(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=co(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return _e(e).some(e=>t.has(e));let n=fe(e);return!!n&&t.has(n)}function io(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=co(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return _e(e).every(e=>t.has(e));if(e.type===`assistant`){let n=co(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=fe(e);return!n||t.has(n)}function ao(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&&O(t.message))return!1;let n=ro(e.message,e.streamingToolUseIDs),r=io(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var oo,so,co,lo,uo=t((()=>{oo=n(h(),1),y(),k(),it(),Fe(),so=S(),Za(),Ls(),eo(),de(),co=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},lo=oo.memo(no,ao)}));function fo(e){return e.type===`attachment`&&po.has(e.attachment.type)}var po,mo=t((()=>{po=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.todo_reminder.context_efficiency.deferred_tools_delta.mcp_instructions_delta.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 ho(e){return So.filter(t=>t.isActive(e))}var K,go,_o,vo,yo,bo,xo,So,Co=t((()=>{y(),h(),qe(),a(),ot(),Mt(),Gt(),zn(),pe(),M(),K=S(),go={id:`large-memory-files`,type:`warning`,isActive:e=>he(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:he(e.memoryFiles).map(e=>{let t=e.path.startsWith(st())?Hn(st(),e.path):e.path;return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large `,(0,K.jsx)(d,{bold:!0,children:t}),` will impact performance (`,Ft(e.content.length),` chars > `,Ft(L),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},_o={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=Wt();return Ut()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=Wt();return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},vo={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=Bt({skipRetrievingKeyFromApiKeyHelper:!0});return!!Ht()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=Bt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Anthropic Console key. Either unset `,e,", or run `claude /logout`."]})]})}},yo={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=Bt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Wt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=Bt({skipRetrievingKeyFromApiKeyHelper:!0}),t=Wt();return(0,K.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{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)(l,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(d,{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)(d,{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.`]})]})]})}},bo={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Rn(e.agentDefinitions)>Bn,render:e=>{let t=Rn(e.agentDefinitions);return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,Ft(t),` tokens > `,Ft(Bn),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /agents to manage`})]})]})}},xo={id:`jetbrains-plugin-install`,type:`info`,isActive:e=>{if(!P()||!(e.config.autoInstallIdeExtension??!0))return!1;let t=re();return t!==null&&!xe(t)},render:()=>{let e=se(re());return(0,K.jsxs)(l,{flexDirection:`row`,gap:1,marginLeft:1,children:[(0,K.jsx)(d,{color:`ide`,children:o.arrowUp}),(0,K.jsxs)(d,{children:[`Install the `,(0,K.jsx)(d,{color:`ide`,children:e}),` plugin from the JetBrains Marketplace:`,` `,(0,K.jsx)(d,{bold:!0,children:`https://docs.claude.com/s/claude-code-jetbrains`})]})]})}},So=[go,bo,_o,vo,yo,xo]}));function wo({agentDefinitions:e}={}){let t={config:R(),agentDefinitions:e,memoryFiles:(0,Eo.use)(T())},n=ho(t);return n.length===0?null:(0,Do.jsx)(l,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Do.jsx)(To.Fragment,{children:e.render(t)},e.id))})}var To,Eo,Do,Oo=t((()=>{To=n(h(),1),Eo=n(h(),1),y(),qe(),St(),Co(),Do=S()}));function ko(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)??Lo,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/No);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])??Ao);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-Mo),w=b;else{if(y){let e=v+jo;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-jo;{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*jo,y=Math.min(b,C+Fo),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+jo);)S+=r.current.get(t[w])??Po,w++}let e=v+2*jo,n=Math.max(0,w-Fo),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??Po;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??Po;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Io&&(C=e-Io),w>t+Io&&(w=t+Io),C>w&&(w=Math.min(C+Io,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>Fo){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Fo:D=O-Fo}let ee=m.current,k=x[D],te=D===0?0:k+ee,ne=O===b?1/0:Math.max(k,x[O]-v)+ee;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(te,ne)}),(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 re=(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},[]),ie=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),A=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),j=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),N=S-x[O];return{range:[D,O],topSpacer:k,bottomSpacer:N,measureRef:re,spacerRef:h,offsets:x,getItemTop:ie,getItemElement:A,getItemHeight:j,scrollToIndex:M}}var q,Ao,jo,Mo,No,Po,Fo,Io,Lo,Ro=t((()=>{q=n(h(),1),Ao=3,jo=40,Mo=30,No=20,Po=1,Fo=200,Io=25,Lo=()=>{}}));function zo({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,Wo.jsx)(Ko.Provider,{value:n,children:(0,Wo.jsx)(Jo.Provider,{value:i,children:(0,Wo.jsx)(Go.Provider,{value:t,children:(0,Wo.jsx)(qo.Provider,{value:r,children:e})})})})}function Bo(){return(0,J.useContext)(Go)}function Vo(){return(0,J.useContext)(qo)}function Ho(e){let t=(0,J.useContext)(Ko);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Uo(e){let t=(0,J.useContext)(Jo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,Wo,Go,Ko,qo,Jo,Yo=t((()=>{J=n(h(),1),Wo=S(),Go=(0,J.createContext)(null),Ko=(0,J.createContext)(null),qo=(0,J.createContext)(null),Jo=(0,J.createContext)(null)}));function Xo(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 Zo(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`&&!Qo(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function Qo(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 $o(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||fo(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=Zo(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function es({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:u=!1,newMessageCount:f=0,onPillClick:m}){let{rows:h,columns:g}=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(!Ve())return;let e=p.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{dn(Un(e))}catch{}else un(e)},()=>{e.onHyperlinkClick=void 0}},[]),Ve()){let s=u?null:_,p=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(zo,{children:[(0,X.jsx)(l,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(l,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(l,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[p&&(0,X.jsx)(ns,{text:p.text,onClick:p.scrollTo}),(0,X.jsxs)(x,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(os,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(ts,{count:f,onClick:m}),r!=null&&(0,X.jsx)(l,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(l,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(rs,{}),(0,X.jsx)(is,{}),(0,X.jsx)(l,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Mn,{value:{rows:h-as-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(l,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-as,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(l,{flexShrink:0,children:(0,X.jsx)(d,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(l,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function ts({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(l,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${Rt(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function ns({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function rs(){let e=Bo();return!e||e.suggestions.length===0?null:(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(Dn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function is(){let e=Vo();return e?(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,as,os,ss=t((()=>{a(),Y=n(h(),1),jn(),Yo(),ye(),y(),fn(),Me(),zt(),mo(),On(),X=S(),as=2,os=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function cs(e){let t=gs.get(e);if(t!==void 0)return t;let n=Di(e);return gs.set(e,n),n}function ls(e){let t=vs.get(e);if(t!==void 0)return t;let n=us(e);return vs.set(e,n),n}function us(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=ne(t);return n.startsWith(`<`)||n===``?null:n}function ds({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:d,renderItem:f}){return(0,ms.jsx)(l,{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?()=>d(e):void 0,children:(0,ms.jsx)(u.Provider,{value:a&&!i?`text`:void 0,children:f(t,n)})})}function fs({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=cs,trackStickyPrompt:u,selectedIndex:d,cursorNavRef:f,setCursor:p,jumpRef:m,onSearchMatchesChange:h,scanElement:g,setPositions:_}){let v=(0,Z.useRef)([]),y=(0,Z.useRef)(e),b=(0,Z.useRef)(r);if(b.current!==r||e.length<v.current.length||e[0]!==y.current[0])v.current=e.map(e=>r(e));else for(let t=v.current.length;t<e.length;t++)v.current.push(r(e[t]));y.current=e,b.current=r;let x=v.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:T,spacerRef:E,offsets:D,getItemTop:O,getItemElement:ee,getItemHeight:k,scrollToIndex:te}=ko(t,x,n),[ne,re]=S,ie=(0,Z.useCallback)(t=>k(t)!==0&&ve(e[t]),[k,e]);(0,Z.useImperativeHandle)(f,()=>{let n=e=>p?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:tt(e)?.name}),r=d??-1,i=(t,r,i=ie)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ie(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),p?.(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,d,p,ie]);let A=(0,Z.useRef)({offsets:D,start:ne,getItemElement:ee,getItemTop:O,messages:e,scrollToIndex:te});A.current={offsets:D,start:ne,getItemElement:ee,getItemTop:O,messages:e,scrollToIndex:te},(0,Z.useEffect)(()=>{if(d===void 0)return;let e=A.current,n=e.getItemElement(d);n?t.current?.scrollToElement(n,1):e.scrollToIndex(d)},[d,t]);let j=(0,Z.useRef)(null),M=(0,Z.useRef)({msgIdx:-1,positions:[]}),N=(0,Z.useRef)(-1),ae=(0,Z.useRef)(0),oe=(0,Z.useRef)(0),se=(0,Z.useRef)(()=>{}),ce=(0,Z.useRef)(()=>{}),le=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),P=(0,Z.useRef)(-1),F=(0,Z.useRef)(!1);function ue(e){let t=A.current.getItemTop(e);return Math.max(0,t-hs)}function I(e){let n=t.current,{msgIdx:r,positions:i}=M.current;if(!n||i.length===0||r<0){_?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=A.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-hs)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=le.current,p=f.prefixSum.at(-1)??0,m=(f.prefixSum[f.ptr]??0)+a+1;h?.(p,m),dt(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${m}/${p}`)}ce.current=I;let[de,fe]=(0,Z.useState)(0),pe=(0,Z.useCallback)(()=>fe(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=j.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=A.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){j.current=null,dt(`seek(i=${n}): no mount after scrollToIndex, skip`),se.current(r?-1:1);return}j.current={idx:n,wantLast:r,tries:i+1},c(n),pe();return}j.current=null,a.scrollTo(Math.max(0,s(n)-hs));let d=g?.(l)??[];if(M.current={msgIdx:n,positions:d},dt(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ae.current>20){ae.current=0;return}se.current(r?-1:1);return}ae.current=0;let f=r?d.length-1:0;le.current.screenOrd=f,N.current=-1,ce.current(f);let p=oe.current;p&&(oe.current=0,se.current(p))},[de]);function me(e,n){let r=t.current;if(!r)return;let i=A.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;_?.(null),M.current={msgIdx:-1,positions:[]},j.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(ue(e)):o(e),pe()}function he(e){let t=le.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(j.current){oe.current=e;return}N.current<0&&(N.current=t.ptr);let{positions:a}=M.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,I(o),N.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===N.current){_?.(null),N.current=-1,dt(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,me(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;h?.(i,c)}se.current=he,(0,Z.useImperativeHandle)(m,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(ue(e))},setSearchQuery:e=>{j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=A.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=A.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=P.current>=0?P.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)}dt(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}le.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?me(r[o],!0):P.current>=0&&s&&s.scrollTo(P.current),h?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>he(1),prevMatch:()=>he(-1),setAnchor:()=>{let e=t.current;e&&(P.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1},warmSearchIndex:async()=>{if(F.current)return 0;let e=A.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Yt(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 dt(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),F.current=!0,Math.round(t)}}),[t]);let[ge,_e]=(0,Z.useState)(null),ye=(0,Z.useRef)({onItemClick:a,setHoveredKey:_e});ye.current={onItemClick:a,setHoveredKey:_e};let be=(0,Z.useCallback)((e,t)=>{let n=ye.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),xe=(0,Z.useCallback)(e=>{ye.current.setHoveredKey(e)},[]),Se=(0,Z.useCallback)(e=>{ye.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,ms.jsxs)(ms.Fragment,{children:[(0,ms.jsx)(l,{ref:E,height:C,flexShrink:0}),e.slice(ne,re).map((e,t)=>{let n=ne+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&ge===r,u=s?.(e);return(0,ms.jsx)(ds,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:be,onEnterK:xe,onLeaveK:Se,renderItem:i},r)}),w>0&&(0,ms.jsx)(l,{height:w,flexShrink:0}),u&&(0,ms.jsx)(ps,{messages:e,start:ne,end:re,offsets:D,getItemTop:O,getItemElement:ee,scrollRef:t})]})}function ps({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(os);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??ys,[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=ls(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,_s).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,ms,hs,gs,_s,vs,ys,bs=t((()=>{h(),Z=n(h(),1),Ro(),y(),ce(),ss(),ms=S(),lt(),Jt(),Pi(),nt(),hs=3,gs=new WeakMap,_s=500,vs=new WeakMap,ys=()=>{}}));function xs(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 Ss(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 Cs(e,t,n=Ns,r=Ps){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 ws(e){return(e.type===`assistant`||e.type===`user`?fe(e):null)??e.uuid}function Ts(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Es(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=fe(e);return i?t.has(i)||n.has(i)||ge(i,`PostToolUse`,a)?!1:mi(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 Ds,Q,$,Os,ks,As,js,Ms,Ns,Ps,Fs,Is,Ls=t((()=>{m(),Ds=n(h(),1),Q=n(h(),1),hi(),w(),gt(),ye(),y(),be(),Xt(),rt(),vi(),xi(),k(),St(),i(),Me(),Ei(),it(),zt(),Pi(),Ja(),Be(),uo(),nt(),He(),mo(),de(),Oo(),$=S(),bs(),Os=Ds.memo(function({agentDefinitions:e}){return(0,$.jsx)(F,{children:(0,$.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(Ga,{}),(0,$.jsx)(Ds.Suspense,{fallback:null,children:(0,$.jsx)(wo,{agentDefinitions:e})})]})})}),ks=($t(),e(Qt)),As=(pt(),e(ht)).BRIEF_TOOL_NAME,js=(Qe(),e(Ne)).SEND_USER_FILE_TOOL_NAME,Ms=30,Ns=200,Ps=50,Fs=({messages:e,tools:t,commands:n,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:c,isMessageSelectorVisible:u,conversationId:p,screen:m,streamingToolUses:h,showAllInTranscript:g=!1,agentDefinitions:_,onOpenRateLimitOptions:y,hideLogo:x=!1,isLoading:S,hidePastThinking:w=!1,streamingThinking:T,streamingText:E,isBriefOnly:O=!1,unseenDivider:k,scrollRef:ne,trackStickyPrompt:re,jumpRef:ie,onSearchMatchesChange:j,scanElement:M,setPositions:ae,disableRenderCap:oe=!1,cursor:se=null,setCursor:ce,cursorNavRef:le,renderRange:P})=>{let{columns:F}=v(),ue=Se(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),I=(0,Q.useMemo)(()=>We(e).filter(N),[e]),de=(0,Q.useMemo)(()=>T?T.isStreaming?!0:T.streamingEndedAt?Date.now()-T.streamingEndedAt<3e4:!1:!1,[T]),{lastThinkingBlockId:fe,latestBashOutputUUID:pe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=w&&!de;w&&de&&(e=`streaming`);for(let r=I.length-1;r>=0;r--){let i=I[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 w||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[I,w,de]),he=(0,Q.useMemo)(()=>me(I),[I]),ge=(0,Q.useMemo)(()=>h.filter(e=>!c.has(e.contentBlock.id)&&!he.has(e.contentBlock.id)),[h,c,he]),_e=(0,Q.useMemo)(()=>ge.flatMap(e=>{let t=Ue({content:[e.contentBlock]});return t.uuid=te(e.contentBlock.id,0),We([t])}),[ge]),ve=m===`transcript`,ye=(0,Q.useMemo)(()=>r(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),be=ne!=null&&!ye,xe=ve&&!g&&!be,we=(0,Q.useRef)(null),L=(0,Q.useRef)(null),{collapsed:Oe,lookups:je,hasTruncatedMessages:Me,hiddenMessageCount:Ne}=(0,Q.useMemo)(()=>{let e=Ce((i||Ve()?I:ee(I,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!fo(e)&&Te(e,ve)),_e),n=[As,js].filter(e=>e!==null),r=[As].filter(e=>e!==null),a=n.length>0&&!ve?O?xs(e,n):r.length>0?Ss(e,r):e:e,o=xe?a.slice(-30):a,s=xe&&a.length>Ms,{messages:c}=wi(o,t,i),l=_i(bi(A(c,t)),i),u=Ae(I,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(L.current&&L.current.key===u)f=L.current.lookups;else if(L.current&&I.length>=L.current.normalizedCount&&o.length>=L.current.messageCount&&L.current.lastAssistantMsgId===d){let e=D(L.current.lookups,L.current.normalizedCount,L.current.messageCount,I,o);e?(f=e,L.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d}):(f=Ge(I,o),L.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d})}else f=Ge(I,o),L.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Ms;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[i,I,ve,_e,xe,t,O]),Pe=(0,Q.useMemo)(()=>{let e=!be&&!oe?Cs(Oe,we):0;return P?Oe.slice(P[0],P[1]):e>0?Oe.slice(e):Oe},[Oe,P,be,oe]),Fe=(0,Q.useMemo)(()=>new Set(h.map(e=>e.contentBlock.id)),[h]),{dividerBeforeIndex:Ie,selectedIdx:Le}=(0,Q.useMemo)(()=>{if(!k&&!se)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=k?.firstUnseenUuid.slice(0,24);for(let r=0;r<Pe.length;r++){let i=Pe[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&se&&i.uuid===se.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[k,se,Pe]),[Re,ze]=(0,Q.useState)(()=>new Set),Be=(0,Q.useCallback)(e=>{let t=ws(e);ze(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),He=(0,Q.useCallback)(e=>Re.size>0&&Re.has(ws(e)),[Re]),Ke=(0,Q.useRef)(je);Ke.current=je;let qe=(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&&Ee(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=Ke.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Zt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ye=(!a||!!a.shouldContinueAnimation)&&!o.length&&!u,Xe=c.size>0,{progress:Ze}=f(),Qe=(0,Q.useRef)(null),et=R().terminalProgressBarEnabled&&!C()&&!(ks?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=et?Xe?`indeterminate`:`completed`:null;Qe.current!==e&&(Qe.current=e,Ze(e))},[Ze,et,Xe]),(0,Q.useEffect)(()=>()=>Ze(null),[Ze]);let tt=(0,Q.useCallback)(e=>`${e.uuid}-${p}`,[p]),nt=(e,r)=>{let a=r>0?Pe[r-1]?.type:void 0,o=e.type===`user`&&a===`user`,u=e.type===`collapsed_read_search`&&(!!E||to(Pe,r,t,Fe)),d=Pe.length-1-r>0,f=tt(e),p=(0,$.jsx)(lo,{message:e,isUserContinuation:o,hasContentAfter:u,tools:t,commands:n,verbose:i||He(e)||se?.expanded===!0&&r===Le,inProgressToolUseIDs:c,streamingToolUseIDs:Fe,screen:m,canAnimate:Ye,onOpenRateLimitOptions:y,lastThinkingBlockId:fe,latestBashOutputUUID:pe,columns:F,isLoading:S,lookups:je,shouldCollapseDiffs:d},f),h=(0,$.jsx)(De.Provider,{value:r===Le,children:p},f);return k&&r===Ie?[(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(s,{title:`${k.count} new ${Rt(k.count,`message`)}`,width:F,color:`inactive`})},`unseen-divider`),h]:h},rt=(0,Q.useRef)(new WeakMap),it=(0,Q.useCallback)(e=>{let n=rt.current.get(e);if(n!==void 0)return n;let r=Di(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=je.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Zt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return rt.current.set(e,i),i},[t,je]);return(0,$.jsxs)($.Fragment,{children:[!x&&!(P&&P[0]>0)&&(0,$.jsx)(Os,{agentDefinitions:_}),Me&&(0,$.jsx)(s,{title:`${ue} to show ${b.bold(Ne)} previous messages`,width:F}),ve&&g&&Ne>0&&!oe&&(0,$.jsx)(s,{title:`${ue} to hide ${b.bold(Ne)} previous messages`,width:F}),be?(0,$.jsx)($e.Provider,{value:!0,children:(0,$.jsx)(fs,{messages:Pe,scrollRef:ne,columns:F,itemKey:tt,renderItem:nt,onItemClick:Be,isItemClickable:qe,isItemExpanded:He,trackStickyPrompt:re,selectedIndex:Le>=0?Le:void 0,cursorNavRef:le,setCursor:ce,jumpRef:ie,onSearchMatchesChange:j,scanElement:M,setPositions:ae,extractSearchText:it})}):Pe.flatMap(nt),E&&!O&&(0,$.jsx)(l,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(l,{flexDirection:`row`,children:[(0,$.jsx)(l,{minWidth:2,children:(0,$.jsx)(d,{color:`text`,children:_t})}),(0,$.jsx)(l,{flexDirection:`column`,children:(0,$.jsx)(ke,{children:E})})]})}),de&&T&&!O&&(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(Je,{param:{type:`thinking`,thinking:T.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},Is=Ds.memo(Fs,(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`&&Ts(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{ss as a,Ho as c,pi as d,$o as i,Uo as l,Ls as n,Xo as o,es as r,Yo as s,Is as t,fi as u};