1use std::path::PathBuf;
2
3use crate::CliOverridesPatch;
4
5#[derive(Clone, Debug, Eq, PartialEq)]
7pub struct DebugCommandRequest {
8 pub overrides: CliOverridesPatch,
10}
11
12impl DebugCommandRequest {
13 pub fn new() -> Self {
14 Self {
15 overrides: CliOverridesPatch::default(),
16 }
17 }
18
19 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
21 self.overrides = overrides;
22 self
23 }
24}
25
26impl Default for DebugCommandRequest {
27 fn default() -> Self {
28 Self::new()
29 }
30}
31
32#[derive(Clone, Debug, Eq, PartialEq)]
34pub struct DebugHelpRequest {
35 pub command: Vec<String>,
37 pub overrides: CliOverridesPatch,
39}
40
41impl DebugHelpRequest {
42 pub fn new() -> Self {
43 Self {
44 command: Vec::new(),
45 overrides: CliOverridesPatch::default(),
46 }
47 }
48
49 pub fn command(mut self, command: impl IntoIterator<Item = impl Into<String>>) -> Self {
51 self.command = command.into_iter().map(Into::into).collect();
52 self
53 }
54
55 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
57 self.overrides = overrides;
58 self
59 }
60}
61
62impl Default for DebugHelpRequest {
63 fn default() -> Self {
64 Self::new()
65 }
66}
67
68#[derive(Clone, Debug, Eq, PartialEq)]
70pub struct DebugAppServerRequest {
71 pub overrides: CliOverridesPatch,
73}
74
75impl DebugAppServerRequest {
76 pub fn new() -> Self {
77 Self {
78 overrides: CliOverridesPatch::default(),
79 }
80 }
81
82 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
84 self.overrides = overrides;
85 self
86 }
87}
88
89impl Default for DebugAppServerRequest {
90 fn default() -> Self {
91 Self::new()
92 }
93}
94
95#[derive(Clone, Debug, Eq, PartialEq)]
97pub struct DebugAppServerHelpRequest {
98 pub command: Vec<String>,
100 pub overrides: CliOverridesPatch,
102}
103
104impl DebugAppServerHelpRequest {
105 pub fn new() -> Self {
106 Self {
107 command: Vec::new(),
108 overrides: CliOverridesPatch::default(),
109 }
110 }
111
112 pub fn command(mut self, command: impl IntoIterator<Item = impl Into<String>>) -> Self {
114 self.command = command.into_iter().map(Into::into).collect();
115 self
116 }
117
118 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
120 self.overrides = overrides;
121 self
122 }
123}
124
125impl Default for DebugAppServerHelpRequest {
126 fn default() -> Self {
127 Self::new()
128 }
129}
130
131#[derive(Clone, Debug, Eq, PartialEq)]
133pub struct DebugAppServerSendMessageV2Request {
134 pub user_message: String,
136 pub overrides: CliOverridesPatch,
138}
139
140impl DebugAppServerSendMessageV2Request {
141 pub fn new(user_message: impl Into<String>) -> Self {
142 Self {
143 user_message: user_message.into(),
144 overrides: CliOverridesPatch::default(),
145 }
146 }
147
148 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
150 self.overrides = overrides;
151 self
152 }
153}
154
155#[derive(Clone, Debug, Eq, PartialEq)]
157pub struct DebugModelsRequest {
158 pub bundled: bool,
160 pub overrides: CliOverridesPatch,
162}
163
164impl DebugModelsRequest {
165 pub fn new() -> Self {
166 Self {
167 bundled: false,
168 overrides: CliOverridesPatch::default(),
169 }
170 }
171
172 pub fn bundled(mut self, enable: bool) -> Self {
174 self.bundled = enable;
175 self
176 }
177
178 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
180 self.overrides = overrides;
181 self
182 }
183}
184
185impl Default for DebugModelsRequest {
186 fn default() -> Self {
187 Self::new()
188 }
189}
190
191#[derive(Clone, Debug, Eq, PartialEq)]
193pub struct DebugPromptInputRequest {
194 pub prompt: Option<String>,
196 pub images: Vec<PathBuf>,
198 pub overrides: CliOverridesPatch,
200}
201
202impl DebugPromptInputRequest {
203 pub fn new() -> Self {
204 Self {
205 prompt: None,
206 images: Vec::new(),
207 overrides: CliOverridesPatch::default(),
208 }
209 }
210
211 pub fn prompt(mut self, prompt: impl Into<String>) -> Self {
213 self.prompt = Some(prompt.into());
214 self
215 }
216
217 pub fn image(mut self, image: impl Into<PathBuf>) -> Self {
219 self.images.push(image.into());
220 self
221 }
222
223 pub fn images<I, P>(mut self, images: I) -> Self
225 where
226 I: IntoIterator<Item = P>,
227 P: Into<PathBuf>,
228 {
229 self.images.extend(images.into_iter().map(Into::into));
230 self
231 }
232
233 pub fn with_overrides(mut self, overrides: CliOverridesPatch) -> Self {
235 self.overrides = overrides;
236 self
237 }
238}
239
240impl Default for DebugPromptInputRequest {
241 fn default() -> Self {
242 Self::new()
243 }
244}