foliko 1.0.58 → 1.0.60
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "foliko",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.60",
|
|
4
4
|
"description": "简约的插件化 Agent 框架",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -40,6 +40,7 @@
|
|
|
40
40
|
"node-telegram-bot-api": "^0.67.0",
|
|
41
41
|
"nodemailer": "^6.10.0",
|
|
42
42
|
"qrcode-terminal": "^0.12.0",
|
|
43
|
+
"remove-markdown": "^0.6.3",
|
|
43
44
|
"tiktoken": "^1.0.22",
|
|
44
45
|
"zod": "^3.24.0"
|
|
45
46
|
}
|
package/plugins/feishu-plugin.js
CHANGED
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
const { Plugin } = require('../src/core/plugin-base')
|
|
12
12
|
const {cleanResponse} =require('../src/utils')
|
|
13
|
+
const removeMarkdown = require('remove-markdown');
|
|
13
14
|
class FeishuPlugin extends Plugin {
|
|
14
15
|
constructor(config = {}) {
|
|
15
16
|
super()
|
|
@@ -18,7 +19,10 @@ class FeishuPlugin extends Plugin {
|
|
|
18
19
|
this.description = '飞书对话插件,使用 WebSocket 长连接接收消息'
|
|
19
20
|
this.priority = 80
|
|
20
21
|
this.enabled = false
|
|
21
|
-
this.systemPrompt =
|
|
22
|
+
this.systemPrompt = `你是一个飞书助手。
|
|
23
|
+
|
|
24
|
+
**重要:**
|
|
25
|
+
-回复内容使用纯文本,不要使用markdown
|
|
22
26
|
|
|
23
27
|
**命令执行规范:**
|
|
24
28
|
- 执行 npx skills add / npx skills remove / npx skills list 命令时,必须自动添加参数:-a openclaw -y
|
|
@@ -320,6 +324,7 @@ class FeishuPlugin extends Plugin {
|
|
|
320
324
|
|
|
321
325
|
async _sendMessage(openId, text, originalMsg) {
|
|
322
326
|
if (!this._client) return
|
|
327
|
+
text=removeMarkdown(text)
|
|
323
328
|
try {
|
|
324
329
|
const chatId = originalMsg?.chat_id || originalMsg?.message?.chat_id
|
|
325
330
|
if (!chatId) return
|
package/plugins/weixin-plugin.js
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
|
|
10
10
|
const { Plugin } = require('../src/core/plugin-base')
|
|
11
11
|
const {cleanResponse} =require('../src/utils')
|
|
12
|
+
const removeMarkdown = require('remove-markdown');
|
|
12
13
|
const { z } = require('zod')
|
|
13
14
|
const { WeixinBot } = require('@chnak/weixin-bot')
|
|
14
15
|
|
|
@@ -22,7 +23,7 @@ class WeixinPlugin extends Plugin {
|
|
|
22
23
|
// 默认不启用,需要在 plugins.json 中设置 enabled: true
|
|
23
24
|
this.enabled = false
|
|
24
25
|
this.path=`.agent/data`
|
|
25
|
-
this.systemPrompt
|
|
26
|
+
this.systemPrompt=`你是一个微信助手。
|
|
26
27
|
|
|
27
28
|
**命令执行规范:**
|
|
28
29
|
- 执行 npx skills add / npx skills remove / npx skills list 命令时,必须自动添加参数:-a openclaw -y
|
|
@@ -287,6 +288,7 @@ class WeixinPlugin extends Plugin {
|
|
|
287
288
|
*/
|
|
288
289
|
async _sendMessageBatch(originalMsg, userId, text, useReply = true) {
|
|
289
290
|
const MAX_LEN = 500
|
|
291
|
+
text=removeMarkdown(text)
|
|
290
292
|
if (!text || text.length <= MAX_LEN) {
|
|
291
293
|
if (useReply && originalMsg) {
|
|
292
294
|
await this._bot.reply(originalMsg, text)
|