wave-agent-sdk 0.19.6 → 0.19.8

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 (366) hide show
  1. package/dist/agent.d.ts +16 -14
  2. package/dist/agent.js +58 -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 +1 -1
  10. package/dist/index.js +1 -0
  11. package/dist/managers/MemoryRuleManager.d.ts +0 -1
  12. package/dist/managers/aiManager.d.ts +2 -1
  13. package/dist/managers/aiManager.js +29 -9
  14. package/dist/managers/backgroundTaskManager.d.ts +0 -2
  15. package/dist/managers/backgroundTaskManager.js +16 -19
  16. package/dist/managers/bangManager.d.ts +0 -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 +0 -1
  26. package/dist/managers/messageQueue.d.ts +17 -2
  27. package/dist/managers/messageQueue.js +40 -1
  28. package/dist/managers/permissionManager.d.ts +0 -1
  29. package/dist/managers/planManager.d.ts +0 -1
  30. package/dist/managers/pluginManager.d.ts +0 -1
  31. package/dist/managers/pluginScopeManager.d.ts +0 -1
  32. package/dist/managers/reversionManager.d.ts +0 -1
  33. package/dist/managers/skillManager.d.ts +0 -1
  34. package/dist/managers/slashCommandManager.d.ts +0 -1
  35. package/dist/managers/subagentManager.d.ts +0 -3
  36. package/dist/managers/subagentManager.js +14 -13
  37. package/dist/managers/toolManager.d.ts +0 -1
  38. package/dist/managers/workflowManager.d.ts +1 -2
  39. package/dist/managers/workflowManager.js +4 -4
  40. package/dist/prompts/autoMemory.d.ts +0 -1
  41. package/dist/prompts/autoMemoryExtraction.d.ts +0 -1
  42. package/dist/prompts/index.d.ts +0 -1
  43. package/dist/prompts/planModeReminders.d.ts +0 -1
  44. package/dist/services/GitService.d.ts +0 -1
  45. package/dist/services/MarketplaceService.d.ts +0 -1
  46. package/dist/services/MemoryRuleService.d.ts +0 -1
  47. package/dist/services/aiService.d.ts +0 -1
  48. package/dist/services/authService.d.ts +0 -1
  49. package/dist/services/autoMemoryService.d.ts +0 -1
  50. package/dist/services/configurationService.d.ts +6 -1
  51. package/dist/services/configurationService.js +31 -0
  52. package/dist/services/fileWatcher.d.ts +0 -1
  53. package/dist/services/hook.d.ts +0 -1
  54. package/dist/services/initializationService.d.ts +0 -1
  55. package/dist/services/interactionService.d.ts +0 -1
  56. package/dist/services/interactionService.js +10 -0
  57. package/dist/services/jsonlHandler.d.ts +0 -1
  58. package/dist/services/memory.d.ts +0 -1
  59. package/dist/services/pluginLoader.d.ts +0 -1
  60. package/dist/services/remoteSettingsService.d.ts +0 -1
  61. package/dist/services/remoteSettingsService.js +2 -0
  62. package/dist/services/reversionService.d.ts +0 -1
  63. package/dist/services/session.d.ts +0 -1
  64. package/dist/services/taskManager.d.ts +0 -1
  65. package/dist/services/taskManager.js +8 -1
  66. package/dist/telemetry/events.d.ts +0 -1
  67. package/dist/telemetry/instrumentation.d.ts +0 -1
  68. package/dist/telemetry/sessionTracing.d.ts +0 -1
  69. package/dist/tools/agentTool.d.ts +0 -1
  70. package/dist/tools/askUserQuestion.d.ts +0 -1
  71. package/dist/tools/bashTool.d.ts +0 -1
  72. package/dist/tools/buildTool.d.ts +0 -1
  73. package/dist/tools/cronCreateTool.d.ts +0 -1
  74. package/dist/tools/cronDeleteTool.d.ts +0 -1
  75. package/dist/tools/cronListTool.d.ts +0 -1
  76. package/dist/tools/editTool.d.ts +0 -1
  77. package/dist/tools/enterPlanMode.d.ts +0 -1
  78. package/dist/tools/enterWorktreeTool.d.ts +0 -1
  79. package/dist/tools/enterWorktreeTool.js +2 -1
  80. package/dist/tools/exitPlanMode.d.ts +0 -1
  81. package/dist/tools/exitWorktreeTool.d.ts +0 -1
  82. package/dist/tools/globTool.d.ts +0 -1
  83. package/dist/tools/grepTool.d.ts +0 -1
  84. package/dist/tools/lspTool.d.ts +0 -1
  85. package/dist/tools/readTool.d.ts +0 -1
  86. package/dist/tools/skillTool.d.ts +0 -1
  87. package/dist/tools/taskManagementTools.d.ts +0 -1
  88. package/dist/tools/taskStopTool.d.ts +0 -1
  89. package/dist/tools/types.d.ts +0 -1
  90. package/dist/tools/webFetchTool.d.ts +0 -1
  91. package/dist/tools/workflowTool.d.ts +0 -1
  92. package/dist/tools/writeTool.d.ts +0 -1
  93. package/dist/types/agent.d.ts +0 -1
  94. package/dist/types/auth.d.ts +0 -1
  95. package/dist/types/commands.d.ts +0 -1
  96. package/dist/types/config.d.ts +0 -1
  97. package/dist/types/configuration.d.ts +5 -1
  98. package/dist/types/core.d.ts +0 -1
  99. package/dist/types/cron.d.ts +0 -1
  100. package/dist/types/environment.d.ts +0 -1
  101. package/dist/types/fileSearch.d.ts +0 -1
  102. package/dist/types/history.d.ts +0 -1
  103. package/dist/types/hooks.d.ts +0 -1
  104. package/dist/types/index.d.ts +0 -1
  105. package/dist/types/lsp.d.ts +0 -1
  106. package/dist/types/marketplace.d.ts +0 -1
  107. package/dist/types/mcp.d.ts +0 -1
  108. package/dist/types/memoryRule.d.ts +0 -1
  109. package/dist/types/messaging.d.ts +0 -1
  110. package/dist/types/permissions.d.ts +0 -3
  111. package/dist/types/plugins.d.ts +0 -1
  112. package/dist/types/processes.d.ts +27 -1
  113. package/dist/types/reversion.d.ts +0 -1
  114. package/dist/types/session.d.ts +0 -1
  115. package/dist/types/skills.d.ts +0 -1
  116. package/dist/types/tasks.d.ts +0 -1
  117. package/dist/types/telemetry.d.ts +0 -1
  118. package/dist/types/tools.d.ts +0 -1
  119. package/dist/types/workflow.d.ts +1 -2
  120. package/dist/utils/abortUtils.d.ts +0 -1
  121. package/dist/utils/atomicWrite.d.ts +0 -1
  122. package/dist/utils/bashParser.d.ts +0 -1
  123. package/dist/utils/cacheControlUtils.d.ts +0 -1
  124. package/dist/utils/commandArgumentParser.d.ts +0 -1
  125. package/dist/utils/commandPathResolver.d.ts +0 -1
  126. package/dist/utils/configPaths.d.ts +0 -1
  127. package/dist/utils/configValidator.d.ts +0 -1
  128. package/dist/utils/constants.d.ts +0 -1
  129. package/dist/utils/container.d.ts +0 -1
  130. package/dist/utils/containerSetup.d.ts +0 -1
  131. package/dist/utils/containerSetup.js +0 -12
  132. package/dist/utils/convertMessagesForAPI.d.ts +0 -1
  133. package/dist/utils/cronTasks.d.ts +0 -1
  134. package/dist/utils/cronTasksLock.d.ts +0 -1
  135. package/dist/utils/cronToHuman.d.ts +0 -1
  136. package/dist/utils/customCommands.d.ts +0 -1
  137. package/dist/utils/editUtils.d.ts +0 -1
  138. package/dist/utils/fileFormat.d.ts +0 -1
  139. package/dist/utils/fileSearch.d.ts +0 -1
  140. package/dist/utils/fileUtils.d.ts +0 -1
  141. package/dist/utils/gitUtils.d.ts +0 -1
  142. package/dist/utils/globalLogger.d.ts +0 -1
  143. package/dist/utils/groupMessagesByApiRound.d.ts +0 -1
  144. package/dist/utils/hookMatcher.d.ts +0 -1
  145. package/dist/utils/markdownParser.d.ts +0 -1
  146. package/dist/utils/mcpUtils.d.ts +0 -1
  147. package/dist/utils/messageOperations.d.ts +0 -1
  148. package/dist/utils/modelCapabilities.d.ts +0 -1
  149. package/dist/utils/nameGenerator.d.ts +0 -1
  150. package/dist/utils/notificationXml.d.ts +0 -1
  151. package/dist/utils/openaiClient.d.ts +0 -1
  152. package/dist/utils/parseCronExpression.d.ts +0 -1
  153. package/dist/utils/path.d.ts +0 -1
  154. package/dist/utils/pathEncoder.d.ts +0 -1
  155. package/dist/utils/pathSafety.d.ts +0 -1
  156. package/dist/utils/promptHistory.d.ts +0 -1
  157. package/dist/utils/ripgrep.d.ts +0 -1
  158. package/dist/utils/shellResolver.d.ts +0 -1
  159. package/dist/utils/skillParser.d.ts +0 -1
  160. package/dist/utils/stringUtils.d.ts +0 -1
  161. package/dist/utils/subagentParser.d.ts +0 -1
  162. package/dist/utils/taskReminder.d.ts +0 -1
  163. package/dist/utils/tokenCalculation.d.ts +0 -1
  164. package/dist/utils/tokenEstimate.d.ts +0 -1
  165. package/dist/utils/toolResultStorage.d.ts +0 -1
  166. package/dist/utils/worktreeSession.d.ts +1 -2
  167. package/dist/utils/worktreeSession.js +1 -1
  168. package/dist/utils/worktreeUtils.d.ts +7 -2
  169. package/dist/utils/worktreeUtils.js +10 -4
  170. package/dist/workflow/budgetTracker.d.ts +0 -1
  171. package/dist/workflow/concurrencyLimiter.d.ts +0 -1
  172. package/dist/workflow/journal.d.ts +0 -1
  173. package/dist/workflow/progressReporter.d.ts +0 -1
  174. package/dist/workflow/runState.d.ts +0 -1
  175. package/dist/workflow/scriptRuntime.d.ts +0 -1
  176. package/dist/workflow/structuredOutput.d.ts +0 -1
  177. package/dist/workflow/types.d.ts +5 -1
  178. package/dist/workflow/workflowApis.d.ts +0 -1
  179. package/package.json +1 -1
  180. package/src/agent.ts +59 -67
  181. package/src/index.ts +1 -0
  182. package/src/managers/aiManager.ts +34 -10
  183. package/src/managers/backgroundTaskManager.ts +17 -21
  184. package/src/managers/messageQueue.ts +43 -2
  185. package/src/managers/subagentManager.ts +15 -15
  186. package/src/managers/workflowManager.ts +5 -5
  187. package/src/services/configurationService.ts +37 -0
  188. package/src/services/interactionService.ts +11 -0
  189. package/src/services/remoteSettingsService.ts +1 -0
  190. package/src/services/taskManager.ts +8 -1
  191. package/src/tools/enterWorktreeTool.ts +2 -1
  192. package/src/types/configuration.ts +5 -0
  193. package/src/types/permissions.ts +0 -2
  194. package/src/types/processes.ts +29 -0
  195. package/src/types/workflow.ts +1 -0
  196. package/src/utils/containerSetup.ts +0 -15
  197. package/src/utils/worktreeSession.ts +1 -1
  198. package/src/utils/worktreeUtils.ts +14 -4
  199. package/src/workflow/types.ts +6 -0
  200. package/dist/agent.d.ts.map +0 -1
  201. package/dist/constants/goalPrompts.d.ts.map +0 -1
  202. package/dist/constants/subagents.d.ts.map +0 -1
  203. package/dist/constants/toolLimits.d.ts.map +0 -1
  204. package/dist/constants/tools.d.ts.map +0 -1
  205. package/dist/core/plugin.d.ts.map +0 -1
  206. package/dist/core/session.d.ts.map +0 -1
  207. package/dist/index.d.ts.map +0 -1
  208. package/dist/managers/MemoryRuleManager.d.ts.map +0 -1
  209. package/dist/managers/aiManager.d.ts.map +0 -1
  210. package/dist/managers/backgroundTaskManager.d.ts.map +0 -1
  211. package/dist/managers/bangManager.d.ts.map +0 -1
  212. package/dist/managers/cronManager.d.ts.map +0 -1
  213. package/dist/managers/foregroundTaskManager.d.ts.map +0 -1
  214. package/dist/managers/forkedAgentManager.d.ts.map +0 -1
  215. package/dist/managers/goalManager.d.ts.map +0 -1
  216. package/dist/managers/hookManager.d.ts.map +0 -1
  217. package/dist/managers/liveConfigManager.d.ts.map +0 -1
  218. package/dist/managers/lspManager.d.ts.map +0 -1
  219. package/dist/managers/mcpManager.d.ts.map +0 -1
  220. package/dist/managers/messageManager.d.ts.map +0 -1
  221. package/dist/managers/messageQueue.d.ts.map +0 -1
  222. package/dist/managers/notificationQueue.d.ts +0 -8
  223. package/dist/managers/notificationQueue.d.ts.map +0 -1
  224. package/dist/managers/notificationQueue.js +0 -17
  225. package/dist/managers/permissionManager.d.ts.map +0 -1
  226. package/dist/managers/planManager.d.ts.map +0 -1
  227. package/dist/managers/pluginManager.d.ts.map +0 -1
  228. package/dist/managers/pluginScopeManager.d.ts.map +0 -1
  229. package/dist/managers/reversionManager.d.ts.map +0 -1
  230. package/dist/managers/skillManager.d.ts.map +0 -1
  231. package/dist/managers/slashCommandManager.d.ts.map +0 -1
  232. package/dist/managers/subagentManager.d.ts.map +0 -1
  233. package/dist/managers/toolManager.d.ts.map +0 -1
  234. package/dist/managers/workflowManager.d.ts.map +0 -1
  235. package/dist/prompts/autoMemory.d.ts.map +0 -1
  236. package/dist/prompts/autoMemoryExtraction.d.ts.map +0 -1
  237. package/dist/prompts/index.d.ts.map +0 -1
  238. package/dist/prompts/planModeReminders.d.ts.map +0 -1
  239. package/dist/services/GitService.d.ts.map +0 -1
  240. package/dist/services/MarketplaceService.d.ts.map +0 -1
  241. package/dist/services/MemoryRuleService.d.ts.map +0 -1
  242. package/dist/services/aiService.d.ts.map +0 -1
  243. package/dist/services/authService.d.ts.map +0 -1
  244. package/dist/services/autoMemoryService.d.ts.map +0 -1
  245. package/dist/services/configurationService.d.ts.map +0 -1
  246. package/dist/services/fileWatcher.d.ts.map +0 -1
  247. package/dist/services/hook.d.ts.map +0 -1
  248. package/dist/services/initializationService.d.ts.map +0 -1
  249. package/dist/services/interactionService.d.ts.map +0 -1
  250. package/dist/services/jsonlHandler.d.ts.map +0 -1
  251. package/dist/services/memory.d.ts.map +0 -1
  252. package/dist/services/pluginLoader.d.ts.map +0 -1
  253. package/dist/services/remoteSettingsService.d.ts.map +0 -1
  254. package/dist/services/reversionService.d.ts.map +0 -1
  255. package/dist/services/session.d.ts.map +0 -1
  256. package/dist/services/taskManager.d.ts.map +0 -1
  257. package/dist/telemetry/events.d.ts.map +0 -1
  258. package/dist/telemetry/instrumentation.d.ts.map +0 -1
  259. package/dist/telemetry/sessionTracing.d.ts.map +0 -1
  260. package/dist/tools/agentTool.d.ts.map +0 -1
  261. package/dist/tools/askUserQuestion.d.ts.map +0 -1
  262. package/dist/tools/bashTool.d.ts.map +0 -1
  263. package/dist/tools/buildTool.d.ts.map +0 -1
  264. package/dist/tools/cronCreateTool.d.ts.map +0 -1
  265. package/dist/tools/cronDeleteTool.d.ts.map +0 -1
  266. package/dist/tools/cronListTool.d.ts.map +0 -1
  267. package/dist/tools/editTool.d.ts.map +0 -1
  268. package/dist/tools/enterPlanMode.d.ts.map +0 -1
  269. package/dist/tools/enterWorktreeTool.d.ts.map +0 -1
  270. package/dist/tools/exitPlanMode.d.ts.map +0 -1
  271. package/dist/tools/exitWorktreeTool.d.ts.map +0 -1
  272. package/dist/tools/globTool.d.ts.map +0 -1
  273. package/dist/tools/grepTool.d.ts.map +0 -1
  274. package/dist/tools/lspTool.d.ts.map +0 -1
  275. package/dist/tools/readTool.d.ts.map +0 -1
  276. package/dist/tools/skillTool.d.ts.map +0 -1
  277. package/dist/tools/taskManagementTools.d.ts.map +0 -1
  278. package/dist/tools/taskStopTool.d.ts.map +0 -1
  279. package/dist/tools/types.d.ts.map +0 -1
  280. package/dist/tools/webFetchTool.d.ts.map +0 -1
  281. package/dist/tools/workflowTool.d.ts.map +0 -1
  282. package/dist/tools/writeTool.d.ts.map +0 -1
  283. package/dist/types/agent.d.ts.map +0 -1
  284. package/dist/types/auth.d.ts.map +0 -1
  285. package/dist/types/commands.d.ts.map +0 -1
  286. package/dist/types/config.d.ts.map +0 -1
  287. package/dist/types/configuration.d.ts.map +0 -1
  288. package/dist/types/core.d.ts.map +0 -1
  289. package/dist/types/cron.d.ts.map +0 -1
  290. package/dist/types/environment.d.ts.map +0 -1
  291. package/dist/types/fileSearch.d.ts.map +0 -1
  292. package/dist/types/history.d.ts.map +0 -1
  293. package/dist/types/hooks.d.ts.map +0 -1
  294. package/dist/types/index.d.ts.map +0 -1
  295. package/dist/types/lsp.d.ts.map +0 -1
  296. package/dist/types/marketplace.d.ts.map +0 -1
  297. package/dist/types/mcp.d.ts.map +0 -1
  298. package/dist/types/memoryRule.d.ts.map +0 -1
  299. package/dist/types/messaging.d.ts.map +0 -1
  300. package/dist/types/permissions.d.ts.map +0 -1
  301. package/dist/types/plugins.d.ts.map +0 -1
  302. package/dist/types/processes.d.ts.map +0 -1
  303. package/dist/types/reversion.d.ts.map +0 -1
  304. package/dist/types/session.d.ts.map +0 -1
  305. package/dist/types/skills.d.ts.map +0 -1
  306. package/dist/types/tasks.d.ts.map +0 -1
  307. package/dist/types/telemetry.d.ts.map +0 -1
  308. package/dist/types/tools.d.ts.map +0 -1
  309. package/dist/types/workflow.d.ts.map +0 -1
  310. package/dist/utils/abortUtils.d.ts.map +0 -1
  311. package/dist/utils/atomicWrite.d.ts.map +0 -1
  312. package/dist/utils/bashParser.d.ts.map +0 -1
  313. package/dist/utils/cacheControlUtils.d.ts.map +0 -1
  314. package/dist/utils/commandArgumentParser.d.ts.map +0 -1
  315. package/dist/utils/commandPathResolver.d.ts.map +0 -1
  316. package/dist/utils/configPaths.d.ts.map +0 -1
  317. package/dist/utils/configValidator.d.ts.map +0 -1
  318. package/dist/utils/constants.d.ts.map +0 -1
  319. package/dist/utils/container.d.ts.map +0 -1
  320. package/dist/utils/containerSetup.d.ts.map +0 -1
  321. package/dist/utils/convertMessagesForAPI.d.ts.map +0 -1
  322. package/dist/utils/cronTasks.d.ts.map +0 -1
  323. package/dist/utils/cronTasksLock.d.ts.map +0 -1
  324. package/dist/utils/cronToHuman.d.ts.map +0 -1
  325. package/dist/utils/customCommands.d.ts.map +0 -1
  326. package/dist/utils/editUtils.d.ts.map +0 -1
  327. package/dist/utils/fileFormat.d.ts.map +0 -1
  328. package/dist/utils/fileSearch.d.ts.map +0 -1
  329. package/dist/utils/fileUtils.d.ts.map +0 -1
  330. package/dist/utils/gitUtils.d.ts.map +0 -1
  331. package/dist/utils/globalLogger.d.ts.map +0 -1
  332. package/dist/utils/groupMessagesByApiRound.d.ts.map +0 -1
  333. package/dist/utils/hookMatcher.d.ts.map +0 -1
  334. package/dist/utils/markdownParser.d.ts.map +0 -1
  335. package/dist/utils/mcpUtils.d.ts.map +0 -1
  336. package/dist/utils/messageOperations.d.ts.map +0 -1
  337. package/dist/utils/modelCapabilities.d.ts.map +0 -1
  338. package/dist/utils/nameGenerator.d.ts.map +0 -1
  339. package/dist/utils/notificationXml.d.ts.map +0 -1
  340. package/dist/utils/openaiClient.d.ts.map +0 -1
  341. package/dist/utils/parseCronExpression.d.ts.map +0 -1
  342. package/dist/utils/path.d.ts.map +0 -1
  343. package/dist/utils/pathEncoder.d.ts.map +0 -1
  344. package/dist/utils/pathSafety.d.ts.map +0 -1
  345. package/dist/utils/promptHistory.d.ts.map +0 -1
  346. package/dist/utils/ripgrep.d.ts.map +0 -1
  347. package/dist/utils/shellResolver.d.ts.map +0 -1
  348. package/dist/utils/skillParser.d.ts.map +0 -1
  349. package/dist/utils/stringUtils.d.ts.map +0 -1
  350. package/dist/utils/subagentParser.d.ts.map +0 -1
  351. package/dist/utils/taskReminder.d.ts.map +0 -1
  352. package/dist/utils/tokenCalculation.d.ts.map +0 -1
  353. package/dist/utils/tokenEstimate.d.ts.map +0 -1
  354. package/dist/utils/toolResultStorage.d.ts.map +0 -1
  355. package/dist/utils/worktreeSession.d.ts.map +0 -1
  356. package/dist/utils/worktreeUtils.d.ts.map +0 -1
  357. package/dist/workflow/budgetTracker.d.ts.map +0 -1
  358. package/dist/workflow/concurrencyLimiter.d.ts.map +0 -1
  359. package/dist/workflow/journal.d.ts.map +0 -1
  360. package/dist/workflow/progressReporter.d.ts.map +0 -1
  361. package/dist/workflow/runState.d.ts.map +0 -1
  362. package/dist/workflow/scriptRuntime.d.ts.map +0 -1
  363. package/dist/workflow/structuredOutput.d.ts.map +0 -1
  364. package/dist/workflow/types.d.ts.map +0 -1
  365. package/dist/workflow/workflowApis.d.ts.map +0 -1
  366. package/src/managers/notificationQueue.ts +0 -19
