@ai-ecoverse/sliccy-browser 0.1.40 → 0.1.41
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/package.json +2 -2
- package/src/discover.js +21 -3
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/sliccy-browser",
|
|
3
|
-
"version": "0.1.
|
|
4
|
-
"description": "sliccy:browser for jsh, over CDP. Discovers Chrome via SLICC_CDP_URL, slicc browsers --json, DevToolsActivePort under slicc profiles, then 127.0.0.1:9222. Discovered endpoints refuse seven/vault/extension/error pages.",
|
|
3
|
+
"version": "0.1.41",
|
|
4
|
+
"description": "sliccy:browser for jsh, over CDP. Discovers Chrome via SLICC_CDP_URL, slicc browsers --json, DevToolsActivePort under slicc profiles (live /json/version must match the file's websocket path), then 127.0.0.1:9222. Discovered endpoints refuse seven/vault/extension/error pages.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
package/src/discover.js
CHANGED
|
@@ -299,16 +299,34 @@ async function fromDevToolsActivePort(options) {
|
|
|
299
299
|
const roots = options.profileRoots ?? sliccProfileRoots(options);
|
|
300
300
|
const files = await collectActivePorts(roots);
|
|
301
301
|
files.sort((left, right) => right.mtimeMs - left.mtimeMs);
|
|
302
|
+
let identityMismatch = 0;
|
|
303
|
+
let probeRejected = 0;
|
|
302
304
|
for (const item of files) {
|
|
303
305
|
const url = await probeVersion(fetchImpl, item.port, timeoutMs);
|
|
304
|
-
if (url === undefined)
|
|
305
|
-
|
|
306
|
+
if (url === undefined) {
|
|
307
|
+
probeRejected += 1;
|
|
308
|
+
continue;
|
|
309
|
+
}
|
|
310
|
+
if (new URL(url).pathname !== item.wsPath) {
|
|
311
|
+
identityMismatch += 1;
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
306
314
|
return { ok: true, url };
|
|
307
315
|
}
|
|
308
316
|
if (files.length === 0) {
|
|
309
317
|
return { ok: false, reason: 'no DevToolsActivePort files under slicc profile dirs' };
|
|
310
318
|
}
|
|
311
|
-
|
|
319
|
+
const parts = [];
|
|
320
|
+
if (identityMismatch > 0) {
|
|
321
|
+
parts.push(`${identityMismatch} rejected for browser identity mismatch`);
|
|
322
|
+
}
|
|
323
|
+
if (probeRejected > 0) {
|
|
324
|
+
parts.push(`${probeRejected} stale or rejected websocket URL`);
|
|
325
|
+
}
|
|
326
|
+
return {
|
|
327
|
+
ok: false,
|
|
328
|
+
reason: `no live DevToolsActivePort (${parts.join('; ')})`,
|
|
329
|
+
};
|
|
312
330
|
}
|
|
313
331
|
|
|
314
332
|
async function fromFallback(options) {
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.41';
|