@muse-code/sdk 1.4.8 → 1.4.9

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.
@@ -279,6 +279,7 @@ export class Session {
279
279
  case "turn/retryScheduled": // non-terminal by contract (SS4.5.1)
280
280
  case "turn/modelRetryScheduled": // non-terminal by contract (SS4.5.1)
281
281
  case "turn/foregroundCompleted": // non-terminal by contract (SS4.5.12)
282
+ case "approval/reviewing": // reviewer-held twin of approval/requested (tdd SS5.5.1): a notice, no decide is open
282
283
  case "approval/resolved":
283
284
  case "userInput/requested":
284
285
  case "userInput/settled":
@@ -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:4e3200c3c9dc0cd7919d11022630d43f9bc1c5cdda375381e90b0183b5665069";
16
+ export declare const EXPECTED_SCHEMA_FINGERPRINT = "sha256:5d3b43e5ccdb7dc4f5a32c380f5f2cde0f10e3059b93610afb2e73f73b1d914c";
17
17
  /**
18
18
  * What a build-time mismatch MEANS, in the words a human needs at 2am.
19
19
  *
@@ -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:4e3200c3c9dc0cd7919d11022630d43f9bc1c5cdda375381e90b0183b5665069";
16
+ export const EXPECTED_SCHEMA_FINGERPRINT = "sha256:5d3b43e5ccdb7dc4f5a32c380f5f2cde0f10e3059b93610afb2e73f73b1d914c";
17
17
  /**
18
18
  * What a build-time mismatch MEANS, in the words a human needs at 2am.
19
19
  *
@@ -69,6 +69,9 @@ export type ViewEvent = {
69
69
  } | {
70
70
  readonly method: "approval/requested";
71
71
  readonly params: ApprovalRequestParams;
72
+ } | {
73
+ readonly method: "approval/reviewing";
74
+ readonly params: ApprovalRequestParams;
72
75
  } | {
73
76
  readonly method: "approval/updated";
74
77
  readonly params: ApprovalUpdatedParams;
@@ -291,6 +294,17 @@ export type FoldOutcome = {
291
294
  | {
292
295
  readonly kind: "sessionState";
293
296
  readonly outcome: DeepReadonly<StateApplyOutcome<SessionStateParams>>;
297
+ }
298
+ /**
299
+ * `approval/reviewing` (tdd SS5.5.1, spec 209 FR-52080-1): the native
300
+ * reviewer holds this approval. A typed-activity NOTICE, never a pending
301
+ * entry — the approval is absent from `pendingRequests` and no decide is
302
+ * open until `approval/requested` releases it (or `approval/resolved`
303
+ * settles it) on the same id. Ids only, so nothing here needs sealing.
304
+ */
305
+ | {
306
+ readonly kind: "approvalReviewing";
307
+ readonly approvalId: string;
294
308
  } | {
295
309
  readonly kind: "approvalPending";
296
310
  readonly approvalId: string;
@@ -169,6 +169,8 @@ export class SessionFold {
169
169
  return this.#turnForegroundCompleted(typed.params);
170
170
  case "approval/requested":
171
171
  return this.#approvalRequested(typed.params);
172
+ case "approval/reviewing":
173
+ return this.#approvalReviewing(typed.params);
172
174
  case "approval/updated":
173
175
  return this.#approvalUpdated(typed.params);
174
176
  case "approval/resolved":
@@ -402,6 +404,15 @@ export class SessionFold {
402
404
  this.#pendingApprovals.set(params.approvalId, { requested: params });
403
405
  return { kind: "approvalPending", approvalId: params.approvalId, requested: params };
404
406
  }
407
+ #approvalReviewing(params) {
408
+ // The reviewer-held twin of `approval/requested` (tdd SS5.5.1): typed
409
+ // activity, not a request. It opens NO pending entry — a client that
410
+ // showed a decision card here would defeat the presentation hold that
411
+ // spec 209 FR-52080-1 exists for — and touches no other store; the
412
+ // release arrives as `approval/requested` (or `approval/resolved`) on
413
+ // this id.
414
+ return { kind: "approvalReviewing", approvalId: params.approvalId };
415
+ }
405
416
  #approvalUpdated(params) {
406
417
  // An update REFRESHES a pending view; it never opens one. An update for an
407
418
  // approval this fold never saw requested (a pre-join frame) is dropped
package/dist/src/msp.d.ts CHANGED
@@ -866,6 +866,8 @@ export interface Item {
866
866
  declaredPhase?: string;
867
867
  /** `subagent`: nesting depth. */
868
868
  depth?: number;
869
+ /** `toolCall`: the tool's own words for this call; absent = none (tdd SS4.5.5). */
870
+ displayLabel?: ToolDisplayLabel;
869
871
  /** `userMessage`: presentation form (tdd SS3.2); absent when the client sent none. */
870
872
  displayText?: string;
871
873
  /** `userShell`/`subagent`: observed wall-clock duration. `workflow`: the run's wall time from launch to reconciliation, set only on the settling `item/completed` — never a sum of child durations. */
@@ -2758,6 +2760,16 @@ export interface TokenUsage {
2758
2760
  reasoningTokens: number;
2759
2761
  }
2760
2762
 
2763
+ /** `toolCall.displayLabel`: the call's words in three forms, each one line of plain text, always present together. The item's `status` picks the form. */
2764
+ export interface ToolDisplayLabel {
2765
+ /** Shown while the call runs (`inProgress`), e.g. "Setting up Computer Use". */
2766
+ active: string;
2767
+ /** Shown after the call succeeds (`completed`), e.g. "Set up Computer Use". */
2768
+ done: string;
2769
+ /** Shown for every other status (failed, rejected, timed out, cancelled), beside that status; never implies success. */
2770
+ neutral: string;
2771
+ }
2772
+
2761
2773
  export type ToolReceipt = { details?: CronReceipt; family: "cron"; operation: ToolReceiptOperation; outcome: ToolReceiptOutcome; } | { details?: CodeModeReceipt; family: "codeMode"; operation: ToolReceiptOperation; outcome: ToolReceiptOutcome; } | { details?: Record<string, unknown>; family: string; operation: string; outcome: string; };
2762
2774
 
2763
2775
  /** Which operation within the family the receipt describes (ADR 43399 D1/D2). Open — registered per family, never derived from the tool name. */
@@ -3481,7 +3493,7 @@ export interface WorkflowTokenBudget {
3481
3493
  /** Every wire method in this schema (SS1.9 index). */
3482
3494
  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" | "computerUseSetup/check";
3483
3495
  /** Every wire notification in this schema (SS1.9 index). */
3484
- export type MspNotification = "initialized" | "session/started" | "session/closed" | "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/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";
3496
+ export type MspNotification = "initialized" | "session/started" | "session/closed" | "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";
3485
3497
  /** Every server-initiated wire request in this schema (SS5.3/SS5.10.1 index). */
3486
3498
  export type MspServerRequest = "approval/request" | "userInput/request";
3487
3499
  /** Every error `data.kind` in this schema's error table (SS1.6) — each code's primary kind plus its override kinds. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@muse-code/sdk",
3
- "version": "1.4.8",
3
+ "version": "1.4.9",
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",