@statelyai/sdk 0.33.0 → 0.34.1

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.
Files changed (40) hide show
  1. package/README.md +21 -4
  2. package/dist/assetStorage.d.mts +1 -1
  3. package/dist/auth.d.mts +1 -1
  4. package/dist/bin.mjs +1 -0
  5. package/dist/{dist-wbhkeGh6.mjs → dist-NJFkDQjK.mjs} +170 -77
  6. package/dist/{editorHostSession-DfmHzpls.mjs → editorHostSession-Bj5YcijC.mjs} +2 -2
  7. package/dist/{editorHostSession-C6yxOmSO.d.mts → editorHostSession-DBLSyHJs.d.mts} +2 -2
  8. package/dist/editorHostSession.d.mts +1 -1
  9. package/dist/editorHostSession.mjs +3 -3
  10. package/dist/embed.d.mts +4 -4
  11. package/dist/embed.mjs +5 -4
  12. package/dist/{graph-CR_g-mOq.d.mts → graph-Ciocekxl.d.mts} +1 -1
  13. package/dist/graph.d.mts +1 -1
  14. package/dist/{index-DlOZxzrW.d.mts → index-DZivqh0u.d.mts} +21 -4
  15. package/dist/index.d.mts +8 -8
  16. package/dist/index.mjs +9 -9
  17. package/dist/{inspect-CunxIl8H.d.mts → inspect-BbvfH0Q1.d.mts} +18 -9
  18. package/dist/{inspect-C-eEfU3T.mjs → inspect-DW30GMge.mjs} +45 -7
  19. package/dist/inspect.d.mts +3 -3
  20. package/dist/inspect.mjs +3 -2
  21. package/dist/node-relay.mjs +1 -1
  22. package/dist/patchTypes.d.mts +1 -1
  23. package/dist/{protocol-CQL9Ubt9.d.mts → protocol-B7q2lWj_.d.mts} +48 -76
  24. package/dist/protocol-BsBGRISR.mjs +116 -0
  25. package/dist/protocol.d.mts +2 -2
  26. package/dist/protocol.mjs +2 -86
  27. package/dist/relay.d.mts +1 -1
  28. package/dist/relay.mjs +23 -3
  29. package/dist/{studio-rSI54Ese.mjs → studio-BZP6DaIO.mjs} +50 -15
  30. package/dist/{studio-DV5IIGhV.d.mts → studio-CKdEPGKY.d.mts} +56 -17
  31. package/dist/studio.d.mts +1 -1
  32. package/dist/studio.mjs +1 -1
  33. package/dist/sync.d.mts +2 -2
  34. package/dist/sync.mjs +5 -10
  35. package/dist/{version-BblbkW8-.mjs → version-BEfUEyPL.mjs} +17 -5
  36. package/package.json +3 -3
  37. /package/dist/{auth-Dg7prjeL.d.mts → auth-CVFc85uF.d.mts} +0 -0
  38. /package/dist/{editor-sync-types-CPpzTSnT.d.mts → editor-sync-types-D7YYz6fb.d.mts} +0 -0
  39. /package/dist/{editorHostProtocol-Bko7wge8.mjs → editorHostProtocol-B2_t3Le7.mjs} +0 -0
  40. /package/dist/{statelyPragma-D46lczJR.mjs → statelyPragma-YtVaBuIe.mjs} +0 -0
