@hypothesi/tauri-mcp-server 0.9.0 → 0.10.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.
package/README.md CHANGED
@@ -52,6 +52,18 @@ npx -y install-mcp @hypothesi/tauri-mcp-server --client claude-code
52
52
 
53
53
  Supported clients: `claude-code`, `cursor`, `windsurf`, `vscode`, `cline`, `roo-cline`, `claude`, `zed`, `goose`, `warp`, `codex`
54
54
 
55
+ ## Terminal CLI
56
+
57
+ If you want to call the same tools directly from a shell, install the companion CLI package:
58
+
59
+ ```bash
60
+ npm install -g @hypothesi/tauri-mcp-cli
61
+ tauri-mcp driver-session start --port 9223
62
+ tauri-mcp driver-session status --json
63
+ ```
64
+
65
+ The CLI keeps the underlying MCP server warm in the background so stateful commands such as `driver_session` work across separate invocations.
66
+
55
67
  ## Multi-App Support
56
68
 
57
69
  The MCP server supports connecting to multiple Tauri apps simultaneously. Each app runs on a unique port, and the most recently connected app becomes the "default" app.
package/dist/api.d.ts ADDED
@@ -0,0 +1,2 @@
1
+ export { TOOLS } from './tools-registry.js';
2
+ export { createMcpServer, getCliToolDefinitions, startStdioServer } from './server.js';
package/dist/api.js ADDED
@@ -0,0 +1,2 @@
1
+ export { TOOLS } from './tools-registry.js';
2
+ export { createMcpServer, getCliToolDefinitions, startStdioServer } from './server.js';
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Configuration for the MCP Bridge connection.
3
+ *
4
+ * This module provides configuration options for connecting to Tauri apps,
5
+ * with support for environment variables and sensible defaults.
6
+ */
7
+ export interface BridgeConfig {
8
+ host: string;
9
+ port: number;
10
+ }
11
+ /**
12
+ * Gets the default host for MCP Bridge connections.
13
+ *
14
+ * Resolution priority:
15
+ * 1. MCP_BRIDGE_HOST environment variable
16
+ * 2. TAURI_DEV_HOST environment variable (set by Tauri CLI for mobile dev)
17
+ * 3. 'localhost' (default)
18
+ */
19
+ export declare function getDefaultHost(): string;
20
+ /**
21
+ * Gets the default port for MCP Bridge connections.
22
+ *
23
+ * Resolution priority:
24
+ * 1. MCP_BRIDGE_PORT environment variable
25
+ * 2. 9223 (default)
26
+ */
27
+ export declare function getDefaultPort(): number;
28
+ /**
29
+ * Gets the full bridge configuration from environment variables.
30
+ */
31
+ export declare function getConfig(): BridgeConfig;
32
+ /**
33
+ * Builds a WebSocket URL from host and port.
34
+ */
35
+ export declare function buildWebSocketURL(host: string, port: number): string;
@@ -0,0 +1,75 @@
1
+ /**
2
+ * App discovery and session management for multiple Tauri instances.
3
+ *
4
+ * This module handles discovering and connecting to multiple Tauri apps
5
+ * running with MCP Bridge on the same machine or remote devices using port scanning.
6
+ */
7
+ import { PluginClient } from './plugin-client.js';
8
+ export interface AppInstance {
9
+ host: string;
10
+ port: number;
11
+ available: boolean;
12
+ }
13
+ export interface SessionInfo {
14
+ appId: string;
15
+ name: string;
16
+ host: string;
17
+ port: number;
18
+ client?: PluginClient;
19
+ connected: boolean;
20
+ }
21
+ /**
22
+ * Manages discovery and connection to multiple Tauri app instances
23
+ */
24
+ export declare class AppDiscovery {
25
+ private _activeSessions;
26
+ private _host;
27
+ private _basePort;
28
+ private _maxPorts;
29
+ constructor(host?: string, basePort?: number);
30
+ /**
31
+ * Gets the configured host.
32
+ */
33
+ get host(): string;
34
+ /**
35
+ * Sets the host for discovery.
36
+ */
37
+ setHost(host: string): void;
38
+ /**
39
+ * Discovers available Tauri app instances by scanning ports
40
+ */
41
+ discoverApps(): Promise<AppInstance[]>;
42
+ /**
43
+ * Connects to a specific app on a host and port
44
+ */
45
+ connectToPort(port: number, appName?: string, host?: string): Promise<SessionInfo>;
46
+ /**
47
+ * Gets the first available app
48
+ */
49
+ getFirstAvailableApp(): Promise<AppInstance | null>;
50
+ /**
51
+ * Disconnects from a specific session
52
+ */
53
+ disconnectSession(sessionId: string): Promise<void>;
54
+ /**
55
+ * Disconnects from all apps
56
+ */
57
+ disconnectAll(): Promise<void>;
58
+ /**
59
+ * Gets the active session by ID
60
+ */
61
+ getSession(sessionId: string): SessionInfo | undefined;
62
+ /**
63
+ * Gets all active sessions
64
+ */
65
+ getAllSessions(): SessionInfo[];
66
+ /**
67
+ * Try to connect to the default port
68
+ */
69
+ connectToDefaultPort(): Promise<SessionInfo>;
70
+ /**
71
+ * Check if a port is in use (likely a Tauri app)
72
+ */
73
+ private _isPortInUse;
74
+ }
75
+ export declare const appDiscovery: AppDiscovery;
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Element picker module for MCP Server Tauri.
3
+ *
4
+ * Provides two tools:
5
+ * - selectElement: Agent-initiated picker overlay (user clicks element)
6
+ * - getPointedElement: Retrieve element user pointed at via Alt+Shift+Click
7
+ */
8
+ import { z } from 'zod';
9
+ import type { ToolContent } from '../tools-registry.js';
10
+ export declare const SelectElementSchema: z.ZodObject<{
11
+ windowId: z.ZodOptional<z.ZodString>;
12
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
13
+ } & {
14
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
15
+ }, "strip", z.ZodTypeAny, {
16
+ timeout: number;
17
+ windowId?: string | undefined;
18
+ appIdentifier?: string | number | undefined;
19
+ }, {
20
+ windowId?: string | undefined;
21
+ appIdentifier?: string | number | undefined;
22
+ timeout?: number | undefined;
23
+ }>;
24
+ export declare const GetPointedElementSchema: z.ZodObject<{
25
+ windowId: z.ZodOptional<z.ZodString>;
26
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
27
+ }, "strip", z.ZodTypeAny, {
28
+ windowId?: string | undefined;
29
+ appIdentifier?: string | number | undefined;
30
+ }, {
31
+ windowId?: string | undefined;
32
+ appIdentifier?: string | number | undefined;
33
+ }>;
34
+ export declare function selectElement(options: {
35
+ timeout?: number;
36
+ windowId?: string;
37
+ appIdentifier?: string | number;
38
+ }): Promise<ToolContent[]>;
39
+ export declare function getPointedElement(options: {
40
+ windowId?: string;
41
+ appIdentifier?: string | number;
42
+ }): Promise<ToolContent[]>;
@@ -0,0 +1,100 @@
1
+ import { EventEmitter } from 'events';
2
+ interface PluginCommand {
3
+ id?: string;
4
+ command: string;
5
+ args?: unknown;
6
+ }
7
+ export interface PluginResponse {
8
+ id?: string;
9
+ success: boolean;
10
+ data?: unknown;
11
+ error?: string;
12
+ windowContext?: {
13
+ windowLabel: string;
14
+ totalWindows: number;
15
+ warning?: string;
16
+ };
17
+ }
18
+ /**
19
+ * Client to communicate with the MCP Bridge plugin's WebSocket server
20
+ */
21
+ export declare class PluginClient extends EventEmitter {
22
+ private _ws;
23
+ private _url;
24
+ private _host;
25
+ private _port;
26
+ private _reconnectAttempts;
27
+ private _shouldReconnect;
28
+ private _reconnectDelay;
29
+ private _pendingRequests;
30
+ /**
31
+ * Constructor for PluginClient
32
+ * @param host Host address of the WebSocket server
33
+ * @param port Port number of the WebSocket server
34
+ */
35
+ constructor(host: string, port: number);
36
+ /**
37
+ * Creates a PluginClient with default configuration from environment.
38
+ */
39
+ static create_default(): PluginClient;
40
+ /**
41
+ * Gets the host this client is configured to connect to.
42
+ */
43
+ get host(): string;
44
+ /**
45
+ * Gets the port this client is configured to connect to.
46
+ */
47
+ get port(): number;
48
+ /**
49
+ * Connect to the plugin's WebSocket server
50
+ */
51
+ connect(): Promise<void>;
52
+ /**
53
+ * Disconnect from the plugin
54
+ */
55
+ disconnect(): void;
56
+ /**
57
+ * Send a command to the plugin and wait for response.
58
+ *
59
+ * Automatically retries on transient "not found" errors (e.g. window not
60
+ * yet registered after WebSocket connect) with exponential backoff.
61
+ */
62
+ sendCommand(command: PluginCommand, timeoutMs?: number): Promise<PluginResponse>;
63
+ /**
64
+ * Check if connected
65
+ */
66
+ isConnected(): boolean;
67
+ }
68
+ /**
69
+ * Gets the existing singleton PluginClient without creating or modifying it.
70
+ * Use this for status checks where you don't want to affect the current connection.
71
+ *
72
+ * @returns The existing PluginClient or null if none exists
73
+ */
74
+ export declare function getExistingPluginClient(): PluginClient | null;
75
+ /**
76
+ * Gets or creates a singleton PluginClient.
77
+ *
78
+ * If host/port are provided and differ from the existing client's configuration,
79
+ * the existing client is disconnected and a new one is created. This ensures
80
+ * that session start with a specific port always uses that port.
81
+ *
82
+ * @param host Optional host override
83
+ * @param port Optional port override
84
+ */
85
+ export declare function getPluginClient(host?: string, port?: number): PluginClient;
86
+ /**
87
+ * Resets the singleton client (useful for reconnecting with different config).
88
+ */
89
+ export declare function resetPluginClient(): void;
90
+ export declare function connectPlugin(host?: string, port?: number): Promise<void>;
91
+ /**
92
+ * Ensures a session is active and connects to the plugin using session config.
93
+ * This should be used by all tools that require a connected Tauri app.
94
+ *
95
+ * @param appIdentifier - Optional app identifier to target specific app
96
+ * @throws Error if no session is active
97
+ */
98
+ export declare function ensureSessionAndConnect(appIdentifier?: string | number): Promise<PluginClient>;
99
+ export declare function disconnectPlugin(): Promise<void>;
100
+ export {};
@@ -0,0 +1,163 @@
1
+ import { z } from 'zod';
2
+ export declare const ExecuteIPCCommandSchema: z.ZodObject<{
3
+ command: z.ZodString;
4
+ args: z.ZodOptional<z.ZodUnknown>;
5
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
6
+ }, "strip", z.ZodTypeAny, {
7
+ command: string;
8
+ appIdentifier?: string | number | undefined;
9
+ args?: unknown;
10
+ }, {
11
+ command: string;
12
+ appIdentifier?: string | number | undefined;
13
+ args?: unknown;
14
+ }>;
15
+ export declare function executeIPCCommand(options: {
16
+ command: string;
17
+ args?: unknown;
18
+ appIdentifier?: string | number;
19
+ }): Promise<string>;
20
+ export declare const ManageIPCMonitoringSchema: z.ZodObject<{
21
+ action: z.ZodEnum<["start", "stop"]>;
22
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
23
+ }, "strip", z.ZodTypeAny, {
24
+ action: "start" | "stop";
25
+ appIdentifier?: string | number | undefined;
26
+ }, {
27
+ action: "start" | "stop";
28
+ appIdentifier?: string | number | undefined;
29
+ }>;
30
+ export declare const StartIPCMonitoringSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
31
+ export declare const StopIPCMonitoringSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
32
+ export declare function manageIPCMonitoring(action: 'start' | 'stop', appIdentifier?: string | number): Promise<string>;
33
+ export declare function startIPCMonitoring(appIdentifier?: string | number): Promise<string>;
34
+ export declare function stopIPCMonitoring(appIdentifier?: string | number): Promise<string>;
35
+ export declare const GetIPCEventsSchema: z.ZodObject<{
36
+ filter: z.ZodOptional<z.ZodString>;
37
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
38
+ }, "strip", z.ZodTypeAny, {
39
+ filter?: string | undefined;
40
+ appIdentifier?: string | number | undefined;
41
+ }, {
42
+ filter?: string | undefined;
43
+ appIdentifier?: string | number | undefined;
44
+ }>;
45
+ export declare function getIPCEvents(filter?: string, appIdentifier?: string | number): Promise<string>;
46
+ export declare const EmitTestEventSchema: z.ZodObject<{
47
+ eventName: z.ZodString;
48
+ payload: z.ZodUnknown;
49
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
50
+ }, "strip", z.ZodTypeAny, {
51
+ eventName: string;
52
+ appIdentifier?: string | number | undefined;
53
+ payload?: unknown;
54
+ }, {
55
+ eventName: string;
56
+ appIdentifier?: string | number | undefined;
57
+ payload?: unknown;
58
+ }>;
59
+ export declare function emitTestEvent(eventName: string, payload: unknown, appIdentifier?: string | number): Promise<string>;
60
+ export declare const GetWindowInfoSchema: z.ZodObject<{
61
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
62
+ }, "strip", z.ZodTypeAny, {
63
+ appIdentifier?: string | number | undefined;
64
+ }, {
65
+ appIdentifier?: string | number | undefined;
66
+ }>;
67
+ export declare function getWindowInfo(appIdentifier?: string | number): Promise<string>;
68
+ export declare const GetBackendStateSchema: z.ZodObject<{
69
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
70
+ }, "strip", z.ZodTypeAny, {
71
+ appIdentifier?: string | number | undefined;
72
+ }, {
73
+ appIdentifier?: string | number | undefined;
74
+ }>;
75
+ /**
76
+ * Get backend state from the connected Tauri app.
77
+ *
78
+ * This function can work in two modes:
79
+ * 1. Normal mode: Requires an active session (for MCP tool calls)
80
+ * 2. Setup mode: Uses existing connected client (for session setup)
81
+ *
82
+ * @param useExistingClient If true, uses the existing connected client without
83
+ * session validation. Used during session setup before currentSession is set.
84
+ */
85
+ export declare function getBackendState(options?: {
86
+ useExistingClient?: boolean;
87
+ appIdentifier?: string | number;
88
+ }): Promise<string>;
89
+ export declare const ListWindowsSchema: z.ZodObject<{}, "strip", z.ZodTypeAny, {}, {}>;
90
+ /**
91
+ * Lists all open webview windows in the Tauri application.
92
+ */
93
+ export declare function listWindows(appIdentifier?: string | number): Promise<string>;
94
+ export declare const ResizeWindowSchema: z.ZodObject<{
95
+ width: z.ZodNumber;
96
+ height: z.ZodNumber;
97
+ windowId: z.ZodOptional<z.ZodString>;
98
+ logical: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
99
+ }, "strip", z.ZodTypeAny, {
100
+ width: number;
101
+ height: number;
102
+ logical: boolean;
103
+ windowId?: string | undefined;
104
+ }, {
105
+ width: number;
106
+ height: number;
107
+ windowId?: string | undefined;
108
+ logical?: boolean | undefined;
109
+ }>;
110
+ /**
111
+ * Resizes a window to the specified dimensions.
112
+ *
113
+ * @param options - Resize options including width, height, and optional windowId
114
+ * @returns JSON string with the result of the resize operation
115
+ */
116
+ export declare function resizeWindow(options: {
117
+ width: number;
118
+ height: number;
119
+ windowId?: string;
120
+ logical?: boolean;
121
+ appIdentifier?: string | number;
122
+ }): Promise<string>;
123
+ export declare const ManageWindowSchema: z.ZodObject<{
124
+ action: z.ZodEnum<["list", "info", "resize"]>;
125
+ windowId: z.ZodOptional<z.ZodString>;
126
+ width: z.ZodOptional<z.ZodNumber>;
127
+ height: z.ZodOptional<z.ZodNumber>;
128
+ logical: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
129
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
130
+ }, "strip", z.ZodTypeAny, {
131
+ action: "list" | "info" | "resize";
132
+ logical: boolean;
133
+ windowId?: string | undefined;
134
+ appIdentifier?: string | number | undefined;
135
+ width?: number | undefined;
136
+ height?: number | undefined;
137
+ }, {
138
+ action: "list" | "info" | "resize";
139
+ windowId?: string | undefined;
140
+ appIdentifier?: string | number | undefined;
141
+ width?: number | undefined;
142
+ height?: number | undefined;
143
+ logical?: boolean | undefined;
144
+ }>;
145
+ /**
146
+ * Unified window management function.
147
+ *
148
+ * Actions:
149
+ * - `list`: List all open webview windows with their labels, titles, URLs, and state
150
+ * - `info`: Get detailed info for a window (size, position, title, focus, visibility)
151
+ * - `resize`: Resize a window to specified dimensions
152
+ *
153
+ * @param options - Action and parameters
154
+ * @returns JSON string with the result
155
+ */
156
+ export declare function manageWindow(options: {
157
+ action: 'list' | 'info' | 'resize';
158
+ windowId?: string;
159
+ width?: number;
160
+ height?: number;
161
+ logical?: boolean;
162
+ appIdentifier?: string | number;
163
+ }): Promise<string>;
@@ -0,0 +1,128 @@
1
+ /**
2
+ * WebSocket protocol types for communication between MCP server and Tauri plugin
3
+ *
4
+ * This file defines the message format for the WebSocket-based communication
5
+ * between the Node.js MCP server and the Rust Tauri plugin.
6
+ */
7
+ /** Commands that can be sent to the Tauri plugin */
8
+ export type PluginCommandType = 'execute_command' | 'get_window_info' | 'get_backend_state' | 'emit_event' | 'start_ipc_monitor' | 'stop_ipc_monitor' | 'get_ipc_events' | 'execute_js' | 'capture_native_screenshot';
9
+ /** Request message sent from MCP server to Tauri plugin */
10
+ export interface PluginRequest {
11
+ id: string;
12
+ command: PluginCommandType;
13
+ args?: unknown;
14
+ }
15
+ /** Response message sent from Tauri plugin to MCP server */
16
+ export interface PluginResponse {
17
+ id: string;
18
+ success: boolean;
19
+ data?: unknown;
20
+ error?: string;
21
+ }
22
+ /** Event broadcast from Tauri plugin (not in response to a request) */
23
+ export interface PluginEvent {
24
+ type: 'ipc_event' | 'console_log' | 'error' | 'element_picked' | 'element_pointed';
25
+ payload: unknown;
26
+ timestamp?: string;
27
+ }
28
+ /** Structured info about a parent element in the DOM ancestry */
29
+ export interface ParentElementInfo {
30
+ tag: string;
31
+ id: string | null;
32
+ classes: string[];
33
+ boundingRect: {
34
+ x: number;
35
+ y: number;
36
+ width: number;
37
+ height: number;
38
+ };
39
+ }
40
+ /** Metadata collected about a picked/pointed DOM element */
41
+ export interface ElementMetadata {
42
+ tag: string;
43
+ id: string | null;
44
+ classes: string[];
45
+ attributes: Record<string, string>;
46
+ textContent: string;
47
+ boundingRect: {
48
+ x: number;
49
+ y: number;
50
+ width: number;
51
+ height: number;
52
+ top: number;
53
+ right: number;
54
+ bottom: number;
55
+ left: number;
56
+ };
57
+ cssSelector: string;
58
+ xpath: string;
59
+ computedStyles: Record<string, string>;
60
+ parentChain: ParentElementInfo[];
61
+ timestamp: number;
62
+ }
63
+ /** Broadcast message for element picker events */
64
+ export interface ElementPickerBroadcast {
65
+ type: 'element_picked' | 'element_pointed';
66
+ payload: {
67
+ pickerId?: string;
68
+ element?: ElementMetadata;
69
+ cancelled?: boolean;
70
+ };
71
+ }
72
+ /** IPC event captured by the monitor */
73
+ export interface IPCEvent {
74
+ command: string;
75
+ args?: unknown;
76
+ response?: unknown;
77
+ duration?: number;
78
+ timestamp: string;
79
+ }
80
+ /** Window information returned by get_window_info */
81
+ export interface WindowInfo {
82
+ width: number;
83
+ height: number;
84
+ x: number;
85
+ y: number;
86
+ title: string;
87
+ focused: boolean;
88
+ visible: boolean;
89
+ }
90
+ /** Backend state returned by get_backend_state */
91
+ export interface BackendState {
92
+ app: {
93
+ name: string;
94
+ identifier: string;
95
+ version: string;
96
+ };
97
+ tauri: {
98
+ version: string;
99
+ };
100
+ environment: {
101
+ debug: boolean;
102
+ os: string;
103
+ arch: string;
104
+ family: string;
105
+ };
106
+ windows: Array<{
107
+ label: string;
108
+ title: string;
109
+ focused: boolean;
110
+ visible: boolean;
111
+ }>;
112
+ window_count: number;
113
+ timestamp: number;
114
+ }
115
+ /** Console log entry */
116
+ export interface ConsoleLogEntry {
117
+ level: 'log' | 'info' | 'warn' | 'error' | 'debug';
118
+ message: string;
119
+ timestamp: string;
120
+ source?: string;
121
+ }
122
+ /** Screenshot result */
123
+ export interface ScreenshotResult {
124
+ data: string;
125
+ format: 'png' | 'jpeg';
126
+ width?: number;
127
+ height?: number;
128
+ }
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Script Manager - Manages persistent script injection across page navigations.
3
+ *
4
+ * This module provides functions to register, remove, and manage scripts that
5
+ * should be automatically re-injected when pages load or navigate.
6
+ *
7
+ * @internal This module is for internal use only and is not exposed as MCP tools.
8
+ */
9
+ /**
10
+ * Type of script to inject.
11
+ */
12
+ export type ScriptType = 'inline' | 'url';
13
+ /**
14
+ * A script entry in the registry.
15
+ */
16
+ export interface ScriptEntry {
17
+ /** Unique identifier for this script. */
18
+ id: string;
19
+ /** Type of script (inline code or external URL). */
20
+ type: ScriptType;
21
+ /** The script content (JavaScript code) or URL. */
22
+ content: string;
23
+ }
24
+ /**
25
+ * Response from script registration.
26
+ */
27
+ interface RegisterScriptResponse {
28
+ registered: boolean;
29
+ scriptId: string;
30
+ }
31
+ /**
32
+ * Response from script removal.
33
+ */
34
+ interface RemoveScriptResponse {
35
+ removed: boolean;
36
+ scriptId: string;
37
+ }
38
+ /**
39
+ * Response from clearing scripts.
40
+ */
41
+ interface ClearScriptsResponse {
42
+ cleared: number;
43
+ }
44
+ /**
45
+ * Response from getting scripts.
46
+ */
47
+ interface GetScriptsResponse {
48
+ scripts: ScriptEntry[];
49
+ }
50
+ /**
51
+ * Registers a script to be injected into the webview.
52
+ *
53
+ * The script will be immediately injected if the page is loaded, and will be
54
+ * automatically re-injected on subsequent page loads/navigations.
55
+ *
56
+ * @param id - Unique identifier for the script
57
+ * @param type - Type of script ('inline' for code, 'url' for external script)
58
+ * @param content - The script content (JavaScript code) or URL
59
+ * @param windowLabel - Optional window label to target
60
+ * @returns Promise resolving to registration result
61
+ */
62
+ export declare function registerScript(id: string, type: ScriptType, content: string, windowLabel?: string): Promise<RegisterScriptResponse>;
63
+ /**
64
+ * Removes a script from the registry and DOM.
65
+ *
66
+ * @param id - The script ID to remove
67
+ * @param windowLabel - Optional window label to target
68
+ * @returns Promise resolving to removal result
69
+ */
70
+ export declare function removeScript(id: string, windowLabel?: string): Promise<RemoveScriptResponse>;
71
+ /**
72
+ * Clears all registered scripts from the registry and DOM.
73
+ *
74
+ * @param windowLabel - Optional window label to target
75
+ * @returns Promise resolving to the number of scripts cleared
76
+ */
77
+ export declare function clearScripts(windowLabel?: string): Promise<ClearScriptsResponse>;
78
+ /**
79
+ * Gets all registered scripts.
80
+ *
81
+ * @returns Promise resolving to the list of registered scripts
82
+ */
83
+ export declare function getScripts(): Promise<GetScriptsResponse>;
84
+ /**
85
+ * Checks if a script with the given ID is registered.
86
+ *
87
+ * @param id - The script ID to check
88
+ * @returns Promise resolving to true if the script is registered
89
+ */
90
+ export declare function isScriptRegistered(id: string): Promise<boolean>;
91
+ export {};
@@ -0,0 +1,17 @@
1
+ /**
2
+ * aria-api library loader
3
+ *
4
+ * Bundles aria-api for browser injection. Provides comprehensive W3C-compliant
5
+ * accessibility computation including:
6
+ * - WAI-ARIA 1.3 role computation
7
+ * - HTML-AAM 1.0 implicit role mappings
8
+ * - Accessible Name and Description Computation 1.2
9
+ * - aria-owns relationship handling
10
+ */
11
+ /** Script ID used for the aria-api library in the script registry. */
12
+ export declare const ARIA_API_SCRIPT_ID = "__mcp_aria_api__";
13
+ /**
14
+ * Get the aria-api library source code.
15
+ * Loaded lazily and cached.
16
+ */
17
+ export declare function getAriaApiSource(): string;