Phase 1 Testing: AgentFn<I> 泛型化 + adaptAgent 通用函数 #328
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
验证目标
AgentFn<I>泛型化完成,adaptAgent通用函数可用,现有代码零改动编译通过。测试步骤
Step 1: 类型定义更新
packages/workflow/src/types.ts中AgentFn改为AgentFn<I = string>预期: 所有现有
AgentFn(无类型参数)自动推导为AgentFn<string>Step 2: adaptAgent 函数实现
在
packages/workflow-utils中新增adapt-agent.ts,提供adaptAgent<I>(schema, agent): AgentFn<string>预期: 给定 Zod schema 和
AgentFn<I>,返回AgentFn<string>(从 string 解析出 I)Step 3: 全量构建通过
预期: 0 errors,所有 package 构建成功
Step 4: 现有测试通过
预期: 所有 test pass
Step 5: 类型检查通过
预期: biome check 通过
验证完成标准
✅ 所有 checkbox 打勾
✅ CI 构建成功