-
Notifications
You must be signed in to change notification settings - Fork 77
Expand file tree
/
Copy pathbranches.rs
More file actions
67 lines (62 loc) · 1.59 KB
/
Copy pathbranches.rs
File metadata and controls
67 lines (62 loc) · 1.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
use crate::AppState;
use aqbot_core::types::*;
use tauri::State;
#[tauri::command]
pub async fn list_branches(
state: State<'_, AppState>,
conversation_id: String,
) -> Result<Vec<ConversationBranch>, String> {
aqbot_core::repo::conversation_branch::list_branches(&state.sea_db, &conversation_id)
.await
.map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn fork_conversation(
state: State<'_, AppState>,
conversation_id: String,
message_id: String,
) -> Result<ConversationBranch, String> {
aqbot_core::repo::conversation_branch::create_branch(
&state.sea_db,
&conversation_id,
&message_id,
"Branch",
)
.await
.map_err(|e| e.to_string())
}
#[tauri::command]
pub async fn compare_branches(
_state: State<'_, AppState>,
branch_a: String,
branch_b: String,
) -> Result<serde_json::Value, String> {
Ok(serde_json::json!({
"branch_a": branch_a,
"branch_b": branch_b,
"differences": []
}))
}
#[tauri::command]
pub async fn get_workspace_snapshot(
_state: State<'_, AppState>,
conversation_id: String,
) -> Result<serde_json::Value, String> {
Ok(serde_json::json!({
"conversation_id": conversation_id,
"context_sources": [],
"active_tools": [],
"knowledge_bindings": [],
"memory_policy": null,
"search_policy": null,
"artifacts": [],
"branches": []
}))
}
#[tauri::command]
pub async fn update_workspace_snapshot(
_state: State<'_, AppState>,
_conversation_id: String,
) -> Result<(), String> {
Ok(())
}