openclaw-lark-multi-agent 1.4.1 → 1.4.3
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 +2 -2
- package/README.zh-CN.md +2 -2
- package/config.example.json +1 -1
- package/dist/cli.js +31 -6
- package/dist/feishu-bot.d.ts +19 -10
- package/dist/feishu-bot.js +470 -93
- package/dist/live-status.d.ts +17 -0
- package/dist/live-status.js +27 -0
- package/dist/message-store.d.ts +29 -0
- package/dist/message-store.js +162 -8
- package/dist/openclaw-client.d.ts +4 -0
- package/dist/openclaw-client.js +75 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ This project is a bridge layer for OpenClaw. It does **not** implement an agent
|
|
|
10
10
|
|
|
11
11
|
Lark/Feishu gives each bot its own app identity, but OpenClaw normally exposes one assistant identity per channel account. This bridge lets you create several Lark bots such as:
|
|
12
12
|
|
|
13
|
-
- `GPT Bot` → `
|
|
13
|
+
- `GPT Bot` → `phgeek-gw/gpt-5.6-sol`
|
|
14
14
|
- `Gemini Bot` → `github-copilot/gemini-3.1-pro-preview`
|
|
15
15
|
- `Claude Bot` → `github-copilot/claude-opus-4.7`
|
|
16
16
|
|
|
@@ -149,7 +149,7 @@ Edit `config.json`:
|
|
|
149
149
|
"name": "GPT",
|
|
150
150
|
"appId": "cli_xxx",
|
|
151
151
|
"appSecret": "YOUR_LARK_APP_SECRET",
|
|
152
|
-
"model": "
|
|
152
|
+
"model": "phgeek-gw/gpt-5.6-sol"
|
|
153
153
|
},
|
|
154
154
|
{
|
|
155
155
|
"name": "Gemini",
|
package/README.zh-CN.md
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
|
|
11
11
|
Lark/飞书里每个机器人都有自己的 App 身份,但 OpenClaw 通常在一个 channel account 下暴露一个助手身份。这个桥接层可以让你创建多个飞书机器人,例如:
|
|
12
12
|
|
|
13
|
-
- `GPT Bot` → `
|
|
13
|
+
- `GPT Bot` → `phgeek-gw/gpt-5.6-sol`
|
|
14
14
|
- `Gemini Bot` → `github-copilot/gemini-3.1-pro-preview`
|
|
15
15
|
- `Claude Bot` → `github-copilot/claude-opus-4.7`
|
|
16
16
|
|
|
@@ -127,7 +127,7 @@ cp config.example.json config.json
|
|
|
127
127
|
"name": "GPT",
|
|
128
128
|
"appId": "cli_xxx",
|
|
129
129
|
"appSecret": "YOUR_LARK_APP_SECRET",
|
|
130
|
-
"model": "
|
|
130
|
+
"model": "phgeek-gw/gpt-5.6-sol"
|
|
131
131
|
},
|
|
132
132
|
{
|
|
133
133
|
"name": "Gemini",
|
package/config.example.json
CHANGED
package/dist/cli.js
CHANGED
|
@@ -65,7 +65,7 @@ function sampleConfig() {
|
|
|
65
65
|
name: "GPT",
|
|
66
66
|
appId: "cli_xxx",
|
|
67
67
|
appSecret: "YOUR_LARK_APP_SECRET",
|
|
68
|
-
model: "
|
|
68
|
+
model: "phgeek-gw/gpt-5.6-sol",
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
name: "Gemini",
|
|
@@ -123,7 +123,12 @@ WantedBy=${params.mode === "system" ? "multi-user.target" : "default.target"}
|
|
|
123
123
|
`;
|
|
124
124
|
}
|
|
125
125
|
function run(cmd, args) {
|
|
126
|
-
|
|
126
|
+
// On Windows, npm-installed CLIs (like `openclaw`) are .cmd shims. Node's
|
|
127
|
+
// execFileSync does NOT resolve/execute .cmd files without shell:true (it
|
|
128
|
+
// fails with ENOENT before the subprocess ever starts — no output from the
|
|
129
|
+
// target command at all). Native .exe tools (nssm, systemctl on Linux) are
|
|
130
|
+
// unaffected by this flag either way, so enabling it only on win32 is safe.
|
|
131
|
+
execFileSync(cmd, args, { stdio: "inherit", shell: process.platform === "win32" });
|
|
127
132
|
}
|
|
128
133
|
function runSudo(args) {
|
|
129
134
|
run("sudo", args);
|
|
@@ -183,11 +188,21 @@ function cmdInstallWindowsService(args) {
|
|
|
183
188
|
}
|
|
184
189
|
function runCapture(cmd, args) {
|
|
185
190
|
try {
|
|
186
|
-
|
|
191
|
+
// See run()'s comment: Windows needs shell:true to execute a .cmd shim
|
|
192
|
+
// (e.g. openclaw installed via `npm install -g`), otherwise the subprocess
|
|
193
|
+
// never starts (ENOENT) and no output from it is ever produced.
|
|
194
|
+
execFileSync(cmd, args, { stdio: "inherit", shell: process.platform === "win32" });
|
|
187
195
|
return { code: 0 };
|
|
188
196
|
}
|
|
189
197
|
catch (err) {
|
|
190
|
-
|
|
198
|
+
const code = typeof err?.status === "number" ? err.status : 1;
|
|
199
|
+
// A spawn failure (command never started) has no numeric exit status/signal
|
|
200
|
+
// from the target process — surface that distinctly from "the command ran
|
|
201
|
+
// and returned non-zero", since the fix differs (PATH vs. the tool's own error).
|
|
202
|
+
const spawnError = typeof err?.status !== "number" && !err?.signal
|
|
203
|
+
? (err?.message || String(err))
|
|
204
|
+
: undefined;
|
|
205
|
+
return { code, spawnError };
|
|
191
206
|
}
|
|
192
207
|
}
|
|
193
208
|
/**
|
|
@@ -216,8 +231,18 @@ function cmdInstallSteerPlugin(args) {
|
|
|
216
231
|
console.log(`Installing lma-steer plugin from: ${pluginDir}`);
|
|
217
232
|
const res = runCapture(openclawBin, installArgs);
|
|
218
233
|
if (res.code !== 0) {
|
|
219
|
-
|
|
220
|
-
|
|
234
|
+
if (res.spawnError) {
|
|
235
|
+
// The subprocess never started (e.g. Windows failing to exec a .cmd shim
|
|
236
|
+
// without a shell, or the binary truly missing from PATH). This is
|
|
237
|
+
// distinct from "openclaw ran and returned an error" — no output above
|
|
238
|
+
// this line came from openclaw itself.
|
|
239
|
+
console.error(`\nCould not start "${openclawBin}": ${res.spawnError}`);
|
|
240
|
+
console.error(`Make sure the OpenClaw CLI is installed and on PATH (or set OPENCLAW_BIN to its full path),`);
|
|
241
|
+
}
|
|
242
|
+
else {
|
|
243
|
+
console.error(`\n"${openclawBin} plugins install" failed (exit ${res.code}).`);
|
|
244
|
+
console.error(`Make sure the OpenClaw CLI is installed and on PATH (or set OPENCLAW_BIN),`);
|
|
245
|
+
}
|
|
221
246
|
console.error(`then rerun: ${CLI_NAME} install-steer-plugin`);
|
|
222
247
|
process.exit(res.code);
|
|
223
248
|
}
|
package/dist/feishu-bot.d.ts
CHANGED
|
@@ -35,6 +35,8 @@ export declare class FeishuBot {
|
|
|
35
35
|
private sendQueue;
|
|
36
36
|
/** Per-chat delayed runtime failure notifications, canceled if a real reply arrives. */
|
|
37
37
|
private delayedFailureTimers;
|
|
38
|
+
/** Per-chat durable outbox retry timer. */
|
|
39
|
+
private deliveryRetryTimers;
|
|
38
40
|
/** Last time a real assistant-visible reply was successfully handed to the delivery pipeline. */
|
|
39
41
|
private lastRealDeliveryAt;
|
|
40
42
|
/** Per-chat: whether we've already sent the high-context alert this cycle. */
|
|
@@ -118,6 +120,14 @@ export declare class FeishuBot {
|
|
|
118
120
|
private cleanMentions;
|
|
119
121
|
private stripLeadingCommandMentions;
|
|
120
122
|
private buildMarkdownCard;
|
|
123
|
+
private deliveryOwnsVisiblePayload;
|
|
124
|
+
private completionSummary;
|
|
125
|
+
/** Final answer card used to replace the running live-status card in place. */
|
|
126
|
+
private buildFinalAnswerCard;
|
|
127
|
+
private patchFinalAnswerCard;
|
|
128
|
+
/** Best-effort cleanup when a final-card patch was too large/failed and the
|
|
129
|
+
* answer had to be delivered as a separate message. */
|
|
130
|
+
private patchLiveStatusDoneSummary;
|
|
121
131
|
private formatUserVisibleError;
|
|
122
132
|
private isBridgeControlReply;
|
|
123
133
|
private isLegacyBridgeControlMessage;
|
|
@@ -126,16 +136,14 @@ export declare class FeishuBot {
|
|
|
126
136
|
* Heuristic: does this reply look truncated / cut off mid-task? Used as the
|
|
127
137
|
* SOLE auto-retry trigger — if true, we ask the session a one-line “done?” probe.
|
|
128
138
|
*
|
|
129
|
-
* Signals
|
|
130
|
-
* 1.
|
|
131
|
-
* 2.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
136
|
-
*
|
|
137
|
-
* treated as likely unfinished. A false positive only costs one cheap,
|
|
138
|
-
* invisible confirmation probe; the session itself is the real arbiter.
|
|
139
|
+
* Signals are intentionally HIGH PRECISION. A reply is suspicious only when:
|
|
140
|
+
* 1. Its Markdown/code structure is visibly unclosed; or
|
|
141
|
+
* 2. It ends on punctuation/words that grammatically demand continuation.
|
|
142
|
+
*
|
|
143
|
+
* Merely lacking a final punctuation mark is NOT enough. Short answers,
|
|
144
|
+
* headings, model lists, paths, hashes, commands, English labels, and normal
|
|
145
|
+
* chat prose routinely end without punctuation; treating all of them as
|
|
146
|
+
* truncated caused obvious false-positive confirmation probes.
|
|
139
147
|
*/
|
|
140
148
|
private looksTruncated;
|
|
141
149
|
/** Current context usage percent for a session (totalTokens / contextTokens),
|
|
@@ -178,6 +186,7 @@ export declare class FeishuBot {
|
|
|
178
186
|
private deliverySourceId;
|
|
179
187
|
private sendSystemDelivery;
|
|
180
188
|
private enqueueAndDispatchDelivery;
|
|
189
|
+
private scheduleDeliveryRetry;
|
|
181
190
|
private dispatchPendingDeliveries;
|
|
182
191
|
private hasFreeModeBot;
|
|
183
192
|
private mentionedBotNames;
|