@statelyai/sdk 0.20.3 → 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,4 +1,4 @@
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
3
  import "xstate";
4
4
  import "xstate/graph";
@@ -4410,6 +4410,92 @@ function guardCondition(value) {
4410
4410
  firstParam: params.startsWith("(") && params.endsWith(")") ? params.slice(1, -1).trim() : params
4411
4411
  };
4412
4412
  }
4413
+ const V6_ARG_BINDINGS = [
4414
+ "context",
4415
+ "event",
4416
+ "actions",
4417
+ "children",
4418
+ "self",
4419
+ "system"
4420
+ ];
4421
+ const V6_IDENTIFIER = /^[A-Za-z_$][A-Za-z0-9_$]*$/;
4422
+ function inferV6ArgBindings(code) {
4423
+ return V6_ARG_BINDINGS.filter((name) => new RegExp(`\\b${name}\\b`).test(code));
4424
+ }
4425
+ /** Splits a destructuring pattern body on its top-level commas. */
4426
+ function splitV6PatternEntries(body) {
4427
+ const entries = [];
4428
+ let depth = 0;
4429
+ let start = 0;
4430
+ let quote;
4431
+ for (let index = 0; index < body.length; index++) {
4432
+ const char = body[index];
4433
+ if (quote) {
4434
+ if (char === "\\") index++;
4435
+ else if (char === quote) quote = void 0;
4436
+ continue;
4437
+ }
4438
+ if (char === "\"" || char === "'" || char === "`") quote = char;
4439
+ else if (char === "{" || char === "[" || char === "(") depth++;
4440
+ else if (char === "}" || char === "]" || char === ")") {
4441
+ depth--;
4442
+ if (depth < 0) return void 0;
4443
+ } else if (char === "," && depth === 0) {
4444
+ entries.push(body.slice(start, index));
4445
+ start = index + 1;
4446
+ }
4447
+ }
4448
+ if (depth !== 0 || quote) return void 0;
4449
+ entries.push(body.slice(start));
4450
+ return entries.map((entry) => entry.trim()).filter(Boolean);
4451
+ }
4452
+ /** Local name a destructuring entry binds, or `undefined` if not a plain one. */
4453
+ function getV6PatternBinding(entry) {
4454
+ const colon = entry.indexOf(":");
4455
+ const name = (colon < 0 ? entry : entry.slice(colon + 1)).split("=")[0].trim();
4456
+ return V6_IDENTIFIER.test(name) ? name : void 0;
4457
+ }
4458
+ /**
4459
+ * Unions the bindings referenced by generated code into the parameter authored
4460
+ * on a guard, so a collapsed transition function never references unbound
4461
+ * variables. Returns `undefined` when the authored parameter cannot be
4462
+ * extended safely, in which case the transition array is kept as-is.
4463
+ */
4464
+ function mergeV6FirstParam(authoredFirstParam, inferred) {
4465
+ if (!authoredFirstParam) return {
4466
+ firstParam: inferred.length ? `{ ${inferred.join(", ")} }` : "_",
4467
+ prelude: []
4468
+ };
4469
+ if (inferred.length === 0) return {
4470
+ firstParam: authoredFirstParam,
4471
+ prelude: []
4472
+ };
4473
+ if (V6_IDENTIFIER.test(authoredFirstParam)) {
4474
+ if (inferred.includes(authoredFirstParam)) return void 0;
4475
+ return {
4476
+ firstParam: authoredFirstParam,
4477
+ prelude: [`const { ${inferred.join(", ")} } = ${authoredFirstParam};`]
4478
+ };
4479
+ }
4480
+ if (!authoredFirstParam.startsWith("{") || !authoredFirstParam.endsWith("}")) return;
4481
+ const entries = splitV6PatternEntries(authoredFirstParam.slice(1, -1));
4482
+ if (!entries) return void 0;
4483
+ const bound = new Set(entries.map(getV6PatternBinding).filter((name) => name !== void 0));
4484
+ const missing = inferred.filter((name) => !bound.has(name));
4485
+ if (missing.length === 0) return {
4486
+ firstParam: authoredFirstParam,
4487
+ prelude: []
4488
+ };
4489
+ const restIndex = entries.findIndex((entry) => entry.startsWith("..."));
4490
+ return {
4491
+ firstParam: `{ ${(restIndex < 0 ? [...entries, ...missing] : [
4492
+ ...entries.slice(0, restIndex),
4493
+ ...missing,
4494
+ ...entries.slice(restIndex)
4495
+ ]).join(", ")} }`,
4496
+ prelude: []
4497
+ };
4498
+ }
4413
4499
  function buildV6TransitionFunction(transitions) {
4414
4500
  const branches = [];
4415
4501
  let authoredFirstParam;
@@ -4435,24 +4521,23 @@ function buildV6TransitionFunction(transitions) {
4435
4521
  if (!returnValue) return;
4436
4522
  const body = [...rendered.statements.map(formatV6Statement), `return ${returnValue};`];
4437
4523
  if (body.length === 0) return;
4438
- if (guard.condition === "true") branches.push(...body.map((line) => ` ${line}`));
4439
- else {
4440
- branches.push(` if (${guard.condition}) {`);
4441
- branches.push(...body.map((line) => ` ${line}`));
4442
- branches.push(" }");
4443
- }
4524
+ branches.push({
4525
+ condition: guard.condition,
4526
+ body
4527
+ });
4444
4528
  }
4445
4529
  if (branches.length === 0) return;
4446
- const referenced = branches.join("\n");
4447
- const inferredBindings = [
4448
- "context",
4449
- "event",
4450
- "actions",
4451
- "children",
4452
- "self",
4453
- "system"
4454
- ].filter((name) => new RegExp(`\\b${name}\\b`).test(referenced));
4455
- return raw(`(${authoredFirstParam ?? (inferredBindings.length ? `{ ${inferredBindings.join(", ")} }` : "_")}, enq) => {\n${branches.join("\n")}\n}`);
4530
+ const generated = branches.flatMap((branch) => branch.body).join("\n");
4531
+ const merged = mergeV6FirstParam(authoredFirstParam, inferV6ArgBindings(generated));
4532
+ if (!merged) return;
4533
+ const lines = merged.prelude.map((statement) => ` ${statement}`);
4534
+ for (const branch of branches) if (branch.condition === "true") lines.push(...branch.body.map((line) => ` ${line}`));
4535
+ else {
4536
+ lines.push(` if (${branch.condition}) {`);
4537
+ lines.push(...branch.body.map((line) => ` ${line}`));
4538
+ lines.push(" }");
4539
+ }
4540
+ return raw(`(${merged.firstParam}, enq) => {\n${lines.join("\n")}\n}`);
4456
4541
  }
