About the cookbook
Each page in this group solves one task you are likely to have while building
on @muse-code/sdk — npm install @muse-code/sdk: stream an answer into your
UI, ask your user to approve a tool call, cancel a turn they are watching,
handle a host that is newer than your SDK, and more as the cookbook grows.
Every recipe is real, runnable code, and it is yours. The program behind each
page lives in clients/sdk-cookbook/ of the SDK repository, which you can
clone:
git clone https://github.com/meta-models/muse-code-sdkEvery recipe runs on changes to this area — against a release-built muse
binary and against the committed conformance transcripts — so one that stops
working turns the build red instead of quietly going stale. The wire exchanges
you see on these pages are checked against those same committed transcripts on
every docs build.
If you have not run anything yet, start with the quickstart — it takes you from nothing to a working session. Come back here when you have a task-shaped question.
One note that applies to every recipe: the harness launches its hosts with
MUSE_EXPERIMENTAL_SDK_ENABLED set explicitly. muse serve now runs by
default; the variable survives as an off-switch, and the harness pins the run
open so an operator’s off in the environment cannot silently change what
these recipes prove. That is not advice for your application. It is how
this test harness launches a host today; build your client against
muse serve as a supported command.