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§
- Agent
Session Frame - Allow
AllEnforcer - Deny
AllEnforcer - Remote
Shell Out - RpcBulk
Ext - RpcCall
Error - RpcClient
- RpcContext
- RpcError
- RpcFrame
Ext - Per-frame metadata carried alongside the rpc envelope. Optional; older counterparts that don’t understand a field skip it.
- RpcProof
Event Stub - RpcServer
Enums§
- Capability
Decision - Http
Frame - Remote
Shell Stream - Response
Status - RpcError
Code - RpcFrame
- RpcMethod
Kind - 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). - Streaming
Priority
Traits§
- Capability
Enforcer - 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§
Type Aliases§
- Agent
Session Handler - Agent-session handler. Both directions carry
AgentSessionFrame { value, responsibility_chain }records. The initial chain from the rpc-call’s ext is surfaced inctx.initial_chain; per-frame chains override it. - Bidi
Handler - 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).
- Bulk
Transfer Handler - 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_hashbefore emitting the receipt. - Client
Stream Handler - Client-streaming handler. Receives the initial request plus an
UnboundedReceiverof streamed client values, returns a single aggregated response. - Command
Channel Handler - Command-channel handler — same shape as
BidiHandler. The runtime emits an initial credit grant on accept and tags every server frame withext.method_kind = command-channel. - Http
Bridge Handler - Http-bridge handler. Both directions carry
HttpFrameenums (headers, chunks, trailers). - Remote
Shell Handler - 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. - Stream
Handler - Subscribe
Handler - Subscribe handler — same shape as a server-streaming handler. The
runtime brackets the stream with
subscribed/unsubscribedack frames automatically. - Telemetry
Handler - Telemetry handler — push-only client-streaming with the declared
streaming priority surfaced in
ctx. ReturnsOk(())to commit a success closing frame,Errto fail the call. - Unary
Handler