@statelyai/sdk 0.20.3 → 0.22.0

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.
@@ -1,2 +1,2 @@
1
- import { a as EditorStateType, n as CanvasColor, o as GraphPatch, s as ImplementationSourceType, t as ActionLocation } from "./index-BAkQThnl.mjs";
1
+ import { _ as GraphPatch, g as EditorStateType, h as CanvasColor, m as ActionLocation, v as ImplementationSourceType } from "./index-Bakx1tkW.mjs";
2
2
  export { type ActionLocation, type CanvasColor, type EditorStateType, type GraphPatch, type ImplementationSourceType };
@@ -1,4 +1,5 @@
1
- import { i as StatelyGraph } from "./graph-yDK-MM3G.mjs";
1
+ import { i as ProfileManifest } from "./index-Bakx1tkW.mjs";
2
+ import { i as StatelyGraph } from "./graph-DYjfFztq.mjs";
2
3
  import { c as EditorSyncSourceLocation, f as MachineSourceLocations$1, l as EditorSyncSourceRange, t as EditorCapabilities$1, u as EditorSyncStateSourceLocation } from "./editor-sync-types-C-zWaaVk.mjs";
3
4
 
4
5
  //#region src/protocol.d.ts
@@ -170,14 +171,37 @@ interface EmbedEventMap {
170
171
  machineSelected: {
171
172
  machineId: string;
172
173
  };
174
+ viewModeChanged: {
175
+ viewMode: 'graph' | 'list';
176
+ machineId?: string;
177
+ };
173
178
  }
174
179
  type EmbedEventName = keyof EmbedEventMap;
175
180
  type EmbedEventHandler<K extends EmbedEventName> = (data: EmbedEventMap[K]) => void;
181
+ interface EmbedFormatManifest {
182
+ id: string;
183
+ name: string;
184
+ file?: {
185
+ extension?: string;
186
+ mediaType?: string;
187
+ };
188
+ editorLanguage?: string;
189
+ detect?: boolean;
190
+ import?: boolean;
191
+ export?: boolean;
192
+ }
193
+ interface EmbedExtensionsManifest {
194
+ profiles: ProfileManifest[];
195
+ formats: EmbedFormatManifest[];
196
+ defaultProfile?: string;
197
+ defaultFormat?: string;
198
+ }
176
199
  interface MachineInitOptions {
177
200
  machine: unknown;
178
201
  /** Ephemeral, read-only reference documents owned by the embed host. */
179
202
  documents?: EmbedDocument[];
180
203
  format?: string;
204
+ extensions?: EmbedExtensionsManifest;
181
205
  mode?: EmbedMode;
182
206
  theme?: 'light' | 'dark';
183
207
  readOnly?: boolean;
@@ -237,6 +261,7 @@ interface InitMessage {
237
261
  machine: unknown;
238
262
  documents?: EmbedDocument[];
239
263
  format?: string;
264
+ extensions?: EmbedExtensionsManifest;
240
265
  mode?: EmbedMode;
241
266
  theme?: 'light' | 'dark';
242
267
  readOnly?: boolean;
@@ -485,6 +510,11 @@ interface ProjectMachineSelectedMessage {
485
510
  type: '@statelyai.project.machineSelected';
486
511
  machineId: string;
487
512
  }
513
+ interface ViewModeChangedMessage {
514
+ type: '@statelyai.viewModeChanged';
515
+ viewMode: 'graph' | 'list';
516
+ machineId?: string;
517
+ }
488
518
  interface RetrievedMessage {
489
519
  type: '@statelyai.retrieved';
490
520
  requestId: string;
@@ -539,10 +569,23 @@ interface UploadResponseMessage {
539
569
  requestId: string;
540
570
  result: UploadResult;
541
571
  }
572
+ interface ExtensionCallMessage {
573
+ type: '@statelyai.extension.call';
574
+ requestId: string;
575
+ extensionId: string;
576
+ method: 'detect' | 'import' | 'export' | 'validate';
577
+ payload: unknown;
578
+ }
579
+ interface ExtensionResultMessage {
580
+ type: '@statelyai.extension.result';
581
+ requestId: string;
582
+ result?: unknown;
583
+ error?: string;
584
+ }
542
585
  /** All messages a client (embed/inspector) can send to the viz. */
543
- type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ErrorMessage;
586
+ type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
544
587
  /** All messages the viz can send back to a client. */
545
- type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage;
588
+ type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | ViewModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
546
589
  interface InspectionClientMetadata {
547
590
  name?: string;
548
591
  machineId?: string;
@@ -571,4 +614,4 @@ declare const PREFIX = "@statelyai.";
571
614
  /** Current WebSocket inspection protocol version. */
572
615
  declare const INSPECTION_PROTOCOL_VERSION = 2;
573
616
  //#endregion
574
- export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };
617
+ export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, ViewModeChangedMessage, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };