@statelyai/sdk 0.10.1 → 0.10.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/dist/index.d.mts CHANGED
@@ -2,7 +2,7 @@ import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createS
2
2
  import { CommentsConfig, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, ProjectEmbedMachine, UploadResult } from "./protocol.mjs";
3
3
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
4
4
  import { AssetConfig, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
5
- import { C as EventTypeData, E as JSONSchema7, S as DigraphNodeConfig, T as CodeGenGraph, _ 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-DmXh22Zu.mjs";
5
+ import { C as EventTypeData, E as JSONSchema7, S as DigraphNodeConfig, T as CodeGenGraph, _ 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-GeuH-mFK.mjs";
6
6
  import { a as ManualActorOptions, c as createPostMessageTransport, i as InspectorEvents, l as createWebSocketTransport, n as CreateInspectorOptions, o as createStatelyInspector, r as Inspector, s as Transport, t as AdoptedActor } from "./inspect-BLlM3qKf.mjs";
7
7
  import { ConnectedRepo, CreateMachineFromDefinitionInput, CreateMachineFromTemplateInput, CreateMachineInput, CreateMachineTemplate, CreateProjectInput, EnsureProjectInput, ExtractMachinesResponse, ExtractedMachine, GetMachineOptions, ProjectData, ProjectMachine, ProjectVisibility, RepoType, StudioApiError, StudioClient, StudioClientOptions, StudioMachineRecord, UpdateMachineInput, VerifyApiKeyResponse, XStateVersion, createStatelyClient } from "./studio.mjs";
8
8
  import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
@@ -35,6 +35,14 @@ declare function upsertStatelyPragma(sourceText: string, id: string, options?: U
35
35
  interface MachineConfigOptions {
36
36
  showDescriptions?: boolean;
37
37
  showMeta?: boolean;
38
+ /**
39
+ * Emit inline-code guards as a `{ type }` reference instead of an inline code
40
+ * expression directive. The simulation needs this: it can't evaluate guard
41
+ * source, so it stubs each guard by `type` (see getSimImplementations). A
42
+ * code-expression guard has no `type`, so XState reads `undefined` and throws
43
+ * "Guard 'undefined' is not implemented" the moment that transition is taken.
44
+ */
45
+ inlineGuardsAsTypeRef?: boolean;
38
46
  }
39
47
  declare function graphToMachineConfig(graph: CodeGenGraph, options?: MachineConfigOptions): UnknownMachineConfig;
40
48
  //#endregion
@@ -42,6 +50,7 @@ declare function graphToMachineConfig(graph: CodeGenGraph, options?: MachineConf
42
50
  interface XStateTSOptions extends MachineConfigOptions {
43
51
  exportStyle?: 'named' | 'default' | 'none';
44
52
  targetLanguage?: 'typescript' | 'javascript';
53
+ xstateVersion?: 5 | 6;
45
54
  }
46
55
  declare function graphToXStateTS(graph: CodeGenGraph, options?: XStateTSOptions): string;
47
56
  //#endregion
package/dist/index.mjs CHANGED
@@ -4,7 +4,7 @@ import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./
4
4
  import { createStatelyInspector } from "./inspect.mjs";
5
5
  import { StudioApiError, createStatelyClient } from "./studio.mjs";
6
6
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
7
- import { a as graphToMachineConfig, c as serializeJS, d as upsertStatelyPragma, i as jsonSchemaToTSType, l as findStatelyPragmaAttachments, n as contextSchemaToTSType, o as RawCode, r as eventsSchemaToTSType, s as raw, t as graphToXStateTS, u as getStatelyPragma } from "./graphToXStateTS-moihsH_U.mjs";
7
+ import { S as upsertStatelyPragma, a as graphToMachineConfig, b as findStatelyPragmaAttachments, c as serializeJS, i as jsonSchemaToTSType, n as contextSchemaToTSType, o as RawCode, r as eventsSchemaToTSType, s as raw, t as graphToXStateTS, x as getStatelyPragma } from "./graphToXStateTS-DOaLOySy.mjs";
8
8
  import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
9
9
 
10
10
  export { RawCode, StatelyApiError, StudioApiError, contextSchemaToTSType, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, eventsSchemaToTSType, findStatelyPragmaAttachments, fromStudioMachine, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
@@ -45,6 +45,7 @@ interface StateSourceLocation extends SourceLocation {
45
45
  interface MachineSourceLocations {
46
46
  version: 1;
47
47
  root?: SourceLocation;
48
+ statesObject?: StateSourceLocation;
48
49
  states: StateSourceLocation[];
49
50
  staticValues?: Array<SourceLocation & {
50
51
  value: string;
@@ -78,6 +79,12 @@ interface ExportFormatMap {
78
79
  options: object;
79
80
  result: Record<string, unknown>;
80
81
  };
82
+ d2: {
83
+ options: {
84
+ includeLayout?: boolean;
85
+ };
86
+ result: string;
87
+ };
81
88
  mermaid: {
82
89
  options: object;
83
90
  result: string;
@@ -159,6 +166,7 @@ interface MachineInitOptions {
159
166
  };
160
167
  comments?: CommentsConfig;
161
168
  sourceLocations?: MachineSourceLocations;
169
+ settings?: Record<string, unknown>;
162
170
  /**
163
171
  * Show a persistent "Save to apply" pill in the embed whenever Viz has
164
172
  * local edits that have not yet been saved. Intended for contexts like
@@ -189,6 +197,7 @@ interface ProjectInitOptions {
189
197
  activePanels?: string[];
190
198
  };
191
199
  commentsByMachineId?: Record<string, CommentsConfig>;
200
+ settings?: Record<string, unknown>;
192
201
  unsavedIndicator?: {
193
202
  enabled?: boolean;
194
203
  mode?: "structural" | "all";
@@ -208,6 +217,7 @@ interface InitMessage {
208
217
  activePanels?: string[];
209
218
  comments?: CommentsConfig;
210
219
  sourceLocations?: MachineSourceLocations;
220
+ settings?: Record<string, unknown>;
211
221
  /** Mirror of `InitOptions.unsavedIndicator`. */
212
222
  unsavedIndicator?: {
213
223
  enabled?: boolean;
@@ -228,6 +238,7 @@ interface ProjectInitMessage {
228
238
  rightPanels?: string[];
229
239
  activePanels?: string[];
230
240
  commentsByMachineId?: Record<string, CommentsConfig>;
241
+ settings?: Record<string, unknown>;
231
242
  unsavedIndicator?: {
232
243
  enabled?: boolean;
233
244
  mode?: "structural" | "all";
package/dist/sync.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { b as DigraphConfig, i as StatelyGraph } from "./graph-DmXh22Zu.mjs";
1
+ import { b as DigraphConfig, i as StatelyGraph } from "./graph-GeuH-mFK.mjs";
2
2
  import { CreateProjectInput, ProjectData, StudioClient, StudioMachineRecord, XStateVersion } from "./studio.mjs";
3
3
  import { GraphDiff } from "@statelyai/graph";
4
4