@openclaw/feishu 2026.2.25 → 2026.3.1
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/index.ts +2 -0
- package/package.json +2 -1
- package/skills/feishu-doc/SKILL.md +109 -3
- package/src/accounts.test.ts +90 -0
- package/src/accounts.ts +11 -2
- package/src/async.ts +62 -0
- package/src/bitable.ts +189 -215
- package/src/bot.card-action.test.ts +63 -0
- package/src/bot.checkBotMentioned.test.ts +55 -0
- package/src/bot.test.ts +863 -9
- package/src/bot.ts +414 -200
- package/src/card-action.ts +79 -0
- package/src/channel.ts +6 -0
- package/src/chat-schema.ts +24 -0
- package/src/chat.test.ts +89 -0
- package/src/chat.ts +130 -0
- package/src/client.test.ts +107 -0
- package/src/client.ts +13 -0
- package/src/config-schema.test.ts +82 -1
- package/src/config-schema.ts +54 -3
- package/src/doc-schema.ts +141 -0
- package/src/docx-batch-insert.ts +190 -0
- package/src/docx-color-text.ts +149 -0
- package/src/docx-table-ops.ts +298 -0
- package/src/docx.account-selection.test.ts +76 -0
- package/src/docx.test.ts +470 -0
- package/src/docx.ts +996 -72
- package/src/drive.ts +38 -33
- package/src/media.test.ts +123 -6
- package/src/media.ts +31 -10
- package/src/monitor.account.ts +286 -0
- package/src/monitor.reaction.test.ts +235 -0
- package/src/monitor.startup.test.ts +187 -0
- package/src/monitor.startup.ts +51 -0
- package/src/monitor.state.ts +76 -0
- package/src/monitor.transport.ts +163 -0
- package/src/monitor.ts +44 -346
- package/src/monitor.webhook-security.test.ts +27 -1
- package/src/outbound.test.ts +181 -0
- package/src/outbound.ts +94 -7
- package/src/perm.ts +37 -30
- package/src/policy.test.ts +56 -1
- package/src/policy.ts +5 -1
- package/src/post.test.ts +105 -0
- package/src/post.ts +274 -0
- package/src/probe.test.ts +253 -0
- package/src/probe.ts +99 -7
- package/src/reply-dispatcher.test.ts +259 -0
- package/src/reply-dispatcher.ts +139 -45
- package/src/send.reply-fallback.test.ts +105 -0
- package/src/send.test.ts +168 -0
- package/src/send.ts +143 -18
- package/src/streaming-card.ts +131 -43
- package/src/targets.test.ts +26 -1
- package/src/targets.ts +11 -6
- package/src/tool-account-routing.test.ts +129 -0
- package/src/tool-account.ts +70 -0
- package/src/tool-factory-test-harness.ts +76 -0
- package/src/tools-config.test.ts +21 -0
- package/src/tools-config.ts +2 -1
- package/src/types.ts +1 -0
- package/src/typing.test.ts +144 -0
- package/src/typing.ts +140 -10
- package/src/wiki.ts +55 -50
package/src/wiki.ts
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import type * as Lark from "@larksuiteoapi/node-sdk";
|
|
2
2
|
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
3
3
|
import { listEnabledFeishuAccounts } from "./accounts.js";
|
|
4
|
-
import {
|
|
5
|
-
import { resolveToolsConfig } from "./tools-config.js";
|
|
4
|
+
import { createFeishuToolClient, resolveAnyEnabledFeishuToolsConfig } from "./tool-account.js";
|
|
6
5
|
import { FeishuWikiSchema, type FeishuWikiParams } from "./wiki-schema.js";
|
|
7
6
|
|
|
8
7
|
// ============ Helpers ============
|
|
@@ -168,62 +167,68 @@ export function registerFeishuWikiTools(api: OpenClawPluginApi) {
|
|
|
168
167
|
return;
|
|
169
168
|
}
|
|
170
169
|
|
|
171
|
-
const
|
|
172
|
-
const toolsCfg = resolveToolsConfig(firstAccount.config.tools);
|
|
170
|
+
const toolsCfg = resolveAnyEnabledFeishuToolsConfig(accounts);
|
|
173
171
|
if (!toolsCfg.wiki) {
|
|
174
172
|
api.logger.debug?.("feishu_wiki: wiki tool disabled in config");
|
|
175
173
|
return;
|
|
176
174
|
}
|
|
177
175
|
|
|
178
|
-
|
|
176
|
+
type FeishuWikiExecuteParams = FeishuWikiParams & { accountId?: string };
|
|
179
177
|
|
|
180
178
|
api.registerTool(
|
|
181
|
-
{
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
"Feishu
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
const
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
p.space_id,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
179
|
+
(ctx) => {
|
|
180
|
+
const defaultAccountId = ctx.agentAccountId;
|
|
181
|
+
return {
|
|
182
|
+
name: "feishu_wiki",
|
|
183
|
+
label: "Feishu Wiki",
|
|
184
|
+
description:
|
|
185
|
+
"Feishu knowledge base operations. Actions: spaces, nodes, get, create, move, rename",
|
|
186
|
+
parameters: FeishuWikiSchema,
|
|
187
|
+
async execute(_toolCallId, params) {
|
|
188
|
+
const p = params as FeishuWikiExecuteParams;
|
|
189
|
+
try {
|
|
190
|
+
const client = createFeishuToolClient({
|
|
191
|
+
api,
|
|
192
|
+
executeParams: p,
|
|
193
|
+
defaultAccountId,
|
|
194
|
+
});
|
|
195
|
+
switch (p.action) {
|
|
196
|
+
case "spaces":
|
|
197
|
+
return json(await listSpaces(client));
|
|
198
|
+
case "nodes":
|
|
199
|
+
return json(await listNodes(client, p.space_id, p.parent_node_token));
|
|
200
|
+
case "get":
|
|
201
|
+
return json(await getNode(client, p.token));
|
|
202
|
+
case "search":
|
|
203
|
+
return json({
|
|
204
|
+
error:
|
|
205
|
+
"Search is not available. Use feishu_wiki with action: 'nodes' to browse or action: 'get' to lookup by token.",
|
|
206
|
+
});
|
|
207
|
+
case "create":
|
|
208
|
+
return json(
|
|
209
|
+
await createNode(client, p.space_id, p.title, p.obj_type, p.parent_node_token),
|
|
210
|
+
);
|
|
211
|
+
case "move":
|
|
212
|
+
return json(
|
|
213
|
+
await moveNode(
|
|
214
|
+
client,
|
|
215
|
+
p.space_id,
|
|
216
|
+
p.node_token,
|
|
217
|
+
p.target_space_id,
|
|
218
|
+
p.target_parent_token,
|
|
219
|
+
),
|
|
220
|
+
);
|
|
221
|
+
case "rename":
|
|
222
|
+
return json(await renameNode(client, p.space_id, p.node_token, p.title));
|
|
223
|
+
default:
|
|
224
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- exhaustive check fallback
|
|
225
|
+
return json({ error: `Unknown action: ${(p as any).action}` });
|
|
226
|
+
}
|
|
227
|
+
} catch (err) {
|
|
228
|
+
return json({ error: err instanceof Error ? err.message : String(err) });
|
|
222
229
|
}
|
|
223
|
-
}
|
|
224
|
-
|
|
225
|
-
}
|
|
226
|
-
},
|
|
230
|
+
},
|
|
231
|
+
};
|
|
227
232
|
},
|
|
228
233
|
{ name: "feishu_wiki" },
|
|
229
234
|
);
|