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
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { categoryToFlagName } from '../config/category-options.js';
|
|
7
|
+
import { zod, } from '../third_party/index.js';
|
|
8
|
+
export function defineTool(definition) {
|
|
9
|
+
return definition;
|
|
10
|
+
}
|
|
11
|
+
export function definePageTool(definition) {
|
|
12
|
+
return (args) => {
|
|
13
|
+
const tool = definition(args);
|
|
14
|
+
return {
|
|
15
|
+
...tool,
|
|
16
|
+
schema: {
|
|
17
|
+
...(args.pageIdRouting && !isSlimTool(tool) ? pageIdSchema : {}),
|
|
18
|
+
...tool.schema,
|
|
19
|
+
},
|
|
20
|
+
pageScoped: true,
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Defines a tool that does not need a browser connection, e.g. a tool that only
|
|
26
|
+
* analyzes local files. Its handler only receives a {@link BrowserlessContext}.
|
|
27
|
+
* Such a tool runs without the context queue (`concurrency: 'none'`) unless
|
|
28
|
+
* the definition sets another value.
|
|
29
|
+
*/
|
|
30
|
+
export function defineBrowserlessTool(definition) {
|
|
31
|
+
return (args) => {
|
|
32
|
+
return {
|
|
33
|
+
concurrency: 'none',
|
|
34
|
+
...definition(args),
|
|
35
|
+
browserless: true,
|
|
36
|
+
};
|
|
37
|
+
};
|
|
38
|
+
}
|
|
39
|
+
export function isPageScopedTool(tool) {
|
|
40
|
+
return 'pageScoped' in tool && tool.pageScoped === true;
|
|
41
|
+
}
|
|
42
|
+
export function isBrowserlessTool(tool) {
|
|
43
|
+
return 'browserless' in tool && tool.browserless === true;
|
|
44
|
+
}
|
|
45
|
+
export const CLOSE_PAGE_ERROR = 'The last open page cannot be closed. It is fine to keep it open.';
|
|
46
|
+
export const pageIdSchema = {
|
|
47
|
+
pageId: zod.number().describe('Targets a specific page by ID.'),
|
|
48
|
+
};
|
|
49
|
+
export function zodTransform(transform) {
|
|
50
|
+
return (arg, ctx) => {
|
|
51
|
+
try {
|
|
52
|
+
return transform(arg);
|
|
53
|
+
}
|
|
54
|
+
catch (error) {
|
|
55
|
+
if (error instanceof zod.ZodError) {
|
|
56
|
+
for (const issue of error.issues) {
|
|
57
|
+
ctx.addIssue({
|
|
58
|
+
code: 'custom',
|
|
59
|
+
message: issue.message,
|
|
60
|
+
path: issue.path,
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
ctx.addIssue({
|
|
66
|
+
code: 'custom',
|
|
67
|
+
message: error instanceof Error ? error.message : String(error),
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return zod.NEVER;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
}
|
|
74
|
+
export const timeoutSchema = {
|
|
75
|
+
timeout: zod
|
|
76
|
+
.number()
|
|
77
|
+
.int()
|
|
78
|
+
.transform(value => {
|
|
79
|
+
return value <= 0 ? undefined : value;
|
|
80
|
+
})
|
|
81
|
+
.optional()
|
|
82
|
+
.describe(`Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`),
|
|
83
|
+
};
|
|
84
|
+
const integerStringSchema = zod
|
|
85
|
+
.string()
|
|
86
|
+
.regex(/^[+-]?\d+$/, 'Expected an integer')
|
|
87
|
+
.pipe(zod.coerce.number());
|
|
88
|
+
const decimalStringSchema = zod
|
|
89
|
+
.string()
|
|
90
|
+
.regex(/^[+-]?\d+(\.\d+)?$/, 'Expected a number')
|
|
91
|
+
.pipe(zod.coerce.number());
|
|
92
|
+
/* eslint-disable @local/enforce-zod-schema */
|
|
93
|
+
const geolocationSchema = zod.object({
|
|
94
|
+
latitude: decimalStringSchema.pipe(zod.number().min(-90).max(90)),
|
|
95
|
+
longitude: decimalStringSchema.pipe(zod.number().min(-180).max(180)),
|
|
96
|
+
});
|
|
97
|
+
const VIEWPORT_FORMAT = '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]';
|
|
98
|
+
const viewportTagSchema = zod.enum(['mobile', 'touch', 'landscape'], {
|
|
99
|
+
error: issue => `Invalid viewport option "${String(issue.input)}". Expected "mobile", "touch", or "landscape" in '${VIEWPORT_FORMAT}'.`,
|
|
100
|
+
});
|
|
101
|
+
// CDP's Emulation.setDeviceMetricsOverride takes integer width and height.
|
|
102
|
+
const viewportSchema = zod.object({
|
|
103
|
+
width: integerStringSchema.pipe(zod.number().int().positive()),
|
|
104
|
+
height: integerStringSchema.pipe(zod.number().int().positive()),
|
|
105
|
+
deviceScaleFactor: decimalStringSchema
|
|
106
|
+
.pipe(zod.number().positive())
|
|
107
|
+
.optional(),
|
|
108
|
+
isMobile: zod.boolean().optional(),
|
|
109
|
+
isLandscape: zod.boolean().optional(),
|
|
110
|
+
hasTouch: zod.boolean().optional(),
|
|
111
|
+
});
|
|
112
|
+
/* eslint-enable @local/enforce-zod-schema */
|
|
113
|
+
export function viewportTransform(arg) {
|
|
114
|
+
if (!arg) {
|
|
115
|
+
return undefined;
|
|
116
|
+
}
|
|
117
|
+
const [dimensions, ...tags] = arg.split(',');
|
|
118
|
+
for (const tag of tags) {
|
|
119
|
+
viewportTagSchema.parse(tag);
|
|
120
|
+
}
|
|
121
|
+
const dimParts = dimensions.split('x');
|
|
122
|
+
if (dimParts.length !== 2 && dimParts.length !== 3) {
|
|
123
|
+
throw new Error(`Invalid viewport dimensions "${dimensions}". Expected format '${VIEWPORT_FORMAT}'.`);
|
|
124
|
+
}
|
|
125
|
+
return viewportSchema.parse({
|
|
126
|
+
width: dimParts[0],
|
|
127
|
+
height: dimParts[1],
|
|
128
|
+
deviceScaleFactor: dimParts[2],
|
|
129
|
+
isMobile: tags.includes('mobile'),
|
|
130
|
+
isLandscape: tags.includes('landscape'),
|
|
131
|
+
hasTouch: tags.includes('touch'),
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
export function geolocationTransform(arg) {
|
|
135
|
+
if (!arg) {
|
|
136
|
+
return undefined;
|
|
137
|
+
}
|
|
138
|
+
const parts = arg.split(',');
|
|
139
|
+
if (parts.length !== 2) {
|
|
140
|
+
throw new Error(`Invalid geolocation "${arg}". Expected '<latitude>,<longitude>'.`);
|
|
141
|
+
}
|
|
142
|
+
return geolocationSchema.parse({
|
|
143
|
+
latitude: parts[0],
|
|
144
|
+
longitude: parts[1],
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
const jsonObjectSchema = zod.record(zod.string(), zod.unknown());
|
|
148
|
+
export function jsonObjectTransform(arg) {
|
|
149
|
+
if (!arg) {
|
|
150
|
+
return undefined;
|
|
151
|
+
}
|
|
152
|
+
return jsonObjectSchema.parse(JSON.parse(arg));
|
|
153
|
+
}
|
|
154
|
+
export function isSlimTool(tool) {
|
|
155
|
+
return Boolean(tool.annotations.conditions?.includes('slim'));
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* Slim mode replaces the regular tools with the slim tools.
|
|
159
|
+
*/
|
|
160
|
+
export function isAvailableInMode(tool, serverArgs) {
|
|
161
|
+
return isSlimTool(tool) === Boolean(serverArgs.slim);
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Returns whether a capability gate is enabled under the given arguments.
|
|
165
|
+
*/
|
|
166
|
+
export function isCapabilityEnabled(gate, serverArgs) {
|
|
167
|
+
if (Boolean(gate.conditions?.includes('slim')) !== Boolean(serverArgs.slim)) {
|
|
168
|
+
return false;
|
|
169
|
+
}
|
|
170
|
+
if (gate.category && !serverArgs[categoryToFlagName(gate.category)]) {
|
|
171
|
+
return false;
|
|
172
|
+
}
|
|
173
|
+
for (const condition of gate.conditions ?? []) {
|
|
174
|
+
if (!serverArgs[condition]) {
|
|
175
|
+
return false;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
return true;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=ToolDefinition.js.map
|
|
@@ -10,12 +10,14 @@ export var ToolCategory;
|
|
|
10
10
|
ToolCategory["EMULATION"] = "emulation";
|
|
11
11
|
ToolCategory["PERFORMANCE"] = "performance";
|
|
12
12
|
ToolCategory["NETWORK"] = "network";
|
|
13
|
+
ToolCategory["NETWORK_MOCKS"] = "networkMocks";
|
|
13
14
|
ToolCategory["DEBUGGING"] = "debugging";
|
|
14
15
|
ToolCategory["EXTENSIONS"] = "extensions";
|
|
15
16
|
ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
|
|
16
17
|
ToolCategory["MEMORY"] = "memory";
|
|
17
18
|
ToolCategory["WEBMCP"] = "experimentalWebmcp";
|
|
18
19
|
ToolCategory["PWA"] = "pwa";
|
|
20
|
+
ToolCategory["WEBAUTHN"] = "webauthn";
|
|
19
21
|
})(ToolCategory || (ToolCategory = {}));
|
|
20
22
|
export const labels = {
|
|
21
23
|
[ToolCategory.INPUT]: 'Input automation',
|
|
@@ -23,11 +25,13 @@ export const labels = {
|
|
|
23
25
|
[ToolCategory.EMULATION]: 'Emulation',
|
|
24
26
|
[ToolCategory.PERFORMANCE]: 'Performance',
|
|
25
27
|
[ToolCategory.NETWORK]: 'Network',
|
|
28
|
+
[ToolCategory.NETWORK_MOCKS]: 'Network mocks',
|
|
26
29
|
[ToolCategory.DEBUGGING]: 'Debugging',
|
|
27
30
|
[ToolCategory.EXTENSIONS]: 'Extensions',
|
|
28
31
|
[ToolCategory.THIRD_PARTY]: 'Third-party',
|
|
29
32
|
[ToolCategory.MEMORY]: 'Memory',
|
|
30
33
|
[ToolCategory.WEBMCP]: 'WebMCP',
|
|
31
34
|
[ToolCategory.PWA]: 'Progressive Web Apps',
|
|
35
|
+
[ToolCategory.WEBAUTHN]: 'WebAuthn',
|
|
32
36
|
};
|
|
33
37
|
//# sourceMappingURL=categories.js.map
|
|
@@ -17,11 +17,15 @@ export const openDevtools = definePageTool(() => ({
|
|
|
17
17
|
},
|
|
18
18
|
schema: {},
|
|
19
19
|
blockedByDialog: false,
|
|
20
|
+
concurrency: 'exclusive',
|
|
20
21
|
verifyFilesSchema: [],
|
|
21
22
|
handler: async (request, response) => {
|
|
22
23
|
const page = request.page;
|
|
23
24
|
try {
|
|
24
|
-
await page.openDevTools();
|
|
25
|
+
const devtoolsPage = await page.openDevTools();
|
|
26
|
+
if (devtoolsPage) {
|
|
27
|
+
await page.ensureDevToolsCommentBridge(devtoolsPage);
|
|
28
|
+
}
|
|
25
29
|
response.appendResponseLine('DevTools window opened successfully.');
|
|
26
30
|
}
|
|
27
31
|
catch (e) {
|
|
@@ -31,16 +35,33 @@ export const openDevtools = definePageTool(() => ({
|
|
|
31
35
|
response.setIncludePages(true);
|
|
32
36
|
},
|
|
33
37
|
}));
|
|
38
|
+
const DEFAULT_COMMENT_WAIT_MS = 10_000;
|
|
39
|
+
const MAX_COMMENT_WAIT_MS = 30_000;
|
|
34
40
|
export const getDevtoolsComments = definePageTool(() => ({
|
|
35
41
|
name: 'get_devtools_comments',
|
|
36
|
-
description: 'Retrieve user comments from the DevTools window for the page.'
|
|
42
|
+
description: 'Retrieve user comments from the DevTools window for the page. ' +
|
|
43
|
+
'If no comment is pending, waits up to `timeout` ms for the user to send one, then returns. ' +
|
|
44
|
+
'Call it again to keep waiting.',
|
|
37
45
|
annotations: {
|
|
38
46
|
category: ToolCategory.DEBUGGING,
|
|
39
47
|
readOnlyHint: true,
|
|
40
48
|
conditions: ['devtoolsComments'],
|
|
41
49
|
},
|
|
42
|
-
schema: {
|
|
50
|
+
schema: {
|
|
51
|
+
timeout: zod
|
|
52
|
+
.number()
|
|
53
|
+
.int()
|
|
54
|
+
.min(0)
|
|
55
|
+
.max(MAX_COMMENT_WAIT_MS)
|
|
56
|
+
.optional()
|
|
57
|
+
.describe(`Maximum time in milliseconds to wait for a new comment when none is pending. ` +
|
|
58
|
+
`Defaults to ${DEFAULT_COMMENT_WAIT_MS}, maximum ${MAX_COMMENT_WAIT_MS}. ` +
|
|
59
|
+
`Set to 0 to return immediately without waiting.`),
|
|
60
|
+
},
|
|
43
61
|
blockedByDialog: false,
|
|
62
|
+
// The handler only reads page state and waits for comment events, so it
|
|
63
|
+
// runs outside the task runner and other tools run during the wait.
|
|
64
|
+
concurrency: 'none',
|
|
44
65
|
verifyFilesSchema: {},
|
|
45
66
|
handler: async (request, response) => {
|
|
46
67
|
const page = request.page;
|
|
@@ -54,7 +75,26 @@ export const getDevtoolsComments = definePageTool(() => ({
|
|
|
54
75
|
response.appendResponseLine(DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE);
|
|
55
76
|
return;
|
|
56
77
|
}
|
|
57
|
-
const
|
|
78
|
+
const timeout = request.params.timeout ?? DEFAULT_COMMENT_WAIT_MS;
|
|
79
|
+
const start = Date.now();
|
|
80
|
+
const deadline = start + timeout;
|
|
81
|
+
let threads = await bridge.getComments(devtoolsPage);
|
|
82
|
+
while (threads.length === 0) {
|
|
83
|
+
const remaining = deadline - Date.now();
|
|
84
|
+
if (remaining <= 0) {
|
|
85
|
+
break;
|
|
86
|
+
}
|
|
87
|
+
const changed = await bridge.waitForCommentEvent(remaining);
|
|
88
|
+
if (!changed) {
|
|
89
|
+
break;
|
|
90
|
+
}
|
|
91
|
+
// Another tool may have changed state during the wait, so fetch again.
|
|
92
|
+
threads = await bridge.getComments(devtoolsPage);
|
|
93
|
+
}
|
|
94
|
+
if (threads.length === 0 && timeout > 0) {
|
|
95
|
+
response.appendResponseLine(`Waited ${Date.now() - start}ms for new DevTools comments. Call get_devtools_comments again to keep waiting.`);
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
58
98
|
response.setDevToolsComments(threads);
|
|
59
99
|
},
|
|
60
100
|
}));
|
|
@@ -76,6 +116,7 @@ export const resolveDevtoolsComment = definePageTool(() => ({
|
|
|
76
116
|
.describe('Optional reply explanation from the AI agent to append to the resolved comment thread.'),
|
|
77
117
|
},
|
|
78
118
|
blockedByDialog: false,
|
|
119
|
+
concurrency: 'exclusive',
|
|
79
120
|
verifyFilesSchema: {},
|
|
80
121
|
handler: async (request, response) => {
|
|
81
122
|
const page = request.page;
|
|
@@ -126,6 +167,7 @@ export const revealInDevtools = definePageTool(() => ({
|
|
|
126
167
|
.describe('Optional network request ID to reveal in the Network panel.'),
|
|
127
168
|
},
|
|
128
169
|
blockedByDialog: false,
|
|
170
|
+
concurrency: 'exclusive',
|
|
129
171
|
verifyFilesSchema: {},
|
|
130
172
|
handler: async (request, response) => {
|
|
131
173
|
const page = request.page;
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
7
|
import { ToolCategory } from './categories.js';
|
|
8
8
|
import { definePageTool } from './ToolDefinition.js';
|
|
9
|
+
import { GET_CONSOLE_MESSAGE_TOOL_NAME, LIST_CONSOLE_MESSAGES_TOOL_NAME, } from './toolNames.js';
|
|
9
10
|
const FILTERABLE_MESSAGE_TYPES = [
|
|
10
11
|
'log',
|
|
11
12
|
'debug',
|
|
@@ -28,11 +29,10 @@ const FILTERABLE_MESSAGE_TYPES = [
|
|
|
28
29
|
'verbose',
|
|
29
30
|
'issue',
|
|
30
31
|
];
|
|
31
|
-
const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
|
|
32
32
|
export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
33
33
|
return {
|
|
34
34
|
name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
|
|
35
|
-
description: `List all console messages for the target page since the last navigation.${cliArgs
|
|
35
|
+
description: `List all console messages for the target page since the last navigation.${cliArgs.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
|
|
36
36
|
annotations: {
|
|
37
37
|
category: ToolCategory.DEBUGGING,
|
|
38
38
|
readOnlyHint: true,
|
|
@@ -49,7 +49,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
|
49
49
|
.int()
|
|
50
50
|
.min(0)
|
|
51
51
|
.optional()
|
|
52
|
-
.describe('Page number to return (0-based). When omitted, returns the first page.'),
|
|
52
|
+
.describe('Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.'),
|
|
53
53
|
types: zod
|
|
54
54
|
.array(zod.enum(FILTERABLE_MESSAGE_TYPES))
|
|
55
55
|
.optional()
|
|
@@ -58,7 +58,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
|
58
58
|
.boolean()
|
|
59
59
|
.default(false)
|
|
60
60
|
.optional()
|
|
61
|
-
.describe(
|
|
61
|
+
.describe(`Set to true to return the preserved messages over the last ${cliArgs.maxNavigationSaved} navigations.`),
|
|
62
62
|
includeStackTraces: zod
|
|
63
63
|
.boolean()
|
|
64
64
|
.default(false)
|
|
@@ -67,9 +67,10 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
|
67
67
|
serviceWorkerId: zod
|
|
68
68
|
.string()
|
|
69
69
|
.optional()
|
|
70
|
-
.describe('Filter messages
|
|
70
|
+
.describe('Filter messages by the service worker ID shown by list_pages (sw-N).'),
|
|
71
71
|
},
|
|
72
72
|
blockedByDialog: false,
|
|
73
|
+
concurrency: 'page',
|
|
73
74
|
verifyFilesSchema: {},
|
|
74
75
|
handler: async (request, response) => {
|
|
75
76
|
response.setIncludeConsoleData(true, {
|
|
@@ -84,7 +85,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
|
84
85
|
};
|
|
85
86
|
});
|
|
86
87
|
export const getConsoleMessage = definePageTool(() => ({
|
|
87
|
-
name:
|
|
88
|
+
name: GET_CONSOLE_MESSAGE_TOOL_NAME,
|
|
88
89
|
description: `Gets a console message by its ID. You can get all messages by calling ${LIST_CONSOLE_MESSAGES_TOOL_NAME}.`,
|
|
89
90
|
annotations: {
|
|
90
91
|
category: ToolCategory.DEBUGGING,
|
|
@@ -96,6 +97,7 @@ export const getConsoleMessage = definePageTool(() => ({
|
|
|
96
97
|
.describe('The msgid of a console message on the page from the listed console messages'),
|
|
97
98
|
},
|
|
98
99
|
blockedByDialog: false,
|
|
100
|
+
concurrency: 'page',
|
|
99
101
|
verifyFilesSchema: {},
|
|
100
102
|
handler: async (request, response) => {
|
|
101
103
|
response.attachConsoleMessage(request.params.msgid);
|
|
@@ -34,6 +34,7 @@ Results are paginated (10 rules per page by default); use pageIdx to page throug
|
|
|
34
34
|
.describe('Page number to return (0-based). Defaults to 0 (the first page).'),
|
|
35
35
|
},
|
|
36
36
|
blockedByDialog: true,
|
|
37
|
+
concurrency: 'page',
|
|
37
38
|
verifyFilesSchema: {},
|
|
38
39
|
handler: async (request, response) => {
|
|
39
40
|
const matchedStyles = await request.page.getMatchedStylesForUid(request.params.uid);
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
import { zod, PredefinedNetworkConditions } from '../third_party/index.js';
|
|
8
8
|
import { FORCED_COLORS_VALUES, PREFERS_CONTRAST_VALUES, PREFERS_REDUCED_MOTION_VALUES, } from '../types.js';
|
|
9
9
|
import { ToolCategory } from './categories.js';
|
|
10
|
-
import { definePageTool, geolocationTransform, viewportTransform, } from './ToolDefinition.js';
|
|
10
|
+
import { definePageTool, geolocationTransform, viewportTransform, zodTransform, } from './ToolDefinition.js';
|
|
11
11
|
function headerStringTransform(value) {
|
|
12
12
|
if (value === undefined) {
|
|
13
13
|
return undefined;
|
|
@@ -52,7 +52,7 @@ export const emulate = definePageTool(() => ({
|
|
|
52
52
|
.describe('Represents the CPU slowdown factor. Omit or set the rate to 1 to disable throttling'),
|
|
53
53
|
geolocation: zod
|
|
54
54
|
.string()
|
|
55
|
-
.transform(geolocationTransform)
|
|
55
|
+
.transform(zodTransform(geolocationTransform))
|
|
56
56
|
.optional()
|
|
57
57
|
.describe('Geolocation (`<latitude>,<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override.'),
|
|
58
58
|
userAgent: zod
|
|
@@ -77,16 +77,17 @@ export const emulate = definePageTool(() => ({
|
|
|
77
77
|
.describe('Emulate the `prefers-reduced-motion` CSS media feature. Omit or set to "auto" to reset to the default.'),
|
|
78
78
|
viewport: zod
|
|
79
79
|
.string()
|
|
80
|
-
.transform(viewportTransform)
|
|
80
|
+
.transform(zodTransform(viewportTransform))
|
|
81
81
|
.optional()
|
|
82
82
|
.describe(`Emulate device viewports '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'. 'touch' and 'mobile' to emulate mobile devices. 'landscape' to emulate landscape mode. Omit to clear the viewport override.`),
|
|
83
83
|
extraHttpHeaders: zod
|
|
84
84
|
.string()
|
|
85
|
-
.transform(headerStringTransform)
|
|
85
|
+
.transform(zodTransform(headerStringTransform))
|
|
86
86
|
.optional()
|
|
87
87
|
.describe('Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers.'),
|
|
88
88
|
},
|
|
89
89
|
blockedByDialog: true,
|
|
90
|
+
concurrency: 'exclusive',
|
|
90
91
|
verifyFilesSchema: {},
|
|
91
92
|
handler: async (request, response) => {
|
|
92
93
|
const page = request.page;
|
|
@@ -19,6 +19,7 @@ export const installExtension = defineTool(() => ({
|
|
|
19
19
|
.describe('Absolute path to the unpacked extension folder.'),
|
|
20
20
|
},
|
|
21
21
|
blockedByDialog: false,
|
|
22
|
+
concurrency: 'exclusive',
|
|
22
23
|
verifyFilesSchema: {
|
|
23
24
|
path: { local: true },
|
|
24
25
|
},
|
|
@@ -39,6 +40,7 @@ export const uninstallExtension = defineTool(() => ({
|
|
|
39
40
|
id: zod.string().describe('ID of the extension to uninstall.'),
|
|
40
41
|
},
|
|
41
42
|
blockedByDialog: false,
|
|
43
|
+
concurrency: 'exclusive',
|
|
42
44
|
verifyFilesSchema: {},
|
|
43
45
|
handler: async (request, response, context) => {
|
|
44
46
|
const { id } = request.params;
|
|
@@ -48,13 +50,14 @@ export const uninstallExtension = defineTool(() => ({
|
|
|
48
50
|
}));
|
|
49
51
|
export const listExtensions = defineTool(() => ({
|
|
50
52
|
name: 'list_extensions',
|
|
51
|
-
description: 'Lists
|
|
53
|
+
description: 'Lists the unpacked Chrome extensions loaded in the browser. This includes their name, ID, version, and enabled status. Extensions installed from the Chrome Web Store are not included.',
|
|
52
54
|
annotations: {
|
|
53
55
|
category: ToolCategory.EXTENSIONS,
|
|
54
56
|
readOnlyHint: true,
|
|
55
57
|
},
|
|
56
58
|
schema: {},
|
|
57
59
|
blockedByDialog: false,
|
|
60
|
+
concurrency: 'exclusive',
|
|
58
61
|
verifyFilesSchema: {},
|
|
59
62
|
handler: async (_request, response) => {
|
|
60
63
|
response.setListExtensions();
|
|
@@ -71,6 +74,7 @@ export const reloadExtension = defineTool(() => ({
|
|
|
71
74
|
id: zod.string().describe('ID of the extension to reload.'),
|
|
72
75
|
},
|
|
73
76
|
blockedByDialog: false,
|
|
77
|
+
concurrency: 'exclusive',
|
|
74
78
|
verifyFilesSchema: {},
|
|
75
79
|
handler: async (request, response, context) => {
|
|
76
80
|
const { id } = request.params;
|
|
@@ -93,6 +97,7 @@ export const triggerExtensionAction = defineTool(() => ({
|
|
|
93
97
|
id: zod.string().describe('ID of the extension to trigger the action for.'),
|
|
94
98
|
},
|
|
95
99
|
blockedByDialog: false,
|
|
100
|
+
concurrency: 'exclusive',
|
|
96
101
|
verifyFilesSchema: {},
|
|
97
102
|
handler: async (request, response, context) => {
|
|
98
103
|
const { id } = request.params;
|
|
@@ -55,11 +55,12 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
|
|
|
55
55
|
var e = new Error(message);
|
|
56
56
|
return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
|
|
57
57
|
});
|
|
58
|
-
import { TimeoutError, zod } from '../third_party/index.js';
|
|
59
|
-
import { parseKey } from '../utils/keyboard.js';
|
|
58
|
+
import { TimeoutError, zod, } from '../third_party/index.js';
|
|
59
|
+
import { parseKey, throwIfInvalidKey } from '../utils/keyboard.js';
|
|
60
60
|
import { logger } from '../utils/logger.js';
|
|
61
|
+
import { raceWithSignal } from '../utils/raceWithSignal.js';
|
|
61
62
|
import { ToolCategory } from './categories.js';
|
|
62
|
-
import { definePageTool } from './ToolDefinition.js';
|
|
63
|
+
import { definePageTool, zodTransform, } from './ToolDefinition.js';
|
|
63
64
|
const dblClickSchema = zod
|
|
64
65
|
.boolean()
|
|
65
66
|
.optional()
|
|
@@ -70,6 +71,8 @@ const includeSnapshotSchema = zod
|
|
|
70
71
|
.describe('Whether to include a snapshot in the response. Default is false.');
|
|
71
72
|
const submitKeySchema = zod
|
|
72
73
|
.string()
|
|
74
|
+
// An empty string means no submit key, as before.
|
|
75
|
+
.transform(zodTransform((key) => key === '' ? undefined : throwIfInvalidKey(key)))
|
|
73
76
|
.optional()
|
|
74
77
|
.describe('Optional key to press after typing. E.g., "Enter", "Tab", "Escape"');
|
|
75
78
|
/**
|
|
@@ -146,6 +149,7 @@ export const click = definePageTool(() => ({
|
|
|
146
149
|
includeSnapshot: includeSnapshotSchema,
|
|
147
150
|
},
|
|
148
151
|
blockedByDialog: true,
|
|
152
|
+
concurrency: 'page',
|
|
149
153
|
verifyFilesSchema: {},
|
|
150
154
|
handler: async (request, response) => {
|
|
151
155
|
const env_2 = { stack: [], error: void 0, hasError: false };
|
|
@@ -204,6 +208,7 @@ export const clickAt = definePageTool(() => ({
|
|
|
204
208
|
includeSnapshot: includeSnapshotSchema,
|
|
205
209
|
},
|
|
206
210
|
blockedByDialog: true,
|
|
211
|
+
concurrency: 'page',
|
|
207
212
|
verifyFilesSchema: {},
|
|
208
213
|
handler: async (request, response) => {
|
|
209
214
|
const page = request.page;
|
|
@@ -235,6 +240,7 @@ export const hover = definePageTool(() => ({
|
|
|
235
240
|
includeSnapshot: includeSnapshotSchema,
|
|
236
241
|
},
|
|
237
242
|
blockedByDialog: true,
|
|
243
|
+
concurrency: 'page',
|
|
238
244
|
verifyFilesSchema: {},
|
|
239
245
|
handler: async (request, response) => {
|
|
240
246
|
const env_3 = { stack: [], error: void 0, hasError: false };
|
|
@@ -265,24 +271,6 @@ export const hover = definePageTool(() => ({
|
|
|
265
271
|
}
|
|
266
272
|
},
|
|
267
273
|
}));
|
|
268
|
-
function raceWithSignal(promise, signal) {
|
|
269
|
-
if (signal.aborted) {
|
|
270
|
-
return Promise.reject(signal.reason);
|
|
271
|
-
}
|
|
272
|
-
return new Promise((resolve, reject) => {
|
|
273
|
-
const onAbort = () => {
|
|
274
|
-
reject(signal.reason);
|
|
275
|
-
};
|
|
276
|
-
signal.addEventListener('abort', onAbort, { once: true });
|
|
277
|
-
Promise.resolve(promise).then(value => {
|
|
278
|
-
signal.removeEventListener('abort', onAbort);
|
|
279
|
-
resolve(value);
|
|
280
|
-
}, error => {
|
|
281
|
-
signal.removeEventListener('abort', onAbort);
|
|
282
|
-
reject(error);
|
|
283
|
-
});
|
|
284
|
-
});
|
|
285
|
-
}
|
|
286
274
|
// The AXNode for an option doesn't contain its `value`. We set text content of the option as value.
|
|
287
275
|
// If the form is a combobox, we need to find the correct option by its text value.
|
|
288
276
|
// To do that, loop through the children while checking which child's text matches the requested value (requested value is actually the text content).
|
|
@@ -422,6 +410,7 @@ export const fill = definePageTool(() => ({
|
|
|
422
410
|
includeSnapshot: includeSnapshotSchema,
|
|
423
411
|
},
|
|
424
412
|
blockedByDialog: true,
|
|
413
|
+
concurrency: 'page',
|
|
425
414
|
verifyFilesSchema: {},
|
|
426
415
|
handler: async (request, response) => {
|
|
427
416
|
const { result } = await fillFormElements([{ uid: request.params.uid, value: request.params.value }], request.page);
|
|
@@ -448,16 +437,18 @@ export const typeText = definePageTool(() => ({
|
|
|
448
437
|
submitKey: submitKeySchema,
|
|
449
438
|
},
|
|
450
439
|
blockedByDialog: true,
|
|
440
|
+
concurrency: 'page',
|
|
451
441
|
verifyFilesSchema: {},
|
|
452
442
|
handler: async (request, response) => {
|
|
453
443
|
const page = request.page;
|
|
444
|
+
const submitKey = request.params.submitKey;
|
|
454
445
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
455
446
|
await page.pptrPage.keyboard.type(request.params.text);
|
|
456
|
-
if (
|
|
457
|
-
await page.pptrPage.keyboard.press(
|
|
447
|
+
if (submitKey) {
|
|
448
|
+
await page.pptrPage.keyboard.press(submitKey);
|
|
458
449
|
}
|
|
459
450
|
});
|
|
460
|
-
response.appendResponseLine(`Typed text "${request.params.text}${
|
|
451
|
+
response.appendResponseLine(`Typed text "${request.params.text}${submitKey ? ` + ${submitKey}` : ''}"`);
|
|
461
452
|
response.attachWaitForResult(result);
|
|
462
453
|
},
|
|
463
454
|
}));
|
|
@@ -474,6 +465,7 @@ export const drag = definePageTool(() => ({
|
|
|
474
465
|
includeSnapshot: includeSnapshotSchema,
|
|
475
466
|
},
|
|
476
467
|
blockedByDialog: true,
|
|
468
|
+
concurrency: 'page',
|
|
477
469
|
verifyFilesSchema: {},
|
|
478
470
|
handler: async (request, response) => {
|
|
479
471
|
const env_7 = { stack: [], error: void 0, hasError: false };
|
|
@@ -523,6 +515,7 @@ export const fillForm = definePageTool(() => ({
|
|
|
523
515
|
includeSnapshot: includeSnapshotSchema,
|
|
524
516
|
},
|
|
525
517
|
blockedByDialog: true,
|
|
518
|
+
concurrency: 'page',
|
|
526
519
|
verifyFilesSchema: {},
|
|
527
520
|
handler: async (request, response) => {
|
|
528
521
|
const { result, interruptedUid } = await fillFormElements(request.params.elements, request.page);
|
|
@@ -560,6 +553,7 @@ export const uploadFile = definePageTool(() => ({
|
|
|
560
553
|
includeSnapshot: includeSnapshotSchema,
|
|
561
554
|
},
|
|
562
555
|
blockedByDialog: true,
|
|
556
|
+
concurrency: 'page',
|
|
563
557
|
// We do not validate file paths for remote browser instances
|
|
564
558
|
// because they are on the remote host and not accessed by the MCP server.
|
|
565
559
|
verifyFilesSchema: {
|
|
@@ -612,7 +606,7 @@ export const uploadFile = definePageTool(() => ({
|
|
|
612
606
|
}));
|
|
613
607
|
export const pressKey = definePageTool(() => ({
|
|
614
608
|
name: 'press_key',
|
|
615
|
-
description: `Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations).`,
|
|
609
|
+
description: `Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native <select> elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.`,
|
|
616
610
|
annotations: {
|
|
617
611
|
category: ToolCategory.INPUT,
|
|
618
612
|
readOnlyHint: false,
|
|
@@ -620,15 +614,16 @@ export const pressKey = definePageTool(() => ({
|
|
|
620
614
|
schema: {
|
|
621
615
|
key: zod
|
|
622
616
|
.string()
|
|
617
|
+
.transform(zodTransform(parseKey))
|
|
623
618
|
.describe('A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta'),
|
|
624
619
|
includeSnapshot: includeSnapshotSchema,
|
|
625
620
|
},
|
|
626
621
|
blockedByDialog: true,
|
|
622
|
+
concurrency: 'page',
|
|
627
623
|
verifyFilesSchema: {},
|
|
628
624
|
handler: async (request, response) => {
|
|
629
625
|
const page = request.page;
|
|
630
|
-
const
|
|
631
|
-
const [key, ...modifiers] = tokens;
|
|
626
|
+
const [key, ...modifiers] = request.params.key;
|
|
632
627
|
const result = await page.waitForEventsAfterAction(async () => {
|
|
633
628
|
const heldModifiers = [];
|
|
634
629
|
try {
|
|
@@ -647,7 +642,7 @@ export const pressKey = definePageTool(() => ({
|
|
|
647
642
|
}
|
|
648
643
|
}
|
|
649
644
|
});
|
|
650
|
-
response.appendResponseLine(`Successfully pressed key: ${
|
|
645
|
+
response.appendResponseLine(`Successfully pressed key: ${[...modifiers, key].join('+')}`);
|
|
651
646
|
response.attachWaitForResult(result);
|
|
652
647
|
if (request.params.includeSnapshot) {
|
|
653
648
|
response.includeSnapshot();
|