@statelyai/sdk 0.21.0 → 0.22.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.
@@ -1,2 +1,2 @@
1
- import { a as EditorStateType, n as CanvasColor, o as GraphPatch, s as ImplementationSourceType, t as ActionLocation } from "./index-BABex8NE.mjs";
1
+ import { _ as GraphPatch, g as EditorStateType, h as CanvasColor, m as ActionLocation, v as ImplementationSourceType } from "./index-Bakx1tkW.mjs";
2
2
  export { type ActionLocation, type CanvasColor, type EditorStateType, type GraphPatch, type ImplementationSourceType };
@@ -1,5 +1,5 @@
1
- import { l as ProfileManifest } from "./index-BABex8NE.mjs";
2
- import { i as StatelyGraph } from "./graph-B4WM_nYg.mjs";
1
+ import { i as ProfileManifest } from "./index-Bakx1tkW.mjs";
2
+ import { i as StatelyGraph } from "./graph-DYjfFztq.mjs";
3
3
  import { c as EditorSyncSourceLocation, f as MachineSourceLocations$1, l as EditorSyncSourceRange, t as EditorCapabilities$1, u as EditorSyncStateSourceLocation } from "./editor-sync-types-C-zWaaVk.mjs";
4
4
 
5
5
  //#region src/protocol.d.ts
@@ -171,6 +171,10 @@ interface EmbedEventMap {
171
171
  machineSelected: {
172
172
  machineId: string;
173
173
  };
174
+ viewModeChanged: {
175
+ viewMode: 'graph' | 'list';
176
+ machineId?: string;
177
+ };
174
178
  }
175
179
  type EmbedEventName = keyof EmbedEventMap;
176
180
  type EmbedEventHandler<K extends EmbedEventName> = (data: EmbedEventMap[K]) => void;
@@ -506,6 +510,11 @@ interface ProjectMachineSelectedMessage {
506
510
  type: '@statelyai.project.machineSelected';
507
511
  machineId: string;
508
512
  }
