three-live 1.2.0 → 1.2.1

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.
@@ -30,12 +30,12 @@ import type {
30
30
  } from './three-live/src/three-view';
31
31
  import type {ARLaunchResult, ARMode} from './three-live/src/three-xr';
32
32
  import type {
33
+ Detection3D,
33
34
  DimensionUnit,
34
35
  ExplodeMode,
35
36
  RemotePeerState,
36
37
  SnapSurfaceMode,
37
38
  TranscriptEvent,
38
- Detection3D,
39
39
  } from './xr-live/src/plugins/index';
40
40
  import type {
41
41
  XRAnchorElement,
@@ -193,7 +193,7 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
193
193
  'xr-depth'?: XRDepthMode;
194
194
  /** 25-joint hand tracking and gesture recognition mode ("gestures", "joints", "pinch", "none"). */
195
195
  'xr-hands'?: XRHandsMode;
196
- /** Desktop room simulator environment ("living-room", "office", "tabletop", "none"). */
196
+ /** Desktop 3D room preview environment, unrelated to `xr-live-sim` ("living-room", "office", "tabletop", "none"). */
197
197
  'xr-simulator'?: XRSimulatorRoom;
198
198
  /** Spatial UI profile ("quest3", "android-xr", "visionos", "auto"). */
199
199
  'xr-profile'?: XRProfile;
@@ -208,7 +208,14 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
208
208
  /** Default display unit for `spatial-measure` ("auto", "m", "cm", "mm", "in", "ft-in"). */
209
209
  'measure-unit'?: DimensionUnit;
210
210
  /** Spatial plugin: socket, grid, surface, and angle snapping ("grid", "surface", "sockets", "all", "none"). */
211
- 'magnetic-snap'?: boolean | 'grid' | 'surface' | 'sockets' | 'all' | 'none' | string;
211
+ 'magnetic-snap'?:
212
+ | boolean
213
+ | 'grid'
214
+ | 'surface'
215
+ | 'sockets'
216
+ | 'all'
217
+ | 'none'
218
+ | string;
212
219
  /** Cartesian snap grid step in meters ("0.05" or "0.05 0.05 0.05"). */
213
220
  'snap-grid'?: number | string;
214
221
  /** Rotational yaw snap increment in degrees (0 to 180). */
@@ -241,6 +248,45 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
241
248
  'peer-name'?: string;
242
249
  /** Local avatar visor & laser color (`#rrggbb`) in `shared-room`. */
243
250
  'peer-color'?: string;
251
+ /** xr-live-sim: character camera mode, or `none` to disable the character. */
252
+ 'character-controller'?:
253
+ | 'third-person'
254
+ | 'first-person'
255
+ | 'top-down'
256
+ | 'fixed-camera'
257
+ | 'none';
258
+ /** xr-live-sim: character speed override (m/s). */
259
+ 'character-speed'?: number | string;
260
+ /** xr-live-sim: character jump velocity override (m/s). */
261
+ 'character-jump'?: number | string;
262
+ /** xr-live-sim: on-screen joystick (`auto` shows it on touch screens). */
263
+ 'touch-joystick'?: 'auto' | 'always' | 'none';
264
+ /** xr-live-sim: `false` or `none` pauses steering agents. */
265
+ 'steering-agents'?: boolean | string;
266
+ /** xr-live-sim: firing mode (empty means `projectile`). */
267
+ 'hit-zones'?: '' | 'projectile' | 'hitscan' | 'contact' | 'off';
268
+ /** xr-live-sim: shots per second (default: 4). */
269
+ 'fire-rate'?: number | string;
270
+ /** xr-live-sim: projectile speed in m/s (default: 14). */
271
+ 'projectile-speed'?: number | string;
272
+ /** xr-live-sim: projectile gravity in m/s² (default: 0). */
273
+ 'projectile-gravity'?: number | string;
274
+ /** xr-live-sim: integrity removed per hit (default: 25). */
275
+ 'hit-amount'?: number | string;
276
+ /** xr-live-sim: enables objectives and scoring (`none` disables). */
277
+ 'objectives'?: boolean | string;
278
+ /** xr-live-sim: scenario countdown in seconds. */
279
+ 'scenario-timer'?: number | string;
280
+ /** xr-live-sim: score that passes the scenario. */
281
+ 'target-score'?: number | string;
282
+ /** xr-live-sim: attempts before the scenario fails. */
283
+ 'attempts'?: number | string;
284
+ /** xr-live-sim: score HUD style. */
285
+ 'sim-hud'?: 'auto' | 'minimal' | 'none';
286
+ /** xr-live-sim: plays procedural audio cues (`muted` disables). */
287
+ 'synth-audio'?: boolean | string;
288
+ /** xr-live-sim: cue volume from 0 to 1 (default: 0.7). */
289
+ 'synth-volume'?: number | string;
244
290
  /** Register WebMCP browser AI tools on `navigator.modelContext`. */
245
291
  'webmcp'?: boolean | string;
246
292
  /** Opt-in gate allowing WebMCP `capture_xr_view` to include the 8x8 depth grid. */
@@ -314,7 +360,74 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
314
360
  e: CustomEvent<Pick<RemotePeerState, 'peerId' | 'name' | 'color'>>,
315
361
  ) => void;
