<LLMSceneBuilder />
<LLMSceneBuilder /> adds an LLM Scene Builder panel to the visualizer dashboard. You type a natural-language instruction (“Move the arm 200 mm forward along X”), the plugin calls your onInfer callback with the current frame state, and presents a diff of every proposed field change before anything is applied. The user confirms or cancels — no frame is mutated until confirmation.
The plugin is model-agnostic: you wire in whatever LLM backend you prefer via the onInfer prop.
A robot-outline button appears in the dashboard. Clicking it opens the LLM Scene Builder floating panel. Enter a prompt and press Submit (or Enter) — the panel shows a diff table while the LLM responds, then lets the user confirm or cancel.
| Prop | Type | Default | Description |
|---|---|---|---|
onInfer | InferCallback | — | Required. Called with the prompt and current frame state; must return proposed deltas and an explanation. |
InferCallback
Section titled “InferCallback”The plugin passes every component that has a frame defined:
Your callback should return:
updates— an array ofFrameDeltaobjects describing changes (see below). Omit any field that should remain unchanged.explanation— a human-readable summary shown above the diff table.refusal— optional. When set, the plugin skips the diff and shows the message in its error state instead. Use it for requests the plugin cannot fulfil (e.g. adding a new component).
FrameDelta
Section titled “FrameDelta”The plugin validates every delta before showing the diff: unknown component names, self-referential parent assignments, non-finite numbers, and geometry with missing or non-positive dimensions are surfaced as errors without blocking the rest of the update batch.
The scene-builder contract
Section titled “The scene-builder contract”Getting good deltas out of a model is mostly prompt work: millimeters, Euler degrees wrapped to [-180, 180], deltas rather than whole frames, one entry per component, and a refusal policy for “add a component”. That prompt and its schemas ship with the package so you don’t have to rebuild them:
This is a separate entry point from /plugins on purpose. /plugins is a Svelte barrel — importing it from a Node or edge handler pulls in every plugin’s components. /scene-builder is pure TypeScript with no Svelte, three.js, or DOM dependency, so it is safe to import server-side.
Nothing here is required. It is a reference implementation of the contract onInfer is built around: bringing your own model means changing the call, not rewriting the prompt.
Example: using the Anthropic SDK
Section titled “Example: using the Anthropic SDK”SceneBuilderResponseSchema is a Zod schema, so it can drive structured outputs directly — the model is constrained to the response shape rather than asked to produce JSON and hoped at:
Any provider works — the prompt and schemas are provider-agnostic. Use whichever SDK you prefer and validate the result with SceneBuilderResponseSchema before returning it.