foliko 1.0.15 → 1.0.16

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.
@@ -47,7 +47,15 @@
47
47
  "Bash(npx tsc:*)",
48
48
  "Bash(node --check /d/Code/vb-agent/plugins/weixin-plugin.js 2>&1)",
49
49
  "Bash(node --check /d/Code/vb-agent/plugins/telegram-plugin.js && node --check /d/Code/vb-agent/plugins/weixin-plugin.js && echo \"OK\")",
50
- "Bash(node --check /d/Code/vb-agent/cli/src/ui/chat-ui.js && echo \"OK\")"
50
+ "Bash(node --check /d/Code/vb-agent/cli/src/ui/chat-ui.js && echo \"OK\")",
51
+ "Bash(npm uninstall:*)",
52
+ "Bash(rm -rf /tmp/weixin-bot && git clone https://github.com/chnak/weixin-bot.git /tmp/weixin-bot 2>&1)",
53
+ "Bash(mkdir -p node_modules/@pinixai/weixin-bot && cp -r /tmp/weixin-bot/nodejs/* node_modules/@pinixai/weixin-bot/ && cd node_modules/@pinixai/weixin-bot && npm install 2>&1)",
54
+ "Bash(node --check /d/Code/vb-agent/plugins/weixin-plugin.js && echo \"OK\")",
55
+ "Bash(node -e \"import\\('@pinixai/weixin-bot'\\).then\\(m => console.log\\('OK:', Object.keys\\(m\\)\\)\\).catch\\(e => console.error\\('Error:', e.message\\)\\)\")",
56
+ "Bash(npm run:*)",
57
+ "Bash(node -e \"const { WeixinBot } = require\\('@pinixai/weixin-bot'\\); console.log\\(typeof WeixinBot\\)\" 2>&1)",
58
+ "Bash(node -e \"import\\('@pinixai/weixin-bot'\\).then\\(m => console.log\\('OK:', typeof m.WeixinBot\\)\\).catch\\(e => console.error\\('Error:', e.message\\)\\)\" 2>&1)"
51
59
  ]
52
60
  }
53
61
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "foliko",
3
- "version": "1.0.15",
3
+ "version": "1.0.16",
4
4
  "description": "简约的插件化 Agent 框架",
5
5
  "main": "src/index.js",
6
6
  "bin": {
@@ -26,7 +26,7 @@
26
26
  "@ai-sdk/openai-compatible": "^2.0.35",
27
27
  "@anthropic-ai/sdk": "^0.39.0",
28
28
  "@modelcontextprotocol/sdk": "^1.27.1",
29
- "@pinixai/weixin-bot": "^1.2.0",
29
+ "@pinixai/weixin-bot": "github:chnak/weixin-bot",
30
30
  "ai": "^6.0.116",
31
31
  "dotenv": "^17.3.1",
32
32
  "imap": "^0.8.19",
@@ -37,9 +37,7 @@
37
37
  "node-telegram-bot-api": "^0.67.0",
38
38
  "nodemailer": "^6.10.0",
39
39
  "qrcode-terminal": "^0.12.0",
40
+ "weixin-bot": "github:chnak/weixin-bot",
40
41
  "zod": "^3.24.0"
41
- },
42
- "devDependencies": {
43
- "typescript": "^5.9.3"
44
42
  }
45
43
  }
@@ -9,8 +9,6 @@
9
9
 
10
10
  const { Plugin } = require('../src/core/plugin-base')
11
11
  const { z } = require('zod')
12
- const path = require('path')
13
- const fs = require('fs')
14
12
 
15
13
  module.exports = function(Plugin) {
16
14
  return class WeixinPlugin extends Plugin {
@@ -57,30 +55,7 @@ module.exports = function(Plugin) {
57
55
  return this
58
56
  }
59
57
 
60
- async _checkAndBuild() {
61
- // 检查 dist 目录是否存在
62
- const weixinBotPkg = path.join(__dirname, '..', '..', 'node_modules', '@pinixai', 'weixin-bot', 'package.json')
63
- const pkgDir = path.dirname(weixinBotPkg)
64
- const distPath = path.join(pkgDir, 'dist', 'index.js')
65
-
66
- if (!fs.existsSync(distPath)) {
67
- console.log('[WeChat] Building @pinixai/weixin-bot...')
68
- const { execSync } = require('child_process')
69
- try {
70
- execSync('npx tsc', {
71
- cwd: pkgDir,
72
- stdio: 'inherit',
73
- timeout: 60000
74
- })
75
- console.log('[WeChat] Build complete')
76
- } catch (err) {
77
- console.warn('[WeChat] Build failed:', err.message)
78
- }
79
- }
80
- }
81
-
82
58
  async _initBotAsync() {
83
- await this._checkAndBuild()
84
59
 
85
60
  let WeixinBot
86
61
  try {