Skip to content

Latest commit

 

History

History
64 lines (47 loc) · 2.54 KB

README.md

File metadata and controls

64 lines (47 loc) · 2.54 KB

Host protocol

The host protocol lets clients discover hosts, find notebooks, edit documents, and follow execution through HTTP requests and event streams.

Change a contract

Edit the definitions in packages/host-protocol. The Python and TypeScript bindings are generated from them and checked in. They should not be edited by hand.

Keep the specification, implementation, and relevant fixtures or tests in step with the change. After the repository development setup, run from the root:

make host-protocol-codegen
pnpm --dir packages/client codegen

make host-protocol-check
pnpm --dir packages/client codegen:check

The first command generates Python and the second generates TypeScript. The checks verify those outputs and run the portable fixtures.

Also run the package checks and tests for the implementation you changed. To check a host over a real connection, use the live conformance suite.

Get the OpenAPI document

No OpenAPI file is checked in. The package prints the document as JSON.

node packages/host-protocol/scripts/openapi.ts                 # the stable protocol
node packages/host-protocol/scripts/openapi.ts --experimental  # with experimental features

The script needs Node and the package's one dependency, which pnpm install --filter @marimo-team/host-protocol --prod installs.

To build on the stable protocol in another language, save the first output and point an OpenAPI generator at it. marimo's own bindings use the second, which adds every experimental feature.

Changing the stable protocol

CI compares the stable document with the base branch and fails when they differ. New work goes behind an experimental feature, which the check leaves out. For a deliberate change, add the stable-protocol-change label to the pull request. To run the comparison locally:

protocols/host/check-stable.sh origin/main