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.
@@ -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(head -1 \"D:\\\\code\\\\vb-agent\\\\cli\\\\bin\\\\foliko.js\" | xxd)",
156
- "Bash(node D:/code/vb-agent/cli/bin/foliko.js chat)"
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
- # AI Provider: minimax, deepseek, openai, anthropic 等
3
- FOLIKO_PROVIDER=minimax
4
-
5
- # AI Model(如果未设置,使用 provider 默认值)
6
- # MiniMax: MiniMax-M2.7
7
- # DeepSeek: deepseek-chat, deepseek-coder
8
- FOLIKO_MODEL=MiniMax-M2.7
9
-
10
- # API Base URL(如果未设置,使用 provider 默认值)
11
- # MiniMax: https://api.minimaxi.com/v1
12
- # DeepSeek: https://api.deepseek.com/v1
13
- FOLIKO_BASE_URL=https://api.minimaxi.com/v1
14
-
15
- # API Key(通用,如果未设置则尝试 provider 专用 key)
16
- FOLIKO_API_KEY=sk-your-api-key
17
-
18
- # Provider 专用 API Key(可选,如果 FOLIKO_API_KEY 未设置则使用这些)
19
- DEEPSEEK_API_KEY=sk-your-deepseek-api-key
20
- MINIMAX_API_KEY=sk-your-minimax-api-key
21
-
22
- # ========== Email Configuration ==========
23
- # SMTP Settings (for sending emails)
24
- SMTP_HOST=smtp.gmail.com
25
- SMTP_PORT=587
26
- SMTP_SECURE=false
27
- SMTP_USER=your-email@gmail.com
28
- SMTP_PASS=your-app-password
29
-
30
- # IMAP Settings (for reading emails)
31
- IMAP_HOST=imap.gmail.com
32
- IMAP_PORT=993
33
- IMAP_USER=your-email@gmail.com
34
- IMAP_PASS=your-app-password
35
-
36
- # Default sender email address
37
- FROM_EMAIL=your-email@gmail.com
38
-
39
- # ========== Telegram Bot (optional) ==========
40
- TELEGRAM_BOT_TOKEN=your-telegram-bot-token
41
-
42
- # ========== Feishu Bot (optional) ==========
43
- FEISHU_APP_ID=cli_xxxxxxxxxxx
44
- FEISHU_APP_SECRET=app_secret
45
-
46
- # ========== Web Server (optional) ==========
47
- # Web 服务端口,默认 8088
48
- WEB_PORT=3000
49
-
50
- # Web 服务主机,默认 127.0.0.1
51
- WEB_HOST=127.0.0.1
52
-
53
- # 公网访问的 base URL(用于生成 webhook URL 等),不设置则使用 host:port,最好部署在docker中可以暴露自定义域名
54
- WEB_BASE_URL=https://your-domain.com
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
@@ -4,7 +4,7 @@
4
4
  */
5
5
 
6
6
  const { Framework } = require('../src');
7
- const { AIPlugin } = require('../plugins/ai-plugin');
7
+ const AIPlugin = require('../plugins/ai-plugin');
8
8
  const { z } = require('zod');
9
9
 
10
10
  async function main() {
package/package.json CHANGED
@@ -1,81 +1,83 @@
1
- {
2
- "name": "foliko",
3
- "version": "1.0.76",
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
- "@hono/node-server": "^1.19.11",
58
- "@larksuiteoapi/node-sdk": "^1.59.0",
59
- "@modelcontextprotocol/sdk": "^1.27.1",
60
- "ai": "^6.0.116",
61
- "dotenv": "^17.3.1",
62
- "hono": "^4.12.9",
63
- "imap-mkl": "^1.0.2",
64
- "mailparser": "^3.7.2",
65
- "marked": "^11.2.0",
66
- "marked-terminal": "6",
67
- "node-cron": "^4.2.1",
68
- "node-telegram-bot-api": "^0.67.0",
69
- "nodemailer": "^6.10.0",
70
- "qrcode-terminal": "^0.12.0",
71
- "remove-markdown": "^0.6.3",
72
- "tiktoken": "^1.0.22",
73
- "vm2": "^3.10.5",
74
- "zod": "^3.24.0"
75
- },
76
- "devDependencies": {
77
- "husky": "^9.1.7",
78
- "lint-staged": "^16.4.0",
79
- "prettier": "^3.8.1"
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
+ }
@@ -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 = { AIPlugin }
102
+ module.exports = AIPlugin
@@ -576,4 +576,4 @@ ${eventList}
576
576
  }
577
577
  }
578
578
 
579
- module.exports = { AmbientAgentPlugin, GoalState }
579
+ module.exports = AmbientAgentPlugin
@@ -185,4 +185,4 @@ class AuditPlugin extends Plugin {
185
185
  }
186
186
  }
187
187
 
188
- module.exports = { AuditPlugin }
188
+ module.exports = AuditPlugin