316
362
  onpeersync?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
317
- onpeergrabconflict?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
363
+ onpeergrabconflict?: (
364
+ e: CustomEvent<{peerId: string; nodeId: string}>,
365
+ ) => void;
366
+ /** xr-live-sim events. */
367
+ oncharacterjump?: (
368
+ e: CustomEvent<{nodeId: string; position: [number, number, number]}>,
369
+ ) => void;
370
+ oncharacterland?: (
371
+ e: CustomEvent<{nodeId: string; fallSpeed: number}>,
372
+ ) => void;
373
+ onagentstatechange?: (
374
+ e: CustomEvent<{nodeId: string; state: string; targetId: string | null}>,
375
+ ) => void;
376
+ onagentreach?: (
377
+ e: CustomEvent<{
378
+ agentId: string;
379
+ targetId: string;
380
+ position: [number, number, number];
381
+ }>,
382
+ ) => void;
383
+ onxrhit?: (
384
+ e: CustomEvent<{
385
+ targetId: string;
386
+ /** Shooter node name, or `'user'`. */
387
+ sourceId: string;
388
+ amount: number;
389
+ remaining: number;
390
+ point: [number, number, number];
391
+ }>,
392
+ ) => void;
393
+ onxrdepleted?: (
394
+ e: CustomEvent<{targetId: string; group: string; scoreValue: number}>,
395
+ ) => void;
396
+ onxrzoneenter?: (
397
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
398
+ ) => void;
399
+ onxrzoneexit?: (
400
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
401
+ ) => void;
402
+ onxrspawn?: (
403
+ e: CustomEvent<{spawnerId: string; instanceId: string; index: number}>,
404
+ ) => void;
405
+ onxrobjective?: (
406
+ e: CustomEvent<{
407
+ nodeId: string;
408
+ tag: string;
409
+ type: string;
410
+ amount: number;
411
+ totalScore: number;
412
+ remainingRequired: number;
413
+ outOfOrder: boolean;
414
+ }>,
415
+ ) => void;
416
+ onxrscorechange?: (
417
+ e: CustomEvent<{
418
+ score: number;
419
+ delta: number;
420
+ attemptsLeft: number | null;
421
+ timeRemaining: number | null;
422
+ }>,
423
+ ) => void;
424
+ onxrscenarioend?: (
425
+ e: CustomEvent<{
426
+ outcome: 'pass' | 'fail' | 'timeout';
427
+ finalScore: number;
428
+ elapsedSec: number;
429
+ }>,
430
+ ) => void;
318
431
  }
319
432
 
