refactor: extract workflow engine into standalone @uncaged/workflow package #320
Reference in New Issue
Block a user
Delete Branch "%!s()"
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?
What
Extract the workflow engine (multi-step role/moderator orchestration) from nerve-core and nerve-daemon into a standalone
@uncaged/workflowpackage.Why
After #318 / #319, senses no longer couple to workflow types. The workflow engine is now a fully independent subsystem that:
Separating it makes both systems cleaner and independently evolvable.
What moves to
@uncaged/workflowFrom
packages/core/src/workflow.tsWorkflowDefinition,Role,Moderator,ThreadContextRoleResult,RoleStep,WorkflowMessageStartStep,AgentFnSTART,ENDconstantsDEFAULT_ENGINE_MAX_ROUNDSFrom
packages/core/src/config.tsWorkflowConfigtypeFrom
packages/daemon/workflow-manager.ts→ workflow process managementworkflow-worker.ts→ workflow execution runtimestart-thread,thread-step,thread-complete, etc.)From
packages/workflow-utils/@uncaged/workflowor keep as a separate helper packageWhat stays in nerve
@uncaged/nerve-core: Sense types, SenseTrigger ({ command }), config parsing (minus workflow parts)@uncaged/nerve-daemon: Sense scheduler, sense workers, kernel (imports@uncaged/workflowfor workflow execution)@uncaged/nerve-cli: CLI commands —nerve workflow triggercalls into@uncaged/workflowNew monorepo structure
Migration strategy
packages/workflow/with types + runtime moved from core + daemon@uncaged/workflow@uncaged/workflow小橘 🍊(NEKO Team)