mirror of
https://github.com/openclaw/openclaw.git
synced 2026-04-18 22:47:26 +00:00
Previously feishu_doc always used accounts[0], so multi-account setups created docs under the first bot regardless of the calling agent. This change resolves accountId via a before_tool_call hook (defaulting from agentAccountId) and selects the Feishu client per call. Fixes #27321
72 lines
2.2 KiB
TypeScript
72 lines
2.2 KiB
TypeScript
import type { OpenClawPluginApi } from "openclaw/plugin-sdk";
|
|
import { emptyPluginConfigSchema } from "openclaw/plugin-sdk";
|
|
import { registerFeishuBitableTools } from "./src/bitable.js";
|
|
import { feishuPlugin } from "./src/channel.js";
|
|
import { registerFeishuDocTools } from "./src/docx.js";
|
|
import { registerFeishuDriveTools } from "./src/drive.js";
|
|
import { registerFeishuPermTools } from "./src/perm.js";
|
|
import { setFeishuRuntime } from "./src/runtime.js";
|
|
import { resolveFeishuAccountForToolContext } from "./src/tool-context.js";
|
|
import { registerFeishuWikiTools } from "./src/wiki.js";
|
|
|
|
export { monitorFeishuProvider } from "./src/monitor.js";
|
|
export {
|
|
sendMessageFeishu,
|
|
sendCardFeishu,
|
|
updateCardFeishu,
|
|
editMessageFeishu,
|
|
getMessageFeishu,
|
|
} from "./src/send.js";
|
|
export {
|
|
uploadImageFeishu,
|
|
uploadFileFeishu,
|
|
sendImageFeishu,
|
|
sendFileFeishu,
|
|
sendMediaFeishu,
|
|
} from "./src/media.js";
|
|
export { probeFeishu } from "./src/probe.js";
|
|
export {
|
|
addReactionFeishu,
|
|
removeReactionFeishu,
|
|
listReactionsFeishu,
|
|
FeishuEmoji,
|
|
} from "./src/reactions.js";
|
|
export {
|
|
extractMentionTargets,
|
|
extractMessageBody,
|
|
isMentionForwardRequest,
|
|
formatMentionForText,
|
|
formatMentionForCard,
|
|
formatMentionAllForText,
|
|
formatMentionAllForCard,
|
|
buildMentionedMessage,
|
|
buildMentionedCardContent,
|
|
type MentionTarget,
|
|
} from "./src/mention.js";
|
|
export { feishuPlugin } from "./src/channel.js";
|
|
|
|
const plugin = {
|
|
id: "feishu",
|
|
name: "Feishu",
|
|
description: "Feishu/Lark channel plugin",
|
|
configSchema: emptyPluginConfigSchema(),
|
|
register(api: OpenClawPluginApi) {
|
|
setFeishuRuntime(api.runtime);
|
|
api.registerChannel({ plugin: feishuPlugin });
|
|
|
|
// Ensure Feishu tool registration uses the calling agent's account / outbound identity.
|
|
api.registerHook(["before_tool_call"], resolveFeishuAccountForToolContext, {
|
|
name: "feishu:resolve-account",
|
|
description: "Resolve Feishu accountId for Feishu tools based on the calling agent",
|
|
});
|
|
|
|
registerFeishuDocTools(api);
|
|
registerFeishuWikiTools(api);
|
|
registerFeishuDriveTools(api);
|
|
registerFeishuPermTools(api);
|
|
registerFeishuBitableTools(api);
|
|
},
|
|
};
|
|
|
|
export default plugin;
|