Expand description
ST Protocol - Binary Wire Protocol for Smart Tree Daemon
A tight, 6502-inspired binary protocol using control ASCII (0x00-0x1F) as opcodes. No JSON in the core path. Every byte means something.
§Frame Format
┌──────┬─────────────────┬──────┐
│ verb │ payload │ 0x00 │
│ 1B │ N bytes │ END │
└──────┴─────────────────┴──────┘§Escape Sequences
0x1B 0x1B= literal0x1Bin payload0x1B 0x00= literal0x00in payload
§Network Addressing
Single byte prefix for routing:
0x00= local daemon (Unix socket)0x01-0x7F= cached host index0x80-0xFE= inline address (len = byte - 0x80)0xFF= broadcast/discover
Structs§
- Address
String - Inline address string (max 126 bytes)
- Auth
Block - Authentication block parsed from wire format
- Frame
- A complete protocol frame
- Frame
Builder - Builder for constructing frames
- Host
Cache - Host cache for remembered remote daemons
- Payload
- Raw payload data with escape handling
- Payload
Decoder - Payload decoder for parsing complex payloads
- Payload
Encoder - Payload encoder for building complex payloads
- Security
Context - Security context for a connection
- Session
Id - Session UUID (16 bytes)
- Signature
- Ed25519 signature (32 bytes)
Enums§
- Address
- Network address for daemon communication
- Auth
Level - Authentication level required for operations
- Protocol
Error - Protocol-specific errors
- Verb
- Protocol verbs mapped to control ASCII codes
Constants§
- END
- End of frame marker
- ESC
- Escape byte
- MAX_
FRAME_ SIZE - Maximum frame size including overhead
- MAX_
PAYLOAD_ LEN - Maximum payload length (64KB)
- PROTECTED_
PATHS - Protected paths that require elevation
- VERSION
- Protocol version
Functions§
- is_
protected_ path - Check if a path requires elevated access
- path_
auth_ level - Get required auth level for a path
Type Aliases§
- Protocol
Result - Result type for protocol operations