@statelyai/sdk 0.40.0 → 0.41.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.
Files changed (35) hide show
  1. package/README.md +10 -0
  2. package/dist/assetStorage.d.mts +1 -1
  3. package/dist/chunk-D1OLi6Wq.mjs +46 -0
  4. package/dist/editorHostProtocol.d.mts +3 -3
  5. package/dist/embed.d.mts +4 -3
  6. package/dist/embed.mjs +1 -1
  7. package/dist/{graph-9CApplKH.d.mts → graph-DbZdSisK.d.mts} +1 -1
  8. package/dist/graph.d.mts +1 -1
  9. package/dist/{index-gyYPC8rD.d.mts → index-DqF1xP8P.d.mts} +50 -399
  10. package/dist/index.d.mts +5 -5
  11. package/dist/index.mjs +3 -3
  12. package/dist/{inspect-COd1d8sJ.mjs → inspect-CDjr4saL.mjs} +1 -1
  13. package/dist/{inspect-C8SpNJKF.d.mts → inspect-ruD95iBM.d.mts} +1 -1
  14. package/dist/inspect.d.mts +2 -2
  15. package/dist/inspect.mjs +2 -2
  16. package/dist/machineGraph-DYtFKHlq-BpWpGU22.mjs +3 -0
  17. package/dist/machineGraph-DYtFKHlq-ChbeTHlv.mjs +1023 -0
  18. package/dist/patchTypes.d.mts +1 -1
  19. package/dist/{protocol-DUehXGus.d.mts → protocol-BvElOcXs.d.mts} +4 -3
  20. package/dist/protocol.d.mts +1 -1
  21. package/dist/relay.d.mts +1 -1
  22. package/dist/rolldown-runtime-95iHPtFO-Bo6l7CbO.mjs +114 -0
  23. package/dist/{studio-D0XNCqKr.mjs → schemas-DsQ8UYlM.mjs} +36 -1649
  24. package/dist/sourceCoverage.d.mts +101 -0
  25. package/dist/sourceCoverage.mjs +3572 -0
  26. package/dist/studio-DH7OeLao.mjs +1604 -0
  27. package/dist/{studio-DeFtdrGS.d.mts → studio-DRw9sxCm.d.mts} +10 -2
  28. package/dist/studio.d.mts +1 -1
  29. package/dist/studio.mjs +1 -1
  30. package/dist/{version-CRlxeCo2.mjs → version-eag6cuvm.mjs} +1 -1
  31. package/dist/xstateSource-BUCx2xA4-CWteIFJn.d.mts +451 -0
  32. package/dist/xstateSource-JvwXWv6G-KnMMoZlG.mjs +151753 -0
  33. package/package.json +7 -3
  34. /package/dist/{editor-sync-types-Ch5P5XRj.d.mts → editor-sync-types-BjgSBGxf.d.mts} +0 -0
  35. /package/dist/{patchTypes-BZ7gzwAP.d.mts → patchTypes-BFlvJTDJ.d.mts} +0 -0
@@ -1,2 +1,2 @@
1
- import { a as ImplementationSourceType, i as GraphPatch, n as CanvasColor, r as EditorStateType, t as ActionLocation } from "./index-gyYPC8rD.mjs";
1
+ import { a as ImplementationSourceType, i as GraphPatch, n as CanvasColor, r as EditorStateType, t as ActionLocation } from "./index-DqF1xP8P.mjs";
2
2
  export { ActionLocation, CanvasColor, EditorStateType, GraphPatch, ImplementationSourceType };
@@ -1,6 +1,7 @@
1
- import { i as GraphPatch, s as ProfileManifest } from "./index-gyYPC8rD.mjs";
2
- import { b as DigraphConfig, i as StatelyGraph } from "./graph-9CApplKH.mjs";
3
- import { a as MachineSourceLocations$1, i as EditorSyncStateSourceLocation, n as EditorSyncSourceLocation, r as EditorSyncSourceRange, t as EditorCapabilities$1 } from "./editor-sync-types-Ch5P5XRj.mjs";
1
+ import { i as GraphPatch } from "./index-DqF1xP8P.mjs";
2
+ import { r as ProfileManifest } from "./xstateSource-BUCx2xA4-CWteIFJn.mjs";
3
+ import { b as DigraphConfig, i as StatelyGraph } from "./graph-DbZdSisK.mjs";
4
+ import { a as MachineSourceLocations$1, i as EditorSyncStateSourceLocation, n as EditorSyncSourceLocation, r as EditorSyncSourceRange, t as EditorCapabilities$1 } from "./editor-sync-types-BjgSBGxf.mjs";
4
5
 
