Skip to main content

Client

Struct Client 

Source
pub struct Client {
    pub auth: AuthClient,
    pub core: CoreClient,
    /* private fields */
}

Fields§

§auth: AuthClient§core: CoreClient

Implementations§

Source§

impl Client

Source

pub fn new(config: ClientConfig) -> Result<Self>

Source

pub fn advanced(&self) -> &AdvancedClient

Raw low-level control-plane surface. Every operation takes a free-form serializable payload and returns raw JSON — the same ops that used to be flattened onto Client directly (those flat delegates are now deprecated in favour of this namespace). The ~24 typed helpers (remember, recall, handoff, …) stay on Client.

Source

pub fn set_api_key(&self, api_key: Option<String>)

Source

pub fn set_token(&self, token: Option<String>)

Source

pub fn set_run_id(&self, run_id: Option<String>)

Source

pub fn set_transport(&self, transport: TransportMode)

Source

pub fn run_scope(&self, run_id: impl Into<String>) -> RunScope

Run-scope sugar: set the client’s ambient run id (the same mechanism that auto-injects run_id into every operation with a run_id field) and restore the previous run id when the returned RunScope guard drops. For explicit reflection at the end of the scope, call RunScope::end_with_reflect instead of letting the guard drop (no async work happens in Drop).

{
    let _scope = client.run_scope("ticket-4711");
    client.remember(RememberBuilder::new("...").build()).await?;
} // previous run id restored here
Source§

impl Client

Source

pub async fn remember(&self, options: RememberOptions) -> Result<Value>

Source

pub async fn recall(&self, options: RecallOptions) -> Result<Value>

Source

pub async fn get_context(&self, options: GetContextOptions) -> Result<Value>

Source

pub async fn archive(&self, options: ArchiveOptions) -> Result<Value>

Source

pub async fn archive_block(&self, options: ArchiveOptions) -> Result<Value>

Source

pub async fn dereference(&self, options: DereferenceOptions) -> Result<Value>

Source

pub async fn memory_health(&self, options: MemoryHealthOptions) -> Result<Value>

Source

pub async fn diagnose(&self, options: DiagnoseOptions) -> Result<Value>

Source

pub async fn reflect(&self, options: ReflectOptions) -> Result<Value>

Source

pub async fn forget(&self, options: ForgetOptions) -> Result<Value>

Source

pub async fn checkpoint(&self, options: CheckpointOptions) -> Result<Value>

Source

pub async fn register_agent( &self, options: RegisterAgentOptions, ) -> Result<Value>

Source

pub async fn list_agents(&self, options: ListAgentsOptions) -> Result<Value>

Source

pub async fn record_outcome( &self, options: RecordOutcomeOptions, ) -> Result<Value>

Source

pub async fn learned(&self, options: LearnedOptions) -> Result<Value>

Source

pub async fn optimize_prompt( &self, options: OptimizePromptOptions, ) -> Result<Value>

Phase 2.4: generate a challenger prompt version from accumulated lessons and outcome stats. The server never auto-activates unless auto_activate=true explicitly; by default the challenger surfaces via the champion/challenger evaluator (Phase 1.1) with ready_for_promotion=true once it outperforms the active version.

Source

pub async fn optimize_skill( &self, options: OptimizeSkillOptions, ) -> Result<Value>

Phase 2.4: skill-version analogue of optimize_prompt.

Source

pub async fn circuit_break(&self, options: CircuitBreakOptions) -> Result<Value>

Phase 1.5: atomic anti-loop reset. Snapshots working memory to LTM as a loop_detected lesson, clears working memory, resets the drift monitor state, and emits a CIRCUIT_BROKEN event. Customers should invoke this after observing signals.repeated == true (or stagnant / drifting) on a recall response.

Source

pub async fn record_step_outcome( &self, options: RecordStepOutcomeOptions, ) -> Result<Value>

Source

pub async fn surface_strategies( &self, options: SurfaceStrategiesOptions, ) -> Result<Value>

Source

pub async fn handoff(&self, options: HandoffOptions) -> Result<Value>

Hand a task off to another agent.

With await_verdict = true, polls (2s interval) for a feedback entry referencing the new handoff_id and returns the verdict (“approve” | “request_changes” | “block” | “acknowledge”) as Value::String — or Value::Null when timeout_s (default 30) elapses without a verdict. Without it, returns the handoff response as before.

Source

pub async fn receive_handoffs( &self, options: ReceiveHandoffsOptions, ) -> Result<Vec<ReceivedHandoff>>

Receiver-side handoff inbox.

Implemented client-side over query with entry_types = ["handoff"] (evidence only, no LLM synthesis) and filtered to evidence whose metadata addresses to_agent_id == agent_id. Each match is returned as a ReceivedHandoff wrapper around the raw evidence item.

Source

pub async fn feedback(&self, options: FeedbackOptions) -> Result<Value>

Source§

impl Client

Source

pub async fn agent_heartbeat<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn context_snapshot<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn ingest<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn batch_insert<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_ingest_job<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_run_ingest_stats<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn query<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn delete_run<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn lessons<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn delete_lesson<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn context<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn create_handoff<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn submit_feedback<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn create_session<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_session<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn close_session<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn set_prompt<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_prompt<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_prompt_versions<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn activate_prompt_version<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_prompt_diff<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn create_project<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_project<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_projects<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn update_project<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn delete_project<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn create_agent_definition<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_agent_definition<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_agent_definitions<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn update_agent_definition<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn delete_agent_definition<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_run_history<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_run_history<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn create_skill<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_skill<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_skills<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn update_skill<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn delete_skill<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn list_skill_versions<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn activate_skill_version<T: Serialize>( &self, payload: T, ) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source

pub async fn get_skill_diff<T: Serialize>(&self, payload: T) -> Result<Value>

👎Deprecated since 0.12.0:

raw control ops moved to client.advanced().<op>(payload) — the flat Client delegate will be removed in a future major release

Source§

impl Client

Source

pub async fn subscribe<T: Serialize>(&self, payload: T) -> Result<ValueStream>

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoRequest<T> for T

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more