unbrowse 6.2.3 → 6.2.5
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/dist/cli.js +1 -1
- package/dist/mcp.js +4 -4
- package/dist/server.js +56 -22
- package/package.json +1 -1
package/dist/cli.js
CHANGED
|
@@ -31,7 +31,7 @@ var __promiseAll = (args) => Promise.all(args);
|
|
|
31
31
|
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
32
32
|
|
|
33
33
|
// ../../src/build-info.generated.ts
|
|
34
|
-
var BUILD_RELEASE_VERSION = "6.2.
|
|
34
|
+
var BUILD_RELEASE_VERSION = "6.2.5", BUILD_GIT_SHA = "842fe8f374d6", BUILD_CODE_HASH = "5d9ebf619c61", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiNi4yLjUiLCJnaXRfc2hhIjoiODQyZmU4ZjM3NGQ2IiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUA4NDJmZThmMzc0ZDYiLCJpc3N1ZWRfYXQiOiIyMDI2LTA1LTAxVDAzOjE5OjI1LjE4OVoifQ", BUILD_RELEASE_MANIFEST_SIGNATURE = "qYak9fhJCHowq94BznDE7aDxbTn53oRrfywJe503s8M", BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
35
35
|
|
|
36
36
|
// ../../src/version.ts
|
|
37
37
|
import { createHash } from "crypto";
|
package/dist/mcp.js
CHANGED
|
@@ -226,11 +226,11 @@ import { dirname, join, parse } from "path";
|
|
|
226
226
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
227
227
|
|
|
228
228
|
// ../../src/build-info.generated.ts
|
|
229
|
-
var BUILD_RELEASE_VERSION = "6.2.
|
|
230
|
-
var BUILD_GIT_SHA = "
|
|
229
|
+
var BUILD_RELEASE_VERSION = "6.2.5";
|
|
230
|
+
var BUILD_GIT_SHA = "842fe8f374d6";
|
|
231
231
|
var BUILD_CODE_HASH = "5d9ebf619c61";
|
|
232
|
-
var BUILD_RELEASE_MANIFEST_BASE64 = "
|
|
233
|
-
var BUILD_RELEASE_MANIFEST_SIGNATURE = "
|
|
232
|
+
var BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiNi4yLjUiLCJnaXRfc2hhIjoiODQyZmU4ZjM3NGQ2IiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUA4NDJmZThmMzc0ZDYiLCJpc3N1ZWRfYXQiOiIyMDI2LTA1LTAxVDAzOjE5OjI1LjE4OVoifQ";
|
|
233
|
+
var BUILD_RELEASE_MANIFEST_SIGNATURE = "qYak9fhJCHowq94BznDE7aDxbTn53oRrfywJe503s8M";
|
|
234
234
|
var BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
235
235
|
|
|
236
236
|
// ../../src/version.ts
|
package/dist/server.js
CHANGED
|
@@ -7285,7 +7285,7 @@ var init_capture = __esm(async () => {
|
|
|
7285
7285
|
});
|
|
7286
7286
|
|
|
7287
7287
|
// ../../src/build-info.generated.ts
|
|
7288
|
-
var BUILD_RELEASE_VERSION = "6.2.
|
|
7288
|
+
var BUILD_RELEASE_VERSION = "6.2.5", BUILD_GIT_SHA = "842fe8f374d6", BUILD_CODE_HASH = "5d9ebf619c61", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiNi4yLjUiLCJnaXRfc2hhIjoiODQyZmU4ZjM3NGQ2IiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUA4NDJmZThmMzc0ZDYiLCJpc3N1ZWRfYXQiOiIyMDI2LTA1LTAxVDAzOjE5OjI1LjE4OVoifQ", BUILD_RELEASE_MANIFEST_SIGNATURE = "qYak9fhJCHowq94BznDE7aDxbTn53oRrfywJe503s8M", BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
7289
7289
|
|
|
7290
7290
|
// ../../src/version.ts
|
|
7291
7291
|
import { createHash as createHash2 } from "crypto";
|
|
@@ -17561,21 +17561,30 @@ async function executeEndpoint(skill, endpoint, params = {}, projection, options
|
|
|
17561
17561
|
]);
|
|
17562
17562
|
let diffCount = 0;
|
|
17563
17563
|
let diffIdx = -1;
|
|
17564
|
+
const diffIndices = [];
|
|
17564
17565
|
for (let i = 0;i < capSegs.length; i++) {
|
|
17565
17566
|
if (capSegs[i].toLowerCase() === ctxSegs[i].toLowerCase())
|
|
17566
17567
|
continue;
|
|
17567
17568
|
diffCount += 1;
|
|
17568
17569
|
diffIdx = i;
|
|
17570
|
+
diffIndices.push(i);
|
|
17569
17571
|
}
|
|
17570
|
-
if (diffCount
|
|
17571
|
-
const
|
|
17572
|
-
|
|
17573
|
-
|
|
17574
|
-
|
|
17575
|
-
|
|
17572
|
+
if (diffCount >= 1) {
|
|
17573
|
+
const allEntityShaped = diffIndices.every((i) => {
|
|
17574
|
+
const a = capSegs[i].toLowerCase();
|
|
17575
|
+
const b = ctxSegs[i].toLowerCase();
|
|
17576
|
+
const aEntity = !SHARED.has(a) && a.length >= 3 && !/^\d+$/.test(a);
|
|
17577
|
+
const bEntity = !SHARED.has(b) && b.length >= 3 && !/^\d+$/.test(b);
|
|
17578
|
+
return aEntity && bEntity;
|
|
17579
|
+
});
|
|
17580
|
+
if (allEntityShaped) {
|
|
17576
17581
|
const newPathname = ctx.pathname;
|
|
17577
17582
|
const rewritten = `${cap.protocol}//${cap.hostname}${cap.port ? `:${cap.port}` : ""}${newPathname}${cap.search}${cap.hash}`;
|
|
17578
|
-
|
|
17583
|
+
if (diffCount === 1) {
|
|
17584
|
+
log("exec", `A8 entity-substitute: ${capSegs[diffIdx]} → ${ctxSegs[diffIdx]} on ${cap.hostname}`);
|
|
17585
|
+
} else {
|
|
17586
|
+
log("exec", `A8 multi-entity-substitute: ${diffCount} segments on ${cap.hostname} (${diffIndices.map((i) => `${capSegs[i]}→${ctxSegs[i]}`).join(", ")})`);
|
|
17587
|
+
}
|
|
17579
17588
|
url = rewritten;
|
|
17580
17589
|
}
|
|
17581
17590
|
}
|
|
@@ -17808,8 +17817,21 @@ async function executeEndpoint(skill, endpoint, params = {}, projection, options
|
|
|
17808
17817
|
} catch {}
|
|
17809
17818
|
}
|
|
17810
17819
|
result = await triggerAndIntercept(triggerUrl, endpoint.url_template, cookies, authHeaders);
|
|
17811
|
-
|
|
17812
|
-
|
|
17820
|
+
const isSelfFetchableFirst = endpoint.method === "GET" && /\.(json)(\?|$)|\/api\//i.test(url);
|
|
17821
|
+
if (result.status === 0 && isSelfFetchableFirst) {
|
|
17822
|
+
log("exec", `trigger-intercept timed out; trying serverFetch for self-fetchable ${url}`);
|
|
17823
|
+
result = await serverFetch(workflowBindings?.extraHeaders, workflowBindings?.bodyOverride);
|
|
17824
|
+
if (result.status >= 200 && result.status < 400) {
|
|
17825
|
+
strategy = "server";
|
|
17826
|
+
workflowChosenStrategy = "server";
|
|
17827
|
+
} else {
|
|
17828
|
+
strategy = "trigger-intercept";
|
|
17829
|
+
workflowChosenStrategy = "trigger-intercept";
|
|
17830
|
+
}
|
|
17831
|
+
} else {
|
|
17832
|
+
strategy = "trigger-intercept";
|
|
17833
|
+
workflowChosenStrategy = "trigger-intercept";
|
|
17834
|
+
}
|
|
17813
17835
|
} else {
|
|
17814
17836
|
result = await withRetry(browserCall, (r) => isRetryableStatus(r.status));
|
|
17815
17837
|
strategy = "browser";
|
|
@@ -17839,8 +17861,18 @@ async function executeEndpoint(skill, endpoint, params = {}, projection, options
|
|
|
17839
17861
|
}
|
|
17840
17862
|
log("exec", `using learned strategy trigger-intercept via ${triggerUrl}`);
|
|
17841
17863
|
result = await triggerAndIntercept(triggerUrl, endpoint.url_template, cookies, authHeaders);
|
|
17842
|
-
|
|
17843
|
-
|
|
17864
|
+
const isSelfFetchable = endpoint.method === "GET" && /\.(json)(\?|$)|\/api\//i.test(url);
|
|
17865
|
+
if (result.status === 0 && isSelfFetchable) {
|
|
17866
|
+
log("exec", `trigger-intercept timed out; trying serverFetch for self-fetchable ${url}`);
|
|
17867
|
+
result = await serverFetch(workflowBindings?.extraHeaders, workflowBindings?.bodyOverride);
|
|
17868
|
+
if (result.status >= 200 && result.status < 400) {
|
|
17869
|
+
strategy = "server";
|
|
17870
|
+
workflowChosenStrategy = "server";
|
|
17871
|
+
}
|
|
17872
|
+
} else {
|
|
17873
|
+
strategy = "trigger-intercept";
|
|
17874
|
+
workflowChosenStrategy = "trigger-intercept";
|
|
17875
|
+
}
|
|
17844
17876
|
} else if (endpointStrategy === "browser") {
|
|
17845
17877
|
if (shouldIgnoreLearnedBrowserStrategy(endpoint, url)) {
|
|
17846
17878
|
result = await serverFetch(workflowBindings?.extraHeaders, workflowBindings?.bodyOverride);
|
|
@@ -21929,22 +21961,24 @@ async function resolveAndExecute(intent, params = {}, context, projection, optio
|
|
|
21929
21961
|
const xs = ctx.pathname.split("/").filter(Boolean);
|
|
21930
21962
|
if (cs.length !== xs.length || cs.length === 0)
|
|
21931
21963
|
continue;
|
|
21932
|
-
let diffCount = 0
|
|
21964
|
+
let diffCount = 0;
|
|
21965
|
+
const diffIndices = [];
|
|
21933
21966
|
for (let i = 0;i < cs.length; i++) {
|
|
21934
21967
|
if (cs[i].toLowerCase() === xs[i].toLowerCase())
|
|
21935
21968
|
continue;
|
|
21936
21969
|
diffCount += 1;
|
|
21937
|
-
|
|
21970
|
+
diffIndices.push(i);
|
|
21938
21971
|
}
|
|
21939
|
-
if (diffCount
|
|
21972
|
+
if (diffCount === 0)
|
|
21940
21973
|
continue;
|
|
21941
|
-
const
|
|
21942
|
-
|
|
21943
|
-
|
|
21944
|
-
|
|
21945
|
-
|
|
21946
|
-
|
|
21947
|
-
|
|
21974
|
+
const allEntityShaped = diffIndices.every((i) => {
|
|
21975
|
+
const a = cs[i].toLowerCase();
|
|
21976
|
+
const b = xs[i].toLowerCase();
|
|
21977
|
+
const aOk = !A8_SHARED.has(a) && a.length >= 3 && !/^\d+$/.test(a);
|
|
21978
|
+
const bOk = !A8_SHARED.has(b) && b.length >= 3 && !/^\d+$/.test(b);
|
|
21979
|
+
return aOk && bOk;
|
|
21980
|
+
});
|
|
21981
|
+
if (!allEntityShaped)
|
|
21948
21982
|
continue;
|
|
21949
21983
|
op.url_template = `${cap.protocol}//${cap.hostname}${cap.port ? `:${cap.port}` : ""}${ctx.pathname}${cap.search}${cap.hash}`;
|
|
21950
21984
|
} catch {}
|