Skip to main content

starweaver_runtime/
executor.rs

1//! Runtime checkpoint emission helpers and compatibility exports.
2
3use std::sync::Arc;
4
5use async_trait::async_trait;
6pub use starweaver_context::{
7    AgentCheckpoint, AgentExecutionDecision, AgentExecutor, AgentExecutorError, AgentResumeCursor,
8    AgentResumeEvidence,
9};
10pub use starweaver_core::AgentExecutionNode;
11
12/// Shared executor reference.
13pub type DynAgentExecutor = Arc<dyn AgentExecutor>;
14
15/// Direct in-process executor that always continues.
16#[derive(Clone, Debug, Default)]
17pub struct DirectAgentExecutor;
18
19#[async_trait]
20impl AgentExecutor for DirectAgentExecutor {
21    async fn checkpoint(
22        &self,
23        _checkpoint: AgentCheckpoint,
24    ) -> Result<AgentExecutionDecision, AgentExecutorError> {
25        Ok(AgentExecutionDecision::Continue)
26    }
27}