@xenolithengine/graph-plugin-runtime
v0.7.0-beta.3
Published
Blueprint-style node runtime for XenolithGraph: typed exec/data primitives + a headless interpreter that runs a graph as a simulation. Installs as an editor plugin.
Maintainers
Readme
@xenolithengine/graph-plugin-runtime
Blueprint-style node runtime for XenolithGraph: typed exec/data primitives + a headless interpreter that runs a graph as a simulation. Installs as an editor plugin.
Experimental — runtime APIs (
Runtime,codegen,RtGraph) may still evolve before v1.0. The editor-plugin surface (runtimePlugin, schemas) tracks the v0.7 BETA freeze.
Part of XenolithGraph — an AI-native, embeddable node-graph editor for the web with its own visual design language (Xen).
Install
pnpm add @xenolithengine/graph-plugin-runtimeUsage
Register primitives + pin types into an editor:
import { XenolithEditor } from '@xenolithengine/graph-editor'
import { runtimePlugin, attachRuntimeBridge } from '@xenolithengine/graph-plugin-runtime'
const editor = await XenolithEditor.init('#graph')
editor.use(runtimePlugin)
attachRuntimeBridge(editor) // drives the live graph + mirrors outputs into widgetsHeadless VM (no editor):
import { Runtime, BUILTIN_PRIMITIVES, type RtGraph } from '@xenolithengine/graph-plugin-runtime'
const rt = new Runtime(BUILTIN_PRIMITIVES)
rt.setVar('x', 3)
rt.tick(myRtGraph)
console.log(rt.getVar('result'))What's exported
runtimePlugin— install into an editor witheditor.use(runtimePlugin)attachRuntimeBridge(editor)— drives the live graph from the editor and mirrors Output values to widgetsRuntime— headless interpreter (tick,getVar,setVar,onAfterTick)codegen(graph, defs)— emits a compiled JS evaluator from anRtGraphAllocate,mandelbrotPixelGraph,mandelbrotPixelReference— reference graphs / nodes for benchmarksBUILTIN_PRIMITIVES,COLLECTION_PRIMITIVES,domainNodes- Schemas:
PIN_TYPES,PRIMITIVE_SCHEMAS,PRIMITIVE_CATEGORY_COLORS,PRIMITIVE_ICONS - Schema-sync helpers:
pinsFromSchemaFields,widgetsFromSchemaFields,schemaPinTypeFor - Value coercion:
asNumber,asBool,asArray - Types:
NodeDef,RtNode,RtPin,RtEdge,RtGraph,PureIO,ExecIO,VmValue
Docs
- API reference — every method exposed by
XenolithEditor - GitHub
MIT © XenolithEngine
