@doeixd/machine 0.0.4 → 0.0.6

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,3 +1,10 @@
1
+ var __require = /* @__PURE__ */ ((x) => typeof require !== "undefined" ? require : typeof Proxy !== "undefined" ? new Proxy(x, {
2
+ get: (a, b) => (typeof require !== "undefined" ? require : a)[b]
3
+ }) : x)(function(x) {
4
+ if (typeof require !== "undefined") return require.apply(this, arguments);
5
+ throw Error('Dynamic require of "' + x + '" is not supported');
6
+ });
7
+
1
8
  // src/generators.ts
2
9
  function run(flow, initial) {
3
10
  const generator = flow(initial);
@@ -61,6 +68,675 @@ async function* stepAsync(m) {
61
68
  return received;
62
69
  }
63
70
 
71
+ // src/primitives.ts
72
+ var META_KEY = Symbol("MachineMeta");
73
+ var RUNTIME_META = Symbol("__machine_runtime_meta__");
74
+ function attachRuntimeMeta(fn, metadata2) {
75
+ const existing = fn[RUNTIME_META] || {};
76
+ const merged = { ...existing, ...metadata2 };
77
+ if (metadata2.guards && existing.guards) {
78
+ merged.guards = [...metadata2.guards, ...existing.guards];
79
+ } else if (metadata2.guards) {
80
+ merged.guards = [...metadata2.guards];
81
+ }
82
+ if (metadata2.actions && existing.actions) {
83
+ merged.actions = [...metadata2.actions, ...existing.actions];
84
+ } else if (metadata2.actions) {
85
+ merged.actions = [...metadata2.actions];
86
+ }
87
+ Object.defineProperty(fn, RUNTIME_META, {
88
+ value: merged,
89
+ enumerable: false,
90
+ writable: false,
91
+ configurable: true
92
+ // CRITICAL: Must be configurable for re-definition
93
+ });
94
+ }
95
+ function transitionTo(_target, implementation) {
96
+ attachRuntimeMeta(implementation, {
97
+ target: _target.name || _target.toString()
98
+ });
99
+ return implementation;
100
+ }
101
+ function describe(_text, transition) {
102
+ attachRuntimeMeta(transition, {
103
+ description: _text
104
+ });
105
+ return transition;
106
+ }
107
+ function guarded(guard, transition) {
108
+ attachRuntimeMeta(transition, {
109
+ guards: [guard]
110
+ });
111
+ return transition;
112
+ }
113
+ function invoke(service, implementation) {
114
+ attachRuntimeMeta(implementation, {
115
+ invoke: {
116
+ src: service.src,
117
+ onDone: service.onDone.name || service.onDone.toString(),
118
+ onError: service.onError.name || service.onError.toString(),
119
+ description: service.description
120
+ }
121
+ });
122
+ return implementation;
123
+ }
124
+ function action(action2, transition) {
125
+ attachRuntimeMeta(transition, {
126
+ actions: [action2]
127
+ });
128
+ return transition;
129
+ }
130
+ function metadata(_meta, value) {
131
+ return value;
132
+ }
133
+
134
+ // src/extract.ts
135
+ import { Project, Node } from "ts-morph";
136
+ function resolveClassName(node) {
137
+ if (Node.isIdentifier(node)) {
138
+ return node.getText();
139
+ }
140
+ if (Node.isTypeOfExpression(node)) {
141
+ return node.getExpression().getText();
142
+ }
143
+ return "unknown";
144
+ }
145
+ function parseObjectLiteral(obj) {
146
+ if (!Node.isObjectLiteralExpression(obj)) {
147
+ return {};
148
+ }
149
+ const result = {};
150
+ for (const prop of obj.getProperties()) {
151
+ if (Node.isPropertyAssignment(prop)) {
152
+ const name = prop.getName();
153
+ const init = prop.getInitializer();
154
+ if (init) {
155
+ if (Node.isStringLiteral(init)) {
156
+ result[name] = init.getLiteralValue();
157
+ } else if (Node.isNumericLiteral(init)) {
158
+ result[name] = init.getLiteralValue();
159
+ } else if (init.getText() === "true" || init.getText() === "false") {
160
+ result[name] = init.getText() === "true";
161
+ } else if (Node.isIdentifier(init)) {
162
+ result[name] = init.getText();
163
+ } else if (Node.isObjectLiteralExpression(init)) {
164
+ result[name] = parseObjectLiteral(init);
165
+ } else if (Node.isArrayLiteralExpression(init)) {
166
+ result[name] = init.getElements().map((el) => {
167
+ if (Node.isObjectLiteralExpression(el)) {
168
+ return parseObjectLiteral(el);
169
+ }
170
+ return el.getText();
171
+ });
172
+ }
173
+ }
174
+ }
175
+ }
176
+ return result;
177
+ }
178
+ function parseInvokeService(obj) {
179
+ if (!Node.isObjectLiteralExpression(obj)) {
180
+ return {};
181
+ }
182
+ const service = {};
183
+ for (const prop of obj.getProperties()) {
184
+ if (Node.isPropertyAssignment(prop)) {
185
+ const name = prop.getName();
186
+ const init = prop.getInitializer();
187
+ if (!init) continue;
188
+ if (name === "onDone" || name === "onError") {
189
+ service[name] = resolveClassName(init);
190
+ } else if (Node.isStringLiteral(init)) {
191
+ service[name] = init.getLiteralValue();
192
+ } else if (Node.isIdentifier(init)) {
193
+ service[name] = init.getText();
194
+ }
195
+ }
196
+ }
197
+ return service;
198
+ }
199
+ function extractFromCallExpression(call, verbose = false) {
200
+ if (!Node.isCallExpression(call)) {
201
+ return null;
202
+ }
203
+ const expression = call.getExpression();
204
+ const fnName = Node.isIdentifier(expression) ? expression.getText() : null;
205
+ if (!fnName) {
206
+ return null;
207
+ }
208
+ const metadata2 = {};
209
+ const args = call.getArguments();
210
+ switch (fnName) {
211
+ case "transitionTo":
212
+ if (args[0]) {
213
+ metadata2.target = resolveClassName(args[0]);
214
+ }
215
+ break;
216
+ case "describe":
217
+ if (args[0] && Node.isStringLiteral(args[0])) {
218
+ metadata2.description = args[0].getLiteralValue();
219
+ }
220
+ if (args[1] && Node.isCallExpression(args[1])) {
221
+ const nested = extractFromCallExpression(args[1], verbose);
222
+ if (nested) {
223
+ Object.assign(metadata2, nested);
224
+ }
225
+ }
226
+ break;
227
+ case "guarded":
228
+ if (args[0]) {
229
+ const guard = parseObjectLiteral(args[0]);
230
+ if (Object.keys(guard).length > 0) {
231
+ metadata2.guards = [guard];
232
+ }
233
+ }
234
+ if (args[1] && Node.isCallExpression(args[1])) {
235
+ const nested = extractFromCallExpression(args[1], verbose);
236
+ if (nested) {
237
+ Object.assign(metadata2, nested);
238
+ }
239
+ }
240
+ break;
241
+ case "invoke":
242
+ if (args[0]) {
243
+ const service = parseInvokeService(args[0]);
244
+ if (Object.keys(service).length > 0) {
245
+ metadata2.invoke = service;
246
+ }
247
+ }
248
+ break;
249
+ case "action":
250
+ if (args[0]) {
251
+ const actionMeta = parseObjectLiteral(args[0]);
252
+ if (Object.keys(actionMeta).length > 0) {
253
+ metadata2.actions = [actionMeta];
254
+ }
255
+ }
256
+ if (args[1] && Node.isCallExpression(args[1])) {
257
+ const nested = extractFromCallExpression(args[1], verbose);
258
+ if (nested) {
259
+ Object.assign(metadata2, nested);
260
+ }
261
+ }
262
+ break;
263
+ default:
264
+ return null;
265
+ }
266
+ return Object.keys(metadata2).length > 0 ? metadata2 : null;
267
+ }
268
+ function extractMetaFromMember(member, verbose = false) {
269
+ if (!Node.isPropertyDeclaration(member)) {
270
+ if (verbose) console.error(` ⚠️ Not a property declaration`);
271
+ return null;
272
+ }
273
+ const initializer = member.getInitializer();
274
+ if (!initializer) {
275
+ if (verbose) console.error(` ⚠️ No initializer`);
276
+ return null;
277
+ }
278
+ if (!Node.isCallExpression(initializer)) {
279
+ if (verbose) console.error(` ⚠️ Initializer is not a call expression`);
280
+ return null;
281
+ }
282
+ const metadata2 = extractFromCallExpression(initializer, verbose);
283
+ if (metadata2 && verbose) {
284
+ console.error(` ✅ Extracted metadata:`, JSON.stringify(metadata2, null, 2));
285
+ }
286
+ return metadata2;
287
+ }
288
+ function analyzeStateNode(classSymbol, verbose = false) {
289
+ const chartNode = { on: {} };
290
+ const classDeclaration = classSymbol.getDeclarations()[0];
291
+ if (!classDeclaration || !Node.isClassDeclaration(classDeclaration)) {
292
+ if (verbose) {
293
+ console.error(`⚠️ Warning: Could not get class declaration for ${classSymbol.getName()}`);
294
+ }
295
+ return chartNode;
296
+ }
297
+ const className = classSymbol.getName();
298
+ if (verbose) {
299
+ console.error(` Analyzing state: ${className}`);
300
+ }
301
+ for (const member of classDeclaration.getInstanceMembers()) {
302
+ const memberName = member.getName();
303
+ if (verbose) {
304
+ console.error(` Checking member: ${memberName}`);
305
+ }
306
+ const meta = extractMetaFromMember(member, verbose);
307
+ if (!meta) continue;
308
+ if (verbose) {
309
+ console.error(` Found transition: ${memberName}`);
310
+ }
311
+ const { invoke: invoke2, actions, guards, ...onEntry } = meta;
312
+ if (invoke2) {
313
+ if (!chartNode.invoke) chartNode.invoke = [];
314
+ chartNode.invoke.push({
315
+ src: invoke2.src,
316
+ onDone: { target: invoke2.onDone },
317
+ onError: { target: invoke2.onError },
318
+ description: invoke2.description
319
+ });
320
+ if (verbose) {
321
+ console.error(` → Invoke: ${invoke2.src}`);
322
+ }
323
+ }
324
+ if (onEntry.target) {
325
+ const transition = { target: onEntry.target };
326
+ if (onEntry.description) {
327
+ transition.description = onEntry.description;
328
+ }
329
+ if (guards) {
330
+ transition.cond = guards.map((g) => g.name).join(" && ");
331
+ if (verbose) {
332
+ console.error(` → Guard: ${transition.cond}`);
333
+ }
334
+ }
335
+ if (actions && actions.length > 0) {
336
+ transition.actions = actions.map((a) => a.name);
337
+ if (verbose) {
338
+ console.error(` → Actions: ${transition.actions.join(", ")}`);
339
+ }
340
+ }
341
+ chartNode.on[memberName] = transition;
342
+ if (verbose) {
343
+ console.error(` → Target: ${onEntry.target}`);
344
+ }
345
+ }
346
+ }
347
+ return chartNode;
348
+ }
349
+ function extractMachine(config, project, verbose = false) {
350
+ if (verbose) {
351
+ console.error(`
352
+ 🔍 Analyzing machine: ${config.id}`);
353
+ console.error(` Source: ${config.input}`);
354
+ }
355
+ const sourceFile = project.getSourceFile(config.input);
356
+ if (!sourceFile) {
357
+ throw new Error(`Source file not found: ${config.input}`);
358
+ }
359
+ const fullChart = {
360
+ id: config.id,
361
+ initial: config.initialState,
362
+ states: {}
363
+ };
364
+ if (config.description) {
365
+ fullChart.description = config.description;
366
+ }
367
+ for (const className of config.classes) {
368
+ const classDeclaration = sourceFile.getClass(className);
369
+ if (!classDeclaration) {
370
+ console.warn(`⚠️ Warning: Class '${className}' not found in '${config.input}'. Skipping.`);
371
+ continue;
372
+ }
373
+ const classSymbol = classDeclaration.getSymbolOrThrow();
374
+ const stateNode = analyzeStateNode(classSymbol, verbose);
375
+ fullChart.states[className] = stateNode;
376
+ }
377
+ if (verbose) {
378
+ console.error(` ✅ Extracted ${config.classes.length} states`);
379
+ }
380
+ return fullChart;
381
+ }
382
+ function extractMachines(config) {
383
+ var _a;
384
+ const verbose = (_a = config.verbose) != null ? _a : false;
385
+ if (verbose) {
386
+ console.error(`
387
+ 📊 Starting statechart extraction`);
388
+ console.error(` Machines to extract: ${config.machines.length}`);
389
+ }
390
+ const project = new Project();
391
+ project.addSourceFilesAtPaths("src/**/*.ts");
392
+ project.addSourceFilesAtPaths("examples/**/*.ts");
393
+ const results = [];
394
+ for (const machineConfig of config.machines) {
395
+ try {
396
+ const chart = extractMachine(machineConfig, project, verbose);
397
+ results.push(chart);
398
+ } catch (error) {
399
+ console.error(`❌ Error extracting machine '${machineConfig.id}':`, error);
400
+ if (!verbose) {
401
+ console.error(` Run with --verbose for more details`);
402
+ }
403
+ }
404
+ }
405
+ if (verbose) {
406
+ console.error(`
407
+ ✅ Extraction complete: ${results.length}/${config.machines.length} machines extracted`);
408
+ }
409
+ return results;
410
+ }
411
+ function generateChart() {
412
+ const config = {
413
+ input: "examples/authMachine.ts",
414
+ classes: [
415
+ "LoggedOutMachine",
416
+ "LoggingInMachine",
417
+ "LoggedInMachine",
418
+ "SessionExpiredMachine",
419
+ "ErrorMachine"
420
+ ],
421
+ id: "auth",
422
+ initialState: "LoggedOutMachine",
423
+ description: "Authentication state machine"
424
+ };
425
+ console.error("🔍 Using legacy generateChart function");
426
+ console.error("⚠️ Consider using extractMachines() with a config file instead\n");
427
+ const project = new Project();
428
+ project.addSourceFilesAtPaths("src/**/*.ts");
429
+ project.addSourceFilesAtPaths("examples/**/*.ts");
430
+ try {
431
+ const chart = extractMachine(config, project, true);
432
+ console.log(JSON.stringify(chart, null, 2));
433
+ } catch (error) {
434
+ console.error(`❌ Error:`, error);
435
+ process.exit(1);
436
+ }
437
+ }
438
+ if (__require.main === module) {
439
+ generateChart();
440
+ }
441
+
442
+ // src/runtime-extract.ts
443
+ function extractFunctionMetadata(fn) {
444
+ if (typeof fn !== "function") {
445
+ return null;
446
+ }
447
+ const meta = fn[RUNTIME_META];
448
+ return meta || null;
449
+ }
450
+ function extractStateNode(stateInstance) {
451
+ const stateNode = { on: {} };
452
+ const invoke2 = [];
453
+ for (const key in stateInstance) {
454
+ const value = stateInstance[key];
455
+ if (typeof value !== "function") {
456
+ continue;
457
+ }
458
+ const meta = extractFunctionMetadata(value);
459
+ if (!meta) {
460
+ continue;
461
+ }
462
+ if (meta.invoke) {
463
+ invoke2.push({
464
+ src: meta.invoke.src,
465
+ onDone: { target: meta.invoke.onDone },
466
+ onError: { target: meta.invoke.onError },
467
+ description: meta.invoke.description
468
+ });
469
+ }
470
+ if (meta.target) {
471
+ const transition = { target: meta.target };
472
+ if (meta.description) {
473
+ transition.description = meta.description;
474
+ }
475
+ if (meta.guards && meta.guards.length > 0) {
476
+ transition.cond = meta.guards.map((g) => g.name).join(" && ");
477
+ }
478
+ if (meta.actions && meta.actions.length > 0) {
479
+ transition.actions = meta.actions.map((a) => a.name);
480
+ }
481
+ stateNode.on[key] = transition;
482
+ }
483
+ }
484
+ if (invoke2.length > 0) {
485
+ stateNode.invoke = invoke2;
486
+ }
487
+ return stateNode;
488
+ }
489
+ function generateStatechart(states, config) {
490
+ const chart = {
491
+ id: config.id,
492
+ initial: config.initial,
493
+ states: {}
494
+ };
495
+ if (config.description) {
496
+ chart.description = config.description;
497
+ }
498
+ for (const [stateName, stateInstance] of Object.entries(states)) {
499
+ chart.states[stateName] = extractStateNode(stateInstance);
500
+ }
501
+ return chart;
502
+ }
503
+ function extractFromInstance(machineInstance, config) {
504
+ const stateName = config.stateName || machineInstance.constructor.name || "State";
505
+ return {
506
+ id: config.id,
507
+ initial: stateName,
508
+ states: {
509
+ [stateName]: extractStateNode(machineInstance)
510
+ }
511
+ };
512
+ }
513
+
514
+ // src/multi.ts
515
+ function createRunner(initialMachine, onChange) {
516
+ let currentMachine = initialMachine;
517
+ const setState = (newState) => {
518
+ currentMachine = newState;
519
+ onChange == null ? void 0 : onChange(newState);
520
+ };
521
+ const { context: _initialContext, ...originalTransitions } = initialMachine;
522
+ const actions = new Proxy({}, {
523
+ get(_target, prop) {
524
+ const transition = currentMachine[prop];
525
+ if (typeof transition !== "function") {
526
+ return void 0;
527
+ }
528
+ return (...args) => {
529
+ const nextState = transition.apply(currentMachine.context, args);
530
+ const nextStateWithTransitions = Object.assign(
531
+ { context: nextState.context },
532
+ originalTransitions
533
+ );
534
+ setState(nextStateWithTransitions);
535
+ return nextStateWithTransitions;
536
+ };
537
+ }
538
+ });
539
+ return {
540
+ get state() {
541
+ return currentMachine;
542
+ },
543
+ get context() {
544
+ return currentMachine.context;
545
+ },
546
+ actions,
547
+ setState
548
+ };
549
+ }
550
+ function createEnsemble(store, factories, getDiscriminant) {
551
+ const getCurrentMachine = () => {
552
+ const context = store.getContext();
553
+ const currentStateName = getDiscriminant(context);
554
+ const factory = factories[currentStateName];
555
+ if (!factory) {
556
+ throw new Error(
557
+ `[Ensemble] Invalid state: No factory found for state "${String(currentStateName)}".`
558
+ );
559
+ }
560
+ return factory(context);
561
+ };
562
+ const actions = new Proxy({}, {
563
+ get(_target, prop) {
564
+ const currentMachine = getCurrentMachine();
565
+ const action2 = currentMachine[prop];
566
+ if (typeof action2 !== "function") {
567
+ throw new Error(
568
+ `[Ensemble] Transition "${prop}" is not valid in the current state.`
569
+ );
570
+ }
571
+ return (...args) => {
572
+ return action2.apply(currentMachine.context, args);
573
+ };
574
+ }
575
+ });
576
+ return {
577
+ get context() {
578
+ return store.getContext();
579
+ },
580
+ get state() {
581
+ return getCurrentMachine();
582
+ },
583
+ actions
584
+ };
585
+ }
586
+ function runWithRunner(flow, initialMachine) {
587
+ const runner = createRunner(initialMachine);
588
+ const generator = flow(runner);
589
+ let result = generator.next();
590
+ while (!result.done) {
591
+ result = generator.next();
592
+ }
593
+ return result.value;
594
+ }
595
+ function runWithEnsemble(flow, ensemble) {
596
+ const generator = flow(ensemble);
597
+ let result = generator.next();
598
+ while (!result.done) {
599
+ result = generator.next();
600
+ }
601
+ return result.value;
602
+ }
603
+ var MultiMachineBase = class {
604
+ /**
605
+ * @param store - The StateStore that will manage this machine's context.
606
+ */
607
+ constructor(store) {
608
+ this.store = store;
609
+ }
610
+ /**
611
+ * Read-only access to the current context from the external store.
612
+ * This getter always returns the latest context from the store.
613
+ *
614
+ * @protected
615
+ *
616
+ * @example
617
+ * const currentStatus = this.context.status;
618
+ * const currentData = this.context.data;
619
+ */
620
+ get context() {
621
+ return this.store.getContext();
622
+ }
623
+ /**
624
+ * Update the shared context in the external store.
625
+ * Call this method in your transition methods to update the state.
626
+ *
627
+ * @protected
628
+ * @param newContext - The new context object. Should typically be a shallow
629
+ * copy with only the properties you're changing, merged with the current
630
+ * context using spread operators.
631
+ *
632
+ * @example
633
+ * // In a transition method:
634
+ * this.setContext({ ...this.context, status: 'loading' });
635
+ *
636
+ * @example
637
+ * // Updating nested properties:
638
+ * this.setContext({
639
+ * ...this.context,
640
+ * user: { ...this.context.user, name: 'Alice' }
641
+ * });
642
+ */
643
+ setContext(newContext) {
644
+ this.store.setContext(newContext);
645
+ }
646
+ };
647
+ function createMultiMachine(MachineClass, store) {
648
+ const instance = new MachineClass(store);
649
+ return new Proxy({}, {
650
+ get(_target, prop) {
651
+ const context = store.getContext();
652
+ if (prop in context) {
653
+ return context[prop];
654
+ }
655
+ const method = instance[prop];
656
+ if (typeof method === "function") {
657
+ return (...args) => {
658
+ return method.apply(instance, args);
659
+ };
660
+ }
661
+ return void 0;
662
+ },
663
+ set(_target, prop, value) {
664
+ const context = store.getContext();
665
+ if (prop in context) {
666
+ const newContext = { ...context, [prop]: value };
667
+ store.setContext(newContext);
668
+ return true;
669
+ }
670
+ return false;
671
+ },
672
+ has(_target, prop) {
673
+ const context = store.getContext();
674
+ return prop in context || typeof instance[prop] === "function";
675
+ },
676
+ ownKeys(_target) {
677
+ const context = store.getContext();
678
+ const contextKeys = Object.keys(context);
679
+ const methodKeys = Object.getOwnPropertyNames(
680
+ Object.getPrototypeOf(instance)
681
+ ).filter((key) => key !== "constructor" && typeof instance[key] === "function");
682
+ return Array.from(/* @__PURE__ */ new Set([...contextKeys, ...methodKeys]));
683
+ },
684
+ getOwnPropertyDescriptor(_target, prop) {
685
+ const context = store.getContext();
686
+ if (prop in context || typeof instance[prop] === "function") {
687
+ return {
688
+ value: void 0,
689
+ writable: true,
690
+ enumerable: true,
691
+ configurable: true
692
+ };
693
+ }
694
+ return void 0;
695
+ }
696
+ });
697
+ }
698
+ function createMutableMachine(sharedContext, factories, getDiscriminant) {
699
+ const getCurrentMachine = () => {
700
+ const currentStateName = getDiscriminant(sharedContext);
701
+ const factory = factories[currentStateName];
702
+ if (!factory) {
703
+ throw new Error(
704
+ `[MutableMachine] Invalid state: No factory for state "${String(currentStateName)}".`
705
+ );
706
+ }
707
+ return factory(sharedContext);
708
+ };
709
+ return new Proxy(sharedContext, {
710
+ get(target, prop, _receiver) {
711
+ if (prop in target) {
712
+ return target[prop];
713
+ }
714
+ const currentMachine = getCurrentMachine();
715
+ const transition = currentMachine[prop];
716
+ if (typeof transition === "function") {
717
+ return (...args) => {
718
+ const nextContext = transition.apply(currentMachine.context, args);
719
+ if (typeof nextContext !== "object" || nextContext === null) {
720
+ console.warn(`[MutableMachine] Transition "${String(prop)}" did not return a valid context object. State may be inconsistent.`);
721
+ return;
722
+ }
723
+ Object.keys(target).forEach((key) => delete target[key]);
724
+ Object.assign(target, nextContext);
725
+ };
726
+ }
727
+ return void 0;
728
+ },
729
+ set(target, prop, value, _receiver) {
730
+ target[prop] = value;
731
+ return true;
732
+ },
733
+ has(target, prop) {
734
+ const currentMachine = getCurrentMachine();
735
+ return prop in target || typeof currentMachine[prop] === "function";
736
+ }
737
+ });
738
+ }
739
+
64
740
  // src/index.ts
65
741
  function createMachine(context, fns) {
66
742
  return Object.assign({ context }, fns);
@@ -151,15 +827,34 @@ function next(m, update) {
151
827
  return createMachine(update(context), transitions);
152
828
  }
153
829
  export {
830
+ META_KEY,
154
831
  MachineBase,
832
+ MultiMachineBase,
833
+ RUNTIME_META,
834
+ action,
155
835
  createAsyncMachine,
836
+ createEnsemble,
156
837
  createFlow,
157
838
  createMachine,
158
839
  createMachineBuilder,
159
840
  createMachineFactory,
841
+ createMultiMachine,
842
+ createMutableMachine,
843
+ createRunner,
844
+ describe,
160
845
  extendTransitions,
846
+ extractFromInstance,
847
+ extractFunctionMetadata,
848
+ extractMachine,
849
+ extractMachines,
850
+ extractStateNode,
851
+ generateChart,
852
+ generateStatechart,
853
+ guarded,
161
854
  hasState,
855
+ invoke,
162
856
  matchMachine,
857
+ metadata,
163
858
  next,
164
859
  overrideTransitions,
165
860
  run,
@@ -167,9 +862,12 @@ export {
167
862
  runMachine,
168
863
  runSequence,
169
864
  runWithDebug,
865
+ runWithEnsemble,
866
+ runWithRunner,
170
867
  setContext,
171
868
  step,
172
869
  stepAsync,
870
+ transitionTo,
173
871
  yieldMachine
174
872
  };
175
873
  //# sourceMappingURL=index.js.map