unbrowse 3.5.0 → 3.5.2
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 +173 -43
- package/dist/mcp.js +5 -5
- package/dist/server.js +27 -12
- 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 = "3.5.
|
|
34
|
+
var BUILD_RELEASE_VERSION = "3.5.2", BUILD_GIT_SHA = "e127b1b897ab", BUILD_CODE_HASH = "5d9ebf619c61", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy41LjIiLCJnaXRfc2hhIjoiZTEyN2IxYjg5N2FiIiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUBlMTI3YjFiODk3YWIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA5VDE3OjQ2OjAyLjE1NVoifQ", BUILD_RELEASE_MANIFEST_SIGNATURE = "ikYTrNqqCeeJZL-NVi1xUe95K8AHkk2hzdOXvhEepgQ", BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
35
35
|
|
|
36
36
|
// ../../src/version.ts
|
|
37
37
|
import { createHash } from "crypto";
|
|
@@ -1264,6 +1264,16 @@ var init_routing_telemetry = __esm(() => {
|
|
|
1264
1264
|
import { nanoid as nanoid9 } from "nanoid";
|
|
1265
1265
|
import { existsSync as existsSync10, writeFileSync as writeFileSync3, readFileSync as readFileSync6, mkdirSync as mkdirSync5, readdirSync as readdirSync3 } from "node:fs";
|
|
1266
1266
|
import { dirname as dirname3, join as join9 } from "node:path";
|
|
1267
|
+
function _writeRouteCacheToDisk() {
|
|
1268
|
+
try {
|
|
1269
|
+
const dir = dirname3(ROUTE_CACHE_FILE);
|
|
1270
|
+
if (!existsSync10(dir))
|
|
1271
|
+
mkdirSync5(dir, { recursive: true });
|
|
1272
|
+
const entries = Object.fromEntries(skillRouteCache);
|
|
1273
|
+
writeFileSync3(ROUTE_CACHE_FILE, JSON.stringify(entries), "utf-8");
|
|
1274
|
+
} catch {}
|
|
1275
|
+
_routeCacheDirty = false;
|
|
1276
|
+
}
|
|
1267
1277
|
var LIVE_CAPTURE_TIMEOUT_MS, capturedDomainCache, captureInFlight, captureDomainLocks, skillRouteCache, ROUTE_CACHE_FILE, SKILL_SNAPSHOT_DIR2, domainSkillCache, DOMAIN_CACHE_FILE, _routeCacheDirty = false, routeCacheFlushTimer, routeResultCache, ROUTE_CACHE_TTL, MARKETPLACE_HYDRATE_LIMIT, MARKETPLACE_GET_SKILL_TIMEOUT_MS, MARKETPLACE_DOMAIN_SEARCH_K, MARKETPLACE_GLOBAL_SEARCH_K, SEARCH_INTENT_STOPWORDS;
|
|
1268
1278
|
var init_orchestrator = __esm(async () => {
|
|
1269
1279
|
init_client();
|
|
@@ -1312,14 +1322,7 @@ var init_orchestrator = __esm(async () => {
|
|
|
1312
1322
|
routeCacheFlushTimer = setInterval(() => {
|
|
1313
1323
|
if (!_routeCacheDirty)
|
|
1314
1324
|
return;
|
|
1315
|
-
|
|
1316
|
-
try {
|
|
1317
|
-
const dir = dirname3(ROUTE_CACHE_FILE);
|
|
1318
|
-
if (!existsSync10(dir))
|
|
1319
|
-
mkdirSync5(dir, { recursive: true });
|
|
1320
|
-
const entries = Object.fromEntries(skillRouteCache);
|
|
1321
|
-
writeFileSync3(ROUTE_CACHE_FILE, JSON.stringify(entries), "utf-8");
|
|
1322
|
-
} catch {}
|
|
1325
|
+
_writeRouteCacheToDisk();
|
|
1323
1326
|
}, 5000);
|
|
1324
1327
|
routeCacheFlushTimer.unref?.();
|
|
1325
1328
|
try {
|
|
@@ -1468,6 +1471,131 @@ function checkWalletConfigured2() {
|
|
|
1468
1471
|
}
|
|
1469
1472
|
var init_wallet2 = () => {};
|
|
1470
1473
|
|
|
1474
|
+
// ../../src/version.ts
|
|
1475
|
+
var exports_version = {};
|
|
1476
|
+
__export(exports_version, {
|
|
1477
|
+
resolveCodeHashSourceDir: () => resolveCodeHashSourceDir2,
|
|
1478
|
+
getPackageVersionForModuleDir: () => getPackageVersionForModuleDir2,
|
|
1479
|
+
getEmbeddedReleaseVersion: () => getEmbeddedReleaseVersion2,
|
|
1480
|
+
computeCodeHashForDir: () => computeCodeHashForDir2,
|
|
1481
|
+
TRACE_VERSION: () => TRACE_VERSION2,
|
|
1482
|
+
RELEASE_MANIFEST_SIGNATURE: () => RELEASE_MANIFEST_SIGNATURE2,
|
|
1483
|
+
RELEASE_MANIFEST_BASE64: () => RELEASE_MANIFEST_BASE642,
|
|
1484
|
+
PACKAGE_VERSION: () => PACKAGE_VERSION2,
|
|
1485
|
+
GIT_SHA: () => GIT_SHA2,
|
|
1486
|
+
DEFAULT_BACKEND_URL: () => DEFAULT_BACKEND_URL2,
|
|
1487
|
+
CODE_HASH: () => CODE_HASH2
|
|
1488
|
+
});
|
|
1489
|
+
import { createHash as createHash3 } from "crypto";
|
|
1490
|
+
import { existsSync as existsSync15, readFileSync as readFileSync10, readdirSync as readdirSync4 } from "fs";
|
|
1491
|
+
import { dirname as dirname4, join as join12, parse as parse2 } from "path";
|
|
1492
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
1493
|
+
function collectTsFiles2(dir) {
|
|
1494
|
+
const results = [];
|
|
1495
|
+
for (const entry of readdirSync4(dir, { withFileTypes: true })) {
|
|
1496
|
+
const full = join12(dir, entry.name);
|
|
1497
|
+
if (entry.isDirectory() && entry.name !== "node_modules") {
|
|
1498
|
+
results.push(...collectTsFiles2(full));
|
|
1499
|
+
} else if (entry.name.endsWith(".ts")) {
|
|
1500
|
+
results.push(full);
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
return results;
|
|
1504
|
+
}
|
|
1505
|
+
function hashFiles2(srcDir, files) {
|
|
1506
|
+
const hash = createHash3("sha256");
|
|
1507
|
+
for (const file of files) {
|
|
1508
|
+
hash.update(file.slice(srcDir.length));
|
|
1509
|
+
hash.update(readFileSync10(file, "utf-8"));
|
|
1510
|
+
}
|
|
1511
|
+
return hash.digest("hex").slice(0, 12);
|
|
1512
|
+
}
|
|
1513
|
+
function resolveCodeHashSourceDir2(moduleDir) {
|
|
1514
|
+
const candidates = [
|
|
1515
|
+
moduleDir,
|
|
1516
|
+
join12(moduleDir, "runtime-src"),
|
|
1517
|
+
join12(moduleDir, "..", "runtime-src"),
|
|
1518
|
+
join12(moduleDir, "src"),
|
|
1519
|
+
join12(moduleDir, "..", "src")
|
|
1520
|
+
];
|
|
1521
|
+
for (const candidate of candidates) {
|
|
1522
|
+
try {
|
|
1523
|
+
if (!existsSync15(candidate))
|
|
1524
|
+
continue;
|
|
1525
|
+
const files = collectTsFiles2(candidate);
|
|
1526
|
+
if (files.length > 0)
|
|
1527
|
+
return candidate;
|
|
1528
|
+
} catch {}
|
|
1529
|
+
}
|
|
1530
|
+
return null;
|
|
1531
|
+
}
|
|
1532
|
+
function computeCodeHashForDir2(srcDir) {
|
|
1533
|
+
const files = collectTsFiles2(srcDir).sort();
|
|
1534
|
+
if (files.length === 0)
|
|
1535
|
+
throw new Error(`No TypeScript sources found in ${srcDir}`);
|
|
1536
|
+
return hashFiles2(srcDir, files);
|
|
1537
|
+
}
|
|
1538
|
+
function computeCodeHash2() {
|
|
1539
|
+
try {
|
|
1540
|
+
const srcDir = resolveCodeHashSourceDir2(MODULE_DIR2);
|
|
1541
|
+
if (srcDir)
|
|
1542
|
+
return computeCodeHashForDir2(srcDir);
|
|
1543
|
+
} catch {}
|
|
1544
|
+
const pkgVersion = getPackageVersion2();
|
|
1545
|
+
if (pkgVersion !== "unknown") {
|
|
1546
|
+
return createHash3("sha256").update(`package:${pkgVersion}`).digest("hex").slice(0, 12);
|
|
1547
|
+
}
|
|
1548
|
+
return "compiled";
|
|
1549
|
+
}
|
|
1550
|
+
function getGitSha2() {
|
|
1551
|
+
return BUILD_GIT_SHA?.trim() || "unknown";
|
|
1552
|
+
}
|
|
1553
|
+
function decodeBase64UrlJson2(value) {
|
|
1554
|
+
try {
|
|
1555
|
+
if (!value)
|
|
1556
|
+
return null;
|
|
1557
|
+
return JSON.parse(Buffer.from(value, "base64url").toString("utf-8"));
|
|
1558
|
+
} catch {
|
|
1559
|
+
return null;
|
|
1560
|
+
}
|
|
1561
|
+
}
|
|
1562
|
+
function getEmbeddedReleaseVersion2() {
|
|
1563
|
+
if (BUILD_RELEASE_VERSION?.trim())
|
|
1564
|
+
return BUILD_RELEASE_VERSION.trim();
|
|
1565
|
+
const manifest = decodeBase64UrlJson2(BUILD_RELEASE_MANIFEST_BASE64?.trim() || "");
|
|
1566
|
+
return typeof manifest?.release_version === "string" && manifest.release_version.trim() ? manifest.release_version.trim() : null;
|
|
1567
|
+
}
|
|
1568
|
+
function getPackageVersionForModuleDir2(moduleDir) {
|
|
1569
|
+
let dir = moduleDir;
|
|
1570
|
+
const root = parse2(dir).root;
|
|
1571
|
+
while (true) {
|
|
1572
|
+
try {
|
|
1573
|
+
const pkg = JSON.parse(readFileSync10(join12(dir, "package.json"), "utf-8"));
|
|
1574
|
+
return typeof pkg.version === "string" ? pkg.version : "unknown";
|
|
1575
|
+
} catch {}
|
|
1576
|
+
if (dir === root)
|
|
1577
|
+
return "unknown";
|
|
1578
|
+
dir = dirname4(dir);
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
function getPackageVersion2() {
|
|
1582
|
+
const packageVersion = getPackageVersionForModuleDir2(MODULE_DIR2);
|
|
1583
|
+
if (packageVersion !== "unknown")
|
|
1584
|
+
return packageVersion;
|
|
1585
|
+
return getEmbeddedReleaseVersion2() ?? "unknown";
|
|
1586
|
+
}
|
|
1587
|
+
var MODULE_DIR2, CODE_HASH2, GIT_SHA2, PACKAGE_VERSION2, DEFAULT_BACKEND_URL2, TRACE_VERSION2, RELEASE_MANIFEST_BASE642, RELEASE_MANIFEST_SIGNATURE2;
|
|
1588
|
+
var init_version2 = __esm(() => {
|
|
1589
|
+
MODULE_DIR2 = dirname4(fileURLToPath4(import.meta.url));
|
|
1590
|
+
CODE_HASH2 = BUILD_CODE_HASH?.trim() || computeCodeHash2();
|
|
1591
|
+
GIT_SHA2 = getGitSha2();
|
|
1592
|
+
PACKAGE_VERSION2 = getPackageVersion2();
|
|
1593
|
+
DEFAULT_BACKEND_URL2 = BUILD_DEFAULT_BACKEND_URL?.trim() || "https://beta-api.unbrowse.ai";
|
|
1594
|
+
TRACE_VERSION2 = `${CODE_HASH2}@${GIT_SHA2}`;
|
|
1595
|
+
RELEASE_MANIFEST_BASE642 = BUILD_RELEASE_MANIFEST_BASE64?.trim() || "";
|
|
1596
|
+
RELEASE_MANIFEST_SIGNATURE2 = BUILD_RELEASE_MANIFEST_SIGNATURE?.trim() || "";
|
|
1597
|
+
});
|
|
1598
|
+
|
|
1471
1599
|
// ../../src/auth/agent-mail.ts
|
|
1472
1600
|
var exports_agent_mail = {};
|
|
1473
1601
|
__export(exports_agent_mail, {
|
|
@@ -1594,19 +1722,19 @@ __export(exports_browser_cookies, {
|
|
|
1594
1722
|
});
|
|
1595
1723
|
import { execFileSync as execFileSync4 } from "node:child_process";
|
|
1596
1724
|
import { createDecipheriv, pbkdf2Sync } from "node:crypto";
|
|
1597
|
-
import { copyFileSync, existsSync as
|
|
1725
|
+
import { copyFileSync, existsSync as existsSync16, mkdtempSync, readdirSync as readdirSync5, rmSync } from "node:fs";
|
|
1598
1726
|
import { tmpdir, homedir as homedir7, platform } from "node:os";
|
|
1599
|
-
import { join as
|
|
1727
|
+
import { join as join13 } from "node:path";
|
|
1600
1728
|
function getChromeUserDataDir() {
|
|
1601
1729
|
const home = homedir7();
|
|
1602
1730
|
if (platform() === "darwin") {
|
|
1603
|
-
return
|
|
1731
|
+
return join13(home, "Library", "Application Support", "Google", "Chrome");
|
|
1604
1732
|
}
|
|
1605
1733
|
if (platform() === "win32") {
|
|
1606
|
-
const appData = process.env.LOCALAPPDATA ??
|
|
1607
|
-
return
|
|
1734
|
+
const appData = process.env.LOCALAPPDATA ?? join13(home, "AppData", "Local");
|
|
1735
|
+
return join13(appData, "Google", "Chrome", "User Data");
|
|
1608
1736
|
}
|
|
1609
|
-
return
|
|
1737
|
+
return join13(home, ".config", "google-chrome");
|
|
1610
1738
|
}
|
|
1611
1739
|
function resolveChromiumCookiesPath(opts) {
|
|
1612
1740
|
if (opts?.cookieDbPath) {
|
|
@@ -1615,45 +1743,45 @@ function resolveChromiumCookiesPath(opts) {
|
|
|
1615
1743
|
const profileDir = opts?.profile || "Default";
|
|
1616
1744
|
const userDataDir = (opts?.userDataDir || getChromeUserDataDir()).replace(/^~\//, homedir7() + "/");
|
|
1617
1745
|
const candidates = [
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1746
|
+
join13(userDataDir, profileDir, "Network", "Cookies"),
|
|
1747
|
+
join13(userDataDir, profileDir, "Cookies"),
|
|
1748
|
+
join13(userDataDir, "Network", "Cookies"),
|
|
1749
|
+
join13(userDataDir, "Cookies")
|
|
1622
1750
|
];
|
|
1623
|
-
return candidates.find((candidate) =>
|
|
1751
|
+
return candidates.find((candidate) => existsSync16(candidate)) ?? candidates[0] ?? null;
|
|
1624
1752
|
}
|
|
1625
1753
|
function getFirefoxProfilesRoot() {
|
|
1626
1754
|
const home = homedir7();
|
|
1627
1755
|
if (platform() === "darwin") {
|
|
1628
|
-
return
|
|
1756
|
+
return join13(home, "Library", "Application Support", "Firefox", "Profiles");
|
|
1629
1757
|
}
|
|
1630
1758
|
if (platform() === "linux") {
|
|
1631
|
-
return
|
|
1759
|
+
return join13(home, ".mozilla", "firefox");
|
|
1632
1760
|
}
|
|
1633
1761
|
if (platform() === "win32") {
|
|
1634
1762
|
const appData = process.env.APPDATA;
|
|
1635
1763
|
if (!appData)
|
|
1636
1764
|
return null;
|
|
1637
|
-
return
|
|
1765
|
+
return join13(appData, "Mozilla", "Firefox", "Profiles");
|
|
1638
1766
|
}
|
|
1639
1767
|
return null;
|
|
1640
1768
|
}
|
|
1641
1769
|
function pickFirefoxProfile(profilesRoot, profile) {
|
|
1642
1770
|
if (profile) {
|
|
1643
|
-
const candidate2 =
|
|
1644
|
-
return
|
|
1771
|
+
const candidate2 = join13(profilesRoot, profile, "cookies.sqlite");
|
|
1772
|
+
return existsSync16(candidate2) ? candidate2 : null;
|
|
1645
1773
|
}
|
|
1646
|
-
const entries =
|
|
1774
|
+
const entries = readdirSync5(profilesRoot, { withFileTypes: true });
|
|
1647
1775
|
const defaultRelease = entries.find((e) => e.isDirectory() && e.name.includes("default-release"));
|
|
1648
1776
|
const targetDir = defaultRelease?.name ?? entries.find((e) => e.isDirectory())?.name;
|
|
1649
1777
|
if (!targetDir)
|
|
1650
1778
|
return null;
|
|
1651
|
-
const candidate =
|
|
1652
|
-
return
|
|
1779
|
+
const candidate = join13(profilesRoot, targetDir, "cookies.sqlite");
|
|
1780
|
+
return existsSync16(candidate) ? candidate : null;
|
|
1653
1781
|
}
|
|
1654
1782
|
function getFirefoxCookiesPath(profile) {
|
|
1655
1783
|
const profilesRoot = getFirefoxProfilesRoot();
|
|
1656
|
-
if (!profilesRoot || !
|
|
1784
|
+
if (!profilesRoot || !existsSync16(profilesRoot))
|
|
1657
1785
|
return null;
|
|
1658
1786
|
return pickFirefoxProfile(profilesRoot, profile);
|
|
1659
1787
|
}
|
|
@@ -1722,13 +1850,13 @@ function decodeChromiumCookieValue(rawValue, encryptedHex, opts) {
|
|
|
1722
1850
|
return decryptChromiumValue(encryptedHex, opts);
|
|
1723
1851
|
}
|
|
1724
1852
|
function withTempCopy(dbPath, fn) {
|
|
1725
|
-
const tempDir = mkdtempSync(
|
|
1726
|
-
const tempDb =
|
|
1853
|
+
const tempDir = mkdtempSync(join13(tmpdir(), "unbrowse-cookies-"));
|
|
1854
|
+
const tempDb = join13(tempDir, "cookies.db");
|
|
1727
1855
|
try {
|
|
1728
1856
|
copyFileSync(dbPath, tempDb);
|
|
1729
1857
|
for (const ext of ["-wal", "-shm"]) {
|
|
1730
1858
|
const src = dbPath + ext;
|
|
1731
|
-
if (
|
|
1859
|
+
if (existsSync16(src))
|
|
1732
1860
|
copyFileSync(src, tempDb + ext);
|
|
1733
1861
|
}
|
|
1734
1862
|
return fn(tempDb);
|
|
@@ -1773,7 +1901,7 @@ function extractFromChromium(domain, opts) {
|
|
|
1773
1901
|
const warnings = [];
|
|
1774
1902
|
const dbPath = resolveChromiumCookiesPath(opts);
|
|
1775
1903
|
const sourceLabel = opts?.browserName || "Chromium";
|
|
1776
|
-
if (!dbPath || !
|
|
1904
|
+
if (!dbPath || !existsSync16(dbPath)) {
|
|
1777
1905
|
warnings.push(`${sourceLabel} cookies DB not found${dbPath ? ` at ${dbPath}` : ""}`);
|
|
1778
1906
|
return { cookies: [], source: null, warnings };
|
|
1779
1907
|
}
|
|
@@ -1891,8 +2019,8 @@ function scanAllBrowserSessions(domain) {
|
|
|
1891
2019
|
const results = [];
|
|
1892
2020
|
const home = homedir7();
|
|
1893
2021
|
for (const browser of CHROMIUM_BROWSERS) {
|
|
1894
|
-
const userDataDir = platform() === "darwin" ?
|
|
1895
|
-
if (!
|
|
2022
|
+
const userDataDir = platform() === "darwin" ? join13(home, "Library", "Application Support", browser.macPath) : platform() === "win32" ? join13(process.env.LOCALAPPDATA ?? join13(home, "AppData", "Local"), browser.macPath, "User Data") : join13(home, ".config", browser.macPath.toLowerCase());
|
|
2023
|
+
if (!existsSync16(userDataDir))
|
|
1896
2024
|
continue;
|
|
1897
2025
|
try {
|
|
1898
2026
|
const result = extractFromChromium(domain, {
|
|
@@ -4913,7 +5041,9 @@ async function cmdEarnings(flags) {
|
|
|
4913
5041
|
die("No API key found. Run `unbrowse setup` first.");
|
|
4914
5042
|
}
|
|
4915
5043
|
try {
|
|
4916
|
-
const
|
|
5044
|
+
const { DEFAULT_BACKEND_URL: DEFAULT_BACKEND_URL3 } = await Promise.resolve().then(() => (init_version2(), exports_version));
|
|
5045
|
+
const backendUrl = process.env.UNBROWSE_BACKEND_URL || DEFAULT_BACKEND_URL3;
|
|
5046
|
+
const resp = await fetch(`${backendUrl}/v1/credits/balance`, {
|
|
4917
5047
|
headers: { Authorization: `Bearer ${apiKey}` }
|
|
4918
5048
|
});
|
|
4919
5049
|
if (!resp.ok) {
|
|
@@ -5339,7 +5469,7 @@ async function cmdLoginAuto(flags) {
|
|
|
5339
5469
|
async function cmdSessionsScan(flags) {
|
|
5340
5470
|
const domain = flags.domain;
|
|
5341
5471
|
const { scanAllBrowserSessions: scanAllBrowserSessions2, findBestBrowserSession: findBestBrowserSession2 } = await Promise.resolve().then(() => (init_browser_cookies(), exports_browser_cookies));
|
|
5342
|
-
const { execFileSync: execFileSync5, existsSync:
|
|
5472
|
+
const { execFileSync: execFileSync5, existsSync: existsSync17 } = await import("./cli-imports.js").catch(() => ({ execFileSync: __require("child_process").execFileSync, existsSync: __require("fs").existsSync }));
|
|
5343
5473
|
if (domain) {
|
|
5344
5474
|
const sessions = scanAllBrowserSessions2(domain);
|
|
5345
5475
|
if (sessions.length === 0) {
|
|
@@ -5361,13 +5491,13 @@ async function cmdSessionsScan(flags) {
|
|
|
5361
5491
|
return;
|
|
5362
5492
|
}
|
|
5363
5493
|
const home = __require("os").homedir();
|
|
5364
|
-
const { join:
|
|
5494
|
+
const { join: join14 } = __require("path");
|
|
5365
5495
|
const browsers = [
|
|
5366
|
-
{ name: "Chrome", path:
|
|
5367
|
-
{ name: "Dia", path:
|
|
5368
|
-
{ name: "Arc", path:
|
|
5369
|
-
{ name: "Brave", path:
|
|
5370
|
-
{ name: "Edge", path:
|
|
5496
|
+
{ name: "Chrome", path: join14(home, "Library/Application Support/Google/Chrome/Default/Cookies") },
|
|
5497
|
+
{ name: "Dia", path: join14(home, "Library/Application Support/Dia/User Data/Default/Cookies") },
|
|
5498
|
+
{ name: "Arc", path: join14(home, "Library/Application Support/Arc/User Data/Default/Cookies") },
|
|
5499
|
+
{ name: "Brave", path: join14(home, "Library/Application Support/BraveSoftware/Brave-Browser/Default/Cookies") },
|
|
5500
|
+
{ name: "Edge", path: join14(home, "Library/Application Support/Microsoft Edge/Default/Cookies") }
|
|
5371
5501
|
];
|
|
5372
5502
|
const allSessions = [];
|
|
5373
5503
|
for (const b of browsers) {
|
package/dist/mcp.js
CHANGED
|
@@ -225,11 +225,11 @@ import { dirname, join, parse } from "path";
|
|
|
225
225
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
226
226
|
|
|
227
227
|
// ../../src/build-info.generated.ts
|
|
228
|
-
var BUILD_RELEASE_VERSION = "3.5.
|
|
229
|
-
var BUILD_GIT_SHA = "
|
|
230
|
-
var BUILD_CODE_HASH = "
|
|
231
|
-
var BUILD_RELEASE_MANIFEST_BASE64 = "
|
|
232
|
-
var BUILD_RELEASE_MANIFEST_SIGNATURE = "
|
|
228
|
+
var BUILD_RELEASE_VERSION = "3.5.2";
|
|
229
|
+
var BUILD_GIT_SHA = "e127b1b897ab";
|
|
230
|
+
var BUILD_CODE_HASH = "5d9ebf619c61";
|
|
231
|
+
var BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy41LjIiLCJnaXRfc2hhIjoiZTEyN2IxYjg5N2FiIiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUBlMTI3YjFiODk3YWIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA5VDE3OjQ2OjAyLjE1NVoifQ";
|
|
232
|
+
var BUILD_RELEASE_MANIFEST_SIGNATURE = "ikYTrNqqCeeJZL-NVi1xUe95K8AHkk2hzdOXvhEepgQ";
|
|
233
233
|
var BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
234
234
|
|
|
235
235
|
// ../../src/version.ts
|
package/dist/server.js
CHANGED
|
@@ -5770,23 +5770,28 @@ function mergePassiveCaptureData(intercepted, harEntries, extensionEntries, resp
|
|
|
5770
5770
|
const respHeaders = {};
|
|
5771
5771
|
for (const h of entry.responseHeaders ?? [])
|
|
5772
5772
|
respHeaders[h.name] = h.value;
|
|
5773
|
+
const dedupKey = graphqlDedup(entry.url, entry.requestBody);
|
|
5773
5774
|
let merged = false;
|
|
5774
5775
|
for (const [key, existing] of seen) {
|
|
5775
|
-
if (existing.url === entry.url) {
|
|
5776
|
+
if (existing.url === entry.url || key === dedupKey) {
|
|
5776
5777
|
for (const [k, v] of Object.entries(reqHeaders)) {
|
|
5777
5778
|
if (!existing.request_headers[k])
|
|
5778
5779
|
existing.request_headers[k] = v;
|
|
5779
5780
|
}
|
|
5781
|
+
if (!existing.request_body && entry.requestBody) {
|
|
5782
|
+
existing.request_body = entry.requestBody;
|
|
5783
|
+
}
|
|
5780
5784
|
merged = true;
|
|
5781
5785
|
break;
|
|
5782
5786
|
}
|
|
5783
5787
|
}
|
|
5784
5788
|
if (merged)
|
|
5785
5789
|
continue;
|
|
5786
|
-
seen.set(
|
|
5790
|
+
seen.set(dedupKey, {
|
|
5787
5791
|
url: entry.url,
|
|
5788
5792
|
method: entry.method,
|
|
5789
5793
|
request_headers: reqHeaders,
|
|
5794
|
+
request_body: entry.requestBody,
|
|
5790
5795
|
response_status: entry.statusCode ?? 0,
|
|
5791
5796
|
response_headers: respHeaders,
|
|
5792
5797
|
response_body: responseBodies.get(entry.url),
|
|
@@ -7091,7 +7096,7 @@ var init_capture = __esm(async () => {
|
|
|
7091
7096
|
});
|
|
7092
7097
|
|
|
7093
7098
|
// ../../src/build-info.generated.ts
|
|
7094
|
-
var BUILD_RELEASE_VERSION = "3.5.
|
|
7099
|
+
var BUILD_RELEASE_VERSION = "3.5.2", BUILD_GIT_SHA = "e127b1b897ab", BUILD_CODE_HASH = "5d9ebf619c61", BUILD_RELEASE_MANIFEST_BASE64 = "eyJzY2hlbWFfdmVyc2lvbiI6MSwicmVsZWFzZV92ZXJzaW9uIjoiMy41LjIiLCJnaXRfc2hhIjoiZTEyN2IxYjg5N2FiIiwiY29kZV9oYXNoIjoiNWQ5ZWJmNjE5YzYxIiwidHJhY2VfdmVyc2lvbiI6IjVkOWViZjYxOWM2MUBlMTI3YjFiODk3YWIiLCJpc3N1ZWRfYXQiOiIyMDI2LTA0LTA5VDE3OjQ2OjAyLjE1NVoifQ", BUILD_RELEASE_MANIFEST_SIGNATURE = "ikYTrNqqCeeJZL-NVi1xUe95K8AHkk2hzdOXvhEepgQ", BUILD_DEFAULT_BACKEND_URL = "https://beta-api.unbrowse.ai";
|
|
7095
7100
|
|
|
7096
7101
|
// ../../src/version.ts
|
|
7097
7102
|
import { createHash } from "crypto";
|
|
@@ -19009,9 +19014,22 @@ function persistDomainCache() {
|
|
|
19009
19014
|
writeFileSync8(DOMAIN_CACHE_FILE, JSON.stringify(Object.fromEntries(domainSkillCache)), "utf-8");
|
|
19010
19015
|
} catch {}
|
|
19011
19016
|
}
|
|
19017
|
+
function _writeRouteCacheToDisk() {
|
|
19018
|
+
try {
|
|
19019
|
+
const dir = dirname2(ROUTE_CACHE_FILE);
|
|
19020
|
+
if (!existsSync13(dir))
|
|
19021
|
+
mkdirSync9(dir, { recursive: true });
|
|
19022
|
+
const entries = Object.fromEntries(skillRouteCache);
|
|
19023
|
+
writeFileSync8(ROUTE_CACHE_FILE, JSON.stringify(entries), "utf-8");
|
|
19024
|
+
} catch {}
|
|
19025
|
+
_routeCacheDirty = false;
|
|
19026
|
+
}
|
|
19012
19027
|
function persistRouteCache() {
|
|
19013
19028
|
_routeCacheDirty = true;
|
|
19014
19029
|
}
|
|
19030
|
+
function flushRouteCacheSync() {
|
|
19031
|
+
_writeRouteCacheToDisk();
|
|
19032
|
+
}
|
|
19015
19033
|
function invalidateRouteCacheForDomain(domain) {
|
|
19016
19034
|
let deleted = 0;
|
|
19017
19035
|
for (const [k] of skillRouteCache) {
|
|
@@ -22030,8 +22048,10 @@ async function resolveAndExecute(intent, params = {}, context, projection, optio
|
|
|
22030
22048
|
contextUrl: context?.url
|
|
22031
22049
|
});
|
|
22032
22050
|
timing.execute_ms += Date.now() - te1;
|
|
22033
|
-
if (execOut.trace.success)
|
|
22051
|
+
if (execOut.trace.success) {
|
|
22034
22052
|
promoteLearnedSkill(clientScope, cacheKey, learned_skill, execOut.trace.endpoint_id, context?.url);
|
|
22053
|
+
flushRouteCacheSync();
|
|
22054
|
+
}
|
|
22035
22055
|
if (execOut.trace.success && isAcceptableIntentResult(execOut.result, queryIntent)) {
|
|
22036
22056
|
queuePassivePublishIfExecuted(learned_skill, {
|
|
22037
22057
|
result: execOut.result,
|
|
@@ -22067,6 +22087,8 @@ async function resolveAndExecute(intent, params = {}, context, projection, optio
|
|
|
22067
22087
|
auth_recommended: true,
|
|
22068
22088
|
auth_hint: captureResult.auth_hint
|
|
22069
22089
|
} : undefined);
|
|
22090
|
+
promoteLearnedSkill(clientScope, cacheKey, learned_skill, deferred.orchestratorResult.trace.endpoint_id || undefined, context?.url);
|
|
22091
|
+
flushRouteCacheSync();
|
|
22070
22092
|
queuePassivePublishIfExecuted(learned_skill, deferred.orchestratorResult, parityBaseline);
|
|
22071
22093
|
upsertDagEdgesFromOperationGraph(learned_skill);
|
|
22072
22094
|
return deferred.orchestratorResult;
|
|
@@ -22353,14 +22375,7 @@ var init_orchestrator = __esm(async () => {
|
|
|
22353
22375
|
routeCacheFlushTimer = setInterval(() => {
|
|
22354
22376
|
if (!_routeCacheDirty)
|
|
22355
22377
|
return;
|
|
22356
|
-
|
|
22357
|
-
try {
|
|
22358
|
-
const dir = dirname2(ROUTE_CACHE_FILE);
|
|
22359
|
-
if (!existsSync13(dir))
|
|
22360
|
-
mkdirSync9(dir, { recursive: true });
|
|
22361
|
-
const entries = Object.fromEntries(skillRouteCache);
|
|
22362
|
-
writeFileSync8(ROUTE_CACHE_FILE, JSON.stringify(entries), "utf-8");
|
|
22363
|
-
} catch {}
|
|
22378
|
+
_writeRouteCacheToDisk();
|
|
22364
22379
|
}, 5000);
|
|
22365
22380
|
routeCacheFlushTimer.unref?.();
|
|
22366
22381
|
try {
|