@vizij/render 0.1.0 → 0.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  > Three.js + React renderer, scene store, and helper controllers for Vizij faces.
4
4
 
5
- This package exposes the `Vizij` canvas component along with hooks, stores, and GLTF helpers that power Vizij’s real-time character visualisation. It is the foundation that other packages (`@vizij/rig`, `@vizij/orchestrator-react`, etc.) build upon.
5
+ This package exposes the `Vizij` canvas component along with hooks, stores, and GLTF helpers that power Vizij’s real-time character visualisation. It is the foundation that other packages (`@vizij/runtime-react`, etc.) build upon.
6
6
 
7
7
  ---
8
8
 
@@ -96,14 +96,14 @@ The store tracks world graph entries, controllers, debug overlays, and renderabl
96
96
  ## Controllers & Helpers
97
97
 
98
98
  - Controllers under `src/controllers` encapsulate input handling, camera logic, and other behaviours. Compose them with your own React components.
99
- - `loadGLTF` / `loadGLTFBlob` simplify loading rig assets and extract animatable metadata used by `@vizij/rig`.
99
+ - `loadGLTF` / `loadGLTFBlob` simplify loading rig assets and extract animatable metadata used by `@vizij/runtime-react`.
100
100
  - `export` helpers produce snapshots of the current scene (useful for tooling or exporting frames).
101
101
 
102
102
  All exports are re-exported through `src/index.tsx`, so a simple `import { loadGLTF } from "@vizij/render"` works.
103
103
 
104
104
  ### Dual-format Vizij bundles
105
105
 
106
- Vizij scenes persist authoring metadata inside GLBs so third-party tools see baked animation, while Vizij runtimes retain orchestrator graphs and clips.
106
+ Vizij scenes persist authoring metadata inside GLBs so third-party tools see baked animation, while Vizij runtimes retain the authored graphs and clips.
107
107
 
108
108
  - Every renderable still carries a `RobotData` extension in `userData` describing features and animatable bindings.
109
109
  - The exporter now writes a root-level `extensions.VIZIJ_bundle` block following the schema in [`src/types/vizij-bundle.ts`](./src/types/vizij-bundle.ts). It contains rig graphs, pose configs, stored Vizij clips, and provenance hashes.
@@ -112,7 +112,7 @@ Vizij scenes persist authoring metadata inside GLBs so third-party tools see bak
112
112
  - The new `animations` field exposes `VizijAnimationClipData[]`, which maps each glTF animation channel back to Vizij animatable ids (`RobotData.features.*.value.id`). Each track provides component-aware `times`/`values` arrays so runtimes can register clips without re-parsing the GLB.
113
113
  - `extractVizijBundle(scene)` and `applyVizijBundle(scene, bundle)` (under `src/functions/vizij-bundle.ts`) let advanced tooling inspect or mutate bundles without triggering a fresh export.
114
114
 
115
- With this structure, authoring tools can round-trip orchestrator assets while shipping native glTF animations for viewers that do not understand Vizij.
115
+ With this structure, authoring tools can round-trip Vizij runtime assets while shipping native glTF animations for viewers that do not understand Vizij.
116
116
 
117
117
  ---
118
118
 
@@ -132,14 +132,17 @@ pnpm --filter "@vizij/render" size
132
132
 
133
133
  ## Publishing
134
134
 
135
- Use the shared workflow at [`.github/workflows/publish-npm.yml`](../../.github/workflows/publish-npm.yml).
135
+ Use the shared workflow at [`.github/workflows/publish-npm.yml`](../../../.github/workflows/publish-npm.yml).
136
136
 
137
137
  1. Align dependency versions (`three`, `@react-three/*`, `zustand`, Vizij packages) and generate a changeset:
138
+
138
139
  ```bash
139
140
  pnpm changeset
140
141
  pnpm version:packages
141
142
  ```
143
+
142
144
  2. Validate locally:
145
+
143
146
  ```bash
144
147
  pnpm install
145
148
  pnpm --filter "@vizij/render" build
@@ -148,13 +151,14 @@ Use the shared workflow at [`.github/workflows/publish-npm.yml`](../../.github/w
148
151
  pnpm --filter "@vizij/render" lint
149
152
  pnpm --filter "@vizij/render" exec npm pack --dry-run
150
153
  ```
