@triscope/core
v0.5.0
Published
Triscope runtime: Element contract, multi-camera lab harness, Vite telemetry plugin.
Maintainers
Readme
@triscope/core
The triscope lab runtime. Wraps a Three.js + WebGPU scene in a small Element
contract and boots a deterministic, machine-inspectable "lab" page that the
@triscope/mcp tools (and a human)
can observe and tune live.
import { runLab, runSceneLab, runSceneView } from '@triscope/core';
// Single element:
runLab(myElement);
// A scene of N namespaced elements (runtime add/remove):
runSceneLab({ elements: [ship, sea, sky] });
// Zero-boilerplate: wrap any existing THREE.Object3D (auto cameras + autoKnobs):
runSceneView(myGroup, { autoKnobs: true });What's in here
runLab/runSceneLab/runSceneView— the lab entry points.Element—{ name, cameras | 'auto', mount() → { root, dispose }, knobs?, telemetry?, motionProbes?, … }.autoCameras(bounds)— four fitted camera presets from an AABB.- The Vite telemetry plugin:
import { triscopeTelemetryPlugin } from '@triscope/core/vite'(serves/__state,/__knob,/__manifest,/__scene).
A single-element runLab page uses bare camera/knob names; a runSceneLab
scene namespaces them <element>.<key>.
Scaffold a project
npm init triscope my-app # greenfield
npx triscope adopt # retrofit an existing Vite + Three projectPart of the triscope monorepo. MIT.
