@smoothdeploy/playwright-core 1.57.1 → 1.58.1-beta-1770452953000

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.

Potentially problematic release.


This version of @smoothdeploy/playwright-core might be problematic. Click here for more details.

Files changed (155) hide show
  1. package/ThirdPartyNotices.txt +3223 -308
  2. package/browsers.json +21 -22
  3. package/lib/cli/program.js +4 -5
  4. package/lib/client/api.js +3 -0
  5. package/lib/client/browser.js +3 -5
  6. package/lib/client/browserContext.js +35 -0
  7. package/lib/client/browserType.js +4 -3
  8. package/lib/client/channelOwner.js +4 -3
  9. package/lib/client/clientInstrumentation.js +10 -0
  10. package/lib/client/connection.js +4 -0
  11. package/lib/client/elementHandle.js +3 -0
  12. package/lib/client/events.js +3 -0
  13. package/lib/client/fetch.js +3 -4
  14. package/lib/client/frame.js +1 -0
  15. package/lib/client/page.js +28 -1
  16. package/lib/client/pageAgent.js +64 -0
  17. package/lib/client/platform.js +3 -0
  18. package/lib/generated/injectedScriptSource.js +1 -1
  19. package/lib/generated/pollingRecorderSource.js +1 -1
  20. package/lib/mcpBundle.js +84 -0
  21. package/lib/mcpBundleImpl/index.js +147 -0
  22. package/lib/protocol/serializers.js +5 -0
  23. package/lib/protocol/validator.js +92 -3
  24. package/lib/remote/playwrightServer.js +1 -2
  25. package/lib/server/agent/actionRunner.js +335 -0
  26. package/lib/server/agent/actions.js +128 -0
  27. package/lib/server/agent/codegen.js +111 -0
  28. package/lib/server/agent/context.js +150 -0
  29. package/lib/server/agent/expectTools.js +156 -0
  30. package/lib/server/agent/pageAgent.js +204 -0
  31. package/lib/server/agent/performTools.js +262 -0
  32. package/lib/server/agent/tool.js +109 -0
  33. package/lib/server/artifact.js +1 -1
  34. package/lib/server/bidi/bidiBrowser.js +56 -12
  35. package/lib/server/bidi/bidiChromium.js +6 -11
  36. package/lib/server/bidi/bidiConnection.js +1 -0
  37. package/lib/server/bidi/bidiDeserializer.js +116 -0
  38. package/lib/server/bidi/bidiExecutionContext.js +75 -29
  39. package/lib/server/bidi/bidiFirefox.js +6 -8
  40. package/lib/server/bidi/bidiNetworkManager.js +1 -1
  41. package/lib/server/bidi/bidiPage.js +39 -28
  42. package/lib/server/bidi/third_party/bidiProtocolCore.js +1 -0
  43. package/lib/server/browserContext.js +32 -25
  44. package/lib/server/browserType.js +12 -4
  45. package/lib/server/chromium/chromium.js +14 -21
  46. package/lib/server/chromium/chromiumSwitches.js +2 -2
  47. package/lib/server/chromium/crBrowser.js +22 -12
  48. package/lib/server/chromium/crConnection.js +0 -5
  49. package/lib/server/chromium/crDevTools.js +0 -2
  50. package/lib/server/chromium/crNetworkManager.js +43 -2
  51. package/lib/server/chromium/crPage.js +19 -87
  52. package/lib/server/codegen/javascript.js +6 -29
  53. package/lib/server/deviceDescriptorsSource.json +56 -56
  54. package/lib/server/dispatchers/browserContextDispatcher.js +3 -0
  55. package/lib/server/dispatchers/dispatcher.js +6 -13
  56. package/lib/server/dispatchers/frameDispatcher.js +1 -1
  57. package/lib/server/dispatchers/pageAgentDispatcher.js +96 -0
  58. package/lib/server/dispatchers/pageDispatcher.js +4 -0
  59. package/lib/server/dom.js +12 -3
  60. package/lib/server/electron/electron.js +5 -2
  61. package/lib/server/firefox/ffBrowser.js +10 -20
  62. package/lib/server/firefox/ffConnection.js +0 -5
  63. package/lib/server/firefox/ffNetworkManager.js +2 -2
  64. package/lib/server/firefox/ffPage.js +15 -18
  65. package/lib/server/firefox/firefox.js +6 -8
  66. package/lib/server/frameSelectors.js +9 -3
  67. package/lib/server/frames.js +49 -33
  68. package/lib/server/instrumentation.js +3 -0
  69. package/lib/server/network.js +50 -12
  70. package/lib/server/page.js +33 -89
  71. package/lib/server/progress.js +26 -6
  72. package/lib/server/recorder/recorderApp.js +79 -100
  73. package/lib/server/recorder.js +55 -0
  74. package/lib/server/registry/browserFetcher.js +6 -4
  75. package/lib/server/registry/index.js +172 -149
  76. package/lib/server/registry/oopDownloadBrowserMain.js +3 -0
  77. package/lib/server/screencast.js +190 -0
  78. package/lib/server/screenshotCompositor.js +153 -0
  79. package/lib/server/trace/recorder/snapshotterInjected.js +21 -1
  80. package/lib/server/trace/recorder/tracing.js +21 -21
  81. package/lib/server/trace/viewer/traceParser.js +72 -0
  82. package/lib/server/trace/viewer/traceViewer.js +17 -13
  83. package/lib/server/utils/expectUtils.js +87 -2
  84. package/lib/server/utils/httpServer.js +4 -19
  85. package/lib/server/utils/network.js +37 -28
  86. package/lib/server/utils/nodePlatform.js +6 -0
  87. package/lib/server/videoRecorder.js +124 -0
  88. package/lib/server/webkit/webkit.js +4 -6
  89. package/lib/server/webkit/wkBrowser.js +2 -6
  90. package/lib/server/webkit/wkConnection.js +1 -6
  91. package/lib/server/webkit/wkInterceptableRequest.js +29 -1
  92. package/lib/server/webkit/wkPage.js +75 -46
  93. package/lib/utils/isomorphic/ariaSnapshot.js +60 -2
  94. package/lib/utils/isomorphic/lruCache.js +51 -0
  95. package/lib/utils/isomorphic/protocolMetainfo.js +9 -1
  96. package/lib/utils/isomorphic/stringUtils.js +49 -0
  97. package/lib/utils/isomorphic/trace/entries.js +16 -0
  98. package/lib/utils/isomorphic/trace/snapshotRenderer.js +499 -0
  99. package/lib/utils/isomorphic/trace/snapshotServer.js +120 -0
  100. package/lib/utils/isomorphic/trace/snapshotStorage.js +89 -0
  101. package/lib/utils/isomorphic/trace/traceLoader.js +131 -0
  102. package/lib/utils/isomorphic/trace/traceModel.js +365 -0
  103. package/lib/utils/isomorphic/trace/traceModernizer.js +400 -0
  104. package/lib/utils/isomorphic/trace/versions/traceV3.js +16 -0
  105. package/lib/utils/isomorphic/trace/versions/traceV4.js +16 -0
  106. package/lib/utils/isomorphic/trace/versions/traceV5.js +16 -0
  107. package/lib/utils/isomorphic/trace/versions/traceV6.js +16 -0
  108. package/lib/utils/isomorphic/trace/versions/traceV7.js +16 -0
  109. package/lib/utils/isomorphic/trace/versions/traceV8.js +16 -0
  110. package/lib/utils/isomorphic/yaml.js +84 -0
  111. package/lib/utils.js +2 -0
  112. package/lib/utilsBundle.js +2 -5
  113. package/lib/utilsBundleImpl/index.js +165 -165
  114. package/lib/vite/htmlReport/index.html +21 -21
  115. package/lib/vite/recorder/assets/{codeMirrorModule-C3UTv-Ge.css → codeMirrorModule-DYBRYzYX.css} +1 -1
  116. package/lib/vite/recorder/assets/codeMirrorModule-DadYNm1I.js +32 -0
  117. package/lib/vite/recorder/assets/{index-Ri0uHF7I.css → index-BSjZa4pk.css} +1 -1
  118. package/lib/vite/recorder/assets/index-BhTWtUlo.js +193 -0
  119. package/lib/vite/recorder/index.html +2 -2
  120. package/lib/vite/traceViewer/assets/codeMirrorModule-8UJPCtp4.js +16884 -0
  121. package/lib/vite/{recorder/assets/codeMirrorModule-BoWUGj0J.js → traceViewer/assets/codeMirrorModule-BNr6yhVP.js} +1 -1
  122. package/lib/vite/traceViewer/assets/codeMirrorModule-Dimjuz94.js +32 -0
  123. package/lib/vite/traceViewer/assets/codeMirrorModule-DkmsYcws.js +32 -0
  124. package/lib/vite/traceViewer/assets/codeMirrorModule-DySgctgr.js +16884 -0
  125. package/lib/vite/traceViewer/assets/defaultSettingsView-B1vuWQsF.js +266 -0
  126. package/lib/vite/traceViewer/assets/defaultSettingsView-CtEsdeVH.js +266 -0
  127. package/lib/vite/traceViewer/assets/defaultSettingsView-D4fm31R-.js +34087 -0
  128. package/lib/vite/traceViewer/assets/defaultSettingsView-JtyB0yzL.js +34087 -0
  129. package/lib/vite/traceViewer/assets/defaultSettingsView-tEZf-LNj.js +266 -0
  130. package/lib/vite/traceViewer/assets/xtermModule-DDw6eROI.js +6168 -0
  131. package/lib/vite/traceViewer/codeMirrorModule.DYBRYzYX.css +1 -0
  132. package/lib/vite/traceViewer/codeMirrorModule.DuST8d_k.css +344 -0
  133. package/lib/vite/traceViewer/defaultSettingsView.5FCqBwKs.css +3986 -0
  134. package/lib/vite/traceViewer/defaultSettingsView.7ch9cixO.css +1 -0
  135. package/lib/vite/traceViewer/index.BQs8gGhY.js +249 -0
  136. package/lib/vite/traceViewer/index.BVu7tZDe.css +1 -0
  137. package/lib/vite/traceViewer/index.BoLn624r.js +2 -0
  138. package/lib/vite/traceViewer/index.Bq_EaK8x.js +249 -0
  139. package/lib/vite/traceViewer/index.C8YVh4B5.js +2 -0
  140. package/lib/vite/traceViewer/index.Cr7-GRf8.js +2 -0
  141. package/lib/vite/traceViewer/index.G-7UhDxt.css +164 -0
  142. package/lib/vite/traceViewer/index.html +4 -4
  143. package/lib/vite/traceViewer/sw.bundle.js +5 -3
  144. package/lib/vite/traceViewer/uiMode.-Kflt2XM.css +1440 -0
  145. package/lib/vite/traceViewer/uiMode.BTRKnokb.js +5 -0
  146. package/lib/vite/traceViewer/uiMode.CEZ5RVHh.js +5 -0
  147. package/lib/vite/traceViewer/uiMode.CIWF23si.js +1829 -0
  148. package/lib/vite/traceViewer/uiMode.Wi-DvIEY.js +1829 -0
  149. package/lib/vite/traceViewer/uiMode.html +3 -3
  150. package/lib/vite/traceViewer/uiMode.zEH1ejvz.js +5 -0
  151. package/lib/vite/traceViewer/xtermModule.BKlWQB97.css +218 -0
  152. package/package.json +3 -1
  153. package/types/protocol.d.ts +738 -159
  154. package/types/types.d.ts +25 -38
  155. package/lib/vite/recorder/assets/index-DJqDAOZp.js +0 -193