5
6
  //#region src/embedPanel.d.ts
6
7
  type EmbedPanelPosition = 'left' | 'right' | 'bottom';
@@ -1,2 +1,2 @@
1
- import { $ as MachineVersionAutoSaveOptions, $t as ValidationIssue, A as ExportFormat, At as SetApiKeyMessage, B as InspectSnapshotMessage, Bt as SystemActorStoppedMessage, C as EmbedExample, Ct as RegisteredMessage, D as ErrorCode, Dt as SavedMessage, E as EmbedMode, Et as SaveMessage, F as HostUpdateOptions, Ft as SourceRange, G as InspectionTakenTransition, Gt as ToastDismissMessage, H as InspectionClientMetadata, Ht as SystemLoadedMessage, I as INSPECTION_PROTOCOL_VERSION, It as StateSourceLocation, J as LoadedMessage, Jt as UploadCapabilitiesMessage, K as InspectorLoadedEvent, Kt as ToastMessage, L as INSPECTION_ROOM_QUERY_PARAM, Lt as SystemActorEventMessage, M as ExtensionCallMessage, Mt as SetSettingsMessage, N as ExtensionResultMessage, Nt as SetThemeMessage, O as ErrorMessage, Ot as SerializedInspectionMachine, P as HighlightMessage, Pt as SourceLocation, Q as MachineSourceLocations, Qt as UploadResult, R as InitMessage, Rt as SystemActorRegisteredMessage, S as EmbedEventName, St as RegisterMessage, T as EmbedFormatManifest, Tt as RetrievedMessage, U as InspectionRoomUrls, Ut as SystemSelectActorMessage, V as InspectionAction, Vt as SystemInitMessage, W as InspectionSentEvent, Wt as SystemSendEventMessage, X as MachineInitOptions, Xt as UploadRequestMessage, Y as LoginMessage, Yt as UploadFileInfo, Z as MachinePayload, Zt as UploadResponseMessage, _ as EmbedChromeOptions, _t as ProjectWorkspaceOpenChangedMessage, a as CapabilityDeniedMessage, an as createInspectionActorId, at as ProjectInitOptions, b as EmbedEventHandler, bt as ReadOnlyReason, c as ClipboardReadMessage, cn as isEmbedExample, ct as ProjectSetWorkspaceOpenMessage, d as ClipboardWriteResponseMessage, dn as mergeInspectorSettings, dt as ProjectWorkspaceActionIcon, en as VersionSaveRequestedMessage, et as ModeChangedMessage, f as CommentsConfig, fn as resolveInspectorSettings, ft as ProjectWorkspaceActionMessage, g as EditorHandshakeMessage, gt as ProjectWorkspaceMachineOrigin, h as EditorCapabilities, hn as EmbedPanelPosition, ht as ProjectWorkspaceMachine, i as CapabilityDeniedEvent, in as assertEmbedExamples, it as ProjectInitMessage, j as ExportFormatMap, jt as SetModeMessage, k as ExportCallOptions, kt as SessionMessage, l as ClipboardReadResponseMessage, ln as isEmbedExampleMachine, lt as ProjectUpdateMessage, m as EMBED_DOCUMENT_LIMITS, mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, n as AuthenticationRecovery, nn as ViewerOptions, nt as PanelChangedMessage, o as ChangeMessage, on as createInspectionRoomUrls, ot as ProjectMachineSelectedMessage, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceCapabilities, q as InspectorSettings, qt as UpdateMessage, r as CapabilityDeniedCapability, rn as VizMessage, rt as ProjectEmbedMachine, s as ClientMessage, sn as getInspectionRoomId, st as ProjectSelectMachineMessage, t as ActorSystemEntry, tn as ViewModeChangedMessage, tt as PREFIX, u as ClipboardWriteMessage, un as isSerializedInspectionMachine, ut as ProjectWorkspaceAction, v as EmbedDocument, vt as ProjectWorkspaceProject, w as EmbedExtensionsManifest, wt as RetrieveMessage, x as EmbedEventMap, xt as ReadyMessage, y as EmbedDocumentLanguage, yt as ProtocolMessage, z as InitOptions, zt as SystemActorSnapshotMessage } from "./protocol-DUehXGus.mjs";
1
+ import { $ as MachineVersionAutoSaveOptions, $t as ValidationIssue, A as ExportFormat, At as SetApiKeyMessage, B as InspectSnapshotMessage, Bt as SystemActorStoppedMessage, C as EmbedExample, Ct as RegisteredMessage, D as ErrorCode, Dt as SavedMessage, E as EmbedMode, Et as SaveMessage, F as HostUpdateOptions, Ft as SourceRange, G as InspectionTakenTransition, Gt as ToastDismissMessage, H as InspectionClientMetadata, Ht as SystemLoadedMessage, I as INSPECTION_PROTOCOL_VERSION, It as StateSourceLocation, J as LoadedMessage, Jt as UploadCapabilitiesMessage, K as InspectorLoadedEvent, Kt as ToastMessage, L as INSPECTION_ROOM_QUERY_PARAM, Lt as SystemActorEventMessage, M as ExtensionCallMessage, Mt as SetSettingsMessage, N as ExtensionResultMessage, Nt as SetThemeMessage, O as ErrorMessage, Ot as SerializedInspectionMachine, P as HighlightMessage, Pt as SourceLocation, Q as MachineSourceLocations, Qt as UploadResult, R as InitMessage, Rt as SystemActorRegisteredMessage, S as EmbedEventName, St as RegisterMessage, T as EmbedFormatManifest, Tt as RetrievedMessage, U as InspectionRoomUrls, Ut as SystemSelectActorMessage, V as InspectionAction, Vt as SystemInitMessage, W as InspectionSentEvent, Wt as SystemSendEventMessage, X as MachineInitOptions, Xt as UploadRequestMessage, Y as LoginMessage, Yt as UploadFileInfo, Z as MachinePayload, Zt as UploadResponseMessage, _ as EmbedChromeOptions, _t as ProjectWorkspaceOpenChangedMessage, a as CapabilityDeniedMessage, an as createInspectionActorId, at as ProjectInitOptions, b as EmbedEventHandler, bt as ReadOnlyReason, c as ClipboardReadMessage, cn as isEmbedExample, ct as ProjectSetWorkspaceOpenMessage, d as ClipboardWriteResponseMessage, dn as mergeInspectorSettings, dt as ProjectWorkspaceActionIcon, en as VersionSaveRequestedMessage, et as ModeChangedMessage, f as CommentsConfig, fn as resolveInspectorSettings, ft as ProjectWorkspaceActionMessage, g as EditorHandshakeMessage, gt as ProjectWorkspaceMachineOrigin, h as EditorCapabilities, hn as EmbedPanelPosition, ht as ProjectWorkspaceMachine, i as CapabilityDeniedEvent, in as assertEmbedExamples, it as ProjectInitMessage, j as ExportFormatMap, jt as SetModeMessage, k as ExportCallOptions, kt as SessionMessage, l as ClipboardReadResponseMessage, ln as isEmbedExampleMachine, lt as ProjectUpdateMessage, m as EMBED_DOCUMENT_LIMITS, mn as EmbedPanelConfig, mt as ProjectWorkspaceConfig, n as AuthenticationRecovery, nn as ViewerOptions, nt as PanelChangedMessage, o as ChangeMessage, on as createInspectionRoomUrls, ot as ProjectMachineSelectedMessage, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceCapabilities, q as InspectorSettings, qt as UpdateMessage, r as CapabilityDeniedCapability, rn as VizMessage, rt as ProjectEmbedMachine, s as ClientMessage, sn as getInspectionRoomId, st as ProjectSelectMachineMessage, t as ActorSystemEntry, tn as ViewModeChangedMessage, tt as PREFIX, u as ClipboardWriteMessage, un as isSerializedInspectionMachine, ut as ProjectWorkspaceAction, v as EmbedDocument, vt as ProjectWorkspaceProject, w as EmbedExtensionsManifest, wt as RetrieveMessage, x as EmbedEventMap, xt as ReadyMessage, y as EmbedDocumentLanguage, yt as ProtocolMessage, z as InitOptions, zt as SystemActorSnapshotMessage } from "./protocol-BvElOcXs.mjs";
2
2
  export { ActorSystemEntry, AuthenticationRecovery, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedChromeOptions, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExample, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, EmbedPanelConfig, EmbedPanelPosition, ErrorCode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, HighlightMessage, HostUpdateOptions, 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, SerializedInspectionMachine, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemLoadedMessage, SystemSelectActorMessage, SystemSendEventMessage, ToastDismissMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VersionSaveRequestedMessage, ViewModeChangedMessage, ViewerOptions, VizMessage, assertEmbedExamples, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, isSerializedInspectionMachine, mergeInspectorSettings, resolveInspectorSettings };
