Download codex-rs/app-server-protocol/src/protocol/v2/project.rs from SaylorTwift/codex: direct link, hf CLI and curl.
- Browser
- Download file 6.09 kB
-
https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/project.rs
- Command line
-
hf download hf://SaylorTwift/codex/codex-rs/app-server-protocol/src/protocol/v2/project.rs
-
curl -L -o project.rs https://huggingface.co/SaylorTwift/codex/resolve/main/codex-rs/app-server-protocol/src/protocol/v2/project.rs
6.09 kB
| use std::collections::BTreeMap; | |
| use crate::JsonSchema; | |
| use crate::TS; | |
| use codex_experimental_api_macros::ExperimentalApi; | |
| use codex_utils_absolute_path::AbsolutePathBuf; | |
| use serde::Deserialize; | |
| use serde::Serialize; | |
| use super::SortDirection; | |
| pub struct ProjectRoot { | |
| pub path: AbsolutePathBuf, | |
| } | |
| pub struct Project { | |
| pub id: String, | |
| pub name: String, | |
| pub roots: Vec<ProjectRoot>, | |
| pub metadata: BTreeMap<String, String>, | |
| pub position: i64, | |
| pub created_at: i64, | |
| pub updated_at: i64, | |
| /// Newest non-archived member thread's recency, in Unix seconds; null when none exist. | |
| pub recency_at: Option<i64>, | |
| } | |
| pub enum ProjectSortKey { | |
| Position, | |
| RecencyAt, | |
| } | |
| pub struct ProjectListParams { | |
| pub cursor: Option<String>, | |
| pub limit: Option<u32>, | |
| /// Defaults to position. Recency sorting always places empty projects last. | |
| pub sort_key: Option<ProjectSortKey>, | |
| /// Requires sortKey. Defaults to asc for position and desc for recencyAt. | |
| pub sort_direction: Option<SortDirection>, | |
| } | |
| pub struct ProjectListResponse { | |
| pub data: Vec<Project>, | |
| pub next_cursor: Option<String>, | |
| } | |
| pub struct ProjectReadParams { | |
| pub project_id: String, | |
| } | |
| pub struct ProjectReadResponse { | |
| pub project: Project, | |
| } | |
| pub struct ProjectCreateParams { | |
| pub name: String, | |
| pub roots: Vec<ProjectRoot>, | |
| pub metadata: Option<BTreeMap<String, String>>, | |
| pub idempotency_key: String, | |
| } | |
| pub struct ProjectCreateResponse { | |
| pub project: Project, | |
| } | |
| pub struct ProjectImportParams { | |
| pub name: String, | |
| pub roots: Vec<ProjectRoot>, | |
| pub metadata: Option<BTreeMap<String, String>>, | |
| pub threads: Option<Vec<String>>, | |
| pub idempotency_key: String, | |
| } | |
| pub struct ProjectImportResponse { | |
| pub project: Project, | |
| } | |
| pub struct ProjectUpdateParams { | |
| pub project_id: String, | |
| pub name: Option<String>, | |
| pub roots: Option<Vec<ProjectRoot>>, | |
| pub metadata: Option<BTreeMap<String, String>>, | |
| } | |
| pub struct ProjectUpdateResponse { | |
| pub project: Project, | |
| } | |
| pub struct ProjectMoveParams { | |
| pub project_id: String, | |
| pub before_project_id: Option<String>, | |
| } | |
| pub struct ProjectMoveResponse {} | |
| pub struct ProjectDeleteParams { | |
| pub project_id: String, | |
| } | |
| pub struct ProjectDeleteResponse {} | |
| pub enum ProjectChangeType { | |
| Created, | |
| Updated, | |
| Deleted, | |
| } | |
| pub struct ProjectChangedNotification { | |
| pub project_id: String, | |
| pub change_type: ProjectChangeType, | |
| } | |
| pub struct ThreadProjectUpdatedNotification { | |
| pub thread_id: String, | |
| pub project_id: Option<String>, | |
| } | |