chrome-devtools-mcp 1.11.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 (389) hide show
  1. package/README.md +73 -21
  2. package/{build → out/Default/gen}/src/BrowserManager.js +49 -18
  3. package/out/Default/gen/src/LogpointManager.js +307 -0
  4. package/{build → out/Default/gen}/src/McpContext.js +439 -133
  5. package/{build → out/Default/gen}/src/McpPage.js +368 -59
  6. package/{build → out/Default/gen}/src/McpResponse.js +90 -47
  7. package/out/Default/gen/src/NetworkOverrideManager.js +419 -0
  8. package/{build → out/Default/gen}/src/TextSnapshot.js +37 -18
  9. package/out/Default/gen/src/ToolHandler.js +512 -0
  10. package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp-main.js +6 -4
  11. package/{build → out/Default/gen}/src/bin/chrome-devtools.js +4 -4
  12. package/{build → out/Default/gen}/src/collectors/PageCollector.js +28 -12
  13. package/{build → out/Default/gen}/src/collectors/ServiceWorkerCollector.js +2 -2
  14. package/out/Default/gen/src/collectors/constants.js +7 -0
  15. package/out/Default/gen/src/config/ConfigParser.js +162 -0
  16. package/{build → out/Default/gen}/src/config/ConfigWatcher.js +3 -2
  17. package/out/Default/gen/src/config/ServerConfig.js +251 -0
  18. package/{build → out/Default/gen}/src/config/browser-options.js +13 -4
  19. package/{build → out/Default/gen}/src/config/category-options.js +10 -0
  20. package/{build → out/Default/gen}/src/config/cli-options.js +223 -22
  21. package/{build → out/Default/gen}/src/config/mcp-options.js +62 -36
  22. package/{build → out/Default/gen}/src/config/puppeteer-options.js +4 -2
  23. package/{build → out/Default/gen}/src/daemon/client.js +3 -3
  24. package/{build → out/Default/gen}/src/daemon/daemon.js +7 -3
  25. package/{build → out/Default/gen}/src/daemon/utils.js +2 -1
  26. package/{build → out/Default/gen}/src/devtools/DevToolsCommentBridge.js +28 -5
  27. package/{build → out/Default/gen}/src/devtools/DevtoolsUtils.js +94 -20
  28. package/{build → out/Default/gen}/src/formatters/ConsoleFormatter.js +28 -1
  29. package/{build → out/Default/gen}/src/formatters/HeapSnapshotFormatter.js +14 -18
  30. package/out/Default/gen/src/formatters/LogpointFormatter.js +62 -0
  31. package/{build → out/Default/gen}/src/formatters/NetworkFormatter.js +70 -17
  32. package/out/Default/gen/src/formatters/NetworkOverridesFormatter.js +49 -0
  33. package/out/Default/gen/src/formatters/RemoteObjectFormatter.js +231 -0
  34. package/{build → out/Default/gen}/src/formatters/SnapshotFormatter.js +13 -3
  35. package/out/Default/gen/src/formatters/WebAuthnFormatter.js +56 -0
  36. package/out/Default/gen/src/index.js +435 -0
  37. package/out/Default/gen/src/processors/HeapSnapshotManager.js +569 -0
  38. package/{build → out/Default/gen}/src/telemetry/transformation.js +1 -1
  39. package/{build → out/Default/gen}/src/third_party/THIRD_PARTY_NOTICES +796 -712
  40. package/out/Default/gen/src/third_party/bundled-packages.json +11 -0
  41. package/out/Default/gen/src/third_party/cli.js +9023 -0
  42. package/out/Default/gen/src/third_party/devtools-formatter-worker.js +31904 -0
  43. package/out/Default/gen/src/third_party/devtools-heap-snapshot-worker.js +26467 -0
  44. package/out/Default/gen/src/third_party/index.js +201574 -0
  45. package/out/Default/gen/src/third_party/lighthouse-devtools-mcp-bundle.js +60395 -0
  46. package/out/Default/gen/src/tools/ToolDefinition.js +180 -0
  47. package/{build → out/Default/gen}/src/tools/categories.js +4 -0
  48. package/{build → out/Default/gen}/src/tools/comments.js +46 -4
  49. package/{build → out/Default/gen}/src/tools/console.js +8 -6
  50. package/{build → out/Default/gen}/src/tools/css.js +1 -0
  51. package/{build → out/Default/gen}/src/tools/emulation.js +5 -4
  52. package/{build → out/Default/gen}/src/tools/extensions.js +6 -1
  53. package/{build → out/Default/gen}/src/tools/input.js +23 -28
  54. package/{build → out/Default/gen}/src/tools/lighthouse.js +30 -8
  55. package/out/Default/gen/src/tools/logpoints.js +51 -0
  56. package/{build → out/Default/gen}/src/tools/memory.js +59 -53
  57. package/out/Default/gen/src/tools/network.js +260 -0
  58. package/{build → out/Default/gen}/src/tools/pages.js +48 -6
  59. package/{build → out/Default/gen}/src/tools/performance.js +33 -7
  60. package/{build → out/Default/gen}/src/tools/pwa.js +7 -0
  61. package/{build → out/Default/gen}/src/tools/screencast.js +3 -1
  62. package/{build → out/Default/gen}/src/tools/screenshot.js +23 -7
  63. package/{build → out/Default/gen}/src/tools/script.js +38 -6
  64. package/{build → out/Default/gen}/src/tools/slim/tools.js +21 -5
  65. package/{build → out/Default/gen}/src/tools/snapshot.js +29 -5
  66. package/{build → out/Default/gen}/src/tools/thirdPartyDeveloper.js +6 -20
  67. package/out/Default/gen/src/tools/toolNames.js +10 -0
  68. package/{build → out/Default/gen}/src/tools/tools.js +4 -0
  69. package/out/Default/gen/src/tools/webauthn.js +51 -0
  70. package/{build → out/Default/gen}/src/tools/webmcp.js +5 -19
  71. package/out/Default/gen/src/utils/TaskRunner.js +151 -0
  72. package/{build → out/Default/gen}/src/utils/WaitForHelper.js +16 -2
  73. package/{build → out/Default/gen}/src/utils/bytes.js +2 -12
  74. package/{build → out/Default/gen}/src/utils/check-for-updates.js +8 -2
  75. package/out/Default/gen/src/utils/disclaimers.js +27 -0
  76. package/{build → out/Default/gen}/src/utils/errorHandling.js +3 -0
  77. package/{build → out/Default/gen}/src/utils/keyboard.js +15 -5
  78. package/out/Default/gen/src/utils/logger.js +131 -0
  79. package/out/Default/gen/src/utils/network.js +81 -0
  80. package/out/Default/gen/src/utils/raceWithSignal.js +26 -0
  81. package/out/Default/gen/src/utils/resourceType.js +27 -0
  82. package/out/Default/gen/src/utils/text.js +44 -0
  83. package/out/Default/gen/src/utils/timeout.js +14 -0
  84. package/{build → out/Default/gen}/src/utils/url.js +73 -17
  85. package/{build → out/Default/gen}/src/version.js +1 -1
  86. package/package.json +26 -32
  87. package/skills/a11y-debugging/SKILL.md +3 -8
  88. package/skills/chrome-devtools/SKILL.md +2 -0
  89. package/skills/chrome-devtools-cli/SKILL.md +12 -1
  90. package/build/src/ToolHandler.js +0 -360
  91. package/build/src/config/ConfigParser.js +0 -264
  92. package/build/src/index.js +0 -282
  93. package/build/src/processors/HeapSnapshotManager.js +0 -307
  94. package/build/src/third_party/bundled-packages.json +0 -11
  95. package/build/src/third_party/devtools-formatter-worker.js +0 -16625
  96. package/build/src/third_party/devtools-heap-snapshot-worker.js +0 -12084
  97. package/build/src/third_party/index.js +0 -189603
  98. package/build/src/third_party/lighthouse-devtools-mcp-bundle.js +0 -58435
  99. package/build/src/tools/ToolDefinition.js +0 -92
  100. package/build/src/tools/network.js +0 -128
  101. package/build/src/utils/logger.js +0 -62
  102. package/build/src/utils/text.js +0 -15
  103. /package/{build → out/Default/gen}/src/McpWorker.js +0 -0
  104. /package/{build → out/Default/gen}/src/SlimMcpResponse.js +0 -0
  105. /package/{build → out/Default/gen}/src/bin/check-latest-version.js +0 -0
  106. /package/{build → out/Default/gen}/src/bin/chrome-devtools-mcp.js +0 -0
  107. /package/{build → out/Default/gen}/src/config/ConfigLocator.js +0 -0
  108. /package/{build → out/Default/gen}/src/config/cli-commands.js +0 -0
  109. /package/{build → out/Default/gen}/src/config/tool-options.js +0 -0
  110. /package/{build → out/Default/gen}/src/daemon/types.js +0 -0
  111. /package/{build → out/Default/gen}/src/devtools/McpHostBindingAdapter.js +0 -0
  112. /package/{build → out/Default/gen}/src/devtools/issueDescriptions.js +0 -0
  113. /package/{build → out/Default/gen}/src/formatters/CommentFormatter.js +0 -0
  114. /package/{build → out/Default/gen}/src/formatters/CssFormatter.js +0 -0
  115. /package/{build → out/Default/gen}/src/formatters/IssueFormatter.js +0 -0
  116. /package/{build → out/Default/gen}/src/processors/ChunkedTraceParser.js +0 -0
  117. /package/{build → out/Default/gen}/src/processors/PerformanceTrace.js +0 -0
  118. /package/{build → out/Default/gen}/src/telemetry/ClearcutLogger.js +0 -0
  119. /package/{build → out/Default/gen}/src/telemetry/WatchdogClient.js +0 -0
  120. /package/{build → out/Default/gen}/src/telemetry/errors.js +0 -0
  121. /package/{build → out/Default/gen}/src/telemetry/flagUtils.js +0 -0
  122. /package/{build → out/Default/gen}/src/telemetry/metricsRegistry.js +0 -0
  123. /package/{build → out/Default/gen}/src/telemetry/persistence.js +0 -0
  124. /package/{build → out/Default/gen}/src/telemetry/types.js +0 -0
  125. /package/{build → out/Default/gen}/src/telemetry/watchdog/ClearcutSender.js +0 -0
  126. /package/{build → out/Default/gen}/src/telemetry/watchdog/main.js +0 -0
  127. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCoopSandboxedIframeCannotNavigateToCoopPage.md +0 -0
  128. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOrigin.md +0 -0
  129. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameOriginAfterDefaultedToSameOriginByCoep.md +0 -0
  130. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepCorpNotSameSite.md +0 -0
  131. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CoepFrameResourceNeedsCoepHeader.md +0 -0
  132. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CompatibilityModeQuirks.md +0 -0
  133. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/CookieAttributeValueExceedsMaxSize.md +0 -0
  134. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/LowTextContrast.md +0 -0
  135. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorRead.md +0 -0
  136. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureErrorSet.md +0 -0
  137. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnRead.md +0 -0
  138. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteNoneInsecureWarnSet.md +0 -0
  139. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeRead.md +0 -0
  140. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/SameSiteUnspecifiedLaxAllowUnsafeSet.md +0 -0
  141. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/bounceTrackingMitigations.md +0 -0
  142. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagAllowListInvalidOrigin.md +0 -0
  143. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/clientHintMetaTagModifiedHTML.md +0 -0
  144. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistEmbeddingRequirementNotSatisfied.md +0 -0
  145. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistIFrameAttributeLoosensEmbeddingRequirement.md +0 -0
  146. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowConnectionAllowlistFrom.md +0 -0
  147. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidAllowlistItemType.md +0 -0
  148. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidHeader.md +0 -0
  149. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistInvalidUrlPattern.md +0 -0
  150. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistItemNotInnerList.md +0 -0
  151. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistMoreThanOneList.md +0 -0
  152. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/connectionAllowlistReportingEndpointNotToken.md +0 -0
  153. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieCrossSiteRedirectDowngrade.md +0 -0
  154. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeDomainNonAscii.md +0 -0
  155. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludePortMismatch.md +0 -0
  156. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeSchemeMismatch.md +0 -0
  157. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutRead.md +0 -0
  158. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieExcludeThirdPartyPhaseoutSet.md +0 -0
  159. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnDomainNonAscii.md +0 -0
  160. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantRead.md +0 -0
  161. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantReadOptOut.md +0 -0
  162. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSet.md +0 -0
  163. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnMetadataGrantSetOptOut.md +0 -0
  164. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutRead.md +0 -0
  165. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cookieWarnThirdPartyPhaseoutSet.md +0 -0
  166. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsAllowCredentialsRequired.md +0 -0
  167. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisabledScheme.md +0 -0
  168. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsDisallowedByMode.md +0 -0
  169. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsHeaderDisallowedByPreflightResponse.md +0 -0
  170. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsInvalidHeaderValues.md +0 -0
  171. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsLocalNetworkAccessPermissionDenied.md +0 -0
  172. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsMethodDisallowedByPreflightResponse.md +0 -0
  173. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsNoCorsRedirectModeNotFollow.md +0 -0
  174. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsOriginMismatch.md +0 -0
  175. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsPreflightResponseInvalid.md +0 -0
  176. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsRedirectContainsCredentials.md +0 -0
  177. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/corsWildcardOriginNotAllowed.md +0 -0
  178. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspEvalViolation.md +0 -0
  179. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspInlineViolation.md +0 -0
  180. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesPolicyViolation.md +0 -0
  181. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspTrustedTypesSinkViolation.md +0 -0
  182. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/cspURLViolation.md +0 -0
  183. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/deprecation.md +0 -0
  184. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsEmptyList.md +0 -0
  185. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsHttpNotFound.md +0 -0
  186. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidContentType.md +0 -0
  187. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsInvalidResponse.md +0 -0
  188. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestAccountsNoResponse.md +0 -0
  189. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsFetchFailed.md +0 -0
  190. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestDnsInvalidRecord.md +0 -0
  191. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownHttpNotFound.md +0 -0
  192. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidContentType.md +0 -0
  193. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownInvalidResponse.md +0 -0
  194. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestEmailVerificationWellKnownNoResponse.md +0 -0
  195. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestInvalidEmail.md +0 -0
  196. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksHttpNotFound.md +0 -0
  197. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestJwksInvalidResponse.md +0 -0
  198. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestKeyBindingSigningFailed.md +0 -0
  199. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestRpOriginIsOpaque.md +0 -0
  200. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenHttpNotFound.md +0 -0
  201. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidContentType.md +0 -0
  202. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidResponse.md +0 -0
  203. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenInvalidSdJwt.md +0 -0
  204. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenMalformedSdJwt.md +0 -0
  205. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenNoResponse.md +0 -0
  206. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidAudience.md +0 -0
  207. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidIssuedAt.md +0 -0
  208. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidNonce.md +0 -0
  209. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidSdHash.md +0 -0
  210. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbInvalidTyp.md +0 -0
  211. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingAud.md +0 -0
  212. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingCnf.md +0 -0
  213. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingIat.md +0 -0
  214. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingNonce.md +0 -0
  215. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbMissingSdHash.md +0 -0
  216. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationKbSignatureFailed.md +0 -0
  217. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmail.md +0 -0
  218. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidEmailVerified.md +0 -0
  219. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidHolderKey.md +0 -0
  220. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuedAt.md +0 -0
  221. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtInvalidIssuer.md +0 -0
  222. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtJwksMissingKeys.md +0 -0
  223. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingCnf.md +0 -0
  224. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingEmail.md +0 -0
  225. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIat.md +0 -0
  226. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtMissingIss.md +0 -0
  227. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtSignatureFailed.md +0 -0
  228. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestTokenVerificationSdJwtUnsupportedHeaderAlg.md +0 -0
  229. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestUserLoggedOut.md +0 -0
  230. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownAccountsEndpointCrossOrigin.md +0 -0
  231. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownHttpNotFound.md +0 -0
  232. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidContentType.md +0 -0
  233. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownInvalidResponse.md +0 -0
  234. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownIssuanceEndpointCrossOrigin.md +0 -0
  235. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownListEmpty.md +0 -0
  236. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingAccountsEndpoint.md +0 -0
  237. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownMissingIssuanceEndpoint.md +0 -0
  238. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownNoResponse.md +0 -0
  239. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/emailVerificationRequestWellKnownUnsupportedSigningAlgorithm.md +0 -0
  240. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsBlockedByConnectionAllowlist.md +0 -0
  241. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsHttpNotFound.md +0 -0
  242. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsInvalidResponse.md +0 -0
  243. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestAccountsNoResponse.md +0 -0
  244. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestApprovalDeclined.md +0 -0
  245. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestCanceled.md +0 -0
  246. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestConfigBlockedByConnectionAllowlist.md +0 -0
  247. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorFetchingSignin.md +0 -0
  248. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestErrorIdToken.md +0 -0
  249. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenBlockedByConnectionAllowlist.md +0 -0
  250. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenHttpNotFound.md +0 -0
  251. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidRequest.md +0 -0
  252. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenInvalidResponse.md +0 -0
  253. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestIdTokenNoResponse.md +0 -0
  254. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestInvalidSigninResponse.md +0 -0
  255. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestHttpNotFound.md +0 -0
  256. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestInvalidResponse.md +0 -0
  257. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestManifestNoResponse.md +0 -0
  258. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestTooManyRequests.md +0 -0
  259. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthRequestWellKnownBlockedByConnectionAllowlist.md +0 -0
  260. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidAccountsResponse.md +0 -0
  261. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestInvalidConfigOrWellKnown.md +0 -0
  262. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoAccountSharingPermission.md +0 -0
  263. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoApiPermission.md +0 -0
  264. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNoReturningUserFromFetchedAccounts.md +0 -0
  265. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotIframe.md +0 -0
  266. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotPotentiallyTrustworthy.md +0 -0
  267. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSameOrigin.md +0 -0
  268. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/federatedAuthUserInfoRequestNotSignedInWithIdp.md +0 -0
  269. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/fetchingPartitionedBlobURL.md +0 -0
  270. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericBackUINavigationWouldSkipAd.md +0 -0
  271. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAriaLabelledByToNonExistingIdError.md +0 -0
  272. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormAutocompleteAttributeEmptyError.md +0 -0
  273. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormDuplicateIdForInputError.md +0 -0
  274. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormEmptyIdAndNameAttributesForInputError.md +0 -0
  275. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputAssignedAutocompleteValueToIdOrNameAttributeError.md +0 -0
  276. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputHasWrongButWellIntendedAutocompleteValueError.md +0 -0
  277. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormInputWithNoLabelError.md +0 -0
  278. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForMatchesNonExistingIdError.md +0 -0
  279. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelForNameError.md +0 -0
  280. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormLabelHasNeitherForNorNestedInputError.md +0 -0
  281. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolDescription.md +0 -0
  282. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextMissingToolName.md +0 -0
  283. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingName.md +0 -0
  284. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextParameterMissingTitleAndDescription.md +0 -0
  285. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericFormModelContextRequiredParameterMissingName.md +0 -0
  286. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericGeolocationPromptWithoutUserGesture.md +0 -0
  287. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericNavigationEntryMarkedSkippable.md +0 -0
  288. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/genericResponseWasBlockedByORB.md +0 -0
  289. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/heavyAd.md +0 -0
  290. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/lazyLoadImageZeroSize.md +0 -0
  291. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/mixedContent.md +0 -0
  292. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/navigatingPartitionedBlobURL.md +0 -0
  293. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabled.md +0 -0
  294. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluder.md +0 -0
  295. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementActivationDisabledWithOccluderParent.md +0 -0
  296. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementCspFrameAncestorsMissing.md +0 -0
  297. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFencedFrameDisallowed.md +0 -0
  298. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooLarge.md +0 -0
  299. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementFontSizeTooSmall.md +0 -0
  300. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementGeolocationDeprecated.md +0 -0
  301. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInsetBoxShadowUnsupported.md +0 -0
  302. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidDisplayStyle.md +0 -0
  303. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidSizeValue.md +0 -0
  304. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidType.md +0 -0
  305. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementInvalidTypeActivation.md +0 -0
  306. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementLowContrast.md +0 -0
  307. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementNonOpaqueColor.md +0 -0
  308. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingBottomUnsupported.md +0 -0
  309. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPaddingRightUnsupported.md +0 -0
  310. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementPermissionsPolicyBlocked.md +0 -0
  311. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRegistrationFailed.md +0 -0
  312. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementRequestInProgress.md +0 -0
  313. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementSecurityChecksFailed.md +0 -0
  314. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementTypeNotSupported.md +0 -0
  315. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/permissionElementUntrustedEvent.md +0 -0
  316. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/placeholderDescriptionForInvisibleIssues.md +0 -0
  317. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleInvalidNameIssue.md +0 -0
  318. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/propertyRuleIssue.md +0 -0
  319. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedOptGroupChild.md +0 -0
  320. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityDisallowedSelectChild.md +0 -0
  321. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentAttributesSelectDescendant.md +0 -0
  322. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentLegendChild.md +0 -0
  323. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityInteractiveContentOptionChild.md +0 -0
  324. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectElementAccessibilityNonPhrasingContentOptionChild.md +0 -0
  325. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/selectivePermissionsIntervention.md +0 -0
  326. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedArrayBuffer.md +0 -0
  327. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorCrossOriginNoCorsRequest.md +0 -0
  328. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorDictionaryLoadFailure.md +0 -0
  329. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorMatchingDictionaryNotUsed.md +0 -0
  330. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryUseErrorUnexpectedContentDictionaryHeader.md +0 -0
  331. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorCossOriginNoCorsRequest.md +0 -0
  332. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorDisallowedBySettings.md +0 -0
  333. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorExpiredResponse.md +0 -0
  334. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorFeatureDisabled.md +0 -0
  335. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInsufficientResources.md +0 -0
  336. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidMatchField.md +0 -0
  337. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidStructuredHeader.md +0 -0
  338. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorInvalidTTLField.md +0 -0
  339. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNavigationRequest.md +0 -0
  340. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNoMatchField.md +0 -0
  341. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonIntegerTTLField.md +0 -0
  342. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonListMatchDestField.md +0 -0
  343. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonSecureContext.md +0 -0
  344. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringIdField.md +0 -0
  345. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringInMatchDestList.md +0 -0
  346. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonStringMatchField.md +0 -0
  347. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorNonTokenTypeField.md +0 -0
  348. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorRequestAborted.md +0 -0
  349. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorShuttingDown.md +0 -0
  350. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorTooLongIdField.md +0 -0
  351. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sharedDictionaryWriteErrorUnsupportedType.md +0 -0
  352. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureHeader.md +0 -0
  353. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriInvalidSignatureInputHeader.md +0 -0
  354. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureHeader.md +0 -0
  355. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriMissingSignatureInputHeader.md +0 -0
  356. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsIncorrectLength.md +0 -0
  357. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsNotByteSequence.md +0 -0
  358. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureHeaderValueIsParameterized.md +0 -0
  359. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentName.md +0 -0
  360. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidComponentType.md +0 -0
  361. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidDerivedComponentParameter.md +0 -0
  362. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidHeaderComponentParameter.md +0 -0
  363. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderInvalidParameter.md +0 -0
  364. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderKeyIdLength.md +0 -0
  365. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingLabel.md +0 -0
  366. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderMissingRequiredParameters.md +0 -0
  367. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueMissingComponents.md +0 -0
  368. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriSignatureInputHeaderValueNotInnerList.md +0 -0
  369. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedIntegrityMismatch.md +0 -0
  370. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedInvalidLength.md +0 -0
  371. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureExpired.md +0 -0
  372. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/sriValidationFailedSignatureMismatch.md +0 -0
  373. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetLateImport.md +0 -0
  374. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/stylesheetRequestFailed.md +0 -0
  375. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/summaryElementAccessibilityInteractiveContentSummaryDescendant.md +0 -0
  376. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestLength.md +0 -0
  377. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestIncorrectDigestType.md +0 -0
  378. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestMalformedDictionary.md +0 -0
  379. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/unencodedDigestUnknownAlgorithm.md +0 -0
  380. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingId.md +0 -0
  381. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestMissingNameOrShortName.md +0 -0
  382. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallManifestParsingOrNetworkError.md +0 -0
  383. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallNoManifest.md +0 -0
  384. /package/{build → out/Default/gen}/src/third_party/issue-descriptions/webInstallStartUrlInvalid.md +0 -0
  385. /package/{build → out/Default/gen}/src/types.js +0 -0
  386. /package/{build → out/Default/gen}/src/utils/files.js +0 -0
  387. /package/{build → out/Default/gen}/src/utils/id.js +0 -0
  388. /package/{build → out/Default/gen}/src/utils/pagination.js +0 -0
  389. /package/{build → out/Default/gen}/src/utils/polyfill.js +0 -0