package/dist/embed.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { i as ProfileManifest } from "./index-DlOZxzrW.mjs";
2
- import { i as StatelyGraph } from "./graph-CR_g-mOq.mjs";
3
- import { $t as EmbedPanelConfig, D as ExportCallOptions, F as InitOptions, G as MachineSourceLocations, Ht as UploadResult, K as MachineVersionAutoSaveOptions, O as ExportFormat, Q as ProjectInitOptions, S as EmbedExtensionsManifest, U as MachineInitOptions, X as ProjectEmbedMachine, _ as EmbedDocumentLanguage, b as EmbedEventName, ct as ProjectWorkspaceMachine, d as CommentsConfig, dt as ProjectWorkspaceProject, en as EmbedPanelPosition, g as EmbedDocument, it as ProjectWorkspaceActionIcon, k as ExportFormatMap, lt as ProjectWorkspaceMachineOrigin, m as EditorCapabilities, ot as ProjectWorkspaceCapabilities, r as CapabilityDeniedEvent, rt as ProjectWorkspaceAction, st as ProjectWorkspaceConfig, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-CQL9Ubt9.mjs";
1
+ import { i as ProfileManifest } from "./index-DZivqh0u.mjs";
2
+ import { i as StatelyGraph } from "./graph-Ciocekxl.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, an as EmbedPanelConfig, 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 EmbedPanelPosition, ot as ProjectWorkspaceActionIcon, pt as ProjectWorkspaceProject, q as MachineSourceLocations, r as CapabilityDeniedEvent, ut as ProjectWorkspaceMachine, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-B7q2lWj_.mjs";
4
4
  import { AssetUploadAdapter } from "./assetStorage.mjs";
5
5
 
6
6
  //#region src/embed.d.ts
@@ -152,4 +152,4 @@ interface StatelyEmbed {
152
152
  }
153
153
  declare function createStatelyEmbed(options: StatelyEmbedOptions): StatelyEmbed;
154
154
  //#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, createStatelyEmbed };
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 };
package/dist/embed.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-BblbkW8-.mjs";
2
- import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
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-BEfUEyPL.mjs";
3
+ import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-B2_t3Le7.mjs";
3
4
 
4
5
  //#region src/embed.ts
5
6
  function isRecord(value) {
@@ -91,7 +92,7 @@ function extractInitOptions(options) {
91
92
  projectWorkspace: options.projectWorkspace,
92
93
  projectWorkspaceOpen: options.projectWorkspaceOpen,
93
94
  chrome: options.chrome,
94
- settings: options.settings,
95
+ settings: settingsWithViewMode(options),
95
96
  unsavedIndicator: options.unsavedIndicator,
96
97
  versionAutoSave: options.versionAutoSave
97
98
  };
@@ -110,7 +111,7 @@ function extractInitOptions(options) {
110
111
  panels: options.panels,
111
112
  comments: options.comments,
112
113
  sourceLocations: options.sourceLocations,
113
- settings: options.settings,
114
+ settings: settingsWithViewMode(options),
114
115
  unsavedIndicator: options.unsavedIndicator,
115
116
  versionAutoSave: options.versionAutoSave
116
117
  };
@@ -1,4 +1,4 @@
1
- import { t as CodeExpression } from "./index-DlOZxzrW.mjs";
1
+ import { t as CodeExpression } from "./index-DZivqh0u.mjs";
2
2
  import * as _statelyai_graph0 from "@statelyai/graph";
3
3
  import { Graph } from "@statelyai/graph";
4
4
 
package/dist/graph.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { _ as studioMachineConverter, a as StatelyGraphData, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, n as StatelyActorImplementation, o as StatelyGuard, p as StudioEventTypeData, r as StatelyEdgeData, s as StatelyImplementation, t as StatelyAction, u as StatelyTagImplementation, v as toStudioMachine } from "./graph-CR_g-mOq.mjs";
1
+ import { _ as studioMachineConverter, a as StatelyGraphData, c as StatelyInvoke, d as StudioAction, f as StudioEdge, g as fromStudioMachine, h as StudioNode, i as StatelyGraph, l as StatelyNodeData, m as StudioMachine, n as StatelyActorImplementation, o as StatelyGuard, p as StudioEventTypeData, r as StatelyEdgeData, s as StatelyImplementation, t as StatelyAction, u as StatelyTagImplementation, v as toStudioMachine } from "./graph-Ciocekxl.mjs";
2
2
  export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };
@@ -2904,11 +2904,28 @@ declare function graphToMachineConfig(graph: CodeGenGraph, options?: MachineConf
2904
2904
  */
2905
2905
  declare class RawCode {
2906
2906
  code: string;
2907
- constructor(code: string);
2908
- }
2909
- declare function raw(code: string): RawCode;
2907
+ sourceValue?: object | undefined;
2908
+ sourceSlice?: {
2909
+ from: number;
2910
+ to: number;
2911
+ } | undefined;
2912
+ constructor(code: string, sourceValue?: object | undefined, sourceSlice?: {
2913
+ from: number;
2914
+ to: number;
2915
+ } | undefined);
2916
+ }
2917
+ declare function raw(code: string, sourceValue?: object, sourceSlice?: {
2918
+ from: number;
2919
+ to: number;
2920
+ }): RawCode;
2910
2921
  declare function serializeJS(value: unknown, indent?: number, step?: number): string; //#endregion
2911
- //#region src/profiles/xgraphMetadata.d.ts
2922
+ //#region src/textUtils.d.ts
2923
+ /**
2924
+ * Pure string utilities used by codegen.
2925
+ */
2926
+ /**
2927
+ * Removes common leading whitespace from all non-empty lines.
2928
+ */
2912
2929
  //#endregion
2913
2930
  //#region src/profiles/types.d.ts
