@chbo297/infoflow 2026.5.7-beta.0 → 2026.5.7-beta.2

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/README.md CHANGED
@@ -37,18 +37,50 @@ bash scripts/deploy.sh
37
37
  BAIDU_NPM_REGISTRY=http://registry.npm.baidu-int.com bash scripts/deploy.sh
38
38
  ```
39
39
 
40
+ ### 首次安装(推荐命令)
41
+
42
+ 首次在机器上安装时,推荐使用以下两种方式。
43
+
44
+ 方式 A:通过独立 tools 包安装并部署(推荐,支持 `update` 子命令)
45
+
46
+ ```bash
47
+ # 正式版(latest)
48
+ npx -y @chbo297/infoflow-openclaw-tools update --version 2026.5.6 --registry https://registry.npmjs.org
49
+
50
+ # Beta 版(示例)
51
+ npx -y @chbo297/infoflow-openclaw-tools@beta update --version 2026.5.7-beta.2 --registry https://registry.npmjs.org
52
+ ```
53
+
54
+ 方式 B:通过 OpenClaw 插件命令安装
55
+
56
+ ```bash
57
+ # 正式版
58
+ openclaw plugins install @chbo297/infoflow@2026.5.6
59
+
60
+ # Beta 版(示例)
61
+ openclaw plugins install @chbo297/infoflow@2026.5.7-beta.2
62
+ ```
63
+
64
+ 安装后建议检查插件状态:
65
+
66
+ ```bash
67
+ openclaw plugins list
68
+ openclaw plugins inspect infoflow
69
+ ```
70
+
40
71
  ### 通过 npx 一键更新安装
41
72
 
42
- 发布到 npm 后,可直接通过 `npx` 安装/升级到指定版本:
73
+ 发布到 npm 后,可直接通过独立 tools 包执行安装/升级:
43
74
 
44
75
  ```bash
45
- npm_config_registry=http://registry.npm.baidu-int.com npx -y @chbo297/infoflow update --version 2026.5.6
76
+ npx -y @chbo297/infoflow-openclaw-tools update --version 2026.5.6 --registry https://registry.npmjs.org
46
77
  ```
47
78
 
48
79
  常用参数:
49
80
 
50
81
  - `--version <version>`: 指定安装版本(默认 `latest`)
51
- - `--registry <url>`: 指定 npm 源(默认读取 `npm_config_registry`,否则回退 `http://registry.npm.baidu-int.com`)
82
+ - `--registry <url>`: 插件包下载源(默认 `https://registry.npmjs.org`)
83
+ - `--baidu-registry <url>`: `@baidu/infoflow-sdk-nodejs` 下载源(默认读取 `npm_config_registry`,否则回退 `http://registry.npm.baidu-int.com`)
52
84
  - `--channel-id <id>`: 目标插件目录名(默认 `infoflow`,安装到 `~/.openclaw/extensions/<id>`)
53
85
  - `--dry-run`: 仅打印命令,不写入系统
54
86
 
@@ -56,6 +88,7 @@ npm_config_registry=http://registry.npm.baidu-int.com npx -y @chbo297/infoflow u
56
88
 
57
89
  - `npx ... update` 与 `bash scripts/deploy.sh` 复用同一套部署核心逻辑(依赖安装、websocket 依赖校验、构建、配置写入、按状态重启 gateway)。
58
90
  - 如果 gateway 未运行,脚本会跳过重启,仅完成插件安装与构建。
91
+ - 插件包 `@chbo297/infoflow` 不再内置 `child_process` CLI,避免被 `openclaw plugins install` 的危险代码检测拦截。
59
92
 
60
93
  ### WebSocket 模式(可选)
61
94
 
package/package.json CHANGED
@@ -1,12 +1,9 @@
1
1
  {
2
2
  "name": "@chbo297/infoflow",
3
- "version": "2026.5.7-beta.0",
3
+ "version": "2026.5.7-beta.2",
4
4
  "description": "OpenClaw Infoflow (如流) channel plugin for Baidu enterprise messaging",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
7
- "bin": {
8
- "infoflow-openclaw": "dist/src/cli.js"
9
- },
10
7
  "license": "MIT",
11
8
  "keywords": [
12
9
  "openclaw",
@@ -126,8 +126,9 @@ if [ ! -d "$PLUGIN_DIR/dist" ] && [[ "$DRY_RUN" != "true" ]]; then
126
126
  fi
127
127
  echo " ✓ 已检测到构建产物目录:$PLUGIN_DIR/dist"
128
128
 
129
- if [ ! -f "$CONFIG_FILE" ]; then
130
- echo " 未找到 $CONFIG_FILE,请先完成 OpenClaw 初始化后再部署"
129
+ CONFIG_FILE_PATH="${CONFIG_FILE:-}"
130
+ if [ -z "$CONFIG_FILE_PATH" ] || [ ! -f "$CONFIG_FILE_PATH" ]; then
131
+ echo " ✗ 未找到 $CONFIG_FILE_PATH,请先完成 OpenClaw 初始化后再部署"
131
132
  exit 1
132
133
  fi
133
134
 
@@ -139,7 +140,7 @@ fi
139
140
  echo "==> 更新 OpenClaw 配置"
140
141
  node -e "
141
142
  const fs = require('fs');
142
- const cfg = JSON.parse(fs.readFileSync('$CONFIG_FILE', 'utf8'));
143
+ const cfg = JSON.parse(fs.readFileSync('$CONFIG_FILE_PATH', 'utf8'));
143
144
  const id = '$PLUGIN_ID';
144
145
 
145
146
  cfg.plugins = cfg.plugins ?? {};
@@ -148,7 +149,7 @@ node -e "
148
149
  else if (!cfg.plugins.entries[id].enabled) cfg.plugins.entries[id].enabled = true;
149
150
 
150
151
  if (Array.isArray(cfg.plugins.allow) && !cfg.plugins.allow.includes(id)) cfg.plugins.allow.push(id);
151
- fs.writeFileSync('$CONFIG_FILE', JSON.stringify(cfg, null, 2) + '\n');
152
+ fs.writeFileSync('$CONFIG_FILE_PATH', JSON.stringify(cfg, null, 2) + '\n');
152
153
  "
153
154
 
154
155
  echo "==> 检查 OpenClaw gateway 运行状态"