codex_protocol/
config_types.rs

1use schemars::JsonSchema;
2use serde::Deserialize;
3use serde::Serialize;
4use strum_macros::Display;
5use strum_macros::EnumIter;
6use ts_rs::TS;
7
8/// See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#get-started-with-reasoning
9#[derive(
10    Debug,
11    Serialize,
12    Deserialize,
13    Default,
14    Clone,
15    Copy,
16    PartialEq,
17    Eq,
18    Display,
19    JsonSchema,
20    TS,
21    EnumIter,
22    Hash,
23)]
24#[serde(rename_all = "lowercase")]
25#[strum(serialize_all = "lowercase")]
26pub enum ReasoningEffort {
27    None,
28    Minimal,
29    Low,
30    #[default]
31    Medium,
32    High,
33    XHigh,
34}
35
36/// A summary of the reasoning performed by the model. This can be useful for
37/// debugging and understanding the model's reasoning process.
38/// See https://platform.openai.com/docs/guides/reasoning?api-mode=responses#reasoning-summaries
39#[derive(
40    Debug, Serialize, Deserialize, Default, Clone, Copy, PartialEq, Eq, Display, JsonSchema, TS,
41)]
42#[serde(rename_all = "lowercase")]
43#[strum(serialize_all = "lowercase")]
44pub enum ReasoningSummary {
45    #[default]
46    Auto,
47    Concise,
48    Detailed,
49    /// Option to disable reasoning summaries.
50    None,
51}
52
53/// Controls output length/detail on GPT-5 models via the Responses API.
54/// Serialized with lowercase values to match the OpenAI API.
55#[derive(
56    Hash,
57    Debug,
58    Serialize,
59    Deserialize,
60    Default,
61    Clone,
62    Copy,
63    PartialEq,
64    Eq,
65    Display,
66    JsonSchema,
67    TS,
68)]
69#[serde(rename_all = "lowercase")]
70#[strum(serialize_all = "lowercase")]
71pub enum Verbosity {
72    Low,
73    #[default]
74    Medium,
75    High,
76}
77
78#[derive(
79    Deserialize, Debug, Clone, Copy, PartialEq, Default, Serialize, Display, JsonSchema, TS,
80)]
81#[serde(rename_all = "kebab-case")]
82#[strum(serialize_all = "kebab-case")]
83pub enum SandboxMode {
84    #[serde(rename = "read-only")]
85    #[default]
86    ReadOnly,
87
88    #[serde(rename = "workspace-write")]
89    WorkspaceWrite,
90
91    #[serde(rename = "danger-full-access")]
92    DangerFullAccess,
93}
94
95#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Display, JsonSchema, TS)]
96#[serde(rename_all = "lowercase")]
97#[strum(serialize_all = "lowercase")]
98pub enum ForcedLoginMethod {
99    Chatgpt,
100    Api,
101}
102
103/// Represents the trust level for a project directory.
104/// This determines the approval policy and sandbox mode applied.
105#[derive(Debug, Serialize, Deserialize, Clone, Copy, PartialEq, Eq, Display, JsonSchema, TS)]
106#[serde(rename_all = "lowercase")]
107#[strum(serialize_all = "lowercase")]
108pub enum TrustLevel {
109    Trusted,
110    Untrusted,
111}