Skip to main content

Module execution

Module execution 

Source
Expand description

Trigger execution engine (moved out of theway-core into the CLI host).

TriggerExecutor is the host-side counterpart of AgentHarness::handle_trigger: it owns the dedup/cycle runtime, the permission hook chain, the audit persistence (via the core Session public API) and the sub-agent execution for accepted triggers. The core runtime stays state-only — the executor subscribes to core hooks and modifies core state (session audits, parent transcript promotion) through public APIs, and surfaces its lifecycle via TriggerEvent to CLI listeners.

The executor is created per harness/session by the CLI wiring (main.rs), which also registers transport adapters via TriggerExecutor::register_notification_hook.

Re-exports§

pub use types::BeforeTriggerActionContext;
pub use types::BeforeTriggerActionHook;
pub use types::BeforeTriggerContext;
pub use types::BeforeTriggerDecision;
pub use types::BeforeTriggerHook;
pub use types::NotificationStatusSnapshot;
pub use types::OnTriggerPromptHook;
pub use types::PromoteAction;
pub use types::PromotionCondition;
pub use types::PromotionConditionSkipReason;
pub use types::RunningTriggerState;
pub use types::TriggerAction;
pub use types::TriggerDelivery;
pub use types::TriggerPromptDecision;
pub use types::TriggerPromptRequest;

Modules§

action
Sub-agent execution for accepted triggers — the detached task body spawned by TriggerExecutor::spawn_trigger_action.
promotion
Result promotion: mirrors a completed trigger’s trigger_result back into the parent session / transcript per the PromoteAction contract (RFC 1 §5.C).
types
Domain types for the trigger execution pipeline: permission decisions, prompt requests, action/delivery/promotion contracts and the hook type aliases.
utils
Small shared helpers for the execution pipeline: audit-label / reason caps, prompt-request construction with payload validation, listener fan-out and banner preview truncation.

Structs§

TriggerExecutor
Host-side trigger pipeline for one harness/session. Constructed by the CLI wiring with the parent agent + session handles and the same hook closures configured on the harness; handle_trigger replaces the old core entrypoint 1:1.