muse-code-msp 1.4.9__tar.gz → 1.4.11__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: muse-code-msp
3
- Version: 1.4.9
3
+ Version: 1.4.11
4
4
  Summary: Generated Python wire types for the Muse Session Protocol (MSP). No hand-written protocol types, ever.
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/meta-models/muse-code-sdk
@@ -5,7 +5,7 @@ build-backend = "setuptools.build_meta"
5
5
 
6
6
  [project]
7
7
  name = "muse-code-msp"
8
- version = "1.4.9"
8
+ version = "1.4.11"
9
9
  description = "Generated Python wire types for the Muse Session Protocol (MSP). No hand-written protocol types, ever."
10
10
  readme = "README.md"
11
11
  requires-python = ">=3.10"
@@ -7,10 +7,10 @@ from __future__ import annotations
7
7
 
8
8
  from typing import Any, Final, Literal, TypedDict
9
9
 
10
- SCHEMA_FINGERPRINT: Final[str] = "sha256:5d3b43e5ccdb7dc4f5a32c380f5f2cde0f10e3059b93610afb2e73f73b1d914c"
10
+ SCHEMA_FINGERPRINT: Final[str] = "sha256:f282ad16e21520d0cda68cb190149b86e2b062eef1dd282749360c05aa3d1082"
11
11
  SCHEMA_VERSION: Final[int] = 1
12
12
  EXPERIMENTAL: Final[bool] = False
13
- REQUIRED_HOST_VERSION: Final[str] = "1.4.9"
13
+ REQUIRED_HOST_VERSION: Final[str] = "1.4.11"
14
14
 
15
15
  ApprovalAmendmentDurability = str # open enum: unknown values stay representable
16
16
  APPROVAL_AMENDMENT_DURABILITY_KNOWN_VALUES: Final[tuple[str, ...]] = ("session", "localPersistent",)
@@ -143,7 +143,7 @@ IfBusy = Literal["queue", "steer", "replace"]
143
143
 
144
144
  # The eleven v1 item kinds plus post-v1 kinds. Open: a new kind is additive evolution, and clients MUST render unknown kinds generically.
145
145
  ItemKind = str # open enum: unknown values stay representable
146
- ITEM_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("userMessage", "agentMessage", "reasoning", "toolCall", "userShell", "subagent", "workflow", "reminderChild", "compaction", "hookRun", "sideChat", "webSearch", "monitorFeed",)
146
+ ITEM_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("userMessage", "agentMessage", "reasoning", "toolCall", "userShell", "subagent", "workflow", "reminderChild", "compaction", "hookRun", "sideChat", "webSearch", "monitorFeed", "damagedRange", "scheduledFire",)
147
147
 
148
148
  # The `item/readOutput` content encoding. Closed: text media is ALWAYS `utf8` and binary media `base64`; a third value would change the client's decode contract.
149
149
  ItemReadOutputEncoding = Literal["utf8", "base64"]
@@ -210,6 +210,21 @@ RECAP_FAILURE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("providerFailed",)
210
210
  RecapOutcome = str # open enum: unknown values stay representable
211
211
  RECAP_OUTCOME_KNOWN_VALUES: Final[tuple[str, ...]] = ("completed", "failed", "cancelled", "timedOut",)
212
212
 
213
+ # Proven effective-choice provenance, independently of input presence.
214
+ RecoveryEffectiveSource = str # open enum: unknown values stay representable
215
+ RECOVERY_EFFECTIVE_SOURCE_KNOWN_VALUES: Final[tuple[str, ...]] = ("request", "retained", "legacyOmission", "hostPolicy", "unknown",)
216
+
217
+ # A requested construction choice; omission is distinct from explicit OFF.
218
+ RecoveryMode = Literal["on", "off"]
219
+
220
+ # A proven mode or unknown; future strings cannot establish OFF.
221
+ RecoveryObservedMode = str # open enum: unknown values stay representable
222
+ RECOVERY_OBSERVED_MODE_KNOWN_VALUES: Final[tuple[str, ...]] = ("on", "off", "unknown",)
223
+
224
+ # This construction's assessment, never an operation acceptance receipt.
225
+ RecoveryQualification = str # open enum: unknown values stay representable
226
+ RECOVERY_QUALIFICATION_KNOWN_VALUES: Final[tuple[str, ...]] = ("qualified", "unavailable", "notRequired", "unknown",)
227
+
213
228
  # A request id: client-chosen string or integer. `1` and `"1"` do not compare equal; each direction owns its own id space.
214
229
  RequestId = int | str
215
230
 