@@ -19,6 +19,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
19
19
  var serializers_exports = {};
20
20
  __export(serializers_exports, {
21
21
  parseSerializedValue: () => parseSerializedValue,
22
+ serializePlainValue: () => serializePlainValue,
22
23
  serializeValue: () => serializeValue
23
24
  });
24
25
  module.exports = __toCommonJS(serializers_exports);
@@ -90,6 +91,9 @@ function innerParseSerializedValue(value, handles, refs, accessChain) {
90
91
  function serializeValue(value, handleSerializer) {
91
92
  return innerSerializeValue(value, handleSerializer, { lastId: 0, visited: /* @__PURE__ */ new Map() }, []);
92
93
  }
94
+ function serializePlainValue(arg) {
95
+ return serializeValue(arg, (value) => ({ fallThrough: value }));
96
+ }
93
97
  function innerSerializeValue(value, handleSerializer, visitorInfo, accessChain) {
94
98
  const handle = handleSerializer(value);
95
99
  if ("fallThrough" in handle)
@@ -188,5 +192,6 @@ const constructorToTypedArrayKind = new Map(Object.entries(typedArrayKindToConst
188
192
  // Annotate the CommonJS export names for ESM import in node:
189
193
  0 && (module.exports = {
190
194
  parseSerializedValue,
195
+ serializePlainValue,
191
196
  serializeValue
192
197
  });
@@ -218,6 +218,16 @@ import_validatorPrimitives.scheme.ScriptStep = (0, import_validatorPrimitives.tO
218
218
  buffer: import_validatorPrimitives.tString,
219
219
  lastModifiedMs: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
220
220
  }))),
221
+ screenshot: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({
222
+ timestamp: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
223
+ mimeType: import_validatorPrimitives.tString,
224
+ buffer: import_validatorPrimitives.tString
225
+ })),
226
+ screenshotElement: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({
227
+ timestamp: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
228
+ mimeType: import_validatorPrimitives.tString,
229
+ buffer: import_validatorPrimitives.tString
230
+ })),
221
231
  substring: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
