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 durable-receive dance: send one AgentRequest, obtain its receipt, then drain the attached 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).

Buffered and incremental response projections build on the same receipt and attachment client.

Re-exports§

pub use edge::ClaimedNamespace;
pub use edge::ClaimedNamespaceError;
pub use edge::EdgeAdapter;
pub use edge::IngressDirective;
pub use edge::IngressIdentity;
pub use edge::IngressIdentityError;
pub use edge::MAX_CLAIMED_NAMESPACE_BYTES;
pub use edge::build_attribution;
pub use edge_credentials::CredentialError;
pub use edge_credentials::EdgeCredentials;
pub use edge_credentials::EdgeCredentialsError;
pub use edge_credentials::edge_credentials_from_env_or_fail;

Modules§

edge
The edge/adapter contract.
edge_credentials
Per-edge transport and provenance credentials for crate::AgentDialer.

Structs§

AddedCredentialKey
What CredentialDialer::add_credential_key did.
AgentDialer
Reusable handle for dialing the polychrome control plane.
AgentTaskOwnership
Exact State-issued ownership for one task dispatch.
AgentTaskPage
One page of a context’s tasks, as TaskDialer::list_tasks read it back.
AgentTaskRecord
One durable task, as TaskDialer read it back.
AgentTaskTransition
The successor a TaskDialer::transition_task call asks for.
ApprovalDialer
Reusable handle for the control plane’s ApprovalService.
ApprovalOutcome
The persisted outcome of an ApprovalService.Respond call.
ApprovalPreview
The approval card’s spec-computed preview (#1496).
ApprovalPreviewFire
One fire instant rendered for a human in ApprovalPreview: the same real instant twice, RFC3339 in ApprovalPreview::zone_name and in UTC.
Attribution
Caller attribution for one turn.
BufferedTurn
The buffered result of one turn: the aggregated reply text plus any PendingApprovalPrompts the turn paused on.
ConnectError
The Connect transport error DialError::Connect wraps, re-exported for the same reason ErrorCode is: an edge that maps a dial failure onto its own surface’s error taxonomy needs to name the type it is mapping from. A ConnectRPC error.
CredentialDialer
Reusable handle for the control plane’s CredentialService — the admin-gated live enrollment, rotation, and revocation surface over State’s credential authority.
CredentialEnrollment
One idempotent credential-enrollment operation.
CredentialKeySummary
One credential key’s operator-visible summary — the buffered analog of the wire CredentialKeySummary. Carries no salt, digest, or public key: the control plane never sends one (INV-C3).
CredentialRecordSummary
One stored credential’s operator-visible summary — the buffered analog of the wire CredentialSummary.
CredentialSummaryPage
One bounded page from credential lifecycle administration.
CredentialVerifier
The verifier half of one credential key, as an operator authors it.
DecideResult
An operator decision’s result: the DecideOutcome plus the control plane’s human-readable detail (the reject reason when rejected).
DurablyReceivedTurn
Proof that State durably received one TurnIngress.
EnrolledCredential
What CredentialDialer::enroll_credential did.
ExcisionOutcome
Result of an ApprovalDialer::excise_taint call.
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.
FiredRoutine
The result of RoutineDialer::fire_routine: the occurrence the firing used.
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).
NotificationDialer
Reusable handle for the control plane’s NotificationService — the pending-notification projection an edge drains to deliver operator DMs.
OperatorMailboxDialer
Reusable handle for the control plane’s OperatorMailboxService — the operator decision endpoint (authorize → evaluate → sign → record → executor, all server-side).
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.
PendingApproval
One outstanding approval returned by ApprovalDialer::list_pending.
PendingApprovalPrompt
One gated tool call a buffered turn paused on, surfaced from the terminal AgentEnd.pending_approvals — the buffered-API mirror of TurnEvent::ApprovalPending’s fields.
PendingNotice
One undelivered (item, target) pair an edge must DM, in edge-friendly terms.
PendingQuestionPrompt
One question a buffered turn paused on (#1660).
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).
QuestionDialer
Reusable handle for the control plane’s QuestionService (#1660).
QuestionOptionPrompt
One option a pending question offers, mirroring the wire QuestionOption/QuestionOptionEntry messages (#1660).
QuestionOutcome
Outcome of a QuestionDialer::respond call — the question-pause SIBLING of ApprovalOutcome.
RecordedApprovalRecovery
A decision durably recorded but not yet consumed by tool execution.
RecoverableApproval
One durable approval occurrence that needs a resume turn.
ReplayReport
The whole-conversation replay report a conversation replay command renders.
ReplayTurnVerdict
One turn’s replay verdict, as ApprovalDialer::replay_conversation returns it.
RetiredCredentialKey
What CredentialDialer::retire_credential_key did.
RevokedCredential
What CredentialDialer::revoke_credential did.
RoutineDialer
Reusable handle for the control plane’s RoutineService — the manual-fire dev-path affordance (#1369).
Sensitive
Re-exported so the thin edges (slack/telegram/discord/email/trigger/a2a) can wrap their two secret config fields (the transport bearer, the ed25519 signing key hex) without taking a direct polyc-crypto dependency of their own — this crate already depends on it (signing an edge_credentials::EdgeCredentials’s envelope), and every edge already depends on this crate. A secret value, redacted in Debug/Display and zeroized on drop.
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.
TaskDialer
Reusable handle for the control plane’s AgentTaskService.
TurnIngress
Complete input for one durable ingress receive.
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.
UsageRollupsRebuilt
What one PersonaDialer::rebuild_usage_rollups pass did.
VerificationOutcome
Result of an ApprovalDialer::verify_conversation call (#799).

Enums§

AgentTaskState
The lifecycle state of one durable agent task.
ApprovalChoice
A human’s decision on a pending approval, as the edges present it.
ApprovalRecoveryState
The recovery state for an approval occurrence.
AttestedEmail
What PersonaDialer::attest_verified_email did. Not rendered to a real person — the caller is a first-party backend, not an edge — so unlike LinkCeremony this carries no user_message.
CompactionReason
Why a turn’s prompt was auto-compacted before it ran. The buffered analog of WireCompactionReason, lifted to a closed Rust enum so surfaces match on it without touching the wire crate.
CredentialKeyState
A credential key’s lifecycle state.
DecideOutcome
The control plane’s verdict on an operator decision, in edge-renderable terms — the buffered analog of the wire DecideReply.Outcome.
DialError
Errors an agent dial can produce.
ErrorCode
The Connect error-code enum, re-exported so edges can branch on DialError::code (e.g. render permission_denied differently from a transient failure) without depending on connectrpc directly. ConnectRPC error codes.
LinkCeremony
The outcome of completing a link ceremony, in edge-renderable terms.
OpsAction
A control-plane action an operator is asked to authorize.
Priority
Advisory scheduling weight on an IngressDirective. Re-exported from the wire type — no scheduler exists today (dispatch is immediate per conversation-lease), so this value is only ever recorded (a signed ingress_directive eventlog event, for forensics/operator display), never used to reorder or defer a turn.
QuestionChoice
A human’s decision on a pending ask_question question (#1660).
ReadPreview
Trusted-side preview for a read that crosses conversations.
ReplayOverrideSpec
One counterfactual override for a what-if ApprovalDialer::replay_conversation.
ReplayTurnOutcome
How one replayed turn compared against its record.
TurnEvent
Incremental event emitted while a turn streams from the control plane.
TurnFailureKind
Provider-agnostic classification of a durable turn failure (#756).
UpgradeOutcomeKind
What the closed-loop rollout observation confirmed after an approved UpgradeTo, in edge-renderable terms — the buffered analog of the wire UpgradeOutcome.Kind.

Constants§

ADMIN_ONLY_INVITE
The “only admins can invite” refusal copy, shared across edges.
AGENT_DIAL_TIMEOUT
Default per-call deadline for an agent turn.
OPS_PROMPT_HEADING
Heading shown above an approval-mailbox prompt.

Functions§

approval_completed_text
The one line of copy shown once an approved call’s re-drive has actually executed (#743).
approval_decided_text
The one line of copy shown after a human decides a pending approval.
approval_preview_plain_text
Render the shared approval preview without chat-markup fences.
approval_preview_text
Render an ApprovalPreview as the text block every chat edge appends to an approval card (#1496, reformatted in #1808).
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.
encode_messages_for_content_hash
Canonical bytes a turn’s messages hash to for AssertedAttribution::content_hash.
encode_transcript_for_content_hash
Canonical bytes the participation gate’s envelope binds to.
expose_nonempty
Reads an optional wrapped secret, treating an empty string as unset.
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.
incognito_error_message
User-facing copy for a PersonaDialer::set_incognito failure (#796), shared across edges so the toggle reads identically wherever it’s reachable from.
invite_error_message
The user-facing message for an admin-invite dial failure, shared by every edge.
invite_opener
The opening line of the target-facing invite message, shared across every edge so the greeting can’t drift.
invite_sent_ack
The codeless acknowledgement the admin sees once an invite is on its way. Never the code, never the redemption mechanism — just confirms who and when it expires, identically on every edge.
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.