Skip to main content

zeph_core/agent/
orchestration_commands.rs

1// SPDX-FileCopyrightText: 2026 Andrei G <bug-ops>
2// SPDX-License-Identifier: MIT OR Apache-2.0
3
4//! [`zeph_commands::OrchestrationAccess`] implementation for [`Agent<C>`]: `/plan` and
5//! `/experiment`.
6//!
7//! [`Agent<C>`]: super::Agent
8
9use std::future::Future;
10use std::pin::Pin;
11
12use zeph_commands::{CommandError, OrchestrationAccess};
13
14use super::Agent;
15use super::command_macros::delegate_cmd;
16use crate::channel::Channel;
17
18impl<C: Channel + Send + 'static> OrchestrationAccess for Agent<C> {
19    // ----- /plan -----
20
21    #[cfg(feature = "scheduler")]
22    delegate_cmd!(handle_plan, dispatch_plan_command_as_string, input: &'a str => String);
23
24    #[cfg(not(feature = "scheduler"))]
25    fn handle_plan<'a>(
26        &'a mut self,
27        _input: &'a str,
28    ) -> Pin<Box<dyn Future<Output = Result<String, CommandError>> + Send + 'a>> {
29        Box::pin(async move { Ok(String::new()) })
30    }
31
32    // ----- /experiment -----
33
34    delegate_cmd!(handle_experiment, handle_experiment_command_as_string, input: &'a str => String);
35}