@doeixd/machine 0.0.20 → 0.0.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +19 -0
- package/dist/cjs/development/core.js.map +1 -1
- package/dist/cjs/development/index.js +277 -0
- package/dist/cjs/development/index.js.map +4 -4
- package/dist/cjs/production/index.js +4 -4
- package/dist/esm/development/core.js.map +1 -1
- package/dist/esm/development/index.js +277 -0
- package/dist/esm/development/index.js.map +4 -4
- package/dist/esm/production/index.js +4 -4
- package/dist/types/actor.d.ts +153 -0
- package/dist/types/actor.d.ts.map +1 -0
- package/dist/types/index.d.ts +3 -1
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/mixins.d.ts +118 -0
- package/dist/types/mixins.d.ts.map +1 -0
- package/package.json +1 -1
- package/src/actor.ts +284 -0
- package/src/index.ts +18 -2
- package/src/mixins.ts +308 -0
- package/src/react.ts +95 -124
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
function D(e,n){let t=e(n),r=n;for(;;){let{value:a,done:o}=t.next(r);if(o)return a;r=a}}function ie(e){return function*(){return yield e}()}function se(e){return e}function ce(e,n){return n.reduce((t,r)=>D(r,t),e)}function de(e){return e}function ye(e,n,t=(r,a)=>{console.log(`Step ${r}:`,a.context)}){let r=e(n),a=n,o=0;for(t(o,a);;){let{value:i,done:s}=r.next(a);if(s)return console.log("Final:",i),i;a=i,o++,t(o,a)}}async function le(e,n){let t=e(n),r=n;for(;;){let{value:a,done:o}=await t.next(r);if(o)return a;r=a}}async function*ue(e){return yield e}var Me=Symbol("MachineMeta"),I=Symbol("__machine_runtime_meta__");function b(e,n){let t=e[I]||{},r={...t,...n};n.guards&&t.guards?r.guards=[...n.guards,...t.guards]:n.guards&&(r.guards=[...n.guards]),n.actions&&t.actions?r.actions=[...n.actions,...t.actions]:n.actions&&(r.actions=[...n.actions]),Object.defineProperty(e,I,{value:r,enumerable:!1,writable:!1,configurable:!0})}function xe(e,n){return b(n,{target:e.name||e.toString()}),n}function he(e,n){return b(n,{description:e}),n}function fe(e,n){return b(n,{guards:[e]}),n}function pe(e,n){return b(n,{invoke:{src:e.src,onDone:e.onDone.name||e.onDone.toString(),onError:e.onError.name||e.onError.toString(),description:e.description}}),n}function Ce(e,n){return b(n,{actions:[e]}),n}function A(e,n,t={}){let{onFail:r="throw",errorMessage:a,description:o}=t,i={...t,onFail:r,errorMessage:a,description:o},s=function(...d){let c=typeof this=="object"&&"context"in this,y=c?this.context:this;if(e(y,...d)){let M=c?this.context:this;return n.apply(M,d)}else if(r==="throw"){let M=a||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:n,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:o||"Synchronous guarded transition",guards:[{name:"runtime_guard",description:o||"Synchronous condition check"}]}),s}function R(e,n,t={}){let{onFail:r="throw",errorMessage:a,description:o}=t,i={...t,onFail:r,errorMessage:a,description:o},s=async function(...d){let c=typeof this=="object"&&"context"in this,y=c?this.context:this;if(await Promise.resolve(e(y,...d))){let M=c?this.context:this;return n.apply(M,d)}else if(r==="throw"){let M=a||"Guard condition failed";throw new Error(M)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:n,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:o||"Runtime guarded transition",guards:[{name:"runtime_guard",description:o||"Runtime condition check"}]}),s}function ge(e){return{do(n){let t=A(e,n);return t.else=function(r){return A(e,n,{onFail:r})},t}}}function me(e){return{do(n){let t=R(e,n);return t.else=function(r){return R(e,n,{onFail:r})},t}}}function Te(e,n){return n}function be(e,n){let t=e,r=s=>{t=s,n==null||n(s)},{context:a,...o}=e,i=new Proxy({},{get(s,d){let c=t[d];if(typeof c=="function")return(...y)=>{let l=c.apply(t.context,y),M=Object.assign({context:l.context},o);return r(M),M}}});return{get state(){return t},get context(){return t.context},actions:i,setState:r}}function we(e,n,t){let r=()=>{let o=e.getContext(),i=t(o),s=n[i];if(!s)throw new Error(`[Ensemble] Invalid state: No factory found for state "${String(i)}".`);return s(o)},a=new Proxy({},{get(o,i){let s=r(),d=s[i];if(typeof d!="function")throw new Error(`[Ensemble] Transition "${i}" is not valid in the current state.`);return(...c)=>d.apply(s.context,c)}});return{get context(){return e.getContext()},get state(){return r()},actions:a}}function De(e,n){return function(r){return we(e,r,n)}}function Ie(e,n){let t=be(n),r=e(t),a=r.next();for(;!a.done;)a=r.next();return a.value}function Ve(e,n){let t=e(n),r=t.next();for(;!r.done;)r=t.next();return r.value}var V=class{constructor(n){this.store=n}get context(){return this.store.getContext()}setContext(n){this.store.setContext(n)}};function Ue(e,n){let t=new e(n);return new Proxy({},{get(r,a){let o=n.getContext();if(a in o)return o[a];let i=t[a];if(typeof i=="function")return(...s)=>i.apply(t,s)},set(r,a,o){let i=n.getContext();if(a in i){let s={...i,[a]:o};return n.setContext(s),!0}return!1},has(r,a){let o=n.getContext();return a in o||typeof t[a]=="function"},ownKeys(r){let a=n.getContext(),o=Object.keys(a),i=Object.getOwnPropertyNames(Object.getPrototypeOf(t)).filter(s=>s!=="constructor"&&typeof t[s]=="function");return Array.from(new Set([...o,...i]))},getOwnPropertyDescriptor(r,a){let o=n.getContext();if(a in o||typeof t[a]=="function")return{value:void 0,writable:!0,enumerable:!0,configurable:!0}}})}function Le(e,n,t){let r=()=>{let a=t(e),o=n[a];if(!o)throw new Error(`[MutableMachine] Invalid state: No factory for state "${String(a)}".`);return o(e)};return new Proxy(e,{get(a,o,i){if(o in a)return a[o];let s=r(),d=s[o];if(typeof d=="function")return(...c)=>{let y=d.apply(s.context,c);if(typeof y!="object"||y===null){console.warn(`[MutableMachine] Transition "${String(o)}" did not return a valid context object. State may be inconsistent.`);return}Object.keys(a).forEach(l=>delete a[l]),Object.assign(a,y)}},set(a,o,i,s){return a[o]=i,!0},has(a,o){let i=r();return o in a||typeof i[o]=="function"}})}function Ze(e){return function(...n){let t=this.context.child;if(typeof t[e]=="function"){let r=t[e](...n);return E(this,{...this.context,child:r})}return this}}function en(e){return function(){return typeof this.context[e]!="boolean"&&console.warn(`[toggle primitive] Property '${String(e)}' is not a boolean. Toggling may have unexpected results.`),E(this,{...this.context,[e]:!this.context[e]})}}var S=class extends m{constructor(t){super({status:"idle"});this.config=t;this.fetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},w=class extends m{constructor(t,r,a){super({status:"loading",abortController:new AbortController,attempts:a});this.config=t;this.params=r;this.succeed=t=>{var r,a;return(a=(r=this.config).onSuccess)==null||a.call(r,t),new v(this.config,{status:"success",data:t})};this.fail=t=>{var a,o,i;let r=(a=this.config.maxRetries)!=null?a:3;return this.context.attempts<r?new j(this.config,this.params,t,this.context.attempts):((i=(o=this.config).onError)==null||i.call(o,t),new P(this.config,{status:"error",error:t}))};this.cancel=()=>(this.context.abortController.abort(),new O(this.config));this.execute()}async execute(){}},j=class extends m{constructor(t,r,a,o){super({status:"retrying",error:a,attempts:o});this.config=t;this.params=r;this.retry=t=>new w(this.config,t!=null?t:this.params,this.context.attempts+1)}},v=class extends m{constructor(t,r){super(r);this.config=t;this.refetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},P=class extends m{constructor(t,r){super(r);this.config=t;this.retry=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}},O=class extends m{constructor(t){super({status:"canceled"});this.config=t;this.refetch=t=>new w(this.config,t!=null?t:this.config.initialParams,1)}};function nn(e){return new S(e)}function U(e,n){let t={...e.context,...n.context},r={...e},a={...n};delete r.context,delete a.context;let o={};for(let i in r){let s=r[i];o[i]=(...d)=>{let c=s.apply(e.context,d);return U(c,n)}}for(let i in a){let s=a[i];o[i]=(...d)=>{let c=s.apply(n.context,d);return U(e,c)}}return{context:t,...o}}var L=Symbol("CANCEL");function g(e,n,t={}){let{continueOnError:r=!1,logErrors:a=!0,onError:o}=t,i={...e};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&s!=="context"&&typeof e[s]!="function"&&(i[s]=e[s]);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let d=e[s];typeof d=="function"&&s!=="context"&&(i[s]=function(...c){let y=s,l=i.context,M=()=>{let u;try{u=d.apply(this,c)}catch(h){if(n.error)try{n.error({transitionName:y,context:l,args:[...c],error:h})}catch(f){if(!r)throw f;a&&console.error(`Middleware error hook error for ${y}:`,f),o==null||o(f,"error",{transitionName:y,context:l,args:c,error:h})}throw h}let x=h=>{if(h&&typeof h=="object"&&h.context){for(let f in i)Object.prototype.hasOwnProperty.call(i,f)&&f!=="context"&&!(f in h)&&(h[f]=i[f]);for(let f in h){if(!Object.prototype.hasOwnProperty.call(h,f))continue;typeof h[f]=="function"&&f!=="context"&&i[f]&&(h[f]=i[f])}}return h};if(u&&typeof u.then=="function")return u.then(f=>{if(x(f),n.after)try{let C=n.after({transitionName:y,prevContext:l,nextContext:f.context,args:[...c]});if(C&&typeof C.then=="function")return C.then(()=>f)}catch(C){if(!r)throw C;a&&console.error(`Middleware after hook error for ${y}:`,C),o==null||o(C,"after",{transitionName:y,prevContext:l,nextContext:f.context,args:c})}return f});if(x(u),n.after)try{let h=n.after({transitionName:y,prevContext:l,nextContext:u.context,args:[...c]});if(h&&typeof h=="object"&&h&&"then"in h)return h.then(()=>u).catch(f=>{if(!r)throw f;return a&&console.error(`Middleware after hook error for ${y}:`,f),o==null||o(f,"after",{transitionName:y,prevContext:l,nextContext:u.context,args:c}),u})}catch(h){if(!r)throw h;a&&console.error(`Middleware after hook error for ${y}:`,h),o==null||o(h,"after",{transitionName:y,prevContext:l,nextContext:u.context,args:c})}return u};if(n.before)try{let u=n.before({transitionName:y,context:l,args:[...c]});if(u&&typeof u=="object"&&u&&"then"in u)return u.then(x=>x===L?i:M()).catch(x=>{if(!r)throw x;return a&&console.error(`Middleware before hook error for ${y}:`,x),o==null||o(x,"before",{transitionName:y,context:l,args:c}),M()});if(u===L)return i}catch(u){if(!r)throw u;a&&console.error(`Middleware before hook error for ${y}:`,u),o==null||o(u,"before",{transitionName:y,context:l,args:c})}return M()})}return i}function q(e,n={}){let{logger:t=console.log,includeArgs:r=!1,includeContext:a=!0}=n;return g(e,{before:({transitionName:o,args:i})=>{let s=r?`→ ${o} [${i.join(", ")}]`:`→ ${o}`;t(s)},after:({transitionName:o,nextContext:i})=>{let s=a?` ${JSON.stringify(i)}`:"";t(`✓ ${o}${s}`)},error:({transitionName:o,error:i})=>{console.error(`[Machine] ${o} failed:`,i)}})}function J(e,n,t={}){let{eventPrefix:r="state_transition",includePrevContext:a=!1,includeArgs:o=!1}=t;return g(e,{after:({transitionName:i,prevContext:s,nextContext:d,args:c})=>{let y=`${r}.${i}`,l={transition:i};a&&(l.from=s),l.to=d,o&&(l.args=c),n(y,l)}})}function Y(e,n){return g(e,{before:t=>{if(n(t)===!1)throw new Error(`Validation failed for transition: ${t.transitionName}`)}})}function Q(e,n){return g(e,{before:t=>{if(!n(t))throw new Error(`Unauthorized transition: ${t.transitionName}`)}})}function X(e,n,t={}){let{includeArgs:r=!1}=t;return g(e,{error:a=>{let o={transition:a.transitionName,context:a.context,...r&&{args:a.args}};n(a.error,o)}})}function Z(e,n){let t=new Map;return g(e,{before:r=>{t.set(r.transitionName,Date.now())},after:r=>{let a=t.get(r.transitionName);if(a){let o=Date.now()-a;t.delete(r.transitionName);let i={transitionName:r.transitionName,duration:o,context:r.nextContext||r.prevContext};n(i)}}})}function ee(e,n={}){var d,c;let{maxAttempts:t=(d=n.maxRetries)!=null?d:3,shouldRetry:r=()=>!0,backoffMs:a=(c=n.delay)!=null?c:100,backoffMultiplier:o=2,onRetry:i}=n,s={...e};for(let y in e){if(!Object.prototype.hasOwnProperty.call(e,y))continue;let l=e[y];typeof l=="function"&&y!=="context"&&(s[y]=async function(...M){let u,x=0;for(;x<t;)try{return await l.apply(this,M)}catch(h){if(u=h,x++,x<t&&r(u,x)){i==null||i(u,x);let C=(typeof a=="function"?a(x):a)*Math.pow(o,x-1);await new Promise(T=>setTimeout(T,C))}else throw u}throw u})}return s}function rn(e,n){return t=>g(t,e,n)}function k(e,n={}){let{maxSize:t,serializer:r,onEntry:a}=n,o=[],i=0,s=g(e,{before:({transitionName:d,args:c})=>{let y={id:`entry-${i++}`,transitionName:d,args:[...c],timestamp:Date.now()};if(r)try{y.serializedArgs=r.serialize(c)}catch(l){console.error("Failed to serialize history args:",l)}o.push(y),t&&o.length>t&&o.shift(),a==null||a(y)}});return Object.assign(s,{history:o,clearHistory:()=>{o.length=0,i=0}})}function N(e,n={}){let{maxSize:t,serializer:r,captureSnapshot:a,onlyOnChange:o=!1}=n,i=[],s=0,d=g(e,{after:({transitionName:y,prevContext:l,nextContext:M})=>{if(o&&JSON.stringify(l)===JSON.stringify(M))return;let u={id:`snapshot-${s++}`,transitionName:y,before:{...l},after:{...M},timestamp:Date.now()};if(r)try{u.serializedBefore=r.serialize(l),u.serializedAfter=r.serialize(M)}catch(x){console.error("Failed to serialize snapshot:",x)}if(a)try{u.diff=a(l,M)}catch(x){console.error("Failed to capture snapshot:",x)}i.push(u),t&&i.length>t&&i.shift()}});return Object.assign(d,{snapshots:i,clearSnapshots:()=>{i.length=0,s=0},restoreSnapshot:y=>{let l=Object.fromEntries(Object.entries(e).filter(([M])=>M!=="context"&&M!=="snapshots"&&M!=="clearSnapshots"&&M!=="restoreSnapshot"&&typeof e[M]=="function"));return Object.assign({context:y},l)}})}function B(e,n={}){let{maxSize:t,serializer:r,onRecord:a}=n,o=[],i=[],s=0,d=0,c=g(e,{before:({transitionName:M,args:u})=>{let x={id:`entry-${s++}`,transitionName:M,args:[...u],timestamp:Date.now()};if(r)try{x.serializedArgs=r.serialize(u)}catch(h){console.error("Failed to serialize history args:",h)}o.push(x),t&&o.length>t&&o.shift(),a==null||a("history",x)},after:({transitionName:M,prevContext:u,nextContext:x})=>{let h={id:`snapshot-${d++}`,transitionName:M,before:{...u},after:{...x},timestamp:Date.now()};if(r)try{h.serializedBefore=r.serialize(u),h.serializedAfter=r.serialize(x)}catch(f){console.error("Failed to serialize snapshot:",f)}i.push(h),t&&i.length>t&&i.shift(),a==null||a("snapshot",h)}});return Object.assign(c,{history:o,snapshots:i,clearHistory:()=>{o.length=0,s=0},clearSnapshots:()=>{i.length=0,d=0},clearTimeTravel:()=>{o.length=0,i.length=0,s=0,d=0},restoreSnapshot:M=>{let u=Object.fromEntries(Object.entries(e).filter(([x])=>x!=="context"&&x!=="history"&&x!=="snapshots"&&x!=="clearHistory"&&x!=="clearSnapshots"&&x!=="restoreSnapshot"&&x!=="clearTimeTravel"&&x!=="replayFrom"&&typeof e[x]=="function"));return Object.assign({context:M},u)},replayFrom:M=>{var C;if(M<0||M>=o.length)throw new Error(`Invalid replay start index: ${M}`);let u=(C=i[M])==null?void 0:C.before;if(!u)throw new Error(`No snapshot available for index ${M}`);let x=o.slice(M),f=Object.assign({context:u},Object.fromEntries(Object.entries(e).filter(([T])=>T!=="context"&&typeof e[T]=="function")));for(let T of x){let G=f[T.transitionName];G&&(f=G.apply(f.context,T.args))}return f}})}function fn(e,...n){return n.reduce((t,r)=>r(t),e)}function K(e,...n){return n.reduce((t,r)=>r(t),e)}var _=class e{constructor(n){this.machine=n}with(n){let t=n(this.machine);return new e(t)}build(){return this.machine}};function pn(e){return new _(e)}function z(e,n){let t=function(r){return n(r)?e(r):r};return t.middleware=e,t.when=n,t}function Cn(e){return z(e,()=>typeof process!="undefined"?!1:typeof window!="undefined"?!window.location.hostname.includes("production"):!1)}function gn(e,n,t){return z(t,r=>r.context[e]===n)}function mn(){let e=new Map;return{register(n,t,r,a){if(e.has(n))throw new Error(`Middleware '${n}' is already registered`);return e.set(n,{name:n,middleware:t,description:r,priority:a}),this},unregister(n){return e.delete(n)},has(n){return e.has(n)},get(n){return e.get(n)},list(){return Array.from(e.values()).sort((n,t)=>{var r,a;return((r=n.priority)!=null?r:0)-((a=t.priority)!=null?a:0)})},apply(n,t){let r=t.map(a=>{let o=e.get(a);if(!o)throw new Error(`Middleware '${a}' is not registered`);return o}).sort((a,o)=>{var i,s;return((i=a.priority)!=null?i:0)-((s=o.priority)!=null?s:0)});return K(n,...r.map(a=>a.middleware))},applyAll(n){let t=this.list();return K(n,...t.map(r=>r.middleware))}}}function Tn(e={}){let{continueOnError:n=!1,logErrors:t=!0,onError:r}=e;return(a,...o)=>{let i=a,s=[],d=!0;for(let c=0;c<o.length;c++){let y=o[c];try{if("middleware"in y&&"when"in y){if(!y.when(i))continue;i=y.middleware(i)}else i=y(i)}catch(l){if(d=!1,!n)throw l;s.push({error:l,middlewareIndex:c,middlewareName:y.name}),t&&console.error(`Pipeline middleware error at index ${c}:`,l),r==null||r(l,c,y.name)}}return{machine:i,errors:s,success:d}}}function bn(...e){return n=>K(n,...e)}function wn(e,n){return t=>{for(let[r,a]of e)if(r(t))return a(t);return n?n(t):t}}function ne(e){return typeof e=="function"&&e.length===1}function En(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&"middleware"in e&&"when"in e&&ne(e.middleware)&&typeof e.when=="function"}function Fn(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"prevContext"in e&&"nextContext"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!n||F(e.prevContext,n)&&F(e.nextContext,n))}function An(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!n||F(e.context,n))}function Rn(e,n){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&"error"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&e.error instanceof Error&&(!n||F(e.context,n))}function Sn(e,n){if(e===null||typeof e!="object")return!1;let t=e;return!("before"in t&&t.before!==void 0&&typeof t.before!="function"||"after"in t&&t.after!==void 0&&typeof t.after!="function"||"error"in t&&t.error!==void 0&&typeof t.error!="function")}function jn(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}function F(e,n){return e!==null&&typeof e=="object"}function vn(e){return e!==null&&typeof e=="object"&&"name"in e&&"middleware"in e&&typeof e.name=="string"&&ne(e.middleware)&&("description"in e?typeof e.description=="string"||e.description===void 0:!0)&&("priority"in e?typeof e.priority=="number"||e.priority===void 0:!0)}function Pn(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}var H=class{constructor(n){this.machine=n;this.middlewares=[]}withLogging(n){return this.middlewares.push(t=>q(t,n)),this}withAnalytics(n,t){return this.middlewares.push(r=>J(r,n,t)),this}withValidation(n,t){return this.middlewares.push(r=>Y(r,n)),this}withPermissions(n){return this.middlewares.push(t=>Q(t,n)),this}withErrorReporting(n,t){return this.middlewares.push(r=>X(r,n,t)),this}withPerformanceMonitoring(n,t){return this.middlewares.push(r=>Z(r,n)),this}withRetry(n){return this.middlewares.push(t=>ee(t,n)),this}withHistory(n){return this.middlewares.push(t=>k(t,n)),this}withSnapshot(n){return this.middlewares.push(t=>N(t,n)),this}withTimeTravel(n){return this.middlewares.push(t=>B(t,n)),this}withDebugging(){return this.middlewares.push(n=>Fe(n)),this}withCustom(n){return this.middlewares.push(n),this}withConditional(n,t){return this.middlewares.push(z(n,t)),this}build(){let n=this.machine;for(let t of this.middlewares)n=t(n);return n}getChain(){return[...this.middlewares]}clear(){return this.middlewares=[],this}};function Ee(e){return new H(e)}function On(e={}){return{create:n=>{let t=Ee(n);return e.logging&&t.withLogging(e.logging),e.analytics&&t.withAnalytics(e.analytics.track,e.analytics.options),e.history&&t.withHistory(e.history),e.snapshot&&t.withSnapshot(e.snapshot),e.timeTravel&&t.withTimeTravel(e.timeTravel),e.retry&&t.withRetry(e.retry),t}}}function Fe(e){return B(N(k(e)))}function Ae(e,n){return e instanceof n}function Re(e,...n){return{type:e,args:n}}function Se(e,n){return E(e,t=>({...t,...n}))}async function je(e,...n){let t=e;for(let r of n)t=await r(t);return t}function ve(e,n){return n?console.log(n,e.context):console.log(e.context),e}function Pe(e,n){return function(...t){let r=n(this.context,...t);return p(r,e())}}function Oe(e,n,...t){return e.apply(n,t)}function te(e){return new Proxy(e,{get(n,t){let r=n[t];return typeof r=="function"?function(...a){let o=r.apply(n.context,a);return o&&typeof o=="object"&&"context"in o?te(o):o}:r}})}var $=class e{constructor(n){return this.wrappedMachine=n,new Proxy(this,{get:(t,r)=>{if(r==="wrappedMachine")return Reflect.get(t,r);if(r==="context")return this.wrappedMachine.context;let a=this.wrappedMachine[r];return typeof a=="function"?(...o)=>{let i=a.apply(this.wrappedMachine.context,o);return i&&typeof i=="object"&&"context"in i?new e(i):i}:a}})}};function ke(){return function(n){return function(...t){let r=n(this.context,...t);return p(r,this)}}}function re(e){return{machine:e,addTransition:function(n,t){let r=function(...o){let i=t(this.context,...o);return p(i,this)},a=oe(e,{[n]:r});return re(a)}}}function ae(e){return function(t){let r={},a=Object.fromEntries(Object.entries(t).map(([o,i])=>[o,function(...s){let d=i(this.context,...s);return p(d,r)}]));return Object.assign(r,a),p(e,r)}}function Ne(e,n){return n!==void 0?p(e,n):ae(e)}function Be(...e){let n=new Map;for(let[s,d,c]of e){if(n.has(s))throw new Error(`Duplicate matcher case name: "${s}"`);n.set(s,{predicate:c})}let t=new Proxy({},{get(s,d){return function(y){let l=n.get(d);if(!l){let M=Array.from(n.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${M}`)}return l.predicate(y)}}}),r=new Proxy({},{get(s,d){return function(y){if(!n.has(d)){let l=Array.from(n.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${l}`)}return{__brand:"CaseHandler",__name:d,__machine:void 0,__return:void 0,handler:y}}}}),a={__exhaustive:!0};function o(s){return{is(...d){if(d.length===0)throw new Error("Pattern match requires at least one handler and exhaustiveness marker");let c=d[d.length-1];if(!c||typeof c!="object"||!("__exhaustive"in c))throw new Error("Pattern match must end with match.exhaustive for compile-time exhaustiveness checking");let y=d.slice(0,-1);for(let u of y){let x=u.__name,h=n.get(x);if(!h)throw new Error(`Internal error: Unknown matcher case in handler: ${x}`);if(h.predicate(s))return u.handler(s)}let l=y.map(u=>u.__name).join(", "),M=Array.from(n.keys()).join(", ");throw new Error(`Non-exhaustive pattern match at runtime: no handler matched the machine.
|
|
2
|
-
Handled cases: [${
|
|
3
|
-
All cases: [${
|
|
4
|
-
This may occur if predicates don't cover all runtime possibilities.`)}}}function i(s){for(let[d,c,
|
|
1
|
+
function L(e,t){let n=e(t),r=t;for(;;){let{value:o,done:a}=n.next(r);if(a)return o;r=o}}function ue(e){return function*(){return yield e}()}function ye(e){return e}function le(e,t){return t.reduce((n,r)=>L(r,n),e)}function xe(e){return e}function Me(e,t,n=(r,o)=>{console.log(`Step ${r}:`,o.context)}){let r=e(t),o=t,a=0;for(n(a,o);;){let{value:i,done:s}=r.next(o);if(s)return console.log("Final:",i),i;o=i,a++,n(a,o)}}async function he(e,t){let n=e(t),r=t;for(;;){let{value:o,done:a}=await n.next(r);if(a)return o;r=o}}async function*pe(e){return yield e}var fe=Symbol("MachineMeta"),q=Symbol("__machine_runtime_meta__");function b(e,t){let n=e[q]||{},r={...n,...t};t.guards&&n.guards?r.guards=[...t.guards,...n.guards]:t.guards&&(r.guards=[...t.guards]),t.actions&&n.actions?r.actions=[...t.actions,...n.actions]:t.actions&&(r.actions=[...t.actions]),Object.defineProperty(e,q,{value:r,enumerable:!1,writable:!1,configurable:!0})}function Ce(e,t){return b(t,{target:e.name||e.toString()}),t}function ge(e,t){return b(t,{description:e}),t}function me(e,t){return b(t,{guards:[e]}),t}function Te(e,t){return b(t,{invoke:{src:e.src,onDone:e.onDone.name||e.onDone.toString(),onError:e.onError.name||e.onError.toString(),description:e.description}}),t}function be(e,t){return b(t,{actions:[e]}),t}function S(e,t,n={}){let{onFail:r="throw",errorMessage:o,description:a}=n,i={...n,onFail:r,errorMessage:o,description:a},s=function(...d){let c=typeof this=="object"&&"context"in this,u=c?this.context:this;if(e(u,...d)){let x=c?this.context:this;return t.apply(x,d)}else if(r==="throw"){let x=o||"Guard condition failed";throw new Error(x)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:t,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:a||"Synchronous guarded transition",guards:[{name:"runtime_guard",description:a||"Synchronous condition check"}]}),s}function j(e,t,n={}){let{onFail:r="throw",errorMessage:o,description:a}=n,i={...n,onFail:r,errorMessage:o,description:a},s=async function(...d){let c=typeof this=="object"&&"context"in this,u=c?this.context:this;if(await Promise.resolve(e(u,...d))){let x=c?this.context:this;return t.apply(x,d)}else if(r==="throw"){let x=o||"Guard condition failed";throw new Error(x)}else if(r==="ignore"){if(c)return this;throw new Error('Cannot use "ignore" mode with context-only binding. Use full machine binding or provide fallback.')}else if(typeof r=="function"){if(c)return r.apply(this,d);throw new Error("Cannot use function fallback with context-only binding. Use full machine binding.")}else return r};return Object.defineProperty(s,"__guard",{value:!0,enumerable:!1}),Object.defineProperty(s,"condition",{value:e,enumerable:!1}),Object.defineProperty(s,"transition",{value:t,enumerable:!1}),Object.defineProperty(s,"options",{value:i,enumerable:!1}),b(s,{description:a||"Runtime guarded transition",guards:[{name:"runtime_guard",description:a||"Runtime condition check"}]}),s}function we(e){return{do(t){let n=S(e,t);return n.else=function(r){return S(e,t,{onFail:r})},n}}}function Ee(e){return{do(t){let n=j(e,t);return n.else=function(r){return j(e,t,{onFail:r})},n}}}function ve(e,t){return t}function Ae(e,t){let n=e,r=s=>{n=s,t==null||t(s)},{context:o,...a}=e,i=new Proxy({},{get(s,d){let c=n[d];if(typeof c=="function")return(...u)=>{let y=c.apply(n.context,u),x=Object.assign({context:y.context},a);return r(x),x}}});return{get state(){return n},get context(){return n.context},actions:i,setState:r}}function Fe(e,t,n){let r=()=>{let a=e.getContext(),i=n(a),s=t[i];if(!s)throw new Error(`[Ensemble] Invalid state: No factory found for state "${String(i)}".`);return s(a)},o=new Proxy({},{get(a,i){let s=r(),d=s[i];if(typeof d!="function")throw new Error(`[Ensemble] Transition "${i}" is not valid in the current state.`);return(...c)=>d.apply(s.context,c)}});return{get context(){return e.getContext()},get state(){return r()},actions:o}}function Xe(e,t){return function(r){return Fe(e,r,t)}}function Ze(e,t){let n=Ae(t),r=e(n),o=r.next();for(;!o.done;)o=r.next();return o.value}function et(e,t){let n=e(t),r=n.next();for(;!r.done;)r=n.next();return r.value}var J=class{constructor(t){this.store=t}get context(){return this.store.getContext()}setContext(t){this.store.setContext(t)}};function tt(e,t){let n=new e(t);return new Proxy({},{get(r,o){let a=t.getContext();if(o in a)return a[o];let i=n[o];if(typeof i=="function")return(...s)=>i.apply(n,s)},set(r,o,a){let i=t.getContext();if(o in i){let s={...i,[o]:a};return t.setContext(s),!0}return!1},has(r,o){let a=t.getContext();return o in a||typeof n[o]=="function"},ownKeys(r){let o=t.getContext(),a=Object.keys(o),i=Object.getOwnPropertyNames(Object.getPrototypeOf(n)).filter(s=>s!=="constructor"&&typeof n[s]=="function");return Array.from(new Set([...a,...i]))},getOwnPropertyDescriptor(r,o){let a=t.getContext();if(o in a||typeof n[o]=="function")return{value:void 0,writable:!0,enumerable:!0,configurable:!0}}})}function nt(e,t,n){let r=()=>{let o=n(e),a=t[o];if(!a)throw new Error(`[MutableMachine] Invalid state: No factory for state "${String(o)}".`);return a(e)};return new Proxy(e,{get(o,a,i){if(a in o)return o[a];let s=r(),d=s[a];if(typeof d=="function")return(...c)=>{let u=d.apply(s.context,c);if(typeof u!="object"||u===null){console.warn(`[MutableMachine] Transition "${String(a)}" did not return a valid context object. State may be inconsistent.`);return}Object.keys(o).forEach(y=>delete o[y]),Object.assign(o,u)}},set(o,a,i,s){return o[a]=i,!0},has(o,a){let i=r();return a in o||typeof i[a]=="function"}})}function ct(e){return function(...t){let n=this.context.child;if(typeof n[e]=="function"){let r=n[e](...t);return v(this,{...this.context,child:r})}return this}}function dt(e){return function(){return typeof this.context[e]!="boolean"&&console.warn(`[toggle primitive] Property '${String(e)}' is not a boolean. Toggling may have unexpected results.`),v(this,{...this.context,[e]:!this.context[e]})}}var P=class extends m{constructor(n){super({status:"idle"});this.config=n;this.fetch=n=>new w(this.config,n!=null?n:this.config.initialParams,1)}},w=class extends m{constructor(n,r,o){super({status:"loading",abortController:new AbortController,attempts:o});this.config=n;this.params=r;this.succeed=n=>{var r,o;return(o=(r=this.config).onSuccess)==null||o.call(r,n),new k(this.config,{status:"success",data:n})};this.fail=n=>{var o,a,i;let r=(o=this.config.maxRetries)!=null?o:3;return this.context.attempts<r?new O(this.config,this.params,n,this.context.attempts):((i=(a=this.config).onError)==null||i.call(a,n),new _(this.config,{status:"error",error:n}))};this.cancel=()=>(this.context.abortController.abort(),new B(this.config));this.execute()}async execute(){}},O=class extends m{constructor(n,r,o,a){super({status:"retrying",error:o,attempts:a});this.config=n;this.params=r;this.retry=n=>new w(this.config,n!=null?n:this.params,this.context.attempts+1)}},k=class extends m{constructor(n,r){super(r);this.config=n;this.refetch=n=>new w(this.config,n!=null?n:this.config.initialParams,1)}},_=class extends m{constructor(n,r){super(r);this.config=n;this.retry=n=>new w(this.config,n!=null?n:this.config.initialParams,1)}},B=class extends m{constructor(n){super({status:"canceled"});this.config=n;this.refetch=n=>new w(this.config,n!=null?n:this.config.initialParams,1)}};function ut(e){return new P(e)}function Y(e,t){let n={...e.context,...t.context},r={...e},o={...t};delete r.context,delete o.context;let a={};for(let i in r){let s=r[i];a[i]=(...d)=>{let c=s.apply(e.context,d);return Y(c,t)}}for(let i in o){let s=o[i];a[i]=(...d)=>{let c=s.apply(t.context,d);return Y(e,c)}}return{context:n,...a}}var Q=Symbol("CANCEL");function g(e,t,n={}){let{continueOnError:r=!1,logErrors:o=!0,onError:a}=n,i={...e};for(let s in e)Object.prototype.hasOwnProperty.call(e,s)&&s!=="context"&&typeof e[s]!="function"&&(i[s]=e[s]);for(let s in e){if(!Object.prototype.hasOwnProperty.call(e,s))continue;let d=e[s];typeof d=="function"&&s!=="context"&&(i[s]=function(...c){let u=s,y=i.context,x=()=>{let l;try{l=d.apply(this,c)}catch(h){if(t.error)try{t.error({transitionName:u,context:y,args:[...c],error:h})}catch(p){if(!r)throw p;o&&console.error(`Middleware error hook error for ${u}:`,p),a==null||a(p,"error",{transitionName:u,context:y,args:c,error:h})}throw h}let M=h=>{if(h&&typeof h=="object"&&h.context){for(let p in i)Object.prototype.hasOwnProperty.call(i,p)&&p!=="context"&&!(p in h)&&(h[p]=i[p]);for(let p in h){if(!Object.prototype.hasOwnProperty.call(h,p))continue;typeof h[p]=="function"&&p!=="context"&&i[p]&&(h[p]=i[p])}}return h};if(l&&typeof l.then=="function")return l.then(p=>{if(M(p),t.after)try{let C=t.after({transitionName:u,prevContext:y,nextContext:p.context,args:[...c]});if(C&&typeof C.then=="function")return C.then(()=>p)}catch(C){if(!r)throw C;o&&console.error(`Middleware after hook error for ${u}:`,C),a==null||a(C,"after",{transitionName:u,prevContext:y,nextContext:p.context,args:c})}return p});if(M(l),t.after)try{let h=t.after({transitionName:u,prevContext:y,nextContext:l.context,args:[...c]});if(h&&typeof h=="object"&&h&&"then"in h)return h.then(()=>l).catch(p=>{if(!r)throw p;return o&&console.error(`Middleware after hook error for ${u}:`,p),a==null||a(p,"after",{transitionName:u,prevContext:y,nextContext:l.context,args:c}),l})}catch(h){if(!r)throw h;o&&console.error(`Middleware after hook error for ${u}:`,h),a==null||a(h,"after",{transitionName:u,prevContext:y,nextContext:l.context,args:c})}return l};if(t.before)try{let l=t.before({transitionName:u,context:y,args:[...c]});if(l&&typeof l=="object"&&l&&"then"in l)return l.then(M=>M===Q?i:x()).catch(M=>{if(!r)throw M;return o&&console.error(`Middleware before hook error for ${u}:`,M),a==null||a(M,"before",{transitionName:u,context:y,args:c}),x()});if(l===Q)return i}catch(l){if(!r)throw l;o&&console.error(`Middleware before hook error for ${u}:`,l),a==null||a(l,"before",{transitionName:u,context:y,args:c})}return x()})}return i}function X(e,t={}){let{logger:n=console.log,includeArgs:r=!1,includeContext:o=!0}=t;return g(e,{before:({transitionName:a,args:i})=>{let s=r?`→ ${a} [${i.join(", ")}]`:`→ ${a}`;n(s)},after:({transitionName:a,nextContext:i})=>{let s=o?` ${JSON.stringify(i)}`:"";n(`✓ ${a}${s}`)},error:({transitionName:a,error:i})=>{console.error(`[Machine] ${a} failed:`,i)}})}function Z(e,t,n={}){let{eventPrefix:r="state_transition",includePrevContext:o=!1,includeArgs:a=!1}=n;return g(e,{after:({transitionName:i,prevContext:s,nextContext:d,args:c})=>{let u=`${r}.${i}`,y={transition:i};o&&(y.from=s),y.to=d,a&&(y.args=c),t(u,y)}})}function ee(e,t){return g(e,{before:n=>{if(t(n)===!1)throw new Error(`Validation failed for transition: ${n.transitionName}`)}})}function te(e,t){return g(e,{before:n=>{if(!t(n))throw new Error(`Unauthorized transition: ${n.transitionName}`)}})}function ne(e,t,n={}){let{includeArgs:r=!1}=n;return g(e,{error:o=>{let a={transition:o.transitionName,context:o.context,...r&&{args:o.args}};t(o.error,a)}})}function re(e,t){let n=new Map;return g(e,{before:r=>{n.set(r.transitionName,Date.now())},after:r=>{let o=n.get(r.transitionName);if(o){let a=Date.now()-o;n.delete(r.transitionName);let i={transitionName:r.transitionName,duration:a,context:r.nextContext||r.prevContext};t(i)}}})}function oe(e,t={}){var d,c;let{maxAttempts:n=(d=t.maxRetries)!=null?d:3,shouldRetry:r=()=>!0,backoffMs:o=(c=t.delay)!=null?c:100,backoffMultiplier:a=2,onRetry:i}=t,s={...e};for(let u in e){if(!Object.prototype.hasOwnProperty.call(e,u))continue;let y=e[u];typeof y=="function"&&u!=="context"&&(s[u]=async function(...x){let l,M=0;for(;M<n;)try{return await y.apply(this,x)}catch(h){if(l=h,M++,M<n&&r(l,M)){i==null||i(l,M);let C=(typeof o=="function"?o(M):o)*Math.pow(a,M-1);await new Promise(T=>setTimeout(T,C))}else throw l}throw l})}return s}function lt(e,t){return n=>g(n,e,t)}function N(e,t={}){let{maxSize:n,serializer:r,onEntry:o}=t,a=[],i=0,s=g(e,{before:({transitionName:d,args:c})=>{let u={id:`entry-${i++}`,transitionName:d,args:[...c],timestamp:Date.now()};if(r)try{u.serializedArgs=r.serialize(c)}catch(y){console.error("Failed to serialize history args:",y)}a.push(u),n&&a.length>n&&a.shift(),o==null||o(u)}});return Object.assign(s,{history:a,clearHistory:()=>{a.length=0,i=0}})}function K(e,t={}){let{maxSize:n,serializer:r,captureSnapshot:o,onlyOnChange:a=!1}=t,i=[],s=0,d=g(e,{after:({transitionName:u,prevContext:y,nextContext:x})=>{if(a&&JSON.stringify(y)===JSON.stringify(x))return;let l={id:`snapshot-${s++}`,transitionName:u,before:{...y},after:{...x},timestamp:Date.now()};if(r)try{l.serializedBefore=r.serialize(y),l.serializedAfter=r.serialize(x)}catch(M){console.error("Failed to serialize snapshot:",M)}if(o)try{l.diff=o(y,x)}catch(M){console.error("Failed to capture snapshot:",M)}i.push(l),n&&i.length>n&&i.shift()}});return Object.assign(d,{snapshots:i,clearSnapshots:()=>{i.length=0,s=0},restoreSnapshot:u=>{let y=Object.fromEntries(Object.entries(e).filter(([x])=>x!=="context"&&x!=="snapshots"&&x!=="clearSnapshots"&&x!=="restoreSnapshot"&&typeof e[x]=="function"));return Object.assign({context:u},y)}})}function H(e,t={}){let{maxSize:n,serializer:r,onRecord:o}=t,a=[],i=[],s=0,d=0,c=g(e,{before:({transitionName:x,args:l})=>{let M={id:`entry-${s++}`,transitionName:x,args:[...l],timestamp:Date.now()};if(r)try{M.serializedArgs=r.serialize(l)}catch(h){console.error("Failed to serialize history args:",h)}a.push(M),n&&a.length>n&&a.shift(),o==null||o("history",M)},after:({transitionName:x,prevContext:l,nextContext:M})=>{let h={id:`snapshot-${d++}`,transitionName:x,before:{...l},after:{...M},timestamp:Date.now()};if(r)try{h.serializedBefore=r.serialize(l),h.serializedAfter=r.serialize(M)}catch(p){console.error("Failed to serialize snapshot:",p)}i.push(h),n&&i.length>n&&i.shift(),o==null||o("snapshot",h)}});return Object.assign(c,{history:a,snapshots:i,clearHistory:()=>{a.length=0,s=0},clearSnapshots:()=>{i.length=0,d=0},clearTimeTravel:()=>{a.length=0,i.length=0,s=0,d=0},restoreSnapshot:x=>{let l=Object.fromEntries(Object.entries(e).filter(([M])=>M!=="context"&&M!=="history"&&M!=="snapshots"&&M!=="clearHistory"&&M!=="clearSnapshots"&&M!=="restoreSnapshot"&&M!=="clearTimeTravel"&&M!=="replayFrom"&&typeof e[M]=="function"));return Object.assign({context:x},l)},replayFrom:x=>{var C;if(x<0||x>=a.length)throw new Error(`Invalid replay start index: ${x}`);let l=(C=i[x])==null?void 0:C.before;if(!l)throw new Error(`No snapshot available for index ${x}`);let M=a.slice(x),p=Object.assign({context:l},Object.fromEntries(Object.entries(e).filter(([T])=>T!=="context"&&typeof e[T]=="function")));for(let T of M){let V=p[T.transitionName];V&&(p=V.apply(p.context,T.args))}return p}})}function Et(e,...t){return t.reduce((n,r)=>r(n),e)}function I(e,...t){return t.reduce((n,r)=>r(n),e)}var z=class e{constructor(t){this.machine=t}with(t){let n=t(this.machine);return new e(n)}build(){return this.machine}};function vt(e){return new z(e)}function W(e,t){let n=function(r){return t(r)?e(r):r};return n.middleware=e,n.when=t,n}function At(e){return W(e,()=>typeof process!="undefined"?!1:typeof window!="undefined"?!window.location.hostname.includes("production"):!1)}function Ft(e,t,n){return W(n,r=>r.context[e]===t)}function Rt(){let e=new Map;return{register(t,n,r,o){if(e.has(t))throw new Error(`Middleware '${t}' is already registered`);return e.set(t,{name:t,middleware:n,description:r,priority:o}),this},unregister(t){return e.delete(t)},has(t){return e.has(t)},get(t){return e.get(t)},list(){return Array.from(e.values()).sort((t,n)=>{var r,o;return((r=t.priority)!=null?r:0)-((o=n.priority)!=null?o:0)})},apply(t,n){let r=n.map(o=>{let a=e.get(o);if(!a)throw new Error(`Middleware '${o}' is not registered`);return a}).sort((o,a)=>{var i,s;return((i=o.priority)!=null?i:0)-((s=a.priority)!=null?s:0)});return I(t,...r.map(o=>o.middleware))},applyAll(t){let n=this.list();return I(t,...n.map(r=>r.middleware))}}}function St(e={}){let{continueOnError:t=!1,logErrors:n=!0,onError:r}=e;return(o,...a)=>{let i=o,s=[],d=!0;for(let c=0;c<a.length;c++){let u=a[c];try{if("middleware"in u&&"when"in u){if(!u.when(i))continue;i=u.middleware(i)}else i=u(i)}catch(y){if(d=!1,!t)throw y;s.push({error:y,middlewareIndex:c,middlewareName:u.name}),n&&console.error(`Pipeline middleware error at index ${c}:`,y),r==null||r(y,c,u.name)}}return{machine:i,errors:s,success:d}}}function jt(...e){return t=>I(t,...e)}function Pt(e,t){return n=>{for(let[r,o]of e)if(r(n))return o(n);return t?t(n):n}}function ae(e){return typeof e=="function"&&e.length===1}function Ot(e){return e!==null&&(typeof e=="object"||typeof e=="function")&&"middleware"in e&&"when"in e&&ae(e.middleware)&&typeof e.when=="function"}function kt(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"prevContext"in e&&"nextContext"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!t||A(e.prevContext,t)&&A(e.nextContext,t))}function _t(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&(!t||A(e.context,t))}function Bt(e,t){return e!==null&&typeof e=="object"&&"transitionName"in e&&"context"in e&&"args"in e&&"error"in e&&typeof e.transitionName=="string"&&Array.isArray(e.args)&&e.error instanceof Error&&(!t||A(e.context,t))}function Nt(e,t){if(e===null||typeof e!="object")return!1;let n=e;return!("before"in n&&n.before!==void 0&&typeof n.before!="function"||"after"in n&&n.after!==void 0&&typeof n.after!="function"||"error"in n&&n.error!==void 0&&typeof n.error!="function")}function Kt(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}function A(e,t){return e!==null&&typeof e=="object"}function Ht(e){return e!==null&&typeof e=="object"&&"name"in e&&"middleware"in e&&typeof e.name=="string"&&ae(e.middleware)&&("description"in e?typeof e.description=="string"||e.description===void 0:!0)&&("priority"in e?typeof e.priority=="number"||e.priority===void 0:!0)}function It(e){return e===void 0||e!==null&&typeof e=="object"&&("continueOnError"in e?typeof e.continueOnError=="boolean":!0)&&("logErrors"in e?typeof e.logErrors=="boolean":!0)&&("onError"in e?typeof e.onError=="function"||e.onError===void 0:!0)}var $=class{constructor(t){this.machine=t;this.middlewares=[]}withLogging(t){return this.middlewares.push(n=>X(n,t)),this}withAnalytics(t,n){return this.middlewares.push(r=>Z(r,t,n)),this}withValidation(t,n){return this.middlewares.push(r=>ee(r,t)),this}withPermissions(t){return this.middlewares.push(n=>te(n,t)),this}withErrorReporting(t,n){return this.middlewares.push(r=>ne(r,t,n)),this}withPerformanceMonitoring(t,n){return this.middlewares.push(r=>re(r,t)),this}withRetry(t){return this.middlewares.push(n=>oe(n,t)),this}withHistory(t){return this.middlewares.push(n=>N(n,t)),this}withSnapshot(t){return this.middlewares.push(n=>K(n,t)),this}withTimeTravel(t){return this.middlewares.push(n=>H(n,t)),this}withDebugging(){return this.middlewares.push(t=>Se(t)),this}withCustom(t){return this.middlewares.push(t),this}withConditional(t,n){return this.middlewares.push(W(t,n)),this}build(){let t=this.machine;for(let n of this.middlewares)t=n(t);return t}getChain(){return[...this.middlewares]}clear(){return this.middlewares=[],this}};function Re(e){return new $(e)}function zt(e={}){return{create:t=>{let n=Re(t);return e.logging&&n.withLogging(e.logging),e.analytics&&n.withAnalytics(e.analytics.track,e.analytics.options),e.history&&n.withHistory(e.history),e.snapshot&&n.withSnapshot(e.snapshot),e.timeTravel&&n.withTimeTravel(e.timeTravel),e.retry&&n.withRetry(e.retry),n}}}function Se(e){return H(K(N(e)))}function D(e){let t={},n=e;for(;n&&n!==Object.prototype;){let r=Object.getOwnPropertyDescriptors(n);for(let[o,a]of Object.entries(r))o!=="constructor"&&(o in t||(t[o]=a));n=Object.getPrototypeOf(n)}return t}function je(...e){let t=e[0];class n extends t{constructor(a){super(a)}}let r=o=>function(...a){let i=o.apply(this,a);if(i&&typeof i=="object"&&"context"in i){let s={...this.context,...i.context};return new n(s)}return i};for(let o of e){let a=D(o.prototype);for(let[i,s]of Object.entries(a))if(i!=="constructor")if(typeof s.value=="function"){let d=s.value,c=r(d);Object.defineProperty(n.prototype,i,{...s,value:c})}else Object.defineProperty(n.prototype,i,s)}return n}function Pe(e,...t){class n extends m{constructor(a){super(a)}}let r=D(e.prototype);for(let[o,a]of Object.entries(r))if(o!=="constructor")if(typeof a.value=="function"){let i=a.value,s=function(...d){let c=i.apply(this,d);return c&&typeof c=="object"&&"context"in c?new n({...this.context,...c.context}):c};Object.defineProperty(n.prototype,o,{...a,value:s})}else Object.defineProperty(n.prototype,o,a);for(let o of t){let a=D(o.prototype);for(let i of Object.keys(a))Object.prototype.hasOwnProperty.call(n.prototype,i)&&delete n.prototype[i]}return n}function Dt(...e){let t=e.map(a=>a.constructor),n=e.map(a=>a.context),r=Object.assign({},...n),o=je(...t);return new o(r)}function Gt(e,...t){let n=e.constructor,r=t.map(a=>a.constructor),o=Pe(n,...r);return new o(e.context)}function Oe(e,t){return e instanceof t}function ke(e,...t){return{type:e,args:t}}function _e(e,t){return v(e,n=>({...n,...t}))}async function Be(e,...t){let n=e;for(let r of t)n=await r(n);return n}function Ne(e,t){return t?console.log(t,e.context):console.log(e.context),e}function Ke(e,t){return function(...n){let r=t(this.context,...n);return f(r,e())}}function He(e,t,...n){return e.apply(t,n)}function ie(e){return new Proxy(e,{get(t,n){let r=t[n];return typeof r=="function"?function(...o){let a=r.apply(t.context,o);return a&&typeof a=="object"&&"context"in a?ie(a):a}:r}})}var G=class e{constructor(t){return this.wrappedMachine=t,new Proxy(this,{get:(n,r)=>{if(r==="wrappedMachine")return Reflect.get(n,r);if(r==="context")return this.wrappedMachine.context;let o=this.wrappedMachine[r];return typeof o=="function"?(...a)=>{let i=o.apply(this.wrappedMachine.context,a);return i&&typeof i=="object"&&"context"in i?new e(i):i}:o}})}};function Ie(){return function(t){return function(...n){let r=t(this.context,...n);return f(r,this)}}}function se(e){return{machine:e,addTransition:function(t,n){let r=function(...a){let i=n(this.context,...a);return f(i,this)},o=de(e,{[t]:r});return se(o)}}}function ce(e){return function(n){let r={},o=Object.fromEntries(Object.entries(n).map(([a,i])=>[a,function(...s){let d=i(this.context,...s);return f(d,r)}]));return Object.assign(r,o),f(e,r)}}function ze(e,t){return t!==void 0?f(e,t):ce(e)}function $e(...e){let t=new Map;for(let[s,d,c]of e){if(t.has(s))throw new Error(`Duplicate matcher case name: "${s}"`);t.set(s,{predicate:c})}let n=new Proxy({},{get(s,d){return function(u){let y=t.get(d);if(!y){let x=Array.from(t.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${x}`)}return y.predicate(u)}}}),r=new Proxy({},{get(s,d){return function(u){if(!t.has(d)){let y=Array.from(t.keys()).join(", ");throw new Error(`Unknown matcher case: "${d}". Available cases: ${y}`)}return{__brand:"CaseHandler",__name:d,__machine:void 0,__return:void 0,handler:u}}}}),o={__exhaustive:!0};function a(s){return{is(...d){if(d.length===0)throw new Error("Pattern match requires at least one handler and exhaustiveness marker");let c=d[d.length-1];if(!c||typeof c!="object"||!("__exhaustive"in c))throw new Error("Pattern match must end with match.exhaustive for compile-time exhaustiveness checking");let u=d.slice(0,-1);for(let l of u){let M=l.__name,h=t.get(M);if(!h)throw new Error(`Internal error: Unknown matcher case in handler: ${M}`);if(h.predicate(s))return l.handler(s)}let y=u.map(l=>l.__name).join(", "),x=Array.from(t.keys()).join(", ");throw new Error(`Non-exhaustive pattern match at runtime: no handler matched the machine.
|
|
2
|
+
Handled cases: [${y}]
|
|
3
|
+
All cases: [${x}]
|
|
4
|
+
This may occur if predicates don't cover all runtime possibilities.`)}}}function i(s){for(let[d,c,u]of e)if(u(s))return d;return null}return Object.assign(i,{is:n,when:a,case:r,exhaustive:o})}function We(e,t){return[e,void 0,n=>n instanceof t]}function De(e,t,n){return[e,void 0,r=>U(r,t,n)]}function Ge(e,t){return[e,void 0,t]}function Ue(){return{case(e,t,n){return[e,void 0,r=>U(r,t,n)]}}}var E=class E{constructor(t){this._observers=new Set;this._queue=[];this._processing=!1;this._state=t,this.ref={send:n=>this.dispatch(n)},this.send=new Proxy({},{get:(n,r)=>(...o)=>{this.dispatch({type:r,args:o})}})}static inspect(t){E._inspector=t}getSnapshot(){return this._state}subscribe(t){return this._observers.add(t),()=>{this._observers.delete(t)}}select(t){return t(this._state)}start(){return this}stop(){this._observers.clear()}dispatch(t){if(E._inspector&&E._inspector({type:"@actor/send",actor:this,event:t,snapshot:this._state}),this._processing){this._queue.push(t);return}this._processing=!0,this._queue.push(t),this._flush()}_flush(){for(;this._queue.length>0;){let t=this._queue[0];this._queue.shift();let r=this._state[t.type];if(typeof r!="function"){console.warn(`[Actor] Transition '${String(t.type)}' not found.`);continue}let o;try{o=r.apply(this._state.context,t.args)}catch(a){console.error(`[Actor] Error in transition '${String(t.type)}':`,a);continue}if(o instanceof Promise){o.then(a=>{this._state=a,this._notify(),this._flush()}).catch(a=>{console.error(`[Actor] Async error in transition '${String(t.type)}':`,a),this._flush()});return}else this._state=o,this._notify()}this._processing=!1}_notify(){let t=this.getSnapshot();this._observers.forEach(n=>n(t))}};E._inspector=null;var F=E;function R(e){return new F(e)}function Ve(e){return R(e)}function Le(e){let n=f({status:"pending",data:void 0,error:void 0},o=>({resolve(a){return o({status:"resolved",data:a,error:void 0})},reject(a){return o({status:"rejected",error:a,data:void 0})}})),r=R(n);return e().then(o=>r.send.resolve(o)).catch(o=>r.send.reject(o)),r}function qe(e){let n=f({status:"active",value:void 0,error:void 0},o=>({next(a){return o({status:"active",value:a,error:void 0})},error(a){return o({status:"error",error:a,value:void 0})},complete(){return o({status:"done",value:void 0,error:void 0})}})),r=R(n);return e.subscribe(o=>r.send.next(o),o=>r.send.error(o),()=>r.send.complete()),r}function f(e,t){if(typeof t=="function"){let o;o=t(s=>{let d=f(s,o),c=Object.fromEntries(Object.entries(o).map(([u,y])=>[u,y.bind(s)]));return Object.assign(d,c)});let i=Object.fromEntries(Object.entries(o).map(([s,d])=>[s,d.bind(e)]));return Object.assign({context:e},i)}let n="context"in t?Object.fromEntries(Object.entries(t).filter(([o])=>o!=="context")):t;return Object.assign({context:e},n)}function Je(e,t){if(typeof t=="function"){let o;o=t(s=>{let d=Je(s,o),c=Object.fromEntries(Object.entries(o).map(([u,y])=>[u,y.bind(s)]));return Object.assign(d,c)});let i=Object.fromEntries(Object.entries(o).map(([s,d])=>[s,d.bind(e)]));return Object.assign({context:e},i)}let n="context"in t?Object.fromEntries(Object.entries(t).filter(([o])=>o!=="context")):t;return Object.assign({context:e},n)}function hn(){return e=>{let t=Object.fromEntries(Object.entries(e).map(([n,r])=>[n,function(...o){let a=r(this.context,...o);return f(a,t)}]));return n=>f(n,t)}}function v(e,t){let{context:n,...r}=e,o=typeof t=="function"?t(n):t;return f(o,r)}function pn(e){return{context:e}}function fn(e,t){let{context:n,...r}=e,o={...r,...t};return f(n,o)}function de(e,t){let{context:n,...r}=e,o={...r,...t};return f(n,o)}function Cn(e,t){return(...n)=>{let r=e(...n),o=t(),a={...r.context,...o.context},{context:i,...s}=r,{context:d,...c}=o,u={...s,...c};return f(a,u)}}function gn(e){let{context:t,...n}=e;return r=>f(r,n)}function mn(e,t,n){let r=e.context[t],o=n[r];if(!o)throw new Error(`No handler found for state: ${String(r)}`);return o(e.context)}function U(e,t,n){return e.context[t]===n}function Tn(e,t){let n=e,r=null;async function o(a){r&&(r.abort(),r=null);let i=n[a.type];if(typeof i!="function")throw new Error(`[Machine] Unknown event type '${String(a.type)}' on current state.`);let s=new AbortController;r=s;try{let c=await i.apply(n.context,[...a.args,{signal:s.signal}]);return s.signal.aborted||(n=c,t==null||t(n)),n}finally{r===s&&(r=null)}}return{get state(){return n.context},dispatch:o,stop:()=>{r&&(r.abort(),r=null)}}}var m=class{constructor(t){this.context=t}};function bn(e,t){let{context:n,...r}=e;return f(t(n),r)}export{F as Actor,G as BoundMachine,Q as CANCEL,fe as META_KEY,m as MachineBase,Pe as MachineExclude,je as MachineUnion,$ as MiddlewareBuilder,J as MultiMachineBase,be as action,ie as bindTransitions,Pt as branch,He as call,vt as chain,We as classCase,jt as combine,Cn as combineFactories,Et as compose,I as composeTyped,R as createActor,Je as createAsyncMachine,pn as createContext,lt as createCustomMiddleware,Fe as createEnsemble,Xe as createEnsembleFactory,ke as createEvent,ut as createFetchMachine,xe as createFlow,ce as createFunctionalMachine,f as createMachine,gn as createMachineBuilder,hn as createMachineFactory,$e as createMatcher,g as createMiddleware,zt as createMiddlewareFactory,Rt as createMiddlewareRegistry,tt as createMultiMachine,nt as createMutableMachine,Y as createParallelMachine,St as createPipeline,Ae as createRunner,Ke as createTransition,se as createTransitionExtender,Ie as createTransitionFactory,Ge as customCase,ct as delegateToChild,ge as describe,De as discriminantCase,de as extendTransitions,Ue as forContext,qe as fromObservable,Le as fromPromise,S as guard,j as guardAsync,me as guarded,U as hasState,At as inDevelopment,Te as invoke,Ot as isConditionalMiddleware,_t as isMiddlewareContext,Bt as isMiddlewareError,ae as isMiddlewareFn,Nt as isMiddlewareHooks,Kt as isMiddlewareOptions,kt as isMiddlewareResult,Ht as isNamedMiddleware,It as isPipelineConfig,Oe as isState,Ne as logState,Gt as machineExclude,Dt as machineUnion,mn as matchMachine,_e as mergeContext,ve as metadata,Re as middlewareBuilder,bn as next,fn as overrideTransitions,Be as pipeTransitions,L as run,he as runAsync,Tn as runMachine,le as runSequence,Me as runWithDebug,et as runWithEnsemble,Ze as runWithRunner,v as setContext,Ve as spawn,ze as state,ue as step,pe as stepAsync,dt as toggle,Ce as transitionTo,W as when,Ft as whenContext,we as whenGuard,Ee as whenGuardAsync,Z as withAnalytics,Se as withDebugging,ne as withErrorReporting,N as withHistory,X as withLogging,re as withPerformanceMonitoring,te as withPermissions,oe as withRetry,K as withSnapshot,H as withTimeTravel,ee as withValidation,ye as yieldMachine};
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
import { Event, BaseMachine, TransitionNames, TransitionArgs } from './index';
|
|
2
|
+
/**
|
|
3
|
+
* A standard interface for interacting with any actor-like entity.
|
|
4
|
+
*/
|
|
5
|
+
export interface ActorRef<T> {
|
|
6
|
+
dispatch: (event: any) => void;
|
|
7
|
+
getSnapshot: () => T;
|
|
8
|
+
subscribe: (observer: (state: T) => void) => () => void;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* Inspection event type.
|
|
12
|
+
*/
|
|
13
|
+
export type InspectionEvent = {
|
|
14
|
+
type: '@actor/send';
|
|
15
|
+
actor: ActorRef<any>;
|
|
16
|
+
event: any;
|
|
17
|
+
snapshot: any;
|
|
18
|
+
};
|
|
19
|
+
/**
|
|
20
|
+
* A reactive container for a state machine that handles dispatching,
|
|
21
|
+
* queueing of async transitions, and state observability.
|
|
22
|
+
*/
|
|
23
|
+
export declare class Actor<M extends BaseMachine<any>> implements ActorRef<M> {
|
|
24
|
+
private _state;
|
|
25
|
+
private _observers;
|
|
26
|
+
private _queue;
|
|
27
|
+
private _processing;
|
|
28
|
+
private static _inspector;
|
|
29
|
+
/**
|
|
30
|
+
* Registers a global inspector.
|
|
31
|
+
*/
|
|
32
|
+
static inspect(inspector: (event: InspectionEvent) => void): void;
|
|
33
|
+
/**
|
|
34
|
+
* The "Magic" Dispatcher.
|
|
35
|
+
* Maps machine transition names to callable functions.
|
|
36
|
+
*/
|
|
37
|
+
readonly send: {
|
|
38
|
+
[K in TransitionNames<M>]: (...args: TransitionArgs<M, K>) => void;
|
|
39
|
+
};
|
|
40
|
+
/**
|
|
41
|
+
* A stable reference to the dispatch method, useful for passing around.
|
|
42
|
+
*/
|
|
43
|
+
readonly ref: {
|
|
44
|
+
send: (event: Event<M>) => void;
|
|
45
|
+
};
|
|
46
|
+
constructor(initialMachine: M);
|
|
47
|
+
/**
|
|
48
|
+
* Returns the current immutable snapshot of the machine.
|
|
49
|
+
*/
|
|
50
|
+
getSnapshot(): M;
|
|
51
|
+
/**
|
|
52
|
+
* Subscribes to state changes.
|
|
53
|
+
* @param observer Callback function to be invoked on every state change.
|
|
54
|
+
* @returns Unsubscribe function.
|
|
55
|
+
*/
|
|
56
|
+
subscribe(observer: (state: M) => void): () => void;
|
|
57
|
+
/**
|
|
58
|
+
* Selects a slice of the state.
|
|
59
|
+
*/
|
|
60
|
+
select<T>(selector: (state: M) => T): T;
|
|
61
|
+
/**
|
|
62
|
+
* Starts the actor.
|
|
63
|
+
*/
|
|
64
|
+
start(): this;
|
|
65
|
+
/**
|
|
66
|
+
* Stops the actor.
|
|
67
|
+
*/
|
|
68
|
+
stop(): void;
|
|
69
|
+
/**
|
|
70
|
+
* Dispatches an event to the actor.
|
|
71
|
+
* Handles both sync and async transitions.
|
|
72
|
+
*/
|
|
73
|
+
dispatch(event: Event<M>): void;
|
|
74
|
+
private _flush;
|
|
75
|
+
private _notify;
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Creates a new Actor instance from a machine.
|
|
79
|
+
*/
|
|
80
|
+
export declare function createActor<M extends BaseMachine<any>>(machine: M): Actor<M>;
|
|
81
|
+
/**
|
|
82
|
+
* Spawns an actor from a machine. Alias for createActor.
|
|
83
|
+
*/
|
|
84
|
+
export declare function spawn<M extends BaseMachine<any>>(machine: M): ActorRef<M>;
|
|
85
|
+
/**
|
|
86
|
+
* Creates an actor-like machine from a Promise.
|
|
87
|
+
*/
|
|
88
|
+
export declare function fromPromise<T>(promiseFn: () => Promise<T>): Actor<import("./index").Machine<{
|
|
89
|
+
status: "pending";
|
|
90
|
+
data: undefined;
|
|
91
|
+
error: undefined;
|
|
92
|
+
} | {
|
|
93
|
+
status: "resolved";
|
|
94
|
+
data: T;
|
|
95
|
+
error: undefined;
|
|
96
|
+
} | {
|
|
97
|
+
status: "rejected";
|
|
98
|
+
data: undefined;
|
|
99
|
+
error: any;
|
|
100
|
+
}, import("./index").BindTransitions<Record<string, (this: {
|
|
101
|
+
status: "pending";
|
|
102
|
+
data: undefined;
|
|
103
|
+
error: undefined;
|
|
104
|
+
} | {
|
|
105
|
+
status: "resolved";
|
|
106
|
+
data: T;
|
|
107
|
+
error: undefined;
|
|
108
|
+
} | {
|
|
109
|
+
status: "rejected";
|
|
110
|
+
data: undefined;
|
|
111
|
+
error: any;
|
|
112
|
+
}, ...args: any[]) => any>>>>;
|
|
113
|
+
/**
|
|
114
|
+
* Creates an actor-like machine from an Observable.
|
|
115
|
+
*/
|
|
116
|
+
export declare function fromObservable<T>(observable: {
|
|
117
|
+
subscribe: (next: (val: T) => void, error?: (err: any) => void, complete?: () => void) => {
|
|
118
|
+
unsubscribe: () => void;
|
|
119
|
+
};
|
|
120
|
+
}): Actor<import("./index").Machine<{
|
|
121
|
+
status: "active";
|
|
122
|
+
value: undefined;
|
|
123
|
+
error: undefined;
|
|
124
|
+
} | {
|
|
125
|
+
status: "active";
|
|
126
|
+
value: T;
|
|
127
|
+
error: undefined;
|
|
128
|
+
} | {
|
|
129
|
+
status: "done";
|
|
130
|
+
value: undefined;
|
|
131
|
+
error: undefined;
|
|
132
|
+
} | {
|
|
133
|
+
status: "error";
|
|
134
|
+
value: undefined;
|
|
135
|
+
error: any;
|
|
136
|
+
}, import("./index").BindTransitions<Record<string, (this: {
|
|
137
|
+
status: "active";
|
|
138
|
+
value: undefined;
|
|
139
|
+
error: undefined;
|
|
140
|
+
} | {
|
|
141
|
+
status: "active";
|
|
142
|
+
value: T;
|
|
143
|
+
error: undefined;
|
|
144
|
+
} | {
|
|
145
|
+
status: "done";
|
|
146
|
+
value: undefined;
|
|
147
|
+
error: undefined;
|
|
148
|
+
} | {
|
|
149
|
+
status: "error";
|
|
150
|
+
value: undefined;
|
|
151
|
+
error: any;
|
|
152
|
+
}, ...args: any[]) => any>>>>;
|
|
153
|
+
//# sourceMappingURL=actor.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"actor.d.ts","sourceRoot":"","sources":["../../src/actor.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,WAAW,EACX,eAAe,EACf,cAAc,EAGf,MAAM,SAAS,CAAC;AAMjB;;GAEG;AACH,MAAM,WAAW,QAAQ,CAAC,CAAC;IACzB,QAAQ,EAAE,CAAC,KAAK,EAAE,GAAG,KAAK,IAAI,CAAC;IAC/B,WAAW,EAAE,MAAM,CAAC,CAAC;IACrB,SAAS,EAAE,CAAC,QAAQ,EAAE,CAAC,KAAK,EAAE,CAAC,KAAK,IAAI,KAAK,MAAM,IAAI,CAAC;CACzD;AAED;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG;IAC5B,IAAI,EAAE,aAAa,CAAC;IACpB,KAAK,EAAE,QAAQ,CAAC,GAAG,CAAC,CAAC;IACrB,KAAK,EAAE,GAAG,CAAC;IACX,QAAQ,EAAE,GAAG,CAAC;CACf,CAAC;AAMF;;;GAGG;AACH,qBAAa,KAAK,CAAC,CAAC,SAAS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
|
97
97
|
/** The readonly state of the machine. */
|
|
98
98
|
readonly context: C;
|
|
99
|
-
}
|
|
99
|
+
};
|
|
100
100
|
/**
|
|
101
101
|
* Helper to make a type deeply readonly (freezes nested objects).
|
|
102
102
|
* Useful for ensuring immutability of context at the type level.
|
|
@@ -675,7 +675,9 @@ export type { MachineConfig, ExtractionConfig, ParallelRegionConfig, ChildStates
|
|
|
675
675
|
export * from './multi';
|
|
676
676
|
export * from './higher-order';
|
|
677
677
|
export * from './middleware/index';
|
|
678
|
+
export * from './mixins';
|
|
678
679
|
export { isState, createEvent, createTransition, mergeContext, pipeTransitions, logState, call, bindTransitions, BoundMachine } from './utils';
|
|
679
680
|
export { createTransitionFactory, createTransitionExtender, createFunctionalMachine, state } from './functional-combinators';
|
|
680
681
|
export { createMatcher, classCase, discriminantCase, customCase, forContext, type MatcherCase, type CasesToMapping, type MatcherUnion, type CaseNames, type CaseHandler, type ExhaustivenessMarker, type IsExhaustive, type WhenBuilder, type Matcher } from './matcher';
|
|
682
|
+
export { Actor, createActor, spawn, fromPromise, fromObservable, type ActorRef, type InspectionEvent } from './actor';
|
|
681
683
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;GAGG;AACH,MAAM,MAAM,YAAY,CAAC,CAAC,IAAI,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,CAAC;AAE7C;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,MAAM,OAAO,CACjB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,GAAG,EAAE,IACnB;IACF,QAAQ,CAAC,OAAO,EAAE,CAAC,CAAC;CACrB,GAAG,CAAC,CAAC;AAEN;;;;GAIG;AACH,MAAM,MAAM,YAAY,CACtB,CAAC,SAAS,MAAM,EAChB,CAAC,SAAS,MAAM,GAAG,EAAE,IACnB;IACF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A;AAEvB,cAAc,gBAAgB,CAAA;AAM9B,cAAc,oBAAoB,CAAC;AAEnC,cAAc,UAAU,CAAC;AAMzB,OAAO,EACL,OAAO,EACP,WAAW,EACX,gBAAgB,EAChB,YAAY,EACZ,eAAe,EACf,QAAQ,EACR,IAAI,EACJ,eAAe,EACf,YAAY,EACb,MAAM,SAAS,CAAC;AAMjB,OAAO,EACL,uBAAuB,EACvB,wBAAwB,EACxB,uBAAuB,EACvB,KAAK,EACN,MAAM,0BAA0B,CAAC;AAMlC,OAAO,EACL,aAAa,EACb,SAAS,EACT,gBAAgB,EAChB,UAAU,EACV,UAAU,EACV,KAAK,WAAW,EAChB,KAAK,cAAc,EACnB,KAAK,YAAY,EACjB,KAAK,SAAS,EACd,KAAK,WAAW,EAChB,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,WAAW,EAChB,KAAK,OAAO,EACb,MAAM,WAAW,CAAC;AAMnB,OAAO,EACL,KAAK,EACL,WAAW,EACX,KAAK,EACL,WAAW,EACX,cAAc,EACd,KAAK,QAAQ,EACb,KAAK,eAAe,EACrB,MAAM,SAAS,CAAC"}
|
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
import { MachineBase } from './index';
|
|
2
|
+
export type Constructor<T = any> = new (...args: any[]) => T;
|
|
3
|
+
/**
|
|
4
|
+
* Helper to convert a tuple of types into an intersection of those types.
|
|
5
|
+
* e.g. [A, B] -> A & B
|
|
6
|
+
*/
|
|
7
|
+
export type UnionToIntersection<U> = (U extends any ? (k: U) => void : never) extends ((k: infer I) => void) ? I : never;
|
|
8
|
+
/**
|
|
9
|
+
* Extracts the instance type from a constructor.
|
|
10
|
+
*/
|
|
11
|
+
export type Instance<T> = T extends new (...args: any[]) => infer R ? R : never;
|
|
12
|
+
/**
|
|
13
|
+
* Extracts the Context type from a MachineBase subclass.
|
|
14
|
+
*/
|
|
15
|
+
export type ExtractContext<T> = T extends MachineBase<infer C> ? C : never;
|
|
16
|
+
/**
|
|
17
|
+
* Combined context type for a union of machines.
|
|
18
|
+
*/
|
|
19
|
+
export type CombinedContext<T extends Constructor[]> = UnionToIntersection<ExtractContext<Instance<T[number]>>> & object;
|
|
20
|
+
/**
|
|
21
|
+
* Combined instance type for a union of machines.
|
|
22
|
+
*/
|
|
23
|
+
export type CombinedInstance<T extends Constructor[]> = UnionToIntersection<Instance<T[number]>>;
|
|
24
|
+
/**
|
|
25
|
+
* The instance type of a MachineUnion, with methods remapped to return the union type.
|
|
26
|
+
*/
|
|
27
|
+
export type MachineUnionInstance<T extends Constructor[]> = {
|
|
28
|
+
[K in keyof CombinedInstance<T>]: CombinedInstance<T>[K] extends (...args: infer Args) => any ? (...args: Args) => MachineUnionInstance<T> : CombinedInstance<T>[K];
|
|
29
|
+
} & CombinedInstance<T>;
|
|
30
|
+
/**
|
|
31
|
+
* The constructor type for a MachineUnion.
|
|
32
|
+
*/
|
|
33
|
+
export type MachineUnionConstructor<T extends Constructor[]> = new (context: CombinedContext<T>) => MachineUnionInstance<T>;
|
|
34
|
+
/**
|
|
35
|
+
* Creates a new class that combines the functionality of multiple Machine classes.
|
|
36
|
+
*
|
|
37
|
+
* This utility effectively implements multiple inheritance for State Machines.
|
|
38
|
+
* It merges the prototypes of all provided classes into a single new class,
|
|
39
|
+
* preserving the type safety of contexts and methods.
|
|
40
|
+
*
|
|
41
|
+
* Crucially, it **wraps** inherited methods to ensure they return instances
|
|
42
|
+
* of the *Combined* machine, enabling fluent method chaining across different
|
|
43
|
+
* mixed-in capabilities.
|
|
44
|
+
*
|
|
45
|
+
* @param machines - A list of Machine classes to combine.
|
|
46
|
+
* @returns A new class constructor that inherits from all input classes.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```typescript
|
|
50
|
+
* class A extends MachineBase<{ a: number }> {
|
|
51
|
+
* incA() { return new A({ a: this.context.a + 1 }); }
|
|
52
|
+
* }
|
|
53
|
+
* class B extends MachineBase<{ b: number }> {
|
|
54
|
+
* incB() { return new B({ b: this.context.b + 1 }); }
|
|
55
|
+
* }
|
|
56
|
+
*
|
|
57
|
+
* class AB extends MachineUnion(A, B) {}
|
|
58
|
+
*
|
|
59
|
+
* const machine = new AB({ a: 0, b: 0 });
|
|
60
|
+
* machine.incA().incB(); // Type-safe chaining!
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function MachineUnion<T extends Constructor[]>(...machines: T): MachineUnionConstructor<T>;
|
|
64
|
+
/**
|
|
65
|
+
* Creates a new class that extends a Source machine but excludes methods defined in one or more Excluded classes.
|
|
66
|
+
*
|
|
67
|
+
* This is useful for "subtracting" functionality from a combined machine or
|
|
68
|
+
* creating a restricted view of a larger machine.
|
|
69
|
+
*
|
|
70
|
+
* @param Source - The class to extend and extract methods from.
|
|
71
|
+
* @param Excluded - One or more classes defining methods to remove.
|
|
72
|
+
* @returns A new class with the subset of methods.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```typescript
|
|
76
|
+
* class Admin extends MachineUnion(Viewer, Editor, Moderator) {}
|
|
77
|
+
* class Guest extends MachineExclude(Admin, Editor, Moderator) {}
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
80
|
+
export declare function MachineExclude<S extends Constructor, E extends Constructor[]>(Source: S, ...Excluded: E): new (context: ExtractContext<Instance<S>>) => Omit<Instance<S>, Exclude<keyof Instance<E[number]>, "context">>;
|
|
81
|
+
/**
|
|
82
|
+
* Functional helper to combine multiple Machine instances into a single union instance.
|
|
83
|
+
*
|
|
84
|
+
* Automatically merges the contexts of all provided instances and creates a new
|
|
85
|
+
* `MachineUnion` class on the fly.
|
|
86
|
+
*
|
|
87
|
+
* @param instances - Variadic list of machine instances to combine.
|
|
88
|
+
* @returns A new instance of the combined machine.
|
|
89
|
+
*
|
|
90
|
+
* @example
|
|
91
|
+
* ```typescript
|
|
92
|
+
* const counter = new Counter({ count: 0 });
|
|
93
|
+
* const toggler = new Toggler({ active: true });
|
|
94
|
+
*
|
|
95
|
+
* const app = machineUnion(counter, toggler);
|
|
96
|
+
* app.increment().toggle(); // Works! logic merged.
|
|
97
|
+
* ```
|
|
98
|
+
*/
|
|
99
|
+
export declare function machineUnion<T extends MachineBase<any>[]>(...instances: T): Instance<MachineUnionConstructor<{
|
|
100
|
+
[K in keyof T]: T[K] extends MachineBase<any> ? Constructor<T[K]> : never;
|
|
101
|
+
}>>;
|
|
102
|
+
/**
|
|
103
|
+
* Functional helper to create a restricted machine instance by excluding behaviors
|
|
104
|
+
* defined in other machine instances.
|
|
105
|
+
*
|
|
106
|
+
* @param source - The source machine instance.
|
|
107
|
+
* @param excluded - Variadic list of machine instances whose methods should be excluded from source.
|
|
108
|
+
* @returns A new instance restricted to the source's capabilities minus excluded ones.
|
|
109
|
+
*
|
|
110
|
+
* @example
|
|
111
|
+
* ```typescript
|
|
112
|
+
* const fullApp = new AppMachine({ count: 0, active: true });
|
|
113
|
+
* const guestApp = machineExclude(fullApp, new Toggler({ active: false }));
|
|
114
|
+
* // guestApp.toggle(); // Error!
|
|
115
|
+
* ```
|
|
116
|
+
*/
|
|
117
|
+
export declare function machineExclude<S extends MachineBase<any>, E extends MachineBase<any>[]>(source: S, ...excluded: E): Omit<S, Exclude<keyof E[number], "context">>;
|
|
118
|
+
//# sourceMappingURL=mixins.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mixins.d.ts","sourceRoot":"","sources":["../../src/mixins.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAMtC,MAAM,MAAM,WAAW,CAAC,CAAC,GAAG,GAAG,IAAI,KAAK,GAAG,IAAI,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;AAE7D;;;GAGG;AACH,MAAM,MAAM,mBAAmB,CAAC,CAAC,IAC/B,CAAC,CAAC,SAAS,GAAG,GAAG,CAAC,CAAC,EAAE,CAAC,KAAK,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,M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