foliko 1.1.49 → 1.1.51

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.
@@ -32,5 +32,27 @@
32
32
  },
33
33
  "createdAt": "2026-05-01T16:24:24.447Z",
34
34
  "lastActive": "2026-05-01T16:24:24.447Z"
35
+ },
36
+ "session:qq_c2c_default_c2c": {
37
+ "messages": [],
38
+ "variables": {},
39
+ "metadata": {
40
+ "platform": "qq",
41
+ "identifier": "default_c2c",
42
+ "type": "c2c"
43
+ },
44
+ "createdAt": "2026-05-02T14:21:02.797Z",
45
+ "lastActive": "2026-05-02T14:21:02.797Z"
46
+ },
47
+ "session:qq_group_default_group": {
48
+ "messages": [],
49
+ "variables": {},
50
+ "metadata": {
51
+ "platform": "qq",
52
+ "identifier": "default_group",
53
+ "type": "group"
54
+ },
55
+ "createdAt": "2026-05-02T14:21:02.798Z",
56
+ "lastActive": "2026-05-02T14:21:02.798Z"
35
57
  }
36
58
  }
@@ -90,6 +90,168 @@
90
90
  "text": "好问题!让我给你列一下我能做的事情:\n\n## 🛠️ 核心能力\n\n### 💬 对话聊天\n- 日常聊天、回答问题、提供建议\n\n### 📝 文件操作\n- 读写文件、搜索内容、创建目录、修改文件\n\n### 🌐 网络请求\n- 抓取网页、调用 API、获取远程数据\n\n### 🐍 编程执行\n- 执行 Python 代码、安装 Python 包\n- 执行 Shell 命令、运行脚本\n\n### 🎨 创意设计\n- **制作海报** - 用 poster 插件生成精美海报/卡片\n- **Markdown 转图片** - 把文档渲染成图片\n\n### ⏰ 定时任务\n- 设置提醒、定时执行任务、Cron 表达式\n\n### 🧠 记忆系统\n- 记住你的偏好、项目信息、参考资料\n\n### 🔌 扩展插件\n- **加密货币交易** - Gate.io 现货/合约交易\n- **QQ 消息** - 发送 QQ 私聊/群聊消息\n- **Web 服务** - 启动 HTTP 服务、注册 Webhook\n\n### 🤖 子 Agent 专家团队\n- **前端开发** - 写 React/Vue/HTML/CSS\n- **后端开发** - API、数据库、微服务\n- **UI 设计** - 界面设计、交互设计\n- **数据分析** - 统计、可视化、报表\n- **DevOps** - 部署、Docker、K8s\n- **测试/安全** - 自动化测试、代码审计\n- **产品经理** - 需求分析、PRD\n\n### 🎯 技能系统\n- 浏览器自动化、工作流引擎、主动思考等\n\n---\n\n**想试试哪个?** 比如我马上可以:\n- 给你画张海报 🎨\n- 写个小程序 💻\n- 查个有趣的信息 🌐\n- 设置个定时提醒 ⏰"
91
91
  }
92
92
  ]