320
433
  declare global {
@@ -30,12 +30,12 @@ import type {
30
30
  } from './three-live/src/three-view';
31
31
  import type {ARLaunchResult, ARMode} from './three-live/src/three-xr';
32
32
  import type {
33
+ Detection3D,
33
34
  DimensionUnit,
34
35
  ExplodeMode,
35
36
  RemotePeerState,
36
37
  SnapSurfaceMode,
37
38
  TranscriptEvent,
38
- Detection3D,
39
39
  } from './xr-live/src/plugins/index';
40
40
  import type {
41
41
  XRAnchorElement,
@@ -193,7 +193,7 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
193
193
  'xr-depth'?: XRDepthMode;
194
194
  /** 25-joint hand tracking and gesture recognition mode ("gestures", "joints", "pinch", "none"). */
195
195
  'xr-hands'?: XRHandsMode;
196
- /** Desktop room simulator environment ("living-room", "office", "tabletop", "none"). */
196
+ /** Desktop 3D room preview environment, unrelated to `xr-live-sim` ("living-room", "office", "tabletop", "none"). */
197
197
  'xr-simulator'?: XRSimulatorRoom;
198
198
  /** Spatial UI profile ("quest3", "android-xr", "visionos", "auto"). */
199
199
  'xr-profile'?: XRProfile;
@@ -208,7 +208,14 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
208
208
  /** Default display unit for `spatial-measure` ("auto", "m", "cm", "mm", "in", "ft-in"). */
209
209
  'measure-unit'?: DimensionUnit;
210
210
  /** Spatial plugin: socket, grid, surface, and angle snapping ("grid", "surface", "sockets", "all", "none"). */
211
- 'magnetic-snap'?: boolean | 'grid' | 'surface' | 'sockets' | 'all' | 'none' | string;
211
+ 'magnetic-snap'?:
212
+ | boolean
213
+ | 'grid'
214
+ | 'surface'
215
+ | 'sockets'
216
+ | 'all'
217
+ | 'none'
218
+ | string;
212
219
  /** Cartesian snap grid step in meters ("0.05" or "0.05 0.05 0.05"). */
213
220
  'snap-grid'?: number | string;
214
221
  /** Rotational yaw snap increment in degrees (0 to 180). */
@@ -241,6 +248,45 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
241
248
  'peer-name'?: string;
242
249
  /** Local avatar visor & laser color (`#rrggbb`) in `shared-room`. */
243
250
  'peer-color'?: string;
251
+ /** xr-live-sim: character camera mode, or `none` to disable the character. */
252
+ 'character-controller'?:
253
+ | 'third-person'
254
+ | 'first-person'
255
+ | 'top-down'
256
+ | 'fixed-camera'
257
+ | 'none';
258
+ /** xr-live-sim: character speed override (m/s). */
259
+ 'character-speed'?: number | string;
260
+ /** xr-live-sim: character jump velocity override (m/s). */
261
+ 'character-jump'?: number | string;
262
+ /** xr-live-sim: on-screen joystick (`auto` shows it on touch screens). */
263
+ 'touch-joystick'?: 'auto' | 'always' | 'none';
264
+ /** xr-live-sim: `false` or `none` pauses steering agents. */
265
+ 'steering-agents'?: boolean | string;
266
+ /** xr-live-sim: firing mode (empty means `projectile`). */
267
+ 'hit-zones'?: '' | 'projectile' | 'hitscan' | 'contact' | 'off';
268
+ /** xr-live-sim: shots per second (default: 4). */
269
+ 'fire-rate'?: number | string;
270
+ /** xr-live-sim: projectile speed in m/s (default: 14). */
271
+ 'projectile-speed'?: number | string;
272
+ /** xr-live-sim: projectile gravity in m/s² (default: 0). */
273
+ 'projectile-gravity'?: number | string;
274
+ /** xr-live-sim: integrity removed per hit (default: 25). */
275
+ 'hit-amount'?: number | string;
276
+ /** xr-live-sim: enables objectives and scoring (`none` disables). */
277
+ 'objectives'?: boolean | string;
278
+ /** xr-live-sim: scenario countdown in seconds. */
279
+ 'scenario-timer'?: number | string;
280
+ /** xr-live-sim: score that passes the scenario. */
281
+ 'target-score'?: number | string;
282
+ /** xr-live-sim: attempts before the scenario fails. */
283
+ 'attempts'?: number | string;
284
+ /** xr-live-sim: score HUD style. */
285
+ 'sim-hud'?: 'auto' | 'minimal' | 'none';
286
+ /** xr-live-sim: plays procedural audio cues (`muted` disables). */
287
+ 'synth-audio'?: boolean | string;
288
+ /** xr-live-sim: cue volume from 0 to 1 (default: 0.7). */
289
+ 'synth-volume'?: number | string;
244
290
  /** Register WebMCP browser AI tools on `navigator.modelContext`. */
245
291
  'webmcp'?: boolean | string;
246
292
  /** Opt-in gate allowing WebMCP `capture_xr_view` to include the 8x8 depth grid. */
@@ -314,7 +360,74 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
314
360
  e: CustomEvent<Pick<RemotePeerState, 'peerId' | 'name' | 'color'>>,
315
361
  ) => void;
316
362
  onpeersync?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
317
- onpeergrabconflict?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
363
+ onpeergrabconflict?: (
364
+ e: CustomEvent<{peerId: string; nodeId: string}>,
365
+ ) => void;
366
+ /** xr-live-sim events. */
367
+ oncharacterjump?: (
368
+ e: CustomEvent<{nodeId: string; position: [number, number, number]}>,
369
+ ) => void;
370
+ oncharacterland?: (
371
+ e: CustomEvent<{nodeId: string; fallSpeed: number}>,
372
+ ) => void;
373
+ onagentstatechange?: (
374
+ e: CustomEvent<{nodeId: string; state: string; targetId: string | null}>,
375
+ ) => void;
376
+ onagentreach?: (
377
+ e: CustomEvent<{
378
+ agentId: string;
379
+ targetId: string;
380
+ position: [number, number, number];
381
+ }>,
382
+ ) => void;
383
+ onxrhit?: (
384
+ e: CustomEvent<{
385
+ targetId: string;
386
+ /** Shooter node name, or `'user'`. */
387
+ sourceId: string;
388
+ amount: number;
389
+ remaining: number;
390
+ point: [number, number, number];
391
+ }>,
392
+ ) => void;
393
+ onxrdepleted?: (
394
+ e: CustomEvent<{targetId: string; group: string; scoreValue: number}>,
395
+ ) => void;
396
+ onxrzoneenter?: (
397
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
398
+ ) => void;
399
+ onxrzoneexit?: (
400
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
401
+ ) => void;
402
+ onxrspawn?: (
403
+ e: CustomEvent<{spawnerId: string; instanceId: string; index: number}>,
404
+ ) => void;
405
+ onxrobjective?: (
406
+ e: CustomEvent<{
407
+ nodeId: string;
408
+ tag: string;
409
+ type: string;
410
+ amount: number;
411
+ totalScore: number;
412
+ remainingRequired: number;
413
+ outOfOrder: boolean;
414
+ }>,
415
+ ) => void;
416
+ onxrscorechange?: (
417
+ e: CustomEvent<{
418
+ score: number;
419
+ delta: number;
420
+ attemptsLeft: number | null;
421
+ timeRemaining: number | null;
422
+ }>,
423
+ ) => void;
424
+ onxrscenarioend?: (
425
+ e: CustomEvent<{
426
+ outcome: 'pass' | 'fail' | 'timeout';
427
+ finalScore: number;
428
+ elapsedSec: number;
429
+ }>,
430
+ ) => void;
318
431
  }