222
232
  value: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
223
233
  checked: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
@@ -553,7 +563,6 @@ import_validatorPrimitives.scheme.BrowserTypeLaunchParams = (0, import_validator
553
563
  timeout: import_validatorPrimitives.tFloat,
554
564
  env: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("NameValue"))),
555
565
  headless: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
556
- devtools: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
557
566
  proxy: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({
558
567
  server: import_validatorPrimitives.tString,
559
568
  bypass: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
@@ -583,7 +592,6 @@ import_validatorPrimitives.scheme.BrowserTypeLaunchPersistentContextParams = (0,
583
592
  timeout: import_validatorPrimitives.tFloat,
584
593
  env: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("NameValue"))),
585
594
  headless: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
586
- devtools: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
587
595
  proxy: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({
588
596
  server: import_validatorPrimitives.tString,
589
597
  bypass: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
@@ -662,7 +670,8 @@ import_validatorPrimitives.scheme.BrowserTypeConnectOverCDPParams = (0, import_v
662
670
  endpointURL: import_validatorPrimitives.tString,
663
671
  headers: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("NameValue"))),
664
672
  slowMo: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tFloat),
665
- timeout: import_validatorPrimitives.tFloat
673
+ timeout: import_validatorPrimitives.tFloat,
674
+ isLocal: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean)
666
675
  });
