Metakit / API
@doeixd/metakit/interpreter
Effect-native Interpreter service and composable middleware layers
(@doeixd/metakit/interpreter).
Provides Interpreter as an Effect Context.Reference (defaulting to the
in-memory evaluator, mirroring Solver in @doeixd/metakit/prove), so applications
supply foreign operations (Operation.define), tracing spans, audit
observers, or foreign-op allowlists once via Effect Layers instead of
threading { foreign } options through every call site.
Functions
allow | Evaluate rule, one of policy.rules, using the current Interpreter; a rule of another policy throws. |
evalExpr | Evaluate expr against env using the current Interpreter. |
judge | Partially evaluate boolean expr against partial using the current Interpreter. |
layer | Provide an in-memory Interpreter configured with optional foreign implementations. |
makeMemoryBackend | Construct an in-memory InterpreterBackend with optional ambient foreign implementations. |
prepare | Prepare expr into a preplanned, CSP-safe closure tree bound to the current Interpreter backend's foreign table, with ArtifactFingerprint and EvidenceKey… |
residualize | Residualize expr against partial using the current Interpreter. |
run | Execute a transition (returning the next State) using the current Interpreter. |
runFn | Execute a Fn with contract checking (runChecked) using the current Interpreter. |
step | Execute a transition step (returning { state, emitted }) using the current Interpreter. |
withAllowlist | Sandbox layer: restricts the current Interpreter's foreign implementations (including any caller-supplied step options) to only those whose exact id@version… |
withForeign | Merge additional foreign operation implementations onto the current Interpreter. |
withObserver | Middleware layer that notifies observer after every interpreter operation, measuring elapsed duration using Effect's Clock. |
withTracing | Wrap the current Interpreter so every operation emits an Effect.withSpan. |
Values
foreign | Read the foreign operation implementations registered on the current Interpreter. |
Interpreter | The ambient MetaKit interpreter in the Effect context. Defaults to memoryBackend; override with Interpreter.layer(...) or middleware layers (withForeign,… |
memoryBackend | Default in-memory backend (no foreign operations registered). |
Interfaces
Types