@muse-code/sdk 1.4.13 → 1.4.15
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 +38 -3
- package/dist/src/connection/connection.js +2 -1
- package/dist/src/connection/discovery.d.ts +14 -0
- package/dist/src/connection/discovery.js +39 -0
- package/dist/src/errors.d.ts +37 -0
- package/dist/src/errors.js +52 -0
- package/dist/src/facade/approval.js +6 -0
- package/dist/src/facade/client.d.ts +76 -10
- package/dist/src/facade/client.js +152 -10
- package/dist/src/facade/run.d.ts +50 -0
- package/dist/src/facade/run.js +132 -0
- package/dist/src/facade/session.d.ts +83 -3
- package/dist/src/facade/session.js +290 -2
- package/dist/src/facade/turn-handle.d.ts +65 -6
- package/dist/src/facade/turn-handle.js +19 -3
- package/dist/src/facade/turn-submit.d.ts +27 -16
- package/dist/src/facade/turn-submit.js +68 -28
- package/dist/src/fingerprint.d.ts +4 -18
- package/dist/src/fingerprint.js +30 -20
- package/dist/src/fingerprint.stamped.d.ts +1 -0
- package/dist/src/fingerprint.stamped.js +6 -0
- package/dist/src/fold/session-fold.d.ts +19 -5
- package/dist/src/fold/session-fold.js +73 -1
- package/dist/src/index.d.ts +5 -4
- package/dist/src/index.js +1 -1
- package/dist/src/msp.d.ts +436 -25
- package/package.json +3 -1
package/dist/src/msp.d.ts
CHANGED
|
@@ -29,7 +29,7 @@ export interface ApprovalChange {
|
|
|
29
29
|
decision?: ApprovalDecision;
|
|
30
30
|
/** A recovery detail: whether the action could run without a new decision. Present only when `kind` is `restartRecovered`. */
|
|
31
31
|
executable?: boolean;
|
|
32
|
-
/** What happened: for example `stageResolved` (a shell stage was satisfied), `policyPersistence` (saving a rule succeeded or failed), `reviewStarted` or `reviewCompleted` (the automated LLM judge started or finished reviewing), `restartRecovered` (a host restart recovered this approval: either the host first resolves it `abort` and a re-ask comes as a new approval with a new `approvalId`, or it stays pending under the same `approvalId` with refreshed choices)
|
|
32
|
+
/** What happened: for example `stageResolved` (a shell stage was satisfied), `policyPersistence` (saving a rule succeeded or failed), `reviewStarted` or `reviewCompleted` (the automated LLM judge started or finished reviewing), `restartRecovered` (a host restart recovered this approval: either the host first resolves it `abort` and a re-ask comes as a new approval with a new `approvalId`, or it stays pending under the same `approvalId` with refreshed choices), `alreadyTerminal` (recovery found it already decided) or `resolving` (a `computerUseTakeover` approval was marked resolving and waits for the lock broker; a decide now answers -32059). The set is open, so newer hosts may add kinds. */
|
|
33
33
|
kind: string;
|
|
34
34
|
/** Why saving the policy rule failed, as human-readable text. Present only when `kind` is `policyPersistence` and `status` is `failed`. */
|
|
35
35
|
reason?: string;
|
|
@@ -214,6 +214,8 @@ export interface ApprovalRequestParams {
|
|
|
214
214
|
protectedWrite: boolean;
|
|
215
215
|
/** The tool call's arguments as a string, usually JSON. With `toolName`, it lets a client show a subject whose `kind` it does not recognize. */
|
|
216
216
|
rawArgs: string;
|
|
217
|
+
/** The judge's escalation reason as one bounded display line (ADR 8609 D3: first sentence, whitespace controls folded, other control and format scalars stripped, 100 extended grapheme clusters max). Present only on a request released by a valid structured `escalate` with a non-blank judge rationale; absent on every other approval. A display hint only, like `judge_escalated`: it never authorizes anything. */
|
|
218
|
+
reviewerReason?: string;
|
|
217
219
|
/** The owning session. For a subagent's approval shown on the parent, this is the parent session. */
|
|
218
220
|
sessionId: string;
|
|
219
221
|
/** The stored records this event was folded from: an opaque token clients must not interpret. */
|
|
@@ -257,6 +259,8 @@ export type ApprovalResolvedBy = "user" | "policy" | "llmJudge" | (string & {});
|
|
|
257
259
|
|
|
258
260
|
/** `approval/resolved` params: the first durable terminal decision. */
|
|
259
261
|
export interface ApprovalResolvedParams {
|
|
262
|
+
/** Why an `abort` was not a cancel, when the host knows: `lockEpochEnded | brokerUnavailable`, an open vocabulary (tdd SS5.5). Clients render an unknown value like an absent one. */
|
|
263
|
+
abortReason?: string;
|
|
260
264
|
/** The policy rule the decision created. Present only when the decision created one. */
|
|
261
265
|
amendment?: ApprovalAmendment;
|
|
262
266
|
/** The approval that was decided. */
|
|
@@ -345,9 +349,11 @@ export interface ApprovalSubject {
|
|
|
345
349
|
access?: string;
|
|
346
350
|
/** The full raw shell command. Present when `kind` is `shell`. */
|
|
347
351
|
command?: string;
|
|
352
|
+
/** The session that holds the Computer Use lock now, by label and times only. Present when `kind` is `computerUseTakeover` (tdd SS5.2.8). */
|
|
353
|
+
holder?: ComputerUseLockHolder;
|
|
348
354
|
/** The network host the tool wants to reach. Present when `kind` is `network`. */
|
|
349
355
|
host?: string;
|
|
350
|
-
/** Open discriminator: `shell | fileAccess | network | unixSocket | process | tool`. */
|
|
356
|
+
/** Open discriminator: `shell | fileAccess | network | unixSocket | process | tool | computerUseTakeover`. */
|
|
351
357
|
kind: string;
|
|
352
358
|
/** What triggered the action (a shell command or a URL), for display only and untrusted. It is not sent on `shell` subjects, and policy rules never match on it. */
|
|
353
359
|
origin?: ApprovalOrigin;
|
|
@@ -403,14 +409,30 @@ export type AttentionFlag = "approvalPending" | "inputPending" | (string & {});
|
|
|
403
409
|
/** Who durably backgrounded a task (tdd SS4.5.5, `TaskBackgroundedInitiator`). Open — runtime vocabulary. */
|
|
404
410
|
export type BackgroundInitiator = "user" | "timeout" | (string & {});
|
|
405
411
|
|
|
406
|
-
/**
|
|
412
|
+
/** One call's live background-target record (tdd SS4.5.5; ADR 63254-background-target-on-tool-call D2): exactly the runtime snapshot's four facts, no new nouns. */
|
|
413
|
+
export interface BackgroundTarget {
|
|
414
|
+
/** Whether the background was already requested for this call. */
|
|
415
|
+
backgroundRequested: boolean;
|
|
416
|
+
/** Whether the call sits in its foreground wait right now. */
|
|
417
|
+
foregroundWaitActive: boolean;
|
|
418
|
+
/** Point-in-time Ctrl+B chooser hint; the runtime re-checks admission on the action. */
|
|
419
|
+
manualReleaseAdmissible: boolean;
|
|
420
|
+
/** The tool call this record describes (the provider call id). */
|
|
421
|
+
toolCallId: string;
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
/** `backgroundTerminalCompletion`: the facts the Finished cell renders (ADR 50041 D3/D4, plus the optional exit code from D28 and the optional reason from D29). The fold reads them from the inbox terminal record and the backgrounded call it names; every member is required (empty output serializes as `""`, never absent) except `exit_code` and `reason`, each absent when the terminal carries none. */
|
|
407
425
|
export interface BackgroundTerminalCompletion {
|
|
408
426
|
/** The title text gate-off shows for the backgrounded command. */
|
|
409
427
|
command: string;
|
|
428
|
+
/** The process exit code from the terminal record's `exit_code: ` line (ADR 50041 D28); absent when the terminal carries none. `i32`, the gate-off frozen-header twin's width (`BackgroundTerminalTailTerminal.exit_code`). Old clients ignore the unknown member (tdd evolution rule). */
|
|
429
|
+
exitCode?: number;
|
|
410
430
|
/** The completion text; empty when the terminal carries none. */
|
|
411
431
|
output: string;
|
|
412
432
|
/** True when `output` is a prefix of the terminal text. */
|
|
413
433
|
outputTruncated: boolean;
|
|
434
|
+
/** The terminal's reason from the terminal record's `reason: ` line, trimmed like gate-off's parse (ADR 50041 D29); absent when the terminal carries none or an empty one. Old clients ignore the unknown member (tdd evolution rule). */
|
|
435
|
+
reason?: string;
|
|
414
436
|
/** One of `completed`, `failed`, `cancelled`, `timedOut`, `rejected` (the ItemStatus wire vocabulary, tdd SS4.4.1). */
|
|
415
437
|
terminalStatus: string;
|
|
416
438
|
/** The backgrounded call's call id: the live/history correlation key behind the skip-when-minted rule (ADR 50041 D6). */
|
|
@@ -566,6 +588,16 @@ export interface ComputerUseInstalledApp {
|
|
|
566
588
|
name: string;
|
|
567
589
|
}
|
|
568
590
|
|
|
591
|
+
/** The Computer Use lock's holder as a `computerUseTakeover` approval shows it: never its app, window, target or current action (ADR 73131 D2). */
|
|
592
|
+
export interface ComputerUseLockHolder {
|
|
593
|
+
/** When the holder took the lock (RFC 3339). */
|
|
594
|
+
acquiredAt: string;
|
|
595
|
+
/** When the holder last acted under the lock (RFC 3339). */
|
|
596
|
+
lastActivityAt: string;
|
|
597
|
+
/** The holding session's label. */
|
|
598
|
+
sessionLabel: string;
|
|
599
|
+
}
|
|
600
|
+
|
|
569
601
|
/** One macOS permission as setup last saw it. **Open**, like the phase. */
|
|
570
602
|
export type ComputerUsePermission = "granted" | "missing" | "unknown" | (string & {});
|
|
571
603
|
|
|
@@ -715,6 +747,36 @@ export interface DamagedRange {
|
|
|
715
747
|
unreadableLines: number;
|
|
716
748
|
}
|
|
717
749
|
|
|
750
|
+
/** One input the read session's log delivered to a subagent (tdd SS2.5.5, ADR 72596-delivered-inputs-on-read D2): the queue-note summary (never the body) plus the queue and drain record sequences, the order and re-read dedupe keys, plus the join ids clients adopt already-rendered rows by. */
|
|
751
|
+
export interface DeliveredInput {
|
|
752
|
+
/** The matching drain record's log sequence: the Delivered row's position key. */
|
|
753
|
+
deliveredSequence: number;
|
|
754
|
+
/** The queued record's log sequence: entry order, and half of the sequence-pair join key. */
|
|
755
|
+
sequence: number;
|
|
756
|
+
/** The `SubagentInput` record's command id: the key wire-twin rows join by in either order. Absent when the record carries none. */
|
|
757
|
+
sourceCommandId?: string;
|
|
758
|
+
/** The queue record's run-log id: the record-row join key. Absent when the host's record carries no mirror metadata (a pre-feature host), which falls back to the command id, then the sequence-pair join. */
|
|
759
|
+
sourceRunRecordId?: string;
|
|
760
|
+
/** The subagent the input was delivered to (parent-scope id). */
|
|
761
|
+
subagentId: string;
|
|
762
|
+
/** The stored queue-note summary (never the body). */
|
|
763
|
+
summary: string;
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/** `earlierHistory`: the boundary checkpoint's transcript tail, served in place of every item that opened in its pruned prefix (ADR 71910 D1/D3). No log record carries it; the host derives it from the checkpoint. */
|
|
767
|
+
export interface EarlierHistory {
|
|
768
|
+
/** The tail entries whose source record is in the pruned prefix, in tail order (at most 50, spec 6127 INV-002). May be empty. */
|
|
769
|
+
messages: EarlierHistoryMessage[];
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
/** One transcript-tail message of an [`EarlierHistory`] item. */
|
|
773
|
+
export interface EarlierHistoryMessage {
|
|
774
|
+
/** Open string enum: `"user"` or `"assistant"`, the only roles a host serves; a client skips any other value (spec 6127 FM-004). */
|
|
775
|
+
role: string;
|
|
776
|
+
/** The stored tail text verbatim (at most 1,000 characters); clients apply their own assistant display rules. */
|
|
777
|
+
text: string;
|
|
778
|
+
}
|
|
779
|
+
|
|
718
780
|
/** The effective approval-mode projection (`EffectiveApprovalModeState`, tdd SS5.12): the same object `session/setApprovalMode` returns as `effectiveMode` and the `Session` object carries as `approvalMode`. */
|
|
719
781
|
export interface EffectiveApprovalModeState {
|
|
720
782
|
/** The command that last set it; `null` when no command did. */
|
|
@@ -806,7 +868,7 @@ export interface ErrorData {
|
|
|
806
868
|
}
|
|
807
869
|
|
|
808
870
|
/** A stable `error.data.kind` category: camelCase, the value clients branch on. Open: new kinds are added as their methods land, and a new `kind` is additive only because this domain is declared open. */
|
|
809
|
-
export type ErrorKind = "parseError" | "invalidRequest" | "notInitialized" | "alreadyInitialized" | "methodNotFound" | "invalidParams" | "experimentalRequired" | "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" | (string & {});
|
|
871
|
+
export type ErrorKind = "parseError" | "invalidRequest" | "notInitialized" | "alreadyInitialized" | "methodNotFound" | "invalidParams" | "experimentalRequired" | "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" | (string & {});
|
|
810
872
|
|
|
811
873
|
/** The `error` member of an error response (SS1.2 §2.4). */
|
|
812
874
|
export interface ErrorObject {
|
|
@@ -828,6 +890,12 @@ export interface ErrorResponse {
|
|
|
828
890
|
jsonrpc: JsonRpcVersion;
|
|
829
891
|
}
|
|
830
892
|
|
|
893
|
+
/** The live host-declared external wait as served on a `Session` object (`Session.externalWait`): present exactly while a declaration is live for the loaded session, absent otherwise. Absence is never fabricated — an unloaded row carries no member. */
|
|
894
|
+
export interface ExternalWaitView {
|
|
895
|
+
/** The host's label for what the session waits on. Omitted when the host declared without one. */
|
|
896
|
+
reason?: string;
|
|
897
|
+
}
|
|
898
|
+
|
|
831
899
|
/** `feedback/submit` classification (tdd SS3.25): the four TUI classes in camelCase wire spelling. **Closed**: a client-selected param vocabulary (#22785 E2). */
|
|
832
900
|
export type FeedbackClassification = "bug" | "badResult" | "goodResult" | "other";
|
|
833
901
|
|
|
@@ -888,6 +956,8 @@ export interface ForkProvenance {
|
|
|
888
956
|
cutCursor: string;
|
|
889
957
|
/** Whether the fork named an explicit cut point. */
|
|
890
958
|
cutExplicit: boolean;
|
|
959
|
+
/** `true` when validated full provenance records a conversation rewind, `false` for a proved ordinary fork (ADR 50280 D8). **Additive-optional**: omitted when the serving face holds no full provenance, which means unknown, never a guessed ordinary fork; never `null`. */
|
|
960
|
+
isRewind?: boolean;
|
|
891
961
|
/** The source session this fork was cut from. */
|
|
892
962
|
sessionId: string;
|
|
893
963
|
}
|
|
@@ -964,13 +1034,16 @@ export interface GoalSetParams {
|
|
|
964
1034
|
sessionId: string;
|
|
965
1035
|
}
|
|
966
1036
|
|
|
1037
|
+
/** What holds a tool call before it is admitted to execute (ADR 50063 D6). Open: a client reads an unknown value as held by something it does not know, never as released. */
|
|
1038
|
+
export type HeldFor = "approval" | "hook" | (string & {});
|
|
1039
|
+
|
|
967
1040
|
/** What history a lifecycle result actually served (tdd SS2.5.2). Open on the client side: report-what-was-served means a client treats an unknown mode as "page it yourself". */
|
|
968
1041
|
export type HistoryMode = "anchoredSnapshot" | "inline" | "snapshot" | "none" | (string & {});
|
|
969
1042
|
|
|
970
|
-
/** Why a result served `history.mode: "none"
|
|
971
|
-
export type HistoryNoneReason = "excluded" | "cursorSuffix" | "historyBudget" | "projectionUnavailable" | "projectionReadLimit" | (string & {});
|
|
1043
|
+
/** Why a result served `history.mode: "none"` — the server's typed reason for serving no history, with one push-only exception: `projectionRebuildFailed` rides only a `session/viewHealthChanged` notification; no resume or read result carries it (see its variant doc). Open on the client side: an absent (older server) or unknown (newer server) value decodes conservatively as an unknown reason, and `viewCursor` text never substitutes for it. */
|
|
1044
|
+
export type HistoryNoneReason = "excluded" | "cursorSuffix" | "historyBudget" | "projectionUnavailable" | "projectionReadLimit" | "projectionRebuildFailed" | (string & {});
|
|
972
1045
|
|
|
973
|
-
/** The `history` request preference of `session/resume` (tdd SS2.5.2). The forced values downgrade `anchored` → `inline` → `snapshot` → `none`; under `auto` the full rung order is anchoredSnapshot → inline → snapshot → elided snapshot → none. */
|
|
1046
|
+
/** The `history` request preference of `session/resume` (tdd SS2.5.2). The forced values downgrade `anchored` → `inline` → `snapshot` → `none`; under `auto` the full rung order is anchoredSnapshot → anchored pending cut → inline → snapshot → pending cut → elided snapshot → elided pending cut → none, a pending cut being the snapshot with its `monitorInbox` cut to the entries still awaiting delivery. */
|
|
974
1047
|
export type HistoryPreference = "auto" | "inline" | "snapshot" | "anchored";
|
|
975
1048
|
|
|
976
1049
|
/** One installed handler (tdd SS3.26.1). */
|
|
@@ -1057,6 +1130,8 @@ export interface Item {
|
|
|
1057
1130
|
background?: boolean;
|
|
1058
1131
|
/** `toolCall`: who backgrounded the task; absent on pre-split records — never inferred (tdd SS4.5.5). */
|
|
1059
1132
|
backgroundInitiator?: BackgroundInitiator;
|
|
1133
|
+
/** `toolCall`: this call's live background-target record (tdd SS4.5.5; ADR 63254-background-target-on-tool-call D1–D2). Set when the foreground tool starts, refreshed by whole-item `item/updated` when the facts change, omitted once the call settles or unregisters — present means a live candidate. Absent (pre-feature hosts, unregistered calls) keeps the client's derived behavior, never an error. Old clients ignore it. */
|
|
1134
|
+
backgroundTarget?: BackgroundTarget;
|
|
1060
1135
|
/** `backgroundTerminalCompletion`: the five facts the Finished cell renders (ADR 50041 D4). */
|
|
1061
1136
|
backgroundTerminalCompletion?: BackgroundTerminalCompletion;
|
|
1062
1137
|
/** `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`. */
|
|
@@ -1083,6 +1158,8 @@ export interface Item {
|
|
|
1083
1158
|
damagedRange?: DamagedRange;
|
|
1084
1159
|
/** `workflow`: the run-level declared-phase label — the last `Phase` detail-row label of the reconciled projection; terminal-only, absent while live (tdd SS4.5.8, #45449). */
|
|
1085
1160
|
declaredPhase?: string;
|
|
1161
|
+
/** `subagentInput` (`delivered`): `true` when the drain landed on its turn before that turn's terminal, which ends the turn's final answer as gate-off's drain record does; absent otherwise (ADR 70249 D4). */
|
|
1162
|
+
deliveredBeforeTurnEnd?: boolean;
|
|
1086
1163
|
/** `scheduledFire`: the occurrence number within the job's history, present with occurrence metadata (tdd SS4.5.17; ADR 45446 D2). */
|
|
1087
1164
|
deliveryNumber?: number;
|
|
1088
1165
|
/** `subagent`: nesting depth. */
|
|
@@ -1093,6 +1170,8 @@ export interface Item {
|
|
|
1093
1170
|
displayText?: string;
|
|
1094
1171
|
/** `userShell`/`subagent`: observed wall-clock duration. `workflow`: the run's wall time from launch to reconciliation, set only on the settling `item/completed` — never a sum of child durations. `toolCall`: the Backgrounded row's duration (ADR 50041 D11) — the open→update record delta in whole ms, served on the `backgroundStatus` re-emission and frozen there; absent otherwise. */
|
|
1095
1172
|
durationMs?: number;
|
|
1173
|
+
/** `earlierHistory`: the boundary checkpoint's transcript tail (ADR 71910 D3, tdd SS4.5.22). */
|
|
1174
|
+
earlierHistory?: EarlierHistory;
|
|
1096
1175
|
/** `workflow`: launched entry identity. */
|
|
1097
1176
|
entryId?: string;
|
|
1098
1177
|
/** `hookRun`: the hook event in Q2 camelCase vocabulary (tdd SS4.5.11). */
|
|
@@ -1111,9 +1190,15 @@ export interface Item {
|
|
|
1111
1190
|
finalSummary?: string;
|
|
1112
1191
|
/** `reminderChild`: the reminder generation. */
|
|
1113
1192
|
generationId?: number;
|
|
1193
|
+
/** `toolCall` (ADR 50063 D4/D6): `true` while the call is held before it is admitted to execute. Present on an item started at hold time, cleared by the release `item/updated`, absent on calls never held. */
|
|
1194
|
+
held?: boolean;
|
|
1195
|
+
/** `toolCall` (ADR 50063 D6): what holds the call; present exactly when `held` is. */
|
|
1196
|
+
heldFor?: HeldFor;
|
|
1114
1197
|
/** `hookRun`: the durable `hook_key` (tdd SS4.5.11). */
|
|
1115
1198
|
hookKey?: string;
|
|
1116
|
-
/**
|
|
1199
|
+
/** `subagentInput`: the record the item stands for; see [`SubagentInputPhase`] (#70249). */
|
|
1200
|
+
inputPhase?: SubagentInputPhase;
|
|
1201
|
+
/** Bare UUIDv7; the item's identity across its whole lifecycle. Identity rule (tdd SS4.4.1): the task id for task-backed kinds (`toolCall`, `subagent`), the pre-minted commit `message_id` for delta-streamed kinds (`agentMessage`, `reasoning`), `EventId::derive` over the session id and the range's starting sequence number for `damagedRange` (no record carries it, SS4.5.16), the same over the boundary checkpoint's sequence number for `earlierHistory` (SS4.5.22), and the opening durable record's event id for everything else. Opaque to clients. */
|
|
1117
1202
|
itemId: string;
|
|
1118
1203
|
/** `scheduledFire`: the cron job id that fired (tdd SS4.5.17; ADR 45446 D2, spec 13929 amendment #62595 FR-62595-1). */
|
|
1119
1204
|
jobId?: string;
|
|
@@ -1123,7 +1208,7 @@ export interface Item {
|
|
|
1123
1208
|
label?: string;
|
|
1124
1209
|
/** `workflow`: the reconciled terminal message, set on completion. */
|
|
1125
1210
|
message?: string;
|
|
1126
|
-
/** `agentMessage`: the phase the model declared
|
|
1211
|
+
/** `agentMessage`: the phase the model declared; see [`MessagePhase`]. */
|
|
1127
1212
|
messagePhase?: MessagePhase;
|
|
1128
1213
|
/** `toolCall`: rich content the model saw beyond text; base64 is not inlined on the view (tdd SS4.5.5). */
|
|
1129
1214
|
modelVisibleContent?: ModelVisibleContent[];
|
|
@@ -1133,18 +1218,30 @@ export interface Item {
|
|
|
1133
1218
|
monitorId?: string;
|
|
1134
1219
|
/** `scheduledFire`: the next scheduled epoch in milliseconds; absent on a final delivery (tdd SS4.5.17; ADR 45446 D2). */
|
|
1135
1220
|
nextFireAtMs?: number;
|
|
1221
|
+
/** `systemNotice`: an optional open machine code for what happened, minted per origin by the slice that adds its producer; omitted for `monitor` and for `hook` (tdd SS4.5.23). */
|
|
1222
|
+
noticeKind?: string;
|
|
1223
|
+
/** `systemNotice`: the producing family, so a client routes a notice without parsing its text (tdd SS4.5.23). Absent means the server named no origin: render generically, never infer one. */
|
|
1224
|
+
noticeOrigin?: NoticeOrigin;
|
|
1225
|
+
/** `systemNotice`: the notice's level — `info` | `warning` | `error`, open (tdd SS4.5.23; ADR 42729 D1). Absent means the server classified no level. */
|
|
1226
|
+
noticeSeverity?: NoticeSeverity;
|
|
1227
|
+
/** `systemNotice`: the durable thing the notice is about — for `hook`, the hook run's item id and its bounded label (tdd SS4.5.23; ADR 75121 D2). */
|
|
1228
|
+
noticeSubject?: NoticeSubject;
|
|
1136
1229
|
/** `subagent`: objective as spawned, bounded on the wire at the 64 KiB retained-text budget (tdd SS4.5.4, ADR 35691 D9); a cut sets `truncated`. The durable record stays verbatim. */
|
|
1137
1230
|
objective?: string;
|
|
1138
1231
|
/** `compaction`: terminal only — folds installed/fallback status. */
|
|
1139
1232
|
outcome?: CompactionOutcome;
|
|
1140
1233
|
/** `toolCall`/`userShell`: stored-output reference; fetch the full bytes via `item/readOutput` (served by #208). */
|
|
1141
1234
|
outputRef?: OutputRef;
|
|
1235
|
+
/** `subagent`: the `subagentId` of the subagent whose own session spawned this child, by `subagent/list`'s `parentSubagentId` rule. **Additive-optional**: absent for a child of the view's own session, or when no open `subagent` item in this view owns the spawning session; never guessed, never derived from `agentPath` (tdd SS4.5.7, #88542). */
|
|
1236
|
+
parentSubagentId?: string;
|
|
1142
1237
|
/** `toolCall`: stored structured-patch reference (`kind: "tool_patch"`, `mediaType: "application/json"`); the body is fetched via `item/readOutput` with `patchRef.id`, and the ref survives the SS2.5.2 elided-snapshot rung exactly like `outputRef` without ever being an elision trigger (tdd SS2.5.2, SS4.5.5; #33025). */
|
|
1143
1238
|
patchRef?: OutputRef;
|
|
1144
1239
|
/** `toolCall`: server-authored edit-family diff summary (#33025) — always beside `patchRef`; absent = no diff available (tdd SS4.5.5). */
|
|
1145
1240
|
patchSummary?: PatchSummary;
|
|
1146
1241
|
/** `workflow`: `true` only while a durable pause fact is in force for the run's generation; absent otherwise, never `false` (tdd SS4.5.8, ADR 45437 D2; the fold sets it on pause commit and clears it on resume-commit supersession or the generation's terminal). */
|
|
1147
1242
|
paused?: boolean;
|
|
1243
|
+
/** `peerMessage`: the four facts the consumed card renders (ADR 72708 D2, tdd SS4.5.24). */
|
|
1244
|
+
peerMessage?: PeerMessage;
|
|
1148
1245
|
/** `reasoning`: provider reasoning item id (e.g. `rs_...`), for provider-side correlation. */
|
|
1149
1246
|
providerItemId?: string;
|
|
1150
1247
|
/** `compaction`: noop/failure reason, verbatim (snake_case durable vocabulary, e.g. `"no_compactable_history"`). `hookRun`: terminal-only capped terminal reason (tdd SS4.5.11). */
|
|
@@ -1157,6 +1254,8 @@ export interface Item {
|
|
|
1157
1254
|
replayHint?: ReplayHint;
|
|
1158
1255
|
/** `subagent`: the result envelope from `ResultReady` (tdd SS4.5.7). */
|
|
1159
1256
|
result?: SubagentResult;
|
|
1257
|
+
/** `subagentResult`: the consumed attempt's outcome; absent if unseen at the drain (#88809). */
|
|
1258
|
+
resultStatus?: SubagentResultStatus;
|
|
1160
1259
|
/** `workflow`: set on resumed launches. */
|
|
1161
1260
|
resumeFromRunId?: string;
|
|
1162
1261
|
/** `userMessage`: `true` after an accepted retract (tdd SS4.5.1); re-emitted via `item/updated`. */
|
|
@@ -1203,7 +1302,7 @@ export interface Item {
|
|
|
1203
1302
|
summary?: string[];
|
|
1204
1303
|
/** `reminderChild`: the linked task id. */
|
|
1205
1304
|
taskId?: string;
|
|
1206
|
-
/** Terminal `toolCall
|
|
1305
|
+
/** Terminal `toolCall`, or a `subagent` whose result drained (#70249): the item after whose rows the terminal row renders (tdd SS4.5.21, ADR 56496 D2/D3). */
|
|
1207
1306
|
terminalRowAfterItemId?: string;
|
|
1208
1307
|
/** `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). */
|
|
1209
1308
|
text?: string;
|
|
@@ -1221,14 +1320,16 @@ export interface Item {
|
|
|
1221
1320
|
trigger?: CompactionTrigger;
|
|
1222
1321
|
/** `workflow`: camelCased `WorkflowLaunchTriggerSource`, verbatim (durable runtime vocabulary, e.g. `"modelProposal"`). */
|
|
1223
1322
|
triggerSource?: string;
|
|
1224
|
-
/** `true` when the server's per-surface text budget saturated a streamed surface (`agentMessage.text`, `reasoning.summary[*]`, `toolCall.visibleOutput`, `userShell.visibleOutput`), cut a `subagent` surface (`objective`, `fallbackText`, `result.summary`, `result.text`), or cut a `monitorFeed` surface (`text`, `fallbackText`, `monitorDescription`) (ADR 50058-monitor-feed-wire D3). On a `subagent` item the flag is item-level and never cleared: once any of those four is cut, every later update keeps it, even when `result.text` arrives whole (ADR 35691 D9). The durable full text remains in the log (tdd SS4.5.4). */
|
|
1323
|
+
/** `true` when the server's per-surface text budget saturated a streamed surface (`agentMessage.text`, `reasoning.summary[*]`, `toolCall.visibleOutput`, `userShell.visibleOutput`), cut a `subagent` surface (`objective`, `fallbackText`, `result.summary`, `result.text`), or cut a `monitorFeed` surface (`text`, `fallbackText`, `monitorDescription`) (ADR 50058-monitor-feed-wire D3), or cut a `systemNotice` surface (`text`, `fallbackText`; the committed-surface budget, ADR 42729 D1, tdd SS4.5.23). On a `subagent` item the flag is item-level and never cleared: once any of those four is cut, every later update keeps it, even when `result.text` arrives whole (ADR 35691 D9). The durable full text remains in the log (tdd SS4.5.4). */
|
|
1225
1324
|
truncated?: boolean;
|
|
1226
|
-
/** The owning turn (== the submitting `commandId` for fresh turns, tdd SS3.1.4). `null` for the kinds outside a turn: `userShell` always (tdd SS4.5.6), `hookRun` for session-boundary runs, `monitorFeed` always (ADR 50058-monitor-feed-wire D1), `sideChat` always (SS4.5.13), `damagedRange` always (ADR 60914 D2). */
|
|
1325
|
+
/** The owning turn (== the submitting `commandId` for fresh turns, tdd SS3.1.4). `null` for the kinds outside a turn: `userShell` always (tdd SS4.5.6), `hookRun` for session-boundary runs, `monitorFeed` always (ADR 50058-monitor-feed-wire D1), `sideChat` always (SS4.5.13), `damagedRange` always (ADR 60914 D2), `earlierHistory` always (ADR 71910 D3), `systemNotice` when produced outside a turn (tdd SS4.5.23). */
|
|
1227
1326
|
turnId?: string | null;
|
|
1228
1327
|
/** `subagent`: **transitive** observed usage — the child and its own descendants; updated in place, absent until first observation; never folded into `session/tokenUsage.cumulative` (tdd SS4.6.5). */
|
|
1229
1328
|
usage?: TokenUsage;
|
|
1230
1329
|
/** `toolCall`/`userShell`: bounded transcript-visible result text (budget per tdd SS4.5.4); streams via `item/delta` field `"output"`. */
|
|
1231
1330
|
visibleOutput?: string;
|
|
1331
|
+
/** `agentMessage`: the Monitor source descriptions for the wake turn's first answer (ADR 62265 D1, #62265) — stripped, bounded, one entry per arming drain in drain order. Absent (or empty) means untagged: the row renders the ordinary untagged shape. The client scrubs per part before joining. */
|
|
1332
|
+
wakeSourceDescriptions?: string[];
|
|
1232
1333
|
/** `toolCall`: the task's registered Work ID, verbatim (`work.v2.managed_bash.sha256.…`); present only when the task registered a ManagedBash id, absent otherwise (tdd SS4.5.5, ADR 50041 D20). Stable from day one: no `x-msp-stability` marker. The host serves it at the later of the task terminal and the inbox admission (D21); absence keeps the client's v1 derivation. */
|
|
1233
1334
|
workId?: string;
|
|
1234
1335
|
/** `subagent`/`workflow`: the owning durable workflow run id (opaque string — not a UUID family). */
|
|
@@ -1262,7 +1363,7 @@ export interface ItemDeltaParams {
|
|
|
1262
1363
|
}
|
|
1263
1364
|
|
|
1264
1365
|
/** 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). */
|
|
1265
|
-
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | "monitorFeed" | "damagedRange" | "scheduledFire" | "backgroundTerminalCompletion" | "overdueNotice" | (string & {});
|
|
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 & {});
|
|
1266
1367
|
|
|
1267
1368
|
/** 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. */
|
|
1268
1369
|
export type ItemReadOutputEncoding = "utf8" | "base64";
|
|
@@ -1382,9 +1483,19 @@ export interface MessageAttachment {
|
|
|
1382
1483
|
width?: number;
|
|
1383
1484
|
}
|
|
1384
1485
|
|
|
1385
|
-
/** `agentMessage.messagePhase` (tdd SS4.5.3, #50254): the phase the model declared
|
|
1486
|
+
/** `agentMessage.messagePhase` (tdd SS4.5.3, #50254): the phase the model declared, never inferred from position. Set on every completed item, and on `item/started` when the host knows the phase (#77396): absent or unknown there means not yet known, and the completed value wins. A failed item carries none, and its missing value does not read as `"finalAnswer"`. Open: a client reads an absent or unknown value on a completed item as `"finalAnswer"` and still decodes the item. Not a turn-done signal; `turn/completed` is. */
|
|
1386
1487
|
export type MessagePhase = "commentary" | "finalAnswer" | (string & {});
|
|
1387
1488
|
|
|
1489
|
+
/** `model/cancel` params (tdd SS3.40, FR-90352-4): the `commandId` of the call to cancel, not a retry id of its own. */
|
|
1490
|
+
export interface ModelCancelParams {
|
|
1491
|
+
/** The call to cancel. */
|
|
1492
|
+
commandId: string;
|
|
1493
|
+
}
|
|
1494
|
+
|
|
1495
|
+
/** `model/cancel` result (ADR 90352 D6): always empty, for a call in flight and for an id no call holds alike; `model/completed` reports the outcome. */
|
|
1496
|
+
export interface ModelCancelResult {
|
|
1497
|
+
}
|
|
1498
|
+
|
|
1388
1499
|
/** One visible catalog row (tdd SS3.10). Catalog rows marked hidden never reach the wire, so a client cannot select one. */
|
|
1389
1500
|
export interface ModelCatalogEntry {
|
|
1390
1501
|
/** Context limit; `null` when the catalog source declared nothing. */
|
|
@@ -1423,6 +1534,69 @@ export type ModelCatalogSource = "providerCatalog" | "fakeCatalog" | "unresolved
|
|
|
1423
1534
|
/** What drove a model selection (tdd SS4.6.1). Open. */
|
|
1424
1535
|
export type ModelChangeSource = "user" | "default" | "policy" | (string & {});
|
|
1425
1536
|
|
|
1537
|
+
/** One `model/complete` message (tdd SS3.40). */
|
|
1538
|
+
export interface ModelCompleteMessage {
|
|
1539
|
+
/** Who said it. */
|
|
1540
|
+
role: ModelCompleteRole;
|
|
1541
|
+
/** What was said. */
|
|
1542
|
+
text: string;
|
|
1543
|
+
}
|
|
1544
|
+
|
|
1545
|
+
/** How a `model/complete` call settled. **Open**: a server-produced result vocabulary, so a word a newer host adds decodes to `Unknown` (tdd SS1.9). */
|
|
1546
|
+
export type ModelCompleteOutcome = "completed" | "failed" | "cancelled" | "timedOut" | (string & {});
|
|
1547
|
+
|
|
1548
|
+
/** `model/complete` params (tdd SS3.40, FR-90352-1): the retry id, 1 to 32 messages (the first and the last `user`), an optional system text and the output bound. No session and no model: the host picks the model (ADR 90352 D3). The host answers an unknown field with `invalidParams`; the type itself accepts it. */
|
|
1549
|
+
export interface ModelCompleteParams {
|
|
1550
|
+
/** The client-minted UUIDv7 retry id (required, SS3.1.1). */
|
|
1551
|
+
commandId: string;
|
|
1552
|
+
/** The most tokens the model may write. Range 1–1024 inclusive. */
|
|
1553
|
+
maxTokens: number;
|
|
1554
|
+
/** What the model answers, oldest first. At most 32 items. */
|
|
1555
|
+
messages: ModelCompleteMessage[];
|
|
1556
|
+
/** The system text, when the caller sends one. */
|
|
1557
|
+
system?: string;
|
|
1558
|
+
}
|
|
1559
|
+
|
|
1560
|
+
/** `model/complete` result (tdd SS3.40): admission only — the ack is never the completion. */
|
|
1561
|
+
export interface ModelCompleteResult {
|
|
1562
|
+
/** The request's id, echoed. */
|
|
1563
|
+
commandId: string;
|
|
1564
|
+
/** Always `accepted` on this path. */
|
|
1565
|
+
status: CommandStatus;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/** Who said one `model/complete` message. **Closed**: a client-produced input the host validates, so an unknown role is `invalidParams`. */
|
|
1569
|
+
export type ModelCompleteRole = "user" | "assistant";
|
|
1570
|
+
|
|
1571
|
+
/** Why the model stopped on a `completed` call (FR-90352-2). **Open**: a server-produced word, so a word a newer host adds decodes to `Unknown` (tdd SS1.9). */
|
|
1572
|
+
export type ModelCompleteStopReason = "end" | "maxTokens" | (string & {});
|
|
1573
|
+
|
|
1574
|
+
/** The provider's token counts for one completed call (ADR 90352 D5): real counts only, never an estimate. */
|
|
1575
|
+
export interface ModelCompleteUsage {
|
|
1576
|
+
/** Input tokens, as the provider counted them. */
|
|
1577
|
+
inputTokens: number;
|
|
1578
|
+
/** Output tokens, as the provider counted them. */
|
|
1579
|
+
outputTokens: number;
|
|
1580
|
+
}
|
|
1581
|
+
|
|
1582
|
+
/** `model/completed` params (tdd SS3.40, FR-90352-2). `text`, `stopReason`, `modelId` and `usage` ride `completed` (`usage` only when the provider reported counts); `message` rides `failed`; `cancelled` and `timedOut` carry neither. The struct marks the conditional members optional; the SS prose pins the per-outcome rule. `text` is untrusted model output. */
|
|
1583
|
+
export interface ModelCompletedParams {
|
|
1584
|
+
/** The request's id — the correlation key. */
|
|
1585
|
+
commandId: string;
|
|
1586
|
+
/** Why the call failed, in words (on `failed`). */
|
|
1587
|
+
message?: string;
|
|
1588
|
+
/** The `model/list` id of the model that ran (on `completed`). */
|
|
1589
|
+
modelId?: string;
|
|
1590
|
+
/** How the call settled. */
|
|
1591
|
+
outcome: ModelCompleteOutcome;
|
|
1592
|
+
/** Why the model stopped (on `completed`). */
|
|
1593
|
+
stopReason?: ModelCompleteStopReason;
|
|
1594
|
+
/** The model's answer, verbatim (on `completed`). */
|
|
1595
|
+
text?: string;
|
|
1596
|
+
/** The provider's counts (on `completed`, when it reported them). */
|
|
1597
|
+
usage?: ModelCompleteUsage;
|
|
1598
|
+
}
|
|
1599
|
+
|
|
1426
1600
|
/** Per-1M-token catalog cost, carried **verbatim** for display and never rounded or re-formatted by the host (tdd SS3.10). Cost arithmetic stays client-local view math. */
|
|
1427
1601
|
export interface ModelCost {
|
|
1428
1602
|
/** Cached-input cost, a decimal string. */
|
|
@@ -1554,6 +1728,48 @@ export interface MonitorInboxItemVoidedParams {
|
|
|
1554
1728
|
voidedAt: string;
|
|
1555
1729
|
}
|
|
1556
1730
|
|
|
1731
|
+
/** One snapshot `monitorInbox` entry (tdd SS4.9.1, FR-56492-7 as amended by #76729): a retained admission in the `monitor/inboxItemAdmitted` shape, envelope-stripped, plus the newest drain and void stamps folded for it. The entry is still awaiting delivery when `drainedAt` is absent, or when `voidedAt` is strictly newer than it (FR-56492-3). */
|
|
1732
|
+
export interface MonitorInboxSnapshotEntry {
|
|
1733
|
+
/** The model-facing delivery text. */
|
|
1734
|
+
body: string;
|
|
1735
|
+
/** The producer-recorded pre-augmentation content; absent on pre-#24686 records. */
|
|
1736
|
+
displayBody?: string;
|
|
1737
|
+
/** The newest drain stamp (RFC3339); absent while never drained. */
|
|
1738
|
+
drainedAt?: string;
|
|
1739
|
+
/** Per-task event order key (with `line_index`). */
|
|
1740
|
+
eventIndex: number;
|
|
1741
|
+
/** Monitor event kind, snake_case, open vocabulary. */
|
|
1742
|
+
eventKind: string;
|
|
1743
|
+
/** The inbox item id (dedupe key). */
|
|
1744
|
+
itemId: string;
|
|
1745
|
+
/** Line order key; absent when the event has no line. */
|
|
1746
|
+
lineIndex?: number;
|
|
1747
|
+
/** Admission stamp (RFC3339). */
|
|
1748
|
+
queuedAt: string;
|
|
1749
|
+
/** Whether the event carries displayable lines. */
|
|
1750
|
+
showLines: boolean;
|
|
1751
|
+
/** The notice-text summary. */
|
|
1752
|
+
summary: string;
|
|
1753
|
+
/** The owning monitor task id (per-task set key). */
|
|
1754
|
+
taskId: string;
|
|
1755
|
+
/** The newest wake-missed void stamp (RFC3339); absent while never voided. */
|
|
1756
|
+
voidedAt?: string;
|
|
1757
|
+
}
|
|
1758
|
+
|
|
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) and the paused-Workflow checkpoint producer (ADR 39490 D5); absent means the server named no origin, and a client never infers one. */
|
|
1760
|
+
export type NoticeOrigin = "monitor" | "skillsStartup" | "scheduledFire" | "incompleteGeneration" | "hook" | "workflowCheckpoint" | (string & {});
|
|
1761
|
+
|
|
1762
|
+
/** `systemNotice`: the notice's level (tdd SS4.5.23). Open; an unknown value is an unknown-but-present level, rendered generically (SS4.10). */
|
|
1763
|
+
export type NoticeSeverity = "info" | "warning" | "error" | (string & {});
|
|
1764
|
+
|
|
1765
|
+
/** `systemNotice`: the durable thing the notice is about (tdd SS4.5.23). `id` is required whenever the object is present; `label` is the producer's sanitized, already-capped display value, omitted when it is empty, never `""`. */
|
|
1766
|
+
export interface NoticeSubject {
|
|
1767
|
+
/** The subject's durable identity: for `monitor`, the monitor's task id (its `toolCall` `itemId`); for `hook`, the hook run's item id (the opening `HookRunStarted` record's event id, SS4.5.11). */
|
|
1768
|
+
id: string;
|
|
1769
|
+
/** The subject's bounded display label (the `hookRun.label` shape). */
|
|
1770
|
+
label?: string;
|
|
1771
|
+
}
|
|
1772
|
+
|
|
1557
1773
|
/** A notification frame, either direction (SS1.2 §2.2). No `id`; a notification is never answered. */
|
|
1558
1774
|
export interface Notification {
|
|
1559
1775
|
/** Emission time in Unix milliseconds, recorded once at emission; server→client notifications only (SS1.2.5). Optional on the wire so decoders tolerate older servers. */
|
|
@@ -1599,6 +1815,18 @@ export interface PatchSummary {
|
|
|
1599
1815
|
removed: number;
|
|
1600
1816
|
}
|
|
1601
1817
|
|
|
1818
|
+
/** `peerMessage`: the four facts the consumed card renders (ADR 72708 D2, tdd SS4.5.24). The fold reads them from the drained inbox record's delivery snapshot; `senderLabel` already ran the gate-off label rule host-side, so the client renders it verbatim. Stable from day one (the `scheduledFire` precedent): no `x-msp-stability` marker. */
|
|
1819
|
+
export interface PeerMessage {
|
|
1820
|
+
/** The message text verbatim — never cut (an over-budget event answers the typed `pageEventTooLarge` arm). */
|
|
1821
|
+
body: string;
|
|
1822
|
+
/** True for mailbox/remote senders, false for local session senders. */
|
|
1823
|
+
remote: boolean;
|
|
1824
|
+
/** The peer label gate-off shows: the sender name when the durable record names one, else the sender id shortened as gate-off shortens it, else `unknown session` — and `remote session` verbatim for a remote sender. */
|
|
1825
|
+
senderLabel: string;
|
|
1826
|
+
/** The local sender's session id; absent for remote senders and when the record names none. */
|
|
1827
|
+
senderSessionId?: string;
|
|
1828
|
+
}
|
|
1829
|
+
|
|
1602
1830
|
/** A pending approval in the snapshot: the SS2.5.2 pointer shape plus the gated `itemId` when one exists (tdd SS4.9.1). */
|
|
1603
1831
|
export interface PendingApprovalPointer {
|
|
1604
1832
|
/** The pending approval's id. */
|
|
@@ -1827,6 +2055,19 @@ export interface PluginMarketplaceUpdateParams {
|
|
|
1827
2055
|
/** A plugin row's source provenance (tdd SS3.26.2, ADR 33398 D7 item 3): camelCase of `PluginSourceProvenance`. Open (server-produced result vocabulary, the #22785 enum-openness rule): a future provenance is additive. */
|
|
1828
2056
|
export type PluginSource = "curated" | "marketplaceUserAdded" | "foreignImport" | "nativeLocal" | (string & {});
|
|
1829
2057
|
|
|
2058
|
+
/** Why a workspace status probe produced no fresh reading (#35065 item 2). **Open**: a new reason is additive evolution, and a client MUST render an unknown value as an unknown-but-present reason rather than rejecting the row. */
|
|
2059
|
+
export type ProbeDegradedReason = "skippedUntrusted" | "skippedSandboxUnavailable" | "probeFailed" | (string & {});
|
|
2060
|
+
|
|
2061
|
+
/** One child session pruned below a checkpoint boundary (tdd SS2.5.5, ADR 71910 D8): the restored row's key, text, and stoppability — never pruned transcript. */
|
|
2062
|
+
export interface PrunedSubagent {
|
|
2063
|
+
/** The served display label (the spawn's role, agent path as fallback); absent when the spawn records carry neither. */
|
|
2064
|
+
label?: string;
|
|
2065
|
+
/** The child session id — the trace key for `session/read` on the child, exactly as for a live child row. */
|
|
2066
|
+
sessionId: string;
|
|
2067
|
+
/** `running`, `completed`, or `failed`; absent reads as `running`. */
|
|
2068
|
+
status?: string;
|
|
2069
|
+
}
|
|
2070
|
+
|
|
1830
2071
|
/** One input still queued for delivery to a session (tdd SS2.5.5, ADR 63254-queued-inputs-on-read D2): the full message body plus its log record sequence, the delivery-order and re-read dedupe key, plus the run-log record id clients join served entries against record-seeded rows by. */
|
|
1831
2072
|
export interface QueuedInput {
|
|
1832
2073
|
/** The queued record's log sequence: delivery order, and the key clients deduplicate re-reads by. */
|
|
@@ -1975,6 +2216,40 @@ export interface RequestReceipt {
|
|
|
1975
2216
|
/** A `turn/retracted` settlement outcome (tdd SS4.5.1, ADR 50074 D1). Open enum (D-033): decode is tolerant — a value outside the list reads as `Accepted` (the event's historical meaning — pre-feature hosts emit it only for accepted retracts), never fails. The bundle keeps enumerating the known values for codegen and docs. */
|
|
1976
2217
|
export type RetractOutcome = "accepted" | "declined" | (string & {});
|
|
1977
2218
|
|
|
2219
|
+
/** The runtime-owned git worktree a child session runs in, mirrored from the `subagent.worktree.*` records on its parent's log (tdd SS2.5.5, ADR 50042-child-worktree-on-read D2). The four enums are open: clients treat an unknown value as unknown. */
|
|
2220
|
+
export interface RuntimeWorktree {
|
|
2221
|
+
/** The commit the worktree was created from. */
|
|
2222
|
+
baseCommit: string;
|
|
2223
|
+
/** The cleanup outcome's recorded diagnostic, verbatim (#70088); absent when the outcome records none. */
|
|
2224
|
+
cleanupDiagnostic?: string;
|
|
2225
|
+
/** How the worktree is cleaned up. */
|
|
2226
|
+
cleanupPolicy: RuntimeWorktreeCleanupPolicy;
|
|
2227
|
+
/** Why cleanup kept the worktree or failed, as the cleanup outcome recorded it (#70088); absent when the outcome records no reason. */
|
|
2228
|
+
cleanupReason?: RuntimeWorktreeCleanupReason;
|
|
2229
|
+
/** Where the worktree's cleanup stands. */
|
|
2230
|
+
cleanupState: RuntimeWorktreeCleanupState;
|
|
2231
|
+
/** The head commit the active lease recorded. */
|
|
2232
|
+
headCommit: string;
|
|
2233
|
+
/** Who owns the worktree. */
|
|
2234
|
+
ownership: RuntimeWorktreeOwnership;
|
|
2235
|
+
/** True exactly when the parent's uncommitted changes were recorded as excluded from the checkout. */
|
|
2236
|
+
parentDirtyExcluded: boolean;
|
|
2237
|
+
/** The recorded worktree root, verbatim (recorded history; serving it never probes the path). */
|
|
2238
|
+
worktreeRoot: string;
|
|
2239
|
+
}
|
|
2240
|
+
|
|
2241
|
+
/** How a session's worktree is cleaned up. The set is open, so newer hosts may send other values. */
|
|
2242
|
+
export type RuntimeWorktreeCleanupPolicy = "removeIfClean" | (string & {});
|
|
2243
|
+
|
|
2244
|
+
/** Why a session's worktree cleanup kept the worktree or failed. The set is open, so newer hosts may send other values. */
|
|
2245
|
+
export type RuntimeWorktreeCleanupReason = "dirtyWorktree" | "headChanged" | "pathEscape" | "cleanupFailed" | "uncertainLeaseState" | (string & {});
|
|
2246
|
+
|
|
2247
|
+
/** Where a session's worktree cleanup stands. The set is open, so newer hosts may send other values. */
|
|
2248
|
+
export type RuntimeWorktreeCleanupState = "active" | "cleaned" | "retained" | "cleanupFailed" | (string & {});
|
|
2249
|
+
|
|
2250
|
+
/** Who owns a session's worktree. The set is open, so newer hosts may send other values. */
|
|
2251
|
+
export type RuntimeWorktreeOwnership = "runtimeOwned" | (string & {});
|
|
2252
|
+
|
|
1978
2253
|
/** Whether this host can enforce the sandbox (ADR 50064-startup-report-sandbox-availability D2/D4). A property of the host process, probed once 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: a future enforcement posture arrives as a new value, read by older clients as unknown. */
|
|
1979
2254
|
export type SandboxAvailability = "available" | "unavailable" | (string & {});
|
|
1980
2255
|
|
|
@@ -2011,32 +2286,46 @@ export interface Session {
|
|
|
2011
2286
|
createdAt: string;
|
|
2012
2287
|
/** The handshake `ClientInfo` recorded when the session was opened (FR-003), echoed verbatim — provenance, never an interpretation, and never a visibility gate (INV-005). **Additive-optional**; absence has four indistinguishable causes (INV-004): an in-process open; a pre-#23124 record; a half stamp where only one of name/version was recorded (FM-005) and `ClientInfo` requires both; and a session with no admitting handshake of its own — a fork child or a subagent — which never carries a stamp to begin with. */
|
|
2013
2288
|
createdByClient?: ClientInfo;
|
|
2289
|
+
/** The handshake `ClientInfo` of the connection that currently holds this session's drive grant (spec 39851 INV-001; spec 42713 FR-58706-1, ADR 58706 D2), served on `session/read` only, as `name` and `version` (the handshake's display `title` is never served, the `createdByClient` rule). **Additive-optional, loaded-only, live**: present exactly when a live connection holds the grant and its handshake is known; absent on `notLoaded` rows, once the holder's connection drops (its orphaned turn included), and for a holder with no handshake stamp. Provenance only (INV-005): whether a client may drive is answered by `session/resume` / `turn/start` (`sessionInUse`), never by this member (FR-58706-4). */
|
|
2290
|
+
driveHolder?: ClientInfo;
|
|
2291
|
+
/** The live host-declared external wait for this session, served on `session/read` only. **Additive-optional, loaded-only, live**: present exactly while a declaration is live for the loaded session; absent on `notLoaded` rows, once the declaration is cleared, once the next user input clears it, and after a restart or resume, which lose it. Presence is the declaration — a client must never infer one from any other member. */
|
|
2292
|
+
externalWait?: ExternalWaitView;
|
|
2014
2293
|
/** Derived first-user-prompt preview (tdd SS2.14.1, #27598). **Additive-optional**, omitted when underivable. */
|
|
2015
2294
|
firstUserPrompt?: string;
|
|
2016
2295
|
/** `null` for root sessions; fork provenance otherwise (tdd SS2.4). */
|
|
2017
2296
|
forkedFrom: ForkProvenance | null;
|
|
2018
2297
|
/** The served generated short title (tdd SS2.4/SS2.14.1, #50048; ADR 50048-generated-name D1). **Additive-optional**, **fold-only**: the snapshot fold derives the latest retained generated pair's short title from the log; `session/list` rows never carry it. Omitted when no pair was ever published — absent reads as unpublished, never fabricated, never inferred from the name text. `name` stays the canonical name it always was. */
|
|
2019
2298
|
generatedName?: string;
|
|
2299
|
+
/** The published head's ordinal (kt-dvw5): the head reference's own ordinal — the count of head slots in its sequence, including any reserved ones — as of the probe that served this row. A sizing hint for a first `view/page`, so the Console can size its page without folding the log. **Additive-optional**, present only on metadata reads (`session/read` with `excludeItems`), where the client has no items to count; full reads carry the items themselves and omit it. Absent when no head is published (unknown), never fabricated. May lag a live log: the head is a snapshot, and appends after its publication are not counted. */
|
|
2300
|
+
itemCount?: number;
|
|
2020
2301
|
/** What kind of session this is (spec 42713 FR-001, ADR 42713 D1/D4). **Open enum**, v1 values `"root"` and `"subagent"`; a client treats an unknown value as an unknown-but-present kind and renders it, never rejecting the row. **Additive-optional**: absence asserts nothing — the host could not determine the home shape (FM-001), or the value is not yet available to serve (FM-003). */
|
|
2021
2302
|
kind?: SessionKind;
|
|
2022
2303
|
/** Content-activity recency, RFC3339 (tdd SS2.4, ADR 31983 D5). **Additive-optional**: omitted when no content record exists. Never advanced by lifecycle bookkeeping (the resume marker, re-stamps) or a fork's copied seed-replay records, and never precedes `createdAt`. */
|
|
2023
2304
|
lastActivityAt?: string;
|
|
2305
|
+
/** The durable log's byte length at read time (kt-dvw5): the size hint paired with `itemCount`, so the Console can size its first page without folding the log. **Additive-optional**, present only on metadata reads (`session/read` with `excludeItems`); full reads omit it. Absent when the log's length is not known (unknown), never fabricated. A live log grows after the read; the value is a snapshot. */
|
|
2306
|
+
logBytes?: number;
|
|
2024
2307
|
/** The winning metadata fold's model; `null` when that record omits it. */
|
|
2025
2308
|
modelId: string | null;
|
|
2026
2309
|
/** The durable allocated session name (tdd SS2.4/SS2.14.1, #27598; ADR 27598 D2/D4). **Additive-optional**: present when the serving path holds an allocated name, omitted otherwise — absent is never fabricated. Authoritative and renameable via `session/rename`. */
|
|
2027
2310
|
name?: string;
|
|
2028
2311
|
/** How the served `name` was set (tdd SS2.4/SS2.14.1, #50048; ADR 50048 D1/D2). **Additive-optional**, **fold-only**: the snapshot fold (`session/read`, the resume/start/fork-ack snapshot) derives and carries it from the log; `session/list` rows never carry it. Absent — and any value the client does not recognize — reads as unknown, never fabricated. */
|
|
2029
2312
|
nameOrigin?: SessionNameOrigin;
|
|
2030
|
-
/** The containing session's id when `kind` is `"subagent"` (FR-002, INV-002) — the id of the TOP-LEVEL session whose home holds this child, which is **not necessarily the session that spawned it**: native-child homes are physical siblings under the outer session's `subagent/` directory, so a subagent spawned by another subagent resolves to the outer session, not to its spawner. A client building a tree from this field gets one level, not a chain. Flat rather than nested: there is exactly one fact to carry, unlike `forkedFrom`'s
|
|
2313
|
+
/** The containing session's id when `kind` is `"subagent"` (FR-002, INV-002) — the id of the TOP-LEVEL session whose home holds this child, which is **not necessarily the session that spawned it**: native-child homes are physical siblings under the outer session's `subagent/` directory, so a subagent spawned by another subagent resolves to the outer session, not to its spawner. A client building a tree from this field gets one level, not a chain. Flat rather than nested: there is exactly one fact to carry, unlike `forkedFrom`'s structured `ForkProvenance`. **Additive-optional**; a root carries none. */
|
|
2031
2314
|
parentSessionId?: string;
|
|
2032
2315
|
/** Absolute path of the session's durable log; non-nullable. Under the ephemeral session profile it is the **empty string**, meaning "no durable log exists" (tdd SS2.13.2) — the one value a client must not hand to a filesystem call. */
|
|
2033
2316
|
path: string;
|
|
2317
|
+
/** Why the workspace status probe produced no fresh reading (#35065 item 2) — the index's last derived value, like `branch`, so the TUI can show WHY status is unavailable instead of a generic unavailable. **Additive-optional**, omitted when the latest probed observation carries no reason or none exists. **Open enum**: a client treats an unknown-but-present reason and renders it, never rejecting the row. */
|
|
2318
|
+
probeDegradedReason?: ProbeDegradedReason;
|
|
2034
2319
|
/** The winning metadata fold's provider; `null` when that record omits it. */
|
|
2035
2320
|
providerId: string | null;
|
|
2321
|
+
/** The handshake `ClientInfo` of the connection whose wire `session/resume` most recently loaded this session (spec 42713 FR-58706-2, ADR 58706 D2): stamped on the durable `session.resumed` marker, folded into the session index, and served from that column by every carrier; while the session is loaded, the stamp the loading resume wrote replaces the column on every carrier (the ack, `session/read`, `session/list`, `session/listChanged`), and after the next fold the column serves it. **Additive-optional** and **provenance only** (INV-005); a resume with no admitting handshake (TUI, exec) stamps nothing, a warm attach to an already-loaded session writes no marker, and a half stamp serves nothing (FR-003a), so absence asserts nothing. `createdByClient` never follows a resume (FR-58706-3). */
|
|
2322
|
+
resumedByClient?: ClientInfo;
|
|
2036
2323
|
/** The session identity. */
|
|
2037
2324
|
sessionId: string;
|
|
2038
2325
|
/** `null` for root sessions and forks; side provenance otherwise (tdd SS2.4/SS2.5.7; ADR 45435 D2). A session carries at most one of `forkedFrom` and `sideFrom`. */
|
|
2039
2326
|
sideFrom?: SideProvenance | null;
|
|
2327
|
+
/** The session that opened this one (spec 42713 FR-69621-6, ADR 69621 D4), recorded once in this session's creation record and served from the session index. Unlike the containing session `parentSessionId` names above, its `parentSessionId` is the exact spawner, except that any `muse` started in a later pane of the worker's tmux session or Herdr workspace names the worker's manager and carries the worker's `project`/`thread` labels (ADR 69621 D8); `project` and `thread` are opaque labels the spawner may name beside it. **Additive-optional** and **provenance only** (INV-005): never a visibility or authority gate. Absence asserts nothing — no recorded spawner, a later session of the spawned process, a row folded before the member existed, or a session the index has not folded yet. */
|
|
2328
|
+
spawnedBy?: SessionSpawnedBy;
|
|
2040
2329
|
/** Load state as this host knows it; `session/list` reports `notLoaded` for sessions loaded by *other* hosts (tdd SS2.4). */
|
|
2041
2330
|
status: SessionStatus;
|
|
2042
2331
|
/** Derived display title (tdd SS2.14.1, #27598): a heuristic that may evolve — its carriage, not its derivation, is the contract. **Additive-optional**, omitted when underivable. */
|
|
@@ -2083,6 +2372,18 @@ export interface SessionBranchChangedParams {
|
|
|
2083
2372
|
workspaceRoot: string;
|
|
2084
2373
|
}
|
|
2085
2374
|
|
|
2375
|
+
/** `session/clearExternalWait` params. */
|
|
2376
|
+
export interface SessionClearExternalWaitParams {
|
|
2377
|
+
/** The loaded session the declaration is cleared for. */
|
|
2378
|
+
sessionId: string;
|
|
2379
|
+
}
|
|
2380
|
+
|
|
2381
|
+
/** `session/clearExternalWait` result: no declaration is live. */
|
|
2382
|
+
export interface SessionClearExternalWaitResult {
|
|
2383
|
+
/** Always `false` on a successful clear: no declaration is live. */
|
|
2384
|
+
declared: boolean;
|
|
2385
|
+
}
|
|
2386
|
+
|
|
2086
2387
|
/** `session/closed` params (tdd SS2.6.2; enrolled by #33065): 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. */
|
|
2087
2388
|
export interface SessionClosedParams {
|
|
2088
2389
|
/** Which orderly unload path fired. */
|
|
@@ -2138,6 +2439,22 @@ export interface SessionContextUsageParams {
|
|
|
2138
2439
|
windowTokens?: number;
|
|
2139
2440
|
}
|
|
2140
2441
|
|
|
2442
|
+
/** `session/declareExternalWait` params. */
|
|
2443
|
+
export interface SessionDeclareExternalWaitParams {
|
|
2444
|
+
/** The host's label for what the session waits on, shown in the session view while the declaration is live. Omitted when the host has no label to show. */
|
|
2445
|
+
reason?: string;
|
|
2446
|
+
/** The loaded session the declaration is for. */
|
|
2447
|
+
sessionId: string;
|
|
2448
|
+
}
|
|
2449
|
+
|
|
2450
|
+
/** `session/declareExternalWait` result: the declaration is live. */
|
|
2451
|
+
export interface SessionDeclareExternalWaitResult {
|
|
2452
|
+
/** Always `true` on a successful declare: a declaration is live. */
|
|
2453
|
+
declared: boolean;
|
|
2454
|
+
/** The live declaration's reason, as declared (truncated by the host runtime). Omitted when the host declared without one. */
|
|
2455
|
+
reason?: string;
|
|
2456
|
+
}
|
|
2457
|
+
|
|
2141
2458
|
/** Whether this host writes its sessions to disk (SS1.4.1, SS2.13). 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 (#14401) has candidate resolutions that add a third value here, so closed would make that a breaking change. */
|
|
2142
2459
|
export type SessionDurability = "durable" | "ephemeral" | (string & {});
|
|
2143
2460
|
|
|
@@ -2268,7 +2585,7 @@ export interface SessionListParams {
|
|
|
2268
2585
|
workspaceRoot?: string;
|
|
2269
2586
|
}
|
|
2270
2587
|
|
|
2271
|
-
/** `session/list` result (tdd SS2.5.4).
|
|
2588
|
+
/** `session/list` result (tdd SS2.5.4). The default order is content activity: `lastActivityAt` descending, then `sessionId` ascending. The order is the session index's key, so a row's displayed timestamps do not always show its position: a row the index has not yet derived keeps its `updatedAt` position, a derived row with no content orders by `createdAt`, and a loaded row can show newer values. Do not re-sort or validate a page from them. `updatedAfter` still filters on `updatedAt`. */
|
|
2272
2589
|
export interface SessionListResult {
|
|
2273
2590
|
/** The canonical filter the server applied, present exactly when the request carried `filter` (#42035, spec 207 FR-42035-1). The probe is per-predicate PRESENCE (ADR 42035 D6): a client that requires filtering checks that every predicate it sent comes back as a member here, and treats a missing member as unsupported. Value equality is the wrong test — canonicalization trims, lowercases, NFC-normalizes, dedupes and sorts, so the echoed values often differ from the sent ones on a correctly filtered page. */
|
|
2274
2591
|
appliedFilter?: SessionListFilter;
|
|
@@ -2371,12 +2688,16 @@ export interface SessionReadParams {
|
|
|
2371
2688
|
export interface SessionReadResult {
|
|
2372
2689
|
/** Same member as `session/resume` (tdd SS2.5.5, ADR 50074 D2). */
|
|
2373
2690
|
blockedPrompt?: BlockedPrompt;
|
|
2691
|
+
/** The inputs the read session's log delivered to its subagents (tdd SS2.5.5, ADR 72596-delivered-inputs-on-read D2). Absent-when-empty: a missing member means nothing delivered, never an error. */
|
|
2692
|
+
deliveredInputs?: DeliveredInput[];
|
|
2374
2693
|
/** The served history. */
|
|
2375
2694
|
history: SessionHistory;
|
|
2376
2695
|
/** Same member as `session/resume` (tdd SS2.5.5, ADR 36635 D2). */
|
|
2377
2696
|
lastTurn?: LastTurn;
|
|
2378
2697
|
/** 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). */
|
|
2379
2698
|
pendingRequests: PendingRequestPointer[];
|
|
2699
|
+
/** 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. */
|
|
2700
|
+
prunedSubagents?: PrunedSubagent[];
|
|
2380
2701
|
/** The inputs still queued for delivery to the read session (tdd SS2.5.5, ADR 63254-queued-inputs-on-read D2). Absent-when-empty: a missing member means nothing queued, never an error. */
|
|
2381
2702
|
queuedInputs?: QueuedInput[];
|
|
2382
2703
|
/** Current local construction only; never inferred from retained history. Absence establishes neither a choice nor supported recovery. */
|
|
@@ -2385,6 +2706,8 @@ export interface SessionReadResult {
|
|
|
2385
2706
|
session: Session;
|
|
2386
2707
|
/** The fold head at read time. */
|
|
2387
2708
|
viewCursor: string;
|
|
2709
|
+
/** The facts of the runtime-owned worktree a child read session's subagent runs in (tdd SS2.5.5, ADR 50042-child-worktree-on-read D2). A root read serves it absent; absent means no worktree facts, never an error. */
|
|
2710
|
+
worktree?: RuntimeWorktree;
|
|
2388
2711
|
}
|
|
2389
2712
|
|
|
2390
2713
|
/** `session/reasoningEffortChanged` params (tdd SS4.6.9, ADR 31255 D1): a durable reasoning-effort reconfigure record landed (tdd SS3.21). Replace wholesale, latest wins; the snapshot carries the latest value (SS4.9.1). */
|
|
@@ -2433,6 +2756,8 @@ export interface SessionResumeParams {
|
|
|
2433
2756
|
excludeItems?: boolean;
|
|
2434
2757
|
/** History mode preference, default `auto`. A PREFERENCE, not a budget override: when the requested mode does not fit the history budget the server downgrades it and `history.mode` reports what was actually served (tdd SS2.5.2). Ignored when `cursor` or `excludeItems` makes it moot. */
|
|
2435
2758
|
history?: HistoryPreference;
|
|
2759
|
+
/** The explicit MSP model override (T-51858-304; INV-51858-11 rank 1): a model string the caller supplies at resume time. When present it wins over the retained binding's recorded origin — over a stamped label and over a stamped pin — and it recovers an otherwise-unresolved label binding by sending the override as the wire model instead of the unresolved refusal. Omitted preserves arm (2): the retained binding resolves by recorded origin exactly as without this member. Explicit `null` is invalid params (the same closed null-tolerant set as at start). The override changes the model within the retained provider; it never names a provider. A resume that loads the session records it as a resume `--model` records (ADR 24046 D7): nothing when it already is the session's model, else one durable selection with the provider's profile for that model. A resume that attaches to a loaded session switches the model live. A model the host refuses, a blank one included, leaves the session on its recorded model, which `session.modelId` reports; a connection that opted into `experimentalApi` also gets the reason in `modelIdRefusal`. */
|
|
2760
|
+
modelId?: string;
|
|
2436
2761
|
/** The launch permission-profile pick (amendment 42624 FR-42624-1, #50054): a profile id the host catalog already admits. Select, never create. Omitted restores retained authority only, with no override. The host restores first, then applies the pick in the same pre-marker step; over a declared lost record the restore is the never-wider reset, committed before the pick, and where the reset cannot commit the pick is committed alone as that reset (spec 11237 FR-57059-4). A pick that fails admission refuses the resume `commandRejected` (-32030; `permission_profile_unknown` / `permission_profile_unavailable`) before any durable byte. Explicit `null` is invalid params (the same closed null-tolerant set as at start). */
|
|
2437
2762
|
permissionProfile?: string;
|
|
2438
2763
|
/** Cold-resume replacement choice; omission preserves the retained choice. A warm attach rejects a different or unestablished choice as invalidParams. Explicit null is invalid. */
|
|
@@ -2451,6 +2776,8 @@ export interface SessionResumeResult {
|
|
|
2451
2776
|
lastTurn?: LastTurn;
|
|
2452
2777
|
/** The late-joiner pointer set; empty when nothing is pending. */
|
|
2453
2778
|
pendingRequests: PendingRequestPointer[];
|
|
2779
|
+
/** One short record per child session the checkpoint boundary pruned (tdd SS2.5.2, ADR 71910 D8). **Additive-optional**, like `queuedInputs` on the read: absent-when-empty, never stripped. */
|
|
2780
|
+
prunedSubagents?: PrunedSubagent[];
|
|
2454
2781
|
/** The loaded session. */
|
|
2455
2782
|
session: Session;
|
|
2456
2783
|
/** The session view head; the connection is subscribed after it. A still-loaded session a prior `view/unsubscribe` detached is RE-ATTACHED by this resume (spec 208 FR-002a, #28920): live delivery resumes from this head. Explicit-cursor re-attach with `(after, head]` engine replay stays `view/subscribe` (SS4.7.1). */
|
|
@@ -2535,6 +2862,16 @@ export interface SessionSideChatResult {
|
|
|
2535
2862
|
viewCursor: string;
|
|
2536
2863
|
}
|
|
2537
2864
|
|
|
2865
|
+
/** Who opened a session (`Session.spawnedBy`, spec 42713 FR-69621-6, ADR 69621 D4). */
|
|
2866
|
+
export interface SessionSpawnedBy {
|
|
2867
|
+
/** The exact session that opened this one (ADR 69621 D2), except that any `muse` started in a later pane of the worker's tmux session or Herdr workspace names the worker's manager and carries the worker's `project`/`thread` labels (ADR 69621 D8). */
|
|
2868
|
+
parentSessionId: string;
|
|
2869
|
+
/** An opaque project label the spawner named, when it named one. */
|
|
2870
|
+
project?: string;
|
|
2871
|
+
/** An opaque thread label the spawner named, when it named one. */
|
|
2872
|
+
thread?: string;
|
|
2873
|
+
}
|
|
2874
|
+
|
|
2538
2875
|
/** `session/start` params (tdd SS2.5.1). */
|
|
2539
2876
|
export interface SessionStartParams {
|
|
2540
2877
|
/** 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). */
|
|
@@ -2547,12 +2884,16 @@ export interface SessionStartParams {
|
|
|
2547
2884
|
modelId?: string;
|
|
2548
2885
|
/** The new session's initial permission profile (amendment 42624 FR-42624-1, ADR 42197 D2): a profile id the host catalog already admits — the rows `permissionProfile/list` serves without `sessionId`. Select, never create. Omitted means today's behavior: the host's configured default under native admission, unchanged. An id the catalog does not carry, or one it serves unavailable, refuses the start `commandRejected` (-32030; `permission_profile_unknown` / `permission_profile_unavailable`) before any durable byte, and an ephemeral host refuses any id (`permission_profile_ephemeral_fixed`). `session/fork` does not admit the member; `session/resume` admits it as the launch pick (FR-42624-1, #50054). Explicit `null` is invalid params: the set of members that tolerate `null` is closed and excludes this one, exactly as it excludes `workspaceRoots`. */
|
|
2549
2886
|
permissionProfile?: string;
|
|
2887
|
+
/** The `/new` predecessor link (spec 207 amendment 50054, FR-50054-1): the outgoing session this start succeeds. Any syntactically valid session UUID; there is no existence check, so a link to a session that is gone still commits. Omitted means a true root. Explicit `null` is invalid params. */
|
|
2888
|
+
previousSessionId?: string;
|
|
2550
2889
|
/** Initial provider routing; server default when omitted or explicit `null` — both spellings select the default (#23468). */
|
|
2551
2890
|
providerId?: string | null;
|
|
2552
2891
|
/** Recovery choice for this construction; omission keeps legacy behavior. Explicit null is invalid. */
|
|
2553
2892
|
recoveryMode?: RecoveryMode;
|
|
2554
2893
|
/** Exact identity for this new root session. When omitted the server mints a UUIDv7. This field never selects an existing session: a retained or reserved id is rejected `commandRejected` with reason `session_id_conflict` (tdd SS2.5.1). */
|
|
2555
2894
|
sessionId?: string;
|
|
2895
|
+
/** The session that opens this one (spec 42713 FR-69621-8, ADR 69621 D7), in the `Session.spawnedBy` shape: a spawner that starts a worker session over MSP names its own session here. The host writes it once into the new session's creation record, as a worker process records its environment hand-over, and `session/list` / `session/read` serve it back as `Session.spawnedBy`; `session/resume` never takes it. **Additive-optional** and **provenance only** (INV-005). A value the host cannot use (a `parentSessionId` that is not a session id, a malformed member) records nothing and never refuses the start; an unusable `project` or `thread` is dropped on its own. Hosts that predate the member ignore it. */
|
|
2896
|
+
spawnedBy?: SessionSpawnedBy;
|
|
2556
2897
|
/** Absolute path, folded into the first metadata record. */
|
|
2557
2898
|
workspaceRoot?: string;
|
|
2558
2899
|
/** The session's initial runtime workspace-root set: ordered absolute canonical existing directory paths; the first root is the CWD and plays the primary-root role; every root receives the ADR 11237 `:workspace_roots` rules; extra roots grant no Project Trust. When `workspaceRoot` is also present the two must name the same folder, compared on canonical forms (the raw `workspaceRoot` is canonicalized first; ADR 37313 D9), or the request is invalid params, and so is explicit `null` (the D-049 null-tolerant set is closed and excludes this member). Omitted preserves single-root behavior (tdd SS2.5.1, ADR 37313, #37313). */
|
|
@@ -2648,14 +2989,14 @@ export interface SessionUserShellResult {
|
|
|
2648
2989
|
status: CommandStatus;
|
|
2649
2990
|
}
|
|
2650
2991
|
|
|
2651
|
-
/** The view-health state (tdd SS2.5.2 companion). Open enum (`x-msp-openness: open`): a client MUST ignore an unrecognized value.
|
|
2652
|
-
export type SessionViewHealth = "unavailable" | (string & {});
|
|
2992
|
+
/** The view-health state (tdd SS2.5.2 companion). Open enum (`x-msp-openness: open`): a client MUST ignore an unrecognized value. `Healthy` is the re-arm value reserved by ADR 32557 D1, emitted after a host re-load (ADR 32557 D5, #60870); openness still reserves additive room for the #14401 durable-degraded axis. */
|
|
2993
|
+
export type SessionViewHealth = "unavailable" | "healthy" | (string & {});
|
|
2653
2994
|
|
|
2654
|
-
/** `session/viewHealthChanged` params (ADR 32557; #32557): the named session's live view stream became unavailable, and why. Best-effort: ordered after already-queued view frames and may be dropped (for example when the connection is closing), so a client MUST NOT assume a guaranteed push and still reads `history.noneReason` on its next resume/read (FM-005). */
|
|
2995
|
+
/** `session/viewHealthChanged` params (ADR 32557; #32557): the named session's live view stream became unavailable, and why, or (ADR 32557 D5) it is back after the host re-loaded the view, so the client re-reads and re-subscribes. Best-effort: ordered after already-queued view frames and may be dropped (for example when the connection is closing), so a client MUST NOT assume a guaranteed push and still reads `history.noneReason` on its next resume/read (FM-005). */
|
|
2655
2996
|
export interface SessionViewHealthChangedParams {
|
|
2656
|
-
/** The new view-health state
|
|
2997
|
+
/** The new view-health state: `Unavailable`, or `Healthy` once the host re-loaded a failed view (#60870). */
|
|
2657
2998
|
health: SessionViewHealth;
|
|
2658
|
-
/** Why the view is unavailable — the SAME typed `HistoryNoneReason` vocabulary the pull path stamps on `history.noneReason` (tdd SS2.5.2, D-050), so a client reuses one handler for push and pull. `projectionUnavailable`
|
|
2999
|
+
/** Why the view is unavailable — the SAME typed `HistoryNoneReason` vocabulary the pull path stamps on `history.noneReason` (tdd SS2.5.2, D-050), so a client reuses one handler for push and pull. `projectionUnavailable` when the view fails, then `projectionRebuildFailed`, which the pull path never stamps: it rides only a `session/viewHealthChanged` notification, after the host's one re-load of a failed live view fails or right after a fork child's live fail-close; present only when `health` is `Unavailable`. Open on the client side: an unknown reason decodes conservatively and renders generically. */
|
|
2659
3000
|
noneReason?: HistoryNoneReason;
|
|
2660
3001
|
/** The session whose live view health changed. */
|
|
2661
3002
|
sessionId: string;
|
|
@@ -2840,6 +3181,8 @@ export interface SnapshotState {
|
|
|
2840
3181
|
goal: Goal | null;
|
|
2841
3182
|
/** Every item, in first-opened order, each at its latest revision at the snapshot cursor. One schema per kind, shared with the notification item object — which is what makes snapshot+suffix a pure splice (tdd SS4.9.1). */
|
|
2842
3183
|
items: Item[];
|
|
3184
|
+
/** The retained Monitor admissions at this cursor (tdd SS4.9.1, FR-56492-7 as amended by #76729): every admission still awaiting delivery, plus per task the newest 200 non-blank stdout lines and the newest other admission, delivered or not, each with its drain and void stamps; a pending cut of the history ladder (tdd SS2.5.2, ADR 56492 D4) carries only the entries still awaiting delivery. A current host always sends it (empty when no monitor admitted anything); absent means an older host. */
|
|
3185
|
+
monitorInbox?: MonitorInboxSnapshotEntry[];
|
|
2843
3186
|
/** The settled canonical session name; `null` when the session was never named (#27598, tdd SS4.9.1 / SS2.14). Folds the same durable `session/nameChanged` record `Session.name` reports. */
|
|
2844
3187
|
name?: string | null;
|
|
2845
3188
|
/** The pending-approval half of the pending set. */
|
|
@@ -2956,6 +3299,21 @@ export interface SubagentInputParams {
|
|
|
2956
3299
|
subagentId: string;
|
|
2957
3300
|
}
|
|
2958
3301
|
|
|
3302
|
+
/** `subagentInput.inputPhase` (#70249): the record the item stands for. Open: a client ignores an item whose phase it does not know. */
|
|
3303
|
+
export type SubagentInputPhase = "queued" | "delivered" | (string & {});
|
|
3304
|
+
|
|
3305
|
+
/** `subagent/list` params: the session whose subagent roster to read. A read-only query in the `skill/list` mold: no `commandId`, no durable record, no view event. Served by the loaded parent's runtime control records, so its refusals (`-32020`/`-32021`/`-32022`/`-32024`, plus a retryable `-32603` when the runtime source declines) are the `task/list` split. */
|
|
3306
|
+
export interface SubagentListParams {
|
|
3307
|
+
/** The target session (the parent whose children to list). */
|
|
3308
|
+
sessionId: string;
|
|
3309
|
+
}
|
|
3310
|
+
|
|
3311
|
+
/** `subagent/list` result: the session's roster rows. Empty only when the parent's control records name no durable child; a declined source refuses typed instead of answering empty. */
|
|
3312
|
+
export interface SubagentListResult {
|
|
3313
|
+
/** The session's roster rows, ordered by `(agentPath, subagentId)`. */
|
|
3314
|
+
subagents: SubagentRosterEntry[];
|
|
3315
|
+
}
|
|
3316
|
+
|
|
2959
3317
|
/** Params for `subagent/interrupt`, `subagent/stop`, and `subagent/close` (SS3.16): a child target plus an optional human-readable reason that is preserved on the durable effect record. */
|
|
2960
3318
|
export interface SubagentOwnerReasonParams {
|
|
2961
3319
|
/** Client-minted UUIDv7 command id (SS3.1.1). */
|
|
@@ -2972,7 +3330,7 @@ export interface SubagentOwnerReasonParams {
|
|
|
2972
3330
|
export interface SubagentResult {
|
|
2973
3331
|
/** Artifact references, verbatim. */
|
|
2974
3332
|
artifactRefs: string[];
|
|
2975
|
-
/** `true` once the parent consumed the result (the inbox join fact the gate-off drain arm folds into the `Finished` marker — tdd SS4.5.7). Absent otherwise; never cleared once set. Clients mint the `Finished` marker off this flag instead of re-deriving the join. */
|
|
3333
|
+
/** `true` once the parent consumed the result (the inbox join fact the gate-off drain arm folds into the `Finished` marker — tdd SS4.5.7). Absent otherwise; never cleared once set. Clients mint the `Finished` marker off this flag instead of re-deriving the join; a client that knows `subagentResult` (tdd SS4.5.26) draws one `Finished` member per consumed result instead, and keeps drawing from this flag for a child with no such item, as on a host before the kind (#88809). */
|
|
2976
3334
|
drained?: boolean;
|
|
2977
3335
|
/** Error kind, verbatim durable vocabulary, when the child failed. */
|
|
2978
3336
|
errorKind?: string;
|
|
@@ -2986,6 +3344,43 @@ export interface SubagentResult {
|
|
|
2986
3344
|
text?: string;
|
|
2987
3345
|
}
|
|
2988
3346
|
|
|
3347
|
+
/** `subagentResult.resultStatus` (#88809): the consumed attempt's outcome. Absent when the host had not seen that attempt's result envelope at the drain; a client then shows the child's current outcome (ADR 88809 D2). Open: a client treats a value it does not know as an absent member. */
|
|
3348
|
+
export type SubagentResultStatus = "completed" | "failed" | "cancelled" | (string & {});
|
|
3349
|
+
|
|
3350
|
+
/** One roster row: a durable child's identity, place, and state, projected from its control records. Rows carry no result content — the transcript stays on the child session / `subagent/readResult`. */
|
|
3351
|
+
export interface SubagentRosterEntry {
|
|
3352
|
+
/** The agent definition path (`agent_path`), verbatim from the spawn. */
|
|
3353
|
+
agentPath: string;
|
|
3354
|
+
/** The child's own session id, readable via `session/read`/`view/page`. **Additive-optional**: absent until the child's start is attested. */
|
|
3355
|
+
childSessionId?: string;
|
|
3356
|
+
/** The child's control status: `Accepted` at spawn, then the latest `StatusUpdated` / `Closed` / `ResultReady` / `RecoveryAvailable` / `RecoveryDecision` (`Accepted | Starting | Running | ResultReady | Closing | Closed | RecoveryPending | ManualReconciliation`). */
|
|
3357
|
+
controlStatus: SubagentControlStatus;
|
|
3358
|
+
/** The granted definition's name (`definition_grant_audit` `definition_name`). **Additive-optional**: absent on spawns without a grant audit (historical records). The resolved definition id is not persisted on the spawn record, so the name is what the roster can truthfully carry. */
|
|
3359
|
+
definitionName?: string;
|
|
3360
|
+
/** The spawn depth (1 = a root-session child). */
|
|
3361
|
+
depth: number;
|
|
3362
|
+
/** The child's observed wall-clock duration in ms, when the runtime observed one. **Additive-optional**: absent until first observation. */
|
|
3363
|
+
durationMs?: number;
|
|
3364
|
+
/** The child's display name: the spawn `description`, falling back to the spawn `role`. **Additive-optional**: absent when neither carries one; never parsed from `agentPath`. */
|
|
3365
|
+
name?: string;
|
|
3366
|
+
/** The spawn objective. **Additive-optional**: absent when the spawn carried none. */
|
|
3367
|
+
objective?: string;
|
|
3368
|
+
/** The parent row's `agentPath`. **Additive-optional**: absent whenever `parentSubagentId` is. */
|
|
3369
|
+
parentPath?: string;
|
|
3370
|
+
/** The parent's `subagentId`: the roster row whose child session issued this child's spawn. **Additive-optional**: absent when the parent is the root session, or when the parent row is not in the roster or not yet attested — never guessed, never derived from `agentPath`. */
|
|
3371
|
+
parentSubagentId?: string;
|
|
3372
|
+
/** Whether the child's latest attempt's result is ready (a `ResultReady` for the latest admitted attempt seen). */
|
|
3373
|
+
resultReady: boolean;
|
|
3374
|
+
/** The spawn role. **Additive-optional**: absent when the spawn carried none. */
|
|
3375
|
+
role?: string;
|
|
3376
|
+
/** The durable child identity (`subagent_id`). Rows without one are not roster rows: a rejected spawn names no child. */
|
|
3377
|
+
subagentId: string;
|
|
3378
|
+
/** The terminal reason: the result envelope's `errorKind` when present, else the cancel outcome's `reason`. **Additive-optional**: absent on live rows and on terminals that carry no reason — never fabricated from the close outcome's status word. */
|
|
3379
|
+
terminalReason?: string;
|
|
3380
|
+
/** The owning dynamic workflow run id, when the child was workflow-admitted. **Additive-optional**: absent for native spawns. */
|
|
3381
|
+
workflowRunId?: string;
|
|
3382
|
+
}
|
|
3383
|
+
|
|
2989
3384
|
/** Params for `subagent/resume`, `subagent/reopen`, and `subagent/readResult` (SS3.16): the bare child target. */
|
|
2990
3385
|
export interface SubagentTargetParams {
|
|
2991
3386
|
/** Client-minted UUIDv7 command id (SS3.1.1). */
|
|
@@ -3237,6 +3632,8 @@ export interface TurnError {
|
|
|
3237
3632
|
message: string;
|
|
3238
3633
|
/** Typed quota-exhaustion detail (ADR 50047 D2/D3): present iff the stopping failure was the quota class. Clients branch on presence, never by parsing `message`. */
|
|
3239
3634
|
quota?: QuotaDetail;
|
|
3635
|
+
/** `true` when the provider refused this request. Present only on the live `turn/completed`: replayed, snapshot-served and `workflow/resume` terminals omit it, so absence does not mean the request was not denied. Never `false`. (ADR 39289 D2/D3) */
|
|
3636
|
+
requestDenied?: boolean;
|
|
3240
3637
|
/** The server's judgment that resubmitting the same input may succeed. */
|
|
3241
3638
|
retryable: boolean;
|
|
3242
3639
|
}
|
|
@@ -3307,6 +3704,18 @@ export interface TurnInterruptResult {
|
|
|
3307
3704
|
turnId: string;
|
|
3308
3705
|
}
|
|
3309
3706
|
|
|
3707
|
+
/** `turn/modelAttemptStarted` params (tdd SS4.5.1; ADR `68644-model-attempt-started` D1): a turn's model provider task recorded its opening status — one model attempt is starting (before the provider dials), retries and later model steps included. Clients raise their thinking state here, the point a switch-off TUI flips on model-task activity. Non-terminal: it never resolves a turn-wait. `sourceRange` cites the session stream's mirror of the task-lifecycle record (tdd SS4.2). */
|
|
3708
|
+
export interface TurnModelAttemptStartedParams {
|
|
3709
|
+
/** The owning session. */
|
|
3710
|
+
sessionId: string;
|
|
3711
|
+
/** The durable record this event folded from (the session stream's mirror of the model task's opening status; `first == last`). */
|
|
3712
|
+
sourceRange: SourceRange;
|
|
3713
|
+
/** The running turn whose model attempt is starting. */
|
|
3714
|
+
turnId: string;
|
|
3715
|
+
/** Opaque, strictly monotonic view cursor (tdd SS4.1). */
|
|
3716
|
+
viewCursor: string;
|
|
3717
|
+
}
|
|
3718
|
+
|
|
3310
3719
|
/** `turn/modelRetryScheduled` params (tdd SS4.5.1; ADR `50047-model-retry-scheduled-members` D1): a durable model-stream retry-scheduled fact folded — the provider backoff behind one model attempt is observable BEFORE the turn terminates, so a streaming client can render "system words · retrying in Ss · attempt N/M" instead of dead air. Non-terminal: it never resolves a turn-wait. The sibling `turn/retryScheduled` shape at the model layer: same member names and semantics (attempt/nextAttempt/maxAttempts/ retryDelayMs/system/errorKind/httpStatus), minus `reason` — the row's words derive from `errorKind` through the shared gate-off mapping, and the recorded machine message is not user text. The delay is the recorded scheduled backoff, never an absolute fire time — clients derive any countdown locally. `sourceRange` cites the session stream's mirror of the task-lifecycle record (tdd SS4.2). */
|
|
3311
3720
|
export interface TurnModelRetryScheduledParams {
|
|
3312
3721
|
/** The failed model attempt (producer-normalized, >= 1). */
|
|
@@ -3785,6 +4194,8 @@ export interface ViewPageParams {
|
|
|
3785
4194
|
direction?: ViewPageDirection;
|
|
3786
4195
|
/** Maximum events to return, 1–1000. The server MAY return fewer. The 1–1000 range is ratified and **published**: the model carries the bound and the bundle renders `minimum`/`maximum` instead of a bare `integer`. Range 1–1000 inclusive. */
|
|
3787
4196
|
limit: number;
|
|
4197
|
+
/** The caller's page byte cap (kt-dvw5, additive-optional). The page serves under `min(server budget, maxBytes)`, so a Console page stays under its own budget without the server's frame cap alone deciding. Absent means the server budget governs. `0` is refused typed (`invalid_params`): a 0 cap admits no progress. A single event over the cap is truncated (marked) instead of erroring, except verbatim and fetch-key content (`item.args`, `structuredData`, `outputRef`/ `patchRef`), which is never cut and still answers typed `PageEventTooLarge`. */
|
|
4198
|
+
maxBytes?: number;
|
|
3788
4199
|
/** The session to page. */
|
|
3789
4200
|
sessionId: string;
|
|
3790
4201
|
}
|
|
@@ -3941,10 +4352,10 @@ export interface WorkflowTokenBudget {
|
|
|
3941
4352
|
}
|
|
3942
4353
|
|
|
3943
4354
|
/** Every wire method in this schema (SS1.9 index). */
|
|
3944
|
-
export type MspMethod = "initialize" | "subagent/sendMessage" | "subagent/followupTask" | "subagent/interrupt" | "subagent/stop" | "subagent/resume" | "subagent/reopen" | "subagent/close" | "subagent/readResult" | "session/start" | "session/resume" | "session/fork" | "session/leave" | "session/list" | "session/read" | "session/sideChat" | "turn/start" | "turn/steer" | "turn/interrupt" | "turn/cancel" | "turn/unqueue" | "session/compact" | "session/setModel" | "session/rename" | "session/setReasoningEffort" | "session/userShell" | "model/list" | "skill/list" | "skill/setActivation" | "skill/import" | "hook/list" | "plugin/list" | "plugin/install" | "plugin/marketplaceAdd" | "plugin/marketplaceUpdate" | "plugin/marketplaceRemove" | "task/background" | "task/stop" | "task/stopAll" | "task/list" | "goal/set" | "goal/edit" | "goal/clear" | "goal/pause" | "goal/resume" | "workflow/cancel" | "workflow/childControl" | "workflow/pause" | "workflow/resume" | "media/upload" | "view/subscribe" | "view/unsubscribe" | "view/page" | "item/readOutput" | "approval/decide" | "approval/listPending" | "session/setApprovalMode" | "userInput/answer" | "userInput/cancel" | "userInput/clarify" | "userInput/interrupt" | "usage/read" | "feedback/submit" | "recap/request" | "recap/cancel" | "computerUseSettings/read" | "computerUseSettings/update" | "computerUseSetup/read" | "computerUseSetup/start" | "computerUseSetup/check";
|
|
4355
|
+
export type MspMethod = "initialize" | "subagent/sendMessage" | "subagent/followupTask" | "subagent/interrupt" | "subagent/stop" | "subagent/resume" | "subagent/reopen" | "subagent/close" | "subagent/readResult" | "subagent/list" | "session/start" | "session/resume" | "session/fork" | "session/declareExternalWait" | "session/clearExternalWait" | "session/leave" | "session/list" | "session/read" | "session/sideChat" | "turn/start" | "turn/steer" | "turn/interrupt" | "turn/cancel" | "turn/unqueue" | "session/compact" | "session/setModel" | "session/rename" | "session/setReasoningEffort" | "session/userShell" | "model/list" | "skill/list" | "skill/setActivation" | "skill/import" | "hook/list" | "plugin/list" | "plugin/install" | "plugin/marketplaceAdd" | "plugin/marketplaceUpdate" | "plugin/marketplaceRemove" | "task/background" | "task/stop" | "task/stopAll" | "task/list" | "goal/set" | "goal/edit" | "goal/clear" | "goal/pause" | "goal/resume" | "workflow/cancel" | "workflow/childControl" | "workflow/pause" | "workflow/resume" | "media/upload" | "view/subscribe" | "view/unsubscribe" | "view/page" | "item/readOutput" | "approval/decide" | "approval/listPending" | "session/setApprovalMode" | "userInput/answer" | "userInput/cancel" | "userInput/clarify" | "userInput/interrupt" | "usage/read" | "feedback/submit" | "recap/request" | "recap/cancel" | "model/complete" | "model/cancel" | "computerUseSettings/read" | "computerUseSettings/update" | "computerUseSetup/read" | "computerUseSetup/start" | "computerUseSetup/check";
|
|
3945
4356
|
/** Every wire notification in this schema (SS1.9 index). */
|
|
3946
|
-
export type MspNotification = "initialized" | "session/started" | "session/closed" | "session/leaveCompleted" | "skill/changed" | "turn/started" | "turn/completed" | "turn/retracted" | "turn/retryScheduled" | "turn/modelRetryScheduled" | "turn/unqueued" | "turn/foregroundCompleted" | "item/started" | "item/updated" | "item/delta" | "item/completed" | "view/gap" | "approval/requested" | "approval/updated" | "approval/reviewing" | "approval/resolved" | "userInput/requested" | "userInput/settled" | "userInput/engaged" | "session/modelChanged" | "session/reasoningEffortChanged" | "session/statusChanged" | "session/goalChanged" | "session/todoListChanged" | "session/branchChanged" | "session/tokenUsage" | "session/contextUsage" | "session/approvalModeChanged" | "recap/completed" | "session/modelRouteUnserved" | "session/nameChanged" | "session/viewHealthChanged" | "session/listChanged" | "usage/changed" | "computerUseSetup/changed" | "plugin/changed" | "plugin/marketplaceChanged" | "monitor/inboxItemAdmitted" | "monitor/inboxItemDrained" | "monitor/inboxItemVoided";
|
|
4357
|
+
export type MspNotification = "initialized" | "session/started" | "session/closed" | "session/leaveCompleted" | "skill/changed" | "turn/started" | "turn/completed" | "turn/retracted" | "turn/retryScheduled" | "turn/modelRetryScheduled" | "turn/modelAttemptStarted" | "turn/unqueued" | "turn/foregroundCompleted" | "item/started" | "item/updated" | "item/delta" | "item/completed" | "view/gap" | "approval/requested" | "approval/updated" | "approval/reviewing" | "approval/resolved" | "userInput/requested" | "userInput/settled" | "userInput/engaged" | "session/modelChanged" | "session/reasoningEffortChanged" | "session/statusChanged" | "session/goalChanged" | "session/todoListChanged" | "session/branchChanged" | "session/tokenUsage" | "session/contextUsage" | "session/approvalModeChanged" | "recap/completed" | "model/completed" | "session/modelRouteUnserved" | "session/nameChanged" | "session/viewHealthChanged" | "session/listChanged" | "usage/changed" | "computerUseSetup/changed" | "plugin/changed" | "plugin/marketplaceChanged" | "monitor/inboxItemAdmitted" | "monitor/inboxItemDrained" | "monitor/inboxItemVoided";
|
|
3947
4358
|
/** Every server-initiated wire request in this schema (SS5.3/SS5.10.1 index). */
|
|
3948
4359
|
export type MspServerRequest = "approval/request" | "userInput/request";
|
|
3949
4360
|
/** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */
|
|
3950
|
-
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";
|
|
4361
|
+
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";
|