import type { AgentEngine } from '../agent/engine.js'; /** AgentEngine 实例复用池 */ export declare class EnginePool { private readonly cache; private readonly ttlMs; constructor(ttlMs?: number, maxSize?: number); /** 生成缓存 key */ static key(profileId?: number | string, scopeKey?: string): string; /** 从池中获取 Engine(未命中或过期返回 null) */ get(profileId?: number | string, scopeKey?: string): AgentEngine | null; /** * 从池中获取 Engine 及配置版本(未命中或过期返回 null)。 * 用于对话前版本校验:命中后由调用方比对 configVersion,不一致则丢弃重建。 */ getWithVersion(cacheKey: string): { engine: AgentEngine; configVersion?: string; } | null; /** 将 Engine 放入池中 */ set(profileId: number | string | undefined, engine: AgentEngine, scopeKey?: string, configVersion?: string): void; /** 清除所有缓存(配置变更时调用) */ clear(): void; /** 枚举池中所有 Engine 实例(用于 pause/resume 等需要通知全部引擎的场景) */ engines(): AgentEngine[]; /** 仅清除过期的实例 */ purgeExpired(): void; /** 池大小 */ get size(): number; } //# sourceMappingURL=engine-pool.d.ts.map