Download codex-rs/protocol/src/request_permissions.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 3.16 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/request_permissions.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/protocol/src/request_permissions.rs
-
curl -L -o request_permissions.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/request_permissions.rs
3.16 kB
| use crate::models::AdditionalPermissionProfile; | |
| use crate::models::FileSystemPermissions; | |
| use crate::models::NetworkPermissions; | |
| use codex_utils_path_uri::LegacyAppPathString; | |
| use schemars::JsonSchema; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| use ts_rs::TS; | |
| pub enum PermissionGrantScope { | |
| Turn, | |
| Session, | |
| } | |
| pub struct RequestPermissionProfile { | |
| pub network: Option<NetworkPermissions>, | |
| pub file_system: Option<FileSystemPermissions>, | |
| } | |
| impl RequestPermissionProfile { | |
| pub fn is_empty(&self) -> bool { | |
| self.network.is_none() && self.file_system.is_none() | |
| } | |
| } | |
| impl From<RequestPermissionProfile> for AdditionalPermissionProfile { | |
| fn from(value: RequestPermissionProfile) -> Self { | |
| Self { | |
| network: value.network, | |
| file_system: value.file_system, | |
| } | |
| } | |
| } | |
| impl From<AdditionalPermissionProfile> for RequestPermissionProfile { | |
| fn from(value: AdditionalPermissionProfile) -> Self { | |
| Self { | |
| network: value.network, | |
| file_system: value.file_system, | |
| } | |
| } | |
| } | |
| pub struct RequestPermissionsArgs { | |
| pub environment_id: Option<String>, | |
| pub reason: Option<String>, | |
| pub permissions: RequestPermissionProfile, | |
| } | |
| pub struct RequestPermissionsResponse { | |
| pub permissions: RequestPermissionProfile, | |
| pub scope: PermissionGrantScope, | |
| /// Review subsequent commands in this turn unless a permission hook resolves the request. | |
| pub strict_auto_review: bool, | |
| } | |
| pub struct RequestPermissionsEvent { | |
| /// Responses API call id for the associated tool call, if available. | |
| pub call_id: String, | |
| /// Turn ID that this request belongs to. | |
| /// Uses `#[serde(default)]` for backwards compatibility. | |
| pub turn_id: String, | |
| pub environment_id: Option<String>, | |
| pub started_at_ms: i64, | |
| pub reason: Option<String>, | |
| pub permissions: RequestPermissionProfile, | |
| pub cwd: Option<LegacyAppPathString>, | |
| } | |