Examples
The programs behind the Quickstart and the Cookbook, published as the source that actually runs. Each one is executed end to end on every change to the SDK, the harness or these docs, so a page here cannot describe behaviour the code no longer has.
- The quickstart journey — The complete first-session program the Quickstart guide walks through: spawn a host, complete the handshake, start a session, run a turn and read it as it streams, answer an approval, cancel a turn, close the host, and reload the session in a new process.
- The shared harness — The small harness the journey and every recipe are written against: a host wrapper over the SDK’s public surface, the typed accessors that read a notification’s untyped
paramssafely, and the segment runner that turns a sequence of steps into one pass-or-fail report. - Answer the agent’s question (userInput) — The runnable source behind the cookbook page “Answer the agent’s question (userInput)”.
- Approve or deny the agent’s permission request — The runnable source behind the cookbook page “Approve or deny the agent’s permission request”.
- Cancel a turn while it is running — The runnable source behind the cookbook page “Cancel a turn while it is running”.
- Classify every way muse serve can exit — The runnable source behind the cookbook page “Classify every way muse serve can exit”.
- Handle a schema fingerprint mismatch — The runnable source behind the cookbook page “Handle a schema fingerprint mismatch”.
- List models and switch mid-session — The runnable source behind the cookbook page “List models and switch mid-session”.
- Retry a command without double-submitting — The runnable source behind the cookbook page “Retry a command without double-submitting”.
- Stream a turn’s answer into a UI — The runnable source behind the cookbook page “Stream a turn’s answer into a UI”.
- Survive the host dying under you — The runnable source behind the cookbook page “Survive the host dying under you”.
Comments that cite the repository these are developed in are removed when they are published; no executable line is changed.