fn resolve_target( state: &AppState, caller: Option<&Caller>, auth: &UiAutomationAuth, pane: Option<&str>, ) -> Result<String, (StatusCode, String)>