Skip to main content

CoreClient

Struct CoreClient 

Source
pub struct CoreClient<T> { /* private fields */ }
Expand description

The sealed read surface, bound to one transport.

Implementations§

Source§

impl<T> CoreClient<T>

Source

pub fn new(transport: T) -> Self

Bind the sealed surface to a transport.

Source

pub fn transport(&self) -> &T

The transport this surface calls through.

Source

pub fn into_transport(self) -> T

Take the transport back.

Source§

impl<T: TapesTransport> CoreClient<T>

Source

pub async fn call<R: DeserializeOwned>( &self, operation_id: &str, values: Vec<(&str, String)>, ) -> Result<R>

Resolve one operation in the sealed contract and call it, decoding into a type the caller names.

The escape hatch — see the module docs. Equivalent to CoreClient::call_with_body with no body, which is what every read operation wants. An operation whose requestBody the contract marks required is refused rather than sent without one.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn call_with_body<R: DeserializeOwned>( &self, operation_id: &str, values: Vec<(&str, String)>, body: Option<String>, ) -> Result<R>

Resolve one operation and call it with a request body.

The body travels the same route as every other value: the contract decides whether the operation accepts one, requires one, or takes none, and a disagreement in either direction is refused before anything is sent. Without this the capability would exist one layer down and be unreachable from the facade callers actually use — which is exactly where a payload goes missing quietly.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub fn request_for( &self, operation_id: &str, values: Vec<(&str, String)>, ) -> Result<WireRequest<'static>>

Build the request for one operation without sending it.

For a caller that needs to inspect or decorate a request — a page walk setting cursors, a test asserting a URL — without a second route to the wire that could route values differently.

§Errors

Any contract failure; see crate::Error.

Source

pub async fn list_sessions( &self, params: &SessionListParams, ) -> Result<SessionListResponse>

GET /v1/sessions — one page of the sessions listing.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_all_sessions( &self, params: &SessionListParams, ) -> Result<Vec<SessionItem>>

Every session the listing matches, following next_cursor to the end.

The cursor convention is crate::page’s, so this walk and a cassette listing’s stop on the same three spellings of “no more pages” and share the guard against a server that repeats a cursor.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_session(&self, id: &str) -> Result<SessionDetailResponse>

GET /v1/sessions/{id} — one session record.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn update_session( &self, id: &str, body: &SessionUpdateRequest, ) -> Result<SessionDetailResponse>

PATCH /v1/sessions/{id} — rename a session.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn delete_session(&self, id: &str) -> Result<()>

DELETE /v1/sessions/{id} — delete a session and its subtree.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_session_traces( &self, id: &str, params: &SessionTracesParams, ) -> Result<SessionTracesResponse>

GET /v1/sessions/{id}/traces — the derived span read model.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_raw_turns(&self, id: &str) -> Result<RawTurnListResponse>

GET /v1/sessions/{id}/raw_turns — the wire log behind a derivation.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_session_skills( &self, id: &str, ) -> Result<SessionSkillsResponse>

GET /v1/sessions/{id}/skills — the skills attributed to one session.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_traces( &self, params: &TraceListParams, ) -> Result<TraceListResponse>

GET /v1/traces — the trace summaries for one session.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_trace( &self, trace_id: &str, params: &TraceParams, ) -> Result<TraceDetail>

GET /v1/traces/{trace_id} — one trace with its spans.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_span(&self, trace_id: &str, span_id: &str) -> Result<SpanItem>

GET /v1/traces/{trace_id}/spans/{span_id} — one span, in full.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn search_spans( &self, params: &SearchSpansParams, ) -> Result<SpanSearchOutput>

GET /v1/search/spans — semantic search over span embeddings.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_stats(&self, params: &StatsParams) -> Result<StatsResponse>

GET /v1/stats — the aggregate rollups.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_skills( &self, params: &SkillsListParams, ) -> Result<SkillsListResponse>

