Download codex-rs/protocol/src/capabilities.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 1.7 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/capabilities.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/protocol/src/capabilities.rs
-
curl -L -o capabilities.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/protocol/src/capabilities.rs
1.7 kB
| use codex_utils_path_uri::LegacyAppPathString; | |
| use codex_utils_path_uri::PathUri; | |
| use schemars::JsonSchema; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| use ts_rs::TS; | |
| /// A user-selected root that can expose one or more runtime capabilities. | |
| pub struct SelectedCapabilityRoot { | |
| /// Stable identifier supplied by the capability selection platform. | |
| pub id: String, | |
| /// Where the selected root can be resolved. | |
| pub location: CapabilityRootLocation, | |
| } | |
| /// Location used to resolve a selected capability root. | |
| pub enum CapabilityRootLocation { | |
| /// A path owned by an execution environment. | |
| Environment { | |
| environment_id: String, | |
| /// Absolute path for the root in the selected environment. | |
| path: PathUri, | |
| }, | |
| } | |
| fn deserialize_path_uri_from_api_path<'de, D>(deserializer: D) -> Result<PathUri, D::Error> | |
| where | |
| D: serde::Deserializer<'de>, | |
| { | |
| let path = LegacyAppPathString::deserialize(deserializer)?; | |
| if let Ok(path_uri) = PathUri::parse(path.as_str()) { | |
| return Ok(path_uri); | |
| } | |
| path.try_into().map_err(serde::de::Error::custom) | |
| } | |
| mod tests; | |