import * as react_jsx_runtime from 'react/jsx-runtime'; import { M as MujocoContextValue, a as MujocoCanvasProps, b as MujocoSimAPI, S as SceneConfig, R as ReadyCallbackInput, c as StepCallbackInput, d as SelectionCallbackInput, e as MujocoModule, f as MujocoRenderOptions, P as PhysicsStepCallback, g as MujocoModel, h as MujocoData, C as ControlGroupInfo, A as ActuatedJointInfo, i as ControlGroupSelector, O as ObservationConfig, j as ObservationResult, I as IkConfig, k as IkContextValue, B as BodyProps, l as IkGizmoProps, D as DragInteractionProps, m as SceneLightsProps, n as ScenarioLightingProps, o as SplatEnvironmentProps, V as VisualScenarioEffectsProps, p as VisualScenarioConfig, q as SplatRendererKind, r as PairedSplatEnvironmentConfig, s as SplatFormat, t as SplatCollisionProxyConfig, u as SplatEnvironmentReadiness, v as SplatCollisionPrimitive, w as SplatEnvironmentReadinessStatus, x as SplatSceneConfigInput, y as SplatSceneConfigState, z as VisualScenarioExecutionContextInput, E as VisualScenarioExecutionContext, F as ScenarioLightingPreset, G as SplatEnvironmentMetadataInput, H as SplatEnvironmentMetadata, J as SplatSceneInput, K as CameraFrameCaptureOptions, L as DebugProps, N as GeomInfo, Q as ContactListenerProps, T as TrajectoryPlayerProps, U as ActuatorInfo, W as Sites, X as SitePositionResult, Y as Sensors, Z as SensorHandle, _ as SensorInfo, $ as Joints, a0 as ScalarJointStateResult, a1 as ArrayJointStateResult, a2 as JointStateOptions, a3 as JointStateResult, a4 as Bodies, a5 as BodyStateResult, a6 as Geoms, a7 as Actuators, a8 as CtrlHandle, a9 as ContactInfo, aa as KeyboardTeleopConfig, ab as KeyboardIkTargetConfig, ac as PolicyConfig, ad as PolicyAPI, ae as RemotePolicyConfig, af as RemotePolicyAPI, ag as ObservationHandle, ah as ObservationOutput, ai as TrajectoryInput, aj as TrajectoryStateChangeInput, ak as PlaybackState, al as TrajectoryFrame, am as FrameCaptureOptions, an as FrameCaptureResult, ao as FrameCaptureBlobResult, ap as FrameCaptureAPI, aq as CameraFrameCaptureAPI, ar as Cameras, as as CameraFrameSequenceCamera, at as CameraFrameCaptureSource, au as CameraFrameSequenceOptions, av as CameraFrameSequenceResult, aw as PolicyCameraFrameStream, ax as PolicyCameraFrameCaptureOptions, ay as PolicyCameraFrameCaptureResult, az as FrameCaptureStatus, aA as PolicyCameraFrameCaptureAPI, aB as CameraFrameCaptureTensorOptions, aC as CameraFrameTensorResult, aD as CameraFrameSequenceRecorderAPI, aE as ImagePointCoordinateSpace, aF as ImagePointProjectionOptions, aG as ImagePointProjectionResult, aH as PolicyVector } from './types-Bu8Aki_j.js'; export { aI as BodyInfo, aJ as CAMERA_FRAME_CAPTURE_PRE_RENDER_USER_DATA_KEY, aK as CAMERA_FRAME_CAPTURE_RENDER_USER_DATA_KEY, aL as CAPTURE_EXCLUDE_KEY, aM as CameraFrameCaptureBlobResult, aN as CameraFrameCaptureQuaternion, aO as CameraFrameCaptureResult, aP as CameraFrameCaptureSession, aQ as CameraFrameCaptureVector3, aR as CameraFramePixelsResult, aS as CameraFrameSequenceCameraSummary, aT as CameraFrameSequenceFrame, aU as CameraFrameSequenceSampleInput, aV as CameraFrameSequenceStepInput, aW as CameraInfo, aX as ControlJointInfo, aY as DebugVirtualCamera, aZ as FrameCaptureTarget, a_ as FrameCaptureTargetRef, a$ as IKSolveFn, b0 as IkGizmoDragInput, b1 as IkSolveInput, b2 as JointInfo, b3 as JointStateKind, b4 as KeyBinding, b5 as KeyboardIkTargetAction, b6 as KeyboardIkTargetBinding, b7 as Keyframes, b8 as ModelActuators, b9 as ModelBodies, ba as ModelCameras, bb as ModelGeoms, bc as ModelJoints, bd as ModelKeyframes, be as ModelOptions, bf as ModelResource, bg as ModelResources, bh as ModelSensors, bi as ModelSites, bj as Models, bk as MujocoContact, bl as MujocoContactArray, bm as MujocoFrameCaptureOptions, bn as ObservationLayoutItem, bo as PhysicsConfig, bp as PhysicsStepInput, bq as PolicyActionChunk, br as PolicyActionInput, bs as PolicyImageTensorLayout, bt as PolicyImageTensorOptions, bu as PolicyImageTensorPixelOptions, bv as PolicyImageTensorRange, bw as PolicyImageTensorResult, bx as PolicyImageTensorSourceOrigin, by as PolicyInferenceInput, bz as PolicyInferenceOutput, bA as PolicyInferenceResult, bB as PolicyObservationInput, bC as RayHit, bD as Register, bE as RegisteredModelMap, bF as RemotePolicyRequestInfo, bG as RemotePolicyRequestInput, bH as RemotePolicyResponseInfo, bI as RemotePolicyStatus, bJ as ResetCallbackInput, bK as ResolvedScenarioCameraConfig, bL as ResolvedScenarioMaterialConfig, bM as ResourceSelector, bN as ScenarioCameraConfig, bO as ScenarioMaterialConfig, bP as SceneMarker, bQ as SceneObject, bR as SensorResult, bS as SiteInfo, bT as SplatAssetConfig, bU as SplatScenarioConfig, bV as StateSnapshot, bW as TrajectoryData, bX as TrajectoryFrameCallbackInput, bY as VisualScenarioMaterialFilterInput, bZ as XmlPatch, b_ as captureCameraFrame, b$ as captureCameraFrameBlob, c0 as captureCameraFrameTensor, c1 as createCameraFrameCaptureSession, c2 as dataUrlToPolicyImageTensor, c3 as getContact, c4 as imageDataToPolicyImageTensor, c5 as pixelsToPolicyImageTensor, c6 as registerModelResources, c7 as renderCameraFrameToCanvas } from './types-Bu8Aki_j.js'; import * as React$1 from 'react'; import { CSSProperties, RefObject } from 'react'; import * as THREE from 'three'; import { ThreeElements } from '@react-three/fiber'; /** * Hook to access the MuJoCo WASM module. */ declare function useMujocoWasm(): MujocoContextValue; type MujocoWasmVariant = 'single' | 'threaded' | 'auto'; interface MujocoLoaderOptions { locateFile?: (path: string) => string; printErr?: (text: string) => void; } type MujocoLoader = (options?: MujocoLoaderOptions) => Promise; interface MujocoProviderProps { wasmUrl?: string; /** Optional URL for the multi-threaded WASM asset. */ mtWasmUrl?: string; /** * Optional official multi-threaded loader, usually imported from * `@mujoco/mujoco/mt`. It is supplied by the app so the default package path * does not force every bundler to process the threaded Emscripten build. */ threadedLoader?: MujocoLoader; /** * MuJoCo WASM build to load. `single` is the default and works everywhere. * `threaded` requires `threadedLoader` and cross-origin isolation. `auto` * uses threaded only when both conditions are satisfied. */ wasmVariant?: MujocoWasmVariant; /** Timeout in ms for WASM module load. Default: 30000. */ timeout?: number; children: React.ReactNode; onError?: (error: Error) => void; } /** * MujocoProvider — WASM / module lifecycle. * Loads the MuJoCo WASM module on mount and provides it to children via context. */ declare function MujocoProvider({ wasmUrl, mtWasmUrl, threadedLoader, wasmVariant, timeout, children, onError, }: MujocoProviderProps): react_jsx_runtime.JSX.Element; /** * MujocoCanvas — thin R3F Canvas wrapper for MuJoCo scenes. * Accepts all R3F Canvas props and forwards them through. * Supports declarative physics config props (spec 1.1). * * Forward ref exposes MujocoSimAPI (not the canvas element). */ declare const MujocoCanvas: React$1.ForwardRefExoticComponent & React$1.RefAttributes>; interface MujocoPhysicsProps { /** Scene/robot configuration. */ config: SceneConfig; /** Fires when model is loaded and API is ready. */ onReady?: (input: ReadyCallbackInput) => void; /** Fires on scene load failure. */ onError?: (error: Error) => void; /** Called each physics step. */ onStep?: (input: StepCallbackInput) => void; /** Called on body double-click selection. */ onSelection?: (input: SelectionCallbackInput) => void; /** Override model gravity. */ gravity?: [number, number, number]; /** Override model.opt.timestep. */ timestep?: number; /** mj_step calls per frame. */ substeps?: number; /** Declarative pause. */ paused?: boolean; /** Simulation speed multiplier. */ speed?: number; /** Interpolate rendered body poses between fixed physics steps. */ interpolate?: boolean; children: React.ReactNode; } /** * MujocoPhysics — physics provider for use inside a user-owned R3F Canvas. * * This is the R3F-idiomatic alternative to MujocoCanvas. Instead of wrapping * the Canvas, place this inside your own : * * ```tsx * * * * * * * * * ``` * * Forward ref exposes MujocoSimAPI. */ declare const MujocoPhysics: React$1.ForwardRefExoticComponent>; type UseMujocoResult = { status: 'loading'; isPending: true; isReady: false; isError: false; error: null; api: null; mjModelRef: null; mjDataRef: null; } | { status: 'error'; isPending: false; isReady: false; isError: true; error: string; api: null; mjModelRef: null; mjDataRef: null; } | { status: 'ready'; isPending: false; isReady: true; isError: false; error: null; api: MujocoSimAPI; mjModelRef: React.RefObject; mjDataRef: React.RefObject; }; declare function useMujoco(): UseMujocoResult; declare function useBeforePhysicsStep(callback: PhysicsStepCallback): void; declare function useAfterPhysicsStep(callback: PhysicsStepCallback): void; interface MujocoSimProviderProps { mujoco: MujocoModule; config: SceneConfig; apiRef?: React.ForwardedRef; onReady?: (input: ReadyCallbackInput) => void; onError?: (error: Error) => void; onStep?: (input: StepCallbackInput) => void; onSelection?: (input: SelectionCallbackInput) => void; gravity?: [number, number, number]; timestep?: number; substeps?: number; paused?: boolean; speed?: number; interpolate?: boolean; renderOptions?: MujocoRenderOptions; hiddenBodies?: readonly string[]; children: React.ReactNode; } declare function MujocoSimProvider({ mujoco, config, apiRef: externalApiRef, onReady, onError, onStep, onSelection, gravity, timestep, substeps, paused, speed, interpolate, renderOptions, hiddenBodies, children, }: MujocoSimProviderProps): react_jsx_runtime.JSX.Element; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Reads a null-terminated C string from MuJoCo's WASM memory. */ declare function getName(mjModel: MujocoModel, address: number): string; /** * Find a site by name in the MuJoCo model. Returns -1 if not found. */ declare function findSiteByName(mjModel: MujocoModel, name: string): number; /** * Find an actuator by name in the MuJoCo model. Returns -1 if not found. */ declare function findActuatorByName(mjModel: MujocoModel, name: string): number; /** * Find a keyframe by name in the MuJoCo model. Returns -1 if not found. */ declare function findKeyframeByName(mjModel: MujocoModel, name: string): number; /** * Find a body by name in the MuJoCo model. Returns -1 if not found. */ declare function findBodyByName(mjModel: MujocoModel, name: string): number; /** * Find a joint by name in the MuJoCo model. Returns -1 if not found. */ declare function findJointByName(mjModel: MujocoModel, name: string): number; /** * Find a geom by name in the MuJoCo model. Returns -1 if not found. */ declare function findGeomByName(mjModel: MujocoModel, name: string): number; /** * Find a sensor by name in the MuJoCo model. Returns -1 if not found. */ declare function findSensorByName(mjModel: MujocoModel, name: string): number; /** * Find a tendon by name in the MuJoCo model. Returns -1 if not found. */ declare function findTendonByName(mjModel: MujocoModel, name: string): number; declare function getActuatedJoints(mjModel: MujocoModel): ActuatedJointInfo[]; declare function getControlMap(mjModel: MujocoModel): ControlGroupInfo; declare function resolveControlGroup(mjModel: MujocoModel, selector: ControlGroupSelector): ControlGroupInfo | null; declare function createContiguousControlGroup(mjModel: MujocoModel, count: number): ControlGroupInfo; interface LoadResult { mjModel: MujocoModel; mjData: MujocoData; } /** * Config-driven scene loader — replaces the old single-model patching approach. */ declare function loadScene(mujoco: MujocoModule, config: SceneConfig, onProgress?: (msg: string) => void): Promise; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Build a flat observation vector plus a layout map from live MuJoCo state. * * Missing named resources are skipped. The returned layout is the source of * truth for the vector produced from the current model. */ declare function buildObservation(model: MujocoModel, data: MujocoData, config: ObservationConfig): ObservationResult; /** * @license * SPDX-License-Identifier: Apache-2.0 */ interface ControllerOptions { /** Unique name for this controller (used as displayName). */ name: string; /** Default values merged under user-supplied config. */ defaultConfig?: Partial; } type ControllerComponent = React.FC<{ config?: Partial; children?: React.ReactNode; }> & { controllerName: string; defaultConfig: Partial; }; /** * Factory that produces a typed controller component. * * Controllers are React components that plug into the MuJoCo simulation tree. * Inside `Impl`, use any hooks (`useMujoco`, `useBeforePhysicsStep`, etc.) * to interact with the physics engine. * * @example * ```tsx * const MyController = createController<{ speed: number }>( * { name: 'my-controller', defaultConfig: { speed: 1.0 } }, * function MyControllerImpl({ config }) { * const wheel = useCtrl(ModelActuators.mobile.leftWheel); * * useBeforePhysicsStep(({ data }) => { * wheel.write(config.speed); * }); * return null; * }, * ); * * // Usage: * * ``` */ declare function createController(options: ControllerOptions, Impl: React.FC<{ config: TConfig; children?: React.ReactNode; }>): ControllerComponent; /** * Factory that produces a typed controller hook. * * Same config stabilization and default merging as `createController`, * but returns a hook instead of a component. Pass `null` to disable. * * @example * ```tsx * const useMyController = createControllerHook( * { name: 'useMyController', defaultConfig: { gain: 1.0 } }, * function useMyControllerImpl(config) { * // config is MyConfig | null — hooks must be called unconditionally * const joint = useCtrl(config?.actuator ?? ModelActuators.franka.actuator1); * * useBeforePhysicsStep(({ data }) => { * if (!config) return; * joint.write(config.gain * Math.sin(data.time)); * }); * if (!config) return null; * return { /* value *\/ }; * }, * ); * * // Usage: * const value = useMyController({ gain: 2.0 }); * const disabled = useMyController(null); // returns null * ``` */ declare function createControllerHook(options: ControllerOptions, useImpl: (config: TConfig | null) => TValue | null): (config: TConfig | null) => TValue | null; /** * @license * SPDX-License-Identifier: Apache-2.0 */ declare const useIkController: (config: IkConfig | null) => IkContextValue | null; /** * @license * SPDX-License-Identifier: Apache-2.0 */ interface GenericIKOptions { maxIterations: number; damping: number; tolerance: number; epsilon: number; posWeight: number; rotWeight: number; /** Per-iteration |Δq| cap in radians; bounds near-singular DLS steps. */ maxStepRad: number; jointLimits?: ReadonlyArray; } /** * Generic Damped Least-Squares IK solver. * Uses finite-difference Jacobian via MuJoCo's mj_forward. * Works for any MuJoCo model — no robot-specific parameters. */ declare class GenericIK { private mujoco; constructor(mujoco: MujocoModule); /** * Solve IK for a target 6-DOF pose. * @param model MuJoCo model * @param data MuJoCo data (qpos will be temporarily modified, then restored) * @param siteId Index of the end-effector site to control * @param qposAdr qpos addresses for scalar joints in solve order * @param targetPos Target position in world frame * @param targetQuat Target orientation in world frame * @param currentQ Current joint angles matching qposAdr order * @param opts Optional solver parameters * @returns Joint angles array, or null if solver diverged */ solve(model: MujocoModel, data: MujocoData, siteId: number, qposAdr: ArrayLike, targetPos: THREE.Vector3, targetQuat: THREE.Quaternion, currentQ: ArrayLike, opts?: Partial): number[] | null; } /** * Declarative physics body component. Registers a body definition in the * provider-level registry so it gets injected into the MJCF XML at load time. * * Bodies present at initial mount cause zero extra reloads (useLayoutEffect * runs before the provider's loadScene useEffect). Bodies added/removed after * the initial load trigger a debounced scene reload. */ declare function Body({ name, type, size, position, rgba, mass, freejoint, friction, solref, solimp, condim, group, children, }: BodyProps): react_jsx_runtime.JSX.Element | null; /** * IkGizmo — drei PivotControls that tracks a MuJoCo site. * * Requires a `controller` from `useIkController()`. * * Props: * - `controller` — IkContextValue from `useIkController()`. * - `siteName` — MuJoCo site to track. Defaults to the controller's configured site. * - `scale` — Gizmo handle scale. Default: 0.18. * - `onDrag` — Custom drag callback `({ position, quaternion }) => void`. * When omitted, dragging enables IK and writes to the IK target. * When provided, the consumer handles what happens during drag. */ declare function IkGizmo({ controller, siteName, scale, onDrag }: IkGizmoProps): react_jsx_runtime.JSX.Element | null; interface ContactMarkersProps { /** Maximum contacts to render. Default: 100. */ maxContacts?: number; /** Sphere radius. Default: 0.008. */ radius?: number; /** Color. Default: '#22d3ee'. */ color?: string; /** Show markers. Default: true. */ visible?: boolean; } declare function ContactMarkers({ maxContacts, radius, color, visible, ...groupProps }?: ContactMarkersProps & Omit): react_jsx_runtime.JSX.Element | null; /** * DragInteraction — Ctrl/Cmd+click-drag to apply spring forces to MuJoCo bodies. * * Raycasts against scene meshes to identify bodies, then applies a spring * force pulling the grabbed point toward the cursor each physics frame. * Requires Ctrl (or Cmd on macOS) to avoid conflicting with OrbitControls. * * - `stiffness` — Spring constant * body mass. Default: 250. * - `showArrow` — Show arrow from grab point toward cursor. Default: true. * * Forces compose with useGravityCompensation — the provider zeros * qfrc_applied each frame, then all consumers add to it. */ declare function DragInteraction({ stiffness, showArrow, ...groupProps }: DragInteractionProps & Omit): react_jsx_runtime.JSX.Element | null; /** * @license * SPDX-License-Identifier: Apache-2.0 * * SceneLights — auto-create Three.js lights from MJCF elements (spec 6.3) * * WASM fields used: model.nlight, light_pos, light_dir, light_diffuse, * light_specular, light_active, light_type, light_castshadow, * light_attenuation, light_cutoff, light_exponent, light_intensity * * light_type: 0 = directional, 1 = spot (maps to mjLIGHT_DIRECTIONAL/mjLIGHT_SPOT) * Note: light_directional does NOT exist in WASM — use light_type instead. */ declare function SceneLights({ intensity }: SceneLightsProps): null; declare function ScenarioLighting({ preset, castShadow, intensity, }: ScenarioLightingProps): react_jsx_runtime.JSX.Element; declare function getScenarioBackground(preset: ScenarioLightingPreset | undefined, fallback?: string): string; declare function getScenarioCameraPosition(basePosition: readonly [number, number, number], scenario?: Pick): [number, number, number]; declare function useVisualScenarioExecutionContext({ scenario, environment, renderer, variantId, enabled, }: VisualScenarioExecutionContextInput): VisualScenarioExecutionContext; declare function createVisualScenarioExecutionContext({ scenario, environment, renderer, variantId, enabled, }: VisualScenarioExecutionContextInput): VisualScenarioExecutionContext; declare function VisualScenarioEffects(props: VisualScenarioEffectsProps): null; declare function useVisualScenarioEffects({ scenario, enabled, applyBackground, applyFog, applyRenderer, applyMaterials, background, fogNear, fogFar, materialFilter, }: VisualScenarioEffectsProps): void; /** * Renderer-agnostic Gaussian splat environment boundary. * * This component intentionally does not import a specific 3DGS renderer. Pass a * Spark/GaussianSplats3D object as `children` once the app chooses a renderer, * and pass MuJoCo/MJCF collision proxy visuals via `collisionProxy`. */ declare function SplatEnvironment({ environment, scenario, renderer, src, format, collisionProxy, collisionProxyMetadata, children, showPlaceholder, ...groupProps }: SplatEnvironmentProps): react_jsx_runtime.JSX.Element; declare function useSplatEnvironment({ environment, scenario, renderer, src, format, collisionProxy, }: SplatEnvironmentMetadataInput): SplatEnvironmentMetadata; /** * Resolve a visual scenario's paired splat environment and compose its MJCF * collision proxy into a MuJoCo scene config. * * This hook is renderer-agnostic: apps can use it with Spark, another 3DGS * renderer, or their own Three scene objects while keeping physics collision * files paired with the visual splat metadata. */ declare function useSplatSceneConfig({ sceneConfig, scenario, environment, enabled, renderer, }: SplatSceneConfigInput): SplatSceneConfigState; /** * Resolve a visual scenario's paired splat environment without requiring React. * * Use this in codegen, import validators, backend handoff metadata, or app code * that needs the same behavior as `useSplatSceneConfig` outside a component. */ declare function createSplatSceneConfig({ sceneConfig, scenario, environment, enabled, renderer, }: SplatSceneConfigInput): SplatSceneConfigState; declare function getSplatEnvironmentReadiness({ environment, scenario, renderer, src, format, collisionProxy, enabled, }: { environment?: PairedSplatEnvironmentConfig; scenario?: Pick; renderer?: SplatRendererKind; src?: string; format?: SplatFormat; collisionProxy?: SplatCollisionProxyConfig; enabled?: boolean; }): SplatEnvironmentReadiness; /** * Convert a generic visual scenario splat block into a composable splat * environment config. Visual-only splats are valid; readiness reports whether * a paired MJCF collision proxy is required before training/physics handoff. */ declare function createPairedSplatEnvironment(scenario: Pick, options?: { id?: string; label?: string; description?: string; renderer?: SplatRendererKind; }): PairedSplatEnvironmentConfig | undefined; /** * Compose a MuJoCo scene config with a paired splat collision proxy. * * This keeps the common hybrid setup declarative: * robot XML remains `sceneFile`, the `.spz` remains a visual-only layer, and * the paired MJCF collision proxy is added to `environmentFiles`. */ declare function withSplatEnvironment(sceneConfig: SceneConfig, input: SplatSceneInput, options?: { renderer?: SplatRendererKind; }): SceneConfig; declare function createSplatEnvironmentUserData({ environment, src, format, collisionProxy, readiness, }: { environment?: PairedSplatEnvironmentConfig; src?: string; format?: SplatFormat; collisionProxy?: SplatCollisionProxyConfig; readiness?: SplatEnvironmentReadiness; }): { role: string; environmentId: string | undefined; environmentLabel: string | undefined; splatSrc: string | undefined; splatFormat: SplatFormat; splatRenderer: SplatRendererKind | undefined; collisionProxyStatus: "missing" | "planned" | "generated" | "validated"; collisionProxyXmlPath: string | undefined; collisionProxyPrimitives: SplatCollisionPrimitive[]; readinessStatus: SplatEnvironmentReadinessStatus | undefined; readinessMessage: string | undefined; }; declare function createSparkSplatViewerUrl({ viewerUrl, splatSrc, }: { viewerUrl: string; splatSrc: string; }): string; type SplatCollisionProxyPreviewVector3 = [number, number, number]; interface SplatCollisionProxyGeomPreview { id: string; type: 'box' | 'plane' | 'sphere' | 'capsule' | 'mesh'; position: SplatCollisionProxyPreviewVector3; size: number[]; } interface SplatCollisionProxyPreviewProps extends Omit { collisionProxy?: SplatCollisionProxyConfig | null; xmlText?: string; fetchXml?: (xmlPath: string) => Promise; color?: string; opacity?: number; planeColor?: string; planeOpacity?: number; } type SplatCollisionProxyPreviewStatus = 'idle' | 'loading' | 'ready' | 'error'; interface UseSplatCollisionProxyGeomsOptions { collisionProxy?: SplatCollisionProxyConfig | null; xmlText?: string; fetchXml?: (xmlPath: string) => Promise; enabled?: boolean; } interface SplatCollisionProxyGeomsState { geoms: SplatCollisionProxyGeomPreview[]; status: SplatCollisionProxyPreviewStatus; error: Error | null; xmlPath?: string; } declare function SplatCollisionProxyPreview({ collisionProxy, xmlText, fetchXml, color, opacity, planeColor, planeOpacity, children, ...groupProps }: SplatCollisionProxyPreviewProps): react_jsx_runtime.JSX.Element | null; declare function useSplatCollisionProxyGeoms({ collisionProxy, xmlText, fetchXml, enabled, }: UseSplatCollisionProxyGeomsOptions): SplatCollisionProxyGeomsState; declare function fetchSplatCollisionProxyXml(xmlPath: string): Promise; declare function canFetchSplatCollisionProxyXml(xmlPath: string): boolean; declare function parseSplatCollisionProxyGeoms(xmlText: string): SplatCollisionProxyGeomPreview[]; /** Camera selection + pose options for a live viewport. */ type CameraViewportOptions = Pick; /** * Render the live MuJoCo scene from a named camera into the region covered by * `elementRef`'s DOM element. Call this inside `` with a ref to a * DOM element you position anywhere (it does not need to be in the R3F tree). */ declare function useCameraViewport(elementRef: RefObject, options: CameraViewportOptions): void; interface CameraViewProps extends CameraViewportOptions { className?: string; style?: CSSProperties; } /** * Drop-in live camera pane. Renders an absolutely-positioned overlay `
` * over the canvas showing the selected MuJoCo camera. Position it with * `style`/`className` (the canvas's parent should be positioned). */ declare function CameraView({ className, style, ...options }: CameraViewProps): null; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Stream a live MuJoCo camera into a DOM ``. Each frame the scene is * rendered offscreen from the selected camera and blitted into the canvas, so * it composites normally in the DOM (works inside opaque panels) and does NOT * take over the render loop. Prefer this over `useCameraViewport` for camera * tiles embedded in HTML UI; use `useCameraViewport` for transparent overlays * on a full-bleed canvas. * * Uses the async capture path so Gaussian-splat environments render through * their dedicated capture renderer — streaming a splat scene at full rate does * not disturb the main view's splat sort. */ interface CameraStreamOptions extends CameraFrameCaptureOptions { /** * Optional cap on updates per second. Omit to stream as fast as captures * complete (one capture is in flight at a time regardless). */ fps?: number; /** Pause updates without unmounting. */ paused?: boolean; } /** * Render the live scene from a MuJoCo camera/site/body into `canvasRef`'s * `` every frame (throttled to `fps`). Call inside ``; * the canvas itself can live anywhere in the DOM. */ declare function useCameraStream(canvasRef: RefObject, options: CameraStreamOptions): void; /** * Declarative debug visualization component. * Renders wireframe geoms, site markers, joint axes, contact forces, COM markers, etc. */ declare function Debug({ showGeoms, showSites, showJoints, showCameras, virtualCameras, showContacts, showCOM, showInertia, showTendons, ...groupProps }: DebugProps & Omit): react_jsx_runtime.JSX.Element | null; declare function TendonRenderer(props: Omit): react_jsx_runtime.JSX.Element | null; /** * Renders MuJoCo flex (deformable) bodies as dynamic meshes. * Vertices are updated every frame from flexvert_xpos. */ declare function FlexRenderer(props: Omit): react_jsx_runtime.JSX.Element | null; interface InstancedGeomRendererProps extends Omit { /** Only render geoms from this MuJoCo geom group. */ geomGroup?: number; /** Predicate for selecting geoms. */ filter?: (geom: GeomInfo) => boolean; /** Optional material override for every instanced batch. */ material?: THREE.Material; /** Hide or show the instanced batches. */ visible?: boolean; castShadow?: boolean; receiveShadow?: boolean; } declare function InstancedGeomRenderer({ geomGroup, filter, material, visible, castShadow, receiveShadow, ...groupProps }?: InstancedGeomRendererProps): react_jsx_runtime.JSX.Element | null; /** * @license * SPDX-License-Identifier: Apache-2.0 * * ContactListener — component form of contact events (spec 2.5) */ /** * Component form of useContactEvents. * Fires onContactEnter/onContactExit callbacks when contacts change. */ declare function ContactListener({ body, onContactEnter, onContactExit, }: ContactListenerProps): null; /** * @license * SPDX-License-Identifier: Apache-2.0 * * TrajectoryPlayer — component form of trajectory playback (spec 13.2) */ /** * Component wrapper for useTrajectoryPlayer. * Provides declarative trajectory playback controlled via props. */ declare function TrajectoryPlayer({ trajectory, fps, speed, loop, playing, mode, onFrame, onComplete, onStateChange, }: TrajectoryPlayerProps): null; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Returns a stable array of actuator metadata for building control UIs. * Computed once when the model loads. Consumer reads/writes data.ctrl[id] directly. */ declare function useActuators(): ActuatorInfo[]; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Returns reactive refs for a MuJoCo site's world position and orientation. * Refs are updated every frame without triggering React re-renders. */ declare function useSitePosition(siteName: Sites): SitePositionResult; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Applies gravity compensation each physics frame by adding qfrc_bias * (gravity + Coriolis forces) to qfrc_applied for each DOF. * * The provider zeros qfrc_applied at the start of each frame, so this * hook (and DragInteraction) compose correctly — both add to a clean slate. */ declare function useGravityCompensation(enabled?: boolean): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useSensor / useSensors — MuJoCo sensor access hooks (spec 2.1) */ /** * Access a single MuJoCo sensor by name. Returns a `SensorHandle` with * `read()`, `dim`, and `name`. The backing array is updated every physics * frame without causing React re-renders. */ declare function useSensor(name: Sensors): SensorHandle; /** * Enumerate all sensors in the loaded MuJoCo model. * Returns a stable array recomputed only when the model changes. */ declare function useSensors(): SensorInfo[]; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useJointState — per-joint position/velocity access (spec 2.3) */ /** * Track a MuJoCo joint's position and velocity by name. * Values are updated every physics frame via refs (no re-renders). * * For hinge/slide joints, position/velocity are scalar numbers. * For ball joints, position is quat (4), velocity is angular vel (3). * For free joints, position is pos+quat (7), velocity is lin+ang vel (6). */ declare function useJointState(name: Joints, options: { kind: 'scalar'; }): ScalarJointStateResult; declare function useJointState(name: Joints, options: { kind: 'array'; }): ArrayJointStateResult; declare function useJointState(name: Joints, options?: JointStateOptions): JointStateResult; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useBodyState — per-body position/velocity tracking (spec 2.2) */ /** * Track a MuJoCo body's world position, quaternion, and velocities. * All values are ref-based — updated every physics frame without re-renders. */ declare function useBodyState(name: Bodies): BodyStateResult; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Ref-based world pose hooks for named MuJoCo bodies, geoms, and sites. */ type PoseResourceKind = 'body' | 'geom' | 'site'; interface PoseReadout { id: RefObject; found: RefObject; position: RefObject; quaternion: RefObject; } declare function useBodyPose(name: Bodies): PoseReadout; declare function useGeomPose(name: Geoms): PoseReadout; declare function useSitePose(name: Sites): PoseReadout; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useCtrl — handle-based read/write access to a named actuator's ctrl value (spec 3.1) */ /** * Access a single actuator's control value by name. * * Returns a `CtrlHandle` with `read()` and `write()` methods that * operate directly on `data.ctrl` without causing React re-renders. */ declare function useCtrl(name: Actuators): CtrlHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Cooperative actuator/control ownership for policies, IK, teleop, and replay. */ interface ControlWriterConflict { actuatorIndex: number; owner: string; requestedBy: string; } interface ControlWriterOptions { owner: string; selector?: ControlGroupSelector; enabled?: boolean; warnOnConflict?: boolean; allowSameOwner?: boolean; onConflict?: (conflicts: ControlWriterConflict[]) => void; } interface ControlWriterWriteOptions { force?: boolean; } interface ControlWriterHandle { owner: string; group: RefObject; conflicts: RefObject; canWrite: () => boolean; read: () => Float64Array; write: (values: ArrayLike, options?: ControlWriterWriteOptions) => boolean; release: () => void; } declare function useControlWriter(options: ControlWriterOptions): ControlWriterHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Typed, named control groups. Define the group once (like a zod schema or a * tanstack route), then read/set actuators by name with inferred keys — no * positional arrays, no `as const`, no owner bookkeeping. */ type StringKeyOf = Extract; type ControlDefinitionMap = Record; type ControlValues = Partial>; /** * A typed description of a set of actuators, keyed by name. Create it once with * {@link controlGroup} and reuse it across controllers and scripts; the key * union flows through to {@link useControlGroup}. */ interface ControlGroup { readonly keys: readonly K[]; } /** * Declare a named control group. With the Vite plugin / codegen active, names * are constrained to the model's registered actuators (a wrong or stale name is * a compile error). Without it, the literal names you pass are still inferred — * no `as const` required (the `const` type parameter captures them). */ declare function controlGroup(names: T): ControlGroup; interface DefinedControls { readonly controls: TControls; readonly aliases: readonly StringKeyOf[]; readonly keys: readonly TControls[StringKeyOf][]; } declare function defineControls(controls: TControls): DefinedControls; interface ControlGroupSetOptions { /** Write even when another control writer owns one of these actuators. */ force?: boolean; } interface ControlGroupHandle { /** The cooperative-ownership identity used for conflict detection. */ owner: string; /** Set a single actuator by name. Returns false if blocked by a conflict. */ set(name: K, value: number, options?: ControlGroupSetOptions): boolean; /** Set one or more actuators by name. Returns false if blocked by a conflict. */ patch(values: ControlValues, options?: ControlGroupSetOptions): boolean; /** Write values in the same order as the declared control group. */ write(values: ArrayLike, options?: ControlGroupSetOptions): boolean; /** Read one actuator value by name. */ get(name: K): number; /** Read the current control value of every actuator in the group, by name. */ read(): Record; /** Whether this group can currently write (no unresolved conflicts). */ canWrite(): boolean; /** Release this group's actuator ownership. */ release(): void; } type UseControlGroupOptions = Omit & { /** Human-readable conflict label. */ label?: string; /** Override the generated conflict owner id. Prefer `label` for normal use. */ owner?: string; }; interface ControlsHandle { /** The cooperative-ownership identity used for conflict detection. */ owner: string; /** Set one alias by name. Returns false if blocked by a conflict. */ set(name: StringKeyOf, value: number, options?: ControlGroupSetOptions): boolean; /** Set one or more aliases by name. Returns false if blocked by a conflict. */ patch(values: ControlValues>, options?: ControlGroupSetOptions): boolean; /** Write values in the same order as the `defineControls()` object. */ write(values: ArrayLike, options?: ControlGroupSetOptions): boolean; /** Read one alias value by name. */ get(name: StringKeyOf): number; /** Read every alias value. */ read(): Record, number>; /** Whether this group can currently write (no unresolved conflicts). */ canWrite(): boolean; /** Release this group's actuator ownership. */ release(): void; } declare function useControlGroup(group: ControlGroup, options?: UseControlGroupOptions): ControlGroupHandle; declare function useControls(definition: DefinedControls, options?: UseControlGroupOptions): ControlsHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useContacts — structured contact query hook (spec 2.4) * useContactEvents — contact enter/exit events (spec 2.5) */ /** * Track contacts for a specific body (or all contacts if no body specified). * Calls the callback every physics frame with current contact list. * Reads `data.ncon` first to avoid allocating for zero contacts. */ declare function useContacts(bodyName?: Bodies, callback?: (contacts: ContactInfo[]) => void): React.RefObject; /** * Contact enter/exit events for a specific body (spec 2.5). * Tracks which geom pairs are in contact frame-to-frame and fires * onEnter/onExit callbacks on transitions. */ declare function useContactEvents(bodyName: Bodies, handlers: { onEnter?: (info: ContactInfo) => void; onExit?: (info: ContactInfo) => void; }): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Bounded contact history for rollout verification and debugging. */ interface ContactHistoryEntry extends ContactInfo { time: number; body1: number; body1Name: string; body2: number; body2Name: string; } interface ContactHistoryOptions { maxLength?: number; bodyNames?: readonly string[]; geomNames?: readonly string[]; includeWorldBody?: boolean; } interface ContactHistoryHandle { entries: RefObject; clear: () => void; countPair: (nameA: string, nameB: string) => number; } declare function useContactHistory(options?: ContactHistoryOptions): ContactHistoryHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useKeyboardTeleop — keyboard teleoperation hook (spec 12.1) */ /** * Map keyboard keys to actuator commands. * * Supports three binding modes: * - `delta`: Add delta to actuator value while key is held * - `toggle`: Toggle between two values on key press * - `set`: Set actuator to a fixed value while key is held */ declare function useKeyboardTeleop(config: KeyboardTeleopConfig): void; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Moves an existing IK target from keyboard input. * * This hook is intentionally robot-agnostic: it only edits the target owned by * `useIkController`, then lets the normal IK solver write robot controls. */ declare function useKeyboardIkTarget(config: KeyboardIkTargetConfig | null): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * usePolicy — policy decimation loop hook (spec 10.1) */ /** * Framework-agnostic policy execution hook. * * Manages a decimation loop: calls `onObservation` to build observations * at the specified frequency, then calls `onAction` to apply the policy output. * The actual inference (ONNX, TF.js, custom) is the consumer's responsibility. * * @param config Policy configuration * @returns { step, isRunning } control handles */ declare function usePolicy(config: PolicyConfig): PolicyAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useRemotePolicy — HTTP JSON inference wrapper around usePolicy. */ /** * Run a policy whose inference step lives behind an HTTP JSON endpoint. * * The hook keeps `usePolicy` responsible for timing, queueing, and pause/reset * behavior. This wrapper only builds requests, parses responses, and exposes * request metadata for HUDs and debugging. */ declare function useRemotePolicy(config: RemotePolicyConfig): RemotePolicyAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 */ /** * Live observation reader for policy loops and telemetry. * * The handle is stable; call `read()` inside callbacks to sample the latest * MuJoCo model/data state without forcing React renders. */ declare function useObservation(config: ObservationConfig): ObservationHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Named policy observation builders with layout and units metadata. */ type NamedObservationMissing = 'skip' | 'zeros' | 'throw'; interface NamedObservationInput { model: MujocoModel; data: MujocoData; } interface NamedObservationField { name: string; size: number; units?: string; read: (input: NamedObservationInput) => ArrayLike | number | null | undefined; } interface NamedObservationLayoutItem { name: string; start: number; size: number; units?: string; } interface NamedObservationOptions { fields: readonly NamedObservationField[]; output?: ObservationOutput; missing?: NamedObservationMissing; } interface NamedObservationResult { values: Float32Array | Float64Array; layout: NamedObservationLayoutItem[]; } declare function readNamedObservation(model: MujocoModel, data: MujocoData, options: NamedObservationOptions): NamedObservationResult; declare function createNamedObservationBuilder(options: NamedObservationOptions): (model: MujocoModel, data: MujocoData) => NamedObservationResult; declare function qposField(name: string, index: number, units?: string): NamedObservationField; declare function qvelField(name: string, index: number, units?: string): NamedObservationField; declare function ctrlField(name: string, index: number, units?: string): NamedObservationField; declare function bodyPositionField(name: Bodies, units?: string): NamedObservationField; declare function geomPositionField(name: Geoms, units?: string): NamedObservationField; declare function sitePositionField(name: Sites, units?: string): NamedObservationField; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Stable React handle for named policy observations. */ interface NamedObservationHandle { read: () => NamedObservationResult; readValues: () => Float32Array | Float64Array; } declare function useNamedObservation(options: NamedObservationOptions): NamedObservationHandle; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useTrajectoryPlayer — trajectory playback/scrubbing (spec 13.2) */ interface TrajectoryPlayerOptions { fps?: number; speed?: number; loop?: boolean; mode?: 'kinematic' | 'physics'; onComplete?: () => void; onStateChange?: (input: TrajectoryStateChangeInput) => void; } /** * Play back a trajectory, overriding simulation state. * * Accepts either `TrajectoryFrame[]` (from useTrajectoryRecorder) or * `number[][]` (raw qpos arrays). * * In `kinematic` mode (default), the simulation is paused and qpos is * set directly each frame with mj_forward for rendering. * * In `physics` mode, the simulation keeps running and ctrl values from * the trajectory are applied each physics step via useBeforePhysicsStep. */ declare function useTrajectoryPlayer(trajectory: TrajectoryInput, options?: TrajectoryPlayerOptions): { play: () => void; pause: () => void; seek: (frameIdx: number) => void; reset: () => void; setSpeed: (s: number) => void; readonly state: PlaybackState; readonly frame: number; readonly playing: boolean; readonly totalFrames: number; readonly progress: number; }; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useTrajectoryRecorder — trajectory recording hook (spec 13.1) */ interface RecorderOptions { fields?: ('qpos' | 'qvel' | 'ctrl' | 'sensordata')[]; } /** * Record simulation trajectories for analysis, replay, or training data. */ declare function useTrajectoryRecorder(options?: RecorderOptions): { start: () => void; stop: () => TrajectoryFrame[]; downloadJSON: () => void; downloadCSV: () => void; readonly recording: boolean; readonly frameCount: number; readonly frames: TrajectoryFrame[]; }; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useGamepad — gamepad teleoperation hook (spec 12.2) */ interface GamepadConfig { /** Map gamepad axis index to actuator name. */ axes?: Record; /** Map gamepad button index to actuator name. */ buttons?: Record; /** Axis deadzone. Default: 0.1. */ deadzone?: number; /** Scale factor for axis values. Default: 1.0. */ scale?: number; /** Gamepad index. Default: 0 (first connected). */ gamepadIndex?: number; enabled?: boolean; } /** * Map gamepad axes and buttons to actuator controls. * Axes map their -1..1 value (scaled) to the actuator. * Buttons map their 0..1 pressed value to the actuator. */ declare function useGamepad(config: GamepadConfig): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useVideoRecorder — canvas video recording hook (spec 13.3) */ interface VideoRecorderOptions { fps?: number; mimeType?: string; } /** * Record the R3F canvas to a video file using MediaRecorder. */ declare function useVideoRecorder(options?: VideoRecorderOptions): { start: () => void; stop: () => Promise; download: (filename?: string) => Promise; readonly recording: boolean; }; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useFrameCapture — still-frame capture for canvas-backed MuJoCo/R3F scenes. */ /** * Capture the current canvas frame as a data URL. * * For WebGL scenes, create the renderer with `preserveDrawingBuffer: true` * when you need deterministic captures after the frame has presented. */ declare function captureFrame(options: FrameCaptureOptions): Promise; /** * Capture the current canvas frame as a Blob. */ declare function captureFrameBlob(options: FrameCaptureOptions): Promise; /** * React state wrapper around `captureFrame` and `captureFrameBlob`. */ declare function useFrameCapture(defaultOptions?: FrameCaptureOptions): FrameCaptureAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * React state wrapper around MuJoCo/R3F offscreen camera-frame capture. */ declare function useCameraFrameCapture(defaultOptions?: CameraFrameCaptureOptions): CameraFrameCaptureAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Helpers for resolving dataset camera streams to mounted MuJoCo resources. */ type MountedCameraFrameCaptureSource = Extract; type CameraFrameMountSelector = { cameraName: Cameras; siteName?: never; bodyName?: never; } | { siteName: Sites; cameraName?: never; bodyName?: never; } | { bodyName: Bodies; cameraName?: never; siteName?: never; }; interface NamedCameraFrameResource { name: string | null | undefined; } interface ResolveMountedCameraFrameSourceOptions { cameras?: readonly (Cameras | NamedCameraFrameResource | null | undefined)[]; sites?: readonly (Sites | NamedCameraFrameResource | null | undefined)[]; bodies?: readonly (Bodies | NamedCameraFrameResource | null | undefined)[]; aliases?: Record; /** * Accept the first valid alias selector even when the current resource * inventory cannot verify it. This is useful when aliases come from a * previously validated model inventory and the actual provider will validate * again during capture. */ allowAliasFallback?: boolean; } interface ResolvedMountedCameraFrameSource { key: string; selector: CameraFrameMountSelector; source: MountedCameraFrameCaptureSource; } declare const MountedCameraFrameSourceSuggestionMatch: { readonly Direct: "direct"; readonly Alias: "alias"; readonly Normalized: "normalized"; readonly Prefix: "prefix"; readonly Suffix: "suffix"; readonly Contains: "contains"; }; type MountedCameraFrameSourceSuggestionMatch = (typeof MountedCameraFrameSourceSuggestionMatch)[keyof typeof MountedCameraFrameSourceSuggestionMatch]; interface MountedCameraFrameSourceSuggestion { key: string; selector: CameraFrameMountSelector; source: MountedCameraFrameCaptureSource; resourceName: string; resourceKind: MountedCameraFrameCaptureSource['kind']; match: MountedCameraFrameSourceSuggestionMatch; } type MountedCameraFrameSequenceDefaults = Omit; type MountedCameraFrameSequenceCameraOptions = Partial; interface CreateMountedCameraFrameSequencePlanOptions extends ResolveMountedCameraFrameSourceOptions { defaults?: MountedCameraFrameSequenceDefaults; cameraOptions?: Record; requireAll?: boolean; } interface MountedCameraFrameSequencePlan { cameraKeys: string[]; cameras: CameraFrameSequenceCamera[]; resolved: Record; missingKeys: string[]; } declare const MountedCameraFrameSequenceReadinessStatus: { readonly Ready: "ready"; readonly Partial: "partial"; readonly Missing: "missing"; }; type MountedCameraFrameSequenceReadinessStatus = (typeof MountedCameraFrameSequenceReadinessStatus)[keyof typeof MountedCameraFrameSequenceReadinessStatus]; interface MountedCameraFrameSequenceSourceReadiness { key: string; ready: boolean; selector?: CameraFrameMountSelector; source?: MountedCameraFrameCaptureSource; message: string; } interface MountedCameraFrameSequenceReadiness { ready: boolean; status: MountedCameraFrameSequenceReadinessStatus; cameraKeys: string[]; resolvedKeys: string[]; missingKeys: string[]; cameras: Record; message: string; } type MountedCameraFrameSequencePlanOptions = Omit; interface MountedCameraFrameSequenceRecordOptions extends Omit, MountedCameraFrameSequencePlanOptions { cameraKeys: readonly string[]; } interface MountedCameraFrameSequenceRecordResult extends CameraFrameSequenceResult { plan: MountedCameraFrameSequencePlan; readiness: MountedCameraFrameSequenceReadiness; } declare const MountedCameraFrameSequenceManifestStatus: { readonly Complete: "complete"; readonly Partial: "partial"; readonly Missing: "missing"; }; type MountedCameraFrameSequenceManifestStatus = (typeof MountedCameraFrameSequenceManifestStatus)[keyof typeof MountedCameraFrameSequenceManifestStatus]; interface MountedCameraFrameSequenceStreamSummary { key: string; ready: boolean; complete: boolean; status: MountedCameraFrameSequenceManifestStatus; source?: CameraFrameCaptureSource; selector?: CameraFrameMountSelector; target?: string; width?: number; height?: number; expectedFrameCount: number; recordedFrameCount: number; missingFrameCount: number; firstFrameIndex: number | null; lastFrameIndex: number | null; firstTimestamp: number | null; lastTimestamp: number | null; message: string; } interface CreateMountedCameraFrameSequenceManifestOptions { expectedFrameCount?: number; cameraKeys?: readonly string[]; } interface MountedCameraFrameSequenceManifest { schema: 'mujoco-react/mounted-camera-frame-sequence-manifest@1'; ready: boolean; complete: boolean; status: MountedCameraFrameSequenceManifestStatus; cameraKeys: string[]; resolvedKeys: string[]; missingKeys: string[]; expectedFrameCount: number; recordedFrameCount: number; missingFrameCount: number; streamSummaries: Record; streams: MountedCameraFrameSequenceStreamSummary[]; readiness: MountedCameraFrameSequenceReadiness; message: string; } type MountedCameraFrameSequenceRecorderTarget = Pick; declare function getMountedCameraFrameCaptureSource(selector: CameraFrameMountSelector): MountedCameraFrameCaptureSource | null; declare function isMountedCameraFrameCaptureSource(source: CameraFrameCaptureSource): source is MountedCameraFrameCaptureSource; declare function getCameraFrameCaptureSourceTarget(source: CameraFrameCaptureSource): string; declare function createMountedCameraFrameSourceSuggestions(key: string, options: ResolveMountedCameraFrameSourceOptions): MountedCameraFrameSourceSuggestion[]; declare function resolveMountedCameraFrameSource(key: string, options: ResolveMountedCameraFrameSourceOptions): ResolvedMountedCameraFrameSource | null; declare function createMountedCameraFrameSequencePlan(cameraKeys: readonly string[], options: CreateMountedCameraFrameSequencePlanOptions): MountedCameraFrameSequencePlan; declare function createMountedCameraFrameSequenceReadiness(plan: MountedCameraFrameSequencePlan): MountedCameraFrameSequenceReadiness; declare function createMountedCameraFrameSequenceManifest(result: MountedCameraFrameSequenceRecordResult, options?: CreateMountedCameraFrameSequenceManifestOptions): MountedCameraFrameSequenceManifest; declare function createMountedCameraFrameSequencePlanFromApi(api: MountedCameraFrameSequenceRecorderTarget, cameraKeys: readonly string[], options?: MountedCameraFrameSequencePlanOptions): MountedCameraFrameSequencePlan; declare function recordMountedCameraFrameSequence(api: MountedCameraFrameSequenceRecorderTarget, options: MountedCameraFrameSequenceRecordOptions): Promise; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Helpers for turning Three/MuJoCo camera captures into policy image payloads. */ type PolicyCameraFrameCaptureTarget = Pick; type PolicyCameraFramePlanTarget = Pick; type PolicyCameraFrameStreamOptions = Partial> & MountedCameraFrameSequenceCameraOptions & { /** Additional policy payload keys that should receive this stream's data URL. */ aliases?: readonly string[]; }; interface CreatePolicyCameraFrameCapturePlanOptions extends Omit { cameraKeys: readonly string[]; cameras?: ResolveMountedCameraFrameSourceOptions['cameras']; sites?: ResolveMountedCameraFrameSourceOptions['sites']; bodies?: ResolveMountedCameraFrameSourceOptions['bodies']; defaults?: MountedCameraFrameSequenceDefaults; streamOptions?: Record; includeObservationImageAliases?: boolean; requireAll?: boolean; } interface PolicyCameraFrameCapturePlan extends PolicyCameraFrameCaptureOptions { cameraKeys: string[]; streams: PolicyCameraFrameStream[]; mountedPlan: MountedCameraFrameSequencePlan; missingKeys: string[]; } declare function createPolicyCameraFrameCapturePlan(options: CreatePolicyCameraFrameCapturePlanOptions): PolicyCameraFrameCapturePlan; declare function createPolicyCameraFrameCapturePlanFromApi(api: PolicyCameraFramePlanTarget, options: Omit): PolicyCameraFrameCapturePlan; declare function capturePolicyCameraFrames(target: PolicyCameraFrameCaptureTarget, options: PolicyCameraFrameCaptureOptions): Promise; declare function capturePolicyCameraFramesFromMountedStreams(target: PolicyCameraFrameCaptureTarget & PolicyCameraFramePlanTarget, options: Omit): Promise; /** * @license * SPDX-License-Identifier: Apache-2.0 * * React wrapper for capturing policy image payloads from Three/MuJoCo cameras. */ type MountedPolicyCameraFrameCaptureOptions = Omit; interface MountedPolicyCameraFrameCaptureAPI { status: FrameCaptureStatus; error: Error | null; isCapturing: boolean; capture: (options?: Partial) => Promise; reset: () => void; } declare function usePolicyCameraFrames(defaultOptions: PolicyCameraFrameCaptureOptions): PolicyCameraFrameCaptureAPI; declare function usePolicyCameraFramesFromMountedStreams(defaultOptions: MountedPolicyCameraFrameCaptureOptions): MountedPolicyCameraFrameCaptureAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Capture policy observation tensors directly from Three/MuJoCo cameras, * skipping the data-URL/PNG round-trip. Sessions are created once per camera * and reused every step, so live inference and dataset recording read straight * from the GPU into Float32 tensors. */ interface PolicyCameraTensorStream extends CameraFrameCaptureTensorOptions { /** Payload key this stream's tensor is stored under. */ key: string; /** Additional payload keys that should reference the same tensor. */ aliases?: readonly string[]; } interface PolicyCameraTensorsOptions { streams: PolicyCameraTensorStream[]; /** Also expose tensors under `observation.images.` aliases. Defaults to `false`. */ includeObservationImageAliases?: boolean; } interface PolicyCameraTensorsResult { tensors: Record; sourceSummary: string; capturedAt: number; } interface PolicyCameraTensorsAPI { status: FrameCaptureStatus; error: Error | null; isCapturing: boolean; /** Synchronously render and convert every stream into a policy image tensor. */ capture: () => PolicyCameraTensorsResult; reset: () => void; } type MountedPolicyCameraTensorOptions = MountedPolicyCameraFrameCaptureOptions & { tensor?: Pick; }; declare function usePolicyCameraTensors(options: PolicyCameraTensorsOptions): PolicyCameraTensorsAPI; declare function usePolicyCameraTensorsFromMountedStreams(options: MountedPolicyCameraTensorOptions): PolicyCameraTensorsAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * React state wrapper around fixed-camera simulation sequence recording. */ declare function useCameraSequenceRecorder(): CameraFrameSequenceRecorderAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * React state wrapper for named MuJoCo camera/site/body sequence recording. */ type MountedCameraSequencePlanOptions = MountedCameraFrameSequencePlanOptions; type MountedCameraSequenceRecordOptions = MountedCameraFrameSequenceRecordOptions; type MountedCameraSequenceRecordResult = MountedCameraFrameSequenceRecordResult; type MountedCameraSequenceReadiness = MountedCameraFrameSequenceReadiness; interface MountedCameraSequenceRecorderAPI extends Omit { plan: MountedCameraFrameSequencePlan | null; readiness: MountedCameraSequenceReadiness | null; result: MountedCameraSequenceRecordResult | null; createPlan: (cameraKeys: readonly string[], options?: MountedCameraSequencePlanOptions) => MountedCameraFrameSequencePlan; checkReadiness: (cameraKeys: readonly string[], options?: MountedCameraSequencePlanOptions) => MountedCameraSequenceReadiness; record: (options: MountedCameraSequenceRecordOptions) => Promise; } declare function useMountedCameraSequenceRecorder(defaultOptions?: MountedCameraSequencePlanOptions): MountedCameraSequenceRecorderAPI; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Project detector/image coordinates from a camera view into the rendered MuJoCo scene. */ declare function imagePointToNdc(x: number, y: number, coordinateSpace?: ImagePointCoordinateSpace, width?: number, height?: number): [number, number]; declare function projectImagePointTo3D(renderer: THREE.WebGLRenderer, scene: THREE.Scene, fallbackCamera: THREE.Camera, options: ImagePointProjectionOptions): ImagePointProjectionResult | null; /** * @license * SPDX-License-Identifier: Apache-2.0 * * Helpers for applying policy action vectors to MuJoCo controls. */ interface ApplyPolicyActionToControlsOptions { /** * First actuator/control index to write. Defaults to 0. */ actuatorOffset?: number; /** * Maximum number of controls to write. Defaults to the action length. */ actionSize?: number; /** * Clamp each action value to `model.actuator_ctrlrange` before writing. * Defaults to true because most learned policies should not exceed actuator limits. */ clamp?: boolean; /** * Leave the current control unchanged when an action entry is not finite. * Defaults to true so a bad policy response cannot write NaN into the simulation. */ skipInvalid?: boolean; } interface ApplyPolicyActionToControlsResult { /** * Values actually written to `data.ctrl`, after offset, truncation, and clamping. */ applied: number[]; /** * Actuator indices that were not written because the corresponding action value * was not finite and `skipInvalid` was enabled. */ skipped: number[]; actuatorOffset: number; } declare function clampPolicyActionValue(model: MujocoModel, actuatorIndex: number, value: number): number; declare function applyPolicyActionToControls(model: MujocoModel, data: MujocoData, action: PolicyVector, options?: ApplyPolicyActionToControlsOptions): ApplyPolicyActionToControlsResult; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useCtrlNoise — control noise / perturbation hook (spec 3.2) */ interface CtrlNoiseConfig { /** Exponential filter rate (0-1). Higher = faster noise changes. Default: 0.01. */ rate?: number; /** Standard deviation of Gaussian noise. Default: 0.05. */ std?: number; /** Enable/disable. Default: true. */ enabled?: boolean; } /** * Apply Gaussian noise with exponential filtering to all ctrl values. * Useful for robustness testing and domain randomization. * * noise[i] = (1 - rate) * noise[i] + rate * N(0, std) * data.ctrl[i] += noise[i] */ declare function useCtrlNoise(config?: CtrlNoiseConfig): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useBodyMeshes — returns Three.js meshes belonging to a MuJoCo body. * * Low-level primitive for custom selection visuals, outlines, * postprocessing effects, or any per-body mesh manipulation. */ /** * Returns all Three.js meshes belonging to the given MuJoCo body ID. * * @example * ```tsx * const meshes = useBodyMeshes(selectedBodyId); * * // Use with drei Outline * * * // Or manipulate directly * useFrame(() => { * meshes.forEach(m => { m.scale.setScalar(1.05); }); * }); * ``` */ declare function useBodyMeshes(bodyId: number | null): THREE.Mesh[]; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useSelectionHighlight — convenience hook for emissive body highlights. * * Built on useBodyMeshes. For custom visuals, use useBodyMeshes directly. */ declare function useSelectionHighlight(bodyId: number | null, options?: { color?: string; emissiveIntensity?: number; }): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useSceneLights — hook form of SceneLights (spec 6.3) * * Auto-creates Three.js lights from MJCF elements. */ declare function useSceneLights(intensity?: number): void; /** * @license * SPDX-License-Identifier: Apache-2.0 * * useCameraAnimation — composable camera animation hook. */ interface CameraAnimationAPI { getCameraState(): { position: THREE.Vector3; target: THREE.Vector3; }; moveCameraTo(position: THREE.Vector3, target: THREE.Vector3, durationMs: number): Promise; } /** * Standalone hook for animated camera transitions. * * Manages its own `useFrame` callback — drop it into any component inside ``. */ declare function useCameraAnimation(): CameraAnimationAPI; export { ActuatedJointInfo, ActuatorInfo, Actuators, type ApplyPolicyActionToControlsOptions, type ApplyPolicyActionToControlsResult, ArrayJointStateResult, Bodies, Body, BodyProps, BodyStateResult, type CameraAnimationAPI, CameraFrameCaptureAPI, CameraFrameCaptureOptions, CameraFrameCaptureSource, CameraFrameCaptureTensorOptions, type CameraFrameMountSelector, CameraFrameSequenceCamera, CameraFrameSequenceOptions, CameraFrameSequenceRecorderAPI, CameraFrameSequenceResult, CameraFrameTensorResult, type CameraStreamOptions, CameraView, type CameraViewProps, type CameraViewportOptions, Cameras, type ContactHistoryEntry, type ContactHistoryHandle, type ContactHistoryOptions, ContactInfo, ContactListener, ContactListenerProps, ContactMarkers, type ControlGroup, type ControlGroupHandle, ControlGroupInfo, ControlGroupSelector, type ControlGroupSetOptions, type ControlWriterConflict, type ControlWriterHandle, type ControlWriterOptions, type ControlWriterWriteOptions, type ControllerComponent, type ControllerOptions, type ControlsHandle, type CreateMountedCameraFrameSequenceManifestOptions, type CreateMountedCameraFrameSequencePlanOptions, type CreatePolicyCameraFrameCapturePlanOptions, CtrlHandle, Debug, DebugProps, type DefinedControls, DragInteraction, DragInteractionProps, FlexRenderer, FrameCaptureAPI, FrameCaptureBlobResult, FrameCaptureOptions, FrameCaptureResult, FrameCaptureStatus, GenericIK, type GenericIKOptions, GeomInfo, Geoms, IkConfig, IkContextValue, IkGizmo, IkGizmoProps, ImagePointCoordinateSpace, ImagePointProjectionOptions, ImagePointProjectionResult, InstancedGeomRenderer, JointStateOptions, JointStateResult, Joints, KeyboardIkTargetConfig, KeyboardTeleopConfig, type MountedCameraFrameCaptureSource, type MountedCameraFrameSequenceCameraOptions, type MountedCameraFrameSequenceDefaults, type MountedCameraFrameSequenceManifest, MountedCameraFrameSequenceManifestStatus, type MountedCameraFrameSequencePlan, type MountedCameraFrameSequencePlanOptions, type MountedCameraFrameSequenceReadiness, MountedCameraFrameSequenceReadinessStatus, type MountedCameraFrameSequenceRecordOptions, type MountedCameraFrameSequenceRecordResult, type MountedCameraFrameSequenceRecorderTarget, type MountedCameraFrameSequenceSourceReadiness, type MountedCameraFrameSequenceStreamSummary, type MountedCameraFrameSourceSuggestion, MountedCameraFrameSourceSuggestionMatch, type MountedCameraSequencePlanOptions, type MountedCameraSequenceReadiness, type MountedCameraSequenceRecordOptions, type MountedCameraSequenceRecordResult, type MountedCameraSequenceRecorderAPI, type MountedPolicyCameraFrameCaptureAPI, type MountedPolicyCameraFrameCaptureOptions, type MountedPolicyCameraTensorOptions, MujocoCanvas, MujocoCanvasProps, MujocoContextValue, MujocoData, type MujocoLoader, type MujocoLoaderOptions, MujocoModel, MujocoModule, MujocoPhysics, type MujocoPhysicsProps, MujocoProvider, type MujocoProviderProps, MujocoSimAPI, MujocoSimProvider, type MujocoWasmVariant, type NamedCameraFrameResource, type NamedObservationField, type NamedObservationHandle, type NamedObservationInput, type NamedObservationLayoutItem, type NamedObservationMissing, type NamedObservationOptions, type NamedObservationResult, ObservationConfig, ObservationHandle, ObservationOutput, ObservationResult, PairedSplatEnvironmentConfig, PhysicsStepCallback, PlaybackState, PolicyAPI, PolicyCameraFrameCaptureAPI, PolicyCameraFrameCaptureOptions, type PolicyCameraFrameCapturePlan, PolicyCameraFrameCaptureResult, type PolicyCameraFrameCaptureTarget, type PolicyCameraFramePlanTarget, PolicyCameraFrameStream, type PolicyCameraFrameStreamOptions, type PolicyCameraTensorStream, type PolicyCameraTensorsAPI, type PolicyCameraTensorsOptions, type PolicyCameraTensorsResult, PolicyConfig, PolicyVector, type PoseReadout, type PoseResourceKind, ReadyCallbackInput, RemotePolicyAPI, RemotePolicyConfig, type ResolveMountedCameraFrameSourceOptions, type ResolvedMountedCameraFrameSource, ScalarJointStateResult, ScenarioLighting, ScenarioLightingPreset, ScenarioLightingProps, SceneConfig, SceneLights, SceneLightsProps, SelectionCallbackInput, SensorHandle, SensorInfo, Sensors, SitePositionResult, Sites, SplatCollisionPrimitive, SplatCollisionProxyConfig, type SplatCollisionProxyGeomPreview, type SplatCollisionProxyGeomsState, SplatCollisionProxyPreview, type SplatCollisionProxyPreviewProps, type SplatCollisionProxyPreviewStatus, type SplatCollisionProxyPreviewVector3, SplatEnvironment, SplatEnvironmentMetadata, SplatEnvironmentMetadataInput, SplatEnvironmentProps, SplatEnvironmentReadiness, SplatEnvironmentReadinessStatus, SplatFormat, SplatRendererKind, SplatSceneConfigInput, SplatSceneConfigState, SplatSceneInput, StepCallbackInput, TendonRenderer, TrajectoryFrame, TrajectoryInput, TrajectoryPlayer, TrajectoryPlayerProps, TrajectoryStateChangeInput, type UseControlGroupOptions, type UseSplatCollisionProxyGeomsOptions, VisualScenarioConfig, VisualScenarioEffects, VisualScenarioEffectsProps, VisualScenarioExecutionContext, VisualScenarioExecutionContextInput, applyPolicyActionToControls, bodyPositionField, buildObservation, canFetchSplatCollisionProxyXml, captureFrame, captureFrameBlob, capturePolicyCameraFrames, capturePolicyCameraFramesFromMountedStreams, clampPolicyActionValue, controlGroup, createContiguousControlGroup, createController, createControllerHook, createMountedCameraFrameSequenceManifest, createMountedCameraFrameSequencePlan, createMountedCameraFrameSequencePlanFromApi, createMountedCameraFrameSequenceReadiness, createMountedCameraFrameSourceSuggestions, createNamedObservationBuilder, createPairedSplatEnvironment, createPolicyCameraFrameCapturePlan, createPolicyCameraFrameCapturePlanFromApi, createSparkSplatViewerUrl, createSplatEnvironmentUserData, createSplatSceneConfig, createVisualScenarioExecutionContext, ctrlField, defineControls, fetchSplatCollisionProxyXml, findActuatorByName, findBodyByName, findGeomByName, findJointByName, findKeyframeByName, findSensorByName, findSiteByName, findTendonByName, geomPositionField, getActuatedJoints, getCameraFrameCaptureSourceTarget, getControlMap, getMountedCameraFrameCaptureSource, getName, getScenarioBackground, getScenarioCameraPosition, getSplatEnvironmentReadiness, imagePointToNdc, isMountedCameraFrameCaptureSource, loadScene, parseSplatCollisionProxyGeoms, projectImagePointTo3D, qposField, qvelField, readNamedObservation, recordMountedCameraFrameSequence, resolveControlGroup, resolveMountedCameraFrameSource, sitePositionField, useActuators, useAfterPhysicsStep, useBeforePhysicsStep, useBodyMeshes, useBodyPose, useBodyState, useCameraAnimation, useCameraFrameCapture, useCameraSequenceRecorder, useCameraStream, useCameraViewport, useContactEvents, useContactHistory, useContacts, useControlGroup, useControlWriter, useControls, useCtrl, useCtrlNoise, useFrameCapture, useGamepad, useGeomPose, useGravityCompensation, useIkController, useJointState, useKeyboardIkTarget, useKeyboardTeleop, useMountedCameraSequenceRecorder, useMujoco, useMujocoWasm, useNamedObservation, useObservation, usePolicy, usePolicyCameraFrames, usePolicyCameraFramesFromMountedStreams, usePolicyCameraTensors, usePolicyCameraTensorsFromMountedStreams, useRemotePolicy, useSceneLights, useSelectionHighlight, useSensor, useSensors, useSitePose, useSitePosition, useSplatCollisionProxyGeoms, useSplatEnvironment, useSplatSceneConfig, useTrajectoryPlayer, useTrajectoryRecorder, useVideoRecorder, useVisualScenarioEffects, useVisualScenarioExecutionContext, withSplatEnvironment };