@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.1
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/LICENSE +202 -0
- package/README.md +223 -2
- package/out/Default/gen/src/ArcBrowser.js +128 -0
- package/out/Default/gen/src/BrowserManager.js +562 -0
- package/out/Default/gen/src/LogpointManager.js +287 -0
- package/out/Default/gen/src/McpContext.js +1031 -0
- package/out/Default/gen/src/McpPage.js +1427 -0
- package/out/Default/gen/src/McpResponse.js +1350 -0
- package/out/Default/gen/src/McpWorker.js +66 -0
- package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
- package/out/Default/gen/src/SlimMcpResponse.js +23 -0
- package/out/Default/gen/src/TextSnapshot.js +336 -0
- package/out/Default/gen/src/ToolHandler.js +531 -0
- package/out/Default/gen/src/bin/check-latest-version.js +53 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
- package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
- package/out/Default/gen/src/collectors/PageCollector.js +325 -0
- package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigLocator.js +70 -0
- package/out/Default/gen/src/config/ConfigParser.js +163 -0
- package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
- package/out/Default/gen/src/config/ServerConfig.js +284 -0
- package/out/Default/gen/src/config/browser-options.js +135 -0
- package/out/Default/gen/src/config/category-options.js +84 -0
- package/out/Default/gen/src/config/cli-commands.js +208 -0
- package/out/Default/gen/src/config/cli-options.js +2090 -0
- package/out/Default/gen/src/config/mcp-options.js +371 -0
- package/out/Default/gen/src/config/puppeteer-options.js +69 -0
- package/out/Default/gen/src/config/tool-options.js +60 -0
- package/out/Default/gen/src/daemon/client.js +281 -0
- package/out/Default/gen/src/daemon/daemon.js +280 -0
- package/out/Default/gen/src/daemon/types.js +7 -0
- package/out/Default/gen/src/daemon/utils.js +173 -0
- package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
- package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
- package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
- package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
- package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
- package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
- package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
- package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
- package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/formatters/constants.js +8 -0
- package/out/Default/gen/src/index.js +434 -0
- package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
- package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
- package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
- package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
- package/out/Default/gen/src/telemetry/errors.js +18 -0
- package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
- package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
- package/out/Default/gen/src/telemetry/persistence.js +82 -0
- package/out/Default/gen/src/telemetry/transformation.js +229 -0
- package/out/Default/gen/src/telemetry/types.js +36 -0
- package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
- package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
- package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
- package/out/Default/gen/src/third_party/browser.js +808 -0
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +139 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
- package/out/Default/gen/src/third_party/index.js +128 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -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/out/Default/gen/src/tools/categories.js +37 -0
- package/out/Default/gen/src/tools/comments.js +230 -0
- package/out/Default/gen/src/tools/console.js +122 -0
- package/out/Default/gen/src/tools/css.js +54 -0
- package/out/Default/gen/src/tools/emulation.js +98 -0
- package/out/Default/gen/src/tools/extensions.js +108 -0
- package/out/Default/gen/src/tools/input.js +658 -0
- package/out/Default/gen/src/tools/lighthouse.js +279 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/memory.js +531 -0
- package/out/Default/gen/src/tools/network.js +325 -0
- package/out/Default/gen/src/tools/pages.js +420 -0
- package/out/Default/gen/src/tools/performance.js +258 -0
- package/out/Default/gen/src/tools/pwa.js +152 -0
- package/out/Default/gen/src/tools/screencast.js +160 -0
- package/out/Default/gen/src/tools/screenshot.js +315 -0
- package/out/Default/gen/src/tools/script.js +319 -0
- package/out/Default/gen/src/tools/slim/tools.js +110 -0
- package/out/Default/gen/src/tools/snapshot.js +88 -0
- package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/out/Default/gen/src/tools/tools.js +72 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/out/Default/gen/src/tools/webmcp.js +55 -0
- package/out/Default/gen/src/types.js +21 -0
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
- package/out/Default/gen/src/utils/bytes.js +95 -0
- package/out/Default/gen/src/utils/check-for-updates.js +81 -0
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/out/Default/gen/src/utils/errorHandling.js +23 -0
- package/out/Default/gen/src/utils/files.js +81 -0
- package/out/Default/gen/src/utils/id.js +16 -0
- package/out/Default/gen/src/utils/keyboard.js +307 -0
- package/out/Default/gen/src/utils/logger.js +145 -0
- package/out/Default/gen/src/utils/logpoint.js +44 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/pagination.js +50 -0
- package/out/Default/gen/src/utils/polyfill.js +11 -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 +43 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/out/Default/gen/src/utils/url.js +311 -0
- package/out/Default/gen/src/version.js +11 -0
- package/package.json +125 -4
- package/skills/a11y-debugging/SKILL.md +86 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/arc-compatibility/SKILL.md +174 -0
- package/skills/arc-compatibility/SOURCES.md +238 -0
- package/skills/arc-compatibility/references/compatibility.md +115 -0
- package/skills/arc-compatibility/references/output-contract.md +62 -0
- package/skills/arc-compatibility/references/workflows.md +108 -0
- package/skills/chrome-devtools/SKILL.md +80 -0
- package/skills/chrome-devtools-cli/SKILL.md +208 -0
- package/skills/chrome-devtools-cli/references/installation.md +24 -0
- package/skills/cookie-debugging/SKILL.md +152 -0
- package/skills/debug-optimize-lcp/SKILL.md +121 -0
- package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
- package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
- package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
- package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
- package/skills/inspect-in-devtools/SKILL.md +82 -0
- package/skills/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +107 -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
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export var ToolCategory;
|
|
7
|
+
(function (ToolCategory) {
|
|
8
|
+
ToolCategory["INPUT"] = "input";
|
|
9
|
+
ToolCategory["NAVIGATION"] = "navigation";
|
|
10
|
+
ToolCategory["EMULATION"] = "emulation";
|
|
11
|
+
ToolCategory["PERFORMANCE"] = "performance";
|
|
12
|
+
ToolCategory["NETWORK"] = "network";
|
|
13
|
+
ToolCategory["NETWORK_MOCKS"] = "networkMocks";
|
|
14
|
+
ToolCategory["DEBUGGING"] = "debugging";
|
|
15
|
+
ToolCategory["EXTENSIONS"] = "extensions";
|
|
16
|
+
ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
|
|
17
|
+
ToolCategory["MEMORY"] = "memory";
|
|
18
|
+
ToolCategory["WEBMCP"] = "experimentalWebmcp";
|
|
19
|
+
ToolCategory["PWA"] = "pwa";
|
|
20
|
+
ToolCategory["WEBAUTHN"] = "webauthn";
|
|
21
|
+
})(ToolCategory || (ToolCategory = {}));
|
|
22
|
+
export const labels = {
|
|
23
|
+
[ToolCategory.INPUT]: 'Input automation',
|
|
24
|
+
[ToolCategory.NAVIGATION]: 'Navigation automation',
|
|
25
|
+
[ToolCategory.EMULATION]: 'Emulation',
|
|
26
|
+
[ToolCategory.PERFORMANCE]: 'Performance',
|
|
27
|
+
[ToolCategory.NETWORK]: 'Network',
|
|
28
|
+
[ToolCategory.NETWORK_MOCKS]: 'Network mocks',
|
|
29
|
+
[ToolCategory.DEBUGGING]: 'Debugging',
|
|
30
|
+
[ToolCategory.EXTENSIONS]: 'Extensions',
|
|
31
|
+
[ToolCategory.THIRD_PARTY]: 'Third-party',
|
|
32
|
+
[ToolCategory.MEMORY]: 'Memory',
|
|
33
|
+
[ToolCategory.WEBMCP]: 'WebMCP',
|
|
34
|
+
[ToolCategory.PWA]: 'Progressive Web Apps',
|
|
35
|
+
[ToolCategory.WEBAUTHN]: 'WebAuthn',
|
|
36
|
+
};
|
|
37
|
+
//# sourceMappingURL=categories.js.map
|
|
@@ -0,0 +1,230 @@
|
|
|
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
|
+
const DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE = 'DevTools comments are not working right now. Possible reasons: the connected Chrome version does not support DevTools comments, the feature is disabled, or the DevTools window has not finished loading. Try again later, or continue without DevTools comments.';
|
|
10
|
+
export const openDevtools = definePageTool(() => ({
|
|
11
|
+
name: 'open_devtools',
|
|
12
|
+
description: 'Open a DevTools window for the selected page.',
|
|
13
|
+
annotations: {
|
|
14
|
+
category: ToolCategory.DEBUGGING,
|
|
15
|
+
readOnlyHint: true,
|
|
16
|
+
conditions: ['devtoolsComments'],
|
|
17
|
+
},
|
|
18
|
+
schema: {},
|
|
19
|
+
blockedByDialog: false,
|
|
20
|
+
concurrency: 'exclusive',
|
|
21
|
+
verifyFilesSchema: [],
|
|
22
|
+
handler: async (request, response) => {
|
|
23
|
+
const page = request.page;
|
|
24
|
+
try {
|
|
25
|
+
const devtoolsPage = await page.openDevTools();
|
|
26
|
+
if (devtoolsPage) {
|
|
27
|
+
await page.ensureDevToolsCommentBridge(devtoolsPage);
|
|
28
|
+
}
|
|
29
|
+
response.appendResponseLine('DevTools window opened successfully.');
|
|
30
|
+
}
|
|
31
|
+
catch (e) {
|
|
32
|
+
const message = e instanceof Error ? e.message : String(e);
|
|
33
|
+
response.appendResponseLine(`Failed to open DevTools: ${message}`);
|
|
34
|
+
}
|
|
35
|
+
response.setIncludePages(true);
|
|
36
|
+
},
|
|
37
|
+
}));
|
|
38
|
+
const DEFAULT_COMMENT_WAIT_MS = 10_000;
|
|
39
|
+
const MAX_COMMENT_WAIT_MS = 30_000;
|
|
40
|
+
export const getDevtoolsComments = definePageTool(() => ({
|
|
41
|
+
name: 'get_devtools_comments',
|
|
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.',
|
|
45
|
+
annotations: {
|
|
46
|
+
category: ToolCategory.DEBUGGING,
|
|
47
|
+
readOnlyHint: true,
|
|
48
|
+
conditions: ['devtoolsComments'],
|
|
49
|
+
},
|
|
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
|
+
},
|
|
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',
|
|
65
|
+
verifyFilesSchema: {},
|
|
66
|
+
handler: async (request, response) => {
|
|
67
|
+
const page = request.page;
|
|
68
|
+
const devtoolsPage = await page.getDevToolsPage();
|
|
69
|
+
if (!devtoolsPage) {
|
|
70
|
+
response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
|
|
71
|
+
return;
|
|
72
|
+
}
|
|
73
|
+
const bridge = await page.ensureDevToolsCommentBridge(devtoolsPage);
|
|
74
|
+
if (!bridge) {
|
|
75
|
+
response.appendResponseLine(DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE);
|
|
76
|
+
return;
|
|
77
|
+
}
|
|
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
|
+
}
|
|
98
|
+
response.setDevToolsComments(threads);
|
|
99
|
+
},
|
|
100
|
+
}));
|
|
101
|
+
export const resolveDevtoolsComment = definePageTool(() => ({
|
|
102
|
+
name: 'resolve_devtools_comment',
|
|
103
|
+
description: 'Append an agent reply to a DevTools comment thread and mark it as resolved.',
|
|
104
|
+
annotations: {
|
|
105
|
+
category: ToolCategory.DEBUGGING,
|
|
106
|
+
readOnlyHint: false,
|
|
107
|
+
conditions: ['devtoolsComments'],
|
|
108
|
+
},
|
|
109
|
+
schema: {
|
|
110
|
+
threadId: zod
|
|
111
|
+
.string()
|
|
112
|
+
.describe('The unique identifier of the comment thread to resolve (e.g. "comment-1").'),
|
|
113
|
+
replyText: zod
|
|
114
|
+
.string()
|
|
115
|
+
.optional()
|
|
116
|
+
.describe('Optional reply explanation from the AI agent to append to the resolved comment thread.'),
|
|
117
|
+
},
|
|
118
|
+
blockedByDialog: false,
|
|
119
|
+
concurrency: 'exclusive',
|
|
120
|
+
verifyFilesSchema: {},
|
|
121
|
+
handler: async (request, response) => {
|
|
122
|
+
const page = request.page;
|
|
123
|
+
const devtoolsPage = await page.getDevToolsPage();
|
|
124
|
+
if (!devtoolsPage) {
|
|
125
|
+
response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
|
|
126
|
+
return;
|
|
127
|
+
}
|
|
128
|
+
if (!(await page.ensureDevToolsCommentBridge(devtoolsPage))) {
|
|
129
|
+
response.appendResponseLine(DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE);
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
const { threadId, replyText } = request.params;
|
|
133
|
+
const success = await devtoolsPage.evaluate((id, reply) => {
|
|
134
|
+
return (window.universe?.cd4aBridge?.resolveCommentThread(id, reply) ?? false);
|
|
135
|
+
}, threadId, replyText);
|
|
136
|
+
if (success) {
|
|
137
|
+
response.appendResponseLine(`Comment thread ${threadId} resolved successfully.`);
|
|
138
|
+
if (replyText) {
|
|
139
|
+
response.appendResponseLine(`Agent reply added: "${replyText}"`);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
else {
|
|
143
|
+
response.appendResponseLine(`Failed to resolve comment thread "${threadId}". Thread not found.`);
|
|
144
|
+
}
|
|
145
|
+
},
|
|
146
|
+
}));
|
|
147
|
+
export const revealInDevtools = definePageTool(() => ({
|
|
148
|
+
name: 'reveal_in_devtools',
|
|
149
|
+
description: 'Navigate DevTools to a specified panel and highlight a target DOM node or network request. The parameters uid and reqid are mutually exclusive.',
|
|
150
|
+
annotations: {
|
|
151
|
+
category: ToolCategory.DEBUGGING,
|
|
152
|
+
readOnlyHint: true,
|
|
153
|
+
conditions: ['devtoolsComments'],
|
|
154
|
+
},
|
|
155
|
+
schema: {
|
|
156
|
+
panelName: zod
|
|
157
|
+
.string()
|
|
158
|
+
.optional()
|
|
159
|
+
.describe('The target DevTools panel (e.g. "elements", "network", "sources", "console").'),
|
|
160
|
+
uid: zod
|
|
161
|
+
.string()
|
|
162
|
+
.optional()
|
|
163
|
+
.describe('Optional snapshot element UID to reveal in the Elements panel.'),
|
|
164
|
+
reqid: zod
|
|
165
|
+
.number()
|
|
166
|
+
.optional()
|
|
167
|
+
.describe('Optional network request ID to reveal in the Network panel.'),
|
|
168
|
+
},
|
|
169
|
+
blockedByDialog: false,
|
|
170
|
+
concurrency: 'exclusive',
|
|
171
|
+
verifyFilesSchema: {},
|
|
172
|
+
handler: async (request, response) => {
|
|
173
|
+
const page = request.page;
|
|
174
|
+
const devtoolsPage = await page.getDevToolsPage();
|
|
175
|
+
if (!devtoolsPage) {
|
|
176
|
+
response.appendResponseLine('DevTools window is not open for this page. Call open_devtools first to open DevTools.');
|
|
177
|
+
return;
|
|
178
|
+
}
|
|
179
|
+
if (!(await page.ensureDevToolsCommentBridge(devtoolsPage))) {
|
|
180
|
+
response.appendResponseLine(DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE);
|
|
181
|
+
return;
|
|
182
|
+
}
|
|
183
|
+
const { panelName, uid, reqid } = request.params;
|
|
184
|
+
let backendNodeId;
|
|
185
|
+
let targetId;
|
|
186
|
+
let networkRequestId;
|
|
187
|
+
if (uid) {
|
|
188
|
+
const resolved = await page.resolveUidToBackendNodeId(uid);
|
|
189
|
+
if (resolved) {
|
|
190
|
+
backendNodeId = resolved.backendNodeId;
|
|
191
|
+
targetId = resolved.targetId;
|
|
192
|
+
}
|
|
193
|
+
else {
|
|
194
|
+
response.appendResponseLine(`Warning: Could not resolve snapshot UID "${uid}" to a backend DOM node ID.`);
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
if (reqid !== undefined) {
|
|
198
|
+
const resolvedCdpRequestId = page.resolveReqidToCdpRequestId(reqid);
|
|
199
|
+
if (resolvedCdpRequestId !== undefined) {
|
|
200
|
+
networkRequestId = resolvedCdpRequestId;
|
|
201
|
+
}
|
|
202
|
+
else {
|
|
203
|
+
response.appendResponseLine(`Warning: Could not resolve network request ID ${reqid} to a CDP request ID.`);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
const revealTarget = {
|
|
207
|
+
networkRequestId,
|
|
208
|
+
...(backendNodeId !== undefined
|
|
209
|
+
? { node: { backendNodeId, targetId: targetId ?? '' } }
|
|
210
|
+
: {}),
|
|
211
|
+
};
|
|
212
|
+
await devtoolsPage.evaluate(async (panel, target) => {
|
|
213
|
+
await window.universe?.cd4aBridge?.reveal(panel, target);
|
|
214
|
+
}, panelName ?? '', revealTarget);
|
|
215
|
+
let targetDesc = '';
|
|
216
|
+
if (uid && backendNodeId !== undefined) {
|
|
217
|
+
targetDesc = ` (revealing element ${uid} [backend node ${backendNodeId}])`;
|
|
218
|
+
}
|
|
219
|
+
else if (reqid !== undefined && networkRequestId) {
|
|
220
|
+
targetDesc = ` (revealing network request ${reqid} [${networkRequestId}])`;
|
|
221
|
+
}
|
|
222
|
+
if (panelName) {
|
|
223
|
+
response.appendResponseLine(`Navigated to ${panelName} panel${targetDesc} in DevTools.`);
|
|
224
|
+
}
|
|
225
|
+
else {
|
|
226
|
+
response.appendResponseLine(`Revealed target${targetDesc} in DevTools.`);
|
|
227
|
+
}
|
|
228
|
+
},
|
|
229
|
+
}));
|
|
230
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 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
|
+
import { GET_CONSOLE_MESSAGE_TOOL_NAME, LIST_CONSOLE_MESSAGES_TOOL_NAME, } from './toolNames.js';
|
|
10
|
+
const FILTERABLE_MESSAGE_TYPES = [
|
|
11
|
+
'log',
|
|
12
|
+
'debug',
|
|
13
|
+
'info',
|
|
14
|
+
'error',
|
|
15
|
+
'warn',
|
|
16
|
+
'dir',
|
|
17
|
+
'dirxml',
|
|
18
|
+
'table',
|
|
19
|
+
'trace',
|
|
20
|
+
'clear',
|
|
21
|
+
'startGroup',
|
|
22
|
+
'startGroupCollapsed',
|
|
23
|
+
'endGroup',
|
|
24
|
+
'assert',
|
|
25
|
+
'profile',
|
|
26
|
+
'profileEnd',
|
|
27
|
+
'count',
|
|
28
|
+
'timeEnd',
|
|
29
|
+
'verbose',
|
|
30
|
+
'issue',
|
|
31
|
+
];
|
|
32
|
+
export const listConsoleMessages = definePageTool((cliArgs) => {
|
|
33
|
+
return {
|
|
34
|
+
name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
|
|
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
|
+
annotations: {
|
|
37
|
+
category: ToolCategory.DEBUGGING,
|
|
38
|
+
readOnlyHint: true,
|
|
39
|
+
},
|
|
40
|
+
schema: {
|
|
41
|
+
pageSize: zod
|
|
42
|
+
.number()
|
|
43
|
+
.int()
|
|
44
|
+
.positive()
|
|
45
|
+
.optional()
|
|
46
|
+
.describe('Maximum number of messages to return. When omitted, returns all messages.'),
|
|
47
|
+
pageIdx: zod
|
|
48
|
+
.number()
|
|
49
|
+
.int()
|
|
50
|
+
.min(0)
|
|
51
|
+
.optional()
|
|
52
|
+
.describe('Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.'),
|
|
53
|
+
types: zod
|
|
54
|
+
.array(zod.enum(FILTERABLE_MESSAGE_TYPES))
|
|
55
|
+
.optional()
|
|
56
|
+
.describe('Filter messages to only return messages of the specified resource types. When omitted or empty, returns all messages.'),
|
|
57
|
+
includePreservedMessages: zod
|
|
58
|
+
.boolean()
|
|
59
|
+
.default(false)
|
|
60
|
+
.optional()
|
|
61
|
+
.describe(`Set to true to return the preserved messages over the last ${cliArgs.maxNavigationSaved} navigations.`),
|
|
62
|
+
includeStackTraces: zod
|
|
63
|
+
.boolean()
|
|
64
|
+
.default(false)
|
|
65
|
+
.optional()
|
|
66
|
+
.describe('Set to true to include the stack trace for each message when available. Increases the response size.'),
|
|
67
|
+
...(cliArgs.categoryExtensions
|
|
68
|
+
? {
|
|
69
|
+
serviceWorkerId: zod
|
|
70
|
+
.string()
|
|
71
|
+
.optional()
|
|
72
|
+
.describe('Filter messages by the service worker ID shown by list_pages (sw-N).'),
|
|
73
|
+
}
|
|
74
|
+
: {}),
|
|
75
|
+
},
|
|
76
|
+
blockedByDialog: false,
|
|
77
|
+
concurrency: 'page',
|
|
78
|
+
verifyFilesSchema: {},
|
|
79
|
+
handler: async (request, response) => {
|
|
80
|
+
response.setIncludeConsoleData(true, {
|
|
81
|
+
pageSize: request.params.pageSize,
|
|
82
|
+
pageIdx: request.params.pageIdx,
|
|
83
|
+
types: request.params.types,
|
|
84
|
+
includePreservedMessages: request.params.includePreservedMessages,
|
|
85
|
+
includeStackTraces: request.params.includeStackTraces,
|
|
86
|
+
serviceWorkerId: request.params.serviceWorkerId,
|
|
87
|
+
});
|
|
88
|
+
},
|
|
89
|
+
};
|
|
90
|
+
});
|
|
91
|
+
export const getConsoleMessage = definePageTool((cliArgs) => ({
|
|
92
|
+
name: GET_CONSOLE_MESSAGE_TOOL_NAME,
|
|
93
|
+
description: `Gets a console message by its ID. You can get all messages by calling ${LIST_CONSOLE_MESSAGES_TOOL_NAME}.`,
|
|
94
|
+
annotations: {
|
|
95
|
+
category: ToolCategory.DEBUGGING,
|
|
96
|
+
readOnlyHint: true,
|
|
97
|
+
},
|
|
98
|
+
schema: {
|
|
99
|
+
msgid: zod
|
|
100
|
+
.number()
|
|
101
|
+
.describe(cliArgs.categoryExtensions
|
|
102
|
+
? 'The msgid of a console message from list_console_messages: for the page, or for the service worker when serviceWorkerId is set.'
|
|
103
|
+
: 'The msgid of a console message on the page from the listed console messages'),
|
|
104
|
+
...(cliArgs.categoryExtensions
|
|
105
|
+
? {
|
|
106
|
+
serviceWorkerId: zod
|
|
107
|
+
.string()
|
|
108
|
+
.optional()
|
|
109
|
+
.describe('Get the message from the service worker with this ID shown by list_pages (sw-N) instead of the page. pageId is ignored when set. Stack traces are not available for service worker messages.'),
|
|
110
|
+
}
|
|
111
|
+
: {}),
|
|
112
|
+
},
|
|
113
|
+
blockedByDialog: false,
|
|
114
|
+
concurrency: 'page',
|
|
115
|
+
verifyFilesSchema: {},
|
|
116
|
+
handler: async (request, response) => {
|
|
117
|
+
response.attachConsoleMessage(request.params.msgid, {
|
|
118
|
+
serviceWorkerId: request.params.serviceWorkerId,
|
|
119
|
+
});
|
|
120
|
+
},
|
|
121
|
+
}));
|
|
122
|
+
//# sourceMappingURL=console.js.map
|
|
@@ -0,0 +1,54 @@
|
|
|
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 getCssStyles = definePageTool(() => ({
|
|
10
|
+
name: 'get_css_styles',
|
|
11
|
+
description: `Retrieve computed styles, matched CSS rules, inline styles (element.style), inherited styles, custom properties, and cascade wrappers (@layer, @media, @container, @scope) for an element identified by its UID.
|
|
12
|
+
Computed styles for the target element itself (not its pseudo-elements) appears as the first entry, showing display, width, height, and properties from matched or inherited rules; pass computedProperties to include additional CSS properties in Computed styles.
|
|
13
|
+
Matched CSS rules follow from highest to lowest cascade precedence and include source line numbers (e.g. index:196). Active (winning) declarations have no prefix tag, while (losing) overridden declarations are prefixed with [overloaded]. Declarations referencing custom properties via var() include their resolved token values as inline comments (e.g. color: var(--brand); /* #ff0000 */). Computed styles shows final browser-computed longhand values.
|
|
14
|
+
Treat the matched cascade and computed values as authoritative.
|
|
15
|
+
Results are paginated (10 entries per page by default); use pageIdx to page through the remaining rules. Requires a UID from take_snapshot.`,
|
|
16
|
+
annotations: {
|
|
17
|
+
category: ToolCategory.DEBUGGING,
|
|
18
|
+
readOnlyHint: true,
|
|
19
|
+
},
|
|
20
|
+
schema: {
|
|
21
|
+
uid: zod
|
|
22
|
+
.string()
|
|
23
|
+
.describe('The uid of the element on the page from the page content snapshot to inspect CSS styles for'),
|
|
24
|
+
pageSize: zod
|
|
25
|
+
.number()
|
|
26
|
+
.int()
|
|
27
|
+
.positive()
|
|
28
|
+
.default(10)
|
|
29
|
+
.describe('Maximum number of CSS rules to return per page. Defaults to 10.'),
|
|
30
|
+
pageIdx: zod
|
|
31
|
+
.number()
|
|
32
|
+
.int()
|
|
33
|
+
.min(0)
|
|
34
|
+
.default(0)
|
|
35
|
+
.describe('Page number to return (0-based). Defaults to 0 (the first page).'),
|
|
36
|
+
computedProperties: zod
|
|
37
|
+
.array(zod.string())
|
|
38
|
+
.optional()
|
|
39
|
+
.describe('Additional CSS property names (in kebab-case, e.g. "position", "z-index", "overflow") to include in Computed styles even when not matched by any CSS rule.'),
|
|
40
|
+
},
|
|
41
|
+
blockedByDialog: true,
|
|
42
|
+
concurrency: 'page',
|
|
43
|
+
verifyFilesSchema: {},
|
|
44
|
+
handler: async (request, response) => {
|
|
45
|
+
const styles = await request.page.getCssStylesForUid(request.params.uid);
|
|
46
|
+
response.setIncludeCssStyles(styles, {
|
|
47
|
+
uid: request.params.uid,
|
|
48
|
+
pageSize: request.params.pageSize,
|
|
49
|
+
pageIdx: request.params.pageIdx,
|
|
50
|
+
computedProperties: request.params.computedProperties,
|
|
51
|
+
});
|
|
52
|
+
},
|
|
53
|
+
}));
|
|
54
|
+
//# sourceMappingURL=css.js.map
|