@eko-ai/eko 3.0.0-alpha.6 → 3.0.0-alpha.8
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/README.md +8 -7
- package/dist/agent/browser/browser_labels.d.ts.map +1 -1
- package/dist/agent/browser/build_dom_tree.d.ts.map +1 -1
- package/dist/core/eko.d.ts.map +1 -1
- package/dist/index.cjs.js +32 -9
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +32 -9
- package/dist/index.esm.js.map +1 -1
- package/dist/mcp/http.d.ts.map +1 -1
- package/dist/prompt/plan.d.ts.map +1 -1
- package/dist/types/core.types.d.ts +1 -0
- package/dist/types/core.types.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,8 +21,9 @@ Eko (pronounced like 'echo') is a production-ready JavaScript framework that ena
|
|
|
21
21
|
|--------------------------------------|-------|------------|--------------|----------|--------|
|
|
22
22
|
| **Supported Platform** | **All platform** | Server side | Browser | Web | Web |
|
|
23
23
|
| **One sentence to multi-step workflow** | ✅ | ❌ | ✅ | ❌ | ❌ |
|
|
24
|
-
| **Intervenability** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
25
|
-
| **
|
|
24
|
+
| **Intervenability** | ✅ | ✅ | ❌ | ❌ | ❌ |
|
|
25
|
+
| **Task Parallel** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
26
|
+
| **Development Efficiency** | **High** | Low | Middle | Middle | Low |
|
|
26
27
|
| **Task Complexity** | **High** | High | Low | Middle | Middle | Middle |
|
|
27
28
|
| **Open-source** | ✅ | ✅ | ✅ | ✅ | ❌ |
|
|
28
29
|
| **Access to private web resources** | ✅ | ❌ | ❌ | ❌ | ❌ |
|
|
@@ -61,6 +62,11 @@ const llms: LLMs = {
|
|
|
61
62
|
model: "claude-sonnet-4-20250514",
|
|
62
63
|
apiKey: "your-api-key"
|
|
63
64
|
},
|
|
65
|
+
gemini: {
|
|
66
|
+
provider: "google",
|
|
67
|
+
model: "gemini-2.5-pro",
|
|
68
|
+
apiKey: "your-api-key"
|
|
69
|
+
},
|
|
64
70
|
openai: {
|
|
65
71
|
provider: "openai",
|
|
66
72
|
model: "gpt-5",
|
|
@@ -107,11 +113,6 @@ Eko can be used in multiple environments:
|
|
|
107
113
|
## Community and Support
|
|
108
114
|
|
|
109
115
|
- Report issues on [GitHub Issues](https://github.com/FellouAI/eko/issues)
|
|
110
|
-
- Join our [slack community discussions](https://join.slack.com/t/eko-ai/shared_invite/zt-2xhvkudv9-nHvD1g8Smp227sM51x_Meg)
|
|
111
|
-
- Join our [Discard](https://discord.gg/XpFfk2e5):
|
|
112
|
-

|
|
113
|
-
- Contribute tools and improvements
|
|
114
|
-
- Share your use cases and feedback
|
|
115
116
|
|
|
116
117
|
[](https://star-history.com/#FellouAI/eko&Date)
|
|
117
118
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAAgB,CAAC;AAC9D,OAAO,EAEL,qBAAqB,EACtB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAE,IAAI,EAAc,UAAU,EAAE,MAAM,aAAa,CAAC;AAG3D,MAAM,CAAC,OAAO,CAAC,QAAQ,OAAO,sBAAuB,SAAQ,gBAAgB;gBAC/D,IAAI,CAAC,EAAE,MAAM,EAAE,EAAE,SAAS,CAAC,EAAE,IAAI,EAAE,EAAE,SAAS,CAAC,EAAE,UAAU;
|
|
1
|
+
{"version":3,"file":"browser_labels.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/browser_labels.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,OAAO,EAAE,gBAAgB,EAAc,MAAM,gBAA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,GAAG,WAAW,CAAC;QACtC,UAAU,EAAE,MAAM,CAAC;KACpB,CAAC;IAwCF,SAAS,CAAC,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM;IAInD,OAAO,CAAC,cAAc;cAuUN,kBAAkB,CAChC,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,IAAI,EAAE,GACZ,OAAO,CAAC,OAAO,CAAC;cAIH,cAAc,CAC5B,YAAY,EAAE,YAAY,EAC1B,QAAQ,EAAE,qBAAqB,EAC/B,KAAK,EAAE,IAAI,EAAE,GACZ,OAAO,CAAC,IAAI,CAAC;IA2ChB,OAAO,CAAC,oBAAoB;IAkC5B,OAAO,CAAC,oBAAoB;CA0B7B;AA4SD,OAAO,EAAE,sBAAsB,EAAE,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build_dom_tree.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/build_dom_tree.ts"],"names":[],"mappings":"AACA,wBAAgB,kBAAkB,
|
|
1
|
+
{"version":3,"file":"build_dom_tree.d.ts","sourceRoot":"","sources":["../../../src/agent/browser/build_dom_tree.ts"],"names":[],"mappings":"AACA,wBAAgB,kBAAkB,SAqqBjC"}
|
package/dist/core/eko.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"eko.d.ts","sourceRoot":"","sources":["../../src/core/eko.ts"],"names":[],"mappings":"AACA,OAAO,OAAO,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,KAAK,EAAE,MAAM,UAAU,CAAC;AAGjC,OAAc,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAG5C,OAAO,EACL,SAAS,EACT,SAAS,EACT,QAAQ,EACR,eAAe,EAChB,MAAM,qBAAqB,CAAC;AAE7B,qBAAa,GAAG;IACd,SAAS,CAAC,MAAM,EAAE,SAAS,CAAC;IAC5B,SAAS,CAAC,OAAO,EAAE,GAAG,CAA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{
|
|
|
32082
32082
|
for (let i = 0; i < agents.length; i++) {
|
|
32083
32083
|
let agent = agents[i];
|
|
32084
32084
|
let tools = await agent.loadTools(context);
|
|
32085
|
+
if (agent.ignorePlan) {
|
|
32086
|
+
continue;
|
|
32087
|
+
}
|
|
32085
32088
|
agents_prompt +=
|
|
32086
32089
|
`<agent name="${agent.Name}">\n` +
|
|
32087
32090
|
`Description: ${agent.PlanDescription || agent.Description}\n` +
|
|
@@ -32831,6 +32834,11 @@ class Eko {
|
|
|
32831
32834
|
results.push(agent_results.join("\n\n"));
|
|
32832
32835
|
}
|
|
32833
32836
|
context.conversation.splice(0, context.conversation.length);
|
|
32837
|
+
if (workflow.modified) {
|
|
32838
|
+
workflow.modified = false;
|
|
32839
|
+
agentTree = buildAgentTree(workflow.agents.filter((agent) => agent.status == "init"));
|
|
32840
|
+
continue;
|
|
32841
|
+
}
|
|
32834
32842
|
if (!agentTree.nextAgent) {
|
|
32835
32843
|
break;
|
|
32836
32844
|
}
|
|
@@ -33872,6 +33880,7 @@ class SimpleHttpMcpClient {
|
|
|
33872
33880
|
}
|
|
33873
33881
|
async connect(signal) {
|
|
33874
33882
|
Log.info("MCP Client, connecting...", this.httpUrl);
|
|
33883
|
+
this.mcpSessionId = null;
|
|
33875
33884
|
await this.request("initialize", {
|
|
33876
33885
|
protocolVersion: this.protocolVersion,
|
|
33877
33886
|
capabilities: {
|
|
@@ -33885,9 +33894,6 @@ class SimpleHttpMcpClient {
|
|
|
33885
33894
|
version: "1.0.0",
|
|
33886
33895
|
},
|
|
33887
33896
|
}, signal);
|
|
33888
|
-
if (this.mcpSessionId) {
|
|
33889
|
-
this.request("notifications/initialized", {}, signal);
|
|
33890
|
-
}
|
|
33891
33897
|
this.connected = true;
|
|
33892
33898
|
}
|
|
33893
33899
|
async listTools(param, signal) {
|
|
@@ -33920,11 +33926,16 @@ class SimpleHttpMcpClient {
|
|
|
33920
33926
|
requestId: uuidv4(),
|
|
33921
33927
|
reason: "User requested cancellation",
|
|
33922
33928
|
});
|
|
33929
|
+
this.mcpSessionId = null;
|
|
33923
33930
|
}
|
|
33924
33931
|
}
|
|
33925
33932
|
async request(method, params, signal) {
|
|
33926
33933
|
try {
|
|
33927
33934
|
const id = uuidv4();
|
|
33935
|
+
const extHeaders = {};
|
|
33936
|
+
if (this.mcpSessionId && method !== "initialize") {
|
|
33937
|
+
extHeaders["Mcp-Session-Id"] = this.mcpSessionId;
|
|
33938
|
+
}
|
|
33928
33939
|
const response = await fetch(this.httpUrl, {
|
|
33929
33940
|
method: "POST",
|
|
33930
33941
|
headers: {
|
|
@@ -33932,7 +33943,7 @@ class SimpleHttpMcpClient {
|
|
|
33932
33943
|
"Content-Type": "application/json",
|
|
33933
33944
|
"Accept": "application/json, text/event-stream",
|
|
33934
33945
|
"MCP-Protocol-Version": this.protocolVersion,
|
|
33935
|
-
...
|
|
33946
|
+
...extHeaders,
|
|
33936
33947
|
...this.headers,
|
|
33937
33948
|
},
|
|
33938
33949
|
body: JSON.stringify({
|
|
@@ -36340,8 +36351,11 @@ function run_build_dom_tree() {
|
|
|
36340
36351
|
nodeData.isInteractive = isInteractive;
|
|
36341
36352
|
nodeData.isVisible = isVisible;
|
|
36342
36353
|
nodeData.isTopElement = isTop;
|
|
36354
|
+
// For Shadow DOM elements, use more lenient criteria
|
|
36355
|
+
const isInShadowDOM = node.getRootNode() instanceof ShadowRoot;
|
|
36356
|
+
const shouldHighlight = isInteractive && isVisible && (isTop || isInShadowDOM);
|
|
36343
36357
|
// Highlight if element meets all criteria and highlighting is enabled
|
|
36344
|
-
if (
|
|
36358
|
+
if (shouldHighlight) {
|
|
36345
36359
|
nodeData.highlightIndex = highlightIndex++;
|
|
36346
36360
|
window.clickable_elements[nodeData.highlightIndex] = node;
|
|
36347
36361
|
if (doHighlightElements) {
|
|
@@ -36401,8 +36415,8 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
36401
36415
|
- If the webpage content hasn't loaded, please use the \`wait\` tool to allow time for the content to load.
|
|
36402
36416
|
* ELEMENT INTERACTION:
|
|
36403
36417
|
- Only use indexes that exist in the provided element list
|
|
36404
|
-
- Each element has a unique index number (e.g., "[33]:<button>")
|
|
36405
|
-
- Elements marked with "[]:" are non-interactive (for context only)
|
|
36418
|
+
- Each element has a unique index number (e.g., "[33]:<button>Submit</button>")
|
|
36419
|
+
- Elements marked with "[]:" are non-interactive (for context only, e.g., "[]: Google")
|
|
36406
36420
|
- Use the latest element index, do not rely on historical outdated element indexes
|
|
36407
36421
|
* ERROR HANDLING:
|
|
36408
36422
|
- If no suitable elements exist, use other functions to complete the task
|
|
@@ -36411,6 +36425,7 @@ class BaseBrowserLabelsAgent extends BaseBrowserAgent {
|
|
|
36411
36425
|
- When encountering scenarios that require user assistance such as login, verification codes, QR code scanning, Payment, etc, you can request user help.
|
|
36412
36426
|
* BROWSER OPERATION:
|
|
36413
36427
|
- Use scroll to find elements you are looking for, When extracting content, prioritize using extract_page_content, only scroll when you need to load more content
|
|
36428
|
+
- Please follow user instructions and don't be lazy until the task is completed. For example, if a user asks you to find 30 people, don't just find 10 - keep searching until you find all 30
|
|
36414
36429
|
* During execution, please output user-friendly step information. Do not output HTML-related element and index information to users, as this would cause user confusion.
|
|
36415
36430
|
`;
|
|
36416
36431
|
const _tools_ = [];
|
|
@@ -36936,13 +36951,21 @@ function do_click(params) {
|
|
|
36936
36951
|
}
|
|
36937
36952
|
for (let n = 0; n < num_clicks; n++) {
|
|
36938
36953
|
for (let i = 0; i < eventTypes.length; i++) {
|
|
36939
|
-
const
|
|
36954
|
+
const eventType = eventTypes[i];
|
|
36955
|
+
const event = new MouseEvent(eventType, {
|
|
36940
36956
|
view: window,
|
|
36941
36957
|
bubbles: true,
|
|
36942
36958
|
cancelable: true,
|
|
36943
36959
|
button, // 0 left; 1 middle; 2 right
|
|
36944
36960
|
});
|
|
36945
|
-
element.
|
|
36961
|
+
if (eventType === 'click' && element.click) {
|
|
36962
|
+
// support shadow dom element
|
|
36963
|
+
element.click();
|
|
36964
|
+
}
|
|
36965
|
+
else {
|
|
36966
|
+
element.dispatchEvent(event);
|
|
36967
|
+
}
|
|
36968
|
+
element.focus?.();
|
|
36946
36969
|
}
|
|
36947
36970
|
}
|
|
36948
36971
|
return true;
|