osborn 0.9.144 → 0.9.145
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/claude-llm.js +42 -0
- package/package.json +1 -1
package/dist/claude-llm.js
CHANGED
|
@@ -1148,6 +1148,27 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1148
1148
|
const reviewerOptions = {
|
|
1149
1149
|
cwd: this.#opts.workingDirectory,
|
|
1150
1150
|
permissionMode: 'default',
|
|
1151
|
+
hooks: {
|
|
1152
|
+
PreToolUse: [{
|
|
1153
|
+
matcher: '.*',
|
|
1154
|
+
hooks: [async (input) => {
|
|
1155
|
+
const toolName = input?.tool_name || 'unknown';
|
|
1156
|
+
const toolInput = input?.tool_input || {};
|
|
1157
|
+
emitter.emit('tool_use', { name: toolName, input: toolInput, agentRole: 'reviewer' });
|
|
1158
|
+
return {};
|
|
1159
|
+
}],
|
|
1160
|
+
}],
|
|
1161
|
+
PostToolUse: [{
|
|
1162
|
+
matcher: '.*',
|
|
1163
|
+
hooks: [async (input) => {
|
|
1164
|
+
const toolName = input?.tool_name || 'unknown';
|
|
1165
|
+
const toolInput = input?.tool_input || {};
|
|
1166
|
+
const toolResponse = input?.tool_response;
|
|
1167
|
+
emitter.emit('tool_result', { name: toolName, input: toolInput, response: toolResponse, agentRole: 'reviewer' });
|
|
1168
|
+
return {};
|
|
1169
|
+
}],
|
|
1170
|
+
}],
|
|
1171
|
+
},
|
|
1151
1172
|
};
|
|
1152
1173
|
console.log(`[DISPATCH] spawning reviewer for agentId=${agentId.slice(0, 8)}`);
|
|
1153
1174
|
const reviewerQuery = query({ prompt, options: reviewerOptions });
|
|
@@ -1206,6 +1227,27 @@ export class ClaudeLLM extends llm.LLM {
|
|
|
1206
1227
|
const gateOptions = {
|
|
1207
1228
|
cwd: this.#opts.workingDirectory,
|
|
1208
1229
|
permissionMode: 'default',
|
|
1230
|
+
hooks: {
|
|
1231
|
+
PreToolUse: [{
|
|
1232
|
+
matcher: '.*',
|
|
1233
|
+
hooks: [async (input) => {
|
|
1234
|
+
const toolName = input?.tool_name || 'unknown';
|
|
1235
|
+
const toolInput = input?.tool_input || {};
|
|
1236
|
+
emitter.emit('tool_use', { name: toolName, input: toolInput, agentRole: 'reasoner' });
|
|
1237
|
+
return {};
|
|
1238
|
+
}],
|
|
1239
|
+
}],
|
|
1240
|
+
PostToolUse: [{
|
|
1241
|
+
matcher: '.*',
|
|
1242
|
+
hooks: [async (input) => {
|
|
1243
|
+
const toolName = input?.tool_name || 'unknown';
|
|
1244
|
+
const toolInput = input?.tool_input || {};
|
|
1245
|
+
const toolResponse = input?.tool_response;
|
|
1246
|
+
emitter.emit('tool_result', { name: toolName, input: toolInput, response: toolResponse, agentRole: 'reasoner' });
|
|
1247
|
+
return {};
|
|
1248
|
+
}],
|
|
1249
|
+
}],
|
|
1250
|
+
},
|
|
1209
1251
|
};
|
|
1210
1252
|
console.log(`[DISPATCH] spawning research-gate for agentId=${agentId.slice(0, 8)}`);
|
|
1211
1253
|
const gateQuery = query({ prompt, options: gateOptions });
|