@statelyai/sdk 0.14.1 → 0.15.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/README.md CHANGED
@@ -80,9 +80,12 @@ Key capabilities:
80
80
  - **Asset uploads** with built-in S3 and Supabase adapters, or bring your own upload handler
81
81
  - **Runtime settings** - toggle color mode, grid, snap lines, autolayout, and view mode on the fly
82
82
 
83
- ### Studio API client
83
+ ### Resource API client
84
84
 
85
- Programmatic access to Stately Studio for managing projects and machines, extracting machine configs from source code, and verifying API keys.
85
+ <!-- StudioClient namespaces, DEFAULT_STATELY_BASE_URL, and StudioApiError from src/studio.ts -->
86
+
87
+ Programmatic access to hosted Stately resources, credential verification, and
88
+ deterministic machine-config extraction.
86
89
 
87
90
  ```ts
88
91
  import { createStatelyClient } from '@statelyai/sdk';
@@ -96,14 +99,55 @@ const studio = createStatelyClient({
96
99
 
97
100
  const projects = await studio.projects.list();
98
101
  const machine = await studio.machines.get('machine-id');
99
- const extracted = await studio.code.extractMachines(sourceCode);
102
+ const extracted = await studio.code.extractMachines({
103
+ code: sourceCode,
104
+ });
100
105
  ```
101
106
 
107
+ The client namespaces map one-to-one onto the server-owned `/api/v1` contract:
108
+
109
+ | Method | Operation |
110
+ | -------------------------------------------------- | ------------------------------------------------------ |
111
+ | `auth.verify()` | `GET /api/v1/auth/verify` |
112
+ | `projects.list()` | `GET /api/v1/projects` |
113
+ | `projects.create(input)` | `POST /api/v1/projects` |
114
+ | `projects.get(projectId)` | `GET /api/v1/projects/:projectId` |
115
+ | `projects.update(projectId, input)` | `PATCH /api/v1/projects/:projectId` |
116
+ | `projects.delete(projectId)` | `DELETE /api/v1/projects/:projectId` |
117
+ | `projects.listMachines(projectId)` | `GET /api/v1/projects/:projectId/machines` |
118
+ | `machines.create(input)` | `POST /api/v1/machines` |
119
+ | `machines.get(machineId)` | `GET /api/v1/machines/:machineId` |
120
+ | `machines.getVersion(machineId, versionId)` | `GET /api/v1/machines/:machineId/versions/:versionId` |
121
+ | `machines.update(machineId, input)` | `PATCH /api/v1/machines/:machineId` |
122
+ | `code.extractMachines(input)` | `POST /api/v1/code/extract-machines` |
123
+
124
+ `projects.ensure(input)` is a client workflow composed of `projects.list`,
125
+ `projects.get`, and `projects.create`, not a route.
126
+
127
+ `baseUrl` defaults to `https://editor.stately.ai`. Do not target
128
+ `stately.ai/registry` directly: Registry URLs are deprecated for clients, and
129
+ the server reaches the Registry itself when it is configured to.
130
+
131
+ Failed requests reject with `StudioApiError`, carrying `status` plus the
132
+ canonical `code`, optional `issues`, and optional `retryable` flag. Codes are
133
+ `bad_request`, `unauthenticated`, `forbidden`, `not_found`, `conflict`,
134
+ `payload_too_large`, `rate_limited`, `capability_disabled`, `upstream_error`,
135
+ and `internal_error`. Deployments with no resource provider answer resource
136
+ calls with `capability_disabled`; code extraction remains available and infers
137
+ XState v5 or v6 structurally when the version is omitted.
138
+
139
+ Deprecated inputs from earlier versions still work and normalize before the
140
+ request is sent: `{ id }` update inputs, capitalized `visibility`, an omitted
141
+ or `4` machine-create `xstateVersion` (defaulting to `5`), `machines.get(id, { version })`,
142
+ `machines.createMany` (singular semantics: one machine in a single-element
143
+ array), and `code.extractMachines(code, options)`.
144
+
102
145
  Legacy `apiKey` is still accepted as an alias for
103
146
  `credential: { type: 'api_key', token }`. The default `authMode: 'auto'` sends
104
147
  a credential when present and otherwise lets the server accept or reject an
105
148
  unauthenticated request. Use `authMode: 'bearer'` to require a credential before
106
149
  making requests, or `authMode: 'none'` to ignore a configured credential.
150
+ Resource operations always require a credential.
107
151
 
108
152
  ### Inspector
109
153
 
@@ -132,6 +176,8 @@ completed request-scoped runs stay available for inspection.
132
176
 
133
177
  XState v5 and v6 inspection events normalize to independent actor, event,
134
178
  snapshot, and stop observations before crossing the WebSocket protocol.
