Expand description
Trigger engine — the host-side (CLI) implementation of external-event-driven agent invocation, moved out of theway-core.
The core runtime maintains state and exposes the agent loop (AgentHarness); the
trigger engine is a host concern: it owns the trigger envelope types, the dedup/cycle
runtime, the permission hook chain, the audit persistence (via core Session public
APIs), the sub-agent execution and result promotion (via core Agent public APIs),
and its own event stream for CLI listeners.
Modules:
types— trigger envelope, state machine, audit record, action/promotion typesruntime— dedup window + cycle suppression engine (pure logic)notification_hook— transport-agnostic source adapter trait + status surfaceevent— trigger lifecycle events for CLI listenersexecution—TriggerExecutor: the pipeline that replaces the oldAgentHarness::handle_trigger(evaluate → permission → audit → sub-agent → promote)
Transport adapters live in crates/server/src/triggers (MCP push, cron, dynamic) and
register with the executor via execution::TriggerExecutor::register_notification_hook.
Modules§
- event
- Trigger lifecycle events emitted by the
TriggerExecutor(moved out oftheway_core::SessionEvent). The CLI subscribes to these alongside the core harness event stream: the executor is host-owned, so its event surface is a host-level contract — the TUI banner,/triggerscommand and JSONL listeners all consume this stream. - execution
- Trigger execution engine (moved out of theway-core into the CLI host).
- notification_
hook - RFC 1 (issue #20)
NotificationHooktrait + status surface (moved out of theway-core with the rest of the trigger engine). - runtime
- RFC 1 (issue #20) dedup window + cycle suppression engine.
- types
- RFC 1 (issue #20) trigger envelope, source taxonomy, authority, state machine, and the
TriggerRecordpersisted asSessionTreeEntry::Custom { custom_type: "trigger" }.