@yezack/chrome-devtools-mcp-108 0.0.0-stage → 1.10.2
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/FORK-NOTICE.md +45 -0
- package/LICENSE +202 -0
- package/README.md +45 -2
- package/build/src/BrowserManager.js +401 -0
- package/build/src/McpContext.js +642 -0
- package/build/src/McpPage.js +850 -0
- package/build/src/McpResponse.js +1086 -0
- package/build/src/SlimMcpResponse.js +19 -0
- package/build/src/TextSnapshot.js +315 -0
- package/build/src/ToolHandler.js +322 -0
- package/build/src/bin/check-latest-version.js +51 -0
- package/build/src/bin/chrome-devtools-mcp-main.js +77 -0
- package/build/src/bin/chrome-devtools-mcp.js +23 -0
- package/build/src/bin/chrome-devtools.js +222 -0
- package/build/src/collectors/PageCollector.js +291 -0
- package/build/src/collectors/ServiceWorkerCollector.js +171 -0
- package/build/src/config/browser-options.js +125 -0
- package/build/src/config/category-options.js +89 -0
- package/build/src/config/cli-commands.js +26 -0
- package/build/src/config/cli-options.js +1473 -0
- package/build/src/config/mcp-options.js +417 -0
- package/build/src/daemon/client.js +221 -0
- package/build/src/daemon/daemon.js +266 -0
- package/build/src/daemon/types.js +7 -0
- package/build/src/daemon/utils.js +136 -0
- package/build/src/devtools/DevToolsCommentBridge.js +91 -0
- package/build/src/devtools/DevtoolsUtils.js +307 -0
- package/build/src/devtools/McpHostBindingAdapter.js +165 -0
- package/build/src/devtools/issueDescriptions.js +42 -0
- package/build/src/formatters/CommentFormatter.js +82 -0
- package/build/src/formatters/ConsoleFormatter.js +321 -0
- package/build/src/formatters/CssFormatter.js +812 -0
- package/build/src/formatters/HeapSnapshotFormatter.js +185 -0
- package/build/src/formatters/IssueFormatter.js +193 -0
- package/build/src/formatters/NetworkFormatter.js +241 -0
- package/build/src/formatters/SnapshotFormatter.js +135 -0
- package/build/src/index.js +237 -0
- package/build/src/processors/ChunkedTraceParser.js +361 -0
- package/build/src/processors/HeapSnapshotManager.js +270 -0
- package/build/src/processors/PerformanceTrace.js +132 -0
- package/build/src/telemetry/ClearcutLogger.js +242 -0
- package/build/src/telemetry/WatchdogClient.js +61 -0
- package/build/src/telemetry/errors.js +18 -0
- package/build/src/telemetry/flagUtils.js +90 -0
- package/build/src/telemetry/metricsRegistry.js +85 -0
- package/build/src/telemetry/persistence.js +82 -0
- package/build/src/telemetry/transformation.js +233 -0
- package/build/src/telemetry/types.js +36 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +205 -0
- package/build/src/telemetry/watchdog/main.js +128 -0
- package/build/src/third_party/THIRD_PARTY_NOTICES +4077 -0
- package/build/src/third_party/bundled-packages.json +12 -0
- package/build/src/third_party/devtools-formatter-worker.js +15494 -0
- package/build/src/third_party/devtools-heap-snapshot-worker.js +10979 -0
- package/build/src/third_party/index.js +200978 -0
- package/build/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/build/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/build/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/build/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +4 -0
- package/build/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +4 -0
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/build/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/build/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/build/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/build/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/build/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/build/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/build/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/build/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/build/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/build/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/build/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/build/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +10 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/build/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/build/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +58435 -0
- package/build/src/tools/ToolDefinition.js +80 -0
- package/build/src/tools/categories.js +33 -0
- package/build/src/tools/comments.js +169 -0
- package/build/src/tools/console.js +104 -0
- package/build/src/tools/css.js +45 -0
- package/build/src/tools/emulation.js +84 -0
- package/build/src/tools/extensions.js +103 -0
- package/build/src/tools/input.js +652 -0
- package/build/src/tools/lighthouse.js +149 -0
- package/build/src/tools/memory.js +424 -0
- package/build/src/tools/network.js +128 -0
- package/build/src/tools/pages.js +363 -0
- package/build/src/tools/performance.js +212 -0
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +119 -0
- package/build/src/tools/screenshot.js +277 -0
- package/build/src/tools/script.js +232 -0
- package/build/src/tools/slim/tools.js +96 -0
- package/build/src/tools/snapshot.js +63 -0
- package/build/src/tools/thirdPartyDeveloper.js +85 -0
- package/build/src/tools/tools.js +55 -0
- package/build/src/tools/webmcp.js +66 -0
- package/build/src/types.js +10 -0
- package/build/src/utils/WaitForHelper.js +316 -0
- package/build/src/utils/bytes.js +105 -0
- package/build/src/utils/check-for-updates.js +75 -0
- package/build/src/utils/files.js +57 -0
- package/build/src/utils/id.js +16 -0
- package/build/src/utils/keyboard.js +297 -0
- package/build/src/utils/logger.js +52 -0
- package/build/src/utils/pagination.js +50 -0
- package/build/src/utils/polyfill.js +11 -0
- package/build/src/utils/url.js +116 -0
- package/build/src/version.js +10 -0
- package/package.json +41 -4
- package/skills/a11y-debugging/SKILL.md +91 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/chrome-devtools/SKILL.md +74 -0
- package/skills/chrome-devtools-cli/SKILL.md +194 -0
- package/skills/chrome-devtools-cli/references/installation.md +14 -0
- package/skills/cookie-debugging/SKILL.md +149 -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/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +99 -0
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import path from 'node:path';
|
|
7
|
+
import { lighthouseRunner, generateReport, zod, } from '../third_party/index.js';
|
|
8
|
+
import { ToolCategory } from './categories.js';
|
|
9
|
+
import { startTrace } from './performance.js';
|
|
10
|
+
import { definePageTool } from './ToolDefinition.js';
|
|
11
|
+
// Kept in sync with `constants.userAgents` in Lighthouse's
|
|
12
|
+
// core/config/constants.js, which `lighthouse:default` and the `desktop`
|
|
13
|
+
// preset use. The bundle in src/third_party only re-exports the runner
|
|
14
|
+
// entrypoints, so these cannot be imported and are mirrored here alongside the
|
|
15
|
+
// screen emulation metrics below. Refresh via scripts/update-lighthouse.ts.
|
|
16
|
+
const MOBILE_USER_AGENT = 'Mozilla/5.0 (Linux; Android 11; moto g power (2022)) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Mobile Safari/537.36';
|
|
17
|
+
const DESKTOP_USER_AGENT = 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/136.0.0.0 Safari/537.36';
|
|
18
|
+
export const lighthouseAudit = definePageTool((args) => ({
|
|
19
|
+
name: 'lighthouse_audit',
|
|
20
|
+
description: `Get Lighthouse score and reports for accessibility, SEO, best practices, and agentic browsing. This excludes performance. For performance audits, run ${startTrace(args).name}`,
|
|
21
|
+
annotations: {
|
|
22
|
+
category: ToolCategory.DEBUGGING,
|
|
23
|
+
readOnlyHint: false,
|
|
24
|
+
},
|
|
25
|
+
schema: {
|
|
26
|
+
mode: zod
|
|
27
|
+
.enum(['navigation', 'snapshot'])
|
|
28
|
+
.default('navigation')
|
|
29
|
+
.describe('"navigation" reloads & audits. "snapshot" analyzes current state.'),
|
|
30
|
+
device: zod
|
|
31
|
+
.enum(['desktop', 'mobile'])
|
|
32
|
+
.default('desktop')
|
|
33
|
+
.describe('Device to emulate.'),
|
|
34
|
+
outputDirPath: zod
|
|
35
|
+
.string()
|
|
36
|
+
.optional()
|
|
37
|
+
.describe('Directory for reports. If omitted, uses temporary files.'),
|
|
38
|
+
},
|
|
39
|
+
blockedByDialog: true,
|
|
40
|
+
verifyFilesSchema: {
|
|
41
|
+
outputDirPath: true,
|
|
42
|
+
},
|
|
43
|
+
handler: async (request, response, context) => {
|
|
44
|
+
const page = request.page;
|
|
45
|
+
const categories = [
|
|
46
|
+
'accessibility',
|
|
47
|
+
'seo',
|
|
48
|
+
'best-practices',
|
|
49
|
+
'agentic-browsing',
|
|
50
|
+
];
|
|
51
|
+
const formats = ['json', 'html'];
|
|
52
|
+
const { mode = 'navigation', device = 'desktop', outputDirPath, } = request.params;
|
|
53
|
+
const flags = {
|
|
54
|
+
onlyCategories: categories,
|
|
55
|
+
output: formats,
|
|
56
|
+
// Default 30 second timeout for page load.
|
|
57
|
+
maxWaitForLoad: 30_000,
|
|
58
|
+
};
|
|
59
|
+
if (device === 'desktop') {
|
|
60
|
+
flags.formFactor = 'desktop';
|
|
61
|
+
flags.screenEmulation = {
|
|
62
|
+
mobile: false,
|
|
63
|
+
width: 1350,
|
|
64
|
+
height: 940,
|
|
65
|
+
deviceScaleFactor: 1,
|
|
66
|
+
disabled: false,
|
|
67
|
+
};
|
|
68
|
+
flags.emulatedUserAgent = DESKTOP_USER_AGENT;
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
flags.formFactor = 'mobile';
|
|
72
|
+
flags.screenEmulation = {
|
|
73
|
+
mobile: true,
|
|
74
|
+
width: 412,
|
|
75
|
+
height: 823,
|
|
76
|
+
deviceScaleFactor: 1.75,
|
|
77
|
+
disabled: false,
|
|
78
|
+
};
|
|
79
|
+
flags.emulatedUserAgent = MOBILE_USER_AGENT;
|
|
80
|
+
}
|
|
81
|
+
let result;
|
|
82
|
+
try {
|
|
83
|
+
if (mode === 'navigation') {
|
|
84
|
+
result = await lighthouseRunner.navigation(page.pptrPage, page.pptrPage.url(), {
|
|
85
|
+
flags,
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
else {
|
|
89
|
+
result = await lighthouseRunner.snapshot(page.pptrPage, {
|
|
90
|
+
flags,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (!result) {
|
|
94
|
+
throw new Error('Lighthouse audit failed.');
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
finally {
|
|
98
|
+
await page.restoreEmulation();
|
|
99
|
+
}
|
|
100
|
+
const lhr = result.lhr;
|
|
101
|
+
const reportPaths = [];
|
|
102
|
+
const encoder = new TextEncoder();
|
|
103
|
+
const savePromises = formats.map(async (format) => {
|
|
104
|
+
const report = generateReport(lhr, format);
|
|
105
|
+
const data = encoder.encode(report);
|
|
106
|
+
if (outputDirPath) {
|
|
107
|
+
const reportPath = path.join(outputDirPath, `report`);
|
|
108
|
+
const { filename } = await context.saveFile(data, reportPath, `.${format}`);
|
|
109
|
+
return filename;
|
|
110
|
+
}
|
|
111
|
+
const { filepath } = await context.saveTemporaryFile(data, `report.${format}`);
|
|
112
|
+
return filepath;
|
|
113
|
+
});
|
|
114
|
+
const results = await Promise.allSettled(savePromises);
|
|
115
|
+
for (const res of results) {
|
|
116
|
+
if (res.status === 'rejected') {
|
|
117
|
+
throw res.reason;
|
|
118
|
+
}
|
|
119
|
+
reportPaths.push(res.value);
|
|
120
|
+
}
|
|
121
|
+
const categoryScores = Object.values(lhr.categories).map(c => ({
|
|
122
|
+
id: c.id,
|
|
123
|
+
title: c.title,
|
|
124
|
+
score: c.score,
|
|
125
|
+
}));
|
|
126
|
+
const failedAudits = Object.values(lhr.audits).filter(a => a.score !== null && a.score < 1).length;
|
|
127
|
+
const passedAudits = Object.values(lhr.audits).filter(a => a.score === 1).length;
|
|
128
|
+
const output = {
|
|
129
|
+
summary: {
|
|
130
|
+
mode,
|
|
131
|
+
device,
|
|
132
|
+
// `mainDocumentUrl` is only set for navigations, whereas
|
|
133
|
+
// `finalDisplayedUrl` is populated for every gather mode.
|
|
134
|
+
url: lhr.finalDisplayedUrl,
|
|
135
|
+
scores: categoryScores,
|
|
136
|
+
audits: {
|
|
137
|
+
failed: failedAudits,
|
|
138
|
+
passed: passedAudits,
|
|
139
|
+
},
|
|
140
|
+
timing: {
|
|
141
|
+
total: lhr.timing.total,
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
reports: reportPaths,
|
|
145
|
+
};
|
|
146
|
+
response.attachLighthouseResult(output);
|
|
147
|
+
},
|
|
148
|
+
}));
|
|
149
|
+
//# sourceMappingURL=lighthouse.js.map
|
|
@@ -0,0 +1,424 @@
|
|
|
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 { byteSizeRangeSchema } from '../utils/bytes.js';
|
|
8
|
+
import { ToolCategory } from './categories.js';
|
|
9
|
+
import { definePageTool, defineTool } from './ToolDefinition.js';
|
|
10
|
+
const HEAP_SNAPSHOT_FILTERS = [
|
|
11
|
+
'objectsRetainedByDetachedDomNodes',
|
|
12
|
+
'objectsRetainedByConsole',
|
|
13
|
+
'objectsRetainedByEventHandlers',
|
|
14
|
+
'objectsRetainedByContexts',
|
|
15
|
+
'sharedNativeContext',
|
|
16
|
+
'noNativeContext',
|
|
17
|
+
'attributedToSpecificNativeContext',
|
|
18
|
+
];
|
|
19
|
+
export const takeHeapSnapshot = definePageTool(() => ({
|
|
20
|
+
name: 'take_heapsnapshot',
|
|
21
|
+
description: `Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.`,
|
|
22
|
+
annotations: {
|
|
23
|
+
category: ToolCategory.MEMORY,
|
|
24
|
+
readOnlyHint: false,
|
|
25
|
+
},
|
|
26
|
+
schema: {
|
|
27
|
+
filePath: zod
|
|
28
|
+
.string()
|
|
29
|
+
.describe('A path to a .heapsnapshot file to save the heapsnapshot to.'),
|
|
30
|
+
},
|
|
31
|
+
blockedByDialog: true,
|
|
32
|
+
verifyFilesSchema: {
|
|
33
|
+
filePath: true,
|
|
34
|
+
},
|
|
35
|
+
handler: async (request, response, context) => {
|
|
36
|
+
const page = request.page;
|
|
37
|
+
const snapshotPath = await context.ensureExtension(request.params.filePath, '.heapsnapshot');
|
|
38
|
+
await page.pptrPage.captureHeapSnapshot({
|
|
39
|
+
path: snapshotPath,
|
|
40
|
+
});
|
|
41
|
+
response.appendResponseLine(`Heap snapshot saved to ${snapshotPath}`);
|
|
42
|
+
},
|
|
43
|
+
}));
|
|
44
|
+
export const getHeapSnapshotSummary = defineTool(() => ({
|
|
45
|
+
name: 'get_heapsnapshot_summary',
|
|
46
|
+
description: 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary.',
|
|
47
|
+
annotations: {
|
|
48
|
+
category: ToolCategory.MEMORY,
|
|
49
|
+
readOnlyHint: true,
|
|
50
|
+
conditions: ['memoryDebugging'],
|
|
51
|
+
},
|
|
52
|
+
schema: {
|
|
53
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
54
|
+
},
|
|
55
|
+
blockedByDialog: false,
|
|
56
|
+
verifyFilesSchema: {
|
|
57
|
+
filePath: true,
|
|
58
|
+
},
|
|
59
|
+
handler: async (request, response, context) => {
|
|
60
|
+
const stats = await context.getHeapSnapshotStats(request.params.filePath);
|
|
61
|
+
const staticData = await context.getHeapSnapshotStaticData(request.params.filePath);
|
|
62
|
+
const nativeContextSizes = await context.getHeapSnapshotNativeContextSizes(request.params.filePath);
|
|
63
|
+
const retainedByContextSummary = await context.getHeapSnapshotRetainedByContextSummary(request.params.filePath);
|
|
64
|
+
response.setHeapSnapshotStats(stats, staticData, nativeContextSizes, retainedByContextSummary);
|
|
65
|
+
},
|
|
66
|
+
}));
|
|
67
|
+
export const getHeapSnapshotDetails = defineTool(() => ({
|
|
68
|
+
name: 'get_heapsnapshot_details',
|
|
69
|
+
description: 'Loads a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates.',
|
|
70
|
+
annotations: {
|
|
71
|
+
category: ToolCategory.MEMORY,
|
|
72
|
+
readOnlyHint: true,
|
|
73
|
+
conditions: ['memoryDebugging'],
|
|
74
|
+
},
|
|
75
|
+
schema: {
|
|
76
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
77
|
+
filterName: zod
|
|
78
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
79
|
+
.optional()
|
|
80
|
+
.describe('An optional filter to apply to the aggregates.'),
|
|
81
|
+
objectId: zod
|
|
82
|
+
.number()
|
|
83
|
+
.optional()
|
|
84
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
85
|
+
pageIdx: zod
|
|
86
|
+
.number()
|
|
87
|
+
.optional()
|
|
88
|
+
.describe('The page index for pagination of aggregates.'),
|
|
89
|
+
pageSize: zod
|
|
90
|
+
.number()
|
|
91
|
+
.optional()
|
|
92
|
+
.describe('The page size for pagination of aggregates.'),
|
|
93
|
+
},
|
|
94
|
+
blockedByDialog: false,
|
|
95
|
+
verifyFilesSchema: {
|
|
96
|
+
filePath: true,
|
|
97
|
+
},
|
|
98
|
+
handler: async (request, response, context) => {
|
|
99
|
+
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath, request.params.filterName, request.params.objectId);
|
|
100
|
+
response.setHeapSnapshotAggregates(aggregates, {
|
|
101
|
+
pageIdx: request.params.pageIdx,
|
|
102
|
+
pageSize: request.params.pageSize,
|
|
103
|
+
});
|
|
104
|
+
},
|
|
105
|
+
}));
|
|
106
|
+
export const getHeapSnapshotClassNodes = defineTool(() => ({
|
|
107
|
+
name: 'get_heapsnapshot_class_nodes',
|
|
108
|
+
description: 'Loads a memory heapsnapshot and returns instances of a specific class with their IDs.',
|
|
109
|
+
annotations: {
|
|
110
|
+
category: ToolCategory.MEMORY,
|
|
111
|
+
readOnlyHint: true,
|
|
112
|
+
conditions: ['memoryDebugging'],
|
|
113
|
+
},
|
|
114
|
+
schema: {
|
|
115
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
116
|
+
id: zod.number().describe('The ID for the class, obtained from details.'),
|
|
117
|
+
filterName: zod
|
|
118
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
119
|
+
.optional()
|
|
120
|
+
.describe('An optional filter to apply to the nodes.'),
|
|
121
|
+
objectId: zod
|
|
122
|
+
.number()
|
|
123
|
+
.optional()
|
|
124
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
125
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
126
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
127
|
+
},
|
|
128
|
+
blockedByDialog: false,
|
|
129
|
+
verifyFilesSchema: {
|
|
130
|
+
filePath: true,
|
|
131
|
+
},
|
|
132
|
+
handler: async (request, response, context) => {
|
|
133
|
+
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id, request.params.filterName, request.params.objectId);
|
|
134
|
+
response.setHeapSnapshotNodes(nodes, {
|
|
135
|
+
pageIdx: request.params.pageIdx,
|
|
136
|
+
pageSize: request.params.pageSize,
|
|
137
|
+
});
|
|
138
|
+
},
|
|
139
|
+
}));
|
|
140
|
+
export const getHeapSnapshotRetainers = defineTool(() => ({
|
|
141
|
+
name: 'get_heapsnapshot_retainers',
|
|
142
|
+
description: 'Loads a memory heapsnapshot and returns retainers for a specific node ID.',
|
|
143
|
+
annotations: {
|
|
144
|
+
category: ToolCategory.MEMORY,
|
|
145
|
+
readOnlyHint: true,
|
|
146
|
+
conditions: ['memoryDebugging'],
|
|
147
|
+
},
|
|
148
|
+
blockedByDialog: false,
|
|
149
|
+
verifyFilesSchema: {
|
|
150
|
+
filePath: true,
|
|
151
|
+
},
|
|
152
|
+
schema: {
|
|
153
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
154
|
+
nodeId: zod.number().describe('The node ID to get retainers for.'),
|
|
155
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
156
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
157
|
+
},
|
|
158
|
+
handler: async (request, response, context) => {
|
|
159
|
+
const retainers = await context.getHeapSnapshotRetainers(request.params.filePath, request.params.nodeId);
|
|
160
|
+
response.setHeapSnapshotNodes(retainers, {
|
|
161
|
+
pageIdx: request.params.pageIdx,
|
|
162
|
+
pageSize: request.params.pageSize,
|
|
163
|
+
});
|
|
164
|
+
},
|
|
165
|
+
}));
|
|
166
|
+
export const closeHeapSnapshot = defineTool(() => ({
|
|
167
|
+
name: 'close_heapsnapshot',
|
|
168
|
+
description: 'Closes a previously loaded memory heapsnapshot, freeing its memory.',
|
|
169
|
+
annotations: {
|
|
170
|
+
category: ToolCategory.MEMORY,
|
|
171
|
+
readOnlyHint: false,
|
|
172
|
+
conditions: ['memoryDebugging'],
|
|
173
|
+
},
|
|
174
|
+
verifyFilesSchema: {
|
|
175
|
+
filePath: true,
|
|
176
|
+
},
|
|
177
|
+
schema: {
|
|
178
|
+
filePath: zod
|
|
179
|
+
.string()
|
|
180
|
+
.describe('A path to the .heapsnapshot file to close.'),
|
|
181
|
+
},
|
|
182
|
+
blockedByDialog: false,
|
|
183
|
+
handler: async (request, response, context) => {
|
|
184
|
+
const closed = await context.closeHeapSnapshot(request.params.filePath);
|
|
185
|
+
if (!closed) {
|
|
186
|
+
throw new Error(`Failed to close heap snapshot: ${request.params.filePath} was not loaded.`);
|
|
187
|
+
}
|
|
188
|
+
response.appendResponseLine(`Closed heap snapshot: ${request.params.filePath}`);
|
|
189
|
+
},
|
|
190
|
+
}));
|
|
191
|
+
export const getHeapSnapshotRetainingPaths = defineTool(() => ({
|
|
192
|
+
name: 'get_heapsnapshot_retaining_paths',
|
|
193
|
+
description: 'Loads a memory heapsnapshot and returns retaining paths for a specific node ID. This helps to understand why a node is not being garbage collected.',
|
|
194
|
+
annotations: {
|
|
195
|
+
category: ToolCategory.MEMORY,
|
|
196
|
+
readOnlyHint: true,
|
|
197
|
+
conditions: ['memoryDebugging'],
|
|
198
|
+
},
|
|
199
|
+
verifyFilesSchema: {
|
|
200
|
+
filePath: true,
|
|
201
|
+
},
|
|
202
|
+
blockedByDialog: false,
|
|
203
|
+
schema: {
|
|
204
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
205
|
+
nodeId: zod.number().describe('The node ID to get retaining paths for.'),
|
|
206
|
+
maxDepth: zod
|
|
207
|
+
.number()
|
|
208
|
+
.optional()
|
|
209
|
+
.describe('The maximum depth to search for retaining paths.'),
|
|
210
|
+
maxNodes: zod
|
|
211
|
+
.number()
|
|
212
|
+
.optional()
|
|
213
|
+
.describe('The maximum number of nodes to return.'),
|
|
214
|
+
maxSiblings: zod
|
|
215
|
+
.number()
|
|
216
|
+
.optional()
|
|
217
|
+
.describe('The maximum number of siblings to return.'),
|
|
218
|
+
},
|
|
219
|
+
handler: async (request, response, context) => {
|
|
220
|
+
const retainingPaths = await context.getHeapSnapshotRetainingPaths(request.params.filePath, request.params.nodeId, request.params.maxDepth, request.params.maxNodes, request.params.maxSiblings);
|
|
221
|
+
response.setHeapSnapshotRetainingPaths(retainingPaths);
|
|
222
|
+
},
|
|
223
|
+
}));
|
|
224
|
+
export const getHeapSnapshotEdges = defineTool(() => ({
|
|
225
|
+
name: 'get_heapsnapshot_edges',
|
|
226
|
+
description: 'Loads a memory heapsnapshot and returns outgoing edges (references) for a specific node ID.',
|
|
227
|
+
annotations: {
|
|
228
|
+
category: ToolCategory.MEMORY,
|
|
229
|
+
readOnlyHint: true,
|
|
230
|
+
conditions: ['memoryDebugging'],
|
|
231
|
+
},
|
|
232
|
+
blockedByDialog: false,
|
|
233
|
+
verifyFilesSchema: {
|
|
234
|
+
filePath: true,
|
|
235
|
+
},
|
|
236
|
+
schema: {
|
|
237
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
238
|
+
nodeId: zod.number().describe('The node ID to get outgoing edges for.'),
|
|
239
|
+
sortBy: zod
|
|
240
|
+
.enum(['retainedSize', 'selfSize', 'name'])
|
|
241
|
+
.optional()
|
|
242
|
+
.describe('Sort order for edges. Default is retainedSize.'),
|
|
243
|
+
retainedSize: byteSizeRangeSchema('Inclusive retained size range (e.g. "1MB-2MB", "-1MB", or "1MB-") for target nodes. A single value is treated as a minimum. Currently, only the lower bound is applied.').optional(),
|
|
244
|
+
excludePrimitives: zod
|
|
245
|
+
.boolean()
|
|
246
|
+
.optional()
|
|
247
|
+
.describe('Whether to exclude primitive target nodes. Default is true.'),
|
|
248
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
249
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
250
|
+
},
|
|
251
|
+
handler: async (request, response, context) => {
|
|
252
|
+
const edges = await context.getHeapSnapshotEdges(request.params.filePath, request.params.nodeId, {
|
|
253
|
+
sortBy: request.params.sortBy ?? 'retainedSize',
|
|
254
|
+
// DevTools currently only supports a lower retained-size bound here.
|
|
255
|
+
minRetainedSize: request.params.retainedSize?.min,
|
|
256
|
+
excludePrimitives: request.params.excludePrimitives ?? true,
|
|
257
|
+
});
|
|
258
|
+
response.setHeapSnapshotNodes(edges, {
|
|
259
|
+
pageIdx: request.params.pageIdx,
|
|
260
|
+
pageSize: request.params.pageSize,
|
|
261
|
+
});
|
|
262
|
+
},
|
|
263
|
+
}));
|
|
264
|
+
export const getHeapSnapshotDominators = defineTool(() => ({
|
|
265
|
+
name: 'get_heapsnapshot_dominators',
|
|
266
|
+
description: 'Loads a memory heapsnapshot and returns the dominator chain for a specific node ID. This helps to identify which objects are keeping the target node alive.',
|
|
267
|
+
annotations: {
|
|
268
|
+
category: ToolCategory.MEMORY,
|
|
269
|
+
readOnlyHint: true,
|
|
270
|
+
conditions: ['memoryDebugging'],
|
|
271
|
+
},
|
|
272
|
+
blockedByDialog: false,
|
|
273
|
+
verifyFilesSchema: {
|
|
274
|
+
filePath: true,
|
|
275
|
+
},
|
|
276
|
+
schema: {
|
|
277
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
278
|
+
nodeId: zod
|
|
279
|
+
.number()
|
|
280
|
+
.describe('The node ID to get the dominator chain for.'),
|
|
281
|
+
},
|
|
282
|
+
handler: async (request, response, context) => {
|
|
283
|
+
const dominators = await context.getHeapSnapshotDominators(request.params.filePath, request.params.nodeId);
|
|
284
|
+
response.setHeapSnapshotDominators(dominators);
|
|
285
|
+
},
|
|
286
|
+
}));
|
|
287
|
+
export const compareHeapSnapshots = defineTool(() => ({
|
|
288
|
+
name: 'compare_heapsnapshots',
|
|
289
|
+
description: 'Loads two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff.',
|
|
290
|
+
annotations: {
|
|
291
|
+
category: ToolCategory.MEMORY,
|
|
292
|
+
readOnlyHint: true,
|
|
293
|
+
conditions: ['memoryDebugging'],
|
|
294
|
+
},
|
|
295
|
+
verifyFilesSchema: {
|
|
296
|
+
baseFilePath: true,
|
|
297
|
+
currentFilePath: true,
|
|
298
|
+
},
|
|
299
|
+
schema: {
|
|
300
|
+
baseFilePath: zod
|
|
301
|
+
.string()
|
|
302
|
+
.describe('A path to the base .heapsnapshot file (earlier snapshot).'),
|
|
303
|
+
currentFilePath: zod
|
|
304
|
+
.string()
|
|
305
|
+
.describe('A path to the current .heapsnapshot file (later snapshot).'),
|
|
306
|
+
classIndex: zod
|
|
307
|
+
.number()
|
|
308
|
+
.optional()
|
|
309
|
+
.describe('Optional 0-based index of the class in the summary list to filter results, showing individual objects.'),
|
|
310
|
+
},
|
|
311
|
+
blockedByDialog: false,
|
|
312
|
+
handler: async (request, response, context) => {
|
|
313
|
+
if (request.params.classIndex !== undefined) {
|
|
314
|
+
const classDiffResult = await context.getHeapSnapshotDetailedClassDiff(request.params.baseFilePath, request.params.currentFilePath, request.params.classIndex);
|
|
315
|
+
response.setHeapSnapshotDetailedClassDiff(classDiffResult);
|
|
316
|
+
}
|
|
317
|
+
else {
|
|
318
|
+
const diff = await context.getHeapSnapshotClassDiffs(request.params.baseFilePath, request.params.currentFilePath);
|
|
319
|
+
response.setHeapSnapshotClassDiffs(diff);
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
}));
|
|
323
|
+
export const getHeapSnapshotDuplicateStrings = defineTool(() => ({
|
|
324
|
+
name: 'get_heapsnapshot_duplicate_strings',
|
|
325
|
+
description: 'Loads a memory heapsnapshot and returns duplicate strings grouped by their value.',
|
|
326
|
+
annotations: {
|
|
327
|
+
category: ToolCategory.MEMORY,
|
|
328
|
+
readOnlyHint: true,
|
|
329
|
+
conditions: ['memoryDebugging'],
|
|
330
|
+
},
|
|
331
|
+
blockedByDialog: false,
|
|
332
|
+
verifyFilesSchema: {
|
|
333
|
+
filePath: true,
|
|
334
|
+
},
|
|
335
|
+
schema: {
|
|
336
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
337
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
338
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
339
|
+
},
|
|
340
|
+
handler: async (request, response, context) => {
|
|
341
|
+
const duplicateStrings = await context.getHeapSnapshotDuplicateStrings(request.params.filePath);
|
|
342
|
+
response.setHeapSnapshotDuplicateStrings(duplicateStrings, {
|
|
343
|
+
pageIdx: request.params.pageIdx,
|
|
344
|
+
pageSize: request.params.pageSize,
|
|
345
|
+
});
|
|
346
|
+
},
|
|
347
|
+
}));
|
|
348
|
+
export const getHeapSnapshotObjectDetails = defineTool(() => ({
|
|
349
|
+
name: 'get_heapsnapshot_object_details',
|
|
350
|
+
description: 'Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness.',
|
|
351
|
+
annotations: {
|
|
352
|
+
category: ToolCategory.MEMORY,
|
|
353
|
+
readOnlyHint: true,
|
|
354
|
+
conditions: ['memoryDebugging'],
|
|
355
|
+
},
|
|
356
|
+
blockedByDialog: false,
|
|
357
|
+
verifyFilesSchema: {
|
|
358
|
+
filePath: true,
|
|
359
|
+
},
|
|
360
|
+
schema: {
|
|
361
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
362
|
+
nodeId: zod.number().describe('The node ID to get object details for.'),
|
|
363
|
+
},
|
|
364
|
+
handler: async (request, response, context) => {
|
|
365
|
+
const objectInfo = await context.getHeapSnapshotObjectDetails(request.params.filePath, request.params.nodeId);
|
|
366
|
+
response.setHeapSnapshotObjectDetails(objectInfo);
|
|
367
|
+
},
|
|
368
|
+
}));
|
|
369
|
+
export const queryHeapSnapshotObjects = defineTool(() => ({
|
|
370
|
+
name: 'query_heapsnapshot_objects',
|
|
371
|
+
description: 'Loads a memory heapsnapshot and queries objects matching specific filters (className, propertyName, nodeType, retainedSize, selfSize, isDetached, sortBy).',
|
|
372
|
+
annotations: {
|
|
373
|
+
category: ToolCategory.MEMORY,
|
|
374
|
+
readOnlyHint: true,
|
|
375
|
+
conditions: ['memoryDebugging'],
|
|
376
|
+
},
|
|
377
|
+
blockedByDialog: false,
|
|
378
|
+
verifyFilesSchema: { filePath: true },
|
|
379
|
+
schema: {
|
|
380
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
381
|
+
className: zod
|
|
382
|
+
.string()
|
|
383
|
+
.optional()
|
|
384
|
+
.describe('Optional regex or text matching object class name.'),
|
|
385
|
+
propertyName: zod
|
|
386
|
+
.string()
|
|
387
|
+
.optional()
|
|
388
|
+
.describe('Optional property name filter for outgoing reference edges.'),
|
|
389
|
+
nodeType: zod
|
|
390
|
+
.string()
|
|
391
|
+
.optional()
|
|
392
|
+
.describe('Optional V8 node type filter (e.g. object, closure, string, array, code).'),
|
|
393
|
+
retainedSize: byteSizeRangeSchema('Inclusive retained size range (e.g. "1MB-2MB", "-1MB", or "1MB-"). A single value is treated as a minimum.').optional(),
|
|
394
|
+
selfSize: byteSizeRangeSchema('Inclusive self size range (e.g. "1MB-2MB", "-1MB", or "1MB-"). A single value is treated as a minimum.').optional(),
|
|
395
|
+
isDetached: zod
|
|
396
|
+
.boolean()
|
|
397
|
+
.optional()
|
|
398
|
+
.describe('Whether to filter for detached DOM nodes.'),
|
|
399
|
+
sortBy: zod
|
|
400
|
+
.enum(['retainedSize', 'selfSize', 'id'])
|
|
401
|
+
.optional()
|
|
402
|
+
.describe('Sort order for results. Default is retainedSize.'),
|
|
403
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
404
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
405
|
+
},
|
|
406
|
+
handler: async (request, response, context) => {
|
|
407
|
+
const range = await context.queryHeapSnapshotObjects(request.params.filePath, {
|
|
408
|
+
className: request.params.className,
|
|
409
|
+
propertyName: request.params.propertyName,
|
|
410
|
+
nodeType: request.params.nodeType,
|
|
411
|
+
minRetainedSize: request.params.retainedSize?.min,
|
|
412
|
+
maxRetainedSize: request.params.retainedSize?.max,
|
|
413
|
+
minSelfSize: request.params.selfSize?.min,
|
|
414
|
+
maxSelfSize: request.params.selfSize?.max,
|
|
415
|
+
isDetached: request.params.isDetached,
|
|
416
|
+
sortBy: request.params.sortBy,
|
|
417
|
+
});
|
|
418
|
+
response.setHeapSnapshotNodes(range, {
|
|
419
|
+
pageIdx: request.params.pageIdx,
|
|
420
|
+
pageSize: request.params.pageSize,
|
|
421
|
+
});
|
|
422
|
+
},
|
|
423
|
+
}));
|
|
424
|
+
//# sourceMappingURL=memory.js.map
|