@manifesto-ai/sdk 3.17.2 → 3.17.3

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/dist/index.d.ts CHANGED
@@ -9,7 +9,7 @@
9
9
  */
10
10
  export type { SdkManifest } from "./manifest.js";
11
11
  export { createManifesto } from "./create-manifesto.js";
12
- export type { ActivatedInstance, ActionArgs, CreateIntentArgs, DispatchReport, ActionObjectBindingArgs, DispatchBlocker, AvailableActionDelta, TypedActionMetadata, TypedGetActionMetadata, TypedGetIntentBlockers, TypedIsIntentDispatchable, BaseLaws, BaseComposableLaws, CanonicalPlatformNamespaces, CanonicalSnapshot, ComposableManifesto, ComputedRef, EffectContext, EffectHandler, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, FieldRef, GovernedComposableLaws, GovernanceLaws, IntentAdmission, IntentAdmissionFailure, IntentExplanation, InvalidInputInfo, LineageComposableLaws, LineageLaws, ManifestoBaseInstance, ManifestoDecoratedRuntimeByLaws, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, ManifestoEventPayload, ManifestoRuntimeByLaws, Selector, SimulationDiagnostics, SimulateResult, ProjectedDiff, CanonicalOutcome, SchemaGraph, SchemaGraphEdge, SchemaGraphEdgeRelation, SchemaGraphNode, SchemaGraphNodeId, SchemaGraphNodeKind, SchemaGraphNodeRef, Snapshot, TypedActionRef, TypedCommitAsync, TypedCreateIntent, TypedDispatchAsync, TypedIntent, TypedMEL, TypedOn, TypedSimulate, TypedSubscribe, Unsubscribe, } from "./types.js";
12
+ export type { ActivatedInstance, ActionArgs, CreateIntentArgs, DispatchReport, ActionObjectBindingArgs, DispatchBlocker, AvailableActionDelta, TypedActionMetadata, TypedGetActionMetadata, TypedGetIntentBlockers, TypedIsIntentDispatchable, BaseLaws, BaseComposableLaws, CanonicalPlatformNamespaces, CanonicalSnapshot, ComposableManifesto, ComputedRef, EffectContext, EffectHandler, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, FieldRef, GovernedComposableLaws, GovernanceLaws, IntentAdmission, IntentAdmissionFailure, IntentExplanation, InvalidInputInfo, LineageComposableLaws, LineageLaws, ManifestoBaseInstance, ManifestoDispatchRuntime, ManifestoDecoratedRuntimeByLaws, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, ManifestoEventPayload, ManifestoLegalityRuntime, ManifestoRuntimeByLaws, Selector, SimulationDiagnostics, SimulateResult, ProjectedDiff, CanonicalOutcome, SchemaGraph, SchemaGraphEdge, SchemaGraphEdgeRelation, SchemaGraphNode, SchemaGraphNodeId, SchemaGraphNodeKind, SchemaGraphNodeRef, Snapshot, TypedActionRef, TypedCommitAsync, TypedCreateIntent, TypedDispatchAsync, TypedIntent, TypedMEL, TypedOn, TypedSimulate, TypedSubscribe, Unsubscribe, } from "./types.js";
13
13
  export { AlreadyActivatedError, CompileError, DisposedError, ManifestoError, ReservedEffectError, } from "./errors.js";
14
14
  export type { CompileDiagnostic } from "./errors.js";
