pub struct CoreClient<T> { /* private fields */ }Expand description
The sealed read surface, bound to one transport.
Implementations§
Source§impl<T> CoreClient<T>
impl<T> CoreClient<T>
Source§impl<T: TapesTransport> CoreClient<T>
impl<T: TapesTransport> CoreClient<T>
Sourcepub async fn call<R: DeserializeOwned>(
&self,
operation_id: &str,
values: Vec<(&str, String)>,
) -> Result<R>
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.
Sourcepub async fn call_with_body<R: DeserializeOwned>(
&self,
operation_id: &str,
values: Vec<(&str, String)>,
body: Option<String>,
) -> Result<R>
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.
Sourcepub fn request_for(
&self,
operation_id: &str,
values: Vec<(&str, String)>,
) -> Result<WireRequest<'static>>
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.
Sourcepub async fn list_sessions(
&self,
params: &SessionListParams,
) -> Result<SessionListResponse>
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.
Sourcepub async fn list_all_sessions(
&self,
params: &SessionListParams,
) -> Result<Vec<SessionItem>>
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.
Sourcepub async fn get_session(&self, id: &str) -> Result<SessionDetailResponse>
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.
Sourcepub async fn update_session(
&self,
id: &str,
body: &SessionUpdateRequest,
) -> Result<SessionDetailResponse>
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.
Sourcepub async fn delete_session(&self, id: &str) -> Result<()>
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.
Sourcepub async fn get_session_traces(
&self,
id: &str,
params: &SessionTracesParams,
) -> Result<SessionTracesResponse>
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.
Sourcepub async fn list_raw_turns(&self, id: &str) -> Result<RawTurnListResponse>
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.
Sourcepub async fn list_session_skills(
&self,
id: &str,
) -> Result<SessionSkillsResponse>
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.
Sourcepub async fn list_traces(
&self,
params: &TraceListParams,
) -> Result<TraceListResponse>
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.
Sourcepub async fn get_trace(
&self,
trace_id: &str,
params: &TraceParams,
) -> Result<TraceDetail>
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.
Sourcepub async fn get_span(&self, trace_id: &str, span_id: &str) -> Result<SpanItem>
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.
Sourcepub async fn search_spans(
&self,
params: &SearchSpansParams,
) -> Result<SpanSearchOutput>
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.
Sourcepub async fn get_stats(&self, params: &StatsParams) -> Result<StatsResponse>
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.
Sourcepub async fn list_skills(
&self,
params: &SkillsListParams,
) -> Result<SkillsListResponse>
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.
Sourcepub async fn list_all_skills(
&self,
params: &SkillsListParams,
) -> Result<Vec<SkillResponse>>
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.
Sourcepub async fn get_skill(&self, id: &str) -> Result<SkillResponse>
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.
Sourcepub async fn create_skill(
&self,
body: &CreateSkillRequest,
) -> Result<SkillResponse>
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.
Sourcepub async fn update_skill(
&self,
id: &str,
body: &UpdateSkillRequest,
) -> Result<SkillResponse>
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.
Sourcepub async fn delete_skill(&self, id: &str) -> Result<()>
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.
Sourcepub async fn duplicate_skill(&self, id: &str) -> Result<SkillResponse>
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.
Sourcepub async fn list_skill_versions(
&self,
id: &str,
) -> Result<SkillVersionsResponse>
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.
Sourcepub async fn publish_skill(
&self,
id: &str,
body: &PublishSkillRequest,
) -> Result<SkillVersionResponse>
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.
Sourcepub async fn generate_skill(
&self,
body: &GenerateSkillRequest,
) -> Result<SkillResponse>
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.
Sourcepub async fn list_cassettes(&self) -> Result<Discovery>
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.
Sourcepub async fn seed_demo(&self, body: &SeedDemoRequest) -> Result<SeedResult>
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>
impl<T: StreamingTransport> CoreClient<T>
Sourcepub async fn stream(
&self,
operation_id: &str,
values: Vec<(&str, String)>,
) -> Result<T::Body>
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.
Sourcepub async fn export_session(
&self,
id: &str,
params: &ExportSessionParams,
) -> Result<T::Body>
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.
Sourcepub async fn export_sessions(
&self,
params: &ExportSessionsParams,
) -> Result<T::Body>
pub async fn export_sessions( &self, params: &ExportSessionsParams, ) -> Result<T::Body>
Trait Implementations§
Source§impl<T: Clone> Clone for CoreClient<T>
impl<T: Clone> Clone for CoreClient<T>
Source§fn clone(&self) -> CoreClient<T>
fn clone(&self) -> CoreClient<T>
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more