three-live 1.3.1 → 1.4.0

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.
Files changed (58) hide show
  1. package/README.md +4 -1
  2. package/dist/index.d.ts +191 -0
  3. package/dist/three-author-engine.js +179 -144
  4. package/dist/three-author.cjs +153 -144
  5. package/dist/three-author.d.ts +191 -0
  6. package/dist/three-author.js +153 -144
  7. package/dist/three-convert.cjs +150 -141
  8. package/dist/three-convert.d.ts +191 -0
  9. package/dist/three-convert.js +150 -141
  10. package/dist/three-live-ai.cjs +41 -0
  11. package/dist/three-live-ai.d.ts +759 -0
  12. package/dist/three-live-ai.js +41 -0
  13. package/dist/three-live-ai.min.js +41 -0
  14. package/dist/three-live-animation.cjs +6 -6
  15. package/dist/three-live-animation.d.ts +191 -0
  16. package/dist/three-live-animation.js +5 -5
  17. package/dist/three-live-animation.min.js +5 -5
  18. package/dist/three-live-cad.cjs +2 -2
  19. package/dist/three-live-cad.d.ts +191 -0
  20. package/dist/three-live-cad.js +2 -2
  21. package/dist/three-live-cad.min.js +2 -2
  22. package/dist/three-live-element.cjs +50 -85
  23. package/dist/three-live-element.d.ts +191 -0
  24. package/dist/three-live-element.js +50 -85
  25. package/dist/three-live-full.cjs +915 -170
  26. package/dist/three-live-full.js +917 -172
  27. package/dist/three-live-full.min.js +915 -170
  28. package/dist/three-live-procedural.cjs +16 -0
  29. package/dist/three-live-procedural.d.ts +759 -0
  30. package/dist/three-live-procedural.js +16 -0
  31. package/dist/three-live-procedural.min.js +16 -0
  32. package/dist/three-live-sandbox.html +11 -1
  33. package/dist/three-live-studio.cjs +72 -17
  34. package/dist/three-live-studio.d.ts +191 -0
  35. package/dist/three-live-studio.js +72 -17
  36. package/dist/three-live-studio.min.js +73 -18
  37. package/dist/three-live-tsl.cjs +103 -0
  38. package/dist/three-live-tsl.d.ts +759 -0
  39. package/dist/three-live-tsl.js +103 -0
  40. package/dist/three-live-tsl.min.js +103 -0
  41. package/dist/three-live-viewer.cjs +50 -85
  42. package/dist/three-live-viewer.d.ts +191 -0
  43. package/dist/three-live-viewer.js +50 -85
  44. package/dist/three-live-viewer.min.js +50 -85
  45. package/dist/three-live-webgpu.cjs +585 -0
  46. package/dist/three-live-webgpu.d.ts +759 -0
  47. package/dist/three-live-webgpu.js +585 -0
  48. package/dist/three-live-webgpu.min.js +585 -0
  49. package/dist/three-live.cjs +155 -146
  50. package/dist/three-live.js +155 -146
  51. package/dist/three-live.min.js +155 -146
  52. package/dist/three-view.cjs +49 -84
  53. package/dist/three-view.d.ts +191 -0
  54. package/dist/three-view.js +50 -85
  55. package/dist/three-xr.cjs +150 -141
  56. package/dist/three-xr.d.ts +191 -0
  57. package/dist/three-xr.js +150 -141
  58. package/package.json +39 -1
@@ -20,6 +20,7 @@
20
20
 
21
21
  import type {
22
22
  CameraState,
23
+ ShadowMapsMode,
23
24
  ThreeLiveElement,
24
25
  } from './three-live/src/three-live-element';
