chore: internalize unused exports across all packages #283

Merged
xiaomo merged 1 commits from chore/audit-exports-cleanup into main 2026-05-16 09:59:58 +00:00
Owner

What

从应用入口出发做可达性分析,收敛所有包的公共 API surface。只改 index.ts,不删源码。

Why

大量内部实现细节暴露为公共 export,增加认知负担和 API 契约维护成本。

Method

package-api-audit skill 的方法论:从 Worker/CLI/Dashboard 应用入口出发,沿定制链做类型签名的可达性闭包,不可达的符号从 index.ts 移除。

Changes (10 files, +32/-105)

Package Removed Notes
workflow-util 7 base32 internals, logger config types
workflow-cas 12 merkle internals, serialization
workflow-execute 24 engine internals, LLM extract
workflow-reactor 4 reactor config/invocation
workflow-register 8 redundant protocol re-exports, internal YAML fns
workflow-runtime curated stop full protocol re-export, keep bundle-author subset
workflow-util-agent 5 internal agent helpers
workflow-agent-cursor 1 validateCursorAgentConfig
workflow-agent-hermes 1 validateHermesAgentConfig

Not Changed

workflow-protocol — downstream packages still import symbols via internal paths. Cleanup requires updating workflow-runtime/src/types.ts first (follow-up PR).

Verification

bunx tsc --noEmit and bunx tsc --build both pass.

Ref

Refs #273, #274, #275, #276, #277, #278, #279, #280, #281, #282

## What 从应用入口出发做可达性分析,收敛所有包的公共 API surface。只改 `index.ts`,不删源码。 ## Why 大量内部实现细节暴露为公共 export,增加认知负担和 API 契约维护成本。 ## Method 按 `package-api-audit` skill 的方法论:从 Worker/CLI/Dashboard 应用入口出发,沿定制链做类型签名的可达性闭包,不可达的符号从 `index.ts` 移除。 ## Changes (10 files, +32/-105) | Package | Removed | Notes | |---------|---------|-------| | workflow-util | 7 | base32 internals, logger config types | | workflow-cas | 12 | merkle internals, serialization | | workflow-execute | 24 | engine internals, LLM extract | | workflow-reactor | 4 | reactor config/invocation | | workflow-register | 8 | redundant protocol re-exports, internal YAML fns | | workflow-runtime | curated | stop full protocol re-export, keep bundle-author subset | | workflow-util-agent | 5 | internal agent helpers | | workflow-agent-cursor | 1 | validateCursorAgentConfig | | workflow-agent-hermes | 1 | validateHermesAgentConfig | ## Not Changed `workflow-protocol` — downstream packages still import symbols via internal paths. Cleanup requires updating `workflow-runtime/src/types.ts` first (follow-up PR). ## Verification `bunx tsc --noEmit` and `bunx tsc --build` both pass. ## Ref Refs #273, #274, #275, #276, #277, #278, #279, #280, #281, #282
xiaoju added 1 commit 2026-05-16 09:59:19 +00:00
Audit public API surfaces using reachability analysis from application
entry points (Worker, CLI, Dashboard). Symbols not reachable from any
application's customization tree are removed from package index.ts files.

Source files and internal usage are untouched — only the public export
surface is narrowed.

Changes by package:
- workflow-util: -7 exports (base32 internals, logger config types)
- workflow-cas: -12 exports (merkle internals, serialization details)
- workflow-execute: -24 exports (engine internals, LLM extract details)
- workflow-reactor: -4 exports (reactor config/invocation internals)
- workflow-register: -8 exports (redundant protocol re-exports, internal YAML fns)
- workflow-runtime: curated re-export subset (stop full protocol re-export)
- workflow-util-agent: -5 exports (internal agent helpers)
- workflow-agent-cursor: -1 export (validateCursorAgentConfig)
- workflow-agent-hermes: -1 export (validateHermesAgentConfig)

Note: workflow-protocol index.ts unchanged — downstream packages still
import removed symbols via internal paths. Protocol cleanup requires
updating workflow-runtime/src/types.ts first (separate PR).

Refs #273, #274, #275, #276, #277, #278, #279, #280, #281, #282
xiaomo approved these changes 2026-05-16 09:59:56 +00:00
xiaomo left a comment
Owner

LGTM 9 个包的 export 收敛,只留公共 API,内部实现细节不再泄漏。runtime 改为直接从 protocol re-export 也为后续收窄 protocol 导出做好了准备。

LGTM ✅ 9 个包的 export 收敛,只留公共 API,内部实现细节不再泄漏。runtime 改为直接从 protocol re-export 也为后续收窄 protocol 导出做好了准备。
xiaomo merged commit ba90214af6 into main 2026-05-16 09:59:58 +00:00
Sign in to join this conversation.
No Reviewers
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#283