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 theconfigurationsthe 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.5.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| lab_sync_driver_protocol-0.5.0.tar.gz | 5.2 kB | Without provenance | Details for lab_sync_driver_protocol-0.5.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| lab_sync_driver_protocol-0.5.0-py3-none-any.whl | Python 3 | none | any | Details for lab_sync_driver_protocol-0.5.0-py3-none-any.whl |
Total release size: 11.8 kB
Release files / lab_sync_driver_protocol-0.5.0.tar.gz
| Download URL | lab_sync_driver_protocol-0.5.0.tar.gz |
|---|---|
| Size | 5.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b86fc352bc97f78be60e707cc4960a5fb2201a81c506e7e29aaed03dc26b376d
|
|
BLAKE2b-256 checksum How to use checksums |
7a59e755ee24cc11666a03bf4f0a0f7bb72836bcea502e1d606dbaaa3165e4e1
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.5.0-py3-none-any.whl
| Download URL | lab_sync_driver_protocol-0.5.0-py3-none-any.whl |
|---|---|
| Size | 6.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f5589228cb7eca9e9405880121a20e3d11a75fa63fb5a49a37c5152104025043
|
|
BLAKE2b-256 checksum How to use checksums |
2bd61a52c503abbbfea13309bad6fdbd5b7bd65bde95f85bb60a7420e2ab9f95
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.13.5 {"installer":{"name":"uv","version":"0.13.5","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.5.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.