pub struct Engine {
pub store: Arc<Store>,
pub github: Option<GitHubClient>,
/* private fields */
}Fields§
§store: Arc<Store>§github: Option<GitHubClient>Optional GitHub API client. None when no token is configured.
Implementations§
Source§impl Engine
impl Engine
pub fn new(store: Arc<Store>) -> Arc<Self>
pub fn new_with_github(store: Arc<Store>, token: String) -> Arc<Self>
Sourcepub async fn register_stream(&self, session_id: SessionId) -> Receiver<()>
pub async fn register_stream(&self, session_id: SessionId) -> Receiver<()>
Cancel any running FIFO reader for session_id and return a fresh
cancellation receiver for the new reader. Call this at the top of
every start_streaming invocation.
pub fn emit(&self, event: Event)
pub fn subscribe(&self) -> Receiver<Event>
pub async fn register_pty_writer( &self, session_id: SessionId, writer: UnboundedSender<Vec<u8>>, )
pub async fn get_pty_writer( &self, session_id: &str, ) -> Option<UnboundedSender<Vec<u8>>>
Sourcepub async fn remove_orchestrator(&self, orchestrator_id: &str) -> Result<()>
pub async fn remove_orchestrator(&self, orchestrator_id: &str) -> Result<()>
Kill all worker sessions belonging to an orchestrator, delete from DB, emit events.
Sourcepub async fn remove_session(&self, session_id: &str) -> Result<()>
pub async fn remove_session(&self, session_id: &str) -> Result<()>
Kill the tmux session and delete it from the DB entirely.
Sourcepub async fn send_to_session(
&self,
session_id: &str,
message: &str,
) -> Result<()>
pub async fn send_to_session( &self, session_id: &str, message: &str, ) -> Result<()>
Send a text message to the agent running in a session’s tmux window. The message is injected as keyboard input — the agent sees it as typed text. Returns Ok(()) if the tmux send succeeded; returns an error if the session has no active tmux window or tmux is unavailable.
Sourcepub async fn terminate_session(&self, session_id: &str) -> Result<()>
pub async fn terminate_session(&self, session_id: &str) -> Result<()>
Kill the tmux session, mark it Terminated in the DB, and emit SessionUpdated.
Sourcepub async fn cleanup_session(&self, session_id: &str) -> Result<()>
pub async fn cleanup_session(&self, session_id: &str) -> Result<()>
Kill the tmux session (best-effort) and mark it Done in the DB. Called automatically when a PR is merged. Emits SessionUpdated.