Skip to main content

codex_extension_items/
image_generation.rs

1use codex_utils_absolute_path::AbsolutePathBuf;
2use schemars::JsonSchema;
3use serde::Deserialize;
4use serde::Serialize;
5use ts_rs::TS;
6
7// Standalone image-generation item owned by the image extension. This is also
8// the field-level representation exposed by app-server; core and rollout
9// persistence only carry it inside an ExtensionItem envelope.
10#[derive(Debug, Clone, Deserialize, Serialize, TS, JsonSchema, PartialEq)]
11#[serde(rename_all = "camelCase")]
12#[ts(rename_all = "camelCase")]
13pub struct ImageGenerationItem {
14    pub id: String,
15    pub status: String,
16    pub revised_prompt: Option<String>,
17    pub result: String,
18    #[serde(default, skip_serializing_if = "Option::is_none")]
19    #[ts(optional)]
20    pub saved_path: Option<AbsolutePathBuf>,
21}