foliko 1.0.76 → 1.0.78
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/.agent/data/default.json +31559 -0
- package/.agent/data/plugins-state.json +10 -1
- package/.claude/settings.local.json +13 -2
- package/.env.example +56 -54
- package/examples/basic.js +1 -1
- package/package.json +83 -81
- package/plugins/ai-plugin.js +2 -2
- package/plugins/ambient-agent/index.js +1 -1
- package/plugins/audit-plugin.js +1 -1
- package/plugins/default-plugins.js +92 -209
- package/plugins/email/index.js +1 -1
- package/plugins/extension-executor-plugin.js +326 -0
- package/plugins/feishu-plugin.js +1 -1
- package/plugins/file-system-plugin.js +57 -6
- package/plugins/gate-trading.js +747 -0
- package/plugins/install-plugin.js +1 -1
- package/plugins/python-executor-plugin.js +1 -1
- package/plugins/python-plugin-loader.js +275 -105
- package/plugins/rules-plugin.js +1 -1
- package/plugins/scheduler-plugin.js +1 -1
- package/plugins/session-plugin.js +132 -7
- package/plugins/shell-executor-plugin.js +1 -1
- package/plugins/storage-plugin.js +24 -1
- package/plugins/subagent-plugin.js +2 -2
- package/plugins/telegram-plugin.js +1 -1
- package/plugins/think-plugin.js +10 -10
- package/plugins/tools-plugin.js +1 -1
- package/plugins/web-plugin.js +49 -18
- package/plugins/weixin-plugin.js +1 -1
- package/skills/foliko-dev/SKILL.md +583 -500
- package/skills/python-plugin-dev/SKILL.md +238 -266
- package/src/core/agent-chat.js +103 -4
- package/src/core/agent.js +84 -18
- package/src/core/plugin-base.js +43 -0
- package/src/executors/mcp-executor.js +126 -22
|
@@ -57,7 +57,8 @@
|
|
|
57
57
|
"maxSessions": 100,
|
|
58
58
|
"maxHistoryLength": 150,
|
|
59
59
|
"autoCleanup": true,
|
|
60
|
-
"cleanupInterval": 300000
|
|
60
|
+
"cleanupInterval": 300000,
|
|
61
|
+
"persistToStorage": true
|
|
61
62
|
}
|
|
62
63
|
},
|
|
63
64
|
"audit": {
|
|
@@ -251,5 +252,13 @@
|
|
|
251
252
|
"agentsDir": "D:\\code\\vb-agent\\.agent\\agents",
|
|
252
253
|
"agents": []
|
|
253
254
|
}
|
|
255
|
+
},
|
|
256
|
+
"extension-executor": {
|
|
257
|
+
"enabled": true,
|
|
258
|
+
"config": {}
|
|
259
|
+
},
|
|
260
|
+
"gate-trading": {
|
|
261
|
+
"enabled": true,
|
|
262
|
+
"config": {}
|
|
254
263
|
}
|
|
255
264
|
}
|
|
@@ -152,8 +152,19 @@
|
|
|
152
152
|
"Bash(git checkout:*)",
|
|
153
153
|
"Bash(node --check plugins/default-plugins.js && echo \"OK\")",
|
|
154
154
|
"Bash(node --check plugins/subagent-plugin.js && echo \"OK\")",
|
|
155
|
-
"Bash(
|
|
156
|
-
"Bash(
|
|
155
|
+
"Bash(cd D:/Code/vb-agent && pnpm install 2>&1 | tail -10)",
|
|
156
|
+
"Bash(mkdir -p \"D:/Code/vb-agent/node_modules/@chanak\" && ln -sf \"../../.pnpm/@chnak+zod-to-markdown@1.0.1/node_modules/@chnak/zod-to-markdown\" \"D:/Code/vb-agent/node_modules/@chnak/zod-to-markdown\")",
|
|
157
|
+
"Bash(cd D:/Code/vb-agent && rm -rf node_modules/@chanak && npm install @chnak/zod-to-markdown --legacy-peer-deps 2>&1 | tail -10)",
|
|
158
|
+
"Bash(cd D:/Code/vb-agent && npm start 2>&1 | head -30)",
|
|
159
|
+
"Bash(cd D:/Code/vb-agent && npm start 2>&1 | head -40)",
|
|
160
|
+
"Bash(grep -l \"module.exports\" D:/Code/vb-agent/plugins/*.js 2>/dev/null | head -20)",
|
|
161
|
+
"Bash(grep -E \"^module.exports\" D:/Code/vb-agent/plugins/*.js | head -30)",
|
|
162
|
+
"Bash(grep -E \"^module.exports\" D:/Code/vb-agent/src/executors/*.js 2>/dev/null)",
|
|
163
|
+
"Bash(grep \"module.exports\" D:/Code/vb-agent/plugins/ambient-agent/*.js 2>/dev/null)",
|
|
164
|
+
"Bash(grep -E \"^module.exports\" D:/Code/vb-agent/plugins/*.js | head -20)",
|
|
165
|
+
"Bash(cd D:/Code/vb-agent && npm start 2>&1 | head -25)",
|
|
166
|
+
"Bash(cd D:/Code/vb-agent && timeout 20 npm start 2>&1 | head -35)",
|
|
167
|
+
"Bash(node -c D:/Code/vb-agent/plugins/gate-trading.js 2>&1)"
|
|
157
168
|
]
|
|
158
169
|
}
|
|
159
170
|
}
|
package/.env.example
CHANGED
|
@@ -1,54 +1,56 @@
|
|
|
1
|
-
# ========== AI Configuration ==========
|
|
2
|
-
#
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
#
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
#
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
1
|
+
# ========== AI Configuration ==========
|
|
2
|
+
# 最大输出 tokens(影响 AI 回复长度)
|
|
3
|
+
MAX_OUTPUT_TOKENS=8192
|
|
4
|
+
# AI Provider: minimax, deepseek, openai, anthropic 等
|
|
5
|
+
FOLIKO_PROVIDER=minimax
|
|
6
|
+
|
|
7
|
+
# AI Model(如果未设置,使用 provider 默认值)
|
|
8
|
+
# MiniMax: MiniMax-M2.7
|
|
9
|
+
# DeepSeek: deepseek-chat, deepseek-coder 等
|
|
10
|
+
FOLIKO_MODEL=MiniMax-M2.7
|
|
11
|
+
|
|
12
|
+
# API Base URL(如果未设置,使用 provider 默认值)
|
|
13
|
+
# MiniMax: https://api.minimaxi.com/v1
|
|
14
|
+
# DeepSeek: https://api.deepseek.com/v1
|
|
15
|
+
FOLIKO_BASE_URL=https://api.minimaxi.com/v1
|
|
16
|
+
|
|
17
|
+
# API Key(通用,如果未设置则尝试 provider 专用 key)
|
|
18
|
+
FOLIKO_API_KEY=sk-your-api-key
|
|
19
|
+
|
|
20
|
+
# Provider 专用 API Key(可选,如果 FOLIKO_API_KEY 未设置则使用这些)
|
|
21
|
+
DEEPSEEK_API_KEY=sk-your-deepseek-api-key
|
|
22
|
+
MINIMAX_API_KEY=sk-your-minimax-api-key
|
|
23
|
+
|
|
24
|
+
# ========== Email Configuration ==========
|
|
25
|
+
# SMTP Settings (for sending emails)
|
|
26
|
+
SMTP_HOST=smtp.gmail.com
|
|
27
|
+
SMTP_PORT=587
|
|
28
|
+
SMTP_SECURE=false
|
|
29
|
+
SMTP_USER=your-email@gmail.com
|
|
30
|
+
SMTP_PASS=your-app-password
|
|
31
|
+
|
|
32
|
+
# IMAP Settings (for reading emails)
|
|
33
|
+
IMAP_HOST=imap.gmail.com
|
|
34
|
+
IMAP_PORT=993
|
|
35
|
+
IMAP_USER=your-email@gmail.com
|
|
36
|
+
IMAP_PASS=your-app-password
|
|
37
|
+
|
|
38
|
+
# Default sender email address
|
|
39
|
+
FROM_EMAIL=your-email@gmail.com
|
|
40
|
+
|
|
41
|
+
# ========== Telegram Bot (optional) ==========
|
|
42
|
+
TELEGRAM_BOT_TOKEN=your-telegram-bot-token
|
|
43
|
+
|
|
44
|
+
# ========== Feishu Bot (optional) ==========
|
|
45
|
+
FEISHU_APP_ID=cli_xxxxxxxxxxx
|
|
46
|
+
FEISHU_APP_SECRET=app_secret
|
|
47
|
+
|
|
48
|
+
# ========== Web Server (optional) ==========
|
|
49
|
+
# Web 服务端口,默认 8088
|
|
50
|
+
WEB_PORT=3000
|
|
51
|
+
|
|
52
|
+
# Web 服务主机,默认 127.0.0.1
|
|
53
|
+
WEB_HOST=127.0.0.1
|
|
54
|
+
|
|
55
|
+
# 公网访问的 base URL(用于生成 webhook URL 等),不设置则使用 host:port,最好部署在docker中可以暴露自定义域名
|
|
56
|
+
WEB_BASE_URL=https://your-domain.com
|
package/examples/basic.js
CHANGED
package/package.json
CHANGED
|
@@ -1,81 +1,83 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "foliko",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "简约的插件化 Agent 框架",
|
|
5
|
-
"main": "src/index.js",
|
|
6
|
-
"type": "commonjs",
|
|
7
|
-
"bin": {
|
|
8
|
-
"foliko": "./cli/bin/foliko.js"
|
|
9
|
-
},
|
|
10
|
-
"scripts": {
|
|
11
|
-
"start": "node examples/basic.js",
|
|
12
|
-
"chat": "node cli/bin/foliko.js chat",
|
|
13
|
-
"dev": "node --watch examples/basic.js",
|
|
14
|
-
"lint": "echo \"No linter configured\"",
|
|
15
|
-
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yaml,yml,md,css,html}\"",
|
|
16
|
-
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yaml,yml,md,css,html}\"",
|
|
17
|
-
"prepare": "husky"
|
|
18
|
-
},
|
|
19
|
-
"lint-staged": {
|
|
20
|
-
"*.{js,jsx,ts,tsx}": [
|
|
21
|
-
"prettier --write"
|
|
22
|
-
],
|
|
23
|
-
"*.{json,yaml,yml}": [
|
|
24
|
-
"prettier --write"
|
|
25
|
-
],
|
|
26
|
-
"*.{md,mdx}": [
|
|
27
|
-
"prettier --write"
|
|
28
|
-
],
|
|
29
|
-
"*.{css,scss,less}": [
|
|
30
|
-
"prettier --write"
|
|
31
|
-
],
|
|
32
|
-
"*.{html,svg}": [
|
|
33
|
-
"prettier --write"
|
|
34
|
-
]
|
|
35
|
-
},
|
|
36
|
-
"engines": {
|
|
37
|
-
"node": ">=18.0.0"
|
|
38
|
-
},
|
|
39
|
-
"keywords": [
|
|
40
|
-
"agent",
|
|
41
|
-
"ai",
|
|
42
|
-
"framework",
|
|
43
|
-
"plugin",
|
|
44
|
-
"claude",
|
|
45
|
-
"openai",
|
|
46
|
-
"anthropic"
|
|
47
|
-
],
|
|
48
|
-
"author": "",
|
|
49
|
-
"license": "MIT",
|
|
50
|
-
"dependencies": {
|
|
51
|
-
"@ai-sdk/anthropic": "^3.0.58",
|
|
52
|
-
"@ai-sdk/mcp": "^1.0.25",
|
|
53
|
-
"@ai-sdk/openai": "^3.0.41",
|
|
54
|
-
"@ai-sdk/openai-compatible": "^2.0.35",
|
|
55
|
-
"@anthropic-ai/sdk": "^0.39.0",
|
|
56
|
-
"@chnak/weixin-bot": "^1.2.1",
|
|
57
|
-
"@
|
|
58
|
-
"@
|
|
59
|
-
"@
|
|
60
|
-
"
|
|
61
|
-
"
|
|
62
|
-
"
|
|
63
|
-
"
|
|
64
|
-
"
|
|
65
|
-
"
|
|
66
|
-
"
|
|
67
|
-
"
|
|
68
|
-
"
|
|
69
|
-
"
|
|
70
|
-
"
|
|
71
|
-
"
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
"
|
|
80
|
-
|
|
81
|
-
|
|
1
|
+
{
|
|
2
|
+
"name": "foliko",
|
|
3
|
+
"version": "1.0.78",
|
|
4
|
+
"description": "简约的插件化 Agent 框架",
|
|
5
|
+
"main": "src/index.js",
|
|
6
|
+
"type": "commonjs",
|
|
7
|
+
"bin": {
|
|
8
|
+
"foliko": "./cli/bin/foliko.js"
|
|
9
|
+
},
|
|
10
|
+
"scripts": {
|
|
11
|
+
"start": "node examples/basic.js",
|
|
12
|
+
"chat": "node cli/bin/foliko.js chat",
|
|
13
|
+
"dev": "node --watch examples/basic.js",
|
|
14
|
+
"lint": "echo \"No linter configured\"",
|
|
15
|
+
"format": "prettier --write \"**/*.{js,jsx,ts,tsx,json,yaml,yml,md,css,html}\"",
|
|
16
|
+
"format:check": "prettier --check \"**/*.{js,jsx,ts,tsx,json,yaml,yml,md,css,html}\"",
|
|
17
|
+
"prepare": "husky"
|
|
18
|
+
},
|
|
19
|
+
"lint-staged": {
|
|
20
|
+
"*.{js,jsx,ts,tsx}": [
|
|
21
|
+
"prettier --write"
|
|
22
|
+
],
|
|
23
|
+
"*.{json,yaml,yml}": [
|
|
24
|
+
"prettier --write"
|
|
25
|
+
],
|
|
26
|
+
"*.{md,mdx}": [
|
|
27
|
+
"prettier --write"
|
|
28
|
+
],
|
|
29
|
+
"*.{css,scss,less}": [
|
|
30
|
+
"prettier --write"
|
|
31
|
+
],
|
|
32
|
+
"*.{html,svg}": [
|
|
33
|
+
"prettier --write"
|
|
34
|
+
]
|
|
35
|
+
},
|
|
36
|
+
"engines": {
|
|
37
|
+
"node": ">=18.0.0"
|
|
38
|
+
},
|
|
39
|
+
"keywords": [
|
|
40
|
+
"agent",
|
|
41
|
+
"ai",
|
|
42
|
+
"framework",
|
|
43
|
+
"plugin",
|
|
44
|
+
"claude",
|
|
45
|
+
"openai",
|
|
46
|
+
"anthropic"
|
|
47
|
+
],
|
|
48
|
+
"author": "",
|
|
49
|
+
"license": "MIT",
|
|
50
|
+
"dependencies": {
|
|
51
|
+
"@ai-sdk/anthropic": "^3.0.58",
|
|
52
|
+
"@ai-sdk/mcp": "^1.0.25",
|
|
53
|
+
"@ai-sdk/openai": "^3.0.41",
|
|
54
|
+
"@ai-sdk/openai-compatible": "^2.0.35",
|
|
55
|
+
"@anthropic-ai/sdk": "^0.39.0",
|
|
56
|
+
"@chnak/weixin-bot": "^1.2.1",
|
|
57
|
+
"@chnak/zod-to-markdown": "^1.0.1",
|
|
58
|
+
"@hono/node-server": "^1.19.11",
|
|
59
|
+
"@larksuiteoapi/node-sdk": "^1.59.0",
|
|
60
|
+
"@modelcontextprotocol/sdk": "^1.27.1",
|
|
61
|
+
"ai": "^6.0.116",
|
|
62
|
+
"dotenv": "^17.3.1",
|
|
63
|
+
"gate-api": "^7.2.57",
|
|
64
|
+
"hono": "^4.12.9",
|
|
65
|
+
"imap-mkl": "^1.0.2",
|
|
66
|
+
"mailparser": "^3.7.2",
|
|
67
|
+
"marked": "^11.2.0",
|
|
68
|
+
"marked-terminal": "6",
|
|
69
|
+
"node-cron": "^4.2.1",
|
|
70
|
+
"node-html-markdown": "^1.3.0",
|
|
71
|
+
"node-telegram-bot-api": "^0.67.0",
|
|
72
|
+
"nodemailer": "^6.10.0",
|
|
73
|
+
"qrcode-terminal": "^0.12.0",
|
|
74
|
+
"remove-markdown": "^0.6.3",
|
|
75
|
+
"vm2": "^3.10.5",
|
|
76
|
+
"zod": "^3.25.76"
|
|
77
|
+
},
|
|
78
|
+
"devDependencies": {
|
|
79
|
+
"husky": "^9.1.7",
|
|
80
|
+
"lint-staged": "^16.4.0",
|
|
81
|
+
"prettier": "^3.8.1"
|
|
82
|
+
}
|
|
83
|
+
}
|
package/plugins/ai-plugin.js
CHANGED
|
@@ -23,7 +23,7 @@ class AIPlugin extends Plugin {
|
|
|
23
23
|
apiKey: config.apiKey,
|
|
24
24
|
baseURL: config.baseURL,
|
|
25
25
|
maxSteps: config.maxSteps || 20,
|
|
26
|
-
maxOutputTokens:config.maxOutputTokens||8192
|
|
26
|
+
maxOutputTokens:config.maxOutputTokens||parseInt(process.env.MAX_OUTPUT_TOKENS)||8192
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
this._aiClient = null
|
|
@@ -99,4 +99,4 @@ class AIPlugin extends Plugin {
|
|
|
99
99
|
}
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
module.exports =
|
|
102
|
+
module.exports = AIPlugin
|
package/plugins/audit-plugin.js
CHANGED