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.
- package/dist/agent.d.ts +16 -14
- package/dist/agent.js +58 -56
- package/dist/constants/goalPrompts.d.ts +0 -1
- package/dist/constants/subagents.d.ts +0 -1
- package/dist/constants/toolLimits.d.ts +0 -1
- package/dist/constants/tools.d.ts +0 -1
- package/dist/core/plugin.d.ts +0 -1
- package/dist/core/session.d.ts +0 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -0
- package/dist/managers/MemoryRuleManager.d.ts +0 -1
- package/dist/managers/aiManager.d.ts +2 -1
- package/dist/managers/aiManager.js +29 -9
- package/dist/managers/backgroundTaskManager.d.ts +0 -2
- package/dist/managers/backgroundTaskManager.js +16 -19
- package/dist/managers/bangManager.d.ts +0 -1
- package/dist/managers/cronManager.d.ts +0 -1
- package/dist/managers/foregroundTaskManager.d.ts +0 -1
- package/dist/managers/forkedAgentManager.d.ts +0 -1
- package/dist/managers/goalManager.d.ts +0 -1
- package/dist/managers/hookManager.d.ts +0 -1
- package/dist/managers/liveConfigManager.d.ts +0 -1
- package/dist/managers/lspManager.d.ts +0 -1
- package/dist/managers/mcpManager.d.ts +0 -1
- package/dist/managers/messageManager.d.ts +0 -1
- package/dist/managers/messageQueue.d.ts +17 -2
- package/dist/managers/messageQueue.js +40 -1
- package/dist/managers/permissionManager.d.ts +0 -1
- package/dist/managers/planManager.d.ts +0 -1
- package/dist/managers/pluginManager.d.ts +0 -1
- package/dist/managers/pluginScopeManager.d.ts +0 -1
- package/dist/managers/reversionManager.d.ts +0 -1
- package/dist/managers/skillManager.d.ts +0 -1
- package/dist/managers/slashCommandManager.d.ts +0 -1
- package/dist/managers/subagentManager.d.ts +0 -3
- package/dist/managers/subagentManager.js +14 -13
- package/dist/managers/toolManager.d.ts +0 -1
- package/dist/managers/workflowManager.d.ts +1 -2
- package/dist/managers/workflowManager.js +4 -4
- package/dist/prompts/autoMemory.d.ts +0 -1
- package/dist/prompts/autoMemoryExtraction.d.ts +0 -1
- package/dist/prompts/index.d.ts +0 -1
- package/dist/prompts/planModeReminders.d.ts +0 -1
- package/dist/services/GitService.d.ts +0 -1
- package/dist/services/MarketplaceService.d.ts +0 -1
- package/dist/services/MemoryRuleService.d.ts +0 -1
- package/dist/services/aiService.d.ts +0 -1
- package/dist/services/authService.d.ts +0 -1
- package/dist/services/autoMemoryService.d.ts +0 -1
- package/dist/services/configurationService.d.ts +6 -1
- package/dist/services/configurationService.js +31 -0
- package/dist/services/fileWatcher.d.ts +0 -1
- package/dist/services/hook.d.ts +0 -1
- package/dist/services/initializationService.d.ts +0 -1
- package/dist/services/interactionService.d.ts +0 -1
- package/dist/services/interactionService.js +10 -0
- package/dist/services/jsonlHandler.d.ts +0 -1
- package/dist/services/memory.d.ts +0 -1
- package/dist/services/pluginLoader.d.ts +0 -1
- package/dist/services/remoteSettingsService.d.ts +0 -1
- package/dist/services/remoteSettingsService.js +2 -0
- package/dist/services/reversionService.d.ts +0 -1
- package/dist/services/session.d.ts +0 -1
- package/dist/services/taskManager.d.ts +0 -1
- package/dist/services/taskManager.js +8 -1
- package/dist/telemetry/events.d.ts +0 -1
- package/dist/telemetry/instrumentation.d.ts +0 -1
- package/dist/telemetry/sessionTracing.d.ts +0 -1
- package/dist/tools/agentTool.d.ts +0 -1
- package/dist/tools/askUserQuestion.d.ts +0 -1
- package/dist/tools/bashTool.d.ts +0 -1
- package/dist/tools/buildTool.d.ts +0 -1
- package/dist/tools/cronCreateTool.d.ts +0 -1
- package/dist/tools/cronDeleteTool.d.ts +0 -1
- package/dist/tools/cronListTool.d.ts +0 -1
- package/dist/tools/editTool.d.ts +0 -1
- package/dist/tools/enterPlanMode.d.ts +0 -1
- package/dist/tools/enterWorktreeTool.d.ts +0 -1
- package/dist/tools/enterWorktreeTool.js +2 -1
- package/dist/tools/exitPlanMode.d.ts +0 -1
- package/dist/tools/exitWorktreeTool.d.ts +0 -1
- package/dist/tools/globTool.d.ts +0 -1
- package/dist/tools/grepTool.d.ts +0 -1
- package/dist/tools/lspTool.d.ts +0 -1
- package/dist/tools/readTool.d.ts +0 -1
- package/dist/tools/skillTool.d.ts +0 -1
- package/dist/tools/taskManagementTools.d.ts +0 -1
- package/dist/tools/taskStopTool.d.ts +0 -1
- package/dist/tools/types.d.ts +0 -1
- package/dist/tools/webFetchTool.d.ts +0 -1
- package/dist/tools/workflowTool.d.ts +0 -1
- package/dist/tools/writeTool.d.ts +0 -1
- package/dist/types/agent.d.ts +0 -1
- package/dist/types/auth.d.ts +0 -1
- package/dist/types/commands.d.ts +0 -1
- package/dist/types/config.d.ts +0 -1
- package/dist/types/configuration.d.ts +5 -1
- package/dist/types/core.d.ts +0 -1
- package/dist/types/cron.d.ts +0 -1
- package/dist/types/environment.d.ts +0 -1
- package/dist/types/fileSearch.d.ts +0 -1
- package/dist/types/history.d.ts +0 -1
- package/dist/types/hooks.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/lsp.d.ts +0 -1
- package/dist/types/marketplace.d.ts +0 -1
- package/dist/types/mcp.d.ts +0 -1
- package/dist/types/memoryRule.d.ts +0 -1
- package/dist/types/messaging.d.ts +0 -1
- package/dist/types/permissions.d.ts +0 -3
- package/dist/types/plugins.d.ts +0 -1
- package/dist/types/processes.d.ts +27 -1
- package/dist/types/reversion.d.ts +0 -1
- package/dist/types/session.d.ts +0 -1
- package/dist/types/skills.d.ts +0 -1
- package/dist/types/tasks.d.ts +0 -1
- package/dist/types/telemetry.d.ts +0 -1
- package/dist/types/tools.d.ts +0 -1
- package/dist/types/workflow.d.ts +1 -2
- package/dist/utils/abortUtils.d.ts +0 -1
- package/dist/utils/atomicWrite.d.ts +0 -1
- package/dist/utils/bashParser.d.ts +0 -1
- package/dist/utils/cacheControlUtils.d.ts +0 -1
- package/dist/utils/commandArgumentParser.d.ts +0 -1
- package/dist/utils/commandPathResolver.d.ts +0 -1
- package/dist/utils/configPaths.d.ts +0 -1
- package/dist/utils/configValidator.d.ts +0 -1
- package/dist/utils/constants.d.ts +0 -1
- package/dist/utils/container.d.ts +0 -1
- package/dist/utils/containerSetup.d.ts +0 -1
- package/dist/utils/containerSetup.js +0 -12
- package/dist/utils/convertMessagesForAPI.d.ts +0 -1
- package/dist/utils/cronTasks.d.ts +0 -1
- package/dist/utils/cronTasksLock.d.ts +0 -1
- package/dist/utils/cronToHuman.d.ts +0 -1
- package/dist/utils/customCommands.d.ts +0 -1
- package/dist/utils/editUtils.d.ts +0 -1
- package/dist/utils/fileFormat.d.ts +0 -1
- package/dist/utils/fileSearch.d.ts +0 -1
- package/dist/utils/fileUtils.d.ts +0 -1
- package/dist/utils/gitUtils.d.ts +0 -1
- package/dist/utils/globalLogger.d.ts +0 -1
- package/dist/utils/groupMessagesByApiRound.d.ts +0 -1
- package/dist/utils/hookMatcher.d.ts +0 -1
- package/dist/utils/markdownParser.d.ts +0 -1
- package/dist/utils/mcpUtils.d.ts +0 -1
- package/dist/utils/messageOperations.d.ts +0 -1
- package/dist/utils/modelCapabilities.d.ts +0 -1
- package/dist/utils/nameGenerator.d.ts +0 -1
- package/dist/utils/notificationXml.d.ts +0 -1
- package/dist/utils/openaiClient.d.ts +0 -1
- package/dist/utils/parseCronExpression.d.ts +0 -1
- package/dist/utils/path.d.ts +0 -1
- package/dist/utils/pathEncoder.d.ts +0 -1
- package/dist/utils/pathSafety.d.ts +0 -1
- package/dist/utils/promptHistory.d.ts +0 -1
- package/dist/utils/ripgrep.d.ts +0 -1
- package/dist/utils/shellResolver.d.ts +0 -1
- package/dist/utils/skillParser.d.ts +0 -1
- package/dist/utils/stringUtils.d.ts +0 -1
- package/dist/utils/subagentParser.d.ts +0 -1
- package/dist/utils/taskReminder.d.ts +0 -1
- package/dist/utils/tokenCalculation.d.ts +0 -1
- package/dist/utils/tokenEstimate.d.ts +0 -1
- package/dist/utils/toolResultStorage.d.ts +0 -1
- package/dist/utils/worktreeSession.d.ts +1 -2
- package/dist/utils/worktreeSession.js +1 -1
- package/dist/utils/worktreeUtils.d.ts +7 -2
- package/dist/utils/worktreeUtils.js +10 -4
- package/dist/workflow/budgetTracker.d.ts +0 -1
- package/dist/workflow/concurrencyLimiter.d.ts +0 -1
- package/dist/workflow/journal.d.ts +0 -1
- package/dist/workflow/progressReporter.d.ts +0 -1
- package/dist/workflow/runState.d.ts +0 -1
- package/dist/workflow/scriptRuntime.d.ts +0 -1
- package/dist/workflow/structuredOutput.d.ts +0 -1
- package/dist/workflow/types.d.ts +5 -1
- package/dist/workflow/workflowApis.d.ts +0 -1
- package/package.json +1 -1
- package/src/agent.ts +59 -67
- package/src/index.ts +1 -0
- package/src/managers/aiManager.ts +34 -10
- package/src/managers/backgroundTaskManager.ts +17 -21
- package/src/managers/messageQueue.ts +43 -2
- package/src/managers/subagentManager.ts +15 -15
- package/src/managers/workflowManager.ts +5 -5
- package/src/services/configurationService.ts +37 -0
- package/src/services/interactionService.ts +11 -0
- package/src/services/remoteSettingsService.ts +1 -0
- package/src/services/taskManager.ts +8 -1
- package/src/tools/enterWorktreeTool.ts +2 -1
- package/src/types/configuration.ts +5 -0
- package/src/types/permissions.ts +0 -2
- package/src/types/processes.ts +29 -0
- package/src/types/workflow.ts +1 -0
- package/src/utils/containerSetup.ts +0 -15
- package/src/utils/worktreeSession.ts +1 -1
- package/src/utils/worktreeUtils.ts +14 -4
- package/src/workflow/types.ts +6 -0
- package/dist/agent.d.ts.map +0 -1
- package/dist/constants/goalPrompts.d.ts.map +0 -1
- package/dist/constants/subagents.d.ts.map +0 -1
- package/dist/constants/toolLimits.d.ts.map +0 -1
- package/dist/constants/tools.d.ts.map +0 -1
- package/dist/core/plugin.d.ts.map +0 -1
- package/dist/core/session.d.ts.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/managers/MemoryRuleManager.d.ts.map +0 -1
- package/dist/managers/aiManager.d.ts.map +0 -1
- package/dist/managers/backgroundTaskManager.d.ts.map +0 -1
- package/dist/managers/bangManager.d.ts.map +0 -1
- package/dist/managers/cronManager.d.ts.map +0 -1
- package/dist/managers/foregroundTaskManager.d.ts.map +0 -1
- package/dist/managers/forkedAgentManager.d.ts.map +0 -1
- package/dist/managers/goalManager.d.ts.map +0 -1
- package/dist/managers/hookManager.d.ts.map +0 -1
- package/dist/managers/liveConfigManager.d.ts.map +0 -1
- package/dist/managers/lspManager.d.ts.map +0 -1
- package/dist/managers/mcpManager.d.ts.map +0 -1
- package/dist/managers/messageManager.d.ts.map +0 -1
- package/dist/managers/messageQueue.d.ts.map +0 -1
- package/dist/managers/notificationQueue.d.ts +0 -8
- package/dist/managers/notificationQueue.d.ts.map +0 -1
- package/dist/managers/notificationQueue.js +0 -17
- package/dist/managers/permissionManager.d.ts.map +0 -1
- package/dist/managers/planManager.d.ts.map +0 -1
- package/dist/managers/pluginManager.d.ts.map +0 -1
- package/dist/managers/pluginScopeManager.d.ts.map +0 -1
- package/dist/managers/reversionManager.d.ts.map +0 -1
- package/dist/managers/skillManager.d.ts.map +0 -1
- package/dist/managers/slashCommandManager.d.ts.map +0 -1
- package/dist/managers/subagentManager.d.ts.map +0 -1
- package/dist/managers/toolManager.d.ts.map +0 -1
- package/dist/managers/workflowManager.d.ts.map +0 -1
- package/dist/prompts/autoMemory.d.ts.map +0 -1
- package/dist/prompts/autoMemoryExtraction.d.ts.map +0 -1
- package/dist/prompts/index.d.ts.map +0 -1
- package/dist/prompts/planModeReminders.d.ts.map +0 -1
- package/dist/services/GitService.d.ts.map +0 -1
- package/dist/services/MarketplaceService.d.ts.map +0 -1
- package/dist/services/MemoryRuleService.d.ts.map +0 -1
- package/dist/services/aiService.d.ts.map +0 -1
- package/dist/services/authService.d.ts.map +0 -1
- package/dist/services/autoMemoryService.d.ts.map +0 -1
- package/dist/services/configurationService.d.ts.map +0 -1
- package/dist/services/fileWatcher.d.ts.map +0 -1
- package/dist/services/hook.d.ts.map +0 -1
- package/dist/services/initializationService.d.ts.map +0 -1
- package/dist/services/interactionService.d.ts.map +0 -1
- package/dist/services/jsonlHandler.d.ts.map +0 -1
- package/dist/services/memory.d.ts.map +0 -1
- package/dist/services/pluginLoader.d.ts.map +0 -1
- package/dist/services/remoteSettingsService.d.ts.map +0 -1
- package/dist/services/reversionService.d.ts.map +0 -1
- package/dist/services/session.d.ts.map +0 -1
- package/dist/services/taskManager.d.ts.map +0 -1
- package/dist/telemetry/events.d.ts.map +0 -1
- package/dist/telemetry/instrumentation.d.ts.map +0 -1
- package/dist/telemetry/sessionTracing.d.ts.map +0 -1
- package/dist/tools/agentTool.d.ts.map +0 -1
- package/dist/tools/askUserQuestion.d.ts.map +0 -1
- package/dist/tools/bashTool.d.ts.map +0 -1
- package/dist/tools/buildTool.d.ts.map +0 -1
- package/dist/tools/cronCreateTool.d.ts.map +0 -1
- package/dist/tools/cronDeleteTool.d.ts.map +0 -1
- package/dist/tools/cronListTool.d.ts.map +0 -1
- package/dist/tools/editTool.d.ts.map +0 -1
- package/dist/tools/enterPlanMode.d.ts.map +0 -1
- package/dist/tools/enterWorktreeTool.d.ts.map +0 -1
- package/dist/tools/exitPlanMode.d.ts.map +0 -1
- package/dist/tools/exitWorktreeTool.d.ts.map +0 -1
- package/dist/tools/globTool.d.ts.map +0 -1
- package/dist/tools/grepTool.d.ts.map +0 -1
- package/dist/tools/lspTool.d.ts.map +0 -1
- package/dist/tools/readTool.d.ts.map +0 -1
- package/dist/tools/skillTool.d.ts.map +0 -1
- package/dist/tools/taskManagementTools.d.ts.map +0 -1
- package/dist/tools/taskStopTool.d.ts.map +0 -1
- package/dist/tools/types.d.ts.map +0 -1
- package/dist/tools/webFetchTool.d.ts.map +0 -1
- package/dist/tools/workflowTool.d.ts.map +0 -1
- package/dist/tools/writeTool.d.ts.map +0 -1
- package/dist/types/agent.d.ts.map +0 -1
- package/dist/types/auth.d.ts.map +0 -1
- package/dist/types/commands.d.ts.map +0 -1
- package/dist/types/config.d.ts.map +0 -1
- package/dist/types/configuration.d.ts.map +0 -1
- package/dist/types/core.d.ts.map +0 -1
- package/dist/types/cron.d.ts.map +0 -1
- package/dist/types/environment.d.ts.map +0 -1
- package/dist/types/fileSearch.d.ts.map +0 -1
- package/dist/types/history.d.ts.map +0 -1
- package/dist/types/hooks.d.ts.map +0 -1
- package/dist/types/index.d.ts.map +0 -1
- package/dist/types/lsp.d.ts.map +0 -1
- package/dist/types/marketplace.d.ts.map +0 -1
- package/dist/types/mcp.d.ts.map +0 -1
- package/dist/types/memoryRule.d.ts.map +0 -1
- package/dist/types/messaging.d.ts.map +0 -1
- package/dist/types/permissions.d.ts.map +0 -1
- package/dist/types/plugins.d.ts.map +0 -1
- package/dist/types/processes.d.ts.map +0 -1
- package/dist/types/reversion.d.ts.map +0 -1
- package/dist/types/session.d.ts.map +0 -1
- package/dist/types/skills.d.ts.map +0 -1
- package/dist/types/tasks.d.ts.map +0 -1
- package/dist/types/telemetry.d.ts.map +0 -1
- package/dist/types/tools.d.ts.map +0 -1
- package/dist/types/workflow.d.ts.map +0 -1
- package/dist/utils/abortUtils.d.ts.map +0 -1
- package/dist/utils/atomicWrite.d.ts.map +0 -1
- package/dist/utils/bashParser.d.ts.map +0 -1
- package/dist/utils/cacheControlUtils.d.ts.map +0 -1
- package/dist/utils/commandArgumentParser.d.ts.map +0 -1
- package/dist/utils/commandPathResolver.d.ts.map +0 -1
- package/dist/utils/configPaths.d.ts.map +0 -1
- package/dist/utils/configValidator.d.ts.map +0 -1
- package/dist/utils/constants.d.ts.map +0 -1
- package/dist/utils/container.d.ts.map +0 -1
- package/dist/utils/containerSetup.d.ts.map +0 -1
- package/dist/utils/convertMessagesForAPI.d.ts.map +0 -1
- package/dist/utils/cronTasks.d.ts.map +0 -1
- package/dist/utils/cronTasksLock.d.ts.map +0 -1
- package/dist/utils/cronToHuman.d.ts.map +0 -1
- package/dist/utils/customCommands.d.ts.map +0 -1
- package/dist/utils/editUtils.d.ts.map +0 -1
- package/dist/utils/fileFormat.d.ts.map +0 -1
- package/dist/utils/fileSearch.d.ts.map +0 -1
- package/dist/utils/fileUtils.d.ts.map +0 -1
- package/dist/utils/gitUtils.d.ts.map +0 -1
- package/dist/utils/globalLogger.d.ts.map +0 -1
- package/dist/utils/groupMessagesByApiRound.d.ts.map +0 -1
- package/dist/utils/hookMatcher.d.ts.map +0 -1
- package/dist/utils/markdownParser.d.ts.map +0 -1
- package/dist/utils/mcpUtils.d.ts.map +0 -1
- package/dist/utils/messageOperations.d.ts.map +0 -1
- package/dist/utils/modelCapabilities.d.ts.map +0 -1
- package/dist/utils/nameGenerator.d.ts.map +0 -1
- package/dist/utils/notificationXml.d.ts.map +0 -1
- package/dist/utils/openaiClient.d.ts.map +0 -1
- package/dist/utils/parseCronExpression.d.ts.map +0 -1
- package/dist/utils/path.d.ts.map +0 -1
- package/dist/utils/pathEncoder.d.ts.map +0 -1
- package/dist/utils/pathSafety.d.ts.map +0 -1
- package/dist/utils/promptHistory.d.ts.map +0 -1
- package/dist/utils/ripgrep.d.ts.map +0 -1
- package/dist/utils/shellResolver.d.ts.map +0 -1
- package/dist/utils/skillParser.d.ts.map +0 -1
- package/dist/utils/stringUtils.d.ts.map +0 -1
- package/dist/utils/subagentParser.d.ts.map +0 -1
- package/dist/utils/taskReminder.d.ts.map +0 -1
- package/dist/utils/tokenCalculation.d.ts.map +0 -1
- package/dist/utils/tokenEstimate.d.ts.map +0 -1
- package/dist/utils/toolResultStorage.d.ts.map +0 -1
- package/dist/utils/worktreeSession.d.ts.map +0 -1
- package/dist/utils/worktreeUtils.d.ts.map +0 -1
- package/dist/workflow/budgetTracker.d.ts.map +0 -1
- package/dist/workflow/concurrencyLimiter.d.ts.map +0 -1
- package/dist/workflow/journal.d.ts.map +0 -1
- package/dist/workflow/progressReporter.d.ts.map +0 -1
- package/dist/workflow/runState.d.ts.map +0 -1
- package/dist/workflow/scriptRuntime.d.ts.map +0 -1
- package/dist/workflow/structuredOutput.d.ts.map +0 -1
- package/dist/workflow/types.d.ts.map +0 -1
- package/dist/workflow/workflowApis.d.ts.map +0 -1
- 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
|
}
|
|
@@ -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 {
|
|
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
|
|
430
|
-
? this.container.get("
|
|
430
|
+
const messageQueue = this.container.has("MessageQueue")
|
|
431
|
+
? this.container.get("MessageQueue")
|
|
431
432
|
: undefined;
|
|
432
|
-
if (
|
|
433
|
+
if (messageQueue) {
|
|
433
434
|
const summary = `Agent task "${instance.description}" completed`;
|
|
434
|
-
|
|
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
|
|
462
|
-
? this.container.get("
|
|
462
|
+
const messageQueue = this.container.has("MessageQueue")
|
|
463
|
+
? this.container.get("MessageQueue")
|
|
463
464
|
: undefined;
|
|
464
|
-
if (
|
|
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
|
-
|
|
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
|
}
|
|
@@ -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
|
|
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
|
|
34
|
-
return this.container.get("
|
|
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.
|
|
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.
|
|
247
|
+
this.messageQueue.enqueueNotification(taskNotificationToXml({
|
|
248
248
|
type: "task_notification",
|
|
249
249
|
taskId: runId,
|
|
250
250
|
taskType: "workflow",
|
package/dist/prompts/index.d.ts
CHANGED
|
@@ -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
|
|
@@ -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
|
|
@@ -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
|
}
|
package/dist/services/hook.d.ts
CHANGED
|
@@ -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
|
}
|
|
@@ -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)
|
|
@@ -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
|
package/dist/tools/bashTool.d.ts
CHANGED
package/dist/tools/editTool.d.ts
CHANGED
|
@@ -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
|
|
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,
|
|
@@ -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
|