15
15
  export type { DomainSchema, Intent, Patch, Snapshot as CoreSnapshot, } from "@manifesto-ai/core";
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
- import{a as v}from"./chunk-EPGBNDYU.js";import{a as d,b as h,d as w,e as x,f as I,j as y,k as E,l as k,r as _}from"./chunk-7TMADY2E.js";import{a as l,b,c as g,d as B,e as F}from"./chunk-BDIXNUQ3.js";import{createHostContextProvider as J,createHost as Y,defaultRuntime as X}from"@manifesto-ai/host";import{extractDefaults as Q}from"@manifesto-ai/core";import{semanticPathToPatchPath as K}from"@manifesto-ai/core";function U(e){return typeof e=="object"&&e!==null&&"key"in e&&"into"in e}function N(e,t){if(U(e))return{patches:[{op:"set",path:L(e.into),value:q(e.key)}]};let{path:n,target:a}=e,o=W(n,t);return a?{patches:[{op:"set",path:L(a),value:o.value}]}:{patches:[]}}function q(e){switch(e){case"uuid":return y();case"timestamp":case"time.now":return Date.now();case"isoTimestamp":return new Date().toISOString();default:return null}}function L(e){let t=H(e),n=t.startsWith("data.")?t.slice(5):t;return K(n)}function H(e){return e.startsWith("/")?e.slice(1).replace(/\//g,"."):e}function W(e,t){let a=H(e).split(".");if(a.length===0)return{value:void 0,found:!1};let[o,...i]=a,r;switch(o){case"data":r=t.data;break;case"computed":r=t.computed;break;case"system":r=t.system;break;case"meta":r=t.meta;break;default:r=t.data,i.unshift(o);break}for(let s of i){if(r==null||typeof r!="object")return{value:void 0,found:!1};r=r[s]}return{value:r,found:r!==void 0}}var u="system.get",j="system.",$=Object.freeze({__baseLaws:!0});function P(e,t,n){let a=X,o=Y(e,{initialData:Q(e.state),runtime:a}),i=J(a);o.registerEffect(u,async(r,s,m)=>{let{patches:c}=N(s,m.snapshot);return c});for(let[r,s]of Object.entries(n)){let m=async(c,f,p)=>await s(f,{snapshot:I(x(p.snapshot,t))});o.registerEffect(r,m)}return{host:o,contextProvider:i}}import{createIntent as Z}from"@manifesto-ai/core";function M(){return(e,...t)=>{let n=e,a=y(),o=ee(n,t);return Z(String(e.name),o,a)}}function ee(e,t){let n=Object.hasOwn(e,d)?e[d]:[];if(t.length!==0){if(n===null){if(t.length===1&&S(t[0]))return t[0];throw new l("INVALID_INTENT_ARGS",`Action "${String(e.name)}" requires a single object argument because positional parameter metadata is unavailable`)}if(n.length===0){if(t.length===1)return t[0];throw new l("INVALID_INTENT_ARGS",`Action "${String(e.name)}" does not accept multiple positional arguments`)}return n.length===1&&t.length===1&&S(t[0])&&e[h]?{[n[0]??"arg0"]:t[0]}:n.length===1&&t.length===1&&te(t[0],n[0])||t.length===1&&S(t[0])&&n.length>1?t[0]:Object.fromEntries(t.map((a,o)=>[n[o]??`arg${o}`,a]))}}function S(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function te(e,t){if(!t||!S(e))return!1;let n=Object.keys(e);return n.length===1&&n[0]===t}import{hashSchemaSync as ce}from"@manifesto-ai/core";import{compileMelDomain as ne,parse as ae,tokenize as re}from"@manifesto-ai/compiler";function V(e){let t=ne(e,{mode:"domain"});if(t.errors.length>0){let a=t.errors.map(o=>{let i=o.location;if(!i||i.start.line===0&&i.start.column===0)return`[${o.code}] ${o.message}`;let r=`[${o.code}] ${o.message} (${i.start.line}:${i.start.column})`,s=e.split(`
2
- `)[i.start.line-1];if(!s)return r;let m=String(i.start.line).padStart(4," "),c=Math.max(1,i.end.line===i.start.line?Math.min(i.end.column-i.start.column,Math.max(1,s.length-i.start.column+1)):1),f=" ".repeat(m.length+3+i.start.column-1);return`${r}
1
+ import{a as v}from"./chunk-EPGBNDYU.js";import{a as d,b as h,d as w,e as x,f as I,j as y,k as E,l as k,r as _}from"./chunk-7TMADY2E.js";import{a as l,b,c as g,d as B,e as F}from"./chunk-BDIXNUQ3.js";import{createHostContextProvider as J,createHost as Y,defaultRuntime as X}from"@manifesto-ai/host";import{extractDefaults as Q}from"@manifesto-ai/core";import{semanticPathToPatchPath as K}from"@manifesto-ai/core";function U(e){return typeof e=="object"&&e!==null&&"key"in e&&"into"in e}function N(e,t){if(U(e))return{patches:[{op:"set",path:L(e.into),value:q(e.key)}]};let{path:n,target:a}=e,r=W(n,t);return a?{patches:[{op:"set",path:L(a),value:r.value}]}:{patches:[]}}function q(e){switch(e){case"uuid":return y();case"timestamp":case"time.now":return Date.now();case"isoTimestamp":return new Date().toISOString();default:return null}}function L(e){let t=H(e),n=t.startsWith("data.")?t.slice(5):t;return K(n)}function H(e){return e.startsWith("/")?e.slice(1).replace(/\//g,"."):e}function W(e,t){let a=H(e).split(".");if(a.length===0)return{value:void 0,found:!1};let[r,...i]=a,o;switch(r){case"data":o=t.data;break;case"computed":o=t.computed;break;case"system":o=t.system;break;case"meta":o=t.meta;break;default:o=t.data,i.unshift(r);break}for(let s of i){if(o==null||typeof o!="object")return{value:void 0,found:!1};o=o[s]}return{value:o,found:o!==void 0}}var u="system.get",j="system.",$=Object.freeze({__baseLaws:!0});function P(e,t,n){let a=X,r=Y(e,{initialData:Q(e.state),runtime:a}),i=J(a);r.registerEffect(u,async(o,s,m)=>{let{patches:c}=N(s,m.snapshot);return c});for(let[o,s]of Object.entries(n)){let m=async(c,f,p)=>await s(f,{snapshot:I(x(p.snapshot,t))});r.registerEffect(o,m)}return{host:r,contextProvider:i}}import{createIntent as Z}from"@manifesto-ai/core";function M(){return(e,...t)=>{let n=e,a=y(),r=ee(n,t);return Z(String(e.name),r,a)}}function ee(e,t){let n=Object.hasOwn(e,d)?e[d]:[];if(t.length!==0){if(n===null){if(t.length===1&&S(t[0]))return t[0];throw new l("INVALID_INTENT_ARGS",`Action "${String(e.name)}" requires a single object argument because positional parameter metadata is unavailable`)}if(n.length===0){if(t.length===1)return t[0];throw new l("INVALID_INTENT_ARGS",`Action "${String(e.name)}" does not accept multiple positional arguments`)}return n.length===1&&t.length===1&&S(t[0])&&e[h]?{[n[0]??"arg0"]:t[0]}:n.length===1&&t.length===1&&te(t[0],n[0])||t.length===1&&S(t[0])&&n.length>1?t[0]:Object.fromEntries(t.map((a,r)=>[n[r]??`arg${r}`,a]))}}function S(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function te(e,t){if(!t||!S(e))return!1;let n=Object.keys(e);return n.length===1&&n[0]===t}import{hashSchemaSync as ce}from"@manifesto-ai/core";import{compileMelDomain as ne,parse as ae,tokenize as oe}from"@manifesto-ai/compiler";function V(e){let t=ne(e,{mode:"domain"});if(t.errors.length>0){let a=t.errors.map(r=>{let i=r.location;if(!i||i.start.line===0&&i.start.column===0)return`[${r.code}] ${r.message}`;let o=`[${r.code}] ${r.message} (${i.start.line}:${i.start.column})`,s=e.split(`
2
+ `)[i.start.line-1];if(!s)return o;let m=String(i.start.line).padStart(4," "),c=Math.max(1,i.end.line===i.start.line?Math.min(i.end.column-i.start.column,Math.max(1,s.length-i.start.column+1)):1),f=" ".repeat(m.length+3+i.start.column-1);return`${o}
3
3
  ${m} | ${s}
4
4
  ${f}${"^".repeat(c)}`}).join(`
5
5
 
6
6
  `);throw new g(t.errors,`MEL compilation failed:
7
- ${a}`)}if(!t.schema)throw new l("COMPILE_ERROR","MEL compilation produced no schema");let n=t.schema;return{schema:n,actionParamMetadata:O(n,se(e)),actionSingleParamObjectValueMetadata:T(n)}}function O(e,t){return Object.freeze(Object.fromEntries(Object.entries(e.actions).map(([n,a])=>{let o=t?.[n];if(o&&o.length>0)return[n,Object.freeze([...o])];if(a.params&&a.params.length>0){let r=Object.freeze([...a.params]);return[n,r]}if(!a.input||a.input.type!=="object"||!a.input.fields)return[n,[]];let i=oe(a.input);return[n,i.length<=1?i:null]})))}function T(e){return Object.freeze(Object.fromEntries(Object.entries(e.actions).map(([t,n])=>[t,ie(e,n)])))}function oe(e){return!e||e.type!=="object"||!e.fields?[]:Object.keys(e.fields)}function ie(e,t){if(t.params?.length===1&&t.inputType){let n=A(t.inputType,t.params[0]??"",e.types);return n?R(n,e.types):!1}if(t.input?.type==="object"&&t.input.fields&&Object.keys(t.input.fields).length===1){let[n]=Object.keys(t.input.fields);return(n?t.input.fields[n]:void 0)?.type==="object"}return!1}function A(e,t,n,a=[]){if(e.kind==="ref"){if(a.includes(e.name))return null;let o=n[e.name];return o?A(o.definition,t,n,[...a,e.name]):null}if(e.kind==="union"){let o=e.types.filter(i=>!C(i,n,a));return o.length===1?A(o[0],t,n,a):null}return e.kind!=="object"?null:e.fields[t]?.type??null}function R(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let a=t[e.name];return a?R(a.definition,t,[...n,e.name]):!1}if(e.kind==="union"){let a=e.types.filter(o=>!C(o,t,n));return a.length===1?R(a[0],t,n):!1}return e.kind==="object"||e.kind==="record"||e.kind==="primitive"&&e.type==="object"}function C(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let a=t[e.name];return a?C(a.definition,t,[...n,e.name]):!1}return e.kind==="primitive"&&e.type==="null"||e.kind==="literal"&&e.value===null}function se(e){let t=re(e);if(t.diagnostics.some(a=>a.severity==="error"))return;let n=ae(t.tokens);if(n.program)return Object.freeze(Object.fromEntries(n.program.domain.members.filter(a=>a.kind==="action").map(a=>[a.name,Object.freeze(a.params.map(o=>o.name))])))}function G(e){if(typeof e!="string"&&le(e))throw new l("SCHEMA_ERROR","DomainModule is a compiler tooling artifact. Pass module.schema or MEL source to createManifesto().");let t=typeof e=="string"?V(e):{schema:e,actionParamMetadata:O(e),actionSingleParamObjectValueMetadata:T(e)},n=me(t.schema);return fe(n),{schema:n,actionParamMetadata:t.actionParamMetadata,actionSingleParamObjectValueMetadata:t.actionSingleParamObjectValueMetadata,projectionPlan:w(n)}}function le(e){return typeof e=="object"&&e!==null&&"schema"in e&&"graph"in e&&"annotations"in e}function me(e){let t={...e.state.fields},n=!1;if(!t.$host)t.$host={type:"object",required:!1,default:{}},n=!0;else{if(t.$host.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$host' must be an object field");t.$host.default===void 0&&(t.$host={...t.$host,default:{}},n=!0)}if(!t.$mel)t.$mel={type:"object",required:!1,default:{guards:{intent:{}}},fields:{guards:{type:"object",required:!1,default:{intent:{}},fields:{intent:{type:"object",required:!1,default:{}}}}}},n=!0;else{if(t.$mel.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel' must be an object field");{let r=t.$mel;r.default===void 0&&(r={...r,default:{guards:{intent:{}}}},n=!0);let s=r.fields??{},m=s.guards;if(!m)r={...r,fields:{...s,guards:{type:"object",required:!1,default:{intent:{}},fields:{intent:{type:"object",required:!1,default:{}}}}}},n=!0;else{if(m.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel.guards' must be an object field");{let c=m;c.default===void 0&&(c={...c,default:{intent:{}}},n=!0);let f=c.fields??{},p=f.intent;if(!p)c={...c,fields:{...f,intent:{type:"object",required:!1,default:{}}}},n=!0;else{if(p.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel.guards.intent' must be an object field");p.default===void 0&&(c={...c,fields:{...f,intent:{...p,default:{}}}},n=!0)}c!==m&&(r={...r,fields:{...s,guards:c}})}}r!==t.$mel&&(t.$mel=r)}}if(!n)return e;let a={...e,state:{...e.state,fields:t}},{hash:o,...i}=a;return{...a,hash:ce(i)}}function fe(e){for(let t of Object.keys(e.actions??{}))if(t.startsWith(j))throw new l("RESERVED_NAMESPACE",`Action type "${t}" uses reserved namespace prefix "${j}"`)}function D(e,t,n){let a=Object.fromEntries(Object.keys(e.actions).map(r=>{let s={__kind:"ActionRef",name:r};return Object.defineProperty(s,d,{enumerable:!1,configurable:!1,writable:!1,value:Object.hasOwn(t,r)?t[r]:[]}),Object.defineProperty(s,h,{enumerable:!1,configurable:!1,writable:!1,value:n[r]??!1}),[r,Object.freeze(s)]})),o=Object.fromEntries(Object.keys(e.state.fields).filter(r=>!r.startsWith("$")).map(r=>[r,Object.freeze({__kind:"FieldRef",name:r})])),i=Object.fromEntries(Object.keys(e.computed.fields).map(r=>[r,Object.freeze({__kind:"ComputedRef",name:r})]));return Object.freeze({actions:Object.freeze(a),state:Object.freeze(o),computed:Object.freeze(i)})}function z(e,t){if(u in t)throw new b(u);let n=G(e),a={_laws:$,schema:n.schema,activate(){_(a);let o=P(n.schema,n.projectionPlan,t);return v(E({schema:n.schema,projectionPlan:n.projectionPlan,host:o.host,hostContextProvider:o.contextProvider,MEL:D(n.schema,n.actionParamMetadata,n.actionSingleParamObjectValueMetadata),createIntent:M()}))}};return k(a,()=>{let o=P(n.schema,n.projectionPlan,t);return E({schema:n.schema,projectionPlan:n.projectionPlan,host:o.host,hostContextProvider:o.contextProvider,MEL:D(n.schema,n.actionParamMetadata,n.actionSingleParamObjectValueMetadata),createIntent:M()})})}import{createSnapshot as et}from"@manifesto-ai/core";export{F as AlreadyActivatedError,g as CompileError,B as DisposedError,l as ManifestoError,b as ReservedEffectError,z as createManifesto,et as createSnapshot};
7
+ ${a}`)}if(!t.schema)throw new l("COMPILE_ERROR","MEL compilation produced no schema");let n=t.schema;return{schema:n,actionParamMetadata:O(n,se(e)),actionSingleParamObjectValueMetadata:T(n)}}function O(e,t){return Object.freeze(Object.fromEntries(Object.entries(e.actions).map(([n,a])=>{let r=t?.[n];if(r&&r.length>0)return[n,Object.freeze([...r])];if(a.params&&a.params.length>0){let o=Object.freeze([...a.params]);return[n,o]}if(!a.input||a.input.type!=="object"||!a.input.fields)return[n,[]];let i=re(a.input);return[n,i.length<=1?i:null]})))}function T(e){return Object.freeze(Object.fromEntries(Object.entries(e.actions).map(([t,n])=>[t,ie(e,n)])))}function re(e){return!e||e.type!=="object"||!e.fields?[]:Object.keys(e.fields)}function ie(e,t){if(t.params?.length===1&&t.inputType){let n=R(t.inputType,t.params[0]??"",e.types);return n?A(n,e.types):!1}if(t.input?.type==="object"&&t.input.fields&&Object.keys(t.input.fields).length===1){let[n]=Object.keys(t.input.fields);return(n?t.input.fields[n]:void 0)?.type==="object"}return!1}function R(e,t,n,a=[]){if(e.kind==="ref"){if(a.includes(e.name))return null;let r=n[e.name];return r?R(r.definition,t,n,[...a,e.name]):null}if(e.kind==="union"){let r=e.types.filter(i=>!C(i,n,a));return r.length===1?R(r[0],t,n,a):null}return e.kind!=="object"?null:e.fields[t]?.type??null}function A(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let a=t[e.name];return a?A(a.definition,t,[...n,e.name]):!1}if(e.kind==="union"){let a=e.types.filter(r=>!C(r,t,n));return a.length===1?A(a[0],t,n):!1}return e.kind==="object"||e.kind==="record"||e.kind==="primitive"&&e.type==="object"}function C(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let a=t[e.name];return a?C(a.definition,t,[...n,e.name]):!1}return e.kind==="primitive"&&e.type==="null"||e.kind==="literal"&&e.value===null}function se(e){let t=oe(e);if(t.diagnostics.some(a=>a.severity==="error"))return;let n=ae(t.tokens);if(n.program)return Object.freeze(Object.fromEntries(n.program.domain.members.filter(a=>a.kind==="action").map(a=>[a.name,Object.freeze(a.params.map(r=>r.name))])))}function G(e){if(typeof e!="string"&&le(e))throw new l("SCHEMA_ERROR","DomainModule is a compiler tooling artifact. Pass module.schema or MEL source to createManifesto().");let t=typeof e=="string"?V(e):{schema:e,actionParamMetadata:O(e),actionSingleParamObjectValueMetadata:T(e)},n=me(t.schema);return fe(n),{schema:n,actionParamMetadata:t.actionParamMetadata,actionSingleParamObjectValueMetadata:t.actionSingleParamObjectValueMetadata,projectionPlan:w(n)}}function le(e){return typeof e=="object"&&e!==null&&"schema"in e&&"graph"in e&&"annotations"in e}function me(e){let t={...e.state.fields},n=!1;if(!t.$host)t.$host={type:"object",required:!1,default:{}},n=!0;else{if(t.$host.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$host' must be an object field");t.$host.default===void 0&&(t.$host={...t.$host,default:{}},n=!0)}if(!t.$mel)t.$mel={type:"object",required:!1,default:{guards:{intent:{}}},fields:{guards:{type:"object",required:!1,default:{intent:{}},fields:{intent:{type:"object",required:!1,default:{}}}}}},n=!0;else{if(t.$mel.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel' must be an object field");{let o=t.$mel;o.default===void 0&&(o={...o,default:{guards:{intent:{}}}},n=!0);let s=o.fields??{},m=s.guards;if(!m)o={...o,fields:{...s,guards:{type:"object",required:!1,default:{intent:{}},fields:{intent:{type:"object",required:!1,default:{}}}}}},n=!0;else{if(m.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel.guards' must be an object field");{let c=m;c.default===void 0&&(c={...c,default:{intent:{}}},n=!0);let f=c.fields??{},p=f.intent;if(!p)c={...c,fields:{...f,intent:{type:"object",required:!1,default:{}}}},n=!0;else{if(p.type!=="object")throw new l("SCHEMA_ERROR","Reserved namespace '$mel.guards.intent' must be an object field");p.default===void 0&&(c={...c,fields:{...f,intent:{...p,default:{}}}},n=!0)}c!==m&&(o={...o,fields:{...s,guards:c}})}}o!==t.$mel&&(t.$mel=o)}}if(!n)return e;let a={...e,state:{...e.state,fields:t}},{hash:r,...i}=a;return{...a,hash:ce(i)}}function fe(e){for(let t of Object.keys(e.actions??{}))if(t.startsWith(j))throw new l("RESERVED_NAMESPACE",`Action type "${t}" uses reserved namespace prefix "${j}"`)}function D(e,t,n){let a=Object.fromEntries(Object.keys(e.actions).map(o=>{let s={__kind:"ActionRef",name:o};return Object.defineProperty(s,d,{enumerable:!1,configurable:!1,writable:!1,value:Object.hasOwn(t,o)?t[o]:[]}),Object.defineProperty(s,h,{enumerable:!1,configurable:!1,writable:!1,value:n[o]??!1}),[o,Object.freeze(s)]})),r=Object.fromEntries(Object.keys(e.state.fields).filter(o=>!o.startsWith("$")).map(o=>[o,Object.freeze({__kind:"FieldRef",name:o})])),i=Object.fromEntries(Object.keys(e.computed.fields).map(o=>[o,Object.freeze({__kind:"ComputedRef",name:o})]));return Object.freeze({actions:Object.freeze(a),state:Object.freeze(r),computed:Object.freeze(i)})}function z(e,t){if(u in t)throw new b(u);let n=G(e),a={_laws:$,schema:n.schema,activate(){_(a);let r=P(n.schema,n.projectionPlan,t);return v(E({schema:n.schema,projectionPlan:n.projectionPlan,host:r.host,hostContextProvider:r.contextProvider,MEL:D(n.schema,n.actionParamMetadata,n.actionSingleParamObjectValueMetadata),createIntent:M()}))}};return k(a,()=>{let r=P(n.schema,n.projectionPlan,t);return E({schema:n.schema,projectionPlan:n.projectionPlan,host:r.host,hostContextProvider:r.contextProvider,MEL:D(n.schema,n.actionParamMetadata,n.actionSingleParamObjectValueMetadata),createIntent:M()})})}import{createSnapshot as et}from"@manifesto-ai/core";export{F as AlreadyActivatedError,g as CompileError,B as DisposedError,l as ManifestoError,b as ReservedEffectError,z as createManifesto,et as createSnapshot};
package/dist/types.d.ts CHANGED
@@ -265,6 +265,8 @@ export type ManifestoBaseInstance<T extends ManifestoDomainShape> = {
265
265
  readonly schema: DomainSchema;
266
266
  readonly dispose: () => void;
267
267
  };
