Typed Pydantic models for the RCS → S1 (LiveKit dispatch worker) wire contract. Shared between RCS and any worker dispatched into a robot session.
Project description
menlo-rcs-types
Typed Pydantic models for the RCS → S1 wire contract — the JSON payloads RCS attaches to LiveKit calls that any dispatched worker (Uranus, rcw, future) reads on connect.
LiveKit is the transport; this package is just the shape of the fields RCS writes onto LiveKit primitives.
What's in it
Two models. That's the whole boundary.
DispatchMetadata (menlo_rcs_types.dispatch)
The JSON RCS passes to livekit.create_agent_dispatch(metadata=...) when injecting a worker into a room. Each worker process receives this on its JobContext.job.metadata.
class DispatchMetadata(BaseModel):
robot_id: str # the robot this session is for
user_id: str # who initiated the session
scene_id: str | None # optional opaque scene tag (env workers use this)
RoomMetadata (menlo_rcs_types.room)
The JSON RCS writes onto the LiveKit room itself. Visible to every participant; carries the orchestrator's view of room state so workers and clients can read it.
class RoomMetadata(BaseModel):
robot_id: str
status: str # "initializing" | "active" | …
dispatched_agent_names: list[str] # what RCS dispatched
required_participants: dict[str, RequiredParticipantSlot] # per-type counts
dispatches: dict[str, DispatchStatusEntry] # RCS's dispatch tracking
scene_id: str | None
created_at: datetime
Participant slot matching
RCS, webhooks, and SDK clients share the same identity ↔ slot rule:
- an identity equals the slot name (
sim-worker), or - starts with
slot-(sim-worker-abc)
The rule lives on the models it describes — this package exposes only types:
RequiredParticipantSlot.identity_matches(identity, slot_name)— the bare string rule, a static helper for callers matching raw candidate names (e.g. RCS webhook classification).RequiredParticipantSlot.matches(identity)— does this identity belong to this slot.RoomMetadata.required_slots()— slot names withmin_count > 0.RoomMetadata.satisfied_by(identities)— are all required slots filled. Assigns each identity to its longest matching slot, so overlapping prefixes (simvssim-worker) never double-count one participant.
Forward compatibility
All three models declare model_config = ConfigDict(extra="allow"). Adding optional fields in a later version of this package does not break workers built against an older version — unknown fields silently pass through model_validate_json.
This is the contract:
- New optional fields → safe to add anytime
- Renaming or removing a field → breaking change; bump version, coordinate rollouts
- Workers should never strictly-validate (
extra="forbid") against this schema
Usage
# RCS side — building the metadata it passes to LiveKit
from menlo_rcs_types import DispatchMetadata
md = DispatchMetadata(robot_id="rb_abc", user_id="user_long", scene_id="warehouse")
await livekit.create_agent_dispatch(
room=room_name,
agent_name="sim-worker",
metadata=md.model_dump_json(),
)
# Worker side — parsing the metadata on dispatch
from menlo_rcs_types import DispatchMetadata
async def runtime_session(ctx: JobContext) -> None:
md = DispatchMetadata.model_validate_json(ctx.job.metadata or "{}")
logger.info(
"dispatched",
robot_id=md.robot_id,
user_id=md.user_id,
scene_id=md.scene_id,
)
What's NOT in this package
AttachSessionRequestor any other client → RCS HTTP body shapes. Those are RCS's HTTP API surface, not the RCS → S1 wire. They live in RCS.- Per-capability variants (
SimHostMetadata,RuntimeExecutorMetadata, …). Both current workers use the same flatDispatchMetadata; capability-specific extras can ride onextra="allow"until they justify their own model. - Worker self-registration / heartbeat protocols. Workers register with LiveKit, not RCS, in V1.
Development
make dev # uv sync --group dev
make check # lint + fmt-check + type + test (CI gate)
Python 3.11+, Pydantic v2, ruff, mypy --strict. Same toolchain as runtime-tools / asimov-protocol.
Related
packages/py/runtime-tools/— the agent-facing Runtime Tools API (different layer: tools that run inside a session, after the worker is in the room)packages/py/asimov-protocol/— robot-firmware-level protobuf (lower than RCS)services/rcs/— produces these payloadsservices/uranus/,services/rcw/— parse these payloads
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file menlo_rcs_types-0.1.1.tar.gz.
File metadata
- Download URL: menlo_rcs_types-0.1.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e09340db75ee50d91dd3da110ef7b77762849abc589591248c2c380683a3cef2
|
|
| MD5 |
8865fec3ebfacb85d7db733c81223903
|
|
| BLAKE2b-256 |
310f7a6a6e608a26e9ded5373f89b639aa6883b5ca75d85dc6e9f9bf24be5679
|
Provenance
The following attestation bundles were made for menlo_rcs_types-0.1.1.tar.gz:
Publisher:
menlo-rcs-types-publish.yml on menloresearch/mono
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menlo_rcs_types-0.1.1.tar.gz -
Subject digest:
e09340db75ee50d91dd3da110ef7b77762849abc589591248c2c380683a3cef2 - Sigstore transparency entry: 1732171199
- Sigstore integration time:
-
Permalink:
menloresearch/mono@73b0b26a567ee87e1d40237c1a4c31feef4dfa4f -
Branch / Tag:
refs/tags/menlo-rcs-types-v0.1.1 - Owner: https://github.com/menloresearch
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
menlo-rcs-types-publish.yml@73b0b26a567ee87e1d40237c1a4c31feef4dfa4f -
Trigger Event:
push
-
Statement type:
File details
Details for the file menlo_rcs_types-0.1.1-py3-none-any.whl.
File metadata
- Download URL: menlo_rcs_types-0.1.1-py3-none-any.whl
- Upload date:
- Size: 9.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7310936912bdd1bf2eb8b58499409c757799387d7f2c0a6e61d3ebdde3a500ec
|
|
| MD5 |
ba6ab7f71924fc8acae6f1a8229e3f05
|
|
| BLAKE2b-256 |
594eb354363e947572786bb1faa0a18841f57f799984decbc1a3f6cf3c3f4f46
|
Provenance
The following attestation bundles were made for menlo_rcs_types-0.1.1-py3-none-any.whl:
Publisher:
menlo-rcs-types-publish.yml on menloresearch/mono
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
menlo_rcs_types-0.1.1-py3-none-any.whl -
Subject digest:
7310936912bdd1bf2eb8b58499409c757799387d7f2c0a6e61d3ebdde3a500ec - Sigstore transparency entry: 1732171262
- Sigstore integration time:
-
Permalink:
menloresearch/mono@73b0b26a567ee87e1d40237c1a4c31feef4dfa4f -
Branch / Tag:
refs/tags/menlo-rcs-types-v0.1.1 - Owner: https://github.com/menloresearch
-
Access:
internal
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
menlo-rcs-types-publish.yml@73b0b26a567ee87e1d40237c1a4c31feef4dfa4f -
Trigger Event:
push
-
Statement type: