@readmagic/workmate 0.0.25 → 0.0.26

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 (355) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-Y5S_lMjD.js → AddWorkspaceDirectory-mS8iUoWY.js} +1 -1
  2. package/dist/chunks/{AgentsMdExternalIncludesDialog-DVbU-BaD.js → AgentsMdExternalIncludesDialog-BHBkysy0.js} +1 -1
  3. package/dist/chunks/AgentsMdExternalIncludesDialog-DuStmCjj.js +1 -0
  4. package/dist/chunks/App-D--vtCyq.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-mcDuiNGs.js +2 -0
  6. package/dist/chunks/{BypassPermissionsModeDialog-DjqGAL4C.js → BypassPermissionsModeDialog-DyqI98d2.js} +1 -1
  7. package/dist/chunks/CustomSelect-CpMbxYbt.js +1 -0
  8. package/dist/chunks/DiffDialog-BQAU2pJx.js +6 -0
  9. package/dist/chunks/Doctor-BU69VQzw.js +1 -0
  10. package/dist/chunks/Doctor-DJOMbSDE.js +3 -0
  11. package/dist/chunks/{ExitFlow-Dh9QdaYK.js → ExitFlow-xBOnvhiW.js} +2 -2
  12. package/dist/chunks/{InvalidConfigDialog-C9boykQn.js → InvalidConfigDialog-NiuhcaG5.js} +1 -1
  13. package/dist/chunks/{InvalidSettingsDialog-UN5mleCK.js → InvalidSettingsDialog-DrromC1I.js} +1 -1
  14. package/dist/chunks/KeybindingProviderSetup-CSUkJHTT.js +1 -0
  15. package/dist/chunks/MCPConnectionManager-Bn1PDn3R.js +1 -0
  16. package/dist/chunks/MCPToolListView-BRxjOaOL.js +1 -0
  17. package/dist/chunks/{McpParsingWarnings-zkM_lGd0.js → McpParsingWarnings-BYG2yqjO.js} +1 -1
  18. package/dist/chunks/MessageSelector-B7xAQqZI.js +3 -0
  19. package/dist/chunks/Messages-CxMsfjOa.js +10 -0
  20. package/dist/chunks/{Onboarding-BT90cFkn.js → Onboarding-CkATe87e.js} +1 -1
  21. package/dist/chunks/{PermissionDialog-BaibiQae.js → PermissionDialog-tEMMa5-a.js} +1 -1
  22. package/dist/chunks/{PressEnterToContinue-DZc_s_pE.js → PressEnterToContinue-CPOaYnym.js} +1 -1
  23. package/dist/chunks/{PromptInputFooterSuggestions-CCTZYbWI.js → PromptInputFooterSuggestions-CwqAsTI2.js} +1 -1
  24. package/dist/chunks/PromptInputHelpMenu-krq-hiFO.js +1 -0
  25. package/dist/chunks/{ProviderSetup-yIj8YOKF.js → ProviderSetup-J6Ty-Wj8.js} +1 -1
  26. package/dist/chunks/QueryEngine-Mdi_kUaL.js +1 -0
  27. package/dist/chunks/REPL-BgzQtSFF.js +1 -0
  28. package/dist/chunks/REPL-rirm6s_7.js +124 -0
  29. package/dist/chunks/ResumeConversation-Cmsbo5m7.js +1 -0
  30. package/dist/chunks/{SearchBox-C9xxQzh1.js → SearchBox-DQBLKyzJ.js} +1 -1
  31. package/dist/chunks/SearchExtraToolsTool-D1-7C04z.js +1 -0
  32. package/dist/chunks/{SelectMulti-BW7Ffk1G.js → SelectMulti-BpAjjhsn.js} +1 -1
  33. package/dist/chunks/Settings-B6DImvca.js +2 -0
  34. package/dist/chunks/Spinner-DhhSOFcN.js +1 -0
  35. package/dist/chunks/{SpinnerGlyph-CqrOK3Mx.js → SpinnerGlyph-CmVXC-_9.js} +1 -1
  36. package/dist/chunks/{TextInput-Cev5Awdd.js → TextInput-BboKIug2.js} +11 -11
  37. package/dist/chunks/ThemePicker-DTpXbEY0.js +1 -0
  38. package/dist/chunks/{TrustDialog-8Sjmuu0e.js → TrustDialog-CZ8JpySm.js} +1 -1
  39. package/dist/chunks/{ValidationErrorsList-INwwoerV.js → ValidationErrorsList-C_gDQfm1.js} +1 -1
  40. package/dist/chunks/{_baseEach-DrPH_FGo.js → _baseEach-DGbaIpJA.js} +1 -1
  41. package/dist/chunks/_baseSlice-D67_NpZ1.js +1 -0
  42. package/dist/chunks/{add-dir-D3RMaYxy.js → add-dir-B576wzi9.js} +1 -1
  43. package/dist/chunks/{agentDisplay-B3npXoCS.js → agentDisplay-ZuFoBZYu.js} +1 -1
  44. package/dist/chunks/{agents-2mPGmeq6.js → agents-Dy4_hDic.js} +1 -1
  45. package/dist/chunks/agents-HIOBiw4w.js +101 -0
  46. package/dist/chunks/allErrors-CxPNR2WN.js +1 -0
  47. package/dist/chunks/appleTerminalBackup-C9kjzdM9.js +1 -0
  48. package/dist/chunks/{backgroundHousekeeping-BkFxfjOf.js → backgroundHousekeeping-PyLNnGdw.js} +1 -1
  49. package/dist/chunks/backgroundHousekeeping-ZCMPmQuU.js +1 -0
  50. package/dist/chunks/{banner-DHpTmEO7.js → banner-DqFectPg.js} +2 -2
  51. package/dist/chunks/{branch-Be_yDFU8.js → branch-B_BL5N9N.js} +2 -2
  52. package/dist/chunks/{break-cache-UUt6Dkf2.js → break-cache-DL95nKZl.js} +2 -2
  53. package/dist/chunks/{btw-DUml5L1w.js → btw-Y44ctueB.js} +1 -1
  54. package/dist/chunks/bundledMode-BxyD5cqq.js +1 -0
  55. package/dist/chunks/caches-5xZ4dSXt.js +1 -0
  56. package/dist/chunks/caches-Be9saXxV.js +1 -0
  57. package/dist/chunks/{claudeDesktop-mBGFDbI6.js → claudeDesktop-g8eUUY2E.js} +1 -1
  58. package/dist/chunks/{clear-CrGjNe6E.js → clear-DtTkA707.js} +1 -1
  59. package/dist/chunks/{client-BDuhbzLD.js → client-Bw_L3lSc.js} +1 -1
  60. package/dist/chunks/{client-BYFVVMcf.js → client-aJ2Nr_sh.js} +1 -1
  61. package/dist/chunks/client-mnUISv_N.js +1 -0
  62. package/dist/chunks/client-wPqIdEVm.js +1 -0
  63. package/dist/chunks/commands-wfE12a4L.js +1 -0
  64. package/dist/chunks/compact-CvNOtu7J.js +2 -0
  65. package/dist/chunks/config-D3K87Mm1.js +3 -0
  66. package/dist/chunks/config-DTga6Ku8.js +1 -0
  67. package/dist/chunks/config-DtmqWusU.js +1 -0
  68. package/dist/chunks/{context-mV5zjqmc.js → context-Opu4E8dL.js} +1 -1
  69. package/dist/chunks/{context-noninteractive-DvfVvmSE.js → context-noninteractive-B1V2Mp26.js} +5 -5
  70. package/dist/chunks/context-noninteractive-eIlneYiL.js +1 -0
  71. package/dist/chunks/conversation-CG_z7TLE.js +1 -0
  72. package/dist/chunks/conversation-CHesBfFZ.js +1 -0
  73. package/dist/chunks/conversationRecovery-OhitW-7g.js +1 -0
  74. package/dist/chunks/crossProjectResume-mmYx8PrZ.js +40 -0
  75. package/dist/chunks/cwd-BH2f3u0o.js +1 -0
  76. package/dist/chunks/{cwd-BvNt_018.js → cwd-DrEEb4f5.js} +1 -1
  77. package/dist/chunks/{debug-CRnGsZOV.js → debug-kBjDaVkQ.js} +3 -3
  78. package/dist/chunks/{detectRepository-CsJLbVEe.js → detectRepository-M6K2wc7h.js} +1 -1
  79. package/dist/chunks/{diff-DUEoNCnJ.js → diff-Cv7tX2-P.js} +1 -1
  80. package/dist/chunks/{directoryCompletion-Bgi8DBT5.js → directoryCompletion-BHyjyKAM.js} +1 -1
  81. package/dist/chunks/doctor-DeBG5SL5.js +1 -0
  82. package/dist/chunks/{entry-D1iD76SW.js → entry-CbhyIWgj.js} +5 -5
  83. package/dist/chunks/envUtils-DZ_SvEVz.js +1 -0
  84. package/dist/chunks/execFileNoThrow-BfZFnCGa.js +1 -0
  85. package/dist/chunks/execa-CBhG1doD.js +34 -0
  86. package/dist/chunks/exit-OKEV_ddw.js +1 -0
  87. package/dist/chunks/{extraUsage-BtHE-SBX.js → extraUsage-BlRL3yeb.js} +1 -1
  88. package/dist/chunks/extractMemories-jnsv-_n_.js +1 -0
  89. package/dist/chunks/fast-4I_qPJCd.js +1 -0
  90. package/dist/chunks/fast-DiolM1M7.js +1 -0
  91. package/dist/chunks/{fetchModelList-Cjow_QGy.js → fetchModelList-BRFTQim4.js} +1 -1
  92. package/dist/chunks/fetchModelList-qPKAuu4m.js +1 -0
  93. package/dist/chunks/{fileSuggestions-C96V9-Ne.js → fileSuggestions-iWVXvvLB.js} +3 -3
  94. package/dist/chunks/{fpsMetrics-wxj9GAsd.js → fpsMetrics-Ixd0J4CH.js} +1 -1
  95. package/dist/chunks/{gemini-4YGElN3H.js → gemini-BfVyavwQ.js} +2 -2
  96. package/dist/chunks/{generateSessionName-BHIKyXpz.js → generateSessionName-CGaTTXCA.js} +1 -1
  97. package/dist/chunks/genericProcessUtils-CVtQOTO2.js +12 -0
  98. package/dist/chunks/{goal-ePK_jLo3.js → goal-BidR-GFa.js} +1 -1
  99. package/dist/chunks/grok-DLcuI-U7.js +1 -0
  100. package/dist/chunks/{help-B7xRle-V.js → help-CZuvYhXj.js} +1 -1
  101. package/dist/chunks/history-BxPGftQw.js +1 -0
  102. package/dist/chunks/hooks-Bg9WIjZQ.js +1 -0
  103. package/dist/chunks/{hooks-BN5f58HY.js → hooks-ehqfAM5F.js} +2 -2
  104. package/dist/chunks/install-ACGY0vhM.js +1 -0
  105. package/dist/chunks/{instrumentation-Oj5xagJG.js → instrumentation-B9bfF2mA.js} +5 -5
  106. package/dist/chunks/{job-D9ypO0cd.js → job-Coztdn6A.js} +1 -1
  107. package/dist/chunks/keybindings-DwSdLpaE.js +1 -0
  108. package/dist/chunks/{launchLocalMemory-DliLezJw.js → launchLocalMemory-DRzfpIOB.js} +1 -1
  109. package/dist/chunks/{launchOnboarding-A-kk-7ID.js → launchOnboarding-D2zFCJf-.js} +1 -1
  110. package/dist/chunks/{loadAgentsDir-DGozQu_6.js → loadAgentsDir-DR5PVAc3.js} +557 -561
  111. package/dist/chunks/loadAgentsDir-DqAbnpB-.js +1 -0
  112. package/dist/chunks/{loadPluginHooks-BiHPKDaY.js → loadPluginHooks-BiQgGfUJ.js} +1 -1
  113. package/dist/chunks/{loader-CtoR-vO-.js → loader-6MqzNGmV.js} +1 -1
  114. package/dist/chunks/{localSearch-BU02Qsv9.js → localSearch-CzkxDuOR.js} +1 -1
  115. package/dist/chunks/localSearch-DW3JT2MA.js +1 -0
  116. package/dist/chunks/lockfile-D_9vif6E.js +1 -0
  117. package/dist/chunks/{log-DoSpAwRP.js → log-DWZny1vM.js} +1 -1
  118. package/dist/chunks/{logoUtils-DLd6JKqW.js → logoUtils-DR5T0pr3.js} +1 -1
  119. package/dist/chunks/{magicDocs-Bj8LYrN2.js → magicDocs-BwBxjfLo.js} +2 -2
  120. package/dist/chunks/main-Ryi27wYq.js +345 -0
  121. package/dist/chunks/managedEnv-DCEJh3z3.js +1 -0
  122. package/dist/chunks/managedEnv-Do9fgLpk.js +1 -0
  123. package/dist/chunks/managedEnvConstants-CWcT7nYr.js +1 -0
  124. package/dist/chunks/mcp-BCpnF6wD.js +1 -0
  125. package/dist/chunks/mcp-CJ6SDJEK.js +6 -0
  126. package/dist/chunks/mcp-CZBTxbhu.js +2 -0
  127. package/dist/chunks/memory-BQO6Y0ak.js +1 -0
  128. package/dist/chunks/{modalContext-DDZdU1J8.js → modalContext-CBE8xuck.js} +1 -1
  129. package/dist/chunks/{mode-CBKawxnD.js → mode-wq70cR44.js} +1 -1
  130. package/dist/chunks/model-D42epddJ.js +1 -0
  131. package/dist/chunks/{model-DwbqvCY2.js → model-DVk9-2dk.js} +1 -1
  132. package/dist/chunks/{modelOptions-CXBfKFXA.js → modelOptions-beLgXORr.js} +1 -1
  133. package/dist/chunks/nativeInstaller-ChGSz1lb.js +1 -0
  134. package/dist/chunks/{notifications-ql0eSo0Y.js → notifications-dGBuNvFj.js} +1 -1
  135. package/dist/chunks/{onChangeAppState-D85b33R5.js → onChangeAppState-B4K-rSaF.js} +1 -1
  136. package/dist/chunks/openai-DAwnAV9K.js +2 -0
  137. package/dist/chunks/{overlayContext-CLjlCFBl.js → overlayContext-B6i_6y_0.js} +1 -1
  138. package/dist/chunks/{panel-DMZkOEiU.js → panel-C0CF3noE.js} +1 -1
  139. package/dist/chunks/parser-BZt0VFd_.js +1 -0
  140. package/dist/chunks/{parser-UqADrvxF.js → parser-DThLwgdM.js} +1 -1
  141. package/dist/chunks/{partition-CwxTlmMd.js → partition-BRQHofxD.js} +1 -1
  142. package/dist/chunks/{pasteStore-ovtxMVR5.js → pasteStore-BmehVo5j.js} +1 -1
  143. package/dist/chunks/{permissions-CgsvWOk_.js → permissions-DkfWKN-B.js} +3 -3
  144. package/dist/chunks/pidLock-YvAaIrIY.js +3 -0
  145. package/dist/chunks/plan-B6U3ioer.js +1 -0
  146. package/dist/chunks/{platform-DsMIk3eq.js → platform-Vl9IynC3.js} +1 -1
  147. package/dist/chunks/plugin-CTA2_-F7.js +17 -0
  148. package/dist/chunks/{pluginAutoupdate-DQqYDPVg.js → pluginAutoupdate-Dy5W3HWE.js} +1 -1
  149. package/dist/chunks/{pluginBlocklist-BAr9WTup.js → pluginBlocklist-DAoUENwc.js} +1 -1
  150. package/dist/chunks/pluginCliCommands-CaHnj0C_.js +1 -0
  151. package/dist/chunks/{pluginFlagging-BO_3qjfs.js → pluginFlagging-BCj9LJP3.js} +1 -1
  152. package/dist/chunks/pluginOperations-ClXNOOG6.js +2 -0
  153. package/dist/chunks/pluginStartupCheck-CiwMKGjx.js +1 -0
  154. package/dist/chunks/{pluginStartupCheck-BX6cv-vs.js → pluginStartupCheck-U8_xk25t.js} +1 -1
  155. package/dist/chunks/{plugins-9crasx2V.js → plugins-D7zyI9c4.js} +4 -4
  156. package/dist/chunks/{poller-CpLBoB-N.js → poller-BeyVwHAf.js} +1 -1
  157. package/dist/chunks/poorMode-DtzWNhsY.js +1 -0
  158. package/dist/chunks/poorMode-Ocff_UT1.js +1 -0
  159. package/dist/chunks/print-BzljdXem.js +13 -0
  160. package/dist/chunks/processBashCommand-RUkmyAl4.js +1 -0
  161. package/dist/chunks/processSlashCommand-DRLO-jNV.js +5 -0
  162. package/dist/chunks/{projectContext-5fmRr6Sd.js → projectContext-COeHKDrk.js} +1 -1
  163. package/dist/chunks/{projectContext-DhtjLv3k.js → projectContext-QN5U3Ggr.js} +1 -1
  164. package/dist/chunks/{projectOnboardingState--L3BKjOE.js → projectOnboardingState-KqcpRXls.js} +1 -1
  165. package/dist/chunks/{prompt-DzO1um1h.js → prompt-CTByhpUI.js} +20 -20
  166. package/dist/chunks/prompt-DTpfW6yP.js +1 -0
  167. package/dist/chunks/prompt-D__eHY_5.js +1 -0
  168. package/dist/chunks/promptEditor-CpUFgGzc.js +4 -0
  169. package/dist/chunks/{protocolHandler-BWgH1jaF.js → protocolHandler-BQSLVGnG.js} +2 -2
  170. package/dist/chunks/{proxy-BjkGlmBu.js → proxy-BtWuysHM.js} +2 -2
  171. package/dist/chunks/{reconciler-CVMmAaCy.js → reconciler-D6BUq8WB.js} +1 -1
  172. package/dist/chunks/refresh-B4pqFp12.js +1 -0
  173. package/dist/chunks/reject-C6IvUvBt.js +1 -0
  174. package/dist/chunks/{reload-plugins-DeyJTx4s.js → reload-plugins-DXQqk7q6.js} +1 -1
  175. package/dist/chunks/rename-D4XBmTBI.js +1 -0
  176. package/dist/chunks/{renderOptions-DRS2EslG.js → renderOptions-DkP98P_d.js} +1 -1
  177. package/dist/chunks/{resume-N4O5YI-S.js → resume-DzIev0JI.js} +2 -2
  178. package/dist/chunks/ripgrep-CYP26Fhg.js +1 -0
  179. package/dist/chunks/ripgrep-D1f1pbCz.js +5 -0
  180. package/dist/chunks/{runtimeObserver-DMSzdFWt.js → runtimeObserver-BPqlbu0B.js} +4 -4
  181. package/dist/chunks/{runtimeObserver-C0CJvA3q.js → runtimeObserver-BUHs3qjs.js} +1 -1
  182. package/dist/chunks/sandbox-adapter-CumL75tU.js +1 -0
  183. package/dist/chunks/{sandbox-toggle-Tbbaw18C.js → sandbox-toggle-CTtET6Xq.js} +1 -1
  184. package/dist/chunks/searchExtraTools-BMCU2zEf.js +1 -0
  185. package/dist/chunks/{select-Fq6g2Ejk.js → select-FrwoTzuc.js} +1 -1
  186. package/dist/chunks/sessionFileAccessHooks-WO8WTdT9.js +1 -0
  187. package/dist/chunks/{sessionObserver-CRie77tp.js → sessionObserver-B6xzxckA.js} +2 -2
  188. package/dist/chunks/sessionObserver-CBrM4opL.js +1 -0
  189. package/dist/chunks/sessionStorage-C1EAxDWG.js +1 -0
  190. package/dist/chunks/sessionTracing-UFK96PxT.js +11 -0
  191. package/dist/chunks/settings-BK6gCko-.js +1 -0
  192. package/dist/chunks/settings-YIDksG5Z.js +24 -0
  193. package/dist/chunks/setup-BBvZyrfz.js +3 -0
  194. package/dist/chunks/{shadowedRuleDetection-CTnYVrmP.js → shadowedRuleDetection-D6R2OeoH.js} +1 -1
  195. package/dist/chunks/{sideQuestion-Cl8m2qYx.js → sideQuestion-5jcbOMsR.js} +3 -3
  196. package/dist/chunks/{sinks-CiupmfTg.js → sinks-B-kFqjjd.js} +1 -1
  197. package/dist/chunks/sinks-DB_D4lmu.js +1 -0
  198. package/dist/chunks/skillChangeDetector-103-nEle.js +1 -0
  199. package/dist/chunks/{skillGapStore-es3K-aYe.js → skillGapStore-DOz1KCqo.js} +2 -2
  200. package/dist/chunks/{skillLifecycle-BcgoOQBk.js → skillLifecycle-D9NkIwFQ.js} +2 -2
  201. package/dist/chunks/{skillSearchPanel-CuDDb1L-.js → skillSearchPanel-DFiSZaJ4.js} +2 -2
  202. package/dist/chunks/skills-DgeLr52a.js +1 -0
  203. package/dist/chunks/sleep-BbWr_FL1.js +1 -0
  204. package/dist/chunks/{src-9vmGsuSI.js → src-Cy5_qH26.js} +1 -1
  205. package/dist/chunks/{src-DL3w8VPk.js → src-WZ94ZKI3.js} +4 -4
  206. package/dist/chunks/{startupProfiler-DF0AjiDf.js → startupProfiler-DIM_Ihyp.js} +2 -2
  207. package/dist/chunks/startupProfiler-FpGsKWYk.js +1 -0
  208. package/dist/chunks/{state-BQ4BEGin.js → state-CXY-q5gr.js} +1 -1
  209. package/dist/chunks/state-DXt6rahM.js +1 -0
  210. package/dist/chunks/{staticRender-BVWx0IM1.js → staticRender-RHUIg5ln.js} +1 -1
  211. package/dist/chunks/status-CKLecQZV.js +1 -0
  212. package/dist/chunks/{statusNoticeHelpers-BfmIub5L.js → statusNoticeHelpers-DI45AH-c.js} +1 -1
  213. package/dist/chunks/stringUtils-D_xPrwGQ.js +4 -0
  214. package/dist/chunks/switcher-D2Z2ZNQ0.js +1 -0
  215. package/dist/chunks/switcher-DhZCaAun.js +1 -0
  216. package/dist/chunks/{tasks-B6gYXxOx.js → tasks-6suPhqsK.js} +1 -1
  217. package/dist/chunks/{templateJobs-BW6TaqEC.js → templateJobs-BKVEWCsb.js} +1 -1
  218. package/dist/chunks/{terminalSetup-C-g9Xvj3.js → terminalSetup-7PUR4hfo.js} +1 -1
  219. package/dist/chunks/{terminalSetup-BgIXFBpd.js → terminalSetup-Cqy5_PhJ.js} +4 -4
  220. package/dist/chunks/{theme-9AZceq_m.js → theme-B-HG2PUs.js} +1 -1
  221. package/dist/chunks/tipRegistry-BR_lSGRw.js +2 -0
  222. package/dist/chunks/{toolEventObserver-DTuJcREC.js → toolEventObserver-BY3QVnr6.js} +1 -1
  223. package/dist/chunks/toolPool-BcwIF8Q_.js +1 -0
  224. package/dist/chunks/{types-97nL3naE.js → types-CD25a50S.js} +1 -1
  225. package/dist/chunks/udsClient-CCxgLiZy.js +1 -0
  226. package/dist/chunks/urlHandler-BNsQKqba.js +1 -0
  227. package/dist/chunks/{use-select-navigation-BStVRvcX.js → use-select-navigation-CW5alA9r.js} +1 -1
  228. package/dist/chunks/{useDoublePress-C9xxQzh1.js → useDoublePress-DQBLKyzJ.js} +1 -1
  229. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DWRFdFoU.js → useExitOnCtrlCDWithKeybindings-BgJrnuDl.js} +1 -1
  230. package/dist/chunks/useMainLoopModel-BVgJo4hN.js +1 -0
  231. package/dist/chunks/useManagePlugins-CrWjzESW.js +1 -0
  232. package/dist/chunks/useMergedTools-r6GQq5mI.js +1 -0
  233. package/dist/chunks/{useSearchInput-B_mY9wBq.js → useSearchInput-BITV_Txn.js} +1 -1
  234. package/dist/chunks/{useSettingsErrors-CM7tThcp.js → useSettingsErrors-CO0fTNzn.js} +1 -1
  235. package/dist/chunks/{util-Bb2S6g9N.js → util-_zo3I1y8.js} +1 -1
  236. package/dist/chunks/validatePlugin-DFGdRhA-.js +1 -0
  237. package/dist/chunks/{vim-Dpnhgoz_.js → vim-qgMS88ss.js} +1 -1
  238. package/dist/chunks/worktree-CR_M6Qfy.js +1 -0
  239. package/dist/cli.js +1 -1
  240. package/package.json +1 -1
  241. package/scripts/postinstall.cjs +16 -16
  242. package/dist/chunks/AgentsMdExternalIncludesDialog-Bnb1jWcg.js +0 -1
  243. package/dist/chunks/App-B8q8PV77.js +0 -1
  244. package/dist/chunks/BackgroundTasksDialog-i0TkZgQp.js +0 -2
  245. package/dist/chunks/CustomSelect-BvTftqEH.js +0 -1
  246. package/dist/chunks/DiffDialog-v5r8cBKW.js +0 -6
  247. package/dist/chunks/Doctor-DKpBnbuI.js +0 -1
  248. package/dist/chunks/Doctor-uvO6NM5m.js +0 -3
  249. package/dist/chunks/KeybindingProviderSetup-DsJqfEt-.js +0 -1
  250. package/dist/chunks/MCPConnectionManager-DkZVxLEj.js +0 -1
  251. package/dist/chunks/MCPToolListView-De1W4jpj.js +0 -1
  252. package/dist/chunks/MessageSelector-DW_itlX-.js +0 -3
  253. package/dist/chunks/Messages-BFsCpACq.js +0 -10
  254. package/dist/chunks/PromptInputHelpMenu-Bm5KY0Ma.js +0 -1
  255. package/dist/chunks/QueryEngine-egz5mbaW.js +0 -1
  256. package/dist/chunks/REPL-D27CE4WN.js +0 -124
  257. package/dist/chunks/REPL-e8wAT1wN.js +0 -1
  258. package/dist/chunks/ResumeConversation-CWA27Lke.js +0 -1
  259. package/dist/chunks/SearchExtraToolsTool-BRchtZ9Q.js +0 -1
  260. package/dist/chunks/Settings-axHLvYIy.js +0 -3
  261. package/dist/chunks/Spinner-VjwI7m_g.js +0 -1
  262. package/dist/chunks/ThemePicker-CtQYHmOr.js +0 -1
  263. package/dist/chunks/agents-DEnmg8Xo.js +0 -101
  264. package/dist/chunks/allErrors-C9kx6lnk.js +0 -1
  265. package/dist/chunks/appleTerminalBackup-CT7g8yOs.js +0 -1
  266. package/dist/chunks/backgroundHousekeeping-CvWfd99M.js +0 -1
  267. package/dist/chunks/caches-DWjwe-DN.js +0 -1
  268. package/dist/chunks/caches-VLs1tQkZ.js +0 -1
  269. package/dist/chunks/client-CO_6v4yl.js +0 -1
  270. package/dist/chunks/client-DO-O441l.js +0 -1
  271. package/dist/chunks/commands-Cn1P7Tms.js +0 -1
  272. package/dist/chunks/compact-DGUhdXcc.js +0 -2
  273. package/dist/chunks/config-C7GTF4iI.js +0 -1
  274. package/dist/chunks/config-CWPHVTic.js +0 -3
  275. package/dist/chunks/config-Cox0TM2Z.js +0 -1
  276. package/dist/chunks/context-noninteractive--OuiZUzL.js +0 -1
  277. package/dist/chunks/conversation--y8PD2Lk.js +0 -1
  278. package/dist/chunks/conversation-BIPJEOwO.js +0 -1
  279. package/dist/chunks/conversationRecovery-BBJzrA0g.js +0 -1
  280. package/dist/chunks/crossProjectResume-CwZb3cEU.js +0 -40
  281. package/dist/chunks/cwd-BZMp3CZ8.js +0 -1
  282. package/dist/chunks/doctor-4NiE46ZG.js +0 -1
  283. package/dist/chunks/envUtils-DfkgIdYf.js +0 -1
  284. package/dist/chunks/execFileNoThrow-BgRsj_SW.js +0 -34
  285. package/dist/chunks/exit-CrsQsjbx.js +0 -1
  286. package/dist/chunks/extractMemories-kogJzpit.js +0 -1
  287. package/dist/chunks/fast-CuNVwVTr.js +0 -1
  288. package/dist/chunks/fast-RlFnwGRV.js +0 -1
  289. package/dist/chunks/fetchModelList-uiCPVqbJ.js +0 -1
  290. package/dist/chunks/genericProcessUtils-BNlr-QxM.js +0 -23
  291. package/dist/chunks/grok-DnmklTrm.js +0 -1
  292. package/dist/chunks/history-kOw3CcLT.js +0 -1
  293. package/dist/chunks/hooks-BDY1jMbS.js +0 -1
  294. package/dist/chunks/install-DrMiHa2Q.js +0 -1
  295. package/dist/chunks/keybindings-BRRN_eap.js +0 -1
  296. package/dist/chunks/loadAgentsDir-CJAK4kif.js +0 -1
  297. package/dist/chunks/localSearch-DyaB2Rm-.js +0 -1
  298. package/dist/chunks/main-B_09WbaG.js +0 -345
  299. package/dist/chunks/managedEnv-BJGfe3m7.js +0 -1
  300. package/dist/chunks/managedEnv-CIWJsuty.js +0 -1
  301. package/dist/chunks/managedEnvConstants-BPwL2aWI.js +0 -1
  302. package/dist/chunks/mcp-1nBvcNxw.js +0 -1
  303. package/dist/chunks/mcp-7DXpXMdT.js +0 -2
  304. package/dist/chunks/mcp-kw99WVi2.js +0 -6
  305. package/dist/chunks/memory-CjWvzR_9.js +0 -1
  306. package/dist/chunks/model-DpZaKZMb.js +0 -1
  307. package/dist/chunks/nativeInstaller-SmPeEisk.js +0 -1
  308. package/dist/chunks/openai-D_j7-KW6.js +0 -2
  309. package/dist/chunks/parser-2usBI4G-.js +0 -1
  310. package/dist/chunks/pidLock-B-SW3Nhx.js +0 -3
  311. package/dist/chunks/plan-BJrWtXEh.js +0 -1
  312. package/dist/chunks/plugin-D97VJAxW.js +0 -17
  313. package/dist/chunks/pluginCliCommands-CUGPc853.js +0 -1
  314. package/dist/chunks/pluginOperations-rTrzu6Vg.js +0 -2
  315. package/dist/chunks/pluginStartupCheck-BRHnXlym.js +0 -1
  316. package/dist/chunks/poorMode-BaS0DBUO.js +0 -1
  317. package/dist/chunks/poorMode-DmvzFAz_.js +0 -1
  318. package/dist/chunks/print-Bi3xVdB3.js +0 -13
  319. package/dist/chunks/processBashCommand-BBtnCx-7.js +0 -1
  320. package/dist/chunks/processSlashCommand-jzF0GmLO.js +0 -5
  321. package/dist/chunks/prompt-CmijKW7G.js +0 -1
  322. package/dist/chunks/prompt-DYBx_D0H.js +0 -1
  323. package/dist/chunks/promptEditor-B6S_Rzcu.js +0 -4
  324. package/dist/chunks/refresh-CAGv8BJY.js +0 -1
  325. package/dist/chunks/reject-CEUkoI2G.js +0 -1
  326. package/dist/chunks/rename-DPFis9g_.js +0 -1
  327. package/dist/chunks/ripgrep-3omwGI-l.js +0 -1
  328. package/dist/chunks/ripgrep-CgQrN3XX.js +0 -5
  329. package/dist/chunks/sandbox-adapter-D15jjHJR.js +0 -1
  330. package/dist/chunks/searchExtraTools-BoFc__Eg.js +0 -1
  331. package/dist/chunks/sessionFileAccessHooks-Rgsp4_Ex.js +0 -1
  332. package/dist/chunks/sessionObserver-PcaVCVkX.js +0 -1
  333. package/dist/chunks/sessionStorage-Dkf7FRgA.js +0 -1
  334. package/dist/chunks/sessionTracing-D7rekMdW.js +0 -11
  335. package/dist/chunks/settings-8fwIkMDV.js +0 -1
  336. package/dist/chunks/settings-CodSADx8.js +0 -24
  337. package/dist/chunks/setup-DBiIrXrh.js +0 -3
  338. package/dist/chunks/sinks-DH83d_kd.js +0 -1
  339. package/dist/chunks/skillChangeDetector-BrrZaFkT.js +0 -1
  340. package/dist/chunks/skills-BRtgqnLz.js +0 -1
  341. package/dist/chunks/startupProfiler-D1NRu2nj.js +0 -1
  342. package/dist/chunks/state-D3gvDiu8.js +0 -1
  343. package/dist/chunks/status-WXA16wIM.js +0 -1
  344. package/dist/chunks/stringUtils-Bu_lJH5c.js +0 -4
  345. package/dist/chunks/switcher-5gilU5_R.js +0 -1
  346. package/dist/chunks/switcher-DMfuKuw_.js +0 -1
  347. package/dist/chunks/tipRegistry-DtO1H_Wo.js +0 -2
  348. package/dist/chunks/toolPool-DHS8jWaL.js +0 -1
  349. package/dist/chunks/udsClient-CmYHFiBD.js +0 -1
  350. package/dist/chunks/urlHandler-DLz3FZm1.js +0 -1
  351. package/dist/chunks/useMainLoopModel-DSN5HjV1.js +0 -1
  352. package/dist/chunks/useManagePlugins-ntnOf5OU.js +0 -1
  353. package/dist/chunks/useMergedTools-C5Yns9Ij.js +0 -1
  354. package/dist/chunks/validatePlugin-D8WQ5z4W.js +0 -1
  355. package/dist/chunks/worktree-a5oOPSYl.js +0 -1
