Phase 1 Testing: TextProducerFn<I> 泛型化 + createTextAdapter schema 重载 #253

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

验证目标

TextProducerFn<I> 泛型化完成,createTextAdapter 支持 schema 重载,现有代码零改动编译通过。

测试步骤

  • Step 1: TextProducerFn 泛型化
    workflow-util-agent/src/create-text-adapter.tsTextProducerFn 改为 TextProducerFn<I = string>
    预期: 现有 TextProducerFn 无类型参数时自动推导为 TextProducerFn<string>

  • Step 2: createTextAdapter 支持 schema 重载
    新增重载:createTextAdapter<I>(inputSchema: ZodType<I>, producer: TextProducerFn<I>): AdapterFn
    原签名 createTextAdapter(producer: TextProducerFn): AdapterFn 保持不变
    预期: 现有调用方(LLM、Cursor、Hermes adapter)零改动编译通过

  • Step 3: 单元测试
    新增测试验证 schema 重载路径:给定结构化 input schema 的 producer 能正确接收 parsed input
    预期: 新测试 pass

  • Step 4: 全量构建通过

    cd ~/repos/uncaged-workflow && pnpm run build
    

    预期: 0 errors

  • Step 5: 现有测试通过

    cd ~/repos/uncaged-workflow && pnpm test
    

    预期: 所有 test pass

验证完成标准

所有 checkbox 打勾
CI 构建成功

## 验证目标 `TextProducerFn<I>` 泛型化完成,`createTextAdapter` 支持 schema 重载,现有代码零改动编译通过。 ## 测试步骤 - [ ] **Step 1: TextProducerFn 泛型化** `workflow-util-agent/src/create-text-adapter.ts` 中 `TextProducerFn` 改为 `TextProducerFn<I = string>` **预期:** 现有 `TextProducerFn` 无类型参数时自动推导为 `TextProducerFn<string>` - [ ] **Step 2: createTextAdapter 支持 schema 重载** 新增重载:`createTextAdapter<I>(inputSchema: ZodType<I>, producer: TextProducerFn<I>): AdapterFn` 原签名 `createTextAdapter(producer: TextProducerFn): AdapterFn` 保持不变 **预期:** 现有调用方(LLM、Cursor、Hermes adapter)零改动编译通过 - [ ] **Step 3: 单元测试** 新增测试验证 schema 重载路径:给定结构化 input schema 的 producer 能正确接收 parsed input **预期:** 新测试 pass - [ ] **Step 4: 全量构建通过** ```bash cd ~/repos/uncaged-workflow && pnpm run build ``` **预期:** 0 errors - [ ] **Step 5: 现有测试通过** ```bash cd ~/repos/uncaged-workflow && pnpm test ``` **预期:** 所有 test pass ## 验证完成标准 ✅ 所有 checkbox 打勾 ✅ CI 构建成功
Sign in to join this conversation.
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#253