@@ -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() {
@@ -91,4 +95,39 @@ export class MessageQueue {
91
95
  this.queue = remaining;
92
96
  return editable;
93
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
+ }
94
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
@@ -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
@@ -8,7 +8,7 @@ import { ToolManager } from "./toolManager.js";
8
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";
11
+ import { MessageQueue } from "./messageQueue.js";
12
12
  import { logger } from "../utils/globalLogger.js";
13
13
  export class SubagentManager {
14
14
  constructor(container, options) {
@@ -136,6 +136,11 @@ export class SubagentManager {
136
136
  const subagentId = randomUUID();
137
137
  // Create a child container for the subagent to isolate its managers
138
138
  const subagentContainer = this.container.createChild();
139
+ // Register an independent MessageQueue so the subagent's AIManager drains its
140
+ // own (empty) queue instead of falling back to the parent container's queue.
141
+ // Without this, concurrent background subagents steal sibling completion
142
+ // notifications from the parent queue, causing the main agent to exit early.
143
+ subagentContainer.register("MessageQueue", new MessageQueue());
139
144
  // Register a modified AgentOptions without onLoadingChange to prevent subagent loading
140
145
  // from affecting the parent agent's loading state
141
146
  const parentOptions = this.container.get("AgentOptions");
@@ -216,9 +221,6 @@ export class SubagentManager {
216
221
  },
217
222
  });
218
223
  subagentContainer.register("AIManager", aiManager);
219
- // Create isolated NotificationQueue for the subagent/forked agent
220
- const subagentNotificationQueue = new NotificationQueue();
221
- subagentContainer.register("NotificationQueue", subagentNotificationQueue);
222
224
  // Create isolated BackgroundTaskManager for the subagent/forked agent
223
225
  const subagentBackgroundTaskManager = new BackgroundTaskManager(subagentContainer, {
224
226
  workdir: this.workdir,
@@ -232,7 +234,6 @@ export class SubagentManager {
232
234
  toolManager,
233
235
  permissionManager: subagentPermissionManager,
234
236
  backgroundTaskManager: subagentBackgroundTaskManager,
235
- notificationQueue: subagentNotificationQueue,
236
237
  status: "initializing",
237
238
  messages: [],
238
239
  usedTools: [], // Initialize usedTools
@@ -426,12 +427,12 @@ export class SubagentManager {
426
427
  }
427
428
  // Skip notification if task was already stopped (e.g. by main agent shutdown)
428
429
  if (!wasAlreadyKilled) {
429
- const notificationQueue = this.container.has("NotificationQueue")
430
- ? this.container.get("NotificationQueue")
430
+ const messageQueue = this.container.has("MessageQueue")
431
+ ? this.container.get("MessageQueue")
431
432
  : undefined;
432
- if (notificationQueue) {
433
+ if (messageQueue) {
433
434
  const summary = `Agent task "${instance.description}" completed`;
434
- 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>`);
435
+ 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>`);
435
436
  }
436
437
  }
437
438
  }
@@ -458,13 +459,13 @@ export class SubagentManager {
458
459
  }
459
460
  // Skip notification if task was already stopped (e.g. by main agent shutdown)
460
461
  if (!wasAlreadyKilled) {
461
- const notificationQueue = this.container.has("NotificationQueue")
462
- ? this.container.get("NotificationQueue")
462
+ const messageQueue = this.container.has("MessageQueue")
463
+ ? this.container.get("MessageQueue")
463
464
  : undefined;
464
- if (notificationQueue) {
465
+ if (messageQueue) {
465
466
  const errorMsg = error instanceof Error ? error.message : String(error);
466
467
  const summary = `Agent task "${instance.description}" failed: ${errorMsg}`;
467
- 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>`);
468
+ 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>`);
468
469
  }
469
470
  }
470
471
  }
@@ -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
@@ -36,4 +36,3 @@ export declare function buildSystemPrompt(basePrompt: string | undefined, tools:
36
36
  };
37
37
  }): SystemPromptBlock[];
38
38
  export declare function enhanceSystemPromptWithEnvDetails(existingSystemPrompt: string, workdir: string, originalWorkdir?: string, worktreeSession?: WorktreeSession | null): string;
39
- //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,3 @@ export declare function wrapInSystemReminder(content: string): string;
2
2
  export declare function buildPlanModeReminder(planFilePath: string, planExists: boolean, isSubagent?: boolean): string;
3
3
  export declare function buildPlanModeReEntryReminder(planFilePath: string): string;
4
4
  export declare function buildExitedPlanModeReminder(planFilePath?: string, planExists?: boolean): string;
5
- //# sourceMappingURL=planModeReminders.d.ts.map
@@ -14,4 +14,3 @@ export declare class GitService {
14
14
  pull(targetPath: string): Promise<void>;
15
15
  private handleGitError;
16
16
  }
17
- //# sourceMappingURL=GitService.d.ts.map
@@ -139,4 +139,3 @@ export declare class MarketplaceService {
139
139
  */
140
140
  updatePlugin(pluginAtMarketplace: string): Promise<InstalledPlugin>;
141
141
  }
142
- //# sourceMappingURL=MarketplaceService.d.ts.map
@@ -9,4 +9,3 @@ export declare class MemoryRuleService {
9
9
  */
10
10
  isRuleActive(rule: MemoryRule, filesInContext: string[], workdir?: string): boolean;
11
11
  }
12
- //# sourceMappingURL=MemoryRuleService.d.ts.map
@@ -112,4 +112,3 @@ export interface EvaluateGoalResult {
112
112
  };
113
113
  }
