@shareai-lab/kode 1.2.0 → 2.0.2

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 (725) hide show
  1. package/README.md +25 -388
  2. package/cli-acp.js +82 -0
  3. package/cli.js +89 -79
  4. package/dist/REPL-GIU4ZIXM.js +42 -0
  5. package/dist/acp-H3VJ77YG.js +1357 -0
  6. package/dist/acp-H3VJ77YG.js.map +7 -0
  7. package/dist/agentsValidate-XP3CFN6F.js +373 -0
  8. package/dist/agentsValidate-XP3CFN6F.js.map +7 -0
  9. package/dist/ask-3G5H5KD5.js +125 -0
  10. package/dist/ask-3G5H5KD5.js.map +7 -0
  11. package/dist/autoUpdater-DNRMJWFQ.js +17 -0
  12. package/dist/chunk-2KWKUXLT.js +490 -0
  13. package/dist/chunk-2KWKUXLT.js.map +7 -0
  14. package/dist/chunk-2PMO2FS2.js +1097 -0
  15. package/dist/chunk-2PMO2FS2.js.map +7 -0
  16. package/dist/chunk-3RUXVV4S.js +23 -0
  17. package/dist/chunk-3RUXVV4S.js.map +7 -0
  18. package/dist/chunk-3TXNP6HH.js +240 -0
  19. package/dist/chunk-3TXNP6HH.js.map +7 -0
  20. package/dist/chunk-4GAIJGRH.js +472 -0
  21. package/dist/chunk-4GAIJGRH.js.map +7 -0
  22. package/dist/chunk-4RTX4AG4.js +249 -0
  23. package/dist/chunk-4RTX4AG4.js.map +7 -0
  24. package/dist/chunk-54DNHKOD.js +511 -0
  25. package/dist/chunk-54DNHKOD.js.map +7 -0
  26. package/dist/chunk-67PY5IX6.js +34 -0
  27. package/dist/chunk-67PY5IX6.js.map +7 -0
  28. package/dist/chunk-6DRDLOLP.js +2613 -0
  29. package/dist/chunk-6DRDLOLP.js.map +7 -0
  30. package/dist/chunk-7CQVZNQV.js +1609 -0
  31. package/dist/chunk-7CQVZNQV.js.map +7 -0
  32. package/dist/chunk-ABLVTESJ.js +19 -0
  33. package/dist/chunk-ABLVTESJ.js.map +7 -0
  34. package/dist/{utils/config.js → chunk-AIMIPK4B.js} +351 -171
  35. package/dist/chunk-AIMIPK4B.js.map +7 -0
  36. package/dist/{utils/autoUpdater.js → chunk-BHGTA6JQ.js} +38 -21
  37. package/dist/chunk-BHGTA6JQ.js.map +7 -0
  38. package/dist/chunk-CIG63V4E.js +72 -0
  39. package/dist/chunk-CIG63V4E.js.map +7 -0
  40. package/dist/chunk-E6YNABER.js +24 -0
  41. package/dist/chunk-E6YNABER.js.map +7 -0
  42. package/dist/chunk-EH34V7CY.js +191 -0
  43. package/dist/chunk-EH34V7CY.js.map +7 -0
  44. package/dist/{cost-tracker.js → chunk-EZXMVTDU.js} +51 -32
  45. package/dist/chunk-EZXMVTDU.js.map +7 -0
  46. package/dist/chunk-FH5CHM6L.js +148 -0
  47. package/dist/chunk-FH5CHM6L.js.map +7 -0
  48. package/dist/chunk-G6I7XROM.js +138 -0
  49. package/dist/chunk-G6I7XROM.js.map +7 -0
  50. package/dist/chunk-HN4E4UUQ.js +96 -0
  51. package/dist/chunk-HN4E4UUQ.js.map +7 -0
  52. package/dist/chunk-HSPVVDIW.js +30198 -0
  53. package/dist/chunk-HSPVVDIW.js.map +7 -0
  54. package/dist/{services/systemReminder.js → chunk-IE2CG2TV.js} +221 -59
  55. package/dist/chunk-IE2CG2TV.js.map +7 -0
  56. package/dist/chunk-JC6NCUG5.js +11 -0
  57. package/dist/chunk-K2MI4TPB.js +1256 -0
  58. package/dist/chunk-K2MI4TPB.js.map +7 -0
  59. package/dist/chunk-KAA5BGMQ.js +12 -0
  60. package/dist/chunk-KAA5BGMQ.js.map +7 -0
  61. package/dist/chunk-MN77D2F7.js +2931 -0
  62. package/dist/chunk-MN77D2F7.js.map +7 -0
  63. package/dist/chunk-NPFOMITO.js +21 -0
  64. package/dist/chunk-NPFOMITO.js.map +7 -0
  65. package/dist/chunk-NQLEUHMS.js +196 -0
  66. package/dist/chunk-NQLEUHMS.js.map +7 -0
  67. package/dist/chunk-OIFQB3S4.js +515 -0
  68. package/dist/chunk-OIFQB3S4.js.map +7 -0
  69. package/dist/chunk-OWTG2W3A.js +164 -0
  70. package/dist/chunk-OWTG2W3A.js.map +7 -0
  71. package/dist/chunk-OZNRLY3E.js +735 -0
  72. package/dist/chunk-OZNRLY3E.js.map +7 -0
  73. package/dist/{utils/debugLogger.js → chunk-QYFKRZQC.js} +107 -204
  74. package/dist/chunk-QYFKRZQC.js.map +7 -0
  75. package/dist/chunk-S3J2TLV6.js +16 -0
  76. package/dist/chunk-S3J2TLV6.js.map +7 -0
  77. package/dist/chunk-S6HRABTA.js +95 -0
  78. package/dist/chunk-S6HRABTA.js.map +7 -0
  79. package/dist/{utils/theme.js → chunk-SDGKPKDK.js} +28 -6
  80. package/dist/chunk-SDGKPKDK.js.map +7 -0
  81. package/dist/chunk-SRZZFAS7.js +766 -0
  82. package/dist/chunk-SRZZFAS7.js.map +7 -0
  83. package/dist/chunk-UKHTVRJM.js +47 -0
  84. package/dist/chunk-UKHTVRJM.js.map +7 -0
  85. package/dist/chunk-UYXEDKOZ.js +24 -0
  86. package/dist/chunk-UYXEDKOZ.js.map +7 -0
  87. package/dist/chunk-VBXVYQYY.js +145 -0
  88. package/dist/chunk-VBXVYQYY.js.map +7 -0
  89. package/dist/chunk-WVHORZQ5.js +17 -0
  90. package/dist/chunk-WVHORZQ5.js.map +7 -0
  91. package/dist/chunk-WWUWDNWW.js +49 -0
  92. package/dist/chunk-WWUWDNWW.js.map +7 -0
  93. package/dist/{utils/model.js → chunk-Z33T5YN5.js} +194 -227
  94. package/dist/chunk-Z33T5YN5.js.map +7 -0
  95. package/dist/{services/openai.js → chunk-ZQU3TXLC.js} +168 -234
  96. package/dist/chunk-ZQU3TXLC.js.map +7 -0
  97. package/dist/cli-SRV2INSL.js +3917 -0
  98. package/dist/cli-SRV2INSL.js.map +7 -0
  99. package/dist/commands-TWH6PGVG.js +46 -0
  100. package/dist/config-6ZMBCL23.js +81 -0
  101. package/dist/context-JQIOOI4W.js +30 -0
  102. package/dist/costTracker-6SL26FDB.js +19 -0
  103. package/dist/customCommands-DNEJS3ZU.js +25 -0
  104. package/dist/customCommands-DNEJS3ZU.js.map +7 -0
  105. package/dist/env-OFAXZ3XG.js +22 -0
  106. package/dist/env-OFAXZ3XG.js.map +7 -0
  107. package/dist/index.js +34 -5
  108. package/dist/index.js.map +4 -4
  109. package/dist/kodeAgentSessionId-X6XWQW7B.js +13 -0
  110. package/dist/kodeAgentSessionId-X6XWQW7B.js.map +7 -0
  111. package/dist/kodeAgentSessionLoad-6N27AC5K.js +18 -0
  112. package/dist/kodeAgentSessionLoad-6N27AC5K.js.map +7 -0
  113. package/dist/kodeAgentSessionResume-HUSAEO24.js +16 -0
  114. package/dist/kodeAgentSessionResume-HUSAEO24.js.map +7 -0
  115. package/dist/kodeAgentStreamJson-NXFN7TXH.js +13 -0
  116. package/dist/kodeAgentStreamJson-NXFN7TXH.js.map +7 -0
  117. package/dist/kodeAgentStreamJsonSession-GRWG3SPE.js +131 -0
  118. package/dist/kodeAgentStreamJsonSession-GRWG3SPE.js.map +7 -0
  119. package/dist/kodeAgentStructuredStdio-HGWJT7CU.js +10 -0
  120. package/dist/kodeAgentStructuredStdio-HGWJT7CU.js.map +7 -0
  121. package/dist/kodeHooks-TDMXFWSO.js +36 -0
  122. package/dist/kodeHooks-TDMXFWSO.js.map +7 -0
  123. package/dist/llm-XVXWYOHK.js +3118 -0
  124. package/dist/llm-XVXWYOHK.js.map +7 -0
  125. package/dist/llmLazy-7TD5N7XP.js +15 -0
  126. package/dist/llmLazy-7TD5N7XP.js.map +7 -0
  127. package/dist/loader-AUXIJTY6.js +28 -0
  128. package/dist/loader-AUXIJTY6.js.map +7 -0
  129. package/dist/mcp-BXJ3K7NZ.js +49 -0
  130. package/dist/mcp-BXJ3K7NZ.js.map +7 -0
  131. package/dist/{services/mentionProcessor.js → mentionProcessor-YD7YXYGF.js} +61 -50
  132. package/dist/mentionProcessor-YD7YXYGF.js.map +7 -0
  133. package/dist/messages-OFUJSPRV.js +63 -0
  134. package/dist/messages-OFUJSPRV.js.map +7 -0
  135. package/dist/model-KPYCXWBK.js +30 -0
  136. package/dist/model-KPYCXWBK.js.map +7 -0
  137. package/dist/openai-5G5D5Q4B.js +29 -0
  138. package/dist/openai-5G5D5Q4B.js.map +7 -0
  139. package/dist/outputStyles-HLDXFQK3.js +28 -0
  140. package/dist/outputStyles-HLDXFQK3.js.map +7 -0
  141. package/dist/package.json +1 -1
  142. package/dist/pluginRuntime-FPTKK6NY.js +218 -0
  143. package/dist/pluginRuntime-FPTKK6NY.js.map +7 -0
  144. package/dist/pluginValidation-DSFXZ4GF.js +17 -0
  145. package/dist/pluginValidation-DSFXZ4GF.js.map +7 -0
  146. package/dist/prompts-LWLAJRS2.js +48 -0
  147. package/dist/prompts-LWLAJRS2.js.map +7 -0
  148. package/dist/query-HVPWL27C.js +50 -0
  149. package/dist/query-HVPWL27C.js.map +7 -0
  150. package/dist/responsesStreaming-AW344PQO.js +10 -0
  151. package/dist/responsesStreaming-AW344PQO.js.map +7 -0
  152. package/dist/ripgrep-YOPCY2GO.js +17 -0
  153. package/dist/ripgrep-YOPCY2GO.js.map +7 -0
  154. package/dist/skillMarketplace-PSNKDINM.js +37 -0
  155. package/dist/skillMarketplace-PSNKDINM.js.map +7 -0
  156. package/dist/state-KNRWP3FO.js +16 -0
  157. package/dist/state-KNRWP3FO.js.map +7 -0
  158. package/dist/theme-7S2QN2FO.js +14 -0
  159. package/dist/theme-7S2QN2FO.js.map +7 -0
  160. package/dist/toolPermissionContext-65L65VEZ.js +17 -0
  161. package/dist/toolPermissionContext-65L65VEZ.js.map +7 -0
  162. package/dist/toolPermissionSettings-GPOBH4IV.js +18 -0
  163. package/dist/toolPermissionSettings-GPOBH4IV.js.map +7 -0
  164. package/dist/tools-FZU2FZBD.js +47 -0
  165. package/dist/tools-FZU2FZBD.js.map +7 -0
  166. package/dist/userInput-VHNBN2MW.js +311 -0
  167. package/dist/userInput-VHNBN2MW.js.map +7 -0
  168. package/dist/uuid-QN2CNKKN.js +9 -0
  169. package/dist/uuid-QN2CNKKN.js.map +7 -0
  170. package/package.json +43 -14
  171. package/scripts/binary-utils.cjs +62 -0
  172. package/scripts/cli-acp-wrapper.cjs +82 -0
  173. package/scripts/cli-wrapper.cjs +105 -0
  174. package/scripts/postinstall.js +135 -9
  175. package/LICENSE +0 -201
  176. package/README.zh-CN.md +0 -312
  177. package/dist/ProjectOnboarding.js +0 -99
  178. package/dist/ProjectOnboarding.js.map +0 -7
  179. package/dist/Tool.js +0 -1
  180. package/dist/commands/agents.js +0 -2087
  181. package/dist/commands/agents.js.map +0 -7
  182. package/dist/commands/approvedTools.js +0 -36
  183. package/dist/commands/approvedTools.js.map +0 -7
  184. package/dist/commands/bug.js +0 -21
  185. package/dist/commands/bug.js.map +0 -7
  186. package/dist/commands/clear.js +0 -37
  187. package/dist/commands/clear.js.map +0 -7
  188. package/dist/commands/compact.js +0 -104
  189. package/dist/commands/compact.js.map +0 -7
  190. package/dist/commands/config.js +0 -20
  191. package/dist/commands/config.js.map +0 -7
  192. package/dist/commands/cost.js +0 -19
  193. package/dist/commands/cost.js.map +0 -7
  194. package/dist/commands/ctx_viz.js +0 -152
  195. package/dist/commands/ctx_viz.js.map +0 -7
  196. package/dist/commands/doctor.js +0 -25
  197. package/dist/commands/doctor.js.map +0 -7
  198. package/dist/commands/help.js +0 -20
  199. package/dist/commands/help.js.map +0 -7
  200. package/dist/commands/init.js +0 -38
  201. package/dist/commands/init.js.map +0 -7
  202. package/dist/commands/listen.js +0 -37
  203. package/dist/commands/listen.js.map +0 -7
  204. package/dist/commands/login.js +0 -37
  205. package/dist/commands/login.js.map +0 -7
  206. package/dist/commands/logout.js +0 -33
  207. package/dist/commands/logout.js.map +0 -7
  208. package/dist/commands/mcp.js +0 -34
  209. package/dist/commands/mcp.js.map +0 -7
  210. package/dist/commands/model.js +0 -41
  211. package/dist/commands/model.js.map +0 -7
  212. package/dist/commands/modelstatus.js +0 -21
  213. package/dist/commands/modelstatus.js.map +0 -7
  214. package/dist/commands/onboarding.js +0 -36
  215. package/dist/commands/onboarding.js.map +0 -7
  216. package/dist/commands/pr_comments.js +0 -61
  217. package/dist/commands/pr_comments.js.map +0 -7
  218. package/dist/commands/refreshCommands.js +0 -37
  219. package/dist/commands/refreshCommands.js.map +0 -7
  220. package/dist/commands/release-notes.js +0 -30
  221. package/dist/commands/release-notes.js.map +0 -7
  222. package/dist/commands/resume.js +0 -35
  223. package/dist/commands/resume.js.map +0 -7
  224. package/dist/commands/review.js +0 -51
  225. package/dist/commands/review.js.map +0 -7
  226. package/dist/commands/terminalSetup.js +0 -163
  227. package/dist/commands/terminalSetup.js.map +0 -7
  228. package/dist/commands.js +0 -84
  229. package/dist/commands.js.map +0 -7
  230. package/dist/components/ApproveApiKey.js +0 -74
  231. package/dist/components/ApproveApiKey.js.map +0 -7
  232. package/dist/components/AsciiLogo.js +0 -12
  233. package/dist/components/AsciiLogo.js.map +0 -7
  234. package/dist/components/AutoUpdater.js +0 -74
  235. package/dist/components/AutoUpdater.js.map +0 -7
  236. package/dist/components/Bug.js +0 -147
  237. package/dist/components/Bug.js.map +0 -7
  238. package/dist/components/Config.js +0 -166
  239. package/dist/components/Config.js.map +0 -7
  240. package/dist/components/ConsoleOAuthFlow.js +0 -188
  241. package/dist/components/ConsoleOAuthFlow.js.map +0 -7
  242. package/dist/components/Cost.js +0 -13
  243. package/dist/components/Cost.js.map +0 -7
  244. package/dist/components/CostThresholdDialog.js +0 -38
  245. package/dist/components/CostThresholdDialog.js.map +0 -7
  246. package/dist/components/CustomSelect/option-map.js +0 -32
  247. package/dist/components/CustomSelect/option-map.js.map +0 -7
  248. package/dist/components/CustomSelect/select-option.js +0 -34
  249. package/dist/components/CustomSelect/select-option.js.map +0 -7
  250. package/dist/components/CustomSelect/select.js +0 -64
  251. package/dist/components/CustomSelect/select.js.map +0 -7
  252. package/dist/components/CustomSelect/theme.js +0 -1
  253. package/dist/components/CustomSelect/use-select-state.js +0 -220
  254. package/dist/components/CustomSelect/use-select-state.js.map +0 -7
  255. package/dist/components/CustomSelect/use-select.js +0 -21
  256. package/dist/components/CustomSelect/use-select.js.map +0 -7
  257. package/dist/components/FallbackToolUseRejectedMessage.js +0 -11
  258. package/dist/components/FallbackToolUseRejectedMessage.js.map +0 -7
  259. package/dist/components/FileEditToolUpdatedMessage.js +0 -32
  260. package/dist/components/FileEditToolUpdatedMessage.js.map +0 -7
  261. package/dist/components/Help.js +0 -41
  262. package/dist/components/Help.js.map +0 -7
  263. package/dist/components/HighlightedCode.js +0 -30
  264. package/dist/components/HighlightedCode.js.map +0 -7
  265. package/dist/components/InvalidConfigDialog.js +0 -83
  266. package/dist/components/InvalidConfigDialog.js.map +0 -7
  267. package/dist/components/Link.js +0 -18
  268. package/dist/components/Link.js.map +0 -7
  269. package/dist/components/LogSelector.js +0 -50
  270. package/dist/components/LogSelector.js.map +0 -7
  271. package/dist/components/Logo.js +0 -94
  272. package/dist/components/Logo.js.map +0 -7
  273. package/dist/components/MCPServerApprovalDialog.js +0 -79
  274. package/dist/components/MCPServerApprovalDialog.js.map +0 -7
  275. package/dist/components/MCPServerDialogCopy.js +0 -11
  276. package/dist/components/MCPServerDialogCopy.js.map +0 -7
  277. package/dist/components/MCPServerMultiselectDialog.js +0 -80
  278. package/dist/components/MCPServerMultiselectDialog.js.map +0 -7
  279. package/dist/components/Message.js +0 -146
  280. package/dist/components/Message.js.map +0 -7
  281. package/dist/components/MessageResponse.js +0 -9
  282. package/dist/components/MessageResponse.js.map +0 -7
  283. package/dist/components/MessageSelector.js +0 -133
  284. package/dist/components/MessageSelector.js.map +0 -7
  285. package/dist/components/ModeIndicator.js +0 -38
  286. package/dist/components/ModeIndicator.js.map +0 -7
  287. package/dist/components/ModelConfig.js +0 -208
  288. package/dist/components/ModelConfig.js.map +0 -7
  289. package/dist/components/ModelListManager.js +0 -140
  290. package/dist/components/ModelListManager.js.map +0 -7
  291. package/dist/components/ModelSelector.js +0 -1985
  292. package/dist/components/ModelSelector.js.map +0 -7
  293. package/dist/components/ModelStatusDisplay.js +0 -87
  294. package/dist/components/ModelStatusDisplay.js.map +0 -7
  295. package/dist/components/Onboarding.js +0 -153
  296. package/dist/components/Onboarding.js.map +0 -7
  297. package/dist/components/PressEnterToContinue.js +0 -10
  298. package/dist/components/PressEnterToContinue.js.map +0 -7
  299. package/dist/components/PromptInput.js +0 -488
  300. package/dist/components/PromptInput.js.map +0 -7
  301. package/dist/components/SentryErrorBoundary.js +0 -27
  302. package/dist/components/SentryErrorBoundary.js.map +0 -7
  303. package/dist/components/Spinner.js +0 -101
  304. package/dist/components/Spinner.js.map +0 -7
  305. package/dist/components/StickerRequestForm.js +0 -7
  306. package/dist/components/StickerRequestForm.js.map +0 -7
  307. package/dist/components/StructuredDiff.js +0 -148
  308. package/dist/components/StructuredDiff.js.map +0 -7
  309. package/dist/components/TextInput.js +0 -100
  310. package/dist/components/TextInput.js.map +0 -7
  311. package/dist/components/TodoItem.js +0 -35
  312. package/dist/components/TodoItem.js.map +0 -7
  313. package/dist/components/TokenWarning.js +0 -19
  314. package/dist/components/TokenWarning.js.map +0 -7
  315. package/dist/components/ToolUseLoader.js +0 -24
  316. package/dist/components/ToolUseLoader.js.map +0 -7
  317. package/dist/components/TrustDialog.js +0 -76
  318. package/dist/components/TrustDialog.js.map +0 -7
  319. package/dist/components/binary-feedback/BinaryFeedback.js +0 -50
  320. package/dist/components/binary-feedback/BinaryFeedback.js.map +0 -7
  321. package/dist/components/binary-feedback/BinaryFeedbackOption.js +0 -94
  322. package/dist/components/binary-feedback/BinaryFeedbackOption.js.map +0 -7
  323. package/dist/components/binary-feedback/BinaryFeedbackView.js +0 -139
  324. package/dist/components/binary-feedback/BinaryFeedbackView.js.map +0 -7
  325. package/dist/components/binary-feedback/utils.js +0 -161
  326. package/dist/components/binary-feedback/utils.js.map +0 -7
  327. package/dist/components/messages/AssistantBashOutputMessage.js +0 -23
  328. package/dist/components/messages/AssistantBashOutputMessage.js.map +0 -7
  329. package/dist/components/messages/AssistantLocalCommandOutputMessage.js +0 -36
  330. package/dist/components/messages/AssistantLocalCommandOutputMessage.js.map +0 -7
  331. package/dist/components/messages/AssistantRedactedThinkingMessage.js +0 -12
  332. package/dist/components/messages/AssistantRedactedThinkingMessage.js.map +0 -7
  333. package/dist/components/messages/AssistantTextMessage.js +0 -78
  334. package/dist/components/messages/AssistantTextMessage.js.map +0 -7
  335. package/dist/components/messages/AssistantThinkingMessage.js +0 -27
  336. package/dist/components/messages/AssistantThinkingMessage.js.map +0 -7
  337. package/dist/components/messages/AssistantToolUseMessage.js +0 -91
  338. package/dist/components/messages/AssistantToolUseMessage.js.map +0 -7
  339. package/dist/components/messages/TaskProgressMessage.js +0 -11
  340. package/dist/components/messages/TaskProgressMessage.js.map +0 -7
  341. package/dist/components/messages/TaskToolMessage.js +0 -39
  342. package/dist/components/messages/TaskToolMessage.js.map +0 -7
  343. package/dist/components/messages/UserBashInputMessage.js +0 -18
  344. package/dist/components/messages/UserBashInputMessage.js.map +0 -7
  345. package/dist/components/messages/UserCommandMessage.js +0 -20
  346. package/dist/components/messages/UserCommandMessage.js.map +0 -7
  347. package/dist/components/messages/UserKodingInputMessage.js +0 -18
  348. package/dist/components/messages/UserKodingInputMessage.js.map +0 -7
  349. package/dist/components/messages/UserPromptMessage.js +0 -20
  350. package/dist/components/messages/UserPromptMessage.js.map +0 -7
  351. package/dist/components/messages/UserTextMessage.js +0 -25
  352. package/dist/components/messages/UserTextMessage.js.map +0 -7
  353. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js +0 -10
  354. package/dist/components/messages/UserToolResultMessage/UserToolCanceledMessage.js.map +0 -7
  355. package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js +0 -15
  356. package/dist/components/messages/UserToolResultMessage/UserToolErrorMessage.js.map +0 -7
  357. package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js +0 -25
  358. package/dist/components/messages/UserToolResultMessage/UserToolRejectMessage.js.map +0 -7
  359. package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js +0 -47
  360. package/dist/components/messages/UserToolResultMessage/UserToolResultMessage.js.map +0 -7
  361. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js +0 -23
  362. package/dist/components/messages/UserToolResultMessage/UserToolSuccessMessage.js.map +0 -7
  363. package/dist/components/messages/UserToolResultMessage/utils.js +0 -42
  364. package/dist/components/messages/UserToolResultMessage/utils.js.map +0 -7
  365. package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js +0 -112
  366. package/dist/components/permissions/BashPermissionRequest/BashPermissionRequest.js.map +0 -7
  367. package/dist/components/permissions/FallbackPermissionRequest.js +0 -131
  368. package/dist/components/permissions/FallbackPermissionRequest.js.map +0 -7
  369. package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js +0 -159
  370. package/dist/components/permissions/FileEditPermissionRequest/FileEditPermissionRequest.js.map +0 -7
  371. package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js +0 -58
  372. package/dist/components/permissions/FileEditPermissionRequest/FileEditToolDiff.js.map +0 -7
  373. package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js +0 -153
  374. package/dist/components/permissions/FileWritePermissionRequest/FileWritePermissionRequest.js.map +0 -7
  375. package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js +0 -70
  376. package/dist/components/permissions/FileWritePermissionRequest/FileWriteToolDiff.js.map +0 -7
  377. package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js +0 -212
  378. package/dist/components/permissions/FilesystemPermissionRequest/FilesystemPermissionRequest.js.map +0 -7
  379. package/dist/components/permissions/PermissionRequest.js +0 -70
  380. package/dist/components/permissions/PermissionRequest.js.map +0 -7
  381. package/dist/components/permissions/PermissionRequestTitle.js +0 -52
  382. package/dist/components/permissions/PermissionRequestTitle.js.map +0 -7
  383. package/dist/components/permissions/hooks.js +0 -28
  384. package/dist/components/permissions/hooks.js.map +0 -7
  385. package/dist/components/permissions/toolUseOptions.js +0 -46
  386. package/dist/components/permissions/toolUseOptions.js.map +0 -7
  387. package/dist/components/permissions/utils.js +0 -21
  388. package/dist/components/permissions/utils.js.map +0 -7
  389. package/dist/constants/betas.js +0 -11
  390. package/dist/constants/betas.js.map +0 -7
  391. package/dist/constants/claude-asterisk-ascii-art.js +0 -242
  392. package/dist/constants/claude-asterisk-ascii-art.js.map +0 -7
  393. package/dist/constants/figures.js +0 -6
  394. package/dist/constants/figures.js.map +0 -7
  395. package/dist/constants/keys.js +0 -7
  396. package/dist/constants/keys.js.map +0 -7
  397. package/dist/constants/macros.js +0 -13
  398. package/dist/constants/macros.js.map +0 -7
  399. package/dist/constants/modelCapabilities.js +0 -154
  400. package/dist/constants/modelCapabilities.js.map +0 -7
  401. package/dist/constants/models.js +0 -1034
  402. package/dist/constants/models.js.map +0 -7
  403. package/dist/constants/oauth.js +0 -18
  404. package/dist/constants/oauth.js.map +0 -7
  405. package/dist/constants/product.js +0 -26
  406. package/dist/constants/product.js.map +0 -7
  407. package/dist/constants/prompts.js +0 -168
  408. package/dist/constants/prompts.js.map +0 -7
  409. package/dist/constants/releaseNotes.js +0 -9
  410. package/dist/constants/releaseNotes.js.map +0 -7
  411. package/dist/context/PermissionContext.js +0 -111
  412. package/dist/context/PermissionContext.js.map +0 -7
  413. package/dist/context.js +0 -259
  414. package/dist/context.js.map +0 -7
  415. package/dist/cost-tracker.js.map +0 -7
  416. package/dist/entrypoints/cli.js +0 -1107
  417. package/dist/entrypoints/cli.js.map +0 -7
  418. package/dist/entrypoints/mcp.js +0 -150
  419. package/dist/entrypoints/mcp.js.map +0 -7
  420. package/dist/history.js +0 -25
  421. package/dist/history.js.map +0 -7
  422. package/dist/hooks/useApiKeyVerification.js +0 -12
  423. package/dist/hooks/useApiKeyVerification.js.map +0 -7
  424. package/dist/hooks/useArrowKeyHistory.js +0 -50
  425. package/dist/hooks/useArrowKeyHistory.js.map +0 -7
  426. package/dist/hooks/useCanUseTool.js +0 -112
  427. package/dist/hooks/useCanUseTool.js.map +0 -7
  428. package/dist/hooks/useCancelRequest.js +0 -30
  429. package/dist/hooks/useCancelRequest.js.map +0 -7
  430. package/dist/hooks/useDoublePress.js +0 -31
  431. package/dist/hooks/useDoublePress.js.map +0 -7
  432. package/dist/hooks/useExitOnCtrlCD.js +0 -26
  433. package/dist/hooks/useExitOnCtrlCD.js.map +0 -7
  434. package/dist/hooks/useInterval.js +0 -18
  435. package/dist/hooks/useInterval.js.map +0 -7
  436. package/dist/hooks/useLogMessages.js +0 -14
  437. package/dist/hooks/useLogMessages.js.map +0 -7
  438. package/dist/hooks/useLogStartupTime.js +0 -15
  439. package/dist/hooks/useLogStartupTime.js.map +0 -7
  440. package/dist/hooks/useNotifyAfterTimeout.js +0 -42
  441. package/dist/hooks/useNotifyAfterTimeout.js.map +0 -7
  442. package/dist/hooks/usePermissionRequestLogging.js +0 -28
  443. package/dist/hooks/usePermissionRequestLogging.js.map +0 -7
  444. package/dist/hooks/useTerminalSize.js +0 -38
  445. package/dist/hooks/useTerminalSize.js.map +0 -7
  446. package/dist/hooks/useTextInput.js +0 -250
  447. package/dist/hooks/useTextInput.js.map +0 -7
  448. package/dist/hooks/useUnifiedCompletion.js +0 -929
  449. package/dist/hooks/useUnifiedCompletion.js.map +0 -7
  450. package/dist/messages.js +0 -33
  451. package/dist/messages.js.map +0 -7
  452. package/dist/permissions.js +0 -194
  453. package/dist/permissions.js.map +0 -7
  454. package/dist/query.js +0 -492
  455. package/dist/query.js.map +0 -7
  456. package/dist/screens/ConfigureNpmPrefix.js +0 -128
  457. package/dist/screens/ConfigureNpmPrefix.js.map +0 -7
  458. package/dist/screens/Doctor.js +0 -22
  459. package/dist/screens/Doctor.js.map +0 -7
  460. package/dist/screens/LogList.js +0 -55
  461. package/dist/screens/LogList.js.map +0 -7
  462. package/dist/screens/REPL.js +0 -593
  463. package/dist/screens/REPL.js.map +0 -7
  464. package/dist/screens/ResumeConversation.js +0 -56
  465. package/dist/screens/ResumeConversation.js.map +0 -7
  466. package/dist/services/adapters/base.js +0 -29
  467. package/dist/services/adapters/base.js.map +0 -7
  468. package/dist/services/adapters/chatCompletions.js +0 -69
  469. package/dist/services/adapters/chatCompletions.js.map +0 -7
  470. package/dist/services/adapters/responsesAPI.js +0 -126
  471. package/dist/services/adapters/responsesAPI.js.map +0 -7
  472. package/dist/services/browserMocks.js +0 -48
  473. package/dist/services/browserMocks.js.map +0 -7
  474. package/dist/services/claude.js +0 -1605
  475. package/dist/services/claude.js.map +0 -7
  476. package/dist/services/customCommands.js +0 -359
  477. package/dist/services/customCommands.js.map +0 -7
  478. package/dist/services/fileFreshness.js +0 -280
  479. package/dist/services/fileFreshness.js.map +0 -7
  480. package/dist/services/gpt5ConnectionTest.js +0 -248
  481. package/dist/services/gpt5ConnectionTest.js.map +0 -7
  482. package/dist/services/mcpClient.js +0 -435
  483. package/dist/services/mcpClient.js.map +0 -7
  484. package/dist/services/mcpServerApproval.js +0 -55
  485. package/dist/services/mcpServerApproval.js.map +0 -7
  486. package/dist/services/mentionProcessor.js.map +0 -7
  487. package/dist/services/modelAdapterFactory.js +0 -47
  488. package/dist/services/modelAdapterFactory.js.map +0 -7
  489. package/dist/services/notifier.js +0 -35
  490. package/dist/services/notifier.js.map +0 -7
  491. package/dist/services/oauth.js +0 -259
  492. package/dist/services/oauth.js.map +0 -7
  493. package/dist/services/openai.js.map +0 -7
  494. package/dist/services/responseStateManager.js +0 -68
  495. package/dist/services/responseStateManager.js.map +0 -7
  496. package/dist/services/sentry.js +0 -9
  497. package/dist/services/sentry.js.map +0 -7
  498. package/dist/services/statsig.js +0 -112
  499. package/dist/services/statsig.js.map +0 -7
  500. package/dist/services/statsigStorage.js +0 -75
  501. package/dist/services/statsigStorage.js.map +0 -7
  502. package/dist/services/systemReminder.js.map +0 -7
  503. package/dist/services/vcr.js +0 -133
  504. package/dist/services/vcr.js.map +0 -7
  505. package/dist/tools/ArchitectTool/ArchitectTool.js +0 -119
  506. package/dist/tools/ArchitectTool/ArchitectTool.js.map +0 -7
  507. package/dist/tools/ArchitectTool/prompt.js +0 -18
  508. package/dist/tools/ArchitectTool/prompt.js.map +0 -7
  509. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js +0 -423
  510. package/dist/tools/AskExpertModelTool/AskExpertModelTool.js.map +0 -7
  511. package/dist/tools/BashTool/BashTool.js +0 -188
  512. package/dist/tools/BashTool/BashTool.js.map +0 -7
  513. package/dist/tools/BashTool/BashToolResultMessage.js +0 -21
  514. package/dist/tools/BashTool/BashToolResultMessage.js.map +0 -7
  515. package/dist/tools/BashTool/OutputLine.js +0 -30
  516. package/dist/tools/BashTool/OutputLine.js.map +0 -7
  517. package/dist/tools/BashTool/prompt.js +0 -179
  518. package/dist/tools/BashTool/prompt.js.map +0 -7
  519. package/dist/tools/BashTool/utils.js +0 -51
  520. package/dist/tools/BashTool/utils.js.map +0 -7
  521. package/dist/tools/FileEditTool/FileEditTool.js +0 -228
  522. package/dist/tools/FileEditTool/FileEditTool.js.map +0 -7
  523. package/dist/tools/FileEditTool/prompt.js +0 -54
  524. package/dist/tools/FileEditTool/prompt.js.map +0 -7
  525. package/dist/tools/FileEditTool/utils.js +0 -42
  526. package/dist/tools/FileEditTool/utils.js.map +0 -7
  527. package/dist/tools/FileReadTool/FileReadTool.js +0 -272
  528. package/dist/tools/FileReadTool/FileReadTool.js.map +0 -7
  529. package/dist/tools/FileReadTool/prompt.js +0 -10
  530. package/dist/tools/FileReadTool/prompt.js.map +0 -7
  531. package/dist/tools/FileWriteTool/FileWriteTool.js +0 -204
  532. package/dist/tools/FileWriteTool/FileWriteTool.js.map +0 -7
  533. package/dist/tools/FileWriteTool/prompt.js +0 -14
  534. package/dist/tools/FileWriteTool/prompt.js.map +0 -7
  535. package/dist/tools/GlobTool/GlobTool.js +0 -88
  536. package/dist/tools/GlobTool/GlobTool.js.map +0 -7
  537. package/dist/tools/GlobTool/prompt.js +0 -12
  538. package/dist/tools/GlobTool/prompt.js.map +0 -7
  539. package/dist/tools/GrepTool/GrepTool.js +0 -107
  540. package/dist/tools/GrepTool/GrepTool.js.map +0 -7
  541. package/dist/tools/GrepTool/prompt.js +0 -15
  542. package/dist/tools/GrepTool/prompt.js.map +0 -7
  543. package/dist/tools/MCPTool/MCPTool.js +0 -90
  544. package/dist/tools/MCPTool/MCPTool.js.map +0 -7
  545. package/dist/tools/MCPTool/prompt.js +0 -7
  546. package/dist/tools/MCPTool/prompt.js.map +0 -7
  547. package/dist/tools/MemoryReadTool/MemoryReadTool.js +0 -103
  548. package/dist/tools/MemoryReadTool/MemoryReadTool.js.map +0 -7
  549. package/dist/tools/MemoryReadTool/prompt.js +0 -7
  550. package/dist/tools/MemoryReadTool/prompt.js.map +0 -7
  551. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js +0 -77
  552. package/dist/tools/MemoryWriteTool/MemoryWriteTool.js.map +0 -7
  553. package/dist/tools/MemoryWriteTool/prompt.js +0 -7
  554. package/dist/tools/MemoryWriteTool/prompt.js.map +0 -7
  555. package/dist/tools/MultiEditTool/MultiEditTool.js +0 -308
  556. package/dist/tools/MultiEditTool/MultiEditTool.js.map +0 -7
  557. package/dist/tools/MultiEditTool/prompt.js +0 -48
  558. package/dist/tools/MultiEditTool/prompt.js.map +0 -7
  559. package/dist/tools/NotebookEditTool/NotebookEditTool.js +0 -238
  560. package/dist/tools/NotebookEditTool/NotebookEditTool.js.map +0 -7
  561. package/dist/tools/NotebookEditTool/prompt.js +0 -7
  562. package/dist/tools/NotebookEditTool/prompt.js.map +0 -7
  563. package/dist/tools/NotebookReadTool/NotebookReadTool.js +0 -212
  564. package/dist/tools/NotebookReadTool/NotebookReadTool.js.map +0 -7
  565. package/dist/tools/NotebookReadTool/prompt.js +0 -7
  566. package/dist/tools/NotebookReadTool/prompt.js.map +0 -7
  567. package/dist/tools/StickerRequestTool/StickerRequestTool.js +0 -86
  568. package/dist/tools/StickerRequestTool/StickerRequestTool.js.map +0 -7
  569. package/dist/tools/StickerRequestTool/prompt.js +0 -23
  570. package/dist/tools/StickerRequestTool/prompt.js.map +0 -7
  571. package/dist/tools/TaskTool/TaskTool.js +0 -351
  572. package/dist/tools/TaskTool/TaskTool.js.map +0 -7
  573. package/dist/tools/TaskTool/constants.js +0 -5
  574. package/dist/tools/TaskTool/constants.js.map +0 -7
  575. package/dist/tools/TaskTool/prompt.js +0 -82
  576. package/dist/tools/TaskTool/prompt.js.map +0 -7
  577. package/dist/tools/ThinkTool/ThinkTool.js +0 -48
  578. package/dist/tools/ThinkTool/ThinkTool.js.map +0 -7
  579. package/dist/tools/ThinkTool/prompt.js +0 -16
  580. package/dist/tools/ThinkTool/prompt.js.map +0 -7
  581. package/dist/tools/TodoWriteTool/TodoWriteTool.js +0 -216
  582. package/dist/tools/TodoWriteTool/TodoWriteTool.js.map +0 -7
  583. package/dist/tools/TodoWriteTool/prompt.js +0 -66
  584. package/dist/tools/TodoWriteTool/prompt.js.map +0 -7
  585. package/dist/tools/URLFetcherTool/URLFetcherTool.js +0 -137
  586. package/dist/tools/URLFetcherTool/URLFetcherTool.js.map +0 -7
  587. package/dist/tools/URLFetcherTool/cache.js +0 -45
  588. package/dist/tools/URLFetcherTool/cache.js.map +0 -7
  589. package/dist/tools/URLFetcherTool/htmlToMarkdown.js +0 -42
  590. package/dist/tools/URLFetcherTool/htmlToMarkdown.js.map +0 -7
  591. package/dist/tools/URLFetcherTool/prompt.js +0 -22
  592. package/dist/tools/URLFetcherTool/prompt.js.map +0 -7
  593. package/dist/tools/WebSearchTool/WebSearchTool.js +0 -86
  594. package/dist/tools/WebSearchTool/WebSearchTool.js.map +0 -7
  595. package/dist/tools/WebSearchTool/prompt.js +0 -17
  596. package/dist/tools/WebSearchTool/prompt.js.map +0 -7
  597. package/dist/tools/WebSearchTool/searchProviders.js +0 -48
  598. package/dist/tools/WebSearchTool/searchProviders.js.map +0 -7
  599. package/dist/tools/lsTool/lsTool.js +0 -201
  600. package/dist/tools/lsTool/lsTool.js.map +0 -7
  601. package/dist/tools/lsTool/prompt.js +0 -5
  602. package/dist/tools/lsTool/prompt.js.map +0 -7
  603. package/dist/tools.js +0 -64
  604. package/dist/tools.js.map +0 -7
  605. package/dist/types/PermissionMode.js +0 -82
  606. package/dist/types/PermissionMode.js.map +0 -7
  607. package/dist/types/RequestContext.js +0 -47
  608. package/dist/types/RequestContext.js.map +0 -7
  609. package/dist/types/common.d.js +0 -1
  610. package/dist/types/conversation.js +0 -1
  611. package/dist/types/logs.js +0 -1
  612. package/dist/types/modelCapabilities.js +0 -1
  613. package/dist/types/notebook.js +0 -1
  614. package/dist/utils/Cursor.js +0 -313
  615. package/dist/utils/Cursor.js.map +0 -7
  616. package/dist/utils/PersistentShell.js +0 -382
  617. package/dist/utils/PersistentShell.js.map +0 -7
  618. package/dist/utils/advancedFuzzyMatcher.js +0 -206
  619. package/dist/utils/advancedFuzzyMatcher.js.map +0 -7
  620. package/dist/utils/agentLoader.js +0 -199
  621. package/dist/utils/agentLoader.js.map +0 -7
  622. package/dist/utils/agentStorage.js +0 -59
  623. package/dist/utils/agentStorage.js.map +0 -7
  624. package/dist/utils/array.js +0 -7
  625. package/dist/utils/array.js.map +0 -7
  626. package/dist/utils/ask.js +0 -77
  627. package/dist/utils/ask.js.map +0 -7
  628. package/dist/utils/auth.js +0 -11
  629. package/dist/utils/auth.js.map +0 -7
  630. package/dist/utils/autoCompactCore.js +0 -149
  631. package/dist/utils/autoCompactCore.js.map +0 -7
  632. package/dist/utils/autoUpdater.js.map +0 -7
  633. package/dist/utils/betas.js +0 -21
  634. package/dist/utils/betas.js.map +0 -7
  635. package/dist/utils/browser.js +0 -15
  636. package/dist/utils/browser.js.map +0 -7
  637. package/dist/utils/cleanup.js +0 -54
  638. package/dist/utils/cleanup.js.map +0 -7
  639. package/dist/utils/commands.js +0 -207
  640. package/dist/utils/commands.js.map +0 -7
  641. package/dist/utils/commonUnixCommands.js +0 -687
  642. package/dist/utils/commonUnixCommands.js.map +0 -7
  643. package/dist/utils/config.js.map +0 -7
  644. package/dist/utils/conversationRecovery.js +0 -35
  645. package/dist/utils/conversationRecovery.js.map +0 -7
  646. package/dist/utils/debugLogger.js.map +0 -7
  647. package/dist/utils/diff.js +0 -32
  648. package/dist/utils/diff.js.map +0 -7
  649. package/dist/utils/env.js +0 -44
  650. package/dist/utils/env.js.map +0 -7
  651. package/dist/utils/errors.js +0 -23
  652. package/dist/utils/errors.js.map +0 -7
  653. package/dist/utils/exampleCommands.js +0 -80
  654. package/dist/utils/exampleCommands.js.map +0 -7
  655. package/dist/utils/execFileNoThrow.js +0 -44
  656. package/dist/utils/execFileNoThrow.js.map +0 -7
  657. package/dist/utils/expertChatStorage.js +0 -78
  658. package/dist/utils/expertChatStorage.js.map +0 -7
  659. package/dist/utils/file.js +0 -282
  660. package/dist/utils/file.js.map +0 -7
  661. package/dist/utils/fileRecoveryCore.js +0 -41
  662. package/dist/utils/fileRecoveryCore.js.map +0 -7
  663. package/dist/utils/format.js +0 -41
  664. package/dist/utils/format.js.map +0 -7
  665. package/dist/utils/fuzzyMatcher.js +0 -252
  666. package/dist/utils/fuzzyMatcher.js.map +0 -7
  667. package/dist/utils/generators.js +0 -46
  668. package/dist/utils/generators.js.map +0 -7
  669. package/dist/utils/git.js +0 -83
  670. package/dist/utils/git.js.map +0 -7
  671. package/dist/utils/globalLogger.js +0 -54
  672. package/dist/utils/globalLogger.js.map +0 -7
  673. package/dist/utils/http.js +0 -7
  674. package/dist/utils/http.js.map +0 -7
  675. package/dist/utils/imagePaste.js +0 -29
  676. package/dist/utils/imagePaste.js.map +0 -7
  677. package/dist/utils/json.js +0 -16
  678. package/dist/utils/json.js.map +0 -7
  679. package/dist/utils/log.js +0 -298
  680. package/dist/utils/log.js.map +0 -7
  681. package/dist/utils/markdown.js +0 -187
  682. package/dist/utils/markdown.js.map +0 -7
  683. package/dist/utils/messageContextManager.js +0 -195
  684. package/dist/utils/messageContextManager.js.map +0 -7
  685. package/dist/utils/messages.js +0 -633
  686. package/dist/utils/messages.js.map +0 -7
  687. package/dist/utils/model.js.map +0 -7
  688. package/dist/utils/permissions/filesystem.js +0 -80
  689. package/dist/utils/permissions/filesystem.js.map +0 -7
  690. package/dist/utils/responseState.js +0 -20
  691. package/dist/utils/responseState.js.map +0 -7
  692. package/dist/utils/ripgrep.js +0 -131
  693. package/dist/utils/ripgrep.js.map +0 -7
  694. package/dist/utils/secureFile.js +0 -483
  695. package/dist/utils/secureFile.js.map +0 -7
  696. package/dist/utils/sessionState.js +0 -31
  697. package/dist/utils/sessionState.js.map +0 -7
  698. package/dist/utils/state.js +0 -24
  699. package/dist/utils/state.js.map +0 -7
  700. package/dist/utils/style.js +0 -31
  701. package/dist/utils/style.js.map +0 -7
  702. package/dist/utils/terminal.js +0 -43
  703. package/dist/utils/terminal.js.map +0 -7
  704. package/dist/utils/theme.js.map +0 -7
  705. package/dist/utils/thinking.js +0 -103
  706. package/dist/utils/thinking.js.map +0 -7
  707. package/dist/utils/todoStorage.js +0 -291
  708. package/dist/utils/todoStorage.js.map +0 -7
  709. package/dist/utils/tokens.js +0 -30
  710. package/dist/utils/tokens.js.map +0 -7
  711. package/dist/utils/toolExecutionController.js +0 -109
  712. package/dist/utils/toolExecutionController.js.map +0 -7
  713. package/dist/utils/unaryLogging.js +0 -14
  714. package/dist/utils/unaryLogging.js.map +0 -7
  715. package/dist/utils/user.js +0 -40
  716. package/dist/utils/user.js.map +0 -7
  717. package/dist/utils/validate.js +0 -132
  718. package/dist/utils/validate.js.map +0 -7
  719. /package/dist/{Tool.js.map → REPL-GIU4ZIXM.js.map} +0 -0
  720. /package/dist/{components/CustomSelect/theme.js.map → autoUpdater-DNRMJWFQ.js.map} +0 -0
  721. /package/dist/{types/common.d.js.map → chunk-JC6NCUG5.js.map} +0 -0
  722. /package/dist/{types/conversation.js.map → commands-TWH6PGVG.js.map} +0 -0
  723. /package/dist/{types/logs.js.map → config-6ZMBCL23.js.map} +0 -0
  724. /package/dist/{types/modelCapabilities.js.map → context-JQIOOI4W.js.map} +0 -0
  725. /package/dist/{types/notebook.js.map → costTracker-6SL26FDB.js.map} +0 -0
