Skip to content
Developer Preview

MuseClient

Your entry point to the SDK.

Spawn a host with MuseClient.spawn, then open conversations with startSession or resumeSession. The client owns the connection: it routes every server event to the session it belongs to and reports a host death to all of them. Call close to shut the host down cleanly.

Property Type Stability Presence Description
durability SessionDurabilityProfile required The durability profile every session this client opens inherits.
exit Promise<ExitClassification> required The host’s exit row, when this client was built by spawn.
initializeResult InitializeResult required The handshake result, when this client was built by spawn.
Method Signature Stability Description
constructor new MuseClient(connection: Connection, options: MuseClientOptions)
close close(): Promise<void> Shut the host down in an orderly way; the shutdown this causes is not reported to your sessions as a host death.
command command(method: "subagent/sendMessage" | "subagent/followupTask" | "subagent/interrupt" | "subagent/stop" | "subagent/resume" | "subagent/reopen" | "subagent/close" | "subagent/readResult" | "session/fork" | "session/leave" | "session/list" | "session/read" | "session/sideChat" | "turn/interrupt" | "turn/cancel" | "session/compact" | "session/setModel" | "session/rename" | "session/setReasoningEffort" | "session/userShell" | "model/list" | "skill/list" | "skill/setActivation" | "skill/import" | "hook/list" | "plugin/list" | "plugin/install" | "plugin/marketplaceAdd" | "plugin/marketplaceUpdate" | "plugin/marketplaceRemove" | "task/background" | "task/stop" | "task/stopAll" | "task/list" | "goal/set" | "goal/edit" | "goal/clear" | "goal/pause" | "goal/resume" | "workflow/cancel" | "workflow/childControl" | "workflow/pause" | "workflow/resume" | "media/upload" | "item/readOutput" | "approval/listPending" | "session/setApprovalMode" | "userInput/cancel" | "userInput/clarify" | "userInput/interrupt" | "usage/read" | "feedback/submit" | "recap/request" | "recap/cancel" | "computerUseSettings/read" | "computerUseSettings/update" | "computerUseSetup/read" | "computerUseSetup/start" | "computerUseSetup/check", params: Record<string, unknown>, options?: CommandOptions): Promise<Record<string, unknown>> Send a wire method directly, typically one the facade does not wrap, through the same Connection.command() the verbs use: the connection mints the commandId, retries a nothing-admitted refusal under the same id, and checks the ack’s echo. options are that seam’s own.
listModels listModels(options?: ModelListParams): Promise<ModelListResult> List the models the host accepts in Session.setModel (model/list). With sessionId, that session’s current model is flagged isActive. A query: rides request(), like listSessions.
listSessions listSessions(options?: SessionListParams): Promise<SessionListResult> List stored sessions (session/list), including text search via filter.text. A read-only list: rides request(), not command() (see Session.listTasks).
readUsage readUsage(): Promise<UsageReadResult> Read the host’s last-observed subscription usage (usage/read) without a model call; usage is absent when the host has observed nothing.
resumeSession resumeSession(options: ResumeSessionOptions): Promise<Session<unknown>> Load an existing session and subscribe this connection to its view.
startSession startSession(options?: StartSessionOptions): Promise<Session<unknown>> Open a new root session.
spawn static spawn(options: MuseClientSpawnOptions): Promise<MuseClient> Spawn an owned host, run the handshake, and hand back a client whose durability profile came from that handshake.
Source

clients/sdk-ts/src/facade/client.ts:293

{
"kind": "Class",
"canonicalPath": "MuseClient"
}