donobu 1.0.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 (1048) hide show
  1. package/dist/apis/AgentsApi.d.ts +12 -0
  2. package/dist/apis/AgentsApi.js +36 -0
  3. package/dist/apis/AgentsApi.js.map +1 -0
  4. package/dist/apis/AskAiApi.d.ts +17 -0
  5. package/dist/apis/AskAiApi.js +58 -0
  6. package/dist/apis/AskAiApi.js.map +1 -0
  7. package/dist/apis/DefaultApiAuthApi.d.ts +17 -0
  8. package/dist/apis/DefaultApiAuthApi.js +33 -0
  9. package/dist/apis/DefaultApiAuthApi.js.map +1 -0
  10. package/dist/apis/FlowsApi.d.ts +40 -0
  11. package/dist/apis/FlowsApi.js +129 -0
  12. package/dist/apis/FlowsApi.js.map +1 -0
  13. package/dist/apis/FlowsFilesApi.d.ts +8 -0
  14. package/dist/apis/FlowsFilesApi.js +87 -0
  15. package/dist/apis/FlowsFilesApi.js.map +1 -0
  16. package/dist/apis/FlowsToolCallsApi.d.ts +18 -0
  17. package/dist/apis/FlowsToolCallsApi.js +43 -0
  18. package/dist/apis/FlowsToolCallsApi.js.map +1 -0
  19. package/dist/apis/GptConfigsApi.d.ts +22 -0
  20. package/dist/apis/GptConfigsApi.js +77 -0
  21. package/dist/apis/GptConfigsApi.js.map +1 -0
  22. package/dist/apis/GptResourcesApi.d.ts +20 -0
  23. package/dist/apis/GptResourcesApi.js +53 -0
  24. package/dist/apis/GptResourcesApi.js.map +1 -0
  25. package/dist/apis/KeysApi.d.ts +25 -0
  26. package/dist/apis/KeysApi.js +64 -0
  27. package/dist/apis/KeysApi.js.map +1 -0
  28. package/dist/apis/PingApi.d.ts +13 -0
  29. package/dist/apis/PingApi.js +19 -0
  30. package/dist/apis/PingApi.js.map +1 -0
  31. package/dist/apis/SpecialFlowsApi.d.ts +17 -0
  32. package/dist/apis/SpecialFlowsApi.js +430 -0
  33. package/dist/apis/SpecialFlowsApi.js.map +1 -0
  34. package/dist/apis/ToolsApi.d.ts +20 -0
  35. package/dist/apis/ToolsApi.js +26 -0
  36. package/dist/apis/ToolsApi.js.map +1 -0
  37. package/dist/apis/VersionApi.d.ts +13 -0
  38. package/dist/apis/VersionApi.js +20 -0
  39. package/dist/apis/VersionApi.js.map +1 -0
  40. package/dist/assets/Donobu.entitlements.plist +28 -0
  41. package/dist/assets/axe.js +47397 -0
  42. package/dist/assets/clickable-elements-tracker.js +62 -0
  43. package/dist/assets/control-panel.js +447 -0
  44. package/dist/assets/devices.json +1403 -0
  45. package/dist/assets/dialog-prompt-tracker.js +20 -0
  46. package/dist/assets/generated/parameter-schemas.json +1518 -0
  47. package/dist/assets/generated/version +1 -0
  48. package/dist/assets/icon.png +0 -0
  49. package/dist/assets/page-interactions-tracker.js +222 -0
  50. package/dist/assets/smart-selector-generator.js +268 -0
  51. package/dist/assets/zaru-eyes.html +141 -0
  52. package/dist/bindings/FocusPage.d.ts +17 -0
  53. package/dist/bindings/FocusPage.js +27 -0
  54. package/dist/bindings/FocusPage.js.map +1 -0
  55. package/dist/bindings/NamedBindingCallback.d.ts +23 -0
  56. package/dist/bindings/NamedBindingCallback.js +3 -0
  57. package/dist/bindings/NamedBindingCallback.js.map +1 -0
  58. package/dist/bindings/PageInteractionTracker.d.ts +28 -0
  59. package/dist/bindings/PageInteractionTracker.js +102 -0
  60. package/dist/bindings/PageInteractionTracker.js.map +1 -0
  61. package/dist/clients/AnthropicAwsBedrockGptClient.d.ts +36 -0
  62. package/dist/clients/AnthropicAwsBedrockGptClient.js +357 -0
  63. package/dist/clients/AnthropicAwsBedrockGptClient.js.map +1 -0
  64. package/dist/clients/AnthropicGptClient.d.ts +36 -0
  65. package/dist/clients/AnthropicGptClient.js +309 -0
  66. package/dist/clients/AnthropicGptClient.js.map +1 -0
  67. package/dist/clients/GoogleGptClient.d.ts +49 -0
  68. package/dist/clients/GoogleGptClient.js +380 -0
  69. package/dist/clients/GoogleGptClient.js.map +1 -0
  70. package/dist/clients/GoogleGptClient2.d.ts +18 -0
  71. package/dist/clients/GoogleGptClient2.js +237 -0
  72. package/dist/clients/GoogleGptClient2.js.map +1 -0
  73. package/dist/clients/GptClient.d.ts +36 -0
  74. package/dist/clients/GptClient.js +12 -0
  75. package/dist/clients/GptClient.js.map +1 -0
  76. package/dist/clients/GptClientFactory.d.ts +5 -0
  77. package/dist/clients/GptClientFactory.js +39 -0
  78. package/dist/clients/GptClientFactory.js.map +1 -0
  79. package/dist/clients/OpenAiGptClient.d.ts +35 -0
  80. package/dist/clients/OpenAiGptClient.js +269 -0
  81. package/dist/clients/OpenAiGptClient.js.map +1 -0
  82. package/dist/clients/SupabaseClient.d.ts +16 -0
  83. package/dist/clients/SupabaseClient.js +200 -0
  84. package/dist/clients/SupabaseClient.js.map +1 -0
  85. package/dist/donobu.fixtures.d.ts +57 -0
  86. package/dist/donobu.fixtures.js +167 -0
  87. package/dist/donobu.fixtures.js.map +1 -0
  88. package/dist/esm/apis/AgentsApi.d.ts +12 -0
  89. package/dist/esm/apis/AgentsApi.js +36 -0
  90. package/dist/esm/apis/AgentsApi.js.map +1 -0
  91. package/dist/esm/apis/AskAiApi.d.ts +17 -0
  92. package/dist/esm/apis/AskAiApi.js +58 -0
  93. package/dist/esm/apis/AskAiApi.js.map +1 -0
  94. package/dist/esm/apis/DefaultApiAuthApi.d.ts +17 -0
  95. package/dist/esm/apis/DefaultApiAuthApi.js +33 -0
  96. package/dist/esm/apis/DefaultApiAuthApi.js.map +1 -0
  97. package/dist/esm/apis/FlowsApi.d.ts +40 -0
  98. package/dist/esm/apis/FlowsApi.js +129 -0
  99. package/dist/esm/apis/FlowsApi.js.map +1 -0
  100. package/dist/esm/apis/FlowsFilesApi.d.ts +8 -0
  101. package/dist/esm/apis/FlowsFilesApi.js +87 -0
  102. package/dist/esm/apis/FlowsFilesApi.js.map +1 -0
  103. package/dist/esm/apis/FlowsToolCallsApi.d.ts +18 -0
  104. package/dist/esm/apis/FlowsToolCallsApi.js +43 -0
  105. package/dist/esm/apis/FlowsToolCallsApi.js.map +1 -0
  106. package/dist/esm/apis/GptConfigsApi.d.ts +22 -0
  107. package/dist/esm/apis/GptConfigsApi.js +77 -0
  108. package/dist/esm/apis/GptConfigsApi.js.map +1 -0
  109. package/dist/esm/apis/GptResourcesApi.d.ts +20 -0
  110. package/dist/esm/apis/GptResourcesApi.js +53 -0
  111. package/dist/esm/apis/GptResourcesApi.js.map +1 -0
  112. package/dist/esm/apis/KeysApi.d.ts +25 -0
  113. package/dist/esm/apis/KeysApi.js +64 -0
  114. package/dist/esm/apis/KeysApi.js.map +1 -0
  115. package/dist/esm/apis/PingApi.d.ts +13 -0
  116. package/dist/esm/apis/PingApi.js +19 -0
  117. package/dist/esm/apis/PingApi.js.map +1 -0
  118. package/dist/esm/apis/SpecialFlowsApi.d.ts +17 -0
  119. package/dist/esm/apis/SpecialFlowsApi.js +430 -0
  120. package/dist/esm/apis/SpecialFlowsApi.js.map +1 -0
  121. package/dist/esm/apis/ToolsApi.d.ts +20 -0
  122. package/dist/esm/apis/ToolsApi.js +26 -0
  123. package/dist/esm/apis/ToolsApi.js.map +1 -0
  124. package/dist/esm/apis/VersionApi.d.ts +13 -0
  125. package/dist/esm/apis/VersionApi.js +20 -0
  126. package/dist/esm/apis/VersionApi.js.map +1 -0
  127. package/dist/esm/assets/Donobu.entitlements.plist +28 -0
  128. package/dist/esm/assets/axe.js +47397 -0
  129. package/dist/esm/assets/clickable-elements-tracker.js +62 -0
  130. package/dist/esm/assets/control-panel.js +447 -0
  131. package/dist/esm/assets/devices.json +1403 -0
  132. package/dist/esm/assets/dialog-prompt-tracker.js +20 -0
  133. package/dist/esm/assets/generated/parameter-schemas.json +1518 -0
  134. package/dist/esm/assets/generated/version +1 -0
  135. package/dist/esm/assets/icon.png +0 -0
  136. package/dist/esm/assets/page-interactions-tracker.js +222 -0
  137. package/dist/esm/assets/smart-selector-generator.js +268 -0
  138. package/dist/esm/assets/zaru-eyes.html +141 -0
  139. package/dist/esm/bindings/FocusPage.d.ts +17 -0
  140. package/dist/esm/bindings/FocusPage.js +27 -0
  141. package/dist/esm/bindings/FocusPage.js.map +1 -0
  142. package/dist/esm/bindings/NamedBindingCallback.d.ts +23 -0
  143. package/dist/esm/bindings/NamedBindingCallback.js +3 -0
  144. package/dist/esm/bindings/NamedBindingCallback.js.map +1 -0
  145. package/dist/esm/bindings/PageInteractionTracker.d.ts +28 -0
  146. package/dist/esm/bindings/PageInteractionTracker.js +102 -0
  147. package/dist/esm/bindings/PageInteractionTracker.js.map +1 -0
  148. package/dist/esm/clients/AnthropicAwsBedrockGptClient.d.ts +36 -0
  149. package/dist/esm/clients/AnthropicAwsBedrockGptClient.js +357 -0
  150. package/dist/esm/clients/AnthropicAwsBedrockGptClient.js.map +1 -0
  151. package/dist/esm/clients/AnthropicGptClient.d.ts +36 -0
  152. package/dist/esm/clients/AnthropicGptClient.js +309 -0
  153. package/dist/esm/clients/AnthropicGptClient.js.map +1 -0
  154. package/dist/esm/clients/GoogleGptClient.d.ts +49 -0
  155. package/dist/esm/clients/GoogleGptClient.js +380 -0
  156. package/dist/esm/clients/GoogleGptClient.js.map +1 -0
  157. package/dist/esm/clients/GptClient.d.ts +36 -0
  158. package/dist/esm/clients/GptClient.js +12 -0
  159. package/dist/esm/clients/GptClient.js.map +1 -0
  160. package/dist/esm/clients/GptClientFactory.d.ts +5 -0
  161. package/dist/esm/clients/GptClientFactory.js +39 -0
  162. package/dist/esm/clients/GptClientFactory.js.map +1 -0
  163. package/dist/esm/clients/OpenAiGptClient.d.ts +35 -0
  164. package/dist/esm/clients/OpenAiGptClient.js +269 -0
  165. package/dist/esm/clients/OpenAiGptClient.js.map +1 -0
  166. package/dist/esm/clients/SupabaseClient.d.ts +16 -0
  167. package/dist/esm/clients/SupabaseClient.js +200 -0
  168. package/dist/esm/clients/SupabaseClient.js.map +1 -0
  169. package/dist/esm/donobu.fixtures.d.ts +57 -0
  170. package/dist/esm/donobu.fixtures.js +167 -0
  171. package/dist/esm/donobu.fixtures.js.map +1 -0
  172. package/dist/esm/exceptions/ActiveFlowNotFoundException.d.ts +10 -0
  173. package/dist/esm/exceptions/ActiveFlowNotFoundException.js +19 -0
  174. package/dist/esm/exceptions/ActiveFlowNotFoundException.js.map +1 -0
  175. package/dist/esm/exceptions/ApiKeyNotSetUpException.d.ts +14 -0
  176. package/dist/esm/exceptions/ApiKeyNotSetUpException.js +21 -0
  177. package/dist/esm/exceptions/ApiKeyNotSetUpException.js.map +1 -0
  178. package/dist/esm/exceptions/BrowserStateNotFoundException.d.ts +8 -0
  179. package/dist/esm/exceptions/BrowserStateNotFoundException.js +15 -0
  180. package/dist/esm/exceptions/BrowserStateNotFoundException.js.map +1 -0
  181. package/dist/esm/exceptions/CannotDeleteRunningFlowException.d.ts +9 -0
  182. package/dist/esm/exceptions/CannotDeleteRunningFlowException.js +18 -0
  183. package/dist/esm/exceptions/CannotDeleteRunningFlowException.js.map +1 -0
  184. package/dist/esm/exceptions/DonobuException.d.ts +12 -0
  185. package/dist/esm/exceptions/DonobuException.js +39 -0
  186. package/dist/esm/exceptions/DonobuException.js.map +1 -0
  187. package/dist/esm/exceptions/FlowNotFoundException.d.ts +6 -0
  188. package/dist/esm/exceptions/FlowNotFoundException.js +17 -0
  189. package/dist/esm/exceptions/FlowNotFoundException.js.map +1 -0
  190. package/dist/esm/exceptions/GptApiKeysNotSetupException.d.ts +4 -0
  191. package/dist/esm/exceptions/GptApiKeysNotSetupException.js +11 -0
  192. package/dist/esm/exceptions/GptApiKeysNotSetupException.js.map +1 -0
  193. package/dist/esm/exceptions/GptConfigNotFoundException.d.ts +8 -0
  194. package/dist/esm/exceptions/GptConfigNotFoundException.js +16 -0
  195. package/dist/esm/exceptions/GptConfigNotFoundException.js.map +1 -0
  196. package/dist/esm/exceptions/GptModelNotFoundException.d.ts +9 -0
  197. package/dist/esm/exceptions/GptModelNotFoundException.js +18 -0
  198. package/dist/esm/exceptions/GptModelNotFoundException.js.map +1 -0
  199. package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.d.ts +6 -0
  200. package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.js +14 -0
  201. package/dist/esm/exceptions/GptPlatformAuthenticationFailedException.js.map +1 -0
  202. package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.d.ts +5 -0
  203. package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.js +13 -0
  204. package/dist/esm/exceptions/GptPlatformInsufficientQuotaException.js.map +1 -0
  205. package/dist/esm/exceptions/GptPlatformInternalErrorException.d.ts +5 -0
  206. package/dist/esm/exceptions/GptPlatformInternalErrorException.js +12 -0
  207. package/dist/esm/exceptions/GptPlatformInternalErrorException.js.map +1 -0
  208. package/dist/esm/exceptions/GptPlatformNotReachableException.d.ts +5 -0
  209. package/dist/esm/exceptions/GptPlatformNotReachableException.js +13 -0
  210. package/dist/esm/exceptions/GptPlatformNotReachableException.js.map +1 -0
  211. package/dist/esm/exceptions/GptPlatformRateLimitedException.d.ts +5 -0
  212. package/dist/esm/exceptions/GptPlatformRateLimitedException.js +13 -0
  213. package/dist/esm/exceptions/GptPlatformRateLimitedException.js.map +1 -0
  214. package/dist/esm/exceptions/GptResourceNotFoundException.d.ts +8 -0
  215. package/dist/esm/exceptions/GptResourceNotFoundException.js +16 -0
  216. package/dist/esm/exceptions/GptResourceNotFoundException.js.map +1 -0
  217. package/dist/esm/exceptions/InvalidParamValueException.d.ts +13 -0
  218. package/dist/esm/exceptions/InvalidParamValueException.js +25 -0
  219. package/dist/esm/exceptions/InvalidParamValueException.js.map +1 -0
  220. package/dist/esm/exceptions/NoApiAccessTokenPresentException.d.ts +8 -0
  221. package/dist/esm/exceptions/NoApiAccessTokenPresentException.js +15 -0
  222. package/dist/esm/exceptions/NoApiAccessTokenPresentException.js.map +1 -0
  223. package/dist/esm/exceptions/PageClosedException.d.ts +6 -0
  224. package/dist/esm/exceptions/PageClosedException.js +13 -0
  225. package/dist/esm/exceptions/PageClosedException.js.map +1 -0
  226. package/dist/esm/exceptions/TooManyRequestsException.d.ts +5 -0
  227. package/dist/esm/exceptions/TooManyRequestsException.js +13 -0
  228. package/dist/esm/exceptions/TooManyRequestsException.js.map +1 -0
  229. package/dist/esm/exceptions/ToolCallNotFoundException.d.ts +6 -0
  230. package/dist/esm/exceptions/ToolCallNotFoundException.js +14 -0
  231. package/dist/esm/exceptions/ToolCallNotFoundException.js.map +1 -0
  232. package/dist/esm/exceptions/ToolRequiresGptException.d.ts +5 -0
  233. package/dist/esm/exceptions/ToolRequiresGptException.js +13 -0
  234. package/dist/esm/exceptions/ToolRequiresGptException.js.map +1 -0
  235. package/dist/esm/exceptions/UnknownToolException.d.ts +5 -0
  236. package/dist/esm/exceptions/UnknownToolException.js +13 -0
  237. package/dist/esm/exceptions/UnknownToolException.js.map +1 -0
  238. package/dist/esm/exceptions/UnparseableJsonBodyException.d.ts +4 -0
  239. package/dist/esm/exceptions/UnparseableJsonBodyException.js +12 -0
  240. package/dist/esm/exceptions/UnparseableJsonBodyException.js.map +1 -0
  241. package/dist/esm/main.d.ts +21 -0
  242. package/dist/esm/main.js +143 -0
  243. package/dist/esm/main.js.map +1 -0
  244. package/dist/esm/managers/AdminApiController.d.ts +32 -0
  245. package/dist/esm/managers/AdminApiController.js +251 -0
  246. package/dist/esm/managers/AdminApiController.js.map +1 -0
  247. package/dist/esm/managers/AgentsManager.d.ts +28 -0
  248. package/dist/esm/managers/AgentsManager.js +75 -0
  249. package/dist/esm/managers/AgentsManager.js.map +1 -0
  250. package/dist/esm/managers/DonobuFlow.d.ts +115 -0
  251. package/dist/esm/managers/DonobuFlow.js +1070 -0
  252. package/dist/esm/managers/DonobuFlow.js.map +1 -0
  253. package/dist/esm/managers/DonobuFlowsManager.d.ts +130 -0
  254. package/dist/esm/managers/DonobuFlowsManager.js +830 -0
  255. package/dist/esm/managers/DonobuFlowsManager.js.map +1 -0
  256. package/dist/esm/managers/FlowsPersistence.d.ts +79 -0
  257. package/dist/esm/managers/FlowsPersistence.js +3 -0
  258. package/dist/esm/managers/FlowsPersistence.js.map +1 -0
  259. package/dist/esm/managers/FlowsPersistenceAwsS3.d.ts +48 -0
  260. package/dist/esm/managers/FlowsPersistenceAwsS3.js +284 -0
  261. package/dist/esm/managers/FlowsPersistenceAwsS3.js.map +1 -0
  262. package/dist/esm/managers/FlowsPersistenceFactory.d.ts +9 -0
  263. package/dist/esm/managers/FlowsPersistenceFactory.js +3 -0
  264. package/dist/esm/managers/FlowsPersistenceFactory.js.map +1 -0
  265. package/dist/esm/managers/FlowsPersistenceFactoryImpl.d.ts +57 -0
  266. package/dist/esm/managers/FlowsPersistenceFactoryImpl.js +119 -0
  267. package/dist/esm/managers/FlowsPersistenceFactoryImpl.js.map +1 -0
  268. package/dist/esm/managers/FlowsPersistenceFactoryPreset.d.ts +12 -0
  269. package/dist/esm/managers/FlowsPersistenceFactoryPreset.js +25 -0
  270. package/dist/esm/managers/FlowsPersistenceFactoryPreset.js.map +1 -0
  271. package/dist/esm/managers/FlowsPersistenceFilesystem.d.ts +33 -0
  272. package/dist/esm/managers/FlowsPersistenceFilesystem.js +180 -0
  273. package/dist/esm/managers/FlowsPersistenceFilesystem.js.map +1 -0
  274. package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.d.ts +40 -0
  275. package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.js +209 -0
  276. package/dist/esm/managers/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
  277. package/dist/esm/managers/FlowsPersistenceSupabase.d.ts +33 -0
  278. package/dist/esm/managers/FlowsPersistenceSupabase.js +152 -0
  279. package/dist/esm/managers/FlowsPersistenceSupabase.js.map +1 -0
  280. package/dist/esm/managers/FlowsPersistenceVolatile.d.ts +30 -0
  281. package/dist/esm/managers/FlowsPersistenceVolatile.js +103 -0
  282. package/dist/esm/managers/FlowsPersistenceVolatile.js.map +1 -0
  283. package/dist/esm/managers/GptConfigsManager.d.ts +38 -0
  284. package/dist/esm/managers/GptConfigsManager.js +159 -0
  285. package/dist/esm/managers/GptConfigsManager.js.map +1 -0
  286. package/dist/esm/managers/GptPlatformApiKeysManager.d.ts +36 -0
  287. package/dist/esm/managers/GptPlatformApiKeysManager.js +3 -0
  288. package/dist/esm/managers/GptPlatformApiKeysManager.js.map +1 -0
  289. package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.d.ts +29 -0
  290. package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.js +136 -0
  291. package/dist/esm/managers/GptPlatformApiKeysManagerFilesystem.js.map +1 -0
  292. package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.d.ts +35 -0
  293. package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.js +51 -0
  294. package/dist/esm/managers/GptPlatformApiKeysManagerVolatile.js.map +1 -0
  295. package/dist/esm/managers/GptResourcesManager.d.ts +39 -0
  296. package/dist/esm/managers/GptResourcesManager.js +130 -0
  297. package/dist/esm/managers/GptResourcesManager.js.map +1 -0
  298. package/dist/esm/managers/RequestContextHolder.d.ts +24 -0
  299. package/dist/esm/managers/RequestContextHolder.js +43 -0
  300. package/dist/esm/managers/RequestContextHolder.js.map +1 -0
  301. package/dist/esm/managers/SelectorGenerator.d.ts +8 -0
  302. package/dist/esm/managers/SelectorGenerator.js +15 -0
  303. package/dist/esm/managers/SelectorGenerator.js.map +1 -0
  304. package/dist/esm/managers/ToolManager.d.ts +21 -0
  305. package/dist/esm/managers/ToolManager.js +264 -0
  306. package/dist/esm/managers/ToolManager.js.map +1 -0
  307. package/dist/esm/managers/ToolTipper.d.ts +35 -0
  308. package/dist/esm/managers/ToolTipper.js +201 -0
  309. package/dist/esm/managers/ToolTipper.js.map +1 -0
  310. package/dist/esm/models/AskAiRequest.d.ts +14 -0
  311. package/dist/esm/models/AskAiRequest.js +3 -0
  312. package/dist/esm/models/AskAiRequest.js.map +1 -0
  313. package/dist/esm/models/BaseToolGptParameters.d.ts +9 -0
  314. package/dist/esm/models/BaseToolGptParameters.js +3 -0
  315. package/dist/esm/models/BaseToolGptParameters.js.map +1 -0
  316. package/dist/esm/models/BrowserDevice.d.ts +18 -0
  317. package/dist/esm/models/BrowserDevice.js +3 -0
  318. package/dist/esm/models/BrowserDevice.js.map +1 -0
  319. package/dist/esm/models/BrowserFramework.d.ts +36 -0
  320. package/dist/esm/models/BrowserFramework.js +164 -0
  321. package/dist/esm/models/BrowserFramework.js.map +1 -0
  322. package/dist/esm/models/BrowserState.d.ts +25 -0
  323. package/dist/esm/models/BrowserState.js +3 -0
  324. package/dist/esm/models/BrowserState.js.map +1 -0
  325. package/dist/esm/models/BrowserStateFlowReference.d.ts +10 -0
  326. package/dist/esm/models/BrowserStateFlowReference.js +3 -0
  327. package/dist/esm/models/BrowserStateFlowReference.js.map +1 -0
  328. package/dist/esm/models/CreateDonobuFlow.d.ts +88 -0
  329. package/dist/esm/models/CreateDonobuFlow.js +3 -0
  330. package/dist/esm/models/CreateDonobuFlow.js.map +1 -0
  331. package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.d.ts +21 -0
  332. package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.js +3 -0
  333. package/dist/esm/models/CreateGoogleSteetviewExtractionFlow.js.map +1 -0
  334. package/dist/esm/models/CustomTool.d.ts +9 -0
  335. package/dist/esm/models/CustomTool.js +3 -0
  336. package/dist/esm/models/CustomTool.js.map +1 -0
  337. package/dist/esm/models/DonobuAgentType.d.ts +2 -0
  338. package/dist/esm/models/DonobuAgentType.js +5 -0
  339. package/dist/esm/models/DonobuAgentType.js.map +1 -0
  340. package/dist/esm/models/DonobuDeploymentEnvironment.d.ts +5 -0
  341. package/dist/esm/models/DonobuDeploymentEnvironment.js +10 -0
  342. package/dist/esm/models/DonobuDeploymentEnvironment.js.map +1 -0
  343. package/dist/esm/models/DonobuErrorResponse.d.ts +13 -0
  344. package/dist/esm/models/DonobuErrorResponse.js +3 -0
  345. package/dist/esm/models/DonobuErrorResponse.js.map +1 -0
  346. package/dist/esm/models/ElementSelector.d.ts +14 -0
  347. package/dist/esm/models/ElementSelector.js +3 -0
  348. package/dist/esm/models/ElementSelector.js.map +1 -0
  349. package/dist/esm/models/ElementSelectorForReplay.d.ts +14 -0
  350. package/dist/esm/models/ElementSelectorForReplay.js +3 -0
  351. package/dist/esm/models/ElementSelectorForReplay.js.map +1 -0
  352. package/dist/esm/models/FlowMetadata.d.ts +123 -0
  353. package/dist/esm/models/FlowMetadata.js +50 -0
  354. package/dist/esm/models/FlowMetadata.js.map +1 -0
  355. package/dist/esm/models/FlowsQuery.d.ts +11 -0
  356. package/dist/esm/models/FlowsQuery.js +3 -0
  357. package/dist/esm/models/FlowsQuery.js.map +1 -0
  358. package/dist/esm/models/FocusedPage.d.ts +4 -0
  359. package/dist/esm/models/FocusedPage.js +3 -0
  360. package/dist/esm/models/FocusedPage.js.map +1 -0
  361. package/dist/esm/models/GptConfig.d.ts +38 -0
  362. package/dist/esm/models/GptConfig.js +3 -0
  363. package/dist/esm/models/GptConfig.js.map +1 -0
  364. package/dist/esm/models/GptMessage.d.ts +43 -0
  365. package/dist/esm/models/GptMessage.js +3 -0
  366. package/dist/esm/models/GptMessage.js.map +1 -0
  367. package/dist/esm/models/GptResource.d.ts +33 -0
  368. package/dist/esm/models/GptResource.js +3 -0
  369. package/dist/esm/models/GptResource.js.map +1 -0
  370. package/dist/esm/models/InteractableElement.d.ts +13 -0
  371. package/dist/esm/models/InteractableElement.js +3 -0
  372. package/dist/esm/models/InteractableElement.js.map +1 -0
  373. package/dist/esm/models/ProposedToolCall.d.ts +19 -0
  374. package/dist/esm/models/ProposedToolCall.js +3 -0
  375. package/dist/esm/models/ProposedToolCall.js.map +1 -0
  376. package/dist/esm/models/RequestContext.d.ts +21 -0
  377. package/dist/esm/models/RequestContext.js +24 -0
  378. package/dist/esm/models/RequestContext.js.map +1 -0
  379. package/dist/esm/models/ToolCall.d.ts +38 -0
  380. package/dist/esm/models/ToolCall.js +3 -0
  381. package/dist/esm/models/ToolCall.js.map +1 -0
  382. package/dist/esm/models/ToolCallContext.d.ts +22 -0
  383. package/dist/esm/models/ToolCallContext.js +3 -0
  384. package/dist/esm/models/ToolCallContext.js.map +1 -0
  385. package/dist/esm/models/ToolCallResult.d.ts +20 -0
  386. package/dist/esm/models/ToolCallResult.js +19 -0
  387. package/dist/esm/models/ToolCallResult.js.map +1 -0
  388. package/dist/esm/models/VideoSegment.d.ts +20 -0
  389. package/dist/esm/models/VideoSegment.js +3 -0
  390. package/dist/esm/models/VideoSegment.js.map +1 -0
  391. package/dist/esm/persistence/AgentsPersistence.d.ts +11 -0
  392. package/dist/esm/persistence/AgentsPersistence.js +3 -0
  393. package/dist/esm/persistence/AgentsPersistence.js.map +1 -0
  394. package/dist/esm/persistence/AgentsPersistenceFilesystem.d.ts +15 -0
  395. package/dist/esm/persistence/AgentsPersistenceFilesystem.js +48 -0
  396. package/dist/esm/persistence/AgentsPersistenceFilesystem.js.map +1 -0
  397. package/dist/esm/persistence/AgentsPersistenceSqlite.d.ts +14 -0
  398. package/dist/esm/persistence/AgentsPersistenceSqlite.js +51 -0
  399. package/dist/esm/persistence/AgentsPersistenceSqlite.js.map +1 -0
  400. package/dist/esm/persistence/AgentsPersistenceVolatile.d.ts +13 -0
  401. package/dist/esm/persistence/AgentsPersistenceVolatile.js +27 -0
  402. package/dist/esm/persistence/AgentsPersistenceVolatile.js.map +1 -0
  403. package/dist/esm/persistence/DonobuSqliteDb.d.ts +11 -0
  404. package/dist/esm/persistence/DonobuSqliteDb.js +178 -0
  405. package/dist/esm/persistence/DonobuSqliteDb.js.map +1 -0
  406. package/dist/esm/persistence/FlowsPersistence.d.ts +94 -0
  407. package/dist/esm/persistence/FlowsPersistence.js +3 -0
  408. package/dist/esm/persistence/FlowsPersistence.js.map +1 -0
  409. package/dist/esm/persistence/FlowsPersistenceAwsS3.d.ts +70 -0
  410. package/dist/esm/persistence/FlowsPersistenceAwsS3.js +447 -0
  411. package/dist/esm/persistence/FlowsPersistenceAwsS3.js.map +1 -0
  412. package/dist/esm/persistence/FlowsPersistenceFactory.d.ts +9 -0
  413. package/dist/esm/persistence/FlowsPersistenceFactory.js +3 -0
  414. package/dist/esm/persistence/FlowsPersistenceFactory.js.map +1 -0
  415. package/dist/esm/persistence/FlowsPersistenceFactoryImpl.d.ts +60 -0
  416. package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js +244 -0
  417. package/dist/esm/persistence/FlowsPersistenceFactoryImpl.js.map +1 -0
  418. package/dist/esm/persistence/FlowsPersistenceFactoryPreset.d.ts +12 -0
  419. package/dist/esm/persistence/FlowsPersistenceFactoryPreset.js +25 -0
  420. package/dist/esm/persistence/FlowsPersistenceFactoryPreset.js.map +1 -0
  421. package/dist/esm/persistence/FlowsPersistenceFilesystem.d.ts +42 -0
  422. package/dist/esm/persistence/FlowsPersistenceFilesystem.js +271 -0
  423. package/dist/esm/persistence/FlowsPersistenceFilesystem.js.map +1 -0
  424. package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.d.ts +62 -0
  425. package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.js +406 -0
  426. package/dist/esm/persistence/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
  427. package/dist/esm/persistence/FlowsPersistenceSqlite.d.ts +37 -0
  428. package/dist/esm/persistence/FlowsPersistenceSqlite.js +229 -0
  429. package/dist/esm/persistence/FlowsPersistenceSqlite.js.map +1 -0
  430. package/dist/esm/persistence/FlowsPersistenceSupabase.d.ts +38 -0
  431. package/dist/esm/persistence/FlowsPersistenceSupabase.js +216 -0
  432. package/dist/esm/persistence/FlowsPersistenceSupabase.js.map +1 -0
  433. package/dist/esm/persistence/FlowsPersistenceVolatile.d.ts +35 -0
  434. package/dist/esm/persistence/FlowsPersistenceVolatile.js +147 -0
  435. package/dist/esm/persistence/FlowsPersistenceVolatile.js.map +1 -0
  436. package/dist/esm/persistence/GptConfigsPersistence.d.ts +11 -0
  437. package/dist/esm/persistence/GptConfigsPersistence.js +3 -0
  438. package/dist/esm/persistence/GptConfigsPersistence.js.map +1 -0
  439. package/dist/esm/persistence/GptConfigsPersistenceFilesystem.d.ts +16 -0
  440. package/dist/esm/persistence/GptConfigsPersistenceFilesystem.js +54 -0
  441. package/dist/esm/persistence/GptConfigsPersistenceFilesystem.js.map +1 -0
  442. package/dist/esm/persistence/GptConfigsPersistenceSqlite.d.ts +12 -0
  443. package/dist/esm/persistence/GptConfigsPersistenceSqlite.js +36 -0
  444. package/dist/esm/persistence/GptConfigsPersistenceSqlite.js.map +1 -0
  445. package/dist/esm/persistence/GptConfigsPersistenceVolatile.d.ts +14 -0
  446. package/dist/esm/persistence/GptConfigsPersistenceVolatile.js +32 -0
  447. package/dist/esm/persistence/GptConfigsPersistenceVolatile.js.map +1 -0
  448. package/dist/esm/persistence/GptResourcesPersistence.d.ts +11 -0
  449. package/dist/esm/persistence/GptResourcesPersistence.js +3 -0
  450. package/dist/esm/persistence/GptResourcesPersistence.js.map +1 -0
  451. package/dist/esm/persistence/GptResourcesPersistenceFilesystem.d.ts +20 -0
  452. package/dist/esm/persistence/GptResourcesPersistenceFilesystem.js +79 -0
  453. package/dist/esm/persistence/GptResourcesPersistenceFilesystem.js.map +1 -0
  454. package/dist/esm/persistence/GptResourcesPersistenceVolatile.d.ts +14 -0
  455. package/dist/esm/persistence/GptResourcesPersistenceVolatile.js +32 -0
  456. package/dist/esm/persistence/GptResourcesPersistenceVolatile.js.map +1 -0
  457. package/dist/esm/test.d.ts +66 -0
  458. package/dist/esm/test.js +288 -0
  459. package/dist/esm/test.js.map +1 -0
  460. package/dist/esm/testfixtures.d.ts +66 -0
  461. package/dist/esm/testfixtures.js +288 -0
  462. package/dist/esm/testfixtures.js.map +1 -0
  463. package/dist/esm/tools/AggregateExtractedStreetviewDataTool.d.ts +24 -0
  464. package/dist/esm/tools/AggregateExtractedStreetviewDataTool.js +61 -0
  465. package/dist/esm/tools/AggregateExtractedStreetviewDataTool.js.map +1 -0
  466. package/dist/esm/tools/AnalyzePageTextTool.d.ts +22 -0
  467. package/dist/esm/tools/AnalyzePageTextTool.js +59 -0
  468. package/dist/esm/tools/AnalyzePageTextTool.js.map +1 -0
  469. package/dist/esm/tools/AssertTool.d.ts +24 -0
  470. package/dist/esm/tools/AssertTool.js +56 -0
  471. package/dist/esm/tools/AssertTool.js.map +1 -0
  472. package/dist/esm/tools/ChangeWebBrowserTabTool.d.ts +18 -0
  473. package/dist/esm/tools/ChangeWebBrowserTabTool.js +36 -0
  474. package/dist/esm/tools/ChangeWebBrowserTabTool.js.map +1 -0
  475. package/dist/esm/tools/ChooseSelectOptionTool.d.ts +18 -0
  476. package/dist/esm/tools/ChooseSelectOptionTool.js +18 -0
  477. package/dist/esm/tools/ChooseSelectOptionTool.js.map +1 -0
  478. package/dist/esm/tools/ClickButtonTool.d.ts +14 -0
  479. package/dist/esm/tools/ClickButtonTool.js +36 -0
  480. package/dist/esm/tools/ClickButtonTool.js.map +1 -0
  481. package/dist/esm/tools/ClickTool.d.ts +14 -0
  482. package/dist/esm/tools/ClickTool.js +36 -0
  483. package/dist/esm/tools/ClickTool.js.map +1 -0
  484. package/dist/esm/tools/CreateBrowserCookieReportTool.d.ts +15 -0
  485. package/dist/esm/tools/CreateBrowserCookieReportTool.js +98 -0
  486. package/dist/esm/tools/CreateBrowserCookieReportTool.js.map +1 -0
  487. package/dist/esm/tools/CustomToolRunnerTool.d.ts +14 -0
  488. package/dist/esm/tools/CustomToolRunnerTool.js +35 -0
  489. package/dist/esm/tools/CustomToolRunnerTool.js.map +1 -0
  490. package/dist/esm/tools/DetectBrokenLinksTool.d.ts +38 -0
  491. package/dist/esm/tools/DetectBrokenLinksTool.js +264 -0
  492. package/dist/esm/tools/DetectBrokenLinksTool.js.map +1 -0
  493. package/dist/esm/tools/DownloadPdfTool.d.ts +19 -0
  494. package/dist/esm/tools/DownloadPdfTool.js +48 -0
  495. package/dist/esm/tools/DownloadPdfTool.js.map +1 -0
  496. package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.d.ts +50 -0
  497. package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js +176 -0
  498. package/dist/esm/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -0
  499. package/dist/esm/tools/ExtractPaymentProviderKeyTool.d.ts +16 -0
  500. package/dist/esm/tools/ExtractPaymentProviderKeyTool.js +80 -0
  501. package/dist/esm/tools/ExtractPaymentProviderKeyTool.js.map +1 -0
  502. package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.d.ts +27 -0
  503. package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.js +232 -0
  504. package/dist/esm/tools/ExtractPublicFacebookEntityDataTool.js.map +1 -0
  505. package/dist/esm/tools/GetEntityDataFromGoogleMapResult.d.ts +27 -0
  506. package/dist/esm/tools/GetEntityDataFromGoogleMapResult.js +36 -0
  507. package/dist/esm/tools/GetEntityDataFromGoogleMapResult.js.map +1 -0
  508. package/dist/esm/tools/GoForwardOrBackTool.d.ts +22 -0
  509. package/dist/esm/tools/GoForwardOrBackTool.js +37 -0
  510. package/dist/esm/tools/GoForwardOrBackTool.js.map +1 -0
  511. package/dist/esm/tools/GoToGoogleMapsStreetViewTool.d.ts +37 -0
  512. package/dist/esm/tools/GoToGoogleMapsStreetViewTool.js +119 -0
  513. package/dist/esm/tools/GoToGoogleMapsStreetViewTool.js.map +1 -0
  514. package/dist/esm/tools/GoToWebpageTool.d.ts +20 -0
  515. package/dist/esm/tools/GoToWebpageTool.js +40 -0
  516. package/dist/esm/tools/GoToWebpageTool.js.map +1 -0
  517. package/dist/esm/tools/HandleBrowserDialogTool.d.ts +26 -0
  518. package/dist/esm/tools/HandleBrowserDialogTool.js +22 -0
  519. package/dist/esm/tools/HandleBrowserDialogTool.js.map +1 -0
  520. package/dist/esm/tools/HoverOverElementTool.d.ts +15 -0
  521. package/dist/esm/tools/HoverOverElementTool.js +18 -0
  522. package/dist/esm/tools/HoverOverElementTool.js.map +1 -0
  523. package/dist/esm/tools/InputRandomizedEmailAddressTool.d.ts +27 -0
  524. package/dist/esm/tools/InputRandomizedEmailAddressTool.js +74 -0
  525. package/dist/esm/tools/InputRandomizedEmailAddressTool.js.map +1 -0
  526. package/dist/esm/tools/InputTextTool.d.ts +24 -0
  527. package/dist/esm/tools/InputTextTool.js +48 -0
  528. package/dist/esm/tools/InputTextTool.js.map +1 -0
  529. package/dist/esm/tools/MakeCommentTool.d.ts +21 -0
  530. package/dist/esm/tools/MakeCommentTool.js +31 -0
  531. package/dist/esm/tools/MakeCommentTool.js.map +1 -0
  532. package/dist/esm/tools/MarkObjectiveCompleteTool.d.ts +27 -0
  533. package/dist/esm/tools/MarkObjectiveCompleteTool.js +39 -0
  534. package/dist/esm/tools/MarkObjectiveCompleteTool.js.map +1 -0
  535. package/dist/esm/tools/MarkObjectiveNotCompletableTool.d.ts +14 -0
  536. package/dist/esm/tools/MarkObjectiveNotCompletableTool.js +35 -0
  537. package/dist/esm/tools/MarkObjectiveNotCompletableTool.js.map +1 -0
  538. package/dist/esm/tools/NavigateToWebpageTool.d.ts +20 -0
  539. package/dist/esm/tools/NavigateToWebpageTool.js +40 -0
  540. package/dist/esm/tools/NavigateToWebpageTool.js.map +1 -0
  541. package/dist/esm/tools/NavigateWithinStreetView.d.ts +38 -0
  542. package/dist/esm/tools/NavigateWithinStreetView.js +107 -0
  543. package/dist/esm/tools/NavigateWithinStreetView.js.map +1 -0
  544. package/dist/esm/tools/PauseForUserInteractionTool.d.ts +18 -0
  545. package/dist/esm/tools/PauseForUserInteractionTool.js +24 -0
  546. package/dist/esm/tools/PauseForUserInteractionTool.js.map +1 -0
  547. package/dist/esm/tools/PressKeyTool.d.ts +18 -0
  548. package/dist/esm/tools/PressKeyTool.js +43 -0
  549. package/dist/esm/tools/PressKeyTool.js.map +1 -0
  550. package/dist/esm/tools/ReloadPageTool.d.ts +14 -0
  551. package/dist/esm/tools/ReloadPageTool.js +20 -0
  552. package/dist/esm/tools/ReloadPageTool.js.map +1 -0
  553. package/dist/esm/tools/ReplayableInteraction.d.ts +62 -0
  554. package/dist/esm/tools/ReplayableInteraction.js +170 -0
  555. package/dist/esm/tools/ReplayableInteraction.js.map +1 -0
  556. package/dist/esm/tools/RunAccessibilityTestTool.d.ts +14 -0
  557. package/dist/esm/tools/RunAccessibilityTestTool.js +49 -0
  558. package/dist/esm/tools/RunAccessibilityTestTool.js.map +1 -0
  559. package/dist/esm/tools/RunInlineJavaScriptCodeTool.d.ts +17 -0
  560. package/dist/esm/tools/RunInlineJavaScriptCodeTool.js +30 -0
  561. package/dist/esm/tools/RunInlineJavaScriptCodeTool.js.map +1 -0
  562. package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.d.ts +18 -0
  563. package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.js +43 -0
  564. package/dist/esm/tools/RunSandboxedJavaScriptCodeTool.js.map +1 -0
  565. package/dist/esm/tools/SaveWebpageAsPdfTool.d.ts +15 -0
  566. package/dist/esm/tools/SaveWebpageAsPdfTool.js +27 -0
  567. package/dist/esm/tools/SaveWebpageAsPdfTool.js.map +1 -0
  568. package/dist/esm/tools/ScrollPageTool.d.ts +18 -0
  569. package/dist/esm/tools/ScrollPageTool.js +21 -0
  570. package/dist/esm/tools/ScrollPageTool.js.map +1 -0
  571. package/dist/esm/tools/SetRunModeTool.d.ts +20 -0
  572. package/dist/esm/tools/SetRunModeTool.js +22 -0
  573. package/dist/esm/tools/SetRunModeTool.js.map +1 -0
  574. package/dist/esm/tools/SummarizeLearningsTool.d.ts +21 -0
  575. package/dist/esm/tools/SummarizeLearningsTool.js +31 -0
  576. package/dist/esm/tools/SummarizeLearningsTool.js.map +1 -0
  577. package/dist/esm/tools/Tool.d.ts +35 -0
  578. package/dist/esm/tools/Tool.js +38 -0
  579. package/dist/esm/tools/Tool.js.map +1 -0
  580. package/dist/esm/tools/TriggerDonobuFlowTool.d.ts +19 -0
  581. package/dist/esm/tools/TriggerDonobuFlowTool.js +26 -0
  582. package/dist/esm/tools/TriggerDonobuFlowTool.js.map +1 -0
  583. package/dist/esm/tools/WaitTool.d.ts +18 -0
  584. package/dist/esm/tools/WaitTool.js +20 -0
  585. package/dist/esm/tools/WaitTool.js.map +1 -0
  586. package/dist/esm/utils/DirectoryUtils.d.ts +11 -0
  587. package/dist/esm/utils/DirectoryUtils.js +37 -0
  588. package/dist/esm/utils/DirectoryUtils.js.map +1 -0
  589. package/dist/esm/utils/JsonUtils.d.ts +19 -0
  590. package/dist/esm/utils/JsonUtils.js +124 -0
  591. package/dist/esm/utils/JsonUtils.js.map +1 -0
  592. package/dist/esm/utils/Logger.d.ts +17 -0
  593. package/dist/esm/utils/Logger.js +95 -0
  594. package/dist/esm/utils/Logger.js.map +1 -0
  595. package/dist/esm/utils/MiscUtils.d.ts +62 -0
  596. package/dist/esm/utils/MiscUtils.js +164 -0
  597. package/dist/esm/utils/MiscUtils.js.map +1 -0
  598. package/dist/esm/utils/PlaywrightUtils.d.ts +180 -0
  599. package/dist/esm/utils/PlaywrightUtils.js +1086 -0
  600. package/dist/esm/utils/PlaywrightUtils.js.map +1 -0
  601. package/dist/esm/utils/VerbConverter.d.ts +14 -0
  602. package/dist/esm/utils/VerbConverter.js +96 -0
  603. package/dist/esm/utils/VerbConverter.js.map +1 -0
  604. package/dist/exceptions/ActiveFlowNotFoundException.d.ts +10 -0
  605. package/dist/exceptions/ActiveFlowNotFoundException.js +19 -0
  606. package/dist/exceptions/ActiveFlowNotFoundException.js.map +1 -0
  607. package/dist/exceptions/ApiKeyNotSetUpException.d.ts +14 -0
  608. package/dist/exceptions/ApiKeyNotSetUpException.js +21 -0
  609. package/dist/exceptions/ApiKeyNotSetUpException.js.map +1 -0
  610. package/dist/exceptions/BrowserStateNotFoundException.d.ts +8 -0
  611. package/dist/exceptions/BrowserStateNotFoundException.js +15 -0
  612. package/dist/exceptions/BrowserStateNotFoundException.js.map +1 -0
  613. package/dist/exceptions/CannotDeleteRunningFlowException.d.ts +9 -0
  614. package/dist/exceptions/CannotDeleteRunningFlowException.js +18 -0
  615. package/dist/exceptions/CannotDeleteRunningFlowException.js.map +1 -0
  616. package/dist/exceptions/DonobuException.d.ts +12 -0
  617. package/dist/exceptions/DonobuException.js +39 -0
  618. package/dist/exceptions/DonobuException.js.map +1 -0
  619. package/dist/exceptions/FlowNotFoundException.d.ts +6 -0
  620. package/dist/exceptions/FlowNotFoundException.js +17 -0
  621. package/dist/exceptions/FlowNotFoundException.js.map +1 -0
  622. package/dist/exceptions/GptApiKeysNotSetupException.d.ts +4 -0
  623. package/dist/exceptions/GptApiKeysNotSetupException.js +11 -0
  624. package/dist/exceptions/GptApiKeysNotSetupException.js.map +1 -0
  625. package/dist/exceptions/GptConfigNotFoundException.d.ts +8 -0
  626. package/dist/exceptions/GptConfigNotFoundException.js +16 -0
  627. package/dist/exceptions/GptConfigNotFoundException.js.map +1 -0
  628. package/dist/exceptions/GptModelNotFoundException.d.ts +9 -0
  629. package/dist/exceptions/GptModelNotFoundException.js +18 -0
  630. package/dist/exceptions/GptModelNotFoundException.js.map +1 -0
  631. package/dist/exceptions/GptPlatformAuthenticationFailedException.d.ts +6 -0
  632. package/dist/exceptions/GptPlatformAuthenticationFailedException.js +14 -0
  633. package/dist/exceptions/GptPlatformAuthenticationFailedException.js.map +1 -0
  634. package/dist/exceptions/GptPlatformInsufficientQuotaException.d.ts +5 -0
  635. package/dist/exceptions/GptPlatformInsufficientQuotaException.js +13 -0
  636. package/dist/exceptions/GptPlatformInsufficientQuotaException.js.map +1 -0
  637. package/dist/exceptions/GptPlatformInternalErrorException.d.ts +5 -0
  638. package/dist/exceptions/GptPlatformInternalErrorException.js +12 -0
  639. package/dist/exceptions/GptPlatformInternalErrorException.js.map +1 -0
  640. package/dist/exceptions/GptPlatformNotReachableException.d.ts +5 -0
  641. package/dist/exceptions/GptPlatformNotReachableException.js +13 -0
  642. package/dist/exceptions/GptPlatformNotReachableException.js.map +1 -0
  643. package/dist/exceptions/GptPlatformRateLimitedException.d.ts +5 -0
  644. package/dist/exceptions/GptPlatformRateLimitedException.js +13 -0
  645. package/dist/exceptions/GptPlatformRateLimitedException.js.map +1 -0
  646. package/dist/exceptions/GptResourceNotFoundException.d.ts +8 -0
  647. package/dist/exceptions/GptResourceNotFoundException.js +16 -0
  648. package/dist/exceptions/GptResourceNotFoundException.js.map +1 -0
  649. package/dist/exceptions/InvalidParamValueException.d.ts +13 -0
  650. package/dist/exceptions/InvalidParamValueException.js +25 -0
  651. package/dist/exceptions/InvalidParamValueException.js.map +1 -0
  652. package/dist/exceptions/NoApiAccessTokenPresentException.d.ts +8 -0
  653. package/dist/exceptions/NoApiAccessTokenPresentException.js +15 -0
  654. package/dist/exceptions/NoApiAccessTokenPresentException.js.map +1 -0
  655. package/dist/exceptions/PageClosedException.d.ts +6 -0
  656. package/dist/exceptions/PageClosedException.js +13 -0
  657. package/dist/exceptions/PageClosedException.js.map +1 -0
  658. package/dist/exceptions/TooManyRequestsException.d.ts +5 -0
  659. package/dist/exceptions/TooManyRequestsException.js +13 -0
  660. package/dist/exceptions/TooManyRequestsException.js.map +1 -0
  661. package/dist/exceptions/ToolCallNotFoundException.d.ts +6 -0
  662. package/dist/exceptions/ToolCallNotFoundException.js +14 -0
  663. package/dist/exceptions/ToolCallNotFoundException.js.map +1 -0
  664. package/dist/exceptions/ToolRequiresGptException.d.ts +5 -0
  665. package/dist/exceptions/ToolRequiresGptException.js +13 -0
  666. package/dist/exceptions/ToolRequiresGptException.js.map +1 -0
  667. package/dist/exceptions/UnknownToolException.d.ts +5 -0
  668. package/dist/exceptions/UnknownToolException.js +13 -0
  669. package/dist/exceptions/UnknownToolException.js.map +1 -0
  670. package/dist/exceptions/UnparseableJsonBodyException.d.ts +4 -0
  671. package/dist/exceptions/UnparseableJsonBodyException.js +12 -0
  672. package/dist/exceptions/UnparseableJsonBodyException.js.map +1 -0
  673. package/dist/main.d.ts +21 -0
  674. package/dist/main.js +143 -0
  675. package/dist/main.js.map +1 -0
  676. package/dist/managers/AdminApiController.d.ts +32 -0
  677. package/dist/managers/AdminApiController.js +251 -0
  678. package/dist/managers/AdminApiController.js.map +1 -0
  679. package/dist/managers/AgentsManager.d.ts +28 -0
  680. package/dist/managers/AgentsManager.js +75 -0
  681. package/dist/managers/AgentsManager.js.map +1 -0
  682. package/dist/managers/DonobuFlow.d.ts +115 -0
  683. package/dist/managers/DonobuFlow.js +1070 -0
  684. package/dist/managers/DonobuFlow.js.map +1 -0
  685. package/dist/managers/DonobuFlowsManager.d.ts +130 -0
  686. package/dist/managers/DonobuFlowsManager.js +830 -0
  687. package/dist/managers/DonobuFlowsManager.js.map +1 -0
  688. package/dist/managers/FlowsPersistence.d.ts +79 -0
  689. package/dist/managers/FlowsPersistence.js +3 -0
  690. package/dist/managers/FlowsPersistence.js.map +1 -0
  691. package/dist/managers/FlowsPersistenceAwsS3.d.ts +48 -0
  692. package/dist/managers/FlowsPersistenceAwsS3.js +284 -0
  693. package/dist/managers/FlowsPersistenceAwsS3.js.map +1 -0
  694. package/dist/managers/FlowsPersistenceFactory.d.ts +9 -0
  695. package/dist/managers/FlowsPersistenceFactory.js +3 -0
  696. package/dist/managers/FlowsPersistenceFactory.js.map +1 -0
  697. package/dist/managers/FlowsPersistenceFactoryImpl.d.ts +57 -0
  698. package/dist/managers/FlowsPersistenceFactoryImpl.js +119 -0
  699. package/dist/managers/FlowsPersistenceFactoryImpl.js.map +1 -0
  700. package/dist/managers/FlowsPersistenceFactoryPreset.d.ts +12 -0
  701. package/dist/managers/FlowsPersistenceFactoryPreset.js +25 -0
  702. package/dist/managers/FlowsPersistenceFactoryPreset.js.map +1 -0
  703. package/dist/managers/FlowsPersistenceFilesystem.d.ts +33 -0
  704. package/dist/managers/FlowsPersistenceFilesystem.js +180 -0
  705. package/dist/managers/FlowsPersistenceFilesystem.js.map +1 -0
  706. package/dist/managers/FlowsPersistenceGoogleCloudStorage.d.ts +40 -0
  707. package/dist/managers/FlowsPersistenceGoogleCloudStorage.js +209 -0
  708. package/dist/managers/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
  709. package/dist/managers/FlowsPersistenceSupabase.d.ts +33 -0
  710. package/dist/managers/FlowsPersistenceSupabase.js +152 -0
  711. package/dist/managers/FlowsPersistenceSupabase.js.map +1 -0
  712. package/dist/managers/FlowsPersistenceVolatile.d.ts +30 -0
  713. package/dist/managers/FlowsPersistenceVolatile.js +103 -0
  714. package/dist/managers/FlowsPersistenceVolatile.js.map +1 -0
  715. package/dist/managers/GptConfigsManager.d.ts +38 -0
  716. package/dist/managers/GptConfigsManager.js +159 -0
  717. package/dist/managers/GptConfigsManager.js.map +1 -0
  718. package/dist/managers/GptPlatformApiKeysManager.d.ts +36 -0
  719. package/dist/managers/GptPlatformApiKeysManager.js +3 -0
  720. package/dist/managers/GptPlatformApiKeysManager.js.map +1 -0
  721. package/dist/managers/GptPlatformApiKeysManagerFilesystem.d.ts +29 -0
  722. package/dist/managers/GptPlatformApiKeysManagerFilesystem.js +136 -0
  723. package/dist/managers/GptPlatformApiKeysManagerFilesystem.js.map +1 -0
  724. package/dist/managers/GptPlatformApiKeysManagerVolatile.d.ts +35 -0
  725. package/dist/managers/GptPlatformApiKeysManagerVolatile.js +51 -0
  726. package/dist/managers/GptPlatformApiKeysManagerVolatile.js.map +1 -0
  727. package/dist/managers/GptResourcesManager.d.ts +44 -0
  728. package/dist/managers/GptResourcesManager.js +180 -0
  729. package/dist/managers/GptResourcesManager.js.map +1 -0
  730. package/dist/managers/RequestContextHolder.d.ts +24 -0
  731. package/dist/managers/RequestContextHolder.js +43 -0
  732. package/dist/managers/RequestContextHolder.js.map +1 -0
  733. package/dist/managers/SelectorGenerator.d.ts +8 -0
  734. package/dist/managers/SelectorGenerator.js +15 -0
  735. package/dist/managers/SelectorGenerator.js.map +1 -0
  736. package/dist/managers/ToolManager.d.ts +21 -0
  737. package/dist/managers/ToolManager.js +264 -0
  738. package/dist/managers/ToolManager.js.map +1 -0
  739. package/dist/managers/ToolTipper.d.ts +35 -0
  740. package/dist/managers/ToolTipper.js +201 -0
  741. package/dist/managers/ToolTipper.js.map +1 -0
  742. package/dist/models/AskAiRequest.d.ts +14 -0
  743. package/dist/models/AskAiRequest.js +3 -0
  744. package/dist/models/AskAiRequest.js.map +1 -0
  745. package/dist/models/BaseToolGptParameters.d.ts +9 -0
  746. package/dist/models/BaseToolGptParameters.js +3 -0
  747. package/dist/models/BaseToolGptParameters.js.map +1 -0
  748. package/dist/models/BaseToolParam.d.ts +9 -0
  749. package/dist/models/BaseToolParam.js +3 -0
  750. package/dist/models/BaseToolParam.js.map +1 -0
  751. package/dist/models/BaseToolParameters.d.ts +9 -0
  752. package/dist/models/BaseToolParameters.js +3 -0
  753. package/dist/models/BaseToolParameters.js.map +1 -0
  754. package/dist/models/BrowserDevice.d.ts +18 -0
  755. package/dist/models/BrowserDevice.js +3 -0
  756. package/dist/models/BrowserDevice.js.map +1 -0
  757. package/dist/models/BrowserFramework.d.ts +36 -0
  758. package/dist/models/BrowserFramework.js +164 -0
  759. package/dist/models/BrowserFramework.js.map +1 -0
  760. package/dist/models/BrowserState.d.ts +25 -0
  761. package/dist/models/BrowserState.js +3 -0
  762. package/dist/models/BrowserState.js.map +1 -0
  763. package/dist/models/BrowserStateFlowReference.d.ts +10 -0
  764. package/dist/models/BrowserStateFlowReference.js +3 -0
  765. package/dist/models/BrowserStateFlowReference.js.map +1 -0
  766. package/dist/models/CreateDonobuFlow.d.ts +88 -0
  767. package/dist/models/CreateDonobuFlow.js +3 -0
  768. package/dist/models/CreateDonobuFlow.js.map +1 -0
  769. package/dist/models/CreateGoogleSteetviewExtractionFlow.d.ts +21 -0
  770. package/dist/models/CreateGoogleSteetviewExtractionFlow.js +3 -0
  771. package/dist/models/CreateGoogleSteetviewExtractionFlow.js.map +1 -0
  772. package/dist/models/CustomTool.d.ts +9 -0
  773. package/dist/models/CustomTool.js +3 -0
  774. package/dist/models/CustomTool.js.map +1 -0
  775. package/dist/models/DonobuAgentType.d.ts +2 -0
  776. package/dist/models/DonobuAgentType.js +5 -0
  777. package/dist/models/DonobuAgentType.js.map +1 -0
  778. package/dist/models/DonobuAnnotated.d.ts +23 -0
  779. package/dist/models/DonobuAnnotated.js +12 -0
  780. package/dist/models/DonobuAnnotated.js.map +1 -0
  781. package/dist/models/DonobuDeploymentEnvironment.d.ts +5 -0
  782. package/dist/models/DonobuDeploymentEnvironment.js +10 -0
  783. package/dist/models/DonobuDeploymentEnvironment.js.map +1 -0
  784. package/dist/models/DonobuErrorResponse.d.ts +13 -0
  785. package/dist/models/DonobuErrorResponse.js +3 -0
  786. package/dist/models/DonobuErrorResponse.js.map +1 -0
  787. package/dist/models/ElementSelector.d.ts +14 -0
  788. package/dist/models/ElementSelector.js +3 -0
  789. package/dist/models/ElementSelector.js.map +1 -0
  790. package/dist/models/ElementSelectorForReplay.d.ts +14 -0
  791. package/dist/models/ElementSelectorForReplay.js +3 -0
  792. package/dist/models/ElementSelectorForReplay.js.map +1 -0
  793. package/dist/models/FlowMetadata.d.ts +123 -0
  794. package/dist/models/FlowMetadata.js +50 -0
  795. package/dist/models/FlowMetadata.js.map +1 -0
  796. package/dist/models/FlowsQuery.d.ts +11 -0
  797. package/dist/models/FlowsQuery.js +3 -0
  798. package/dist/models/FlowsQuery.js.map +1 -0
  799. package/dist/models/FocusedPage.d.ts +4 -0
  800. package/dist/models/FocusedPage.js +3 -0
  801. package/dist/models/FocusedPage.js.map +1 -0
  802. package/dist/models/GptConfig.d.ts +38 -0
  803. package/dist/models/GptConfig.js +3 -0
  804. package/dist/models/GptConfig.js.map +1 -0
  805. package/dist/models/GptMessage.d.ts +43 -0
  806. package/dist/models/GptMessage.js +3 -0
  807. package/dist/models/GptMessage.js.map +1 -0
  808. package/dist/models/GptResource.d.ts +33 -0
  809. package/dist/models/GptResource.js +3 -0
  810. package/dist/models/GptResource.js.map +1 -0
  811. package/dist/models/InteractableElement.d.ts +13 -0
  812. package/dist/models/InteractableElement.js +3 -0
  813. package/dist/models/InteractableElement.js.map +1 -0
  814. package/dist/models/ProposedToolCall.d.ts +19 -0
  815. package/dist/models/ProposedToolCall.js +3 -0
  816. package/dist/models/ProposedToolCall.js.map +1 -0
  817. package/dist/models/RequestContext.d.ts +21 -0
  818. package/dist/models/RequestContext.js +24 -0
  819. package/dist/models/RequestContext.js.map +1 -0
  820. package/dist/models/ToolCall.d.ts +38 -0
  821. package/dist/models/ToolCall.js +3 -0
  822. package/dist/models/ToolCall.js.map +1 -0
  823. package/dist/models/ToolCallContext.d.ts +22 -0
  824. package/dist/models/ToolCallContext.js +3 -0
  825. package/dist/models/ToolCallContext.js.map +1 -0
  826. package/dist/models/ToolCallResult.d.ts +20 -0
  827. package/dist/models/ToolCallResult.js +19 -0
  828. package/dist/models/ToolCallResult.js.map +1 -0
  829. package/dist/models/VideoSegment.d.ts +20 -0
  830. package/dist/models/VideoSegment.js +3 -0
  831. package/dist/models/VideoSegment.js.map +1 -0
  832. package/dist/persistence/AgentsPersistence.d.ts +11 -0
  833. package/dist/persistence/AgentsPersistence.js +3 -0
  834. package/dist/persistence/AgentsPersistence.js.map +1 -0
  835. package/dist/persistence/AgentsPersistenceFilesystem.d.ts +15 -0
  836. package/dist/persistence/AgentsPersistenceFilesystem.js +48 -0
  837. package/dist/persistence/AgentsPersistenceFilesystem.js.map +1 -0
  838. package/dist/persistence/AgentsPersistenceSqlite.d.ts +14 -0
  839. package/dist/persistence/AgentsPersistenceSqlite.js +51 -0
  840. package/dist/persistence/AgentsPersistenceSqlite.js.map +1 -0
  841. package/dist/persistence/AgentsPersistenceVolatile.d.ts +13 -0
  842. package/dist/persistence/AgentsPersistenceVolatile.js +27 -0
  843. package/dist/persistence/AgentsPersistenceVolatile.js.map +1 -0
  844. package/dist/persistence/DonobuSqliteDb.d.ts +11 -0
  845. package/dist/persistence/DonobuSqliteDb.js +178 -0
  846. package/dist/persistence/DonobuSqliteDb.js.map +1 -0
  847. package/dist/persistence/FlowsPersistence.d.ts +94 -0
  848. package/dist/persistence/FlowsPersistence.js +3 -0
  849. package/dist/persistence/FlowsPersistence.js.map +1 -0
  850. package/dist/persistence/FlowsPersistenceAwsS3.d.ts +70 -0
  851. package/dist/persistence/FlowsPersistenceAwsS3.js +447 -0
  852. package/dist/persistence/FlowsPersistenceAwsS3.js.map +1 -0
  853. package/dist/persistence/FlowsPersistenceFactory.d.ts +9 -0
  854. package/dist/persistence/FlowsPersistenceFactory.js +3 -0
  855. package/dist/persistence/FlowsPersistenceFactory.js.map +1 -0
  856. package/dist/persistence/FlowsPersistenceFactoryImpl.d.ts +60 -0
  857. package/dist/persistence/FlowsPersistenceFactoryImpl.js +244 -0
  858. package/dist/persistence/FlowsPersistenceFactoryImpl.js.map +1 -0
  859. package/dist/persistence/FlowsPersistenceFactoryPreset.d.ts +12 -0
  860. package/dist/persistence/FlowsPersistenceFactoryPreset.js +25 -0
  861. package/dist/persistence/FlowsPersistenceFactoryPreset.js.map +1 -0
  862. package/dist/persistence/FlowsPersistenceFilesystem.d.ts +42 -0
  863. package/dist/persistence/FlowsPersistenceFilesystem.js +271 -0
  864. package/dist/persistence/FlowsPersistenceFilesystem.js.map +1 -0
  865. package/dist/persistence/FlowsPersistenceGoogleCloudStorage.d.ts +62 -0
  866. package/dist/persistence/FlowsPersistenceGoogleCloudStorage.js +406 -0
  867. package/dist/persistence/FlowsPersistenceGoogleCloudStorage.js.map +1 -0
  868. package/dist/persistence/FlowsPersistenceSqlite.d.ts +37 -0
  869. package/dist/persistence/FlowsPersistenceSqlite.js +229 -0
  870. package/dist/persistence/FlowsPersistenceSqlite.js.map +1 -0
  871. package/dist/persistence/FlowsPersistenceSupabase.d.ts +38 -0
  872. package/dist/persistence/FlowsPersistenceSupabase.js +216 -0
  873. package/dist/persistence/FlowsPersistenceSupabase.js.map +1 -0
  874. package/dist/persistence/FlowsPersistenceVolatile.d.ts +35 -0
  875. package/dist/persistence/FlowsPersistenceVolatile.js +147 -0
  876. package/dist/persistence/FlowsPersistenceVolatile.js.map +1 -0
  877. package/dist/persistence/GptConfigsPersistence.d.ts +11 -0
  878. package/dist/persistence/GptConfigsPersistence.js +3 -0
  879. package/dist/persistence/GptConfigsPersistence.js.map +1 -0
  880. package/dist/persistence/GptConfigsPersistenceFilesystem.d.ts +16 -0
  881. package/dist/persistence/GptConfigsPersistenceFilesystem.js +54 -0
  882. package/dist/persistence/GptConfigsPersistenceFilesystem.js.map +1 -0
  883. package/dist/persistence/GptConfigsPersistenceSqlite.d.ts +12 -0
  884. package/dist/persistence/GptConfigsPersistenceSqlite.js +36 -0
  885. package/dist/persistence/GptConfigsPersistenceSqlite.js.map +1 -0
  886. package/dist/persistence/GptConfigsPersistenceVolatile.d.ts +14 -0
  887. package/dist/persistence/GptConfigsPersistenceVolatile.js +32 -0
  888. package/dist/persistence/GptConfigsPersistenceVolatile.js.map +1 -0
  889. package/dist/persistence/GptResourcesPersistence.d.ts +11 -0
  890. package/dist/persistence/GptResourcesPersistence.js +3 -0
  891. package/dist/persistence/GptResourcesPersistence.js.map +1 -0
  892. package/dist/persistence/GptResourcesPersistenceFilesystem.d.ts +20 -0
  893. package/dist/persistence/GptResourcesPersistenceFilesystem.js +79 -0
  894. package/dist/persistence/GptResourcesPersistenceFilesystem.js.map +1 -0
  895. package/dist/persistence/GptResourcesPersistenceVolatile.d.ts +14 -0
  896. package/dist/persistence/GptResourcesPersistenceVolatile.js +32 -0
  897. package/dist/persistence/GptResourcesPersistenceVolatile.js.map +1 -0
  898. package/dist/test.d.ts +66 -0
  899. package/dist/test.js +288 -0
  900. package/dist/test.js.map +1 -0
  901. package/dist/testfixtures.d.ts +66 -0
  902. package/dist/testfixtures.js +288 -0
  903. package/dist/testfixtures.js.map +1 -0
  904. package/dist/tools/AggregateExtractedStreetviewDataTool.d.ts +24 -0
  905. package/dist/tools/AggregateExtractedStreetviewDataTool.js +61 -0
  906. package/dist/tools/AggregateExtractedStreetviewDataTool.js.map +1 -0
  907. package/dist/tools/AnalyzePageTextTool.d.ts +22 -0
  908. package/dist/tools/AnalyzePageTextTool.js +59 -0
  909. package/dist/tools/AnalyzePageTextTool.js.map +1 -0
  910. package/dist/tools/AssertTool.d.ts +24 -0
  911. package/dist/tools/AssertTool.js +56 -0
  912. package/dist/tools/AssertTool.js.map +1 -0
  913. package/dist/tools/ChangeWebBrowserTabTool.d.ts +18 -0
  914. package/dist/tools/ChangeWebBrowserTabTool.js +36 -0
  915. package/dist/tools/ChangeWebBrowserTabTool.js.map +1 -0
  916. package/dist/tools/ChooseSelectOptionTool.d.ts +18 -0
  917. package/dist/tools/ChooseSelectOptionTool.js +18 -0
  918. package/dist/tools/ChooseSelectOptionTool.js.map +1 -0
  919. package/dist/tools/ClickButtonTool.d.ts +14 -0
  920. package/dist/tools/ClickButtonTool.js +36 -0
  921. package/dist/tools/ClickButtonTool.js.map +1 -0
  922. package/dist/tools/ClickTool.d.ts +14 -0
  923. package/dist/tools/ClickTool.js +36 -0
  924. package/dist/tools/ClickTool.js.map +1 -0
  925. package/dist/tools/CreateBrowserCookieReportTool.d.ts +15 -0
  926. package/dist/tools/CreateBrowserCookieReportTool.js +98 -0
  927. package/dist/tools/CreateBrowserCookieReportTool.js.map +1 -0
  928. package/dist/tools/CustomToolRunnerTool.d.ts +14 -0
  929. package/dist/tools/CustomToolRunnerTool.js +35 -0
  930. package/dist/tools/CustomToolRunnerTool.js.map +1 -0
  931. package/dist/tools/DetectBrokenLinksTool.d.ts +38 -0
  932. package/dist/tools/DetectBrokenLinksTool.js +264 -0
  933. package/dist/tools/DetectBrokenLinksTool.js.map +1 -0
  934. package/dist/tools/DownloadPdfTool.d.ts +19 -0
  935. package/dist/tools/DownloadPdfTool.js +48 -0
  936. package/dist/tools/DownloadPdfTool.js.map +1 -0
  937. package/dist/tools/ExtractGoogleStreetviewEntityDataTool.d.ts +50 -0
  938. package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js +176 -0
  939. package/dist/tools/ExtractGoogleStreetviewEntityDataTool.js.map +1 -0
  940. package/dist/tools/ExtractPaymentProviderKeyTool.d.ts +16 -0
  941. package/dist/tools/ExtractPaymentProviderKeyTool.js +80 -0
  942. package/dist/tools/ExtractPaymentProviderKeyTool.js.map +1 -0
  943. package/dist/tools/ExtractPublicFacebookEntityDataTool.d.ts +27 -0
  944. package/dist/tools/ExtractPublicFacebookEntityDataTool.js +232 -0
  945. package/dist/tools/ExtractPublicFacebookEntityDataTool.js.map +1 -0
  946. package/dist/tools/GetEntityDataFromGoogleMapResult.d.ts +27 -0
  947. package/dist/tools/GetEntityDataFromGoogleMapResult.js +36 -0
  948. package/dist/tools/GetEntityDataFromGoogleMapResult.js.map +1 -0
  949. package/dist/tools/GoForwardOrBackTool.d.ts +22 -0
  950. package/dist/tools/GoForwardOrBackTool.js +37 -0
  951. package/dist/tools/GoForwardOrBackTool.js.map +1 -0
  952. package/dist/tools/GoToGoogleMapsStreetViewTool.d.ts +37 -0
  953. package/dist/tools/GoToGoogleMapsStreetViewTool.js +119 -0
  954. package/dist/tools/GoToGoogleMapsStreetViewTool.js.map +1 -0
  955. package/dist/tools/GoToWebpageTool.d.ts +20 -0
  956. package/dist/tools/GoToWebpageTool.js +40 -0
  957. package/dist/tools/GoToWebpageTool.js.map +1 -0
  958. package/dist/tools/HandleBrowserDialogTool.d.ts +26 -0
  959. package/dist/tools/HandleBrowserDialogTool.js +22 -0
  960. package/dist/tools/HandleBrowserDialogTool.js.map +1 -0
  961. package/dist/tools/HoverOverElementTool.d.ts +15 -0
  962. package/dist/tools/HoverOverElementTool.js +18 -0
  963. package/dist/tools/HoverOverElementTool.js.map +1 -0
  964. package/dist/tools/InputRandomizedEmailAddressTool.d.ts +27 -0
  965. package/dist/tools/InputRandomizedEmailAddressTool.js +74 -0
  966. package/dist/tools/InputRandomizedEmailAddressTool.js.map +1 -0
  967. package/dist/tools/InputTextTool.d.ts +24 -0
  968. package/dist/tools/InputTextTool.js +48 -0
  969. package/dist/tools/InputTextTool.js.map +1 -0
  970. package/dist/tools/MakeCommentTool.d.ts +21 -0
  971. package/dist/tools/MakeCommentTool.js +31 -0
  972. package/dist/tools/MakeCommentTool.js.map +1 -0
  973. package/dist/tools/MarkObjectiveCompleteTool.d.ts +27 -0
  974. package/dist/tools/MarkObjectiveCompleteTool.js +39 -0
  975. package/dist/tools/MarkObjectiveCompleteTool.js.map +1 -0
  976. package/dist/tools/MarkObjectiveNotCompletableTool.d.ts +14 -0
  977. package/dist/tools/MarkObjectiveNotCompletableTool.js +35 -0
  978. package/dist/tools/MarkObjectiveNotCompletableTool.js.map +1 -0
  979. package/dist/tools/NavigateToWebpage.d.ts +19 -0
  980. package/dist/tools/NavigateToWebpage.js +25 -0
  981. package/dist/tools/NavigateToWebpage.js.map +1 -0
  982. package/dist/tools/NavigateToWebpageTool.d.ts +20 -0
  983. package/dist/tools/NavigateToWebpageTool.js +40 -0
  984. package/dist/tools/NavigateToWebpageTool.js.map +1 -0
  985. package/dist/tools/NavigateWithinStreetView.d.ts +38 -0
  986. package/dist/tools/NavigateWithinStreetView.js +107 -0
  987. package/dist/tools/NavigateWithinStreetView.js.map +1 -0
  988. package/dist/tools/PauseForUserInteractionTool.d.ts +18 -0
  989. package/dist/tools/PauseForUserInteractionTool.js +24 -0
  990. package/dist/tools/PauseForUserInteractionTool.js.map +1 -0
  991. package/dist/tools/PressKeyTool.d.ts +18 -0
  992. package/dist/tools/PressKeyTool.js +43 -0
  993. package/dist/tools/PressKeyTool.js.map +1 -0
  994. package/dist/tools/ReloadPageTool.d.ts +14 -0
  995. package/dist/tools/ReloadPageTool.js +20 -0
  996. package/dist/tools/ReloadPageTool.js.map +1 -0
  997. package/dist/tools/ReplayableInteraction.d.ts +62 -0
  998. package/dist/tools/ReplayableInteraction.js +170 -0
  999. package/dist/tools/ReplayableInteraction.js.map +1 -0
  1000. package/dist/tools/RunAccessibilityTestTool.d.ts +14 -0
  1001. package/dist/tools/RunAccessibilityTestTool.js +49 -0
  1002. package/dist/tools/RunAccessibilityTestTool.js.map +1 -0
  1003. package/dist/tools/RunInlineJavaScriptCodeTool.d.ts +17 -0
  1004. package/dist/tools/RunInlineJavaScriptCodeTool.js +30 -0
  1005. package/dist/tools/RunInlineJavaScriptCodeTool.js.map +1 -0
  1006. package/dist/tools/RunSandboxedJavaScriptCodeTool.d.ts +18 -0
  1007. package/dist/tools/RunSandboxedJavaScriptCodeTool.js +43 -0
  1008. package/dist/tools/RunSandboxedJavaScriptCodeTool.js.map +1 -0
  1009. package/dist/tools/SaveWebpageAsPdfTool.d.ts +15 -0
  1010. package/dist/tools/SaveWebpageAsPdfTool.js +27 -0
  1011. package/dist/tools/SaveWebpageAsPdfTool.js.map +1 -0
  1012. package/dist/tools/ScrollPageTool.d.ts +18 -0
  1013. package/dist/tools/ScrollPageTool.js +21 -0
  1014. package/dist/tools/ScrollPageTool.js.map +1 -0
  1015. package/dist/tools/SetRunModeTool.d.ts +20 -0
  1016. package/dist/tools/SetRunModeTool.js +22 -0
  1017. package/dist/tools/SetRunModeTool.js.map +1 -0
  1018. package/dist/tools/SummarizeLearningsTool.d.ts +21 -0
  1019. package/dist/tools/SummarizeLearningsTool.js +31 -0
  1020. package/dist/tools/SummarizeLearningsTool.js.map +1 -0
  1021. package/dist/tools/Tool.d.ts +35 -0
  1022. package/dist/tools/Tool.js +38 -0
  1023. package/dist/tools/Tool.js.map +1 -0
  1024. package/dist/tools/TriggerDonobuFlowTool.d.ts +19 -0
  1025. package/dist/tools/TriggerDonobuFlowTool.js +26 -0
  1026. package/dist/tools/TriggerDonobuFlowTool.js.map +1 -0
  1027. package/dist/tools/WaitTool.d.ts +18 -0
  1028. package/dist/tools/WaitTool.js +20 -0
  1029. package/dist/tools/WaitTool.js.map +1 -0
  1030. package/dist/utils/DirectoryUtils.d.ts +11 -0
  1031. package/dist/utils/DirectoryUtils.js +37 -0
  1032. package/dist/utils/DirectoryUtils.js.map +1 -0
  1033. package/dist/utils/JsonUtils.d.ts +19 -0
  1034. package/dist/utils/JsonUtils.js +124 -0
  1035. package/dist/utils/JsonUtils.js.map +1 -0
  1036. package/dist/utils/Logger.d.ts +17 -0
  1037. package/dist/utils/Logger.js +95 -0
  1038. package/dist/utils/Logger.js.map +1 -0
  1039. package/dist/utils/MiscUtils.d.ts +62 -0
  1040. package/dist/utils/MiscUtils.js +164 -0
  1041. package/dist/utils/MiscUtils.js.map +1 -0
  1042. package/dist/utils/PlaywrightUtils.d.ts +180 -0
  1043. package/dist/utils/PlaywrightUtils.js +1086 -0
  1044. package/dist/utils/PlaywrightUtils.js.map +1 -0
  1045. package/dist/utils/VerbConverter.d.ts +14 -0
  1046. package/dist/utils/VerbConverter.js +96 -0
  1047. package/dist/utils/VerbConverter.js.map +1 -0
  1048. package/package.json +83 -0
