MCPcopy Create free account
hub / github.com/GCWing/BitFun / create_assistant_workspace

Function create_assistant_workspace

src/apps/desktop/src/api/commands.rs:1541–1577  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    app: tauri::AppHandle,
    _request: CreateAssistantWorkspaceRequest,
)

Source from the content-addressed store, hash-verified

1539
1540#[tauri::command]
1541pub async fn create_assistant_workspace(
1542 state: State<'_, AppState>,
1543 app: tauri::AppHandle,
1544 _request: CreateAssistantWorkspaceRequest,
1545) -> Result<WorkspaceInfoDto, String> {
1546 match state
1547 .workspace_service
1548 .create_assistant_workspace(None)
1549 .await
1550 {
1551 Ok(workspace_info) => {
1552 apply_active_workspace_context(&state, &app, &workspace_info, None).await;
1553
1554 if let Err(e) = state
1555 .workspace_identity_watch_service
1556 .sync_watched_workspaces()
1557 .await
1558 {
1559 warn!(
1560 "Failed to sync workspace identity watchers after assistant workspace creation: {}",
1561 e
1562 );
1563 }
1564
1565 info!(
1566 "Assistant workspace created: workspace_id={}, path={}",
1567 workspace_info.id,
1568 workspace_info.root_path.display()
1569 );
1570 Ok(WorkspaceInfoDto::from_workspace_info(&workspace_info))
1571 }
1572 Err(e) => {
1573 error!("Failed to create assistant workspace: {}", e);
1574 Err(format!("Failed to create assistant workspace: {}", e))
1575 }
1576 }
1577}
1578
1579#[tauri::command]
1580pub async fn delete_assistant_workspace(

Callers

nothing calls this directly

Tested by

no test coverage detected