opensteer 0.8.0 → 0.8.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/README.md +2 -1
- package/dist/{chunk-2UMBR4XO.js → chunk-X3G6QSCF.js} +196 -61
- package/dist/chunk-X3G6QSCF.js.map +1 -0
- package/dist/cli/bin.cjs +193 -58
- package/dist/cli/bin.cjs.map +1 -1
- package/dist/cli/bin.js +1 -1
- package/dist/index.cjs +193 -58
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +2 -2
- package/package.json +4 -4
- package/skills/README.md +13 -1
- package/skills/opensteer/SKILL.md +10 -2
- package/skills/opensteer/references/cli-reference.md +8 -0
- package/skills/opensteer/references/request-workflow.md +11 -0
- package/skills/opensteer/references/sdk-reference.md +9 -0
- package/dist/chunk-2UMBR4XO.js.map +0 -1
package/README.md
CHANGED
|
@@ -39,7 +39,8 @@ pnpm add @opensteer/engine-abp
|
|
|
39
39
|
```
|
|
40
40
|
|
|
41
41
|
`opensteer skills install` installs the packaged first-party skill pack through the upstream
|
|
42
|
-
`skills` CLI.
|
|
42
|
+
`skills` CLI. Use `opensteer skills install --agent claude-code` when you want to target
|
|
43
|
+
Claude Code explicitly.
|
|
43
44
|
|
|
44
45
|
`opensteer` installs the Playwright-backed local engine by default. Add
|
|
45
46
|
`@opensteer/engine-abp` only when you need the ABP backend.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import path6, { join, resolve, basename, relative } from 'path';
|
|
2
2
|
import { randomUUID, createHash } from 'crypto';
|
|
3
|
-
import { rm, mkdtemp, mkdir, access, readFile, cp, writeFile, rename,
|
|
3
|
+
import { rm, mkdtemp, mkdir, access, readFile, cp, readdir, writeFile, rename, stat, copyFile, open } from 'fs/promises';
|
|
4
4
|
import { pathToFileURL } from 'url';
|
|
5
5
|
import { selectAll } from 'css-select';
|
|
6
6
|
import { execFileSync, execFile, spawn } from 'child_process';
|
|
@@ -12146,6 +12146,38 @@ async function clearChromeSingletonEntries(userDataDir) {
|
|
|
12146
12146
|
)
|
|
12147
12147
|
);
|
|
12148
12148
|
}
|
|
12149
|
+
async function sanitizeChromeProfile(userDataDir) {
|
|
12150
|
+
if (!existsSync(userDataDir)) {
|
|
12151
|
+
return;
|
|
12152
|
+
}
|
|
12153
|
+
const entries = await readdir(userDataDir).catch(() => []);
|
|
12154
|
+
const profileDirs = entries.filter(
|
|
12155
|
+
(entry) => entry === "Default" || /^Profile \d+$/i.test(entry)
|
|
12156
|
+
);
|
|
12157
|
+
await Promise.all(profileDirs.map((dir) => sanitizeProfilePreferences(userDataDir, dir)));
|
|
12158
|
+
}
|
|
12159
|
+
async function sanitizeProfilePreferences(userDataDir, profileDir) {
|
|
12160
|
+
const prefsPath = join(userDataDir, profileDir, "Preferences");
|
|
12161
|
+
if (!existsSync(prefsPath)) {
|
|
12162
|
+
return;
|
|
12163
|
+
}
|
|
12164
|
+
try {
|
|
12165
|
+
const raw = await readFile(prefsPath, "utf8");
|
|
12166
|
+
const prefs = JSON.parse(raw);
|
|
12167
|
+
const profile = prefs.profile ?? {};
|
|
12168
|
+
if (profile.exit_type === "Normal" && profile.exited_cleanly === true) {
|
|
12169
|
+
return;
|
|
12170
|
+
}
|
|
12171
|
+
profile.exit_type = "Normal";
|
|
12172
|
+
profile.exited_cleanly = true;
|
|
12173
|
+
prefs.profile = profile;
|
|
12174
|
+
await writeFile(prefsPath, JSON.stringify(prefs), "utf8");
|
|
12175
|
+
await rm(join(userDataDir, profileDir, "Secure Preferences"), { force: true }).catch(
|
|
12176
|
+
() => void 0
|
|
12177
|
+
);
|
|
12178
|
+
} catch {
|
|
12179
|
+
}
|
|
12180
|
+
}
|
|
12149
12181
|
var CHROME_SINGLETON_ENTRIES = new Set(CHROME_SINGLETON_ARTIFACTS);
|
|
12150
12182
|
var SKIPPED_ROOT_DIRECTORIES = /* @__PURE__ */ new Set([
|
|
12151
12183
|
"Crash Reports",
|
|
@@ -12204,6 +12236,7 @@ async function createBrowserProfileSnapshot(input) {
|
|
|
12204
12236
|
...profileDirectory === void 0 ? {} : { selectedProfileDirectory: profileDirectory }
|
|
12205
12237
|
});
|
|
12206
12238
|
await clearChromeSingletonEntries(targetUserDataDir);
|
|
12239
|
+
await sanitizeChromeProfile(targetUserDataDir);
|
|
12207
12240
|
}
|
|
12208
12241
|
async function copyRootLevelEntries(input) {
|
|
12209
12242
|
const entries = await readdir(input.sourceUserDataDir).catch(() => []);
|
|
@@ -12267,68 +12300,88 @@ function generateStealthInitScript(profile) {
|
|
|
12267
12300
|
const encodedProfile = JSON.stringify(profile);
|
|
12268
12301
|
return `(() => {
|
|
12269
12302
|
const profile = ${encodedProfile};
|
|
12270
|
-
|
|
12271
|
-
|
|
12303
|
+
|
|
12304
|
+
// --- navigator.webdriver safety net ---
|
|
12305
|
+
// --disable-blink-features=AutomationControlled handles this at the flag level
|
|
12306
|
+
// and CDP handles it at the protocol level, but some Chrome builds still leak
|
|
12307
|
+
// webdriver=true when --remote-debugging-port is active.
|
|
12308
|
+
if (navigator.webdriver === true) {
|
|
12309
|
+
Object.defineProperty(Navigator.prototype, 'webdriver', {
|
|
12272
12310
|
configurable: true,
|
|
12273
|
-
get:
|
|
12311
|
+
get: function() { return false; },
|
|
12274
12312
|
});
|
|
12275
|
-
};
|
|
12276
|
-
define(Navigator.prototype, 'webdriver', false);
|
|
12277
|
-
define(Navigator.prototype, 'platform', profile.platform === 'macos' ? 'MacIntel' : profile.platform === 'windows' ? 'Win32' : 'Linux x86_64');
|
|
12278
|
-
define(Navigator.prototype, 'userAgent', profile.userAgent);
|
|
12279
|
-
define(Navigator.prototype, 'language', profile.locale);
|
|
12280
|
-
define(Navigator.prototype, 'languages', [profile.locale, 'en']);
|
|
12281
|
-
define(Navigator.prototype, 'maxTouchPoints', profile.maxTouchPoints);
|
|
12282
|
-
define(window, 'devicePixelRatio', profile.devicePixelRatio);
|
|
12283
|
-
define(window.screen, 'width', profile.screenResolution.width);
|
|
12284
|
-
define(window.screen, 'height', profile.screenResolution.height);
|
|
12285
|
-
define(window.screen, 'availWidth', profile.screenResolution.width);
|
|
12286
|
-
define(window.screen, 'availHeight', profile.screenResolution.height - 40);
|
|
12287
|
-
if (document.fonts && typeof document.fonts.check === 'function') {
|
|
12288
|
-
const originalCheck = document.fonts.check.bind(document.fonts);
|
|
12289
|
-
document.fonts.check = function(font, text) {
|
|
12290
|
-
const family = String(font).match(/["']([^"']+)["']/)?.[1] || String(font).split(/s+/).at(-1);
|
|
12291
|
-
if (family && profile.fonts.includes(family)) {
|
|
12292
|
-
return true;
|
|
12293
|
-
}
|
|
12294
|
-
return originalCheck(font, text);
|
|
12295
|
-
};
|
|
12296
12313
|
}
|
|
12297
|
-
|
|
12298
|
-
|
|
12314
|
+
|
|
12315
|
+
// --- CDP Runtime.enable leak defense ---
|
|
12316
|
+
var _wrap = function(name) {
|
|
12317
|
+
var orig = console[name];
|
|
12318
|
+
if (typeof orig !== 'function') return;
|
|
12319
|
+
console[name] = new Proxy(orig, {
|
|
12320
|
+
apply: function(target, thisArg, args) {
|
|
12321
|
+
for (var i = 0; i < args.length; i++) {
|
|
12322
|
+
if (args[i] instanceof Error) {
|
|
12323
|
+
var d = Object.getOwnPropertyDescriptor(args[i], 'stack');
|
|
12324
|
+
if (d && typeof d.get === 'function') return undefined;
|
|
12325
|
+
}
|
|
12326
|
+
}
|
|
12327
|
+
return Reflect.apply(target, thisArg, args);
|
|
12328
|
+
},
|
|
12329
|
+
});
|
|
12330
|
+
};
|
|
12331
|
+
['debug', 'log', 'info', 'error', 'warn', 'trace', 'dir'].forEach(_wrap);
|
|
12332
|
+
|
|
12333
|
+
// --- Canvas fingerprint noise ---
|
|
12334
|
+
var seedNoise = function(seed, input) {
|
|
12335
|
+
var value = Math.sin(seed + input * 12.9898) * 43758.5453;
|
|
12299
12336
|
return value - Math.floor(value);
|
|
12300
12337
|
};
|
|
12301
12338
|
if (HTMLCanvasElement.prototype.toDataURL) {
|
|
12302
|
-
|
|
12303
|
-
HTMLCanvasElement.prototype.toDataURL = function(
|
|
12304
|
-
|
|
12339
|
+
var originalToDataURL = HTMLCanvasElement.prototype.toDataURL;
|
|
12340
|
+
HTMLCanvasElement.prototype.toDataURL = function() {
|
|
12341
|
+
var context = this.getContext('2d');
|
|
12305
12342
|
if (context) {
|
|
12306
|
-
|
|
12307
|
-
|
|
12308
|
-
|
|
12343
|
+
var x = Math.min(1, Math.max(0, this.width - 1));
|
|
12344
|
+
var y = Math.min(1, Math.max(0, this.height - 1));
|
|
12345
|
+
var imageData = context.getImageData(x, y, 1, 1);
|
|
12309
12346
|
imageData.data[0] = Math.max(0, Math.min(255, imageData.data[0] + Math.floor(seedNoise(profile.canvasNoiseSeed, 1) * 2)));
|
|
12310
12347
|
context.putImageData(imageData, x, y);
|
|
12311
12348
|
}
|
|
12312
|
-
return originalToDataURL.apply(this,
|
|
12349
|
+
return originalToDataURL.apply(this, arguments);
|
|
12313
12350
|
};
|
|
12314
12351
|
}
|
|
12352
|
+
|
|
12353
|
+
// --- WebGL vendor/renderer spoofing ---
|
|
12315
12354
|
if (typeof WebGLRenderingContext !== 'undefined') {
|
|
12316
|
-
|
|
12355
|
+
var originalGetParameter = WebGLRenderingContext.prototype.getParameter;
|
|
12317
12356
|
WebGLRenderingContext.prototype.getParameter = function(parameter) {
|
|
12318
12357
|
if (parameter === 37445) return profile.webglVendor;
|
|
12319
12358
|
if (parameter === 37446) return profile.webglRenderer;
|
|
12320
12359
|
return originalGetParameter.call(this, parameter);
|
|
12321
12360
|
};
|
|
12322
12361
|
}
|
|
12362
|
+
|
|
12363
|
+
// --- AudioBuffer fingerprint noise ---
|
|
12323
12364
|
if (typeof AudioBuffer !== 'undefined' && typeof AnalyserNode !== 'undefined') {
|
|
12324
|
-
|
|
12365
|
+
var originalGetFloatFrequencyData = AnalyserNode.prototype.getFloatFrequencyData;
|
|
12325
12366
|
AnalyserNode.prototype.getFloatFrequencyData = function(array) {
|
|
12326
12367
|
originalGetFloatFrequencyData.call(this, array);
|
|
12327
|
-
for (
|
|
12368
|
+
for (var index = 0; index < array.length; index += 16) {
|
|
12328
12369
|
array[index] += (seedNoise(profile.audioNoiseSeed, index) - 0.5) * 0.0001;
|
|
12329
12370
|
}
|
|
12330
12371
|
};
|
|
12331
12372
|
}
|
|
12373
|
+
|
|
12374
|
+
// --- Font availability spoofing ---
|
|
12375
|
+
if (document.fonts && typeof document.fonts.check === 'function') {
|
|
12376
|
+
var originalCheck = document.fonts.check.bind(document.fonts);
|
|
12377
|
+
document.fonts.check = function(font, text) {
|
|
12378
|
+
var family = String(font).match(/["']([^"']+)["']/)?.[1] || String(font).split(/\\s+/).at(-1);
|
|
12379
|
+
if (family && profile.fonts.includes(family)) {
|
|
12380
|
+
return true;
|
|
12381
|
+
}
|
|
12382
|
+
return originalCheck(font, text);
|
|
12383
|
+
};
|
|
12384
|
+
}
|
|
12332
12385
|
})();`;
|
|
12333
12386
|
}
|
|
12334
12387
|
|
|
@@ -12374,25 +12427,95 @@ var STEALTH_INIT_SCRIPT = `(() => {
|
|
|
12374
12427
|
['debug', 'log', 'info', 'error', 'warn', 'trace', 'dir'].forEach(_wrap);
|
|
12375
12428
|
})();`;
|
|
12376
12429
|
async function injectBrowserStealthScripts(context, input = {}) {
|
|
12430
|
+
if (input.profile !== void 0 && input.page !== void 0) {
|
|
12431
|
+
await applyCdpStealthOverrides(context, input.page, input.profile);
|
|
12432
|
+
}
|
|
12377
12433
|
if (typeof context.addInitScript === "function") {
|
|
12378
12434
|
await context.addInitScript({
|
|
12379
12435
|
content: input.profile === void 0 ? STEALTH_INIT_SCRIPT : generateStealthInitScript(input.profile)
|
|
12380
12436
|
});
|
|
12381
12437
|
}
|
|
12382
12438
|
}
|
|
12439
|
+
function buildUserAgentMetadata(profile) {
|
|
12440
|
+
const majorVersion = profile.browserVersion.split(".")[0] ?? "136";
|
|
12441
|
+
const brands = [
|
|
12442
|
+
{ brand: "Chromium", version: majorVersion },
|
|
12443
|
+
...profile.browserBrand === "edge" ? [{ brand: "Microsoft Edge", version: majorVersion }] : [{ brand: "Google Chrome", version: majorVersion }],
|
|
12444
|
+
{ brand: "Not-A.Brand", version: "99" }
|
|
12445
|
+
];
|
|
12446
|
+
const fullVersionList = [
|
|
12447
|
+
{ brand: "Chromium", version: profile.browserVersion },
|
|
12448
|
+
...profile.browserBrand === "edge" ? [{ brand: "Microsoft Edge", version: profile.browserVersion }] : [{ brand: "Google Chrome", version: profile.browserVersion }],
|
|
12449
|
+
{ brand: "Not-A.Brand", version: "99.0.0.0" }
|
|
12450
|
+
];
|
|
12451
|
+
const platformMap = {
|
|
12452
|
+
macos: { platform: "macOS", platformVersion: "14.4.0", architecture: "arm" },
|
|
12453
|
+
windows: { platform: "Windows", platformVersion: "15.0.0", architecture: "x86" },
|
|
12454
|
+
linux: { platform: "Linux", platformVersion: "6.5.0", architecture: "x86" }
|
|
12455
|
+
};
|
|
12456
|
+
const platformInfo = platformMap[profile.platform] ?? platformMap.linux;
|
|
12457
|
+
return {
|
|
12458
|
+
brands,
|
|
12459
|
+
fullVersionList,
|
|
12460
|
+
platform: platformInfo.platform,
|
|
12461
|
+
platformVersion: platformInfo.platformVersion,
|
|
12462
|
+
architecture: platformInfo.architecture,
|
|
12463
|
+
model: "",
|
|
12464
|
+
mobile: false,
|
|
12465
|
+
bitness: "64",
|
|
12466
|
+
wow64: false
|
|
12467
|
+
};
|
|
12468
|
+
}
|
|
12469
|
+
async function applyCdpStealthOverrides(context, page, profile) {
|
|
12470
|
+
const contextWithCdp = context;
|
|
12471
|
+
if (typeof contextWithCdp.newCDPSession !== "function") {
|
|
12472
|
+
return;
|
|
12473
|
+
}
|
|
12474
|
+
let cdp;
|
|
12475
|
+
try {
|
|
12476
|
+
cdp = await contextWithCdp.newCDPSession(page);
|
|
12477
|
+
} catch {
|
|
12478
|
+
return;
|
|
12479
|
+
}
|
|
12480
|
+
try {
|
|
12481
|
+
const platformString = profile.platform === "macos" ? "MacIntel" : profile.platform === "windows" ? "Win32" : "Linux x86_64";
|
|
12482
|
+
await cdp.send("Network.setUserAgentOverride", {
|
|
12483
|
+
userAgent: profile.userAgent,
|
|
12484
|
+
acceptLanguage: `${profile.locale},en;q=0.9`,
|
|
12485
|
+
platform: platformString,
|
|
12486
|
+
userAgentMetadata: buildUserAgentMetadata(profile)
|
|
12487
|
+
});
|
|
12488
|
+
await cdp.send("Emulation.setDeviceMetricsOverride", {
|
|
12489
|
+
width: profile.viewport.width,
|
|
12490
|
+
height: profile.viewport.height,
|
|
12491
|
+
deviceScaleFactor: profile.devicePixelRatio,
|
|
12492
|
+
mobile: false,
|
|
12493
|
+
screenWidth: profile.screenResolution.width,
|
|
12494
|
+
screenHeight: profile.screenResolution.height
|
|
12495
|
+
});
|
|
12496
|
+
await cdp.send("Emulation.setLocaleOverride", {
|
|
12497
|
+
locale: profile.locale
|
|
12498
|
+
}).catch(() => void 0);
|
|
12499
|
+
await cdp.send("Emulation.setTimezoneOverride", {
|
|
12500
|
+
timezoneId: profile.timezoneId
|
|
12501
|
+
}).catch(() => void 0);
|
|
12502
|
+
await cdp.detach();
|
|
12503
|
+
} catch {
|
|
12504
|
+
}
|
|
12505
|
+
}
|
|
12383
12506
|
|
|
12384
12507
|
// src/local-browser/stealth-profiles.ts
|
|
12385
12508
|
var PROFILE_PRESETS = [
|
|
12386
12509
|
{
|
|
12387
12510
|
platform: "macos",
|
|
12388
12511
|
browserBrand: "chrome",
|
|
12389
|
-
browserVersion: "
|
|
12390
|
-
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X
|
|
12512
|
+
browserVersion: "136.0.7103.93",
|
|
12513
|
+
userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
|
|
12391
12514
|
viewport: { width: 1440, height: 900 },
|
|
12392
12515
|
screenResolution: { width: 1512, height: 982 },
|
|
12393
12516
|
devicePixelRatio: 2,
|
|
12394
12517
|
maxTouchPoints: 0,
|
|
12395
|
-
webglVendor: "Apple
|
|
12518
|
+
webglVendor: "Apple",
|
|
12396
12519
|
webglRenderer: "Apple M2",
|
|
12397
12520
|
fonts: ["SF Pro Text", "Helvetica Neue", "Arial", "Menlo", "Apple Color Emoji"],
|
|
12398
12521
|
locale: "en-US",
|
|
@@ -12401,8 +12524,8 @@ var PROFILE_PRESETS = [
|
|
|
12401
12524
|
{
|
|
12402
12525
|
platform: "windows",
|
|
12403
12526
|
browserBrand: "chrome",
|
|
12404
|
-
browserVersion: "
|
|
12405
|
-
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
12527
|
+
browserVersion: "136.0.7103.93",
|
|
12528
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
|
|
12406
12529
|
viewport: { width: 1536, height: 864 },
|
|
12407
12530
|
screenResolution: { width: 1920, height: 1080 },
|
|
12408
12531
|
devicePixelRatio: 1.25,
|
|
@@ -12416,8 +12539,8 @@ var PROFILE_PRESETS = [
|
|
|
12416
12539
|
{
|
|
12417
12540
|
platform: "windows",
|
|
12418
12541
|
browserBrand: "edge",
|
|
12419
|
-
browserVersion: "
|
|
12420
|
-
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
12542
|
+
browserVersion: "136.0.3240.50",
|
|
12543
|
+
userAgent: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36 Edg/136.0.3240.50",
|
|
12421
12544
|
viewport: { width: 1536, height: 864 },
|
|
12422
12545
|
screenResolution: { width: 1920, height: 1080 },
|
|
12423
12546
|
devicePixelRatio: 1.25,
|
|
@@ -12431,8 +12554,8 @@ var PROFILE_PRESETS = [
|
|
|
12431
12554
|
{
|
|
12432
12555
|
platform: "linux",
|
|
12433
12556
|
browserBrand: "chrome",
|
|
12434
|
-
browserVersion: "
|
|
12435
|
-
userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/
|
|
12557
|
+
browserVersion: "136.0.7103.93",
|
|
12558
|
+
userAgent: "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36",
|
|
12436
12559
|
viewport: { width: 1366, height: 768 },
|
|
12437
12560
|
screenResolution: { width: 1366, height: 768 },
|
|
12438
12561
|
devicePixelRatio: 1,
|
|
@@ -12702,7 +12825,8 @@ var OpensteerBrowserManager = class {
|
|
|
12702
12825
|
await clearChromeSingletonEntries(userDataDir);
|
|
12703
12826
|
const launched = await launchOwnedBrowser({
|
|
12704
12827
|
userDataDir,
|
|
12705
|
-
...this.launchOptions === void 0 ? {} : { launch: this.launchOptions }
|
|
12828
|
+
...this.launchOptions === void 0 ? {} : { launch: this.launchOptions },
|
|
12829
|
+
...this.contextOptions?.viewport === void 0 ? {} : { viewport: this.contextOptions.viewport }
|
|
12706
12830
|
});
|
|
12707
12831
|
try {
|
|
12708
12832
|
return await this.createAttachedEngine({
|
|
@@ -12750,7 +12874,8 @@ var OpensteerBrowserManager = class {
|
|
|
12750
12874
|
await this.ensurePersistentBrowserManifest(workspace);
|
|
12751
12875
|
const launched = await launchOwnedBrowser({
|
|
12752
12876
|
userDataDir: workspace.browserUserDataDir,
|
|
12753
|
-
...this.launchOptions === void 0 ? {} : { launch: this.launchOptions }
|
|
12877
|
+
...this.launchOptions === void 0 ? {} : { launch: this.launchOptions },
|
|
12878
|
+
...this.contextOptions?.viewport === void 0 ? {} : { viewport: this.contextOptions.viewport }
|
|
12754
12879
|
});
|
|
12755
12880
|
const liveRecord = {
|
|
12756
12881
|
mode: "persistent",
|
|
@@ -12785,13 +12910,13 @@ var OpensteerBrowserManager = class {
|
|
|
12785
12910
|
if (!context) {
|
|
12786
12911
|
throw new Error("Connected browser did not expose a Chromium browser context.");
|
|
12787
12912
|
}
|
|
12913
|
+
const page = input.freshTab || context.pages()[0] === void 0 ? await context.newPage() : context.pages()[0];
|
|
12914
|
+
await page.bringToFront?.();
|
|
12788
12915
|
const stealthProfile = resolveStealthProfile(this.contextOptions?.stealthProfile);
|
|
12789
12916
|
await injectBrowserStealthScripts(
|
|
12790
12917
|
context,
|
|
12791
|
-
stealthProfile === void 0 ? {} : { profile: stealthProfile }
|
|
12918
|
+
stealthProfile === void 0 ? {} : { profile: stealthProfile, page }
|
|
12792
12919
|
);
|
|
12793
|
-
const page = input.freshTab || context.pages()[0] === void 0 ? await context.newPage() : context.pages()[0];
|
|
12794
|
-
await page.bringToFront?.();
|
|
12795
12920
|
const engine = await createPlaywrightBrowserCoreEngine({
|
|
12796
12921
|
browser,
|
|
12797
12922
|
attachedContext: context,
|
|
@@ -12977,8 +13102,9 @@ async function resolveAttachEndpoint(browser) {
|
|
|
12977
13102
|
async function launchOwnedBrowser(input) {
|
|
12978
13103
|
await ensureDirectory(input.userDataDir);
|
|
12979
13104
|
await clearChromeSingletonEntries(input.userDataDir);
|
|
13105
|
+
await sanitizeChromeProfile(input.userDataDir);
|
|
12980
13106
|
const executablePath = resolveChromeExecutablePath(input.launch?.executablePath);
|
|
12981
|
-
const args = buildChromeArgs(input.userDataDir, input.launch);
|
|
13107
|
+
const args = buildChromeArgs(input.userDataDir, input.launch, input.viewport);
|
|
12982
13108
|
const child = spawn(executablePath, args, {
|
|
12983
13109
|
stdio: ["ignore", "ignore", "pipe"],
|
|
12984
13110
|
detached: process.platform !== "win32"
|
|
@@ -13005,7 +13131,8 @@ async function launchOwnedBrowser(input) {
|
|
|
13005
13131
|
executablePath
|
|
13006
13132
|
};
|
|
13007
13133
|
}
|
|
13008
|
-
function buildChromeArgs(userDataDir, launch) {
|
|
13134
|
+
function buildChromeArgs(userDataDir, launch, viewport) {
|
|
13135
|
+
const isHeadless = launch?.headless ?? true;
|
|
13009
13136
|
const args = [
|
|
13010
13137
|
"--remote-debugging-port=0",
|
|
13011
13138
|
"--no-first-run",
|
|
@@ -13019,17 +13146,25 @@ function buildChromeArgs(userDataDir, launch) {
|
|
|
13019
13146
|
"--disable-popup-blocking",
|
|
13020
13147
|
"--disable-prompt-on-repost",
|
|
13021
13148
|
"--disable-sync",
|
|
13149
|
+
"--disable-infobars",
|
|
13022
13150
|
"--disable-features=Translate",
|
|
13023
13151
|
"--enable-features=NetworkService,NetworkServiceInProcess",
|
|
13024
13152
|
"--password-store=basic",
|
|
13025
13153
|
"--use-mock-keychain",
|
|
13026
13154
|
`--user-data-dir=${userDataDir}`
|
|
13027
13155
|
];
|
|
13028
|
-
if (
|
|
13156
|
+
if (isHeadless) {
|
|
13029
13157
|
args.push("--headless=new");
|
|
13030
|
-
|
|
13031
|
-
|
|
13032
|
-
|
|
13158
|
+
}
|
|
13159
|
+
const hasUserWindowSize = (launch?.args ?? []).some(
|
|
13160
|
+
(entry) => entry.startsWith("--window-size")
|
|
13161
|
+
);
|
|
13162
|
+
if (!hasUserWindowSize) {
|
|
13163
|
+
const width = viewport?.width ?? 1440;
|
|
13164
|
+
const height = viewport?.height ?? 900;
|
|
13165
|
+
args.push(
|
|
13166
|
+
isHeadless ? `--window-size=${String(width)},${String(height)}` : `--window-size=${String(width)},${String(height + 150)}`
|
|
13167
|
+
);
|
|
13033
13168
|
}
|
|
13034
13169
|
args.push(...launch?.args ?? []);
|
|
13035
13170
|
return args;
|
|
@@ -16887,8 +17022,8 @@ async function isExecutable(candidate) {
|
|
|
16887
17022
|
}
|
|
16888
17023
|
async function readDirSafe(directory) {
|
|
16889
17024
|
try {
|
|
16890
|
-
const { readdir:
|
|
16891
|
-
return await
|
|
17025
|
+
const { readdir: readdir4 } = await import('fs/promises');
|
|
17026
|
+
return await readdir4(directory);
|
|
16892
17027
|
} catch {
|
|
16893
17028
|
return [];
|
|
16894
17029
|
}
|
|
@@ -31750,5 +31885,5 @@ function createOpensteerSemanticRuntime(input = {}) {
|
|
|
31750
31885
|
}
|
|
31751
31886
|
|
|
31752
31887
|
export { CloudSessionProxy, DEFAULT_OPENSTEER_ENGINE, DEFERRED_MATCH_ATTR_KEYS, ElementPathError, MATCH_ATTRIBUTE_PRIORITY, OPENSTEER_DOM_ACTION_BRIDGE_SYMBOL, OPENSTEER_ENGINE_NAMES, OPENSTEER_FILESYSTEM_WORKSPACE_LAYOUT, OPENSTEER_FILESYSTEM_WORKSPACE_VERSION, OpensteerAttachAmbiguousError, OpensteerBrowserManager, OpensteerCloudClient, OpensteerRuntime, STABLE_PRIMARY_ATTR_KEYS, assertExecutionModeSupportsEngine, buildArrayFieldPathCandidates, buildPathCandidates, buildPathSelectorHint, buildSegmentSelector, cloneElementPath, cloneReplayElementPath, cloneStructuralElementAnchor, createDomRuntime, createFilesystemOpensteerWorkspace, createOpensteerSemanticRuntime, defaultFallbackPolicy, defaultPolicy, defaultRetryPolicy, defaultSettlePolicy, defaultTimeoutPolicy, delayWithSignal, discoverLocalCdpBrowsers, dispatchSemanticOperation, hasPersistedCloudSession, inspectCdpEndpoint, isCurrentUrlField, isValidCssAttributeKey, listLocalChromeProfiles, normalizeExtractedValue, normalizeOpensteerEngineName, normalizeOpensteerExecutionMode, normalizeWorkspaceId, readPersistedCloudSessionRecord, resolveCloudConfig, resolveCloudSessionRecordPath, resolveDomActionBridge, resolveExtractedValueInContext, resolveFilesystemWorkspacePath, resolveOpensteerEngineName, resolveOpensteerExecutionMode, resolveOpensteerRuntimeConfig, runWithPolicyTimeout, sanitizeElementPath, sanitizeReplayElementPath, sanitizeStructuralElementAnchor, settleWithPolicy, shouldKeepAttributeForPath };
|
|
31753
|
-
//# sourceMappingURL=chunk-
|
|
31754
|
-
//# sourceMappingURL=chunk-
|
|
31888
|
+
//# sourceMappingURL=chunk-X3G6QSCF.js.map
|
|
31889
|
+
//# sourceMappingURL=chunk-X3G6QSCF.js.map
|