@@ -227,7 +242,7 @@ SANDBOX_UNAVAILABLE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("userNamespac
227
242
 
228
243
  # The closed-reason vocabulary. Server-produced and published OPEN by owner ruling — the menu-B pick, which settles that this notification reason enum publishes open rather than resting on E2's result-vocabulary rule by analogy. A crash is deliberately not a reason, because a crash emits no notification at all.
229
244
  SessionClosedReason = str # open enum: unknown values stay representable
230
- SESSION_CLOSED_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("idle", "hostShutdown",)
245
+ SESSION_CLOSED_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("idle", "hostShutdown", "leave",)
231
246
 
232
247
  # Whether this host writes its sessions to disk. A property of the host process, fixed at construction and identical for every session and every connection it serves — never requested, granted, or negotiated, which is why it is not a capability. Open: the unrepresented degraded state has candidate resolutions that add a third value here, so closed would make that a breaking change.
233
248
  SessionDurability = str # open enum: unknown values stay representable
@@ -237,6 +252,14 @@ SESSION_DURABILITY_KNOWN_VALUES: Final[tuple[str, ...]] = ("durable", "ephemeral
237
252
  SessionKind = str # open enum: unknown values stay representable
238
253
  SESSION_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("root", "subagent",)
239
254
 
255
+ # Current producer failure reasons for `session/leaveCompleted`; receiver-open for additive future reasons.
256
+ SessionLeaveFailureReason = str # open enum: unknown values stay representable
257
+ SESSION_LEAVE_FAILURE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("timeout", "responseUndelivered", "persistenceFailed", "runtimeFailed", "abandoned",)
258
+
259
+ # Current producer outcomes for `session/leaveCompleted`; receiver-open.
260
+ SessionLeaveOutcome = str # open enum: unknown values stay representable
261
+ SESSION_LEAVE_OUTCOME_KNOWN_VALUES: Final[tuple[str, ...]] = ("released", "failed",)
262
+
240
263
  # A served session field `session/list` text search reads. The client selects it, so the set is closed.
241
264
  SessionListTextField = Literal["name", "title"]
242
265
 
@@ -267,6 +290,9 @@ SkillActivationState = Literal["on", "userInvocableOnly", "off"]
267
290
  # `skill/import` foreign ecosystem. **Closed**: a client-selected write vocabulary — a write must fail an ecosystem the host does not implement rather than import from an unknown dir. The host resolves its own foreign dir (the `foreign_skills_sources` derivation); no client paths cross the wire.
268
291
  SkillImportSource = Literal["claude", "codex"]
269
292
 
293
+ # A `skill` input part's picked-copy source: the catalog-row `source` enum values, sent by the TUI on every skill submit so the host resolves the exact `(selector, source)` row. **Closed**: a client-selected write vocabulary — an unknown value is `invalidParams`, never a fall-through to the bare row. Contrast the open read-side [`SkillSource`].
294
+ SkillInvocationSource = Literal["bundled", "user", "project", "plugin"]
295
+
270
296
  # A skill row's source scope: the projection of the skills crate's `SkillsSourceScope`. Open: a future scope value is additive.
271
297
  SkillSource = str # open enum: unknown values stay representable
272
298
  SKILL_SOURCE_KNOWN_VALUES: Final[tuple[str, ...]] = ("bundled", "user", "project", "plugin",)
@@ -763,6 +789,19 @@ class CumulativeTokenUsage(_CumulativeTokenUsageBase, total=False):
763
789
  cost: CumulativeCost
764
790
 
765
791
 
792
+ class _DamagedRangeBase(TypedDict):
793
+ missingRecords: int
794
+ readableAfterAt: str
795
+ unreadableLines: int
796
+
797
+
798
+ class DamagedRange(_DamagedRangeBase, total=False):
799
+ """`damagedRange`: what one damaged range of the session log cost. The reader finds the range in the log bytes; no log record is written for it, so every member is derived from the readable records around it."""
800
+
801
+ lastGoodTurnId: str
802
+ readableBeforeAt: str
803
+
804
+
766
805
  class EffectiveApprovalModeState(TypedDict):
767
806
  """The effective approval-mode projection: the same object `session/setApprovalMode` returns as `effectiveMode` and the `Session` object carries as `approvalMode`."""
768
807
 
@@ -807,6 +846,7 @@ class ErrorData(_ErrorDataBase, total=False):
807
846
  outputRef: str
808
847
  paths: list[str]
809
848
  reason: str
849
+ recoveryObservation: RecoveryObservation
810
850
  resolution: ApprovalResolutionSummary
811
851
  retryable: bool
812
852
  seedFallbackReason: str
@@ -894,8 +934,10 @@ class _GoalBase(TypedDict):
894
934
  class Goal(_GoalBase, total=False):
895
935
  """The session goal block. `status` and `percentComplete` are carried **verbatim** — out-of-contract status strings and >100 percents pass through; display clamping is the renderer's job."""
896
936
 
937
+ createdAtMs: int
897
938
  currentWork: str
898
939
  nextWork: str
940
+ updatedAtMs: int
899
941
 
900
942
 
901
943
  class GoalClearParams(TypedDict):
@@ -1022,7 +1064,9 @@ class Item(_ItemBase, total=False):
1022
1064
  commandText: str
1023
1065
  controlStatus: SubagentControlStatus
1024
1066
  cutOff: bool
1067
+ damagedRange: DamagedRange
1025
1068
  declaredPhase: str
1069
+ deliveryNumber: int
1026
1070
  depth: int
1027
1071
  displayLabel: ToolDisplayLabel
1028
1072
  displayText: str
@@ -1037,12 +1081,14 @@ class Item(_ItemBase, total=False):
1037
1081
  finalSummary: str
1038
1082
  generationId: int
1039
1083
  hookKey: str
1084
+ jobId: str
1040
1085
  label: str
1041
1086
  message: str
1042
1087
  messagePhase: MessagePhase
1043
1088
  modelVisibleContent: list[ModelVisibleContent]
1044
1089
  monitorDescription: str
1045
1090
  monitorId: str
1091
+ nextFireAtMs: int
1046
1092
  objective: str
1047
1093
  outcome: CompactionOutcome
1048
1094
  outputRef: OutputRef
@@ -1058,6 +1104,7 @@ class Item(_ItemBase, total=False):
1058
1104
  retracted: bool
1059
1105
  role: str
1060
1106
  runStatus: HookRunStatus
1107
+ scheduledFireAtMs: int
1061
1108
  scriptId: str
1062
1109
  sideSessionId: str
1063
1110
  statusAttempt: StatusAttempt
@@ -1282,6 +1329,52 @@ class ModelVisibleContent(_ModelVisibleContentBase, total=False):
1282
1329
  width: int
1283
1330
 
1284
1331
 
1332
+ class _MonitorInboxItemAdmittedParamsBase(TypedDict):
1333
+ body: str
1334
+ eventIndex: int
1335
+ eventKind: str
1336
+ itemId: str
1337
+ queuedAt: str
1338
+ sessionId: str
1339
+ showLines: bool
1340
+ sourceRange: SourceRange
1341
+ summary: str
1342
+ taskId: str
1343
+ viewCursor: str
1344
+
1345
+
1346
+ class MonitorInboxItemAdmittedParams(_MonitorInboxItemAdmittedParamsBase, total=False):
1347
+ """`monitor/inboxItemAdmitted` params: one monitor inbox admission — the fold keys gate-off consumes."""
1348
+
1349
+ displayBody: str
1350
+ lineIndex: int
1351
+
1352
+
1353
+ class _MonitorInboxItemDrainedParamsBase(TypedDict):
1354
+ deliveryVisible: bool
1355
+ drainedAt: str
1356
+ itemId: str
1357
+ sessionId: str
1358
+ sourceRange: SourceRange
1359
+ viewCursor: str
1360
+
1361
+
1362
+ class MonitorInboxItemDrainedParams(_MonitorInboxItemDrainedParamsBase, total=False):
1363
+ """`monitor/inboxItemDrained` params: one monitor inbox drain — a consumption marker with its recorded stamp."""
1364
+
1365
+ drainTargetRunStream: StreamRef
1366
+
1367
+
1368
+ class MonitorInboxItemVoidedParams(TypedDict):
1369
+ """`monitor/inboxItemVoided` params: one wake-missed void — count-only, no transcript row."""
1370
+
1371
+ itemId: str
1372
+ sessionId: str
1373
+ sourceRange: SourceRange
1374
+ viewCursor: str
1375
+ voidedAt: str
1376
+
1377
+
1285
1378
  class _NotificationBase(TypedDict):
1286
1379
  jsonrpc: JsonRpcVersion
1287
1380
  method: str
@@ -1564,6 +1657,17 @@ class RecordPosition(TypedDict):
1564
1657
  sequence: int
1565
1658
 
1566
1659
 
1660
+ class RecoveryObservation(TypedDict):
1661
+ """One coherent producer snapshot; all members are required and non-null."""
1662
+
1663
+ constructionId: str
1664
+ effectiveMode: RecoveryObservedMode
1665
+ effectiveSource: RecoveryEffectiveSource
1666
+ qualification: RecoveryQualification
1667
+ requestedMode: RecoveryObservedMode
1668
+ sessionId: str
1669
+
1670
+
1567
1671
  class _RequestBase(TypedDict):
1568
1672
  id: RequestId
1569
1673
  jsonrpc: JsonRpcVersion
@@ -1656,7 +1760,7 @@ class SessionBranchChangedParams(_SessionBranchChangedParamsBase, total=False):
1656
1760
 
1657
1761
 
1658
1762
  class SessionClosedParams(TypedDict):
1659
- """`session/closed` params: a loaded session was unloaded from this host, broadcast to every initialized connection. After it, the session is `notLoaded`; the log remains on disk and `session/resume` reloads it. A crash emits nothing — only the two orderly unload paths do, and both write the durable `SessionEnd` record first."""
1763
+ """`session/closed` params: a loaded session was unloaded from this host, broadcast to every initialized connection. After it, the session is `notLoaded`; the log remains on disk and `session/resume` reloads it. A crash emits nothing — only the orderly unload paths do (idle unload, host shutdown and a released `session/leave`), and each writes the durable `SessionEnd` record first."""
1660
1764
 
1661
1765
  reason: SessionClosedReason
1662
1766
  sessionId: str
@@ -1747,6 +1851,37 @@ class SessionHistory(_SessionHistoryBase, total=False):
1747
1851
  noneReason: HistoryNoneReason
1748
1852
 
1749
1853
 
1854
+ class _SessionLeaveCompletedParamsBase(TypedDict):
1855
+ commandId: str
1856
+ outcome: SessionLeaveOutcome
1857
+ sessionId: str
1858
+
1859
+
1860
+ class SessionLeaveCompletedParams(_SessionLeaveCompletedParamsBase, total=False):
1861
+ """Params of the protected, non-view leave terminal notification."""
1862
+
1863
+ reason: SessionLeaveFailureReason
1864
+ viewCursor: str
1865
+
1866
+
1867
+ class _SessionLeaveParamsBase(TypedDict):
1868
+ commandId: str
1869
+ sessionId: str
1870
+
1871
+
1872
+ class SessionLeaveParams(_SessionLeaveParamsBase, total=False):
1873
+ """`session/leave` params."""
1874
+
1875
+ stop: bool
1876
+
1877
+
1878
+ class SessionLeaveResult(TypedDict):
1879
+ """The admission-only `session/leave` result."""
1880
+
1881
+ commandId: str
1882
+ status: CommandAckStatus
1883
+
1884
+
1750
1885
  class SessionListBranchFilter(TypedDict):
1751
1886
  """Exact branch selection."""
1752
1887
 
@@ -1863,6 +1998,7 @@ class SessionReadResult(_SessionReadResultBase, total=False):
1863
1998
  """`session/read` result. The `viewCursor` is the fold head at read time — a point-in-time read, immediately stale if a foreign host is appending."""
1864
1999
 
1865
2000
  lastTurn: LastTurn
2001
+ recoveryObservation: RecoveryObservation
1866
2002
 
1867
2003
 
1868
2004
  class SessionReasoningEffortChangedParams(TypedDict):
@@ -1907,6 +2043,7 @@ class SessionResumeParams(_SessionResumeParamsBase, total=False):
1907
2043
  excludeItems: bool
1908
2044
  history: HistoryPreference
1909
2045
  permissionProfile: str
2046
+ recoveryMode: RecoveryMode
1910
2047
 
1911
2048
 
1912
2049
  class _SessionResumeResultBase(TypedDict):
@@ -1997,6 +2134,7 @@ class SessionStartParams(_SessionStartParamsBase, total=False):
1997
2134
  modelId: str
1998
2135
  permissionProfile: str
1999
2136
  providerId: str | None
2137
+ recoveryMode: RecoveryMode
2000
2138
  sessionId: str
2001
2139
  workspaceRoot: str
2002
2140
  workspaceRoots: list[str]
@@ -2331,6 +2469,7 @@ class _SubagentResultBase(TypedDict):
2331
2469
  class SubagentResult(_SubagentResultBase, total=False):
2332
2470
  """A subagent's result envelope."""
2333
2471
 
2472
+ drained: bool
2334
2473
  errorKind: str
2335
2474
  structuredData: dict[str, Any]
2336
2475
  text: str
@@ -2559,6 +2698,7 @@ class TurnInputPart(_TurnInputPartBase, total=False):
2559
2698
  height: int
2560
2699
  mediaType: str
2561
2700
  selector: str
2701
+ source: SkillInvocationSource
2562
2702
  text: str
2563
2703
  uploadId: str
2564
2704
  width: int
@@ -3183,6 +3323,7 @@ METHODS: Final[dict[str, MethodSpec]] = {
3183
3323
  "recap/request": {"description": "Requests a \"while you were away\" recap for a loaded session; acks \\ `accepted` and settles exactly once on `recap/completed` — one \\ in flight per session, host-enforced 45s timeout.", "params": "RecapRequestParams", "result": "RecapRequestResult"},
3184
3324
  "session/compact": {"description": "Compacts the session's conversation context; runs asynchronously, so the ack is admission only.", "params": "SessionCompactParams", "result": "SessionCompactResult"},
3185
3325
  "session/fork": {"description": "Branches a session into a new id whose log copies the source through a cut point, with durable provenance.", "params": "SessionForkParams", "result": "SessionForkResult"},
3326
+ "session/leave": {"description": "Admits release of one loaded session; final release or failure is pushed through session/leaveCompleted.", "params": "SessionLeaveParams", "result": "SessionLeaveResult"},
3186
3327
  "session/list": {"description": "Pages through stored sessions under the sessions root for history and picker UIs; read-only, never touches leases.", "params": "SessionListParams", "result": "SessionListResult"},
3187
3328
  "session/read": {"description": "Reads one stored session without attaching: no lease, no load, no subscription, no resume record.", "params": "SessionReadParams", "result": "SessionReadResult"},
3188
3329
  "session/rename": {"description": "Sets or changes the durable allocated session name through the runtime session_name command; withheld under the ephemeral profile.", "params": "SessionRenameParams", "result": "SessionRenameResult"},
@@ -3238,14 +3379,18 @@ NOTIFICATIONS: Final[dict[str, NotificationSpec]] = {
3238
3379
  "item/delta": {"description": "Streaming append to an open item's field path (ephemeral-sourced, no sourceRange; opt-out-able).", "params": "ItemDeltaParams"},
3239
3380
  "item/started": {"description": "An item opened on the transcript.", "params": "ItemStartedParams"},
3240
3381
  "item/updated": {"description": "An open item changed non-terminally: full re-emission at a higher revision.", "params": "ItemUpdatedParams"},
3382
+ "monitor/inboxItemAdmitted": {"description": "One monitor inbox admission: the fold keys gate-off consumes \\.", "params": "MonitorInboxItemAdmittedParams"},
3383
+ "monitor/inboxItemDrained": {"description": "One monitor inbox drain with its recorded stamp, the \\ drain-side operand of latest-wins.", "params": "MonitorInboxItemDrainedParams"},
3384
+ "monitor/inboxItemVoided": {"description": "One wake-missed void with its recorded stamp; count-only, \\ no transcript row.", "params": "MonitorInboxItemVoidedParams"},
3241
3385
  "plugin/changed": {"description": "An install landed; carries the installed-row summary and clients re-issue `plugin/list`.", "params": "PluginChangedParams"},
3242
3386
  "plugin/marketplaceChanged": {"description": "A marketplace was added, updated, or removed; carries the change summary.", "params": "PluginMarketplaceChangedParams"},
3243
3387
  "recap/completed": {"description": "A recap request settled exactly once — `completed` (with \\ `text` plus optional `title`), `failed` (`providerFailed`), \\ `cancelled`, or `timedOut` — delivered to the requesting \\ connection outside the view stream.", "params": "RecapCompletedParams"},
3244
3388
  "session/approvalModeChanged": {"description": "The approval enforcement mode changed: the fold of the durable reconfigure audit fact.", "params": "SessionApprovalModeChangedParams"},
3245
3389
  "session/branchChanged": {"description": "A durable workspace-branch observation landed; null branch is a detached-HEAD fact.", "params": "SessionBranchChangedParams"},
3246
- "session/closed": {"description": "A loaded session was unloaded (idle | hostShutdown) with the final view cursor; broadcast to every initialized connection.", "params": "SessionClosedParams"},
3390
+ "session/closed": {"description": "A loaded session was unloaded (idle | hostShutdown | leave) with the final view cursor; broadcast to every initialized connection.", "params": "SessionClosedParams"},
3247
3391
  "session/contextUsage": {"description": "A provider-reported context-occupancy fact folded to a changed (windowTokens, usedTokens, pressure) triple.", "params": "SessionContextUsageParams"},
3248
3392
  "session/goalChanged": {"description": "The session's goal block changed value; replace wholesale, an explicit null clears.", "params": "SessionGoalChangedParams"},
3393
+ "session/leaveCompleted": {"description": "Protected correlated terminal for an admitted session/leave.", "params": "SessionLeaveCompletedParams"},
3249
3394
  "session/listChanged": {"description": "The changed session/list row, full-row replace; opt-in per connection via the sessionListStream capability, never subscription-gated.", "params": "SessionListChangedParams"},
3250
3395
  "session/modelChanged": {"description": "A durable model selection took effect.", "params": "SessionModelChangedParams"},
3251
3396
  "session/modelRouteUnserved": {"description": "An accepted login credential update installed a provider that cannot serve the session's standing model route; the standing selection is unchanged and a routable session/setModel repairs it.", "params": "SessionModelRouteUnservedParams"},
@@ -7,10 +7,10 @@ from __future__ import annotations
7
7
 
8
8
  from typing import Any, Final, Literal, TypedDict
9
9
 
10
- SCHEMA_FINGERPRINT: Final[str] = "sha256:e8b3d24f3922af8e567838a9ebdf8a28b64e6e0ddb516689f1a760e46c2f7fa1"
10
+ SCHEMA_FINGERPRINT: Final[str] = "sha256:195aeec21350d8a9a6979eaaa16edb06c7b7017ebc4130e96966ea30ee435614"
11
11
  SCHEMA_VERSION: Final[int] = 1
12
12
  EXPERIMENTAL: Final[bool] = True
13
- REQUIRED_HOST_VERSION: Final[str] = "1.4.9"
13
+ REQUIRED_HOST_VERSION: Final[str] = "1.4.11"
14
14
 
15
15
  # How a login flow ended. Server-produced, so the vocabulary is open per the E2 rule — a future flow may end in a new way additively.
16
16
  AccountLoginOutcome = str # open enum: unknown values stay representable
@@ -162,7 +162,7 @@ IfBusy = Literal["queue", "steer", "replace"]
162
162
 
163
163
  # The eleven v1 item kinds plus post-v1 kinds. Open: a new kind is additive evolution, and clients MUST render unknown kinds generically.
164
164
  ItemKind = str # open enum: unknown values stay representable
165
- ITEM_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("userMessage", "agentMessage", "reasoning", "toolCall", "userShell", "subagent", "workflow", "reminderChild", "compaction", "hookRun", "sideChat", "webSearch", "monitorFeed", "skillRead",)
165
+ ITEM_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("userMessage", "agentMessage", "reasoning", "toolCall", "userShell", "subagent", "workflow", "reminderChild", "compaction", "hookRun", "sideChat", "webSearch", "monitorFeed", "damagedRange", "scheduledFire", "skillRead",)
166
166
 
167
167
  # The `item/readOutput` content encoding. Closed: text media is ALWAYS `utf8` and binary media `base64`; a third value would change the client's decode contract.
168
168
  ItemReadOutputEncoding = Literal["utf8", "base64"]
@@ -281,6 +281,21 @@ RECAP_FAILURE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("providerFailed",)
281
281
  RecapOutcome = str # open enum: unknown values stay representable
282
282
  RECAP_OUTCOME_KNOWN_VALUES: Final[tuple[str, ...]] = ("completed", "failed", "cancelled", "timedOut",)
283
283
 
284
+ # Proven effective-choice provenance, independently of input presence.
285
+ RecoveryEffectiveSource = str # open enum: unknown values stay representable
286
+ RECOVERY_EFFECTIVE_SOURCE_KNOWN_VALUES: Final[tuple[str, ...]] = ("request", "retained", "legacyOmission", "hostPolicy", "unknown",)
287
+
288
+ # A requested construction choice; omission is distinct from explicit OFF.
289
+ RecoveryMode = Literal["on", "off"]
290
+
291
+ # A proven mode or unknown; future strings cannot establish OFF.
292
+ RecoveryObservedMode = str # open enum: unknown values stay representable
293
+ RECOVERY_OBSERVED_MODE_KNOWN_VALUES: Final[tuple[str, ...]] = ("on", "off", "unknown",)
294
+
295
+ # This construction's assessment, never an operation acceptance receipt.
296
+ RecoveryQualification = str # open enum: unknown values stay representable
297
+ RECOVERY_QUALIFICATION_KNOWN_VALUES: Final[tuple[str, ...]] = ("qualified", "unavailable", "notRequired", "unknown",)
298
+
284
299
  # A request id: client-chosen string or integer. `1` and `"1"` do not compare equal; each direction owns its own id space.
285
300
  RequestId = int | str
286
301
 
@@ -302,7 +317,7 @@ SANDBOX_UNAVAILABLE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("userNamespac
302
317
 
303
318
  # The closed-reason vocabulary. Server-produced and published OPEN by owner ruling — the menu-B pick, which settles that this notification reason enum publishes open rather than resting on E2's result-vocabulary rule by analogy. A crash is deliberately not a reason, because a crash emits no notification at all.
304
319
  SessionClosedReason = str # open enum: unknown values stay representable
305
- SESSION_CLOSED_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("idle", "hostShutdown",)
320
+ SESSION_CLOSED_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("idle", "hostShutdown", "leave",)
306
321
 
307
322
  # Whether this host writes its sessions to disk. A property of the host process, fixed at construction and identical for every session and every connection it serves — never requested, granted, or negotiated, which is why it is not a capability. Open: the unrepresented degraded state has candidate resolutions that add a third value here, so closed would make that a breaking change.
308
323
  SessionDurability = str # open enum: unknown values stay representable
@@ -312,6 +327,14 @@ SESSION_DURABILITY_KNOWN_VALUES: Final[tuple[str, ...]] = ("durable", "ephemeral
312
327
  SessionKind = str # open enum: unknown values stay representable
313
328
  SESSION_KIND_KNOWN_VALUES: Final[tuple[str, ...]] = ("root", "subagent",)
314
329
 
330
+ # Current producer failure reasons for `session/leaveCompleted`; receiver-open for additive future reasons.
331
+ SessionLeaveFailureReason = str # open enum: unknown values stay representable
332
+ SESSION_LEAVE_FAILURE_REASON_KNOWN_VALUES: Final[tuple[str, ...]] = ("timeout", "responseUndelivered", "persistenceFailed", "runtimeFailed", "abandoned",)
333
+
334
+ # Current producer outcomes for `session/leaveCompleted`; receiver-open.
335
+ SessionLeaveOutcome = str # open enum: unknown values stay representable
336
+ SESSION_LEAVE_OUTCOME_KNOWN_VALUES: Final[tuple[str, ...]] = ("released", "failed",)
337
+
315
338
  # A served session field `session/list` text search reads. The client selects it, so the set is closed.
316
339
  SessionListTextField = Literal["name", "title"]
317
340
 
@@ -348,6 +371,9 @@ SkillActivationState = Literal["on", "userInvocableOnly", "off"]
348
371
  # `skill/import` foreign ecosystem. **Closed**: a client-selected write vocabulary — a write must fail an ecosystem the host does not implement rather than import from an unknown dir. The host resolves its own foreign dir (the `foreign_skills_sources` derivation); no client paths cross the wire.
349
372
  SkillImportSource = Literal["claude", "codex"]
350
373
 
374
+ # A `skill` input part's picked-copy source: the catalog-row `source` enum values, sent by the TUI on every skill submit so the host resolves the exact `(selector, source)` row. **Closed**: a client-selected write vocabulary — an unknown value is `invalidParams`, never a fall-through to the bare row. Contrast the open read-side [`SkillSource`].
375
+ SkillInvocationSource = Literal["bundled", "user", "project", "plugin"]
376
+
351
377
  # A skill row's source scope: the projection of the skills crate's `SkillsSourceScope`. Open: a future scope value is additive.
352
378
  SkillSource = str # open enum: unknown values stay representable
353
379
  SKILL_SOURCE_KNOWN_VALUES: Final[tuple[str, ...]] = ("bundled", "user", "project", "plugin",)
@@ -516,6 +542,7 @@ class _AdmissionRequestParamsBase(TypedDict):
516
542
  class AdmissionRequestParams(_AdmissionRequestParamsBase, total=False):
517
543
  """`admission/request` + `admission/requested` payload: the server→client prompt and its cursor-bearing durable fold carry the same payload, so a gapped client recovers it via `view/page`."""
518
544
 
545
+ heldBody: str
519
546
  requesterWorkspace: str
520
547
 
521
548
 
@@ -533,6 +560,7 @@ class _AdmissionRequestedViewParamsBase(TypedDict):
533
560
  class AdmissionRequestedViewParams(_AdmissionRequestedViewParamsBase, total=False):
534
561
  """`admission/requested` view event: the cursor-bearing durable fold of the prompt, so a gapped client recovers the identical payload via `view/page`."""
535
562
 
563
+ heldBody: str
536
564
  requesterWorkspace: str
537
565
 
538
566
 
@@ -1000,6 +1028,19 @@ class CumulativeTokenUsage(_CumulativeTokenUsageBase, total=False):
1000
1028
  cost: CumulativeCost
1001
1029
 
1002
1030
 
1031
+ class _DamagedRangeBase(TypedDict):
1032
+ missingRecords: int
1033
+ readableAfterAt: str
1034
+ unreadableLines: int
1035
+
1036
+
1037
+ class DamagedRange(_DamagedRangeBase, total=False):
1038
+ """`damagedRange`: what one damaged range of the session log cost. The reader finds the range in the log bytes; no log record is written for it, so every member is derived from the readable records around it."""
1039
+
1040
+ lastGoodTurnId: str
1041
+ readableBeforeAt: str
1042
+
1043
+
1003
1044
  class EffectiveApprovalModeState(TypedDict):
1004
1045
  """The effective approval-mode projection: the same object `session/setApprovalMode` returns as `effectiveMode` and the `Session` object carries as `approvalMode`."""
1005
1046
 
@@ -1065,6 +1106,7 @@ class ErrorData(_ErrorDataBase, total=False):
1065
1106
  paths: list[str]
1066
1107
  projection: str
1067
1108
  reason: str
1109
+ recoveryObservation: RecoveryObservation
1068
1110
  requestedStream: StreamRef
1069
1111
  resolution: ApprovalResolutionSummary
1070
1112
  retryable: bool
@@ -1154,8 +1196,10 @@ class _GoalBase(TypedDict):
1154
1196
  class Goal(_GoalBase, total=False):
1155
1197
  """The session goal block. `status` and `percentComplete` are carried **verbatim** — out-of-contract status strings and >100 percents pass through; display clamping is the renderer's job."""
1156
1198
 
1199
+ createdAtMs: int
1157
1200
  currentWork: str
1158
1201
  nextWork: str
1202
+ updatedAtMs: int
1159
1203
 
1160
1204
 
1161
1205
  class GoalClearParams(TypedDict):
@@ -1284,7 +1328,9 @@ class Item(_ItemBase, total=False):
1284
1328
  commandText: str
1285
1329
  controlStatus: SubagentControlStatus
1286
1330
  cutOff: bool
1331
+ damagedRange: DamagedRange
1287
1332
  declaredPhase: str
1333
+ deliveryNumber: int
1288
1334
  depth: int
1289
1335
  displayLabel: ToolDisplayLabel
1290
1336
  displayText: str
@@ -1299,12 +1345,14 @@ class Item(_ItemBase, total=False):
1299
1345
  finalSummary: str
1300
1346
  generationId: int
1301
1347
  hookKey: str
1348
+ jobId: str
1302
1349
  label: str
1303
1350
  message: str
1304
1351
  messagePhase: MessagePhase
1305
1352
  modelVisibleContent: list[ModelVisibleContent]
1306
1353
  monitorDescription: str
1307
1354
  monitorId: str
1355
+ nextFireAtMs: int
1308
1356
  objective: str
1309
1357
  outcome: CompactionOutcome
1310
1358
  outputRef: OutputRef
@@ -1325,6 +1373,7 @@ class Item(_ItemBase, total=False):
1325
1373
  retracted: bool
1326
1374
  role: str
1327
1375
  runStatus: HookRunStatus
1376
+ scheduledFireAtMs: int
1328
1377
  scriptId: str
1329
1378
  selector: str
1330
1379
  sideSessionId: str
@@ -1708,6 +1757,52 @@ class ModelVisibleContent(_ModelVisibleContentBase, total=False):
1708
1757
  width: int
1709
1758
 
1710
1759
 
1760
+ class _MonitorInboxItemAdmittedParamsBase(TypedDict):
1761
+ body: str
1762
+ eventIndex: int
1763
+ eventKind: str
1764
+ itemId: str
1765
+ queuedAt: str
1766
+ sessionId: str
1767
+ showLines: bool
1768
+ sourceRange: SourceRange
1769
+ summary: str
1770
+ taskId: str
1771
+ viewCursor: str
1772
+
1773
+
1774
+ class MonitorInboxItemAdmittedParams(_MonitorInboxItemAdmittedParamsBase, total=False):
1775
+ """`monitor/inboxItemAdmitted` params: one monitor inbox admission — the fold keys gate-off consumes."""
1776
+
1777
+ displayBody: str
1778
+ lineIndex: int
1779
+
1780
+
1781
+ class _MonitorInboxItemDrainedParamsBase(TypedDict):
1782
+ deliveryVisible: bool
1783
+ drainedAt: str
1784
+ itemId: str
1785
+ sessionId: str
1786
+ sourceRange: SourceRange
1787
+ viewCursor: str
1788
+
1789
+
1790
+ class MonitorInboxItemDrainedParams(_MonitorInboxItemDrainedParamsBase, total=False):
1791
+ """`monitor/inboxItemDrained` params: one monitor inbox drain — a consumption marker with its recorded stamp."""
1792
+
1793
+ drainTargetRunStream: StreamRef
1794
+
1795
+
1796
+ class MonitorInboxItemVoidedParams(TypedDict):
1797
+ """`monitor/inboxItemVoided` params: one wake-missed void — count-only, no transcript row."""
1798
+
1799
+ itemId: str
1800
+ sessionId: str
1801
+ sourceRange: SourceRange
1802
+ viewCursor: str
1803
+ voidedAt: str
1804
+
1805
+
1711
1806
  class _NotificationBase(TypedDict):
1712
1807
  jsonrpc: JsonRpcVersion
1713
1808
  method: str
@@ -2113,6 +2208,17 @@ class RecordPosition(TypedDict):
2113
2208
  sequence: int
2114
2209
 
2115
2210
 
2211
+ class RecoveryObservation(TypedDict):
2212
+ """One coherent producer snapshot; all members are required and non-null."""
2213
+
2214
+ constructionId: str
2215
+ effectiveMode: RecoveryObservedMode
2216
+ effectiveSource: RecoveryEffectiveSource
2217
+ qualification: RecoveryQualification
2218
+ requestedMode: RecoveryObservedMode
2219
+ sessionId: str
2220
+
2221
+
2116
2222
  class _RequestBase(TypedDict):
2117
2223
  id: RequestId
2118
2224
  jsonrpc: JsonRpcVersion
@@ -2207,7 +2313,7 @@ class SessionBranchChangedParams(_SessionBranchChangedParamsBase, total=False):
2207
2313
 
2208
2314
 
2209
2315
  class SessionClosedParams(TypedDict):
2210
- """`session/closed` params: a loaded session was unloaded from this host, broadcast to every initialized connection. After it, the session is `notLoaded`; the log remains on disk and `session/resume` reloads it. A crash emits nothing — only the two orderly unload paths do, and both write the durable `SessionEnd` record first."""
2316
+ """`session/closed` params: a loaded session was unloaded from this host, broadcast to every initialized connection. After it, the session is `notLoaded`; the log remains on disk and `session/resume` reloads it. A crash emits nothing — only the orderly unload paths do (idle unload, host shutdown and a released `session/leave`), and each writes the durable `SessionEnd` record first."""
2211
2317
 
2212
2318
  reason: SessionClosedReason
2213
2319
  sessionId: str
@@ -2298,6 +2404,37 @@ class SessionHistory(_SessionHistoryBase, total=False):
2298
2404
  noneReason: HistoryNoneReason
2299
2405
 
2300
2406
 
2407
+ class _SessionLeaveCompletedParamsBase(TypedDict):
2408
+ commandId: str
2409
+ outcome: SessionLeaveOutcome
2410
+ sessionId: str
2411
+
2412
+
2413
+ class SessionLeaveCompletedParams(_SessionLeaveCompletedParamsBase, total=False):
2414
+ """Params of the protected, non-view leave terminal notification."""
2415
+
2416
+ reason: SessionLeaveFailureReason
2417
+ viewCursor: str
2418
+
2419
+
2420
+ class _SessionLeaveParamsBase(TypedDict):
2421
+ commandId: str
2422
+ sessionId: str
2423
+
2424
+
2425
+ class SessionLeaveParams(_SessionLeaveParamsBase, total=False):
2426
+ """`session/leave` params."""
2427
+
2428
+ stop: bool
2429
+
2430
+
2431
+ class SessionLeaveResult(TypedDict):
2432
+ """The admission-only `session/leave` result."""
2433
+
2434
+ commandId: str
2435
+ status: CommandAckStatus
2436
+
2437
+
2301
2438
  class SessionListBranchFilter(TypedDict):
2302
2439
  """Exact branch selection."""
2303
2440
 
@@ -2446,6 +2583,7 @@ class SessionReadResult(_SessionReadResultBase, total=False):
2446
2583
  """`session/read` result. The `viewCursor` is the fold head at read time — a point-in-time read, immediately stale if a foreign host is appending."""
2447
2584
 
2448
2585
  lastTurn: LastTurn
2586
+ recoveryObservation: RecoveryObservation
2449
2587
 
2450
2588
 
2451
2589
  class SessionReasoningEffortChangedParams(TypedDict):
@@ -2516,6 +2654,7 @@ class SessionResumeParams(_SessionResumeParamsBase, total=False):
2516
2654
  excludeItems: bool
2517
2655
  history: HistoryPreference
2518
2656
  permissionProfile: str
2657
+ recoveryMode: RecoveryMode
2519
2658
 
2520
2659
 
2521
2660
  class _SessionResumeResultBase(TypedDict):
@@ -2623,6 +2762,7 @@ class SessionStartParams(_SessionStartParamsBase, total=False):
2623
2762
  modelId: str
2624
2763
  permissionProfile: str
2625
2764
  providerId: str | None
2765
+ recoveryMode: RecoveryMode
2626
2766
  sessionId: str
2627
2767
  workspaceRoot: str
2628
2768
  workspaceRoots: list[str]
@@ -3020,6 +3160,7 @@ class _SubagentResultBase(TypedDict):
3020
3160
  class SubagentResult(_SubagentResultBase, total=False):
3021
3161
  """A subagent's result envelope."""
3022
3162
 
3163
+ drained: bool
3023
3164
  errorKind: str
3024
3165
  structuredData: dict[str, Any]
3025
3166
  text: str
@@ -3248,6 +3389,7 @@ class TurnInputPart(_TurnInputPartBase, total=False):
3248
3389
  height: int
3249
3390
  mediaType: str
3250
3391
  selector: str
3392
+ source: SkillInvocationSource
3251
3393
  text: str
3252
3394
  uploadId: str
3253
3395
  width: int
@@ -3939,6 +4081,7 @@ METHODS: Final[dict[str, MethodSpec]] = {
3939
4081
  "recap/request": {"description": "Requests a \"while you were away\" recap for a loaded session; acks \\ `accepted` and settles exactly once on `recap/completed` — one \\ in flight per session, host-enforced 45s timeout.", "params": "RecapRequestParams", "result": "RecapRequestResult"},
3940
4082
  "session/compact": {"description": "Compacts the session's conversation context; runs asynchronously, so the ack is admission only.", "params": "SessionCompactParams", "result": "SessionCompactResult"},
3941
4083
  "session/fork": {"description": "Branches a session into a new id whose log copies the source through a cut point, with durable provenance.", "params": "SessionForkParams", "result": "SessionForkResult"},
4084
+ "session/leave": {"description": "Admits release of one loaded session; final release or failure is pushed through session/leaveCompleted.", "params": "SessionLeaveParams", "result": "SessionLeaveResult"},
3942
4085
  "session/list": {"description": "Pages through stored sessions under the sessions root for history and picker UIs; read-only, never touches leases.", "params": "SessionListParams", "result": "SessionListResult"},
3943
4086
  "session/promptHint": {"description": "Picks one feature-tip table id over the client-supplied candidates; display-only, nothing is logged.", "params": "SessionPromptHintParams", "result": "SessionPromptHintResult"},
3944
4087
  "session/read": {"description": "Reads one stored session without attaching: no lease, no load, no subscription, no resume record.", "params": "SessionReadParams", "result": "SessionReadResult"},
@@ -4009,14 +4152,18 @@ NOTIFICATIONS: Final[dict[str, NotificationSpec]] = {
4009
4152
  "log/gap": {"description": "Raw backlog collapsed for one subscription; fill (after, next) via log/page.", "params": "LogGapParams"},
4010
4153
  "log/record": {"description": "One raw record for an active subscription, in sequence order.", "params": "LogRecordParams"},
4011
4154
  "mcpServer/oauthLoginCompleted": {"description": "An MCP OAuth login flow reached a terminal outcome (granted, denied, expired, cancelled, or failed). Delivered to every experimental connection that has not opted the method out, initiator or not; never carries the authorization URL or any key material.", "params": "McpServerOAuthLoginCompletedParams"},
4155
+ "monitor/inboxItemAdmitted": {"description": "One monitor inbox admission: the fold keys gate-off consumes \\.", "params": "MonitorInboxItemAdmittedParams"},
4156
+ "monitor/inboxItemDrained": {"description": "One monitor inbox drain with its recorded stamp, the \\ drain-side operand of latest-wins.", "params": "MonitorInboxItemDrainedParams"},
4157
+ "monitor/inboxItemVoided": {"description": "One wake-missed void with its recorded stamp; count-only, \\ no transcript row.", "params": "MonitorInboxItemVoidedParams"},
4012
4158
  "plugin/changed": {"description": "An install landed; carries the installed-row summary and clients re-issue `plugin/list`.", "params": "PluginChangedParams"},
4013
4159
  "plugin/marketplaceChanged": {"description": "A marketplace was added, updated, or removed; carries the change summary.", "params": "PluginMarketplaceChangedParams"},
4014
4160
  "recap/completed": {"description": "A recap request settled exactly once — `completed` (with \\ `text` plus optional `title`), `failed` (`providerFailed`), \\ `cancelled`, or `timedOut` — delivered to the requesting \\ connection outside the view stream.", "params": "RecapCompletedParams"},
4015
4161
  "session/approvalModeChanged": {"description": "The approval enforcement mode changed: the fold of the durable reconfigure audit fact.", "params": "SessionApprovalModeChangedParams"},
4016
4162
  "session/branchChanged": {"description": "A durable workspace-branch observation landed; null branch is a detached-HEAD fact.", "params": "SessionBranchChangedParams"},
4017
- "session/closed": {"description": "A loaded session was unloaded (idle | hostShutdown) with the final view cursor; broadcast to every initialized connection.", "params": "SessionClosedParams"},
4163
+ "session/closed": {"description": "A loaded session was unloaded (idle | hostShutdown | leave) with the final view cursor; broadcast to every initialized connection.", "params": "SessionClosedParams"},
4018
4164
  "session/contextUsage": {"description": "A provider-reported context-occupancy fact folded to a changed (windowTokens, usedTokens, pressure) triple.", "params": "SessionContextUsageParams"},
4019
4165
  "session/goalChanged": {"description": "The session's goal block changed value; replace wholesale, an explicit null clears.", "params": "SessionGoalChangedParams"},
4166
+ "session/leaveCompleted": {"description": "Protected correlated terminal for an admitted session/leave.", "params": "SessionLeaveCompletedParams"},
4020
4167
  "session/listChanged": {"description": "The changed session/list row, full-row replace; opt-in per connection via the sessionListStream capability, never subscription-gated.", "params": "SessionListChangedParams"},
4021
4168
  "session/modelChanged": {"description": "A durable model selection took effect.", "params": "SessionModelChangedParams"},
4022
4169
  "session/modelRouteUnserved": {"description": "An accepted login credential update installed a provider that cannot serve the session's standing model route; the standing selection is unchanged and a routable session/setModel repairs it.", "params": "SessionModelRouteUnservedParams"},
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: muse-code-msp
3
- Version: 1.4.9
3
+ Version: 1.4.11
4
4
  Summary: Generated Python wire types for the Muse Session Protocol (MSP). No hand-written protocol types, ever.
5
5
  License-Expression: MIT
6
6
  Project-URL: Homepage, https://github.com/meta-models/muse-code-sdk
File without changes
File without changes
File without changes