feat(runtime): DeerFlow 模式中间件链 Phase 1-4 全部完成
借鉴 DeerFlow 架构,实现完整中间件链系统: Phase 1 - Agent 中间件链基础设施 - MiddlewareChain Clone 支持 - LoopRunner 双路径集成 (middleware/legacy) - Kernel create_middleware_chain() 工厂方法 Phase 2 - 技能按需注入 - SkillIndexMiddleware (priority 200) - SkillLoadTool 工具 - SkillDetail/SkillIndexEntry 结构体 - KernelSkillExecutor trait 扩展 Phase 3 - Guardrail 安全护栏 - GuardrailMiddleware (priority 400, fail_open) - ShellExecRule / FileWriteRule / WebFetchRule Phase 4 - 记忆闭环统一 - MemoryMiddleware (priority 150, 30s 防抖) - after_completion 双路径调用 中间件注册顺序: 100 Compaction | 150 Memory | 200 SkillIndex 400 Guardrail | 500 LoopGuard | 700 TokenCalibration 向后兼容:Option<MiddlewareChain> 默认 None 走旧路径
This commit is contained in:
@@ -133,6 +133,14 @@ impl SkillRegistry {
|
||||
manifests.values().cloned().collect()
|
||||
}
|
||||
|
||||
/// Synchronous snapshot of all manifests.
|
||||
/// Uses `try_read` — returns empty map if write lock is held (should be rare at steady state).
|
||||
pub fn manifests_snapshot(&self) -> HashMap<SkillId, SkillManifest> {
|
||||
self.manifests.try_read()
|
||||
.map(|guard| guard.clone())
|
||||
.unwrap_or_default()
|
||||
}
|
||||
|
||||
/// Execute a skill
|
||||
pub async fn execute(
|
||||
&self,
|
||||
|
||||
Reference in New Issue
Block a user