diff --git a/bin/pudoxd/src/main.rs b/bin/pudoxd/src/main.rs index 33e1ce6..bad9795 100644 --- a/bin/pudoxd/src/main.rs +++ b/bin/pudoxd/src/main.rs @@ -5,7 +5,6 @@ use std::sync::Arc; use tokio::sync::{mpsc, RwLock}; mod linear; -mod sandbox; mod session; use crate::linear::{Linear, WebhookPayload}; diff --git a/bin/pudoxd/src/sandbox.rs b/bin/pudoxd/src/sandbox.rs deleted file mode 100644 index 13d2385..0000000 --- a/bin/pudoxd/src/sandbox.rs +++ /dev/null @@ -1,32 +0,0 @@ -pub enum Sandbox { - Local, - Microvm, -} - -impl Sandbox { - pub async fn prepare(&self, session_id: &str) { - match self { - Sandbox::Local => { - tracing::info!("LocalSandbox: preparing for session {} (stub)", session_id); - } - Sandbox::Microvm => { - unimplemented!("MicrovmSandbox not yet implemented"); - } - } - } - - pub async fn spawn_agent(&self, session_id: &str) { - match self { - Sandbox::Local => { - tracing::info!("LocalSandbox: spawning agent for session {} (stub)", session_id); - } - Sandbox::Microvm => { - unimplemented!("MicrovmSandbox not yet implemented"); - } - } - } -} - -pub fn create_sandbox() -> Sandbox { - Sandbox::Local -} diff --git a/bin/pudoxd/src/session.rs b/bin/pudoxd/src/session.rs index b8a8ad9..5437ae1 100644 --- a/bin/pudoxd/src/session.rs +++ b/bin/pudoxd/src/session.rs @@ -3,11 +3,10 @@ use std::sync::Arc; use tokio::sync::{mpsc, RwLock}; use crate::linear::WebhookPayload; -use crate::sandbox::{create_sandbox, Sandbox}; pub enum SessionMessage { Init(WebhookPayload), - SandboxReady(Sandbox), + SandboxReady, } pub struct Session { @@ -23,10 +22,10 @@ async fn init(tx: mpsc::Sender, session_id: String) { session_id ); - let sandbox = create_sandbox(); - sandbox.prepare(&session_id).await; + // TODO: clone git repo, prepare sandbox + tracing::info!("Sandbox prepared for session {}", session_id); - let _ = tx.send(SessionMessage::SandboxReady(sandbox)).await; + let _ = tx.send(SessionMessage::SandboxReady).await; } pub async fn run_session( @@ -35,17 +34,14 @@ pub async fn run_session( mut rx: mpsc::Receiver, session_id: String, ) { - let mut sandbox: Option = None; - while let Some(msg) = rx.recv().await { match msg { SessionMessage::Init(_payload) => { tokio::spawn(init(tx.clone(), session_id.clone())); } - SessionMessage::SandboxReady(s) => { + SessionMessage::SandboxReady => { tracing::info!("Sandbox ready for session {}", session_id); - s.spawn_agent(&session_id).await; - sandbox = Some(s); + // TODO: spawn pudox-run inside sandbox } } }