@statelyai/sdk 0.27.1 → 0.28.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/embed.d.mts +1 -4
- package/dist/embed.mjs +4 -2
- package/dist/index.mjs +2 -2
- package/dist/{inspect-CebH2l6F.mjs → inspect-DSDnyzZ5.mjs} +1 -1
- package/dist/inspect.mjs +2 -2
- package/dist/protocol.d.mts +19 -3
- package/dist/{version-usAEzut8.mjs → version-D_SqbrSy.mjs} +1 -1
- package/package.json +1 -1
package/dist/embed.d.mts
CHANGED
|
@@ -109,10 +109,7 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
|
|
|
109
109
|
onViewModeChanged?: (viewMode: 'graph' | 'list') => void;
|
|
110
110
|
onPanelChanged?: (event: EmbedEventMap['panelChanged']) => void;
|
|
111
111
|
onModeChanged?: (event: EmbedEventMap['modeChanged']) => void;
|
|
112
|
-
onError?: (error:
|
|
113
|
-
code: string;
|
|
114
|
-
message: string;
|
|
115
|
-
}) => void;
|
|
112
|
+
onError?: (error: EmbedEventMap['error']) => void;
|
|
116
113
|
onCapabilityDenied?: (event: CapabilityDeniedEvent) => void;
|
|
117
114
|
}
|
|
118
115
|
interface StatelyEmbed {
|
package/dist/embed.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-
|
|
1
|
+
import { a as createEventRegistry, o as createPendingExportManager, r as createPostMessageTransport, s as toInitMessage, t as SDK_VERSION } from "./version-D_SqbrSy.mjs";
|
|
2
2
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/embed.ts
|
|
@@ -364,7 +364,9 @@ function createStatelyEmbed(options) {
|
|
|
364
364
|
const error = data;
|
|
365
365
|
const err = {
|
|
366
366
|
code: error.code,
|
|
367
|
-
message: error.message
|
|
367
|
+
message: error.message,
|
|
368
|
+
...error.machineId !== void 0 ? { machineId: error.machineId } : {},
|
|
369
|
+
...error.details !== void 0 ? { details: error.details } : {}
|
|
368
370
|
};
|
|
369
371
|
exportManager.reject(new Error(err.message), error.requestId);
|
|
370
372
|
options.onError?.(err);
|
package/dist/index.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import "./openapi-BTDjYWXd.mjs";
|
|
2
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-
|
|
3
|
+
import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-D_SqbrSy.mjs";
|
|
4
4
|
import { t as EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol-Bko7wge8.mjs";
|
|
5
5
|
import { createStatelyEmbed } from "./embed.mjs";
|
|
6
6
|
import { i as fetchEditorSyncAccess, r as createRemoteEditorSyncBackend, t as EditorHostSession } from "./editorHostSession-shrjfosC.mjs";
|
|
7
7
|
import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-CNkxMZyz.mjs";
|
|
8
8
|
import { a as RawCode, d as getXStateFSMCompatibilityIssues, g as jsonSchemaToTSType, h as graphToXStateTS, m as graphToXStateFSM, n as getStatelyPragma, p as graphToMachineConfig, r as upsertStatelyPragma, s as contextSchemaToTSType, t as findStatelyPragmaAttachments, u as eventsSchemaToTSType, v as raw, y as serializeJS } from "./statelyPragma-ByF0-L-N.mjs";
|
|
9
9
|
import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
|
|
10
|
-
import { n as createStatelyInspector, t as createInspector } from "./inspect-
|
|
10
|
+
import { n as createStatelyInspector, t as createInspector } from "./inspect-DSDnyzZ5.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";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
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-
|
|
2
|
+
import { a as createEventRegistry, i as createWebSocketTransport, n as inspectionRuntime, o as createPendingExportManager, t as SDK_VERSION } from "./version-D_SqbrSy.mjs";
|
|
3
3
|
|
|
4
4
|
//#region src/openBrowser.ts
|
|
5
5
|
async function openBrowser(url) {
|
package/dist/inspect.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import "./version-
|
|
2
|
-
import { n as createStatelyInspector, t as createInspector } from "./inspect-
|
|
1
|
+
import "./version-D_SqbrSy.mjs";
|
|
2
|
+
import { n as createStatelyInspector, t as createInspector } from "./inspect-DSDnyzZ5.mjs";
|
|
3
3
|
|
|
4
4
|
export { createInspector, createStatelyInspector };
|
package/dist/protocol.d.mts
CHANGED
|
@@ -254,8 +254,10 @@ interface EmbedEventMap {
|
|
|
254
254
|
sourceLocations?: MachineSourceLocations;
|
|
255
255
|
};
|
|
256
256
|
error: {
|
|
257
|
-
code:
|
|
257
|
+
code: ErrorCode;
|
|
258
258
|
message: string;
|
|
259
|
+
machineId?: string;
|
|
260
|
+
details?: string[];
|
|
259
261
|
};
|
|
260
262
|
capabilityDenied: CapabilityDeniedEvent;
|
|
261
263
|
snapshot: {
|
|
@@ -706,10 +708,24 @@ interface RetrievedMessage {
|
|
|
706
708
|
requestId: string;
|
|
707
709
|
data: unknown;
|
|
708
710
|
}
|
|
711
|
+
/**
|
|
712
|
+
* Error codes the editor emits. Open-ended (`string`) so an older SDK keeps
|
|
713
|
+
* forwarding codes a newer editor adds.
|
|
714
|
+
*
|
|
715
|
+
* - `unsupported_protocol` — editor/SDK protocol versions disagree.
|
|
716
|
+
* - `conversion_failed` — a machine source could not be converted to a graph.
|
|
717
|
+
* - `invalid_graph` — a host-supplied graph is structurally invalid; see `details`.
|
|
718
|
+
* - `render_failed` — the editor threw while rendering a machine.
|
|
719
|
+
*/
|
|
720
|
+
type ErrorCode = 'unsupported_protocol' | 'conversion_failed' | 'invalid_graph' | 'render_failed' | (string & {});
|
|
709
721
|
interface ErrorMessage {
|
|
710
722
|
type: '@statelyai.error';
|
|
711
|
-
code:
|
|
723
|
+
code: ErrorCode;
|
|
712
724
|
message: string;
|
|
725
|
+
/** Machine the error belongs to, when the editor knows which one failed. */
|
|
726
|
+
machineId?: string;
|
|
727
|
+
/** Per-problem explanations, e.g. one line per structural graph error. */
|
|
728
|
+
details?: string[];
|
|
713
729
|
requestId?: string;
|
|
714
730
|
}
|
|
715
731
|
interface CapabilityDeniedMessage extends CapabilityDeniedEvent {
|
|
@@ -800,4 +816,4 @@ declare const PREFIX = "@statelyai.";
|
|
|
800
816
|
/** Current WebSocket inspection protocol version. */
|
|
801
817
|
declare const INSPECTION_PROTOCOL_VERSION = 2;
|
|
802
818
|
//#endregion
|
|
803
|
-
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, type EmbedPanelConfig, type EmbedPanelPosition, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, 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, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine };
|
|
819
|
+
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, type EmbedPanelConfig, type EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, 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, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine };
|
|
@@ -364,7 +364,7 @@ function createWebSocketTransport(options) {
|
|
|
364
364
|
|
|
365
365
|
//#endregion
|
|
366
366
|
//#region src/version.ts
|
|
367
|
-
const SDK_VERSION = "0.
|
|
367
|
+
const SDK_VERSION = "0.28.0";
|
|
368
368
|
function inspectionRuntime() {
|
|
369
369
|
if (typeof window !== "undefined") return "browser";
|
|
370
370
|
if (typeof process !== "undefined" && process.versions?.node) return "node";
|