@namzu/browser 0.1.0
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/CHANGELOG.md +32 -0
- package/LICENSE.md +110 -0
- package/README.md +149 -0
- package/dist/classifier.d.ts +70 -0
- package/dist/classifier.d.ts.map +1 -0
- package/dist/classifier.js +147 -0
- package/dist/classifier.js.map +1 -0
- package/dist/detect.d.ts +126 -0
- package/dist/detect.d.ts.map +1 -0
- package/dist/detect.js +282 -0
- package/dist/detect.js.map +1 -0
- package/dist/errors.d.ts +64 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +99 -0
- package/dist/errors.js.map +1 -0
- package/dist/host.d.ts +167 -0
- package/dist/host.d.ts.map +1 -0
- package/dist/host.js +1024 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +10 -0
- package/dist/index.js.map +1 -0
- package/dist/page-scripts.d.ts +51 -0
- package/dist/page-scripts.d.ts.map +1 -0
- package/dist/page-scripts.js +123 -0
- package/dist/page-scripts.js.map +1 -0
- package/dist/policy.d.ts +61 -0
- package/dist/policy.d.ts.map +1 -0
- package/dist/policy.js +150 -0
- package/dist/policy.js.map +1 -0
- package/dist/profiles.d.ts +107 -0
- package/dist/profiles.d.ts.map +1 -0
- package/dist/profiles.js +312 -0
- package/dist/profiles.js.map +1 -0
- package/dist/relay.d.ts +27 -0
- package/dist/relay.d.ts.map +1 -0
- package/dist/relay.js +69 -0
- package/dist/relay.js.map +1 -0
- package/dist/snapshot.d.ts +101 -0
- package/dist/snapshot.d.ts.map +1 -0
- package/dist/snapshot.js +265 -0
- package/dist/snapshot.js.map +1 -0
- package/dist/windows-bridge-script.d.ts +29 -0
- package/dist/windows-bridge-script.d.ts.map +1 -0
- package/dist/windows-bridge-script.js +161 -0
- package/dist/windows-bridge-script.js.map +1 -0
- package/dist/windows-bridge.d.ts +120 -0
- package/dist/windows-bridge.d.ts.map +1 -0
- package/dist/windows-bridge.js +267 -0
- package/dist/windows-bridge.js.map +1 -0
- package/dist/windows-engine.d.ts +55 -0
- package/dist/windows-engine.d.ts.map +1 -0
- package/dist/windows-engine.js +154 -0
- package/dist/windows-engine.js.map +1 -0
- package/dist/wsl.d.ts +52 -0
- package/dist/wsl.d.ts.map +1 -0
- package/dist/wsl.js +134 -0
- package/dist/wsl.js.map +1 -0
- package/package.json +74 -0
- package/src/classifier.ts +191 -0
- package/src/detect.ts +432 -0
- package/src/errors.ts +121 -0
- package/src/host.ts +1217 -0
- package/src/index.ts +79 -0
- package/src/page-scripts.ts +154 -0
- package/src/policy.ts +190 -0
- package/src/profiles.ts +373 -0
- package/src/relay.ts +101 -0
- package/src/snapshot.ts +317 -0
- package/src/windows-bridge-script.ts +160 -0
- package/src/windows-bridge.ts +358 -0
- package/src/windows-engine.ts +208 -0
- package/src/wsl.ts +155 -0
package/dist/detect.js
ADDED
|
@@ -0,0 +1,282 @@
|
|
|
1
|
+
import { execFileSync } from 'node:child_process';
|
|
2
|
+
import { existsSync, readFileSync, readdirSync, statSync } from 'node:fs';
|
|
3
|
+
import { DEFAULT_WSL_MOUNT_ROOT, WSL_RUN_DIR, findWslInteropSocket, parseNetworkingModeOutput, parseWslConfigNetworkingMode, parseWslMountRoot, wslPathToWindows, } from './wsl.js';
|
|
4
|
+
/** Probes over the real file system. */
|
|
5
|
+
export const nodeBrowserProbes = {
|
|
6
|
+
exists: (path) => {
|
|
7
|
+
try {
|
|
8
|
+
return existsSync(path);
|
|
9
|
+
}
|
|
10
|
+
catch {
|
|
11
|
+
return false;
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
readFile: (path) => {
|
|
15
|
+
try {
|
|
16
|
+
return readFileSync(path, 'utf8');
|
|
17
|
+
}
|
|
18
|
+
catch {
|
|
19
|
+
return undefined;
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
listDir: (path) => {
|
|
23
|
+
try {
|
|
24
|
+
return readdirSync(path);
|
|
25
|
+
}
|
|
26
|
+
catch {
|
|
27
|
+
return [];
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
modifiedMs: (path) => {
|
|
31
|
+
try {
|
|
32
|
+
return statSync(path).mtimeMs;
|
|
33
|
+
}
|
|
34
|
+
catch {
|
|
35
|
+
return undefined;
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
run: (file, args) => {
|
|
39
|
+
try {
|
|
40
|
+
return execFileSync(file, [...args], {
|
|
41
|
+
encoding: 'utf8',
|
|
42
|
+
timeout: 3_000,
|
|
43
|
+
stdio: ['ignore', 'pipe', 'ignore'],
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
catch {
|
|
47
|
+
return undefined;
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
};
|
|
51
|
+
const WSL_POWERSHELL_TAIL = 'c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe';
|
|
52
|
+
/** Where the Windows browsers install, relative to the mount root. */
|
|
53
|
+
const WSL_WINDOWS_BROWSERS = [
|
|
54
|
+
{ browser: 'chrome', tail: 'c/Program Files/Google/Chrome/Application/chrome.exe' },
|
|
55
|
+
{ browser: 'chrome', tail: 'c/Program Files (x86)/Google/Chrome/Application/chrome.exe' },
|
|
56
|
+
{ browser: 'msedge', tail: 'c/Program Files (x86)/Microsoft/Edge/Application/msedge.exe' },
|
|
57
|
+
{ browser: 'msedge', tail: 'c/Program Files/Microsoft/Edge/Application/msedge.exe' },
|
|
58
|
+
];
|
|
59
|
+
const WSLINFO = '/usr/bin/wslinfo';
|
|
60
|
+
/** Profile folders under `C:\Users` that are not a person's. */
|
|
61
|
+
const NOT_A_USER = new Set(['all users', 'default', 'default user', 'public', 'desktop.ini']);
|
|
62
|
+
/**
|
|
63
|
+
* The VM's networking mode: `wslinfo --networking-mode` when WSL has it;
|
|
64
|
+
* otherwise the one `.wslconfig` under `C:\Users` (when exactly one user has
|
|
65
|
+
* one); otherwise `unknown`, which is treated as NAT.
|
|
66
|
+
*/
|
|
67
|
+
export function wslNetworkingMode(probes, mountRoot = DEFAULT_WSL_MOUNT_ROOT) {
|
|
68
|
+
if (probes.run && probes.exists(WSLINFO)) {
|
|
69
|
+
const mode = parseNetworkingModeOutput(probes.run(WSLINFO, ['--networking-mode']));
|
|
70
|
+
if (mode !== 'unknown')
|
|
71
|
+
return mode;
|
|
72
|
+
}
|
|
73
|
+
const users = `${mountRoot}c/Users`;
|
|
74
|
+
const configs = probes
|
|
75
|
+
.listDir(users)
|
|
76
|
+
.filter((name) => !NOT_A_USER.has(name.toLowerCase()))
|
|
77
|
+
.map((name) => `${users}/${name}/.wslconfig`)
|
|
78
|
+
.filter((path) => probes.exists(path));
|
|
79
|
+
if (configs.length !== 1)
|
|
80
|
+
return 'unknown';
|
|
81
|
+
return parseWslConfigNetworkingMode(probes.readFile(configs[0]));
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* The interop socket to give a Windows program: the environment's
|
|
85
|
+
* `WSL_INTEROP` when it exists, else one under `/run/WSL`.
|
|
86
|
+
*/
|
|
87
|
+
export function wslInteropSocket(env, probes) {
|
|
88
|
+
if (env.WSL_INTEROP && probes.exists(env.WSL_INTEROP))
|
|
89
|
+
return env.WSL_INTEROP;
|
|
90
|
+
const sockets = probes
|
|
91
|
+
.listDir(WSL_RUN_DIR)
|
|
92
|
+
.filter((name) => /^\d+_interop$/.test(name))
|
|
93
|
+
.map((name) => {
|
|
94
|
+
const path = `${WSL_RUN_DIR}/${name}`;
|
|
95
|
+
return { path, mtimeMs: probes.modifiedMs?.(path) ?? 0 };
|
|
96
|
+
});
|
|
97
|
+
return findWslInteropSocket(sockets);
|
|
98
|
+
}
|
|
99
|
+
const LINUX_CHROME = ['/opt/google/chrome/chrome'];
|
|
100
|
+
const DARWIN_CHROME = ['/Applications/Google Chrome.app/Contents/MacOS/Google Chrome'];
|
|
101
|
+
function windowsBrowserPaths(env, browser) {
|
|
102
|
+
const roots = [env.PROGRAMFILES, env['PROGRAMFILES(X86)'], env.LOCALAPPDATA].filter((root) => typeof root === 'string' && root.length > 0);
|
|
103
|
+
const tail = browser === 'chrome'
|
|
104
|
+
? '\\Google\\Chrome\\Application\\chrome.exe'
|
|
105
|
+
: '\\Microsoft\\Edge\\Application\\msedge.exe';
|
|
106
|
+
return roots.map((root) => `${root.replace(/[\\/]+$/, '')}${tail}`);
|
|
107
|
+
}
|
|
108
|
+
/** Is this Linux kernel WSL's? The environment variables are absent under a systemd service. */
|
|
109
|
+
export function isWsl(env, probes) {
|
|
110
|
+
if (env.WSL_DISTRO_NAME || env.WSL_INTEROP)
|
|
111
|
+
return true;
|
|
112
|
+
const release = probes.readFile('/proc/sys/kernel/osrelease') ?? '';
|
|
113
|
+
return /microsoft|wsl/i.test(release);
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Can this WSL process start Windows programs? The binfmt handler must be
|
|
117
|
+
* registered, and a socket must be reachable: `WSL_INTEROP`, or one under
|
|
118
|
+
* `/run/WSL` (all a systemd user service has).
|
|
119
|
+
*/
|
|
120
|
+
export function wslInteropAvailable(env, probes) {
|
|
121
|
+
const registered = probes.exists('/proc/sys/fs/binfmt_misc/WSLInterop') ||
|
|
122
|
+
probes.exists('/proc/sys/fs/binfmt_misc/WSLInterop-late');
|
|
123
|
+
if (!registered)
|
|
124
|
+
return false;
|
|
125
|
+
if (env.WSL_INTEROP && probes.exists(env.WSL_INTEROP))
|
|
126
|
+
return true;
|
|
127
|
+
return probes.listDir('/run/WSL').some((name) => name.endsWith('_interop'));
|
|
128
|
+
}
|
|
129
|
+
function hasDisplay(env) {
|
|
130
|
+
return Boolean(env.DISPLAY || env.WAYLAND_DISPLAY);
|
|
131
|
+
}
|
|
132
|
+
function headlessFor(setting, mode, display) {
|
|
133
|
+
if (setting === 'always')
|
|
134
|
+
return { headless: true };
|
|
135
|
+
if (setting === 'never') {
|
|
136
|
+
return display
|
|
137
|
+
? { headless: false }
|
|
138
|
+
: {
|
|
139
|
+
headless: false,
|
|
140
|
+
unavailableReason: 'A visible browser window was asked for (headless: never), but there is no display: neither DISPLAY nor WAYLAND_DISPLAY is set. Run under a desktop session, with ssh -X, or with xvfb-run.',
|
|
141
|
+
};
|
|
142
|
+
}
|
|
143
|
+
return { headless: !(display && mode === 'interactive') };
|
|
144
|
+
}
|
|
145
|
+
function localPlan(platform, env, probes, options, warnings) {
|
|
146
|
+
const display = platform === 'darwin' || platform === 'win32' ? true : hasDisplay(env);
|
|
147
|
+
let browser = 'chromium';
|
|
148
|
+
if (platform === 'linux' || platform === 'wsl') {
|
|
149
|
+
if (LINUX_CHROME.some((p) => probes.exists(p)))
|
|
150
|
+
browser = 'chrome';
|
|
151
|
+
}
|
|
152
|
+
else if (platform === 'darwin') {
|
|
153
|
+
if (DARWIN_CHROME.some((p) => probes.exists(p)))
|
|
154
|
+
browser = 'chrome';
|
|
155
|
+
}
|
|
156
|
+
else if (windowsBrowserPaths(env, 'chrome').some((p) => probes.exists(p))) {
|
|
157
|
+
browser = 'chrome';
|
|
158
|
+
}
|
|
159
|
+
else if (windowsBrowserPaths(env, 'msedge').some((p) => probes.exists(p))) {
|
|
160
|
+
browser = 'msedge';
|
|
161
|
+
}
|
|
162
|
+
if (!display) {
|
|
163
|
+
warnings.push('No display (DISPLAY and WAYLAND_DISPLAY are unset): the browser runs headless, and signing in to a profile needs a machine with a display.');
|
|
164
|
+
}
|
|
165
|
+
const { headless, unavailableReason } = headlessFor(options.headless, options.mode, display);
|
|
166
|
+
return {
|
|
167
|
+
engine: 'local',
|
|
168
|
+
platform,
|
|
169
|
+
browser,
|
|
170
|
+
...(browser === 'chromium' ? {} : { channel: browser }),
|
|
171
|
+
headless,
|
|
172
|
+
display,
|
|
173
|
+
warnings,
|
|
174
|
+
...(unavailableReason !== undefined ? { unavailableReason } : {}),
|
|
175
|
+
};
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* The engine plan for this environment. Pure over its arguments: the
|
|
179
|
+
* environment, the platform, and the probes answer every question.
|
|
180
|
+
*/
|
|
181
|
+
export function detectBrowserEnvironment(env, platform, probes = nodeBrowserProbes, options = {}) {
|
|
182
|
+
const settings = {
|
|
183
|
+
engine: options.engine ?? 'auto',
|
|
184
|
+
headless: options.headless ?? 'auto',
|
|
185
|
+
mode: options.mode ?? 'interactive',
|
|
186
|
+
};
|
|
187
|
+
if (platform === 'darwin' || platform === 'win32') {
|
|
188
|
+
const plan = localPlan(platform, env, probes, settings, []);
|
|
189
|
+
if (settings.engine === 'windows') {
|
|
190
|
+
return {
|
|
191
|
+
...plan,
|
|
192
|
+
unavailableReason: 'engine "windows" drives a Windows browser from WSL; this is not WSL. Use engine "auto" or "local".',
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
return plan;
|
|
196
|
+
}
|
|
197
|
+
if (platform !== 'linux') {
|
|
198
|
+
return {
|
|
199
|
+
engine: 'local',
|
|
200
|
+
platform: 'linux',
|
|
201
|
+
browser: 'chromium',
|
|
202
|
+
headless: true,
|
|
203
|
+
display: false,
|
|
204
|
+
warnings: [],
|
|
205
|
+
unavailableReason: `The browser is not supported on ${platform}.`,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
if (!isWsl(env, probes)) {
|
|
209
|
+
const plan = localPlan('linux', env, probes, settings, []);
|
|
210
|
+
if (settings.engine === 'windows') {
|
|
211
|
+
return {
|
|
212
|
+
...plan,
|
|
213
|
+
unavailableReason: 'engine "windows" drives a Windows browser from WSL; this is not WSL. Use engine "auto" or "local".',
|
|
214
|
+
};
|
|
215
|
+
}
|
|
216
|
+
return plan;
|
|
217
|
+
}
|
|
218
|
+
// WSL.
|
|
219
|
+
if (settings.engine === 'local')
|
|
220
|
+
return localPlan('wsl', env, probes, settings, []);
|
|
221
|
+
const mountRoot = parseWslMountRoot(probes.readFile('/etc/wsl.conf'));
|
|
222
|
+
const interop = wslInteropAvailable(env, probes);
|
|
223
|
+
const powershellPath = `${mountRoot}${WSL_POWERSHELL_TAIL}`;
|
|
224
|
+
const powershell = probes.exists(powershellPath) ? powershellPath : undefined;
|
|
225
|
+
const installed = WSL_WINDOWS_BROWSERS.map((b) => ({
|
|
226
|
+
browser: b.browser,
|
|
227
|
+
path: `${mountRoot}${b.tail}`,
|
|
228
|
+
})).filter((b) => probes.exists(b.path));
|
|
229
|
+
const preferred = options.windowsBrowser;
|
|
230
|
+
const windowsBrowser = (preferred ? installed.find((b) => b.browser === preferred) : undefined) ?? installed[0];
|
|
231
|
+
const warnings = [];
|
|
232
|
+
if (preferred && windowsBrowser && windowsBrowser.browser !== preferred) {
|
|
233
|
+
warnings.push(`${preferred === 'chrome' ? 'Google Chrome' : 'Microsoft Edge'} is not installed on Windows; using ${windowsBrowser.browser === 'chrome' ? 'Google Chrome' : 'Microsoft Edge'}.`);
|
|
234
|
+
}
|
|
235
|
+
if (!interop || !powershell || !windowsBrowser) {
|
|
236
|
+
const why = !interop
|
|
237
|
+
? 'WSL interop is off, so Windows programs cannot be started'
|
|
238
|
+
: !powershell
|
|
239
|
+
? `powershell.exe was not found at ${powershellPath}`
|
|
240
|
+
: 'no Windows Chrome or Edge was found under C:\\Program Files';
|
|
241
|
+
if (settings.engine === 'windows') {
|
|
242
|
+
return {
|
|
243
|
+
...localPlan('wsl', env, probes, settings, []),
|
|
244
|
+
unavailableReason: `engine "windows" was asked for, but ${why}.`,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
return localPlan('wsl', env, probes, settings, [
|
|
248
|
+
`Using Chromium inside WSL: ${why}. Sites see a Linux browser, and a visible window needs WSLg.`,
|
|
249
|
+
]);
|
|
250
|
+
}
|
|
251
|
+
// The Windows browser has the Windows desktop for a display, whatever
|
|
252
|
+
// WSLg says; headless follows the setting and the mode alone.
|
|
253
|
+
const { headless } = headlessFor(settings.headless, settings.mode, true);
|
|
254
|
+
const socket = wslInteropSocket(env, probes);
|
|
255
|
+
const windowsExecutable = wslPathToWindows(windowsBrowser.path, mountRoot);
|
|
256
|
+
return {
|
|
257
|
+
engine: 'windows-cdp',
|
|
258
|
+
platform: 'wsl',
|
|
259
|
+
browser: windowsBrowser.browser,
|
|
260
|
+
executable: windowsBrowser.path,
|
|
261
|
+
windowsExecutable,
|
|
262
|
+
powershell,
|
|
263
|
+
mountRoot,
|
|
264
|
+
networkingMode: wslNetworkingMode(probes, mountRoot),
|
|
265
|
+
...(socket !== undefined && socket !== env.WSL_INTEROP ? { interopSocket: socket } : {}),
|
|
266
|
+
headless,
|
|
267
|
+
display: true,
|
|
268
|
+
warnings,
|
|
269
|
+
};
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* The plan to actually run: the plan itself, or its fallback when it is
|
|
273
|
+
* unavailable and has one. Still possibly unavailable — check
|
|
274
|
+
* `unavailableReason`.
|
|
275
|
+
*/
|
|
276
|
+
export function runnableBrowserPlan(plan) {
|
|
277
|
+
if (plan.unavailableReason !== undefined && plan.engine === 'windows-cdp' && plan.fallback) {
|
|
278
|
+
return plan.fallback;
|
|
279
|
+
}
|
|
280
|
+
return plan;
|
|
281
|
+
}
|
|
282
|
+
//# sourceMappingURL=detect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"detect.js","sourceRoot":"","sources":["../src/detect.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AACjD,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AACzE,OAAO,EACN,sBAAsB,EACtB,WAAW,EAEX,oBAAoB,EACpB,yBAAyB,EACzB,4BAA4B,EAC5B,iBAAiB,EACjB,gBAAgB,GAChB,MAAM,UAAU,CAAA;AAwGjB,wCAAwC;AACxC,MAAM,CAAC,MAAM,iBAAiB,GAA6B;IAC1D,MAAM,EAAE,CAAC,IAAI,EAAE,EAAE;QAChB,IAAI,CAAC;YACJ,OAAO,UAAU,CAAC,IAAI,CAAC,CAAA;QACxB,CAAC;QAA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E;YAC9C,8BAA8B,GAAG,+DAA+D;SAChG,CAAC,CAAA;IACH,CAAC;IACD,sEAAsE;IACtE,8DAA8D;IAC9D,MAAM,EAAE,QAAQ,EAAE,GAAG,WAAW,CAAC,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,IAAI,EAAE,IAAI,CAAC,CAAA;IACxE,MAAM,MAAM,GAAG,gBAAgB,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5C,MAAM,iBAAiB,GAAG,gBAAgB,CAAC,cAAc,CAAC,IAAI,EAAE,SAAS,CAAW,CAAA;IACpF,OAAO;QACN,MAAM,EAAE,aAAa;QACrB,QAAQ,EAAE,KAAK;QACf,OAAO,EAAE,cAAc,CAAC,OAAO;QAC/B,UAAU,EAAE,cAAc,CAAC,IAAI;QAC/B,iBAAiB;QACjB,UAAU;QACV,SAAS;QACT,cAAc,EAAE,iBAAiB,CAAC,MAAM,EAAE,SAAS,CAAC;QACpD,GAAG,CAAC,MAAM,KAAK,SAAS,IAAI,MAAM,KAAK,GAAG,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,MAAM,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACxF,QAAQ;QACR,OAAO,EAAE,IAAI;QACb,QAAQ;KACR,CAAA;AACF,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAuB;IAC1D,IAAI,IAAI,CAAC,iBAAiB,KAAK,SAAS,IAAI,IAAI,CAAC,MAAM,KAAK,aAAa,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC5F,OAAO,IAAI,CAAC,QAAQ,CAAA;IACrB,CAAC;IACD,OAAO,IAAI,CAAA;AACZ,CAAC"}
|
package/dist/errors.d.ts
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { BrowserActionName, BrowserHumanRequired, BrowserHumanRequiredReason, BrowserOriginMismatch, BrowserOutcomeUnknown, BrowserSiteDenied, BrowserStaleRef } from '@namzu/sdk';
|
|
2
|
+
/**
|
|
3
|
+
* The browser cannot run here: the engine is not installed, there is no
|
|
4
|
+
* display for a visible window, the engine this environment needs is not in
|
|
5
|
+
* this build. `reason` is a sentence for a person and ends with what to do.
|
|
6
|
+
*/
|
|
7
|
+
export declare class BrowserUnavailableError extends Error {
|
|
8
|
+
readonly reason: string;
|
|
9
|
+
readonly name = "BrowserUnavailableError";
|
|
10
|
+
readonly code: "browser_unavailable";
|
|
11
|
+
constructor(reason: string);
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Another browser holds the profile. A local profile directory can be opened
|
|
15
|
+
* by one browser process at a time; `holders` names the processes that hold
|
|
16
|
+
* it, as `<pid>-<session>`.
|
|
17
|
+
*/
|
|
18
|
+
export declare class ProfileBusyError extends Error {
|
|
19
|
+
readonly profile: string;
|
|
20
|
+
readonly holders: readonly string[];
|
|
21
|
+
readonly name = "ProfileBusyError";
|
|
22
|
+
readonly code: "browser_profile_busy";
|
|
23
|
+
constructor(profile: string, holders: readonly string[]);
|
|
24
|
+
}
|
|
25
|
+
export declare class BrowserOriginMismatchError extends Error implements BrowserOriginMismatch {
|
|
26
|
+
readonly expected: string;
|
|
27
|
+
readonly actual: string;
|
|
28
|
+
readonly name = "BrowserOriginMismatchError";
|
|
29
|
+
readonly code: "browser_origin_mismatch";
|
|
30
|
+
constructor(expected: string, actual: string);
|
|
31
|
+
}
|
|
32
|
+
export declare class BrowserStaleRefError extends Error implements BrowserStaleRef {
|
|
33
|
+
readonly ref: string;
|
|
34
|
+
readonly name = "BrowserStaleRefError";
|
|
35
|
+
readonly code: "browser_stale_ref";
|
|
36
|
+
constructor(ref: string);
|
|
37
|
+
}
|
|
38
|
+
export declare class BrowserHumanRequiredError extends Error implements BrowserHumanRequired {
|
|
39
|
+
readonly reason: BrowserHumanRequiredReason;
|
|
40
|
+
readonly origin: string;
|
|
41
|
+
readonly name = "BrowserHumanRequiredError";
|
|
42
|
+
readonly code: "browser_human_required";
|
|
43
|
+
readonly profile?: string;
|
|
44
|
+
readonly loginCommand?: string;
|
|
45
|
+
constructor(reason: BrowserHumanRequiredReason, origin: string, options?: {
|
|
46
|
+
profile?: string;
|
|
47
|
+
loginCommand?: string;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
export declare class BrowserSiteDeniedError extends Error implements BrowserSiteDenied {
|
|
51
|
+
readonly origin: string;
|
|
52
|
+
readonly name = "BrowserSiteDeniedError";
|
|
53
|
+
readonly code: "browser_site_denied";
|
|
54
|
+
constructor(origin: string, detail?: string);
|
|
55
|
+
}
|
|
56
|
+
export declare class BrowserOutcomeUnknownError extends Error implements BrowserOutcomeUnknown {
|
|
57
|
+
readonly action: BrowserActionName;
|
|
58
|
+
readonly name = "BrowserOutcomeUnknownError";
|
|
59
|
+
readonly code: "browser_outcome_unknown";
|
|
60
|
+
readonly outcome: "unknown";
|
|
61
|
+
readonly retrySafety: "unsafe";
|
|
62
|
+
constructor(action: BrowserActionName, cause: unknown);
|
|
63
|
+
}
|
|
64
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACX,iBAAiB,EACjB,oBAAoB,EACpB,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,iBAAiB,EACjB,eAAe,EACf,MAAM,YAAY,CAAA;AAEnB;;;;GAIG;AACH,qBAAa,uBAAwB,SAAQ,KAAK;IAIrC,QAAQ,CAAC,MAAM,EAAE,MAAM;IAHnC,SAAkB,IAAI,6BAA4B;IAClD,QAAQ,CAAC,IAAI,EAAG,qBAAqB,CAAS;gBAEzB,MAAM,EAAE,MAAM;CAGnC;AAED;;;;GAIG;AACH,qBAAa,gBAAiB,SAAQ,KAAK;IAKzC,QAAQ,CAAC,OAAO,EAAE,MAAM;IACxB,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EA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EAAE,MAAM,EACvB,MAAM,CAAC,EAAE,MAAM;CAIhB;AAED,qBAAa,0BAA2B,SAAQ,KAAM,YAAW,qBAAqB;IAOpF,QAAQ,CAAC,MAAM,EAAE,iBAAiB;IANnC,SAAkB,IAAI,gCAA+B;IACrD,QAAQ,CAAC,IAAI,EAAG,yBAAyB,CAAS;IAClD,QAAQ,CAAC,OAAO,EAAG,SAAS,CAAS;IACrC,QAAQ,CAAC,WAAW,EAAG,QAAQ,CAAS;gBAG9B,MAAM,EAAE,iBAAiB,EAClC,KAAK,EAAE,OAAO;CAMf"}
|
package/dist/errors.js
ADDED
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The browser cannot run here: the engine is not installed, there is no
|
|
3
|
+
* display for a visible window, the engine this environment needs is not in
|
|
4
|
+
* this build. `reason` is a sentence for a person and ends with what to do.
|
|
5
|
+
*/
|
|
6
|
+
export class BrowserUnavailableError extends Error {
|
|
7
|
+
reason;
|
|
8
|
+
name = 'BrowserUnavailableError';
|
|
9
|
+
code = 'browser_unavailable';
|
|
10
|
+
constructor(reason) {
|
|
11
|
+
super(reason);
|
|
12
|
+
this.reason = reason;
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Another browser holds the profile. A local profile directory can be opened
|
|
17
|
+
* by one browser process at a time; `holders` names the processes that hold
|
|
18
|
+
* it, as `<pid>-<session>`.
|
|
19
|
+
*/
|
|
20
|
+
export class ProfileBusyError extends Error {
|
|
21
|
+
profile;
|
|
22
|
+
holders;
|
|
23
|
+
name = 'ProfileBusyError';
|
|
24
|
+
code = 'browser_profile_busy';
|
|
25
|
+
constructor(profile, holders) {
|
|
26
|
+
super(holders.length > 0
|
|
27
|
+
? `The browser profile "${profile}" is in use by another namzu process (${holders.join(', ')}). Close that session, or use another profile.`
|
|
28
|
+
: `The browser profile "${profile}" is in use by another browser. Close it, or use another profile.`);
|
|
29
|
+
this.profile = profile;
|
|
30
|
+
this.holders = holders;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
// ---------------------------------------------------------------------------
|
|
34
|
+
// The SDK's structural refusals, as classes. The tools recognise them by
|
|
35
|
+
// shape (`browserHostErrorOf`), so these only need to carry the fields.
|
|
36
|
+
// ---------------------------------------------------------------------------
|
|
37
|
+
export class BrowserOriginMismatchError extends Error {
|
|
38
|
+
expected;
|
|
39
|
+
actual;
|
|
40
|
+
name = 'BrowserOriginMismatchError';
|
|
41
|
+
code = 'browser_origin_mismatch';
|
|
42
|
+
constructor(expected, actual) {
|
|
43
|
+
super(`The page is at ${actual || 'an unknown origin'}, not ${expected}. Nothing was done.`);
|
|
44
|
+
this.expected = expected;
|
|
45
|
+
this.actual = actual;
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export class BrowserStaleRefError extends Error {
|
|
49
|
+
ref;
|
|
50
|
+
name = 'BrowserStaleRefError';
|
|
51
|
+
code = 'browser_stale_ref';
|
|
52
|
+
constructor(ref) {
|
|
53
|
+
super(`Element ${ref} is not on the page any more. Nothing was done.`);
|
|
54
|
+
this.ref = ref;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
export class BrowserHumanRequiredError extends Error {
|
|
58
|
+
reason;
|
|
59
|
+
origin;
|
|
60
|
+
name = 'BrowserHumanRequiredError';
|
|
61
|
+
code = 'browser_human_required';
|
|
62
|
+
profile;
|
|
63
|
+
loginCommand;
|
|
64
|
+
constructor(reason, origin, options = {}) {
|
|
65
|
+
super(`${origin || 'The page'} needs a person (${reason}).`);
|
|
66
|
+
this.reason = reason;
|
|
67
|
+
this.origin = origin;
|
|
68
|
+
if (options.profile !== undefined)
|
|
69
|
+
this.profile = options.profile;
|
|
70
|
+
if (options.loginCommand !== undefined)
|
|
71
|
+
this.loginCommand = options.loginCommand;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
export class BrowserSiteDeniedError extends Error {
|
|
75
|
+
origin;
|
|
76
|
+
name = 'BrowserSiteDeniedError';
|
|
77
|
+
code = 'browser_site_denied';
|
|
78
|
+
constructor(origin, detail) {
|
|
79
|
+
super(detail ?? `${origin || 'This site'} is not allowed by the site rules.`);
|
|
80
|
+
this.origin = origin;
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
export class BrowserOutcomeUnknownError extends Error {
|
|
84
|
+
action;
|
|
85
|
+
name = 'BrowserOutcomeUnknownError';
|
|
86
|
+
code = 'browser_outcome_unknown';
|
|
87
|
+
outcome = 'unknown';
|
|
88
|
+
retrySafety = 'unsafe';
|
|
89
|
+
constructor(action, cause) {
|
|
90
|
+
super(`browser_act "${action}" started and did not finish cleanly (${firstLine(cause)}). The page may already have changed; take a snapshot before deciding what to do, and do not repeat the action blindly.`);
|
|
91
|
+
this.action = action;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function firstLine(cause) {
|
|
95
|
+
const text = cause instanceof Error ? cause.message : String(cause);
|
|
96
|
+
const line = text.split('\n')[0] ?? '';
|
|
97
|
+
return line.length > 200 ? `${line.slice(0, 199)}…` : line;
|
|
98
|
+
}
|
|
99
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../src/errors.ts"],"names":[],"mappings":"AAUA;;;;GAIG;AACH,MAAM,OAAO,uBAAwB,SAAQ,KAAK;IAI5B;IAHH,IAAI,GAAG,yBAAyB,CAAA;IACzC,IAAI,GAAG,qBAA8B,CAAA;IAE9C,YAAqB,MAAc;QAClC,KAAK,CAAC,MAAM,CAAC,CAAA;QADO,WAAM,GAAN,MAAM,CAAQ;IAEnC,CAAC;CACD;AAED;;;;GAIG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IAKhC;IACA;IALQ,IAAI,GAAG,kBAAkB,CAAA;IAClC,IAAI,GAAG,sBAA+B,CAAA;IAE/C,YACU,OAAe,EACf,OAA0B;QAEnC,KAAK,CACJ,OAAO,CAAC,MAAM,GAAG,CA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
+
import type { BrowserActAction, BrowserCallOptions, BrowserCapabilities, BrowserHost, BrowserObserveAction, BrowserRefDescription, BrowserResult, BrowserSessionInfo } from '@namzu/sdk';
|
|
2
|
+
import { type BrowserHumanClassifierOptions } from './classifier.js';
|
|
3
|
+
import { type BrowserEnginePlan, type BrowserEngineSetting, type BrowserHeadlessSetting, type BrowserRunMode } from './detect.js';
|
|
4
|
+
import { type BrowserSiteRules } from './policy.js';
|
|
5
|
+
export interface PlaywrightBrowserHostOptions {
|
|
6
|
+
/** Profile to run under. Default `default`. Chosen by the operator, never by the model. */
|
|
7
|
+
readonly profile?: string;
|
|
8
|
+
/** `NAMZU_HOME`. Default: resolved from the environment when the browser first starts. */
|
|
9
|
+
readonly home?: string;
|
|
10
|
+
/** Names this host's lease on the profile. Default: random. */
|
|
11
|
+
readonly sessionId?: string;
|
|
12
|
+
/** The engine plan. Default: {@link detectBrowserEnvironment} over `env` and `platform`. */
|
|
13
|
+
readonly plan?: BrowserEnginePlan;
|
|
14
|
+
readonly env?: NodeJS.ProcessEnv;
|
|
15
|
+
readonly platform?: NodeJS.Platform;
|
|
16
|
+
readonly engine?: BrowserEngineSetting;
|
|
17
|
+
readonly headless?: BrowserHeadlessSetting;
|
|
18
|
+
readonly mode?: BrowserRunMode;
|
|
19
|
+
/** Site rules for the checks after the fact. Default `{ '*': 'ask' }`. */
|
|
20
|
+
readonly sites?: BrowserSiteRules;
|
|
21
|
+
/**
|
|
22
|
+
* Leave the browser running when this host is disposed. For the Windows
|
|
23
|
+
* engine this also leaves it running if this process dies.
|
|
24
|
+
*/
|
|
25
|
+
readonly keepOpen?: boolean;
|
|
26
|
+
/** Default 30 000. */
|
|
27
|
+
readonly navigationTimeoutMs?: number;
|
|
28
|
+
/** Default 10 000. */
|
|
29
|
+
readonly actionTimeoutMs?: number;
|
|
30
|
+
/** Snapshot page size in characters. Default and ceiling 20 000. */
|
|
31
|
+
readonly snapshotMaxChars?: number;
|
|
32
|
+
/** A browser binary to launch instead of the plan's. */
|
|
33
|
+
readonly executablePath?: string;
|
|
34
|
+
/** More sign-in addresses for the classifier. */
|
|
35
|
+
readonly signInAddresses?: BrowserHumanClassifierOptions['signInAddresses'];
|
|
36
|
+
/** The command that opens a visible window for signing in. Default `namzu browser login <profile> <url>`. */
|
|
37
|
+
readonly loginCommand?: (profile: string, url: string) => string;
|
|
38
|
+
/** Windows engine: how long starting and connecting to the browser may take. Default 60 000. */
|
|
39
|
+
readonly windowsLaunchTimeoutMs?: number;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* A {@link BrowserHost} that runs Chromium (or an installed Chrome or Edge)
|
|
43
|
+
* in this process with Playwright, on a persistent profile. Inside WSL it
|
|
44
|
+
* drives the Windows Chrome or Edge instead, through the PowerShell bridge
|
|
45
|
+
* (`windows-engine.ts`).
|
|
46
|
+
*
|
|
47
|
+
* Nothing starts at construction: the browser is launched by the first call
|
|
48
|
+
* that needs it, so mounting the tools costs nothing until the model uses
|
|
49
|
+
* them.
|
|
50
|
+
*
|
|
51
|
+
* What it enforces, whatever the gate allowed:
|
|
52
|
+
*
|
|
53
|
+
* - every `browser_act` call's `origin` equals the live page's, checked
|
|
54
|
+
* immediately before acting;
|
|
55
|
+
* - a page that a navigation, redirect, script or popup lands on must be
|
|
56
|
+
* allowed by the site rules at `read` or `act`, or be an address the caller
|
|
57
|
+
* asked to open this session, or `about:blank`. A top-level request to
|
|
58
|
+
* anything else is blocked before it is sent; a redirect is caught when it
|
|
59
|
+
* lands, and the tab is cleared to `about:blank`;
|
|
60
|
+
* - acting needs the live origin at `ask` or `act`;
|
|
61
|
+
* - a sign-in, second factor, CAPTCHA, bot wall or HTTP credential prompt
|
|
62
|
+
* stops the call with `browser_human_required`;
|
|
63
|
+
* - nothing is ever typed into a password or one-time-code field;
|
|
64
|
+
* - downloads are cancelled and reported; a leave-page prompt is answered so
|
|
65
|
+
* navigation proceeds; other dialogs wait for `browser_act dialog`.
|
|
66
|
+
*/
|
|
67
|
+
export declare class PlaywrightBrowserHost implements BrowserHost {
|
|
68
|
+
readonly id: string;
|
|
69
|
+
readonly capabilities: BrowserCapabilities;
|
|
70
|
+
readonly plan: BrowserEnginePlan;
|
|
71
|
+
readonly profile: string;
|
|
72
|
+
private readonly options;
|
|
73
|
+
private readonly policy;
|
|
74
|
+
private readonly sessionId;
|
|
75
|
+
private readonly pager;
|
|
76
|
+
private context;
|
|
77
|
+
private windows;
|
|
78
|
+
private launching;
|
|
79
|
+
private lease;
|
|
80
|
+
private readonly tabs;
|
|
81
|
+
private readonly tabOf;
|
|
82
|
+
private tabCounter;
|
|
83
|
+
private activeTabId;
|
|
84
|
+
private ownPageOpening;
|
|
85
|
+
private pendingDialog;
|
|
86
|
+
private readonly notes;
|
|
87
|
+
private readonly blanking;
|
|
88
|
+
private refs;
|
|
89
|
+
constructor(options?: PlaywrightBrowserHostOptions);
|
|
90
|
+
/** Warnings from engine detection, for the operator. */
|
|
91
|
+
get warnings(): readonly string[];
|
|
92
|
+
/** Whether the browser is running now. */
|
|
93
|
+
get running(): boolean;
|
|
94
|
+
private ensureContext;
|
|
95
|
+
private launch;
|
|
96
|
+
private home;
|
|
97
|
+
private launchLocal;
|
|
98
|
+
/**
|
|
99
|
+
* The Windows browser, through the PowerShell bridge. The profile lives on
|
|
100
|
+
* the Windows side; its descriptor here records where. Leases are shared:
|
|
101
|
+
* every namzu process on the profile drives the same browser, and the
|
|
102
|
+
* last one to let go closes it.
|
|
103
|
+
*/
|
|
104
|
+
private launchWindows;
|
|
105
|
+
private windowsLaunchError;
|
|
106
|
+
private launchError;
|
|
107
|
+
private forget;
|
|
108
|
+
initialize(): Promise<void>;
|
|
109
|
+
/**
|
|
110
|
+
* Release this host's lease. The browser closes when that was the last
|
|
111
|
+
* lease on the profile, unless `keepOpen` was set.
|
|
112
|
+
*/
|
|
113
|
+
dispose(): Promise<void>;
|
|
114
|
+
/** Close the browser now, whatever the leases say. */
|
|
115
|
+
close(): Promise<void>;
|
|
116
|
+
private adopt;
|
|
117
|
+
private onDialog;
|
|
118
|
+
/** The route handler: stop top-level navigations the policy does not allow. */
|
|
119
|
+
private screen;
|
|
120
|
+
/** After a navigation lands: clear the tab if the policy does not allow where it is. */
|
|
121
|
+
private checkLanding;
|
|
122
|
+
private settle;
|
|
123
|
+
private activeTab;
|
|
124
|
+
private openOwnPage;
|
|
125
|
+
private drainNotes;
|
|
126
|
+
private title;
|
|
127
|
+
private pageInfo;
|
|
128
|
+
private result;
|
|
129
|
+
private loginCommandFor;
|
|
130
|
+
private humanRequired;
|
|
131
|
+
/** Throw `browser_human_required` if the page needs a person. */
|
|
132
|
+
private checkHuman;
|
|
133
|
+
private guarded;
|
|
134
|
+
observe(action: BrowserObserveAction, options?: BrowserCallOptions): Promise<BrowserResult>;
|
|
135
|
+
act(action: BrowserActAction, options?: BrowserCallOptions): Promise<BrowserResult>;
|
|
136
|
+
private runObserve;
|
|
137
|
+
private navigate;
|
|
138
|
+
private afterNavigation;
|
|
139
|
+
private history;
|
|
140
|
+
private dismissPendingDialog;
|
|
141
|
+
private takeSnapshot;
|
|
142
|
+
private snapshot;
|
|
143
|
+
private resolveRef;
|
|
144
|
+
private screenshot;
|
|
145
|
+
private scroll;
|
|
146
|
+
private waitFor;
|
|
147
|
+
private tabsCall;
|
|
148
|
+
private tabList;
|
|
149
|
+
private guardField;
|
|
150
|
+
private runAct;
|
|
151
|
+
private answerDialog;
|
|
152
|
+
/**
|
|
153
|
+
* Do the action. Everything that can refuse — refs, credential fields,
|
|
154
|
+
* actionability — is checked before anything happens; a failure after
|
|
155
|
+
* the first change is `browser_outcome_unknown`.
|
|
156
|
+
*/
|
|
157
|
+
private perform;
|
|
158
|
+
/**
|
|
159
|
+
* Run the change. A failure once it has started is `outcome unknown`. A
|
|
160
|
+
* dialog the action opens ends the wait: the page is paused until the
|
|
161
|
+
* dialog is answered, and so is anything Playwright was still waiting for.
|
|
162
|
+
*/
|
|
163
|
+
private unknownOnFailure;
|
|
164
|
+
describeRef(ref: string): BrowserRefDescription | undefined;
|
|
165
|
+
session(): BrowserSessionInfo;
|
|
166
|
+
}
|
|
167
|
+
//# sourceMappingURL=host.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"host.d.ts","sourceRoot":"","sources":["../src/host.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EACX,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,WAAW,EACX,oBAAoB,EAEpB,qBAAqB,EACrB,aAAa,EACb,kBAAkB,EAGlB,MAAM,YAAY,CAAA;AAUnB,OAAO,EACN,KAAK,6BAA6B,EAGlC,MAAM,iBAAiB,CAAA;AACxB,OAAO,EACN,KAAK,iBAAiB,EACtB,KAAK,oBAAoB,EACzB,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EAKnB,MAAM,aAAa,CAAA;AAgBpB,OAAO,EAAqB,KAAK,gBAAgB,EAA8B,MAAM,aAAa,CAAA;AAkBlG,MAAM,WAAW,4BAA4B;IAC5C,2FAA2F;IAC3F,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAA;IACzB,0FAA0F;IAC1F,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAA;IACtB,+DAA+D;IAC/D,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAA;IAC3B,4FAA4F;IAC5F,QAAQ,CAAC,IAAI,CAAC,EAAE,iBAAiB,CAAA;IACjC,QAAQ,CAAC,GAAG,CAAC,EAAE,MAAM,CAAC,UAAU,CAAA;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAA;IACnC,QAAQ,CAAC,MAAM,CAAC,EAAE,oBAAoB,CAAA;IACtC,QAAQ,CAAC,QAAQ,CAAC,EAAE,sBAAsB,CAAA;IAC1C,QAAQ,CAAC,IAAI,CAAC,EAAE,cAAc,CAAA;IAC9B,0EAA0E;IAC1E,QAAQ,CAAC,KAAK,CAAC,EAAE,gBAAgB,CAAA;IACjC;;;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