@statelyai/sdk 0.36.0 → 0.37.2

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 CHANGED
@@ -53,8 +53,36 @@ The embed `apiKey` is sent to the iframe over `postMessage` after the editor
53
53
  handshake; it is not included in the iframe URL. Call `embed.setApiKey(token)`
54
54
  when the host refreshes the access token.
55
55
 
56
+ <!-- source-preserving embed.planSourceUpdate from src/embed.ts and editor-sync route -->
57
+
58
+ For a Git-backed XState JSON or JSONC file, keep the exact blob text in the host.
59
+ On save, pass the edited graph and original blob text to the configured editor:
60
+
61
+ ```ts
62
+ const plan = await embed.planSourceUpdate({
63
+ source: { fileName: 'machines/checkout.jsonc', text: originalBlobText },
64
+ nextGraph: savedGraph,
65
+ });
66
+ if (plan.status === 'changed') {
67
+ // Commit plan.text only if the Git blob revision still matches the one read.
68
+ // Advance originalBlobText and the host's graph baseline after commit succeeds.
69
+ }
70
+ if (plan.status === 'unsupported') console.warn(plan.reason);
71
+ ```
72
+
73
+ JSON and JSONC contain one machine; omit `source.machineIndex` for this method.
74
+ The call returns the complete updated text, focused zero-based UTF-16
75
+ `edits`, and a semantic graph `diff`. The graph diff is not a Git patch; GitLab
76
+ constructs its merge-request diff from the committed text. The call does not
77
+ read or write Git. It requires the editor-sync endpoint on the editor at
78
+ `baseUrl`, an allowed API origin, and editor-sync write access. This one-file
79
+ method supports XState `.json` and `.jsonc` sources; imported TypeScript
80
+ definitions require the document-based Editor Sync parse/apply APIs.
81
+
56
82
  Use `viewMode: 'list'` on `createStatelyEmbed` to add `?view=list` to the
57
83
  iframe URL, or subscribe to `viewModeChanged` when the user switches views.
84
+ Pass the initial `theme` or `settings.appearance.colorMode` when creating the
85
+ embed so its loading screen uses that color mode before initialization.
58
86
 
59
87
  Custom profiles and formats can be supplied when the embed is created. Their
60
88
  serializable manifests are sent to the iframe; detector, importer, exporter,
@@ -118,6 +146,11 @@ used by editor hosts. The private `@statelyai/editor-sync` package coordinates
118
146
  CLI and VS Code source editing. Application developers use the embed API below
119
147
  without a TypeScript compiler or source writeback dependency.
120
148
 
149
+ Initialization errors can include `authenticationRecovery` with the host kind
150
+ (`cli` or `vscode`). A host advertising `canLogin: true` accepts
151
+ `@statelyai.login` and sends a new initialization after sign-in succeeds.
152
+ Older hosts still receive command-based recovery guidance.
153
+
121
154
  <!-- supported editor export formats from packages/editor/src/formatConfig.ts -->
122
155
 
123
156
  Key capabilities:
@@ -1,4 +1,4 @@
1
- import { Gt as UploadResult } from "./protocol-CP3DSl5u.mjs";
1
+ import { qt as UploadResult } from "./protocol-CFK_R0rt.mjs";
2
2
 
3
3
  //#region src/assetStorage.d.ts
