@vizualmodel/vmblu-runtime
v0.5.5
Published
vmblu runtime javascript library for running node-based apps
Readme
@vizualmodel/vmblu
Runtime for vmblu apps — a message-passing engine that runs node graphs defined in vmblu JSON models.
This package exposes a small public API and is intended to be used by code generated by the vmblu editor.
Install
npm i @vizualmodel/vmblu-runtime @vizualmodel/vmblu-cli- ESM + CJS builds (no browser UMD bundle).
- Requires Node 18+ (works in Vite/webpack/etc. for browser targets).
Quick start
Most projects won’t call the runtime directly—vmblu generates the source that imports it. If you do want to bootstrap manually:
// ESM
import {Runtime} from "@vizualmodel/vmblu-runtime/rt-base";
// prepare all the nodes in the application
const runtime = new Runtime(nodeList)
// run the application
runtime.start();CommonJS usage:
const {Runtime} = require("@vizualmodel/vmblu-runtime/rt-base");
const runtime = new Runtime(nodeList);API (minimal)
new Runtime(nodeList, options)
Bootstraps the runtime for a vmblu model.
nodeList: vmblu JSON model (nodes, routes, pins)options(optional) runtime-specific configuration
Returns a runtime object:
start
Runtime variants
| Runtime | Browser | Node.js | Safety/ALS | Agent |
|---|---:|---:|---:|---:|
| @vizualmodel/vmblu-runtime/rt-base | yes | yes | no | no |
| @vizualmodel/vmblu-runtime/rt-browser-agent | yes | yes | no | yes |
| @vizualmodel/vmblu-runtime/rt-als | no | yes | yes | no |
| @vizualmodel/vmblu-runtime/rt-nodejs-agent | no | yes | yes | yes |
Use rt-browser-agent for browser apps that need the agent/tool broker without
Node.js safety instrumentation. Use rt-nodejs-agent for Node.js apps that need both
agent features and ALS-based safety attribution.
safety.enable({ mode }, tx)
Available from @vizualmodel/vmblu-runtime/rt-als.
mode:off,warn, orenforce- forwards structured events as
security.event - event shape:
{
ts: 1710000000000,
node: "My Node",
cap: "proc:exec" | "net:egress" | "fs:write" | "fs:delete",
detail: {}
}Why no single-file bundle?
This package is published library-style for modern toolchains (tree-shakable ESM, CJS for compatibility).
If you need a <script>-friendly UMD build for demos, open an issue—happy to add one later.
Versioning
Semantic Versioning:
- patch: fixes
- minor: new, non-breaking exports/features
- major: breaking API changes
License
Apache-2.0 © Vizual Model
