Skip to main content

lab-sync-driver-protocol

The versioned wire contract between device drivers and the supervisor that launches them. A driver runs as a child process and the two talk newline-delimited JSON over the child's stdin and stdout: stdout is the protocol channel and nothing else may write to it, stderr is the driver's log channel. The package is importable by both sides and depends on nothing, so a driver speaks the protocol without importing anything of the supervisor's.

Most driver authors want lab-sync-driver-sdk, which implements the driver side of this protocol from a decorated Python class. Depend on lab-sync-driver-protocol directly only to implement the protocol yourself, in Python or as a reference for another language.

pip install lab-sync-driver-protocol

Frames

One JSON object per line. Every request carries an id, and every frame a driver sends in answer carries the same id and a type:

Request   (supervisor -> driver): {"id": <int>, "method": <str>, "params": {...}}
Reply     (driver -> supervisor): {"id": <int>, "type": "reply", "result": {...}}
Execute stream:                   {"id", "type": "progress", "fraction", "message"}
                           ... -> {"id", "type": "result", "output_json"}
                              or  {"id", "type": "error", "code", "message"}
Telemetry (driver -> supervisor): {"type": "telemetry", "channel": <str>, "payload": {...}}

lab_sync_driver_protocol.wire holds the framing (encode, decode, read_frame, write_frame), the protocol version (PROTOCOL_VERSION, currently v0) and STREAM_LIMIT, the line length a reader should accept.

Methods

The request vocabulary is handshake, describe, connect, set_simulation, ping, execute (streaming progress/result/error frames), abort, describe_options, estimate_time and set_telemetry_demand.

describe_options is optional and additive (the protocol version stays v0): request {"command": name, "parameters": {…}}, reply {"options": {param_name: [choice, …]}} — the runtime choices for the command's dynamic_options parameters, best-effort per parameter. A driver predating it answers with the standard unknown_method error frame, which a supervisor reads as "no dynamic options" rather than a fault.

Telemetry is demand-gated: a driver samples nothing until the supervisor sends set_telemetry_demand with the complete set of channels that should be running. See the lab_sync_driver_protocol.wire module docstring.

Environment

The supervisor passes per-instance values in the driver process's environment, since the launch command is shared by every instance of a driver type:

  • STUDIO_DEVICE_CONFIGURATION (CONFIGURATION_ENV): the hardware variant the device was added as, one of the configurations the driver describes.
  • STUDIO_DEVICE_DATA_DIR (DATA_DIR_ENV): the instance's own writable directory, which is also the process's working directory.

License

MIT

Metadata

Release files for lab-sync-driver-protocol 0.6.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lab-sync-driver-protocol 0.6.0
File Size Uploaded Provenance Actions
lab_sync_driver_protocol-0.6.0.tar.gz 5.2 kB Without provenance Details for lab_sync_driver_protocol-0.6.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lab-sync-driver-protocol 0.6.0
File Interpreter ABI Platform Actions
lab_sync_driver_protocol-0.6.0-py3-none-any.whl Python 3 none any Details for lab_sync_driver_protocol-0.6.0-py3-none-any.whl

Total release size: 11.8 kB

Release files / lab_sync_driver_protocol-0.6.0.tar.gz

Download URL lab_sync_driver_protocol-0.6.0.tar.gz
Size 5.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fb3c0d47b91e9eb62f04a6d9cf6ced133e699dbf45735c55109c7cd4ea8c4f4c
BLAKE2b-256 checksum
How to use checksums
f86132c169c4ab11ec51c4f7e9e8fef6a54e77b605c1042d7ebec8814c622014
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / lab_sync_driver_protocol-0.6.0-py3-none-any.whl

Download URL lab_sync_driver_protocol-0.6.0-py3-none-any.whl
Size 6.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a30a6ac2ba029b2d08de3723a7cb3f2ecbfdce454122c228e7ea05f1cadfca71
BLAKE2b-256 checksum
How to use checksums
68264832b346ac63394c4eba0bd4342dcfe8f905a8b176085af745e375cd6d6c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for lab-sync-driver-protocol 0.6.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page