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
Health status (empty = healthy, "mount_failed" = unhealthy)
Example:
{ "comment": "Before database migration", "create_time": "2026-01-05T10:30:00Z", "id": "v7"}ChmodRequest
Section titled “ChmodRequest”ChmodResponse
Section titled “ChmodResponse”ChmodResult
Section titled “ChmodResult”ChownRequest
Section titled “ChownRequest”ChownResponse
Section titled “ChownResponse”ChownResult
Section titled “ChownResult”CopyRequest
Section titled “CopyRequest”CopyResponse
Section titled “CopyResponse”CopyResult
Section titled “CopyResult”CreateCheckpointRequest
Section titled “CreateCheckpointRequest”Example:
{ "comment": "Before deploying v2.0"}DeleteRequest
Section titled “DeleteRequest”DeleteResponse
Section titled “DeleteResponse”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"}ExecSession
Section titled “ExecSession”Session identifier
Session creation time
Command being executed
Working directory
Whether the session has a TTY
Recent output rate
Whether the session has recent output or attached clients
Time of the most recent output
ExecSessionListResponse
Section titled “ExecSessionListResponse”Active exec sessions
Number of active sessions
Present when the session manager is unavailable
ListResponse
Section titled “ListResponse”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"}PortNotificationMessage
Section titled “PortNotificationMessage”Notification type
Port number
Proxy URL for accessing the port
Process ID that opened/closed the port
PrivilegesPolicyDoc
Section titled “PrivilegesPolicyDoc”Capability profile: `minimal`, `standard` or `privileged`. Empty means unrestricted
Device nodes the sprite may access
Prevent processes from gaining privileges through execve
RenameRequest
Section titled “RenameRequest”RenameResponse
Section titled “RenameResponse”ResourcesPolicyDoc
Section titled “ResourcesPolicyDoc”ResourcesPolicyMemory
Section titled “ResourcesPolicyMemory”Enable dynamic memory autoscaling (default: false)
ServiceLogCompleteEvent
Section titled “ServiceLogCompleteEvent”(const: `"complete"`)
Log file paths
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
Environment variables to add to the base service environment
Working directory for the service
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
Machine-readable error class, empty when unclassified
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"}StreamKeepaliveEvent
Section titled “StreamKeepaliveEvent”(const: `"keepalive"`)
Timestamp
WriteResponse
Section titled “WriteResponse”Handler
Section titled “Handler”Handler identifies a handler function
| Value |
|---|
ExecHandler |
ExecHTTPHandler |
ExecAttachHandler |
ExecKillHandler |
HandleCheckpoint |
HandleListCheckpoints |
HandleGetCheckpoint |
HandleCheckpointRestore |
HandleDeleteCheckpoint |
HandleProxy |
HandlePolicyNetwork |
HandlePolicyPrivileges |
HandlePolicyResources |
HandleListServices |
HandleGetService |
HandleCreateService |
HandleStartService |
HandleStopService |
HandleRestartService |
HandleDeleteService |
HandleSuspend |
HandleLogs |
HandleSetSpriteEnvironment |
HandleDebugCreateZombie |
HandleDebugCheckProcess |
HandleAdminResetState |
HandleServiceLogs |
HandlePortWatch |
HandleControl |
HandleFsRead |
HandleFsWrite |
HandleFsList |
HandleFsDelete |
HandleFsRename |
HandleFsCopy |
HandleFsChmod |
HandleFsChown |
HandleFsWatch |
Middleware
Section titled “Middleware”Middleware identifies a middleware function
| Value |
|---|
auth |
wait_for_process |
wait_for_storage |
wait_for_policy |
enrich_context |
exec_ack |
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"}PortListMessage
Section titled “PortListMessage”(const: `"port_list"`)
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"`)
Session ID
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"}