@iwsdk/vite-plugin-dev 0.3.1 → 0.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.
@@ -22,6 +22,7 @@ interface FrameworkMCPRuntime {
22
22
  declare global {
23
23
  interface Window {
24
24
  FRAMEWORK_MCP_RUNTIME?: FrameworkMCPRuntime;
25
+ __IWSDK_MCP_TRACE?: boolean;
25
26
  }
26
27
  }
27
28
  /**
@@ -43,6 +44,8 @@ export declare class MCPWebSocketClient {
43
44
  constructor(device: XRDevice, options?: {
44
45
  verbose?: boolean;
45
46
  });
47
+ private isTraceEnabled;
48
+ private trace;
46
49
  /**
47
50
  * Connect to the Vite dev server's WebSocket endpoint
48
51
  */
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { type RuntimeBrowserState, type RuntimeSession } from '@iwsdk/cli/contract';
8
+ interface RegisterRuntimeSessionInput {
9
+ sessionId: string;
10
+ workspaceRoot: string;
11
+ pid: number;
12
+ port: number;
13
+ localUrl: string;
14
+ networkUrls?: string[];
15
+ aiMode?: string;
16
+ browser?: RuntimeBrowserState;
17
+ }
18
+ export declare function registerRuntimeSession(input: RegisterRuntimeSessionInput): Promise<RuntimeSession>;
19
+ export declare function setRuntimeSessionBrowserState(workspaceRoot: string, browser: RuntimeBrowserState): Promise<RuntimeSession | null>;
20
+ export declare function unregisterRuntimeSession(workspaceRoot: string): Promise<void>;
21
+ export {};
package/dist/types.d.ts CHANGED
@@ -30,11 +30,6 @@ export interface AiOptions {
30
30
  * @default 'agent'
31
31
  */
32
32
  mode?: AiMode;
33
- /**
34
- * Which AI tools to generate MCP config files for.
35
- * @default ['claude']
36
- */
37
- tools?: AiTool[];
38
33
  /**
39
34
  * Screenshot size constraint.
40
35
  * - In agent mode: sets the Playwright viewport dimensions directly.
@@ -93,7 +88,8 @@ export interface DevPluginOptions {
93
88
  /**
94
89
  * AI agent tooling configuration.
95
90
  * Enables AI agent control of the emulated XR runtime via MCP + WebSocket.
96
- * Omit to disable AI features entirely (no Playwright, no MCP configs).
91
+ * Omit to disable AI features entirely (no Playwright, no MCP bridge, no
92
+ * runtime session publication).
97
93
  */
98
94
  ai?: AiOptions;
99
95
  /**
@@ -114,7 +110,6 @@ export interface ProcessedDevOptions {
114
110
  };
115
111
  ai?: {
116
112
  mode: AiMode;
117
- tools: AiTool[];
118
113
  headless: boolean;
119
114
  devUI: boolean;
120
115
  viewport: {
package/package.json CHANGED
@@ -1,13 +1,10 @@
1
1
  {
2
2
  "name": "@iwsdk/vite-plugin-dev",
3
- "version": "0.3.1",
3
+ "version": "0.4.0",
4
4
  "type": "module",
5
5
  "description": "Vite plugin for IWSDK development — XR emulation, AI agent tooling, and Playwright browser",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
8
- "bin": {
9
- "iwsdk-dev-mcp": "./dist/mcp-server.js"
10
- },
11
8
  "files": [
12
9
  "dist",
13
10
  "README.md"
@@ -29,27 +26,29 @@
29
26
  "dependencies": {
30
27
  "@iwer/devui": "^2.2.0",
31
28
  "@iwer/sem": "^0.2.5",
32
- "@modelcontextprotocol/sdk": "^1.0.0",
33
- "iwer": "^2.2.0",
29
+ "iwer": "^2.2.1",
34
30
  "playwright": "^1.58.2",
35
31
  "sharp": "^0.33.0",
36
32
  "ws": "^8.18.0"
37
33
  },
38
34
  "devDependencies": {
39
35
  "@types/ws": "^8.5.13",
40
- "vitest": "^4.0.0"
36
+ "vitest": "^4.0.0",
37
+ "@iwsdk/cli": "0.4.0"
41
38
  },
42
39
  "peerDependencies": {
43
40
  "vite": "^7.0.0"
44
41
  },
45
42
  "engines": {
46
- "node": ">=20.19.0"
43
+ "node": ">=20.19.0 <21.0.0-0 || >=22.12.0 <23.0.0-0 || >=24.0.0"
47
44
  },
48
45
  "scripts": {
46
+ "prebuild": "pnpm --filter @iwsdk/cli build",
47
+ "prebuild:plugin": "pnpm --filter @iwsdk/cli build",
49
48
  "build": "rollup -c rollup.injection.config.js && rollup -c rollup.config.js",
50
49
  "build:plugin": "rollup -c rollup.config.js",
51
50
  "build:injection": "rollup -c rollup.injection.config.js",
52
- "test": "vitest run",
51
+ "test": "pnpm --filter @iwsdk/cli build && vitest run",
53
52
  "test:watch": "vitest",
54
53
  "dev": "rollup -c --watch",
55
54
  "clean": "rm -rf dist"