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§
- Added
Credential Key - What
CredentialDialer::add_credential_keydid. - Agent
Dialer - Reusable handle for dialing the polychrome control plane.
- Agent
Task Ownership - Exact State-issued ownership for one task dispatch.
- Agent
Task Page - One page of a context’s tasks, as
TaskDialer::list_tasksread it back. - Agent
Task Record - One durable task, as
TaskDialerread it back. - Agent
Task Transition - The successor a
TaskDialer::transition_taskcall asks for. - Approval
Dialer - Reusable handle for the control plane’s
ApprovalService. - Approval
Outcome - The persisted outcome of an
ApprovalService.Respondcall. - Approval
Preview - The approval card’s spec-computed preview (
#1496). - Approval
Preview Fire - One fire instant rendered for a human in
ApprovalPreview: the same real instant twice, RFC3339 inApprovalPreview::zone_nameand in UTC. - Attribution
- Caller attribution for one turn.
- Buffered
Turn - The buffered result of one turn: the aggregated reply text plus any
PendingApprovalPrompts the turn paused on. - Connect
Error - The Connect transport error
DialError::Connectwraps, re-exported for the same reasonErrorCodeis: 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. - Credential
Dialer - Reusable handle for the control plane’s
CredentialService— the admin-gated live enrollment, rotation, and revocation surface over State’s credential authority. - Credential
Enrollment - One idempotent credential-enrollment operation.
- Credential
KeySummary - 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). - Credential
Record Summary - One stored credential’s operator-visible summary — the buffered analog of
the wire
CredentialSummary. - Credential
Summary Page - One bounded page from credential lifecycle administration.
- Credential
Verifier - The verifier half of one credential key, as an operator authors it.
- Decide
Result - An operator decision’s result: the
DecideOutcomeplus the control plane’s human-readabledetail(the reject reason when rejected). - Durably
Received Turn - Proof that State durably received one
TurnIngress. - Enrolled
Credential - What
CredentialDialer::enroll_credentialdid. - Excision
Outcome - Result of an
ApprovalDialer::excise_taintcall. - External
Identity - The external identity of a human observed at an edge (re-exported wire
type, shared with the persona store records): the per-edge
EdgeAdaptermapping produces these and the control plane resolves them to durable personas. - Fired
Routine - The result of
RoutineDialer::fire_routine: the occurrence the firing used. - Gate
Message - The attributed transcript line type the participation gate consumes.
Re-exported so callers build requests without importing
polyc-proto. - Linked
Identity - One external identity linked to a persona, as the dashboard renders it (provider · display name · id).
- Notification
Dialer - Reusable handle for the control plane’s
NotificationService— the pending-notification projection an edge drains to deliver operator DMs. - Operator
Mailbox Dialer - Reusable handle for the control plane’s
OperatorMailboxService— the operator decision endpoint (authorize → evaluate → sign → record → executor, all server-side). - Payment
Receipt - A settled inbound payment receipt, re-exported so the public-edge layer can
thread it into
AgentDialer::run_turn_streaming_messages_withwithout depending onpolyc-protodirectly. - Pending
Approval - One outstanding approval returned by
ApprovalDialer::list_pending. - Pending
Approval Prompt - One gated tool call a buffered turn paused on, surfaced from the terminal
AgentEnd.pending_approvals— the buffered-API mirror ofTurnEvent::ApprovalPending’s fields. - Pending
Notice - One undelivered
(item, target)pair an edge must DM, in edge-friendly terms. - Pending
Question Prompt - One question a buffered turn paused on (
#1660). - Persona
Dialer - Reusable handle for the control plane’s
PersonaService. - Persona
View - 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).
- Question
Dialer - Reusable handle for the control plane’s
QuestionService(#1660). - Question
Option Prompt - One option a pending question offers, mirroring the wire
QuestionOption/QuestionOptionEntrymessages (#1660). - Question
Outcome - Outcome of a
QuestionDialer::respondcall — the question-pause SIBLING ofApprovalOutcome. - Recorded
Approval Recovery - A decision durably recorded but not yet consumed by tool execution.
- Recoverable
Approval - One durable approval occurrence that needs a resume turn.
- Replay
Report - The whole-conversation replay report a
conversation replaycommand renders. - Replay
Turn Verdict - One turn’s replay verdict, as
ApprovalDialer::replay_conversationreturns it. - Retired
Credential Key - What
CredentialDialer::retire_credential_keydid. - Revoked
Credential - What
CredentialDialer::revoke_credentialdid. - Routine
Dialer - 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-cryptodependency of their own — this crate already depends on it (signing anedge_credentials::EdgeCredentials’s envelope), and every edge already depends on this crate. A secret value, redacted inDebug/Displayand zeroized on drop. - Started
Deep Link - 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.
- Started
Link - A freshly minted link-ceremony challenge: the code an edge must deliver privately to the requesting user, plus its absolute expiry.
- Task
Dialer - Reusable handle for the control plane’s
AgentTaskService. - Turn
Ingress - Complete input for one durable ingress receive.
- Turn
Message - A turn-input message, re-exported so callers can build attributed
multi-party input for
AgentDialer::run_turn_streaming_messageswithout depending onpolyc-proto. - Usage
Rollups Rebuilt - What one
PersonaDialer::rebuild_usage_rollupspass did. - Verification
Outcome - Result of an
ApprovalDialer::verify_conversationcall (#799).
Enums§
- Agent
Task State - The lifecycle state of one durable agent task.
- Approval
Choice - A human’s decision on a pending approval, as the edges present it.
- Approval
Recovery State - The recovery state for an approval occurrence.
- Attested
Email - What
PersonaDialer::attest_verified_emaildid. Not rendered to a real person — the caller is a first-party backend, not an edge — so unlikeLinkCeremonythis carries nouser_message. - Compaction
Reason - 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. - Credential
KeyState - A credential key’s lifecycle state.
- Decide
Outcome - The control plane’s verdict on an operator decision, in edge-renderable
terms — the buffered analog of the wire
DecideReply.Outcome. - Dial
Error - Errors an agent dial can produce.
- Error
Code - The Connect error-code enum, re-exported so edges can branch on
DialError::code(e.g. renderpermission_denieddifferently from a transient failure) without depending onconnectrpcdirectly. ConnectRPC error codes. - Link
Ceremony - 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 signedingress_directiveeventlog event, for forensics/operator display), never used to reorder or defer a turn. - Question
Choice - A human’s decision on a pending
ask_questionquestion (#1660). - Read
Preview - Trusted-side preview for a read that crosses conversations.
- Replay
Override Spec - One counterfactual override for a what-if
ApprovalDialer::replay_conversation. - Replay
Turn Outcome - How one replayed turn compared against its record.
- Turn
Event - Incremental event emitted while a turn streams from the control plane.
- Turn
Failure Kind - Provider-agnostic classification of a durable turn failure (
#756). - Upgrade
Outcome Kind - What the closed-loop rollout observation confirmed after an approved
UpgradeTo, in edge-renderable terms — the buffered analog of the wireUpgradeOutcome.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
ApprovalPreviewas 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_idfor edges whose native parts can themselves contain':'(e.g. an emailMessage-ID, a URL, a path). - hashed_
conversation_ id - Derive a stable, fixed-length conversation id by hashing
partsinto aUUIDv5under a pinnednamespace. - incognito_
error_ message - User-facing copy for a
PersonaDialer::set_incognitofailure (#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.