Skip to main content
VelinStyle v1.4.0
⌂ Home

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

APIPurpose
bootFromDOM(root, { adapt })Single central boot with optional Adapt
startAdapt(root, options)Create or return the shared controller
applyIntentValidate → guardrails → semantic apply → audit
getAuditLogRead semantic decision history
undoLast / undoAllRestore inverse patches
getVelinAPI / getSemanticStateRead semantic element state

Events

EventMeaning
velin-adapt-startController / semantic observation started
velin-adapt-changeRecognized contract attribute changed
velin-adapt-applyIntent applied
velin-adapt-errorValidation or guardrail rejection
velin-adapt-stopController stopped
velin-adapt-ai-start|rank|error|stopSafe Local AI status payloads

Export

import { startAdapt, applyIntent, getVelinAPI, getSemanticState } from '@birdapi/velinstyle/adapt';