sema-core 1.0.11 → 1.0.13

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 (325) hide show
  1. package/README.md +6 -11
  2. package/dist/core/Conversation.d.ts +6 -1
  3. package/dist/core/Conversation.d.ts.map +1 -1
  4. package/dist/core/Conversation.js +72 -28
  5. package/dist/core/Conversation.js.map +1 -1
  6. package/dist/core/RunTools.d.ts.map +1 -1
  7. package/dist/core/RunTools.js +1 -1
  8. package/dist/core/RunTools.js.map +1 -1
  9. package/dist/core/SemaCore.d.ts +16 -0
  10. package/dist/core/SemaCore.d.ts.map +1 -1
  11. package/dist/core/SemaCore.js +30 -3
  12. package/dist/core/SemaCore.js.map +1 -1
  13. package/dist/core/SemaEngine.d.ts +2 -18
  14. package/dist/core/SemaEngine.d.ts.map +1 -1
  15. package/dist/core/SemaEngine.js +101 -131
  16. package/dist/core/SemaEngine.js.map +1 -1
  17. package/dist/events/EventSystem.d.ts.map +1 -1
  18. package/dist/events/EventSystem.js +6 -2
  19. package/dist/events/EventSystem.js.map +1 -1
  20. package/dist/events/types.d.ts +60 -13
  21. package/dist/events/types.d.ts.map +1 -1
  22. package/dist/events/types.js +0 -1
  23. package/dist/events/types.js.map +1 -1
  24. package/dist/manager/ConfManager.d.ts.map +1 -1
  25. package/dist/manager/ConfManager.js +3 -1
  26. package/dist/manager/ConfManager.js.map +1 -1
  27. package/dist/manager/CronManager.d.ts +52 -0
  28. package/dist/manager/CronManager.d.ts.map +1 -0
  29. package/dist/manager/CronManager.js +426 -0
  30. package/dist/manager/CronManager.js.map +1 -0
  31. package/dist/manager/PermissionManager.d.ts +1 -1
  32. package/dist/manager/PermissionManager.d.ts.map +1 -1
  33. package/dist/manager/PermissionManager.js +63 -12
  34. package/dist/manager/PermissionManager.js.map +1 -1
  35. package/dist/manager/StateManager.d.ts +79 -11
  36. package/dist/manager/StateManager.d.ts.map +1 -1
  37. package/dist/manager/StateManager.js +287 -4
  38. package/dist/manager/StateManager.js.map +1 -1
  39. package/dist/manager/TaskManager.d.ts +106 -0
  40. package/dist/manager/TaskManager.d.ts.map +1 -0
  41. package/dist/manager/TaskManager.js +664 -0
  42. package/dist/manager/TaskManager.js.map +1 -0
  43. package/dist/services/agents/defaultBuiltInAgentsConfs.js +3 -3
  44. package/dist/services/agents/defaultBuiltInAgentsConfs.js.map +1 -1
  45. package/dist/services/agents/systemReminder.d.ts.map +1 -1
  46. package/dist/services/agents/systemReminder.js +8 -118
  47. package/dist/services/agents/systemReminder.js.map +1 -1
  48. package/dist/services/api/adapt/anthropic.js +2 -2
  49. package/dist/services/api/adapt/anthropic.js.map +1 -1
  50. package/dist/services/api/adapt/openai.js +2 -2
  51. package/dist/services/api/adapt/openai.js.map +1 -1
  52. package/dist/services/api/adapt/util.d.ts +1 -1
  53. package/dist/services/api/adapt/util.d.ts.map +1 -1
  54. package/dist/services/api/adapt/util.js +2 -2
  55. package/dist/services/api/adapt/util.js.map +1 -1
  56. package/dist/services/api/cache.d.ts.map +1 -1
  57. package/dist/services/api/cache.js +1 -3
  58. package/dist/services/api/cache.js.map +1 -1
  59. package/dist/services/api/queryLLM.d.ts.map +1 -1
  60. package/dist/services/api/queryLLM.js +5 -0
  61. package/dist/services/api/queryLLM.js.map +1 -1
  62. package/dist/services/commands/runCommand.d.ts.map +1 -1
  63. package/dist/services/commands/runCommand.js +12 -0
  64. package/dist/services/commands/runCommand.js.map +1 -1
  65. package/dist/services/mcp/MCPManager.d.ts.map +1 -1
  66. package/dist/services/mcp/MCPManager.js +6 -1
  67. package/dist/services/mcp/MCPManager.js.map +1 -1
  68. package/dist/services/plugins/pluginsManager.d.ts.map +1 -1
  69. package/dist/services/plugins/pluginsManager.js +8 -1
  70. package/dist/services/plugins/pluginsManager.js.map +1 -1
  71. package/dist/services/rules/rulesManager.d.ts +51 -0
  72. package/dist/services/rules/rulesManager.d.ts.map +1 -0
  73. package/dist/services/rules/rulesManager.js +192 -0
  74. package/dist/services/rules/rulesManager.js.map +1 -0
  75. package/dist/tools/Agent/Agent.d.ts +19 -11
  76. package/dist/tools/Agent/Agent.d.ts.map +1 -1
  77. package/dist/tools/Agent/Agent.js +249 -72
  78. package/dist/tools/Agent/Agent.js.map +1 -1
  79. package/dist/tools/Agent/prompt.d.ts.map +1 -1
  80. package/dist/tools/Agent/prompt.js +7 -9
  81. package/dist/tools/Agent/prompt.js.map +1 -1
  82. package/dist/tools/Bash/Bash.d.ts +21 -11
  83. package/dist/tools/Bash/Bash.d.ts.map +1 -1
  84. package/dist/tools/Bash/Bash.js +74 -17
  85. package/dist/tools/Bash/Bash.js.map +1 -1
  86. package/dist/tools/Bash/prompt.d.ts.map +1 -1
  87. package/dist/tools/Bash/prompt.js +53 -70
  88. package/dist/tools/Bash/prompt.js.map +1 -1
  89. package/dist/tools/Bash/utils.d.ts +5 -1
  90. package/dist/tools/Bash/utils.d.ts.map +1 -1
  91. package/dist/tools/Bash/utils.js +24 -4
  92. package/dist/tools/Bash/utils.js.map +1 -1
  93. package/dist/tools/CronCreate/CronCreate.d.ts +68 -0
  94. package/dist/tools/CronCreate/CronCreate.d.ts.map +1 -0
  95. package/dist/tools/CronCreate/CronCreate.js +75 -0
  96. package/dist/tools/CronCreate/CronCreate.js.map +1 -0
  97. package/dist/tools/CronCreate/prompt.d.ts +3 -0
  98. package/dist/tools/CronCreate/prompt.d.ts.map +1 -0
  99. package/dist/tools/CronCreate/prompt.js +41 -0
  100. package/dist/tools/CronCreate/prompt.js.map +1 -0
  101. package/dist/tools/CronDelete/CronDelete.d.ts +45 -0
  102. package/dist/tools/CronDelete/CronDelete.d.ts.map +1 -0
  103. package/dist/tools/CronDelete/CronDelete.js +51 -0
  104. package/dist/tools/CronDelete/CronDelete.js.map +1 -0
  105. package/dist/tools/CronDelete/prompt.d.ts +3 -0
  106. package/dist/tools/CronDelete/prompt.d.ts.map +1 -0
  107. package/dist/tools/CronDelete/prompt.js +6 -0
  108. package/dist/tools/CronDelete/prompt.js.map +1 -0
  109. package/dist/tools/CronList/CronList.d.ts +33 -0
  110. package/dist/tools/CronList/CronList.d.ts.map +1 -0
  111. package/dist/tools/CronList/CronList.js +55 -0
  112. package/dist/tools/CronList/CronList.js.map +1 -0
  113. package/dist/tools/CronList/prompt.d.ts +3 -0
  114. package/dist/tools/CronList/prompt.d.ts.map +1 -0
  115. package/dist/tools/CronList/prompt.js +6 -0
  116. package/dist/tools/CronList/prompt.js.map +1 -0
  117. package/dist/tools/Edit/Edit.d.ts.map +1 -1
  118. package/dist/tools/Edit/Edit.js +7 -3
  119. package/dist/tools/Edit/Edit.js.map +1 -1
  120. package/dist/tools/Edit/utils.d.ts.map +1 -1
  121. package/dist/tools/Edit/utils.js +14 -5
  122. package/dist/tools/Edit/utils.js.map +1 -1
  123. package/dist/tools/Grep/Grep.d.ts +4 -4
  124. package/dist/tools/NotebookEdit/NotebookEdit.js +1 -1
  125. package/dist/tools/NotebookEdit/NotebookEdit.js.map +1 -1
  126. package/dist/tools/Read/Read.d.ts +74 -3
  127. package/dist/tools/Read/Read.d.ts.map +1 -1
  128. package/dist/tools/Read/Read.js +188 -18
  129. package/dist/tools/Read/Read.js.map +1 -1
  130. package/dist/tools/Read/prompt.d.ts +1 -1
  131. package/dist/tools/Read/prompt.d.ts.map +1 -1
  132. package/dist/tools/Read/prompt.js +2 -1
  133. package/dist/tools/Read/prompt.js.map +1 -1
  134. package/dist/tools/Skill/Skill.d.ts +2 -1
  135. package/dist/tools/Skill/Skill.d.ts.map +1 -1
  136. package/dist/tools/Skill/Skill.js +3 -2
  137. package/dist/tools/Skill/Skill.js.map +1 -1
  138. package/dist/tools/TaskCreate/TaskCreate.d.ts +54 -0
  139. package/dist/tools/TaskCreate/TaskCreate.d.ts.map +1 -0
  140. package/dist/tools/TaskCreate/TaskCreate.js +51 -0
  141. package/dist/tools/TaskCreate/TaskCreate.js.map +1 -0
  142. package/dist/tools/TaskCreate/prompt.d.ts +3 -0
  143. package/dist/tools/TaskCreate/prompt.d.ts.map +1 -0
  144. package/dist/tools/TaskCreate/prompt.js +45 -0
  145. package/dist/tools/TaskCreate/prompt.js.map +1 -0
  146. package/dist/tools/TaskGet/TaskGet.d.ts +34 -0
  147. package/dist/tools/TaskGet/TaskGet.d.ts.map +1 -0
  148. package/dist/tools/TaskGet/TaskGet.js +57 -0
  149. package/dist/tools/TaskGet/TaskGet.js.map +1 -0
  150. package/dist/tools/TaskGet/prompt.d.ts +3 -0
  151. package/dist/tools/TaskGet/prompt.d.ts.map +1 -0
  152. package/dist/tools/TaskGet/prompt.js +26 -0
  153. package/dist/tools/TaskGet/prompt.js.map +1 -0
  154. package/dist/tools/TaskList/TaskList.d.ts +27 -0
  155. package/dist/tools/TaskList/TaskList.d.ts.map +1 -0
  156. package/dist/tools/TaskList/TaskList.js +56 -0
  157. package/dist/tools/TaskList/TaskList.js.map +1 -0
  158. package/dist/tools/TaskList/prompt.d.ts +3 -0
  159. package/dist/tools/TaskList/prompt.d.ts.map +1 -0
  160. package/dist/tools/TaskList/prompt.js +25 -0
  161. package/dist/tools/TaskList/prompt.js.map +1 -0
  162. package/dist/tools/TaskOutput/TaskOutput.d.ts +58 -0
  163. package/dist/tools/TaskOutput/TaskOutput.d.ts.map +1 -0
  164. package/dist/tools/TaskOutput/TaskOutput.js +95 -0
  165. package/dist/tools/TaskOutput/TaskOutput.js.map +1 -0
  166. package/dist/tools/TaskStop/TaskStop.d.ts +50 -0
  167. package/dist/tools/TaskStop/TaskStop.d.ts.map +1 -0
  168. package/dist/tools/TaskStop/TaskStop.js +69 -0
  169. package/dist/tools/TaskStop/TaskStop.js.map +1 -0
  170. package/dist/tools/TaskUpdate/TaskUpdate.d.ts +88 -0
  171. package/dist/tools/TaskUpdate/TaskUpdate.d.ts.map +1 -0
  172. package/dist/tools/TaskUpdate/TaskUpdate.js +115 -0
  173. package/dist/tools/TaskUpdate/TaskUpdate.js.map +1 -0
  174. package/dist/tools/TaskUpdate/prompt.d.ts +3 -0
  175. package/dist/tools/TaskUpdate/prompt.d.ts.map +1 -0
  176. package/dist/tools/TaskUpdate/prompt.js +80 -0
  177. package/dist/tools/TaskUpdate/prompt.js.map +1 -0
  178. package/dist/tools/WebFetch/WebFetch.d.ts +62 -0
  179. package/dist/tools/WebFetch/WebFetch.d.ts.map +1 -0
  180. package/dist/tools/WebFetch/WebFetch.js +143 -0
  181. package/dist/tools/WebFetch/WebFetch.js.map +1 -0
  182. package/dist/tools/WebFetch/prompt.d.ts +4 -0
  183. package/dist/tools/WebFetch/prompt.d.ts.map +1 -0
  184. package/dist/tools/WebFetch/prompt.js +38 -0
  185. package/dist/tools/WebFetch/prompt.js.map +1 -0
  186. package/dist/tools/WebFetch/utils.d.ts +20 -0
  187. package/dist/tools/WebFetch/utils.d.ts.map +1 -0
  188. package/dist/tools/WebFetch/utils.js +223 -0
  189. package/dist/tools/WebFetch/utils.js.map +1 -0
  190. package/dist/tools/Write/Write.js +1 -1
  191. package/dist/tools/Write/Write.js.map +1 -1
  192. package/dist/tools/base/Tool.d.ts +1 -0
  193. package/dist/tools/base/Tool.d.ts.map +1 -1
  194. package/dist/tools/base/tools.d.ts +4 -2
  195. package/dist/tools/base/tools.d.ts.map +1 -1
  196. package/dist/tools/base/tools.js +61 -14
  197. package/dist/tools/base/tools.js.map +1 -1
  198. package/dist/types/cron.d.ts +21 -0
  199. package/dist/types/cron.d.ts.map +1 -0
  200. package/dist/types/cron.js +6 -0
  201. package/dist/types/cron.js.map +1 -0
  202. package/dist/types/index.d.ts +9 -1
  203. package/dist/types/index.d.ts.map +1 -1
  204. package/dist/types/index.js +4 -2
  205. package/dist/types/index.js.map +1 -1
  206. package/dist/types/rule.d.ts +8 -0
  207. package/dist/types/rule.d.ts.map +1 -0
  208. package/dist/types/rule.js +3 -0
  209. package/dist/types/rule.js.map +1 -0
  210. package/dist/types/task.d.ts +93 -0
  211. package/dist/types/task.d.ts.map +1 -0
  212. package/dist/types/task.js +3 -0
  213. package/dist/types/task.js.map +1 -0
  214. package/dist/types/todoTask.d.ts +29 -0
  215. package/dist/types/todoTask.d.ts.map +1 -0
  216. package/dist/types/todoTask.js +6 -0
  217. package/dist/types/todoTask.js.map +1 -0
  218. package/dist/util/assembleTools.d.ts +6 -0
  219. package/dist/util/assembleTools.d.ts.map +1 -0
  220. package/dist/util/assembleTools.js +17 -0
  221. package/dist/util/assembleTools.js.map +1 -0
  222. package/dist/util/btw.d.ts +6 -0
  223. package/dist/util/btw.d.ts.map +1 -0
  224. package/dist/util/btw.js +80 -0
  225. package/dist/util/btw.js.map +1 -0
  226. package/dist/util/compact.d.ts +16 -4
  227. package/dist/util/compact.d.ts.map +1 -1
  228. package/dist/util/compact.js +12 -18
  229. package/dist/util/compact.js.map +1 -1
  230. package/dist/util/cron.d.ts +17 -0
  231. package/dist/util/cron.d.ts.map +1 -0
  232. package/dist/util/cron.js +82 -0
  233. package/dist/util/cron.js.map +1 -0
  234. package/dist/util/file.d.ts +16 -0
  235. package/dist/util/file.d.ts.map +1 -1
  236. package/dist/util/file.js +55 -0
  237. package/dist/util/file.js.map +1 -1
  238. package/dist/util/fileReference.d.ts.map +1 -1
  239. package/dist/util/fileReference.js +10 -1
  240. package/dist/util/fileReference.js.map +1 -1
  241. package/dist/util/format.d.ts +6 -0
  242. package/dist/util/format.d.ts.map +1 -1
  243. package/dist/util/format.js +17 -0
  244. package/dist/util/format.js.map +1 -1
  245. package/dist/util/history.d.ts +4 -1
  246. package/dist/util/history.d.ts.map +1 -1
  247. package/dist/util/history.js +9 -5
  248. package/dist/util/history.js.map +1 -1
  249. package/dist/util/inputQueue.d.ts +19 -0
  250. package/dist/util/inputQueue.d.ts.map +1 -0
  251. package/dist/util/inputQueue.js +30 -0
  252. package/dist/util/inputQueue.js.map +1 -0
  253. package/dist/util/message.d.ts +4 -0
  254. package/dist/util/message.d.ts.map +1 -1
  255. package/dist/util/message.js +27 -0
  256. package/dist/util/message.js.map +1 -1
  257. package/dist/util/pdf.d.ts +83 -0
  258. package/dist/util/pdf.d.ts.map +1 -0
  259. package/dist/util/pdf.js +472 -0
  260. package/dist/util/pdf.js.map +1 -0
  261. package/dist/util/process.d.ts +10 -0
  262. package/dist/util/process.d.ts.map +1 -0
  263. package/dist/util/process.js +88 -0
  264. package/dist/util/process.js.map +1 -0
  265. package/dist/util/savePath.d.ts +0 -11
  266. package/dist/util/savePath.d.ts.map +1 -1
  267. package/dist/util/savePath.js +0 -17
  268. package/dist/util/savePath.js.map +1 -1
  269. package/dist/util/shell.d.ts +10 -1
  270. package/dist/util/shell.d.ts.map +1 -1
  271. package/dist/util/shell.js +89 -34
  272. package/dist/util/shell.js.map +1 -1
  273. package/dist/util/topic.d.ts +7 -0
  274. package/dist/util/topic.d.ts.map +1 -1
  275. package/dist/util/topic.js +40 -0
  276. package/dist/util/topic.js.map +1 -1
  277. package/package.json +2 -1
  278. package/dist/services/command/customCommands.d.ts +0 -1
  279. package/dist/services/command/customCommands.d.ts.map +0 -1
  280. package/dist/services/command/customCommands.js +0 -197
  281. package/dist/services/command/customCommands.js.map +0 -1
  282. package/dist/services/command/runCommand.d.ts +0 -18
  283. package/dist/services/command/runCommand.d.ts.map +0 -1
  284. package/dist/services/command/runCommand.js +0 -147
  285. package/dist/services/command/runCommand.js.map +0 -1
  286. package/dist/services/plugins/customCommands.d.ts +0 -29
  287. package/dist/services/plugins/customCommands.d.ts.map +0 -1
  288. package/dist/services/plugins/customCommands.js +0 -227
  289. package/dist/services/plugins/customCommands.js.map +0 -1
  290. package/dist/services/skill/skillLoader.d.ts +0 -17
  291. package/dist/services/skill/skillLoader.d.ts.map +0 -1
  292. package/dist/services/skill/skillLoader.js +0 -122
  293. package/dist/services/skill/skillLoader.js.map +0 -1
  294. package/dist/services/skill/skillParser.d.ts +0 -15
  295. package/dist/services/skill/skillParser.d.ts.map +0 -1
  296. package/dist/services/skill/skillParser.js +0 -66
  297. package/dist/services/skill/skillParser.js.map +0 -1
  298. package/dist/services/skill/skillRegistry.d.ts +0 -34
  299. package/dist/services/skill/skillRegistry.d.ts.map +0 -1
  300. package/dist/services/skill/skillRegistry.js +0 -98
  301. package/dist/services/skill/skillRegistry.js.map +0 -1
  302. package/dist/services/skill/skillsManager.d.ts +0 -79
  303. package/dist/services/skill/skillsManager.d.ts.map +0 -1
  304. package/dist/services/skill/skillsManager.js +0 -289
  305. package/dist/services/skill/skillsManager.js.map +0 -1
  306. package/dist/tools/Task/Task.d.ts +0 -59
  307. package/dist/tools/Task/Task.d.ts.map +0 -1
  308. package/dist/tools/Task/Task.js +0 -212
  309. package/dist/tools/Task/Task.js.map +0 -1
  310. package/dist/tools/Task/prompt.d.ts +0 -6
  311. package/dist/tools/Task/prompt.d.ts.map +0 -1
  312. package/dist/tools/Task/prompt.js +0 -75
  313. package/dist/tools/Task/prompt.js.map +0 -1
  314. package/dist/util/frontmatter.d.ts +0 -35
  315. package/dist/util/frontmatter.d.ts.map +0 -1
  316. package/dist/util/frontmatter.js +0 -119
  317. package/dist/util/frontmatter.js.map +0 -1
  318. package/dist/util/rules.d.ts +0 -6
  319. package/dist/util/rules.d.ts.map +0 -1
  320. package/dist/util/rules.js +0 -162
  321. package/dist/util/rules.js.map +0 -1
  322. package/dist/util/systemReminder.d.ts +0 -10
  323. package/dist/util/systemReminder.d.ts.map +0 -1
  324. package/dist/util/systemReminder.js +0 -177
  325. package/dist/util/systemReminder.js.map +0 -1
