@muse-code/sdk 1.4.4 → 1.4.6
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/dist/src/errors.d.ts +17 -0
- package/dist/src/errors.js +25 -0
- package/dist/src/facade/approval.js +34 -2
- package/dist/src/facade/client.d.ts +11 -1
- package/dist/src/facade/client.js +64 -2
- package/dist/src/facade/turn-submit.js +4 -0
- package/dist/src/fingerprint.d.ts +1 -1
- package/dist/src/fingerprint.js +1 -1
- package/dist/src/fold/session-fold.d.ts +2 -2
- package/dist/src/fold/session-fold.js +5 -2
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.js +1 -1
- package/dist/src/msp.d.ts +404 -17
- package/package.json +1 -1
package/dist/src/errors.d.ts
CHANGED
|
@@ -52,3 +52,20 @@ export declare class MuseGapFillError extends Error {
|
|
|
52
52
|
readonly next: string;
|
|
53
53
|
constructor(reason: GapFillFailureReason, after: string, next: string, cause?: unknown);
|
|
54
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* A required session-start permission-profile selection the client could not
|
|
57
|
+
* prove applied (TEST-42624-10, amendment 42624 § Compatibility): the start
|
|
58
|
+
* result carried no `permissionState`, and the `session/read` read-back
|
|
59
|
+
* served a different profile — or none at all. Never a silent default: the
|
|
60
|
+
* session stays open and the caller decides (set/retry or close) via
|
|
61
|
+
* `sessionId`, with no auto-close and no auto-set.
|
|
62
|
+
*/
|
|
63
|
+
export declare class PermissionProfileNotApplied extends Error {
|
|
64
|
+
/** The profile id the caller required. */
|
|
65
|
+
readonly requested: string;
|
|
66
|
+
/** The committed profile id the read-back served, or null when unknown. */
|
|
67
|
+
readonly served: string | null;
|
|
68
|
+
/** The open session, so the caller can set, retry, or close it. */
|
|
69
|
+
readonly sessionId: string;
|
|
70
|
+
constructor(requested: string, served: string | null, sessionId: string);
|
|
71
|
+
}
|
package/dist/src/errors.js
CHANGED
|
@@ -49,3 +49,28 @@ export class MuseGapFillError extends Error {
|
|
|
49
49
|
this.next = next;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* A required session-start permission-profile selection the client could not
|
|
54
|
+
* prove applied (TEST-42624-10, amendment 42624 § Compatibility): the start
|
|
55
|
+
* result carried no `permissionState`, and the `session/read` read-back
|
|
56
|
+
* served a different profile — or none at all. Never a silent default: the
|
|
57
|
+
* session stays open and the caller decides (set/retry or close) via
|
|
58
|
+
* `sessionId`, with no auto-close and no auto-set.
|
|
59
|
+
*/
|
|
60
|
+
export class PermissionProfileNotApplied extends Error {
|
|
61
|
+
/** The profile id the caller required. */
|
|
62
|
+
requested;
|
|
63
|
+
/** The committed profile id the read-back served, or null when unknown. */
|
|
64
|
+
served;
|
|
65
|
+
/** The open session, so the caller can set, retry, or close it. */
|
|
66
|
+
sessionId;
|
|
67
|
+
constructor(requested, served, sessionId) {
|
|
68
|
+
super(`required permissionProfile ${JSON.stringify(requested)} was not applied:` +
|
|
69
|
+
` the committed selection is ${served === null ? "unknown" : JSON.stringify(served)}` +
|
|
70
|
+
` (session ${sessionId})`);
|
|
71
|
+
this.name = "PermissionProfileNotApplied";
|
|
72
|
+
this.requested = requested;
|
|
73
|
+
this.served = served;
|
|
74
|
+
this.sessionId = sessionId;
|
|
75
|
+
}
|
|
76
|
+
}
|
|
@@ -80,6 +80,15 @@ export class ApprovalRouter {
|
|
|
80
80
|
* with a frontier the host already closed, right before `approval/resolved`.
|
|
81
81
|
*/
|
|
82
82
|
#terminalApprovals = new Set();
|
|
83
|
+
/**
|
|
84
|
+
* The most recently sent decide each approval has on the wire, settled when
|
|
85
|
+
* its ack lands or the decide fails. A trailing `stageResolved` update read
|
|
86
|
+
* in the SAME chunk as a `terminal: true` ack is routed before
|
|
87
|
+
* {@link #decide} resumes from that ack, so {@link updated} waits for it
|
|
88
|
+
* instead of re-asking. Scoped to the round trip: an open handler or a
|
|
89
|
+
* decide that never started blocks nobody.
|
|
90
|
+
*/
|
|
91
|
+
#inFlight = new Map();
|
|
83
92
|
constructor(sessionId, connection) {
|
|
84
93
|
this.#sessionId = sessionId;
|
|
85
94
|
this.#connection = connection;
|
|
@@ -171,8 +180,18 @@ export class ApprovalRouter {
|
|
|
171
180
|
// parent's own approvals by contract (#36182 `skip_serializing_if`).
|
|
172
181
|
if (params.subagentOrigin !== undefined)
|
|
173
182
|
refreshed.subagentOrigin = params.subagentOrigin;
|
|
183
|
+
const acked = this.#inFlight.get(requested.approvalId);
|
|
184
|
+
if (acked !== undefined)
|
|
185
|
+
return this.#afterAck(acked, refreshed);
|
|
174
186
|
return this.requested(refreshed);
|
|
175
187
|
}
|
|
188
|
+
/** {@link updated}'s same-chunk arm: decide only once our own ack is in. */
|
|
189
|
+
async #afterAck(acked, refreshed) {
|
|
190
|
+
await acked;
|
|
191
|
+
if (this.#terminalApprovals.has(refreshed.approvalId))
|
|
192
|
+
return;
|
|
193
|
+
await this.requested(refreshed);
|
|
194
|
+
}
|
|
176
195
|
static #stageKey(params) {
|
|
177
196
|
const requirement = params.currentRequirementId;
|
|
178
197
|
return `${params.approvalId} ${requirement.approvalId}:${String(requirement.sourceIndex)}`;
|
|
@@ -231,6 +250,14 @@ export class ApprovalRouter {
|
|
|
231
250
|
// a plain-JS caller would be rejected by the host.
|
|
232
251
|
if (decision.feedback != null)
|
|
233
252
|
decideParams.feedback = decision.feedback;
|
|
253
|
+
// The wait covers only this round trip: an update for this approval read
|
|
254
|
+
// before the ack lands waits for it (see `#inFlight`).
|
|
255
|
+
const approvalId = params.approvalId;
|
|
256
|
+
let settle;
|
|
257
|
+
const acked = new Promise((resolve) => {
|
|
258
|
+
settle = resolve;
|
|
259
|
+
});
|
|
260
|
+
this.#inFlight.set(approvalId, acked);
|
|
234
261
|
try {
|
|
235
262
|
// No explicit `commandId`: unlike `sendUserTurn`, nothing here needs the
|
|
236
263
|
// id before the ack, so `Connection.command()` mints and stamps it — and
|
|
@@ -239,10 +266,15 @@ export class ApprovalRouter {
|
|
|
239
266
|
// A `terminal: true` ack closed the WHOLE approval; remember it so the
|
|
240
267
|
// trailing stale-frontier update #37538 permits cannot re-prompt.
|
|
241
268
|
if (ack["terminal"] === true)
|
|
242
|
-
this.#terminalApprovals.add(
|
|
269
|
+
this.#terminalApprovals.add(approvalId);
|
|
243
270
|
}
|
|
244
271
|
catch (error) {
|
|
245
|
-
this.#report({ approvalId
|
|
272
|
+
this.#report({ approvalId, error, kind: "submitFailed" });
|
|
273
|
+
}
|
|
274
|
+
finally {
|
|
275
|
+
settle();
|
|
276
|
+
if (this.#inFlight.get(approvalId) === acked)
|
|
277
|
+
this.#inFlight.delete(approvalId);
|
|
246
278
|
}
|
|
247
279
|
}
|
|
248
280
|
#report(failure) {
|
|
@@ -46,7 +46,17 @@ import type { InitializeParams, InitializeResult, SessionResumeParams, SessionSt
|
|
|
46
46
|
* `config` is excluded as well as `commandId` until the facade implements the
|
|
47
47
|
* required `sessionMcp` grant check and forwarding.
|
|
48
48
|
*/
|
|
49
|
-
export type StartSessionOptions = Readonly<Omit<SessionStartParams, "commandId" | "config"
|
|
49
|
+
export type StartSessionOptions = Readonly<Omit<SessionStartParams, "commandId" | "config"> & {
|
|
50
|
+
/**
|
|
51
|
+
* Require the `permissionProfile` selection (TEST-42624-10): when set,
|
|
52
|
+
* the client proves the committed selection equals the requested id —
|
|
53
|
+
* from the start result's `session.permissionState`, else a
|
|
54
|
+
* `session/read` read-back — and throws `PermissionProfileNotApplied`
|
|
55
|
+
* instead of proceeding on the host default. Client-local: never sent
|
|
56
|
+
* on the wire. Setting it without `permissionProfile` is a usage error.
|
|
57
|
+
*/
|
|
58
|
+
requirePermissionProfile?: boolean;
|
|
59
|
+
}>;
|
|
50
60
|
/** Caller-facing options for `session/resume` (tdd SS2.5.2). */
|
|
51
61
|
export type ResumeSessionOptions = Readonly<Omit<SessionResumeParams, "commandId" | "config">>;
|
|
52
62
|
/**
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
* it is forwarded (or explicitly allow-listed as unforwardable).
|
|
37
37
|
*/
|
|
38
38
|
import { initializeAnswered, spawnMspConnection } from "../connection/spawn.js";
|
|
39
|
-
import { MuseSessionDiscardedError } from "../errors.js";
|
|
39
|
+
import { MuseSessionDiscardedError, PermissionProfileNotApplied } from "../errors.js";
|
|
40
40
|
import { DiscardedSessions } from "./discarded.js";
|
|
41
41
|
import { isAbnormalHostDeath, readSessionDurability } from "./host-death.js";
|
|
42
42
|
import { MspError, ProtocolError } from "../connection/connection.js";
|
|
@@ -54,12 +54,29 @@ const START_FORWARDED = [
|
|
|
54
54
|
"workspaceRoot",
|
|
55
55
|
"workspaceRoots",
|
|
56
56
|
"modelId",
|
|
57
|
+
"permissionProfile",
|
|
57
58
|
];
|
|
58
59
|
/**
|
|
59
60
|
* Every `ResumeParams` member `resumeSession` forwards. `config` has the same
|
|
60
61
|
* temporary capability-check boundary as the start facade above.
|
|
61
62
|
*/
|
|
62
63
|
const RESUME_FORWARDED = ["sessionId", "cursor", "excludeItems", "history"];
|
|
64
|
+
/**
|
|
65
|
+
* The committed profile id a session snapshot claims, or null when the
|
|
66
|
+
* snapshot is silent (the stable bundle strips the member; absent and null
|
|
67
|
+
* both mean unknown, never applied). Structural on purpose: the stable
|
|
68
|
+
* `Session` type carries no `permissionState`, and an unknown wire shape
|
|
69
|
+
* must read as unknown rather than throw.
|
|
70
|
+
*/
|
|
71
|
+
function committedProfileId(snapshot) {
|
|
72
|
+
if (typeof snapshot !== "object" || snapshot === null)
|
|
73
|
+
return null;
|
|
74
|
+
const state = snapshot.permissionState;
|
|
75
|
+
if (typeof state !== "object" || state === null)
|
|
76
|
+
return null;
|
|
77
|
+
const id = state.profileId;
|
|
78
|
+
return typeof id === "string" ? id : null;
|
|
79
|
+
}
|
|
63
80
|
/**
|
|
64
81
|
* Your entry point to the SDK.
|
|
65
82
|
*
|
|
@@ -252,13 +269,58 @@ export class MuseClient {
|
|
|
252
269
|
params.workspaceRoots = options.workspaceRoots;
|
|
253
270
|
if (options.modelId != null)
|
|
254
271
|
params.modelId = options.modelId;
|
|
272
|
+
// The initial permission-profile selection, forwarded verbatim like the
|
|
273
|
+
// other start members (undefined stays omitted).
|
|
274
|
+
if (options.permissionProfile != null)
|
|
275
|
+
params.permissionProfile = options.permissionProfile;
|
|
276
|
+
// TEST-42624-10: a caller that requires its selection proves it, never
|
|
277
|
+
// assuming the host default. The flag without the member is API misuse
|
|
278
|
+
// (plain Error, like the other misuse guards here), raised pre-wire.
|
|
279
|
+
const required = options.requirePermissionProfile === true;
|
|
280
|
+
if (required && options.permissionProfile == null) {
|
|
281
|
+
throw new Error("requirePermissionProfile needs permissionProfile: require the selection you pass");
|
|
282
|
+
}
|
|
255
283
|
// Keyed by the id the SERVER named, never the one the caller asked for:
|
|
256
284
|
// `sessionId` is a REQUEST on start, and a session keyed by a hopeful id
|
|
257
285
|
// would reject every one of its own events as foreign.
|
|
258
|
-
|
|
286
|
+
const session = await this.#open("session/start", params, (raw) => ({
|
|
259
287
|
result: raw,
|
|
260
288
|
verb: "session/start",
|
|
261
289
|
}));
|
|
290
|
+
if (!required)
|
|
291
|
+
return session;
|
|
292
|
+
return this.#proveSelection(session, options.permissionProfile);
|
|
293
|
+
}
|
|
294
|
+
/**
|
|
295
|
+
* Prove a required start selection (TEST-42624-10): the start result's own
|
|
296
|
+
* `session.permissionState` first (absent = unknown, never applied); else a
|
|
297
|
+
* point-in-time `session/read`, which never subscribes. Only `profileId ==
|
|
298
|
+
* requested` proceeds; anything else throws `PermissionProfileNotApplied`
|
|
299
|
+
* BEFORE any turn is sent. The refused session is dropped from the client
|
|
300
|
+
* (no orphan keeps folding for an id the caller can never reach — the SDK
|
|
301
|
+
* has no set/close-by-id verb); the error's `sessionId` is the caller's
|
|
302
|
+
* handle to resume via `sessionId` or start again. A failed read-back
|
|
303
|
+
* propagates: the client still never proceeds on the default.
|
|
304
|
+
*/
|
|
305
|
+
async #proveSelection(session, requested) {
|
|
306
|
+
const opening = session.opening;
|
|
307
|
+
const started = opening !== undefined && opening.verb === "session/start"
|
|
308
|
+
? committedProfileId(opening.result.session)
|
|
309
|
+
: null;
|
|
310
|
+
if (started !== null) {
|
|
311
|
+
if (started === requested)
|
|
312
|
+
return session;
|
|
313
|
+
this.#sessions.delete(session);
|
|
314
|
+
throw new PermissionProfileNotApplied(requested, started, session.sessionId);
|
|
315
|
+
}
|
|
316
|
+
const read = await this.#connection.command("session/read", {
|
|
317
|
+
sessionId: session.sessionId,
|
|
318
|
+
});
|
|
319
|
+
const served = committedProfileId(read["session"]);
|
|
320
|
+
if (served === requested)
|
|
321
|
+
return session;
|
|
322
|
+
this.#sessions.delete(session);
|
|
323
|
+
throw new PermissionProfileNotApplied(requested, served, session.sessionId);
|
|
262
324
|
}
|
|
263
325
|
/**
|
|
264
326
|
* Load an existing session and subscribe this connection to its view
|
|
@@ -26,6 +26,8 @@ const TURN_START_FORWARDED = [
|
|
|
26
26
|
// No "tokenBudget" (#45454): experimental-gated, and this SDK serves the
|
|
27
27
|
// stable surface only.
|
|
28
28
|
"workspaceRoots",
|
|
29
|
+
// v1 stable member, forwarded like any other.
|
|
30
|
+
"userShell",
|
|
29
31
|
];
|
|
30
32
|
/**
|
|
31
33
|
* An `MspError` as the pending set reads it (SS4.13's settlement test).
|
|
@@ -174,6 +176,8 @@ export class TurnSubmitter {
|
|
|
174
176
|
// No tokenBudget forward (#45454): experimental-gated, stable SDK omits it.
|
|
175
177
|
if (options.workspaceRoots != null)
|
|
176
178
|
params.workspaceRoots = options.workspaceRoots;
|
|
179
|
+
if (options.userShell != null)
|
|
180
|
+
params.userShell = options.userShell;
|
|
177
181
|
return params;
|
|
178
182
|
}
|
|
179
183
|
}
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* (tdd SS1.4.1) — additive-optional evolution means an older SDK keeps
|
|
14
14
|
* working against a newer host.
|
|
15
15
|
*/
|
|
16
|
-
export declare const EXPECTED_SCHEMA_FINGERPRINT = "sha256:
|
|
16
|
+
export declare const EXPECTED_SCHEMA_FINGERPRINT = "sha256:eae467ab60cb9a5d5af4de616830f065e59375c987fd59269c8cc33ed2a1137f";
|
|
17
17
|
/**
|
|
18
18
|
* What a build-time mismatch MEANS, in the words a human needs at 2am.
|
|
19
19
|
*
|
package/dist/src/fingerprint.js
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
* (tdd SS1.4.1) — additive-optional evolution means an older SDK keeps
|
|
14
14
|
* working against a newer host.
|
|
15
15
|
*/
|
|
16
|
-
export const EXPECTED_SCHEMA_FINGERPRINT = "sha256:
|
|
16
|
+
export const EXPECTED_SCHEMA_FINGERPRINT = "sha256:eae467ab60cb9a5d5af4de616830f065e59375c987fd59269c8cc33ed2a1137f";
|
|
17
17
|
/**
|
|
18
18
|
* What a build-time mismatch MEANS, in the words a human needs at 2am.
|
|
19
19
|
*
|
|
@@ -170,9 +170,9 @@ export type ViewEvent = {
|
|
|
170
170
|
* client's notification callback rather than this fold.
|
|
171
171
|
*/
|
|
172
172
|
type AssertNever<T extends never> = T;
|
|
173
|
-
type LiveHostStateProjection = "skill/changed" | "usage/changed" | "session/statusChanged" | "session/listChanged";
|
|
173
|
+
type LiveHostStateProjection = "skill/changed" | "usage/changed" | "session/statusChanged" | "session/listChanged" | "plugin/changed" | "plugin/marketplaceChanged" | "computerUseSetup/changed";
|
|
174
174
|
type SessionLifecycleBroadcast = "session/started" | "session/closed";
|
|
175
|
-
type NonFoldNotification = "initialized" | "userInput/engaged" | "session/viewHealthChanged" | SessionLifecycleBroadcast | LiveHostStateProjection;
|
|
175
|
+
type NonFoldNotification = "initialized" | "userInput/engaged" | "session/viewHealthChanged" | "recap/completed" | SessionLifecycleBroadcast | LiveHostStateProjection;
|
|
176
176
|
type UnfoldedViewNotification = Exclude<MspNotification, NonFoldNotification | ViewEvent["method"]>;
|
|
177
177
|
export type EveryViewNotificationIsFolded = AssertNever<UnfoldedViewNotification>;
|
|
178
178
|
/**
|
|
@@ -278,8 +278,11 @@ export class SessionFold {
|
|
|
278
278
|
const turn = this.#turnFor(params.turnId);
|
|
279
279
|
turn.commandId = params.commandId;
|
|
280
280
|
// A retract is NOT a `TurnTerminal`; leaving `terminal` unset is the whole
|
|
281
|
-
// point (INV-006).
|
|
282
|
-
// with `retracted: true`, which the item half folds
|
|
281
|
+
// point (INV-006). On accepted, the retracted user message re-arrives via
|
|
282
|
+
// `item/updated` with `retracted: true`, which the item half folds
|
|
283
|
+
// (a declined outcome also lands here for now: the entry reads retracted
|
|
284
|
+
// and the later turn/completed arrives as a stale frame, so its terminal
|
|
285
|
+
// is dropped too - a known gap in this fold, behavior unchanged).
|
|
283
286
|
turn.state = "retracted";
|
|
284
287
|
this.#clearActive(params.turnId);
|
|
285
288
|
return { kind: "turn", turnId: params.turnId, state: turn.state };
|
package/dist/src/index.d.ts
CHANGED
|
@@ -50,7 +50,7 @@ export { MuseClient } from "./facade/client.js";
|
|
|
50
50
|
export type { MuseClientOptions, MuseClientSpawnOptions, ResumeSessionOptions, StartSessionOptions, } from "./facade/client.js";
|
|
51
51
|
export type { ExitClassification, MuseServeChildOptions, ProcessExit, SpawnMspConnectionOptions, } from "./connection/spawn.js";
|
|
52
52
|
export { DiscardedSessions } from "./facade/discarded.js";
|
|
53
|
-
export { MuseForeignSessionError, MuseGapFillError, MuseSessionDiscardedError, } from "./errors.js";
|
|
53
|
+
export { MuseForeignSessionError, MuseGapFillError, MuseSessionDiscardedError, PermissionProfileNotApplied, } from "./errors.js";
|
|
54
54
|
export type { GapFillFailureReason } from "./errors.js";
|
|
55
55
|
export type { GapFillFailureHandler } from "./facade/gap-fill.js";
|
|
56
56
|
export { MuseHostDiedError, readSessionDurability } from "./facade/host-death.js";
|
package/dist/src/index.js
CHANGED
|
@@ -40,7 +40,7 @@ export { MuseClient } from "./facade/client.js";
|
|
|
40
40
|
// none — the cross-client sharing knob was declined (Constitution XI; see the
|
|
41
41
|
// constructor note in `facade/client.ts`).
|
|
42
42
|
export { DiscardedSessions } from "./facade/discarded.js";
|
|
43
|
-
export { MuseForeignSessionError, MuseGapFillError, MuseSessionDiscardedError, } from "./errors.js";
|
|
43
|
+
export { MuseForeignSessionError, MuseGapFillError, MuseSessionDiscardedError, PermissionProfileNotApplied, } from "./errors.js";
|
|
44
44
|
// Trimmed deliberately (Constitution XI): `isAbnormalHostDeath`,
|
|
45
45
|
// `isItemInProgress`, and `survivesHostDeath` are `Session`'s own internals
|
|
46
46
|
// with no consumer, and a barrel export would freeze them into `@muse-code/sdk`'s
|
package/dist/src/msp.d.ts
CHANGED
|
@@ -245,7 +245,7 @@ export interface BranchState {
|
|
|
245
245
|
}
|
|
246
246
|
|
|
247
247
|
/** A grantable capability name (SS1.4.4). Open: the reserved `rawLog` entry joins this domain as an additive open-enum extension when SS6 un-defers (#13929, Scenario 5 AS-3) — closed would make that a retype. */
|
|
248
|
-
export type CapabilityName = "userShell" | "sessionMcp" | "sessionListStream" | "feedback" | (string & {});
|
|
248
|
+
export type CapabilityName = "userShell" | "sessionMcp" | "sessionListStream" | "feedback" | "computerUseSetup" | (string & {});
|
|
249
249
|
|
|
250
250
|
/** The client's requested capability posture (SS1.4.1). Every member defaults; an absent `capabilities` object means all defaults. */
|
|
251
251
|
export interface ClientCapabilities {
|
|
@@ -333,6 +333,9 @@ export interface ComputerUseBlockedApp {
|
|
|
333
333
|
/** A capability dropdown's value (ADR 630 D18.4). **Open**: the read result carries it, so an older client tolerates a value it does not know. */
|
|
334
334
|
export type ComputerUseChoice = "ask" | "alwaysAllow" | (string & {});
|
|
335
335
|
|
|
336
|
+
/** One macOS permission as setup last saw it. **Open**, like the phase. */
|
|
337
|
+
export type ComputerUsePermission = "granted" | "missing" | "unknown" | (string & {});
|
|
338
|
+
|
|
336
339
|
/** `computerUseSettings/read` result, also answered by `computerUseSettings/update`. */
|
|
337
340
|
export interface ComputerUseSettings {
|
|
338
341
|
/** The user's blocks in the order they were added, then the built-in blocks when `showBuiltIns` asked for them. */
|
|
@@ -361,6 +364,47 @@ export interface ComputerUseSettingsUpdateParams {
|
|
|
361
364
|
unblockApps?: string[];
|
|
362
365
|
}
|
|
363
366
|
|
|
367
|
+
/** `computerUseSetup/changed` params. */
|
|
368
|
+
export interface ComputerUseSetupChanged {
|
|
369
|
+
/** The session whose setup state changed. */
|
|
370
|
+
sessionId: string;
|
|
371
|
+
/** Its new state. */
|
|
372
|
+
state: ComputerUseSetupState;
|
|
373
|
+
}
|
|
374
|
+
|
|
375
|
+
/** Where the session's setup stands: `cua_setup`'s state codes, camelCase. **Open**: a result vocabulary, so an older client tolerates a new state. */
|
|
376
|
+
export type ComputerUseSetupPhase = "dormant" | "inProgress" | "restartRequired" | "readyForTarget" | "stopped" | (string & {});
|
|
377
|
+
|
|
378
|
+
/** `computerUseSetup/read` params. */
|
|
379
|
+
export interface ComputerUseSetupReadParams {
|
|
380
|
+
/** The session whose setup to read. */
|
|
381
|
+
sessionId: string;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
/** `computerUseSetup/start` params: a human command. */
|
|
385
|
+
export interface ComputerUseSetupStartParams {
|
|
386
|
+
/** The client's id for this command. */
|
|
387
|
+
commandId: string;
|
|
388
|
+
/** The session whose setup to start. */
|
|
389
|
+
sessionId: string;
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
/** The session's setup state: the result of both methods and the `computerUseSetup/changed` payload's `state`. */
|
|
393
|
+
export interface ComputerUseSetupState {
|
|
394
|
+
/** Accessibility. */
|
|
395
|
+
accessibility: ComputerUsePermission;
|
|
396
|
+
/** Input Monitoring: computer use is ready without it; some actions need it. */
|
|
397
|
+
inputMonitoring: ComputerUsePermission;
|
|
398
|
+
/** The sentence `cua_setup` gives the user for this answer. */
|
|
399
|
+
message?: string;
|
|
400
|
+
/** The `cua_setup` refusal code when the call was refused, verbatim. */
|
|
401
|
+
refused?: string;
|
|
402
|
+
/** Screen Recording. */
|
|
403
|
+
screenRecording: ComputerUsePermission;
|
|
404
|
+
/** Where setup stands. */
|
|
405
|
+
setup: ComputerUseSetupPhase;
|
|
406
|
+
}
|
|
407
|
+
|
|
364
408
|
/** Context pressure level (tdd SS4.6.6): hard threshold first, both inclusive `>=`. Open. */
|
|
365
409
|
export type ContextPressureLevel = "normal" | "warning" | "blocked" | (string & {});
|
|
366
410
|
|
|
@@ -472,6 +516,10 @@ export interface ErrorData {
|
|
|
472
516
|
latestBoundaryCursor?: string | null;
|
|
473
517
|
/** The exceeded byte limit, on `inputTooLarge` errors. */
|
|
474
518
|
limitBytes?: number;
|
|
519
|
+
/** The store on `pluginNotFound` (`-32035`, SS3.29.1). */
|
|
520
|
+
marketplace?: string;
|
|
521
|
+
/** The rejected marketplace name on `marketplaceNotFound` (`-32034`, SS3.29.7) and `marketplaceAlreadyExists` (`-32036`, SS3.29.2); the rejected plugin name on `pluginNotFound` (`-32035`, SS3.29.1). */
|
|
522
|
+
name?: string;
|
|
475
523
|
/** The requested `outputRef.id`, on the same `item/readOutput` arms. */
|
|
476
524
|
outputRef?: string;
|
|
477
525
|
/** Candidate retained paths on `sessionAmbiguous`. */
|
|
@@ -482,6 +530,10 @@ export interface ErrorData {
|
|
|
482
530
|
resolution?: ApprovalResolutionSummary;
|
|
483
531
|
/** Whether retrying can succeed (e.g. `overloaded`). When present, overrides the error table row's `retryable` default for this code. */
|
|
484
532
|
retryable?: boolean;
|
|
533
|
+
/** Why the branch seed did not use a checkpoint, on the same arms: one of `no_usable_checkpoint`, `unsupported_checkpoint_shape`, `checkpoint_has_model_visible_tail`, `checkpoint_missing_suffix`; absent when the seed used a checkpoint or no fallback was recorded. */
|
|
534
|
+
seedFallbackReason?: string;
|
|
535
|
+
/** The branch-seed path the host read before rejecting, on branch-validation rejections (`session/fork`, `session/sideChat`: the `forkBoundaryInvalid`, `commandRejected` and `sessionNotFound` arms; SS2.5.3, SS2.5.7; #51365): one of `runtime_checkpoint_tail`, `runtime_full_replay`, `legacy_session_data` — the durable branch-seed vocabulary, so the client cites the real seed decision instead of guessing at a stale binary. */
|
|
536
|
+
seedPath?: string;
|
|
485
537
|
/** The rejected skill selector on `skillNotFound` (`-32032`, SS3.22.4). */
|
|
486
538
|
selector?: string;
|
|
487
539
|
/** Session identity on errors whose lookup is session-scoped. */
|
|
@@ -497,7 +549,7 @@ export interface ErrorData {
|
|
|
497
549
|
}
|
|
498
550
|
|
|
499
551
|
/** A stable `error.data.kind` category (SS1.6): camelCase, the value clients branch on. Open: SS2–SS5 lanes add kinds additively as their methods land (Appendix B already registers them), and the spec's edge-case rule makes a new `kind` additive only because this domain is declared open. */
|
|
500
|
-
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" | "uploadNotFound" | "viewTruncated" | "outputUnavailable" | "boundaryPruned" | "boundaryUnusable" | "noBoundary" | "approvalNotFound" | "approvalAlreadyResolved" | "approvalChoiceInvalid" | "approvalRequirementStale" | "approvalReviewerUnavailable" | "userInputNotFound" | "userInputAlreadySettled" | "userInputAnswerInvalid" | (string & {});
|
|
552
|
+
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 & {});
|
|
501
553
|
|
|
502
554
|
/** The `error` member of an error response (SS1.2 §2.4). */
|
|
503
555
|
export interface ErrorObject {
|
|
@@ -916,8 +968,8 @@ export interface ItemDeltaParams {
|
|
|
916
968
|
viewCursor: string;
|
|
917
969
|
}
|
|
918
970
|
|
|
919
|
-
/** The eleven v1 item kinds (tdd SS4.5.2–4.5.13). Open: a new kind is additive evolution, and clients MUST render unknown kinds generically (tdd SS4.10). */
|
|
920
|
-
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | (string & {});
|
|
971
|
+
/** 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). */
|
|
972
|
+
export type ItemKind = "userMessage" | "agentMessage" | "reasoning" | "toolCall" | "userShell" | "subagent" | "workflow" | "reminderChild" | "compaction" | "hookRun" | "sideChat" | "webSearch" | (string & {});
|
|
921
973
|
|
|
922
974
|
/** 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. */
|
|
923
975
|
export type ItemReadOutputEncoding = "utf8" | "base64";
|
|
@@ -994,6 +1046,9 @@ export interface LastTurn {
|
|
|
994
1046
|
turnId: string;
|
|
995
1047
|
}
|
|
996
1048
|
|
|
1049
|
+
/** Quota limit kinds (tdd SS4.5.1, ADR 50047 D2): open for evolution. */
|
|
1050
|
+
export type LimitKind = "tierLimit" | (string & {});
|
|
1051
|
+
|
|
997
1052
|
/** `media/upload` params (tdd SS3.33, ADR 45443 D5): one chunk of a client-minted upload. All members required. */
|
|
998
1053
|
export interface MediaUploadParams {
|
|
999
1054
|
/** This chunk's bytes; each call's frame stays in the SS1.1 budget. */
|
|
@@ -1239,6 +1294,75 @@ export interface PluginCatalogEntry {
|
|
|
1239
1294
|
version: string;
|
|
1240
1295
|
}
|
|
1241
1296
|
|
|
1297
|
+
/** `plugin/changed` params (tdd SS3.29.5): an install landed; clients re-issue `plugin/list` (plus `hook/list` and `skill/list`). */
|
|
1298
|
+
export interface PluginChangedParams {
|
|
1299
|
+
/** The installed record's own switch. */
|
|
1300
|
+
enabled: boolean;
|
|
1301
|
+
/** The installed record's identifier. */
|
|
1302
|
+
id: string;
|
|
1303
|
+
/** The acting session. */
|
|
1304
|
+
sessionId: string;
|
|
1305
|
+
/** The installed-list provenance vocabulary (tdd SS3.26.2). */
|
|
1306
|
+
source: PluginSource;
|
|
1307
|
+
/** The installed record's version. */
|
|
1308
|
+
version: string;
|
|
1309
|
+
}
|
|
1310
|
+
|
|
1311
|
+
/** The `plugin/install` local-path arm (tdd SS3.29.1). */
|
|
1312
|
+
export interface PluginInstallLocalPathTarget {
|
|
1313
|
+
/** The host folder to install from; absolute recommended, relative resolves against the host working directory. */
|
|
1314
|
+
path: string;
|
|
1315
|
+
/** The install lane; omitted means `default`. */
|
|
1316
|
+
scope?: PluginInstallScope;
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
/** The `plugin/install` marketplace arm (tdd SS3.29.1). */
|
|
1320
|
+
export interface PluginInstallMarketplaceTarget {
|
|
1321
|
+
/** The configured marketplace name. */
|
|
1322
|
+
marketplace: string;
|
|
1323
|
+
/** The plugin name within the store. */
|
|
1324
|
+
name: string;
|
|
1325
|
+
}
|
|
1326
|
+
|
|
1327
|
+
/** `plugin/install` params (tdd SS3.29.1). Per-session params plus a client-generated `commandId` (UUIDv7) with the uniform SS3.1.1 idempotency contract. */
|
|
1328
|
+
export interface PluginInstallParams {
|
|
1329
|
+
/** The client-generated idempotency key (UUIDv7). */
|
|
1330
|
+
commandId: string;
|
|
1331
|
+
/** The target session; its workspace resolves project scope. */
|
|
1332
|
+
sessionId: string;
|
|
1333
|
+
/** Exactly one install target arm. */
|
|
1334
|
+
target: PluginInstallTarget;
|
|
1335
|
+
}
|
|
1336
|
+
|
|
1337
|
+
/** `plugin/install` result (tdd SS3.29.1): the SS3.1.2 ack envelope plus the installed receipt. */
|
|
1338
|
+
export interface PluginInstallResult {
|
|
1339
|
+
/** The echoed idempotency key. */
|
|
1340
|
+
commandId: string;
|
|
1341
|
+
/** The installed record's own switch. */
|
|
1342
|
+
enabled: boolean;
|
|
1343
|
+
/** The installed record's identifier. */
|
|
1344
|
+
id: string;
|
|
1345
|
+
/** The installed-list provenance vocabulary (tdd SS3.26.2). */
|
|
1346
|
+
source: PluginSource;
|
|
1347
|
+
/** The ack status. */
|
|
1348
|
+
status: CommandStatus;
|
|
1349
|
+
/** The installed record's version. */
|
|
1350
|
+
version: string;
|
|
1351
|
+
/** The installer's advisory text when the install succeeded with a caveat; absent otherwise. */
|
|
1352
|
+
warning?: string;
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
/** The `plugin/install` local-path scope (tdd SS3.29.1). Closed: an unknown scope is `-32602 invalidParams`. */
|
|
1356
|
+
export type PluginInstallScope = "default" | "user" | "project";
|
|
1357
|
+
|
|
1358
|
+
/** The one structured install target (tdd SS3.29.1): a flat object with two optional arms, exactly one present — the `TurnInputPart` convention, since the v1 schema model names no object-variant union. Both arms or neither is `-32602 invalidParams`. */
|
|
1359
|
+
export interface PluginInstallTarget {
|
|
1360
|
+
/** The local-path arm: install from a host folder. */
|
|
1361
|
+
localPath?: PluginInstallLocalPathTarget;
|
|
1362
|
+
/** The marketplace arm: install a named plugin from a store. */
|
|
1363
|
+
marketplace?: PluginInstallMarketplaceTarget;
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1242
1366
|
/** `plugin/list` params (tdd SS3.26.2). Per-session params; rows are the installed plugin records. */
|
|
1243
1367
|
export interface PluginListParams {
|
|
1244
1368
|
/** The target session. */
|
|
@@ -1251,9 +1375,108 @@ export interface PluginListResult {
|
|
|
1251
1375
|
plugins: PluginCatalogEntry[];
|
|
1252
1376
|
}
|
|
1253
1377
|
|
|
1378
|
+
/** `plugin/marketplaceAdd` params (tdd SS3.29.2). Per-session params plus a client-generated `commandId` (UUIDv7). */
|
|
1379
|
+
export interface PluginMarketplaceAddParams {
|
|
1380
|
+
/** The client-generated idempotency key (UUIDv7). */
|
|
1381
|
+
commandId: string;
|
|
1382
|
+
/** The marketplace name to configure. */
|
|
1383
|
+
name: string;
|
|
1384
|
+
/** The target session. */
|
|
1385
|
+
sessionId: string;
|
|
1386
|
+
/** The app's source vocabulary: `owner/repo`, a git URL, a `file://` URL, or a local path. */
|
|
1387
|
+
source: string;
|
|
1388
|
+
}
|
|
1389
|
+
|
|
1390
|
+
/** What happened to a marketplace (tdd SS3.29.6). Closed: an unknown change is a contract violation, never tolerated. */
|
|
1391
|
+
export type PluginMarketplaceChange = "added" | "updated" | "removed";
|
|
1392
|
+
|
|
1393
|
+
/** `plugin/marketplaceChanged` params (tdd SS3.29.6): a marketplace was added, updated, or removed. */
|
|
1394
|
+
export interface PluginMarketplaceChangedParams {
|
|
1395
|
+
/** What happened. */
|
|
1396
|
+
change: PluginMarketplaceChange;
|
|
1397
|
+
/** The marketplace name. */
|
|
1398
|
+
name: string;
|
|
1399
|
+
/** The stored record's plugin count; omitted on `removed`, never fabricated. */
|
|
1400
|
+
pluginCount?: number;
|
|
1401
|
+
/** The acting session. */
|
|
1402
|
+
sessionId: string;
|
|
1403
|
+
/** The stored record's skipped count; omitted on `removed`, never fabricated. */
|
|
1404
|
+
skippedCount?: number;
|
|
1405
|
+
}
|
|
1406
|
+
|
|
1407
|
+
/** The stored marketplace record both add and update answer (tdd SS3.29.2, SS3.29.3): the SS3.1.2 ack envelope plus the record. */
|
|
1408
|
+
export interface PluginMarketplaceRecordResult {
|
|
1409
|
+
/** The echoed idempotency key. */
|
|
1410
|
+
commandId: string;
|
|
1411
|
+
/** The configured marketplace name. */
|
|
1412
|
+
name: string;
|
|
1413
|
+
/** The plugins the store now offers. */
|
|
1414
|
+
pluginCount: number;
|
|
1415
|
+
/** Entries the store could not offer, with the reason each was skipped; empty when nothing was skipped. */
|
|
1416
|
+
skipped: PluginMarketplaceSkippedEntry[];
|
|
1417
|
+
/** The normalized stored source. */
|
|
1418
|
+
source: PluginMarketplaceSourceShape;
|
|
1419
|
+
/** The ack status. */
|
|
1420
|
+
status: CommandStatus;
|
|
1421
|
+
}
|
|
1422
|
+
|
|
1423
|
+
/** `plugin/marketplaceRemove` params (tdd SS3.29.4). Per-session params plus a client-generated `commandId` (UUIDv7). */
|
|
1424
|
+
export interface PluginMarketplaceRemoveParams {
|
|
1425
|
+
/** The client-generated idempotency key (UUIDv7). */
|
|
1426
|
+
commandId: string;
|
|
1427
|
+
/** The marketplace name to remove. */
|
|
1428
|
+
name: string;
|
|
1429
|
+
/** The target session. */
|
|
1430
|
+
sessionId: string;
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
/** `plugin/marketplaceRemove` result (tdd SS3.29.4): the SS3.1.2 ack envelope plus the removed name. */
|
|
1434
|
+
export interface PluginMarketplaceRemoveResult {
|
|
1435
|
+
/** The echoed idempotency key. */
|
|
1436
|
+
commandId: string;
|
|
1437
|
+
/** The removed marketplace name. */
|
|
1438
|
+
name: string;
|
|
1439
|
+
/** The ack status. */
|
|
1440
|
+
status: CommandStatus;
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
/** One skipped marketplace entry (tdd SS3.29.2). */
|
|
1444
|
+
export interface PluginMarketplaceSkippedEntry {
|
|
1445
|
+
/** The skipped plugin. */
|
|
1446
|
+
plugin: string;
|
|
1447
|
+
/** Why it was skipped. */
|
|
1448
|
+
reason: string;
|
|
1449
|
+
}
|
|
1450
|
+
|
|
1451
|
+
/** The normalized stored marketplace source (tdd SS3.29.2). */
|
|
1452
|
+
export interface PluginMarketplaceSourceShape {
|
|
1453
|
+
/** The stored source kind. */
|
|
1454
|
+
kind: string;
|
|
1455
|
+
/** The stored source path. */
|
|
1456
|
+
path: string;
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
/** `plugin/marketplaceUpdate` params (tdd SS3.29.3). Per-session params plus a client-generated `commandId` (UUIDv7). */
|
|
1460
|
+
export interface PluginMarketplaceUpdateParams {
|
|
1461
|
+
/** The client-generated idempotency key (UUIDv7). */
|
|
1462
|
+
commandId: string;
|
|
1463
|
+
/** The marketplace name to refresh. */
|
|
1464
|
+
name: string;
|
|
1465
|
+
/** The target session. */
|
|
1466
|
+
sessionId: string;
|
|
1467
|
+
}
|
|
1468
|
+
|
|
1254
1469
|
/** 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. */
|
|
1255
1470
|
export type PluginSource = "curated" | "marketplaceUserAdded" | "foreignImport" | "nativeLocal" | (string & {});
|
|
1256
1471
|
|
|
1472
|
+
/** Typed quota-exhaustion detail (tdd SS4.5.1, ADR 50047 D2): the limit kind plus the provider's reset instant. */
|
|
1473
|
+
export interface QuotaDetail {
|
|
1474
|
+
/** Which quota was exhausted (open enum; unknown values fall back). */
|
|
1475
|
+
limitKind: LimitKind;
|
|
1476
|
+
/** Epoch milliseconds at which the provider says usage resets. */
|
|
1477
|
+
resetsAtMs: number;
|
|
1478
|
+
}
|
|
1479
|
+
|
|
1257
1480
|
/** The reasoning-effort tier sampled at submission (tdd SS3.2, SS3.3). The **same closed tier vocabulary** on both the fresh-turn and steer lanes, spelled identically; invalid tiers are invalid params. `none` is a tier of the vocabulary (ask for no reasoning), not a way to say "unset". */
|
|
1258
1481
|
export type ReasoningEffort = "none" | "minimal" | "low" | "medium" | "high" | "xhigh" | "max" | "ultra";
|
|
1259
1482
|
|
|
@@ -1268,6 +1491,60 @@ export interface ReasoningEffortState {
|
|
|
1268
1491
|
source: ReasoningEffortChangeSource;
|
|
1269
1492
|
}
|
|
1270
1493
|
|
|
1494
|
+
/** `recap/cancel` params (tdd SS3.28.5): the session plus the cancel's own retry id. No target — one in-flight slot per session makes the target unambiguous. */
|
|
1495
|
+
export interface RecapCancelParams {
|
|
1496
|
+
/** The cancel's own retry id (required, SS3.1.1). */
|
|
1497
|
+
commandId: string;
|
|
1498
|
+
/** The session whose in-flight recap to cancel (required). */
|
|
1499
|
+
sessionId: string;
|
|
1500
|
+
}
|
|
1501
|
+
|
|
1502
|
+
/** `recap/cancel` result (tdd SS3.28.5): admission only. In flight → the recap settles `cancelled`; idle → accepted no-op. */
|
|
1503
|
+
export interface RecapCancelResult {
|
|
1504
|
+
/** The cancel's id, echoed. */
|
|
1505
|
+
commandId: string;
|
|
1506
|
+
/** Always `accepted` on this path. */
|
|
1507
|
+
status: CommandStatus;
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
/** `recap/completed` params (tdd SS3.28.2): the settlement, delivered to the requesting connection outside the view stream — no `viewCursor`, no `sourceRange`. `text` is required on `completed` (plus optional `title`, untrusted model output — clients MUST sanitize per spec 442 INV-015); `reason` is required on `failed`; neither rides `cancelled`/`timedOut`. The struct marks the conditional members optional; the SS prose pins the per-outcome rule, the `turn/completed` usage/error convention. */
|
|
1511
|
+
export interface RecapCompletedParams {
|
|
1512
|
+
/** The request's id — the correlation key. */
|
|
1513
|
+
commandId: string;
|
|
1514
|
+
/** How the request settled. */
|
|
1515
|
+
outcome: RecapOutcome;
|
|
1516
|
+
/** Why the side-call failed (on `failed`). */
|
|
1517
|
+
reason?: RecapFailureReason;
|
|
1518
|
+
/** The recapped session. */
|
|
1519
|
+
sessionId: string;
|
|
1520
|
+
/** The recap text verbatim (on `completed`). */
|
|
1521
|
+
text?: string;
|
|
1522
|
+
/** The model-produced short title (on `completed`, when produced). */
|
|
1523
|
+
title?: string;
|
|
1524
|
+
}
|
|
1525
|
+
|
|
1526
|
+
/** `recap/completed` failure reason (tdd SS3.28.2/SS3.28.8): post-ack failures fold to the single initial value. **Open**: later splits stay additive (#22785 E2). */
|
|
1527
|
+
export type RecapFailureReason = "providerFailed" | (string & {});
|
|
1528
|
+
|
|
1529
|
+
/** `recap/completed` outcome (tdd SS3.28.2): the terminal vocabulary, camelCase per SS1.6. **Open**: a server-produced result vocabulary (#22785 E2). */
|
|
1530
|
+
export type RecapOutcome = "completed" | "failed" | "cancelled" | "timedOut" | (string & {});
|
|
1531
|
+
|
|
1532
|
+
/** `recap/request` params (tdd SS3.28.1): the session plus the client-minted UUIDv7 retry id. No other param; unknown fields are `invalidParams`. */
|
|
1533
|
+
export interface RecapRequestParams {
|
|
1534
|
+
/** The client-minted retry id (required, SS3.1.1). */
|
|
1535
|
+
commandId: string;
|
|
1536
|
+
/** The session to recap (required). */
|
|
1537
|
+
sessionId: string;
|
|
1538
|
+
}
|
|
1539
|
+
|
|
1540
|
+
/** `recap/request` result (tdd SS3.28.1): admission only — the ack is never the recap. */
|
|
1541
|
+
export interface RecapRequestResult {
|
|
1542
|
+
/** The request's id, echoed. */
|
|
1543
|
+
commandId: string;
|
|
1544
|
+
/** Always `accepted` on this path. */
|
|
1545
|
+
status: CommandStatus;
|
|
1546
|
+
}
|
|
1547
|
+
|
|
1271
1548
|
/** One end of a [`SourceRange`]: a record's event id and its sequence number within the stream (tdd SS4.2). */
|
|
1272
1549
|
export interface RecordPosition {
|
|
1273
1550
|
/** The record's event id. */
|
|
@@ -1297,6 +1574,9 @@ export type RequestId = number | string;
|
|
|
1297
1574
|
export interface RequestReceipt {
|
|
1298
1575
|
}
|
|
1299
1576
|
|
|
1577
|
+
/** 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. */
|
|
1578
|
+
export type RetractOutcome = "accepted" | "declined" | (string & {});
|
|
1579
|
+
|
|
1300
1580
|
/** 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). */
|
|
1301
1581
|
export interface SchemaInfo {
|
|
1302
1582
|
/** `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). */
|
|
@@ -1348,7 +1628,7 @@ export interface Session {
|
|
|
1348
1628
|
/** The session identity. */
|
|
1349
1629
|
sessionId: string;
|
|
1350
1630
|
/** `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`. */
|
|
1351
|
-
sideFrom?: SideProvenance;
|
|
1631
|
+
sideFrom?: SideProvenance | null;
|
|
1352
1632
|
/** Load state as this host knows it; `session/list` reports `notLoaded` for sessions loaded by *other* hosts (tdd SS2.4). */
|
|
1353
1633
|
status: SessionStatus;
|
|
1354
1634
|
/** Derived display title (tdd SS2.14.1, #27598): a heuristic that may evolve — its carriage, not its derivation, is the contract. **Additive-optional**, omitted when underivable. */
|
|
@@ -1382,7 +1662,7 @@ export interface SessionApprovalModeChangedParams {
|
|
|
1382
1662
|
/** `session/branchChanged` params (tdd SS4.6.4): a durable workspace-branch observation landed. */
|
|
1383
1663
|
export interface SessionBranchChangedParams {
|
|
1384
1664
|
/** The observed branch; `null` on a detached-HEAD observation — a fact, not "unchanged" (tdd SS4.6.4). */
|
|
1385
|
-
branch
|
|
1665
|
+
branch: string | null;
|
|
1386
1666
|
/** The owning session. */
|
|
1387
1667
|
sessionId: string;
|
|
1388
1668
|
/** The durable records this event folded from. */
|
|
@@ -1480,7 +1760,7 @@ export interface SessionForkResult {
|
|
|
1480
1760
|
/** `session/goalChanged` params (tdd SS4.6.2): the projected goal block's value changed — identical adoptions emit nothing (the change gate), and an explicit `null` clears. Replace wholesale; `null` never means unchanged. */
|
|
1481
1761
|
export interface SessionGoalChangedParams {
|
|
1482
1762
|
/** The full current goal block, or `null` to clear. */
|
|
1483
|
-
goal
|
|
1763
|
+
goal: Goal | null;
|
|
1484
1764
|
/** The owning session. */
|
|
1485
1765
|
sessionId: string;
|
|
1486
1766
|
/** The durable records this event folded from. */
|
|
@@ -1583,7 +1863,7 @@ export interface SessionModelChangedParams {
|
|
|
1583
1863
|
/** The selected model. */
|
|
1584
1864
|
modelId: string;
|
|
1585
1865
|
/** The selected provider; `null` when the selection names none. */
|
|
1586
|
-
providerId
|
|
1866
|
+
providerId: string | null;
|
|
1587
1867
|
/** The owning session. */
|
|
1588
1868
|
sessionId: string;
|
|
1589
1869
|
/** What drove the selection. */
|
|
@@ -1603,7 +1883,7 @@ export interface SessionModelRouteUnservedParams {
|
|
|
1603
1883
|
/** The standing (still bound, now unroutable) model. */
|
|
1604
1884
|
modelId: string;
|
|
1605
1885
|
/** The standing model's provider; `null` when the selection names none. */
|
|
1606
|
-
providerId
|
|
1886
|
+
providerId: string | null;
|
|
1607
1887
|
/** The owning session. */
|
|
1608
1888
|
sessionId: string;
|
|
1609
1889
|
/** The durable records this event folded from. */
|
|
@@ -1798,6 +2078,8 @@ export interface SessionStartParams {
|
|
|
1798
2078
|
config?: SessionConfig;
|
|
1799
2079
|
/** Initial model; server default when omitted. */
|
|
1800
2080
|
modelId?: string;
|
|
2081
|
+
/** The new session's initial permission profile (amendment 42624 FR-42624-1, ADR 42197 D2): a profile id the host catalog already admits — the rows `permissionProfile/list` serves without `sessionId`. Select, never create. Omitted means today's behavior: the host's configured default under native admission, unchanged. An id the catalog does not carry, or one it serves unavailable, refuses the start `commandRejected` (-32030; `permission_profile_unknown` / `permission_profile_unavailable`) before any durable byte, and an ephemeral host refuses any id (`permission_profile_ephemeral_fixed`). `session/resume` and `session/fork` do not admit the member. Explicit `null` is invalid params: the set of members that tolerate `null` is closed and excludes this one, exactly as it excludes `workspaceRoots`. */
|
|
2082
|
+
permissionProfile?: string;
|
|
1801
2083
|
/** Initial provider routing; server default when omitted or explicit `null` — both spellings select the default (#23468). */
|
|
1802
2084
|
providerId?: string | null;
|
|
1803
2085
|
/** Exact identity for this new root session. When omitted the server mints a UUIDv7. This field never selects an existing session: a retained or reserved id is rejected `commandRejected` with reason `session_id_conflict` (tdd SS2.5.1). */
|
|
@@ -1862,7 +2144,7 @@ export interface SessionTokenUsageParams {
|
|
|
1862
2144
|
/** Provider finish reason when reported (open vocabulary, verbatim). */
|
|
1863
2145
|
finishReason?: string;
|
|
1864
2146
|
/** The effective model that produced this usage; `null` on pre-schema records — never back-filled, an unpriced leg (tdd SS4.6.5). */
|
|
1865
|
-
modelId
|
|
2147
|
+
modelId: string | null;
|
|
1866
2148
|
/** Prompt tokens counted exactly once under the provider's cache convention (#8803). Server-derived; deterministic — the provider is in the log. */
|
|
1867
2149
|
promptTokens: number;
|
|
1868
2150
|
/** The owning session. */
|
|
@@ -1948,6 +2230,73 @@ export interface SkillChangedParams {
|
|
|
1948
2230
|
sessionId: string;
|
|
1949
2231
|
}
|
|
1950
2232
|
|
|
2233
|
+
/** The four receipt-list lengths (tdd SS3.30.2): a client renders counts without walking lists. */
|
|
2234
|
+
export interface SkillImportCounts {
|
|
2235
|
+
/** `failed.len()`. */
|
|
2236
|
+
failed: number;
|
|
2237
|
+
/** `installed.len()`. */
|
|
2238
|
+
installed: number;
|
|
2239
|
+
/** `quarantined.len()`. */
|
|
2240
|
+
quarantined: number;
|
|
2241
|
+
/** `skipped.len()`. */
|
|
2242
|
+
skipped: number;
|
|
2243
|
+
}
|
|
2244
|
+
|
|
2245
|
+
/** One import candidate that could neither install nor quarantine (tdd SS3.30.2): recorded so the run continues past it. `id` is null when the candidate never yielded one — present-but-null, never omitted. */
|
|
2246
|
+
export interface SkillImportFailure {
|
|
2247
|
+
/** The candidate's id, or null when it never yielded one. */
|
|
2248
|
+
id: string | null;
|
|
2249
|
+
/** Why the candidate failed. */
|
|
2250
|
+
reason: string;
|
|
2251
|
+
}
|
|
2252
|
+
|
|
2253
|
+
/** `skill/import` params (tdd SS3.30.2, #45433): import foreign skills through the single `SkillsService::import_skills` seam. */
|
|
2254
|
+
export interface SkillImportParams {
|
|
2255
|
+
/** The SS3.1.1 idempotency handle (UUIDv7) — required even for `dryRun` previews. */
|
|
2256
|
+
commandId: string;
|
|
2257
|
+
/** Preview for the consent UI; writes nothing. Additive-optional, default false. */
|
|
2258
|
+
dryRun?: boolean;
|
|
2259
|
+
/** Re-import over already-imported ids (the CLI `--force` twin). Additive-optional, default false. */
|
|
2260
|
+
force?: boolean;
|
|
2261
|
+
/** The target session. */
|
|
2262
|
+
sessionId: string;
|
|
2263
|
+
/** The foreign ecosystem to import from. */
|
|
2264
|
+
source: SkillImportSource;
|
|
2265
|
+
}
|
|
2266
|
+
|
|
2267
|
+
/** One quarantined import candidate (tdd SS3.30.2): kept, not loaded. */
|
|
2268
|
+
export interface SkillImportQuarantine {
|
|
2269
|
+
/** The candidate's id. */
|
|
2270
|
+
id: string;
|
|
2271
|
+
/** The quarantine reasons. */
|
|
2272
|
+
reasons: string[];
|
|
2273
|
+
}
|
|
2274
|
+
|
|
2275
|
+
/** `skill/import` result (tdd SS3.30.2, #45433): the ack envelope plus the service receipt projection. */
|
|
2276
|
+
export interface SkillImportResult {
|
|
2277
|
+
/** Echoes the client's id. */
|
|
2278
|
+
commandId: string;
|
|
2279
|
+
/** The four list lengths. */
|
|
2280
|
+
counts: SkillImportCounts;
|
|
2281
|
+
/** Echoes the call's preview flag. */
|
|
2282
|
+
dryRun: boolean;
|
|
2283
|
+
/** Candidates that could neither install nor quarantine. Import never aborts the whole run on one bad candidate. */
|
|
2284
|
+
failed: SkillImportFailure[];
|
|
2285
|
+
/** The ids the run installed, in pipeline order. */
|
|
2286
|
+
installed: string[];
|
|
2287
|
+
/** Kept, not loaded, with reasons. */
|
|
2288
|
+
quarantined: SkillImportQuarantine[];
|
|
2289
|
+
/** Ids the run did not install: already-imported ids and in-run duplicates, verbatim from the seam's `skipped` vec. */
|
|
2290
|
+
skipped: string[];
|
|
2291
|
+
/** Echoes the call's ecosystem. */
|
|
2292
|
+
source: SkillImportSource;
|
|
2293
|
+
/** Admission status. */
|
|
2294
|
+
status: CommandStatus;
|
|
2295
|
+
}
|
|
2296
|
+
|
|
2297
|
+
/** `skill/import` foreign ecosystem (tdd SS3.30.2). **Closed**: a client-selected write vocabulary (ADR 45433 D2) — a write must fail an ecosystem the host does not implement rather than import from an unknown dir. The host resolves its own foreign dir (the `foreign_skills_sources` derivation); no client paths cross the wire. */
|
|
2298
|
+
export type SkillImportSource = "claude" | "codex";
|
|
2299
|
+
|
|
1951
2300
|
/** `skill/list` params (tdd SS3.22.1, SS3.30.3). Per-session because skill scope follows the session's workspace and plugin state. */
|
|
1952
2301
|
export interface SkillListParams {
|
|
1953
2302
|
/** The target session. */
|
|
@@ -2018,7 +2367,7 @@ export interface SnapshotState {
|
|
|
2018
2367
|
/** 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). */
|
|
2019
2368
|
items: Item[];
|
|
2020
2369
|
/** 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. */
|
|
2021
|
-
name?: string;
|
|
2370
|
+
name?: string | null;
|
|
2022
2371
|
/** The pending-approval half of the pending set. */
|
|
2023
2372
|
pendingApprovals: PendingApprovalPointer[];
|
|
2024
2373
|
/** The pending-user-input half of the pending set. */
|
|
@@ -2393,12 +2742,14 @@ export interface TurnError {
|
|
|
2393
2742
|
kind: TurnErrorKind;
|
|
2394
2743
|
/** Human-readable failure text. */
|
|
2395
2744
|
message: string;
|
|
2745
|
+
/** Typed quota-exhaustion detail (ADR 50047 D2/D3): present iff the stopping failure was the quota class. Clients branch on presence, never by parsing `message`. */
|
|
2746
|
+
quota?: QuotaDetail;
|
|
2396
2747
|
/** The server's judgment that resubmitting the same input may succeed. */
|
|
2397
2748
|
retryable: boolean;
|
|
2398
2749
|
}
|
|
2399
2750
|
|
|
2400
2751
|
/** Turn failure classes (tdd SS4.5.1, `TerminalErrorKind` plus the model-task failure class). Open. */
|
|
2401
|
-
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | (string & {});
|
|
2752
|
+
export type TurnErrorKind = "stepLimit" | "configError" | "projectionError" | "logError" | "workflowLaunchError" | "environmentError" | "modelError" | "launchError" | "authRequired" | "mcpLinkError" | (string & {});
|
|
2402
2753
|
|
|
2403
2754
|
/** `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`. */
|
|
2404
2755
|
export interface TurnForegroundCompletedParams {
|
|
@@ -2473,10 +2824,12 @@ export interface TurnRef {
|
|
|
2473
2824
|
turnId: string;
|
|
2474
2825
|
}
|
|
2475
2826
|
|
|
2476
|
-
/** `turn/retracted` params (tdd SS4.5.1): an interrupt-paired retract
|
|
2827
|
+
/** `turn/retracted` params (tdd SS4.5.1): an interrupt-paired retract durably settled, accepted or declined (ADR 50074 D1). On `"accepted"` the retracted user-message item is re-emitted via `item/updated` with `retracted: true`; on `"declined"` the client folds the legacy declined rollback instead and no item is re-emitted. */
|
|
2477
2828
|
export interface TurnRetractedParams {
|
|
2478
2829
|
/** The retracted submission's command id. */
|
|
2479
2830
|
commandId: string;
|
|
2831
|
+
/** The retract settlement outcome (tdd SS4.5.1, ADR 50074 D1). Additive-optional: absent reads as `"accepted"` — pre-feature hosts emit the event only for accepted retracts — and so does an unrecognized value (open enum, D-033). */
|
|
2832
|
+
outcome?: RetractOutcome;
|
|
2480
2833
|
/** The owning session. */
|
|
2481
2834
|
sessionId: string;
|
|
2482
2835
|
/** The durable records this event folded from. */
|
|
@@ -2491,6 +2844,10 @@ export interface TurnRetractedParams {
|
|
|
2491
2844
|
export interface TurnRetryScheduledParams {
|
|
2492
2845
|
/** The attempt that failed (producer-normalized, >= 1). */
|
|
2493
2846
|
attempt: number;
|
|
2847
|
+
/** The failing model attempt's durable kind, verbatim (ADR 50047 D2/D3) — a plain string: the durable vocabulary is open-ended. */
|
|
2848
|
+
errorKind?: string;
|
|
2849
|
+
/** The failing model attempt's HTTP status (ADR 50047 D2/D3). */
|
|
2850
|
+
httpStatus?: number;
|
|
2494
2851
|
/** The turn's model-retry chain bound. */
|
|
2495
2852
|
maxAttempts: number;
|
|
2496
2853
|
/** The attempt about to run (producer contract: attempt < nextAttempt <= maxAttempts; not a schema constraint). */
|
|
@@ -2503,6 +2860,8 @@ export interface TurnRetryScheduledParams {
|
|
|
2503
2860
|
sessionId: string;
|
|
2504
2861
|
/** The durable record this event folded from (the session stream's mirror of the retry-scheduled task status; `first == last`). */
|
|
2505
2862
|
sourceRange: SourceRange;
|
|
2863
|
+
/** The failing model attempt's provider system, verbatim (ADR 50047 D2/D3) — e.g. `"meta"`. Absent when no model-attempt facet precedes the retry status on the task (old logs). */
|
|
2864
|
+
system?: string;
|
|
2506
2865
|
/** The running turn whose model attempt is being retried. */
|
|
2507
2866
|
turnId: string;
|
|
2508
2867
|
/** Opaque, strictly monotonic view cursor (tdd SS4.1). */
|
|
@@ -2512,7 +2871,7 @@ export interface TurnRetryScheduledParams {
|
|
|
2512
2871
|
/** What `turn/start` did with the input (tdd SS3.2). Resolves OQ-H in v1: since `queue` is the default `ifBusy`, clients need to distinguish these without folding history. */
|
|
2513
2872
|
export type TurnStartDisposition = "started" | "queued" | "steered" | (string & {});
|
|
2514
2873
|
|
|
2515
|
-
/** `turn/start.providerRequestOptions` is deliberately absent: **RULED (#22785 E3, owner, 2026-08-26) to stay off the published schema.** The schema is the contract, and a free-form-object node kind is revisited only if the experimental field graduates.
|
|
2874
|
+
/** `turn/start` params (tdd SS3.2). `turn/start.providerRequestOptions` is deliberately absent: **RULED (#22785 E3, owner, 2026-08-26) to stay off the published schema.** The schema is the contract, and a free-form-object node kind is revisited only if the experimental field graduates. */
|
|
2516
2875
|
export interface TurnStartParams {
|
|
2517
2876
|
/** The SS3.1.1 idempotency handle (UUIDv7). The fresh turn's `turnId` derives from it (tdd SS3.1.4). */
|
|
2518
2877
|
commandId: string;
|
|
@@ -2526,6 +2885,8 @@ export interface TurnStartParams {
|
|
|
2526
2885
|
reasoningEffort?: ReasoningEffort;
|
|
2527
2886
|
/** The target session. */
|
|
2528
2887
|
sessionId: string;
|
|
2888
|
+
/** A queued `!` shell action riding this turn (tdd SS3.2, ADR 50034): the `!cmd` typed while a turn runs, executed at the next model-call boundary before any later steer. Exclusive with `text` and `skill` input; `input` may be empty only when this member is present. Capability-gated on `userShell`: a carrying turn on a connection without the grant fails `-32010 capabilityRequired`. Explicit `null` is invalid params (the null-tolerant set is closed). A v1 stable member. */
|
|
2889
|
+
userShell?: TurnUserShell;
|
|
2529
2890
|
/** A sticky REPLACEMENT of the session's runtime workspace-root set, binding at this turn's launch and persisting for subsequent turns until replaced again — unlike `reasoningEffort`, which is this-turn-only. Same shape and validation as `session/start.workspaceRoots`; invalid params on an explicit `ifBusy: "steer"` submit and so is explicit `null` (the D-049 null-tolerant set is closed); omitted means "unchanged", never "reset" (tdd SS3.2, ADR 37313 D3, #37313). */
|
|
2530
2891
|
workspaceRoots?: string[];
|
|
2531
2892
|
}
|
|
@@ -2619,6 +2980,12 @@ export interface TurnUnqueuedParams {
|
|
|
2619
2980
|
viewCursor: string;
|
|
2620
2981
|
}
|
|
2621
2982
|
|
|
2983
|
+
/** The queued `!` shell action a `turn/start` carries (tdd SS3.2, ADR 50034): the `!cmd` typed while a turn runs. The shell's command id derives from the carrying turn's `commandId`, exactly as the app's own queued submit does; the params' sibling `displayText` carries the `!…` presentation form. */
|
|
2984
|
+
export interface TurnUserShell {
|
|
2985
|
+
/** The shell command text, without the leading `!`. */
|
|
2986
|
+
commandText: string;
|
|
2987
|
+
}
|
|
2988
|
+
|
|
2622
2989
|
/** One element of a `view/page` result's `events` array: an **unframed view notification** exactly as tdd SS4.2.1 defines it — the nested pair `{"method", "params"}`, which is the live notification minus `jsonrpc` and `emittedAtMs`, with nothing lifted out of `params` and nothing spliced into it. SS4.2.1 is the single normative definition; SS4.7.3 and SS7.4 both cite it, so the two surfaces cannot drift. */
|
|
2623
2990
|
export interface UnframedViewNotification {
|
|
2624
2991
|
/** The event type — the live notification's method name, retained because the type lives only in the notification name and would otherwise be lost (tdd SS4.2.1). */
|
|
@@ -2977,6 +3344,26 @@ export interface WorkflowPauseParams {
|
|
|
2977
3344
|
workflowRunId: string;
|
|
2978
3345
|
}
|
|
2979
3346
|
|
|
3347
|
+
/** `workflow/resume` params (tdd SS3.34, ADR 45437 D3): resume a paused workflow run, host-driven. */
|
|
3348
|
+
export interface WorkflowResumeParams {
|
|
3349
|
+
/** The SS3.1.1 idempotency handle (UUIDv7). */
|
|
3350
|
+
commandId: string;
|
|
3351
|
+
/** The target session. */
|
|
3352
|
+
sessionId: string;
|
|
3353
|
+
/** The paused run to resume, exactly as the `workflow` item names it (SS4.5.8); required, non-empty. */
|
|
3354
|
+
workflowRunId: string;
|
|
3355
|
+
}
|
|
3356
|
+
|
|
3357
|
+
/** `workflow/resume` result (tdd SS3.34): admission-only plus the driven turn — always present, since resume always drives (idle fresh turn or busy steer). */
|
|
3358
|
+
export interface WorkflowResumeResult {
|
|
3359
|
+
/** Echoes the client's id. */
|
|
3360
|
+
commandId: string;
|
|
3361
|
+
/** Admission status. */
|
|
3362
|
+
status: CommandStatus;
|
|
3363
|
+
/** The turn the host drove: the fresh resume turn on an idle session, the admission-time active turn on a busy session (a routing fact like the SS3.18 wake-gate's, not settlement). */
|
|
3364
|
+
turnId: string;
|
|
3365
|
+
}
|
|
3366
|
+
|
|
2980
3367
|
/** `workflow`: the run's launch token budget (tdd SS4.5.8, #45449). */
|
|
2981
3368
|
export interface WorkflowTokenBudget {
|
|
2982
3369
|
/** The effective launch budget in tokens, verbatim from the launch fact. */
|
|
@@ -2984,10 +3371,10 @@ export interface WorkflowTokenBudget {
|
|
|
2984
3371
|
}
|
|
2985
3372
|
|
|
2986
3373
|
/** Every wire method in this schema (SS1.9 index). */
|
|
2987
|
-
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/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" | "hook/list" | "plugin/list" | "task/background" | "task/stop" | "task/stopAll" | "goal/set" | "goal/edit" | "goal/clear" | "goal/pause" | "goal/resume" | "workflow/cancel" | "workflow/childControl" | "workflow/pause" | "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" | "computerUseSettings/read" | "computerUseSettings/update";
|
|
3374
|
+
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/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";
|
|
2988
3375
|
/** Every wire notification in this schema (SS1.9 index). */
|
|
2989
|
-
export type MspNotification = "initialized" | "session/started" | "session/closed" | "skill/changed" | "turn/started" | "turn/completed" | "turn/retracted" | "turn/retryScheduled" | "turn/unqueued" | "turn/foregroundCompleted" | "item/started" | "item/updated" | "item/delta" | "item/completed" | "view/gap" | "approval/requested" | "approval/updated" | "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" | "session/modelRouteUnserved" | "session/nameChanged" | "session/viewHealthChanged" | "session/listChanged" | "usage/changed";
|
|
3376
|
+
export type MspNotification = "initialized" | "session/started" | "session/closed" | "skill/changed" | "turn/started" | "turn/completed" | "turn/retracted" | "turn/retryScheduled" | "turn/unqueued" | "turn/foregroundCompleted" | "item/started" | "item/updated" | "item/delta" | "item/completed" | "view/gap" | "approval/requested" | "approval/updated" | "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";
|
|
2990
3377
|
/** Every server-initiated wire request in this schema (SS5.3/SS5.10.1 index). */
|
|
2991
3378
|
export type MspServerRequest = "approval/request" | "userInput/request";
|
|
2992
3379
|
/** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */
|
|
2993
|
-
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" | "uploadNotFound" | "viewTruncated" | "outputUnavailable" | "boundaryPruned" | "boundaryUnusable" | "noBoundary" | "approvalNotFound" | "approvalAlreadyResolved" | "approvalChoiceInvalid" | "approvalRequirementStale" | "approvalReviewerUnavailable" | "userInputNotFound" | "userInputAlreadySettled" | "userInputAnswerInvalid";
|
|
3380
|
+
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";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@muse-code/sdk",
|
|
3
|
-
"version": "1.4.
|
|
3
|
+
"version": "1.4.6",
|
|
4
4
|
"description": "TypeScript SDK for the Muse Session Protocol (MSP): connect to a Muse Code session, drive turns, and fold the event stream. Zero runtime dependencies.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/meta-models/muse-code-sdk",
|