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

Function resolve_desktop_path_target

src/apps/desktop/src/api/path_target.rs:128–155  ·  view source on GitHub ↗
(
    app_state: &AppState,
    raw_path: &str,
    preferred_remote_connection_id: Option<&str>,
)

Source from the content-addressed store, hash-verified

126}
127
128pub async fn resolve_desktop_path_target(
129 app_state: &AppState,
130 raw_path: &str,
131 preferred_remote_connection_id: Option<&str>,
132) -> Result<DesktopPathTarget, String> {
133 if let Some(resolved_path) = resolve_runtime_artifact_path(app_state, raw_path).await? {
134 return Ok(DesktopPathTarget::Local {
135 requested_path: raw_path.to_string(),
136 resolved_path,
137 is_runtime_artifact: true,
138 });
139 }
140
141 if let Some(entry) =
142 lookup_remote_entry_for_path(app_state, raw_path, preferred_remote_connection_id).await
143 {
144 return Ok(DesktopPathTarget::Remote {
145 requested_path: raw_path.to_string(),
146 entry,
147 });
148 }
149
150 Ok(DesktopPathTarget::Local {
151 requested_path: raw_path.to_string(),
152 resolved_path: PathBuf::from(raw_path),
153 is_runtime_artifact: false,
154 })
155}
156
157#[derive(Debug, Clone, Serialize)]
158#[serde(rename_all = "camelCase")]

Callers 14

list_directory_filesFunction · 0.85
reveal_in_explorerFunction · 0.85
search_filenamesFunction · 0.85
read_text_fileFunction · 0.85
write_text_fileFunction · 0.85
path_existsFunction · 0.85
get_path_metadataFunction · 0.85
rename_pathFunction · 0.85
delete_fileFunction · 0.85
delete_directoryFunction · 0.85

Calls 2

Tested by

no test coverage detected