chrome-devtools-mcp 1.12.0 → 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.
Files changed (381) hide show
  1. package/README.md +1 -1
  2. package/{build → out/Default/gen}/src/BrowserManager.js +22 -0
  3. package/out/Default/gen/src/LogpointManager.js +307 -0
  4. package/{build → out/Default/gen}/src/McpContext.js +10 -52
  5. package/{build → out/Default/gen}/src/McpPage.js +181 -2
  6. package/{build → out/Default/gen}/src/McpResponse.js +29 -3
  7. package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
  8. package/{build → out/Default/gen}/src/ToolHandler.js +53 -22
  9. package/{build → out/Default/gen}/src/collectors/PageCollector.js +15 -3
  10. package/{build → out/Default/gen}/src/config/ConfigParser.js +4 -1
  11. package/{build → out/Default/gen}/src/config/category-options.js +10 -0
  12. package/{build → out/Default/gen}/src/config/cli-options.js +188 -3
  13. package/{build → out/Default/gen}/src/config/mcp-options.js +1 -1
  14. package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +45 -8
  15. package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
  16. package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +16 -2
  17. package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
  18. package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
  19. package/{build → out/Default/gen}/src/index.js +2 -1
  20. package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
  21. package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +354 -367
  22. package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
  23. package/out/Default/gen/src/third_party/cli.js +9023 -0
  24. package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
  25. package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
  26. package/out/Default/gen/src/third_party/index.js +201574 -0
  27. package/{build → out/Default/gen}/src/third_party/lighthouse-devtools-mcp-bundle.js +11034 -11476
  28. package/{build → out/Default/gen}/src/tools/ToolDefinition.js +66 -56
  29. package/{build → out/Default/gen}/src/tools/categories.js +4 -0
  30. package/{build → out/Default/gen}/src/tools/comments.js +4 -1
  31. package/{build → out/Default/gen}/src/tools/console.js +2 -2
  32. package/{build → out/Default/gen}/src/tools/extensions.js +1 -1
  33. package/{build → out/Default/gen}/src/tools/input.js +9 -29
  34. package/{build → out/Default/gen}/src/tools/lighthouse.js +6 -0
  35. package/out/Default/gen/src/tools/logpoints.js +51 -0
  36. package/out/Default/gen/src/tools/network.js +260 -0
  37. package/{build → out/Default/gen}/src/tools/performance.js +26 -3
  38. package/{build → out/Default/gen}/src/tools/snapshot.js +20 -6
  39. package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +3 -19
  40. package/out/Default/gen/src/tools/toolNames.js +10 -0
  41. package/{build → out/Default/gen}/src/tools/tools.js +4 -0
  42. package/out/Default/gen/src/tools/webauthn.js +51 -0
  43. package/{build → out/Default/gen}/src/tools/webmcp.js +3 -19
  44. package/{build → out/Default/gen}/src/utils/TaskRunner.js +31 -16
  45. package/{build → out/Default/gen}/src/utils/WaitForHelper.js +15 -1
  46. package/{build → out/Default/gen}/src/utils/check-for-updates.js +7 -1
  47. package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
  48. package/{build → out/Default/gen}/src/utils/keyboard.js +5 -7
  49. package/out/Default/gen/src/utils/network.js +81 -0
  50. package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
  51. package/{build → out/Default/gen}/src/utils/url.js +33 -18
  52. package/{build → out/Default/gen}/src/version.js +1 -1
  53. package/package.json +25 -32
  54. package/skills/chrome-devtools/SKILL.md +2 -0
  55. package/skills/chrome-devtools-cli/SKILL.md +12 -1
  56. package/build/src/third_party/bundled-packages.json +0 -11
  57. package/build/src/third_party/cli.js +0 -9239
  58. package/build/src/third_party/devtools-formatter-worker.js +0 -17276
  59. package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12255
  60. package/build/src/third_party/index.js +0 -186086
  61. package/build/src/tools/network.js +0 -129
  62. /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
  63. /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
  64. /package/{build → out/Default/gen}/src/TextSnapshot.js +0 -0
  65. /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
  66. /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +0 -0
  67. /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
  68. /package/{build → out/Default/gen}/src/bin/chrome-devtools.js +0 -0
  69. /package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +0 -0
  70. /package/{build → out/Default/gen}/src/collectors/constants.js +0 -0
  71. /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
  72. /package/{build → out/Default/gen}/src/config/ConfigWatcher.js +0 -0
  73. /package/{build → out/Default/gen}/src/config/ServerConfig.js +0 -0
  74. /package/{build → out/Default/gen}/src/config/browser-options.js +0 -0
  75. /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
  76. /package/{build → out/Default/gen}/src/config/puppeteer-options.js +0 -0
  77. /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
  78. /package/{build → out/Default/gen}/src/daemon/client.js +0 -0
  79. /package/{build → out/Default/gen}/src/daemon/daemon.js +0 -0
  80. /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
  81. /package/{build → out/Default/gen}/src/daemon/utils.js +0 -0
  82. /package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +0 -0
  83. /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
  84. /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
  85. /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
  86. /package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +0 -0
  87. /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
  88. /package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +0 -0
  89. /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
  90. /package/{build → out/Default/gen}/src/formatters/RemoteObjectFormatter.js +0 -0
  91. /package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +0 -0
  92. /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
  93. /package/{build → out/Default/gen}/src/processors/HeapSnapshotManager.js +0 -0
  94. /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
  95. /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
  96. /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
  97. /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
  98. /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
  99. /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
  100. /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
  101. /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
  102. /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
  103. /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
  104. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
  105. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
  106. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
  107. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
  108. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
  109. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
  110. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
  111. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
  112. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
  113. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
  114. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
  115. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
  116. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
  117. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
  118. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
  119. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
  120. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
  121. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
  122. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
  123. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
  124. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
  125. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
  126. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
  127. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
  128. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
  129. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
  130. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
  131. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
  132. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
  133. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
  134. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
  135. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
  136. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
  137. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
  138. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
  139. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
  140. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
  141. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
  142. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
  143. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
  144. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
  145. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
  146. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
  147. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
  148. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
  149. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
  150. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
  151. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
  152. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
  153. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
  154. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
  155. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
  156. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
  157. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
  158. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
  159. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
  160. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
  161. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
  162. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
  163. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
  164. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
  165. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
  166. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
  167. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
  168. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
  169. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
  170. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
  171. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
  172. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
  173. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
  174. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
  175. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
  176. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
  177. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
  178. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
  179. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
  180. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
  181. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
  182. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
  183. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
  184. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
  185. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
  186. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
  187. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
  188. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
  189. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
  190. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
  191. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
  192. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
  193. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
  194. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
  195. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
  196. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
  197. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
  198. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
  199. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
  200. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
  201. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
  202. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
  203. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
  204. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
  205. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
  206. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
  207. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
  208. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
  209. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
  210. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
  211. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
  212. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
  213. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
  214. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
  215. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
  216. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
  217. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
  218. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
  219. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
  220. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
  221. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
  222. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
  223. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
  224. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
  225. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
  226. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
  227. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
  228. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
  229. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
  230. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
  231. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
  232. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
  233. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
  234. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
  235. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
  236. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
  237. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
  238. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
  239. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
  240. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
  241. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
  242. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
  243. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
  244. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
  245. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
  246. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
  247. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
  248. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
  249. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
  250. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
  251. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
  252. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
  253. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
  254. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
  255. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
  256. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
  257. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
  258. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
  259. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
  260. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
  261. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
  262. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
  263. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
  264. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
  265. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
  266. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
  267. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
  268. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
  269. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
  270. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
  271. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
  272. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
  273. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
  274. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
  275. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
  276. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
  277. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
  278. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
  279. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
  280. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
  281. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
  282. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
  283. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
  284. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
  285. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
  286. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
  287. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
  288. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
  289. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
  290. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
  291. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
  292. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
  293. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
  294. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
  295. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
  296. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
  297. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
  298. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
  299. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
  300. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
  301. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
  302. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
  303. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
  304. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
  305. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
  306. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
  307. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
  308. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
  309. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
  310. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
  311. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
  312. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
  313. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
  314. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
  315. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
  316. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
  317. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
  318. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
  319. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
  320. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
  321. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
  322. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
  323. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
  324. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
  325. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
  326. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
  327. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
  328. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
  329. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
  330. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
  331. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
  332. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
  333. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
  334. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
  335. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
  336. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
  337. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
  338. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
  339. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
  340. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
  341. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
  342. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
  343. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
  344. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
  345. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
  346. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
  347. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
  348. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
  349. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
  350. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
  351. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
  352. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
  353. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
  354. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
  355. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
  356. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
  357. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
  358. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
  359. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
  360. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
  361. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
  362. /package/{build → out/Default/gen}/src/tools/css.js +0 -0
  363. /package/{build → out/Default/gen}/src/tools/emulation.js +0 -0
  364. /package/{build → out/Default/gen}/src/tools/memory.js +0 -0
  365. /package/{build → out/Default/gen}/src/tools/pages.js +0 -0
  366. /package/{build → out/Default/gen}/src/tools/pwa.js +0 -0
  367. /package/{build → out/Default/gen}/src/tools/screencast.js +0 -0
  368. /package/{build → out/Default/gen}/src/tools/screenshot.js +0 -0
  369. /package/{build → out/Default/gen}/src/tools/script.js +0 -0
  370. /package/{build → out/Default/gen}/src/tools/slim/tools.js +0 -0
  371. /package/{build → out/Default/gen}/src/types.js +0 -0
  372. /package/{build → out/Default/gen}/src/utils/bytes.js +0 -0
  373. /package/{build → out/Default/gen}/src/utils/disclaimers.js +0 -0
  374. /package/{build → out/Default/gen}/src/utils/files.js +0 -0
  375. /package/{build → out/Default/gen}/src/utils/id.js +0 -0
  376. /package/{build → out/Default/gen}/src/utils/logger.js +0 -0
  377. /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
  378. /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
  379. /package/{build → out/Default/gen}/src/utils/resourceType.js +0 -0
  380. /package/{build → out/Default/gen}/src/utils/text.js +0 -0
  381. /package/{build → out/Default/gen}/src/utils/timeout.js +0 -0
