Make model and permission choices provider-specific

This commit is contained in:
iris committed 2026-09-08 00:08:09 -04:00
1 parent 6a0202b1b5
commit 7ee88dfd9c
10 files changed
+269 -60

No files matched your search

+20
View File
@@ -258,6 +258,26 @@ impl DriverKind {
Self::Echo | Self::LlamaCpp => false,
}
}
/// Permission choices the phone can offer for this kind, in display order.
/// The driver remains responsible for translating these stable values into
/// its CLI's arguments or control protocol.
pub fn permission_modes(self) -> &'static [&'static str] {
match self {
Self::ClaudeCli => &["manual", "acceptEdits", "auto", "bypassPermissions", "plan"],
Self::CodexCli => &["workspace-write", "read-only", "danger-full-access"],
Self::Echo | Self::LlamaCpp => &[],
}
}
/// The mode used when a new-session form first selects this kind.
pub fn default_permission_mode(self) -> Option<&'static str> {
match self {
Self::ClaudeCli => Some("auto"),
Self::CodexCli => Some("workspace-write"),
Self::Echo | Self::LlamaCpp => None,
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]