114
114
  export declare function evaluateGoal(options: EvaluateGoalOptions): Promise<EvaluateGoalResult>;
115
- //# sourceMappingURL=aiService.d.ts.map
@@ -87,4 +87,3 @@ export declare function createAuthAwareFetch(innerFetch: typeof fetch): typeof f
87
87
  export declare function getOrCreateAnonymousId(): string;
88
88
  /** @internal — reset anonymous ID cache for testing only */
89
89
  export declare function __resetAnonymousIdForTesting(): void;
90
- //# sourceMappingURL=authService.d.ts.map
@@ -21,4 +21,3 @@ export declare class AutoMemoryService {
21
21
  */
22
22
  private runExtraction;
23
23
  }
24
- //# sourceMappingURL=autoMemoryService.d.ts.map
@@ -85,6 +85,12 @@ export declare class ConfigurationService {
85
85
  * @returns Resolved auto-memory enabled state
86
86
  */
87
87
  resolveAutoMemoryEnabled(): boolean;
88
+ /**
89
+ * Resolves worktree base ref with fallbacks
90
+ * Resolution priority: settings.json > default ("fresh")
91
+ * @returns Resolved worktree base ref
92
+ */
93
+ resolveWorktreeBaseRef(): "fresh" | "head";
88
94
  /**
89
95
  * Resolves auto-memory extraction frequency with fallbacks
90
96
  * Resolution priority: settings.json > WAVE_AUTO_MEMORY_FREQUENCY > default (1)
@@ -172,4 +178,3 @@ export declare function loadWaveConfigFromFile(filePath: string): WaveConfigurat
172
178
  * Checks .local.json files first, then falls back to .json files
173
179
  */
174
180
  export declare function loadMergedWaveConfig(workdir: string): WaveConfiguration | null;
175
- //# sourceMappingURL=configurationService.d.ts.map
@@ -241,6 +241,19 @@ export class ConfigurationService {
241
241
  }
242
242
  }
