illuma-agents 1.0.45 → 1.0.47

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.
@@ -1,357 +0,0 @@
1
- import { z } from 'zod';
2
- import { tool } from '@langchain/core/tools';
3
-
4
- /**
5
- * Desktop tool names - keep in sync with Ranger Desktop Electron app
6
- * These tools execute locally in the Electron app, NOT on the server
7
- */
8
- const EDesktopTools = {
9
- SCREENSHOT: 'computer_screenshot',
10
- CLICK: 'computer_click',
11
- DOUBLE_CLICK: 'computer_double_click',
12
- RIGHT_CLICK: 'computer_right_click',
13
- TYPE: 'computer_type',
14
- KEY: 'computer_key',
15
- KEY_COMBO: 'computer_key_combo',
16
- SCROLL: 'computer_scroll',
17
- DRAG: 'computer_drag',
18
- GET_ACTIVE_WINDOW: 'computer_get_active_window',
19
- GET_MOUSE_POSITION: 'computer_get_mouse_position',
20
- CLIPBOARD_READ: 'clipboard_read',
21
- CLIPBOARD_WRITE: 'clipboard_write',
22
- CLIPBOARD_PASTE: 'clipboard_paste',
23
- WAIT: 'computer_wait',
24
- // Native UI Automation tools (Windows) - faster and more reliable than screenshot-based
25
- UI_FIND_ELEMENT: 'ui_find_element',
26
- UI_CLICK_ELEMENT: 'ui_click_element',
27
- UI_GET_WINDOW_TREE: 'ui_get_window_tree',
28
- UI_FIND_BUTTONS: 'ui_find_buttons',
29
- UI_FIND_INPUTS: 'ui_find_inputs',
30
- };
31
- /**
32
- * Check if desktop capability is available based on request headers or context
33
- * The Ranger Desktop Electron app sets these headers when connected:
34
- * - X-Ranger-Desktop: true
35
- * - X-Ranger-Desktop-Capable: true
36
- */
37
- function hasDesktopCapability(req) {
38
- if (!req?.headers) {
39
- return false;
40
- }
41
- const desktopApp = req.headers['x-ranger-desktop'];
42
- const desktopCapable = req.headers['x-ranger-desktop-capable'];
43
- return desktopApp === 'true' || desktopCapable === 'true';
44
- }
45
- // Tool schemas
46
- const ScreenshotSchema = z.object({});
47
- const ClickSchema = z.object({
48
- x: z.number().describe('X coordinate to click'),
49
- y: z.number().describe('Y coordinate to click'),
50
- });
51
- const DoubleClickSchema = z.object({
52
- x: z.number().describe('X coordinate to double-click'),
53
- y: z.number().describe('Y coordinate to double-click'),
54
- });
55
- const RightClickSchema = z.object({
56
- x: z.number().describe('X coordinate to right-click'),
57
- y: z.number().describe('Y coordinate to right-click'),
58
- });
59
- const TypeSchema = z.object({
60
- text: z.string().describe('Text to type'),
61
- });
62
- const KeySchema = z.object({
63
- key: z
64
- .string()
65
- .describe('Key to press (e.g., "Enter", "Tab", "Escape", "Backspace", "Delete", "ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight", "Home", "End", "PageUp", "PageDown", "F1"-"F12")'),
66
- });
67
- const KeyComboSchema = z.object({
68
- keys: z
69
- .array(z.string())
70
- .describe('Array of keys to press together (e.g., ["Control", "c"] for copy, ["Alt", "Tab"] for window switch)'),
71
- });
72
- const ScrollSchema = z.object({
73
- x: z.number().describe('X coordinate to scroll at'),
74
- y: z.number().describe('Y coordinate to scroll at'),
75
- deltaX: z.number().optional().describe('Horizontal scroll amount (pixels)'),
76
- deltaY: z.number().describe('Vertical scroll amount (pixels, negative = up, positive = down)'),
77
- });
78
- const DragSchema = z.object({
79
- startX: z.number().describe('Starting X coordinate'),
80
- startY: z.number().describe('Starting Y coordinate'),
81
- endX: z.number().describe('Ending X coordinate'),
82
- endY: z.number().describe('Ending Y coordinate'),
83
- });
84
- const GetActiveWindowSchema = z.object({});
85
- const GetMousePositionSchema = z.object({});
86
- const ClipboardReadSchema = z.object({});
87
- const ClipboardWriteSchema = z.object({
88
- text: z.string().describe('Text to write to clipboard'),
89
- });
90
- const ClipboardPasteSchema = z.object({});
91
- const WaitSchema = z.object({
92
- ms: z.number().describe('Milliseconds to wait'),
93
- });
94
- // ============ Native UI Automation Schemas (Windows) ============
95
- const UIFindElementSchema = z.object({
96
- name: z.string().optional().describe('Element name/label to find (e.g., "Submit", "OK", "File")'),
97
- automationId: z.string().optional().describe('Automation ID of element (unique identifier)'),
98
- controlType: z.string().optional().describe('Type of control: Button, Edit, Text, ComboBox, List, Menu, MenuItem, Window, etc.'),
99
- });
100
- const UIClickElementSchema = z.object({
101
- name: z.string().optional().describe('Element name/label to click'),
102
- automationId: z.string().optional().describe('Automation ID of element to click'),
103
- controlType: z.string().optional().describe('Type of control: Button, Edit, etc.'),
104
- clickType: z.enum(['left', 'right', 'double']).optional().describe('Click type (default: left)'),
105
- });
106
- const UIGetWindowTreeSchema = z.object({
107
- maxDepth: z.number().optional().describe('Maximum depth to traverse (default: 3)'),
108
- });
109
- const UIFindButtonsSchema = z.object({});
110
- const UIFindInputsSchema = z.object({});
111
- /**
112
- * Format desktop action result for LLM consumption
113
- */
114
- function formatResultForLLM(result, action) {
115
- if (!result.success && result.error) {
116
- return `Desktop action "${action}" failed: ${result.error}`;
117
- }
118
- const parts = [];
119
- if (result.screenshot) {
120
- parts.push(`Screenshot captured (${result.screenshot.width}x${result.screenshot.height})`);
121
- // The base64 image will be handled separately by the message formatter
122
- }
123
- if (result.activeWindow) {
124
- parts.push(`**Active Window:**`);
125
- parts.push(` - Title: ${result.activeWindow.title}`);
126
- parts.push(` - App: ${result.activeWindow.app}`);
127
- if (result.activeWindow.bounds) {
128
- const b = result.activeWindow.bounds;
129
- parts.push(` - Position: (${b.x}, ${b.y})`);
130
- parts.push(` - Size: ${b.width}x${b.height}`);
131
- }
132
- }
133
- if (result.mousePosition) {
134
- parts.push(`**Mouse Position:** (${result.mousePosition.x}, ${result.mousePosition.y})`);
135
- }
136
- if (result.clipboard !== undefined) {
137
- parts.push(`**Clipboard Content:** ${result.clipboard}`);
138
- }
139
- // UI Automation results
140
- if (result.uiElement) {
141
- const el = result.uiElement;
142
- parts.push(`**UI Element Found:**`);
143
- parts.push(` - Name: "${el.name}"`);
144
- parts.push(` - AutomationId: "${el.automationId}"`);
145
- parts.push(` - Type: ${el.controlType}`);
146
- if (el.boundingRectangle) {
147
- const b = el.boundingRectangle;
148
- parts.push(` - Bounds: (${b.x}, ${b.y}) ${b.width}x${b.height}`);
149
- parts.push(` - Center: (${Math.round(b.x + b.width / 2)}, ${Math.round(b.y + b.height / 2)})`);
150
- }
151
- parts.push(` - Enabled: ${el.isEnabled}`);
152
- }
153
- if (result.uiElements && result.uiElements.length > 0) {
154
- parts.push(`**UI Elements Found (${result.uiElements.length}):**`);
155
- for (const el of result.uiElements.slice(0, 20)) { // Limit to 20
156
- const bounds = el.boundingRectangle ?
157
- ` at (${el.boundingRectangle.x}, ${el.boundingRectangle.y})` : '';
158
- parts.push(` - [${el.controlType}] "${el.name}"${el.automationId ? ` (id: ${el.automationId})` : ''}${bounds}`);
159
- }
160
- if (result.uiElements.length > 20) {
161
- parts.push(` ... and ${result.uiElements.length - 20} more`);
162
- }
163
- }
164
- if (result.uiTree) {
165
- parts.push(`**UI Tree:**`);
166
- parts.push('```json');
167
- parts.push(JSON.stringify(result.uiTree, null, 2).slice(0, 3000)); // Limit size
168
- parts.push('```');
169
- }
170
- if (result.data && !result.uiElement && !result.uiElements && !result.uiTree) {
171
- // Generic data fallback
172
- parts.push(`**Result:**`);
173
- parts.push(JSON.stringify(result.data, null, 2).slice(0, 2000));
174
- }
175
- if (parts.length === 0) {
176
- parts.push(`Desktop action "${action}" completed successfully.`);
177
- }
178
- return parts.join('\\n');
179
- }
180
- /**
181
- * Create desktop automation tools for the agent
182
- * These tools allow AI to control the user's desktop when Ranger Desktop is running
183
- */
184
- function createDesktopTools(options = {}) {
185
- const { waitForResult } = options;
186
- const tools = [];
187
- /**
188
- * Helper to create tool function that optionally waits for results
189
- * The toolCallId is extracted from the RunnableConfig passed by LangChain
190
- */
191
- const createToolFunction = (action) => {
192
- return async (args, config) => {
193
- const toolCallId = config?.toolCall?.id ??
194
- `desktop_${Date.now()}_${Math.random().toString(36).slice(2)}`;
195
- // Create marker for Electron app
196
- const marker = {
197
- requiresDesktopExecution: true,
198
- action,
199
- args,
200
- toolCallId,
201
- };
202
- // If no callback, return marker immediately (Electron handles via SSE interception)
203
- if (!waitForResult) {
204
- return JSON.stringify(marker);
205
- }
206
- // With callback: wait for actual results from Electron app
207
- try {
208
- const result = await waitForResult(action, args, toolCallId);
209
- return formatResultForLLM(result, action);
210
- }
211
- catch (error) {
212
- const errorMessage = error instanceof Error ? error.message : String(error);
213
- return `Desktop action "${action}" failed: ${errorMessage}`;
214
- }
215
- };
216
- };
217
- // computer_screenshot
218
- tools.push(tool(createToolFunction(EDesktopTools.SCREENSHOT), {
219
- name: EDesktopTools.SCREENSHOT,
220
- description: 'Take a screenshot of the entire screen. Use this to see what is currently displayed on the desktop.',
221
- schema: ScreenshotSchema,
222
- }));
223
- // computer_click
224
- tools.push(tool(createToolFunction(EDesktopTools.CLICK), {
225
- name: EDesktopTools.CLICK,
226
- description: 'Click the mouse at the specified screen coordinates. Use screenshot first to identify the target location.',
227
- schema: ClickSchema,
228
- }));
229
- // computer_double_click
230
- tools.push(tool(createToolFunction(EDesktopTools.DOUBLE_CLICK), {
231
- name: EDesktopTools.DOUBLE_CLICK,
232
- description: 'Double-click the mouse at the specified screen coordinates.',
233
- schema: DoubleClickSchema,
234
- }));
235
- // computer_right_click
236
- tools.push(tool(createToolFunction(EDesktopTools.RIGHT_CLICK), {
237
- name: EDesktopTools.RIGHT_CLICK,
238
- description: 'Right-click the mouse at the specified screen coordinates to open context menus.',
239
- schema: RightClickSchema,
240
- }));
241
- // computer_type
242
- tools.push(tool(createToolFunction(EDesktopTools.TYPE), {
243
- name: EDesktopTools.TYPE,
244
- description: 'Type text using the keyboard. Make sure the target input field is focused first (use click).',
245
- schema: TypeSchema,
246
- }));
247
- // computer_key
248
- tools.push(tool(createToolFunction(EDesktopTools.KEY), {
249
- name: EDesktopTools.KEY,
250
- description: 'Press a single key on the keyboard (Enter, Tab, Escape, arrow keys, function keys, etc.).',
251
- schema: KeySchema,
252
- }));
253
- // computer_key_combo
254
- tools.push(tool(createToolFunction(EDesktopTools.KEY_COMBO), {
255
- name: EDesktopTools.KEY_COMBO,
256
- description: 'Press a key combination (e.g., Ctrl+C to copy, Ctrl+V to paste, Alt+Tab to switch windows).',
257
- schema: KeyComboSchema,
258
- }));
259
- // computer_scroll
260
- tools.push(tool(createToolFunction(EDesktopTools.SCROLL), {
261
- name: EDesktopTools.SCROLL,
262
- description: 'Scroll at the specified screen coordinates. Use negative deltaY to scroll up, positive to scroll down.',
263
- schema: ScrollSchema,
264
- }));
265
- // computer_drag
266
- tools.push(tool(createToolFunction(EDesktopTools.DRAG), {
267
- name: EDesktopTools.DRAG,
268
- description: 'Drag the mouse from one position to another (for moving windows, selecting text, etc.).',
269
- schema: DragSchema,
270
- }));
271
- // computer_get_active_window
272
- tools.push(tool(createToolFunction(EDesktopTools.GET_ACTIVE_WINDOW), {
273
- name: EDesktopTools.GET_ACTIVE_WINDOW,
274
- description: 'Get information about the currently active window (title, application name, position, size).',
275
- schema: GetActiveWindowSchema,
276
- }));
277
- // computer_get_mouse_position
278
- tools.push(tool(createToolFunction(EDesktopTools.GET_MOUSE_POSITION), {
279
- name: EDesktopTools.GET_MOUSE_POSITION,
280
- description: 'Get the current mouse cursor position on screen.',
281
- schema: GetMousePositionSchema,
282
- }));
283
- // clipboard_read
284
- tools.push(tool(createToolFunction(EDesktopTools.CLIPBOARD_READ), {
285
- name: EDesktopTools.CLIPBOARD_READ,
286
- description: 'Read the current contents of the system clipboard.',
287
- schema: ClipboardReadSchema,
288
- }));
289
- // clipboard_write
290
- tools.push(tool(createToolFunction(EDesktopTools.CLIPBOARD_WRITE), {
291
- name: EDesktopTools.CLIPBOARD_WRITE,
292
- description: 'Write text to the system clipboard.',
293
- schema: ClipboardWriteSchema,
294
- }));
295
- // clipboard_paste
296
- tools.push(tool(createToolFunction(EDesktopTools.CLIPBOARD_PASTE), {
297
- name: EDesktopTools.CLIPBOARD_PASTE,
298
- description: 'Paste the clipboard contents (equivalent to Ctrl+V). Use clipboard_write first to set the content.',
299
- schema: ClipboardPasteSchema,
300
- }));
301
- // computer_wait
302
- tools.push(tool(createToolFunction(EDesktopTools.WAIT), {
303
- name: EDesktopTools.WAIT,
304
- description: 'Wait for the specified number of milliseconds. Use this to wait for UI animations or loading.',
305
- schema: WaitSchema,
306
- }));
307
- // ============ Native UI Automation Tools (Windows) ============
308
- // These are FASTER and MORE RELIABLE than screenshot-based automation
309
- // They find elements by semantic properties (name, automationId, type)
310
- // instead of relying on pixel coordinates from screenshots
311
- // ui_find_element
312
- tools.push(tool(createToolFunction(EDesktopTools.UI_FIND_ELEMENT), {
313
- name: EDesktopTools.UI_FIND_ELEMENT,
314
- description: '🚀 PREFERRED: Find a UI element by semantic properties (name, automationId, controlType). MUCH FASTER than screenshot analysis. Returns element bounds for clicking. Windows only.',
315
- schema: UIFindElementSchema,
316
- }));
317
- // ui_click_element
318
- tools.push(tool(createToolFunction(EDesktopTools.UI_CLICK_ELEMENT), {
319
- name: EDesktopTools.UI_CLICK_ELEMENT,
320
- description: '🚀 PREFERRED: Find and click a UI element by name/automationId. More reliable than coordinate-based clicking. Example: ui_click_element({name: "OK"}) or ui_click_element({controlType: "Button", name: "Submit"}). Windows only.',
321
- schema: UIClickElementSchema,
322
- }));
323
- // ui_get_window_tree
324
- tools.push(tool(createToolFunction(EDesktopTools.UI_GET_WINDOW_TREE), {
325
- name: EDesktopTools.UI_GET_WINDOW_TREE,
326
- description: 'Get the UI element tree of the active window. Shows all buttons, inputs, menus, etc. with their names and automationIds. Use this to discover elements before clicking. Windows only.',
327
- schema: UIGetWindowTreeSchema,
328
- }));
329
- // ui_find_buttons
330
- tools.push(tool(createToolFunction(EDesktopTools.UI_FIND_BUTTONS), {
331
- name: EDesktopTools.UI_FIND_BUTTONS,
332
- description: 'Find all clickable buttons in the active window. Returns list with names and positions. Useful for discovering available actions. Windows only.',
333
- schema: UIFindButtonsSchema,
334
- }));
335
- // ui_find_inputs
336
- tools.push(tool(createToolFunction(EDesktopTools.UI_FIND_INPUTS), {
337
- name: EDesktopTools.UI_FIND_INPUTS,
338
- description: 'Find all text input fields in the active window. Returns list with names and positions. Useful for discovering form fields. Windows only.',
339
- schema: UIFindInputsSchema,
340
- }));
341
- return tools;
342
- }
343
- /**
344
- * Get all desktop tool names
345
- */
346
- function getDesktopToolNames() {
347
- return Object.values(EDesktopTools);
348
- }
349
- /**
350
- * Check if a tool name is a desktop tool
351
- */
352
- function isDesktopTool(name) {
353
- return Object.values(EDesktopTools).includes(name);
354
- }
355
-
356
- export { EDesktopTools, createDesktopTools, getDesktopToolNames, hasDesktopCapability, isDesktopTool };
357
- //# sourceMappingURL=DesktopTools.mjs.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"DesktopTools.mjs","sources":["../../../src/tools/DesktopTools.ts"],"sourcesContent":["import { z } from 'zod';\r\nimport { tool, DynamicStructuredTool } from '@langchain/core/tools';\r\n\r\n/**\r\n * Desktop tool names - keep in sync with Ranger Desktop Electron app\r\n * These tools execute locally in the Electron app, NOT on the server\r\n */\r\nexport const EDesktopTools = {\r\n SCREENSHOT: 'computer_screenshot',\r\n CLICK: 'computer_click',\r\n DOUBLE_CLICK: 'computer_double_click',\r\n RIGHT_CLICK: 'computer_right_click',\r\n TYPE: 'computer_type',\r\n KEY: 'computer_key',\r\n KEY_COMBO: 'computer_key_combo',\r\n SCROLL: 'computer_scroll',\r\n DRAG: 'computer_drag',\r\n GET_ACTIVE_WINDOW: 'computer_get_active_window',\r\n GET_MOUSE_POSITION: 'computer_get_mouse_position',\r\n CLIPBOARD_READ: 'clipboard_read',\r\n CLIPBOARD_WRITE: 'clipboard_write',\r\n CLIPBOARD_PASTE: 'clipboard_paste',\r\n WAIT: 'computer_wait',\r\n // Native UI Automation tools (Windows) - faster and more reliable than screenshot-based\r\n UI_FIND_ELEMENT: 'ui_find_element',\r\n UI_CLICK_ELEMENT: 'ui_click_element',\r\n UI_GET_WINDOW_TREE: 'ui_get_window_tree',\r\n UI_FIND_BUTTONS: 'ui_find_buttons',\r\n UI_FIND_INPUTS: 'ui_find_inputs',\r\n} as const;\r\n\r\nexport type DesktopToolName =\r\n (typeof EDesktopTools)[keyof typeof EDesktopTools];\r\n\r\n/**\r\n * Callback function type for waiting on desktop action results\r\n * This allows the server (Ranger) to provide a callback that waits for the Electron app\r\n * to POST results back to the server before returning to the LLM.\r\n *\r\n * @param action - The desktop action (click, type, screenshot, etc.)\r\n * @param args - Arguments for the action\r\n * @param toolCallId - Unique ID for this tool call (from config.toolCall.id)\r\n * @returns Promise that resolves with the actual desktop result\r\n */\r\nexport type DesktopToolCallback = (\r\n action: string,\r\n args: Record<string, unknown>,\r\n toolCallId: string\r\n) => Promise<DesktopActionResult>;\r\n\r\n/**\r\n * Result returned from desktop action execution\r\n */\r\nexport interface DesktopActionResult {\r\n success: boolean;\r\n error?: string;\r\n screenshot?: {\r\n base64: string;\r\n width: number;\r\n height: number;\r\n };\r\n activeWindow?: {\r\n title: string;\r\n app: string;\r\n bounds?: { x: number; y: number; width: number; height: number };\r\n };\r\n mousePosition?: { x: number; y: number };\r\n clipboard?: string;\r\n // UI Automation results\r\n uiElement?: {\r\n name: string;\r\n automationId: string;\r\n controlType: string;\r\n boundingRectangle?: { x: number; y: number; width: number; height: number };\r\n isEnabled: boolean;\r\n };\r\n uiElements?: Array<{\r\n name: string;\r\n automationId: string;\r\n controlType: string;\r\n boundingRectangle?: { x: number; y: number; width: number; height: number };\r\n }>;\r\n uiTree?: unknown;\r\n // Generic data for extended results\r\n data?: unknown;\r\n}\r\n\r\n/**\r\n * Check if desktop capability is available based on request headers or context\r\n * The Ranger Desktop Electron app sets these headers when connected:\r\n * - X-Ranger-Desktop: true\r\n * - X-Ranger-Desktop-Capable: true\r\n */\r\nexport function hasDesktopCapability(req?: {\r\n headers?: Record<string, string | string[] | undefined>;\r\n}): boolean {\r\n if (!req?.headers) {\r\n return false;\r\n }\r\n\r\n const desktopApp = req.headers['x-ranger-desktop'];\r\n const desktopCapable = req.headers['x-ranger-desktop-capable'];\r\n\r\n return desktopApp === 'true' || desktopCapable === 'true';\r\n}\r\n\r\n// Tool schemas\r\nconst ScreenshotSchema = z.object({});\r\n\r\nconst ClickSchema = z.object({\r\n x: z.number().describe('X coordinate to click'),\r\n y: z.number().describe('Y coordinate to click'),\r\n});\r\n\r\nconst DoubleClickSchema = z.object({\r\n x: z.number().describe('X coordinate to double-click'),\r\n y: z.number().describe('Y coordinate to double-click'),\r\n});\r\n\r\nconst RightClickSchema = z.object({\r\n x: z.number().describe('X coordinate to right-click'),\r\n y: z.number().describe('Y coordinate to right-click'),\r\n});\r\n\r\nconst TypeSchema = z.object({\r\n text: z.string().describe('Text to type'),\r\n});\r\n\r\nconst KeySchema = z.object({\r\n key: z\r\n .string()\r\n .describe(\r\n 'Key to press (e.g., \"Enter\", \"Tab\", \"Escape\", \"Backspace\", \"Delete\", \"ArrowUp\", \"ArrowDown\", \"ArrowLeft\", \"ArrowRight\", \"Home\", \"End\", \"PageUp\", \"PageDown\", \"F1\"-\"F12\")'\r\n ),\r\n});\r\n\r\nconst KeyComboSchema = z.object({\r\n keys: z\r\n .array(z.string())\r\n .describe(\r\n 'Array of keys to press together (e.g., [\"Control\", \"c\"] for copy, [\"Alt\", \"Tab\"] for window switch)'\r\n ),\r\n});\r\n\r\nconst ScrollSchema = z.object({\r\n x: z.number().describe('X coordinate to scroll at'),\r\n y: z.number().describe('Y coordinate to scroll at'),\r\n deltaX: z.number().optional().describe('Horizontal scroll amount (pixels)'),\r\n deltaY: z.number().describe('Vertical scroll amount (pixels, negative = up, positive = down)'),\r\n});\r\n\r\nconst DragSchema = z.object({\r\n startX: z.number().describe('Starting X coordinate'),\r\n startY: z.number().describe('Starting Y coordinate'),\r\n endX: z.number().describe('Ending X coordinate'),\r\n endY: z.number().describe('Ending Y coordinate'),\r\n});\r\n\r\nconst GetActiveWindowSchema = z.object({});\r\n\r\nconst GetMousePositionSchema = z.object({});\r\n\r\nconst ClipboardReadSchema = z.object({});\r\n\r\nconst ClipboardWriteSchema = z.object({\r\n text: z.string().describe('Text to write to clipboard'),\r\n});\r\n\r\nconst ClipboardPasteSchema = z.object({});\r\n\r\nconst WaitSchema = z.object({\r\n ms: z.number().describe('Milliseconds to wait'),\r\n});\r\n\r\n// ============ Native UI Automation Schemas (Windows) ============\r\n\r\nconst UIFindElementSchema = z.object({\r\n name: z.string().optional().describe('Element name/label to find (e.g., \"Submit\", \"OK\", \"File\")'),\r\n automationId: z.string().optional().describe('Automation ID of element (unique identifier)'),\r\n controlType: z.string().optional().describe('Type of control: Button, Edit, Text, ComboBox, List, Menu, MenuItem, Window, etc.'),\r\n});\r\n\r\nconst UIClickElementSchema = z.object({\r\n name: z.string().optional().describe('Element name/label to click'),\r\n automationId: z.string().optional().describe('Automation ID of element to click'),\r\n controlType: z.string().optional().describe('Type of control: Button, Edit, etc.'),\r\n clickType: z.enum(['left', 'right', 'double']).optional().describe('Click type (default: left)'),\r\n});\r\n\r\nconst UIGetWindowTreeSchema = z.object({\r\n maxDepth: z.number().optional().describe('Maximum depth to traverse (default: 3)'),\r\n});\r\n\r\nconst UIFindButtonsSchema = z.object({});\r\n\r\nconst UIFindInputsSchema = z.object({});\r\n\r\n/**\r\n * Desktop tool response interface\r\n * This is what the Electron app returns after executing the action\r\n */\r\nexport interface DesktopToolResponse {\r\n requiresDesktopExecution: true;\r\n action: string;\r\n args: Record<string, unknown>;\r\n toolCallId?: string;\r\n}\r\n\r\n/**\r\n * Options for creating desktop tools\r\n */\r\nexport interface CreateDesktopToolsOptions {\r\n /**\r\n * Optional callback that waits for desktop action results.\r\n * When provided, tools will await this callback to get actual results from the Electron app.\r\n * When not provided, tools return markers immediately (for non-server contexts).\r\n */\r\n waitForResult?: DesktopToolCallback;\r\n}\r\n\r\n/**\r\n * Format desktop action result for LLM consumption\r\n */\r\nfunction formatResultForLLM(\r\n result: DesktopActionResult,\r\n action: string\r\n): string {\r\n if (!result.success && result.error) {\r\n return `Desktop action \"${action}\" failed: ${result.error}`;\r\n }\r\n\r\n const parts: string[] = [];\r\n\r\n if (result.screenshot) {\r\n parts.push(\r\n `Screenshot captured (${result.screenshot.width}x${result.screenshot.height})`\r\n );\r\n // The base64 image will be handled separately by the message formatter\r\n }\r\n\r\n if (result.activeWindow) {\r\n parts.push(`**Active Window:**`);\r\n parts.push(` - Title: ${result.activeWindow.title}`);\r\n parts.push(` - App: ${result.activeWindow.app}`);\r\n if (result.activeWindow.bounds) {\r\n const b = result.activeWindow.bounds;\r\n parts.push(` - Position: (${b.x}, ${b.y})`);\r\n parts.push(` - Size: ${b.width}x${b.height}`);\r\n }\r\n }\r\n\r\n if (result.mousePosition) {\r\n parts.push(\r\n `**Mouse Position:** (${result.mousePosition.x}, ${result.mousePosition.y})`\r\n );\r\n }\r\n\r\n if (result.clipboard !== undefined) {\r\n parts.push(`**Clipboard Content:** ${result.clipboard}`);\r\n }\r\n\r\n // UI Automation results\r\n if (result.uiElement) {\r\n const el = result.uiElement;\r\n parts.push(`**UI Element Found:**`);\r\n parts.push(` - Name: \"${el.name}\"`);\r\n parts.push(` - AutomationId: \"${el.automationId}\"`);\r\n parts.push(` - Type: ${el.controlType}`);\r\n if (el.boundingRectangle) {\r\n const b = el.boundingRectangle;\r\n parts.push(` - Bounds: (${b.x}, ${b.y}) ${b.width}x${b.height}`);\r\n parts.push(` - Center: (${Math.round(b.x + b.width/2)}, ${Math.round(b.y + b.height/2)})`);\r\n }\r\n parts.push(` - Enabled: ${el.isEnabled}`);\r\n }\r\n\r\n if (result.uiElements && result.uiElements.length > 0) {\r\n parts.push(`**UI Elements Found (${result.uiElements.length}):**`);\r\n for (const el of result.uiElements.slice(0, 20)) { // Limit to 20\r\n const bounds = el.boundingRectangle ? \r\n ` at (${el.boundingRectangle.x}, ${el.boundingRectangle.y})` : '';\r\n parts.push(` - [${el.controlType}] \"${el.name}\"${el.automationId ? ` (id: ${el.automationId})` : ''}${bounds}`);\r\n }\r\n if (result.uiElements.length > 20) {\r\n parts.push(` ... and ${result.uiElements.length - 20} more`);\r\n }\r\n }\r\n\r\n if (result.uiTree) {\r\n parts.push(`**UI Tree:**`);\r\n parts.push('```json');\r\n parts.push(JSON.stringify(result.uiTree, null, 2).slice(0, 3000)); // Limit size\r\n parts.push('```');\r\n }\r\n\r\n if (result.data && !result.uiElement && !result.uiElements && !result.uiTree) {\r\n // Generic data fallback\r\n parts.push(`**Result:**`);\r\n parts.push(JSON.stringify(result.data, null, 2).slice(0, 2000));\r\n }\r\n\r\n if (parts.length === 0) {\r\n parts.push(`Desktop action \"${action}\" completed successfully.`);\r\n }\r\n\r\n return parts.join('\\\\n');\r\n}\r\n\r\n/**\r\n * Create desktop automation tools for the agent\r\n * These tools allow AI to control the user's desktop when Ranger Desktop is running\r\n */\r\nexport function createDesktopTools(\r\n options: CreateDesktopToolsOptions = {}\r\n): DynamicStructuredTool[] {\r\n const { waitForResult } = options;\r\n const tools: DynamicStructuredTool[] = [];\r\n\r\n /**\r\n * Helper to create tool function that optionally waits for results\r\n * The toolCallId is extracted from the RunnableConfig passed by LangChain\r\n */\r\n const createToolFunction = (action: string) => {\r\n return async (\r\n args: Record<string, unknown>,\r\n config?: { toolCall?: { id?: string } }\r\n ): Promise<string> => {\r\n const toolCallId =\r\n config?.toolCall?.id ??\r\n `desktop_${Date.now()}_${Math.random().toString(36).slice(2)}`;\r\n\r\n // Create marker for Electron app\r\n const marker: DesktopToolResponse = {\r\n requiresDesktopExecution: true,\r\n action,\r\n args,\r\n toolCallId,\r\n };\r\n\r\n // If no callback, return marker immediately (Electron handles via SSE interception)\r\n if (!waitForResult) {\r\n return JSON.stringify(marker);\r\n }\r\n\r\n // With callback: wait for actual results from Electron app\r\n try {\r\n const result = await waitForResult(action, args, toolCallId);\r\n return formatResultForLLM(result, action);\r\n } catch (error) {\r\n const errorMessage =\r\n error instanceof Error ? error.message : String(error);\r\n return `Desktop action \"${action}\" failed: ${errorMessage}`;\r\n }\r\n };\r\n };\r\n\r\n // computer_screenshot\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.SCREENSHOT), {\r\n name: EDesktopTools.SCREENSHOT,\r\n description:\r\n 'Take a screenshot of the entire screen. Use this to see what is currently displayed on the desktop.',\r\n schema: ScreenshotSchema,\r\n })\r\n );\r\n\r\n // computer_click\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.CLICK), {\r\n name: EDesktopTools.CLICK,\r\n description:\r\n 'Click the mouse at the specified screen coordinates. Use screenshot first to identify the target location.',\r\n schema: ClickSchema,\r\n })\r\n );\r\n\r\n // computer_double_click\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.DOUBLE_CLICK), {\r\n name: EDesktopTools.DOUBLE_CLICK,\r\n description:\r\n 'Double-click the mouse at the specified screen coordinates.',\r\n schema: DoubleClickSchema,\r\n })\r\n );\r\n\r\n // computer_right_click\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.RIGHT_CLICK), {\r\n name: EDesktopTools.RIGHT_CLICK,\r\n description:\r\n 'Right-click the mouse at the specified screen coordinates to open context menus.',\r\n schema: RightClickSchema,\r\n })\r\n );\r\n\r\n // computer_type\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.TYPE), {\r\n name: EDesktopTools.TYPE,\r\n description:\r\n 'Type text using the keyboard. Make sure the target input field is focused first (use click).',\r\n schema: TypeSchema,\r\n })\r\n );\r\n\r\n // computer_key\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.KEY), {\r\n name: EDesktopTools.KEY,\r\n description:\r\n 'Press a single key on the keyboard (Enter, Tab, Escape, arrow keys, function keys, etc.).',\r\n schema: KeySchema,\r\n })\r\n );\r\n\r\n // computer_key_combo\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.KEY_COMBO), {\r\n name: EDesktopTools.KEY_COMBO,\r\n description:\r\n 'Press a key combination (e.g., Ctrl+C to copy, Ctrl+V to paste, Alt+Tab to switch windows).',\r\n schema: KeyComboSchema,\r\n })\r\n );\r\n\r\n // computer_scroll\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.SCROLL), {\r\n name: EDesktopTools.SCROLL,\r\n description:\r\n 'Scroll at the specified screen coordinates. Use negative deltaY to scroll up, positive to scroll down.',\r\n schema: ScrollSchema,\r\n })\r\n );\r\n\r\n // computer_drag\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.DRAG), {\r\n name: EDesktopTools.DRAG,\r\n description:\r\n 'Drag the mouse from one position to another (for moving windows, selecting text, etc.).',\r\n schema: DragSchema,\r\n })\r\n );\r\n\r\n // computer_get_active_window\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.GET_ACTIVE_WINDOW), {\r\n name: EDesktopTools.GET_ACTIVE_WINDOW,\r\n description:\r\n 'Get information about the currently active window (title, application name, position, size).',\r\n schema: GetActiveWindowSchema,\r\n })\r\n );\r\n\r\n // computer_get_mouse_position\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.GET_MOUSE_POSITION), {\r\n name: EDesktopTools.GET_MOUSE_POSITION,\r\n description: 'Get the current mouse cursor position on screen.',\r\n schema: GetMousePositionSchema,\r\n })\r\n );\r\n\r\n // clipboard_read\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.CLIPBOARD_READ), {\r\n name: EDesktopTools.CLIPBOARD_READ,\r\n description: 'Read the current contents of the system clipboard.',\r\n schema: ClipboardReadSchema,\r\n })\r\n );\r\n\r\n // clipboard_write\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.CLIPBOARD_WRITE), {\r\n name: EDesktopTools.CLIPBOARD_WRITE,\r\n description: 'Write text to the system clipboard.',\r\n schema: ClipboardWriteSchema,\r\n })\r\n );\r\n\r\n // clipboard_paste\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.CLIPBOARD_PASTE), {\r\n name: EDesktopTools.CLIPBOARD_PASTE,\r\n description:\r\n 'Paste the clipboard contents (equivalent to Ctrl+V). Use clipboard_write first to set the content.',\r\n schema: ClipboardPasteSchema,\r\n })\r\n );\r\n\r\n // computer_wait\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.WAIT), {\r\n name: EDesktopTools.WAIT,\r\n description:\r\n 'Wait for the specified number of milliseconds. Use this to wait for UI animations or loading.',\r\n schema: WaitSchema,\r\n })\r\n );\r\n\r\n // ============ Native UI Automation Tools (Windows) ============\r\n // These are FASTER and MORE RELIABLE than screenshot-based automation\r\n // They find elements by semantic properties (name, automationId, type)\r\n // instead of relying on pixel coordinates from screenshots\r\n\r\n // ui_find_element\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.UI_FIND_ELEMENT), {\r\n name: EDesktopTools.UI_FIND_ELEMENT,\r\n description:\r\n '🚀 PREFERRED: Find a UI element by semantic properties (name, automationId, controlType). MUCH FASTER than screenshot analysis. Returns element bounds for clicking. Windows only.',\r\n schema: UIFindElementSchema,\r\n })\r\n );\r\n\r\n // ui_click_element\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.UI_CLICK_ELEMENT), {\r\n name: EDesktopTools.UI_CLICK_ELEMENT,\r\n description:\r\n '🚀 PREFERRED: Find and click a UI element by name/automationId. More reliable than coordinate-based clicking. Example: ui_click_element({name: \"OK\"}) or ui_click_element({controlType: \"Button\", name: \"Submit\"}). Windows only.',\r\n schema: UIClickElementSchema,\r\n })\r\n );\r\n\r\n // ui_get_window_tree\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.UI_GET_WINDOW_TREE), {\r\n name: EDesktopTools.UI_GET_WINDOW_TREE,\r\n description:\r\n 'Get the UI element tree of the active window. Shows all buttons, inputs, menus, etc. with their names and automationIds. Use this to discover elements before clicking. Windows only.',\r\n schema: UIGetWindowTreeSchema,\r\n })\r\n );\r\n\r\n // ui_find_buttons\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.UI_FIND_BUTTONS), {\r\n name: EDesktopTools.UI_FIND_BUTTONS,\r\n description:\r\n 'Find all clickable buttons in the active window. Returns list with names and positions. Useful for discovering available actions. Windows only.',\r\n schema: UIFindButtonsSchema,\r\n })\r\n );\r\n\r\n // ui_find_inputs\r\n tools.push(\r\n tool(createToolFunction(EDesktopTools.UI_FIND_INPUTS), {\r\n name: EDesktopTools.UI_FIND_INPUTS,\r\n description:\r\n 'Find all text input fields in the active window. Returns list with names and positions. Useful for discovering form fields. Windows only.',\r\n schema: UIFindInputsSchema,\r\n })\r\n );\r\n\r\n return tools;\r\n}\r\n\r\n/**\r\n * Get all desktop tool names\r\n */\r\nexport function getDesktopToolNames(): DesktopToolName[] {\r\n return Object.values(EDesktopTools);\r\n}\r\n\r\n/**\r\n * Check if a tool name is a desktop tool\r\n */\r\nexport function isDesktopTool(name: string): name is DesktopToolName {\r\n return Object.values(EDesktopTools).includes(name as DesktopToolName);\r\n}\r\n"],"names":[],"mappings":";;;AAGA;;;AAGG;AACU,MAAA,aAAa,GAAG;AAC3B,IAAA,UAAU,EAAE,qBAAqB;AACjC,IAAA,KAAK,EAAE,gBAAgB;AACvB,IAAA,YAAY,EAAE,uBAAuB;AACrC,IAAA,WAAW,EAAE,sBAAsB;AACnC,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,GAAG,EAAE,cAAc;AACnB,IAAA,SAAS,EAAE,oBAAoB;AAC/B,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,IAAI,EAAE,eAAe;AACrB,IAAA,iBAAiB,EAAE,4BAA4B;AAC/C,IAAA,kBAAkB,EAAE,6BAA6B;AACjD,IAAA,cAAc,EAAE,gBAAgB;AAChC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,IAAI,EAAE,eAAe;;AAErB,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,gBAAgB,EAAE,kBAAkB;AACpC,IAAA,kBAAkB,EAAE,oBAAoB;AACxC,IAAA,eAAe,EAAE,iBAAiB;AAClC,IAAA,cAAc,EAAE,gBAAgB;;AA2DlC;;;;;AAKG;AACG,SAAU,oBAAoB,CAAC,GAEpC,EAAA;AACC,IAAA,IAAI,CAAC,GAAG,EAAE,OAAO,EAAE;AACjB,QAAA,OAAO,KAAK;;IAGd,MAAM,UAAU,GAAG,GAAG,CAAC,OAAO,CAAC,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C,MAAM,CAAC,aAAa,CAAC;AACrC;AAEA;;AAEG;AACG,SAAU,aAAa,CAAC,IAAY,EAAA;IACxC,OAAO,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,QAAQ,CAAC,IAAuB,CAAC;AACvE;;;;"}
@@ -1,134 +0,0 @@
1
- import { DynamicStructuredTool } from '@langchain/core/tools';
2
- /**
3
- * Desktop tool names - keep in sync with Ranger Desktop Electron app
4
- * These tools execute locally in the Electron app, NOT on the server
5
- */
6
- export declare const EDesktopTools: {
7
- readonly SCREENSHOT: "computer_screenshot";
8
- readonly CLICK: "computer_click";
9
- readonly DOUBLE_CLICK: "computer_double_click";
10
- readonly RIGHT_CLICK: "computer_right_click";
11
- readonly TYPE: "computer_type";
12
- readonly KEY: "computer_key";
13
- readonly KEY_COMBO: "computer_key_combo";
14
- readonly SCROLL: "computer_scroll";
15
- readonly DRAG: "computer_drag";
16
- readonly GET_ACTIVE_WINDOW: "computer_get_active_window";
17
- readonly GET_MOUSE_POSITION: "computer_get_mouse_position";
18
- readonly CLIPBOARD_READ: "clipboard_read";
19
- readonly CLIPBOARD_WRITE: "clipboard_write";
20
- readonly CLIPBOARD_PASTE: "clipboard_paste";
21
- readonly WAIT: "computer_wait";
22
- readonly UI_FIND_ELEMENT: "ui_find_element";
23
- readonly UI_CLICK_ELEMENT: "ui_click_element";
24
- readonly UI_GET_WINDOW_TREE: "ui_get_window_tree";
25
- readonly UI_FIND_BUTTONS: "ui_find_buttons";
26
- readonly UI_FIND_INPUTS: "ui_find_inputs";
27
- };
28
- export type DesktopToolName = (typeof EDesktopTools)[keyof typeof EDesktopTools];
29
- /**
30
- * Callback function type for waiting on desktop action results
31
- * This allows the server (Ranger) to provide a callback that waits for the Electron app
32
- * to POST results back to the server before returning to the LLM.
33
- *
34
- * @param action - The desktop action (click, type, screenshot, etc.)
35
- * @param args - Arguments for the action
36
- * @param toolCallId - Unique ID for this tool call (from config.toolCall.id)
37
- * @returns Promise that resolves with the actual desktop result
38
- */
39
- export type DesktopToolCallback = (action: string, args: Record<string, unknown>, toolCallId: string) => Promise<DesktopActionResult>;
40
- /**
41
- * Result returned from desktop action execution
42
- */
43
- export interface DesktopActionResult {
44
- success: boolean;
45
- error?: string;
46
- screenshot?: {
47
- base64: string;
48
- width: number;
49
- height: number;
50
- };
51
- activeWindow?: {
52
- title: string;
53
- app: string;
54
- bounds?: {
55
- x: number;
56
- y: number;
57
- width: number;
58
- height: number;
59
- };
60
- };
61
- mousePosition?: {
62
- x: number;
63
- y: number;
64
- };
65
- clipboard?: string;
66
- uiElement?: {
67
- name: string;
68
- automationId: string;
69
- controlType: string;
70
- boundingRectangle?: {
71
- x: number;
72
- y: number;
73
- width: number;
74
- height: number;
75
- };
76
- isEnabled: boolean;
77
- };
78
- uiElements?: Array<{
79
- name: string;
80
- automationId: string;
81
- controlType: string;
82
- boundingRectangle?: {
83
- x: number;
84
- y: number;
85
- width: number;
86
- height: number;
87
- };
88
- }>;
89
- uiTree?: unknown;
90
- data?: unknown;
91
- }
92
- /**
93
- * Check if desktop capability is available based on request headers or context
94
- * The Ranger Desktop Electron app sets these headers when connected:
95
- * - X-Ranger-Desktop: true
96
- * - X-Ranger-Desktop-Capable: true
97
- */
98
- export declare function hasDesktopCapability(req?: {
99
- headers?: Record<string, string | string[] | undefined>;
100
- }): boolean;
101
- /**
102
- * Desktop tool response interface
103
- * This is what the Electron app returns after executing the action
104
- */
105
- export interface DesktopToolResponse {
106
- requiresDesktopExecution: true;
107
- action: string;
108
- args: Record<string, unknown>;
109
- toolCallId?: string;
110
- }
111
- /**
112
- * Options for creating desktop tools
113
- */
114
- export interface CreateDesktopToolsOptions {
115
- /**
116
- * Optional callback that waits for desktop action results.
117
- * When provided, tools will await this callback to get actual results from the Electron app.
118
- * When not provided, tools return markers immediately (for non-server contexts).
119
- */
120
- waitForResult?: DesktopToolCallback;
121
- }
122
- /**
123
- * Create desktop automation tools for the agent
124
- * These tools allow AI to control the user's desktop when Ranger Desktop is running
125
- */
126
- export declare function createDesktopTools(options?: CreateDesktopToolsOptions): DynamicStructuredTool[];
127
- /**
128
- * Get all desktop tool names
129
- */
130
- export declare function getDesktopToolNames(): DesktopToolName[];
131
- /**
132
- * Check if a tool name is a desktop tool
133
- */
134
- export declare function isDesktopTool(name: string): name is DesktopToolName;