@@ -1,188 +0,0 @@
1
- import { statSync } from "fs";
2
- import { EOL } from "os";
3
- import { isAbsolute, relative, resolve } from "path";
4
- import * as React from "react";
5
- import { z } from "zod";
6
- import { FallbackToolUseRejectedMessage } from "../../components/FallbackToolUseRejectedMessage.js";
7
- import { PRODUCT_NAME } from "../../constants/product.js";
8
- import { splitCommand } from "../../utils/commands.js";
9
- import { isInDirectory } from "../../utils/file.js";
10
- import { logError } from "../../utils/log.js";
11
- import { PersistentShell } from "../../utils/PersistentShell.js";
12
- import { getCwd, getOriginalCwd } from "../../utils/state.js";
13
- import { getGlobalConfig } from "../../utils/config.js";
14
- import { getModelManager } from "../../utils/model.js";
15
- import BashToolResultMessage from "./BashToolResultMessage.js";
16
- import { BANNED_COMMANDS, PROMPT } from "./prompt.js";
17
- import { formatOutput, getCommandFilePaths } from "./utils.js";
18
- import { logEvent } from "../../services/statsig.js";
19
- const inputSchema = z.strictObject({
20
- command: z.string().describe("The command to execute"),
21
- timeout: z.number().optional().describe("Optional timeout in milliseconds (max 600000)")
22
- });
23
- const BashTool = {
24
- name: "Bash",
25
- async description() {
26
- return "Executes shell commands on your computer";
27
- },
28
- async prompt() {
29
- const config = getGlobalConfig();
30
- const modelManager = getModelManager();
31
- const modelName = modelManager.getModelName("main") || "<No Model Configured>";
32
- return PROMPT.replace(/{MODEL_NAME}/g, modelName);
33
- },
34
- isReadOnly() {
35
- return false;
36
- },
37
- isConcurrencySafe() {
38
- return false;
39
- },
40
- inputSchema,
41
- userFacingName() {
42
- return "Bash";
43
- },
44
- async isEnabled() {
45
- return true;
46
- },
47
- needsPermissions() {
48
- return true;
49
- },
50
- async validateInput({ command }) {
51
- const commands = splitCommand(command);
52
- for (const cmd of commands) {
53
- const parts = cmd.split(" ");
54
- const baseCmd = parts[0];
55
- if (baseCmd && BANNED_COMMANDS.includes(baseCmd.toLowerCase())) {
56
- return {
57
- result: false,
58
- message: `Command '${baseCmd}' is not allowed for security reasons`
59
- };
60
- }
61
- if (baseCmd === "cd" && parts[1]) {
62
- const targetDir = parts[1].replace(/^['"]|['"]$/g, "");
63
- const fullTargetDir = isAbsolute(targetDir) ? targetDir : resolve(getCwd(), targetDir);
64
- if (!isInDirectory(
65
- relative(getOriginalCwd(), fullTargetDir),
66
- relative(getCwd(), getOriginalCwd())
67
- )) {
68
- return {
69
- result: false,
70
- message: `ERROR: cd to '${fullTargetDir}' was blocked. For security, ${PRODUCT_NAME} may only change directories to child directories of the original working directory (${getOriginalCwd()}) for this session.`
71
- };
72
- }
73
- }
74
- }
75
- return { result: true };
76
- },
77
- renderToolUseMessage({ command }) {
78
- if (command.includes(`"$(cat <<'EOF'`)) {
79
- const match = command.match(
80
- /^(.*?)"?\$\(cat <<'EOF'\n([\s\S]*?)\n\s*EOF\n\s*\)"(.*)$/
81
- );
82
- if (match && match[1] && match[2]) {
83
- const prefix = match[1];
84
- const content = match[2];
85
- const suffix = match[3] || "";
86
- return `${prefix.trim()} "${content.trim()}"${suffix.trim()}`;
87
- }
88
- }
89
- return command;
90
- },
91
- renderToolUseRejectedMessage() {
92
- return /* @__PURE__ */ React.createElement(FallbackToolUseRejectedMessage, null);
93
- },
94
- renderToolResultMessage(content) {
95
- return /* @__PURE__ */ React.createElement(BashToolResultMessage, { content, verbose: false });
96
- },
97
- renderResultForAssistant({ interrupted, stdout, stderr }) {
98
- let errorMessage = stderr.trim();
99
- if (interrupted) {
100
- if (stderr) errorMessage += EOL;
101
- errorMessage += "<error>Command was aborted before completion</error>";
102
- }
103
- const hasBoth = stdout.trim() && errorMessage;
104
- return `${stdout.trim()}${hasBoth ? "\n" : ""}${errorMessage.trim()}`;
105
- },
106
- async *call({ command, timeout = 12e4 }, { abortController, readFileTimestamps }) {
107
- let stdout = "";
108
- let stderr = "";
109
- if (abortController.signal.aborted) {
110
- const data = {
111
- stdout: "",
112
- stdoutLines: 0,
113
- stderr: "Command cancelled before execution",
114
- stderrLines: 1,
115
- interrupted: true
116
- };
117
- yield {
118
- type: "result",
119
- resultForAssistant: this.renderResultForAssistant(data),
120
- data
121
- };
122
- return;
123
- }
124
- try {
125
- const result = await PersistentShell.getInstance().exec(
126
- command,
127
- abortController.signal,
128
- timeout
129
- );
130
- stdout += (result.stdout || "").trim() + EOL;
131
- stderr += (result.stderr || "").trim() + EOL;
132
- if (result.code !== 0) {
133
- stderr += `Exit code ${result.code}`;
134
- }
135
- if (!isInDirectory(getCwd(), getOriginalCwd())) {
136
- await PersistentShell.getInstance().setCwd(getOriginalCwd());
137
- stderr = `${stderr.trim()}${EOL}Shell cwd was reset to ${getOriginalCwd()}`;
138
- logEvent("bash_tool_reset_to_original_dir", {});
139
- }
140
- if (process.env.NODE_ENV !== "test") {
141
- getCommandFilePaths(command, stdout).then((filePaths) => {
142
- for (const filePath of filePaths) {
143
- const fullFilePath = isAbsolute(filePath) ? filePath : resolve(getCwd(), filePath);
144
- try {
145
- readFileTimestamps[fullFilePath] = statSync(fullFilePath).mtimeMs;
146
- } catch (e) {
147
- logError(e);
148
- }
149
- }
150
- });
151
- }
152
- const { totalLines: stdoutLines, truncatedContent: stdoutContent } = formatOutput(stdout.trim());
153
- const { totalLines: stderrLines, truncatedContent: stderrContent } = formatOutput(stderr.trim());
154
- const data = {
155
- stdout: stdoutContent,
156
- stdoutLines,
157
- stderr: stderrContent,
158
- stderrLines,
159
- interrupted: result.interrupted
160
- };
161
- yield {
162
- type: "result",
163
- resultForAssistant: this.renderResultForAssistant(data),
164
- data
165
- };
166
- } catch (error) {
167
- const isAborted = abortController.signal.aborted;
168
- const errorMessage = isAborted ? "Command was cancelled by user" : `Command failed: ${error instanceof Error ? error.message : String(error)}`;
169
- const data = {
170
- stdout: stdout.trim(),
171
- stdoutLines: stdout.split("\n").length,
172
- stderr: errorMessage,
173
- stderrLines: 1,
174
- interrupted: isAborted
175
- };
176
- yield {
177
- type: "result",
178
- resultForAssistant: this.renderResultForAssistant(data),
179
- data
180
- };
181
- }
182
- }
183
- };
184
- export {
185
- BashTool,
186
- inputSchema
187
- };
188
- //# sourceMappingURL=BashTool.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/tools/BashTool/BashTool.tsx"],
4
- "sourcesContent": ["import { statSync } from 'fs'\nimport { EOL } from 'os'\nimport { isAbsolute, relative, resolve } from 'path'\nimport * as React from 'react'\nimport { z } from 'zod'\nimport { FallbackToolUseRejectedMessage } from '../../components/FallbackToolUseRejectedMessage'\nimport { PRODUCT_NAME } from '../../constants/product'\nimport { queryQuick } from '../../services/claude'\nimport { Tool, ValidationResult } from '../../Tool'\nimport { splitCommand } from '../../utils/commands'\nimport { isInDirectory } from '../../utils/file'\nimport { logError } from '../../utils/log'\nimport { PersistentShell } from '../../utils/PersistentShell'\nimport { getCwd, getOriginalCwd } from '../../utils/state'\nimport { getGlobalConfig } from '../../utils/config'\nimport { getModelManager } from '../../utils/model'\nimport BashToolResultMessage from './BashToolResultMessage'\nimport { BANNED_COMMANDS, PROMPT } from './prompt'\nimport { formatOutput, getCommandFilePaths } from './utils'\nimport { logEvent } from '../../services/statsig'\n\nexport const inputSchema = z.strictObject({\n command: z.string().describe('The command to execute'),\n timeout: z\n .number()\n .optional()\n .describe('Optional timeout in milliseconds (max 600000)'),\n})\n\ntype In = typeof inputSchema\nexport type Out = {\n stdout: string\n stdoutLines: number // Total number of lines in original stdout, even if `stdout` is now truncated\n stderr: string\n stderrLines: number // Total number of lines in original stderr, even if `stderr` is now truncated\n interrupted: boolean\n}\n\nexport const BashTool = {\n name: 'Bash',\n async description() {\n return 'Executes shell commands on your computer'\n },\n async prompt() {\n const config = getGlobalConfig()\n // \uD83D\uDD27 Fix: Use ModelManager to get actual current model\n const modelManager = getModelManager()\n const modelName =\n modelManager.getModelName('main') || '<No Model Configured>'\n // Substitute the placeholder in the static PROMPT string\n return PROMPT.replace(/{MODEL_NAME}/g, modelName)\n },\n isReadOnly() {\n return false\n },\n isConcurrencySafe() {\n return false // BashTool modifies state/files, not safe for concurrent execution\n },\n inputSchema,\n userFacingName() {\n return 'Bash'\n },\n async isEnabled() {\n return true\n },\n needsPermissions(): boolean {\n // Always check per-project permissions for BashTool\n return true\n },\n async validateInput({ command }): Promise<ValidationResult> {\n const commands = splitCommand(command)\n for (const cmd of commands) {\n const parts = cmd.split(' ')\n const baseCmd = parts[0]\n\n // Check if command is banned\n if (baseCmd && BANNED_COMMANDS.includes(baseCmd.toLowerCase())) {\n return {\n result: false,\n message: `Command '${baseCmd}' is not allowed for security reasons`,\n }\n }\n\n // Special handling for cd command\n if (baseCmd === 'cd' && parts[1]) {\n const targetDir = parts[1]!.replace(/^['\"]|['\"]$/g, '') // Remove quotes if present\n const fullTargetDir = isAbsolute(targetDir)\n ? targetDir\n : resolve(getCwd(), targetDir)\n if (\n !isInDirectory(\n relative(getOriginalCwd(), fullTargetDir),\n relative(getCwd(), getOriginalCwd()),\n )\n ) {\n return {\n result: false,\n message: `ERROR: cd to '${fullTargetDir}' was blocked. For security, ${PRODUCT_NAME} may only change directories to child directories of the original working directory (${getOriginalCwd()}) for this session.`,\n }\n }\n }\n }\n\n return { result: true }\n },\n renderToolUseMessage({ command }) {\n // Clean up any command that uses the quoted HEREDOC pattern\n if (command.includes(\"\\\"$(cat <<'EOF'\")) {\n const match = command.match(\n /^(.*?)\"?\\$\\(cat <<'EOF'\\n([\\s\\S]*?)\\n\\s*EOF\\n\\s*\\)\"(.*)$/,\n )\n if (match && match[1] && match[2]) {\n const prefix = match[1]\n const content = match[2]\n const suffix = match[3] || ''\n return `${prefix.trim()} \"${content.trim()}\"${suffix.trim()}`\n }\n }\n return command\n },\n renderToolUseRejectedMessage() {\n return <FallbackToolUseRejectedMessage />\n },\n\n renderToolResultMessage(content) {\n return <BashToolResultMessage content={content} verbose={false} />\n },\n renderResultForAssistant({ interrupted, stdout, stderr }) {\n let errorMessage = stderr.trim()\n if (interrupted) {\n if (stderr) errorMessage += EOL\n errorMessage += '<error>Command was aborted before completion</error>'\n }\n const hasBoth = stdout.trim() && errorMessage\n return `${stdout.trim()}${hasBoth ? '\\n' : ''}${errorMessage.trim()}`\n },\n async *call(\n { command, timeout = 120000 },\n { abortController, readFileTimestamps },\n ) {\n let stdout = ''\n let stderr = ''\n\n // \uD83D\uDD27 Check if already cancelled before starting execution\n if (abortController.signal.aborted) {\n const data: Out = {\n stdout: '',\n stdoutLines: 0,\n stderr: 'Command cancelled before execution',\n stderrLines: 1,\n interrupted: true,\n }\n\n yield {\n type: 'result',\n resultForAssistant: this.renderResultForAssistant(data),\n data,\n }\n return\n }\n\n try {\n // Execute commands\n const result = await PersistentShell.getInstance().exec(\n command,\n abortController.signal,\n timeout,\n )\n stdout += (result.stdout || '').trim() + EOL\n stderr += (result.stderr || '').trim() + EOL\n if (result.code !== 0) {\n stderr += `Exit code ${result.code}`\n }\n\n if (!isInDirectory(getCwd(), getOriginalCwd())) {\n // Shell directory is outside original working directory, reset it\n await PersistentShell.getInstance().setCwd(getOriginalCwd())\n stderr = `${stderr.trim()}${EOL}Shell cwd was reset to ${getOriginalCwd()}`\n logEvent('bash_tool_reset_to_original_dir', {})\n }\n\n // Update read timestamps for any files referenced by the command\n // Don't block the main thread!\n // Skip this in tests because it makes fixtures non-deterministic (they might not always get written),\n // so will be missing in CI.\n if (process.env.NODE_ENV !== 'test') {\n getCommandFilePaths(command, stdout).then(filePaths => {\n for (const filePath of filePaths) {\n const fullFilePath = isAbsolute(filePath)\n ? filePath\n : resolve(getCwd(), filePath)\n\n // Try/catch in case the file doesn't exist (because Haiku didn't properly extract it)\n try {\n readFileTimestamps[fullFilePath] = statSync(fullFilePath).mtimeMs\n } catch (e) {\n logError(e)\n }\n }\n })\n }\n\n const { totalLines: stdoutLines, truncatedContent: stdoutContent } =\n formatOutput(stdout.trim())\n const { totalLines: stderrLines, truncatedContent: stderrContent } =\n formatOutput(stderr.trim())\n\n const data: Out = {\n stdout: stdoutContent,\n stdoutLines,\n stderr: stderrContent,\n stderrLines,\n interrupted: result.interrupted,\n }\n\n yield {\n type: 'result',\n resultForAssistant: this.renderResultForAssistant(data),\n data,\n }\n } catch (error) {\n // \uD83D\uDD27 Handle cancellation or other errors properly\n const isAborted = abortController.signal.aborted\n const errorMessage = isAborted \n ? 'Command was cancelled by user' \n : `Command failed: ${error instanceof Error ? error.message : String(error)}`\n \n const data: Out = {\n stdout: stdout.trim(),\n stdoutLines: stdout.split('\\n').length,\n stderr: errorMessage,\n stderrLines: 1,\n interrupted: isAborted,\n }\n\n yield {\n type: 'result',\n resultForAssistant: this.renderResultForAssistant(data),\n data,\n }\n }\n },\n} satisfies Tool<In, Out>\n"],
5
- "mappings": "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",
6
- "names": []
7
- }
@@ -1,21 +0,0 @@
1
- import { Box, Text } from "ink";
2
- import { OutputLine } from "./OutputLine.js";
3
- import React from "react";
4
- import { getTheme } from "../../utils/theme.js";
5
- function BashToolResultMessage({ content, verbose }) {
6
- const { stdout, stdoutLines, stderr, stderrLines } = content;
7
- return /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, stdout !== "" ? /* @__PURE__ */ React.createElement(OutputLine, { content: stdout, lines: stdoutLines, verbose }) : null, stderr !== "" ? /* @__PURE__ */ React.createElement(
8
- OutputLine,
9
- {
10
- content: stderr,
11
- lines: stderrLines,
12
- verbose,
13
- isError: true
14
- }
15
- ) : null, stdout === "" && stderr === "" ? /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React.createElement(Text, { color: getTheme().secondaryText }, "(No content)")) : null);
16
- }
17
- var BashToolResultMessage_default = BashToolResultMessage;
18
- export {
19
- BashToolResultMessage_default as default
20
- };
21
- //# sourceMappingURL=BashToolResultMessage.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/tools/BashTool/BashToolResultMessage.tsx"],
4
- "sourcesContent": ["import { Box, Text } from 'ink'\nimport { OutputLine } from './OutputLine'\nimport React from 'react'\nimport { getTheme } from '../../utils/theme'\nimport { Out as BashOut } from './BashTool'\n\ntype Props = {\n content: Omit<BashOut, 'interrupted'>\n verbose: boolean\n}\n\nfunction BashToolResultMessage({ content, verbose }: Props): React.JSX.Element {\n const { stdout, stdoutLines, stderr, stderrLines } = content\n\n return (\n <Box flexDirection=\"column\">\n {stdout !== '' ? (\n <OutputLine content={stdout} lines={stdoutLines} verbose={verbose} />\n ) : null}\n {stderr !== '' ? (\n <OutputLine\n content={stderr}\n lines={stderrLines}\n verbose={verbose}\n isError\n />\n ) : null}\n {stdout === '' && stderr === '' ? (\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Text color={getTheme().secondaryText}>(No content)</Text>\n </Box>\n ) : null}\n </Box>\n )\n}\n\nexport default BashToolResultMessage\n"],
5
- "mappings": "AAAA,SAAS,KAAK,YAAY;AAC1B,SAAS,kBAAkB;AAC3B,OAAO,WAAW;AAClB,SAAS,gBAAgB;AAQzB,SAAS,sBAAsB,EAAE,SAAS,QAAQ,GAA6B;AAC7E,QAAM,EAAE,QAAQ,aAAa,QAAQ,YAAY,IAAI;AAErD,SACE,oCAAC,OAAI,eAAc,YAChB,WAAW,KACV,oCAAC,cAAW,SAAS,QAAQ,OAAO,aAAa,SAAkB,IACjE,MACH,WAAW,KACV;AAAA,IAAC;AAAA;AAAA,MACC,SAAS;AAAA,MACT,OAAO;AAAA,MACP;AAAA,MACA,SAAO;AAAA;AAAA,EACT,IACE,MACH,WAAW,MAAM,WAAW,KAC3B,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,QAAK,OAAO,SAAS,EAAE,iBAAe,cAAY,CACrD,IACE,IACN;AAEJ;AAEA,IAAO,gCAAQ;",
6
- "names": []
7
- }
@@ -1,30 +0,0 @@
1
- import { Box, Text } from "ink";
2
- import * as React from "react";
3
- import { getTheme } from "../../utils/theme.js";
4
- import { MAX_RENDERED_LINES } from "./prompt.js";
5
- import chalk from "chalk";
6
- function renderTruncatedContent(content, totalLines) {
7
- const allLines = content.split("\n");
8
- if (allLines.length <= MAX_RENDERED_LINES) {
9
- return allLines.join("\n");
10
- }
11
- const lastLines = allLines.slice(-MAX_RENDERED_LINES);
12
- return [
13
- chalk.grey(
14
- `Showing last ${MAX_RENDERED_LINES} lines of ${totalLines} total lines`
15
- ),
16
- ...lastLines
17
- ].join("\n");
18
- }
19
- function OutputLine({
20
- content,
21
- lines,
22
- verbose,
23
- isError
24
- }) {
25
- return /* @__PURE__ */ React.createElement(Box, { justifyContent: "space-between", width: "100%" }, /* @__PURE__ */ React.createElement(Box, { flexDirection: "row" }, /* @__PURE__ */ React.createElement(Text, null, "\xA0\xA0\u23BF \xA0"), /* @__PURE__ */ React.createElement(Box, { flexDirection: "column" }, /* @__PURE__ */ React.createElement(Text, { color: isError ? getTheme().error : void 0 }, verbose ? content.trim() : renderTruncatedContent(content.trim(), lines)))));
26
- }
27
- export {
28
- OutputLine
29
- };
30
- //# sourceMappingURL=OutputLine.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/tools/BashTool/OutputLine.tsx"],
4
- "sourcesContent": ["import { Box, Text } from 'ink'\nimport * as React from 'react'\nimport { getTheme } from '../../utils/theme'\nimport { MAX_RENDERED_LINES } from './prompt'\nimport chalk from 'chalk'\n\nfunction renderTruncatedContent(content: string, totalLines: number): string {\n const allLines = content.split('\\n')\n if (allLines.length <= MAX_RENDERED_LINES) {\n return allLines.join('\\n')\n }\n\n // Show last 5 lines of output by default (matching reference implementation)\n const lastLines = allLines.slice(-MAX_RENDERED_LINES)\n return [\n chalk.grey(\n `Showing last ${MAX_RENDERED_LINES} lines of ${totalLines} total lines`,\n ),\n ...lastLines,\n ].join('\\n')\n}\n\nexport function OutputLine({\n content,\n lines,\n verbose,\n isError,\n}: {\n content: string\n lines: number\n verbose: boolean\n isError?: boolean\n key?: React.Key\n}) {\n return (\n <Box justifyContent=\"space-between\" width=\"100%\">\n <Box flexDirection=\"row\">\n <Text>&nbsp;&nbsp;\u23BF &nbsp;</Text>\n <Box flexDirection=\"column\">\n <Text color={isError ? getTheme().error : undefined}>\n {verbose\n ? content.trim()\n : renderTruncatedContent(content.trim(), lines)}\n </Text>\n </Box>\n </Box>\n </Box>\n )\n}\n"],
5
- "mappings": "AAAA,SAAS,KAAK,YAAY;AAC1B,YAAY,WAAW;AACvB,SAAS,gBAAgB;AACzB,SAAS,0BAA0B;AACnC,OAAO,WAAW;AAElB,SAAS,uBAAuB,SAAiB,YAA4B;AAC3E,QAAM,WAAW,QAAQ,MAAM,IAAI;AACnC,MAAI,SAAS,UAAU,oBAAoB;AACzC,WAAO,SAAS,KAAK,IAAI;AAAA,EAC3B;AAGA,QAAM,YAAY,SAAS,MAAM,CAAC,kBAAkB;AACpD,SAAO;AAAA,IACL,MAAM;AAAA,MACJ,gBAAgB,kBAAkB,aAAa,UAAU;AAAA,IAC3D;AAAA,IACA,GAAG;AAAA,EACL,EAAE,KAAK,IAAI;AACb;AAEO,SAAS,WAAW;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,GAMG;AACD,SACE,oCAAC,OAAI,gBAAe,iBAAgB,OAAM,UACxC,oCAAC,OAAI,eAAc,SACjB,oCAAC,YAAK,qBAAoB,GAC1B,oCAAC,OAAI,eAAc,YACjB,oCAAC,QAAK,OAAO,UAAU,SAAS,EAAE,QAAQ,UACvC,UACG,QAAQ,KAAK,IACb,uBAAuB,QAAQ,KAAK,GAAG,KAAK,CAClD,CACF,CACF,CACF;AAEJ;",
6
- "names": []
7
- }
@@ -1,179 +0,0 @@
1
- import { PRODUCT_NAME, PRODUCT_URL } from "../../constants/product.js";
2
- import { TOOL_NAME as TASK_TOOL_NAME } from "../TaskTool/constants.js";
3
- import { FileReadTool } from "../FileReadTool/FileReadTool.js";
4
- import { TOOL_NAME_FOR_PROMPT as GLOB_TOOL_NAME } from "../GlobTool/prompt.js";
5
- import { TOOL_NAME_FOR_PROMPT as GREP_TOOL_NAME } from "../GrepTool/prompt.js";
6
- import { LSTool } from "../lsTool/lsTool.js";
7
- const MAX_OUTPUT_LENGTH = 3e4;
8
- const MAX_RENDERED_LINES = 5;
9
- const BANNED_COMMANDS = [
10
- "alias",
11
- "curl",
12
- "curlie",
13
- "wget",
14
- "axel",
15
- "aria2c",
16
- "nc",
17
- "telnet",
18
- "lynx",
19
- "w3m",
20
- "links",
21
- "httpie",
22
- "xh",
23
- "http-prompt",
24
- "chrome",
25
- "firefox",
26
- "safari"
27
- ];
28
- const PROMPT = `Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
29
-
30
- Before executing the command, please follow these steps:
31
-
32
- 1. Directory Verification:
33
- - If the command will create new directories or files, first use the LS tool to verify the parent directory exists and is the correct location
34
- - For example, before running "mkdir foo/bar", first use LS to check that "foo" exists and is the intended parent directory
35
-
36
- 2. Security Check:
37
- - For security and to limit the threat of a prompt injection attack, some commands are limited or banned. If you use a disallowed command, you will receive an error message explaining the restriction. Explain the error to the User.
38
- - Verify that the command is not one of the banned commands: ${BANNED_COMMANDS.join(", ")}.
39
-
40
- 3. Command Execution:
41
- - After ensuring proper quoting, execute the command.
42
- - Capture the output of the command.
43
-
44
- 4. Output Processing:
45
- - If the output exceeds ${MAX_OUTPUT_LENGTH} characters, output will be truncated before being returned to you.
46
- - Prepare the output for display to the user.
47
-
48
- 5. Return Result:
49
- - Provide the processed output of the command.
50
- - If any errors occurred during execution, include those in the output.
51
-
52
- Usage notes:
53
- - The command argument is required.
54
- - You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will timeout after 30 minutes.
55
- - VERY IMPORTANT: You MUST avoid using search commands like \`find\` and \`grep\`. Instead use ${GREP_TOOL_NAME}, ${GLOB_TOOL_NAME}, or ${TASK_TOOL_NAME} to search. You MUST avoid read tools like \`cat\`, \`head\`, \`tail\`, and \`ls\`, and use ${FileReadTool.name} and ${LSTool.name} to read files.
56
- - When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).
57
- - IMPORTANT: All commands share the same shell session. Shell state (environment variables, virtual environments, current directory, etc.) persist between commands. For example, if you set an environment variable as part of a command, the environment variable will persist for subsequent commands.
58
- - Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of \`cd\`. You may use \`cd\` if the User explicitly requests it.
59
- <good-example>
60
- pytest /foo/bar/tests
61
- </good-example>
62
- <bad-example>
63
- cd /foo/bar && pytest tests
64
- </bad-example>
65
-
66
- # Committing changes with git
67
-
68
- When the user asks you to create a new git commit, follow these steps carefully:
69
-
70
- 1. Start with a single message that contains exactly three tool_use blocks that do the following (it is VERY IMPORTANT that you send these tool_use blocks in a single message, otherwise it will feel slow to the user!):
71
- - Run a git status command to see all untracked files.
72
- - Run a git diff command to see both staged and unstaged changes that will be committed.
73
- - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
74
-
75
- 2. Use the git context at the start of this conversation to determine which files are relevant to your commit. Add relevant untracked files to the staging area. Do not commit files that were already modified at the start of this conversation, if they are not relevant to your commit.
76
-
77
- 3. Analyze all staged changes (both previously staged and newly added) and draft a commit message. Wrap your analysis process in <commit_analysis> tags:
78
-
79
- <commit_analysis>
80
- - List the files that have been changed or added
81
- - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)
82
- - Brainstorm the purpose or motivation behind these changes
83
- - Do not use tools to explore code, beyond what is available in the git context
84
- - Assess the impact of these changes on the overall project
85
- - Check for any sensitive information that shouldn't be committed
86
- - Draft a concise (1-2 sentences) commit message that focuses on the "why" rather than the "what"
87
- - Ensure your language is clear, concise, and to the point
88
- - Ensure the message accurately reflects the changes and their purpose (i.e. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.)
89
- - Ensure the message is not generic (avoid words like "Update" or "Fix" without context)
90
- - Review the draft message to ensure it accurately reflects the changes and their purpose
91
- </commit_analysis>
92
-
93
- 4. Create the commit with a message ending with:
94
- \u{1F916} Generated with ${PRODUCT_NAME} & {MODEL_NAME}
95
- Co-Authored-By: ${PRODUCT_NAME} <noreply@${PRODUCT_NAME}.com>
96
-
97
- - In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
98
- <example>
99
- git commit -m "$(cat <<'EOF'
100
- Commit message here.
101
-
102
- \u{1F916} Generated with ${PRODUCT_NAME} & {MODEL_NAME}
103
- Co-Authored-By: ${PRODUCT_NAME} <noreply@${PRODUCT_NAME}.com>
104
- EOF
105
- )"
106
- </example>
107
-
108
- 5. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.
109
-
110
- 6. Finally, run git status to make sure the commit succeeded.
111
-
112
- Important notes:
113
- - When possible, combine the "git add" and "git commit" commands into a single "git commit -am" command, to speed things up
114
- - However, be careful not to stage files (e.g. with \`git add .\`) for commits that aren't part of the change, they may have untracked files they want to keep around, but not commit.
115
- - NEVER update the git config
116
- - DO NOT push to the remote repository
117
- - IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.
118
- - If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
119
- - Ensure your commit message is meaningful and concise. It should explain the purpose of the changes, not just describe them.
120
- - Return an empty response - the user will see the git output directly
121
-
122
- # Creating pull requests
123
- Use the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.
124
-
125
- IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
126
-
127
- 1. Understand the current state of the branch. Remember to send a single message that contains multiple tool_use blocks (it is VERY IMPORTANT that you do this in a single message, otherwise it will feel slow to the user!):
128
- - Run a git status command to see all untracked files.
129
- - Run a git diff command to see both staged and unstaged changes that will be committed.
130
- - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote
131
- - Run a git log command and \`git diff main...HEAD\` to understand the full commit history for the current branch (from the time it diverged from the \`main\` branch.)
132
-
133
- 2. Create new branch if needed
134
-
135
- 3. Commit changes if needed
136
-
137
- 4. Push to remote with -u flag if needed
138
-
139
- 5. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (not just the latest commit, but all commits that will be included in the pull request!), and draft a pull request summary. Wrap your analysis process in <pr_analysis> tags:
140
-
141
- <pr_analysis>
142
- - List the commits since diverging from the main branch
143
- - Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)
144
- - Brainstorm the purpose or motivation behind these changes
145
- - Assess the impact of these changes on the overall project
146
- - Do not use tools to explore code, beyond what is available in the git context
147
- - Check for any sensitive information that shouldn't be committed
148
- - Draft a concise (1-2 bullet points) pull request summary that focuses on the "why" rather than the "what"
149
- - Ensure the summary accurately reflects all changes since diverging from the main branch
150
- - Ensure your language is clear, concise, and to the point
151
- - Ensure the summary accurately reflects the changes and their purpose (ie. "add" means a wholly new feature, "update" means an enhancement to an existing feature, "fix" means a bug fix, etc.)
152
- - Ensure the summary is not generic (avoid words like "Update" or "Fix" without context)
153
- - Review the draft summary to ensure it accurately reflects the changes and their purpose
154
- </pr_analysis>
155
-
156
- 6. Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.
157
- <example>
158
- gh pr create --title "the pr title" --body "$(cat <<'EOF'
159
- ## Summary
160
- <1-3 bullet points>
161
-
162
- ## Test plan
163
- [Checklist of TODOs for testing the pull request...]
164
-
165
- \u{1F916} Generated with ${process.env.USER_TYPE === "ant" ? `[${PRODUCT_NAME}](${PRODUCT_URL})` : PRODUCT_NAME} & {MODEL_NAME}
166
- EOF
167
- )"
168
- </example>
169
-
170
- Important:
171
- - Return an empty response - the user will see the gh output directly
172
- - Never update git config`;
173
- export {
174
- BANNED_COMMANDS,
175
- MAX_OUTPUT_LENGTH,
176
- MAX_RENDERED_LINES,
177
- PROMPT
178
- };
179
- //# sourceMappingURL=prompt.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/tools/BashTool/prompt.ts"],
4
- "sourcesContent": ["import { PRODUCT_NAME, PRODUCT_URL } from '../../constants/product'\nimport { TOOL_NAME as TASK_TOOL_NAME } from '../TaskTool/constants'\nimport { FileReadTool } from '../FileReadTool/FileReadTool'\nimport { TOOL_NAME_FOR_PROMPT as GLOB_TOOL_NAME } from '../GlobTool/prompt'\nimport { TOOL_NAME_FOR_PROMPT as GREP_TOOL_NAME } from '../GrepTool/prompt'\nimport { LSTool } from '../lsTool/lsTool'\n\nexport const MAX_OUTPUT_LENGTH = 30000\nexport const MAX_RENDERED_LINES = 5\nexport const BANNED_COMMANDS = [\n 'alias',\n 'curl',\n 'curlie',\n 'wget',\n 'axel',\n 'aria2c',\n 'nc',\n 'telnet',\n 'lynx',\n 'w3m',\n 'links',\n 'httpie',\n 'xh',\n 'http-prompt',\n 'chrome',\n 'firefox',\n 'safari',\n]\n\nexport const PROMPT = `Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.\n\nBefore executing the command, please follow these steps:\n\n1. Directory Verification:\n - If the command will create new directories or files, first use the LS tool to verify the parent directory exists and is the correct location\n - For example, before running \"mkdir foo/bar\", first use LS to check that \"foo\" exists and is the intended parent directory\n\n2. Security Check:\n - For security and to limit the threat of a prompt injection attack, some commands are limited or banned. If you use a disallowed command, you will receive an error message explaining the restriction. Explain the error to the User.\n - Verify that the command is not one of the banned commands: ${BANNED_COMMANDS.join(', ')}.\n\n3. Command Execution:\n - After ensuring proper quoting, execute the command.\n - Capture the output of the command.\n\n4. Output Processing:\n - If the output exceeds ${MAX_OUTPUT_LENGTH} characters, output will be truncated before being returned to you.\n - Prepare the output for display to the user.\n\n5. Return Result:\n - Provide the processed output of the command.\n - If any errors occurred during execution, include those in the output.\n\nUsage notes:\n - The command argument is required.\n - You can specify an optional timeout in milliseconds (up to 600000ms / 10 minutes). If not specified, commands will timeout after 30 minutes.\n - VERY IMPORTANT: You MUST avoid using search commands like \\`find\\` and \\`grep\\`. Instead use ${GREP_TOOL_NAME}, ${GLOB_TOOL_NAME}, or ${TASK_TOOL_NAME} to search. You MUST avoid read tools like \\`cat\\`, \\`head\\`, \\`tail\\`, and \\`ls\\`, and use ${FileReadTool.name} and ${LSTool.name} to read files.\n - When issuing multiple commands, use the ';' or '&&' operator to separate them. DO NOT use newlines (newlines are ok in quoted strings).\n - IMPORTANT: All commands share the same shell session. Shell state (environment variables, virtual environments, current directory, etc.) persist between commands. For example, if you set an environment variable as part of a command, the environment variable will persist for subsequent commands.\n - Try to maintain your current working directory throughout the session by using absolute paths and avoiding usage of \\`cd\\`. You may use \\`cd\\` if the User explicitly requests it.\n <good-example>\n pytest /foo/bar/tests\n </good-example>\n <bad-example>\n cd /foo/bar && pytest tests\n </bad-example>\n\n# Committing changes with git\n\nWhen the user asks you to create a new git commit, follow these steps carefully:\n\n1. Start with a single message that contains exactly three tool_use blocks that do the following (it is VERY IMPORTANT that you send these tool_use blocks in a single message, otherwise it will feel slow to the user!):\n - Run a git status command to see all untracked files.\n - Run a git diff command to see both staged and unstaged changes that will be committed.\n - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.\n\n2. Use the git context at the start of this conversation to determine which files are relevant to your commit. Add relevant untracked files to the staging area. Do not commit files that were already modified at the start of this conversation, if they are not relevant to your commit.\n\n3. Analyze all staged changes (both previously staged and newly added) and draft a commit message. Wrap your analysis process in <commit_analysis> tags:\n\n<commit_analysis>\n- List the files that have been changed or added\n- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)\n- Brainstorm the purpose or motivation behind these changes\n- Do not use tools to explore code, beyond what is available in the git context\n- Assess the impact of these changes on the overall project\n- Check for any sensitive information that shouldn't be committed\n- Draft a concise (1-2 sentences) commit message that focuses on the \"why\" rather than the \"what\"\n- Ensure your language is clear, concise, and to the point\n- Ensure the message accurately reflects the changes and their purpose (i.e. \"add\" means a wholly new feature, \"update\" means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)\n- Ensure the message is not generic (avoid words like \"Update\" or \"Fix\" without context)\n- Review the draft message to ensure it accurately reflects the changes and their purpose\n</commit_analysis>\n\n4. Create the commit with a message ending with:\n\uD83E\uDD16 Generated with ${PRODUCT_NAME} & {MODEL_NAME}\nCo-Authored-By: ${PRODUCT_NAME} <noreply@${PRODUCT_NAME}.com>\n\n- In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:\n<example>\ngit commit -m \"$(cat <<'EOF'\n Commit message here.\n\n \uD83E\uDD16 Generated with ${PRODUCT_NAME} & {MODEL_NAME}\n Co-Authored-By: ${PRODUCT_NAME} <noreply@${PRODUCT_NAME}.com>\n EOF\n )\"\n</example>\n\n5. If the commit fails due to pre-commit hook changes, retry the commit ONCE to include these automated changes. If it fails again, it usually means a pre-commit hook is preventing the commit. If the commit succeeds but you notice that files were modified by the pre-commit hook, you MUST amend your commit to include them.\n\n6. Finally, run git status to make sure the commit succeeded.\n\nImportant notes:\n- When possible, combine the \"git add\" and \"git commit\" commands into a single \"git commit -am\" command, to speed things up\n- However, be careful not to stage files (e.g. with \\`git add .\\`) for commits that aren't part of the change, they may have untracked files they want to keep around, but not commit.\n- NEVER update the git config\n- DO NOT push to the remote repository\n- IMPORTANT: Never use git commands with the -i flag (like git rebase -i or git add -i) since they require interactive input which is not supported.\n- If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit\n- Ensure your commit message is meaningful and concise. It should explain the purpose of the changes, not just describe them.\n- Return an empty response - the user will see the git output directly\n\n# Creating pull requests\nUse the gh command via the Bash tool for ALL GitHub-related tasks including working with issues, pull requests, checks, and releases. If given a Github URL use the gh command to get the information needed.\n\nIMPORTANT: When the user asks you to create a pull request, follow these steps carefully:\n\n1. Understand the current state of the branch. Remember to send a single message that contains multiple tool_use blocks (it is VERY IMPORTANT that you do this in a single message, otherwise it will feel slow to the user!):\n - Run a git status command to see all untracked files.\n - Run a git diff command to see both staged and unstaged changes that will be committed.\n - Check if the current branch tracks a remote branch and is up to date with the remote, so you know if you need to push to the remote\n - Run a git log command and \\`git diff main...HEAD\\` to understand the full commit history for the current branch (from the time it diverged from the \\`main\\` branch.)\n\n2. Create new branch if needed\n\n3. Commit changes if needed\n\n4. Push to remote with -u flag if needed\n\n5. Analyze all changes that will be included in the pull request, making sure to look at all relevant commits (not just the latest commit, but all commits that will be included in the pull request!), and draft a pull request summary. Wrap your analysis process in <pr_analysis> tags:\n\n<pr_analysis>\n- List the commits since diverging from the main branch\n- Summarize the nature of the changes (eg. new feature, enhancement to an existing feature, bug fix, refactoring, test, docs, etc.)\n- Brainstorm the purpose or motivation behind these changes\n- Assess the impact of these changes on the overall project\n- Do not use tools to explore code, beyond what is available in the git context\n- Check for any sensitive information that shouldn't be committed\n- Draft a concise (1-2 bullet points) pull request summary that focuses on the \"why\" rather than the \"what\"\n- Ensure the summary accurately reflects all changes since diverging from the main branch\n- Ensure your language is clear, concise, and to the point\n- Ensure the summary accurately reflects the changes and their purpose (ie. \"add\" means a wholly new feature, \"update\" means an enhancement to an existing feature, \"fix\" means a bug fix, etc.)\n- Ensure the summary is not generic (avoid words like \"Update\" or \"Fix\" without context)\n- Review the draft summary to ensure it accurately reflects the changes and their purpose\n</pr_analysis>\n\n6. Create PR using gh pr create with the format below. Use a HEREDOC to pass the body to ensure correct formatting.\n<example>\ngh pr create --title \"the pr title\" --body \"$(cat <<'EOF'\n## Summary\n<1-3 bullet points>\n\n## Test plan\n[Checklist of TODOs for testing the pull request...]\n\n\uD83E\uDD16 Generated with ${process.env.USER_TYPE === 'ant' ? `[${PRODUCT_NAME}](${PRODUCT_URL})` : PRODUCT_NAME} & {MODEL_NAME}\nEOF\n)\"\n</example>\n\nImportant:\n- Return an empty response - the user will see the gh output directly\n- Never update git config`\n"],
5
- "mappings": "AAAA,SAAS,cAAc,mBAAmB;AAC1C,SAAS,aAAa,sBAAsB;AAC5C,SAAS,oBAAoB;AAC7B,SAAS,wBAAwB,sBAAsB;AACvD,SAAS,wBAAwB,sBAAsB;AACvD,SAAS,cAAc;AAEhB,MAAM,oBAAoB;AAC1B,MAAM,qBAAqB;AAC3B,MAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAEO,MAAM,SAAS;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kEAU4C,gBAAgB,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,6BAO/D,iBAAiB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mGAUqD,cAAc,KAAK,cAAc,QAAQ,cAAc,+FAA+F,aAAa,IAAI,QAAQ,OAAO,IAAI;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BAuCzQ,YAAY;AAAA,kBACd,YAAY,aAAa,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,8BAOhC,YAAY;AAAA,qBACd,YAAY,aAAa,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,2BA8DtC,QAAQ,IAAI,cAAc,QAAQ,IAAI,YAAY,KAAK,WAAW,MAAM,YAAY;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;",
6
- "names": []
7
- }
@@ -1,51 +0,0 @@
1
- import { queryQuick } from "../../services/claude.js";
2
- import { extractTag } from "../../utils/messages.js";
3
- import { MAX_OUTPUT_LENGTH } from "./prompt.js";
4
- function formatOutput(content) {
5
- if (content.length <= MAX_OUTPUT_LENGTH) {
6
- return {
7
- totalLines: content.split("\n").length,
8
- truncatedContent: content
9
- };
10
- }
11
- const halfLength = MAX_OUTPUT_LENGTH / 2;
12
- const start = content.slice(0, halfLength);
13
- const end = content.slice(-halfLength);
14
- const truncated = `${start}
15
-
16
- ... [${content.slice(halfLength, -halfLength).split("\n").length} lines truncated] ...
17
-
18
- ${end}`;
19
- return {
20
- totalLines: content.split("\n").length,
21
- truncatedContent: truncated
22
- };
23
- }
24
- async function getCommandFilePaths(command, output) {
25
- const response = await queryQuick({
26
- systemPrompt: [
27
- `Extract any file paths that this command reads or modifies. For commands like "git diff" and "cat", include the paths of files being shown. Use paths verbatim -- don't add any slashes or try to resolve them. Do not try to infer paths that were not explicitly listed in the command output.
28
- Format your response as:
29
- <filepaths>
30
- path/to/file1
31
- path/to/file2
32
- </filepaths>
33
-
34
- If no files are read or modified, return empty filepaths tags:
35
- <filepaths>
36
- </filepaths>
37
-
38
- Do not include any other text in your response.`
39
- ],
40
- userPrompt: `Command: ${command}
41
- Output: ${output}`,
42
- enablePromptCaching: true
43
- });
44
- const content = response.message.content.filter((_) => _.type === "text").map((_) => _.text).join("");
45
- return extractTag(content, "filepaths")?.trim().split("\n").filter(Boolean) || [];
46
- }
47
- export {
48
- formatOutput,
49
- getCommandFilePaths
50
- };
51
- //# sourceMappingURL=utils.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../src/tools/BashTool/utils.ts"],
4
- "sourcesContent": ["import { queryQuick } from '../../services/claude'\nimport { extractTag } from '../../utils/messages'\nimport { MAX_OUTPUT_LENGTH } from './prompt'\n\nexport function formatOutput(content: string): {\n totalLines: number\n truncatedContent: string\n} {\n if (content.length <= MAX_OUTPUT_LENGTH) {\n return {\n totalLines: content.split('\\n').length,\n truncatedContent: content,\n }\n }\n const halfLength = MAX_OUTPUT_LENGTH / 2\n const start = content.slice(0, halfLength)\n const end = content.slice(-halfLength)\n const truncated = `${start}\\n\\n... [${content.slice(halfLength, -halfLength).split('\\n').length} lines truncated] ...\\n\\n${end}`\n\n return {\n totalLines: content.split('\\n').length,\n truncatedContent: truncated,\n }\n}\n\nexport async function getCommandFilePaths(\n command: string,\n output: string,\n): Promise<string[]> {\n const response = await queryQuick({\n systemPrompt: [\n `Extract any file paths that this command reads or modifies. For commands like \"git diff\" and \"cat\", include the paths of files being shown. Use paths verbatim -- don't add any slashes or try to resolve them. Do not try to infer paths that were not explicitly listed in the command output.\nFormat your response as:\n<filepaths>\npath/to/file1\npath/to/file2\n</filepaths>\n\nIf no files are read or modified, return empty filepaths tags:\n<filepaths>\n</filepaths>\n\nDo not include any other text in your response.`,\n ],\n userPrompt: `Command: ${command}\\nOutput: ${output}`,\n enablePromptCaching: true,\n })\n const content = response.message.content\n .filter(_ => _.type === 'text')\n .map(_ => _.text)\n .join('')\n\n return (\n extractTag(content, 'filepaths')?.trim().split('\\n').filter(Boolean) || []\n )\n}\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,kBAAkB;AAC3B,SAAS,yBAAyB;AAE3B,SAAS,aAAa,SAG3B;AACA,MAAI,QAAQ,UAAU,mBAAmB;AACvC,WAAO;AAAA,MACL,YAAY,QAAQ,MAAM,IAAI,EAAE;AAAA,MAChC,kBAAkB;AAAA,IACpB;AAAA,EACF;AACA,QAAM,aAAa,oBAAoB;AACvC,QAAM,QAAQ,QAAQ,MAAM,GAAG,UAAU;AACzC,QAAM,MAAM,QAAQ,MAAM,CAAC,UAAU;AACrC,QAAM,YAAY,GAAG,KAAK;AAAA;AAAA,OAAY,QAAQ,MAAM,YAAY,CAAC,UAAU,EAAE,MAAM,IAAI,EAAE,MAAM;AAAA;AAAA,EAA4B,GAAG;AAE9H,SAAO;AAAA,IACL,YAAY,QAAQ,MAAM,IAAI,EAAE;AAAA,IAChC,kBAAkB;AAAA,EACpB;AACF;AAEA,eAAsB,oBACpB,SACA,QACmB;AACnB,QAAM,WAAW,MAAM,WAAW;AAAA,IAChC,cAAc;AAAA,MACZ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAYF;AAAA,IACA,YAAY,YAAY,OAAO;AAAA,UAAa,MAAM;AAAA,IAClD,qBAAqB;AAAA,EACvB,CAAC;AACD,QAAM,UAAU,SAAS,QAAQ,QAC9B,OAAO,OAAK,EAAE,SAAS,MAAM,EAC7B,IAAI,OAAK,EAAE,IAAI,EACf,KAAK,EAAE;AAEV,SACE,WAAW,SAAS,WAAW,GAAG,KAAK,EAAE,MAAM,IAAI,EAAE,OAAO,OAAO,KAAK,CAAC;AAE7E;",
6
- "names": []
7
- }