wave-agent-sdk 0.19.5 → 0.19.7

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 (371) hide show
  1. package/dist/agent.d.ts +30 -14
  2. package/dist/agent.js +70 -56
  3. package/dist/constants/goalPrompts.d.ts +0 -1
  4. package/dist/constants/subagents.d.ts +0 -1
  5. package/dist/constants/toolLimits.d.ts +0 -1
  6. package/dist/constants/tools.d.ts +0 -1
  7. package/dist/core/plugin.d.ts +0 -1
  8. package/dist/core/session.d.ts +0 -1
  9. package/dist/index.d.ts +0 -1
  10. package/dist/managers/MemoryRuleManager.d.ts +0 -1
  11. package/dist/managers/aiManager.d.ts +15 -2
  12. package/dist/managers/aiManager.js +65 -11
  13. package/dist/managers/backgroundTaskManager.d.ts +1 -3
  14. package/dist/managers/backgroundTaskManager.js +20 -22
  15. package/dist/managers/bangManager.d.ts +0 -1
  16. package/dist/managers/bangManager.js +2 -1
  17. package/dist/managers/cronManager.d.ts +0 -1
  18. package/dist/managers/foregroundTaskManager.d.ts +0 -1
  19. package/dist/managers/forkedAgentManager.d.ts +0 -1
  20. package/dist/managers/goalManager.d.ts +0 -1
  21. package/dist/managers/hookManager.d.ts +0 -1
  22. package/dist/managers/liveConfigManager.d.ts +0 -1
  23. package/dist/managers/lspManager.d.ts +0 -1
  24. package/dist/managers/mcpManager.d.ts +0 -1
  25. package/dist/managers/messageManager.d.ts +7 -1
  26. package/dist/managers/messageManager.js +64 -5
  27. package/dist/managers/messageQueue.d.ts +25 -2
  28. package/dist/managers/messageQueue.js +53 -1
  29. package/dist/managers/permissionManager.d.ts +0 -1
  30. package/dist/managers/permissionManager.js +3 -3
  31. package/dist/managers/planManager.d.ts +0 -1
  32. package/dist/managers/pluginManager.d.ts +0 -1
  33. package/dist/managers/pluginScopeManager.d.ts +0 -1
  34. package/dist/managers/reversionManager.d.ts +0 -1
  35. package/dist/managers/skillManager.d.ts +0 -1
  36. package/dist/managers/slashCommandManager.d.ts +0 -1
  37. package/dist/managers/subagentManager.d.ts +0 -3
  38. package/dist/managers/subagentManager.js +15 -14
  39. package/dist/managers/toolManager.d.ts +0 -1
  40. package/dist/managers/workflowManager.d.ts +1 -2
  41. package/dist/managers/workflowManager.js +4 -4
  42. package/dist/prompts/autoMemory.d.ts +0 -1
  43. package/dist/prompts/autoMemoryExtraction.d.ts +0 -1
  44. package/dist/prompts/index.d.ts +3 -2
  45. package/dist/prompts/index.js +2 -4
  46. package/dist/prompts/planModeReminders.d.ts +0 -1
  47. package/dist/services/GitService.d.ts +0 -1
  48. package/dist/services/MarketplaceService.d.ts +0 -1
  49. package/dist/services/MemoryRuleService.d.ts +0 -1
  50. package/dist/services/aiService.d.ts +0 -1
  51. package/dist/services/authService.d.ts +0 -1
  52. package/dist/services/autoMemoryService.d.ts +0 -1
  53. package/dist/services/configurationService.d.ts +0 -1
  54. package/dist/services/fileWatcher.d.ts +0 -1
  55. package/dist/services/hook.d.ts +0 -1
  56. package/dist/services/hook.js +6 -0
  57. package/dist/services/initializationService.d.ts +0 -1
  58. package/dist/services/interactionService.d.ts +0 -1
  59. package/dist/services/interactionService.js +10 -0
  60. package/dist/services/jsonlHandler.d.ts +0 -1
  61. package/dist/services/memory.d.ts +0 -1
  62. package/dist/services/pluginLoader.d.ts +0 -1
  63. package/dist/services/remoteSettingsService.d.ts +0 -1
  64. package/dist/services/reversionService.d.ts +0 -1
  65. package/dist/services/session.d.ts +0 -1
  66. package/dist/services/taskManager.d.ts +0 -1
  67. package/dist/services/taskManager.js +8 -1
  68. package/dist/telemetry/events.d.ts +0 -1
  69. package/dist/telemetry/instrumentation.d.ts +0 -1
  70. package/dist/telemetry/sessionTracing.d.ts +0 -1
  71. package/dist/tools/agentTool.d.ts +0 -1
  72. package/dist/tools/askUserQuestion.d.ts +0 -1
  73. package/dist/tools/bashTool.d.ts +0 -1
  74. package/dist/tools/bashTool.js +7 -5
  75. package/dist/tools/buildTool.d.ts +0 -1
  76. package/dist/tools/cronCreateTool.d.ts +0 -1
  77. package/dist/tools/cronDeleteTool.d.ts +0 -1
  78. package/dist/tools/cronListTool.d.ts +0 -1
  79. package/dist/tools/editTool.d.ts +0 -1
  80. package/dist/tools/enterPlanMode.d.ts +0 -1
  81. package/dist/tools/enterWorktreeTool.d.ts +0 -1
  82. package/dist/tools/enterWorktreeTool.js +3 -8
  83. package/dist/tools/exitPlanMode.d.ts +0 -1
  84. package/dist/tools/exitWorktreeTool.d.ts +0 -1
  85. package/dist/tools/exitWorktreeTool.js +5 -8
  86. package/dist/tools/globTool.d.ts +0 -1
  87. package/dist/tools/grepTool.d.ts +0 -1
  88. package/dist/tools/lspTool.d.ts +0 -1
  89. package/dist/tools/readTool.d.ts +0 -1
  90. package/dist/tools/skillTool.d.ts +0 -1
  91. package/dist/tools/taskManagementTools.d.ts +0 -1
  92. package/dist/tools/taskStopTool.d.ts +0 -1
  93. package/dist/tools/types.d.ts +0 -1
  94. package/dist/tools/webFetchTool.d.ts +0 -1
  95. package/dist/tools/workflowTool.d.ts +0 -1
  96. package/dist/tools/writeTool.d.ts +0 -1
  97. package/dist/types/agent.d.ts +0 -1
  98. package/dist/types/auth.d.ts +0 -1
  99. package/dist/types/commands.d.ts +0 -1
  100. package/dist/types/config.d.ts +0 -1
  101. package/dist/types/configuration.d.ts +0 -1
  102. package/dist/types/core.d.ts +0 -1
  103. package/dist/types/cron.d.ts +0 -1
  104. package/dist/types/environment.d.ts +0 -1
  105. package/dist/types/fileSearch.d.ts +0 -1
  106. package/dist/types/history.d.ts +0 -1
  107. package/dist/types/hooks.d.ts +2 -1
  108. package/dist/types/index.d.ts +0 -1
  109. package/dist/types/lsp.d.ts +0 -1
  110. package/dist/types/marketplace.d.ts +0 -1
  111. package/dist/types/mcp.d.ts +0 -1
  112. package/dist/types/memoryRule.d.ts +0 -1
  113. package/dist/types/messaging.d.ts +2 -1
  114. package/dist/types/permissions.d.ts +0 -1
  115. package/dist/types/plugins.d.ts +0 -1
  116. package/dist/types/processes.d.ts +0 -1
  117. package/dist/types/reversion.d.ts +0 -1
  118. package/dist/types/session.d.ts +0 -1
  119. package/dist/types/skills.d.ts +0 -1
  120. package/dist/types/tasks.d.ts +0 -1
  121. package/dist/types/telemetry.d.ts +0 -1
  122. package/dist/types/tools.d.ts +0 -1
  123. package/dist/types/workflow.d.ts +0 -1
  124. package/dist/utils/abortUtils.d.ts +0 -1
  125. package/dist/utils/atomicWrite.d.ts +0 -1
  126. package/dist/utils/bashParser.d.ts +0 -1
  127. package/dist/utils/cacheControlUtils.d.ts +0 -1
  128. package/dist/utils/commandArgumentParser.d.ts +0 -1
  129. package/dist/utils/commandPathResolver.d.ts +0 -1
  130. package/dist/utils/configPaths.d.ts +0 -1
  131. package/dist/utils/configValidator.d.ts +0 -1
  132. package/dist/utils/constants.d.ts +0 -1
  133. package/dist/utils/container.d.ts +0 -1
  134. package/dist/utils/containerSetup.d.ts +0 -1
  135. package/dist/utils/containerSetup.js +3 -3
  136. package/dist/utils/convertMessagesForAPI.d.ts +0 -1
  137. package/dist/utils/cronTasks.d.ts +0 -1
  138. package/dist/utils/cronTasksLock.d.ts +0 -1
  139. package/dist/utils/cronToHuman.d.ts +0 -1
  140. package/dist/utils/customCommands.d.ts +0 -1
  141. package/dist/utils/editUtils.d.ts +0 -1
  142. package/dist/utils/fileFormat.d.ts +0 -1
  143. package/dist/utils/fileSearch.d.ts +0 -1
  144. package/dist/utils/fileUtils.d.ts +0 -1
  145. package/dist/utils/gitUtils.d.ts +0 -1
  146. package/dist/utils/globalLogger.d.ts +0 -1
  147. package/dist/utils/groupMessagesByApiRound.d.ts +0 -1
  148. package/dist/utils/hookMatcher.d.ts +0 -1
  149. package/dist/utils/markdownParser.d.ts +0 -1
  150. package/dist/utils/mcpUtils.d.ts +0 -1
  151. package/dist/utils/messageOperations.d.ts +0 -1
  152. package/dist/utils/modelCapabilities.d.ts +0 -1
  153. package/dist/utils/nameGenerator.d.ts +0 -1
  154. package/dist/utils/notificationXml.d.ts +0 -1
  155. package/dist/utils/openaiClient.d.ts +0 -1
  156. package/dist/utils/parseCronExpression.d.ts +0 -1
  157. package/dist/utils/path.d.ts +0 -1
  158. package/dist/utils/pathEncoder.d.ts +0 -1
  159. package/dist/utils/pathSafety.d.ts +0 -1
  160. package/dist/utils/promptHistory.d.ts +0 -1
  161. package/dist/utils/ripgrep.d.ts +0 -1
  162. package/dist/utils/shellResolver.d.ts +0 -1
  163. package/dist/utils/shellResolver.js +156 -7
  164. package/dist/utils/skillParser.d.ts +0 -1
  165. package/dist/utils/stringUtils.d.ts +0 -1
  166. package/dist/utils/subagentParser.d.ts +0 -1
  167. package/dist/utils/taskReminder.d.ts +0 -1
  168. package/dist/utils/tokenCalculation.d.ts +0 -1
  169. package/dist/utils/tokenEstimate.d.ts +0 -1
  170. package/dist/utils/toolResultStorage.d.ts +0 -1
  171. package/dist/utils/worktreeSession.d.ts +6 -7
  172. package/dist/utils/worktreeSession.js +7 -11
  173. package/dist/utils/worktreeUtils.d.ts +0 -1
  174. package/dist/workflow/budgetTracker.d.ts +0 -1
  175. package/dist/workflow/concurrencyLimiter.d.ts +0 -1
  176. package/dist/workflow/journal.d.ts +0 -1
  177. package/dist/workflow/progressReporter.d.ts +0 -1
  178. package/dist/workflow/runState.d.ts +0 -1
  179. package/dist/workflow/scriptRuntime.d.ts +0 -1
  180. package/dist/workflow/structuredOutput.d.ts +0 -1
  181. package/dist/workflow/types.d.ts +0 -1
  182. package/dist/workflow/workflowApis.d.ts +0 -1
  183. package/package.json +1 -1
  184. package/src/agent.ts +80 -67
  185. package/src/managers/aiManager.ts +79 -12
  186. package/src/managers/backgroundTaskManager.ts +21 -23
  187. package/src/managers/bangManager.ts +2 -1
  188. package/src/managers/messageManager.ts +72 -6
  189. package/src/managers/messageQueue.ts +60 -2
  190. package/src/managers/permissionManager.ts +6 -3
  191. package/src/managers/subagentManager.ts +22 -16
  192. package/src/managers/workflowManager.ts +5 -5
  193. package/src/prompts/index.ts +4 -4
  194. package/src/services/hook.ts +9 -0
  195. package/src/services/interactionService.ts +11 -0
  196. package/src/services/taskManager.ts +8 -1
  197. package/src/tools/bashTool.ts +11 -5
  198. package/src/tools/enterWorktreeTool.ts +4 -14
  199. package/src/tools/exitWorktreeTool.ts +5 -13
  200. package/src/types/hooks.ts +2 -0
  201. package/src/types/messaging.ts +2 -0
  202. package/src/utils/containerSetup.ts +3 -3
  203. package/src/utils/shellResolver.ts +167 -8
  204. package/src/utils/worktreeSession.ts +6 -16
  205. package/dist/agent.d.ts.map +0 -1
  206. package/dist/constants/goalPrompts.d.ts.map +0 -1
  207. package/dist/constants/subagents.d.ts.map +0 -1
  208. package/dist/constants/toolLimits.d.ts.map +0 -1
  209. package/dist/constants/tools.d.ts.map +0 -1
  210. package/dist/core/plugin.d.ts.map +0 -1
  211. package/dist/core/session.d.ts.map +0 -1
  212. package/dist/index.d.ts.map +0 -1
  213. package/dist/managers/MemoryRuleManager.d.ts.map +0 -1
  214. package/dist/managers/aiManager.d.ts.map +0 -1
  215. package/dist/managers/backgroundTaskManager.d.ts.map +0 -1
  216. package/dist/managers/bangManager.d.ts.map +0 -1
  217. package/dist/managers/cronManager.d.ts.map +0 -1
  218. package/dist/managers/foregroundTaskManager.d.ts.map +0 -1
  219. package/dist/managers/forkedAgentManager.d.ts.map +0 -1
  220. package/dist/managers/goalManager.d.ts.map +0 -1
  221. package/dist/managers/hookManager.d.ts.map +0 -1
  222. package/dist/managers/liveConfigManager.d.ts.map +0 -1
  223. package/dist/managers/lspManager.d.ts.map +0 -1
  224. package/dist/managers/mcpManager.d.ts.map +0 -1
  225. package/dist/managers/messageManager.d.ts.map +0 -1
  226. package/dist/managers/messageQueue.d.ts.map +0 -1
  227. package/dist/managers/notificationQueue.d.ts +0 -8
  228. package/dist/managers/notificationQueue.d.ts.map +0 -1
  229. package/dist/managers/notificationQueue.js +0 -17
  230. package/dist/managers/permissionManager.d.ts.map +0 -1
  231. package/dist/managers/planManager.d.ts.map +0 -1
  232. package/dist/managers/pluginManager.d.ts.map +0 -1
  233. package/dist/managers/pluginScopeManager.d.ts.map +0 -1
  234. package/dist/managers/reversionManager.d.ts.map +0 -1
  235. package/dist/managers/skillManager.d.ts.map +0 -1
  236. package/dist/managers/slashCommandManager.d.ts.map +0 -1
  237. package/dist/managers/subagentManager.d.ts.map +0 -1
  238. package/dist/managers/toolManager.d.ts.map +0 -1
  239. package/dist/managers/workflowManager.d.ts.map +0 -1
  240. package/dist/prompts/autoMemory.d.ts.map +0 -1
  241. package/dist/prompts/autoMemoryExtraction.d.ts.map +0 -1
  242. package/dist/prompts/index.d.ts.map +0 -1
  243. package/dist/prompts/planModeReminders.d.ts.map +0 -1
  244. package/dist/services/GitService.d.ts.map +0 -1
  245. package/dist/services/MarketplaceService.d.ts.map +0 -1
  246. package/dist/services/MemoryRuleService.d.ts.map +0 -1
  247. package/dist/services/aiService.d.ts.map +0 -1
  248. package/dist/services/authService.d.ts.map +0 -1
  249. package/dist/services/autoMemoryService.d.ts.map +0 -1
  250. package/dist/services/configurationService.d.ts.map +0 -1
  251. package/dist/services/fileWatcher.d.ts.map +0 -1
  252. package/dist/services/hook.d.ts.map +0 -1
  253. package/dist/services/initializationService.d.ts.map +0 -1
  254. package/dist/services/interactionService.d.ts.map +0 -1
  255. package/dist/services/jsonlHandler.d.ts.map +0 -1
  256. package/dist/services/memory.d.ts.map +0 -1
  257. package/dist/services/pluginLoader.d.ts.map +0 -1
  258. package/dist/services/remoteSettingsService.d.ts.map +0 -1
  259. package/dist/services/reversionService.d.ts.map +0 -1
  260. package/dist/services/session.d.ts.map +0 -1
  261. package/dist/services/taskManager.d.ts.map +0 -1
  262. package/dist/telemetry/events.d.ts.map +0 -1
  263. package/dist/telemetry/instrumentation.d.ts.map +0 -1
  264. package/dist/telemetry/sessionTracing.d.ts.map +0 -1
  265. package/dist/tools/agentTool.d.ts.map +0 -1
  266. package/dist/tools/askUserQuestion.d.ts.map +0 -1
  267. package/dist/tools/bashTool.d.ts.map +0 -1
  268. package/dist/tools/buildTool.d.ts.map +0 -1
  269. package/dist/tools/cronCreateTool.d.ts.map +0 -1
  270. package/dist/tools/cronDeleteTool.d.ts.map +0 -1
  271. package/dist/tools/cronListTool.d.ts.map +0 -1
  272. package/dist/tools/editTool.d.ts.map +0 -1
  273. package/dist/tools/enterPlanMode.d.ts.map +0 -1
  274. package/dist/tools/enterWorktreeTool.d.ts.map +0 -1
  275. package/dist/tools/exitPlanMode.d.ts.map +0 -1
  276. package/dist/tools/exitWorktreeTool.d.ts.map +0 -1
  277. package/dist/tools/globTool.d.ts.map +0 -1
  278. package/dist/tools/grepTool.d.ts.map +0 -1
  279. package/dist/tools/lspTool.d.ts.map +0 -1
  280. package/dist/tools/readTool.d.ts.map +0 -1
  281. package/dist/tools/skillTool.d.ts.map +0 -1
  282. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  283. package/dist/tools/taskStopTool.d.ts.map +0 -1
  284. package/dist/tools/types.d.ts.map +0 -1
  285. package/dist/tools/webFetchTool.d.ts.map +0 -1
  286. package/dist/tools/workflowTool.d.ts.map +0 -1
  287. package/dist/tools/writeTool.d.ts.map +0 -1
  288. package/dist/types/agent.d.ts.map +0 -1
  289. package/dist/types/auth.d.ts.map +0 -1
  290. package/dist/types/commands.d.ts.map +0 -1
  291. package/dist/types/config.d.ts.map +0 -1
  292. package/dist/types/configuration.d.ts.map +0 -1
  293. package/dist/types/core.d.ts.map +0 -1
  294. package/dist/types/cron.d.ts.map +0 -1
  295. package/dist/types/environment.d.ts.map +0 -1
  296. package/dist/types/fileSearch.d.ts.map +0 -1
  297. package/dist/types/history.d.ts.map +0 -1
  298. package/dist/types/hooks.d.ts.map +0 -1
  299. package/dist/types/index.d.ts.map +0 -1
  300. package/dist/types/lsp.d.ts.map +0 -1
  301. package/dist/types/marketplace.d.ts.map +0 -1
  302. package/dist/types/mcp.d.ts.map +0 -1
  303. package/dist/types/memoryRule.d.ts.map +0 -1
  304. package/dist/types/messaging.d.ts.map +0 -1
  305. package/dist/types/permissions.d.ts.map +0 -1
  306. package/dist/types/plugins.d.ts.map +0 -1
  307. package/dist/types/processes.d.ts.map +0 -1
  308. package/dist/types/reversion.d.ts.map +0 -1
  309. package/dist/types/session.d.ts.map +0 -1
  310. package/dist/types/skills.d.ts.map +0 -1
  311. package/dist/types/tasks.d.ts.map +0 -1
  312. package/dist/types/telemetry.d.ts.map +0 -1
  313. package/dist/types/tools.d.ts.map +0 -1
  314. package/dist/types/workflow.d.ts.map +0 -1
  315. package/dist/utils/abortUtils.d.ts.map +0 -1
  316. package/dist/utils/atomicWrite.d.ts.map +0 -1
  317. package/dist/utils/bashParser.d.ts.map +0 -1
  318. package/dist/utils/cacheControlUtils.d.ts.map +0 -1
  319. package/dist/utils/commandArgumentParser.d.ts.map +0 -1
  320. package/dist/utils/commandPathResolver.d.ts.map +0 -1
  321. package/dist/utils/configPaths.d.ts.map +0 -1
  322. package/dist/utils/configValidator.d.ts.map +0 -1
  323. package/dist/utils/constants.d.ts.map +0 -1
  324. package/dist/utils/container.d.ts.map +0 -1
  325. package/dist/utils/containerSetup.d.ts.map +0 -1
  326. package/dist/utils/convertMessagesForAPI.d.ts.map +0 -1
  327. package/dist/utils/cronTasks.d.ts.map +0 -1
  328. package/dist/utils/cronTasksLock.d.ts.map +0 -1
  329. package/dist/utils/cronToHuman.d.ts.map +0 -1
  330. package/dist/utils/customCommands.d.ts.map +0 -1
  331. package/dist/utils/editUtils.d.ts.map +0 -1
  332. package/dist/utils/fileFormat.d.ts.map +0 -1
  333. package/dist/utils/fileSearch.d.ts.map +0 -1
  334. package/dist/utils/fileUtils.d.ts.map +0 -1
  335. package/dist/utils/gitUtils.d.ts.map +0 -1
  336. package/dist/utils/globalLogger.d.ts.map +0 -1
  337. package/dist/utils/groupMessagesByApiRound.d.ts.map +0 -1
  338. package/dist/utils/hookMatcher.d.ts.map +0 -1
  339. package/dist/utils/markdownParser.d.ts.map +0 -1
  340. package/dist/utils/mcpUtils.d.ts.map +0 -1
  341. package/dist/utils/messageOperations.d.ts.map +0 -1
  342. package/dist/utils/modelCapabilities.d.ts.map +0 -1
  343. package/dist/utils/nameGenerator.d.ts.map +0 -1
  344. package/dist/utils/notificationXml.d.ts.map +0 -1
  345. package/dist/utils/openaiClient.d.ts.map +0 -1
  346. package/dist/utils/parseCronExpression.d.ts.map +0 -1
  347. package/dist/utils/path.d.ts.map +0 -1
  348. package/dist/utils/pathEncoder.d.ts.map +0 -1
  349. package/dist/utils/pathSafety.d.ts.map +0 -1
  350. package/dist/utils/promptHistory.d.ts.map +0 -1
  351. package/dist/utils/ripgrep.d.ts.map +0 -1
  352. package/dist/utils/shellResolver.d.ts.map +0 -1
  353. package/dist/utils/skillParser.d.ts.map +0 -1
  354. package/dist/utils/stringUtils.d.ts.map +0 -1
  355. package/dist/utils/subagentParser.d.ts.map +0 -1
  356. package/dist/utils/taskReminder.d.ts.map +0 -1
  357. package/dist/utils/tokenCalculation.d.ts.map +0 -1
  358. package/dist/utils/tokenEstimate.d.ts.map +0 -1
  359. package/dist/utils/toolResultStorage.d.ts.map +0 -1
  360. package/dist/utils/worktreeSession.d.ts.map +0 -1
  361. package/dist/utils/worktreeUtils.d.ts.map +0 -1
  362. package/dist/workflow/budgetTracker.d.ts.map +0 -1
  363. package/dist/workflow/concurrencyLimiter.d.ts.map +0 -1
  364. package/dist/workflow/journal.d.ts.map +0 -1
  365. package/dist/workflow/progressReporter.d.ts.map +0 -1
  366. package/dist/workflow/runState.d.ts.map +0 -1
  367. package/dist/workflow/scriptRuntime.d.ts.map +0 -1
  368. package/dist/workflow/structuredOutput.d.ts.map +0 -1
  369. package/dist/workflow/types.d.ts.map +0 -1
  370. package/dist/workflow/workflowApis.d.ts.map +0 -1
  371. package/src/managers/notificationQueue.ts +0 -19
