@readmagic/workmate 0.0.11 → 0.0.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (405) hide show
  1. package/dist/chunks/{AddWorkspaceDirectory-ag2JTpmU.js → AddWorkspaceDirectory-CtRxzRny.js} +1 -1
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-_bI4jo_P.js +1 -0
  3. package/dist/chunks/{ClaudeMdExternalIncludesDialog-CSywJdVL.js → AgentsMdExternalIncludesDialog-_yJJ0wqu.js} +1 -1
  4. package/dist/chunks/{App-BuKmqFPm.js → App-DoAZ7CYS.js} +1 -1
  5. package/dist/chunks/{ApproveApiKey-M6U-NafA.js → ApproveApiKey-C8LwmDM2.js} +1 -1
  6. package/dist/chunks/ApproveApiKey-DQP3qmb0.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-CDA2noEk.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-B05t83wa.js → BypassPermissionsModeDialog-COI_V57z.js} +1 -1
  9. package/dist/chunks/ConsoleOAuthFlow-Dn8fO-o_.js +1 -0
  10. package/dist/chunks/{DiffDialog-DUbFrzKu.js → DiffDialog-CRWtQ1R5.js} +3 -3
  11. package/dist/chunks/Doctor-CZ513Df9.js +3 -0
  12. package/dist/chunks/Doctor-CzPvNZzF.js +1 -0
  13. package/dist/chunks/ExitFlow-BFeftDv0.js +2 -0
  14. package/dist/chunks/{Grove-BDoVj02t.js → Grove-DRZrhbF0.js} +1 -1
  15. package/dist/chunks/{HybridTransport-C_U0IJfz.js → HybridTransport-BadJQe6u.js} +2 -2
  16. package/dist/chunks/{InvalidConfigDialog-bih293Xt.js → InvalidConfigDialog-DQaT6aen.js} +1 -1
  17. package/dist/chunks/{InvalidSettingsDialog-Br8kQOHz.js → InvalidSettingsDialog-ISzcIGPU.js} +1 -1
  18. package/dist/chunks/MCPConnectionManager-BpjC7CEo.js +1 -0
  19. package/dist/chunks/MCPToolListView-Rb1Q--jG.js +1 -0
  20. package/dist/chunks/{McpParsingWarnings-COa71S9q.js → McpParsingWarnings-xv0RZCSL.js} +1 -1
  21. package/dist/chunks/MessageSelector-BHB55sZb.js +3 -0
  22. package/dist/chunks/Messages-CPX-nIdA.js +11 -0
  23. package/dist/chunks/Onboarding-CymgipoF.js +1 -0
  24. package/dist/chunks/{PromptInputFooterSuggestions-to5eYBvI.js → PromptInputFooterSuggestions-8-awCxOn.js} +1 -1
  25. package/dist/chunks/PromptInputHelpMenu-BP3UgCdi.js +1 -0
  26. package/dist/chunks/QueryEngine-HkswHUNv.js +1 -0
  27. package/dist/chunks/REPL-CZfg65kg.js +133 -0
  28. package/dist/chunks/REPL-eZsYNBfl.js +1 -0
  29. package/dist/chunks/RemoteSessionManager-B4jqKVd3.js +2 -0
  30. package/dist/chunks/ResumeConversation-B03XN_SP.js +1 -0
  31. package/dist/chunks/{SSETransport-DN4tCDEh.js → SSETransport-je346ofV.js} +1 -1
  32. package/dist/chunks/SearchExtraToolsTool-C85Sanww.js +1 -0
  33. package/dist/chunks/Settings-C8GKWod1.js +2 -0
  34. package/dist/chunks/{TeleportProgress-C2LQVLav.js → TeleportProgress-zmdAsogZ.js} +1 -1
  35. package/dist/chunks/{TeleportRepoMismatchDialog-BZL8Zblz.js → TeleportRepoMismatchDialog-CG32I4cO.js} +1 -1
  36. package/dist/chunks/{TeleportResumeWrapper-wPiIs8xg.js → TeleportResumeWrapper-2Yjr74Lq.js} +1 -1
  37. package/dist/chunks/{ThemePicker-BT_NaRQC.js → ThemePicker-p7_hHk1V.js} +1 -1
  38. package/dist/chunks/TrustDialog-BVcny9vs.js +1 -0
  39. package/dist/chunks/{ValidationErrorsList-C-hWdy_8.js → ValidationErrorsList-DSSUWdgd.js} +1 -1
  40. package/dist/chunks/{WelcomeV2-ZQRKlcT4.js → WelcomeV2-BnSYhyfu.js} +1 -1
  41. package/dist/chunks/add-dir-Bd7pilVx.js +1 -0
  42. package/dist/chunks/{agentDisplay-CuSHqgZc.js → agentDisplay-CfMLGPGH.js} +1 -1
  43. package/dist/chunks/{agents-CMC0iQP4.js → agents-BT82hwBN.js} +1 -1
  44. package/dist/chunks/agents-qR6r94-F.js +103 -0
  45. package/dist/chunks/allErrors-CS77lRvU.js +1 -0
  46. package/dist/chunks/api-C4VflFau.js +1 -0
  47. package/dist/chunks/{api-BbJfMXRS.js → api-DAubp5q9.js} +1 -1
  48. package/dist/chunks/auth-CNCehj7y.js +1 -0
  49. package/dist/chunks/auth-DrD9DW6X.js +1 -0
  50. package/dist/chunks/{auth-7mJGtlZp.js → auth-yDsvFcM7.js} +1 -1
  51. package/dist/chunks/{autoMode-CBtY7ACs.js → autoMode-C2lnBot9.js} +5 -5
  52. package/dist/chunks/backgroundHousekeeping-DbpTGbwl.js +1 -0
  53. package/dist/chunks/backgroundHousekeeping-SpTxViUq.js +17 -0
  54. package/dist/chunks/{banner-1Wyeyawe.js → banner-BcAM7iSx.js} +1 -1
  55. package/dist/chunks/bg-Ci7pG4eo.js +9 -0
  56. package/dist/chunks/{branch-k3kirqbA.js → branch-DJiMa8td.js} +1 -1
  57. package/dist/chunks/{break-cache-CAoZ9b72.js → break-cache-4rlQORVk.js} +2 -2
  58. package/dist/chunks/{bridgeConfig-UgaUfuP6.js → bridgeConfig-BB6Hgali.js} +1 -1
  59. package/dist/chunks/bridgeConfig-Ccm79Jze.js +1 -0
  60. package/dist/chunks/{bridgeMessaging-Ci5H68MX.js → bridgeMessaging-C9D0Lly2.js} +1 -1
  61. package/dist/chunks/{bridgePointer-BL8-lGvN.js → bridgePointer-DHWK3LEe.js} +1 -1
  62. package/dist/chunks/{bridgeStatusUtil-C36w15ge.js → bridgeStatusUtil-D8UbcVrZ.js} +1 -1
  63. package/dist/chunks/btw-BO2B23f-.js +1 -0
  64. package/dist/chunks/caches-BQmbXerw.js +1 -0
  65. package/dist/chunks/caches-Dtjmjm6G.js +1 -0
  66. package/dist/chunks/{capacityWake-BOySRJUJ.js → capacityWake-ByL6fM6I.js} +1 -1
  67. package/dist/chunks/{ccrClient-Br4LAofR.js → ccrClient-BG9HU_fW.js} +1 -1
  68. package/dist/chunks/{claudeDesktop-Bgds1-YT.js → claudeDesktop-Ct_hyICL.js} +1 -1
  69. package/dist/chunks/{clear-C4Vtnbye.js → clear-B4XN2fib.js} +1 -1
  70. package/dist/chunks/cliLaunch-OPOtzhvA.js +1 -0
  71. package/dist/chunks/client-7lIxWcaM.js +1 -0
  72. package/dist/chunks/client-B-2ccQZk.js +1 -0
  73. package/dist/chunks/{client-B9404qIP.js → client-BMA05FW8.js} +1 -1
  74. package/dist/chunks/commands-D_-v6_A0.js +1 -0
  75. package/dist/chunks/compact-kM0ETtB2.js +2 -0
  76. package/dist/chunks/config-9rLTDOYW.js +3 -0
  77. package/dist/chunks/config-Crf6Mzu3.js +1 -0
  78. package/dist/chunks/{config-kB2eazPX.js → config-DMKtiMzJ.js} +1 -1
  79. package/dist/chunks/{context-BN7DEjoH.js → context-BY5oO5is.js} +1 -1
  80. package/dist/chunks/{context-noninteractive-D91W2B8e.js → context-noninteractive-mAQt1p9l.js} +2 -2
  81. package/dist/chunks/context-noninteractive-tc4KTYfI.js +1 -0
  82. package/dist/chunks/conversation-CFIn-KsW.js +1 -0
  83. package/dist/chunks/conversation-DPI7VKBL.js +1 -0
  84. package/dist/chunks/createSSHSession-DjLSGm-0.js +6 -0
  85. package/dist/chunks/{createSession-DRqkLZWt.js → createSession-CftIZ3aq.js} +1 -1
  86. package/dist/chunks/createSession-CjdLcRec.js +1 -0
  87. package/dist/chunks/crossProjectResume-BJqXBzkf.js +40 -0
  88. package/dist/chunks/{cwd-Cfdf7z7s.js → cwd-Besi3Os3.js} +1 -1
  89. package/dist/chunks/cwd-DpqwaYHw.js +1 -0
  90. package/dist/chunks/datadog-BGati3aQ.js +1 -0
  91. package/dist/chunks/{debug-BecbSVoN.js → debug-Dr1SjdXn.js} +2 -2
  92. package/dist/chunks/{debugUtils-CmJfIUxW.js → debugUtils-cK-iOsEV.js} +1 -1
  93. package/dist/chunks/detached-CqfQYVOi.js +5 -0
  94. package/dist/chunks/detectRepository-BsKZDRoI.js +1 -0
  95. package/dist/chunks/{detectRepository-C15umvKN.js → detectRepository-CMEkS5_2.js} +1 -1
  96. package/dist/chunks/{diff-DeK4bwjw.js → diff-1HsxKGBh.js} +1 -1
  97. package/dist/chunks/{directoryCompletion-BJCu19HJ.js → directoryCompletion-ByBTSuLu.js} +1 -1
  98. package/dist/chunks/doctor-CJfvt9zR.js +1 -0
  99. package/dist/chunks/entry-CrZCZQQC.js +14 -0
  100. package/dist/chunks/{envUtils-BDhHQY0-.js → envUtils-DcaKZlRU.js} +1 -1
  101. package/dist/chunks/{esm-Ka3lhafK.js → esm-BkOWaWVb.js} +1 -1
  102. package/dist/chunks/{execFileNoThrow-DHyW8FMX.js → execFileNoThrow-mXq4K0rl.js} +1 -1
  103. package/dist/chunks/{execSyncWrapper-CDzB0BM1.js → execSyncWrapper-Ne33rRiD.js} +1 -1
  104. package/dist/chunks/exit-B8MA4Ltm.js +1 -0
  105. package/dist/chunks/{extraUsage-BrKbpBK-.js → extraUsage-0pUcYexI.js} +1 -1
  106. package/dist/chunks/extractMemories-DqhN0lba.js +1 -0
  107. package/dist/chunks/fast-DT5WDe3L.js +1 -0
  108. package/dist/chunks/{fast-DWn40OcQ.js → fast-VOu2FUlV.js} +1 -1
  109. package/dist/chunks/{fileSuggestions-C7Pwq2yj.js → fileSuggestions-Be-pyLLq.js} +1 -1
  110. package/dist/chunks/firstPartyEventLogger-B8RVGBQB.js +1 -0
  111. package/dist/chunks/{firstPartyEventLogger-BHjBQH0J.js → firstPartyEventLogger-aFhcruXA.js} +2 -2
  112. package/dist/chunks/{flushGate-DdJjxCes.js → flushGate-BUSrMj_6.js} +1 -1
  113. package/dist/chunks/{gemini-DHv2iVfy.js → gemini-DB4M-MYv.js} +1 -1
  114. package/dist/chunks/{generateSessionName-DhS_6oHd.js → generateSessionName-DhCypqJ_.js} +1 -1
  115. package/dist/chunks/{genericProcessUtils-B2HcDYhg.js → genericProcessUtils-Dc1pfb7J.js} +1 -1
  116. package/dist/chunks/git-Bs1vtuvX.js +1 -0
  117. package/dist/chunks/{git-DBlOv64X.js → git-CoQQ6YEf.js} +1 -1
  118. package/dist/chunks/{githubRepoPathMapping-CK56bUDe.js → githubRepoPathMapping-CmpEaQoo.js} +1 -1
  119. package/dist/chunks/goal-TxXtfkQ6.js +3 -0
  120. package/dist/chunks/{grok-BS57ZhyW.js → grok-D2a_J5wE.js} +1 -1
  121. package/dist/chunks/{grove-_zlQ83yR.js → grove-BnzBbGsX.js} +2 -2
  122. package/dist/chunks/{help-C_2tdXHC.js → help-C5ankDi4.js} +1 -1
  123. package/dist/chunks/{hooks-C7Bn7MBe.js → hooks-BZS105Rd.js} +3 -3
  124. package/dist/chunks/hooks-D-twhU_z.js +1 -0
  125. package/dist/chunks/{initReplBridge-NkZRcM77.js → initReplBridge-DL4klK0C.js} +1 -1
  126. package/dist/chunks/{install-Du-DSVzj.js → install-NZvHd_40.js} +1 -1
  127. package/dist/chunks/{instrumentation-DMs3b82f.js → instrumentation-CjBlVlFq.js} +4 -4
  128. package/dist/chunks/{job-rbX1VZmp.js → job-D502Zf8J.js} +1 -1
  129. package/dist/chunks/{jwtUtils-OzxN2zts.js → jwtUtils-FQWtM6iM.js} +1 -1
  130. package/dist/chunks/keybindings-D9Boc8FD.js +2 -0
  131. package/dist/chunks/{launchLocalMemory-BLRCK1_o.js → launchLocalMemory-DxC3LojF.js} +2 -2
  132. package/dist/chunks/{launchOnboarding-Al_X75Vz.js → launchOnboarding-BLp5k_H4.js} +1 -1
  133. package/dist/chunks/{loadAgentsDir-BL93ulMm.js → loadAgentsDir-BXtV2jiO.js} +597 -604
  134. package/dist/chunks/loadAgentsDir-BjsAQWqt.js +1 -0
  135. package/dist/chunks/{loadPluginHooks-B0au35a4.js → loadPluginHooks-Dt3XQ-3N.js} +1 -1
  136. package/dist/chunks/{localSearch-C5ipegd9.js → localSearch-CeP4ef0a.js} +1 -1
  137. package/dist/chunks/localSearch-Cz8Ot7k2.js +1 -0
  138. package/dist/chunks/{log-Dauqle-Z.js → log-27kCA_9u.js} +1 -1
  139. package/dist/chunks/{logoV2Utils-CkvOihX7.js → logoV2Utils-CEnU8qad.js} +1 -1
  140. package/dist/chunks/{magicDocs-DLav5QK0.js → magicDocs-YtfrqVC6.js} +3 -3
  141. package/dist/chunks/main-CGLCy2pM.js +31 -0
  142. package/dist/chunks/{main-CVNWNAoh.js → main-CkjTzYj1.js} +42 -42
  143. package/dist/chunks/{managedEnv-DJSCuqCb.js → managedEnv-B-BNY0xC.js} +1 -1
  144. package/dist/chunks/managedEnv-K9Si1UuL.js +1 -0
  145. package/dist/chunks/{mappers-DQxMcezy.js → mappers-IuJeXgvr.js} +1 -1
  146. package/dist/chunks/mcp-DMBoeQzm.js +6 -0
  147. package/dist/chunks/mcp-TMOPfLcW.js +1 -0
  148. package/dist/chunks/mcp-x5rgv-uv.js +2 -0
  149. package/dist/chunks/{memoize-FeyE7JEh.js → memoize-Co4vS6UF.js} +1 -1
  150. package/dist/chunks/memory-DDUoR63T.js +1 -0
  151. package/dist/chunks/{mode-Bl2RZC8M.js → mode-GzBwK--u.js} +2 -2
  152. package/dist/chunks/model-BydaMaPr.js +1 -0
  153. package/dist/chunks/model-CDnVaVDR.js +1 -0
  154. package/dist/chunks/model-CIvbC7rW.js +1 -0
  155. package/dist/chunks/{modelOptions-BtEZe5BB.js → modelOptions-ut0xePEe.js} +1 -1
  156. package/dist/chunks/{nativeInstaller-BEwayifa.js → nativeInstaller-fgCMR_c0.js} +1 -1
  157. package/dist/chunks/oauth-D38aRTUb.js +1 -0
  158. package/dist/chunks/oauth-U649LV5H.js +1 -0
  159. package/dist/chunks/{observationStore-BpjlK0pG.js → observationStore-D0rm3GhP.js} +1 -1
  160. package/dist/chunks/omit-D4Udf-p-.js +1 -0
  161. package/dist/chunks/{onChangeAppState-ZdwI7boX.js → onChangeAppState-WbvtqDtk.js} +1 -1
  162. package/dist/chunks/{openai-DWs4D-nQ.js → openai-DaVFXyBB.js} +3 -3
  163. package/dist/chunks/{panel-CoNfXy3K.js → panel-CoF2a-h4.js} +1 -1
  164. package/dist/chunks/parser-B2PlJg4C.js +1 -0
  165. package/dist/chunks/{parser-BH4u7QiV.js → parser-CUUiH40T.js} +1 -1
  166. package/dist/chunks/partition-CzW_31Y1.js +1 -0
  167. package/dist/chunks/permissions-BT3lxYBM.js +3 -0
  168. package/dist/chunks/{pidLock-DgOBc1Xo.js → pidLock-d1VPd6CG.js} +2 -2
  169. package/dist/chunks/{plan-BNYDTnQd.js → plan-M9DG3AqN.js} +1 -1
  170. package/dist/chunks/{platform-B0uTQc9P.js → platform-Dg1c9F_1.js} +1 -1
  171. package/dist/chunks/plugin-BiNHuq3h.js +17 -0
  172. package/dist/chunks/{pluginAutoupdate-BBU9Jn4p.js → pluginAutoupdate-B5lel6s5.js} +1 -1
  173. package/dist/chunks/{pluginBlocklist-DXQlbG0P.js → pluginBlocklist-CNGmIlwU.js} +1 -1
  174. package/dist/chunks/pluginCliCommands-WLOEhb2M.js +1 -0
  175. package/dist/chunks/{pluginFlagging-DcJ_FQuv.js → pluginFlagging-CXSSOj4J.js} +1 -1
  176. package/dist/chunks/pluginOperations-BFbty6WT.js +2 -0
  177. package/dist/chunks/{pluginStartupCheck-CKBFaMFr.js → pluginStartupCheck-BEd0VeQC.js} +1 -1
  178. package/dist/chunks/pluginStartupCheck-Bcdxg484.js +1 -0
  179. package/dist/chunks/{plugins-CBW7kPyp.js → plugins-BMZ3aYKP.js} +4 -4
  180. package/dist/chunks/poorMode-Djw0P9Gu.js +1 -0
  181. package/dist/chunks/{poorMode-B_xEvuEV.js → poorMode-DxgO_bUb.js} +1 -1
  182. package/dist/chunks/print-DmoLcwVq.js +26 -0
  183. package/dist/chunks/processBashCommand-B-VqME9O.js +1 -0
  184. package/dist/chunks/processSlashCommand-D6zEooTy.js +5 -0
  185. package/dist/chunks/{projectContext-CIxul6vA.js → projectContext-BN2ZWzOG.js} +1 -1
  186. package/dist/chunks/{projectContext-RUMJB798.js → projectContext-Bw3o5BrN.js} +1 -1
  187. package/dist/chunks/prompt-C3RRe4kW.js +1 -0
  188. package/dist/chunks/{prompt-Dx7IWhBt.js → prompt-CRc2QEZ5.js} +4 -4
  189. package/dist/chunks/prompt-EtAanewG.js +1 -0
  190. package/dist/chunks/{promptEditor-WCkmpejM.js → promptEditor-Bo1d8ZLq.js} +2 -2
  191. package/dist/chunks/{protocolHandler-BiVWrpHi.js → protocolHandler-B83fCYI4.js} +1 -1
  192. package/dist/chunks/{proxy-CVn7o19p.js → proxy-BEKNaTXI.js} +1 -1
  193. package/dist/chunks/rcDebugLog-DSchf3Hs.js +1 -0
  194. package/dist/chunks/{reconciler-C2Nd_e4n.js → reconciler-BGav_ezX.js} +1 -1
  195. package/dist/chunks/refresh-DumNiLvM.js +1 -0
  196. package/dist/chunks/{registerProtocol-E0Iu5hEx.js → registerProtocol-DduKPsn_.js} +1 -1
  197. package/dist/chunks/{reload-plugins-D-3AUT9g.js → reload-plugins-DNEgQ5vo.js} +1 -1
  198. package/dist/chunks/{remoteBridgeCore-CV6we3ZA.js → remoteBridgeCore-BGOqHADF.js} +1 -1
  199. package/dist/chunks/{remoteManagedSettings-D26Q09-7.js → remoteManagedSettings-26nhzuca.js} +1 -1
  200. package/dist/chunks/{rename-CSavuBIE.js → rename-BPknfVGF.js} +1 -1
  201. package/dist/chunks/{renderOptions-DDLbSMQU.js → renderOptions-45A-EdsK.js} +1 -1
  202. package/dist/chunks/resume-DGz04xDh.js +2 -0
  203. package/dist/chunks/ripgrep-BLQnqPnE.js +1 -0
  204. package/dist/chunks/{ripgrep-C1ydIMzT.js → ripgrep-DQ_ILUJV.js} +1 -1
  205. package/dist/chunks/{runtimeObserver-L7pSIWBT.js → runtimeObserver-BZrF3GnQ.js} +4 -4
  206. package/dist/chunks/{runtimeObserver-OU8KrZQG.js → runtimeObserver-CBV-7-w7.js} +1 -1
  207. package/dist/chunks/sandbox-adapter-DUqeqkQD.js +1 -0
  208. package/dist/chunks/sandbox-toggle-D61gVqcT.js +1 -0
  209. package/dist/chunks/searchExtraTools-CgsV6kb1.js +1 -0
  210. package/dist/chunks/{session-DUYsfPy_.js → session-Dy-_R7KP.js} +2 -2
  211. package/dist/chunks/sessionFileAccessHooks-BJlrZaRD.js +1 -0
  212. package/dist/chunks/sessionObserver-BGYoLRGx.js +1 -0
  213. package/dist/chunks/{sessionObserver-Dv3Ba8eA.js → sessionObserver-CyLpHSkw.js} +2 -2
  214. package/dist/chunks/{sessionState-D-SaBzWD.js → sessionState-DSWN4tMV.js} +1 -1
  215. package/dist/chunks/sessionStorage-zJ1esSCE.js +1 -0
  216. package/dist/chunks/{sessionStoragePortable-JZnGwqUM.js → sessionStoragePortable-BhkGMZWp.js} +1 -1
  217. package/dist/chunks/{sessionTitle-uCuYaNif.js → sessionTitle-L5tyJgdU.js} +2 -2
  218. package/dist/chunks/{sessionTracing-Bqb3vJTt.js → sessionTracing-DpHGGIZm.js} +1 -1
  219. package/dist/chunks/settings-3ionQKNv.js +1 -0
  220. package/dist/chunks/settings-DiBMs2gM.js +20 -0
  221. package/dist/chunks/settingsSync-dBqlrbcU.js +1 -0
  222. package/dist/chunks/setup-zf3v3ICe.js +3 -0
  223. package/dist/chunks/{shadowedRuleDetection-BzAZ57p2.js → shadowedRuleDetection-DZ0AA2Rw.js} +1 -1
  224. package/dist/chunks/{shellQuote-DS6WrivY.js → shellQuote-C_I6DHLV.js} +1 -1
  225. package/dist/chunks/{sideQuestion-CvMBBjI8.js → sideQuestion-BYT8FdPF.js} +1 -1
  226. package/dist/chunks/sinks-DppGvgz1.js +1 -0
  227. package/dist/chunks/{sinks-f7qYjbKJ.js → sinks-mFsijQ_S.js} +2 -2
  228. package/dist/chunks/skillChangeDetector-D-iq09Xs.js +1 -0
  229. package/dist/chunks/{skillGapStore-CqaT8c0C.js → skillGapStore-DQXHqoP7.js} +2 -2
  230. package/dist/chunks/{skillLifecycle-CnR8IqJM.js → skillLifecycle-BG_RnGSh.js} +2 -2
  231. package/dist/chunks/{skillSearchPanel-D9qrOXpI.js → skillSearchPanel-DxYP4Q6R.js} +5 -5
  232. package/dist/chunks/skills-BD-2ofXA.js +1 -0
  233. package/dist/chunks/startupProfiler-CUlV07MD.js +1 -0
  234. package/dist/chunks/{startupProfiler-CmH_aVy2.js → startupProfiler-Dc5r6LgE.js} +2 -2
  235. package/dist/chunks/{state-BemZdQIl.js → state-BPFYBqm1.js} +1 -1
  236. package/dist/chunks/state-CsdHk8n-.js +1 -0
  237. package/dist/chunks/{stats-B8uQ-UDi.js → stats-BkadEKa-.js} +1 -1
  238. package/dist/chunks/{status-D6KlRJmR.js → status-BmHu-c7I.js} +2 -2
  239. package/dist/chunks/{status-BekdWoIj.js → status-CrmnCDIE.js} +1 -1
  240. package/dist/chunks/{statusNoticeHelpers-BMM8_uJ1.js → statusNoticeHelpers-DakAVtQO.js} +1 -1
  241. package/dist/chunks/{stringUtils-C8PaYpQF.js → stringUtils-Df-Lnjxd.js} +1 -1
  242. package/dist/chunks/{subprocessEnv-Ci8VV_bi.js → subprocessEnv-CNBOhlDV.js} +1 -1
  243. package/dist/chunks/subprocessEnv-DtBCqQIo.js +1 -0
  244. package/dist/chunks/switcher-Dm646gO5.js +1 -0
  245. package/dist/chunks/switcher-sYTxnJQA.js +1 -0
  246. package/dist/chunks/{syncCache-ClP9aBqK.js → syncCache-BofuFJEe.js} +1 -1
  247. package/dist/chunks/{tasks-Dmh6qikm.js → tasks-NpI1iEem.js} +1 -1
  248. package/dist/chunks/teleport-Bs3kEipi.js +1 -0
  249. package/dist/chunks/{templateJobs-CxqU-s5i.js → templateJobs-C94jEE6O.js} +2 -2
  250. package/dist/chunks/{terminalSetup-BKGcmlWp.js → terminalSetup-CbXKCpWM.js} +1 -1
  251. package/dist/chunks/{terminalSetup-Cy19F1Js.js → terminalSetup-fwhFTxGi.js} +1 -1
  252. package/dist/chunks/{theme-U7lMFHQ0.js → theme-CEi3b_8f.js} +1 -1
  253. package/dist/chunks/tmux-d3cNCIZA.js +1 -0
  254. package/dist/chunks/{toolEventObserver-D9qjoVl5.js → toolEventObserver-DlL9CHmI.js} +1 -1
  255. package/dist/chunks/toolPool-DIT_uhtD.js +1 -0
  256. package/dist/chunks/trustedDevice-BokywSKL.js +1 -0
  257. package/dist/chunks/{trustedDevice-DL0pWP4_.js → trustedDevice-Bzz03jCy.js} +1 -1
  258. package/dist/chunks/{types-DafcFtmb.js → types-BJ7qTz75.js} +1 -1
  259. package/dist/chunks/{udsClient-CWnfsgFP.js → udsClient-CF8BmZgN.js} +1 -1
  260. package/dist/chunks/{updateCCB-C6XftzIG.js → updateCCB-CzBxsuJe.js} +6 -6
  261. package/dist/chunks/{upstreamproxy-CXmjxHpl.js → upstreamproxy-BuBFDFAD.js} +1 -1
  262. package/dist/chunks/{useExitOnCtrlCDWithKeybindings-DEEJhm_W.js → useExitOnCtrlCDWithKeybindings-BHQfwlAl.js} +1 -1
  263. package/dist/chunks/useMainLoopModel-BkyIIW9t.js +1 -0
  264. package/dist/chunks/useManagePlugins-BWROoGDs.js +1 -0
  265. package/dist/chunks/{useMergedTools-DbhqKk1-.js → useMergedTools-CHxnwR7R.js} +1 -1
  266. package/dist/chunks/{useSearchInput-gUDbkLaC.js → useSearchInput-q2CFPU4W.js} +1 -1
  267. package/dist/chunks/useSettingsErrors-CPVQbsqq.js +1 -0
  268. package/dist/chunks/{userAgent-CU7Ndh79.js → userAgent-B7WkjI6I.js} +1 -1
  269. package/dist/chunks/util-BfqXOA-P.js +1 -0
  270. package/dist/chunks/{validatePlugin-y_O_tCEL.js → validatePlugin-jrcrYEIu.js} +1 -1
  271. package/dist/chunks/{vim-w37BfGZ5.js → vim-C4Hs5U2h.js} +1 -1
  272. package/dist/chunks/{which-BRWBO7Gu.js → which-mplwBbc0.js} +1 -1
  273. package/dist/chunks/windowsPaths-B8p9tFRF.js +1 -0
  274. package/dist/chunks/{windowsPaths-DtWHLjmE.js → windowsPaths-C7Mdo9aU.js} +1 -1
  275. package/dist/chunks/{workSecret-BEhXgH2M.js → workSecret-XLodD7tw.js} +1 -1
  276. package/dist/chunks/workerRegistry-Cfo7bKlm.js +6 -0
  277. package/dist/chunks/worktree-D0k_pCEz.js +1 -0
  278. package/dist/cli.js +1 -1
  279. package/package.json +1 -1
  280. package/dist/chunks/ApproveApiKey-CIWOi_7v.js +0 -1
  281. package/dist/chunks/BackgroundTasksDialog-Pnpl3Ixx.js +0 -2
  282. package/dist/chunks/ClaudeMdExternalIncludesDialog-D-w166RC.js +0 -1
  283. package/dist/chunks/ConsoleOAuthFlow-CV6PcJOP.js +0 -1
  284. package/dist/chunks/Doctor-BcnUfJ4I.js +0 -1
  285. package/dist/chunks/Doctor-Dz4TuYas.js +0 -3
  286. package/dist/chunks/ExitFlow-BwyAtIHx.js +0 -2
  287. package/dist/chunks/MCPConnectionManager-B9n4SXN4.js +0 -1
  288. package/dist/chunks/MCPToolListView-DJ06N1DG.js +0 -1
  289. package/dist/chunks/MessageSelector-o4ULADFg.js +0 -3
  290. package/dist/chunks/Messages-qqwHuAW5.js +0 -11
  291. package/dist/chunks/Onboarding-BzuQjney.js +0 -1
  292. package/dist/chunks/PromptInputHelpMenu-CfMFx-TF.js +0 -1
  293. package/dist/chunks/QueryEngine-Dt0BKUeF.js +0 -1
  294. package/dist/chunks/REPL-CUbEDqEl.js +0 -133
  295. package/dist/chunks/REPL-DMaKNhTa.js +0 -1
  296. package/dist/chunks/RemoteSessionManager-Bf44A0Ol.js +0 -2
  297. package/dist/chunks/ResumeConversation-Ctw5Q1g9.js +0 -1
  298. package/dist/chunks/SearchExtraToolsTool-C80OdtPZ.js +0 -1
  299. package/dist/chunks/Settings-DfdcmvOV.js +0 -2
  300. package/dist/chunks/TrustDialog-ACaJ_m7A.js +0 -1
  301. package/dist/chunks/add-dir-SAKTkw0S.js +0 -1
  302. package/dist/chunks/agents-ZgRKpjHv.js +0 -103
  303. package/dist/chunks/allErrors-_cOQksHC.js +0 -1
  304. package/dist/chunks/api-DS1MiW01.js +0 -1
  305. package/dist/chunks/auth-DGZzCbU0.js +0 -1
  306. package/dist/chunks/auth-DN1MUpB8.js +0 -1
  307. package/dist/chunks/autonomy-DuQmYhq6.js +0 -15
  308. package/dist/chunks/autonomy-lJV7yWUl.js +0 -1
  309. package/dist/chunks/autonomyPanel-DAQm6lDz.js +0 -1
  310. package/dist/chunks/backgroundHousekeeping-BTy71bcY.js +0 -1
  311. package/dist/chunks/backgroundHousekeeping-Cc7Ag7JG.js +0 -17
  312. package/dist/chunks/bg-CJ0YWFli.js +0 -9
  313. package/dist/chunks/bg-CeUrRz_7.js +0 -1
  314. package/dist/chunks/bridgeConfig-CzRUPn-D.js +0 -1
  315. package/dist/chunks/btw-nVoVuIae.js +0 -1
  316. package/dist/chunks/caches-B8sM3Zys.js +0 -1
  317. package/dist/chunks/caches-Bp9MZ7IE.js +0 -1
  318. package/dist/chunks/cliLaunch-BTpfAGGI.js +0 -1
  319. package/dist/chunks/client-BCAbKdNz.js +0 -1
  320. package/dist/chunks/client-CJE6gEvU.js +0 -1
  321. package/dist/chunks/commands-DL-BzoMQ.js +0 -1
  322. package/dist/chunks/compact-Cx7BPXLU.js +0 -2
  323. package/dist/chunks/config-S5OW4Xqr.js +0 -1
  324. package/dist/chunks/config-aRiTrtCv.js +0 -3
  325. package/dist/chunks/context-noninteractive-DPacEFJ1.js +0 -1
  326. package/dist/chunks/conversation-D5Nbu9eT.js +0 -1
  327. package/dist/chunks/conversation-hcUx9e-C.js +0 -1
  328. package/dist/chunks/createSSHSession-DecOR6M5.js +0 -6
  329. package/dist/chunks/createSession-D27zvmOs.js +0 -1
  330. package/dist/chunks/crossProjectResume-Bw3U0Ty6.js +0 -40
  331. package/dist/chunks/cwd-ClLru_7T.js +0 -1
  332. package/dist/chunks/datadog-bm551AVV.js +0 -1
  333. package/dist/chunks/detached-CIyF0M5O.js +0 -5
  334. package/dist/chunks/detectRepository-DDfLfKcM.js +0 -1
  335. package/dist/chunks/doctor-BJORBomU.js +0 -1
  336. package/dist/chunks/entry-mdegyj8z.js +0 -14
  337. package/dist/chunks/exit-CF3KBl-S.js +0 -1
  338. package/dist/chunks/extractMemories-4lBn134y.js +0 -1
  339. package/dist/chunks/fast-0Vi354KI.js +0 -1
  340. package/dist/chunks/firstPartyEventLogger-BNBnLYPK.js +0 -1
  341. package/dist/chunks/git-DF4RFFaT.js +0 -1
  342. package/dist/chunks/goal-BZG4gtnb.js +0 -3
  343. package/dist/chunks/hooks-DT80Arzc.js +0 -1
  344. package/dist/chunks/keybindings-CwdC_8S0.js +0 -2
  345. package/dist/chunks/loadAgentsDir-eVKq8efm.js +0 -1
  346. package/dist/chunks/localSearch-CZlFfR_X.js +0 -1
  347. package/dist/chunks/main-LMyE3jXY.js +0 -31
  348. package/dist/chunks/managedEnv-CYepSnm8.js +0 -1
  349. package/dist/chunks/mcp-BAbbEaBA.js +0 -1
  350. package/dist/chunks/mcp-Ct4Sum6A.js +0 -6
  351. package/dist/chunks/mcp-D5HkCqUh.js +0 -2
  352. package/dist/chunks/memory-COa7aUbx.js +0 -1
  353. package/dist/chunks/model-B7rtZ7KV.js +0 -1
  354. package/dist/chunks/model-Bgh_r4lg.js +0 -1
  355. package/dist/chunks/model-DiuEAv6h.js +0 -1
  356. package/dist/chunks/oauth-BN2I0_jl.js +0 -1
  357. package/dist/chunks/oauth-C9VBDB0Y.js +0 -1
  358. package/dist/chunks/omit--yH_T4rf.js +0 -1
  359. package/dist/chunks/parser-BMIaRErw.js +0 -1
  360. package/dist/chunks/partition-DLcW5Oo_.js +0 -1
  361. package/dist/chunks/permissions-CaucYK3s.js +0 -3
  362. package/dist/chunks/plugin-BN-of1_H.js +0 -17
  363. package/dist/chunks/pluginCliCommands-CfdVNs8D.js +0 -1
  364. package/dist/chunks/pluginOperations-DnhzFbYI.js +0 -2
  365. package/dist/chunks/pluginStartupCheck-CpNB4jxG.js +0 -1
  366. package/dist/chunks/poorMode-yH1o41cQ.js +0 -1
  367. package/dist/chunks/print-BZOx09SU.js +0 -26
  368. package/dist/chunks/processBashCommand-dcCNCiBp.js +0 -1
  369. package/dist/chunks/processSlashCommand-YDiM63Qr.js +0 -5
  370. package/dist/chunks/prompt-CXGy0llt.js +0 -1
  371. package/dist/chunks/prompt-DovNDmcx.js +0 -1
  372. package/dist/chunks/rcDebugLog-CARUIORE.js +0 -1
  373. package/dist/chunks/refresh-B84H2Ezd.js +0 -1
  374. package/dist/chunks/resume-CROylN3J.js +0 -2
  375. package/dist/chunks/ripgrep-2M1GkXqJ.js +0 -1
  376. package/dist/chunks/sandbox-adapter-6UwMLh6e.js +0 -1
  377. package/dist/chunks/sandbox-toggle-YrQNWGsr.js +0 -1
  378. package/dist/chunks/searchExtraTools-Bdv5HJ74.js +0 -1
  379. package/dist/chunks/sessionFileAccessHooks-Czen7Ejz.js +0 -1
  380. package/dist/chunks/sessionObserver-B0zucj_c.js +0 -1
  381. package/dist/chunks/sessionStorage-BM1x51Z7.js +0 -1
  382. package/dist/chunks/settings-BG15IFYx.js +0 -1
  383. package/dist/chunks/settings-D4CpDv2y.js +0 -20
  384. package/dist/chunks/settingsSync-BSrpnyqo.js +0 -1
  385. package/dist/chunks/setup-C62oq4AZ.js +0 -3
  386. package/dist/chunks/sinks-WJ7nzLQs.js +0 -1
  387. package/dist/chunks/skillChangeDetector-U5kRU5nd.js +0 -1
  388. package/dist/chunks/skills-BgcFh0vy.js +0 -1
  389. package/dist/chunks/startupProfiler-B4HBBbHN.js +0 -1
  390. package/dist/chunks/state-BAGmpVBn.js +0 -1
  391. package/dist/chunks/state-D_lk6z-C.js +0 -1
  392. package/dist/chunks/subprocessEnv-CZkA9Cdp.js +0 -1
  393. package/dist/chunks/switcher-Ck9CrXrr.js +0 -1
  394. package/dist/chunks/switcher-DnAhkyIn.js +0 -1
  395. package/dist/chunks/teleport-DH3IuAUQ.js +0 -1
  396. package/dist/chunks/tmux-D5EvHWi3.js +0 -1
  397. package/dist/chunks/toolPool-69mfSPAs.js +0 -1
  398. package/dist/chunks/trustedDevice-B6AKlsl_.js +0 -1
  399. package/dist/chunks/useMainLoopModel-6w7mhwhU.js +0 -1
  400. package/dist/chunks/useManagePlugins-CjnsO-Of.js +0 -1
  401. package/dist/chunks/useSettingsErrors-CgPad-H0.js +0 -1
  402. package/dist/chunks/util-B4oMhJKh.js +0 -1
  403. package/dist/chunks/windowsPaths-BY-IVNwQ.js +0 -1
  404. package/dist/chunks/workerRegistry-Bq9bS5pw.js +0 -6
  405. package/dist/chunks/worktree-4SUJ4dtz.js +0 -1
