wave-agent-sdk 0.14.0 → 0.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/builtin/skills/settings/HOOKS.md +69 -0
- package/builtin/skills/settings/PLUGINS.md +171 -0
- package/builtin/skills/settings/SKILL.md +8 -3
- package/dist/agent.d.ts +2 -2
- package/dist/agent.d.ts.map +1 -1
- package/dist/agent.js +12 -3
- package/dist/core/plugin.d.ts +2 -2
- package/dist/core/plugin.d.ts.map +1 -1
- package/dist/core/plugin.js +7 -7
- package/dist/managers/aiManager.d.ts +6 -6
- package/dist/managers/aiManager.d.ts.map +1 -1
- package/dist/managers/aiManager.js +122 -59
- package/dist/managers/backgroundTaskManager.d.ts.map +1 -1
- package/dist/managers/backgroundTaskManager.js +28 -30
- package/dist/managers/hookManager.d.ts +16 -1
- package/dist/managers/hookManager.d.ts.map +1 -1
- package/dist/managers/hookManager.js +97 -8
- package/dist/managers/messageManager.d.ts +19 -4
- package/dist/managers/messageManager.d.ts.map +1 -1
- package/dist/managers/messageManager.js +63 -18
- package/dist/managers/pluginManager.d.ts.map +1 -1
- package/dist/managers/pluginManager.js +1 -1
- package/dist/prompts/index.d.ts +1 -1
- package/dist/prompts/index.d.ts.map +1 -1
- package/dist/prompts/index.js +1 -1
- package/dist/services/MarketplaceService.d.ts +42 -12
- package/dist/services/MarketplaceService.d.ts.map +1 -1
- package/dist/services/MarketplaceService.js +225 -105
- package/dist/services/aiService.d.ts +3 -3
- package/dist/services/aiService.d.ts.map +1 -1
- package/dist/services/aiService.js +7 -7
- package/dist/services/configurationService.d.ts +17 -1
- package/dist/services/configurationService.d.ts.map +1 -1
- package/dist/services/configurationService.js +104 -0
- package/dist/services/hook.d.ts.map +1 -1
- package/dist/services/hook.js +15 -0
- package/dist/services/initializationService.d.ts.map +1 -1
- package/dist/services/initializationService.js +24 -1
- package/dist/services/interactionService.js +1 -1
- package/dist/services/pluginLoader.d.ts.map +1 -1
- package/dist/services/pluginLoader.js +7 -1
- package/dist/services/session.d.ts +1 -1
- package/dist/services/session.js +7 -7
- package/dist/services/taskManager.d.ts +1 -1
- package/dist/services/taskManager.js +1 -1
- package/dist/types/configuration.d.ts +7 -0
- package/dist/types/configuration.d.ts.map +1 -1
- package/dist/types/core.d.ts +1 -1
- package/dist/types/core.d.ts.map +1 -1
- package/dist/types/hooks.d.ts +9 -1
- package/dist/types/hooks.d.ts.map +1 -1
- package/dist/types/hooks.js +2 -0
- package/dist/types/marketplace.d.ts +2 -0
- package/dist/types/marketplace.d.ts.map +1 -1
- package/dist/types/messaging.d.ts +3 -3
- package/dist/types/messaging.d.ts.map +1 -1
- package/dist/utils/convertMessagesForAPI.d.ts +1 -1
- package/dist/utils/convertMessagesForAPI.js +7 -7
- package/dist/utils/groupMessagesByApiRound.d.ts +1 -1
- package/dist/utils/groupMessagesByApiRound.js +6 -6
- package/dist/utils/messageOperations.d.ts.map +1 -1
- package/dist/utils/messageOperations.js +3 -3
- package/package.json +1 -1
- package/src/agent.ts +16 -3
- package/src/core/plugin.ts +13 -7
- package/src/managers/aiManager.ts +142 -63
- package/src/managers/backgroundTaskManager.ts +33 -42
- package/src/managers/hookManager.ts +125 -10
- package/src/managers/messageManager.ts +76 -22
- package/src/managers/pluginManager.ts +4 -1
- package/src/prompts/index.ts +1 -1
- package/src/services/MarketplaceService.ts +301 -111
- package/src/services/aiService.ts +11 -11
- package/src/services/configurationService.ts +131 -0
- package/src/services/hook.ts +17 -0
- package/src/services/initializationService.ts +33 -1
- package/src/services/interactionService.ts +1 -1
- package/src/services/pluginLoader.ts +7 -1
- package/src/services/session.ts +7 -7
- package/src/services/taskManager.ts +1 -1
- package/src/types/configuration.ts +8 -0
- package/src/types/core.ts +1 -1
- package/src/types/hooks.ts +16 -2
- package/src/types/marketplace.ts +2 -0
- package/src/types/messaging.ts +3 -3
- package/src/utils/convertMessagesForAPI.ts +8 -8
- package/src/utils/groupMessagesByApiRound.ts +6 -6
- package/src/utils/messageOperations.ts +3 -5
|
@@ -13,8 +13,8 @@ export class AIManager {
|
|
|
13
13
|
this.isLoading = false;
|
|
14
14
|
this.abortController = null;
|
|
15
15
|
this.toolAbortController = null;
|
|
16
|
-
this.
|
|
17
|
-
this.
|
|
16
|
+
this.consecutiveCompactionFailures = 0;
|
|
17
|
+
this.isCompacting = false;
|
|
18
18
|
this.workdir = options.workdir;
|
|
19
19
|
this.originalWorkdir = options.workdir;
|
|
20
20
|
this.systemPrompt = options.systemPrompt;
|
|
@@ -152,8 +152,8 @@ export class AIManager {
|
|
|
152
152
|
}
|
|
153
153
|
return "";
|
|
154
154
|
}
|
|
155
|
-
// Private method to handle token statistics and message
|
|
156
|
-
async
|
|
155
|
+
// Private method to handle token statistics and message compaction
|
|
156
|
+
async handleTokenUsageAndCompaction(usage, abortController) {
|
|
157
157
|
if (!usage)
|
|
158
158
|
return;
|
|
159
159
|
// Update token statistics - display comprehensive token usage including cache tokens
|
|
@@ -164,37 +164,37 @@ export class AIManager {
|
|
|
164
164
|
(usage.cache_read_input_tokens || 0) +
|
|
165
165
|
(usage.cache_creation_input_tokens || 0) >
|
|
166
166
|
this.getMaxInputTokens()) {
|
|
167
|
-
logger?.debug(`Token usage exceeded ${this.getMaxInputTokens()},
|
|
168
|
-
// Check if messages need
|
|
169
|
-
const
|
|
170
|
-
// If there are messages to
|
|
171
|
-
if (
|
|
172
|
-
// Circuit breaker: skip
|
|
173
|
-
if (this.
|
|
174
|
-
logger?.warn(`Skipping
|
|
167
|
+
logger?.debug(`Token usage exceeded ${this.getMaxInputTokens()}, compacting messages...`);
|
|
168
|
+
// Check if messages need compaction
|
|
169
|
+
const messagesToCompact = this.messageManager.getMessages();
|
|
170
|
+
// If there are messages to compact, perform compaction
|
|
171
|
+
if (messagesToCompact.length > 0) {
|
|
172
|
+
// Circuit breaker: skip compaction after 3 consecutive failures
|
|
173
|
+
if (this.consecutiveCompactionFailures >= 3) {
|
|
174
|
+
logger?.warn(`Skipping compaction: ${this.consecutiveCompactionFailures} consecutive failures`);
|
|
175
175
|
return;
|
|
176
176
|
}
|
|
177
|
-
const recentChatMessages = convertMessagesForAPI(
|
|
178
|
-
// Save session before
|
|
177
|
+
const recentChatMessages = convertMessagesForAPI(messagesToCompact);
|
|
178
|
+
// Save session before compaction to preserve original messages
|
|
179
179
|
await this.messageManager.saveSession();
|
|
180
|
-
this.
|
|
180
|
+
this.setIsCompacting(true);
|
|
181
181
|
try {
|
|
182
|
-
const
|
|
182
|
+
const compactResult = await aiService.compactMessages({
|
|
183
183
|
gatewayConfig: this.getGatewayConfig(),
|
|
184
184
|
modelConfig: this.getModelConfig(),
|
|
185
185
|
messages: recentChatMessages,
|
|
186
186
|
abortSignal: abortController.signal,
|
|
187
187
|
model: this.getModelConfig().fastModel,
|
|
188
188
|
});
|
|
189
|
-
// Handle usage tracking for
|
|
190
|
-
let
|
|
191
|
-
if (
|
|
192
|
-
|
|
193
|
-
prompt_tokens:
|
|
194
|
-
completion_tokens:
|
|
195
|
-
total_tokens:
|
|
189
|
+
// Handle usage tracking for compaction operations
|
|
190
|
+
let compactUsage;
|
|
191
|
+
if (compactResult.usage) {
|
|
192
|
+
compactUsage = {
|
|
193
|
+
prompt_tokens: compactResult.usage.prompt_tokens,
|
|
194
|
+
completion_tokens: compactResult.usage.completion_tokens,
|
|
195
|
+
total_tokens: compactResult.usage.total_tokens,
|
|
196
196
|
model: this.getModelConfig().fastModel,
|
|
197
|
-
operation_type: "
|
|
197
|
+
operation_type: "compact",
|
|
198
198
|
};
|
|
199
199
|
}
|
|
200
200
|
// Build post-compact context restoration
|
|
@@ -235,56 +235,119 @@ export class AIManager {
|
|
|
235
235
|
contextParts.push(`\n\n[Plan Mode]\nYou are in plan mode. Plan file: ${planFilePath} (exists: ${planExists})`);
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
|
-
// 4.
|
|
239
|
-
const
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
if (
|
|
243
|
-
const
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
238
|
+
// 4. Invoked skills context (with token budget, matching Claude Code)
|
|
239
|
+
const POST_COMPACT_SKILLS_TOKEN_BUDGET = 25000;
|
|
240
|
+
const POST_COMPACT_MAX_TOKENS_PER_SKILL = 5000;
|
|
241
|
+
const invokedSkillNames = this.messageManager.getInvokedSkillNames(10);
|
|
242
|
+
if (invokedSkillNames.length > 0 && this.skillManager) {
|
|
243
|
+
const invokedSkillParts = [];
|
|
244
|
+
let skillsUsedTokens = 0;
|
|
245
|
+
for (const skillName of invokedSkillNames) {
|
|
246
|
+
try {
|
|
247
|
+
const skill = await this.skillManager.loadSkill(skillName);
|
|
248
|
+
if (!skill)
|
|
249
|
+
continue;
|
|
250
|
+
// Extract content after frontmatter (matching prepareSkillContent pattern)
|
|
251
|
+
const contentMatch = skill.content.match(/^---\n[\s\S]*?\n---\n([\s\S]*)$/);
|
|
252
|
+
let skillContent = contentMatch
|
|
253
|
+
? contentMatch[1].trim()
|
|
254
|
+
: skill.content;
|
|
255
|
+
// Per-skill token budget enforcement (~4 chars per token)
|
|
256
|
+
const maxSkillChars = POST_COMPACT_MAX_TOKENS_PER_SKILL * 4;
|
|
257
|
+
if (skillContent.length > maxSkillChars) {
|
|
258
|
+
skillContent =
|
|
259
|
+
skillContent.slice(0, maxSkillChars) +
|
|
260
|
+
"\n\n...[truncated]...";
|
|
261
|
+
}
|
|
262
|
+
const skillTokens = Math.ceil(skillContent.length / 4);
|
|
263
|
+
if (skillsUsedTokens + skillTokens >
|
|
264
|
+
POST_COMPACT_SKILLS_TOKEN_BUDGET)
|
|
265
|
+
break;
|
|
266
|
+
skillsUsedTokens += skillTokens;
|
|
267
|
+
invokedSkillParts.push(`\n\n## ${skill.name}\n${skill.description ? `*${skill.description}*\n\n` : ""}\`\`\`\n${skillContent}\n\`\`\``);
|
|
268
|
+
}
|
|
269
|
+
catch {
|
|
270
|
+
// Skip skills that can't be loaded
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (invokedSkillParts.length > 0) {
|
|
274
|
+
contextParts.push(`\n\n[Invoked Skills]\n${invokedSkillParts.join("")}`);
|
|
275
|
+
}
|
|
247
276
|
}
|
|
248
|
-
// 5. Background
|
|
249
|
-
const agents = this.backgroundTaskManager
|
|
277
|
+
// 5. Background subagent status (shell tasks excluded, matching Claude Code's createAsyncAgentAttachmentsIfNeeded)
|
|
278
|
+
const agents = this.backgroundTaskManager
|
|
279
|
+
?.getAllTasks()
|
|
280
|
+
.filter((a) => a.type === "subagent") || [];
|
|
250
281
|
if (agents.length > 0) {
|
|
251
|
-
const
|
|
252
|
-
|
|
253
|
-
.
|
|
254
|
-
|
|
282
|
+
const agentParts = [];
|
|
283
|
+
for (const a of agents) {
|
|
284
|
+
if (a.status === "killed") {
|
|
285
|
+
agentParts.push(`Task "${a.description}" (${a.id}) was stopped by the user.`);
|
|
286
|
+
}
|
|
287
|
+
else if (a.status === "running") {
|
|
288
|
+
const parts = [
|
|
289
|
+
`Background agent "${a.description}" (${a.id}) is still running.`,
|
|
290
|
+
`Do NOT spawn a duplicate. You will be notified when it completes.`,
|
|
291
|
+
];
|
|
292
|
+
if (a.outputPath) {
|
|
293
|
+
parts.push(`You can read partial output at ${a.outputPath}.`);
|
|
294
|
+
}
|
|
295
|
+
agentParts.push(parts.join(" "));
|
|
296
|
+
}
|
|
297
|
+
else {
|
|
298
|
+
// completed or failed
|
|
299
|
+
const parts = [
|
|
300
|
+
`Task ${a.id} (status: ${a.status}) (description: ${a.description}).`,
|
|
301
|
+
];
|
|
302
|
+
const deltaText = a.status === "failed" ? a.stderr : a.stdout;
|
|
303
|
+
if (deltaText && deltaText.length > 0) {
|
|
304
|
+
const summary = deltaText.length > 500
|
|
305
|
+
? deltaText.slice(0, 500) + "..."
|
|
306
|
+
: deltaText;
|
|
307
|
+
parts.push(`Delta: ${summary}`);
|
|
308
|
+
}
|
|
309
|
+
if (a.outputPath) {
|
|
310
|
+
parts.push(`Read the output file to retrieve the result: ${a.outputPath}.`);
|
|
311
|
+
}
|
|
312
|
+
agentParts.push(parts.join(" "));
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (agentParts.length > 0) {
|
|
316
|
+
contextParts.push(`\n\n[Background Tasks]\n${agentParts.join("\n")}`);
|
|
317
|
+
}
|
|
255
318
|
}
|
|
256
319
|
// Merge context restoration into summary
|
|
257
|
-
const enhancedSummary =
|
|
320
|
+
const enhancedSummary = compactResult.content +
|
|
258
321
|
(contextParts.length > 0
|
|
259
322
|
? `\n\n[Context Restoration]` + contextParts.join("")
|
|
260
323
|
: "");
|
|
261
|
-
// Execute message reconstruction and sessionId update after
|
|
262
|
-
this.messageManager.
|
|
324
|
+
// Execute message reconstruction and sessionId update after compaction
|
|
325
|
+
this.messageManager.compactMessagesAndUpdateSession(enhancedSummary, compactUsage);
|
|
263
326
|
// Notify Agent to add to usage tracking
|
|
264
|
-
if (
|
|
265
|
-
this.callbacks.onUsageAdded(
|
|
327
|
+
if (compactUsage && this.callbacks?.onUsageAdded) {
|
|
328
|
+
this.callbacks.onUsageAdded(compactUsage);
|
|
266
329
|
}
|
|
267
|
-
logger?.debug(`Successfully
|
|
268
|
-
this.
|
|
330
|
+
logger?.debug(`Successfully compacted ${messagesToCompact.length} messages and updated session`);
|
|
331
|
+
this.consecutiveCompactionFailures = 0;
|
|
269
332
|
}
|
|
270
|
-
catch (
|
|
271
|
-
this.
|
|
272
|
-
logger?.error(`Failed to
|
|
273
|
-
this.messageManager.addErrorBlock(`Failed to
|
|
333
|
+
catch (compactError) {
|
|
334
|
+
this.consecutiveCompactionFailures++;
|
|
335
|
+
logger?.error(`Failed to compact messages (${this.consecutiveCompactionFailures} consecutive):`, compactError);
|
|
336
|
+
this.messageManager.addErrorBlock(`Failed to compact conversation history: ${compactError instanceof Error ? compactError.message : String(compactError)}. You may encounter context limit issues.`);
|
|
274
337
|
}
|
|
275
338
|
finally {
|
|
276
|
-
this.
|
|
339
|
+
this.setIsCompacting(false);
|
|
277
340
|
}
|
|
278
341
|
}
|
|
279
342
|
}
|
|
280
343
|
}
|
|
281
|
-
|
|
282
|
-
return this.
|
|
344
|
+
getIsCompacting() {
|
|
345
|
+
return this.isCompacting;
|
|
283
346
|
}
|
|
284
|
-
|
|
285
|
-
if (this.
|
|
286
|
-
this.
|
|
287
|
-
this.callbacks.
|
|
347
|
+
setIsCompacting(isCompacting) {
|
|
348
|
+
if (this.isCompacting !== isCompacting) {
|
|
349
|
+
this.isCompacting = isCompacting;
|
|
350
|
+
this.callbacks.onCompactionStateChange?.(isCompacting);
|
|
288
351
|
}
|
|
289
352
|
}
|
|
290
353
|
get subagentManager() {
|
|
@@ -658,8 +721,8 @@ export class AIManager {
|
|
|
658
721
|
// Wait for all tools to complete execution in parallel
|
|
659
722
|
await Promise.all(toolExecutionPromises);
|
|
660
723
|
}
|
|
661
|
-
// Handle token statistics and message
|
|
662
|
-
await this.
|
|
724
|
+
// Handle token statistics and message compaction
|
|
725
|
+
await this.handleTokenUsageAndCompaction(result.usage, abortController);
|
|
663
726
|
// Finalize text/reasoning blocks for the final response (no tools)
|
|
664
727
|
this.messageManager.finalizeStreamingBlocks();
|
|
665
728
|
// Check if there are tool operations or response was truncated, if so automatically initiate next AI service call
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"backgroundTaskManager.d.ts","sourceRoot":"","sources":["../../src/managers/backgroundTaskManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,
|
|
1
|
+
{"version":3,"file":"backgroundTaskManager.d.ts","sourceRoot":"","sources":["../../src/managers/backgroundTaskManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAS,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAIzD,OAAO,EAAE,cAAc,EAAmB,MAAM,uBAAuB,CAAC;AAGxE,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAGlD,MAAM,WAAW,8BAA8B;IAC7C,uB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,GAAG,OAAO;IAgC7B,OAAO,IAAI,IAAI;CAUvB"}
|
|
@@ -120,19 +120,24 @@ export class BackgroundTaskManager {
|
|
|
120
120
|
if (logStream.writable) {
|
|
121
121
|
logStream.end();
|
|
122
122
|
}
|
|
123
|
-
shell.status
|
|
123
|
+
const wasKilled = shell.status === "killed";
|
|
124
|
+
if (!wasKilled) {
|
|
125
|
+
shell.status = code === 0 ? "completed" : "failed";
|
|
126
|
+
}
|
|
124
127
|
shell.exitCode = code ?? 0;
|
|
125
128
|
shell.endTime = Date.now();
|
|
126
129
|
shell.runtime = shell.endTime - startTime;
|
|
127
130
|
this.notifyTasksChange();
|
|
128
|
-
//
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
131
|
+
// Skip notification if task was manually killed (user/agent-initiated stop)
|
|
132
|
+
if (!wasKilled) {
|
|
133
|
+
const notificationQueue = this.container.has("NotificationQueue")
|
|
134
|
+
? this.container.get("NotificationQueue")
|
|
135
|
+
: undefined;
|
|
136
|
+
if (notificationQueue) {
|
|
137
|
+
const statusStr = shell.status;
|
|
138
|
+
const summary = `Command "${command}" ${statusStr} with exit code ${code ?? 0}`;
|
|
139
|
+
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>`);
|
|
140
|
+
}
|
|
136
141
|
}
|
|
137
142
|
};
|
|
138
143
|
const onError = (error) => {
|
|
@@ -248,19 +253,24 @@ export class BackgroundTaskManager {
|
|
|
248
253
|
if (logStream.writable) {
|
|
249
254
|
logStream.end();
|
|
250
255
|
}
|
|
251
|
-
shell.status
|
|
256
|
+
const wasKilled = shell.status === "killed";
|
|
257
|
+
if (!wasKilled) {
|
|
258
|
+
shell.status = code === 0 ? "completed" : "failed";
|
|
259
|
+
}
|
|
252
260
|
shell.exitCode = code ?? 0;
|
|
253
261
|
shell.endTime = Date.now();
|
|
254
262
|
shell.runtime = shell.endTime - startTime;
|
|
255
263
|
this.notifyTasksChange();
|
|
256
|
-
//
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
+
// Skip notification if task was manually killed (user/agent-initiated stop)
|
|
265
|
+
if (!wasKilled) {
|
|
266
|
+
const notificationQueue = this.container.has("NotificationQueue")
|
|
267
|
+
? this.container.get("NotificationQueue")
|
|
268
|
+
: undefined;
|
|
269
|
+
if (notificationQueue) {
|
|
270
|
+
const statusStr = shell.status;
|
|
271
|
+
const summary = `Command "${command}" ${statusStr} with exit code ${code ?? 0}`;
|
|
272
|
+
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>`);
|
|
273
|
+
}
|
|
264
274
|
}
|
|
265
275
|
});
|
|
266
276
|
child.on("error", (error) => {
|
|
@@ -345,18 +355,6 @@ export class BackgroundTaskManager {
|
|
|
345
355
|
task.endTime = Date.now();
|
|
346
356
|
task.runtime = task.endTime - task.startTime;
|
|
347
357
|
this.notifyTasksChange();
|
|
348
|
-
// Enqueue killed notification
|
|
349
|
-
const notificationQueue = this.container.has("NotificationQueue")
|
|
350
|
-
? this.container.get("NotificationQueue")
|
|
351
|
-
: undefined;
|
|
352
|
-
if (notificationQueue) {
|
|
353
|
-
const description = task.description || "";
|
|
354
|
-
const command = task.command || "";
|
|
355
|
-
const summary = task.type === "subagent"
|
|
356
|
-
? `Agent task "${description}" was stopped`
|
|
357
|
-
: `Command "${command}" was stopped`;
|
|
358
|
-
notificationQueue.enqueue(`<task-notification>\n<task-id>${id}</task-id>\n<task-type>${task.type}</task-type>\n<status>killed</status>\n<summary>${summary}</summary>\n</task-notification>`);
|
|
359
|
-
}
|
|
360
358
|
return true;
|
|
361
359
|
}
|
|
362
360
|
cleanup() {
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Central orchestrator for the hooks system. Handles configuration loading,
|
|
5
5
|
* validation, and hook execution across all supported events.
|
|
6
6
|
*/
|
|
7
|
-
import { type HookEvent, type HookExecutionContext, type ExtendedHookExecutionContext, type HookExecutionResult, type HookValidationResult } from "../types/hooks.js";
|
|
7
|
+
import { type HookEvent, type HookExecutionContext, type ExtendedHookExecutionContext, type HookExecutionResult, type HookValidationResult, type SessionEndSource } from "../types/hooks.js";
|
|
8
8
|
import type { WaveConfiguration, PartialHookConfiguration } from "../types/configuration.js";
|
|
9
9
|
import { HookMatcher } from "../utils/hookMatcher.js";
|
|
10
10
|
import type { MessageManager } from "./messageManager.js";
|
|
@@ -106,5 +106,20 @@ export declare class HookManager {
|
|
|
106
106
|
* Register hooks provided by a plugin
|
|
107
107
|
*/
|
|
108
108
|
registerPluginHooks(pluginRoot: string, hooks: PartialHookConfiguration): void;
|
|
109
|
+
/**
|
|
110
|
+
* Execute SessionStart hooks during initialization.
|
|
111
|
+
* Collects additionalContext and initialUserMessage from hook stdout.
|
|
112
|
+
*/
|
|
113
|
+
executeSessionStartHooks(source: "startup" | "resume" | "compact", sessionId: string, transcriptPath: string, agentType?: string): Promise<{
|
|
114
|
+
results: HookExecutionResult[];
|
|
115
|
+
additionalContext?: string;
|
|
116
|
+
initialUserMessage?: string;
|
|
117
|
+
}>;
|
|
118
|
+
/**
|
|
119
|
+
* Execute SessionEnd hooks during agent destruction.
|
|
120
|
+
* Non-blocking: always continues shutdown even if hooks fail.
|
|
121
|
+
* No stdout processing needed (SessionEnd hooks are fire-and-forget cleanup).
|
|
122
|
+
*/
|
|
123
|
+
executeSessionEndHooks(source: SessionEndSource, sessionId: string, transcriptPath: string): Promise<HookExecutionResult[]>;
|
|
109
124
|
}
|
|
110
125
|
//# sourceMappingURL=hookManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hookManager.d.ts","sourceRoot":"","sources":["../../src/managers/hookManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,
|
|
1
|
+
{"version":3,"file":"hookManager.d.ts","sourceRoot":"","sources":["../../src/managers/hookManager.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EACL,KAAK,SAAS,EAEd,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,mBAAmB,EACxB,KAAK,oBAAoB,EACzB,KAAK,gBAAgB,EAItB,MAAM,mBAAmB,CAAC;AAC3B,OAAO,KAAK,EACV,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAGtD,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAC1D,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAIlD,qBAAa,WAAW;IAMpB,OAAO,CAAC,SAAS;IALnB,OAAO,CAAC,aAAa,CAAuC;IAC5D,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAc;IACtC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAS;gBAGvB,SAAS,EAAE,SAAS,EAC5B,OAAO,EAAE,MAAM,EACf,OAAO,GAAE,WAA+B;IAM1C;;;OAGG;IACH,iBAAiB,CACf,SAAS,CAAC,EAAE,wBAAwB,EACpC,YAAY,CAAC,EAAE,wBAAwB,GACtC,IAAI;IAyBP;;;OAGG;IACH,+BAA+B,CAAC,UAAU,EAAE,iBAAiB,GAAG,IAAI,GAAG,IAAI;IA6B3E;;OAEG;IACG,YAAY,CAChB,KAAK,EAAE,SAAS,EAChB,OAAO,EAAE,oBAAoB,GAAG,4BAA4B,GAC3D,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAkHjC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CAAC,GAC1B,OAAO,CAAC,mBAAmB,EAAE,CAAC;IAoBjC;;OAEG;IACH,mBAAmB,CACjB,UAAU,EAAE,MAAM,EAClB,KAAK,EAAE,wBAAwB,GAC9B,IAAI;IAkBP;;;OAGG;IACG,wBAAwB,CAC5B,MAAM,EAAE,SAAS,GAAG,QAAQ,GAAG,SAAS,EACxC,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,EACtB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC;QACT,OAAO,EAAE,mBAAmB,EAAE,CAAC;QAC/B,iBAAiB,CAAC,EAAE,MAAM,CAAC;QAC3B,kBAAkB,CAAC,EAAE,MAAM,CAAC;KAC7B,CAAC;IA8CF;;;;OAIG;IACG,sBAAsB,CAC1B,MAAM,EAAE,gBAAgB,EACxB,SAAS,EAAE,MAAM,EACjB,cAAc,EAAE,MAAM,GACrB,OAAO,CAAC,mBAAmB,EAAE,CAAC;CAuBlC"}
|
|
@@ -42,24 +42,26 @@ export class HookManager {
|
|
|
42
42
|
*/
|
|
43
43
|
loadConfigurationFromWaveConfig(waveConfig) {
|
|
44
44
|
try {
|
|
45
|
-
|
|
46
|
-
//
|
|
45
|
+
// Merge Wave configuration hooks with existing plugin hooks
|
|
46
|
+
// (plugin hooks were registered earlier via registerPluginHooks)
|
|
47
47
|
if (waveConfig?.hooks) {
|
|
48
48
|
const validation = this.validatePartialConfiguration(waveConfig.hooks);
|
|
49
49
|
if (!validation.valid) {
|
|
50
50
|
throw new HookConfigurationError("provided configuration", validation.errors);
|
|
51
51
|
}
|
|
52
|
+
if (!this.configuration) {
|
|
53
|
+
this.configuration = {};
|
|
54
|
+
}
|
|
55
|
+
this.mergeHooksConfiguration(this.configuration, waveConfig.hooks);
|
|
52
56
|
}
|
|
53
57
|
}
|
|
54
58
|
catch (error) {
|
|
55
|
-
// If loading fails, start with undefined configuration (no hooks)
|
|
56
|
-
this.configuration = undefined;
|
|
57
59
|
// Re-throw configuration errors, but handle other errors gracefully
|
|
58
60
|
if (error instanceof HookConfigurationError) {
|
|
59
61
|
throw error;
|
|
60
62
|
}
|
|
61
63
|
else {
|
|
62
|
-
logger?.warn(`[HookManager] Failed to load configuration, continuing with
|
|
64
|
+
logger?.warn(`[HookManager] Failed to load configuration, continuing with existing hooks: ${error.message}`);
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
}
|
|
@@ -195,6 +197,8 @@ export class HookManager {
|
|
|
195
197
|
source: MessageSource.HOOK,
|
|
196
198
|
});
|
|
197
199
|
}
|
|
200
|
+
// For SessionStart, stdout is processed separately in executeSessionStartHooks
|
|
201
|
+
// For SessionEnd, stdout is ignored (fire-and-forget cleanup)
|
|
198
202
|
// For other hook types (PreToolUse, PostToolUse, Stop, PermissionRequest), ignore stdout
|
|
199
203
|
}
|
|
200
204
|
/**
|
|
@@ -253,6 +257,14 @@ export class HookManager {
|
|
|
253
257
|
// Non-blocking for now, just show error in error block
|
|
254
258
|
messageManager.addErrorBlock(errorMessage);
|
|
255
259
|
return { shouldBlock: false };
|
|
260
|
+
case "SessionStart":
|
|
261
|
+
// Non-blocking for startup, show error in error block
|
|
262
|
+
messageManager.addErrorBlock(errorMessage);
|
|
263
|
+
return { shouldBlock: false };
|
|
264
|
+
case "SessionEnd":
|
|
265
|
+
// Blocking error (exit code 2): show in error block, don't block shutdown
|
|
266
|
+
messageManager.addErrorBlock(errorMessage);
|
|
267
|
+
return { shouldBlock: false };
|
|
256
268
|
default:
|
|
257
269
|
return { shouldBlock: false };
|
|
258
270
|
}
|
|
@@ -407,7 +419,9 @@ export class HookManager {
|
|
|
407
419
|
if ((event === "UserPromptSubmit" ||
|
|
408
420
|
event === "Stop" ||
|
|
409
421
|
event === "SubagentStop" ||
|
|
410
|
-
event === "WorktreeCreate"
|
|
422
|
+
event === "WorktreeCreate" ||
|
|
423
|
+
event === "SessionStart" ||
|
|
424
|
+
event === "SessionEnd") &&
|
|
411
425
|
context.toolName !== undefined) {
|
|
412
426
|
logger?.warn(`[HookManager] ${event} event has unexpected toolName in context: ${context.toolName}`);
|
|
413
427
|
}
|
|
@@ -458,7 +472,9 @@ export class HookManager {
|
|
|
458
472
|
event === "Stop" ||
|
|
459
473
|
event === "SubagentStop" ||
|
|
460
474
|
event === "WorktreeCreate" ||
|
|
461
|
-
event === "CwdChanged"
|
|
475
|
+
event === "CwdChanged" ||
|
|
476
|
+
event === "SessionStart" ||
|
|
477
|
+
event === "SessionEnd") {
|
|
462
478
|
return true;
|
|
463
479
|
}
|
|
464
480
|
// For tool-based events, check matcher if present
|
|
@@ -500,7 +516,9 @@ export class HookManager {
|
|
|
500
516
|
if ((event === "UserPromptSubmit" ||
|
|
501
517
|
event === "Stop" ||
|
|
502
518
|
event === "SubagentStop" ||
|
|
503
|
-
event === "WorktreeCreate"
|
|
519
|
+
event === "WorktreeCreate" ||
|
|
520
|
+
event === "SessionStart" ||
|
|
521
|
+
event === "SessionEnd") &&
|
|
504
522
|
config.matcher) {
|
|
505
523
|
errors.push(`${prefix}: Event ${event} should not have a matcher`);
|
|
506
524
|
}
|
|
@@ -530,6 +548,8 @@ export class HookManager {
|
|
|
530
548
|
PermissionRequest: 0,
|
|
531
549
|
WorktreeCreate: 0,
|
|
532
550
|
CwdChanged: 0,
|
|
551
|
+
SessionStart: 0,
|
|
552
|
+
SessionEnd: 0,
|
|
533
553
|
},
|
|
534
554
|
};
|
|
535
555
|
}
|
|
@@ -542,6 +562,8 @@ export class HookManager {
|
|
|
542
562
|
PermissionRequest: 0,
|
|
543
563
|
WorktreeCreate: 0,
|
|
544
564
|
CwdChanged: 0,
|
|
565
|
+
SessionStart: 0,
|
|
566
|
+
SessionEnd: 0,
|
|
545
567
|
};
|
|
546
568
|
let totalConfigs = 0;
|
|
547
569
|
let totalCommands = 0;
|
|
@@ -600,4 +622,71 @@ export class HookManager {
|
|
|
600
622
|
}
|
|
601
623
|
this.mergeHooksConfiguration(this.configuration, stampedHooks);
|
|
602
624
|
}
|
|
625
|
+
/**
|
|
626
|
+
* Execute SessionStart hooks during initialization.
|
|
627
|
+
* Collects additionalContext and initialUserMessage from hook stdout.
|
|
628
|
+
*/
|
|
629
|
+
async executeSessionStartHooks(source, sessionId, transcriptPath, agentType) {
|
|
630
|
+
const context = {
|
|
631
|
+
event: "SessionStart",
|
|
632
|
+
projectDir: this.workdir,
|
|
633
|
+
timestamp: new Date(),
|
|
634
|
+
sessionId,
|
|
635
|
+
transcriptPath,
|
|
636
|
+
cwd: this.workdir,
|
|
637
|
+
source,
|
|
638
|
+
agentType,
|
|
639
|
+
env: Object.fromEntries(Object.entries(process.env).filter((e) => e[1] !== undefined)),
|
|
640
|
+
};
|
|
641
|
+
const results = await this.executeHooks("SessionStart", context);
|
|
642
|
+
let additionalContext;
|
|
643
|
+
let initialUserMessage;
|
|
644
|
+
// Process stdout from successful hooks
|
|
645
|
+
for (const result of results) {
|
|
646
|
+
if (result.success && result.stdout?.trim()) {
|
|
647
|
+
const trimmed = result.stdout.trim();
|
|
648
|
+
// Try to parse as JSON for structured output
|
|
649
|
+
try {
|
|
650
|
+
const parsed = JSON.parse(trimmed);
|
|
651
|
+
if (parsed.hookSpecificOutput?.additionalContext) {
|
|
652
|
+
additionalContext =
|
|
653
|
+
(additionalContext ? additionalContext + "\n" : "") +
|
|
654
|
+
parsed.hookSpecificOutput.additionalContext;
|
|
655
|
+
}
|
|
656
|
+
if (parsed.initialUserMessage) {
|
|
657
|
+
initialUserMessage = parsed.initialUserMessage;
|
|
658
|
+
}
|
|
659
|
+
}
|
|
660
|
+
catch {
|
|
661
|
+
// Not JSON, treat as additional context
|
|
662
|
+
additionalContext =
|
|
663
|
+
(additionalContext ? additionalContext + "\n" : "") + trimmed;
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return { results, additionalContext, initialUserMessage };
|
|
668
|
+
}
|
|
669
|
+
/**
|
|
670
|
+
* Execute SessionEnd hooks during agent destruction.
|
|
671
|
+
* Non-blocking: always continues shutdown even if hooks fail.
|
|
672
|
+
* No stdout processing needed (SessionEnd hooks are fire-and-forget cleanup).
|
|
673
|
+
*/
|
|
674
|
+
async executeSessionEndHooks(source, sessionId, transcriptPath) {
|
|
675
|
+
const context = {
|
|
676
|
+
event: "SessionEnd",
|
|
677
|
+
projectDir: this.workdir,
|
|
678
|
+
timestamp: new Date(),
|
|
679
|
+
sessionId,
|
|
680
|
+
transcriptPath,
|
|
681
|
+
cwd: this.workdir,
|
|
682
|
+
endSource: source,
|
|
683
|
+
env: Object.fromEntries(Object.entries(process.env).filter((e) => e[1] !== undefined)),
|
|
684
|
+
};
|
|
685
|
+
const results = await this.executeHooks("SessionEnd", context);
|
|
686
|
+
// Process results but never block shutdown
|
|
687
|
+
if (results.length > 0) {
|
|
688
|
+
this.processHookResults("SessionEnd", results);
|
|
689
|
+
}
|
|
690
|
+
return results;
|
|
691
|
+
}
|
|
603
692
|
}
|
|
@@ -14,8 +14,8 @@ export interface MessageManagerCallbacks {
|
|
|
14
14
|
onAssistantReasoningUpdated?: (chunk: string, accumulated: string) => void;
|
|
15
15
|
onToolBlockUpdated?: (params: AgentToolBlockUpdateParams) => void;
|
|
16
16
|
onErrorBlockAdded?: (error: string) => void;
|
|
17
|
-
|
|
18
|
-
|
|
17
|
+
onCompactBlockAdded?: (content: string) => void;
|
|
18
|
+
onCompactionStateChange?: (isCompacting: boolean) => void;
|
|
19
19
|
onAddBangMessage?: (command: string) => void;
|
|
20
20
|
onUpdateBangMessage?: (command: string, output: string) => void;
|
|
21
21
|
onCompleteBangMessage?: (command: string, exitCode: number) => void;
|
|
@@ -49,6 +49,7 @@ export declare class MessageManager {
|
|
|
49
49
|
private savedMessageCount;
|
|
50
50
|
private filesInContext;
|
|
51
51
|
private recentFileReads;
|
|
52
|
+
private invokedSkills;
|
|
52
53
|
private sessionType;
|
|
53
54
|
private subagentType?;
|
|
54
55
|
private _usages;
|
|
@@ -120,9 +121,9 @@ export declare class MessageManager {
|
|
|
120
121
|
addErrorBlock(error: string): void;
|
|
121
122
|
addInfoBlock(content: string): void;
|
|
122
123
|
/**
|
|
123
|
-
*
|
|
124
|
+
* Compact messages and update session, delete compacted messages, only keep compacted messages and last 3 messages
|
|
124
125
|
*/
|
|
125
|
-
|
|
126
|
+
compactMessagesAndUpdateSession(compactedContent: string, usage?: Usage): void;
|
|
126
127
|
addFileHistoryBlock(snapshots: import("../types/reversion.js").FileSnapshot[]): void;
|
|
127
128
|
addBangMessage(command: string): void;
|
|
128
129
|
updateBangMessage(command: string, output: string): void;
|
|
@@ -197,5 +198,19 @@ export declare class MessageManager {
|
|
|
197
198
|
path: string;
|
|
198
199
|
content: string;
|
|
199
200
|
}>;
|
|
201
|
+
/**
|
|
202
|
+
* Extract skill invocations from tool blocks in a message.
|
|
203
|
+
*/
|
|
204
|
+
private extractSkillInvocationsFromMessage;
|
|
205
|
+
/**
|
|
206
|
+
* Get recently invoked skill names, sorted by timestamp (newest first).
|
|
207
|
+
* @param maxSkills - Maximum number of skills to return
|
|
208
|
+
* @returns Array of skill names sorted by recency
|
|
209
|
+
*/
|
|
210
|
+
getInvokedSkillNames(maxSkills?: number): string[];
|
|
211
|
+
/**
|
|
212
|
+
* Clear all invoked skills (e.g., after compaction).
|
|
213
|
+
*/
|
|
214
|
+
clearInvokedSkills(): void;
|
|
200
215
|
}
|
|
201
216
|
//# sourceMappingURL=messageManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"messageManager.d.ts","sourceRoot":"","sources":["../../src/managers/messageManager.ts"],"names":[],"mappings":"AAAA,OAAO,EAYL,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,KAAK,4BAA4B,EAElC,MAAM,+BAA+B,CAAC;AACvC,OAAO,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAGxD,OAAO,EAIL,WAAW,EAEZ,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,qCAAqC,EAAE,MAAM,qBAAqB,CAAC;AAK5E,OAAO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