@statelyai/sdk 0.37.2 → 0.37.4

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
@@ -70,6 +70,13 @@ if (plan.status === 'changed') {
70
70
  if (plan.status === 'unsupported') console.warn(plan.reason);
71
71
  ```
72
72
 
73
+ Compound-state renames preserve omitted descendant IDs, including graphs from
74
+ older imports; IDs authored in the original source remain intact. The SDK supplies
75
+ an immutable loaded graph as `previousGraph` to distinguish intentionally changed
76
+ IDs from inherited legacy IDs. You may supply `previousGraph` explicitly; capture
77
+ it before editing and advance it after a successful source commit. Without that
78
+ baseline, ambiguous ID changes return `unsupported` instead of discarding an ID.
79
+
73
80
  JSON and JSONC contain one machine; omit `source.machineIndex` for this method.
74
81
  The call returns the complete updated text, focused zero-based UTF-16
75
82
  `edits`, and a semantic graph `diff`. The graph diff is not a Git patch; GitLab
@@ -286,9 +293,15 @@ blocked viewer actions. See [inspector controls](../../docs/sdk/inspector.md#vie
286
293
  If you already have the actor reference, `inspector.attach(actor)` subscribes to
287
294
  its system and backfills actors that are already running.
288
295
 
289
- When authored source is available, return it from `extractMachine` so the
290
- visualizer preserves executable guards, inputs, and outputs instead of only a
291
- JSON-safe machine structure:
296
+ XState v6 machines automatically send a versioned JSON definition with inline
297
+ functions preserved as code expressions. The viewer parses those expressions
298
+ without executing them, draws statically identifiable destinations, and marks
299
+ unresolved destinations as dynamic rather than reporting false unreachable
300
+ states. XState v5 machines keep their existing config payload.
301
+
302
+ When authored source is available, return it from `extractMachine` to retain
303
+ local bindings and imports that function text alone cannot recover. An explicit
304
+ extractor overrides automatic serialization:
292
305
 
293
306
  ```ts
294
307
  const inspector = createInspector({
@@ -451,6 +464,16 @@ from graph data. Source generation is part of the private Editor Sync workflow.
451
464
  For pricing and support, contact
452
465
  [team@stately.ai](mailto:team@stately.ai).
453
466
 
467
+ ## Machine JSON schemas
468
+
469
+ <!-- JSON schema exports from package.json and schemas/ -->
470
+
471
+ Use `@statelyai/sdk/xstate-v6.schema.json` to validate the `MachineJSON` loader format accepted by XState v6's `createMachineFromConfig`, including `@expr` expressions and `@xstate.*` action objects. It uses JSON Schema draft 2020-12.
472
+
473
+ This loader format has its own contract: transition `actions` must be arrays, history states require a non-empty fallback `target`, and state `onDone` and root `options` are unsupported. Code-authored `createMachine` configurations and the editor's general `xstate-json` exports can contain fields or shorthand outside this loader format.
474
+
475
+ `@statelyai/sdk/xstate.schema.json` and `xstate-json.schema.json` continue to describe v5 definitions. The schemas are also available under the `schemas/` export paths.
476
+
454
477
  ## Self-hosting
455
478
 
456
479
  <!-- self-host configuration from the editor app auth and editor-sync routes -->
@@ -1,4 +1,4 @@
1
- import { qt as UploadResult } from "./protocol-CFK_R0rt.mjs";
1
+ import { Jt as UploadResult } from "./protocol-Dlo9C3lj.mjs";
2
2
 
3
3
  //#region src/assetStorage.d.ts
4
4
  interface AssetUploadContext {
@@ -1,4 +1,4 @@
1
- import { cn as EmbedPanelConfig, dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, n as AuthenticationRecovery, sn as PresentationMetadataInitializer } from "./protocol-CFK_R0rt.mjs";
1
+ import { dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, ln as PresentationMetadataInitializer, n as AuthenticationRecovery, un as EmbedPanelConfig } from "./protocol-Dlo9C3lj.mjs";
2
2
  import { a as MachineSourceLocations, t as EditorCapabilities } from "./editor-sync-types-U5uryWOk.mjs";
3
3
 
4
4
  //#region src/editorHostProtocol.d.ts
package/dist/embed.d.mts CHANGED
@@ -1,6 +1,6 @@
1
- import { n as ProfileManifest } from "./index-CoxF4Saw.mjs";
2
- import { i as StatelyGraph } from "./graph-B6xUxqR5.mjs";
3
- import { A as ExportFormatMap, C as EmbedExtensionsManifest, I as InitOptions, O as ExportCallOptions, T as EmbedMode, X as MachineVersionAutoSaveOptions, Y as MachineSourceLocations, Zt as ViewerOptions, _ as EmbedDocument, b as EmbedEventMap, cn as EmbedPanelConfig, ct as ProjectWorkspaceActionIcon, dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, k as ExportFormat, ln as EmbedPanelPosition, nt as ProjectInitOptions, pt as ProjectWorkspaceMachineOrigin, q as MachineInitOptions, qt as UploadResult, st as ProjectWorkspaceAction, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-CFK_R0rt.mjs";
1
+ import { n as ProfileManifest } from "./index-P3fyMvvk.mjs";
2
+ import { i as StatelyGraph } from "./graph-C_G5qXKW.mjs";
3
+ import { A as ExportFormatMap, C as EmbedExtensionsManifest, I as InitOptions, Jt as UploadResult, O as ExportCallOptions, Qt as ViewerOptions, T as EmbedMode, X as MachineVersionAutoSaveOptions, Y as MachineSourceLocations, _ as EmbedDocument, b as EmbedEventMap, ct as ProjectWorkspaceActionIcon, dn as EmbedPanelPosition, dt as ProjectWorkspaceConfig, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, k as ExportFormat, nt as ProjectInitOptions, pt as ProjectWorkspaceMachineOrigin, q as MachineInitOptions, st as ProjectWorkspaceAction, un as EmbedPanelConfig, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-Dlo9C3lj.mjs";
4
4
  import { AssetUploadAdapter } from "./assetStorage.mjs";
5
5
  import { GraphDiff } from "@statelyai/graph";
6
6
 
@@ -65,6 +65,8 @@ interface PlanSourceUpdateInput {
65
65
  };
66
66
  /** Edited graph from the embed, with stable node and edge IDs. */
67
67
  nextGraph: StatelyGraph;
68
+ /** Graph captured before editing. Defaults to the latest matching loaded snapshot. */
69
+ previousGraph?: StatelyGraph;
68
70
  }
69
71
  type EmbedFormatContext = {
70
72
  profile: EmbedProfileDefinition;
package/dist/embed.mjs CHANGED
@@ -1,5 +1,5 @@
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-jzP2mGvy.mjs";
1
+ import "./protocol-M3Zeun3o.mjs";
2
+ import { c as createPendingExportManager, l as settingsWithViewMode, r as createPostMessageTransport, s as createEventRegistry, t as SDK_VERSION, u as toInitMessage } from "./version-BeGmL5w7.mjs";
3
3
  import { EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol.mjs";
4
4
 
5
5
  //#region src/embed.ts
@@ -127,6 +127,7 @@ function createStatelyEmbed(options) {
127
127
  let iframe = null;
128
128
  let transport = null;
129
129
  let ownedIframe = false;
130
+ let sourceUpdateBaseline;
130
131
  let destroyed = false;
131
132
  let editorProtocolCompatible;
132
133
  let apiKey = normalizeApiKey(options.apiKey);
@@ -268,6 +269,7 @@ function createStatelyEmbed(options) {
268
269
  }
269
270
  case "@statelyai.loaded": {
270
271
  const loaded = data;
272
+ sourceUpdateBaseline = structuredClone(loaded.graph);
271
273
  options.onLoaded?.(loaded.graph);
272
274
  events.emit("loaded", {
273
275
  graph: loaded.graph,
@@ -546,6 +548,9 @@ function createStatelyEmbed(options) {
546
548
  },
547
549
  async planSourceUpdate(input) {
548
550
  if (destroyed) throw new Error("Embed is destroyed");
551
+ const rootId = (graph) => graph.nodes.find((node) => node.parentId == null)?.id;
552
+ const matchingBaseline = sourceUpdateBaseline && rootId(sourceUpdateBaseline) === rootId(input.nextGraph) ? sourceUpdateBaseline : void 0;
553
+ const previousGraph = input.previousGraph ?? matchingBaseline;
549
554
  const response = await fetch(new URL("/api/editor-sync/plan-source-update", options.baseUrl), {
550
555
  method: "POST",
551
556
  headers: {
@@ -553,7 +558,10 @@ function createStatelyEmbed(options) {
553
558
  "X-Stately-Editor-Sync-Version": "1",
554
559
  ...apiKey ? { Authorization: `Bearer ${apiKey}` } : {}
555
560
  },
556
- body: JSON.stringify(input)
561
+ body: JSON.stringify(previousGraph ? {
562
+ ...input,
563
+ previousGraph
564
+ } : input)
557
565
  });
558
566
  const protocolVersion = response.headers.get("X-Stately-Editor-Sync-Version");
559
567
  if (protocolVersion !== null && protocolVersion !== "1") throw new Error(`Unsupported editor-sync protocol ${protocolVersion}`);
@@ -1,4 +1,4 @@
1
- import { t as CodeExpression } from "./index-CoxF4Saw.mjs";
1
+ import { t as CodeExpression } from "./index-P3fyMvvk.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-B6xUxqR5.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-C_G5qXKW.mjs";
2
2
  export { StatelyAction, StatelyActorImplementation, StatelyEdgeData, StatelyGraph, StatelyGraphData, StatelyGuard, StatelyImplementation, StatelyInvoke, StatelyNodeData, StatelyTagImplementation, StudioAction, StudioEdge, StudioEventTypeData, StudioMachine, StudioNode, fromStudioMachine, studioMachineConverter, toStudioMachine };
@@ -190,7 +190,7 @@ declare const $output: unique symbol;
190
190
  type $output = typeof $output;
191
191
  declare const $input: unique symbol;
192
192
  type $input = typeof $input;
193
- type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S> } : Meta;
193
+ type $replace<Meta, S extends $ZodType> = Meta extends $output ? output<S> : Meta extends $input ? input$1<S> : Meta extends (infer M)[] ? $replace<M, S>[] : Meta extends ((...args: infer P) => infer R) ? (...args: { [K in keyof P]: $replace<P[K], S> }) => $replace<R, S> : Meta extends object ? { [K in keyof Meta]: $replace<Meta[K], S> } : Meta;
194
194
  type MetadataType = object | undefined;
195
195
  declare class $ZodRegistry<Meta extends MetadataType = MetadataType, Schema extends $ZodType = $ZodType> {
196
196
  _meta: Meta;
@@ -296,7 +296,7 @@ interface ToJSONSchemaContext {
296
296
  defs: Record<string, BaseSchema>;
297
297
  } | undefined;
298
298
  }
299
- type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
299
+ type ZodStandardSchemaWithJSON$1<T> = StandardSchemaWithJSONProps<input$1<T>, output<T>>;
300
300
  interface ZodStandardJSONSchemaPayload<T> extends BaseSchema {
301
301
  "~standard": ZodStandardSchemaWithJSON$1<T>;
302
302
  }
@@ -434,7 +434,7 @@ interface $ZodTypeInternals<out O = unknown, out I = unknown> extends _$ZodTypeI
434
434
  /** @internal The inferred input type */
435
435
  input: I;
436
436
  }
437
- type $ZodStandardSchema<T> = StandardSchemaV1.Props<input<T>, output<T>>;
437
+ type $ZodStandardSchema<T> = StandardSchemaV1.Props<input$1<T>, output<T>>;
438
438
  type SomeType = {
439
439
  _zod: _$ZodTypeInternals;
440
440
  };
@@ -814,7 +814,7 @@ interface $ZodArrayInternals<T extends SomeType = $ZodType> extends _$ZodTypeInt
814
814
  def: $ZodArrayDef<T>;
815
815
  isst: $ZodIssueInvalidType;
816
816
  output: output<T>[];
817
- input: input<T>[];
817
+ input: input$1<T>[];
818
818
  }
819
819
  interface $ZodArray<T extends SomeType = $ZodType> extends $ZodType<any, any, $ZodArrayInternals<T>> {}
820
820
  declare const $ZodArray: $constructor<$ZodArray>;
@@ -829,7 +829,7 @@ type OptionalInSchema = {
829
829
  };
830
830
  };
831
831
  type $InferObjectOutput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, output<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalOutSchema ? never : k]: T[k]["_zod"]["output"] } & { -readonly [k in keyof T as T[k] extends OptionalOutSchema ? k : never]?: T[k]["_zod"]["output"] } & Extra>;
832
- type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"] } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"] } & Extra>;
832
+ type $InferObjectInput<T extends $ZodLooseShape, Extra extends Record<string, unknown>> = string extends keyof T ? IsAny<T[keyof T]> extends true ? Record<string, unknown> : Record<string, input$1<T[keyof T]>> : keyof (T & Extra) extends never ? Record<string, never> : Prettify<{ -readonly [k in keyof T as T[k] extends OptionalInSchema ? never : k]: T[k]["_zod"]["input"] } & { -readonly [k in keyof T as T[k] extends OptionalInSchema ? k : never]?: T[k]["_zod"]["input"] } & Extra>;
833
833
  type $ZodObjectConfig = {
834
834
  out: Record<string, unknown>;
835
835
  in: Record<string, unknown>;
@@ -851,7 +851,7 @@ type $catchall<T extends SomeType> = {
851
851
  [k: string]: output<T>;
852
852
  };
853
853
  in: {
854
- [k: string]: input<T>;
854
+ [k: string]: input$1<T>;
855
855
  };
856
856
  };
857
857
  type $ZodShape = Readonly<{
@@ -876,7 +876,7 @@ type $ZodLooseShape = Record<string, any>;
876
876
  interface $ZodObject< /** @ts-ignore Cast variance */out Shape extends Readonly<$ZodShape> = Readonly<$ZodShape>, out Params extends $ZodObjectConfig = $ZodObjectConfig> extends $ZodType<any, any, $ZodObjectInternals<Shape, Params>> {}
877
877
  declare const $ZodObject: $constructor<$ZodObject>;
878
878
  type $InferUnionOutput<T extends SomeType> = T extends any ? output<T> : never;
879
- type $InferUnionInput<T extends SomeType> = T extends any ? input<T> : never;
879
+ type $InferUnionInput<T extends SomeType> = T extends any ? input$1<T> : never;
880
880
  interface $ZodUnionDef<Options extends readonly SomeType[] = readonly $ZodType[]> extends $ZodTypeDef {
881
881
  type: "union";
882
882
  options: Options;
@@ -921,7 +921,7 @@ interface $ZodIntersectionInternals<A extends SomeType = $ZodType, B extends Som
921
921
  optin: A["_zod"]["optin"] | B["_zod"]["optin"];
922
922
  optout: A["_zod"]["optout"] | B["_zod"]["optout"];
923
923
  output: output<A> & output<B>;
924
- input: input<A> & input<B>;
924
+ input: input$1<A> & input$1<B>;
925
925
  }
926
926
  interface $ZodIntersection<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodType {
927
927
  _zod: $ZodIntersectionInternals<A, B>;
@@ -932,9 +932,9 @@ interface $ZodTupleDef<T extends TupleItems = readonly $ZodType[], Rest extends
932
932
  items: T;
933
933
  rest: Rest;
934
934
  }
935
- type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input<Rest>[] : [])];
936
- type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input<T[k]> };
937
- type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input<Tail>?] : TupleInputTypeNoOptionals<T> : [];
935
+ type $InferTupleInputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleInputTypeWithOptionals<T>, ...(Rest extends SomeType ? input$1<Rest>[] : [])];
936
+ type TupleInputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: input$1<T[k]> };
937
+ type TupleInputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optin"] extends "optional" ? [...TupleInputTypeWithOptionals<Prefix>, input$1<Tail>?] : TupleInputTypeNoOptionals<T> : [];
938
938
  type $InferTupleOutputType<T extends TupleItems, Rest extends SomeType | null> = [...TupleOutputTypeWithOptionals<T>, ...(Rest extends SomeType ? output<Rest>[] : [])];
