@midscene/shared 1.8.4 → 1.8.5-beta-20260522071402.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.
|
@@ -5,7 +5,7 @@ import { assert } from "../utils.mjs";
|
|
|
5
5
|
import { maskConfig, parseJson } from "./helper.mjs";
|
|
6
6
|
import { initDebugConfig } from "./init-debug.mjs";
|
|
7
7
|
const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
|
|
8
|
-
const getCurrentVersion = ()=>"1.8.
|
|
8
|
+
const getCurrentVersion = ()=>"1.8.5-beta-20260522071402.0";
|
|
9
9
|
const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
|
|
10
10
|
const KEYS_MAP = {
|
|
11
11
|
insight: INSIGHT_MODEL_CONFIG_KEYS,
|
package/dist/es/node/port.mjs
CHANGED
|
@@ -37,7 +37,7 @@ const external_utils_js_namespaceObject = require("../utils.js");
|
|
|
37
37
|
const external_helper_js_namespaceObject = require("./helper.js");
|
|
38
38
|
const external_init_debug_js_namespaceObject = require("./init-debug.js");
|
|
39
39
|
const MODEL_CONFIG_DOC_URL = 'https://midscenejs.com/model-common-config.html';
|
|
40
|
-
const getCurrentVersion = ()=>"1.8.
|
|
40
|
+
const getCurrentVersion = ()=>"1.8.5-beta-20260522071402.0";
|
|
41
41
|
const getInvalidModelFamilyMessage = (modelFamily)=>`Invalid MIDSCENE_MODEL_FAMILY value: ${modelFamily}. Current version v${getCurrentVersion()} accepts the following model families: ${external_types_js_namespaceObject.MODEL_FAMILY_VALUES.join(', ')}. You can also visit ${MODEL_CONFIG_DOC_URL} for the latest configuration information.`;
|
|
42
42
|
const KEYS_MAP = {
|
|
43
43
|
insight: external_constants_js_namespaceObject.INSIGHT_MODEL_CONFIG_KEYS,
|
package/dist/lib/node/port.js
CHANGED
|
@@ -32,7 +32,7 @@ async function isPortAvailable(port) {
|
|
|
32
32
|
return new Promise((resolve)=>{
|
|
33
33
|
const server = (0, external_node_net_namespaceObject.createServer)();
|
|
34
34
|
server.on('error', ()=>resolve(false));
|
|
35
|
-
server.listen(port, ()=>{
|
|
35
|
+
server.listen(port, '0.0.0.0', ()=>{
|
|
36
36
|
server.close(()=>resolve(true));
|
|
37
37
|
});
|
|
38
38
|
});
|
package/package.json
CHANGED
package/src/node/port.ts
CHANGED
|
@@ -4,10 +4,15 @@ import { createServer } from 'node:net';
|
|
|
4
4
|
* Check if a port is available
|
|
5
5
|
*/
|
|
6
6
|
export async function isPortAvailable(port: number): Promise<boolean> {
|
|
7
|
+
// Probe with the same bind address the real playground/scrcpy servers use
|
|
8
|
+
// (`0.0.0.0`). Calling `listen(port)` without a host defaults to IPv6 `::`
|
|
9
|
+
// on most setups, which can succeed even when another process already
|
|
10
|
+
// holds the IPv4 wildcard for that port — leaving us to crash at real
|
|
11
|
+
// launch time after wrongly concluding the port was free.
|
|
7
12
|
return new Promise((resolve) => {
|
|
8
13
|
const server = createServer();
|
|
9
14
|
server.on('error', () => resolve(false));
|
|
10
|
-
server.listen(port, () => {
|
|
15
|
+
server.listen(port, '0.0.0.0', () => {
|
|
11
16
|
server.close(() => resolve(true));
|
|
12
17
|
});
|
|
13
18
|
});
|