xstate 6.0.0-alpha.62 → 6.0.0-alpha.63

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.
Files changed (42) hide show
  1. package/README.md +7 -0
  2. package/dist/{createActor-55f62c08.development.esm.js → createActor-48f753a9.development.esm.js} +38 -1
  3. package/dist/{createActor-f9b188f2.esm.js → createActor-523a98c7.esm.js} +38 -1
  4. package/dist/{createActor-8dfa9b5c.cjs.js → createActor-eba8226e.cjs.js} +39 -0
  5. package/dist/{createActor-6d6bfee1.development.cjs.js → createActor-f71670cf.development.cjs.js} +39 -0
  6. package/dist/declarations/src/StateMachine.d.ts +1 -1
  7. package/dist/declarations/src/durable/index.d.ts +12 -1
  8. package/dist/{effectDescriptor-a3ff2473.development.cjs.js → effectDescriptor-8c87a3e7.development.cjs.js} +1 -1
  9. package/dist/{effectDescriptor-35129133.esm.js → effectDescriptor-ad75e430.esm.js} +1 -1
  10. package/dist/{effectDescriptor-0a7315fa.cjs.js → effectDescriptor-bc9e3e81.cjs.js} +1 -1
  11. package/dist/{effectDescriptor-5048c471.development.esm.js → effectDescriptor-eadf1b25.development.esm.js} +1 -1
  12. package/dist/{index-e5f3a62b.esm.js → index-211a5dce.esm.js} +1 -1
  13. package/dist/{index-eda79ddc.development.esm.js → index-2a4be1f2.development.esm.js} +1 -1
  14. package/dist/{index-05e9e83b.development.cjs.js → index-3cb56f46.development.cjs.js} +1 -1
  15. package/dist/{index-ad40a951.cjs.js → index-83f11f07.cjs.js} +1 -1
  16. package/dist/xstate-actors.cjs.js +2 -2
  17. package/dist/xstate-actors.development.cjs.js +2 -2
  18. package/dist/xstate-actors.development.esm.js +2 -2
  19. package/dist/xstate-actors.esm.js +2 -2
  20. package/dist/xstate-actors.umd.min.js.map +1 -1
  21. package/dist/xstate-durable.cjs.js +93 -31
  22. package/dist/xstate-durable.development.cjs.js +93 -31
  23. package/dist/xstate-durable.development.esm.js +93 -31
  24. package/dist/xstate-durable.esm.js +93 -31
  25. package/dist/xstate-durable.umd.min.js +1 -1
  26. package/dist/xstate-durable.umd.min.js.map +1 -1
  27. package/dist/xstate-graph.cjs.js +2 -2
  28. package/dist/xstate-graph.development.cjs.js +2 -2
  29. package/dist/xstate-graph.development.esm.js +2 -2
  30. package/dist/xstate-graph.esm.js +2 -2
  31. package/dist/xstate-graph.umd.min.js.map +1 -1
  32. package/dist/xstate-validation.cjs.js +1 -1
  33. package/dist/xstate-validation.development.cjs.js +1 -1
  34. package/dist/xstate-validation.development.esm.js +1 -1
  35. package/dist/xstate-validation.esm.js +1 -1
  36. package/dist/xstate.cjs.js +9 -5
  37. package/dist/xstate.development.cjs.js +9 -5
  38. package/dist/xstate.development.esm.js +11 -7
  39. package/dist/xstate.esm.js +11 -7
  40. package/dist/xstate.umd.min.js +1 -1
  41. package/dist/xstate.umd.min.js.map +1 -1
  42. package/package.json +1 -1
package/README.md CHANGED
@@ -17,6 +17,13 @@ XState is a state management and orchestration solution for JavaScript and TypeS
17
17
 
18
18
  It uses event-driven programming, state machines, statecharts, and the actor model to handle complex logic in predictable, robust, and visual ways. XState provides a powerful and flexible way to manage application and workflow state by allowing developers to model logic as actors and state machines.
19
19
 
20
+ <!-- durable execution and checkpoint restoration from packages/core/src/durable/index.ts -->
21
+
22
+ For durable hosts, the experimental `xstate/durable` entry point provides
23
+ `createDurable`. Resume a checkpoint with `execution.restore(persistedSnapshot)`
24
+ and execute the returned effects to restart active embedded children and pending
25
+ timers without replaying entry actions. See [durable execution](../../docs/durable-execution.md).
26
+
20
27
  For flat finite state machines, `xstate/fsm` provides a tiny pure transition
21
28
  table with context and TypeScript support:
22
29
 
@@ -1129,6 +1129,8 @@ function getBuiltInActionFields(action, args) {
1129
1129
  return undefined;
1130
1130
  }
