@muse-code/sdk 1.4.15 → 1.4.23
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.
- package/README.md +78 -2
- package/dist/src/connection/connection.d.ts +83 -6
- package/dist/src/connection/connection.js +113 -14
- package/dist/src/connection/spawn.d.ts +50 -4
- package/dist/src/connection/spawn.js +161 -33
- package/dist/src/connection/surface.d.ts +49 -0
- package/dist/src/connection/surface.js +8 -0
- package/dist/src/errors.d.ts +6 -5
- package/dist/src/errors.js +7 -6
- package/dist/src/facade/approval.js +1 -1
- package/dist/src/facade/client.d.ts +158 -17
- package/dist/src/facade/client.js +370 -74
- package/dist/src/facade/gap-fill.d.ts +2 -0
- package/dist/src/facade/gap-fill.js +11 -2
- package/dist/src/facade/host-death.d.ts +5 -1
- package/dist/src/facade/host-death.js +5 -1
- package/dist/src/facade/session.d.ts +133 -5
- package/dist/src/facade/session.js +419 -13
- package/dist/src/facade/turn-handle.d.ts +23 -0
- package/dist/src/facade/turn-handle.js +1 -1
- package/dist/src/fingerprint.d.ts +79 -4
- package/dist/src/fingerprint.js +110 -11
- package/dist/src/fingerprint.stamped.d.ts +2 -1
- package/dist/src/fingerprint.stamped.js +2 -1
- package/dist/src/fold/extension.d.ts +39 -0
- package/dist/src/fold/extension.js +49 -0
- package/dist/src/fold/session-fold.d.ts +11 -0
- package/dist/src/fold/session-fold.js +13 -0
- package/dist/src/index.d.ts +6 -5
- package/dist/src/index.js +1 -1
- package/dist/src/msp.d.ts +319 -10
- package/package.json +1 -1
package/dist/src/msp.d.ts
CHANGED
|
@@ -60,8 +60,20 @@ export interface ApprovalChoice {
|
|
|
60
60
|
/** How long a grant made by a choice lasts. The set is open, so newer hosts may send other values. */
|
|
61
61
|
export type ApprovalChoiceScope = "once" | "session" | "localPersistent" | (string & {});
|
|
62
62
|
|
|
63
|
+
/** A browser card's notices: the first time Computer Use uses a browser on this Mac, and the session's consent before it opens its own window in a browser that comes to the front when it does. A client words each flag itself. */
|
|
64
|
+
export interface ApprovalCuaBrowser {
|
|
65
|
+
/** Show the first-use notice: Computer Use hasn't used this browser on this Mac before and will act signed in as the person. */
|
|
66
|
+
firstUse?: boolean;
|
|
67
|
+
/** The browser's display name. */
|
|
68
|
+
name: string;
|
|
69
|
+
/** Show the window consent line: Computer Use will open its own window in this browser and bring the browser to the front, once per session. */
|
|
70
|
+
windowConsent?: boolean;
|
|
71
|
+
}
|
|
72
|
+
|
|
63
73
|
/** One Computer Use card's facts. Empty collections and absent rows are omitted, never `null`. */
|
|
64
74
|
export interface ApprovalCuaCardFacts {
|
|
75
|
+
/** For a browser card, the notices it carries; absent unless at least one shows. */
|
|
76
|
+
browser?: ApprovalCuaBrowser;
|
|
65
77
|
/** The data the call would send that the card must name; a card with any offers only one-shot choices. */
|
|
66
78
|
data?: ApprovalCuaDataFact[];
|
|
67
79
|
/** For a browser, the host of the window's current page. */
|
|
@@ -445,6 +457,23 @@ export interface BlockedPrompt {
|
|
|
445
457
|
text: string;
|
|
446
458
|
}
|
|
447
459
|
|
|
460
|
+
/** Whether the origin call join held at delivery. */
|
|
461
|
+
export type BodyCompletionCorrelation = "resolved" | "unresolved" | (string & {});
|
|
462
|
+
|
|
463
|
+
/** `bodyCompletion`: the facts one receipt row renders (ADR 87062 D2). The fold reads them from the inbox terminal record and the backgrounded call it names. `status`, `result_summary`, and `correlation` are required; `origin_call_id` is absent exactly when the join is unresolved. */
|
|
464
|
+
export interface BodyCompletionMembers {
|
|
465
|
+
/** Whether the origin call join held at delivery. */
|
|
466
|
+
correlation: BodyCompletionCorrelation;
|
|
467
|
+
/** The originating call's provider call id, opaque — the join key back to the original row. Absent when the join is unresolved (compaction). */
|
|
468
|
+
originCallId?: string;
|
|
469
|
+
/** True for the Manual semantic receipt (`◆`); false for the ordinary completion row. */
|
|
470
|
+
receipt: boolean;
|
|
471
|
+
/** Bounded transcript-visible result text; empty when the terminal carries none. Full bytes stay behind outputRef. */
|
|
472
|
+
resultSummary: string;
|
|
473
|
+
/** One fixed wire word per Task terminal (`completed`, `failed`, `cancelled`, `timedOut`, `rejected`) — never display text; gate-off display words derive client-side. */
|
|
474
|
+
status: string;
|
|
475
|
+
}
|
|
476
|
+
|
|
448
477
|
/** The latest branch observation in the snapshot (tdd SS4.6.4, SS4.9.1). */
|
|
449
478
|
export interface BranchState {
|
|
450
479
|
/** The observed branch; `null` on a detached-HEAD observation. */
|
|
@@ -859,6 +888,8 @@ export interface ErrorData {
|
|
|
859
888
|
sessionId?: string;
|
|
860
889
|
/** Winning settlement on `userInputAlreadySettled`. */
|
|
861
890
|
settlement?: UserInputSettlementSummary;
|
|
891
|
+
/** The stop's refusal kind on a `workflow/cancel` `commandRejected` whose stop was refused or whose settlement read failed (SS3.19, spec 14410 FR-92884-1): `stale_revision`, `policy_rejected`, `actor_authority_mismatch`, `authority_index_conflict`, `admission_failed`, `persistence_failed`, `control_not_signalled`, `post_marker_not_cancellable`, `control_outcome_uncertain`, `adapter_contract_violation`, `transport_lost` or `reply_lost`. */
|
|
892
|
+
stopRefusal?: string;
|
|
862
893
|
/** The rejected upload id on `uploadNotFound` (`-32038`, SS3.33). */
|
|
863
894
|
uploadId?: string;
|
|
864
895
|
/** Prompt identity on user-input errors. */
|
|
@@ -1134,8 +1165,12 @@ export interface Item {
|
|
|
1134
1165
|
backgroundTarget?: BackgroundTarget;
|
|
1135
1166
|
/** `backgroundTerminalCompletion`: the five facts the Finished cell renders (ADR 50041 D4). */
|
|
1136
1167
|
backgroundTerminalCompletion?: BackgroundTerminalCompletion;
|
|
1168
|
+
/** `toolCall`: the call's Bash Title — its `description` argument through the shared Bash Title normalizer, for a managed Bash call, served only while the host's `bash_titles` gate is on. The host adds it when it serves the item and never stores it; absent for any other call (tdd SS4.5.5; ADR 31406 D26). Old clients ignore it. */
|
|
1169
|
+
bashTitle?: string;
|
|
1137
1170
|
/** `reminderChild`: `true` when this child is a blocking reminder (it holds the turn open until it settles); absent otherwise, never `false` (ADR 41191 D4). The status word stays off the wire; clients name the reminder from `reminderAgentId`. */
|
|
1138
1171
|
blocking?: boolean;
|
|
1172
|
+
/** `bodyCompletion`: the facts one receipt row renders (ADR 87062 D2, accepted names). */
|
|
1173
|
+
bodyCompletion?: BodyCompletionMembers;
|
|
1139
1174
|
/** `toolCall`: the provider call id (`call_...`), opaque. */
|
|
1140
1175
|
callId?: string;
|
|
1141
1176
|
/** `workflow`: one `outputRef`-shaped link per recorded child spawn with an objective (`kind: "workflow_child_prompt"`), fetched via `item/readOutput` (tdd SS4.5.8/SS4.7.4, #45449). */
|
|
@@ -1300,10 +1335,12 @@ export interface Item {
|
|
|
1300
1335
|
summarizedThrough?: string;
|
|
1301
1336
|
/** `reasoning`: one entry per summary part; part *n* streams via `item/delta` field `"summary.n"` (part boundary = index change). */
|
|
1302
1337
|
summary?: string[];
|
|
1303
|
-
/** `reminderChild`: the linked task id. */
|
|
1338
|
+
/** `reminderChild`: the linked task id. Unresolved `bodyCompletion` items also set it (FR-87062-1: the diagnostic names the task whose join did not hold). */
|
|
1304
1339
|
taskId?: string;
|
|
1305
|
-
/** Terminal `toolCall`,
|
|
1340
|
+
/** Terminal monitor `toolCall`, drained `subagent`, `backgroundTerminalCompletion`, or Finished-row `toolCall`: render after the target's logical rows (tdd SS4.5.21, ADR 56496 D2/D3, OD #738). */
|
|
1306
1341
|
terminalRowAfterItemId?: string;
|
|
1342
|
+
/** `backgroundTerminalCompletion`, or a terminal `toolCall` that already shows a Finished row: render before the target's whole coalesced region (tdd SS4.5.21, ADR 50041 D6). */
|
|
1343
|
+
terminalRowBeforeItemId?: string;
|
|
1307
1344
|
/** `userMessage`: the prompt text as submitted. `agentMessage`: the accumulated reply, streamed via `item/delta` field `"text"`. `reasoning`: raw committed reasoning text where the provider exposes it (never streamed in v1, tdd SS4.5.4). */
|
|
1308
1345
|
text?: string;
|
|
1309
1346
|
/** `workflow`: the run's launch token budget, set from the launch fact (tdd SS4.5.8, #45449); absent when the launch carried none. */
|
|
@@ -1363,7 +1400,7 @@ export interface ItemDeltaParams {
|
|
|
1363
1400
|
}
|
|
1364
1401
|
|
|
1365
1402
|
/** The eleven v1 item kinds (tdd SS4.5.2–4.5.13) plus post-v1 kinds (tdd SS4.5.14+). Open: a new kind is additive evolution, and clients MUST render unknown kinds generically (tdd SS4.10). */
|
|
1366
|
-
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | "monitorFeed" | "damagedRange" | "scheduledFire" | "backgroundTerminalCompletion" | "overdueNotice" | "earlierHistory" | "peerMessage" | "subagentInput" | "subagentResult" | "systemNotice" | (string & {});
|
|
1403
|
+
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | "monitorFeed" | "damagedRange" | "scheduledFire" | "backgroundTerminalCompletion" | "overdueNotice" | "earlierHistory" | "peerMessage" | "subagentInput" | "subagentResult" | "systemNotice" | "bodyCompletion" | (string & {});
|
|
1367
1404
|
|
|
1368
1405
|
/** The `item/readOutput` content encoding (tdd SS4.7.4). Closed: text media is ALWAYS `utf8` and binary media `base64`; a third value would change the client's decode contract. */
|
|
1369
1406
|
export type ItemReadOutputEncoding = "utf8" | "base64";
|
|
@@ -1756,8 +1793,8 @@ export interface MonitorInboxSnapshotEntry {
|
|
|
1756
1793
|
voidedAt?: string;
|
|
1757
1794
|
}
|
|
1758
1795
|
|
|
1759
|
-
/** `systemNotice`: the producing family, so a client routes a notice without parsing its text (tdd SS4.5.23). Open. The v1 vocabulary is the Monitor notice and the three system-chrome producers (ADR 42729 D1) plus the hook-run producer (ADR 75121 D2)
|
|
1760
|
-
export type NoticeOrigin = "monitor" | "skillsStartup" | "scheduledFire" | "incompleteGeneration" | "hook" | "workflowCheckpoint" | (string & {});
|
|
1796
|
+
/** `systemNotice`: the producing family, so a client routes a notice without parsing its text (tdd SS4.5.23). Open. The v1 vocabulary is the Monitor notice and the three system-chrome producers (ADR 42729 D1) plus the hook-run producer (ADR 75121 D2), the paused-Workflow checkpoint producer (ADR 39490 D5) and the continued-child tools producer (ADR 42729 D5); absent means the server named no origin, and a client never infers one. */
|
|
1797
|
+
export type NoticeOrigin = "monitor" | "skillsStartup" | "scheduledFire" | "incompleteGeneration" | "hook" | "workflowCheckpoint" | "continuedChildTools" | (string & {});
|
|
1761
1798
|
|
|
1762
1799
|
/** `systemNotice`: the notice's level (tdd SS4.5.23). Open; an unknown value is an unknown-but-present level, rendered generically (SS4.10). */
|
|
1763
1800
|
export type NoticeSeverity = "info" | "warning" | "error" | (string & {});
|
|
@@ -2258,6 +2295,10 @@ export type SandboxUnavailableReason = "userNamespacesDenied" | "bubblewrapUnava
|
|
|
2258
2295
|
|
|
2259
2296
|
/** The `schema` pair in [`InitializeResult`] (SS1.4.1, SS1.5.3). `version` is the wire **envelope** schema version — distinct from the session-view `schemaVersion`, the raw-log `schema_version`, and the 0.x/1.0 stability posture, which is not on the wire at all (INV-006a). */
|
|
2260
2297
|
export interface SchemaInfo {
|
|
2298
|
+
/** The host's declared compatibility epoch (spec 206 amendment #22936 FR-22936-2, ADR 22936 D2): the count of declared non-additive advances of the stable surface. A client reads a `fingerprint` mismatch by comparing this with its own pin: equal, every difference is additive; different, a declared non-additive advance lies between. Additive-optional: a host that predates the member omits it, and the reader treats absence as unknown, never a guessed value (SS1.5.4). */
|
|
2299
|
+
compatibilityEpoch?: number;
|
|
2300
|
+
/** `sha256:<64 lower hex>` content hash of this server binary's experimental-surface bundle (ADR 97527 D5). Additive-optional: a host that predates the member omits it, and the reader treats absence as unknown — never a guessed value (SS1.5.4). */
|
|
2301
|
+
experimentalFingerprint?: string;
|
|
2261
2302
|
/** `sha256:<64 lower hex>` content hash of this server binary's stable-surface bundle (INV-003). A mismatch is a warning condition, not an error (SS1.4.1). */
|
|
2262
2303
|
fingerprint: string;
|
|
2263
2304
|
/** Envelope schema version; `1` in v1, expected to stay `1` for a long time (SS1.4.1). */
|
|
@@ -2274,7 +2315,7 @@ export interface ServerInfo {
|
|
|
2274
2315
|
|
|
2275
2316
|
/** The session object every lifecycle method returns or lists (tdd SS2.4). Additive-optional evolution applies: clients must ignore unknown fields. */
|
|
2276
2317
|
export interface Session {
|
|
2277
|
-
/** The `turnId` of the current foreground turn when
|
|
2318
|
+
/** The `turnId` of the current foreground turn when a turn is in flight (parked under `needsInput` included), and `null` otherwise (tdd SS2.4, ADR 95605 D1). **Required-nullable.** Every served `Session` carries the member: `null` when no turn is in flight or the session is not loaded, the turn id when one is. An optional-absent shape would publish it as plain `string` and reject every idle `Session` frame the host sends. */
|
|
2278
2319
|
activeTurnId: string | null;
|
|
2279
2320
|
/** The folded effective approval mode. **Additive-optional**: a Session object that omits it means the host has not folded a mode, which is why the index-derived `session/list` entry may legitimately omit it (tdd SS2.4, SS5.12). */
|
|
2280
2321
|
approvalMode?: EffectiveApprovalModeState;
|
|
@@ -2419,6 +2460,8 @@ export interface SessionCompactResult {
|
|
|
2419
2460
|
|
|
2420
2461
|
/** The open configuration extension object shared by `session/start` and `session/resume` (ADR 32760 D1). Unknown keys are ignored on the wire, never rejected: the live decoder tolerates them, and no exported bundle carries `additionalProperties: false`. The Rust typed model's `deny_unknown_fields` is internal and never exported — the closedness export applies nowhere, and the `x-msp-closed` opt-in mechanism stays inert. Recognized `mcpServers` values are typed and validated before they leave the wire boundary. */
|
|
2421
2462
|
export interface SessionConfig {
|
|
2463
|
+
/** Developer instructions for this session only (ADR 32029 D38, stable from switch piece F2), on `session/start` and `session/resume`. The text is trimmed. A nonblank value replaces the settings-derived developer instructions; an omitted member is no override and keeps the full developer context. Explicit `null` and blank text are the explicit clear (the Rust value is an empty string): no override, and on a host that serves developer instructions they also turn off the session's suppressible developer context (the agent catalog and the memory snapshot). Any other type fails the decode. A host that does not serve developer instructions ignores a valid member. */
|
|
2464
|
+
developerPrompt?: string | null;
|
|
2422
2465
|
/** Native MCP servers added only to this session runtime. */
|
|
2423
2466
|
mcpServers?: Record<string, SessionMcpServerConfig>;
|
|
2424
2467
|
}
|
|
@@ -2694,6 +2737,8 @@ export interface SessionReadResult {
|
|
|
2694
2737
|
history: SessionHistory;
|
|
2695
2738
|
/** Same member as `session/resume` (tdd SS2.5.5, ADR 36635 D2). */
|
|
2696
2739
|
lastTurn?: LastTurn;
|
|
2740
|
+
/** Whether a native child read session's model turn runs (tdd SS2.5.5, ADR 89202 D1): served on a read of a `subagent` session whose containing session this host holds loaded, from that session's runtime at serve time. Absent for every other read and when the runtime cannot answer; absence asserts nothing. */
|
|
2741
|
+
modelTurnRunning?: boolean;
|
|
2697
2742
|
/** The same pointer shape as `session/resume`. Because `session/read` never subscribes this is a point-in-time log read only: no requests are re-issued after it (tdd SS2.5.5). */
|
|
2698
2743
|
pendingRequests: PendingRequestPointer[];
|
|
2699
2744
|
/** One short record per child session the checkpoint boundary pruned (tdd SS2.5.5, ADR 71910 D8). Absent-when-empty: a missing member means the view is uncompacted or nothing pruned, never an error. */
|
|
@@ -2852,7 +2897,7 @@ export interface SessionSideChatParams {
|
|
|
2852
2897
|
|
|
2853
2898
|
/** `session/sideChat` result (tdd SS2.5.7; ADR 45435 D2): the `session/resume` envelope for the **new** side session, whose `session.sideFrom` carries the provenance. The side opens empty. */
|
|
2854
2899
|
export interface SessionSideChatResult {
|
|
2855
|
-
/** The served history
|
|
2900
|
+
/** The served history: inline, with empty items, since the side opens empty (SS2.5.7). */
|
|
2856
2901
|
history: SessionHistory;
|
|
2857
2902
|
/** The late-joiner pointer set. */
|
|
2858
2903
|
pendingRequests: PendingRequestPointer[];
|
|
@@ -2876,6 +2921,8 @@ export interface SessionSpawnedBy {
|
|
|
2876
2921
|
export interface SessionStartParams {
|
|
2877
2922
|
/** The session's starting approval mode; server default when omitted or explicit `null` — both spellings select the default (#23468). Select, never create — the value names a mode the host's configuration already defines (tdd SS2.5.1, SS5.12). This is the only surface that declares a non-interactive run's policy (tdd SS5.11, D-008). */
|
|
2878
2923
|
approvalMode?: ApprovalMode | null;
|
|
2924
|
+
/** Marks this start as a `/clear` (spec 207 amendment 93195, FR-93195-1, ADR 93195 D1): `true` starts the new session as a clear, so its `SessionStart` hooks get source `clear` instead of `startup`. `false` and omitted are the same plain start (source `startup`). It neither needs nor implies `previousSessionId`. Explicit `null` is invalid params. */
|
|
2925
|
+
clear?: boolean;
|
|
2879
2926
|
/** The SS2.5 idempotency handle (UUIDv7). Required; the server never mints one. */
|
|
2880
2927
|
commandId: string;
|
|
2881
2928
|
/** Reserved for future per-session overrides; only its `mcpServers` member is admitted. */
|
|
@@ -2917,13 +2964,13 @@ export interface SessionStartedParams {
|
|
|
2917
2964
|
/** A session's load state (tdd SS2.4). */
|
|
2918
2965
|
export type SessionStatus = "notLoaded" | "idle" | "running" | (string & {});
|
|
2919
2966
|
|
|
2920
|
-
/** `session/statusChanged` params (tdd SS4.6.10, ADR 31983 D2): a loaded session's projected `(status, attention)` value flipped. A command-plane broadcast — delivered to every connection regardless of its view subscription set, never gated, no `sourceRange`; the same facts live on the Session object, which is how a client seeds its table (no initial burst on connect). */
|
|
2967
|
+
/** `session/statusChanged` params (tdd SS4.6.10, ADR 31983 D2): a loaded session's projected `(status, attention, needsInputReasons)` value flipped. A command-plane broadcast — delivered to every connection regardless of its view subscription set, never gated, no `sourceRange`; the same facts live on the Session object, which is how a client seeds its table (no initial burst on connect). */
|
|
2921
2968
|
export interface SessionStatusChangedParams {
|
|
2922
2969
|
/** Attention flags after the transition; present only when at least one flag is set (tdd SS2.4, ADR 31983 D3). */
|
|
2923
2970
|
attention?: AttentionFlag[];
|
|
2924
2971
|
/** The owning session. */
|
|
2925
2972
|
sessionId: string;
|
|
2926
|
-
/** Load state after the transition (the
|
|
2973
|
+
/** Load state after the transition (the open SS2.4 enum, including `needsInput` since ADR 95605 D1/D4). */
|
|
2927
2974
|
status: SessionStatus;
|
|
2928
2975
|
/** The causing record's view cursor (ADR 31983 D4). Required-nullable: `null` exactly when the paired `session/closed`'s cursor is `null` (the unload fold-failure arm); a definite cursor everywhere else. */
|
|
2929
2976
|
viewCursor: string | null;
|
|
@@ -3340,6 +3387,8 @@ export interface SubagentResult {
|
|
|
3340
3387
|
structuredData?: Record<string, unknown>;
|
|
3341
3388
|
/** Result summary, bounded on the wire at the 64 KiB retained-text budget (tdd SS4.5.4 and SS4.5.7, ADR 35691 D9); a cut sets the item's `truncated`. The durable record stays verbatim. */
|
|
3342
3389
|
summary: string;
|
|
3390
|
+
/** `true` once a newer attempt of the child started after this result (ADR 92325 D1): the result stays, and a client takes the child's status from `controlStatus`. Absent, it asserts nothing (a host before this member, or a fold state saved before it, never sets it); a newer result replaces the whole result, so it carries no mark. */
|
|
3391
|
+
superseded?: boolean;
|
|
3343
3392
|
/** Result text, when present, bounded on the wire at the same 64 KiB budget (ADR 35691 D9); a cut sets the item's `truncated`. */
|
|
3344
3393
|
text?: string;
|
|
3345
3394
|
}
|
|
@@ -3639,7 +3688,7 @@ export interface TurnError {
|
|
|
3639
3688
|
}
|
|
3640
3689
|
|
|
3641
3690
|
/** Turn failure classes (tdd SS4.5.1, `TerminalErrorKind` plus the model-task failure class). Open. */
|
|
3642
|
-
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | "mcpLinkError" | (string & {});
|
|
3691
|
+
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | "mcpLinkError" | "reasoningReplayRefused" | "contextOverflow" | (string & {});
|
|
3643
3692
|
|
|
3644
3693
|
/** `turn/foregroundCompleted` params (tdd SS4.5.12): the turn's foreground work is done and named background reminder checks hold the turn open. Explicitly non-terminal: the turn ends only at `turn/completed` / `turn/unqueued`. */
|
|
3645
3694
|
export interface TurnForegroundCompletedParams {
|
|
@@ -4359,3 +4408,263 @@ export type MspNotification = "initialized" | "session/started" | "session/close
|
|
|
4359
4408
|
export type MspServerRequest = "approval/request" | "userInput/request";
|
|
4360
4409
|
/** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */
|
|
4361
4410
|
export type MspErrorDataKind = "parseError" | "invalidRequest" | "notInitialized" | "alreadyInitialized" | "methodNotFound" | "experimentalRequired" | "invalidParams" | "internal" | "pageEventTooLarge" | "outputResultTooLarge" | "overloaded" | "inputTooLarge" | "capabilityRequired" | "notFound" | "interrupted" | "cancelled" | "sessionNotFound" | "sessionInUse" | "sessionAmbiguous" | "forkBoundaryInvalid" | "sessionNotLoaded" | "sessionStreamMismatch" | "commandRejected" | "backpressured" | "skillNotFound" | "computerUseUnavailable" | "marketplaceNotFound" | "pluginNotFound" | "marketplaceAlreadyExists" | "pluginMutationsDisabled" | "uploadNotFound" | "viewTruncated" | "outputUnavailable" | "boundaryPruned" | "boundaryUnusable" | "noBoundary" | "approvalNotFound" | "approvalAlreadyResolved" | "approvalChoiceInvalid" | "approvalRequirementStale" | "approvalReviewerUnavailable" | "userInputNotFound" | "userInputAlreadySettled" | "userInputAnswerInvalid" | "approvalBrokerUnavailable" | "approvalResolving";
|
|
4411
|
+
|
|
4412
|
+
/** Every wire method's `params` and `result` types, keyed by method (SS1.9 index); `params` is `undefined` for a method that takes none. */
|
|
4413
|
+
export interface MspMethodMap {
|
|
4414
|
+
/** Opens the connection: client identification, capability requests, and the experimental opt-in; the reply carries the envelope schema version and the stable-surface fingerprint (SS1.4.1). */
|
|
4415
|
+
"initialize": { params: InitializeParams; result: InitializeResult };
|
|
4416
|
+
/** Queue a user note into a running child; admission-only ack, the note settles on the child session's view stream (SS3.16). */
|
|
4417
|
+
"subagent/sendMessage": { params: SubagentInputParams; result: CommandAcceptedResult };
|
|
4418
|
+
/** Queue a follow-up task for a child; admission-only ack, the task settles on the child session's view stream (SS3.16). */
|
|
4419
|
+
"subagent/followupTask": { params: SubagentInputParams; result: CommandAcceptedResult };
|
|
4420
|
+
/** Ask a child to yield at its next boundary; outcome folds to the parent's subagent item (SS3.16, SS4.5.7). */
|
|
4421
|
+
"subagent/interrupt": { params: SubagentOwnerReasonParams; result: CommandAcceptedResult };
|
|
4422
|
+
/** Stop a running child; outcome folds to the parent's subagent item (SS3.16, SS4.5.7). */
|
|
4423
|
+
"subagent/stop": { params: SubagentOwnerReasonParams; result: CommandAcceptedResult };
|
|
4424
|
+
/** Resume a paused/recoverable child as a durable later attempt (SS3.16). */
|
|
4425
|
+
"subagent/resume": { params: SubagentTargetParams; result: CommandAcceptedResult };
|
|
4426
|
+
/** Reopen a stopped/closed child as a durable later attempt (SS3.16). */
|
|
4427
|
+
"subagent/reopen": { params: SubagentTargetParams; result: CommandAcceptedResult };
|
|
4428
|
+
/** Owner-close a child; the terminal mapping folds per SS4.5.7 (SS3.16). */
|
|
4429
|
+
"subagent/close": { params: SubagentOwnerReasonParams; result: CommandAcceptedResult };
|
|
4430
|
+
/** Consume a ready child result (state-changing; the content is already the subagent item's result field) (SS3.16). */
|
|
4431
|
+
"subagent/readResult": { params: SubagentTargetParams; result: CommandAcceptedResult };
|
|
4432
|
+
/** Lists the session's subagent roster: one row per durable child, running and finished, projected from the loaded parent's runtime subagent control records (kt-o155). */
|
|
4433
|
+
"subagent/list": { params: SubagentListParams; result: SubagentListResult };
|
|
4434
|
+
/** Creates a brand-new session, loads it on this host, durably records the start, and auto-subscribes this connection (SS2.5.1). */
|
|
4435
|
+
"session/start": { params: SessionStartParams; result: SessionStartResult };
|
|
4436
|
+
/** Loads a stored session on this host, auto-subscribes this connection, and returns the history needed to render it (SS2.5.2). */
|
|
4437
|
+
"session/resume": { params: SessionResumeParams; result: SessionResumeResult };
|
|
4438
|
+
/** Branches a session into a new id whose log copies the source through a cut point, with durable provenance (SS2.5.3). */
|
|
4439
|
+
"session/fork": { params: SessionForkParams; result: SessionForkResult };
|
|
4440
|
+
/** Declares that a loaded session is waiting on an external event: the end-of-turn reminder boundary parks a blocking reminder instead of re-verifying until the next input arrives (ADR 66573 amendment). Live-only: a serve restart, unload, or resume loses the declaration; the next user input or an explicit clear ends it. */
|
|
4441
|
+
"session/declareExternalWait": { params: SessionDeclareExternalWaitParams; result: SessionDeclareExternalWaitResult };
|
|
4442
|
+
/** Clears a live host-declared external wait: no declaration is live afterwards, and the end-of-turn reminder boundary returns to today's behaviour at once. Clearing a session with no declaration is a no-op that still answers `declared: false`. */
|
|
4443
|
+
"session/clearExternalWait": { params: SessionClearExternalWaitParams; result: SessionClearExternalWaitResult };
|
|
4444
|
+
/** Admits release of one loaded session; final release or failure is pushed through session/leaveCompleted (SS2.15). */
|
|
4445
|
+
"session/leave": { params: SessionLeaveParams; result: SessionLeaveResult };
|
|
4446
|
+
/** Pages through stored sessions under the sessions root for history and picker UIs; read-only, never touches leases (SS2.5.4). */
|
|
4447
|
+
"session/list": { params: SessionListParams; result: SessionListResult };
|
|
4448
|
+
/** Reads one stored session without attaching: no lease, no load, no subscription, no resume record (SS2.5.5). */
|
|
4449
|
+
"session/read": { params: SessionReadParams; result: SessionReadResult };
|
|
4450
|
+
/** Opens a side chat from a loaded main session, with durable provenance (SS2.5.7; ADR 45435 D2). */
|
|
4451
|
+
"session/sideChat": { params: SessionSideChatParams; result: SessionSideChatResult };
|
|
4452
|
+
/** Submits user input to a session; the optional disposition controls queue, steer, or replace when a turn is already running (SS3.2). */
|
|
4453
|
+
"turn/start": { params: TurnStartParams; result: TurnStartResult };
|
|
4454
|
+
/** Injects input into the turn the caller names, failing if that turn is no longer active (SS3.3). */
|
|
4455
|
+
"turn/steer": { params: TurnSteerParams; result: TurnSteerResult };
|
|
4456
|
+
/** Stops the running turn on the runtime's priority lane, optionally pairing a durable retract intent (SS3.4). */
|
|
4457
|
+
"turn/interrupt": { params: TurnInterruptParams; result: TurnInterruptResult };
|
|
4458
|
+
/** Cancels a turn on the normal command lane, recording no priority interrupt intent (SS3.5). */
|
|
4459
|
+
"turn/cancel": { params: TurnCancelParams; result: TurnCancelResult };
|
|
4460
|
+
/** Reclaims a queued submit before it launches; never upgrades into a cancel once the target is running (SS3.6). */
|
|
4461
|
+
"turn/unqueue": { params: TurnUnqueueParams; result: TurnUnqueueResult };
|
|
4462
|
+
/** Compacts the session's conversation context; runs asynchronously, so the ack is admission only (SS3.7). */
|
|
4463
|
+
"session/compact": { params: SessionCompactParams; result: SessionCompactResult };
|
|
4464
|
+
/** Reconfigures the session's model; the selection is durable and applies to subsequent model calls (SS3.8). */
|
|
4465
|
+
"session/setModel": { params: SessionSetModelParams; result: SessionSetModelResult };
|
|
4466
|
+
/** Sets or changes the durable allocated session name through the runtime session_name command; withheld under the ephemeral profile (SS2.14.2, #27598). */
|
|
4467
|
+
"session/rename": { params: SessionRenameParams; result: SessionRenameResult };
|
|
4468
|
+
/** Sets the session's standing reasoning-effort default; a turn carrying its own tier overrides it for that turn only (SS3.21, ADR 31255 D1). */
|
|
4469
|
+
"session/setReasoningEffort": { params: SessionSetReasoningEffortParams; result: SessionSetReasoningEffortResult };
|
|
4470
|
+
/** Runs a user-initiated shell command in the session's workspace; capability-gated on `userShell` (SS3.9). */
|
|
4471
|
+
"session/userShell": { params: SessionUserShellParams; result: SessionUserShellResult };
|
|
4472
|
+
/** Reads the catalog of models the host will accept in `session/setModel`; a query, not a command (SS3.10). */
|
|
4473
|
+
"model/list": { params: ModelListParams; result: ModelListResult };
|
|
4474
|
+
/** Reads the session's user-invocable skill rows — one per typed-invocable shortcut spelling, the INV-007 predicate and shared name resolution by call-through; a query, not a command (SS3.22.1). */
|
|
4475
|
+
"skill/list": { params: SkillListParams; result: SkillListResult };
|
|
4476
|
+
/** Writes one skill's activation in any scope through the single `SkillsService::set_activation` seam; answers the applied state plus `previous`. `commandId`-idempotent; each successful write is a `skill/changed` detection point (tdd SS3.30.1, ADR 45433 D2/D4/D5, #45433). */
|
|
4477
|
+
"skill/setActivation": { params: SkillSetActivationParams; result: SkillSetActivationResult };
|
|
4478
|
+
/** Imports foreign skills from the host's own `claude | codex` dirs through the single `SkillsService::import_skills` seam; answers per-skill installed/quarantined/skipped/failed plus counts. `commandId`-idempotent (including `dryRun` previews); each successful write is a `skill/changed` detection point (tdd SS3.30.2, ADR 45433 D2/D4/D5, #45433). */
|
|
4479
|
+
"skill/import": { params: SkillImportParams; result: SkillImportResult };
|
|
4480
|
+
/** Reads the session's installed hook rows — one per installed handler per event, config-file handlers plus plugin-contributed hooks; a query, not a command (SS3.26.1). */
|
|
4481
|
+
"hook/list": { params: HookListParams; result: HookListResult };
|
|
4482
|
+
/** Reads the installed plugin records — one row per installed plugin; a query, not a command (SS3.26.2). */
|
|
4483
|
+
"plugin/list": { params: PluginListParams; result: PluginListResult };
|
|
4484
|
+
/** Install one plugin from a marketplace pair or a host local path with scope (per-session, `commandId`-idempotent, hold-open; answers the installed receipt) (SS3.29.1). */
|
|
4485
|
+
"plugin/install": { params: PluginInstallParams; result: PluginInstallResult };
|
|
4486
|
+
/** Add a marketplace from `owner/repo`, git URL, `file://` URL, or local path (per-session, `commandId`-idempotent; answers the stored record) (SS3.29.2). */
|
|
4487
|
+
"plugin/marketplaceAdd": { params: PluginMarketplaceAddParams; result: PluginMarketplaceRecordResult };
|
|
4488
|
+
/** Refresh a marketplace in place (per-session, `commandId`-idempotent; answers the stored record) (SS3.29.3). */
|
|
4489
|
+
"plugin/marketplaceUpdate": { params: PluginMarketplaceUpdateParams; result: PluginMarketplaceRecordResult };
|
|
4490
|
+
/** Remove a marketplace (per-session, `commandId`-idempotent; answers the removed name) (SS3.29.4). */
|
|
4491
|
+
"plugin/marketplaceRemove": { params: PluginMarketplaceRemoveParams; result: PluginMarketplaceRemoveResult };
|
|
4492
|
+
/** Durably sends a running foreground tool task to the background; the `TaskBackgrounded` record lands before the ack and the `toolCall` item's `item/updated` folds the flip (tdd §3.13, #14411; enrolled under the #33065 T1 ruling). */
|
|
4493
|
+
"task/background": { params: TaskBackgroundParams; result: TaskCommandResult };
|
|
4494
|
+
/** Stops one named background task; the kill settles durably and the item folds a terminal (tdd §3.14, #14411; enrolled under the #33065 T1 ruling). */
|
|
4495
|
+
"task/stop": { params: TaskStopParams; result: TaskCommandResult };
|
|
4496
|
+
/** Stops every stoppable background workload live at admission; always accepted, one item terminal folds per stopped item-visible task (tdd §3.15, #14411; enrolled under the #33065 T1 ruling). */
|
|
4497
|
+
"task/stopAll": { params: TaskStopAllParams; result: TaskStopAllResult };
|
|
4498
|
+
/** Lists the loaded session's background-task inventory: one row per stoppable workload at admission, ordered oldest-start first (tdd §3.31, #45144; enrolled under the #33065 T1 ruling). */
|
|
4499
|
+
"task/list": { params: TaskListParams; result: TaskListResult };
|
|
4500
|
+
/** Sets the session goal objective; wakes a goal-driving turn iff idle and the resulting goal is unfinished (tdd SS3.18, spec 14408; enrolled by #33066). */
|
|
4501
|
+
"goal/set": { params: GoalSetParams; result: GoalCommandResult };
|
|
4502
|
+
/** Replaces the current goal's objective under the same wake gate as goal/set (tdd SS3.18, spec 14408; enrolled by #33066). */
|
|
4503
|
+
"goal/edit": { params: GoalEditParams; result: GoalCommandResult };
|
|
4504
|
+
/** Clears the session goal; never wakes and its ack never names a turn (tdd SS3.18, spec 14408; enrolled by #33066). */
|
|
4505
|
+
"goal/clear": { params: GoalClearParams; result: GoalCommandResult };
|
|
4506
|
+
/** Pauses the session goal; never wakes and its ack never names a turn (tdd SS3.18, spec 14408; enrolled by #33066). */
|
|
4507
|
+
"goal/pause": { params: GoalPauseParams; result: GoalCommandResult };
|
|
4508
|
+
/** Resumes a paused goal under the same wake gate as goal/set (tdd SS3.18, spec 14408; enrolled by #33066). */
|
|
4509
|
+
"goal/resume": { params: GoalResumeParams; result: GoalCommandResult };
|
|
4510
|
+
/** Cancels a live workflow run; admission-only bare ack, the cancellation's truth arrives as the workflow item's view events (tdd SS3.19, spec 14410; enrolled by the #33065 sweep). */
|
|
4511
|
+
"workflow/cancel": { params: WorkflowCancelParams; result: WorkflowControlResult };
|
|
4512
|
+
/** Skips or retries one workflow child keyed by the item's (childId, attempt) pair; admission-only bare ack (tdd SS3.20, spec 14410; enrolled by the #33065 sweep). */
|
|
4513
|
+
"workflow/childControl": { params: WorkflowChildControlParams; result: WorkflowControlResult };
|
|
4514
|
+
/** Pauses a live workflow run; admission-only bare ack, the pause folds as the workflow item's `paused` member (tdd SS3.32, ADR 45437 D2). */
|
|
4515
|
+
"workflow/pause": { params: WorkflowPauseParams; result: WorkflowControlResult };
|
|
4516
|
+
/** Resumes a paused workflow run, host-driven; the reply names the driven turn, the resumed launch folds as a new workflow item whose `resumeFromRunId` names the paused run (tdd SS3.34, ADR 45437 D3). */
|
|
4517
|
+
"workflow/resume": { params: WorkflowResumeParams; result: WorkflowResumeResult };
|
|
4518
|
+
/** Moves one video chunk into the session's video store; answers the `uploadId` receipt on every chunk (tdd SS3.33, ADR 45443 D5). */
|
|
4519
|
+
"media/upload": { params: MediaUploadParams; result: MediaUploadResult };
|
|
4520
|
+
/** Attaches this connection's live view subscription for a session at an explicit cursor, replaying `(after, head]` before any live event; the re-attach path after `view/unsubscribe` (SS4.7.1). */
|
|
4521
|
+
"view/subscribe": { params: ViewSubscribeParams; result: ViewSubscribeResult };
|
|
4522
|
+
/** Removes this connection from the session's view subscription set; does not unload the session (SS4.7.2). */
|
|
4523
|
+
"view/unsubscribe": { params: ViewUnsubscribeParams; result: ViewUnsubscribeResult };
|
|
4524
|
+
/** Cursor-paged reads of the session view, forward or backward; each result element is an unframed view notification, the nested {method, params} pair of SS4.2.1 (SS4.7.3). */
|
|
4525
|
+
"view/page": { params: ViewPageParams; result: ViewPageResult };
|
|
4526
|
+
/** Byte-ranged read of stored full output the view truncated; works on loaded and unloaded sessions and takes no lease (SS4.7.4). */
|
|
4527
|
+
"item/readOutput": { params: ItemReadOutputParams; result: ItemReadOutputResult };
|
|
4528
|
+
/** Decides a pending approval, guarded by the current requirement id against the multi-stage race (SS5.4). */
|
|
4529
|
+
"approval/decide": { params: ApprovalDecideParams; result: ApprovalDecideResult };
|
|
4530
|
+
/** Reads the full pending approval and user-input payloads for a session; a lease-free fold read (SS5.7). */
|
|
4531
|
+
"approval/listPending": { params: ApprovalListPendingParams; result: ApprovalListPendingResult };
|
|
4532
|
+
/** Selects a preconfigured approval enforcement mode mid-session; select, never create (SS5.12). */
|
|
4533
|
+
"session/setApprovalMode": { params: SessionSetApprovalModeParams; result: SessionSetApprovalModeResult };
|
|
4534
|
+
/** Answers every question of an open user-input prompt (SS5.10.2). */
|
|
4535
|
+
"userInput/answer": { params: UserInputAnswerParams; result: UserInputAnswerResult };
|
|
4536
|
+
/** Declines an open user-input prompt; the tool call resolves with a cancelled result the model sees (SS5.10.2). */
|
|
4537
|
+
"userInput/cancel": { params: UserInputCancelParams; result: UserInputCancelResult };
|
|
4538
|
+
/** Answers an open user-input prompt with a free-form clarification the model re-decides against (SS5.10.2). */
|
|
4539
|
+
"userInput/clarify": { params: UserInputClarifyParams; result: UserInputClarifyResult };
|
|
4540
|
+
/** Interrupts an open user-input prompt carrying confirmed partial answers, then stops the turn (SS5.10.2, ADR 45450 D1). */
|
|
4541
|
+
"userInput/interrupt": { params: UserInputInterruptParams; result: UserInputInterruptResult };
|
|
4542
|
+
/** Reads the host's last-observed subscription usage window (5h-class and weekly percent blocks, tier, arrival stamp) without a model call; the usage member is omitted when nothing has been observed (ADR 32563 D2). */
|
|
4543
|
+
"usage/read": { params: undefined; result: UsageReadResult };
|
|
4544
|
+
/** Submits a first-party feedback report through the host, reusing the TUI submitter seam (consent, bundle-first persistence, redaction), and answers the upload receipt (ADR 42691 D2). */
|
|
4545
|
+
"feedback/submit": { params: FeedbackSubmitParams; result: FeedbackSubmitResult };
|
|
4546
|
+
/** 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 (ADR 45447 D1/D5, tdd SS3.28.1). */
|
|
4547
|
+
"recap/request": { params: RecapRequestParams; result: RecapRequestResult };
|
|
4548
|
+
/** Cancels the session's in-flight recap, which settles `cancelled`; idle is an accepted no-op (ADR 45447 D5, tdd SS3.28.5). */
|
|
4549
|
+
"recap/cancel": { params: RecapCancelParams; result: RecapCancelResult };
|
|
4550
|
+
/** Runs one model completion with no session on the host's model; acks `accepted` and settles exactly once on `model/completed` — 4 in flight per connection, host-enforced 45s timeout (ADR 90352 D1-D4, tdd SS3.40). */
|
|
4551
|
+
"model/complete": { params: ModelCompleteParams; result: ModelCompleteResult };
|
|
4552
|
+
/** Cancels the sending connection's `model/complete` call, which settles `cancelled`; any other id answers `{}` and changes nothing (ADR 90352 D4/D6, tdd SS3.40). */
|
|
4553
|
+
"model/cancel": { params: ModelCancelParams; result: ModelCancelResult };
|
|
4554
|
+
/** Reads the computer-use Settings: each capability's Always allow switch and the user's blocked apps from the approval policy store, plus the built-in blocks as locked rows when asked; computerUseUnavailable while the CUA gate is off (ADR 630 D18.17). */
|
|
4555
|
+
"computerUseSettings/read": { params: ComputerUseSettingsReadParams; result: ComputerUseSettings };
|
|
4556
|
+
/** Applies one Settings patch (capability dropdowns, blocked apps to add or remove) all-or-nothing and answers the user's Settings after it; a built-in block is refused in either list; computerUseUnavailable while the CUA gate is off (ADR 630 D18.17). */
|
|
4557
|
+
"computerUseSettings/update": { params: ComputerUseSettingsUpdateParams; result: ComputerUseSettings };
|
|
4558
|
+
/** Reads one session's computer-use setup state and permissions by running cua_setup status for it as a host command: no model turn, no prompt, no spawn; computerUseUnavailable while the CUA gate is off (#52381). Without sessionId it reads the host's own setup, with computerUseHostSetup. */
|
|
4559
|
+
"computerUseSetup/read": { params: ComputerUseSetupReadParams; result: ComputerUseSetupState };
|
|
4560
|
+
/** A human command: runs cua_setup start for one session, between turns, exactly as the TUI's /cua on does, and answers the state it settles in, with the refusal code when setup refused; computerUseUnavailable while the CUA gate is off (#52381). Without sessionId it starts the host's own setup under one host owner, with computerUseHostSetup. */
|
|
4561
|
+
"computerUseSetup/start": { params: ComputerUseSetupStartParams; result: ComputerUseSetupState };
|
|
4562
|
+
/** Reads the host's three macOS grants with no prompt: starts the computer-use helper only long enough to check them, reports each as granted or missing, and ends it; never requests a grant or opens System Settings. Needs computerUseHostSetup; commandRejected runtime_busy while a setup attempt holds the host. */
|
|
4563
|
+
"computerUseSetup/check": { params: undefined; result: ComputerUseSetupState };
|
|
4564
|
+
}
|
|
4565
|
+
|
|
4566
|
+
/** Every wire notification's `params` type, keyed by method (SS1.9 index); `undefined` for a notification that carries none. */
|
|
4567
|
+
export interface MspNotificationMap {
|
|
4568
|
+
/** Client-to-server notification closing the handshake; no params (SS1.4.2). */
|
|
4569
|
+
"initialized": undefined;
|
|
4570
|
+
/** A session became newly loaded on this host via session/start or session/fork; broadcast to every initialized connection (SS2.6.1). */
|
|
4571
|
+
"session/started": SessionStartedParams;
|
|
4572
|
+
/** A loaded session was unloaded (idle | hostShutdown | leave) with the final view cursor; broadcast to every initialized connection (SS2.6.2). */
|
|
4573
|
+
"session/closed": SessionClosedParams;
|
|
4574
|
+
/** Protected correlated terminal for an admitted session/leave (SS2.15). */
|
|
4575
|
+
"session/leaveCompleted": SessionLeaveCompletedParams;
|
|
4576
|
+
/** The session's user-invocable skill set changed; clients re-issue skill/list. A live host-state projection, not a view event (SS3.22.2). */
|
|
4577
|
+
"skill/changed": SkillChangedParams;
|
|
4578
|
+
/** A foreground turn began running (SS4.5.1). */
|
|
4579
|
+
"turn/started": TurnStartedParams;
|
|
4580
|
+
/** Turn terminal: completed | failed | cancelled, with usage and the settled error object (SS4.5.1). */
|
|
4581
|
+
"turn/completed": TurnCompletedParams;
|
|
4582
|
+
/** An accepted interrupt's paired retract durably settled, accepted or declined (SS4.5.1; ADR 50074 D1). */
|
|
4583
|
+
"turn/retracted": TurnRetractedParams;
|
|
4584
|
+
/** A failing model attempt's retry is scheduled and waiting out its backoff; observable mid-turn, non-terminal (SS4.5.1, D-026). */
|
|
4585
|
+
"turn/retryScheduled": TurnRetryScheduledParams;
|
|
4586
|
+
/** A provider backoff behind one model attempt is scheduled and waiting out its delay; observable mid-turn, non-terminal (SS4.5.1; ADR 50047-model-retry-scheduled-members D1). */
|
|
4587
|
+
"turn/modelRetryScheduled": TurnModelRetryScheduledParams;
|
|
4588
|
+
/** A turn's model attempt is starting: its model provider task recorded its opening status; observable mid-turn, non-terminal (SS4.5.1; ADR 68644-model-attempt-started D1). */
|
|
4589
|
+
"turn/modelAttemptStarted": TurnModelAttemptStartedParams;
|
|
4590
|
+
/** A queued submit's reclaim durably won: its pre-minted turn never runs, and no turn/started or turn/completed will follow for that turnId (SS3.6, SS4.5.1). */
|
|
4591
|
+
"turn/unqueued": TurnUnqueuedParams;
|
|
4592
|
+
/** The turn's foreground work is done while named background reminder checks hold the turn open; explicitly non-terminal (SS4.5.12). */
|
|
4593
|
+
"turn/foregroundCompleted": TurnForegroundCompletedParams;
|
|
4594
|
+
/** An item opened on the transcript (SS4.3). */
|
|
4595
|
+
"item/started": ItemStartedParams;
|
|
4596
|
+
/** An open item changed non-terminally: full re-emission at a higher revision (SS4.4.2). */
|
|
4597
|
+
"item/updated": ItemUpdatedParams;
|
|
4598
|
+
/** Streaming append to an open item's field path (ephemeral-sourced, no sourceRange; opt-out-able) (SS4.3.1). */
|
|
4599
|
+
"item/delta": ItemDeltaParams;
|
|
4600
|
+
/** An item reached its terminal state: the authoritative final object (SS4.3). */
|
|
4601
|
+
"item/completed": ItemCompletedParams;
|
|
4602
|
+
/** Push delivery dropped events: `(after, next)` brackets the undelivered range and delivery continues from `next` (SS4.8; spec 208 FM-001). */
|
|
4603
|
+
"view/gap": ViewGapParams;
|
|
4604
|
+
/** An approval opened: the fold of its durable Requested record (SS5.5.1). */
|
|
4605
|
+
"approval/requested": ApprovalRequestParams;
|
|
4606
|
+
/** A non-terminal approval record changed the pending view (SS5.5.1). */
|
|
4607
|
+
"approval/updated": ApprovalUpdatedParams;
|
|
4608
|
+
/** The native reviewer holds an approval: the fold of a Requested whose phase is automated_reviewing; typed activity, not a request (SS5.5.1, spec 209 FR-52080-1). */
|
|
4609
|
+
"approval/reviewing": ApprovalRequestParams;
|
|
4610
|
+
/** The first durable approval terminal landed; protected delivery (SS5.5). */
|
|
4611
|
+
"approval/resolved": ApprovalResolvedParams;
|
|
4612
|
+
/** A user-input prompt opened: the fold of its durable Requested record (SS5.10.1). */
|
|
4613
|
+
"userInput/requested": UserInputRequestParams;
|
|
4614
|
+
/** The first durable user-input settlement landed; protected delivery (SS5.10.3). */
|
|
4615
|
+
"userInput/settled": UserInputSettledParams;
|
|
4616
|
+
/** Client-to-server engagement note: the user started interacting with a timed prompt, so the host disarms its countdown; no result, no errors, no ledger row (SS5.10.4, ADR 45450 D2). */
|
|
4617
|
+
"userInput/engaged": UserInputEngagedParams;
|
|
4618
|
+
/** A durable model selection took effect (SS4.6.1). */
|
|
4619
|
+
"session/modelChanged": SessionModelChangedParams;
|
|
4620
|
+
/** A durable session-default reasoning-effort change took effect (SS4.6.9, ADR 31255 D1). */
|
|
4621
|
+
"session/reasoningEffortChanged": SessionReasoningEffortChangedParams;
|
|
4622
|
+
/** A loaded session's (status, attention) flipped; command-plane broadcast, cursor-stamped, not subscription-gated (SS4.6.10, ADR 31983 D2). */
|
|
4623
|
+
"session/statusChanged": SessionStatusChangedParams;
|
|
4624
|
+
/** The session's goal block changed value; replace wholesale, an explicit null clears (SS4.6.2). */
|
|
4625
|
+
"session/goalChanged": SessionGoalChangedParams;
|
|
4626
|
+
/** The todo list was replaced wholesale; empty items is a cleared list (SS4.6.3). */
|
|
4627
|
+
"session/todoListChanged": SessionTodoListChangedParams;
|
|
4628
|
+
/** A durable workspace-branch observation landed; null branch is a detached-HEAD fact (SS4.6.4). */
|
|
4629
|
+
"session/branchChanged": SessionBranchChangedParams;
|
|
4630
|
+
/** A model call completed with usage: raw counters plus counted-once derivations plus session cumulative (SS4.6.5). */
|
|
4631
|
+
"session/tokenUsage": SessionTokenUsageParams;
|
|
4632
|
+
/** A provider-reported context-occupancy fact folded to a changed (windowTokens, usedTokens, pressure) triple (SS4.6.6). */
|
|
4633
|
+
"session/contextUsage": SessionContextUsageParams;
|
|
4634
|
+
/** The approval enforcement mode changed: the fold of the durable reconfigure audit fact (SS5.12). */
|
|
4635
|
+
"session/approvalModeChanged": SessionApprovalModeChangedParams;
|
|
4636
|
+
/** 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 (ADR 45447 D2, tdd SS3.28.2). */
|
|
4637
|
+
"recap/completed": RecapCompletedParams;
|
|
4638
|
+
/** A model/complete call settled exactly once: `completed`, `failed`, `cancelled` or `timedOut`, to the requesting connection only (ADR 90352 D2, tdd SS3.40). */
|
|
4639
|
+
"model/completed": ModelCompletedParams;
|
|
4640
|
+
/** 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 (#25603, spec 5469 Amendment 16). */
|
|
4641
|
+
"session/modelRouteUnserved": SessionModelRouteUnservedParams;
|
|
4642
|
+
/** A durable session-name record landed (rename or first naming): the fold of the session_name record (SS4.6.7, #27598). */
|
|
4643
|
+
"session/nameChanged": SessionNameChangedParams;
|
|
4644
|
+
/** A loaded session's live view stream became unavailable, and why: a command-plane push delivered independent of the view subscription set when the materialized projection fails closed (ADR 32557; #32557). */
|
|
4645
|
+
"session/viewHealthChanged": SessionViewHealthChangedParams;
|
|
4646
|
+
/** The changed session/list row, full-row replace; opt-in per connection via the sessionListStream capability, never subscription-gated (#33084, ADR 33084 D2/D3). */
|
|
4647
|
+
"session/listChanged": SessionListChangedParams;
|
|
4648
|
+
/** The host's last-observed subscription usage DATA changed (window, weekly, or tier — not a stamp-only refresh), with the same payload shape as usage/read's usage member; the absent-to-present first observation emits (ADR 32563 D3). */
|
|
4649
|
+
"usage/changed": SubscriptionUsage;
|
|
4650
|
+
/** A computerUseSetup/read or /start observed a session's setup state differ from the last one sent for it, including inProgress when a start begins and the state it settles in (#52381). Without sessionId it carries the host's own setup state, delivered only with computerUseHostSetup. */
|
|
4651
|
+
"computerUseSetup/changed": ComputerUseSetupChanged;
|
|
4652
|
+
/** An install landed; carries the installed-row summary and clients re-issue `plugin/list` (ADR 45434 D5). */
|
|
4653
|
+
"plugin/changed": PluginChangedParams;
|
|
4654
|
+
/** A marketplace was added, updated, or removed; carries the change summary (ADR 45434 D5). */
|
|
4655
|
+
"plugin/marketplaceChanged": PluginMarketplaceChangedParams;
|
|
4656
|
+
/** One monitor inbox admission: the fold keys gate-off consumes (SS4.5.18). */
|
|
4657
|
+
"monitor/inboxItemAdmitted": MonitorInboxItemAdmittedParams;
|
|
4658
|
+
/** One monitor inbox drain with its recorded stamp, the drain-side operand of latest-wins (SS4.5.18). */
|
|
4659
|
+
"monitor/inboxItemDrained": MonitorInboxItemDrainedParams;
|
|
4660
|
+
/** One wake-missed void with its recorded stamp; count-only, no transcript row (SS4.5.18). */
|
|
4661
|
+
"monitor/inboxItemVoided": MonitorInboxItemVoidedParams;
|
|
4662
|
+
}
|
|
4663
|
+
|
|
4664
|
+
/** Every server-initiated wire request's `params` type and the `result` the client answers with, keyed by method (SS5.3/SS5.10.1 index). */
|
|
4665
|
+
export interface MspServerRequestMap {
|
|
4666
|
+
/** Server-initiated must-answer request presenting a pending approval to every subscribed connection; the response is the SS5.3.3 presentation receipt — the decision travels as approval/decide (SS5.3; indexed by #23840). */
|
|
4667
|
+
"approval/request": { params: ApprovalRequestParams; result: RequestReceipt };
|
|
4668
|
+
/** Server-initiated must-answer request presenting a pending user-input prompt; the response is the SS5.3.3 presentation receipt — the answer travels as userInput/answer (SS5.10.1; indexed by #23840). */
|
|
4669
|
+
"userInput/request": { params: UserInputRequestParams; result: RequestReceipt };
|
|
4670
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muse-code/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.23",
|
|
4
4
|
"description": "TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/meta-models/muse-code-sdk",
|