@@ -0,0 +1,180 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2025 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { categoryToFlagName } from '../config/category-options.js';
7
+ import { zod, } from '../third_party/index.js';
8
+ export function defineTool(definition) {
9
+ return definition;
10
+ }
11
+ export function definePageTool(definition) {
12
+ return (args) => {
13
+ const tool = definition(args);
14
+ return {
15
+ ...tool,
16
+ schema: {
17
+ ...(args.pageIdRouting && !isSlimTool(tool) ? pageIdSchema : {}),
18
+ ...tool.schema,
19
+ },
20
+ pageScoped: true,
21
+ };
22
+ };
23
+ }
24
+ /**
25
+ * Defines a tool that does not need a browser connection, e.g. a tool that only
26
+ * analyzes local files. Its handler only receives a {@link BrowserlessContext}.
27
+ * Such a tool runs without the context queue (`concurrency: 'none'`) unless
28
+ * the definition sets another value.
29
+ */
30
+ export function defineBrowserlessTool(definition) {
31
+ return (args) => {
32
+ return {
33
+ concurrency: 'none',
34
+ ...definition(args),
35
+ browserless: true,
36
+ };
37
+ };
38
+ }
39
+ export function isPageScopedTool(tool) {
40
+ return 'pageScoped' in tool && tool.pageScoped === true;
41
+ }
42
+ export function isBrowserlessTool(tool) {
43
+ return 'browserless' in tool && tool.browserless === true;
44
+ }
45
+ export const CLOSE_PAGE_ERROR = 'The last open page cannot be closed. It is fine to keep it open.';
46
+ export const pageIdSchema = {
47
+ pageId: zod.number().describe('Targets a specific page by ID.'),
48
+ };
49
+ export function zodTransform(transform) {
50
+ return (arg, ctx) => {
51
+ try {
52
+ return transform(arg);
53
+ }
54
+ catch (error) {
55
+ if (error instanceof zod.ZodError) {
56
+ for (const issue of error.issues) {
57
+ ctx.addIssue({
58
+ code: 'custom',
59
+ message: issue.message,
60
+ path: issue.path,
61
+ });
62
+ }
63
+ }
64
+ else {
65
+ ctx.addIssue({
66
+ code: 'custom',
67
+ message: error instanceof Error ? error.message : String(error),
68
+ });
69
+ }
70
+ return zod.NEVER;
71
+ }
72
+ };
73
+ }
74
+ export const timeoutSchema = {
75
+ timeout: zod
76
+ .number()
77
+ .int()
78
+ .transform(value => {
79
+ return value <= 0 ? undefined : value;
80
+ })
81
+ .optional()
82
+ .describe(`Maximum wait time in milliseconds. If set to 0, the default timeout will be used.`),
83
+ };
84
+ const integerStringSchema = zod
85
+ .string()
86
+ .regex(/^[+-]?\d+$/, 'Expected an integer')
87
+ .pipe(zod.coerce.number());
88
+ const decimalStringSchema = zod
89
+ .string()
90
+ .regex(/^[+-]?\d+(\.\d+)?$/, 'Expected a number')
91
+ .pipe(zod.coerce.number());
92
+ /* eslint-disable @local/enforce-zod-schema */
93
+ const geolocationSchema = zod.object({
94
+ latitude: decimalStringSchema.pipe(zod.number().min(-90).max(90)),
95
+ longitude: decimalStringSchema.pipe(zod.number().min(-180).max(180)),
96
+ });
97
+ const VIEWPORT_FORMAT = '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]';
98
+ const viewportTagSchema = zod.enum(['mobile', 'touch', 'landscape'], {
99
+ error: issue => `Invalid viewport option "${String(issue.input)}". Expected "mobile", "touch", or "landscape" in '${VIEWPORT_FORMAT}'.`,
100
+ });
101
+ // CDP's Emulation.setDeviceMetricsOverride takes integer width and height.
102
+ const viewportSchema = zod.object({
103
+ width: integerStringSchema.pipe(zod.number().int().positive()),
104
+ height: integerStringSchema.pipe(zod.number().int().positive()),
105
+ deviceScaleFactor: decimalStringSchema
106
+ .pipe(zod.number().positive())
107
+ .optional(),
108
+ isMobile: zod.boolean().optional(),
109
+ isLandscape: zod.boolean().optional(),
110
+ hasTouch: zod.boolean().optional(),
111
+ });
112
+ /* eslint-enable @local/enforce-zod-schema */
113
+ export function viewportTransform(arg) {
114
+ if (!arg) {
115
+ return undefined;
116
+ }
117
+ const [dimensions, ...tags] = arg.split(',');
118
+ for (const tag of tags) {
119
+ viewportTagSchema.parse(tag);
120
+ }
121
+ const dimParts = dimensions.split('x');
122
+ if (dimParts.length !== 2 && dimParts.length !== 3) {
123
+ throw new Error(`Invalid viewport dimensions "${dimensions}". Expected format '${VIEWPORT_FORMAT}'.`);
124
+ }
125
+ return viewportSchema.parse({
126
+ width: dimParts[0],
127
+ height: dimParts[1],
128
+ deviceScaleFactor: dimParts[2],
129
+ isMobile: tags.includes('mobile'),
130
+ isLandscape: tags.includes('landscape'),
131
+ hasTouch: tags.includes('touch'),
132
+ });
133
+ }
134
+ export function geolocationTransform(arg) {
135
+ if (!arg) {
136
+ return undefined;
137
+ }
138
+ const parts = arg.split(',');
139
+ if (parts.length !== 2) {
140
+ throw new Error(`Invalid geolocation "${arg}". Expected '<latitude>,<longitude>'.`);
141
+ }
142
+ return geolocationSchema.parse({
143
+ latitude: parts[0],
144
+ longitude: parts[1],
145
+ });
146
+ }
147
+ const jsonObjectSchema = zod.record(zod.string(), zod.unknown());
148
+ export function jsonObjectTransform(arg) {
149
+ if (!arg) {
150
+ return undefined;
151
+ }
152
+ return jsonObjectSchema.parse(JSON.parse(arg));
153
+ }
154
+ export function isSlimTool(tool) {
155
+ return Boolean(tool.annotations.conditions?.includes('slim'));
156
+ }
157
+ /**
158
+ * Slim mode replaces the regular tools with the slim tools.
159
+ */
160
+ export function isAvailableInMode(tool, serverArgs) {
161
+ return isSlimTool(tool) === Boolean(serverArgs.slim);
162
+ }
163
+ /**
164
+ * Returns whether a capability gate is enabled under the given arguments.
165
+ */
166
+ export function isCapabilityEnabled(gate, serverArgs) {
167
+ if (Boolean(gate.conditions?.includes('slim')) !== Boolean(serverArgs.slim)) {
168
+ return false;
169
+ }
170
+ if (gate.category && !serverArgs[categoryToFlagName(gate.category)]) {
171
+ return false;
172
+ }
173
+ for (const condition of gate.conditions ?? []) {
174
+ if (!serverArgs[condition]) {
175
+ return false;
176
+ }
177
+ }
178
+ return true;
179
+ }
180
+ //# sourceMappingURL=ToolDefinition.js.map
@@ -10,12 +10,14 @@ export var ToolCategory;
10
10
  ToolCategory["EMULATION"] = "emulation";