151
- 3. Tag the release as `npm-render-vX.Y.Z` and push the tag. The workflow will publish with provenance metadata.
154
+
155
+ 3. Merge the version bump to `main`. CI publishes any `@vizij/*` version not yet on npm (with provenance) — no release tag. See the root [README → Publishing & Versioning](../../../README.md#publishing--versioning).
152
156
 
153
157
  ---
154
158
 
155
159
  ## Related Packages
156
160
 
157
- - [`@vizij/rig`](../@vizij/rig/README.md) – Hooks that consume the renderer to load rigged models.
158
- - [`@vizij/animation-react`](../@vizij/animation-react/README.md) – React bindings that feed animation values back into the renderer.
161
+ - [`@vizij/runtime-react`](../runtime-react/README.md) – Hooks that consume the renderer to load rigged models.
162
+ - [`@vizij/animation-react`](../animation-react/README.md) – React bindings that feed animation values back into the renderer.
159
163
 
160
164
  Questions or contributions? Open an issue so we can keep the renderer API and docs sharp for the whole Vizij ecosystem. 🎨
package/dist/index.d.mts CHANGED
@@ -227,6 +227,9 @@ interface Shape extends RenderableBase {
227
227
  roughness?: Feature;
228
228
  metalness?: Feature;
229
229
  color?: Feature;
230
+ emissive?: Feature;
231
+ emissiveIntensity?: Feature;
232
+ specular?: Feature;
230
233
  translation: Feature;
231
234
  rotation: Feature;
232
235
  scale?: Feature;
@@ -357,12 +360,40 @@ interface VizijBundleAnimationEntry {
357
360
  [key: string]: unknown;
358
361
  };
359
362
  }
363
+ interface VizijSpeechConfig {
364
+ /** TTS voice name (e.g., "Ruth") */
365
+ voice?: string;
366
+ /** Speech mode */
367
+ mode?: "echo" | "conversation";
368
+ /** Agent name for LLM system prompt */
369
+ agentName?: string;
370
+ /** Custom system prompt (supports {{agent_name}} template) */
371
+ systemPrompt?: string;
372
+ /** Input path for avatar-speaking state (default: /speech/speaking) */
373
+ speakingInputPath?: string;
374
+ /** Input path for user-speaking state (default: /speech/user_speaking) */
375
+ userSpeakingInputPath?: string;
376
+ /** Input path for thinking state (default: /speech/thinking) */
377
+ thinkingInputPath?: string;
378
+ /** Pose group ID for viseme mapping */
379
+ visemeGroupId?: string;
380
+ /** Pose group ID for emotion mapping */
381
+ emotionGroupId?: string;
382
+ /** TTS API base URL */
383
+ apiBaseUrl?: string;
384
+ /** Auto-activate microphone when speech is ready (default: false) */
385
+ autoActivateMic?: boolean;
386
+ }
360
387
  interface VizijBundleExtension {
361
388
  version: VizijBundleVersion;
362
389
  exportedAt?: string;
363
390
  graphs?: VizijBundleGraphEntry[];
364
391
  poses?: VizijBundlePoseSection | null;
365
392
  animations?: VizijBundleAnimationEntry[];
393
+ /**
394
+ * Bundle-level metadata. May include `speechConfig: VizijSpeechConfig`
395
+ * for configuring the STT/LLM/TTS speech pipeline.
396
+ */
366
397
  metadata?: Record<string, unknown>;
367
398
  }
368
399
 
@@ -571,6 +602,12 @@ declare function useVizijStoreGetter(): () => VizijData & VizijActions;
571
602
  declare class EmptyModelError extends Error {
572
603
  constructor(message: string);
573
604
  }
605
+ type ParserJsonFallbackSource = {
606
+ url?: string;
607
+ blob?: Blob;
608
+ arrayBuffer?: ArrayBuffer;
609
+ };
610
+ declare function parseGlbJsonChunk(buffer: ArrayBuffer): unknown | undefined;
574
611
  declare function loadGLTF(url: string, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
575
612
  center: RawVector2;
576
613
  size: RawVector2;
@@ -584,11 +621,12 @@ type LoadedVizijAsset = {
584
621
  animatables: Record<string, AnimatableValue>;
585
622
  bundle: VizijBundleExtension | null;
586
623
  animations: VizijAnimationClipData[];
624
+ scene: Group$1;
587
625
  };
588
626
  declare function loadGLTFWithBundle(url: string, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
589
627
  center: RawVector2;
590
628
  size: RawVector2;
591
- }): Promise<LoadedVizijAsset>;
629
+ }, parserJsonFallback?: ParserJsonFallbackSource): Promise<LoadedVizijAsset>;
592
630
  declare function loadGLTFFromBlobWithBundle(blob: Blob, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
593
631
  center: RawVector2;
594
632
  size: RawVector2;
@@ -607,10 +645,12 @@ type ExportSceneOptions = {
607
645
  bundle?: VizijBundleExtension | null;
608
646
  animations?: AnimationClip[];
609
647
  binary?: boolean;
648
+ onError?: (error: Error) => void;
649
+ onComplete?: () => void;
610
650
  };
611
651
  declare function exportScene(data: Group$1, fileNameOrOptions?: string | ExportSceneOptions): void;
612
652
 
613
653
  declare function extractVizijBundle(object: Object3D, parserJson?: unknown): VizijBundleExtension | null;
614
654
  declare function applyVizijBundle(object: Object3D, bundle: VizijBundleExtension | null): () => void;
615
655
 
616
- export { type AnimatedFeature, type Ellipse, type EllipseFeature, EmptyModelError, type ExportSceneOptions, type Feature, type Group, type GroupFeature, InnerVizij, type InnerVizijProps, type LoadedVizijAsset, type Rectangle, type RectangleFeature, type RenderableBase, type RenderableFeature, type Selection, type Shape, type ShapeFeature, ShapeMaterial, type StaticFeature, type Stored, type StoredAnimatedFeature, type StoredEllipse, type StoredFeatures, type StoredGroup, type StoredRectangle, type StoredRenderable, type StoredShape, Vizij, type VizijActions, type VizijAnimationClipData, type VizijAnimationId, type VizijAnimationTrackData, type VizijBundleAnimationClip, type VizijBundleAnimationEntry, type VizijBundleAnimationKeyframe, type VizijBundleAnimationTrack, type VizijBundleExtension, type VizijBundleGraphEntry, type VizijBundleGraphKind, type VizijBundleGraphMetadata, type VizijBundlePoseSection, type VizijBundleVersion, VizijContext, type VizijData, type VizijGraphId, type VizijPoseDefinition, type VizijPoseId, type VizijPoseRigConfig, type VizijProps, VizijSlice, type VizijStore, type VizijStoreGetter, type VizijStoreSetter, type World, applyVizijBundle, createVizijStore, exportScene, extractVizijBundle, loadGLTF, loadGLTFFromBlob, loadGLTFFromBlobWithBundle, loadGLTFWithBundle, loadGltfFromBlob, useDefaultVizijStore, useFeatures, useVizijStore, useVizijStoreGetter, useVizijStoreSetter, useVizijStoreSubscription };
656
+ export { type AnimatedFeature, type Ellipse, type EllipseFeature, EmptyModelError, type ExportSceneOptions, type Feature, type Group, type GroupFeature, InnerVizij, type InnerVizijProps, type LoadedVizijAsset, type Rectangle, type RectangleFeature, type RenderableBase, type RenderableFeature, type Selection, type Shape, type ShapeFeature, ShapeMaterial, type StaticFeature, type Stored, type StoredAnimatedFeature, type StoredEllipse, type StoredFeatures, type StoredGroup, type StoredRectangle, type StoredRenderable, type StoredShape, Vizij, type VizijActions, type VizijAnimationClipData, type VizijAnimationId, type VizijAnimationTrackData, type VizijBundleAnimationClip, type VizijBundleAnimationEntry, type VizijBundleAnimationKeyframe, type VizijBundleAnimationTrack, type VizijBundleExtension, type VizijBundleGraphEntry, type VizijBundleGraphKind, type VizijBundleGraphMetadata, type VizijBundlePoseSection, type VizijBundleVersion, VizijContext, type VizijData, type VizijGraphId, type VizijPoseDefinition, type VizijPoseId, type VizijPoseRigConfig, type VizijProps, VizijSlice, type VizijSpeechConfig, type VizijStore, type VizijStoreGetter, type VizijStoreSetter, type World, applyVizijBundle, createVizijStore, exportScene, extractVizijBundle, loadGLTF, loadGLTFFromBlob, loadGLTFFromBlobWithBundle, loadGLTFWithBundle, loadGltfFromBlob, parseGlbJsonChunk, useDefaultVizijStore, useFeatures, useVizijStore, useVizijStoreGetter, useVizijStoreSetter, useVizijStoreSubscription };
package/dist/index.d.ts CHANGED
@@ -227,6 +227,9 @@ interface Shape extends RenderableBase {
227
227
  roughness?: Feature;
228
228
  metalness?: Feature;
229
229
  color?: Feature;
230
+ emissive?: Feature;
231
+ emissiveIntensity?: Feature;
232
+ specular?: Feature;
230
233
  translation: Feature;
231
234
  rotation: Feature;
232
235
  scale?: Feature;
@@ -357,12 +360,40 @@ interface VizijBundleAnimationEntry {
357
360
  [key: string]: unknown;
358
361
  };
359
362
  }
363
+ interface VizijSpeechConfig {
364
+ /** TTS voice name (e.g., "Ruth") */
365
+ voice?: string;
366
+ /** Speech mode */
367
+ mode?: "echo" | "conversation";
368
+ /** Agent name for LLM system prompt */
369
+ agentName?: string;
370
+ /** Custom system prompt (supports {{agent_name}} template) */
371
+ systemPrompt?: string;
372
+ /** Input path for avatar-speaking state (default: /speech/speaking) */
373
+ speakingInputPath?: string;
374
+ /** Input path for user-speaking state (default: /speech/user_speaking) */
375
+ userSpeakingInputPath?: string;
376
+ /** Input path for thinking state (default: /speech/thinking) */
377
+ thinkingInputPath?: string;
378
+ /** Pose group ID for viseme mapping */
379
+ visemeGroupId?: string;
380
+ /** Pose group ID for emotion mapping */
381
+ emotionGroupId?: string;
382
+ /** TTS API base URL */
383
+ apiBaseUrl?: string;
384
+ /** Auto-activate microphone when speech is ready (default: false) */
385
+ autoActivateMic?: boolean;
386
+ }
360
387
  interface VizijBundleExtension {
361
388
  version: VizijBundleVersion;
362
389
  exportedAt?: string;
363
390
  graphs?: VizijBundleGraphEntry[];
364
391
  poses?: VizijBundlePoseSection | null;
365
392
  animations?: VizijBundleAnimationEntry[];
393
+ /**
394
+ * Bundle-level metadata. May include `speechConfig: VizijSpeechConfig`
395
+ * for configuring the STT/LLM/TTS speech pipeline.
396
+ */
366
397
  metadata?: Record<string, unknown>;
367
398
  }
368
399
 
@@ -571,6 +602,12 @@ declare function useVizijStoreGetter(): () => VizijData & VizijActions;
571
602
  declare class EmptyModelError extends Error {
572
603
  constructor(message: string);
573
604
  }
605
+ type ParserJsonFallbackSource = {
606
+ url?: string;
607
+ blob?: Blob;
608
+ arrayBuffer?: ArrayBuffer;
609
+ };
610
+ declare function parseGlbJsonChunk(buffer: ArrayBuffer): unknown | undefined;
574
611
  declare function loadGLTF(url: string, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
575
612
  center: RawVector2;
576
613
  size: RawVector2;
@@ -584,11 +621,12 @@ type LoadedVizijAsset = {
584
621
  animatables: Record<string, AnimatableValue>;
585
622
  bundle: VizijBundleExtension | null;
586
623
  animations: VizijAnimationClipData[];
624
+ scene: Group$1;
587
625
  };
588
626
  declare function loadGLTFWithBundle(url: string, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
589
627
  center: RawVector2;
590
628
  size: RawVector2;
591
- }): Promise<LoadedVizijAsset>;
629
+ }, parserJsonFallback?: ParserJsonFallbackSource): Promise<LoadedVizijAsset>;
592
630
  declare function loadGLTFFromBlobWithBundle(blob: Blob, namespaces: string[], aggressiveImport?: boolean, rootBounds?: {
593
631
  center: RawVector2;
594
632
  size: RawVector2;
@@ -607,10 +645,12 @@ type ExportSceneOptions = {
607
645
  bundle?: VizijBundleExtension | null;
608
646
  animations?: AnimationClip[];
609
647
  binary?: boolean;
648
+ onError?: (error: Error) => void;
649
+ onComplete?: () => void;
610
650
  };
611
651
  declare function exportScene(data: Group$1, fileNameOrOptions?: string | ExportSceneOptions): void;
612
652
 
613
653
  declare function extractVizijBundle(object: Object3D, parserJson?: unknown): VizijBundleExtension | null;
614
654
  declare function applyVizijBundle(object: Object3D, bundle: VizijBundleExtension | null): () => void;
615
655
 
616
- export { type AnimatedFeature, type Ellipse, type EllipseFeature, EmptyModelError, type ExportSceneOptions, type Feature, type Group, type GroupFeature, InnerVizij, type InnerVizijProps, type LoadedVizijAsset, type Rectangle, type RectangleFeature, type RenderableBase, type RenderableFeature, type Selection, type Shape, type ShapeFeature, ShapeMaterial, type StaticFeature, type Stored, type StoredAnimatedFeature, type StoredEllipse, type StoredFeatures, type StoredGroup, type StoredRectangle, type StoredRenderable, type StoredShape, Vizij, type VizijActions, type VizijAnimationClipData, type VizijAnimationId, type VizijAnimationTrackData, type VizijBundleAnimationClip, type VizijBundleAnimationEntry, type VizijBundleAnimationKeyframe, type VizijBundleAnimationTrack, type VizijBundleExtension, type VizijBundleGraphEntry, type VizijBundleGraphKind, type VizijBundleGraphMetadata, type VizijBundlePoseSection, type VizijBundleVersion, VizijContext, type VizijData, type VizijGraphId, type VizijPoseDefinition, type VizijPoseId, type VizijPoseRigConfig, type VizijProps, VizijSlice, type VizijStore, type VizijStoreGetter, type VizijStoreSetter, type World, applyVizijBundle, createVizijStore, exportScene, extractVizijBundle, loadGLTF, loadGLTFFromBlob, loadGLTFFromBlobWithBundle, loadGLTFWithBundle, loadGltfFromBlob, useDefaultVizijStore, useFeatures, useVizijStore, useVizijStoreGetter, useVizijStoreSetter, useVizijStoreSubscription };
656
+ export { type AnimatedFeature, type Ellipse, type EllipseFeature, EmptyModelError, type ExportSceneOptions, type Feature, type Group, type GroupFeature, InnerVizij, type InnerVizijProps, type LoadedVizijAsset, type Rectangle, type RectangleFeature, type RenderableBase, type RenderableFeature, type Selection, type Shape, type ShapeFeature, ShapeMaterial, type StaticFeature, type Stored, type StoredAnimatedFeature, type StoredEllipse, type StoredFeatures, type StoredGroup, type StoredRectangle, type StoredRenderable, type StoredShape, Vizij, type VizijActions, type VizijAnimationClipData, type VizijAnimationId, type VizijAnimationTrackData, type VizijBundleAnimationClip, type VizijBundleAnimationEntry, type VizijBundleAnimationKeyframe, type VizijBundleAnimationTrack, type VizijBundleExtension, type VizijBundleGraphEntry, type VizijBundleGraphKind, type VizijBundleGraphMetadata, type VizijBundlePoseSection, type VizijBundleVersion, VizijContext, type VizijData, type VizijGraphId, type VizijPoseDefinition, type VizijPoseId, type VizijPoseRigConfig, type VizijProps, VizijSlice, type VizijSpeechConfig, type VizijStore, type VizijStoreGetter, type VizijStoreSetter, type World, applyVizijBundle, createVizijStore, exportScene, extractVizijBundle, loadGLTF, loadGLTFFromBlob, loadGLTFFromBlobWithBundle, loadGLTFWithBundle, loadGltfFromBlob, parseGlbJsonChunk, useDefaultVizijStore, useFeatures, useVizijStore, useVizijStoreGetter, useVizijStoreSetter, useVizijStoreSubscription };