Skip to content

Commit 35105d5

Browse files
committed
feat: persist workspace runtime state across reconnects
1 parent de0f478 commit 35105d5

50 files changed

Lines changed: 6739 additions & 361 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/server/src/app.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ pub(crate) struct AppState {
5757
pub auth: Mutex<AuthRuntime>,
5858
pub agents: Mutex<HashMap<String, Arc<AgentRuntime>>>,
5959
pub terminals: Mutex<HashMap<String, Arc<TerminalRuntime>>>,
60+
pub workspace_client_connections: Mutex<HashMap<String, usize>>,
6061
pub workspace_watches: Mutex<HashMap<String, WorkspaceWatch>>,
6162
pub workspace_watch_suppressions: Arc<Mutex<HashMap<String, WorkspaceWatchSuppression>>>,
6263
pub next_terminal_id: Mutex<u64>,
@@ -74,6 +75,7 @@ impl Default for AppState {
7475
auth: Mutex::new(AuthRuntime::default()),
7576
agents: Mutex::new(HashMap::new()),
7677
terminals: Mutex::new(HashMap::new()),
78+
workspace_client_connections: Mutex::new(HashMap::new()),
7779
workspace_watches: Mutex::new(HashMap::new()),
7880
workspace_watch_suppressions: Arc::new(Mutex::new(HashMap::new())),
7981
next_terminal_id: Mutex::new(1),

apps/server/src/auth/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,7 @@ fn normalized_allowed_roots(
12701270
Ok(roots)
12711271
}
12721272

1273-
fn normalize_path_for_target(path: &str, target: &ExecTarget) -> Result<String, String> {
1273+
pub(crate) fn normalize_path_for_target(path: &str, target: &ExecTarget) -> Result<String, String> {
12741274
match target {
12751275
ExecTarget::Native => normalize_native_path(path),
12761276
ExecTarget::Wsl { .. } => normalize_wsl_path(path, target),
@@ -1316,7 +1316,7 @@ fn normalize_wsl_path(path: &str, target: &ExecTarget) -> Result<String, String>
13161316
run_cmd(target, "", &["realpath", "-m", &resolved]).map(|value| value.trim().to_string())
13171317
}
13181318

1319-
fn path_within_root(path: &str, root: &str, target: &ExecTarget) -> bool {
1319+
pub(crate) fn path_within_root(path: &str, root: &str, target: &ExecTarget) -> bool {
13201320
let normalize = |value: &str| {
13211321
let value = value.replace('\\', "/");
13221322
let trimmed = value.trim_end_matches('/').to_string();

0 commit comments

Comments
 (0)