@eko-ai/eko 1.2.5 → 1.3.1

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,10 +1,10 @@
1
- import { BrowserUseParam, BrowserUseResult } from '../../types/tools.types';
1
+ import { BrowserActionParam, BrowserActionResult } from '../../types/tools.types';
2
2
  import { InputSchema, ExecutionContext } from '../../types/action.types';
3
3
  import { ToolReturnsScreenshot } from './tool_returns_screenshot';
4
4
  /**
5
5
  * Browser Use for general
6
6
  */
7
- export declare class BrowserUse extends ToolReturnsScreenshot<BrowserUseParam> {
7
+ export declare class BrowserAction extends ToolReturnsScreenshot<BrowserActionParam> {
8
8
  name: string;
9
9
  description: string;
10
10
  input_schema: InputSchema;
@@ -15,6 +15,6 @@ export declare class BrowserUse extends ToolReturnsScreenshot<BrowserUseParam> {
15
15
  * @param {*} params { action: 'input_text', index: 1, text: 'string' }
16
16
  * @returns > { success: true, image?: { type: 'base64', media_type: 'image/jpeg', data: '/9j...' }, text?: string }
17
17
  */
18
- realExecute(context: ExecutionContext, params: BrowserUseParam): Promise<BrowserUseResult>;
18
+ realExecute(context: ExecutionContext, params: BrowserActionParam): Promise<BrowserActionResult>;
19
19
  destroy(context: ExecutionContext): void;
20
20
  }
@@ -1,4 +1,4 @@
1
- import { BrowserUse } from './browser_use';
1
+ import { BrowserAction } from './browser_action';
2
2
  import { ExportFile } from './export_file';
3
3
  import { ExtractContent } from './extract_content';
4
4
  import { GetAllTabs } from './get_all_tabs';
@@ -9,4 +9,4 @@ import { WebSearch } from './web_search';
9
9
  import { RequestLogin } from './request_login';
10
10
  import { SwitchTab } from './switch_tab';
11
11
  export * from '../../common/tools';
12
- export { BrowserUse, ExportFile, ExtractContent, OpenUrl, GetAllTabs, Screenshot, TabManagement, WebSearch, RequestLogin, SwitchTab, };
12
+ export { BrowserAction, ExportFile, ExtractContent, OpenUrl, GetAllTabs, Screenshot, TabManagement, WebSearch, RequestLogin, SwitchTab, };
@@ -1,8 +1,8 @@
1
- import { BrowserUseResult, ExecutionContext, InputSchema, Tool } from "@/types";
2
- export declare abstract class ToolReturnsScreenshot<T> implements Tool<T, BrowserUseResult> {
1
+ import { BrowserActionResult, ExecutionContext, InputSchema, Tool } from "@/types";
2
+ export declare abstract class ToolReturnsScreenshot<T> implements Tool<T, BrowserActionResult> {
3
3
  abstract name: string;
4
4
  abstract description: string;
5
5
  abstract input_schema: InputSchema;
6
6
  abstract realExecute(context: ExecutionContext, params: T): Promise<any>;
7
- execute(context: ExecutionContext, params: T): Promise<BrowserUseResult>;
7
+ execute(context: ExecutionContext, params: T): Promise<BrowserActionResult>;
8
8
  }
@@ -696,7 +696,7 @@ async function getTabId(context) {
696
696
  }
697
697
  if (!tabId) {
698
698
  const fellouTabId = window.__FELLOU_TAB_ID__;
699
- if (tabId) {
699
+ if (fellouTabId) {
700
700
  tabId = fellouTabId;
701
701
  }
702
702
  else {
@@ -1405,7 +1405,7 @@ class ToolReturnsScreenshot {
1405
1405
  logger.debug("debug realResult...");
1406
1406
  logger.debug(realResult);
1407
1407
  await sleep(3000); // wait for page loding
1408
- let instance = new BrowserUse();
1408
+ let instance = new BrowserAction();
1409
1409
  const image = await instance.realExecute(context, { action: "screenshot_extract_element" });
1410
1410
  return image;
1411
1411
  }
@@ -1414,10 +1414,10 @@ class ToolReturnsScreenshot {
1414
1414
  /**
1415
1415
  * Browser Use for general
1416
1416
  */
1417
- class BrowserUse extends ToolReturnsScreenshot {
1417
+ class BrowserAction extends ToolReturnsScreenshot {
1418
1418
  constructor() {
1419
1419
  super();
1420
- this.name = 'browser_use';
1420
+ this.name = 'browser_action';
1421
1421
  this.description = `Use structured commands to interact with the browser, manipulating page elements through screenshots and webpage element extraction.
1422
1422
  * This is a browser GUI interface where you need to analyze webpages by taking screenshots and extracting page element structures, and specify action sequences to complete designated tasks.
1423
1423
  * Before any operation, you must first call the \`screenshot_extract_element\` command, which will return the browser page screenshot and structured element information, both specially processed.
@@ -1481,7 +1481,7 @@ class BrowserUse extends ToolReturnsScreenshot {
1481
1481
  */
1482
1482
  async realExecute(context, params) {
1483
1483
  var _a;
1484
- logger.debug("debug 'browser_use'...");
1484
+ logger.debug("debug 'browser_action'...");
1485
1485
  logger.debug(params);
1486
1486
  try {
1487
1487
  if (params === null || !params.action) {
@@ -1606,7 +1606,7 @@ class BrowserUse extends ToolReturnsScreenshot {
1606
1606
  default:
1607
1607
  throw Error(`Invalid parameters. The "${params.action}" value is not included in the "action" enumeration.`);
1608
1608
  }
1609
- logger.debug(`execute 'browser_use'...done, result=${result}`);
1609
+ logger.debug(`execute 'browser_action'...done, result=${result}`);
1610
1610
  return result;
1611
1611
  }
1612
1612
  catch (e) {
@@ -2755,7 +2755,7 @@ class DocumentAgentTool {
2755
2755
 
2756
2756
  var tools = /*#__PURE__*/Object.freeze({
2757
2757
  __proto__: null,
2758
- BrowserUse: BrowserUse,
2758
+ BrowserAction: BrowserAction,
2759
2759
  CancelWorkflow: CancelWorkflow,
2760
2760
  DocumentAgentTool: DocumentAgentTool,
2761
2761
  ExportFile: ExportFile,
@@ -694,7 +694,7 @@ async function getTabId(context) {
694
694
  }
695
695
  if (!tabId) {
696
696
  const fellouTabId = window.__FELLOU_TAB_ID__;
697
- if (tabId) {
697
+ if (fellouTabId) {
698
698
  tabId = fellouTabId;
699
699
  }
700
700
  else {
@@ -1403,7 +1403,7 @@ class ToolReturnsScreenshot {
1403
1403
  logger.debug("debug realResult...");
1404
1404
  logger.debug(realResult);
1405
1405
  await sleep(3000); // wait for page loding
1406
- let instance = new BrowserUse();
1406
+ let instance = new BrowserAction();
1407
1407
  const image = await instance.realExecute(context, { action: "screenshot_extract_element" });
1408
1408
  return image;
1409
1409
  }
@@ -1412,10 +1412,10 @@ class ToolReturnsScreenshot {
1412
1412
  /**
1413
1413
  * Browser Use for general
1414
1414
  */
1415
- class BrowserUse extends ToolReturnsScreenshot {
1415
+ class BrowserAction extends ToolReturnsScreenshot {
1416
1416
  constructor() {
1417
1417
  super();
1418
- this.name = 'browser_use';
1418
+ this.name = 'browser_action';
1419
1419
  this.description = `Use structured commands to interact with the browser, manipulating page elements through screenshots and webpage element extraction.
1420
1420
  * This is a browser GUI interface where you need to analyze webpages by taking screenshots and extracting page element structures, and specify action sequences to complete designated tasks.
1421
1421
  * Before any operation, you must first call the \`screenshot_extract_element\` command, which will return the browser page screenshot and structured element information, both specially processed.
@@ -1479,7 +1479,7 @@ class BrowserUse extends ToolReturnsScreenshot {
1479
1479
  */
1480
1480
  async realExecute(context, params) {
1481
1481
  var _a;
1482
- logger.debug("debug 'browser_use'...");
1482
+ logger.debug("debug 'browser_action'...");
1483
1483
  logger.debug(params);
1484
1484
  try {
1485
1485
  if (params === null || !params.action) {
@@ -1604,7 +1604,7 @@ class BrowserUse extends ToolReturnsScreenshot {
1604
1604
  default:
1605
1605
  throw Error(`Invalid parameters. The "${params.action}" value is not included in the "action" enumeration.`);
1606
1606
  }
1607
- logger.debug(`execute 'browser_use'...done, result=${result}`);
1607
+ logger.debug(`execute 'browser_action'...done, result=${result}`);
1608
1608
  return result;
1609
1609
  }
1610
1610
  catch (e) {
@@ -2753,7 +2753,7 @@ class DocumentAgentTool {
2753
2753
 
2754
2754
  var tools = /*#__PURE__*/Object.freeze({
2755
2755
  __proto__: null,
2756
- BrowserUse: BrowserUse,
2756
+ BrowserAction: BrowserAction,
2757
2757
  CancelWorkflow: CancelWorkflow,
2758
2758
  DocumentAgentTool: DocumentAgentTool,
2759
2759
  ExportFile: ExportFile,