Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,12 +46,12 @@
"session-check": "node scripts/session-check.mjs --verbose"
},
"dependencies": {
"patchright-core": "1.64.1"
"patchright-core": "1.64.2"
},
"devDependencies": {
"@types/node": "^25.2.1",
"esbuild": "^0.25.12",
"patchright": "1.64.1",
"patchright": "1.64.2",
"tsx": "^4.23.13",
"typescript": "^5.9.3"
}
Expand Down
42 changes: 23 additions & 19 deletions scripts/upstream-snapshot/client.patch
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Our client layer relative to the pristine upstream client (Playwright v1.64.1,
# compiled as patchright-core 1.64.1). Generated by scripts/upstream-patch.ts;
# compiled as patchright-core 1.64.2). Generated by scripts/upstream-patch.ts;
# not applied anywhere: the layer is carried forward by three-way merge in scripts/roll.ts.

diff --git a/vendor/cli-client/program.ts b/src/program.ts
index 246a21a..e704c10 100644
index 246a21a..0a1806f 100644
--- a/vendor/cli-client/program.ts
+++ b/src/program.ts
@@ -1,5 +1,6 @@
Expand All @@ -13,7 +13,7 @@ index 246a21a..e704c10 100644
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -14,24 +15,36 @@
@@ -14,24 +15,37 @@
* limitations under the License.
*/

Expand Down Expand Up @@ -43,6 +43,7 @@ index 246a21a..e704c10 100644
+import { coreBundle, corePackageJSON, dashboardAppPath, serverRegistry, utilsBundle } from './core';
+import { loadUserConfig } from './config/load';
+import { applyCoreEnvInProcess, coreProcessEnv } from './daemonEnv';
+import { assertProfileFree } from './commands/profiles';
+import { loadHelp } from './help';
+import { killAllDaemons } from './killAll';
+import { bundledSkillDir, parseSkillTarget, skillInstallDir, workspaceMarker } from './paths';
Expand All @@ -59,7 +60,7 @@ index 246a21a..e704c10 100644

type GlobalOptions = {
help?: boolean;
@@ -64,18 +77,20 @@ const globalOptions: (keyof (GlobalOptions & OpenOptions & AttachOptions))[] = [
@@ -64,18 +78,20 @@ const globalOptions: (keyof (GlobalOptions & OpenOptions & AttachOptions))[] = [
'session',
];

Expand All @@ -84,7 +85,7 @@ index 246a21a..e704c10 100644

const argv = process.argv.slice(2);
const boolean = [...help.booleanOptions, ...booleanOptions];
@@ -95,9 +110,17 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -95,9 +111,17 @@ export async function program(options?: { embedderVersion?: string}) {
const commandName = args._?.[0];

if (args.version || args.v) {
Expand All @@ -105,7 +106,7 @@ index 246a21a..e704c10 100644
}

const command = commandName && help.commands[commandName];
@@ -105,9 +128,9 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -105,9 +129,9 @@ export async function program(options?: { embedderVersion?: string}) {
if (command) {
output.help(command.help);
} else {
Expand All @@ -117,15 +118,15 @@ index 246a21a..e704c10 100644
lines.push(help.global);
output.help(lines.join('\n\n'));
}
@@ -135,6 +158,7 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -135,6 +159,7 @@ export async function program(options?: { embedderVersion?: string}) {
const closed: string[] = [];
for (const entry of entries) {
await new Session(entry).stop();
+ stopWatchdog(clientInfo, entry.config.name);
closed.push(entry.config.name);
}
output.closeAll(closed);
@@ -147,6 +171,8 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -147,6 +172,8 @@ export async function program(options?: { embedderVersion?: string}) {
return;
}
const result = await new Session(entry).deleteData();
Expand All @@ -134,7 +135,7 @@ index 246a21a..e704c10 100644
output.deleteData(sessionName, result);
return;
}
@@ -156,11 +182,11 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -156,11 +183,11 @@ export async function program(options?: { embedderVersion?: string}) {
return;
}
case 'open': {
Expand All @@ -148,7 +149,7 @@ index 246a21a..e704c10 100644
return;
}
case 'attach': {
@@ -182,7 +208,7 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -182,7 +209,7 @@ export async function program(options?: { embedderVersion?: string}) {
output.errorAttachNoTarget();
const attachSessionName = explicitSessionName(args.session as string) ?? attachTarget ?? cdpChannel ?? extensionChannel ?? sessionName;
args.session = attachSessionName;
Expand All @@ -157,15 +158,15 @@ index 246a21a..e704c10 100644
const newEntry = await registry.loadEntry(clientInfo, attachSessionName);
const toolText = await runInSessionOrStop(newEntry, clientInfo, { _: ['snapshot'], filename: '<auto>' }, output);
output.attach(attachSessionName, pid, targetName, toolText);
@@ -191,6 +217,7 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -191,6 +218,7 @@ export async function program(options?: { embedderVersion?: string}) {
case 'close': {
const closeEntry = registry.entry(clientInfo, sessionName);
const { wasOpen } = closeEntry ? await new Session(closeEntry).stop() : { wasOpen: false };
+ stopWatchdog(clientInfo, sessionName);
output.close(sessionName, wasOpen);
return;
}
@@ -199,30 +226,30 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -199,30 +227,30 @@ export async function program(options?: { embedderVersion?: string}) {
if (detachEntry && !detachEntry.config.attached)
output.errorDetachNotAttached(sessionName);
const { wasOpen } = detachEntry ? await new Session(detachEntry).stop() : { wasOpen: false };
Expand Down Expand Up @@ -205,7 +206,7 @@ index 246a21a..e704c10 100644
const explicit = explicitSessionName(args.session as string);
if (explicit)
daemonArgs.push(`--sessionName=${explicit}`);
@@ -232,7 +259,7 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -232,7 +260,7 @@ export async function program(options?: { embedderVersion?: string}) {
daemonArgs.push(`--host=${args.host as string}`);
if (args.kill) {
daemonArgs.push(`--kill`);
Expand All @@ -214,15 +215,15 @@ index 246a21a..e704c10 100644
await new Promise<void>(resolve => child.on('exit', () => resolve()));
return;
}
@@ -249,6 +276,7 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -249,6 +277,7 @@ export async function program(options?: { embedderVersion?: string}) {
const child = spawn(process.execPath, daemonArgs, {
detached: !foreground,
stdio: foreground ? 'inherit' : ['pipe', 'pipe', 'ignore'],
+ env: coreProcessEnv(),
windowsHide: true,
});
if (foreground) {
@@ -281,30 +309,109 @@ export async function program(options?: { embedderVersion?: string}) {
@@ -281,30 +310,112 @@ export async function program(options?: { embedderVersion?: string}) {
return;
}
default: {
Expand Down Expand Up @@ -281,6 +282,9 @@ index 246a21a..e704c10 100644
+ output.warn({ key: 'config', severity: 'LOW', kind: 'notice', message });
+ // Resolved before the launch so a bad --idle-timeout/--owner-pid never leaves a daemon behind.
+ const lifetime = resolveLifetime(args, loaded.config, process.env);
+ // Chrome runs one browser per profile; say who holds it instead of failing in the browser.
+ if (mode === 'open' && typeof args.profile === 'string' && args.profile && args.isolated !== true)
+ await assertProfileFree(registry, args.profile, cwd, { session: sessionName, daemonDir: clientInfo.daemonProfilesDir });
+
+ const profile = await stealth.resolveLaunchProfile({
+ mode,
Expand Down Expand Up @@ -340,7 +344,7 @@ index 246a21a..e704c10 100644
if (result.isError)
process.exitCode = 1;
return result.text;
@@ -323,95 +430,47 @@ async function runInSessionOrStop(entry: SessionFile, clientInfo: ClientInfo, ar
@@ -323,95 +434,47 @@ async function runInSessionOrStop(entry: SessionFile, clientInfo: ClientInfo, ar
}
}

Expand Down Expand Up @@ -462,15 +466,15 @@ index 246a21a..e704c10 100644
const key = clientKey(clientInfo);
for (const [workspaceKey, list] of entries) {
if (!all && workspaceKey !== key)
@@ -436,6 +495,7 @@ async function collectList(registry: Registry, clientInfo: ClientInfo, all: bool
@@ -436,6 +499,7 @@ async function collectList(registry: Registry, clientInfo: ClientInfo, all: bool
attached: !!config.attached,
compatible: session.isCompatible(clientInfo),
version: config.version,
+ lifetime: describeLifetimeOf(entry.daemonDir, session.name),
});
}
}
@@ -454,6 +514,8 @@ function validateFlags(args: MinimistArgs, command: { flags: Record<string, 'boo
@@ -454,6 +518,8 @@ function validateFlags(args: MinimistArgs, command: { flags: Record<string, 'boo
continue;
if ((globalOptions as readonly string[]).includes(key))
continue;
Expand All @@ -479,7 +483,7 @@ index 246a21a..e704c10 100644
if (key in command.flags)
continue;
// Negated flags like '--no-shell' are parsed as { shell: false }.
@@ -465,14 +527,8 @@ function validateFlags(args: MinimistArgs, command: { flags: Record<string, 'boo
@@ -465,14 +531,8 @@ function validateFlags(args: MinimistArgs, command: { flags: Record<string, 'boo
output.errorUnknownOption(unknownFlags, command.help);
}

Expand Down
2 changes: 1 addition & 1 deletion scripts/upstream-snapshot/snapshot.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "patchright-core",
"version": "1.64.1",
"version": "1.64.2",
"files": 11
}
4 changes: 2 additions & 2 deletions scripts/upstream-snapshot/versions.json
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{
"patchrightCore": {
"version": "1.64.1",
"version": "1.64.2",
"playwrightVersion": "1.64.1",
"playwrightTag": "v1.64.1",
"rolledAt": "2026-10-19",
"rolledAt": "2026-10-28",
"vendorSha256": {
"vendor/cli-client/program.ts": "8827f5c443099512a285fe6fb2ed26dd3b6fe7f1f1df2e3bdebd328f792f5b79",
"vendor/cli-client/session.ts": "ad1809cdf64d90a0e8d0cb653cef605d186c67425b53743ac3199d0eb8b53f8e",
Expand Down
Loading
Loading