metro-mcp 0.1.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/LICENSE +21 -0
- package/README.md +143 -0
- package/dist/bin/metro-mcp.js +3726 -0
- package/dist/client/client-buffer.d.ts +14 -0
- package/dist/client/client-buffer.d.ts.map +1 -0
- package/dist/client/index.cjs +346 -0
- package/dist/client/index.d.ts +80 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +307 -0
- package/dist/client/lifecycle.d.ts +17 -0
- package/dist/client/lifecycle.d.ts.map +1 -0
- package/dist/client/logger.d.ts +17 -0
- package/dist/client/logger.d.ts.map +1 -0
- package/dist/client/middleware/navigation.d.ts +22 -0
- package/dist/client/middleware/navigation.d.ts.map +1 -0
- package/dist/client/middleware/redux.d.ts +22 -0
- package/dist/client/middleware/redux.d.ts.map +1 -0
- package/dist/client/performance.d.ts +18 -0
- package/dist/client/performance.d.ts.map +1 -0
- package/dist/client/state.d.ts +13 -0
- package/dist/client/state.d.ts.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +3746 -0
- package/dist/metro/connection.d.ts +66 -0
- package/dist/metro/connection.d.ts.map +1 -0
- package/dist/metro/discovery.d.ts +19 -0
- package/dist/metro/discovery.d.ts.map +1 -0
- package/dist/metro/types.d.ts +49 -0
- package/dist/metro/types.d.ts.map +1 -0
- package/dist/plugin.cjs +51 -0
- package/dist/plugin.d.ts +97 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +14 -0
- package/dist/plugins/accessibility.d.ts +2 -0
- package/dist/plugins/accessibility.d.ts.map +1 -0
- package/dist/plugins/appium.d.ts +2 -0
- package/dist/plugins/appium.d.ts.map +1 -0
- package/dist/plugins/bundle.d.ts +2 -0
- package/dist/plugins/bundle.d.ts.map +1 -0
- package/dist/plugins/commands.d.ts +2 -0
- package/dist/plugins/commands.d.ts.map +1 -0
- package/dist/plugins/components.d.ts +2 -0
- package/dist/plugins/components.d.ts.map +1 -0
- package/dist/plugins/console.d.ts +2 -0
- package/dist/plugins/console.d.ts.map +1 -0
- package/dist/plugins/deeplink.d.ts +2 -0
- package/dist/plugins/deeplink.d.ts.map +1 -0
- package/dist/plugins/device.d.ts +2 -0
- package/dist/plugins/device.d.ts.map +1 -0
- package/dist/plugins/errors.d.ts +2 -0
- package/dist/plugins/errors.d.ts.map +1 -0
- package/dist/plugins/evaluate.d.ts +2 -0
- package/dist/plugins/evaluate.d.ts.map +1 -0
- package/dist/plugins/maestro.d.ts +2 -0
- package/dist/plugins/maestro.d.ts.map +1 -0
- package/dist/plugins/navigation.d.ts +2 -0
- package/dist/plugins/navigation.d.ts.map +1 -0
- package/dist/plugins/network.d.ts +2 -0
- package/dist/plugins/network.d.ts.map +1 -0
- package/dist/plugins/prompts.d.ts +2 -0
- package/dist/plugins/prompts.d.ts.map +1 -0
- package/dist/plugins/redux.d.ts +2 -0
- package/dist/plugins/redux.d.ts.map +1 -0
- package/dist/plugins/simulator.d.ts +2 -0
- package/dist/plugins/simulator.d.ts.map +1 -0
- package/dist/plugins/source.d.ts +2 -0
- package/dist/plugins/source.d.ts.map +1 -0
- package/dist/plugins/storage.d.ts +2 -0
- package/dist/plugins/storage.d.ts.map +1 -0
- package/dist/plugins/ui-interact.d.ts +2 -0
- package/dist/plugins/ui-interact.d.ts.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/utils/buffer.d.ts +19 -0
- package/dist/utils/buffer.d.ts.map +1 -0
- package/dist/utils/cdp.d.ts +6 -0
- package/dist/utils/cdp.d.ts.map +1 -0
- package/dist/utils/fiber.d.ts +33 -0
- package/dist/utils/fiber.d.ts.map +1 -0
- package/dist/utils/format.d.ts +34 -0
- package/dist/utils/format.d.ts.map +1 -0
- package/dist/utils/logger.d.ts +3 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/package.json +65 -0
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import type { CDPConnection } from '../plugin.js';
|
|
2
|
+
import type { MetroTarget } from './types.js';
|
|
3
|
+
type CDPEventHandler = (params: Record<string, unknown>) => void;
|
|
4
|
+
/**
|
|
5
|
+
* CDP WebSocket client that connects to a Hermes debugger target.
|
|
6
|
+
* Implements the CDPConnection interface used by plugins.
|
|
7
|
+
*/
|
|
8
|
+
export declare class CDPClient implements CDPConnection {
|
|
9
|
+
private ws;
|
|
10
|
+
private messageId;
|
|
11
|
+
private pendingRequests;
|
|
12
|
+
private eventHandlers;
|
|
13
|
+
private reconnectAttempts;
|
|
14
|
+
private reconnectTimer;
|
|
15
|
+
private keepAliveTimer;
|
|
16
|
+
private connectingPromise;
|
|
17
|
+
private suppressReconnect;
|
|
18
|
+
private _isConnected;
|
|
19
|
+
private target;
|
|
20
|
+
private readonly maxReconnectAttempts;
|
|
21
|
+
private readonly reconnectDelays;
|
|
22
|
+
private readonly requestTimeout;
|
|
23
|
+
private readonly keepAliveInterval;
|
|
24
|
+
/**
|
|
25
|
+
* Connect to a CDP target.
|
|
26
|
+
*/
|
|
27
|
+
connect(target: MetroTarget): Promise<void>;
|
|
28
|
+
/**
|
|
29
|
+
* Wait for an in-progress connection attempt to finish, if any.
|
|
30
|
+
*/
|
|
31
|
+
waitForConnection(): Promise<boolean>;
|
|
32
|
+
private doConnect;
|
|
33
|
+
/**
|
|
34
|
+
* Send a CDP command and wait for the response.
|
|
35
|
+
*/
|
|
36
|
+
send(method: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
37
|
+
/**
|
|
38
|
+
* Subscribe to a CDP event.
|
|
39
|
+
*/
|
|
40
|
+
on(event: string, handler: CDPEventHandler): void;
|
|
41
|
+
/**
|
|
42
|
+
* Unsubscribe from a CDP event.
|
|
43
|
+
*/
|
|
44
|
+
off(event: string, handler: CDPEventHandler): void;
|
|
45
|
+
/**
|
|
46
|
+
* Check if connected.
|
|
47
|
+
*/
|
|
48
|
+
isConnected(): boolean;
|
|
49
|
+
/**
|
|
50
|
+
* Get the current target.
|
|
51
|
+
*/
|
|
52
|
+
getTarget(): MetroTarget | null;
|
|
53
|
+
/**
|
|
54
|
+
* Disconnect and stop reconnecting.
|
|
55
|
+
*/
|
|
56
|
+
disconnect(): void;
|
|
57
|
+
private clearReconnectTimer;
|
|
58
|
+
private startKeepAlive;
|
|
59
|
+
private stopKeepAlive;
|
|
60
|
+
private handleMessage;
|
|
61
|
+
private rejectAllPending;
|
|
62
|
+
private scheduleReconnect;
|
|
63
|
+
private emit;
|
|
64
|
+
}
|
|
65
|
+
export {};
|
|
66
|
+
//# sourceMappingURL=connection.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"connection.d.ts","sourceRoot":"","sources":["../../src/metro/connection.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClD,OAAO,KAAK,EAA2B,WAAW,EAAE,MAAM,YAAY,CAAC;AAKvE,KAAK,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;AAQjE;;;GAGG;AACH,qBAAa,SAAU,YAAW,aAAa;IAC7C,OAAO,CAAC,EAAE,CAA0B;IACpC,OAAO,CAAC,SAAS,CAAK;IACtB,OAAO,CAAC,eAAe,CAAqC;IAC5D,OAAO,CAAC,aAAa,CAA2C;IAChE,OAAO,CAAC,iBAAiB,CAAK;IAC9B,OAAO,CAAC,cAAc,CAA8C;IACpE,OAAO,CAAC,cAAc,CAA+C;IACrE,OAAO,CAAC,iBAAiB,CAA8B;IACvD,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,YAAY,CAAS;IAC7B,OAAO,CAAC,MAAM,CAA4B;IAE1C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAM;IAC3C,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAmC;IACnE,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAS;IACxC,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAE3C;;OAEG;IACG,OAAO,CAAC,MAAM,EAAE,WAAW,GAAG,OAAO,CAAC,IAAI,CAAC;IAWjD;;OAEG;IACG,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC;IAQ3C,OAAO,CAAC,SAAS;IA2CjB;;OAEG;IACG,IAAI,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,OAAO,CAAC,OAAO,CAAC;IAoB9E;;OAEG;IACH,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAOjD;;OAEG;IACH,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,eAAe,GAAG,IAAI;IAIlD;;OAEG;IACH,WAAW,IAAI,OAAO;IAItB;;OAEG;IACH,SAAS,IAAI,WAAW,GAAG,IAAI;IAI/B;;OAEG;IACH,UAAU,IAAI,IAAI;IAYlB,OAAO,CAAC,mBAAmB;IAO3B,OAAO,CAAC,cAAc;IAUtB,OAAO,CAAC,aAAa;IAOrB,OAAO,CAAC,aAAa;IAuCrB,OAAO,CAAC,gBAAgB;IAQxB,OAAO,CAAC,iBAAiB;IA2BzB,OAAO,CAAC,IAAI;CAYb"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { MetroTarget, MetroServerInfo } from './types.js';
|
|
2
|
+
/**
|
|
3
|
+
* Fetch debuggable targets from a Metro server's /json endpoint.
|
|
4
|
+
*/
|
|
5
|
+
export declare function fetchTargets(host: string, port: number): Promise<MetroTarget[]>;
|
|
6
|
+
/**
|
|
7
|
+
* Select the best target from a list.
|
|
8
|
+
* Priority: Bridgeless > Hermes > standard RN (skip Reanimated/Experimental).
|
|
9
|
+
*/
|
|
10
|
+
export declare function selectBestTarget(targets: MetroTarget[]): MetroTarget | null;
|
|
11
|
+
/**
|
|
12
|
+
* Scan common Metro ports and find running servers.
|
|
13
|
+
*/
|
|
14
|
+
export declare function scanMetroPorts(host: string, specificPort?: number): Promise<MetroServerInfo[]>;
|
|
15
|
+
/**
|
|
16
|
+
* Check if Metro is running (returns status).
|
|
17
|
+
*/
|
|
18
|
+
export declare function checkMetroStatus(host: string, port: number): Promise<string | null>;
|
|
19
|
+
//# sourceMappingURL=discovery.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"discovery.d.ts","sourceRoot":"","sources":["../../src/metro/discovery.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAO/D;;GAEG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC,CAYrF;AAED;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,WAAW,EAAE,GAAG,WAAW,GAAG,IAAI,CAyB3E;AAED;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,MAAM,EACZ,YAAY,CAAC,EAAE,MAAM,GACpB,OAAO,CAAC,eAAe,EAAE,CAAC,CAc5B;AAED;;GAEG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAUzF"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Target info returned by Metro's /json endpoint.
|
|
3
|
+
*/
|
|
4
|
+
export interface MetroTarget {
|
|
5
|
+
id: string;
|
|
6
|
+
title: string;
|
|
7
|
+
description: string;
|
|
8
|
+
type: string;
|
|
9
|
+
devtoolsFrontendUrl?: string;
|
|
10
|
+
webSocketDebuggerUrl: string;
|
|
11
|
+
faviconUrl?: string;
|
|
12
|
+
url?: string;
|
|
13
|
+
deviceName?: string;
|
|
14
|
+
reactNative?: {
|
|
15
|
+
logicalDeviceId?: string;
|
|
16
|
+
};
|
|
17
|
+
vm?: string;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* CDP message sent to the debugger.
|
|
21
|
+
*/
|
|
22
|
+
export interface CDPRequest {
|
|
23
|
+
id: number;
|
|
24
|
+
method: string;
|
|
25
|
+
params?: Record<string, unknown>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* CDP response from the debugger.
|
|
29
|
+
*/
|
|
30
|
+
export interface CDPResponse {
|
|
31
|
+
id?: number;
|
|
32
|
+
method?: string;
|
|
33
|
+
params?: Record<string, unknown>;
|
|
34
|
+
result?: unknown;
|
|
35
|
+
error?: {
|
|
36
|
+
code: number;
|
|
37
|
+
message: string;
|
|
38
|
+
data?: unknown;
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Discovered Metro server info.
|
|
43
|
+
*/
|
|
44
|
+
export interface MetroServerInfo {
|
|
45
|
+
host: string;
|
|
46
|
+
port: number;
|
|
47
|
+
targets: MetroTarget[];
|
|
48
|
+
}
|
|
49
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/metro/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,IAAI,EAAE,MAAM,CAAC;IACb,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE;QACZ,eAAe,CAAC,EAAE,MAAM,CAAC;KAC1B,CAAC;IACF,EAAE,CAAC,EAAE,MAAM,CAAC;CACb;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;CAClC;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,CAAC,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACjC,MAAM,CAAC,EAAE,OAAO,CAAC;IACjB,KAAK,CAAC,EAAE;QACN,IAAI,EAAE,MAAM,CAAC;QACb,OAAO,EAAE,MAAM,CAAC;QAChB,IAAI,CAAC,EAAE,OAAO,CAAC;KAChB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,WAAW,EAAE,CAAC;CACxB"}
|
package/dist/plugin.cjs
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
function __accessProp(key) {
|
|
6
|
+
return this[key];
|
|
7
|
+
}
|
|
8
|
+
var __toCommonJS = (from) => {
|
|
9
|
+
var entry = (__moduleCache ??= new WeakMap).get(from), desc;
|
|
10
|
+
if (entry)
|
|
11
|
+
return entry;
|
|
12
|
+
entry = __defProp({}, "__esModule", { value: true });
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (var key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(entry, key))
|
|
16
|
+
__defProp(entry, key, {
|
|
17
|
+
get: __accessProp.bind(from, key),
|
|
18
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
__moduleCache.set(from, entry);
|
|
22
|
+
return entry;
|
|
23
|
+
};
|
|
24
|
+
var __moduleCache;
|
|
25
|
+
var __returnValue = (v) => v;
|
|
26
|
+
function __exportSetter(name, newValue) {
|
|
27
|
+
this[name] = __returnValue.bind(null, newValue);
|
|
28
|
+
}
|
|
29
|
+
var __export = (target, all) => {
|
|
30
|
+
for (var name in all)
|
|
31
|
+
__defProp(target, name, {
|
|
32
|
+
get: all[name],
|
|
33
|
+
enumerable: true,
|
|
34
|
+
configurable: true,
|
|
35
|
+
set: __exportSetter.bind(all, name)
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
// src/plugin.ts
|
|
40
|
+
var exports_plugin = {};
|
|
41
|
+
__export(exports_plugin, {
|
|
42
|
+
definePlugin: () => definePlugin,
|
|
43
|
+
defineConfig: () => defineConfig
|
|
44
|
+
});
|
|
45
|
+
module.exports = __toCommonJS(exports_plugin);
|
|
46
|
+
function definePlugin(plugin) {
|
|
47
|
+
return plugin;
|
|
48
|
+
}
|
|
49
|
+
function defineConfig(config) {
|
|
50
|
+
return config;
|
|
51
|
+
}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export interface CDPConnection {
|
|
3
|
+
send(method: string, params?: Record<string, unknown>): Promise<unknown>;
|
|
4
|
+
on(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
5
|
+
off(event: string, handler: (params: Record<string, unknown>) => void): void;
|
|
6
|
+
isConnected(): boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface FormatUtils {
|
|
9
|
+
summarize<T>(items: T[], lastN?: number): string;
|
|
10
|
+
compact(obj: unknown): string;
|
|
11
|
+
truncate(str: string, maxLen: number): string;
|
|
12
|
+
structureOnly(tree: ComponentNode): ComponentNode;
|
|
13
|
+
}
|
|
14
|
+
export interface ComponentNode {
|
|
15
|
+
name: string;
|
|
16
|
+
children?: ComponentNode[];
|
|
17
|
+
props?: Record<string, unknown>;
|
|
18
|
+
state?: unknown;
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}
|
|
21
|
+
export interface ToolConfig<T extends z.ZodType = z.ZodType> {
|
|
22
|
+
description: string;
|
|
23
|
+
parameters: T;
|
|
24
|
+
handler: (args: z.infer<T>) => Promise<unknown>;
|
|
25
|
+
}
|
|
26
|
+
export interface ResourceConfig {
|
|
27
|
+
name: string;
|
|
28
|
+
description: string;
|
|
29
|
+
mimeType?: string;
|
|
30
|
+
handler: () => Promise<string>;
|
|
31
|
+
}
|
|
32
|
+
export interface PromptConfig {
|
|
33
|
+
description: string;
|
|
34
|
+
arguments?: Array<{
|
|
35
|
+
name: string;
|
|
36
|
+
description: string;
|
|
37
|
+
required?: boolean;
|
|
38
|
+
}>;
|
|
39
|
+
handler: (args: Record<string, string>) => Promise<Array<{
|
|
40
|
+
role: 'user' | 'assistant';
|
|
41
|
+
content: string;
|
|
42
|
+
}>>;
|
|
43
|
+
}
|
|
44
|
+
export interface EvalOptions {
|
|
45
|
+
/** Wait for a returned Promise to resolve before returning the value */
|
|
46
|
+
awaitPromise?: boolean;
|
|
47
|
+
/** CDP timeout in milliseconds (default: 10000) */
|
|
48
|
+
timeout?: number;
|
|
49
|
+
}
|
|
50
|
+
export interface PluginContext {
|
|
51
|
+
cdp: CDPConnection;
|
|
52
|
+
registerTool<T extends z.ZodType>(name: string, config: ToolConfig<T>): void;
|
|
53
|
+
registerResource(uri: string, config: ResourceConfig): void;
|
|
54
|
+
registerPrompt(name: string, config: PromptConfig): void;
|
|
55
|
+
config: Record<string, unknown>;
|
|
56
|
+
logger: Logger;
|
|
57
|
+
metro: {
|
|
58
|
+
host: string;
|
|
59
|
+
port: number;
|
|
60
|
+
fetch(path: string): Promise<Response>;
|
|
61
|
+
};
|
|
62
|
+
exec(command: string): Promise<string>;
|
|
63
|
+
format: FormatUtils;
|
|
64
|
+
/** Evaluate a JavaScript expression in the connected app runtime */
|
|
65
|
+
evalInApp(expression: string, options?: EvalOptions): Promise<unknown>;
|
|
66
|
+
}
|
|
67
|
+
export interface Logger {
|
|
68
|
+
info(message: string, ...args: unknown[]): void;
|
|
69
|
+
warn(message: string, ...args: unknown[]): void;
|
|
70
|
+
error(message: string, ...args: unknown[]): void;
|
|
71
|
+
debug(message: string, ...args: unknown[]): void;
|
|
72
|
+
}
|
|
73
|
+
export interface PluginDefinition {
|
|
74
|
+
name: string;
|
|
75
|
+
version: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
setup(ctx: PluginContext): Promise<void>;
|
|
78
|
+
}
|
|
79
|
+
export declare function definePlugin(plugin: PluginDefinition): PluginDefinition;
|
|
80
|
+
export interface MetroMCPConfig {
|
|
81
|
+
metro?: {
|
|
82
|
+
host?: string;
|
|
83
|
+
port?: number;
|
|
84
|
+
autoDiscover?: boolean;
|
|
85
|
+
};
|
|
86
|
+
plugins?: string[];
|
|
87
|
+
bufferSizes?: {
|
|
88
|
+
logs?: number;
|
|
89
|
+
network?: number;
|
|
90
|
+
errors?: number;
|
|
91
|
+
};
|
|
92
|
+
network?: {
|
|
93
|
+
interceptFetch?: boolean;
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
export declare function defineConfig(config: MetroMCPConfig): MetroMCPConfig;
|
|
97
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAKxB,MAAM,WAAW,aAAa;IAC5B,IAAI,CAAC,MAAM,EAAE,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,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,MAAM,CAAC,EAAE,MAAM,CAAC;KACjB,CAAC;IACF,OAAO,CAAC,EAAE;QACR,cAAc,CAAC,EAAE,OAAO,CAAC;KAC1B,CAAC;CACH;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,cAAc,GAAG,cAAc,CAEnE"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createRequire } from "node:module";
|
|
2
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
3
|
+
|
|
4
|
+
// src/plugin.ts
|
|
5
|
+
function definePlugin(plugin) {
|
|
6
|
+
return plugin;
|
|
7
|
+
}
|
|
8
|
+
function defineConfig(config) {
|
|
9
|
+
return config;
|
|
10
|
+
}
|
|
11
|
+
export {
|
|
12
|
+
definePlugin,
|
|
13
|
+
defineConfig
|
|
14
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"accessibility.d.ts","sourceRoot":"","sources":["../../src/plugins/accessibility.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,mBAAmB,yCAgQ9B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appium.d.ts","sourceRoot":"","sources":["../../src/plugins/appium.ts"],"names":[],"mappings":"AAuEA,eAAO,MAAM,YAAY,yCA6WvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bundle.d.ts","sourceRoot":"","sources":["../../src/plugins/bundle.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,YAAY,yCA4FvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"commands.d.ts","sourceRoot":"","sources":["../../src/plugins/commands.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,cAAc,yCAyEzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components.d.ts","sourceRoot":"","sources":["../../src/plugins/components.ts"],"names":[],"mappings":"AA4FA,eAAO,MAAM,gBAAgB,yCAsL3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"console.d.ts","sourceRoot":"","sources":["../../src/plugins/console.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,aAAa,yCAgFxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deeplink.d.ts","sourceRoot":"","sources":["../../src/plugins/deeplink.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,yCA+EzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"device.d.ts","sourceRoot":"","sources":["../../src/plugins/device.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,YAAY,yCAsGvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/plugins/errors.ts"],"names":[],"mappings":"AAaA,eAAO,MAAM,YAAY,yCAqGvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"evaluate.d.ts","sourceRoot":"","sources":["../../src/plugins/evaluate.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,cAAc,yCAuBzB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"maestro.d.ts","sourceRoot":"","sources":["../../src/plugins/maestro.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,yCA+JxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"navigation.d.ts","sourceRoot":"","sources":["../../src/plugins/navigation.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,gBAAgB,yCAuK3B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"network.d.ts","sourceRoot":"","sources":["../../src/plugins/network.ts"],"names":[],"mappings":"AAqBA,eAAO,MAAM,aAAa,yCAwJxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"prompts.d.ts","sourceRoot":"","sources":["../../src/plugins/prompts.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,aAAa,yCAyIxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"redux.d.ts","sourceRoot":"","sources":["../../src/plugins/redux.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,WAAW,yCA+HtB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"simulator.d.ts","sourceRoot":"","sources":["../../src/plugins/simulator.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,eAAe,yCA2N1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"source.d.ts","sourceRoot":"","sources":["../../src/plugins/source.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,YAAY,yCA4CvB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"storage.d.ts","sourceRoot":"","sources":["../../src/plugins/storage.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,yCAsFxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ui-interact.d.ts","sourceRoot":"","sources":["../../src/plugins/ui-interact.ts"],"names":[],"mappings":"AASA,eAAO,MAAM,gBAAgB,yCA4hB3B,CAAC"}
|
package/dist/server.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"server.d.ts","sourceRoot":"","sources":["../src/server.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,cAAc,EAOf,MAAM,aAAa,CAAC;AAoDrB,wBAAsB,WAAW,CAAC,MAAM,EAAE,QAAQ,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgOjF"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Fixed-size circular buffer for storing log entries, network requests, etc.
|
|
3
|
+
* When full, oldest entries are overwritten.
|
|
4
|
+
*/
|
|
5
|
+
export declare class CircularBuffer<T> {
|
|
6
|
+
private readonly capacity;
|
|
7
|
+
private items;
|
|
8
|
+
private head;
|
|
9
|
+
private count;
|
|
10
|
+
constructor(capacity: number);
|
|
11
|
+
push(item: T): void;
|
|
12
|
+
getAll(): T[];
|
|
13
|
+
getLast(n: number): T[];
|
|
14
|
+
filter(predicate: (item: T) => boolean): T[];
|
|
15
|
+
clear(): void;
|
|
16
|
+
get size(): number;
|
|
17
|
+
get maxSize(): number;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=buffer.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"buffer.d.ts","sourceRoot":"","sources":["../../src/utils/buffer.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,qBAAa,cAAc,CAAC,CAAC;IAKf,OAAO,CAAC,QAAQ,CAAC,QAAQ;IAJrC,OAAO,CAAC,KAAK,CAAM;IACnB,OAAO,CAAC,IAAI,CAAK;IACjB,OAAO,CAAC,KAAK,CAAK;gBAEW,QAAQ,EAAE,MAAM;IAI7C,IAAI,CAAC,IAAI,EAAE,CAAC,GAAG,IAAI;IAUnB,MAAM,IAAI,CAAC,EAAE;IAQb,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,CAAC,EAAE;IAKvB,MAAM,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,OAAO,GAAG,CAAC,EAAE;IAI5C,KAAK,IAAI,IAAI;IAMb,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED,IAAI,OAAO,IAAI,MAAM,CAEpB;CACF"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Extract a human-readable message from a CDP exceptionDetails object.
|
|
3
|
+
* Works for both Runtime.evaluate responses and Runtime.exceptionThrown events.
|
|
4
|
+
*/
|
|
5
|
+
export declare function extractCDPExceptionMessage(details: Record<string, unknown>, fallback?: string): string;
|
|
6
|
+
//# sourceMappingURL=cdp.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cdp.d.ts","sourceRoot":"","sources":["../../src/utils/cdp.ts"],"names":[],"mappings":"AAAA;;;GAGG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,QAAQ,SAAsB,GAC7B,MAAM,CAQR"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Shared fiber tree utilities used across plugins.
|
|
3
|
+
*
|
|
4
|
+
* JS string constants are embedded into evalInApp() calls, so they must be
|
|
5
|
+
* valid JavaScript and cannot reference TypeScript imports.
|
|
6
|
+
*/
|
|
7
|
+
/**
|
|
8
|
+
* Inline JS snippet that resolves `rootFiber` from the React DevTools hook.
|
|
9
|
+
* Embed at the top of an IIFE; uses `return` to exit early on failure.
|
|
10
|
+
* The early-return value should match the IIFE's failure sentinel (null or []).
|
|
11
|
+
*/
|
|
12
|
+
export declare const FIBER_ROOT_JS = "\n var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n if (!hook || !hook.getFiberRoots) return null;\n var fiberRoots;\n try {\n for (var i = 1; i <= 5; i++) {\n fiberRoots = hook.getFiberRoots(i);\n if (fiberRoots && fiberRoots.size > 0) break;\n }\n } catch(e) { return null; }\n if (!fiberRoots || fiberRoots.size === 0) return null;\n var rootFiber = Array.from(fiberRoots)[0].current;\n";
|
|
13
|
+
/**
|
|
14
|
+
* Complete standalone IIFE that collects testable elements from the fiber tree.
|
|
15
|
+
* Returns an array of { name, testID, accessibilityLabel, accessibilityRole, text, interactive }.
|
|
16
|
+
* Uses an iterative stack to safely handle deep navigation trees (depth 200+).
|
|
17
|
+
*/
|
|
18
|
+
export declare const COLLECT_ELEMENTS_JS = "\n (function() {\n var hook = globalThis.__REACT_DEVTOOLS_GLOBAL_HOOK__;\n if (!hook || !hook.getFiberRoots) return [];\n var fiberRoots;\n try {\n for (var i = 1; i <= 5; i++) {\n fiberRoots = hook.getFiberRoots(i);\n if (fiberRoots && fiberRoots.size > 0) break;\n }\n } catch(e) { return []; }\n if (!fiberRoots || fiberRoots.size === 0) return [];\n var rootFiber = Array.from(fiberRoots)[0].current;\n var elements = [];\n var seen = {};\n var stack = [{ f: rootFiber, d: 0 }];\n while (stack.length) {\n var item = stack.pop();\n var fiber = item.f; var depth = item.d;\n if (!fiber || depth > 200) continue;\n var type = fiber.type;\n var name = typeof type === 'string' ? type : (type && (type.displayName || type.name));\n if (name && name.indexOf('RCT') !== 0) {\n var props = fiber.memoizedProps || {};\n var testID = props.testID || null;\n var label = props.accessibilityLabel || props['aria-label'] || null;\n var key = testID || label;\n if ((testID || label || typeof props.children === 'string') && (!key || !seen[key])) {\n if (key) seen[key] = true;\n elements.push({\n name: name,\n testID: testID,\n accessibilityLabel: label,\n accessibilityRole: props.accessibilityRole || props['role'] || null,\n text: typeof props.children === 'string' ? props.children : null,\n interactive: !!(props.onPress || props.onPressIn || props.onClick),\n });\n }\n }\n if (fiber.sibling) stack.push({ f: fiber.sibling, d: depth });\n if (fiber.child) stack.push({ f: fiber.child, d: depth + 1 });\n }\n return elements;\n })()\n";
|
|
19
|
+
export interface TestableElement {
|
|
20
|
+
name: string;
|
|
21
|
+
testID?: string;
|
|
22
|
+
accessibilityLabel?: string;
|
|
23
|
+
accessibilityRole?: string;
|
|
24
|
+
text?: string;
|
|
25
|
+
interactive?: boolean;
|
|
26
|
+
}
|
|
27
|
+
type EvalFn = (expr: string, opts?: {
|
|
28
|
+
timeout?: number;
|
|
29
|
+
awaitPromise?: boolean;
|
|
30
|
+
}) => Promise<unknown>;
|
|
31
|
+
export declare function collectElements(evalInApp: EvalFn): Promise<TestableElement[]>;
|
|
32
|
+
export {};
|
|
33
|
+
//# sourceMappingURL=fiber.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fiber.d.ts","sourceRoot":"","sources":["../../src/utils/fiber.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;;GAIG;AACH,eAAO,MAAM,aAAa,waAYzB,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,mBAAmB,svDA4C/B,CAAC;AAEF,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAC5B,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,OAAO,CAAC;CACvB;AAED,KAAK,MAAM,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;IAAE,OAAO,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,KAAK,OAAO,CAAC,OAAO,CAAC,CAAC;AAEtG,wBAAsB,eAAe,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAEnF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { ComponentNode, FormatUtils } from '../plugin.js';
|
|
2
|
+
/**
|
|
3
|
+
* Summarize a list of items: "47 items. Last 5: ..."
|
|
4
|
+
*/
|
|
5
|
+
export declare function summarize<T>(items: T[], lastN?: number): string;
|
|
6
|
+
/**
|
|
7
|
+
* Compact representation: single-line key=value format.
|
|
8
|
+
*/
|
|
9
|
+
export declare function compact(obj: unknown): string;
|
|
10
|
+
/**
|
|
11
|
+
* Truncate a string with "..." suffix.
|
|
12
|
+
*/
|
|
13
|
+
export declare function truncate(str: string, maxLen: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* Strip props and state from a component tree, keeping only names and structure.
|
|
16
|
+
*/
|
|
17
|
+
export declare function structureOnly(tree: ComponentNode): ComponentNode;
|
|
18
|
+
/**
|
|
19
|
+
* Format a timestamp to a readable string.
|
|
20
|
+
*/
|
|
21
|
+
export declare function formatTimestamp(ts: number): string;
|
|
22
|
+
/**
|
|
23
|
+
* Escape a string for safe embedding inside a JS single-quoted string literal.
|
|
24
|
+
*/
|
|
25
|
+
export declare function escapeJsString(str: string): string;
|
|
26
|
+
/**
|
|
27
|
+
* Format bytes to human-readable string.
|
|
28
|
+
*/
|
|
29
|
+
export declare function formatBytes(bytes: number): string;
|
|
30
|
+
/**
|
|
31
|
+
* Create a FormatUtils instance.
|
|
32
|
+
*/
|
|
33
|
+
export declare function createFormatUtils(): FormatUtils;
|
|
34
|
+
//# sourceMappingURL=format.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/utils/format.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE/D;;GAEG;AACH,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,KAAK,SAAI,GAAG,MAAM,CAS1D;AAED;;GAEG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,OAAO,GAAG,MAAM,CAQ5C;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAG5D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,aAAa,CAMhE;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAKjD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,WAAW,CAE/C"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAE3C,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAYjD"}
|