opera-devtools-mcp 0.2.4 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +104 -7
- package/build/src/McpContext.js +365 -365
- package/build/src/McpPage.js +475 -48
- package/build/src/McpResponse.js +462 -288
- package/build/src/SlimMcpResponse.js +1 -1
- package/build/src/TextSnapshot.js +101 -22
- package/build/src/ToolHandler.js +142 -20
- package/build/src/bin/check-latest-version.js +27 -1
- package/build/src/bin/chrome-devtools-cli-options.js +573 -10
- package/build/src/bin/chrome-devtools-mcp-cli-options.js +119 -32
- package/build/src/bin/chrome-devtools-mcp-main.js +50 -7
- package/build/src/bin/chrome-devtools-mcp.js +7 -4
- package/build/src/bin/chrome-devtools.js +57 -14
- package/build/src/bin/opera-devtools-cli-options.js +3 -829
- package/build/src/bin/opera-devtools-mcp-cli-options.js +3 -348
- package/build/src/bin/opera-devtools-mcp-main.js +3 -37
- package/build/src/bin/opera-devtools-mcp.js +4 -19
- package/build/src/bin/opera-devtools.js +4 -185
- package/build/src/browser.js +45 -5
- package/build/src/{PageCollector.js → collectors/PageCollector.js} +64 -133
- package/build/src/collectors/ServiceWorkerCollector.js +171 -0
- package/build/src/daemon/client.js +75 -17
- package/build/src/daemon/daemon.js +92 -30
- package/build/src/daemon/utils.js +24 -8
- package/build/src/{DevtoolsUtils.js → devtools/DevtoolsUtils.js} +94 -88
- package/build/src/devtools/McpHostBindingAdapter.js +165 -0
- package/build/src/{issue-descriptions.js → devtools/issueDescriptions.js} +8 -6
- package/build/src/formatters/ConsoleFormatter.js +44 -11
- package/build/src/formatters/HeapSnapshotFormatter.js +140 -9
- package/build/src/formatters/IssueFormatter.js +7 -7
- package/build/src/formatters/NetworkFormatter.js +10 -8
- package/build/src/index.js +101 -232
- package/build/src/opera/branding.js +34 -0
- package/build/src/opera/browserFlags.js +85 -0
- package/build/src/opera/browserLaunch.js +52 -0
- package/build/src/opera/policy.js +50 -0
- package/build/src/opera/serviceWorkerRetry.js +37 -0
- package/build/src/opera/toolHandlerHooks.js +39 -0
- package/build/src/{tools → opera/tools}/opera.js +9 -21
- package/build/src/processors/HeapSnapshotManager.js +258 -0
- package/build/src/{trace-processing/parse.js → processors/PerformanceTrace.js} +9 -9
- package/build/src/telemetry/ClearcutLogger.js +12 -119
- package/build/src/telemetry/WatchdogClient.js +5 -5
- package/build/src/telemetry/errors.js +1 -1
- package/build/src/telemetry/flagUtils.js +6 -6
- package/build/src/telemetry/{toolMetricsUtils.js → metricsRegistry.js} +4 -11
- package/build/src/telemetry/persistence.js +3 -3
- package/build/src/telemetry/transformation.js +184 -0
- package/build/src/telemetry/watchdog/ClearcutSender.js +11 -11
- package/build/src/telemetry/watchdog/main.js +6 -6
- package/build/src/third_party/THIRD_PARTY_NOTICES +232 -1061
- package/build/src/third_party/bundled-packages.json +6 -8
- package/build/src/third_party/devtools-formatter-worker.js +63 -22
- package/build/src/third_party/devtools-heap-snapshot-worker.js +809 -182
- package/build/src/third_party/index.js +69558 -74691
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +2 -2
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +3 -3
- package/build/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +2 -2
- package/build/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +1 -1
- package/build/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +2 -2
- package/build/src/third_party/issue-descriptions/LowTextContrast.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +1 -1
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +3 -3
- package/build/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +3 -3
- package/build/src/third_party/issue-descriptions/bounceTrackingMitigations.md +1 -1
- 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 +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +3 -3
- package/build/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +2 -2
- package/build/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +3 -3
- package/build/src/third_party/issue-descriptions/cookieExcludeBlockedWithinRelatedWebsiteSet.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +1 -1
- package/build/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +1 -1
- package/build/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +1 -1
- package/build/src/third_party/issue-descriptions/corsDisabledScheme.md +2 -2
- package/build/src/third_party/issue-descriptions/corsDisallowedByMode.md +2 -2
- package/build/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +3 -3
- package/build/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +1 -1
- package/build/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +1 -1
- package/build/src/third_party/issue-descriptions/corsOriginMismatch.md +3 -3
- package/build/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +2 -2
- package/build/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +3 -3
- package/build/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +4 -3
- package/build/src/third_party/issue-descriptions/cspEvalViolation.md +4 -4
- package/build/src/third_party/issue-descriptions/cspInlineViolation.md +2 -2
- package/build/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +2 -2
- package/build/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +4 -4
- package/build/src/third_party/issue-descriptions/cspURLViolation.md +4 -4
- 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/federatedAuthRequestAccountsHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -1
- package/build/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +2 -2
- package/build/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/build/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +2 -2
- package/build/src/third_party/issue-descriptions/genericFormLabelForNameError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +1 -1
- package/build/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +2 -2
- package/build/src/third_party/issue-descriptions/heavyAd.md +1 -1
- package/build/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/build/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +3 -3
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidType.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +2 -2
- package/build/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +1 -1
- package/build/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +1 -1
- package/build/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +3 -3
- package/build/src/third_party/issue-descriptions/sharedArrayBuffer.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +2 -2
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +2 -2
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +4 -4
- package/build/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +4 -4
- package/build/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +1 -1
- package/build/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +4 -4
- package/build/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +4 -4
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +1 -1
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +5 -5
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +3 -3
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +2 -2
- package/build/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +2 -2
- package/build/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +4 -4
- package/build/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +3 -3
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +2 -2
- package/build/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +2 -2
- package/build/src/third_party/issue-descriptions/stylesheetLateImport.md +1 -1
- package/build/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +1 -1
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +2 -2
- package/build/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +3 -3
- package/build/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +2 -2
- package/build/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +1 -1
- package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +3177 -6340
- package/build/src/tools/ToolDefinition.js +2 -2
- package/build/src/tools/categories.js +3 -0
- package/build/src/tools/console.js +13 -0
- package/build/src/tools/emulation.js +30 -3
- package/build/src/tools/extensions.js +8 -1
- package/build/src/tools/input.js +246 -128
- package/build/src/tools/lighthouse.js +14 -7
- package/build/src/tools/memory.js +289 -25
- package/build/src/tools/network.js +10 -7
- package/build/src/tools/pages.js +33 -92
- package/build/src/tools/performance.js +67 -52
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +35 -12
- package/build/src/tools/screenshot.js +234 -75
- package/build/src/tools/script.js +130 -45
- package/build/src/tools/slim/tools.js +3 -0
- package/build/src/tools/snapshot.js +7 -4
- package/build/src/tools/thirdPartyDeveloper.js +19 -9
- package/build/src/tools/tools.js +3 -1
- package/build/src/tools/webmcp.js +3 -1
- package/build/src/utils/WaitForHelper.js +299 -0
- package/build/src/utils/check-for-updates.js +8 -2
- package/build/src/utils/files.js +42 -3
- package/build/src/utils/logger.js +51 -0
- package/build/src/utils/polyfill.js +11 -0
- package/build/src/utils/url.js +43 -0
- package/build/src/version.js +1 -1
- package/package.json +42 -33
- package/build/src/DevToolsConnectionAdapter.js +0 -70
- package/build/src/HeapSnapshotManager.js +0 -110
- package/build/src/Mutex.js +0 -38
- package/build/src/WaitForHelper.js +0 -195
- package/build/src/bin/cliDefinitions.js +0 -616
- package/build/src/logger.js +0 -37
- package/build/src/polyfill.js +0 -8
- package/build/src/telemetry/metricUtils.js +0 -15
- package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeRead.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteExcludeContextDowngradeSet.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteExcludeNavigationContextDowngrade.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeRead.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnCrossDowngradeSet.md +0 -8
- package/build/src/third_party/issue-descriptions/SameSiteWarnStrictLaxDowngradeStrict.md +0 -8
- package/build/src/third_party/issue-descriptions/arInsecureContext.md +0 -7
- package/build/src/third_party/issue-descriptions/arInvalidInfoHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterOsSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterOsTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arInvalidRegisterTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNavigationRegistrationUniqueScopeAlreadySet.md +0 -5
- package/build/src/third_party/issue-descriptions/arNavigationRegistrationWithoutTransientUserActivation.md +0 -6
- package/build/src/third_party/issue-descriptions/arNoRegisterOsSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterOsTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterSourceHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoRegisterTriggerHeader.md +0 -5
- package/build/src/third_party/issue-descriptions/arNoWebOrOsSupport.md +0 -4
- package/build/src/third_party/issue-descriptions/arOsSourceIgnored.md +0 -18
- package/build/src/third_party/issue-descriptions/arOsTriggerIgnored.md +0 -19
- package/build/src/third_party/issue-descriptions/arPermissionPolicyDisabled.md +0 -8
- package/build/src/third_party/issue-descriptions/arSourceAndTriggerHeaders.md +0 -9
- package/build/src/third_party/issue-descriptions/arSourceIgnored.md +0 -13
- package/build/src/third_party/issue-descriptions/arTriggerIgnored.md +0 -12
- package/build/src/third_party/issue-descriptions/arUntrustworthyReportingOrigin.md +0 -10
- package/build/src/third_party/issue-descriptions/arWebAndOsHeaders.md +0 -11
- package/build/src/utils/string.js +0 -37
- package/build/src/utils/types.js +0 -7
|
@@ -4,11 +4,19 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
|
-
import { ensureExtension } from '../utils/files.js';
|
|
8
7
|
import { ToolCategory } from './categories.js';
|
|
9
8
|
import { definePageTool, defineTool } from './ToolDefinition.js';
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const HEAP_SNAPSHOT_FILTERS = [
|
|
10
|
+
'objectsRetainedByDetachedDomNodes',
|
|
11
|
+
'objectsRetainedByConsole',
|
|
12
|
+
'objectsRetainedByEventHandlers',
|
|
13
|
+
'objectsRetainedByContexts',
|
|
14
|
+
'sharedNativeContext',
|
|
15
|
+
'noNativeContext',
|
|
16
|
+
'attributedToSpecificNativeContext',
|
|
17
|
+
];
|
|
18
|
+
export const takeHeapSnapshot = definePageTool({
|
|
19
|
+
name: 'take_heapsnapshot',
|
|
12
20
|
description: `Capture a heap snapshot of the currently selected page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.`,
|
|
13
21
|
annotations: {
|
|
14
22
|
category: ToolCategory.MEMORY,
|
|
@@ -20,44 +28,59 @@ export const takeMemorySnapshot = definePageTool({
|
|
|
20
28
|
.describe('A path to a .heapsnapshot file to save the heapsnapshot to.'),
|
|
21
29
|
},
|
|
22
30
|
blockedByDialog: true,
|
|
31
|
+
verifyFilesSchema: {
|
|
32
|
+
filePath: true,
|
|
33
|
+
},
|
|
23
34
|
handler: async (request, response, context) => {
|
|
24
35
|
const page = request.page;
|
|
25
|
-
context.
|
|
36
|
+
const snapshotPath = await context.ensureExtension(request.params.filePath, '.heapsnapshot');
|
|
26
37
|
await page.pptrPage.captureHeapSnapshot({
|
|
27
|
-
path:
|
|
38
|
+
path: snapshotPath,
|
|
28
39
|
});
|
|
29
|
-
response.appendResponseLine(`Heap snapshot saved to ${
|
|
40
|
+
response.appendResponseLine(`Heap snapshot saved to ${snapshotPath}`);
|
|
30
41
|
},
|
|
31
42
|
});
|
|
32
|
-
export const
|
|
33
|
-
name: '
|
|
34
|
-
description: 'Loads a memory heapsnapshot and returns snapshot summary stats.',
|
|
43
|
+
export const getHeapSnapshotSummary = defineTool({
|
|
44
|
+
name: 'get_heapsnapshot_summary',
|
|
45
|
+
description: 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary.',
|
|
35
46
|
annotations: {
|
|
36
47
|
category: ToolCategory.MEMORY,
|
|
37
48
|
readOnlyHint: true,
|
|
38
|
-
conditions: ['
|
|
49
|
+
conditions: ['memoryDebugging'],
|
|
39
50
|
},
|
|
40
51
|
schema: {
|
|
41
52
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
42
53
|
},
|
|
43
54
|
blockedByDialog: false,
|
|
55
|
+
verifyFilesSchema: {
|
|
56
|
+
filePath: true,
|
|
57
|
+
},
|
|
44
58
|
handler: async (request, response, context) => {
|
|
45
|
-
context.validatePath(request.params.filePath);
|
|
46
59
|
const stats = await context.getHeapSnapshotStats(request.params.filePath);
|
|
47
60
|
const staticData = await context.getHeapSnapshotStaticData(request.params.filePath);
|
|
48
|
-
|
|
61
|
+
const nativeContextSizes = await context.getHeapSnapshotNativeContextSizes(request.params.filePath);
|
|
62
|
+
const retainedByContextSummary = await context.getHeapSnapshotRetainedByContextSummary(request.params.filePath);
|
|
63
|
+
response.setHeapSnapshotStats(stats, staticData, nativeContextSizes, retainedByContextSummary);
|
|
49
64
|
},
|
|
50
65
|
});
|
|
51
|
-
export const
|
|
52
|
-
name: '
|
|
66
|
+
export const getHeapSnapshotDetails = defineTool({
|
|
67
|
+
name: 'get_heapsnapshot_details',
|
|
53
68
|
description: 'Loads a memory heapsnapshot and returns all available information including statistics, static data, and aggregated node information. Supports pagination for aggregates.',
|
|
54
69
|
annotations: {
|
|
55
70
|
category: ToolCategory.MEMORY,
|
|
56
71
|
readOnlyHint: true,
|
|
57
|
-
conditions: ['
|
|
72
|
+
conditions: ['memoryDebugging'],
|
|
58
73
|
},
|
|
59
74
|
schema: {
|
|
60
75
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
76
|
+
filterName: zod
|
|
77
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
78
|
+
.optional()
|
|
79
|
+
.describe('An optional filter to apply to the aggregates.'),
|
|
80
|
+
objectId: zod
|
|
81
|
+
.number()
|
|
82
|
+
.optional()
|
|
83
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
61
84
|
pageIdx: zod
|
|
62
85
|
.number()
|
|
63
86
|
.optional()
|
|
@@ -68,39 +91,280 @@ export const getMemorySnapshotDetails = defineTool({
|
|
|
68
91
|
.describe('The page size for pagination of aggregates.'),
|
|
69
92
|
},
|
|
70
93
|
blockedByDialog: false,
|
|
94
|
+
verifyFilesSchema: {
|
|
95
|
+
filePath: true,
|
|
96
|
+
},
|
|
71
97
|
handler: async (request, response, context) => {
|
|
72
|
-
context.
|
|
73
|
-
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath);
|
|
98
|
+
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath, request.params.filterName, request.params.objectId);
|
|
74
99
|
response.setHeapSnapshotAggregates(aggregates, {
|
|
75
100
|
pageIdx: request.params.pageIdx,
|
|
76
101
|
pageSize: request.params.pageSize,
|
|
77
102
|
});
|
|
78
103
|
},
|
|
79
104
|
});
|
|
80
|
-
export const
|
|
81
|
-
name: '
|
|
82
|
-
description: 'Loads a memory heapsnapshot and returns instances of a specific class with their
|
|
105
|
+
export const getHeapSnapshotClassNodes = defineTool({
|
|
106
|
+
name: 'get_heapsnapshot_class_nodes',
|
|
107
|
+
description: 'Loads a memory heapsnapshot and returns instances of a specific class with their IDs.',
|
|
83
108
|
annotations: {
|
|
84
109
|
category: ToolCategory.MEMORY,
|
|
85
110
|
readOnlyHint: true,
|
|
86
|
-
conditions: ['
|
|
111
|
+
conditions: ['memoryDebugging'],
|
|
87
112
|
},
|
|
88
113
|
schema: {
|
|
89
114
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
90
|
-
|
|
115
|
+
id: zod.number().describe('The ID for the class, obtained from details.'),
|
|
116
|
+
filterName: zod
|
|
117
|
+
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
118
|
+
.optional()
|
|
119
|
+
.describe('An optional filter to apply to the nodes.'),
|
|
120
|
+
objectId: zod
|
|
91
121
|
.number()
|
|
92
|
-
.
|
|
122
|
+
.optional()
|
|
123
|
+
.describe('The object ID (nodeId) of the specific native context to filter by when filterName is attributedToSpecificNativeContext.'),
|
|
93
124
|
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
94
125
|
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
95
126
|
},
|
|
96
127
|
blockedByDialog: false,
|
|
128
|
+
verifyFilesSchema: {
|
|
129
|
+
filePath: true,
|
|
130
|
+
},
|
|
97
131
|
handler: async (request, response, context) => {
|
|
98
|
-
context.
|
|
99
|
-
const nodes = await context.getHeapSnapshotNodesByUid(request.params.filePath, request.params.uid);
|
|
132
|
+
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id, request.params.filterName, request.params.objectId);
|
|
100
133
|
response.setHeapSnapshotNodes(nodes, {
|
|
101
134
|
pageIdx: request.params.pageIdx,
|
|
102
135
|
pageSize: request.params.pageSize,
|
|
103
136
|
});
|
|
104
137
|
},
|
|
105
138
|
});
|
|
139
|
+
export const getHeapSnapshotRetainers = defineTool({
|
|
140
|
+
name: 'get_heapsnapshot_retainers',
|
|
141
|
+
description: 'Loads a memory heapsnapshot and returns retainers for a specific node ID.',
|
|
142
|
+
annotations: {
|
|
143
|
+
category: ToolCategory.MEMORY,
|
|
144
|
+
readOnlyHint: true,
|
|
145
|
+
conditions: ['memoryDebugging'],
|
|
146
|
+
},
|
|
147
|
+
blockedByDialog: false,
|
|
148
|
+
verifyFilesSchema: {
|
|
149
|
+
filePath: true,
|
|
150
|
+
},
|
|
151
|
+
schema: {
|
|
152
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
153
|
+
nodeId: zod.number().describe('The node ID to get retainers for.'),
|
|
154
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
155
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
156
|
+
},
|
|
157
|
+
handler: async (request, response, context) => {
|
|
158
|
+
const retainers = await context.getHeapSnapshotRetainers(request.params.filePath, request.params.nodeId);
|
|
159
|
+
response.setHeapSnapshotNodes(retainers, {
|
|
160
|
+
pageIdx: request.params.pageIdx,
|
|
161
|
+
pageSize: request.params.pageSize,
|
|
162
|
+
});
|
|
163
|
+
},
|
|
164
|
+
});
|
|
165
|
+
export const closeHeapSnapshot = defineTool({
|
|
166
|
+
name: 'close_heapsnapshot',
|
|
167
|
+
description: 'Closes a previously loaded memory heapsnapshot, freeing its memory.',
|
|
168
|
+
annotations: {
|
|
169
|
+
category: ToolCategory.MEMORY,
|
|
170
|
+
readOnlyHint: false,
|
|
171
|
+
conditions: ['memoryDebugging'],
|
|
172
|
+
},
|
|
173
|
+
verifyFilesSchema: {
|
|
174
|
+
filePath: true,
|
|
175
|
+
},
|
|
176
|
+
schema: {
|
|
177
|
+
filePath: zod
|
|
178
|
+
.string()
|
|
179
|
+
.describe('A path to the .heapsnapshot file to close.'),
|
|
180
|
+
},
|
|
181
|
+
blockedByDialog: false,
|
|
182
|
+
handler: async (request, response, context) => {
|
|
183
|
+
const closed = await context.closeHeapSnapshot(request.params.filePath);
|
|
184
|
+
if (!closed) {
|
|
185
|
+
throw new Error(`Failed to close heap snapshot: ${request.params.filePath} was not loaded.`);
|
|
186
|
+
}
|
|
187
|
+
response.appendResponseLine(`Closed heap snapshot: ${request.params.filePath}`);
|
|
188
|
+
},
|
|
189
|
+
});
|
|
190
|
+
export const getHeapSnapshotRetainingPaths = defineTool({
|
|
191
|
+
name: 'get_heapsnapshot_retaining_paths',
|
|
192
|
+
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.',
|
|
193
|
+
annotations: {
|
|
194
|
+
category: ToolCategory.MEMORY,
|
|
195
|
+
readOnlyHint: true,
|
|
196
|
+
conditions: ['memoryDebugging'],
|
|
197
|
+
},
|
|
198
|
+
verifyFilesSchema: {
|
|
199
|
+
filePath: true,
|
|
200
|
+
},
|
|
201
|
+
blockedByDialog: false,
|
|
202
|
+
schema: {
|
|
203
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
204
|
+
nodeId: zod.number().describe('The node ID to get retaining paths for.'),
|
|
205
|
+
maxDepth: zod
|
|
206
|
+
.number()
|
|
207
|
+
.optional()
|
|
208
|
+
.describe('The maximum depth to search for retaining paths.'),
|
|
209
|
+
maxNodes: zod
|
|
210
|
+
.number()
|
|
211
|
+
.optional()
|
|
212
|
+
.describe('The maximum number of nodes to return.'),
|
|
213
|
+
maxSiblings: zod
|
|
214
|
+
.number()
|
|
215
|
+
.optional()
|
|
216
|
+
.describe('The maximum number of siblings to return.'),
|
|
217
|
+
},
|
|
218
|
+
handler: async (request, response, context) => {
|
|
219
|
+
const retainingPaths = await context.getHeapSnapshotRetainingPaths(request.params.filePath, request.params.nodeId, request.params.maxDepth, request.params.maxNodes, request.params.maxSiblings);
|
|
220
|
+
response.setHeapSnapshotRetainingPaths(retainingPaths);
|
|
221
|
+
},
|
|
222
|
+
});
|
|
223
|
+
export const getHeapSnapshotEdges = defineTool({
|
|
224
|
+
name: 'get_heapsnapshot_edges',
|
|
225
|
+
description: 'Loads a memory heapsnapshot and returns outgoing edges (references) for a specific node ID.',
|
|
226
|
+
annotations: {
|
|
227
|
+
category: ToolCategory.MEMORY,
|
|
228
|
+
readOnlyHint: true,
|
|
229
|
+
conditions: ['memoryDebugging'],
|
|
230
|
+
},
|
|
231
|
+
blockedByDialog: false,
|
|
232
|
+
verifyFilesSchema: {
|
|
233
|
+
filePath: true,
|
|
234
|
+
},
|
|
235
|
+
schema: {
|
|
236
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
237
|
+
nodeId: zod.number().describe('The node ID to get outgoing edges for.'),
|
|
238
|
+
sortBy: zod
|
|
239
|
+
.enum(['retainedSize', 'selfSize', 'name'])
|
|
240
|
+
.optional()
|
|
241
|
+
.describe('Sort order for edges. Default is retainedSize.'),
|
|
242
|
+
minRetainedSize: zod
|
|
243
|
+
.number()
|
|
244
|
+
.optional()
|
|
245
|
+
.describe('Minimum retained size in bytes for target nodes.'),
|
|
246
|
+
excludePrimitives: zod
|
|
247
|
+
.boolean()
|
|
248
|
+
.optional()
|
|
249
|
+
.describe('Whether to exclude primitive target nodes. Default is true.'),
|
|
250
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
251
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
252
|
+
},
|
|
253
|
+
handler: async (request, response, context) => {
|
|
254
|
+
const edges = await context.getHeapSnapshotEdges(request.params.filePath, request.params.nodeId, {
|
|
255
|
+
sortBy: request.params.sortBy ?? 'retainedSize',
|
|
256
|
+
minRetainedSize: request.params.minRetainedSize,
|
|
257
|
+
excludePrimitives: request.params.excludePrimitives ?? true,
|
|
258
|
+
});
|
|
259
|
+
response.setHeapSnapshotNodes(edges, {
|
|
260
|
+
pageIdx: request.params.pageIdx,
|
|
261
|
+
pageSize: request.params.pageSize,
|
|
262
|
+
});
|
|
263
|
+
},
|
|
264
|
+
});
|
|
265
|
+
export const getHeapSnapshotDominators = defineTool({
|
|
266
|
+
name: 'get_heapsnapshot_dominators',
|
|
267
|
+
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.',
|
|
268
|
+
annotations: {
|
|
269
|
+
category: ToolCategory.MEMORY,
|
|
270
|
+
readOnlyHint: true,
|
|
271
|
+
conditions: ['memoryDebugging'],
|
|
272
|
+
},
|
|
273
|
+
blockedByDialog: false,
|
|
274
|
+
verifyFilesSchema: {
|
|
275
|
+
filePath: true,
|
|
276
|
+
},
|
|
277
|
+
schema: {
|
|
278
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
279
|
+
nodeId: zod
|
|
280
|
+
.number()
|
|
281
|
+
.describe('The node ID to get the dominator chain for.'),
|
|
282
|
+
},
|
|
283
|
+
handler: async (request, response, context) => {
|
|
284
|
+
const dominators = await context.getHeapSnapshotDominators(request.params.filePath, request.params.nodeId);
|
|
285
|
+
response.setHeapSnapshotDominators(dominators);
|
|
286
|
+
},
|
|
287
|
+
});
|
|
288
|
+
export const compareHeapSnapshots = defineTool({
|
|
289
|
+
name: 'compare_heapsnapshots',
|
|
290
|
+
description: 'Loads two memory heapsnapshots and returns the comparison. If classIndex is provided, returns detailed diff for that class, otherwise returns summary diff.',
|
|
291
|
+
annotations: {
|
|
292
|
+
category: ToolCategory.MEMORY,
|
|
293
|
+
readOnlyHint: true,
|
|
294
|
+
conditions: ['memoryDebugging'],
|
|
295
|
+
},
|
|
296
|
+
verifyFilesSchema: {
|
|
297
|
+
baseFilePath: true,
|
|
298
|
+
currentFilePath: true,
|
|
299
|
+
},
|
|
300
|
+
schema: {
|
|
301
|
+
baseFilePath: zod
|
|
302
|
+
.string()
|
|
303
|
+
.describe('A path to the base .heapsnapshot file (earlier snapshot).'),
|
|
304
|
+
currentFilePath: zod
|
|
305
|
+
.string()
|
|
306
|
+
.describe('A path to the current .heapsnapshot file (later snapshot).'),
|
|
307
|
+
classIndex: zod
|
|
308
|
+
.number()
|
|
309
|
+
.optional()
|
|
310
|
+
.describe('Optional 0-based index of the class in the summary list to filter results, showing individual objects.'),
|
|
311
|
+
},
|
|
312
|
+
blockedByDialog: false,
|
|
313
|
+
handler: async (request, response, context) => {
|
|
314
|
+
if (request.params.classIndex !== undefined) {
|
|
315
|
+
const classDiffResult = await context.getHeapSnapshotDetailedClassDiff(request.params.baseFilePath, request.params.currentFilePath, request.params.classIndex);
|
|
316
|
+
response.setHeapSnapshotDetailedClassDiff(classDiffResult);
|
|
317
|
+
}
|
|
318
|
+
else {
|
|
319
|
+
const diff = await context.getHeapSnapshotClassDiffs(request.params.baseFilePath, request.params.currentFilePath);
|
|
320
|
+
response.setHeapSnapshotClassDiffs(diff);
|
|
321
|
+
}
|
|
322
|
+
},
|
|
323
|
+
});
|
|
324
|
+
export const getHeapSnapshotDuplicateStrings = defineTool({
|
|
325
|
+
name: 'get_heapsnapshot_duplicate_strings',
|
|
326
|
+
description: 'Loads a memory heapsnapshot and returns duplicate strings grouped by their value.',
|
|
327
|
+
annotations: {
|
|
328
|
+
category: ToolCategory.MEMORY,
|
|
329
|
+
readOnlyHint: true,
|
|
330
|
+
conditions: ['memoryDebugging'],
|
|
331
|
+
},
|
|
332
|
+
blockedByDialog: false,
|
|
333
|
+
verifyFilesSchema: {
|
|
334
|
+
filePath: true,
|
|
335
|
+
},
|
|
336
|
+
schema: {
|
|
337
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
338
|
+
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
339
|
+
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
340
|
+
},
|
|
341
|
+
handler: async (request, response, context) => {
|
|
342
|
+
const duplicateStrings = await context.getHeapSnapshotDuplicateStrings(request.params.filePath);
|
|
343
|
+
response.setHeapSnapshotDuplicateStrings(duplicateStrings, {
|
|
344
|
+
pageIdx: request.params.pageIdx,
|
|
345
|
+
pageSize: request.params.pageSize,
|
|
346
|
+
});
|
|
347
|
+
},
|
|
348
|
+
});
|
|
349
|
+
export const getHeapSnapshotObjectDetails = defineTool({
|
|
350
|
+
name: 'get_heapsnapshot_object_details',
|
|
351
|
+
description: 'Loads a memory heapsnapshot and returns detailed information about a specific object by its node ID, including size, type, distance, and DOM detachedness.',
|
|
352
|
+
annotations: {
|
|
353
|
+
category: ToolCategory.MEMORY,
|
|
354
|
+
readOnlyHint: true,
|
|
355
|
+
conditions: ['memoryDebugging'],
|
|
356
|
+
},
|
|
357
|
+
blockedByDialog: false,
|
|
358
|
+
verifyFilesSchema: {
|
|
359
|
+
filePath: true,
|
|
360
|
+
},
|
|
361
|
+
schema: {
|
|
362
|
+
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
363
|
+
nodeId: zod.number().describe('The node ID to get object details for.'),
|
|
364
|
+
},
|
|
365
|
+
handler: async (request, response, context) => {
|
|
366
|
+
const objectInfo = await context.getHeapSnapshotObjectDetails(request.params.filePath, request.params.nodeId);
|
|
367
|
+
response.setHeapSnapshotObjectDetails(objectInfo);
|
|
368
|
+
},
|
|
369
|
+
});
|
|
106
370
|
//# sourceMappingURL=memory.js.map
|
|
@@ -29,7 +29,7 @@ const FILTERABLE_RESOURCE_TYPES = [
|
|
|
29
29
|
];
|
|
30
30
|
export const listNetworkRequests = definePageTool({
|
|
31
31
|
name: 'list_network_requests',
|
|
32
|
-
description: `
|
|
32
|
+
description: `Lists the most recent requests for the currently selected page since the last navigation.`,
|
|
33
33
|
annotations: {
|
|
34
34
|
category: ToolCategory.NETWORK,
|
|
35
35
|
readOnlyHint: true,
|
|
@@ -58,11 +58,12 @@ export const listNetworkRequests = definePageTool({
|
|
|
58
58
|
.describe('Set to true to return the preserved requests over the last 3 navigations.'),
|
|
59
59
|
},
|
|
60
60
|
blockedByDialog: false,
|
|
61
|
-
|
|
61
|
+
verifyFilesSchema: {},
|
|
62
|
+
handler: async (request, response) => {
|
|
62
63
|
const data = await request.page.getDevToolsData();
|
|
63
64
|
response.attachDevToolsData(data);
|
|
64
65
|
const reqid = data?.cdpRequestId
|
|
65
|
-
?
|
|
66
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
66
67
|
: undefined;
|
|
67
68
|
response.setIncludeNetworkRequests(true, {
|
|
68
69
|
pageSize: request.params.pageSize,
|
|
@@ -95,9 +96,11 @@ export const getNetworkRequest = definePageTool({
|
|
|
95
96
|
.describe('The absolute or relative path to a .network-response file to save the response body to. If omitted, the body is returned inline.'),
|
|
96
97
|
},
|
|
97
98
|
blockedByDialog: true,
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
verifyFilesSchema: {
|
|
100
|
+
requestFilePath: true,
|
|
101
|
+
responseFilePath: true,
|
|
102
|
+
},
|
|
103
|
+
handler: async (request, response) => {
|
|
101
104
|
if (request.params.reqid) {
|
|
102
105
|
response.attachNetworkRequest(request.params.reqid, {
|
|
103
106
|
requestFilePath: request.params.requestFilePath,
|
|
@@ -108,7 +111,7 @@ export const getNetworkRequest = definePageTool({
|
|
|
108
111
|
const data = await request.page.getDevToolsData();
|
|
109
112
|
response.attachDevToolsData(data);
|
|
110
113
|
const reqid = data?.cdpRequestId
|
|
111
|
-
?
|
|
114
|
+
? request.page.resolveCdpRequestId(data.cdpRequestId)
|
|
112
115
|
: undefined;
|
|
113
116
|
if (reqid) {
|
|
114
117
|
response.attachNetworkRequest(reqid, {
|