@eko-ai/eko 1.0.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.
- package/LICENSE +21 -0
- package/README.md +70 -0
- package/dist/core/eko.d.ts +17 -0
- package/dist/core/tool-registry.d.ts +13 -0
- package/dist/extension/content/index.d.ts +7 -0
- package/dist/extension/core.d.ts +11 -0
- package/dist/extension/index.d.ts +7 -0
- package/dist/extension/script/bing.js +25 -0
- package/dist/extension/script/build_dom_tree.js +657 -0
- package/dist/extension/script/common.js +204 -0
- package/dist/extension/script/duckduckgo.js +25 -0
- package/dist/extension/script/google.js +26 -0
- package/dist/extension/tools/browser.d.ts +21 -0
- package/dist/extension/tools/browser_use.d.ts +18 -0
- package/dist/extension/tools/element_click.d.ts +12 -0
- package/dist/extension/tools/export_file.d.ts +18 -0
- package/dist/extension/tools/extract_content.d.ts +18 -0
- package/dist/extension/tools/find_element_position.d.ts +12 -0
- package/dist/extension/tools/form_autofill.d.ts +11 -0
- package/dist/extension/tools/html_script.d.ts +21 -0
- package/dist/extension/tools/index.d.ts +11 -0
- package/dist/extension/tools/open_url.d.ts +18 -0
- package/dist/extension/tools/screenshot.d.ts +18 -0
- package/dist/extension/tools/tab_management.d.ts +19 -0
- package/dist/extension/tools/web_search.d.ts +18 -0
- package/dist/extension/utils.d.ts +30 -0
- package/dist/extension.cjs.js +1783 -0
- package/dist/extension.esm.js +1776 -0
- package/dist/extension_content_script.js +247 -0
- package/dist/fellou/computer.d.ts +20 -0
- package/dist/fellou/index.d.ts +6 -0
- package/dist/fellou/tools/computer_use.d.ts +18 -0
- package/dist/fellou/tools/index.d.ts +2 -0
- package/dist/fellou.cjs.js +238 -0
- package/dist/fellou.esm.js +235 -0
- package/dist/index.cjs.js +9350 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.esm.js +9340 -0
- package/dist/models/action.d.ts +20 -0
- package/dist/models/workflow.d.ts +15 -0
- package/dist/nodejs/index.d.ts +2 -0
- package/dist/nodejs/tools/index.d.ts +1 -0
- package/dist/nodejs.cjs.js +7 -0
- package/dist/nodejs.esm.js +5 -0
- package/dist/schemas/workflow.schema.d.ts +85 -0
- package/dist/services/llm/claude-provider.d.ts +10 -0
- package/dist/services/llm/openai-provider.d.ts +10 -0
- package/dist/services/parser/workflow-parser.d.ts +29 -0
- package/dist/services/workflow/generator.d.ts +11 -0
- package/dist/services/workflow/templates.d.ts +7 -0
- package/dist/types/action.types.d.ts +36 -0
- package/dist/types/eko.types.d.ts +21 -0
- package/dist/types/framework.types.d.ts +11 -0
- package/dist/types/index.d.ts +6 -0
- package/dist/types/llm.types.d.ts +54 -0
- package/dist/types/parser.types.d.ts +9 -0
- package/dist/types/tools.types.d.ts +88 -0
- package/dist/types/workflow.types.d.ts +39 -0
- package/dist/web/index.d.ts +2 -0
- package/dist/web/tools/index.d.ts +1 -0
- package/dist/web.cjs.js +7 -0
- package/dist/web.esm.js +5 -0
- package/package.json +108 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 FellouAI
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# **Eko**
|
|
2
|
+
|
|
3
|
+
[](LICENSE) [](https://example.com/build-status) [](https://example.com/version)
|
|
4
|
+
|
|
5
|
+
**Eko** is a revolutionary framework designed to empower developers and users alike to program their browser and operating system using natural language. With seamless integration of browser APIs, OS-level capabilities, and cutting-edge AI tools like Claude 3.5, Eko redefines how we interact with technology, making it intuitive, powerful, and accessible.
|
|
6
|
+
|
|
7
|
+
---
|
|
8
|
+
|
|
9
|
+
## **Table of Contents**
|
|
10
|
+
|
|
11
|
+
1. [Introduction](#introduction)
|
|
12
|
+
2. [Features](#features)
|
|
13
|
+
3. [Installation](#installation)
|
|
14
|
+
4. [Usage](#usage)
|
|
15
|
+
5. [API Documentation](#api-documentation)
|
|
16
|
+
6. [Contributing](#contributing)
|
|
17
|
+
7. [License](#license)
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## **Introduction**
|
|
22
|
+
|
|
23
|
+
**Eko** is a full-stack agent development framework built on the [Fellou AI browser](https://fellou.ai), which transforms human words into actions. By leveraging natural language processing and advanced AI capabilities, it bridges the gap between user intent and system execution. Whether you're automating workflows, building browser agents, or accessing system-level operations, Eko provides the tools to make it effortless.
|
|
24
|
+
|
|
25
|
+
## **Why use the Eko**
|
|
26
|
+
- The biggest advantage of using Eko is that developers don’t need to build client software, and users don’t need to install any additional client to enjoy the most advanced AI-powered computer use capabilities. These capabilities span across both the browser and the operating system.
|
|
27
|
+
- **Eko** changes the paradigm of programming, shifting from developers telling computers how to do something to developers telling computers what to do and what goals to achieve.
|
|
28
|
+
|
|
29
|
+
|
|
30
|
+
### **Key Benefits**
|
|
31
|
+
- **Language as Code**: Use natural language to write commands and create workflows.
|
|
32
|
+
- **Cross-Platform Integration**: Access browser and operating system APIs seamlessly.
|
|
33
|
+
- **AI-Powered**: Harness the capabilities of AI systems like Claude 3.5, OpenAI for advanced automation.
|
|
34
|
+
- **Developer-Friendly**: Simplify complex tasks with an intuitive and flexible framework.
|
|
35
|
+
|
|
36
|
+
---
|
|
37
|
+
|
|
38
|
+
## **Features**
|
|
39
|
+
|
|
40
|
+
- **Natural Language Programming**: Write code in plain English to interact with your system and browser.
|
|
41
|
+
- **Unified API Access**: A single interface for browser APIs, OS-level operations, and AI tools.
|
|
42
|
+
- **Event-Driven Automation**: Trigger workflows based on browser or system events.
|
|
43
|
+
- **Customizable Agents**: Build intelligent agents to perform repetitive or complex tasks.
|
|
44
|
+
- **AI Integration**: Leverage advanced AI models to understand and execute complex commands.
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## **Installation**
|
|
49
|
+
|
|
50
|
+
### **Using npm**
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
npm install @eko-ai/eko
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Contributing
|
|
57
|
+
|
|
58
|
+
Contributions are welcome! Please follow these steps to contribute:
|
|
59
|
+
|
|
60
|
+
1. Fork the repository.
|
|
61
|
+
2. Create a new branch: git checkout -b feature/- your-feature-name.
|
|
62
|
+
3. Make your changes and commit them: git commit -m 'Add some feature'.
|
|
63
|
+
4. Push to the branch: git push origin feature/your-feature-name.
|
|
64
|
+
5. Submit a pull request.
|
|
65
|
+
6. For detailed guidelines, see CONTRIBUTING.md.
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
This project is licensed under the MIT License.
|
|
69
|
+
|
|
70
|
+
## Acknowledgments
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { EkoConfig, EkoInvokeParam, Tool, Workflow, WorkflowCallback } from '../types';
|
|
2
|
+
/**
|
|
3
|
+
* Eko core
|
|
4
|
+
*/
|
|
5
|
+
export declare class Eko {
|
|
6
|
+
private llmProvider;
|
|
7
|
+
private toolRegistry;
|
|
8
|
+
constructor(config: EkoConfig);
|
|
9
|
+
generateWorkflow(prompt: string, param?: EkoInvokeParam): Promise<Workflow>;
|
|
10
|
+
executeWorkflow(workflow: Workflow, callback?: WorkflowCallback): Promise<void>;
|
|
11
|
+
private getTool;
|
|
12
|
+
callTool(toolName: string, input: object, callback?: WorkflowCallback): Promise<any>;
|
|
13
|
+
callTool(tool: Tool<any, any>, input: object, callback?: WorkflowCallback): Promise<any>;
|
|
14
|
+
registerTool(tool: Tool<any, any>): void;
|
|
15
|
+
unregisterTool(toolName: string): void;
|
|
16
|
+
}
|
|
17
|
+
export default Eko;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Tool } from '../types/action.types';
|
|
2
|
+
import { ToolDefinition } from '../types/llm.types';
|
|
3
|
+
export declare class ToolRegistry {
|
|
4
|
+
private tools;
|
|
5
|
+
registerTool(tool: Tool<any, any>): void;
|
|
6
|
+
unregisterTool(toolName: string): void;
|
|
7
|
+
getTool(toolName: string): Tool<any, any>;
|
|
8
|
+
hasTools(toolNames: string[]): boolean;
|
|
9
|
+
getAllTools(): Tool<any, any>[];
|
|
10
|
+
getToolDefinitions(): ToolDefinition[];
|
|
11
|
+
getToolEnum(): string[];
|
|
12
|
+
getWorkflowSchema(): object;
|
|
13
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
declare const eko: any;
|
|
2
|
+
declare function key(request: any): any;
|
|
3
|
+
declare function type(request: any): any;
|
|
4
|
+
declare function mouse_move(request: any): boolean;
|
|
5
|
+
declare function simulateMouseEvent(request: any, eventTypes: Array<string>, button: 0 | 1 | 2): boolean;
|
|
6
|
+
declare function scroll_to(request: any): void;
|
|
7
|
+
declare function left_click_drag(request: any, steps?: number): boolean;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { Tool } from '../types';
|
|
2
|
+
export declare function pub(tabId: number, event: string, params: any): Promise<any>;
|
|
3
|
+
export declare function getLLMConfig(name?: string): Promise<{
|
|
4
|
+
llm?: string;
|
|
5
|
+
apiKey?: string;
|
|
6
|
+
modelName?: string;
|
|
7
|
+
options?: {
|
|
8
|
+
[key: string]: any;
|
|
9
|
+
};
|
|
10
|
+
} | undefined>;
|
|
11
|
+
export declare function getAllTools(): Map<string, Tool<any, any>>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
|
|
2
|
+
eko.getDetailLinks = async function (search) {
|
|
3
|
+
await eko.waitForElementPresent(document.body, 'main h2 a', 5000)
|
|
4
|
+
let search_list = document.querySelectorAll('main h2 a')
|
|
5
|
+
if (search_list.length === 0) {
|
|
6
|
+
search_list = document.querySelectorAll('h2 a')
|
|
7
|
+
}
|
|
8
|
+
let links = []
|
|
9
|
+
for (let i = 0; i < search_list.length; i++) {
|
|
10
|
+
let title = eko.cleanText(search_list[i])
|
|
11
|
+
let url = search_list[i].getAttribute('href')
|
|
12
|
+
links.push({ title, url })
|
|
13
|
+
}
|
|
14
|
+
return {
|
|
15
|
+
links: links
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
eko.getContent = async function (search) {
|
|
20
|
+
await eko.waitLoaded()
|
|
21
|
+
return {
|
|
22
|
+
title: document.title,
|
|
23
|
+
content: eko.extractHtmlContent()
|
|
24
|
+
}
|
|
25
|
+
}
|