chrome-devtools-mcp 1.11.0 → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -21
- package/{build → out/Default/gen}/src/BrowserManager.js +49 -18
- package/out/Default/gen/src/LogpointManager.js +307 -0
- package/{build → out/Default/gen}/src/McpContext.js +439 -133
- package/{build → out/Default/gen}/src/McpPage.js +368 -59
- package/{build → out/Default/gen}/src/McpResponse.js +90 -47
- package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
- package/{build → out/Default/gen}/src/TextSnapshot.js +37 -18
- package/out/Default/gen/src/ToolHandler.js +512 -0
- package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +6 -4
- package/{build → out/Default/gen}/src/bin/chrome-devtools.js +4 -4
- package/{build → out/Default/gen}/src/collectors/PageCollector.js +28 -12
- package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +2 -2
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigParser.js +162 -0
- package/{build → out/Default/gen}/src/config/ConfigWatcher.js +3 -2
- package/out/Default/gen/src/config/ServerConfig.js +251 -0
- package/{build → out/Default/gen}/src/config/browser-options.js +13 -4
- package/{build → out/Default/gen}/src/config/category-options.js +10 -0
- package/{build → out/Default/gen}/src/config/cli-options.js +223 -22
- package/{build → out/Default/gen}/src/config/mcp-options.js +62 -36
- package/{build → out/Default/gen}/src/config/puppeteer-options.js +4 -2
- package/{build → out/Default/gen}/src/daemon/client.js +3 -3
- package/{build → out/Default/gen}/src/daemon/daemon.js +7 -3
- package/{build → out/Default/gen}/src/daemon/utils.js +2 -1
- package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +28 -5
- package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +94 -20
- package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +28 -1
- package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +14 -18
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +70 -17
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +13 -3
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/index.js +435 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +569 -0
- package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
- package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +796 -712
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +9023 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
- package/out/Default/gen/src/third_party/index.js +201574 -0
- package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
- package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
- package/{build → out/Default/gen}/src/tools/categories.js +4 -0
- package/{build → out/Default/gen}/src/tools/comments.js +46 -4
- package/{build → out/Default/gen}/src/tools/console.js +8 -6
- package/{build → out/Default/gen}/src/tools/css.js +1 -0
- package/{build → out/Default/gen}/src/tools/emulation.js +5 -4
- package/{build → out/Default/gen}/src/tools/extensions.js +6 -1
- package/{build → out/Default/gen}/src/tools/input.js +23 -28
- package/{build → out/Default/gen}/src/tools/lighthouse.js +30 -8
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/{build → out/Default/gen}/src/tools/memory.js +59 -53
- package/out/Default/gen/src/tools/network.js +260 -0
- package/{build → out/Default/gen}/src/tools/pages.js +48 -6
- package/{build → out/Default/gen}/src/tools/performance.js +33 -7
- package/{build → out/Default/gen}/src/tools/pwa.js +7 -0
- package/{build → out/Default/gen}/src/tools/screencast.js +3 -1
- package/{build → out/Default/gen}/src/tools/screenshot.js +23 -7
- package/{build → out/Default/gen}/src/tools/script.js +38 -6
- package/{build → out/Default/gen}/src/tools/slim/tools.js +21 -5
- package/{build → out/Default/gen}/src/tools/snapshot.js +29 -5
- package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +6 -20
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/{build → out/Default/gen}/src/tools/tools.js +4 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/{build → out/Default/gen}/src/tools/webmcp.js +5 -19
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/{build → out/Default/gen}/src/utils/WaitForHelper.js +16 -2
- package/{build → out/Default/gen}/src/utils/bytes.js +2 -12
- package/{build → out/Default/gen}/src/utils/check-for-updates.js +8 -2
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
- package/{build → out/Default/gen}/src/utils/keyboard.js +15 -5
- package/out/Default/gen/src/utils/logger.js +131 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/out/Default/gen/src/utils/resourceType.js +27 -0
- package/out/Default/gen/src/utils/text.js +44 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/{build → out/Default/gen}/src/utils/url.js +73 -17
- package/{build → out/Default/gen}/src/version.js +1 -1
- package/package.json +26 -32
- package/skills/a11y-debugging/SKILL.md +3 -8
- package/skills/chrome-devtools/SKILL.md +2 -0
- package/skills/chrome-devtools-cli/SKILL.md +12 -1
- package/build/src/ToolHandler.js +0 -360
- package/build/src/config/ConfigParser.js +0 -264
- package/build/src/index.js +0 -282
- package/build/src/processors/HeapSnapshotManager.js +0 -307
- package/build/src/third_party/bundled-packages.json +0 -11
- package/build/src/third_party/devtools-formatter-worker.js +0 -16625
- package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12084
- package/build/src/third_party/index.js +0 -189603
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -58435
- package/build/src/tools/ToolDefinition.js +0 -92
- package/build/src/tools/network.js +0 -128
- package/build/src/utils/logger.js +0 -62
- package/build/src/utils/text.js +0 -15
- /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
- /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
- /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
- /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
- /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
- /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
- /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
- /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
- /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
- /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
- /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
- /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
- /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
- /package/{build → out/Default/gen}/src/types.js +0 -0
- /package/{build → out/Default/gen}/src/utils/files.js +0 -0
- /package/{build → out/Default/gen}/src/utils/id.js +0 -0
- /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
- /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
|
@@ -56,9 +56,9 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
56
56
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
57
57
|
});
|
|
58
58
|
import { pathToFileURL } from 'node:url';
|
|
59
|
-
import { zod } from '../third_party/index.js';
|
|
59
|
+
import { zod, } from '../third_party/index.js';
|
|
60
60
|
import { ToolCategory } from './categories.js';
|
|
61
|
-
import { defineTool, pageIdSchema } from './ToolDefinition.js';
|
|
61
|
+
import { defineTool, pageIdSchema, } from './ToolDefinition.js';
|
|
62
62
|
export const evaluateScript = defineTool((cliArgs) => {
|
|
63
63
|
return {
|
|
64
64
|
name: 'evaluate_script',
|
|
@@ -121,10 +121,13 @@ Example with arguments: \`(el) => el.innerText\`
|
|
|
121
121
|
}
|
|
122
122
|
: {}),
|
|
123
123
|
},
|
|
124
|
-
blockedByDialog:
|
|
124
|
+
blockedByDialog: false,
|
|
125
|
+
concurrency: 'exclusive',
|
|
125
126
|
verifyFilesSchema: {
|
|
126
127
|
filePath: true,
|
|
127
|
-
sourcePath:
|
|
128
|
+
// sourcePath may be an http(s): URL the server fetches, so allow URLs
|
|
129
|
+
// through; a file: path or plain path is still validated.
|
|
130
|
+
sourcePath: { local: true, remote: true, allowUrl: true },
|
|
128
131
|
},
|
|
129
132
|
handler: async (request, response, context) => {
|
|
130
133
|
const env_1 = { stack: [], error: void 0, hasError: false };
|
|
@@ -164,7 +167,13 @@ Example with arguments: \`(el) => el.innerText\`
|
|
|
164
167
|
const mcpPage = cliArgs.pageIdRouting && request.params.pageId
|
|
165
168
|
? context.getPageById(request.params.pageId)
|
|
166
169
|
: context.getSelectedMcpPage();
|
|
167
|
-
await mcpPage.init();
|
|
170
|
+
await mcpPage.init({ emulateFocus: true });
|
|
171
|
+
// evaluate_script is not page-scoped, so ToolHandler does not run the
|
|
172
|
+
// blockedByDialog check for it. Without this, an evaluation started
|
|
173
|
+
// while a dialog is open waits until the protocol timeout.
|
|
174
|
+
// TODO: include the "# Open dialog ... Call handle_dialog" hint once
|
|
175
|
+
// Response can attach the page for non-page-scoped tools.
|
|
176
|
+
mcpPage.throwIfDialogOpen();
|
|
168
177
|
const page = mcpPage.pptrPage;
|
|
169
178
|
const args = [];
|
|
170
179
|
const stack = __addDisposableResource(env_1, new DisposableStack(), false);
|
|
@@ -222,8 +231,31 @@ const performEvaluation = async (evaluatable, source, format, args, response, op
|
|
|
222
231
|
try {
|
|
223
232
|
const functionSource = source.trimEnd().replace(/;$/, '');
|
|
224
233
|
const fn = __addDisposableResource(env_2, await evaluatable.evaluateHandle(`(\n${functionSource}\n)`), false);
|
|
234
|
+
// Normalize non-Error values inside the page callback (serialized by Puppeteer) so CDP preserves the message.
|
|
225
235
|
result = await evaluatable.evaluate(async (fn, ...args) => {
|
|
226
|
-
|
|
236
|
+
try {
|
|
237
|
+
return JSON.stringify(await fn(...args));
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
if (err instanceof Error ||
|
|
241
|
+
(typeof err === 'object' &&
|
|
242
|
+
err !== null &&
|
|
243
|
+
'message' in err &&
|
|
244
|
+
typeof err.message === 'string')) {
|
|
245
|
+
throw err;
|
|
246
|
+
}
|
|
247
|
+
let message;
|
|
248
|
+
try {
|
|
249
|
+
message =
|
|
250
|
+
typeof err === 'object' && err !== null
|
|
251
|
+
? JSON.stringify(err)
|
|
252
|
+
: String(err);
|
|
253
|
+
}
|
|
254
|
+
catch {
|
|
255
|
+
message = String(err);
|
|
256
|
+
}
|
|
257
|
+
throw new Error(message);
|
|
258
|
+
}
|
|
227
259
|
}, fn, ...args);
|
|
228
260
|
}
|
|
229
261
|
catch (e_2) {
|
|
@@ -9,24 +9,38 @@ import { definePageTool } from '../ToolDefinition.js';
|
|
|
9
9
|
import { validateUrl } from '../../utils/url.js';
|
|
10
10
|
export const screenshot = definePageTool(() => ({
|
|
11
11
|
name: 'screenshot',
|
|
12
|
-
description: `Takes a screenshot`,
|
|
12
|
+
description: `Takes a png screenshot`,
|
|
13
13
|
annotations: {
|
|
14
14
|
category: ToolCategory.DEBUGGING,
|
|
15
15
|
// Not read-only due to filePath param.
|
|
16
16
|
readOnlyHint: false,
|
|
17
17
|
conditions: ['slim'],
|
|
18
18
|
},
|
|
19
|
-
schema: {
|
|
19
|
+
schema: {
|
|
20
|
+
filePath: zod
|
|
21
|
+
.string()
|
|
22
|
+
.optional()
|
|
23
|
+
.describe('The absolute path, or a path relative to the current working directory, to save the screenshot to instead of attaching it to the response.'),
|
|
24
|
+
},
|
|
20
25
|
blockedByDialog: true,
|
|
21
|
-
|
|
26
|
+
concurrency: 'page',
|
|
27
|
+
verifyFilesSchema: {
|
|
28
|
+
filePath: true,
|
|
29
|
+
},
|
|
22
30
|
handler: async (request, response, context) => {
|
|
23
31
|
const page = request.page;
|
|
24
32
|
const screenshot = await page.pptrPage.screenshot({
|
|
25
33
|
type: 'png',
|
|
26
34
|
optimizeForSpeed: true,
|
|
27
35
|
});
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
if (request.params.filePath) {
|
|
37
|
+
const result = await context.saveFile(screenshot, request.params.filePath, '.png');
|
|
38
|
+
response.appendResponseLine(result.filename);
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
const { filepath } = await context.saveTemporaryFile(screenshot, `screenshot.png`);
|
|
42
|
+
response.appendResponseLine(filepath);
|
|
43
|
+
}
|
|
30
44
|
},
|
|
31
45
|
}));
|
|
32
46
|
export const navigate = definePageTool((args) => {
|
|
@@ -42,6 +56,7 @@ export const navigate = definePageTool((args) => {
|
|
|
42
56
|
url: zod.string().describe('URL to navigate to'),
|
|
43
57
|
},
|
|
44
58
|
blockedByDialog: false,
|
|
59
|
+
concurrency: 'page',
|
|
45
60
|
verifyFilesSchema: {},
|
|
46
61
|
handler: async (request, response) => {
|
|
47
62
|
validateUrl(request.params.url, {
|
|
@@ -84,6 +99,7 @@ export const evaluate = definePageTool(() => ({
|
|
|
84
99
|
script: zod.string().describe(`JS script to run on the page`),
|
|
85
100
|
},
|
|
86
101
|
blockedByDialog: true,
|
|
102
|
+
concurrency: 'page',
|
|
87
103
|
verifyFilesSchema: {},
|
|
88
104
|
handler: async (request, response) => {
|
|
89
105
|
const page = request.page;
|
|
@@ -3,9 +3,9 @@
|
|
|
3
3
|
* Copyright 2025 Google LLC
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
|
-
import { zod } from '../third_party/index.js';
|
|
6
|
+
import { TimeoutError, zod } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
|
-
import { definePageTool, timeoutSchema } from './ToolDefinition.js';
|
|
8
|
+
import { definePageTool, timeoutSchema, } from './ToolDefinition.js';
|
|
9
9
|
export const takeSnapshot = definePageTool(() => ({
|
|
10
10
|
name: 'take_snapshot',
|
|
11
11
|
description: `Take a text snapshot of the target page based on the a11y tree. The snapshot lists page elements along with a unique
|
|
@@ -27,6 +27,7 @@ in the DevTools Elements panel (if any).`,
|
|
|
27
27
|
.describe('The absolute path, or a path relative to the current working directory, to save the snapshot to instead of attaching it to the response.'),
|
|
28
28
|
},
|
|
29
29
|
blockedByDialog: true,
|
|
30
|
+
concurrency: 'page',
|
|
30
31
|
verifyFilesSchema: {
|
|
31
32
|
filePath: true,
|
|
32
33
|
},
|
|
@@ -39,7 +40,7 @@ in the DevTools Elements panel (if any).`,
|
|
|
39
40
|
}));
|
|
40
41
|
export const waitFor = definePageTool(() => ({
|
|
41
42
|
name: 'wait_for',
|
|
42
|
-
description: `Wait for the specified text to appear on the selected page.`,
|
|
43
|
+
description: `Wait for the specified text to appear on the selected page. By default, hidden text is also matched. Set visible to true to wait until the matched text is visible.`,
|
|
43
44
|
annotations: {
|
|
44
45
|
category: ToolCategory.NAVIGATION,
|
|
45
46
|
readOnlyHint: true,
|
|
@@ -48,14 +49,37 @@ export const waitFor = definePageTool(() => ({
|
|
|
48
49
|
text: zod
|
|
49
50
|
.array(zod.string())
|
|
50
51
|
.min(1)
|
|
51
|
-
.describe('Non-empty list of texts. Resolves when any value
|
|
52
|
+
.describe('Non-empty list of texts. Resolves when any value matches an ' +
|
|
53
|
+
'accessible name exactly or is a substring of DOM text. Matching ' +
|
|
54
|
+
'is case-sensitive. DOM text preserves spaces and newlines, unlike ' +
|
|
55
|
+
'snapshot text which may normalize whitespace. Use the original ' +
|
|
56
|
+
'whitespace or a shorter distinctive substring.'),
|
|
52
57
|
...timeoutSchema,
|
|
58
|
+
visible: zod
|
|
59
|
+
.boolean()
|
|
60
|
+
.default(false)
|
|
61
|
+
.optional()
|
|
62
|
+
.describe('If true, wait until the matching text is visible. By default, hidden text also counts.'),
|
|
53
63
|
},
|
|
54
64
|
blockedByDialog: true,
|
|
65
|
+
concurrency: 'page',
|
|
55
66
|
verifyFilesSchema: {},
|
|
56
67
|
handler: async (request, response) => {
|
|
57
68
|
const page = request.page;
|
|
58
|
-
|
|
69
|
+
try {
|
|
70
|
+
await page.waitForTextOnPage(request.params.text, {
|
|
71
|
+
timeout: request.params.timeout,
|
|
72
|
+
visible: request.params.visible,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
if (error instanceof TimeoutError) {
|
|
77
|
+
throw new TimeoutError(`${error.message}. Text matching is case-sensitive. DOM text must ` +
|
|
78
|
+
'preserve spaces and newlines, whereas snapshot text may ' +
|
|
79
|
+
'normalize whitespace. Try a shorter distinctive substring.', { cause: error });
|
|
80
|
+
}
|
|
81
|
+
throw error;
|
|
82
|
+
}
|
|
59
83
|
response.appendResponseLine(`Element matching one of ${JSON.stringify(request.params.text)} found.`);
|
|
60
84
|
response.includeSnapshot();
|
|
61
85
|
},
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { zod, ajv } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
|
-
import { definePageTool } from './ToolDefinition.js';
|
|
8
|
+
import { definePageTool, jsonObjectTransform, zodTransform, } from './ToolDefinition.js';
|
|
9
9
|
export const listThirdPartyDeveloperTools = definePageTool(() => ({
|
|
10
10
|
name: 'list_3p_developer_tools',
|
|
11
11
|
description: `Lists all third-party developer tools the page exposes for providing runtime information (including debugging WebMCP tools and tools exposed via the 'devtoolstooldiscovery' event).
|
|
@@ -21,6 +21,7 @@ third-party developer tools with additional functionality.`,
|
|
|
21
21
|
},
|
|
22
22
|
schema: {},
|
|
23
23
|
blockedByDialog: false,
|
|
24
|
+
concurrency: 'page',
|
|
24
25
|
verifyFilesSchema: {},
|
|
25
26
|
handler: async (_request, response) => {
|
|
26
27
|
response.setListThirdPartyDeveloperTools();
|
|
@@ -37,32 +38,17 @@ export const executeThirdPartyDeveloperTool = definePageTool(() => ({
|
|
|
37
38
|
toolName: zod.string().describe('The name of the tool to execute'),
|
|
38
39
|
params: zod
|
|
39
40
|
.string()
|
|
41
|
+
.transform(zodTransform(jsonObjectTransform))
|
|
40
42
|
.optional()
|
|
41
43
|
.describe('The JSON-stringified parameters to pass to the tool'),
|
|
42
44
|
},
|
|
43
45
|
blockedByDialog: false,
|
|
46
|
+
concurrency: 'page',
|
|
44
47
|
verifyFilesSchema: {},
|
|
45
48
|
handler: async (request, response) => {
|
|
46
49
|
const toolName = request.params.toolName;
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
try {
|
|
50
|
-
const parsed = JSON.parse(request.params.params);
|
|
51
|
-
if (typeof parsed === 'object' &&
|
|
52
|
-
parsed !== null &&
|
|
53
|
-
!Array.isArray(parsed)) {
|
|
54
|
-
params = parsed;
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
throw new Error('Parsed params is not an object');
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
catch (e) {
|
|
61
|
-
const errorMessage = e instanceof Error ? e.message : String(e);
|
|
62
|
-
throw new Error(`Failed to parse params as JSON: ${errorMessage}`);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
const toolGroups = request.page.getThirdPartyDeveloperTools();
|
|
50
|
+
const params = request.params.params ?? {};
|
|
51
|
+
const toolGroups = await request.page.discoverThirdPartyDeveloperTools();
|
|
66
52
|
let tool;
|
|
67
53
|
if (toolGroups) {
|
|
68
54
|
for (const group of toolGroups) {
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
// Tool names referenced from other tools' descriptions. Kept out of the tool
|
|
7
|
+
// modules because `createTools()` instantiates every export of those.
|
|
8
|
+
export const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
|
|
9
|
+
export const GET_CONSOLE_MESSAGE_TOOL_NAME = 'get_console_message';
|
|
10
|
+
//# sourceMappingURL=toolNames.js.map
|
|
@@ -11,6 +11,7 @@ import * as emulationTools from './emulation.js';
|
|
|
11
11
|
import * as extensionTools from './extensions.js';
|
|
12
12
|
import * as inputTools from './input.js';
|
|
13
13
|
import * as lighthouseTools from './lighthouse.js';
|
|
14
|
+
import * as logpointTools from './logpoints.js';
|
|
14
15
|
import * as memoryTools from './memory.js';
|
|
15
16
|
import * as networkTools from './network.js';
|
|
16
17
|
import * as pagesTools from './pages.js';
|
|
@@ -22,6 +23,7 @@ import * as scriptTools from './script.js';
|
|
|
22
23
|
import * as slimTools from './slim/tools.js';
|
|
23
24
|
import * as snapshotTools from './snapshot.js';
|
|
24
25
|
import * as thirdPartyDeveloperTools from './thirdPartyDeveloper.js';
|
|
26
|
+
import * as webauthnTools from './webauthn.js';
|
|
25
27
|
import * as webmcpTools from './webmcp.js';
|
|
26
28
|
export const createTools = (args) => {
|
|
27
29
|
const rawTools = [
|
|
@@ -32,6 +34,7 @@ export const createTools = (args) => {
|
|
|
32
34
|
...Object.values(extensionTools),
|
|
33
35
|
...Object.values(inputTools),
|
|
34
36
|
...Object.values(lighthouseTools),
|
|
37
|
+
...Object.values(logpointTools),
|
|
35
38
|
...Object.values(memoryTools),
|
|
36
39
|
...Object.values(networkTools),
|
|
37
40
|
...Object.values(pagesTools),
|
|
@@ -43,6 +46,7 @@ export const createTools = (args) => {
|
|
|
43
46
|
...Object.values(slimTools),
|
|
44
47
|
...Object.values(snapshotTools),
|
|
45
48
|
...Object.values(thirdPartyDeveloperTools),
|
|
49
|
+
...Object.values(webauthnTools),
|
|
46
50
|
...Object.values(webmcpTools),
|
|
47
51
|
];
|
|
48
52
|
const tools = [];
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { zod } from '../third_party/index.js';
|
|
7
|
+
import { ToolCategory } from './categories.js';
|
|
8
|
+
import { definePageTool } from './ToolDefinition.js';
|
|
9
|
+
export const configureWebAuthn = definePageTool(() => ({
|
|
10
|
+
name: 'configure_webauthn',
|
|
11
|
+
description: 'Adds a virtual WebAuthn authenticator to the page. Call this before the page calls navigator.credentials. ' +
|
|
12
|
+
'It answers navigator.credentials.create() and get() and is removed when the page closes. ' +
|
|
13
|
+
'Omitted parameters keep their current values. Changing protocol, transport, hasResidentKey or hasUserVerification replaces the authenticator and deletes its credentials. ' +
|
|
14
|
+
'enabled=false ignores other parameters and removes all authenticators on the page.',
|
|
15
|
+
annotations: {
|
|
16
|
+
category: ToolCategory.WEBAUTHN,
|
|
17
|
+
readOnlyHint: false,
|
|
18
|
+
},
|
|
19
|
+
schema: {
|
|
20
|
+
enabled: zod
|
|
21
|
+
.boolean()
|
|
22
|
+
.describe('Set to false to remove all virtual authenticators from the page.'),
|
|
23
|
+
protocol: zod
|
|
24
|
+
.enum(['ctap2', 'u2f'])
|
|
25
|
+
.optional()
|
|
26
|
+
.describe('The authenticator protocol. Default: ctap2.'),
|
|
27
|
+
transport: zod
|
|
28
|
+
.enum(['internal', 'usb', 'nfc', 'ble', 'hybrid'])
|
|
29
|
+
.optional()
|
|
30
|
+
.describe('"internal" is a platform authenticator such as Touch ID or Windows Hello; the others are roaming security keys. Default: internal.'),
|
|
31
|
+
hasResidentKey: zod
|
|
32
|
+
.boolean()
|
|
33
|
+
.optional()
|
|
34
|
+
.describe('Whether the authenticator can store discoverable credentials (passkeys). Default: true. u2f does not support it, so it is false for u2f.'),
|
|
35
|
+
hasUserVerification: zod
|
|
36
|
+
.boolean()
|
|
37
|
+
.optional()
|
|
38
|
+
.describe('Whether the authenticator supports user verification (PIN or biometrics). Default: true. u2f does not support it, so it is false for u2f.'),
|
|
39
|
+
isUserVerified: zod
|
|
40
|
+
.boolean()
|
|
41
|
+
.optional()
|
|
42
|
+
.describe('Whether user verification succeeds. Set to false to test a failed verification. Default: true.'),
|
|
43
|
+
},
|
|
44
|
+
blockedByDialog: false,
|
|
45
|
+
concurrency: 'page',
|
|
46
|
+
verifyFilesSchema: {},
|
|
47
|
+
handler: async (request, response) => {
|
|
48
|
+
response.attachWebAuthnAuthenticator(await request.page.configureWebAuthn(request.params));
|
|
49
|
+
},
|
|
50
|
+
}));
|
|
51
|
+
//# sourceMappingURL=webauthn.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
|
-
import { definePageTool } from './ToolDefinition.js';
|
|
8
|
+
import { definePageTool, jsonObjectTransform, zodTransform, } from './ToolDefinition.js';
|
|
9
9
|
export const listWebMcpTools = definePageTool(() => ({
|
|
10
10
|
name: 'list_webmcp_tools',
|
|
11
11
|
description: `Lists all WebMCP tools the page exposes (excluding debugging tools, which are exposed via 'list_3p_developer_tools').`,
|
|
@@ -15,6 +15,7 @@ export const listWebMcpTools = definePageTool(() => ({
|
|
|
15
15
|
},
|
|
16
16
|
schema: {},
|
|
17
17
|
blockedByDialog: false,
|
|
18
|
+
concurrency: 'page',
|
|
18
19
|
verifyFilesSchema: {},
|
|
19
20
|
handler: async (_request, response) => {
|
|
20
21
|
response.setListWebMcpTools();
|
|
@@ -31,31 +32,16 @@ export const executeWebMcpTool = definePageTool(() => ({
|
|
|
31
32
|
toolName: zod.string().describe('The name of the WebMCP tool to execute'),
|
|
32
33
|
input: zod
|
|
33
34
|
.string()
|
|
35
|
+
.transform(zodTransform(jsonObjectTransform))
|
|
34
36
|
.optional()
|
|
35
37
|
.describe('The JSON-stringified parameters to pass to the WebMCP tool'),
|
|
36
38
|
},
|
|
37
39
|
blockedByDialog: false,
|
|
40
|
+
concurrency: 'page',
|
|
38
41
|
verifyFilesSchema: {},
|
|
39
42
|
handler: async (request, response) => {
|
|
40
43
|
const toolName = request.params.toolName;
|
|
41
|
-
|
|
42
|
-
if (request.params.input) {
|
|
43
|
-
try {
|
|
44
|
-
const parsed = JSON.parse(request.params.input);
|
|
45
|
-
if (typeof parsed === 'object' &&
|
|
46
|
-
parsed !== null &&
|
|
47
|
-
!Array.isArray(parsed)) {
|
|
48
|
-
input = parsed;
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
throw new Error('Parsed input is not an object');
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
catch (e) {
|
|
55
|
-
const errorMessage = e instanceof Error ? e.message : String(e);
|
|
56
|
-
throw new Error(`Failed to parse input as JSON: ${errorMessage}`);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
44
|
+
const input = request.params.input ?? {};
|
|
59
45
|
const tools = request.page.getWebMcpTools();
|
|
60
46
|
const tool = tools.find(t => t.name === toolName);
|
|
61
47
|
if (!tool) {
|
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* A queue that the {@link TaskRunner} created. Tasks on one queue run one
|
|
8
|
+
* at a time. Tasks on a queue and on its ancestors or descendants also run
|
|
9
|
+
* one at a time. Tasks on unrelated queues run at the same time.
|
|
10
|
+
*/
|
|
11
|
+
export class TaskQueue {
|
|
12
|
+
parent;
|
|
13
|
+
#hooks;
|
|
14
|
+
#disposed;
|
|
15
|
+
constructor(hooks, parent) {
|
|
16
|
+
this.#hooks = hooks;
|
|
17
|
+
this.parent = parent;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Schedules a task on this queue. Resolves when no earlier task on a
|
|
21
|
+
* related queue runs, with a guard that holds the queue until it is
|
|
22
|
+
* disposed. Rejects when the queue is disposed while the task waits. A
|
|
23
|
+
* second dispose of the guard throws. Cancellation rejects a waiting task
|
|
24
|
+
* with the signal's reason; after acquisition, the caller owns the guard.
|
|
25
|
+
*/
|
|
26
|
+
async scheduleTask(signal) {
|
|
27
|
+
if (this.#disposed) {
|
|
28
|
+
throw this.#disposed;
|
|
29
|
+
}
|
|
30
|
+
return await this.#hooks.scheduleTask(this, signal);
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Rejects the callers that wait on this queue with `reason`, and rejects
|
|
34
|
+
* every later `scheduleTask()` call. The current holder keeps the queue.
|
|
35
|
+
*/
|
|
36
|
+
dispose(reason) {
|
|
37
|
+
this.#disposed = reason;
|
|
38
|
+
this.#hooks.cancel(this, reason);
|
|
39
|
+
}
|
|
40
|
+
/** True when `other` is this queue, an ancestor, or a descendant. */
|
|
41
|
+
isRelatedTo(other) {
|
|
42
|
+
return this.#isAncestorOrSelf(other) || other.#isAncestorOrSelf(this);
|
|
43
|
+
}
|
|
44
|
+
#isAncestorOrSelf(other) {
|
|
45
|
+
for (let queue = other; queue; queue = queue.parent) {
|
|
46
|
+
if (queue === this) {
|
|
47
|
+
return true;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return false;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Runs every task of the server from one ordered list. Each task names the
|
|
55
|
+
* queue it runs on. A task starts when every earlier task on a related queue
|
|
56
|
+
* has finished. Waiting tasks count, so a waiting task blocks later related
|
|
57
|
+
* tasks and no task starves. `pause()` enters the list ahead of waiting tasks
|
|
58
|
+
* and relates to every queue.
|
|
59
|
+
*/
|
|
60
|
+
export class TaskRunner {
|
|
61
|
+
#hooks = {
|
|
62
|
+
scheduleTask: (queue, signal) => this.#scheduleTask(queue, 'normal', signal),
|
|
63
|
+
cancel: (queue, reason) => this.#cancel(queue, reason),
|
|
64
|
+
};
|
|
65
|
+
#root = new TaskQueue(this.#hooks, undefined);
|
|
66
|
+
#entries = [];
|
|
67
|
+
/**
|
|
68
|
+
* Creates a queue. Tasks on the new queue and tasks on `parent` wait for
|
|
69
|
+
* each other. Without `parent`, the queue is a child of the root, so only
|
|
70
|
+
* `pause()` relates to it.
|
|
71
|
+
*/
|
|
72
|
+
createQueue(parent = this.#root) {
|
|
73
|
+
return new TaskQueue(this.#hooks, parent);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Stops new tasks on every queue. The pause goes ahead of waiting tasks and
|
|
77
|
+
* resolves when every running task has finished. Disposing the guard
|
|
78
|
+
* resumes the runner.
|
|
79
|
+
*/
|
|
80
|
+
async pause() {
|
|
81
|
+
return await this.#scheduleTask(this.#root, 'high');
|
|
82
|
+
}
|
|
83
|
+
async #scheduleTask(queue, priority = 'normal', signal) {
|
|
84
|
+
signal?.throwIfAborted();
|
|
85
|
+
const { entry, started } = this.#enter(queue, priority);
|
|
86
|
+
const onAbort = () => {
|
|
87
|
+
this.#cancelEntry(entry, signal?.reason);
|
|
88
|
+
};
|
|
89
|
+
signal?.addEventListener('abort', onAbort, { once: true });
|
|
90
|
+
try {
|
|
91
|
+
await started;
|
|
92
|
+
return {
|
|
93
|
+
[Symbol.dispose]: () => this.#leave(entry),
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
finally {
|
|
97
|
+
signal?.removeEventListener('abort', onAbort);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
#cancel(queue, reason) {
|
|
101
|
+
for (const entry of [...this.#entries]) {
|
|
102
|
+
if (entry.queue === queue) {
|
|
103
|
+
this.#cancelEntry(entry, reason);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
#cancelEntry(entry, reason) {
|
|
108
|
+
if (entry.running || !this.#entries.includes(entry)) {
|
|
109
|
+
return;
|
|
110
|
+
}
|
|
111
|
+
this.#leave(entry);
|
|
112
|
+
entry.reject(reason);
|
|
113
|
+
}
|
|
114
|
+
#enter(queue, priority) {
|
|
115
|
+
const { promise, resolve, reject } = Promise.withResolvers();
|
|
116
|
+
const entry = { queue, priority, running: false, resolve, reject };
|
|
117
|
+
// A high-priority entry goes before the first waiting normal entry.
|
|
118
|
+
const index = priority === 'high'
|
|
119
|
+
? this.#entries.findIndex(e => !e.running && e.priority === 'normal')
|
|
120
|
+
: -1;
|
|
121
|
+
this.#entries.splice(index === -1 ? this.#entries.length : index, 0, entry);
|
|
122
|
+
this.#schedule();
|
|
123
|
+
return {
|
|
124
|
+
started: promise,
|
|
125
|
+
entry,
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
#leave(entry) {
|
|
129
|
+
const index = this.#entries.indexOf(entry);
|
|
130
|
+
if (index === -1) {
|
|
131
|
+
throw new Error('The guard was already disposed.');
|
|
132
|
+
}
|
|
133
|
+
this.#entries.splice(index, 1);
|
|
134
|
+
this.#schedule();
|
|
135
|
+
}
|
|
136
|
+
#schedule() {
|
|
137
|
+
for (const [index, entry] of this.#entries.entries()) {
|
|
138
|
+
if (entry.running) {
|
|
139
|
+
continue;
|
|
140
|
+
}
|
|
141
|
+
const blocked = this.#entries
|
|
142
|
+
.slice(0, index)
|
|
143
|
+
.some(earlier => earlier.queue.isRelatedTo(entry.queue));
|
|
144
|
+
if (!blocked) {
|
|
145
|
+
entry.running = true;
|
|
146
|
+
entry.resolve();
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
//# sourceMappingURL=TaskRunner.js.map
|
|
@@ -68,6 +68,7 @@ export class WaitForHelper {
|
|
|
68
68
|
/** Track all dialogs as they pause the renderer. */
|
|
69
69
|
#dialogDetected = false;
|
|
70
70
|
#initialUrl;
|
|
71
|
+
#loadedNewDocument = false;
|
|
71
72
|
#openedPages = new Set();
|
|
72
73
|
constructor(page, cpuTimeoutMultiplier, networkTimeoutMultiplier) {
|
|
73
74
|
this.#stableDomTimeout = 3000 * cpuTimeoutMultiplier;
|
|
@@ -88,7 +89,7 @@ export class WaitForHelper {
|
|
|
88
89
|
try {
|
|
89
90
|
// Bound the setup evaluation against the stable-DOM timeout. Without this
|
|
90
91
|
// cap a paused renderer (e.g. an open dialog) would make evaluateHandle
|
|
91
|
-
// hang until protocolTimeout (default 180s)
|
|
92
|
+
// hang until protocolTimeout (default 180s) inside the context queue.
|
|
92
93
|
const stableDomObserver = __addDisposableResource(env_1, await Promise.race([
|
|
93
94
|
this.#page.evaluateHandle(timeout => {
|
|
94
95
|
let timeoutId;
|
|
@@ -200,6 +201,19 @@ export class WaitForHelper {
|
|
|
200
201
|
this.#abortController.signal.addEventListener('abort', () => {
|
|
201
202
|
this.#publicPage.off('popup', popupHandler);
|
|
202
203
|
});
|
|
204
|
+
// CDP reports each new document the main frame commits, a reload or a
|
|
205
|
+
// back/forward cache restore included, with `Page.frameNavigated`, while
|
|
206
|
+
// a same-document navigation comes as `Page.navigatedWithinDocument`.
|
|
207
|
+
const frameNavigatedHandler = (event) => {
|
|
208
|
+
if (!event.frame.parentId) {
|
|
209
|
+
this.#loadedNewDocument = true;
|
|
210
|
+
}
|
|
211
|
+
};
|
|
212
|
+
const client = this.#page._client();
|
|
213
|
+
client.on('Page.frameNavigated', frameNavigatedHandler);
|
|
214
|
+
this.#abortController.signal.addEventListener('abort', () => {
|
|
215
|
+
client.off('Page.frameNavigated', frameNavigatedHandler);
|
|
216
|
+
});
|
|
203
217
|
// A scoped AbortController used to clean up navigation probe listeners.
|
|
204
218
|
// When aborted (either after navigation detection finishes or if this.#abortController
|
|
205
219
|
// aborts), it removes CDP navigation probe listeners and automatically
|
|
@@ -304,7 +318,7 @@ export class WaitForHelper {
|
|
|
304
318
|
#getResult() {
|
|
305
319
|
const urlAfterAction = this.#page.url();
|
|
306
320
|
return {
|
|
307
|
-
...(urlAfterAction !== this.#initialUrl
|
|
321
|
+
...(urlAfterAction !== this.#initialUrl || this.#loadedNewDocument
|
|
308
322
|
? { navigatedToUrl: urlAfterAction }
|
|
309
323
|
: {}),
|
|
310
324
|
dialogHandled: this.#dialogHandled,
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
|
+
import { zodTransform } from '../tools/ToolDefinition.js';
|
|
7
8
|
const BYTE_UNITS = {
|
|
8
9
|
b: 1,
|
|
9
10
|
byte: 1,
|
|
@@ -88,18 +89,7 @@ export function parseByteSizeRange(value) {
|
|
|
88
89
|
export function byteSizeRangeSchema(description) {
|
|
89
90
|
return zod
|
|
90
91
|
.string()
|
|
91
|
-
.transform((
|
|
92
|
-
try {
|
|
93
|
-
return parseByteSizeRange(value);
|
|
94
|
-
}
|
|
95
|
-
catch (error) {
|
|
96
|
-
context.addIssue({
|
|
97
|
-
code: zod.ZodIssueCode.custom,
|
|
98
|
-
message: error instanceof Error ? error.message : 'Invalid byte size range',
|
|
99
|
-
});
|
|
100
|
-
return zod.NEVER;
|
|
101
|
-
}
|
|
102
|
-
})
|
|
92
|
+
.transform(zodTransform(parseByteSizeRange))
|
|
103
93
|
.describe(description);
|
|
104
94
|
}
|
|
105
95
|
//# sourceMappingURL=bytes.js.map
|
|
@@ -8,7 +8,7 @@ import fs from 'node:fs/promises';
|
|
|
8
8
|
import os from 'node:os';
|
|
9
9
|
import path from 'node:path';
|
|
10
10
|
import process from 'node:process';
|
|
11
|
-
import { semver } from '../third_party/
|
|
11
|
+
import { semver } from '../third_party/cli.js';
|
|
12
12
|
import { VERSION } from '../version.js';
|
|
13
13
|
/**
|
|
14
14
|
* Notifies the user if an update is available.
|
|
@@ -30,7 +30,13 @@ export async function checkForUpdates(message) {
|
|
|
30
30
|
try {
|
|
31
31
|
stats = await fs.stat(cachePath);
|
|
32
32
|
const data = await fs.readFile(cachePath, 'utf8');
|
|
33
|
-
|
|
33
|
+
const version = JSON.parse(data).version;
|
|
34
|
+
// A cache entry that is not a valid version would make `semver.lt` throw
|
|
35
|
+
// before the refresh below runs, so every start would fail on the same
|
|
36
|
+
// file. Ignore such an entry and let the refresh replace it.
|
|
37
|
+
if (typeof version === 'string' && semver.valid(version)) {
|
|
38
|
+
cachedVersion = version;
|
|
39
|
+
}
|
|
34
40
|
}
|
|
35
41
|
catch {
|
|
36
42
|
// Ignore errors reading cache.
|