pub struct AcpController {
tab_id: String,
block_id: String,
inner: Arc<Mutex<AcpInner>>,
broker: Option<Arc<Broker>>,
event_bus: Option<Arc<EventBus>>,
wstore: Option<Arc<WaveStore>>,
filestore: Option<Arc<FileStore>>,
health_monitor: Arc<HealthMonitor>,
next_rpc_id: Arc<AtomicU64>,
}Expand description
AcpController manages an ACP-speaking agent process.
Fields§
§tab_id: String§block_id: String§inner: Arc<Mutex<AcpInner>>§broker: Option<Arc<Broker>>§event_bus: Option<Arc<EventBus>>§wstore: Option<Arc<WaveStore>>§filestore: Option<Arc<FileStore>>§health_monitor: Arc<HealthMonitor>§next_rpc_id: Arc<AtomicU64>Monotonically increasing JSON-RPC request ID.
Implementations§
Source§impl AcpController
impl AcpController
pub fn new( tab_id: String, block_id: String, broker: Option<Arc<Broker>>, event_bus: Option<Arc<EventBus>>, wstore: Option<Arc<WaveStore>>, filestore: Option<Arc<FileStore>>, ) -> Self
fn next_id(&self) -> u64
fn set_status(inner: &mut AcpInner, status: &str)
fn get_status_snapshot(&self) -> BlockControllerRuntimeStatus
fn publish_status(&self)
fn is_running(&self) -> bool
Sourcefn make_request(&self, method: &str, params: Value) -> String
fn make_request(&self, method: &str, params: Value) -> String
Build a JSON-RPC 2.0 request.
Sourcefn make_notification(&self, method: &str, params: Value) -> String
fn make_notification(&self, method: &str, params: Value) -> String
Build a JSON-RPC 2.0 notification (no id field).
Sourcepub fn send_message(
&self,
message: String,
cli_command: String,
cli_args: Vec<String>,
working_dir: String,
env_vars: HashMap<String, String>,
) -> Result<(), String>
pub fn send_message( &self, message: String, cli_command: String, cli_args: Vec<String>, working_dir: String, env_vars: HashMap<String, String>, ) -> Result<(), String>
Send a user message via ACP session/prompt.
If the process isn’t spawned yet, spawns it first (the first prompt is
deferred until the session is established — see pending_prompt).
Trait Implementations§
Source§impl Controller for AcpController
impl Controller for AcpController
Source§fn start(
&self,
block_meta: HashMap<String, Value>,
_rt_opts: Option<Value>,
_force: bool,
) -> Result<(), String>
fn start( &self, block_meta: HashMap<String, Value>, _rt_opts: Option<Value>, _force: bool, ) -> Result<(), String>
Start the controller. May spawn background tasks.
force restarts even if already running.Source§fn stop(&self, _graceful: bool, _new_status: &str) -> Result<(), String>
fn stop(&self, _graceful: bool, _new_status: &str) -> Result<(), String>
Stop the controller.
graceful waits for process to exit; new_status is the target state.Source§fn get_runtime_status(&self) -> BlockControllerRuntimeStatus
fn get_runtime_status(&self) -> BlockControllerRuntimeStatus
Get the current runtime status.
Source§fn send_input(
&self,
input: BlockInputUnion,
_seq: Option<u64>,
) -> Result<(), String>
fn send_input( &self, input: BlockInputUnion, _seq: Option<u64>, ) -> Result<(), String>
Send input (terminal data, signal, or resize) to the controller.
seq is the per-TermViewModel monotonic counter; None means fire-and-forget (no ordering).Source§fn controller_type(&self) -> &str
fn controller_type(&self) -> &str
Get the controller type (e.g., “shell”, “cmd”).
Auto Trait Implementations§
impl Freeze for AcpController
impl RefUnwindSafe for AcpController
impl Send for AcpController
impl Sync for AcpController
impl Unpin for AcpController
impl UnwindSafe for AcpController
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.