268
+ export type ManifestoLegalityRuntime<T extends ManifestoDomainShape> = Pick<ManifestoBaseInstance<T>, "createIntent" | "whyNot" | "simulate" | "MEL">;
269
+ export type ManifestoDispatchRuntime<T extends ManifestoDomainShape> = Pick<ManifestoBaseInstance<T>, "dispatchAsync" | "dispatchAsyncWithReport">;
268
270
  export interface ManifestoRuntimeByLaws<T extends ManifestoDomainShape> {
269
271
  readonly base: ManifestoBaseInstance<T>;
270
272
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@manifesto-ai/sdk",
3
- "version": "3.17.2",
3
+ "version": "3.17.3",
4
4
  "description": "Manifesto SDK - Activation-first public API for the base runtime",
5
5
  "author": "eggplantiny <eggplantiny@gmail.com>",
6
6
  "license": "MIT",
@@ -47,8 +47,8 @@
47
47
  "dist"
48
48
  ],
49
49
  "dependencies": {
50
- "@manifesto-ai/compiler": "3.8.0",
51
50
  "@manifesto-ai/host": "2.9.1",
51
+ "@manifesto-ai/compiler": "3.8.0",
52
52
  "@manifesto-ai/core": "2.13.0"
53
53
  },
54
54
  "devDependencies": {