Skip to content

Protocol Reference

Sireno Deck uses WebSocket for real-time communication between frontend and backend.

Current: 1

  1. Client connects to WebSocket server
  2. Client sends hello message with token
  3. Server validates and sends hello-ack
  4. Bidirectional message exchange begins
{
type: "hello"
token: string // Authentication token
clientId: string // Client identifier
}
{
type: "button-action"
deckId: string
position: number // 0-indexed button position
gesture: "tap" | "dbl-tap" | "hold"
}
{
type: "method-call"
callId: string // Unique request ID
name: string // Method name
args: unknown[] // Method arguments
}
{
type: "select-deck"
deckId: string
}
{
type: "deck-active"
deckId: string
}
{
type: "dismiss-overlay"
}
{
type: "subscribe-channels"
channels: string[]
}
{
type: "hello-ack"
protocolVersion: 1
deviceInfo: {
id: string
model: string
keyCount: number
label: string
transport: "real" | "emulated"
}
theme: {
name: string
cssPath: string
}
}
{
type: "device-info"
id: string
model: string
keyCount: number
label: string
transport: "real" | "emulated"
}
{
type: "deck-config"
deckId: string
surfaces: Record<string, unknown>
navMode: "regular" | "paginated" | "overlay"
isCompact: boolean
hasOverlayDeckAvailable: boolean
overlayDeckIcon: string | null
overlayDeckName: string | null
}
{
type: "state"
channels: Record<string, unknown>
cadence?: Record<string, number> // Poll intervals in ms
}
{
type: "decks-list"
decks: Array<{ id: string; name: string }>
}
{
type: "show-overlay"
deckId: string
}
{
type: "button-error"
deckId: string
position: number
durationMs: number
buttonId?: string
details?: string
}
{
type: "method-call-result"
callId: string
success: boolean
result?: unknown
error?: string
}
{
type: "assets"
assets: Array<{ id: string; data: string }>
}
Channel Description
date-time:now Current timestamp (every 1s)
media:state Media player state (every 1s)
weather:current Weather data (every 10min)
value-display:values Shell command outputs (every 5s)
runtime:system-status:* System metrics
runtime:overlay Overlay deck state
runtime:activeDeck Active deck changes

The server validates the token in the hello message against sireno-deck.token in the runtime directory.

Invalid token results in WebSocket close with code 4001.