refactor(core): SenseResult generic + split types.ts into config/sense/workflow #111

Closed
opened 2026-04-25 01:46:39 +00:00 by xiaoju · 0 comments
Owner

Phase 4 — 泛型化 + 文件拆分

1. SenseResult 泛型

export type SenseResult<T = unknown> = {
  payload: T;
  workflow: string | null;
};

2. 文件拆分

types.ts 拆为三个文件,按职责分离:

  • config.ts — NerveConfig、SenseConfig、WorkflowConfig、ReflexConfig 等
  • sense.ts — Signal、SenseResult、SenseInfo
  • workflow.ts — StartStep、RoleStep、Role、Moderator、WorkflowDefinition 等

index.ts 统一 re-export,外部 import 路径不变。

依赖

Phase 3 先合

## Phase 4 — 泛型化 + 文件拆分 ### 1. SenseResult 泛型 ```typescript export type SenseResult<T = unknown> = { payload: T; workflow: string | null; }; ``` ### 2. 文件拆分 `types.ts` 拆为三个文件,按职责分离: - `config.ts` — NerveConfig、SenseConfig、WorkflowConfig、ReflexConfig 等 - `sense.ts` — Signal、SenseResult、SenseInfo - `workflow.ts` — StartStep、RoleStep、Role、Moderator、WorkflowDefinition 等 `index.ts` 统一 re-export,外部 import 路径不变。 ### 依赖 Phase 3 先合
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#111