@@ -0,0 +1,1086 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.PlaywrightUtils = void 0;
7
+ const Logger_1 = require("./Logger");
8
+ const MiscUtils_1 = require("./MiscUtils");
9
+ const path_1 = __importDefault(require("path"));
10
+ const PageClosedException_1 = require("../exceptions/PageClosedException");
11
+ const child_process_1 = require("child_process");
12
+ /**
13
+ * Miscellaneous utility functions for working with the Playwright SDK. If you are looking to
14
+ * instantiate a Playwright instance, see PlaywrightSetup instead.
15
+ */
16
+ class PlaywrightUtils {
17
+ static logger = Logger_1.Logger.appLogger;
18
+ static ACCESSIBILITY_TEST_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('axe.js'));
19
+ static CLICKABLE_ELEMENTS_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('clickable-elements-tracker.js'));
20
+ static DIALOG_PROMPT_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('dialog-prompt-tracker.js'));
21
+ static SMART_SELECTOR_GENERATOR_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('smart-selector-generator.js'));
22
+ static PAGE_INTERACTIONS_TRACKER_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('page-interactions-tracker.js'));
23
+ static DONOBU_CONTROL_PANEL_INIT_SCRIPT = MiscUtils_1.MiscUtils.getResourceFileAsString(path_1.default.join('control-panel.js'));
24
+ // WARNING: If the control panel ID is changed here, you must also change the
25
+ // control-panel.js control panel ID value.
26
+ static DONOBU_CONTROL_PANEL_ELEMENT_ID = 'donobu-control-panel';
27
+ static DONOBU_CONTROL_PANEL_HEADLINE_ELEMENT_ID = 'donobu-control-panel-title-text';
28
+ static DONOBU_INTERACTABLE_ATTRIBUTE = 'data-donobu-interactable';
29
+ static DONOBU_ANNOTATION_ATTRIBUTE = 'data-donobu-annotation';
30
+ /**
31
+ * Attempts to take a screenshot of the given page in PNG format, returning
32
+ * the raw byte array. If the operation fails, an empty array is returned.
33
+ * Note that if the Donobu control panel is present in the page, it will be
34
+ * excluded from the screenshot.
35
+ */
36
+ static async takePngScreenshot(page) {
37
+ try {
38
+ const style = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID} { display: none !important; }`;
39
+ return await page.screenshot({
40
+ style,
41
+ type: 'png',
42
+ });
43
+ }
44
+ catch (error) {
45
+ if (PlaywrightUtils.isPageClosedError(error)) {
46
+ throw new PageClosedException_1.PageClosedException();
47
+ }
48
+ else {
49
+ throw error;
50
+ }
51
+ }
52
+ }
53
+ /**
54
+ * Generate valid selectors for the given element. The generated selectors are
55
+ * in a priority order based on their ability to identify the given element.
56
+ * For example, an unambiguous selector that matches the element exactly are
57
+ * first in the list, and weaker selectors that match multiple elements are
58
+ * last.
59
+ */
60
+ static async generateSelectors(element) {
61
+ return element.evaluate((elem) => {
62
+ return window.donobuGenerateSmartSelectors(elem);
63
+ });
64
+ }
65
+ /**
66
+ * Returns a JavaScript code snippet intended to run as an initialization
67
+ * script for `DonobuFlow` flows. This script helps other scripts to know
68
+ * which elements have mouse-click related event listeners attached to them
69
+ * via inspecting the {@code window.donobuGetClickableElements} element array.
70
+ */
71
+ static clickableElementsTrackerInitScript() {
72
+ return PlaywrightUtils.CLICKABLE_ELEMENTS_TRACKER_INIT_SCRIPT;
73
+ }
74
+ /**
75
+ * Returns a JavaScript code snippet intended to run as an initialization
76
+ * script for `DonobuFlow` flows. This script helps flows handle/track
77
+ * prompts/confirmations. This is done specially since these browser actions
78
+ * pause the Javascript main thread and also cause issues with running various
79
+ * Playwright actions. See `DonobuFlow.onDialog(Dialog)` for details.
80
+ */
81
+ static dialogPromptTrackerInitScript() {
82
+ return PlaywrightUtils.DIALOG_PROMPT_TRACKER_INIT_SCRIPT;
83
+ }
84
+ /**
85
+ * Returns a JavaScript code snippet intended to run as an initialization
86
+ * script for `DonobuFlow` flows. This is an in-page version of the
87
+ * `SelectorGenerator` class so that smart selectors can be generated in
88
+ * the web client. This is done so the
89
+ * {@link PlaywrightUtils.pageInteractionsTrackerInitScript()} can generate
90
+ * smart selectors on the fly and pass them to the `PageInteractionTracker`
91
+ * so the page interactions can be converted to synthetic `ToolCallResult`s.
92
+ */
93
+ static smartSelectorGeneratorInitScript() {
94
+ return PlaywrightUtils.SMART_SELECTOR_GENERATOR_INIT_SCRIPT;
95
+ }
96
+ /**
97
+ * This script is used by the `RunAccessibilityTestTool` to test the
98
+ * accessibility of a webpage. This script is injected on page load, rather
99
+ * than when running the `RunAccessibilityTestTool` because we need to bypass
100
+ * webpage Content Security Policy (CSP); this is done by injecting the
101
+ * script via `BrowserContext#addInitScript`.
102
+ */
103
+ static accessibilityTestInitScript() {
104
+ return PlaywrightUtils.ACCESSIBILITY_TEST_INIT_SCRIPT;
105
+ }
106
+ static pageInteractionsTrackerInitScript() {
107
+ return PlaywrightUtils.PAGE_INTERACTIONS_TRACKER_INIT_SCRIPT;
108
+ }
109
+ static donobuControlPanelInitScript() {
110
+ return PlaywrightUtils.DONOBU_CONTROL_PANEL_INIT_SCRIPT;
111
+ }
112
+ /**
113
+ * Creates a visual sparkle effect at the specified browser-page coordinates,
114
+ * automatically detecting if the point lies inside a same-origin iframe (and nesting deeper
115
+ * if necessary). Injects the sparkle into that frame’s document at the correct local coords.
116
+ *
117
+ * @param page - The Playwright Page object
118
+ * @param x - The x-coordinate in the top-level page coordinate space (relative to the browser window)
119
+ * @param y - The y-coordinate in the top-level page coordinate space
120
+ * @param durationMs - How long the sparkle remains (ms, default 800)
121
+ * @param emoji - The emoji to display (default '✨')
122
+ * @param size - CSS font-size for the emoji (default '40px')
123
+ */
124
+ static async createSparkleEffect(page, x, y, durationMs = 800, emoji = '✨', size = '40px') {
125
+ // 1) Find the deepest same-origin frame covering (x, y), recursing if iframes nest further.
126
+ // Also get the coordinate in that frame’s local coordinate system.
127
+ const { targetFrame, localX, localY } = await this.findDeepestFrameAtPoint(page, x, y);
128
+ // 2) Inject the sparkle container & style in that frame
129
+ await targetFrame.evaluate(({ x, y, emoji, size }) => {
130
+ const containerId = 'playwright-sparkle-shadow-container';
131
+ // Remove old container if needed
132
+ const old = document.getElementById(containerId);
133
+ if (old)
134
+ old.remove();
135
+ const container = document.createElement('div');
136
+ container.id = containerId;
137
+ const shadowRoot = container.attachShadow({ mode: 'open' });
138
+ const sparkle = document.createElement('span');
139
+ sparkle.id = 'playwright-sparkle-element';
140
+ sparkle.textContent = emoji;
141
+ // Position & style
142
+ sparkle.style.position = 'fixed';
143
+ sparkle.style.left = `${x}px`;
144
+ sparkle.style.top = `${y}px`;
145
+ sparkle.style.fontSize = size;
146
+ sparkle.style.transform = 'translate(-50%, -50%)';
147
+ sparkle.style.zIndex = '2147483647'; // Very large to float above most overlays
148
+ sparkle.style.pointerEvents = 'none';
149
+ sparkle.style.userSelect = 'none';
150
+ sparkle.style.filter = 'drop-shadow(0 0 2px rgba(255,255,255,0.7))';
151
+ sparkle.style.animation = 'sparkle-appear 0.3s ease-out forwards';
152
+ const styleEl = document.createElement('style');
153
+ styleEl.textContent = `
154
+ :host {
155
+ all: initial;
156
+ }
157
+ @keyframes sparkle-appear {
158
+ 0% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
159
+ 50% { opacity: 1; transform: translate(-50%, -50%) scale(1.2); }
160
+ 100% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
161
+ }
162
+ @keyframes sparkle-disappear {
163
+ 0% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
164
+ 100% { opacity: 0; transform: translate(-50%, -50%) scale(0.5); }
165
+ }
166
+ `;
167
+ shadowRoot.appendChild(styleEl);
168
+ shadowRoot.appendChild(sparkle);
169
+ document.body.appendChild(container);
170
+ console.log(`Sparkle created at ${x}, ${y} with emoji "${emoji}"`);
171
+ }, { x: localX, y: localY, emoji, size });
172
+ // 3) Wait the duration
173
+ await page.waitForTimeout(durationMs);
174
+ // 4) Fade out and remove
175
+ await targetFrame.evaluate(() => {
176
+ const container = document.getElementById('playwright-sparkle-shadow-container');
177
+ if (container && container.shadowRoot) {
178
+ const sparkle = container.shadowRoot.getElementById('playwright-sparkle-element');
179
+ if (sparkle) {
180
+ sparkle.style.animation = 'sparkle-disappear 0.3s ease-in forwards';
181
+ }
182
+ setTimeout(() => {
183
+ container.remove();
184
+ console.log('Sparkle effect removed');
185
+ }, 300);
186
+ }
187
+ });
188
+ // 5) Wait for removal
189
+ await page.waitForTimeout(300);
190
+ }
191
+ /**
192
+ * Recursively finds the deepest same-origin Frame that covers the point (top-level coordinates).
193
+ * Returns the Frame plus the local coordinates (relative to that frame's viewport).
194
+ *
195
+ * If no same-origin child frame covers (x, y), it returns the main frame and the original coords.
196
+ */
197
+ static async findDeepestFrameAtPoint(page, x, y, frame = page.mainFrame()) {
198
+ // We'll attempt to see if any child <iframe> in this frame covers the coordinate
199
+ // Steps:
200
+ // (1) Convert the top-level coordinate (x, y) into this frame's local coordinate system.
201
+ // (2) If outside the frame's bounding client rect (in its parent), skip further checks.
202
+ // (3) Check each child <iframe> inside this frame's DOM. If the point is inside that <iframe>,
203
+ // convert to the child frame's coords and recurse. If the child frame is cross-origin,
204
+ // skip it.
205
+ //
206
+ // If none of the children contain the point, we are the "deepest" frame for that point.
207
+ // If we're the mainFrame, there's no parent boundingRect. So we start with (x, y) as is.
208
+ let localX = x;
209
+ let localY = y;
210
+ // If there's a parent frame, we need to see where the <iframe> itself is in parent's coords
211
+ // But we only do that if frame is NOT the main frame
212
+ const parentFrame = frame.parentFrame();
213
+ if (parentFrame) {
214
+ // Evaluate bounding rect of the <iframe> that hosts this child frame
215
+ // We'll do a small trick: find the <iframe> element in the parent that has frame.url()
216
+ // or frame.name(). There's no direct method, so we rely on the frame element handle:
217
+ const frameElement = await frame.frameElement();
218
+ const box = await frameElement.boundingBox();
219
+ if (!box) {
220
+ // If we can't get bounding box, fallback
221
+ return { targetFrame: page.mainFrame(), localX: x, localY: y };
222
+ }
223
+ // The bounding box's coords are relative to the parent's main page.
224
+ // Convert our (x, y) from the parent's coordinate system to this child's local system.
225
+ if (x < box.x ||
226
+ y < box.y ||
227
+ x > box.x + box.width ||
228
+ y > box.y + box.height) {
229
+ // The point is not inside this child frame's bounding box at all
230
+ // so it's not relevant. We'll skip it. The caller will continue searching siblings.
231
+ return { targetFrame: page.mainFrame(), localX: x, localY: y };
232
+ }
233
+ // So we are inside this child frame. Convert (x, y) to local coords
234
+ localX = x - box.x; // offset from left
235
+ localY = y - box.y; // offset from top
236
+ // Now we must also account for the child frame's own scrolling. Evaluate in the child:
237
+ const scrollOffsets = await frame.evaluate(() => {
238
+ return { sx: window.scrollX, sy: window.scrollY };
239
+ });
240
+ localX += scrollOffsets.sx;
241
+ localY += scrollOffsets.sy;
242
+ }
243
+ // Next, see if there's a deeper child frame (iframe) in this frame that covers (localX, localY)
244
+ const childFrames = frame.childFrames();
245
+ for (const child of childFrames) {
246
+ // We'll see if child is same-origin by trying a small evaluate
247
+ // If it's cross-origin, we'll catch the error & skip
248
+ try {
249
+ // Convert localX/Y into child's bounding box
250
+ const childElement = await child.frameElement();
251
+ const childBox = await childElement.boundingBox();
252
+ if (!childBox) {
253
+ continue;
254
+ }
255
+ // Check if local point is inside child's bounding box
256
+ if (localX >= childBox.x &&
257
+ localY >= childBox.y &&
258
+ localX <= childBox.x + childBox.width &&
259
+ localY <= childBox.y + childBox.height) {
260
+ // Convert to child's local coords
261
+ let childLocalX = localX - childBox.x;
262
+ let childLocalY = localY - childBox.y;
263
+ // Add child's scroll offset
264
+ const childScroll = await child.evaluate(() => {
265
+ return { sx: window.scrollX, sy: window.scrollY };
266
+ });
267
+ childLocalX += childScroll.sx;
268
+ childLocalY += childScroll.sy;
269
+ // Recurse deeper
270
+ return await this.findDeepestFrameAtPoint(page, childLocalX, childLocalY, child);
271
+ }
272
+ }
273
+ catch {
274
+ // Probably cross-origin or some other error, skip
275
+ }
276
+ }
277
+ // If we get here, none of the children contain the point (or are cross-origin),
278
+ // so this frame is the deepest coverage.
279
+ return { targetFrame: frame, localX, localY };
280
+ }
281
+ static async getLocatorOrItsLabel(element) {
282
+ const timeoutMilliseconds = 5000;
283
+ try {
284
+ const id = await element.getAttribute('id', {
285
+ timeout: timeoutMilliseconds,
286
+ });
287
+ if (id) {
288
+ // Get the underlying ElementHandle first
289
+ const handle = await element.elementHandle({
290
+ timeout: timeoutMilliseconds / 5,
291
+ });
292
+ if (handle) {
293
+ // From the handle, retrieve the frame that owns this element
294
+ const frame = await handle.ownerFrame();
295
+ if (frame) {
296
+ // Look for label with matching 'for' attribute
297
+ const labelByFor = frame.locator(`label[for="${id}"]`);
298
+ if ((await labelByFor.count()) > 0) {
299
+ await labelByFor.waitFor({
300
+ state: 'visible',
301
+ timeout: timeoutMilliseconds / 5,
302
+ });
303
+ return labelByFor;
304
+ }
305
+ }
306
+ }
307
+ }
308
+ // Fallback: look for a wrapping label
309
+ const wrappingLabel = element.locator('xpath=ancestor::label');
310
+ if ((await wrappingLabel.count()) > 0) {
311
+ await wrappingLabel.waitFor({
312
+ state: 'visible',
313
+ timeout: timeoutMilliseconds / 5,
314
+ });
315
+ return wrappingLabel;
316
+ }
317
+ // Neither "for" nor wrapping label found
318
+ return element;
319
+ }
320
+ catch (error) {
321
+ if (PlaywrightUtils.isPageClosedError(error)) {
322
+ throw new PageClosedException_1.PageClosedException();
323
+ }
324
+ throw error;
325
+ }
326
+ }
327
+ /**
328
+ * Reads and clears the desired next state as directed by the in-flow control
329
+ * panel. Note that the control panel does not have carte blanche control, as
330
+ * we only support the control panel signaling an intent to pause and resume a
331
+ * flow.
332
+ */
333
+ static async popControlPanelNextDesiredState(page) {
334
+ try {
335
+ const desiredNextState = await page.evaluate(() => {
336
+ const tmpState = window.donobuNextState;
337
+ window.donobuNextState = null;
338
+ return tmpState;
339
+ });
340
+ if (desiredNextState) {
341
+ return desiredNextState;
342
+ }
343
+ }
344
+ catch (error) {
345
+ if (PlaywrightUtils.isPageClosedError(error)) {
346
+ throw new PageClosedException_1.PageClosedException();
347
+ }
348
+ else {
349
+ throw error;
350
+ }
351
+ }
352
+ return null;
353
+ }
354
+ /**
355
+ * Hides the control panel by setting its display to 'none'. This ensures the
356
+ * panel is not visible and does not intercept mouse events.
357
+ */
358
+ static async hideControlPanel(focusedPage, flowMetadata) {
359
+ if (!flowMetadata.isControlPanelEnabled) {
360
+ return;
361
+ }
362
+ for (const page of focusedPage.context().pages()) {
363
+ try {
364
+ await page.evaluate((panelId) => {
365
+ const element = document.querySelector(`#${panelId}`);
366
+ if (element) {
367
+ element.style.display = 'none';
368
+ }
369
+ }, PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID);
370
+ }
371
+ catch (error) {
372
+ if (PlaywrightUtils.isPageClosedError(error)) {
373
+ // Pass; this can happen normally.
374
+ }
375
+ else {
376
+ PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
377
+ }
378
+ }
379
+ }
380
+ }
381
+ /**
382
+ * Shows the control panel by resetting its display property. Assumes the
383
+ * original display was 'block'.
384
+ */
385
+ static async showControlPanel(focusedPage, flowMetadata) {
386
+ if (!flowMetadata.isControlPanelEnabled) {
387
+ return;
388
+ }
389
+ for (const page of focusedPage.context().pages()) {
390
+ try {
391
+ await page.evaluate((panelId) => {
392
+ const element = document.querySelector(`#${panelId}`);
393
+ if (element) {
394
+ element.style.display = 'block';
395
+ }
396
+ }, PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID);
397
+ }
398
+ catch (error) {
399
+ if (PlaywrightUtils.isPageClosedError(error)) {
400
+ // Pass; this can happen normally.
401
+ }
402
+ else {
403
+ PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
404
+ }
405
+ }
406
+ }
407
+ }
408
+ /**
409
+ * Updates all control panels in the given browser context. If the provided
410
+ * headline is non-null, the headline in the control panel will be updated.
411
+ */
412
+ static async updateControlPanel(focusedPage, flowMetadata, headline) {
413
+ const controlPanelQuerySelector = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_ELEMENT_ID}`;
414
+ const controlPanelHeadlineQuerySelector = `#${PlaywrightUtils.DONOBU_CONTROL_PANEL_HEADLINE_ELEMENT_ID}`;
415
+ for (const page of focusedPage.context().pages()) {
416
+ try {
417
+ const controlPanel = await page.$(controlPanelQuerySelector);
418
+ if (controlPanel) {
419
+ await controlPanel.evaluate((element, state) => {
420
+ element.donobuFlowState = state;
421
+ }, flowMetadata.state.toString());
422
+ }
423
+ }
424
+ catch (error) {
425
+ if (PlaywrightUtils.isPageClosedError(error)) {
426
+ // Pass; this can happen normally.
427
+ }
428
+ else {
429
+ PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
430
+ }
431
+ }
432
+ }
433
+ if (headline) {
434
+ for (const page of focusedPage.context().pages()) {
435
+ try {
436
+ const controlPanel = await page.$(controlPanelHeadlineQuerySelector);
437
+ if (controlPanel) {
438
+ const escapedMessage = headline.replace(/[\\"']/g, '\\$&');
439
+ await controlPanel.evaluate((element, message) => {
440
+ element.innerText = message;
441
+ element.dataset.text = message;
442
+ }, escapedMessage);
443
+ }
444
+ }
445
+ catch (error) {
446
+ if (PlaywrightUtils.isPageClosedError(error)) {
447
+ // Pass; this can happen normally.
448
+ }
449
+ else {
450
+ PlaywrightUtils.logger.error(`Unexpected exception while attempting to show control panel for flow '${flowMetadata.id}'`, error);
451
+ }
452
+ }
453
+ }
454
+ }
455
+ }
456
+ /**
457
+ * Returns all elements that have the
458
+ * {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML attribute.
459
+ **/
460
+ static async getAttributedInteractableElements(page) {
461
+ try {
462
+ const interactableElements = [];
463
+ const frames = page
464
+ .frames()
465
+ .filter((frame) => PlaywrightUtils.frameFilter(frame));
466
+ for (const frame of frames) {
467
+ const attributeMap = await frame.evaluate((interactableAttribute) => {
468
+ const getOuterHTMLWithoutChildrenExceptForSelectElements = (element) => {
469
+ if (element.tagName.toLowerCase() === 'select') {
470
+ return element.outerHTML;
471
+ }
472
+ else {
473
+ const tempElement = document.createElement('div');
474
+ tempElement.appendChild(element.cloneNode(false));
475
+ return tempElement.innerHTML;
476
+ }
477
+ };
478
+ const attributeToHtmlMap = {};
479
+ const elements = document.querySelectorAll(`[${interactableAttribute}]`);
480
+ elements.forEach((element) => {
481
+ const attributeValue = element.getAttribute(interactableAttribute);
482
+ const outerHtml = getOuterHTMLWithoutChildrenExceptForSelectElements(element);
483
+ if (attributeValue) {
484
+ attributeToHtmlMap[attributeValue] = outerHtml;
485
+ }
486
+ });
487
+ return attributeToHtmlMap;
488
+ }, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE);
489
+ Object.entries(attributeMap).forEach(([donobuAttributeValue, htmlSnippet]) => {
490
+ interactableElements.push({
491
+ donobuAttributeValue,
492
+ htmlSnippet,
493
+ });
494
+ });
495
+ }
496
+ return interactableElements;
497
+ }
498
+ catch (error) {
499
+ if (PlaywrightUtils.isPageClosedError(error)) {
500
+ throw new PageClosedException_1.PageClosedException();
501
+ }
502
+ else {
503
+ throw error;
504
+ }
505
+ }
506
+ }
507
+ /**
508
+ * Assigns a globally unique {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE}
509
+ * attribute value to each visible, interactable, element in the given page.
510
+ * Any pre-existing {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE}
511
+ * attributes will be removed.
512
+ */
513
+ static async attributeInteractableElements(page) {
514
+ try {
515
+ // Remove any preexisting attributes
516
+ await this.deattributeVisibleInteractableElements(page);
517
+ // Get the main page's viewport and scroll offsets
518
+ const [viewWidth, viewHeight, viewX, viewY] = await page.evaluate(() => {
519
+ return [
520
+ window.innerWidth,
521
+ window.innerHeight,
522
+ Math.round(window.scrollX),
523
+ Math.round(window.scrollY),
524
+ ];
525
+ });
526
+ // 1) Attribute elements in the main page
527
+ let annotationOffset = await page.evaluate(this.attributeElementsInContext, [0, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE]);
528
+ // 2) Check child frames, attributing elements if the frame is (partially) in view
529
+ const frames = page
530
+ .frames()
531
+ .filter((frame) => PlaywrightUtils.frameFilter(frame) && frame !== page.mainFrame());
532
+ for (const frame of frames) {
533
+ const elementHandle = await frame.frameElement();
534
+ if (!elementHandle) {
535
+ continue;
536
+ }
537
+ const boundingBox = await elementHandle.boundingBox();
538
+ if (!boundingBox) {
539
+ continue;
540
+ }
541
+ const { x: frameX, y: frameY, width: frameWidth, height: frameHeight, } = boundingBox;
542
+ // Check if the frame is visible in the main viewport
543
+ const intersectsViewport = frameX < viewX + viewWidth &&
544
+ frameX + frameWidth > viewX &&
545
+ frameY < viewY + viewHeight &&
546
+ frameY + frameHeight > viewY;
547
+ if (intersectsViewport) {
548
+ // Update annotation offset from this frame's results
549
+ annotationOffset = await frame.evaluate(this.attributeElementsInContext, [
550
+ annotationOffset,
551
+ PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE,
552
+ ]);
553
+ }
554
+ }
555
+ }
556
+ catch (error) {
557
+ if (PlaywrightUtils.isPageClosedError(error)) {
558
+ throw new PageClosedException_1.PageClosedException();
559
+ }
560
+ else {
561
+ throw error;
562
+ }
563
+ }
564
+ }
565
+ /**
566
+ * Annotate all elements in the given page that have a
567
+ * {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML attribute.
568
+ *
569
+ * The annotations are placed in a shadow root to avoid site-specific CSS,
570
+ * each having a {@link PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE} attribute.
571
+ */
572
+ static async annotateInteractableElements(page) {
573
+ try {
574
+ // Filter frames as needed
575
+ const frames = page
576
+ .frames()
577
+ .filter((frame) => PlaywrightUtils.frameFilter(frame));
578
+ for (const frame of frames) {
579
+ await frame.evaluate(([interactableAttr, annotationAttr]) => {
580
+ // 1) Ensure we have a shadow container in the main document
581
+ let container = document.getElementById('annotation-shadow-container');
582
+ if (!container) {
583
+ container = document.createElement('div');
584
+ container.id = 'annotation-shadow-container';
585
+ // Position container so child elements can be absolutely placed
586
+ Object.assign(container.style, {
587
+ position: 'absolute',
588
+ top: '0',
589
+ left: '0',
590
+ width: '100%',
591
+ height: '100%',
592
+ pointerEvents: 'none', // Let clicks pass through
593
+ });
594
+ // Check if document.body exists before trying to append.
595
+ if (document.body) {
596
+ document.body.appendChild(container);
597
+ }
598
+ else if (document.documentElement) {
599
+ // Fall back to document.documentElement if body does not exist.
600
+ document.documentElement.appendChild(container);
601
+ }
602
+ else {
603
+ // If neither exists, we can't proceed with annotations in this frame.
604
+ console.warn(`Cannot create annotation container for ${window.location.href} since the document structure is incomplete`);
605
+ return;
606
+ }
607
+ // Attach a shadow root
608
+ const shadowRoot = container.attachShadow({ mode: 'open' });
609
+ // Add a <style> element inside the shadow root to reset and define annotation styles
610
+ const style = document.createElement('style');
611
+ style.textContent = `
612
+ :host {
613
+ all: initial; /* Reset styles in shadow root */
614
+ }
615
+ .annotation {
616
+ position: absolute;
617
+ z-index: 2147483647;
618
+ background-color: black;
619
+ color: white;
620
+ width: 40px;
621
+ height: 40px;
622
+ border-radius: 50%;
623
+ display: flex;
624
+ align-items: center;
625
+ justify-content: center;
626
+ font-size: 14px;
627
+ font-weight: bold;
628
+ line-height: 20px;
629
+ text-align: center;
630
+ box-shadow: 0px 2px 4px rgba(0,0,0,0.2);
631
+ border: 4px solid #FF4136;
632
+ pointer-events: none;
633
+ }
634
+ `;
635
+ shadowRoot.appendChild(style);
636
+ }
637
+ // Retrieve the shadow root to place annotation elements
638
+ const containerEl = document.getElementById('annotation-shadow-container');
639
+ if (!containerEl?.shadowRoot) {
640
+ return;
641
+ }
642
+ const shadowRoot = containerEl.shadowRoot;
643
+ // 2) Factory to create a new annotation inside the shadow root
644
+ const createAnnotation = (value) => {
645
+ const annotation = document.createElement('div');
646
+ annotation.classList.add('annotation');
647
+ annotation.dataset[annotationAttr] = '1';
648
+ annotation.textContent = value;
649
+ return annotation;
650
+ };
651
+ // 3) Position annotation relative to an element
652
+ const positionAnnotation = (annotation, element) => {
653
+ const rect = element.getBoundingClientRect();
654
+ // Center the annotation on the element, adjusting for its size
655
+ const x = rect.left + rect.width / 2 - 20 + window.scrollX;
656
+ const y = rect.top + rect.height / 2 - 20 + window.scrollY;
657
+ annotation.style.left = `${x}px`;
658
+ annotation.style.top = `${y}px`;
659
+ };
660
+ // 4) Traverse DOM (including any nested shadow roots) to find interactable elements
661
+ const processNode = (root) => {
662
+ // Find elements with the interactable attribute
663
+ const elements = root.querySelectorAll(`[${interactableAttr}]`);
664
+ elements.forEach((element) => {
665
+ const value = element.getAttribute(interactableAttr);
666
+ if (value) {
667
+ const annotation = createAnnotation(value);
668
+ shadowRoot.appendChild(annotation);
669
+ positionAnnotation(annotation, element);
670
+ }
671
+ });
672
+ // Recursively process any child shadow roots
673
+ root.querySelectorAll('*').forEach((el) => {
674
+ if (el.shadowRoot) {
675
+ processNode(el.shadowRoot);
676
+ }
677
+ });
678
+ };
679
+ // Start processing from the (frame) document root
680
+ processNode(document);
681
+ }, [
682
+ PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE,
683
+ PlaywrightUtils.convertToJsAttribute(PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE),
684
+ ]);
685
+ }
686
+ }
687
+ catch (error) {
688
+ if (PlaywrightUtils.isPageClosedError(error)) {
689
+ throw new PageClosedException_1.PageClosedException();
690
+ }
691
+ else {
692
+ throw error;
693
+ }
694
+ }
695
+ }
696
+ /**
697
+ * Removes all annotations with a {@link PlaywrightUtils.DONOBU_ANNOTATION_ATTRIBUTE}
698
+ * HTML attribute in the given page, including any containers in shadow DOM.
699
+ */
700
+ static async removeDonobuAnnotations(page) {
701
+ try {
702
+ const frames = page
703
+ .frames()
704
+ .filter((frame) => PlaywrightUtils.frameFilter(frame));
705
+ for (const frame of frames) {
706
+ await frame.evaluate(() => {
707
+ const containerId = 'annotation-shadow-container';
708
+ const container = document.getElementById(containerId);
709
+ if (container) {
710
+ container.remove();
711
+ }
712
+ });
713
+ }
714
+ }
715
+ catch (error) {
716
+ if (PlaywrightUtils.isPageClosedError(error)) {
717
+ throw new PageClosedException_1.PageClosedException();
718
+ }
719
+ throw error;
720
+ }
721
+ }
722
+ /**
723
+ * Removes the {@link PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE} HTML
724
+ * attribute for all elements in the given page. This attribute is normally
725
+ * added by the {@link PlaywrightUtils.attributeInteractableElements(Page)}
726
+ * function.
727
+ */
728
+ static async deattributeVisibleInteractableElements(page) {
729
+ try {
730
+ const frames = page
731
+ .frames()
732
+ .filter((frame) => PlaywrightUtils.frameFilter(frame));
733
+ for (const frame of frames) {
734
+ await frame.evaluate((attr) => {
735
+ document.querySelectorAll(`[${attr}]`).forEach((element) => {
736
+ element.removeAttribute(attr);
737
+ });
738
+ }, PlaywrightUtils.DONOBU_INTERACTABLE_ATTRIBUTE);
739
+ }
740
+ }
741
+ catch (error) {
742
+ if (PlaywrightUtils.isPageClosedError(error)) {
743
+ throw new PageClosedException_1.PageClosedException();
744
+ }
745
+ else {
746
+ throw error;
747
+ }
748
+ }
749
+ }
750
+ static async parseUnambiguousSelector(elementHandle) {
751
+ try {
752
+ return await elementHandle.evaluate((element) => {
753
+ const escapeCssIdentifier = (ident) => {
754
+ return ident.replace(/([!"#$%&'()*+,./:;<=>?@[\\]^{|}~])/g, '\\$1');
755
+ };
756
+ const getPath = (el) => {
757
+ if (el.id)
758
+ return '#' + escapeCssIdentifier(el.id);
759
+ if (!el.parentNode || el.parentNode.nodeType === Node.DOCUMENT_NODE)
760
+ return '';
761
+ const siblings = Array.from(el.parentNode.children).filter((e) => e.tagName === el.tagName);
762
+ const index = siblings.indexOf(el) + 1;
763
+ const tag = el.tagName.toLowerCase();
764
+ const parentPath = getPath(el.parentNode);
765
+ return (parentPath +
766
+ (parentPath ? ' > ' : '') +
767
+ tag +
768
+ (siblings.length > 1 ? ':nth-child(' + index + ')' : ''));
769
+ };
770
+ return getPath(element);
771
+ });
772
+ }
773
+ catch (error) {
774
+ if (PlaywrightUtils.isPageClosedError(error)) {
775
+ throw new PageClosedException_1.PageClosedException();
776
+ }
777
+ else {
778
+ throw error;
779
+ }
780
+ }
781
+ }
782
+ /**
783
+ * Converts an HTML attribute to a JavaScript attribute. For example,
784
+ * "data-foo-bar" is turned into "fooBar". Notice the dropping of the "data-"
785
+ * prefix, and the conversion from kebab-case to camelCase.
786
+ */
787
+ static convertToJsAttribute(htmlAttribute) {
788
+ if (htmlAttribute.startsWith('data-')) {
789
+ htmlAttribute = htmlAttribute.substring(5);
790
+ }
791
+ const parts = htmlAttribute.split('-');
792
+ const jsAttribute = parts[0] +
793
+ parts
794
+ .slice(1)
795
+ .map((part) => part.charAt(0).toUpperCase() + part.slice(1).toLowerCase())
796
+ .join('');
797
+ return jsAttribute;
798
+ }
799
+ /**
800
+ * Returned true IFF the given error is a Playwright error regarding page closing,
801
+ * of if the given error is an instance of {@link PageClosedException}.
802
+ */
803
+ static isPageClosedError(error) {
804
+ if (error instanceof PageClosedException_1.PageClosedException) {
805
+ return true;
806
+ }
807
+ else {
808
+ const exceptionMessage = error?.message?.toLowerCase();
809
+ if (!exceptionMessage) {
810
+ return false;
811
+ }
812
+ else {
813
+ return (exceptionMessage.includes('detached') ||
814
+ exceptionMessage.includes('context was destroyed') ||
815
+ exceptionMessage.includes('browser has been closed'));
816
+ }
817
+ }
818
+ }
819
+ static async ensurePlaywrightInstallation() {
820
+ return PlaywrightUtils.runPlaywrightCli(['install', '--with-deps']);
821
+ }
822
+ static async runPlaywrightCli(args) {
823
+ try {
824
+ // First, resolve the package root
825
+ const packagePath = require.resolve('playwright-core/package.json');
826
+ // Then construct the path to cli.js
827
+ const cliPath = path_1.default.join(path_1.default.dirname(packagePath), 'cli.js');
828
+ PlaywrightUtils.logger.debug(`Found Playwright CLI at: ${cliPath}`);
829
+ PlaywrightUtils.logger.info(`Running Playwright CLI with args: ${args.join(' ')}`);
830
+ const env = {
831
+ ...process.env,
832
+ PLAYWRIGHT_BROWSERS_PATH: path_1.default.join(MiscUtils_1.MiscUtils.baseWorkingDirectory(), '.playwright'),
833
+ PLAYWRIGHT_SKIP_VALIDATE_HOST_REQUIREMENTS: '1',
834
+ PLAYWRIGHT_SKIP_BROWSER_GC: '1',
835
+ PLAYWRIGHT_SKIP_BROWSER_VALIDATION: '1',
836
+ FORCE_COLOR: '0',
837
+ NODE_NO_WARNINGS: '1',
838
+ ELECTRON_RUN_AS_NODE: '1',
839
+ };
840
+ const childProcess = (0, child_process_1.spawn)(process.execPath, [cliPath, ...args], {
841
+ stdio: 'inherit',
842
+ env: env,
843
+ windowsHide: true,
844
+ });
845
+ return new Promise((resolve, reject) => {
846
+ childProcess.on('exit', (code) => {
847
+ if (code === 0) {
848
+ PlaywrightUtils.logger.debug('Playwright CLI completed successfully');
849
+ resolve();
850
+ }
851
+ else {
852
+ reject(new Error(`Playwright CLI failed with code ${code}`));
853
+ }
854
+ });
855
+ childProcess.on('error', (error) => {
856
+ reject(new Error(`Failed to execute Playwright CLI: ${error.message}`));
857
+ });
858
+ });
859
+ }
860
+ catch (error) {
861
+ throw new Error(`Failed to initialize Playwright CLI: ${error instanceof Error ? error.message : String(error)}`);
862
+ }
863
+ }
864
+ /**
865
+ * Attempts to wait until the currently focused page is stable. If the page
866
+ * never stabilizes, it just returns after timing out. If any error occurs,
867
+ * it is logged and ignored. If page is null, this function has no effect.
868
+ */
869
+ static async waitForPageStability(page) {
870
+ const waitTimeMilliseconds = 5000;
871
+ const minimumWaitTimeMilliseconds = 1000;
872
+ if (page) {
873
+ try {
874
+ await Promise.all([
875
+ page.waitForLoadState('load', {
876
+ timeout: waitTimeMilliseconds,
877
+ }),
878
+ page.waitForTimeout(minimumWaitTimeMilliseconds),
879
+ ]);
880
+ }
881
+ catch (error) {
882
+ if (!PlaywrightUtils.isPageClosedError(error)) {
883
+ // Pass, just move on and hope for the best, we waited long enough.
884
+ PlaywrightUtils.logger.error(`Error while waiting for page to reach steady state for page ${page.url}`, error);
885
+ }
886
+ }
887
+ }
888
+ }
889
+ static frameFilter(frame) {
890
+ return (!frame.isDetached() &&
891
+ !frame.url().startsWith('about:') &&
892
+ !frame.url().startsWith('chrome:') &&
893
+ !frame.url().startsWith('edge:'));
894
+ }
895
+ /**
896
+ * This function is injected into the page (or frame) context. It finds
897
+ * "interactable" elements, checks visibility, and sets a unique attribute.
898
+ * It returns the updated offset after labeling.
899
+ */
900
+ static attributeElementsInContext(arg) {
901
+ let offset = arg[0];
902
+ const interactableAttribute = arg[1];
903
+ // --- Utility Functions ---
904
+ function isElementVisible(rect, style) {
905
+ return (rect.width > 0 &&
906
+ rect.height > 0 &&
907
+ style.display !== 'none' &&
908
+ style.visibility !== 'hidden');
909
+ }
910
+ function isElementMoreThanHalfInViewport(rect) {
911
+ const viewportWidth = window.innerWidth || document.documentElement.clientWidth;
912
+ const viewportHeight = window.innerHeight || document.documentElement.clientHeight;
913
+ const visibleWidth = Math.min(rect.right, viewportWidth) - Math.max(rect.left, 0);
914
+ const visibleHeight = Math.min(rect.bottom, viewportHeight) - Math.max(rect.top, 0);
915
+ const visibleArea = Math.max(0, visibleWidth) * Math.max(0, visibleHeight);
916
+ const elementArea = rect.width * rect.height;
917
+ return visibleArea >= elementArea / 2;
918
+ }
919
+ function isElementEnabled(element, style) {
920
+ // Check standard disabled attribute (for form controls like button, input, etc.)
921
+ if (element.hasAttribute('disabled')) {
922
+ return false;
923
+ }
924
+ // Check for ARIA attributes that indicate non-interactivity
925
+ if (element.getAttribute('aria-disabled') === 'true' ||
926
+ element.getAttribute('aria-hidden') === 'true') {
927
+ return false;
928
+ }
929
+ // Check for pointer-events: none which prevents interactions
930
+ if (style.pointerEvents === 'none') {
931
+ return false;
932
+ }
933
+ // Check for ARIA attributes indicating disabled state
934
+ if (element.getAttribute('aria-disabled') === 'true') {
935
+ return false;
936
+ }
937
+ // Check for inert attribute which makes elements non-interactive
938
+ if (element.hasAttribute('inert')) {
939
+ return false;
940
+ }
941
+ // If the element is in a form and the fieldset is disabled, it might be disabled as well
942
+ let parent = element.parentElement;
943
+ while (parent) {
944
+ if (parent.tagName.toLowerCase() === 'fieldset' &&
945
+ parent.hasAttribute('disabled') &&
946
+ element.tagName.toLowerCase() !== 'legend') {
947
+ return false;
948
+ }
949
+ parent = parent.parentElement;
950
+ }
951
+ return true;
952
+ }
953
+ /**
954
+ * Generate a few test points on the element's bounding box. We only need
955
+ * a small offset (1px) from each corner, plus the center.
956
+ */
957
+ function getPointsToCheck(rect) {
958
+ const cornerOffset = 1;
959
+ return [
960
+ { x: rect.left + cornerOffset, y: rect.top + cornerOffset },
961
+ { x: rect.right - cornerOffset, y: rect.top + cornerOffset },
962
+ { x: rect.left + cornerOffset, y: rect.bottom - cornerOffset },
963
+ { x: rect.right - cornerOffset, y: rect.bottom - cornerOffset },
964
+ { x: rect.left + rect.width / 2, y: rect.top + rect.height / 2 },
965
+ ];
966
+ }
967
+ /**
968
+ * Like `elementFromPoint` but continues walking shadow roots if found.
969
+ */
970
+ function getDeepElementFromPoint(x, y) {
971
+ let el = document.elementFromPoint(x, y);
972
+ while (el && el.shadowRoot) {
973
+ const shadowEl = el.shadowRoot.elementFromPoint(x, y);
974
+ if (!shadowEl || shadowEl === el)
975
+ break;
976
+ el = shadowEl;
977
+ }
978
+ return el;
979
+ }
980
+ function getAllInteractableElements(root) {
981
+ const selector = [
982
+ // Basic interactive elements
983
+ 'button',
984
+ 'button svg',
985
+ 'input',
986
+ 'textarea',
987
+ 'a',
988
+ 'select',
989
+ // Common ARIA roles
990
+ '[role="button"]',
991
+ '[role="option"]',
992
+ '[role="link"]',
993
+ '[role="checkbox"]',
994
+ '[role="radio"]',
995
+ '[role="tab"]',
996
+ '[role="menuitem"]',
997
+ '[role="menuitemcheckbox"]',
998
+ '[role="menuitemradio"]',
999
+ '[role="combobox"]',
1000
+ '[role="listbox"]',
1001
+ '[role="searchbox"]',
1002
+ '[role="spinbutton"]',
1003
+ '[role="slider"]',
1004
+ '[role="switch"]',
1005
+ // Elements with popup behavior
1006
+ '[aria-haspopup]',
1007
+ '[aria-controls]',
1008
+ // Editable elements
1009
+ '[contenteditable="true"]',
1010
+ // Draggable elements
1011
+ '[draggable="true"]',
1012
+ // Elements that can receive focus
1013
+ '[tabindex]:not([tabindex="-1"])',
1014
+ ].join(', ');
1015
+ let elements = Array.from(root.querySelectorAll(selector));
1016
+ // Dive into shadow roots
1017
+ root.querySelectorAll('*').forEach((el) => {
1018
+ if (el.shadowRoot) {
1019
+ // Recurse
1020
+ elements = elements.concat(getAllInteractableElements(el.shadowRoot));
1021
+ }
1022
+ });
1023
+ // Remove duplicates
1024
+ return Array.from(new Set(elements));
1025
+ }
1026
+ // 1) Gather candidate elements (including any custom "clickable" from donobuGetClickableElements)
1027
+ let interactableElements = getAllInteractableElements(document);
1028
+ if (window.donobuGetClickableElements) {
1029
+ interactableElements = interactableElements.concat(window
1030
+ .donobuGetClickableElements()
1031
+ // Exclude elements with a "donobu-" prefixed ID.
1032
+ .filter((el) => !el.id || !el.id.startsWith('donobu-')));
1033
+ }
1034
+ // Use a Set to avoid duplicates
1035
+ const uniqueElements = new Set(interactableElements);
1036
+ // 2) Check each element for visibility + actual "interactability"
1037
+ uniqueElements.forEach((element) => {
1038
+ if (typeof element.getBoundingClientRect !== 'function') {
1039
+ // Should be rare, but just in case
1040
+ return;
1041
+ }
1042
+ const rect = element.getBoundingClientRect();
1043
+ const style = window.getComputedStyle(element);
1044
+ const visible = isElementVisible(rect, style) && isElementMoreThanHalfInViewport(rect);
1045
+ // Check if the element is actually enabled/interactive
1046
+ const enabled = isElementEnabled(element, style);
1047
+ if (!visible || !enabled) {
1048
+ return;
1049
+ }
1050
+ let annotated = false;
1051
+ // 3) Test small set of points on the element to confirm it's truly topmost
1052
+ for (const pt of getPointsToCheck(rect)) {
1053
+ let elToCheck = getDeepElementFromPoint(pt.x, pt.y);
1054
+ // Walk up the DOM tree from that point
1055
+ while (elToCheck) {
1056
+ if (elToCheck === element) {
1057
+ // Found the actual element
1058
+ element.setAttribute(interactableAttribute, offset.toString());
1059
+ offset++;
1060
+ annotated = true;
1061
+ break;
1062
+ }
1063
+ else if (elToCheck.tagName?.toLowerCase() === 'label' &&
1064
+ elToCheck.htmlFor) {
1065
+ // If we found a label referencing an element, also mark that
1066
+ const forId = elToCheck.htmlFor;
1067
+ const associatedInput = document.getElementById(forId);
1068
+ if (associatedInput) {
1069
+ associatedInput.setAttribute(interactableAttribute, offset.toString());
1070
+ offset++;
1071
+ }
1072
+ annotated = true;
1073
+ break;
1074
+ }
1075
+ elToCheck = elToCheck.parentElement;
1076
+ }
1077
+ if (annotated) {
1078
+ break;
1079
+ }
1080
+ }
1081
+ });
1082
+ return offset;
1083
+ }
1084
+ }
1085
+ exports.PlaywrightUtils = PlaywrightUtils;
1086
+ //# sourceMappingURL=PlaywrightUtils.js.map