import type { Skill, RouteResult, RouteStrategy } from './types.js'; import type { SkillManager } from './manager.js'; import type { VectorIndex } from './vector-index.js'; export declare class SkillRouter { private strategies; private skillManager; constructor(skillManager: SkillManager); /** * 路由:自定义策略 → 显式调用 → 关键词匹配 * 命中即停,全部未命中返回 { skill: null }(由 Engine 注入 skill catalog,Agent 自主调用 load_skill) */ route(message: string): Promise; /** 注册自定义路由策略(优先级高于内置三级路由) */ addStrategy(strategy: RouteStrategy): void; /** 移除自定义策略 */ removeStrategy(name: string): void; private matchExplicit; /** * 获取 Skill 在 SkillManager 中的存储 key * 通过 metadata.connectorId 判断是否为连接器 Skill */ private getSkillStorageKey; /** 获取 Manifest 在 SkillManager 中的存储 key(同 getSkillStorageKey,但用 manifest 类型) */ private getManifestStorageKey; private matchByKeywords; } /** 嵌入函数:将文本转换为向量 */ export type EmbedFunction = (text: string) => Promise; /** VectorRouteStrategy 配置选项 */ export interface VectorRouteStrategyOptions { /** 检索候选数量(默认 5) */ topK?: number; /** 最低相似度阈值,低于此值不命中(默认 0.5) */ minScore?: number; } export declare class VectorRouteStrategy implements RouteStrategy { name: string; private index; private embedFn; private topK; private minScore; constructor(index: VectorIndex, embedFn: EmbedFunction, options?: VectorRouteStrategyOptions); match(message: string, skills: Skill[]): Promise; } //# sourceMappingURL=router.d.ts.map