@colinlu50/openclaw-lark-stream 260323.1.0 → 260323.3.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.
- package/README.md +8 -5
- package/bin/openclaw-lark.js +29 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -20,12 +20,15 @@
|
|
|
20
20
|
|
|
21
21
|
## 📦 安装
|
|
22
22
|
|
|
23
|
-
需要 [OpenClaw](https://openclaw.ai)
|
|
23
|
+
需要 [OpenClaw](https://openclaw.ai) 和 Node.js(>= v22)。
|
|
24
24
|
|
|
25
|
-
>
|
|
25
|
+
> [!WARNING]
|
|
26
|
+
> OpenClaw 新发布的 **3.22** 版本存在不兼容变更,飞书插件运行会出现异常,正在兼容中。预计 **3.24 日**兼容完成。
|
|
27
|
+
> 请暂时使用 3.13 版本:
|
|
26
28
|
> ```bash
|
|
27
|
-
> npm install -g openclaw
|
|
29
|
+
> npm install -g openclaw@2026.3.13
|
|
28
30
|
> ```
|
|
31
|
+
> 查看当前版本:`openclaw -v`
|
|
29
32
|
|
|
30
33
|
```bash
|
|
31
34
|
npx -y @colinlu50/openclaw-lark-stream install
|
|
@@ -40,7 +43,7 @@ npx -y @colinlu50/openclaw-lark-stream install
|
|
|
40
43
|
|
|
41
44
|
```bash
|
|
42
45
|
cd ~/.openclaw/extensions
|
|
43
|
-
git clone
|
|
46
|
+
git clone https://github.com/ColinLu50/openclaw-lark-stream.git openclaw-lark-stream
|
|
44
47
|
cd openclaw-lark-stream && npm install && npm run build
|
|
45
48
|
openclaw gateway restart
|
|
46
49
|
```
|
|
@@ -59,4 +62,4 @@ openclaw config set channels.feishu.footer.status false # 隐藏完成状态
|
|
|
59
62
|
|
|
60
63
|
## 📄 许可证
|
|
61
64
|
|
|
62
|
-
MIT
|
|
65
|
+
MIT
|
package/bin/openclaw-lark.js
CHANGED
|
@@ -74,8 +74,13 @@ function checkOpenClawVersion() {
|
|
|
74
74
|
try {
|
|
75
75
|
const ver = execSync("openclaw -v", { encoding: "utf8" }).trim();
|
|
76
76
|
console.log(`OpenClaw version: ${ver}`);
|
|
77
|
+
if (!ver.includes("2026.3.13")) {
|
|
78
|
+
console.warn(`\n⚠️ This plugin is tested with OpenClaw 2026.3.13.`);
|
|
79
|
+
console.warn(` Current version: ${ver}`);
|
|
80
|
+
console.warn(` To install the compatible version: npm install -g openclaw@2026.3.13\n`);
|
|
81
|
+
}
|
|
77
82
|
} catch {
|
|
78
|
-
console.error("❌ OpenClaw not found. Install it first: npm install -g openclaw");
|
|
83
|
+
console.error("❌ OpenClaw not found. Install it first: npm install -g openclaw@2026.3.13");
|
|
79
84
|
process.exit(1);
|
|
80
85
|
}
|
|
81
86
|
}
|
|
@@ -92,7 +97,8 @@ async function configureBotIfNeeded() {
|
|
|
92
97
|
console.log(`\nFound existing bot config (App ID: ${existing.appId}).`);
|
|
93
98
|
const reuse = await ask("Use existing bot config? (Y/n): ");
|
|
94
99
|
if (reuse.toLowerCase() !== "n") {
|
|
95
|
-
|
|
100
|
+
// Keep bot credentials but ensure streaming is enabled
|
|
101
|
+
ensureStreamingConfig(cfg);
|
|
96
102
|
return;
|
|
97
103
|
}
|
|
98
104
|
}
|
|
@@ -144,6 +150,27 @@ async function configureBotIfNeeded() {
|
|
|
144
150
|
// Helpers
|
|
145
151
|
// ---------------------------------------------------------------------------
|
|
146
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Ensure streaming is enabled on an existing config.
|
|
155
|
+
*/
|
|
156
|
+
function ensureStreamingConfig(cfg) {
|
|
157
|
+
if (!cfg.channels?.feishu) return;
|
|
158
|
+
let changed = false;
|
|
159
|
+
if (!cfg.channels.feishu.streaming) {
|
|
160
|
+
cfg.channels.feishu.streaming = true;
|
|
161
|
+
changed = true;
|
|
162
|
+
}
|
|
163
|
+
const rm = cfg.channels.feishu.replyMode || {};
|
|
164
|
+
if (rm.direct !== "streaming" || rm.group !== "streaming" || rm.default !== "streaming") {
|
|
165
|
+
cfg.channels.feishu.replyMode = { direct: "streaming", group: "streaming", default: "streaming" };
|
|
166
|
+
changed = true;
|
|
167
|
+
}
|
|
168
|
+
if (changed) {
|
|
169
|
+
writeFileSync(CONFIG_FILE, JSON.stringify(cfg, null, 2) + "\n", "utf8");
|
|
170
|
+
console.log("Enabled streaming mode for all reply modes.");
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
|
|
147
174
|
function ask(prompt) {
|
|
148
175
|
const rl = createInterface({ input: process.stdin, output: process.stdout });
|
|
149
176
|
return new Promise((resolve) => {
|