MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / is_session_envelope

Method is_session_envelope

atomic-agent/src/envelope.rs:310–312  ·  view source on GitHub ↗

Check whether a byte slice looks like a `SessionEnvelope`. This is a fast check (just the 4-byte magic prefix) that the server can use to identify which changes have session data without fully deserializing. Used during push receipt to index session turns. # Example ```rust use atomic_agent::envelope::SessionEnvelope; let envelope = SessionEnvelope::builder("s1", "claude-code").build(); let by

(data: &[u8])

Source from the content-addressed store, hash-verified

308 /// assert!(!SessionEnvelope::is_session_envelope(b"ATS")); // too short
309 /// ```
310 pub fn is_session_envelope(data: &[u8]) -> bool {
311 data.len() >= MAGIC.len() && &data[..4] == MAGIC
312 }
313
314 /// Returns the number of files changed in this turn.
315 pub fn turn_file_count(&self) -> usize {

Callers

nothing calls this directly

Calls 1

lenMethod · 0.45

Tested by

no test coverage detected