import type { FeishuConfigSchema, FeishuGroupSchema, FeishuAccountConfigSchema, z } from "./config-schema.js"; import type { MentionTarget } from "./mention.js"; export type FeishuConfig = z.infer; export type FeishuGroupConfig = z.infer; export type FeishuAccountConfig = z.infer; export type FeishuDomain = "feishu" | "lark" | (string & {}); export type FeishuConnectionMode = "websocket" | "webhook"; export type ResolvedFeishuAccount = { accountId: string; enabled: boolean; configured: boolean; name?: string; appId?: string; appSecret?: string; encryptKey?: string; verificationToken?: string; domain: FeishuDomain; /** Merged config (top-level defaults + account-specific overrides) */ config: FeishuConfig; }; export type FeishuIdType = "open_id" | "user_id" | "union_id" | "chat_id"; export type FeishuMessageContext = { chatId: string; messageId: string; senderId: string; senderOpenId: string; senderName?: string; chatType: "p2p" | "group" | "private"; mentionedBot: boolean; hasAnyMention?: boolean; rootId?: string; parentId?: string; content: string; contentType: string; /** Media placeholder token (e.g. ) when inbound message is media. */ placeholder?: string; /** Raw provider payload string (original event.message.content). */ rawPayload?: string; /** Mention forward targets (excluding the bot itself) */ mentionTargets?: MentionTarget[]; /** Extracted message body (after removing @ placeholders) */ mentionMessageBody?: string; }; export type FeishuSendResult = { messageId: string; chatId: string; }; export type FeishuProbeResult = { ok: boolean; error?: string; appId?: string; botName?: string; botOpenId?: string; }; export type FeishuMediaInfo = { path: string; contentType?: string; placeholder: string; }; export type FeishuToolsConfig = { doc?: boolean; wiki?: boolean; drive?: boolean; perm?: boolean; scopes?: boolean; task?: boolean; chat?: boolean; /** Enable the feishu_urgent tool (buzz/urgent notifications). Enabled by default. */ urgent?: boolean; /** Enable the feishu_message tool (get/list messages). Enabled by default. */ message?: boolean; /** Enable the feishu_reaction tool (add/remove/list emoji reactions). Enabled by default. */ reaction?: boolean; }; export type DynamicAgentCreationConfig = { enabled?: boolean; workspaceTemplate?: string; agentDirTemplate?: string; maxAgents?: number; };