fn open_window_with_kind( state: &Arc<AppState>, kind: WindowKind, parent_instance_id: Option<String>, ) -> Result<Value, String>