import type { QiaoqiaoConfigSchema, QiaoqiaoGroupSchema, QiaoqiaoAccountConfigSchema, z } from "./config-schema.js"; import type { MentionTarget } from "./mention.js"; export type QiaoqiaoConfig = z.infer; export type QiaoqiaoGroupConfig = z.infer; export type QiaoqiaoAccountConfig = z.infer; export type QiaoqiaoDomain = "qiaoqiao" | (string & {}); export type QiaoqiaoConnectionMode = "websocket" | "webhook"; export type ResolvedQiaoqiaoAccount = { accountId: string; enabled: boolean; configured: boolean; name?: string; appId?: string; appSecret?: string; encryptKey?: string; verificationToken?: string; domain: QiaoqiaoDomain; /** Merged config (top-level defaults + account-specific overrides) */ config: QiaoqiaoConfig; }; export type QiaoqiaoIdType = "open_id" | "user_id" | "union_id" | "chat_id"; export type QiaoqiaoMessageContext = { 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 QiaoqiaoMediaInfo = { path: string; url?: string; type: string; size?: number; name?: string; }; export type QiaoqiaoSendResult = { messageId: string; chatId: string; }; export type QiaoqiaoProbeResult = { ok: boolean; error?: string; appId?: string; botName?: string; botOpenId?: string; }; export type QiaoqiaoToolsConfig = { message?: boolean; feed?: boolean; post?: boolean; comment?: boolean; dashboard?: boolean; memory?: boolean; dm?: boolean; }; export type DynamicAgentCreationConfig = { enabled?: boolean; workspaceTemplate?: string; agentDirTemplate?: string; maxAgents?: number; };