@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.
@@ -0,0 +1,25 @@
1
+ /**
2
+ * html2canvas-pro library loader
3
+ *
4
+ * Loads the html2canvas-pro library from node_modules and provides it as a string
5
+ * that can be injected into the webview. html2canvas-pro is a fork of html2canvas
6
+ * that adds support for modern CSS color functions like oklch(), oklab(), lab(),
7
+ * lch(), and color().
8
+ */
9
+ /** Script ID used for the html2canvas library in the script registry. */
10
+ export declare const HTML2CANVAS_SCRIPT_ID = "__mcp_html2canvas__";
11
+ /**
12
+ * Get the html2canvas-pro library source code.
13
+ * Loaded lazily and cached.
14
+ */
15
+ export declare function getHtml2CanvasSource(): string;
16
+ /**
17
+ * Build a script that captures a screenshot using html2canvas.
18
+ * Assumes html2canvas is already loaded (either via script manager or inline).
19
+ */
20
+ export declare function buildScreenshotCaptureScript(format: 'png' | 'jpeg', quality: number): string;
21
+ /**
22
+ * Build a script that injects html2canvas and captures a screenshot.
23
+ * This is the legacy function that inlines the library - kept for fallback.
24
+ */
25
+ export declare function buildScreenshotScript(format: 'png' | 'jpeg', quality: number): string;
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Script loader for webview injection scripts
3
+ *
4
+ * These scripts are loaded at build time and injected into the webview at runtime.
5
+ * Each script is an IIFE that accepts a params object.
6
+ */
7
+ export declare const SCRIPTS: {
8
+ readonly resolveRef: string;
9
+ readonly interact: string;
10
+ readonly swipe: string;
11
+ readonly keyboard: string;
12
+ readonly waitFor: string;
13
+ readonly getStyles: string;
14
+ readonly focus: string;
15
+ readonly findElement: string;
16
+ readonly domSnapshot: string;
17
+ readonly elementPicker: string;
18
+ };
19
+ /** Script ID used for resolve-ref in the script registry. */
20
+ export declare const RESOLVE_REF_SCRIPT_ID = "__mcp_resolve_ref__";
21
+ /**
22
+ * Get the resolve-ref script source code.
23
+ */
24
+ export declare function getResolveRefSource(): string;
25
+ /**
26
+ * Build a script invocation with parameters
27
+ * The script should be an IIFE that accepts a params object
28
+ */
29
+ export declare function buildScript(script: string, params: Record<string, unknown>): string;
30
+ /**
31
+ * Build a script for typing text (uses the keyboard script's typeText function)
32
+ */
33
+ export declare function buildTypeScript(selector: string, text: string, strategy?: string): string;
34
+ /**
35
+ * Build a script for key events (press, down, up)
36
+ */
37
+ export declare function buildKeyEventScript(action: string, key: string, modifiers?: string[]): string;
@@ -0,0 +1,76 @@
1
+ import { z } from 'zod';
2
+ import { PluginClient } from './plugin-client.js';
3
+ /**
4
+ * Session Manager - Native IPC-based session management
5
+ *
6
+ * This module provides lightweight native session management using Tauri IPC.
7
+ * The "session" concept is maintained for API compatibility.
8
+ *
9
+ * Connection Strategy:
10
+ * 1. Try localhost first (most reliable for simulators/emulators/desktop)
11
+ * 2. If localhost fails and a remote host is configured, try that host
12
+ * 3. Return error if all connection attempts fail
13
+ */
14
+ export declare const ManageDriverSessionSchema: z.ZodObject<{
15
+ action: z.ZodEnum<["start", "stop", "status"]>;
16
+ host: z.ZodOptional<z.ZodString>;
17
+ port: z.ZodOptional<z.ZodNumber>;
18
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
19
+ }, "strip", z.ZodTypeAny, {
20
+ action: "status" | "start" | "stop";
21
+ host?: string | undefined;
22
+ port?: number | undefined;
23
+ appIdentifier?: string | number | undefined;
24
+ }, {
25
+ action: "status" | "start" | "stop";
26
+ host?: string | undefined;
27
+ port?: number | undefined;
28
+ appIdentifier?: string | number | undefined;
29
+ }>;
30
+ export interface SessionInfo {
31
+ name: string;
32
+ identifier: string | null;
33
+ host: string;
34
+ port: number;
35
+ client: PluginClient;
36
+ connected: boolean;
37
+ }
38
+ /**
39
+ * Check if any session is currently active.
40
+ * @returns true if at least one session exists
41
+ */
42
+ export declare function hasActiveSession(): boolean;
43
+ /**
44
+ * Get a specific session by port.
45
+ */
46
+ export declare function getSession(port: number): SessionInfo | null;
47
+ /**
48
+ * Get the default session (most recently connected).
49
+ */
50
+ export declare function getDefaultSession(): SessionInfo | null;
51
+ /**
52
+ * Get all active sessions.
53
+ */
54
+ export declare function getAllSessions(): SessionInfo[];
55
+ /**
56
+ * Resolve target app from port or identifier.
57
+ * Returns the appropriate session based on the routing logic.
58
+ */
59
+ export declare function resolveTargetApp(portOrIdentifier?: string | number): SessionInfo;
60
+ /**
61
+ * Manage session lifecycle (start, stop, or status).
62
+ *
63
+ * Connection strategy for 'start':
64
+ * 1. Try localhost:{port} first (most reliable for simulators/emulators/desktop)
65
+ * 2. If localhost fails AND a different host is configured, try {host}:{port}
66
+ * 3. If both fail, try auto-discovery on localhost
67
+ * 4. Return error if all attempts fail
68
+ *
69
+ * @param action - 'start', 'stop', or 'status'
70
+ * @param host - Optional host address (defaults to env var or localhost)
71
+ * @param port - Optional port number (defaults to 9223)
72
+ * @param appIdentifier - Optional app identifier for 'stop' action (port or bundle ID)
73
+ * @returns For 'start'/'stop': A message string describing the result.
74
+ * For 'status': A JSON string with connection details
75
+ */
76
+ export declare function manageDriverSession(action: 'start' | 'stop' | 'status', host?: string, port?: number, appIdentifier?: string | number): Promise<string>;
@@ -0,0 +1,122 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * Ensures the MCP server is fully initialized and ready to use.
4
+ * This is called automatically by all tool functions.
5
+ *
6
+ * Initialization includes:
7
+ * - Verifying an active session exists (via driver_session)
8
+ * - Connecting to the plugin WebSocket using session config
9
+ * - Console capture is already initialized by bridge.js in the Tauri app
10
+ *
11
+ * This function is idempotent - calling it multiple times is safe.
12
+ *
13
+ * @throws Error if no session is active (driver_session must be called first)
14
+ */
15
+ export declare function ensureReady(): Promise<void>;
16
+ /**
17
+ * Reset initialization state (useful for testing or reconnecting).
18
+ */
19
+ export declare function resetInitialization(): void;
20
+ export interface ExecuteInWebviewResult {
21
+ result: string;
22
+ windowLabel: string;
23
+ warning?: string;
24
+ }
25
+ /**
26
+ * Execute JavaScript in the Tauri webview using native IPC via WebSocket.
27
+ *
28
+ * @param script - JavaScript code to execute in the webview context
29
+ * @param windowId - Optional window label to target (defaults to "main")
30
+ * @param appIdentifier - Optional app identifier to target specific app
31
+ * @returns Result of the script execution with window context
32
+ */
33
+ export declare function executeInWebview(script: string, windowId?: string, appIdentifier?: string | number): Promise<string>;
34
+ /**
35
+ * Execute JavaScript in the Tauri webview and return window context.
36
+ *
37
+ * @param script - JavaScript code to execute in the webview context
38
+ * @param windowId - Optional window label to target (defaults to "main")
39
+ * @param appIdentifier - Optional app identifier to target specific app
40
+ * @returns Result of the script execution with window context
41
+ */
42
+ export declare function executeInWebviewWithContext(script: string, windowId?: string, appIdentifier?: string | number): Promise<ExecuteInWebviewResult>;
43
+ /**
44
+ * Execute async JavaScript in the webview with timeout support.
45
+ *
46
+ * @param script - JavaScript code to execute (can use await)
47
+ * @param windowId - Optional window label to target (defaults to "main")
48
+ * @param timeout - Timeout in milliseconds (default: 5000)
49
+ * @returns Result of the script execution
50
+ */
51
+ export declare function executeAsyncInWebview(script: string, windowId?: string, timeout?: number): Promise<string>;
52
+ /**
53
+ * Initialize console log capture in the webview.
54
+ * This intercepts console methods and stores logs in memory.
55
+ *
56
+ * NOTE: Console capture is now automatically initialized by bridge.js when the
57
+ * Tauri app starts. This function is kept for backwards compatibility and will
58
+ * simply return early if capture is already initialized.
59
+ */
60
+ export declare function initializeConsoleCapture(): Promise<string>;
61
+ /**
62
+ * Retrieve captured console logs with optional filtering.
63
+ *
64
+ * @param filter - Optional regex pattern to filter log messages
65
+ * @param since - Optional ISO timestamp to filter logs after this time
66
+ * @param windowId - Optional window label to target (defaults to "main")
67
+ * @param appIdentifier - Optional app identifier to target specific app
68
+ * @returns Formatted console logs as string
69
+ */
70
+ export declare function getConsoleLogs(filter?: string, since?: string, windowId?: string, appIdentifier?: string | number): Promise<string>;
71
+ /**
72
+ * Clear all captured console logs.
73
+ */
74
+ export declare function clearConsoleLogs(): Promise<string>;
75
+ import type { ToolContent } from '../tools-registry.js';
76
+ /**
77
+ * Result of a screenshot capture, containing both image data and optional context.
78
+ */
79
+ export interface ScreenshotResult {
80
+ content: ToolContent[];
81
+ }
82
+ export interface CaptureScreenshotOptions {
83
+ format?: 'png' | 'jpeg';
84
+ quality?: number;
85
+ windowId?: string;
86
+ appIdentifier?: string | number;
87
+ maxWidth?: number;
88
+ }
89
+ /**
90
+ * Capture a screenshot of the entire webview.
91
+ *
92
+ * @param options - Screenshot options (format, quality, windowId, appIdentifier, etc.)
93
+ * @returns Screenshot result with image content
94
+ */
95
+ export declare function captureScreenshot(options?: CaptureScreenshotOptions): Promise<ScreenshotResult>;
96
+ export declare const ExecuteScriptSchema: z.ZodObject<{
97
+ script: z.ZodString;
98
+ }, "strip", z.ZodTypeAny, {
99
+ script: string;
100
+ }, {
101
+ script: string;
102
+ }>;
103
+ export declare const GetConsoleLogsSchema: z.ZodObject<{
104
+ filter: z.ZodOptional<z.ZodString>;
105
+ since: z.ZodOptional<z.ZodString>;
106
+ }, "strip", z.ZodTypeAny, {
107
+ filter?: string | undefined;
108
+ since?: string | undefined;
109
+ }, {
110
+ filter?: string | undefined;
111
+ since?: string | undefined;
112
+ }>;
113
+ export declare const CaptureScreenshotSchema: z.ZodObject<{
114
+ format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>>;
115
+ quality: z.ZodOptional<z.ZodNumber>;
116
+ }, "strip", z.ZodTypeAny, {
117
+ format: "png" | "jpeg";
118
+ quality?: number | undefined;
119
+ }, {
120
+ format?: "png" | "jpeg" | undefined;
121
+ quality?: number | undefined;
122
+ }>;
@@ -0,0 +1,349 @@
1
+ import { z } from 'zod';
2
+ import { ScreenshotResult } from './webview-executor.js';
3
+ /**
4
+ * Base schema mixin for tools that can target a specific window and app.
5
+ * All webview tools extend this to support multi-window and multi-app scenarios.
6
+ */
7
+ export declare const WindowTargetSchema: z.ZodObject<{
8
+ windowId: z.ZodOptional<z.ZodString>;
9
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
10
+ }, "strip", z.ZodTypeAny, {
11
+ windowId?: string | undefined;
12
+ appIdentifier?: string | number | undefined;
13
+ }, {
14
+ windowId?: string | undefined;
15
+ appIdentifier?: string | number | undefined;
16
+ }>;
17
+ export declare const InteractSchema: z.ZodObject<{
18
+ windowId: z.ZodOptional<z.ZodString>;
19
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
20
+ } & {
21
+ action: z.ZodEnum<["click", "double-click", "long-press", "scroll", "swipe", "focus"]>;
22
+ selector: z.ZodOptional<z.ZodString>;
23
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
24
+ x: z.ZodOptional<z.ZodNumber>;
25
+ y: z.ZodOptional<z.ZodNumber>;
26
+ duration: z.ZodOptional<z.ZodNumber>;
27
+ scrollX: z.ZodOptional<z.ZodNumber>;
28
+ scrollY: z.ZodOptional<z.ZodNumber>;
29
+ fromX: z.ZodOptional<z.ZodNumber>;
30
+ fromY: z.ZodOptional<z.ZodNumber>;
31
+ toX: z.ZodOptional<z.ZodNumber>;
32
+ toY: z.ZodOptional<z.ZodNumber>;
33
+ }, "strip", z.ZodTypeAny, {
34
+ action: "swipe" | "focus" | "click" | "double-click" | "long-press" | "scroll";
35
+ strategy: "css" | "text" | "xpath";
36
+ windowId?: string | undefined;
37
+ appIdentifier?: string | number | undefined;
38
+ selector?: string | undefined;
39
+ x?: number | undefined;
40
+ y?: number | undefined;
41
+ duration?: number | undefined;
42
+ scrollX?: number | undefined;
43
+ scrollY?: number | undefined;
44
+ fromX?: number | undefined;
45
+ fromY?: number | undefined;
46
+ toX?: number | undefined;
47
+ toY?: number | undefined;
48
+ }, {
49
+ action: "swipe" | "focus" | "click" | "double-click" | "long-press" | "scroll";
50
+ windowId?: string | undefined;
51
+ appIdentifier?: string | number | undefined;
52
+ selector?: string | undefined;
53
+ strategy?: "css" | "text" | "xpath" | undefined;
54
+ x?: number | undefined;
55
+ y?: number | undefined;
56
+ duration?: number | undefined;
57
+ scrollX?: number | undefined;
58
+ scrollY?: number | undefined;
59
+ fromX?: number | undefined;
60
+ fromY?: number | undefined;
61
+ toX?: number | undefined;
62
+ toY?: number | undefined;
63
+ }>;
64
+ export declare const ScreenshotSchema: z.ZodObject<{
65
+ windowId: z.ZodOptional<z.ZodString>;
66
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
67
+ } & {
68
+ format: z.ZodDefault<z.ZodOptional<z.ZodEnum<["png", "jpeg"]>>>;
69
+ quality: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
70
+ filePath: z.ZodOptional<z.ZodString>;
71
+ maxWidth: z.ZodOptional<z.ZodNumber>;
72
+ }, "strip", z.ZodTypeAny, {
73
+ format: "png" | "jpeg";
74
+ quality: number;
75
+ windowId?: string | undefined;
76
+ appIdentifier?: string | number | undefined;
77
+ maxWidth?: number | undefined;
78
+ filePath?: string | undefined;
79
+ }, {
80
+ format?: "png" | "jpeg" | undefined;
81
+ quality?: number | undefined;
82
+ windowId?: string | undefined;
83
+ appIdentifier?: string | number | undefined;
84
+ maxWidth?: number | undefined;
85
+ filePath?: string | undefined;
86
+ }>;
87
+ export declare const KeyboardSchema: z.ZodObject<{
88
+ windowId: z.ZodOptional<z.ZodString>;
89
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
90
+ } & {
91
+ action: z.ZodEnum<["type", "press", "down", "up"]>;
92
+ selector: z.ZodOptional<z.ZodString>;
93
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
94
+ text: z.ZodOptional<z.ZodString>;
95
+ key: z.ZodOptional<z.ZodString>;
96
+ modifiers: z.ZodOptional<z.ZodArray<z.ZodEnum<["Control", "Alt", "Shift", "Meta"]>, "many">>;
97
+ }, "strip", z.ZodTypeAny, {
98
+ action: "type" | "press" | "down" | "up";
99
+ strategy: "css" | "text" | "xpath";
100
+ text?: string | undefined;
101
+ windowId?: string | undefined;
102
+ appIdentifier?: string | number | undefined;
103
+ selector?: string | undefined;
104
+ key?: string | undefined;
105
+ modifiers?: ("Control" | "Alt" | "Shift" | "Meta")[] | undefined;
106
+ }, {
107
+ action: "type" | "press" | "down" | "up";
108
+ text?: string | undefined;
109
+ windowId?: string | undefined;
110
+ appIdentifier?: string | number | undefined;
111
+ selector?: string | undefined;
112
+ strategy?: "css" | "text" | "xpath" | undefined;
113
+ key?: string | undefined;
114
+ modifiers?: ("Control" | "Alt" | "Shift" | "Meta")[] | undefined;
115
+ }>;
116
+ export declare const WaitForSchema: z.ZodObject<{
117
+ windowId: z.ZodOptional<z.ZodString>;
118
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
119
+ } & {
120
+ type: z.ZodEnum<["selector", "text", "ipc-event"]>;
121
+ value: z.ZodString;
122
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
123
+ timeout: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
124
+ }, "strip", z.ZodTypeAny, {
125
+ value: string;
126
+ type: "text" | "selector" | "ipc-event";
127
+ strategy: "css" | "text" | "xpath";
128
+ timeout: number;
129
+ windowId?: string | undefined;
130
+ appIdentifier?: string | number | undefined;
131
+ }, {
132
+ value: string;
133
+ type: "text" | "selector" | "ipc-event";
134
+ windowId?: string | undefined;
135
+ appIdentifier?: string | number | undefined;
136
+ strategy?: "css" | "text" | "xpath" | undefined;
137
+ timeout?: number | undefined;
138
+ }>;
139
+ export declare const GetStylesSchema: z.ZodObject<{
140
+ windowId: z.ZodOptional<z.ZodString>;
141
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
142
+ } & {
143
+ selector: z.ZodString;
144
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
145
+ properties: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
146
+ multiple: z.ZodDefault<z.ZodOptional<z.ZodBoolean>>;
147
+ }, "strip", z.ZodTypeAny, {
148
+ selector: string;
149
+ strategy: "css" | "text" | "xpath";
150
+ multiple: boolean;
151
+ windowId?: string | undefined;
152
+ appIdentifier?: string | number | undefined;
153
+ properties?: string[] | undefined;
154
+ }, {
155
+ selector: string;
156
+ windowId?: string | undefined;
157
+ appIdentifier?: string | number | undefined;
158
+ strategy?: "css" | "text" | "xpath" | undefined;
159
+ properties?: string[] | undefined;
160
+ multiple?: boolean | undefined;
161
+ }>;
162
+ export declare const ExecuteJavaScriptSchema: z.ZodObject<{
163
+ windowId: z.ZodOptional<z.ZodString>;
164
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
165
+ } & {
166
+ script: z.ZodString;
167
+ args: z.ZodOptional<z.ZodArray<z.ZodUnknown, "many">>;
168
+ }, "strip", z.ZodTypeAny, {
169
+ script: string;
170
+ windowId?: string | undefined;
171
+ appIdentifier?: string | number | undefined;
172
+ args?: unknown[] | undefined;
173
+ }, {
174
+ script: string;
175
+ windowId?: string | undefined;
176
+ appIdentifier?: string | number | undefined;
177
+ args?: unknown[] | undefined;
178
+ }>;
179
+ export declare const FocusElementSchema: z.ZodObject<{
180
+ windowId: z.ZodOptional<z.ZodString>;
181
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
182
+ } & {
183
+ selector: z.ZodString;
184
+ }, "strip", z.ZodTypeAny, {
185
+ selector: string;
186
+ windowId?: string | undefined;
187
+ appIdentifier?: string | number | undefined;
188
+ }, {
189
+ selector: string;
190
+ windowId?: string | undefined;
191
+ appIdentifier?: string | number | undefined;
192
+ }>;
193
+ export declare const FindElementSchema: z.ZodObject<{
194
+ windowId: z.ZodOptional<z.ZodString>;
195
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
196
+ } & {
197
+ selector: z.ZodString;
198
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
199
+ }, "strip", z.ZodTypeAny, {
200
+ selector: string;
201
+ strategy: "css" | "text" | "xpath";
202
+ windowId?: string | undefined;
203
+ appIdentifier?: string | number | undefined;
204
+ }, {
205
+ selector: string;
206
+ windowId?: string | undefined;
207
+ appIdentifier?: string | number | undefined;
208
+ strategy?: "css" | "text" | "xpath" | undefined;
209
+ }>;
210
+ export declare const GetConsoleLogsSchema: z.ZodObject<{
211
+ windowId: z.ZodOptional<z.ZodString>;
212
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
213
+ } & {
214
+ filter: z.ZodOptional<z.ZodString>;
215
+ since: z.ZodOptional<z.ZodString>;
216
+ }, "strip", z.ZodTypeAny, {
217
+ filter?: string | undefined;
218
+ windowId?: string | undefined;
219
+ appIdentifier?: string | number | undefined;
220
+ since?: string | undefined;
221
+ }, {
222
+ filter?: string | undefined;
223
+ windowId?: string | undefined;
224
+ appIdentifier?: string | number | undefined;
225
+ since?: string | undefined;
226
+ }>;
227
+ export declare const DomSnapshotSchema: z.ZodObject<{
228
+ windowId: z.ZodOptional<z.ZodString>;
229
+ appIdentifier: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
230
+ } & {
231
+ type: z.ZodEnum<["accessibility", "structure"]>;
232
+ selector: z.ZodOptional<z.ZodString>;
233
+ strategy: z.ZodDefault<z.ZodEnum<["css", "xpath", "text"]>>;
234
+ }, "strip", z.ZodTypeAny, {
235
+ type: "accessibility" | "structure";
236
+ strategy: "css" | "text" | "xpath";
237
+ windowId?: string | undefined;
238
+ appIdentifier?: string | number | undefined;
239
+ selector?: string | undefined;
240
+ }, {
241
+ type: "accessibility" | "structure";
242
+ windowId?: string | undefined;
243
+ appIdentifier?: string | number | undefined;
244
+ selector?: string | undefined;
245
+ strategy?: "css" | "text" | "xpath" | undefined;
246
+ }>;
247
+ export declare function interact(options: {
248
+ action: string;
249
+ selector?: string;
250
+ strategy?: string;
251
+ x?: number;
252
+ y?: number;
253
+ duration?: number;
254
+ scrollX?: number;
255
+ scrollY?: number;
256
+ fromX?: number;
257
+ fromY?: number;
258
+ toX?: number;
259
+ toY?: number;
260
+ windowId?: string;
261
+ appIdentifier?: string | number;
262
+ }): Promise<string>;
263
+ export interface ScreenshotOptions {
264
+ quality?: number;
265
+ format?: 'png' | 'jpeg';
266
+ windowId?: string;
267
+ filePath?: string;
268
+ appIdentifier?: string | number;
269
+ maxWidth?: number;
270
+ }
271
+ export interface ScreenshotFileResult {
272
+ filePath: string;
273
+ format: 'png' | 'jpeg';
274
+ }
275
+ export declare function screenshot(options?: ScreenshotOptions): Promise<ScreenshotResult | ScreenshotFileResult>;
276
+ export interface KeyboardOptions {
277
+ action: string;
278
+ selectorOrKey?: string;
279
+ strategy?: string;
280
+ textOrModifiers?: string | string[];
281
+ modifiers?: string[];
282
+ windowId?: string;
283
+ appIdentifier?: string | number;
284
+ }
285
+ export declare function keyboard(options: KeyboardOptions): Promise<string>;
286
+ export interface WaitForOptions {
287
+ type: string;
288
+ value: string;
289
+ strategy?: string;
290
+ timeout?: number;
291
+ windowId?: string;
292
+ appIdentifier?: string | number;
293
+ }
294
+ export declare function waitFor(options: WaitForOptions): Promise<string>;
295
+ export interface GetStylesOptions {
296
+ selector: string;
297
+ strategy?: string;
298
+ properties?: string[];
299
+ multiple?: boolean;
300
+ windowId?: string;
301
+ appIdentifier?: string | number;
302
+ }
303
+ export declare function getStyles(options: GetStylesOptions): Promise<string>;
304
+ export interface ExecuteJavaScriptOptions {
305
+ script: string;
306
+ args?: unknown[];
307
+ windowId?: string;
308
+ appIdentifier?: string | number;
309
+ }
310
+ export declare function executeJavaScript(options: ExecuteJavaScriptOptions): Promise<string>;
311
+ export interface FocusElementOptions {
312
+ selector: string;
313
+ strategy?: string;
314
+ windowId?: string;
315
+ appIdentifier?: string | number;
316
+ }
317
+ export declare function focusElement(options: FocusElementOptions): Promise<string>;
318
+ export interface FindElementOptions {
319
+ selector: string;
320
+ strategy: string;
321
+ windowId?: string;
322
+ appIdentifier?: string | number;
323
+ }
324
+ /**
325
+ * Find an element using various selector strategies.
326
+ */
327
+ export declare function findElement(options: FindElementOptions): Promise<string>;
328
+ export interface GetConsoleLogsOptions {
329
+ filter?: string;
330
+ since?: string;
331
+ windowId?: string;
332
+ appIdentifier?: string | number;
333
+ }
334
+ /**
335
+ * Get console logs from the webview.
336
+ */
337
+ export declare function getConsoleLogs(options?: GetConsoleLogsOptions): Promise<string>;
338
+ export interface DomSnapshotOptions {
339
+ type: 'accessibility' | 'structure';
340
+ selector?: string;
341
+ strategy?: string;
342
+ windowId?: string;
343
+ appIdentifier?: string | number;
344
+ }
345
+ /**
346
+ * Generate a structured DOM snapshot for AI consumption.
347
+ * Uses aria-api for comprehensive, spec-compliant accessibility computation.
348
+ */
349
+ export declare function domSnapshot(options: DomSnapshotOptions): Promise<string>;
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};