939
939
  type TupleOutputTypeNoOptionals<T extends TupleItems> = { [k in keyof T]: output<T[k]> };
940
940
  type TupleOutputTypeWithOptionals<T extends TupleItems> = T extends readonly [...infer Prefix extends SomeType[], infer Tail extends SomeType] ? Tail["_zod"]["optout"] extends "optional" ? [...TupleOutputTypeWithOptionals<Prefix>, output<Tail>?] : TupleOutputTypeNoOptionals<T> : [];
@@ -957,7 +957,7 @@ interface $ZodRecordDef<Key extends $ZodRecordKey = $ZodRecordKey, Value extends
957
957
  mode?: "strict" | "loose";
958
958
  }
959
959
  type $InferZodRecordOutput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<output<Key>, output<Value>>> : Record<output<Key>, output<Value>>;
960
- type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input<Key> & PropertyKey, input<Value>>> : Record<input<Key> & PropertyKey, input<Value>>;
960
+ type $InferZodRecordInput<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> = Key extends $partial ? Partial<Record<input$1<Key> & PropertyKey, input$1<Value>>> : Record<input$1<Key> & PropertyKey, input$1<Value>>;
961
961
  interface $ZodRecordInternals<Key extends $ZodRecordKey = $ZodRecordKey, Value extends SomeType = $ZodType> extends $ZodTypeInternals<$InferZodRecordOutput<Key, Value>, $InferZodRecordInput<Key, Value>> {
962
962
  def: $ZodRecordDef<Key, Value>;
963
963
  isst: $ZodIssueInvalidType | $ZodIssueInvalidKey<Record<PropertyKey, unknown>>;
@@ -976,7 +976,7 @@ interface $ZodMapDef<Key extends SomeType = $ZodType, Value extends SomeType = $
976
976
  keyType: Key;
977
977
  valueType: Value;
978
978
  }
