@wwlocal/aibot-plugin-node 20260409.20.0 → 20260409.21.0

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.
Files changed (2) hide show
  1. package/README.md +30 -12
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -20,7 +20,7 @@
20
20
 
21
21
  - **可插拔适配器架构**:通过 `provider` 配置字段自动路由到对应适配器,新增 AI 平台只需实现一个适配器类
22
22
  - **monitor 层统一节流**:替代各适配器的分散节流,在 monitor 层统一控制中间帧发送频率
23
- - **流式过期降级**:当企微流式消息超过 6 分钟时自动降级为主动发送(基于response_url地址发送)
23
+ - **流式过期降级**:当企微流式消息超过 6 分钟时自动降级为主动发送
24
24
  - **LRU + TTL 内存管理**:消息状态、对话历史、ReqId 存储均有容量限制和自动过期清理
25
25
 
26
26
 
@@ -52,20 +52,20 @@
52
52
 
53
53
  ```
54
54
  ┌─────────────────────────────────────────────────────────────────────┐
55
- @wecom/aibot-plugin
55
+ @wwlocal/aibot-plugin-node
56
56
  │ │
57
- │ ┌──────────┐ ┌──────────────┐ ┌─────────────────────────────┐
57
+ │ ┌──────────┐ ┌──────────────┐ ┌─────────────────────────────┐
58
58
  │ │ index.ts │──→│ ServiceManager│──→│ monitorWeComProvider() │ │
59
- │ │ (入口) │ │ (多账号管理) │ │ ┌──────────────────────┐ │ │
60
- │ └──────────┘ └──────────────┘ │ │ WSClient (SDK) │ │
61
- │ │ │ │ - 连接管理 │ │
62
- │ │ ┌──────────────┐ │ │ - 消息监听 │ │
63
- │ └────────→│ Express HTTP │ │ │ - 心跳保活 │ │
64
- │ │ /health │ │ └──────────┬───────────┘ │ │
59
+ │ │ (入口) │ │ (多账号管理) │ │ ┌──────────────────────┐ │ │
60
+ │ └──────────┘ └──────────────┘ │ │ WSClient (SDK) │
61
+ │ │ │ │ - 连接管理 │ │
62
+ │ │ ┌──────────────┐ │ │ - 消息监听 │
63
+ │ └────────→│ Express HTTP │ │ │ - 心跳保活 │
64
+ │ │ /health │ │ └──────────┬───────────┘ │ │
65
65
  │ │ /api/status │ │ │ │ │
66
- │ └──────────────┘ │ ┌──────────▼───────────┐ │ │
66
+ │ └──────────────┘ │ ┌──────────▼───────────┐ │ │
67
67
  │ │ │ processWeComMessage()│ │ │
68
- │ │ │ 1. 解析消息内容 │ │ │
68
+ │ │ │ 1. 解析消息内容 │ │ │
69
69
  │ │ │ 2. 策略检查 │ │ │
70
70
  │ │ │ 3. 下载媒体 │ │ │
71
71
  │ │ │ 4. 初始化状态 │ │ │
@@ -160,7 +160,25 @@
160
160
  ## 安装
161
161
 
162
162
  ```bash
163
- npm install
163
+ # 全局安装
164
+ npm install -g @wwlocal/aibot-plugin-node
165
+ # 会安装到:
166
+ # /usr/local/lib/node_modules/@wwlocal/aibot-plugin-node
167
+
168
+ # 在项目目录中安装
169
+ # 1. 创建项目目录
170
+ mkdir ~/my-wecom-bot
171
+ cd ~/my-wecom-bot
172
+ # 2. 初始化 package.json
173
+ npm init -y
174
+ # 3. 安装依赖(会自动写入 package.json)
175
+ npm install @wwlocal/aibot-plugin-node
176
+ # 包在 ~/my-wecom-bot/node_modules/ 下
177
+
178
+ # 检查安装
179
+ npm list @wwlocal/aibot-plugin-node
180
+ npm list @wecom/aibot-node-sdk
181
+
164
182
  ```
165
183
 
166
184
  ## 配置
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wwlocal/aibot-plugin-node",
3
- "version": "20260409.20.0",
3
+ "version": "20260409.21.0",
4
4
  "type": "module",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",