mirror of
https://github.com/openai/codex.git
synced 2026-11-13 14:46:14 +00:00
Add workspace messages app-server API (#29001)
## Summary - Add backend-client types and fetch support for active workspace messages. - Add the app-server v2 `account/workspaceMessages/read` method, generated schemas, and README documentation. - Delegate workspace-message eligibility to the Codex backend feature gate; map a backend 404 to `featureEnabled: false`. ## Testing - `just write-app-server-schema` - `just test -p codex-backend-client` - `just test -p codex-app-server-protocol` - `just test -p codex-app-server workspace_messages` - `just fix -p codex-backend-client -p codex-app-server-protocol -p codex-app-server` - `just fmt` ## Stack - Base PR for #28232, which adds the TUI status-line integration.
This commit is contained in:
1 parent
9c3b10e5d4
commit
21d36296f1
34 files changed
+1163
-3
No files matched your search
@@ -314,6 +314,41 @@ pub struct GetAccountTokenUsageResponse {
|
||||
pub daily_usage_buckets: Option<Vec<AccountTokenUsageDailyBucket>>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct GetWorkspaceMessagesResponse {
|
||||
/// Whether the workspace-message backend route is available for this client.
|
||||
pub feature_enabled: bool,
|
||||
/// Active workspace messages returned by the backend.
|
||||
pub messages: Vec<WorkspaceMessage>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
pub struct WorkspaceMessage {
|
||||
pub message_id: String,
|
||||
pub message_type: WorkspaceMessageType,
|
||||
pub message_body: String,
|
||||
/// Unix timestamp (in seconds) when the message was created.
|
||||
#[ts(type = "number | null")]
|
||||
pub created_at: Option<i64>,
|
||||
/// Unix timestamp (in seconds) when the message was archived.
|
||||
#[ts(type = "number | null")]
|
||||
pub archived_at: Option<i64>,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
#[ts(export_to = "v2/", rename_all = "snake_case")]
|
||||
pub enum WorkspaceMessageType {
|
||||
Headline,
|
||||
Announcement,
|
||||
#[serde(other)]
|
||||
Unknown,
|
||||
}
|
||||
|
||||
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, JsonSchema, TS)]
|
||||
#[serde(rename_all = "camelCase")]
|
||||
#[ts(export_to = "v2/")]
|
||||
|
||||
Reference in new issue
Block a user