/** * **动态 Agent 路由模块** * * 为每个用户/群组自动生成独立的 Agent ID,实现会话隔离。 * 参考: openclaw-plugin-wecom/dynamic-agent.js */ import type { OpenClawConfig } from "openclaw/plugin-sdk/core"; export interface DynamicAgentConfig { enabled: boolean; dmCreateAgent: boolean; groupEnabled: boolean; adminUsers: string[]; } /** * **getDynamicAgentConfig (读取动态 Agent 配置)** * * 从全局配置中读取动态 Agent 配置,提供默认值。 */ export declare function getDynamicAgentConfig(config: OpenClawConfig): DynamicAgentConfig; /** * **generateAgentId (生成动态 Agent ID)** * * 兼容旧语义:同一个机器人/账号(tinyId/accountId)固定映射到同一个 Agent。 * 格式: {accountId} */ export declare function generateAgentId(chatType: "dm" | "group", peerId: string, accountId?: string): string; /** * **shouldUseDynamicAgent (检查是否使用动态 Agent)** * * 根据配置和发送者信息判断是否应使用动态 Agent。 * 管理员(adminUsers)始终绕过动态路由,使用主 Agent。 */ export declare function shouldUseDynamicAgent(params: { chatType: "dm" | "group"; senderId: string; config: OpenClawConfig; }): boolean;