25
26
  import type {
@@ -118,6 +119,27 @@ export {
118
119
  postprocessingPlugin,
119
120
  resolveViewerBloom,
120
121
  } from './three-live/src/plugins/postprocessing';
122
+ export {
123
+ installProceduralExtension,
124
+ proceduralPlugin,
125
+ } from './three-live/src/plugins/procedural';
126
+ export {
127
+ computeWorldSceneBounds,
128
+ doesMeshCastShadow,
129
+ doesMeshReceiveShadow,
130
+ fitDirectionalShadowMatrix,
131
+ fitSpotShadowMatrix,
132
+ getShadowMapStats,
133
+ MAX_SHADOW_LIGHTS,
134
+ normalizeShadowMapsMode,
135
+ resolveActiveShadowLights,
136
+ SHADOW_MAP_TEXTURE_UNIT,
137
+ shadowMapsPlugin,
138
+ type ResolvedShadowPlan,
139
+ type ResolvedShadowSlice,
140
+ type ShadowMapStats,
141
+ type WorldSceneBounds,
142
+ } from './three-live/src/plugins/shadow-maps';
121
143
  export {
122
144
  extractMaterialVariants,
123
145
  extractPrimitiveVariantMappings,
@@ -126,6 +148,7 @@ export {
126
148
  type VariantMapping,
127
149
  } from './three-live/src/plugins/variants';
128
150
  export {
151
+ defineModelViewer,
129
152
  ThreeLiveElement,
130
153
  type ARLaunchOptions,
131
154
  type ARLaunchResult,
@@ -142,10 +165,144 @@ export {
142
165
  type XRProfile,
143
166
  type XRSimulatorRoom,
144
167
  } from './xr-live/src/xr-live-element';
168
+ /** Opt-in bring-your-own-LLM scene editing (`three-live/ai`, `three-live-ai.min.js`). */
169
+ export {
170
+ aiPlugin,
171
+ createAIChatProvider,
172
+ editScene,
173
+ extractScript,
174
+ undoEdit,
175
+ } from './three-live/src/plugins/ai';
176
+ export type {
177
+ AIChatContentPart,
178
+ AIChatMessage,
179
+ AIChatProviderOptions,
180
+ EditSceneOptions,
181
+ EditSceneResult,
182
+ ThreeLiveAIProvider,
183
+ } from './three-live/src/plugins/ai';
184
+ export {
185
+ buildImageMessages,
186
+ buildImageUserText,
187
+ compileFromImage,
188
+ detectImageMime,
189
+ formatSpatialPriors,
190
+ IMAGE_SYSTEM_PROMPT,
191
+ imageRepairMessage,
192
+ isAllowedImageUrl,
193
+ normalizeImageInput,
194
+ } from './three-live/src/plugins/ai-image';
195
+ export type {
196
+ AIImageInput,
197
+ AISpatialCamera,
198
+ AISpatialObject,
199
+ AISpatialPlane,
200
+ AISpatialPriors,
201
+ CompileFromImageOptions,
202
+ } from './three-live/src/plugins/ai-image';
203
+ /** AI PBR textures: texture packs and image providers (part of `three-live-ai.min.js`). */
204
+ export {
205
+ browserImageCodec,
206
+ createAIImageProvider,
207
+ indexedDbTextureCache,
208
+ parseTexturePack,
209
+ prepareAlbedo,
210
+ serializeTexturePack,
211
+ TEXTURE_PROMPT_SUFFIX,
212
+ textureRequests,
213
+ } from './three-live/src/plugins/ai-texture';
214
+ export type {
215
+ AIImageProviderOptions,
216
+ AITextureSpec,
217
+ GenerateTexturesOptions,
218
+ GenerateTexturesResult,
219
+ TextureCache,
220
+ TextureCacheRecord,
221
+ TextureImageCodec,
222
+ TextureMiss,
223
+ TexturePackEntry,
224
+ TexturePackJSON,
225
+ ThreeLiveImageProvider,
226
+ } from './three-live/src/plugins/ai-texture';
227
+ /** "Tap & Speak" voice editing (part of `three-live-ai.min.js`). */
228
+ export {
229
+ hideSelectionChips,
230
+ showSelectionChips,
231
+ } from './three-live/src/plugins/ai-select-chips';
232
+ export type {AISelectChipsState} from './three-live/src/plugins/ai-select-chips';
233
+ export {
234
+ AIVoiceSession,
235
+ connectVoice,
236
+ createWebSpeechRecognizer,
237
+ describeEditResult,
238
+ describeVoiceSelection,
239
+ geminiLiveAdapter,
240
+ realtimeAdapter,
241
+ selectByVoice,
242
+ selectNamesByVoice,
243
+ setSelectOnTap,
244
+ speakableName,
245
+ startVoiceEdit,
246
+ } from './three-live/src/plugins/ai-voice';
247
+ /** Multi-select for Tap & Speak / Talk-to-Select (part of `three-live-ai.min.js`). */
248
+ export {
249
+ describeSelection,
250
+ getSelection,
251
+ parseSelectReply,
252
+ resolveSelection,
253
+ resolveSelectionWithModel,
254
+ sceneSelectEntries,
255
+ selectCamera,
256
+ selectMessages,
257
+ setSelection,
258
+ } from './three-live/src/plugins/ai-select';
259
+ export type {
260
+ AIModelSelection,
261
+ AISelectProvider,
262
+ } from './three-live/src/plugins/ai-select';
263
+ /** Talk-to-Select tier-1 matcher and push-to-talk grammar (mirrors the Rust core). */
264
+ export type {
265
+ AISelectionEventDetail,
266
+ AISelectionMode,
267
+ AISelectionSource,
268
+ } from './three-live/src/plugins/ai-select';
269
+ export {
270
+ buildSelectIndex,
271
+ matchSelection,
272
+ parseVoiceCommand,
273
+ } from './three-live/src/plugins/ai-select-match';
274
+ export type {
275
+ SelectCamera,
276
+ SelectConfidence,
277
+ SelectIndexEntry,
278
+ SelectMatch,
279
+ SelectRawEntry,
280
+ VoiceCommand,
281
+ } from './three-live/src/plugins/ai-select-match';
282
+ export type {
283
+ AIAudioSink,
284
+ AIMicrophoneSource,
285
+ AISpeechRecognizer,
286
+ AIVoiceAdapter,
287
+ AIVoiceEditOptions,
288
+ AIVoiceEditResult,
289
+ AIVoiceEventDetail,
290
+ AIVoiceProviderName,
291
+ AIVoiceSelection,
292
+ AIVoiceSessionOptions,
293
+ AIVoiceState,
294
+ AIVoiceTransport,
295
+ } from './three-live/src/plugins/ai-voice';
145
296
  /** Optional spatial plugins (`xr-live/spatial`, `xr-live-spatial.min.js`). */
146
297
  export * from './xr-live/src/plugins/index';
147
298
  /** Optional simulation plugins (`xr-live/sim`, `xr-live-sim.min.js`). */
148
299
  export * from './xr-live/src/sim/index';
300
+ /** Optional WebGPU Gaussian Splatting compute & render accelerator (`xr-live/webgpu`, `xr-live-webgpu.min.js`). */
301
+ export * from './xr-live/src/webgpu';
302
+ /** Optional WebGPU `GPURenderBundle` scene accelerator (`three-live/webgpu`, `three-live-webgpu.min.js`). */
303
+ export * from './three-live/src/webgpu';
304
+ /** Optional Loop-Free `THREE.TSL` & `MeshStandardNodeMaterial` compiler (`three-live/tsl`, `three-live-tsl.min.js`). */
305
+ export * from './three-live/src/tsl';
149
306
 
150
307
  /**
151
308
  * Declarative JSX / HTML attributes supported by the <three-live> custom element.
@@ -234,6 +391,40 @@ export interface ThreeLiveAttributes {
234
391
  * Server-generated scripts (`script-src`) are enabled by default.
235
392
  */
236
393
  'allow-client-scripts'?: boolean | string;
394
+ /** `three-live-ai`: Chat Completions-compatible endpoint (your proxy or a local model) for `editScene()`. */
395
+ 'ai-endpoint'?: string;
396
+ /** `three-live-ai`: model name sent to `ai-endpoint`. */
397
+ 'ai-model'?: string;
398
+ /** `three-live-ai`: provider protocol for `ai-endpoint` (`'ai-chat'`, the default). */
399
+ 'ai-provider'?: 'ai-chat';
400
+ /** `three-live-ai`: OpenAI-compatible Images endpoint (`/v1/images/generations`) for AI textures (`userData.xr.material.prompt`). */
401
+ 'ai-image-endpoint'?: string;
402
+ /** `three-live-ai`: model name sent to `ai-image-endpoint`. */
403
+ 'ai-image-model'?: string;
404
+ /** `three-live-ai`: `'auto'` (default) generates missing AI textures when an image endpoint is configured; `'manual'` waits for `el.generateTextures()`. */
405
+ 'ai-textures'?: 'auto' | 'manual';
406
+ /** `three-live-ai`: URL of a texture pack (`scene.textures.json`) for AI textures. */
407
+ 'texture-pack'?: string;
408
+ /** `three-live-webgpu`: scene rendering backend (`'auto'`, `'webgpu'`, or `'webgl2'`). */
409
+ renderer?: 'auto' | 'webgpu' | 'webgl2' | string;
410
+ /** `three-live-studio` / `shadowMapsPlugin`: multi-light depth shadow maps (`'auto'`, `'pcf'`, or `'off'`). */
411
+ 'shadow-maps'?: ShadowMapsMode | string;
412
+ /** `xr-live-webgpu`: Gaussian splatting backend (`'auto'`, `'webgpu'`, `'hybrid'`, or `'webgl2'`). */
413
+ 'splat-renderer'?: 'auto' | 'webgpu' | 'hybrid' | 'webgl2' | string;
414
+ /** `xr-live-spatial` / `xr-live-webgpu`: Spherical Harmonics view-dependent color quality (`'normal'` or `'high'`). */
415
+ 'splat-quality'?: 'normal' | 'high' | string;
416
+ /** Allow cross-origin `.splat` / `.spz` URLs on `userData.xr.splatUrl`. */
417
+ 'allow-remote-splats'?: boolean | string;
418
+ /** `three-live-ai`: tapping a mesh selects it (tap again to clear; Shift/Ctrl/Cmd-tap or long-press adds to `el.selectedMeshes`). */
419
+ 'ai-select-on-tap'?: boolean | string;
420
+ /** `three-live-ai`: show a mic button (push-to-talk, or a realtime session when `ai-voice-url` is set). */
421
+ 'ai-voice-button'?: boolean | string;
422
+ /** `three-live-ai`: `wss://` realtime voice endpoint (your proxy or an ephemeral-token URL) for the mic button. */
423
+ 'ai-voice-url'?: string;
424
+ /** `three-live-ai`: realtime voice protocol for `ai-voice-url` (`'ai-realtime'`, the default, or `'gemini-live'`). */
425
+ 'ai-voice-provider'?: 'ai-realtime' | 'gemini-live';
426
+ /** `three-live-ai`: model name sent in the realtime session setup. */
427
+ 'ai-voice-model'?: string;
237
428
 
238
429
  // React 19 / JSX Event Listeners
239
430
  onload?: (e: CustomEvent<{model: GLBData}>) => void;