openclaw-lark-multi-agent 1.4.8 → 1.4.10
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 +18 -0
- package/README.zh-CN.md +16 -0
- package/dist/feishu-bot.d.ts +4 -0
- package/dist/feishu-bot.js +147 -32
- package/dist/live-status.d.ts +11 -0
- package/dist/live-status.js +58 -4
- package/dist/openclaw-client.d.ts +15 -2
- package/dist/openclaw-client.js +336 -44
- package/dist/session-status.d.ts +19 -0
- package/dist/session-status.js +43 -0
- package/package.json +4 -4
- package/plugins/lma-steer/README.md +10 -0
- package/plugins/lma-steer/openclaw.plugin.json +57 -2
- package/plugins/lma-steer/package.json +4 -2
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/** Frontend budget only; does not change Gateway execution limits. */
|
|
2
|
+
export declare const FOREGROUND_WAIT_MS: number;
|
|
3
|
+
export type SessionRuntimeStatus = {
|
|
4
|
+
status: string;
|
|
5
|
+
running: boolean;
|
|
6
|
+
checkedAt: number;
|
|
7
|
+
contextUsedTokens?: number;
|
|
8
|
+
contextLimitTokens?: number;
|
|
9
|
+
};
|
|
10
|
+
export declare const isWaitTimeout: (text: string) => boolean;
|
|
11
|
+
export declare function normalizeSessionRuntimeStatus(value: any): SessionRuntimeStatus;
|
|
12
|
+
/** Compact presentation only; never replaces the actual status/model values. */
|
|
13
|
+
export declare function formatSessionFooter(snapshot: SessionRuntimeStatus): string;
|
|
14
|
+
/** Foreground waiting paused, NOT an assertion that execution ended. */
|
|
15
|
+
export declare class SessionWaitPaused extends Error {
|
|
16
|
+
readonly snapshot: SessionRuntimeStatus;
|
|
17
|
+
readonly reason: "timeout" | "yield";
|
|
18
|
+
constructor(snapshot: SessionRuntimeStatus, reportedTimeout?: boolean, reason?: "timeout" | "yield");
|
|
19
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** Frontend budget only; does not change Gateway execution limits. */
|
|
2
|
+
export const FOREGROUND_WAIT_MS = 10 * 60_000;
|
|
3
|
+
export const isWaitTimeout = (text) => /\btimeout\b|timed\s*out|超时/i.test(text) && !/invalid|validation|schema|malformed|permission denied|forbidden|unauthorized|authentication failed|quota|rate limit|无效参数|参数错误|校验失败/i.test(text);
|
|
4
|
+
export function normalizeSessionRuntimeStatus(value) {
|
|
5
|
+
const session = value?.session || value?.sessionInfo;
|
|
6
|
+
const raw = typeof session?.status === "string" ? session.status.trim().toLowerCase() : "unknown";
|
|
7
|
+
const status = /^[a-z][a-z0-9 _|,-]{0,63}$/.test(raw) ? raw : "unknown";
|
|
8
|
+
const running = session?.hasActiveRun === true || status.split(/[|,]/).some((part) => part.trim() === "running");
|
|
9
|
+
// Same context counters as /status, not cumulative input/output billing.
|
|
10
|
+
// A missing/stale count must not be presented as an empty context.
|
|
11
|
+
const used = session?.totalTokens;
|
|
12
|
+
const limit = session?.contextTokens;
|
|
13
|
+
const contextUsedTokens = session?.totalTokensFresh !== false && typeof used === "number" && Number.isFinite(used) && used >= 0 ? used : undefined;
|
|
14
|
+
const contextLimitTokens = typeof limit === "number" && Number.isFinite(limit) && limit > 0 ? limit : undefined;
|
|
15
|
+
return { status: running ? "running" : status, running, checkedAt: Date.now(),
|
|
16
|
+
...(contextUsedTokens !== undefined ? { contextUsedTokens } : {}),
|
|
17
|
+
...(contextLimitTokens !== undefined ? { contextLimitTokens } : {}),
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
/** Compact presentation only; never replaces the actual status/model values. */
|
|
21
|
+
export function formatSessionFooter(snapshot) {
|
|
22
|
+
const { contextUsedTokens: used, contextLimitTokens: limit } = snapshot;
|
|
23
|
+
if (used === undefined && limit === undefined)
|
|
24
|
+
return snapshot.status;
|
|
25
|
+
const usedK = used === undefined ? "?" : Math.round(used / 1000);
|
|
26
|
+
const limitK = limit === undefined ? "?" : Math.max(1, Math.round(limit / 1000));
|
|
27
|
+
return `${snapshot.status} · ${usedK}K/${limitK}K`;
|
|
28
|
+
}
|
|
29
|
+
/** Foreground waiting paused, NOT an assertion that execution ended. */
|
|
30
|
+
export class SessionWaitPaused extends Error {
|
|
31
|
+
snapshot;
|
|
32
|
+
reason;
|
|
33
|
+
constructor(snapshot, reportedTimeout = false, reason = "timeout") {
|
|
34
|
+
super(reason === "yield"
|
|
35
|
+
? "⏳ 本轮已转入后台等待;若有后续结果,将继续在此回复。未发送停止请求,也未自动重发请求。"
|
|
36
|
+
: reportedTimeout
|
|
37
|
+
? "⏳ 本轮返回了超时,LMA 已暂停本次等待,但不据此认定整个会话已经结束。会话状态见下方;你可以继续等待后续结果。"
|
|
38
|
+
: "⏳ 本次等待时间已到,LMA 暂停本轮等待,先返回会话状态供你判断。\n没有因此停止运行或自动重发本次请求;你可以继续等待后续结果。");
|
|
39
|
+
this.snapshot = snapshot;
|
|
40
|
+
this.reason = reason;
|
|
41
|
+
this.name = "SessionWaitPaused";
|
|
42
|
+
}
|
|
43
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openclaw-lark-multi-agent",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.10",
|
|
4
4
|
"description": "Multi-bot Lark/Feishu bridge for OpenClaw, with per-bot model routing and isolated sessions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -8,13 +8,13 @@
|
|
|
8
8
|
"build:steer-plugin": "tsc -p plugins/lma-steer/tsconfig.json",
|
|
9
9
|
"start": "node dist/index.js",
|
|
10
10
|
"dev": "tsx src/index.ts",
|
|
11
|
-
"test": "vitest run",
|
|
12
|
-
"test:coverage": "vitest run --coverage",
|
|
11
|
+
"test": "vitest run --config tests/normal-flow-offline.config.ts",
|
|
12
|
+
"test:coverage": "vitest run --config tests/normal-flow-offline.config.ts --coverage",
|
|
13
13
|
"prepack": "npm run build",
|
|
14
14
|
"prepublishOnly": "npm test && npm pack --dry-run"
|
|
15
15
|
},
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@larksuiteoapi/node-sdk": "^1.
|
|
17
|
+
"@larksuiteoapi/node-sdk": "^1.73.3",
|
|
18
18
|
"@types/ws": "^8.18.1",
|
|
19
19
|
"better-sqlite3": "^12.9.0",
|
|
20
20
|
"ws": "^8.20.0"
|
|
@@ -33,3 +33,13 @@ normal queue.
|
|
|
33
33
|
- method: `lma.steer`
|
|
34
34
|
- params: `{ sessionKey: string, text: string }`
|
|
35
35
|
- result: `{ status: "steered" | "no_active_run" | "rejected", sessionId?: string }`
|
|
36
|
+
|
|
37
|
+
## 0.1.1 compatibility refresh
|
|
38
|
+
|
|
39
|
+
This release retains the existing `lma.steer` runtime behavior. A synchronous
|
|
40
|
+
`steered` result is provisional; LMA waits for a matching transcript message
|
|
41
|
+
before reporting consumption. The experimental steer V2 and question service
|
|
42
|
+
are not part of this release. A previously installed strict `questionBridge`
|
|
43
|
+
configuration shape is accepted for upgrade compatibility only; the plugin
|
|
44
|
+
ignores it and does not enable question handling. Existing values need not be
|
|
45
|
+
removed or exposed during this update.
|
|
@@ -2,13 +2,68 @@
|
|
|
2
2
|
"id": "lma-steer",
|
|
3
3
|
"name": "LMA Steer",
|
|
4
4
|
"description": "Inject (steer) a queued user message into the active OpenClaw run at the next tool-call boundary, with an observable outcome the LMA bridge can render as a Feishu reaction.",
|
|
5
|
-
"version": "0.1.
|
|
5
|
+
"version": "0.1.1",
|
|
6
6
|
"activation": {
|
|
7
7
|
"onStartup": true
|
|
8
8
|
},
|
|
9
9
|
"configSchema": {
|
|
10
10
|
"type": "object",
|
|
11
11
|
"additionalProperties": false,
|
|
12
|
-
"properties": {
|
|
12
|
+
"properties": {
|
|
13
|
+
"questionBridge": {
|
|
14
|
+
"type": "object",
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"required": [
|
|
17
|
+
"issuer",
|
|
18
|
+
"publicKeyFile",
|
|
19
|
+
"sources"
|
|
20
|
+
],
|
|
21
|
+
"properties": {
|
|
22
|
+
"issuer": {
|
|
23
|
+
"type": "string",
|
|
24
|
+
"minLength": 1
|
|
25
|
+
},
|
|
26
|
+
"publicKeyFile": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"minLength": 1
|
|
29
|
+
},
|
|
30
|
+
"sources": {
|
|
31
|
+
"type": "array",
|
|
32
|
+
"minItems": 1,
|
|
33
|
+
"maxItems": 128,
|
|
34
|
+
"items": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": false,
|
|
37
|
+
"required": [
|
|
38
|
+
"botId",
|
|
39
|
+
"chatId",
|
|
40
|
+
"senderIds",
|
|
41
|
+
"sessionKey"
|
|
42
|
+
],
|
|
43
|
+
"properties": {
|
|
44
|
+
"botId": {
|
|
45
|
+
"type": "string"
|
|
46
|
+
},
|
|
47
|
+
"chatId": {
|
|
48
|
+
"type": "string"
|
|
49
|
+
},
|
|
50
|
+
"sessionKey": {
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
53
|
+
"senderIds": {
|
|
54
|
+
"type": "array",
|
|
55
|
+
"minItems": 1,
|
|
56
|
+
"maxItems": 128,
|
|
57
|
+
"items": {
|
|
58
|
+
"type": "string"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"description": "Deprecated configuration compatibility only; ignored by this release. Does not enable question handling."
|
|
66
|
+
}
|
|
67
|
+
}
|
|
13
68
|
}
|
|
14
69
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "lma-steer",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"private": true,
|
|
6
6
|
"description": "OpenClaw plugin: steer a queued message into the active run at the next tool-call boundary (used by the LMA bridge).",
|
|
@@ -10,7 +10,9 @@
|
|
|
10
10
|
"README.md"
|
|
11
11
|
],
|
|
12
12
|
"openclaw": {
|
|
13
|
-
"extensions": [
|
|
13
|
+
"extensions": [
|
|
14
|
+
"./dist/index.js"
|
|
15
|
+
],
|
|
14
16
|
"compat": {
|
|
15
17
|
"pluginApi": ">=2026.3.0"
|
|
16
18
|
}
|