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

Function get_available_modes

src/apps/desktop/src/api/agentic_api.rs:2045–2079  ·  view source on GitHub ↗
(
    state: State<'_, AppState>,
    startup_trace: State<'_, DesktopStartupTrace>,
)

Source from the content-addressed store, hash-verified

2043
2044#[tauri::command]
2045pub async fn get_available_modes(
2046 state: State<'_, AppState>,
2047 startup_trace: State<'_, DesktopStartupTrace>,
2048) -> Result<Vec<ModeInfoDTO>, String> {
2049 let trace_started = Instant::now();
2050 let mode_infos = state.agent_registry.get_modes_info().await;
2051
2052 let dtos: Vec<ModeInfoDTO> = mode_infos
2053 .into_iter()
2054 .map(|info| {
2055 let config_profile_id = info
2056 .config_profile_id
2057 .clone()
2058 .unwrap_or_else(|| info.id.clone());
2059 ModeInfoDTO {
2060 id: info.id,
2061 name: info.name,
2062 description: info.description,
2063 is_readonly: info.is_readonly,
2064 tool_count: info.tool_count,
2065 default_tools: info.default_tools,
2066 prompt_cache_scope_key: info.prompt_cache_scope_key,
2067 config_profile_id,
2068 config_profile_label: info.config_profile_label,
2069 config_profile_member_mode_ids: info.config_profile_member_mode_ids,
2070 source: info.source,
2071 path: info.path,
2072 model: info.model,
2073 }
2074 })
2075 .collect();
2076
2077 startup_trace.record_tauri_command_elapsed("get_available_modes", None, trace_started);
2078 Ok(dtos)
2079}
2080
2081#[tauri::command]
2082pub async fn get_default_review_team_definition() -> Result<ReviewTeamDefinition, String> {

Callers

nothing calls this directly

Calls 4

get_modes_infoMethod · 0.80
collectMethod · 0.80
cloneMethod · 0.45

Tested by

no test coverage detected