chrome-devtools-mcp 1.6.0 → 1.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +73 -22
- package/build/src/McpContext.js +121 -44
- package/build/src/McpPage.js +230 -14
- package/build/src/McpResponse.js +209 -283
- package/build/src/SlimMcpResponse.js +1 -1
- package/build/src/TextSnapshot.js +80 -19
- package/build/src/ToolHandler.js +80 -15
- package/build/src/bin/chrome-devtools-mcp-main.js +3 -3
- package/build/src/bin/chrome-devtools.js +47 -32
- package/build/src/browser.js +3 -1
- package/build/src/{PageCollector.js → collectors/PageCollector.js} +15 -10
- package/build/src/{ServiceWorkerCollector.js → collectors/ServiceWorkerCollector.js} +1 -1
- package/build/src/{bin/chrome-devtools-cli-options.js → config/cli-options.js} +414 -23
- package/build/src/{bin/chrome-devtools-mcp-cli-options.js → config/mcp-options.js} +74 -9
- package/build/src/daemon/client.js +33 -2
- package/build/src/daemon/daemon.js +17 -13
- package/build/src/daemon/utils.js +18 -3
- package/build/src/devtools/DevtoolsUtils.js +9 -16
- package/build/src/formatters/ConsoleFormatter.js +43 -10
- package/build/src/formatters/HeapSnapshotFormatter.js +58 -13
- package/build/src/formatters/IssueFormatter.js +1 -1
- package/build/src/formatters/NetworkFormatter.js +7 -7
- package/build/src/index.js +34 -5
- package/build/src/{HeapSnapshotManager.js → processors/HeapSnapshotManager.js} +82 -27
- package/build/src/{trace-processing/parse.js → processors/PerformanceTrace.js} +1 -1
- package/build/src/telemetry/ClearcutLogger.js +16 -1
- package/build/src/telemetry/flagUtils.js +4 -3
- package/build/src/telemetry/transformation.js +30 -0
- package/build/src/telemetry/types.js +4 -0
- package/build/src/third_party/THIRD_PARTY_NOTICES +235 -113
- package/build/src/third_party/bundled-packages.json +6 -7
- package/build/src/third_party/devtools-formatter-worker.js +60 -19
- package/build/src/third_party/devtools-heap-snapshot-worker.js +657 -224
- package/build/src/third_party/index.js +62484 -43814
- 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 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -1
- package/build/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -1
- package/build/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.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/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- 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/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- 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/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- 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/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 +1125 -1027
- package/build/src/tools/categories.js +3 -0
- package/build/src/tools/console.js +9 -3
- package/build/src/tools/emulation.js +2 -2
- package/build/src/tools/extensions.js +7 -5
- package/build/src/tools/input.js +222 -120
- package/build/src/tools/lighthouse.js +3 -1
- package/build/src/tools/memory.js +144 -17
- package/build/src/tools/network.js +6 -3
- package/build/src/tools/pages.js +13 -16
- package/build/src/tools/performance.js +57 -46
- package/build/src/tools/pwa.js +128 -0
- package/build/src/tools/screencast.js +6 -4
- package/build/src/tools/screenshot.js +192 -84
- package/build/src/tools/script.js +118 -34
- package/build/src/tools/slim/tools.js +3 -3
- package/build/src/tools/snapshot.js +5 -3
- package/build/src/tools/thirdPartyDeveloper.js +2 -2
- package/build/src/tools/tools.js +2 -0
- package/build/src/tools/webmcp.js +2 -2
- package/build/src/utils/WaitForHelper.js +299 -0
- package/build/src/utils/bytes.js +105 -0
- package/build/src/utils/logger.js +25 -11
- package/build/src/utils/polyfill.js +6 -3
- package/build/src/utils/url.js +43 -0
- package/build/src/version.js +1 -1
- package/package.json +37 -25
- package/skills/a11y-debugging/SKILL.md +2 -0
- package/skills/chrome-devtools/SKILL.md +5 -4
- package/skills/chrome-devtools-cli/SKILL.md +109 -64
- package/skills/debug-optimize-lcp/SKILL.md +9 -9
- package/skills/memory-leak-debugging/SKILL.md +14 -18
- package/skills/memory-leak-debugging/references/common-leaks.md +1 -1
- package/skills/troubleshooting/SKILL.md +1 -0
- package/build/src/WaitForHelper.js +0 -200
- package/build/src/devtools/DevToolsConnectionAdapter.js +0 -70
- 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/Mutex.js +0 -38
- package/build/src/utils/string.js +0 -37
- package/skills/memory-leak-debugging/references/compare_snapshots.js +0 -109
- package/skills/memory-leak-debugging/references/memlab.md +0 -29
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
* SPDX-License-Identifier: Apache-2.0
|
|
5
5
|
*/
|
|
6
6
|
import { zod } from '../third_party/index.js';
|
|
7
|
+
import { byteSizeRangeSchema } from '../utils/bytes.js';
|
|
7
8
|
import { ToolCategory } from './categories.js';
|
|
8
9
|
import { definePageTool, defineTool } from './ToolDefinition.js';
|
|
9
10
|
const HEAP_SNAPSHOT_FILTERS = [
|
|
@@ -11,10 +12,13 @@ const HEAP_SNAPSHOT_FILTERS = [
|
|
|
11
12
|
'objectsRetainedByConsole',
|
|
12
13
|
'objectsRetainedByEventHandlers',
|
|
13
14
|
'objectsRetainedByContexts',
|
|
15
|
+
'sharedNativeContext',
|
|
16
|
+
'noNativeContext',
|
|
17
|
+
'attributedToSpecificNativeContext',
|
|
14
18
|
];
|
|
15
19
|
export const takeHeapSnapshot = definePageTool({
|
|
16
20
|
name: 'take_heapsnapshot',
|
|
17
|
-
description: `Capture a heap snapshot of the
|
|
21
|
+
description: `Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.`,
|
|
18
22
|
annotations: {
|
|
19
23
|
category: ToolCategory.MEMORY,
|
|
20
24
|
readOnlyHint: false,
|
|
@@ -25,7 +29,9 @@ export const takeHeapSnapshot = definePageTool({
|
|
|
25
29
|
.describe('A path to a .heapsnapshot file to save the heapsnapshot to.'),
|
|
26
30
|
},
|
|
27
31
|
blockedByDialog: true,
|
|
28
|
-
verifyFilesSchema:
|
|
32
|
+
verifyFilesSchema: {
|
|
33
|
+
filePath: true,
|
|
34
|
+
},
|
|
29
35
|
handler: async (request, response, context) => {
|
|
30
36
|
const page = request.page;
|
|
31
37
|
const snapshotPath = await context.ensureExtension(request.params.filePath, '.heapsnapshot');
|
|
@@ -37,7 +43,7 @@ export const takeHeapSnapshot = definePageTool({
|
|
|
37
43
|
});
|
|
38
44
|
export const getHeapSnapshotSummary = defineTool({
|
|
39
45
|
name: 'get_heapsnapshot_summary',
|
|
40
|
-
description: 'Loads a memory heapsnapshot and returns snapshot summary stats.',
|
|
46
|
+
description: 'Loads a memory heapsnapshot and returns snapshot summary stats, including native contexts and their sizes, and retained by context summary.',
|
|
41
47
|
annotations: {
|
|
42
48
|
category: ToolCategory.MEMORY,
|
|
43
49
|
readOnlyHint: true,
|
|
@@ -47,11 +53,15 @@ export const getHeapSnapshotSummary = defineTool({
|
|
|
47
53
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
48
54
|
},
|
|
49
55
|
blockedByDialog: false,
|
|
50
|
-
verifyFilesSchema:
|
|
56
|
+
verifyFilesSchema: {
|
|
57
|
+
filePath: true,
|
|
58
|
+
},
|
|
51
59
|
handler: async (request, response, context) => {
|
|
52
60
|
const stats = await context.getHeapSnapshotStats(request.params.filePath);
|
|
53
61
|
const staticData = await context.getHeapSnapshotStaticData(request.params.filePath);
|
|
54
|
-
|
|
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);
|
|
55
65
|
},
|
|
56
66
|
});
|
|
57
67
|
export const getHeapSnapshotDetails = defineTool({
|
|
@@ -68,6 +78,10 @@ export const getHeapSnapshotDetails = defineTool({
|
|
|
68
78
|
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
69
79
|
.optional()
|
|
70
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.'),
|
|
71
85
|
pageIdx: zod
|
|
72
86
|
.number()
|
|
73
87
|
.optional()
|
|
@@ -78,9 +92,11 @@ export const getHeapSnapshotDetails = defineTool({
|
|
|
78
92
|
.describe('The page size for pagination of aggregates.'),
|
|
79
93
|
},
|
|
80
94
|
blockedByDialog: false,
|
|
81
|
-
verifyFilesSchema:
|
|
95
|
+
verifyFilesSchema: {
|
|
96
|
+
filePath: true,
|
|
97
|
+
},
|
|
82
98
|
handler: async (request, response, context) => {
|
|
83
|
-
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath, request.params.filterName);
|
|
99
|
+
const aggregates = await context.getHeapSnapshotAggregates(request.params.filePath, request.params.filterName, request.params.objectId);
|
|
84
100
|
response.setHeapSnapshotAggregates(aggregates, {
|
|
85
101
|
pageIdx: request.params.pageIdx,
|
|
86
102
|
pageSize: request.params.pageSize,
|
|
@@ -102,13 +118,19 @@ export const getHeapSnapshotClassNodes = defineTool({
|
|
|
102
118
|
.enum(HEAP_SNAPSHOT_FILTERS)
|
|
103
119
|
.optional()
|
|
104
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.'),
|
|
105
125
|
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
106
126
|
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
107
127
|
},
|
|
108
128
|
blockedByDialog: false,
|
|
109
|
-
verifyFilesSchema:
|
|
129
|
+
verifyFilesSchema: {
|
|
130
|
+
filePath: true,
|
|
131
|
+
},
|
|
110
132
|
handler: async (request, response, context) => {
|
|
111
|
-
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id, request.params.filterName);
|
|
133
|
+
const nodes = await context.getHeapSnapshotNodesById(request.params.filePath, request.params.id, request.params.filterName, request.params.objectId);
|
|
112
134
|
response.setHeapSnapshotNodes(nodes, {
|
|
113
135
|
pageIdx: request.params.pageIdx,
|
|
114
136
|
pageSize: request.params.pageSize,
|
|
@@ -124,7 +146,9 @@ export const getHeapSnapshotRetainers = defineTool({
|
|
|
124
146
|
conditions: ['memoryDebugging'],
|
|
125
147
|
},
|
|
126
148
|
blockedByDialog: false,
|
|
127
|
-
verifyFilesSchema:
|
|
149
|
+
verifyFilesSchema: {
|
|
150
|
+
filePath: true,
|
|
151
|
+
},
|
|
128
152
|
schema: {
|
|
129
153
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
130
154
|
nodeId: zod.number().describe('The node ID to get retainers for.'),
|
|
@@ -147,7 +171,9 @@ export const closeHeapSnapshot = defineTool({
|
|
|
147
171
|
readOnlyHint: false,
|
|
148
172
|
conditions: ['memoryDebugging'],
|
|
149
173
|
},
|
|
150
|
-
verifyFilesSchema:
|
|
174
|
+
verifyFilesSchema: {
|
|
175
|
+
filePath: true,
|
|
176
|
+
},
|
|
151
177
|
schema: {
|
|
152
178
|
filePath: zod
|
|
153
179
|
.string()
|
|
@@ -170,7 +196,9 @@ export const getHeapSnapshotRetainingPaths = defineTool({
|
|
|
170
196
|
readOnlyHint: true,
|
|
171
197
|
conditions: ['memoryDebugging'],
|
|
172
198
|
},
|
|
173
|
-
verifyFilesSchema:
|
|
199
|
+
verifyFilesSchema: {
|
|
200
|
+
filePath: true,
|
|
201
|
+
},
|
|
174
202
|
blockedByDialog: false,
|
|
175
203
|
schema: {
|
|
176
204
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
@@ -202,15 +230,31 @@ export const getHeapSnapshotEdges = defineTool({
|
|
|
202
230
|
conditions: ['memoryDebugging'],
|
|
203
231
|
},
|
|
204
232
|
blockedByDialog: false,
|
|
205
|
-
verifyFilesSchema:
|
|
233
|
+
verifyFilesSchema: {
|
|
234
|
+
filePath: true,
|
|
235
|
+
},
|
|
206
236
|
schema: {
|
|
207
237
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
208
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.'),
|
|
209
248
|
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
210
249
|
pageSize: zod.number().optional().describe('The page size for pagination.'),
|
|
211
250
|
},
|
|
212
251
|
handler: async (request, response, context) => {
|
|
213
|
-
const edges = await context.getHeapSnapshotEdges(request.params.filePath, request.params.nodeId
|
|
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
|
+
});
|
|
214
258
|
response.setHeapSnapshotNodes(edges, {
|
|
215
259
|
pageIdx: request.params.pageIdx,
|
|
216
260
|
pageSize: request.params.pageSize,
|
|
@@ -226,7 +270,9 @@ export const getHeapSnapshotDominators = defineTool({
|
|
|
226
270
|
conditions: ['memoryDebugging'],
|
|
227
271
|
},
|
|
228
272
|
blockedByDialog: false,
|
|
229
|
-
verifyFilesSchema:
|
|
273
|
+
verifyFilesSchema: {
|
|
274
|
+
filePath: true,
|
|
275
|
+
},
|
|
230
276
|
schema: {
|
|
231
277
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
232
278
|
nodeId: zod
|
|
@@ -246,7 +292,10 @@ export const compareHeapSnapshots = defineTool({
|
|
|
246
292
|
readOnlyHint: true,
|
|
247
293
|
conditions: ['memoryDebugging'],
|
|
248
294
|
},
|
|
249
|
-
verifyFilesSchema:
|
|
295
|
+
verifyFilesSchema: {
|
|
296
|
+
baseFilePath: true,
|
|
297
|
+
currentFilePath: true,
|
|
298
|
+
},
|
|
250
299
|
schema: {
|
|
251
300
|
baseFilePath: zod
|
|
252
301
|
.string()
|
|
@@ -280,7 +329,9 @@ export const getHeapSnapshotDuplicateStrings = defineTool({
|
|
|
280
329
|
conditions: ['memoryDebugging'],
|
|
281
330
|
},
|
|
282
331
|
blockedByDialog: false,
|
|
283
|
-
verifyFilesSchema:
|
|
332
|
+
verifyFilesSchema: {
|
|
333
|
+
filePath: true,
|
|
334
|
+
},
|
|
284
335
|
schema: {
|
|
285
336
|
filePath: zod.string().describe('A path to a .heapsnapshot file to read.'),
|
|
286
337
|
pageIdx: zod.number().optional().describe('The page index for pagination.'),
|
|
@@ -294,4 +345,80 @@ export const getHeapSnapshotDuplicateStrings = defineTool({
|
|
|
294
345
|
});
|
|
295
346
|
},
|
|
296
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
|
+
});
|
|
297
424
|
//# 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 target page since the last navigation.`,
|
|
33
33
|
annotations: {
|
|
34
34
|
category: ToolCategory.NETWORK,
|
|
35
35
|
readOnlyHint: true,
|
|
@@ -58,7 +58,7 @@ 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
|
-
verifyFilesSchema:
|
|
61
|
+
verifyFilesSchema: {},
|
|
62
62
|
handler: async (request, response) => {
|
|
63
63
|
const data = await request.page.getDevToolsData();
|
|
64
64
|
response.attachDevToolsData(data);
|
|
@@ -96,7 +96,10 @@ export const getNetworkRequest = definePageTool({
|
|
|
96
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.'),
|
|
97
97
|
},
|
|
98
98
|
blockedByDialog: true,
|
|
99
|
-
verifyFilesSchema:
|
|
99
|
+
verifyFilesSchema: {
|
|
100
|
+
requestFilePath: true,
|
|
101
|
+
responseFilePath: true,
|
|
102
|
+
},
|
|
100
103
|
handler: async (request, response) => {
|
|
101
104
|
if (request.params.reqid) {
|
|
102
105
|
response.attachNetworkRequest(request.params.reqid, {
|
package/build/src/tools/pages.js
CHANGED
|
@@ -17,7 +17,7 @@ export const listPages = defineTool(args => {
|
|
|
17
17
|
},
|
|
18
18
|
schema: {},
|
|
19
19
|
blockedByDialog: false,
|
|
20
|
-
verifyFilesSchema:
|
|
20
|
+
verifyFilesSchema: {},
|
|
21
21
|
handler: async (_request, response) => {
|
|
22
22
|
response.setIncludePages(true);
|
|
23
23
|
response.setListThirdPartyDeveloperTools();
|
|
@@ -42,7 +42,7 @@ export const selectPage = defineTool({
|
|
|
42
42
|
.describe('Whether to focus the page and bring it to the top.'),
|
|
43
43
|
},
|
|
44
44
|
blockedByDialog: false,
|
|
45
|
-
verifyFilesSchema:
|
|
45
|
+
verifyFilesSchema: {},
|
|
46
46
|
handler: async (request, response, context) => {
|
|
47
47
|
const page = context.getPageById(request.params.pageId);
|
|
48
48
|
context.selectPage(page);
|
|
@@ -67,7 +67,7 @@ export const closePage = defineTool({
|
|
|
67
67
|
.describe('The ID of the page to close. Call list_pages to list pages.'),
|
|
68
68
|
},
|
|
69
69
|
blockedByDialog: false,
|
|
70
|
-
verifyFilesSchema:
|
|
70
|
+
verifyFilesSchema: {},
|
|
71
71
|
handler: async (request, response, context) => {
|
|
72
72
|
try {
|
|
73
73
|
await context.closePage(request.params.pageId);
|
|
@@ -107,7 +107,7 @@ export const newPage = defineTool(() => {
|
|
|
107
107
|
...timeoutSchema,
|
|
108
108
|
},
|
|
109
109
|
blockedByDialog: false,
|
|
110
|
-
verifyFilesSchema:
|
|
110
|
+
verifyFilesSchema: {},
|
|
111
111
|
handler: async (request, response, context) => {
|
|
112
112
|
const page = await context.newPage(request.params.background, request.params.isolatedContext);
|
|
113
113
|
await page.waitForEventsAfterAction(async () => {
|
|
@@ -149,7 +149,7 @@ export const navigatePage = definePageTool(() => {
|
|
|
149
149
|
...timeoutSchema,
|
|
150
150
|
},
|
|
151
151
|
blockedByDialog: false,
|
|
152
|
-
verifyFilesSchema:
|
|
152
|
+
verifyFilesSchema: {},
|
|
153
153
|
handler: async (request, response) => {
|
|
154
154
|
const page = request.page;
|
|
155
155
|
const options = {
|
|
@@ -239,7 +239,7 @@ export const navigatePage = definePageTool(() => {
|
|
|
239
239
|
});
|
|
240
240
|
export const resizePage = definePageTool({
|
|
241
241
|
name: 'resize_page',
|
|
242
|
-
description: `Resizes the
|
|
242
|
+
description: `Resizes the page's window so that the page has specified dimension`,
|
|
243
243
|
annotations: {
|
|
244
244
|
category: ToolCategory.EMULATION,
|
|
245
245
|
readOnlyHint: false,
|
|
@@ -249,7 +249,7 @@ export const resizePage = definePageTool({
|
|
|
249
249
|
height: zod.number().describe('Page height'),
|
|
250
250
|
},
|
|
251
251
|
blockedByDialog: false,
|
|
252
|
-
verifyFilesSchema:
|
|
252
|
+
verifyFilesSchema: {},
|
|
253
253
|
handler: async (request, response) => {
|
|
254
254
|
const page = request.page;
|
|
255
255
|
try {
|
|
@@ -292,7 +292,7 @@ export const handleDialog = definePageTool({
|
|
|
292
292
|
.describe('Optional prompt text to enter into the dialog.'),
|
|
293
293
|
},
|
|
294
294
|
blockedByDialog: false,
|
|
295
|
-
verifyFilesSchema:
|
|
295
|
+
verifyFilesSchema: {},
|
|
296
296
|
handler: async (request, response) => {
|
|
297
297
|
const page = request.page;
|
|
298
298
|
const dialog = page.getDialog();
|
|
@@ -335,17 +335,14 @@ export const getTabId = definePageTool({
|
|
|
335
335
|
readOnlyHint: true,
|
|
336
336
|
conditions: ['experimentalInteropTools'],
|
|
337
337
|
},
|
|
338
|
-
schema: {
|
|
339
|
-
pageId: zod
|
|
340
|
-
.number()
|
|
341
|
-
.describe(`The ID of the page to get the tab ID for. Call ${listPages().name} to get available pages.`),
|
|
342
|
-
},
|
|
338
|
+
schema: {},
|
|
343
339
|
blockedByDialog: false,
|
|
344
|
-
verifyFilesSchema:
|
|
345
|
-
handler: async (request, response
|
|
346
|
-
const page =
|
|
340
|
+
verifyFilesSchema: {},
|
|
341
|
+
handler: async (request, response) => {
|
|
342
|
+
const page = request.page;
|
|
347
343
|
const tabId = page.pptrPage._tabId;
|
|
348
344
|
response.setTabId(tabId);
|
|
345
|
+
response.appendResponseLine(`Tab ID: ${tabId}`);
|
|
349
346
|
},
|
|
350
347
|
});
|
|
351
348
|
//# sourceMappingURL=pages.js.map
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
import zlib from 'node:zlib';
|
|
7
7
|
import { zod, DevTools } from '../third_party/index.js';
|
|
8
|
-
import { parseRawTraceBuffer, traceResultIsSuccess, } from '../
|
|
8
|
+
import { parseRawTraceBuffer, traceResultIsSuccess, } from '../processors/PerformanceTrace.js';
|
|
9
9
|
import { logger } from '../utils/logger.js';
|
|
10
10
|
import { ToolCategory } from './categories.js';
|
|
11
11
|
import { definePageTool } from './ToolDefinition.js';
|
|
@@ -15,7 +15,7 @@ const filePathSchema = zod
|
|
|
15
15
|
.describe('The absolute file path, or a file path relative to the current working directory, to save the raw trace data. For example, trace.json.gz (compressed) or trace.json (uncompressed).');
|
|
16
16
|
export const startTrace = definePageTool({
|
|
17
17
|
name: 'performance_start_trace',
|
|
18
|
-
description: `Start a performance trace on the
|
|
18
|
+
description: `Start a performance trace on the target webpage. Use to find frontend performance issues, Core Web Vitals (LCP, INP, CLS), and improve page load speed.`,
|
|
19
19
|
annotations: {
|
|
20
20
|
category: ToolCategory.PERFORMANCE,
|
|
21
21
|
readOnlyHint: false,
|
|
@@ -24,7 +24,7 @@ export const startTrace = definePageTool({
|
|
|
24
24
|
reload: zod
|
|
25
25
|
.boolean()
|
|
26
26
|
.default(true)
|
|
27
|
-
.describe('Determines if, once tracing has started, the
|
|
27
|
+
.describe('Determines if, once tracing has started, the target page should be automatically reloaded. Navigate the page to the right URL using the navigate_page tool BEFORE starting the trace if reload or autoStop is set to true.'),
|
|
28
28
|
autoStop: zod
|
|
29
29
|
.boolean()
|
|
30
30
|
.default(true)
|
|
@@ -32,7 +32,9 @@ export const startTrace = definePageTool({
|
|
|
32
32
|
filePath: filePathSchema,
|
|
33
33
|
},
|
|
34
34
|
blockedByDialog: true,
|
|
35
|
-
verifyFilesSchema:
|
|
35
|
+
verifyFilesSchema: {
|
|
36
|
+
filePath: true,
|
|
37
|
+
},
|
|
36
38
|
handler: async (request, response, context) => {
|
|
37
39
|
if (context.isRunningPerformanceTrace()) {
|
|
38
40
|
response.appendResponseLine('Error: a performance trace is already running. Use performance_stop_trace to stop it. Only one trace can be running at any given time.');
|
|
@@ -41,53 +43,60 @@ export const startTrace = definePageTool({
|
|
|
41
43
|
context.setIsRunningPerformanceTrace(true);
|
|
42
44
|
const page = request.page;
|
|
43
45
|
const pageUrlForTracing = page.pptrPage.url();
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
'disabled-by-default-devtools.timeline.frame',
|
|
62
|
-
'disabled-by-default-devtools.timeline.stack',
|
|
63
|
-
'disabled-by-default-v8.cpu_profiler',
|
|
64
|
-
'disabled-by-default-v8.cpu_profiler.hires',
|
|
65
|
-
'latencyInfo',
|
|
66
|
-
'loading',
|
|
67
|
-
'disabled-by-default-lighthouse',
|
|
68
|
-
'v8.execute',
|
|
69
|
-
'v8',
|
|
70
|
-
];
|
|
71
|
-
await page.pptrPage.tracing.start({
|
|
72
|
-
categories,
|
|
73
|
-
});
|
|
74
|
-
if (request.params.reload) {
|
|
75
|
-
await page.pptrPage.goto(pageUrlForTracing, {
|
|
76
|
-
waitUntil: ['load'],
|
|
46
|
+
try {
|
|
47
|
+
if (request.params.reload) {
|
|
48
|
+
// Before starting the recording, navigate to about:blank to clear out any state.
|
|
49
|
+
// We use `load` because `networkidle0` is known to be flaky for about:blank in Puppeteer.
|
|
50
|
+
await page.pptrPage.goto('about:blank', {
|
|
51
|
+
waitUntil: 'load',
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
const categories = [
|
|
55
|
+
'-*',
|
|
56
|
+
...DevTools.TracingDefaultCategories,
|
|
57
|
+
// These categories are optional in DevTools, but enabled by default in the DevTools UI, so we enable them here too.
|
|
58
|
+
...DevTools.TracingOptionalCategories.JsSampling,
|
|
59
|
+
...DevTools.TracingOptionalCategories.Screenshot,
|
|
60
|
+
];
|
|
61
|
+
await page.pptrPage.tracing.start({
|
|
62
|
+
categories,
|
|
77
63
|
});
|
|
64
|
+
if (request.params.reload) {
|
|
65
|
+
await page.pptrPage.goto(pageUrlForTracing, {
|
|
66
|
+
waitUntil: ['load'],
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (request.params.autoStop) {
|
|
70
|
+
await new Promise(resolve => setTimeout(resolve, 5_000));
|
|
71
|
+
await stopTracingAndAppendOutput(page, response, context, request.params.filePath);
|
|
72
|
+
}
|
|
73
|
+
else {
|
|
74
|
+
response.appendResponseLine(`The performance trace is being recorded. Use performance_stop_trace to stop it.`);
|
|
75
|
+
}
|
|
78
76
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
77
|
+
catch (error) {
|
|
78
|
+
// If a setup step (navigation, tracing.start) throws before
|
|
79
|
+
// stopTracingAndAppendOutput runs, the running flag would otherwise stay
|
|
80
|
+
// stuck `true` for the rest of the session, blocking all future traces.
|
|
81
|
+
// Unwind here: stop tracing if it was started and clear the flag. When
|
|
82
|
+
// autoStop already ran stopTracingAndAppendOutput the flag is already
|
|
83
|
+
// false and this is a no-op.
|
|
84
|
+
if (context.isRunningPerformanceTrace()) {
|
|
85
|
+
try {
|
|
86
|
+
await page.pptrPage.tracing.stop();
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
// Tracing may not have started yet; ignore.
|
|
90
|
+
}
|
|
91
|
+
context.setIsRunningPerformanceTrace(false);
|
|
92
|
+
}
|
|
93
|
+
throw error;
|
|
85
94
|
}
|
|
86
95
|
},
|
|
87
96
|
});
|
|
88
97
|
export const stopTrace = definePageTool({
|
|
89
98
|
name: 'performance_stop_trace',
|
|
90
|
-
description: 'Stop the active performance trace recording on the
|
|
99
|
+
description: 'Stop the active performance trace recording on the target webpage.',
|
|
91
100
|
annotations: {
|
|
92
101
|
category: ToolCategory.PERFORMANCE,
|
|
93
102
|
readOnlyHint: false,
|
|
@@ -96,7 +105,9 @@ export const stopTrace = definePageTool({
|
|
|
96
105
|
filePath: filePathSchema,
|
|
97
106
|
},
|
|
98
107
|
blockedByDialog: true,
|
|
99
|
-
verifyFilesSchema:
|
|
108
|
+
verifyFilesSchema: {
|
|
109
|
+
filePath: true,
|
|
110
|
+
},
|
|
100
111
|
handler: async (request, response, context) => {
|
|
101
112
|
if (!context.isRunningPerformanceTrace()) {
|
|
102
113
|
return;
|
|
@@ -121,7 +132,7 @@ export const analyzeInsight = definePageTool({
|
|
|
121
132
|
.describe('The name of the Insight you want more information on. For example: "DocumentLatency" or "LCPBreakdown"'),
|
|
122
133
|
},
|
|
123
134
|
blockedByDialog: false,
|
|
124
|
-
verifyFilesSchema:
|
|
135
|
+
verifyFilesSchema: {},
|
|
125
136
|
handler: async (request, response, context) => {
|
|
126
137
|
const lastRecording = context.recordedTraces().at(-1);
|
|
127
138
|
if (!lastRecording) {
|