codetether_agent/browser/session/
state.rs1use std::sync::Arc;
2use tokio::sync::Mutex;
3
4#[derive(Clone, Default)]
5pub struct BrowserSession {
6 pub(super) inner: Arc<SessionInner>,
7}
8
9#[derive(Default)]
10pub(super) struct SessionInner {
11 pub runtime: Mutex<Option<super::SessionRuntime>>,
12}
13
14impl BrowserSession {
15 pub fn new() -> Self {
16 Self::default()
17 }
18
19 pub async fn execute(
20 &self,
21 command: crate::browser::BrowserCommand,
22 ) -> Result<crate::browser::BrowserOutput, crate::browser::BrowserError> {
23 super::runtime::execute(self, command).await
24 }
25}