Skip to content

Commit 67333e8

Browse files
committed
Merge PR Dimillian#596: add saved account switching
2 parents ea9492f + 70b819f commit 67333e8

17 files changed

Lines changed: 963 additions & 109 deletions

File tree

src-tauri/Cargo.lock

Lines changed: 21 additions & 93 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src-tauri/Cargo.toml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,12 @@ toml_edit = "0.20.2"
4747
[target."cfg(not(any(target_os = \"android\", target_os = \"ios\")))".dependencies]
4848
tauri-plugin-updater = "2.10.0"
4949
tauri-plugin-window-state = "2"
50+
portable-pty = "0.8"
51+
52+
[target."cfg(all(not(any(target_os = \"android\", target_os = \"ios\", target_os = \"windows\"))))".dependencies]
5053
cpal = "0.15"
51-
whisper-rs = "0.12"
54+
whisper-rs = "0.16"
5255
sha2 = "0.10"
53-
portable-pty = "0.8"
5456

5557
[target."cfg(target_os = \"macos\")".dependencies]
5658
objc2 = "0.6"

src-tauri/src/codex/mod.rs

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -750,6 +750,55 @@ pub(crate) async fn account_read(
750750
codex_core::account_read_core(&state.sessions, &state.workspaces, workspace_id).await
751751
}
752752

753+
#[tauri::command]
754+
pub(crate) async fn saved_auth_profiles_list(
755+
workspace_id: String,
756+
state: State<'_, AppState>,
757+
_app: AppHandle,
758+
) -> Result<Value, String> {
759+
if remote_backend::is_remote_mode(&*state).await {
760+
return Err("Saved auth profiles are not supported in remote mode".to_string());
761+
}
762+
763+
codex_core::saved_auth_profiles_list_core(&state.workspaces, workspace_id).await
764+
}
765+
766+
#[tauri::command]
767+
pub(crate) async fn saved_auth_profile_sync_current(
768+
workspace_id: String,
769+
account: Option<Value>,
770+
rate_limits: Option<Value>,
771+
state: State<'_, AppState>,
772+
_app: AppHandle,
773+
) -> Result<Value, String> {
774+
if remote_backend::is_remote_mode(&*state).await {
775+
return Err("Saved auth profiles are not supported in remote mode".to_string());
776+
}
777+
778+
codex_core::saved_auth_profile_sync_current_core(
779+
&state.workspaces,
780+
workspace_id,
781+
account,
782+
rate_limits,
783+
)
784+
.await
785+
}
786+
787+
#[tauri::command]
788+
pub(crate) async fn saved_auth_profile_activate(
789+
workspace_id: String,
790+
profile_id: String,
791+
state: State<'_, AppState>,
792+
_app: AppHandle,
793+
) -> Result<Value, String> {
794+
if remote_backend::is_remote_mode(&*state).await {
795+
return Err("Saved auth profiles are not supported in remote mode".to_string());
796+
}
797+
798+
codex_core::saved_auth_profile_activate_core(&state.workspaces, workspace_id, profile_id)
799+
.await
800+
}
801+
753802
#[tauri::command]
754803
pub(crate) async fn codex_login(
755804
workspace_id: String,

src-tauri/src/dictation/mod.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
1-
#[cfg_attr(any(target_os = "ios", target_os = "android"), path = "stub.rs")]
2-
#[cfg_attr(not(any(target_os = "ios", target_os = "android")), path = "real.rs")]
1+
#[cfg_attr(
2+
any(target_os = "ios", target_os = "android", target_os = "windows"),
3+
path = "stub.rs"
4+
)]
5+
#[cfg_attr(
6+
not(any(target_os = "ios", target_os = "android", target_os = "windows")),
7+
path = "real.rs"
8+
)]
39
mod imp;
410

511
pub(crate) use imp::*;

src-tauri/src/lib.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ pub fn run() {
272272
codex::write_agent_config_toml,
273273
codex::account_rate_limits,
274274
codex::account_read,
275+
codex::saved_auth_profiles_list,
276+
codex::saved_auth_profile_sync_current,
277+
codex::saved_auth_profile_activate,
275278
codex::codex_login,
276279
codex::codex_login_cancel,
277280
codex::skills_list,

0 commit comments

Comments
 (0)