@iwsdk/vite-plugin-dev 1.0.0-rc.0 → 1.0.0-rc.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
@@ -39,7 +39,7 @@ export default defineConfig({
39
39
  iwsdkDev({
40
40
  emulator: {
41
41
  // XR device to emulate
42
- // Options: 'metaQuest2' | 'metaQuest3' | 'metaQuestPro' | 'oculusQuest1'
42
+ // Options: 'metaQuest2' | 'metaQuest3' | 'metaQuestPro' | 'metaVRGlasses' | 'oculusQuest1'
43
43
  device: 'metaQuest3', // default
44
44
 
45
45
  // Synthetic environment for AR room simulation
package/dist/index.d.ts CHANGED
@@ -6,7 +6,7 @@
6
6
  */
7
7
  import type { Plugin } from 'vite';
8
8
  import type { DevPluginOptions } from './types.js';
9
- export type { DevPluginOptions, AiOptions, AiMode, EmulatorOptions, DevelopmentHttpsOptions, ProductionBundleOptions, UIKitMLBundledFontName, WorkspaceOptions, ProcessedDevOptions, IWERPluginOptions, SEMOptions, } from './types.js';
9
+ export type { DevPluginOptions, AiOptions, AiMode, EmulatorOptions, DevelopmentHttpsOptions, ProductionBundleOptions, UIKitMLBundledFontName, WorkspaceOptions, TargetDevicePreviewOptions, ProcessedDevOptions, IWERPluginOptions, SEMOptions, } from './types.js';
10
10
  /**
11
11
  * Vite plugin for IWSDK development — XR emulation, AI agent tooling, and Playwright browser
12
12
  */
package/dist/index.js CHANGED
@@ -1501,7 +1501,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1501
1501
  // =============================================================================
1502
1502
  {
1503
1503
  name: 'xr_get_transform',
1504
- description: 'Get position and orientation of a tracked device',
1504
+ description: 'Get position and orientation of a tracked device. Gaze reports the headset-derived origin and its world orientation.',
1505
1505
  inputSchema: {
1506
1506
  type: 'object',
1507
1507
  properties: {
@@ -1513,6 +1513,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1513
1513
  'controller-right',
1514
1514
  'hand-left',
1515
1515
  'hand-right',
1516
+ 'gaze',
1516
1517
  ],
1517
1518
  description: 'The device to query',
1518
1519
  },
@@ -1522,7 +1523,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1522
1523
  },
1523
1524
  {
1524
1525
  name: 'xr_set_transform',
1525
- description: 'Set position and/or orientation of a tracked device. Position is in meters, orientation can be quaternion or euler angles (degrees).',
1526
+ description: 'Set position and/or orientation of a tracked device. Position is in meters, orientation can be quaternion or euler angles (degrees). Gaze accepts orientation only; move its origin with the headset.',
1526
1527
  inputSchema: {
1527
1528
  type: 'object',
1528
1529
  properties: {
@@ -1534,6 +1535,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1534
1535
  'controller-right',
1535
1536
  'hand-left',
1536
1537
  'hand-right',
1538
+ 'gaze',
1537
1539
  ],
1538
1540
  description: 'The device to move',
1539
1541
  },
@@ -1577,7 +1579,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1577
1579
  },
1578
1580
  {
1579
1581
  name: 'xr_look_at',
1580
- description: 'Orient a device to look at a specific world position',
1582
+ description: 'Orient a device to look at a specific world position. Gaze keeps its headset-derived origin.',
1581
1583
  inputSchema: {
1582
1584
  type: 'object',
1583
1585
  properties: {
@@ -1589,6 +1591,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1589
1591
  'controller-right',
1590
1592
  'hand-left',
1591
1593
  'hand-right',
1594
+ 'gaze',
1592
1595
  ],
1593
1596
  description: 'The device to orient',
1594
1597
  },
@@ -1604,7 +1607,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1604
1607
  },
1605
1608
  moveToDistance: {
1606
1609
  type: 'number',
1607
- description: 'Optional: move device to this distance from target',
1610
+ description: 'Optional: move device to this distance from target (not supported for gaze)',
1608
1611
  },
1609
1612
  },
1610
1613
  required: ['device', 'target'],
@@ -1612,7 +1615,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1612
1615
  },
1613
1616
  {
1614
1617
  name: 'xr_animate_to',
1615
- description: 'Smoothly animate a device to a new position/orientation over time',
1618
+ description: 'Smoothly animate a device to a new position/orientation over time. Gaze accepts orientation only.',
1616
1619
  inputSchema: {
1617
1620
  type: 'object',
1618
1621
  properties: {
@@ -1624,6 +1627,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1624
1627
  'controller-right',
1625
1628
  'hand-left',
1626
1629
  'hand-right',
1630
+ 'gaze',
1627
1631
  ],
1628
1632
  description: 'The device to animate',
1629
1633
  },
@@ -1683,7 +1687,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1683
1687
  },
1684
1688
  {
1685
1689
  name: 'xr_set_connected',
1686
- description: 'Connect or disconnect an input device',
1690
+ description: 'Connect or disconnect a controller, hand, or gaze source',
1687
1691
  inputSchema: {
1688
1692
  type: 'object',
1689
1693
  properties: {
@@ -1694,6 +1698,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
1694
1698
  'controller-right',
1695
1699
  'hand-left',
1696
1700
  'hand-right',
1701
+ 'gaze',
1697
1702
  ],
1698
1703
  description: 'The input device',
1699
1704
  },
@@ -2083,7 +2088,7 @@ const ALL_RUNTIME_MCP_TOOLS = [
2083
2088
  // =============================================================================
2084
2089
  {
2085
2090
  name: 'xr_get_device_state',
2086
- description: 'Get comprehensive state of the XR device including headset, controllers, and hands',
2091
+ description: 'Get comprehensive state of the XR device including headset, controllers, hands, and gaze',
2087
2092
  inputSchema: {
2088
2093
  type: 'object',
2089
2094
  properties: {},
@@ -2180,6 +2185,23 @@ const ALL_RUNTIME_MCP_TOOLS = [
2180
2185
  },
2181
2186
  },
2182
2187
  },
2188
+ gaze: {
2189
+ type: 'object',
2190
+ additionalProperties: false,
2191
+ description: 'Gaze state. Its origin is derived from the headset and cannot be set independently.',
2192
+ properties: {
2193
+ orientation: {
2194
+ type: 'object',
2195
+ properties: {
2196
+ x: { type: 'number' },
2197
+ y: { type: 'number' },
2198
+ z: { type: 'number' },
2199
+ w: { type: 'number' },
2200
+ },
2201
+ },
2202
+ connected: { type: 'boolean' },
2203
+ },
2204
+ },
2183
2205
  },
2184
2206
  },
2185
2207
  },
@@ -24452,6 +24474,7 @@ async function buildInjectionBundle(options) {
24452
24474
  : options.userAgentException,
24453
24475
  iwer: options.iwer,
24454
24476
  nativeXRControl: options.nativeXRControl,
24477
+ targetDevicePreview: options.targetDevicePreview,
24455
24478
  };
24456
24479
  // Replace the CONFIG token with actual configuration
24457
24480
  const configReplacement = JSON.stringify(config, null, 2);
@@ -57345,6 +57368,7 @@ const OPTIMIZER_EXCLUSIONS = [
57345
57368
  'preact/jsx-runtime',
57346
57369
  ];
57347
57370
  const OPTIMIZER_INCLUSIONS = [
57371
+ '@iwsdk/core > elics',
57348
57372
  '@iwsdk/scene-composition',
57349
57373
  'three',
57350
57374
  'three-viewport-gizmo',
@@ -57390,6 +57414,9 @@ function processOptions(options = {}) {
57390
57414
  userAgentException: emulator.userAgentException || new RegExp('OculusBrowser'),
57391
57415
  iwer: emulator.iwer ?? true,
57392
57416
  nativeXRControl: options.nativeXRControl ?? false,
57417
+ ...(options.targetDevicePreview == null
57418
+ ? {}
57419
+ : { targetDevicePreview: options.targetDevicePreview }),
57393
57420
  bridgeReadyTimeoutMs,
57394
57421
  };
57395
57422
  // Process SEM options from emulator.environment
@@ -57401,6 +57428,9 @@ function processOptions(options = {}) {
57401
57428
  if (processed.nativeXRControl && processed.iwer === false) {
57402
57429
  throw new Error('[IWSDK] --native-xr-control requires dev.emulator.iwer to be enabled.');
57403
57430
  }
57431
+ if (processed.targetDevicePreview && processed.iwer === false) {
57432
+ throw new Error('[IWSDK] dev.targetDevicePreview requires dev.emulator.iwer to be enabled.');
57433
+ }
57404
57434
  const normalizeScreenshotSize = (input) => {
57405
57435
  const width = input?.width;
57406
57436
  const height = input?.height;
@@ -57546,6 +57576,9 @@ function projectManifestPluginOptions(options, manifest, projectRoot, command) {
57546
57576
  ...(ai == null ? {} : { ai }),
57547
57577
  ...(workspace == null ? {} : { workspace }),
57548
57578
  ...(nativeXRControl ? { nativeXRControl } : {}),
57579
+ ...(command === 'serve' && dev.targetDevicePreview != null
57580
+ ? { targetDevicePreview: dev.targetDevicePreview }
57581
+ : {}),
57549
57582
  ...(options.https == null ? {} : { https: options.https }),
57550
57583
  ...(options.verbose == null ? {} : { verbose: options.verbose }),
57551
57584
  ...(options.bridgeReadyTimeoutMs == null
@@ -57774,7 +57807,10 @@ function iwsdkDev(options = {}) {
57774
57807
  // started. Keep its framework dependencies out of Vite's late discovery
57775
57808
  // pass so opening the editor cannot invalidate the running page. The
57776
57809
  // MSDF generator must also stay unbundled so its relative worker and WASM
57777
- // URLs continue to resolve when UIKit loads a TTF font.
57810
+ // URLs continue to resolve when UIKit loads a TTF font. @iwsdk/core is
57811
+ // served unbundled, so pre-bundle its elics dependency through it; the
57812
+ // nested form resolves under pnpm, where elics is not visible from the
57813
+ // app root.
57778
57814
  userConfig.optimizeDeps ?? (userConfig.optimizeDeps = {});
57779
57815
  userConfig.optimizeDeps.exclude = [
57780
57816
  ...(userConfig.optimizeDeps.exclude ?? []),