667
676
  import_validatorPrimitives.scheme.BrowserTypeConnectOverCDPResult = (0, import_validatorPrimitives.tObject)({
668
677
  browser: (0, import_validatorPrimitives.tChannel)(["Browser"]),
@@ -862,6 +871,7 @@ import_validatorPrimitives.scheme.WorkerWaitForEventInfoParams = (0, import_vali
862
871
  import_validatorPrimitives.scheme.WebSocketWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
863
872
  import_validatorPrimitives.scheme.ElectronApplicationWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
864
873
  import_validatorPrimitives.scheme.AndroidDeviceWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
874
+ import_validatorPrimitives.scheme.PageAgentWaitForEventInfoParams = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoParams");
865
875
  import_validatorPrimitives.scheme.EventTargetWaitForEventInfoResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
866
876
  import_validatorPrimitives.scheme.BrowserContextWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
867
877
  import_validatorPrimitives.scheme.PageWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
@@ -869,6 +879,7 @@ import_validatorPrimitives.scheme.WorkerWaitForEventInfoResult = (0, import_vali
869
879
  import_validatorPrimitives.scheme.WebSocketWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
870
880
  import_validatorPrimitives.scheme.ElectronApplicationWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
871
881
  import_validatorPrimitives.scheme.AndroidDeviceWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
882
+ import_validatorPrimitives.scheme.PageAgentWaitForEventInfoResult = (0, import_validatorPrimitives.tType)("EventTargetWaitForEventInfoResult");
872
883
  import_validatorPrimitives.scheme.BrowserContextInitializer = (0, import_validatorPrimitives.tObject)({
873
884
  isChromium: import_validatorPrimitives.tBoolean,
874
885
  requestContext: (0, import_validatorPrimitives.tChannel)(["APIRequestContext"]),
@@ -1116,6 +1127,8 @@ import_validatorPrimitives.scheme.BrowserContextEnableRecorderParams = (0, impor
1116
1127
  import_validatorPrimitives.scheme.BrowserContextEnableRecorderResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1117
1128
  import_validatorPrimitives.scheme.BrowserContextDisableRecorderParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1118
1129
  import_validatorPrimitives.scheme.BrowserContextDisableRecorderResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1130
+ import_validatorPrimitives.scheme.BrowserContextExposeConsoleApiParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1131
+ import_validatorPrimitives.scheme.BrowserContextExposeConsoleApiResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1119
1132
  import_validatorPrimitives.scheme.BrowserContextNewCDPSessionParams = (0, import_validatorPrimitives.tObject)({
1120
1133
  page: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Page"])),
1121
1134
  frame: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tChannel)(["Frame"]))
@@ -1531,6 +1544,25 @@ import_validatorPrimitives.scheme.PageUpdateSubscriptionParams = (0, import_vali
1531
1544
  enabled: import_validatorPrimitives.tBoolean
1532
1545
  });
1533
1546
  import_validatorPrimitives.scheme.PageUpdateSubscriptionResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
1547
+ import_validatorPrimitives.scheme.PageAgentParams = (0, import_validatorPrimitives.tObject)({
1548
+ api: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1549
+ apiKey: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1550
+ apiEndpoint: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1551
+ apiTimeout: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
1552
+ apiCacheFile: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1553
+ cacheFile: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1554
+ cacheOutFile: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1555
+ doNotRenderActive: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tBoolean),
1556
+ maxActions: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
1557
+ maxActionRetries: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
1558
+ maxTokens: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
1559
+ model: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
1560
+ secrets: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tArray)((0, import_validatorPrimitives.tType)("NameValue"))),
1561
+ systemPrompt: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString)
1562
+ });
1563
+ import_validatorPrimitives.scheme.PageAgentResult = (0, import_validatorPrimitives.tObject)({
1564
+ agent: (0, import_validatorPrimitives.tChannel)(["PageAgent"])
1565
+ });
1534
1566
  import_validatorPrimitives.scheme.FrameInitializer = (0, import_validatorPrimitives.tObject)({
1535
1567
  url: import_validatorPrimitives.tString,
1536
1568
  name: import_validatorPrimitives.tString,
@@ -2922,6 +2954,63 @@ import_validatorPrimitives.scheme.JsonPipeSendParams = (0, import_validatorPrimi
2922
2954
  import_validatorPrimitives.scheme.JsonPipeSendResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
2923
2955
  import_validatorPrimitives.scheme.JsonPipeCloseParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
2924
2956
  import_validatorPrimitives.scheme.JsonPipeCloseResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
2957
+ import_validatorPrimitives.scheme.PageAgentInitializer = (0, import_validatorPrimitives.tObject)({
2958
+ page: (0, import_validatorPrimitives.tChannel)(["Page"])
2959
+ });
2960
+ import_validatorPrimitives.scheme.PageAgentTurnEvent = (0, import_validatorPrimitives.tObject)({
2961
+ role: import_validatorPrimitives.tString,
2962
+ message: import_validatorPrimitives.tString,
2963
+ usage: (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({
2964
+ inputTokens: import_validatorPrimitives.tInt,
2965
+ outputTokens: import_validatorPrimitives.tInt
2966
+ }))
2967
+ });
2968
+ import_validatorPrimitives.scheme.PageAgentPerformParams = (0, import_validatorPrimitives.tObject)({
2969
+ task: import_validatorPrimitives.tString,
2970
+ maxActions: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2971
+ maxActionRetries: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2972
+ maxTokens: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2973
+ cacheKey: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
2974
+ timeout: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
2975
+ });
2976
+ import_validatorPrimitives.scheme.PageAgentPerformResult = (0, import_validatorPrimitives.tObject)({
2977
+ usage: (0, import_validatorPrimitives.tType)("AgentUsage")
2978
+ });
2979
+ import_validatorPrimitives.scheme.PageAgentExpectParams = (0, import_validatorPrimitives.tObject)({
2980
+ expectation: import_validatorPrimitives.tString,
2981
+ maxActions: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2982
+ maxActionRetries: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2983
+ maxTokens: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2984
+ cacheKey: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
2985
+ timeout: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
2986
+ });
2987
+ import_validatorPrimitives.scheme.PageAgentExpectResult = (0, import_validatorPrimitives.tObject)({
2988
+ usage: (0, import_validatorPrimitives.tType)("AgentUsage")
2989
+ });
2990
+ import_validatorPrimitives.scheme.PageAgentExtractParams = (0, import_validatorPrimitives.tObject)({
2991
+ query: import_validatorPrimitives.tString,
2992
+ schema: import_validatorPrimitives.tAny,
2993
+ maxActions: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2994
+ maxActionRetries: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2995
+ maxTokens: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt),
2996
+ cacheKey: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tString),
2997
+ timeout: (0, import_validatorPrimitives.tOptional)(import_validatorPrimitives.tInt)
2998
+ });
2999
+ import_validatorPrimitives.scheme.PageAgentExtractResult = (0, import_validatorPrimitives.tObject)({
3000
+ result: import_validatorPrimitives.tAny,
3001
+ usage: (0, import_validatorPrimitives.tType)("AgentUsage")
3002
+ });
3003
+ import_validatorPrimitives.scheme.PageAgentDisposeParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
3004
+ import_validatorPrimitives.scheme.PageAgentDisposeResult = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
3005
+ import_validatorPrimitives.scheme.PageAgentUsageParams = (0, import_validatorPrimitives.tOptional)((0, import_validatorPrimitives.tObject)({}));
3006
+ import_validatorPrimitives.scheme.PageAgentUsageResult = (0, import_validatorPrimitives.tObject)({
3007
+ usage: (0, import_validatorPrimitives.tType)("AgentUsage")
3008
+ });
3009
+ import_validatorPrimitives.scheme.AgentUsage = (0, import_validatorPrimitives.tObject)({
3010
+ turns: import_validatorPrimitives.tInt,
3011
+ inputTokens: import_validatorPrimitives.tInt,
3012
+ outputTokens: import_validatorPrimitives.tInt
3013
+ });
2925
3014
  // Annotate the CommonJS export names for ESM import in node:
2926
3015
  0 && (module.exports = {
2927
3016
  ValidationError,
@@ -321,8 +321,7 @@ const defaultLaunchOptions = {
321
321
  handleSIGINT: false,
322
322
  handleSIGTERM: false,
323
323
  handleSIGHUP: false,
324
- headless: true,
325
- devtools: false
324
+ headless: true
326
325
  };
327
326
  const optionsThatAllowBrowserReuse = [
328
327
  "headless",
@@ -0,0 +1,335 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var actionRunner_exports = {};
20
+ __export(actionRunner_exports, {
21
+ runAction: () => runAction,
22
+ traceParamsForAction: () => traceParamsForAction
23
+ });
24
+ module.exports = __toCommonJS(actionRunner_exports);
25
+ var import_expectUtils = require("../utils/expectUtils");
26
+ var import_urlMatch = require("../../utils/isomorphic/urlMatch");
27
+ var import_stringUtils = require("../../utils/isomorphic/stringUtils");
28
+ var import_time = require("../../utils/isomorphic/time");
29
+ var import_crypto = require("../utils/crypto");
30
+ var import_ariaSnapshot = require("../../utils/isomorphic/ariaSnapshot");
31
+ var import_locatorGenerators = require("../../utils/isomorphic/locatorGenerators");
32
+ var import_utilsBundle = require("../../utilsBundle");
33
+ var import_errors = require("../errors");
34
+ async function runAction(progress, mode, page, action, secrets) {
35
+ const parentMetadata = progress.metadata;
36
+ const frame = page.mainFrame();
37
+ const callMetadata = callMetadataForAction(progress, frame, action, mode);
38
+ callMetadata.log = parentMetadata.log;
39
+ progress.metadata = callMetadata;
40
+ await frame.instrumentation.onBeforeCall(frame, callMetadata, parentMetadata.id);
41
+ let error;
42
+ const result = await innerRunAction(progress, mode, page, action, secrets).catch((e) => error = e);
43
+ callMetadata.endTime = (0, import_time.monotonicTime)();
44
+ callMetadata.error = error ? (0, import_errors.serializeError)(error) : void 0;
45
+ callMetadata.result = error ? void 0 : result;
46
+ await frame.instrumentation.onAfterCall(frame, callMetadata);
47
+ if (error)
48
+ throw error;
49
+ return result;
50
+ }
51
+ async function innerRunAction(progress, mode, page, action, secrets) {
52
+ const frame = page.mainFrame();
53
+ const commonOptions = { strict: true, noAutoWaiting: mode === "generate" };
54
+ switch (action.method) {
55
+ case "navigate":
56
+ await frame.goto(progress, action.url);
57
+ break;
58
+ case "click":
59
+ await frame.click(progress, action.selector, {
60
+ button: action.button,
61
+ clickCount: action.clickCount,
62
+ modifiers: action.modifiers,
63
+ ...commonOptions
64
+ });
65
+ break;
66
+ case "drag":
67
+ await frame.dragAndDrop(progress, action.sourceSelector, action.targetSelector, { ...commonOptions });
68
+ break;
69
+ case "hover":
70
+ await frame.hover(progress, action.selector, {
71
+ modifiers: action.modifiers,
72
+ ...commonOptions
73
+ });
74
+ break;
75
+ case "selectOption":
76
+ await frame.selectOption(progress, action.selector, [], action.labels.map((a) => ({ label: a })), { ...commonOptions });
77
+ break;
78
+ case "pressKey":
79
+ await page.keyboard.press(progress, action.key);
80
+ break;
81
+ case "pressSequentially": {
82
+ const secret = secrets?.find((s) => s.name === action.text)?.value ?? action.text;
83
+ await frame.type(progress, action.selector, secret, { ...commonOptions });
84
+ if (action.submit)
85
+ await page.keyboard.press(progress, "Enter");
86
+ break;
87
+ }
88
+ case "fill": {
89
+ const secret = secrets?.find((s) => s.name === action.text)?.value ?? action.text;
90
+ await frame.fill(progress, action.selector, secret, { ...commonOptions });
91
+ if (action.submit)
92
+ await page.keyboard.press(progress, "Enter");
93
+ break;
94
+ }
95
+ case "setChecked":
96
+ if (action.checked)
97
+ await frame.check(progress, action.selector, { ...commonOptions });
98
+ else
99
+ await frame.uncheck(progress, action.selector, { ...commonOptions });
100
+ break;
101
+ case "expectVisible": {
102
+ await runExpect(frame, progress, mode, action.selector, { expression: "to.be.visible", isNot: !!action.isNot }, "visible", "toBeVisible", "");
103
+ break;
104
+ }
105
+ case "expectValue": {
106
+ if (action.type === "textbox" || action.type === "combobox" || action.type === "slider") {
107
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([action.value]);
108
+ await runExpect(frame, progress, mode, action.selector, { expression: "to.have.value", expectedText, isNot: !!action.isNot }, action.value, "toHaveValue", "expected");
109
+ } else if (action.type === "checkbox" || action.type === "radio") {
110
+ const expectedValue = { checked: action.value === "true" };
111
+ await runExpect(frame, progress, mode, action.selector, { selector: action.selector, expression: "to.be.checked", expectedValue, isNot: !!action.isNot }, action.value ? "checked" : "unchecked", "toBeChecked", "");
112
+ } else {
113
+ throw new Error(`Unsupported element type: ${action.type}`);
114
+ }
115
+ break;
116
+ }
117
+ case "expectAria": {
118
+ const expectedValue = (0, import_ariaSnapshot.parseAriaSnapshotUnsafe)(import_utilsBundle.yaml, action.template);
119
+ await runExpect(frame, progress, mode, "body", { expression: "to.match.aria", expectedValue, isNot: !!action.isNot }, "\n" + action.template, "toMatchAriaSnapshot", "expected");
120
+ break;
121
+ }
122
+ case "expectURL": {
123
+ if (!action.regex && !action.value)
124
+ throw new Error("Either url or regex must be provided");
125
+ if (action.regex && action.value)
126
+ throw new Error("Only one of url or regex can be provided");
127
+ const expected = action.regex ? (0, import_stringUtils.parseRegex)(action.regex) : (0, import_urlMatch.constructURLBasedOnBaseURL)(page.browserContext._options.baseURL, action.value);
128
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([expected]);
129
+ await runExpect(frame, progress, mode, void 0, { expression: "to.have.url", expectedText, isNot: !!action.isNot }, expected, "toHaveURL", "expected");
130
+ break;
131
+ }
132
+ case "expectTitle": {
133
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([action.value], { normalizeWhiteSpace: true });
134
+ await runExpect(frame, progress, mode, void 0, { expression: "to.have.title", expectedText, isNot: !!action.isNot }, action.value, "toHaveTitle", "expected");
135
+ break;
136
+ }
137
+ }
138
+ }
139
+ async function runExpect(frame, progress, mode, selector, options, expected, matcherName, expectation) {
140
+ const result = await frame.expect(progress, selector, {
141
+ ...options,
142
+ // When generating, we want the expect to pass or fail immediately and give feedback to the model.
143
+ noAutoWaiting: mode === "generate",
144
+ timeoutForLogs: mode === "generate" ? void 0 : progress.timeout
145
+ });
146
+ if (!result.matches === !options.isNot) {
147
+ const received = matcherName === "toMatchAriaSnapshot" ? "\n" + result.received.raw : result.received;
148
+ const expectedSuffix = typeof expected === "string" ? "" : " pattern";
149
+ const expectedDisplay = typeof expected === "string" ? expected : expected.toString();
150
+ throw new Error((0, import_expectUtils.formatMatcherMessage)(import_expectUtils.simpleMatcherUtils, {
151
+ isNot: options.isNot,
152
+ matcherName,
153
+ expectation,
154
+ locator: selector ? (0, import_locatorGenerators.asLocatorDescription)("javascript", selector) : void 0,
155
+ timedOut: result.timedOut,
156
+ timeout: mode === "generate" ? void 0 : progress.timeout,
157
+ printedExpected: options.isNot ? `Expected${expectedSuffix}: not ${expectedDisplay}` : `Expected${expectedSuffix}: ${expectedDisplay}`,
158
+ printedReceived: result.errorMessage ? "" : `Received: ${received}`,
159
+ errorMessage: result.errorMessage
160
+ // Note: we are not passing call log, because it will be automatically appended on the client side,
161
+ // as a part of the agent.{perform,expect} call.
162
+ }));
163
+ }
164
+ }
165
+ function traceParamsForAction(progress, action, mode) {
166
+ const timeout = progress.timeout;
167
+ switch (action.method) {
168
+ case "navigate": {
169
+ const params = {
170
+ url: action.url,
171
+ timeout
172
+ };
173
+ return { type: "Frame", method: "goto", params };
174
+ }
175
+ case "click": {
176
+ const params = {
177
+ selector: action.selector,
178
+ strict: true,
179
+ modifiers: action.modifiers,
180
+ button: action.button,
181
+ clickCount: action.clickCount,
182
+ timeout
183
+ };
184
+ return { type: "Frame", method: "click", params };
185
+ }
186
+ case "drag": {
187
+ const params = {
188
+ source: action.sourceSelector,
189
+ target: action.targetSelector,
190
+ timeout
191
+ };
192
+ return { type: "Frame", method: "dragAndDrop", params };
193
+ }
194
+ case "hover": {
195
+ const params = {
196
+ selector: action.selector,
197
+ modifiers: action.modifiers,
198
+ timeout
199
+ };
200
+ return { type: "Frame", method: "hover", params };
201
+ }
202
+ case "pressKey": {
203
+ const params = {
204
+ key: action.key
205
+ };
206
+ return { type: "Page", method: "keyboardPress", params };
207
+ }
208
+ case "pressSequentially": {
209
+ const params = {
210
+ selector: action.selector,
211
+ text: action.text,
212
+ timeout
213
+ };
214
+ return { type: "Frame", method: "type", params };
215
+ }
216
+ case "fill": {
217
+ const params = {
218
+ selector: action.selector,
219
+ strict: true,
220
+ value: action.text,
221
+ timeout
222
+ };
223
+ return { type: "Frame", method: "fill", params };
224
+ }
225
+ case "setChecked": {
226
+ if (action.checked) {
227
+ const params = {
228
+ selector: action.selector,
229
+ strict: true,
230
+ timeout
231
+ };
232
+ return { type: "Frame", method: "check", params };
233
+ } else {
234
+ const params = {
235
+ selector: action.selector,
236
+ strict: true,
237
+ timeout
238
+ };
239
+ return { type: "Frame", method: "uncheck", params };
240
+ }
241
+ }
242
+ case "selectOption": {
243
+ const params = {
244
+ selector: action.selector,
245
+ strict: true,
246
+ options: action.labels.map((label) => ({ label })),
247
+ timeout
248
+ };
249
+ return { type: "Frame", method: "selectOption", params };
250
+ }
251
+ case "expectValue": {
252
+ if (action.type === "textbox" || action.type === "combobox" || action.type === "slider") {
253
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([action.value]);
254
+ const params = {
255
+ selector: action.selector,
256
+ expression: "to.have.value",
257
+ expectedText,
258
+ isNot: !!action.isNot,
259
+ timeout
260
+ };
261
+ return { type: "Frame", method: "expect", title: "Expect Value", params };
262
+ } else if (action.type === "checkbox" || action.type === "radio") {
263
+ const params = {
264
+ selector: action.selector,
265
+ expression: "to.be.checked",
266
+ isNot: !!action.isNot,
267
+ timeout
268
+ };
269
+ return { type: "Frame", method: "expect", title: "Expect Checked", params };
270
+ } else {
271
+ throw new Error(`Unsupported element type: ${action.type}`);
272
+ }
273
+ }
274
+ case "expectVisible": {
275
+ const params = {
276
+ selector: action.selector,
277
+ expression: "to.be.visible",
278
+ isNot: !!action.isNot,
279
+ timeout
280
+ };
281
+ return { type: "Frame", method: "expect", title: "Expect Visible", params };
282
+ }
283
+ case "expectAria": {
284
+ const params = {
285
+ selector: "body",
286
+ expression: "to.match.snapshot",
287
+ expectedText: [],
288
+ isNot: !!action.isNot,
289
+ timeout
290
+ };
291
+ return { type: "Frame", method: "expect", title: "Expect Aria Snapshot", params };
292
+ }
293
+ case "expectURL": {
294
+ const expected = action.regex ? (0, import_stringUtils.parseRegex)(action.regex) : action.value;
295
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([expected]);
296
+ const params = {
297
+ selector: void 0,
298
+ expression: "to.have.url",
299
+ expectedText,
300
+ isNot: !!action.isNot,
301
+ timeout
302
+ };
303
+ return { type: "Frame", method: "expect", title: "Expect URL", params };
304
+ }
305
+ case "expectTitle": {
306
+ const expectedText = (0, import_expectUtils.serializeExpectedTextValues)([action.value], { normalizeWhiteSpace: true });
307
+ const params = {
308
+ selector: void 0,
309
+ expression: "to.have.title",
310
+ expectedText,
311
+ isNot: !!action.isNot,
312
+ timeout
313
+ };
314
+ return { type: "Frame", method: "expect", title: "Expect Title", params };
315
+ }
316
+ }
317
+ }
318
+ function callMetadataForAction(progress, frame, action, mode) {
319
+ const callMetadata = {
320
+ id: `call@${(0, import_crypto.createGuid)()}`,
321
+ objectId: frame.guid,
322
+ pageId: frame._page.guid,
323
+ frameId: frame.guid,
324
+ startTime: (0, import_time.monotonicTime)(),
325
+ endTime: 0,
326
+ log: [],
327
+ ...traceParamsForAction(progress, action, mode)
328
+ };
329
+ return callMetadata;
330
+ }
331
+ // Annotate the CommonJS export names for ESM import in node:
332
+ 0 && (module.exports = {
333
+ runAction,
334
+ traceParamsForAction
335
+ });
@@ -0,0 +1,128 @@
1
+ "use strict";
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
6
+ var __export = (target, all) => {
7
+ for (var name in all)
8
+ __defProp(target, name, { get: all[name], enumerable: true });
9
+ };
10
+ var __copyProps = (to, from, except, desc) => {
11
+ if (from && typeof from === "object" || typeof from === "function") {
12
+ for (let key of __getOwnPropNames(from))
13
+ if (!__hasOwnProp.call(to, key) && key !== except)
14
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
15
+ }
16
+ return to;
17
+ };
18
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
+ var actions_exports = {};
20
+ __export(actions_exports, {
21
+ cachedActionsSchema: () => cachedActionsSchema
22
+ });
23
+ module.exports = __toCommonJS(actions_exports);
24
+ var import_mcpBundle = require("../../mcpBundle");
25
+ const modifiersSchema = import_mcpBundle.z.array(
26
+ import_mcpBundle.z.enum(["Alt", "Control", "ControlOrMeta", "Meta", "Shift"])
27
+ );
28
+ const navigateActionSchema = import_mcpBundle.z.object({
29
+ method: import_mcpBundle.z.literal("navigate"),
30
+ url: import_mcpBundle.z.string()
31
+ });
32
+ const clickActionSchema = import_mcpBundle.z.object({
33
+ method: import_mcpBundle.z.literal("click"),
34
+ selector: import_mcpBundle.z.string(),
35
+ button: import_mcpBundle.z.enum(["left", "right", "middle"]).optional(),
36
+ clickCount: import_mcpBundle.z.number().optional(),
37
+ modifiers: modifiersSchema.optional()
38
+ });
39
+ const dragActionSchema = import_mcpBundle.z.object({
40
+ method: import_mcpBundle.z.literal("drag"),
41
+ sourceSelector: import_mcpBundle.z.string(),
42
+ targetSelector: import_mcpBundle.z.string()
43
+ });
44
+ const hoverActionSchema = import_mcpBundle.z.object({
45
+ method: import_mcpBundle.z.literal("hover"),
46
+ selector: import_mcpBundle.z.string(),
47
+ modifiers: modifiersSchema.optional()
48
+ });
49
+ const selectOptionActionSchema = import_mcpBundle.z.object({
50
+ method: import_mcpBundle.z.literal("selectOption"),
51
+ selector: import_mcpBundle.z.string(),
52
+ labels: import_mcpBundle.z.array(import_mcpBundle.z.string())
53
+ });
54
+ const pressActionSchema = import_mcpBundle.z.object({
55
+ method: import_mcpBundle.z.literal("pressKey"),
56
+ key: import_mcpBundle.z.string()
57
+ });
58
+ const pressSequentiallyActionSchema = import_mcpBundle.z.object({
59
+ method: import_mcpBundle.z.literal("pressSequentially"),
60
+ selector: import_mcpBundle.z.string(),
61
+ text: import_mcpBundle.z.string(),
62
+ submit: import_mcpBundle.z.boolean().optional()
63
+ });
64
+ const fillActionSchema = import_mcpBundle.z.object({
65
+ method: import_mcpBundle.z.literal("fill"),
66
+ selector: import_mcpBundle.z.string(),
67
+ text: import_mcpBundle.z.string(),
68
+ submit: import_mcpBundle.z.boolean().optional()
69
+ });
70
+ const setCheckedSchema = import_mcpBundle.z.object({
71
+ method: import_mcpBundle.z.literal("setChecked"),
72
+ selector: import_mcpBundle.z.string(),
73
+ checked: import_mcpBundle.z.boolean()
74
+ });
75
+ const expectVisibleSchema = import_mcpBundle.z.object({
76
+ method: import_mcpBundle.z.literal("expectVisible"),
77
+ selector: import_mcpBundle.z.string(),
78
+ isNot: import_mcpBundle.z.boolean().optional()
79
+ });
80
+ const expectValueSchema = import_mcpBundle.z.object({
81
+ method: import_mcpBundle.z.literal("expectValue"),
82
+ selector: import_mcpBundle.z.string(),
83
+ type: import_mcpBundle.z.enum(["textbox", "checkbox", "radio", "combobox", "slider"]),
84
+ value: import_mcpBundle.z.string(),
85
+ isNot: import_mcpBundle.z.boolean().optional()
86
+ });
87
+ const expectAriaSchema = import_mcpBundle.z.object({
88
+ method: import_mcpBundle.z.literal("expectAria"),
89
+ template: import_mcpBundle.z.string(),
90
+ isNot: import_mcpBundle.z.boolean().optional()
91
+ });
92
+ const expectURLSchema = import_mcpBundle.z.object({
93
+ method: import_mcpBundle.z.literal("expectURL"),
94
+ value: import_mcpBundle.z.string().optional(),
95
+ regex: import_mcpBundle.z.string().optional(),
96
+ isNot: import_mcpBundle.z.boolean().optional()
97
+ });
98
+ const expectTitleSchema = import_mcpBundle.z.object({
99
+ method: import_mcpBundle.z.literal("expectTitle"),
100
+ value: import_mcpBundle.z.string(),
101
+ isNot: import_mcpBundle.z.boolean().optional()
102
+ });
103
+ const actionSchema = import_mcpBundle.z.discriminatedUnion("method", [
104
+ navigateActionSchema,
105
+ clickActionSchema,
106
+ dragActionSchema,
107
+ hoverActionSchema,
108
+ selectOptionActionSchema,
109
+ pressActionSchema,
110
+ pressSequentiallyActionSchema,
111
+ fillActionSchema,
112
+ setCheckedSchema,
113
+ expectVisibleSchema,
114
+ expectValueSchema,
115
+ expectAriaSchema,
116
+ expectURLSchema,
117
+ expectTitleSchema
118
+ ]);
119
+ const actionWithCodeSchema = actionSchema.and(import_mcpBundle.z.object({
120
+ code: import_mcpBundle.z.string()
121
+ }));
122
+ const cachedActionsSchema = import_mcpBundle.z.record(import_mcpBundle.z.string(), import_mcpBundle.z.object({
123
+ actions: import_mcpBundle.z.array(actionWithCodeSchema)
124
+ }));
125
+ // Annotate the CommonJS export names for ESM import in node:
126
+ 0 && (module.exports = {
127
+ cachedActionsSchema
128
+ });