@eko-ai/eko 1.3.0 → 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
  }
@@ -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,
@@ -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,
package/dist/index.cjs.js CHANGED
@@ -10395,7 +10395,7 @@ class ActionImpl {
10395
10395
  // unwrap the toolCall
10396
10396
  let unwrapped = this.unwrapToolCall(toolCall);
10397
10397
  let input = unwrapped.toolCall.input;
10398
- logger.info("LLM Response:", unwrapped);
10398
+ logger.debug("unwrapped", unwrapped);
10399
10399
  if (unwrapped.thinking) {
10400
10400
  (_d = (_b = context.callback) === null || _b === void 0 ? void 0 : (_c = _b.hooks).onLlmMessage) === null || _d === void 0 ? void 0 : _d.call(_c, unwrapped.thinking);
10401
10401
  }
@@ -10585,11 +10585,9 @@ class ActionImpl {
10585
10585
  toolMap.set(returnTool.name, returnTool);
10586
10586
  // get already existing tabs as task background
10587
10587
  const currentWindow = await context.ekoConfig.chromeProxy.windows.getCurrent();
10588
- let existingTabs = await context.ekoConfig.chromeProxy.tabs.query({
10588
+ const existingTabs = await context.ekoConfig.chromeProxy.tabs.query({
10589
10589
  windowId: currentWindow.id,
10590
10590
  });
10591
- existingTabs = existingTabs.filter((tab) => { tab.title && tab.url; });
10592
- logger.debug("existingTabs:", existingTabs);
10593
10591
  // get patchs for task
10594
10592
  let patchs = [];
10595
10593
  if (context.ekoConfig.patchServerUrl) {
@@ -11034,7 +11032,7 @@ class WorkflowGenerator {
11034
11032
  // Add nodes to workflow
11035
11033
  if (Array.isArray(data.nodes)) {
11036
11034
  data.nodes.forEach((nodeData) => {
11037
- const action = ActionImpl.createPromptAction(nodeData.action.name, nodeData.action.description, [this.toolRegistry.getTool('browser_use')], this.llmProvider, { maxTokens: 8192 });
11035
+ const action = ActionImpl.createPromptAction(nodeData.action.name, nodeData.action.description, [this.toolRegistry.getTool('browser_action')], this.llmProvider, { maxTokens: 8192 });
11038
11036
  const node = {
11039
11037
  id: nodeData.id,
11040
11038
  name: nodeData.name || nodeData.id,
@@ -11065,23 +11063,44 @@ const workflowSchema = {
11065
11063
  type: "array",
11066
11064
  items: {
11067
11065
  type: "object",
11068
- required: ["id", "action"],
11066
+ required: ["id", "type", "action"],
11069
11067
  properties: {
11070
11068
  id: { type: "string" },
11071
- action: {
11069
+ type: {
11070
+ type: "string",
11071
+ enum: ["action"], // only action nodes for now; reserved for future types like condition, loop, etc.
11072
+ },
11073
+ dependencies: {
11074
+ type: "array",
11075
+ items: { type: "string" },
11076
+ },
11077
+ output: {
11072
11078
  type: "object",
11073
- required: ["name", "description"],
11074
11079
  properties: {
11075
11080
  name: { type: "string" },
11076
- description: {
11081
+ description: { type: "string" },
11082
+ },
11083
+ },
11084
+ action: {
11085
+ type: "object",
11086
+ required: ["type", "name", "description"],
11087
+ properties: {
11088
+ type: {
11077
11089
  type: "string",
11078
- description: "Note that do not use \" mark.",
11090
+ // enum: ["prompt", "script", "hybrid"],
11091
+ enum: ["prompt"],
11079
11092
  },
11093
+ name: { type: "string" },
11094
+ description: { type: "string" },
11080
11095
  },
11081
11096
  },
11082
11097
  },
11083
11098
  },
11084
11099
  },
11100
+ variables: {
11101
+ type: "object",
11102
+ additionalProperties: true,
11103
+ },
11085
11104
  },
11086
11105
  };
11087
11106
 
@@ -11144,7 +11163,7 @@ class Eko {
11144
11163
  this.llmProvider = LLMProviderFactory.buildLLMProvider(llmConfig);
11145
11164
  this.ekoConfig = this.buildEkoConfig(ekoConfig);
11146
11165
  this.registerTools();
11147
- logger.info("using Eko@" + "416349eaa1535085d74b14170d4e0741756da46f");
11166
+ logger.info("using Eko@" + "a5c3c50087c75ad4abcf1d0dbb58aa4bf0227c13");
11148
11167
  logger.debug("caller's ekoConfig:", ekoConfig);
11149
11168
  }
11150
11169
  static getLogger() {
@@ -11237,7 +11256,7 @@ class Eko {
11237
11256
  'name': prompt,
11238
11257
  'description': description,
11239
11258
  'tools': [
11240
- 'browser_use',
11259
+ 'browser_action',
11241
11260
  'document_agent',
11242
11261
  'export_file',
11243
11262
  'extract_content',
package/dist/index.esm.js CHANGED
@@ -10391,7 +10391,7 @@ class ActionImpl {
10391
10391
  // unwrap the toolCall
10392
10392
  let unwrapped = this.unwrapToolCall(toolCall);
10393
10393
  let input = unwrapped.toolCall.input;
10394
- logger.info("LLM Response:", unwrapped);
10394
+ logger.debug("unwrapped", unwrapped);
10395
10395
  if (unwrapped.thinking) {
10396
10396
  (_d = (_b = context.callback) === null || _b === void 0 ? void 0 : (_c = _b.hooks).onLlmMessage) === null || _d === void 0 ? void 0 : _d.call(_c, unwrapped.thinking);
10397
10397
  }
@@ -10581,11 +10581,9 @@ class ActionImpl {
10581
10581
  toolMap.set(returnTool.name, returnTool);
10582
10582
  // get already existing tabs as task background
10583
10583
  const currentWindow = await context.ekoConfig.chromeProxy.windows.getCurrent();
10584
- let existingTabs = await context.ekoConfig.chromeProxy.tabs.query({
10584
+ const existingTabs = await context.ekoConfig.chromeProxy.tabs.query({
10585
10585
  windowId: currentWindow.id,
10586
10586
  });
10587
- existingTabs = existingTabs.filter((tab) => { tab.title && tab.url; });
10588
- logger.debug("existingTabs:", existingTabs);
10589
10587
  // get patchs for task
10590
10588
  let patchs = [];
10591
10589
  if (context.ekoConfig.patchServerUrl) {
@@ -11030,7 +11028,7 @@ class WorkflowGenerator {
11030
11028
  // Add nodes to workflow
11031
11029
  if (Array.isArray(data.nodes)) {
11032
11030
  data.nodes.forEach((nodeData) => {
11033
- const action = ActionImpl.createPromptAction(nodeData.action.name, nodeData.action.description, [this.toolRegistry.getTool('browser_use')], this.llmProvider, { maxTokens: 8192 });
11031
+ const action = ActionImpl.createPromptAction(nodeData.action.name, nodeData.action.description, [this.toolRegistry.getTool('browser_action')], this.llmProvider, { maxTokens: 8192 });
11034
11032
  const node = {
11035
11033
  id: nodeData.id,
11036
11034
  name: nodeData.name || nodeData.id,
@@ -11061,23 +11059,44 @@ const workflowSchema = {
11061
11059
  type: "array",
11062
11060
  items: {
11063
11061
  type: "object",
11064
- required: ["id", "action"],
11062
+ required: ["id", "type", "action"],
11065
11063
  properties: {
11066
11064
  id: { type: "string" },
11067
- action: {
11065
+ type: {
11066
+ type: "string",
11067
+ enum: ["action"], // only action nodes for now; reserved for future types like condition, loop, etc.
11068
+ },
11069
+ dependencies: {
11070
+ type: "array",
11071
+ items: { type: "string" },
11072
+ },
11073
+ output: {
11068
11074
  type: "object",
11069
- required: ["name", "description"],
11070
11075
  properties: {
11071
11076
  name: { type: "string" },
11072
- description: {
11077
+ description: { type: "string" },
11078
+ },
11079
+ },
11080
+ action: {
11081
+ type: "object",
11082
+ required: ["type", "name", "description"],
11083
+ properties: {
11084
+ type: {
11073
11085
  type: "string",
11074
- description: "Note that do not use \" mark.",
11086
+ // enum: ["prompt", "script", "hybrid"],
11087
+ enum: ["prompt"],
11075
11088
  },
11089
+ name: { type: "string" },
11090
+ description: { type: "string" },
11076
11091
  },
11077
11092
  },
11078
11093
  },
11079
11094
  },
11080
11095
  },
11096
+ variables: {
11097
+ type: "object",
11098
+ additionalProperties: true,
11099
+ },
11081
11100
  },
11082
11101
  };
11083
11102
 
@@ -11140,7 +11159,7 @@ class Eko {
11140
11159
  this.llmProvider = LLMProviderFactory.buildLLMProvider(llmConfig);
11141
11160
  this.ekoConfig = this.buildEkoConfig(ekoConfig);
11142
11161
  this.registerTools();
11143
- logger.info("using Eko@" + "416349eaa1535085d74b14170d4e0741756da46f");
11162
+ logger.info("using Eko@" + "a5c3c50087c75ad4abcf1d0dbb58aa4bf0227c13");
11144
11163
  logger.debug("caller's ekoConfig:", ekoConfig);
11145
11164
  }
11146
11165
  static getLogger() {
@@ -11233,7 +11252,7 @@ class Eko {
11233
11252
  'name': prompt,
11234
11253
  'description': description,
11235
11254
  'tools': [
11236
- 'browser_use',
11255
+ 'browser_action',
11237
11256
  'document_agent',
11238
11257
  'export_file',
11239
11258
  'extract_content',
@@ -1,9 +1,9 @@
1
- import { BrowserUseParam, BrowserUseResult } from '../../types/tools.types';
1
+ import { BrowserActionParam, BrowserActionResult } from '../../types/tools.types';
2
2
  import { Tool, InputSchema, ExecutionContext } from '../../types/action.types';
3
3
  /**
4
4
  * Browser Use => `npx playwright install`
5
5
  */
6
- export declare class BrowserUse implements Tool<BrowserUseParam, BrowserUseResult> {
6
+ export declare class BrowserUse implements Tool<BrowserActionParam, BrowserActionResult> {
7
7
  name: string;
8
8
  description: string;
9
9
  input_schema: InputSchema;
@@ -17,7 +17,7 @@ export declare class BrowserUse implements Tool<BrowserUseParam, BrowserUseResul
17
17
  * @param {*} params { action: 'input_text', index: 1, text: 'string' }
18
18
  * @returns > { success: true, image?: { type: 'base64', media_type: 'image/jpeg', data: '/9j...' }, text?: string }
19
19
  */
20
- execute(context: ExecutionContext, params: BrowserUseParam): Promise<BrowserUseResult>;
20
+ execute(context: ExecutionContext, params: BrowserActionParam): Promise<BrowserActionResult>;
21
21
  private open_url;
22
22
  private injectScript;
23
23
  private get_highlight_element;
@@ -24,21 +24,49 @@ export declare const workflowSchema: {
24
24
  id: {
25
25
  type: string;
26
26
  };
27
+ type: {
28
+ type: string;
29
+ enum: string[];
30
+ };
31
+ dependencies: {
32
+ type: string;
33
+ items: {
34
+ type: string;
35
+ };
36
+ };
37
+ output: {
38
+ type: string;
39
+ properties: {
40
+ name: {
41
+ type: string;
42
+ };
43
+ description: {
44
+ type: string;
45
+ };
46
+ };
47
+ };
27
48
  action: {
28
49
  type: string;
29
50
  required: string[];
30
51
  properties: {
52
+ type: {
53
+ type: string;
54
+ enum: string[];
55
+ };
31
56
  name: {
32
57
  type: string;
33
58
  };
34
59
  description: {
35
60
  type: string;
36
- description: string;
37
61
  };
38
62
  };
39
63
  };
40
64
  };
41
65
  };
42
66
  };
67
+ variables: {
68
+ type: string;
69
+ additionalProperties: boolean;
70
+ };
43
71
  };
44
72
  };
@@ -8,12 +8,12 @@ export interface ComputerUseResult {
8
8
  image?: ScreenshotImage;
9
9
  [key: string]: any;
10
10
  }
11
- export interface BrowserUseParam {
11
+ export interface BrowserActionParam {
12
12
  action: string;
13
13
  index?: number;
14
14
  text?: string;
15
15
  }
16
- export interface BrowserUseResult {
16
+ export interface BrowserActionResult {
17
17
  success: boolean;
18
18
  image?: ScreenshotImage;
19
19
  text?: string;
@@ -1,9 +1,9 @@
1
- import { BrowserUseParam, BrowserUseResult } from '../../types/tools.types';
1
+ import { BrowserActionParam, BrowserActionResult } from '../../types/tools.types';
2
2
  import { Tool, InputSchema, ExecutionContext } from '../../types/action.types';
3
3
  /**
4
4
  * Browser Use for general
5
5
  */
6
- export declare class BrowserUse implements Tool<BrowserUseParam, BrowserUseResult> {
6
+ export declare class BrowserUse implements Tool<BrowserActionParam, BrowserActionResult> {
7
7
  name: string;
8
8
  description: string;
9
9
  input_schema: InputSchema;
@@ -14,6 +14,6 @@ export declare class BrowserUse implements Tool<BrowserUseParam, BrowserUseResul
14
14
  * @param {*} params { action: 'input_text', index: 1, text: 'string' }
15
15
  * @returns > { success: true, image?: { type: 'base64', media_type: 'image/jpeg', data: '/9j...' }, text?: string }
16
16
  */
17
- execute(context: ExecutionContext, params: BrowserUseParam): Promise<BrowserUseResult>;
17
+ execute(context: ExecutionContext, params: BrowserActionParam): Promise<BrowserActionResult>;
18
18
  destroy(context: ExecutionContext): void;
19
19
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eko-ai/eko",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Empowering language to transform human words into action.",
5
5
  "main": "dist/index.cjs.js",
6
6
  "module": "dist/index.esm.js",
@@ -1,10 +0,0 @@
1
- import { Message } from "@/types";
2
- export declare abstract class ContextComporessor {
3
- abstract comporess(messages: Message[]): Message[];
4
- }
5
- export declare class NoComporess extends ContextComporessor {
6
- comporess(messages: Message[]): Message[];
7
- }
8
- export declare class SimpleQAComporess extends ContextComporessor {
9
- comporess(messages: Message[]): Message[];
10
- }