@@ -58,12 +58,13 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
58
58
  import { McpResponse } from './McpResponse.js';
59
59
  import { SlimMcpResponse } from './SlimMcpResponse.js';
60
60
  import { ClearcutLogger } from './telemetry/ClearcutLogger.js';
61
- import { ProtocolError, ProtocolErrorCode, zod, } from './third_party/index.js';
61
+ import { DisposableStack, ProtocolError, ProtocolErrorCode, zod, } from './third_party/index.js';
62
62
  import { labels } from './tools/categories.js';
63
63
  import { categoryToFlagName } from './config/category-options.js';
64
64
  import { isAvailableInMode, isBrowserlessTool, isPageScopedTool, isSlimTool, } from './tools/ToolDefinition.js';
65
- import { getErrorMessage } from './utils/errorHandling.js';
65
+ import { getErrorMessage, toError } from './utils/errorHandling.js';
66
66
  import { logger } from './utils/logger.js';
67
+ import { raceWithSignal } from './utils/raceWithSignal.js';
67
68
  import { fileURLToPath, pathToFileURL } from 'node:url';
68
69
  import { isDeepStrictEqual } from 'node:util';
69
70
  import { isLocalBrowserEndpoint } from './utils/url.js';
@@ -278,12 +279,13 @@ export class ToolHandler {
278
279
  !isDeepStrictEqual(toInputJsonSchema(previousInputSchema), toInputJsonSchema(nextInputSchema)));
