Update npm packages (73 packages including @jqhtml 2.3.36)

Update npm registry domain from privatenpm.hanson.xyz to npm.internal.hanson.xyz

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
root
2026-02-20 11:31:28 +00:00
parent d01a6179aa
commit b5eb27a827
1690 changed files with 47348 additions and 16848 deletions

View File

@@ -46,6 +46,7 @@ __export(api_exports, {
Locator: () => import_locator.Locator,
Mouse: () => import_input.Mouse,
Page: () => import_page.Page,
PageAgent: () => import_pageAgent.PageAgent,
Playwright: () => import_playwright.Playwright,
Request: () => import_network.Request,
Response: () => import_network.Response,
@@ -81,6 +82,7 @@ var import_jsHandle = require("./jsHandle");
var import_network = require("./network");
var import_fetch = require("./fetch");
var import_page = require("./page");
var import_pageAgent = require("./pageAgent");
var import_selectors = require("./selectors");
var import_tracing = require("./tracing");
var import_video = require("./video");
@@ -118,6 +120,7 @@ var import_webError = require("./webError");
Locator,
Mouse,
Page,
PageAgent,
Playwright,
Request,
Response,

View File

@@ -62,11 +62,9 @@ class Browser extends import_channelOwner.ChannelOwner {
context._onClose();
await this._channel.disconnectFromReusedContext({ reason });
}
async _innerNewContext(options = {}, forReuse) {
options = this._browserType._playwright.selectors._withSelectorOptions({
...this._browserType._playwright._defaultContextOptions,
...options
});
async _innerNewContext(userOptions = {}, forReuse) {
const options = this._browserType._playwright.selectors._withSelectorOptions(userOptions);
await this._instrumentation.runBeforeCreateBrowserContext(options);
const contextOptions = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
const response = forReuse ? await this._channel.newContextForReuse(contextOptions) : await this._channel.newContext(contextOptions);
const context = import_browserContext.BrowserContext.from(response.context);

View File

@@ -76,6 +76,7 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
this.tracing = import_tracing.Tracing.from(initializer.tracing);
this.request = import_fetch.APIRequestContext.from(initializer.requestContext);
this.request._timeoutSettings = this._timeoutSettings;
this.request._checkUrlAllowed = (url) => this._checkUrlAllowed(url);
this.clock = new import_clock.Clock(this);
this._channel.on("bindingCall", ({ binding }) => this._onBinding(import_page.BindingCall.from(binding)));
this._channel.on("close", () => this._onClose());
@@ -474,6 +475,40 @@ class BrowserContext extends import_channelOwner.ChannelOwner {
this._onRecorderEventSink = void 0;
await this._channel.disableRecorder();
}
async _exposeConsoleApi() {
await this._channel.exposeConsoleApi();
}
_setAllowedProtocols(protocols) {
this._allowedProtocols = protocols;
}
_checkUrlAllowed(url) {
if (!this._allowedProtocols)
return;
let parsedURL;
try {
parsedURL = new URL(url);
} catch (e) {
throw new Error(`Access to ${url} is blocked. Invalid URL: ${e.message}`);
}
if (!this._allowedProtocols.includes(parsedURL.protocol))
throw new Error(`Access to "${parsedURL.protocol}" URL is blocked. Allowed protocols: ${this._allowedProtocols.join(", ")}. Attempted URL: ${url}`);
}
_setAllowedDirectories(rootDirectories) {
this._allowedDirectories = rootDirectories;
}
_checkFileAccess(filePath) {
if (!this._allowedDirectories)
return;
const path = this._platform.path().resolve(filePath);
const isInsideDir = (container, child) => {
const path2 = this._platform.path();
const rel = path2.relative(container, child);
return !!rel && !rel.startsWith("..") && !path2.isAbsolute(rel);
};
if (this._allowedDirectories.some((root) => isInsideDir(root, path)))
return;
throw new Error(`File access denied: ${filePath} is outside allowed roots. Allowed roots: ${this._allowedDirectories.length ? this._allowedDirectories.join(", ") : "none"}`);
}
}
async function prepareStorageState(platform, storageState) {
if (typeof storageState !== "string")

View File

@@ -73,13 +73,13 @@ class BrowserType extends import_channelOwner.ChannelOwner {
return await this._serverLauncher.launchServer(options);
}
async launchPersistentContext(userDataDir, options = {}) {
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
(0, import_assert.assert)(!options.port, "Cannot specify a port without launching as a server.");
options = this._playwright.selectors._withSelectorOptions({
...this._playwright._defaultLaunchOptions,
...this._playwright._defaultContextOptions,
...options
});
await this._instrumentation.runBeforeCreateBrowserContext(options);
const logger = options.logger || this._playwright._defaultLaunchOptions?.logger;
const contextParams = await (0, import_browserContext.prepareBrowserContextParams)(this._platform, options);
const persistentParams = {
...contextParams,
@@ -169,7 +169,8 @@ class BrowserType extends import_channelOwner.ChannelOwner {
endpointURL,
headers,
slowMo: params.slowMo,
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).timeout(params)
timeout: new import_timeoutSettings.TimeoutSettings(this._platform).timeout(params),
isLocal: params.isLocal
});
const browser = import_browser.Browser.from(result.browser);
browser._connectToBrowserType(this, {}, params.logger);

View File

@@ -48,6 +48,7 @@ var import_worker = require("./worker");
var import_writableStream = require("./writableStream");
var import_validator = require("../protocol/validator");
var import_stackTrace = require("../utils/isomorphic/stackTrace");
var import_pageAgent = require("./pageAgent");
class Root extends import_channelOwner.ChannelOwner {
constructor(connection) {
super(connection, "Root", "", {});
@@ -261,6 +262,9 @@ class Connection extends import_eventEmitter.EventEmitter {
case "Page":
result = new import_page.Page(parent, type, guid, initializer);
break;
case "PageAgent":
result = new import_pageAgent.PageAgent(parent, type, guid, initializer);
break;
case "Playwright":
result = new import_playwright.Playwright(parent, type, guid, initializer);
break;

View File

@@ -230,6 +230,9 @@ async function convertInputFiles(platform, files, context) {
if (!items.every((item) => typeof item === "string"))
throw new Error("File paths cannot be mixed with buffers");
const [localPaths, localDirectory] = await resolvePathsAndDirectoryForInputFiles(platform, items);
localPaths?.forEach((path) => context._checkFileAccess(path));
if (localDirectory)
context._checkFileAccess(localDirectory);
if (context._connection.isRemote()) {
const files2 = localDirectory ? (await platform.fs().promises.readdir(localDirectory, { withFileTypes: true, recursive: true })).filter((f) => f.isFile()).map((f) => platform.path().join(f.path, f.name)) : localPaths;
const { writableStreams, rootDir } = await context._wrapApiCall(async () => context._channel.createTempFiles({

View File

@@ -78,6 +78,9 @@ const Events = {
WebSocket: "websocket",
Worker: "worker"
},
PageAgent: {
Turn: "turn"
},
WebSocket: {
Close: "close",
Error: "socketerror",

View File

@@ -39,10 +39,8 @@ class APIRequest {
this._playwright = playwright;
}
async newContext(options = {}) {
options = {
...this._playwright._defaultContextOptions,
...options
};
options = { ...options };
await this._playwright._instrumentation.runBeforeCreateRequestContext(options);
const storageState = typeof options.storageState === "string" ? JSON.parse(await this._playwright._platform.fs().promises.readFile(options.storageState, "utf8")) : options.storageState;
const context = APIRequestContext.from((await this._playwright._channel.newRequest({
...options,
@@ -135,6 +133,7 @@ class APIRequestContext extends import_channelOwner.ChannelOwner {
(0, import_assert.assert)(options.maxRedirects === void 0 || options.maxRedirects >= 0, `'maxRedirects' must be greater than or equal to '0'`);
(0, import_assert.assert)(options.maxRetries === void 0 || options.maxRetries >= 0, `'maxRetries' must be greater than or equal to '0'`);
const url = options.url !== void 0 ? options.url : options.request.url();
this._checkUrlAllowed?.(url);
const method = options.method || options.request?.method();
let encodedParams = void 0;
if (typeof options.params === "string")

View File

@@ -101,6 +101,7 @@ class Frame extends import_channelOwner.ChannelOwner {
}
async goto(url, options = {}) {
const waitUntil = verifyLoadState("waitUntil", options.waitUntil === void 0 ? "load" : options.waitUntil);
this.page().context()._checkUrlAllowed(url);
return network.Response.fromNullable((await this._channel.goto({ url, ...options, waitUntil, timeout: this._navigationTimeout(options) })).response);
}
_setupNavigationWaiter(options) {

View File

@@ -48,6 +48,7 @@ var import_urlMatch = require("../utils/isomorphic/urlMatch");
var import_manualPromise = require("../utils/isomorphic/manualPromise");
var import_rtti = require("../utils/isomorphic/rtti");
var import_consoleMessage = require("./consoleMessage");
var import_pageAgent = require("./pageAgent");
class Page extends import_channelOwner.ChannelOwner {
constructor(parent, type, guid, initializer) {
super(parent, type, guid, initializer);
@@ -62,6 +63,7 @@ class Page extends import_channelOwner.ChannelOwner {
this._closeWasCalled = false;
this._harRouters = [];
this._locatorHandlers = /* @__PURE__ */ new Map();
this._instrumentation.onPage(this);
this._browserContext = parent;
this._timeoutSettings = new import_timeoutSettings.TimeoutSettings(this._platform, this._browserContext._timeoutSettings);
this.keyboard = new import_input.Keyboard(this);
@@ -502,7 +504,8 @@ class Page extends import_channelOwner.ChannelOwner {
}
async close(options = {}) {
this._closeReason = options.reason;
this._closeWasCalled = true;
if (!options.runBeforeUnload)
this._closeWasCalled = true;
try {
if (this._ownedContext)
await this._ownedContext.close();
@@ -673,6 +676,30 @@ class Page extends import_channelOwner.ChannelOwner {
}
return result.pdf;
}
// @ts-expect-error agents are hidden
async agent(options = {}) {
const params = {
api: options.provider?.api,
apiEndpoint: options.provider?.apiEndpoint,
apiKey: options.provider?.apiKey,
apiTimeout: options.provider?.apiTimeout,
apiCacheFile: options.provider?._apiCacheFile,
doNotRenderActive: options._doNotRenderActive,
model: options.provider?.model,
cacheFile: options.cache?.cacheFile,
cacheOutFile: options.cache?.cacheOutFile,
maxTokens: options.limits?.maxTokens,
maxActions: options.limits?.maxActions,
maxActionRetries: options.limits?.maxActionRetries,
// @ts-expect-error runAgents is hidden
secrets: options.secrets ? Object.entries(options.secrets).map(([name, value]) => ({ name, value })) : void 0,
systemPrompt: options.systemPrompt
};
const { agent } = await this._channel.agent(params);
const pageAgent = import_pageAgent.PageAgent.from(agent);
pageAgent._expectTimeout = options?.expect?.timeout;
return pageAgent;
}
async _snapshotForAI(options = {}) {
return await this._channel.snapshotForAI({ timeout: this._timeoutSettings.timeout(options), track: options.track });
}

64
node_modules/playwright-core/lib/client/pageAgent.js generated vendored Normal file
View File

@@ -0,0 +1,64 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var pageAgent_exports = {};
__export(pageAgent_exports, {
PageAgent: () => PageAgent
});
module.exports = __toCommonJS(pageAgent_exports);
var import_channelOwner = require("./channelOwner");
var import_events = require("./events");
var import_page = require("./page");
class PageAgent extends import_channelOwner.ChannelOwner {
static from(channel) {
return channel._object;
}
constructor(parent, type, guid, initializer) {
super(parent, type, guid, initializer);
this._page = import_page.Page.from(initializer.page);
this._channel.on("turn", (params) => this.emit(import_events.Events.PageAgent.Turn, params));
}
async expect(expectation, options = {}) {
const timeout = options.timeout ?? this._expectTimeout ?? 5e3;
await this._channel.expect({ expectation, ...options, timeout });
}
async perform(task, options = {}) {
const timeout = this._page._timeoutSettings.timeout(options);
const { usage } = await this._channel.perform({ task, ...options, timeout });
return { usage };
}
async extract(query, schema, options = {}) {
const timeout = this._page._timeoutSettings.timeout(options);
const { result, usage } = await this._channel.extract({ query, schema: this._page._platform.zodToJsonSchema(schema), ...options, timeout });
return { result, usage };
}
async usage() {
const { usage } = await this._channel.usage({});
return usage;
}
async dispose() {
await this._channel.dispose();
}
async [Symbol.asyncDispose]() {
await this.dispose();
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PageAgent
});

View File

@@ -66,6 +66,9 @@ const emptyPlatform = {
streamWritable: (channel) => {
throw new Error("Streams are not available");
},
zodToJsonSchema: (schema) => {
throw new Error("Zod is not available");
},
zones: { empty: noopZone, current: () => noopZone }
};
// Annotate the CommonJS export names for ESM import in node: