Skip to main content

objectiveai_sdk/cli/command/agents/
mod.rs

1pub mod enqueue;
2pub mod get;
3pub mod instances;
4pub mod list;
5pub mod logs;
6pub mod message;
7pub mod publish;
8pub mod queue;
9pub mod selector;
10pub mod spawn;
11pub mod tags;
12pub mod wait;
13
14#[derive(clap::Subcommand)]
15pub enum Command {
16    /// Park a message in the queue against an agent instance or tag
17    /// and return immediately (no delivery race, no spawn).
18    Enqueue(enqueue::Command),
19    /// Get an agent by remote path.
20    Get(get::Command),
21    /// Caller-side handles for live spawned agents that didn't earn
22    /// their own top-level home: `me`, `list`.
23    Instances {
24        #[command(subcommand)]
25        command: instances::Command,
26    },
27    /// List remote agents available from a given source.
28    List(list::Command),
29    /// Persisted log tier — `open`, `list`, `subscribe`.
30    Logs {
31        #[command(subcommand)]
32        command: logs::Command,
33    },
34    /// Deliver a message to a running spawned agent (or resume its
35    /// most recent completion via continuation if it's dormant).
36    Message(message::Command),
37    /// Publish an agent to the local filesystem.
38    Publish(publish::Command),
39    /// Deferred-prompt queue — `open`, `list`, `delete`, `deliver`.
40    /// (Add is gone — use `agents message` instead.)
41    Queue {
42        #[command(subcommand)]
43        command: queue::Command,
44    },
45    /// Spawn an agent completion (open a streaming run as a child of
46    /// this caller).
47    Spawn(spawn::Command),
48    /// Client-side agent tags — lookup / apply.
49    Tags {
50        #[command(subcommand)]
51        command: tags::Command,
52    },
53    /// Block until an agent (instance or tag) is done — its lock
54    /// chain fully released — or the timeout elapses.
55    Wait(wait::Command),
56}
57
58#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, schemars::JsonSchema)]
59#[serde(untagged)]
60#[schemars(rename = "cli.command.agents.Request")]
61pub enum Request {
62    #[schemars(title = "Enqueue")]
63    Enqueue(enqueue::Request),
64    #[schemars(title = "EnqueueRequestSchema")]
65    EnqueueRequestSchema(enqueue::request_schema::Request),
66    #[schemars(title = "EnqueueResponseSchema")]
67    EnqueueResponseSchema(enqueue::response_schema::Request),
68    #[schemars(title = "Get")]
69    Get(get::Request),
70    #[schemars(title = "GetRequestSchema")]
71    GetRequestSchema(get::request_schema::Request),
72    #[schemars(title = "GetResponseSchema")]
73    GetResponseSchema(get::response_schema::Request),
74    #[schemars(title = "Instances")]
75    Instances(instances::Request),
76    #[schemars(title = "List")]
77    List(list::Request),
78    #[schemars(title = "ListRequestSchema")]
79    ListRequestSchema(list::request_schema::Request),
80    #[schemars(title = "ListResponseSchema")]
81    ListResponseSchema(list::response_schema::Request),
82    #[schemars(title = "Logs")]
83    Logs(logs::Request),
84    #[schemars(title = "Message")]
85    Message(message::Request),
86    #[schemars(title = "MessageRequestSchema")]
87    MessageRequestSchema(message::request_schema::Request),
88    #[schemars(title = "MessageResponseSchema")]
89    MessageResponseSchema(message::response_schema::Request),
90    #[schemars(title = "Publish")]
91    Publish(publish::Request),
92    #[schemars(title = "PublishRequestSchema")]
93    PublishRequestSchema(publish::request_schema::Request),
94    #[schemars(title = "PublishResponseSchema")]
95    PublishResponseSchema(publish::response_schema::Request),
96    #[schemars(title = "Queue")]
97    Queue(queue::Request),
98    #[schemars(title = "Spawn")]
99    Spawn(spawn::Request),
100    #[schemars(title = "SpawnRequestSchema")]
101    SpawnRequestSchema(spawn::request_schema::Request),
102    #[schemars(title = "SpawnResponseSchema")]
103    SpawnResponseSchema(spawn::response_schema::Request),
104    #[schemars(title = "Tags")]
105    Tags(tags::Request),
106    #[schemars(title = "Wait")]
107    Wait(wait::Request),
108    #[schemars(title = "WaitRequestSchema")]
109    WaitRequestSchema(wait::request_schema::Request),
110    #[schemars(title = "WaitResponseSchema")]
111    WaitResponseSchema(wait::response_schema::Request),
112}
113
114// Exempt from json-schema coverage: tier aggregate (see the root
115// `ResponseItem` in command.rs - TS7056).
116#[objectiveai_sdk_macros::json_schema_ignore]
117#[derive(Debug, Clone, serde::Serialize, serde::Deserialize, schemars::JsonSchema)]
118#[schemars(rename = "cli.command.agents.ResponseItem")]
119#[serde(untagged)]
120pub enum ResponseItem {
121    #[schemars(title = "Enqueue")]
122    Enqueue(enqueue::Response),
123    #[schemars(title = "EnqueueRequestSchema")]
124    EnqueueRequestSchema(enqueue::request_schema::Response),
125    #[schemars(title = "EnqueueResponseSchema")]
126    EnqueueResponseSchema(enqueue::response_schema::Response),
127    #[schemars(title = "Get")]
128    Get(get::Response),
129    #[schemars(title = "GetRequestSchema")]
130    GetRequestSchema(get::request_schema::Response),
131    #[schemars(title = "GetResponseSchema")]
132    GetResponseSchema(get::response_schema::Response),
133    #[schemars(title = "Instances")]
134    Instances(instances::ResponseItem),
135    #[schemars(title = "List")]
136    List(list::ResponseItem),
137    #[schemars(title = "ListRequestSchema")]
138    ListRequestSchema(list::request_schema::Response),
139    #[schemars(title = "ListResponseSchema")]
140    ListResponseSchema(list::response_schema::Response),
141    #[schemars(title = "Logs")]
142    Logs(logs::ResponseItem),
143    #[schemars(title = "Message")]
144    Message(message::Response),
145    #[schemars(title = "MessageRequestSchema")]
146    MessageRequestSchema(message::request_schema::Response),
147    #[schemars(title = "MessageResponseSchema")]
148    MessageResponseSchema(message::response_schema::Response),
149    #[schemars(title = "Publish")]
150    Publish(publish::Response),
151    #[schemars(title = "PublishRequestSchema")]
152    PublishRequestSchema(publish::request_schema::Response),
153    #[schemars(title = "PublishResponseSchema")]
154    PublishResponseSchema(publish::response_schema::Response),
155    #[schemars(title = "Queue")]
156    Queue(queue::ResponseItem),
157    #[schemars(title = "Spawn")]
158    Spawn(spawn::ResponseItem),
159    #[schemars(title = "SpawnRequestSchema")]
160    SpawnRequestSchema(spawn::request_schema::Response),
161    #[schemars(title = "SpawnResponseSchema")]
162    SpawnResponseSchema(spawn::response_schema::Response),
163    #[schemars(title = "Tags")]
164    Tags(tags::ResponseItem),
165    #[schemars(title = "Wait")]
166    Wait(wait::Response),
167    #[schemars(title = "WaitRequestSchema")]
168    WaitRequestSchema(wait::request_schema::Response),
169    #[schemars(title = "WaitResponseSchema")]
170    WaitResponseSchema(wait::response_schema::Response),
171}
172
173#[cfg(feature = "mcp")]
174impl crate::cli::command::CommandResponse for ResponseItem {
175    fn into_mcp(self) -> crate::cli::command::McpResponseItem {
176        match self {
177            ResponseItem::Enqueue(v) => v.into_mcp(),
178            ResponseItem::EnqueueRequestSchema(v) => v.into_mcp(),
179            ResponseItem::EnqueueResponseSchema(v) => v.into_mcp(),
180            ResponseItem::Get(v) => v.into_mcp(),
181            ResponseItem::GetRequestSchema(v) => v.into_mcp(),
182            ResponseItem::GetResponseSchema(v) => v.into_mcp(),
183            ResponseItem::Instances(v) => v.into_mcp(),
184            ResponseItem::List(v) => v.into_mcp(),
185            ResponseItem::ListRequestSchema(v) => v.into_mcp(),
186            ResponseItem::ListResponseSchema(v) => v.into_mcp(),
187            ResponseItem::Logs(v) => v.into_mcp(),
188            ResponseItem::Message(v) => v.into_mcp(),
189            ResponseItem::MessageRequestSchema(v) => v.into_mcp(),
190            ResponseItem::MessageResponseSchema(v) => v.into_mcp(),
191            ResponseItem::Publish(v) => v.into_mcp(),
192            ResponseItem::PublishRequestSchema(v) => v.into_mcp(),
193            ResponseItem::PublishResponseSchema(v) => v.into_mcp(),
194            ResponseItem::Queue(v) => v.into_mcp(),
195            ResponseItem::Spawn(v) => v.into_mcp(),
196            ResponseItem::SpawnRequestSchema(v) => v.into_mcp(),
197            ResponseItem::SpawnResponseSchema(v) => v.into_mcp(),
198            ResponseItem::Tags(v) => v.into_mcp(),
199            ResponseItem::Wait(v) => v.into_mcp(),
200            ResponseItem::WaitRequestSchema(v) => v.into_mcp(),
201            ResponseItem::WaitResponseSchema(v) => v.into_mcp(),
202        }
203    }
204}
205
206impl TryFrom<Command> for Request {
207    type Error = crate::cli::command::FromArgsError;
208    fn try_from(command: Command) -> Result<Self, Self::Error> {
209        match command {
210            Command::Enqueue(cmd) => match cmd.schema {
211                None => Ok(Request::Enqueue(enqueue::Request::try_from(cmd.args)?)),
212                Some(enqueue::Schema::RequestSchema(args)) =>
213                    Ok(Request::EnqueueRequestSchema(enqueue::request_schema::Request::try_from(args)?)),
214                Some(enqueue::Schema::ResponseSchema(args)) =>
215                    Ok(Request::EnqueueResponseSchema(enqueue::response_schema::Request::try_from(args)?)),
216            },
217            Command::Get(cmd) => match cmd.schema {
218                None => Ok(Request::Get(get::Request::try_from(cmd.args)?)),
219                Some(get::Schema::RequestSchema(args)) =>
220                    Ok(Request::GetRequestSchema(get::request_schema::Request::try_from(args)?)),
221                Some(get::Schema::ResponseSchema(args)) =>
222                    Ok(Request::GetResponseSchema(get::response_schema::Request::try_from(args)?)),
223            },
224            Command::Instances { command } =>
225                Ok(Request::Instances(instances::Request::try_from(command)?)),
226            Command::List(cmd) => match cmd.schema {
227                None => Ok(Request::List(list::Request::try_from(cmd.args)?)),
228                Some(list::Schema::RequestSchema(args)) =>
229                    Ok(Request::ListRequestSchema(list::request_schema::Request::try_from(args)?)),
230                Some(list::Schema::ResponseSchema(args)) =>
231                    Ok(Request::ListResponseSchema(list::response_schema::Request::try_from(args)?)),
232            },
233            Command::Logs { command } =>
234                Ok(Request::Logs(logs::Request::try_from(command)?)),
235            Command::Message(cmd) => match cmd.schema {
236                None => Ok(Request::Message(message::Request::try_from(cmd.args)?)),
237                Some(message::Schema::RequestSchema(args)) =>
238                    Ok(Request::MessageRequestSchema(message::request_schema::Request::try_from(args)?)),
239                Some(message::Schema::ResponseSchema(args)) =>
240                    Ok(Request::MessageResponseSchema(message::response_schema::Request::try_from(args)?)),
241            },
242            Command::Publish(cmd) => match cmd.schema {
243                None => Ok(Request::Publish(publish::Request::try_from(cmd.args)?)),
244                Some(publish::Schema::RequestSchema(args)) =>
245                    Ok(Request::PublishRequestSchema(publish::request_schema::Request::try_from(args)?)),
246                Some(publish::Schema::ResponseSchema(args)) =>
247                    Ok(Request::PublishResponseSchema(publish::response_schema::Request::try_from(args)?)),
248            },
249            Command::Queue { command } =>
250                Ok(Request::Queue(queue::Request::try_from(command)?)),
251            Command::Spawn(cmd) => match cmd.schema {
252                None => Ok(Request::Spawn(spawn::Request::try_from(cmd.args)?)),
253                Some(spawn::Schema::RequestSchema(args)) =>
254                    Ok(Request::SpawnRequestSchema(spawn::request_schema::Request::try_from(args)?)),
255                Some(spawn::Schema::ResponseSchema(args)) =>
256                    Ok(Request::SpawnResponseSchema(spawn::response_schema::Request::try_from(args)?)),
257            },
258            Command::Tags { command } =>
259                Ok(Request::Tags(tags::Request::try_from(command)?)),
260            Command::Wait(cmd) => match cmd.schema {
261                None => Ok(Request::Wait(wait::Request::try_from(cmd.args)?)),
262                Some(wait::Schema::RequestSchema(args)) =>
263                    Ok(Request::WaitRequestSchema(wait::request_schema::Request::try_from(args)?)),
264                Some(wait::Schema::ResponseSchema(args)) =>
265                    Ok(Request::WaitResponseSchema(wait::response_schema::Request::try_from(args)?)),
266            },
267        }
268    }
269}
270
271impl crate::cli::command::CommandRequest for Request {
272    fn request_base(&self) -> &crate::cli::command::RequestBase {
273        match self {
274            Request::Enqueue(inner) => inner.request_base(),
275            Request::EnqueueRequestSchema(inner) => inner.request_base(),
276            Request::EnqueueResponseSchema(inner) => inner.request_base(),
277            Request::Get(inner) => inner.request_base(),
278            Request::GetRequestSchema(inner) => inner.request_base(),
279            Request::GetResponseSchema(inner) => inner.request_base(),
280            Request::Instances(inner) => inner.request_base(),
281            Request::List(inner) => inner.request_base(),
282            Request::ListRequestSchema(inner) => inner.request_base(),
283            Request::ListResponseSchema(inner) => inner.request_base(),
284            Request::Logs(inner) => inner.request_base(),
285            Request::Message(inner) => inner.request_base(),
286            Request::MessageRequestSchema(inner) => inner.request_base(),
287            Request::MessageResponseSchema(inner) => inner.request_base(),
288            Request::Publish(inner) => inner.request_base(),
289            Request::PublishRequestSchema(inner) => inner.request_base(),
290            Request::PublishResponseSchema(inner) => inner.request_base(),
291            Request::Queue(inner) => inner.request_base(),
292            Request::Spawn(inner) => inner.request_base(),
293            Request::SpawnRequestSchema(inner) => inner.request_base(),
294            Request::SpawnResponseSchema(inner) => inner.request_base(),
295            Request::Tags(inner) => inner.request_base(),
296            Request::Wait(inner) => inner.request_base(),
297            Request::WaitRequestSchema(inner) => inner.request_base(),
298            Request::WaitResponseSchema(inner) => inner.request_base(),
299        }
300    }
301
302    fn request_base_mut(&mut self) -> Option<&mut crate::cli::command::RequestBase> {
303        match self {
304            Request::Enqueue(inner) => inner.request_base_mut(),
305            Request::EnqueueRequestSchema(inner) => inner.request_base_mut(),
306            Request::EnqueueResponseSchema(inner) => inner.request_base_mut(),
307            Request::Get(inner) => inner.request_base_mut(),
308            Request::GetRequestSchema(inner) => inner.request_base_mut(),
309            Request::GetResponseSchema(inner) => inner.request_base_mut(),
310            Request::Instances(inner) => inner.request_base_mut(),
311            Request::List(inner) => inner.request_base_mut(),
312            Request::ListRequestSchema(inner) => inner.request_base_mut(),
313            Request::ListResponseSchema(inner) => inner.request_base_mut(),
314            Request::Logs(inner) => inner.request_base_mut(),
315            Request::Message(inner) => inner.request_base_mut(),
316            Request::MessageRequestSchema(inner) => inner.request_base_mut(),
317            Request::MessageResponseSchema(inner) => inner.request_base_mut(),
318            Request::Publish(inner) => inner.request_base_mut(),
319            Request::PublishRequestSchema(inner) => inner.request_base_mut(),
320            Request::PublishResponseSchema(inner) => inner.request_base_mut(),
321            Request::Queue(inner) => inner.request_base_mut(),
322            Request::Spawn(inner) => inner.request_base_mut(),
323            Request::SpawnRequestSchema(inner) => inner.request_base_mut(),
324            Request::SpawnResponseSchema(inner) => inner.request_base_mut(),
325            Request::Tags(inner) => inner.request_base_mut(),
326            Request::Wait(inner) => inner.request_base_mut(),
327            Request::WaitRequestSchema(inner) => inner.request_base_mut(),
328            Request::WaitResponseSchema(inner) => inner.request_base_mut(),
329        }
330    }
331}
332
333#[cfg(feature = "cli-executor")]
334pub async fn execute<E: crate::cli::command::CommandExecutor>(
335    executor: &E,
336    request: Request,
337
338        agent_arguments: Option<&crate::cli::command::AgentArguments>,
339    ) -> Result<
340    std::pin::Pin<Box<dyn futures::Stream<Item = Result<ResponseItem, E::Error>> + Send>>,
341    E::Error,
342> {
343    use futures::StreamExt;
344    let stream: std::pin::Pin<Box<dyn futures::Stream<Item = Result<ResponseItem, E::Error>> + Send>> =
345        match request {
346            Request::Enqueue(req) => {
347                let value = enqueue::execute(executor, req, agent_arguments).await?;
348                Box::pin(crate::cli::command::StreamOnce::new(Ok(
349                    ResponseItem::Enqueue(value),
350                )))
351            }
352            Request::EnqueueRequestSchema(req) => {
353                let value = enqueue::request_schema::execute(executor, req, agent_arguments).await?;
354                Box::pin(crate::cli::command::StreamOnce::new(Ok(
355                    ResponseItem::EnqueueRequestSchema(value),
356                )))
357            }
358            Request::EnqueueResponseSchema(req) => {
359                let value = enqueue::response_schema::execute(executor, req, agent_arguments).await?;
360                Box::pin(crate::cli::command::StreamOnce::new(Ok(
361                    ResponseItem::EnqueueResponseSchema(value),
362                )))
363            }
364            Request::Get(req) => {
365                let value = get::execute(executor, req, agent_arguments).await?;
366                Box::pin(crate::cli::command::StreamOnce::new(Ok(
367                    ResponseItem::Get(value),
368                )))
369            }
370            Request::GetRequestSchema(req) => {
371                let value = get::request_schema::execute(executor, req, agent_arguments).await?;
372                Box::pin(crate::cli::command::StreamOnce::new(Ok(
373                    ResponseItem::GetRequestSchema(value),
374                )))
375            }
376            Request::GetResponseSchema(req) => {
377                let value = get::response_schema::execute(executor, req, agent_arguments).await?;
378                Box::pin(crate::cli::command::StreamOnce::new(Ok(
379                    ResponseItem::GetResponseSchema(value),
380                )))
381            }
382            Request::Instances(req) => {
383                let inner = instances::execute(executor, req, agent_arguments).await?;
384                Box::pin(inner.map(|r| r.map(ResponseItem::Instances)))
385            }
386            Request::List(req) => {
387                let inner = list::execute(executor, req, agent_arguments).await?;
388                Box::pin(inner.map(|r| r.map(ResponseItem::List)))
389            }
390            Request::ListRequestSchema(req) => {
391                let value = list::request_schema::execute(executor, req, agent_arguments).await?;
392                Box::pin(crate::cli::command::StreamOnce::new(Ok(
393                    ResponseItem::ListRequestSchema(value),
394                )))
395            }
396            Request::ListResponseSchema(req) => {
397                let value = list::response_schema::execute(executor, req, agent_arguments).await?;
398                Box::pin(crate::cli::command::StreamOnce::new(Ok(
399                    ResponseItem::ListResponseSchema(value),
400                )))
401            }
402            Request::Logs(req) => {
403                let inner = logs::execute(executor, req, agent_arguments).await?;
404                Box::pin(inner.map(|r| r.map(ResponseItem::Logs)))
405            }
406            Request::Message(req) => {
407                let value = message::execute(executor, req, agent_arguments).await?;
408                Box::pin(crate::cli::command::StreamOnce::new(Ok(
409                    ResponseItem::Message(value),
410                )))
411            }
412            Request::MessageRequestSchema(req) => {
413                let value = message::request_schema::execute(executor, req, agent_arguments).await?;
414                Box::pin(crate::cli::command::StreamOnce::new(Ok(
415                    ResponseItem::MessageRequestSchema(value),
416                )))
417            }
418            Request::MessageResponseSchema(req) => {
419                let value = message::response_schema::execute(executor, req, agent_arguments).await?;
420                Box::pin(crate::cli::command::StreamOnce::new(Ok(
421                    ResponseItem::MessageResponseSchema(value),
422                )))
423            }
424            Request::Publish(req) => {
425                let value = publish::execute(executor, req, agent_arguments).await?;
426                Box::pin(crate::cli::command::StreamOnce::new(Ok(
427                    ResponseItem::Publish(value),
428                )))
429            }
430            Request::PublishRequestSchema(req) => {
431                let value = publish::request_schema::execute(executor, req, agent_arguments).await?;
432                Box::pin(crate::cli::command::StreamOnce::new(Ok(
433                    ResponseItem::PublishRequestSchema(value),
434                )))
435            }
436            Request::PublishResponseSchema(req) => {
437                let value = publish::response_schema::execute(executor, req, agent_arguments).await?;
438                Box::pin(crate::cli::command::StreamOnce::new(Ok(
439                    ResponseItem::PublishResponseSchema(value),
440                )))
441            }
442            Request::Queue(req) => {
443                let inner = queue::execute(executor, req, agent_arguments).await?;
444                Box::pin(inner.map(|r| r.map(ResponseItem::Queue)))
445            }
446            Request::Spawn(req) => {
447                let want_streaming = req
448                    .dangerous_advanced
449                    .as_ref()
450                    .and_then(|a| a.stream)
451                    .unwrap_or(false);
452                if want_streaming {
453                    let inner = spawn::execute_streaming(executor, req, agent_arguments).await?;
454                    Box::pin(inner.map(|r| r.map(ResponseItem::Spawn)))
455                } else {
456                    let value = spawn::execute(executor, req, agent_arguments).await?;
457                    Box::pin(crate::cli::command::StreamOnce::new(Ok(
458                        ResponseItem::Spawn(spawn::ResponseItem::Id(value)),
459                    )))
460                }
461            }
462            Request::SpawnRequestSchema(req) => {
463                let value = spawn::request_schema::execute(executor, req, agent_arguments).await?;
464                Box::pin(crate::cli::command::StreamOnce::new(Ok(
465                    ResponseItem::SpawnRequestSchema(value),
466                )))
467            }
468            Request::SpawnResponseSchema(req) => {
469                let value = spawn::response_schema::execute(executor, req, agent_arguments).await?;
470                Box::pin(crate::cli::command::StreamOnce::new(Ok(
471                    ResponseItem::SpawnResponseSchema(value),
472                )))
473            }
474            Request::Tags(req) => {
475                let inner = tags::execute(executor, req, agent_arguments).await?;
476                Box::pin(inner.map(|r| r.map(ResponseItem::Tags)))
477            }
478            Request::Wait(req) => {
479                let value = wait::execute(executor, req, agent_arguments).await?;
480                Box::pin(crate::cli::command::StreamOnce::new(Ok(
481                    ResponseItem::Wait(value),
482                )))
483            }
484            Request::WaitRequestSchema(req) => {
485                let value = wait::request_schema::execute(executor, req, agent_arguments).await?;
486                Box::pin(crate::cli::command::StreamOnce::new(Ok(
487                    ResponseItem::WaitRequestSchema(value),
488                )))
489            }
490            Request::WaitResponseSchema(req) => {
491                let value = wait::response_schema::execute(executor, req, agent_arguments).await?;
492                Box::pin(crate::cli::command::StreamOnce::new(Ok(
493                    ResponseItem::WaitResponseSchema(value),
494                )))
495            }
496        };
497    Ok(stream)
498}
499
500#[cfg(feature = "cli-executor")]
501pub async fn execute_transform<E: crate::cli::command::CommandExecutor>(
502    executor: &E,
503    request: Request,
504    transform: crate::cli::command::Transform,
505
506        agent_arguments: Option<&crate::cli::command::AgentArguments>,
507    ) -> Result<
508    std::pin::Pin<Box<dyn futures::Stream<Item = Result<serde_json::Value, E::Error>> + Send>>,
509    E::Error,
510> {
511    let stream: std::pin::Pin<Box<dyn futures::Stream<Item = Result<serde_json::Value, E::Error>> + Send>> =
512        match request {
513            Request::Enqueue(req) => {
514                let value = enqueue::execute_transform(executor, req, transform, agent_arguments).await?;
515                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
516            }
517            Request::EnqueueRequestSchema(req) => {
518                let value =
519                    enqueue::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
520                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
521            }
522            Request::EnqueueResponseSchema(req) => {
523                let value =
524                    enqueue::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
525                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
526            }
527            Request::Get(req) => {
528                let value = get::execute_transform(executor, req, transform, agent_arguments).await?;
529                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
530            }
531            Request::GetRequestSchema(req) => {
532                let value = get::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
533                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
534            }
535            Request::GetResponseSchema(req) => {
536                let value = get::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
537                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
538            }
539            Request::Instances(req) => {
540                let inner = instances::execute_transform(executor, req, transform, agent_arguments).await?;
541                Box::pin(inner)
542            }
543            Request::List(req) => {
544                let inner = list::execute_transform(executor, req, transform, agent_arguments).await?;
545                Box::pin(inner)
546            }
547            Request::ListRequestSchema(req) => {
548                let value = list::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
549                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
550            }
551            Request::ListResponseSchema(req) => {
552                let value = list::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
553                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
554            }
555            Request::Logs(req) => {
556                let inner = logs::execute_transform(executor, req, transform, agent_arguments).await?;
557                Box::pin(inner)
558            }
559            Request::Message(req) => {
560                let value = message::execute_transform(executor, req, transform, agent_arguments).await?;
561                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
562            }
563            Request::MessageRequestSchema(req) => {
564                let value =
565                    message::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
566                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
567            }
568            Request::MessageResponseSchema(req) => {
569                let value =
570                    message::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
571                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
572            }
573            Request::Publish(req) => {
574                let value = publish::execute_transform(executor, req, transform, agent_arguments).await?;
575                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
576            }
577            Request::PublishRequestSchema(req) => {
578                let value = publish::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
579                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
580            }
581            Request::PublishResponseSchema(req) => {
582                let value = publish::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
583                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
584            }
585            Request::Queue(req) => {
586                let inner = queue::execute_transform(executor, req, transform, agent_arguments).await?;
587                Box::pin(inner)
588            }
589            Request::Spawn(req) => {
590                let want_streaming = req
591                    .dangerous_advanced
592                    .as_ref()
593                    .and_then(|a| a.stream)
594                    .unwrap_or(false);
595                if want_streaming {
596                    let inner = spawn::execute_streaming_transform(executor, req, transform, agent_arguments).await?;
597                    Box::pin(inner)
598                } else {
599                    let value = spawn::execute_transform(executor, req, transform, agent_arguments).await?;
600                    Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
601                }
602            }
603            Request::SpawnRequestSchema(req) => {
604                let value =
605                    spawn::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
606                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
607            }
608            Request::SpawnResponseSchema(req) => {
609                let value =
610                    spawn::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
611                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
612            }
613            Request::Tags(req) => {
614                let inner = tags::execute_transform(executor, req, transform, agent_arguments).await?;
615                Box::pin(inner)
616            }
617            Request::Wait(req) => {
618                let value = wait::execute_transform(executor, req, transform, agent_arguments).await?;
619                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
620            }
621            Request::WaitRequestSchema(req) => {
622                let value =
623                    wait::request_schema::execute_transform(executor, req, transform, agent_arguments).await?;
624                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
625            }
626            Request::WaitResponseSchema(req) => {
627                let value =
628                    wait::response_schema::execute_transform(executor, req, transform, agent_arguments).await?;
629                Box::pin(crate::cli::command::StreamOnce::new(Ok(value)))
630            }
631        };
632    Ok(stream)
633}