243
243
  }
244
+ // Validate worktree if present
245
+ if (config.worktree !== undefined) {
246
+ if (typeof config.worktree !== "object" || config.worktree === null) {
247
+ result.isValid = false;
248
+ result.errors.push("worktree configuration must be an object");
249
+ }
250
+ else if (config.worktree.baseRef !== undefined &&
251
+ config.worktree.baseRef !== "fresh" &&
252
+ config.worktree.baseRef !== "head") {
253
+ result.isValid = false;
254
+ result.errors.push(`Invalid worktree.baseRef: "${config.worktree.baseRef}". Must be "fresh" or "head".`);
255
+ }
256
+ }
244
257
  return result;
245
258
  }
246
259
  /**
@@ -506,6 +519,18 @@ export class ConfigurationService {
506
519
  // 3. Default (true)
507
520
  return true;
508
521
  }
522
+ /**
523
+ * Resolves worktree base ref with fallbacks
524
+ * Resolution priority: settings.json > default ("fresh")
525
+ * @returns Resolved worktree base ref
526
+ */
527
+ resolveWorktreeBaseRef() {
528
+ const baseRef = this.currentConfiguration?.worktree?.baseRef;
529
+ if (baseRef === "head") {
530
+ return "head";
531
+ }
532
+ return "fresh";
533
+ }
509
534
  /**
510
535
  * Resolves auto-memory extraction frequency with fallbacks
511
536
  * Resolution priority: settings.json > WAVE_AUTO_MEMORY_FREQUENCY > default (1)
@@ -944,6 +969,7 @@ export function loadWaveConfigFromFile(filePath) {
944
969
  : undefined,
945
970
  models: config.models || undefined,
946
971
  marketplaces: config.marketplaces || undefined,
972
+ worktree: config.worktree || undefined,
947
973
  };
948
974
  }
949
975
  catch (error) {
@@ -1074,6 +1100,10 @@ export function loadMergedWaveConfig(workdir) {
1074
1100
  mergedConfig.marketplaces = {};
1075
1101
  Object.assign(mergedConfig.marketplaces, config.marketplaces);
1076
1102
  }
1103
+ // Merge worktree (last one wins)
1104
+ if (config.worktree !== undefined) {
1105
+ mergedConfig.worktree = config.worktree;
1106
+ }
1077
1107
  // Merge models
1078
1108
  if (config.models) {
1079
1109
  if (!mergedConfig.models)
@@ -1111,5 +1141,6 @@ export function loadMergedWaveConfig(workdir) {
1111
1141
  models: mergedConfig.models && Object.keys(mergedConfig.models).length > 0
1112
1142
  ? mergedConfig.models
1113
1143
  : undefined,
1144
+ worktree: mergedConfig.worktree,
1114
1145
  };
1115
1146
  }
@@ -63,4 +63,3 @@ export declare class FileWatcherService extends EventEmitter {
63
63
  private setupGlobalWatcherEvents;
64
64
  private handleFileEvent;
65
65
  }
66
- //# sourceMappingURL=fileWatcher.d.ts.map
@@ -22,4 +22,3 @@ export declare function executeCwdChangedHooks(oldCwd: string, newCwd: string, c
22
22
  * Validate command safety (basic checks)
23
23
  */
