export type AdapterDirection = 'outgoing' | 'incoming' | 'bidirectional'; export type ChannelPayloadMode = 'envelope' | 'raw'; export type ChannelMessage = { adapter: string; recipient: string; text?: string; source?: string; metadata?: Record; payloadMode?: ChannelPayloadMode; rawBody?: unknown; webhook?: { method?: string; contentType?: string; }; }; export type IncomingAttachment = { type: 'image' | 'document' | 'audio' | 'file'; path: string; filename?: string; mimeType?: string; size?: number; }; export type IncomingMessage = { adapter: string; sender: string; text: string; attachments?: IncomingAttachment[]; metadata?: Record; }; export type OnIncomingMessage = (message: IncomingMessage) => void | Promise; export type ChannelAdapter = { direction: AdapterDirection; send?(message: ChannelMessage): Promise; start?(onMessage: OnIncomingMessage): Promise; stop?(): Promise; sendTyping?(recipient: string): Promise; }; export type AdapterConfig = { type: string; [key: string]: unknown; }; export type HttpIncomingConfig = { enabled?: boolean; host?: string; port?: number; path?: string; }; export type FeishuAdapterConfig = AdapterConfig & { type: 'feishu'; appId?: string; appSecret?: string; /** * Event transport. Defaults to websocket. Set "off" for outgoing-only use, * or "http" when the deployment already exposes an event callback endpoint. */ eventMode?: 'websocket' | 'http' | 'off'; appType?: 'self_build' | 'selfBuild' | 'SelfBuild' | 'isv' | 'ISV'; domain?: 'feishu' | 'lark' | string; verificationToken?: string; encryptKey?: string; botOpenId?: string; receiveIdType?: 'chat_id' | 'open_id' | 'user_id' | 'union_id' | 'email'; respondToMentionsOnly?: boolean; respondToMentionAll?: boolean; replyInThread?: boolean; ackReactionEmoji?: string | false; allowedChatIds?: string[]; allowedSenderIds?: string[]; dmMode?: 'open' | 'allowlist' | 'pair' | 'disabled'; dmAllowlist?: string[]; loggerLevel?: 'error' | 'warn' | 'info' | 'debug' | 'trace'; handshakeTimeoutMs?: number; wsPingTimeoutSeconds?: number; incoming?: HttpIncomingConfig; }; export type WeComAdapterConfig = AdapterConfig & { type: 'wecom'; botId?: string; secret?: string; eventMode?: 'websocket' | 'off'; timeoutMs?: number; reconnectInterval?: number; maxReconnectAttempts?: number; maxAuthFailureAttempts?: number; heartbeatInterval?: number; wsUrl?: string; respondToMentionsOnly?: boolean; allowedChatIds?: string[]; allowedSenderIds?: string[]; }; export type DingTalkAdapterConfig = AdapterConfig & { type: 'dingtalk'; clientId?: string; clientSecret?: string; robotCode?: string; eventMode?: 'stream' | 'off'; respondToMentionsOnly?: boolean; allowedConversationIds?: string[]; allowedSenderIds?: string[]; keepAlive?: boolean; debug?: boolean; ua?: string; openApiBaseUrl?: string; tokenUrl?: string; }; export type WebhookAdapterConfig = AdapterConfig & { type: 'webhook'; method?: string; contentType?: string; payloadMode?: ChannelPayloadMode; secret?: string; headers?: Record; }; export type BridgeConfig = { enabled?: boolean; timeoutMs?: number; maxQueuePerSender?: number; maxConcurrent?: number; model?: string | null; provider?: string | null; piBin?: string; commands?: boolean; persistSessions?: boolean; apiBase?: string; env?: Record; }; export type ChannelRouteConfig = { adapter: string; recipient: string; name?: string; capture?: boolean; }; export type ChannelConfig = { adapters?: Record; routes?: Record; bridge?: BridgeConfig; }; export type SendResult = { ok: boolean; error?: string; }; //# sourceMappingURL=types.d.ts.map