Runtime API & Events 1.4.0
Implemented entry points share one document/controller lifecycle under the existing runtime.
Boot and controller
await bootFromDOM(document, { adapt: true });
const controller = startAdapt(document, { auto: false });
controller.applyIntent(intent);
controller.getAuditLog();
controller.undoLast();
controller.undoAll();
Semantic reads
const api = getVelinAPI(element);
api.getSemanticState();
getSemanticState(element);
API roles
| API | Purpose |
|---|
bootFromDOM(root, { adapt }) | Single central boot with optional Adapt |
startAdapt(root, options) | Create or return the shared controller |
applyIntent | Validate → guardrails → semantic apply → audit |
getAuditLog | Read semantic decision history |
undoLast / undoAll | Restore inverse patches |
getVelinAPI / getSemanticState | Read semantic element state |
Events
| Event | Meaning |
|---|
velin-adapt-start | Controller / semantic observation started |
velin-adapt-change | Recognized contract attribute changed |
velin-adapt-apply | Intent applied |
velin-adapt-error | Validation or guardrail rejection |
velin-adapt-stop | Controller stopped |
velin-adapt-ai-start|rank|error|stop | Safe Local AI status payloads |
Export
import { startAdapt, applyIntent, getVelinAPI, getSemanticState } from '@birdapi/velinstyle/adapt';