GET /v1/skills — one page of the skills listing.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_all_skills( &self, params: &SkillsListParams, ) -> Result<Vec<SkillResponse>>

Every skill the listing matches, following next_cursor to the end.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn get_skill(&self, id: &str) -> Result<SkillResponse>

GET /v1/skills/{id} — one skill.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn create_skill( &self, body: &CreateSkillRequest, ) -> Result<SkillResponse>

POST /v1/skills — author a skill.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn update_skill( &self, id: &str, body: &UpdateSkillRequest, ) -> Result<SkillResponse>

PUT /v1/skills/{id} — apply the present fields onto a skill.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn delete_skill(&self, id: &str) -> Result<()>

DELETE /v1/skills/{id} — delete a skill.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn duplicate_skill(&self, id: &str) -> Result<SkillResponse>

POST /v1/skills/{id}/duplicate — fork a skill.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_skill_versions( &self, id: &str, ) -> Result<SkillVersionsResponse>

GET /v1/skills/{id}/versions — one skill’s published history.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn publish_skill( &self, id: &str, body: &PublishSkillRequest, ) -> Result<SkillVersionResponse>

POST /v1/skills/{id}/versions — publish an immutable snapshot.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn generate_skill( &self, body: &GenerateSkillRequest, ) -> Result<SkillResponse>

POST /v1/skills/generate — generate a skill from sessions.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn list_cassettes(&self) -> Result<Discovery>

GET /v1/cassettes — what this deployment serves.

Decodes into the cassette surface’s own model rather than a second copy of it: crate::cassettes::discovery reads the fields the generated command surface acts on, and modelling the document twice is the duplication this crate exists to end.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source

pub async fn seed_demo(&self, body: &SeedDemoRequest) -> Result<SeedResult>

POST /v1/admin/seed/demo — replay the demo corpora.

§Errors

Any contract, transport, status, or decode failure; see crate::Error.

Source§

impl<T: StreamingTransport> CoreClient<T>

Source

pub async fn stream( &self, operation_id: &str, values: Vec<(&str, String)>, ) -> Result<T::Body>

Resolve one operation and stream its response.

Bodyless, and deliberately so: nothing in this contract both streams a response and takes a request body. That is an observation about the document rather than a rule, so it is not enforced here — an operation that did take a required body would be refused with the same loud error as anywhere else, which is a signal to add the body-bearing sibling rather than a payload going missing.

§Errors

Any contract or transport failure; see crate::Error.

Source

pub async fn export_session( &self, id: &str, params: &ExportSessionParams, ) -> Result<T::Body>

GET /v1/sessions/{id}/export, streamed.

An export can be far larger than a session’s working set, and there is no reason to hold it in memory on the way to a file. It stays untyped for the same reason: an archive written through a typed decode is an archive of the fields this build happened to know about.

§Errors

Any contract or transport failure; see crate::Error.

Source

pub async fn export_sessions( &self, params: &ExportSessionsParams, ) -> Result<T::Body>

GET /v1/sessions/export, streamed.

§Errors

Any contract or transport failure; see crate::Error.

Trait Implementations§

Source§

impl<T: Clone> Clone for CoreClient<T>

Source§

fn clone(&self) -> CoreClient<T>

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
Source§

impl<T: Copy> Copy for CoreClient<T>

Source§

impl<T: Debug> Debug for CoreClient<T>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<T> Freeze for CoreClient<T>
where T: Freeze,

§

impl<T> RefUnwindSafe for CoreClient<T>
where T: RefUnwindSafe,

§

impl<T> Send for CoreClient<T>
where T: Send,

§

impl<T> Sync for CoreClient<T>
where T: Sync,

§

impl<T> Unpin for CoreClient<T>
where T: Unpin,

§

impl<T> UnsafeUnpin for CoreClient<T>
where T: UnsafeUnpin,

§

impl<T> UnwindSafe for CoreClient<T>
where T: UnwindSafe,

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<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> 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> 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> 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<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