24
24
  export declare function isCommandSafe(command: string): boolean;
25
- //# sourceMappingURL=hook.d.ts.map
@@ -39,4 +39,3 @@ export declare class InitializationService {
39
39
  messages?: Message[];
40
40
  }): Promise<void>;
41
41
  }
42
- //# sourceMappingURL=initializationService.d.ts.map
@@ -26,4 +26,3 @@ export declare class InteractionService {
26
26
  }>): Promise<void>;
27
27
  static restoreSession(context: InteractionContext, sessionId: string): Promise<void>;
28
28
  }
29
- //# sourceMappingURL=interactionService.d.ts.map
@@ -30,6 +30,12 @@ export class InteractionService {
30
30
  mimeType: img.mimeType,
31
31
  })),
32
32
  });
33
+ // Reserve loading state synchronously before any async work (hooks).
34
+ // This closes the race window where a concurrent notification/message
35
+ // could see isLoading=false during the await below and start a second
36
+ // sendAIMessage. sendAIMessage's generation guard is the backstop, but
37
+ // reserving here prevents the race at its source.
38
+ aiManager.setIsLoading(true);
33
39
  // Execute UserPromptSubmit hooks after adding the user message
34
40
  if (hookManager) {
35
41
  try {
@@ -49,6 +55,8 @@ export class InteractionService {
49
55
  // If hook processing indicates we should block (exit code 2), stop here
50
56
  if (processResult.shouldBlock) {
51
57
  logger?.info("UserPromptSubmit hook blocked prompt processing with error:", processResult.errorMessage);
58
+ // Release the loading state we reserved above
59
+ aiManager.setIsLoading(false);
52
60
  return; // Don't send to AI
53
61
  }
54
62
  }
@@ -62,6 +70,8 @@ export class InteractionService {
62
70
  }
63
71
  catch (error) {
64
72
  console.error("Failed to add user message:", error);
73
+ // Ensure loading state is released on error
74
+ aiManager.setIsLoading(false);
65
75
  // Loading state will be automatically updated by the useEffect that watches messages
66
76
  }
67
77
  }
@@ -68,4 +68,3 @@ export declare class JsonlHandler {
68
68
  */
69
69
  generateSessionFilename(sessionId: string, sessionType: "main" | "subagent"): string;
70
70
  }
71
- //# sourceMappingURL=jsonlHandler.d.ts.map
@@ -27,4 +27,3 @@ export declare class MemoryService {
27
27
  readMemoryFile(workdir: string): Promise<string>;
28
28
  getCombinedMemoryContent(workdir: string): Promise<string>;
29
29
  }
30
- //# sourceMappingURL=memory.d.ts.map
@@ -37,4 +37,3 @@ export declare class PluginLoader {
37
37
  */
38
38
  private static validateManifest;
39
39
  }
40
- //# sourceMappingURL=pluginLoader.d.ts.map
@@ -24,4 +24,3 @@ export declare const remoteSettingsService: {
24
24
  readonly mergeRemoteSettings: typeof mergeRemoteSettings;
25
25
  readonly onSettingsUpdate: typeof onSettingsUpdate;
26
26
  };
27
- //# sourceMappingURL=remoteSettingsService.d.ts.map
@@ -286,6 +286,8 @@ export function mergeRemoteSettings(localMerged, remote) {
286
286
  result.autoMemoryEnabled = remote.autoMemoryEnabled;
287
287
  if (remote.autoMemoryFrequency !== undefined)
288
288
  result.autoMemoryFrequency = remote.autoMemoryFrequency;
289
+ if (remote.worktree !== undefined)
290
+ result.worktree = remote.worktree;
289
291
  if (remote.models !== undefined)
290
292
  result.models = remote.models;
291
293
  if (remote.marketplaces !== undefined)
@@ -25,4 +25,3 @@ export declare class ReversionService {
25
25
  cleanupOldSessions(days?: number): Promise<void>;
26
26
  private ensureDirectory;
27
27
  }
28
- //# sourceMappingURL=reversionService.d.ts.map
@@ -193,4 +193,3 @@ export declare function loadFullMessageThread(currentSessionId: string, workdir:
193
193
  messages: Message[];
194
194
  sessionIds: string[];
195
195
  }>;
196
- //# sourceMappingURL=session.d.ts.map
@@ -31,4 +31,3 @@ export declare class TaskManager extends EventEmitter {
31
31
  */
32
32
  refreshTasks(): Promise<void>;
33
33
  }
34
- //# sourceMappingURL=taskManager.d.ts.map
@@ -3,6 +3,13 @@ import { join } from "path";
3
3
  import { homedir } from "os";
4
4
  import { EventEmitter } from "events";
5
5
  import { logger } from "../utils/globalLogger.js";
6
+ function byIdAsc(a, b) {
7
+ const aNum = parseInt(a.id, 10);
8
+ const bNum = parseInt(b.id, 10);
9
+ if (!isNaN(aNum) && !isNaN(bNum))
10
+ return aNum - bNum;
11
+ return a.id.localeCompare(b.id);
12
+ }
6
13
  export class TaskManager extends EventEmitter {
7
14
  constructor(container, taskListId) {
8
15
  super();
@@ -198,7 +205,7 @@ export class TaskManager extends EventEmitter {
198
205
  return null;
199
206
  }
200
207
  }));
201
- return tasks.filter((t) => t !== null);
208
+ return tasks.filter((t) => t !== null).sort(byIdAsc);
202
209
  }