@@ -1,10 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{C as o,Gr as s,I as c,N as l,P as u,Pn as d,Rn as f,ai as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,xt as b}from"./src-DL3w8VPk.js";import{t as x}from"./jsx-runtime-Bb4Xn-E0.js";import{$i as S,$u as C,A_ as w,Bp as T,DC as ee,DS as E,D_ as D,Du as O,Eu as k,Ff as A,If as j,Ji as M,Mp as N,OS as P,O_ as F,Ou as I,Qi as L,Sa as te,Tb as ne,Tu as re,_b as ie,aa as ae,bC as oe,bb as se,bu as ce,cv as le,da as ue,dd as R,du as de,ea as fe,ed as pe,fu as me,gw as he,ha as ge,hb as _e,hm as ve,jp as z,kC as ye,kS as be,kb as xe,ku as Se,la as Ce,lv as B,nS as we,na as Te,oS as Ee,pS as De,pa as Oe,ra as ke,sS as Ae,ta as je,ud as Me,uu as V,vb as Ne,vu as Pe,vw as Fe,w_ as Ie,wb as Le,wu as Re,xb as ze,xu as Be,yC as Ve,yb as He,yu as Ue,zp as We}from"./loadAgentsDir-DGozQu_6.js";import{n as Ge,t as Ke}from"./cwd-BvNt_018.js";import{a as qe,c as Je,i as Ye,n as Xe,o as Ze}from"./debug-CRnGsZOV.js";import{Ht as Qe,Vt as $e,h as et,t as tt}from"./settings-CodSADx8.js";import{d as nt,h as rt,o as it}from"./config-CWPHVTic.js";import{B as at,L as ot,R as st,q as ct}from"./log-DoSpAwRP.js";import{l as lt,o as ut}from"./stringUtils-Bu_lJH5c.js";import{_ as dt,f as ft,p as pt,y as mt}from"./startupProfiler-DF0AjiDf.js";import{f as ht,h as gt,x as _t}from"./model-DpZaKZMb.js";import{gn as vt,vn as yt}from"./prompt-DzO1um1h.js";import{a as bt,n as xt,r as St,t as Ct}from"./projectOnboardingState--L3BKjOE.js";import{n as wt,t as Tt}from"./systemTheme-Ceakddth.js";import{a as Et,c as Dt,i as Ot}from"./SpinnerGlyph-CqrOK3Mx.js";import{n as kt,r as At}from"./PromptInputFooterSuggestions-CCTZYbWI.js";import{n as jt,t as Mt}from"./useMainLoopModel-DSN5HjV1.js";import{n as Nt,t as Pt}from"./modalContext-DDZdU1J8.js";import{n as Ft,r as It,t as Lt}from"./statusNoticeHelpers-BfmIub5L.js";import{a as Rt,c as zt,i as Bt,l as Vt,n as Ht,o as Ut,r as Wt,t as Gt,u as Kt}from"./logoUtils-DLd6JKqW.js";import{homedir as qt}from"os";import{relative as Jt}from"path";import{fileURLToPath as Yt}from"url";function Xt(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var Zt=e((()=>{}));function Qt(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`)||we(t.text,`status`)!==`completed`?!1:we(t.text,`summary`)?.startsWith(`Background command `)??!1}function $t(e,t){if(!N()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(Qt(t)){let i=0;for(;r<e.length&&Qt(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${at}><${ot}>completed</${ot}><${st}>${i} background commands completed</${st}></${at}>`}]}})}else n.push(t),r++}return n}var en=e((()=>{ct(),ve(),z(),M()}));function tn(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function nn(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(tn(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!tn(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 rn=e((()=>{}));function an(e){let t=cn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),cn.set(e,t)),t}function on(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 sn(e,t,n=!1){if(n)return{messages:e};let r=an(t),i=new Map;for(let t of e){let e=on(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=on(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=on(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 cn,ln=e((()=>{cn=new WeakMap}));function un(e){let t=gn.get(e);if(t!==void 0)return t;let n=dn(e).toLowerCase();return gn.set(e,n),n}function dn(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=hn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?hn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(pn(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`?[fn(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(mn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function fn(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 pn(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?`\n${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(`
8
- `))}return n.join(`
9
- `)}var mn,hn,gn,_n=e((()=>{M(),mn=`</system-reminder>`,hn=new Set([P,be]),gn=new WeakMap}));function vn({pose:e=`default`}={}){return(0,yn.jsxs)(c,{flexDirection:`column`,alignItems:`center`,children:[(0,yn.jsx)(u,{color:`clawd_body`,children:` █████ `}),(0,yn.jsx)(u,{color:`clawd_body`,children:`██ ● ● ██`}),(0,yn.jsx)(u,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,yn.jsx)(u,{color:`clawd_body`,children:` █ █ █ █ `})]})}var yn,bn=e((()=>{y(),yn=x()}));function xn(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=s(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,s(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?s(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=s(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,s(r))),o}function Sn({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,l=Math.max(0,...r.map(e=>e.timestamp?s(e.timestamp):0));return(0,H.jsxs)(c,{flexDirection:`column`,width:t,children:[(0,H.jsx)(u,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(u,{dimColor:!0,italic:!0,children:mt(i,t)})]}):r.length===0&&a?(0,H.jsx)(u,{dimColor:!0,children:mt(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(l>0?l+2:0));return(0,H.jsxs)(u,{children:[l>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(u,{dimColor:!0,children:(e.timestamp||``).padEnd(l)}),` `]}),(0,H.jsx)(u,{children:mt(e.text,r)})]},n)}),i&&(0,H.jsx)(u,{dimColor:!0,italic:!0,children:mt(i,t)})]})]})}var H,Cn=e((()=>{y(),dt(),H=x()}));function wn({feeds:e,maxWidth:t}){let n=e.map(e=>xn(e)),r=Math.max(...n),i=Math.min(r,t);return(0,En.jsx)(c,{flexDirection:`column`,children:e.map((t,n)=>(0,En.jsxs)(Tn.Fragment,{children:[(0,En.jsx)(Sn,{config:t,actualWidth:i}),n<e.length-1&&(0,En.jsx)(o,{color:`claude`,width:i})]},n))})}var Tn,En,Dn=e((()=>{Tn=t(p(),1),y(),Cn(),En=x()}));function On(e){let t=e.map(e=>{let t=pt(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 kn(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${a.tick} `:``}${e}`})),n=Ke()===qt()?`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}}var An=e((()=>{i(),Ge(),dt()}));function U(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function jn(){let{pose:e,bounceOffset:t,onClick:n}=Mn();return(0,Pn.jsx)(c,{height:Bn,flexDirection:`column`,onClick:n,children:(0,Pn.jsx)(c,{marginTop:t,flexShrink:0,children:(0,Pn.jsx)(vn,{pose:e})})})}function Mn(){let[e]=(0,Nn.useState)(()=>tt().prefersReducedMotion??!1),[t,n]=(0,Nn.useState)(-1),r=(0,Nn.useRef)(Fn),i=()=>{e||t!==-1||(r.current=In[Math.floor(Math.random()*In.length)],n(0))};(0,Nn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Rn,zn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Ln;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Nn,Pn,Fn,In,Ln,Rn,zn,Bn,Vn=e((()=>{Nn=t(p(),1),y(),et(),bn(),Pn=x(),Fn=[...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1),...U(`default`,1,2),...U(`arms-up`,0,3),...U(`default`,0,1)],In=[Fn,[...U(`look-right`,0,5),...U(`look-left`,0,5),...U(`default`,0,1)]],Ln={pose:`default`,offset:0},Rn=60,zn=e=>e+1,Bn=3}));function Hn(){let{columns:e}=v(),t=T(e=>e.agent),n=_t(jt()),{version:r,cwd:i,billingType:a,agentName:o}=Ut(),l=t??o,d=Math.max(e-15,20),f=mt(r,Math.max(d-11,6)),{shouldSplit:p,truncatedModel:m,truncatedBilling:h}=Wt(n,a,d),g=l?d-1-s(l)-3:d,_=Kt(i,Math.max(g,10));return(0,W.jsx)(A,{children:(0,W.jsxs)(c,{flexDirection:`row`,gap:2,alignItems:`center`,children:[N()?(0,W.jsx)(jn,{}):(0,W.jsx)(vn,{}),(0,W.jsxs)(c,{flexDirection:`column`,children:[(0,W.jsxs)(u,{children:[(0,W.jsx)(u,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(u,{dimColor:!0,children:[`v`,f]})]}),p?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(u,{dimColor:!0,children:m}),(0,W.jsx)(u,{dimColor:!0,children:h})]}):(0,W.jsxs)(u,{dimColor:!0,children:[m,` · `,h]}),(0,W.jsx)(u,{dimColor:!0,children:l?`@${l} · ${_}`:_})]})]})})}var W,Un=e((()=>{Mt(),xe(),y(),We(),dt(),z(),Vt(),ht(),j(),Vn(),bn(),W=x()}));function Wn(){let e=(0,Kn.useMemo)(Gn,[]),t=(0,Kn.useMemo)(()=>it().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,Kn.useEffect)(()=>{n&&rt(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,qn.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,qn.jsx)(u,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Gn(){return Jn}var Kn,qn,Jn,Yn=e((()=>{Kn=t(p(),1),y(),nt(),qn=x(),Jn={tip:``,color:`dim`}}));function Xn({char:e=`✻`}){let[t]=(0,Zn.useState)(()=>tt().prefersReducedMotion??!1),[n,r]=(0,Zn.useState)(t),i=(0,Zn.useRef)(null),[a,o]=_(n?null:50);return(0,Zn.useEffect)(()=>{if(n)return;let e=setTimeout(r,er,!0);return()=>clearTimeout(e)},[n]),n?(0,Qn.jsx)(c,{ref:a,children:(0,Qn.jsx)(u,{color:tr,children:e})}):(i.current===null&&(i.current=o),(0,Qn.jsx)(c,{ref:a,children:(0,Qn.jsx)(u,{color:Dt(Ot((o-i.current)/$n*360%360)),children:e})}))}var Zn,Qn,$n,er,tr,nr=e((()=>{Zn=t(p(),1),Qe(),y(),et(),Et(),Qn=x(),$n=1500,er=$n*2,tr=Dt({r:153,g:153,b:153})}));function rr(){return gt()&&(it().opus1mMergeNoticeSeenCount??0)<sr}function ir(){let[e]=(0,ar.useState)(rr);return(0,ar.useEffect)(()=>{if(!e)return;let t=(it().opus1mMergeNoticeSeenCount??0)+1;rt(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,or.jsxs)(c,{paddingLeft:2,children:[(0,or.jsx)(Xn,{char:`↑`}),(0,or.jsx)(u,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var ar,or,sr,cr=e((()=>{ar=t(p(),1),Qe(),y(),nt(),ht(),nr(),or=x(),sr=6}));function lr(){let e=zt(),{columns:t}=v(),r=bt(),i=ee.isSandboxingEnabled(),a=T(e=>e.agent),o=it(),[l]=(0,ur.useState)(()=>{let e=tt().companyAnnouncements;if(!(!e||e.length===0))return o.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,ur.useEffect)(()=>{r&&xt()},[r]),!r&&n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let d=_t(jt()),{version:f,cwd:p,billingType:m,agentName:h}=Ut(),_=a??h,y=mt(d,dr-20);if(!r&&!n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Hn,{}),(0,G.jsx)(ir,{}),qe()&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(u,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(u,{dimColor:!0,children:[`Logging to: `,Ze()?`stderr`:Xe()]})]}),(0,G.jsx)(Wn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(u,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(u,{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 - Work Mate uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),l&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{children:l})})]});let b=Rt(t),x=wt(it().theme),S=` ${g(`claude`,x)(`Work Mate`)} ${g(`inactive`,x)(`v${f}`)} `,C=g(`claude`,x)(` Work Mate `);if(b===`compact`){let e=Bt(null);s(e)>t-4&&(e=Bt(null));let n=_?t-4-1-s(_)-3:t-4,r=Kt(p,Math.max(n,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(A,{children:(0,G.jsxs)(c,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:C,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:t,children:[(0,G.jsx)(u,{bold:!0,children:e}),(0,G.jsx)(c,{marginY:1,children:(0,G.jsx)(vn,{})}),(0,G.jsx)(u,{dimColor:!0,children:y}),(0,G.jsx)(u,{dimColor:!0,children:m}),(0,G.jsx)(u,{dimColor:!0,children:_?`@${_} · ${r}`:r})]})}),(0,G.jsx)(ir,{}),i&&(0,G.jsx)(c,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(u,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let w=Bt(null),E=`${y} · ${m}`,D=_?dr-1-s(_)-3:dr,O=Kt(p,Math.max(D,10)),k=_?`@${_} · ${O}`:O,{leftWidth:j,rightWidth:M}=Gt(t,b,Ht(w,k,E));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(A,{children:(0,G.jsx)(c,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:S,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(c,{flexDirection:b===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(c,{flexDirection:`column`,width:j,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(c,{marginTop:1,children:(0,G.jsx)(u,{bold:!0,children:w})}),(0,G.jsx)(vn,{}),(0,G.jsxs)(c,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(u,{dimColor:!0,children:E}),(0,G.jsx)(u,{dimColor:!0,children:k})]})]}),b===`horizontal`&&(0,G.jsx)(c,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),b===`horizontal`&&(0,G.jsx)(wn,{feeds:r?[kn(Ct()),On(e)]:[On(e)],maxWidth:M})]})})}),(0,G.jsx)(ir,{}),qe()&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(u,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(u,{dimColor:!0,children:[`Logging to: `,Ze()?`stderr`:Xe()]})]}),(0,G.jsx)(Wn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(c,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(u,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(u,{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 - Work Mate uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),l&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{children:l})}),i&&(0,G.jsx)(c,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(u,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var ur,G,dr,fr=e((()=>{y(),xe(),Vt(),dt(),bn(),Dn(),An(),nt(),Tt(),et(),Ye(),ur=t(p(),1),St(),Un(),j(),r(),Yn(),cr(),ye(),We(),Mt(),ht(),G=x(),dr=50}));function pr({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,mr.jsx)(c,{minWidth:s(i)+8,children:(0,mr.jsx)(u,{dimColor:!0,children:i})})}var mr,hr=e((()=>{y(),mr=x()}));function gr({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,_r.jsx)(c,{minWidth:s(n),children:(0,_r.jsx)(u,{dimColor:!0,children:n})})}var _r,vr=e((()=>{y(),_r=x()}));function yr(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Er(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(k(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Er(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Er(t.messages[0]?.message.content)?.input;if(k(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function br({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:l,canAnimate:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=l===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(I(e,o)||m&&!n),x=v?e.displayMessage:y?re(e):e,S=v||y?[]:fe(e,h),C=Li(e,s,o,v||y?E:je(e,h),l,h),w=!1;if(u)if(v)w=e.messages.some(e=>{let t=Er(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)w=I(e,o);else{let t=Ae(e);w=!t||o.has(t)}let T=_&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),ee=(0,Tr.jsx)(V,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:S,shouldAnimate:w,shouldShowDot:!0,isTranscriptMode:_,isStatic:C,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,Tr.jsx)(A,{children:(0,Tr.jsxs)(c,{width:p,flexDirection:`column`,children:[(0,Tr.jsxs)(c,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Tr.jsx)(gr,{message:x,isTranscriptMode:_}),(0,Tr.jsx)(pr,{message:x,isTranscriptMode:_})]}),ee]})}):(0,Tr.jsx)(A,{children:ee})}function xr(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Er(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return O(e).some(e=>t.has(e));let n=Ae(e);return!!n&&t.has(n)}function Sr(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Er(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return O(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Er(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=Ae(e);return!n||t.has(n)}function Cr(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&&de(t.message))return!1;let n=xr(e.message,e.streamingToolUseIDs),r=Sr(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var wr,Tr,Er,Dr,Or=e((()=>{wr=t(p(),1),y(),Se(),M(),me(),Tr=x(),hr(),Gi(),vr(),j(),Er=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Dr=wr.memo(br,Cr)}));function kr(e){return e.type===`attachment`&&Ar.has(e.attachment.type)}var Ar,jr=e((()=>{Ar=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.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 Mr(e){return Fr.filter(t=>t.isActive(e))}var K,Nr,Pr,Fr,Ir=e((()=>{y(),w(),i(),Ge(),dt(),It(),K=x(),Nr={id:`large-memory-files`,type:`warning`,isActive:e=>D(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:D(e.memoryFiles).map(e=>{let t=e.path.startsWith(Ke())?Jt(Ke(),e.path):e.path;return(0,K.jsxs)(c,{flexDirection:`row`,children:[(0,K.jsx)(u,{color:`warning`,children:a.warning}),(0,K.jsxs)(u,{color:`warning`,children:[`Large `,(0,K.jsx)(u,{bold:!0,children:t}),` will impact performance (`,ft(e.content.length),` chars > `,ft(Ie),`)`,(0,K.jsx)(u,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Pr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Ft(e.agentDefinitions)>Lt,render:e=>{let t=Ft(e.agentDefinitions);return(0,K.jsxs)(c,{flexDirection:`row`,children:[(0,K.jsx)(u,{color:`warning`,children:a.warning}),(0,K.jsxs)(u,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,ft(t),` tokens > `,ft(Lt),`)`,(0,K.jsx)(u,{dimColor:!0,children:` · /agents to manage`})]})]})}},Fr=[Nr,Pr]}));function Lr({agentDefinitions:e}={}){let t={config:it(),agentDefinitions:e,memoryFiles:(0,zr.use)(F())},n=Mr(t);return n.length===0?null:(0,Br.jsx)(c,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Br.jsx)(Rr.Fragment,{children:e.render(t)},e.id))})}var Rr,zr,Br,Vr=e((()=>{Rr=t(p(),1),zr=t(p(),1),y(),w(),nt(),Ir(),Br=x()}));function Hr(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)??Xr,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Kr);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])??Ur);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-Gr),w=b;else{if(y){let e=v+Wr;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-Wr;{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*Wr,y=Math.min(b,C+Jr),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+Wr);)S+=r.current.get(t[w])??qr,w++}let e=v+2*Wr,n=Math.max(0,w-Jr),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??qr;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??qr;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Yr&&(C=e-Yr),w>t+Yr&&(w=t+Yr),C>w&&(w=Math.min(C+Yr,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),ee=(0,q.useDeferredValue)(w),E=C<T?T:C,D=w>ee?ee:w;if((E>D||y)&&(E=C,D=w),_>0&&(D=w),D-E>Jr){let e=(x[E]+x[D])/2;g-m.current<e?D=E+Jr:E=D-Jr}let O=m.current,k=x[E],A=E===0?0:k+O,j=D===b?1/0:Math.max(k,x[D]-v)+O;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(A,j)}),(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 M=(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},[]),N=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),P=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),F=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),I=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),L=S-x[D];return{range:[E,D],topSpacer:k,bottomSpacer:L,measureRef:M,spacerRef:h,offsets:x,getItemTop:N,getItemElement:P,getItemHeight:F,scrollToIndex:I}}var q,Ur,Wr,Gr,Kr,qr,Jr,Yr,Xr,Zr=e((()=>{q=t(p(),1),Ur=3,Wr=40,Gr=30,Kr=20,qr=1,Jr=200,Yr=25,Xr=()=>{}}));function Qr({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,ri.jsx)(ai.Provider,{value:n,children:(0,ri.jsx)(si.Provider,{value:i,children:(0,ri.jsx)(ii.Provider,{value:t,children:(0,ri.jsx)(oi.Provider,{value:r,children:e})})})})}function $r(){return(0,J.useContext)(ii)}function ei(){return(0,J.useContext)(oi)}function ti(e){let t=(0,J.useContext)(ai);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function ni(e){let t=(0,J.useContext)(si);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,ri,ii,ai,oi,si,ci=e((()=>{J=t(p(),1),ri=x(),ii=(0,J.createContext)(null),ai=(0,J.createContext)(null),oi=(0,J.createContext)(null),si=(0,J.createContext)(null)}));function li(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 ui(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`&&!di(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function di(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 fi(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||kr(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ui(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function pi({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:l=!1,hideSticky:d=!1,newMessageCount:p=0,onPillClick:m}){let{rows:h,columns:g}=v(),[_,y]=(0,Y.useState)(null),x=(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(!N())return;let e=f.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{Be(Yt(e))}catch{}else ce(e)},()=>{e.onHyperlinkClick=void 0}},[]),N()){let s=d?null:_,f=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(Qr,{children:[(0,X.jsx)(c,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(c,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(c,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[f&&(0,X.jsx)(hi,{text:f.text,onClick:f.scrollTo}),(0,X.jsxs)(b,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(yi,{value:x,children:e}),n]}),!l&&S&&n==null&&(0,X.jsx)(mi,{count:p,onClick:m}),r!=null&&(0,X.jsx)(c,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(c,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(gi,{}),(0,X.jsx)(_i,{}),(0,X.jsx)(c,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Pt,{value:{rows:h-vi-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(c,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-vi,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(c,{flexShrink:0,children:(0,X.jsx)(u,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(c,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function mi({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(c,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(c,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(u,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${lt(e,`message`)}`:`Jump to bottom`,` `,a.arrowDown,` `]})})})}function hi({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(c,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(u,{color:`subtle`,wrap:`truncate-end`,children:[a.pointer,` `,e]})})}function gi(){let e=$r();return!e||e.suggestions.length===0?null:(0,X.jsx)(c,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(kt,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function _i(){let e=ei();return e?(0,X.jsx)(c,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,vi,yi,bi=e((()=>{i(),Y=t(p(),1),Nt(),ci(),xe(),y(),Ue(),z(),ut(),jr(),At(),X=x(),vi=2,yi=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function xi(e){let t=ki.get(e);if(t!==void 0)return t;let n=un(e);return ki.set(e,n),n}function Si(e){let t=ji.get(e);if(t!==void 0)return t;let n=Ci(e);return ji.set(e,n),n}function Ci(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(`
10
- `)}if(t===null)return null;let n=se(t);return n.startsWith(`<`)||n===``?null:n}function wi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:u,onLeaveK:d,renderItem:f}){return(0,Di.jsx)(c,{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?()=>u(e):void 0,onMouseLeave:o?()=>d(e):void 0,children:(0,Di.jsx)(l.Provider,{value:a&&!i?`text`:void 0,children:f(t,n)})})}function Ti({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:l=xi,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:ee,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:k,scrollToIndex:A}=Hr(t,x,n),[j,M]=S,N=(0,Z.useCallback)(t=>k(t)!==0&&He(e[t]),[k,e]);(0,Z.useImperativeHandle)(f,()=>{let n=e=>p?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:ze(e)?.name}),r=d??-1,i=(t,r,i=N)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>N(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,N]);let P=(0,Z.useRef)({offsets:E,start:j,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:A});P.current={offsets:E,start:j,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:A},(0,Z.useEffect)(()=>{if(d===void 0)return;let e=P.current,n=e.getItemElement(d);n?t.current?.scrollToElement(n,1):e.scrollToIndex(d)},[d,t]);let F=(0,Z.useRef)(null),I=(0,Z.useRef)({msgIdx:-1,positions:[]}),L=(0,Z.useRef)(-1),te=(0,Z.useRef)(0),ne=(0,Z.useRef)(0),re=(0,Z.useRef)(()=>{}),ie=(0,Z.useRef)(()=>{}),ae=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),oe=(0,Z.useRef)(-1),se=(0,Z.useRef)(!1);function ce(e){let t=P.current.getItemTop(e);return Math.max(0,t-Oi)}function le(e){let n=t.current,{msgIdx:r,positions:i}=I.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=P.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-Oi)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=ae.current,p=f.prefixSum.at(-1)??0,m=(f.prefixSum[f.ptr]??0)+a+1;h?.(p,m),Je(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${m}/${p}`)}ie.current=le;let[ue,R]=(0,Z.useState)(0),de=(0,Z.useCallback)(()=>R(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=F.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}=P.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){F.current=null,Je(`seek(i=${n}): no mount after scrollToIndex, skip`),re.current(r?-1:1);return}F.current={idx:n,wantLast:r,tries:i+1},c(n),de();return}F.current=null,a.scrollTo(Math.max(0,s(n)-Oi));let d=g?.(l)??[];if(I.current={msgIdx:n,positions:d},Je(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++te.current>20){te.current=0;return}re.current(r?-1:1);return}te.current=0;let f=r?d.length-1:0;ae.current.screenOrd=f,L.current=-1,ie.current(f);let p=ne.current;p&&(ne.current=0,re.current(p))},[ue]);function fe(e,n){let r=t.current;if(!r)return;let i=P.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;_?.(null),I.current={msgIdx:-1,positions:[]},F.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(ce(e)):o(e),de()}function pe(e){let t=ae.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(F.current){ne.current=e;return}L.current<0&&(L.current=t.ptr);let{positions:a}=I.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,le(o),L.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===L.current){_?.(null),L.current=-1,Je(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,fe(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;h?.(i,c)}re.current=pe,(0,Z.useImperativeHandle)(m,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(ce(e))},setSearchQuery:e=>{F.current=null,I.current={msgIdx:-1,positions:[]},L.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=P.current.messages;for(let t=0;t<e.length;t++){let a=l(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:c,start:u,getItemTop:d}=P.current,f=d(u),p=f>=0?f-c[u]:0;if(r.length>0&&s){let t=oe.current>=0?oe.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+c[r[e]]-t);i<=n&&(n=i,o=e)}Je(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}ae.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?fe(r[o],!0):oe.current>=0&&s&&s.scrollTo(oe.current),h?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>pe(1),prevMatch:()=>pe(-1),setAnchor:()=>{let e=t.current;e&&(oe.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),F.current=null,I.current={msgIdx:-1,positions:[]},L.current=-1},warmSearchIndex:async()=>{if(se.current)return 0;let e=P.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await B(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)l(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return Je(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),se.current=!0,Math.round(t)}}),[t]);let[me,he]=(0,Z.useState)(null),ge=(0,Z.useRef)({onItemClick:a,setHoveredKey:he});ge.current={onItemClick:a,setHoveredKey:he};let _e=(0,Z.useCallback)((e,t)=>{let n=ge.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),ve=(0,Z.useCallback)(e=>{ge.current.setHoveredKey(e)},[]),z=(0,Z.useCallback)(e=>{ge.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Di.jsxs)(Di.Fragment,{children:[(0,Di.jsx)(c,{ref:ee,height:C,flexShrink:0}),e.slice(j,M).map((e,t)=>{let n=j+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&me===r,u=s?.(e);return(0,Di.jsx)(wi,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:_e,onEnterK:ve,onLeaveK:z,renderItem:i},r)}),w>0&&(0,Di.jsx)(c,{height:w,flexShrink:0}),u&&(0,Di.jsx)(Ei,{messages:e,start:j,end:M,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function Ei({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(yi);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Mi,[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=Si(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,Ai).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,Di,Oi,ki,Ai,ji,Mi,Ni=e((()=>{Z=t(p(),1),Zr(),y(),Pe(),bi(),Di=x(),Ye(),le(),_n(),Ne(),Oi=3,ki=new WeakMap,Ai=500,ji=new WeakMap,Mi=()=>{}}));function Pi(e,t,n=Vi,r=Hi){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 Fi(e){return(e.type===`assistant`||e.type===`user`?Ae(e):null)??e.uuid}function Ii(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Li(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=Ae(e);return i?t.has(i)||n.has(i)||ke(i,`PostToolUse`,a)?!1:Xt(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 Ri,Q,$,zi,Bi,Vi,Hi,Ui,Wi,Gi=e((()=>{h(),Ri=t(p(),1),Q=t(p(),1),Zt(),Qe(),xe(),y(),Le(),yt(),Ve(),en(),rn(),Se(),nt(),r(),z(),ln(),M(),ut(),_n(),fr(),R(),Or(),Ne(),pe(),jr(),j(),Vr(),$=x(),he(),Ni(),zi=Ri.memo(function({agentDefinitions:e}){return(0,$.jsx)(A,{children:(0,$.jsxs)(c,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(lr,{}),(0,$.jsx)(Ri.Suspense,{fallback:null,children:(0,$.jsx)(Lr,{agentDefinitions:e})})]})})}),Bi=30,Vi=200,Hi=50,Ui=({messages:e,tools:t,commands:r,verbose:i,toolJSX:a,toolUseConfirmQueue:s,inProgressToolUseIDs:l,isMessageSelectorVisible:f,conversationId:p,screen:h,streamingToolUses:g,showAllInTranscript:_=!1,agentDefinitions:y,hideLogo:b=!1,isLoading:x,hidePastThinking:w=!1,streamingThinking:T,streamingText:ee,unseenDivider:E,scrollRef:D,trackStickyPrompt:O,jumpRef:k,onSearchMatchesChange:A,scanElement:j,setPositions:M,disableRenderCap:P=!1,cursor:F=null,setCursor:I,cursorNavRef:re,renderRange:se})=>{let{columns:ce}=v(),le=ne(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),R=(0,Q.useMemo)(()=>Ce(e).filter(te),[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=R.length-1;r>=0;r--){let i=R[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return w||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[R,w,de]),me=(0,Q.useMemo)(()=>Te(R),[R]),he=(0,Q.useMemo)(()=>g.filter(e=>!l.has(e.contentBlock.id)&&!me.has(e.contentBlock.id)),[g,l,me]),ve=(0,Q.useMemo)(()=>he.flatMap(e=>{let t=De({content:[e.contentBlock]});return t.uuid=Oe(e.contentBlock.id,0),Ce([t])}),[he]),z=h===`transcript`,ye=(0,Q.useMemo)(()=>n(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),be=D!=null&&!ye,xe=z&&!_&&!be,Se=(0,Q.useRef)(null),B=(0,Q.useRef)(null),{collapsed:we,lookups:ke,hasTruncatedMessages:Ae,hiddenMessageCount:je}=(0,Q.useMemo)(()=>{let e=ue((i||N()?R:Ee(R,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!kr(e)&&ge(e,z)),ve),n=xe?e.slice(-30):e,r=xe&&e.length>Bi,{messages:a}=sn(n,t,i),o=$t(nn(Re(a,t)),i),s=S(R,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(B.current&&B.current.key===s)l=B.current.lookups;else if(B.current&&R.length>=B.current.normalizedCount&&n.length>=B.current.messageCount&&B.current.lastAssistantMsgId===c){let e=ae(B.current.lookups,B.current.normalizedCount,B.current.messageCount,R,n);e?(l=e,B.current={key:s,lookups:l,normalizedCount:R.length,messageCount:n.length,lastAssistantMsgId:c}):(l=L(R,n),B.current={key:s,lookups:l,normalizedCount:R.length,messageCount:n.length,lastAssistantMsgId:c})}else l=L(R,n),B.current={key:s,lookups:l,normalizedCount:R.length,messageCount:n.length,lastAssistantMsgId:c};let u=e.length-Bi;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:u}},[i,R,z,ve,xe,t]),V=(0,Q.useMemo)(()=>{let e=!be&&!P?Pi(we,Se):0;return se?we.slice(se[0],se[1]):e>0?we.slice(e):we},[we,se,be,P]),Ne=(0,Q.useMemo)(()=>new Set(g.map(e=>e.contentBlock.id)),[g]),{dividerBeforeIndex:Pe,selectedIdx:Ie}=(0,Q.useMemo)(()=>{if(!E&&!F)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=E?.firstUnseenUuid.slice(0,24);for(let r=0;r<V.length;r++){let i=V[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&F&&i.uuid===F.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[E,F,V]),[Le,ze]=(0,Q.useState)(()=>new Set),Be=(0,Q.useCallback)(e=>{let t=Fi(e);ze(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Ve=(0,Q.useCallback)(e=>Le.size>0&&Le.has(Fi(e)),[Le]),He=(0,Q.useRef)(ke);He.current=ke;let Ue=(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&&oe(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=He.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?vt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),We=(!a||!!a.shouldContinueAnimation)&&!s.length&&!f,Ge=l.size>0,{progress:Ke}=d(),qe=(0,Q.useRef)(null),Je=it().terminalProgressBarEnabled&&!Fe();(0,Q.useEffect)(()=>{let e=Je?Ge?`indeterminate`:`completed`:null;qe.current!==e&&(qe.current=e,Ke(e))},[Ke,Je,Ge]),(0,Q.useEffect)(()=>()=>Ke(null),[Ke]);let Ye=(0,Q.useCallback)(e=>`${e.uuid}-${p}`,[p]),Xe=(e,n)=>{let a=n>0?V[n-1]?.type:void 0,s=e.type===`user`&&a===`user`,u=e.type===`collapsed_read_search`&&(!!ee||yr(V,n,t,Ne)),d=V.length-1-n>0,f=Ye(e),p=(0,$.jsx)(Dr,{message:e,isUserContinuation:s,hasContentAfter:u,tools:t,commands:r,verbose:i||Ve(e)||F?.expanded===!0&&n===Ie,inProgressToolUseIDs:l,streamingToolUseIDs:Ne,screen:h,canAnimate:We,lastThinkingBlockId:fe,latestBashOutputUUID:pe,columns:ce,isLoading:x,lookups:ke,shouldCollapseDiffs:d},f),m=(0,$.jsx)(ie.Provider,{value:n===Ie,children:p},f);return E&&n===Pe?[(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(o,{title:`${E.count} new ${lt(E.count,`message`)}`,width:ce,color:`inactive`})},`unseen-divider`),m]:m},Ze=(0,Q.useRef)(new WeakMap),Qe=(0,Q.useCallback)(e=>{let n=Ze.current.get(e);if(n!==void 0)return n;let r=un(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=ke.toolUseByToolUseID.get(n.tool_use_id),a=(i&&vt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Ze.current.set(e,i),i},[t,ke]);return(0,$.jsxs)($.Fragment,{children:[!b&&!(se&&se[0]>0)&&(0,$.jsx)(zi,{agentDefinitions:y}),Ae&&(0,$.jsx)(o,{title:`${le} to show ${m.bold(je)} previous messages`,width:ce}),z&&_&&je>0&&!P&&(0,$.jsx)(o,{title:`${le} to hide ${m.bold(je)} previous messages`,width:ce}),be?(0,$.jsx)(_e.Provider,{value:!0,children:(0,$.jsx)(Ti,{messages:V,scrollRef:D,columns:ce,itemKey:Ye,renderItem:Xe,onItemClick:Be,isItemClickable:Ue,isItemExpanded:Ve,trackStickyPrompt:O,selectedIndex:Ie>=0?Ie:void 0,cursorNavRef:re,setCursor:I,jumpRef:k,onSearchMatchesChange:A,scanElement:j,setPositions:M,extractSearchText:Qe})}):V.flatMap(Xe),ee&&(0,$.jsx)(c,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(c,{flexDirection:`row`,children:[(0,$.jsx)(c,{minWidth:2,children:(0,$.jsx)(u,{color:`text`,children:$e})}),(0,$.jsx)(c,{flexDirection:`column`,children:(0,$.jsx)(Me,{children:ee})})]})}),de&&T&&(0,$.jsx)(c,{marginTop:1,children:(0,$.jsx)(C,{param:{type:`thinking`,thinking:T.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},Wi=Ri.memo(Ui,(e,t)=>{let n=Object.keys(e);for(let r of n)if(!(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`&&Ii(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{bi as a,ti as c,fi as i,ni as l,Gi as n,li as o,pi as r,ci as s,Wi as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-DL3w8VPk.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Tb as a,aw as o,jw as s,kw as c,nw as l,rw as u,wb as d}from"./loadAgentsDir-DGozQu_6.js";import{Wt as f,qt as p}from"./settings-CodSADx8.js";import{d as m,o as h}from"./config-CWPHVTic.js";import{i as g,n as _}from"./platform-DsMIk3eq.js";import{a as v,i as y,r as b}from"./terminalSetup-BgIXFBpd.js";function x(){return h().editorMode===`vim`}function S(){return f.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),m(),p()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:r,fixedWidth:i,gap:c,paddingX:l}=e,d=T(a(`app:toggleTranscript`,`Global`,`ctrl+o`)),f=T(a(`app:toggleTodos`,`Global`,`ctrl+t`)),p=T(a(`chat:undo`,`Chat`,`ctrl+_`)),m=T(a(`chat:stash`,`Chat`,`ctrl+s`)),h=T(a(`chat:cycleMode`,`Chat`,`shift+tab`)),g=T(a(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(a(`chat:fastMode`,`Chat`,`alt+o`)),y=T(a(`chat:externalEditor`,`Chat`,`ctrl+g`));T(a(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(a(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(t,{paddingX:l,flexDirection:`row`,gap:c,children:[(0,D.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`& for background`})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,D.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[h,` to auto-accept edits`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[d,` for verbose output`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[f,` to toggle tasks`]})}),(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:S()})})]}),(0,D.jsxs)(t,{flexDirection:`column`,children:[(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[p,` to undo`]})}),_()!==`windows`&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[g,` to switch model`]})}),o()&&u()&&(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[m,` to stash prompt`]})}),(0,D.jsx)(t,{children:(0,D.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),s()&&(0,D.jsx)(t,{children:(0,D.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{r(),g(),c(),d(),l(),w(),D=i()}));export{x as a,C as i,O as n,w as r,E as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,s as r}from"./envUtils-DfkgIdYf.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Kr as o,qr as s}from"./src-DL3w8VPk.js";import{Ft as c,K as l,Pt as u,at as d,ft as f,gt as p,rt as m}from"./state-BQ4BEGin.js";import{$ as h,$C as g,$g as _,$p as v,$w as y,Ai as ee,BC as b,Cs as x,FS as te,Fh as ne,Gu as S,HS as C,Hb as w,Ia as re,Ih as T,Ji as E,Js as ie,Ju as ae,Mi as D,Oa as O,Pa as k,Ph as oe,Ss as se,Ts as ce,Ub as le,Ug as ue,Vg as A,Wr as j,X as de,Xn as M,Y as fe,am as N,cy as P,ef as F,f_ as I,fa as pe,gn as me,gr as he,hC as L,hg as R,hn as z,ly as B,mg as ge,nf as V,nm as _e,nw as ve,oT as ye,ot as be,pC as xe,pS as Se,qs as Ce,sT as we,st as Te,ws as Ee,zC as De}from"./loadAgentsDir-DGozQu_6.js";import{n as H,t as Oe}from"./cwd-BvNt_018.js";import{J as U,Z as ke,d as Ae,h as je}from"./settings-CodSADx8.js";import{E as Me,T as Ne,d as W,o as Pe}from"./config-CWPHVTic.js";import{i as Fe,o as Ie,q as Le}from"./log-DoSpAwRP.js";import{f as G,s as Re,v as ze}from"./model-DpZaKZMb.js";import{at as K,bn as Be,nt as Ve,vn as He}from"./prompt-DzO1um1h.js";import{n as Ue,o as We,r as q}from"./MessageSelector-DW_itlX-.js";import{n as Ge,t as J}from"./systemTheme-Ceakddth.js";import{randomUUID as Y}from"crypto";n(),i(),o(),u(),H(),Ie(),je(),Me(),He(),W(),ye(),ve(),De(),C(),I(),K(),ue(),R(),N(),V(),Ce(),k(),E(),D(),he(),z(),de(),Te(),T(),B(),G(),_(),S();async function Ke({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?be(e,t,n,r):Promise.resolve([]),ne(),i===void 0?oe():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function qe({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=Re(),f=a(),{defaultSystemPrompt:p,userContext:m,systemContext:h}=await Ke({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),g=xe([...s===void 0?p:[s],...c?[c]:[]]),_=r.at(-1),v=_?.type===`assistant`&&_.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:g,userContext:m,systemContext:h,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(ae()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:P(),readFileState:i,getAppState:a,setAppState:o,messages:v,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:v}}ke(),w(),O(),J(),y();function X(e){return e.flatMap(e=>{if(!e)return[];switch(e.type){case`assistant`:return[{type:`assistant`,message:e.message,uuid:e.uuid,requestId:void 0,timestamp:new Date().toISOString()}];case`user`:return[{type:`user`,message:e.message,uuid:e.uuid??Y(),timestamp:e.timestamp??new Date().toISOString(),isMeta:e.isSynthetic}];default:return[]}})}function Je(e){let t=e.preservedSegment;return{trigger:e.trigger,pre_tokens:e.preTokens,...t&&{preserved_segment:{head_uuid:t.headUuid,anchor_uuid:t.anchorUuid,tail_uuid:t.tailUuid}}}}function Ye(e,t){let n=Se({content:s(e).replace(/<local-command-stdout>([\s\S]*?)<\/local-command-stdout>/,`$1`).replace(/<local-command-stderr>([\s\S]*?)<\/local-command-stderr>/,`$1`).trim()});return{type:`assistant`,content:n.message?.content,message:n.message,parent_tool_use_id:null,session_id:d(),uuid:t}}function Z(e){if(e)return{type:`rate_limit`,status:e.status,...e.resetsAt!==void 0&&{resetsAt:e.resetsAt},...e.rateLimitType!==void 0&&{rateLimitType:e.rateLimitType},...e.utilization!==void 0&&{utilization:e.utilization},...e.overageStatus!==void 0&&{overageStatus:e.overageStatus},...e.overageResetsAt!==void 0&&{overageResetsAt:e.overageResetsAt},...e.overageDisabledReason!==void 0&&{overageDisabledReason:e.overageDisabledReason},...e.isUsingOverage!==void 0&&{isUsingOverage:e.isUsingOverage},...e.surpassedThreshold!==void 0&&{surpassedThreshold:e.surpassedThreshold}}}u();function Xe(e){return e===`Agent`?U:e}function Ze(e){let t=Ae()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:Oe(),session_id:d(),tools:e.tools.map(e=>Xe(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:process.env.ANTHROPIC_API_KEY?`ANTHROPIC_API_KEY`:`none`,betas:m(),claude_code_version:`0.0.25`,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:Y()};return n.fast_mode_state=g(e.model,e.fastMode),n}u(),o(),Le(),B(),H(),ve(),E(),G(),_(),S(),x();var Qe=()=>{try{return q(),e(Ue)}catch{return null}},Q=class{constructor(e){a(this,`config`,void 0),a(this,`mutableMessages`,void 0),a(this,`abortController`,void 0),a(this,`permissionDenials`,void 0),a(this,`totalUsage`,void 0),a(this,`hasHandledOrphanedPermission`,!1),a(this,`readFileState`,void 0),a(this,`discoveredSkillNames`,new Set),a(this,`loadedNestedMemoryPaths`,new Set),this.config=e,this.mutableMessages=e.initialMessages??[],this.abortController=e.abortController??P(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=L}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:u,verbose:m=!1,thinkingConfig:_,maxTurns:y,maxBudgetUsd:x,taskBudget:ne,canUseTool:S,customSystemPrompt:C,appendSystemPrompt:w,userSpecifiedModel:T,fallbackModel:E,jsonSchema:D,getAppState:O,setAppState:k,replayUserMessages:oe=!1,includePartialMessages:ue=!1,agents:A=[],setSDKStatus:de,orphanedPermission:N}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],le(i);let P=!c(),I=Date.now(),he=async(e,t,n,r,i,a)=>{let o=await S(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:Xe(e.name),tool_use_id:i,tool_input:t}),o},R=O(),z=T?ze(T):Re(),B=_||(ae()===!1?{type:`disabled`}:{type:`adaptive`});F(`before_getSystemPrompt`);let V=typeof C==`string`?C:void 0,{defaultSystemPrompt:ve,userContext:ye,systemContext:be}=await Ke({tools:o,mainLoopModel:z,additionalWorkingDirectories:Array.from(R.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:u,customSystemPrompt:V});F(`after_getSystemPrompt`);let Se={...ye},Ce=V!==void 0&&Ne()?await we():null,Te=xe([...V===void 0?ve:[V],...Ce?[Ce]:[],...w?[w]:[]]),De=o.some(e=>Be(e,Ve));D&&De&&me(k,d());let H={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:m,mainLoopModel:z,thinkingConfig:B,mcpClients:u,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:w,agentDefinitions:{activeAgents:A,allAgents:[]},theme:Ge(Pe().theme),maxBudgetUsd:x},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{k(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{k(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:de};if(N&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of se(N,o,this.mutableMessages,H))yield e}let{messages:U,shouldQuery:ke,allowedTools:Ae,model:je,resultText:Me}=await We({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...H,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...U);let W=[...this.mutableMessages];if(P&&U.length>0){let e=j(W);r()||(await e,(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M())}let Ie=Qe(),Le=U.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Ie?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),G=oe?Le:[];k(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Ae}}}));let K=je??z;H={messages:W,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:m,mainLoopModel:K,thinkingConfig:B,mcpClients:u,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:w,theme:Ge(Pe().theme),agentDefinitions:{activeAgents:A,allAgents:[]},maxBudgetUsd:x},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:H.updateFileHistoryState,updateAttributionState:H.updateAttributionState,setSDKStatus:de},F(`before_skills_plugins`);let[He,{enabled:Ue}]=await Promise.all([ee(Oe()),re()]);if(F(`after_skills_plugins`),yield Ze({tools:o,mcpClients:u,model:K,permissionMode:R.toolPermissionContext.mode,commands:a,agents:A,skills:He,plugins:Ue,fastMode:R.fastMode}),F(`system_message_yielded`),!ke){for(let e of U)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:s(e.message.content)},session_id:d(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!e.isCompactSummary,isSynthetic:e.isMeta||e.isVisibleInTranscriptOnly}),e.type===`system`&&e.subtype===`local_command`&&typeof e.content==`string`&&(e.content.includes(`<local-command-stdout>`)||e.content.includes(`<local-command-stderr>`))&&(yield Ye(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:d(),uuid:e.uuid,compact_metadata:Je(t.compactMetadata)}}P&&(await j(W),(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-I,duration_api_ms:f(),num_turns:W.length-1,result:Me??``,stop_reason:null,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,fast_mode_state:g(K,R.fastMode),uuid:Y()};return}if(v()&&P){let e=Qe()?.selectableUserMessagesFilter??(e=>!0);U.filter(e).forEach(e=>{_e(e=>{k(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let q=L,J=1,qe=!1,X,Z=null,Q=Fe().at(-1),$e=D?pe(this.mutableMessages,Ve):0;for await(let e of ie({messages:W,systemPrompt:Te,userContext:Se,systemContext:be,canUseTool:he,toolUseContext:H,fallbackModel:E,querySource:`sdk`,maxTurns:y,taskBudget:ne})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(P&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await j(this.mutableMessages.slice(0,e+1))}}if(W.push(e),P&&(e.type===`assistant`?j(W):await j(W)),!qe&&G.length>0){qe=!0;for(let e of G)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:d(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&J++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Z=n),this.mutableMessages.push(t),yield*ce(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),P&&(W.push(t),j(W)),yield*ce(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*ce(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){q=L;let e=t.message;q=h(q,e.usage)}if(t.type===`message_delta`){q=h(q,t.usage);let e=t.delta;e.stop_reason!=null&&(Z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=fe(this.totalUsage,q)),ue&&(yield{type:`stream_event`,event:t,session_id:d(),parent_tool_use_id:null,uuid:Y()});break}case`attachment`:{let n=e;this.mutableMessages.push(n),P&&(W.push(n),j(W));let r=n.attachment;if(r.type===`structured_output`)X=r.data;else if(r.type===`max_turns_reached`){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-I,duration_api_ms:f(),is_error:!0,num_turns:r.turnCount,stop_reason:Z,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,fast_mode_state:g(K,R.fastMode),uuid:Y(),errors:[`Reached maximum number of turns (${r.maxTurns})`]};return}else oe&&r.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:r.prompt},session_id:d(),parent_tool_use_id:null,uuid:r.source_uuid||n.uuid,timestamp:n.timestamp,isReplay:!0});break}case`stream_request_start`:break;case`system`:{let t=e,n=this.config.snipReplay?.(t,this.mutableMessages);if(n!==void 0){n.executed&&(this.mutableMessages.length=0,this.mutableMessages.push(...n.messages));break}if(this.mutableMessages.push(t),t.subtype===`compact_boundary`&&t.compactMetadata){let e=t,n=this.mutableMessages.length-1;n>0&&this.mutableMessages.splice(0,n);let r=W.length-1;r>0&&W.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:d(),uuid:t.uuid,compact_metadata:Je(e.compactMetadata)}}if(t.subtype===`api_error`){let e=t;yield{type:`system`,subtype:`api_retry`,attempt:e.retryAttempt,max_retries:e.maxRetries,retry_delay_ms:e.retryInMs,error_status:e.error.status??null,error:ge(e.error),session_id:d(),uuid:t.uuid}}break}case`tool_use_summary`:{let t=e;yield{type:`tool_use_summary`,summary:t.summary,preceding_tool_use_ids:t.precedingToolUseIds,session_id:d(),uuid:t.uuid};break}}if(x!==void 0&&p()>=x){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-I,duration_api_ms:f(),is_error:!0,num_turns:J,stop_reason:Z,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,fast_mode_state:g(K,R.fastMode),uuid:Y(),errors:[`Reached maximum budget ($${x}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&D){let e=pe(this.mutableMessages,Ve)-$e,n=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=n){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-I,duration_api_ms:f(),is_error:!0,num_turns:J,stop_reason:Z,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,fast_mode_state:g(K,R.fastMode),uuid:Y(),errors:[`Failed to provide valid structured output after ${n} attempts`]};return}}}let $=W.findLast(e=>e.type===`assistant`||e.type===`user`),et=$?.type??`undefined`,tt=$?.type===`assistant`?b($.message.content)?.type??`none`:`n/a`;if(P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M(),!Ee($,Z)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-I,duration_api_ms:f(),is_error:!0,num_turns:J,stop_reason:Z,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,fast_mode_state:g(K,R.fastMode),uuid:Y(),errors:(()=>{let e=Fe(),t=Q?e.lastIndexOf(Q)+1:0;return[`[ede_diagnostic] result_type=${et} last_content_type=${tt} stop_reason=${Z}`,...e.slice(t).map(e=>e.error)]})()};return}let nt=``,rt=!1;if($.type===`assistant`){let e=b($.message.content);e?.type===`text`&&!te.has(e.text)&&(nt=e.text),rt=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:rt,duration_ms:Date.now()-I,duration_api_ms:f(),num_turns:J,result:nt,stop_reason:Z,session_id:d(),total_cost_usd:p(),usage:this.totalUsage,modelUsage:l(),permission_denials:this.permissionDenials,structured_output:X,fast_mode_state:g(K,R.fastMode),uuid:Y()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=P()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return d()}setModel(e){this.config.userSpecifiedModel=e}};async function*$e({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:f,mutableMessages:p=[],getReadFileCache:m,setReadFileCache:h,customSystemPrompt:g,appendSystemPrompt:_,userSpecifiedModel:v,fallbackModel:y,jsonSchema:ee,getAppState:b,setAppState:x,abortController:te,replayUserMessages:ne=!1,includePartialMessages:S=!1,handleElicitation:C,agents:w=[],setSDKStatus:re,orphanedPermission:T}){let E=new Q({cwd:i,tools:a,commands:e,mcpClients:o,agents:w??[],canUseTool:f,getAppState:b,setAppState:x,initialMessages:p,readFileCache:A(m()),customSystemPrompt:g,appendSystemPrompt:_,userSpecifiedModel:v,fallbackModel:y,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:ee,verbose:s,handleElicitation:C,replayUserMessages:ne,includePartialMessages:S,setSDKStatus:re,abortController:te,orphanedPermission:T});try{yield*E.submitMessage(t,{uuid:n,isMeta:r})}finally{h(E.getReadFileState())}}export{qe as a,Z as i,$e as n,X as r,Q as t};