@lynx-js/devtool-connector 0.18.1 → 0.18.3

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 CHANGED
@@ -1,5 +1,16 @@
1
1
  # @lynx-js/devtool-connector
2
2
 
3
+ ## 0.18.3
4
+
5
+ No changes in this release.
6
+
7
+ ## 0.18.2
8
+
9
+ ### Patch Changes
10
+
11
+ - 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.
12
+ - Add a daemon-managed Simulator with a lazily prepared Core/native host, window options, and JSON/JavaScript page environments on `open`.
13
+
3
14
  ## 0.18.1
4
15
 
5
16
  ### 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.1"
1662
+ rE: "0.18.3"
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
@@ -9097,7 +9097,7 @@ class AndroidTransport {
9097
9097
  }
9098
9098
  const output = await spawnWaitText(adb, command);
9099
9099
  android_debug(`openApp output ${output}`);
9100
- if (output.includes("Error:") || output.includes("unable to resolve Intent") || /Error type \d+/u.test(output)) throw new Error(`Failed to open app ${packageName}: ${output.trim()}`);
9100
+ if (output.includes("Error:") || output.includes("Security exception:") || output.includes("Permission Denial:") || output.includes("unable to resolve Intent") || /\b[A-Za-z0-9_$.]*Exception:/u.test(output) || /Error type \d+/u.test(output)) throw new Error(`Failed to open app ${packageName}: ${output.trim()}`);
9101
9101
  } catch (e) {
9102
9102
  env.error = e;
9103
9103
  env.hasError = true;
@@ -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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/devtool-connector",
3
- "version": "0.18.1",
3
+ "version": "0.18.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/lynx-community/skills.git",