2914
2931
  /**
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
2
- import { S as GraphPatch, _ as raw, a as RawCode, c as XStateV4TSOptions, d as getXStateFSMCompatibilityIssues, f as graphToMachineConfig, g as jsonSchemaToTSType, h as graphToXStateV4TS, l as contextSchemaToTSType, m as graphToXStateTS, n as CodeGenGraph, o as XStateFSMOptions, p as graphToXStateFSM, r as MachineConfigOptions, s as XStateTSOptions, u as eventsSchemaToTSType, v as serializeJS, y as ActionLocation } from "./index-DlOZxzrW.mjs";
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-CR_g-mOq.mjs";
4
- import { $t as EmbedPanelConfig, B as InspectionSentEvent, D as ExportCallOptions, F as InitOptions, Ht as UploadResult, Jt as createInspectionActorId, K as MachineVersionAutoSaveOptions, L as InspectionAction, M as INSPECTION_PROTOCOL_VERSION, N as INSPECTION_ROOM_QUERY_PARAM, O as ExportFormat, Qt as isEmbedExampleMachine, V as InspectionTakenTransition, X as ProjectEmbedMachine, Xt as getInspectionRoomId, Yt as createInspectionRoomUrls, Zt as isEmbedExample, _ as EmbedDocumentLanguage, b as EmbedEventName, ct as ProjectWorkspaceMachine, d as CommentsConfig, dt as ProjectWorkspaceProject, en as EmbedPanelPosition, f as EMBED_DOCUMENT_LANGUAGES, g as EmbedDocument, it as ProjectWorkspaceActionIcon, k as ExportFormatMap, lt as ProjectWorkspaceMachineOrigin, m as EditorCapabilities, n as CapabilityDeniedCapability, ot as ProjectWorkspaceCapabilities, p as EMBED_DOCUMENT_LIMITS, qt as assertEmbedExamples, r as CapabilityDeniedEvent, rt as ProjectWorkspaceAction, st as ProjectWorkspaceConfig, v as EmbedEventHandler, w as EmbedMode, x as EmbedExample, y as EmbedEventMap } from "./protocol-CQL9Ubt9.mjs";
2
+ import { S as GraphPatch, _ as raw, a as RawCode, c as XStateV4TSOptions, d as getXStateFSMCompatibilityIssues, f as graphToMachineConfig, g as jsonSchemaToTSType, h as graphToXStateV4TS, l as contextSchemaToTSType, m as graphToXStateTS, n as CodeGenGraph, o as XStateFSMOptions, p as graphToXStateFSM, r as MachineConfigOptions, s as XStateTSOptions, u as eventsSchemaToTSType, v as serializeJS, y as ActionLocation } from "./index-DZivqh0u.mjs";
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-Ciocekxl.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 EmbedPanelConfig, 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 EmbedPanelPosition, ot as ProjectWorkspaceActionIcon, p as EMBED_DOCUMENT_LIMITS, pt as ProjectWorkspaceProject, r as CapabilityDeniedEvent, rn as mergeInspectorSettings, tn as isEmbedExample, ut as ProjectWorkspaceMachine, v as EmbedEventHandler, w as EmbedMode, x as EmbedExample, y as EmbedEventMap } from "./protocol-B7q2lWj_.mjs";
5
5
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
6
- import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-Dg7prjeL.mjs";
7
- import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-C6yxOmSO.mjs";
6
+ import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-CVFc85uF.mjs";
7
+ import { _ as EditorHostOutboundMessage, a as EditorHostWorkspaceSessionOptions, d as fetchEditorSyncAccess, f as EDITOR_PROTOCOL_VERSION, g as EditorHostInitOptions, h as EditorHostInboundMessage, i as EditorHostWorkspaceSession, l as RemoteEditorSyncBackendOptions, m as EditorHostExportFormat, n as EditorHostSessionOptions, o as EditorSourceHost, p as EditorHostDiagnostic, r as EditorHostWorkspaceMachine, s as EditorSyncBackend, t as EditorHostSession, u as createRemoteEditorSyncBackend, v as EditorHostValidationIssue } from "./editorHostSession-DBLSyHJs.mjs";
8
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-CunxIl8H.mjs";
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-DV5IIGhV.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-BbvfH0Q1.mjs";
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-CKdEPGKY.mjs";
11
11
  import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
12
12
  import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
13
13
  import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
@@ -33,4 +33,4 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
33
33
  declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
34
34
  declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
35
35
  //#endregion
36
- export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CodeGenGraph, 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, EditorHostSession, type EditorHostSessionOptions, type EditorHostValidationIssue, type EditorHostWorkspaceMachine, EditorHostWorkspaceSession, type EditorHostWorkspaceSessionOptions, type EditorSourceHost, type EditorSyncBackend, 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 LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineConfigOptions, type MachineVersion, type MachineVersionAutoSaveOptions, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSyncOptions, 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 PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, type RemoteEditorSyncBackendOptions, type RepoType, type ResolvedSyncInput, 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 StatelyPragma, type StatelyPragmaAttachment, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type VerifyResult, type XStateFSMOptions, type XStateTSOptions, type XStateV4TSOptions, type XStateVersion, assertEmbedExamples, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
36
+ export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, type CodeGenGraph, 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, EditorHostSession, type EditorHostSessionOptions, type EditorHostValidationIssue, type EditorHostWorkspaceMachine, EditorHostWorkspaceSession, type EditorHostWorkspaceSessionOptions, type EditorSourceHost, type EditorSyncBackend, 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 MachineConfigOptions, type MachineVersion, type MachineVersionAutoSaveOptions, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSyncOptions, 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 PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, type RemoteEditorSyncBackendOptions, type RepoType, type ResolvedSyncInput, 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 StatelyPragma, type StatelyPragmaAttachment, type StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type VerifyResult, type ViewerOptions, type XStateFSMOptions, type XStateTSOptions, type XStateV4TSOptions, type XStateVersion, assertEmbedExamples, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, mergeInspectorSettings, raw, refreshToken, registerOAuthClient, resolveInspectorSettings, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
package/dist/index.mjs CHANGED
@@ -1,18 +1,18 @@
1
1
  import "./openapi-BTDjYWXd.mjs";
2
- import { EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine } from "./protocol.mjs";
3
- import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-BblbkW8-.mjs";
4
- import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
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-BEfUEyPL.mjs";
4
+ import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-B2_t3Le7.mjs";
5
5
  import { createStatelyEmbed } from "./embed.mjs";
6
- import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, t as EditorHostSession } from "./editorHostSession-DfmHzpls.mjs";
7
- import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-rSI54Ese.mjs";
8
- import { _ as graphToXStateV4TS, b as raw, f as getXStateFSMCompatibilityIssues, g as graphToXStateTS, h as graphToXStateFSM, l as eventsSchemaToTSType, m as graphToMachineConfig, n as RawCode, o as contextSchemaToTSType, v as jsonSchemaToTSType, x as serializeJS } from "./dist-wbhkeGh6.mjs";
6
+ import { a as fetchEditorSyncAccess, i as createRemoteEditorSyncBackend, n as EditorHostWorkspaceSession, t as EditorHostSession } from "./editorHostSession-Bj5YcijC.mjs";
7
+ import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-BZP6DaIO.mjs";
8
+ import { S as serializeJS, _ as graphToXStateV4TS, f as getXStateFSMCompatibilityIssues, g as graphToXStateTS, h as graphToXStateFSM, l as eventsSchemaToTSType, m as graphToMachineConfig, n as RawCode, o as contextSchemaToTSType, x as raw, y as jsonSchemaToTSType } from "./dist-NJFkDQjK.mjs";
9
9
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
10
- import { n as createStatelyInspector, t as createInspector } from "./inspect-C-eEfU3T.mjs";
10
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-DW30GMge.mjs";
11
11
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
12
12
  import { buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
13
13
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
14
- import { n as getStatelyPragma, r as upsertStatelyPragma, t as findStatelyPragmaAttachments } from "./statelyPragma-D46lczJR.mjs";
14
+ import { n as getStatelyPragma, r as upsertStatelyPragma, t as findStatelyPragmaAttachments } from "./statelyPragma-YtVaBuIe.mjs";
15
15
  import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
16
16
  import { createInspectionRelay } from "./relay.mjs";
17
17
 
18
- export { DEFAULT_STATELY_BASE_URL, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorHostSession, EditorHostWorkspaceSession, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, RawCode, StatelyApiError, StudioApiError, assertEmbedExamples, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
18
+ export { DEFAULT_STATELY_BASE_URL, EDITOR_PROTOCOL_VERSION, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorHostSession, EditorHostWorkspaceSession, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, RawCode, StatelyApiError, StudioApiError, assertEmbedExamples, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createRemoteEditorSyncBackend, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, fetchEditorSyncAccess, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getInspectionRoomId, getStatelyPragma, getXStateFSMCompatibilityIssues, graphToMachineConfig, graphToXStateFSM, graphToXStateTS, graphToXStateV4TS, isEmbedExample, isEmbedExampleMachine, jsonSchemaToTSType, mergeInspectorSettings, raw, refreshToken, registerOAuthClient, resolveInspectorSettings, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
@@ -1,4 +1,4 @@
1
- import { $t as EmbedPanelConfig, B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, R as InspectionClientMetadata, V as InspectionTakenTransition, W as MachinePayload, ft as ProtocolMessage, k as ExportFormatMap, m as EditorCapabilities, y as EmbedEventMap } from "./protocol-CQL9Ubt9.mjs";
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-B7q2lWj_.mjs";
2
2
 
3
3
  //#region src/transport.d.ts
4
4
  interface TransportFailure {
@@ -53,6 +53,7 @@ interface MinimalSnapshot {
53
53
  value: unknown;
54
54
  status: unknown;
55
55
  context?: unknown;
56
+ tags?: Iterable<string>;
56
57
  children?: Record<string, MinimalActorRef>;
57
58
  }
58
59
  /** Cross-version event envelope accepted by {@link Inspector.inspect}. */
