Skip to main content

Crate polyc_rpc_client

Crate polyc_rpc_client 

Source
Expand description

Thin connectrpc client over the generated polyc_proto::proto::polychrome::agent::v1::AgentServiceClient.

Both the operator CLI (polychrome send) and the reference-edge receiver dial the external-facing AgentService with the same Connect-streaming dance: build a connect-rust client, send one AgentRequest, drain the AgentResponse stream, and render each non-empty content block to user-visible text. This crate is the single home for that logic so the two call sites can’t drift.

RPC-client concerns deliberately live here rather than in polyc-agent (the turn-loop crate, the wrong layer for a transport client).

For v1 the whole turn is collected into a single string and returned at end-of-turn; incremental streaming (e.g. Slack chat.appendStream) is a follow-up that can build on the same client.

Re-exports§

pub use edge::EdgeAdapter;
pub use edge::build_attribution;

Modules§

edge
The edge/adapter contract.

Structs§

AgentDialer
Reusable handle for dialing the polychrome control plane.
ApprovalDialer
Reusable handle for the control plane’s ApprovalService.
ApprovalOutcome
The persisted outcome of an ApprovalService.Respond call.
Attribution
Caller attribution for one turn.
ExternalIdentity
The external identity of a human observed at an edge (re-exported wire type, shared with the persona store records): the per-edge EdgeAdapter mapping produces these and the control plane resolves them to durable personas.
GateMessage
The attributed transcript line type the participation gate consumes. Re-exported so callers build requests without importing polyc-proto.
LinkedIdentity
One external identity linked to a persona, as the dashboard renders it (provider · display name · id).
PaymentReceipt
A settled inbound payment receipt, re-exported so the public-edge layer can thread it into AgentDialer::run_turn_streaming_messages_with without depending on polyc-proto directly.
PersonaDialer
Reusable handle for the control plane’s PersonaService.
PersonaView
An edge-friendly read of a persona, for surfaces like the App Home dashboard. Every field is empty when the queried identity is not in the directory (a not-yet-claimed user).
StartedDeepLink
A freshly minted deep-link token: the opaque value an edge embeds in a platform URL for a no-typing ceremony, plus its absolute expiry.
StartedLink
A freshly minted link-ceremony challenge: the code an edge must deliver privately to the requesting user, plus its absolute expiry.
TurnMessage
A turn-input message, re-exported so callers can build attributed multi-party input for AgentDialer::run_turn_streaming_messages without depending on polyc-proto.

Enums§

DialError
Errors an agent dial can produce.
LinkCeremony
The outcome of completing a link ceremony, in edge-renderable terms.
TurnEvent
Incremental event emitted while a turn streams from the control plane.

Functions§

attributed_message
Build an attributed user-role turn message rendered as "<speaker>: text", so the model sees who said what in a multi-party thread.
framed_conversation_id
Collision-free variant of hashed_conversation_id for edges whose native parts can themselves contain ':' (e.g. an email Message-ID, a URL, a path).
hashed_conversation_id
Derive a stable, fixed-length conversation id by hashing parts into a UUIDv5 under a pinned namespace.
namespaced_id
Build the documented readable namespaced conversation id, "{namespace}:{native_id}".
user_message
Build a plain user-role turn message (no speaker attribution) — used for 1:1 DMs where there is only one human in the conversation.