Type Definitions
This page documents the data types used throughout the Sprites API.
CheckpointInfo
Section titled “CheckpointInfo”Checkpoint identifier (e.g., `v7`)
When the checkpoint was created
Parent checkpoint ID
User-provided description
Example:
{ "comment": "Before database migration", "create_time": "2026-01-05T10:30:00Z", "id": "v7"}CreateCheckpointRequest
Section titled “CreateCheckpointRequest”Example:
{ "comment": "Before deploying v2.0"}ExecKillCompleteEvent
Section titled “ExecKillCompleteEvent”(const: `"complete"`)
Process exit code
Example:
{ "exit_code": 0, "type": "complete"}ExecKillErrorEvent
Section titled “ExecKillErrorEvent”(const: `"error"`)
Error message
Example:
{ "message": "Warning: process may not have terminated", "type": "error"}ExecKillExitedEvent
Section titled “ExecKillExitedEvent”(const: `"exited"`)
Status message
Example:
{ "message": "Process exited", "type": "exited"}ExecKillKilledEvent
Section titled “ExecKillKilledEvent”(const: `"killed"`)
Status message
Example:
{ "message": "Process killed", "type": "killed"}ExecKillSignalEvent
Section titled “ExecKillSignalEvent”(const: `"signal"`)
Status message
Signal name (e.g., `SIGTERM`)
Target process ID
Example:
{ "message": "Signaling SIGTERM to process group 1847", "pid": 1847, "signal": "SIGTERM", "type": "signal"}ExecKillTimeoutEvent
Section titled “ExecKillTimeoutEvent”(const: `"timeout"`)
Status message
Example:
{ "message": "Timeout after 10s, sending SIGKILL", "type": "timeout"}NetworkPolicyRequest
Section titled “NetworkPolicyRequest”List of network policy rules
Example:
{ "rules": [ { "action": "allow", "domain": "github.com" }, { "action": "allow", "domain": "*.npmjs.org" } ]}NetworkPolicyRule
Section titled “NetworkPolicyRule”Domain pattern (e.g., `*.github.com`)
`allow` or `deny`
Include rules from preset
Example:
{ "action": "allow", "domain": "*.github.com"}ServiceLogCompleteEvent
Section titled “ServiceLogCompleteEvent”(const: `"complete"`)
Unix milliseconds
Example:
{ "log_files": { "combined": "/.sprite/logs/services/webapp.log", "stderr": "/.sprite/logs/services/webapp.log", "stdout": "/.sprite/logs/services/webapp.log" }, "timestamp": 1767609000000, "type": "complete"}ServiceLogErrorEvent
Section titled “ServiceLogErrorEvent”(const: `"error"`)
Error message
Unix milliseconds
Example:
{ "data": "Failed to start service: command not found", "timestamp": 1767609000000, "type": "error"}ServiceLogExitEvent
Section titled “ServiceLogExitEvent”(const: `"exit"`)
Process exit code
Unix milliseconds
Example:
{ "exit_code": 0, "timestamp": 1767609000000, "type": "exit"}ServiceLogStartedEvent
Section titled “ServiceLogStartedEvent”(const: `"started"`)
Unix milliseconds
Example:
{ "timestamp": 1767609000000, "type": "started"}ServiceLogStderrEvent
Section titled “ServiceLogStderrEvent”(const: `"stderr"`)
Log line content
Unix milliseconds
Example:
{ "data": "Warning: deprecated API usage\n", "timestamp": 1767609000000, "type": "stderr"}ServiceLogStdoutEvent
Section titled “ServiceLogStdoutEvent”(const: `"stdout"`)
Log line content
Unix milliseconds
Example:
{ "data": "Server listening on port 3000\n", "timestamp": 1767609000000, "type": "stdout"}ServiceLogStoppedEvent
Section titled “ServiceLogStoppedEvent”(const: `"stopped"`)
Process exit code
Unix milliseconds
Example:
{ "exit_code": 0, "timestamp": 1767609000000, "type": "stopped"}ServiceLogStoppingEvent
Section titled “ServiceLogStoppingEvent”(const: `"stopping"`)
Unix milliseconds
Example:
{ "timestamp": 1767609000000, "type": "stopping"}ServiceRequest
Section titled “ServiceRequest”Command to execute
Command arguments
Service dependencies (started first)
HTTP port for proxy routing
Example:
{ "args": [ "-m", "http.server", "8000" ], "cmd": "python", "http_port": 8000, "needs": [ "postgres" ]}ServiceResponse
Section titled “ServiceResponse”Service name
Command to execute
Command arguments
Service dependencies
HTTP port for proxy routing
Current runtime state
Example:
{ "args": [ "-m", "http.server", "8000" ], "cmd": "python", "http_port": 8000, "name": "webapp", "needs": [ "postgres" ], "state": { "name": "webapp", "pid": 1567, "started_at": "2026-01-05T08:01:00Z", "status": "running" }}ServiceState
Section titled “ServiceState”Service name
`stopped`, `starting`, `running`, `stopping`, or `failed`
Process ID when running
ISO 8601 timestamp
Error message if failed
Example:
{ "name": "webapp", "pid": 1567, "started_at": "2026-01-05T08:01:00Z", "status": "running"}StreamCompleteEvent
Section titled “StreamCompleteEvent”(const: `"complete"`)
Completion message
Timestamp
Example:
{ "data": "Checkpoint v3 created successfully", "time": "2026-01-05T10:30:00Z", "type": "complete"}StreamErrorEvent
Section titled “StreamErrorEvent”(const: `"error"`)
Error description
Timestamp
Example:
{ "error": "Checkpoint failed: disk full", "time": "2026-01-05T10:30:00Z", "type": "error"}StreamInfoEvent
Section titled “StreamInfoEvent”(const: `"info"`)
Status message
Timestamp
Example:
{ "data": "Creating checkpoint...", "time": "2026-01-05T10:30:00Z", "type": "info"}Handler
Section titled “Handler”Handler identifies a handler function
| Value |
|---|
ExecHandler |
ExecHTTPHandler |
ExecAttachHandler |
ExecKillHandler |
HandleCheckpoint |
HandleListCheckpoints |
HandleGetCheckpoint |
HandleCheckpointRestore |
HandleDeleteCheckpoint |
HandleProxy |
HandlePolicyNetwork |
HandleListServices |
HandleGetService |
HandleCreateService |
HandleStartService |
HandleStopService |
HandleDeleteService |
HandleWebSocket |
HandleSuspend |
HandleLogs |
MCPHandler |
HandleSetSpriteEnvironment |
HandleDebugCreateZombie |
HandleDebugCheckProcess |
HandleAdminResetState |
HandleServiceLogs |
Middleware
Section titled “Middleware”Middleware identifies a middleware function
| Value |
|---|
auth |
wait_for_process |
wait_for_storage |
wait_for_policy |
enrich_context |
PortNotificationType
Section titled “PortNotificationType”PortNotificationType represents the type of port notification
| Value |
|---|
port_opened |
port_closed |
WebSocket Messages
Section titled “WebSocket Messages”These message types are used for WebSocket communication in exec and proxy endpoints.
ExitMessage
Section titled “ExitMessage”(const: `"exit"`)
Process exit code
Example:
{ "exit_code": 0, "type": "exit"}PortNotificationMessage
Section titled “PortNotificationMessage”Notification type
Port number
Proxy URL for accessing the port
Process ID that opened/closed the port
Example:
{ "address": "https://my-sprite.sprites.dev:3000", "pid": 1847, "port": 3000, "type": "port_opened"}ProxyInitMessage
Section titled “ProxyInitMessage”Target hostname (typically "localhost")
Target port (1-65535)
Example:
{ "host": "localhost", "port": 5432}ResizeMessage
Section titled “ResizeMessage”(const: `"resize"`)
New column count
New row count
Example:
{ "cols": 180, "rows": 50, "type": "resize"}SessionInfoMessage
Section titled “SessionInfoMessage”(const: `"session_info"`)
Process PID
Command being executed
Unix timestamp of session creation
Terminal columns (TTY mode only)
Terminal rows (TTY mode only)
Whether this attachment owns the session
Whether session is in TTY mode
Example:
{ "cols": 120, "command": "bash", "created": 1767609000, "is_owner": true, "rows": 40, "session_id": 1847, "tty": true, "type": "session_info"}