@andorra-labs/code 0.1.13 → 0.1.15
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/src/account-presentation.js +4 -1
- package/dist/src/acp-agent.d.ts +54 -0
- package/dist/src/acp-agent.js +991 -0
- package/dist/src/agent-execution.js +304 -140
- package/dist/src/agent-mcp-catalog.js +2 -0
- package/dist/src/agent-mcp.d.ts +2 -0
- package/dist/src/agent-mcp.js +86 -4
- package/dist/src/andorra/endpoint.d.ts +7 -0
- package/dist/src/andorra/endpoint.js +46 -0
- package/dist/src/andorra/entry.d.ts +21 -0
- package/dist/src/andorra/entry.js +118 -0
- package/dist/src/andorra/errors.d.ts +2 -0
- package/dist/src/andorra/errors.js +39 -0
- package/dist/src/andorra/hosted.d.ts +55 -0
- package/dist/src/andorra/hosted.js +130 -0
- package/dist/src/andorra/monitor.d.ts +151 -0
- package/dist/src/andorra/monitor.js +393 -0
- package/dist/src/andorra/notices.d.ts +16 -0
- package/dist/src/andorra/notices.js +38 -0
- package/dist/src/andorra/opt-in.d.ts +58 -0
- package/dist/src/andorra/opt-in.js +112 -0
- package/dist/src/andorra/request-watch.d.ts +6 -0
- package/dist/src/andorra/request-watch.js +10 -0
- package/dist/src/andorra/state.d.ts +86 -0
- package/dist/src/andorra/state.js +238 -0
- package/dist/src/andorra/terminal.d.ts +70 -0
- package/dist/src/andorra/terminal.js +125 -0
- package/dist/src/andorra/usage-format.d.ts +9 -0
- package/dist/src/andorra/usage-format.js +19 -0
- package/dist/src/anthropic-credentials.js +9 -1
- package/dist/src/app-server/protocol.d.ts +10 -2
- package/dist/src/app-server/protocol.js +1 -1
- package/dist/src/app-server/workspace.d.ts +1 -0
- package/dist/src/app-server/workspace.js +141 -10
- package/dist/src/app-server.d.ts +35 -0
- package/dist/src/app-server.js +377 -124
- package/dist/src/auth/AuthManager.d.ts +9 -0
- package/dist/src/auth/AuthManager.js +164 -24
- package/dist/src/auth/deployment.d.ts +1 -0
- package/dist/src/auth/deployment.js +1 -0
- package/dist/src/auth/index.d.ts +1 -1
- package/dist/src/auth/index.js +1 -1
- package/dist/src/auth/store.d.ts +26 -0
- package/dist/src/auth/store.js +34 -1
- package/dist/src/browser-bridge.d.ts +1 -0
- package/dist/src/browser-bridge.js +5 -2
- package/dist/src/browser-external-app.d.ts +27 -0
- package/dist/src/browser-external-app.js +60 -0
- package/dist/src/browser-panel-tool.d.ts +6 -0
- package/dist/src/browser-panel-tool.js +36 -0
- package/dist/src/browser-runner.js +1 -1
- package/dist/src/browser-server.d.ts +5 -0
- package/dist/src/browser-server.js +27 -3
- package/dist/src/browser-stealth.d.ts +19 -1
- package/dist/src/browser-stealth.js +23 -3
- package/dist/src/browser-ui/tokens.css +4 -4
- package/dist/src/browser-view.d.ts +81 -0
- package/dist/src/browser-view.js +289 -18
- package/dist/src/bug-report.d.ts +81 -0
- package/dist/src/bug-report.js +235 -0
- package/dist/src/claude-provider.d.ts +2 -1
- package/dist/src/claude-provider.js +10 -8
- package/dist/src/cli-sign-in.d.ts +3 -1
- package/dist/src/cli-sign-in.js +4 -1
- package/dist/src/cli.js +205 -58
- package/dist/src/coding-tools.js +7 -7
- package/dist/src/command-screens.d.ts +26 -3
- package/dist/src/command-screens.js +323 -85
- package/dist/src/commands.d.ts +7 -1
- package/dist/src/commands.js +79 -27
- package/dist/src/completion-gates.d.ts +22 -0
- package/dist/src/completion-gates.js +11 -0
- package/dist/src/config.d.ts +11 -1
- package/dist/src/config.js +134 -3
- package/dist/src/dashboard-view.d.ts +2 -0
- package/dist/src/dashboard-view.js +11 -2
- package/dist/src/decision/PreparedSteps.js +1 -1
- package/dist/src/decision/applyToolMenu.js +1 -1
- package/dist/src/decision/toolFamilies.js +1 -1
- package/dist/src/decision/types.d.ts +1 -0
- package/dist/src/google-provider.d.ts +31 -0
- package/dist/src/google-provider.js +153 -0
- package/dist/src/graph-health.d.ts +11 -0
- package/dist/src/graph-health.js +36 -4
- package/dist/src/graph-manager-chat.d.ts +33 -0
- package/dist/src/graph-manager-chat.js +165 -6
- package/dist/src/graph-runner.js +27 -0
- package/dist/src/graph-selection.js +2 -1
- package/dist/src/graph-sync.d.ts +1 -0
- package/dist/src/graph-sync.js +93 -34
- package/dist/src/graph-tool.d.ts +2 -0
- package/dist/src/graph-tool.js +2 -2
- package/dist/src/graph-ui/app.js +92 -10
- package/dist/src/graph-ui/edge-router.js +121 -53
- package/dist/src/graph-ui/manager.js +40 -5
- package/dist/src/graph-ui/style.css +5 -2
- package/dist/src/graph-ui/tokens.css +4 -4
- package/dist/src/graph-visibility.d.ts +31 -0
- package/dist/src/graph-visibility.js +102 -0
- package/dist/src/graphs.js +1 -3
- package/dist/src/hardened-runtime.js +1 -1
- package/dist/src/live-model.d.ts +24 -0
- package/dist/src/live-model.js +37 -0
- package/dist/src/managed-sign-in.d.ts +1 -0
- package/dist/src/managed-sign-in.js +13 -0
- package/dist/src/membership-errors.d.ts +2 -0
- package/dist/src/membership-errors.js +6 -2
- package/dist/src/membership.d.ts +13 -2
- package/dist/src/membership.js +39 -8
- package/dist/src/model-context-windows.d.ts +2 -0
- package/dist/src/model-context-windows.js +24 -0
- package/dist/src/model-health-cache.js +1 -1
- package/dist/src/model-metadata.d.ts +1 -0
- package/dist/src/model-metadata.js +47 -3
- package/dist/src/paged-transcript.d.ts +2 -0
- package/dist/src/paged-transcript.js +16 -0
- package/dist/src/palette.d.ts +1 -0
- package/dist/src/palette.js +1 -1
- package/dist/src/permissions.js +17 -4
- package/dist/src/provider-connection.js +32 -0
- package/dist/src/provider-engine.d.ts +5 -0
- package/dist/src/provider-engine.js +3 -3
- package/dist/src/provider-import.js +3 -1
- package/dist/src/provider-settings.d.ts +16 -1
- package/dist/src/provider-settings.js +50 -22
- package/dist/src/providers.d.ts +29 -3
- package/dist/src/providers.js +100 -18
- package/dist/src/react-runtime.js +33 -12
- package/dist/src/read-document-tool.d.ts +2 -0
- package/dist/src/read-document-tool.js +6 -6
- package/dist/src/remote/engine-pool.js +31 -6
- package/dist/src/run-control.d.ts +2 -2
- package/dist/src/run-control.js +9 -6
- package/dist/src/runtime-environment.d.ts +1 -0
- package/dist/src/runtime-environment.js +13 -0
- package/dist/src/runtime.d.ts +2 -0
- package/dist/src/runtime.js +2 -1
- package/dist/src/save-lock.js +14 -7
- package/dist/src/session-title.d.ts +3 -0
- package/dist/src/session-title.js +5 -2
- package/dist/src/sessions.d.ts +1 -0
- package/dist/src/sessions.js +4 -2
- package/dist/src/sign-in-detection.d.ts +1 -1
- package/dist/src/sign-in-detection.js +10 -3
- package/dist/src/sign-in-offer.js +1 -1
- package/dist/src/skill-commands.js +1 -1
- package/dist/src/skills/bundled/bug-report/SKILL.md +80 -0
- package/dist/src/skills/bundled/graph-manager/SKILL.md +9 -1
- package/dist/src/skills/bundled/graph-manager/errors.md +2 -1
- package/dist/src/skills/bundled/provenance.json +743 -738
- package/dist/src/skills/runtime-skills.js +1 -0
- package/dist/src/subagent-run.d.ts +2 -0
- package/dist/src/subagent-run.js +14 -3
- package/dist/src/telemetry/schema.d.ts +1 -1
- package/dist/src/telemetry/schema.js +2 -2
- package/dist/src/telemetry/uploader.d.ts +7 -1
- package/dist/src/telemetry/uploader.js +11 -2
- package/dist/src/terminal-links.d.ts +16 -0
- package/dist/src/terminal-links.js +113 -0
- package/dist/src/terminal-ui.d.ts +29 -1
- package/dist/src/terminal-ui.js +113 -24
- package/dist/src/tool-catalog.js +1 -1
- package/dist/src/trajectory.js +6 -1
- package/dist/src/transcript.d.ts +2 -0
- package/dist/src/transcript.js +5 -1
- package/dist/src/types.d.ts +5 -0
- package/dist/src/workspace-instructions.js +1 -1
- package/package.json +13 -1
|
@@ -9,7 +9,7 @@ import { join, resolve } from 'node:path';
|
|
|
9
9
|
import { configDirectory, loadConfig } from './config.js';
|
|
10
10
|
import { SessionWriteFence, SessionStore, sessionName, writeSessionSnapshot, removeSessionSnapshot, savedSessionFields, carryRailOwnedFields, primaryDigest, projectIdentity, validSavedSession } from './sessions.js';
|
|
11
11
|
import { acquireSessionMutationLock, SessionMutationLockHeldError, sessionHasOpenRun } from './run-records.js';
|
|
12
|
-
import { createBrowserBridge, validBrowserSession,
|
|
12
|
+
import { createBrowserBridge, validBrowserSession, browserBearerMatches, browserBody, browserReply, discoverBrowserSessions, assertBrowserSessionUnowned } from './browser-bridge.js';
|
|
13
13
|
import { readSessionTrajectory } from './app-server/workspace.js';
|
|
14
14
|
import { runBrowserTask } from './browser-runner.js';
|
|
15
15
|
import { configuredSurface, reportSessionStarted } from './telemetry/surface.js';
|
|
@@ -659,7 +659,8 @@ export async function startBrowserServer(options = {}) {
|
|
|
659
659
|
const server = createServer(async (req, res) => {
|
|
660
660
|
try {
|
|
661
661
|
const path = new URL(req.url || '/', origin).pathname;
|
|
662
|
-
|
|
662
|
+
const requestOrigin = loopbackRequestOrigin(req.headers.host);
|
|
663
|
+
if (!requestOrigin || req.headers.origin && req.headers.origin !== requestOrigin) {
|
|
663
664
|
browserReply(res, 403, { error: 'Invalid origin' });
|
|
664
665
|
return;
|
|
665
666
|
}
|
|
@@ -674,7 +675,7 @@ export async function startBrowserServer(options = {}) {
|
|
|
674
675
|
res.end(content);
|
|
675
676
|
return;
|
|
676
677
|
}
|
|
677
|
-
if (!
|
|
678
|
+
if (!browserBearerMatches(req, token)) {
|
|
678
679
|
browserReply(res, 401, { error: 'Reopen using /browser.' });
|
|
679
680
|
return;
|
|
680
681
|
}
|
|
@@ -987,6 +988,29 @@ export async function startBrowserServer(options = {}) {
|
|
|
987
988
|
throw failure.reason;
|
|
988
989
|
} };
|
|
989
990
|
}
|
|
991
|
+
// The origin a request addressed, when its Host header names this machine's loopback interface.
|
|
992
|
+
// A forwarded port (ssh -L, an editor's port forwarding) arrives as localhost or under another
|
|
993
|
+
// port, so neither the spelling nor the port is compared with the bound address. Refusing every
|
|
994
|
+
// other name is what stops DNS rebinding: a page on a hostile name that resolves here still sends
|
|
995
|
+
// its own name as Host.
|
|
996
|
+
export function loopbackRequestOrigin(host) {
|
|
997
|
+
if (!host || !/^(?:127\.0\.0\.1|localhost|\[::1\])(?::\d{1,5})?$/i.test(host))
|
|
998
|
+
return undefined;
|
|
999
|
+
return `http://${host.toLowerCase()}`;
|
|
1000
|
+
}
|
|
1001
|
+
// What /browser prints, and whether to launch a browser on this machine. Over SSH a browser
|
|
1002
|
+
// opened here is on the wrong computer, so the text explains how to reach the server instead.
|
|
1003
|
+
export function browserLaunch(url, environment = process.env) {
|
|
1004
|
+
if (!(environment.SSH_CONNECTION || environment.SSH_CLIENT || environment.SSH_TTY))
|
|
1005
|
+
return { text: `Andorra Browser: ${url}`, open: true };
|
|
1006
|
+
const port = new URL(url).port;
|
|
1007
|
+
return { open: false, text: [
|
|
1008
|
+
`Andorra Browser: ${url}`,
|
|
1009
|
+
'This is an SSH session, so no browser was opened on this machine. The server listens only on this machine, so forward its port from your own computer, then open the address above there:',
|
|
1010
|
+
` ssh -N -L ${port}:127.0.0.1:${port} <this host>`,
|
|
1011
|
+
'The same address works with localhost in place of 127.0.0.1, and with a different local port if you forward to one.',
|
|
1012
|
+
].join('\n') };
|
|
1013
|
+
}
|
|
990
1014
|
export function openBrowserUrl(url) {
|
|
991
1015
|
const command = process.platform === 'win32' ? 'rundll32.exe' : process.platform === 'darwin' ? 'open' : 'xdg-open';
|
|
992
1016
|
execFile(command, process.platform === 'win32' ? ['url.dll,FileProtocolHandler', url] : [url], { windowsHide: true, timeout: 10000 }, error => { if (error)
|
|
@@ -6,11 +6,29 @@ export declare function stealthContextOptions(platform?: NodeJS.Platform): {
|
|
|
6
6
|
userAgent: string;
|
|
7
7
|
locale: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function desktopUaOverride(platform?: NodeJS.Platform): {
|
|
9
|
+
export declare function desktopUaOverride(platform?: NodeJS.Platform, version?: string): {
|
|
10
10
|
userAgent: string;
|
|
11
11
|
acceptLanguage: string;
|
|
12
12
|
platform: string;
|
|
13
13
|
};
|
|
14
|
+
/**
|
|
15
|
+
* The client-hint (UA-CH) metadata Chromium itself would send for this browser.
|
|
16
|
+
* An Emulation.setUserAgentOverride without userAgentMetadata stops Chromium from
|
|
17
|
+
* sending Sec-CH-UA headers at all, so every override carries a matching set:
|
|
18
|
+
* the brand and major version mirror the real running browser and the platform
|
|
19
|
+
* mirrors the UA string, keeping UA and client hints consistent for bot checks.
|
|
20
|
+
*/
|
|
21
|
+
export declare function userAgentMetadata(version: string | undefined, mobile?: boolean): {
|
|
22
|
+
brands: {
|
|
23
|
+
brand: string;
|
|
24
|
+
version: string;
|
|
25
|
+
}[];
|
|
26
|
+
mobile: boolean;
|
|
27
|
+
model: string;
|
|
28
|
+
platform: string;
|
|
29
|
+
platformVersion: string;
|
|
30
|
+
architecture: string;
|
|
31
|
+
};
|
|
14
32
|
export declare function stealthInitScript(hardware?: {
|
|
15
33
|
cores?: number;
|
|
16
34
|
}): string;
|
|
@@ -20,8 +20,10 @@ const OS_PROFILES = {
|
|
|
20
20
|
},
|
|
21
21
|
};
|
|
22
22
|
const osProfile = (platform = process.platform) => OS_PROFILES[platform === 'darwin' ? 'darwin' : platform === 'win32' ? 'win32' : 'linux'];
|
|
23
|
+
const safeVersion = (version) => (/^\d+(\.\d+)*$/.test(version) ? version : STEALTH_UA_VERSION);
|
|
24
|
+
const userAgentFor = (platform, version) => `Mozilla/5.0 (${osProfile(platform).uaPlatform}) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/${safeVersion(version)} Safari/537.36`;
|
|
23
25
|
export function stealthUserAgent(platform = process.platform) {
|
|
24
|
-
return
|
|
26
|
+
return userAgentFor(platform, STEALTH_UA_VERSION);
|
|
25
27
|
}
|
|
26
28
|
export function stealthLaunchArgs() {
|
|
27
29
|
return ['--disable-blink-features=AutomationControlled'];
|
|
@@ -29,9 +31,27 @@ export function stealthLaunchArgs() {
|
|
|
29
31
|
export function stealthContextOptions(platform = process.platform) {
|
|
30
32
|
return { userAgent: stealthUserAgent(platform), locale: STEALTH_LOCALE };
|
|
31
33
|
}
|
|
32
|
-
export function desktopUaOverride(platform = process.platform) {
|
|
34
|
+
export function desktopUaOverride(platform = process.platform, version = STEALTH_UA_VERSION) {
|
|
33
35
|
const profile = osProfile(platform);
|
|
34
|
-
return { userAgent:
|
|
36
|
+
return { userAgent: userAgentFor(platform, version), acceptLanguage: STEALTH_ACCEPT_LANGUAGE, platform: profile.cdpPlatform };
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* The client-hint (UA-CH) metadata Chromium itself would send for this browser.
|
|
40
|
+
* An Emulation.setUserAgentOverride without userAgentMetadata stops Chromium from
|
|
41
|
+
* sending Sec-CH-UA headers at all, so every override carries a matching set:
|
|
42
|
+
* the brand and major version mirror the real running browser and the platform
|
|
43
|
+
* mirrors the UA string, keeping UA and client hints consistent for bot checks.
|
|
44
|
+
*/
|
|
45
|
+
export function userAgentMetadata(version, mobile = false) {
|
|
46
|
+
const major = (typeof version === 'string' && /^\d+/.test(version) ? version : STEALTH_UA_VERSION).split('.')[0];
|
|
47
|
+
return {
|
|
48
|
+
brands: [{ brand: 'Chromium', version: major }, { brand: 'Not:A-Brand', version: '99' }],
|
|
49
|
+
mobile,
|
|
50
|
+
model: mobile ? 'Pixel 8' : '',
|
|
51
|
+
platform: mobile ? 'Android' : process.platform === 'darwin' ? 'macOS' : process.platform === 'win32' ? 'Windows' : 'Linux',
|
|
52
|
+
platformVersion: mobile ? '14' : '10.0.0',
|
|
53
|
+
architecture: mobile ? '' : 'x86',
|
|
54
|
+
};
|
|
35
55
|
}
|
|
36
56
|
const clampCores = (cores) => Math.min(Math.max(cores || 8, 2), 16);
|
|
37
57
|
const PAGE_SCRIPT = `(cfg => {
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
--accent-hover: #ffffff; --accent-ring: rgba(245,245,245,.36);
|
|
48
48
|
--accent-fill: #1372da; --accent-fill-hover: #2a7fdd; --on-accent-fill: #f5f5f5;
|
|
49
49
|
--accent-text: #71aeff; --focus: #1f87fc;
|
|
50
|
-
--ok: #2f9e6a; --err: #e5484d; --warn: #c9c9c9;
|
|
51
|
-
--ok-text: #7cc79a; --err-text: #f47174; --warn-text: #ececec; --merged-text: #bba4f2;
|
|
50
|
+
--ok: #2f9e6a; --err: #e5484d; --warn: #c9c9c9; --caution: #d9a520; --caution-text: #f2c94c;
|
|
51
|
+
--ok-text: #7cc79a; --err-text: #f47174; --warn-text: #ececec; --merged-text: #bba4f2; --draft-text: #f0a35e;
|
|
52
52
|
--skill: #aab8ff; --skill-wash: rgba(120,140,255,.18);
|
|
53
53
|
--ok-wash: rgba(47,158,106,.14); --err-wash: rgba(229,72,77,.14); --merged-wash: rgba(142,110,224,.14);
|
|
54
54
|
--add-wash: rgba(47,158,106,.16); --del-wash: rgba(229,72,77,.16);
|
|
@@ -94,8 +94,8 @@
|
|
|
94
94
|
--accent-hover: #333333; --accent-ring: rgba(28,28,28,.48);
|
|
95
95
|
--accent-fill: #1680f3; --accent-fill-hover: #1776dd; --on-accent-fill: #ffffff;
|
|
96
96
|
--accent-text: #0b6dd3; --focus: #1680f3;
|
|
97
|
-
--ok: #3d7a5c; --err: #d13438; --warn: #45464b;
|
|
98
|
-
--ok-text: #36704f; --err-text: #c4262e; --warn-text: #1c1c1c; --merged-text: #6a4fc4;
|
|
97
|
+
--ok: #3d7a5c; --err: #d13438; --warn: #45464b; --caution: #b8860b; --caution-text: #8a6100;
|
|
98
|
+
--ok-text: #36704f; --err-text: #c4262e; --warn-text: #1c1c1c; --merged-text: #6a4fc4; --draft-text: #b35a0e;
|
|
99
99
|
--skill: #3b4fc4; --skill-wash: rgba(59,79,196,.10);
|
|
100
100
|
--ok-wash: rgba(61,122,92,.08); --err-wash: rgba(209,52,56,.08); --merged-wash: rgba(106,79,196,.08);
|
|
101
101
|
--add-wash: rgba(61,122,92,.14); --del-wash: rgba(209,52,56,.13);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type ExternalAppPrompt } from './browser-external-app.js';
|
|
1
2
|
import type { ImportedCookie } from './firefox-cookies.js';
|
|
2
3
|
import type { ExtensionStatus } from './browser-extensions.js';
|
|
3
4
|
export type BrowserViewChannel = 'chromium' | 'msedge' | 'chrome';
|
|
@@ -12,6 +13,7 @@ export interface BrowserViewTab {
|
|
|
12
13
|
url: string;
|
|
13
14
|
title: string;
|
|
14
15
|
loading: boolean;
|
|
16
|
+
appPrompt?: ExternalAppPrompt;
|
|
15
17
|
}
|
|
16
18
|
export declare const VIEW_TAB_LIMIT = 6;
|
|
17
19
|
export declare const VIEW_SESSION_LIMIT = 4;
|
|
@@ -34,6 +36,28 @@ export declare function nextFrameBudget(budget: {
|
|
|
34
36
|
size: number;
|
|
35
37
|
} | undefined;
|
|
36
38
|
export declare const VIEW_MOBILE_USER_AGENT = "Mozilla/5.0 (Linux; Android 14; Pixel 8) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/140.0.0.0 Mobile Safari/537.36";
|
|
39
|
+
/**
|
|
40
|
+
* The panel browses with a real headed window so sites score it as a browser and
|
|
41
|
+
* not a bot, but the window is parked far offscreen: the pane shows the page by
|
|
42
|
+
* screencasting it, so the window does not need to be on screen or in the way.
|
|
43
|
+
* -32000 is the standard spot that Windows, macOS and Linux all keep off the
|
|
44
|
+
* visible desktop without clamping back.
|
|
45
|
+
*/
|
|
46
|
+
export declare const VIEW_OFFSCREEN_POSITION: {
|
|
47
|
+
readonly left: -32000;
|
|
48
|
+
readonly top: -32000;
|
|
49
|
+
};
|
|
50
|
+
/** Where the window goes when the user asks to see it. */
|
|
51
|
+
export declare const VIEW_ONSCREEN_POSITION: {
|
|
52
|
+
readonly left: 80;
|
|
53
|
+
readonly top: 80;
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* The mobile emulation override is built from the running browser's real version,
|
|
57
|
+
* so the page never sees a version the browser itself does not have. Without a
|
|
58
|
+
* readable version the old constant stays the fallback.
|
|
59
|
+
*/
|
|
60
|
+
export declare function mobileUserAgent(version: string | undefined): string;
|
|
37
61
|
export declare function browserViewUrl(value: string): string;
|
|
38
62
|
export declare function clampViewport(width: unknown, height: unknown): {
|
|
39
63
|
width: number;
|
|
@@ -55,6 +79,14 @@ export declare const MODIFIER_BITS: Record<string, number>;
|
|
|
55
79
|
export declare function modifierMask(modifiers: unknown): number;
|
|
56
80
|
export declare function macEditingCommands(key: string, modifiers: number): string[];
|
|
57
81
|
export declare function viewLaunchOptions(channel: BrowserViewChannel, executablePath: string, scale?: number, extensionPaths?: string[]): Record<string, unknown>;
|
|
82
|
+
/**
|
|
83
|
+
* The options the panel actually launches with: the stealth launch options above,
|
|
84
|
+
* but headed, with the real window parked offscreen. A real window is what bot
|
|
85
|
+
* checks (Cloudflare's managed challenge among them) look for; the pane shows the
|
|
86
|
+
* page by screencasting it, so the window does not have to be visible or in the
|
|
87
|
+
* way. parkWindow re-asserts the offscreen position after the launch.
|
|
88
|
+
*/
|
|
89
|
+
export declare function headedViewLaunchOptions(channel: BrowserViewChannel, executablePath: string, scale?: number, extensionPaths?: string[]): Record<string, unknown>;
|
|
58
90
|
export declare function frameGate(now: number, lastEmittedAt: number | undefined, minIntervalMs: number): boolean;
|
|
59
91
|
export declare function channelCandidate(channel: BrowserViewChannel, platform: NodeJS.Platform, chromiumExecutable: () => string): string | undefined;
|
|
60
92
|
export type BrowserViewProfileKind = 'project' | 'incognito' | 'isolated';
|
|
@@ -113,6 +145,39 @@ export declare class BrowserViewManager {
|
|
|
113
145
|
private launch;
|
|
114
146
|
private launchPersistent;
|
|
115
147
|
private reportLoaded;
|
|
148
|
+
/**
|
|
149
|
+
* Re-assert the offscreen position over the browser-level CDP connection after
|
|
150
|
+
* the launch. --window-position already asks for it at startup; this second
|
|
151
|
+
* pass catches window managers that clamp the window back on screen (macOS has
|
|
152
|
+
* done so with very large negative coordinates).
|
|
153
|
+
*/
|
|
154
|
+
private parkWindow;
|
|
155
|
+
/**
|
|
156
|
+
* Finds the id of the window that should be moved. The precise way is the target
|
|
157
|
+
* id of the tab the user is looking at; without one the browser target itself has
|
|
158
|
+
* no web contents to look a window up with, so the newest page target is used.
|
|
159
|
+
*/
|
|
160
|
+
private windowIdFor;
|
|
161
|
+
private lookupWindowId;
|
|
162
|
+
private browserFor;
|
|
163
|
+
private browserCdpFor;
|
|
164
|
+
showWindow(sessionId: string): Promise<void>;
|
|
165
|
+
hideWindow(sessionId: string): Promise<void>;
|
|
166
|
+
/**
|
|
167
|
+
* Whether the native window holding this tab is on the user's screen right now.
|
|
168
|
+
* Sessions of one project share a window, so one session can hide what another
|
|
169
|
+
* showed; the window's own bounds are the only record that stays true.
|
|
170
|
+
*/
|
|
171
|
+
private windowOnScreen;
|
|
172
|
+
/**
|
|
173
|
+
* An app link got past the in-page guard. With the window on screen the user can
|
|
174
|
+
* see the browser's prompt; otherwise the tab is flagged so the panel and the
|
|
175
|
+
* agent are told why it stopped responding.
|
|
176
|
+
*/
|
|
177
|
+
private flagAppPrompt;
|
|
178
|
+
/** What to tell the agent when a tab may be stuck behind the browser's "Open app?" prompt. */
|
|
179
|
+
appPromptNote(sessionId: string, tabId?: string): string | undefined;
|
|
180
|
+
private moveWindow;
|
|
116
181
|
restartForExtensions(force?: boolean): Promise<{
|
|
117
182
|
restarted: number;
|
|
118
183
|
pending: string[];
|
|
@@ -130,6 +195,13 @@ export declare class BrowserViewManager {
|
|
|
130
195
|
private armRestartPoll;
|
|
131
196
|
private restartProfile;
|
|
132
197
|
private acquireProfile;
|
|
198
|
+
/**
|
|
199
|
+
* Closes the blank pages a persistent launch was left holding, once the profile
|
|
200
|
+
* has at least one real page: under a headed launch the initial about:blank is
|
|
201
|
+
* the only tab of the real window, and closing it while it is alone destroys the
|
|
202
|
+
* window, so the blanks are held until a real page keeps the window alive.
|
|
203
|
+
*/
|
|
204
|
+
private drainPendingBlanks;
|
|
133
205
|
private claimExtensionPage;
|
|
134
206
|
private claimUnclaimed;
|
|
135
207
|
private releaseProfile;
|
|
@@ -145,6 +217,15 @@ export declare class BrowserViewManager {
|
|
|
145
217
|
private showTab;
|
|
146
218
|
private applyViewportMode;
|
|
147
219
|
private queueViewportMode;
|
|
220
|
+
private browserVersion;
|
|
221
|
+
/**
|
|
222
|
+
* The desktop override after mobile emulation: built from the real running
|
|
223
|
+
* browser version when it is readable, falling back to the stealth version when
|
|
224
|
+
* it is not. A desktop UA carrying a version the running browser does not have
|
|
225
|
+
* is exactly what fingerprinting checks catch, so the real one wins whenever it
|
|
226
|
+
* is available.
|
|
227
|
+
*/
|
|
228
|
+
private applyDesktopIdentity;
|
|
148
229
|
private emitFrame;
|
|
149
230
|
private startScreencast;
|
|
150
231
|
private shrinkStream;
|