@lynx-js/devtool-connector 0.18.1 → 0.18.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/2.js +1 -1
- package/dist/a.js +2 -0
- package/dist/h.js +5 -1
- package/dist/t.js +1 -0
- package/dist/transport/desktop.d.ts +1 -0
- package/dist/transport/transport.d.ts +1 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
# @lynx-js/devtool-connector
|
|
2
2
|
|
|
3
|
+
## 0.18.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Route requests through a sole daemon without requiring a fresh device scan, so it can reuse a healthy pooled connection and validate unknown targets itself.
|
|
8
|
+
- Add a daemon-managed Simulator with a lazily prepared Core/native host, window options, and JSON/JavaScript page environments on `open`.
|
|
9
|
+
|
|
3
10
|
## 0.18.1
|
|
4
11
|
|
|
5
12
|
### Patch Changes
|
package/dist/2.js
CHANGED
|
@@ -1659,7 +1659,7 @@ const DAEMON_SHUTDOWN_PATH = `${DAEMON_WS_PATH}/shutdown`;
|
|
|
1659
1659
|
const DAEMON_INSPECTOR_PATH = `${DAEMON_WS_PATH}/inspector`;
|
|
1660
1660
|
const DAEMON_COMMAND_PATH_PREFIX = "/command/";
|
|
1661
1661
|
var package_namespaceObject = {
|
|
1662
|
-
rE: "0.18.
|
|
1662
|
+
rE: "0.18.2"
|
|
1663
1663
|
};
|
|
1664
1664
|
const CONNECTOR_VERSION = package_namespaceObject.rE;
|
|
1665
1665
|
const node_modules_semver = __webpack_require__("../../../node_modules/.pnpm/semver@7.8.5/node_modules/semver/index.js");
|
package/dist/a.js
CHANGED
|
@@ -368,6 +368,8 @@ class Connector {
|
|
|
368
368
|
return parsed;
|
|
369
369
|
}
|
|
370
370
|
async #findTransportWithDeviceId(deviceId) {
|
|
371
|
+
const [onlyTransport] = this.#transports;
|
|
372
|
+
if (1 === this.#transports.length && onlyTransport instanceof DaemonTransport) return onlyTransport;
|
|
371
373
|
const daemonTransport = await this.#findTransportWithDeviceIdInPool(this.#daemonTransports, deviceId);
|
|
372
374
|
if (daemonTransport) return daemonTransport;
|
|
373
375
|
const transport = await this.#findTransportWithDeviceIdInPool(this.#transports.filter((t)=>!(t instanceof DaemonTransport)), deviceId);
|
package/dist/h.js
CHANGED
|
@@ -9109,8 +9109,12 @@ class AndroidTransport {
|
|
|
9109
9109
|
}
|
|
9110
9110
|
const desktop_debug = ansi_createDebug("devtool-mcp-server:connector:desktop");
|
|
9111
9111
|
class DesktopTransport {
|
|
9112
|
+
#takeoverHDT;
|
|
9113
|
+
constructor(takeoverHDT = true){
|
|
9114
|
+
this.#takeoverHDT = takeoverHDT;
|
|
9115
|
+
}
|
|
9112
9116
|
async connect(options) {
|
|
9113
|
-
return connectWithPeertalk((opts)=>this.#connectRaw(opts), options);
|
|
9117
|
+
return connectWithPeertalk((opts)=>this.#connectRaw(opts), options, this.#takeoverHDT);
|
|
9114
9118
|
}
|
|
9115
9119
|
async close() {
|
|
9116
9120
|
desktop_debug("Desktop transport closed");
|
package/dist/t.js
CHANGED
|
@@ -1230,6 +1230,7 @@ class DevtoolDaemon {
|
|
|
1230
1230
|
server_debug("no clients connected, starting idle timer (%dms)", this.#idleTimeoutMs);
|
|
1231
1231
|
this.#idleTimer = setTimeout(()=>{
|
|
1232
1232
|
if (0 === this.#wsClients.size && 0 === this.#activeCommandRequests) {
|
|
1233
|
+
if (this.#transports.some((transport)=>transport.active)) return void this.#resetIdleTimer();
|
|
1233
1234
|
server_debug("idle timeout reached, shutting down daemon");
|
|
1234
1235
|
this.#onIdle?.();
|
|
1235
1236
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type App, type Connection, type Device, type Transport, type TransportConnectOptions } from "./transport.js";
|
|
2
2
|
export declare class DesktopTransport implements Transport {
|
|
3
3
|
#private;
|
|
4
|
+
constructor(takeoverHDT?: boolean);
|
|
4
5
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
5
6
|
close(): Promise<void>;
|
|
6
7
|
listDevices(): Promise<Device[]>;
|
|
@@ -23,6 +23,7 @@ export interface Transport {
|
|
|
23
23
|
openApp(deviceId: string, packageName: string, options?: OpenAppOptions): Promise<void>;
|
|
24
24
|
connect<TInput = unknown, TOutput = unknown>(options: TransportConnectOptions): Promise<Connection<TOutput, TInput>>;
|
|
25
25
|
readonly persistent?: boolean;
|
|
26
|
+
readonly active?: boolean;
|
|
26
27
|
}
|
|
27
28
|
export interface Device {
|
|
28
29
|
id: string;
|