@readmagic/workmate 0.0.8 → 0.0.9

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 (501) hide show
  1. package/dist/chunks/AddWorkspaceDirectory-qFZy3FOD.js +1 -0
  2. package/dist/chunks/App-DW4elk6E.js +1 -0
  3. package/dist/chunks/ApproveApiKey-D05WywHU.js +1 -0
  4. package/dist/chunks/ApproveApiKey-DHAbdwkC.js +1 -0
  5. package/dist/chunks/BackgroundTasksDialog-QgFwoaaC.js +2 -0
  6. package/dist/chunks/BypassPermissionsModeDialog-BuRFF1fQ.js +1 -0
  7. package/dist/chunks/ClaudeMdExternalIncludesDialog-CDrArsSX.js +1 -0
  8. package/dist/chunks/ClaudeMdExternalIncludesDialog-DpecRCAt.js +1 -0
  9. package/dist/chunks/ConsoleOAuthFlow-D1MYL1dJ.js +1 -0
  10. package/dist/chunks/DiffDialog-BIcwpgSr.js +6 -0
  11. package/dist/chunks/Doctor-D160J8Ad.js +3 -0
  12. package/dist/chunks/Doctor-VhJi2cmL.js +1 -0
  13. package/dist/chunks/ExitFlow-CoWHhKHJ.js +2 -0
  14. package/dist/chunks/Grove-BmirUB6V.js +11 -0
  15. package/dist/chunks/{HybridTransport-BJPOG2wl.js → HybridTransport-BVmSUHf0.js} +1 -1
  16. package/dist/chunks/InvalidConfigDialog-WRywkKeS.js +1 -0
  17. package/dist/chunks/InvalidSettingsDialog-C4n3A72C.js +1 -0
  18. package/dist/chunks/MCPConnectionManager-DPFe4hPh.js +1 -0
  19. package/dist/chunks/MCPToolListView-BPmE0C2o.js +1 -0
  20. package/dist/chunks/McpParsingWarnings-CH4yyMAL.js +1 -0
  21. package/dist/chunks/MessageSelector-kOn2GaU-.js +3 -0
  22. package/dist/chunks/Messages-4EnHFeh1.js +11 -0
  23. package/dist/chunks/Onboarding-BboWs1pp.js +1 -0
  24. package/dist/chunks/{PermissionDialog-0ya1CU5k.js → PermissionDialog-Cb3z8OUP.js} +1 -1
  25. package/dist/chunks/{PressEnterToContinue-Dl9Hg9Mf.js → PressEnterToContinue-Dq0Imo9c.js} +1 -1
  26. package/dist/chunks/PromptInputFooterSuggestions-BpC9COmh.js +1 -0
  27. package/dist/chunks/PromptInputHelpMenu-BvcAzbSi.js +1 -0
  28. package/dist/chunks/QueryEngine-J6ElcO16.js +1 -0
  29. package/dist/chunks/REPL-DBjbAJsm.js +133 -0
  30. package/dist/chunks/REPL-oBemMXvp.js +1 -0
  31. package/dist/chunks/RemoteSessionManager-CoIyFKKa.js +2 -0
  32. package/dist/chunks/ResumeConversation-wBG8OD9P.js +1 -0
  33. package/dist/chunks/{SSETransport-CrwbKuVt.js → SSETransport-1KBBUikF.js} +1 -1
  34. package/dist/chunks/{SearchBox-vfLXEPed.js → SearchBox-C9vUA4IM.js} +1 -1
  35. package/dist/chunks/SearchExtraToolsTool-BugrzImr.js +1 -0
  36. package/dist/chunks/Settings-DptKuJE7.js +2 -0
  37. package/dist/chunks/TeleportProgress-BmgPAZAi.js +1 -0
  38. package/dist/chunks/TeleportRepoMismatchDialog-sgxNOeM_.js +1 -0
  39. package/dist/chunks/TeleportResumeWrapper-GptvrUdv.js +1 -0
  40. package/dist/chunks/ThemePicker-gAMqqD1P.js +1 -0
  41. package/dist/chunks/{TrustDialog-BukWGvHZ.js → TrustDialog-CWt-4Evl.js} +1 -1
  42. package/dist/chunks/{ValidationErrorsList-DokTJQwi.js → ValidationErrorsList-De3kzHtz.js} +1 -1
  43. package/dist/chunks/{WelcomeV2-Ci9VwPYh.js → WelcomeV2-BWF-cJOu.js} +1 -1
  44. package/dist/chunks/add-dir-DBVT1cEK.js +1 -0
  45. package/dist/chunks/{agentDisplay-DBQYOaOh.js → agentDisplay-5gnCQwUY.js} +1 -1
  46. package/dist/chunks/{agents-HlKk68Qc.js → agents-Bz1MLp4A.js} +1 -1
  47. package/dist/chunks/agents-CnwTOlqO.js +103 -0
  48. package/dist/chunks/allErrors-DYw_q14e.js +1 -0
  49. package/dist/chunks/analytics-DJobLaWP.js +1 -0
  50. package/dist/chunks/api-DXDXTFGa.js +1 -0
  51. package/dist/chunks/{api-CF5IVtj0.js → api-DzccRM_z.js} +1 -1
  52. package/dist/chunks/auth-Cjnyy10u.js +15 -0
  53. package/dist/chunks/auth-CnLb6RWc.js +1 -0
  54. package/dist/chunks/auth-D-SGHS0K.js +1 -0
  55. package/dist/chunks/{autoMode-Cr0AhS1G.js → autoMode-CQ5nqP9c.js} +4 -4
  56. package/dist/chunks/{autonomy-ARUQt-Lu.js → autonomy-CPUCe-YU.js} +1 -1
  57. package/dist/chunks/autonomy-dSJl0hN1.js +15 -0
  58. package/dist/chunks/{autonomyPanel-BQK9MoeB.js → autonomyPanel-Ccr9ilei.js} +1 -1
  59. package/dist/chunks/backgroundHousekeeping--cs5crp7.js +17 -0
  60. package/dist/chunks/backgroundHousekeeping-CcbHitKC.js +1 -0
  61. package/dist/chunks/{banner-Ca7rki2V.js → banner-BJZNMppT.js} +1 -1
  62. package/dist/chunks/bg-DWloqGwk.js +1 -0
  63. package/dist/chunks/{bg-DxRHF1yn.js → bg-w3Vlsm3Y.js} +2 -2
  64. package/dist/chunks/branch-CG0AKS1J.js +3 -0
  65. package/dist/chunks/{break-cache-BKvoMOZx.js → break-cache-DXV0brco.js} +2 -2
  66. package/dist/chunks/bridgeConfig-Dmc1ZDev.js +1 -0
  67. package/dist/chunks/{bridgeConfig-jDEva6Eh.js → bridgeConfig-vORehbGG.js} +1 -1
  68. package/dist/chunks/{bridgeMessaging-YqYdl6ej.js → bridgeMessaging-DlczTV9X.js} +1 -1
  69. package/dist/chunks/{bridgePointer-DIM0sj0x.js → bridgePointer-D4W9GpWw.js} +1 -1
  70. package/dist/chunks/btw-DDUC_t0w.js +1 -0
  71. package/dist/chunks/caches-1IFb6_M_.js +1 -0
  72. package/dist/chunks/caches-CB8MHqy2.js +1 -0
  73. package/dist/chunks/{capacityWake-CKOiRELo.js → capacityWake-L7b1mMft.js} +1 -1
  74. package/dist/chunks/{ccrClient-BC2q3k44.js → ccrClient-CG6HTv_n.js} +1 -1
  75. package/dist/chunks/{claudeDesktop-DQXL5bGm.js → claudeDesktop-CAmnheYx.js} +1 -1
  76. package/dist/chunks/{clear-1etSJhdg.js → clear-DdWexxbM.js} +1 -1
  77. package/dist/chunks/{cliLaunch-CQjLYRzM.js → cliLaunch-BWWOgBFh.js} +1 -1
  78. package/dist/chunks/{client-DQwf_b9o.js → client-CoXtVRzi.js} +1 -1
  79. package/dist/chunks/client-Crrwkw7g.js +1 -0
  80. package/dist/chunks/client-D8hKghba.js +1 -0
  81. package/dist/chunks/color-Cuq0c6xy.js +1 -0
  82. package/dist/chunks/commands-D3sESsTp.js +1 -0
  83. package/dist/chunks/compact-DIpwuBDq.js +2 -0
  84. package/dist/chunks/config-CVvUNkj2.js +1 -0
  85. package/dist/chunks/config-D4G8_MqJ.js +3 -0
  86. package/dist/chunks/config-q9D4hFiK.js +1 -0
  87. package/dist/chunks/context-BWcfhhDj.js +1 -0
  88. package/dist/chunks/context-noninteractive-Bwt9A3XD.js +1 -0
  89. package/dist/chunks/{context-noninteractive-Ct_ttQfP.js → context-noninteractive-c7jGVWHQ.js} +2 -2
  90. package/dist/chunks/conversation-Bjo_8kia.js +1 -0
  91. package/dist/chunks/conversation-DrHZIQX2.js +1 -0
  92. package/dist/chunks/{createSSHSession-BmHXA2me.js → createSSHSession-DP7B8yvb.js} +1 -1
  93. package/dist/chunks/{createSession-C4rukWkv.js → createSession-CPo6GBSb.js} +1 -1
  94. package/dist/chunks/createSession-DnykRoia.js +1 -0
  95. package/dist/chunks/crossProjectResume-D2A-qjgP.js +40 -0
  96. package/dist/chunks/cwd--q1ONL7P.js +1 -0
  97. package/dist/chunks/{cwd-C5ce-7WB.js → cwd-L4wygFqJ.js} +1 -1
  98. package/dist/chunks/{daemon-ZtpTZWgQ.js → daemon-D2vFIVOz.js} +1 -1
  99. package/dist/chunks/datadog-DrmHyl3_.js +1 -0
  100. package/dist/chunks/{debug-RZ4NuXyS.js → debug-BdqxZ7rV.js} +4 -4
  101. package/dist/chunks/{debugUtils-D30M1cbN.js → debugUtils-CezNYZ-4.js} +1 -1
  102. package/dist/chunks/{detached-jrVP11oU.js → detached-CkPpYMJj.js} +1 -1
  103. package/dist/chunks/detectRepository-DA1Q_Skc.js +1 -0
  104. package/dist/chunks/{detectRepository-CFiHe6Rv.js → detectRepository-DvxoaPlk.js} +1 -1
  105. package/dist/chunks/{diff-BKiK3xHv.js → diff-DHzz9WAp.js} +1 -1
  106. package/dist/chunks/directoryCompletion-D5AvL7TF.js +1 -0
  107. package/dist/chunks/doctor-PWqB46xd.js +1 -0
  108. package/dist/chunks/entry-4JtoJONR.js +14 -0
  109. package/dist/chunks/envUtils-BDhHQY0-.js +1 -0
  110. package/dist/chunks/{esm-BLPbfHQd.js → esm-DcIr7tVd.js} +1 -1
  111. package/dist/chunks/{execFileNoThrow-CCX-JY8h.js → execFileNoThrow-5SylUnAI.js} +1 -1
  112. package/dist/chunks/{execSyncWrapper-dhRSYGFW.js → execSyncWrapper-DKuxVTaf.js} +1 -1
  113. package/dist/chunks/exit-OW9g7b9A.js +1 -0
  114. package/dist/chunks/extraUsage-Dt5mw35U.js +1 -0
  115. package/dist/chunks/extractMemories-1VlmCGwa.js +1 -0
  116. package/dist/chunks/fast-ClYQcEv5.js +1 -0
  117. package/dist/chunks/fast-CrvLdpy3.js +1 -0
  118. package/dist/chunks/fileSuggestions-fNxREjpe.js +3 -0
  119. package/dist/chunks/firstPartyEventLogger-BBXEQUf0.js +1 -0
  120. package/dist/chunks/firstPartyEventLogger-DhEPWcit.js +5 -0
  121. package/dist/chunks/{flushGate-Cnsu4HET.js → flushGate-ch-Tvwjj.js} +1 -1
  122. package/dist/chunks/{fpsMetrics-Cf_hdtiJ.js → fpsMetrics-DffAomdg.js} +1 -1
  123. package/dist/chunks/{gemini-Cudre91e.js → gemini-fZ0VPU2A.js} +1 -1
  124. package/dist/chunks/generateRecap-BIBVlB__.js +1 -0
  125. package/dist/chunks/generateSessionName-nZj_VvKZ.js +1 -0
  126. package/dist/chunks/{genericProcessUtils-DVfMHhfy.js → genericProcessUtils-BmDSLcMf.js} +1 -1
  127. package/dist/chunks/{git-BerW9bId.js → git-B9uvt96d.js} +1 -1
  128. package/dist/chunks/git-BfS5Hk4S.js +1 -0
  129. package/dist/chunks/githubRepoPathMapping-Cqx3pSfc.js +1 -0
  130. package/dist/chunks/goal-IasZVqKh.js +3 -0
  131. package/dist/chunks/grok-Dk3LyzMa.js +1 -0
  132. package/dist/chunks/grove-BE4fQ6tG.js +7 -0
  133. package/dist/chunks/help-D2-v9Ug9.js +1 -0
  134. package/dist/chunks/{hooks-BZJTWD07.js → hooks-BrKy5XWQ.js} +2 -2
  135. package/dist/chunks/hooks-DGd02IKF.js +1 -0
  136. package/dist/chunks/initReplBridge-RhCAlmHE.js +1 -0
  137. package/dist/chunks/{install-BI---dv0.js → install-CVGZ55wV.js} +1 -1
  138. package/dist/chunks/{instrumentation-CcWzhGfE.js → instrumentation-BmWotlxR.js} +4 -4
  139. package/dist/chunks/{job-B0ftcqPF.js → job-DEXxW_Zo.js} +1 -1
  140. package/dist/chunks/{jwtUtils-C0cE-1Ey.js → jwtUtils-C9sdGhvT.js} +1 -1
  141. package/dist/chunks/keybindings-BRdSOSUD.js +2 -0
  142. package/dist/chunks/language-C0cIpKE2.js +1 -0
  143. package/dist/chunks/{language-s-dLbdVz.js → language-CxThoWRC.js} +1 -1
  144. package/dist/chunks/launchLocalMemory-CLSSVFoj.js +3 -0
  145. package/dist/chunks/launchOnboarding-BkJfKviO.js +8 -0
  146. package/dist/chunks/loadAgentsDir-8UprzS4w.js +1 -0
  147. package/dist/chunks/{loadAgentsDir-ByO8eJqU.js → loadAgentsDir-CKSb56Gp.js} +673 -759
  148. package/dist/chunks/loadPluginHooks-LbaURHVH.js +1 -0
  149. package/dist/chunks/{localSearch-CHHCH16D.js → localSearch-CPOnyi8I.js} +1 -1
  150. package/dist/chunks/localSearch-DNjbr4S9.js +1 -0
  151. package/dist/chunks/{log-CZ0zYP_c.js → log-CTFl4qpD.js} +1 -1
  152. package/dist/chunks/logoV2Utils-we1sfJvf.js +1 -0
  153. package/dist/chunks/{magicDocs-C5i5ruuU.js → magicDocs-DmKlTQvK.js} +3 -3
  154. package/dist/chunks/main-BIiwW4mM.js +605 -0
  155. package/dist/chunks/{main-BLD4QAQg.js → main-ClXu1ilx.js} +2 -2
  156. package/dist/chunks/{managedEnv-C-9XSN14.js → managedEnv-Cl7YbYzf.js} +1 -1
  157. package/dist/chunks/managedEnv-CpiiQx_v.js +1 -0
  158. package/dist/chunks/{mappers-CHRFic5q.js → mappers-xQC-Z4-h.js} +1 -1
  159. package/dist/chunks/mcp-B_m1XBDt.js +6 -0
  160. package/dist/chunks/mcp-BiyfH9Sd.js +1 -0
  161. package/dist/chunks/mcp-BjlaPUWX.js +2 -0
  162. package/dist/chunks/{memoize-B8hfb1JN.js → memoize-FJv2HV1u.js} +1 -1
  163. package/dist/chunks/memory-LN8f_p2b.js +1 -0
  164. package/dist/chunks/{modalContext-DFjKLCB6.js → modalContext-CUThy6Ph.js} +1 -1
  165. package/dist/chunks/mode-lYTs0XHs.js +2 -0
  166. package/dist/chunks/model-C2e73CJD.js +1 -0
  167. package/dist/chunks/model-CvmS-Esk.js +1 -0
  168. package/dist/chunks/model-DJ8mFfuR.js +1 -0
  169. package/dist/chunks/modelOptions-efCGKnXT.js +1 -0
  170. package/dist/chunks/nativeInstaller-DQIFwdat.js +1 -0
  171. package/dist/chunks/oauth-BN2I0_jl.js +1 -0
  172. package/dist/chunks/oauth-C9VBDB0Y.js +1 -0
  173. package/dist/chunks/omit-CLPZGevl.js +1 -0
  174. package/dist/chunks/onChangeAppState-DhBO34OK.js +1 -0
  175. package/dist/chunks/{openai-DPH6rXOZ.js → openai-DJLYqiRl.js} +2 -2
  176. package/dist/chunks/{panel-mD094ALT.js → panel-q0_iT9cg.js} +1 -1
  177. package/dist/chunks/panelCall-sum-3zvi.js +1 -0
  178. package/dist/chunks/parser-BcdhBGx0.js +1 -0
  179. package/dist/chunks/{parser-dbHRgXb8.js → parser-BdCj2GrE.js} +1 -1
  180. package/dist/chunks/partition-CpfoVrg1.js +1 -0
  181. package/dist/chunks/permissions-DTb9wkAP.js +3 -0
  182. package/dist/chunks/pidLock-BR5M6RQw.js +3 -0
  183. package/dist/chunks/{pipeTransport-DVOKR4c_.js → pipeTransport-B3TIkTAp.js} +1 -1
  184. package/dist/chunks/plan-BeoIjNPv.js +1 -0
  185. package/dist/chunks/{platform-DCXXznJg.js → platform-D6IMiyqT.js} +1 -1
  186. package/dist/chunks/plugin-D_dHjTud.js +17 -0
  187. package/dist/chunks/pluginAutoupdate-BHKlOOXI.js +1 -0
  188. package/dist/chunks/pluginBlocklist-D93Hd1GF.js +1 -0
  189. package/dist/chunks/pluginCliCommands-vv0wNt4O.js +1 -0
  190. package/dist/chunks/{pluginFlagging-pBxSselw.js → pluginFlagging-CxuRF2Vc.js} +1 -1
  191. package/dist/chunks/pluginOperations-BTq4AjYB.js +2 -0
  192. package/dist/chunks/{pluginStartupCheck-Di4LjHXf.js → pluginStartupCheck-B6leNWq9.js} +1 -1
  193. package/dist/chunks/pluginStartupCheck-DBOCHUHQ.js +1 -0
  194. package/dist/chunks/plugins-pmipe7kE.js +4 -0
  195. package/dist/chunks/{poorMode-CYXmr_mU.js → poorMode-BxsyllUK.js} +1 -1
  196. package/dist/chunks/poorMode-iV1NwC5L.js +1 -0
  197. package/dist/chunks/print-CAUvczBM.js +23 -0
  198. package/dist/chunks/processBashCommand-CdeQg_c6.js +1 -0
  199. package/dist/chunks/processSlashCommand-CbkshIC6.js +5 -0
  200. package/dist/chunks/{projectContext-D9MDwJUF.js → projectContext-CIxul6vA.js} +1 -1
  201. package/dist/chunks/{projectContext-BaDZBAoK.js → projectContext-RUMJB798.js} +1 -1
  202. package/dist/chunks/prompt-CybUvG8G.js +139 -0
  203. package/dist/chunks/prompt-RBn4JdEg.js +1 -0
  204. package/dist/chunks/prompt-Rb8zXlDo.js +1 -0
  205. package/dist/chunks/promptEditor-0Ug93P2I.js +4 -0
  206. package/dist/chunks/{protocolHandler-RNKkhq91.js → protocolHandler-ClfbHTjI.js} +1 -1
  207. package/dist/chunks/{proxy-BmtEnJ02.js → proxy-Blq4W6Ox.js} +1 -1
  208. package/dist/chunks/reconciler-Drq3HSkj.js +4 -0
  209. package/dist/chunks/refresh-D8TLHO_T.js +1 -0
  210. package/dist/chunks/{registerProtocol-DoKqmqu2.js → registerProtocol-3_ozAuDK.js} +1 -1
  211. package/dist/chunks/reload-plugins-Dn1ibOiI.js +1 -0
  212. package/dist/chunks/{remoteBridgeCore-Cddqv2WW.js → remoteBridgeCore-Dpg6Se9C.js} +1 -1
  213. package/dist/chunks/remoteManagedSettings-CCrq-qL-.js +1 -0
  214. package/dist/chunks/rename-CKsSc7Z3.js +1 -0
  215. package/dist/chunks/{renderOptions-ChLwxtVu.js → renderOptions-CLcco6fc.js} +1 -1
  216. package/dist/chunks/replBridgeHandle-DNC797_T.js +1 -0
  217. package/dist/chunks/resume-B1a5gLVR.js +2 -0
  218. package/dist/chunks/ripgrep-BisRODQ2.js +1 -0
  219. package/dist/chunks/{ripgrep-gaT9Njwi.js → ripgrep-DkL2S7-I.js} +1 -1
  220. package/dist/chunks/{runtimeObserver-CsIwinzh.js → runtimeObserver-B0xfyLiA.js} +1 -1
  221. package/dist/chunks/{runtimeObserver-Dbxxw4ls.js → runtimeObserver-DonWCJOx.js} +4 -4
  222. package/dist/chunks/sandbox-adapter-BnBOSkKJ.js +1 -0
  223. package/dist/chunks/sandbox-toggle-CSdnHWp-.js +1 -0
  224. package/dist/chunks/searchExtraTools-DbgfnQkH.js +1 -0
  225. package/dist/chunks/session-BbQlh2S5.js +2 -0
  226. package/dist/chunks/sessionFileAccessHooks-Xfr1NiXG.js +1 -0
  227. package/dist/chunks/sessionMemory-7UOFdp29.js +1 -0
  228. package/dist/chunks/sessionMemory-fAzgAS7Q.js +1 -0
  229. package/dist/chunks/sessionMemoryUtils-DVjFw5Bd.js +1 -0
  230. package/dist/chunks/sessionObserver-Cl26OdaW.js +1 -0
  231. package/dist/chunks/{sessionObserver-DoYc0ZOP.js → sessionObserver-XV6N0XER.js} +2 -2
  232. package/dist/chunks/{sessionState-CjNY991n.js → sessionState-BvECKycx.js} +1 -1
  233. package/dist/chunks/sessionStorage-DSj9yZkl.js +1 -0
  234. package/dist/chunks/{sessionStoragePortable-Cx6JQ5Ye.js → sessionStoragePortable-JZnGwqUM.js} +1 -1
  235. package/dist/chunks/sessionTitle-E1FvsKM9.js +14 -0
  236. package/dist/chunks/sessionTracing-ClGQ08jM.js +11 -0
  237. package/dist/chunks/settings-B-R9ZJNY.js +1 -0
  238. package/dist/chunks/settings-Xbq6AaD-.js +20 -0
  239. package/dist/chunks/settingsSync-NCN0a4sc.js +1 -0
  240. package/dist/chunks/setup-uZ0dSekt.js +3 -0
  241. package/dist/chunks/shadowedRuleDetection-B9iSx6mB.js +1 -0
  242. package/dist/chunks/{shellQuote-BUVKMu_P.js → shellQuote-Bth6IZgX.js} +1 -1
  243. package/dist/chunks/{sideQuestion-C780iYwd.js → sideQuestion-D2dPToW8.js} +3 -3
  244. package/dist/chunks/sinks-C7q46rvE.js +2 -0
  245. package/dist/chunks/sinks-D3bXeHlQ.js +1 -0
  246. package/dist/chunks/skillChangeDetector-C1EJ7rUL.js +1 -0
  247. package/dist/chunks/{skillGapStore-Dc1arohs.js → skillGapStore-DylpOKJ6.js} +2 -2
  248. package/dist/chunks/{skillLifecycle-DP6mY1Kp.js → skillLifecycle-GK-8eyyn.js} +2 -2
  249. package/dist/chunks/{skillSearchPanel-CpLTImaL.js → skillSearchPanel-mpaC62y4.js} +4 -4
  250. package/dist/chunks/skills-t6krW8GZ.js +1 -0
  251. package/dist/chunks/{src-CDCSSo0U2.js → src-P_wYS_NJ2.js} +1 -1
  252. package/dist/chunks/{src-CST_jFnT.js → src-r6ZFgWPx2.js} +1 -1
  253. package/dist/chunks/startupProfiler-BaiXZ9tr.js +1 -0
  254. package/dist/chunks/{startupProfiler-DCn_NxMH.js → startupProfiler-jeId9f2i.js} +2 -2
  255. package/dist/chunks/state-B4HwLt8i.js +1 -0
  256. package/dist/chunks/{state-Cn_m2NOf.js → state-BAGmpVBn.js} +1 -1
  257. package/dist/chunks/state-Bs5xweDL.js +1 -0
  258. package/dist/chunks/{staticRender-BIxpgNUq.js → staticRender-DrU6eWoq.js} +1 -1
  259. package/dist/chunks/{stats-Duk7_xjQ.js → stats-BJBhl-Lc.js} +1 -1
  260. package/dist/chunks/{status-peiVB_2j.js → status-BtsnKNVY.js} +1 -1
  261. package/dist/chunks/status-nZQEar7T.js +2 -0
  262. package/dist/chunks/{statusNoticeHelpers-B5U5c9PE.js → statusNoticeHelpers-DMqRGFOh.js} +1 -1
  263. package/dist/chunks/{stringUtils-B6FudhoZ.js → stringUtils-CbS6OkmE.js} +1 -1
  264. package/dist/chunks/subprocessEnv-CZkA9Cdp.js +1 -0
  265. package/dist/chunks/{subprocessEnv-vrwzMgKn.js → subprocessEnv-Ci8VV_bi.js} +1 -1
  266. package/dist/chunks/{switcher-BAMqSX7Z.js → switcher-77h2J5HC.js} +1 -1
  267. package/dist/chunks/switcher-B2CYzCC_.js +1 -0
  268. package/dist/chunks/{syncCache-Zl9kZRRl.js → syncCache-By_-buUC.js} +1 -1
  269. package/dist/chunks/tasks-BNrdmF9p.js +1 -0
  270. package/dist/chunks/teleport-mdnhIZBj.js +1 -0
  271. package/dist/chunks/{templateJobs-DR5fKFiO.js → templateJobs-Dkv4I9c1.js} +1 -1
  272. package/dist/chunks/{terminalSetup-DgRBt-JJ.js → terminalSetup-DQopnSPR.js} +1 -1
  273. package/dist/chunks/terminalSetup-DTGm1Eo2.js +33 -0
  274. package/dist/chunks/{theme-Bz6esfST.js → theme-BjpBVRf5.js} +1 -1
  275. package/dist/chunks/{tmux-DSU9tYIo.js → tmux-CMRiI6CD.js} +1 -1
  276. package/dist/chunks/{toolEventObserver-BSekCkM2.js → toolEventObserver-D-sNBvOe.js} +1 -1
  277. package/dist/chunks/toolPool-Di30gn_Y.js +1 -0
  278. package/dist/chunks/trustedDevice-CupLMpO8.js +1 -0
  279. package/dist/chunks/{trustedDevice-B0x9X0fb.js → trustedDevice-j1u2TG5U.js} +1 -1
  280. package/dist/chunks/{types-D7_37tP2.js → types-DWRxAH0E.js} +1 -1
  281. package/dist/chunks/{udsClient-CHoMMH28.js → udsClient-Cm3HqYUu.js} +1 -1
  282. package/dist/chunks/{updateCCB-D_kGQKPT.js → updateCCB-BlUAU2Vp.js} +8 -8
  283. package/dist/chunks/{upstreamproxy-Hmq-n8fw.js → upstreamproxy-DDVMwoRi.js} +1 -1
  284. package/dist/chunks/useExitOnCtrlCDWithKeybindings-D2FvHieH.js +1 -0
  285. package/dist/chunks/useMainLoopModel-ylPQNj7Z.js +1 -0
  286. package/dist/chunks/useManagePlugins-BbWJNLe8.js +1 -0
  287. package/dist/chunks/useMergedTools-B-Z9XQ6U.js +1 -0
  288. package/dist/chunks/useSearchInput-C6d6nt9S.js +1 -0
  289. package/dist/chunks/useSettingsErrors-DKh4rkGi.js +1 -0
  290. package/dist/chunks/{userAgent-BxTG7IMk.js → userAgent-Ng_TTjWr.js} +1 -1
  291. package/dist/chunks/util-D-X8i5Z2.js +1 -0
  292. package/dist/chunks/validatePlugin-DSw08u76.js +1 -0
  293. package/dist/chunks/vim-3mUqsEJm.js +1 -0
  294. package/dist/chunks/{which-CHLNJmtJ.js → which-DznMOwny.js} +1 -1
  295. package/dist/chunks/windowsPaths-1mgenSWa.js +1 -0
  296. package/dist/chunks/{windowsPaths-o62uq6LF.js → windowsPaths-BVztIhXM.js} +1 -1
  297. package/dist/chunks/{workSecret-DG9shvG0.js → workSecret-DtiFreRl.js} +1 -1
  298. package/dist/chunks/workerRegistry-DdOYjLm3.js +6 -0
  299. package/dist/chunks/worktree-BX1ULzrw.js +1 -0
  300. package/dist/cli.js +1 -1
  301. package/package.json +1 -1
  302. package/dist/chunks/AddWorkspaceDirectory-CwLtQld4.js +0 -1
  303. package/dist/chunks/App-Ba52HvYC.js +0 -1
  304. package/dist/chunks/ApproveApiKey-CEIfuUh0.js +0 -1
  305. package/dist/chunks/ApproveApiKey-D2MLQu2P.js +0 -1
  306. package/dist/chunks/BackgroundTasksDialog-IGDrkbWl.js +0 -2
  307. package/dist/chunks/BypassPermissionsModeDialog-GYhq--JR.js +0 -1
  308. package/dist/chunks/ClaudeMdExternalIncludesDialog-C-CTa-95.js +0 -1
  309. package/dist/chunks/ClaudeMdExternalIncludesDialog-Catv6BCJ.js +0 -1
  310. package/dist/chunks/ConsoleOAuthFlow-BeQXqUtX.js +0 -1
  311. package/dist/chunks/DiffDialog-AC5DSJrq.js +0 -6
  312. package/dist/chunks/Doctor-B9Rxsoy0.js +0 -1
  313. package/dist/chunks/Doctor-lhUBhEy5.js +0 -3
  314. package/dist/chunks/ExitFlow-Cu8SoQHs.js +0 -2
  315. package/dist/chunks/Grove-Bc4CofEj.js +0 -11
  316. package/dist/chunks/InvalidConfigDialog-BI13il58.js +0 -1
  317. package/dist/chunks/InvalidSettingsDialog-CtOheV1K.js +0 -1
  318. package/dist/chunks/MCPConnectionManager-ao-P3xSA.js +0 -1
  319. package/dist/chunks/MCPToolListView-dkofcJs4.js +0 -1
  320. package/dist/chunks/McpParsingWarnings-BS4JoR5l.js +0 -1
  321. package/dist/chunks/MessageSelector-B88b2ypw.js +0 -3
  322. package/dist/chunks/Messages-BPeI7lLV.js +0 -11
  323. package/dist/chunks/Onboarding-c2fQ8Io_.js +0 -1
  324. package/dist/chunks/PromptInputFooterSuggestions-D1cH9sDX.js +0 -1
  325. package/dist/chunks/PromptInputHelpMenu-DDD5WuK0.js +0 -1
  326. package/dist/chunks/QueryEngine-Cv_meCam.js +0 -1
  327. package/dist/chunks/REPL-BXhAQOXb.js +0 -139
  328. package/dist/chunks/REPL-YqjLnr3A.js +0 -1
  329. package/dist/chunks/RemoteSessionManager-CT7T8BaR.js +0 -2
  330. package/dist/chunks/ResumeConversation-CIZCjms9.js +0 -1
  331. package/dist/chunks/SearchExtraToolsTool-Dx6093yw.js +0 -1
  332. package/dist/chunks/Settings-CyUm0AtU.js +0 -2
  333. package/dist/chunks/TeleportProgress-C3qyp5zy.js +0 -1
  334. package/dist/chunks/TeleportRepoMismatchDialog-BV--nyYn.js +0 -1
  335. package/dist/chunks/TeleportResumeWrapper-Blo2cZg-.js +0 -1
  336. package/dist/chunks/ThemePicker-EQ6hPUeI.js +0 -1
  337. package/dist/chunks/add-dir-DPQV0qml.js +0 -1
  338. package/dist/chunks/agents-DmybpgDN.js +0 -103
  339. package/dist/chunks/allErrors-BPn_2TrB.js +0 -1
  340. package/dist/chunks/analytics-CkYUHW_U.js +0 -1
  341. package/dist/chunks/ant-DjdvlLOo.js +0 -1
  342. package/dist/chunks/api-AMgj1zf_.js +0 -1
  343. package/dist/chunks/asciicast-BJNYO5sh.js +0 -4
  344. package/dist/chunks/asciicast-CH6hdK0a.js +0 -1
  345. package/dist/chunks/auth-CNjDn1VY.js +0 -15
  346. package/dist/chunks/auth-CZzP483s.js +0 -1
  347. package/dist/chunks/auth-DDSBm_Yj.js +0 -1
  348. package/dist/chunks/autonomy-D4xZLOdJ.js +0 -15
  349. package/dist/chunks/backgroundHousekeeping--eBgphcg.js +0 -17
  350. package/dist/chunks/backgroundHousekeeping-VV1V_Y2Z.js +0 -1
  351. package/dist/chunks/bg-BK_9J6F6.js +0 -1
  352. package/dist/chunks/branch-BYq0zpzT.js +0 -3
  353. package/dist/chunks/bridgeConfig-C82un7rJ.js +0 -1
  354. package/dist/chunks/btw-CUV3nRrE.js +0 -1
  355. package/dist/chunks/caches-BZ59_En6.js +0 -1
  356. package/dist/chunks/caches-Cg-HtWKG.js +0 -1
  357. package/dist/chunks/client-DQXvVKND.js +0 -1
  358. package/dist/chunks/client-DkgC-mFB.js +0 -1
  359. package/dist/chunks/color-CBsNbt1s.js +0 -1
  360. package/dist/chunks/commands-qM5z_Uld.js +0 -1
  361. package/dist/chunks/compact-BclJiRJe.js +0 -2
  362. package/dist/chunks/completionCache-BMHAktkM.js +0 -1
  363. package/dist/chunks/config-CE058cvr.js +0 -3
  364. package/dist/chunks/config-D81avYye.js +0 -1
  365. package/dist/chunks/config-DpOOllGk.js +0 -1
  366. package/dist/chunks/context-noninteractive-DJb8H_hN.js +0 -1
  367. package/dist/chunks/context-sR9fJmXE.js +0 -1
  368. package/dist/chunks/conversation-D48Kt3ar.js +0 -1
  369. package/dist/chunks/conversation-fOFTa7k5.js +0 -1
  370. package/dist/chunks/createSession-CSwlW2T2.js +0 -1
  371. package/dist/chunks/crossProjectResume-lDFB2ZcY.js +0 -40
  372. package/dist/chunks/cwd-5Xr-Qka6.js +0 -1
  373. package/dist/chunks/datadog-BJn5ECIu.js +0 -1
  374. package/dist/chunks/detectRepository-DqQvyj_a.js +0 -1
  375. package/dist/chunks/directoryCompletion-BagQcynj.js +0 -1
  376. package/dist/chunks/doctor-BEHYm34V.js +0 -1
  377. package/dist/chunks/entry-BzL1MFQG.js +0 -14
  378. package/dist/chunks/envUtils-DSxRz_kt.js +0 -1
  379. package/dist/chunks/eventLoopStallDetector-Cg_RXU1q.js +0 -1
  380. package/dist/chunks/exit-DE2YiAhQ.js +0 -1
  381. package/dist/chunks/extraUsage-Dw7AXiH7.js +0 -1
  382. package/dist/chunks/extractMemories-DxTUMiv3.js +0 -1
  383. package/dist/chunks/fast-CHmMkIpE.js +0 -1
  384. package/dist/chunks/fast-uQASHWqR.js +0 -1
  385. package/dist/chunks/fileSuggestions-Dyu2kQtE.js +0 -3
  386. package/dist/chunks/firstPartyEventLogger-D5ohKbIe.js +0 -5
  387. package/dist/chunks/firstPartyEventLogger-LsNY6yOt.js +0 -1
  388. package/dist/chunks/generateRecap-CiFxXlmH.js +0 -1
  389. package/dist/chunks/generateSessionName-DitoBxJT.js +0 -1
  390. package/dist/chunks/git-D6dOU2mT.js +0 -1
  391. package/dist/chunks/githubRepoPathMapping-DGr0kJ8D.js +0 -1
  392. package/dist/chunks/goal-DuUayfDg.js +0 -3
  393. package/dist/chunks/grok-tRbmZzEh.js +0 -1
  394. package/dist/chunks/grove-Cv19v6Sv.js +0 -7
  395. package/dist/chunks/help-DkqxbFDM.js +0 -1
  396. package/dist/chunks/hooks-CsP42iOp.js +0 -1
  397. package/dist/chunks/initReplBridge-DdsSWVqN.js +0 -1
  398. package/dist/chunks/keybindings-DZU3vwo3.js +0 -2
  399. package/dist/chunks/language-DHhXLb_Y.js +0 -1
  400. package/dist/chunks/launchLocalMemory-twLxpPvg.js +0 -3
  401. package/dist/chunks/launchOnboarding-BWz2XSb9.js +0 -8
  402. package/dist/chunks/lib-rQZENxQg.js +0 -8
  403. package/dist/chunks/loadAgentsDir-CMNFLt7R.js +0 -1
  404. package/dist/chunks/loadPluginHooks-BPnxcgrL.js +0 -1
  405. package/dist/chunks/localSearch-DzQODFap.js +0 -1
  406. package/dist/chunks/logoV2Utils-CGUJ-5gY.js +0 -1
  407. package/dist/chunks/main-D4Uk-WUs.js +0 -862
  408. package/dist/chunks/managedEnv-DLVRBaA9.js +0 -1
  409. package/dist/chunks/mcp-BMVdGknC.js +0 -1
  410. package/dist/chunks/mcp-COS5RJFS.js +0 -6
  411. package/dist/chunks/mcp-tGsOW1GN.js +0 -2
  412. package/dist/chunks/memory-DR6poqeH.js +0 -1
  413. package/dist/chunks/mode-QV-NW1Wd.js +0 -2
  414. package/dist/chunks/model-BF_4ebyl.js +0 -1
  415. package/dist/chunks/model-BNU_ulDJ.js +0 -1
  416. package/dist/chunks/model-CwO-g1RW.js +0 -1
  417. package/dist/chunks/nativeInstaller-B-lNJjM-.js +0 -1
  418. package/dist/chunks/oauth-BqJqV-2M.js +0 -1
  419. package/dist/chunks/oauth-C8X_p8Gc.js +0 -1
  420. package/dist/chunks/omit-DZCEXri5.js +0 -1
  421. package/dist/chunks/onChangeAppState-BmfM5g-D.js +0 -1
  422. package/dist/chunks/p-map-B1EeBuI8.js +0 -1
  423. package/dist/chunks/p-map-HKDr3iDo.js +0 -1
  424. package/dist/chunks/panelCall-SbffM7G4.js +0 -1
  425. package/dist/chunks/parser-DrBC8nWp.js +0 -1
  426. package/dist/chunks/partition-DKuAFJkc.js +0 -1
  427. package/dist/chunks/path-Cv9QMBAX.js +0 -1
  428. package/dist/chunks/permissions-ey-bfanE.js +0 -3
  429. package/dist/chunks/pidLock-DJnS_38v.js +0 -3
  430. package/dist/chunks/plan-Brg9XnRr.js +0 -1
  431. package/dist/chunks/plugin-CRwa39Y1.js +0 -17
  432. package/dist/chunks/pluginAutoupdate-D0LIP7cy.js +0 -1
  433. package/dist/chunks/pluginBlocklist-PwHHD3nj.js +0 -1
  434. package/dist/chunks/pluginCliCommands-BJM5Bdpf.js +0 -1
  435. package/dist/chunks/pluginOperations-C7p_Qr2r.js +0 -2
  436. package/dist/chunks/pluginStartupCheck-C0HqhG6D.js +0 -1
  437. package/dist/chunks/plugins-DUKNjLq6.js +0 -4
  438. package/dist/chunks/poorMode-CejPNCp-.js +0 -1
  439. package/dist/chunks/print-gyTOCJzk.js +0 -23
  440. package/dist/chunks/processBashCommand-Cze9vCm6.js +0 -1
  441. package/dist/chunks/processSlashCommand-BRajh1v7.js +0 -5
  442. package/dist/chunks/prompt-B7joRiqj.js +0 -139
  443. package/dist/chunks/prompt-DqSMh2x9.js +0 -1
  444. package/dist/chunks/prompt-Eysh8Et_.js +0 -1
  445. package/dist/chunks/promptEditor-R_acDAgI.js +0 -4
  446. package/dist/chunks/reconciler-BfkO6X2X.js +0 -4
  447. package/dist/chunks/refresh-C1X3sptR.js +0 -1
  448. package/dist/chunks/reload-plugins-C0osFcNh.js +0 -1
  449. package/dist/chunks/remoteManagedSettings-B1mnRDmA.js +0 -1
  450. package/dist/chunks/rename-B3tf-YiD.js +0 -1
  451. package/dist/chunks/replBridgeHandle-CNwNIijW.js +0 -1
  452. package/dist/chunks/resume-Be1G_GBL.js +0 -2
  453. package/dist/chunks/ripgrep-C2PhTJDh.js +0 -1
  454. package/dist/chunks/rollback-BPWRKlIZ.js +0 -11
  455. package/dist/chunks/sandbox-adapter-C6GBuJPB.js +0 -1
  456. package/dist/chunks/sandbox-toggle-jEySONTW.js +0 -1
  457. package/dist/chunks/sdkHeapDumpMonitor-WdXUV7DV.js +0 -1
  458. package/dist/chunks/searchExtraTools-C_UTryh_.js +0 -1
  459. package/dist/chunks/session-DDI1Eb2x.js +0 -2
  460. package/dist/chunks/sessionDataUploader-CaCjwsA2.js +0 -1
  461. package/dist/chunks/sessionFileAccessHooks-DfJ7Htfl.js +0 -1
  462. package/dist/chunks/sessionMemory-CQBxPkTQ.js +0 -1
  463. package/dist/chunks/sessionMemory-s0ALUHvc.js +0 -1
  464. package/dist/chunks/sessionMemoryUtils-xt7dTHGC.js +0 -1
  465. package/dist/chunks/sessionObserver-C2sYqWL3.js +0 -1
  466. package/dist/chunks/sessionStorage-DqsY-7pi.js +0 -1
  467. package/dist/chunks/sessionTitle-B0OYf5nM.js +0 -14
  468. package/dist/chunks/sessionTracing-CwsXt_uA.js +0 -11
  469. package/dist/chunks/settings-BWtOA9A7.js +0 -1
  470. package/dist/chunks/settings-hQDLwPVj.js +0 -20
  471. package/dist/chunks/settingsSync-DdFagwHV.js +0 -1
  472. package/dist/chunks/setup-DzC22EkN.js +0 -3
  473. package/dist/chunks/shadowedRuleDetection-C86PTj1m.js +0 -1
  474. package/dist/chunks/sinks-5G_xhc1Q.js +0 -1
  475. package/dist/chunks/sinks-Cftq7Es0.js +0 -2
  476. package/dist/chunks/skillChangeDetector-plLveEbf.js +0 -1
  477. package/dist/chunks/skills-zGYaYfFV.js +0 -1
  478. package/dist/chunks/startupProfiler-JbpAkfNE.js +0 -1
  479. package/dist/chunks/state-C2OSZkV1.js +0 -1
  480. package/dist/chunks/state-DU9lRJ9x.js +0 -1
  481. package/dist/chunks/status-CFw-FpZM.js +0 -2
  482. package/dist/chunks/subprocessEnv-BSQSomcK.js +0 -1
  483. package/dist/chunks/switcher-hgBgVzLb.js +0 -1
  484. package/dist/chunks/tasks-BxpyRhmD.js +0 -1
  485. package/dist/chunks/teleport-CwxeD5vL.js +0 -1
  486. package/dist/chunks/terminalSetup-DlaFWI81.js +0 -33
  487. package/dist/chunks/toolPool-B7SIoDw5.js +0 -1
  488. package/dist/chunks/trustedDevice-CjHQtVkO.js +0 -1
  489. package/dist/chunks/up-B8wBSpLg.js +0 -12
  490. package/dist/chunks/useExitOnCtrlCDWithKeybindings-Cce612uS.js +0 -1
  491. package/dist/chunks/useMainLoopModel-BICP6_Fi.js +0 -1
  492. package/dist/chunks/useManagePlugins-DtbY_vPL.js +0 -1
  493. package/dist/chunks/useMergedTools-Ckx2IEhF.js +0 -1
  494. package/dist/chunks/useSearchInput-BAgljZUl.js +0 -1
  495. package/dist/chunks/useSettingsErrors-CAJR_wpd.js +0 -1
  496. package/dist/chunks/util-DDtmyq_r.js +0 -1
  497. package/dist/chunks/validatePlugin-AHl-g4ct.js +0 -1
  498. package/dist/chunks/vim-kg-mRVbu.js +0 -1
  499. package/dist/chunks/windowsPaths-Pmx8LDR6.js +0 -1
  500. package/dist/chunks/workerRegistry-C7H_lsQX.js +0 -6
  501. package/dist/chunks/worktree-O2p-mJdF.js +0 -1
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-DaDcL9Zw.js";import{I as e,P as t,fi as n,kn as r,t as i,y as a}from"./src-CDCSSo0U2.js";import{t as o}from"./jsx-runtime-Bb4Xn-E0.js";import{Rp as s,_v as c,gv as l,op as u,sp as d,zp as f}from"./loadAgentsDir-ByO8eJqU.js";import{E as p,S as m,w as h}from"./debug-RZ4NuXyS.js";import{t as g}from"./renderOptions-ChLwxtVu.js";n(),i(),d(),c(),m(),s();var _=o();function v({filePath:n,errorDescription:r,onExit:i,onReset:o}){return(0,_.jsxs)(a,{title:`Configuration Error`,color:`error`,onCancel:i,children:[(0,_.jsxs)(e,{flexDirection:`column`,gap:1,children:[(0,_.jsxs)(t,{children:[`The configuration file at `,(0,_.jsx)(t,{bold:!0,children:n}),` contains invalid JSON.`]}),(0,_.jsx)(t,{children:r})]}),(0,_.jsxs)(e,{flexDirection:`column`,children:[(0,_.jsx)(t,{bold:!0,children:`Choose an option:`}),(0,_.jsx)(f,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Reset with default configuration`,value:`reset`}],onChange:e=>{e===`exit`?i():o()},onCancel:i})]})]})}var y=`dark`;async function b({error:e}){let t={...g(!1),theme:y};await new Promise(async n=>{let{unmount:i}=await r((0,_.jsx)(l,{children:(0,_.jsx)(u,{children:(0,_.jsx)(v,{filePath:e.filePath,errorDescription:e.message,onExit:()=>{i(),n(),process.exit(1)},onReset:()=>{p(e.filePath,h(e.defaultConfig,null,2),{flush:!1,encoding:`utf8`}),i(),n(),process.exit(0)}})})}),t)})}export{b as showInvalidConfigDialog};
@@ -1 +0,0 @@
1
- import"./rolldown-runtime-DaDcL9Zw.js";import{P as e,fi as t,t as n,y as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{Rp as a,zp as o}from"./loadAgentsDir-ByO8eJqU.js";import{n as s,t as c}from"./ValidationErrorsList-DokTJQwi.js";t(),n(),a(),s();var l=i();function u({settingsErrors:t,onContinue:n,onExit:i}){function a(e){e===`exit`?i():n()}return(0,l.jsxs)(r,{title:`Settings Error`,onCancel:i,color:`warning`,children:[(0,l.jsx)(c,{errors:t}),(0,l.jsx)(e,{dimColor:!0,children:`Files with errors are skipped entirely, not just the invalid settings.`}),(0,l.jsx)(o,{options:[{label:`Exit and fix manually`,value:`exit`},{label:`Continue without these settings`,value:`continue`}],onChange:a})]})}export{u as InvalidSettingsDialog};
@@ -1 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{fi as r}from"./src-CDCSSo0U2.js";import{t as i}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as a,mt as o}from"./state-C2OSZkV1.js";import{AT as s,BC as c,BE as l,DC as u,DT as d,ES as f,ET as p,GC as m,Gm as ee,IC as h,KC as g,MC as _,NC as v,NS as y,OS as b,PC as te,PS as x,SS as S,TS as C,VC as w,VE as T,Wm as E,YC as D,_v as O,bC as ne,bv as re,jS as k,jT as A,kS as ie,mC as ae,qC as oe,vv as j,wS as M,yv as se}from"./loadAgentsDir-ByO8eJqU.js";import{F as N,a as ce,l as le,z as P}from"./debug-RZ4NuXyS.js";import{it as F,nt as I}from"./settings-hQDLwPVj.js";import{c as L,l as R,o as z}from"./log-CZ0zYP_c.js";import{n as B,r as V}from"./analytics-CkYUHW_U.js";import{n as H,t as U}from"./omit-DZCEXri5.js";import{o as ue,s as de}from"./localSearch-CHHCH16D.js";import{basename as fe}from"path";function W(e){let t=`plugin`in e?e.plugin:`no-plugin`;return`${e.type}:${e.source}:${t}`}function G(e,t){t.length!==0&&e(e=>{let n=new Set(e.plugins.errors.map(e=>W(e))),r=t.filter(e=>!n.has(W(e)));return r.length===0?e:{...e,plugins:{...e.plugins,errors:[...e.plugins.errors,...r]}}})}function pe(e,t=!1){let n=se(),r=j(e=>e.authVersion),i=j(e=>e.mcp.pluginReconnectKey),a=re(),c=(0,K.useRef)(new Map),{addNotification:l}=ee(),u=(0,K.useRef)([]),y=(0,K.useRef)(null),E=(0,K.useCallback)(()=>{y.current=null;let e=u.current;e.length!==0&&(u.current=[],a(t=>{let n=t.mcp;for(let t of e){let{tools:e,commands:r,resources:i,...a}=t,o=a.type===`disabled`||a.type===`failed`?e??[]:e,s=a.type===`disabled`||a.type===`failed`?r??[]:r,c=a.type===`disabled`||a.type===`failed`?i??[]:i,l=I(a.name),u=n.clients.findIndex(e=>e.name===a.name)===-1?[...n.clients,a]:n.clients.map(e=>e.name===a.name?a:e),d=o===void 0?n.tools:[...T(n.tools,e=>e.name?.startsWith(l)),...o],f=s===void 0?n.commands:[...T(n.commands,e=>ae(e,a.name)),...s],p=c===void 0?n.resources:{...n.resources,...c.length>0?{[a.name]:c}:H(n.resources,a.name)};n={...n,clients:u,tools:d,commands:f,resources:p}}return{...t,mcp:n}}))},[a]),D=(0,K.useCallback)(e=>{u.current.push(e),y.current===null&&(y.current=setTimeout(E,16))},[E]),O=(0,K.useCallback)(({client:e,tools:t,commands:n,resources:r})=>{switch(D({...e,tools:t,commands:n,resources:r}),e.type){case`connected`:x(e.client,e.name,a),e.client.onclose=()=>{let t=e.config.type??`stdio`;if(S(e.name,e.config).catch(()=>{le(`Failed to invalidate the server cache: ${e.name}`)}),w(e.name)){L(e.name,`Server is disabled, skipping automatic reconnection`);return}if(t!==`stdio`&&t!==`sdk`){let n=me(t);L(e.name,`${n} transport closed/disconnected, attempting automatic reconnection`);let r=c.current.get(e.name);r&&(clearTimeout(r),c.current.delete(e.name)),(async()=>{for(let t=1;t<=J;t++){if(w(e.name)){L(e.name,`Server disabled during reconnection, stopping retry`),c.current.delete(e.name);return}D({...e,type:`pending`,reconnectAttempt:t,maxReconnectAttempts:J});let r=Date.now();try{let i=await k(e.name,e.config),a=Date.now()-r;if(i.client.type===`connected`){L(e.name,`${n} reconnection successful after ${a}ms (attempt ${t})`),c.current.delete(e.name),O(i);return}if(L(e.name,`${n} reconnection attempt ${t} completed with status: ${i.client.type}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),c.current.delete(e.name),O(i);return}}catch(i){let a=Date.now()-r;if(R(e.name,`${n} reconnection attempt ${t} failed after ${a}ms: ${i}`),t===J){L(e.name,`Max reconnection attempts (${J}) reached, giving up`),c.current.delete(e.name),D({...e,type:`failed`});return}}let i=Math.min(Y*2**(t-1),X);L(e.name,`Scheduling reconnection attempt ${t+1} in ${i}ms`),await new Promise(t=>{let n=setTimeout(t,i);c.current.set(e.name,n)})}})()}else D({...e,type:`failed`})},e.capabilities?.tools?.listChanged&&e.client.setNotificationHandler(s,async()=>{L(e.name,`Received tools/list_changed notification, refreshing tools`);try{let t=f.cache.get(e.name);f.cache.delete(e.name);let n=await f(e),r=n.length;t?t.then(e=>{V(`tengu_mcp_list_changed`,{type:`tools`,previousCount:e.length,newCount:r})},()=>{V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r})}):V(`tengu_mcp_list_changed`,{type:`tools`,newCount:r}),D({...e,tools:n})}catch(t){R(e.name,`Failed to refresh tools after list_changed notification: ${N(t)}`)}}),e.capabilities?.prompts?.listChanged&&e.client.setNotificationHandler(p,async()=>{L(e.name,`Received prompts/list_changed notification, refreshing prompts`),V(`tengu_mcp_list_changed`,{type:`prompts`});try{M.cache.delete(e.name);let[t,n]=await Promise.all([M(e),Promise.resolve([])]);D({...e,commands:[...t,...n]}),q?.()}catch(t){R(e.name,`Failed to refresh prompts after list_changed notification: ${N(t)}`)}}),e.capabilities?.resources?.listChanged&&e.client.setNotificationHandler(d,async()=>{L(e.name,`Received resources/list_changed notification, refreshing resources`),V(`tengu_mcp_list_changed`,{type:`resources`});try{C.cache.delete(e.name);{let t=await C(e);D({...e,resources:t})}}catch(t){R(e.name,`Failed to refresh resources after list_changed notification: ${N(t)}`)}});break;case`needs-auth`:case`failed`:case`pending`:case`disabled`:break}},[D]),A=o();return(0,K.useEffect)(()=>{async function n(){let{servers:n,errors:r}=t?{servers:{},errors:[]}:await h(e),i={...n,...e};G(a,r),a(e=>{let{stale:t,...n}=ne(e.mcp,i);for(let e of t){let t=c.current.get(e.name);t&&(clearTimeout(t),c.current.delete(e.name)),e.type===`connected`&&(e.client.onclose=void 0,S(e.name,e.config).catch(()=>{}))}let r=new Set(n.clients.map(e=>e.name)),a=Object.entries(i).filter(([e])=>!r.has(e)).map(([e,t])=>({name:e,type:w(e)?`disabled`:`pending`,config:t}));return a.length===0&&t.length===0?e:{...e,mcp:{...e.mcp,...n,clients:[...n.clients,...a]}}})}n().catch(e=>{R(`useManageMCPConnections`,`Failed to initialize servers as pending: ${N(e)}`)})},[t,e,a,A,i]),(0,K.useEffect)(()=>{let n=!1;async function r(){let r;t||v()?r=Promise.resolve({}):(g(),r=oe());let{servers:i,errors:o}=t?{servers:{},errors:[]}:await h(e,r);if(n)return;G(a,o);let s={...i,...e},c=Object.fromEntries(Object.entries(s).filter(([e])=>!w(e)));b(O,c).catch(e=>{R(`useManageMcpConnections`,`Failed to get MCP resources: ${N(e)}`)});let l={};if(!t){if(l=te(await r).allowed,n)return;if(Object.keys(l).length>0){let{servers:e}=_(l,s);l=e}if(Object.keys(l).length>0){a(e=>{let t=new Set(e.mcp.clients.map(e=>e.name)),n=Object.entries(l).filter(([e])=>!t.has(e)).map(([e,t])=>({name:e,type:w(e)?`disabled`:`pending`,config:t}));return n.length===0?e:{...e,mcp:{...e.mcp,clients:[...e.mcp.clients,...n]}}});let e=Object.fromEntries(Object.entries(l).filter(([e])=>!w(e)));b(O,e).catch(e=>{R(`useManageMcpConnections`,`Failed to get claude.ai MCP resources: ${N(e)}`)})}}let u={...s,...l},d={enterprise:0,global:0,project:0,user:0,plugin:0,claudeai:0},f=[];for(let[e,t]of Object.entries(u))t.scope===`enterprise`?d.enterprise++:t.scope===`user`?d.global++:t.scope===`project`?d.project++:t.scope===`local`?d.user++:t.scope===`dynamic`?d.plugin++:t.scope===`claudeai`&&d.claudeai++,process.env.USER_TYPE===`ant`&&!w(e)&&(t.type===void 0||t.type===`stdio`)&&`command`in t&&f.push(fe(t.command));V(`tengu_mcp_servers`,{...d,...process.env.USER_TYPE===`ant`&&f.length>0?{stdio_commands:f.sort().join(`,`)}:{}})}return r(),()=>{n=!0}},[t,e,O,a,r,A,i]),(0,K.useEffect)(()=>{let e=c.current;return()=>{for(let t of e.values())clearTimeout(t);e.clear(),y.current!==null&&(clearTimeout(y.current),y.current=null,E())}},[E]),{reconnectMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);let r=c.current.get(e);r&&(clearTimeout(r),c.current.delete(e));let i=await k(e,t.config);return O(i),i},[n,O]),toggleMcpServer:(0,K.useCallback)(async e=>{let t=n.getState().mcp.clients.find(t=>t.name===e);if(!t)throw Error(`MCP server ${e} not found`);if(t.type!==`disabled`){let n=c.current.get(e);n&&(clearTimeout(n),c.current.delete(e)),m(e,!1),t.type===`connected`&&await S(e,t.config),D({name:e,type:`disabled`,config:t.config})}else{m(e,!0),D({name:e,type:`pending`,config:t.config});let n=await k(e,t.config);O(n)}},[n,D,O])}}function me(e){switch(e){case`http`:return`HTTP`;case`ws`:case`ws-ide`:return`WebSocket`;default:return`SSE`}}var K,q,J,Y,X,he=t((()=>{K=n(r(),1),a(),ie(),A(),U(),l(),B(),c(),ce(),E(),O(),P(),z(),y(),D(),F(),u(),q=(ue(),e(de)).clearSkillIndexCache,J=5,Y=1e3,X=3e4}));function ge(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpReconnect must be used within MCPConnectionManager`);return e.reconnectMcpServer}function _e(){let e=(0,Z.useContext)($);if(!e)throw Error(`useMcpToggleEnabled must be used within MCPConnectionManager`);return e.toggleMcpServer}function ve({children:e,dynamicMcpConfig:t,isStrictMcpConfig:n}){let{reconnectMcpServer:r,toggleMcpServer:i}=pe(t,n),a=(0,Z.useMemo)(()=>({reconnectMcpServer:r,toggleMcpServer:i}),[r,i]);return(0,Q.jsx)($.Provider,{value:a,children:e})}var Z,Q,$,ye=t((()=>{Z=n(r(),1),he(),Q=i(),$=(0,Z.createContext)(null)}));export{_e as i,ye as n,ge as r,ve as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{n,t as r}from"./figures-5ThXQEtq.js";import{D as i,H as a,I as o,Lt as s,P as c,T as l,Wt as u,dr as ee,fi as d,hn as f,j as p,ot as te,t as m,y as h}from"./src-CDCSSo0U2.js";import{t as g}from"./jsx-runtime-Bb4Xn-E0.js";import{$S as ne,BC as _,CC as re,DC as v,Jp as y,LC as b,Pw as x,QS as S,Rp as C,SS as ie,_v as w,bv as ae,dp as T,fw as E,hC as oe,im as se,kS as ce,pp as D,pw as le,qS as ue,qp as O,rm as de,tC as fe,vC as pe,vv as me,wC as k,xC as he,xw as A,yC as ge,zp as _e}from"./loadAgentsDir-ByO8eJqU.js";import{F as ve,z as j}from"./debug-RZ4NuXyS.js";import{et as M,it as N,tt as P}from"./settings-hQDLwPVj.js";import{c as ye,o as F}from"./log-CZ0zYP_c.js";import{n as I,r as L}from"./analytics-CkYUHW_U.js";import{l as be,u as R}from"./oauth-BqJqV-2M.js";import{l as xe,n as Se,o as z}from"./stringUtils-B6FudhoZ.js";import{Bt as B,jt as Ce}from"./model-CwO-g1RW.js";import{i as we,n as V,r as Te}from"./MCPConnectionManager-ao-P3xSA.js";import{n as Ee,t as H}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";function De({serverToolsCount:e,serverPromptsCount:t,serverResourcesCount:n}){let r=[];return e>0&&r.push(`tools`),n>0&&r.push(`resources`),t>0&&r.push(`prompts`),(0,U.jsxs)(o,{children:[(0,U.jsx)(c,{bold:!0,children:`Capabilities: `}),(0,U.jsx)(c,{color:`text`,children:r.length>0?(0,U.jsx)(l,{children:r}):`none`})]})}var U,Oe=e((()=>{d(),m(),U=g()}));function ke(e,t){switch(e.client.type){case`connected`:return{message:`Reconnected to ${t}.`,success:!0};case`needs-auth`:return{message:`${t} requires authentication. Use the 'Authenticate' option.`,success:!1};case`failed`:return{message:`Failed to reconnect to ${t}.`,success:!1};default:return{message:`Unknown result when reconnecting to ${t}.`,success:!1}}}function Ae(e,t){return`Error reconnecting to ${t}: ${e instanceof Error?e.message:String(e)}`}var W=e((()=>{}));function je({server:e,serverToolsCount:t,onViewTools:n,onCancel:d,onComplete:m,borderless:h=!1}){let[g]=a(),_=Ee(),{columns:v}=te(),[y,b]=G.useState(!1),[x,S]=G.useState(null),C=me(e=>e.mcp),w=ae(),[E,se]=G.useState(null),[ce,D]=(0,G.useState)(!1),k=(0,G.useRef)(null),[A,j]=(0,G.useState)(!1),[M,N]=(0,G.useState)(null),[P,F]=(0,G.useState)(!1),[I,R]=(0,G.useState)(null),[xe,z]=(0,G.useState)(!1),[B,V]=(0,G.useState)(!1),H=(0,G.useRef)(void 0),U=(0,G.useRef)(!1),[Oe,W]=(0,G.useState)(``),[je,Me]=(0,G.useState)(0),[Ne,q]=(0,G.useState)(null);(0,G.useEffect)(()=>()=>{U.current=!0,k.current?.abort(),H.current!==void 0&&clearTimeout(H.current)},[]);let J=e.isAuthenticated||e.client.type===`connected`&&t>0,Y=Te(),Pe=G.useCallback(async()=>{j(!1),N(null),D(!0);try{let t=await Y(e.name),n=t.client.type===`connected`;L(`tengu_claudeai_mcp_auth_completed`,{success:n}),n?m?.(`Authentication successful. Connected to ${e.name}.`):t.client.type===`needs-auth`?m?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):m?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`)}catch(t){L(`tengu_claudeai_mcp_auth_completed`,{success:!1}),m?.(Ae(t,e.name))}finally{D(!1)}},[Y,e.name,m]),X=G.useCallback(async()=>{await ie(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`needs-auth`}:t),r=he(t.mcp.tools,e.name),i=pe(t.mcp.commands,e.name),a=ge(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),L(`tengu_claudeai_mcp_clear_auth_completed`,{}),m?.(`Disconnected from ${e.name}.`),F(!1),R(null),z(!1)},[e.name,e.config,e.scope,w,m]);u(`confirm:no`,()=>{k.current?.abort(),k.current=null,b(!1),se(null)},{context:`Confirmation`,isActive:y}),u(`confirm:no`,()=>{j(!1),N(null)},{context:`Confirmation`,isActive:A}),u(`confirm:no`,()=>{F(!1),R(null),z(!1)},{context:`Confirmation`,isActive:P}),f((e,t)=>{if(t.return&&A&&Pe(),t.return&&P)if(xe)X();else{let e=`${be().CLAUDE_AI_ORIGIN}/settings/connectors`;R(e),z(!0),le(e)}if(e===`c`&&!B){let e=E||M||I;e&&ee(e).then(e=>{U.current||(e&&process.stdout.write(e),V(!0),H.current!==void 0&&clearTimeout(H.current),H.current=setTimeout(V,2e3,!1))})}});let Z=Se(String(e.name)),Fe=re(C.commands,e.name).length,Ie=we(),Le=G.useCallback(async()=>{let t=be().CLAUDE_AI_ORIGIN,n=Ce()?.organizationUuid,r;r=n&&e.config.type===`claudeai-proxy`&&e.config.id?`${t}/api/organizations/${n}/mcp/start-auth/${e.config.id.startsWith(`mcprs`)?`mcpsrv`+e.config.id.slice(5):e.config.id}?product_surface=${encodeURIComponent(process.env.CLAUDE_CODE_ENTRYPOINT||`cli`)}`:`${t}/settings/connectors`,N(r),j(!0),L(`tengu_claudeai_mcp_auth_started`,{}),await le(r)},[e.config]),Q=G.useCallback(()=>{F(!0),L(`tengu_claudeai_mcp_clear_auth_started`,{})},[]),Re=G.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await Ie(e.name),e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_toggle`,{new_state:t?`disabled`:`enabled`}),d()}catch(n){m?.(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ve(n)}`)}},[e.client.type,e.config.type,e.name,Ie,d,m]),ze=G.useCallback(async()=>{if(e.config.type===`claudeai-proxy`)return;b(!0),S(null);let t=new AbortController;k.current=t;try{if(e.isAuthenticated&&e.config&&await fe(e.name,e.config,{preserveStepUpState:!0}),e.config){await ne(e.name,e.config,se,t.signal,{onWaitingForCallback:e=>{q(()=>e)}}),L(`tengu_mcp_auth_config_authenticate`,{wasAuthenticated:e.isAuthenticated});let n=await Y(e.name);if(n.client.type===`connected`){let t=J?`Authentication successful. Reconnected to ${e.name}.`:`Authentication successful. Connected to ${e.name}.`;m?.(t)}else n.client.type===`needs-auth`?m?.(`Authentication successful, but server still requires authentication. You may need to manually restart Claude Code.`):(ye(e.name,`Reconnection failed after authentication`),m?.(`Authentication successful, but server reconnection failed. You may need to manually restart Claude Code for the changes to take effect.`))}}catch(e){e instanceof Error&&!(e instanceof ue)&&S(e.message)}finally{b(!1),k.current=null,q(null),W(``)}},[e.isAuthenticated,e.config,e.name,m,Y,J]),Be=async()=>{e.config.type!==`claudeai-proxy`&&e.config&&(await fe(e.name,e.config),L(`tengu_mcp_auth_config_clear`,{}),await ie(e.name,{...e.config,scope:e.scope}),w(t=>{let n=t.mcp.clients.map(t=>t.name===e.name?{...t,type:`failed`}:t),r=he(t.mcp.tools,e.name),i=pe(t.mcp.commands,e.name),a=ge(t.mcp.resources,e.name);return{...t,mcp:{...t.mcp,clients:n,tools:r,commands:i,resources:a}}}),m?.(`Authentication cleared for ${e.name}.`))};if(y){let t=e.config.type!==`claudeai-proxy`&&e.config.oauth?.xaa?` Authenticating via your identity provider`:` A browser window will open for authentication`;return(0,K.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,K.jsxs)(c,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,K.jsxs)(o,{children:[(0,K.jsx)(T,{}),(0,K.jsx)(c,{children:t})]}),E&&(0,K.jsxs)(o,{flexDirection:`column`,children:[(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),B?(0,K.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,K.jsx)(c,{dimColor:!0,children:(0,K.jsx)(i,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,K.jsx)(s,{url:E})]}),y&&E&&Ne&&(0,K.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,K.jsx)(c,{dimColor:!0,children:`If the redirect page shows a connection error, paste the URL from your browser's address bar:`}),(0,K.jsxs)(o,{children:[(0,K.jsxs)(c,{dimColor:!0,children:[`URL `,`>`,` `]}),(0,K.jsx)(de,{value:Oe,onChange:W,onSubmit:e=>{Ne(e.trim()),W(``)},cursorOffset:je,onChangeCursorOffset:Me,columns:v-8})]})]}),(0,K.jsx)(o,{marginLeft:3,children:(0,K.jsx)(c,{dimColor:!0,children:`Return here after authenticating in your browser. Press Esc to go back.`})})]})}if(A)return(0,K.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,K.jsxs)(c,{color:`claude`,children:[`Authenticating with `,e.name,`…`]}),(0,K.jsxs)(o,{children:[(0,K.jsx)(T,{}),(0,K.jsx)(c,{children:` A browser window will open for authentication`})]}),M&&(0,K.jsxs)(o,{flexDirection:`column`,children:[(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{dimColor:!0,children:`If your browser doesn't open automatically, copy this URL manually `}),B?(0,K.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,K.jsx)(c,{dimColor:!0,children:(0,K.jsx)(i,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,K.jsx)(s,{url:M})]}),(0,K.jsxs)(o,{marginLeft:3,flexDirection:`column`,children:[(0,K.jsxs)(c,{color:`permission`,children:[`Press `,(0,K.jsx)(c,{bold:!0,children:`Enter`}),` after authenticating in your browser.`]}),(0,K.jsx)(c,{dimColor:!0,italic:!0,children:(0,K.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]});if(P)return(0,K.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,K.jsxs)(c,{color:`claude`,children:[`Clear authentication for `,e.name]}),xe?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(c,{children:`Find the MCP server in the browser and click "Disconnect".`}),I&&(0,K.jsxs)(o,{flexDirection:`column`,children:[(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{dimColor:!0,children:`If your browser didn't open automatically, copy this URL manually `}),B?(0,K.jsx)(c,{color:`success`,children:`(Copied!)`}):(0,K.jsx)(c,{dimColor:!0,children:(0,K.jsx)(i,{shortcut:`c`,action:`copy`,parens:!0})})]}),(0,K.jsx)(s,{url:I})]}),(0,K.jsxs)(o,{marginLeft:3,flexDirection:`column`,children:[(0,K.jsxs)(c,{color:`permission`,children:[`Press `,(0,K.jsx)(c,{bold:!0,children:`Enter`}),` when done.`]}),(0,K.jsx)(c,{dimColor:!0,italic:!0,children:(0,K.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]}):(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(c,{children:`This will open claude.ai in the browser. Find the MCP server in the list and click "Disconnect".`}),(0,K.jsxs)(o,{marginLeft:3,flexDirection:`column`,children:[(0,K.jsxs)(c,{color:`permission`,children:[`Press `,(0,K.jsx)(c,{bold:!0,children:`Enter`}),` to open the browser.`]}),(0,K.jsx)(c,{dimColor:!0,italic:!0,children:(0,K.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})})]})]})]});if(ce)return(0,K.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,K.jsxs)(c,{color:`text`,children:[`Connecting to `,(0,K.jsx)(c,{bold:!0,children:e.name}),`…`]}),(0,K.jsxs)(o,{children:[(0,K.jsx)(T,{}),(0,K.jsx)(c,{children:` Establishing connection to MCP server`})]}),(0,K.jsx)(c,{dimColor:!0,children:`This may take a few moments.`})]});let $=[];return e.client.type===`disabled`&&$.push({label:`Enable`,value:`toggle-enabled`}),e.client.type===`connected`&&t>0&&$.push({label:`View tools`,value:`tools`}),e.config.type===`claudeai-proxy`?e.client.type===`connected`?$.push({label:`Clear authentication`,value:`claudeai-clear-auth`}):e.client.type!==`disabled`&&$.push({label:`Authenticate`,value:`claudeai-auth`}):(J&&($.push({label:`Re-authenticate`,value:`reauth`}),$.push({label:`Clear authentication`,value:`clear-auth`})),J||$.push({label:`Authenticate`,value:`auth`})),e.client.type!==`disabled`&&(e.client.type!==`needs-auth`&&$.push({label:`Reconnect`,value:`reconnectMcpServer`}),$.push({label:`Disable`,value:`toggle-enabled`})),$.length===0&&$.push({label:`Back`,value:`back`}),(0,K.jsxs)(o,{flexDirection:`column`,children:[(0,K.jsxs)(o,{flexDirection:`column`,paddingX:1,borderStyle:h?void 0:`round`,children:[(0,K.jsx)(o,{marginBottom:1,children:(0,K.jsxs)(c,{bold:!0,children:[Z,` MCP Server`]})}),(0,K.jsxs)(o,{flexDirection:`column`,gap:0,children:[(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,K.jsxs)(c,{children:[p(`inactive`,g)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,K.jsxs)(c,{children:[p(`success`,g)(r.tick),` connected`]}):e.client.type===`pending`?(0,K.jsxs)(K.Fragment,{children:[(0,K.jsx)(c,{dimColor:!0,children:r.radioOff}),(0,K.jsx)(c,{children:` connecting…`})]}):e.client.type===`needs-auth`?(0,K.jsxs)(c,{children:[p(`warning`,g)(r.triangleUpOutline),` needs authentication`]}):(0,K.jsxs)(c,{children:[p(`error`,g)(r.cross),` failed`]})]}),e.transport!==`claudeai-proxy`&&(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{bold:!0,children:`Auth: `}),J?(0,K.jsxs)(c,{children:[p(`success`,g)(r.tick),` authenticated`]}):(0,K.jsxs)(c,{children:[p(`error`,g)(r.cross),` not authenticated`]})]}),(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{bold:!0,children:`URL: `}),(0,K.jsx)(c,{dimColor:!0,children:e.config.url})]}),(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{bold:!0,children:`Config location: `}),(0,K.jsx)(c,{dimColor:!0,children:oe(e.scope)})]}),e.client.type===`connected`&&(0,K.jsx)(De,{serverToolsCount:t,serverPromptsCount:Fe,serverResourcesCount:C.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,K.jsxs)(o,{children:[(0,K.jsx)(c,{bold:!0,children:`Tools: `}),(0,K.jsxs)(c,{dimColor:!0,children:[t,` tools`]})]})]}),x&&(0,K.jsx)(o,{marginTop:1,children:(0,K.jsxs)(c,{color:`error`,children:[`Error: `,x]})}),$.length>0&&(0,K.jsx)(o,{marginTop:1,children:(0,K.jsx)(_e,{options:$,onChange:async t=>{switch(t){case`tools`:n();break;case`auth`:case`reauth`:await ze();break;case`clear-auth`:await Be();break;case`claudeai-auth`:await Le();break;case`claudeai-clear-auth`:Q();break;case`reconnectMcpServer`:D(!0);try{let t=await Y(e.name);e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_reconnect`,{success:t.client.type===`connected`});let{message:n}=ke(t,e.name);m?.(n)}catch(t){e.config.type===`claudeai-proxy`&&L(`tengu_claudeai_mcp_reconnect`,{success:!1}),m?.(Ae(t,e.name))}finally{D(!1)}break;case`toggle-enabled`:await Re();break;case`back`:d();break}},onCancel:d})})]}),(0,K.jsx)(o,{marginTop:1,children:(0,K.jsx)(c,{dimColor:!0,italic:!0,children:_.pending?(0,K.jsxs)(K.Fragment,{children:[`Press `,_.keyName,` again to exit`]}):(0,K.jsxs)(l,{children:[(0,K.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,K.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,K.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var G,K,Me=e((()=>{n(),G=t(d(),1),I(),R(),H(),A(),m(),x(),S(),ce(),V(),v(),w(),B(),E(),j(),F(),z(),y(),C(),D(),se(),Oe(),W(),K=g()}));function Ne({server:e,serverToolsCount:t,onViewTools:n,onCancel:s,onComplete:u,borderless:ee=!1}){let[d]=a(),f=Ee(),te=me(e=>e.mcp),m=Te(),h=we(),[g,ne]=(0,q.useState)(!1),_=q.useCallback(async()=>{let t=e.client.type!==`disabled`;try{await h(e.name),s()}catch(n){u(`Failed to ${t?`disable`:`enable`} MCP server '${e.name}': ${ve(n)}`)}},[e.client.type,e.name,h,s,u]),v=Se(String(e.name)),y=re(te.commands,e.name).length,x=[];return e.client.type!==`disabled`&&t>0&&x.push({label:`View tools`,value:`tools`}),e.client.type!==`disabled`&&x.push({label:`Reconnect`,value:`reconnectMcpServer`}),x.push({label:e.client.type===`disabled`?`Enable`:`Disable`,value:`toggle-enabled`}),x.length===0&&x.push({label:`Back`,value:`back`}),g?(0,J.jsxs)(o,{flexDirection:`column`,gap:1,padding:1,children:[(0,J.jsxs)(c,{color:`text`,children:[`Reconnecting to `,(0,J.jsx)(c,{bold:!0,children:e.name})]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(T,{}),(0,J.jsx)(c,{children:` Restarting MCP server process`})]}),(0,J.jsx)(c,{dimColor:!0,children:`This may take a few moments.`})]}):(0,J.jsxs)(o,{flexDirection:`column`,children:[(0,J.jsxs)(o,{flexDirection:`column`,paddingX:1,borderStyle:ee?void 0:`round`,children:[(0,J.jsx)(o,{marginBottom:1,children:(0,J.jsxs)(c,{bold:!0,children:[v,` MCP Server`]})}),(0,J.jsxs)(o,{flexDirection:`column`,gap:0,children:[(0,J.jsxs)(o,{children:[(0,J.jsx)(c,{bold:!0,children:`Status: `}),e.client.type===`disabled`?(0,J.jsxs)(c,{children:[p(`inactive`,d)(r.radioOff),` disabled`]}):e.client.type===`connected`?(0,J.jsxs)(c,{children:[p(`success`,d)(r.tick),` connected`]}):e.client.type===`pending`?(0,J.jsxs)(J.Fragment,{children:[(0,J.jsx)(c,{dimColor:!0,children:r.radioOff}),(0,J.jsx)(c,{children:` connecting…`})]}):(0,J.jsxs)(c,{children:[p(`error`,d)(r.cross),` failed`]})]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(c,{bold:!0,children:`Command: `}),(0,J.jsx)(c,{dimColor:!0,children:e.config.command})]}),e.config.args&&e.config.args.length>0&&(0,J.jsxs)(o,{children:[(0,J.jsx)(c,{bold:!0,children:`Args: `}),(0,J.jsx)(c,{dimColor:!0,children:e.config.args.join(` `)})]}),(0,J.jsxs)(o,{children:[(0,J.jsx)(c,{bold:!0,children:`Config location: `}),(0,J.jsx)(c,{dimColor:!0,children:oe(b(e.name)?.scope??`dynamic`)})]}),e.client.type===`connected`&&(0,J.jsx)(De,{serverToolsCount:t,serverPromptsCount:y,serverResourcesCount:te.resources[e.name]?.length||0}),e.client.type===`connected`&&t>0&&(0,J.jsxs)(o,{children:[(0,J.jsx)(c,{bold:!0,children:`Tools: `}),(0,J.jsxs)(c,{dimColor:!0,children:[t,` tools`]})]})]}),x.length>0&&(0,J.jsx)(o,{marginTop:1,children:(0,J.jsx)(_e,{options:x,onChange:async t=>{if(t===`tools`)n();else if(t===`reconnectMcpServer`){ne(!0);try{let{message:t}=ke(await m(e.name),e.name);u?.(t)}catch(t){u?.(Ae(t,e.name))}finally{ne(!1)}}else t===`toggle-enabled`?await _():t===`back`&&s()},onCancel:s})})]}),(0,J.jsx)(o,{marginTop:1,children:(0,J.jsx)(c,{dimColor:!0,italic:!0,children:f.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,f.keyName,` again to exit`]}):(0,J.jsxs)(l,{children:[(0,J.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,J.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,J.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]})})})]})}var q,J,Y=e((()=>{n(),q=t(d(),1),H(),m(),_(),V(),v(),w(),j(),z(),y(),C(),D(),Oe(),W(),J=g()}));function Pe({tool:e,server:t,onBack:n}){let[r,i]=X.useState(``),a=P(e.name,t.name),s=M(e.userFacingName?e.userFacingName({}):a),l=e.isReadOnly?.({})??!1,u=e.isDestructive?.({})??!1,ee=e.isOpenWorld?.({})??!1;return X.useEffect(()=>{async function t(){try{let t=await e.description({},{isNonInteractiveSession:!1,toolPermissionContext:{mode:`default`,additionalWorkingDirectories:new Map,alwaysAllowRules:{},alwaysDenyRules:{},alwaysAskRules:{},isBypassPermissionsModeAvailable:!1},tools:[]});i(t)}catch{i(`Failed to load description`)}}t()},[e]),(0,Z.jsx)(h,{title:(0,Z.jsxs)(Z.Fragment,{children:[s,l&&(0,Z.jsx)(c,{color:`success`,children:` [read-only]`}),u&&(0,Z.jsx)(c,{color:`error`,children:` [destructive]`}),ee&&(0,Z.jsx)(c,{dimColor:!0,children:` [open-world]`})]}),subtitle:t.name,onCancel:n,inputGuide:e=>e.pending?(0,Z.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,Z.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`go back`}),children:(0,Z.jsxs)(o,{flexDirection:`column`,children:[(0,Z.jsxs)(o,{children:[(0,Z.jsx)(c,{bold:!0,children:`Tool name: `}),(0,Z.jsx)(c,{dimColor:!0,children:a})]}),(0,Z.jsxs)(o,{children:[(0,Z.jsx)(c,{bold:!0,children:`Full name: `}),(0,Z.jsx)(c,{dimColor:!0,children:e.name})]}),r&&(0,Z.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,Z.jsx)(c,{bold:!0,children:`Description:`}),(0,Z.jsx)(c,{wrap:`wrap`,children:r})]}),e.inputJSONSchema&&e.inputJSONSchema.properties&&Object.keys(e.inputJSONSchema.properties).length>0&&(0,Z.jsxs)(o,{flexDirection:`column`,marginTop:1,children:[(0,Z.jsx)(c,{bold:!0,children:`Parameters:`}),(0,Z.jsx)(o,{marginLeft:2,flexDirection:`column`,children:Object.entries(e.inputJSONSchema.properties).map(([t,n])=>{let r=(e.inputJSONSchema?.required)?.includes(t);return(0,Z.jsxs)(c,{children:[`• `,t,r&&(0,Z.jsx)(c,{dimColor:!0,children:` (required)`}),`:`,` `,(0,Z.jsx)(c,{dimColor:!0,children:typeof n==`object`&&n&&`type`in n?String(n.type):`unknown`}),typeof n==`object`&&n&&`description`in n&&(0,Z.jsxs)(c,{dimColor:!0,children:[` - `,String(n.description)]})]},t)})})]})]})})}var X,Z,Fe=e((()=>{X=t(d(),1),m(),N(),y(),Z=g()}));function Ie({server:e,onSelectTool:t,onBack:n}){let r=me(e=>e.mcp.tools),a=Le.useMemo(()=>e.client.type===`connected`?k(r,e.name):[],[e,r]),o=a.map((t,n)=>{let r=P(t.name,e.name),i=M(t.userFacingName?t.userFacingName({}):r),a=t.isReadOnly?.({})??!1,o=t.isDestructive?.({})??!1,s=t.isOpenWorld?.({})??!1,c=[];return a&&c.push(`read-only`),o&&c.push(`destructive`),s&&c.push(`open-world`),{label:i,value:n.toString(),description:c.length>0?c.join(`, `):void 0,descriptionColor:o?`error`:a?`success`:void 0}});return(0,Q.jsx)(h,{title:`Tools for ${e.name}`,subtitle:`${a.length} ${xe(a.length,`tool`)}`,onCancel:n,inputGuide:e=>e.pending?(0,Q.jsxs)(c,{children:[`Press `,e.keyName,` again to exit`]}):(0,Q.jsxs)(l,{children:[(0,Q.jsx)(i,{shortcut:`↑↓`,action:`navigate`}),(0,Q.jsx)(i,{shortcut:`Enter`,action:`select`}),(0,Q.jsx)(O,{action:`confirm:no`,context:`Confirmation`,fallback:`Esc`,description:`back`})]}),children:a.length===0?(0,Q.jsx)(c,{dimColor:!0,children:`No tools available`}):(0,Q.jsx)(_e,{options:o,onChange:e=>{let n=parseInt(e,10),r=a[n];r&&t(r,n)},onCancel:n})})}var Le,Q,Re=e((()=>{Le=t(d(),1),m(),N(),v(),w(),z(),y(),C(),Q=g()}));export{Ne as a,Me as c,Fe as i,Re as n,Y as o,Pe as r,je as s,Ie as t};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{I as n,Lt as r,P as i,fi as a,t as o}from"./src-CDCSSo0U2.js";import{t as s}from"./jsx-runtime-Bb4Xn-E0.js";import{BC as c,DC as l,EC as u,RC as d,hC as f}from"./loadAgentsDir-ByO8eJqU.js";function p({scope:e,parsingErrors:t,warnings:r}){let a=t.length>0,o=r.length>0;return!a&&!o?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,children:[(0,_.jsxs)(n,{children:[(a||o)&&(0,_.jsxs)(i,{color:a?`error`:`warning`,children:[`[`,a?`Failed to parse`:`Contains warnings`,`] `]}),(0,_.jsx)(i,{children:u(e)})]}),(0,_.jsxs)(n,{children:[(0,_.jsx)(i,{dimColor:!0,children:`Location: `}),(0,_.jsx)(i,{dimColor:!0,children:f(e)})]}),(0,_.jsxs)(n,{marginLeft:1,flexDirection:`column`,children:[t.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`error`,children:`[Error]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`error-${t}`)}),r.map((e,t)=>{let r=e.mcpErrorMetadata?.serverName;return(0,_.jsx)(n,{children:(0,_.jsxs)(i,{children:[(0,_.jsx)(i,{dimColor:!0,children:`└ `}),(0,_.jsx)(i,{color:`warning`,children:`[Warning]`}),(0,_.jsxs)(i,{dimColor:!0,children:[` `,r&&`[${r}] `,e.path&&e.path!==``?`${e.path}: `:``,e.message]})]})},`warning-${t}`)})]})]})}function m(){let e=(0,g.useMemo)(()=>[{scope:`user`,config:d(`user`)},{scope:`project`,config:d(`project`)},{scope:`local`,config:d(`local`)},{scope:`enterprise`,config:d(`enterprise`)}],[]),t=e.some(({config:e})=>h(e.errors,`fatal`).length>0),a=e.some(({config:e})=>h(e.errors,`warning`).length>0);return!t&&!a?null:(0,_.jsxs)(n,{flexDirection:`column`,marginTop:1,marginBottom:1,children:[(0,_.jsx)(i,{bold:!0,children:`MCP Config Diagnostics`}),(0,_.jsx)(n,{marginTop:1,children:(0,_.jsxs)(i,{dimColor:!0,children:[`For help configuring MCP servers, see:`,` `,(0,_.jsx)(r,{url:`https://code.claude.com/docs/en/mcp`,children:`https://code.claude.com/docs/en/mcp`})]})}),e.map(({scope:e,config:t})=>(0,_.jsx)(p,{scope:e,parsingErrors:h(t.errors,`fatal`),warnings:h(t.errors,`warning`)},e))]})}function h(e,t){return e.filter(e=>e.mcpErrorMetadata?.severity===t)}var g,_,v=e((()=>{g=t(a(),1),c(),l(),o(),_=s()}));export{v as n,m as t};
@@ -1,3 +0,0 @@
1
- import{n as e,o as t,r as n}from"./rolldown-runtime-DaDcL9Zw.js";import{n as r,t as i}from"./figures-5ThXQEtq.js";import{C as a,Gt as o,I as s,P as c,Wt as l,fi as u,ot as d,t as f}from"./src-CDCSSo0U2.js";import{t as p}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as m,er as h,ft as g,mt as _}from"./state-C2OSZkV1.js";import{Bp as v,Bs as y,Fx as b,La as x,Pa as S,Pw as C,Px as w,Qp as T,Ua as E,Us as D,Vs as O,_v as k,_w as A,al as j,cy as ee,dp as te,em as ne,eo as M,hn as re,hw as N,il as ie,io as P,no as ae,ny as oe,on as F,oo as I,pp as L,rl as se,ry as ce,sl as R,ty as le,vv as ue,vw as z,xo as de,xw as fe,yn as pe,za as B,zp as me}from"./loadAgentsDir-ByO8eJqU.js";import{n as he,t as V}from"./cwd-C5ce-7WB.js";import{In as H,Ln as ge,Q as _e,Y as ve,f as ye,g as be}from"./settings-hQDLwPVj.js";import{J as xe,h as Se,m as Ce,o as we,s as U,w as Te}from"./log-CZ0zYP_c.js";import{n as W,r as G}from"./analytics-CkYUHW_U.js";import{h as Ee,x as De,y as Oe}from"./startupProfiler-DCn_NxMH.js";import{Bt as ke,St as Ae,Y as je,et as Me}from"./model-CwO-g1RW.js";import{E as Ne,T as Pe,c as Fe,d as Ie,w as Le}from"./sessionTracing-CwsXt_uA.js";import{n as Re,t as ze}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import*as K from"path";import{randomUUID as q}from"crypto";u();var J=p();r(),f(),m(),he(),xe(),Ce(),we(),ge(),W(),Oe(),_e(),be(),ke(),A(),w(),Le(),T(),Fe(),j(),se(),D(),de(),M(),pe();function Be(e){let t=e.toLowerCase();return/\b(wtf|wth|ffs|omfg|shit(ty|tiest)?|dumbass|horrible|awful|piss(ed|ing)? off|piece of (shit|crap|junk)|what the (fuck|hell)|fucking? (broken|useless|terrible|awful|horrible)|fuck you|screw (this|you)|so frustrating|this sucks|damn it)\b/.test(t)}function Ve(e){let t=e.toLowerCase().trim();return t===`continue`||/\b(keep going|go on)\b/.test(t)}function He(e,t,n,r,i,a,o){let s=q();h(s);let c=typeof e==`string`?e:e.find(e=>e.type===`text`)?.text||``;Ie(c);let l=typeof e==`string`?e:e.findLast(e=>e.type===`text`)?.text||``;return l&&Pe(`user_prompt`,{prompt_length:String(l.length),prompt:Ne(l),"prompt.id":s}),G(`tengu_input_prompt`,{is_negative:Be(c),is_keep_going:Ve(c)}),t.length>0?{messages:[x({content:[...typeof e==`string`?e.trim()?[{type:`text`,text:e}]:[]:e,...t],uuid:i,imagePasteIds:n.length>0?n:void 0,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}:{messages:[x({content:e,uuid:i,permissionMode:a,isMeta:o||void 0}),...r],shouldQuery:!0}}W(),M();async function Ue({input:e,preExpansionInput:t,mode:n,setToolJSX:r,context:i,pastedContents:a,ideSelection:o,messages:s,setUserInputOnProcessing:c,uuid:l,isAlreadyProcessing:u,querySource:d,canUseTool:f,skipSlashCommands:p,bridgeOrigin:m,isMeta:h,skipAttachments:g,autonomy:_}){let v=typeof e==`string`?e:null,b=v?.startsWith(`/`)&&!p;n===`prompt`&&v!==null&&!h&&!b&&c?.(v),R(`query_process_user_input_base_start`);let C=i.getAppState(),w=await Ge(e,n,r,i,a,o,s,l,u,d,f,C.toolPermissionContext.mode,p,m,h,g,t,_);if(R(`query_process_user_input_base_end`),!w.shouldQuery)return w;R(`query_hooks_start`);let T=E(e)||``;for await(let t of F(T,C.toolPermissionContext.mode,i,i.requestPrompt))if(t.message?.type!==`progress`){if(t.blockingError)return{messages:[S(`${re(t.blockingError)}\n\nOriginal prompt: ${e}`,`warning`)],shouldQuery:!1,allowedTools:w.allowedTools};if(t.preventContinuation){let e=t.stopReason?`Operation stopped by hook: ${t.stopReason}`:`Operation stopped by hook`;return w.messages.push(x({content:e})),w.shouldQuery=!1,w}if(t.additionalContexts&&t.additionalContexts.length>0&&w.messages.push(y({type:`hook_additional_context`,content:t.additionalContexts.map(We),hookName:`UserPromptSubmit`,toolUseID:`hook-${q()}`,hookEvent:`UserPromptSubmit`})),t.message)switch(t.message.attachment.type){case`hook_success`:if(!t.message.attachment.content)break;w.messages.push({...t.message,attachment:{...t.message.attachment,content:We(t.message.attachment.content)}});break;default:w.messages.push(t.message);break}}return R(`query_hooks_end`),w}var Y=1e4;function We(e){return e.length>Y?`${e.substring(0,Y)}… [output truncated - exceeded ${Y} characters]`:e}async function Ge(e,t,n,r,i,a,o,s,c,l,u,d,f,p,m,h,g,_){let v=null,y=[],x=[],S=e;if(typeof e==`string`)v=e;else if(e.length>0){R(`query_image_processing_start`);let t=[];for(let n of e)if(n.type===`image`){let e=await z(n);if(e.dimensions){let t=N(e.dimensions);t&&x.push(t)}t.push(e.block)}else t.push(n);S=t,R(`query_image_processing_end`);let n=t[t.length-1];n?.type===`text`?(v=n.text,y=t.slice(0,-1)):y=t}if(v===null&&t!==`prompt`)throw Error(`Mode: ${t} requires a string input.`);let C=i?Object.values(i).filter(b):[],w=C.map(e=>e.id),T=i?await ne(i):new Map;R(`query_pasted_image_processing_start`);let E=await Promise.all(C.map(async e=>{let t={type:`image`,source:{type:`base64`,media_type:e.mediaType||`image/png`,data:e.content}};return G(`tengu_pasted_image_resize_attempt`,{original_size_bytes:e.content.length}),{resized:await z(t),originalDimensions:e.dimensions,sourcePath:e.sourcePath??T.get(e.id)}})),D=[];for(let{resized:e,originalDimensions:t,sourcePath:n}of E){if(e.dimensions){let t=N(e.dimensions,n);t&&x.push(t)}else if(t){let e=N(t,n);e&&x.push(e)}else n&&x.push(`[Image source: ${n}]`);D.push(e.block)}R(`query_pasted_image_processing_end`);let k=f,A=!h&&v!==null&&(t!==`prompt`||k||!v.startsWith(`/`));R(`query_attachment_loading_start`);let j=A?await ie(O(v,r,a??null,[],o,l)):[];if(R(`query_attachment_loading_end`),v!==null&&t===`bash`){let{processBashCommand:e}=await import(`./processBashCommand-Cze9vCm6.js`);return X(await e(v,y,j,r,n),x)}if(v!==null&&!k&&v.startsWith(`/`)){let{processSlashCommand:e}=await import(`./processSlashCommand-BRajh1v7.js`);return X(await e(v,y,D,j,r,n,s,c,u,_),x)}if(v!==null&&t===`prompt`){let e=v.trim(),t=j.find(e=>e.attachment.type===`agent_mention`);if(t){let n=`@agent-${t.attachment.agentType}`,r=e===n;G(`tengu_subagent_at_mention`,{is_subagent_only:r,is_prefix:e.startsWith(n)&&!r})}}return X(He(S,D,w,j,s,d,m),x)}function X(e,t){return t.length>0&&e.messages.push(x({content:t.map(e=>({type:`text`,text:e})),isMeta:!0})),e}m(),Me();function Ke(e){return e===`Agent`?ve:e}function qe(e){let t=ye()?.outputStyle??`default`,n={type:`system`,subtype:`init`,cwd:V(),session_id:_(),tools:e.tools.map(e=>Ke(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:Ae().source,betas:g(),claude_code_version:`0.0.8`,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:q()};return n.fast_mode_state=je(e.model,e.fastMode),n}var Je=n({MessageSelector:()=>Xe,messagesAfterAreOnlySynthetic:()=>it,selectableUserMessagesFilter:()=>rt});function Ye(e){return e.type===`text`}function Z(e){return e===`summarize`||e===`summarize_up_to`}function Xe({messages:e,onPreRestore:t,onRestoreMessage:n,onRestoreCode:r,onSummarize:u,onClose:d,preselectedMessage:f}){let p=ue(e=>e.fileHistory),[m,h]=(0,Q.useState)(void 0),g=oe(),_=(0,Q.useMemo)(q,[]),v=(0,Q.useMemo)(()=>[...e.filter(rt),{...x({content:``}),uuid:_}],[e,_]),[y,b]=(0,Q.useState)(v.length-1),S=Math.max(0,Math.min(y-Math.floor($/2),v.length-$)),C=v.length>1,[w,T]=(0,Q.useState)(f),[E,D]=(0,Q.useState)(void 0);(0,Q.useEffect)(()=>{if(!f||!g)return;let e=!1;return ce(p,f.uuid).then(t=>{e||D(t)}),()=>{e=!0}},[f,g,p]);let[O,k]=(0,Q.useState)(!1),[A,j]=(0,Q.useState)(null),[ee,ne]=(0,Q.useState)(`both`),[M,re]=(0,Q.useState)(``),[N,ie]=(0,Q.useState)(``);function P(e){let t=e?[{value:`both`,label:`Restore code and conversation`},{value:`conversation`,label:`Restore conversation`},{value:`code`,label:`Restore code`}]:[{value:`conversation`,label:`Restore conversation`}],n={type:`input`,placeholder:`add context (optional)`,initialValue:``,allowEmptySubmitToCancel:!0,showLabelWithValue:!0,labelValueSeparator:`: `};return t.push({value:`summarize`,label:`Summarize from here`,...n,onChange:re}),process.env.USER_TYPE===`ant`&&t.push({value:`summarize_up_to`,label:`Summarize up to here`,...n,onChange:ie}),t.push({value:`nevermind`,label:`Never mind`}),t}(0,Q.useEffect)(()=>{G(`tengu_message_selector_opened`,{})},[]);async function ae(e){t(),k(!0);try{await n(e),k(!1),d()}catch(e){U(e),k(!1),h(`Failed to restore the conversation:\n${e}`)}}async function F(t){let n=e.indexOf(t);if(G(`tengu_message_selector_selected`,{index_from_end:e.length-1-n,message_type:t.type,is_current_prompt:!1}),!e.includes(t)){d();return}if(!g){await ae(t);return}let r=await ce(p,t.uuid);T(t),D(r)}async function I(e){if(G(`tengu_message_selector_restore_option_selected`,{option:e}),!w){h(`Message not found.`);return}if(e===`nevermind`){f?d():T(void 0);return}if(Z(e)){t(),k(!0),j(e),h(void 0);try{let t=e===`summarize_up_to`?`up_to`:`from`,n=(t===`up_to`?N:M).trim()||void 0;await u(w,n,t),k(!1),j(null),T(void 0),d()}catch(e){U(e),k(!1),j(null),T(void 0),h(`Failed to summarize:\n${e}`)}return}t(),k(!0),h(void 0);let i=null,a=null;if(e===`code`||e===`both`)try{await r(w)}catch(e){i=e,U(i)}if(e===`conversation`||e===`both`)try{await n(w)}catch(e){a=e,U(a)}k(!1),T(void 0),a&&i?h(`Failed to restore the conversation and code:\n${a}\n${i}`):a?h(`Failed to restore the conversation:\n${a}`):i?h(`Failed to restore the code:\n${i}`):d()}let L=Re(),se=(0,Q.useCallback)(()=>{if(w&&!f){T(void 0);return}G(`tengu_message_selector_cancelled`,{}),d()},[d,w,f]),R=(0,Q.useCallback)(()=>b(e=>Math.max(0,e-1)),[]),z=(0,Q.useCallback)(()=>b(e=>Math.min(v.length-1,e+1)),[v.length]),de=(0,Q.useCallback)(()=>b(0),[]),fe=(0,Q.useCallback)(()=>b(v.length-1),[v.length]),pe=(0,Q.useCallback)(()=>{let e=v[y];e&&F(e)},[v,y,F]);l(`confirm:no`,se,{context:`Confirmation`,isActive:!w}),o({"messageSelector:up":R,"messageSelector:down":z,"messageSelector:top":de,"messageSelector:bottom":fe,"messageSelector:select":pe},{context:`MessageSelector`,isActive:!O&&!m&&!w&&C});let[B,he]=(0,Q.useState)({});(0,Q.useEffect)(()=>{async function t(){g&&Promise.all(v.map(async(t,n)=>{if(t.uuid!==_){let r=le(p,t.uuid),i=v.at(n+1),a=r?nt(e,t.uuid,i?.uuid===_?void 0:i?.uuid):void 0;he(a===void 0?e=>({...e,[n]:void 0}):e=>({...e,[n]:a}))}}))}t()},[v,e,_,p,g]);let V=g&&E?.filesChanged&&E.filesChanged.length>0,H=!m&&!w&&!f&&C;return(0,J.jsxs)(s,{flexDirection:`column`,width:`100%`,children:[(0,J.jsx)(a,{color:`suggestion`}),(0,J.jsxs)(s,{flexDirection:`column`,marginX:1,gap:1,children:[(0,J.jsx)(c,{bold:!0,color:`suggestion`,children:`Rewind`}),m&&(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(c,{color:`error`,children:[`Error: `,m]})}),!C&&(0,J.jsx)(J.Fragment,{children:(0,J.jsx)(c,{children:`Nothing to rewind to yet.`})}),!m&&w&&C&&(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(c,{children:[`Confirm you want to restore `,!E&&`the conversation `,`to the point before you sent this message:`]}),(0,J.jsxs)(s,{flexDirection:`column`,paddingLeft:1,borderStyle:`single`,borderRight:!1,borderTop:!1,borderBottom:!1,borderLeft:!0,borderLeftDimColor:!0,children:[(0,J.jsx)(tt,{userMessage:w,color:`text`,isCurrent:!1}),(0,J.jsxs)(c,{dimColor:!0,children:[`(`,Ee(new Date(w.timestamp)),`)`]})]}),(0,J.jsx)(Qe,{selectedRestoreOption:ee,canRestoreCode:!!V,diffStatsForRestore:E}),O&&Z(A)?(0,J.jsxs)(s,{flexDirection:`row`,gap:1,children:[(0,J.jsx)(te,{}),(0,J.jsx)(c,{children:`Summarizing…`})]}):(0,J.jsx)(me,{isDisabled:O,options:P(!!V),defaultFocusValue:V?`both`:`conversation`,onFocus:e=>ne(e),onChange:e=>I(e),onCancel:()=>f?d():T(void 0)}),V&&(0,J.jsx)(s,{marginBottom:1,children:(0,J.jsxs)(c,{dimColor:!0,children:[i.warning,` Rewinding does not affect files edited manually or via bash.`]})})]}),H&&(0,J.jsxs)(J.Fragment,{children:[g?(0,J.jsx)(c,{children:`Restore the code and/or conversation to the point before…`}):(0,J.jsx)(c,{children:`Restore and fork the conversation to the point before…`}),(0,J.jsx)(s,{width:`100%`,flexDirection:`column`,children:v.slice(S,S+$).map((e,t)=>{let n=S+t,r=n===y,a=e.uuid===_,o=n in B,l=B[n],u=l?.filesChanged&&l.filesChanged.length;return(0,J.jsxs)(s,{height:g?3:2,overflow:`hidden`,width:`100%`,flexDirection:`row`,children:[(0,J.jsx)(s,{width:2,minWidth:2,children:r?(0,J.jsxs)(c,{color:`permission`,bold:!0,children:[i.pointer,` `]}):(0,J.jsx)(c,{children:` `})}),(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsx)(s,{flexShrink:1,height:1,overflow:`hidden`,children:(0,J.jsx)(tt,{userMessage:e,color:r?`suggestion`:void 0,isCurrent:a,paddingRight:10})}),g&&o&&(0,J.jsx)(s,{height:1,flexDirection:`row`,children:l?(0,J.jsx)(J.Fragment,{children:(0,J.jsx)(c,{dimColor:!r,color:`inactive`,children:u?(0,J.jsxs)(J.Fragment,{children:[u===1&&l.filesChanged[0]?`${K.basename(l.filesChanged[0])} `:`${u} files changed `,(0,J.jsx)(et,{diffStats:l})]}):(0,J.jsx)(J.Fragment,{children:`No code changes`})})}):(0,J.jsxs)(c,{dimColor:!0,color:`warning`,children:[i.warning,` No code restore`]})})]})]},e.uuid)})})]}),!w&&(0,J.jsx)(c,{dimColor:!0,italic:!0,children:L.pending?(0,J.jsxs)(J.Fragment,{children:[`Press `,L.keyName,` again to exit`]}):(0,J.jsxs)(J.Fragment,{children:[!m&&C&&`Enter to continue · `,`Esc to exit`]})})]})]})}function Ze(e){switch(e){case`summarize`:return`Messages after this point will be summarized.`;case`summarize_up_to`:return`Preceding messages will be summarized. This and subsequent messages will remain unchanged — you will stay at the end of the conversation.`;case`both`:case`conversation`:return`The conversation will be forked.`;case`code`:case`nevermind`:return`The conversation will be unchanged.`}}function Qe({selectedRestoreOption:e,canRestoreCode:t,diffStatsForRestore:n}){let r=t&&(e===`both`||e===`code`);return(0,J.jsxs)(s,{flexDirection:`column`,children:[(0,J.jsx)(c,{dimColor:!0,children:Ze(e)}),!Z(e)&&(r?(0,J.jsx)($e,{diffStatsForRestore:n}):(0,J.jsx)(c,{dimColor:!0,children:`The code will be unchanged.`}))]})}function $e({diffStatsForRestore:e}){if(e===void 0)return;if(!e.filesChanged||!e.filesChanged[0])return(0,J.jsx)(c,{dimColor:!0,children:`The code has not changed (nothing will be restored).`});let t=e.filesChanged.length,n=``;return n=t===1?K.basename(e.filesChanged[0]||``):t===2?`${K.basename(e.filesChanged[0]||``)} and ${K.basename(e.filesChanged[1]||``)}`:`${K.basename(e.filesChanged[0]||``)} and ${e.filesChanged.length-1} other files`,(0,J.jsx)(J.Fragment,{children:(0,J.jsxs)(c,{dimColor:!0,children:[`The code will be restored `,(0,J.jsx)(et,{diffStats:e}),` in `,n,`.`]})})}function et({diffStats:e}){if(!(!e||!e.filesChanged))return(0,J.jsxs)(J.Fragment,{children:[(0,J.jsxs)(c,{color:`diffAddedWord`,children:[`+`,e.insertions,` `]}),(0,J.jsxs)(c,{color:`diffRemovedWord`,children:[`-`,e.deletions]})]})}function tt({userMessage:e,color:t,dimColor:n,isCurrent:r,paddingRight:i}){let{columns:a}=d();if(r)return(0,J.jsx)(s,{width:`100%`,children:(0,J.jsx)(c,{italic:!0,color:t,dimColor:n,children:`(current)`})});let o=e.message.content,l=typeof o==`string`?null:o[o.length-1],u=Se(typeof o==`string`?o.trim():l&&Ye(l)?l.text.trim():`(no prompt)`);if(ae(u))return(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(c,{italic:!0,color:t,dimColor:n,children:`((empty message))`})});if(u.includes(`<bash-input>`)){let e=B(u,`bash-input`);if(e)return(0,J.jsxs)(s,{flexDirection:`row`,width:`100%`,children:[(0,J.jsx)(c,{color:`bashBorder`,children:`!`}),(0,J.jsxs)(c,{color:t,dimColor:n,children:[` `,e]})]})}if(u.includes(`<command-message>`)){let e=B(u,Te),r=B(u,`command-args`),i=B(u,`skill-format`)===`true`;if(e)return i?(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(c,{color:t,dimColor:n,children:[`Skill(`,e,`)`]})}):(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsxs)(c,{color:t,dimColor:n,children:[`/`,e,` `,r]})})}return(0,J.jsx)(s,{flexDirection:`row`,width:`100%`,children:(0,J.jsx)(c,{color:t,dimColor:n,children:i?De(u,a-i,!0):u.slice(0,500).split(`
2
- `).slice(0,4).join(`
3
- `)})})}function nt(e,t,n){let r=e.findIndex(e=>e.uuid===t);if(r===-1)return;let i=n?e.findIndex(e=>e.uuid===n):e.length;i===-1&&(i=e.length);let a=[],o=0,s=0;for(let t=r+1;t<i;t++){let n=e[t];if(!n||!I(n))continue;let r=n.toolUseResult;if(!(!r||!r.filePath||!r.structuredPatch)){a.includes(r.filePath)||a.push(r.filePath);try{if(`type`in r&&r.type===`create`)o+=r.content.split(/\r?\n/).length;else for(let e of r.structuredPatch){let t=H(e.lines,e=>e.startsWith(`+`)),n=H(e.lines,e=>e.startsWith(`-`));o+=t,s+=n}}catch{}}}return{filesChanged:a,insertions:o,deletions:s}}function rt(e){if(e.type!==`user`||Array.isArray(e.message.content)&&e.message.content[0]?.type===`tool_result`||P(e)||e.isMeta||e.isCompactSummary||e.isVisibleInTranscriptOnly)return!1;let t=e.message.content,n=typeof t==`string`?null:t[t.length-1],r=typeof t==`string`?t.trim():n&&Ye(n)?n.text.trim():``;return!(r.indexOf(`<local-command-stdout>`)!==-1||r.indexOf(`<local-command-stderr>`)!==-1||r.indexOf(`<bash-stdout>`)!==-1||r.indexOf(`<bash-stderr>`)!==-1||r.indexOf(`<task-notification>`)!==-1||r.indexOf(`<tick>`)!==-1)}function it(e,t){for(let n=t+1;n<e.length;n++){let t=e[n];if(t&&!P(t)&&!I(t)&&t.type!==`progress`&&t.type!==`system`&&t.type!==`attachment`&&!(t.type===`user`&&t.isMeta)){if(t.type===`assistant`){let e=t.message.content;if(Array.isArray(e)&&e.some(e=>e.type===`text`&&e.text.trim()||e.type===`tool_use`))return!1;continue}if(t.type===`user`)return!1}}return!0}var Q,$,at=e((()=>{Q=t(u(),1),W(),k(),ee(),ze(),C(),M(),v(),L(),fe(),$=7}));export{rt as a,Ue as c,it as i,Je as n,qe as o,at as r,Ke as s,Xe as t};
@@ -1,11 +0,0 @@
1
- import{a as e,n as t,o as n}from"./rolldown-runtime-DaDcL9Zw.js";import{l as r,o as i}from"./envUtils-DSxRz_kt.js";import{n as a,t as o}from"./figures-5ThXQEtq.js";import{C as s,Gr as c,I as l,N as u,P as d,Pn as f,Rn as p,di as m,fi as h,j as g,mt as _,ot as v,t as y,ui as b,xt as x}from"./src-CDCSSo0U2.js";import{t as S}from"./jsx-runtime-Bb4Xn-E0.js";import{$t as C,B as w}from"./state-C2OSZkV1.js";import{$a as T,$u as E,Aw as D,Ax as O,Bu as k,Ca as ee,Ew as te,Fw as ne,Ga as re,Hd as ie,Hu as ae,Hx as A,Iw as j,Ja as M,Ka as N,Ku as oe,Mw as se,Ow as ce,Qu as le,Ra as ue,Rx as P,SE as F,Sp as de,TE as I,Vd as fe,Vu as pe,Vx as me,Wx as he,Xd as ge,Xu as _e,Ya as ve,Yd as ye,Yu as be,Zu as xe,__ as L,_a as Se,_v as Ce,bp as we,co as Te,do as Ee,dv as De,ed as Oe,eo as R,fo as ke,fw as Ae,g_ as z,ga as je,gh as Me,ha as Ne,hh as Pe,jw as Fe,ka as Ie,kw as Le,kx as Re,mo as ze,mw as Be,pw as Ve,qa as He,ro as Ue,uv as We,vv as Ge,vy as Ke,wa as qe,xp as Je,xw as Ye,za as Xe}from"./loadAgentsDir-ByO8eJqU.js";import{n as Ze,t as Qe}from"./cwd-C5ce-7WB.js";import{a as $e,l as et,o as tt,r as nt,s as rt}from"./debug-RZ4NuXyS.js";import{Cn as it,Ut as at,Vt as ot,bn as st,g as ct,n as lt}from"./settings-hQDLwPVj.js";import{b as ut,c as dt,g as ft}from"./config-CE058cvr.js";import{B as pt,J as mt,L as ht,R as gt}from"./log-CZ0zYP_c.js";import{h as _t,n as vt,p as yt,r as bt,t as xt,x as St,y as Ct}from"./startupProfiler-DCn_NxMH.js";import{l as wt,o as Tt}from"./stringUtils-B6FudhoZ.js";import{Bt as Et,Dt,E as Ot,Gt as kt,St as At,Tt as jt,_ as Mt,_n as Nt,b as Pt,vn as Ft}from"./model-CwO-g1RW.js";import{xn as It,yn as Lt}from"./prompt-B7joRiqj.js";import{C as Rt,D as zt}from"./sessionState-CjNY991n.js";import{d as Bt,f as Vt,h as Ht,p as Ut}from"./terminalSetup-DlaFWI81.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-CGUJ-5gY.js";import{n as $t,t as en}from"./systemTheme-Ceakddth.js";import{n as tn,r as nn}from"./PromptInputFooterSuggestions-D1cH9sDX.js";import{n as rn,t as an}from"./useMainLoopModel-BICP6_Fi.js";import{n as on,t as sn}from"./modalContext-DFjKLCB6.js";import{n as cn,r as ln,t as un}from"./statusNoticeHelpers-B5U5c9PE.js";import{homedir as dn}from"os";import{relative as fn}from"path";import{fileURLToPath as pn}from"url";function mn(e){return Array.isArray?Array.isArray(e):Sn(e)===`[object Array]`}function hn(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function gn(e){return e==null?``:hn(e)}function B(e){return typeof e==`string`}function _n(e){return typeof e==`number`}function vn(e){return e===!0||e===!1||bn(e)&&Sn(e)==`[object Boolean]`}function yn(e){return typeof e==`object`}function bn(e){return yn(e)&&e!==null}function V(e){return e!=null}function xn(e){return!e.trim().length}function Sn(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}function Cn(e){let t=null,n=null,r=null,i=1,a=null;if(B(e)||mn(e))r=e,t=wn(e),n=Tn(e);else{if(!sr.call(e,`name`))throw Error(ir(`name`));let o=e.name;if(r=o,sr.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(ar(Tn(o)));t=wn(o),n=Tn(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function wn(e){return mn(e)?e:e.split(`.`)}function Tn(e){return mn(e)?e.join(`.`):e}function En(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(V(e))if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!V(s))return;if(a===t.length-1&&(B(s)||_n(s)||vn(s)||typeof s==`bigint`))n.push(o===void 0?gn(s):{v:gn(s),i:o});else if(mn(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}};return i(e,B(t)?t.split(`.`):t,0),r?n:n[0]}function Dn(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=1,a=!1;for(let e=0;e<t.length;e++)t.charCodeAt(e)===32?a||(i++,a=!0):a=!1;if(n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}function On(e,t,{getFn:n=H.getFn,fieldNormWeight:r=H.fieldNormWeight}={}){let i=new pr({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(Cn)),i.setSources(t),i.create(),i}function kn(e,{getFn:t=H.getFn,fieldNormWeight:n=H.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new pr({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function An(e=[],t=H.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function jn(e,t,n,{location:r=H.location,distance:i=H.distance,threshold:a=H.threshold,findAllMatches:o=H.findAllMatches,minMatchCharLength:s=H.minMatchCharLength,includeMatches:c=H.includeMatches,ignoreLocation:l=H.ignoreLocation}={}){if(t.length>32)throw Error(rr(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=An(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function Mn(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function Nn(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}function Pn(e){return e.startsWith(`inverse`)}function Fn(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function In(e,t){let n=e.match(t);return n?n[1]:null}function Ln(e,t={}){return e.replace(/\\\|/g,xr).split(Sr).map(e=>{let n=Fn(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<br;){let e=yr[o],n=In(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<br;){let e=yr[o],n=In(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}function Rn(...e){wr.push(...e)}function zn(e,t){for(let n=0,r=wr.length;n<r;n+=1){let r=wr[n];if(r.condition(e,t))return new r(e,t)}return new _r(e,t)}function Bn(e,t,{auto:n=!0}={}){let r=e=>{if(B(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=zn(e,t)),r}let i=Object.keys(e),a=Or(e);if(!a&&i.length>1&&!Dr(e))return r(Ar(e));if(kr(e)){let r=a?e[Er.PATH]:i[0],o=a?e[Er.PATTERN]:e[r];if(!B(o))throw Error(nr(r));let s={keyId:Tn(r),pattern:o};return n&&(s.searcher=zn(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];mn(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return Dr(e)||(e=Ar(e)),r(e)}function Vn(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function Hn(e,{ignoreFieldNorm:t=H.ignoreFieldNorm}){e.forEach(e=>{e.score=Vn(e.matches,{ignoreFieldNorm:t})})}function Un(e){let t=[];return e.matches.forEach(e=>{if(!V(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function Wn(e,t,{includeMatches:n=H.includeMatches,includeScore:r=H.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=Un(e)),r&&(a.score=e.score),a})}function Gn(e){Nr.has(e)||(Nr.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function Kn(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||Gn(e),t=>t.match(e)||[]):e=>e.match(Mr)||[]}function qn({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=Kn(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=gr(n)),r(n)}}}function Jn(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function Yn(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){Jn(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n)if(Array.isArray(n))for(let t of n)Jn(e,t.v,i,r);else Jn(e,n.v,i,r)}}function Xn(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)Yn(r,i,t,n);return r}function Zn(e,t,n,r){Yn(e,t,n,r)}function Qn(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function $n(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)Qn(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var er,tr,nr,rr,ir,ar,or,sr,cr,lr,ur,dr,fr,H,pr,mr,hr,gr,_r,vr,yr,br,xr,Sr,Cr,wr,Tr,Er,Dr,Or,kr,Ar,jr,Mr,Nr,Pr,Fr,Ir,Lr=t((()=>{er=`Incorrect 'index' type`,tr=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,nr=e=>`Invalid value for key ${e}`,rr=e=>`Pattern length exceeds max of ${e}.`,ir=e=>`Missing ${e} property in key`,ar=e=>`Property 'weight' in key '${e}' must be a positive integer`,or=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,sr=Object.prototype.hasOwnProperty,cr=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=Cn(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}},lr={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},ur={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},dr={location:0,threshold:.6,distance:100},fr={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:En,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},H=Object.freeze({...ur,...lr,...dr,...fr}),pr=class{constructor({getFn:e=H.getFn,fieldNormWeight:t=H.fieldNormWeight}={}){this.norm=Dn(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(B(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(tr);if(B(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(tr);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!V(e)||xn(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(V(i)){if(mn(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(V(n)){if(B(n)){if(!xn(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(V(n.v)){let t=B(n.v)?n.v:gn(n.v);if(!xn(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(B(i)&&!xn(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}},mr={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},hr=RegExp(`[`+Object.keys(mr).join(``)+`]`,`g`),gr=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(hr,e=>mr[e]):e=>e,_r=class{constructor(e,{location:t=H.location,threshold:n=H.threshold,distance:r=H.distance,includeMatches:i=H.includeMatches,findAllMatches:a=H.findAllMatches,minMatchCharLength:o=H.minMatchCharLength,isCaseSensitive:s=H.isCaseSensitive,ignoreDiacritics:c=H.ignoreDiacritics,ignoreLocation:l=H.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?gr(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:Mn(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?gr(e):e,this.pattern===e){let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=jn(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=Nn(u)),p}},vr=new Set([`fuzzy`,`include`]),yr=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new _r(e,{location:t.location??H.location,threshold:t.threshold??H.threshold,distance:t.distance??H.distance,includeMatches:t.includeMatches??H.includeMatches,findAllMatches:t.findAllMatches??H.findAllMatches,minMatchCharLength:t.minMatchCharLength??H.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??H.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??H.ignoreDiacritics,ignoreLocation:t.ignoreLocation??H.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],br=yr.length,xr=`\0`,Sr=`|`,Cr=class{constructor(e,{isCaseSensitive:t=H.isCaseSensitive,ignoreDiacritics:n=H.ignoreDiacritics,includeMatches:r=H.includeMatches,minMatchCharLength:i=H.minMatchCharLength,ignoreLocation:a=H.ignoreLocation,findAllMatches:o=H.findAllMatches,location:s=H.location,threshold:c=H.threshold,distance:l=H.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?gr(e):e,this.pattern=e,this.query=Ln(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?gr(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,Pn(r.type)&&(c=!0),n&&(vr.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=Nn(o)),e}}return{isMatch:!1,score:1}}},wr=[],Tr={AND:`$and`,OR:`$or`},Er={PATH:`$path`,PATTERN:`$val`},Dr=e=>!!(e[Tr.AND]||e[Tr.OR]),Or=e=>!!e[Er.PATH],kr=e=>!mn(e)&&yn(e)&&!Dr(e),Ar=e=>({[Tr.AND]:Object.keys(e).map(t=>({[t]:e[t]}))}),jr=class{constructor(e){this.limit=e,this.heap=[]}get size(){return this.heap.length}shouldInsert(e){return this.size<this.limit||e<this.heap[0].score}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):e.score<this.heap[0].score&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(e){return this.heap.sort(e)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(t[e].score<=t[n].score)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&t[i].score>t[r].score&&(r=i),a<n&&t[a].score>t[r].score&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}},Mr=/[\p{L}\p{M}\p{N}_]+/gu,Nr=new WeakSet,Pr=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=qn({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new _r(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=Nn(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}},Fr=class{constructor(e,t,n){this.options={...H,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new cr(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=zn(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof pr))throw Error(er);if(this._myIndex=t||On(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=qn({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=Xn(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!V(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=qn({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});Zn(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&$n(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(tr);this._invertedIndex&&$n(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(B(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return _n(n)&&n>-1&&(e=e.slice(0,n)),e}let c=_n(n)&&n>0&&B(e),l;if(c){let t=new jr(n);B(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),l=t.extractSorted(o)}else l=B(e)?B(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),Hn(l,{ignoreFieldNorm:s}),a&&l.sort(o),_n(n)&&n>-1&&(l=l.slice(0,n));return Wn(l,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!V(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=Vn(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=Bn(e,this.options),n=(e,t,r)=>{if(!(`children`in e)){let{keyId:n,searcher:i}=e,a;return n===null?(a=[],this._myIndex.keys.forEach((e,n)=>{a.push(...this._findMatches({key:e,value:t[n],searcher:i}))})):a=this._findMatches({key:this._keyStore.get(n),value:this._myIndex.getValueForItemAtKeyId(t,n),searcher:i}),a&&a.length?[{idx:r,item:t,matches:a}]:[]}let{children:i,operator:a}=e,o=[];for(let e=0,s=i.length;e<s;e+=1){let s=i[e],c=n(s,t,r);if(c.length)o.push(...c);else if(a===Tr.AND)return[]}return o},r=this._myIndex.records,i=new Map,a=[];return r.forEach(({$:e,i:r})=>{if(V(e)){let o=n(t,e,r);o.length&&(i.has(r)||(i.set(r,{idx:r,item:e,matches:[]}),a.push(i.get(r))),o.forEach(({matches:e})=>{i.get(r).matches.push(...e)}))}}),a}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{keys:a,records:o}=this._myIndex,s=t?null:[];return o.forEach(({$:e,i:o})=>{if(!V(e))return;let c=[],l=!1,u=!1;if(a.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:o,item:e,matches:c};t?(r.score=Vn(r.matches,{ignoreFieldNorm:n}),t.shouldInsert(r.score)&&t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!V(t))return[];let r=[];if(mn(t))t.forEach(({v:t,i,n:a})=>{if(!V(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}},Fr.version=`7.4.2`,Fr.createIndex=On,Fr.parseIndex=kn,Fr.config=H,Fr.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(or);return zn(e,{...H,...n}).searchIn(t)},Fr.parseQuery=Bn,Rn(Cr),Rn(Pr),Fr.use=function(...e){e.forEach(e=>Rn(e))},Ir=Fr}));function Rr(e,t){for(let n of e)if(!t.has(n))return!1;return!0}var zr=t((()=>{}));function Br(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`)||Xe(t.text,`status`)!==`completed`?!1:Xe(t.text,`summary`)?.startsWith(`Background command `)??!1}function Vr(e,t){if(!De()||t)return e;let n=[],r=0;for(;r<e.length;){let t=e[r];if(Br(t)){let i=0;for(;r<e.length&&Br(e[r]);)i++,r++;i===1?n.push(t):n.push({...t,message:{role:`user`,content:[{type:`text`,text:`<${pt}><${ht}>completed</${ht}><${gt}>${i} background commands completed</${gt}></${pt}>`}]}})}else n.push(t),r++}return n}var Hr=t((()=>{mt(),Ke(),We(),R()}));function Ur(e){return e.type===`system`&&e.subtype===`stop_hook_summary`&&e.hookLabel!==void 0}function Wr(e){let t=[],n=0;for(;n<e.length;){let r=e[n];if(Ur(r)){let i=r.hookLabel,a=[];for(;n<e.length;){let t=e[n];if(!Ur(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 Gr=t((()=>{}));function Kr(e){let t=Yr.get(e);return t||(t=new Set(e.filter(e=>e.renderGroupedToolUse).map(e=>e.name)),Yr.set(e,t)),t}function qr(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 Jr(e,t,n=!1){if(n)return{messages:e};let r=Kr(t),i=new Map;for(let t of e){let e=qr(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=qr(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=qr(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 Yr,Xr=t((()=>{Yr=new WeakMap}));function Zr(e){let t=ri.get(e);if(t!==void 0)return t;let n=Qr(e).toLowerCase();return ri.set(e,n),n}function Qr(e){let t=``;switch(e.type){case`user`:{let n=e.message.content;if(typeof n==`string`)t=ni.has(n)?``:n;else{let r=[];for(let t of n??[])t.type===`text`?ni.has(t.text)||r.push(t.text):t.type===`tool_result`&&r.push(ei(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`?[$r(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(ti,r);if(e<0)break;n=n.slice(0,r)+n.slice(e+18),r=n.indexOf(`<system-reminder>`)}return n}function $r(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 ei(e){if(!e||typeof e!=`object`)return typeof e==`string`?e:``;let t=e;if(typeof t.stdout==`string`){let e=typeof t.stderr==`string`?t.stderr:``;return t.stdout+(e?`
8
- `+e:``)}if(t.file&&typeof t.file==`object`&&typeof t.file.content==`string`)return t.file.content;let n=[];for(let e of[`content`,`output`,`result`,`text`,`message`]){let r=t[e];typeof r==`string`&&n.push(r)}for(let e of[`filenames`,`lines`,`results`]){let r=t[e];Array.isArray(r)&&r.every(e=>typeof e==`string`)&&n.push(r.join(`
9
- `))}return n.join(`
10
- `)}var ti,ni,ri,ii=t((()=>{R(),ti=`</system-reminder>`,ni=new Set([je,Se]),ri=new WeakMap}));function ai({pose:e=`default`}={}){return(0,oi.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,oi.jsx)(d,{color:`clawd_body`,children:` █████ `}),(0,oi.jsx)(d,{color:`clawd_body`,children:`██ ● ● ██`}),(0,oi.jsx)(d,{color:`clawd_body`,children:`██ ▄▄▄ ██`}),(0,oi.jsx)(d,{color:`clawd_body`,children:` █ █ █ █ `})]})}var oi,si=t((()=>{h(),y(),oi=S()}));function ci(e){let{title:t,lines:n,footer:r,emptyMessage:i,customContent:a}=e,o=c(t);if(a!==void 0)o=Math.max(o,a.width);else if(n.length===0&&i)o=Math.max(o,c(i));else{let e=Math.max(0,...n.map(e=>e.timestamp?c(e.timestamp):0));for(let t of n){let n=e>0?e:0,r=c(t.text)+(n>0?n+2:0);o=Math.max(o,r)}}return r&&(o=Math.max(o,c(r))),o}function li({config:e,actualWidth:t}){let{title:n,lines:r,footer:i,emptyMessage:a,customContent:o}=e,s=Math.max(0,...r.map(e=>e.timestamp?c(e.timestamp):0));return(0,U.jsxs)(l,{flexDirection:`column`,width:t,children:[(0,U.jsx)(d,{bold:!0,color:`claude`,children:n}),o?(0,U.jsxs)(U.Fragment,{children:[o.content,i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:St(i,t)})]}):r.length===0&&a?(0,U.jsx)(d,{dimColor:!0,children:St(a,t)}):(0,U.jsxs)(U.Fragment,{children:[r.map((e,n)=>{let r=Math.max(10,t-(s>0?s+2:0));return(0,U.jsxs)(d,{children:[s>0&&(0,U.jsxs)(U.Fragment,{children:[(0,U.jsx)(d,{dimColor:!0,children:(e.timestamp||``).padEnd(s)}),` `]}),(0,U.jsx)(d,{children:St(e.text,r)})]},n)}),i&&(0,U.jsx)(d,{dimColor:!0,italic:!0,children:St(i,t)})]})]})}var U,ui=t((()=>{h(),y(),Ct(),U=S()}));function di({feeds:e,maxWidth:t}){let n=e.map(e=>ci(e)),r=Math.max(...n),i=Math.min(r,t);return(0,pi.jsx)(l,{flexDirection:`column`,children:e.map((t,n)=>(0,pi.jsxs)(fi.Fragment,{children:[(0,pi.jsx)(li,{config:t,actualWidth:i}),n<e.length-1&&(0,pi.jsx)(s,{color:`claude`,width:i})]},n))})}var fi,pi,mi=t((()=>{fi=n(h(),1),y(),ui(),pi=S()}));function hi(e){let t=e.map(e=>{let t=_t(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 gi(e){let t=e.filter(({isEnabled:e})=>e).sort((e,t)=>Number(e.isComplete)-Number(t.isComplete)).map(({text:e,isComplete:t})=>({text:`${t?`${o.tick} `:``}${e}`})),n=Qe()===dn()?`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 _i=t((()=>{a(),Ze(),Ct()}));function vi(e,t,n){return Array.from({length:n},()=>({pose:e,offset:t}))}function yi(){let{pose:e,bounceOffset:t,onClick:n}=bi();return(0,Si.jsx)(l,{height:Oi,flexDirection:`column`,onClick:n,children:(0,Si.jsx)(l,{marginTop:t,flexShrink:0,children:(0,Si.jsx)(ai,{pose:e})})})}function bi(){let[e]=(0,xi.useState)(()=>lt().prefersReducedMotion??!1),[t,n]=(0,xi.useState)(-1),r=(0,xi.useRef)(Ci),i=()=>{e||t!==-1||(r.current=wi[Math.floor(Math.random()*wi.length)],n(0))};(0,xi.useEffect)(()=>{if(t===-1)return;if(t>=r.current.length){n(-1);return}let e=setTimeout(n,Ei,Di);return()=>clearTimeout(e)},[t]);let a=r.current,o=t>=0&&t<a.length?a[t]:Ti;return{pose:o.pose,bounceOffset:o.offset,onClick:i}}var xi,Si,Ci,wi,Ti,Ei,Di,Oi,ki=t((()=>{h(),xi=n(h(),1),y(),ct(),si(),Si=S(),Ci=[...vi(`default`,1,2),...vi(`arms-up`,0,3),...vi(`default`,0,1),...vi(`default`,1,2),...vi(`arms-up`,0,3),...vi(`default`,0,1)],wi=[Ci,[...vi(`look-right`,0,5),...vi(`look-left`,0,5),...vi(`default`,0,1)]],Ti={pose:`default`,offset:0},Ei=60,Di=e=>e+1,Oi=3}));function Ai(){let{columns:e}=v(),t=Ge(e=>e.agent),n=Ot(rn()),{version:r,cwd:i,billingType:a,agentName:o}=Yt(),s=t??o,u=Math.max(e-15,20),f=St(r,Math.max(u-11,6)),{shouldSplit:p,truncatedModel:m,truncatedBilling:h}=Xt(n,a,u),g=s?u-1-c(s)-3:u,_=Qt(i,Math.max(g,10));return(0,W.jsx)(z,{children:(0,W.jsxs)(l,{flexDirection:`row`,gap:2,alignItems:`center`,children:[De()?(0,W.jsx)(yi,{}):(0,W.jsx)(ai,{}),(0,W.jsxs)(l,{flexDirection:`column`,children:[(0,W.jsxs)(d,{children:[(0,W.jsx)(d,{bold:!0,children:`Work Mate`}),` `,(0,W.jsxs)(d,{dimColor:!0,children:[`v`,f]})]}),p?(0,W.jsxs)(W.Fragment,{children:[(0,W.jsx)(d,{dimColor:!0,children:m}),(0,W.jsx)(d,{dimColor:!0,children:h})]}):(0,W.jsxs)(d,{dimColor:!0,children:[m,` · `,h]}),(0,W.jsx)(d,{dimColor:!0,children:s?`@${s} · ${_}`:_})]})]})})}var W,ji=t((()=>{an(),Ye(),y(),Ce(),Ct(),We(),qt(),Mt(),L(),ki(),si(),W=S()}));function Mi(){let e=(0,Pi.useMemo)(Ni,[]),t=(0,Pi.useMemo)(()=>dt().lastShownEmergencyTip,[]),n=e.tip&&e.tip!==t;return(0,Pi.useEffect)(()=>{n&&ut(t=>t.lastShownEmergencyTip===e.tip?t:{...t,lastShownEmergencyTip:e.tip})},[n,e.tip]),n?(0,Fi.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,Fi.jsx)(d,{...e.color===`warning`?{color:`warning`}:e.color===`error`?{color:`error`}:{dimColor:!0},children:e.tip})}):null}function Ni(){return Ii}var Pi,Fi,Ii,Li=t((()=>{h(),Pi=n(h(),1),y(),ft(),Fi=S(),Ii={tip:``,color:`dim`}}));function Ri({char:e=`✻`}){let[t]=(0,zi.useState)(()=>lt().prefersReducedMotion??!1),[n,r]=(0,zi.useState)(t),i=(0,zi.useRef)(null),[a,o]=_(n?null:50);return(0,zi.useEffect)(()=>{if(n)return;let e=setTimeout(r,Hi,!0);return()=>clearTimeout(e)},[n]),n?(0,Bi.jsx)(l,{ref:a,children:(0,Bi.jsx)(d,{color:Ui,children:e})}):(i.current===null&&(i.current=o),(0,Bi.jsx)(l,{ref:a,children:(0,Bi.jsx)(d,{color:de(we((o-i.current)/Vi*360%360)),children:e})}))}var zi,Bi,Vi,Hi,Ui,Wi=t((()=>{h(),zi=n(h(),1),at(),y(),ct(),Je(),Bi=S(),Vi=1500,Hi=Vi*2,Ui=de({r:153,g:153,b:153})}));function Gi(){return Pt()&&(dt().opus1mMergeNoticeSeenCount??0)<Yi}function Ki(){let[e]=(0,qi.useState)(Gi);return(0,qi.useEffect)(()=>{if(!e)return;let t=(dt().opus1mMergeNoticeSeenCount??0)+1;ut(e=>(e.opus1mMergeNoticeSeenCount??0)>=t?e:{...e,opus1mMergeNoticeSeenCount:t})},[e]),e?(0,Ji.jsxs)(l,{paddingLeft:2,children:[(0,Ji.jsx)(Ri,{char:`↑`}),(0,Ji.jsx)(d,{dimColor:!0,children:` Opus now defaults to 1M context · 5x more room, same pricing`})]}):null}var qi,Ji,Yi,Xi=t((()=>{h(),qi=n(h(),1),at(),y(),ft(),Mt(),Wi(),Ji=S(),Yi=6}));function Zi(){return null}var Qi=t((()=>{}));function $i(){return null}var ea=t((()=>{}));function ta(){let e=Gt(),t=dt().oauthAccount?.displayName??``,{columns:n}=v(),i=Ht(),a=F.isSandboxingEnabled(),o=Ge(e=>e.agent),s=dt(),[u]=(0,na.useState)(()=>{let e=lt().companyAnnouncements;if(!(!e||e.length===0))return s.numStartups===1?e[0]:e[Math.floor(Math.random()*e.length)]});(0,na.useEffect)(()=>{i&&Vt()},[i]),!i&&r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO);let f=Ot(rn()),{version:p,cwd:m,billingType:h,agentName:_}=Yt(),y=o??_,b=St(f,ra-20);if(!i&&!r(process.env.CLAUDE_CODE_FORCE_FULL_LOGO))return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(Ai,{}),(0,G.jsx)(Ki,{}),tt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,rt()?`stderr`:nt()]})]}),(0,G.jsx)(Mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),u&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:u})]}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,st(Pe())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,st(nt())]}),bt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,st(xt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)($i,{})]});let x=Wt(n),S=$t(dt().theme),C=` ${g(`claude`,S)(`Work Mate`)} ${g(`inactive`,S)(`v${p}`)} `,w=g(`claude`,S)(` Work Mate `);if(x===`compact`){let e=Kt(t);c(e)>n-4&&(e=Kt(null));let r=y?n-4-1-c(y)-3:n-4,i=Qt(m,Math.max(r,10));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z,{children:(0,G.jsxs)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:w,position:`top`,align:`start`,offset:1},paddingX:1,paddingY:1,alignItems:`center`,width:n,children:[(0,G.jsx)(d,{bold:!0,children:e}),(0,G.jsx)(l,{marginY:1,children:(0,G.jsx)(ai,{})}),(0,G.jsx)(d,{dimColor:!0,children:b}),(0,G.jsx)(d,{dimColor:!0,children:h}),(0,G.jsx)(d,{dimColor:!0,children:y?`@${y} · ${i}`:i})]})}),(0,G.jsx)(Ki,{}),a&&(0,G.jsx)(l,{marginTop:1,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)($i,{})]})}let T=Kt(t),E=!process.env.IS_DEMO&&s.oauthAccount?.organizationName?`${b} · ${h} · ${s.oauthAccount.organizationName}`:`${b} · ${h}`,D=y?ra-1-c(y)-3:ra,O=Qt(m,Math.max(D,10)),k=y?`@${y} · ${O}`:O,{leftWidth:ee,rightWidth:te}=Zt(n,x,Jt(T,k,E));return(0,G.jsxs)(G.Fragment,{children:[(0,G.jsx)(z,{children:(0,G.jsx)(l,{flexDirection:`column`,borderStyle:`round`,borderColor:`claude`,borderText:{content:C,position:`top`,align:`start`,offset:3},children:(0,G.jsxs)(l,{flexDirection:x===`horizontal`?`row`:`column`,paddingX:1,gap:1,children:[(0,G.jsxs)(l,{flexDirection:`column`,width:ee,justifyContent:`space-between`,alignItems:`center`,minHeight:9,children:[(0,G.jsx)(l,{marginTop:1,children:(0,G.jsx)(d,{bold:!0,children:T})}),(0,G.jsx)(ai,{}),(0,G.jsxs)(l,{flexDirection:`column`,alignItems:`center`,children:[(0,G.jsx)(d,{dimColor:!0,children:E}),(0,G.jsx)(d,{dimColor:!0,children:k})]})]}),x===`horizontal`&&(0,G.jsx)(l,{height:`100%`,borderStyle:`single`,borderColor:`claude`,borderDimColor:!0,borderTop:!1,borderBottom:!1,borderLeft:!1}),x===`horizontal`&&(0,G.jsx)(di,{feeds:i?[gi(Bt()),hi(e)]:[hi(e)],maxWidth:te})]})})}),(0,G.jsx)(Ki,{}),tt()&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`Debug mode enabled`}),(0,G.jsxs)(d,{dimColor:!0,children:[`Logging to: `,rt()?`stderr`:nt()]})]}),(0,G.jsx)(Mi,{}),process.env.CLAUDE_CODE_TMUX_SESSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsxs)(d,{dimColor:!0,children:[`tmux session: `,process.env.CLAUDE_CODE_TMUX_SESSION]}),(0,G.jsx)(d,{dimColor:!0,children:process.env.CLAUDE_CODE_TMUX_PREFIX_CONFLICTS?`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} ${process.env.CLAUDE_CODE_TMUX_PREFIX} d (press prefix twice - Claude uses ${process.env.CLAUDE_CODE_TMUX_PREFIX})`:`Detach: ${process.env.CLAUDE_CODE_TMUX_PREFIX} d`})]}),u&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[!process.env.IS_DEMO&&s.oauthAccount?.organizationName&&(0,G.jsxs)(d,{dimColor:!0,children:[`Message from `,s.oauthAccount.organizationName,`:`]}),(0,G.jsx)(d,{children:u})]}),a&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{color:`warning`,children:`Your bash commands will be sandboxed. Disable with /sandbox.`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsx)(l,{paddingLeft:2,flexDirection:`column`,children:(0,G.jsx)(d,{dimColor:!0,children:`Use /issue to report model behavior issues`})}),process.env.USER_TYPE===`ant`&&!process.env.DEMO_VERSION&&(0,G.jsxs)(l,{paddingLeft:2,flexDirection:`column`,children:[(0,G.jsx)(d,{color:`warning`,children:`[ANT-ONLY] Logs:`}),(0,G.jsxs)(d,{dimColor:!0,children:[`API calls: `,st(Pe())]}),(0,G.jsxs)(d,{dimColor:!0,children:[`Debug logs: `,st(nt())]}),bt()&&(0,G.jsxs)(d,{dimColor:!0,children:[`Startup Perf: `,st(xt())]})]}),process.env.USER_TYPE===`ant`&&(0,G.jsx)(Zi,{}),process.env.USER_TYPE===`ant`&&(0,G.jsx)($i,{})]})}var na,G,ra,ia=t((()=>{h(),y(),Ye(),qt(),Ct(),it(),si(),mi(),_i(),ft(),en(),ct(),$e(),na=n(h(),1),Ut(),ji(),L(),Me(),i(),vt(),Li(),Xi(),Qi(),ea(),I(),Ce(),an(),Mt(),G=S(),ra=50}));function aa({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,oa.jsx)(l,{minWidth:c(i)+8,children:(0,oa.jsx)(d,{dimColor:!0,children:i})})}var oa,sa=t((()=>{h(),y(),oa=S()}));function ca({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,la.jsx)(l,{minWidth:c(n),children:(0,la.jsx)(d,{dimColor:!0,children:n})})}var la,ua=t((()=>{h(),y(),la=S()}));function da(e,t,n,r){for(let i=t+1;i<e.length;i++){let t=e[i];if(t?.type===`assistant`){let e=va(t.message.content);if(e?.type===`thinking`||e?.type===`redacted_thinking`||e?.type===`tool_use`&&(xe(e.name,e.input,n).isCollapsible||r.has(e.id)))continue;return!0}if(!(t?.type===`system`||t?.type===`attachment`)&&!(t?.type===`user`&&va(t.message.content)?.type===`tool_result`)){if(t?.type===`grouped_tool_use`){let e=va(t.messages[0]?.message.content)?.input;if(xe(t.toolName,e,n).isCollapsible)continue}return!0}}return!1}function fa({message:e,isUserContinuation:t,hasContentAfter:n,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,streamingToolUseIDs:s,screen:c,canAnimate:u,lastThinkingBlockId:d,latestBashOutputUUID:f,columns:p,isLoading:m,lookups:h,shouldCollapseDiffs:g}){let _=c===`transcript`,v=e.type===`grouped_tool_use`,y=e.type===`collapsed_read_search`,b=y&&(E(e,o)||m&&!n),x=v?e.displayMessage:y?_e(e):e,S=v||y?[]:N(e,h),C=Fo(e,s,o,v||y?Ne:He(e,h),c,h),w=!1;if(u)if(v)w=e.messages.some(e=>{let t=va(e.message.content);return t?.type===`tool_use`&&o.has(t.id)});else if(y)w=E(e,o);else{let t=M(e);w=!t||o.has(t)}let T=_&&x.type===`assistant`&&Array.isArray(x.message.content)&&x.message.content.some(e=>e.type===`text`)&&(x.timestamp||x.message.model),D=(0,_a.jsx)(k,{message:e,lookups:h,addMargin:!T,containerWidth:T?void 0:p,tools:r,commands:i,verbose:a,inProgressToolUseIDs:o,progressMessagesForMessage:S,shouldAnimate:w,shouldShowDot:!0,isTranscriptMode:_,isStatic:C,isActiveCollapsedGroup:b,isUserContinuation:t,lastThinkingBlockId:d,latestBashOutputUUID:f,shouldCollapseDiffs:g});return T?(0,_a.jsx)(z,{children:(0,_a.jsxs)(l,{width:p,flexDirection:`column`,children:[(0,_a.jsxs)(l,{flexDirection:`row`,justifyContent:`flex-end`,gap:1,marginTop:1,children:[(0,_a.jsx)(ca,{message:x,isTranscriptMode:_}),(0,_a.jsx)(aa,{message:x,isTranscriptMode:_})]}),D]})}):(0,_a.jsx)(z,{children:D})}function pa(e,t){if(e.type===`grouped_tool_use`)return e.messages.some(e=>{let n=va(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return le(e).some(e=>t.has(e));let n=M(e);return!!n&&t.has(n)}function ma(e,t){if(e.type===`grouped_tool_use`)return e.messages.every(e=>{let n=va(e.message.content);return n?.type===`tool_use`&&t.has(n.id)});if(e.type===`collapsed_read_search`)return le(e).every(e=>t.has(e));if(e.type===`assistant`){let n=va(e.message.content);if(n?.type===`server_tool_use`)return t.has(n.id)}let n=M(e);return!n||t.has(n)}function ha(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&&pe(t.message))return!1;let n=pa(e.message,e.streamingToolUseIDs),r=ma(e.message,e.lookups.resolvedToolUseIDs);return!(n||!r)}var ga,_a,va,ya,ba=t((()=>{ga=n(h(),1),y(),Oe(),R(),ae(),_a=S(),sa(),Ko(),ua(),L(),va=e=>{if(!Array.isArray(e))return;let t=e[0];if(!(t==null||typeof t==`string`))return t},ya=ga.memo(fa,ha)}));function xa(e){return e.type===`attachment`&&Sa.has(e.attachment.type)}var Sa,Ca=t((()=>{Sa=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 wa(e){return Aa.filter(t=>t.isActive(e))}var K,Ta,Ea,Da,Oa,ka,Aa,ja=t((()=>{y(),h(),he(),a(),Ze(),Ct(),Et(),ln(),K=S(),Ta={id:`large-memory-files`,type:`warning`,isActive:e=>me(e.memoryFiles).length>0,render:e=>(0,K.jsx)(K.Fragment,{children:me(e.memoryFiles).map(e=>{let t=e.path.startsWith(Qe())?fn(Qe(),e.path):e.path;return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large `,(0,K.jsx)(d,{bold:!0,children:t}),` will impact performance (`,yt(e.content.length),` chars > `,yt(P),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /memory to edit`})]})]},e.path)})})},Ea={id:`claude-ai-external-token`,type:`warning`,isActive:()=>{let e=Dt();return kt()&&(e.source===`ANTHROPIC_AUTH_TOKEN`||e.source===`apiKeyHelper`)},render:()=>{let e=Dt();return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e.source,` instead of Claude account subscription token. Either unset`,` `,e.source,", or run `claude /logout`."]})]})}},Da={id:`api-key-conflict`,type:`warning`,isActive:()=>{let{source:e}=At({skipRetrievingKeyFromApiKeyHelper:!0});return!!jt()&&(e===`ANTHROPIC_API_KEY`||e===`apiKeyHelper`)},render:()=>{let{source:e}=At({skipRetrievingKeyFromApiKeyHelper:!0});return(0,K.jsxs)(l,{flexDirection:`row`,marginTop:1,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Using `,e,` instead of Console key. Either unset `,e,", or run `claude /logout`."]})]})}},Oa={id:`both-auth-methods`,type:`warning`,isActive:()=>{let{source:e}=At({skipRetrievingKeyFromApiKeyHelper:!0}),t=Dt();return e!==`none`&&t.source!==`none`&&!(e===`apiKeyHelper`&&t.source===`apiKeyHelper`)},render:()=>{let{source:e}=At({skipRetrievingKeyFromApiKeyHelper:!0}),t=Dt();return(0,K.jsxs)(l,{flexDirection:`column`,marginTop:1,children:[(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Auth conflict: Both a token (`,t.source,`) and an API key (`,e,`) are set. This may lead to unexpected behavior.`]})]}),(0,K.jsxs)(l,{flexDirection:`column`,marginLeft:3,children:[(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,t.source===`claude.ai`?`claude.ai`:t.source,`?`,` `,e===`ANTHROPIC_API_KEY`?`Unset the ANTHROPIC_API_KEY environment variable, or claude /logout then say "No" to the API key approval before login.`:e===`apiKeyHelper`?`Unset the apiKeyHelper setting.`:`claude /logout`]}),(0,K.jsxs)(d,{color:`warning`,children:[`· Trying to use `,e,`?`,` `,t.source===`claude.ai`?`claude /logout to sign out of claude.ai.`:`Unset the ${t.source} environment variable.`]})]})]})}},ka={id:`large-agent-descriptions`,type:`warning`,isActive:e=>cn(e.agentDefinitions)>un,render:e=>{let t=cn(e.agentDefinitions);return(0,K.jsxs)(l,{flexDirection:`row`,children:[(0,K.jsx)(d,{color:`warning`,children:o.warning}),(0,K.jsxs)(d,{color:`warning`,children:[`Large cumulative agent descriptions will impact performance (~`,yt(t),` tokens > `,yt(un),`)`,(0,K.jsx)(d,{dimColor:!0,children:` · /agents to manage`})]})]})}},Aa=[Ta,ka,Ea,Da,Oa]}));function Ma({agentDefinitions:e}={}){let t={config:dt(),agentDefinitions:e,memoryFiles:(0,Pa.use)(A())},n=wa(t);return n.length===0?null:(0,Fa.jsx)(l,{flexDirection:`column`,paddingLeft:1,children:n.map(e=>(0,Fa.jsx)(Na.Fragment,{children:e.render(t)},e.id))})}var Na,Pa,Fa,Ia=t((()=>{Na=n(h(),1),Pa=n(h(),1),y(),he(),ft(),ja(),Fa=S()}));function La(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)??Ga,[e]),()=>{let t=e.current;if(!t)return NaN;let n=t.getScrollTop()+t.getPendingDelta(),r=Math.floor(n/Va);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])??Ra);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-Ba),w=b;else{if(y){let e=v+za;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-za;{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*za,y=Math.min(b,C+Ua),S=0;for(w=C;w<y&&(S<h||x[w]<f+v+za);)S+=r.current.get(t[w])??Ha,w++}let e=v+2*za,n=Math.max(0,w-Ua),i=0;for(let e=C;e<w;e++)i+=r.current.get(t[e])??Ha;for(;C>n&&i<e;)C--,i+=r.current.get(t[C])??Ha;let o=d.current,c=Math.abs(g-a.current)+Math.abs(_);if(o&&c>v*2){let[e,t]=o;C<e-Wa&&(C=e-Wa),w>t+Wa&&(w=t+Wa),C>w&&(w=Math.min(C+Wa,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>Ua){let e=(x[D]+x[O])/2;g-m.current<e?O=D+Ua:D=O-Ua}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},[]),ie=(0,q.useCallback)(e=>{let n=s.current.get(t[e])?.yogaNode;return!n||n.getComputedWidth()===0?-1:n.getComputedTop()},[t]),ae=(0,q.useCallback)(e=>s.current.get(t[e])??null,[t]),A=(0,q.useCallback)(e=>r.current.get(t[e]),[t]),j=(0,q.useCallback)(t=>{let n=o.current;t<0||t>=n.n||e.current?.scrollTo(n.arr[t]+m.current)},[e]),M=S-x[O];return{range:[D,O],topSpacer:ee,bottomSpacer:M,measureRef:re,spacerRef:h,offsets:x,getItemTop:ie,getItemElement:ae,getItemHeight:A,scrollToIndex:j}}var q,Ra,za,Ba,Va,Ha,Ua,Wa,Ga,Ka=t((()=>{q=n(h(),1),Ra=3,za=40,Ba=30,Va=20,Ha=1,Ua=200,Wa=25,Ga=()=>{}}));function qa({children:e}){let[t,n]=(0,J.useState)(null),[r,i]=(0,J.useState)(null);return(0,Qa.jsx)(eo.Provider,{value:n,children:(0,Qa.jsx)(no.Provider,{value:i,children:(0,Qa.jsx)($a.Provider,{value:t,children:(0,Qa.jsx)(to.Provider,{value:r,children:e})})})})}function Ja(){return(0,J.useContext)($a)}function Ya(){return(0,J.useContext)(to)}function Xa(e){let t=(0,J.useContext)(eo);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}function Za(e){let t=(0,J.useContext)(no);(0,J.useEffect)(()=>{if(t)return t(e),()=>t(null)},[t,e])}var J,Qa,$a,eo,to,no,ro=t((()=>{J=n(h(),1),Qa=S(),$a=(0,J.createContext)(null),eo=(0,J.createContext)(null),to=(0,J.createContext)(null),no=(0,J.createContext)(null)}));function io(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 ao(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`&&!oo(t))continue;let a=t.type===`assistant`;a&&!r&&n++,r=a}return n}function oo(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 so(e,t){if(t===null)return;let n=t;for(;n<e.length&&(e[n]?.type===`progress`||xa(e[n]));)n++;let r=e[n]?.uuid;if(!r)return;let i=ao(e,t);return{firstUnseenUuid:r,count:Math.max(1,i)}}function co({scrollable:e,bottom:t,overlay:n,bottomFloat:r,modal:i,modalScrollRef:a,scrollRef:o,dividerYRef:s,hidePill:c=!1,hideSticky:u=!1,newMessageCount:f=0,onPillClick:m}){let{rows:h,columns:g}=v(),[_,y]=(0,Y.useState)(null),b=(0,Y.useMemo)(()=>({setStickyPrompt:y}),[]),S=(0,Y.useSyncExternalStore)((0,Y.useCallback)(e=>o?.current?.subscribe(e)??(()=>{}),[o]),()=>{let e=o?.current,t=s?.current;return!e||t==null?!1:e.getScrollTop()+e.getPendingDelta()+e.getViewportHeight()<t});if((0,Y.useLayoutEffect)(()=>{if(!De())return;let e=p.get(process.stdout);if(e)return e.onHyperlinkClick=e=>{if(e.startsWith(`file:`))try{Be(pn(e))}catch{}else Ve(e)},()=>{e.onHyperlinkClick=void 0}},[]),De()){let s=u?null:_,p=s!=null&&s!==`clicked`&&n==null?s:null,v=s!=null&&n==null;return(0,X.jsxs)(qa,{children:[(0,X.jsx)(l,{flexDirection:`row`,flexGrow:1,overflow:`hidden`,width:`100%`,children:(0,X.jsxs)(l,{flexDirection:`column`,flexGrow:1,width:g,overflow:`hidden`,children:[(0,X.jsxs)(l,{flexGrow:1,flexDirection:`column`,overflow:`hidden`,children:[p&&(0,X.jsx)(uo,{text:p.text,onClick:p.scrollTo}),(0,X.jsxs)(x,{ref:o,flexGrow:1,flexDirection:`column`,paddingTop:+!v,stickyScroll:!0,children:[(0,X.jsx)(ho,{value:b,children:e}),n]}),!c&&S&&n==null&&(0,X.jsx)(lo,{count:f,onClick:m}),r!=null&&(0,X.jsx)(l,{position:`absolute`,bottom:0,right:0,opaque:!0,children:r})]}),(0,X.jsxs)(l,{flexDirection:`column`,flexShrink:0,width:`100%`,maxHeight:`50%`,children:[(0,X.jsx)(fo,{}),(0,X.jsx)(po,{}),(0,X.jsx)(l,{flexDirection:`column`,width:`100%`,flexGrow:1,overflowY:`hidden`,children:t})]})]})}),i!=null&&(0,X.jsx)(sn,{value:{rows:h-mo-1,columns:g-4,scrollRef:a??null},children:(0,X.jsxs)(l,{position:`absolute`,bottom:0,left:0,right:0,maxHeight:h-mo,flexDirection:`column`,overflow:`hidden`,opaque:!0,children:[(0,X.jsx)(l,{flexShrink:0,children:(0,X.jsx)(d,{color:`permission`,children:`▔`.repeat(g)})}),(0,X.jsx)(l,{flexDirection:`column`,paddingX:2,flexShrink:0,overflow:`hidden`,children:i})]})})]})}return(0,X.jsxs)(X.Fragment,{children:[e,t,n,i]})}function lo({count:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{position:`absolute`,bottom:0,left:0,right:0,justifyContent:`center`,children:(0,X.jsx)(l,{onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,dimColor:!0,children:[` `,e>0?`${e} new ${wt(e,`message`)}`:`Jump to bottom`,` `,o.arrowDown,` `]})})})}function uo({text:e,onClick:t}){let[n,r]=(0,Y.useState)(!1);return(0,X.jsx)(l,{flexShrink:0,width:`100%`,height:1,paddingRight:1,backgroundColor:n?`userMessageBackgroundHover`:`userMessageBackground`,onClick:t,onMouseEnter:()=>r(!0),onMouseLeave:()=>r(!1),children:(0,X.jsxs)(d,{color:`subtle`,wrap:`truncate-end`,children:[o.pointer,` `,e]})})}function fo(){let e=Ja();return!e||e.suggestions.length===0?null:(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,paddingX:2,paddingTop:1,flexDirection:`column`,opaque:!0,children:(0,X.jsx)(tn,{suggestions:e.suggestions,selectedSuggestion:e.selectedSuggestion,maxColumnWidth:e.maxColumnWidth,overlay:!0})})}function po(){let e=Ya();return e?(0,X.jsx)(l,{position:`absolute`,bottom:`100%`,left:0,right:0,opaque:!0,children:e}):null}var Y,X,mo,ho,go=t((()=>{a(),Y=n(h(),1),on(),ro(),Ye(),y(),Ae(),We(),Tt(),Ca(),nn(),X=S(),mo=2,ho=(0,Y.createContext)({setStickyPrompt:()=>{}})}));function _o(e){let t=To.get(e);if(t!==void 0)return t;let n=Zr(e);return To.set(e,n),n}function vo(e){let t=Do.get(e);if(t!==void 0)return t;let n=yo(e);return Do.set(e,n),n}function yo(e){let t=null;if(e.type===`user`){if(e.isMeta||e.isVisibleInTranscriptOnly)return null;let n=e.message.content[0];if(n?.type!==`text`)return null;t=n.text??null}else if(e.type===`attachment`&&e.attachment.type===`queued_command`&&e.attachment.commandMode!==`task-notification`&&!e.attachment.isMeta){let n=e.attachment.prompt;t=typeof n==`string`?n:n.flatMap(e=>e.type===`text`?[e.text??``]:[]).join(`
11
- `)}if(t===null)return null;let n=Fe(t);return n.startsWith(`<`)||n===``?null:n}function bo({itemKey:e,msg:t,idx:n,measureRef:r,expanded:i,hovered:a,clickable:o,onClickK:s,onEnterK:c,onLeaveK:d,renderItem:f}){return(0,Co.jsx)(l,{ref:r(e),flexDirection:`column`,backgroundColor:i?`userMessageBackgroundHover`:void 0,paddingBottom:i?1:void 0,onClick:o?e=>s(t,e.cellIsBlank):void 0,onMouseEnter:o?()=>c(e):void 0,onMouseLeave:o?()=>d(e):void 0,children:(0,Co.jsx)(u.Provider,{value:a&&!i?`text`:void 0,children:f(t,n)})})}function xo({messages:e,scrollRef:t,columns:n,itemKey:r,renderItem:i,onItemClick:a,isItemClickable:o,isItemExpanded:s,extractSearchText:c=_o,trackStickyPrompt:u,selectedIndex:d,cursorNavRef:f,setCursor:p,jumpRef:m,onSearchMatchesChange:h,scanElement:g,setPositions:_}){let v=(0,Z.useRef)([]),y=(0,Z.useRef)(e),b=(0,Z.useRef)(r);if(b.current!==r||e.length<v.current.length||e[0]!==y.current[0])v.current=e.map(e=>r(e));else for(let t=v.current.length;t<e.length;t++)v.current.push(r(e[t]));y.current=e,b.current=r;let x=v.current,{range:S,topSpacer:C,bottomSpacer:w,measureRef:T,spacerRef:E,offsets:O,getItemTop:k,getItemElement:ee,getItemHeight:te,scrollToIndex:ne}=La(t,x,n),[re,ie]=S,ae=(0,Z.useCallback)(t=>te(t)!==0&&D(e[t]),[te,e]);(0,Z.useImperativeHandle)(f,()=>{let n=e=>p?.({uuid:e.uuid,msgType:e.type,expanded:!1,toolName:se(e)?.name}),r=d??-1,i=(t,r,i=ae)=>{for(let a=t;a>=0&&a<e.length;a+=r)if(i(a))return n(e[a]),!0;return!1},a=t=>ae(t)&&e[t].type===`user`;return{enterCursor:()=>i(e.length-1,-1,a),navigatePrev:()=>i(r-1,-1),navigateNext:()=>{i(r+1,1)||(t.current?.scrollToBottom(),p?.(null))},navigatePrevUser:()=>i(r-1,-1,a),navigateNextUser:()=>i(r+1,1,a),navigateTop:()=>i(0,1),navigateBottom:()=>i(e.length-1,-1),getSelected:()=>r>=0?e[r]??null:null}},[e,d,p,ae]);let A=(0,Z.useRef)({offsets:O,start:re,getItemElement:ee,getItemTop:k,messages:e,scrollToIndex:ne});A.current={offsets:O,start:re,getItemElement:ee,getItemTop:k,messages:e,scrollToIndex:ne},(0,Z.useEffect)(()=>{if(d===void 0)return;let e=A.current,n=e.getItemElement(d);n?t.current?.scrollToElement(n,1):e.scrollToIndex(d)},[d,t]);let j=(0,Z.useRef)(null),M=(0,Z.useRef)({msgIdx:-1,positions:[]}),N=(0,Z.useRef)(-1),oe=(0,Z.useRef)(0),ce=(0,Z.useRef)(0),le=(0,Z.useRef)(()=>{}),ue=(0,Z.useRef)(()=>{}),P=(0,Z.useRef)({matches:[],ptr:0,screenOrd:0,prefixSum:[]}),F=(0,Z.useRef)(-1),de=(0,Z.useRef)(!1);function I(e){let t=A.current.getItemTop(e);return Math.max(0,t-wo)}function fe(e){let n=t.current,{msgIdx:r,positions:i}=M.current;if(!n||i.length===0||r<0){_?.(null);return}let a=Math.max(0,Math.min(e,i.length-1)),o=i[a],s=A.current.getItemTop(r),c=n.getViewportTop(),l=s-n.getScrollTop(),u=n.getViewportHeight(),d=c+l+o.row;(d<c||d>=c+u)&&(n.scrollTo(Math.max(0,s+o.row-wo)),l=s-n.getScrollTop(),d=c+l+o.row),_?.({positions:i,rowOffset:c+l,currentIdx:a});let f=P.current,p=f.prefixSum.at(-1)??0,m=(f.prefixSum[f.ptr]??0)+a+1;h?.(p,m),et(`highlight(i=${r}, ord=${a}/${i.length}): pos={row:${o.row},col:${o.col}} lo=${l} screenRow=${d} badge=${m}/${p}`)}ue.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,et(`seek(i=${n}): no mount after scrollToIndex, skip`),le.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)-wo));let d=g?.(l)??[];if(M.current={msgIdx:n,positions:d},et(`seek(i=${n} t=${i}): ${d.length} positions`),d.length===0){if(++oe.current>20){oe.current=0;return}le.current(r?-1:1);return}oe.current=0;let f=r?d.length-1:0;P.current.screenOrd=f,N.current=-1,ue.current(f);let p=ce.current;p&&(ce.current=0,le.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;_?.(null),M.current={msgIdx:-1,positions:[]},j.current={idx:e,wantLast:n,tries:0};let s=a(e),c=s?.yogaNode?.getComputedHeight()??0;s&&c>0?r.scrollTo(I(e)):o(e),he()}function _e(e){let t=P.current,{matches:n,prefixSum:r}=t,i=r.at(-1)??0;if(n.length===0)return;if(j.current){ce.current=e;return}N.current<0&&(N.current=t.ptr);let{positions:a}=M.current,o=t.screenOrd+e;if(o>=0&&o<a.length){t.screenOrd=o,fe(o),N.current=-1;return}let s=(t.ptr+e+n.length)%n.length;if(s===N.current){_?.(null),N.current=-1,et(`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;h?.(i,c)}le.current=_e,(0,Z.useImperativeHandle)(m,()=>({jumpToIndex:e=>{let n=t.current;n&&n.scrollTo(I(e))},setSearchQuery:e=>{j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1,_?.(null);let n=e.toLowerCase(),r=[],i=[0];if(n){let e=A.current.messages;for(let t=0;t<e.length;t++){let a=c(e[t]),o=a.indexOf(n),s=0;for(;o>=0;)s++,o=a.indexOf(n,o+n.length);s>0&&(r.push(t),i.push(i.at(-1)+s))}}let a=i.at(-1),o=0,s=t.current,{offsets:l,start:u,getItemTop:d}=A.current,f=d(u),p=f>=0?f-l[u]:0;if(r.length>0&&s){let t=F.current>=0?F.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)}et(`setSearchQuery('${e}'): ${r.length} msgs · ptr=${o} msgIdx=${r[o]} curTop=${t} origin=${p}`)}P.current={matches:r,ptr:o,screenOrd:0,prefixSum:i},r.length>0?ge(r[o],!0):F.current>=0&&s&&s.scrollTo(F.current),h?.(a,r.length>0?i[o+1]??a:0)},nextMatch:()=>_e(1),prevMatch:()=>_e(-1),setAnchor:()=>{let e=t.current;e&&(F.current=e.getScrollTop())},disarmSearch:()=>{_?.(null),j.current=null,M.current={msgIdx:-1,positions:[]},N.current=-1},warmSearchIndex:async()=>{if(de.current)return 0;let e=A.current.messages,t=0,n=performance.now();for(let n=0;n<e.length;n+=500){await Ft(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 et(`warmSearchIndex: ${e.length} msgs · work=${Math.round(t)}ms wall=${r}ms chunks=${Math.ceil(e.length/500)}`),de.current=!0,Math.round(t)}}),[t]);let[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)},[]),L=(0,Z.useCallback)(e=>{be.current.setHoveredKey(e)},[]),Se=(0,Z.useCallback)(e=>{be.current.setHoveredKey(t=>t===e?null:t)},[]);return(0,Co.jsxs)(Co.Fragment,{children:[(0,Co.jsx)(l,{ref:E,height:C,flexShrink:0}),e.slice(re,ie).map((e,t)=>{let n=re+t,r=x[n],c=!!a&&(o?.(e)??!0),l=c&&ve===r,u=s?.(e);return(0,Co.jsx)(bo,{itemKey:r,msg:e,idx:n,measureRef:T,expanded:u,hovered:l,clickable:c,onClickK:xe,onEnterK:L,onLeaveK:Se,renderItem:i},r)}),w>0&&(0,Co.jsx)(l,{height:w,flexShrink:0}),u&&(0,Co.jsx)(So,{messages:e,start:re,end:ie,offsets:O,getItemTop:k,getItemElement:ee,scrollRef:t})]})}function So({messages:e,start:t,end:n,offsets:r,getItemTop:i,getItemElement:a,scrollRef:o}){let{setStickyPrompt:s}=(0,Z.useContext)(ho);(0,Z.useSyncExternalStore)((0,Z.useCallback)(e=>o.current?.subscribe(e)??Oo,[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=vo(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,Eo).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,Co,wo,To,Eo,Do,Oo,ko=t((()=>{h(),Z=n(h(),1),Ka(),y(),oe(),go(),Co=S(),$e(),Nt(),ii(),Le(),wo=3,To=new WeakMap,Eo=500,Do=new WeakMap,Oo=()=>{}}));function Ao(e,t){let n=new Set(t),r=new Set;return e.filter(e=>{if(e.type===`system`)return e.subtype!==`api_metrics`;let t=e.message?.content[0];if(e.type===`assistant`)return e.isApiErrorMessage?!0:t?.type===`tool_use`&&t.name&&n.has(t.name)?(`id`in t&&r.add(t.id),!0):!1;if(e.type===`user`)return t?.type===`tool_result`?t.tool_use_id!==void 0&&r.has(t.tool_use_id):!e.isMeta;if(e.type===`attachment`){let t=e.attachment;return t?.type===`queued_command`&&t.commandMode===`prompt`&&!t.isMeta&&t.origin===void 0}return!1})}function jo(e,t){let n=new Set(t),r=new Set,i=[],a=0;for(let t=0;t<e.length;t++){let o=e[t],s=o.message?.content[0];if(o.type===`user`&&s?.type!==`tool_result`&&!o.isMeta){a++;continue}o.type===`assistant`&&(s?.type===`text`?i[t]=a:s?.type===`tool_use`&&s.name&&n.has(s.name)&&r.add(a))}return r.size===0?e:e.filter((e,t)=>{let n=i[t];return n===void 0||!r.has(n)})}function Mo(e,t,n=Ho,r=Uo){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 No(e){return(e.type===`assistant`||e.type===`user`?M(e):null)??e.uuid}function Po(e,t){if(e.size!==t.size)return!1;for(let n of e)if(!t.has(n))return!1;return!0}function Fo(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=M(e);return i?t.has(i)||n.has(i)||T(i,`PostToolUse`,a)?!1:Rr(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 Io,Q,$,Lo,Ro,zo,Bo,Vo,Ho,Uo,Wo,Go,Ko=t((()=>{m(),Io=n(h(),1),Q=n(h(),1),zr(),C(),at(),Ye(),y(),ne(),It(),Re(),Hr(),Gr(),Oe(),ft(),i(),We(),Xr(),R(),Tt(),ii(),ia(),ge(),ba(),Le(),ie(),Ca(),L(),Ia(),$=S(),ko(),Lo=Io.memo(function({agentDefinitions:e}){return(0,$.jsx)(z,{children:(0,$.jsxs)(l,{flexDirection:`column`,gap:1,children:[(0,$.jsx)(ta,{}),(0,$.jsx)(Io.Suspense,{fallback:null,children:(0,$.jsx)(Ma,{agentDefinitions:e})})]})})}),Ro=(Rt(),e(zt)),zo=null,Bo=null,Vo=30,Ho=200,Uo=50,Wo=({messages:e,tools:t,commands:n,verbose:i,toolJSX:a,toolUseConfirmQueue:o,inProgressToolUseIDs:c,isMessageSelectorVisible:u,conversationId:p,screen:m,streamingToolUses:h,showAllInTranscript:g=!1,agentDefinitions:_,hideLogo:y=!1,isLoading:x,hidePastThinking:S=!1,streamingThinking:C,streamingText:T,isBriefOnly:E=!1,unseenDivider:D,scrollRef:k,trackStickyPrompt:ne,jumpRef:ie,onSearchMatchesChange:ae,scanElement:A,setPositions:M,disableRenderCap:N=!1,cursor:oe=null,setCursor:se,cursorNavRef:le,renderRange:P})=>{let{columns:F}=v(),de=j(`transcript:toggleShowAll`,`Transcript`,`Ctrl+E`),I=(0,Q.useMemo)(()=>Te(e).filter(Ue),[e]),pe=(0,Q.useMemo)(()=>C?C.isStreaming?!0:C.streamingEndedAt?Date.now()-C.streamingEndedAt<3e4:!1:!1,[C]),{lastThinkingBlockId:me,latestBashOutputUUID:he}=(0,Q.useMemo)(()=>{let e=null,t=null,n=S&&!pe;S&&pe&&(e=`streaming`);for(let r=I.length-1;r>=0;r--){let i=I[r];if(i?.type===`user`){let r=i.message.content;if(!t){for(let e of r)if(e.type===`text`){let n=e.text??``;if(n.startsWith(`<bash-stdout`)||n.startsWith(`<bash-stderr`)){t=i.uuid;break}}}n&&!e&&(r.some(e=>e.type===`tool_result`)||(e=`no-thinking`))}else if(i?.type===`assistant`&&n&&!e){let t=i.message.content;for(let n=t.length-1;n>=0;n--)if(t[n]?.type===`thinking`){e=`${i.uuid}:${n}`;break}}if(e!==null&&t)break}return S||(e=null),{lastThinkingBlockId:e,latestBashOutputUUID:t}},[I,S,pe]),ge=(0,Q.useMemo)(()=>ve(I),[I]),_e=(0,Q.useMemo)(()=>h.filter(e=>!c.has(e.contentBlock.id)&&!ge.has(e.contentBlock.id)),[h,c,ge]),xe=(0,Q.useMemo)(()=>_e.flatMap(e=>{let t=Ie({content:[e.contentBlock]});return t.uuid=ue(e.contentBlock.id,0),Te([t])}),[_e]),L=m===`transcript`,Se=(0,Q.useMemo)(()=>r(process.env.CLAUDE_CODE_DISABLE_VIRTUAL_SCROLL),[]),Ce=k!=null&&!Se,we=L&&!g&&!Ce,Oe=(0,Q.useRef)(null),R=(0,Q.useRef)(null),{collapsed:Ae,lookups:z,hasTruncatedMessages:je,hiddenMessageCount:Me}=(0,Q.useMemo)(()=>{let e=Ee((i||De()?I:re(I,{includeSnipped:!0})).filter(e=>e.type!==`progress`&&!xa(e)&&ke(e,L)),xe),n=[zo,Bo].filter(e=>e!==null),r=[zo].filter(e=>e!==null),a=n.length>0&&!L?E?Ao(e,n):r.length>0?jo(e,r):e:e,o=we?a.slice(-30):a,s=we&&a.length>Vo,{messages:c}=Jr(o,t,i),l=Vr(Wr(be(c,t)),i),u=qe(I,o),d=(()=>{let e=o.at(-1);return e?.type===`assistant`?e.message?.id:void 0})(),f;if(R.current&&R.current.key===u)f=R.current.lookups;else if(R.current&&I.length>=R.current.normalizedCount&&o.length>=R.current.messageCount&&R.current.lastAssistantMsgId===d){let e=ze(R.current.lookups,R.current.normalizedCount,R.current.messageCount,I,o);e?(f=e,R.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d}):(f=ee(I,o),R.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d})}else f=ee(I,o),R.current={key:u,lookups:f,normalizedCount:I.length,messageCount:o.length,lastAssistantMsgId:d};let p=e.length-Vo;return{collapsed:l,lookups:f,hasTruncatedMessages:s,hiddenMessageCount:p}},[i,I,L,xe,we,t,E]),Ne=(0,Q.useMemo)(()=>{let e=!Ce&&!N?Mo(Ae,Oe):0;return P?Ae.slice(P[0],P[1]):e>0?Ae.slice(e):Ae},[Ae,P,Ce,N]),Pe=(0,Q.useMemo)(()=>new Set(h.map(e=>e.contentBlock.id)),[h]),{dividerBeforeIndex:Fe,selectedIdx:Le}=(0,Q.useMemo)(()=>{if(!D&&!oe)return{dividerBeforeIndex:-1,selectedIdx:-1};let e=-1,t=-1,n=D?.firstUnseenUuid.slice(0,24);for(let r=0;r<Ne.length;r++){let i=Ne[r];if(e===-1&&n&&i.uuid.slice(0,24)===n&&(e=r),t===-1&&oe&&i.uuid===oe.uuid&&(t=r),e!==-1&&t!==-1)break}return{dividerBeforeIndex:e,selectedIdx:t}},[D,oe,Ne]),[Re,Be]=(0,Q.useState)(()=>new Set),Ve=(0,Q.useCallback)(e=>{let t=No(e);Be(e=>{let n=new Set(e);return n.has(t)?n.delete(t):n.add(t),n})},[]),He=(0,Q.useCallback)(e=>Re.size>0&&Re.has(No(e)),[Re]),We=(0,Q.useRef)(z);We.current=z;let Ge=(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&&O(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=We.current.toolUseByToolUseID.get(n.tool_use_id??``)?.name;return(r?Lt(t,r):void 0)?.isResultTruncated?.(e.toolUseResult)??!1},[t]),Ke=(!a||!!a.shouldContinueAnimation)&&!o.length&&!u,Je=c.size>0,{progress:Ye}=f(),Xe=(0,Q.useRef)(null),Ze=dt().terminalProgressBarEnabled&&!w()&&!(Ro?.isProactiveActive()??!1);(0,Q.useEffect)(()=>{let e=Ze?Je?`indeterminate`:`completed`:null;Xe.current!==e&&(Xe.current=e,Ye(e))},[Ye,Ze,Je]),(0,Q.useEffect)(()=>()=>Ye(null),[Ye]);let Qe=(0,Q.useCallback)(e=>`${e.uuid}-${p}`,[p]),$e=(e,r)=>{let a=r>0?Ne[r-1]?.type:void 0,o=e.type===`user`&&a===`user`,u=e.type===`collapsed_read_search`&&(!!T||da(Ne,r,t,Pe)),d=Ne.length-1-r>0,f=Qe(e),p=(0,$.jsx)(ya,{message:e,isUserContinuation:o,hasContentAfter:u,tools:t,commands:n,verbose:i||He(e)||oe?.expanded===!0&&r===Le,inProgressToolUseIDs:c,streamingToolUseIDs:Pe,screen:m,canAnimate:Ke,lastThinkingBlockId:me,latestBashOutputUUID:he,columns:F,isLoading:x,lookups:z,shouldCollapseDiffs:d},f),h=(0,$.jsx)(ce.Provider,{value:r===Le,children:p},f);return D&&r===Fe?[(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(s,{title:`${D.count} new ${wt(D.count,`message`)}`,width:F,color:`inactive`})},`unseen-divider`),h]:h},et=(0,Q.useRef)(new WeakMap),tt=(0,Q.useCallback)(e=>{let n=et.current.get(e);if(n!==void 0)return n;let r=Zr(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=z.toolUseByToolUseID.get(n.tool_use_id),a=(i&&Lt(t,i.name))?.extractSearchText?.(e.toolUseResult);a!==void 0&&(r=a)}}let i=r.toLowerCase();return et.current.set(e,i),i},[t,z]);return(0,$.jsxs)($.Fragment,{children:[!y&&!(P&&P[0]>0)&&(0,$.jsx)(Lo,{agentDefinitions:_}),je&&(0,$.jsx)(s,{title:`${de} to show ${b.bold(Me)} previous messages`,width:F}),L&&g&&Me>0&&!N&&(0,$.jsx)(s,{title:`${de} to hide ${b.bold(Me)} previous messages`,width:F}),Ce?(0,$.jsx)(te.Provider,{value:!0,children:(0,$.jsx)(xo,{messages:Ne,scrollRef:k,columns:F,itemKey:Qe,renderItem:$e,onItemClick:Ve,isItemClickable:Ge,isItemExpanded:He,trackStickyPrompt:ne,selectedIndex:Le>=0?Le:void 0,cursorNavRef:le,setCursor:se,jumpRef:ie,onSearchMatchesChange:ae,scanElement:A,setPositions:M,extractSearchText:tt})}):Ne.flatMap($e),T&&!E&&(0,$.jsx)(l,{alignItems:`flex-start`,flexDirection:`row`,marginTop:1,width:`100%`,children:(0,$.jsxs)(l,{flexDirection:`row`,children:[(0,$.jsx)(l,{minWidth:2,children:(0,$.jsx)(d,{color:`text`,children:ot})}),(0,$.jsx)(l,{flexDirection:`column`,children:(0,$.jsx)(ye,{children:T})})]})}),pe&&C&&!E&&(0,$.jsx)(l,{marginTop:1,children:(0,$.jsx)(fe,{param:{type:`thinking`,thinking:C.thinking},addMargin:!1,isTranscriptMode:!0,verbose:i,hideInTranscript:!1})})]})},Go=Io.memo(Wo,(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`&&Po(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{go as a,Xa as c,Lr as d,so as i,Za as l,Ko as n,io as o,co as r,ro as s,Go as t,Ir as u};
@@ -1 +0,0 @@
1
- import{o as e}from"./rolldown-runtime-DaDcL9Zw.js";import{d as t,o as n}from"./envUtils-DSxRz_kt.js";import{Gt as r,H as i,I as a,Lt as o,P as s,fi as c,kt as l,t as u}from"./src-CDCSSo0U2.js";import{t as d}from"./jsx-runtime-Bb4Xn-E0.js";import{Bp as f,Pw as p,nm as m,pp as h,tm as g,zp as _}from"./loadAgentsDir-ByO8eJqU.js";import{Gt as v,Jt as y}from"./settings-hQDLwPVj.js";import{g as b,s as x}from"./config-CE058cvr.js";import{n as S,r as C}from"./analytics-CkYUHW_U.js";import{Bt as w,Ht as T,Sr as E,xr as D}from"./model-CwO-g1RW.js";import{c as O,i as k,s as A}from"./terminalSetup-DlaFWI81.js";import{t as j}from"./WelcomeV2-Ci9VwPYh.js";import{n as M,t as N}from"./useExitOnCtrlCDWithKeybindings-Cce612uS.js";import{n as P,t as F}from"./ThemePicker-EQ6hPUeI.js";import{n as I,t as L}from"./PressEnterToContinue-Dl9Hg9Mf.js";import{t as R}from"./ApproveApiKey-CEIfuUh0.js";n();var z=e(c(),1),B=d();S(),y(),b(),D(),w(),p(),k(),N(),u(),u(),h(),m(),f(),P(),I(),u();var V=(0,z.createContext)({marker:``});function H({children:e}){let{marker:t}=(0,z.useContext)(V);return(0,B.jsxs)(a,{gap:1,children:[(0,B.jsx)(s,{dimColor:!0,children:t}),(0,B.jsx)(a,{flexDirection:`column`,children:e})]})}u();var U=(0,z.createContext)({marker:``});function W({children:e}){let{marker:t}=(0,z.useContext)(U),n=0;for(let t of z.Children.toArray(e))!(0,z.isValidElement)(t)||t.type!==H||n++;let r=String(n).length;return(0,B.jsx)(a,{flexDirection:`column`,children:z.Children.map(e,(e,n)=>{if(!(0,z.isValidElement)(e)||e.type!==H)return e;let i=`${String(n+1).padStart(r)}.`,a=`${t}${i}`;return(0,B.jsx)(U.Provider,{value:{marker:a},children:(0,B.jsx)(V.Provider,{value:{marker:a},children:e})})})})}W.Item=H;var G=W;u();function K({onDone:e}){let[n,c]=(0,z.useState)(0),[u,d]=(0,z.useState)(!1),[f]=(0,z.useState)(()=>T()),[p,m]=i();(0,z.useEffect)(()=>{C(`tengu_began_setup`,{oauthEnabled:f})},[f]);function h(){if(n<N.length-1){let e=n+1;c(e),C(`tengu_onboarding_step`,{oauthEnabled:f,stepId:N[e]?.id})}else e()}function y(e){m(e),h()}let b=M(),S=(0,B.jsx)(a,{marginX:1,children:(0,B.jsx)(F,{onThemeSelect:y,showIntroText:!0,helpText:`To change this later, run /theme`,hideEscToCancel:!0,skipExitHandling:!0})}),w=(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Before you start, keep in mind:`}),(0,B.jsx)(a,{flexDirection:`column`,width:70,children:(0,B.jsxs)(G,{children:[(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Always review changes before accepting`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Claude can make mistakes — especially when running commands`,(0,B.jsx)(l,{}),`or editing files. You stay in control of every action.`,(0,B.jsx)(l,{})]})]}),(0,B.jsxs)(G.Item,{children:[(0,B.jsx)(s,{children:`Only use Claude Code on projects you trust`}),(0,B.jsxs)(s,{dimColor:!0,wrap:`wrap`,children:[`Untrusted code could contain prompt injection attacks.`,(0,B.jsx)(l,{}),(0,B.jsx)(o,{url:`https://code.claude.com/docs/en/security`})]})]})]})}),(0,B.jsx)(L,{})]}),D=(0,z.useMemo)(()=>{if(!process.env.ANTHROPIC_API_KEY||t())return``;let e=E(process.env.ANTHROPIC_API_KEY);if(x(e)===`new`)return e},[]);function k(e){e&&d(!0),h()}let N=[];N.push({id:`theme`,component:S}),D&&N.push({id:`api-key`,component:(0,B.jsx)(R,{customApiKeyTruncated:D,onDone:k})}),f&&N.push({id:`oauth`,component:(0,B.jsx)(q,{skip:u,onSkip:h,children:(0,B.jsx)(g,{onDone:h})})}),N.push({id:`security`,component:w}),O()&&N.push({id:`terminal-setup`,component:(0,B.jsxs)(a,{flexDirection:`column`,gap:1,paddingLeft:1,children:[(0,B.jsx)(s,{bold:!0,children:`Use Claude Code's terminal setup?`}),(0,B.jsxs)(a,{flexDirection:`column`,width:70,gap:1,children:[(0,B.jsxs)(s,{children:[`For the optimal coding experience, enable the recommended settings`,(0,B.jsx)(l,{}),`for your terminal:`,` `,v.terminal===`Apple_Terminal`?`Option+Enter for newlines and visual bell`:`Shift+Enter for newlines`]}),(0,B.jsx)(_,{options:[{label:`Yes, use recommended settings`,value:`install`},{label:`No, maybe later with /terminal-setup`,value:`no`}],onChange:e=>{e===`install`?A(p).catch(()=>{}).finally(h):h()},onCancel:()=>h()}),(0,B.jsx)(s,{dimColor:!0,children:b.pending?(0,B.jsxs)(B.Fragment,{children:[`Press `,b.keyName,` again to exit`]}):(0,B.jsx)(B.Fragment,{children:`Enter to confirm · Esc to skip`})})]})]})});let P=N[n],I=(0,z.useCallback)(()=>{n===N.length-1?e():h()},[n,N.length,f,e]),V=(0,z.useCallback)(()=>{h()},[n,N.length,f,e]);return r({"confirm:yes":I},{context:`Confirmation`,isActive:P?.id===`security`}),r({"confirm:no":V},{context:`Confirmation`,isActive:P?.id===`terminal-setup`}),(0,B.jsxs)(a,{flexDirection:`column`,children:[(0,B.jsx)(j,{}),(0,B.jsxs)(a,{flexDirection:`column`,marginTop:1,children:[P?.component,b.pending&&(0,B.jsx)(a,{padding:1,children:(0,B.jsxs)(s,{dimColor:!0,children:[`Press `,b.keyName,` again to exit`]})})]})]})}function q({skip:e,onSkip:t,children:n}){return(0,z.useEffect)(()=>{e&&t()},[e,t]),e?null:n}export{K as Onboarding};
@@ -1 +0,0 @@
1
- import{n as e,o as t}from"./rolldown-runtime-DaDcL9Zw.js";import{Gr as n,I as r,P as i,fi as a,ot as o,t as s}from"./src-CDCSSo0U2.js";import{t as c}from"./jsx-runtime-Bb4Xn-E0.js";import{xw as l}from"./loadAgentsDir-ByO8eJqU.js";import{S as u,w as d,y as f}from"./startupProfiler-DCn_NxMH.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:i,overlay:a}){let{rows:s}=o(),c=a?5:Math.min(6,Math.max(1,s-3));if(e.length===0)return null;let l=i??Math.max(...e.map(e=>n(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)(r,{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(a(),1),l(),s(),f(),_=c(),v=(0,g.memo)(function({item:e,maxColumnWidth:t,isSelected:r}){let a=o().columns;if(m(e.id)){let t=p(e.id),o=r?`suggestion`:void 0,s=!r,c=e.id.startsWith(`file-`),l=e.id.startsWith(`mcp-resource-`),f=e.description?3:0,m;if(c){let t=e.description?Math.min(20,n(e.description)):0,r=a-2-4-f-t;m=u(e.displayText,r)}else m=l?d(e.displayText,30):e.displayText;let h=a-2-n(m)-f-4,g;if(e.description){let n=Math.max(0,h),r=d(e.description.replace(/\s+/g,` `),n);g=`${t} ${m} – ${r}`}else g=`${t} ${m}`;return(0,_.jsx)(i,{color:o,dimColor:s,wrap:`truncate`,children:g})}let s=Math.floor(a*.4),c=Math.min(t??n(e.displayText)+5,s),l=e.color||(r?`suggestion`:void 0),f=!r,h=e.displayText;n(h)>c-2&&(h=d(h,c-2));let g=h+` `.repeat(Math.max(0,c-n(h))),v=e.tag?`[${e.tag}] `:``,y=n(v),b=Math.max(0,a-c-y-4),x=e.description?d(e.description.replace(/\s+/g,` `),b):``;return(0,_.jsxs)(i,{wrap:`truncate`,children:[(0,_.jsx)(i,{color:l,dimColor:f,children:g}),v?(0,_.jsx)(i,{color:e.tag===`local`?`ansi:yellow`:void 0,dimColor:e.tag!==`local`,children:v}):null,(0,_.jsx)(i,{color:r?`suggestion`:void 0,dimColor:!r,children:x})]})}),y=(0,g.memo)(h)}));export{y as n,b as r,h as t};
@@ -1 +0,0 @@
1
- import{n as e}from"./rolldown-runtime-DaDcL9Zw.js";import{I as t,P as n,fi as r,t as i}from"./src-CDCSSo0U2.js";import{t as a}from"./jsx-runtime-Bb4Xn-E0.js";import{Fw as o,Hw as s,Iw as c,Uw as l}from"./loadAgentsDir-ByO8eJqU.js";import{Gt as u,Jt as d}from"./settings-hQDLwPVj.js";import{c as f,g as p}from"./config-CE058cvr.js";import{i as m,o as h}from"./platform-DCXXznJg.js";import{et as g,rt as _,tt as v}from"./model-CwO-g1RW.js";import{a as y,i as b,r as x}from"./terminalSetup-DlaFWI81.js";function S(){return f().editorMode===`vim`}function C(){return u.terminal===`Apple_Terminal`&&process.platform===`darwin`||y()?`shift + ⏎ for newline`:x()?`\\⏎ for newline`:`backslash (\\) + return (⏎) for newline`}function w(e,t){return t.ctrl||t.meta||t.escape||t.return||t.tab||t.backspace||t.delete||t.upArrow||t.downArrow||t.leftArrow||t.rightArrow||t.pageUp||t.pageDown||t.home||t.end?!1:e.length>0&&!/^\s/.test(e)&&!e.startsWith(`\x1B`)}var T=e((()=>{b(),p(),d()}));function E(e){return e.replace(/\+/g,` + `)}function D(e){let{dimColor:r,fixedWidth:i,gap:a,paddingX:o}=e,s=E(c(`app:toggleTranscript`,`Global`,`ctrl+o`)),u=E(c(`app:toggleTodos`,`Global`,`ctrl+t`)),d=E(c(`chat:undo`,`Chat`,`ctrl+_`)),f=E(c(`chat:stash`,`Chat`,`ctrl+s`)),p=E(c(`chat:cycleMode`,`Chat`,`shift+tab`)),h=E(c(`chat:modelPicker`,`Chat`,`alt+p`)),g=E(c(`chat:fastMode`,`Chat`,`alt+o`)),y=E(c(`chat:externalEditor`,`Chat`,`ctrl+g`));E(c(`app:toggleTerminal`,`Global`,`meta+j`));let b=E(c(`chat:imagePaste`,`Chat`,`ctrl+v`));return(0,O.jsxs)(t,{paddingX:o,flexDirection:`row`,gap:a,children:[(0,O.jsxs)(t,{flexDirection:`column`,width:i?24:void 0,children:[(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`! for bash mode`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/ for commands`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`@ for file paths`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`& for background`})}),(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/btw for side question`})})]}),(0,O.jsxs)(t,{flexDirection:`column`,width:i?35:void 0,children:[(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`double tap esc to clear input`})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[p,` `,process.env.USER_TYPE===`ant`?`to cycle modes`:`to auto-accept edits`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[s,` for verbose output`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[u,` to toggle tasks`]})}),null,(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:C()})})]}),(0,O.jsxs)(t,{flexDirection:`column`,children:[(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[d,` to undo`]})}),m()!==`windows`&&(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`ctrl + z to suspend`})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[b,` to paste images`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[h,` to switch model`]})}),_()&&v()&&(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[g,` to toggle fast mode`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[f,` to stash prompt`]})}),(0,O.jsx)(t,{children:(0,O.jsxs)(n,{dimColor:r,children:[y,` to edit in $EDITOR`]})}),l()&&(0,O.jsx)(t,{children:(0,O.jsx)(n,{dimColor:r,children:`/keybindings to customize`})})]})]})}var O,k=e((()=>{r(),i(),h(),s(),o(),g(),T(),O=a()}));export{S as a,w as i,k as n,T as r,D as t};
@@ -1 +0,0 @@
1
- import{a as e}from"./rolldown-runtime-DaDcL9Zw.js";import{l as t,o as n,s as r}from"./envUtils-DSxRz_kt.js";import{n as i,t as a}from"./defineProperty-C-QyHrDq.js";import{Kr as o,qr as s}from"./src-CDCSSo0U2.js";import{$ as c,$t as l,Ot as u,en as d,mt as f,wt as p}from"./state-C2OSZkV1.js";import{$ as m,Ac as h,Cb as g,Do as _,Fy as v,Gn as y,Iy as b,Kn as ee,LS as x,Mv as te,Pd as S,Py as C,RS as w,SD as T,Sa as ne,Sb as re,Sn as ie,Ta as ae,Yg as E,Yi as oe,Yx as D,Zx as O,ay as se,cy as k,dc as ce,dx as le,eo as ue,et as A,fc as j,jd as M,jr as N,jv as P,kc as F,ko as de,lc as fe,lr as I,lt as pe,ny as me,qi as he,rt as ge,si as L,uc as R,ut as z,xD as B,xh as V,xn as _e,yh as H}from"./loadAgentsDir-ByO8eJqU.js";import{n as ve,t as ye}from"./cwd-C5ce-7WB.js";import{N as be,P as xe,c as Se,g as Ce}from"./config-CE058cvr.js";import{J as we,i as Te,o as Ee}from"./log-CZ0zYP_c.js";import{C as De,Y as U,_ as Oe,et as W,u as ke}from"./model-CwO-g1RW.js";import{Sn as Ae,it as je,st as G,xn as Me}from"./prompt-B7joRiqj.js";import{U as Ne,gt as Pe,vt as Fe}from"./sessionState-CjNY991n.js";import{a as Ie,n as Le,r as Re}from"./mappers-CHRFic5q.js";import{c as ze,n as Be,o as Ve,r as K,s as He}from"./MessageSelector-B88b2ypw.js";import{n as Ue,t as We}from"./systemTheme-Ceakddth.js";import{randomUUID as q}from"crypto";n(),i(),o(),l(),ve(),we(),Ee(),xe(),Me(),Ce(),W(),Ne(),B(),O(),le(),g(),G(),k(),V(),F(),_(),ue(),oe(),N(),y(),_e(),A(),z(),b(),w(),Oe(),E(),M();async function Ge({tools:e,mainLoopModel:t,additionalWorkingDirectories:n,mcpClients:r,customSystemPrompt:i}){let[a,o,s]=await Promise.all([i===void 0?pe(e,t,n,r):Promise.resolve([]),v(),i===void 0?C():Promise.resolve({})]);return{defaultSystemPrompt:a,userContext:o,systemContext:s}}async function Ke({tools:e,commands:t,mcpClients:n,messages:r,readFileState:i,getAppState:a,setAppState:o,customSystemPrompt:s,appendSystemPrompt:c,thinkingConfig:l,agents:u}){let d=ke(),f=a(),{defaultSystemPrompt:p,userContext:m,systemContext:h}=await Ge({tools:e,mainLoopModel:d,additionalWorkingDirectories:Array.from(f.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:n,customSystemPrompt:s}),g=Pe([...s===void 0?p:[s],...c?[c]:[]]),_=r.at(-1),v=_?.type===`assistant`&&_.message.stop_reason===null?r.slice(0,-1):r;return{systemPrompt:g,userContext:m,systemContext:h,toolUseContext:{options:{commands:t,debug:!1,mainLoopModel:d,tools:e,verbose:!1,thinkingConfig:l??(S()===!1?{type:`disabled`}:{type:`adaptive`}),mcpClients:n,mcpResources:{},isNonInteractiveSession:!0,agentDefinitions:{activeAgents:u,allAgents:[]},customSystemPrompt:s,appendSystemPrompt:c},abortController:x(),readFileState:i,getAppState:a,setAppState:o,messages:v,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:()=>{},updateAttributionState:()=>{}},forkContextMessages:v}}w(),Oe(),P(),E(),We(),M(),Le(),R();var qe=()=>{try{return K(),e(Be)}catch{return null}},J=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??x(),this.permissionDenials=[],this.readFileState=e.readFileCache,this.totalUsage=Fe}async*submitMessage(e,n){let{cwd:i,commands:a,tools:o,mcpClients:l,verbose:g=!1,thinkingConfig:_,maxTurns:v,maxBudgetUsd:y,taskBudget:b,canUseTool:x,customSystemPrompt:C,appendSystemPrompt:w,userSpecifiedModel:E,fallbackModel:oe,jsonSchema:D,getAppState:O,setAppState:k,replayUserMessages:le=!1,includePartialMessages:ue=!1,agents:A=[],setSDKStatus:M,orphanedPermission:N}=this.config;this.discoveredSkillNames.clear(),this.permissionDenials=[],te(i);let P=!d(),F=Date.now(),pe=async(e,t,n,r,i,a)=>{let o=await x(e,t,n,r,i,a);return o.behavior!==`allow`&&this.permissionDenials.push({type:`permission_denial`,tool_name:He(e.name),tool_use_id:i,tool_input:t}),o},R=O(),z=E?De(E):ke(),B=_||(S()===!1?{type:`disabled`}:{type:`adaptive`});H(`before_getSystemPrompt`);let V=typeof C==`string`?C:void 0,{defaultSystemPrompt:_e,userContext:ve,systemContext:xe}=await Ge({tools:o,mainLoopModel:z,additionalWorkingDirectories:Array.from(R.toolPermissionContext.additionalWorkingDirectories.keys()),mcpClients:l,customSystemPrompt:V});H(`after_getSystemPrompt`);let Ce={...ve},we=V!==void 0&&be()?await ee():null,Ee=Pe([...V===void 0?_e:[V],...we?[we]:[],...w?[w]:[]]),Oe=o.some(e=>Ae(e,je));D&&Oe&&ie(k,f());let W={messages:this.mutableMessages,setMessages:e=>{this.mutableMessages=e(this.mutableMessages)},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:g,mainLoopModel:z,thinkingConfig:B,mcpClients:l,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:w,agentDefinitions:{activeAgents:A,allAgents:[]},theme:Ue(Se().theme),maxBudgetUsd:y},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:e=>{k(t=>{let n=e(t.fileHistory);return n===t.fileHistory?t:{...t,fileHistory:n}})},updateAttributionState:e=>{k(t=>{let n=e(t.attribution);return n===t.attribution?t:{...t,attribution:n}})},setSDKStatus:M};if(N&&!this.hasHandledOrphanedPermission){this.hasHandledOrphanedPermission=!0;for await(let e of fe(N,o,this.mutableMessages,W))yield e}let{messages:G,shouldQuery:Me,allowedTools:Ne,model:Le,resultText:Be}=await ze({input:e,mode:`prompt`,setToolJSX:()=>{},context:{...W,messages:this.mutableMessages},messages:this.mutableMessages,uuid:n?.uuid,isMeta:n?.isMeta,querySource:`sdk`});this.mutableMessages.push(...G);let K=[...this.mutableMessages];if(P&&G.length>0){let e=L(K);r()||(await e,(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I())}let We=qe(),Ke=G.filter(e=>e.type===`user`&&!e.isMeta&&!e.toolUseResult&&(We?.selectableUserMessagesFilter(e)??!0)||e.type===`system`&&e.subtype===`compact_boundary`),J=le?Ke:[];k(e=>({...e,toolPermissionContext:{...e.toolPermissionContext,alwaysAllowRules:{...e.toolPermissionContext.alwaysAllowRules,command:Ne}}}));let Y=Le??z;W={messages:K,setMessages:()=>{},onChangeAPIKey:()=>{},handleElicitation:this.config.handleElicitation,options:{commands:a,debug:!1,tools:o,verbose:g,mainLoopModel:Y,thinkingConfig:B,mcpClients:l,mcpResources:{},ideInstallationStatus:null,isNonInteractiveSession:!0,customSystemPrompt:C,appendSystemPrompt:w,theme:Ue(Se().theme),agentDefinitions:{activeAgents:A,allAgents:[]},maxBudgetUsd:y},getAppState:O,setAppState:k,abortController:this.abortController,readFileState:this.readFileState,nestedMemoryAttachmentTriggers:new Set,loadedNestedMemoryPaths:this.loadedNestedMemoryPaths,dynamicSkillDirTriggers:new Set,discoveredSkillNames:this.discoveredSkillNames,setInProgressToolUseIDs:()=>{},setResponseLength:()=>{},updateFileHistoryState:W.updateFileHistoryState,updateAttributionState:W.updateAttributionState,setSDKStatus:M},H(`before_skills_plugins`);let[Je,{enabled:Ye}]=await Promise.all([he(ye()),de()]);if(H(`after_skills_plugins`),yield Ve({tools:o,mcpClients:l,model:Y,permissionMode:R.toolPermissionContext.mode,commands:a,agents:A,skills:Je,plugins:Ye,fastMode:R.fastMode}),H(`system_message_yielded`),!Me){for(let e of G)if(e.type===`user`&&typeof e.message.content==`string`&&(e.message.content.includes(`<local-command-stdout>`)||e.message.content.includes(`<local-command-stderr>`)||e.isCompactSummary)&&(yield{type:`user`,message:{...e.message,content:s(e.message.content)},session_id:f(),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 Re(e.content,e.uuid)),e.type===`system`&&e.subtype===`compact_boundary`){let t=e;yield{type:`system`,subtype:`compact_boundary`,session_id:f(),uuid:e.uuid,compact_metadata:Ie(t.compactMetadata)}}P&&(await L(K),(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I()),yield{type:`result`,subtype:`success`,is_error:!1,duration_ms:Date.now()-F,duration_api_ms:p(),num_turns:K.length-1,result:Be??``,stop_reason:null,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,fast_mode_state:U(Y,R.fastMode),uuid:q()};return}if(me()&&P){let e=qe()?.selectableUserMessagesFilter??(e=>!0);G.filter(e).forEach(e=>{se(e=>{k(t=>({...t,fileHistory:e(t.fileHistory)}))},e.uuid)})}let X=Fe,Z=1,Xe=!1,Ze,Q=null,Qe=Te().at(-1),$e=D?ae(this.mutableMessages,je):0;for await(let e of h({messages:K,systemPrompt:Ee,userContext:Ce,systemContext:xe,canUseTool:pe,toolUseContext:W,fallbackModel:oe,querySource:`sdk`,maxTurns:v,taskBudget:b})){if(e.type===`assistant`||e.type===`user`||e.type===`system`&&e.subtype===`compact_boundary`){if(P&&e.type===`system`&&e.subtype===`compact_boundary`){let t=e.compactMetadata?.preservedSegment?.tailUuid;if(t){let e=this.mutableMessages.findLastIndex(e=>e.uuid===t);e!==-1&&await L(this.mutableMessages.slice(0,e+1))}}if(K.push(e),P&&(e.type===`assistant`?L(K):await L(K)),!Xe&&J.length>0){Xe=!0;for(let e of J)e.type===`user`&&(yield{type:`user`,message:e.message,session_id:f(),parent_tool_use_id:null,uuid:e.uuid,timestamp:e.timestamp,isReplay:!0})}}switch(e.type===`user`&&Z++,e.type){case`tombstone`:break;case`assistant`:{let t=e,n=t.message?.stop_reason;n!=null&&(Q=n),this.mutableMessages.push(t),yield*j(t);break}case`progress`:{let t=e;this.mutableMessages.push(t),P&&(K.push(t),L(K)),yield*j(t);break}case`user`:{let t=e;this.mutableMessages.push(t),yield*j(t);break}case`stream_event`:{let t=e.event;if(t.type===`message_start`){X=Fe;let e=t.message;X=ge(X,e.usage)}if(t.type===`message_delta`){X=ge(X,t.usage);let e=t.delta;e.stop_reason!=null&&(Q=e.stop_reason)}t.type===`message_stop`&&(this.totalUsage=m(this.totalUsage,X)),ue&&(yield{type:`stream_event`,event:t,session_id:f(),parent_tool_use_id:null,uuid:q()});break}case`attachment`:{let n=e;this.mutableMessages.push(n),P&&(K.push(n),L(K));let r=n.attachment;if(r.type===`structured_output`)Ze=r.data;else if(r.type===`max_turns_reached`){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I(),yield{type:`result`,subtype:`error_max_turns`,duration_ms:Date.now()-F,duration_api_ms:p(),is_error:!0,num_turns:r.turnCount,stop_reason:Q,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,fast_mode_state:U(Y,R.fastMode),uuid:q(),errors:[`Reached maximum number of turns (${r.maxTurns})`]};return}else le&&r.type===`queued_command`&&(yield{type:`user`,message:{role:`user`,content:r.prompt},session_id:f(),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=K.length-1;r>0&&K.splice(0,r),yield{type:`system`,subtype:`compact_boundary`,session_id:f(),uuid:t.uuid,compact_metadata:Ie(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:re(e.error),session_id:f(),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:f(),uuid:t.uuid};break}}if(y!==void 0&&u()>=y){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I(),yield{type:`result`,subtype:`error_max_budget_usd`,duration_ms:Date.now()-F,duration_api_ms:p(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,fast_mode_state:U(Y,R.fastMode),uuid:q(),errors:[`Reached maximum budget ($${y}). Increase the limit with --max-budget-usd or start a new session.`]};return}if(e.type===`user`&&D){let e=ae(this.mutableMessages,je)-$e,n=parseInt(process.env.MAX_STRUCTURED_OUTPUT_RETRIES||`5`,10);if(e>=n){P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I(),yield{type:`result`,subtype:`error_max_structured_output_retries`,duration_ms:Date.now()-F,duration_api_ms:p(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,fast_mode_state:U(Y,R.fastMode),uuid:q(),errors:[`Failed to provide valid structured output after ${n} attempts`]};return}}}let $=K.findLast(e=>e.type===`assistant`||e.type===`user`),et=$?.type??`undefined`,tt=$?.type===`assistant`?T($.message.content)?.type??`none`:`n/a`;if(P&&(t(process.env.CLAUDE_CODE_EAGER_FLUSH)||t(process.env.CLAUDE_CODE_IS_COWORK))&&await I(),!ce($,Q)){yield{type:`result`,subtype:`error_during_execution`,duration_ms:Date.now()-F,duration_api_ms:p(),is_error:!0,num_turns:Z,stop_reason:Q,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,fast_mode_state:U(Y,R.fastMode),uuid:q(),errors:(()=>{let e=Te(),t=Qe?e.lastIndexOf(Qe)+1:0;return[`[ede_diagnostic] result_type=${et} last_content_type=${tt} stop_reason=${Q}`,...e.slice(t).map(e=>e.error)]})()};return}let nt=``,rt=!1;if($.type===`assistant`){let e=T($.message.content);e?.type===`text`&&!ne.has(e.text)&&(nt=e.text),rt=!!$.isApiErrorMessage}yield{type:`result`,subtype:`success`,is_error:rt,duration_ms:Date.now()-F,duration_api_ms:p(),num_turns:Z,result:nt,stop_reason:Q,session_id:f(),total_cost_usd:u(),usage:this.totalUsage,modelUsage:c(),permission_denials:this.permissionDenials,structured_output:Ze,fast_mode_state:U(Y,R.fastMode),uuid:q()}}interrupt(){this.abortController.abort()}resetAbortController(){this.abortController=x()}getAbortSignal(){return this.abortController.signal}getMessages(){return this.mutableMessages}getReadFileState(){return this.readFileState}getSessionId(){return f()}setModel(e){this.config.userSpecifiedModel=e}};async function*Y({commands:e,prompt:t,promptUuid:n,isMeta:r,cwd:i,tools:a,mcpClients:o,verbose:s=!1,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,canUseTool:f,mutableMessages:p=[],getReadFileCache:m,setReadFileCache:h,customSystemPrompt:g,appendSystemPrompt:_,userSpecifiedModel:v,fallbackModel:y,jsonSchema:b,getAppState:ee,setAppState:x,abortController:te,replayUserMessages:S=!1,includePartialMessages:C=!1,handleElicitation:w,agents:T=[],setSDKStatus:ne,orphanedPermission:re}){let ie=new J({cwd:i,tools:a,commands:e,mcpClients:o,agents:T??[],canUseTool:f,getAppState:ee,setAppState:x,initialMessages:p,readFileCache:D(m()),customSystemPrompt:g,appendSystemPrompt:_,userSpecifiedModel:v,fallbackModel:y,thinkingConfig:c,maxTurns:l,maxBudgetUsd:u,taskBudget:d,jsonSchema:b,verbose:s,handleElicitation:w,replayUserMessages:S,includePartialMessages:C,setSDKStatus:ne,abortController:te,orphanedPermission:re});try{yield*ie.submitMessage(t,{uuid:n,isMeta:r})}finally{h(ie.getReadFileState())}}export{Y as n,Ke as r,J as t};