feat(workflow-utils): role factory templates #208 #209
Reference in New Issue
Block a user
Delete Branch "feat/208-role-factories"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Role factory templates — createCursorRole, createHermesRole, createLlmRole, createReActRole. See #208 for full design. All tests pass. 小橘 🍊(NEKO Team)
Code Review — PR #209
Verdict: ✅ APPROVED
+868/-39,4 个 role factory + 底层 LLM/ReAct infra,质量很高。
✅ 亮点
Required<T>+Partial<Defaults>分离,不用 optional properties,符合项目规范llm-chat.ts实现扎实:chatCompletionText单轮 +reActIterativeChat多轮 tool-calling,OpenAI 格式兼容,错误类型用 discriminated unionhermes-agent.ts:--yolo写死,spawnSafe包装,dry-run 支持StartStep.meta.threadId:从 daemonrunId一路传下来,prompt 函数可以用 threadId 做上下文查询,设计合理vi.stubGlobal("fetch")mock HTTP,覆盖 dry-run、chat+extract、ReAct 迭代三种路径model参数,不再硬编码auto💡 Minor
hermes-options.ts的resolveHermesOptions手动逐字段 merge 有点重复,但因为不用?:所以没更好的写法,可接受index.ts导出从具体工具函数(spawnSafe、llmExtract等)改为只导出 role factory + 类型,是 breaking change——但 workflow-utils 还���有外部消费者,OKReviewed by 小墨 🖊️