@lynx-js/devtool-connector 0.19.1 → 0.20.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/CHANGELOG.md +36 -0
- package/dist/2.js +170 -170
- package/dist/a.js +9301 -566
- package/dist/az.js +691 -0
- package/dist/command/index.js +1 -1
- package/dist/command/reactlynx/controller.d.ts +1 -1
- package/dist/command/reactlynx/session.d.ts +3 -0
- package/dist/daemon/entry.js +5 -3
- package/dist/daemon/index.js +1 -1
- package/dist/f.js +217 -109
- package/dist/f1.js +214 -140
- package/dist/h.js +147 -9431
- package/dist/h6.js +603 -0
- package/dist/index.d.ts +7 -6
- package/dist/index.js +3 -3
- package/dist/main.js +1 -1
- package/dist/rslib-runtime.js +11 -13
- package/dist/streams/cdp.d.ts +1 -1
- package/dist/streams/customized.d.ts +1 -1
- package/dist/streams/index.js +1 -1
- package/dist/t.js +2473 -1276
- package/dist/transport/android.d.ts +3 -3
- package/dist/transport/daemon.d.ts +3 -3
- package/dist/transport/hdt.d.ts +15 -0
- package/dist/transport/index.d.ts +1 -0
- package/dist/transport/index.js +3 -2
- package/dist/transport/ios.d.ts +3 -3
- package/dist/transport/simulator.d.ts +62 -0
- package/dist/transport/transport.d.ts +14 -3
- package/dist/tw.js +1405 -0
- package/dist/types.d.ts +6 -4
- package/dist/ws-stream.js +3 -3
- package/package.json +9 -7
- package/public/simulator/bind-darwin-arm64.dylib +0 -0
- package/public/simulator/bind-darwin-x64.dylib +0 -0
- package/public/simulator/bind-linux-x64.so +0 -0
- package/public/simulator/entry.mjs +68 -0
- package/public/simulator/extensions.mjs +230 -0
- package/dist/0.js +0 -2537
- package/dist/hb.js +0 -203
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { type AdbServerClient } from "@yume-chan/adb";
|
|
2
2
|
import type { SocketConnectOpts } from "node:net";
|
|
3
3
|
export type * from "./adb-shell-types.js";
|
|
4
|
-
import { type App, type Connection, type Device, type OpenAppOptions, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
4
|
+
import { type App, type Connection, type Device, type OpenAppOptions, Platform, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
5
5
|
export interface AppIcon {
|
|
6
6
|
readonly data: Uint8Array;
|
|
7
7
|
readonly mimeType: "image/png";
|
|
8
8
|
}
|
|
9
9
|
export declare class AndroidTransport implements Transport {
|
|
10
10
|
#private;
|
|
11
|
-
readonly id
|
|
11
|
+
readonly id: Platform;
|
|
12
12
|
protected readonly client: AdbServerClient;
|
|
13
13
|
constructor(spec?: SocketConnectOpts);
|
|
14
14
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
@@ -20,5 +20,5 @@ export declare class AndroidTransport implements Transport {
|
|
|
20
20
|
} | undefined;
|
|
21
21
|
listAvailableApps(deviceId: string): Promise<App[]>;
|
|
22
22
|
getAppIcon(deviceId: string, packageName: string): Promise<AppIcon>;
|
|
23
|
-
openApp(deviceId: string, packageName: string, { withDataCleared, schema, restart
|
|
23
|
+
openApp(deviceId: string, packageName: string, { withDataCleared, schema, restart }?: OpenAppOptions<string>): Promise<void>;
|
|
24
24
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type App, type ClientList, type Connection, type Device, type OpenAppOptions, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
1
|
+
import { type App, type ClientList, type Connection, type Device, type ListAvailableAppsOptions, type OpenAppOptions, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
2
2
|
export interface DaemonConnectOptions extends TransportConnectOptions {
|
|
3
3
|
transportId: string;
|
|
4
4
|
}
|
|
@@ -17,8 +17,8 @@ export declare class DaemonTransport implements Transport {
|
|
|
17
17
|
constructor(endpoint?: number | string);
|
|
18
18
|
close(): Promise<void>;
|
|
19
19
|
listDevices(): Promise<Device[]>;
|
|
20
|
-
listAvailableApps(deviceId: string): Promise<App[]>;
|
|
21
|
-
openApp(deviceId: string, packageName: string, options?: OpenAppOptions): Promise<void>;
|
|
20
|
+
listAvailableApps(deviceId: string, options?: ListAvailableAppsOptions<string>): Promise<App[]>;
|
|
21
|
+
openApp(deviceId: string, packageName: string, options?: OpenAppOptions<string>): Promise<void>;
|
|
22
22
|
listClients(): Promise<ClientList>;
|
|
23
23
|
connect<TInput = unknown, TOutput = unknown>(options: DaemonConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
24
24
|
protected ensureDaemonRunning(port: number): Promise<string>;
|
package/dist/transport/hdt.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import type { ReadableStream } from "node:stream/web";
|
|
2
|
+
import { WritableStream } from "node:stream/web";
|
|
1
3
|
import type { App, Client, Connection, Device, Transport, TransportConnectOptions } from "./transport.js";
|
|
2
4
|
export declare class HDTTransport implements Transport {
|
|
3
5
|
#private;
|
|
@@ -11,4 +13,17 @@ export declare class HDTTransport implements Transport {
|
|
|
11
13
|
listAvailableApps(): Promise<App[]>;
|
|
12
14
|
openApp(): Promise<void>;
|
|
13
15
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
16
|
+
protected filterClient(client: Client): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Read messages from the stream until one with the specified event type is found.
|
|
19
|
+
* Earlier messages are discarded. This is used during the handshake to wait for
|
|
20
|
+
* server acknowledgments (Registered, RoomJoined) before proceeding.
|
|
21
|
+
*/
|
|
22
|
+
protected readUntilEvent(readable: ReadableStream<string>, eventName: string, signal?: AbortSignal): Promise<{
|
|
23
|
+
event: string;
|
|
24
|
+
data: unknown;
|
|
25
|
+
}>;
|
|
26
|
+
protected writeMessage(writable: WritableStream<string>, chunk: string, signal?: AbortSignal): Promise<void>;
|
|
27
|
+
protected completeRegistration(readable: ReadableStream<string>, writable: WritableStream<string>, signal?: AbortSignal): Promise<void>;
|
|
28
|
+
protected requestClientList(readable: ReadableStream<string>, writable: WritableStream<string>, signal?: AbortSignal): Promise<void>;
|
|
14
29
|
}
|
package/dist/transport/index.js
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export { AndroidTransport,
|
|
2
|
-
export { DaemonTransport, HDTTransport, requireNumericPort, withTransports } from "../f1.js";
|
|
1
|
+
export { AndroidTransport, Usbmux, iOSTransport } from "../a.js";
|
|
2
|
+
export { DaemonTransport, HDTTransport, Platform, requireNumericPort, withTransports } from "../f1.js";
|
|
3
|
+
export { DesktopTransport, LynxSimulatorTransport, PeertalkToMessageTransformStream, connectWithPeertalk, encodePeertalkMessage } from "../h6.js";
|
package/dist/transport/ios.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { NetConnectOpts } from "node:net";
|
|
2
|
-
import { type App, type Connection, type Device, type OpenAppOptions, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
2
|
+
import { type App, type Connection, type Device, type OpenAppOptions, Platform, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
3
3
|
export declare class iOSTransport implements Transport {
|
|
4
4
|
#private;
|
|
5
|
-
readonly id
|
|
5
|
+
readonly id: Platform;
|
|
6
6
|
constructor(options?: NetConnectOpts);
|
|
7
7
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
8
8
|
close(): Promise<void>;
|
|
9
9
|
listDevices(): Promise<Device[]>;
|
|
10
10
|
listAvailableApps(): Promise<App[]>;
|
|
11
|
-
openApp(_: string, __?: string, ___?: OpenAppOptions): Promise<void>;
|
|
11
|
+
openApp(_: string, __?: string, ___?: OpenAppOptions<string>): Promise<void>;
|
|
12
12
|
}
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
import type { Connector } from "../index.js";
|
|
2
|
+
import { DesktopTransport } from "./desktop.js";
|
|
3
|
+
import { type Client, type Connection, type Device, Platform, type TransportConnectOptions } from "./transport.js";
|
|
4
|
+
export interface LynxSimulatorConfig {
|
|
5
|
+
registry: string;
|
|
6
|
+
core: {
|
|
7
|
+
name: string;
|
|
8
|
+
version: string;
|
|
9
|
+
};
|
|
10
|
+
lynxtron: {
|
|
11
|
+
name: string;
|
|
12
|
+
version: string;
|
|
13
|
+
};
|
|
14
|
+
jsb?: string[];
|
|
15
|
+
nativeExtensions?: (version: string) => string[];
|
|
16
|
+
}
|
|
17
|
+
type LynxSimulatorInfo = {
|
|
18
|
+
clientId: string;
|
|
19
|
+
pid: number | null;
|
|
20
|
+
port: number;
|
|
21
|
+
status: "starting" | "running" | "stopping" | "stopped" | "exited" | "failed";
|
|
22
|
+
logPath: string;
|
|
23
|
+
startedAt: string;
|
|
24
|
+
endedAt?: string;
|
|
25
|
+
expiresAt?: string;
|
|
26
|
+
exitCode: number | null;
|
|
27
|
+
signal: NodeJS.Signals | null;
|
|
28
|
+
error?: string;
|
|
29
|
+
stopReason?: string;
|
|
30
|
+
coreVersion: string;
|
|
31
|
+
lynxtronVersion: string;
|
|
32
|
+
jsb: string[];
|
|
33
|
+
nativeExtensions: string[];
|
|
34
|
+
};
|
|
35
|
+
export declare class LynxSimulatorTransport extends DesktopTransport {
|
|
36
|
+
#private;
|
|
37
|
+
readonly id: Platform;
|
|
38
|
+
readonly persistent = true;
|
|
39
|
+
get active(): boolean;
|
|
40
|
+
constructor(config?: LynxSimulatorConfig);
|
|
41
|
+
listDevices(): Promise<Device[]>;
|
|
42
|
+
listClients(): Promise<Client[]>;
|
|
43
|
+
list(): LynxSimulatorInfo[];
|
|
44
|
+
get(clientId: string): LynxSimulatorInfo;
|
|
45
|
+
logs(clientId: string, offset?: number): Promise<{
|
|
46
|
+
content: string;
|
|
47
|
+
offset: number;
|
|
48
|
+
size: number;
|
|
49
|
+
eof: boolean;
|
|
50
|
+
finished: boolean;
|
|
51
|
+
}>;
|
|
52
|
+
wait(clientId: string, timeoutMs: number, signal?: AbortSignal): Promise<LynxSimulatorInfo>;
|
|
53
|
+
stop(clientId: string): Promise<LynxSimulatorInfo>;
|
|
54
|
+
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
55
|
+
run(connector: Connector, signal?: AbortSignal, ttlMs?: number, options?: {
|
|
56
|
+
jsb?: unknown;
|
|
57
|
+
nativeExtensions?: unknown;
|
|
58
|
+
lynxtronVersion?: unknown;
|
|
59
|
+
}): Promise<LynxSimulatorInfo>;
|
|
60
|
+
close(): Promise<void>;
|
|
61
|
+
}
|
|
62
|
+
export {};
|
|
@@ -7,7 +7,18 @@ export interface TransportConnectOptions {
|
|
|
7
7
|
signal?: AbortSignal | undefined;
|
|
8
8
|
}
|
|
9
9
|
export declare function requireNumericPort(port: ClientTarget): number;
|
|
10
|
-
export
|
|
10
|
+
export declare const Platform: {
|
|
11
|
+
readonly Android: "android";
|
|
12
|
+
readonly iOS: "ios";
|
|
13
|
+
readonly Desktop: "desktop";
|
|
14
|
+
readonly Simulator: "simulator";
|
|
15
|
+
};
|
|
16
|
+
export type Platform = (typeof Platform)[keyof typeof Platform];
|
|
17
|
+
export interface ListAvailableAppsOptions<TPlatform extends string = Platform> {
|
|
18
|
+
/** Target platform, so the daemon can skip device discovery. */
|
|
19
|
+
platform?: TPlatform | undefined;
|
|
20
|
+
}
|
|
21
|
+
export interface OpenAppOptions<TPlatform extends string = Platform> extends ListAvailableAppsOptions<TPlatform> {
|
|
11
22
|
signal?: AbortSignal;
|
|
12
23
|
withDataCleared?: boolean | undefined;
|
|
13
24
|
/** Stop the app before launching; Android preserves its existing default of true. */
|
|
@@ -20,8 +31,8 @@ export interface Transport {
|
|
|
20
31
|
close(): Promise<void>;
|
|
21
32
|
listDevices(): Promise<Device[]>;
|
|
22
33
|
listClients?(): Promise<Client[]>;
|
|
23
|
-
listAvailableApps(deviceId: string): Promise<App[]>;
|
|
24
|
-
openApp(deviceId: string, packageName: string, options?: OpenAppOptions): Promise<void>;
|
|
34
|
+
listAvailableApps(deviceId: string, options?: ListAvailableAppsOptions<string>): Promise<App[]>;
|
|
35
|
+
openApp(deviceId: string, packageName: string, options?: OpenAppOptions<string>): Promise<void>;
|
|
25
36
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
26
37
|
readonly persistent?: boolean;
|
|
27
38
|
readonly active?: boolean;
|