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

@@ -28,19 +28,17 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var context_exports = {};
__export(context_exports, {
Context: () => Context,
InputRecorder: () => InputRecorder
Context: () => Context
});
module.exports = __toCommonJS(context_exports);
var import_fs = __toESM(require("fs"));
var import_path = __toESM(require("path"));
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
var import_utils = require("playwright-core/lib/utils");
var import_playwright_core = require("playwright-core");
var import_url = require("url");
var import_os = __toESM(require("os"));
var import_log = require("../log");
var import_tab = require("./tab");
var import_config = require("./config");
var codegen = __toESM(require("./codegen"));
var import_utils = require("./tools/utils");
const testDebug = (0, import_utilsBundle.debug)("pw:mcp:test");
class Context {
constructor(options) {
@@ -68,14 +66,13 @@ class Context {
}
currentTabOrDie() {
if (!this._currentTab)
throw new Error('No open pages available. Use the "browser_navigate" tool to navigate to a page first.');
throw new Error("No open pages available.");
return this._currentTab;
}
async newTab() {
const { browserContext } = await this._ensureBrowserContext();
const { browserContext } = await this._ensureBrowserContext({});
const page = await browserContext.newPage();
this._currentTab = this._tabs.find((t) => t.page === page);
await this._currentTab.initializedPromise;
return this._currentTab;
}
async selectTab(index) {
@@ -86,8 +83,8 @@ class Context {
this._currentTab = tab;
return tab;
}
async ensureTab() {
const { browserContext } = await this._ensureBrowserContext();
async ensureTab(options = {}) {
const { browserContext } = await this._ensureBrowserContext(options);
if (!this._currentTab)
await browserContext.newPage();
return this._currentTab;
@@ -137,31 +134,11 @@ class Context {
testDebug("close context");
const promise = this._browserContextPromise;
this._browserContextPromise = void 0;
this._browserContextOption = void 0;
await promise.then(async ({ browserContext, close }) => {
if (this.config.saveTrace)
await browserContext.tracing.stop();
const videos = this.config.saveVideo ? browserContext.pages().map((page) => page.video()).filter((video) => !!video) : [];
await close(async () => {
for (const video of videos) {
const name = await this.outputFile((0, import_utils.dateAsFileName)("webm"), { origin: "code", reason: "Saving video" });
await import_fs.default.promises.mkdir(import_path.default.dirname(name), { recursive: true });
const p = await video.path();
if (import_fs.default.existsSync(p)) {
try {
await import_fs.default.promises.rename(p, name);
} catch (e) {
if (e.code !== "EXDEV")
(0, import_log.logUnhandledError)(e);
try {
await import_fs.default.promises.copyFile(p, name);
await import_fs.default.promises.unlink(p);
} catch (e2) {
(0, import_log.logUnhandledError)(e2);
}
}
}
}
});
await close();
});
}
async dispose() {
@@ -169,28 +146,45 @@ class Context {
await this.closeBrowserContext();
Context._allContexts.delete(this);
}
async ensureBrowserContext() {
const { browserContext } = await this._ensureBrowserContext();
async _setupRequestInterception(context) {
if (this.config.network?.allowedOrigins?.length) {
await context.route("**", (route) => route.abort("blockedbyclient"));
for (const origin of this.config.network.allowedOrigins)
await context.route(originOrHostGlob(origin), (route) => route.continue());
}
if (this.config.network?.blockedOrigins?.length) {
for (const origin of this.config.network.blockedOrigins)
await context.route(originOrHostGlob(origin), (route) => route.abort("blockedbyclient"));
}
}
async ensureBrowserContext(options = {}) {
const { browserContext } = await this._ensureBrowserContext(options);
return browserContext;
}
_ensureBrowserContext() {
if (!this._browserContextPromise) {
this._browserContextPromise = this._setupBrowserContext();
this._browserContextPromise.catch(() => {
this._browserContextPromise = void 0;
});
}
_ensureBrowserContext(options) {
if (this._browserContextPromise && (options.forceHeadless === void 0 || this._browserContextOption?.forceHeadless === options.forceHeadless))
return this._browserContextPromise;
const closePrework = this._browserContextPromise ? this.closeBrowserContext() : Promise.resolve();
this._browserContextPromise = closePrework.then(() => this._setupBrowserContext(options));
this._browserContextPromise.catch(() => {
this._browserContextPromise = void 0;
this._browserContextOption = void 0;
});
this._browserContextOption = options;
return this._browserContextPromise;
}
async _setupBrowserContext() {
async _setupBrowserContext(options) {
if (this._closeBrowserContextPromise)
throw new Error("Another browser context is being closed.");
if (this.config.testIdAttribute)
import_playwright_core.selectors.setTestIdAttribute(this.config.testIdAttribute);
const result = await this._browserContextFactory.createContext(this._clientInfo, this._abortController.signal, this._runningToolName);
const result = await this._browserContextFactory.createContext(this._clientInfo, this._abortController.signal, { toolName: this._runningToolName, ...options });
const { browserContext } = result;
if (this.sessionLog)
await InputRecorder.create(this, browserContext);
if (!this.config.allowUnrestrictedFileAccess) {
browserContext._setAllowedProtocols(["http:", "https:", "about:", "data:"]);
browserContext._setAllowedDirectories(allRootPaths(this._clientInfo));
}
await this._setupRequestInterception(browserContext);
for (const page of browserContext.pages())
this._onPageCreated(page);
browserContext.on("page", (page) => this._onPageCreated(page));
@@ -206,62 +200,45 @@ class Context {
}
lookupSecret(secretName) {
if (!this.config.secrets?.[secretName])
return { value: secretName, code: codegen.quote(secretName) };
return { value: secretName, code: (0, import_utils.escapeWithQuotes)(secretName, "'") };
return {
value: this.config.secrets[secretName],
code: `process.env['${secretName}']`
};
}
firstRootPath() {
return allRootPaths(this._clientInfo)[0];
}
}
class InputRecorder {
constructor(context, browserContext) {
this._context = context;
this._browserContext = browserContext;
function allRootPaths(clientInfo) {
const paths = [];
for (const root of clientInfo.roots) {
const url = new URL(root.uri);
let rootPath;
try {
rootPath = (0, import_url.fileURLToPath)(url);
} catch (e) {
if (e.code === "ERR_INVALID_FILE_URL_PATH" && import_os.default.platform() === "win32")
rootPath = decodeURIComponent(url.pathname);
}
if (!rootPath)
continue;
paths.push(rootPath);
}
static async create(context, browserContext) {
const recorder = new InputRecorder(context, browserContext);
await recorder._initialize();
return recorder;
}
async _initialize() {
const sessionLog = this._context.sessionLog;
await this._browserContext._enableRecorder({
mode: "recording",
recorderMode: "api"
}, {
actionAdded: (page, data, code) => {
if (this._context.isRunningTool())
return;
const tab = import_tab.Tab.forPage(page);
if (tab)
sessionLog.logUserAction(data.action, tab, code, false);
},
actionUpdated: (page, data, code) => {
if (this._context.isRunningTool())
return;
const tab = import_tab.Tab.forPage(page);
if (tab)
sessionLog.logUserAction(data.action, tab, code, true);
},
signalAdded: (page, data) => {
if (this._context.isRunningTool())
return;
if (data.signal.name !== "navigation")
return;
const tab = import_tab.Tab.forPage(page);
const navigateAction = {
name: "navigate",
url: data.signal.url,
signals: []
};
if (tab)
sessionLog.logUserAction(navigateAction, tab, `await page.goto('${data.signal.url}');`, false);
}
});
if (paths.length === 0)
paths.push(process.cwd());
return paths;
}
function originOrHostGlob(originOrHost) {
try {
const url = new URL(originOrHost);
if (url.origin !== "null")
return `${url.origin}/**`;
} catch {
}
return `*://${originOrHost}/**`;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
Context,
InputRecorder
Context
});