203
210
  catch (error) {
204
211
  if (error.code === "ENOENT") {
@@ -9,4 +9,3 @@ import type { OTelEventName } from "../types/telemetry.js";
9
9
  * Logs a structured event via the OTEL logs API. Respects PII gates.
10
10
  */
11
11
  export declare function logOTelEvent(eventName: OTelEventName, metadata: Record<string, string | undefined>): Promise<void>;
12
- //# sourceMappingURL=events.d.ts.map
@@ -70,4 +70,3 @@ export { JsonlSpanExporter, JsonlLogExporter };
70
70
  * 2. Not authenticated → persistent anonymous ID from ~/.wave/config.json
71
71
  */
72
72
  export declare function getTelemetryAttributes(): Record<string, string>;
73
- //# sourceMappingURL=instrumentation.d.ts.map
@@ -52,4 +52,3 @@ export declare function startToolSpan(toolName: string, input?: unknown): Span |
52
52
  * Reads the span from toolContext, then clears it.
53
53
  */
54
54
  export declare function endToolSpan(metadata: ToolMetadata): void;
55
- //# sourceMappingURL=sessionTracing.d.ts.map
@@ -3,4 +3,3 @@ import type { ToolPlugin } from "./types.js";
3
3
  * Agent tool plugin for launching specialized agents to handle complex tasks
4
4
  */
5
5
  export declare const agentTool: ToolPlugin;
6
- //# sourceMappingURL=agentTool.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ToolPlugin } from "./types.js";
2
2
  export declare const askUserQuestionTool: ToolPlugin;
3
- //# sourceMappingURL=askUserQuestion.d.ts.map
@@ -3,4 +3,3 @@ import type { ToolPlugin } from "./types.js";
3
3
  * Bash command execution tool - supports both foreground and background execution
4
4
  */
5
5
  export declare const bashTool: ToolPlugin;
6
- //# sourceMappingURL=bashTool.d.ts.map
@@ -17,4 +17,3 @@ export interface ToolDef {
17
17
  additionalProperties?: boolean;
18
18
  }
19
19
  export declare function buildTool(def: ToolDef): ToolPlugin;
20
- //# sourceMappingURL=buildTool.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ToolPlugin } from "./types.js";
2
2
  export declare const cronCreateTool: ToolPlugin;
3
- //# sourceMappingURL=cronCreateTool.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ToolPlugin } from "./types.js";
2
2
  export declare const cronDeleteTool: ToolPlugin;
3
- //# sourceMappingURL=cronDeleteTool.d.ts.map
@@ -1,3 +1,2 @@
1
1
  import { ToolPlugin } from "./types.js";
2
2
  export declare const cronListTool: ToolPlugin;
3
- //# sourceMappingURL=cronListTool.d.ts.map
@@ -3,4 +3,3 @@ import type { ToolPlugin } from "./types.js";
3
3
  * Single file edit tool plugin
4
4
  */
5
5
  export declare const editTool: ToolPlugin;
6
- //# sourceMappingURL=editTool.d.ts.map
@@ -3,4 +3,3 @@ import type { ToolPlugin } from "./types.js";
3
3
  * Enter Plan Mode Tool Plugin
4
4
  */
5
5
  export declare const enterPlanModeTool: ToolPlugin;
6
- //# sourceMappingURL=enterPlanMode.d.ts.map
@@ -5,4 +5,3 @@
5
5
  import type { ToolPlugin } from "./types.js";
6
6
  export declare const ENTER_WORKTREE_TOOL_PROMPT = "Use this tool ONLY when the user explicitly asks to work in a worktree. This tool creates an isolated git worktree and switches the current session into it.\n\n## When to Use\n\n- The user explicitly says \"worktree\" (e.g., \"start a worktree\", \"work in a worktree\", \"create a worktree\", \"use a worktree\")\n\n## When NOT to Use\n\n- The user asks to create a branch, switch branches, or work on a different branch \u2014 use git commands instead\n- The user asks to fix a bug or work on a feature \u2014 use normal git workflow unless they specifically mention worktrees\n- Never use this tool unless the user explicitly mentions \"worktree\"\n\n## Requirements\n\n- Must be in a git repository\n- Must not already be in a worktree\n\n## Behavior\n\n- Creates a new git worktree inside `.wave/worktrees/` with a new branch based on HEAD\n- Switches the session's working directory to the new worktree\n- Use ExitWorktree to leave the worktree mid-session (keep or remove). On session exit, if still in the worktree, the user will be prompted to keep or remove it\n\n## Parameters\n\n- `name` (optional): A name for the worktree. Each \"/\"-separated segment may contain only letters, digits, dots, underscores, and dashes; max 64 chars total. A random name is generated if not provided.\n";
7
7
  export declare const enterWorktreeTool: ToolPlugin;
8
- //# sourceMappingURL=enterWorktreeTool.d.ts.map
@@ -83,7 +83,8 @@ export const enterWorktreeTool = {
83
83
  };
84
84
  }
85
85
  // Create the worktree (captures originalHeadCommit internally)
86
- const worktreeInfo = createWorktree(name, mainRepoRoot);
86
+ const baseRef = context.aiManager?.getWorktreeBaseRef?.();
87
+ const worktreeInfo = createWorktree(name, mainRepoRoot, { baseRef });
87
88
  // Build session state
88
89
  const session = {
89
90
  originalCwd: context.workdir,
@@ -3,4 +3,3 @@ import type { ToolPlugin } from "./types.js";
3
3
  * Exit Plan Mode Tool Plugin
4
4
  */
5
5
  export declare const exitPlanModeTool: ToolPlugin;
6
- //# sourceMappingURL=exitPlanMode.d.ts.map
@@ -5,4 +5,3 @@
5
5
  import type { ToolPlugin } from "./types.js";
6
6
  export declare const EXIT_WORKTREE_TOOL_PROMPT = "Exit a worktree session created by EnterWorktree and return the session to the original working directory.\n\n## Scope\n\nThis tool ONLY operates on worktrees created by EnterWorktree in this session. It will NOT touch:\n- Worktrees you created manually with `git worktree add`\n- Worktrees from a previous session (even if created by EnterWorktree then)\n- The directory you're in if EnterWorktree was never called\n\nIf called outside an EnterWorktree session, the tool is a **no-op**: it reports that no worktree session is active and takes no action. Filesystem state is unchanged.\n\n## When to Use\n\n- The user explicitly asks to \"exit the worktree\", \"leave the worktree\", \"go back\", or otherwise end the worktree session\n- Do NOT call this proactively \u2014 only when the user asks\n\n## Parameters\n\n- `action` (required): `\"keep\"` or `\"remove\"`\n - `\"keep\"` \u2014 leave the worktree directory and branch intact on disk. Use this if the user wants to come back to the work later, or if there are changes to preserve.\n - `\"remove\"` \u2014 delete the worktree directory and its branch. Use this for a clean exit when the work is done or abandoned.\n- `discard_changes` (optional, default false): only meaningful with `action: \"remove\"`. If the worktree has uncommitted files or commits not on the original branch, the tool will REFUSE to remove it unless this is set to `true`. If the tool returns an error listing changes, confirm with the user before re-invoking with `discard_changes: true`.\n\n## Behavior\n\n- Restores the session's working directory to where it was before EnterWorktree\n- If action is \"remove\": deletes the worktree directory and branch\n- Once exited, EnterWorktree can be called again to create a fresh worktree\n";
7
7
  export declare const exitWorktreeTool: ToolPlugin;
8
- //# sourceMappingURL=exitWorktreeTool.d.ts.map