@@ -4,6 +4,7 @@ import * as fs from "fs";
4
4
  import * as path from "path";
5
5
  import { stripAnsiColors } from "../utils/stringUtils.js";
6
6
  import { logger } from "../utils/globalLogger.js";
7
+ import { resolveShellPath } from "../utils/shellResolver.js";
7
8
  export class BackgroundTaskManager {
8
9
  constructor(container, options) {
9
10
  this.container = container;
@@ -12,9 +13,6 @@ export class BackgroundTaskManager {
12
13
  this.callbacks = options.callbacks || {};
13
14
  this.workdir = options.workdir;
14
15
  }
15
- get notificationQueue() {
16
- return this.container.get("NotificationQueue");
17
- }
18
16
  /**
19
17
  * Fire the onBackgroundTasksChange callback so UI consumers refresh.
20
18
  * Public so other managers (e.g. WorkflowManager) can trigger a refresh
@@ -36,14 +34,14 @@ export class BackgroundTaskManager {
36
34
  getAllTasks() {
37
35
  return Array.from(this.tasks.values());
38
36
  }
39
- startShell(command, timeout) {
37
+ startShell(command, timeout, cwd) {
40
38
  const id = this.generateId();
41
39
  const startTime = Date.now();
42
40
  const child = spawn(command, {
43
- shell: true,
41
+ shell: resolveShellPath() ?? true,
44
42
  stdio: "pipe",
45
43
  detached: true,
46
- cwd: this.workdir,
44
+ cwd: cwd ?? this.workdir,
47
45
  env: {
48
46
  ...process.env,
49
47
  },
@@ -140,13 +138,13 @@ export class BackgroundTaskManager {
140
138
  this.notifyTasksChange();
141
139
  // Skip notification if task was manually killed (user/agent-initiated stop)
142
140
  if (!wasKilled) {
143
- const notificationQueue = this.container.has("NotificationQueue")
144
- ? this.container.get("NotificationQueue")
141
+ const messageQueue = this.container.has("MessageQueue")
142
+ ? this.container.get("MessageQueue")
145
143
  : undefined;
146
- if (notificationQueue) {
144
+ if (messageQueue) {
147
145
  const statusStr = shell.status;
148
146
  const summary = `Command "${command}" ${statusStr} with exit code ${code ?? 0}`;
149
- notificationQueue.enqueue(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>${statusStr}</status>\n<summary>${summary}</summary>\n</task-notification>`);
147
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>${statusStr}</status>\n<summary>${summary}</summary>\n</task-notification>`);
150
148
  }
151
149
  }
152
150
  };
@@ -166,12 +164,12 @@ export class BackgroundTaskManager {
166
164
  shell.runtime = shell.endTime - startTime;
167
165
  this.notifyTasksChange();
168
166
  // Enqueue error notification
169
- const notificationQueue = this.container.has("NotificationQueue")
170
- ? this.container.get("NotificationQueue")
167
+ const messageQueue = this.container.has("MessageQueue")
168
+ ? this.container.get("MessageQueue")
171
169
  : undefined;
172
- if (notificationQueue) {
170
+ if (messageQueue) {
173
171
  const summary = `Command "${command}" failed with error: ${stripAnsiColors(error.message)}`;
174
- notificationQueue.enqueue(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
172
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
175
173
  }
176
174
  };
177
175
  child.stdout?.on("data", onStdout);
@@ -277,13 +275,13 @@ export class BackgroundTaskManager {
277
275
  this.notifyTasksChange();
278
276
  // Skip notification if task was manually killed (user/agent-initiated stop)
279
277
  if (!wasKilled) {
280
- const notificationQueue = this.container.has("NotificationQueue")
281
- ? this.container.get("NotificationQueue")
278
+ const messageQueue = this.container.has("MessageQueue")
279
+ ? this.container.get("MessageQueue")
282
280
  : undefined;
283
- if (notificationQueue) {
281
+ if (messageQueue) {
284
282
  const statusStr = shell.status;
285
283
  const summary = `Command "${command}" ${statusStr} with exit code ${code ?? 0}`;
286
- notificationQueue.enqueue(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>${statusStr}</status>\n<summary>${summary}</summary>\n</task-notification>`);
284
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>${statusStr}</status>\n<summary>${summary}</summary>\n</task-notification>`);
287
285
  }
288
286
  }
289
287
  });
@@ -300,12 +298,12 @@ export class BackgroundTaskManager {
300
298
  shell.runtime = shell.endTime - startTime;
301
299
  this.notifyTasksChange();
302
300
  // Enqueue error notification
303
- const notificationQueue = this.container.has("NotificationQueue")
304
- ? this.container.get("NotificationQueue")
301
+ const messageQueue = this.container.has("MessageQueue")
302
+ ? this.container.get("MessageQueue")
305
303
  : undefined;
306
- if (notificationQueue) {
304
+ if (messageQueue) {
307
305
  const summary = `Command "${command}" failed with error: ${stripAnsiColors(error.message)}`;
308
- notificationQueue.enqueue(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
306
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>shell</task-type>\n<output-file>${logPath}</output-file>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
309
307
  }
310
308
  });
311
309
  return id;
@@ -18,4 +18,3 @@ export declare class BangManager {
18
18
  executeCommand(command: string): Promise<number>;
19
19
  abortCommand(): void;
20
20
  }
21
- //# sourceMappingURL=bangManager.d.ts.map
@@ -1,4 +1,5 @@
1
1
  import { spawn } from "child_process";
2
+ import { resolveShellPath } from "../utils/shellResolver.js";
2
3
  export class BangManager {
3
4
  constructor(container, options) {
4
5
  this.container = container;
@@ -22,7 +23,7 @@ export class BangManager {
22
23
  this.messageManager.addBangMessage(command);
23
24
  return new Promise((resolve) => {
24
25
  const child = spawn(command, {
25
- shell: true,
26
+ shell: resolveShellPath() ?? true,
26
27
  stdio: "pipe",
27
28
  cwd: this.workdir,
28
29
  env: {
@@ -23,4 +23,3 @@ export declare class CronManager {
23
23
  private getDeterministicRandom;
24
24
  private checkJobs;
25
25
  }
26
- //# sourceMappingURL=cronManager.d.ts.map
@@ -9,4 +9,3 @@ export declare class ForegroundTaskManager implements IForegroundTaskManager {
9
9
  backgroundCurrentTask(): Promise<void>;
10
10
  hasActiveTasks(): boolean;
11
11
  }
12
- //# sourceMappingURL=foregroundTaskManager.d.ts.map
@@ -48,4 +48,3 @@ export declare class ForkedAgentManager {
48
48
  getActiveForks(): ForkedAgentEntry[];
49
49
  private notifyChange;
50
50
  }
51
- //# sourceMappingURL=forkedAgentManager.d.ts.map
@@ -40,4 +40,3 @@ export declare class GoalManager {
40
40
  private parseEvaluationResponse;
41
41
  private formatElapsed;
42
42
  }
43
- //# sourceMappingURL=goalManager.d.ts.map
@@ -143,4 +143,3 @@ export declare class HookManager {
143
143
  */
144
144
  executePostCompactHooks(sessionId: string, transcriptPath: string, compactSummary: string): Promise<HookExecutionResult[]>;
145
145
  }
146
- //# sourceMappingURL=hookManager.d.ts.map
@@ -83,4 +83,3 @@ export declare class LiveConfigManager {
83
83
  */
84
84
  private getConfigurationPaths;
85
85
  }
86
- //# sourceMappingURL=liveConfigManager.d.ts.map
@@ -39,4 +39,3 @@ export declare class LspManager implements ILspManager {
39
39
  cleanup(): Promise<void>;
40
40
  }
41
41
  export {};
42
- //# sourceMappingURL=lspManager.d.ts.map
@@ -85,4 +85,3 @@ export declare class McpManager {
85
85
  */
86
86
  isMcpTool(name: string): boolean;
87
87
  }
88
- //# sourceMappingURL=mcpManager.d.ts.map
@@ -190,6 +190,13 @@ export declare class MessageManager {
190
190
  * Fires incremental callbacks for each finalized block.
191
191
  */
192
192
  finalizeStreamingBlocks(): void;
193
+ /**
194
+ * Finalize any tool blocks still in a non-terminal stage (start/streaming/running)
195
+ * by marking them as ended with an error. Called when the AI call is aborted or
196
+ * fails mid-tool-stream so the UI stops showing the "running" spinner.
197
+ * Fires onToolBlockUpdated for each finalized tool block.
198
+ */
199
+ finalizeAbortedToolBlocks(error?: string): void;
193
200
  /**
194
201
  * Remove the last user message from the conversation
195
202
  * Used for hook error handling when the user prompt needs to be erased
@@ -247,4 +254,3 @@ export declare class MessageManager {
247
254
  */
248
255
  rebuildLoadedRuleIds(): void;
249
256
  }
250
- //# sourceMappingURL=messageManager.d.ts.map
@@ -477,11 +477,22 @@ export class MessageManager {
477
477
  if (index < 0)
478
478
  return false;
479
479
  const block = lastMessage.blocks[index];
480
- lastMessage.blocks[index] = {
481
- type: block.type,
482
- content: block.content,
483
- stage: "end",
484
- };
480
+ if (block.type === "reasoning") {
481
+ lastMessage.blocks[index] = {
482
+ type: "reasoning",
483
+ content: block.content,
484
+ stage: "end",
485
+ startTime: block.startTime,
486
+ endTime: Date.now(),
487
+ };
488
+ }
489
+ else {
490
+ lastMessage.blocks[index] = {
491
+ type: block.type,
492
+ content: block.content,
493
+ stage: "end",
494
+ };
495
+ }
485
496
  // Fire incremental callback to signal finalization
486
497
  const callbackParams = {
487
498
  messageId: lastMessage.id,
@@ -564,10 +575,12 @@ export class MessageManager {
564
575
  const chunk = newAccumulatedReasoning.slice(currentReasoning.length);
565
576
  if (reasoningBlockIndex >= 0) {
566
577
  // Update existing reasoning block
578
+ const existingStartTime = lastMessage.blocks[reasoningBlockIndex].startTime;
567
579
  lastMessage.blocks[reasoningBlockIndex] = {
568
580
  type: "reasoning",
569
581
  content: newAccumulatedReasoning,
570
582
  stage: "streaming",
583
+ startTime: existingStartTime,
571
584
  };
572
585
  }
573
586
  else {
@@ -576,6 +589,7 @@ export class MessageManager {
576
589
  type: "reasoning",
577
590
  content: newAccumulatedReasoning,
578
591
  stage: "streaming",
592
+ startTime: Date.now(),
579
593
  });
580
594
  }
581
595
  // Trigger callbacks with chunk and accumulated reasoning content
@@ -604,6 +618,51 @@ export class MessageManager {
604
618
  this.callbacks.onMessagesChange?.([...this.messages]);
605
619
  }
606
620
  }
621
+ /**
622
+ * Finalize any tool blocks still in a non-terminal stage (start/streaming/running)
623
+ * by marking them as ended with an error. Called when the AI call is aborted or
624
+ * fails mid-tool-stream so the UI stops showing the "running" spinner.
625
+ * Fires onToolBlockUpdated for each finalized tool block.
626
+ */
627
+ finalizeAbortedToolBlocks(error) {
628
+ if (this.messages.length === 0)
629
+ return;
630
+ const lastMessage = this.messages[this.messages.length - 1];
631
+ if (lastMessage.role !== "assistant")
632
+ return;
633
+ const errorMessage = error ?? "Tool execution was aborted";
634
+ let finalized = false;
635
+ for (let i = 0; i < lastMessage.blocks.length; i++) {
636
+ const block = lastMessage.blocks[i];
637
+ if (block.type !== "tool" || block.stage === "end")
638
+ continue;
639
+ const timestamp = Date.now();
640
+ lastMessage.blocks[i] = {
641
+ ...block,
642
+ stage: "end",
643
+ success: false,
644
+ error: errorMessage,
645
+ timestamp,
646
+ };
647
+ finalized = true;
648
+ this.callbacks.onToolBlockUpdated?.({
649
+ id: block.id ?? "",
650
+ messageId: lastMessage.id ?? "",
651
+ name: block.name,
652
+ parameters: block.parameters,
653
+ parametersChunk: block.parametersChunk,
654
+ compactParams: block.compactParams,
655
+ stage: "end",
656
+ success: false,
657
+ error: errorMessage,
658
+ isManuallyBackgrounded: block.isManuallyBackgrounded,
659
+ timestamp,
660
+ });
661
+ }
662
+ if (finalized) {
663
+ this.setMessages([...this.messages]);
664
+ }
665
+ }
607
666
  /**
608
667
  * Remove the last user message from the conversation
609
668
  * Used for hook error handling when the user prompt needs to be erased
@@ -1,7 +1,7 @@
1
1
  export type QueueState = "idle" | "dispatching" | "running";
2
2
  export interface QueuedMessage {
3
3
  id?: string;
4
- type?: "message" | "bang";
4
+ type?: "message" | "bang" | "notification";
5
5
  content: string;
6
6
  images?: Array<{
7
7
  path: string;
@@ -19,12 +19,35 @@ export declare class MessageQueue {
19
19
  transitionTo(newState: QueueState): boolean;
20
20
  enqueue(message: QueuedMessage): void;
21
21
  dequeue(): QueuedMessage | null;
22
+ /**
23
+ * Clear user-facing items (messages, bang commands) but preserve pending
24
+ * notifications so background task results are not lost on abort.
25
+ */
22
26
  clear(): void;
23
27
  hasPending(): boolean;
24
28
  getQueue(): QueuedMessage[];
25
29
  removeAt(index: number): boolean;
26
30
  removeById(id: string): boolean;
31
+ updateById(id: string, patch: {
32
+ content?: string;
33
+ images?: Array<{
34
+ path: string;
35
+ mimeType: string;
36
+ }>;
37
+ type?: "message" | "bang";
38
+ }): boolean;
27
39
  popLastEditable(): QueuedMessage | null;
28
40
  popAllEditable(): QueuedMessage[];
41
+ /**
42
+ * Enqueue a background task notification (XML string). Notifications are
43
+ * not user-editable and not surfaced in the queued-messages UI.
44
+ */
45
+ enqueueNotification(xml: string): void;
46
+ /** Whether any notification items are pending. */
47
+ hasNotifications(): boolean;
48
+ /**
49
+ * Drain all notification items, returning their XML content. Non-notification
50
+ * items (messages, bang commands) are preserved in the queue.
51
+ */
52
+ drainNotifications(): string[];
29
53
  }
30
- //# sourceMappingURL=messageQueue.d.ts.map
@@ -30,8 +30,12 @@ export class MessageQueue {
30
30
  dequeue() {
31
31
  return this.queue.shift() ?? null;
32
32
  }
33
+ /**
34
+ * Clear user-facing items (messages, bang commands) but preserve pending
35
+ * notifications so background task results are not lost on abort.
36
+ */
33
37
  clear() {
34
- this.queue = [];
38
+ this.queue = this.queue.filter((m) => m.type === "notification");
35
39
  this._state = "idle";
36
40
  }
37
41
  hasPending() {
@@ -56,6 +60,19 @@ export class MessageQueue {
56
60
  this.onMessageEnqueued?.();
57
61
  return true;
58
62
  }
63
+ updateById(id, patch) {
64
+ const m = this.queue.find((x) => x.id === id);
65
+ if (!m)
66
+ return false;
67
+ if (patch.content !== undefined)
68
+ m.content = patch.content;
69
+ if (patch.images !== undefined)
70
+ m.images = patch.images;
71
+ if (patch.type !== undefined)
72
+ m.type = patch.type;
73
+ this.onMessageEnqueued?.();
74
+ return true;
75
+ }
59
76
  popLastEditable() {
60
77
  for (let i = this.queue.length - 1; i >= 0; i--) {
61
78
  if (this.queue[i].editable !== false) {
@@ -78,4 +95,39 @@ export class MessageQueue {
78
95
  this.queue = remaining;
79
96
  return editable;
80
97
  }
98
+ /**
99
+ * Enqueue a background task notification (XML string). Notifications are
100
+ * not user-editable and not surfaced in the queued-messages UI.
101
+ */
102
+ enqueueNotification(xml) {
103
+ this.queue.push({
104
+ id: `mq-${this.nextId++}`,
105
+ type: "notification",
106
+ content: xml,
107
+ editable: false,
108
+ });
109
+ this.onMessageEnqueued?.();
110
+ }
111
+ /** Whether any notification items are pending. */
112
+ hasNotifications() {
113
+ return this.queue.some((m) => m.type === "notification");
114
+ }
115
+ /**
116
+ * Drain all notification items, returning their XML content. Non-notification
117
+ * items (messages, bang commands) are preserved in the queue.
118
+ */
119
+ drainNotifications() {
120
+ const notifications = [];
121
+ const remaining = [];
122
+ for (const msg of this.queue) {
123
+ if (msg.type === "notification") {
124
+ notifications.push(msg.content);
125
+ }
126
+ else {
127
+ remaining.push(msg);
128
+ }
129
+ }
130
+ this.queue = remaining;
131
+ return notifications;
132
+ }
81
133
  }
@@ -183,4 +183,3 @@ export declare class PermissionManager {
183
183
  */
184
184
  addPermissionRule(rule: string): Promise<void>;
185
185
  }
186
- //# sourceMappingURL=permissionManager.d.ts.map
@@ -11,7 +11,6 @@ import { RESTRICTED_TOOLS } from "../types/permissions.js";
11
11
  import { splitBashCommand, stripEnvVars, stripRedirections, hasWriteRedirections, getSmartPrefix, isDangerousFind, DANGEROUS_COMMANDS, } from "../utils/bashParser.js";
12
12
  import { isPathInside } from "../utils/pathSafety.js";
13
13
  import { BASH_TOOL_NAME, EDIT_TOOL_NAME, WRITE_TOOL_NAME, READ_TOOL_NAME, ASK_USER_QUESTION_TOOL_NAME, } from "../constants/tools.js";
14
- import { getCurrentWorktreeSession } from "../utils/worktreeSession.js";
15
14
  const SAFE_COMMANDS = [
16
15
  "cd",
17
16
  "ls",
@@ -337,8 +336,9 @@ export class PermissionManager {
337
336
  }
338
337
  }
339
338
  // 1.0 Check worktree safety for Write and Edit tools
340
- // Support both CLI -w sessions (container-registered) and EnterWorktree mid-session (module-level)
341
- const worktreeSession = getCurrentWorktreeSession();
339
+ // Support both CLI -w sessions (container-registered) and EnterWorktree mid-session
340
+ // (per-agent WorktreeSession stored in this session's container)
341
+ const worktreeSession = this.container.get("WorktreeSession");
342
342
  const effectiveWorktreeName = this.worktreeName || worktreeSession?.worktreeName;
343
343
  const effectiveWorkdir = this.workdir || worktreeSession?.worktreePath;
344
344
  const effectiveMainRepoRoot = this.mainRepoRoot || worktreeSession?.repoRoot;
@@ -25,4 +25,3 @@ export declare class PlanManager {
25
25
  isPlanEntryReminderPending(): boolean;
26
26
  consumePlanEntryReminder(): void;
27
27
  }
28
- //# sourceMappingURL=planManager.d.ts.map
@@ -43,4 +43,3 @@ export declare class PluginManager {
43
43
  */
44
44
  getPlugin(name: string): Plugin | undefined;
45
45
  }
46
- //# sourceMappingURL=pluginManager.d.ts.map
@@ -43,4 +43,3 @@ export declare class PluginScopeManager {
43
43
  */
44
44
  private refreshPluginManager;
45
45
  }
46
- //# sourceMappingURL=pluginScopeManager.d.ts.map
@@ -37,4 +37,3 @@ export declare class ReversionManager {
37
37
  */
38
38
  revertTo(messageIds: string[], allMessages: import("../types/index.js").Message[]): Promise<number>;
39
39
  }
40
- //# sourceMappingURL=reversionManager.d.ts.map
@@ -101,4 +101,3 @@ export declare class SkillManager extends EventEmitter {
101
101
  */
102
102
  registerPluginSkills(pluginName: string, skills: Skill[]): void;
103
103
  }
104
- //# sourceMappingURL=skillManager.d.ts.map
@@ -88,4 +88,3 @@ export declare class SlashCommandManager {
88
88
  */
89
89
  abortCurrentCommand(): void;
90
90
  }
91
- //# sourceMappingURL=slashCommandManager.d.ts.map
@@ -5,7 +5,6 @@ import { AIManager } from "./aiManager.js";
5
5
  import { MessageManager } from "./messageManager.js";
6
6
  import { ToolManager } from "./toolManager.js";
7
7
  import { BackgroundTaskManager } from "./backgroundTaskManager.js";
8
- import { NotificationQueue } from "./notificationQueue.js";
9
8
  import { UserMessageParams, type ToolBlockUpdateCallbackParams } from "../utils/messageOperations.js";
10
9
  import { Container } from "../utils/container.js";
11
10
  import type { PermissionManager } from "./permissionManager.js";
@@ -46,7 +45,6 @@ export interface SubagentInstance {
46
45
  toolManager: ToolManager;
47
46
  permissionManager: PermissionManager;
48
47
  backgroundTaskManager: BackgroundTaskManager;
49
- notificationQueue: NotificationQueue;
50
48
  status: "initializing" | "active" | "completed" | "error" | "aborted";
51
49
  messages: Message[];
52
50
  usedTools: {
@@ -156,4 +154,3 @@ export declare class SubagentManager {
156
154
  */
157
155
  private createSubagentCallbacks;
158
156
  }
159
- //# sourceMappingURL=subagentManager.d.ts.map
@@ -5,10 +5,9 @@ import * as path from "path";
5
5
  import { AIManager } from "./aiManager.js";
6
6
  import { MessageManager } from "./messageManager.js";
7
7
  import { ToolManager } from "./toolManager.js";
8
- import { AGENT_TOOL_NAME } from "../constants/tools.js";
8
+ import { AGENT_TOOL_NAME, TASK_CREATE_TOOL_NAME, TASK_GET_TOOL_NAME, TASK_LIST_TOOL_NAME, TASK_UPDATE_TOOL_NAME, } from "../constants/tools.js";
9
9
  import { addConsolidatedAbortListener, createAbortPromise, } from "../utils/abortUtils.js";
10
10
  import { BackgroundTaskManager } from "./backgroundTaskManager.js";
11
- import { NotificationQueue } from "./notificationQueue.js";
12
11
  import { logger } from "../utils/globalLogger.js";
13
12
  export class SubagentManager {
14
13
  constructor(container, options) {
@@ -165,6 +164,12 @@ export class SubagentManager {
165
164
  instanceDeniedRules: [
166
165
  ...(parentPermissionManager?.getInstanceDeniedRules?.() || []),
167
166
  AGENT_TOOL_NAME, // Always deny Agent tool in subagents to prevent recursion
167
+ // Deny Task tools in subagents — they share the parent's TaskManager
168
+ // and could mutate the main agent's task list
169
+ TASK_CREATE_TOOL_NAME,
170
+ TASK_GET_TOOL_NAME,
171
+ TASK_UPDATE_TOOL_NAME,
172
+ TASK_LIST_TOOL_NAME,
168
173
  ],
169
174
  additionalDirectories: parentPermissionManager?.getAdditionalDirectories(),
170
175
  systemAdditionalDirectories: parentPermissionManager?.getSystemAdditionalDirectories(),
@@ -210,9 +215,6 @@ export class SubagentManager {
210
215
  },
211
216
  });
212
217
  subagentContainer.register("AIManager", aiManager);
213
- // Create isolated NotificationQueue for the subagent/forked agent
214
- const subagentNotificationQueue = new NotificationQueue();
215
- subagentContainer.register("NotificationQueue", subagentNotificationQueue);
216
218
  // Create isolated BackgroundTaskManager for the subagent/forked agent
217
219
  const subagentBackgroundTaskManager = new BackgroundTaskManager(subagentContainer, {
218
220
  workdir: this.workdir,
@@ -226,7 +228,6 @@ export class SubagentManager {
226
228
  toolManager,
227
229
  permissionManager: subagentPermissionManager,
228
230
  backgroundTaskManager: subagentBackgroundTaskManager,
229
- notificationQueue: subagentNotificationQueue,
230
231
  status: "initializing",
231
232
  messages: [],
232
233
  usedTools: [], // Initialize usedTools
@@ -420,12 +421,12 @@ export class SubagentManager {
420
421
  }
421
422
  // Skip notification if task was already stopped (e.g. by main agent shutdown)
422
423
  if (!wasAlreadyKilled) {
423
- const notificationQueue = this.container.has("NotificationQueue")
424
- ? this.container.get("NotificationQueue")
424
+ const messageQueue = this.container.has("MessageQueue")
425
+ ? this.container.get("MessageQueue")
425
426
  : undefined;
426
- if (notificationQueue) {
427
+ if (messageQueue) {
427
428
  const summary = `Agent task "${instance.description}" completed`;
428
- notificationQueue.enqueue(`<task-notification>\n<task-id>${instance.backgroundTaskId}</task-id>\n<task-type>agent</task-type>\n<status>completed</status>\n<summary>${summary}</summary>\n</task-notification>`);
429
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${instance.backgroundTaskId}</task-id>\n<task-type>agent</task-type>\n<status>completed</status>\n<summary>${summary}</summary>\n</task-notification>`);
429
430
  }
430
431
  }
431
432
  }
@@ -452,13 +453,13 @@ export class SubagentManager {
452
453
  }
453
454
  // Skip notification if task was already stopped (e.g. by main agent shutdown)
454
455
  if (!wasAlreadyKilled) {
455
- const notificationQueue = this.container.has("NotificationQueue")
456
- ? this.container.get("NotificationQueue")
456
+ const messageQueue = this.container.has("MessageQueue")
457
+ ? this.container.get("MessageQueue")
457
458
  : undefined;
458
- if (notificationQueue) {
459
+ if (messageQueue) {
459
460
  const errorMsg = error instanceof Error ? error.message : String(error);
460
461
  const summary = `Agent task "${instance.description}" failed: ${errorMsg}`;
461
- notificationQueue.enqueue(`<task-notification>\n<task-id>${instance.backgroundTaskId}</task-id>\n<task-type>agent</task-type>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
462
+ messageQueue.enqueueNotification(`<task-notification>\n<task-id>${instance.backgroundTaskId}</task-id>\n<task-type>agent</task-type>\n<status>failed</status>\n<summary>${summary}</summary>\n</task-notification>`);
462
463
  }
463
464
  }
464
465
  }
@@ -114,4 +114,3 @@ declare class ToolManager {
114
114
  getTaskManager(): import("../services/taskManager.js").TaskManager | undefined;
115
115
  }
116
116
  export { ToolManager };
117
- //# sourceMappingURL=toolManager.d.ts.map
@@ -9,7 +9,7 @@ export declare class WorkflowManager {
9
9
  constructor(container: Container);
10
10
  private get stateStore();
11
11
  private get backgroundTaskManager();
12
- private get notificationQueue();
12
+ private get messageQueue();
13
13
  private get subagentManager();
14
14
  private get workdir();
15
15
  private get sessionDir();
@@ -62,4 +62,3 @@ export declare class WorkflowManager {
62
62
  */
63
63
  cleanup(): void;
64
64
  }
65
- //# sourceMappingURL=workflowManager.d.ts.map
@@ -30,8 +30,8 @@ export class WorkflowManager {
30
30
  get backgroundTaskManager() {
31
31
  return this.container.get("BackgroundTaskManager");
32
32
  }
33
- get notificationQueue() {
34
- return this.container.get("NotificationQueue");
33
+ get messageQueue() {
34
+ return this.container.get("MessageQueue");
35
35
  }
36
36
  get subagentManager() {
37
37
  return this.container.get("SubagentManager");
@@ -209,7 +209,7 @@ export class WorkflowManager {
209
209
  }
210
210
  // Enqueue completion notification
211
211
  const journalPath = journal.filePath;
212
- this.notificationQueue.enqueue(taskNotificationToXml({
212
+ this.messageQueue.enqueueNotification(taskNotificationToXml({
213
213
  type: "task_notification",
214
214
  taskId: runId,
215
215
  taskType: "workflow",
@@ -244,7 +244,7 @@ export class WorkflowManager {
244
244
  task.stderr = run.error || "";
245
245
  task.endTime = Date.now();
246
246
  }
247
- this.notificationQueue.enqueue(taskNotificationToXml({
247
+ this.messageQueue.enqueueNotification(taskNotificationToXml({
248
248
  type: "task_notification",
249
249
  taskId: runId,
250
250
  taskType: "workflow",
@@ -1,2 +1 @@
1
1
  export declare function buildAutoMemoryPrompt(memoryDir: string): string;
2
- //# sourceMappingURL=autoMemory.d.ts.map
@@ -2,4 +2,3 @@
2
2
  * Build the auto-memory extraction prompt for the background agent.
3
3
  */
4
4
  export declare function buildAutoMemoryExtractionPrompt(newMessageCount: number, existingMemoriesManifest: string): string;
5
- //# sourceMappingURL=autoMemoryExtraction.d.ts.map