Skip to content
Muse Code Developer Docs
Search
Ctrl
K
Cancel
Select theme
Dark
Light
Auto
Getting started
Overview
Quickstart
Guides
MSP concepts
MSP concepts
Sessions and turns
Commands and idempotency
Approvals
Resume
Exit classification
Durability profiles
The item-revision fold model
MSP wire protocol
MSP wire-level implementer's guide
Envelope and ids
Framing and caps
Backpressure
Errors
Conformance
Cookbook
About the cookbook
Stream a turn's answer into your UI
Approve or deny a tool call
Cancel a running turn
Survive the host dying under you
Handle a fingerprint mismatch
Classify every way the host can exit
List models and switch mid-session
Retry without double-submitting
Answer the agent's question
Examples
Overview
The quickstart journey
The shared harness
Answer the agent's question (userInput)
Approve or deny the agent's permission request
Cancel a turn while it is running
Classify every way muse serve can exit
Handle a schema fingerprint mismatch
List models and switch mid-session
Retry a command without double-submitting
Stream a turn's answer into a UI
Survive the host dying under you
Compatibility
What keeps working
Protocol changelog
SDK reference
Overview
AbnormalExit
ApprovalDecisionInput
ApprovalFailure
ApprovalFailureHandler
ApprovalHandler
checkServedFingerprint
COMMAND_REJECTED_CODE
COMMAND_REJECTED_KIND
CommandErrorResponse
CommandOptions
Connection
ConnectionOptions
createUuidV7Mint
DeltaApplyOutcome
DiscardedSessions
DuplexTransport
ExitClassification
EXPECTED_SCHEMA_FINGERPRINT
fingerprintMismatchMessage
FingerprintWarning
FoldedItem
FoldItems
FoldOutcome
FoldSessionState
GapFillFailureHandler
GapFillFailureReason
HostDeathDischarge
HostDeathNotification
isLaunchFailure
ItemApplyOutcome
ItemStore
MspError
MspHandshake
MuseClient
MuseClientOptions
MuseClientSpawnOptions
MuseForeignSessionError
MuseGapFillError
MuseHostDiedError
MuseServeChild
MuseServeChildOptions
MuseSessionDiscardedError
NotificationHandler
PendingApproval
PendingCommandAck
PendingCommandEntry
PendingCommandSet
PendingCommandSetOptions
PendingCommandView
PendingDisposition
PendingJoinPlan
PendingRetirement
ProcessExit
ProtocolError
ProtocolErrorHandler
readSessionDurability
ReplayAnswer
ResumeSessionOptions
RevisionedItem
SendUserTurnOptions
ServerRequestHandler
Session
SessionApplyOutcome
SessionApplyRefusal
SessionDurabilityProfile
SessionFold
SessionFoldView
SessionGapBuffered
SessionGapOverlap
SessionOpening
SessionOptions
SessionStateMethod
SessionStateParams
SessionStateStore
SnapshotJoinFacts
SpawnedMspConnection
spawnMspConnection
SpawnMspConnectionOptions
StaleDroppableMethod
StartSessionOptions
StateApplyOutcome
StateValue
TerminalUnknownItemAnnotation
TransportEof
Turn
TurnEntry
TurnOutcome
TurnState
ViewEvent
Wire protocol reference
Methods
Overview
approval/decide
approval/listPending
initialize
model/list
session/compact
session/fork
session/list
session/read
session/resume
session/setApprovalMode
session/setModel
session/start
session/userShell
subagent/close
subagent/followupTask
subagent/interrupt
subagent/readResult
subagent/reopen
subagent/resume
subagent/sendMessage
subagent/stop
turn/cancel
turn/interrupt
turn/start
turn/steer
turn/unqueue
userInput/answer
userInput/cancel
userInput/clarify
view/page
view/unsubscribe
Notifications
Overview
approval/requested
approval/resolved
approval/updated
initialized
item/completed
item/delta
item/started
item/updated
session/approvalModeChanged
session/branchChanged
session/contextUsage
session/goalChanged
session/modelChanged
session/todoListChanged
session/tokenUsage
turn/completed
turn/retracted
turn/retryScheduled
turn/started
turn/unqueued
userInput/requested
userInput/settled
view/gap
Errors
Overview
approvalAlreadyResolved (-32051)
approvalChoiceInvalid (-32052)
approvalNotFound (-32050)
approvalRequirementStale (-32053)
approvalReviewerUnavailable (-32054)
backpressured (-32031)
boundaryPruned (-32042)
cancelled (-32014)
capabilityRequired (-32010)
commandRejected (-32030)
forkBoundaryInvalid (-32023)
inputTooLarge (-32002)
internal (-32603)
interrupted (-32013)
invalidParams (-32602)
invalidRequest (-32600)
methodNotFound (-32601)
notFound (-32011)
overloaded (-32001)
parseError (-32700)
sessionAmbiguous (-32022)
sessionInUse (-32021)
sessionNotFound (-32020)
sessionNotLoaded (-32024)
sessionStreamMismatch (-32025)
userInputAlreadySettled (-32056)
userInputAnswerInvalid (-32057)
userInputNotFound (-32055)
viewTruncated (-32040)
Types
Overview
ApprovalAmendment
ApprovalAmendmentDurability
ApprovalChange
ApprovalChoice
ApprovalChoiceScope
ApprovalDecideParams
ApprovalDecideResult
ApprovalDecision
ApprovalListPendingParams
ApprovalListPendingResult
ApprovalMode
ApprovalModeApplyOutcome
ApprovalModeSource
ApprovalOrigin
ApprovalPersistenceStatus
ApprovalPolicyResult
ApprovalRequestParams
ApprovalRequirementRef
ApprovalResolutionSummary
ApprovalResolvedBy
ApprovalResolvedParams
ApprovalStage
ApprovalStageEvidence
ApprovalStageResolution
ApprovalSubject
ApprovalSuggestedPrefix
ApprovalUpdatedParams
BackgroundInitiator
BranchState
CapabilityName
ClientCapabilities
ClientInfo
CommandAcceptedResult
CommandAckStatus
CommandStatus
CompactionOutcome
CompactionTrigger
CompactStatus
ContextPressureLevel
ContextUsage
CumulativeTokenUsage
EffectiveApprovalModeState
EffectiveModel
ErrorData
ErrorKind
ErrorObject
ErrorResponse
ForkCutPoint
ForkProvenance
Goal
HistoryMode
HistoryNoneReason
HistoryPreference
IfBusy
InitializeParams
InitializeResult
Item
ItemCompletedParams
ItemDeltaParams
ItemKind
ItemStartedParams
ItemStatus
ItemUpdatedParams
JsonRpcVersion
MessageAttachment
ModelCatalogEntry
ModelCatalogSource
ModelChangeSource
ModelCost
ModelListParams
ModelListResult
ModelSelection
ModelVisibleContent
Notification
OutputRef
OutputRefAvailability
PendingApprovalPointer
PendingRequestKind
PendingRequestPointer
PendingUserInputPointer
PlatformFamily
PlatformOs
ReasoningEffort
RecordPosition
Request
RequestId
SchemaInfo
ServerInfo
Session
SessionApprovalModeChangedParams
SessionBranchChangedParams
SessionCompactParams
SessionCompactResult
SessionConfig
SessionContextUsageParams
SessionDurability
SessionForkParams
SessionForkResult
SessionGoalChangedParams
SessionHistory
SessionListParams
SessionListResult
SessionModelChangedParams
SessionReadParams
SessionReadResult
SessionResumeParams
SessionResumeResult
SessionSetApprovalModeParams
SessionSetApprovalModeResult
SessionSetModelParams
SessionSetModelResult
SessionStartParams
SessionStartResult
SessionStatus
SessionTodoListChangedParams
SessionTokenUsageParams
SessionUserShellParams
SessionUserShellResult
SnapshotAnchor
SnapshotState
SourceRange
StreamRef
SubagentControlStatus
SubagentInputParams
SubagentOwnerReasonParams
SubagentResult
SubagentTargetParams
SuccessResponse
TodoItem
TodoListState
TodoStatus
TokenUsage
TraceContext
TurnCancelParams
TurnCancelResult
TurnCompletedParams
TurnError
TurnErrorKind
TurnInputPart
TurnInputPartType
TurnInterruptParams
TurnInterruptResult
TurnRef
TurnRetractedParams
TurnRetryScheduledParams
TurnStartDisposition
TurnStartedParams
TurnStartParams
TurnStartResult
TurnSteerParams
TurnSteerResult
TurnTerminal
TurnUnqueuedParams
TurnUnqueueParams
TurnUnqueueResult
UnframedViewNotification
UnframedViewNotificationParams
UserInputAnswer
UserInputAnswerParams
UserInputAnswerResult
UserInputCancelParams
UserInputCancelResult
UserInputClarification
UserInputClarifyParams
UserInputClarifyResult
UserInputOption
UserInputOptionPreview
UserInputOutcome
UserInputQuestion
UserInputRequestParams
UserInputSelection
UserInputSelectionMode
UserInputSettledParams
UserInputSettlementSummary
Vcs
ViewGapParams
ViewPageAnchor
ViewPageDirection
ViewPageParams
ViewPageResolvedAnchor
ViewPageResult
ViewSnapshot
ViewUnsubscribeParams
ViewUnsubscribeResult
WorkflowChild
Capabilities
Overview
rawLog
userShell
Reserved identifiers
Overview
-32012
-32060..-32069
deprecationNotice
Select theme
Dark
Light
Auto
Developer Preview
Reserved
-32012
-32060..-32069
deprecationNotice
Source
schema/msp/experimental/msp.schema.json