@manifesto-ai/sdk 3.18.1 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -14
- package/dist/chunk-DPFMD6LR.js +1 -0
- package/dist/chunk-OW22XF26.js +1 -0
- package/dist/chunk-TG2UPPZN.js +1 -0
- package/dist/compat/internal.d.ts +5 -84
- package/dist/effects.d.ts +2 -2
- package/dist/effects.js +1 -1
- package/dist/errors.d.ts +4 -0
- package/dist/extensions-types.d.ts +7 -5
- package/dist/extensions.js +1 -1
- package/dist/index.d.ts +13 -2
- package/dist/index.js +6 -6
- package/dist/manifest/compile-schema.d.ts +3 -1
- package/dist/manifest/create-manifesto.d.ts +2 -2
- package/dist/manifest/resolve-schema.d.ts +2 -2
- package/dist/manifest/shared.d.ts +3 -1
- package/dist/manifest.d.ts +1 -1
- package/dist/projection/snapshot-projection.d.ts +11 -13
- package/dist/provider.d.ts +12 -1
- package/dist/provider.js +1 -1
- package/dist/runtime/action-payload.d.ts +9 -0
- package/dist/runtime/admission-failure.d.ts +16 -0
- package/dist/runtime/admission.d.ts +6 -5
- package/dist/runtime/base-dispatch.d.ts +12 -10
- package/dist/runtime/base-runtime.d.ts +9 -2
- package/dist/runtime/context.d.ts +4 -0
- package/dist/runtime/facets.d.ts +13 -10
- package/dist/runtime/kernel-contract.d.ts +111 -0
- package/dist/runtime/kernel.d.ts +1 -1
- package/dist/runtime/publication.d.ts +3 -4
- package/dist/runtime/reports.d.ts +3 -3
- package/dist/runtime/simulation.d.ts +1 -1
- package/dist/runtime/state-store.d.ts +1 -1
- package/dist/types.d.ts +425 -45
- package/package.json +8 -8
- package/dist/chunk-BDIXNUQ3.js +0 -1
- package/dist/chunk-BSGOCNTO.js +0 -1
- package/dist/chunk-JM42OG2H.js +0 -1
- package/dist/manifest/system-get.d.ts +0 -4
- package/dist/runtime/events.d.ts +0 -7
package/README.md
CHANGED
|
@@ -1,43 +1,59 @@
|
|
|
1
1
|
# @manifesto-ai/sdk
|
|
2
2
|
|
|
3
|
-
>
|
|
3
|
+
> Base runtime entry point for Manifesto applications.
|
|
4
4
|
|
|
5
|
-
`@manifesto-ai/sdk` is the
|
|
5
|
+
`@manifesto-ai/sdk` is the package most apps should start with. It turns a MEL
|
|
6
|
+
domain into an activated runtime with typed actions, `snapshot()` reads, and
|
|
7
|
+
subscriptions.
|
|
6
8
|
|
|
7
|
-
|
|
9
|
+
For the step-by-step app path, start with the main
|
|
10
|
+
[Quick Start](../../docs/guide/quick-start.md) and
|
|
11
|
+
[Tutorial](../../docs/tutorial/index.md). Use the package-level spec only when
|
|
12
|
+
you need the exact runtime contract.
|
|
8
13
|
|
|
9
14
|
## When to Use It
|
|
10
15
|
|
|
11
16
|
Use the SDK when you want:
|
|
12
17
|
|
|
13
18
|
- the shortest path to a running base runtime
|
|
14
|
-
- typed
|
|
19
|
+
- typed action submission through `action.*`
|
|
15
20
|
- optional typed effect authoring through `@manifesto-ai/sdk/effects`
|
|
16
|
-
-
|
|
17
|
-
-
|
|
18
|
-
-
|
|
21
|
+
- action check/preview/submit, observers, availability queries, optional diagnostics, and `snapshot()` reads in one package
|
|
22
|
+
- generated domain facades from `@manifesto-ai/codegen`
|
|
23
|
+
- advanced inspection and simulation helpers when you are building tools around an app
|
|
19
24
|
|
|
20
25
|
## Smallest Example
|
|
21
26
|
|
|
22
27
|
```typescript
|
|
23
28
|
import { createManifesto } from "@manifesto-ai/sdk";
|
|
29
|
+
import TodoMel from "./domain/todo.mel";
|
|
30
|
+
import type { TodoDomain } from "./domain/todo.domain";
|
|
24
31
|
|
|
25
|
-
const manifesto = createManifesto<
|
|
26
|
-
const
|
|
32
|
+
const manifesto = createManifesto<TodoDomain>(TodoMel, {});
|
|
33
|
+
const app = manifesto.activate();
|
|
27
34
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
console.log(instance.getSnapshot().data.count);
|
|
35
|
+
await app.action.addTodo.submit("Review docs");
|
|
36
|
+
console.log(app.snapshot().state.todos);
|
|
31
37
|
```
|
|
32
38
|
|
|
33
|
-
|
|
39
|
+
The base runtime covers the ordinary app loop: submit typed actions, read
|
|
40
|
+
snapshots, and observe state or lifecycle events. Availability, preview, and
|
|
41
|
+
inspection helpers are available when UI, agent, or debugging tooling needs
|
|
42
|
+
them.
|
|
34
43
|
|
|
35
44
|
Effect authoring helpers live on the dedicated `@manifesto-ai/sdk/effects` subpath. The root package stays centered on `createManifesto()`.
|
|
36
45
|
|
|
37
|
-
If you need review, approval,
|
|
46
|
+
If you need review, approval, policy, audit history, or restore later,
|
|
47
|
+
compose optional `@manifesto-ai/lineage` and `@manifesto-ai/governance`
|
|
48
|
+
extensions before `activate()`.
|
|
49
|
+
If you are building low-level runtime tooling after activation, use
|
|
50
|
+
`@manifesto-ai/sdk/extensions`.
|
|
38
51
|
|
|
39
52
|
## Docs
|
|
40
53
|
|
|
54
|
+
- [Quick Start](../../docs/guide/quick-start.md)
|
|
55
|
+
- [React Integration](../../docs/integration/react.md)
|
|
56
|
+
- [Web App + Agent](../../docs/integration/web-app-and-agent.md)
|
|
41
57
|
- [Public API Reference](../../docs/api/sdk.md)
|
|
42
58
|
- [SDK Guide](docs/GUIDE.md)
|
|
43
59
|
- [SDK Specification](docs/sdk-SPEC.md)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as C,e as q}from"./chunk-TG2UPPZN.js";import{evaluateComputed as ft,evaluateActionAvailability as mt,evaluateAvailableActions as ht,evaluateIntentDispatchability as yt,isErr as St}from"@manifesto-ai/core";import{extractSchemaGraph as bt}from"@manifesto-ai/compiler";function gt(e){return{visibleComputedKeys:Object.keys(e.computed.fields)}}function J(e,t){return{state:$e(e.state),computed:qe(e.computed,t),system:{status:e.system.status,lastError:e.system.lastError},meta:{schemaHash:e.meta.schemaHash}}}function jt(e,t){return J(e,t)}function I(e){return me(structuredClone(e))}function fe(e,t){return Je(e,t)}function $e(e){return structuredClone(e)}function qe(e,t){let n={};for(let o of t.visibleComputedKeys)Object.prototype.hasOwnProperty.call(e,o)&&(n[o]=e[o]);return structuredClone(n)}function Je(e,t){return D(e,t,new WeakMap)}function D(e,t,n){if(Object.is(e,t))return!0;if(typeof e!=typeof t)return!1;if(e===null||t===null)return e===t;if(typeof e!="object"||typeof t!="object")return!1;let o=e,a=t,y=Object.prototype.toString.call(o),i=Object.prototype.toString.call(a);if(y!==i)return!1;let r=n.get(o);if(r?.has(a))return!0;if(r||(r=new WeakSet,n.set(o,r)),r.add(a),Array.isArray(o)&&Array.isArray(a)){if(o.length!==a.length)return!1;for(let c=0;c<o.length;c+=1){let h=Object.prototype.hasOwnProperty.call(o,c),x=Object.prototype.hasOwnProperty.call(a,c);if(h!==x||h&&!D(o[c],a[c],n))return!1}return!0}if(o instanceof Date&&a instanceof Date)return o.getTime()===a.getTime();if(o instanceof RegExp&&a instanceof RegExp)return o.source===a.source&&o.flags===a.flags;if(ArrayBuffer.isView(o)&&ArrayBuffer.isView(a)){if(o.constructor!==a.constructor||o.byteLength!==a.byteLength)return!1;let c=new Uint8Array(o.buffer,o.byteOffset,o.byteLength),h=new Uint8Array(a.buffer,a.byteOffset,a.byteLength);return c.every((x,T)=>x===h[T])}if(o instanceof ArrayBuffer&&a instanceof ArrayBuffer){if(o.byteLength!==a.byteLength)return!1;let c=new Uint8Array(o),h=new Uint8Array(a);return c.every((x,T)=>x===h[T])}if(o instanceof Map&&a instanceof Map){if(o.size!==a.size)return!1;let c=Array.from(o.entries()),h=Array.from(a.entries());return c.every(([x,T],b)=>{let g=h[b];if(!g)return!1;let[A,k]=g;return D(x,A,n)&&D(T,k,n)})}if(o instanceof Set&&a instanceof Set){if(o.size!==a.size)return!1;let c=Array.from(o.values()),h=Array.from(a.values());return c.every((x,T)=>D(x,h[T],n))}let l=ue(o),u=ue(a);if(l.length!==u.length)return!1;for(let c=0;c<l.length;c+=1){let h=l[c],x=u[c];if(h!==x)return!1;let T=o[h],b=a[x];if(!D(T,b,n))return!1}return!0}function ue(e){return Object.keys(e).filter(t=>e[t]!==void 0).sort()}function me(e,t=new WeakSet){if(e==null||typeof e!="object")return e;if(de(e))return he(e);let n=e;if(t.has(n)||Object.isFrozen(e))return e;t.add(n);for(let o of Reflect.ownKeys(n)){let a=n[o];if(de(a)){We(n,o,a);continue}me(a,t)}return Object.freeze(e)}function de(e){return e instanceof ArrayBuffer||ArrayBuffer.isView(e)}function he(e){return structuredClone(e)}function We(e,t,n){let o=Object.getOwnPropertyDescriptor(e,t);!o||!("value"in o)||Object.defineProperty(e,t,{enumerable:o.enumerable??!0,configurable:!1,get(){return he(n)}})}var W=Symbol("manifesto-sdk.action-param-names"),Xe=Symbol("manifesto-sdk.action-single-param-object-value"),F=Symbol("manifesto-sdk.runtime-kernel-factory"),z=Symbol("manifesto-sdk.activation-state"),w=Symbol("manifesto-sdk.extension-kernel");var Ye=/^(state|computed|action):.+$/;function X(e){let t=new Set(e.nodes.map(r=>r.id)),n=new Map,o=new Map,a=(r,l,u)=>{let c=r.get(l);if(c){c.add(u);return}r.set(l,new Set([u]))};for(let r of e.edges)a(n,r.from,r.to),a(o,r.to,r.from);let y=r=>{let l=Object.freeze({nodes:Object.freeze(e.nodes.filter(u=>r.has(u.id))),edges:Object.freeze(e.edges.filter(u=>r.has(u.from)&&r.has(u.to)))});return X(l)},i=(r,l)=>{let u=Qe(r,t),c=[u],h=new Set([u]),x=l==="incoming"?o:n;for(;c.length>0;){let T=c.shift();if(T)for(let b of x.get(T)??[])h.has(b)||(h.add(b),c.push(b))}return y(h)};return Object.freeze({nodes:e.nodes,edges:e.edges,traceUp(r){return i(r,"incoming")},traceDown(r){return i(r,"outgoing")}})}function Qe(e,t){if(typeof e=="string"){if(!Ye.test(e))throw new C("SCHEMA_ERROR",'SchemaGraph node id must use "state:<name>", "computed:<name>", or "action:<name>"');if(!t.has(e))throw new C("SCHEMA_ERROR",`Unknown SchemaGraph node id "${e}"`);return e}let n;switch(e.__kind){case"ActionRef":n=`action:${String(e.name)}`;break;case"FieldRef":n=`state:${e.name}`;break;case"ComputedRef":n=`computed:${e.name}`;break;default:throw new C("SCHEMA_ERROR","Unsupported SchemaGraph ref lookup target")}if(!t.has(n))throw new C("SCHEMA_ERROR",`SchemaGraph node "${n}" is not part of the projected graph`);return n}import{validateIntentInput as tt}from"@manifesto-ai/core";function Se({getAvailableActionsFor:e,projectSnapshotFromCanonical:t}){function n(i,r){let l=e(i),u=e(r),c=Object.freeze(u.filter(x=>!l.includes(x))),h=Object.freeze(l.filter(x=>!u.includes(x)));return Object.freeze({before:l,after:u,unlocked:c,locked:h})}function o(i,r){let l=I(i),u=I(r),c=t(l),h=t(u);return Object.freeze({projected:Object.freeze({beforeSnapshot:c,afterSnapshot:h,changedPaths:B(c,h),availability:n(l,u)}),canonical:Object.freeze({beforeCanonicalSnapshot:l,afterCanonicalSnapshot:u,pendingRequirements:u.system.pendingRequirements,status:u.system.status})})}function a(i,r){let l=et(i),u=l;return Object.freeze({message:l.message,...typeof u.code=="string"?{code:u.code}:{},...typeof l.name=="string"?{name:l.name}:{},stage:r})}function y(i){return Object.freeze({hostTraces:I(i.traces)})}return Object.freeze({deriveExecutionOutcome:o,classifyExecutionFailure:a,createExecutionDiagnostics:y})}function B(e,t){let n=new Map,o=new WeakMap,a=(i,r)=>{let l=Ze(i);n.set(l,Object.freeze({path:Object.freeze([...i]),kind:r}))},y=(i,r,l)=>{if(Object.is(i,r))return;if(i===null||r===null){a(l,"changed");return}if(typeof i!="object"||typeof r!="object"){a(l,"changed");return}let u=i,c=r,h=o.get(u);if(h?.has(c))return;if(h?h.add(c):o.set(u,new WeakSet([c])),Array.isArray(i)||Array.isArray(r)){if(!Array.isArray(i)||!Array.isArray(r)){a(l,"changed");return}let T=Math.max(i.length,r.length);for(let b=0;b<T;b+=1){let g=Object.prototype.hasOwnProperty.call(i,b),A=Object.prototype.hasOwnProperty.call(r,b),k=[...l,b];if(g!==A){a(k,g?"unset":"set");continue}!g&&!A||y(i[b],r[b],k)}return}if(!ye(i)||!ye(r)){a(l,"changed");return}let x=new Set([...Object.keys(i),...Object.keys(r)]);for(let T of[...x].sort()){let b=Object.prototype.hasOwnProperty.call(i,T),g=Object.prototype.hasOwnProperty.call(r,T),A=[...l,T];if(b!==g){a(A,b?"unset":"set");continue}y(i[T],r[T],A)}};return y(e.state,t.state,["state"]),y(e.computed,t.computed,["computed"]),y(e.system,t.system,["system"]),y(e.meta,t.meta,["meta"]),Object.freeze([...n.entries()].sort(([i],[r])=>i.localeCompare(r)).map(([,i])=>i))}function ye(e){return Object.prototype.toString.call(e)==="[object Object]"}function Ze(e){return e.map(t=>typeof t=="number"?`[${t}]`:t).join(".")}function et(e){return e instanceof Error?e:new Error(String(e))}function be({schema:e,ensureIntentId:t,getAvailableActionsFor:n,isActionAvailableFor:o,evaluateActionAvailabilityFor:a,evaluateIntentDispatchabilityFor:y,projectSnapshotFromCanonical:i,getSimulateSync:r}){function l(S,m,p){return Object.freeze({layer:S,expression:m,evaluatedResult:!1,...p!==void 0?{description:p}:{}})}function u(S,m){let p=m.type,d=e.actions[p];if(!d)return Object.freeze([]);let R=a(S,p);if(R.kind==="error")return Object.freeze(d.available?[l("available",d.available,R.message)]:[]);if(!R.available)return Object.freeze(d.available?[l("available",d.available,d.description)]:[]);let E=y(S,m);return E.kind==="error"?Object.freeze(d.dispatchable?[l("dispatchable",d.dispatchable,E.message)]:[]):E.dispatchable?Object.freeze([]):Object.freeze(d.dispatchable?[l("dispatchable",d.dispatchable,d.description)]:[])}function c(S){return new C("ACTION_UNAVAILABLE",`Action "${S.type}" is unavailable against the current visible snapshot`)}function h(S){return new C("INTENT_NOT_DISPATCHABLE",`Action "${S.type}" is available, but the bound intent is not dispatchable against the current visible snapshot`)}function x(S){return new C("INVALID_INPUT",S)}function T(S,m){let p=tt(e,m);return p?x(p):null}function b(S,m){let p=t(m),d=p.type;if(!o(S,d))return{kind:"unavailable",intent:p,actionName:d};let R=T(S,p);if(R)return{kind:"invalid-input",intent:p,actionName:d,error:R};let E=u(S,p);return E.length>0?{kind:"not-dispatchable",intent:p,actionName:d,blockers:E}:{kind:"admitted",intent:p,actionName:d}}function g(S,m){return m.kind==="unavailable"?Object.freeze({kind:"blocked",actionName:m.actionName,failure:{kind:"unavailable",blockers:u(S,m.intent)}}):m.kind==="invalid-input"?Object.freeze({kind:"blocked",actionName:m.actionName,failure:{kind:"invalid_input",error:{code:"INVALID_INPUT",message:m.error.message}}}):m.kind==="not-dispatchable"?Object.freeze({kind:"blocked",actionName:m.actionName,failure:{kind:"not_dispatchable",blockers:m.blockers}}):Object.freeze({kind:"admitted",actionName:m.actionName})}function A(S,m){let p=b(S,m);if(p.kind==="unavailable")return Object.freeze({kind:"blocked",actionName:p.actionName,available:!1,dispatchable:!1,blockers:u(S,p.intent)});if(p.kind==="invalid-input")throw p.error;if(p.kind==="not-dispatchable")return Object.freeze({kind:"blocked",actionName:p.actionName,available:!0,dispatchable:!1,blockers:p.blockers});let d=r()(S,p.intent),R=i(S),E=i(d.snapshot);return Object.freeze({kind:"admitted",actionName:p.actionName,available:!0,dispatchable:!0,status:d.status,requirements:d.requirements,canonicalSnapshot:d.snapshot,snapshot:E,newAvailableActions:n(d.snapshot),changedPaths:B(R,E)})}function k(S,m){throw m}function P(S){return k(S,c(S))}function M(S,m){return k(S,x(m))}function _(S){return k(S,h(S))}return Object.freeze({getIntentBlockersFor:u,validateIntentInputFor:T,evaluateIntentLegalityFor:b,deriveIntentAdmission:g,explainIntentFor:A,createUnavailableError:c,createNotDispatchableError:h,rejectInvalidInput:M,rejectUnavailable:P,rejectNotDispatchable:_})}function Te({setVisibleSnapshot:e,restoreVisibleSnapshot:t,getCanonicalSnapshot:n}){function o(i,r){return e(i,r)}function a(i){let r=o(i);return Object.freeze({publishedSnapshot:r,publishedCanonicalSnapshot:n()})}function y(i){let r=o(i);return Object.freeze({publishedSnapshot:r,publishedCanonicalSnapshot:n()})}return Object.freeze({replaceVisibleSnapshot:o,restoreVisibleSnapshot:t,publishCompletedHostResult:a,publishFailedHostResult:y})}import{apply as nt,applyNamespaceDeltas as xe,applySystemDelta as ot,computeSync as at}from"@manifesto-ai/core";import{getHostState as rt}from"@manifesto-ai/host/tooling";function Ce(e,t){return{...e,timestamp:t,children:e.children.map(n=>Ce(n,t))}}function it(e){let t={};function n(o){t[o.id]=o,o.children.forEach(n)}return n(e),t}function st(e,t){let n=Ce(e.root,t);return{...e,duration:0,root:n,nodes:it(n)}}function Ae({schema:e,hostContextProvider:t,evaluateIntentLegalityFor:n}){function o(r,l){let c=rt(r)?.intentSlots??{},h=l.input===void 0?{type:l.type}:{type:l.type,input:l.input};return xe(r,[{namespace:"host",patches:[{op:"set",path:[{kind:"prop",name:"intentSlots"}],value:{...c,[l.intentId]:h}}]}])}function a(r){return new C("ACTION_UNAVAILABLE",`Action "${r.type}" is unavailable against the provided canonical snapshot`)}function y(r){return new C("INTENT_NOT_DISPATCHABLE",`Action "${r.type}" is available, but the bound intent is not dispatchable against the provided canonical snapshot`)}return Object.freeze({withHostIntentSlot:o,createSimulationUnavailableError:a,createSimulationNotDispatchableError:y,simulateSync:(r,l,u)=>{let c=n(r,l);if(c.kind==="unavailable")throw a(c.intent);if(c.kind==="invalid-input")throw c.error;if(c.kind==="not-dispatchable")throw y(c.intent);let h=c.intent,x=u?.context??t.createFrozenContext(h.intentId,u?.externalContext),T=o(structuredClone(r),h),b=at(e,T,h,x),g=nt(e,T,b.patches),A=xe(g,b.namespaceDelta??[]),k=ot(A,b.systemDelta);return Object.freeze({snapshot:I(k),patches:I(b.patches),systemDelta:I(b.systemDelta),status:b.status,requirements:I(b.systemDelta.addRequirements??[]),diagnostics:Object.freeze({trace:I(st(b.trace,r.meta.timestamp))})})}})}var ct=new Set(["state","computed","system","input","meta","namespaces"]),lt=["state","system","meta"];function pt(e){if(e===null||typeof e!="object"||Array.isArray(e))throw new C("INVALID_SNAPSHOT_SHAPE","Visible snapshot must be a canonical snapshot object");let t=e,n=Object.keys(t).filter(o=>!ct.has(o));if(n.length>0){let o=n.includes("data")?' Domain state lives under "state" since v5; the v4 "data" key was renamed.':"";throw new C("INVALID_SNAPSHOT_SHAPE",`Visible snapshot has unknown top-level key(s): ${n.join(", ")}.${o} Expected only: state, computed, system, input, meta, namespaces.`)}for(let o of lt){let a=t[o];if(a===null||typeof a!="object"||Array.isArray(a))throw new C("INVALID_SNAPSHOT_SHAPE",`Visible snapshot is missing the required "${o}" object`)}}function Ee({host:e,initialCanonicalSnapshot:t,projectSnapshotFromCanonical:n}){let o=structuredClone(t),a=n(o),y=I(o),i=Promise.resolve(),r=!1,l=new Set,u=new Map;function c(m,p){if(r)return()=>{};let d,R=!1;try{d=m(a),R=!0}catch{d=void 0,R=!1}let E={selector:m,listener:p,lastValue:d,initialized:R};return l.add(E),()=>{l.delete(E)}}function h(m,p){if(r)return()=>{};let d=u.get(m);return d||(d=new Set,u.set(m,d)),d.add(p),()=>{d?.delete(p)}}function x(){return a}function T(){return y}function b(){return structuredClone(o)}function g(m,p){pt(m),o=structuredClone(m),e.reset(structuredClone(o)),y=I(o);let d=n(o),R=!fe(d,a);return R&&(a=d),p?.notify!==!1&&R&&S(a),a}function A(){e.reset(structuredClone(o))}function k(m,p){let d=u.get(m);if(d)for(let R of d)try{R(p)}catch{}}function P(m){let p=i.catch(()=>{}).then(m);return i=p.then(()=>{},()=>{}),p}function M(){r||(r=!0,l.clear(),u.clear())}function _(){return r}function S(m){for(let p of l){let d;try{d=p.selector(m)}catch{continue}if(!(p.initialized&&Object.is(p.lastValue,d))){p.lastValue=d,p.initialized=!0;try{p.listener(d)}catch{}}}}return{subscribe:c,on:h,getSnapshot:x,getCanonicalSnapshot:T,getVisibleCoreSnapshot:b,setVisibleSnapshot:g,restoreVisibleSnapshot:A,emitEvent:k,enqueue:P,dispose:M,isDisposed:_}}function Re(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)})}import{validateExternalContext as ut}from"@manifesto-ai/core";function V(e,t,n){let o=dt(t===void 0?{}:t,n),a=ut(e,o);if(!a.valid){let y=a.errors.map(i=>i.path?`${i.path}: ${i.message}`:i.message).join("; ");throw new C("INVALID_CONTEXT",`Invalid context for ${n}: ${y}`)}return o}function Y(e,t,n,o){return n===void 0?t:V(e,n,o)}function dt(e,t){return Ie(e)||O(t,[],"Context must be a plain JSON object"),Object.freeze(je(e,t,[],new WeakSet))}function ge(e,t,n,o){if(e===null)return null;switch(typeof e){case"string":case"boolean":return e;case"number":return Number.isFinite(e)?e:O(t,n,"Context numbers must be finite");case"undefined":return O(t,n,"Context must not contain undefined");case"function":return O(t,n,"Context must not contain functions");case"symbol":return O(t,n,"Context must not contain symbols");case"bigint":return O(t,n,"Context must not contain bigint values");case"object":break}if(Array.isArray(e)){o.has(e)&&O(t,n,"Context must not contain cycles"),o.add(e),ke(e,t,n),Oe(e,t,n);let y=[];for(let i=0;i<e.length;i+=1)Object.prototype.hasOwnProperty.call(e,i)||O(t,[...n,i],"Context arrays must not contain holes"),y.push(ge(e[i],t,[...n,i],o));return o.delete(e),Object.freeze(y)}Ie(e)||O(t,n,"Context objects must be plain JSON objects"),o.has(e)&&O(t,n,"Context must not contain cycles"),o.add(e);let a=je(e,t,n,o);return o.delete(e),Object.freeze(a)}function je(e,t,n,o){ke(e,t,n),Oe(e,t,n);let a=Object.create(null);for(let[y,i]of Object.entries(e))a[y]=ge(i,t,[...n,y],o);return a}function Ie(e){if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function ke(e,t,n){for(let[o,a]of Object.entries(Object.getOwnPropertyDescriptors(e)))(a.get||a.set)&&O(t,[...n,o],"Context must not contain getters or setters")}function Oe(e,t,n){Object.getOwnPropertySymbols(e).length>0&&O(t,n,"Context must not contain symbol keys")}function O(e,t,n){let o=t.length===0?"$context":`$context.${t.map(String).join(".")}`;throw new C("INVALID_CONTEXT",`Invalid context for ${e} at ${o}: ${n}`)}var Tt=new Set(["then","constructor","prototype","__proto__"]);function xt(e){if(e.params)return e.params;let t=e.input;return!t||t.type!=="object"||!t.fields?[]:Object.keys(t.fields)}function Ct(e){return typeof e=="object"&&e!==null&&"then"in e&&typeof e.then=="function"}function At({schema:e,projectionPlan:t,actionAnnotations:n,host:o,hostContextProvider:a,MEL:y,createIntent:i,initialContext:r}){let l=y,u=o.getSnapshot();if(!u)throw new C("SCHEMA_ERROR","Host failed to initialize its genesis snapshot");function c(s){return I(J(s,t))}function h(s){let f=ft(e,s);if(St(f))throw new C("SNAPSHOT_REHYDRATION_FAILED",`Failed to rehydrate restored snapshot computed values: ${f.error.message}`,{cause:f.error});return{...s,computed:f.value}}let x=Ee({host:o,initialCanonicalSnapshot:u,projectSnapshotFromCanonical:c}),{subscribe:T,on:b,getSnapshot:g,getCanonicalSnapshot:A,getVisibleCoreSnapshot:k,setVisibleSnapshot:P,restoreVisibleSnapshot:M,emitEvent:_,enqueue:S,dispose:m,isDisposed:p}=x,d=X(bt(e)),R=Object.keys(e.actions);Et(R);let E=V(e,r,"createManifesto"),Z=Object.freeze(Object.fromEntries(R.map(s=>{let f=e.actions[s],L=l.actions[s]?.[W],le=Object.freeze(Array.isArray(L)?[...L]:xt(f)),pe=L===null?1:le.length,Ue=f.input?.required===!1?0:pe;return[s,Object.freeze({name:s,params:le,publicArity:pe,requiredArity:Ue,input:f.input,...f.inputType!==void 0?{inputType:f.inputType}:{},description:f.description,...n[s]!==void 0?{annotations:n[s]}:{},hasDispatchableGate:f.dispatchable!==void 0})]}))),Ne=Object.freeze(R.map(s=>Z[s]));function ee(s,f){return mt(e,s,String(f))}function te(s,f){return yt(e,s,f)}function N(s){let f=ht(e,s);return f.kind==="error"?Object.freeze([]):Object.freeze([...f.actions])}let K=Se({getAvailableActionsFor:N,projectSnapshotFromCanonical:c});function De(){return N(A())}let Pe=(s=>s!==void 0?Z[String(s)]:Ne);function G(s,f){let j=ee(s,f);return j.kind==="ok"&&j.available}function Me(s){return G(A(),s)}function H(s,f){let j=te(s,f);return j.kind==="ok"&&j.dispatchable}let _e=((s,...f)=>H(A(),i(s,...f)));function ne(s){return s.intentId&&s.intentId.length>0?s:{...s,intentId:Re()}}async function Le(s,f){return o.dispatch(s,f)}function ze(){return E}function Be(s){return E=V(e,s,"injectContext"),E}function Ve(s){let f=s(E);if(Ct(f))throw new C("INVALID_CONTEXT","updateContext() updater must return a synchronous JSON context value");return E=V(e,f,"updateContext"),E}function oe(s){return Y(e,E,s,"transition")}function ae(s,f){let j=f===void 0?E:Y(e,E,f,"transition");return a.createFrozenContext(s.intentId,j)}let U=null,v=be({schema:e,ensureIntentId:ne,getAvailableActionsFor:N,isActionAvailableFor:G,isIntentDispatchableFor:H,evaluateActionAvailabilityFor:ee,evaluateIntentDispatchabilityFor:te,projectSnapshotFromCanonical:c,getSimulateSync:()=>{if(!U)throw new C("SCHEMA_ERROR","Runtime simulation surface is not initialized");return U}}),re=Ae({schema:e,hostContextProvider:a,evaluateIntentLegalityFor:v.evaluateIntentLegalityFor});U=re.simulateSync;let ie=Te({setVisibleSnapshot:P,restoreVisibleSnapshot:M,getCanonicalSnapshot:A}),se=v.getIntentBlockersFor,Ge=((s,...f)=>se(A(),i(s,...f))),$=(s,f,j)=>{let L=j?.context??ae(f,j?.externalContext??oe());return re.simulateSync(s,f,{context:L})};function He(s){let f=c(s.snapshot);return Object.freeze({snapshot:f,changedPaths:B(g(),f),newAvailableActions:N(s.snapshot),requirements:s.requirements,status:s.status,diagnostics:s.diagnostics})}let ce=(s=>He($(A(),s))),Fe=((s,...f)=>ce(i(s,...f))),Ke=Object.freeze({refs:l,MEL:y,schema:e,createIntent:i,getCanonicalSnapshot:A,projectSnapshot:s=>c(s),simulateSync:(s,f)=>{let j=$(s,f);return Object.freeze({snapshot:j.snapshot,patches:j.patches,requirements:j.requirements,status:j.status,diagnostics:j.diagnostics})},getAvailableActionsFor:N,isActionAvailableFor:G,isIntentDispatchableFor:H,explainIntentFor:v.explainIntentFor});return{schema:e,refs:l,MEL:y,createIntent:i,subscribe:T,on:b,getSnapshot:g,getAvailableActionsFor:N,getAvailableActions:De,getIntentBlockersFor:se,getActionMetadata:Pe,isActionAvailableFor:G,isActionAvailable:Me,isIntentDispatchableFor:H,isIntentDispatchable:_e,getIntentBlockers:Ge,getSchemaGraph(){return d},simulateSync:$,simulate:Fe,simulateIntent:ce,dispose:m,isDisposed:p,getCanonicalSnapshot:A,getVisibleCoreSnapshot:k,rehydrateSnapshot:h,setVisibleSnapshot:ie.replaceVisibleSnapshot,restoreVisibleSnapshot:ie.restoreVisibleSnapshot,emitEvent:_,enqueue:S,ensureIntentId:ne,executeHost:Le,createComputeContext:ae,getExternalContext:ze,replaceExternalContext:Be,updateExternalContext:Ve,captureExternalContext:oe,validateIntentInputFor:v.validateIntentInputFor,evaluateIntentLegalityFor:v.evaluateIntentLegalityFor,deriveIntentAdmission:v.deriveIntentAdmission,deriveExecutionOutcome:K.deriveExecutionOutcome,classifyExecutionFailure:K.classifyExecutionFailure,createExecutionDiagnostics:K.createExecutionDiagnostics,createUnavailableError:v.createUnavailableError,createNotDispatchableError:v.createNotDispatchableError,rejectInvalidInput:v.rejectInvalidInput,rejectUnavailable:v.rejectUnavailable,rejectNotDispatchable:v.rejectNotDispatchable,[w]:Ke}}function Et(e){let t=e.filter(n=>Tt.has(n));if(t.length!==0)throw new C("RESERVED_ACTION_NAME",`Action name${t.length===1?"":"s"} ${t.map(n=>`"${n}"`).join(", ")} ${t.length===1?"is":"are"} reserved by the SDK public action namespace`)}function Q(e,t){return Object.freeze({path:Object.freeze([]),code:t,message:e.description??t,detail:Object.freeze({layer:e.layer,expression:e.expression})})}function Rt(e,t,n){if(t.failure.kind==="invalid_input"){let a=t.failure;return Object.freeze({ok:!1,action:e,layer:"input",code:"INVALID_INPUT",message:a.error.message,blockers:Object.freeze([])})}if(t.failure.kind==="not_dispatchable"){let a=t.failure;return Object.freeze({ok:!1,action:e,layer:"dispatchability",code:"INTENT_NOT_DISPATCHABLE",message:n??`Action "${e}" is not dispatchable against the current visible snapshot`,blockers:a.blockers.map(y=>Q(y,"INTENT_NOT_DISPATCHABLE"))})}let o=t.failure;return Object.freeze({ok:!1,action:e,layer:"availability",code:"ACTION_UNAVAILABLE",message:n??`Action "${e}" is unavailable against the current visible snapshot`,blockers:(o.blockers??[]).map(a=>Q(a,"ACTION_UNAVAILABLE"))})}function hn(e,t,n){Object.defineProperty(e,F,{enumerable:!1,configurable:!1,writable:!1,value:t});let o=n??ve(e)??{activated:!1};return ve(e)||Object.defineProperty(e,z,{enumerable:!1,configurable:!1,writable:!1,value:o}),e}function yn(e){let n=e[F];if(typeof n!="function")throw new C("SCHEMA_ERROR","ComposableManifesto is missing its runtime kernel factory");return n}function Sn(e,t){return Object.defineProperty(e,w,{enumerable:!1,configurable:!1,writable:!1,value:t[w]}),e}function bn(e){let n=e[w];if(!n)throw new C("SCHEMA_ERROR","Activated runtime is missing its extension kernel");return n}function we(e){let n=e[z];if(!n)throw new C("SCHEMA_ERROR","ComposableManifesto is missing its activation state");return n}function Tn(e){if(we(e).activated)throw new q}function xn(e){let t=we(e);if(t.activated)throw new q;t.activated=!0}function ve(e){return e[z]??null}export{W as a,Xe as b,w as c,gt as d,jt as e,I as f,B as g,Te as h,Re as i,At as j,Q as k,Rt as l,hn as m,yn as n,Sn as o,bn as p,we as q,Tn as r,xn as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as G,g as X,h as J,l as j,o as Q}from"./chunk-DPFMD6LR.js";import{a as h,d as K,f as D}from"./chunk-TG2UPPZN.js";async function Y(e,o,s,c,l){let p=e.getCanonicalSnapshot(),f=o.projectSnapshot(p),T=e.evaluateIntentLegalityFor(p,c),x=e.deriveIntentAdmission(p,T);if(T.kind!=="admitted"){let A=x,y=ue(e,T),z={code:y.code,reason:y.message};return{kind:"rejected",intent:T.intent,admission:A,beforeSnapshot:f,beforeCanonicalSnapshot:p,rejection:z,rejectionError:y}}let N=x,b;try{b=await e.executeHost(T.intent,{context:l})}catch(A){let y=de(A);return{kind:"failed",intent:T.intent,admission:N,beforeSnapshot:f,beforeCanonicalSnapshot:p,failure:y,errorInfo:e.classifyExecutionFailure(y,"host"),published:!1}}let I=e.createExecutionDiagnostics(b);if(b.status==="error"){let A=b.error??new h("HOST_ERROR","Host dispatch failed"),{publishedCanonicalSnapshot:y}=s.publishFailedHostResult(b.snapshot);return{kind:"failed",intent:T.intent,admission:N,beforeSnapshot:f,beforeCanonicalSnapshot:p,failure:A,errorInfo:e.classifyExecutionFailure(A,"host"),published:!0,diagnostics:I,outcome:e.deriveExecutionOutcome(p,y)}}let{publishedSnapshot:M,publishedCanonicalSnapshot:C}=s.publishCompletedHostResult(b.snapshot);return{kind:"completed",intent:T.intent,admission:N,publishedSnapshot:M,outcome:e.deriveExecutionOutcome(p,C),diagnostics:I}}function ue(e,o){if(o.kind==="unavailable")return e.createUnavailableError(o.intent);if(o.kind==="invalid-input")return o.error;if(o.kind==="not-dispatchable")return e.createNotDispatchableError(o.intent);throw new h("SDK_REPORT_ERROR","Cannot derive a rejected dispatch error for an admitted intent")}function de(e){return e instanceof Error?e:new Error(String(e))}function V(e){let o;try{o=structuredClone(e)}catch(s){throw new h("INVALID_INPUT",`Action input must be structured-cloneable: ${s instanceof Error?s.message:String(s)}`)}return Z(o)}function H(e){try{return{ok:!0,value:V(e)}}catch(o){if(o instanceof h)return{ok:!1,error:o};throw o}}function Z(e,o=new WeakSet){if(e==null||typeof e!="object")return e;let s=e;if(o.has(s)||Object.isFrozen(e))return e;o.add(s);for(let c of Reflect.ownKeys(s))Z(s[c],o);return Object.freeze(e)}function me(e,o={},s=!1){let c=v(o),l=e[G],p=J({setVisibleSnapshot:e.setVisibleSnapshot,restoreVisibleSnapshot:e.restoreVisibleSnapshot,getCanonicalSnapshot:e.getCanonicalSnapshot}),f=new Map;for(let t of e.getActionMetadata())f.set(t.name,fe(t));let T=Object.create(null),x=new Map;for(let t of f.keys()){let n=z(t);x.set(t,n),Object.defineProperty(T,t,{enumerable:!0,configurable:!1,writable:!1,value:n})}function N(t,n){if(e.isDisposed())return()=>{};let i;try{i=t(e.getSnapshot())}catch{i=void 0}return e.subscribe(t,r=>{let u=i;i=r,n(r,u)})}let b=Object.freeze({state:N,event(t,n){return e.isDisposed()?()=>{}:e.on(t,n)}}),I=(t=>x.get(t)),M={action:Object.freeze(T),state:A(),computed:y(),observe:b,inspect:Object.freeze({graph:e.getSchemaGraph,canonicalSnapshot:e.getCanonicalSnapshot,action(t){return O(t)},availableActions(){return Object.freeze(e.getAvailableActions().map(t=>O(t)))},schemaHash(){return e.getCanonicalSnapshot().meta.schemaHash}}),snapshot:e.getSnapshot,getAction:I,context:U,injectContext(t){if(s){c=v({...c,context:e.captureExternalContext(t)});return}e.replaceExternalContext(t)},updateContext(t){if(!s)return e.updateExternalContext(t);let n=t(U());return c=v({...c,context:e.captureExternalContext(n)}),c.context??e.getExternalContext()},with(t){return me(e,oe(t),!0)},dispose:e.dispose};return Object.freeze(Q(M,e));function C(t,n,i){return Object.freeze({name:t,ref:n,value:()=>i(e.getSnapshot()),observe:r=>N(i,r)})}function A(){let t=Object.create(null);for(let n of Object.keys(e.refs.state)){let i=e.refs.state[n];Object.defineProperty(t,n,{enumerable:!0,configurable:!1,writable:!1,value:C(n,i,r=>r.state[n])})}return Object.freeze(t)}function y(){let t=Object.create(null);for(let n of Object.keys(e.refs.computed)){let i=e.refs.computed[n];Object.defineProperty(t,n,{enumerable:!0,configurable:!1,writable:!1,value:C(n,i,r=>r.computed[n])})}return Object.freeze(t)}function z(t){return Object.freeze({info:()=>O(t),available:()=>e.isActionAvailable(t),check:(...n)=>{let i=E(t,n);return k(i)},preview:(...n)=>{let i=E(t,n);return L(i)},submit:(...n)=>{let i=E(t,n);return _(i)},bind:(...n)=>te(t,n)})}function te(t,n){let i=E(t,n),r=H([...n]),u=()=>r.ok?E(t,r.value):i;return Object.freeze({action:t,input:i.input,check:()=>k(u()),preview:()=>L(u()),submit:()=>_(u()),intent:()=>{let a=u();return a.inputError?null:a.intent}})}function E(t,n){let i=e.refs.actions[t],r=ne(t,n),u=H(r);if(!u.ok)return Object.freeze({actionName:t,input:void 0,intent:null,inputError:u.error});try{let a=V(e.createIntent(i,...n)),d=e.validateIntentInputFor(e.getCanonicalSnapshot(),a);return Object.freeze({actionName:t,input:u.value,intent:a,inputError:d})}catch(a){if(!(a instanceof h))throw a;return Object.freeze({actionName:t,input:u.value,intent:null,inputError:a})}}function ne(t,n){return n.length===0?void 0:e.getActionMetadata(t).publicArity>1?Object.freeze([...n]):n.length===1?n[0]:Object.freeze([...n])}function k(t){let n=e.getCanonicalSnapshot();return B(t,n).admission}function L(t){let n=e.getCanonicalSnapshot(),i=l.projectSnapshot(n),r=B(t,n);if(!r.admission.ok||r.intent===null)return Object.freeze({admitted:!1,admission:r.admission});let u=r.intent,a=e.createComputeContext(u,P()),d=e.simulateSync(n,u,{context:a}),S=l.projectSnapshot(d.snapshot);return Object.freeze({admitted:!0,status:d.status,before:i,after:S,changes:X(i,S),requirements:d.requirements,newAvailableActions:e.getAvailableActionsFor(d.snapshot).map(R=>O(R)),...le(d.diagnostics,c.diagnostics),error:d.snapshot.system.lastError})}async function _(t){if(e.isDisposed())throw new K;let n=t.intent?e.createComputeContext(t.intent,P()):null;return e.enqueue(async()=>{if(e.isDisposed())throw new K;let i=e.getCanonicalSnapshot(),r=B(t,i);if(!r.admission.ok||r.intent===null){let m=r.admission;return q(t.actionName,t.intent,m,i),Object.freeze({ok:!1,mode:"base",action:t.actionName,admission:m})}let u=r.intent;ae(t.actionName,u,r.admission,i),re(t.actionName,u,i);let a=await Y(e,l,p,u,n??e.createComputeContext(u,P()));if(a.kind==="rejected"){let m=j(t.actionName,a.admission,a.rejection.reason);return q(t.actionName,a.intent,m,a.beforeCanonicalSnapshot),Object.freeze({ok:!1,mode:"base",action:t.actionName,admission:m})}if(a.kind==="failed"){let m=a.outcome?.canonical.afterCanonicalSnapshot??a.beforeCanonicalSnapshot,$=ee(m);if(!a.published||$||!m.system.lastError){let ce=$??be(a.failure,a.intent,m);throw F(t.actionName,a.intent,ce,m),new D(a.failure.message,"runtime",{cause:a.failure})}}let d=(a.kind==="completed",a.outcome);if(!d){let m=w(a.kind==="failed"?a.failure:new Error("Submission produced no terminal outcome"),a.intent,e.getCanonicalSnapshot());throw F(t.actionName,a.intent,m,e.getCanonicalSnapshot()),new D(m.message,"runtime")}let S=ye(d,a.intent,a.diagnostics),R=d.canonical.afterCanonicalSnapshot;if(d.canonical.status==="pending"){let m=w(new Error("Base submit produced a pending runtime snapshot"),a.intent,R);throw F(t.actionName,a.intent,m,R),new D(m.message,"runtime")}se(t.actionName,a.intent,S,R);let W=pe(c.report,t.actionName,d,S,a.diagnostics);return Object.freeze({ok:!0,mode:"base",status:"settled",action:t.actionName,before:d.projected.beforeSnapshot,after:d.projected.afterSnapshot,outcome:S,...W!==void 0?{report:W}:{}})})}function U(){return c.context??e.getExternalContext()}function P(){return c.context??e.captureExternalContext()}function oe(t){return v({...c,...t.context!==void 0?{context:e.captureExternalContext(t.context)}:{},...t.diagnostics!==void 0?{diagnostics:t.diagnostics}:{},...t.report!==void 0?{report:t.report}:{}})}function B(t,n){if(!e.isActionAvailableFor(n,t.actionName))return{admission:Object.freeze({ok:!1,action:t.actionName,layer:"availability",code:"ACTION_UNAVAILABLE",message:`Action "${t.actionName}" is unavailable against the current visible snapshot`,blockers:ie(t,n)}),intent:null};if(t.inputError||!t.intent)return{admission:Object.freeze({ok:!1,action:t.actionName,layer:"input",code:"INVALID_INPUT",message:t.inputError?.message??"Invalid action input",blockers:Object.freeze([])}),intent:null};let i=e.evaluateIntentLegalityFor(n,t.intent);if(i.kind==="admitted")return{admission:Object.freeze({ok:!0,action:t.actionName}),intent:i.intent};let r=e.deriveIntentAdmission(n,i);return{admission:j(t.actionName,r),intent:null}}function ie(t,n){if(!t.intent){let u=Object.freeze({type:String(t.actionName),intentId:`availability:${String(t.actionName)}`}),a=e.evaluateIntentLegalityFor(n,u),d=e.deriveIntentAdmission(n,a);return d.kind!=="blocked"||d.failure.kind!=="unavailable"?Object.freeze([]):j(t.actionName,d).blockers}let i=e.evaluateIntentLegalityFor(n,t.intent),r=e.deriveIntentAdmission(n,i);return r.kind!=="blocked"||r.failure.kind!=="unavailable"?Object.freeze([]):j(t.actionName,r).blockers}function O(t){let n=f.get(t);if(!n)throw new h("UNKNOWN_ACTION",`Action "${String(t)}" is not declared by this Manifesto schema`);return n}function ae(t,n,i,r){e.emitEvent("submission:admitted",{...g(t,n,r),admission:i})}function q(t,n,i,r){e.emitEvent("submission:rejected",{...g(t,n,r),admission:i})}function re(t,n,i){e.emitEvent("submission:submitted",g(t,n,i))}function se(t,n,i,r){e.emitEvent("submission:settled",{...g(t,n,r),outcome:i})}function F(t,n,i,r){e.emitEvent("submission:failed",{...g(t,n,r),stage:"runtime",error:i})}function g(t,n,i){return{action:t,mode:"base",...n?.intentId?{intentId:n.intentId}:{},schemaHash:i.meta.schemaHash,snapshotVersion:i.meta.version}}}function le(e,o){return!e||o==="none"?{}:o==="summary"?{diagnostics:{}}:{diagnostics:{trace:e.trace}}}function pe(e,o,s,c,l){if(e!=="none")return Object.freeze({mode:"base",action:String(o),changes:s.projected.changedPaths,requirements:s.canonical.pendingRequirements,outcome:c,...e==="full"&&l!==void 0?{diagnostics:l}:{}})}function v(e){return Object.freeze({...e})}function fe(e){let o=e.input?.type==="object"?e.input.fields??{}:{},s=e.params.length>0?e.params:Object.keys(o),c=e.annotations,l=typeof c?.title=="string"?c.title:void 0;return Object.freeze({name:e.name,...l!==void 0?{title:l}:{},...e.description!==void 0?{description:e.description}:{},parameters:Object.freeze(s.map(p=>{let f=o[p];return Object.freeze({name:p,required:f?.required??!0,...f?.type!==void 0?{type:Te(f.type)}:{},...f?.description!==void 0?{description:f.description}:{}})})),...c!==void 0?{annotations:c}:{}})}function Te(e){return typeof e=="string"?e:typeof e=="object"&&e!==null&&"enum"in e?"enum":"unknown"}function ye(e,o,s){let c=he(s);if(c!==null)return Object.freeze({kind:"stop",reason:c});let l=e.canonical.afterCanonicalSnapshot;return l.system.lastError?Object.freeze({kind:"fail",error:l.system.lastError}):e.canonical.status==="error"?Object.freeze({kind:"fail",error:w(new Error("Runtime completed with error status"),o,l)}):Object.freeze({kind:"ok"})}function he(e){let o=e?.hostTraces?.slice().reverse().find(s=>s.terminatedBy==="halt");if(!o)return null;for(let s of Object.values(o.nodes))if(s.kind==="halt"){let c=s.inputs.reason;return typeof c=="string"?c:"halted"}return"halted"}function w(e,o,s){return Object.freeze({code:e instanceof h?e.code:"SUBMISSION_FAILED",message:e.message,source:{actionId:o.intentId??"",nodePath:"runtime.submit"},timestamp:s.meta.timestamp})}function be(e,o,s){return Ae(s)??w(e,o,s)}function Ae(e){return e.system.lastError?e.system.lastError:ee(e)}function ee(e){let o=e.namespaces?.host;if(o&&typeof o=="object"&&!Array.isArray(o)){let s=o.lastError;if(Ne(s))return s}return null}function Ne(e){if(!e||typeof e!="object"||Array.isArray(e))return!1;let o=e;return typeof o.code=="string"&&typeof o.message=="string"&&typeof o.timestamp=="number"&&!!o.source&&typeof o.source=="object"&&typeof o.source.actionId=="string"&&typeof o.source.nodePath=="string"}export{me as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var n=class extends Error{code;constructor(e,t,s){super(t,s),this.name="ManifestoError",this.code=e}},o=class extends n{effectType;constructor(e){super("RESERVED_EFFECT",`Effect type "${e}" is reserved and cannot be overridden`),this.name="ReservedEffectError",this.effectType=e}},a=class extends n{diagnostics;constructor(e,t){super("COMPILE_ERROR",t),this.name="CompileError",this.diagnostics=e}},i=class extends n{constructor(){super("DISPOSED","Cannot use a disposed Manifesto runtime"),this.name="DisposedError"}},l=class extends n{constructor(){super("ALREADY_ACTIVATED","ComposableManifesto.activate() may only be called once"),this.name="AlreadyActivatedError"}},d=class extends n{stage;constructor(e,t="runtime",s){super("SUBMISSION_FAILED",e,s),this.name="SubmissionFailedError",this.stage=t}};export{n as a,o as b,a as c,i as d,l as e,d as f};
|
|
@@ -1,93 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { HostContextProvider, HostResult, ManifestoHost } from "@manifesto-ai/host";
|
|
3
|
-
import { ManifestoError } from "../errors.js";
|
|
4
|
-
import type { BaseLaws, CanonicalSnapshot, ComposableManifesto, DispatchBlocker, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, IntentAdmission, ManifestoDomainShape, ManifestoEvent, ManifestoEventMap, SchemaGraph, SimulationDiagnostics, Snapshot, TypedCreateIntent, TypedGetActionMetadata, TypedGetIntentBlockers, TypedIntent, TypedIsIntentDispatchable, TypedMEL, TypedOn, TypedSimulate, TypedSimulateIntent, TypedSubscribe } from "../types.js";
|
|
5
|
-
import type { SnapshotProjectionPlan } from "../projection/snapshot-projection.js";
|
|
1
|
+
import type { BaseLaws, ComposableManifesto, ManifestoDomainShape } from "../types.js";
|
|
6
2
|
import type { ExtensionKernel } from "../extensions-types.js";
|
|
7
|
-
import type
|
|
8
|
-
import { ACTIVATION_STATE, EXTENSION_KERNEL, RUNTIME_KERNEL_FACTORY, type ActivationState } from "./runtime-symbols.js";
|
|
3
|
+
import { ACTIVATION_STATE, RUNTIME_KERNEL_FACTORY, type ActivationState } from "./runtime-symbols.js";
|
|
9
4
|
export { ACTION_PARAM_NAMES, ACTION_SINGLE_PARAM_OBJECT_VALUE, ACTIVATION_STATE, EXTENSION_KERNEL, RUNTIME_KERNEL_FACTORY, type ActivationState, } from "./runtime-symbols.js";
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
readonly snapshot: CanonicalSnapshot<T["state"]>;
|
|
13
|
-
readonly patches: readonly Patch[];
|
|
14
|
-
readonly systemDelta: Readonly<SystemDelta>;
|
|
15
|
-
readonly status: ComputeStatus;
|
|
16
|
-
readonly requirements: readonly Requirement[];
|
|
17
|
-
readonly diagnostics?: SimulationDiagnostics;
|
|
18
|
-
};
|
|
19
|
-
export interface RuntimeKernel<T extends ManifestoDomainShape> {
|
|
20
|
-
readonly schema: DomainSchema;
|
|
21
|
-
readonly MEL: TypedMEL<T>;
|
|
22
|
-
readonly createIntent: TypedCreateIntent<T>;
|
|
23
|
-
readonly subscribe: TypedSubscribe<T>;
|
|
24
|
-
readonly on: TypedOn<T>;
|
|
25
|
-
readonly getSnapshot: () => Snapshot<T["state"]>;
|
|
26
|
-
readonly getCanonicalSnapshot: () => CanonicalSnapshot<T["state"]>;
|
|
27
|
-
readonly getAvailableActionsFor: (snapshot: CanonicalSnapshot<T["state"]>) => readonly (keyof T["actions"])[];
|
|
28
|
-
readonly getAvailableActions: () => readonly (keyof T["actions"])[];
|
|
29
|
-
readonly getIntentBlockersFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => readonly DispatchBlocker[];
|
|
30
|
-
readonly getActionMetadata: TypedGetActionMetadata<T>;
|
|
31
|
-
readonly isActionAvailableFor: (snapshot: CanonicalSnapshot<T["state"]>, name: keyof T["actions"]) => boolean;
|
|
32
|
-
readonly isActionAvailable: (name: keyof T["actions"]) => boolean;
|
|
33
|
-
readonly isIntentDispatchableFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => boolean;
|
|
34
|
-
readonly isIntentDispatchable: TypedIsIntentDispatchable<T>;
|
|
35
|
-
readonly getIntentBlockers: TypedGetIntentBlockers<T>;
|
|
36
|
-
readonly getSchemaGraph: () => SchemaGraph;
|
|
37
|
-
readonly simulateSync: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => SimulateResult<T>;
|
|
38
|
-
readonly simulate: TypedSimulate<T>;
|
|
39
|
-
readonly simulateIntent: TypedSimulateIntent<T>;
|
|
40
|
-
readonly dispose: () => void;
|
|
41
|
-
readonly isDisposed: () => boolean;
|
|
42
|
-
readonly getVisibleCoreSnapshot: () => CoreSnapshot;
|
|
43
|
-
readonly setVisibleSnapshot: (snapshot: CoreSnapshot, options?: {
|
|
44
|
-
readonly notify?: boolean;
|
|
45
|
-
}) => Snapshot<T["state"]>;
|
|
46
|
-
readonly restoreVisibleSnapshot: () => void;
|
|
47
|
-
readonly emitEvent: <K extends ManifestoEvent>(event: K, payload: ManifestoEventMap<T>[K]) => void;
|
|
48
|
-
readonly enqueue: <R>(task: () => Promise<R>) => Promise<R>;
|
|
49
|
-
readonly ensureIntentId: (intent: TypedIntent<T>) => TypedIntent<T>;
|
|
50
|
-
readonly executeHost: (intent: TypedIntent<T>, options?: HostDispatchOptions) => Promise<HostResult>;
|
|
51
|
-
readonly validateIntentInputFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => ManifestoError | null;
|
|
52
|
-
readonly evaluateIntentLegalityFor: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => IntentLegalityEvaluation<T>;
|
|
53
|
-
readonly deriveIntentAdmission: (snapshot: CanonicalSnapshot<T["state"]>, legality: IntentLegalityEvaluation<T>) => IntentAdmission<T>;
|
|
54
|
-
readonly deriveExecutionOutcome: (beforeSnapshot: CanonicalSnapshot<T["state"]>, afterSnapshot: CanonicalSnapshot<T["state"]>) => ExecutionOutcome<T>;
|
|
55
|
-
readonly classifyExecutionFailure: (error: unknown, stage: "host" | "seal") => ExecutionFailureInfo;
|
|
56
|
-
readonly createExecutionDiagnostics: (result: HostResult) => ExecutionDiagnostics;
|
|
57
|
-
readonly createUnavailableError: (intent: TypedIntent<T>) => ManifestoError;
|
|
58
|
-
readonly createNotDispatchableError: (intent: TypedIntent<T>) => ManifestoError;
|
|
59
|
-
readonly rejectInvalidInput: (intent: TypedIntent<T>, message: string) => never;
|
|
60
|
-
readonly rejectUnavailable: (intent: TypedIntent<T>) => never;
|
|
61
|
-
readonly rejectNotDispatchable: (intent: TypedIntent<T>) => never;
|
|
62
|
-
readonly [EXTENSION_KERNEL]: ExtensionKernel<T>;
|
|
63
|
-
}
|
|
64
|
-
type RuntimePublicReadFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "schema" | "MEL" | "createIntent" | "subscribe" | "on" | "getSnapshot" | "getCanonicalSnapshot" | "getAvailableActions" | "isIntentDispatchable" | "getIntentBlockers" | "getActionMetadata" | "isActionAvailable" | "getSchemaGraph" | "simulate" | "simulateIntent">;
|
|
65
|
-
type RuntimeLifecycleFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "dispose" | "isDisposed" | "enqueue">;
|
|
66
|
-
type RuntimeExecutionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "ensureIntentId" | "executeHost">;
|
|
67
|
-
type RuntimeSealAdmissionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "isActionAvailable" | "validateIntentInputFor" | "isIntentDispatchableFor" | "rejectUnavailable" | "rejectInvalidInput" | "rejectNotDispatchable">;
|
|
68
|
-
type RuntimeReportAdmissionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "evaluateIntentLegalityFor" | "deriveIntentAdmission" | "createUnavailableError" | "createNotDispatchableError">;
|
|
69
|
-
type RuntimePublicationFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "getVisibleCoreSnapshot" | "setVisibleSnapshot" | "restoreVisibleSnapshot">;
|
|
70
|
-
type RuntimeReportingFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "deriveExecutionOutcome" | "classifyExecutionFailure" | "createExecutionDiagnostics">;
|
|
71
|
-
type RuntimeDispatchEventsFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "emitEvent">;
|
|
72
|
-
type RuntimeExtensionFacet<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, typeof EXTENSION_KERNEL>;
|
|
73
|
-
export type LineageRuntimeKernel<T extends ManifestoDomainShape> = RuntimePublicReadFacet<T> & RuntimeLifecycleFacet<T> & RuntimeExecutionFacet<T> & RuntimeSealAdmissionFacet<T> & RuntimeReportAdmissionFacet<T> & RuntimePublicationFacet<T> & RuntimeReportingFacet<T> & RuntimeDispatchEventsFacet<T> & RuntimeExtensionFacet<T>;
|
|
74
|
-
export type LineageRuntimeKernelFactory<T extends ManifestoDomainShape> = () => LineageRuntimeKernel<T>;
|
|
75
|
-
export type GovernanceRuntimeKernel<T extends ManifestoDomainShape> = RuntimePublicReadFacet<T> & RuntimeLifecycleFacet<T> & RuntimeExecutionFacet<T> & RuntimeSealAdmissionFacet<T> & RuntimePublicationFacet<T> & Pick<RuntimeKernel<T>, "deriveExecutionOutcome"> & RuntimeDispatchEventsFacet<T> & RuntimeExtensionFacet<T>;
|
|
76
|
-
export type GovernanceRuntimeKernelFactory<T extends ManifestoDomainShape> = () => GovernanceRuntimeKernel<T>;
|
|
77
|
-
export type WaitForProposalRuntimeKernel<T extends ManifestoDomainShape> = Pick<RuntimeKernel<T>, "isDisposed" | "deriveExecutionOutcome">;
|
|
78
|
-
export type RuntimeKernelFactory<T extends ManifestoDomainShape> = () => RuntimeKernel<T>;
|
|
5
|
+
export * from "../runtime/kernel-contract.js";
|
|
6
|
+
import type { RuntimeExtensionFacet, RuntimeKernelFactory } from "../runtime/kernel-contract.js";
|
|
79
7
|
export type InternalComposableManifesto<T extends ManifestoDomainShape, Laws extends BaseLaws> = ComposableManifesto<T, Laws> & {
|
|
80
8
|
readonly [RUNTIME_KERNEL_FACTORY]: RuntimeKernelFactory<T>;
|
|
81
9
|
readonly [ACTIVATION_STATE]: ActivationState;
|
|
82
10
|
};
|
|
83
|
-
export type RuntimeKernelOptions<T extends ManifestoDomainShape> = {
|
|
84
|
-
readonly schema: DomainSchema;
|
|
85
|
-
readonly projectionPlan: SnapshotProjectionPlan;
|
|
86
|
-
readonly host: ManifestoHost;
|
|
87
|
-
readonly hostContextProvider: HostContextProvider;
|
|
88
|
-
readonly MEL: TypedMEL<T>;
|
|
89
|
-
readonly createIntent: TypedCreateIntent<T>;
|
|
90
|
-
};
|
|
91
11
|
export declare function attachRuntimeKernelFactory<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>, factory: RuntimeKernelFactory<T>, activationState?: ActivationState): InternalComposableManifesto<T, Laws>;
|
|
92
12
|
export declare function getRuntimeKernelFactory<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): RuntimeKernelFactory<T>;
|
|
93
13
|
export declare function attachExtensionKernel<T extends ManifestoDomainShape, TInstance extends object>(runtime: TInstance, kernel: RuntimeExtensionFacet<T>): TInstance;
|
|
@@ -96,3 +16,4 @@ export declare function getActivationState<T extends ManifestoDomainShape, Laws
|
|
|
96
16
|
export declare function assertComposableNotActivated<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): void;
|
|
97
17
|
export declare function activateComposable<T extends ManifestoDomainShape, Laws extends BaseLaws>(manifesto: ComposableManifesto<T, Laws>): void;
|
|
98
18
|
export { createRuntimeKernel } from "../runtime/kernel.js";
|
|
19
|
+
export { mapBlockedAdmission, toBlocker } from "../runtime/admission-failure.js";
|
package/dist/effects.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type Patch } from "@manifesto-ai/core";
|
|
2
|
-
import type { EffectHandler, FieldRef, ManifestoDomainShape,
|
|
2
|
+
import type { EffectHandler, FieldRef, ManifestoDomainShape, TypedDomainRefs } from "./types.js";
|
|
3
3
|
type MergeableObject<TValue> = TValue extends readonly unknown[] ? never : TValue extends object ? TValue : never;
|
|
4
4
|
type RefValue<TRef extends FieldRef<unknown>> = TRef extends FieldRef<infer TValue> ? TValue : never;
|
|
5
5
|
type MergeValue<TRef extends FieldRef<unknown>> = Partial<MergeableObject<RefValue<TRef>>>;
|
|
@@ -8,6 +8,6 @@ export type PatchBuilder = {
|
|
|
8
8
|
unset<TRef extends FieldRef<unknown>>(ref: TRef): Patch;
|
|
9
9
|
merge<TRef extends FieldRef<unknown>>(ref: TRef, value: MergeValue<TRef>): Patch;
|
|
10
10
|
};
|
|
11
|
-
type DefineEffectsFactory<T extends ManifestoDomainShape> = (ops: PatchBuilder,
|
|
11
|
+
type DefineEffectsFactory<T extends ManifestoDomainShape> = (ops: PatchBuilder, refs: TypedDomainRefs<T>) => Record<string, EffectHandler>;
|
|
12
12
|
export declare function defineEffects<T extends ManifestoDomainShape>(factory: DefineEffectsFactory<T>): Record<string, EffectHandler>;
|
|
13
13
|
export {};
|
package/dist/effects.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a}from"./chunk-
|
|
1
|
+
import{a}from"./chunk-TG2UPPZN.js";import{mergePatch as u,propSegment as l,setPatch as T,unsetPatch as h}from"@manifesto-ai/core";function m(e){return e!==null&&typeof e=="object"&&!Array.isArray(e)}function r(e,n){if(!n||typeof n!="object")throw new a("SCHEMA_ERROR",`PatchBuilder.${e}() expects a FieldRef from defineEffects(..., refs.state.*)`);let t=n;if(t.__kind!=="FieldRef"||typeof t.name!="string"||t.name.length===0)throw new a("SCHEMA_ERROR",`PatchBuilder.${e}() expects a FieldRef from defineEffects(..., refs.state.*)`);if(t.name.startsWith("$"))throw new a("SCHEMA_ERROR",`PatchBuilder.${e}() does not allow reserved platform namespaces such as "${t.name}"`)}function p(e){if(!m(e))throw new a("SCHEMA_ERROR","PatchBuilder.merge() expects a plain object value")}function s(e){let n=new Map,t=Object.freeze(Object.create(null));return new Proxy(t,{get(c,f,d){if(typeof f!="string")return Reflect.get(c,f,d);let o=n.get(f);if(o)return o;let R=Object.freeze({__kind:e,name:f});return n.set(f,R),R}})}function i(e){return[l(e.name)]}var w=Object.freeze({set(e,n){return r("set",e),T(i(e),n)},unset(e){return r("unset",e),h(i(e))},merge(e,n){return r("merge",e),p(n),u(i(e),n)}}),g=Object.freeze({actions:s("ActionRef"),state:s("FieldRef"),computed:s("ComputedRef")});function y(e){return e(w,g)}export{y as defineEffects};
|
package/dist/errors.d.ts
CHANGED
|
@@ -35,3 +35,7 @@ export declare class DisposedError extends ManifestoError {
|
|
|
35
35
|
export declare class AlreadyActivatedError extends ManifestoError {
|
|
36
36
|
constructor();
|
|
37
37
|
}
|
|
38
|
+
export declare class SubmissionFailedError extends ManifestoError {
|
|
39
|
+
readonly stage: "runtime" | "settlement";
|
|
40
|
+
constructor(message: string, stage?: "runtime" | "settlement", options?: ErrorOptions);
|
|
41
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { ComputeStatus, DomainSchema, Patch, Requirement } from "@manifesto-ai/core";
|
|
2
|
-
import type { CanonicalSnapshot, CreateIntentArgs, IntentExplanation, ManifestoDomainShape,
|
|
2
|
+
import type { CanonicalSnapshot, CreateIntentArgs, IntentExplanation, ManifestoDomainShape, ProjectedSnapshot, SimulationDiagnostics, TypedActionRef, TypedCreateIntent, TypedIntent, TypedDomainRefs, TypedMEL } from "./types.js";
|
|
3
3
|
export type ExtensionSimulateResult<T extends ManifestoDomainShape = ManifestoDomainShape> = {
|
|
4
4
|
readonly snapshot: CanonicalSnapshot<T["state"]>;
|
|
5
5
|
readonly patches: readonly Patch[];
|
|
@@ -8,11 +8,13 @@ export type ExtensionSimulateResult<T extends ManifestoDomainShape = ManifestoDo
|
|
|
8
8
|
readonly diagnostics?: SimulationDiagnostics;
|
|
9
9
|
};
|
|
10
10
|
export interface ExtensionKernel<T extends ManifestoDomainShape> {
|
|
11
|
+
readonly refs: TypedDomainRefs<T>;
|
|
12
|
+
/** @deprecated Use refs. */
|
|
11
13
|
readonly MEL: TypedMEL<T>;
|
|
12
14
|
readonly schema: DomainSchema;
|
|
13
15
|
readonly createIntent: TypedCreateIntent<T>;
|
|
14
16
|
readonly getCanonicalSnapshot: () => CanonicalSnapshot<T["state"]>;
|
|
15
|
-
readonly projectSnapshot: (snapshot: CanonicalSnapshot<T["state"]>) =>
|
|
17
|
+
readonly projectSnapshot: (snapshot: CanonicalSnapshot<T["state"]>) => ProjectedSnapshot<T>;
|
|
16
18
|
readonly simulateSync: (snapshot: CanonicalSnapshot<T["state"]>, intent: TypedIntent<T>) => ExtensionSimulateResult<T>;
|
|
17
19
|
readonly getAvailableActionsFor: (snapshot: CanonicalSnapshot<T["state"]>) => readonly (keyof T["actions"])[];
|
|
18
20
|
readonly isActionAvailableFor: (snapshot: CanonicalSnapshot<T["state"]>, actionName: keyof T["actions"]) => boolean;
|
|
@@ -23,7 +25,7 @@ export type SimulationSessionStatus = ComputeStatus | "idle" | "computing";
|
|
|
23
25
|
export type SimulationActionRef<T extends ManifestoDomainShape = ManifestoDomainShape> = TypedActionRef<T, keyof T["actions"]>;
|
|
24
26
|
export type SimulationSessionStep<T extends ManifestoDomainShape = ManifestoDomainShape> = {
|
|
25
27
|
readonly intent: TypedIntent<T>;
|
|
26
|
-
readonly snapshot:
|
|
28
|
+
readonly snapshot: ProjectedSnapshot<T>;
|
|
27
29
|
readonly canonicalSnapshot: CanonicalSnapshot<T["state"]>;
|
|
28
30
|
readonly availableActions: readonly SimulationActionRef<T>[];
|
|
29
31
|
readonly requirements: readonly Requirement[];
|
|
@@ -31,7 +33,7 @@ export type SimulationSessionStep<T extends ManifestoDomainShape = ManifestoDoma
|
|
|
31
33
|
readonly isTerminal: boolean;
|
|
32
34
|
};
|
|
33
35
|
export type SimulationSessionResult<T extends ManifestoDomainShape = ManifestoDomainShape> = {
|
|
34
|
-
readonly snapshot:
|
|
36
|
+
readonly snapshot: ProjectedSnapshot<T>;
|
|
35
37
|
readonly canonicalSnapshot: CanonicalSnapshot<T["state"]>;
|
|
36
38
|
readonly depth: number;
|
|
37
39
|
readonly trajectory: readonly SimulationSessionStep<T>[];
|
|
@@ -41,7 +43,7 @@ export type SimulationSessionResult<T extends ManifestoDomainShape = ManifestoDo
|
|
|
41
43
|
readonly isTerminal: boolean;
|
|
42
44
|
};
|
|
43
45
|
export interface SimulationSession<T extends ManifestoDomainShape> {
|
|
44
|
-
readonly snapshot:
|
|
46
|
+
readonly snapshot: ProjectedSnapshot<T>;
|
|
45
47
|
readonly canonicalSnapshot: CanonicalSnapshot<T["state"]>;
|
|
46
48
|
readonly depth: number;
|
|
47
49
|
readonly trajectory: readonly SimulationSessionStep<T>[];
|
package/dist/extensions.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{f as m,
|
|
1
|
+
import{f as m,p as c}from"./chunk-DPFMD6LR.js";import{a as S}from"./chunk-TG2UPPZN.js";function p(n){return n==="pending"||n==="halted"||n==="error"}function d(n){return n.__kind==="ActionRef"}function l(n){return Object.freeze([...n])}function u(n,e,t){return Object.freeze(t?[]:n.getAvailableActionsFor(e).map(i=>n.refs.actions[i]))}function y(n,e,t,i,s){let a=p(s);return Object.freeze({intent:m(n),snapshot:e.projectSnapshot(t),canonicalSnapshot:t,availableActions:u(e,t,a),requirements:l(i),status:s,isTerminal:a})}function T(n,e){return Object.freeze({snapshot:e.snapshot,canonicalSnapshot:e.canonicalSnapshot,depth:e.depth,trajectory:e.trajectory,availableActions:e.availableActions,requirements:e.requirements,status:e.status,isTerminal:e.isTerminal,finish(){return e},next(i,...s){if(e.isTerminal)throw new S("SIMULATION_SESSION_TERMINAL","SimulationSession.next() cannot advance a terminal session");let a=d(i)?n.createIntent(i,...s):i,r=n.simulateSync(e.canonicalSnapshot,a),o=y(a,n,r.snapshot,r.requirements,r.status),f=Object.freeze({snapshot:o.snapshot,canonicalSnapshot:r.snapshot,depth:e.depth+1,trajectory:l([...e.trajectory,o]),availableActions:o.availableActions,requirements:o.requirements,status:o.status,isTerminal:o.isTerminal});return T(n,f)}})}function h(n){let e=c(n),t=e.getCanonicalSnapshot(),i=t.system.status,s=p(i);return T(e,Object.freeze({snapshot:e.projectSnapshot(t),canonicalSnapshot:t,depth:0,trajectory:Object.freeze([]),availableActions:u(e,t,s),requirements:l(t.system.pendingRequirements),status:i,isTerminal:s}))}function v(n){return c(n)}export{h as createSimulationSession,v as getExtensionKernel};
|
package/dist/index.d.ts
CHANGED
|
@@ -9,8 +9,19 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export type { SdkManifest } from "./manifest.js";
|
|
11
11
|
export { createManifesto } from "./create-manifesto.js";
|
|
12
|
-
export type { ActivatedInstance, ActionArgs, CreateIntentArgs,
|
|
13
|
-
|
|
12
|
+
export type { ActivatedInstance, ActionAnnotation, ActionArgs, ActionHandle, ActionInfo, ActionInput, ActionName, ActionParameterInfo, ActionSurface, Admission, AdmissionFailure, AdmissionOk, CreateIntentArgs, CreateManifestoOptions, ContextUpdater, DomainExternalContext, BaseManifestoApp, BaseSubmissionResult, DynamicActionHandle, DynamicBoundAction, DispatchExecutionOutcome, DispatchProjectedDiff, DispatchCanonicalOutcome, ActionObjectBindingArgs, AdmissionBlocker, Blocker, BoundAction, DispatchBlocker, ExplanationBlocker, AvailableActionDelta, TypedActionMetadata, TypedGetActionMetadata, TypedGetIntentBlockers, TypedIsIntentDispatchable, BaseLaws, BaseComposableLaws, BaseWriteReport, CanonicalNamespaces, CanonicalSnapshot, ComposableManifesto, ComputedReadSurface, ComputedRef, ChangedPath, EffectContext, EffectHandler, ExecutionDiagnostics, ExecutionFailureInfo, ExecutionOutcome, ExecutionView, ExternalContext, FieldRef, GovernedComposableLaws, GovernanceLaws, GovernanceSettlementResult, GovernanceSettlementSurface, GovernanceSubmissionResult, GetAction, IntentExplanation, InvalidInputInfo, JsonValue, LineageComposableLaws, LineageLaws, LineageSubmissionResult, LineageWriteReport, ManifestoApp, ManifestoDecoratedRuntimeByLaws, ManifestoDomainShape, ManifestoEvent, ManifestoEventName, ManifestoEventPayload, ManifestoEventPayloadMap, ManifestoRuntimeByLaws, ObserveSurface, Selector, SimulationDiagnostics, SimulateResult, ProjectedDiff, ProjectedSnapshot, ProposalRef, PreviewDiagnosticsMode, PreviewResult, PathSegment, CanonicalOutcome, ProjectedReadHandle, RuntimeMode, SchemaGraph, SchemaGraphEdge, SchemaGraphEdgeRelation, SchemaGraphNode, SchemaGraphNodeId, SchemaGraphNodeKind, SchemaGraphNodeRef, Snapshot, StateReadSurface, SubmissionResult, SubmitReportMode, SubmitResultFor, TypedActionRef, TypedCreateIntent, TypedDomainRefs, TypedIntent, TypedMEL, TypedOn, TypedSubscribe, Unsubscribe, WorldRecord, } from "./types.js";
|
|
13
|
+
/**
|
|
14
|
+
* v3-era intent-centric result types. Their public producers
|
|
15
|
+
* (dispatchAsyncWithReport / the intent-centric base instance) were retired
|
|
16
|
+
* by the v5 activation-first surface; these exports remain only so existing
|
|
17
|
+
* type-level consumers keep compiling.
|
|
18
|
+
*
|
|
19
|
+
* @deprecated Scheduled for removal in the next major release. Use the
|
|
20
|
+
* action-candidate surface (Admission / AdmissionFailure / SubmissionResult)
|
|
21
|
+
* instead.
|
|
22
|
+
*/
|
|
23
|
+
export type { DispatchReport, IntentAdmission, IntentAdmissionFailure, } from "./types.js";
|
|
24
|
+
export { AlreadyActivatedError, CompileError, DisposedError, ManifestoError, ReservedEffectError, SubmissionFailedError, } from "./errors.js";
|
|
14
25
|
export type { CompileDiagnostic } from "./errors.js";
|
|
15
26
|
export type { DomainSchema, Intent, Patch, Snapshot as CoreSnapshot, } from "@manifesto-ai/core";
|
|
16
27
|
export { createSnapshot } from "@manifesto-ai/core";
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{a as
|
|
2
|
-
`)[
|
|
3
|
-
${
|
|
4
|
-
${
|
|
1
|
+
import{a as _}from"./chunk-OW22XF26.js";import{a as m,b as p,d as D,e as T,f as I,i as v,j as A,m as k,s as w}from"./chunk-DPFMD6LR.js";import{a as c,b as h,c as y,d as G,e as F,f as K}from"./chunk-TG2UPPZN.js";import{createHostContextProvider as W,createHost as U,defaultRuntime as J}from"@manifesto-ai/host";import{createSnapshot as X,evaluateComputed as Y,extractDefaults as q,isOk as Q}from"@manifesto-ai/core";function S(e,t,n){let o=J,a=W(o),r=X(q(e.state),e.hash,a.createInitialContext()),i=Y(e,r),s=U(e,{initialSnapshot:Q(i)?{...r,computed:i.value}:r,runtime:o});for(let[l,d]of Object.entries(n)){let u=async(pe,$,z)=>await d($,{snapshot:I(T(z.snapshot,t))});s.registerEffect(l,u)}return{host:s,contextProvider:a}}import{createIntent as Z}from"@manifesto-ai/core";function b(){return(e,...t)=>{let n=e,o=v(),a=ee(n,t);return Z(String(e.name),a,o)}}function ee(e,t){let n=Object.hasOwn(e,m)?e[m]:[];if(t.length!==0){if(n===null){if(t.length===1&&f(t[0]))return t[0];throw new c("INVALID_INTENT_ARGS",`Action "${String(e.name)}" requires a single object argument because positional parameter metadata is unavailable`)}if(n.length===0)throw new c("INVALID_INTENT_ARGS",`Action "${String(e.name)}" does not accept input`);return n.length===1&&t.length===1&&f(t[0])&&e[p]?{[n[0]??"arg0"]:t[0]}:n.length===1&&t.length===1&&te(t[0],n[0])||t.length===1&&f(t[0])&&n.length>1?t[0]:Object.fromEntries(t.map((o,a)=>[n[a]??`arg${a}`,o]))}}function f(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function te(e,t){if(!t||!f(e))return!1;let n=Object.keys(e);return n.length===1&&n[0]===t}import{compileMelModule as ne,parse as oe,tokenize as ae}from"@manifesto-ai/compiler";function L(e){let t=ne(e,{mode:"module"});if(t.errors.length>0){let o=t.errors.map(a=>{let r=a.location;if(!r||r.start.line===0&&r.start.column===0)return`[${a.code}] ${a.message}`;let i=`[${a.code}] ${a.message} (${r.start.line}:${r.start.column})`,s=e.split(`
|
|
2
|
+
`)[r.start.line-1];if(!s)return i;let l=String(r.start.line).padStart(4," "),d=Math.max(1,r.end.line===r.start.line?Math.min(r.end.column-r.start.column,Math.max(1,s.length-r.start.column+1)):1),u=" ".repeat(l.length+3+r.start.column-1);return`${i}
|
|
3
|
+
${l} | ${s}
|
|
4
|
+
${u}${"^".repeat(d)}`}).join(`
|
|
5
5
|
|
|
6
|
-
`);throw new
|
|
7
|
-
${
|
|
6
|
+
`);throw new y(t.errors,`MEL compilation failed:
|
|
7
|
+
${o}`)}if(!t.module)throw new c("COMPILE_ERROR","MEL compilation produced no schema");let n=t.module.schema;return{schema:n,actionParamMetadata:g(n,se(e)),actionSingleParamObjectValueMetadata:P(n),actionAnnotations:j(t.module.annotations)}}function j(e){return Object.freeze(e?Object.fromEntries(Object.entries(e.entries).filter(([t])=>t.startsWith("action:")).map(([t,n])=>[t.slice(7),Object.freeze(Object.fromEntries(n.map(a=>[a.tag,a.payload??!0])))])):{})}function g(e,t){return Object.freeze(Object.fromEntries(Object.entries(e.actions).map(([n,o])=>{let a=t?.[n];if(a&&a.length>0)return[n,Object.freeze([...a])];if(o.params&&o.params.length>0){let i=Object.freeze([...o.params]);return[n,i]}if(!o.input||o.input.type!=="object"||!o.input.fields)return[n,[]];let r=re(o.input);return[n,r.length<=1?r:null]})))}function P(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=E(t.inputType,t.params[0]??"",e.types);return n?M(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 E(e,t,n,o=[]){if(e.kind==="ref"){if(o.includes(e.name))return null;let a=n[e.name];return a?E(a.definition,t,n,[...o,e.name]):null}if(e.kind==="union"){let a=e.types.filter(r=>!R(r,n,o));return a.length===1?E(a[0],t,n,o):null}return e.kind!=="object"?null:e.fields[t]?.type??null}function M(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let o=t[e.name];return o?M(o.definition,t,[...n,e.name]):!1}if(e.kind==="union"){let o=e.types.filter(a=>!R(a,t,n));return o.length===1?M(o[0],t,n):!1}return e.kind==="object"||e.kind==="record"||e.kind==="primitive"&&e.type==="object"}function R(e,t,n=[]){if(e.kind==="ref"){if(n.includes(e.name))return!1;let o=t[e.name];return o?R(o.definition,t,[...n,e.name]):!1}return e.kind==="primitive"&&e.type==="null"||e.kind==="literal"&&e.value===null}function se(e){let t=ae(e);if(t.diagnostics.some(o=>o.severity==="error"))return;let n=oe(t.tokens);if(n.program)return Object.freeze(Object.fromEntries(n.program.domain.members.filter(o=>o.kind==="action").map(o=>[o.name,Object.freeze(o.params.map(a=>a.name))])))}var O="system.get",C="system.",N=Object.freeze({__baseLaws:!0});function H(e,t){if(typeof e!="string"&&me(e))throw new c("SCHEMA_ERROR","DomainModule is a compiler tooling artifact. Pass module.schema or MEL source to createManifesto().");let n=typeof e=="string"?L(e):{schema:e,actionParamMetadata:g(e),actionSingleParamObjectValueMetadata:P(e),actionAnnotations:j()};return le(n.schema),{schema:n.schema,actionParamMetadata:n.actionParamMetadata,actionSingleParamObjectValueMetadata:n.actionSingleParamObjectValueMetadata,actionAnnotations:ce(n.actionAnnotations,t),projectionPlan:D(n.schema)}}function ce(e,t){if(!t)return e;let n=new Map;for(let[o,a]of Object.entries(e))n.set(o,a);for(let[o,a]of Object.entries(t))n.set(o,Object.freeze({...n.get(o)??{},...a}));return Object.freeze(Object.fromEntries(n))}function me(e){return typeof e=="object"&&e!==null&&"schema"in e&&"graph"in e&&"annotations"in e}function le(e){B(e.state.fields,"state.fields");for(let t of Object.keys(e.actions??{}))if(t.startsWith(C))throw new c("RESERVED_NAMESPACE",`Action type "${t}" uses reserved namespace prefix "${C}"`)}function B(e,t){for(let[n,o]of Object.entries(e)){let a=`${t}.${n}`;if(n.startsWith("$"))throw new c("SCHEMA_ERROR",`State field "${a}" uses reserved namespace prefix "$"`);o.type==="object"&&o.fields&&B(o.fields,a)}}function x(e,t,n){let o=Object.fromEntries(Object.keys(e.actions).map(i=>{let s={__kind:"ActionRef",name:i};return Object.defineProperty(s,m,{enumerable:!1,configurable:!1,writable:!1,value:Object.hasOwn(t,i)?t[i]:[]}),Object.defineProperty(s,p,{enumerable:!1,configurable:!1,writable:!1,value:n[i]??!1}),[i,Object.freeze(s)]})),a=Object.fromEntries(Object.keys(e.state.fields).filter(i=>!i.startsWith("$")).map(i=>[i,Object.freeze({__kind:"FieldRef",name:i})])),r=Object.fromEntries(Object.keys(e.computed.fields).map(i=>[i,Object.freeze({__kind:"ComputedRef",name:i})]));return Object.freeze({actions:Object.freeze(o),state:Object.freeze(a),computed:Object.freeze(r)})}function V(e,t,n){if(O in t)throw new h(O);let o=H(e,n?.annotations),a={_laws:N,schema:o.schema,activate(){w(a);let r=S(o.schema,o.projectionPlan,t);return _(A({schema:o.schema,projectionPlan:o.projectionPlan,host:r.host,hostContextProvider:r.contextProvider,MEL:x(o.schema,o.actionParamMetadata,o.actionSingleParamObjectValueMetadata),createIntent:b(),actionAnnotations:o.actionAnnotations,initialContext:n?.context}))}};return k(a,()=>{let r=S(o.schema,o.projectionPlan,t);return A({schema:o.schema,projectionPlan:o.projectionPlan,host:r.host,hostContextProvider:r.contextProvider,MEL:x(o.schema,o.actionParamMetadata,o.actionSingleParamObjectValueMetadata),createIntent:b(),actionAnnotations:o.actionAnnotations,initialContext:n?.context})})}import{createSnapshot as Je}from"@manifesto-ai/core";export{F as AlreadyActivatedError,y as CompileError,G as DisposedError,c as ManifestoError,h as ReservedEffectError,K as SubmissionFailedError,V as createManifesto,Je as createSnapshot};
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
+
import { type AnnotationIndex } from "@manifesto-ai/compiler";
|
|
1
2
|
import { type DomainSchema } from "@manifesto-ai/core";
|
|
2
|
-
import type { ActionParamMetadata, ActionSingleParamObjectValueMetadata, CompiledSchema } from "./shared.js";
|
|
3
|
+
import type { ActionParamMetadata, ActionAnnotationMap, ActionSingleParamObjectValueMetadata, CompiledSchema } from "./shared.js";
|
|
3
4
|
export declare function compileSchema(source: string): CompiledSchema;
|
|
5
|
+
export declare function deriveActionAnnotations(annotations?: AnnotationIndex | null): ActionAnnotationMap;
|
|
4
6
|
export declare function deriveActionParamMetadata(schema: DomainSchema, actionParamOrder?: Readonly<Record<string, readonly string[]>>): Readonly<Record<string, ActionParamMetadata>>;
|
|
5
7
|
export declare function deriveSingleParamObjectValueMetadata(schema: DomainSchema): Readonly<Record<string, ActionSingleParamObjectValueMetadata>>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { BaseComposableLaws, ComposableManifesto, EffectHandler, ManifestoDomainShape } from "../types.js";
|
|
1
|
+
import type { BaseComposableLaws, ComposableManifesto, CreateManifestoOptions, DomainExternalContext, EffectHandler, ManifestoDomainShape } from "../types.js";
|
|
2
2
|
import type { DomainSchema } from "@manifesto-ai/core";
|
|
3
|
-
export declare function createManifesto<T extends ManifestoDomainShape>(schemaInput: DomainSchema | string, effects: Record<string, EffectHandler
|
|
3
|
+
export declare function createManifesto<T extends ManifestoDomainShape>(schemaInput: DomainSchema | string, effects: Record<string, EffectHandler>, options?: CreateManifestoOptions<DomainExternalContext<T>>): ComposableManifesto<T, BaseComposableLaws>;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { type DomainSchema } from "@manifesto-ai/core";
|
|
2
|
-
import type { ResolvedSchema } from "./shared.js";
|
|
3
|
-
export declare function resolveSchema(schema: DomainSchema | string): ResolvedSchema;
|
|
2
|
+
import type { ActionAnnotationMap, ResolvedSchema } from "./shared.js";
|
|
3
|
+
export declare function resolveSchema(schema: DomainSchema | string, callerAnnotations?: ActionAnnotationMap): ResolvedSchema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { HostContextProvider, ManifestoHost } from "@manifesto-ai/host";
|
|
2
2
|
import type { DomainSchema } from "@manifesto-ai/core";
|
|
3
3
|
import { ACTION_PARAM_NAMES, ACTION_SINGLE_PARAM_OBJECT_VALUE } from "../compat/runtime-symbols.js";
|
|
4
|
-
import type { BaseComposableLaws, ManifestoDomainShape, TypedActionRef } from "../types.js";
|
|
4
|
+
import type { ActionAnnotation, BaseComposableLaws, ManifestoDomainShape, TypedActionRef } from "../types.js";
|
|
5
5
|
import type { SnapshotProjectionPlan } from "../projection/snapshot-projection.js";
|
|
6
6
|
export declare const RESERVED_EFFECT_TYPE = "system.get";
|
|
7
7
|
export declare const RESERVED_NAMESPACE_PREFIX = "system.";
|
|
@@ -12,10 +12,12 @@ export type RuntimeActionRef = TypedActionRef<ManifestoDomainShape> & {
|
|
|
12
12
|
};
|
|
13
13
|
export type ActionParamMetadata = readonly string[] | null;
|
|
14
14
|
export type ActionSingleParamObjectValueMetadata = boolean;
|
|
15
|
+
export type ActionAnnotationMap = Readonly<Record<string, ActionAnnotation>>;
|
|
15
16
|
export type ResolvedSchema = {
|
|
16
17
|
readonly schema: DomainSchema;
|
|
17
18
|
readonly actionParamMetadata: Readonly<Record<string, ActionParamMetadata>>;
|
|
18
19
|
readonly actionSingleParamObjectValueMetadata: Readonly<Record<string, ActionSingleParamObjectValueMetadata>>;
|
|
20
|
+
readonly actionAnnotations: ActionAnnotationMap;
|
|
19
21
|
readonly projectionPlan: SnapshotProjectionPlan;
|
|
20
22
|
};
|
|
21
23
|
export type CompiledSchema = Omit<ResolvedSchema, "projectionPlan">;
|
package/dist/manifest.d.ts
CHANGED
|
@@ -1,23 +1,21 @@
|
|
|
1
1
|
import { type DomainSchema, type Snapshot as CoreSnapshot } from "@manifesto-ai/core";
|
|
2
|
-
export type
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
};
|
|
7
|
-
export type Snapshot<T = unknown> = {
|
|
8
|
-
data: T;
|
|
9
|
-
computed: Record<string, unknown>;
|
|
2
|
+
export type CanonicalNamespaces = CoreSnapshot["namespaces"];
|
|
3
|
+
export type Snapshot<TState = unknown, TComputed = Record<string, unknown>> = {
|
|
4
|
+
state: TState;
|
|
5
|
+
computed: TComputed;
|
|
10
6
|
system: Pick<CoreSnapshot["system"], "status" | "lastError">;
|
|
11
7
|
meta: Pick<CoreSnapshot["meta"], "schemaHash">;
|
|
12
8
|
};
|
|
13
|
-
export type CanonicalSnapshot<
|
|
14
|
-
|
|
9
|
+
export type CanonicalSnapshot<TState = unknown, TComputed = Record<string, unknown>> = Omit<CoreSnapshot, "state" | "computed"> & {
|
|
10
|
+
state: TState;
|
|
11
|
+
computed: TComputed;
|
|
12
|
+
namespaces: CanonicalNamespaces;
|
|
15
13
|
};
|
|
16
14
|
export type SnapshotProjectionPlan = {
|
|
17
15
|
visibleComputedKeys: readonly string[];
|
|
18
16
|
};
|
|
19
17
|
export declare function buildSnapshotProjectionPlan(schema: DomainSchema): SnapshotProjectionPlan;
|
|
20
|
-
export declare function projectCanonicalSnapshot<
|
|
21
|
-
export declare function projectEffectContextSnapshot<
|
|
18
|
+
export declare function projectCanonicalSnapshot<TState = unknown, TComputed = Record<string, unknown>>(snapshot: CoreSnapshot, plan: SnapshotProjectionPlan): Snapshot<TState, TComputed>;
|
|
19
|
+
export declare function projectEffectContextSnapshot<TState = unknown, TComputed = Record<string, unknown>>(snapshot: CoreSnapshot, plan: SnapshotProjectionPlan): Snapshot<TState, TComputed>;
|
|
22
20
|
export declare function cloneAndDeepFreeze<T>(value: T): T;
|
|
23
|
-
export declare function projectedSnapshotsEqual<
|
|
21
|
+
export declare function projectedSnapshotsEqual<TState, TComputed = Record<string, unknown>>(left: Snapshot<TState, TComputed>, right: Snapshot<TState, TComputed>): boolean;
|
package/dist/provider.d.ts
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
* App code should prefer the main sdk entry point; decorator and provider authors
|
|
4
4
|
* can rely on this subpath when composing or promoting runtime verbs.
|
|
5
5
|
*/
|
|
6
|
-
export type { ActivationState, GovernanceRuntimeKernel, GovernanceRuntimeKernelFactory, HostDispatchOptions, LineageRuntimeKernel, LineageRuntimeKernelFactory, RuntimeKernel, RuntimeKernelFactory,
|
|
6
|
+
export type { ActivationState, GovernanceRuntimeKernel, GovernanceRuntimeKernelFactory, HostDispatchOptions, LineageRuntimeKernel, LineageRuntimeKernelFactory, RuntimeKernel, RuntimeKernelFactory, WaitForProposalRuntimeKernel, } from "./compat/internal.js";
|
|
7
|
+
export type { SimulateResult as KernelSimulateResult } from "./compat/internal.js";
|
|
8
|
+
import type { SimulateResult as InternalKernelSimulateResult } from "./compat/internal.js";
|
|
9
|
+
import type { ManifestoDomainShape } from "./types.js";
|
|
10
|
+
/**
|
|
11
|
+
* @deprecated Renamed to {@link KernelSimulateResult}: this provider-seam
|
|
12
|
+
* type shares its name with the projected `SimulateResult` on the main
|
|
13
|
+
* entry while having a different (canonical) shape. The alias will be
|
|
14
|
+
* removed in the next major release.
|
|
15
|
+
*/
|
|
16
|
+
export type SimulateResult<T extends ManifestoDomainShape = ManifestoDomainShape> = InternalKernelSimulateResult<T>;
|
|
7
17
|
export { activateComposable, assertComposableNotActivated, attachExtensionKernel, attachRuntimeKernelFactory, createRuntimeKernel, getActivationState, getRuntimeKernelFactory, } from "./compat/internal.js";
|
|
8
18
|
export { createBaseRuntimeInstance } from "./runtime/base-runtime.js";
|
|
19
|
+
export { mapBlockedAdmission, toBlocker } from "./runtime/admission-failure.js";
|