179
+ Observations captured before the first transport registration replay in order
180
+ after the initial actor-tree baseline. Reconnects use the latest checkpoint.
135
181
  In Node, the inspector opens in the default browser automatically. The SDK
136
182
  generates a cryptographically random session capability; hosted inspectors open
137
183
  without requiring login. The session capability controls access to the live
@@ -190,6 +236,7 @@ Key environment variables for self-hosted deployments:
190
236
  | Variable | Purpose |
191
237
  | --------------------------- | ------------------------------------------------- |
192
238
  | `AUTH_PROVIDER` | Auth strategy used by the editor host |
239
+ | `RESOURCE_PROVIDER` | Set to `stately` to enable project and machine resource operations; `none` (default) disables them |
193
240
  | `EDITOR_SYNC_AUTH_REQUIRED` | Set to `false` to skip editor-sync API-key checks |
194
241
  | `NEXT_PUBLIC_BASE_URL` | Public-facing editor URL |
195
242
 
package/dist/auth.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-DmPZiERd.mjs";
1
+ import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-2Thaw42j.mjs";
2
2
  export { StatelyAuthMode, StatelyCredential, createAuthorizationHeader, getCredentialToken };
package/dist/embed.d.mts CHANGED
@@ -1,3 +1,4 @@
1
+ import { i as StatelyGraph } from "./graph-DuOeLGvh.mjs";
1
2
  import { CapabilityDeniedEvent, CommentsConfig, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InitOptions, MachineInitOptions, MachineSourceLocations, ProjectEmbedMachine, UploadResult } from "./protocol.mjs";
2
3
  import { AssetUploadAdapter } from "./assetStorage.mjs";
3
4
 
