Phase 1 Testing: AgentFn<I> 泛型化 + adaptAgent 通用函数 #328

Closed
opened 2026-05-14 07:46:39 +00:00 by xiaoju · 0 comments
Owner

验证目标

AgentFn<I> 泛型化完成,adaptAgent 通用函数可用,现有代码零改动编译通过。

测试步骤

  • Step 1: 类型定义更新
    packages/workflow/src/types.tsAgentFn 改为 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: 全量构建通过

    cd ~/repos/nerve && pnpm run build
    

    预期: 0 errors,所有 package 构建成功

  • Step 4: 现有测试通过

    cd ~/repos/nerve && pnpm test
    

    预期: 所有 test pass

  • Step 5: 类型检查通过

    cd ~/repos/nerve && pnpm run check
    

    预期: biome check 通过

验证完成标准

所有 checkbox 打勾
CI 构建成功

## 验证目标 `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: 全量构建通过** ```bash cd ~/repos/nerve && pnpm run build ``` **预期:** 0 errors,所有 package 构建成功 - [ ] **Step 4: 现有测试通过** ```bash cd ~/repos/nerve && pnpm test ``` **预期:** 所有 test pass - [ ] **Step 5: 类型检查通过** ```bash cd ~/repos/nerve && pnpm run check ``` **预期:** biome check 通过 ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ CI 构建成功
This repo is archived. You cannot comment on issues.
No Label
1 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#328