@@ -3,15 +3,18 @@ import { ValidationResult } from '../base/Tool';
3
3
  export declare const inputSchema: z.ZodObject<{
4
4
  command: z.ZodString;
5
5
  timeout: z.ZodOptional<z.ZodNumber>;
6
- description: z.ZodString;
6
+ description: z.ZodOptional<z.ZodString>;
7
+ run_in_background: z.ZodOptional<z.ZodBoolean>;
7
8
  }, "strict", z.ZodTypeAny, {
8
9
  command: string;
9
- description: string;
10
10
  timeout?: number | undefined;
11
+ description?: string | undefined;
12
+ run_in_background?: boolean | undefined;
11
13
  }, {
12
14
  command: string;
13
- description: string;
14
15
  timeout?: number | undefined;
16
+ description?: string | undefined;
17
+ run_in_background?: boolean | undefined;
15
18
  }>;
16
19
  export type Out = {
17
20
  stdout: string;
@@ -29,25 +32,30 @@ export declare const BashTool: {
29
32
  inputSchema: z.ZodObject<{
30
33
  command: z.ZodString;
31
34
  timeout: z.ZodOptional<z.ZodNumber>;
32
- description: z.ZodString;
35
+ description: z.ZodOptional<z.ZodString>;
36
+ run_in_background: z.ZodOptional<z.ZodBoolean>;
33
37
  }, "strict", z.ZodTypeAny, {
34
38
  command: string;
35
- description: string;
36
39
  timeout?: number | undefined;
40
+ description?: string | undefined;
41
+ run_in_background?: boolean | undefined;
37
42
  }, {
38
43
  command: string;
39
- description: string;
40
44
  timeout?: number | undefined;
45
+ description?: string | undefined;
46
+ run_in_background?: boolean | undefined;
41
47
  }>;
42
48
  validateInput({ command }: {
43
49
  command: string;
44
- description: string;
45
50
  timeout?: number | undefined;
51
+ description?: string | undefined;
52
+ run_in_background?: boolean | undefined;
46
53
  }, agentContext: any): Promise<ValidationResult>;
47
54
  genToolPermission(input: {
48
55
  command: string;
49
- description: string;
50
56
  timeout?: number | undefined;
57
+ description?: string | undefined;
58
+ run_in_background?: boolean | undefined;
51
59
  }): {
52
60
  title: string;
53
61
  content: string;
@@ -59,14 +67,16 @@ export declare const BashTool: {
59
67
  };
60
68
  getDisplayTitle(input: {
61
69
  command: string;
62
- description: string;
63
70
  timeout?: number | undefined;
71
+ description?: string | undefined;
72
+ run_in_background?: boolean | undefined;
64
73
  } | undefined): string;
65
74
  genResultForAssistant({ interrupted, stdout, stderr }: Out): string;
66
- call({ command, timeout }: {
75
+ call({ command, timeout, run_in_background }: {
67
76
  command: string;
68
- description: string;
69
77
  timeout?: number | undefined;
78
+ description?: string | undefined;
79
+ run_in_background?: boolean | undefined;
70
80
  }, agentContext: any): AsyncGenerator<{
71
81
  type: "result";
72
82
  data: Out;
@@ -1 +1 @@
1
- {"version":3,"file":"Bash.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/Bash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA2CrD,eAAO,MAAM,WAAW;;;;;;;;;;;;EAkBtB,CAAA;AAGF,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;qBAY4B,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;iEAmEtB,MAAM;;;;;qBAsB9C,GAAG;;;;;CA0GI,CAAA"}
1
+ {"version":3,"file":"Bash.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/Bash.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAQ,gBAAgB,EAAE,MAAM,cAAc,CAAA;AA6CrD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;EAsBtB,CAAA;AAGF,MAAM,MAAM,GAAG,GAAG;IAChB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,WAAW,EAAE,OAAO,CAAA;IACpB,OAAO,CAAC,EAAE,MAAM,CAAA;CACjB,CAAA;AAED,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;qBAY4B,GAAG,GAAG,OAAO,CAAC,gBAAgB,CAAC;;;;;;;;;;;;;;;;;;;;;iEAmEtB,MAAM;;;;;;qBAmB9C,GAAG;;;;;CA+KI,CAAA"}
@@ -7,9 +7,11 @@ const zod_1 = require("zod");
7
7
  const commands_1 = require("../../util/commands");
8
8
  const file_1 = require("../../util/file");
9
9
  const shell_1 = require("../../util/shell");
10
+ const TaskManager_1 = require("../../manager/TaskManager");
10
11
  const cwd_1 = require("../../util/cwd");
11
12
  const format_1 = require("../../util/format");
12
13
  const prompt_1 = require("./prompt");
14
+ const ConfManager_1 = require("../../manager/ConfManager");
13
15
  const utils_1 = require("./utils");
14
16
  const EventSystem_1 = require("../../events/EventSystem");
15
17
  const StateManager_1 = require("../../manager/StateManager");
@@ -47,7 +49,7 @@ exports.inputSchema = zod_1.z.strictObject({
47
49
  .number()
48
50
  .optional()
49
51
  .describe(`Optional timeout in milliseconds (max ${prompt_1.MAX_TIMEOUT_MS})`),
50
- description: zod_1.z.string().describe(`Clear, concise description of what this command does in 5-10 words, in active voice. Examples:
52
+ description: zod_1.z.string().optional().describe(`Clear, concise description of what this command does in 5-10 words, in active voice. Examples:
51
53
  Input: ls
52
54
  Output: List files in current directory
53
55
 
@@ -58,7 +60,11 @@ Input: npm install
58
60
  Output: Install package dependencies
59
61
 
60
62
  Input: mkdir foo
61
- Output: Create directory 'foo'`)
63
+ Output: Create directory 'foo'`),
64
+ run_in_background: zod_1.z
65
+ .boolean()
66
+ .optional()
67
+ .describe(`Set to true to run this command in the background. Use TaskOutput to read the output later.`),
62
68
  });
63
69
  exports.BashTool = {
64
70
  name: prompt_1.TOOL_NAME_FOR_PROMPT,
@@ -102,16 +108,16 @@ exports.BashTool = {
102
108
  const title = getTitle(input);
103
109
  return {
104
110
  title,
105
- content: input.description
111
+ content: input.description || ''
106
112
  };
107
113
  },
108
114
  genToolResultMessage({ stdout, stderr, interrupted, command }) {
109
115
  let result = '';
110
116
  if (stdout !== '') {
111
- result += (0, utils_1.formatOutput)(stdout.trim()).truncatedContent + '\n';
117
+ result += (0, utils_1.formatOutput)(stdout.trim(), utils_1.STDOUT_HEAD_TAIL_LINES).truncatedContent + '\n';
112
118
  }
113
119
  if (stderr !== '') {
114
- result += (0, utils_1.formatOutput)(stderr.trim()).truncatedContent + '\n';
120
+ result += (0, utils_1.formatOutput)(stderr.trim(), utils_1.STDERR_HEAD_TAIL_LINES).truncatedContent + '\n';
115
121
  }
116
122
  if (stdout === '' && stderr === '') {
117
123
  result = '(No content)';
@@ -127,27 +133,56 @@ exports.BashTool = {
127
133
  return getTitle(input);
128
134
  },
129
135
  genResultForAssistant({ interrupted, stdout, stderr }) {
130
- const headTailLines = 500;
131
136
  const { truncatedContent: stdoutContent } = stdout.trim()
132
- ? (0, utils_1.formatOutput)(stdout.trim(), headTailLines)
137
+ ? (0, utils_1.formatOutput)(stdout.trim(), utils_1.STDOUT_HEAD_TAIL_LINES)
133
138
  : { truncatedContent: '' };
134
139
  const { truncatedContent: stderrContent } = stderr.trim()
135
- ? (0, utils_1.formatOutput)(stderr.trim(), headTailLines)
140
+ ? (0, utils_1.formatOutput)(stderr.trim(), utils_1.STDERR_HEAD_TAIL_LINES)
136
141
  : { truncatedContent: '' };
137
142
  if (interrupted) {
138
- const errorMsg = stderrContent;
139
- return stdoutContent
140
- ? `${errorMsg}\n${message_1.INTERRUPT_MESSAGE_FOR_TOOL_USE}\n${stdoutContent}`
141
- : `${errorMsg}`;
143
+ const parts = [stdoutContent, message_1.INTERRUPT_MESSAGE_FOR_TOOL_USE, stderrContent].filter(Boolean);
144
+ return parts.join('\n');
142
145
  }
143
146
  const hasBoth = stdoutContent && stderrContent;
144
147
  const result = `${stdoutContent}${hasBoth ? '\n' : ''}${stderrContent}`;
145
148
  return result || '(no content)';
146
149
  },
147
- async *call({ command, timeout = prompt_1.DEFAULT_TIMEOUT_MS }, agentContext) {
150
+ async *call({ command, timeout = prompt_1.DEFAULT_TIMEOUT_MS, run_in_background }, agentContext) {
151
+ const abortController = agentContext.abortController;
152
+ // 子代理不支持后台执行,强制前台
153
+ const isSubAgent = agentContext.agentId !== StateManager_1.MAIN_AGENT_ID;
154
+ const disableBackground = (0, ConfManager_1.getConfManager)().getCoreConfig()?.disableBackgroundTasks ?? false;
155
+ // ① run_in_background=true → 直接 spawn 独立进程(仅主代理,且未禁用后台任务)
156
+ if (run_in_background && !isSubAgent && !disableBackground) {
157
+ try {
158
+ const { taskId, filepath } = (0, TaskManager_1.getTaskManager)().spawnBashTask(command, agentContext.currentToolUseID || '', agentContext);
159
+ const msg = `Command running in background. Task ID: ${taskId}. Output: ${filepath}`;
160
+ const data = {
161
+ stdout: msg,
162
+ stdoutLines: 1,
163
+ stderr: '',
164
+ stderrLines: 0,
165
+ interrupted: false,
166
+ command,
167
+ };
168
+ yield { type: 'result', data, resultForAssistant: msg };
169
+ }
170
+ catch (error) {
171
+ const errMsg = error instanceof Error ? error.message : String(error);
172
+ const data = {
173
+ stdout: '',
174
+ stdoutLines: 0,
175
+ stderr: errMsg,
176
+ stderrLines: 1,
177
+ interrupted: false,
178
+ command,
179
+ };
180
+ yield { type: 'result', data, resultForAssistant: errMsg };
181
+ }
182
+ return;
183
+ }
148
184
  let stdout = '';
149
185
  let stderr = '';
150
- const abortController = agentContext.abortController;
151
186
  if (abortController?.signal.aborted) {
152
187
  const data = {
153
188
  stdout: '',
@@ -174,9 +209,9 @@ exports.BashTool = {
174
209
  const onChunk = isMainAgent ? (chunkStdout, chunkStderr) => {
175
210
  let content = '';
176
211
  if (chunkStdout.trim())
177
- content += (0, utils_1.formatOutput)(chunkStdout.trim()).truncatedContent;
212
+ content += (0, utils_1.formatOutput)(chunkStdout.trim(), undefined, { resolveCR: false }).truncatedContent;
178
213
  if (chunkStderr.trim())
179
- content += (content ? '\n' : '') + (0, utils_1.formatOutput)(chunkStderr.trim()).truncatedContent;
214
+ content += (content ? '\n' : '') + (0, utils_1.formatOutput)(chunkStderr.trim(), undefined, { resolveCR: false }).truncatedContent;
180
215
  const chunkData = {
181
216
  agentId: agentContext.agentId,
182
217
  toolId: agentContext.currentToolUseID || '',
@@ -187,8 +222,30 @@ exports.BashTool = {
187
222
  };
188
223
  (0, EventSystem_1.getEventBus)().emit('tool:execution:chunk', chunkData);
189
224
  } : undefined;
225
+ // ② 超时接管回调(子代理不接管,超时直接 kill;禁用后台任务时同样直接 kill)
226
+ let bgTaskId;
227
+ let bgFilepath;
228
+ const onTimeout = (isSubAgent || disableBackground) ? undefined : (ctx) => {
229
+ const result = (0, TaskManager_1.getTaskManager)().takeoverTask(ctx, command, agentContext.currentToolUseID || '', agentContext);
230
+ bgTaskId = result.taskId;
231
+ bgFilepath = result.filepath;
232
+ };
190
233
  try {
191
- const result = await shell_1.PersistentShell.getInstance().exec(command, abortController?.signal, effectiveTimeout, onChunk);
234
+ const result = await shell_1.PersistentShell.getInstance().exec(command, abortController?.signal, effectiveTimeout, onChunk, onTimeout);
235
+ // ③ 超时接管标记(code === -1)
236
+ if (result.code === -1 && bgTaskId) {
237
+ const msg = `Command timed out after ${(0, shell_1.formatDuration)(effectiveTimeout)}, moved to background.\nTask ID: ${bgTaskId}.\nOutput: ${bgFilepath}`;
238
+ const data = {
239
+ stdout: msg,
240
+ stdoutLines: 1,
241
+ stderr: '',
242
+ stderrLines: 0,
243
+ interrupted: false,
244
+ command,
245
+ };
246
+ yield { type: 'result', data, resultForAssistant: msg };
247
+ return;
248
+ }
192
249
  stdout += (result.stdout || '').trim() + os_1.EOL;
193
250
  if (result.code !== 0) {
194
251
  stderr += `Exit code ${result.code}` + os_1.EOL;
@@ -1 +1 @@
1
- {"version":3,"file":"Bash.js","sourceRoot":"","sources":["../../../src/tools/Bash/Bash.ts"],"names":[],"mappings":";;;AAAA,2BAAwB;AACxB,+BAAoD;AACpD,6BAAuB;AAEvB,kDAAkD;AAClD,0CAA+C;AAC/C,4CAAkD;AAClD,wCAAuD;AACvD,8CAAyD;AACzD,qCAAgG;AAChG,mCAAsC;AACtC,0DAAsD;AAEtD,6DAA0D;AAC1D,qDAAwE;AAGxE,MAAM,eAAe,GAAG;IACtB,OAAO;IACP,MAAM;IACN,QAAQ;IACR,MAAM;IACN,MAAM;IACN,QAAQ;IACR,IAAI;IACJ,QAAQ;IACR,MAAM;IACN,KAAK;IACL,OAAO;IACP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AAM;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI;gBACJ,kBAAkB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;aACrD,CAAA;QACH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,SAAS,GAAG,eAAe,EAAE,MAAM,CAAC,OAAO,IAAI,KAAK,CAAA;YAC1D,MAAM,YAAY,GAAG,SAAS;gBAC5B,CAAC,CAAC,+BAA+B;gBACjC,CAAC,CAAC,mBAAmB,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,EAAE,CAAA;YAE/E,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,GAAG,IAAA,oBAAY,EAAC,MAAM,CAAC,IAAI,EAAE,CAAC,CAAA;YAChG,MAAM,IAAI,GAAQ;gBAChB,MAAM,EAAE,aAAa;gBACrB,WAAW;gBACX,MAAM,EAAE,YAAY;gBACpB,WAAW,EAAE,CAAC;gBACd,WAAW,EAAE,SAAS;gBACtB,OAAO;aACR,CAAA;YAED,MAAM;gBACJ,IAAI,EAAE,QAAQ;gBACd,IAAI;gBACJ,kBAAkB,EAAE,IAAI,CAAC,qBAAqB,CAAC,IAAI,CAAC;aACrD,CAAA;QACH,CAAC;IACH,CAAC;CACsB,CAAA"}
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/prompt.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,eAAO,MAAM,oBAAoB,SAAS,CAAA;AAE1C,eAAO,MAAM,WAAW,EAAE,MAkI8C,CAAA"}
1
+ {"version":3,"file":"prompt.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/prompt.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,SAAS,CAAC;AACrC,eAAO,MAAM,kBAAkB,SAAS,CAAC;AAEzC,eAAO,MAAM,oBAAoB,SAAS,CAAA;AAE1C,eAAO,MAAM,WAAW,EAAE,MAyH8C,CAAA"}
@@ -2,62 +2,47 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.DESCRIPTION = exports.TOOL_NAME_FOR_PROMPT = exports.DEFAULT_TIMEOUT_MS = exports.MAX_TIMEOUT_MS = void 0;
4
4
  const product_1 = require("../../constants/product");
5
- const prompt_1 = require("../Read/prompt");
6
- const prompt_2 = require("../Edit/prompt");
7
- const prompt_3 = require("../Write/prompt");
8
- const prompt_4 = require("../Agent/prompt");
9
- const prompt_5 = require("../Glob/prompt");
10
- const prompt_6 = require("../Grep/prompt");
11
- const prompt_7 = require("../TodoWrite/prompt");
12
- const MAX_OUTPUT_LENGTH = 30000;
13
5
  exports.MAX_TIMEOUT_MS = 600000; // 最大超时毫秒数 10分钟
14
6
  exports.DEFAULT_TIMEOUT_MS = 120000; // 默认超时毫秒数 2分钟
15
7
  exports.TOOL_NAME_FOR_PROMPT = 'Bash';
16
- exports.DESCRIPTION = `Executes a given bash command in a persistent shell session with optional timeout, ensuring proper handling and security measures.
17
-
18
- IMPORTANT: This tool is for terminal operations like git, npm, docker, etc. DO NOT use it for file operations (reading, writing, editing, searching, finding files) - use the specialized tools for this instead.
19
-
20
- Before executing the command, please follow these steps:
21
-
22
- 1. Directory Verification:
23
- - If the command will create new directories or files, first use \`ls\` to verify the parent directory exists and is the correct location
24
- - For example, before running "mkdir foo/bar", first use \`ls foo\` to check that "foo" exists and is the intended parent directory
25
-
26
- 2. Command Execution:
27
- - Always quote file paths that contain spaces with double quotes (e.g., cd "path with spaces/file.txt")
28
- - Examples of proper quoting:
29
- - cd "/Users/name/My Documents" (correct)
30
- - cd /Users/name/My Documents (incorrect - will fail)
31
- - python "/path/with spaces/script.py" (correct)
32
- - python /path/with spaces/script.py (incorrect - will fail)
33
- - After ensuring proper quoting, execute the command.
34
- - Capture the output of the command.
35
-
36
- Usage notes:
37
- - The command argument is required.
38
- - You can specify an optional timeout in milliseconds (up to ${exports.MAX_TIMEOUT_MS}ms / ${exports.MAX_TIMEOUT_MS / 60000}minutes). If not specified, commands will timeout after ${exports.DEFAULT_TIMEOUT_MS}ms (${exports.DEFAULT_TIMEOUT_MS / 60000} minutes).
39
- - It is very helpful if you write a clear, concise description of what this command does in 5-10 words.
40
- - If the output exceeds ${MAX_OUTPUT_LENGTH} characters, output will be truncated before being returned to you.
41
-
42
- - Avoid using Bash with the \`find\`, \`grep\`, \`cat\`, \`head\`, \`tail\`, \`sed\`, \`awk\`, or \`echo\` commands, unless explicitly instructed or when these commands are truly necessary for the task. Instead, always prefer using the dedicated tools for these commands:
43
- - File search: Use ${prompt_5.TOOL_NAME_FOR_PROMPT} (NOT find or ls)
44
- - Content search: Use ${prompt_6.TOOL_NAME_FOR_PROMPT} (NOT grep or rg)
45
- - Read files: Use ${prompt_1.TOOL_NAME_FOR_PROMPT} (NOT cat/head/tail)
46
- - Edit files: Use ${prompt_2.TOOL_NAME_FOR_PROMPT} (NOT sed/awk)
47
- - Write files: Use ${prompt_3.TOOL_NAME_FOR_PROMPT} (NOT echo >/cat <<EOF)
48
- - Communication: Output text directly (NOT echo/printf)
49
- - When issuing multiple commands:
50
- - If the commands are independent and can run in parallel, make multiple Bash tool calls in a single message. For example, if you need to run "git status" and "git diff", send a single message with two Bash tool calls in parallel.
51
- - If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together (e.g., \`git add . && git commit -m "message" && git push\`). For instance, if one operation must complete before another starts (like mkdir before cp, Write before Bash for git operations, or git add before git commit), run these operations sequentially instead.
52
- - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail
53
- - DO NOT use newlines to separate commands (newlines are ok in quoted strings)
54
- - 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.
55
- <good-example>
56
- pytest /foo/bar/tests
57
- </good-example>
58
- <bad-example>
59
- cd /foo/bar && pytest tests
60
- </bad-example>
8
+ exports.DESCRIPTION = `Executes a given bash command and returns its output.
9
+
10
+ The working directory persists between commands, but shell state does not. The shell environment is initialized from the user's profile (bash or zsh).
11
+
12
+ IMPORTANT: Avoid using this tool to run \`find\`, \`grep\`, \`cat\`, \`head\`, \`tail\`, \`sed\`, \`awk\`, or \`echo\` commands, unless explicitly instructed or after you have verified that a dedicated tool cannot accomplish your task. Instead, use the appropriate dedicated tool as this will provide a much better experience for the user:
13
+
14
+ - File search: Use Glob (NOT find or ls)
15
+ - Content search: Use Grep (NOT grep or rg)
16
+ - Read files: Use Read (NOT cat/head/tail)
17
+ - Edit files: Use Edit (NOT sed/awk)
18
+ - Write files: Use Write (NOT echo >/cat <<EOF)
19
+ - Communication: Output text directly (NOT echo/printf)
20
+ While the Bash tool can do similar things, it’s better to use the built-in tools as they provide a better user experience and make it easier to review tool calls and give permission.
21
+
22
+ # Instructions
23
+ - If your command will create new directories or files, first use this tool to run \`ls\` to verify the parent directory exists and is the correct location.
24
+ - Always quote file paths that contain spaces with double quotes in your command (e.g., cd "path with spaces/file.txt")
25
+ - 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.
26
+ - You may specify an optional timeout in milliseconds (up to ${exports.MAX_TIMEOUT_MS}ms / ${exports.MAX_TIMEOUT_MS / 60000} minutes). By default, your command will timeout after ${exports.DEFAULT_TIMEOUT_MS}ms (${exports.DEFAULT_TIMEOUT_MS / 60000} minutes).
27
+ - You can use the \`run_in_background\` parameter to run the command in the background. Only use this if you don't need the result immediately and are OK being notified when the command completes later. You do not need to check the output right away - you'll be notified when it finishes. You do not need to use '&' at the end of the command when using this parameter.
28
+ - Write a clear, concise description of what your command does. For simple commands, keep it brief (5-10 words). For complex commands (piped commands, obscure flags, or anything hard to understand at a glance), include enough context so that the user can understand what your command will do.
29
+ - When issuing multiple commands:
30
+ - If the commands are independent and can run in parallel, make multiple Bash tool calls in a single message. Example: if you need to run "git status" and "git diff", send a single message with two Bash tool calls in parallel.
31
+ - If the commands depend on each other and must run sequentially, use a single Bash call with '&&' to chain them together.
32
+ - Use ';' only when you need to run commands sequentially but don't care if earlier commands fail.
33
+ - DO NOT use newlines to separate commands (newlines are ok in quoted strings).
34
+ - For git commands:
35
+ - Prefer to create a new commit rather than amending an existing commit.
36
+ - Before running destructive operations (e.g., git reset --hard, git push --force, git checkout --), consider whether there is a safer alternative that achieves the same goal. Only use destructive operations when they are truly the best approach.
37
+ - Never skip hooks (--no-verify) or bypass signing (--no-gpg-sign, -c commit.gpgsign=false) unless the user has explicitly asked for it. If a hook fails, investigate and fix the underlying issue.
38
+ - Avoid unnecessary \`sleep\` commands:
39
+ - Do not sleep between commands that can run immediately — just run them.
40
+ - If your command is long running and you would like to be notified when it finishes – simply run your command using \`run_in_background\`. There is no need to sleep in this case.
41
+ - Do not retry failing commands in a sleep loop — diagnose the root cause or consider an alternative approach.
42
+ - If waiting for a background task you started with \`run_in_background\`, you will be notified when it completes do not poll.
43
+ - If you must poll an external process, use a check command (e.g. \`gh run view\`) rather than sleeping first.
44
+ - If you must sleep, keep the duration short (1-5 seconds) to avoid blocking the user.
45
+
61
46
 
62
47
  # Committing changes with git
63
48
 
@@ -65,15 +50,15 @@ Only create commits when requested by the user. If unclear, ask first. When the
65
50
 
66
51
  Git Safety Protocol:
67
52
  - NEVER update the git config
68
- - NEVER run destructive/irreversible git commands (like push --force, hard reset, etc) unless the user explicitly requests them
53
+ - NEVER run destructive git commands (push --force, reset --hard, checkout ., restore ., clean -f, branch -D) unless the user explicitly requests these actions. Taking unauthorized destructive actions is unhelpful and can result in lost work, so it's best to ONLY run these commands when given direct instructions
69
54
  - NEVER skip hooks (--no-verify, --no-gpg-sign, etc) unless the user explicitly requests it
70
55
  - NEVER run force push to main/master, warn the user if they request it
71
- - Avoid git commit --amend. ONLY use --amend when either (1) user explicitly requested amend OR (2) adding edits from pre-commit hook (additional instructions below)
72
- - Before amending: ALWAYS check authorship (git log -1 --format='%an %ae')
73
- - NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive.
56
+ - CRITICAL: Always create NEW commits rather than amending, unless the user explicitly requests a git amend. When a pre-commit hook fails, the commit did NOT happen — so --amend would modify the PREVIOUS commit, which may result in destroying work or losing previous changes. Instead, after hook failure, fix the issue, re-stage, and create a NEW commit
57
+ - When staging files, prefer adding specific files by name rather than using "git add -A" or "git add .", which can accidentally include sensitive files (.env, credentials) or large binaries
58
+ - NEVER commit changes unless the user explicitly asks you to. It is VERY IMPORTANT to only commit when explicitly asked, otherwise the user will feel that you are being too proactive
74
59
 
75
60
  1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel, each using the Bash tool:
76
- - Run a git status command to see all untracked files.
61
+ - Run a git status command to see all untracked files. IMPORTANT: Never use the -uall flag as it can cause memory issues on large repos.
77
62
  - Run a git diff command to see both staged and unstaged changes that will be committed.
78
63
  - Run a git log command to see recent commit messages, so that you can follow this repository's commit message style.
79
64
  2. Analyze all staged changes (both previously staged and newly added) and draft a commit message:
@@ -84,28 +69,24 @@ Git Safety Protocol:
84
69
  3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands:
85
70
  - Add relevant untracked files to the staging area.
86
71
  - Create the commit with a message ending with:
87
- 🤖 Generated with [${product_1.PRODUCT_NAME}](${product_1.PRODUCT_URL})
88
-
72
+ Co-Authored-By: [${product_1.PRODUCT_NAME}](${product_1.PRODUCT_URL})
89
73
  - Run git status after the commit completes to verify success.
90
74
  Note: git status depends on the commit completing, so run it sequentially after the commit.
91
- 4. If the commit fails due to pre-commit hook changes, retry ONCE. If it succeeds but files were modified by the hook, verify it's safe to amend:
92
- - Check authorship: git log -1 --format='%an %ae'
93
- - Check not pushed: git status shows "Your branch is ahead"
94
- - If both true: amend your commit. Otherwise: create NEW commit (never amend other developers' commits)
75
+ 4. If the commit fails due to pre-commit hook: fix the issue and create a NEW commit
95
76
 
96
77
  Important notes:
97
78
  - NEVER run additional commands to read or explore code, besides git bash commands
98
- - NEVER use the ${prompt_7.TOOL_NAME_FOR_PROMPT} or ${prompt_4.TOOL_NAME_FOR_PROMPT} tools
79
+ - NEVER use the Task or Agent tools
99
80
  - DO NOT push to the remote repository unless the user explicitly asks you to do so
100
81
  - 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.
82
+ - IMPORTANT: Do not use --no-edit with git rebase commands, as the --no-edit flag is not a valid option for git rebase.
101
83
  - If there are no changes to commit (i.e., no untracked files and no modifications), do not create an empty commit
102
84
  - In order to ensure good formatting, ALWAYS pass the commit message via a HEREDOC, a la this example:
103
85
  <example>
104
86
  git commit -m "$(cat <<'EOF'
105
87
  Commit message here.
106
88
 
107
- 🤖 Generated with [${product_1.PRODUCT_NAME}](${product_1.PRODUCT_URL})
108
-
89
+ Co-Authored-By: [${product_1.PRODUCT_NAME}](${product_1.PRODUCT_URL})
109
90
  EOF
110
91
  )"
111
92
  </example>
@@ -116,11 +97,13 @@ Use the gh command via the Bash tool for ALL GitHub-related tasks including work
116
97
  IMPORTANT: When the user asks you to create a pull request, follow these steps carefully:
117
98
 
118
99
  1. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following bash commands in parallel using the Bash tool, in order to understand the current state of the branch since it diverged from the main branch:
119
- - Run a git status command to see all untracked files
100
+ - Run a git status command to see all untracked files (never use -uall flag)
120
101
  - Run a git diff command to see both staged and unstaged changes that will be committed
121
102
  - 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
122
103
  - Run a git log command and \`git diff [base-branch]...HEAD\` to understand the full commit history for the current branch (from the time it diverged from the base branch)
123
- 2. 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
104
+ 2. 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 title and summary:
105
+ - Keep the PR title short (under 70 characters)
106
+ - Use the description/body for details, not the title
124
107
  3. You can call multiple tools in a single response. When multiple independent pieces of information are requested and all commands are likely to succeed, run multiple tool calls in parallel for optimal performance. run the following commands in parallel:
125
108
  - Create new branch if needed
126
109
  - Push to remote with -u flag if needed
@@ -139,7 +122,7 @@ EOF
139
122
  </example>
140
123
 
141
124
  Important:
142
- - DO NOT use the ${prompt_7.TOOL_NAME_FOR_PROMPT} or ${prompt_4.TOOL_NAME_FOR_PROMPT} tools
125
+ - DO NOT use the Task or Agent tools
143
126
  - Return the PR URL when you're done, so the user can see it
144
127
 
145
128
  # Other common operations
@@ -1 +1 @@
1
- {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/tools/Bash/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AAEnE,2CAAuE;AACvE,2CAAuE;AACvE,4CAAyE;AACzE,4CAAyE;AACzE,2CAAuE;AACvE,2CAAuE;AACvE,gDAA6E;AAE7E,MAAM,iBAAiB,GAAG,KAAK,CAAA;AAClB,QAAA,cAAc,GAAG,MAAM,CAAC,CAAC,eAAe;AACxC,QAAA,kBAAkB,GAAG,MAAM,CAAC,CAAC,cAAc;AAE3C,QAAA,oBAAoB,GAAG,MAAM,CAAA;AAE7B,QAAA,WAAW,GAAW;;;;;;;;;;;;;;;;;;;;;;iEAsB8B,sBAAc,QAAQ,sBAAc,GAAG,KAAK,2DAA2D,0BAAkB,OAAO,0BAAkB,GAAG,KAAK;;4BAE/L,iBAAiB;;;yBAGpB,6BAAc;4BACX,6BAAc;wBAClB,6BAAc;wBACd,6BAAc;yBACb,6BAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;wBAwChB,sBAAY,KAAK,qBAAW;;;;;;;;;;;kBAWlC,6BAAe,OAAO,6BAAe;;;;;;;;;wBAS/B,sBAAY,KAAK,qBAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA6B/B,sBAAY,KAAK,qBAAW;;;;;;mBAM9B,6BAAe,OAAO,6BAAe;;;;wEAIgB,CAAA"}
1
+ {"version":3,"file":"prompt.js","sourceRoot":"","sources":["../../../src/tools/Bash/prompt.ts"],"names":[],"mappings":";;;AAAA,qDAAmE;AAEtD,QAAA,cAAc,GAAG,MAAM,CAAC,CAAC,eAAe;AACxC,QAAA,kBAAkB,GAAG,MAAM,CAAC,CAAC,cAAc;AAE3C,QAAA,oBAAoB,GAAG,MAAM,CAAA;AAE7B,QAAA,WAAW,GAAW;;;;;;;;;;;;;;;;;;gEAkB6B,sBAAc,QAAQ,sBAAc,GAAG,KAAK,0DAA0D,0BAAkB,OAAO,0BAAkB,GAAG,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;sBA8CnM,sBAAY,KAAK,qBAAW;;;;;;;;;;;;;;;;;sBAiB5B,sBAAY,KAAK,qBAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;qBA8B7B,sBAAY,KAAK,qBAAW;;;;;;;;;;wEAUuB,CAAA"}
@@ -1,4 +1,8 @@
1
- export declare function formatOutput(content: string, headTailLines?: number): {
1
+ export declare const STDOUT_HEAD_TAIL_LINES = 500;
2
+ export declare const STDERR_HEAD_TAIL_LINES = 50;
3
+ export declare function formatOutput(content: string, headTailLines?: number, { resolveCR }?: {
4
+ resolveCR?: boolean;
5
+ }): {
2
6
  totalLines: number;
3
7
  truncatedContent: string;
4
8
  };
@@ -1 +1 @@
1
- {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/utils.ts"],"names":[],"mappings":"AAEA,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,SAAkB,GAAG;IAC9E,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAmBA"}
1
+ {"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/tools/Bash/utils.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,MAAM,CAAA;AACzC,eAAO,MAAM,sBAAsB,KAAK,CAAA;AAsBxC,wBAAgB,YAAY,CAAC,OAAO,EAAE,MAAM,EAAE,aAAa,SAAyB,EAAE,EAAE,SAAgB,EAAE,GAAE;IAAE,SAAS,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG;IACzI,UAAU,EAAE,MAAM,CAAA;IAClB,gBAAgB,EAAE,MAAM,CAAA;CACzB,CAoBA"}
@@ -1,12 +1,32 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.STDERR_HEAD_TAIL_LINES = exports.STDOUT_HEAD_TAIL_LINES = void 0;
3
4
  exports.formatOutput = formatOutput;
4
- const HEAD_TAIL_LINES = 100;
5
- function formatOutput(content, headTailLines = HEAD_TAIL_LINES) {
6
- const lines = content.split('\n');
5
+ exports.STDOUT_HEAD_TAIL_LINES = 500;
6
+ exports.STDERR_HEAD_TAIL_LINES = 50;
7
+ const MAX_LINE_LENGTH = 2000;
8
+ /**
9
+ * 处理 \r(回车符):模拟终端行为,只保留每行最后一次 \r 后的内容。
10
+ * 进度条等工具用 \r 覆盖同一行,原始内容会变成超长单行,
11
+ * 这里将其还原为终端实际显示的最终状态。
12
+ */
13
+ function resolveCarriageReturns(content) {
14
+ return content.split('\n').map(line => {
15
+ if (!line.includes('\r'))
16
+ return line;
17
+ const parts = line.split('\r');
18
+ return parts[parts.length - 1];
19
+ }).join('\n');
20
+ }
21
+ function truncateLines(lines) {
22
+ return lines.map(l => l.length > MAX_LINE_LENGTH ? l.slice(0, MAX_LINE_LENGTH) + '...[line truncated]' : l);
23
+ }
24
+ function formatOutput(content, headTailLines = exports.STDOUT_HEAD_TAIL_LINES, { resolveCR = true } = {}) {
25
+ const text = resolveCR ? resolveCarriageReturns(content) : content;
26
+ const lines = truncateLines(text.split('\n'));
7
27
  const totalLines = lines.length;
8
28
  if (totalLines <= headTailLines * 2) {
9
- return { totalLines, truncatedContent: content };
29
+ return { totalLines, truncatedContent: lines.join('\n') };
10
30
  }
11
31
  const firstLines = lines.slice(0, headTailLines);
12
32
  const lastLines = lines.slice(-headTailLines);
@@ -1 +1 @@
1
- {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/tools/Bash/utils.ts"],"names":[],"mappings":";;AAEA,oCAsBC;AAxBD,MAAM,eAAe,GAAG,GAAG,CAAA;AAE3B,SAAgB,YAAY,CAAC,OAAe,EAAE,aAAa,GAAG,eAAe;IAI3E,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC,IAAI,CAAC,CAAA;IACjC,MAAM,UAAU,GAAG,KAAK,CAAC,MAAM,CAAA;IAE/B,IAAI,UAAU,IAAI,aAAa,GAAG,CAAC,EAAE,CAAC;QACpC,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,OAAO,EAAE,CAAA;IAClD,CAAC;IAED,MAAM,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAA;IAC7C,MAAM,YAAY,GAAG,UAAU,GAAG,aAAa,GAAG,CAAC,CAAA;IAEnD,MAAM,gBAAgB,GAAG;QACvB,GAAG,UAAU;QACb,UAAU,YAAY,yBAAyB;QAC/C,GAAG,SAAS;KACb,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;AACzC,CAAC"}
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../src/tools/Bash/utils.ts"],"names":[],"mappings":";;;AAuBA,oCAuBC;AA9CY,QAAA,sBAAsB,GAAG,GAAG,CAAA;AAC5B,QAA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,UAAU,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,aAAa,CAAC,CAAA;IAChD,MAAM,SAAS,GAAG,KAAK,CAAC,KAAK,CAAC,CAAC,aAAa,CAAC,CAAA;IAC7C,MAAM,YAAY,GAAG,UAAU,GAAG,aAAa,GAAG,CAAC,CAAA;IAEnD,MAAM,gBAAgB,GAAG;QACvB,GAAG,UAAU;QACb,UAAU,YAAY,yBAAyB;QAC/C,GAAG,SAAS;KACb,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IAEZ,OAAO,EAAE,UAAU,EAAE,gBAAgB,EAAE,CAAA;AACzC,CAAC"}
@@ -0,0 +1,68 @@
1
+ import { z } from 'zod';
2
+ declare const inputSchema: z.ZodObject<{
3
+ cron: z.ZodString;
4
+ prompt: z.ZodString;
5
+ recurring: z.ZodOptional<z.ZodBoolean>;
6
+ durable: z.ZodOptional<z.ZodBoolean>;
7
+ }, "strict", z.ZodTypeAny, {
8
+ cron: string;
9
+ prompt: string;
10
+ recurring?: boolean | undefined;
11
+ durable?: boolean | undefined;
12
+ }, {
13
+ cron: string;
14
+ prompt: string;
15
+ recurring?: boolean | undefined;
16
+ durable?: boolean | undefined;
17
+ }>;
18
+ type Out = {
19
+ id: string;
20
+ cron: string;
21
+ prompt: string;
22
+ humanSchedule: string;
23
+ recurring: boolean;
24
+ durable: boolean;
25
+ };
26
+ export declare const CronCreateTool: {
27
+ name: string;
28
+ description(): string;
29
+ inputSchema: z.ZodObject<{
30
+ cron: z.ZodString;
31
+ prompt: z.ZodString;
32
+ recurring: z.ZodOptional<z.ZodBoolean>;
33
+ durable: z.ZodOptional<z.ZodBoolean>;
34
+ }, "strict", z.ZodTypeAny, {
35
+ cron: string;
36
+ prompt: string;
37
+ recurring?: boolean | undefined;
38
+ durable?: boolean | undefined;
39
+ }, {
40
+ cron: string;
41
+ prompt: string;
42
+ recurring?: boolean | undefined;
43
+ durable?: boolean | undefined;
44
+ }>;
45
+ isReadOnly(): false;
46
+ canRunConcurrently(): true;
47
+ validateInput(input: z.infer<typeof inputSchema>, agentContext: any): Promise<{
48
+ result: false;
49
+ message: string;
50
+ } | {
51
+ result: true;
52
+ message?: undefined;
53
+ }>;
54
+ genResultForAssistant(data: Out): string;
55
+ genToolResultMessage(output: Out): {
56
+ title: string;
57
+ summary: string;
58
+ content: string;
59
+ };
60
+ getDisplayTitle(input: any): string;
61
+ call({ cron, prompt, recurring, durable }: z.infer<typeof inputSchema>, _agentContext: any): AsyncGenerator<{
62
+ type: "result";
63
+ data: Out;
64
+ resultForAssistant: string;
65
+ }, void, unknown>;
66
+ };
67
+ export {};
68
+ //# sourceMappingURL=CronCreate.d.ts.map