agentops-rpc
Shared Pydantic wire types for the AgentOps SDK and controlplane.
Both the SDK (komodor-agentops) and the controlplane import models from this
package, giving build-time (mypy) and runtime (Pydantic v2) type safety across
the wire boundary.
Install
pip install agentops-rpc
Quick Start
from agentops_rpc import RunEventIn, IngestRunEventsRequest, HOOK_EVENT_TYPE_MAP
event = RunEventIn(
event_type="span.started",
span_id="span_abc",
kind="tool",
name="Bash",
hook_event_type="tool.start",
)
event.model_dump() # JSON-safe dict
request = IngestRunEventsRequest(worker_id="wrk_1", events=[event])
Exported Models
types.py -- Literal type aliases
| Type | Values |
|---|---|
EventType |
run.started, run.completed, run.failed, span.started, span.ended, message.created, log.created, token.created, custom.created, output.updated |
RunStatus |
queued, claimed, running, succeeded, failed |
SpanKind |
agent, llm, tool, chain, generation |
HookEventName |
SessionStart, UserPromptSubmit, PreToolUse, PostToolUse, PostToolUseFailure, SubagentStart, SubagentStop, Notification, Stop, SessionEnd, PermissionRequest, PreCompact, PostCompact |
HookEventType |
session.start, prompt.submit, tool.start, tool.end, tool.error, subagent.start, subagent.end, notification, session.stop, compaction.start, compaction.end |
AgentStatus |
online, offline |
RunTransport |
polling, api_sync, api_sse, a2a |
events.py -- Event ingest models
RunEventIn-- unified event sent SDK -> controlplaneTraceEventIn,LogEventIn-- structured events for DB tablesIngestRunEventsRequest/IngestRunEventsResponseBatchEventsRequestTraceEventResponse,LogEventResponse,RunMessageResponse
runs.py -- Run lifecycle models
CreateRunRequest,RunSummary,RunDetail,RunJobPollNextRunRequest,ClaimRunResponseStartRunRequest,StartRunDirectRequestCompleteRunRequest,FailRunRequest,UpdateRunOutputRequestInvokeAgentRequest/InvokeAgentResponseWorkerInvokeRequest/WorkerInvokeResponse
agents.py -- Agent registration models
AgentManifest,HeartbeatRequest,HeartbeatResponseAgentInstanceResponse
hook_types.py -- Hook event mapping
HOOK_EVENT_TYPE_MAP-- maps Claude CodeHookEventNametoHookEventType
a2a.py -- A2A protocol wire types
A2AMessage,A2AMessagePartA2AMessageRequest,A2ATaskResponse
Type Safety Guarantees
| Layer | Protection |
|---|---|
| Build-time (mypy) | SDK and controlplane import the same Pydantic models -- field mismatches caught at type-check |
| Runtime (Pydantic) | Every event validated at construction and at API boundary |
| Wire (JSON) | model_dump() / model_validate() guarantee JSON matches schema |
| Hook events | HookEventType literal -- typos fail both type-check and runtime |
Adding a CP↔worker frame type
Four steps, none of them a Python edit. schemas/frames.schema.json is the hand-authored
source of truth; Python, Go and TypeScript are all generated from it, and no language is
privileged.
- Add the payload to
$defs, and bind it inx-agentops-frames("my_frame": "MyFramePayload"). LeaveadditionalPropertiesout rather than setting ittrue— the schema's own description explains why the two differ in generated Go. - Declare how it travels in
x-agentops-delivery—control(send now or fail now) orat-least-once(buffered, retried, may deliver twice, ordered perstream). There is no default and the generator refuses to run without one, because either default is wrong for half the types. - Add a fixture under
schemas/fixtures/(andfixtures/invalid/if the type has a constraint worth proving). A per-type coverage guard fails without one. - Run
make generate-frames. This writes the Python models and registry, the Go wire types, and the TypeScript bindings together — plus theMY_FRAMEconstant and the package's__all__, sofrom agentops_rpc.wire import MY_FRAME, MyFramePayloadworks with no further edit.make check-framesis the CI guard that the committed artifacts match the schema.
The one thing that does still cost a Python line is a payload with an inline sub-schema:
the registry binds top-level payload schemas, so a shape nested inside one is invisible to the
generator and each language names it differently. wire/__init__.py aliases it once (see
Event as RunEvent). A payload built only from $defs and scalars needs nothing.
Everything after that is feature code: a Router.on(MY_FRAME) handler on the worker side, a
caller on the control-plane side. See docs/reference/cp-worker-protocol.md
for how frames reach a worker and how a reply is correlated.
Dependencies
Only pydantic>=2.0. Zero internal dependencies.
Metadata
Release files for agentops-rpc 0.4.9
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 | |
|---|---|---|---|---|
| agentops_rpc-0.4.9.tar.gz | 175.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| agentops_rpc-0.4.9-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 346.5 kB
Release files / agentops_rpc-0.4.9.tar.gz
| Download URL | agentops_rpc-0.4.9.tar.gz |
|---|---|
| Size | 175.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b107364f64d7653db411137a6bee7b470081e242d3997c470278b8304fcec03a
|
|
BLAKE2b-256 checksum How to use checksums |
3ae7b4d7d2d1e6a7bc1a373766338140d51e8923792a783914bfdf019a07d958
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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 / agentops_rpc-0.4.9-py3-none-any.whl
| Download URL | agentops_rpc-0.4.9-py3-none-any.whl |
|---|---|
| Size | 171.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
293d327ca2dd8b334f7a4088009cda0b811136045081ae39341168557fd86fcd
|
|
BLAKE2b-256 checksum How to use checksums |
0c6a0eb4cfd0fb408dcf7e3c32353157a11e6e110414b9ba3499d354cd40f88f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
uv/0.11.13 {"installer":{"name":"uv","version":"0.11.13","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 agentops-rpc 0.4.9
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.