Phase 1 Testing: Types + Config Schema #235

Closed
opened 2026-04-29 04:33:32 +00:00 by xiaoju · 0 comments
Owner

验证目标

agentsextract 配置段能被 nerve.yaml parser 正确解析,核心类型导出可用。

前置条件

packages/core 中工作。

测试步骤

  • Step 1: 类型定义存在且可导入

    cd packages/core && pnpm run build
    

    预期: 构建成功,无类型错误

  • Step 2: AgentFn 类型签名正确
    新增类型:

    type WorkflowContext = { start: StartStep; messages: WorkflowMessage[]; workdir: string; signal: AbortSignal; };
    type AgentFn = (prompt: string, context: WorkflowContext) => Promise<string>;
    type ExtractFn<T> = (raw: string, schema: Schema<T>) => Promise<T>;
    

    预期: 类型从 @nerve/core 导出

  • Step 3: nerve.yaml agents + extract 配置解析

    agents:
      developer:
        type: cursor
        model: auto
        timeout: 300s
      ops:
        type: hermes
        model: auto
        timeout: 600s
    extract:
      provider: dashscope
      model: qwen-plus
    

    预期: pnpm test 通过,config parse 测试覆盖 agents/extract 字段

  • Step 4: ExtractError 类型存在

    class ExtractError extends Error { raw: string; parseError: Error; }
    

    预期: 可从 @nerve/core 导入

  • Step 5: Agent naming 允许任意字符串
    预期: config parse 不限制 agent name(任意 kebab-case 字符串)

验证完成标准

所有 checkbox 打勾 | pnpm run check 通过 | pnpm test 通过

Ref: #234

## 验证目标 `agents` 和 `extract` 配置段能被 nerve.yaml parser 正确解析,核心类型导出可用。 ## 前置条件 在 `packages/core` 中工作。 ## 测试步骤 - [ ] **Step 1: 类型定义存在且可导入** ```bash cd packages/core && pnpm run build ``` **预期:** 构建成功,无类型错误 - [ ] **Step 2: AgentFn 类型签名正确** 新增类型: ```ts type WorkflowContext = { start: StartStep; messages: WorkflowMessage[]; workdir: string; signal: AbortSignal; }; type AgentFn = (prompt: string, context: WorkflowContext) => Promise<string>; type ExtractFn<T> = (raw: string, schema: Schema<T>) => Promise<T>; ``` **预期:** 类型从 `@nerve/core` 导出 - [ ] **Step 3: nerve.yaml agents + extract 配置解析** ```yaml agents: developer: type: cursor model: auto timeout: 300s ops: type: hermes model: auto timeout: 600s extract: provider: dashscope model: qwen-plus ``` **预期:** `pnpm test` 通过,config parse 测试覆盖 agents/extract 字段 - [ ] **Step 4: ExtractError 类型存在** ```ts class ExtractError extends Error { raw: string; parseError: Error; } ``` **预期:** 可从 `@nerve/core` 导入 - [ ] **Step 5: Agent naming 允许任意字符串** **预期:** config parse 不限制 agent name(任意 kebab-case 字符串) ## 验证完成标准 ✅ 所有 checkbox 打勾 | ✅ `pnpm run check` 通过 | ✅ `pnpm test` 通过 Ref: #234
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#235