Skip to main content

Crate ocp_types

Crate ocp_types 

Source
Expand description

ocp-types — the Open Context Protocol wire types.

This crate is the industry-facing artifact: MIT licensed, zero dependencies beyond serde, publishable to crates.io on its own so a third party can implement an OCP host or provider without pulling in any Stella code. See docs/specs/stella-rust-cli/06-context-protocol.md §3 for the normative shape this crate binds to Rust types.

Protocol version: ocp/1.0-draft.

Re-exports§

pub use capability::Capabilities;
pub use capability::DataFlow;
pub use capability::ProviderInfo;
pub use frame::ContextFrame;
pub use frame::FrameKind;
pub use frame::Provenance;
pub use frame::Relation;
pub use query::ContextQuery;
pub use query::ContextQueryResult;

Modules§

capability
Handshake and capability negotiation types (docs/specs/stella-rust-cli/06-context-protocol.md §3.2). DataFlow is the security-critical field: hosts surface it at install/consent time, and egress: true providers must never be auto-enabled (§3.5).
frame
ContextFrame — the unit of exchange between an OCP host and a provider. docs/specs/stella-rust-cli/06-context-protocol.md §3.4 fixes this exact shape; frames, never blobs, carry relevance, cost, and provenance so a budgeting, citing host can compose sources honestly.
query
context/query request/response shapes (docs/specs/stella-rust-cli/06-context-protocol.md §3.3). Budget-aware by contract: every query carries max_tokens; a conforming provider never returns more than the budget and never lies about cost.

Constants§

PROTOCOL_VERSION
The protocol version string this crate implements. Frozen to ocp/1.0 only at the public v1.0 release (06-context-protocol.md §3).