package/dist/relay.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { yt as ProtocolMessage } from "./protocol-DUehXGus.mjs";
1
+ import { yt as ProtocolMessage } from "./protocol-BvElOcXs.mjs";
2
2
  //#region src/relay.d.ts
3
3
  type InspectionRelayRole = 'producer' | 'viewer';
4
4
  interface InspectionRelayPeer {
@@ -0,0 +1,114 @@
1
+ //#region ../graph-tools/dist/xstateMeta-BIvoquBy.mjs
2
+ const XSTATE_V5_PROFILE = "@statelyai/xstate@5.30.0";
3
+ const XSTATE_V6_PROFILE = "@statelyai/xstate@6.0.0-alpha.51";
4
+ const XSTATE_V6_BRANCH_DESCRIPTION_META = "@statelyai.branchDescription";
5
+ const XSTATE_V6_UNRESOLVED_TARGET_META = "@statelyai.xstate.v6.unresolvedTarget";
6
+ const LEGACY_MACHINE_PROFILES = ["xstate-v5", "xstate-v6-alpha"];
7
+ function normalizeMachineProfile(profile) {
8
+ return profile === "xstate-v5" ? XSTATE_V5_PROFILE : profile === "xstate-v6-alpha" ? XSTATE_V6_PROFILE : profile;
9
+ }
10
+ function isXStateV6Profile(profile) {
11
+ return (profile === "xstate-v5" || profile === "xstate-v6-alpha" ? normalizeMachineProfile(profile) : profile ?? XSTATE_V5_PROFILE).startsWith("@statelyai/xstate@6.");
12
+ }
13
+ function isCodeExpression(value) {
14
+ return Boolean(value && typeof value === "object" && !Array.isArray(value) && value["@type"] === "code" && typeof value.expr === "string");
15
+ }
16
+ /**
17
+ * Serializes JavaScript values as JS source code (not JSON).
18
+ * - Unquoted keys for valid identifiers
19
+ * - Single-quoted strings
20
+ * - Omits undefined values
21
+ * - Supports RawCode for verbatim expressions
22
+ * - Supports inline expression directives for verbatim expressions
23
+ */
24
+ const VALID_IDENT = /^[a-zA-Z_$][a-zA-Z0-9_$]*$/;
25
+ var RawCode = class {
26
+ constructor(code, sourceValue, sourceSlice, preserveWhitespace = false) {
27
+ this.code = code;
28
+ this.sourceValue = sourceValue;
29
+ this.sourceSlice = sourceSlice;
30
+ this.preserveWhitespace = preserveWhitespace;
31
+ }
32
+ };
33
+ function raw(code, sourceValue, sourceSlice, preserveWhitespace = false) {
34
+ return new RawCode(code, sourceValue, sourceSlice, preserveWhitespace);
35
+ }
36
+ const SERIALIZED_SOURCE_ID = Symbol("stately.sourceId");
37
+ function serializeJS(value, indent = 0, step = 2) {
38
+ if (value instanceof RawCode) return markSourceValue(value.sourceValue, value.code, value.sourceSlice);
39
+ if (isCodeExpression(value)) return markSourceValue(value, value.expr);
40
+ if (value === void 0) return "undefined";
41
+ if (value === null) return "null";
42
+ if (typeof value === "string") return `'${escapeString(value)}'`;
43
+ if (typeof value === "number" || typeof value === "boolean") return String(value);
44
+ if (Array.isArray(value)) return serializeArray(value, indent, step);
45
+ if (typeof value === "object") return serializeObject(value, indent, step);
46
+ return String(value);
47
+ }
48
+ function markSourceValue(value, code, slice = {
49
+ from: 0,
50
+ to: code.length
51
+ }) {
52
+ if (!value) return code;
53
+ const id = value[SERIALIZED_SOURCE_ID];
54
+ return id === void 0 ? code : `${code.slice(0, slice.from)}/*__stately_source_${id}_start__*/${code.slice(slice.from, slice.to)}/*__stately_source_${id}_end__*/${code.slice(slice.to)}`;
55
+ }
56
+ function escapeString(s) {
57
+ return s.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t");
58
+ }
59
+ function serializeArray(arr, indent, step) {
60
+ const filtered = arr.filter((v) => v !== void 0);
61
+ if (filtered.length === 0) return markSourceValue(arr, "[]");
62
+ const inner = indent + step;
63
+ const pad = " ".repeat(inner);
64
+ const closePad = " ".repeat(indent);
65
+ return markSourceValue(arr, `[\n${filtered.map((v) => `${pad}${serializeJS(v, inner, step)}`).join(",\n")},\n${closePad}]`);
66
+ }
67
+ function serializeObject(obj, indent, step) {
68
+ const entries = Object.entries(obj).filter(([, v]) => v !== void 0);
69
+ if (entries.length === 0) return markSourceValue(obj, "{}");
70
+ const inner = indent + step;
71
+ const pad = " ".repeat(inner);
72
+ const closePad = " ".repeat(indent);
73
+ return markSourceValue(obj, `{\n${entries.map(([key, val]) => {
74
+ const k = VALID_IDENT.test(key) ? key : `'${escapeString(key)}'`;
75
+ const serialized = serializeJS(val, inner, step);
76
+ if (isRawExpression(val) && serialized.includes("\n")) return `${pad}${k}: ${preservesAuthoredWhitespace(val) ? serialized : indentRawCode(serialized, inner)}`;
77
+ return `${pad}${k}: ${serialized}`;
78
+ }).join(",\n")},\n${closePad}}`);
79
+ }
80
+ function preservesAuthoredWhitespace(value) {
81
+ if (isCodeExpression(value)) return true;
82
+ if (value instanceof RawCode && value.preserveWhitespace) return true;
83
+ const sourceValue = value instanceof RawCode ? value.sourceValue : value;
84
+ return Boolean(sourceValue && typeof sourceValue === "object" && SERIALIZED_SOURCE_ID in sourceValue);
85
+ }
86
+ function isRawExpression(value) {
87
+ return value instanceof RawCode || isCodeExpression(value);
88
+ }
89
+ function indentRawCode(code, indent) {
90
+ const lines = code.split("\n");
91
+ if (lines.length <= 1) return code;
92
+ const pad = " ".repeat(indent);
93
+ return [lines[0], ...lines.slice(1).map((line) => line.trim() === "" ? "" : `${pad}${line}`)].join("\n");
94
+ }
95
+ /** TypeScript-free metadata keys shared by the main and `/typescript` entries. */
96
+ const XSTATE_V6_FN_TRANSITION_META = "@statelyai.xstate.v6.fnTransition";
97
+ const XSTATE_V6_FN_SOURCE_META = "@statelyai.xstate.v6.fnSource";
98
+ const FN_PROJECTION_META = "@statelyai.xstate.v6.fnProjection";
99
+
100
+ //#endregion
101
+ //#region ../graph-tools/dist/rolldown-runtime-95iHPtFO.mjs
102
+ var __defProp = Object.defineProperty;
103
+ var __exportAll = (all, no_symbols) => {
104
+ let target = {};
105
+ for (var name in all) __defProp(target, name, {
106
+ get: all[name],
107
+ enumerable: true
108
+ });
109
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
110
+ return target;
111
+ };
112
+
113
+ //#endregion
114
+ export { XSTATE_V5_PROFILE as a, XSTATE_V6_FN_TRANSITION_META as c, isCodeExpression as d, isXStateV6Profile as f, serializeJS as h, SERIALIZED_SOURCE_ID as i, XSTATE_V6_PROFILE as l, raw as m, FN_PROJECTION_META as n, XSTATE_V6_BRANCH_DESCRIPTION_META as o, normalizeMachineProfile as p, LEGACY_MACHINE_PROFILES as r, XSTATE_V6_FN_SOURCE_META as s, __exportAll as t, XSTATE_V6_UNRESOLVED_TARGET_META as u };