@@ -49,9 +50,9 @@ interface StatelyEmbedOptions extends Partial<MachineInitOptions> {
49
50
  /** Asset upload configuration. If omitted, files are stored as base64 data URLs. */
50
51
  assets?: AssetConfig;
51
52
  onReady?: () => void;
52
- onLoaded?: (graph: unknown) => void;
53
- onChange?: (graph: unknown, machineConfig: unknown) => void;
54
- onSave?: (graph: unknown, machineConfig: unknown) => void;
53
+ onLoaded?: (graph: StatelyGraph) => void;
54
+ onChange?: (graph: StatelyGraph, machineConfig: unknown) => void;
55
+ onSave?: (graph: StatelyGraph, machineConfig: unknown) => void;
55
56
  onError?: (error: {
56
57
  code: string;
57
58
  message: string;
@@ -1,4 +1,4 @@
1
- import { r as CodeExpression } from "./index-DVjNSTuQ.mjs";
1
+ import { r as CodeExpression } from "./index-ag6K2iAS.mjs";
2
2
  import * as _statelyai_graph0 from "@statelyai/graph";
3
3
  import { Graph } from "@statelyai/graph";
4
4
 
@@ -18,6 +18,7 @@ interface DigraphNodeInvokeData {
18
18
  }
19
19
  interface DigraphEdgeData {
20
20
  eventTypeData: EventTypeData;
21
+ matches?: Record<string, unknown>;
21
22
  guard?: ExtractorGuard;
22
23
  transitions?: DigraphEdgeTransition[];
23
24
  actions: DigraphAction[];
@@ -203,6 +204,7 @@ interface DigraphData {
203
204
  }
204
205
  interface DigraphConfig {
205
206
  id: string;
207
+ profile?: 'xstate-v5' | 'xstate-v6-alpha';
206
208
  rootNode: DigraphNodeConfig;
207
209
  edges: DigraphEdgeConfig[];
208
210
  context: Record<string, JsonItem> | JsonExpressionString;
@@ -324,6 +326,7 @@ interface StatelyNodeData {
324
326
  }
325
327
  interface StatelyEdgeData {
326
328
  eventType: string;
329
+ matches?: Record<string, unknown>;
327
330
  transitionType?: 'normal' | 'targetless' | 'reenter';
328
331
  guard?: StatelyGuard | null;
329
332
  actions?: StatelyAction[];
@@ -332,6 +335,7 @@ interface StatelyEdgeData {
332
335
  meta?: Record<string, unknown> | null;
333
336
  }
334
337
  interface StatelyGraphData {
338
+ profile?: 'xstate-v5' | 'xstate-v6-alpha';
335
339
  schemas?: {
336
340
  context?: Record<string, SimpleJsonSchema> | null;
337
341
  events?: Record<string, SimpleJsonSchemaObject> | null;
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-R0sbxnZ7.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-DuOeLGvh.mjs";
2
2
  export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };
package/dist/graph.mjs CHANGED
@@ -286,6 +286,7 @@ function toStudioMachine(graph) {
286
286
  } } : {},
287
287
  data: {
288
288
  eventTypeData: toStudioEventTypeData(eventType),
289
+ ...edge.data.matches ? { matches: edge.data.matches } : {},
289
290
  actions: (edge.data.actions ?? []).map(toStudioAction),
290
291
  ...edge.data.guard ? { guard: {
291
292
  kind: edge.data.guard.code ? "inline" : "named",
@@ -305,6 +306,7 @@ function toStudioMachine(graph) {
305
306
  edges: studioEdges,
306
307
  context: {},
307
308
  ...graph.data?.schemas ? { schemas: normalizeSchemas(graph.data.schemas) } : {},
309
+ ...graph.data?.profile ? { profile: graph.data.profile } : {},
308
310
  ...graph.data?.implementations ? { implementations: {
309
311
  actions: Object.fromEntries(graph.data.implementations.actions.map((action) => [action.name, toActionSource(action)])),
310
312
  guards: Object.fromEntries(graph.data.implementations.guards.map((guard) => [guard.name, toGuardSource(guard)])),
@@ -332,6 +334,7 @@ function fromStudioMachine(studioMachine) {
332
334
  } : {},
333
335
  data: {
334
336
  eventType: fromStudioEventTypeData(edge.data.eventTypeData),
337
+ ...edge.data.matches ? { matches: edge.data.matches } : {},
335
338
  transitionType: edge.target ? "normal" : "targetless",
336
339
  ...edge.data.guard ? { guard: {
337
340
  type: edge.data.guard.type,
@@ -352,6 +355,7 @@ function fromStudioMachine(studioMachine) {
352
355
  })),
353
356
  edges: edges.map(({ type: _type, ...edge }) => edge),
354
357
  data: {
358
+ ...studioMachine.profile ? { profile: studioMachine.profile } : {},
355
359
  ...studioMachine.schemas ? { schemas: studioMachine.schemas } : {},
356
360
  ...studioMachine.implementations ? { implementations: {
357
361
  actions: Object.entries(studioMachine.implementations.actions).filter(([key]) => !key.startsWith("inline:")).map(([, source]) => fromActionSource(source)),
@@ -2129,6 +2129,13 @@ interface ZodReadonly<T extends SomeType = $ZodType> extends _ZodType<$ZodReadon
2129
2129
  }
2130
2130
  declare const ZodReadonly: $constructor<ZodReadonly>;
2131
2131
  //#endregion
2132
+ //#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.24/node_modules/xstate/dist/declarations/src/index.d.ts
2133
+ declare global {
2134
+ interface SymbolConstructor {
2135
+ readonly observable: symbol;
2136
+ }
2137
+ }
2138
+ //#endregion
2132
2139
  //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
2133
2140
  // ==================================================================================================
2134
2141
  // JSON Schema Draft 07
@@ -2270,6 +2277,10 @@ interface JSONSchema7 {
2270
2277
  //#endregion
2271
2278
  //#region ../graph-tools/dist/index.d.mts
2272
2279
  //#endregion
2280
+ //#region src/machineProfile.d.ts
2281
+ declare const MACHINE_PROFILES: readonly ["xstate-v5", "xstate-v6-alpha"];
2282
+ type MachineProfile = (typeof MACHINE_PROFILES)[number];
2283
+ //#endregion
2273
2284
  //#region src/codegenTypes.d.ts
2274
2285
  interface CodeGenAction {
2275
2286
  /** Graph-native block id, referenced by `@statelyai.action.*` transitions. */
@@ -2303,8 +2314,12 @@ interface CodeImport {
2303
2314
  }
2304
2315
  interface CodeGenInvoke {
2305
2316
  src: string;
2317
+ /** Exact authored actor-logic expression for inline/direct actor sources. */
2318
+ srcExpression?: CodeExpression;
2306
2319
  id: string;
2307
2320
  invocationId?: string;
2321
+ registryKey?: string;
2322
+ timeout?: number | string | CodeExpression;
2308
2323
  input?: Record<string, unknown> | CodeExpression;
2309
2324
  output?: Record<string, unknown> | CodeExpression;
2310
2325
  }
@@ -2313,6 +2328,9 @@ interface CodeGenNodeData {
2313
2328
  key: string;
2314
2329
  type?: 'normal' | 'parallel' | 'final' | 'history' | 'choice' | null;
2315
2330
  initialId?: string | null;
2331
+ initialInput?: Record<string, unknown> | CodeExpression;
2332
+ timeout?: number | string | CodeExpression;
2333
+ route?: Record<string, unknown> | CodeExpression;
2316
2334
  history?: 'shallow' | 'deep' | boolean;
2317
2335
  output?: Record<string, unknown> | CodeExpression;
2318
2336
  entry?: CodeGenAction[];
@@ -2329,14 +2347,18 @@ interface CodeGenNodeData {
2329
2347
  }
2330
2348
  interface CodeGenEdgeData {
2331
2349
  eventType: string;
2350
+ matches?: Record<string, unknown>;
2332
2351
  transitionType?: 'normal' | 'targetless' | 'reenter';
2333
2352
  guard?: CodeGenGuard | null;
2334
2353
  context?: Record<string, unknown> | CodeExpression;
2354
+ input?: Record<string, unknown> | CodeExpression;
2335
2355
  actions?: CodeGenAction[];
2336
2356
  description?: string | null;
2337
2357
  color?: string;
2338
2358
  meta?: Record<string, unknown> | null;
2339
2359
  temp?: unknown;
2360
+ /** Derived visualization edge for a destination state's `route` config. */
2361
+ route?: boolean;
2340
2362
  }
2341
2363
  interface CodeGenImplementation {
2342
2364
  id: string;
@@ -2362,6 +2384,7 @@ interface CodeGenActorImplementation {
2362
2384
  } | null;
2363
2385
  }
2364
2386
  interface CodeGenGraphData {
2387
+ profile?: MachineProfile;
2365
2388
  context?: Record<string, unknown> | CodeExpression | null;
2366
2389
  schemas?: {
2367
2390
  context?: Record<string, JSONSchema7> | null;
@@ -2422,6 +2445,12 @@ declare class RawCode {
2422
2445
  }
2423
2446
  declare function raw(code: string): RawCode;
2424
2447
  declare function serializeJS(value: unknown, indent?: number, step?: number): string; //#endregion
2448
+ //#region src/v6Simulation.d.ts
2449
+ /**
2450
+ * Adapts Viz's serializable choice projection to XState v6's executable
2451
+ * `choice` function. Other v6 config stays untouched.
2452
+ */
2453
+ //#endregion
2425
2454
  //#region src/graphToXStateTS.d.ts
2426
2455
  interface XStateTSOptions extends MachineConfigOptions {
2427
2456
  exportStyle?: 'named' | 'default' | 'none';
@@ -2510,6 +2539,9 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2510
2539
  }>>>;
2511
2540
  description: ZodOptional<ZodString>;
2512
2541
  initialId: ZodOptional<ZodNullable<ZodString>>;
2542
+ initialInput: ZodOptional<ZodUnknown>;
2543
+ timeout: ZodOptional<ZodUnknown>;
2544
+ route: ZodOptional<ZodUnknown>;
2513
2545
  }, $strip>;
2514
2546
  }, $strip>, ZodObject<{
2515
2547
  op: ZodLiteral<"deleteNode">;
@@ -2522,6 +2554,7 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2522
2554
  sourceId: ZodString;
2523
2555
  targetId: ZodString;
2524
2556
  eventType: ZodString;
2557
+ matches: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2525
2558
  transitionType: ZodOptional<ZodEnum<{
2526
2559
  normal: "normal";
2527
2560
  targetless: "targetless";
@@ -2535,12 +2568,14 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2535
2568
  sourceId: ZodOptional<ZodString>;
2536
2569
  targetId: ZodOptional<ZodString>;
2537
2570
  eventType: ZodOptional<ZodString>;
2571
+ matches: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2538
2572
  transitionType: ZodOptional<ZodEnum<{
2539
2573
  normal: "normal";
2540
2574
  targetless: "targetless";
2541
2575
  reenter: "reenter";
2542
2576
  }>>;
2543
2577
  description: ZodOptional<ZodNullable<ZodString>>;
2578
+ input: ZodOptional<ZodUnknown>;
2544
2579
  }, $strip>;
2545
2580
  }, $strip>, ZodObject<{
2546
2581
  op: ZodLiteral<"deleteEdge">;
@@ -2586,6 +2621,9 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2586
2621
  }>>>;
2587
2622
  stateDescription: ZodOptional<ZodString>;
2588
2623
  initialId: ZodOptional<ZodNullable<ZodString>>;
2624
+ initialInput: ZodOptional<ZodUnknown>;
2625
+ timeout: ZodOptional<ZodUnknown>;
2626
+ route: ZodOptional<ZodUnknown>;
2589
2627
  color: ZodOptional<ZodNullable<ZodEnum<{
2590
2628
  green: "green";
2591
2629
  red: "red";
@@ -2612,6 +2650,7 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2612
2650
  sourceId: ZodString;
2613
2651
  targetId: ZodString;
2614
2652
  eventType: ZodString;
2653
+ matches: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2615
2654
  transitionType: ZodOptional<ZodEnum<{
2616
2655
  normal: "normal";
2617
2656
  targetless: "targetless";
@@ -2633,6 +2672,7 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2633
2672
  teal: "teal";
2634
2673
  }>>>;
2635
2674
  transitionDescription: ZodOptional<ZodNullable<ZodString>>;
2675
+ input: ZodOptional<ZodUnknown>;
2636
2676
  }, $strip>, ZodObject<{
2637
2677
  op: ZodLiteral<"updateTransition">;
2638
2678
  description: ZodOptional<ZodString>;
@@ -2640,12 +2680,14 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2640
2680
  sourceId: ZodOptional<ZodString>;
2641
2681
  targetId: ZodOptional<ZodString>;
2642
2682
  eventType: ZodOptional<ZodString>;
2683
+ matches: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2643
2684
  transitionType: ZodOptional<ZodEnum<{
2644
2685
  normal: "normal";
2645
2686
  targetless: "targetless";
2646
2687
  reenter: "reenter";
2647
2688
  }>>;
2648
2689
  transitionDescription: ZodOptional<ZodNullable<ZodString>>;
2690
+ input: ZodOptional<ZodUnknown>;
2649
2691
  color: ZodOptional<ZodNullable<ZodEnum<{
2650
2692
  green: "green";
2651
2693
  red: "red";
@@ -2720,9 +2762,12 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2720
2762
  id: ZodOptional<ZodString>;
2721
2763
  invocationId: ZodOptional<ZodString>;
2722
2764
  src: ZodString;
2765
+ srcExpression: ZodOptional<ZodUnknown>;
2723
2766
  code: ZodOptional<ZodString>;
2724
- input: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2725
- output: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2767
+ registryKey: ZodOptional<ZodString>;
2768
+ timeout: ZodOptional<ZodUnknown>;
2769
+ input: ZodOptional<ZodUnknown>;
2770
+ output: ZodOptional<ZodUnknown>;
2726
2771
  }, $strip>;
2727
2772
  }, $strip>, ZodObject<{
2728
2773
  op: ZodLiteral<"updateInvoke">;
@@ -2732,9 +2777,12 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2732
2777
  data: ZodObject<{
2733
2778
  invocationId: ZodOptional<ZodString>;
2734
2779
  src: ZodOptional<ZodString>;
2780
+ srcExpression: ZodOptional<ZodUnknown>;
2735
2781
  code: ZodOptional<ZodString>;
2736
- input: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2737
- output: ZodOptional<ZodRecord<ZodString, ZodUnknown>>;
2782
+ registryKey: ZodOptional<ZodString>;
2783
+ timeout: ZodOptional<ZodUnknown>;
2784
+ input: ZodOptional<ZodUnknown>;
2785
+ output: ZodOptional<ZodUnknown>;
2738
2786
  }, $strip>;
2739
2787
  }, $strip>, ZodObject<{
2740
2788
  op: ZodLiteral<"deleteInvoke">;
@@ -2840,4 +2888,4 @@ declare const graphPatchSchema: ZodDiscriminatedUnion<[ZodObject<{
2840
2888
  type GraphPatch = output<typeof graphPatchSchema>;
2841
2889
  /** AI-only schema: semantic ops + shared ops (no generic graph ops) */
2842
2890
  //#endregion
2843
- export { serializeJS as _, EditorStateType as a, MachineConfigOptions as c, contextSchemaToTSType as d, eventsSchemaToTSType as f, raw as g, jsonSchemaToTSType as h, CodeGenGraph as i, RawCode as l, graphToXStateTS as m, CanvasColor as n, GraphPatch as o, graphToMachineConfig as p, CodeExpression as r, ImplementationSourceType as s, ActionLocation as t, XStateTSOptions as u };
2891
+ export { $strip as A, ZodObject as C, ZodUnion as D, ZodString as E, ZodUnknown as O, ZodNumber as S, ZodRecord as T, serializeJS as _, EditorStateType as a, ZodLiteral as b, MachineConfigOptions as c, contextSchemaToTSType as d, eventsSchemaToTSType as f, raw as g, jsonSchemaToTSType as h, CodeGenGraph as i, output as k, RawCode as l, graphToXStateTS as m, CanvasColor as n, GraphPatch as o, graphToMachineConfig as p, CodeExpression as r, ImplementationSourceType as s, ActionLocation as t, XStateTSOptions as u, ZodArray as v, ZodOptional as w, ZodNullable as x, ZodEnum as y };
package/dist/index.d.mts CHANGED
@@ -1,12 +1,12 @@
1
1
  import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
2
+ import { _ as serializeJS, c as MachineConfigOptions, d as contextSchemaToTSType, f as eventsSchemaToTSType, g as raw, h as jsonSchemaToTSType, i as CodeGenGraph, l as RawCode, m as graphToXStateTS, o as GraphPatch, p as graphToMachineConfig, t as ActionLocation, u as XStateTSOptions } from "./index-ag6K2iAS.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-DuOeLGvh.mjs";
2
4
  import { CapabilityDeniedCapability, CapabilityDeniedEvent, CommentsConfig, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, INSPECTION_PROTOCOL_VERSION, InitOptions, InspectionAction, InspectionSentEvent, InspectionTakenTransition, ProjectEmbedMachine, UploadResult } from "./protocol.mjs";
3
5
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
4
- import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-DmPZiERd.mjs";
6
+ import { i as getCredentialToken, n as StatelyCredential, r as createAuthorizationHeader, t as StatelyAuthMode } from "./auth-2Thaw42j.mjs";
5
7
  import { AssetConfig, StatelyEmbed, StatelyEmbedOptions, createStatelyEmbed } from "./embed.mjs";
6
- import { _ as serializeJS, c as MachineConfigOptions, d as contextSchemaToTSType, f as eventsSchemaToTSType, g as raw, h as jsonSchemaToTSType, i as CodeGenGraph, l as RawCode, m as graphToXStateTS, o as GraphPatch, p as graphToMachineConfig, t as ActionLocation, u as XStateTSOptions } from "./index-DVjNSTuQ.mjs";
7
- 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-R0sbxnZ7.mjs";
8
- import { _ as createPostMessageTransport, a as InspectedTransition, c as InspectorInspectionEvent, d as createStatelyInspector, f as MultiplexedChannelOptions, g as createMultiplexedWebSocketConnection, h as Transport, i as InspectedSnapshot, l as ManualActorOptions, m as MultiplexedWebSocketConnectionOptions, n as CreateInspectorOptions, o as Inspector, p as MultiplexedWebSocketConnection, r as InspectedEvent, s as InspectorEvents, t as AdoptedActor, u as createInspector, v as createWebSocketTransport } from "./inspect-DQ_7I7eH.mjs";
9
- 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
+ import { _ as createPostMessageTransport, a as InspectedTransition, c as InspectorInspectionEvent, d as createStatelyInspector, f as MultiplexedChannelOptions, g as createMultiplexedWebSocketConnection, h as Transport, i as InspectedSnapshot, l as ManualActorOptions, m as MultiplexedWebSocketConnectionOptions, n as CreateInspectorOptions, o as Inspector, p as MultiplexedWebSocketConnection, r as InspectedEvent, s as InspectorEvents, t as AdoptedActor, u as createInspector, v as createWebSocketTransport } from "./inspect-DenVP7IE.mjs";
9
+ 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-Da5pyxv6.mjs";
10
10
  import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
11
11
  import { PlanSyncOptions, PullSyncResult, PushLocalMachineLinksResult, PushSyncOptions, PushSyncProjectOptions, PushSyncResult, ResolvedSyncInput, SyncInputFormat, SyncPlan, SyncPlanSummary } from "./sync.mjs";
12
12
  import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
@@ -32,4 +32,4 @@ declare function findStatelyPragmaAttachments(sourceText: string, fileName?: str
32
32
  declare function getStatelyPragma(sourceText: string, fileName?: string, machineIndex?: number): StatelyPragma | undefined;
33
33
  declare function upsertStatelyPragma(sourceText: string, id: string, options?: UpsertStatelyPragmaOptions): string;
34
34
  //#endregion
35
- 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, type DigraphAction, type DigraphConfig, type DigraphEdgeConfig, type DigraphNodeConfig, type EditorCapabilities, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedMode, type EnsureProjectInput, type EventTypeData, type ExportCallOptions, type ExportFormat, type ExportFormatMap, type ExtractMachinesResponse, type ExtractedMachine, type GetMachineOptions, type GraphPatch, INSPECTION_PROTOCOL_VERSION, 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 InspectorEvents, type InspectorInspectionEvent, type MachineConfigOptions, type ManualActorOptions, type MultiplexedChannelOptions, type MultiplexedWebSocketConnection, type MultiplexedWebSocketConnectionOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSyncOptions, type ProjectData, type ProjectEmbedMachine, type ProjectMachine, type ProjectVisibility, type PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, type RepoType, type ResolvedSyncInput, 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 StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type SupabaseStorageClient, type SyncInputFormat, type SyncPlan, type SyncPlanSummary, type Transport, type UpdateMachineInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type XStateTSOptions, type XStateVersion, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionRelay, createInspector, createMultiplexedWebSocketConnection, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
35
+ 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, type EditorCapabilities, type EmbedEventHandler, type EmbedEventMap, type EmbedEventName, type EmbedMode, 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, 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 InspectorEvents, type InspectorInspectionEvent, type LegacyProjectVisibility, type LegacyUpdateMachineInput, type Machine, type MachineConfigOptions, type MachineVersion, type ManualActorOptions, type MultiplexedChannelOptions, type MultiplexedWebSocketConnection, type MultiplexedWebSocketConnectionOptions, 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 PullSyncResult, type PushLocalMachineLinksResult, type PushSyncOptions, type PushSyncProjectOptions, type PushSyncResult, RawCode, 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 UpdateMachineInput, type UpdateProjectInput, type UploadResult, type UpsertStatelyPragmaOptions, type VerifyApiKeyResponse, type VerifyResult, type XStateTSOptions, type XStateVersion, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionRelay, createInspector, createMultiplexedWebSocketConnection, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
package/dist/index.mjs CHANGED
@@ -2,13 +2,13 @@ import { n as createPostMessageTransport, r as createWebSocketTransport, t as cr
2
2
  import { INSPECTION_PROTOCOL_VERSION } from "./protocol.mjs";
3
3
  import { createStatelyEmbed } from "./embed.mjs";
4
4
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
5
- import { n as createStatelyInspector, t as createInspector } from "./inspect-BcKTFJI1.mjs";
5
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-DWDTNMEc.mjs";
6
+ import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-txdyJHD7.mjs";
7
+ import { a as RawCode, c as eventsSchemaToTSType, d as jsonSchemaToTSType, f as raw, l as graphToMachineConfig, n as getStatelyPragma, o as contextSchemaToTSType, p as serializeJS, r as upsertStatelyPragma, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-Bm9O4XV6.mjs";
6
8
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
7
- import { StudioApiError, createStatelyClient } from "./studio.mjs";
8
9
  import { buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
9
10
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
10
- import { a as eventsSchemaToTSType, c as jsonSchemaToTSType, f as findStatelyPragmaAttachments, l as raw, m as upsertStatelyPragma, n as RawCode, o as graphToMachineConfig, p as getStatelyPragma, r as contextSchemaToTSType, s as graphToXStateTS, u as serializeJS } from "./dist-C8jVuuHf.mjs";
11
11
  import { fromStudioMachine, studioMachineConverter, toStudioMachine } from "./graph.mjs";
12
12
  import { createInspectionRelay } from "./relay.mjs";
13
13
 
14
- export { INSPECTION_PROTOCOL_VERSION, RawCode, StatelyApiError, StudioApiError, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionRelay, createInspector, createMultiplexedWebSocketConnection, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
14
+ export { DEFAULT_STATELY_BASE_URL, INSPECTION_PROTOCOL_VERSION, RawCode, StatelyApiError, StudioApiError, buildAuthorizeUrl, contextSchemaToTSType, createAuthorizationHeader, createInspectionRelay, createInspector, createMultiplexedWebSocketConnection, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, eventsSchemaToTSType, exchangeCodeForToken, findStatelyPragmaAttachments, fromStudioMachine, getCredentialToken, getStatelyPragma, graphToMachineConfig, graphToXStateTS, jsonSchemaToTSType, raw, refreshToken, registerOAuthClient, serializeJS, studioMachineConverter, toStudioMachine, upsertStatelyPragma };
@@ -61,6 +61,7 @@ function createInspector(options = {}) {
61
61
  let initSent = false;
62
62
  let initialized = false;
63
63
  let pendingTransportReady = false;
64
+ let transportWasReady = false;
64
65
  let didAutoOpen = false;
65
66
  const pendingMessages = [];
66
67
  const events = createEventRegistry();
@@ -81,9 +82,16 @@ function createInspector(options = {}) {
81
82
  transport.send(msg);
82
83
  }
83
84
  function handleTransportReady() {
84
- pendingMessages.length = 0;
85
- initSent = false;
86
- sendInit();
85
+ if (!transportWasReady) {
86
+ transportWasReady = true;
87
+ if (!initSent) sendInit();
88
+ const queued = pendingMessages.splice(0);
89
+ for (const message of queued) transport.send(message);
90
+ } else {
91
+ pendingMessages.length = 0;
92
+ initSent = false;
93
+ sendInit();
94
+ }
87
95
  if (autoOpen && !didAutoOpen && ownsTransport) {
88
96
  didAutoOpen = true;
89
97
  const launchUrl = createInspectorLaunchUrl(url, sessionId);
@@ -372,7 +380,7 @@ function createInspector(options = {}) {
372
380
  break;
373
381
  default: break;
374
382
  }
375
- if (isNewRoot && initSent) sendInit();
383
+ if (isNewRoot) sendInit();
376
384
  }
377
385
  function attachActor(actor) {
378
386
  const root = actor;
@@ -386,7 +394,7 @@ function createInspector(options = {}) {
386
394
  subscription
387
395
  });
388
396
  backfillActorTree(root, rootActorId);
389
- if (initSent) sendInit();
397
+ sendInit();
390
398
  return { unsubscribe() {
391
399
  subscription.unsubscribe();
392
400
  inspectedRoots.delete(rootActorId);
@@ -405,7 +413,8 @@ function createInspector(options = {}) {
405
413
  machineConfig: opts?.machine ?? null
406
414
  };
407
415
  actors.set(id, entry);
408
- if (initSent) send({
416
+ if (!initSent) sendInit();
417
+ else send({
409
418
  type: "@statelyai.system.actorRegistered",
410
419
  actorId: id,
411
420
  parentActorId: entry.parentActorId,
@@ -1,3 +1,3 @@
1
1
  import { EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InspectionAction, InspectionSentEvent, InspectionTakenTransition } from "./protocol.mjs";
2
- import { a as InspectedTransition, c as InspectorInspectionEvent, d as createStatelyInspector, h as Transport, i as InspectedSnapshot, l as ManualActorOptions, n as CreateInspectorOptions, o as Inspector, r as InspectedEvent, s as InspectorEvents, t as AdoptedActor, u as createInspector } from "./inspect-DQ_7I7eH.mjs";
2
+ import { a as InspectedTransition, c as InspectorInspectionEvent, d as createStatelyInspector, h as Transport, i as InspectedSnapshot, l as ManualActorOptions, n as CreateInspectorOptions, o as Inspector, r as InspectedEvent, s as InspectorEvents, t as AdoptedActor, u as createInspector } from "./inspect-DenVP7IE.mjs";
3
3
  export { AdoptedActor, CreateInspectorOptions, EditorCapabilities, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedMode, ExportCallOptions, ExportFormat, ExportFormatMap, InspectedEvent, InspectedSnapshot, InspectedTransition, InspectionAction, InspectionSentEvent, InspectionTakenTransition, Inspector, InspectorEvents, InspectorInspectionEvent, ManualActorOptions, Transport, createInspector, createStatelyInspector };
package/dist/inspect.mjs CHANGED
@@ -1,3 +1,3 @@
1
- import { n as createStatelyInspector, t as createInspector } from "./inspect-BcKTFJI1.mjs";
1
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-DWDTNMEc.mjs";
2
2
 
3
3
  export { createInspector, createStatelyInspector };
@@ -1,2 +1,2 @@
1
- import { a as EditorStateType, n as CanvasColor, o as GraphPatch, s as ImplementationSourceType, t as ActionLocation } from "./index-DVjNSTuQ.mjs";
1
+ import { a as EditorStateType, n as CanvasColor, o as GraphPatch, s as ImplementationSourceType, t as ActionLocation } from "./index-ag6K2iAS.mjs";
2
2
  export { type ActionLocation, type CanvasColor, type EditorStateType, type GraphPatch, type ImplementationSourceType };
@@ -1,3 +1,5 @@
1
+ import { i as StatelyGraph } from "./graph-DuOeLGvh.mjs";
2
+
1
3
  //#region src/protocol.d.ts
2
4
  type EmbedMode = "editing" | "viewing" | "simulating" | "inspecting";
3
5
  interface CommentsConfig {
@@ -139,19 +141,19 @@ interface EmbedEventMap {
139
141
  version: string;
140
142
  };
141
143
  loaded: {
142
- graph: unknown;
144
+ graph: StatelyGraph;
143
145
  machineId?: string;
144
146
  sourceLocations?: MachineSourceLocations;
145
147
  };
146
148
  change: {
147
- graph: unknown;
149
+ graph: StatelyGraph;
148
150
  machineConfig: unknown;
149
151
  machineId?: string;
150
152
  patches?: unknown[];
151
153
  sourceLocations?: MachineSourceLocations;
152
154
  };
153
155
  save: {
154
- graph: unknown;
156
+ graph: StatelyGraph;
155
157
  machineConfig: unknown;
156
158
  machineId?: string;
157
159
  patches?: unknown[];
@@ -427,13 +429,13 @@ interface ReadyMessage {
427
429
  }
428
430
  interface LoadedMessage {
429
431
  type: "@statelyai.loaded";
430
- graph: unknown;
432
+ graph: StatelyGraph;
431
433
  machineId?: string;
432
434
  sourceLocations?: MachineSourceLocations;
433
435
  }
434
436
  interface ChangeMessage {
435
437
  type: "@statelyai.change";
436
- graph: unknown;
438
+ graph: StatelyGraph;
437
439
  machineConfig: unknown;
438
440
  machineId?: string;
439
441
  patches?: unknown[];
@@ -441,7 +443,7 @@ interface ChangeMessage {
441
443
  }
442
444
  interface SaveMessage {
443
445
  type: "@statelyai.save";
444
- graph: unknown;
446
+ graph: StatelyGraph;
445
447
  machineConfig: unknown;
446
448
  machineId?: string;
447
449
  patches?: unknown[];