@iwsdk/vite-plugin-dev 0.3.1 → 0.3.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/dist/browser-rpc-errors.d.ts +13 -0
- package/dist/headless-browser.d.ts +6 -1
- package/dist/index.d.ts +0 -33
- package/dist/index.js +1420 -320
- package/dist/index.js.map +1 -1
- package/dist/injection-bundle.js +2 -2
- package/dist/mcp/ws-client.d.ts +3 -0
- package/dist/runtime-session.d.ts +21 -0
- package/dist/types.d.ts +2 -7
- package/package.json +6 -7
- package/dist/mcp-server.d.ts +0 -1379
- package/dist/mcp-server.js +0 -21312
- package/dist/mcp-server.js.map +0 -1
|
@@ -0,0 +1,13 @@
|
|
|
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, RuntimeIssueCause } from '@iwsdk/cli/contract';
|
|
8
|
+
export interface RuntimeRpcErrorPayload {
|
|
9
|
+
code: number;
|
|
10
|
+
message: string;
|
|
11
|
+
cause?: RuntimeIssueCause;
|
|
12
|
+
}
|
|
13
|
+
export declare function createUnavailableBrowserRpcError(browser: RuntimeBrowserState | null | undefined): RuntimeRpcErrorPayload;
|
|
@@ -27,6 +27,11 @@ export interface ManagedBrowser {
|
|
|
27
27
|
page: unknown;
|
|
28
28
|
/** Query captured console logs. */
|
|
29
29
|
queryLogs(options?: LogQuery): CapturedLog[];
|
|
30
|
+
/** Read the managed browser tab identity used by MCP metadata. */
|
|
31
|
+
getTabMetadata(): Promise<{
|
|
32
|
+
id: string | null;
|
|
33
|
+
generation: number | null;
|
|
34
|
+
}>;
|
|
30
35
|
/** Take a screenshot of the browser page via CDP. */
|
|
31
36
|
screenshot(): Promise<Buffer>;
|
|
32
37
|
/** Register a callback invoked when the page/browser closes unexpectedly. */
|
|
@@ -40,4 +45,4 @@ export declare function launchManagedBrowser(url: string, headless: boolean, ver
|
|
|
40
45
|
} | null, screenshotSize?: {
|
|
41
46
|
width: number;
|
|
42
47
|
height: number;
|
|
43
|
-
}): Promise<ManagedBrowser>;
|
|
48
|
+
}, traceMcp?: boolean): Promise<ManagedBrowser>;
|
package/dist/index.d.ts
CHANGED
|
@@ -7,39 +7,6 @@
|
|
|
7
7
|
import type { Plugin } from 'vite';
|
|
8
8
|
import type { DevPluginOptions } from './types.js';
|
|
9
9
|
export type { DevPluginOptions, AiOptions, AiMode, EmulatorOptions, ProcessedDevOptions, IWERPluginOptions, SEMOptions, AiTool, } from './types.js';
|
|
10
|
-
/**
|
|
11
|
-
* Merge our server entries into an existing (or new) JSON config file.
|
|
12
|
-
* When `managedKeys` is provided, any key in that list that is NOT in
|
|
13
|
-
* `serverEntries` is removed — this prevents stale entries from surviving
|
|
14
|
-
* across config changes (e.g. uninstalling an optional MCP server).
|
|
15
|
-
* Returns true if the file was newly created.
|
|
16
|
-
*/
|
|
17
|
-
export declare function mergeJsonConfig(filePath: string, serverEntries: Record<string, unknown>, jsonKey: string, managedKeys?: string[]): Promise<boolean>;
|
|
18
|
-
/**
|
|
19
|
-
* Remove our managed server keys from a JSON config file.
|
|
20
|
-
* If we originally created the file and the servers section is now empty
|
|
21
|
-
* with no other top-level keys, delete the file entirely.
|
|
22
|
-
*
|
|
23
|
-
* @internal Not called by the plugin at runtime (MCP configs are left in
|
|
24
|
-
* place on shutdown). Kept as a tested utility for potential external use.
|
|
25
|
-
*/
|
|
26
|
-
export declare function unmergeJsonConfig(filePath: string, serverKeys: string[], jsonKey: string, weCreatedFile: boolean): Promise<void>;
|
|
27
|
-
/**
|
|
28
|
-
* Merge our managed TOML block into an existing (or new) config file.
|
|
29
|
-
* Returns true if the file was newly created.
|
|
30
|
-
*/
|
|
31
|
-
export declare function mergeTomlConfig(filePath: string, serverEntries: Record<string, {
|
|
32
|
-
command: string;
|
|
33
|
-
args: string[];
|
|
34
|
-
}>): Promise<boolean>;
|
|
35
|
-
/**
|
|
36
|
-
* Remove our managed TOML block from a config file.
|
|
37
|
-
* If we originally created the file and it's now effectively empty, delete it.
|
|
38
|
-
*
|
|
39
|
-
* @internal Not called by the plugin at runtime (MCP configs are left in
|
|
40
|
-
* place on shutdown). Kept as a tested utility for potential external use.
|
|
41
|
-
*/
|
|
42
|
-
export declare function unmergeTomlConfig(filePath: string, weCreatedFile: boolean): Promise<void>;
|
|
43
10
|
/**
|
|
44
11
|
* Vite plugin for IWSDK development — XR emulation, AI agent tooling, and Playwright browser
|
|
45
12
|
*/
|