@chenpx976/chrome-devtools-mcp 0.0.0-stage → 1.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +202 -0
- package/README.md +223 -2
- package/out/Default/gen/src/ArcBrowser.js +128 -0
- package/out/Default/gen/src/BrowserManager.js +562 -0
- package/out/Default/gen/src/LogpointManager.js +287 -0
- package/out/Default/gen/src/McpContext.js +1031 -0
- package/out/Default/gen/src/McpPage.js +1427 -0
- package/out/Default/gen/src/McpResponse.js +1350 -0
- package/out/Default/gen/src/McpWorker.js +66 -0
- package/out/Default/gen/src/NetworkOverrideManager.js +447 -0
- package/out/Default/gen/src/SlimMcpResponse.js +23 -0
- package/out/Default/gen/src/TextSnapshot.js +336 -0
- package/out/Default/gen/src/ToolHandler.js +531 -0
- package/out/Default/gen/src/bin/check-latest-version.js +53 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp-main.js +80 -0
- package/out/Default/gen/src/bin/chrome-devtools-mcp.js +23 -0
- package/out/Default/gen/src/bin/chrome-devtools.js +213 -0
- package/out/Default/gen/src/collectors/PageCollector.js +325 -0
- package/out/Default/gen/src/collectors/ServiceWorkerCollector.js +198 -0
- package/out/Default/gen/src/collectors/constants.js +7 -0
- package/out/Default/gen/src/config/ConfigLocator.js +70 -0
- package/out/Default/gen/src/config/ConfigParser.js +163 -0
- package/out/Default/gen/src/config/ConfigWatcher.js +94 -0
- package/out/Default/gen/src/config/ServerConfig.js +284 -0
- package/out/Default/gen/src/config/browser-options.js +135 -0
- package/out/Default/gen/src/config/category-options.js +84 -0
- package/out/Default/gen/src/config/cli-commands.js +208 -0
- package/out/Default/gen/src/config/cli-options.js +2090 -0
- package/out/Default/gen/src/config/mcp-options.js +371 -0
- package/out/Default/gen/src/config/puppeteer-options.js +69 -0
- package/out/Default/gen/src/config/tool-options.js +60 -0
- package/out/Default/gen/src/daemon/client.js +281 -0
- package/out/Default/gen/src/daemon/daemon.js +280 -0
- package/out/Default/gen/src/daemon/types.js +7 -0
- package/out/Default/gen/src/daemon/utils.js +173 -0
- package/out/Default/gen/src/devtools/DevToolsCommentBridge.js +151 -0
- package/out/Default/gen/src/devtools/DevtoolsUtils.js +413 -0
- package/out/Default/gen/src/devtools/McpHostBindingAdapter.js +164 -0
- package/out/Default/gen/src/devtools/issueDescriptions.js +42 -0
- package/out/Default/gen/src/formatters/CommentFormatter.js +73 -0
- package/out/Default/gen/src/formatters/ConsoleFormatter.js +363 -0
- package/out/Default/gen/src/formatters/CssFormatter.js +883 -0
- package/out/Default/gen/src/formatters/HeapSnapshotFormatter.js +239 -0
- package/out/Default/gen/src/formatters/IssueFormatter.js +194 -0
- package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
- package/out/Default/gen/src/formatters/NetworkFormatter.js +295 -0
- package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +57 -0
- package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
- package/out/Default/gen/src/formatters/SnapshotFormatter.js +172 -0
- package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
- package/out/Default/gen/src/formatters/constants.js +8 -0
- package/out/Default/gen/src/index.js +434 -0
- package/out/Default/gen/src/processors/ChunkedTraceParser.js +361 -0
- package/out/Default/gen/src/processors/HeapSnapshotManager.js +595 -0
- package/out/Default/gen/src/processors/PerformanceTrace.js +132 -0
- package/out/Default/gen/src/telemetry/ClearcutLogger.js +271 -0
- package/out/Default/gen/src/telemetry/WatchdogClient.js +60 -0
- package/out/Default/gen/src/telemetry/errors.js +18 -0
- package/out/Default/gen/src/telemetry/flagUtils.js +89 -0
- package/out/Default/gen/src/telemetry/metricsRegistry.js +85 -0
- package/out/Default/gen/src/telemetry/persistence.js +82 -0
- package/out/Default/gen/src/telemetry/transformation.js +229 -0
- package/out/Default/gen/src/telemetry/types.js +36 -0
- package/out/Default/gen/src/telemetry/watchdog/ClearcutSender.js +213 -0
- package/out/Default/gen/src/telemetry/watchdog/main.js +142 -0
- package/out/Default/gen/src/third_party/THIRD_PARTY_NOTICES +3774 -0
- package/out/Default/gen/src/third_party/browser.js +808 -0
- package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
- package/out/Default/gen/src/third_party/cli.js +139 -0
- package/out/Default/gen/src/third_party/devtools-formatter-worker.js +125 -0
- package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +111 -0
- package/out/Default/gen/src/third_party/index.js +128 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +18 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/LowTextContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/bounceTrackingMitigations.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +26 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +21 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisabledScheme.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsDisallowedByMode.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +19 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsOriginMismatch.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspEvalViolation.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspInlineViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/cspURLViolation.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/deprecation.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelForNameError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/heavyAd.md +10 -0
- package/out/Default/gen/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/mixedContent.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +9 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidType.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementLowContrast.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/propertyRuleIssue.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedArrayBuffer.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +1 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +7 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +13 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +8 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +5 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +6 -0
- package/out/Default/gen/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +11 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetLateImport.md +4 -0
- package/out/Default/gen/src/third_party/issue-descriptions/stylesheetRequestFailed.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +12 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +17 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +14 -0
- package/out/Default/gen/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +15 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingId.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallNoManifest.md +3 -0
- package/out/Default/gen/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +3 -0
- package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
- package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
- package/out/Default/gen/src/tools/categories.js +37 -0
- package/out/Default/gen/src/tools/comments.js +230 -0
- package/out/Default/gen/src/tools/console.js +122 -0
- package/out/Default/gen/src/tools/css.js +54 -0
- package/out/Default/gen/src/tools/emulation.js +98 -0
- package/out/Default/gen/src/tools/extensions.js +108 -0
- package/out/Default/gen/src/tools/input.js +658 -0
- package/out/Default/gen/src/tools/lighthouse.js +279 -0
- package/out/Default/gen/src/tools/logpoints.js +51 -0
- package/out/Default/gen/src/tools/memory.js +531 -0
- package/out/Default/gen/src/tools/network.js +325 -0
- package/out/Default/gen/src/tools/pages.js +420 -0
- package/out/Default/gen/src/tools/performance.js +258 -0
- package/out/Default/gen/src/tools/pwa.js +152 -0
- package/out/Default/gen/src/tools/screencast.js +160 -0
- package/out/Default/gen/src/tools/screenshot.js +315 -0
- package/out/Default/gen/src/tools/script.js +319 -0
- package/out/Default/gen/src/tools/slim/tools.js +110 -0
- package/out/Default/gen/src/tools/snapshot.js +88 -0
- package/out/Default/gen/src/tools/thirdPartyDeveloper.js +73 -0
- package/out/Default/gen/src/tools/toolNames.js +10 -0
- package/out/Default/gen/src/tools/tools.js +72 -0
- package/out/Default/gen/src/tools/webauthn.js +51 -0
- package/out/Default/gen/src/tools/webmcp.js +55 -0
- package/out/Default/gen/src/types.js +21 -0
- package/out/Default/gen/src/utils/TaskRunner.js +151 -0
- package/out/Default/gen/src/utils/WaitForHelper.js +343 -0
- package/out/Default/gen/src/utils/bytes.js +95 -0
- package/out/Default/gen/src/utils/check-for-updates.js +81 -0
- package/out/Default/gen/src/utils/disclaimers.js +27 -0
- package/out/Default/gen/src/utils/errorHandling.js +23 -0
- package/out/Default/gen/src/utils/files.js +81 -0
- package/out/Default/gen/src/utils/id.js +16 -0
- package/out/Default/gen/src/utils/keyboard.js +307 -0
- package/out/Default/gen/src/utils/logger.js +145 -0
- package/out/Default/gen/src/utils/logpoint.js +44 -0
- package/out/Default/gen/src/utils/network.js +81 -0
- package/out/Default/gen/src/utils/pagination.js +50 -0
- package/out/Default/gen/src/utils/polyfill.js +11 -0
- package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
- package/out/Default/gen/src/utils/resourceType.js +27 -0
- package/out/Default/gen/src/utils/text.js +43 -0
- package/out/Default/gen/src/utils/timeout.js +14 -0
- package/out/Default/gen/src/utils/url.js +311 -0
- package/out/Default/gen/src/version.js +11 -0
- package/package.json +125 -4
- package/skills/a11y-debugging/SKILL.md +86 -0
- package/skills/a11y-debugging/references/a11y-snippets.md +92 -0
- package/skills/arc-compatibility/SKILL.md +168 -0
- package/skills/arc-compatibility/SOURCES.md +216 -0
- package/skills/arc-compatibility/references/compatibility.md +113 -0
- package/skills/arc-compatibility/references/output-contract.md +62 -0
- package/skills/arc-compatibility/references/workflows.md +105 -0
- package/skills/chrome-devtools/SKILL.md +80 -0
- package/skills/chrome-devtools-cli/SKILL.md +208 -0
- package/skills/chrome-devtools-cli/references/installation.md +24 -0
- package/skills/cookie-debugging/SKILL.md +152 -0
- package/skills/debug-optimize-lcp/SKILL.md +121 -0
- package/skills/debug-optimize-lcp/references/elements-and-size.md +27 -0
- package/skills/debug-optimize-lcp/references/lcp-breakdown.md +23 -0
- package/skills/debug-optimize-lcp/references/lcp-snippets.md +79 -0
- package/skills/debug-optimize-lcp/references/optimization-strategies.md +38 -0
- package/skills/inspect-in-devtools/SKILL.md +82 -0
- package/skills/memory-leak-debugging/SKILL.md +58 -0
- package/skills/memory-leak-debugging/references/common-leaks.md +33 -0
- package/skills/troubleshooting/SKILL.md +107 -0
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import fs from 'node:fs';
|
|
7
|
+
import util from 'node:util';
|
|
8
|
+
const mcpDebugNamespace = 'mcp:log';
|
|
9
|
+
let logFileStream;
|
|
10
|
+
const debugLog = util.debuglog(mcpDebugNamespace);
|
|
11
|
+
export function saveLogsToFile(fileName) {
|
|
12
|
+
const logFile = fs.createWriteStream(fileName, { flags: 'a+' });
|
|
13
|
+
logFile.on('error', function (error) {
|
|
14
|
+
console.error(`Error when opening/writing to log file: ${error.message}`);
|
|
15
|
+
logFile.end();
|
|
16
|
+
process.exit(1);
|
|
17
|
+
});
|
|
18
|
+
logFileStream = logFile;
|
|
19
|
+
return logFile;
|
|
20
|
+
}
|
|
21
|
+
export function flushLogs(logFile, timeoutMs = 2000) {
|
|
22
|
+
return new Promise((resolve, reject) => {
|
|
23
|
+
const timeout = setTimeout(reject, timeoutMs);
|
|
24
|
+
logFile.end(() => {
|
|
25
|
+
clearTimeout(timeout);
|
|
26
|
+
resolve();
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Removes terminal control sequences from untrusted text before it reaches a
|
|
32
|
+
* TTY. Strips CSI sequences (ESC [ ... final-byte), OSC sequences (ESC ] ...
|
|
33
|
+
* terminated by BEL or ST, with payloads), and any remaining C0/C1 controls
|
|
34
|
+
* except \n. An unterminated OSC affects only its own line. Used for output
|
|
35
|
+
* lines that interpolate tool-response text, which may contain
|
|
36
|
+
* page-controlled strings.
|
|
37
|
+
*/
|
|
38
|
+
export function stripTerminalEscapes(value) {
|
|
39
|
+
return value
|
|
40
|
+
.replace(/\x1b\[[\x30-\x3f\x20-\x2f]*[\x40-\x7e]/g, '')
|
|
41
|
+
.replace(/\x1b\][^\x07\x1b\r\n]*(?:\x07|\x1b\\)/g, '')
|
|
42
|
+
.replace(/[\x00-\x08\x0b\x0c\x0e-\x1f\x7f-\x9f]/g, '');
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Encodes a value for interpolation into a one-line log or error message. The
|
|
46
|
+
* result is a JSON string literal that also escapes DEL, C1 controls and
|
|
47
|
+
* U+2028/U+2029, which JSON.stringify leaves raw but terminals and line
|
|
48
|
+
* readers act on.
|
|
49
|
+
*/
|
|
50
|
+
export function escapeForLog(value) {
|
|
51
|
+
return JSON.stringify(value).replace(/[\u007f-\u009f\u2028\u2029]/g, char => `\\u${char.charCodeAt(0).toString(16).padStart(4, '0')}`);
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Redact credentials from URLs used in connection and diagnostic logs.
|
|
55
|
+
* The URL passed to Puppeteer is never modified.
|
|
56
|
+
*/
|
|
57
|
+
export function redactUrlForLogging(value) {
|
|
58
|
+
try {
|
|
59
|
+
const url = new URL(value);
|
|
60
|
+
url.username = '';
|
|
61
|
+
url.password = '';
|
|
62
|
+
if (url.search) {
|
|
63
|
+
url.search = '?REDACTED';
|
|
64
|
+
}
|
|
65
|
+
return url.toString();
|
|
66
|
+
}
|
|
67
|
+
catch {
|
|
68
|
+
// Unparseable URLs might still contain credentials. Fail closed.
|
|
69
|
+
return '[REDACTED]';
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Return a redacted copy of the Puppeteer connection options for logging.
|
|
74
|
+
* Keep the actual headers and connection URLs intact for Puppeteer.
|
|
75
|
+
*/
|
|
76
|
+
export function redactConnectOptionsForLogging(options) {
|
|
77
|
+
return {
|
|
78
|
+
...options,
|
|
79
|
+
...(options.headers
|
|
80
|
+
? {
|
|
81
|
+
headers: Object.fromEntries(Object.keys(options.headers).map(name => [name, '[REDACTED]'])),
|
|
82
|
+
}
|
|
83
|
+
: {}),
|
|
84
|
+
...(options.browserWSEndpoint
|
|
85
|
+
? { browserWSEndpoint: redactUrlForLogging(options.browserWSEndpoint) }
|
|
86
|
+
: {}),
|
|
87
|
+
...(options.browserURL
|
|
88
|
+
? { browserURL: redactUrlForLogging(options.browserURL) }
|
|
89
|
+
: {}),
|
|
90
|
+
};
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Filter sensitive CLI arguments in the daemon startup log only.
|
|
94
|
+
* Spawn still receives the original arguments unchanged.
|
|
95
|
+
*/
|
|
96
|
+
export function redactDaemonArgsForLogging(args) {
|
|
97
|
+
const headersFlag = /^--ws-?headers$/i;
|
|
98
|
+
const endpointFlag = /^--(?:ws-?endpoint|browser-?url)$/i;
|
|
99
|
+
return args.map((arg, index) => {
|
|
100
|
+
const previous = args[index - 1] ?? '';
|
|
101
|
+
if (headersFlag.test(previous)) {
|
|
102
|
+
return '[REDACTED]';
|
|
103
|
+
}
|
|
104
|
+
if (endpointFlag.test(previous)) {
|
|
105
|
+
return redactUrlForLogging(arg);
|
|
106
|
+
}
|
|
107
|
+
const equalsAt = arg.indexOf('=');
|
|
108
|
+
if (equalsAt === -1) {
|
|
109
|
+
return arg;
|
|
110
|
+
}
|
|
111
|
+
const flag = arg.slice(0, equalsAt);
|
|
112
|
+
const value = arg.slice(equalsAt + 1);
|
|
113
|
+
if (headersFlag.test(flag)) {
|
|
114
|
+
return `${flag}=[REDACTED]`;
|
|
115
|
+
}
|
|
116
|
+
if (endpointFlag.test(flag)) {
|
|
117
|
+
return `${flag}=${redactUrlForLogging(value)}`;
|
|
118
|
+
}
|
|
119
|
+
return arg;
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
export const logger = (...args) => {
|
|
123
|
+
if (logFileStream) {
|
|
124
|
+
logFileStream.write(`${new Date().toISOString()} ${mcpDebugNamespace} ${util.format(...args)}\n`);
|
|
125
|
+
}
|
|
126
|
+
else if (debugLog.enabled) {
|
|
127
|
+
debugLog('%s %s', new Date().toISOString(), util.format(...args));
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
export const puppeteerLogger = (prefix) => {
|
|
131
|
+
const dbg = util.debuglog(prefix);
|
|
132
|
+
if (!dbg.enabled) {
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const stream = logFileStream;
|
|
136
|
+
if (stream) {
|
|
137
|
+
return (...args) => {
|
|
138
|
+
stream.write(`${new Date().toISOString()} ${prefix} ${util.format(...args)}\n`);
|
|
139
|
+
};
|
|
140
|
+
}
|
|
141
|
+
return (...args) => {
|
|
142
|
+
dbg('%s %s', new Date().toISOString(), util.format(...args));
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Thrown by {@link LogpointManager.setLogpoints} when some locations could
|
|
8
|
+
* not be bound. The other logpoints were applied; `logpoints` holds the
|
|
9
|
+
* resulting state.
|
|
10
|
+
*/
|
|
11
|
+
export class LogpointError extends Error {
|
|
12
|
+
logpoints;
|
|
13
|
+
constructor(message, logpoints) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'LogpointError';
|
|
16
|
+
this.logpoints = logpoints;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export const LOGPOINT_FORMAT = '<url>:<lineNumber>[:<columnNumber>] <expression>';
|
|
20
|
+
/**
|
|
21
|
+
* Parses a logpoint given as `<url>:<lineNumber>[:<columnNumber>] <expression>`.
|
|
22
|
+
* The url may itself contain colons (for example a port), so the location is
|
|
23
|
+
* the shortest prefix that ends in one or two numbers followed by whitespace.
|
|
24
|
+
*/
|
|
25
|
+
export function parseLogpoint(text) {
|
|
26
|
+
const match = /^(\S+?):(\d+)(?::(\d+))?\s+(\S.*)$/s.exec(text.trim());
|
|
27
|
+
if (!match) {
|
|
28
|
+
throw new Error(`Invalid logpoint "${text}". Expected the format ${LOGPOINT_FORMAT}, for example "src/app.ts:42 'total', cart.total".`);
|
|
29
|
+
}
|
|
30
|
+
const [, url, lineNumber, columnNumber, expression] = match;
|
|
31
|
+
const logpoint = {
|
|
32
|
+
url,
|
|
33
|
+
lineNumber: Number(lineNumber),
|
|
34
|
+
expression,
|
|
35
|
+
};
|
|
36
|
+
if (columnNumber !== undefined) {
|
|
37
|
+
logpoint.columnNumber = Number(columnNumber);
|
|
38
|
+
}
|
|
39
|
+
if (logpoint.lineNumber < 1 || logpoint.columnNumber === 0) {
|
|
40
|
+
throw new Error(`Invalid logpoint "${text}": line and column numbers are 1-based.`);
|
|
41
|
+
}
|
|
42
|
+
return logpoint;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=logpoint.js.map
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { URLPattern } from '../third_party/cli.js';
|
|
7
|
+
import { redactUrlForLogging } from './logger.js';
|
|
8
|
+
const CROSS_ORIGIN_REDIRECT_HEADERS = new Set([
|
|
9
|
+
'accept',
|
|
10
|
+
'accept-language',
|
|
11
|
+
'cache-control',
|
|
12
|
+
'origin',
|
|
13
|
+
'pragma',
|
|
14
|
+
'range',
|
|
15
|
+
'user-agent',
|
|
16
|
+
]);
|
|
17
|
+
export function getRedirectHeaders(sourceUrl, targetUrl, originalHeaders) {
|
|
18
|
+
const sameOrigin = sourceUrl.origin === targetUrl.origin;
|
|
19
|
+
const headers = {};
|
|
20
|
+
for (const [name, value] of Object.entries(originalHeaders)) {
|
|
21
|
+
const lowerName = name.toLowerCase();
|
|
22
|
+
if (lowerName === 'accept-encoding') {
|
|
23
|
+
continue;
|
|
24
|
+
}
|
|
25
|
+
if (sameOrigin || CROSS_ORIGIN_REDIRECT_HEADERS.has(lowerName)) {
|
|
26
|
+
headers[name] = value;
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return headers;
|
|
30
|
+
}
|
|
31
|
+
export function validateUrlNotBlocked(url, blocklist) {
|
|
32
|
+
for (const block of blocklist ?? []) {
|
|
33
|
+
if (new URLPattern(block).test(url)) {
|
|
34
|
+
throw new Error('Blocked by blocklist: ' + redactUrlForLogging(url.href));
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
export function validateNetworkUrl(url, policy) {
|
|
39
|
+
if (url.protocol !== 'https:' && url.protocol !== 'http:') {
|
|
40
|
+
throw new Error('Unsupported URL protocol: ' + url.protocol);
|
|
41
|
+
}
|
|
42
|
+
validateUrlNotBlocked(url, policy.blockedUrlPattern);
|
|
43
|
+
if (policy.allowedUrlPattern &&
|
|
44
|
+
!policy.allowedUrlPattern.some(allow => new URLPattern(allow).test(url))) {
|
|
45
|
+
throw new Error('Not allowed by allowlist: ' + redactUrlForLogging(url.href));
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export async function fetchWithValidatedRedirects(url, options) {
|
|
49
|
+
const redirectStatuses = new Set([301, 302, 303, 307, 308]);
|
|
50
|
+
const maxRedirects = 20;
|
|
51
|
+
let currentUrl = url;
|
|
52
|
+
let headers = options.headers
|
|
53
|
+
? Object.fromEntries(new Headers(options.headers))
|
|
54
|
+
: undefined;
|
|
55
|
+
for (let redirectCount = 0;; redirectCount++) {
|
|
56
|
+
validateNetworkUrl(currentUrl, options.policy);
|
|
57
|
+
const response = await fetch(currentUrl, {
|
|
58
|
+
redirect: 'manual',
|
|
59
|
+
...(options.method ? { method: options.method } : {}),
|
|
60
|
+
...(headers ? { headers } : {}),
|
|
61
|
+
});
|
|
62
|
+
if (!redirectStatuses.has(response.status)) {
|
|
63
|
+
return response;
|
|
64
|
+
}
|
|
65
|
+
const location = response.headers.get('location');
|
|
66
|
+
await response.body?.cancel();
|
|
67
|
+
if (!location) {
|
|
68
|
+
throw new Error('Redirect has no Location header: ' +
|
|
69
|
+
redactUrlForLogging(currentUrl.href));
|
|
70
|
+
}
|
|
71
|
+
if (redirectCount >= maxRedirects) {
|
|
72
|
+
throw new Error('Too many redirects loading resource: ' + redactUrlForLogging(url.href));
|
|
73
|
+
}
|
|
74
|
+
const nextUrl = new URL(location, currentUrl);
|
|
75
|
+
if (headers) {
|
|
76
|
+
headers = getRedirectHeaders(currentUrl, nextUrl, headers);
|
|
77
|
+
}
|
|
78
|
+
currentUrl = nextUrl;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=network.js.map
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
const DEFAULT_PAGE_SIZE = 20;
|
|
7
|
+
export function paginate(items, options) {
|
|
8
|
+
const total = items.length;
|
|
9
|
+
if (!options || noPaginationOptions(options)) {
|
|
10
|
+
return {
|
|
11
|
+
items,
|
|
12
|
+
currentPage: 0,
|
|
13
|
+
totalPages: 1,
|
|
14
|
+
hasNextPage: false,
|
|
15
|
+
hasPreviousPage: false,
|
|
16
|
+
startIndex: 0,
|
|
17
|
+
endIndex: total,
|
|
18
|
+
invalidPage: false,
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
const pageSize = options.pageSize ?? DEFAULT_PAGE_SIZE;
|
|
22
|
+
const totalPages = Math.max(1, Math.ceil(total / pageSize));
|
|
23
|
+
const { currentPage, invalidPage } = resolvePageIndex(options.pageIdx, totalPages);
|
|
24
|
+
const startIndex = currentPage * pageSize;
|
|
25
|
+
const pageItems = items.slice(startIndex, startIndex + pageSize);
|
|
26
|
+
const endIndex = startIndex + pageItems.length;
|
|
27
|
+
return {
|
|
28
|
+
items: pageItems,
|
|
29
|
+
currentPage,
|
|
30
|
+
totalPages,
|
|
31
|
+
hasNextPage: currentPage < totalPages - 1,
|
|
32
|
+
hasPreviousPage: currentPage > 0,
|
|
33
|
+
startIndex,
|
|
34
|
+
endIndex,
|
|
35
|
+
invalidPage,
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
function noPaginationOptions(options) {
|
|
39
|
+
return options.pageSize === undefined && options.pageIdx === undefined;
|
|
40
|
+
}
|
|
41
|
+
function resolvePageIndex(pageIdx, totalPages) {
|
|
42
|
+
if (pageIdx === undefined) {
|
|
43
|
+
return { currentPage: 0, invalidPage: false };
|
|
44
|
+
}
|
|
45
|
+
if (pageIdx < 0 || pageIdx >= totalPages) {
|
|
46
|
+
return { currentPage: 0, invalidPage: true };
|
|
47
|
+
}
|
|
48
|
+
return { currentPage: pageIdx, invalidPage: false };
|
|
49
|
+
}
|
|
50
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2025 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { DisposableStack, AsyncDisposableStack, SuppressedError, } from '../third_party/index.js';
|
|
7
|
+
globalThis.DisposableStack ??= DisposableStack;
|
|
8
|
+
globalThis.AsyncDisposableStack ??= AsyncDisposableStack;
|
|
9
|
+
// @ts-expect-error Type mismatch between puppeteer-core and node for SuppressedError.
|
|
10
|
+
globalThis.SuppressedError ??= SuppressedError;
|
|
11
|
+
//# sourceMappingURL=polyfill.js.map
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
export function raceWithSignal(promise, signal) {
|
|
7
|
+
return new Promise((resolve, reject) => {
|
|
8
|
+
const onAbort = () => {
|
|
9
|
+
reject(signal.reason);
|
|
10
|
+
};
|
|
11
|
+
if (signal.aborted) {
|
|
12
|
+
onAbort();
|
|
13
|
+
}
|
|
14
|
+
else {
|
|
15
|
+
signal.addEventListener('abort', onAbort, { once: true });
|
|
16
|
+
}
|
|
17
|
+
Promise.resolve(promise).then(value => {
|
|
18
|
+
signal.removeEventListener('abort', onAbort);
|
|
19
|
+
resolve(value);
|
|
20
|
+
}, error => {
|
|
21
|
+
signal.removeEventListener('abort', onAbort);
|
|
22
|
+
reject(error);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}
|
|
26
|
+
//# sourceMappingURL=raceWithSignal.js.map
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* The resource type a request is filtered by. Chrome reports CORS preflights
|
|
8
|
+
* and `<link rel=prefetch>` requests as `Other`, so `resourceTypes: ['preflight']`
|
|
9
|
+
* and `['prefetch']` could never match. Those two are recognised from the
|
|
10
|
+
* headers Chrome sends with them; every other type is Chrome's own.
|
|
11
|
+
*/
|
|
12
|
+
export function getFilterableResourceType(request) {
|
|
13
|
+
const type = request.resourceType();
|
|
14
|
+
if (type !== 'other') {
|
|
15
|
+
return type;
|
|
16
|
+
}
|
|
17
|
+
const headers = request.headers();
|
|
18
|
+
if (request.method() === 'OPTIONS' &&
|
|
19
|
+
headers['access-control-request-method'] !== undefined) {
|
|
20
|
+
return 'preflight';
|
|
21
|
+
}
|
|
22
|
+
if (/^prefetch\b/i.test(headers['sec-purpose'] ?? '')) {
|
|
23
|
+
return 'prefetch';
|
|
24
|
+
}
|
|
25
|
+
return type;
|
|
26
|
+
}
|
|
27
|
+
//# sourceMappingURL=resourceType.js.map
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { StringUtilities } from '../third_party/index.js';
|
|
7
|
+
const VALID_PLACEHOLDER_MATCH_PATTERN = /\{(PLACEHOLDER_[a-zA-Z][a-zA-Z0-9_]*)\}/g;
|
|
8
|
+
export function substitutePlaceholders(rawMarkdown, substitutions) {
|
|
9
|
+
if (!substitutions) {
|
|
10
|
+
return rawMarkdown;
|
|
11
|
+
}
|
|
12
|
+
return rawMarkdown.replace(VALID_PLACEHOLDER_MATCH_PATTERN, (_, placeholder) => {
|
|
13
|
+
return substitutions.get(placeholder) ?? '';
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Truncates `text` to at most `maxLength` UTF-16 code units and appends
|
|
18
|
+
* `ellipsis` when anything was cut off. The cut uses devtools-frontend's
|
|
19
|
+
* `StringUtilities.truncateToCodeUnitLength`, which moves back to the last
|
|
20
|
+
* grapheme boundary at or before the limit, so surrogate pairs and emoji
|
|
21
|
+
* sequences stay whole and the result never contains a lone surrogate, which
|
|
22
|
+
* `JSON.stringify` serializes as an escape like `\ud83d` that strict JSON
|
|
23
|
+
* parsers (such as the one the Python MCP SDK uses) reject.
|
|
24
|
+
*
|
|
25
|
+
* With `includeEllipsisInLength`, the ellipsis counts toward `maxLength`.
|
|
26
|
+
*/
|
|
27
|
+
export function truncateText(text, maxLength, { ellipsis = '...', includeEllipsisInLength = false, } = {}) {
|
|
28
|
+
if (text.length <= maxLength) {
|
|
29
|
+
return text;
|
|
30
|
+
}
|
|
31
|
+
const keep = includeEllipsisInLength
|
|
32
|
+
? Math.max(0, maxLength - ellipsis.length)
|
|
33
|
+
: maxLength;
|
|
34
|
+
return StringUtilities.truncateToCodeUnitLength(text, keep) + ellipsis;
|
|
35
|
+
}
|
|
36
|
+
const URL_SIZE_LIMIT = 255;
|
|
37
|
+
/**
|
|
38
|
+
* Truncates a URL for tool output, such as a `data:` URL with a base64 payload.
|
|
39
|
+
*/
|
|
40
|
+
export function truncateUrl(url) {
|
|
41
|
+
return truncateText(url, URL_SIZE_LIMIT, { ellipsis: '... <truncated>' });
|
|
42
|
+
}
|
|
43
|
+
//# sourceMappingURL=text.js.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright 2026 Google LLC
|
|
4
|
+
* SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
*/
|
|
6
|
+
import { Deferred } from '../third_party/browser.js';
|
|
7
|
+
/**
|
|
8
|
+
* Rejects with a Puppeteer `TimeoutError` with `message` if `promise` does not
|
|
9
|
+
* settle within `timeout` ms. The timer is cleared when the race settles.
|
|
10
|
+
*/
|
|
11
|
+
export async function withTimeout(promise, options) {
|
|
12
|
+
return await Deferred.race([promise, Deferred.create(options)]);
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=timeout.js.map
|