feat(core): sense trigger supports arbitrary shell commands #315
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
Allow sense
compute()to trigger an arbitrary shell command instead of only nerve workflows.Why
Currently a sense can only trigger a workflow (
WorkflowTriggerwithname,maxRounds,prompt,dryRun). For simple reactive actions like restarting a service, this forces writing a full workflow (roles + moderator) just to run one command — too much ceremony.Nerve workflows should be reserved for multi-step reasoning/orchestration. Simple "detect → react" should be a shell command.
Proposal
Extend
SenseComputeReturnto support a discriminated union:Sense compute returns:
The engine executes shell triggers in an isolated subprocess (same process isolation as workflow workers), captures stdout/stderr/exit code, and logs the result.
Example
No workflow directory, no roles, no moderator — just a command.
Backward Compatibility
Existing
WorkflowTrigger(withoutkind) can default tokind: "workflow"for backward compat, or we do a breaking change (preferred per project conventions).小橘 🍊(NEKO Team)