@eko-ai/eko 1.0.3 → 1.0.4
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/core/eko.d.ts +1 -1
- package/dist/extension/index.d.ts +2 -0
- package/dist/extension.cjs.js +80 -0
- package/dist/extension.esm.js +80 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.esm.js +1 -1
- package/dist/web/index.d.ts +2 -0
- package/dist/web.cjs.js +16 -0
- package/dist/web.esm.js +16 -1
- package/package.json +1 -1
package/dist/core/eko.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export declare class Eko {
|
|
|
8
8
|
private toolRegistry;
|
|
9
9
|
constructor(config: EkoConfig);
|
|
10
10
|
generateWorkflow(prompt: string, param?: EkoInvokeParam): Promise<Workflow>;
|
|
11
|
-
|
|
11
|
+
execute(workflow: Workflow, callback?: WorkflowCallback): Promise<void>;
|
|
12
12
|
private getTool;
|
|
13
13
|
callTool(toolName: string, input: object, callback?: WorkflowCallback): Promise<any>;
|
|
14
14
|
callTool(tool: Tool<any, any>, input: object, callback?: WorkflowCallback): Promise<any>;
|
package/dist/extension.cjs.js
CHANGED
|
@@ -235,6 +235,17 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
235
235
|
waitForTabComplete: waitForTabComplete
|
|
236
236
|
});
|
|
237
237
|
|
|
238
|
+
async function type(tabId, text, coordinate) {
|
|
239
|
+
if (!coordinate) {
|
|
240
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
241
|
+
}
|
|
242
|
+
await mouse_move(tabId, coordinate);
|
|
243
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
244
|
+
type: 'computer:type',
|
|
245
|
+
text,
|
|
246
|
+
coordinate,
|
|
247
|
+
});
|
|
248
|
+
}
|
|
238
249
|
async function type_by(tabId, text, xpath, highlightIndex) {
|
|
239
250
|
return await chrome.tabs.sendMessage(tabId, {
|
|
240
251
|
type: 'computer:type',
|
|
@@ -243,6 +254,17 @@ async function type_by(tabId, text, xpath, highlightIndex) {
|
|
|
243
254
|
highlightIndex,
|
|
244
255
|
});
|
|
245
256
|
}
|
|
257
|
+
async function clear_input(tabId, coordinate) {
|
|
258
|
+
if (!coordinate) {
|
|
259
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
260
|
+
}
|
|
261
|
+
await mouse_move(tabId, coordinate);
|
|
262
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
263
|
+
type: 'computer:type',
|
|
264
|
+
text: '',
|
|
265
|
+
coordinate,
|
|
266
|
+
});
|
|
267
|
+
}
|
|
246
268
|
async function clear_input_by(tabId, xpath, highlightIndex) {
|
|
247
269
|
return await chrome.tabs.sendMessage(tabId, {
|
|
248
270
|
type: 'computer:type',
|
|
@@ -251,6 +273,12 @@ async function clear_input_by(tabId, xpath, highlightIndex) {
|
|
|
251
273
|
highlightIndex,
|
|
252
274
|
});
|
|
253
275
|
}
|
|
276
|
+
async function mouse_move(tabId, coordinate) {
|
|
277
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
278
|
+
type: 'computer:mouse_move',
|
|
279
|
+
coordinate,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
254
282
|
async function left_click(tabId, coordinate) {
|
|
255
283
|
if (!coordinate) {
|
|
256
284
|
coordinate = (await cursor_position(tabId)).coordinate;
|
|
@@ -267,6 +295,15 @@ async function left_click_by(tabId, xpath, highlightIndex) {
|
|
|
267
295
|
highlightIndex,
|
|
268
296
|
});
|
|
269
297
|
}
|
|
298
|
+
async function right_click(tabId, coordinate) {
|
|
299
|
+
if (!coordinate) {
|
|
300
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
301
|
+
}
|
|
302
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
303
|
+
type: 'computer:right_click',
|
|
304
|
+
coordinate,
|
|
305
|
+
});
|
|
306
|
+
}
|
|
270
307
|
async function right_click_by(tabId, xpath, highlightIndex) {
|
|
271
308
|
return await chrome.tabs.sendMessage(tabId, {
|
|
272
309
|
type: 'computer:right_click',
|
|
@@ -274,6 +311,15 @@ async function right_click_by(tabId, xpath, highlightIndex) {
|
|
|
274
311
|
highlightIndex,
|
|
275
312
|
});
|
|
276
313
|
}
|
|
314
|
+
async function double_click(tabId, coordinate) {
|
|
315
|
+
if (!coordinate) {
|
|
316
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
317
|
+
}
|
|
318
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
319
|
+
type: 'computer:double_click',
|
|
320
|
+
coordinate,
|
|
321
|
+
});
|
|
322
|
+
}
|
|
277
323
|
async function double_click_by(tabId, xpath, highlightIndex) {
|
|
278
324
|
return await chrome.tabs.sendMessage(tabId, {
|
|
279
325
|
type: 'computer:double_click',
|
|
@@ -295,6 +341,14 @@ async function screenshot(windowId) {
|
|
|
295
341
|
},
|
|
296
342
|
};
|
|
297
343
|
}
|
|
344
|
+
async function scroll_to(tabId, coordinate) {
|
|
345
|
+
let from_coordinate = (await cursor_position(tabId)).coordinate;
|
|
346
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
347
|
+
type: 'computer:scroll_to',
|
|
348
|
+
from_coordinate,
|
|
349
|
+
to_coordinate: coordinate,
|
|
350
|
+
});
|
|
351
|
+
}
|
|
298
352
|
async function scroll_to_by(tabId, xpath, highlightIndex) {
|
|
299
353
|
return await chrome.tabs.sendMessage(tabId, {
|
|
300
354
|
type: 'computer:scroll_to',
|
|
@@ -323,6 +377,31 @@ async function cursor_position(tabId) {
|
|
|
323
377
|
});
|
|
324
378
|
return { coordinate: result.coordinate };
|
|
325
379
|
}
|
|
380
|
+
async function size(tabId) {
|
|
381
|
+
return await getPageSize(tabId);
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
var browser = /*#__PURE__*/Object.freeze({
|
|
385
|
+
__proto__: null,
|
|
386
|
+
clear_input: clear_input,
|
|
387
|
+
clear_input_by: clear_input_by,
|
|
388
|
+
cursor_position: cursor_position,
|
|
389
|
+
double_click: double_click,
|
|
390
|
+
double_click_by: double_click_by,
|
|
391
|
+
get_dropdown_options: get_dropdown_options,
|
|
392
|
+
left_click: left_click,
|
|
393
|
+
left_click_by: left_click_by,
|
|
394
|
+
mouse_move: mouse_move,
|
|
395
|
+
right_click: right_click,
|
|
396
|
+
right_click_by: right_click_by,
|
|
397
|
+
screenshot: screenshot,
|
|
398
|
+
scroll_to: scroll_to,
|
|
399
|
+
scroll_to_by: scroll_to_by,
|
|
400
|
+
select_dropdown_option: select_dropdown_option,
|
|
401
|
+
size: size,
|
|
402
|
+
type: type,
|
|
403
|
+
type_by: type_by
|
|
404
|
+
});
|
|
326
405
|
|
|
327
406
|
/**
|
|
328
407
|
* Browser Use for general
|
|
@@ -1601,6 +1680,7 @@ function getAllTools() {
|
|
|
1601
1680
|
return toolsMap;
|
|
1602
1681
|
}
|
|
1603
1682
|
|
|
1683
|
+
exports.browser = browser;
|
|
1604
1684
|
exports.getAllTools = getAllTools;
|
|
1605
1685
|
exports.getLLMConfig = getLLMConfig;
|
|
1606
1686
|
exports.pub = pub;
|
package/dist/extension.esm.js
CHANGED
|
@@ -233,6 +233,17 @@ var utils = /*#__PURE__*/Object.freeze({
|
|
|
233
233
|
waitForTabComplete: waitForTabComplete
|
|
234
234
|
});
|
|
235
235
|
|
|
236
|
+
async function type(tabId, text, coordinate) {
|
|
237
|
+
if (!coordinate) {
|
|
238
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
239
|
+
}
|
|
240
|
+
await mouse_move(tabId, coordinate);
|
|
241
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
242
|
+
type: 'computer:type',
|
|
243
|
+
text,
|
|
244
|
+
coordinate,
|
|
245
|
+
});
|
|
246
|
+
}
|
|
236
247
|
async function type_by(tabId, text, xpath, highlightIndex) {
|
|
237
248
|
return await chrome.tabs.sendMessage(tabId, {
|
|
238
249
|
type: 'computer:type',
|
|
@@ -241,6 +252,17 @@ async function type_by(tabId, text, xpath, highlightIndex) {
|
|
|
241
252
|
highlightIndex,
|
|
242
253
|
});
|
|
243
254
|
}
|
|
255
|
+
async function clear_input(tabId, coordinate) {
|
|
256
|
+
if (!coordinate) {
|
|
257
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
258
|
+
}
|
|
259
|
+
await mouse_move(tabId, coordinate);
|
|
260
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
261
|
+
type: 'computer:type',
|
|
262
|
+
text: '',
|
|
263
|
+
coordinate,
|
|
264
|
+
});
|
|
265
|
+
}
|
|
244
266
|
async function clear_input_by(tabId, xpath, highlightIndex) {
|
|
245
267
|
return await chrome.tabs.sendMessage(tabId, {
|
|
246
268
|
type: 'computer:type',
|
|
@@ -249,6 +271,12 @@ async function clear_input_by(tabId, xpath, highlightIndex) {
|
|
|
249
271
|
highlightIndex,
|
|
250
272
|
});
|
|
251
273
|
}
|
|
274
|
+
async function mouse_move(tabId, coordinate) {
|
|
275
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
276
|
+
type: 'computer:mouse_move',
|
|
277
|
+
coordinate,
|
|
278
|
+
});
|
|
279
|
+
}
|
|
252
280
|
async function left_click(tabId, coordinate) {
|
|
253
281
|
if (!coordinate) {
|
|
254
282
|
coordinate = (await cursor_position(tabId)).coordinate;
|
|
@@ -265,6 +293,15 @@ async function left_click_by(tabId, xpath, highlightIndex) {
|
|
|
265
293
|
highlightIndex,
|
|
266
294
|
});
|
|
267
295
|
}
|
|
296
|
+
async function right_click(tabId, coordinate) {
|
|
297
|
+
if (!coordinate) {
|
|
298
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
299
|
+
}
|
|
300
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
301
|
+
type: 'computer:right_click',
|
|
302
|
+
coordinate,
|
|
303
|
+
});
|
|
304
|
+
}
|
|
268
305
|
async function right_click_by(tabId, xpath, highlightIndex) {
|
|
269
306
|
return await chrome.tabs.sendMessage(tabId, {
|
|
270
307
|
type: 'computer:right_click',
|
|
@@ -272,6 +309,15 @@ async function right_click_by(tabId, xpath, highlightIndex) {
|
|
|
272
309
|
highlightIndex,
|
|
273
310
|
});
|
|
274
311
|
}
|
|
312
|
+
async function double_click(tabId, coordinate) {
|
|
313
|
+
if (!coordinate) {
|
|
314
|
+
coordinate = (await cursor_position(tabId)).coordinate;
|
|
315
|
+
}
|
|
316
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
317
|
+
type: 'computer:double_click',
|
|
318
|
+
coordinate,
|
|
319
|
+
});
|
|
320
|
+
}
|
|
275
321
|
async function double_click_by(tabId, xpath, highlightIndex) {
|
|
276
322
|
return await chrome.tabs.sendMessage(tabId, {
|
|
277
323
|
type: 'computer:double_click',
|
|
@@ -293,6 +339,14 @@ async function screenshot(windowId) {
|
|
|
293
339
|
},
|
|
294
340
|
};
|
|
295
341
|
}
|
|
342
|
+
async function scroll_to(tabId, coordinate) {
|
|
343
|
+
let from_coordinate = (await cursor_position(tabId)).coordinate;
|
|
344
|
+
return await chrome.tabs.sendMessage(tabId, {
|
|
345
|
+
type: 'computer:scroll_to',
|
|
346
|
+
from_coordinate,
|
|
347
|
+
to_coordinate: coordinate,
|
|
348
|
+
});
|
|
349
|
+
}
|
|
296
350
|
async function scroll_to_by(tabId, xpath, highlightIndex) {
|
|
297
351
|
return await chrome.tabs.sendMessage(tabId, {
|
|
298
352
|
type: 'computer:scroll_to',
|
|
@@ -321,6 +375,31 @@ async function cursor_position(tabId) {
|
|
|
321
375
|
});
|
|
322
376
|
return { coordinate: result.coordinate };
|
|
323
377
|
}
|
|
378
|
+
async function size(tabId) {
|
|
379
|
+
return await getPageSize(tabId);
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
var browser = /*#__PURE__*/Object.freeze({
|
|
383
|
+
__proto__: null,
|
|
384
|
+
clear_input: clear_input,
|
|
385
|
+
clear_input_by: clear_input_by,
|
|
386
|
+
cursor_position: cursor_position,
|
|
387
|
+
double_click: double_click,
|
|
388
|
+
double_click_by: double_click_by,
|
|
389
|
+
get_dropdown_options: get_dropdown_options,
|
|
390
|
+
left_click: left_click,
|
|
391
|
+
left_click_by: left_click_by,
|
|
392
|
+
mouse_move: mouse_move,
|
|
393
|
+
right_click: right_click,
|
|
394
|
+
right_click_by: right_click_by,
|
|
395
|
+
screenshot: screenshot,
|
|
396
|
+
scroll_to: scroll_to,
|
|
397
|
+
scroll_to_by: scroll_to_by,
|
|
398
|
+
select_dropdown_option: select_dropdown_option,
|
|
399
|
+
size: size,
|
|
400
|
+
type: type,
|
|
401
|
+
type_by: type_by
|
|
402
|
+
});
|
|
324
403
|
|
|
325
404
|
/**
|
|
326
405
|
* Browser Use for general
|
|
@@ -1599,4 +1678,4 @@ function getAllTools() {
|
|
|
1599
1678
|
return toolsMap;
|
|
1600
1679
|
}
|
|
1601
1680
|
|
|
1602
|
-
export { getAllTools, getLLMConfig, pub, tools, utils };
|
|
1681
|
+
export { browser, getAllTools, getLLMConfig, pub, tools, utils };
|
package/dist/index.cjs.js
CHANGED
|
@@ -9103,7 +9103,7 @@ class Eko {
|
|
|
9103
9103
|
const generator = new WorkflowGenerator(this.llmProvider, toolRegistry);
|
|
9104
9104
|
return await generator.generateWorkflow(prompt);
|
|
9105
9105
|
}
|
|
9106
|
-
async
|
|
9106
|
+
async execute(workflow, callback) {
|
|
9107
9107
|
return await workflow.execute(callback);
|
|
9108
9108
|
}
|
|
9109
9109
|
getTool(toolName) {
|
package/dist/index.esm.js
CHANGED
|
@@ -9099,7 +9099,7 @@ class Eko {
|
|
|
9099
9099
|
const generator = new WorkflowGenerator(this.llmProvider, toolRegistry);
|
|
9100
9100
|
return await generator.generateWorkflow(prompt);
|
|
9101
9101
|
}
|
|
9102
|
-
async
|
|
9102
|
+
async execute(workflow, callback) {
|
|
9103
9103
|
return await workflow.execute(callback);
|
|
9104
9104
|
}
|
|
9105
9105
|
getTool(toolName) {
|
package/dist/web/index.d.ts
CHANGED
package/dist/web.cjs.js
CHANGED
|
@@ -8627,6 +8627,21 @@ function simulateMouseEvent(eventTypes, button, xpath, highlightIndex) {
|
|
|
8627
8627
|
return true;
|
|
8628
8628
|
}
|
|
8629
8629
|
|
|
8630
|
+
var browser = /*#__PURE__*/Object.freeze({
|
|
8631
|
+
__proto__: null,
|
|
8632
|
+
clear_input: clear_input,
|
|
8633
|
+
double_click: double_click,
|
|
8634
|
+
extractHtmlContent: extractHtmlContent,
|
|
8635
|
+
get_dropdown_options: get_dropdown_options,
|
|
8636
|
+
left_click: left_click,
|
|
8637
|
+
right_click: right_click,
|
|
8638
|
+
screenshot: screenshot,
|
|
8639
|
+
scroll_to: scroll_to,
|
|
8640
|
+
select_dropdown_option: select_dropdown_option,
|
|
8641
|
+
size: size,
|
|
8642
|
+
type: type
|
|
8643
|
+
});
|
|
8644
|
+
|
|
8630
8645
|
/**
|
|
8631
8646
|
* Browser Use for general
|
|
8632
8647
|
*/
|
|
@@ -9377,5 +9392,6 @@ function getAllTools() {
|
|
|
9377
9392
|
return toolsMap;
|
|
9378
9393
|
}
|
|
9379
9394
|
|
|
9395
|
+
exports.browser = browser;
|
|
9380
9396
|
exports.getAllTools = getAllTools;
|
|
9381
9397
|
exports.tools = tools;
|
package/dist/web.esm.js
CHANGED
|
@@ -8625,6 +8625,21 @@ function simulateMouseEvent(eventTypes, button, xpath, highlightIndex) {
|
|
|
8625
8625
|
return true;
|
|
8626
8626
|
}
|
|
8627
8627
|
|
|
8628
|
+
var browser = /*#__PURE__*/Object.freeze({
|
|
8629
|
+
__proto__: null,
|
|
8630
|
+
clear_input: clear_input,
|
|
8631
|
+
double_click: double_click,
|
|
8632
|
+
extractHtmlContent: extractHtmlContent,
|
|
8633
|
+
get_dropdown_options: get_dropdown_options,
|
|
8634
|
+
left_click: left_click,
|
|
8635
|
+
right_click: right_click,
|
|
8636
|
+
screenshot: screenshot,
|
|
8637
|
+
scroll_to: scroll_to,
|
|
8638
|
+
select_dropdown_option: select_dropdown_option,
|
|
8639
|
+
size: size,
|
|
8640
|
+
type: type
|
|
8641
|
+
});
|
|
8642
|
+
|
|
8628
8643
|
/**
|
|
8629
8644
|
* Browser Use for general
|
|
8630
8645
|
*/
|
|
@@ -9375,4 +9390,4 @@ function getAllTools() {
|
|
|
9375
9390
|
return toolsMap;
|
|
9376
9391
|
}
|
|
9377
9392
|
|
|
9378
|
-
export { getAllTools, tools };
|
|
9393
|
+
export { browser, getAllTools, tools };
|