Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
veasion committed Dec 12, 2024
0 parents commit 919e17f
Show file tree
Hide file tree
Showing 29 changed files with 1,155 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: build

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

jobs:
build:

runs-on: ubuntu-latest

strategy:
matrix:
node-version: [18.x, 20.x, 22.x]

steps:
- uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
tmp/
dist/
.idea/
.vscode/
node_modules/
.DS_Store
npm-debug.log
package-lock.json
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2018 Tomofumi Chiba

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# **Eko Chromium Extension**

Eko Keeps Operating - Empowering language to transform human words into action - eko.fellou.ai

## Setup
```
npm install
npm run build
```
8 changes: 8 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
module.exports = {
"roots": [
"src"
],
"transform": {
"^.+\\.ts$": ["ts-jest", { tsconfig: "tsconfig.test.json" }]
},
};
40 changes: 40 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
{
"name": "eko-chromium-extension",
"version": "1.0.0",
"description": "eko chromium extension",
"main": "index.js",
"scripts": {
"watch": "webpack --config webpack/webpack.dev.js --watch",
"build": "webpack --config webpack/webpack.prod.js",
"clean": "rimraf dist",
"test": "npx jest",
"style": "prettier --write \"src/**/*.{ts,tsx}\""
},
"author": "fellou.ai",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/fellouAI/eko-chromium-extension.git"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
},
"devDependencies": {
"@types/chrome": "0.0.158",
"@types/jest": "^29.5.0",
"@types/react": "^18.0.29",
"@types/react-dom": "^18.0.11",
"copy-webpack-plugin": "^9.0.1",
"glob": "^7.1.6",
"jest": "^29.5.0",
"prettier": "^2.2.1",
"rimraf": "^3.0.2 ",
"ts-jest": "^29.1.0",
"ts-loader": "^8.0.0",
"typescript": "^5.0.4",
"webpack": "^5.94.0",
"webpack-cli": "^4.0.0",
"webpack-merge": "^5.0.0"
}
}
Binary file added public/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
39 changes: 39 additions & 0 deletions public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
{
"name": "eko agent",
"description": "Eko Agent Extension",
"version": "1.0",
"manifest_version": 3,
"background": {
"type": "module",
"service_worker": "js/background.js"
},
"action": {
"default_icon": "icon.png",
"default_popup": "popup.html"
},
"options_ui": {
"page": "options.html"
},
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["js/vendor.js", "js/content_script.js"],
"run_at": "document_idle"
}
],
"permissions": [
"alarms",
"storage",
"scripting",
"activeTab",
"notifications",
"webRequest"
],
"host_permissions": [
"<all_urls>"
],
"web_accessible_resources": [{
"matches": ["<all_urls>"],
"resources": ["script/*"]
}]
}
12 changes: 12 additions & 0 deletions public/options.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!DOCTYPE html>
<html>
<head>
<title>Eko Options</title>
<script src="js/vendor.js"></script>
</head>

<body>
<div id="root"></div>
<script src="js/options.js"></script>
</body>
</html>
13 changes: 13 additions & 0 deletions public/popup.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Eko Popup</title>
<script src="js/vendor.js"></script>
</head>
<body>
<div id="root"></div>
<script src="js/popup.js"></script>
</body>
</html>

11 changes: 11 additions & 0 deletions src/__tests__/sum.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
function sum(x: number, y: number) {
return x + y;
}

test("1 + 1 = 2", () => {
expect(sum(1, 1)).toBe(2);
});

test("1 + 2 != 2", () => {
expect(sum(1, 2)).not.toBe(2);
});
3 changes: 3 additions & 0 deletions src/background/eko.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

// Eko Workflow Core Code
console.log('eko workflow')
9 changes: 9 additions & 0 deletions src/background/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { WebSearch } from "./tools/web_search";
import './eko'

setTimeout(async () => {
// Test
let search = new WebSearch()
let result = await search.execute({ query: '谢扬', maxResults: 5 })
console.log(result)
}, 2000)
Empty file.
Loading

0 comments on commit 919e17f

Please sign in to comment.