@agentforge/patterns 0.5.0 → 0.5.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/dist/index.cjs +18 -1
- package/dist/index.js +18 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -2080,6 +2080,11 @@ function wrapReActAgent(workerId, agent, verbose = false) {
|
|
|
2080
2080
|
if (verbose) {
|
|
2081
2081
|
console.log(`[ReActWrapper:${workerId}] Response:`, response.substring(0, 100) + "...");
|
|
2082
2082
|
}
|
|
2083
|
+
const toolsUsed = result.actions?.map((action) => action.name).filter(Boolean) || [];
|
|
2084
|
+
const uniqueTools = [...new Set(toolsUsed)];
|
|
2085
|
+
if (verbose && uniqueTools.length > 0) {
|
|
2086
|
+
console.log(`[ReActWrapper:${workerId}] Tools used:`, uniqueTools.join(", "));
|
|
2087
|
+
}
|
|
2083
2088
|
const taskResult = {
|
|
2084
2089
|
assignmentId: currentAssignment.id,
|
|
2085
2090
|
workerId,
|
|
@@ -2088,7 +2093,8 @@ function wrapReActAgent(workerId, agent, verbose = false) {
|
|
|
2088
2093
|
success: true,
|
|
2089
2094
|
metadata: {
|
|
2090
2095
|
agent_type: "react",
|
|
2091
|
-
iterations: result.iteration || 0
|
|
2096
|
+
iterations: result.iteration || 0,
|
|
2097
|
+
tools_used: uniqueTools
|
|
2092
2098
|
}
|
|
2093
2099
|
};
|
|
2094
2100
|
return {
|
|
@@ -2481,6 +2487,17 @@ function createMultiAgentSystem(config) {
|
|
|
2481
2487
|
};
|
|
2482
2488
|
return originalInvoke(mergedInput, config2);
|
|
2483
2489
|
};
|
|
2490
|
+
const originalStream = compiled.stream.bind(compiled);
|
|
2491
|
+
compiled.stream = async function(input, config2) {
|
|
2492
|
+
const mergedInput = {
|
|
2493
|
+
...input,
|
|
2494
|
+
workers: {
|
|
2495
|
+
...workerCapabilities,
|
|
2496
|
+
...input.workers || {}
|
|
2497
|
+
}
|
|
2498
|
+
};
|
|
2499
|
+
return originalStream(mergedInput, config2);
|
|
2500
|
+
};
|
|
2484
2501
|
return compiled;
|
|
2485
2502
|
}
|
|
2486
2503
|
var MultiAgentSystemBuilder = class {
|
package/dist/index.js
CHANGED
|
@@ -1981,6 +1981,11 @@ function wrapReActAgent(workerId, agent, verbose = false) {
|
|
|
1981
1981
|
if (verbose) {
|
|
1982
1982
|
console.log(`[ReActWrapper:${workerId}] Response:`, response.substring(0, 100) + "...");
|
|
1983
1983
|
}
|
|
1984
|
+
const toolsUsed = result.actions?.map((action) => action.name).filter(Boolean) || [];
|
|
1985
|
+
const uniqueTools = [...new Set(toolsUsed)];
|
|
1986
|
+
if (verbose && uniqueTools.length > 0) {
|
|
1987
|
+
console.log(`[ReActWrapper:${workerId}] Tools used:`, uniqueTools.join(", "));
|
|
1988
|
+
}
|
|
1984
1989
|
const taskResult = {
|
|
1985
1990
|
assignmentId: currentAssignment.id,
|
|
1986
1991
|
workerId,
|
|
@@ -1989,7 +1994,8 @@ function wrapReActAgent(workerId, agent, verbose = false) {
|
|
|
1989
1994
|
success: true,
|
|
1990
1995
|
metadata: {
|
|
1991
1996
|
agent_type: "react",
|
|
1992
|
-
iterations: result.iteration || 0
|
|
1997
|
+
iterations: result.iteration || 0,
|
|
1998
|
+
tools_used: uniqueTools
|
|
1993
1999
|
}
|
|
1994
2000
|
};
|
|
1995
2001
|
return {
|
|
@@ -2382,6 +2388,17 @@ function createMultiAgentSystem(config) {
|
|
|
2382
2388
|
};
|
|
2383
2389
|
return originalInvoke(mergedInput, config2);
|
|
2384
2390
|
};
|
|
2391
|
+
const originalStream = compiled.stream.bind(compiled);
|
|
2392
|
+
compiled.stream = async function(input, config2) {
|
|
2393
|
+
const mergedInput = {
|
|
2394
|
+
...input,
|
|
2395
|
+
workers: {
|
|
2396
|
+
...workerCapabilities,
|
|
2397
|
+
...input.workers || {}
|
|
2398
|
+
}
|
|
2399
|
+
};
|
|
2400
|
+
return originalStream(mergedInput, config2);
|
|
2401
|
+
};
|
|
2385
2402
|
return compiled;
|
|
2386
2403
|
}
|
|
2387
2404
|
var MultiAgentSystemBuilder = class {
|