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.
@@ -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 10 browser tools', () => {
25
- expect(Object.keys(EBrowserTools).length).toBe(10);
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 10 browser tools', () => {
86
- expect(tools.length).toBe(10);
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', () => {