@@ -111,6 +112,8 @@ interface InspectorConnection {
111
112
  /** Browser-page discovery metadata consumed by the Stately DevTools extension. */
112
113
  type InspectorDiscoveryEntry = InspectorConnection;
113
114
  interface InspectorEvents {
115
+ loaded: InspectorLoadedEvent;
116
+ capabilityDenied: EmbedEventMap['capabilityDenied'];
114
117
  connected: InspectorConnection;
115
118
  actor: AdoptedActor;
116
119
  event: InspectedEvent;
@@ -140,7 +143,7 @@ interface ManualActorOptions {
140
143
  /** System-level id (optional alias). */
141
144
  systemId?: string;
142
145
  }
143
- interface CreateInspectorOptions {
146
+ interface CreateInspectorOptions extends ViewerOptions<InspectorSettings> {
144
147
  /**
145
148
  * WebSocket relay base URL. Defaults to `STATELY_INSPECT_URL`, then
146
149
  * `wss://sky.stately.ai`. Passing this option always wins.
@@ -206,16 +209,16 @@ interface CreateInspectorOptions {
206
209
  * guarantee the previous runtime actor will no longer produce relevant events.
207
210
  */
208
211
  sessionIdReuse?: 'stopped' | 'always';
209
- /** Selected actor session id to focus on first. */
212
+ /**
213
+ * Exact producer-local session id to focus on first (not the actor id).
214
+ * For manual actors registered with `inspector.actor(id)`, use
215
+ * `${producerId}:${id}` and configure an explicit `producerId`.
216
+ * For runtime actors, use `actor.sessionId`, or the value returned by
217
+ * `resolveSessionId` when configured. Do not add the viewer's room namespace.
218
+ */
210
219
  selectedSessionId?: string;
211
220
  /** @deprecated Use {@link selectedSessionId}. */
212
221
  selectedActorId?: string;
213
- /** Panel layout forwarded into the system init message. */
214
- panels?: EmbedPanelConfig[];
215
- theme?: 'light' | 'dark';
216
- readOnly?: boolean;
217
- depth?: number;
218
- capabilities?: EditorCapabilities;
219
222
  /**
220
223
  * Advanced: inject a pre-built transport. When provided, `url`/`name` are
221
224
  * ignored and no WebSocket or browser URL is created.
@@ -249,6 +252,12 @@ interface Inspector {
249
252
  /** Subscribe to lifecycle / error events. Returns an unsubscribe function. */
250
253
  on<E extends EventName>(event: E, handler: Handler<E>): () => void;
251
254
  off<E extends EventName>(event: E, handler: Handler<E>): void;
255
+ /** Focus an actor using its producer-local session id. */
256
+ selectActor(sessionId: string): void;
257
+ /** Update display preferences without restarting inspection. */
258
+ setSettings(settings: InspectorSettings): void;
259
+ setTheme(theme: NonNullable<ViewerOptions['theme']>): void;
260
+ setViewMode(viewMode: NonNullable<ViewerOptions['viewMode']>): void;
252
261
  /** Export the currently-viewed machine in a given format. */
253
262
  export<F extends ExportFormat>(format: F, options?: ExportCallOptions<F>): Promise<ExportFormatMap[F]['result']>;
254
263
  /**
@@ -1,5 +1,5 @@
1
- import { INSPECTION_PROTOCOL_VERSION, createInspectionRoomUrls, getInspectionRoomId } from "./protocol.mjs";
2
- import { a as createEventRegistry, i as createWebSocketTransport, n as inspectionRuntime, o as createPendingExportManager, t as SDK_VERSION } from "./version-BblbkW8-.mjs";
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-BEfUEyPL.mjs";
3
3
 
4
4
  //#region src/openBrowser.ts
5
5
  async function openBrowser(url) {
@@ -51,7 +51,8 @@ function deriveActorDisplayName(parentLogic, actorId) {
51
51
  //#region src/inspect.ts
52
52
  const defaultSerializeSnapshot = (snapshot) => ({
53
53
  value: snapshot?.value,
54
- status: snapshot?.status
54
+ status: snapshot?.status,
55
+ ...snapshot?.tags && { tags: Array.from(snapshot.tags) }
55
56
  });
56
57
  const defaultExtractMachineConfig = (actor, source) => actor?.logic?.config ?? source?.config ?? null;
57
58
  function isStoppedSnapshot(snapshot) {
@@ -76,9 +77,14 @@ function generateRoomId() {
76
77
  return globalThis.crypto.randomUUID();
77
78
  }
78
79
  function createInspector(options = {}) {
80
+ assertEmbedDocuments(options.documents);
81
+ assertEmbedPanels(options.panels);
82
+ let viewerSettings = resolveInspectorSettings(options);
83
+ let hasViewerSettings = options.settings !== void 0 || options.viewMode !== void 0;
84
+ let preferredSessionId = options.selectedSessionId ?? options.selectedActorId;
79
85
  const environmentUrl = typeof process !== "undefined" ? process.env?.STATELY_INSPECT_URL : void 0;
80
86
  const url = options.url ?? environmentUrl ?? "wss://sky.stately.ai";
81
- const { inspectorBaseUrl, name, machines: configuredMachines, serializeSnapshot = defaultSerializeSnapshot, selectedSessionId: configuredSelectedSessionId, selectedActorId, panels, theme, readOnly, depth, capabilities, sessionIdReuse = "stopped", transport: injectedTransport } = options;
87
+ const { inspectorBaseUrl, name, machines: configuredMachines, serializeSnapshot = defaultSerializeSnapshot, panels, documents, readOnly, depth, capabilities, sessionIdReuse = "stopped", transport: injectedTransport } = options;
82
88
  const declaredMachines = { ...configuredMachines };
83
89
  const launch = options.launch ?? (options.autoOpen === true ? "browser" : "none");
84
90
  const extractMachine = options.extractMachine ?? options.extractMachineConfig ?? defaultExtractMachineConfig;
@@ -212,7 +218,16 @@ function createInspector(options = {}) {
212
218
  });
213
219
  const stopTransportMessages = transport.onMessage((msg) => {
214
220
  if (destroyed) return;
221
+ if (msg.producerId && msg.producerId !== producerId) return;
215
222
  switch (msg.type) {
223
+ case "@statelyai.system.loaded":
224
+ emitLocal("loaded", { ...msg.producerId && { producerId: msg.producerId } });
225
+ break;
226
+ case "@statelyai.capabilityDenied": {
227
+ const { type: _type, ...event } = msg;
228
+ emitLocal("capabilityDenied", event);
229
+ break;
230
+ }
216
231
  case "@statelyai.retrieved":
217
232
  exportManager.resolve(msg.requestId, msg.data);
218
233
  break;
@@ -387,7 +402,7 @@ function createInspector(options = {}) {
387
402
  machine: entry.machineConfig,
388
403
  snapshot: entry.snapshot ?? void 0
389
404
  });
390
- if ((configuredSelectedSessionId ?? selectedActorId) === entry.sessionId) send({
405
+ if (preferredSessionId === entry.sessionId) send({
391
406
  type: "@statelyai.system.selectActor",
392
407
  sessionId: entry.sessionId
393
408
  });
@@ -419,7 +434,7 @@ function createInspector(options = {}) {
419
434
  function buildInitMessage() {
420
435
  for (const [rootActorId, { actor }] of inspectedRoots) backfillActorTree(actor, rootActorId);
421
436
  const allEntries = Array.from(actors.values());
422
- const selectedSessionId = configuredSelectedSessionId ?? selectedActorId ?? observedRootIds.values().next().value ?? allEntries[0]?.sessionId;
437
+ const selectedSessionId = preferredSessionId ?? observedRootIds.values().next().value ?? allEntries[0]?.sessionId;
423
438
  return {
424
439
  type: "@statelyai.system.init",
425
440
  protocolVersion: INSPECTION_PROTOCOL_VERSION,
@@ -427,7 +442,9 @@ function createInspector(options = {}) {
427
442
  actors: allEntries.map(toSystemEntry),
428
443
  ...configuredMachines !== void 0 || Object.keys(declaredMachines).length > 0 ? { machines: { ...declaredMachines } } : {},
429
444
  ...selectedSessionId && { selectedSessionId },
430
- ...theme && { theme },
445
+ ...!hasViewerSettings && options.theme && { theme: options.theme },
446
+ ...hasViewerSettings && { settings: viewerSettings },
447
+ ...documents && { documents },
431
448
  ...readOnly !== void 0 && { readOnly },
432
449
  ...depth !== void 0 && { depth },
433
450
  ...capabilities !== void 0 && { capabilities },
@@ -728,6 +745,15 @@ function createInspector(options = {}) {
728
745
  pendingTransportReady = false;
729
746
  handleTransportReady();
730
747
  }
748
+ function setViewerSettings(settings) {
749
+ if (destroyed) return;
750
+ viewerSettings = mergeInspectorSettings(viewerSettings, settings);
751
+ hasViewerSettings = true;
752
+ send({
753
+ type: "@statelyai.setSettings",
754
+ settings: { ...viewerSettings }
755
+ });
756
+ }
731
757
  return {
732
758
  actors,
733
759
  roomId,
@@ -750,6 +776,18 @@ function createInspector(options = {}) {
750
776
  off(event, handler) {
751
777
  localListeners[event]?.delete(handler);
752
778
  },
779
+ selectActor(sessionId) {
780
+ if (destroyed) return;
781
+ if (!sessionId.trim()) throw new TypeError("sessionId must not be empty");
782
+ preferredSessionId = sessionId;
783
+ send({
784
+ type: "@statelyai.system.selectActor",
785
+ sessionId
786
+ });
787
+ },
788
+ setSettings: setViewerSettings,
789
+ setTheme: (theme) => setViewerSettings({ appearance: { colorMode: theme } }),
790
+ setViewMode: (viewMode) => setViewerSettings({ canvas: { viewMode } }),
753
791
  export(format, callOptions) {
754
792
  return exportManager.start(format, callOptions, "Inspector is destroyed", () => destroyed);
755
793
  },
@@ -1,3 +1,3 @@
1
- import { B as InspectionSentEvent, D as ExportCallOptions, L as InspectionAction, O as ExportFormat, V as InspectionTakenTransition, W as MachinePayload, b as EmbedEventName, k as ExportFormatMap, m as EditorCapabilities, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-CQL9Ubt9.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-CunxIl8H.mjs";
3
- export { AdoptedActor, CreateInspectorOptions, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InspectedEvent, InspectedSnapshot, InspectedTransition, InspectionAction, InspectionSentEvent, InspectionTakenTransition, Inspector, InspectorConnection, InspectorDiscoveryEntry, InspectorEvents, InspectorInspectionEvent, MachinePayload, ManualActorOptions, Transport, createInspector, createStatelyInspector };
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, an as EmbedPanelConfig, b as EmbedEventName, g as EmbedDocument, k as ExportFormatMap, m as EditorCapabilities, v as EmbedEventHandler, w as EmbedMode, y as EmbedEventMap } from "./protocol-B7q2lWj_.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-BbvfH0Q1.mjs";
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,4 +1,5 @@
1
- import "./version-BblbkW8-.mjs";
2
- import { n as createStatelyInspector, t as createInspector } from "./inspect-C-eEfU3T.mjs";
1
+ import "./protocol-BsBGRISR.mjs";
2
+ import "./version-BEfUEyPL.mjs";
3
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-DW30GMge.mjs";
3
4
 
4
5
  export { createInspector, createStatelyInspector };
@@ -1,4 +1,4 @@
1
- import { getInspectionRoomId } from "./protocol.mjs";
1
+ import { l as getInspectionRoomId } from "./protocol-BsBGRISR.mjs";
2
2
  import { createInspectionRelay } from "./relay.mjs";
3
3
  import { createServer } from "node:http";
4
4
  import { randomUUID } from "node:crypto";
@@ -1,2 +1,2 @@
1
- import { C as ImplementationSourceType, S as GraphPatch, b as CanvasColor, x as EditorStateType, y as ActionLocation } from "./index-DlOZxzrW.mjs";
1
+ import { C as ImplementationSourceType, S as GraphPatch, b as CanvasColor, x as EditorStateType, y as ActionLocation } from "./index-DZivqh0u.mjs";
2
2
  export { type ActionLocation, type CanvasColor, type EditorStateType, type GraphPatch, type ImplementationSourceType };