pub struct CalibandClient { /* private fields */ }Expand description
A client bound to one caliband control endpoint (Unix, or TCP+TLS+token).
Implementations§
Source§impl CalibandClient
impl CalibandClient
Sourcepub fn new(socket_path: impl Into<PathBuf>) -> Self
pub fn new(socket_path: impl Into<PathBuf>) -> Self
Create a client for a local Unix control socket (credential-free default).
Sourcepub fn connect_tcp(
addr: impl Into<String>,
tls: Option<TlsClient>,
token: Option<String>,
) -> Self
pub fn connect_tcp( addr: impl Into<String>, tls: Option<TlsClient>, token: Option<String>, ) -> Self
Create a client that dials a TCP control endpoint over TLS + bearer token
(ADR 0051). tls/token are None only in plaintext/no-auth test setups.
Sourcepub async fn request(&self, req: &CtlRequest) -> Result<CtlReply>
pub async fn request(&self, req: &CtlRequest) -> Result<CtlReply>
Send one request and return the raw reply, surfacing Error replies as
typed CoreErrors.
Sourcepub async fn list(&self) -> Result<Vec<AgentRecord>>
pub async fn list(&self) -> Result<Vec<AgentRecord>>
List all agents registered with this daemon.
Sourcepub async fn spawn(&self, spec: SpawnSpec) -> Result<(String, Endpoint)>
pub async fn spawn(&self, spec: SpawnSpec) -> Result<(String, Endpoint)>
Spawn a new agent; returns (id, per-agent endpoint).
Sourcepub async fn attach(&self, id: impl Into<String>) -> Result<Endpoint>
pub async fn attach(&self, id: impl Into<String>) -> Result<Endpoint>
Resolve an agent’s per-agent endpoint for attaching.
Sourcepub async fn respawn(&self, id: impl Into<String>) -> Result<String>
pub async fn respawn(&self, id: impl Into<String>) -> Result<String>
Respawn an agent; returns the new id.
Sourcepub async fn rm(&self, id: impl Into<String>, force: bool) -> Result<()>
pub async fn rm(&self, id: impl Into<String>, force: bool) -> Result<()>
Remove an agent from the registry.
Sourcepub async fn status(&self) -> Result<DaemonStatus>
pub async fn status(&self) -> Result<DaemonStatus>
Probe daemon status.
Sourcepub async fn open_stream(
&self,
endpoint: &Endpoint,
) -> Result<BufReader<BoxConn>>
pub async fn open_stream( &self, endpoint: &Endpoint, ) -> Result<BufReader<BoxConn>>
Open a streaming reader over a per-agent endpoint (from Self::attach),
dialing with this client’s TLS/token. Lines read from this reader are
caliban stream-json frames.
Sourcepub async fn send_inbound(
&self,
endpoint: &Endpoint,
frame: &AttachInbound,
) -> Result<()>
pub async fn send_inbound( &self, endpoint: &Endpoint, frame: &AttachInbound, ) -> Result<()>
Write a single inbound control frame to an interactive agent’s per-agent
endpoint (from Self::attach). Opens a fresh write-only connection,
matching caliban’s “all attach connections feed a shared inbox” model.
Trait Implementations§
Source§impl Clone for CalibandClient
impl Clone for CalibandClient
Source§fn clone(&self) -> CalibandClient
fn clone(&self) -> CalibandClient
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for CalibandClient
impl !RefUnwindSafe for CalibandClient
impl Send for CalibandClient
impl Sync for CalibandClient
impl Unpin for CalibandClient
impl UnsafeUnpin for CalibandClient
impl !UnwindSafe for CalibandClient
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more