Stream session events (actions, command output)
computers.retrieve_events(strid)
GET/computers/{id}/events
Server-Sent Events stream carrying non-video events for a session. Each data: line is a JSON object describing one event. Three event categories are emitted:
- Action requests — an action has been queued for execution.
- Action responses — a previously requested action has completed. Includes a
request_idfor correlation; for shell commands, also includesexit_code,stdout, andstderr. - Command output chunks — streaming output from a long-running shell command started with
/exec. Each chunk includesrequest_id, base64-encodeddata, and anis_stderrflag.
Video and cursor traffic is delivered on /computers/{id}/screencast instead and is deliberately excluded from this stream so high-frequency frame data doesn't drown out action responses.
On stream-setup failure the server emits a single event: error SSE event and closes the connection.
Parameters
id: str
Stream session events (actions, command output)
import os
from tzafon import Lightcone
client = Lightcone(
api_key=os.environ.get("TZAFON_API_KEY"), # This is the default and can be omitted
)
client.computers.retrieve_events(
"id",
)