979
- interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input<Key>, input<Value>>> {
979
+ interface $ZodMapInternals<Key extends SomeType = $ZodType, Value extends SomeType = $ZodType> extends $ZodTypeInternals<Map<output<Key>, output<Value>>, Map<input$1<Key>, input$1<Value>>> {
980
980
  def: $ZodMapDef<Key, Value>;
981
981
  isst: $ZodIssueInvalidType | $ZodIssueInvalidKey | $ZodIssueInvalidElement<unknown>;
982
982
  optin?: "optional" | undefined;
@@ -990,7 +990,7 @@ interface $ZodSetDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
990
990
  type: "set";
991
991
  valueType: T;
992
992
  }
993
- interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input<T>>> {
993
+ interface $ZodSetInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Set<output<T>>, Set<input$1<T>>> {
994
994
  def: $ZodSetDef<T>;
995
995
  isst: $ZodIssueInvalidType;
996
996
  optin?: "optional" | undefined;
@@ -1072,7 +1072,7 @@ interface $ZodOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1072
1072
  type: "optional";
1073
1073
  innerType: T;
1074
1074
  }
1075
- interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input<T> | undefined> {
1075
+ interface $ZodOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | undefined, input$1<T> | undefined> {
1076
1076
  def: $ZodOptionalDef<T>;
1077
1077
  optin: "optional";
1078
1078
  optout: "optional";
@@ -1088,7 +1088,7 @@ interface $ZodExactOptionalDef<T extends SomeType = $ZodType> extends $ZodOption
1088
1088
  interface $ZodExactOptionalInternals<T extends SomeType = $ZodType> extends $ZodOptionalInternals<T> {
1089
1089
  def: $ZodExactOptionalDef<T>;
1090
1090
  output: output<T>;
1091
- input: input<T>;
1091
+ input: input$1<T>;
1092
1092
  }
1093
1093
  interface $ZodExactOptional<T extends SomeType = $ZodType> extends $ZodType {
1094
1094
  _zod: $ZodExactOptionalInternals<T>;
@@ -1098,7 +1098,7 @@ interface $ZodNullableDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1098
1098
  type: "nullable";
1099
1099
  innerType: T;
1100
1100
  }
1101
- interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input<T> | null> {
1101
+ interface $ZodNullableInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T> | null, input$1<T> | null> {
1102
1102
  def: $ZodNullableDef<T>;
1103
1103
  optin: T["_zod"]["optin"];
1104
1104
  optout: T["_zod"]["optout"];
@@ -1116,7 +1116,7 @@ interface $ZodDefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1116
1116
  /** The default value. May be a getter. */
1117
1117
  defaultValue: NoUndefined<output<T>>;
1118
1118
  }
1119
- interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1119
+ interface $ZodDefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input$1<T> | undefined> {
1120
1120
  def: $ZodDefaultDef<T>;
1121
1121
  optin: "optional";
1122
1122
  optout?: "optional" | undefined;
@@ -1131,9 +1131,9 @@ interface $ZodPrefaultDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1131
1131
  type: "prefault";
1132
1132
  innerType: T;
1133
1133
  /** The default value. May be a getter. */
1134
- defaultValue: input<T>;
1134
+ defaultValue: input$1<T>;
1135
1135
  }
1136
- interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input<T> | undefined> {
1136
+ interface $ZodPrefaultInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, input$1<T> | undefined> {
1137
1137
  def: $ZodPrefaultDef<T>;
1138
1138
  optin: "optional";
1139
1139
  optout?: "optional" | undefined;
@@ -1148,7 +1148,7 @@ interface $ZodNonOptionalDef<T extends SomeType = $ZodType> extends $ZodTypeDef
1148
1148
  type: "nonoptional";
1149
1149
  innerType: T;
1150
1150
  }
1151
- interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input<T>>> {
1151
+ interface $ZodNonOptionalInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<NoUndefined<output<T>>, NoUndefined<input$1<T>>> {
1152
1152
  def: $ZodNonOptionalDef<T>;
1153
1153
  isst: $ZodIssueInvalidType;
1154
1154
  values: T["_zod"]["values"];
@@ -1163,7 +1163,7 @@ interface $ZodSuccessDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1163
1163
  type: "success";
1164
1164
  innerType: T;
1165
1165
  }
1166
- interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input<T>> {
1166
+ interface $ZodSuccessInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<boolean, input$1<T>> {
1167
1167
  def: $ZodSuccessDef<T>;
1168
1168
  isst: never;
1169
1169
  optin: T["_zod"]["optin"];
@@ -1186,7 +1186,7 @@ interface $ZodCatchDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1186
1186
  innerType: T;
1187
1187
  catchValue: (ctx: $ZodCatchCtx) => unknown;
1188
1188
  }
1189
- interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1189
+ interface $ZodCatchInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input$1<T>> {
1190
1190
  def: $ZodCatchDef<T>;
1191
1191
  optin: T["_zod"]["optin"];
1192
1192
  optout: T["_zod"]["optout"];
@@ -1213,11 +1213,11 @@ interface $ZodPipeDef<A extends SomeType = $ZodType, B extends SomeType = $ZodTy
1213
1213
  in: A;
1214
1214
  out: B;
1215
1215
  /** Only defined inside $ZodCodec instances. */
1216
- transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input<B>>;
1216
+ transform?: (value: output<A>, payload: ParsePayload<output<A>>) => MaybeAsync<input$1<B>>;
1217
1217
  /** Only defined inside $ZodCodec instances. */
1218
- reverseTransform?: (value: input<B>, payload: ParsePayload<input<B>>) => MaybeAsync<output<A>>;
1218
+ reverseTransform?: (value: input$1<B>, payload: ParsePayload<input$1<B>>) => MaybeAsync<output<A>>;
1219
1219
  }
1220
- interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input<A>> {
1220
+ interface $ZodPipeInternals<A extends SomeType = $ZodType, B extends SomeType = $ZodType> extends $ZodTypeInternals<output<B>, input$1<A>> {
1221
1221
  def: $ZodPipeDef<A, B>;
1222
1222
  isst: never;
1223
1223
  values: A["_zod"]["values"];
@@ -1233,7 +1233,7 @@ interface $ZodReadonlyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1233
1233
  type: "readonly";
1234
1234
  innerType: T;
1235
1235
  }
1236
- interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input<T>>> {
1236
+ interface $ZodReadonlyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<MakeReadonly<output<T>>, MakeReadonly<input$1<T>>> {
1237
1237
  def: $ZodReadonlyDef<T>;
1238
1238
  optin: T["_zod"]["optin"];
1239
1239
  optout: T["_zod"]["optout"];
@@ -1270,10 +1270,10 @@ declare const $ZodTemplateLiteral: $constructor<$ZodTemplateLiteral>;
1270
1270
  type $ZodFunctionArgs = $ZodType<unknown[], unknown[]>;
1271
1271
  type $ZodFunctionIn = $ZodFunctionArgs;
1272
1272
  type $ZodFunctionOut = $ZodType;
1273
- type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input<Returns>;
1274
- type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input<Returns>>;
1275
- type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => output<Returns>;
1276
- type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input<Args>) => Promise<output<Returns>>;
1273
+ type $InferInnerFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => input$1<Returns>;
1274
+ type $InferInnerFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : output<Args>) => MaybeAsync<input$1<Returns>>;
1275
+ type $InferOuterFunctionType<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$1<Args>) => output<Returns>;
1276
+ type $InferOuterFunctionTypeAsync<Args extends $ZodFunctionIn, Returns extends $ZodFunctionOut> = (...args: $ZodFunctionIn extends Args ? never[] : input$1<Args>) => Promise<output<Returns>>;
1277
1277
  interface $ZodFunctionDef<In extends $ZodFunctionIn = $ZodFunctionIn, Out extends $ZodFunctionOut = $ZodFunctionOut> extends $ZodTypeDef {
1278
1278
  type: "function";
1279
1279
  input: In;
@@ -1300,7 +1300,7 @@ interface $ZodPromiseDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1300
1300
  type: "promise";
1301
1301
  innerType: T;
1302
1302
  }
1303
- interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input<T>>> {
1303
+ interface $ZodPromiseInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<Promise<output<T>>, MaybeAsync<input$1<T>>> {
1304
1304
  def: $ZodPromiseDef<T>;
1305
1305
  isst: never;
1306
1306
  }
@@ -1312,7 +1312,7 @@ interface $ZodLazyDef<T extends SomeType = $ZodType> extends $ZodTypeDef {
1312
1312
  type: "lazy";
1313
1313
  getter: () => T;
1314
1314
  }
1315
- interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input<T>> {
1315
+ interface $ZodLazyInternals<T extends SomeType = $ZodType> extends $ZodTypeInternals<output<T>, input$1<T>> {
1316
1316
  def: $ZodLazyDef<T>;
1317
1317
  isst: never;
1318
1318
  /** Auto-cached way to retrieve the inner schema */
@@ -1672,19 +1672,19 @@ type $brand<T extends string | number | symbol = string | number | symbol> = {
1672
1672
  };
1673
1673
  type $ZodBranded<T extends SomeType, Brand extends string | number | symbol, Dir extends "in" | "out" | "inout" = "out"> = T & (Dir extends "inout" ? {
1674
1674
  _zod: {
1675
- input: input<T> & $brand<Brand>;
1675
+ input: input$1<T> & $brand<Brand>;
1676
1676
  output: output<T> & $brand<Brand>;
1677
1677
  };
1678
1678
  } : Dir extends "in" ? {
1679
1679
  _zod: {
1680
- input: input<T> & $brand<Brand>;
1680
+ input: input$1<T> & $brand<Brand>;
1681
1681
  };
1682
1682
  } : {
1683
1683
  _zod: {
1684
1684
  output: output<T> & $brand<Brand>;
1685
1685
  };
1686
1686
  });
1687
- type input<T> = T extends {
1687
+ type input$1<T> = T extends {
1688
1688
  _zod: {
1689
1689
  input: any;
1690
1690
  };
@@ -1796,7 +1796,7 @@ type ZodSafeParseError<T> = {
1796
1796
  };
1797
1797
  //#endregion
1798
1798
  //#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/classic/schemas.d.cts
1799
- type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input<T>, output<T>>;
1799
+ type ZodStandardSchemaWithJSON<T> = StandardSchemaWithJSONProps<input$1<T>, output<T>>;
1800
1800
  interface ZodType<out Output = unknown, out Input = unknown, out Internals extends $ZodTypeInternals<Output, Input> = $ZodTypeInternals<Output, Input>> extends $ZodType<Output, Input, Internals> {
1801
1801
  def: Internals["def"];
1802
1802
  type: Internals["def"]["type"];
@@ -1821,15 +1821,15 @@ interface ZodType<out Output = unknown, out Input = unknown, out Internals exten
1821
1821
  parseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1822
1822
  safeParseAsync(data: unknown, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1823
1823
  spa: (data: unknown, params?: ParseContext<$ZodIssue>) => Promise<ZodSafeParseResult<output<this>>>;
1824
- encode(data: output<this>, params?: ParseContext<$ZodIssue>): input<this>;
1825
- decode(data: input<this>, params?: ParseContext<$ZodIssue>): output<this>;
1826
- encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input<this>>;
1827
- decodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1828
- safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input<this>>;
1829
- safeDecode(data: input<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1830
- safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input<this>>>;
1831
- safeDecodeAsync(data: input<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1832
- refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input<this>> : this;
1824
+ encode(data: output<this>, params?: ParseContext<$ZodIssue>): input$1<this>;
1825
+ decode(data: input$1<this>, params?: ParseContext<$ZodIssue>): output<this>;
1826
+ encodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<input$1<this>>;
1827
+ decodeAsync(data: input$1<this>, params?: ParseContext<$ZodIssue>): Promise<output<this>>;
1828
+ safeEncode(data: output<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<input$1<this>>;
1829
+ safeDecode(data: input$1<this>, params?: ParseContext<$ZodIssue>): ZodSafeParseResult<output<this>>;
1830
+ safeEncodeAsync(data: output<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<input$1<this>>>;
1831
+ safeDecodeAsync(data: input$1<this>, params?: ParseContext<$ZodIssue>): Promise<ZodSafeParseResult<output<this>>>;
1832
+ refine<Ch extends (arg: output<this>) => unknown | Promise<unknown>>(check: Ch, params?: string | $ZodCustomParams): Ch extends ((arg: any) => arg is infer R) ? this & ZodType<R, input$1<this>> : this;
1833
1833
  superRefine(refinement: (arg: output<this>, ctx: $RefinementCtx<output<this>>) => void | Promise<void>, params?: $ZodSuperRefineParams): this;
1834
1834
  overwrite(fn: (x: output<this>) => output<this>): this;
1835
1835
  optional(): ZodOptional<this>;
@@ -1839,8 +1839,8 @@ interface ZodType<out Output = unknown, out Input = unknown, out Internals exten
1839
1839
  nullish(): ZodOptional<ZodNullable<this>>;
1840
1840
  default(def: NoUndefined<output<this>>): ZodDefault<this>;
1841
1841
  default(def: () => NoUndefined<output<this>>): ZodDefault<this>;
1842
- prefault(def: () => input<this>): ZodPrefault<this>;
1843
- prefault(def: input<this>): ZodPrefault<this>;
1842
+ prefault(def: () => input$1<this>): ZodPrefault<this>;
1843
+ prefault(def: input$1<this>): ZodPrefault<this>;
1844
1844
  array(): ZodArray<this>;
1845
1845
  or<T extends SomeType>(option: T): ZodUnion<[this, T]>;
1846
1846
  and<T extends SomeType>(incoming: T): ZodIntersection<this, T>;
@@ -2007,7 +2007,7 @@ interface ZodArray<T extends SomeType = $ZodType> extends _ZodType<$ZodArrayInte
2007
2007
  "~standard": ZodStandardSchemaWithJSON<this>;
2008
2008
  }
2009
2009
  declare const ZodArray: $constructor<ZodArray>;
2010
- type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input<Ext[K]> extends input<Base[K]> ? Ext[K] : never : never : Ext[K] };
2010
+ type SafeExtendShape<Base extends $ZodShape, Ext extends $ZodLooseShape> = { [K in keyof Ext]: K extends keyof Base ? output<Ext[K]> extends output<Base[K]> ? input$1<Ext[K]> extends input$1<Base[K]> ? Ext[K] : never : never : Ext[K] };
2011
2011
  interface ZodObject< /** @ts-ignore Cast variance */out Shape extends $ZodShape = $ZodLooseShape, out Config extends $ZodObjectConfig = $strip> extends _ZodType<$ZodObjectInternals<Shape, Config>>, $ZodObject<Shape, Config> {
2012
2012
  "~standard": ZodStandardSchemaWithJSON<this>;
2013
2013
  shape: Shape;
@@ -2558,12 +2558,17 @@ declare global {
2558
2558
  }
2559
2559
  }
2560
2560
  //#endregion
2561
- //#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.51/node_modules/xstate/dist/declarations/src/index.d.ts
2561
+ //#region ../../node_modules/.pnpm/xstate@6.0.0-alpha.64/node_modules/xstate/dist/declarations/src/base.types.d.ts
2562
2562
  declare global {
2563
2563
  interface SymbolConstructor {
2564
2564
  readonly observable: symbol;
2565
2565
  }
2566
2566
  }
2567
+ /**
2568
+ * The full definition of an event, with a string `type`.
2569
+ *
2570
+ * @public
2571
+ */
2567
2572
  //#endregion
2568
2573
  //#region ../../node_modules/.pnpm/@types+json-schema@7.0.15/node_modules/@types/json-schema/index.d.ts
2569
2574
  // ==================================================================================================
package/dist/index.d.mts CHANGED
@@ -1,13 +1,13 @@
1
1
  import { StatelyApiClientOptions, StatelyApiError, StatelyApiUrlOptions, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
2
- import { o as GraphPatch, r as ActionLocation } from "./index-CoxF4Saw.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-B6xUxqR5.mjs";
4
- import { $t as assertEmbedExamples, A as ExportFormatMap, H as InspectionTakenTransition, I as InitOptions, N as INSPECTION_PROTOCOL_VERSION, O as ExportCallOptions, P as INSPECTION_ROOM_QUERY_PARAM, R as InspectionAction, S as EmbedExample, T as EmbedMode, U as InspectorLoadedEvent, V as InspectionSentEvent, W as InspectorSettings, X as MachineVersionAutoSaveOptions, Zt as ViewerOptions, _ as EmbedDocument, an as mergeInspectorSettings, b as EmbedEventMap, cn as EmbedPanelConfig, ct as ProjectWorkspaceActionIcon, dt as ProjectWorkspaceConfig, en as createInspectionActorId, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, in as isEmbedExampleMachine, k as ExportFormat, ln as EmbedPanelPosition, m as EMBED_DOCUMENT_LIMITS, nn as getInspectionRoomId, on as resolveInspectorSettings, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceMachineOrigin, qt as UploadResult, r as CapabilityDeniedCapability, rn as isEmbedExample, sn as PresentationMetadataInitializer, st as ProjectWorkspaceAction, tn as createInspectionRoomUrls, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-CFK_R0rt.mjs";
2
+ import { o as GraphPatch, r as ActionLocation } from "./index-P3fyMvvk.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-C_G5qXKW.mjs";
4
+ import { A as ExportFormatMap, H as InspectionTakenTransition, I as InitOptions, Jt as UploadResult, N as INSPECTION_PROTOCOL_VERSION, O as ExportCallOptions, P as INSPECTION_ROOM_QUERY_PARAM, Qt as ViewerOptions, R as InspectionAction, S as EmbedExample, T as EmbedMode, U as InspectorLoadedEvent, V as InspectionSentEvent, W as InspectorSettings, X as MachineVersionAutoSaveOptions, _ as EmbedDocument, an as isEmbedExampleMachine, b as EmbedEventMap, cn as resolveInspectorSettings, ct as ProjectWorkspaceActionIcon, dn as EmbedPanelPosition, dt as ProjectWorkspaceConfig, en as assertEmbedExamples, et as ProjectEmbedMachine, f as CommentsConfig, ft as ProjectWorkspaceMachine, h as EditorCapabilities, ht as ProjectWorkspaceProject, i as CapabilityDeniedEvent, in as isEmbedExample, k as ExportFormat, ln as PresentationMetadataInitializer, m as EMBED_DOCUMENT_LIMITS, nn as createInspectionRoomUrls, p as EMBED_DOCUMENT_LANGUAGES, pt as ProjectWorkspaceMachineOrigin, r as CapabilityDeniedCapability, rn as getInspectionRoomId, sn as mergeInspectorSettings, st as ProjectWorkspaceAction, tn as createInspectionActorId, un as EmbedPanelConfig, ut as ProjectWorkspaceCapabilities, v as EmbedDocumentLanguage, x as EmbedEventName, y as EmbedEventHandler } from "./protocol-Dlo9C3lj.mjs";
5
5
  import { AssetUploadAdapter, AssetUploadContext, AssetUploadRequest, CreateS3AssetUploadAdapterOptions, CreateSupabaseAssetUploadAdapterOptions, S3UploadTarget, SupabaseStorageClient, createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
6
6
  import { StatelyAuthMode, StatelyCredential, createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
7
7
  import { EDITOR_PROTOCOL_VERSION, EditorHostDiagnostic, EditorHostExportFormat, EditorHostInboundMessage, EditorHostInitOptions, EditorHostOutboundMessage, EditorHostValidationIssue } from "./editorHostProtocol.mjs";
8
8
  import { AssetConfig, EmbedEntity, EmbedFormatContext, EmbedFormatDefinition, EmbedGraph, EmbedProfileDefinition, PlanSourceUpdateInput, SourceUpdateEdit, SourceUpdatePlan, 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-DV35V81q.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-DvEgrtk1.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-ChP5FD65.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-WmN72ERY.mjs";
11
11
  import { OAuthAuthorizationServerMetadata, OAuthClientRegistrationResponse, OAuthProtectedResourceMetadata, OAuthTokenResponse, PkcePair, buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
12
12
  import { CreateInspectionRelayOptions, InspectionRelay, InspectionRelayEffect, InspectionRelayPeer, InspectionRelayRole, InspectionRelaySnapshot, createInspectionRelay } from "./relay.mjs";
13
13
  export { type ActionLocation, type AdoptedActor, type AssetConfig, type AssetUploadAdapter, type AssetUploadContext, type AssetUploadRequest, type CapabilityDeniedCapability, type CapabilityDeniedEvent, 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, type EditorHostValidationIssue, 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 MachineVersion, type MachineVersionAutoSaveOptions, type ManualActorOptions, type OAuthAuthorizationServerMetadata, type OAuthClientRegistrationResponse, type OAuthProtectedResourceMetadata, type OAuthTokenResponse, type PkcePair, type PlanSourceUpdateInput, type PresentationMetadataInitializer, 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 RepoType, type ResourceErrorCode, type S3UploadTarget, type SourceUpdateEdit, type SourceUpdatePlan, 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 StudioAction, StudioApiError, type StudioApiErrorOptions, type StudioClient, type StudioClientOptions, type StudioEdge, type StudioMachine, type StudioMachineRecord, type StudioNode, type StudioRequestOptions, type SupabaseStorageClient, type Transport, type TransportFailure, type UpdateMachineInput, type UpdateProjectInput, type UploadResult, type VerifyApiKeyResponse, type VerifyResult, type ViewerOptions, type XStateVersion, assertEmbedExamples, buildAuthorizeUrl, createAuthorizationHeader, createInspectionActorId, createInspectionRelay, createInspectionRoomUrls, createInspector, createPkcePair, createPostMessageTransport, createS3AssetUploadAdapter, createStatelyApiClient, createStatelyApiUrl, createStatelyClient, createStatelyEmbed, createStatelyInspector, createSupabaseAssetUploadAdapter, createWebSocketTransport, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, fromStudioMachine, getCredentialToken, getInspectionRoomId, isEmbedExample, isEmbedExampleMachine, mergeInspectorSettings, refreshToken, registerOAuthClient, resolveInspectorSettings, studioMachineConverter, toStudioMachine };
package/dist/index.mjs CHANGED
@@ -1,10 +1,10 @@
1
- import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-DhzM6zFx.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-jzP2mGvy.mjs";
1
+ import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-uGK1kS0n.mjs";
2
+ import { c as createInspectionRoomUrls, d as isEmbedExampleMachine, i as INSPECTION_ROOM_QUERY_PARAM, l as getInspectionRoomId, m as resolveInspectorSettings, n as EMBED_DOCUMENT_LIMITS, o as assertEmbedExamples, p as mergeInspectorSettings, r as INSPECTION_PROTOCOL_VERSION, s as createInspectionActorId, t as EMBED_DOCUMENT_LANGUAGES, u as isEmbedExample } from "./protocol-M3Zeun3o.mjs";
3
+ import { i as createWebSocketTransport, r as createPostMessageTransport } from "./version-BeGmL5w7.mjs";
4
4
  import { EDITOR_PROTOCOL_VERSION } from "./editorHostProtocol.mjs";
5
5
  import { createStatelyEmbed } from "./embed.mjs";
6
6
  import { createS3AssetUploadAdapter, createSupabaseAssetUploadAdapter } from "./assetStorage.mjs";
7
- import { n as createStatelyInspector, t as createInspector } from "./inspect-CLeyY8Yw.mjs";
7
+ import { n as createStatelyInspector, t as createInspector } from "./inspect-CGMew487.mjs";
8
8
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
9
9
  import { buildAuthorizeUrl, createPkcePair, discoverAuthorizationServer, discoverProtectedResource, exchangeCodeForToken, refreshToken, registerOAuthClient } from "./oauth.mjs";
10
10
  import { StatelyApiError, createStatelyApiClient, createStatelyApiUrl } from "./api.mjs";
@@ -1,5 +1,5 @@
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-jzP2mGvy.mjs";
1
+ import { c as createInspectionRoomUrls, l as getInspectionRoomId, m as resolveInspectorSettings, p as mergeInspectorSettings, r as INSPECTION_PROTOCOL_VERSION } from "./protocol-M3Zeun3o.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-BeGmL5w7.mjs";
3
3
 
4
4
  //#region src/openBrowser.ts
5
5
  async function openBrowser(url) {
@@ -47,6 +47,50 @@ function deriveActorDisplayName(parentLogic, actorId) {
47
47
  }
48
48
  }
49
49
 
50
+ //#endregion
51
+ //#region src/inspectionMachine.ts
52
+ /** Keep the inspector independent of a consumer's installed XState version. */
53
+ function extractInspectionMachine(logic) {
54
+ if (!logic || typeof logic !== "object") return null;
55
+ const machine = logic;
56
+ const config = machine.config;
57
+ if (!config || typeof config !== "object" || typeof machine.initialTransition !== "function" || typeof machine.getStateNodeById !== "function") return config ?? null;
58
+ const ancestors = /* @__PURE__ */ new WeakSet();
59
+ function serialize(value, key) {
60
+ if (typeof value === "function") return {
61
+ "@code": Function.prototype.toString.call(value),
62
+ "@lang": "ts"
63
+ };
64
+ if (value === null || typeof value !== "object") return typeof value === "bigint" || typeof value === "symbol" ? void 0 : value;
65
+ if (ancestors.has(value)) return void 0;
66
+ if ("transition" in value && "getInitialSnapshot" in value) {
67
+ const id = value.id;
68
+ return key === "src" ? typeof id === "string" ? id : "@statelyai.inlineActor" : void 0;
69
+ }
70
+ if ("~standard" in value) return void 0;
71
+ if (!Array.isArray(value) && Object.getPrototypeOf(value) !== Object.prototype && Object.getPrototypeOf(value) !== null) return void 0;
72
+ ancestors.add(value);
73
+ const result = Array.isArray(value) ? value.map((item) => serialize(item)).filter((item) => item !== void 0) : Object.fromEntries(Object.entries(value).flatMap(([name, item]) => {
74
+ if ([
75
+ "actors",
76
+ "actions",
77
+ "guards",
78
+ "delays"
79
+ ].includes(name) && value === config) return [];
80
+ const serialized = serialize(item, name);
81
+ return serialized === void 0 ? [] : [[name, serialized]];
82
+ }));
83
+ ancestors.delete(value);
84
+ return result;
85
+ }
86
+ return {
87
+ type: "@statelyai.inspection.machine",
88
+ version: 1,
89
+ profile: "xstate-v6-alpha",
90
+ config: serialize(machine._json ?? config)
91
+ };
92
+ }
93
+
50
94
  //#endregion
51
95
  //#region src/inspect.ts
52
96
  const defaultSerializeSnapshot = (snapshot) => ({
@@ -54,7 +98,7 @@ const defaultSerializeSnapshot = (snapshot) => ({
54
98
  status: snapshot?.status,
55
99
  ...snapshot?.tags && { tags: Array.from(snapshot.tags) }
56
100
  });
57
- const defaultExtractMachineConfig = (actor, source) => actor?.logic?.config ?? source?.config ?? null;
101
+ const defaultExtractMachineConfig = (actor, source) => extractInspectionMachine(actor?.logic) ?? extractInspectionMachine(source);
58
102
  function isStoppedSnapshot(snapshot) {
59
103
  const status = snapshot?.status;
60
104
  return status === "done" || status === "stopped" || status === "error";