Skip to main content

Microcosm emitter interface

microcosm-emitter-interface is the small, dependency-free package a Microcosm build imports to hand work to the separately installed microcosm-emitter. Microcosm decides what to hand over; the emitter decides where it goes.

Install the emitter on its own, outside the build's environment:

uv tool install microcosm-emitter

The build then depends on this package with a version range and starts the emitter through it:

from microcosm_emitter_interface import EmitterClient, TelemetryRun, TelemetrySettings

client = EmitterClient.start(
    telemetry=TelemetrySettings(run=TelemetryRun("run-id", "UK", "uk-build")),
)
client.telemetry.transition_stage("calibrating")
client.telemetry.complete()
client.close()

EmitterClient.start runs the microcosm-emitter command as the build's own child process. The command comes from the command argument, then the MICROCOSM_EMITTER_COMMAND environment variable, then PATH. The child inherits the build's environment variables and user, so it finds the same Hugging Face credential: HF_TOKEN, then HUGGINGFACE_TOKEN, then the token saved by hf auth login.

No call raises into the build: not because the emitter is missing, slow or refusing a request, and not because an argument cannot be converted to JSON (for example a multi-element NumPy array or a self-referencing mapping). Each call converts its arguments inside its error handling and reports whether the emitter accepted it; after a refusal, client.last_failure says why (emitter_unavailable, invalid_arguments or not_accepted). Startup settings that cannot be converted start an unavailable client (invalid_configuration). The build continues in every case.

Compatibility

Both packages are released together with one version number, and microcosm-emitter==X requires microcosm-emitter-interface==X. A build, though, may run with a different emitter from the interface it depends on: it keeps the emitter it started with, and the next build uses whichever emitter is installed then. So the socket protocol carries its own version:

  • PROTOCOL_VERSION names the shape of every message this package sends. The emitter lists the versions it accepts in its hello answer, and the client refuses an emitter that does not list its version (unsupported_protocol_version); the build continues without it.
  • Every emitter release must accept every protocol version that interface releases still in use send. Adding a module or a message kind keeps the version; changing the shape of an existing message needs a new version, which emitters then accept alongside the old one.
  • fixtures/protocol-v<N>/ holds one JSON file per message of protocol version N, including how the command is started (host-launch.json: its arguments and the configuration object on standard input) and each socket request's whole envelope (host-ping.json, host-message-envelope.json, host-query-envelope.json, host-close.json, and host-hello.json). This package's tests check that each typed call, the launcher and the socket transport send exactly their fixture, and the emitter's contract tests check that it accepts every fixture of every version it supports, so a change to the command's arguments or the envelope cannot pass by changing both sides at once. An emitter's hello answer must contain the recorded keys and may add more. A released fixture is never edited or removed: the emitter's tests pin each one's SHA-256.
  • An emitter that lacks a module this package asks for starts without it (--skip-unavailable-modules); calls for that module report that they were not accepted.

Metadata

Release files for microcosm-emitter-interface 0.5.1

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

Source distribution (sdist)

Source distribution for microcosm-emitter-interface 0.5.1
File Size Uploaded Provenance
microcosm_emitter_interface-0.5.1.tar.gz 18.1 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for microcosm-emitter-interface 0.5.1
File Interpreter ABI Platform
microcosm_emitter_interface-0.5.1-py3-none-any.whl Python 3 none any Details

Total release size: 49.3 kB

Release files / microcosm_emitter_interface-0.5.1.tar.gz

Download URL microcosm_emitter_interface-0.5.1.tar.gz
Size 18.1 kB
Tags Source
SHA-256 checksum
How to use checksums
3669592b69ba9bd515f527a8c61624c3063777963f9b65ddec03afe28d148b0c
BLAKE2b-256 checksum
How to use checksums
9c52eb5b2d82953ee7916f65f20f58697e2952ed526f1a82df8a8f78eb28162f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Release files / microcosm_emitter_interface-0.5.1-py3-none-any.whl

Download URL microcosm_emitter_interface-0.5.1-py3-none-any.whl
Size 31.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
72d4d90ce2da72d67d8a1fd037b740d049800b1fc68734524855cc11529994e0
BLAKE2b-256 checksum
How to use checksums
7bc2f57e212f83c481091ce0ca04196c4409ade9713cf31590f8880c3ba66421
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

Security for microcosm-emitter-interface 0.5.1

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.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for microcosm_emitter_interface-0.5.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 21, 2026.

Transparency log

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.

Release history Release notifications | RSS feed

This release

0.5.1 This release

2 release files Full provenance

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