11
11
  ToolCategory["PERFORMANCE"] = "performance";
12
12
  ToolCategory["NETWORK"] = "network";
13
+ ToolCategory["NETWORK_MOCKS"] = "networkMocks";
13
14
  ToolCategory["DEBUGGING"] = "debugging";
14
15
  ToolCategory["EXTENSIONS"] = "extensions";
15
16
  ToolCategory["THIRD_PARTY"] = "experimentalThirdParty";
16
17
  ToolCategory["MEMORY"] = "memory";
17
18
  ToolCategory["WEBMCP"] = "experimentalWebmcp";
18
19
  ToolCategory["PWA"] = "pwa";
20
+ ToolCategory["WEBAUTHN"] = "webauthn";
19
21
  })(ToolCategory || (ToolCategory = {}));
20
22
  export const labels = {
21
23
  [ToolCategory.INPUT]: 'Input automation',
@@ -23,11 +25,13 @@ export const labels = {
23
25
  [ToolCategory.EMULATION]: 'Emulation',
24
26
  [ToolCategory.PERFORMANCE]: 'Performance',
25
27
  [ToolCategory.NETWORK]: 'Network',
28
+ [ToolCategory.NETWORK_MOCKS]: 'Network mocks',
26
29
  [ToolCategory.DEBUGGING]: 'Debugging',
27
30
  [ToolCategory.EXTENSIONS]: 'Extensions',
28
31
  [ToolCategory.THIRD_PARTY]: 'Third-party',
29
32
  [ToolCategory.MEMORY]: 'Memory',
30
33
  [ToolCategory.WEBMCP]: 'WebMCP',
31
34
  [ToolCategory.PWA]: 'Progressive Web Apps',
35
+ [ToolCategory.WEBAUTHN]: 'WebAuthn',
32
36
  };
33
37
  //# sourceMappingURL=categories.js.map
@@ -17,11 +17,15 @@ export const openDevtools = definePageTool(() => ({
17
17
  },
18
18
  schema: {},
19
19
  blockedByDialog: false,
20
+ concurrency: 'exclusive',
20
21
  verifyFilesSchema: [],
21
22
  handler: async (request, response) => {
22
23
  const page = request.page;
23
24
  try {
24
- await page.openDevTools();
25
+ const devtoolsPage = await page.openDevTools();
26
+ if (devtoolsPage) {
27
+ await page.ensureDevToolsCommentBridge(devtoolsPage);
28
+ }
25
29
  response.appendResponseLine('DevTools window opened successfully.');
26
30
  }
27
31
  catch (e) {
@@ -31,16 +35,33 @@ export const openDevtools = definePageTool(() => ({
31
35
  response.setIncludePages(true);
32
36
  },
33
37
  }));
38
+ const DEFAULT_COMMENT_WAIT_MS = 10_000;
39
+ const MAX_COMMENT_WAIT_MS = 30_000;
34
40
  export const getDevtoolsComments = definePageTool(() => ({
35
41
  name: 'get_devtools_comments',
36
- description: 'Retrieve user comments from the DevTools window for the page.',
42
+ description: 'Retrieve user comments from the DevTools window for the page. ' +
43
+ 'If no comment is pending, waits up to `timeout` ms for the user to send one, then returns. ' +
44
+ 'Call it again to keep waiting.',
37
45
  annotations: {
38
46
  category: ToolCategory.DEBUGGING,
39
47
  readOnlyHint: true,
40
48
  conditions: ['devtoolsComments'],
41
49
  },
42
- schema: {},
50
+ schema: {
51
+ timeout: zod
52
+ .number()
53
+ .int()
54
+ .min(0)
55
+ .max(MAX_COMMENT_WAIT_MS)
56
+ .optional()
57
+ .describe(`Maximum time in milliseconds to wait for a new comment when none is pending. ` +
58
+ `Defaults to ${DEFAULT_COMMENT_WAIT_MS}, maximum ${MAX_COMMENT_WAIT_MS}. ` +
59
+ `Set to 0 to return immediately without waiting.`),
60
+ },
43
61
  blockedByDialog: false,
62
+ // The handler only reads page state and waits for comment events, so it
63
+ // runs outside the task runner and other tools run during the wait.
64
+ concurrency: 'none',
44
65
  verifyFilesSchema: {},
45
66
  handler: async (request, response) => {
46
67
  const page = request.page;
@@ -54,7 +75,26 @@ export const getDevtoolsComments = definePageTool(() => ({
54
75
  response.appendResponseLine(DEVTOOLS_COMMENTS_UNAVAILABLE_MESSAGE);
55
76
  return;
56
77
  }
57
- const threads = await bridge.getComments(devtoolsPage);
78
+ const timeout = request.params.timeout ?? DEFAULT_COMMENT_WAIT_MS;
79
+ const start = Date.now();
80
+ const deadline = start + timeout;
81
+ let threads = await bridge.getComments(devtoolsPage);
82
+ while (threads.length === 0) {
83
+ const remaining = deadline - Date.now();
84
+ if (remaining <= 0) {
85
+ break;
86
+ }
87
+ const changed = await bridge.waitForCommentEvent(remaining);
88
+ if (!changed) {
89
+ break;
90
+ }
91
+ // Another tool may have changed state during the wait, so fetch again.
92
+ threads = await bridge.getComments(devtoolsPage);
93
+ }
94
+ if (threads.length === 0 && timeout > 0) {
95
+ response.appendResponseLine(`Waited ${Date.now() - start}ms for new DevTools comments. Call get_devtools_comments again to keep waiting.`);
96
+ return;
97
+ }
58
98
  response.setDevToolsComments(threads);
59
99
  },
60
100
  }));
@@ -76,6 +116,7 @@ export const resolveDevtoolsComment = definePageTool(() => ({
76
116
  .describe('Optional reply explanation from the AI agent to append to the resolved comment thread.'),
77
117
  },
78
118
  blockedByDialog: false,
119
+ concurrency: 'exclusive',
79
120
  verifyFilesSchema: {},
80
121
  handler: async (request, response) => {
81
122
  const page = request.page;
@@ -126,6 +167,7 @@ export const revealInDevtools = definePageTool(() => ({
126
167
  .describe('Optional network request ID to reveal in the Network panel.'),
127
168
  },
128
169
  blockedByDialog: false,
170
+ concurrency: 'exclusive',
129
171
  verifyFilesSchema: {},
130
172
  handler: async (request, response) => {
131
173
  const page = request.page;
@@ -6,6 +6,7 @@
6
6
  import { zod } from '../third_party/index.js';
7
7
  import { ToolCategory } from './categories.js';
8
8
  import { definePageTool } from './ToolDefinition.js';
9
+ import { GET_CONSOLE_MESSAGE_TOOL_NAME, LIST_CONSOLE_MESSAGES_TOOL_NAME, } from './toolNames.js';
9
10
  const FILTERABLE_MESSAGE_TYPES = [
10
11
  'log',
11
12
  'debug',
@@ -28,11 +29,10 @@ const FILTERABLE_MESSAGE_TYPES = [
28
29
  'verbose',
29
30
  'issue',
30
31
  ];
31
- const LIST_CONSOLE_MESSAGES_TOOL_NAME = 'list_console_messages';
32
32
  export const listConsoleMessages = definePageTool((cliArgs) => {
33
33
  return {
34
34
  name: LIST_CONSOLE_MESSAGES_TOOL_NAME,
35
- description: `List all console messages for the target page since the last navigation.${cliArgs?.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
35
+ description: `List all console messages for the target page since the last navigation.${cliArgs.categoryExtensions ? ' This includes console messages originating from extensions content scripts.' : ''}`,
36
36
  annotations: {
37
37
  category: ToolCategory.DEBUGGING,
38
38
  readOnlyHint: true,
@@ -49,7 +49,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
49
49
  .int()
50
50
  .min(0)
51
51
  .optional()
52
- .describe('Page number to return (0-based). When omitted, returns the first page.'),
52
+ .describe('Page number to return (0-based). When omitted, returns the first page. Ignored unless pageSize is set.'),
53
53
  types: zod
54
54
  .array(zod.enum(FILTERABLE_MESSAGE_TYPES))
55
55
  .optional()
@@ -58,7 +58,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
58
58
  .boolean()
59
59
  .default(false)
60
60
  .optional()
61
- .describe('Set to true to return the preserved messages over the last 3 navigations.'),
61
+ .describe(`Set to true to return the preserved messages over the last ${cliArgs.maxNavigationSaved} navigations.`),
62
62
  includeStackTraces: zod
63
63
  .boolean()
64
64
  .default(false)
@@ -67,9 +67,10 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
67
67
  serviceWorkerId: zod
68
68
  .string()
69
69
  .optional()
70
- .describe('Filter messages to only return messages of the specified service worker.'),
70
+ .describe('Filter messages by the service worker ID shown by list_pages (sw-N).'),
71
71
  },
72
72
  blockedByDialog: false,
73
+ concurrency: 'page',
73
74
  verifyFilesSchema: {},
74
75
  handler: async (request, response) => {
75
76
  response.setIncludeConsoleData(true, {
@@ -84,7 +85,7 @@ export const listConsoleMessages = definePageTool((cliArgs) => {
84
85
  };
85
86
  });
86
87
  export const getConsoleMessage = definePageTool(() => ({
87
- name: 'get_console_message',
88
+ name: GET_CONSOLE_MESSAGE_TOOL_NAME,
88
89
  description: `Gets a console message by its ID. You can get all messages by calling ${LIST_CONSOLE_MESSAGES_TOOL_NAME}.`,
89
90
  annotations: {
90
91
  category: ToolCategory.DEBUGGING,
@@ -96,6 +97,7 @@ export const getConsoleMessage = definePageTool(() => ({
96
97
  .describe('The msgid of a console message on the page from the listed console messages'),
97
98
  },
98
99
  blockedByDialog: false,
100
+ concurrency: 'page',
99
101
  verifyFilesSchema: {},
100
102
  handler: async (request, response) => {
101
103
  response.attachConsoleMessage(request.params.msgid);
@@ -34,6 +34,7 @@ Results are paginated (10 rules per page by default); use pageIdx to page throug
34
34
  .describe('Page number to return (0-based). Defaults to 0 (the first page).'),
35
35
  },
36
36
  blockedByDialog: true,
37
+ concurrency: 'page',
37
38
  verifyFilesSchema: {},
38
39
  handler: async (request, response) => {
39
40
  const matchedStyles = await request.page.getMatchedStylesForUid(request.params.uid);
@@ -7,7 +7,7 @@
7
7
  import { zod, PredefinedNetworkConditions } from '../third_party/index.js';
8
8
  import { FORCED_COLORS_VALUES, PREFERS_CONTRAST_VALUES, PREFERS_REDUCED_MOTION_VALUES, } from '../types.js';
9
9
  import { ToolCategory } from './categories.js';
10
- import { definePageTool, geolocationTransform, viewportTransform, } from './ToolDefinition.js';
10
+ import { definePageTool, geolocationTransform, viewportTransform, zodTransform, } from './ToolDefinition.js';
11
11
  function headerStringTransform(value) {
12
12
  if (value === undefined) {
13
13
  return undefined;
@@ -52,7 +52,7 @@ export const emulate = definePageTool(() => ({
52
52
  .describe('Represents the CPU slowdown factor. Omit or set the rate to 1 to disable throttling'),
53
53
  geolocation: zod
54
54
  .string()
55
- .transform(geolocationTransform)
55
+ .transform(zodTransform(geolocationTransform))
56
56
  .optional()
57
57
  .describe('Geolocation (`<latitude>,<longitude>`) to emulate. Latitude between -90 and 90. Longitude between -180 and 180. Omit to clear the geolocation override.'),
58
58
  userAgent: zod
@@ -77,16 +77,17 @@ export const emulate = definePageTool(() => ({
77
77
  .describe('Emulate the `prefers-reduced-motion` CSS media feature. Omit or set to "auto" to reset to the default.'),
78
78
  viewport: zod
79
79
  .string()
80
- .transform(viewportTransform)
80
+ .transform(zodTransform(viewportTransform))
81
81
  .optional()
82
82
  .describe(`Emulate device viewports '<width>x<height>x<devicePixelRatio>[,mobile][,touch][,landscape]'. 'touch' and 'mobile' to emulate mobile devices. 'landscape' to emulate landscape mode. Omit to clear the viewport override.`),
83
83
  extraHttpHeaders: zod
84
84
  .string()
85
- .transform(headerStringTransform)
85
+ .transform(zodTransform(headerStringTransform))
86
86
  .optional()
87
87
  .describe('Extra HTTP headers as a JSON string object, e.g. {"X-Custom": "value", "Authorization": "Bearer token"}. Headers are included into every HTTP request originating from the page and persist across navigations until cleared. Pass an empty string to clear all extra headers.'),
88
88
  },
89
89
  blockedByDialog: true,
90
+ concurrency: 'exclusive',
90
91
  verifyFilesSchema: {},
91
92
  handler: async (request, response) => {
92
93
  const page = request.page;
@@ -19,6 +19,7 @@ export const installExtension = defineTool(() => ({
19
19
  .describe('Absolute path to the unpacked extension folder.'),
20
20
  },
21
21
  blockedByDialog: false,
22
+ concurrency: 'exclusive',
22
23
  verifyFilesSchema: {
23
24
  path: { local: true },
24
25
  },
@@ -39,6 +40,7 @@ export const uninstallExtension = defineTool(() => ({
39
40
  id: zod.string().describe('ID of the extension to uninstall.'),
40
41
  },
41
42
  blockedByDialog: false,
43
+ concurrency: 'exclusive',
42
44
  verifyFilesSchema: {},
43
45
  handler: async (request, response, context) => {
44
46
  const { id } = request.params;
@@ -48,13 +50,14 @@ export const uninstallExtension = defineTool(() => ({
48
50
  }));
49
51
  export const listExtensions = defineTool(() => ({
50
52
  name: 'list_extensions',
51
- description: 'Lists all the Chrome extensions installed in the browser. This includes their name, ID, version, and enabled status.',
53
+ 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.',
52
54
  annotations: {
53
55
  category: ToolCategory.EXTENSIONS,
54
56
  readOnlyHint: true,
55
57
  },
56
58
  schema: {},
57
59
  blockedByDialog: false,
60
+ concurrency: 'exclusive',
58
61
  verifyFilesSchema: {},
59
62
  handler: async (_request, response) => {
60
63
  response.setListExtensions();
@@ -71,6 +74,7 @@ export const reloadExtension = defineTool(() => ({
71
74
  id: zod.string().describe('ID of the extension to reload.'),
72
75
  },
73
76
  blockedByDialog: false,
77
+ concurrency: 'exclusive',
74
78
  verifyFilesSchema: {},
75
79
  handler: async (request, response, context) => {
76
80
  const { id } = request.params;
@@ -93,6 +97,7 @@ export const triggerExtensionAction = defineTool(() => ({
93
97
  id: zod.string().describe('ID of the extension to trigger the action for.'),
94
98
  },
95
99
  blockedByDialog: false,
100
+ concurrency: 'exclusive',
96
101
  verifyFilesSchema: {},
97
102
  handler: async (request, response, context) => {
98
103
  const { id } = request.params;
@@ -55,11 +55,12 @@ var __disposeResources = (this && this.__disposeResources) || (function (Suppres
55
55
  var e = new Error(message);
56
56
  return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
57
57
  });
58
- import { TimeoutError, zod } from '../third_party/index.js';
59
- import { parseKey } from '../utils/keyboard.js';
58
+ import { TimeoutError, zod, } from '../third_party/index.js';
59
+ import { parseKey, throwIfInvalidKey } from '../utils/keyboard.js';
60
60
  import { logger } from '../utils/logger.js';
61
+ import { raceWithSignal } from '../utils/raceWithSignal.js';
61
62
  import { ToolCategory } from './categories.js';
62
- import { definePageTool } from './ToolDefinition.js';
63
+ import { definePageTool, zodTransform, } from './ToolDefinition.js';
63
64
  const dblClickSchema = zod
64
65
  .boolean()
65
66
  .optional()
@@ -70,6 +71,8 @@ const includeSnapshotSchema = zod
70
71
  .describe('Whether to include a snapshot in the response. Default is false.');
71
72
  const submitKeySchema = zod
72
73
  .string()
74
+ // An empty string means no submit key, as before.
75
+ .transform(zodTransform((key) => key === '' ? undefined : throwIfInvalidKey(key)))
73
76
  .optional()
74
77
  .describe('Optional key to press after typing. E.g., "Enter", "Tab", "Escape"');
75
78
  /**
@@ -146,6 +149,7 @@ export const click = definePageTool(() => ({
146
149
  includeSnapshot: includeSnapshotSchema,
147
150
  },
148
151
  blockedByDialog: true,
152
+ concurrency: 'page',
149
153
  verifyFilesSchema: {},
150
154
  handler: async (request, response) => {
151
155
  const env_2 = { stack: [], error: void 0, hasError: false };
@@ -204,6 +208,7 @@ export const clickAt = definePageTool(() => ({
204
208
  includeSnapshot: includeSnapshotSchema,
205
209
  },
206
210
  blockedByDialog: true,
211
+ concurrency: 'page',
207
212
  verifyFilesSchema: {},
208
213
  handler: async (request, response) => {
209
214
  const page = request.page;
@@ -235,6 +240,7 @@ export const hover = definePageTool(() => ({
235
240
  includeSnapshot: includeSnapshotSchema,
236
241
  },
237
242
  blockedByDialog: true,
243
+ concurrency: 'page',
238
244
  verifyFilesSchema: {},
239
245
  handler: async (request, response) => {
240
246
  const env_3 = { stack: [], error: void 0, hasError: false };
@@ -265,24 +271,6 @@ export const hover = definePageTool(() => ({
265
271
  }
266
272
  },
267
273
  }));
268
- function raceWithSignal(promise, signal) {
269
- if (signal.aborted) {
270
- return Promise.reject(signal.reason);
271
- }
272
- return new Promise((resolve, reject) => {
273
- const onAbort = () => {
274
- reject(signal.reason);
275
- };
276
- signal.addEventListener('abort', onAbort, { once: true });
277
- Promise.resolve(promise).then(value => {
278
- signal.removeEventListener('abort', onAbort);
279
- resolve(value);
280
- }, error => {
281
- signal.removeEventListener('abort', onAbort);
282
- reject(error);
283
- });
284
- });
285
- }
286
274
  // The AXNode for an option doesn't contain its `value`. We set text content of the option as value.
287
275
  // If the form is a combobox, we need to find the correct option by its text value.
288
276
  // To do that, loop through the children while checking which child's text matches the requested value (requested value is actually the text content).
@@ -422,6 +410,7 @@ export const fill = definePageTool(() => ({
422
410
  includeSnapshot: includeSnapshotSchema,
423
411
  },
424
412
  blockedByDialog: true,
413
+ concurrency: 'page',
425
414
  verifyFilesSchema: {},
426
415
  handler: async (request, response) => {
427
416
  const { result } = await fillFormElements([{ uid: request.params.uid, value: request.params.value }], request.page);
@@ -448,16 +437,18 @@ export const typeText = definePageTool(() => ({
448
437
  submitKey: submitKeySchema,
449
438
  },
450
439
  blockedByDialog: true,
440
+ concurrency: 'page',
451
441
  verifyFilesSchema: {},
452
442
  handler: async (request, response) => {
453
443
  const page = request.page;
444
+ const submitKey = request.params.submitKey;
454
445
  const result = await page.waitForEventsAfterAction(async () => {
455
446
  await page.pptrPage.keyboard.type(request.params.text);
456
- if (request.params.submitKey) {
457
- await page.pptrPage.keyboard.press(request.params.submitKey);
447
+ if (submitKey) {
448
+ await page.pptrPage.keyboard.press(submitKey);
458
449
  }
459
450
  });
460
- response.appendResponseLine(`Typed text "${request.params.text}${request.params.submitKey ? ` + ${request.params.submitKey}` : ''}"`);
451
+ response.appendResponseLine(`Typed text "${request.params.text}${submitKey ? ` + ${submitKey}` : ''}"`);
461
452
  response.attachWaitForResult(result);
462
453
  },
463
454
  }));
@@ -474,6 +465,7 @@ export const drag = definePageTool(() => ({
474
465
  includeSnapshot: includeSnapshotSchema,
475
466
  },
476
467
  blockedByDialog: true,
468
+ concurrency: 'page',
477
469
  verifyFilesSchema: {},
478
470
  handler: async (request, response) => {
479
471
  const env_7 = { stack: [], error: void 0, hasError: false };
@@ -523,6 +515,7 @@ export const fillForm = definePageTool(() => ({
523
515
  includeSnapshot: includeSnapshotSchema,
524
516
  },
525
517
  blockedByDialog: true,
518
+ concurrency: 'page',
526
519
  verifyFilesSchema: {},
527
520
  handler: async (request, response) => {
528
521
  const { result, interruptedUid } = await fillFormElements(request.params.elements, request.page);
@@ -560,6 +553,7 @@ export const uploadFile = definePageTool(() => ({
560
553
  includeSnapshot: includeSnapshotSchema,
561
554
  },
562
555
  blockedByDialog: true,
556
+ concurrency: 'page',
563
557
  // We do not validate file paths for remote browser instances
564
558
  // because they are on the remote host and not accessed by the MCP server.
565
559
  verifyFilesSchema: {
@@ -612,7 +606,7 @@ export const uploadFile = definePageTool(() => ({
612
606
  }));
613
607
  export const pressKey = definePageTool(() => ({
614
608
  name: 'press_key',
615
- 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).`,
609
+ 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.`,
616
610
  annotations: {
617
611
  category: ToolCategory.INPUT,
618
612
  readOnlyHint: false,
@@ -620,15 +614,16 @@ export const pressKey = definePageTool(() => ({
620
614
  schema: {
621
615
  key: zod
622
616
  .string()
617
+ .transform(zodTransform(parseKey))
623
618
  .describe('A key or a combination (e.g., "Enter", "Control+A", "Control++", "Control+Shift+R"). Modifiers: Control, Shift, Alt, Meta'),
624
619
  includeSnapshot: includeSnapshotSchema,
625
620
  },
626
621
  blockedByDialog: true,
622
+ concurrency: 'page',
627
623
  verifyFilesSchema: {},
628
624
  handler: async (request, response) => {
629
625
  const page = request.page;
630
- const tokens = parseKey(request.params.key);
631
- const [key, ...modifiers] = tokens;
626
+ const [key, ...modifiers] = request.params.key;
632
627
  const result = await page.waitForEventsAfterAction(async () => {
633
628
  const heldModifiers = [];
634
629
  try {
@@ -647,7 +642,7 @@ export const pressKey = definePageTool(() => ({
647
642
  }
648
643
  }
649
644
  });
650
- response.appendResponseLine(`Successfully pressed key: ${request.params.key}`);
645
+ response.appendResponseLine(`Successfully pressed key: ${[...modifiers, key].join('+')}`);
651
646
  response.attachWaitForResult(result);
652
647
  if (request.params.includeSnapshot) {
653
648
  response.includeSnapshot();