@dmsdc-ai/aigentry-deliberation 0.0.25 → 0.0.26
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/index.js +7 -4
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -1233,17 +1233,20 @@ async function collectSpeakerCandidates({ include_cli = true, include_browser =
|
|
|
1233
1233
|
|
|
1234
1234
|
// CDP auto-detection: probe endpoints for matching tabs
|
|
1235
1235
|
const cdpEndpoints = resolveCdpEndpoints();
|
|
1236
|
-
const
|
|
1236
|
+
const cdpTabsMap = new Map(); // dedupe by tab ID (multiple endpoints may return same tabs)
|
|
1237
1237
|
for (const endpoint of cdpEndpoints) {
|
|
1238
1238
|
try {
|
|
1239
1239
|
const tabs = await fetchJson(endpoint, 2000);
|
|
1240
1240
|
if (Array.isArray(tabs)) {
|
|
1241
1241
|
for (const t of tabs) {
|
|
1242
|
-
if (t.type === "page" && t.url
|
|
1242
|
+
if (t.type === "page" && t.url && t.id && !cdpTabsMap.has(t.id)) {
|
|
1243
|
+
cdpTabsMap.set(t.id, t);
|
|
1244
|
+
}
|
|
1243
1245
|
}
|
|
1244
1246
|
}
|
|
1245
1247
|
} catch { /* endpoint not reachable */ }
|
|
1246
1248
|
}
|
|
1249
|
+
const cdpTabs = [...cdpTabsMap.values()];
|
|
1247
1250
|
|
|
1248
1251
|
// Match CDP tabs with discovered browser candidates
|
|
1249
1252
|
for (const candidate of candidates) {
|
|
@@ -1257,7 +1260,7 @@ async function collectSpeakerCandidates({ include_cli = true, include_browser =
|
|
|
1257
1260
|
String(t.url || "").startsWith("chrome-extension://") &&
|
|
1258
1261
|
String(t.title || "").toLowerCase().includes(candidateTitle)
|
|
1259
1262
|
);
|
|
1260
|
-
if (matches.length
|
|
1263
|
+
if (matches.length >= 1) {
|
|
1261
1264
|
candidate.cdp_available = true;
|
|
1262
1265
|
candidate.cdp_tab_id = matches[0].id;
|
|
1263
1266
|
candidate.cdp_ws_url = matches[0].webSocketDebuggerUrl;
|
|
@@ -1275,7 +1278,7 @@ async function collectSpeakerCandidates({ include_cli = true, include_browser =
|
|
|
1275
1278
|
return new URL(t.url).hostname.toLowerCase() === candidateHost;
|
|
1276
1279
|
} catch { return false; }
|
|
1277
1280
|
});
|
|
1278
|
-
if (matches.length
|
|
1281
|
+
if (matches.length >= 1) {
|
|
1279
1282
|
candidate.cdp_available = true;
|
|
1280
1283
|
candidate.cdp_tab_id = matches[0].id;
|
|
1281
1284
|
candidate.cdp_ws_url = matches[0].webSocketDebuggerUrl;
|
package/package.json
CHANGED