@muse-code/sdk 1.4.14 → 1.4.20
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 +65 -3
- package/dist/src/connection/connection.d.ts +21 -4
- package/dist/src/connection/connection.js +52 -9
- package/dist/src/connection/discovery.d.ts +14 -0
- package/dist/src/connection/discovery.js +39 -0
- package/dist/src/connection/spawn.d.ts +24 -4
- package/dist/src/connection/spawn.js +5 -2
- package/dist/src/errors.d.ts +38 -0
- package/dist/src/errors.js +53 -0
- package/dist/src/facade/client.d.ts +165 -13
- package/dist/src/facade/client.js +325 -28
- package/dist/src/facade/host-death.d.ts +5 -1
- package/dist/src/facade/host-death.js +5 -1
- package/dist/src/facade/run.d.ts +50 -0
- package/dist/src/facade/run.js +132 -0
- package/dist/src/facade/session.d.ts +139 -5
- package/dist/src/facade/session.js +372 -6
- package/dist/src/facade/turn-handle.d.ts +88 -6
- package/dist/src/facade/turn-handle.js +20 -4
- 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/extension.d.ts +39 -0
- package/dist/src/fold/extension.js +49 -0
- package/dist/src/fold/session-fold.d.ts +30 -5
- package/dist/src/fold/session-fold.js +86 -1
- package/dist/src/index.d.ts +7 -5
- package/dist/src/index.js +1 -1
- package/dist/src/msp.d.ts +391 -33
- 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;
|
|
@@ -259,6 +259,8 @@ export type ApprovalResolvedBy = "user" | "policy" | "llmJudge" | (string & {});
|
|
|
259
259
|
|
|
260
260
|
/** `approval/resolved` params: the first durable terminal decision. */
|
|
261
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;
|
|
262
264
|
/** The policy rule the decision created. Present only when the decision created one. */
|
|
263
265
|
amendment?: ApprovalAmendment;
|
|
264
266
|
/** The approval that was decided. */
|
|
@@ -347,9 +349,11 @@ export interface ApprovalSubject {
|
|
|
347
349
|
access?: string;
|
|
348
350
|
/** The full raw shell command. Present when `kind` is `shell`. */
|
|
349
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;
|
|
350
354
|
/** The network host the tool wants to reach. Present when `kind` is `network`. */
|
|
351
355
|
host?: string;
|
|
352
|
-
/** Open discriminator: `shell | fileAccess | network | unixSocket | process | tool`. */
|
|
356
|
+
/** Open discriminator: `shell | fileAccess | network | unixSocket | process | tool | computerUseTakeover`. */
|
|
353
357
|
kind: string;
|
|
354
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. */
|
|
355
359
|
origin?: ApprovalOrigin;
|
|
@@ -405,14 +409,30 @@ export type AttentionFlag = "approvalPending" | "inputPending" | (string & {});
|
|
|
405
409
|
/** Who durably backgrounded a task (tdd SS4.5.5, `TaskBackgroundedInitiator`). Open — runtime vocabulary. */
|
|
406
410
|
export type BackgroundInitiator = "user" | "timeout" | (string & {});
|
|
407
411
|
|
|
408
|
-
/**
|
|
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. */
|
|
409
425
|
export interface BackgroundTerminalCompletion {
|
|
410
426
|
/** The title text gate-off shows for the backgrounded command. */
|
|
411
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;
|
|
412
430
|
/** The completion text; empty when the terminal carries none. */
|
|
413
431
|
output: string;
|
|
414
432
|
/** True when `output` is a prefix of the terminal text. */
|
|
415
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;
|
|
416
436
|
/** One of `completed`, `failed`, `cancelled`, `timedOut`, `rejected` (the ItemStatus wire vocabulary, tdd SS4.4.1). */
|
|
417
437
|
terminalStatus: string;
|
|
418
438
|
/** The backgrounded call's call id: the live/history correlation key behind the skip-when-minted rule (ADR 50041 D6). */
|
|
@@ -425,6 +445,23 @@ export interface BlockedPrompt {
|
|
|
425
445
|
text: string;
|
|
426
446
|
}
|
|
427
447
|
|
|
448
|
+
/** Whether the origin call join held at delivery. */
|
|
449
|
+
export type BodyCompletionCorrelation = "resolved" | "unresolved" | (string & {});
|
|
450
|
+
|
|
451
|
+
/** `bodyCompletion`: the facts one receipt row renders (ADR 87062 D2). The fold reads them from the inbox terminal record and the backgrounded call it names. `status`, `result_summary`, and `correlation` are required; `origin_call_id` is absent exactly when the join is unresolved. */
|
|
452
|
+
export interface BodyCompletionMembers {
|
|
453
|
+
/** Whether the origin call join held at delivery. */
|
|
454
|
+
correlation: BodyCompletionCorrelation;
|
|
455
|
+
/** The originating call's provider call id, opaque — the join key back to the original row. Absent when the join is unresolved (compaction). */
|
|
456
|
+
originCallId?: string;
|
|
457
|
+
/** True for the Manual semantic receipt (`◆`); false for the ordinary completion row. */
|
|
458
|
+
receipt: boolean;
|
|
459
|
+
/** Bounded transcript-visible result text; empty when the terminal carries none. Full bytes stay behind outputRef. */
|
|
460
|
+
resultSummary: string;
|
|
461
|
+
/** One fixed wire word per Task terminal (`completed`, `failed`, `cancelled`, `timedOut`, `rejected`) — never display text; gate-off display words derive client-side. */
|
|
462
|
+
status: string;
|
|
463
|
+
}
|
|
464
|
+
|
|
428
465
|
/** The latest branch observation in the snapshot (tdd SS4.6.4, SS4.9.1). */
|
|
429
466
|
export interface BranchState {
|
|
430
467
|
/** The observed branch; `null` on a detached-HEAD observation. */
|
|
@@ -568,6 +605,16 @@ export interface ComputerUseInstalledApp {
|
|
|
568
605
|
name: string;
|
|
569
606
|
}
|
|
570
607
|
|
|
608
|
+
/** The Computer Use lock's holder as a `computerUseTakeover` approval shows it: never its app, window, target or current action (ADR 73131 D2). */
|
|
609
|
+
export interface ComputerUseLockHolder {
|
|
610
|
+
/** When the holder took the lock (RFC 3339). */
|
|
611
|
+
acquiredAt: string;
|
|
612
|
+
/** When the holder last acted under the lock (RFC 3339). */
|
|
613
|
+
lastActivityAt: string;
|
|
614
|
+
/** The holding session's label. */
|
|
615
|
+
sessionLabel: string;
|
|
616
|
+
}
|
|
617
|
+
|
|
571
618
|
/** One macOS permission as setup last saw it. **Open**, like the phase. */
|
|
572
619
|
export type ComputerUsePermission = "granted" | "missing" | "unknown" | (string & {});
|
|
573
620
|
|
|
@@ -717,6 +764,22 @@ export interface DamagedRange {
|
|
|
717
764
|
unreadableLines: number;
|
|
718
765
|
}
|
|
719
766
|
|
|
767
|
+
/** 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. */
|
|
768
|
+
export interface DeliveredInput {
|
|
769
|
+
/** The matching drain record's log sequence: the Delivered row's position key. */
|
|
770
|
+
deliveredSequence: number;
|
|
771
|
+
/** The queued record's log sequence: entry order, and half of the sequence-pair join key. */
|
|
772
|
+
sequence: number;
|
|
773
|
+
/** The `SubagentInput` record's command id: the key wire-twin rows join by in either order. Absent when the record carries none. */
|
|
774
|
+
sourceCommandId?: string;
|
|
775
|
+
/** 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. */
|
|
776
|
+
sourceRunRecordId?: string;
|
|
777
|
+
/** The subagent the input was delivered to (parent-scope id). */
|
|
778
|
+
subagentId: string;
|
|
779
|
+
/** The stored queue-note summary (never the body). */
|
|
780
|
+
summary: string;
|
|
781
|
+
}
|
|
782
|
+
|
|
720
783
|
/** `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. */
|
|
721
784
|
export interface EarlierHistory {
|
|
722
785
|
/** The tail entries whose source record is in the pruned prefix, in tail order (at most 50, spec 6127 INV-002). May be empty. */
|
|
@@ -813,6 +876,8 @@ export interface ErrorData {
|
|
|
813
876
|
sessionId?: string;
|
|
814
877
|
/** Winning settlement on `userInputAlreadySettled`. */
|
|
815
878
|
settlement?: UserInputSettlementSummary;
|
|
879
|
+
/** The stop's refusal kind on a `workflow/cancel` `commandRejected` whose stop was refused or whose settlement read failed (SS3.19, spec 14410 FR-92884-1): `stale_revision`, `policy_rejected`, `actor_authority_mismatch`, `authority_index_conflict`, `admission_failed`, `persistence_failed`, `control_not_signalled`, `post_marker_not_cancellable`, `control_outcome_uncertain`, `adapter_contract_violation`, `transport_lost` or `reply_lost`. */
|
|
880
|
+
stopRefusal?: string;
|
|
816
881
|
/** The rejected upload id on `uploadNotFound` (`-32038`, SS3.33). */
|
|
817
882
|
uploadId?: string;
|
|
818
883
|
/** Prompt identity on user-input errors. */
|
|
@@ -822,7 +887,7 @@ export interface ErrorData {
|
|
|
822
887
|
}
|
|
823
888
|
|
|
824
889
|
/** 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. */
|
|
825
|
-
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 & {});
|
|
890
|
+
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 & {});
|
|
826
891
|
|
|
827
892
|
/** The `error` member of an error response (SS1.2 §2.4). */
|
|
828
893
|
export interface ErrorObject {
|
|
@@ -844,6 +909,12 @@ export interface ErrorResponse {
|
|
|
844
909
|
jsonrpc: JsonRpcVersion;
|
|
845
910
|
}
|
|
846
911
|
|
|
912
|
+
/** 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. */
|
|
913
|
+
export interface ExternalWaitView {
|
|
914
|
+
/** The host's label for what the session waits on. Omitted when the host declared without one. */
|
|
915
|
+
reason?: string;
|
|
916
|
+
}
|
|
917
|
+
|
|
847
918
|
/** `feedback/submit` classification (tdd SS3.25): the four TUI classes in camelCase wire spelling. **Closed**: a client-selected param vocabulary (#22785 E2). */
|
|
848
919
|
export type FeedbackClassification = "bug" | "badResult" | "goodResult" | "other";
|
|
849
920
|
|
|
@@ -904,6 +975,8 @@ export interface ForkProvenance {
|
|
|
904
975
|
cutCursor: string;
|
|
905
976
|
/** Whether the fork named an explicit cut point. */
|
|
906
977
|
cutExplicit: boolean;
|
|
978
|
+
/** `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`. */
|
|
979
|
+
isRewind?: boolean;
|
|
907
980
|
/** The source session this fork was cut from. */
|
|
908
981
|
sessionId: string;
|
|
909
982
|
}
|
|
@@ -986,10 +1059,10 @@ export type HeldFor = "approval" | "hook" | (string & {});
|
|
|
986
1059
|
/** 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". */
|
|
987
1060
|
export type HistoryMode = "anchoredSnapshot" | "inline" | "snapshot" | "none" | (string & {});
|
|
988
1061
|
|
|
989
|
-
/** Why a result served `history.mode: "none"
|
|
990
|
-
export type HistoryNoneReason = "excluded" | "cursorSuffix" | "historyBudget" | "projectionUnavailable" | "projectionReadLimit" | (string & {});
|
|
1062
|
+
/** 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. */
|
|
1063
|
+
export type HistoryNoneReason = "excluded" | "cursorSuffix" | "historyBudget" | "projectionUnavailable" | "projectionReadLimit" | "projectionRebuildFailed" | (string & {});
|
|
991
1064
|
|
|
992
|
-
/** 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. */
|
|
1065
|
+
/** 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. */
|
|
993
1066
|
export type HistoryPreference = "auto" | "inline" | "snapshot" | "anchored";
|
|
994
1067
|
|
|
995
1068
|
/** One installed handler (tdd SS3.26.1). */
|
|
@@ -1076,10 +1149,16 @@ export interface Item {
|
|
|
1076
1149
|
background?: boolean;
|
|
1077
1150
|
/** `toolCall`: who backgrounded the task; absent on pre-split records — never inferred (tdd SS4.5.5). */
|
|
1078
1151
|
backgroundInitiator?: BackgroundInitiator;
|
|
1152
|
+
/** `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. */
|
|
1153
|
+
backgroundTarget?: BackgroundTarget;
|
|
1079
1154
|
/** `backgroundTerminalCompletion`: the five facts the Finished cell renders (ADR 50041 D4). */
|
|
1080
1155
|
backgroundTerminalCompletion?: BackgroundTerminalCompletion;
|
|
1156
|
+
/** `toolCall`: the call's Bash Title — its `description` argument through the shared Bash Title normalizer, for a managed Bash call, served only while the host's `bash_titles` gate is on. The host adds it when it serves the item and never stores it; absent for any other call (tdd SS4.5.5; ADR 31406 D26). Old clients ignore it. */
|
|
1157
|
+
bashTitle?: string;
|
|
1081
1158
|
/** `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`. */
|
|
1082
1159
|
blocking?: boolean;
|
|
1160
|
+
/** `bodyCompletion`: the facts one receipt row renders (ADR 87062 D2, accepted names). */
|
|
1161
|
+
bodyCompletion?: BodyCompletionMembers;
|
|
1083
1162
|
/** `toolCall`: the provider call id (`call_...`), opaque. */
|
|
1084
1163
|
callId?: string;
|
|
1085
1164
|
/** `workflow`: one `outputRef`-shaped link per recorded child spawn with an objective (`kind: "workflow_child_prompt"`), fetched via `item/readOutput` (tdd SS4.5.8/SS4.7.4, #45449). */
|
|
@@ -1102,6 +1181,8 @@ export interface Item {
|
|
|
1102
1181
|
damagedRange?: DamagedRange;
|
|
1103
1182
|
/** `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). */
|
|
1104
1183
|
declaredPhase?: string;
|
|
1184
|
+
/** `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). */
|
|
1185
|
+
deliveredBeforeTurnEnd?: boolean;
|
|
1105
1186
|
/** `scheduledFire`: the occurrence number within the job's history, present with occurrence metadata (tdd SS4.5.17; ADR 45446 D2). */
|
|
1106
1187
|
deliveryNumber?: number;
|
|
1107
1188
|
/** `subagent`: nesting depth. */
|
|
@@ -1138,6 +1219,8 @@ export interface Item {
|
|
|
1138
1219
|
heldFor?: HeldFor;
|
|
1139
1220
|
/** `hookRun`: the durable `hook_key` (tdd SS4.5.11). */
|
|
1140
1221
|
hookKey?: string;
|
|
1222
|
+
/** `subagentInput`: the record the item stands for; see [`SubagentInputPhase`] (#70249). */
|
|
1223
|
+
inputPhase?: SubagentInputPhase;
|
|
1141
1224
|
/** 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. */
|
|
1142
1225
|
itemId: string;
|
|
1143
1226
|
/** `scheduledFire`: the cron job id that fired (tdd SS4.5.17; ADR 45446 D2, spec 13929 amendment #62595 FR-62595-1). */
|
|
@@ -1148,7 +1231,7 @@ export interface Item {
|
|
|
1148
1231
|
label?: string;
|
|
1149
1232
|
/** `workflow`: the reconciled terminal message, set on completion. */
|
|
1150
1233
|
message?: string;
|
|
1151
|
-
/** `agentMessage`: the phase the model declared
|
|
1234
|
+
/** `agentMessage`: the phase the model declared; see [`MessagePhase`]. */
|
|
1152
1235
|
messagePhase?: MessagePhase;
|
|
1153
1236
|
/** `toolCall`: rich content the model saw beyond text; base64 is not inlined on the view (tdd SS4.5.5). */
|
|
1154
1237
|
modelVisibleContent?: ModelVisibleContent[];
|
|
@@ -1158,18 +1241,30 @@ export interface Item {
|
|
|
1158
1241
|
monitorId?: string;
|
|
1159
1242
|
/** `scheduledFire`: the next scheduled epoch in milliseconds; absent on a final delivery (tdd SS4.5.17; ADR 45446 D2). */
|
|
1160
1243
|
nextFireAtMs?: number;
|
|
1244
|
+
/** `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). */
|
|
1245
|
+
noticeKind?: string;
|
|
1246
|
+
/** `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. */
|
|
1247
|
+
noticeOrigin?: NoticeOrigin;
|
|
1248
|
+
/** `systemNotice`: the notice's level — `info` | `warning` | `error`, open (tdd SS4.5.23; ADR 42729 D1). Absent means the server classified no level. */
|
|
1249
|
+
noticeSeverity?: NoticeSeverity;
|
|
1250
|
+
/** `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). */
|
|
1251
|
+
noticeSubject?: NoticeSubject;
|
|
1161
1252
|
/** `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. */
|
|
1162
1253
|
objective?: string;
|
|
1163
1254
|
/** `compaction`: terminal only — folds installed/fallback status. */
|
|
1164
1255
|
outcome?: CompactionOutcome;
|
|
1165
1256
|
/** `toolCall`/`userShell`: stored-output reference; fetch the full bytes via `item/readOutput` (served by #208). */
|
|
1166
1257
|
outputRef?: OutputRef;
|
|
1258
|
+
/** `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). */
|
|
1259
|
+
parentSubagentId?: string;
|
|
1167
1260
|
/** `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). */
|
|
1168
1261
|
patchRef?: OutputRef;
|
|
1169
1262
|
/** `toolCall`: server-authored edit-family diff summary (#33025) — always beside `patchRef`; absent = no diff available (tdd SS4.5.5). */
|
|
1170
1263
|
patchSummary?: PatchSummary;
|
|
1171
1264
|
/** `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). */
|
|
1172
1265
|
paused?: boolean;
|
|
1266
|
+
/** `peerMessage`: the four facts the consumed card renders (ADR 72708 D2, tdd SS4.5.24). */
|
|
1267
|
+
peerMessage?: PeerMessage;
|
|
1173
1268
|
/** `reasoning`: provider reasoning item id (e.g. `rs_...`), for provider-side correlation. */
|
|
1174
1269
|
providerItemId?: string;
|
|
1175
1270
|
/** `compaction`: noop/failure reason, verbatim (snake_case durable vocabulary, e.g. `"no_compactable_history"`). `hookRun`: terminal-only capped terminal reason (tdd SS4.5.11). */
|
|
@@ -1182,6 +1277,8 @@ export interface Item {
|
|
|
1182
1277
|
replayHint?: ReplayHint;
|
|
1183
1278
|
/** `subagent`: the result envelope from `ResultReady` (tdd SS4.5.7). */
|
|
1184
1279
|
result?: SubagentResult;
|
|
1280
|
+
/** `subagentResult`: the consumed attempt's outcome; absent if unseen at the drain (#88809). */
|
|
1281
|
+
resultStatus?: SubagentResultStatus;
|
|
1185
1282
|
/** `workflow`: set on resumed launches. */
|
|
1186
1283
|
resumeFromRunId?: string;
|
|
1187
1284
|
/** `userMessage`: `true` after an accepted retract (tdd SS4.5.1); re-emitted via `item/updated`. */
|
|
@@ -1226,9 +1323,9 @@ export interface Item {
|
|
|
1226
1323
|
summarizedThrough?: string;
|
|
1227
1324
|
/** `reasoning`: one entry per summary part; part *n* streams via `item/delta` field `"summary.n"` (part boundary = index change). */
|
|
1228
1325
|
summary?: string[];
|
|
1229
|
-
/** `reminderChild`: the linked task id. */
|
|
1326
|
+
/** `reminderChild`: the linked task id. Unresolved `bodyCompletion` items also set it (FR-87062-1: the diagnostic names the task whose join did not hold). */
|
|
1230
1327
|
taskId?: string;
|
|
1231
|
-
/** Terminal `toolCall
|
|
1328
|
+
/** 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). */
|
|
1232
1329
|
terminalRowAfterItemId?: string;
|
|
1233
1330
|
/** `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). */
|
|
1234
1331
|
text?: string;
|
|
@@ -1246,9 +1343,9 @@ export interface Item {
|
|
|
1246
1343
|
trigger?: CompactionTrigger;
|
|
1247
1344
|
/** `workflow`: camelCased `WorkflowLaunchTriggerSource`, verbatim (durable runtime vocabulary, e.g. `"modelProposal"`). */
|
|
1248
1345
|
triggerSource?: string;
|
|
1249
|
-
/** `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). */
|
|
1346
|
+
/** `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). */
|
|
1250
1347
|
truncated?: boolean;
|
|
1251
|
-
/** 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). */
|
|
1348
|
+
/** 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). */
|
|
1252
1349
|
turnId?: string | null;
|
|
1253
1350
|
/** `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). */
|
|
1254
1351
|
usage?: TokenUsage;
|
|
@@ -1289,7 +1386,7 @@ export interface ItemDeltaParams {
|
|
|
1289
1386
|
}
|
|
1290
1387
|
|
|
1291
1388
|
/** 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). */
|
|
1292
|
-
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | "monitorFeed" | "damagedRange" | "scheduledFire" | "backgroundTerminalCompletion" | "overdueNotice" | "earlierHistory" | (string & {});
|
|
1389
|
+
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | "monitorFeed" | "damagedRange" | "scheduledFire" | "backgroundTerminalCompletion" | "overdueNotice" | "earlierHistory" | "peerMessage" | "subagentInput" | "subagentResult" | "systemNotice" | "bodyCompletion" | (string & {});
|
|
1293
1390
|
|
|
1294
1391
|
/** 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. */
|
|
1295
1392
|
export type ItemReadOutputEncoding = "utf8" | "base64";
|
|
@@ -1409,9 +1506,19 @@ export interface MessageAttachment {
|
|
|
1409
1506
|
width?: number;
|
|
1410
1507
|
}
|
|
1411
1508
|
|
|
1412
|
-
/** `agentMessage.messagePhase` (tdd SS4.5.3, #50254): the phase the model declared
|
|
1509
|
+
/** `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. */
|
|
1413
1510
|
export type MessagePhase = "commentary" | "finalAnswer" | (string & {});
|
|
1414
1511
|
|
|
1512
|
+
/** `model/cancel` params (tdd SS3.40, FR-90352-4): the `commandId` of the call to cancel, not a retry id of its own. */
|
|
1513
|
+
export interface ModelCancelParams {
|
|
1514
|
+
/** The call to cancel. */
|
|
1515
|
+
commandId: string;
|
|
1516
|
+
}
|
|
1517
|
+
|
|
1518
|
+
/** `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. */
|
|
1519
|
+
export interface ModelCancelResult {
|
|
1520
|
+
}
|
|
1521
|
+
|
|
1415
1522
|
/** One visible catalog row (tdd SS3.10). Catalog rows marked hidden never reach the wire, so a client cannot select one. */
|
|
1416
1523
|
export interface ModelCatalogEntry {
|
|
1417
1524
|
/** Context limit; `null` when the catalog source declared nothing. */
|
|
@@ -1450,6 +1557,69 @@ export type ModelCatalogSource = "providerCatalog" | "fakeCatalog" | "unresolved
|
|
|
1450
1557
|
/** What drove a model selection (tdd SS4.6.1). Open. */
|
|
1451
1558
|
export type ModelChangeSource = "user" | "default" | "policy" | (string & {});
|
|
1452
1559
|
|
|
1560
|
+
/** One `model/complete` message (tdd SS3.40). */
|
|
1561
|
+
export interface ModelCompleteMessage {
|
|
1562
|
+
/** Who said it. */
|
|
1563
|
+
role: ModelCompleteRole;
|
|
1564
|
+
/** What was said. */
|
|
1565
|
+
text: string;
|
|
1566
|
+
}
|
|
1567
|
+
|
|
1568
|
+
/** 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). */
|
|
1569
|
+
export type ModelCompleteOutcome = "completed" | "failed" | "cancelled" | "timedOut" | (string & {});
|
|
1570
|
+
|
|
1571
|
+
/** `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. */
|
|
1572
|
+
export interface ModelCompleteParams {
|
|
1573
|
+
/** The client-minted UUIDv7 retry id (required, SS3.1.1). */
|
|
1574
|
+
commandId: string;
|
|
1575
|
+
/** The most tokens the model may write. Range 1–1024 inclusive. */
|
|
1576
|
+
maxTokens: number;
|
|
1577
|
+
/** What the model answers, oldest first. At most 32 items. */
|
|
1578
|
+
messages: ModelCompleteMessage[];
|
|
1579
|
+
/** The system text, when the caller sends one. */
|
|
1580
|
+
system?: string;
|
|
1581
|
+
}
|
|
1582
|
+
|
|
1583
|
+
/** `model/complete` result (tdd SS3.40): admission only — the ack is never the completion. */
|
|
1584
|
+
export interface ModelCompleteResult {
|
|
1585
|
+
/** The request's id, echoed. */
|
|
1586
|
+
commandId: string;
|
|
1587
|
+
/** Always `accepted` on this path. */
|
|
1588
|
+
status: CommandStatus;
|
|
1589
|
+
}
|
|
1590
|
+
|
|
1591
|
+
/** Who said one `model/complete` message. **Closed**: a client-produced input the host validates, so an unknown role is `invalidParams`. */
|
|
1592
|
+
export type ModelCompleteRole = "user" | "assistant";
|
|
1593
|
+
|
|
1594
|
+
/** 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). */
|
|
1595
|
+
export type ModelCompleteStopReason = "end" | "maxTokens" | (string & {});
|
|
1596
|
+
|
|
1597
|
+
/** The provider's token counts for one completed call (ADR 90352 D5): real counts only, never an estimate. */
|
|
1598
|
+
export interface ModelCompleteUsage {
|
|
1599
|
+
/** Input tokens, as the provider counted them. */
|
|
1600
|
+
inputTokens: number;
|
|
1601
|
+
/** Output tokens, as the provider counted them. */
|
|
1602
|
+
outputTokens: number;
|
|
1603
|
+
}
|
|
1604
|
+
|
|
1605
|
+
/** `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. */
|
|
1606
|
+
export interface ModelCompletedParams {
|
|
1607
|
+
/** The request's id — the correlation key. */
|
|
1608
|
+
commandId: string;
|
|
1609
|
+
/** Why the call failed, in words (on `failed`). */
|
|
1610
|
+
message?: string;
|
|
1611
|
+
/** The `model/list` id of the model that ran (on `completed`). */
|
|
1612
|
+
modelId?: string;
|
|
1613
|
+
/** How the call settled. */
|
|
1614
|
+
outcome: ModelCompleteOutcome;
|
|
1615
|
+
/** Why the model stopped (on `completed`). */
|
|
1616
|
+
stopReason?: ModelCompleteStopReason;
|
|
1617
|
+
/** The model's answer, verbatim (on `completed`). */
|
|
1618
|
+
text?: string;
|
|
1619
|
+
/** The provider's counts (on `completed`, when it reported them). */
|
|
1620
|
+
usage?: ModelCompleteUsage;
|
|
1621
|
+
}
|
|
1622
|
+
|
|
1453
1623
|
/** 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. */
|
|
1454
1624
|
export interface ModelCost {
|
|
1455
1625
|
/** Cached-input cost, a decimal string. */
|
|
@@ -1581,6 +1751,48 @@ export interface MonitorInboxItemVoidedParams {
|
|
|
1581
1751
|
voidedAt: string;
|
|
1582
1752
|
}
|
|
1583
1753
|
|
|
1754
|
+
/** 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). */
|
|
1755
|
+
export interface MonitorInboxSnapshotEntry {
|
|
1756
|
+
/** The model-facing delivery text. */
|
|
1757
|
+
body: string;
|
|
1758
|
+
/** The producer-recorded pre-augmentation content; absent on pre-#24686 records. */
|
|
1759
|
+
displayBody?: string;
|
|
1760
|
+
/** The newest drain stamp (RFC3339); absent while never drained. */
|
|
1761
|
+
drainedAt?: string;
|
|
1762
|
+
/** Per-task event order key (with `line_index`). */
|
|
1763
|
+
eventIndex: number;
|
|
1764
|
+
/** Monitor event kind, snake_case, open vocabulary. */
|
|
1765
|
+
eventKind: string;
|
|
1766
|
+
/** The inbox item id (dedupe key). */
|
|
1767
|
+
itemId: string;
|
|
1768
|
+
/** Line order key; absent when the event has no line. */
|
|
1769
|
+
lineIndex?: number;
|
|
1770
|
+
/** Admission stamp (RFC3339). */
|
|
1771
|
+
queuedAt: string;
|
|
1772
|
+
/** Whether the event carries displayable lines. */
|
|
1773
|
+
showLines: boolean;
|
|
1774
|
+
/** The notice-text summary. */
|
|
1775
|
+
summary: string;
|
|
1776
|
+
/** The owning monitor task id (per-task set key). */
|
|
1777
|
+
taskId: string;
|
|
1778
|
+
/** The newest wake-missed void stamp (RFC3339); absent while never voided. */
|
|
1779
|
+
voidedAt?: string;
|
|
1780
|
+
}
|
|
1781
|
+
|
|
1782
|
+
/** `systemNotice`: the producing family, so a client routes a notice without parsing its text (tdd SS4.5.23). Open. The v1 vocabulary is the Monitor notice and the three system-chrome producers (ADR 42729 D1) plus the hook-run producer (ADR 75121 D2), the paused-Workflow checkpoint producer (ADR 39490 D5) and the continued-child tools producer (ADR 42729 D5); absent means the server named no origin, and a client never infers one. */
|
|
1783
|
+
export type NoticeOrigin = "monitor" | "skillsStartup" | "scheduledFire" | "incompleteGeneration" | "hook" | "workflowCheckpoint" | "continuedChildTools" | (string & {});
|
|
1784
|
+
|
|
1785
|
+
/** `systemNotice`: the notice's level (tdd SS4.5.23). Open; an unknown value is an unknown-but-present level, rendered generically (SS4.10). */
|
|
1786
|
+
export type NoticeSeverity = "info" | "warning" | "error" | (string & {});
|
|
1787
|
+
|
|
1788
|
+
/** `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 `""`. */
|
|
1789
|
+
export interface NoticeSubject {
|
|
1790
|
+
/** 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). */
|
|
1791
|
+
id: string;
|
|
1792
|
+
/** The subject's bounded display label (the `hookRun.label` shape). */
|
|
1793
|
+
label?: string;
|
|
1794
|
+
}
|
|
1795
|
+
|
|
1584
1796
|
/** A notification frame, either direction (SS1.2 §2.2). No `id`; a notification is never answered. */
|
|
1585
1797
|
export interface Notification {
|
|
1586
1798
|
/** 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. */
|
|
@@ -1626,6 +1838,18 @@ export interface PatchSummary {
|
|
|
1626
1838
|
removed: number;
|
|
1627
1839
|
}
|
|
1628
1840
|
|
|
1841
|
+
/** `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. */
|
|
1842
|
+
export interface PeerMessage {
|
|
1843
|
+
/** The message text verbatim — never cut (an over-budget event answers the typed `pageEventTooLarge` arm). */
|
|
1844
|
+
body: string;
|
|
1845
|
+
/** True for mailbox/remote senders, false for local session senders. */
|
|
1846
|
+
remote: boolean;
|
|
1847
|
+
/** 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. */
|
|
1848
|
+
senderLabel: string;
|
|
1849
|
+
/** The local sender's session id; absent for remote senders and when the record names none. */
|
|
1850
|
+
senderSessionId?: string;
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1629
1853
|
/** A pending approval in the snapshot: the SS2.5.2 pointer shape plus the gated `itemId` when one exists (tdd SS4.9.1). */
|
|
1630
1854
|
export interface PendingApprovalPointer {
|
|
1631
1855
|
/** The pending approval's id. */
|
|
@@ -1854,6 +2078,19 @@ export interface PluginMarketplaceUpdateParams {
|
|
|
1854
2078
|
/** 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. */
|
|
1855
2079
|
export type PluginSource = "curated" | "marketplaceUserAdded" | "foreignImport" | "nativeLocal" | (string & {});
|
|
1856
2080
|
|
|
2081
|
+
/** 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. */
|
|
2082
|
+
export type ProbeDegradedReason = "skippedUntrusted" | "skippedSandboxUnavailable" | "probeFailed" | (string & {});
|
|
2083
|
+
|
|
2084
|
+
/** 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. */
|
|
2085
|
+
export interface PrunedSubagent {
|
|
2086
|
+
/** The served display label (the spawn's role, agent path as fallback); absent when the spawn records carry neither. */
|
|
2087
|
+
label?: string;
|
|
2088
|
+
/** The child session id — the trace key for `session/read` on the child, exactly as for a live child row. */
|
|
2089
|
+
sessionId: string;
|
|
2090
|
+
/** `running`, `completed`, or `failed`; absent reads as `running`. */
|
|
2091
|
+
status?: string;
|
|
2092
|
+
}
|
|
2093
|
+
|
|
1857
2094
|
/** 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. */
|
|
1858
2095
|
export interface QueuedInput {
|
|
1859
2096
|
/** The queued record's log sequence: delivery order, and the key clients deduplicate re-reads by. */
|
|
@@ -2002,12 +2239,16 @@ export interface RequestReceipt {
|
|
|
2002
2239
|
/** 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. */
|
|
2003
2240
|
export type RetractOutcome = "accepted" | "declined" | (string & {});
|
|
2004
2241
|
|
|
2005
|
-
/** 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
|
|
2242
|
+
/** 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. */
|
|
2006
2243
|
export interface RuntimeWorktree {
|
|
2007
2244
|
/** The commit the worktree was created from. */
|
|
2008
2245
|
baseCommit: string;
|
|
2246
|
+
/** The cleanup outcome's recorded diagnostic, verbatim (#70088); absent when the outcome records none. */
|
|
2247
|
+
cleanupDiagnostic?: string;
|
|
2009
2248
|
/** How the worktree is cleaned up. */
|
|
2010
2249
|
cleanupPolicy: RuntimeWorktreeCleanupPolicy;
|
|
2250
|
+
/** Why cleanup kept the worktree or failed, as the cleanup outcome recorded it (#70088); absent when the outcome records no reason. */
|
|
2251
|
+
cleanupReason?: RuntimeWorktreeCleanupReason;
|
|
2011
2252
|
/** Where the worktree's cleanup stands. */
|
|
2012
2253
|
cleanupState: RuntimeWorktreeCleanupState;
|
|
2013
2254
|
/** The head commit the active lease recorded. */
|
|
@@ -2023,6 +2264,9 @@ export interface RuntimeWorktree {
|
|
|
2023
2264
|
/** How a session's worktree is cleaned up. The set is open, so newer hosts may send other values. */
|
|
2024
2265
|
export type RuntimeWorktreeCleanupPolicy = "removeIfClean" | (string & {});
|
|
2025
2266
|
|
|
2267
|
+
/** Why a session's worktree cleanup kept the worktree or failed. The set is open, so newer hosts may send other values. */
|
|
2268
|
+
export type RuntimeWorktreeCleanupReason = "dirtyWorktree" | "headChanged" | "pathEscape" | "cleanupFailed" | "uncertainLeaseState" | (string & {});
|
|
2269
|
+
|
|
2026
2270
|
/** Where a session's worktree cleanup stands. The set is open, so newer hosts may send other values. */
|
|
2027
2271
|
export type RuntimeWorktreeCleanupState = "active" | "cleaned" | "retained" | "cleanupFailed" | (string & {});
|
|
2028
2272
|
|
|
@@ -2037,6 +2281,8 @@ export type SandboxUnavailableReason = "userNamespacesDenied" | "bubblewrapUnava
|
|
|
2037
2281
|
|
|
2038
2282
|
/** The `schema` pair in [`InitializeResult`] (SS1.4.1, SS1.5.3). `version` is the wire **envelope** schema version — distinct from the session-view `schemaVersion`, the raw-log `schema_version`, and the 0.x/1.0 stability posture, which is not on the wire at all (INV-006a). */
|
|
2039
2283
|
export interface SchemaInfo {
|
|
2284
|
+
/** `sha256:<64 lower hex>` content hash of this server binary's experimental-surface bundle (ADR 97527 D5). Additive-optional: a host that predates the member omits it, and the reader treats absence as unknown — never a guessed value (SS1.5.4). */
|
|
2285
|
+
experimentalFingerprint?: string;
|
|
2040
2286
|
/** `sha256:<64 lower hex>` content hash of this server binary's stable-surface bundle (INV-003). A mismatch is a warning condition, not an error (SS1.4.1). */
|
|
2041
2287
|
fingerprint: string;
|
|
2042
2288
|
/** Envelope schema version; `1` in v1, expected to stay `1` for a long time (SS1.4.1). */
|
|
@@ -2053,7 +2299,7 @@ export interface ServerInfo {
|
|
|
2053
2299
|
|
|
2054
2300
|
/** The session object every lifecycle method returns or lists (tdd SS2.4). Additive-optional evolution applies: clients must ignore unknown fields. */
|
|
2055
2301
|
export interface Session {
|
|
2056
|
-
/** The `turnId` of the current foreground turn when
|
|
2302
|
+
/** The `turnId` of the current foreground turn when a turn is in flight (parked under `needsInput` included), and `null` otherwise (tdd SS2.4, ADR 95605 D1). **Required-nullable.** Every served `Session` carries the member: `null` when no turn is in flight or the session is not loaded, the turn id when one is. An optional-absent shape would publish it as plain `string` and reject every idle `Session` frame the host sends. */
|
|
2057
2303
|
activeTurnId: string | null;
|
|
2058
2304
|
/** The folded effective approval mode. **Additive-optional**: a Session object that omits it means the host has not folded a mode, which is why the index-derived `session/list` entry may legitimately omit it (tdd SS2.4, SS5.12). */
|
|
2059
2305
|
approvalMode?: EffectiveApprovalModeState;
|
|
@@ -2067,6 +2313,8 @@ export interface Session {
|
|
|
2067
2313
|
createdByClient?: ClientInfo;
|
|
2068
2314
|
/** 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). */
|
|
2069
2315
|
driveHolder?: ClientInfo;
|
|
2316
|
+
/** 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. */
|
|
2317
|
+
externalWait?: ExternalWaitView;
|
|
2070
2318
|
/** Derived first-user-prompt preview (tdd SS2.14.1, #27598). **Additive-optional**, omitted when underivable. */
|
|
2071
2319
|
firstUserPrompt?: string;
|
|
2072
2320
|
/** `null` for root sessions; fork provenance otherwise (tdd SS2.4). */
|
|
@@ -2087,10 +2335,12 @@ export interface Session {
|
|
|
2087
2335
|
name?: string;
|
|
2088
2336
|
/** 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. */
|
|
2089
2337
|
nameOrigin?: SessionNameOrigin;
|
|
2090
|
-
/** 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
|
|
2338
|
+
/** 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. */
|
|
2091
2339
|
parentSessionId?: string;
|
|
2092
2340
|
/** 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. */
|
|
2093
2341
|
path: string;
|
|
2342
|
+
/** 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. */
|
|
2343
|
+
probeDegradedReason?: ProbeDegradedReason;
|
|
2094
2344
|
/** The winning metadata fold's provider; `null` when that record omits it. */
|
|
2095
2345
|
providerId: string | null;
|
|
2096
2346
|
/** 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). */
|
|
@@ -2099,7 +2349,7 @@ export interface Session {
|
|
|
2099
2349
|
sessionId: string;
|
|
2100
2350
|
/** `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`. */
|
|
2101
2351
|
sideFrom?: SideProvenance | null;
|
|
2102
|
-
/** 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.
|
|
2352
|
+
/** 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. */
|
|
2103
2353
|
spawnedBy?: SessionSpawnedBy;
|
|
2104
2354
|
/** Load state as this host knows it; `session/list` reports `notLoaded` for sessions loaded by *other* hosts (tdd SS2.4). */
|
|
2105
2355
|
status: SessionStatus;
|
|
@@ -2147,6 +2397,18 @@ export interface SessionBranchChangedParams {
|
|
|
2147
2397
|
workspaceRoot: string;
|
|
2148
2398
|
}
|
|
2149
2399
|
|
|
2400
|
+
/** `session/clearExternalWait` params. */
|
|
2401
|
+
export interface SessionClearExternalWaitParams {
|
|
2402
|
+
/** The loaded session the declaration is cleared for. */
|
|
2403
|
+
sessionId: string;
|
|
2404
|
+
}
|
|
2405
|
+
|
|
2406
|
+
/** `session/clearExternalWait` result: no declaration is live. */
|
|
2407
|
+
export interface SessionClearExternalWaitResult {
|
|
2408
|
+
/** Always `false` on a successful clear: no declaration is live. */
|
|
2409
|
+
declared: boolean;
|
|
2410
|
+
}
|
|
2411
|
+
|
|
2150
2412
|
/** `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. */
|
|
2151
2413
|
export interface SessionClosedParams {
|
|
2152
2414
|
/** Which orderly unload path fired. */
|
|
@@ -2182,6 +2444,8 @@ export interface SessionCompactResult {
|
|
|
2182
2444
|
|
|
2183
2445
|
/** The open configuration extension object shared by `session/start` and `session/resume` (ADR 32760 D1). Unknown keys are ignored on the wire, never rejected: the live decoder tolerates them, and no exported bundle carries `additionalProperties: false`. The Rust typed model's `deny_unknown_fields` is internal and never exported — the closedness export applies nowhere, and the `x-msp-closed` opt-in mechanism stays inert. Recognized `mcpServers` values are typed and validated before they leave the wire boundary. */
|
|
2184
2446
|
export interface SessionConfig {
|
|
2447
|
+
/** Developer instructions for this session only (ADR 32029 D38, stable from switch piece F2), on `session/start` and `session/resume`. The text is trimmed. A nonblank value replaces the settings-derived developer instructions; an omitted member is no override and keeps the full developer context. Explicit `null` and blank text are the explicit clear (the Rust value is an empty string): no override, and on a host that serves developer instructions they also turn off the session's suppressible developer context (the agent catalog and the memory snapshot). Any other type fails the decode. A host that does not serve developer instructions ignores a valid member. */
|
|
2448
|
+
developerPrompt?: string | null;
|
|
2185
2449
|
/** Native MCP servers added only to this session runtime. */
|
|
2186
2450
|
mcpServers?: Record<string, SessionMcpServerConfig>;
|
|
2187
2451
|
}
|
|
@@ -2202,6 +2466,22 @@ export interface SessionContextUsageParams {
|
|
|
2202
2466
|
windowTokens?: number;
|
|
2203
2467
|
}
|
|
2204
2468
|
|
|
2469
|
+
/** `session/declareExternalWait` params. */
|
|
2470
|
+
export interface SessionDeclareExternalWaitParams {
|
|
2471
|
+
/** 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. */
|
|
2472
|
+
reason?: string;
|
|
2473
|
+
/** The loaded session the declaration is for. */
|
|
2474
|
+
sessionId: string;
|
|
2475
|
+
}
|
|
2476
|
+
|
|
2477
|
+
/** `session/declareExternalWait` result: the declaration is live. */
|
|
2478
|
+
export interface SessionDeclareExternalWaitResult {
|
|
2479
|
+
/** Always `true` on a successful declare: a declaration is live. */
|
|
2480
|
+
declared: boolean;
|
|
2481
|
+
/** The live declaration's reason, as declared (truncated by the host runtime). Omitted when the host declared without one. */
|
|
2482
|
+
reason?: string;
|
|
2483
|
+
}
|
|
2484
|
+
|
|
2205
2485
|
/** 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. */
|
|
2206
2486
|
export type SessionDurability = "durable" | "ephemeral" | (string & {});
|
|
2207
2487
|
|
|
@@ -2332,7 +2612,7 @@ export interface SessionListParams {
|
|
|
2332
2612
|
workspaceRoot?: string;
|
|
2333
2613
|
}
|
|
2334
2614
|
|
|
2335
|
-
/** `session/list` result (tdd SS2.5.4).
|
|
2615
|
+
/** `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`. */
|
|
2336
2616
|
export interface SessionListResult {
|
|
2337
2617
|
/** 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. */
|
|
2338
2618
|
appliedFilter?: SessionListFilter;
|
|
@@ -2435,12 +2715,18 @@ export interface SessionReadParams {
|
|
|
2435
2715
|
export interface SessionReadResult {
|
|
2436
2716
|
/** Same member as `session/resume` (tdd SS2.5.5, ADR 50074 D2). */
|
|
2437
2717
|
blockedPrompt?: BlockedPrompt;
|
|
2718
|
+
/** 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. */
|
|
2719
|
+
deliveredInputs?: DeliveredInput[];
|
|
2438
2720
|
/** The served history. */
|
|
2439
2721
|
history: SessionHistory;
|
|
2440
2722
|
/** Same member as `session/resume` (tdd SS2.5.5, ADR 36635 D2). */
|
|
2441
2723
|
lastTurn?: LastTurn;
|
|
2724
|
+
/** Whether a native child read session's model turn runs (tdd SS2.5.5, ADR 89202 D1): served on a read of a `subagent` session whose containing session this host holds loaded, from that session's runtime at serve time. Absent for every other read and when the runtime cannot answer; absence asserts nothing. */
|
|
2725
|
+
modelTurnRunning?: boolean;
|
|
2442
2726
|
/** 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). */
|
|
2443
2727
|
pendingRequests: PendingRequestPointer[];
|
|
2728
|
+
/** 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. */
|
|
2729
|
+
prunedSubagents?: PrunedSubagent[];
|
|
2444
2730
|
/** 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. */
|
|
2445
2731
|
queuedInputs?: QueuedInput[];
|
|
2446
2732
|
/** Current local construction only; never inferred from retained history. Absence establishes neither a choice nor supported recovery. */
|
|
@@ -2499,7 +2785,7 @@ export interface SessionResumeParams {
|
|
|
2499
2785
|
excludeItems?: boolean;
|
|
2500
2786
|
/** 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. */
|
|
2501
2787
|
history?: HistoryPreference;
|
|
2502
|
-
/** 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
|
|
2788
|
+
/** 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`. */
|
|
2503
2789
|
modelId?: string;
|
|
2504
2790
|
/** 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). */
|
|
2505
2791
|
permissionProfile?: string;
|
|
@@ -2519,6 +2805,8 @@ export interface SessionResumeResult {
|
|
|
2519
2805
|
lastTurn?: LastTurn;
|
|
2520
2806
|
/** The late-joiner pointer set; empty when nothing is pending. */
|
|
2521
2807
|
pendingRequests: PendingRequestPointer[];
|
|
2808
|
+
/** 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. */
|
|
2809
|
+
prunedSubagents?: PrunedSubagent[];
|
|
2522
2810
|
/** The loaded session. */
|
|
2523
2811
|
session: Session;
|
|
2524
2812
|
/** 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). */
|
|
@@ -2605,7 +2893,7 @@ export interface SessionSideChatResult {
|
|
|
2605
2893
|
|
|
2606
2894
|
/** Who opened a session (`Session.spawnedBy`, spec 42713 FR-69621-6, ADR 69621 D4). */
|
|
2607
2895
|
export interface SessionSpawnedBy {
|
|
2608
|
-
/** The exact session that opened this one (ADR 69621 D2). */
|
|
2896
|
+
/** 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). */
|
|
2609
2897
|
parentSessionId: string;
|
|
2610
2898
|
/** An opaque project label the spawner named, when it named one. */
|
|
2611
2899
|
project?: string;
|
|
@@ -2617,6 +2905,8 @@ export interface SessionSpawnedBy {
|
|
|
2617
2905
|
export interface SessionStartParams {
|
|
2618
2906
|
/** 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). */
|
|
2619
2907
|
approvalMode?: ApprovalMode | null;
|
|
2908
|
+
/** Marks this start as a `/clear` (spec 207 amendment 93195, FR-93195-1, ADR 93195 D1): `true` starts the new session as a clear, so its `SessionStart` hooks get source `clear` instead of `startup`. `false` and omitted are the same plain start (source `startup`). It neither needs nor implies `previousSessionId`. Explicit `null` is invalid params. */
|
|
2909
|
+
clear?: boolean;
|
|
2620
2910
|
/** The SS2.5 idempotency handle (UUIDv7). Required; the server never mints one. */
|
|
2621
2911
|
commandId: string;
|
|
2622
2912
|
/** Reserved for future per-session overrides; only its `mcpServers` member is admitted. */
|
|
@@ -2658,13 +2948,13 @@ export interface SessionStartedParams {
|
|
|
2658
2948
|
/** A session's load state (tdd SS2.4). */
|
|
2659
2949
|
export type SessionStatus = "notLoaded" | "idle" | "running" | (string & {});
|
|
2660
2950
|
|
|
2661
|
-
/** `session/statusChanged` params (tdd SS4.6.10, ADR 31983 D2): a loaded session's projected `(status, attention)` value flipped. A command-plane broadcast — delivered to every connection regardless of its view subscription set, never gated, no `sourceRange`; the same facts live on the Session object, which is how a client seeds its table (no initial burst on connect). */
|
|
2951
|
+
/** `session/statusChanged` params (tdd SS4.6.10, ADR 31983 D2): a loaded session's projected `(status, attention, needsInputReasons)` value flipped. A command-plane broadcast — delivered to every connection regardless of its view subscription set, never gated, no `sourceRange`; the same facts live on the Session object, which is how a client seeds its table (no initial burst on connect). */
|
|
2662
2952
|
export interface SessionStatusChangedParams {
|
|
2663
2953
|
/** Attention flags after the transition; present only when at least one flag is set (tdd SS2.4, ADR 31983 D3). */
|
|
2664
2954
|
attention?: AttentionFlag[];
|
|
2665
2955
|
/** The owning session. */
|
|
2666
2956
|
sessionId: string;
|
|
2667
|
-
/** Load state after the transition (the
|
|
2957
|
+
/** Load state after the transition (the open SS2.4 enum, including `needsInput` since ADR 95605 D1/D4). */
|
|
2668
2958
|
status: SessionStatus;
|
|
2669
2959
|
/** The causing record's view cursor (ADR 31983 D4). Required-nullable: `null` exactly when the paired `session/closed`'s cursor is `null` (the unload fold-failure arm); a definite cursor everywhere else. */
|
|
2670
2960
|
viewCursor: string | null;
|
|
@@ -2730,14 +3020,14 @@ export interface SessionUserShellResult {
|
|
|
2730
3020
|
status: CommandStatus;
|
|
2731
3021
|
}
|
|
2732
3022
|
|
|
2733
|
-
/** The view-health state (tdd SS2.5.2 companion). Open enum (`x-msp-openness: open`): a client MUST ignore an unrecognized value.
|
|
2734
|
-
export type SessionViewHealth = "unavailable" | (string & {});
|
|
3023
|
+
/** 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. */
|
|
3024
|
+
export type SessionViewHealth = "unavailable" | "healthy" | (string & {});
|
|
2735
3025
|
|
|
2736
|
-
/** `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). */
|
|
3026
|
+
/** `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). */
|
|
2737
3027
|
export interface SessionViewHealthChangedParams {
|
|
2738
|
-
/** The new view-health state
|
|
3028
|
+
/** The new view-health state: `Unavailable`, or `Healthy` once the host re-loaded a failed view (#60870). */
|
|
2739
3029
|
health: SessionViewHealth;
|
|
2740
|
-
/** 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`
|
|
3030
|
+
/** 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. */
|
|
2741
3031
|
noneReason?: HistoryNoneReason;
|
|
2742
3032
|
/** The session whose live view health changed. */
|
|
2743
3033
|
sessionId: string;
|
|
@@ -2922,6 +3212,8 @@ export interface SnapshotState {
|
|
|
2922
3212
|
goal: Goal | null;
|
|
2923
3213
|
/** 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). */
|
|
2924
3214
|
items: Item[];
|
|
3215
|
+
/** 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. */
|
|
3216
|
+
monitorInbox?: MonitorInboxSnapshotEntry[];
|
|
2925
3217
|
/** 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. */
|
|
2926
3218
|
name?: string | null;
|
|
2927
3219
|
/** The pending-approval half of the pending set. */
|
|
@@ -3038,6 +3330,21 @@ export interface SubagentInputParams {
|
|
|
3038
3330
|
subagentId: string;
|
|
3039
3331
|
}
|
|
3040
3332
|
|
|
3333
|
+
/** `subagentInput.inputPhase` (#70249): the record the item stands for. Open: a client ignores an item whose phase it does not know. */
|
|
3334
|
+
export type SubagentInputPhase = "queued" | "delivered" | (string & {});
|
|
3335
|
+
|
|
3336
|
+
/** `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. */
|
|
3337
|
+
export interface SubagentListParams {
|
|
3338
|
+
/** The target session (the parent whose children to list). */
|
|
3339
|
+
sessionId: string;
|
|
3340
|
+
}
|
|
3341
|
+
|
|
3342
|
+
/** `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. */
|
|
3343
|
+
export interface SubagentListResult {
|
|
3344
|
+
/** The session's roster rows, ordered by `(agentPath, subagentId)`. */
|
|
3345
|
+
subagents: SubagentRosterEntry[];
|
|
3346
|
+
}
|
|
3347
|
+
|
|
3041
3348
|
/** 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. */
|
|
3042
3349
|
export interface SubagentOwnerReasonParams {
|
|
3043
3350
|
/** Client-minted UUIDv7 command id (SS3.1.1). */
|
|
@@ -3054,7 +3361,7 @@ export interface SubagentOwnerReasonParams {
|
|
|
3054
3361
|
export interface SubagentResult {
|
|
3055
3362
|
/** Artifact references, verbatim. */
|
|
3056
3363
|
artifactRefs: string[];
|
|
3057
|
-
/** `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. */
|
|
3364
|
+
/** `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). */
|
|
3058
3365
|
drained?: boolean;
|
|
3059
3366
|
/** Error kind, verbatim durable vocabulary, when the child failed. */
|
|
3060
3367
|
errorKind?: string;
|
|
@@ -3064,10 +3371,49 @@ export interface SubagentResult {
|
|
|
3064
3371
|
structuredData?: Record<string, unknown>;
|
|
3065
3372
|
/** Result summary, bounded on the wire at the 64 KiB retained-text budget (tdd SS4.5.4 and SS4.5.7, ADR 35691 D9); a cut sets the item's `truncated`. The durable record stays verbatim. */
|
|
3066
3373
|
summary: string;
|
|
3374
|
+
/** `true` once a newer attempt of the child started after this result (ADR 92325 D1): the result stays, and a client takes the child's status from `controlStatus`. Absent, it asserts nothing (a host before this member, or a fold state saved before it, never sets it); a newer result replaces the whole result, so it carries no mark. */
|
|
3375
|
+
superseded?: boolean;
|
|
3067
3376
|
/** Result text, when present, bounded on the wire at the same 64 KiB budget (ADR 35691 D9); a cut sets the item's `truncated`. */
|
|
3068
3377
|
text?: string;
|
|
3069
3378
|
}
|
|
3070
3379
|
|
|
3380
|
+
/** `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. */
|
|
3381
|
+
export type SubagentResultStatus = "completed" | "failed" | "cancelled" | (string & {});
|
|
3382
|
+
|
|
3383
|
+
/** 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`. */
|
|
3384
|
+
export interface SubagentRosterEntry {
|
|
3385
|
+
/** The agent definition path (`agent_path`), verbatim from the spawn. */
|
|
3386
|
+
agentPath: string;
|
|
3387
|
+
/** The child's own session id, readable via `session/read`/`view/page`. **Additive-optional**: absent until the child's start is attested. */
|
|
3388
|
+
childSessionId?: string;
|
|
3389
|
+
/** The child's control status: `Accepted` at spawn, then the latest `StatusUpdated` / `Closed` / `ResultReady` / `RecoveryAvailable` / `RecoveryDecision` (`Accepted | Starting | Running | ResultReady | Closing | Closed | RecoveryPending | ManualReconciliation`). */
|
|
3390
|
+
controlStatus: SubagentControlStatus;
|
|
3391
|
+
/** 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. */
|
|
3392
|
+
definitionName?: string;
|
|
3393
|
+
/** The spawn depth (1 = a root-session child). */
|
|
3394
|
+
depth: number;
|
|
3395
|
+
/** The child's observed wall-clock duration in ms, when the runtime observed one. **Additive-optional**: absent until first observation. */
|
|
3396
|
+
durationMs?: number;
|
|
3397
|
+
/** 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`. */
|
|
3398
|
+
name?: string;
|
|
3399
|
+
/** The spawn objective. **Additive-optional**: absent when the spawn carried none. */
|
|
3400
|
+
objective?: string;
|
|
3401
|
+
/** The parent row's `agentPath`. **Additive-optional**: absent whenever `parentSubagentId` is. */
|
|
3402
|
+
parentPath?: string;
|
|
3403
|
+
/** 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`. */
|
|
3404
|
+
parentSubagentId?: string;
|
|
3405
|
+
/** Whether the child's latest attempt's result is ready (a `ResultReady` for the latest admitted attempt seen). */
|
|
3406
|
+
resultReady: boolean;
|
|
3407
|
+
/** The spawn role. **Additive-optional**: absent when the spawn carried none. */
|
|
3408
|
+
role?: string;
|
|
3409
|
+
/** The durable child identity (`subagent_id`). Rows without one are not roster rows: a rejected spawn names no child. */
|
|
3410
|
+
subagentId: string;
|
|
3411
|
+
/** 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. */
|
|
3412
|
+
terminalReason?: string;
|
|
3413
|
+
/** The owning dynamic workflow run id, when the child was workflow-admitted. **Additive-optional**: absent for native spawns. */
|
|
3414
|
+
workflowRunId?: string;
|
|
3415
|
+
}
|
|
3416
|
+
|
|
3071
3417
|
/** Params for `subagent/resume`, `subagent/reopen`, and `subagent/readResult` (SS3.16): the bare child target. */
|
|
3072
3418
|
export interface SubagentTargetParams {
|
|
3073
3419
|
/** Client-minted UUIDv7 command id (SS3.1.1). */
|
|
@@ -3326,7 +3672,7 @@ export interface TurnError {
|
|
|
3326
3672
|
}
|
|
3327
3673
|
|
|
3328
3674
|
/** Turn failure classes (tdd SS4.5.1, `TerminalErrorKind` plus the model-task failure class). Open. */
|
|
3329
|
-
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | "mcpLinkError" | (string & {});
|
|
3675
|
+
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | "mcpLinkError" | "reasoningReplayRefused" | "contextOverflow" | (string & {});
|
|
3330
3676
|
|
|
3331
3677
|
/** `turn/foregroundCompleted` params (tdd SS4.5.12): the turn's foreground work is done and named background reminder checks hold the turn open. Explicitly non-terminal: the turn ends only at `turn/completed` / `turn/unqueued`. */
|
|
3332
3678
|
export interface TurnForegroundCompletedParams {
|
|
@@ -3391,6 +3737,18 @@ export interface TurnInterruptResult {
|
|
|
3391
3737
|
turnId: string;
|
|
3392
3738
|
}
|
|
3393
3739
|
|
|
3740
|
+
/** `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). */
|
|
3741
|
+
export interface TurnModelAttemptStartedParams {
|
|
3742
|
+
/** The owning session. */
|
|
3743
|
+
sessionId: string;
|
|
3744
|
+
/** The durable record this event folded from (the session stream's mirror of the model task's opening status; `first == last`). */
|
|
3745
|
+
sourceRange: SourceRange;
|
|
3746
|
+
/** The running turn whose model attempt is starting. */
|
|
3747
|
+
turnId: string;
|
|
3748
|
+
/** Opaque, strictly monotonic view cursor (tdd SS4.1). */
|
|
3749
|
+
viewCursor: string;
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3394
3752
|
/** `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). */
|
|
3395
3753
|
export interface TurnModelRetryScheduledParams {
|
|
3396
3754
|
/** The failed model attempt (producer-normalized, >= 1). */
|
|
@@ -4027,10 +4385,10 @@ export interface WorkflowTokenBudget {
|
|
|
4027
4385
|
}
|
|
4028
4386
|
|
|
4029
4387
|
/** Every wire method in this schema (SS1.9 index). */
|
|
4030
|
-
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";
|
|
4388
|
+
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";
|
|
4031
4389
|
/** Every wire notification in this schema (SS1.9 index). */
|
|
4032
|
-
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";
|
|
4390
|
+
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";
|
|
4033
4391
|
/** Every server-initiated wire request in this schema (SS5.3/SS5.10.1 index). */
|
|
4034
4392
|
export type MspServerRequest = "approval/request" | "userInput/request";
|
|
4035
4393
|
/** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */
|
|
4036
|
-
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";
|
|
4394
|
+
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";
|