513
+ interface ViewModeChangedMessage {
514
+ type: '@statelyai.viewModeChanged';
515
+ viewMode: 'graph' | 'list';
516
+ machineId?: string;
517
+ }
509
518
  interface RetrievedMessage {
510
519
  type: '@statelyai.retrieved';
511
520
  requestId: string;
@@ -576,7 +585,7 @@ interface ExtensionResultMessage {
576
585
  /** All messages a client (embed/inspector) can send to the viz. */
577
586
  type ClientMessage = InitMessage | SetApiKeyMessage | EditorHandshakeMessage | SavedMessage | ClipboardReadResponseMessage | ClipboardWriteResponseMessage | ProjectInitMessage | ProjectUpdateMessage | ProjectSelectMachineMessage | UpdateMessage | SetModeMessage | SetThemeMessage | SetSettingsMessage | RetrieveMessage | ToastMessage | InspectSnapshotMessage | SystemInitMessage | SystemSelectActorMessage | SystemActorRegisteredMessage | SystemActorEventMessage | SystemActorSnapshotMessage | SystemActorStoppedMessage | UploadCapabilitiesMessage | UploadResponseMessage | ExtensionResultMessage | ErrorMessage;
578
587
  /** All messages the viz can send back to a client. */
579
- type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
588
+ type VizMessage = ReadyMessage | LoadedMessage | ChangeMessage | SaveMessage | ProjectMachineSelectedMessage | ViewModeChangedMessage | RetrievedMessage | ErrorMessage | CapabilityDeniedMessage | ClipboardReadMessage | ClipboardWriteMessage | UploadRequestMessage | ExtensionCallMessage;
580
589
  interface InspectionClientMetadata {
581
590
  name?: string;
582
591
  machineId?: string;
@@ -605,4 +614,4 @@ declare const PREFIX = "@statelyai.";
605
614
  /** Current WebSocket inspection protocol version. */
606
615
  declare const INSPECTION_PROTOCOL_VERSION = 2;
607
616
  //#endregion
608
- export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };
617
+ export { ActorSystemEntry, CapabilityDeniedCapability, CapabilityDeniedEvent, CapabilityDeniedMessage, ChangeMessage, ClientMessage, ClipboardReadMessage, ClipboardReadResponseMessage, ClipboardWriteMessage, ClipboardWriteResponseMessage, CommentsConfig, EMBED_DOCUMENT_LANGUAGES, EMBED_DOCUMENT_LIMITS, EditorCapabilities, EditorHandshakeMessage, EmbedDocument, EmbedDocumentLanguage, EmbedEventHandler, EmbedEventMap, EmbedEventName, EmbedExtensionsManifest, EmbedFormatManifest, EmbedMode, ErrorMessage, ExportCallOptions, ExportFormat, ExportFormatMap, ExtensionCallMessage, ExtensionResultMessage, INSPECTION_PROTOCOL_VERSION, INSPECTION_ROOM_QUERY_PARAM, InitMessage, InitOptions, InspectSnapshotMessage, InspectionAction, InspectionClientMetadata, InspectionRoomUrls, InspectionSentEvent, InspectionTakenTransition, LoadedMessage, MachineInitOptions, MachineSourceLocations, PREFIX, ProjectEmbedMachine, ProjectInitMessage, ProjectInitOptions, ProjectMachineSelectedMessage, ProjectSelectMachineMessage, ProjectUpdateMessage, ProtocolMessage, ReadOnlyReason, ReadyMessage, RegisterMessage, RegisteredMessage, RetrieveMessage, RetrievedMessage, SaveMessage, SavedMessage, SessionMessage, SetApiKeyMessage, SetModeMessage, SetSettingsMessage, SetThemeMessage, SourceLocation, SourceRange, StateSourceLocation, SystemActorEventMessage, SystemActorRegisteredMessage, SystemActorSnapshotMessage, SystemActorStoppedMessage, SystemInitMessage, SystemSelectActorMessage, ToastMessage, UpdateMessage, UploadCapabilitiesMessage, UploadFileInfo, UploadRequestMessage, UploadResponseMessage, UploadResult, ValidationIssue, ViewModeChangedMessage, VizMessage, createInspectionActorId, createInspectionRoomUrls, getInspectionRoomId };
@@ -1,5 +1,6 @@
1
- import { a as discriminatedUnion, c as object, d as union, f as unknown, i as custom, l as record, n as array, o as literal, r as boolean, s as number, t as _enum, u as string } from "./schemas-b9wG-zYl.mjs";
1
+ import { a as discriminatedUnion, c as object, d as union, f as unknown, i as custom, l as record, n as array, o as literal, r as boolean, s as number, t as _enum, u as string } from "./openapi-BTDjYWXd.mjs";
2
2
  import ts from "typescript";
3
+ import "xstate";
3
4
  import "xstate/graph";
4
5
 
5
6
  //#region ../../node_modules/.pnpm/js-yaml@4.2.0/node_modules/js-yaml/dist/js-yaml.mjs
@@ -4966,7 +4967,7 @@ const actionLocationSchema$1 = union([object({
4966
4967
  edgeId: string(),
4967
4968
  group: literal("transition")
4968
4969
  })]);
4969
- const createStatePatchSchema$1 = object({
4970
+ const createStatePatchSchema = object({
4970
4971
  op: literal("createState"),
4971
4972
  description: string().optional(),
4972
4973
  id: string().optional(),
@@ -4978,7 +4979,7 @@ const createStatePatchSchema$1 = object({
4978
4979
  color: colorSchema.nullable().optional(),
4979
4980
  initial: boolean().optional()
4980
4981
  });
4981
- const updateStatePatchSchema$1 = object({
4982
+ const updateStatePatchSchema = object({
4982
4983
  op: literal("updateState"),
4983
4984
  description: string().optional(),
4984
4985
  stateId: string(),
@@ -4990,7 +4991,7 @@ const updateStatePatchSchema$1 = object({
4990
4991
  meta: record(string(), unknown()).nullable().optional(),
4991
4992
  history: _enum(["shallow", "deep"]).nullable().optional()
4992
4993
  });
4993
- const deleteStatePatchSchema$1 = object({
4994
+ const deleteStatePatchSchema = object({
4994
4995
  op: literal("deleteState"),
4995
4996
  description: string().optional(),
4996
4997
  stateId: string()
@@ -5000,7 +5001,7 @@ const guardSchema = object({
5000
5001
  code: string().optional(),
5001
5002
  params: record(string(), unknown()).optional()
5002
5003
  });
5003
- const createTransitionPatchSchema$1 = object({
5004
+ const createTransitionPatchSchema = object({
5004
5005
  op: literal("createTransition"),
5005
5006
  description: string().optional(),
5006
5007
  id: string().optional(),
@@ -5017,7 +5018,7 @@ const createTransitionPatchSchema$1 = object({
5017
5018
  color: colorSchema.nullable().optional(),
5018
5019
  transitionDescription: string().nullable().optional()
5019
5020
  });
5020
- const updateTransitionPatchSchema$1 = object({
5021
+ const updateTransitionPatchSchema = object({
5021
5022
  op: literal("updateTransition"),
5022
5023
  description: string().optional(),
5023
5024
  transitionId: string(),
@@ -5034,12 +5035,12 @@ const updateTransitionPatchSchema$1 = object({
5034
5035
  color: colorSchema.nullable().optional(),
5035
5036
  meta: record(string(), unknown()).nullable().optional()
5036
5037
  });
5037
- const deleteTransitionPatchSchema$1 = object({
5038
+ const deleteTransitionPatchSchema = object({
5038
5039
  op: literal("deleteTransition"),
5039
5040
  description: string().optional(),
5040
5041
  transitionId: string()
5041
5042
  });
5042
- const createActionPatchSchema$1 = object({
5043
+ const createActionPatchSchema = object({
5043
5044
  op: literal("createAction"),
5044
5045
  description: string().optional(),
5045
5046
  location: actionLocationSchema$1,
@@ -5050,7 +5051,7 @@ const createActionPatchSchema$1 = object({
5050
5051
  }),
5051
5052
  index: number().optional()
5052
5053
  });
5053
- const updateActionPatchSchema$1 = object({
5054
+ const updateActionPatchSchema = object({
5054
5055
  op: literal("updateAction"),
5055
5056
  description: string().optional(),
5056
5057
  location: actionLocationSchema$1,
@@ -5060,35 +5061,35 @@ const updateActionPatchSchema$1 = object({
5060
5061
  params: record(string(), unknown()).optional()
5061
5062
  })
5062
5063
  });
5063
- const deleteActionPatchSchema$1 = object({
5064
+ const deleteActionPatchSchema = object({
5064
5065
  op: literal("deleteAction"),
5065
5066
  description: string().optional(),
5066
5067
  location: actionLocationSchema$1,
5067
5068
  actionId: string()
5068
5069
  });
5069
- const setGuardPatchSchema$1 = object({
5070
+ const setGuardPatchSchema = object({
5070
5071
  op: literal("setGuard"),
5071
5072
  description: string().optional(),
5072
5073
  edgeId: string(),
5073
5074
  guard: guardSchema
5074
5075
  });
5075
- const deleteGuardPatchSchema$1 = object({
5076
+ const deleteGuardPatchSchema = object({
5076
5077
  op: literal("deleteGuard"),
5077
5078
  description: string().optional(),
5078
5079
  edgeId: string()
5079
5080
  });
5080
5081
  const machinePatchSchema = discriminatedUnion("op", [
5081
- createStatePatchSchema$1,
5082
- updateStatePatchSchema$1,
5083
- deleteStatePatchSchema$1,
5084
- createTransitionPatchSchema$1,
5085
- updateTransitionPatchSchema$1,
5086
- deleteTransitionPatchSchema$1,
5087
- createActionPatchSchema$1,
5088
- updateActionPatchSchema$1,
5089
- deleteActionPatchSchema$1,
5090
- setGuardPatchSchema$1,
5091
- deleteGuardPatchSchema$1
5082
+ createStatePatchSchema,
5083
+ updateStatePatchSchema,
5084
+ deleteStatePatchSchema,
5085
+ createTransitionPatchSchema,
5086
+ updateTransitionPatchSchema,
5087
+ deleteTransitionPatchSchema,
5088
+ createActionPatchSchema,
5089
+ updateActionPatchSchema,
5090
+ deleteActionPatchSchema,
5091
+ setGuardPatchSchema,
5092
+ deleteGuardPatchSchema
5092
5093
  ]);
5093
5094
  const validationLevelSchema = _enum([
5094
5095
  "info",
@@ -5224,397 +5225,6 @@ const simulateMachineStepInputSchema = machineInputSchema.extend({
5224
5225
  event: object({ type: string() }).passthrough(),
5225
5226
  guardState: record(string(), boolean()).optional()
5226
5227
  });
5227
- const pointSchema = object({
5228
- x: number(),
5229
- y: number()
5230
- });
5231
- const canvasColorSchema = _enum([
5232
- "green",
5233
- "red",
5234
- "purple",
5235
- "blue",
5236
- "orange",
5237
- "yellow",
5238
- "pink",
5239
- "teal"
5240
- ]);
5241
- const editorStateTypeSchema = _enum([
5242
- "normal",
5243
- "parallel",
5244
- "history",
5245
- "final",
5246
- "choice"
5247
- ]).nullable();
5248
- const actionLocationSchema = union([object({
5249
- nodeId: string(),
5250
- group: _enum(["entry", "exit"])
5251
- }), object({
5252
- edgeId: string(),
5253
- group: literal("transition")
5254
- })]);
5255
- const implementationSourceTypeSchema = _enum([
5256
- "action",
5257
- "guard",
5258
- "actor",
5259
- "delay"
5260
- ]);
5261
- const createNodePatchSchema = object({
5262
- op: literal("createNode"),
5263
- description: string().optional(),
5264
- id: string().optional(),
5265
- parentId: string(),
5266
- key: string(),
5267
- type: editorStateTypeSchema.optional(),
5268
- x: number().optional(),
5269
- y: number().optional()
5270
- });
5271
- const updateNodePatchSchema = object({
5272
- op: literal("updateNode"),
5273
- description: string().optional(),
5274
- nodeId: string(),
5275
- data: object({
5276
- key: string().optional(),
5277
- type: editorStateTypeSchema.optional(),
5278
- description: string().optional(),
5279
- initialId: string().nullable().optional(),
5280
- initialInput: unknown().optional(),
5281
- timeout: unknown().optional(),
5282
- route: unknown().optional()
5283
- })
5284
- });
5285
- const deleteNodePatchSchema = object({
5286
- op: literal("deleteNode"),
5287
- description: string().optional(),
5288
- nodeId: string()
5289
- });
5290
- const createEdgePatchSchema = object({
5291
- op: literal("createEdge"),
5292
- description: string().optional(),
5293
- id: string().optional(),
5294
- sourceId: string(),
5295
- targetId: string(),
5296
- eventType: string(),
5297
- matches: record(string(), unknown()).optional(),
5298
- transitionType: _enum([
5299
- "normal",
5300
- "targetless",
5301
- "reenter"
5302
- ]).optional()
5303
- });
5304
- const updateEdgePatchSchema = object({
5305
- op: literal("updateEdge"),
5306
- description: string().optional(),
5307
- edgeId: string(),
5308
- data: object({
5309
- sourceId: string().optional(),
5310
- targetId: string().optional(),
5311
- eventType: string().optional(),
5312
- matches: record(string(), unknown()).optional(),
5313
- transitionType: _enum([
5314
- "normal",
5315
- "targetless",
5316
- "reenter"
5317
- ]).optional(),
5318
- description: string().nullable().optional(),
5319
- input: unknown().optional()
5320
- })
5321
- });
5322
- const deleteEdgePatchSchema = object({
5323
- op: literal("deleteEdge"),
5324
- description: string().optional(),
5325
- edgeId: string()
5326
- });
5327
- const createStatePatchSchema = object({
5328
- op: literal("createState"),
5329
- description: string().optional(),
5330
- id: string().optional(),
5331
- parentId: string(),
5332
- key: string(),
5333
- type: editorStateTypeSchema.optional(),
5334
- x: number().optional(),
5335
- y: number().optional(),
5336
- color: canvasColorSchema.nullable().optional(),
5337
- initial: boolean().optional()
5338
- });
5339
- const updateStatePatchSchema = object({
5340
- op: literal("updateState"),
5341
- description: string().optional(),
5342
- stateId: string(),
5343
- key: string().optional(),
5344
- type: editorStateTypeSchema.optional(),
5345
- stateDescription: string().optional(),
5346
- initialId: string().nullable().optional(),
5347
- initialInput: unknown().optional(),
5348
- timeout: unknown().optional(),
5349
- route: unknown().optional(),
5350
- color: canvasColorSchema.nullable().optional(),
5351
- meta: record(string(), unknown()).nullable().optional(),
5352
- history: _enum(["shallow", "deep"]).nullable().optional()
5353
- });
5354
- const deleteStatePatchSchema = object({
5355
- op: literal("deleteState"),
5356
- description: string().optional(),
5357
- stateId: string()
5358
- });
5359
- const createTransitionPatchSchema = object({
5360
- op: literal("createTransition"),
5361
- description: string().optional(),
5362
- id: string().optional(),
5363
- sourceId: string(),
5364
- targetId: string(),
5365
- eventType: string(),
5366
- matches: record(string(), unknown()).optional(),
5367
- transitionType: _enum([
5368
- "normal",
5369
- "targetless",
5370
- "reenter"
5371
- ]).optional(),
5372
- guard: object({
5373
- type: string(),
5374
- code: string().optional(),
5375
- params: record(string(), unknown()).optional()
5376
- }).optional(),
5377
- color: canvasColorSchema.nullable().optional(),
5378
- transitionDescription: string().nullable().optional(),
5379
- input: unknown().optional()
5380
- });
5381
- const updateTransitionPatchSchema = object({
5382
- op: literal("updateTransition"),
5383
- description: string().optional(),
5384
- transitionId: string(),
5385
- sourceId: string().optional(),
5386
- targetId: string().optional(),
5387
- eventType: string().optional(),
5388
- matches: record(string(), unknown()).optional(),
5389
- transitionType: _enum([
5390
- "normal",
5391
- "targetless",
5392
- "reenter"
5393
- ]).optional(),
5394
- transitionDescription: string().nullable().optional(),
5395
- input: unknown().optional(),
5396
- color: canvasColorSchema.nullable().optional(),
5397
- meta: record(string(), unknown()).nullable().optional()
5398
- });
5399
- const deleteTransitionPatchSchema = object({
5400
- op: literal("deleteTransition"),
5401
- description: string().optional(),
5402
- transitionId: string()
5403
- });
5404
- const createActionPatchSchema = object({
5405
- op: literal("createAction"),
5406
- description: string().optional(),
5407
- location: actionLocationSchema,
5408
- action: object({
5409
- id: string().optional(),
5410
- type: string(),
5411
- params: record(string(), unknown()).optional()
5412
- }),
5413
- index: number().optional()
5414
- });
5415
- const updateActionPatchSchema = object({
5416
- op: literal("updateAction"),
5417
- description: string().optional(),
5418
- location: actionLocationSchema,
5419
- actionId: string(),
5420
- data: object({
5421
- type: string().optional(),
5422
- params: record(string(), unknown()).optional()
5423
- })
5424
- });
5425
- const deleteActionPatchSchema = object({
5426
- op: literal("deleteAction"),
5427
- description: string().optional(),
5428
- location: actionLocationSchema,
5429
- actionId: string()
5430
- });
5431
- const createInvokePatchSchema = object({
5432
- op: literal("createInvoke"),
5433
- description: string().optional(),
5434
- nodeId: string(),
5435
- invoke: object({
5436
- id: string().optional(),
5437
- invocationId: string().optional(),
5438
- src: string(),
5439
- srcExpression: unknown().optional(),
5440
- code: string().optional(),
5441
- registryKey: string().optional(),
5442
- timeout: unknown().optional(),
5443
- input: unknown().optional(),
5444
- output: unknown().optional()
5445
- })
5446
- });
5447
- const updateInvokePatchSchema = object({
5448
- op: literal("updateInvoke"),
5449
- description: string().optional(),
5450
- nodeId: string(),
5451
- invokeId: string(),
5452
- data: object({
5453
- invocationId: string().optional(),
5454
- src: string().optional(),
5455
- srcExpression: unknown().optional(),
5456
- code: string().optional(),
5457
- registryKey: string().optional(),
5458
- timeout: unknown().optional(),
5459
- input: unknown().optional(),
5460
- output: unknown().optional()
5461
- })
5462
- });
5463
- const deleteInvokePatchSchema = object({
5464
- op: literal("deleteInvoke"),
5465
- description: string().optional(),
5466
- nodeId: string(),
5467
- invokeId: string()
5468
- });
5469
- const implementationPatchDataSchema = object({
5470
- id: string(),
5471
- name: string().optional(),
5472
- code: string().optional()
5473
- });
5474
- const createImplementationPatchSchema = object({
5475
- op: literal("createImplementation"),
5476
- description: string().optional(),
5477
- sourceType: implementationSourceTypeSchema,
5478
- implementation: implementationPatchDataSchema
5479
- });
5480
- const updateImplementationPatchSchema = object({
5481
- op: literal("updateImplementation"),
5482
- description: string().optional(),
5483
- sourceType: implementationSourceTypeSchema,
5484
- implementationId: string(),
5485
- data: object({
5486
- name: string().optional(),
5487
- code: string().optional()
5488
- })
5489
- });
5490
- const deleteImplementationPatchSchema = object({
5491
- op: literal("deleteImplementation"),
5492
- description: string().optional(),
5493
- sourceType: implementationSourceTypeSchema,
5494
- implementationId: string()
5495
- });
5496
- const setGuardPatchSchema = object({
5497
- op: literal("setGuard"),
5498
- description: string().optional(),
5499
- edgeId: string(),
5500
- guard: object({
5501
- type: string(),
5502
- code: string().optional(),
5503
- params: record(string(), unknown()).optional()
5504
- })
5505
- });
5506
- const deleteGuardPatchSchema = object({
5507
- op: literal("deleteGuard"),
5508
- description: string().optional(),
5509
- edgeId: string()
5510
- });
5511
- const createTagPatchSchema = object({
5512
- op: literal("createTag"),
5513
- description: string().optional(),
5514
- nodeId: string(),
5515
- tag: object({ name: string() })
5516
- });
5517
- const deleteTagPatchSchema = object({
5518
- op: literal("deleteTag"),
5519
- description: string().optional(),
5520
- nodeId: string(),
5521
- tagName: string()
5522
- });
5523
- const createAnnotationPatchSchema = object({
5524
- op: literal("createAnnotation"),
5525
- description: string().optional(),
5526
- id: string().optional(),
5527
- parentId: string().nullable(),
5528
- content: string(),
5529
- x: number().optional(),
5530
- y: number().optional()
5531
- });
5532
- const updateAnnotationPatchSchema = object({
5533
- op: literal("updateAnnotation"),
5534
- description: string().optional(),
5535
- annotationId: string(),
5536
- data: object({ content: string().optional() })
5537
- });
5538
- const deleteAnnotationPatchSchema = object({
5539
- op: literal("deleteAnnotation"),
5540
- description: string().optional(),
5541
- annotationId: string()
5542
- });
5543
- const setContextPatchSchema = object({
5544
- op: literal("setContext"),
5545
- description: string().optional(),
5546
- context: record(string(), unknown())
5547
- });
5548
- const updateSchemasPatchSchema = object({
5549
- op: literal("updateSchemas"),
5550
- description: string().optional(),
5551
- schemas: object({
5552
- context: record(string(), unknown()).nullable().optional(),
5553
- events: record(string(), unknown()).nullable().optional(),
5554
- input: unknown().nullable().optional(),
5555
- output: unknown().nullable().optional()
5556
- })
5557
- });
5558
- /** Full union: generic graph ops + semantic state machine ops */
5559
- const graphPatchSchema = discriminatedUnion("op", [
5560
- createNodePatchSchema,
5561
- updateNodePatchSchema,
5562
- deleteNodePatchSchema,
5563
- createEdgePatchSchema,
5564
- updateEdgePatchSchema,
5565
- deleteEdgePatchSchema,
5566
- createStatePatchSchema,
5567
- updateStatePatchSchema,
5568
- deleteStatePatchSchema,
5569
- createTransitionPatchSchema,
5570
- updateTransitionPatchSchema,
5571
- deleteTransitionPatchSchema,
5572
- createActionPatchSchema,
5573
- updateActionPatchSchema,
5574
- deleteActionPatchSchema,
5575
- createInvokePatchSchema,
5576
- updateInvokePatchSchema,
5577
- deleteInvokePatchSchema,
5578
- createImplementationPatchSchema,
5579
- updateImplementationPatchSchema,
5580
- deleteImplementationPatchSchema,
5581
- setGuardPatchSchema,
5582
- deleteGuardPatchSchema,
5583
- createTagPatchSchema,
5584
- deleteTagPatchSchema,
5585
- createAnnotationPatchSchema,
5586
- updateAnnotationPatchSchema,
5587
- deleteAnnotationPatchSchema,
5588
- setContextPatchSchema,
5589
- updateSchemasPatchSchema
5590
- ]);
5591
- /** AI-only schema: semantic ops + shared ops (no generic graph ops) */
5592
- const aiPatchSchema = discriminatedUnion("op", [
5593
- createStatePatchSchema,
5594
- updateStatePatchSchema,
5595
- deleteStatePatchSchema,
5596
- createTransitionPatchSchema,
5597
- updateTransitionPatchSchema,
5598
- deleteTransitionPatchSchema,
5599
- createActionPatchSchema,
5600
- updateActionPatchSchema,
5601
- deleteActionPatchSchema,
5602
- createInvokePatchSchema,
5603
- updateInvokePatchSchema,
5604
- deleteInvokePatchSchema,
5605
- createImplementationPatchSchema,
5606
- updateImplementationPatchSchema,
5607
- deleteImplementationPatchSchema,
5608
- setGuardPatchSchema,
5609
- deleteGuardPatchSchema,
5610
- createTagPatchSchema,
5611
- deleteTagPatchSchema,
5612
- createAnnotationPatchSchema,
5613
- updateAnnotationPatchSchema,
5614
- deleteAnnotationPatchSchema,
5615
- setContextPatchSchema,
5616
- updateSchemasPatchSchema
5617
- ]);
5618
5228
 
5619
5229
  //#endregion
5620
5230
  //#region src/statelyPragma.ts
@@ -1,4 +1,4 @@
1
- import { A as output, C as ZodNumber, D as ZodString, E as ZodRecord, O as ZodUnion, S as ZodNullable, T as ZodOptional, b as ZodEnum, j as $strip, k as ZodUnknown, w as ZodObject, x as ZodLiteral, y as ZodArray } from "./index-BABex8NE.mjs";
1
+ import { A as output, C as ZodNumber, D as ZodString, E as ZodRecord, O as ZodUnion, S as ZodNullable, T as ZodOptional, b as ZodEnum, j as $strip, k as ZodUnknown, w as ZodObject, x as ZodLiteral, y as ZodArray } from "./index-Bakx1tkW.mjs";
2
2
  import { n as StatelyCredential, t as StatelyAuthMode } from "./auth-B0ZTKri2.mjs";
3
3
 
4
4
  //#region ../api-contract/dist/errors.d.mts
@@ -1,4 +1,4 @@
1
- import { c as object, d as union, f as unknown, l as record, n as array, o as literal, r as boolean, s as number, t as _enum, u as string } from "./schemas-b9wG-zYl.mjs";
1
+ import { c as object, d as union, f as unknown, l as record, n as array, o as literal, r as boolean, s as number, t as _enum, u as string } from "./openapi-BTDjYWXd.mjs";
2
2
  import { createAuthorizationHeader, getCredentialToken } from "./auth.mjs";
3
3
 
4
4
  //#region ../api-contract/dist/errors.mjs
package/dist/studio.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- 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, p as LegacyExtractMachinesOptions, 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-CjnsqD8j.mjs";
1
+ 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, p as LegacyExtractMachinesOptions, 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-DYI613t_.mjs";
2
2
  export { ConnectedRepo, CreateMachineFromDefinitionInput, CreateMachineFromTemplateInput, CreateMachineInput, CreateMachineTemplate, CreateProjectInput, DEFAULT_STATELY_BASE_URL, EnsureProjectInput, ExtractMachinesInput, ExtractMachinesResponse, ExtractedMachine, ExtractedMachines, GetMachineOptions, LegacyExtractMachinesOptions, LegacyProjectVisibility, LegacyUpdateMachineInput, Machine, MachineVersion, Project, ProjectData, ProjectMachine, ProjectMachineSummary, ProjectSummary, ProjectVisibility, RepoType, ResourceErrorCode, StudioApiError, StudioApiErrorOptions, StudioClient, StudioClientOptions, StudioMachineRecord, StudioRequestOptions, UpdateMachineInput, UpdateProjectInput, VerifyApiKeyResponse, VerifyResult, XStateVersion, createStatelyClient };
package/dist/studio.mjs CHANGED
@@ -1,3 +1,4 @@
1
- import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-DHGspwII.mjs";
1
+ import "./openapi-BTDjYWXd.mjs";
2
+ import { n as StudioApiError, r as createStatelyClient, t as DEFAULT_STATELY_BASE_URL } from "./studio-iNSHtNmP.mjs";
2
3
 
3
4
  export { DEFAULT_STATELY_BASE_URL, StudioApiError, createStatelyClient };
package/dist/sync.d.mts CHANGED
@@ -1,5 +1,5 @@
1
- import { b as DigraphConfig, i as StatelyGraph } from "./graph-B4WM_nYg.mjs";
2
- import { C as StudioMachineRecord, L as XStateVersion, g as ProjectData, o as CreateProjectInput, x as StudioClient } from "./studio-CjnsqD8j.mjs";
1
+ import { b as DigraphConfig, i as StatelyGraph } from "./graph-DYjfFztq.mjs";
2
+ import { C as StudioMachineRecord, L as XStateVersion, g as ProjectData, o as CreateProjectInput, x as StudioClient } from "./studio-DYI613t_.mjs";
3
3
  import { GraphDiff } from "@statelyai/graph";
4
4
 
5
5
  //#region src/sync.d.ts
package/dist/sync.mjs CHANGED
@@ -1,5 +1,6 @@
1
- import { r as createStatelyClient } from "./studio-DHGspwII.mjs";
2
- import { f as normalizeMachineProfile, h as xstateSourceToConfig, i as INLINE_EXPRESSION_DIRECTIVE_FIELDS, m as serializeJS, n as getStatelyPragma, r as upsertStatelyPragma, s as detectXStateSourceProfile, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-mii-qTXd.mjs";
1
+ import "./openapi-BTDjYWXd.mjs";
2
+ import { r as createStatelyClient } from "./studio-iNSHtNmP.mjs";
3
+ import { f as normalizeMachineProfile, h as xstateSourceToConfig, i as INLINE_EXPRESSION_DIRECTIVE_FIELDS, m as serializeJS, n as getStatelyPragma, r as upsertStatelyPragma, s as detectXStateSourceProfile, t as findStatelyPragmaAttachments, u as graphToXStateTS } from "./statelyPragma-CokFTPgT.mjs";
3
4
  import { fromStudioMachine, toStudioMachine } from "./graph.mjs";
4
5
  import * as ts$1 from "typescript";
5
6
  import ts from "typescript";
@@ -127,6 +127,7 @@ function toInitMessage(options) {
127
127
  rightPanels: options.panels?.rightPanels,
128
128
  activePanels: options.panels?.activePanels,
129
129
  commentsByMachineId: options.commentsByMachineId,
130
+ settings: options.settings,
130
131
  unsavedIndicator: options.unsavedIndicator
131
132
  };
132
133
  return {
@@ -146,6 +147,7 @@ function toInitMessage(options) {
146
147
  activePanels: options.panels?.activePanels,
147
148
  comments: options.comments,
148
149
  sourceLocations: options.sourceLocations,
150
+ settings: options.settings,
149
151
  unsavedIndicator: options.unsavedIndicator
150
152
  };
151
153
  }
@@ -329,7 +331,7 @@ function createWebSocketTransport(options) {
329
331
 
330
332
  //#endregion
331
333
  //#region src/version.ts
332
- const SDK_VERSION = "0.21.0";
334
+ const SDK_VERSION = "0.22.0";
333
335
  function inspectionRuntime() {
334
336
  if (typeof window !== "undefined") return "browser";
335
337
  if (typeof process !== "undefined" && process.versions?.node) return "node";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@statelyai/sdk",
3
- "version": "0.21.0",
3
+ "version": "0.22.0",
4
4
  "license": "MIT",
5
5
  "bin": {
6
6
  "stately-sdk": "./dist/bin.mjs"