279
280
  }
280
281
  /**
281
- * Races a promise against TOOL_CALL_TIMEOUT_MS, calling onTimeout() if the
282
- * timer wins. The loser of the race is left running — there is no way to
282
+ * Races a promise against TOOL_CALL_TIMEOUT_MS and signal abort, calling
283
+ * onTimeout() only if the timer wins, never on abort.
284
+ * The loser of the race is left running — there is no way to
283
285
  * cancel a pending connect/launch — but since nothing is left awaiting it,
284
286
  * it cannot block subsequent tool calls.
285
287
  */
286
- async #raceWithTimeout(promise, onTimeout) {
288
+ async #raceWithTimeout(promise, onTimeout, signal) {
287
289
  const timeoutError = new ToolCallTimeoutError(`Tool "${this.#tool.name}" timed out after ${TOOL_CALL_TIMEOUT_MS}ms waiting for the browser connection to be established. The connection attempt will be retried automatically on the next tool call.`);
288
290
  let timer;
289
291
  const timeout = new Promise((_, reject) => {
@@ -291,7 +293,7 @@ export class ToolHandler {
291
293
  timer.unref?.();
292
294
  });
293
295
  try {
294
- return await Promise.race([promise, timeout]);
296
+ return await raceWithSignal(Promise.race([promise, timeout]), signal);
295
297
  }
296
298
  catch (err) {
297
299
  if (err === timeoutError) {
@@ -313,24 +315,27 @@ export class ToolHandler {
313
315
  * Browserless tools never establish a browser connection, so they also never
314
316
  * wait for one under TOOL_CALL_TIMEOUT_MS.
315
317
  */
316
- async #runBrowserlessTool(tool, params, response, context) {
318
+ async #runBrowserlessTool(tool, params, response, context, signal) {
317
319
  try {
318
320
  await validateToolFiles(tool, params, context, true);
321
+ signal.throwIfAborted();
319
322
  await tool.handler({ params }, response, context);
320
323
  }
321
324
  catch (err) {
322
- response.setError(err);
325
+ signal.throwIfAborted();
326
+ response.setError(toError(err));
323
327
  }
328
+ signal.throwIfAborted();
324
329
  return await response.handle(context, this.#dataFormat(this.#config.resolved));
325
330
  }
326
- async #runBrowserTool(tool, params, response, context, onTelemetryData) {
331
+ async #runBrowserTool(tool, params, response, context, signal, onTelemetryData) {
327
332
  // ensureBrowser() has no cancellation mechanism, so this timeout only
328
333
  // stops us from waiting — the attempt itself keeps running abandoned.
329
334
  // abandonPendingBrowserAttemptOnTimeout() tells BrowserManager to
330
335
  // discard that attempt if it succeeds later instead of handing it to a
331
336
  // subsequent caller — see BrowserManager#abandonPendingAttempt()'s doc
332
337
  // comment for the full mechanism.
333
- const browser = await this.#raceWithTimeout(context.ensureBrowser(), () => this.abandonPendingBrowserAttemptOnTimeout());
338
+ const browser = await this.#raceWithTimeout(context.ensureBrowser(), () => this.abandonPendingBrowserAttemptOnTimeout(), signal);
334
339
  logger?.(`${tool.name} browser: resolved`);
335
340
  if (context.consumeReconnectNotice()) {
336
341
  response.setReconnectNotice();
@@ -338,6 +343,7 @@ export class ToolHandler {
338
343
  let page;
339
344
  try {
340
345
  await validateToolFiles(tool, params, context, isLocalBrowser(browser));
346
+ signal.throwIfAborted();
341
347
  if (isPageScopedTool(tool)) {
342
348
  const pageId = routedPageId(tool, this.#config.resolved, params);
343
349
  page =
@@ -345,6 +351,7 @@ export class ToolHandler {
345
351
  ? context.getPageById(pageId)
346
352
  : context.getSelectedMcpPage();
347
353
  await page?.init({ emulateFocus: true });
354
+ signal.throwIfAborted();
348
355
  response.setPage(page);
349
356
  if (tool.blockedByDialog) {
350
357
  page.throwIfDialogOpen();
@@ -361,9 +368,13 @@ export class ToolHandler {
361
368
  }
362
369
  }
363
370
  catch (err) {
364
- response.setError(err);
371
+ signal.throwIfAborted();
372
+ response.setError(toError(err));
365
373
  }
366
- onTelemetryData(await context.getDevToolsData(page), context.getSelectedMcpPageUrl(page));
374
+ signal.throwIfAborted();
375
+ const devToolsData = await context.getDevToolsData(page);
376
+ signal.throwIfAborted();
377
+ onTelemetryData(devToolsData, context.getSelectedMcpPageUrl(page));
367
378
  return await response.handle(context, this.#dataFormat(this.#config.resolved));
368
379
  }
369
380
  /**
@@ -387,19 +398,29 @@ export class ToolHandler {
387
398
  return context.taskQueue;
388
399
  }
389
400
  }
390
- handle = async (rawArgs = {}, options) => {
401
+ /**
402
+ * Cancellation stops waiting for a result, but running work keeps its queue
403
+ * until it settles, including response processing, to preserve serialization.
404
+ * Operations without cancellation support can keep the queue indefinitely.
405
+ */
406
+ async handle(rawArgs = {}, options) {
391
407
  const env_1 = { stack: [], error: void 0, hasError: false };
392
408
  try {
393
- const context = await this.getContext();
409
+ const signal = options?.signal ?? new AbortController().signal;
410
+ signal.throwIfAborted();
411
+ const context = await raceWithSignal(this.getContext(), signal);
394
412
  let queueGuard;
395
413
  try {
396
- queueGuard = await this.#queueFor(context, rawArgs)?.scheduleTask();
414
+ queueGuard = await this.#queueFor(context, rawArgs)?.scheduleTask(signal);
397
415
  }
398
416
  catch (err) {
417
+ signal.throwIfAborted();
399
418
  // The queue was disposed while the call waited, e.g. the page closed.
400
419
  return errorResult(getErrorMessage(err));
401
420
  }
402
- const guard = __addDisposableResource(env_1, queueGuard, false);
421
+ const guard = __addDisposableResource(env_1, new DisposableStack(), false);
422
+ guard.use(queueGuard);
423
+ signal.throwIfAborted();
403
424
  if (options?.viaMcp && this.#disabled) {
404
425
  throw new ProtocolError(ProtocolErrorCode.InvalidParams, `Tool ${this.#tool.name} disabled`);
405
426
  }
@@ -421,12 +442,16 @@ export class ToolHandler {
421
442
  const response = isSlimTool(tool)
422
443
  ? new SlimMcpResponse(this.#config)
423
444
  : new McpResponse(this.#config);
424
- const { content, structuredContent } = isBrowserlessTool(tool)
425
- ? await this.#runBrowserlessTool(tool, params, response, context)
426
- : await this.#runBrowserTool(tool, params, response, context, (data, url) => {
445
+ // The execution owns the queue even when its caller stops waiting.
446
+ const execution = isBrowserlessTool(tool)
447
+ ? this.#runBrowserlessTool(tool, params, response, context, signal)
448
+ : this.#runBrowserTool(tool, params, response, context, signal, (data, url) => {
427
449
  devToolsData = data;
428
450
  pageUrl = url;
429
451
  });
452
+ const executionGuard = guard.move();
453
+ const completion = execution.finally(() => executionGuard.dispose());
454
+ const { content, structuredContent } = await raceWithSignal(completion, signal);
430
455
  const result = {
431
456
  content,
432
457
  };
@@ -440,8 +465,14 @@ export class ToolHandler {
440
465
  return result;
441
466
  }
442
467
  catch (err) {
468
+ if (signal.aborted) {
469
+ logger?.(`${tool.name} cancelled:`, signal.reason);
470
+ }
471
+ signal.throwIfAborted();
443
472
  logger?.(`${tool.name} error:`, err, err?.stack);
444
- let errorText = err && 'message' in err ? err.message : String(err);
473
+ let errorText = err && typeof err === 'object' && 'message' in err
474
+ ? err.message
475
+ : String(err);
445
476
  let cause = err && typeof err === 'object' && 'cause' in err
446
477
  ? err.cause
447
478
  : undefined;
@@ -460,7 +491,7 @@ export class ToolHandler {
460
491
  finally {
461
492
  void ClearcutLogger.get()?.logToolInvocation({
462
493
  toolName: tool.name,
463
- params,
494
+ params: rawArgs,
464
495
  schema: tool.schema,
465
496
  success,
466
497
  latencyMs: Date.now() - startTime,
@@ -476,6 +507,6 @@ export class ToolHandler {
476
507
  finally {
477
508
  __disposeResources(env_1);
478
509
  }
479
- };
510
+ }
480
511
  }
481
512
  //# sourceMappingURL=ToolHandler.js.map
@@ -263,9 +263,17 @@ class PageEventSubscriber {
263
263
  }
264
264
  export class NetworkCollector extends PageCollector {
265
265
  static MAX_REQUESTS_PER_NAVIGATION = 1_000;
266
+ /** The navigation request that started the latest navigation, if any. */
267
+ #navigationRequest;
266
268
  constructor(page, { maxResourcesPerNavigation = NetworkCollector.MAX_REQUESTS_PER_NAVIGATION, maxNavigationSaved, } = {}, listeners = collect => {
267
269
  return {
268
270
  request: req => {
271
+ // With the debugger `createTargetUniverse()` starts, initiator stacks
272
+ // carry up to 32 async parents, which no tool reads.
273
+ const stack = req.initiator()?.stack;
274
+ if (stack) {
275
+ delete stack.parent;
276
+ }
269
277
  collect(req);
270
278
  },
271
279
  };
@@ -274,19 +282,23 @@ export class NetworkCollector extends PageCollector {
274
282
  }
275
283
  splitAfterNavigation() {
276
284
  const requests = this.storage[0];
285
+ // A navigation without a request, such as a back/forward cache restore or
286
+ // about:blank, must not claim the request of the previous navigation.
277
287
  const lastRequestIdx = requests.findLastIndex(request => {
278
- return request.frame() === this.pptrPage.mainFrame()
279
- ? request.isNavigationRequest()
280
- : false;
288
+ return (request !== this.#navigationRequest &&
289
+ request.frame() === this.pptrPage.mainFrame() &&
290
+ request.isNavigationRequest());
281
291
  });
282
292
  // Keep all requests since the last navigation request including that
283
293
  // navigation request itself.
284
294
  // Keep the reference
285
295
  if (lastRequestIdx !== -1) {
296
+ this.#navigationRequest = requests[lastRequestIdx];
286
297
  const fromCurrentNavigation = requests.splice(lastRequestIdx);
287
298
  this.storage.unshift(fromCurrentNavigation);
288
299
  }
289
300
  else {
301
+ this.#navigationRequest = undefined;
290
302
  this.storage.unshift([]);
291
303
  }
292
304
  this.storage.splice(this.maxNavigationSaved);
@@ -66,7 +66,10 @@ export class ConfigParser {
66
66
  */
67
67
  static parseConfigFile(configPath, rawContent) {
68
68
  try {
69
- const fileContent = JSON.parse(rawContent ?? readFileSync(configPath, 'utf-8'));
69
+ const content = rawContent ?? readFileSync(configPath, 'utf-8');
70
+ // Strip a leading UTF-8 byte order mark (U+FEFF). Windows PowerShell 5.1
71
+ // writes one by default, and JSON.parse rejects it.
72
+ const fileContent = JSON.parse(content.replace(/^\uFEFF/, ''));
70
73
  if (!isPlainObject(fileContent)) {
71
74
  throw new Error('Config must be a JSON object');
72
75
  }
@@ -10,6 +10,12 @@ const categoryOverrides = {
10
10
  [ToolCategory.EMULATION]: {},
11
11
  [ToolCategory.PERFORMANCE]: {},
12
12
  [ToolCategory.NETWORK]: {},
13
+ [ToolCategory.NETWORK_MOCKS]: {
14
+ describe: 'Set to true to include network mocking tools. ' +
15
+ 'Changing this option requires restarting the server.',
16
+ offByDefault: true,
17
+ reloadable: false,
18
+ },
13
19
  [ToolCategory.DEBUGGING]: {},
14
20
  [ToolCategory.MEMORY]: {},
15
21
  [ToolCategory.WEBMCP]: {
@@ -29,6 +35,10 @@ const categoryOverrides = {
29
35
  describe: 'Set to true to include tools for automating Progressive Web Apps (install, launch, uninstall, and OS state). This feature is only supported with a pipe connection; autoConnect, browserUrl, and wsEndpoint are not supported.',
30
36
  offByDefault: true,
31
37
  },
38
+ [ToolCategory.WEBAUTHN]: {
39
+ describe: 'Set to true to include a tool that manages virtual WebAuthn authenticators, for testing passkey and security key flows.',
40
+ offByDefault: true,
41
+ },
32
42
  };
33
43
  function createOption(category) {
34
44
  const overrides = categoryOverrides[category];
@@ -205,6 +205,63 @@ export const commands = {
205
205
  },
206
206
  },
207
207
  },
208
+ configure_webauthn: {
209
+ description: 'Adds a virtual WebAuthn authenticator to the page. Call this before the page calls navigator.credentials. It answers navigator.credentials.create() and get() and is removed when the page closes. Omitted parameters keep their current values. Changing protocol, transport, hasResidentKey or hasUserVerification replaces the authenticator and deletes its credentials. enabled=false ignores other parameters and removes all authenticators on the page. (requires flag: --categoryWebauthn=true)',
210
+ category: 'WebAuthn',
211
+ args: {
212
+ pageId: {
213
+ name: 'pageId',
214
+ type: 'number',
215
+ description: 'Targets a specific page by ID.',
216
+ required: true,
217
+ positional: true,
218
+ },
219
+ enabled: {
220
+ name: 'enabled',
221
+ type: 'boolean',
222
+ description: 'Set to false to remove all virtual authenticators from the page.',
223
+ required: true,
224
+ positional: true,
225
+ },
226
+ protocol: {
227
+ name: 'protocol',
228
+ type: 'string',
229
+ description: 'The authenticator protocol. Default: ctap2.',
230
+ required: false,
231
+ positional: false,
232
+ enum: ['ctap2', 'u2f'],
233
+ },
234
+ transport: {
235
+ name: 'transport',
236
+ type: 'string',
237
+ description: '"internal" is a platform authenticator such as Touch ID or Windows Hello; the others are roaming security keys. Default: internal.',
238
+ required: false,
239
+ positional: false,
240
+ enum: ['internal', 'usb', 'nfc', 'ble', 'hybrid'],
241
+ },
242
+ hasResidentKey: {
243
+ name: 'hasResidentKey',
244
+ type: 'boolean',
245
+ description: 'Whether the authenticator can store discoverable credentials (passkeys). Default: true. u2f does not support it, so it is false for u2f.',
246
+ required: false,
247
+ positional: false,
248
+ },
249
+ hasUserVerification: {
250
+ name: 'hasUserVerification',
251
+ type: 'boolean',
252
+ description: 'Whether the authenticator supports user verification (PIN or biometrics). Default: true. u2f does not support it, so it is false for u2f.',
253
+ required: false,
254
+ positional: false,
255
+ },
256
+ isUserVerified: {
257
+ name: 'isUserVerified',
258
+ type: 'boolean',
259
+ description: 'Whether user verification succeeds. Set to false to test a failed verification. Default: true.',
260
+ required: false,
261
+ positional: false,
262
+ },
263
+ },
264
+ },
208
265
  drag: {
209
266
  description: 'Drag an element onto another element',
210
267
  category: 'Input automation',
@@ -1204,7 +1261,7 @@ export const commands = {
1204
1261
  },
1205
1262
  },
1206
1263
  list_extensions: {
1207
- description: 'Lists all the Chrome extensions installed in the browser. This includes their name, ID, version, and enabled status. (requires flag: --categoryExtensions=true)',
1264
+ description: 'Lists the unpacked Chrome extensions loaded in the browser. This includes their name, ID, version, and enabled status. Extensions installed from the Chrome Web Store are not included. (requires flag: --categoryExtensions=true)',
1208
1265
  category: 'Extensions',
1209
1266
  args: {},
1210
1267
  },
@@ -1268,6 +1325,67 @@ export const commands = {
1268
1325
  },
1269
1326
  },
1270
1327
  },
1328
+ mock_network: {
1329
+ description: 'Inspect or update network mocks for a page. With no actions, list mocks matching the supplied filters, or all mocks when no filters are given. Providing body or upstream updates the exact route/resourceType pair. An omitted route matches any URL. Other mocks are preserved. The most recently updated matching mock wins and persists across navigations. Configure before navigating or reloading; inspection shows hit counts and replacement errors. Upstream responses use server-side GET/HEAD fetches. Changes are rejected during a performance trace. Mocks disable the page HTTP cache and intercept every request, affecting measurements. Service workers can bypass mocks. Use remove_network_mock to remove mocks. (requires flag: --categoryNetworkMocks=true)',
1330
+ category: 'Network mocks',
1331
+ args: {
1332
+ pageId: {
1333
+ name: 'pageId',
1334
+ type: 'number',
1335
+ description: 'Targets a specific page by ID.',
1336
+ required: true,
1337
+ positional: true,
1338
+ },
1339
+ route: {
1340
+ name: 'route',
1341
+ type: 'string',
1342
+ description: 'Absolute URLPattern, e.g. https://example.com/app.js or `*://*:*/app.js`. Use `*` for wildcards; omitted query strings match any query. Regex and `:name` groups are rejected. Inspection and removal compare the stored pattern exactly. Omit to inspect/remove all routes or match any URL.',
1343
+ required: false,
1344
+ positional: false,
1345
+ },
1346
+ resourceType: {
1347
+ name: 'resourceType',
1348
+ type: 'string',
1349
+ description: 'Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.',
1350
+ required: false,
1351
+ positional: false,
1352
+ enum: [
1353
+ 'document',
1354
+ 'stylesheet',
1355
+ 'image',
1356
+ 'media',
1357
+ 'font',
1358
+ 'script',
1359
+ 'texttrack',
1360
+ 'xhr',
1361
+ 'fetch',
1362
+ 'prefetch',
1363
+ 'eventsource',
1364
+ 'manifest',
1365
+ 'signedexchange',
1366
+ 'ping',
1367
+ 'cspviolationreport',
1368
+ 'preflight',
1369
+ 'fedcm',
1370
+ 'other',
1371
+ ],
1372
+ },
1373
+ body: {
1374
+ name: 'body',
1375
+ type: 'string',
1376
+ description: 'Local response body file, revalidated and reread for every request. Content-Type follows its extension. Mutually exclusive with upstream.',
1377
+ required: false,
1378
+ positional: false,
1379
+ },
1380
+ upstream: {
1381
+ name: 'upstream',
1382
+ type: 'string',
1383
+ description: 'Absolute HTTP(S) replacement URL for GET/HEAD requests. URL allowlists and blocklists apply to this URL and every redirect. Mutually exclusive with body.',
1384
+ required: false,
1385
+ positional: false,
1386
+ },
1387
+ },
1388
+ },
1271
1389
  navigate_page: {
1272
1390
  description: 'Go to a URL, or back, forward, or reload. Use project URL if not specified otherwise.',
1273
1391
  category: 'Navigation automation',
@@ -1416,7 +1534,7 @@ export const commands = {
1416
1534
  ignoreCache: {
1417
1535
  name: 'ignoreCache',
1418
1536
  type: 'boolean',
1419
- description: 'Whether to bypass the HTTP cache when reloading the page, to measure a cold page load. Only applies if reload is true.',
1537
+ description: 'Whether to bypass the HTTP cache when reloading the page, to measure a cold page load. Only applies if reload is true. Active network mocks always disable the page HTTP cache.',
1420
1538
  required: false,
1421
1539
  positional: false,
1422
1540
  },
@@ -1450,7 +1568,7 @@ export const commands = {
1450
1568
  },
1451
1569
  },
1452
1570
  press_key: {
1453
- description: 'Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations).',
1571
+ description: 'Press a key or key combination. Use this when other input methods like fill() cannot be used (e.g., keyboard shortcuts, navigation keys, or special key combinations). Note: On macOS, native <select> elements cannot be operated with ArrowDown/Enter via press_key; use fill() on the combobox or click() on the option instead.',
1454
1572
  category: 'Input automation',
1455
1573
  args: {
1456
1574
  pageId: {
@@ -1575,6 +1693,53 @@ export const commands = {
1575
1693
  },
1576
1694
  },
1577
1695
  },
1696
+ remove_network_mock: {
1697
+ description: 'Remove network mocks matching the supplied stored route and/or resource type. Route patterns are compared exactly, not applied as wildcards to other patterns. Omit both filters to remove all mocks for the page. Removing the last mock restores the HTTP cache and stops interception. Changes are rejected during a performance trace. (requires flag: --categoryNetworkMocks=true)',
1698
+ category: 'Network mocks',
1699
+ args: {
1700
+ pageId: {
1701
+ name: 'pageId',
1702
+ type: 'number',
1703
+ description: 'Targets a specific page by ID.',
1704
+ required: true,
1705
+ positional: true,
1706
+ },
1707
+ route: {
1708
+ name: 'route',
1709
+ type: 'string',
1710
+ description: 'Absolute URLPattern, e.g. https://example.com/app.js or `*://*:*/app.js`. Use `*` for wildcards; omitted query strings match any query. Regex and `:name` groups are rejected. Inspection and removal compare the stored pattern exactly. Omit to inspect/remove all routes or match any URL.',
1711
+ required: false,
1712
+ positional: false,
1713
+ },
1714
+ resourceType: {
1715
+ name: 'resourceType',
1716
+ type: 'string',
1717
+ description: 'Restrict requests and stored mock filters to this resource type. Omit to inspect/remove all types or configure a mock for any type.',
1718
+ required: false,
1719
+ positional: false,
1720
+ enum: [
1721
+ 'document',
1722
+ 'stylesheet',
1723
+ 'image',
1724
+ 'media',
1725
+ 'font',
1726
+ 'script',
1727
+ 'texttrack',
1728
+ 'xhr',
1729
+ 'fetch',
1730
+ 'prefetch',
1731
+ 'eventsource',
1732
+ 'manifest',
1733
+ 'signedexchange',
1734
+ 'ping',
1735
+ 'cspviolationreport',
1736
+ 'preflight',
1737
+ 'fedcm',
1738
+ 'other',
1739
+ ],
1740
+ },
1741
+ },
1742
+ },
1578
1743
  resize_page: {
1579
1744
  description: "Resizes the page's window so that the page has specified dimension",
1580
1745
  category: 'Emulation',
@@ -1655,6 +1820,26 @@ export const commands = {
1655
1820
  },
1656
1821
  },
1657
1822
  },
1823
+ set_logpoints: {
1824
+ description: 'Set the complete set of logpoints of the selected page: logpoints not in the list are removed, new ones are added, and an empty list removes all. A logpoint logs expressions to the console every time a line executes, without pausing or changing the source, like logpoints in the DevTools Sources panel. Locations are script URLs or original source files resolved through source maps (not available with --no-source-maps; scripts in workers and out-of-process iframes are not supported). A location in a generated script moves to its original source line when a source map covers it, and locations on the same line become one logpoint with the last expression. Output appears in list_console_messages; an expression that throws produces an error message without text. Logpoints survive reloads and navigations until removed or the page is closed. The response lists the resulting logpoints and where they are bound.',
1825
+ category: 'Debugging',
1826
+ args: {
1827
+ pageId: {
1828
+ name: 'pageId',
1829
+ type: 'number',
1830
+ description: 'Targets a specific page by ID.',
1831
+ required: true,
1832
+ positional: true,
1833
+ },
1834
+ logpoints: {
1835
+ name: 'logpoints',
1836
+ type: 'array',
1837
+ description: 'Logpoints formatted as <url>:<lineNumber>[:<columnNumber>] <expression>. The url is a script URL or the path of an original source file from a source map, exact or as a path suffix (e.g. "src/app.ts"). Line and column numbers are 1-based in the coordinates of the url; a line without executable code moves to the next possible location. The expression is evaluated like console.log() arguments in the scope of the location, where local variables are accessible by their original names, and runs before the line executes, so a variable declared on that line is not set yet. list_console_messages shows objects as [object Object]: read them with get_console_message, or log JSON.stringify(value) for plain data. Example: "src/cart.ts:42 \'cart total:\', cart.total, cart.items.length". Pass an empty array to remove all logpoints.',
1838
+ required: true,
1839
+ positional: true,
1840
+ },
1841
+ },
1842
+ },
1658
1843
  take_heapsnapshot: {
1659
1844
  description: 'Capture a heap snapshot of the target page. Use to analyze the memory distribution of JavaScript objects and debug memory leaks.',
1660
1845
  category: 'Memory',
@@ -128,7 +128,7 @@ export const mcpOptions = {
128
128
  javascriptEvaluation: {
129
129
  type: 'boolean',
130
130
  default: true,
131
- describe: 'Set to false to disable the server entry points for evaluating caller-provided JavaScript: evaluation tools (evaluate_script and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed. This is not a JavaScript sandbox: page scripts and JavaScript triggered through other permitted browser interactions (e.g. clicks or typing) still run. If --experimentalDevtools is also enabled, the DevTools UI, including the Console that evaluates code in the inspected page, can be automated and is not restricted by this option. The client remains responsible for validating tool calls and parameters.',
131
+ describe: 'Set to false to disable the server entry points for evaluating caller-provided JavaScript: evaluation tools (evaluate_script, set_logpoints, and slim evaluate) are disabled, the initScript parameter in navigate_page is turned off, and navigating to javascript:, data:, or vbscript: URLs is disallowed. This is not a JavaScript sandbox: page scripts and JavaScript triggered through other permitted browser interactions (e.g. clicks or typing) still run. If --experimentalDevtools is also enabled, the DevTools UI, including the Console that evaluates code in the inspected page, can be automated and is not restricted by this option. The client remains responsible for validating tool calls and parameters.',
132
132
  reloadable: true,
133
133
  },
134
134
  fileNavigations: {
@@ -135,6 +135,12 @@ const DISABLE_NETWORK = {
135
135
  // Do nothing.
136
136
  },
137
137
  };
138
+ /**
139
+ * Maximum number of `cause` links resolved for one error. A page can create a
140
+ * cyclic chain (`error.cause = error`), and CDP returns a new object id on
141
+ * every lookup of the same object, so a cycle cannot be detected by id.
142
+ */
143
+ const MAX_CAUSE_DEPTH = 10;
138
144
  /**
139
145
  * Constructed from Runtime.ExceptionDetails of an uncaught error.
140
146
  *
@@ -152,6 +158,9 @@ export class SymbolizedError {
152
158
  this.cause = cause;
153
159
  }
154
160
  static async fromDetails(opts) {
161
+ return await SymbolizedError.#fromDetails(opts, 0);
162
+ }
163
+ static async #fromDetails(opts, causeDepth) {
155
164
  const message = SymbolizedError.#getMessage(opts.details);
156
165
  if (!opts.includeStackAndCause || (!opts.devTools && !opts.session)) {
157
166
  return new SymbolizedError(message, opts.resolvedStackTraceForTesting, opts.resolvedCauseForTesting);
@@ -174,16 +183,16 @@ export class SymbolizedError {
174
183
  if (opts.resolvedCauseForTesting) {
175
184
  cause = opts.resolvedCauseForTesting;
176
185
  }
177
- else if (opts.details.exception) {
186
+ else if (opts.details.exception && causeDepth < MAX_CAUSE_DEPTH) {
178
187
  try {
179
188
  const causeRemoteObj = await SymbolizedError.#lookupCause(opts.devTools, opts.details.exception, opts.targetId, opts.session);
180
189
  if (causeRemoteObj) {
181
- cause = await SymbolizedError.fromError({
190
+ cause = await SymbolizedError.#fromError({
182
191
  devTools: opts.devTools,
183
192
  error: causeRemoteObj,
184
193
  targetId: opts.targetId,
185
194
  session: opts.session,
186
- });
195
+ }, causeDepth + 1);
187
196
  }
188
197
  }
189
198
  catch {
@@ -193,15 +202,18 @@ export class SymbolizedError {
193
202
  return new SymbolizedError(message, stackTrace, cause);
194
203
  }
195
204
  static async fromError(opts) {
205
+ return await SymbolizedError.#fromError(opts, 0);
206
+ }
207
+ static async #fromError(opts, causeDepth) {
196
208
  const details = await SymbolizedError.#getExceptionDetails(opts.devTools, opts.error, opts.targetId, opts.session);
197
209
  if (details) {
198
- return await SymbolizedError.fromDetails({
210
+ return await SymbolizedError.#fromDetails({
199
211
  details,
200
212
  devTools: opts.devTools,
201
213
  targetId: opts.targetId,
202
214
  session: opts.session,
203
215
  includeStackAndCause: true,
204
- });
216
+ }, causeDepth);
205
217
  }
206
218
  return new SymbolizedError(SymbolizedError.#getMessageFromException(opts.error));
207
219
  }
@@ -314,13 +326,38 @@ export async function createStackTrace(devTools, rawStackTrace, targetId) {
314
326
  }
315
327
  }
316
328
  const signal = AbortSignal.timeout(1_000);
317
- await Promise.all([...scriptIds].map(id => waitForScript(model, id, signal)
318
- .then(script => model.sourceMapManager().sourceMapForClientPromise(script))
319
- .catch()));
329
+ const scripts = await Promise.all([...scriptIds].map(id => waitForScript(model, id, signal)));
330
+ await waitForSourceMaps(model, scripts, signal);
320
331
  const binding = devTools.universe.context.get(DevTools.DebuggerWorkspaceBinding);
321
332
  // DevTools uses branded types for ScriptId and others. Casting the puppeteer protocol type to the DevTools protocol type is safe.
322
333
  return await binding.createStackTraceFromProtocolRuntime(rawStackTrace, target);
323
334
  }
335
+ /**
336
+ * Waits for the source maps of `scripts` to load, so that their original
337
+ * sources are in the workspace. Scripts without a source map are skipped.
338
+ * Non-trivial pages have hundreds of source maps, so the wait ends when
339
+ * `signal` aborts; loads still pending then continue in the background and
340
+ * resolve later.
341
+ */
342
+ export async function waitForSourceMaps(model, scripts, signal) {
343
+ const manager = model.sourceMapManager();
344
+ const aborted = new Promise(resolve => {
345
+ if (signal.aborted) {
346
+ resolve();
347
+ return;
348
+ }
349
+ signal.addEventListener('abort', () => resolve(), { once: true });
350
+ });
351
+ await Promise.all([...scripts].map(script => {
352
+ if (!script.sourceMapURL) {
353
+ return undefined;
354
+ }
355
+ return Promise.race([
356
+ manager.sourceMapForClientPromise(script).then(() => undefined),
357
+ aborted,
358
+ ]);
359
+ }));
360
+ }
324
361
  // Waits indefinitely for the script so pair it with Promise.race.
325
362
  async function waitForScript(model, scriptId, signal) {
326
363
  while (true) {