1131
1131
  }
1132
+
1133
+ /** @internal Creates an actor-start effect, including for restored children. */
1132
1134
  function createStartEffect(actor) {
1133
1135
  const args = [actor];
1134
1136
  return {
@@ -1142,6 +1144,41 @@ function createStartEffect(actor) {
1142
1144
  id: actor.id
1143
1145
  };
1144
1146
  }
1147
+
1148
+ /** @internal Recreates a pending logical timer without re-entering its state. */
1149
+ function createTimerEffect(actorScope, timer, delay) {
1150
+ const source = actorScope.self;
1151
+ const options = {
1152
+ id: timer.id,
1153
+ delay
1154
+ };
1155
+ if (timer.type === '@xstate.raise') {
1156
+ return {
1157
+ kind: 'builtin',
1158
+ type: timer.type,
1159
+ source,
1160
+ event: timer.event,
1161
+ id: timer.id,
1162
+ delay,
1163
+ params: undefined,
1164
+ args: [actorScope, timer.event, options],
1165
+ exec: execRaiseEffect
1166
+ };
1167
+ }
1168
+ const target = timer.target === 'self' ? source : timer.target;
1169
+ return {
1170
+ kind: 'builtin',
1171
+ type: timer.type,
1172
+ source,
1173
+ target,
1174
+ event: timer.event,
1175
+ id: timer.id,
1176
+ delay,
1177
+ params: undefined,
1178
+ args: [actorScope, target, timer.event, options],
1179
+ exec: execSendToEffect
1180
+ };
1181
+ }
1145
1182
  function createSpawnEffect(actor) {
1146
1183
  const args = [actor];
1147
1184
  return {
@@ -6334,4 +6371,4 @@ function createActor(logic, ...[options]) {
6334
6371
  return new Actor(logic, options);
6335
6372
  }
6336
6373
 
6337
- export { ACTOR_REF_TYPE as $, attachSnapshotActorRef as A, macrostep as B, isInertActorScope as C, setSnapshotActorRef as D, cloneMachineSnapshot as E, transitionNode as F, getTransitionResult as G, hasEffect as H, createErrorPlatformEvent as I, withActorSelf as J, resolveActionsWithContext as K, takeSpawnAllocationCounters as L, mergeActorIdCounters as M, NULL_EVENT as N, createInitEvent as O, createSpawnEffect as P, initialMicrostep as Q, toStatePath as R, STATE_DELIMITER as S, isStateId as T, getStateNodeByPath as U, getPersistedSnapshot as V, createRemoteActorRef as W, XSTATE_TIMER as X, resolveReferencedActor as Y, createInvokeTimeoutEvent as Z, parseGeneratedActorId as _, allocateChildId as a, createActor as a0, parseDelayToMilliseconds as a1, isAtomicStateNode as a2, ProcessingStatus as a3, isActorRefLike as a4, createListenerLogic as a5, createSubscriptionLogic as a6, listenerLogic as a7, subscriptionLogic as a8, Actor as a9, getAllOwnEvents as aA, matchesEvent as aB, encodeAddressSegment as aC, getRootActorId as aD, RUNTIME_OPERATIONS as aE, withSystemInspector as aF, getSnapshotActorRef as aG, withExecutionIdentity as aH, isMachineSnapshot as aa, InfiniteTransitionError as ab, getAllOwnEventDescriptors as ac, matchesState as ad, checkStateIn as ae, pathToStateValue as af, toObserver as ag, executeEffects as ah, isBuiltInExecutableAction as ai, deliverEvent as aj, runStep as ak, stopActor as al, terminateActor as am, XSTATE_STOP as an, createCustomEffect as ao, XSTATE_LOGIC_EFFECT_START as ap, XSTATE_LOGIC_EFFECT_RESOLVE as aq, XSTATE_LOGIC_EFFECT_REJECT as ar, finalizeTransitionResult as as, createEmitEffect as at, createSendToEffect as au, XSTATE_INIT as av, hasAmbientInspector as aw, getProperAncestors as ax, isRemoteActorRef as ay, getActorIdPrefix as az, assertChildIdFree as b, reserveChildId as c, mapValues as d, createInvokeId as e, getEventDescriptorKey as f, getDelayedTransitions as g, getCandidates as h, evaluateCandidate as i, formatTransition as j, toTransitionConfigArray as k, createInvokeTimeoutEventId as l, matchesEventDescriptor as m, matchesActorSession as n, formatRouteTransitions as o, resolveStateValue as p, getAllStateNodes as q, resolveRegisteredActorSource as r, getStateNodes as s, toArray as t, createMachineSnapshot as u, isInFinalState as v, createInertActorScope as w, setInertActorScopeSnapshot as x, createDeadLetterEffect as y, beginSpawnAllocation as z };
6374
+ export { parseGeneratedActorId as $, attachSnapshotActorRef as A, macrostep as B, isInertActorScope as C, setSnapshotActorRef as D, cloneMachineSnapshot as E, transitionNode as F, getTransitionResult as G, hasEffect as H, createErrorPlatformEvent as I, withActorSelf as J, resolveActionsWithContext as K, takeSpawnAllocationCounters as L, mergeActorIdCounters as M, NULL_EVENT as N, createInitEvent as O, createSpawnEffect as P, initialMicrostep as Q, createStartEffect as R, STATE_DELIMITER as S, toStatePath as T, isStateId as U, getStateNodeByPath as V, getPersistedSnapshot as W, XSTATE_TIMER as X, createRemoteActorRef as Y, resolveReferencedActor as Z, createInvokeTimeoutEvent as _, allocateChildId as a, ACTOR_REF_TYPE as a0, createActor as a1, parseDelayToMilliseconds as a2, isAtomicStateNode as a3, ProcessingStatus as a4, isActorRefLike as a5, createListenerLogic as a6, createSubscriptionLogic as a7, listenerLogic as a8, subscriptionLogic as a9, getActorIdPrefix as aA, getAllOwnEvents as aB, matchesEvent as aC, encodeAddressSegment as aD, getRootActorId as aE, RUNTIME_OPERATIONS as aF, withSystemInspector as aG, createTimerEffect as aH, getSnapshotActorRef as aI, withExecutionIdentity as aJ, Actor as aa, isMachineSnapshot as ab, InfiniteTransitionError as ac, getAllOwnEventDescriptors as ad, matchesState as ae, checkStateIn as af, pathToStateValue as ag, toObserver as ah, executeEffects as ai, isBuiltInExecutableAction as aj, deliverEvent as ak, runStep as al, stopActor as am, terminateActor as an, XSTATE_STOP as ao, createCustomEffect as ap, XSTATE_LOGIC_EFFECT_START as aq, XSTATE_LOGIC_EFFECT_RESOLVE as ar, XSTATE_LOGIC_EFFECT_REJECT as as, finalizeTransitionResult as at, createEmitEffect as au, createSendToEffect as av, XSTATE_INIT as aw, hasAmbientInspector as ax, getProperAncestors as ay, isRemoteActorRef as az, assertChildIdFree as b, reserveChildId as c, mapValues as d, createInvokeId as e, getEventDescriptorKey as f, getDelayedTransitions as g, getCandidates as h, evaluateCandidate as i, formatTransition as j, toTransitionConfigArray as k, createInvokeTimeoutEventId as l, matchesEventDescriptor as m, matchesActorSession as n, formatRouteTransitions as o, resolveStateValue as p, getAllStateNodes as q, resolveRegisteredActorSource as r, getStateNodes as s, toArray as t, createMachineSnapshot as u, isInFinalState as v, createInertActorScope as w, setInertActorScopeSnapshot as x, createDeadLetterEffect as y, beginSpawnAllocation as z };
@@ -1119,6 +1119,8 @@ function getBuiltInActionFields(action, args) {
1119
1119
  return undefined;
1120
1120
  }
1121
1121
  }
1122
+
1123
+ /** @internal Creates an actor-start effect, including for restored children. */
1122
1124
  function createStartEffect(actor) {
1123
1125
  const args = [actor];
1124
1126
  return {
@@ -1132,6 +1134,41 @@ function createStartEffect(actor) {
1132
1134
  id: actor.id
1133
1135
  };
1134
1136
  }
1137
+
1138
+ /** @internal Recreates a pending logical timer without re-entering its state. */
1139
+ function createTimerEffect(actorScope, timer, delay) {
1140
+ const source = actorScope.self;
1141
+ const options = {
1142
+ id: timer.id,
1143
+ delay
1144
+ };
1145
+ if (timer.type === '@xstate.raise') {
1146
+ return {
1147
+ kind: 'builtin',
1148
+ type: timer.type,
1149
+ source,
1150
+ event: timer.event,
1151
+ id: timer.id,
1152
+ delay,
1153
+ params: undefined,
1154
+ args: [actorScope, timer.event, options],
1155
+ exec: execRaiseEffect
1156
+ };
1157
+ }
1158
+ const target = timer.target === 'self' ? source : timer.target;
1159
+ return {
1160
+ kind: 'builtin',
1161
+ type: timer.type,
1162
+ source,
1163
+ target,
1164
+ event: timer.event,
1165
+ id: timer.id,
1166
+ delay,
1167
+ params: undefined,
1168
+ args: [actorScope, target, timer.event, options],
1169
+ exec: execSendToEffect
1170
+ };
1171
+ }
1135
1172
  function createSpawnEffect(actor) {
1136
1173
  const args = [actor];
1137
1174
  return {
@@ -6191,4 +6228,4 @@ function createActor(logic, ...[options]) {
6191
6228
  return new Actor(logic, options);
6192
6229
  }
6193
6230
 
6194
- export { ACTOR_REF_TYPE as $, attachSnapshotActorRef as A, macrostep as B, isInertActorScope as C, setSnapshotActorRef as D, cloneMachineSnapshot as E, transitionNode as F, getTransitionResult as G, hasEffect as H, createErrorPlatformEvent as I, withActorSelf as J, resolveActionsWithContext as K, takeSpawnAllocationCounters as L, mergeActorIdCounters as M, NULL_EVENT as N, createInitEvent as O, createSpawnEffect as P, initialMicrostep as Q, toStatePath as R, STATE_DELIMITER as S, isStateId as T, getStateNodeByPath as U, getPersistedSnapshot as V, createRemoteActorRef as W, XSTATE_TIMER as X, resolveReferencedActor as Y, createInvokeTimeoutEvent as Z, parseGeneratedActorId as _, allocateChildId as a, createActor as a0, parseDelayToMilliseconds as a1, isAtomicStateNode as a2, ProcessingStatus as a3, isActorRefLike as a4, createListenerLogic as a5, createSubscriptionLogic as a6, listenerLogic as a7, subscriptionLogic as a8, Actor as a9, getAllOwnEvents as aA, matchesEvent as aB, encodeAddressSegment as aC, getRootActorId as aD, RUNTIME_OPERATIONS as aE, withSystemInspector as aF, getSnapshotActorRef as aG, withExecutionIdentity as aH, isMachineSnapshot as aa, InfiniteTransitionError as ab, getAllOwnEventDescriptors as ac, matchesState as ad, checkStateIn as ae, pathToStateValue as af, toObserver as ag, executeEffects as ah, isBuiltInExecutableAction as ai, deliverEvent as aj, runStep as ak, stopActor as al, terminateActor as am, XSTATE_STOP as an, createCustomEffect as ao, XSTATE_LOGIC_EFFECT_START as ap, XSTATE_LOGIC_EFFECT_RESOLVE as aq, XSTATE_LOGIC_EFFECT_REJECT as ar, finalizeTransitionResult as as, createEmitEffect as at, createSendToEffect as au, XSTATE_INIT as av, hasAmbientInspector as aw, getProperAncestors as ax, isRemoteActorRef as ay, getActorIdPrefix as az, assertChildIdFree as b, reserveChildId as c, mapValues as d, createInvokeId as e, getEventDescriptorKey as f, getDelayedTransitions as g, getCandidates as h, evaluateCandidate as i, formatTransition as j, toTransitionConfigArray as k, createInvokeTimeoutEventId as l, matchesEventDescriptor as m, matchesActorSession as n, formatRouteTransitions as o, resolveStateValue as p, getAllStateNodes as q, resolveRegisteredActorSource as r, getStateNodes as s, toArray as t, createMachineSnapshot as u, isInFinalState as v, createInertActorScope as w, setInertActorScopeSnapshot as x, createDeadLetterEffect as y, beginSpawnAllocation as z };
6231
+ export { parseGeneratedActorId as $, attachSnapshotActorRef as A, macrostep as B, isInertActorScope as C, setSnapshotActorRef as D, cloneMachineSnapshot as E, transitionNode as F, getTransitionResult as G, hasEffect as H, createErrorPlatformEvent as I, withActorSelf as J, resolveActionsWithContext as K, takeSpawnAllocationCounters as L, mergeActorIdCounters as M, NULL_EVENT as N, createInitEvent as O, createSpawnEffect as P, initialMicrostep as Q, createStartEffect as R, STATE_DELIMITER as S, toStatePath as T, isStateId as U, getStateNodeByPath as V, getPersistedSnapshot as W, XSTATE_TIMER as X, createRemoteActorRef as Y, resolveReferencedActor as Z, createInvokeTimeoutEvent as _, allocateChildId as a, ACTOR_REF_TYPE as a0, createActor as a1, parseDelayToMilliseconds as a2, isAtomicStateNode as a3, ProcessingStatus as a4, isActorRefLike as a5, createListenerLogic as a6, createSubscriptionLogic as a7, listenerLogic as a8, subscriptionLogic as a9, getActorIdPrefix as aA, getAllOwnEvents as aB, matchesEvent as aC, encodeAddressSegment as aD, getRootActorId as aE, RUNTIME_OPERATIONS as aF, withSystemInspector as aG, createTimerEffect as aH, getSnapshotActorRef as aI, withExecutionIdentity as aJ, Actor as aa, isMachineSnapshot as ab, InfiniteTransitionError as ac, getAllOwnEventDescriptors as ad, matchesState as ae, checkStateIn as af, pathToStateValue as ag, toObserver as ah, executeEffects as ai, isBuiltInExecutableAction as aj, deliverEvent as ak, runStep as al, stopActor as am, terminateActor as an, XSTATE_STOP as ao, createCustomEffect as ap, XSTATE_LOGIC_EFFECT_START as aq, XSTATE_LOGIC_EFFECT_RESOLVE as ar, XSTATE_LOGIC_EFFECT_REJECT as as, finalizeTransitionResult as at, createEmitEffect as au, createSendToEffect as av, XSTATE_INIT as aw, hasAmbientInspector as ax, getProperAncestors as ay, isRemoteActorRef as az, assertChildIdFree as b, reserveChildId as c, mapValues as d, createInvokeId as e, getEventDescriptorKey as f, getDelayedTransitions as g, getCandidates as h, evaluateCandidate as i, formatTransition as j, toTransitionConfigArray as k, createInvokeTimeoutEventId as l, matchesEventDescriptor as m, matchesActorSession as n, formatRouteTransitions as o, resolveStateValue as p, getAllStateNodes as q, resolveRegisteredActorSource as r, getStateNodes as s, toArray as t, createMachineSnapshot as u, isInFinalState as v, createInertActorScope as w, setInertActorScopeSnapshot as x, createDeadLetterEffect as y, beginSpawnAllocation as z };
@@ -1121,6 +1121,8 @@ function getBuiltInActionFields(action, args) {
1121
1121
  return undefined;
1122
1122
  }
1123
1123
  }
1124
+
1125
+ /** @internal Creates an actor-start effect, including for restored children. */
1124
1126
  function createStartEffect(actor) {
1125
1127
  const args = [actor];
1126
1128
  return {
@@ -1134,6 +1136,41 @@ function createStartEffect(actor) {
1134
1136
  id: actor.id
1135
1137
  };
1136
1138
  }
1139
+
1140
+ /** @internal Recreates a pending logical timer without re-entering its state. */
1141
+ function createTimerEffect(actorScope, timer, delay) {
1142
+ const source = actorScope.self;
1143
+ const options = {
1144
+ id: timer.id,
1145
+ delay
1146
+ };
1147
+ if (timer.type === '@xstate.raise') {
1148
+ return {
1149
+ kind: 'builtin',
1150
+ type: timer.type,
1151
+ source,
1152
+ event: timer.event,
1153
+ id: timer.id,
1154
+ delay,
1155
+ params: undefined,
1156
+ args: [actorScope, timer.event, options],
1157
+ exec: execRaiseEffect
1158
+ };
1159
+ }
1160
+ const target = timer.target === 'self' ? source : timer.target;
1161
+ return {
1162
+ kind: 'builtin',
1163
+ type: timer.type,
1164
+ source,
1165
+ target,
1166
+ event: timer.event,
1167
+ id: timer.id,
1168
+ delay,
1169
+ params: undefined,
1170
+ args: [actorScope, target, timer.event, options],
1171
+ exec: execSendToEffect
1172
+ };
1173
+ }
1137
1174
  function createSpawnEffect(actor) {
1138
1175
  const args = [actor];
1139
1176
  return {
@@ -6227,7 +6264,9 @@ exports.createMachineSnapshot = createMachineSnapshot;
6227
6264
  exports.createRemoteActorRef = createRemoteActorRef;
6228
6265
  exports.createSendToEffect = createSendToEffect;
6229
6266
  exports.createSpawnEffect = createSpawnEffect;
6267
+ exports.createStartEffect = createStartEffect;
6230
6268
  exports.createSubscriptionLogic = createSubscriptionLogic;
6269
+ exports.createTimerEffect = createTimerEffect;
6231
6270
  exports.deliverEvent = deliverEvent;
6232
6271
  exports.encodeAddressSegment = encodeAddressSegment;
6233
6272
  exports.evaluateCandidate = evaluateCandidate;
@@ -1131,6 +1131,8 @@ function getBuiltInActionFields(action, args) {
1131
1131
  return undefined;
1132
1132
  }
1133
1133
  }
1134
+
1135
+ /** @internal Creates an actor-start effect, including for restored children. */
1134
1136
  function createStartEffect(actor) {
1135
1137
  const args = [actor];
1136
1138
  return {
@@ -1144,6 +1146,41 @@ function createStartEffect(actor) {
1144
1146
  id: actor.id
1145
1147
  };
1146
1148
  }
1149
+
1150
+ /** @internal Recreates a pending logical timer without re-entering its state. */
1151
+ function createTimerEffect(actorScope, timer, delay) {
1152
+ const source = actorScope.self;
1153
+ const options = {
1154
+ id: timer.id,
1155
+ delay
1156
+ };
1157
+ if (timer.type === '@xstate.raise') {
1158
+ return {
1159
+ kind: 'builtin',
1160
+ type: timer.type,
1161
+ source,
1162
+ event: timer.event,
1163
+ id: timer.id,
1164
+ delay,
1165
+ params: undefined,
1166
+ args: [actorScope, timer.event, options],
1167
+ exec: execRaiseEffect
1168
+ };
1169
+ }
1170
+ const target = timer.target === 'self' ? source : timer.target;
1171
+ return {
1172
+ kind: 'builtin',
1173
+ type: timer.type,
1174
+ source,
1175
+ target,
1176
+ event: timer.event,
1177
+ id: timer.id,
1178
+ delay,
1179
+ params: undefined,
1180
+ args: [actorScope, target, timer.event, options],
1181
+ exec: execSendToEffect
1182
+ };
1183
+ }
1147
1184
  function createSpawnEffect(actor) {
1148
1185
  const args = [actor];
1149
1186
  return {
@@ -6370,7 +6407,9 @@ exports.createMachineSnapshot = createMachineSnapshot;
6370
6407
  exports.createRemoteActorRef = createRemoteActorRef;
6371
6408
  exports.createSendToEffect = createSendToEffect;
6372
6409
  exports.createSpawnEffect = createSpawnEffect;
6410
+ exports.createStartEffect = createStartEffect;
6373
6411
  exports.createSubscriptionLogic = createSubscriptionLogic;
6412
+ exports.createTimerEffect = createTimerEffect;
6374
6413
  exports.deliverEvent = deliverEvent;
6375
6414
  exports.encodeAddressSegment = encodeAddressSegment;
6376
6415
  exports.evaluateCandidate = evaluateCandidate;
@@ -140,7 +140,7 @@ export declare class StateMachine<TContext extends MachineContext, TEvent extend
140
140
  */
141
141
  getInitialSnapshot(actorScope?: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, TEvent, AnyActorSystem, TEmitted>, input?: TInput): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>;
142
142
  initialTransition(input: TInput | undefined, actorScope?: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, TEvent, AnyActorSystem, TEmitted>): ActorLogicTransitionResult<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, ExecutableActionObjectFromLogic<this>>;
143
- start(snapshot?: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>): void;
143
+ start(snapshot?: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, actorScope?: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, TEvent, AnyActorSystem, TEmitted>): void;
144
144
  getStateNodeById(stateId: string): StateNode<TContext, TEvent, TMeta, TTransitionMeta>;
145
145
  getPersistedSnapshot(snapshot: MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, options?: unknown): Snapshot<unknown>;
146
146
  restoreSnapshot(snapshot: Snapshot<unknown>, actorScope?: ActorScope<MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>, TEvent, AnyActorSystem, TEmitted>): MachineSnapshot<TContext, TEvent, TChildren, TStateValue, TTag, TOutput, TMeta, TConfig>;
@@ -134,6 +134,17 @@ export interface DurableExecution<TLogic extends AnyActorLogic> {
134
134
  readonly machineVersion: string | undefined;
135
135
  /** Index assigned to the next transition. Persist this with checkpoints. */
136
136
  readonly nextTransitionIndex: number;
137
+ /**
138
+ * Restores a checkpoint on a fresh execution. Returns effects that start
139
+ * active embedded children and re-arm pending root timers; execute them
140
+ * with `executeEffects` before waiting or processing the next event.
141
+ * Does not send a machine event, replay entry actions, or advance the
142
+ * transition index. Restoration effect IDs use `restore:<index>:<effect>`.
143
+ */
144
+ restore(persistedSnapshot: Snapshot<unknown>): [
145
+ snapshot: DurableSnapshot<TLogic>,
146
+ effects: DurableEffect<ExecutableActionObjectFromLogic<TLogic>>[]
147
+ ];
137
148
  initialTransition(...[input]: undefined extends InputFrom<TLogic> ? [input?: InputFrom<TLogic>] : [input: InputFrom<TLogic>]): [
138
149
  snapshot: DurableSnapshot<TLogic>,
139
150
  effects: DurableEffect<ExecutableActionObjectFromLogic<TLogic>>[]
@@ -146,7 +157,7 @@ export interface DurableExecution<TLogic extends AnyActorLogic> {
146
157
  * Returns the actor reference behind a snapshot produced by this execution,
147
158
  * for addressing and inspection. `undefined` for snapshots this execution
148
159
  * has not seen (for example a freshly deserialized checkpoint that has not
149
- * been passed through `transition()` yet).
160
+ * been passed through `restore()` or `transition()` yet).
150
161
  *
151
162
  * With an `address`, returns the live actor at that logical address in the
152
163
  * snapshot's actor tree instead — the root itself, one of its transitive
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createActor = require('./createActor-6d6bfee1.development.cjs.js');
3
+ var createActor = require('./createActor-f71670cf.development.cjs.js');
4
4
 
5
5
  function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
6
6
  const result = microsteps.map(([snapshot, actions, transitions]) => [snapshot, actions, transitions ?? []]);
@@ -1,4 +1,4 @@
1
- import { w as createInertActorScope, x as setInertActorScopeSnapshot, as as finalizeTransitionResult, A as attachSnapshotActorRef, O as createInitEvent, aw as hasAmbientInspector, z as beginSpawnAllocation, B as macrostep, P as createSpawnEffect, Q as initialMicrostep, a2 as isAtomicStateNode, ax as getProperAncestors, ay as isRemoteActorRef, az as getActorIdPrefix } from './createActor-f9b188f2.esm.js';
1
+ import { w as createInertActorScope, x as setInertActorScopeSnapshot, at as finalizeTransitionResult, A as attachSnapshotActorRef, O as createInitEvent, ax as hasAmbientInspector, z as beginSpawnAllocation, B as macrostep, P as createSpawnEffect, Q as initialMicrostep, a3 as isAtomicStateNode, ay as getProperAncestors, az as isRemoteActorRef, aA as getActorIdPrefix } from './createActor-523a98c7.esm.js';
2
2
 
3
3
  function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
4
4
  const result = microsteps.map(([snapshot, actions, transitions]) => [snapshot, actions, transitions ?? []]);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createActor = require('./createActor-8dfa9b5c.cjs.js');
3
+ var createActor = require('./createActor-eba8226e.cjs.js');
4
4
 
5
5
  function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
6
6
  const result = microsteps.map(([snapshot, actions, transitions]) => [snapshot, actions, transitions ?? []]);
@@ -1,4 +1,4 @@
1
- import { w as createInertActorScope, x as setInertActorScopeSnapshot, as as finalizeTransitionResult, A as attachSnapshotActorRef, O as createInitEvent, aw as hasAmbientInspector, z as beginSpawnAllocation, B as macrostep, P as createSpawnEffect, Q as initialMicrostep, a2 as isAtomicStateNode, ax as getProperAncestors, ay as isRemoteActorRef, az as getActorIdPrefix } from './createActor-55f62c08.development.esm.js';
1
+ import { w as createInertActorScope, x as setInertActorScopeSnapshot, at as finalizeTransitionResult, A as attachSnapshotActorRef, O as createInitEvent, ax as hasAmbientInspector, z as beginSpawnAllocation, B as macrostep, P as createSpawnEffect, Q as initialMicrostep, a3 as isAtomicStateNode, ay as getProperAncestors, az as isRemoteActorRef, aA as getActorIdPrefix } from './createActor-48f753a9.development.esm.js';
2
2
 
3
3
  function attachMicrostepActorRefs(microsteps, actorScope, inputSnapshot) {
4
4
  const result = microsteps.map(([snapshot, actions, transitions]) => [snapshot, actions, transitions ?? []]);
@@ -1,4 +1,4 @@
1
- import { O as createInitEvent, y as createDeadLetterEffect, an as XSTATE_STOP, ao as createCustomEffect, ap as XSTATE_LOGIC_EFFECT_START, aq as XSTATE_LOGIC_EFFECT_RESOLVE, ar as XSTATE_LOGIC_EFFECT_REJECT, as as finalizeTransitionResult, at as createEmitEffect, au as createSendToEffect, av as XSTATE_INIT, a1 as parseDelayToMilliseconds, ak as runStep, a0 as createActor } from './createActor-f9b188f2.esm.js';
1
+ import { O as createInitEvent, y as createDeadLetterEffect, ao as XSTATE_STOP, ap as createCustomEffect, aq as XSTATE_LOGIC_EFFECT_START, ar as XSTATE_LOGIC_EFFECT_RESOLVE, as as XSTATE_LOGIC_EFFECT_REJECT, at as finalizeTransitionResult, au as createEmitEffect, av as createSendToEffect, aw as XSTATE_INIT, a2 as parseDelayToMilliseconds, al as runStep, a1 as createActor } from './createActor-523a98c7.esm.js';
2
2
 
3
3
  function assertValid(validator, request) {
4
4
  const error = validator.check(request);
@@ -1,4 +1,4 @@
1
- import { O as createInitEvent, y as createDeadLetterEffect, an as XSTATE_STOP, ao as createCustomEffect, ap as XSTATE_LOGIC_EFFECT_START, aq as XSTATE_LOGIC_EFFECT_RESOLVE, ar as XSTATE_LOGIC_EFFECT_REJECT, as as finalizeTransitionResult, at as createEmitEffect, au as createSendToEffect, av as XSTATE_INIT, a1 as parseDelayToMilliseconds, ak as runStep, a0 as createActor } from './createActor-55f62c08.development.esm.js';
1
+ import { O as createInitEvent, y as createDeadLetterEffect, ao as XSTATE_STOP, ap as createCustomEffect, aq as XSTATE_LOGIC_EFFECT_START, ar as XSTATE_LOGIC_EFFECT_RESOLVE, as as XSTATE_LOGIC_EFFECT_REJECT, at as finalizeTransitionResult, au as createEmitEffect, av as createSendToEffect, aw as XSTATE_INIT, a2 as parseDelayToMilliseconds, al as runStep, a1 as createActor } from './createActor-48f753a9.development.esm.js';
2
2
 
3
3
  function assertValid(validator, request) {
4
4
  const error = validator.check(request);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createActor = require('./createActor-6d6bfee1.development.cjs.js');
3
+ var createActor = require('./createActor-f71670cf.development.cjs.js');
4
4
 
5
5
  function assertValid(validator, request) {
6
6
  const error = validator.check(request);
@@ -1,6 +1,6 @@
1
1
  'use strict';
2
2
 
3
- var createActor = require('./createActor-8dfa9b5c.cjs.js');
3
+ var createActor = require('./createActor-eba8226e.cjs.js');
4
4
 
5
5
  function assertValid(validator, request) {
6
6
  const error = validator.check(request);
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createActor = require('./createActor-8dfa9b5c.cjs.js');
6
- var dist_xstateActors = require('./index-ad40a951.cjs.js');
5
+ var createActor = require('./createActor-eba8226e.cjs.js');
6
+ var dist_xstateActors = require('./index-83f11f07.cjs.js');
7
7
 
8
8
 
9
9
 
@@ -2,8 +2,8 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var createActor = require('./createActor-6d6bfee1.development.cjs.js');
6
- var dist_xstateActors = require('./index-05e9e83b.development.cjs.js');
5
+ var createActor = require('./createActor-f71670cf.development.cjs.js');
6
+ var dist_xstateActors = require('./index-3cb56f46.development.cjs.js');
7
7
 
8
8
 
9
9
 
@@ -1,2 +1,2 @@
1
- export { a5 as createListenerLogic, a6 as createSubscriptionLogic, a7 as listenerLogic, a8 as subscriptionLogic } from './createActor-55f62c08.development.esm.js';
2
- export { T as TimeoutError, c as createAsyncLogic, b as createCallbackLogic, d as createEmptyActor, e as createEventObservableLogic, f as createLogic, g as createObservableLogic } from './index-eda79ddc.development.esm.js';
1
+ export { a6 as createListenerLogic, a7 as createSubscriptionLogic, a8 as listenerLogic, a9 as subscriptionLogic } from './createActor-48f753a9.development.esm.js';
2
+ export { T as TimeoutError, c as createAsyncLogic, b as createCallbackLogic, d as createEmptyActor, e as createEventObservableLogic, f as createLogic, g as createObservableLogic } from './index-2a4be1f2.development.esm.js';
@@ -1,2 +1,2 @@
1
- export { a5 as createListenerLogic, a6 as createSubscriptionLogic, a7 as listenerLogic, a8 as subscriptionLogic } from './createActor-f9b188f2.esm.js';
2
- export { T as TimeoutError, c as createAsyncLogic, b as createCallbackLogic, d as createEmptyActor, e as createEventObservableLogic, f as createLogic, g as createObservableLogic } from './index-e5f3a62b.esm.js';
1
+ export { a6 as createListenerLogic, a7 as createSubscriptionLogic, a8 as listenerLogic, a9 as subscriptionLogic } from './createActor-523a98c7.esm.js';
2
+ export { T as TimeoutError, c as createAsyncLogic, b as createCallbackLogic, d as createEmptyActor, e as createEventObservableLogic, f as createLogic, g as createObservableLogic } from './index-211a5dce.esm.js';