93
+ },
94
+ {
95
+ "role": "user",
96
+ "content": "在吗"
97
+ },
98
+ {
99
+ "role": "assistant",
100
+ "content": [
101
+ {
102
+ "type": "reasoning",
103
+ "text": "用户问\"在吗\",很简单的问候。我不需要调用工具,直接友好回应即可。"
104
+ },
105
+ {
106
+ "type": "text",
107
+ "text": "在呢!😄 随时待命~\n\n有什么需要帮忙的,直接说!"
108
+ }
109
+ ]
110
+ },
111
+ {
112
+ "role": "user",
113
+ "content": "Hi"
114
+ },
115
+ {
116
+ "role": "assistant",
117
+ "content": [
118
+ {
119
+ "type": "reasoning",
120
+ "text": "用户只是简单打了个招呼\"Hi\",直接友好回应即可,不需要调用工具。"
121
+ },
122
+ {
123
+ "type": "text",
124
+ "text": "Hi!👋 有什么可以帮你的吗?"
125
+ }
126
+ ]
127
+ },
128
+ {
129
+ "role": "user",
130
+ "content": "你好"
131
+ },
132
+ {
133
+ "role": "assistant",
134
+ "content": [
135
+ {
136
+ "type": "reasoning",
137
+ "text": "用户再次说\"你好\",看起来像是在测试或者随意打招呼。我就简单回应一下就好。"
138
+ },
139
+ {
140
+ "type": "text",
141
+ "text": "你好呀!😊 我一直在,随时可以陪你聊天或者帮你做事~"
142
+ }
143
+ ]
144
+ },
145
+ {
146
+ "role": "user",
147
+ "content": "哈哈"
148
+ },
149
+ {
150
+ "role": "assistant",
151
+ "content": [
152
+ {
153
+ "type": "reasoning",
154
+ "text": "用户只是笑了下,看来心情不错。我可以轻松回应一下,然后可能引导对话继续。"
155
+ },
156
+ {
157
+ "type": "text",
158
+ "text": "哈哈,心情不错嘛!😄\n\n有什么想聊的,或者想让我帮你做点好玩的吗?"
159
+ }
160
+ ]
161
+ },
162
+ {
163
+ "role": "user",
164
+ "content": "你好"
165
+ },
166
+ {
167
+ "role": "assistant",
168
+ "content": [
169
+ {
170
+ "type": "text",
171
+ "text": "<think>用户只是说\"你好\",这是一个简单的问候。我应该简洁地回复,保持友好。\n</think>\n\n你好!👋"
172
+ }
173
+ ]
174
+ },
175
+ {
176
+ "role": "user",
177
+ "content": "怎么这么慢?"
178
+ },
179
+ {
180
+ "role": "assistant",
181
+ "content": [
182
+ {
183
+ "type": "text",
184
+ "text": "<think>用户说\"怎么这么慢?\",可能是指我回复慢,或者是在问我为什么某个操作慢。但我一般回复挺快的,可能用户是在开玩笑或者想要我执行某个操作?\n\n我应该回应一下,看看用户需要什么。\n</think>\n\n抱歉让你久等了!😅\n\n是在等我做什么操作吗?还是单纯想聊聊天?告诉我你需要什么~"
185
+ }
186
+ ]
187
+ },
188
+ {
189
+ "role": "user",
190
+ "content": "没有"
191
+ },
192
+ {
193
+ "role": "assistant",
194
+ "content": [
195
+ {
196
+ "type": "text",
197
+ "text": "<think>用户说\"没有\",表示没什么特别的事要做。我就简单回复一下,保持轻松的语气。\n</think>\n\n好的,那我就陪着你~ 😊\n\n有需要随时说!"
198
+ }
199
+ ]
200
+ },
201
+ {
202
+ "role": "user",
203
+ "content": "今天星期几"
204
+ },
205
+ {
206
+ "role": "assistant",
207
+ "content": [
208
+ {
209
+ "type": "text",
210
+ "text": "<think>用户问今天星期几,我之前已经回答过了是2026年5月2日星期六。让我再获取一下时间确认一下。\n</think>\n\n\n"
211
+ },
212
+ {
213
+ "type": "tool-call",
214
+ "toolCallId": "call_function_kaxyw4vfiym7_1",
215
+ "toolName": "get_time",
216
+ "input": {}
217
+ }
218
+ ]
219
+ },
220
+ {
221
+ "role": "tool",
222
+ "content": [
223
+ {
224
+ "type": "tool-result",
225
+ "toolCallId": "call_function_kaxyw4vfiym7_1",
226
+ "toolName": "get_time",
227
+ "output": {
228
+ "type": "text",
229
+ "value": "{\"success\":true,\"beijingTime\":\"2026-05-02 22:22:27\",\"timestamp\":1777731747493,\"timezone\":\"Asia/Shanghai (UTC+8)\",\"formatted\":{\"year\":2026,\"month\":\"05\",\"day\":\"02\",\"hour\":\"22\",\"minute\":\"22\",\"second\":\"22\"}}"
230
+ }
231
+ }
232
+ ]
233
+ },
234
+ {
235
+ "role": "assistant",
236
+ "content": [
237
+ {
238
+ "type": "text",
239
+ "text": "<think>用户问今天星期几,根据时间信息,今天是2026年5月2日。我需要根据日期判断是星期几。\n\n2026年5月2日,让我算一下:\n- 2026年1月1日是星期几?我需要查一下\n- 或者用计算方法\n\n2026年是平年(不能被4整除),1月1日到5月2日:\n- 1月:31天\n- 2月:28天\n- 3月:31天\n- 4月:30天\n- 5月2日:2天\n\n总天数 = 31 + 28 + 31 + 30 + 2 = 122天\n\n需要知道2026年1月1日是星期几。2025年1月1日是星期三(2024是闰年)。\n2026年1月1日 = 2025年1月1日 + 365天\n365 mod 7 = 1,所以2026年1月1日是星期四\n\n122天后的星期 = 4 + (122 - 1) mod 7 = 4 + 121 mod 7\n121 mod 7 = 2(因为 119 = 17*7)\n所以是 4 + 2 = 6,星期六\n\n是的,5月2日确实是星期六。\n</think>\n\n今天是 **2026年5月2日,星期六** 🎉\n\n周末愉快~"
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "role": "user",
245
+ "content": "OK"
246
+ },
247
+ {
248
+ "role": "assistant",
249
+ "content": [
250
+ {
251
+ "type": "text",
252
+ "text": "<think>用户回复 OK,这是一个简单的确认。我可以简短回复,保持对话轻松。\n</think>\n\n👍 有事叫我!"
253
+ }
254
+ ]
93
255
  }
94
256
  ],
95
257
  "variables": {},
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foliko",
3
- "version": "1.1.49",
3
+ "version": "1.1.51",
4
4
  "description": "简约的插件化 Agent 框架",
5
5
  "main": "src/index.js",
6
6
  "type": "commonjs",
@@ -355,13 +355,6 @@ class QQPlugin extends Plugin {
355
355
  }
356
356
 
357
357
  async _initBotAsync() {
358
- log.info('QQ 配置检查:', {
359
- appId: this.config.appId,
360
- clientSecret: this.config.clientSecret ? '***' + this.config.clientSecret.slice(-6) : 'undefined',
361
- envQQ_APP_ID: process.env.QQ_APP_ID,
362
- envQQ_CLIENT_SECRET: process.env.QQ_CLIENT_SECRET ? '***' + process.env.QQ_CLIENT_SECRET.slice(-6) : 'undefined',
363
- });
364
-
365
358
  if (!this.config.appId || !this.config.clientSecret) {
366
359
  log.error('QQ_APP_ID and QQ_CLIENT_SECRET must be configured')
367
360
  return
@@ -412,6 +405,35 @@ class QQPlugin extends Plugin {
412
405
  })
413
406
 
414
407
  log.info('QQ Bot 已连接')
408
+
409
+ // 预先创建默认 session scope,避免收到消息时延迟
410
+ this._ensureDefaultSessionScopes()
411
+ }
412
+
413
+ /**
414
+ * 预先创建默认的 session scope
415
+ * 避免收到消息时才创建导致的延迟
416
+ */
417
+ _ensureDefaultSessionScopes() {
418
+ try {
419
+ // 创建默认的私聊 session agent 和 scope
420
+ const defaultC2CId = 'default_c2c'
421
+ const { agent: c2cAgent, sessionId: c2cSessionId } = this._getSessionAgent(defaultC2CId, 'c2c')
422
+ if (c2cAgent && !this._sessionScopes.has(c2cSessionId)) {
423
+ this._setupSessionScopeListeners(c2cAgent, c2cSessionId, null, defaultC2CId, 'c2c')
424
+ }
425
+
426
+ // 创建默认的群聊 session agent 和 scope
427
+ const defaultGroupId = 'default_group'
428
+ const { agent: groupAgent, sessionId: groupSessionId } = this._getSessionAgent(defaultGroupId, 'group')
429
+ if (groupAgent && !this._sessionScopes.has(groupSessionId)) {
430
+ this._setupSessionScopeListeners(groupAgent, groupSessionId, null, defaultGroupId, 'group')
431
+ }
432
+
433
+ log.info('Default session scopes prepared')
434
+ } catch (err) {
435
+ log.warn('Failed to prepare default session scopes:', err.message)
436
+ }
415
437
  }
416
438
 
417
439
  /**
@@ -67,6 +67,9 @@ class Subagent extends EventEmitter {
67
67
  // 标记为子Agent(用于区分主Agent)
68
68
  this._isSubagent = true;
69
69
 
70
+ this.providerOptions.deepseek = this.providerOptions.deepseek || {};
71
+ this.providerOptions.deepseek.thinking={ type: 'disabled' }
72
+
70
73
  this.framework.once('framework:ready', () => {
71
74
  const extExecutor = this.framework?.pluginManager?.get('extension-executor');
72
75
  extExecutor._refreshAllAgentsExtPrompt(this.framework);