@@ -0,0 +1,11 @@
1
+ import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-DcaKZlRU.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{$h as s,Ba as c,Bg as l,Bu as u,CT as d,DC as f,Da as p,Dp as m,EC as h,Ea as g,Fa as _,Ff as v,Gf as y,Hf as b,IC as x,Ia as ee,If as S,Ja as C,Jf as w,Kf as te,MC as T,Ma as E,Na as ne,OC as re,Op as ie,Pa as ae,Pf as D,Qa as oe,Ru as O,SC as k,SS as A,TC as j,Ua as se,Xf as M,Yf as N,Za as ce,_a as le,aa as ue,ab as P,bS as de,bT as fe,bp as pe,eg as me,eo as he,fa as ge,gT as _e,hT as ve,ia as ye,ib as be,jC as xe,nh as Se,oa as Ce,og as we,pa as Te,qf as Ee,sb as F,sg as De,tb as Oe,th as ke,wC as Ae,xS as je,yp as Me,za as Ne,zu as Pe}from"./loadAgentsDir-BXtV2jiO.js";import{C as Fe,Gr as I,I as L,N as Ie,P as R,Pn as Le,Rn as Re,di as ze,fi as z,j as Be,mt as Ve,ot as He,t as B,ui as Ue,xt as We}from"./src-P_wYS_NJ2.js";import{t as V}from"./jsx-runtime-Bb4Xn-E0.js";import{B as Ge,Wt as Ke}from"./state-BPFYBqm1.js";import{n as qe,t as Je}from"./cwd-Besi3Os3.js";import{a as Ye,c as Xe,i as Ze,n as Qe,o as $e}from"./debug-Dr1SjdXn.js";import{Ht as et,Wt as tt,g as nt,n as rt}from"./settings-DiBMs2gM.js";import{c as it,h as at,y as ot}from"./config-9rLTDOYW.js";import{B as st,L as ct,R as lt,q as ut}from"./log-27kCA_9u.js";import{b as dt,f as ft,m as pt,v as mt}from"./startupProfiler-Dc5r6LgE.js";import{l as ht,o as gt}from"./stringUtils-Df-Lnjxd.js";import{Bt as _t,Dt as vt,E as yt,Gt as bt,St as xt,Tt as St,_ as Ct,_n as wt,b as Tt,vn as Et}from"./model-CDnVaVDR.js";import{bn as Dt,vn as Ot}from"./prompt-CRc2QEZ5.js";import{d as kt,f as At,h as jt,p as Mt}from"./terminalSetup-fwhFTxGi.js";import{_ as Nt,x as Pt}from"./sessionState-DSWN4tMV.js";import{n as Ft,t as It}from"./systemTheme-Ceakddth.js";import{n as Lt,r as Rt}from"./PromptInputFooterSuggestions-8-awCxOn.js";import{n as zt,t as Bt}from"./useMainLoopModel-BkyIIW9t.js";import{n as Vt,t as Ht}from"./modalContext-CUThy6Ph.js";import{n as Ut,r as Wt,t as Gt}from"./statusNoticeHelpers-DakAVtQO.js";import{a as Kt,c as qt,i as Jt,l as Yt,n as Xt,o as Zt,r as Qt,t as $t,u as en}from"./logoV2Utils-CEnU8qad.js";import{homedir as tn}from"os";import{relative as nn}from"path";import{fileURLToPath as rn}from"url";function an(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var on=t((()=>{}));function sn(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`)||p(t.text,`status`)!==`completed`?!1:p(t.text,`summary`)?.startsWith(`Background command `)??!1}function cn(e,t){if(!me()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(sn(t)){let i=0;for(;r<e.length&&sn(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${st}><${ct}>completed</${ct}><${lt}>${i} background commands completed</${lt}></${st}>`}]}})}else n.push(t),r++}return n}var ln=t((()=>{ut(),l(),s(),c()}));function un(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function dn(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(un(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!un(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 fn=t((()=>{}));function pn(e){let t=gn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),gn.set(e,t)),t}function mn(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 hn(e,t,n=!1){if(n)return{messages:e};let r=pn(t),i=new Map;for(let t of e){let e=mn(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=mn(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=mn(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 gn,_n=t((()=>{gn=new WeakMap}));function vn(e){let t=wn.get(e);if(t!==void 0)return t;let n=yn(e).toLowerCase();return wn.set(e,n),n}function yn(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=Cn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?Cn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(xn(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`?[bn(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(Sn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function bn(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 xn(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
8
+ `+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
9
+ `))}return n.join(`
10
+ `)}var Sn,Cn,wn,Tn=t((()=>{c(),Sn=`</system-reminder>`,Cn=new Set([ue,Ce]),wn=new WeakMap}));function En({pose:e=`default`}={}){return(0,Dn.jsxs)(L,{flexDirection:`column`,alignItems:`center`,children:[(0,Dn.jsx)(R,{color:`clawd_body`,children:` █████ `}),(0,Dn.jsx)(R,{color:`clawd_body`,children:`██ ● ● ██`}),(0,Dn.jsx)(R,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,Dn.jsx)(R,{color:`clawd_body`,children:` █ █ █ █ `})]})}var Dn,On=t((()=>{z(),B(),Dn=V()}));function kn(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=I(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,I(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?I(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=I(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,I(r))),o}function An({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?I(e.timestamp):0));return(0,H.jsxs)(L,{flexDirection:`column`,width:t,children:[(0,H.jsx)(R,{bold:!0,color:`claude`,children:n}),o?(0,H.jsxs)(H.Fragment,{children:[o.content,i&&(0,H.jsx)(R,{dimColor:!0,italic:!0,children:dt(i,t)})]}):r.length===0&&a?(0,H.jsx)(R,{dimColor:!0,children:dt(a,t)}):(0,H.jsxs)(H.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,H.jsxs)(R,{children:[s>0&&(0,H.jsxs)(H.Fragment,{children:[(0,H.jsx)(R,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,H.jsx)(R,{children:dt(e.text,r)})]},n)}),i&&(0,H.jsx)(R,{dimColor:!0,italic:!0,children:dt(i,t)})]})]})}var H,jn=t((()=>{z(),B(),mt(),H=V()}));function Mn({feeds:e,maxWidth:t}){let n=e.map(e=>kn(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Pn.jsx)(L,{flexDirection:`column`,children:e.map((t,n)=>(0,Pn.jsxs)(Nn.Fragment,{children:[(0,Pn.jsx)(An,{config:t,actualWidth:i}),n<e.length-1&&(0,Pn.jsx)(Fe,{color:`claude`,width:i})]},n))})}var Nn,Pn,Fn=t((()=>{Nn=n(z(),1),B(),jn(),Pn=V()}));function In(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 Ln(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=Je()===tn()?`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 Rn=t((()=>{a(),qe(),mt()}));function zn(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Bn(){let{pose:e,bounceOffset:t,onClick:n}=Vn();return(0,Un.jsx)(L,{height:Yn,flexDirection:`column`,onClick:n,children:(0,Un.jsx)(L,{marginTop:t,flexShrink:0,children:(0,Un.jsx)(En,{pose:e})})})}function Vn(){let[e]=(0,Hn.useState)(()=>rt().prefersReducedMotion??!1),[t,n]=(0,Hn.useState)(-1),r=(0,Hn.useRef)(Wn),i=()=>{e||t!==-1||(r.current=Gn[Math.floor(Math.random()*Gn.length)],n(0))};(0,Hn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,qn,Jn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Kn;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Hn,Un,Wn,Gn,Kn,qn,Jn,Yn,Xn=t((()=>{z(),Hn=n(z(),1),B(),nt(),On(),Un=V(),Wn=[...zn(`default`,1,2),...zn(`arms-up`,0,3),...zn(`default`,0,1),...zn(`default`,1,2),...zn(`arms-up`,0,3),...zn(`default`,0,1)],Gn=[Wn,[...zn(`look-right`,0,5),...zn(`look-left`,0,5),...zn(`default`,0,1)]],Kn={pose:`default`,offset:0},qn=60,Jn=e=>e+1,Yn=3}));function Zn(){let{columns:e}=He(),t=De(e=>e.agent),n=yt(zt()),{version:r,cwd:i,billingType:a,agentName:o}=Zt(),s=t??o,c=Math.max(e-15,20),l=dt(r,Math.max(c-11,6)),{shouldSplit:u,truncatedModel:d,truncatedBilling:f}=Qt(n,a,c),p=s?c-1-I(s)-3:c,m=en(i,Math.max(p,10));return(0,U.jsx)(ke,{children:(0,U.jsxs)(L,{flexDirection:`row`,gap:2,alignItems:`center`,children:[me()?(0,U.jsx)(Bn,{}):(0,U.jsx)(En,{}),(0,U.jsxs)(L,{flexDirection:`column`,children:[(0,U.jsxs)(R,{children:[(0,U.jsx)(R,{bold:!0,children:`Work Mate`}),` `,(0,U.jsxs)(R,{dimColor:!0,children:[`v`,l]})]}),u?(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(R,{dimColor:!0,children:d}),(0,U.jsx)(R,{dimColor:!0,children:f})]}):(0,U.jsxs)(R,{dimColor:!0,children:[d,` · `,f]}),(0,U.jsx)(R,{dimColor:!0,children:s?`@${s} · ${m}`:m})]})]})})}var U,Qn=t((()=>{Bt(),x(),B(),we(),mt(),s(),Yt(),Ct(),Se(),Xn(),On(),U=V()}));function $n(){let e=(0,tr.useMemo)(er,[]),t=(0,tr.useMemo)(()=>it().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,tr.useEffect)(()=>{n&&ot(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,nr.jsx)(L,{paddingLeft:2,flexDirection:`column`,children:(0,nr.jsx)(R,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function er(){return rr}var tr,nr,rr,ir=t((()=>{z(),tr=n(z(),1),B(),at(),nr=V(),rr={tip:``,color:`dim`}}));function ar({char:e=`✻`}){let[t]=(0,or.useState)(()=>rt().prefersReducedMotion??!1),[n,r]=(0,or.useState)(t),i=(0,or.useRef)(null),[a,o]=Ve(n?null:50);return(0,or.useEffect)(()=>{if(n)return;let e=setTimeout(r,lr,!0);return()=>clearTimeout(e)},[n]),n?(0,sr.jsx)(L,{ref:a,children:(0,sr.jsx)(R,{color:ur,children:e})}):(i.current===null&&(i.current=o),(0,sr.jsx)(L,{ref:a,children:(0,sr.jsx)(R,{color:u(O((o-i.current)/cr*360%360)),children:e})}))}var or,sr,cr,lr,ur,dr=t((()=>{z(),or=n(z(),1),tt(),B(),nt(),Pe(),sr=V(),cr=1500,lr=cr*2,ur=u({r:153,g:153,b:153})}));function fr(){return Tt()&&(it().opus1mMergeNoticeSeenCount??0)<gr}function pr(){let[e]=(0,mr.useState)(fr);return(0,mr.useEffect)(()=>{if(!e)return;let t=(it().opus1mMergeNoticeSeenCount??0)+1;ot(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,hr.jsxs)(L,{paddingLeft:2,children:[(0,hr.jsx)(ar,{char:`↑`}),(0,hr.jsx)(R,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var mr,hr,gr,_r=t((()=>{z(),mr=n(z(),1),tt(),B(),at(),Ct(),dr(),hr=V(),gr=6}));function vr(){let e=qt(),t=it().oauthAccount?.displayName??``,{columns:n}=He(),i=jt(),a=fe.isSandboxingEnabled(),o=De(e=>e.agent),s=it(),[c]=(0,yr.useState)(()=>{let e=rt().companyAnnouncements;if(!(!e||e.length===0))return s.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,yr.useEffect)(()=>{i&&At()},[i]),!i&&r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let l=yt(zt()),{version:u,cwd:d,billingType:f,agentName:p}=Zt(),m=o??p,h=dt(l,br-20);if(!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(Zn,{}),(0,W.jsx)(pr,{}),Ye()&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(R,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(R,{dimColor:!0,children:[`Logging to: `,$e()?`stderr`:Qe()]})]}),(0,W.jsx)($n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(R,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(R,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),c&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,W.jsxs)(R,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,W.jsx)(R,{children:c})]})]});let g=Kt(n),_=Ft(it().theme),v=` ${Be(`claude`,_)(`Work Mate`)} ${Be(`inactive`,_)(`v${u}`)} `,y=Be(`claude`,_)(` Work Mate `);if(g===`compact`){let e=Jt(t);I(e)>n-4&&(e=Jt(null));let r=m?n-4-1-I(m)-3:n-4,i=en(d,Math.max(r,10));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ke,{children:(0,W.jsxs)(L,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:y,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,W.jsx)(R,{bold:!0,children:e}),(0,W.jsx)(L,{marginY:1,children:(0,W.jsx)(En,{})}),(0,W.jsx)(R,{dimColor:!0,children:h}),(0,W.jsx)(R,{dimColor:!0,children:f}),(0,W.jsx)(R,{dimColor:!0,children:m?`@${m} · ${i}`:i})]})}),(0,W.jsx)(pr,{}),a&&(0,W.jsx)(L,{marginTop:1,flexDirection:`column`,children:(0,W.jsx)(R,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let b=Jt(t),x=!process.env.IS_DEMO&&s.oauthAccount?.organizationName?`${h} · ${f} · ${s.oauthAccount.organizationName}`:`${h} · ${f}`,ee=m?br-1-I(m)-3:br,S=en(d,Math.max(ee,10)),C=m?`@${m} · ${S}`:S,{leftWidth:w,rightWidth:te}=$t(n,g,Xt(b,C,x));return(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(ke,{children:(0,W.jsx)(L,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:v,position:`top`,align:`start`,offset:3},children:(0,W.jsxs)(L,{flexDirection:g===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,W.jsxs)(L,{flexDirection:`column`,width:w,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,W.jsx)(L,{marginTop:1,children:(0,W.jsx)(R,{bold:!0,children:b})}),(0,W.jsx)(En,{}),(0,W.jsxs)(L,{flexDirection:`column`,alignItems:`center`,children:[(0,W.jsx)(R,{dimColor:!0,children:x}),(0,W.jsx)(R,{dimColor:!0,children:C})]})]}),g===`horizontal`&&(0,W.jsx)(L,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),g===`horizontal`&&(0,W.jsx)(Mn,{feeds:i?[Ln(kt()),In(e)]:[In(e)],maxWidth:te})]})})}),(0,W.jsx)(pr,{}),Ye()&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsx)(R,{color:`warning`,children:`Debug mode enabled`}),(0,W.jsxs)(R,{dimColor:!0,children:[`Logging to: `,$e()?`stderr`:Qe()]})]}),(0,W.jsx)($n,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[(0,W.jsxs)(R,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,W.jsx)(R,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),c&&(0,W.jsxs)(L,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,W.jsxs)(R,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,W.jsx)(R,{children:c})]}),a&&(0,W.jsx)(L,{paddingLeft:2,flexDirection:`column`,children:(0,W.jsx)(R,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var yr,W,br,xr=t((()=>{z(),B(),x(),Yt(),mt(),On(),Fn(),Rn(),at(),It(),nt(),Ze(),yr=n(z(),1),Mt(),Qn(),Se(),i(),ir(),_r(),d(),we(),Bt(),Ct(),W=V(),br=50}));function Sr({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,Cr.jsx)(L,{minWidth:I(i)+8,children:(0,Cr.jsx)(R,{dimColor:!0,children:i})})}var Cr,wr=t((()=>{z(),B(),Cr=V()}));function Tr({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,Er.jsx)(L,{minWidth:I(n),children:(0,Er.jsx)(R,{dimColor:!0,children:n})})}var Er,Dr=t((()=>{z(),B(),Er=V()}));function Or(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Fr(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(Ee(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Fr(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Fr(t.messages[0]?.message.content)?.input;if(Ee(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function kr({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:l,lastThinkingBlockId:u,latestBashOutputUUID:d,columns:f,isLoading:p,lookups:m,shouldCollapseDiffs:h}){let g=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(N(e,o)||p&&!n),x=v?e.displayMessage:y?te(e):e,ee=v||y?[]:ne(e,m),S=Ji(e,s,o,v||y?ye:ae(e,m),c,m),C=!1;if(l)if(v)C=e.messages.some(e=>{let t=Fr(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)C=N(e,o);else{let t=_(e);C=!t||o.has(t)}let w=g&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),T=(0,Pr.jsx)(D,{message:e,lookups:m,addMargin:!w,containerWidth:w?void 0:f,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:ee,shouldAnimate:C,shouldShowDot:!0,isTranscriptMode:g,isStatic:S,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:u,latestBashOutputUUID:d,shouldCollapseDiffs:h});return w?(0,Pr.jsx)(ke,{children:(0,Pr.jsxs)(L,{width:f,flexDirection:`column`,children:[(0,Pr.jsxs)(L,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Pr.jsx)(Tr,{message:x,isTranscriptMode:g}),(0,Pr.jsx)(Sr,{message:x,isTranscriptMode:g})]}),T]})}):(0,Pr.jsx)(ke,{children:T})}function Ar(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Fr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return w(e).some(e=>t.has(e));let n=_(e);return!!n&&t.has(n)}function jr(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Fr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return w(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Fr(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=_(e);return!n||t.has(n)}function Mr(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&&v(t.message))return!1;let n=Ar(e.message,e.streamingToolUseIDs),r=jr(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var Nr,Pr,Fr,Ir,Lr=t((()=>{Nr=n(z(),1),B(),M(),c(),S(),Pr=V(),wr(),ra(),Dr(),Se(),Fr=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Ir=Nr.memo(kr,Mr)}));function Rr(e){return e.type===`attachment`&&zr.has(e.attachment.type)}var zr,Br=t((()=>{zr=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 Vr(e){return qr.filter(t=>t.isActive(e))}var G,Hr,Ur,Wr,Gr,Kr,qr,Jr=t((()=>{B(),z(),F(),a(),qe(),mt(),_t(),Wt(),G=V(),Hr={id:`large-memory-files`,type:`warning`,isActive:e=>be(e.memoryFiles).length>0,render:e=>(0,G.jsx)(G.Fragment,{children:be(e.memoryFiles).map(e=>{let t=e.path.startsWith(Je())?nn(Je(),e.path):e.path;return(0,G.jsxs)(L,{flexDirection:`row`,children:[(0,G.jsx)(R,{color:`warning`,children:o.warning}),(0,G.jsxs)(R,{color:`warning`,children:[`Large `,(0,G.jsx)(R,{bold:!0,children:t}),` will impact performance (`,ft(e.content.length),` chars > `,ft(Oe),`)`,(0,G.jsx)(R,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Ur={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=vt();return bt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=vt();return(0,G.jsxs)(L,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(R,{color:`warning`,children:o.warning}),(0,G.jsxs)(R,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Wr={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=xt({skipRetrievingKeyFromApiKeyHelper:!0});return!!St()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=xt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,G.jsxs)(L,{flexDirection:`row`,marginTop:1,children:[(0,G.jsx)(R,{color:`warning`,children:o.warning}),(0,G.jsxs)(R,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Gr={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=xt({skipRetrievingKeyFromApiKeyHelper:!0}),t=vt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=xt({skipRetrievingKeyFromApiKeyHelper:!0}),t=vt();return(0,G.jsxs)(L,{flexDirection:`column`,marginTop:1,children:[(0,G.jsxs)(L,{flexDirection:`row`,children:[(0,G.jsx)(R,{color:`warning`,children:o.warning}),(0,G.jsxs)(R,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,G.jsxs)(L,{flexDirection:`column`,marginLeft:3,children:[(0,G.jsxs)(R,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,G.jsxs)(R,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},Kr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Ut(e.agentDefinitions)>Gt,render:e=>{let t=Ut(e.agentDefinitions);return(0,G.jsxs)(L,{flexDirection:`row`,children:[(0,G.jsx)(R,{color:`warning`,children:o.warning}),(0,G.jsxs)(R,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,ft(t),` tokens > `,ft(Gt),`)`,(0,G.jsx)(R,{dimColor:!0,children:` · /agents to manage`})]})]})}},qr=[Hr,Kr,Ur,Wr,Gr]}));function Yr({agentDefinitions:e}={}){let t={config:it(),agentDefinitions:e,memoryFiles:(0,Zr.use)(P())},n=Vr(t);return n.length===0?null:(0,Qr.jsx)(L,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Qr.jsx)(Xr.Fragment,{children:e.render(t)},e.id))})}var Xr,Zr,Qr,$r=t((()=>{Xr=n(z(),1),Zr=n(z(),1),B(),F(),at(),Jr(),Qr=V()}));function ei(e,t,n){let r=(0,K.useRef)(new Map),i=(0,K.useRef)(0),a=(0,K.useRef)(0),o=(0,K.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,K.useRef)(new Map),c=(0,K.useRef)(new Map),l=(0,K.useRef)(n),u=(0,K.useRef)(!1),d=(0,K.useRef)(null),f=(0,K.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,K.useRef)(0),h=(0,K.useRef)(null);(0,K.useSyncExternalStore)((0,K.useCallback)(t=>e.current?.subscribe(t)??ci,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/ii);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,K.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])??ti);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,ee=x[b],S,C;if(p)[S,C]=p,S=Math.min(S,b),C=Math.min(C,b);else if(v===0||g<0)S=Math.max(0,b-ri),C=b;else{if(y){let e=v+ni;for(S=b;S>0&&ee-x[S-1]<e;)S--;C=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-ni;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}S=e}{let e=d.current;if(e&&e[0]<S)for(let n=e[0];n<Math.min(S,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){S=n;break}}}let h=v+2*ni,y=Math.min(b,S+oi),ee=0;for(C=S;C<y&&(ee<h||x[C]<f+v+ni);)ee+=r.current.get(t[C])??ai,C++}let e=v+2*ni,n=Math.max(0,C-oi),i=0;for(let e=S;e<C;e++)i+=r.current.get(t[e])??ai;for(;S>n&&i<e;)S--,i+=r.current.get(t[S])??ai;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;S<e-si&&(S=e-si),C>t+si&&(C=t+si),S>C&&(C=Math.min(S+si,b))}a.current=g}f.current>0?f.current--:d.current=[S,C];let w=(0,K.useDeferredValue)(S),te=(0,K.useDeferredValue)(C),T=S<w?w:S,E=C>te?te:C;if((T>E||y)&&(T=S,E=C),_>0&&(E=C),E-T>oi){let e=(x[T]+x[E])/2;g-m.current<e?E=T+oi:T=E-oi}let ne=m.current,re=x[T],ie=T===0?0:re+ne,ae=E===b?1/0:Math.max(re,x[E]-v)+ne;(0,K.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(ie,ae)}),(0,K.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 D=(0,K.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},[]),oe=(0,K.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),O=(0,K.useCallback)(e=>s.current.get(t[e])??null,[t]),k=(0,K.useCallback)(e=>r.current.get(t[e]),[t]),A=(0,K.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),j=ee-x[E];return{range:[T,E],topSpacer:re,bottomSpacer:j,measureRef:D,spacerRef:h,offsets:x,getItemTop:oe,getItemElement:O,getItemHeight:k,scrollToIndex:A}}var K,ti,ni,ri,ii,ai,oi,si,ci,li=t((()=>{K=n(z(),1),ti=3,ni=40,ri=30,ii=20,ai=1,oi=200,si=25,ci=()=>{}}));function ui({children:e}){let[t,n]=(0,q.useState)(null),[r,i]=(0,q.useState)(null);return(0,hi.jsx)(_i.Provider,{value:n,children:(0,hi.jsx)(yi.Provider,{value:i,children:(0,hi.jsx)(gi.Provider,{value:t,children:(0,hi.jsx)(vi.Provider,{value:r,children:e})})})})}function di(){return(0,q.useContext)(gi)}function fi(){return(0,q.useContext)(vi)}function pi(e){let t=(0,q.useContext)(_i);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function mi(e){let t=(0,q.useContext)(yi);(0,q.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var q,hi,gi,_i,vi,yi,bi=t((()=>{q=n(z(),1),hi=V(),gi=(0,q.createContext)(null),_i=(0,q.createContext)(null),vi=(0,q.createContext)(null),yi=(0,q.createContext)(null)}));function xi(e){let[t,n]=(0,J.useState)(null),r=(0,J.useRef)(e);r.current=e;let i=(0,J.useRef)(null),a=(0,J.useCallback)(()=>{n(null)},[]),o=(0,J.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,J.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,J.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,J.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function Si(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`&&!Ci(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function Ci(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 wi(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||Rr(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=Si(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function Ti({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:l=!1,newMessageCount:u=0,onPillClick:d}){let{rows:f,columns:p}=He(),[m,h]=(0,J.useState)(null),g=(0,J.useMemo)(()=>({setStickyPrompt:h}),[]),_=(0,J.useSyncExternalStore)((0,J.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,J.useLayoutEffect)(()=>{if(!me())return;let e=Re.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{A(rn(e))}catch{}else je(e)},()=>{e.onHyperlinkClick=void 0}},[]),me()){let s=l?null:m,h=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,Y.jsxs)(ui,{children:[(0,Y.jsx)(L,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,Y.jsxs)(L,{flexDirection:`column`,flexGrow:1,width:p,overflow:`hidden`,children:[(0,Y.jsxs)(L,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[h&&(0,Y.jsx)(Di,{text:h.text,onClick:h.scrollTo}),(0,Y.jsxs)(We,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,Y.jsx)(ji,{value:g,children:e}),n]}),!c&&_&&n==null&&(0,Y.jsx)(Ei,{count:u,onClick:d}),r!=null&&(0,Y.jsx)(L,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,Y.jsxs)(L,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,Y.jsx)(Oi,{}),(0,Y.jsx)(ki,{}),(0,Y.jsx)(L,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,Y.jsx)(Ht,{value:{rows:f-Ai-1,columns:p-4,scrollRef:a??null},children:(0,Y.jsxs)(L,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:f-Ai,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,Y.jsx)(L,{flexShrink:0,children:(0,Y.jsx)(R,{color:`permission`,children:`▔`.repeat(p)})}),(0,Y.jsx)(L,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,Y.jsxs)(Y.Fragment,{children:[e,t,n,i]})}function Ei({count:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(L,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,Y.jsx)(L,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(R,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${ht(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function Di({text:e,onClick:t}){let[n,r]=(0,J.useState)(!1);return(0,Y.jsx)(L,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,Y.jsxs)(R,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function Oi(){let e=di();return!e||e.suggestions.length===0?null:(0,Y.jsx)(L,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,Y.jsx)(Lt,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function ki(){let e=fi();return e?(0,Y.jsx)(L,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var J,Y,Ai,ji,Mi=t((()=>{a(),J=n(z(),1),Vt(),bi(),x(),B(),de(),s(),gt(),Br(),Rt(),Y=V(),Ai=2,ji=(0,J.createContext)({setStickyPrompt:()=>{}})}));function Ni(e){let t=Bi.get(e);if(t!==void 0)return t;let n=vn(e);return Bi.set(e,n),n}function Pi(e){let t=Hi.get(e);if(t!==void 0)return t;let n=Fi(e);return Hi.set(e,n),n}function Fi(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
11
+ `)}if(t===null)return null;let n=f(t);return n.startsWith(`<`)||n===``?null:n}function Ii({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Z.jsx)(L,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>l(e):void 0,children:(0,Z.jsx)(Ie.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function Li({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=Ni,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:g,setPositions:_}){let v=(0,X.useRef)([]),y=(0,X.useRef)(e),b=(0,X.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:ee,topSpacer:S,bottomSpacer:C,measureRef:w,spacerRef:te,offsets:T,getItemTop:E,getItemElement:ne,getItemHeight:ie,scrollToIndex:ae}=ei(t,x,n),[D,oe]=ee,O=(0,X.useCallback)(t=>ie(t)!==0&&h(e[t]),[ie,e]);(0,X.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:re(e)?.name}),r=u??-1,i=(t,r,i=O)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>O(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,O]);let k=(0,X.useRef)({offsets:T,start:D,getItemElement:ne,getItemTop:E,messages:e,scrollToIndex:ae});k.current={offsets:T,start:D,getItemElement:ne,getItemTop:E,messages:e,scrollToIndex:ae},(0,X.useEffect)(()=>{if(u===void 0)return;let e=k.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let A=(0,X.useRef)(null),j=(0,X.useRef)({msgIdx:-1,positions:[]}),se=(0,X.useRef)(-1),M=(0,X.useRef)(0),N=(0,X.useRef)(0),ce=(0,X.useRef)(()=>{}),le=(0,X.useRef)(()=>{}),ue=(0,X.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),P=(0,X.useRef)(-1),de=(0,X.useRef)(!1);function fe(e){let t=k.current.getItemTop(e);return Math.max(0,t-zi)}function pe(e){let n=t.current,{msgIdx:r,positions:i}=j.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=k.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-zi)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=ue.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),Xe(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}le.current=pe;let[me,he]=(0,X.useState)(0),ge=(0,X.useCallback)(()=>he(e=>e+1),[]);(0,X.useEffect)(()=>{let e=A.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}=k.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){A.current=null,Xe(`seek(i=${n}): no mount after scrollToIndex, skip`),ce.current(r?-1:1);return}A.current={idx:n,wantLast:r,tries:i+1},c(n),ge();return}A.current=null,a.scrollTo(Math.max(0,s(n)-zi));let d=g?.(l)??[];if(j.current={msgIdx:n,positions:d},Xe(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++M.current>20){M.current=0;return}ce.current(r?-1:1);return}M.current=0;let f=r?d.length-1:0;ue.current.screenOrd=f,se.current=-1,le.current(f);let p=N.current;p&&(N.current=0,ce.current(p))},[me]);function _e(e,n){let r=t.current;if(!r)return;let i=k.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;_?.(null),j.current={msgIdx:-1,positions:[]},A.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(fe(e)):o(e),ge()}function ve(e){let t=ue.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(A.current){N.current=e;return}se.current<0&&(se.current=t.ptr);let{positions:a}=j.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,pe(o),se.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===se.current){_?.(null),se.current=-1,Xe(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,_e(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}ce.current=ve,(0,X.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(fe(e))},setSearchQuery:e=>{A.current=null,j.current={msgIdx:-1,positions:[]},se.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=k.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=k.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=P.current>=0?P.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}Xe(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}ue.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?_e(r[o],!0):P.current>=0&&s&&s.scrollTo(P.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>ve(1),prevMatch:()=>ve(-1),setAnchor:()=>{let e=t.current;e&&(P.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),A.current=null,j.current={msgIdx:-1,positions:[]},se.current=-1},warmSearchIndex:async()=>{if(de.current)return 0;let e=k.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Et(0);let r=performance.now(),i=Math.min(n+500,e.length);for(let t=n;t<i;t++)c(e[t]);t+=performance.now()-r}let r=Math.round(performance.now()-n);return Xe(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),de.current=!0,Math.round(t)}}),[t]);let[ye,be]=(0,X.useState)(null),xe=(0,X.useRef)({onItemClick:a,setHoveredKey:be});xe.current={onItemClick:a,setHoveredKey:be};let Se=(0,X.useCallback)((e,t)=>{let n=xe.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),Ce=(0,X.useCallback)(e=>{xe.current.setHoveredKey(e)},[]),we=(0,X.useCallback)(e=>{xe.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Z.jsxs)(Z.Fragment,{children:[(0,Z.jsx)(L,{ref:te,height:S,flexShrink:0}),e.slice(D,oe).map((e,t)=>{let n=D+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&ye===r,u=s?.(e);return(0,Z.jsx)(Ii,{itemKey:r,msg:e,idx:n,measureRef:w,expanded:u,hovered:l,clickable:c,onClickK:Se,onEnterK:Ce,onLeaveK:we,renderItem:i},r)}),C>0&&(0,Z.jsx)(L,{height:C,flexShrink:0}),l&&(0,Z.jsx)(Ri,{messages:e,start:D,end:oe,offsets:T,getItemTop:E,getItemElement:ne,scrollRef:t})]})}function Ri({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,X.useContext)(ji);(0,X.useSyncExternalStore)((0,X.useCallback)(e=>o.current?.subscribe(e)??Ui,[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=Pi(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,X.useRef)({idx:-1,tries:0}),_=(0,X.useRef)(`none`),v=(0,X.useRef)(-1);return(0,X.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,Vi).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,X.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 X,Z,zi,Bi,Vi,Hi,Ui,Wi=t((()=>{z(),X=n(z(),1),li(),B(),b(),Mi(),Z=V(),Ze(),wt(),Tn(),j(),zi=3,Bi=new WeakMap,Vi=500,Hi=new WeakMap,Ui=()=>{}}));function Gi(e,t,n=$i,r=ea){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 Ki(e){return(e.type===`assistant`||e.type===`user`?_(e):null)??e.uuid}function qi(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Ji(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=_(e);return i?t.has(i)||n.has(i)||Ne(i,`PostToolUse`,a)?!1:an(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 Yi,Q,$,Xi,Zi,Qi,$i,ea,ta,na,ra=t((()=>{ze(),Yi=n(z(),1),Q=n(z(),1),on(),Ke(),tt(),x(),B(),xe(),Dt(),ve(),ln(),fn(),M(),at(),i(),s(),_n(),c(),gt(),Tn(),xr(),ie(),Lr(),j(),pe(),Br(),Se(),$r(),$=V(),Wi(),Xi=Yi.memo(function({agentDefinitions:e}){return(0,$.jsx)(ke,{children:(0,$.jsxs)(L,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(vr,{}),(0,$.jsx)(Yi.Suspense,{fallback:null,children:(0,$.jsx)(Yr,{agentDefinitions:e})})]})})}),Zi=(Nt(),e(Pt)),Qi=30,$i=200,ea=50,ta=({messages:e,tools:t,commands:n,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:l,screen:u,streamingToolUses:d,showAllInTranscript:f=!1,agentDefinitions:p,hideLogo:h=!1,isLoading:_,hidePastThinking:v=!1,streamingThinking:b,streamingText:x,unseenDivider:S,scrollRef:w,trackStickyPrompt:te,jumpRef:ne,onSearchMatchesChange:re,scanElement:ie,setPositions:ae,disableRenderCap:D=!1,cursor:O=null,setCursor:A,cursorNavRef:j,renderRange:M})=>{let{columns:N}=He(),ue=T(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),P=(0,Q.useMemo)(()=>C(e).filter(se),[e]),de=(0,Q.useMemo)(()=>b?b.isStreaming?!0:b.streamingEndedAt?Date.now()-b.streamingEndedAt<3e4:!1:!1,[b]),{lastThinkingBlockId:fe,latestBashOutputUUID:pe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=v&&!de;v&&de&&(e=`streaming`);for(let r=P.length-1;r>=0;r--){let i=P[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 v||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[P,v,de]),ve=(0,Q.useMemo)(()=>ee(P),[P]),ye=(0,Q.useMemo)(()=>d.filter(e=>!s.has(e.contentBlock.id)&&!ve.has(e.contentBlock.id)),[d,s,ve]),be=(0,Q.useMemo)(()=>ye.flatMap(e=>{let t=le({content:[e.contentBlock]});return t.uuid=g(e.contentBlock.id,0),C([t])}),[ye]),xe=u===`transcript`,Se=(0,Q.useMemo)(()=>r(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),Ce=w!=null&&!Se,we=xe&&!f&&!Ce,Ee=(0,Q.useRef)(null),F=(0,Q.useRef)(null),{collapsed:De,lookups:Oe,hasTruncatedMessages:ke,hiddenMessageCount:je}=(0,Q.useMemo)(()=>{let e=ce((i||me()?P:E(P,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!Rr(e)&&oe(e,xe)),be),n=we?e.slice(-30):e,r=we&&e.length>Qi,{messages:a}=hn(n,t,i),o=cn(dn(y(a,t)),i),s=Te(P,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(F.current&&F.current.key===s)l=F.current.lookups;else if(F.current&&P.length>=F.current.normalizedCount&&n.length>=F.current.messageCount&&F.current.lastAssistantMsgId===c){let e=he(F.current.lookups,F.current.normalizedCount,F.current.messageCount,P,n);e?(l=e,F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c}):(l=ge(P,n),F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c})}else l=ge(P,n),F.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c};let u=e.length-Qi;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:u}},[i,P,xe,be,we,t]),Ne=(0,Q.useMemo)(()=>{let e=!Ce&&!D?Gi(De,Ee):0;return M?De.slice(M[0],M[1]):e>0?De.slice(e):De},[De,M,Ce,D]),Pe=(0,Q.useMemo)(()=>new Set(d.map(e=>e.contentBlock.id)),[d]),{dividerBeforeIndex:I,selectedIdx:Ie}=(0,Q.useMemo)(()=>{if(!S&&!O)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=S?.firstUnseenUuid.slice(0,24);for(let r=0;r<Ne.length;r++){let i=Ne[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&O&&i.uuid===O.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[S,O,Ne]),[Re,ze]=(0,Q.useState)(()=>new Set),z=(0,Q.useCallback)(e=>{let t=Ki(e);ze(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Be=(0,Q.useCallback)(e=>Re.size>0&&Re.has(Ki(e)),[Re]),Ve=(0,Q.useRef)(Oe);Ve.current=Oe;let B=(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&&_e(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=Ve.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Ot(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),We=(!a||!!a.shouldContinueAnimation)&&!o.length&&!c,V=s.size>0,{progress:Ke}=Le(),qe=(0,Q.useRef)(null),Je=it().terminalProgressBarEnabled&&!Ge()&&!(Zi?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Je?V?`indeterminate`:`completed`:null;qe.current!==e&&(qe.current=e,Ke(e))},[Ke,Je,V]),(0,Q.useEffect)(()=>()=>Ke(null),[Ke]);let Ye=(0,Q.useCallback)(e=>`${e.uuid}-${l}`,[l]),Xe=(e,r)=>{let a=r>0?Ne[r-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!x||Or(Ne,r,t,Pe)),l=Ne.length-1-r>0,d=Ye(e),f=(0,$.jsx)(Ir,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:n,verbose:i||Be(e)||O?.expanded===!0&&r===Ie,inProgressToolUseIDs:s,streamingToolUseIDs:Pe,screen:u,canAnimate:We,lastThinkingBlockId:fe,latestBashOutputUUID:pe,columns:N,isLoading:_,lookups:Oe,shouldCollapseDiffs:l},d),p=(0,$.jsx)(Ae.Provider,{value:r===Ie,children:f},d);return S&&r===I?[(0,$.jsx)(L,{marginTop:1,children:(0,$.jsx)(Fe,{title:`${S.count} new ${ht(S.count,`message`)}`,width:N,color:`inactive`})},`unseen-divider`),p]:p},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=vn(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=Oe.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Ot(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Ze.current.set(e,i),i},[t,Oe]);return(0,$.jsxs)($.Fragment,{children:[!h&&!(M&&M[0]>0)&&(0,$.jsx)(Xi,{agentDefinitions:p}),ke&&(0,$.jsx)(Fe,{title:`${ue} to show ${Ue.bold(je)} previous messages`,width:N}),xe&&f&&je>0&&!D&&(0,$.jsx)(Fe,{title:`${ue} to hide ${Ue.bold(je)} previous messages`,width:N}),Ce?(0,$.jsx)(k.Provider,{value:!0,children:(0,$.jsx)(Li,{messages:Ne,scrollRef:w,columns:N,itemKey:Ye,renderItem:Xe,onItemClick:z,isItemClickable:B,isItemExpanded:Be,trackStickyPrompt:te,selectedIndex:Ie>=0?Ie:void 0,cursorNavRef:j,setCursor:A,jumpRef:ne,onSearchMatchesChange:re,scanElement:ie,setPositions:ae,extractSearchText:Qe})}):Ne.flatMap(Xe),x&&(0,$.jsx)(L,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(L,{flexDirection:`row`,children:[(0,$.jsx)(L,{minWidth:2,children:(0,$.jsx)(R,{color:`text`,children:et})}),(0,$.jsx)(L,{flexDirection:`column`,children:(0,$.jsx)(m,{children:x})})]})}),de&&b&&(0,$.jsx)(L,{marginTop:1,children:(0,$.jsx)(Me,{param:{type:`thinking`,thinking:b.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},na=Yi.memo(ta,(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`&&qi(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{Mi as a,pi as c,wi as i,mi as l,ra as n,xi as o,Ti as r,bi as s,na as t};
@@ -0,0 +1 @@
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DcaKZlRU.js";import{AC as r,Nu as i,Qu as a,Zu as o,ad as s,od as c}from"./loadAgentsDir-BXtV2jiO.js";import{Gt as l,H as u,I as d,Lt as f,P as p,fi as m,kt as h,t as g}from"./src-P_wYS_NJ2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as v,Yt as y}from"./settings-DiBMs2gM.js";import{h as b,s as x}from"./config-9rLTDOYW.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{Bt as w,Ht as T,Sr as E,xr as D}from"./model-CDnVaVDR.js";import{c as O,i as k,s as A}from"./terminalSetup-fwhFTxGi.js";import{t as j}from"./WelcomeV2-BnSYhyfu.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-BHQfwlAl.js";import{n as P,t as F}from"./ThemePicker-p7_hHk1V.js";import{n as I,t as L}from"./PressEnterToContinue-Dq0Imo9c.js";import{t as R}from"./ApproveApiKey-C8LwmDM2.js";n();var z=e(m(),1),B=_();S(),y(),b(),D(),w(),r(),k(),N(),g(),g(),i(),c(),a(),P(),I(),g();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(d,{gap:1,children:[(0,B.jsx)(p,{dimColor:!0,children:t}),(0,B.jsx)(d,{flexDirection:`column`,children:e})]})}g();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(d,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,B.jsx)(U.Provider,{value:{marker:a},children:(0,B.jsx)(V.Provider,{value:{marker:a},children:e})})})})}W.Item=H;var G=W;g();function K({onDone:e}){let[n,r]=(0,z.useState)(0),[i,a]=(0,z.useState)(!1),[c]=(0,z.useState)(()=>T()),[m,g]=u();(0,z.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:c})},[c]);function _(){if(n<N.length-1){let e=n+1;r(e),C(`tengu_onboarding_step`,{oauthEnabled:c,stepId:N[e]?.id})}else e()}function y(e){g(e),_()}let b=M(),S=(0,B.jsx)(d,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),w=(0,B.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(p,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(d,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(p,{children:`Always review changes before accepting`}),(0,B.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(h,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(h,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(p,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(h,{}),(0,B.jsx)(f,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=E(process.env.ANTHROPIC_API_KEY);if(x(e)===`new`)return e},[]);function k(e){e&&a(!0),_()}let N=[];N.push({id:`theme`,component:S}),D&&N.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),c&&N.push({id:`oauth`,component:(0,B.jsx)(q,{skip:i,onSkip:_,children:(0,B.jsx)(s,{onDone:_})})}),N.push({id:`security`,component:w}),O()&&N.push({id:`terminal-setup`,component:(0,B.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(p,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(d,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(p,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(h,{}),`for your terminal:`,` `,v.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(o,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(m).catch(()=>{}).finally(_):_()},onCancel:()=>_()}),(0,B.jsx)(p,{dimColor:!0,children:b.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=N[n],I=(0,z.useCallback)(()=>{n===N.length-1?e():_()},[n,N.length,c,e]),V=(0,z.useCallback)(()=>{_()},[n,N.length,c,e]);return l({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),l({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(d,{flexDirection:`column`,children:[(0,B.jsx)(j,{}),(0,B.jsxs)(d,{flexDirection:`column`,marginTop:1,children:[P?.component,b.pending&&(0,B.jsx)(d,{padding:1,children:(0,B.jsxs)(p,{dimColor:!0,children:[`Press `,b.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{ZC as n}from"./loadAgentsDir-BL93ulMm.js";import{Gr as r,I as i,P as a,fi as o,ot as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{C as u,v as d,x as f}from"./startupProfiler-CmH_aVy2.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:n,overlay:a}){let{rows:o}=s(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=n??Math.max(...e.map(e=>r(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(i,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(o(),1),n(),c(),d(),_=l(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:n}){let i=s().columns;if(m(e.id)){let t=p(e.id),o=n?`suggestion`:void 0,s=!n,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,r(e.description)):0,n=i-2-4-d-t;m=f(e.displayText,n)}else m=l?u(e.displayText,30):e.displayText;let h=i-2-r(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:o,dimColor:s,wrap:`truncate`,children:g})}let o=Math.floor(i*.4),c=Math.min(t??r(e.displayText)+5,o),l=e.color||(n?`suggestion`:void 0),d=!n,h=e.displayText;r(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-r(h))),v=e.tag?`[${e.tag}] `:``,y=r(v),b=Math.max(0,i-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:n?`suggestion`:void 0,dimColor:!n,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{IC as n}from"./loadAgentsDir-BXtV2jiO.js";import{Gr as r,I as i,P as a,fi as o,ot as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{C as u,v as d,x as f}from"./startupProfiler-Dc5r6LgE.js";function p(e){return e.startsWith(`file-`)?`+`:e.startsWith(`mcp-resource-`)?`◇`:e.startsWith(`agent-`)?`*`:`+`}function m(e){return e.startsWith(`file-`)||e.startsWith(`mcp-resource-`)||e.startsWith(`agent-`)}function h({suggestions:e,selectedSuggestion:t,maxColumnWidth:n,overlay:a}){let{rows:o}=s(),c=a?5:Math.min(6,Math.max(1,o-3));if(e.length===0)return null;let l=n??Math.max(...e.map(e=>r(e.displayText)))+5,u=Math.max(0,Math.min(t-Math.floor(c/2),e.length-c)),d=Math.min(u+c,e.length),f=e.slice(u,d);return(0,_.jsx)(i,{flexDirection:`column`,justifyContent:a?void 0:`flex-end`,children:f.map(n=>(0,_.jsx)(v,{item:n,maxColumnWidth:l,isSelected:n.id===e[t]?.id},n.id))})}var g,_,v,y,b=e((()=>{g=t(o(),1),n(),c(),d(),_=l(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:n}){let i=s().columns;if(m(e.id)){let t=p(e.id),o=n?`suggestion`:void 0,s=!n,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),d=e.description?3:0,m;if(c){let t=e.description?Math.min(20,r(e.description)):0,n=i-2-4-d-t;m=f(e.displayText,n)}else m=l?u(e.displayText,30):e.displayText;let h=i-2-r(m)-d-4,g;if(e.description){let n=Math.max(0,h),r=u(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(a,{color:o,dimColor:s,wrap:`truncate`,children:g})}let o=Math.floor(i*.4),c=Math.min(t??r(e.displayText)+5,o),l=e.color||(n?`suggestion`:void 0),d=!n,h=e.displayText;r(h)>c-2&&(h=u(h,c-2));let g=h+` `.repeat(Math.max(0,c-r(h))),v=e.tag?`[${e.tag}] `:``,y=r(v),b=Math.max(0,i-c-y-4),x=e.description?u(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(a,{wrap:`truncate`,children:[(0,_.jsx)(a,{color:l,dimColor:d,children:g}),v?(0,_.jsx)(a,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(a,{color:n?`suggestion`:void 0,dimColor:!n,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{$T as t,MC as n,QT as r,jC as i}from"./loadAgentsDir-BXtV2jiO.js";import{I as a,P as o,fi as s,t as c}from"./src-P_wYS_NJ2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as u,Yt as d}from"./settings-DiBMs2gM.js";import{c as f,h as p}from"./config-9rLTDOYW.js";import{i as m,o as h}from"./platform-Dg1c9F_1.js";import{et as g,rt as _,tt as v}from"./model-CDnVaVDR.js";import{a as y,i as b,r as x}from"./terminalSetup-fwhFTxGi.js";function S(){return f().editorMode===`vim`}function C(){return u.terminal===`Apple_Terminal`&&process.platform===`darwin`||y()?`shift + ⏎ for newline`:x()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function w(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 T=e((()=>{b(),p(),d()}));function E(e){return e.replace(/\+/g,` + `)}function D(e){let{dimColor:r,fixedWidth:i,gap:s,paddingX:c}=e,l=E(n(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=E(n(`app:toggleTodos`,`Global`,`ctrl+t`)),d=E(n(`chat:undo`,`Chat`,`ctrl+_`)),f=E(n(`chat:stash`,`Chat`,`ctrl+s`)),p=E(n(`chat:cycleMode`,`Chat`,`shift+tab`)),h=E(n(`chat:modelPicker`,`Chat`,`alt+p`)),g=E(n(`chat:fastMode`,`Chat`,`alt+o`)),y=E(n(`chat:externalEditor`,`Chat`,`ctrl+g`));E(n(`app:toggleTerminal`,`Global`,`meta+j`));let b=E(n(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,O.jsxs)(a,{paddingX:c,flexDirection:`row`,gap:s,children:[(0,O.jsxs)(a,{flexDirection:`column`,width:i?24:void 0,children:[(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`! for bash mode`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`/ for commands`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`@ for file paths`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`& for background`})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`/btw for side question`})})]}),(0,O.jsxs)(a,{flexDirection:`column`,width:i?35:void 0,children:[(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`double tap esc to clear input`})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[p,` to auto-accept edits`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[l,` for verbose output`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[u,` to toggle tasks`]})}),(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:C()})})]}),(0,O.jsxs)(a,{flexDirection:`column`,children:[(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[d,` to undo`]})}),m()!==`windows`&&(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`ctrl + z to suspend`})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[b,` to paste images`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[h,` to switch model`]})}),_()&&v()&&(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[g,` to toggle fast mode`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[f,` to stash prompt`]})}),(0,O.jsx)(a,{children:(0,O.jsxs)(o,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),t()&&(0,O.jsx)(a,{children:(0,O.jsx)(o,{dimColor:r,children:`/keybindings to customize`})})]})]})}var O,k=e((()=>{s(),c(),h(),r(),i(),g(),T(),O=l()}));export{S as a,w as i,k as n,T as r,D as t};
@@ -0,0 +1 @@
1
+ import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,s as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{$ as o,$r as s,Ag as c,BT as l,Ba as u,Bi as d,Cr as f,DE as p,Dg as ee,EE as m,Fy as h,Q as g,Qs as _,Ri as te,Uv as ne,VT as v,Wv as y,XC as re,Xs as b,YC as x,Ys as ie,Zs as ae,_m as S,ao as C,av as w,bn as T,ct as E,da as oe,do as D,dp as O,ex as k,fb as se,gc as ce,hc as le,iv as A,lt as j,ma as ue,mb as de,mp as fe,nr as M,nt as pe,nv as N,ov as P,po as me,tx as F,wg as he,xn as ge,ym as I}from"./loadAgentsDir-BXtV2jiO.js";import{Kr as _e,qr as ve}from"./src-P_wYS_NJ2.js";import{Et as L,Gt as ye,Q as R,St as z,Wt as B,dt as be,pt as V}from"./state-BPFYBqm1.js";import{n as H,t as xe}from"./cwd-Besi3Os3.js";import{Q as Se,Y as Ce,f as we,g as U}from"./settings-DiBMs2gM.js";import{M as W,c as Te,h as Ee,j as De}from"./config-9rLTDOYW.js";import{i as Oe,o as ke,q as Ae}from"./log-27kCA_9u.js";import{Bt as je,C as Me,St as G,Y as K,_ as Ne,et as Pe,u as Fe}from"./model-CDnVaVDR.js";import{bn as Ie,ot as q,rt as Le,xn as Re}from"./prompt-CRc2QEZ5.js";import{M as ze,at as Be,st as Ve}from"./sessionState-DSWN4tMV.js";import{a as He,n as Ue,r as We}from"./mappers-IuJeXgvr.js";import{n as J,o as Ge,r as Y}from"./MessageSelector-BHB55sZb.js";import{n as Ke,t as qe}from"./systemTheme-Ceakddth.js";import{randomUUID as X}from"crypto";n(),i(),_e(),B(),H(),Ae(),ke(),Se(),U(),W(),Ie(),Ee(),m(),je(),Pe(),l(),ze(),de(),h(),y(),q(),c(),I(),le(),D(),C(),u(),d(),f(),T(),o(),j(),P(),F(),Ne(),N(),O();async function Je({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?E(e,t,n,r):Promise.resolve([]),w(),i===void 0?A():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ye({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=Fe(),f=a(),{defaultSystemPrompt:p,userContext:ee,systemContext:m}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),h=Be([...s===void 0?p:[s],...c?[c]:[]]),g=r.at(-1),_=g?.type===`assistant`&&g.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:h,userContext:ee,systemContext:m,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(fe()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:k(),readFileState:i,getAppState:a,setAppState:o,messages:_,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:_}}x(),Ue(),qe();function Xe(e){return e===`Agent`?Ce:e}function Ze(e){let t=we()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:xe(),session_id:V(),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:G().source,betas:be(),claude_code_version:`0.0.12`,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:X()};return n.fast_mode_state=K(e.model,e.fastMode),n}B(),F(),H(),Pe(),Ne(),N(),O(),b();var Qe=()=>{try{return Y(),e(J)}catch{return null}},Z=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??k(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Ve}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:c,verbose:l=!1,thinkingConfig:u,maxTurns:d,maxBudgetUsd:f,taskBudget:m,canUseTool:h,customSystemPrompt:y,appendSystemPrompt:b,userSpecifiedModel:x,fallbackModel:C,jsonSchema:w,getAppState:T,setAppState:E,replayUserMessages:D=!1,includePartialMessages:O=!1,agents:k=[],setSDKStatus:se,orphanedPermission:le}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],re(i);let A=!ye(),j=Date.now(),de=async(e,t,n,r,i,a)=>{let o=await h(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},N=T(),P=x?Me(x):Fe(),F=u||(fe()===!1?{type:`disabled`}:{type:`adaptive`});S(`before_getSystemPrompt`);let I=typeof y==`string`?y:void 0,{defaultSystemPrompt:_e,userContext:B,systemContext:be}=await Je({tools:o,mainLoopModel:P,additionalWorkingDirectories:Array.from(N.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:c,customSystemPrompt:I});S(`after_getSystemPrompt`);let H={...B},Se=I!==void 0&&De()?await p():null,Ce=Be([...I===void 0?_e:[I],...Se?[Se]:[],...b?[b]:[]]),we=o.some(e=>Re(e,Le));w&&we&&ge(E,V());let U={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:P,thinkingConfig:F,mcpClients:c,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,agentDefinitions:{activeAgents:k,allAgents:[]},theme:Ke(Te().theme),maxBudgetUsd:f},getAppState:T,setAppState:E,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{E(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{E(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:se};if(le&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of ie(le,o,this.mutableMessages,U))yield e}let{messages:W,shouldQuery:Ee,allowedTools:ke,model:Ae,resultText:je}=await Ge({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...U,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...W);let G=[...this.mutableMessages];if(A&&W.length>0){let e=s(G);r()||(await e,(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M())}let Ne=Qe(),Pe=W.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(Ne?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),Ie=D?Pe:[];E(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:ke}}}));let q=Ae??P;U={messages:G,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:l,mainLoopModel:q,thinkingConfig:F,mcpClients:c,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,theme:Ke(Te().theme),agentDefinitions:{activeAgents:k,allAgents:[]},maxBudgetUsd:f},getAppState:T,setAppState:E,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:U.updateFileHistoryState,updateAttributionState:U.updateAttributionState,setSDKStatus:se},S(`before_skills_plugins`);let[ze,{enabled:Ue}]=await Promise.all([te(xe()),me()]);if(S(`after_skills_plugins`),yield Ze({tools:o,mcpClients:c,model:q,permissionMode:N.toolPermissionContext.mode,commands:a,agents:k,skills:ze,plugins:Ue,fastMode:N.fastMode}),S(`system_message_yielded`),!Ee){for(let e of W)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:ve(e.message.content)},session_id:V(),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 We(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:V(),uuid:e.uuid,compact_metadata:He(t.compactMetadata)}}A&&(await s(G),(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()-j,duration_api_ms:z(),num_turns:G.length-1,result:je??``,stop_reason:null,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,fast_mode_state:K(q,N.fastMode),uuid:X()};return}if(he()&&A){let e=Qe()?.selectableUserMessagesFilter??(e=>!0);W.filter(e).forEach(e=>{ee(e=>{E(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let J=Ve,Y=1,qe=!1,Ye,Z=null,Q=Oe().at(-1),$e=w?ue(this.mutableMessages,Le):0;for await(let e of ce({messages:G,systemPrompt:Ce,userContext:H,systemContext:be,canUseTool:de,toolUseContext:U,fallbackModel:C,querySource:`sdk`,maxTurns:d,taskBudget:m})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(A&&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 s(this.mutableMessages.slice(0,e+1))}}if(G.push(e),A&&(e.type===`assistant`?s(G):await s(G)),!qe&&Ie.length>0){qe=!0;for(let e of Ie)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:V(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Y++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Z=n),this.mutableMessages.push(t),yield*_(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),A&&(G.push(t),s(G)),yield*_(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*_(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){J=Ve;let e=t.message;J=pe(J,e.usage)}if(t.type===`message_delta`){J=pe(J,t.usage);let e=t.delta;e.stop_reason!=null&&(Z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=g(this.totalUsage,J)),O&&(yield{type:`stream_event`,event:t,session_id:V(),parent_tool_use_id:null,uuid:X()});break}case`attachment`:{let n=e;this.mutableMessages.push(n),A&&(G.push(n),s(G));let r=n.attachment;if(r.type===`structured_output`)Ye=r.data;else if(r.type===`max_turns_reached`){A&&(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()-j,duration_api_ms:z(),is_error:!0,num_turns:r.turnCount,stop_reason:Z,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,fast_mode_state:K(q,N.fastMode),uuid:X(),errors:[`Reached maximum number of turns (${r.maxTurns})`]};return}else D&&r.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:r.prompt},session_id:V(),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=G.length-1;r>0&&G.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:V(),uuid:t.uuid,compact_metadata:He(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:ne(e.error),session_id:V(),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:V(),uuid:t.uuid};break}}if(f!==void 0&&L()>=f){A&&(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()-j,duration_api_ms:z(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,fast_mode_state:K(q,N.fastMode),uuid:X(),errors:[`Reached maximum budget ($${f}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&w){let e=ue(this.mutableMessages,Le)-$e,n=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=n){A&&(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()-j,duration_api_ms:z(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,fast_mode_state:K(q,N.fastMode),uuid:X(),errors:[`Failed to provide valid structured output after ${n} attempts`]};return}}}let $=G.findLast(e=>e.type===`assistant`||e.type===`user`),et=$?.type??`undefined`,tt=$?.type===`assistant`?v($.message.content)?.type??`none`:`n/a`;if(A&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await M(),!ae($,Z)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-j,duration_api_ms:z(),is_error:!0,num_turns:Y,stop_reason:Z,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,fast_mode_state:K(q,N.fastMode),uuid:X(),errors:(()=>{let e=Oe(),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=v($.message.content);e?.type===`text`&&!oe.has(e.text)&&(nt=e.text),rt=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:rt,duration_ms:Date.now()-j,duration_api_ms:z(),num_turns:Y,result:nt,stop_reason:Z,session_id:V(),total_cost_usd:L(),usage:this.totalUsage,modelUsage:R(),permission_denials:this.permissionDenials,structured_output:Ye,fast_mode_state:K(q,N.fastMode),uuid:X()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=k()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return V()}setModel(e){this.config.userSpecifiedModel=e}};async function*Q({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:ee,setReadFileCache:m,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:te,jsonSchema:ne,getAppState:v,setAppState:y,abortController:re,replayUserMessages:b=!1,includePartialMessages:x=!1,handleElicitation:ie,agents:ae=[],setSDKStatus:S,orphanedPermission:C}){let w=new Z({cwd:i,tools:a,commands:e,mcpClients:o,agents:ae??[],canUseTool:f,getAppState:v,setAppState:y,initialMessages:p,readFileCache:se(ee()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:te,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:ne,verbose:s,handleElicitation:ie,replayUserMessages:b,includePartialMessages:x,setSDKStatus:S,abortController:re,orphanedPermission:C});try{yield*w.submitMessage(t,{uuid:n,isMeta:r})}finally{m(w.getReadFileState())}}export{Q as n,Ye as r,Z as t};