mirror of
https://github.com/openai/codex.git
synced 2026-11-26 23:40:43 +00:00
## What changed Remove `position` from app-server `Project` responses, the thread-store project model, and generated schemas and SDK types. Document that clients should use the returned project order and that `beforeProjectId` places a moved project before another project, or appends it when omitted or null. GitOrigin-RevId: 5de481e13f524c03260b7fed5c74874f051d6f30
81 lines
1.9 KiB
Rust
81 lines
1.9 KiB
Rust
use std::collections::BTreeMap;
|
|
|
|
use crate::SortDirection;
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct StoredProjectRoot {
|
|
pub path: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct StoredProject {
|
|
pub id: String,
|
|
pub name: String,
|
|
pub roots: Vec<StoredProjectRoot>,
|
|
pub metadata: BTreeMap<String, String>,
|
|
pub created_at_ms: i64,
|
|
pub updated_at_ms: i64,
|
|
pub recency_at_ms: Option<i64>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct StoredProjectsPage {
|
|
pub projects: Vec<StoredProject>,
|
|
pub next_cursor: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct ListProjectsParams {
|
|
pub cursor: Option<String>,
|
|
pub limit: usize,
|
|
pub sort_key: codex_state::ProjectSortKey,
|
|
pub sort_direction: SortDirection,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct CreateProjectParams {
|
|
pub name: String,
|
|
pub roots: Vec<StoredProjectRoot>,
|
|
pub metadata: BTreeMap<String, String>,
|
|
pub thread_ids: Vec<String>,
|
|
pub idempotency_key: String,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct CreatedProject {
|
|
pub project: StoredProject,
|
|
pub created: bool,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct UpdateProjectParams {
|
|
pub project_id: String,
|
|
pub name: Option<String>,
|
|
pub roots: Option<Vec<StoredProjectRoot>>,
|
|
pub metadata: Option<BTreeMap<String, String>>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct MoveProjectParams {
|
|
pub project_id: String,
|
|
pub before_project_id: Option<String>,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub enum ProjectMoveOutcome {
|
|
Unchanged,
|
|
Moved,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct UpdatedProject {
|
|
pub project: StoredProject,
|
|
pub changed: bool,
|
|
}
|
|
|
|
#[derive(Clone, Debug, PartialEq, Eq)]
|
|
pub struct DeletedProject {
|
|
pub affected_active_thread_ids: Vec<String>,
|
|
pub affected_archived_thread_ids: Vec<String>,
|
|
}
|