openagent-ws · frame
Declared module signatures, types, configuration, and source documentation.
Source: openagent-sdk/adapters/websocket/rust/src/frame.rs. SHA-256: 1dd6eb684a375c0c9733fc171a312b0703495370fa7ed8cfc0a5ee9a886c250f.
This source reference follows declared modules and preserves feature attributes. It includes public declarations and implementation methods in those modules. Private-module exports and trait resolution still require the compiler; not every declaration is a crate-root import. Function bodies and constant values are omitted. Source comments describe their implementation context and are not a production deployment claim.
frame::PresentFrame
Step 1: Client presents its DID and ephemeral X25519 public key.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct PresentFrame {
/// Always `"oaap:present"`.
#[serde(rename = "type")]
pub frame_type: String,
/// The client's `did:oas:*` identifier.
pub did: String,
/// Client's ephemeral X25519 public key (hex-encoded, 64 chars).
pub ephemeral_pub: String,
/// Client's Ed25519 verifying key (hex-encoded, 64 chars).
pub verifying_key: String,
/// ISO-8601 timestamp of when the frame was created.
pub timestamp: String
}Source line: 16.
frame::ChallengeFrame
Step 2: Server responds with its own DID, ephemeral key, and a challenge nonce.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ChallengeFrame {
/// Always `"oaap:challenge"`.
#[serde(rename = "type")]
pub frame_type: String,
/// The server's `did:oas:*` identifier.
pub did: String,
/// Server's ephemeral X25519 public key (hex-encoded).
pub ephemeral_pub: String,
/// Server's Ed25519 verifying key (hex-encoded).
pub verifying_key: String,
/// Random challenge nonce (hex-encoded, 64 chars = 32 bytes).
pub challenge: String,
/// ISO-8601 timestamp.
pub timestamp: String
}Source line: 32.
frame::ProveFrame
Step 3: Client proves identity by signing the challenge with its Ed25519 key.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct ProveFrame {
/// Always `"oaap:prove"`.
#[serde(rename = "type")]
pub frame_type: String,
/// Ed25519 signature over the challenge bytes (hex-encoded, 128 chars).
pub signature: String,
/// The challenge that was signed (echoed back for binding).
pub challenge: String
}Source line: 50.
frame::EstablishedFrame
Step 4: Server confirms authentication and establishes the session.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct EstablishedFrame {
/// Always `"oaap:established"`.
#[serde(rename = "type")]
pub frame_type: String,
/// The unique session identifier (hex-encoded, 32 bytes).
pub session: String,
/// Whether the session uses encrypted payloads.
pub encrypted: bool,
/// Ed25519 signature from the server over `session || client_ephemeral_pub`
/// to prove the server is authentic (hex-encoded).
pub signature: String
}Source line: 62.
frame::MessageFrame
Data frame sent after authentication is established.
#[derive(Debug, Clone, Serialize, Deserialize)]
pub struct MessageFrame {
/// Always `"oaap:message"`.
#[serde(rename = "type")]
pub frame_type: String,
/// Session identifier (hex-encoded).
pub session: String,
/// The payload — either plaintext (UTF-8) or base64-encoded ciphertext
/// depending on whether the session is encrypted.
pub payload: String,
/// AES-256-GCM nonce (hex-encoded) — present only when encrypted.
#[serde(skip_serializing_if = "Option::is_none")]
pub nonce: Option<String>,
/// Monotonically increasing sequence number for replay protection.
pub seq: u64
}Source line: 79.
frame::TYPE_PRESENT
Wire value of the type field for [PresentFrame] (handshake step 1).
pub const TYPE_PRESENT: &str;Source line: 107.
frame::TYPE_CHALLENGE
Wire value of the type field for [ChallengeFrame] (handshake step 2).
pub const TYPE_CHALLENGE: &str;Source line: 109.
frame::TYPE_PROVE
Wire value of the type field for [ProveFrame] (handshake step 3).
pub const TYPE_PROVE: &str;Source line: 111.
frame::TYPE_ESTABLISHED
Wire value of the type field for [EstablishedFrame] (handshake step 4).
pub const TYPE_ESTABLISHED: &str;Source line: 113.
frame::TYPE_MESSAGE
Wire value of the type field for [MessageFrame] (post-handshake data).
pub const TYPE_MESSAGE: &str;Source line: 115.