@readmagic/workmate 0.0.13 → 0.0.14

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 (428) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-m2d3nOQJ.js +1 -0
  2. package/dist/chunks/AgentsMdExternalIncludesDialog-BRXGkHO4.js +1 -0
  3. package/dist/chunks/{AgentsMdExternalIncludesDialog-CH9x1Ngp.js → AgentsMdExternalIncludesDialog-D58Vn3SK.js} +1 -1
  4. package/dist/chunks/App-CeC-2dzL.js +1 -0
  5. package/dist/chunks/ApproveApiKey-DFpddLyp.js +1 -0
  6. package/dist/chunks/ApproveApiKey-NXTWIAMj.js +1 -0
  7. package/dist/chunks/BackgroundTasksDialog-9ruzl1jm.js +2 -0
  8. package/dist/chunks/{BypassPermissionsModeDialog-B0BizN_J.js → BypassPermissionsModeDialog-C4QGpcBT.js} +1 -1
  9. package/dist/chunks/DiffDialog-LTdtTqsC.js +6 -0
  10. package/dist/chunks/Doctor-DmiDH-lg.js +1 -0
  11. package/dist/chunks/Doctor-Yvrzcrvx.js +3 -0
  12. package/dist/chunks/ExitFlow-DH0L3tyY.js +2 -0
  13. package/dist/chunks/{Grove-D0nn8zOV.js → Grove-BhhnrFX9.js} +1 -1
  14. package/dist/chunks/{HybridTransport-BQNLZNa_.js → HybridTransport-CEWG9ZRi.js} +2 -4
  15. package/dist/chunks/InvalidConfigDialog-Ue3kJUPJ.js +1 -0
  16. package/dist/chunks/InvalidSettingsDialog-BO2AOTVf.js +1 -0
  17. package/dist/chunks/MCPConnectionManager-Ciy9y9VV.js +1 -0
  18. package/dist/chunks/MCPToolListView-Ddmu2UcL.js +1 -0
  19. package/dist/chunks/{McpParsingWarnings-CUx2zexI.js → McpParsingWarnings-BsCDFWci.js} +1 -1
  20. package/dist/chunks/MessageSelector-DY5K0NHd.js +3 -0
  21. package/dist/chunks/Messages-LD6ZO301.js +10 -0
  22. package/dist/chunks/{Onboarding-t-P6Q5O6.js → Onboarding-w0-VVsDz.js} +1 -1
  23. package/dist/chunks/PermissionDialog-BPhvs5xH.js +1 -0
  24. package/dist/chunks/PressEnterToContinue-Dwoh6CaW.js +1 -0
  25. package/dist/chunks/{PromptInputFooterSuggestions-R12fbdmp.js → PromptInputFooterSuggestions-OEXx0Abp.js} +1 -1
  26. package/dist/chunks/PromptInputHelpMenu-DyaUsvNx.js +1 -0
  27. package/dist/chunks/QueryEngine-sH-KjJIq.js +1 -0
  28. package/dist/chunks/REPL-BMH_RItw.js +128 -0
  29. package/dist/chunks/REPL-DkPd3vk5.js +1 -0
  30. package/dist/chunks/RemoteSessionManager-DJhrR1dz.js +2 -0
  31. package/dist/chunks/ResumeConversation-BbNrpSFB.js +1 -0
  32. package/dist/chunks/SSETransport-CLiI2qnD.js +2 -0
  33. package/dist/chunks/{SearchBox-C9vUA4IM.js → SearchBox-CwwV0W-w.js} +1 -1
  34. package/dist/chunks/SearchExtraToolsTool-DupzA6Vm.js +1 -0
  35. package/dist/chunks/Settings-B1EI5LOU.js +2 -0
  36. package/dist/chunks/{TeleportProgress-3hmIApkj.js → TeleportProgress-IB--CbqZ.js} +1 -1
  37. package/dist/chunks/{TeleportRepoMismatchDialog-BA1a66RK.js → TeleportRepoMismatchDialog-KjdlS_gA.js} +1 -1
  38. package/dist/chunks/{TeleportResumeWrapper-BT4O-Wsi.js → TeleportResumeWrapper-DnHTI39O.js} +1 -1
  39. package/dist/chunks/ThemePicker-BrD_T7xF.js +1 -0
  40. package/dist/chunks/{TrustDialog-Dpk03V1Y.js → TrustDialog-L0rvvpit.js} +1 -1
  41. package/dist/chunks/ValidationErrorsList-QZvtUrAy.js +2 -0
  42. package/dist/chunks/add-dir-CpWXReCi.js +1 -0
  43. package/dist/chunks/{agentDisplay-D7bdOOG7.js → agentDisplay-CrQvGkTT.js} +1 -1
  44. package/dist/chunks/agents-BYQO6DbG.js +101 -0
  45. package/dist/chunks/{agents-22wiC58F.js → agents-C99yMsVF.js} +1 -1
  46. package/dist/chunks/allErrors-uyOMiF9U.js +1 -0
  47. package/dist/chunks/{api-f3GN2I_J.js → api-C5I2xwgd.js} +1 -1
  48. package/dist/chunks/api-j0iE1mkR.js +1 -0
  49. package/dist/chunks/attributionHooks-C0aXyx9L.js +1 -0
  50. package/dist/chunks/{auth-Czy7GoRh.js → auth-BYCRa_mb.js} +7 -12
  51. package/dist/chunks/auth-C9FUZzpW.js +1 -0
  52. package/dist/chunks/auth-DwPrlTHv.js +1 -0
  53. package/dist/chunks/backgroundHousekeeping-BxcVB3By.js +1 -0
  54. package/dist/chunks/backgroundHousekeeping-CjD8bACB.js +17 -0
  55. package/dist/chunks/{banner-BcAM7iSx.js → banner-HfMnBd03.js} +2 -2
  56. package/dist/chunks/{bg-Ci7pG4eo.js → bg-DltfF1_K.js} +2 -2
  57. package/dist/chunks/branch-BOWBZo5K.js +2 -0
  58. package/dist/chunks/{break-cache-4rlQORVk.js → break-cache-Cd1yQ-0h.js} +2 -3
  59. package/dist/chunks/bridgeConfig-Bxs5dqjH.js +1 -0
  60. package/dist/chunks/{bridgeConfig-B80T_lw7.js → bridgeConfig-CgAVrQfz.js} +1 -1
  61. package/dist/chunks/{bridgeMessaging-DyvHd16Z.js → bridgeMessaging-cOFtbkf_.js} +1 -1
  62. package/dist/chunks/{bridgePointer-DHWK3LEe.js → bridgePointer-CiHy2tTN.js} +1 -1
  63. package/dist/chunks/{bridgeStatusUtil-DStiD05t.js → bridgeStatusUtil-BQF0AJDO.js} +1 -1
  64. package/dist/chunks/btw-B0UmiVKl.js +1 -0
  65. package/dist/chunks/caches-C9--b9a7.js +1 -0
  66. package/dist/chunks/caches-wN3JyvNE.js +1 -0
  67. package/dist/chunks/{capacityWake-ByL6fM6I.js → capacityWake-LRiPhPeM.js} +1 -1
  68. package/dist/chunks/{ccrClient-BALhzhPF.js → ccrClient-wtUIz75R.js} +1 -1
  69. package/dist/chunks/{claudeDesktop-Ct_hyICL.js → claudeDesktop-DPIJpc1V.js} +1 -1
  70. package/dist/chunks/{clear-B_yVyJXP.js → clear-CNzBoL7O.js} +1 -1
  71. package/dist/chunks/{cliLaunch-OPOtzhvA.js → cliLaunch-xIVvtPZy.js} +1 -1
  72. package/dist/chunks/{client-BMA05FW8.js → client-B7WkO81L.js} +1 -1
  73. package/dist/chunks/client-BCzhAEd0.js +1 -0
  74. package/dist/chunks/client-Dr9AYB-r.js +1 -0
  75. package/dist/chunks/commands-DTB0Qzd5.js +1 -0
  76. package/dist/chunks/compact-Bj8mdDYN.js +2 -0
  77. package/dist/chunks/config-B1kYcRIP.js +1 -0
  78. package/dist/chunks/{config-9rLTDOYW.js → config-BkbL2e5Q.js} +1 -1
  79. package/dist/chunks/{config-DMKtiMzJ.js → config-WMxn2jLl.js} +1 -1
  80. package/dist/chunks/context-DB1Ar85E.js +1 -0
  81. package/dist/chunks/context-noninteractive-Bno2Xsmp.js +1 -0
  82. package/dist/chunks/{context-noninteractive-CHzerxnH.js → context-noninteractive-CqnJTDcI.js} +2 -2
  83. package/dist/chunks/conversation-DOgBzrm0.js +1 -0
  84. package/dist/chunks/conversation-hNXWaswI.js +1 -0
  85. package/dist/chunks/{createSSHSession-XkHMiGRN.js → createSSHSession-Cf2tOgK_.js} +3 -4
  86. package/dist/chunks/createSession-BZx-2UIB.js +1 -0
  87. package/dist/chunks/{createSession-BNGm9fL4.js → createSession-DD5YaQKM.js} +1 -1
  88. package/dist/chunks/crossProjectResume-CkiPQYYE.js +40 -0
  89. package/dist/chunks/{datadog-3WUWcCFn.js → datadog-DcLf1QpG.js} +1 -1
  90. package/dist/chunks/{debug-Dr1SjdXn.js → debug-BQj6h99Q.js} +1 -1
  91. package/dist/chunks/debugUtils-B86DM1Sp.js +1 -0
  92. package/dist/chunks/{detached-CqfQYVOi.js → detached--wGwkuHX.js} +1 -2
  93. package/dist/chunks/{detectRepository-CMEkS5_2.js → detectRepository-Qy3zKoyn.js} +1 -1
  94. package/dist/chunks/detectRepository-tRUoPOKy.js +1 -0
  95. package/dist/chunks/{diff-CKlLimGq.js → diff-dfXWiuLA.js} +1 -1
  96. package/dist/chunks/directoryCompletion-BtlRKLzw.js +1 -0
  97. package/dist/chunks/doctor-aKE2bG5C.js +1 -0
  98. package/dist/chunks/{entry-DCbq734V.js → entry-wISucmYc.js} +4 -5
  99. package/dist/chunks/esm-CrJVXrKW.js +1 -0
  100. package/dist/chunks/{execFileNoThrow-mXq4K0rl.js → execFileNoThrow-DYm1GeGn.js} +1 -1
  101. package/dist/chunks/{execSyncWrapper-Ne33rRiD.js → execSyncWrapper-CqvQqke-.js} +1 -1
  102. package/dist/chunks/exit-pjN4EJHV.js +1 -0
  103. package/dist/chunks/exit-s9XGerrH.js +1 -0
  104. package/dist/chunks/{extraUsage-C86bZVgt.js → extraUsage-CwDhpClH.js} +1 -1
  105. package/dist/chunks/extractMemories-WmPLOLUT.js +1 -0
  106. package/dist/chunks/fast-BVABmasw.js +1 -0
  107. package/dist/chunks/fast-Cuj3bfFm.js +1 -0
  108. package/dist/chunks/{fileSuggestions-BalHmi1-.js → fileSuggestions-Dy2BUZzd.js} +2 -2
  109. package/dist/chunks/firstPartyEventLogger-CabA8fu0.js +1 -0
  110. package/dist/chunks/{firstPartyEventLogger-1RTgXHSz.js → firstPartyEventLogger-D4yuDP-n.js} +3 -5
  111. package/dist/chunks/flushGate-B6ecrC4j.js +1 -0
  112. package/dist/chunks/{fpsMetrics-DffAomdg.js → fpsMetrics-Dk_pnSHJ.js} +1 -1
  113. package/dist/chunks/gemini-BC-BxZmj.js +1 -0
  114. package/dist/chunks/generateSessionName-JTR8nPYD.js +1 -0
  115. package/dist/chunks/{genericProcessUtils-Dc1pfb7J.js → genericProcessUtils-Bbcbi11g.js} +1 -1
  116. package/dist/chunks/git-BaSq69E7.js +1 -0
  117. package/dist/chunks/{git-CoQQ6YEf.js → git-DplvjXEY.js} +2 -3
  118. package/dist/chunks/{githubRepoPathMapping-CmpEaQoo.js → githubRepoPathMapping-Bk4FZrng.js} +1 -1
  119. package/dist/chunks/goal-B09SOyra.js +3 -0
  120. package/dist/chunks/grok-BBo3jGfP.js +1 -0
  121. package/dist/chunks/{grove-b9gGKgu4.js → grove-DsAIY-rZ.js} +2 -2
  122. package/dist/chunks/help-CELr6oJZ.js +1 -0
  123. package/dist/chunks/hooks-9rkDD2iw.js +1 -0
  124. package/dist/chunks/{hooks-C-QMGvCg.js → hooks-BI4NY5IC.js} +2 -2
  125. package/dist/chunks/initReplBridge-BYrL6ou1.js +1 -0
  126. package/dist/chunks/{install-DGH_bjUh.js → install-Dn3_M1Ui.js} +1 -1
  127. package/dist/chunks/{instrumentation-DQ705pC7.js → instrumentation-5cSwEKaF.js} +4 -4
  128. package/dist/chunks/{job-BaMT6Lb2.js → job-rW1mEYtm.js} +1 -1
  129. package/dist/chunks/{jwtUtils-FQWtM6iM.js → jwtUtils-YCoZL0FW.js} +1 -1
  130. package/dist/chunks/keybindings-B5kUoxvg.js +1 -0
  131. package/dist/chunks/{launchLocalMemory-CtZrkmaw.js → launchLocalMemory-CPucX8Xj.js} +2 -2
  132. package/dist/chunks/launchOnboarding--GCJWeeS.js +8 -0
  133. package/dist/chunks/loadAgentsDir-D-a1uUb5.js +1 -0
  134. package/dist/chunks/{loadAgentsDir-mcRW90aq.js → loadAgentsDir-JrGMJN05.js} +656 -693
  135. package/dist/chunks/loadPluginHooks-C4zrlV0u.js +1 -0
  136. package/dist/chunks/localSearch-C-stDP9C.js +1 -0
  137. package/dist/chunks/localSearch-hOERAH9v.js +1 -0
  138. package/dist/chunks/{log-27kCA_9u.js → log-BlJ7CcKG.js} +1 -1
  139. package/dist/chunks/{logoV2Utils--8OUQQPd.js → logoV2Utils-J2Sqfube.js} +1 -1
  140. package/dist/chunks/{magicDocs-26J_l1De.js → magicDocs-Dpe3YhyL.js} +2 -2
  141. package/dist/chunks/main-C_PDzJdv.js +356 -0
  142. package/dist/chunks/{main-CGLCy2pM.js → main-Zh18lf2J.js} +2 -2
  143. package/dist/chunks/managedEnv-AEhH_HUs.js +1 -0
  144. package/dist/chunks/{managedEnv-Ds6MlFQE.js → managedEnv-C8SisyLk.js} +1 -1
  145. package/dist/chunks/{mappers-DwZw084m.js → mappers-CMJorgSL.js} +1 -1
  146. package/dist/chunks/mcp-B2mJmWKt.js +6 -0
  147. package/dist/chunks/mcp-SuAh71Ht.js +2 -0
  148. package/dist/chunks/mcp-_tBxhPV-.js +1 -0
  149. package/dist/chunks/{memoize-Co4vS6UF.js → memoize-_2f7NWDv.js} +1 -1
  150. package/dist/chunks/memory-DK8bOrUr.js +1 -0
  151. package/dist/chunks/{modalContext-CUThy6Ph.js → modalContext-wY9CeN4G.js} +1 -1
  152. package/dist/chunks/{mode-B80CHkqo.js → mode-BhfhEpnW.js} +2 -2
  153. package/dist/chunks/model-BCM7RpVk.js +1 -0
  154. package/dist/chunks/model-BWR43D3c.js +1 -0
  155. package/dist/chunks/model-CmDF8O9G.js +1 -0
  156. package/dist/chunks/modelOptions-DEQat7lU.js +1 -0
  157. package/dist/chunks/nativeInstaller-xxyUjXbl.js +1 -0
  158. package/dist/chunks/{omit-KEhe84f4.js → omit-od_CYp5o.js} +1 -1
  159. package/dist/chunks/{onChangeAppState-Dq1tIEJI.js → onChangeAppState-CqTb0yEa.js} +1 -1
  160. package/dist/chunks/openai-qW8mATAs.js +10 -0
  161. package/dist/chunks/{panel-CoF2a-h4.js → panel-Bg_0PHE6.js} +1 -1
  162. package/dist/chunks/{parser-CUUiH40T.js → parser-a2S_eFyE.js} +1 -1
  163. package/dist/chunks/parser-x-w3ikxt.js +1 -0
  164. package/dist/chunks/{partition-DeT341qu.js → partition-CYoWXLNU.js} +1 -1
  165. package/dist/chunks/permissions--iKUbWBw.js +3 -0
  166. package/dist/chunks/pidLock-BR4hzYgp.js +3 -0
  167. package/dist/chunks/plan-DiHCGXhM.js +1 -0
  168. package/dist/chunks/{platform-Dg1c9F_1.js → platform-DVeTi9mp.js} +2 -2
  169. package/dist/chunks/plugin-BeC4D7XF.js +17 -0
  170. package/dist/chunks/pluginAutoupdate-Bj-CrFuO.js +1 -0
  171. package/dist/chunks/{pluginBlocklist-BfoLN9a-.js → pluginBlocklist-DzOs-RS1.js} +1 -1
  172. package/dist/chunks/{pluginCliCommands-Bc2Iybhz.js → pluginCliCommands-DwIGn58t.js} +1 -1
  173. package/dist/chunks/{pluginFlagging-Cr0d0hBA.js → pluginFlagging-BzuymJuf.js} +1 -1
  174. package/dist/chunks/pluginOperations-CP1v-nu0.js +2 -0
  175. package/dist/chunks/pluginStartupCheck-BGN6Je6d.js +1 -0
  176. package/dist/chunks/{pluginStartupCheck-DiCDQQlr.js → pluginStartupCheck-BUeBiYVq.js} +1 -1
  177. package/dist/chunks/plugins-D1N31THW.js +4 -0
  178. package/dist/chunks/{poorMode-DxgO_bUb.js → poorMode-D4L_-yWS.js} +1 -1
  179. package/dist/chunks/poorMode-XDBnxTiF.js +1 -0
  180. package/dist/chunks/print-DaJi1wF_.js +14 -0
  181. package/dist/chunks/processBashCommand-BGCIqxc9.js +1 -0
  182. package/dist/chunks/processSlashCommand-qR_j1DE8.js +5 -0
  183. package/dist/chunks/prompt-B0gADAvI.js +1 -0
  184. package/dist/chunks/{prompt-DIlq8NTy.js → prompt-DnPppVz8.js} +21 -23
  185. package/dist/chunks/prompt-DqyEtC_I2.js +1 -0
  186. package/dist/chunks/{promptEditor-BILqOGl1.js → promptEditor-Cilc9N3L.js} +3 -3
  187. package/dist/chunks/protocolHandler-DdbiucQa.js +13 -0
  188. package/dist/chunks/{proxy-BEKNaTXI.js → proxy-C0j74LqT.js} +1 -1
  189. package/dist/chunks/reconciler-Bte4gdP-.js +1 -0
  190. package/dist/chunks/refresh-MiZ0acBm.js +1 -0
  191. package/dist/chunks/registerProtocol-Bpte9dly.js +1 -0
  192. package/dist/chunks/{reload-plugins-CGb0HTsH.js → reload-plugins-GdqFZblC.js} +1 -1
  193. package/dist/chunks/{remoteBridgeCore-BmteXmI9.js → remoteBridgeCore-CAl3_H-O.js} +1 -1
  194. package/dist/chunks/{remoteManagedSettings-CwDGxL5p.js → remoteManagedSettings-BcLJLEr7.js} +1 -1
  195. package/dist/chunks/rename-BDo5qIK0.js +1 -0
  196. package/dist/chunks/{renderOptions-45A-EdsK.js → renderOptions-CkqTbz6d.js} +1 -1
  197. package/dist/chunks/resume-Bbweh2hA.js +2 -0
  198. package/dist/chunks/ripgrep-DrpZ79Pp.js +1 -0
  199. package/dist/chunks/{ripgrep-DQ_ILUJV.js → ripgrep-X5m4gJ-3.js} +1 -1
  200. package/dist/chunks/{runtimeObserver-CtNY8Al2.js → runtimeObserver-CxXxUcrm.js} +1 -1
  201. package/dist/chunks/{runtimeObserver-4ZqaCXYy.js → runtimeObserver-Hjbo43xj.js} +4 -4
  202. package/dist/chunks/sandbox-adapter-DQ_fJSIo.js +1 -0
  203. package/dist/chunks/sandbox-toggle-DmNSThQK.js +1 -0
  204. package/dist/chunks/searchExtraTools-C7b2x2p_.js +1 -0
  205. package/dist/chunks/{session-wb6X4Wrq.js → session-CkuTMD_4.js} +2 -2
  206. package/dist/chunks/sessionFileAccessHooks-CQvGAbvL.js +1 -0
  207. package/dist/chunks/{sessionIdCompat-DMayYBrf.js → sessionIdCompat-Dgp6PW_1.js} +1 -1
  208. package/dist/chunks/sessionObserver-BoQY7nOa.js +1 -0
  209. package/dist/chunks/{sessionObserver-BJQ5hwjU.js → sessionObserver-CvQ6oyoj.js} +2 -2
  210. package/dist/chunks/sessionState-C2REgUrs.js +11 -0
  211. package/dist/chunks/sessionStorage-BeaEgnaa.js +1 -0
  212. package/dist/chunks/sessionStoragePortable-x0Yn02-G.js +3 -0
  213. package/dist/chunks/{sessionTitle-Cbzrb9jT.js → sessionTitle-2IWcNB8H.js} +2 -2
  214. package/dist/chunks/{sessionTracing-CEsm8pZL.js → sessionTracing-Bm7hQKHA.js} +2 -2
  215. package/dist/chunks/settings-Da6ax5aI.js +1 -0
  216. package/dist/chunks/{settings-DiBMs2gM.js → settings-aUygByiZ.js} +4 -5
  217. package/dist/chunks/settingsSync-DgzCU1BZ.js +1 -0
  218. package/dist/chunks/setup-CvaG4nl5.js +3 -0
  219. package/dist/chunks/{shadowedRuleDetection-D5X5fhzj.js → shadowedRuleDetection-CWCQ5dZ0.js} +1 -1
  220. package/dist/chunks/{shellQuote-C_I6DHLV.js → shellQuote-D3Ocv_U-.js} +1 -1
  221. package/dist/chunks/{sideQuestion-BHRtwhyj.js → sideQuestion-BoW-xYkh.js} +3 -3
  222. package/dist/chunks/sinks-B_ehGpvp.js +1 -0
  223. package/dist/chunks/sinks-ZHKfs6gv.js +1 -0
  224. package/dist/chunks/skillChangeDetector-C-HWR_8v.js +1 -0
  225. package/dist/chunks/{skillGapStore-BjQSSz2E.js → skillGapStore-CCNeSjIb.js} +2 -2
  226. package/dist/chunks/{skillLifecycle-Sp8strFv.js → skillLifecycle-wU4JDNYQ.js} +2 -2
  227. package/dist/chunks/{skillSearchPanel-3sYRez_Q.js → skillSearchPanel-Cxr1QQn4.js} +4 -4
  228. package/dist/chunks/skills-BghnKnNo.js +1 -0
  229. package/dist/chunks/{src-r6ZFgWPx2.js → src-D3yIF9I42.js} +1 -1
  230. package/dist/chunks/src-DL3w8VPk2.js +51 -0
  231. package/dist/chunks/{startupProfiler-Dc5r6LgE.js → startupProfiler-2sjXZkIP.js} +1 -1
  232. package/dist/chunks/startupProfiler-B2fyaBEa.js +1 -0
  233. package/dist/chunks/{staticRender-DrU6eWoq.js → staticRender-D9AbnQFr.js} +1 -1
  234. package/dist/chunks/{stats-BkadEKa-.js → stats-unp6R0Ah.js} +1 -1
  235. package/dist/chunks/status-BraYBx4N.js +2 -0
  236. package/dist/chunks/status-DwyWiaVc.js +1 -0
  237. package/dist/chunks/statusNoticeHelpers-Dm1aiibR.js +1 -0
  238. package/dist/chunks/{stringUtils-Df-Lnjxd.js → stringUtils-BjnclTLB.js} +3 -3
  239. package/dist/chunks/{switcher-uoQMHmEZ.js → switcher-BUNSEJ-7.js} +1 -1
  240. package/dist/chunks/switcher-DDUnWU_4.js +1 -0
  241. package/dist/chunks/{syncCache-BooMjgU6.js → syncCache-1s9xV8WV.js} +1 -1
  242. package/dist/chunks/tasks-BjFot03S.js +1 -0
  243. package/dist/chunks/teleport-Dj2Kvbmx.js +1 -0
  244. package/dist/chunks/{templateJobs-BYYfF4m5.js → templateJobs-CY7GNRo5.js} +1 -3
  245. package/dist/chunks/{terminalSetup-fwhFTxGi.js → terminalSetup-CpMNk6dc.js} +5 -6
  246. package/dist/chunks/{terminalSetup-CbXKCpWM.js → terminalSetup-Ty8T8ePM.js} +1 -1
  247. package/dist/chunks/theme-c6grxWNn.js +1 -0
  248. package/dist/chunks/{tmux-d3cNCIZA.js → tmux-g0cQ0Buz.js} +1 -1
  249. package/dist/chunks/{toolEventObserver-BFEl47bq.js → toolEventObserver-D7WbjgFR.js} +1 -1
  250. package/dist/chunks/toolPool-O5nkEFb1.js +1 -0
  251. package/dist/chunks/{trustedDevice-BLiKbGpG.js → trustedDevice-BF78PNK8.js} +1 -1
  252. package/dist/chunks/trustedDevice-D_z7bAQh.js +1 -0
  253. package/dist/chunks/{types-BJ7qTz75.js → types-BomO8WUz.js} +1 -1
  254. package/dist/chunks/{udsClient-CF8BmZgN.js → udsClient-DSvRPCvR.js} +1 -1
  255. package/dist/chunks/updateCCB-ts7Joyve.js +5 -0
  256. package/dist/chunks/upstreamproxy-DYoLvdM9.js +10 -0
  257. package/dist/chunks/useExitOnCtrlCDWithKeybindings-qLfN0tc-.js +1 -0
  258. package/dist/chunks/useMainLoopModel-DkjG_ikT.js +1 -0
  259. package/dist/chunks/useManagePlugins-E0Qzj-ws.js +1 -0
  260. package/dist/chunks/useMergedTools-B7iYaNwM.js +1 -0
  261. package/dist/chunks/{useSearchInput-KFKh2ozY.js → useSearchInput-CsxiM9i0.js} +1 -1
  262. package/dist/chunks/useSettingsErrors-DdVTahNa.js +1 -0
  263. package/dist/chunks/{userAgent-DUrr02yh.js → userAgent-BggRZ-ZE.js} +1 -1
  264. package/dist/chunks/util-Xdy1nOjj.js +1 -0
  265. package/dist/chunks/validatePlugin-Be5aSSnP.js +1 -0
  266. package/dist/chunks/{vim-C4Hs5U2h.js → vim-cFcxfuac.js} +1 -1
  267. package/dist/chunks/{which-mplwBbc0.js → which-BR8YVCCW.js} +1 -1
  268. package/dist/chunks/{windowsPaths-C7Mdo9aU.js → windowsPaths-BmXyrasP.js} +1 -1
  269. package/dist/chunks/windowsPaths-BybjGW7e.js +1 -0
  270. package/dist/chunks/{workSecret-XLodD7tw.js → workSecret-BUd8cQ6-.js} +1 -1
  271. package/dist/chunks/workerRegistry-GrD7IAVQ.js +2 -0
  272. package/dist/chunks/worktree-V7xiUAtl.js +1 -0
  273. package/dist/cli.js +1 -1
  274. package/package.json +1 -1
  275. package/dist/chunks/AddWorkspaceDirectory-BzNj9rS6.js +0 -1
  276. package/dist/chunks/AgentsMdExternalIncludesDialog-CDZPR488.js +0 -1
  277. package/dist/chunks/App-D-bYAYAl.js +0 -1
  278. package/dist/chunks/ApproveApiKey-BEGV9Zj9.js +0 -1
  279. package/dist/chunks/ApproveApiKey-CjacpIqq.js +0 -1
  280. package/dist/chunks/BackgroundTasksDialog-A9hw_SV0.js +0 -2
  281. package/dist/chunks/DiffDialog-mQ-5_TSv.js +0 -6
  282. package/dist/chunks/Doctor-BC6IuQhd.js +0 -3
  283. package/dist/chunks/Doctor-i_5_AQd-.js +0 -1
  284. package/dist/chunks/ExitFlow-Bu2cVGpC.js +0 -2
  285. package/dist/chunks/InvalidConfigDialog-C5CIiSIE.js +0 -1
  286. package/dist/chunks/InvalidSettingsDialog-Dq7hKXcO.js +0 -1
  287. package/dist/chunks/MCPConnectionManager-aDDsYkGM.js +0 -1
  288. package/dist/chunks/MCPToolListView-Cr0MDkzT.js +0 -1
  289. package/dist/chunks/MessageSelector-DwGOWKKL.js +0 -3
  290. package/dist/chunks/Messages-C1jh4ixt.js +0 -11
  291. package/dist/chunks/PermissionDialog-Cb3z8OUP.js +0 -1
  292. package/dist/chunks/PressEnterToContinue-Dq0Imo9c.js +0 -1
  293. package/dist/chunks/PromptInputHelpMenu-BgADIzRj.js +0 -1
  294. package/dist/chunks/QueryEngine-HlLQJmsd.js +0 -1
  295. package/dist/chunks/REPL-Rs_JQkDc.js +0 -1
  296. package/dist/chunks/REPL-VKAmKkII.js +0 -133
  297. package/dist/chunks/RemoteSessionManager-BbgXeM-t.js +0 -2
  298. package/dist/chunks/ResumeConversation-66zbx12g.js +0 -1
  299. package/dist/chunks/SSETransport-BBQkdn4e.js +0 -4
  300. package/dist/chunks/SearchExtraToolsTool-Bq87I_vu.js +0 -1
  301. package/dist/chunks/Settings-BKdLcyXe.js +0 -2
  302. package/dist/chunks/ThemePicker-DUlhcoso.js +0 -1
  303. package/dist/chunks/ValidationErrorsList-DSSUWdgd.js +0 -2
  304. package/dist/chunks/add-dir-BUr0z-VU.js +0 -1
  305. package/dist/chunks/agents-8ELI8RJo.js +0 -103
  306. package/dist/chunks/allErrors-C1eMbHSv.js +0 -1
  307. package/dist/chunks/api-DgjIFdMn.js +0 -1
  308. package/dist/chunks/attributionHooks-CUAoGkU6.js +0 -1
  309. package/dist/chunks/auth-B73a4Cob.js +0 -1
  310. package/dist/chunks/auth-D_0waidQ.js +0 -1
  311. package/dist/chunks/autoModeDenials-BxNzGJdR.js +0 -1
  312. package/dist/chunks/backgroundHousekeeping-C_ArdTFX.js +0 -17
  313. package/dist/chunks/backgroundHousekeeping-YJhvZ0dh.js +0 -1
  314. package/dist/chunks/branch-bb4-bErF.js +0 -3
  315. package/dist/chunks/bridgeConfig-DywkIo_k.js +0 -1
  316. package/dist/chunks/btw-BRmV51bR.js +0 -1
  317. package/dist/chunks/caches-C5DIVdvI.js +0 -1
  318. package/dist/chunks/caches-zDZEgNKq.js +0 -1
  319. package/dist/chunks/client-7lIxWcaM.js +0 -1
  320. package/dist/chunks/client-DVg8PpFX.js +0 -1
  321. package/dist/chunks/commands-ByFXqW43.js +0 -1
  322. package/dist/chunks/compact-BUShp2eQ.js +0 -2
  323. package/dist/chunks/config-BwHNU_pI.js +0 -1
  324. package/dist/chunks/context-6Pk3iVhh.js +0 -1
  325. package/dist/chunks/context-noninteractive-DFwRQyFE.js +0 -1
  326. package/dist/chunks/conversation-5zb5XkSA.js +0 -1
  327. package/dist/chunks/conversation-JP2ZXrwu.js +0 -1
  328. package/dist/chunks/createSession-VTqzWAu6.js +0 -1
  329. package/dist/chunks/crossProjectResume-DxgQVYSi.js +0 -40
  330. package/dist/chunks/debugUtils-cK-iOsEV.js +0 -1
  331. package/dist/chunks/detectRepository-BsKZDRoI.js +0 -1
  332. package/dist/chunks/directoryCompletion-ByBTSuLu.js +0 -1
  333. package/dist/chunks/doctor-Bvx0u0sO.js +0 -1
  334. package/dist/chunks/esm-CtQkOk5D.js +0 -1
  335. package/dist/chunks/exit-BOhGfSlm.js +0 -2
  336. package/dist/chunks/exit-DTsz5Lcb.js +0 -1
  337. package/dist/chunks/extractMemories-6OnMgL2S.js +0 -1
  338. package/dist/chunks/fast-B2ziqJEA.js +0 -1
  339. package/dist/chunks/fast-BkhjaTkZ.js +0 -1
  340. package/dist/chunks/firstPartyEventLogger-CXMzhLrF.js +0 -1
  341. package/dist/chunks/flushGate-DWL05x7v.js +0 -1
  342. package/dist/chunks/gemini-BLpLJyli.js +0 -1
  343. package/dist/chunks/generateSessionName-CdbMksHi.js +0 -1
  344. package/dist/chunks/git-Bs1vtuvX.js +0 -1
  345. package/dist/chunks/goal-V3qix-i1.js +0 -3
  346. package/dist/chunks/grok-BLLATotv.js +0 -1
  347. package/dist/chunks/help-BR7UEr5R.js +0 -1
  348. package/dist/chunks/hooks-D6wtd0Qq.js +0 -1
  349. package/dist/chunks/initReplBridge-DyScxedy.js +0 -1
  350. package/dist/chunks/keybindings-CG292HS1.js +0 -2
  351. package/dist/chunks/launchOnboarding-CyOtdZkT.js +0 -8
  352. package/dist/chunks/loadAgentsDir-4UC4yLg1.js +0 -1
  353. package/dist/chunks/loadPluginHooks-CWI0RMUx.js +0 -1
  354. package/dist/chunks/localSearch-CCCDKpYx.js +0 -1
  355. package/dist/chunks/localSearch-D4hVR7-d.js +0 -1
  356. package/dist/chunks/main-DUjtDK1Q.js +0 -513
  357. package/dist/chunks/managedEnv-BuCurT_S.js +0 -1
  358. package/dist/chunks/mcp-CEKR7PjL.js +0 -6
  359. package/dist/chunks/mcp-DCAf2hHD.js +0 -1
  360. package/dist/chunks/mcp-mCuc8dNe.js +0 -2
  361. package/dist/chunks/memory-B5SkpC7u.js +0 -1
  362. package/dist/chunks/model-BqaneI4D.js +0 -1
  363. package/dist/chunks/model-C29_32BD.js +0 -1
  364. package/dist/chunks/model-NG8fvuT2.js +0 -1
  365. package/dist/chunks/modelOptions-CiZgZxZC.js +0 -1
  366. package/dist/chunks/nativeInstaller-DqbEfGSX.js +0 -1
  367. package/dist/chunks/openai-BvnsYTpQ.js +0 -10
  368. package/dist/chunks/parser-B2PlJg4C.js +0 -1
  369. package/dist/chunks/permissions-BPpeHxpk.js +0 -3
  370. package/dist/chunks/pidLock-DQGDoFQP.js +0 -3
  371. package/dist/chunks/plan-BRiC5ujG.js +0 -1
  372. package/dist/chunks/plugin-Dcg_GGR9.js +0 -17
  373. package/dist/chunks/pluginAutoupdate-ByH9IPC9.js +0 -1
  374. package/dist/chunks/pluginOperations-CKNyYjS-.js +0 -2
  375. package/dist/chunks/pluginStartupCheck-B48_cGgo.js +0 -1
  376. package/dist/chunks/plugins-BP_36tOl.js +0 -4
  377. package/dist/chunks/poorMode-Djw0P9Gu.js +0 -1
  378. package/dist/chunks/print-2uavraPq.js +0 -26
  379. package/dist/chunks/processBashCommand-g3sAMpHt.js +0 -1
  380. package/dist/chunks/processSlashCommand-tIbeCrv5.js +0 -5
  381. package/dist/chunks/prompt-DLv-Cd67.js +0 -1
  382. package/dist/chunks/prompt-DV5tCLRh.js +0 -1
  383. package/dist/chunks/protocolHandler-B83fCYI4.js +0 -13
  384. package/dist/chunks/reconciler-CDq6XgAS.js +0 -1
  385. package/dist/chunks/refresh-ysrhoWCo.js +0 -1
  386. package/dist/chunks/registerProtocol-DduKPsn_.js +0 -36
  387. package/dist/chunks/rename-1GLIUlYk.js +0 -1
  388. package/dist/chunks/resume-DWtlUiHW.js +0 -2
  389. package/dist/chunks/ripgrep-BLQnqPnE.js +0 -1
  390. package/dist/chunks/sandbox-adapter-BzjRQh_r.js +0 -1
  391. package/dist/chunks/sandbox-toggle-Bz49-F6e.js +0 -1
  392. package/dist/chunks/searchExtraTools-D6vj8qJ-.js +0 -1
  393. package/dist/chunks/sessionFileAccessHooks-Da97UA2n.js +0 -1
  394. package/dist/chunks/sessionObserver-DXO4trhk.js +0 -1
  395. package/dist/chunks/sessionState-Bn3ESS5f.js +0 -11
  396. package/dist/chunks/sessionStorage-DlPVsQn9.js +0 -1
  397. package/dist/chunks/sessionStoragePortable-BhkGMZWp.js +0 -3
  398. package/dist/chunks/settings-3ionQKNv.js +0 -1
  399. package/dist/chunks/settingsSync-eHaSngKo.js +0 -1
  400. package/dist/chunks/setup-DeyiuGNX.js +0 -3
  401. package/dist/chunks/sinks-Bgy2UNK-.js +0 -2
  402. package/dist/chunks/sinks-CgzLmim2.js +0 -1
  403. package/dist/chunks/skillChangeDetector-BlSP16j6.js +0 -1
  404. package/dist/chunks/skills-CJhWI8t1.js +0 -1
  405. package/dist/chunks/src-P_wYS_NJ2.js +0 -53
  406. package/dist/chunks/startupProfiler-CUlV07MD.js +0 -1
  407. package/dist/chunks/status-CDCurOqs.js +0 -2
  408. package/dist/chunks/status-yoQIQ2Ni.js +0 -1
  409. package/dist/chunks/statusNoticeHelpers-Sl4jjauz.js +0 -1
  410. package/dist/chunks/switcher-C-m6MUwE.js +0 -1
  411. package/dist/chunks/tasks-CHG_6sXQ.js +0 -1
  412. package/dist/chunks/teleport-C9KRE4X8.js +0 -1
  413. package/dist/chunks/theme-MvX7hojJ.js +0 -1
  414. package/dist/chunks/toolPool-Cq74Cvjp.js +0 -1
  415. package/dist/chunks/trustedDevice-BGwujSqc.js +0 -1
  416. package/dist/chunks/updateCCB-CfckOy7T.js +0 -11
  417. package/dist/chunks/upstreamproxy-BuBFDFAD.js +0 -11
  418. package/dist/chunks/useExitOnCtrlCDWithKeybindings-CPLBDluY.js +0 -1
  419. package/dist/chunks/useMainLoopModel-C00PbZ1Q.js +0 -1
  420. package/dist/chunks/useManagePlugins-DFaGntzJ.js +0 -1
  421. package/dist/chunks/useMergedTools-DYobZ5N4.js +0 -1
  422. package/dist/chunks/useSettingsErrors-BRgjvaHd.js +0 -1
  423. package/dist/chunks/util-D7uwPgF1.js +0 -1
  424. package/dist/chunks/validatePlugin-VukX52bx.js +0 -1
  425. package/dist/chunks/windowsPaths-B8p9tFRF.js +0 -1
  426. package/dist/chunks/workerRegistry-BA37PVbv.js +0 -6
  427. package/dist/chunks/worktree-Lik8xuKd.js +0 -1
  428. package/dist/chunks/xdg-DcF9ejUM.js +0 -1
