@browsermation/browser-engine 0.0.12 → 0.0.16
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/node_modules/playwright/LICENSE +202 -0
- package/dist/node_modules/playwright/NOTICE +5 -0
- package/dist/node_modules/playwright/README.md +168 -0
- package/dist/node_modules/playwright/ThirdPartyNotices.txt +6197 -0
- package/dist/node_modules/playwright/cli.js +19 -0
- package/dist/node_modules/playwright/index.d.ts +17 -0
- package/dist/node_modules/playwright/index.js +17 -0
- package/dist/node_modules/playwright/index.mjs +18 -0
- package/dist/node_modules/playwright/jsx-runtime.js +42 -0
- package/dist/node_modules/playwright/jsx-runtime.mjs +21 -0
- package/dist/node_modules/playwright/lib/agents/copilot-setup-steps.yml +34 -0
- package/dist/node_modules/playwright/lib/agents/generateAgents.js +395 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-coverage.prompt.md +31 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generate.prompt.md +8 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-generator.agent.md +88 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-heal.prompt.md +6 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-healer.agent.md +55 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-plan.prompt.md +9 -0
- package/dist/node_modules/playwright/lib/agents/playwright-test-planner.agent.md +72 -0
- package/dist/node_modules/playwright/lib/common/config.js +280 -0
- package/dist/node_modules/playwright/lib/common/configLoader.js +344 -0
- package/dist/node_modules/playwright/lib/common/esmLoaderHost.js +102 -0
- package/dist/node_modules/playwright/lib/common/expectBundle.js +43 -0
- package/dist/node_modules/playwright/lib/common/expectBundleImpl.js +407 -0
- package/dist/node_modules/playwright/lib/common/fixtures.js +302 -0
- package/dist/node_modules/playwright/lib/common/globals.js +58 -0
- package/dist/node_modules/playwright/lib/common/ipc.js +60 -0
- package/dist/node_modules/playwright/lib/common/poolBuilder.js +85 -0
- package/dist/node_modules/playwright/lib/common/process.js +104 -0
- package/dist/node_modules/playwright/lib/common/suiteUtils.js +140 -0
- package/dist/node_modules/playwright/lib/common/test.js +321 -0
- package/dist/node_modules/playwright/lib/common/testLoader.js +101 -0
- package/dist/node_modules/playwright/lib/common/testType.js +298 -0
- package/dist/node_modules/playwright/lib/common/validators.js +68 -0
- package/dist/node_modules/playwright/lib/fsWatcher.js +67 -0
- package/dist/node_modules/playwright/lib/index.js +682 -0
- package/dist/node_modules/playwright/lib/internalsForTest.js +42 -0
- package/dist/node_modules/playwright/lib/isomorphic/events.js +77 -0
- package/dist/node_modules/playwright/lib/isomorphic/folders.js +30 -0
- package/dist/node_modules/playwright/lib/isomorphic/stringInternPool.js +69 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleReceiver.js +508 -0
- package/dist/node_modules/playwright/lib/isomorphic/teleSuiteUpdater.js +137 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerConnection.js +225 -0
- package/dist/node_modules/playwright/lib/isomorphic/testServerInterface.js +16 -0
- package/dist/node_modules/playwright/lib/isomorphic/testTree.js +334 -0
- package/dist/node_modules/playwright/lib/isomorphic/types.d.js +16 -0
- package/dist/node_modules/playwright/lib/loader/loaderMain.js +59 -0
- package/dist/node_modules/playwright/lib/matchers/expect.js +324 -0
- package/dist/node_modules/playwright/lib/matchers/matcherHint.js +87 -0
- package/dist/node_modules/playwright/lib/matchers/matchers.js +382 -0
- package/dist/node_modules/playwright/lib/matchers/toBeTruthy.js +73 -0
- package/dist/node_modules/playwright/lib/matchers/toEqual.js +99 -0
- package/dist/node_modules/playwright/lib/matchers/toHaveURL.js +102 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchAriaSnapshot.js +159 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchSnapshot.js +341 -0
- package/dist/node_modules/playwright/lib/matchers/toMatchText.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/browser/actions.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserContextFactory.js +296 -0
- package/dist/node_modules/playwright/lib/mcp/browser/browserServerBackend.js +76 -0
- package/dist/node_modules/playwright/lib/mcp/browser/codegen.js +66 -0
- package/dist/node_modules/playwright/lib/mcp/browser/config.js +368 -0
- package/dist/node_modules/playwright/lib/mcp/browser/context.js +267 -0
- package/dist/node_modules/playwright/lib/mcp/browser/response.js +237 -0
- package/dist/node_modules/playwright/lib/mcp/browser/sessionLog.js +160 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tab.js +292 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/common.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/console.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/dialogs.js +60 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/evaluate.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/files.js +58 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/form.js +73 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/install.js +69 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/keyboard.js +84 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/mouse.js +107 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/navigate.js +62 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/network.js +54 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/pdf.js +59 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/runCode.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/screenshot.js +106 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/snapshot.js +181 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tabs.js +67 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tool.js +49 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/tracing.js +74 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/utils.js +89 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/verify.js +153 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools/wait.js +63 -0
- package/dist/node_modules/playwright/lib/mcp/browser/tools.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/browser/watchdog.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/config.d.js +16 -0
- package/dist/node_modules/playwright/lib/mcp/extension/cdpRelay.js +351 -0
- package/dist/node_modules/playwright/lib/mcp/extension/extensionContextFactory.js +75 -0
- package/dist/node_modules/playwright/lib/mcp/extension/protocol.js +28 -0
- package/dist/node_modules/playwright/lib/mcp/index.js +61 -0
- package/dist/node_modules/playwright/lib/mcp/log.js +35 -0
- package/dist/node_modules/playwright/lib/mcp/program.js +116 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/bundle.js +81 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/exports.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/http.js +187 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/inProcessTransport.js +71 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/proxyBackend.js +128 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/server.js +198 -0
- package/dist/node_modules/playwright/lib/mcp/sdk/tool.js +47 -0
- package/dist/node_modules/playwright/lib/mcp/test/browserBackend.js +108 -0
- package/dist/node_modules/playwright/lib/mcp/test/generatorTools.js +122 -0
- package/dist/node_modules/playwright/lib/mcp/test/plannerTools.js +144 -0
- package/dist/node_modules/playwright/lib/mcp/test/seed.js +82 -0
- package/dist/node_modules/playwright/lib/mcp/test/streams.js +44 -0
- package/dist/node_modules/playwright/lib/mcp/test/testBackend.js +99 -0
- package/dist/node_modules/playwright/lib/mcp/test/testContext.js +279 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTool.js +30 -0
- package/dist/node_modules/playwright/lib/mcp/test/testTools.js +106 -0
- package/dist/node_modules/playwright/lib/mcpBundleImpl.js +41 -0
- package/dist/node_modules/playwright/lib/plugins/gitCommitInfoPlugin.js +198 -0
- package/dist/node_modules/playwright/lib/plugins/index.js +28 -0
- package/dist/node_modules/playwright/lib/plugins/webServerPlugin.js +237 -0
- package/dist/node_modules/playwright/lib/program.js +403 -0
- package/dist/node_modules/playwright/lib/reporters/base.js +609 -0
- package/dist/node_modules/playwright/lib/reporters/blob.js +135 -0
- package/dist/node_modules/playwright/lib/reporters/dot.js +82 -0
- package/dist/node_modules/playwright/lib/reporters/empty.js +32 -0
- package/dist/node_modules/playwright/lib/reporters/github.js +128 -0
- package/dist/node_modules/playwright/lib/reporters/html.js +623 -0
- package/dist/node_modules/playwright/lib/reporters/internalReporter.js +132 -0
- package/dist/node_modules/playwright/lib/reporters/json.js +254 -0
- package/dist/node_modules/playwright/lib/reporters/junit.js +232 -0
- package/dist/node_modules/playwright/lib/reporters/line.js +113 -0
- package/dist/node_modules/playwright/lib/reporters/list.js +231 -0
- package/dist/node_modules/playwright/lib/reporters/listModeReporter.js +69 -0
- package/dist/node_modules/playwright/lib/reporters/markdown.js +144 -0
- package/dist/node_modules/playwright/lib/reporters/merge.js +541 -0
- package/dist/node_modules/playwright/lib/reporters/multiplexer.js +104 -0
- package/dist/node_modules/playwright/lib/reporters/reporterV2.js +102 -0
- package/dist/node_modules/playwright/lib/reporters/teleEmitter.js +299 -0
- package/dist/node_modules/playwright/lib/reporters/versions/blobV1.js +16 -0
- package/dist/node_modules/playwright/lib/runner/dispatcher.js +515 -0
- package/dist/node_modules/playwright/lib/runner/failureTracker.js +72 -0
- package/dist/node_modules/playwright/lib/runner/lastRun.js +77 -0
- package/dist/node_modules/playwright/lib/runner/loadUtils.js +334 -0
- package/dist/node_modules/playwright/lib/runner/loaderHost.js +89 -0
- package/dist/node_modules/playwright/lib/runner/processHost.js +161 -0
- package/dist/node_modules/playwright/lib/runner/projectUtils.js +241 -0
- package/dist/node_modules/playwright/lib/runner/rebase.js +189 -0
- package/dist/node_modules/playwright/lib/runner/reporters.js +138 -0
- package/dist/node_modules/playwright/lib/runner/sigIntWatcher.js +96 -0
- package/dist/node_modules/playwright/lib/runner/taskRunner.js +127 -0
- package/dist/node_modules/playwright/lib/runner/tasks.js +410 -0
- package/dist/node_modules/playwright/lib/runner/testGroups.js +117 -0
- package/dist/node_modules/playwright/lib/runner/testRunner.js +389 -0
- package/dist/node_modules/playwright/lib/runner/testServer.js +269 -0
- package/dist/node_modules/playwright/lib/runner/uiModeReporter.js +30 -0
- package/dist/node_modules/playwright/lib/runner/vcs.js +72 -0
- package/dist/node_modules/playwright/lib/runner/watchMode.js +395 -0
- package/dist/node_modules/playwright/lib/runner/workerHost.js +98 -0
- package/dist/node_modules/playwright/lib/third_party/pirates.js +62 -0
- package/dist/node_modules/playwright/lib/third_party/tsconfig-loader.js +103 -0
- package/dist/node_modules/playwright/lib/transform/babelBundle.js +43 -0
- package/dist/node_modules/playwright/lib/transform/babelBundleImpl.js +461 -0
- package/dist/node_modules/playwright/lib/transform/compilationCache.js +272 -0
- package/dist/node_modules/playwright/lib/transform/esmLoader.js +104 -0
- package/dist/node_modules/playwright/lib/transform/portTransport.js +67 -0
- package/dist/node_modules/playwright/lib/transform/transform.js +293 -0
- package/dist/node_modules/playwright/lib/util.js +403 -0
- package/dist/node_modules/playwright/lib/utilsBundle.js +43 -0
- package/dist/node_modules/playwright/lib/utilsBundleImpl.js +100 -0
- package/dist/node_modules/playwright/lib/worker/fixtureRunner.js +258 -0
- package/dist/node_modules/playwright/lib/worker/testInfo.js +516 -0
- package/dist/node_modules/playwright/lib/worker/testTracing.js +345 -0
- package/dist/node_modules/playwright/lib/worker/timeoutManager.js +174 -0
- package/dist/node_modules/playwright/lib/worker/util.js +31 -0
- package/dist/node_modules/playwright/lib/worker/workerMain.js +529 -0
- package/dist/node_modules/playwright/package.json +72 -0
- package/dist/node_modules/playwright/test.d.ts +18 -0
- package/dist/node_modules/playwright/test.js +24 -0
- package/dist/node_modules/playwright/test.mjs +33 -0
- package/dist/node_modules/playwright/types/test.d.ts +10253 -0
- package/dist/node_modules/playwright/types/testReporter.d.ts +821 -0
- package/dist/node_modules/playwright-core/LICENSE +202 -0
- package/dist/node_modules/playwright-core/NOTICE +5 -0
- package/dist/node_modules/playwright-core/README.md +3 -0
- package/dist/node_modules/playwright-core/ThirdPartyNotices.txt +1161 -0
- package/dist/node_modules/playwright-core/bin/install_media_pack.ps1 +5 -0
- package/dist/node_modules/playwright-core/bin/install_webkit_wsl.ps1 +33 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_mac.sh +13 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_beta_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_linux.sh +42 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_mac.sh +12 -0
- package/dist/node_modules/playwright-core/bin/reinstall_chrome_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_beta_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_dev_win.ps1 +23 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_linux.sh +48 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_mac.sh +11 -0
- package/dist/node_modules/playwright-core/bin/reinstall_msedge_stable_win.ps1 +24 -0
- package/dist/node_modules/playwright-core/browsers.json +80 -0
- package/dist/node_modules/playwright-core/cli.js +18 -0
- package/dist/node_modules/playwright-core/index.d.ts +17 -0
- package/dist/node_modules/playwright-core/index.js +32 -0
- package/dist/node_modules/playwright-core/index.mjs +28 -0
- package/dist/node_modules/playwright-core/lib/androidServerImpl.js +65 -0
- package/dist/node_modules/playwright-core/lib/browserServerImpl.js +120 -0
- package/dist/node_modules/playwright-core/lib/cli/driver.js +97 -0
- package/dist/node_modules/playwright-core/lib/cli/program.js +590 -0
- package/dist/node_modules/playwright-core/lib/cli/programWithTestStub.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/android.js +361 -0
- package/dist/node_modules/playwright-core/lib/client/api.js +134 -0
- package/dist/node_modules/playwright-core/lib/client/artifact.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/browser.js +163 -0
- package/dist/node_modules/playwright-core/lib/client/browserContext.js +547 -0
- package/dist/node_modules/playwright-core/lib/client/browserType.js +184 -0
- package/dist/node_modules/playwright-core/lib/client/cdpSession.js +51 -0
- package/dist/node_modules/playwright-core/lib/client/channelOwner.js +194 -0
- package/dist/node_modules/playwright-core/lib/client/clientHelper.js +64 -0
- package/dist/node_modules/playwright-core/lib/client/clientInstrumentation.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/clientStackTrace.js +69 -0
- package/dist/node_modules/playwright-core/lib/client/clock.js +68 -0
- package/dist/node_modules/playwright-core/lib/client/connection.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/consoleMessage.js +58 -0
- package/dist/node_modules/playwright-core/lib/client/coverage.js +44 -0
- package/dist/node_modules/playwright-core/lib/client/dialog.js +56 -0
- package/dist/node_modules/playwright-core/lib/client/download.js +62 -0
- package/dist/node_modules/playwright-core/lib/client/electron.js +138 -0
- package/dist/node_modules/playwright-core/lib/client/elementHandle.js +281 -0
- package/dist/node_modules/playwright-core/lib/client/errors.js +77 -0
- package/dist/node_modules/playwright-core/lib/client/eventEmitter.js +314 -0
- package/dist/node_modules/playwright-core/lib/client/events.js +100 -0
- package/dist/node_modules/playwright-core/lib/client/fetch.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/fileChooser.js +46 -0
- package/dist/node_modules/playwright-core/lib/client/fileUtils.js +34 -0
- package/dist/node_modules/playwright-core/lib/client/frame.js +408 -0
- package/dist/node_modules/playwright-core/lib/client/harRouter.js +87 -0
- package/dist/node_modules/playwright-core/lib/client/input.js +84 -0
- package/dist/node_modules/playwright-core/lib/client/jsHandle.js +109 -0
- package/dist/node_modules/playwright-core/lib/client/jsonPipe.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/localUtils.js +60 -0
- package/dist/node_modules/playwright-core/lib/client/locator.js +369 -0
- package/dist/node_modules/playwright-core/lib/client/network.js +747 -0
- package/dist/node_modules/playwright-core/lib/client/page.js +718 -0
- package/dist/node_modules/playwright-core/lib/client/platform.js +74 -0
- package/dist/node_modules/playwright-core/lib/client/playwright.js +71 -0
- package/dist/node_modules/playwright-core/lib/client/selectors.js +55 -0
- package/dist/node_modules/playwright-core/lib/client/stream.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/timeoutSettings.js +79 -0
- package/dist/node_modules/playwright-core/lib/client/tracing.js +119 -0
- package/dist/node_modules/playwright-core/lib/client/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/client/video.js +59 -0
- package/dist/node_modules/playwright-core/lib/client/waiter.js +142 -0
- package/dist/node_modules/playwright-core/lib/client/webError.js +39 -0
- package/dist/node_modules/playwright-core/lib/client/webSocket.js +93 -0
- package/dist/node_modules/playwright-core/lib/client/worker.js +85 -0
- package/dist/node_modules/playwright-core/lib/client/writableStream.js +39 -0
- package/dist/node_modules/playwright-core/lib/generated/bindingsControllerSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/clockSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/injectedScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/pollingRecorderSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/storageScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/utilityScriptSource.js +28 -0
- package/dist/node_modules/playwright-core/lib/generated/webSocketMockSource.js +336 -0
- package/dist/node_modules/playwright-core/lib/inProcessFactory.js +60 -0
- package/dist/node_modules/playwright-core/lib/inprocess.js +3 -0
- package/dist/node_modules/playwright-core/lib/outofprocess.js +76 -0
- package/dist/node_modules/playwright-core/lib/protocol/serializers.js +192 -0
- package/dist/node_modules/playwright-core/lib/protocol/validator.js +2890 -0
- package/dist/node_modules/playwright-core/lib/protocol/validatorPrimitives.js +193 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightConnection.js +129 -0
- package/dist/node_modules/playwright-core/lib/remote/playwrightServer.js +335 -0
- package/dist/node_modules/playwright-core/lib/server/android/android.js +465 -0
- package/dist/node_modules/playwright-core/lib/server/android/backendAdb.js +177 -0
- package/dist/node_modules/playwright-core/lib/server/artifact.js +127 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiBrowser.js +505 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiChromium.js +153 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiConnection.js +212 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiExecutionContext.js +221 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiFirefox.js +130 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiInput.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiNetworkManager.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiOverCdp.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPage.js +572 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/bidiPdf.js +106 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiCommands.d.js +22 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiDeserializer.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiKeyboard.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocol.js +24 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolCore.js +179 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiProtocolPermissions.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/bidiSerializer.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/bidi/third_party/firefoxPrefs.js +259 -0
- package/dist/node_modules/playwright-core/lib/server/browser.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/browserContext.js +695 -0
- package/dist/node_modules/playwright-core/lib/server/browserType.js +328 -0
- package/dist/node_modules/playwright-core/lib/server/callLog.js +82 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/appIcon.png +0 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromium.js +402 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/chromiumSwitches.js +104 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crBrowser.js +510 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crConnection.js +202 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crCoverage.js +235 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDevTools.js +113 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crDragDrop.js +131 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crExecutionContext.js +146 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crInput.js +187 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crNetworkManager.js +666 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPage.js +1069 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crPdf.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crProtocolHelper.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/crServiceWorker.js +136 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/defaultFontFamilies.js +162 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/chromium/videoRecorder.js +115 -0
- package/dist/node_modules/playwright-core/lib/server/clock.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/csharp.js +327 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/java.js +274 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/javascript.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/jsonl.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/language.js +132 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/languages.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/python.js +279 -0
- package/dist/node_modules/playwright-core/lib/server/codegen/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/console.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/cookieStore.js +206 -0
- package/dist/node_modules/playwright-core/lib/server/debugController.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/debugger.js +119 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptors.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/deviceDescriptorsSource.json +1779 -0
- package/dist/node_modules/playwright-core/lib/server/dialog.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/androidDispatcher.js +325 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/artifactDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserContextDispatcher.js +381 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserDispatcher.js +118 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/browserTypeDispatcher.js +64 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/cdpSessionDispatcher.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/debugControllerDispatcher.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dialogDispatcher.js +47 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/dispatcher.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/electronDispatcher.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/elementHandlerDispatcher.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/frameDispatcher.js +227 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsHandleDispatcher.js +85 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/jsonPipeDispatcher.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/localUtilsDispatcher.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/networkDispatchers.js +213 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/pageDispatcher.js +389 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/playwrightDispatcher.js +108 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/streamDispatcher.js +67 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/tracingDispatcher.js +68 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/webSocketRouteDispatcher.js +165 -0
- package/dist/node_modules/playwright-core/lib/server/dispatchers/writableStreamDispatcher.js +79 -0
- package/dist/node_modules/playwright-core/lib/server/dom.js +806 -0
- package/dist/node_modules/playwright-core/lib/server/download.js +70 -0
- package/dist/node_modules/playwright-core/lib/server/electron/electron.js +270 -0
- package/dist/node_modules/playwright-core/lib/server/electron/loader.js +29 -0
- package/dist/node_modules/playwright-core/lib/server/errors.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/fetch.js +621 -0
- package/dist/node_modules/playwright-core/lib/server/fileChooser.js +43 -0
- package/dist/node_modules/playwright-core/lib/server/fileUploadUtils.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffBrowser.js +428 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffConnection.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffExecutionContext.js +150 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffInput.js +159 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffNetworkManager.js +256 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/ffPage.js +500 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/firefox.js +116 -0
- package/dist/node_modules/playwright-core/lib/server/firefox/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/formData.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/frameSelectors.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/frames.js +1455 -0
- package/dist/node_modules/playwright-core/lib/server/har/harRecorder.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/har/harTracer.js +607 -0
- package/dist/node_modules/playwright-core/lib/server/harBackend.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/helper.js +96 -0
- package/dist/node_modules/playwright-core/lib/server/index.js +58 -0
- package/dist/node_modules/playwright-core/lib/server/input.js +277 -0
- package/dist/node_modules/playwright-core/lib/server/instrumentation.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/javascript.js +291 -0
- package/dist/node_modules/playwright-core/lib/server/launchApp.js +128 -0
- package/dist/node_modules/playwright-core/lib/server/localUtils.js +214 -0
- package/dist/node_modules/playwright-core/lib/server/macEditingCommands.js +143 -0
- package/dist/node_modules/playwright-core/lib/server/network.js +629 -0
- package/dist/node_modules/playwright-core/lib/server/page.js +886 -0
- package/dist/node_modules/playwright-core/lib/server/pipeTransport.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/playwright.js +69 -0
- package/dist/node_modules/playwright-core/lib/server/progress.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/protocolError.js +52 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/chat.js +161 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderApp.js +387 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderRunner.js +138 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderSignalProcessor.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/recorderUtils.js +157 -0
- package/dist/node_modules/playwright-core/lib/server/recorder/throttledFile.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/recorder.js +499 -0
- package/dist/node_modules/playwright-core/lib/server/registry/browserFetcher.js +175 -0
- package/dist/node_modules/playwright-core/lib/server/registry/dependencies.js +371 -0
- package/dist/node_modules/playwright-core/lib/server/registry/index.js +1399 -0
- package/dist/node_modules/playwright-core/lib/server/registry/nativeDeps.js +1280 -0
- package/dist/node_modules/playwright-core/lib/server/registry/oopDownloadBrowserMain.js +124 -0
- package/dist/node_modules/playwright-core/lib/server/screenshotter.js +333 -0
- package/dist/node_modules/playwright-core/lib/server/selectors.js +112 -0
- package/dist/node_modules/playwright-core/lib/server/socksClientCertificatesInterceptor.js +383 -0
- package/dist/node_modules/playwright-core/lib/server/socksInterceptor.js +95 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotter.js +147 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/snapshotterInjected.js +541 -0
- package/dist/node_modules/playwright-core/lib/server/trace/recorder/tracing.js +604 -0
- package/dist/node_modules/playwright-core/lib/server/trace/test/inMemorySnapshotter.js +87 -0
- package/dist/node_modules/playwright-core/lib/server/trace/viewer/traceViewer.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/transport.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/types.js +28 -0
- package/dist/node_modules/playwright-core/lib/server/usKeyboardLayout.js +145 -0
- package/dist/node_modules/playwright-core/lib/server/utils/ascii.js +44 -0
- package/dist/node_modules/playwright-core/lib/server/utils/comparators.js +139 -0
- package/dist/node_modules/playwright-core/lib/server/utils/crypto.js +216 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debug.js +42 -0
- package/dist/node_modules/playwright-core/lib/server/utils/debugLogger.js +122 -0
- package/dist/node_modules/playwright-core/lib/server/utils/env.js +73 -0
- package/dist/node_modules/playwright-core/lib/server/utils/eventsHelper.js +39 -0
- package/dist/node_modules/playwright-core/lib/server/utils/expectUtils.js +38 -0
- package/dist/node_modules/playwright-core/lib/server/utils/fileUtils.js +191 -0
- package/dist/node_modules/playwright-core/lib/server/utils/happyEyeballs.js +207 -0
- package/dist/node_modules/playwright-core/lib/server/utils/hostPlatform.js +123 -0
- package/dist/node_modules/playwright-core/lib/server/utils/httpServer.js +218 -0
- package/dist/node_modules/playwright-core/lib/server/utils/imageUtils.js +141 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/colorUtils.js +89 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/compare.js +109 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/imageChannel.js +78 -0
- package/dist/node_modules/playwright-core/lib/server/utils/image_tools/stats.js +102 -0
- package/dist/node_modules/playwright-core/lib/server/utils/linuxUtils.js +71 -0
- package/dist/node_modules/playwright-core/lib/server/utils/network.js +233 -0
- package/dist/node_modules/playwright-core/lib/server/utils/nodePlatform.js +148 -0
- package/dist/node_modules/playwright-core/lib/server/utils/pipeTransport.js +84 -0
- package/dist/node_modules/playwright-core/lib/server/utils/processLauncher.js +241 -0
- package/dist/node_modules/playwright-core/lib/server/utils/profiler.js +65 -0
- package/dist/node_modules/playwright-core/lib/server/utils/socksProxy.js +511 -0
- package/dist/node_modules/playwright-core/lib/server/utils/spawnAsync.js +41 -0
- package/dist/node_modules/playwright-core/lib/server/utils/task.js +51 -0
- package/dist/node_modules/playwright-core/lib/server/utils/userAgent.js +98 -0
- package/dist/node_modules/playwright-core/lib/server/utils/wsServer.js +121 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zipFile.js +74 -0
- package/dist/node_modules/playwright-core/lib/server/utils/zones.js +57 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/protocol.d.js +16 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/webkit.js +110 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkBrowser.js +339 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkConnection.js +149 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkExecutionContext.js +154 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInput.js +181 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkInterceptableRequest.js +169 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkPage.js +1130 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkProvisionalPage.js +83 -0
- package/dist/node_modules/playwright-core/lib/server/webkit/wkWorkers.js +105 -0
- package/dist/node_modules/playwright-core/lib/third_party/pixelmatch.js +255 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/ariaSnapshot.js +397 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/assert.js +31 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/colors.js +72 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssParser.js +245 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/cssTokenizer.js +1051 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/headers.js +53 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorGenerators.js +689 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorParser.js +176 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/locatorUtils.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/manualPromise.js +114 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/mimeType.js +459 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/multimap.js +80 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolFormatter.js +81 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/protocolMetainfo.js +322 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/rtti.js +43 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/selectorParser.js +386 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/semaphore.js +54 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stackTrace.js +158 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/stringUtils.js +155 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/time.js +49 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/timeoutRunner.js +66 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/traceUtils.js +58 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/types.js +16 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/urlMatch.js +190 -0
- package/dist/node_modules/playwright-core/lib/utils/isomorphic/utilityScriptSerializers.js +251 -0
- package/dist/node_modules/playwright-core/lib/utils.js +109 -0
- package/dist/node_modules/playwright-core/lib/utilsBundle.js +112 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/index.js +218 -0
- package/dist/node_modules/playwright-core/lib/utilsBundleImpl/xdg-open +1066 -0
- package/dist/node_modules/playwright-core/lib/vite/htmlReport/index.html +84 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-BoWUGj0J.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codeMirrorModule-C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/codicon-DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-DJqDAOZp.js +193 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/assets/index-Ri0uHF7I.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/index.html +29 -0
- package/dist/node_modules/playwright-core/lib/vite/recorder/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/codeMirrorModule-Bucv2d7q.js +25 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/defaultSettingsView-BEpdCv1S.js +266 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/assets/xtermModule-CsJ4vdCR.js +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codeMirrorModule.C3UTv-Ge.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/codicon.DCmgc-ay.ttf +0 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/defaultSettingsView.ConWv5KN.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.BxQ34UMZ.js +2 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.C4Y3Aw8n.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/index.html +43 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/manifest.webmanifest +16 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/playwright-logo.svg +9 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/snapshot.html +21 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/sw.bundle.js +3 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.BWTwXl41.js +5 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.Btcz36p_.css +1 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/uiMode.html +17 -0
- package/dist/node_modules/playwright-core/lib/vite/traceViewer/xtermModule.DYP7pi_n.css +32 -0
- package/dist/node_modules/playwright-core/lib/zipBundle.js +34 -0
- package/dist/node_modules/playwright-core/lib/zipBundleImpl.js +5 -0
- package/dist/node_modules/playwright-core/package.json +42 -0
- package/dist/node_modules/playwright-core/types/protocol.d.ts +23245 -0
- package/dist/node_modules/playwright-core/types/structs.d.ts +45 -0
- package/dist/node_modules/playwright-core/types/types.d.ts +22856 -0
- package/dist/server.obf.js +1 -1
- package/package.json +11 -12
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var bundle_exports = {};
|
|
30
|
+
__export(bundle_exports, {
|
|
31
|
+
CallToolRequestSchema: () => CallToolRequestSchema,
|
|
32
|
+
Client: () => Client,
|
|
33
|
+
ListRootsRequestSchema: () => ListRootsRequestSchema,
|
|
34
|
+
ListToolsRequestSchema: () => ListToolsRequestSchema,
|
|
35
|
+
PingRequestSchema: () => PingRequestSchema,
|
|
36
|
+
ProgressNotificationSchema: () => ProgressNotificationSchema,
|
|
37
|
+
SSEClientTransport: () => SSEClientTransport,
|
|
38
|
+
SSEServerTransport: () => SSEServerTransport,
|
|
39
|
+
Server: () => Server,
|
|
40
|
+
StdioClientTransport: () => StdioClientTransport,
|
|
41
|
+
StdioServerTransport: () => StdioServerTransport,
|
|
42
|
+
StreamableHTTPClientTransport: () => StreamableHTTPClientTransport,
|
|
43
|
+
StreamableHTTPServerTransport: () => StreamableHTTPServerTransport,
|
|
44
|
+
z: () => z,
|
|
45
|
+
zodToJsonSchema: () => zodToJsonSchema
|
|
46
|
+
});
|
|
47
|
+
module.exports = __toCommonJS(bundle_exports);
|
|
48
|
+
var bundle = __toESM(require("../../mcpBundleImpl"));
|
|
49
|
+
const zodToJsonSchema = bundle.zodToJsonSchema;
|
|
50
|
+
const Client = bundle.Client;
|
|
51
|
+
const Server = bundle.Server;
|
|
52
|
+
const SSEClientTransport = bundle.SSEClientTransport;
|
|
53
|
+
const SSEServerTransport = bundle.SSEServerTransport;
|
|
54
|
+
const StdioClientTransport = bundle.StdioClientTransport;
|
|
55
|
+
const StdioServerTransport = bundle.StdioServerTransport;
|
|
56
|
+
const StreamableHTTPServerTransport = bundle.StreamableHTTPServerTransport;
|
|
57
|
+
const StreamableHTTPClientTransport = bundle.StreamableHTTPClientTransport;
|
|
58
|
+
const CallToolRequestSchema = bundle.CallToolRequestSchema;
|
|
59
|
+
const ListRootsRequestSchema = bundle.ListRootsRequestSchema;
|
|
60
|
+
const ProgressNotificationSchema = bundle.ProgressNotificationSchema;
|
|
61
|
+
const ListToolsRequestSchema = bundle.ListToolsRequestSchema;
|
|
62
|
+
const PingRequestSchema = bundle.PingRequestSchema;
|
|
63
|
+
const z = bundle.z;
|
|
64
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
65
|
+
0 && (module.exports = {
|
|
66
|
+
CallToolRequestSchema,
|
|
67
|
+
Client,
|
|
68
|
+
ListRootsRequestSchema,
|
|
69
|
+
ListToolsRequestSchema,
|
|
70
|
+
PingRequestSchema,
|
|
71
|
+
ProgressNotificationSchema,
|
|
72
|
+
SSEClientTransport,
|
|
73
|
+
SSEServerTransport,
|
|
74
|
+
Server,
|
|
75
|
+
StdioClientTransport,
|
|
76
|
+
StdioServerTransport,
|
|
77
|
+
StreamableHTTPClientTransport,
|
|
78
|
+
StreamableHTTPServerTransport,
|
|
79
|
+
z,
|
|
80
|
+
zodToJsonSchema
|
|
81
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
15
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
16
|
+
var exports_exports = {};
|
|
17
|
+
module.exports = __toCommonJS(exports_exports);
|
|
18
|
+
__reExport(exports_exports, require("./inProcessTransport"), module.exports);
|
|
19
|
+
__reExport(exports_exports, require("./proxyBackend"), module.exports);
|
|
20
|
+
__reExport(exports_exports, require("./server"), module.exports);
|
|
21
|
+
__reExport(exports_exports, require("./tool"), module.exports);
|
|
22
|
+
__reExport(exports_exports, require("./http"), module.exports);
|
|
23
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
24
|
+
0 && (module.exports = {
|
|
25
|
+
...require("./inProcessTransport"),
|
|
26
|
+
...require("./proxyBackend"),
|
|
27
|
+
...require("./server"),
|
|
28
|
+
...require("./tool"),
|
|
29
|
+
...require("./http")
|
|
30
|
+
});
|
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var http_exports = {};
|
|
30
|
+
__export(http_exports, {
|
|
31
|
+
httpAddressToString: () => httpAddressToString,
|
|
32
|
+
installHttpTransport: () => installHttpTransport,
|
|
33
|
+
startHttpServer: () => startHttpServer
|
|
34
|
+
});
|
|
35
|
+
module.exports = __toCommonJS(http_exports);
|
|
36
|
+
var import_assert = __toESM(require("assert"));
|
|
37
|
+
var import_http = __toESM(require("http"));
|
|
38
|
+
var import_crypto = __toESM(require("crypto"));
|
|
39
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
40
|
+
var mcpBundle = __toESM(require("./bundle"));
|
|
41
|
+
var mcpServer = __toESM(require("./server"));
|
|
42
|
+
const testDebug = (0, import_utilsBundle.debug)("pw:mcp:test");
|
|
43
|
+
async function startHttpServer(config, abortSignal) {
|
|
44
|
+
const { host, port } = config;
|
|
45
|
+
const httpServer = import_http.default.createServer();
|
|
46
|
+
decorateServer(httpServer);
|
|
47
|
+
await new Promise((resolve, reject) => {
|
|
48
|
+
httpServer.on("error", reject);
|
|
49
|
+
abortSignal?.addEventListener("abort", () => {
|
|
50
|
+
httpServer.close();
|
|
51
|
+
reject(new Error("Aborted"));
|
|
52
|
+
});
|
|
53
|
+
httpServer.listen(port, host, () => {
|
|
54
|
+
resolve();
|
|
55
|
+
httpServer.removeListener("error", reject);
|
|
56
|
+
});
|
|
57
|
+
});
|
|
58
|
+
return httpServer;
|
|
59
|
+
}
|
|
60
|
+
function httpAddressToString(address) {
|
|
61
|
+
(0, import_assert.default)(address, "Could not bind server socket");
|
|
62
|
+
if (typeof address === "string")
|
|
63
|
+
return address;
|
|
64
|
+
const resolvedPort = address.port;
|
|
65
|
+
let resolvedHost = address.family === "IPv4" ? address.address : `[${address.address}]`;
|
|
66
|
+
if (resolvedHost === "0.0.0.0" || resolvedHost === "[::]")
|
|
67
|
+
resolvedHost = "localhost";
|
|
68
|
+
return `http://${resolvedHost}:${resolvedPort}`;
|
|
69
|
+
}
|
|
70
|
+
async function installHttpTransport(httpServer, serverBackendFactory, unguessableUrl, allowedHosts) {
|
|
71
|
+
const url = httpAddressToString(httpServer.address());
|
|
72
|
+
const host = new URL(url).host;
|
|
73
|
+
allowedHosts = (allowedHosts || [host]).map((h) => h.toLowerCase());
|
|
74
|
+
const allowAnyHost = allowedHosts.includes("*");
|
|
75
|
+
const pathPrefix = unguessableUrl ? `/${import_crypto.default.randomUUID()}` : "";
|
|
76
|
+
const sseSessions = /* @__PURE__ */ new Map();
|
|
77
|
+
const streamableSessions = /* @__PURE__ */ new Map();
|
|
78
|
+
httpServer.on("request", async (req, res) => {
|
|
79
|
+
if (!allowAnyHost) {
|
|
80
|
+
const host2 = req.headers.host?.toLowerCase();
|
|
81
|
+
if (!host2) {
|
|
82
|
+
res.statusCode = 400;
|
|
83
|
+
return res.end("Missing host");
|
|
84
|
+
}
|
|
85
|
+
if (!allowedHosts.includes(host2)) {
|
|
86
|
+
res.statusCode = 403;
|
|
87
|
+
return res.end("Access is only allowed at " + allowedHosts.join(", "));
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
if (!req.url?.startsWith(pathPrefix)) {
|
|
91
|
+
res.statusCode = 404;
|
|
92
|
+
return res.end("Not found");
|
|
93
|
+
}
|
|
94
|
+
const path = req.url?.slice(pathPrefix.length);
|
|
95
|
+
const url2 = new URL(`http://localhost${path}`);
|
|
96
|
+
if (url2.pathname === "/killkillkill" && req.method === "GET") {
|
|
97
|
+
res.statusCode = 200;
|
|
98
|
+
res.end("Killing process");
|
|
99
|
+
process.emit("SIGINT");
|
|
100
|
+
return;
|
|
101
|
+
}
|
|
102
|
+
if (url2.pathname.startsWith("/sse"))
|
|
103
|
+
await handleSSE(serverBackendFactory, req, res, url2, sseSessions);
|
|
104
|
+
else
|
|
105
|
+
await handleStreamable(serverBackendFactory, req, res, streamableSessions);
|
|
106
|
+
});
|
|
107
|
+
return `${url}${pathPrefix}`;
|
|
108
|
+
}
|
|
109
|
+
async function handleSSE(serverBackendFactory, req, res, url, sessions) {
|
|
110
|
+
if (req.method === "POST") {
|
|
111
|
+
const sessionId = url.searchParams.get("sessionId");
|
|
112
|
+
if (!sessionId) {
|
|
113
|
+
res.statusCode = 400;
|
|
114
|
+
return res.end("Missing sessionId");
|
|
115
|
+
}
|
|
116
|
+
const transport = sessions.get(sessionId);
|
|
117
|
+
if (!transport) {
|
|
118
|
+
res.statusCode = 404;
|
|
119
|
+
return res.end("Session not found");
|
|
120
|
+
}
|
|
121
|
+
return await transport.handlePostMessage(req, res);
|
|
122
|
+
} else if (req.method === "GET") {
|
|
123
|
+
const transport = new mcpBundle.SSEServerTransport("/sse", res);
|
|
124
|
+
sessions.set(transport.sessionId, transport);
|
|
125
|
+
testDebug(`create SSE session: ${transport.sessionId}`);
|
|
126
|
+
await mcpServer.connect(serverBackendFactory, transport, false);
|
|
127
|
+
res.on("close", () => {
|
|
128
|
+
testDebug(`delete SSE session: ${transport.sessionId}`);
|
|
129
|
+
sessions.delete(transport.sessionId);
|
|
130
|
+
});
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
res.statusCode = 405;
|
|
134
|
+
res.end("Method not allowed");
|
|
135
|
+
}
|
|
136
|
+
async function handleStreamable(serverBackendFactory, req, res, sessions) {
|
|
137
|
+
const sessionId = req.headers["mcp-session-id"];
|
|
138
|
+
if (sessionId) {
|
|
139
|
+
const transport = sessions.get(sessionId);
|
|
140
|
+
if (!transport) {
|
|
141
|
+
res.statusCode = 404;
|
|
142
|
+
res.end("Session not found");
|
|
143
|
+
return;
|
|
144
|
+
}
|
|
145
|
+
return await transport.handleRequest(req, res);
|
|
146
|
+
}
|
|
147
|
+
if (req.method === "POST") {
|
|
148
|
+
const transport = new mcpBundle.StreamableHTTPServerTransport({
|
|
149
|
+
sessionIdGenerator: () => import_crypto.default.randomUUID(),
|
|
150
|
+
onsessioninitialized: async (sessionId2) => {
|
|
151
|
+
testDebug(`create http session: ${transport.sessionId}`);
|
|
152
|
+
await mcpServer.connect(serverBackendFactory, transport, true);
|
|
153
|
+
sessions.set(sessionId2, transport);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
156
|
+
transport.onclose = () => {
|
|
157
|
+
if (!transport.sessionId)
|
|
158
|
+
return;
|
|
159
|
+
sessions.delete(transport.sessionId);
|
|
160
|
+
testDebug(`delete http session: ${transport.sessionId}`);
|
|
161
|
+
};
|
|
162
|
+
await transport.handleRequest(req, res);
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
res.statusCode = 400;
|
|
166
|
+
res.end("Invalid request");
|
|
167
|
+
}
|
|
168
|
+
function decorateServer(server) {
|
|
169
|
+
const sockets = /* @__PURE__ */ new Set();
|
|
170
|
+
server.on("connection", (socket) => {
|
|
171
|
+
sockets.add(socket);
|
|
172
|
+
socket.once("close", () => sockets.delete(socket));
|
|
173
|
+
});
|
|
174
|
+
const close = server.close;
|
|
175
|
+
server.close = (callback) => {
|
|
176
|
+
for (const socket of sockets)
|
|
177
|
+
socket.destroy();
|
|
178
|
+
sockets.clear();
|
|
179
|
+
return close.call(server, callback);
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
183
|
+
0 && (module.exports = {
|
|
184
|
+
httpAddressToString,
|
|
185
|
+
installHttpTransport,
|
|
186
|
+
startHttpServer
|
|
187
|
+
});
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
var inProcessTransport_exports = {};
|
|
20
|
+
__export(inProcessTransport_exports, {
|
|
21
|
+
InProcessTransport: () => InProcessTransport
|
|
22
|
+
});
|
|
23
|
+
module.exports = __toCommonJS(inProcessTransport_exports);
|
|
24
|
+
class InProcessTransport {
|
|
25
|
+
constructor(server) {
|
|
26
|
+
this._connected = false;
|
|
27
|
+
this._server = server;
|
|
28
|
+
this._serverTransport = new InProcessServerTransport(this);
|
|
29
|
+
}
|
|
30
|
+
async start() {
|
|
31
|
+
if (this._connected)
|
|
32
|
+
throw new Error("InprocessTransport already started!");
|
|
33
|
+
await this._server.connect(this._serverTransport);
|
|
34
|
+
this._connected = true;
|
|
35
|
+
}
|
|
36
|
+
async send(message, options) {
|
|
37
|
+
if (!this._connected)
|
|
38
|
+
throw new Error("Transport not connected");
|
|
39
|
+
this._serverTransport._receiveFromClient(message);
|
|
40
|
+
}
|
|
41
|
+
async close() {
|
|
42
|
+
if (this._connected) {
|
|
43
|
+
this._connected = false;
|
|
44
|
+
this.onclose?.();
|
|
45
|
+
this._serverTransport.onclose?.();
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
_receiveFromServer(message, extra) {
|
|
49
|
+
this.onmessage?.(message, extra);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
class InProcessServerTransport {
|
|
53
|
+
constructor(clientTransport) {
|
|
54
|
+
this._clientTransport = clientTransport;
|
|
55
|
+
}
|
|
56
|
+
async start() {
|
|
57
|
+
}
|
|
58
|
+
async send(message, options) {
|
|
59
|
+
this._clientTransport._receiveFromServer(message);
|
|
60
|
+
}
|
|
61
|
+
async close() {
|
|
62
|
+
this.onclose?.();
|
|
63
|
+
}
|
|
64
|
+
_receiveFromClient(message) {
|
|
65
|
+
this.onmessage?.(message);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
69
|
+
0 && (module.exports = {
|
|
70
|
+
InProcessTransport
|
|
71
|
+
});
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var proxyBackend_exports = {};
|
|
30
|
+
__export(proxyBackend_exports, {
|
|
31
|
+
ProxyBackend: () => ProxyBackend
|
|
32
|
+
});
|
|
33
|
+
module.exports = __toCommonJS(proxyBackend_exports);
|
|
34
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
35
|
+
var mcpBundle = __toESM(require("./bundle"));
|
|
36
|
+
const errorsDebug = (0, import_utilsBundle.debug)("pw:mcp:errors");
|
|
37
|
+
const { z, zodToJsonSchema } = mcpBundle;
|
|
38
|
+
class ProxyBackend {
|
|
39
|
+
constructor(mcpProviders) {
|
|
40
|
+
this._mcpProviders = mcpProviders;
|
|
41
|
+
this._contextSwitchTool = this._defineContextSwitchTool();
|
|
42
|
+
}
|
|
43
|
+
async initialize(clientInfo) {
|
|
44
|
+
this._clientInfo = clientInfo;
|
|
45
|
+
}
|
|
46
|
+
async listTools() {
|
|
47
|
+
const currentClient = await this._ensureCurrentClient();
|
|
48
|
+
const response = await currentClient.listTools();
|
|
49
|
+
if (this._mcpProviders.length === 1)
|
|
50
|
+
return response.tools;
|
|
51
|
+
return [
|
|
52
|
+
...response.tools,
|
|
53
|
+
this._contextSwitchTool
|
|
54
|
+
];
|
|
55
|
+
}
|
|
56
|
+
async callTool(name, args) {
|
|
57
|
+
if (name === this._contextSwitchTool.name)
|
|
58
|
+
return this._callContextSwitchTool(args);
|
|
59
|
+
const currentClient = await this._ensureCurrentClient();
|
|
60
|
+
return await currentClient.callTool({
|
|
61
|
+
name,
|
|
62
|
+
arguments: args
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
serverClosed() {
|
|
66
|
+
void this._currentClient?.close().catch(errorsDebug);
|
|
67
|
+
}
|
|
68
|
+
async _callContextSwitchTool(params) {
|
|
69
|
+
try {
|
|
70
|
+
const factory = this._mcpProviders.find((factory2) => factory2.name === params.name);
|
|
71
|
+
if (!factory)
|
|
72
|
+
throw new Error("Unknown connection method: " + params.name);
|
|
73
|
+
await this._setCurrentClient(factory);
|
|
74
|
+
return {
|
|
75
|
+
content: [{ type: "text", text: "### Result\nSuccessfully changed connection method.\n" }]
|
|
76
|
+
};
|
|
77
|
+
} catch (error) {
|
|
78
|
+
return {
|
|
79
|
+
content: [{ type: "text", text: `### Result
|
|
80
|
+
Error: ${error}
|
|
81
|
+
` }],
|
|
82
|
+
isError: true
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
_defineContextSwitchTool() {
|
|
87
|
+
return {
|
|
88
|
+
name: "browser_connect",
|
|
89
|
+
description: [
|
|
90
|
+
"Connect to a browser using one of the available methods:",
|
|
91
|
+
...this._mcpProviders.map((factory) => `- "${factory.name}": ${factory.description}`)
|
|
92
|
+
].join("\n"),
|
|
93
|
+
inputSchema: zodToJsonSchema(z.object({
|
|
94
|
+
name: z.enum(this._mcpProviders.map((factory) => factory.name)).default(this._mcpProviders[0].name).describe("The method to use to connect to the browser")
|
|
95
|
+
}), { strictUnions: true }),
|
|
96
|
+
annotations: {
|
|
97
|
+
title: "Connect to a browser context",
|
|
98
|
+
readOnlyHint: true,
|
|
99
|
+
openWorldHint: false
|
|
100
|
+
}
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
async _ensureCurrentClient() {
|
|
104
|
+
if (this._currentClient)
|
|
105
|
+
return this._currentClient;
|
|
106
|
+
return await this._setCurrentClient(this._mcpProviders[0]);
|
|
107
|
+
}
|
|
108
|
+
async _setCurrentClient(factory) {
|
|
109
|
+
await this._currentClient?.close();
|
|
110
|
+
this._currentClient = void 0;
|
|
111
|
+
const client = new mcpBundle.Client({ name: "Playwright MCP Proxy", version: "0.0.0" });
|
|
112
|
+
client.registerCapabilities({
|
|
113
|
+
roots: {
|
|
114
|
+
listRoots: true
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
client.setRequestHandler(mcpBundle.ListRootsRequestSchema, () => ({ roots: this._clientInfo?.roots || [] }));
|
|
118
|
+
client.setRequestHandler(mcpBundle.PingRequestSchema, () => ({}));
|
|
119
|
+
const transport = await factory.connect();
|
|
120
|
+
await client.connect(transport);
|
|
121
|
+
this._currentClient = client;
|
|
122
|
+
return client;
|
|
123
|
+
}
|
|
124
|
+
}
|
|
125
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
126
|
+
0 && (module.exports = {
|
|
127
|
+
ProxyBackend
|
|
128
|
+
});
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __export = (target, all) => {
|
|
9
|
+
for (var name in all)
|
|
10
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
11
|
+
};
|
|
12
|
+
var __copyProps = (to, from, except, desc) => {
|
|
13
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
14
|
+
for (let key of __getOwnPropNames(from))
|
|
15
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
16
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
17
|
+
}
|
|
18
|
+
return to;
|
|
19
|
+
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
29
|
+
var server_exports = {};
|
|
30
|
+
__export(server_exports, {
|
|
31
|
+
connect: () => connect,
|
|
32
|
+
createServer: () => createServer,
|
|
33
|
+
firstRootPath: () => firstRootPath,
|
|
34
|
+
start: () => start,
|
|
35
|
+
wrapInProcess: () => wrapInProcess
|
|
36
|
+
});
|
|
37
|
+
module.exports = __toCommonJS(server_exports);
|
|
38
|
+
var import_url = require("url");
|
|
39
|
+
var import_utilsBundle = require("playwright-core/lib/utilsBundle");
|
|
40
|
+
var mcpBundle = __toESM(require("./bundle"));
|
|
41
|
+
var import_http = require("./http");
|
|
42
|
+
var import_inProcessTransport = require("./inProcessTransport");
|
|
43
|
+
const serverDebug = (0, import_utilsBundle.debug)("pw:mcp:server");
|
|
44
|
+
const serverDebugResponse = (0, import_utilsBundle.debug)("pw:mcp:server:response");
|
|
45
|
+
async function connect(factory, transport, runHeartbeat) {
|
|
46
|
+
const server = createServer(factory.name, factory.version, factory.create(), runHeartbeat);
|
|
47
|
+
await server.connect(transport);
|
|
48
|
+
}
|
|
49
|
+
async function wrapInProcess(backend) {
|
|
50
|
+
const server = createServer("Internal", "0.0.0", backend, false);
|
|
51
|
+
return new import_inProcessTransport.InProcessTransport(server);
|
|
52
|
+
}
|
|
53
|
+
function createServer(name, version, backend, runHeartbeat) {
|
|
54
|
+
const server = new mcpBundle.Server({ name, version }, {
|
|
55
|
+
capabilities: {
|
|
56
|
+
tools: {}
|
|
57
|
+
}
|
|
58
|
+
});
|
|
59
|
+
server.setRequestHandler(mcpBundle.ListToolsRequestSchema, async () => {
|
|
60
|
+
serverDebug("listTools");
|
|
61
|
+
const tools = await backend.listTools();
|
|
62
|
+
return { tools };
|
|
63
|
+
});
|
|
64
|
+
let initializePromise;
|
|
65
|
+
server.setRequestHandler(mcpBundle.CallToolRequestSchema, async (request, extra) => {
|
|
66
|
+
serverDebug("callTool", request);
|
|
67
|
+
const progressToken = request.params._meta?.progressToken;
|
|
68
|
+
let progressCounter = 0;
|
|
69
|
+
const progress = progressToken ? (params) => {
|
|
70
|
+
extra.sendNotification({
|
|
71
|
+
method: "notifications/progress",
|
|
72
|
+
params: {
|
|
73
|
+
progressToken,
|
|
74
|
+
progress: params.progress ?? ++progressCounter,
|
|
75
|
+
total: params.total,
|
|
76
|
+
message: params.message
|
|
77
|
+
}
|
|
78
|
+
}).catch(serverDebug);
|
|
79
|
+
} : () => {
|
|
80
|
+
};
|
|
81
|
+
try {
|
|
82
|
+
if (!initializePromise)
|
|
83
|
+
initializePromise = initializeServer(server, backend, runHeartbeat);
|
|
84
|
+
await initializePromise;
|
|
85
|
+
const toolResult = await backend.callTool(request.params.name, request.params.arguments || {}, progress);
|
|
86
|
+
const mergedResult = mergeTextParts(toolResult);
|
|
87
|
+
serverDebugResponse("callResult", mergedResult);
|
|
88
|
+
return mergedResult;
|
|
89
|
+
} catch (error) {
|
|
90
|
+
return {
|
|
91
|
+
content: [{ type: "text", text: "### Result\n" + String(error) }],
|
|
92
|
+
isError: true
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
addServerListener(server, "close", () => backend.serverClosed?.(server));
|
|
97
|
+
return server;
|
|
98
|
+
}
|
|
99
|
+
const initializeServer = async (server, backend, runHeartbeat) => {
|
|
100
|
+
const capabilities = server.getClientCapabilities();
|
|
101
|
+
let clientRoots = [];
|
|
102
|
+
if (capabilities?.roots) {
|
|
103
|
+
const { roots } = await server.listRoots().catch((e) => {
|
|
104
|
+
serverDebug(e);
|
|
105
|
+
return { roots: [] };
|
|
106
|
+
});
|
|
107
|
+
clientRoots = roots;
|
|
108
|
+
}
|
|
109
|
+
const clientInfo = {
|
|
110
|
+
name: server.getClientVersion()?.name ?? "unknown",
|
|
111
|
+
version: server.getClientVersion()?.version ?? "unknown",
|
|
112
|
+
roots: clientRoots,
|
|
113
|
+
timestamp: Date.now()
|
|
114
|
+
};
|
|
115
|
+
await backend.initialize?.(clientInfo);
|
|
116
|
+
if (runHeartbeat)
|
|
117
|
+
startHeartbeat(server);
|
|
118
|
+
};
|
|
119
|
+
const startHeartbeat = (server) => {
|
|
120
|
+
const beat = () => {
|
|
121
|
+
Promise.race([
|
|
122
|
+
server.ping(),
|
|
123
|
+
new Promise((_, reject) => setTimeout(() => reject(new Error("ping timeout")), 5e3))
|
|
124
|
+
]).then(() => {
|
|
125
|
+
setTimeout(beat, 3e3);
|
|
126
|
+
}).catch(() => {
|
|
127
|
+
void server.close();
|
|
128
|
+
});
|
|
129
|
+
};
|
|
130
|
+
beat();
|
|
131
|
+
};
|
|
132
|
+
function addServerListener(server, event, listener) {
|
|
133
|
+
const oldListener = server[`on${event}`];
|
|
134
|
+
server[`on${event}`] = () => {
|
|
135
|
+
oldListener?.();
|
|
136
|
+
listener();
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
async function start(serverBackendFactory, options) {
|
|
140
|
+
if (options.port === void 0) {
|
|
141
|
+
await connect(serverBackendFactory, new mcpBundle.StdioServerTransport(), false);
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
const httpServer = await (0, import_http.startHttpServer)(options);
|
|
145
|
+
const url = await (0, import_http.installHttpTransport)(httpServer, serverBackendFactory, false, options.allowedHosts);
|
|
146
|
+
const mcpConfig = { mcpServers: {} };
|
|
147
|
+
mcpConfig.mcpServers[serverBackendFactory.nameInConfig] = {
|
|
148
|
+
url: `${url}/mcp`
|
|
149
|
+
};
|
|
150
|
+
const message = [
|
|
151
|
+
`Listening on ${url}`,
|
|
152
|
+
"Put this in your client config:",
|
|
153
|
+
JSON.stringify(mcpConfig, void 0, 2),
|
|
154
|
+
"For legacy SSE transport support, you can use the /sse endpoint instead."
|
|
155
|
+
].join("\n");
|
|
156
|
+
console.error(message);
|
|
157
|
+
}
|
|
158
|
+
function firstRootPath(clientInfo) {
|
|
159
|
+
if (clientInfo.roots.length === 0)
|
|
160
|
+
return void 0;
|
|
161
|
+
const firstRootUri = clientInfo.roots[0]?.uri;
|
|
162
|
+
const url = firstRootUri ? new URL(firstRootUri) : void 0;
|
|
163
|
+
try {
|
|
164
|
+
return url ? (0, import_url.fileURLToPath)(url) : void 0;
|
|
165
|
+
} catch (error) {
|
|
166
|
+
serverDebug(error);
|
|
167
|
+
return void 0;
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
function mergeTextParts(result) {
|
|
171
|
+
const content = [];
|
|
172
|
+
const testParts = [];
|
|
173
|
+
for (const part of result.content) {
|
|
174
|
+
if (part.type === "text") {
|
|
175
|
+
testParts.push(part.text);
|
|
176
|
+
continue;
|
|
177
|
+
}
|
|
178
|
+
if (testParts.length > 0) {
|
|
179
|
+
content.push({ type: "text", text: testParts.join("\n") });
|
|
180
|
+
testParts.length = 0;
|
|
181
|
+
}
|
|
182
|
+
content.push(part);
|
|
183
|
+
}
|
|
184
|
+
if (testParts.length > 0)
|
|
185
|
+
content.push({ type: "text", text: testParts.join("\n") });
|
|
186
|
+
return {
|
|
187
|
+
...result,
|
|
188
|
+
content
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
192
|
+
0 && (module.exports = {
|
|
193
|
+
connect,
|
|
194
|
+
createServer,
|
|
195
|
+
firstRootPath,
|
|
196
|
+
start,
|
|
197
|
+
wrapInProcess
|
|
198
|
+
});
|