SyncMuseClient
The blocking twin of MuseClient for plain scripts; async contexts — Jupyter cells included, since a cell already runs inside a live loop — use MuseClient directly.
Class in muse_code
Get one from spawn (an owned host) or create (a client you
compose yourself); every verb then blocks the calling thread while the
private loop runs the async facade. Call close to shut the host
down and release the loop.
Constructor
Section titled “Constructor”SyncMuseClient(client: MuseClient[_I], loop: asyncio.AbstractEventLoop)
Properties
Section titled “Properties”| Property | Type | Description |
|---|---|---|
initialize_result |
InitializeResult |
The handshake result, when built by spawn (no loop needed). |
durability |
SessionDurabilityProfile |
The durability profile every session this client opens inherits. |
Methods
Section titled “Methods”| Method | Signature | Description |
|---|---|---|
spawn |
spawn(options: MuseClientSpawnOptions) -> 'SyncMuseClient[Any]' |
Spawn an owned host and hand back a blocking client — the sync twin of spawn. |
create |
create(factory: Callable[[], Awaitable[MuseClient[_I]]]) -> 'SyncMuseClient[_I]' |
Build a blocking client around an async client you compose yourself — the sync twin of the MuseClient constructor. |
start_session |
start_session(options: StartSessionOptions | None = None) -> 'SyncSession[_I]' |
Open a new root session (blocking twin of start_session). |
resume_session |
resume_session(options: ResumeSessionOptions) -> 'SyncSession[_I]' |
Load an existing session (blocking twin of resume_session). |
list_sessions |
list_sessions(options: SessionListParams | None = None) -> SessionListResult |
List stored sessions (blocking twin of list_sessions). |
list_models |
list_models(options: ModelListParams | None = None) -> ModelListResult |
List the host’s model catalog (blocking twin of list_models). |
read_usage |
read_usage() -> UsageReadResult |
Read last-observed usage (blocking twin of read_usage). |
command |
command(method: str, params: Mapping[str, Any], *, command_id: str | None = None, max_attempts: int | None = None, retry_delay: RetryDelay | None = None) -> Params |
Send a wire method the facade does not wrap (blocking twin of command); facade-owned methods raise MuseFacadeOwnedMethodError before anything is written. |
wait_exit |
wait_exit() -> ExitClassification |
Block until the owned host exits; its exit-classification row (twin of exit). |
close |
close() -> None |
Shut the host down, then retire the private loop. |
Source
clients/sdk-py/src/muse_code/sync_facade.py:242