4457
4542
  function toV6ActionField(actions) {
4458
4543
  if (actions.length === 1) {
@@ -4470,15 +4555,7 @@ function buildV6ActionFunction(actions, transition) {
4470
4555
  let returnValue = rendered.contextValue ? `{ context: ${rendered.contextValue} }` : void 0;
4471
4556
  if (transition) returnValue = buildV6TransitionReturnValue(transition, rendered.contextValue);
4472
4557
  if (statements.length === 0 && !returnValue) return void 0;
4473
- const referenced = [...statements, returnValue ?? ""].join("\n");
4474
- const bindings = [
4475
- "context",
4476
- "event",
4477
- "actions",
4478
- "children",
4479
- "self",
4480
- "system"
4481
- ].filter((name) => new RegExp(`\\b${name}\\b`).test(referenced));
4558
+ const bindings = inferV6ArgBindings([...statements, returnValue ?? ""].join("\n"));
4482
4559
  return raw(`(${bindings.length ? `{ ${bindings.join(", ")} }` : "_"}, enq) => {\n${[...statements.map((statement) => ` ${formatV6Statement(statement)}`), ...returnValue ? [` return ${returnValue};`] : []].join("\n")}\n}`);
4483
4560
  }
4484
4561
  function formatV6Statement(statement) {
@@ -4890,7 +4967,7 @@ const actionLocationSchema$1 = union([object({
4890
4967
  edgeId: string(),
4891
4968
  group: literal("transition")
4892
4969
  })]);
4893
- const createStatePatchSchema$1 = object({
4970
+ const createStatePatchSchema = object({
4894
4971
  op: literal("createState"),
4895
4972
  description: string().optional(),
4896
4973
  id: string().optional(),
@@ -4902,7 +4979,7 @@ const createStatePatchSchema$1 = object({
4902
4979
  color: colorSchema.nullable().optional(),
4903
4980
  initial: boolean().optional()
4904
4981
  });
4905
- const updateStatePatchSchema$1 = object({
4982
+ const updateStatePatchSchema = object({
4906
4983
  op: literal("updateState"),
4907
4984
  description: string().optional(),
4908
4985
  stateId: string(),
@@ -4914,7 +4991,7 @@ const updateStatePatchSchema$1 = object({
4914
4991
  meta: record(string(), unknown()).nullable().optional(),
4915
4992
  history: _enum(["shallow", "deep"]).nullable().optional()
4916
4993
  });
4917
- const deleteStatePatchSchema$1 = object({
4994
+ const deleteStatePatchSchema = object({
4918
4995
  op: literal("deleteState"),
4919
4996
  description: string().optional(),
4920
4997
  stateId: string()
@@ -4924,7 +5001,7 @@ const guardSchema = object({
4924
5001
  code: string().optional(),
4925
5002
  params: record(string(), unknown()).optional()
4926
5003
  });
4927
- const createTransitionPatchSchema$1 = object({
5004
+ const createTransitionPatchSchema = object({
4928
5005
  op: literal("createTransition"),
4929
5006
  description: string().optional(),
4930
5007
  id: string().optional(),
@@ -4941,7 +5018,7 @@ const createTransitionPatchSchema$1 = object({
4941
5018
  color: colorSchema.nullable().optional(),
4942
5019
  transitionDescription: string().nullable().optional()
4943
5020
  });
4944
- const updateTransitionPatchSchema$1 = object({
5021
+ const updateTransitionPatchSchema = object({
4945
5022
  op: literal("updateTransition"),
4946
5023
  description: string().optional(),
4947
5024
  transitionId: string(),
@@ -4958,12 +5035,12 @@ const updateTransitionPatchSchema$1 = object({
4958
5035
  color: colorSchema.nullable().optional(),
4959
5036
  meta: record(string(), unknown()).nullable().optional()
4960
5037
  });
4961
- const deleteTransitionPatchSchema$1 = object({
5038
+ const deleteTransitionPatchSchema = object({
4962
5039
  op: literal("deleteTransition"),
4963
5040
  description: string().optional(),
4964
5041
  transitionId: string()
4965
5042
  });
4966
- const createActionPatchSchema$1 = object({
5043
+ const createActionPatchSchema = object({
4967
5044
  op: literal("createAction"),
4968
5045
  description: string().optional(),
4969
5046
  location: actionLocationSchema$1,
@@ -4974,7 +5051,7 @@ const createActionPatchSchema$1 = object({
4974
5051
  }),
4975
5052
  index: number().optional()
4976
5053
  });
4977
- const updateActionPatchSchema$1 = object({
5054
+ const updateActionPatchSchema = object({
4978
5055
  op: literal("updateAction"),
4979
5056
  description: string().optional(),
4980
5057
  location: actionLocationSchema$1,
@@ -4984,35 +5061,35 @@ const updateActionPatchSchema$1 = object({
4984
5061
  params: record(string(), unknown()).optional()
4985
5062
  })
4986
5063
  });
4987
- const deleteActionPatchSchema$1 = object({
5064
+ const deleteActionPatchSchema = object({
4988
5065
  op: literal("deleteAction"),
4989
5066
  description: string().optional(),
4990
5067
  location: actionLocationSchema$1,
4991
5068
  actionId: string()
4992
5069
  });
4993
- const setGuardPatchSchema$1 = object({
5070
+ const setGuardPatchSchema = object({
4994
5071
  op: literal("setGuard"),
4995
5072
  description: string().optional(),
4996
5073
  edgeId: string(),
4997
5074
  guard: guardSchema
4998
5075
  });
4999
- const deleteGuardPatchSchema$1 = object({
5076
+ const deleteGuardPatchSchema = object({
5000
5077
  op: literal("deleteGuard"),
5001
5078
  description: string().optional(),
5002
5079
  edgeId: string()
5003
5080
  });
5004
5081
  const machinePatchSchema = discriminatedUnion("op", [
5005
- createStatePatchSchema$1,
5006
- updateStatePatchSchema$1,
5007
- deleteStatePatchSchema$1,
5008
- createTransitionPatchSchema$1,
5009
- updateTransitionPatchSchema$1,
5010
- deleteTransitionPatchSchema$1,
5011
- createActionPatchSchema$1,
5012
- updateActionPatchSchema$1,
5013
- deleteActionPatchSchema$1,
5014
- setGuardPatchSchema$1,
5015
- deleteGuardPatchSchema$1
5082
+ createStatePatchSchema,
5083
+ updateStatePatchSchema,
5084
+ deleteStatePatchSchema,
5085
+ createTransitionPatchSchema,
5086
+ updateTransitionPatchSchema,
5087
+ deleteTransitionPatchSchema,
5088
+ createActionPatchSchema,
5089
+ updateActionPatchSchema,
5090
+ deleteActionPatchSchema,
5091
+ setGuardPatchSchema,
5092
+ deleteGuardPatchSchema
5016
5093
  ]);
5017
5094
  const validationLevelSchema = _enum([
5018
5095
  "info",
@@ -5148,397 +5225,6 @@ const simulateMachineStepInputSchema = machineInputSchema.extend({
5148
5225
  event: object({ type: string() }).passthrough(),
5149
5226
  guardState: record(string(), boolean()).optional()
5150
5227
  });
5151
- const pointSchema = object({
5152
- x: number(),
5153
- y: number()
5154
- });
5155
- const canvasColorSchema = _enum([
5156
- "green",
5157
- "red",
5158
- "purple",
5159
- "blue",
5160
- "orange",
5161
- "yellow",
5162
- "pink",
5163
- "teal"
5164
- ]);
5165
- const editorStateTypeSchema = _enum([
5166
- "normal",
5167
- "parallel",
5168
- "history",
5169
- "final",
5170
- "choice"
5171
- ]).nullable();
5172
- const actionLocationSchema = union([object({
5173
- nodeId: string(),
5174
- group: _enum(["entry", "exit"])
5175
- }), object({
5176
- edgeId: string(),
5177
- group: literal("transition")
5178
- })]);
5179
- const implementationSourceTypeSchema = _enum([
5180
- "action",
5181
- "guard",
5182
- "actor",
5183
- "delay"
5184
- ]);
5185
- const createNodePatchSchema = object({
5186
- op: literal("createNode"),
5187
- description: string().optional(),
5188
- id: string().optional(),
5189
- parentId: string(),
5190
- key: string(),
5191
- type: editorStateTypeSchema.optional(),
5192
- x: number().optional(),
5193
- y: number().optional()
5194
- });
5195
- const updateNodePatchSchema = object({
5196
- op: literal("updateNode"),
5197
- description: string().optional(),
5198
- nodeId: string(),
5199
- data: object({
5200
- key: string().optional(),
5201
- type: editorStateTypeSchema.optional(),
5202
- description: string().optional(),
5203
- initialId: string().nullable().optional(),
5204
- initialInput: unknown().optional(),
5205
- timeout: unknown().optional(),
5206
- route: unknown().optional()
5207
- })
5208
- });
5209
- const deleteNodePatchSchema = object({
5210
- op: literal("deleteNode"),
5211
- description: string().optional(),
5212
- nodeId: string()
5213
- });
5214
- const createEdgePatchSchema = object({
5215
- op: literal("createEdge"),
5216
- description: string().optional(),
5217
- id: string().optional(),
5218
- sourceId: string(),
5219
- targetId: string(),
5220
- eventType: string(),
5221
- matches: record(string(), unknown()).optional(),
5222
- transitionType: _enum([
5223
- "normal",
5224
- "targetless",
5225
- "reenter"
5226
- ]).optional()
5227
- });
5228
- const updateEdgePatchSchema = object({
5229
- op: literal("updateEdge"),
5230
- description: string().optional(),
5231
- edgeId: string(),
5232
- data: object({
5233
- sourceId: string().optional(),
5234
- targetId: string().optional(),
5235
- eventType: string().optional(),
5236
- matches: record(string(), unknown()).optional(),
5237
- transitionType: _enum([
5238
- "normal",
5239
- "targetless",
5240
- "reenter"
5241
- ]).optional(),
5242
- description: string().nullable().optional(),
5243
- input: unknown().optional()
5244
- })
5245
- });
5246
- const deleteEdgePatchSchema = object({
5247
- op: literal("deleteEdge"),
5248
- description: string().optional(),
5249
- edgeId: string()
5250
- });
5251
- const createStatePatchSchema = object({
5252
- op: literal("createState"),
5253
- description: string().optional(),
5254
- id: string().optional(),
5255
- parentId: string(),
5256
- key: string(),
5257
- type: editorStateTypeSchema.optional(),
5258
- x: number().optional(),
5259
- y: number().optional(),
5260
- color: canvasColorSchema.nullable().optional(),
5261
- initial: boolean().optional()
5262
- });
5263
- const updateStatePatchSchema = object({
5264
- op: literal("updateState"),
5265
- description: string().optional(),
5266
- stateId: string(),
5267
- key: string().optional(),
5268
- type: editorStateTypeSchema.optional(),
5269
- stateDescription: string().optional(),
5270
- initialId: string().nullable().optional(),
5271
- initialInput: unknown().optional(),
5272
- timeout: unknown().optional(),
5273
- route: unknown().optional(),
5274
- color: canvasColorSchema.nullable().optional(),
5275
- meta: record(string(), unknown()).nullable().optional(),
5276
- history: _enum(["shallow", "deep"]).nullable().optional()
5277
- });
5278
- const deleteStatePatchSchema = object({
5279
- op: literal("deleteState"),
5280
- description: string().optional(),
5281
- stateId: string()
5282
- });
5283
- const createTransitionPatchSchema = object({
5284
- op: literal("createTransition"),
5285
- description: string().optional(),
5286
- id: string().optional(),
5287
- sourceId: string(),
5288
- targetId: string(),
5289
- eventType: string(),
5290
- matches: record(string(), unknown()).optional(),
5291
- transitionType: _enum([
5292
- "normal",
5293
- "targetless",
5294
- "reenter"
5295
- ]).optional(),
5296
- guard: object({
5297
- type: string(),
5298
- code: string().optional(),
5299
- params: record(string(), unknown()).optional()
5300
- }).optional(),
5301
- color: canvasColorSchema.nullable().optional(),
5302
- transitionDescription: string().nullable().optional(),
5303
- input: unknown().optional()
5304
- });
5305
- const updateTransitionPatchSchema = object({
5306
- op: literal("updateTransition"),
5307
- description: string().optional(),
5308
- transitionId: string(),
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
- transitionDescription: string().nullable().optional(),
5319
- input: unknown().optional(),
5320
- color: canvasColorSchema.nullable().optional(),
5321
- meta: record(string(), unknown()).nullable().optional()
5322
- });
5323
- const deleteTransitionPatchSchema = object({
5324
- op: literal("deleteTransition"),
5325
- description: string().optional(),
5326
- transitionId: string()
5327
- });
5328
- const createActionPatchSchema = object({
5329
- op: literal("createAction"),
5330
- description: string().optional(),
5331
- location: actionLocationSchema,
5332
- action: object({
5333
- id: string().optional(),
5334
- type: string(),
5335
- params: record(string(), unknown()).optional()
5336
- }),
5337
- index: number().optional()
5338
- });
5339
- const updateActionPatchSchema = object({
5340
- op: literal("updateAction"),
5341
- description: string().optional(),
5342
- location: actionLocationSchema,
5343
- actionId: string(),
5344
- data: object({
5345
- type: string().optional(),
5346
- params: record(string(), unknown()).optional()
5347
- })
5348
- });
5349
- const deleteActionPatchSchema = object({
5350
- op: literal("deleteAction"),
5351
- description: string().optional(),
5352
- location: actionLocationSchema,
5353
- actionId: string()
5354
- });
5355
- const createInvokePatchSchema = object({
5356
- op: literal("createInvoke"),
5357
- description: string().optional(),
5358
- nodeId: string(),
5359
- invoke: object({
5360
- id: string().optional(),
5361
- invocationId: string().optional(),
5362
- src: string(),
5363
- srcExpression: unknown().optional(),
5364
- code: string().optional(),
5365
- registryKey: string().optional(),
5366
- timeout: unknown().optional(),
5367
- input: unknown().optional(),
5368
- output: unknown().optional()
5369
- })
5370
- });
5371
- const updateInvokePatchSchema = object({
5372
- op: literal("updateInvoke"),
5373
- description: string().optional(),
5374
- nodeId: string(),
5375
- invokeId: string(),
5376
- data: object({
5377
- invocationId: string().optional(),
5378
- src: string().optional(),
5379
- srcExpression: unknown().optional(),
5380
- code: string().optional(),
5381
- registryKey: string().optional(),
5382
- timeout: unknown().optional(),
5383
- input: unknown().optional(),
5384
- output: unknown().optional()
5385
- })
5386
- });
5387
- const deleteInvokePatchSchema = object({
5388
- op: literal("deleteInvoke"),
5389
- description: string().optional(),
5390
- nodeId: string(),
5391
- invokeId: string()
5392
- });
5393
- const implementationPatchDataSchema = object({
5394
- id: string(),
5395
- name: string().optional(),
5396
- code: string().optional()
5397
- });
5398
- const createImplementationPatchSchema = object({
5399
- op: literal("createImplementation"),
5400
- description: string().optional(),
5401
- sourceType: implementationSourceTypeSchema,
5402
- implementation: implementationPatchDataSchema
5403
- });
5404
- const updateImplementationPatchSchema = object({
5405
- op: literal("updateImplementation"),
5406
- description: string().optional(),
5407
- sourceType: implementationSourceTypeSchema,
5408
- implementationId: string(),
5409
- data: object({
5410
- name: string().optional(),
5411
- code: string().optional()
5412
- })
5413
- });
5414
- const deleteImplementationPatchSchema = object({
5415
- op: literal("deleteImplementation"),
5416
- description: string().optional(),
5417
- sourceType: implementationSourceTypeSchema,
5418
- implementationId: string()
5419
- });
5420
- const setGuardPatchSchema = object({
5421
- op: literal("setGuard"),
5422
- description: string().optional(),
5423
- edgeId: string(),
5424
- guard: object({
5425
- type: string(),
5426
- code: string().optional(),
5427
- params: record(string(), unknown()).optional()
5428
- })
5429
- });
5430
- const deleteGuardPatchSchema = object({
5431
- op: literal("deleteGuard"),
5432
- description: string().optional(),
5433
- edgeId: string()
5434
- });
5435
- const createTagPatchSchema = object({
5436
- op: literal("createTag"),
5437
- description: string().optional(),
5438
- nodeId: string(),
5439
- tag: object({ name: string() })
5440
- });
5441
- const deleteTagPatchSchema = object({
5442
- op: literal("deleteTag"),
5443
- description: string().optional(),
5444
- nodeId: string(),
5445
- tagName: string()
5446
- });
5447
- const createAnnotationPatchSchema = object({
5448
- op: literal("createAnnotation"),
5449
- description: string().optional(),
5450
- id: string().optional(),
5451
- parentId: string().nullable(),
5452
- content: string(),
5453
- x: number().optional(),
5454
- y: number().optional()
5455
- });
5456
- const updateAnnotationPatchSchema = object({
5457
- op: literal("updateAnnotation"),
5458
- description: string().optional(),
5459
- annotationId: string(),
5460
- data: object({ content: string().optional() })
5461
- });
5462
- const deleteAnnotationPatchSchema = object({
5463
- op: literal("deleteAnnotation"),
5464
- description: string().optional(),
5465
- annotationId: string()
5466
- });
5467
- const setContextPatchSchema = object({
5468
- op: literal("setContext"),
5469
- description: string().optional(),
5470
- context: record(string(), unknown())
5471
- });
5472
- const updateSchemasPatchSchema = object({
5473
- op: literal("updateSchemas"),
5474
- description: string().optional(),
5475
- schemas: object({
5476
- context: record(string(), unknown()).nullable().optional(),
5477
- events: record(string(), unknown()).nullable().optional(),
5478
- input: unknown().nullable().optional(),
5479
- output: unknown().nullable().optional()
5480
- })
5481
- });
5482
- /** Full union: generic graph ops + semantic state machine ops */
5483
- const graphPatchSchema = discriminatedUnion("op", [
5484
- createNodePatchSchema,
5485
- updateNodePatchSchema,
5486
- deleteNodePatchSchema,
5487
- createEdgePatchSchema,
5488
- updateEdgePatchSchema,
5489
- deleteEdgePatchSchema,
5490
- createStatePatchSchema,
5491
- updateStatePatchSchema,
5492
- deleteStatePatchSchema,
5493
- createTransitionPatchSchema,
5494
- updateTransitionPatchSchema,
5495
- deleteTransitionPatchSchema,
5496
- createActionPatchSchema,
5497
- updateActionPatchSchema,
5498
- deleteActionPatchSchema,
5499
- createInvokePatchSchema,
5500
- updateInvokePatchSchema,
5501
- deleteInvokePatchSchema,
5502
- createImplementationPatchSchema,
5503
- updateImplementationPatchSchema,
5504
- deleteImplementationPatchSchema,
5505
- setGuardPatchSchema,
5506
- deleteGuardPatchSchema,
5507
- createTagPatchSchema,
5508
- deleteTagPatchSchema,
5509
- createAnnotationPatchSchema,
5510
- updateAnnotationPatchSchema,
5511
- deleteAnnotationPatchSchema,
5512
- setContextPatchSchema,
5513
- updateSchemasPatchSchema
5514
- ]);
5515
- /** AI-only schema: semantic ops + shared ops (no generic graph ops) */
5516
- const aiPatchSchema = discriminatedUnion("op", [
5517
- createStatePatchSchema,
5518
- updateStatePatchSchema,
5519
- deleteStatePatchSchema,
5520
- createTransitionPatchSchema,
5521
- updateTransitionPatchSchema,
5522
- deleteTransitionPatchSchema,
5523
- createActionPatchSchema,
5524
- updateActionPatchSchema,
5525
- deleteActionPatchSchema,
5526
- createInvokePatchSchema,
5527
- updateInvokePatchSchema,
5528
- deleteInvokePatchSchema,
5529
- createImplementationPatchSchema,
5530
- updateImplementationPatchSchema,
5531
- deleteImplementationPatchSchema,
5532
- setGuardPatchSchema,
5533
- deleteGuardPatchSchema,
5534
- createTagPatchSchema,
5535
- deleteTagPatchSchema,
5536
- createAnnotationPatchSchema,
5537
- updateAnnotationPatchSchema,
5538
- deleteAnnotationPatchSchema,
5539
- setContextPatchSchema,
5540
- updateSchemasPatchSchema
5541
- ]);
5542
5228
 
5543
5229
  //#endregion
5544
5230
  //#region src/statelyPragma.ts
@@ -1,4 +1,4 @@
1
- import { A as $strip, C as ZodObject, D as ZodUnion, E as ZodString, O as ZodUnknown, S as ZodNumber, T as ZodRecord, b as ZodLiteral, k as output, v as ZodArray, w as ZodOptional, x as ZodNullable, y as ZodEnum } from "./index-BAkQThnl.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-YSppd-am.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 };