319
432
 
320
433
  declare global {
@@ -30,12 +30,12 @@ import type {
30
30
  } from './three-live/src/three-view';
31
31
  import type {ARLaunchResult, ARMode} from './three-live/src/three-xr';
32
32
  import type {
33
+ Detection3D,
33
34
  DimensionUnit,
34
35
  ExplodeMode,
35
36
  RemotePeerState,
36
37
  SnapSurfaceMode,
37
38
  TranscriptEvent,
38
- Detection3D,
39
39
  } from './xr-live/src/plugins/index';
40
40
  import type {
41
41
  XRAnchorElement,
@@ -193,7 +193,7 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
193
193
  'xr-depth'?: XRDepthMode;
194
194
  /** 25-joint hand tracking and gesture recognition mode ("gestures", "joints", "pinch", "none"). */
195
195
  'xr-hands'?: XRHandsMode;
196
- /** Desktop room simulator environment ("living-room", "office", "tabletop", "none"). */
196
+ /** Desktop 3D room preview environment, unrelated to `xr-live-sim` ("living-room", "office", "tabletop", "none"). */
197
197
  'xr-simulator'?: XRSimulatorRoom;
198
198
  /** Spatial UI profile ("quest3", "android-xr", "visionos", "auto"). */
199
199
  'xr-profile'?: XRProfile;
@@ -208,7 +208,14 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
208
208
  /** Default display unit for `spatial-measure` ("auto", "m", "cm", "mm", "in", "ft-in"). */
209
209
  'measure-unit'?: DimensionUnit;
210
210
  /** Spatial plugin: socket, grid, surface, and angle snapping ("grid", "surface", "sockets", "all", "none"). */
211
- 'magnetic-snap'?: boolean | 'grid' | 'surface' | 'sockets' | 'all' | 'none' | string;
211
+ 'magnetic-snap'?:
212
+ | boolean
213
+ | 'grid'
214
+ | 'surface'
215
+ | 'sockets'
216
+ | 'all'
217
+ | 'none'
218
+ | string;
212
219
  /** Cartesian snap grid step in meters ("0.05" or "0.05 0.05 0.05"). */
213
220
  'snap-grid'?: number | string;
214
221
  /** Rotational yaw snap increment in degrees (0 to 180). */
@@ -241,6 +248,45 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
241
248
  'peer-name'?: string;
242
249
  /** Local avatar visor & laser color (`#rrggbb`) in `shared-room`. */
243
250
  'peer-color'?: string;
251
+ /** xr-live-sim: character camera mode, or `none` to disable the character. */
252
+ 'character-controller'?:
253
+ | 'third-person'
254
+ | 'first-person'
255
+ | 'top-down'
256
+ | 'fixed-camera'
257
+ | 'none';
258
+ /** xr-live-sim: character speed override (m/s). */
259
+ 'character-speed'?: number | string;
260
+ /** xr-live-sim: character jump velocity override (m/s). */
261
+ 'character-jump'?: number | string;
262
+ /** xr-live-sim: on-screen joystick (`auto` shows it on touch screens). */
263
+ 'touch-joystick'?: 'auto' | 'always' | 'none';
264
+ /** xr-live-sim: `false` or `none` pauses steering agents. */
265
+ 'steering-agents'?: boolean | string;
266
+ /** xr-live-sim: firing mode (empty means `projectile`). */
267
+ 'hit-zones'?: '' | 'projectile' | 'hitscan' | 'contact' | 'off';
268
+ /** xr-live-sim: shots per second (default: 4). */
269
+ 'fire-rate'?: number | string;
270
+ /** xr-live-sim: projectile speed in m/s (default: 14). */
271
+ 'projectile-speed'?: number | string;
272
+ /** xr-live-sim: projectile gravity in m/s² (default: 0). */
273
+ 'projectile-gravity'?: number | string;
274
+ /** xr-live-sim: integrity removed per hit (default: 25). */
275
+ 'hit-amount'?: number | string;
276
+ /** xr-live-sim: enables objectives and scoring (`none` disables). */
277
+ 'objectives'?: boolean | string;
278
+ /** xr-live-sim: scenario countdown in seconds. */
279
+ 'scenario-timer'?: number | string;
280
+ /** xr-live-sim: score that passes the scenario. */
281
+ 'target-score'?: number | string;
282
+ /** xr-live-sim: attempts before the scenario fails. */
283
+ 'attempts'?: number | string;
284
+ /** xr-live-sim: score HUD style. */
285
+ 'sim-hud'?: 'auto' | 'minimal' | 'none';
286
+ /** xr-live-sim: plays procedural audio cues (`muted` disables). */
287
+ 'synth-audio'?: boolean | string;
288
+ /** xr-live-sim: cue volume from 0 to 1 (default: 0.7). */
289
+ 'synth-volume'?: number | string;
244
290
  /** Register WebMCP browser AI tools on `navigator.modelContext`. */
245
291
  'webmcp'?: boolean | string;
246
292
  /** Opt-in gate allowing WebMCP `capture_xr_view` to include the 8x8 depth grid. */
@@ -314,7 +360,74 @@ export interface XRLiveAttributes extends ThreeLiveAttributes {
314
360
  e: CustomEvent<Pick<RemotePeerState, 'peerId' | 'name' | 'color'>>,
315
361
  ) => void;
316
362
  onpeersync?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
317
- onpeergrabconflict?: (e: CustomEvent<{peerId: string; nodeId: string}>) => void;
363
+ onpeergrabconflict?: (
364
+ e: CustomEvent<{peerId: string; nodeId: string}>,
365
+ ) => void;
366
+ /** xr-live-sim events. */
367
+ oncharacterjump?: (
368
+ e: CustomEvent<{nodeId: string; position: [number, number, number]}>,
369
+ ) => void;
370
+ oncharacterland?: (
371
+ e: CustomEvent<{nodeId: string; fallSpeed: number}>,
372
+ ) => void;
373
+ onagentstatechange?: (
374
+ e: CustomEvent<{nodeId: string; state: string; targetId: string | null}>,
375
+ ) => void;
376
+ onagentreach?: (
377
+ e: CustomEvent<{
378
+ agentId: string;
379
+ targetId: string;
380
+ position: [number, number, number];
381
+ }>,
382
+ ) => void;
383
+ onxrhit?: (
384
+ e: CustomEvent<{
385
+ targetId: string;
386
+ /** Shooter node name, or `'user'`. */
387
+ sourceId: string;
388
+ amount: number;
389
+ remaining: number;
390
+ point: [number, number, number];
391
+ }>,
392
+ ) => void;
393
+ onxrdepleted?: (
394
+ e: CustomEvent<{targetId: string; group: string; scoreValue: number}>,
395
+ ) => void;
396
+ onxrzoneenter?: (
397
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
398
+ ) => void;
399
+ onxrzoneexit?: (
400
+ e: CustomEvent<{zoneId: string; nodeId: string; group: string}>,
401
+ ) => void;
402
+ onxrspawn?: (
403
+ e: CustomEvent<{spawnerId: string; instanceId: string; index: number}>,
404
+ ) => void;
405
+ onxrobjective?: (
406
+ e: CustomEvent<{
407
+ nodeId: string;
408
+ tag: string;
409
+ type: string;
410
+ amount: number;
411
+ totalScore: number;
412
+ remainingRequired: number;
413
+ outOfOrder: boolean;
414
+ }>,
415
+ ) => void;
416
+ onxrscorechange?: (
417
+ e: CustomEvent<{
418
+ score: number;
419
+ delta: number;
420
+ attemptsLeft: number | null;
421
+ timeRemaining: number | null;
422
+ }>,
423
+ ) => void;
424
+ onxrscenarioend?: (
425
+ e: CustomEvent<{
426
+ outcome: 'pass' | 'fail' | 'timeout';
427
+ finalScore: number;
428
+ elapsedSec: number;
429
+ }>,
430
+ ) => void;
318
431
  }
319
432
 
320
433
  declare global {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "three-live",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "Lightweight 3D, WebXR, and procedural Three.js runtime",
5
5
  "author": "Google LLC",
6
6
  "license": "Apache-2.0",