Skip to main content

Module rpc

Module rpc 

Source
Expand description

ProofRPC runtime — mirrors tools/tf-types-ts/src/core/rpc.ts.

Sits on top of a transport that carries SessionFrame values (typically tf_types::session::SessionState wrapped by some adapter). Emits typed Rust structs; capability enforcement is pluggable.

Structs§

AgentSessionFrame
AllowAllEnforcer
DenyAllEnforcer
RemoteShellOut
RpcBulkExt
RpcCallError
RpcClient
RpcContext
RpcError
RpcFrameExt
Per-frame metadata carried alongside the rpc envelope. Optional; older counterparts that don’t understand a field skip it.
RpcProofEventStub
RpcServer

Enums§

CapabilityDecision
HttpFrame
RemoteShellStream
ResponseStatus
RpcErrorCode
RpcFrame
RpcMethodKind
ProofRPC method kind. Mirror of TS RpcMethodKind. The proofrpc schema enumerates all 10 distinct flows; the runtime applies per-kind invariants (subscribe ack, command-channel credits, bulk-transfer hash verification, telemetry priority, remote-shell stream tagging, agent-session delegation chain).
StreamingPriority

Traits§

CapabilityEnforcer
RpcTransport
Wire-level transport. The tf-session crate will provide an adapter that implements this on top of SessionState; for tests we use an in-memory pair.

Functions§

new_call_id

Type Aliases§

AgentSessionHandler
Agent-session handler. Both directions carry AgentSessionFrame { value, responsibility_chain } records. The initial chain from the rpc-call’s ext is surfaced in ctx.initial_chain; per-frame chains override it.
BidiHandler
Bidi-streaming handler. Receives an inbound receiver and an outbound sender; drives both independently. Returns when the handler is done emitting (the runtime wires the sender to RpcStream frames).
BulkTransferHandler
Bulk-transfer handler. Receives an inbound receiver of byte chunks (decoded from base64 wire frames) and returns a single receipt. The runtime SHA-256s the concatenation and verifies against the caller-asserted expected_hash before emitting the receipt.
ClientStreamHandler
Client-streaming handler. Receives the initial request plus an UnboundedReceiver of streamed client values, returns a single aggregated response.
CommandChannelHandler
Command-channel handler — same shape as BidiHandler. The runtime emits an initial credit grant on accept and tags every server frame with ext.method_kind = command-channel.
HttpBridgeHandler
Http-bridge handler. Both directions carry HttpFrame enums (headers, chunks, trailers).
RemoteShellHandler
Remote-shell handler. Receives an inbound receiver of stdin byte chunks and an outbound sender for RemoteShellOut { stream, data } records; the runtime preserves the stream tag end-to-end.
StreamHandler
SubscribeHandler
Subscribe handler — same shape as a server-streaming handler. The runtime brackets the stream with subscribed/unsubscribed ack frames automatically.
TelemetryHandler
Telemetry handler — push-only client-streaming with the declared streaming priority surfaced in ctx. Returns Ok(()) to commit a success closing frame, Err to fail the call.
UnaryHandler