illuma-agents 1.0.52 → 1.0.53
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/cjs/graphs/Graph.cjs +4 -1
- package/dist/cjs/graphs/Graph.cjs.map +1 -1
- package/dist/cjs/messages/tools.cjs +4 -0
- package/dist/cjs/messages/tools.cjs.map +1 -1
- package/dist/esm/graphs/Graph.mjs +4 -1
- package/dist/esm/graphs/Graph.mjs.map +1 -1
- package/dist/esm/messages/tools.mjs +4 -0
- package/dist/esm/messages/tools.mjs.map +1 -1
- package/package.json +1 -1
- package/src/graphs/Graph.ts +5 -2
- package/src/llm/bedrock/llm.spec.ts +6 -6
- package/src/messages/tools.ts +2 -0
- package/src/tools/__tests__/BrowserTools.test.ts +6 -4
package/src/messages/tools.ts
CHANGED
|
@@ -19,6 +19,7 @@ type ToolSearchArtifact = {
|
|
|
19
19
|
* @returns Array of discovered tool names (empty if no new discoveries)
|
|
20
20
|
*/
|
|
21
21
|
export function extractToolDiscoveries(messages: BaseMessage[]): string[] {
|
|
22
|
+
if (messages.length === 0) return [];
|
|
22
23
|
const lastMessage = messages[messages.length - 1];
|
|
23
24
|
// Use getType() instead of instanceof to avoid module mismatch issues
|
|
24
25
|
if (lastMessage.getType() !== MessageTypes.TOOL) return [];
|
|
@@ -69,6 +70,7 @@ export function extractToolDiscoveries(messages: BaseMessage[]): string[] {
|
|
|
69
70
|
* Quick check to avoid full extraction when not needed.
|
|
70
71
|
*/
|
|
71
72
|
export function hasToolSearchInCurrentTurn(messages: BaseMessage[]): boolean {
|
|
73
|
+
if (messages.length === 0) return false;
|
|
72
74
|
const lastMessage = messages[messages.length - 1];
|
|
73
75
|
// Use getType() instead of instanceof to avoid module mismatch issues
|
|
74
76
|
if (lastMessage.getType() !== MessageTypes.TOOL) return false;
|
|
@@ -19,10 +19,12 @@ describe('BrowserTools', () => {
|
|
|
19
19
|
expect(EBrowserTools.BACK).toBe('browser_back');
|
|
20
20
|
expect(EBrowserTools.SCREENSHOT).toBe('browser_screenshot');
|
|
21
21
|
expect(EBrowserTools.GET_PAGE_STATE).toBe('browser_get_page_state');
|
|
22
|
+
expect(EBrowserTools.KEYPRESS).toBe('browser_keypress');
|
|
23
|
+
expect(EBrowserTools.SWITCH_TAB).toBe('browser_switch_tab');
|
|
22
24
|
});
|
|
23
25
|
|
|
24
|
-
it('should have exactly
|
|
25
|
-
expect(Object.keys(EBrowserTools).length).toBe(
|
|
26
|
+
it('should have exactly 12 browser tools', () => {
|
|
27
|
+
expect(Object.keys(EBrowserTools).length).toBe(12);
|
|
26
28
|
});
|
|
27
29
|
});
|
|
28
30
|
|
|
@@ -82,8 +84,8 @@ describe('BrowserTools', () => {
|
|
|
82
84
|
tools = createBrowserTools();
|
|
83
85
|
});
|
|
84
86
|
|
|
85
|
-
it('should create exactly
|
|
86
|
-
expect(tools.length).toBe(
|
|
87
|
+
it('should create exactly 12 browser tools', () => {
|
|
88
|
+
expect(tools.length).toBe(12);
|
|
87
89
|
});
|
|
88
90
|
|
|
89
91
|
it('should create tools with correct names', () => {
|