/** * Channel Supervisor 模式 * * P2-13: 监督者模式实现 * * 功能: * - 任务分配策略(轮询、最少忙碌、优先级) * - 超时检查 * - 负载均衡 */ import type { AgentIdentity, ChannelRuntime, SupervisorConfig } from './channel-types.js'; export declare class Supervisor { private config; private runtime; private workers; private roundRobinIndex; private timeoutCheckInterval?; constructor(runtime: ChannelRuntime, config?: Partial); /** * 启动 Supervisor */ start(): Promise; /** * 停止 Supervisor */ stop(): Promise; /** * 注册 Worker */ registerWorker(worker: AgentIdentity): Promise; /** * 移除 Worker */ removeWorker(workerId: string): Promise; /** * 分配任务 */ assignTask(description: string, content: any, creator: string): Promise; /** * 选择 Worker(根据策略) */ private selectWorker; /** * 轮询策略 */ private selectRoundRobin; /** * 最少忙碌策略 */ private selectLeastBusy; /** * 优先级策略(根据 Worker 的最后活跃时间) */ private selectByPriority; /** * 检查超时任务 */ private checkTimeouts; /** * 获取 Worker 列表 */ getWorkers(): AgentIdentity[]; /** * 获取配置 */ getConfig(): SupervisorConfig; } /** * 创建 Supervisor */ export declare function createSupervisor(runtime: ChannelRuntime, config?: Partial): Supervisor; //# sourceMappingURL=channel-supervisor.d.ts.map