chore: audit public exports — #281

Closed
opened 2026-05-16 06:35:47 +00:00 by xiaoju · 2 comments
Owner

背景

Bundle 全部自包含后(#270),审计各 package 的 public API,识别未被其他 package import 的符号。

未被使用 ≠ 应该删除。这些是收敛候选,需逐个判断:

  • 是否为外部 bundle 作者需要的公共 API
  • 是否只在包内部使用
  • 是否为冗余 re-export

统计

总 export 外部使用 未使用 使用率
3 1 2 33%

未被外部 import 的符号(候选)

备注

外部只用 ,Config 类型和校验函数无外部消费者。

操作

逐个检查上述符号,决定:

  1. 保留 — 属于公共 API 契约,外部 bundle 作者可能需要
  2. 内部化 — 从 移除 re-export,保留在包内部使用
  3. 删除 — 确认为死代码
## 背景 Bundle 全部自包含后(#270),审计各 package 的 public API,识别未被其他 package import 的符号。 未被使用 ≠ 应该删除。这些是收敛候选,需逐个判断: - 是否为外部 bundle 作者需要的公共 API - 是否只在包内部使用 - 是否为冗余 re-export ## 统计 | 总 export | 外部使用 | 未使用 | 使用率 | |----------|---------|--------|-------| | 3 | 1 | 2 | 33% | ## 未被外部 import 的符号(候选) - [ ] - [ ] ## 备注 外部只用 ,Config 类型和校验函数无外部消费者。 ## 操作 逐个检查上述符号,决定: 1. **保留** — 属于公共 API 契约,外部 bundle 作者可能需要 2. **内部化** — 从 移除 re-export,保留在包内部使用 3. **删除** — 确认为死代码
Author
Owner

\u53ef\u8fbe\u6027\u5206\u6790 \u2014 @uncaged/workflow-agent-cursor\n\n### \u5305\u804c\u8d23\n\nCursor agent \u5b9e\u73b0\u3002 \u63d0\u4f9b createCursorAgent \u6784\u9020 AdapterFn\u3002\n\n### \u53d7\u4f17\n\nBundle \u4f5c\u8005 \u2014 \u5728 bundle entry \u4e2d\u8c03\u7528 createCursorAgent(config) \u6ce8\u5165 adapter\u3002\n\n### \u53ef\u8fbe\u6027\u5224\u5b9a\n\n\u4ece bundle \u4f5c\u8005\u7684\u5b9a\u5236\u6811\uff08Layer 3\uff09\uff1a\n\n\ncreateCursorAgent :: CursorAgentConfig -> AdapterFn\n\n\n**\u2705 \u53ef\u8fbe \u2014 \u4fdd\u7559\uff1a**\n- createCursorAgent \u2014 \u6784\u9020\u51fd\u6570\uff0cLayer 3 \u5165\u53e3\n\n**\u274c \u5185\u90e8\u5316\u5019\u9009\uff1a**\n- CursorAgentConfig \u2014 \u8fd9\u662f createCursorAgent \u7684\u53c2\u6570\u7c7b\u578b\u3002\u6309\u53ef\u8fbe\u6027\u89c4\u5219\uff0c**\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u5fc5\u987b export**\u3002\u4f46\u9700\u786e\u8ba4\uff1abundle \u4f5c\u8005\u662f\u5426\u4f20\u5165\u5b57\u9762\u91cf\u5bf9\u8c61\uff08\u4e0d\u9700\u8981 import \u7c7b\u578b\uff09\uff0c\u8fd8\u662f\u9700\u8981\u5355\u72ec\u58f0\u660e\u53d8\u91cf\uff08\u9700\u8981 import \u7c7b\u578b\u6807\u6ce8\uff09\u3002**\u5efa\u8bae\u4fdd\u7559** \u2014 \u4f5c\u4e3a\u6784\u9020\u51fd\u6570\u53c2\u6570\u7c7b\u578b\uff0c\u5c5e\u4e8e\u516c\u5171 API \u5951\u7ea6\u3002\n- validateCursorAgentConfig \u2014 \u5185\u90e8\u6821\u9a8c\u51fd\u6570\uff0ccreateCursorAgent \u5185\u90e8\u8c03\u7528\uff0cbundle \u4f5c\u8005\u4e0d\u9700\u8981\u5355\u72ec\u8c03\u7528\u3002**\u5185\u90e8\u5316\u3002**\n\n**\u4fee\u6b63\u5224\u5b9a\uff1a** CursorAgentConfig \u4fdd\u7559\uff0cvalidateCursorAgentConfig \u5185\u90e8\u5316\u3002\u5b9e\u9645\u53ea\u6709 1 \u4e2a\u53ef\u5185\u90e8\u5316\u3002\n\n\u2014 \u5c0f\u6a58 \ud83c\udf4a\uff08NEKO Team\uff09

## \u53ef\u8fbe\u6027\u5206\u6790 \u2014 `@uncaged/workflow-agent-cursor`\n\n### \u5305\u804c\u8d23\n\n**Cursor agent \u5b9e\u73b0\u3002** \u63d0\u4f9b `createCursorAgent` \u6784\u9020 `AdapterFn`\u3002\n\n### \u53d7\u4f17\n\n**Bundle \u4f5c\u8005** \u2014 \u5728 bundle entry \u4e2d\u8c03\u7528 `createCursorAgent(config)` \u6ce8\u5165 adapter\u3002\n\n### \u53ef\u8fbe\u6027\u5224\u5b9a\n\n\u4ece bundle \u4f5c\u8005\u7684\u5b9a\u5236\u6811\uff08Layer 3\uff09\uff1a\n\n```\ncreateCursorAgent :: CursorAgentConfig -> AdapterFn\n```\n\n**\u2705 \u53ef\u8fbe \u2014 \u4fdd\u7559\uff1a**\n- `createCursorAgent` \u2014 \u6784\u9020\u51fd\u6570\uff0cLayer 3 \u5165\u53e3\n\n**\u274c \u5185\u90e8\u5316\u5019\u9009\uff1a**\n- `CursorAgentConfig` \u2014 \u8fd9\u662f `createCursorAgent` \u7684\u53c2\u6570\u7c7b\u578b\u3002\u6309\u53ef\u8fbe\u6027\u89c4\u5219\uff0c**\u6784\u9020\u51fd\u6570\u7684\u53c2\u6570\u7c7b\u578b\u5fc5\u987b export**\u3002\u4f46\u9700\u786e\u8ba4\uff1abundle \u4f5c\u8005\u662f\u5426\u4f20\u5165\u5b57\u9762\u91cf\u5bf9\u8c61\uff08\u4e0d\u9700\u8981 import \u7c7b\u578b\uff09\uff0c\u8fd8\u662f\u9700\u8981\u5355\u72ec\u58f0\u660e\u53d8\u91cf\uff08\u9700\u8981 import \u7c7b\u578b\u6807\u6ce8\uff09\u3002**\u5efa\u8bae\u4fdd\u7559** \u2014 \u4f5c\u4e3a\u6784\u9020\u51fd\u6570\u53c2\u6570\u7c7b\u578b\uff0c\u5c5e\u4e8e\u516c\u5171 API \u5951\u7ea6\u3002\n- `validateCursorAgentConfig` \u2014 \u5185\u90e8\u6821\u9a8c\u51fd\u6570\uff0c`createCursorAgent` \u5185\u90e8\u8c03\u7528\uff0cbundle \u4f5c\u8005\u4e0d\u9700\u8981\u5355\u72ec\u8c03\u7528\u3002**\u5185\u90e8\u5316\u3002**\n\n**\u4fee\u6b63\u5224\u5b9a\uff1a** `CursorAgentConfig` \u4fdd\u7559\uff0c`validateCursorAgentConfig` \u5185\u90e8\u5316\u3002\u5b9e\u9645\u53ea\u6709 1 \u4e2a\u53ef\u5185\u90e8\u5316\u3002\n\n\u2014 \u5c0f\u6a58 \ud83c\udf4a\uff08NEKO Team\uff09
Owner

Completed in PR #283 + #284.

Completed in PR #283 + #284.
xiaomo changed title from chore: audit public exports \u2014 `@uncaged/workflow-agent-cursor` to chore: audit public exports — 2026-05-16 10:34:24 +00:00
Sign in to join this conversation.
No Label
2 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: uncaged/workflow#281