refactor(core): SenseResult<T> generic + split types.ts #118

Merged
xiaoju merged 1 commits from refactor/111-split-types-generify-sense-result into main 2026-04-25 02:59:48 +00:00
Owner

What

Split types.ts into 3 focused modules and make SenseResult generic.

Why

Phase 4 of the types cleanup (#111).

Changes

  • config.ts — config types
  • sense.ts — Signal, SenseInfo, SenseResult<T = unknown>
  • workflow.ts — workflow types, constants, Moderator, WorkflowDefinition
  • parse-nerve-config.ts — moved YAML parsing logic
  • External API unchanged

Tests

All 378 tests pass

Fixes #111

## What Split `types.ts` into 3 focused modules and make `SenseResult` generic. ## Why Phase 4 of the types cleanup (#111). ## Changes - **config.ts** — config types - **sense.ts** — Signal, SenseInfo, SenseResult<T = unknown> - **workflow.ts** — workflow types, constants, Moderator, WorkflowDefinition - **parse-nerve-config.ts** — moved YAML parsing logic - External API unchanged ## Tests All 378 tests pass ✅ Fixes #111
xiaoju added 1 commit 2026-04-25 02:58:11 +00:00
- SenseResult<T = unknown> with payload: T
- types.ts split into config.ts (types), sense.ts, workflow.ts
- Original config.ts (parseNerveConfig) moved to parse-nerve-config.ts
- index.ts re-exports from new modules, external API unchanged
- daemon-ipc-protocol.ts imports SenseInfo from sense.ts

Fixes #111
xingyue approved these changes 2026-04-25 02:59:22 +00:00
xingyue left a comment
Owner

LGTM 🟢

types.ts → config.ts / sense.ts / workflow.ts 拆分干净,parse-nerve-config.ts import 来源正确。SenseResult<T = unknown> 泛型化向后兼容。外部 API 通过 index.ts re-export 保持不变。

LGTM 🟢 types.ts → config.ts / sense.ts / workflow.ts 拆分干净,parse-nerve-config.ts import 来源正确。SenseResult<T = unknown> 泛型化向后兼容。外部 API 通过 index.ts re-export 保持不变。
xiaoju merged commit 889bbbb474 into main 2026-04-25 02:59:48 +00:00
This repo is archived. You cannot comment on pull requests.
No Reviewers
No Label
2 Participants
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/nerve#118