4
4
  interface AssetUploadContext {
@@ -1,4 +1,4 @@
1
- import { Q as ProjectEmbedMachine, an as PresentationMetadataInitializer, lt as ProjectWorkspaceConfig, on as EmbedPanelConfig } from "./protocol-CP3DSl5u.mjs";
1
+ import { cn as EmbedPanelConfig, dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, n as AuthenticationRecovery, sn as PresentationMetadataInitializer } from "./protocol-CFK_R0rt.mjs";
2
2
  import { a as MachineSourceLocations, t as EditorCapabilities } from "./editor-sync-types-U5uryWOk.mjs";
3
3
 
4
4
  //#region src/editorHostProtocol.d.ts
@@ -18,6 +18,8 @@ interface EditorHostValidationIssue {
18
18
  message: string;
19
19
  }
20
20
  type EditorHostInboundMessage = {
21
+ type: '@statelyai.login';
22
+ } | {
21
23
  type: '@statelyai.ready';
22
24
  version?: string;
23
25
  protocolVersion?: number;
@@ -38,6 +40,7 @@ type EditorHostInboundMessage = {
38
40
  sourceLocations?: MachineSourceLocations;
39
41
  } | {
40
42
  type: '@statelyai.save';
43
+ serialized?: Record<string, string>;
41
44
  requestId?: string;
42
45
  graph: unknown;
43
46
  machineConfig: unknown;
@@ -61,6 +64,7 @@ type EditorHostInboundMessage = {
61
64
  machineId?: string;
62
65
  requestId?: string;
63
66
  diagnostic?: EditorHostDiagnostic;
67
+ authenticationRecovery?: AuthenticationRecovery;
64
68
  } | {
65
69
  type: '@statelyai.clipboardRead';
66
70
  requestId: string;
@@ -190,6 +194,7 @@ type EditorHostOutboundMessage = {
190
194
  machineId?: string;
191
195
  requestId?: string;
192
196
  diagnostic?: EditorHostDiagnostic;
197
+ authenticationRecovery?: AuthenticationRecovery;
193
198
  } | {
194
199
  type: '@statelyai.clipboardReadResponse';
195
200
  requestId: string;
package/dist/embed.d.mts CHANGED
@@ -1,7 +1,8 @@
1
1
  import { n as ProfileManifest } from "./index-CoxF4Saw.mjs";
2
2
  import { i as StatelyGraph } from "./graph-B6xUxqR5.mjs";
3
- import { D as ExportCallOptions, F as InitOptions, G as MachineInitOptions, Gt as UploadResult, J as MachineVersionAutoSaveOptions, O as ExportFormat, Q as ProjectEmbedMachine, S as EmbedExtensionsManifest, Yt as ViewerOptions, _ as EmbedDocumentLanguage, at as ProjectWorkspaceAction, b as EmbedEventName, ct as ProjectWorkspaceCapabilities, d as CommentsConfig, dt as ProjectWorkspaceMachineOrigin, et as ProjectInitOptions, g as EmbedDocument, k as ExportFormatMap, lt as ProjectWorkspaceConfig, m as EditorCapabilities, on as EmbedPanelConfig, ot as ProjectWorkspaceActionIcon, pt as ProjectWorkspaceProject, q as MachineSourceLocations, r as CapabilityDeniedEvent, sn as EmbedPanelPosition, ut as ProjectWorkspaceMachine, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-CP3DSl5u.mjs";
3
+ import { A as ExportFormatMap, C as EmbedExtensionsManifest, I as InitOptions, O as ExportCallOptions, T as EmbedMode, X as MachineVersionAutoSaveOptions, Y as MachineSourceLocations, Zt as ViewerOptions, _ as EmbedDocument, b as EmbedEventMap, cn as EmbedPanelConfig, ct as ProjectWorkspaceActionIcon, dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, k as ExportFormat, ln as EmbedPanelPosition, nt as ProjectInitOptions, pt as ProjectWorkspaceMachineOrigin, q as MachineInitOptions, qt as UploadResult, st as ProjectWorkspaceAction, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-CFK_R0rt.mjs";
4
4
  import { AssetUploadAdapter } from "./assetStorage.mjs";
5
+ import { GraphDiff } from "@statelyai/graph";
5
6
 
6
7
  //#region src/embed.d.ts
7
8
  interface AssetConfig {
@@ -37,6 +38,34 @@ type EmbedGraph = EmbedEntity & {
37
38
  nodes?: EmbedEntity[];
38
39
  edges?: EmbedEntity[];
39
40
  };
41
+ /** One zero-based UTF-16 source edit, relative to the supplied original text. */
42
+ interface SourceUpdateEdit {
43
+ range: {
44
+ startLine: number;
45
+ startChar: number;
46
+ endLine: number;
47
+ endChar: number;
48
+ };
49
+ newText: string;
50
+ }
51
+ interface SourceUpdatePlan {
52
+ status: 'changed' | 'unchanged' | 'unsupported';
53
+ /** Complete updated file; commit this after checking the Git blob revision. */
54
+ text: string;
55
+ edits: SourceUpdateEdit[];
56
+ /** Semantic graph changes, not a Git patch. */
57
+ diff: GraphDiff;
58
+ reason?: string;
59
+ }
60
+ interface PlanSourceUpdateInput {
61
+ source: {
62
+ fileName: string;
63
+ text: string;
64
+ machineIndex?: number;
65
+ };
66
+ /** Edited graph from the embed, with stable node and edge IDs. */
67
+ nextGraph: StatelyGraph;
68
+ }
40
69
  type EmbedFormatContext = {
41
70
  profile: EmbedProfileDefinition;
42
71
  resolveGraphData(graph: EmbedGraph): Record<string, unknown>;
@@ -114,6 +143,8 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
114
143
  onCapabilityDenied?: (event: CapabilityDeniedEvent) => void;
115
144
  }
116
145
  interface StatelyEmbed {
146
+ /** Plan one-file XState JSON/JSONC writeback on the configured editor server. Does not write. */
147
+ planSourceUpdate(input: PlanSourceUpdateInput): Promise<SourceUpdatePlan>;
117
148
  /** Attach to an existing iframe element. Sets src and begins handshake. */
118
149
  attach(iframe: HTMLIFrameElement): void;
119
150
  /** Create an iframe and mount it into a container element. */
@@ -152,4 +183,4 @@ interface StatelyEmbed {
152
183
  }
153
184
  declare function createStatelyEmbed(options: StatelyEmbedOptions): StatelyEmbed;
154
185
  //#endregion
155
- export { AssetConfig, type CapabilityDeniedEvent, type CommentsConfig, type EditorCapabilities, type EmbedDocument, type EmbedDocumentLanguage, EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExtensionsManifest, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, type EmbedMode, type EmbedPanelConfig, type EmbedPanelPosition, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type MachineVersionAutoSaveOptions, type ProjectEmbedMachine, type ProjectInitOptions, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, StatelyEmbed, StatelyEmbedOptions, type UploadResult, type ViewerOptions, createStatelyEmbed };
186
+ export { AssetConfig, type CapabilityDeniedEvent, type CommentsConfig, type EditorCapabilities, type EmbedDocument, type EmbedDocumentLanguage, EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExtensionsManifest, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, type EmbedMode, type EmbedPanelConfig, type EmbedPanelPosition, EmbedProfileDefinition, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type InitOptions, type MachineInitOptions, type MachineSourceLocations, type MachineVersionAutoSaveOptions, PlanSourceUpdateInput, type ProjectEmbedMachine, type ProjectInitOptions, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, SourceUpdateEdit, SourceUpdatePlan, StatelyEmbed, StatelyEmbedOptions, type UploadResult, type ViewerOptions, createStatelyEmbed };
package/dist/embed.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./protocol-BsBGRISR.mjs";
2
- import { c as createPendingExportManager, l as settingsWithViewMode, r as createPostMessageTransport, s as createEventRegistry, t as SDK_VERSION, u as toInitMessage } from "./version-DS2izNeF.mjs";
2
+ import { c as createPendingExportManager, l as settingsWithViewMode, r as createPostMessageTransport, s as createEventRegistry, t as SDK_VERSION, u as toInitMessage } from "./version-jzP2mGvy.mjs";
3
3
  import { EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol.mjs";
4
4
 
5
5
  //#region src/embed.ts
@@ -34,6 +34,10 @@ function buildEmbedUrl(options) {
34
34
  const url = new URL(base);
35
35
  if (normalizeApiKey(options.apiKey)) url.searchParams.set("auth", "message");
36
36
  if (options.viewMode) url.searchParams.set("view", options.viewMode);
37
+ const appearance = options.settings?.appearance;
38
+ const settingsMode = appearance && typeof appearance === "object" && "colorMode" in appearance ? appearance.colorMode : void 0;
39
+ const colorMode = options.theme ?? settingsMode;
40
+ if (colorMode === "light" || colorMode === "dark" || colorMode === "system") url.searchParams.set("theme", colorMode);
37
41
  return url.toString();
38
42
  }
39
43
  function serializeExtensions(options) {
@@ -540,6 +544,28 @@ function createStatelyEmbed(options) {
540
544
  export(format, callOptions) {
541
545
  return exportManager.start(format, callOptions, "Embed is destroyed", () => destroyed);
542
546
  },
547
+ async planSourceUpdate(input) {
548
+ if (destroyed) throw new Error("Embed is destroyed");
549
+ const response = await fetch(new URL("/api/editor-sync/plan-source-update", options.baseUrl), {
550
+ method: "POST",
551
+ headers: {
552
+ "Content-Type": "application/json",
553
+ "X-Stately-Editor-Sync-Version": "1",
554
+ ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
555
+ },
556
+ body: JSON.stringify(input)
557
+ });
558
+ const protocolVersion = response.headers.get("X-Stately-Editor-Sync-Version");
559
+ if (protocolVersion !== null && protocolVersion !== "1") throw new Error(`Unsupported editor-sync protocol ${protocolVersion}`);
560
+ const result = await response.json();
561
+ if (!response.ok) throw new Error(result?.error ?? `Source update failed (${response.status})`);
562
+ if (!result || ![
563
+ "changed",
564
+ "unchanged",
565
+ "unsupported"
566
+ ].includes(result.status) || typeof result.text !== "string" || !Array.isArray(result.edits)) throw new Error("Invalid source update response");
567
+ return result;
568
+ },
543
569
  on(event, handler) {
544
570
  events.on(event, handler);
545
571
  },
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
2
2
  import { o as GraphPatch, r as ActionLocation } from "./index-CoxF4Saw.mjs";
3
3
  import { C as EventTypeData, S as DigraphNodeConfig, _ as studioMachineConverter, a as StatelyGraphData, b as DigraphConfig, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, o as StatelyGuard, r as StatelyEdgeData, t as StatelyAction, v as toStudioMachine, w as StateNodeJSONData, x as DigraphEdgeConfig, y as DigraphAction } from "./graph-B6xUxqR5.mjs";
4
- import { $t as createInspectionRoomUrls, B as InspectionSentEvent, D as ExportCallOptions, F as InitOptions, Gt as UploadResult, H as InspectorLoadedEvent, J as MachineVersionAutoSaveOptions, L as InspectionAction, M as INSPECTION_PROTOCOL_VERSION, N as INSPECTION_ROOM_QUERY_PARAM, O as ExportFormat, Q as ProjectEmbedMachine, Qt as createInspectionActorId, U as InspectorSettings, V as InspectionTakenTransition, Yt as ViewerOptions, Zt as assertEmbedExamples, _ as EmbedDocumentLanguage, an as PresentationMetadataInitializer, at as ProjectWorkspaceAction, b as EmbedEventName, ct as ProjectWorkspaceCapabilities, d as CommentsConfig, dt as ProjectWorkspaceMachineOrigin, en as getInspectionRoomId, f as EMBED_DOCUMENT_LANGUAGES, g as EmbedDocument, in as resolveInspectorSettings, k as ExportFormatMap, lt as ProjectWorkspaceConfig, m as EditorCapabilities, n as CapabilityDeniedCapability, nn as isEmbedExampleMachine, on as EmbedPanelConfig, ot as ProjectWorkspaceActionIcon, p as EMBED_DOCUMENT_LIMITS, pt as ProjectWorkspaceProject, r as CapabilityDeniedEvent, rn as mergeInspectorSettings, sn as EmbedPanelPosition, tn as isEmbedExample, ut as ProjectWorkspaceMachine, v as EmbedEventHandler, w as EmbedMode, x as EmbedExample, y as EmbedEventMap } from "./protocol-CP3DSl5u.mjs";
4
+ import { $t as assertEmbedExamples, A as ExportFormatMap, H as InspectionTakenTransition, I as InitOptions, N as INSPECTION_PROTOCOL_VERSION, O as ExportCallOptions, P as INSPECTION_ROOM_QUERY_PARAM, R as InspectionAction, S as EmbedExample, T as EmbedMode, U as InspectorLoadedEvent, V as InspectionSentEvent, W as InspectorSettings, X as MachineVersionAutoSaveOptions, Zt as ViewerOptions, _ as EmbedDocument, an as mergeInspectorSettings, b as EmbedEventMap, cn as EmbedPanelConfig, ct as ProjectWorkspaceActionIcon, dt as ProjectWorkspaceConfig, en as createInspectionActorId, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, in as isEmbedExampleMachine, k as ExportFormat, ln as EmbedPanelPosition, m as EMBED_DOCUMENT_LIMITS, nn as getInspectionRoomId, on as resolveInspectorSettings, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceMachineOrigin, qt as UploadResult, r as CapabilityDeniedCapability, rn as isEmbedExample, sn as PresentationMetadataInitializer, st as ProjectWorkspaceAction, tn as createInspectionRoomUrls, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-CFK_R0rt.mjs";
5
5
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
6
6
  import { StatelyAuthMode, StatelyCredential, createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
7
7
  import { EDITOR_PROTOCOL_VERSION, EditorHostDiagnostic, EditorHostExportFormat, EditorHostInboundMessage, EditorHostInitOptions, EditorHostOutboundMessage, EditorHostValidationIssue } from "./editorHostProtocol.mjs";
8
- import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
9
- import { _ as createWebSocketTransport, a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, g as createPostMessageTransport, h as TransportFailure, i as InspectedSnapshot, l as InspectorEvents, m as Transport, n as CreateInspectorOptions, o as Inspector, p as createStatelyInspector, r as InspectedEvent, s as InspectorConnection, t as AdoptedActor, u as InspectorInspectionEvent } from "./inspect-Douvt5k_.mjs";
8
+ import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, PlanSourceUpdateInput, SourceUpdateEdit, SourceUpdatePlan, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
9
+ import { _ as createWebSocketTransport, a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, g as createPostMessageTransport, h as TransportFailure, i as InspectedSnapshot, l as InspectorEvents, m as Transport, n as CreateInspectorOptions, o as Inspector, p as createStatelyInspector, r as InspectedEvent, s as InspectorConnection, t as AdoptedActor, u as InspectorInspectionEvent } from "./inspect-DV35V81q.mjs";
10
10
  import { A as Machine, C as StudioMachineRecord, D as VerifyApiKeyResponse, E as UpdateProjectInput, F as ProjectVisibility, I as VerifyResult, L as XStateVersion, M as Project, N as ProjectMachineSummary, O as createStatelyClient, P as ProjectSummary, R as ResourceErrorCode, S as StudioClientOptions, T as UpdateMachineInput, _ as ProjectMachine, a as CreateMachineTemplate, b as StudioApiErrorOptions, c as EnsureProjectInput, d as ExtractedMachine, f as GetMachineOptions, g as ProjectData, h as LegacyUpdateMachineInput, i as CreateMachineInput, j as MachineVersion, k as ExtractedMachines, l as ExtractMachinesInput, m as LegacyProjectVisibility, n as CreateMachineFromDefinitionInput, o as CreateProjectInput, r as CreateMachineFromTemplateInput, s as DEFAULT_STATELY_BASE_URL, t as ConnectedRepo, u as ExtractMachinesResponse, v as RepoType, w as StudioRequestOptions, x as StudioClient, y as StudioApiError } from "./studio-DvEgrtk1.mjs";
11
11
  import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
12
12
  import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
13
- export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CommentsConfig, type ConnectedRepo, type CreateInspectionRelayOptions, type CreateInspectorOptions, type CreateMachineFromDefinitionInput, type CreateMachineFromTemplateInput, type CreateMachineInput, type CreateMachineTemplate, type CreateProjectInput, type CreateS3AssetUploadAdapterOptions, type CreateSupabaseAssetUploadAdapterOptions, DEFAULT_STATELY_BASE_URL, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, type EditorCapabilities, type EditorHostDiagnostic, type EditorHostExportFormat, type EditorHostInboundMessage, type EditorHostInitOptions, type EditorHostOutboundMessage, type EditorHostValidationIssue, type EmbedDocument, type EmbedDocumentLanguage, type EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExample, type EmbedFormatContext, type EmbedFormatDefinition, type EmbedGraph, type EmbedMode, type EmbedPanelConfig, type EmbedPanelPosition, type EmbedProfileDefinition, type EnsureProjectInput, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesInput, type ExtractMachinesResponse, type ExtractedMachine, type ExtractedMachines, type GetMachineOptions, type GraphPatch, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, type InitOptions, type InspectedEvent, type InspectedSnapshot, type InspectedTransition, type InspectionAction, type InspectionRelay, type InspectionRelayEffect, type InspectionRelayPeer, type InspectionRelayRole, type InspectionRelaySnapshot, type InspectionSentEvent, type InspectionTakenTransition, type Inspector, type InspectorConnection, type InspectorDiscoveryEntry, type InspectorEvents, type InspectorInspectionEvent, type InspectorLoadedEvent, type InspectorSettings, type LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineVersion, type MachineVersionAutoSaveOptions, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PresentationMetadataInitializer, type Project, type ProjectData, type ProjectEmbedMachine, type ProjectMachine, type ProjectMachineSummary, type ProjectSummary, type ProjectVisibility, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, type RepoType, type ResourceErrorCode, type S3UploadTarget, type StateNodeJSONData, type StatelyAction, type StatelyApiClientOptions, StatelyApiError, type StatelyApiUrlOptions, type StatelyAuthMode, type StatelyCredential, type StatelyEdgeData, type StatelyEmbed, type StatelyEmbedOptions, type StatelyGraph, type StatelyGraphData, type StatelyGuard, type StatelyInvoke, type StatelyNodeData, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type VerifyApiKeyResponse, type VerifyResult, type ViewerOptions, type XStateVersion, assertEmbedExamples, buildAuthorizeUrl, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, fromStudioMachine, getCredentialToken, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, mergeInspectorSettings, refreshToken, registerOAuthClient, resolveInspectorSettings, studioMachineConverter, toStudioMachine };
13
+ export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CommentsConfig, type ConnectedRepo, type CreateInspectionRelayOptions, type CreateInspectorOptions, type CreateMachineFromDefinitionInput, type CreateMachineFromTemplateInput, type CreateMachineInput, type CreateMachineTemplate, type CreateProjectInput, type CreateS3AssetUploadAdapterOptions, type CreateSupabaseAssetUploadAdapterOptions, DEFAULT_STATELY_BASE_URL, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, type EditorCapabilities, type EditorHostDiagnostic, type EditorHostExportFormat, type EditorHostInboundMessage, type EditorHostInitOptions, type EditorHostOutboundMessage, type EditorHostValidationIssue, type EmbedDocument, type EmbedDocumentLanguage, type EmbedEntity, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedExample, type EmbedFormatContext, type EmbedFormatDefinition, type EmbedGraph, type EmbedMode, type EmbedPanelConfig, type EmbedPanelPosition, type EmbedProfileDefinition, type EnsureProjectInput, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesInput, type ExtractMachinesResponse, type ExtractedMachine, type ExtractedMachines, type GetMachineOptions, type GraphPatch, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, type InitOptions, type InspectedEvent, type InspectedSnapshot, type InspectedTransition, type InspectionAction, type InspectionRelay, type InspectionRelayEffect, type InspectionRelayPeer, type InspectionRelayRole, type InspectionRelaySnapshot, type InspectionSentEvent, type InspectionTakenTransition, type Inspector, type InspectorConnection, type InspectorDiscoveryEntry, type InspectorEvents, type InspectorInspectionEvent, type InspectorLoadedEvent, type InspectorSettings, type LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineVersion, type MachineVersionAutoSaveOptions, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSourceUpdateInput, type PresentationMetadataInitializer, type Project, type ProjectData, type ProjectEmbedMachine, type ProjectMachine, type ProjectMachineSummary, type ProjectSummary, type ProjectVisibility, type ProjectWorkspaceAction, type ProjectWorkspaceActionIcon, type ProjectWorkspaceCapabilities, type ProjectWorkspaceConfig, type ProjectWorkspaceMachine, type ProjectWorkspaceMachineOrigin, type ProjectWorkspaceProject, type RepoType, type ResourceErrorCode, type S3UploadTarget, type SourceUpdateEdit, type SourceUpdatePlan, type StateNodeJSONData, type StatelyAction, type StatelyApiClientOptions, StatelyApiError, type StatelyApiUrlOptions, type StatelyAuthMode, type StatelyCredential, type StatelyEdgeData, type StatelyEmbed, type StatelyEmbedOptions, type StatelyGraph, type StatelyGraphData, type StatelyGuard, type StatelyInvoke, type StatelyNodeData, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type VerifyApiKeyResponse, type VerifyResult, type ViewerOptions, type XStateVersion, assertEmbedExamples, buildAuthorizeUrl, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, fromStudioMachine, getCredentialToken, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, mergeInspectorSettings, refreshToken, registerOAuthClient, resolveInspectorSettings, studioMachineConverter, toStudioMachine };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
1
  import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-DhzM6zFx.mjs";
2
2
  import { c as createInspectionRoomUrls, d as isEmbedExampleMachine, f as mergeInspectorSettings, i as INSPECTION_ROOM_QUERY_PARAM, l as getInspectionRoomId, n as EMBED_DOCUMENT_LIMITS, o as assertEmbedExamples, p as resolveInspectorSettings, r as INSPECTION_PROTOCOL_VERSION, s as createInspectionActorId, t as EMBED_DOCUMENT_LANGUAGES, u as isEmbedExample } from "./protocol-BsBGRISR.mjs";
3
- import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-DS2izNeF.mjs";
3
+ import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-jzP2mGvy.mjs";
4
4
  import { EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol.mjs";
5
5
  import { createStatelyEmbed } from "./embed.mjs";
6
6
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
7
- import { n as createStatelyInspector, t as createInspector } from "./inspect-BoMln78S.mjs";
7
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-CLeyY8Yw.mjs";
8
8
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
9
9
  import { buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
10
10
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
@@ -1,5 +1,5 @@
1
1
  import { c as createInspectionRoomUrls, f as mergeInspectorSettings, l as getInspectionRoomId, p as resolveInspectorSettings, r as INSPECTION_PROTOCOL_VERSION } from "./protocol-BsBGRISR.mjs";
2
- import { a as assertEmbedDocuments, c as createPendingExportManager, i as createWebSocketTransport, n as inspectionRuntime, o as assertEmbedPanels, s as createEventRegistry, t as SDK_VERSION } from "./version-DS2izNeF.mjs";
2
+ import { a as assertEmbedDocuments, c as createPendingExportManager, i as createWebSocketTransport, n as inspectionRuntime, o as assertEmbedPanels, s as createEventRegistry, t as SDK_VERSION } from "./version-jzP2mGvy.mjs";
3
3
 
4
4
  //#region src/openBrowser.ts
5
5
  async function openBrowser(url) {
@@ -96,15 +96,22 @@ function createInspector(options = {}) {
96
96
  inspectorBaseUrl
97
97
  });
98
98
  const relayUrl = roomUrls?.relayUrl ?? null;
99
- const inspectorUrl = roomUrls?.inspectorUrl ?? null;
99
+ const getInspectorUrl = () => {
100
+ if (!roomUrls?.inspectorUrl) return null;
101
+ const url = new URL(roomUrls.inspectorUrl);
102
+ url.searchParams.set("theme", viewerSettings.appearance?.colorMode ?? "dark");
103
+ return url.toString();
104
+ };
100
105
  const connection = {
101
- inspectorUrl,
106
+ get inspectorUrl() {
107
+ return getInspectorUrl();
108
+ },
102
109
  relayUrl,
103
110
  roomId,
104
111
  producerId
105
112
  };
106
113
  const displayName = name ?? "system:manual";
107
- if (inspectorUrl && launch === "none") console.info(`[Stately Inspector] ${inspectorUrl}`);
114
+ if (connection.inspectorUrl && launch === "none") console.info(`[Stately Inspector] ${connection.inspectorUrl}`);
108
115
  const browserRegistry = isBrowserRuntime() ? getBrowserInspectorRegistry() : void 0;
109
116
  browserRegistry?.set(producerId, connection);
110
117
  const browserLaunchUnsupported = launch === "browser" && isBrowserRuntime();
@@ -189,7 +196,8 @@ function createInspector(options = {}) {
189
196
  events.emit("error", failure);
190
197
  return;
191
198
  }
192
- if (inspectorUrl) openBrowser(inspectorUrl).catch((error) => {
199
+ const url = connection.inspectorUrl;
200
+ if (url) openBrowser(url).catch((error) => {
193
201
  const failure = {
194
202
  code: "open_failed",
195
203
  message: error instanceof Error ? error.message : "Unable to open the inspector browser"
@@ -778,7 +786,9 @@ function createInspector(options = {}) {
778
786
  get sessionId() {
779
787
  return roomId;
780
788
  },
781
- inspectorUrl,
789
+ get inspectorUrl() {
790
+ return connection.inspectorUrl;
791
+ },
782
792
  ready,
783
793
  inspect: safelyHandleInspectionEvent,
784
794
  attach: attachActor,
@@ -1,4 +1,4 @@
1
- import { B as InspectionSentEvent, D as ExportCallOptions, H as InspectorLoadedEvent, K as MachinePayload, L as InspectionAction, O as ExportFormat, R as InspectionClientMetadata, U as InspectorSettings, V as InspectionTakenTransition, Yt as ViewerOptions, k as ExportFormatMap, mt as ProtocolMessage, y as EmbedEventMap } from "./protocol-CP3DSl5u.mjs";
1
+ import { A as ExportFormatMap, H as InspectionTakenTransition, J as MachinePayload, O as ExportCallOptions, R as InspectionAction, U as InspectorLoadedEvent, V as InspectionSentEvent, W as InspectorSettings, Zt as ViewerOptions, b as EmbedEventMap, gt as ProtocolMessage, k as ExportFormat, z as InspectionClientMetadata } from "./protocol-CFK_R0rt.mjs";
2
2
 
3
3
  //#region src/transport.d.ts
4
4
  interface TransportFailure {
@@ -1,3 +1,3 @@
1
- import { B as InspectionSentEvent, D as ExportCallOptions, H as InspectorLoadedEvent, K as MachinePayload, L as InspectionAction, O as ExportFormat, U as InspectorSettings, V as InspectionTakenTransition, Yt as ViewerOptions, b as EmbedEventName, g as EmbedDocument, k as ExportFormatMap, m as EditorCapabilities, on as EmbedPanelConfig, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-CP3DSl5u.mjs";
2
- import { a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, i as InspectedSnapshot, l as InspectorEvents, m as Transport, n as CreateInspectorOptions, o as Inspector, p as createStatelyInspector, r as InspectedEvent, s as InspectorConnection, t as AdoptedActor, u as InspectorInspectionEvent } from "./inspect-Douvt5k_.mjs";
1
+ import { A as ExportFormatMap, H as InspectionTakenTransition, J as MachinePayload, O as ExportCallOptions, R as InspectionAction, T as EmbedMode, U as InspectorLoadedEvent, V as InspectionSentEvent, W as InspectorSettings, Zt as ViewerOptions, _ as EmbedDocument, b as EmbedEventMap, cn as EmbedPanelConfig, h as EditorCapabilities, k as ExportFormat, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-CFK_R0rt.mjs";
2
+ import { a as InspectedTransition, c as InspectorDiscoveryEntry, d as ManualActorOptions, f as createInspector, i as InspectedSnapshot, l as InspectorEvents, m as Transport, n as CreateInspectorOptions, o as Inspector, p as createStatelyInspector, r as InspectedEvent, s as InspectorConnection, t as AdoptedActor, u as InspectorInspectionEvent } from "./inspect-DV35V81q.mjs";
3
3
  export { AdoptedActor, CreateInspectorOptions, EditorCapabilities, EmbedDocument, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, EmbedPanelConfig, ExportCallOptions, ExportFormat, ExportFormatMap, InspectedEvent, InspectedSnapshot, InspectedTransition, InspectionAction, InspectionSentEvent, InspectionTakenTransition, Inspector, InspectorConnection, InspectorDiscoveryEntry, InspectorEvents, InspectorInspectionEvent, InspectorLoadedEvent, InspectorSettings, MachinePayload, ManualActorOptions, Transport, ViewerOptions, createInspector, createStatelyInspector };
package/dist/inspect.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import "./protocol-BsBGRISR.mjs";
2
- import "./version-DS2izNeF.mjs";
3
- import { n as createStatelyInspector, t as createInspector } from "./inspect-BoMln78S.mjs";
2
+ import "./version-jzP2mGvy.mjs";
3
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-CLeyY8Yw.mjs";
4
4
 
5
5
  export { createInspector, createStatelyInspector };
@@ -273,6 +273,7 @@ interface EmbedEventMap {
273
273
  };
274
274
  save: {
275
275
  requestId?: string;
276
+ serialized?: Record<string, string>;
276
277
  graph: StatelyGraph;
277
278
  machineConfig: unknown;
278
279
  machineId?: string;
@@ -692,6 +693,8 @@ interface ChangeMessage {
692
693
  }
693
694
  interface SaveMessage {
694
695
  type: '@statelyai.save';
696
+ /** Internal persistence payload; independent of user export capability. */
697
+ serialized?: Record<string, string>;
695
698
  requestId?: string;
696
699
  graph: StatelyGraph;
697
700
  machineConfig: unknown;
@@ -767,6 +770,16 @@ interface ErrorMessage {
767
770
  /** Per-problem explanations, e.g. one line per structural graph error. */
768
771
  details?: string[];
769
772
  requestId?: string;
773
+ /** Host-specific sign-in recovery for an authentication failure. */
774
+ authenticationRecovery?: AuthenticationRecovery;
775
+ }
776
+ interface AuthenticationRecovery {
777
+ host: 'cli' | 'vscode';
778
+ /** The host accepts @statelyai.login and retries initialization afterward. */
779
+ canLogin?: boolean;
780
+ }
781
+ interface LoginMessage {
782
+ type: '@statelyai.login';
770
783
  }
771
784
  interface CapabilityDeniedMessage extends CapabilityDeniedEvent {
772
785
  type: '@statelyai.capabilityDenied';
@@ -827,7 +840,7 @@ interface ExtensionResultMessage {
827
840
  /** All messages a client (embed/inspector) can send to the viz. */
828
841
  type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | ProjectSetWorkspaceOpenMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | ToastDismissMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
829
842
  /** All messages the viz can send back to a client. */
830
- type VizMessage = SystemLoadedMessage | ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | VersionSaveRequestedMessage | ProjectMachineSelectedMessage | ProjectWorkspaceActionMessage | ProjectWorkspaceOpenChangedMessage | ViewModeChangedMessage | PanelChangedMessage | ModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
843
+ type VizMessage = LoginMessage | SystemLoadedMessage | ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | VersionSaveRequestedMessage | ProjectMachineSelectedMessage | ProjectWorkspaceActionMessage | ProjectWorkspaceOpenChangedMessage | ViewModeChangedMessage | PanelChangedMessage | ModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
831
844
  interface InspectionClientMetadata {
832
845
  name?: string;
833
846
  machineId?: string;
@@ -856,4 +869,4 @@ declare const PREFIX = "@statelyai.";
856
869
  /** Current WebSocket inspection protocol version. */
857
870
  declare const INSPECTION_PROTOCOL_VERSION = 2;
858
871
  //#endregion
859
- export { ProjectInitMessage as $, createInspectionRoomUrls as $t, ExtensionCallMessage as A, StateSourceLocation as At, InspectionSentEvent as B, UpdateMessage as Bt, EmbedFormatManifest as C, SessionMessage as Ct, ExportCallOptions as D, SetThemeMessage as Dt, ErrorMessage as E, SetSettingsMessage as Et, InitOptions as F, SystemInitMessage as Ft, MachineInitOptions as G, UploadResult as Gt, InspectorLoadedEvent as H, UploadFileInfo as Ht, InspectSnapshotMessage as I, SystemLoadedMessage as It, MachineVersionAutoSaveOptions as J, ViewModeChangedMessage as Jt, MachinePayload as K, ValidationIssue as Kt, InspectionAction as L, SystemSelectActorMessage as Lt, INSPECTION_PROTOCOL_VERSION as M, SystemActorRegisteredMessage as Mt, INSPECTION_ROOM_QUERY_PARAM as N, SystemActorSnapshotMessage as Nt, ExportFormat as O, SourceLocation as Ot, InitMessage as P, SystemActorStoppedMessage as Pt, ProjectEmbedMachine as Q, createInspectionActorId as Qt, InspectionClientMetadata as R, ToastDismissMessage as Rt, EmbedExtensionsManifest as S, SavedMessage as St, ErrorCode as T, SetModeMessage as Tt, InspectorSettings as U, UploadRequestMessage as Ut, InspectionTakenTransition as V, UploadCapabilitiesMessage as Vt, LoadedMessage as W, UploadResponseMessage as Wt, PREFIX as X, VizMessage as Xt, ModeChangedMessage as Y, ViewerOptions as Yt, PanelChangedMessage as Z, assertEmbedExamples as Zt, EmbedDocumentLanguage as _, RegisterMessage as _t, ChangeMessage as a, PresentationMetadataInitializer as an, ProjectWorkspaceAction as at, EmbedEventName as b, RetrievedMessage as bt, ClipboardReadResponseMessage as c, ProjectWorkspaceCapabilities as ct, CommentsConfig as d, ProjectWorkspaceMachineOrigin as dt, getInspectionRoomId as en, ProjectInitOptions as et, EMBED_DOCUMENT_LANGUAGES as f, ProjectWorkspaceOpenChangedMessage as ft, EmbedDocument as g, ReadyMessage as gt, EditorHandshakeMessage as h, ReadOnlyReason as ht, CapabilityDeniedMessage as i, resolveInspectorSettings as in, ProjectUpdateMessage as it, ExtensionResultMessage as j, SystemActorEventMessage as jt, ExportFormatMap as k, SourceRange as kt, ClipboardWriteMessage as l, ProjectWorkspaceConfig as lt, EditorCapabilities as m, ProtocolMessage as mt, CapabilityDeniedCapability as n, isEmbedExampleMachine as nn, ProjectSelectMachineMessage as nt, ClientMessage as o, EmbedPanelConfig as on, ProjectWorkspaceActionIcon as ot, EMBED_DOCUMENT_LIMITS as p, ProjectWorkspaceProject as pt, MachineSourceLocations as q, VersionSaveRequestedMessage as qt, CapabilityDeniedEvent as r, mergeInspectorSettings as rn, ProjectSetWorkspaceOpenMessage as rt, ClipboardReadMessage as s, EmbedPanelPosition as sn, ProjectWorkspaceActionMessage as st, ActorSystemEntry as t, isEmbedExample as tn, ProjectMachineSelectedMessage as tt, ClipboardWriteResponseMessage as u, ProjectWorkspaceMachine as ut, EmbedEventHandler as v, RegisteredMessage as vt, EmbedMode as w, SetApiKeyMessage as wt, EmbedExample as x, SaveMessage as xt, EmbedEventMap as y, RetrieveMessage as yt, InspectionRoomUrls as z, ToastMessage as zt };
872
+ export { PanelChangedMessage as $, assertEmbedExamples as $t, ExportFormatMap as A, SourceLocation as At, InspectionRoomUrls as B, ToastDismissMessage as Bt, EmbedExtensionsManifest as C, SaveMessage as Ct, ErrorMessage as D, SetModeMessage as Dt, ErrorCode as E, SetApiKeyMessage as Et, InitMessage as F, SystemActorSnapshotMessage as Ft, LoadedMessage as G, UploadRequestMessage as Gt, InspectionTakenTransition as H, UpdateMessage as Ht, InitOptions as I, SystemActorStoppedMessage as It, MachinePayload as J, ValidationIssue as Jt, LoginMessage as K, UploadResponseMessage as Kt, InspectSnapshotMessage as L, SystemInitMessage as Lt, ExtensionResultMessage as M, StateSourceLocation as Mt, INSPECTION_PROTOCOL_VERSION as N, SystemActorEventMessage as Nt, ExportCallOptions as O, SetSettingsMessage as Ot, INSPECTION_ROOM_QUERY_PARAM as P, SystemActorRegisteredMessage as Pt, PREFIX as Q, VizMessage as Qt, InspectionAction as R, SystemLoadedMessage as Rt, EmbedExample as S, RetrievedMessage as St, EmbedMode as T, SessionMessage as Tt, InspectorLoadedEvent as U, UploadCapabilitiesMessage as Ut, InspectionSentEvent as V, ToastMessage as Vt, InspectorSettings as W, UploadFileInfo as Wt, MachineVersionAutoSaveOptions as X, ViewModeChangedMessage as Xt, MachineSourceLocations as Y, VersionSaveRequestedMessage as Yt, ModeChangedMessage as Z, ViewerOptions as Zt, EmbedDocument as _, ReadOnlyReason as _t, CapabilityDeniedMessage as a, mergeInspectorSettings as an, ProjectSetWorkspaceOpenMessage as at, EmbedEventMap as b, RegisteredMessage as bt, ClipboardReadMessage as c, EmbedPanelConfig as cn, ProjectWorkspaceActionIcon as ct, ClipboardWriteResponseMessage as d, ProjectWorkspaceConfig as dt, createInspectionActorId as en, ProjectEmbedMachine as et, CommentsConfig as f, ProjectWorkspaceMachine as ft, EditorHandshakeMessage as g, ProtocolMessage as gt, EditorCapabilities as h, ProjectWorkspaceProject as ht, CapabilityDeniedEvent as i, isEmbedExampleMachine as in, ProjectSelectMachineMessage as it, ExtensionCallMessage as j, SourceRange as jt, ExportFormat as k, SetThemeMessage as kt, ClipboardReadResponseMessage as l, EmbedPanelPosition as ln, ProjectWorkspaceActionMessage as lt, EMBED_DOCUMENT_LIMITS as m, ProjectWorkspaceOpenChangedMessage as mt, AuthenticationRecovery as n, getInspectionRoomId as nn, ProjectInitOptions as nt, ChangeMessage as o, resolveInspectorSettings as on, ProjectUpdateMessage as ot, EMBED_DOCUMENT_LANGUAGES as p, ProjectWorkspaceMachineOrigin as pt, MachineInitOptions as q, UploadResult as qt, CapabilityDeniedCapability as r, isEmbedExample as rn, ProjectMachineSelectedMessage as rt, ClientMessage as s, PresentationMetadataInitializer as sn, ProjectWorkspaceAction as st, ActorSystemEntry as t, createInspectionRoomUrls as tn, ProjectInitMessage as tt, ClipboardWriteMessage as u, ProjectWorkspaceCapabilities as ut, EmbedDocumentLanguage as v, ReadyMessage as vt, EmbedFormatManifest as w, SavedMessage as wt, EmbedEventName as x, RetrieveMessage as xt, EmbedEventHandler as y, RegisterMessage as yt, InspectionClientMetadata as z, SystemSelectActorMessage as zt };
@@ -1,2 +1,2 @@
1
- import { $ as ProjectInitMessage, $t as createInspectionRoomUrls, A as ExtensionCallMessage, At as StateSourceLocation, B as InspectionSentEvent, Bt as UpdateMessage, C as EmbedFormatManifest, Ct as SessionMessage, D as ExportCallOptions, Dt as SetThemeMessage, E as ErrorMessage, Et as SetSettingsMessage, F as InitOptions, Ft as SystemInitMessage, G as MachineInitOptions, Gt as UploadResult, H as InspectorLoadedEvent, Ht as UploadFileInfo, I as InspectSnapshotMessage, It as SystemLoadedMessage, J as MachineVersionAutoSaveOptions, Jt as ViewModeChangedMessage, K as MachinePayload, Kt as ValidationIssue, L as InspectionAction, Lt as SystemSelectActorMessage, M as INSPECTION_PROTOCOL_VERSION, Mt as SystemActorRegisteredMessage, N as INSPECTION_ROOM_QUERY_PARAM, Nt as SystemActorSnapshotMessage, O as ExportFormat, Ot as SourceLocation, P as InitMessage, Pt as SystemActorStoppedMessage, Q as ProjectEmbedMachine, Qt as createInspectionActorId, R as InspectionClientMetadata, Rt as ToastDismissMessage, S as EmbedExtensionsManifest, St as SavedMessage, T as ErrorCode, Tt as SetModeMessage, U as InspectorSettings, Ut as UploadRequestMessage, V as InspectionTakenTransition, Vt as UploadCapabilitiesMessage, W as LoadedMessage, Wt as UploadResponseMessage, X as PREFIX, Xt as VizMessage, Y as ModeChangedMessage, Yt as ViewerOptions, Z as PanelChangedMessage, Zt as assertEmbedExamples, _ as EmbedDocumentLanguage, _t as RegisterMessage, a as ChangeMessage, at as ProjectWorkspaceAction, b as EmbedEventName, bt as RetrievedMessage, c as ClipboardReadResponseMessage, ct as ProjectWorkspaceCapabilities, d as CommentsConfig, dt as ProjectWorkspaceMachineOrigin, en as getInspectionRoomId, et as ProjectInitOptions, f as EMBED_DOCUMENT_LANGUAGES, ft as ProjectWorkspaceOpenChangedMessage, g as EmbedDocument, gt as ReadyMessage, h as EditorHandshakeMessage, ht as ReadOnlyReason, i as CapabilityDeniedMessage, in as resolveInspectorSettings, it as ProjectUpdateMessage, j as ExtensionResultMessage, jt as SystemActorEventMessage, k as ExportFormatMap, kt as SourceRange, l as ClipboardWriteMessage, lt as ProjectWorkspaceConfig, m as EditorCapabilities, mt as ProtocolMessage, n as CapabilityDeniedCapability, nn as isEmbedExampleMachine, nt as ProjectSelectMachineMessage, o as ClientMessage, on as EmbedPanelConfig, ot as ProjectWorkspaceActionIcon, p as EMBED_DOCUMENT_LIMITS, pt as ProjectWorkspaceProject, q as MachineSourceLocations, qt as VersionSaveRequestedMessage, r as CapabilityDeniedEvent, rn as mergeInspectorSettings, rt as ProjectSetWorkspaceOpenMessage, s as ClipboardReadMessage, sn as EmbedPanelPosition, st as ProjectWorkspaceActionMessage, t as ActorSystemEntry, tn as isEmbedExample, tt as ProjectMachineSelectedMessage, u as ClipboardWriteResponseMessage, ut as ProjectWorkspaceMachine, v as EmbedEventHandler, vt as RegisteredMessage, w as EmbedMode, wt as SetApiKeyMessage, x as EmbedExample, xt as SaveMessage, y as EmbedEventMap, yt as RetrieveMessage, z as InspectionRoomUrls, zt as ToastMessage } from "./protocol-CP3DSl5u.mjs";
2
- 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, EmbedExample, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, EmbedPanelConfig, EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, InspectorLoadedEvent, InspectorSettings, LoadedMessage, MachineInitOptions, MachinePayload, MachineSourceLocations, MachineVersionAutoSaveOptions, ModeChangedMessage, PREFIX, PanelChangedMessage, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectSetWorkspaceOpenMessage, ProjectUpdateMessage, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceActionMessage, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, ProjectWorkspaceOpenChangedMessage, ProjectWorkspaceProject, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemLoadedMessage, SystemSelectActorMessage, ToastDismissMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, ViewerOptions, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, mergeInspectorSettings, resolveInspectorSettings };
1
+ import { $ as PanelChangedMessage, $t as assertEmbedExamples, A as ExportFormatMap, At as SourceLocation, B as InspectionRoomUrls, Bt as ToastDismissMessage, C as EmbedExtensionsManifest, Ct as SaveMessage, D as ErrorMessage, Dt as SetModeMessage, E as ErrorCode, Et as SetApiKeyMessage, F as InitMessage, Ft as SystemActorSnapshotMessage, G as LoadedMessage, Gt as UploadRequestMessage, H as InspectionTakenTransition, Ht as UpdateMessage, I as InitOptions, It as SystemActorStoppedMessage, J as MachinePayload, Jt as ValidationIssue, K as LoginMessage, Kt as UploadResponseMessage, L as InspectSnapshotMessage, Lt as SystemInitMessage, M as ExtensionResultMessage, Mt as StateSourceLocation, N as INSPECTION_PROTOCOL_VERSION, Nt as SystemActorEventMessage, O as ExportCallOptions, Ot as SetSettingsMessage, P as INSPECTION_ROOM_QUERY_PARAM, Pt as SystemActorRegisteredMessage, Q as PREFIX, Qt as VizMessage, R as InspectionAction, Rt as SystemLoadedMessage, S as EmbedExample, St as RetrievedMessage, T as EmbedMode, Tt as SessionMessage, U as InspectorLoadedEvent, Ut as UploadCapabilitiesMessage, V as InspectionSentEvent, Vt as ToastMessage, W as InspectorSettings, Wt as UploadFileInfo, X as MachineVersionAutoSaveOptions, Xt as ViewModeChangedMessage, Y as MachineSourceLocations, Yt as VersionSaveRequestedMessage, Z as ModeChangedMessage, Zt as ViewerOptions, _ as EmbedDocument, _t as ReadOnlyReason, a as CapabilityDeniedMessage, an as mergeInspectorSettings, at as ProjectSetWorkspaceOpenMessage, b as EmbedEventMap, bt as RegisteredMessage, c as ClipboardReadMessage, cn as EmbedPanelConfig, ct as ProjectWorkspaceActionIcon, d as ClipboardWriteResponseMessage, dt as ProjectWorkspaceConfig, en as createInspectionActorId, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, g as EditorHandshakeMessage, gt as ProtocolMessage, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, in as isEmbedExampleMachine, it as ProjectSelectMachineMessage, j as ExtensionCallMessage, jt as SourceRange, k as ExportFormat, kt as SetThemeMessage, l as ClipboardReadResponseMessage, ln as EmbedPanelPosition, lt as ProjectWorkspaceActionMessage, m as EMBED_DOCUMENT_LIMITS, mt as ProjectWorkspaceOpenChangedMessage, n as AuthenticationRecovery, nn as getInspectionRoomId, nt as ProjectInitOptions, o as ChangeMessage, on as resolveInspectorSettings, ot as ProjectUpdateMessage, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceMachineOrigin, q as MachineInitOptions, qt as UploadResult, r as CapabilityDeniedCapability, rn as isEmbedExample, rt as ProjectMachineSelectedMessage, s as ClientMessage, st as ProjectWorkspaceAction, t as ActorSystemEntry, tn as createInspectionRoomUrls, tt as ProjectInitMessage, u as ClipboardWriteMessage, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, vt as ReadyMessage, w as EmbedFormatManifest, wt as SavedMessage, x as EmbedEventName, xt as RetrieveMessage, y as EmbedEventHandler, yt as RegisterMessage, z as InspectionClientMetadata, zt as SystemSelectActorMessage } from "./protocol-CFK_R0rt.mjs";
2
+ export { ActorSystemEntry, AuthenticationRecovery, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExample, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, EmbedPanelConfig, EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, InspectorLoadedEvent, InspectorSettings, LoadedMessage, LoginMessage, MachineInitOptions, MachinePayload, MachineSourceLocations, MachineVersionAutoSaveOptions, ModeChangedMessage, PREFIX, PanelChangedMessage, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectSetWorkspaceOpenMessage, ProjectUpdateMessage, ProjectWorkspaceAction, ProjectWorkspaceActionIcon, ProjectWorkspaceActionMessage, ProjectWorkspaceCapabilities, ProjectWorkspaceConfig, ProjectWorkspaceMachine, ProjectWorkspaceMachineOrigin, ProjectWorkspaceOpenChangedMessage, ProjectWorkspaceProject, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemLoadedMessage, SystemSelectActorMessage, ToastDismissMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, ViewerOptions, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, mergeInspectorSettings, resolveInspectorSettings };
package/dist/relay.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { mt as ProtocolMessage } from "./protocol-CP3DSl5u.mjs";
1
+ import { gt as ProtocolMessage } from "./protocol-CFK_R0rt.mjs";
2
2
 
3
3
  //#region src/relay.d.ts
4
4
  type InspectionRelayRole = 'producer' | 'viewer';
@@ -378,7 +378,7 @@ function createWebSocketTransport(options) {
378
378
 
379
379
  //#endregion
380
380
  //#region src/version.ts
381
- const SDK_VERSION = "0.36.0";
381
+ const SDK_VERSION = "0.37.2";
382
382
  function inspectionRuntime() {
383
383
  if (typeof window !== "undefined") return "browser";
384
384
  if (typeof process !== "undefined" && process.versions?.node) return "node";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.36.0",
3
+ "version": "0.37.2",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "stately-sdk": "./dist/bin.mjs"
@@ -89,8 +89,8 @@
89
89
  "typescript": "^5.9.3",
90
90
  "ws": "^8.19.0",
91
91
  "xstate": "^5.0.0",
92
- "@statelyai/graph-tools": "0.9.1",
93
- "@statelyai/api-contract": "0.5.3"
92
+ "@statelyai/api-contract": "0.5.4",
93
+ "@statelyai/graph-tools": "0.9.2"
94
94
  },
95
95
  "engines": {
96
96
  "node": ">=22.4"