@@ -0,0 +1,10 @@
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{l as n,o as r}from"./envUtils-DcaKZlRU.js";import{n as i,t as a}from"./figures-5ThXQEtq.js";import{Aa as o,Af as s,Ag as c,Ba as l,Bu as u,By as d,Ca as f,Cp as p,Ga as m,Gf as h,Hf as g,Ia as _,Ja as v,Jm as y,Kf as b,Ky as x,La as S,Ma as C,Mf as w,Na as T,Rf as E,Uf as D,Uh as O,Uy as k,Vf as ee,Vu as te,Wf as ne,Wh as re,Wy as A,Xh as j,Ya as ie,Za as M,Zh as ae,_C as oe,aS as se,aT as ce,cT as N,dC as le,eT as P,fC as ue,gC as de,gp as fe,hp as pe,ja as me,jf as he,ka as ge,lC as _e,la as ve,ma as ye,na as be,oS as xe,pC as Se,qm as F,ra as Ce,sC as we,sS as Te,tT as Ee,ta as I,uC as De,ua as Oe,wa as ke,wp as Ae,xC as je,zu as Me}from"./loadAgentsDir-JrGMJN05.js";import{C as Ne,Gr as L,I as R,N as Pe,P as z,Pn as Fe,Rn as Ie,ai as B,di as Le,fi as Re,j as ze,mt as Be,ot as Ve,t as V,xt as He}from"./src-DL3w8VPk2.js";import{t as H}from"./jsx-runtime-Bb4Xn-E0.js";import{B as Ue,Wt as We}from"./state-BPFYBqm1.js";import{n as Ge,t as Ke}from"./cwd-Besi3Os3.js";import{a as qe,c as Je,i as Ye,n as Xe,o as Ze}from"./debug-BQj6h99Q.js";import{Ht as Qe,Wt as $e,g as et,n as tt}from"./settings-aUygByiZ.js";import{c as nt,h as rt,y as it}from"./config-BkbL2e5Q.js";import{B as at,L as ot,R as st,q as ct}from"./log-BlJ7CcKG.js";import{b as lt,f as ut,m as dt,v as ft}from"./startupProfiler-2sjXZkIP.js";import{l as pt,o as mt}from"./stringUtils-BjnclTLB.js";import{Bt as ht,Dt as gt,E as _t,Gt as vt,St as yt,Tt as bt,_ as xt,_n as St,b as Ct,vn as wt}from"./model-CmDF8O9G.js";import{_n as Tt,yn as Et}from"./prompt-DnPppVz8.js";import{d as Dt,f as Ot,h as kt,p as At}from"./terminalSetup-CpMNk6dc.js";import{at as jt,st as Mt}from"./sessionState-C2REgUrs.js";import{n as Nt,t as Pt}from"./systemTheme-Ceakddth.js";import{n as Ft,r as It}from"./PromptInputFooterSuggestions-OEXx0Abp.js";import{n as Lt,t as Rt}from"./useMainLoopModel-DkjG_ikT.js";import{n as zt,t as Bt}from"./modalContext-wY9CeN4G.js";import{n as Vt,r as Ht,t as Ut}from"./statusNoticeHelpers-Dm1aiibR.js";import{a as Wt,c as Gt,i as Kt,l as qt,n as Jt,o as Yt,r as Xt,t as Zt,u as Qt}from"./logoV2Utils-J2Sqfube.js";import{homedir as $t}from"os";import{relative as en}from"path";import{fileURLToPath as tn}from"url";function nn(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var rn=e((()=>{}));function an(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`)||ke(t.text,`status`)!==`completed`?!1:ke(t.text,`summary`)?.startsWith(`Background command `)??!1}function on(e,t){if(!re()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(an(t)){let i=0;for(;r<e.length&&an(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${at}><${ot}>completed</${ot}><${st}>${i} background commands completed</${st}></${at}>`}]}})}else n.push(t),r++}return n}var sn=e((()=>{ct(),c(),O(),S()}));function cn(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function ln(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(cn(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!cn(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 un=e((()=>{}));function dn(e){let t=mn.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),mn.set(e,t)),t}function fn(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 pn(e,t,n=!1){if(n)return{messages:e};let r=dn(t),i=new Map;for(let t of e){let e=fn(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=fn(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=fn(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 mn,hn=e((()=>{mn=new WeakMap}));function gn(e){let t=Sn.get(e);if(t!==void 0)return t;let n=_n(e).toLowerCase();return Sn.set(e,n),n}function _n(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=xn.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?xn.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(yn(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`?[vn(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(bn,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function vn(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 yn(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`\n${e}`:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
8
+ `))}return n.join(`
9
+ `)}var bn,xn,Sn,Cn=e((()=>{S(),bn=`</system-reminder>`,xn=new Set([be,Ce]),Sn=new WeakMap}));function wn({pose:e=`default`}={}){return(0,Tn.jsxs)(R,{flexDirection:`column`,alignItems:`center`,children:[(0,Tn.jsx)(z,{color:`clawd_body`,children:` █████ `}),(0,Tn.jsx)(z,{color:`clawd_body`,children:`██ ● ● ██`}),(0,Tn.jsx)(z,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,Tn.jsx)(z,{color:`clawd_body`,children:` █ █ █ █ `})]})}var Tn,En=e((()=>{V(),Tn=H()}));function Dn(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=L(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,L(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?L(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=L(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,L(r))),o}function On({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?L(e.timestamp):0));return(0,U.jsxs)(R,{flexDirection:`column`,width:t,children:[(0,U.jsx)(z,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(z,{dimColor:!0,italic:!0,children:lt(i,t)})]}):r.length===0&&a?(0,U.jsx)(z,{dimColor:!0,children:lt(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(z,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(z,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(z,{children:lt(e.text,r)})]},n)}),i&&(0,U.jsx)(z,{dimColor:!0,italic:!0,children:lt(i,t)})]})]})}var U,kn=e((()=>{V(),ft(),U=H()}));function An({feeds:e,maxWidth:t}){let n=e.map(e=>Dn(e)),r=Math.max(...n),i=Math.min(r,t);return(0,Mn.jsx)(R,{flexDirection:`column`,children:e.map((t,n)=>(0,Mn.jsxs)(jn.Fragment,{children:[(0,Mn.jsx)(On,{config:t,actualWidth:i}),n<e.length-1&&(0,Mn.jsx)(Ne,{color:`claude`,width:i})]},n))})}var jn,Mn,Nn=e((()=>{jn=t(B(),1),V(),kn(),Mn=H()}));function Pn(e){let t=e.map(e=>{let t=dt(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 Fn(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${a.tick} `:``}${e}`})),n=Ke()===$t()?`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 In=e((()=>{i(),Ge(),ft()}));function Ln(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function Rn(){let{pose:e,bounceOffset:t,onClick:n}=zn();return(0,Vn.jsx)(R,{height:qn,flexDirection:`column`,onClick:n,children:(0,Vn.jsx)(R,{marginTop:t,flexShrink:0,children:(0,Vn.jsx)(wn,{pose:e})})})}function zn(){let[e]=(0,Bn.useState)(()=>tt().prefersReducedMotion??!1),[t,n]=(0,Bn.useState)(-1),r=(0,Bn.useRef)(Hn),i=()=>{e||t!==-1||(r.current=Un[Math.floor(Math.random()*Un.length)],n(0))};(0,Bn.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Gn,Kn);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Wn;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var Bn,Vn,Hn,Un,Wn,Gn,Kn,qn,Jn=e((()=>{Bn=t(B(),1),V(),et(),En(),Vn=H(),Hn=[...Ln(`default`,1,2),...Ln(`arms-up`,0,3),...Ln(`default`,0,1),...Ln(`default`,1,2),...Ln(`arms-up`,0,3),...Ln(`default`,0,1)],Un=[Hn,[...Ln(`look-right`,0,5),...Ln(`look-left`,0,5),...Ln(`default`,0,1)]],Wn={pose:`default`,offset:0},Gn=60,Kn=e=>e+1,qn=3}));function Yn(){let{columns:e}=Ve(),t=ae(e=>e.agent),n=_t(Lt()),{version:r,cwd:i,billingType:a,agentName:o}=Yt(),s=t??o,c=Math.max(e-15,20),l=lt(r,Math.max(c-11,6)),{shouldSplit:u,truncatedModel:d,truncatedBilling:f}=Xt(n,a,c),p=s?c-1-L(s)-3:c,m=Qt(i,Math.max(p,10));return(0,W.jsx)(F,{children:(0,W.jsxs)(R,{flexDirection:`row`,gap:2,alignItems:`center`,children:[re()?(0,W.jsx)(Rn,{}):(0,W.jsx)(wn,{}),(0,W.jsxs)(R,{flexDirection:`column`,children:[(0,W.jsxs)(z,{children:[(0,W.jsx)(z,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(z,{dimColor:!0,children:[`v`,l]})]}),u?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(z,{dimColor:!0,children:d}),(0,W.jsx)(z,{dimColor:!0,children:f})]}):(0,W.jsxs)(z,{dimColor:!0,children:[d,` · `,f]}),(0,W.jsx)(z,{dimColor:!0,children:s?`@${s} · ${m}`:m})]})]})})}var W,Xn=e((()=>{Rt(),je(),V(),j(),ft(),O(),qt(),xt(),y(),Jn(),En(),W=H()}));function Zn(){let e=(0,$n.useMemo)(Qn,[]),t=(0,$n.useMemo)(()=>nt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,$n.useEffect)(()=>{n&&it(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,er.jsx)(R,{paddingLeft:2,flexDirection:`column`,children:(0,er.jsx)(z,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Qn(){return tr}var $n,er,tr,nr=e((()=>{$n=t(B(),1),V(),rt(),er=H(),tr={tip:``,color:`dim`}}));function rr({char:e=`✻`}){let[t]=(0,ir.useState)(()=>tt().prefersReducedMotion??!1),[n,r]=(0,ir.useState)(t),i=(0,ir.useRef)(null),[a,o]=Be(n?null:50);return(0,ir.useEffect)(()=>{if(n)return;let e=setTimeout(r,sr,!0);return()=>clearTimeout(e)},[n]),n?(0,ar.jsx)(R,{ref:a,children:(0,ar.jsx)(z,{color:cr,children:e})}):(i.current===null&&(i.current=o),(0,ar.jsx)(R,{ref:a,children:(0,ar.jsx)(z,{color:te(Me((o-i.current)/or*360%360)),children:e})}))}var ir,ar,or,sr,cr,lr=e((()=>{ir=t(B(),1),$e(),V(),et(),u(),ar=H(),or=1500,sr=or*2,cr=te({r:153,g:153,b:153})}));function ur(){return Ct()&&(nt().opus1mMergeNoticeSeenCount??0)<mr}function dr(){let[e]=(0,fr.useState)(ur);return(0,fr.useEffect)(()=>{if(!e)return;let t=(nt().opus1mMergeNoticeSeenCount??0)+1;it(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,pr.jsxs)(R,{paddingLeft:2,children:[(0,pr.jsx)(rr,{char:`↑`}),(0,pr.jsx)(z,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var fr,pr,mr,hr=e((()=>{fr=t(B(),1),$e(),V(),rt(),xt(),lr(),pr=H(),mr=6}));function gr(){let e=Gt(),t=nt().oauthAccount?.displayName??``,{columns:r}=Ve(),i=kt(),a=ce.isSandboxingEnabled(),o=ae(e=>e.agent),s=nt(),[c]=(0,_r.useState)(()=>{let e=tt().companyAnnouncements;if(!(!e||e.length===0))return s.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,_r.useEffect)(()=>{i&&Ot()},[i]),!i&&n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let l=_t(Lt()),{version:u,cwd:d,billingType:f,agentName:p}=Yt(),m=o??p,h=lt(l,vr-20);if(!i&&!n(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Yn,{}),(0,G.jsx)(dr,{}),qe()&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(z,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Logging to: `,Ze()?`stderr`:Xe()]})]}),(0,G.jsx)(Zn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(z,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(z,{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,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(z,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(z,{children:c})]})]});let g=Wt(r),_=Nt(nt().theme),v=` ${ze(`claude`,_)(`Work Mate`)} ${ze(`inactive`,_)(`v${u}`)} `,y=ze(`claude`,_)(` Work Mate `);if(g===`compact`){let e=Kt(t);L(e)>r-4&&(e=Kt(null));let n=m?r-4-1-L(m)-3:r-4,i=Qt(d,Math.max(n,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F,{children:(0,G.jsxs)(R,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:y,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:r,children:[(0,G.jsx)(z,{bold:!0,children:e}),(0,G.jsx)(R,{marginY:1,children:(0,G.jsx)(wn,{})}),(0,G.jsx)(z,{dimColor:!0,children:h}),(0,G.jsx)(z,{dimColor:!0,children:f}),(0,G.jsx)(z,{dimColor:!0,children:m?`@${m} · ${i}`:i})]})}),(0,G.jsx)(dr,{}),a&&(0,G.jsx)(R,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(z,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}let b=Kt(t),x=!process.env.IS_DEMO&&s.oauthAccount?.organizationName?`${h} · ${f} · ${s.oauthAccount.organizationName}`:`${h} · ${f}`,S=m?vr-1-L(m)-3:vr,C=Qt(d,Math.max(S,10)),w=m?`@${m} · ${C}`:C,{leftWidth:T,rightWidth:E}=Zt(r,g,Jt(b,w,x));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(F,{children:(0,G.jsx)(R,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:v,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(R,{flexDirection:g===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(R,{flexDirection:`column`,width:T,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(R,{marginTop:1,children:(0,G.jsx)(z,{bold:!0,children:b})}),(0,G.jsx)(wn,{}),(0,G.jsxs)(R,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(z,{dimColor:!0,children:x}),(0,G.jsx)(z,{dimColor:!0,children:w})]})]}),g===`horizontal`&&(0,G.jsx)(R,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),g===`horizontal`&&(0,G.jsx)(An,{feeds:i?[Fn(Dt()),Pn(e)]:[Pn(e)],maxWidth:E})]})})}),(0,G.jsx)(dr,{}),qe()&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(z,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(z,{dimColor:!0,children:[`Logging to: `,Ze()?`stderr`:Xe()]})]}),(0,G.jsx)(Zn,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(z,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(z,{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,G.jsxs)(R,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(z,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(z,{children:c})]}),a&&(0,G.jsx)(R,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(z,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})})]})}var _r,G,vr,yr=e((()=>{V(),je(),qt(),ft(),En(),Nn(),In(),rt(),Pt(),et(),Ye(),_r=t(B(),1),At(),Xn(),y(),r(),nr(),hr(),N(),j(),Rt(),xt(),G=H(),vr=50}));function br({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,xr.jsx)(R,{minWidth:L(i)+8,children:(0,xr.jsx)(z,{dimColor:!0,children:i})})}var xr,Sr=e((()=>{V(),xr=H()}));function Cr({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,wr.jsx)(R,{minWidth:L(n),children:(0,wr.jsx)(z,{dimColor:!0,children:n})})}var wr,Tr=e((()=>{V(),wr=H()}));function Er(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=Nr(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(D(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&Nr(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=Nr(t.messages[0]?.message.content)?.input;if(D(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function Dr({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:c,streamingToolUseIDs:l,screen:u,canAnimate:d,lastThinkingBlockId:f,latestBashOutputUUID:p,columns:m,isLoading:_,lookups:v,shouldCollapseDiffs:y}){let b=u===`transcript`,x=e.type===`grouped_tool_use`,S=e.type===`collapsed_read_search`,w=S&&(h(e,c)||_&&!n),T=x?e.displayMessage:S?g(e):e,E=x||S?[]:o(e,v),D=qi(e,l,c,x||S?I:me(e,v),u,v),O=!1;if(d)if(x)O=e.messages.some(e=>{let t=Nr(e.message.content);return t?.type===`tool_use`&&c.has(t.id)});else if(S)O=h(e,c);else{let t=C(e);O=!t||c.has(t)}let k=b&&T.type===`assistant`&&Array.isArray(T.message.content)&&T.message.content.some(e=>e.type===`text`)&&(T.timestamp||T.message.model),ee=(0,Mr.jsx)(s,{message:e,lookups:v,addMargin:!k,containerWidth:k?void 0:m,tools:r,commands:i,verbose:a,inProgressToolUseIDs:c,progressMessagesForMessage:E,shouldAnimate:O,shouldShowDot:!0,isTranscriptMode:b,isStatic:D,isActiveCollapsedGroup:w,isUserContinuation:t,lastThinkingBlockId:f,latestBashOutputUUID:p,shouldCollapseDiffs:y});return k?(0,Mr.jsx)(F,{children:(0,Mr.jsxs)(R,{width:m,flexDirection:`column`,children:[(0,Mr.jsxs)(R,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,Mr.jsx)(Cr,{message:T,isTranscriptMode:b}),(0,Mr.jsx)(br,{message:T,isTranscriptMode:b})]}),ee]})}):(0,Mr.jsx)(F,{children:ee})}function Or(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=Nr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return ne(e).some(e=>t.has(e));let n=C(e);return!!n&&t.has(n)}function kr(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=Nr(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return ne(e).every(e=>t.has(e));if(e.type===`assistant`){let n=Nr(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=C(e);return!n||t.has(n)}function Ar(e,t){if(e.message!==t.message||e.screen!==t.screen||e.verbose!==t.verbose||e.message.type===`collapsed_read_search`&&t.screen!==`transcript`||e.columns!==t.columns||e.latestBashOutputUUID===e.message.uuid!=(t.latestBashOutputUUID===t.message.uuid)||e.lastThinkingBlockId!==t.lastThinkingBlockId&&he(t.message))return!1;let n=Or(e.message,e.streamingToolUseIDs),r=kr(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var jr,Mr,Nr,Pr,Fr=e((()=>{jr=t(B(),1),V(),b(),S(),w(),Mr=H(),Sr(),ta(),Tr(),y(),Nr=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},Pr=jr.memo(Dr,Ar)}));function Ir(e){return e.type===`attachment`&&Lr.has(e.attachment.type)}var Lr,Rr=e((()=>{Lr=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 zr(e){return Gr.filter(t=>t.isActive(e))}var K,Br,Vr,Hr,Ur,Wr,Gr,Kr=e((()=>{V(),x(),i(),Ge(),ft(),ht(),Ht(),K=H(),Br={id:`large-memory-files`,type:`warning`,isActive:e=>k(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:k(e.memoryFiles).map(e=>{let t=e.path.startsWith(Ke())?en(Ke(),e.path):e.path;return(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:a.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Large `,(0,K.jsx)(z,{bold:!0,children:t}),` will impact performance (`,ut(e.content.length),` chars > `,ut(d),`)`,(0,K.jsx)(z,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Vr={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=gt();return vt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=gt();return(0,K.jsxs)(R,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(z,{color:`warning`,children:a.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Hr={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=yt({skipRetrievingKeyFromApiKeyHelper:!0});return!!bt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=yt({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(R,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(z,{color:`warning`,children:a.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Ur={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=yt({skipRetrievingKeyFromApiKeyHelper:!0}),t=gt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=yt({skipRetrievingKeyFromApiKeyHelper:!0}),t=gt();return(0,K.jsxs)(R,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:a.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(R,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(z,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(z,{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.`]})]})]})}},Wr={id:`large-agent-descriptions`,type:`warning`,isActive:e=>Vt(e.agentDefinitions)>Ut,render:e=>{let t=Vt(e.agentDefinitions);return(0,K.jsxs)(R,{flexDirection:`row`,children:[(0,K.jsx)(z,{color:`warning`,children:a.warning}),(0,K.jsxs)(z,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,ut(t),` tokens > `,ut(Ut),`)`,(0,K.jsx)(z,{dimColor:!0,children:` · /agents to manage`})]})]})}},Gr=[Br,Wr,Vr,Hr,Ur]}));function qr({agentDefinitions:e}={}){let t={config:nt(),agentDefinitions:e,memoryFiles:(0,Yr.use)(A())},n=zr(t);return n.length===0?null:(0,Xr.jsx)(R,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Xr.jsx)(Jr.Fragment,{children:e.render(t)},e.id))})}var Jr,Yr,Xr,Zr=e((()=>{Jr=t(B(),1),Yr=t(B(),1),V(),x(),rt(),Kr(),Xr=H()}));function Qr(e,t,n){let r=(0,q.useRef)(new Map),i=(0,q.useRef)(0),a=(0,q.useRef)(0),o=(0,q.useRef)({arr:new Float64Array,version:-1,n:-1}),s=(0,q.useRef)(new Map),c=(0,q.useRef)(new Map),l=(0,q.useRef)(n),u=(0,q.useRef)(!1),d=(0,q.useRef)(null),f=(0,q.useRef)(0);if(l.current!==n){let e=l.current/n;l.current=n;for(let[t,n]of r.current)r.current.set(t,Math.max(1,Math.round(n*e)));i.current++,u.current=!0,f.current=2}let p=f.current>0?d.current:null,m=(0,q.useRef)(0),h=(0,q.useRef)(null);(0,q.useSyncExternalStore)((0,q.useCallback)(t=>e.current?.subscribe(t)??oi,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/ni);return t.isSticky()?~r:r});let g=e.current?.getScrollTop()??-1,_=e.current?.getPendingDelta()??0,v=e.current?.getViewportHeight()??0,y=e.current?.isSticky()??!0;(0,q.useMemo)(()=>{let e=new Set(t),n=!1;for(let t of r.current.keys())e.has(t)||(r.current.delete(t),n=!0);for(let t of c.current.keys())e.has(t)||c.current.delete(t);n&&i.current++},[t]);let b=t.length;if(o.current.version!==i.current||o.current.n!==b){let e=o.current.arr.length>=b+1?o.current.arr:new Float64Array(b+1);e[0]=0;for(let n=0;n<b;n++)e[n+1]=e[n]+(r.current.get(t[n])??$r);o.current={arr:e,version:i.current,n:b}}let x=o.current.arr,S=x[b],C,w;if(p)[C,w]=p,C=Math.min(C,b),w=Math.min(w,b);else if(v===0||g<0)C=Math.max(0,b-ti),w=b;else{if(y){let e=v+ei;for(C=b;C>0&&S-x[C-1]<e;)C--;w=b}else{let e=m.current,n=v*3,i=Math.min(g,g+_),a=Math.max(g,g+_),o=a-i,c=o>n&&_<0?a-n:i,l=c+Math.min(o,n),u=Math.max(0,c-e),f=l-e,p=u-ei;{let e=0,t=b;for(;e<t;){let n=e+t>>1;x[n+1]<=p?e=n+1:t=n}C=e}{let e=d.current;if(e&&e[0]<C)for(let n=e[0];n<Math.min(C,e[1]);n++){let e=t[n];if(s.current.has(e)&&!r.current.has(e)){C=n;break}}}let h=v+2*ei,y=Math.min(b,C+ii),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+ei);)S+=r.current.get(t[w])??ri,w++}let e=v+2*ei,n=Math.max(0,w-ii),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??ri;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??ri;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-ai&&(C=e-ai),w>t+ai&&(w=t+ai),C>w&&(w=Math.min(C+ai,b))}a.current=g}f.current>0?f.current--:d.current=[C,w];let T=(0,q.useDeferredValue)(C),E=(0,q.useDeferredValue)(w),D=C<T?T:C,O=w>E?E:w;if((D>O||y)&&(D=C,O=w),_>0&&(O=w),O-D>ii){let e=(x[D]+x[O])/2;g-m.current<e?O=D+ii:D=O-ii}let k=m.current,ee=x[D],te=D===0?0:ee+k,ne=O===b?1/0:Math.max(ee,x[O]-v)+k;(0,q.useLayoutEffect)(()=>{y?e.current?.setClampBounds(void 0,void 0):e.current?.setClampBounds(te,ne)}),(0,q.useLayoutEffect)(()=>{let e=h.current?.yogaNode;if(e&&e.getComputedWidth()>0&&(m.current=e.getComputedTop()),u.current){u.current=!1;return}let t=!1;for(let[e,n]of s.current){let i=n.yogaNode;if(!i)continue;let a=i.getComputedHeight(),o=r.current.get(e);a>0?o!==a&&(r.current.set(e,a),t=!0):i.getComputedWidth()>0&&o!==0&&(r.current.set(e,0),t=!0)}t&&i.current++});let re=(0,q.useCallback)(e=>{let t=c.current.get(e);return t||(t=t=>{if(t)s.current.set(e,t);else{let t=s.current.get(e)?.yogaNode;if(t&&!u.current){let n=t.getComputedHeight();(n>0||t.getComputedWidth()>0)&&r.current.get(e)!==n&&(r.current.set(e,n),i.current++)}s.current.delete(e)}},c.current.set(e,t)),t},[]),A=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),j=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),ie=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),M=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),ae=S-x[O];return{range:[D,O],topSpacer:ee,bottomSpacer:ae,measureRef:re,spacerRef:h,offsets:x,getItemTop:A,getItemElement:j,getItemHeight:ie,scrollToIndex:M}}var q,$r,ei,ti,ni,ri,ii,ai,oi,si=e((()=>{q=t(B(),1),$r=3,ei=40,ti=30,ni=20,ri=1,ii=200,ai=25,oi=()=>{}}));function ci({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,pi.jsx)(hi.Provider,{value:n,children:(0,pi.jsx)(_i.Provider,{value:i,children:(0,pi.jsx)(mi.Provider,{value:t,children:(0,pi.jsx)(gi.Provider,{value:r,children:e})})})})}function li(){return(0,J.useContext)(mi)}function ui(){return(0,J.useContext)(gi)}function di(e){let t=(0,J.useContext)(hi);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function fi(e){let t=(0,J.useContext)(_i);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,pi,mi,hi,gi,_i,vi=e((()=>{J=t(B(),1),pi=H(),mi=(0,J.createContext)(null),hi=(0,J.createContext)(null),gi=(0,J.createContext)(null),_i=(0,J.createContext)(null)}));function yi(e){let[t,n]=(0,Y.useState)(null),r=(0,Y.useRef)(e);r.current=e;let i=(0,Y.useRef)(null),a=(0,Y.useCallback)(()=>{n(null)},[]),o=(0,Y.useCallback)(e=>{let t=Math.max(0,e.getScrollHeight()-e.getViewportHeight());e.getScrollTop()+e.getPendingDelta()>=t||i.current===null&&(i.current=e.getScrollHeight(),n(r.current))},[]),s=(0,Y.useCallback)(e=>{e&&e.scrollToBottom()},[]);return(0,Y.useEffect)(()=>{t===null?i.current=null:e<t&&(i.current=null,n(null))},[e,t]),{dividerIndex:t,dividerYRef:i,onScrollAway:o,onRepin:a,jumpToNew:s,shiftDivider:(0,Y.useCallback)((e,t)=>{n(t=>t===null?null:t+e),i.current!==null&&(i.current+=t)},[])}}function bi(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`&&!xi(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function xi(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 Si(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||Ir(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=bi(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function Ci({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}=Ve(),[m,h]=(0,Y.useState)(null),g=(0,Y.useMemo)(()=>({setStickyPrompt:h}),[]),_=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!re())return;let e=Ie.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{Te(tn(e))}catch{}else xe(e)},()=>{e.onHyperlinkClick=void 0}},[]),re()){let s=l?null:m,h=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(ci,{children:[(0,X.jsx)(R,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(R,{flexDirection:`column`,flexGrow:1,width:p,overflow:`hidden`,children:[(0,X.jsxs)(R,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[h&&(0,X.jsx)(Ti,{text:h.text,onClick:h.scrollTo}),(0,X.jsxs)(He,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(ki,{value:g,children:e}),n]}),!c&&_&&n==null&&(0,X.jsx)(wi,{count:u,onClick:d}),r!=null&&(0,X.jsx)(R,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(R,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(Ei,{}),(0,X.jsx)(Di,{}),(0,X.jsx)(R,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(Bt,{value:{rows:f-Oi-1,columns:p-4,scrollRef:a??null},children:(0,X.jsxs)(R,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:f-Oi,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(R,{flexShrink:0,children:(0,X.jsx)(z,{color:`permission`,children:`▔`.repeat(p)})}),(0,X.jsx)(R,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function wi({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(R,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(R,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(z,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${pt(e,`message`)}`:`Jump to bottom`,` `,a.arrowDown,` `]})})})}function Ti({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(R,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(z,{color:`subtle`,wrap:`truncate-end`,children:[a.pointer,` `,e]})})}function Ei(){let e=li();return!e||e.suggestions.length===0?null:(0,X.jsx)(R,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(Ft,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function Di(){let e=ui();return e?(0,X.jsx)(R,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,Oi,ki,Ai=e((()=>{i(),Y=t(B(),1),zt(),vi(),je(),V(),se(),O(),mt(),Rr(),It(),X=H(),Oi=2,ki=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function ji(e){let t=zi.get(e);if(t!==void 0)return t;let n=gn(e);return zi.set(e,n),n}function Mi(e){let t=Vi.get(e);if(t!==void 0)return t;let n=Ni(e);return Vi.set(e,n),n}function Ni(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
10
+ `)}if(t===null)return null;let n=ue(t);return n.startsWith(`<`)||n===``?null:n}function Pi({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:l,renderItem:u}){return(0,Li.jsx)(R,{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,Li.jsx)(Pe.Provider,{value:a&&!i?`text`:void 0,children:u(t,n)})})}function Fi({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=ji,trackStickyPrompt:l,selectedIndex:u,cursorNavRef:d,setCursor:f,jumpRef:p,onSearchMatchesChange:m,scanElement:h,setPositions:g}){let _=(0,Z.useRef)([]),v=(0,Z.useRef)(e),y=(0,Z.useRef)(r);if(y.current!==r||e.length<_.current.length||e[0]!==v.current[0])_.current=e.map(e=>r(e));else for(let t=_.current.length;t<e.length;t++)_.current.push(r(e[t]));v.current=e,y.current=r;let b=_.current,{range:x,topSpacer:S,bottomSpacer:C,measureRef:w,spacerRef:T,offsets:E,getItemTop:D,getItemElement:O,getItemHeight:k,scrollToIndex:ee}=Qr(t,b,n),[te,ne]=x,re=(0,Z.useCallback)(t=>k(t)!==0&&le(e[t]),[k,e]);(0,Z.useImperativeHandle)(d,()=>{let n=e=>f?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:Se(e)?.name}),r=u??-1,i=(t,r,i=re)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>re(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),f?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,u,f,re]);let A=(0,Z.useRef)({offsets:E,start:te,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ee});A.current={offsets:E,start:te,getItemElement:O,getItemTop:D,messages:e,scrollToIndex:ee},(0,Z.useEffect)(()=>{if(u===void 0)return;let e=A.current,n=e.getItemElement(u);n?t.current?.scrollToElement(n,1):e.scrollToIndex(u)},[u,t]);let j=(0,Z.useRef)(null),ie=(0,Z.useRef)({msgIdx:-1,positions:[]}),M=(0,Z.useRef)(-1),ae=(0,Z.useRef)(0),oe=(0,Z.useRef)(0),se=(0,Z.useRef)(()=>{}),ce=(0,Z.useRef)(()=>{}),N=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),P=(0,Z.useRef)(-1),ue=(0,Z.useRef)(!1);function de(e){let t=A.current.getItemTop(e);return Math.max(0,t-Ri)}function fe(e){let n=t.current,{msgIdx:r,positions:i}=ie.current;if(!n||i.length===0||r<0){g?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=A.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-Ri)),l=s-n.getScrollTop(),d=c+l+o.row),g?.({positions:i,rowOffset:c+l,currentIdx:a});let f=N.current,p=f.prefixSum.at(-1)??0,h=(f.prefixSum[f.ptr]??0)+a+1;m?.(p,h),Je(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${h}/${p}`)}ce.current=fe;let[pe,me]=(0,Z.useState)(0),he=(0,Z.useCallback)(()=>me(e=>e+1),[]);(0,Z.useEffect)(()=>{let e=j.current;if(!e)return;let{idx:n,wantLast:r,tries:i}=e,a=t.current;if(!a)return;let{getItemElement:o,getItemTop:s,scrollToIndex:c}=A.current,l=o(n),u=l?.yogaNode?.getComputedHeight()??0;if(!l||u===0){if(i>1){j.current=null,Je(`seek(i=${n}): no mount after scrollToIndex, skip`),se.current(r?-1:1);return}j.current={idx:n,wantLast:r,tries:i+1},c(n),he();return}j.current=null,a.scrollTo(Math.max(0,s(n)-Ri));let d=h?.(l)??[];if(ie.current={msgIdx:n,positions:d},Je(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++ae.current>20){ae.current=0;return}se.current(r?-1:1);return}ae.current=0;let f=r?d.length-1:0;N.current.screenOrd=f,M.current=-1,ce.current(f);let p=oe.current;p&&(oe.current=0,se.current(p))},[pe]);function ge(e,n){let r=t.current;if(!r)return;let i=A.current,{getItemElement:a,scrollToIndex:o}=i;if(e<0||e>=i.messages.length)return;g?.(null),ie.current={msgIdx:-1,positions:[]},j.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(de(e)):o(e),he()}function _e(e){let t=N.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(j.current){oe.current=e;return}M.current<0&&(M.current=t.ptr);let{positions:a}=ie.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,fe(o),M.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===M.current){g?.(null),M.current=-1,Je(`step: wraparound at ptr=${s}, all ${n.length} msgs phantoms`);return}t.ptr=s,t.screenOrd=0,ge(n[s],e<0);let c=e<0?r[s+1]??i:r[s]+1;m?.(i,c)}se.current=_e,(0,Z.useImperativeHandle)(p,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(de(e))},setSearchQuery:e=>{j.current=null,ie.current={msgIdx:-1,positions:[]},M.current=-1,g?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=A.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=A.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=P.current>=0?P.current:s.getScrollTop(),n=1/0;for(let e=0;e<r.length;e++){let i=Math.abs(p+l[r[e]]-t);i<=n&&(n=i,o=e)}Je(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}N.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?ge(r[o],!0):P.current>=0&&s&&s.scrollTo(P.current),m?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>_e(1),prevMatch:()=>_e(-1),setAnchor:()=>{let e=t.current;e&&(P.current=e.getScrollTop())},disarmSearch:()=>{g?.(null),j.current=null,ie.current={msgIdx:-1,positions:[]},M.current=-1},warmSearchIndex:async()=>{if(ue.current)return 0;let e=A.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await wt(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 Je(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),ue.current=!0,Math.round(t)}}),[t]);let[ve,ye]=(0,Z.useState)(null),be=(0,Z.useRef)({onItemClick:a,setHoveredKey:ye});be.current={onItemClick:a,setHoveredKey:ye};let xe=(0,Z.useCallback)((e,t)=>{let n=be.current;!t&&n.onItemClick&&n.onItemClick(e)},[]),F=(0,Z.useCallback)(e=>{be.current.setHoveredKey(e)},[]),Ce=(0,Z.useCallback)(e=>{be.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Li.jsxs)(Li.Fragment,{children:[(0,Li.jsx)(R,{ref:T,height:S,flexShrink:0}),e.slice(te,ne).map((e,t)=>{let n=te+t,r=b[n],c=!!a&&(o?.(e)??!0),l=c&&ve===r,u=s?.(e);return(0,Li.jsx)(Pi,{itemKey:r,msg:e,idx:n,measureRef:w,expanded:u,hovered:l,clickable:c,onClickK:xe,onEnterK:F,onLeaveK:Ce,renderItem:i},r)}),C>0&&(0,Li.jsx)(R,{height:C,flexShrink:0}),l&&(0,Li.jsx)(Ii,{messages:e,start:te,end:ne,offsets:E,getItemTop:D,getItemElement:O,scrollRef:t})]})}function Ii({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(ki);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Hi,[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=Mi(e[t]);if(n===null)continue;let r=i(t);if(!(r>=0&&r+1>=l)){f=t,p=n;break}}let m=d>=0?d-r[u]:0,h=f>=0?Math.max(0,m+r[f]):-1,g=(0,Z.useRef)({idx:-1,tries:0}),_=(0,Z.useRef)(`none`),v=(0,Z.useRef)(-1);return(0,Z.useEffect)(()=>{if(g.current.idx>=0)return;if(_.current===`armed`){_.current=`force`;return}let e=_.current===`force`;if(_.current=`none`,!e&&v.current===f)return;if(v.current=f,p===null){s(null);return}let t=p.trimStart(),n=t.search(/\n\s*\n/),r=(n>=0?t.slice(0,n):t).slice(0,Bi).replace(/\s+/g,` `).trim();if(r===``){s(null);return}let i=f,c=h;s({text:r,scrollTo:()=>{s(`clicked`),_.current=`armed`;let e=a(i);e?o.current?.scrollToElement(e,1):(o.current?.scrollTo(c),g.current={idx:i,tries:0})}})}),(0,Z.useEffect)(()=>{if(g.current.idx<0)return;let e=a(g.current.idx);e?(o.current?.scrollToElement(e,1),g.current={idx:-1,tries:0}):++g.current.tries>5&&(g.current={idx:-1,tries:0})}),null}var Z,Li,Ri,zi,Bi,Vi,Hi,Ui=e((()=>{Z=t(B(),1),si(),V(),E(),Ai(),Li=H(),Ye(),St(),Cn(),De(),Ri=3,zi=new WeakMap,Bi=500,Vi=new WeakMap,Hi=()=>{}}));function Wi(e,t,n=Zi,r=Qi){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 Gi(e){return(e.type===`assistant`||e.type===`user`?C(e):null)??e.uuid}function Ki(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function qi(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=C(e);return i?t.has(i)||n.has(i)||_(i,`PostToolUse`,a)?!1:nn(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 Ji,Q,$,Yi,Xi,Zi,Qi,$i,ea,ta=e((()=>{Re(),Ji=t(B(),1),Q=t(B(),1),rn(),We(),$e(),je(),V(),de(),Et(),P(),sn(),un(),b(),rt(),r(),O(),hn(),S(),mt(),Cn(),yr(),Ae(),Fr(),De(),fe(),Rr(),y(),Zr(),$=H(),jt(),Ui(),Yi=Ji.memo(function({agentDefinitions:e}){return(0,$.jsx)(F,{children:(0,$.jsxs)(R,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(gr,{}),(0,$.jsx)(Ji.Suspense,{fallback:null,children:(0,$.jsx)(qr,{agentDefinitions:e})})]})})}),Xi=30,Zi=200,Qi=50,$i=({messages:e,tools:t,commands:r,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:s,isMessageSelectorVisible:c,conversationId:u,screen:d,streamingToolUses:h,showAllInTranscript:g=!1,agentDefinitions:_,hideLogo:y=!1,isLoading:b,hidePastThinking:x=!1,streamingThinking:S,streamingText:C,unseenDivider:w,scrollRef:E,trackStickyPrompt:D,jumpRef:O,onSearchMatchesChange:k,scanElement:te,setPositions:ne,disableRenderCap:A=!1,cursor:j=null,setCursor:ae,cursorNavRef:se,renderRange:ce})=>{let{columns:N}=Ve(),le=oe(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),P=(0,Q.useMemo)(()=>m(e).filter(l),[e]),ue=(0,Q.useMemo)(()=>S?S.isStreaming?!0:S.streamingEndedAt?Date.now()-S.streamingEndedAt<3e4:!1:!1,[S]),{lastThinkingBlockId:de,latestBashOutputUUID:fe}=(0,Q.useMemo)(()=>{let e=null,t=null,n=x&&!ue;x&&ue&&(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 x||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[P,x,ue]),me=(0,Q.useMemo)(()=>T(P),[P]),he=(0,Q.useMemo)(()=>h.filter(e=>!s.has(e.contentBlock.id)&&!me.has(e.contentBlock.id)),[h,s,me]),be=(0,Q.useMemo)(()=>he.flatMap(e=>{let t=ye({content:[e.contentBlock]});return t.uuid=f(e.contentBlock.id,0),m([t])}),[he]),xe=d===`transcript`,Se=(0,Q.useMemo)(()=>n(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),F=E!=null&&!Se,Ce=xe&&!g&&!F,Te=(0,Q.useRef)(null),I=(0,Q.useRef)(null),{collapsed:De,lookups:ke,hasTruncatedMessages:Ae,hiddenMessageCount:je}=(0,Q.useMemo)(()=>{let e=v((i||re()?P:ge(P,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!Ir(e)&&ie(e,xe)),be),n=Ce?e.slice(-30):e,r=Ce&&e.length>Xi,{messages:a}=pn(n,t,i),o=on(ln(ee(a,t)),i),s=Oe(P,n),c=(()=>{let e=n.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),l;if(I.current&&I.current.key===s)l=I.current.lookups;else if(I.current&&P.length>=I.current.normalizedCount&&n.length>=I.current.messageCount&&I.current.lastAssistantMsgId===c){let e=M(I.current.lookups,I.current.normalizedCount,I.current.messageCount,P,n);e?(l=e,I.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c}):(l=ve(P,n),I.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c})}else l=ve(P,n),I.current={key:s,lookups:l,normalizedCount:P.length,messageCount:n.length,lastAssistantMsgId:c};let u=e.length-Xi;return{collapsed:o,lookups:l,hasTruncatedMessages:r,hiddenMessageCount:u}},[i,P,xe,be,Ce,t]),Me=(0,Q.useMemo)(()=>{let e=!F&&!A?Wi(De,Te):0;return ce?De.slice(ce[0],ce[1]):e>0?De.slice(e):De},[De,ce,F,A]),L=(0,Q.useMemo)(()=>new Set(h.map(e=>e.contentBlock.id)),[h]),{dividerBeforeIndex:Pe,selectedIdx:Ie}=(0,Q.useMemo)(()=>{if(!w&&!j)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=w?.firstUnseenUuid.slice(0,24);for(let r=0;r<Me.length;r++){let i=Me[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&j&&i.uuid===j.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[w,j,Me]),[B,Re]=(0,Q.useState)(()=>new Set),ze=(0,Q.useCallback)(e=>{let t=Gi(e);Re(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),Be=(0,Q.useCallback)(e=>B.size>0&&B.has(Gi(e)),[B]),V=(0,Q.useRef)(ke);V.current=ke;let He=(0,Q.useCallback)(e=>{if(e.type===`collapsed_read_search`)return!0;if(e.type===`assistant`){let t=e.message.content,n=Array.isArray(t)?t[0]:void 0;return n!=null&&Ee(n)&&n.type===`advisor_tool_result`&&n.content.type===`advisor_result`}if(e.type!==`user`)return!1;let n=e.message.content[0];if(n?.type!==`tool_result`||n.is_error||!e.toolUseResult)return!1;let r=V.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Tt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),H=(!a||!!a.shouldContinueAnimation)&&!o.length&&!c,We=s.size>0,{progress:Ge}=Fe(),Ke=(0,Q.useRef)(null),qe=nt().terminalProgressBarEnabled&&!Ue()&&!Mt();(0,Q.useEffect)(()=>{let e=qe?We?`indeterminate`:`completed`:null;Ke.current!==e&&(Ke.current=e,Ge(e))},[Ge,qe,We]),(0,Q.useEffect)(()=>()=>Ge(null),[Ge]);let Je=(0,Q.useCallback)(e=>`${e.uuid}-${u}`,[u]),Ye=(e,n)=>{let a=n>0?Me[n-1]?.type:void 0,o=e.type===`user`&&a===`user`,c=e.type===`collapsed_read_search`&&(!!C||Er(Me,n,t,L)),l=Me.length-1-n>0,u=Je(e),f=(0,$.jsx)(Pr,{message:e,isUserContinuation:o,hasContentAfter:c,tools:t,commands:r,verbose:i||Be(e)||j?.expanded===!0&&n===Ie,inProgressToolUseIDs:s,streamingToolUseIDs:L,screen:d,canAnimate:H,lastThinkingBlockId:de,latestBashOutputUUID:fe,columns:N,isLoading:b,lookups:ke,shouldCollapseDiffs:l},u),p=(0,$.jsx)(_e.Provider,{value:n===Ie,children:f},u);return w&&n===Pe?[(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(Ne,{title:`${w.count} new ${pt(w.count,`message`)}`,width:N,color:`inactive`})},`unseen-divider`),p]:p},Xe=(0,Q.useRef)(new WeakMap),Ze=(0,Q.useCallback)(e=>{let n=Xe.current.get(e);if(n!==void 0)return n;let r=gn(e);if(e.type===`user`&&e.toolUseResult&&Array.isArray(e.message.content)){let n=e.message.content.find(e=>e.type===`tool_result`);if(n&&`tool_use_id`in n){let i=ke.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Tt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return Xe.current.set(e,i),i},[t,ke]);return(0,$.jsxs)($.Fragment,{children:[!y&&!(ce&&ce[0]>0)&&(0,$.jsx)(Yi,{agentDefinitions:_}),Ae&&(0,$.jsx)(Ne,{title:`${le} to show ${Le.bold(je)} previous messages`,width:N}),xe&&g&&je>0&&!A&&(0,$.jsx)(Ne,{title:`${le} to hide ${Le.bold(je)} previous messages`,width:N}),F?(0,$.jsx)(we.Provider,{value:!0,children:(0,$.jsx)(Fi,{messages:Me,scrollRef:E,columns:N,itemKey:Je,renderItem:Ye,onItemClick:ze,isItemClickable:He,isItemExpanded:Be,trackStickyPrompt:D,selectedIndex:Ie>=0?Ie:void 0,cursorNavRef:se,setCursor:ae,jumpRef:O,onSearchMatchesChange:k,scanElement:te,setPositions:ne,extractSearchText:Ze})}):Me.flatMap(Ye),C&&(0,$.jsx)(R,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(R,{flexDirection:`row`,children:[(0,$.jsx)(R,{minWidth:2,children:(0,$.jsx)(z,{color:`text`,children:Qe})}),(0,$.jsx)(R,{flexDirection:`column`,children:(0,$.jsx)(p,{children:C})})]})}),ue&&S&&(0,$.jsx)(R,{marginTop:1,children:(0,$.jsx)(pe,{param:{type:`thinking`,thinking:S.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},ea=Ji.memo($i,(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`&&Ki(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{Ai as a,di as c,Si as i,fi as l,ta as n,yi as o,Ci as r,vi as s,ea as t};
@@ -1 +1 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DcaKZlRU.js";import{EC as r,Mu as i,Xu as a,Zu as o,ad as s,id as c}from"./loadAgentsDir-mcRW90aq.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-C29_32BD.js";import{c as O,i as k,s as A}from"./terminalSetup-fwhFTxGi.js";import{n as j,t as M}from"./useExitOnCtrlCDWithKeybindings-CPLBDluY.js";import{n as N,t as P}from"./ThemePicker-DUlhcoso.js";import{n as F,t as I}from"./PressEnterToContinue-Dq0Imo9c.js";import{t as L}from"./ApproveApiKey-BEGV9Zj9.js";n();var R=e(m(),1),z=_();S(),y(),b(),D(),w(),r(),k(),M(),g(),g(),i(),s(),o(),g();var B=58;function V(){let[e]=u(),t=`Welcome to Work Mate`;return v.terminal===`Apple_Terminal`?(0,z.jsx)(H,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.13`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` ░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` `})]}):(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.13`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` * █████▓▓░ `}),(0,z.jsx)(p,{children:` * ███▓░ ░░ `}),(0,z.jsx)(p,{children:` ░░░░░░ ███▓░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,z.jsxs)(p,{children:[(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{bold:!0,children:`*`}),(0,z.jsx)(p,{children:` ██▓░░ ▓ `})]}),(0,z.jsx)(p,{children:` ░▓▓███▓▓░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * `})]})}function H({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.13`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` ░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` `})]}):(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.13`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` * █████▓▓░ `}),(0,z.jsx)(p,{children:` * ███▓░ ░░ `}),(0,z.jsx)(p,{children:` ░░░░░░ ███▓░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,z.jsxs)(p,{children:[(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{bold:!0,children:`*`}),(0,z.jsx)(p,{children:` ██▓░░ ▓ `})]}),(0,z.jsx)(p,{children:` ░▓▓███▓▓░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}N(),F(),g();var U=(0,R.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,R.useContext)(U);return(0,z.jsxs)(d,{gap:1,children:[(0,z.jsx)(p,{dimColor:!0,children:t}),(0,z.jsx)(d,{flexDirection:`column`,children:e})]})}g();var G=(0,R.createContext)({marker:``});function K({children:e}){let{marker:t}=(0,R.useContext)(G),n=0;for(let t of R.Children.toArray(e))!(0,R.isValidElement)(t)||t.type!==W||n++;let r=String(n).length;return(0,z.jsx)(d,{flexDirection:`column`,children:R.Children.map(e,(e,n)=>{if(!(0,R.isValidElement)(e)||e.type!==W)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,z.jsx)(G.Provider,{value:{marker:a},children:(0,z.jsx)(U.Provider,{value:{marker:a},children:e})})})})}K.Item=W;var q=K;g(),y();function J({onDone:e}){let[n,r]=(0,R.useState)(0),[i,o]=(0,R.useState)(!1),[s]=(0,R.useState)(()=>T()),[m,g]=u();(0,R.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:s})},[s]);function _(){if(n<M.length-1){let e=n+1;r(e),C(`tengu_onboarding_step`,{oauthEnabled:s,stepId:M[e]?.id})}else e()}function y(e){g(e),_()}let b=j(),S=(0,z.jsx)(d,{marginX:1,children:(0,z.jsx)(P,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),w=(0,z.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,z.jsx)(p,{bold:!0,children:`Before you start, keep in mind:`}),(0,z.jsx)(d,{flexDirection:`column`,width:70,children:(0,z.jsxs)(q,{children:[(0,z.jsxs)(q.Item,{children:[(0,z.jsx)(p,{children:`Always review changes before accepting`}),(0,z.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,z.jsx)(h,{}),`or editing files. You stay in control of every action.`,(0,z.jsx)(h,{})]})]}),(0,z.jsxs)(q.Item,{children:[(0,z.jsx)(p,{children:`Only use Claude Code on projects you trust`}),(0,z.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,z.jsx)(h,{}),(0,z.jsx)(f,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,z.jsx)(I,{})]}),D=(0,R.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&&o(!0),_()}let M=[];M.push({id:`theme`,component:S}),D&&M.push({id:`api-key`,component:(0,z.jsx)(L,{customApiKeyTruncated:D,onDone:k})}),s&&M.push({id:`oauth`,component:(0,z.jsx)(Y,{skip:i,onSkip:_,children:(0,z.jsx)(c,{onDone:_})})}),M.push({id:`security`,component:w}),O()&&M.push({id:`terminal-setup`,component:(0,z.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,z.jsx)(p,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,z.jsxs)(d,{flexDirection:`column`,width:70,gap:1,children:[(0,z.jsxs)(p,{children:[`For the optimal coding experience, enable the recommended settings`,(0,z.jsx)(h,{}),`for your terminal:`,` `,v.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,z.jsx)(a,{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,z.jsx)(p,{dimColor:!0,children:b.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,z.jsx)(z.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let N=M[n],F=(0,R.useCallback)(()=>{n===M.length-1?e():_()},[n,M.length,s,e]),B=(0,R.useCallback)(()=>{_()},[n,M.length,s,e]);return l({"confirm:yes":F},{context:`Confirmation`,isActive:N?.id===`security`}),l({"confirm:no":B},{context:`Confirmation`,isActive:N?.id===`terminal-setup`}),(0,z.jsxs)(d,{flexDirection:`column`,children:[(0,z.jsx)(V,{}),(0,z.jsxs)(d,{flexDirection:`column`,marginTop:1,children:[N?.component,b.pending&&(0,z.jsx)(d,{padding:1,children:(0,z.jsxs)(p,{dimColor:!0,children:[`Press `,b.keyName,` again to exit`]})})]})]})}function Y({skip:e,onSkip:t,children:n}){return(0,R.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{J as Onboarding};
1
+ import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DcaKZlRU.js";import{$u as r,Pu as i,Qu as a,hC as o,od as s,sd as c}from"./loadAgentsDir-JrGMJN05.js";import{Gt as l,H as u,I as d,Lt as f,P as p,ai as m,kt as h,t as g}from"./src-DL3w8VPk2.js";import{t as _}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as v,Yt as y}from"./settings-aUygByiZ.js";import{h as b,s as x}from"./config-BkbL2e5Q.js";import{n as S,r as C}from"./analytics-DJobLaWP.js";import{Bt as w,Ht as T,br as E,xr as D}from"./model-CmDF8O9G.js";import{c as O,i as k,s as A}from"./terminalSetup-CpMNk6dc.js";import{n as j,t as M}from"./useExitOnCtrlCDWithKeybindings-qLfN0tc-.js";import{n as N,t as P}from"./ThemePicker-BrD_T7xF.js";import{n as F,t as I}from"./PressEnterToContinue-Dwoh6CaW.js";import{t as L}from"./ApproveApiKey-DFpddLyp.js";n();var R=e(m(),1),z=_();S(),y(),b(),E(),w(),o(),k(),M(),g(),g(),i(),c(),r(),g();var B=58;function V(){let[e]=u(),t=`Welcome to Work Mate`;return v.terminal===`Apple_Terminal`?(0,z.jsx)(H,{theme:e,welcomeMessage:t}):[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.14`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` ░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` `})]}):(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.14`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` * █████▓▓░ `}),(0,z.jsx)(p,{children:` * ███▓░ ░░ `}),(0,z.jsx)(p,{children:` ░░░░░░ ███▓░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,z.jsxs)(p,{children:[(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{bold:!0,children:`*`}),(0,z.jsx)(p,{children:` ██▓░░ ▓ `})]}),(0,z.jsx)(p,{children:` ░▓▓███▓▓░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * `})]})}function H({theme:e,welcomeMessage:t}){return[`light`,`light-daltonized`,`light-ansi`].includes(e)?(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.14`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` ░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{children:` `})]}):(0,z.jsxs)(d,{width:B,flexDirection:`column`,children:[(0,z.jsxs)(p,{children:[(0,z.jsxs)(p,{color:`claudeBlue_FOR_SYSTEM_SPINNER`,children:[t,` `]}),(0,z.jsxs)(p,{dimColor:!0,children:[`v`,`0.0.14`,` `]})]}),(0,z.jsx)(p,{children:`…………………………………………………………………………………………………………………………………………………………`}),(0,z.jsx)(p,{children:` * █████▓▓░ `}),(0,z.jsx)(p,{children:` * ███▓░ ░░ `}),(0,z.jsx)(p,{children:` ░░░░░░ ███▓░ `}),(0,z.jsx)(p,{children:` ░░░ ░░░░░░░░░░ ███▓░ `}),(0,z.jsxs)(p,{children:[(0,z.jsx)(p,{children:` ░░░░░░░░░░░░░░░░░░░ `}),(0,z.jsx)(p,{bold:!0,children:`*`}),(0,z.jsx)(p,{children:` ██▓░░ ▓ `})]}),(0,z.jsx)(p,{children:` ░▓▓███▓▓░ `}),(0,z.jsx)(p,{dimColor:!0,children:` * ░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░ `}),(0,z.jsx)(p,{dimColor:!0,children:` ░░░░░░░░░░░░░░░░ `})]})}N(),F(),g();var U=(0,R.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,R.useContext)(U);return(0,z.jsxs)(d,{gap:1,children:[(0,z.jsx)(p,{dimColor:!0,children:t}),(0,z.jsx)(d,{flexDirection:`column`,children:e})]})}g();var G=(0,R.createContext)({marker:``});function K({children:e}){let{marker:t}=(0,R.useContext)(G),n=0;for(let t of R.Children.toArray(e))!(0,R.isValidElement)(t)||t.type!==W||n++;let r=String(n).length;return(0,z.jsx)(d,{flexDirection:`column`,children:R.Children.map(e,(e,n)=>{if(!(0,R.isValidElement)(e)||e.type!==W)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,z.jsx)(G.Provider,{value:{marker:a},children:(0,z.jsx)(U.Provider,{value:{marker:a},children:e})})})})}K.Item=W;var q=K;g(),y();function J({onDone:e}){let[n,r]=(0,R.useState)(0),[i,o]=(0,R.useState)(!1),[c]=(0,R.useState)(()=>T()),[m,g]=u();(0,R.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:c})},[c]);function _(){if(n<M.length-1){let e=n+1;r(e),C(`tengu_onboarding_step`,{oauthEnabled:c,stepId:M[e]?.id})}else e()}function y(e){g(e),_()}let b=j(),S=(0,z.jsx)(d,{marginX:1,children:(0,z.jsx)(P,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),w=(0,z.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,z.jsx)(p,{bold:!0,children:`Before you start, keep in mind:`}),(0,z.jsx)(d,{flexDirection:`column`,width:70,children:(0,z.jsxs)(q,{children:[(0,z.jsxs)(q.Item,{children:[(0,z.jsx)(p,{children:`Always review changes before accepting`}),(0,z.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,z.jsx)(h,{}),`or editing files. You stay in control of every action.`,(0,z.jsx)(h,{})]})]}),(0,z.jsxs)(q.Item,{children:[(0,z.jsx)(p,{children:`Only use Claude Code on projects you trust`}),(0,z.jsxs)(p,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,z.jsx)(h,{}),(0,z.jsx)(f,{url:`https://code.workmate.com/docs/en/security`})]})]})]})}),(0,z.jsx)(I,{})]}),E=(0,R.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=D(process.env.ANTHROPIC_API_KEY);if(x(e)===`new`)return e},[]);function k(e){e&&o(!0),_()}let M=[];M.push({id:`theme`,component:S}),E&&M.push({id:`api-key`,component:(0,z.jsx)(L,{customApiKeyTruncated:E,onDone:k})}),c&&M.push({id:`oauth`,component:(0,z.jsx)(Y,{skip:i,onSkip:_,children:(0,z.jsx)(s,{onDone:_})})}),M.push({id:`security`,component:w}),O()&&M.push({id:`terminal-setup`,component:(0,z.jsxs)(d,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,z.jsx)(p,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,z.jsxs)(d,{flexDirection:`column`,width:70,gap:1,children:[(0,z.jsxs)(p,{children:[`For the optimal coding experience, enable the recommended settings`,(0,z.jsx)(h,{}),`for your terminal:`,` `,v.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,z.jsx)(a,{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,z.jsx)(p,{dimColor:!0,children:b.pending?(0,z.jsxs)(z.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,z.jsx)(z.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let N=M[n],F=(0,R.useCallback)(()=>{n===M.length-1?e():_()},[n,M.length,c,e]),B=(0,R.useCallback)(()=>{_()},[n,M.length,c,e]);return l({"confirm:yes":F},{context:`Confirmation`,isActive:N?.id===`security`}),l({"confirm:no":B},{context:`Confirmation`,isActive:N?.id===`terminal-setup`}),(0,z.jsxs)(d,{flexDirection:`column`,children:[(0,z.jsx)(V,{}),(0,z.jsxs)(d,{flexDirection:`column`,marginTop:1,children:[N?.component,b.pending&&(0,z.jsx)(d,{padding:1,children:(0,z.jsxs)(p,{dimColor:!0,children:[`Press `,b.keyName,` again to exit`]})})]})]})}function Y({skip:e,onSkip:t,children:n}){return(0,R.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{J as Onboarding};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,t as r}from"./src-DL3w8VPk2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";function a({title:e,subtitle:r,color:i=`permission`}){return(0,o.jsxs)(t,{flexDirection:`column`,children:[(0,o.jsx)(t,{flexDirection:`row`,gap:1,children:(0,o.jsx)(n,{bold:!0,color:i,children:e})}),r!=null&&(typeof r==`string`?(0,o.jsx)(n,{dimColor:!0,wrap:`truncate-start`,children:r}):r)]})}var o,s=e((()=>{r(),o=i()}));function c({title:e,subtitle:n,color:r=`permission`,titleColor:i,innerPaddingX:o=1,titleRight:s,children:c}){return(0,l.jsxs)(t,{flexDirection:`column`,borderStyle:`round`,borderColor:r,borderLeft:!1,borderRight:!1,borderBottom:!1,marginTop:1,children:[(0,l.jsx)(t,{paddingX:1,flexDirection:`column`,children:(0,l.jsxs)(t,{justifyContent:`space-between`,children:[(0,l.jsx)(a,{title:e,subtitle:n,color:i}),s]})}),(0,l.jsx)(t,{flexDirection:`column`,paddingX:o,children:c})]})}var l,u=e((()=>{r(),s(),l=i()}));export{s as i,u as n,a as r,c as t};
@@ -0,0 +1 @@
1
+ import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{P as t,t as n}from"./src-DL3w8VPk2.js";import{t as r}from"./jsx-runtime-Bb4Xn-E0.js";function i(){return(0,a.jsxs)(t,{color:`permission`,children:[`Press `,(0,a.jsx)(t,{bold:!0,children:`Enter`}),` to continue…`]})}var a,o=e((()=>{n(),a=r()}));export{o as n,i as t};
@@ -1 +1 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{MC as n}from"./loadAgentsDir-mcRW90aq.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};
1
+ import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{xC as n}from"./loadAgentsDir-JrGMJN05.js";import{Gr as r,I as i,P as a,ai as o,ot as s,t as c}from"./src-DL3w8VPk2.js";import{t as l}from"./jsx-runtime-Bb4Xn-E0.js";import{C as u,v as d,x as f}from"./startupProfiler-2sjXZkIP.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{LT as t,RT as n,_C as r,gC as i}from"./loadAgentsDir-JrGMJN05.js";import{I as a,P as o,t as s}from"./src-DL3w8VPk2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{Kt as l,Yt as u}from"./settings-aUygByiZ.js";import{c as d,h as f}from"./config-BkbL2e5Q.js";import{i as p,o as m}from"./platform-DVeTi9mp.js";import{et as h,rt as g,tt as _}from"./model-CmDF8O9G.js";import{a as v,i as y,r as b}from"./terminalSetup-CpMNk6dc.js";function x(){return d().editorMode===`vim`}function S(){return l.terminal===`Apple_Terminal`&&process.platform===`darwin`||v()?`shift + ⏎ for newline`:b()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function C(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var w=e((()=>{y(),f(),u()}));function T(e){return e.replace(/\+/g,` + `)}function E(e){let{dimColor:t,fixedWidth:i,gap:s,paddingX:c}=e,l=T(r(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=T(r(`app:toggleTodos`,`Global`,`ctrl+t`)),d=T(r(`chat:undo`,`Chat`,`ctrl+_`)),f=T(r(`chat:stash`,`Chat`,`ctrl+s`)),m=T(r(`chat:cycleMode`,`Chat`,`shift+tab`)),h=T(r(`chat:modelPicker`,`Chat`,`alt+p`)),v=T(r(`chat:fastMode`,`Chat`,`alt+o`)),y=T(r(`chat:externalEditor`,`Chat`,`ctrl+g`));T(r(`app:toggleTerminal`,`Global`,`meta+j`));let b=T(r(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,D.jsxs)(a,{paddingX:c,flexDirection:`row`,gap:s,children:[(0,D.jsxs)(a,{flexDirection:`column`,width:i?24:void 0,children:[(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`! for bash mode`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`/ for commands`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`@ for file paths`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`& for background`})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`/btw for side question`})})]}),(0,D.jsxs)(a,{flexDirection:`column`,width:i?35:void 0,children:[(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`double tap esc to clear input`})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[m,` to auto-accept edits`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[l,` for verbose output`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[u,` to toggle tasks`]})}),(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:S()})})]}),(0,D.jsxs)(a,{flexDirection:`column`,children:[(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[d,` to undo`]})}),p()!==`windows`&&(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`ctrl + z to suspend`})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[b,` to paste images`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[h,` to switch model`]})}),g()&&_()&&(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[v,` to toggle fast mode`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[f,` to stash prompt`]})}),(0,D.jsx)(a,{children:(0,D.jsxs)(o,{dimColor:t,children:[y,` to edit in $EDITOR`]})}),n()&&(0,D.jsx)(a,{children:(0,D.jsx)(o,{dimColor:t,children:`/keybindings to customize`})})]})]})}var D,O=e((()=>{s(),m(),t(),i(),h(),w(),D=c()}));export{x as a,C as i,O as n,w as r,E 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,$n as s,$y as c,Bb as l,ET as u,FC as d,Fi as f,J_ as p,Js as m,Ks as ee,La as h,Li as g,Mv as _,Nv as v,Ny as te,PC as ne,TT as y,X as b,Xr as x,Y as re,Y_ as S,Ys as C,Zy as ie,_g as ae,_n as w,at as T,bg as E,br as D,by as O,ca as oe,co as k,dE as se,da as ce,fE as le,fc as ue,fm as A,mg as de,no as j,ot as fe,pc as pe,q_ as M,qs as N,sp as P,um as F,uo as me,up as he,vn as ge,zb as I}from"./loadAgentsDir-JrGMJN05.js";import{Kr as _e,qr as ve}from"./src-DL3w8VPk2.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-aUygByiZ.js";import{M as W,c as Te,h as Ee,j as De}from"./config-BkbL2e5Q.js";import{i as Oe,o as ke,q as Ae}from"./log-BlJ7CcKG.js";import{Bt as je,C as Me,St as G,Y as K,_ as Ne,et as Pe,u as Fe}from"./model-CmDF8O9G.js";import{at as Ie,nt as Le,xn as Re,yn as q}from"./prompt-DnPppVz8.js";import{Q as ze,T as Be,et as Ve}from"./sessionState-C2REgUrs.js";import{a as He,n as Ue,r as We}from"./mappers-CMJorgSL.js";import{n as J,o as Ge,r as Y}from"./MessageSelector-DY5K0NHd.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(),q(),Ee(),se(),je(),Pe(),y(),Be(),c(),te(),Ie(),v(),E(),A(),ue(),k(),j(),h(),g(),D(),w(),b(),fe(),S(),l(),Ne(),O(),P();async function Je({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?T(e,t,n,r):Promise.resolve([]),p(),i===void 0?M():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:m,systemContext:ee}=await Je({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),h=ze([...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:m,systemContext:ee,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(he()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:I(),readFileState:i,getAppState:a,setAppState:o,messages:_,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:_}}ne(),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.14`,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(),l(),H(),Pe(),Ne(),O(),P(),N();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??I(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Ve}async*submitMessage(e,n){let{cwd:i,commands:a,tools:c,mcpClients:l,verbose:p=!1,thinkingConfig:h,maxTurns:g,maxBudgetUsd:v,taskBudget:te,canUseTool:ne,customSystemPrompt:y,appendSystemPrompt:b,userSpecifiedModel:S,fallbackModel:ie,jsonSchema:w,getAppState:T,setAppState:E,replayUserMessages:D=!1,includePartialMessages:O=!1,agents:k=[],setSDKStatus:se,orphanedPermission:ue}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],d(i);let A=!ye(),j=Date.now(),fe=async(e,t,n,r,i,a)=>{let o=await ne(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},M=T(),N=S?Me(S):Fe(),P=h||(he()===!1?{type:`disabled`}:{type:`adaptive`});F(`before_getSystemPrompt`);let I=typeof y==`string`?y:void 0,{defaultSystemPrompt:_e,userContext:B,systemContext:be}=await Je({tools:c,mainLoopModel:N,additionalWorkingDirectories:Array.from(M.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:l,customSystemPrompt:I});F(`after_getSystemPrompt`);let H={...B},Se=I!==void 0&&De()?await le():null,Ce=ze([...I===void 0?_e:[I],...Se?[Se]:[],...b?[b]:[]]),we=c.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:c,verbose:p,mainLoopModel:N,thinkingConfig:P,mcpClients:l,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,agentDefinitions:{activeAgents:k,allAgents:[]},theme:Ke(Te().theme),maxBudgetUsd:v},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(ue&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of ee(ue,c,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=x(G);r()||(await e,(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await s())}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??N;U={messages:G,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:c,verbose:p,mainLoopModel:q,thinkingConfig:P,mcpClients:l,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:y,appendSystemPrompt:b,theme:Ke(Te().theme),agentDefinitions:{activeAgents:k,allAgents:[]},maxBudgetUsd:v},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},F(`before_skills_plugins`);let[Be,{enabled:Ue}]=await Promise.all([f(xe()),me()]);if(F(`after_skills_plugins`),yield Ze({tools:c,mcpClients:l,model:q,permissionMode:M.toolPermissionContext.mode,commands:a,agents:k,skills:Be,plugins:Ue,fastMode:M.fastMode}),F(`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 x(G),(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await s()),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,M.fastMode),uuid:X()};return}if(de()&&A){let e=Qe()?.selectableUserMessagesFilter??(e=>!0);W.filter(e).forEach(e=>{ae(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?ce(this.mutableMessages,Le):0;for await(let e of pe({messages:G,systemPrompt:Ce,userContext:H,systemContext:be,canUseTool:fe,toolUseContext:U,fallbackModel:ie,querySource:`sdk`,maxTurns:g,taskBudget:te})){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 x(this.mutableMessages.slice(0,e+1))}}if(G.push(e),A&&(e.type===`assistant`?x(G):await x(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*C(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),A&&(G.push(t),x(G)),yield*C(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*C(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){J=Ve;let e=t.message;J=o(J,e.usage)}if(t.type===`message_delta`){J=o(J,t.usage);let e=t.delta;e.stop_reason!=null&&(Z=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=re(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),x(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 s(),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,M.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:_(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(v!==void 0&&L()>=v){A&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await s(),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,M.fastMode),uuid:X(),errors:[`Reached maximum budget ($${v}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&w){let e=ce(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 s(),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,M.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`?u($.message.content)?.type??`none`:`n/a`;if(A&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await s(),!m($,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,M.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=u($.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,M.fastMode),uuid:X()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=I()}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:m,setReadFileCache:ee,customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,jsonSchema:te,getAppState:ne,setAppState:y,abortController:b,replayUserMessages:x=!1,includePartialMessages:re=!1,handleElicitation:S,agents:C=[],setSDKStatus:ae,orphanedPermission:w}){let T=new Z({cwd:i,tools:a,commands:e,mcpClients:o,agents:C??[],canUseTool:f,getAppState:ne,setAppState:y,initialMessages:p,readFileCache:ie(m()),customSystemPrompt:h,appendSystemPrompt:g,userSpecifiedModel:_,fallbackModel:v,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:te,verbose:s,handleElicitation:S,replayUserMessages:x,includePartialMessages:re,setSDKStatus:ae,abortController:b,orphanedPermission:w});try{yield*T.submitMessage(t,{uuid:n,isMeta:r})}finally{ee(T.getReadFileState())}}export{Q as n,Ye as r,Z as t};