Skip to content

Commit 531a5bd

Browse files
committed
feat(desktop): add Project connection setup
Signed-off-by: KC <[email protected]>
1 parent b450d46 commit 531a5bd

22 files changed

Lines changed: 3239 additions & 5 deletions

‎desktop/playwright.config.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ export default defineConfig({
137137
"**/harness-catalog-screenshots.spec.ts",
138138
"**/inline-custom-harness.spec.ts",
139139
"**/where-to-run-config.spec.ts",
140+
"**/project-connections-screenshots.spec.ts",
140141
"**/huddle-transcription.spec.ts",
141142
"**/agent-numeric-tuning.spec.ts",
142143
"**/needs-restart-screenshots.spec.ts",

‎desktop/src-tauri/src/commands/mod.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ pub mod pairing;
4242
mod personas;
4343
mod prevent_sleep;
4444
mod profile;
45+
mod project_connections;
4546
mod project_git;
4647
mod project_git_branches;
4748
mod project_git_diff;
@@ -98,6 +99,7 @@ pub use pairing::*;
9899
pub use personas::*;
99100
pub use prevent_sleep::*;
100101
pub use profile::*;
102+
pub use project_connections::*;
101103
pub use project_git::*;
102104
pub use project_git_branches::*;
103105
pub use project_git_diff::*;
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
use tauri::AppHandle;
2+
3+
use crate::managed_agents::project_connections::{
4+
self, CreateProjectConnectionRequest, ProjectConnection, ProjectConnectionScope,
5+
UpdateProjectConnectionRequest,
6+
};
7+
8+
#[tauri::command]
9+
pub fn list_project_connections(
10+
app: AppHandle,
11+
project_scope: ProjectConnectionScope,
12+
) -> Result<Vec<ProjectConnection>, String> {
13+
project_connections::list_project_connections(&app, &project_scope)
14+
}
15+
16+
#[tauri::command]
17+
pub fn create_project_connection(
18+
app: AppHandle,
19+
input: CreateProjectConnectionRequest,
20+
) -> Result<ProjectConnection, String> {
21+
project_connections::create_project_connection(&app, input)
22+
}
23+
24+
#[tauri::command]
25+
pub fn update_project_connection(
26+
app: AppHandle,
27+
input: UpdateProjectConnectionRequest,
28+
) -> Result<ProjectConnection, String> {
29+
project_connections::update_project_connection(&app, input)
30+
}
31+
32+
#[tauri::command]
33+
pub async fn test_project_connection(
34+
app: AppHandle,
35+
project_scope: ProjectConnectionScope,
36+
connection_id: String,
37+
) -> Result<ProjectConnection, String> {
38+
tauri::async_runtime::spawn_blocking(move || {
39+
project_connections::test_project_connection(&app, &project_scope, &connection_id)
40+
})
41+
.await
42+
.map_err(|error| format!("Project connection test task failed: {error}"))?
43+
}
44+
45+
#[tauri::command]
46+
pub fn delete_project_connection(
47+
app: AppHandle,
48+
project_scope: ProjectConnectionScope,
49+
connection_id: String,
50+
) -> Result<(), String> {
51+
project_connections::delete_project_connection(&app, &project_scope, &connection_id)
52+
}

‎desktop/src-tauri/src/lib.rs‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -138,28 +138,23 @@ pub fn run() {
138138
if webview.label() != "main" {
139139
return;
140140
}
141-
142141
// Linux/WebKitGTK needs media-stream settings and a
143142
// permission-request handler for getUserMedia; no-op
144143
// on macOS/Windows.
145144
linux_media::enable_media_capture(&webview);
146-
147145
// macOS applies the restored geometry asynchronously. Wait
148146
// for several identical outer bounds and for React to
149147
// commit the startup surface before revealing it.
150148
let window = webview.window();
151-
152149
#[cfg(target_os = "macos")]
153150
{
154151
set_initial_window_backing(&window);
155-
156152
let (initial_render_tx, initial_render_rx) = tokio::sync::oneshot::channel();
157153
window
158154
.app_handle()
159155
.once(INITIAL_RENDER_READY_EVENT, move |_| {
160156
let _ = initial_render_tx.send(());
161157
});
162-
163158
tauri::async_runtime::spawn(async move {
164159
wait_for_stable_initial_window_geometry(&window).await;
165160

@@ -637,6 +632,11 @@ pub fn run() {
637632
get_project_local_repo_diff,
638633
get_project_local_repo_snapshot,
639634
get_project_repo_sync_status,
635+
list_project_connections,
636+
create_project_connection,
637+
update_project_connection,
638+
test_project_connection,
639+
delete_project_connection,
640640
list_project_local_repositories,
641641
clone_project_repository,
642642
create_project_remote_branch,

‎desktop/src-tauri/src/managed_agents/mod.rs‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ pub(crate) mod persona_events;
2121
mod personas;
2222
#[cfg(windows)]
2323
mod process_lifecycle;
24+
pub(crate) mod project_connections;
2425
pub(crate) mod readiness;
2526
pub(crate) mod reconcile;
2627
mod relay_mesh;

0 commit comments

Comments
 (0)