@taodigital/crawler 0.0.0-stage → 1.2.1

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 (494) hide show
  1. package/Dockerfile +82 -0
  2. package/README.md +10 -2
  3. package/dist/accessibility-auditor.d.ts +29 -0
  4. package/dist/accessibility-auditor.js +57 -0
  5. package/dist/accessibility-auditor.js.map +7 -0
  6. package/dist/accessibility-tree-crawler.d.ts +44 -0
  7. package/dist/accessibility-tree-crawler.js +156 -0
  8. package/dist/accessibility-tree-crawler.js.map +7 -0
  9. package/dist/advanced-ui-probes.d.ts +47 -0
  10. package/dist/advanced-ui-probes.js +310 -0
  11. package/dist/advanced-ui-probes.js.map +7 -0
  12. package/dist/ai-login.d.ts +32 -0
  13. package/dist/ai-login.js +250 -0
  14. package/dist/ai-login.js.map +7 -0
  15. package/dist/auth-token-rotator.d.ts +47 -0
  16. package/dist/auth-token-rotator.js +58 -0
  17. package/dist/auth-token-rotator.js.map +7 -0
  18. package/dist/auth.d.ts +20 -0
  19. package/dist/auth.js +348 -0
  20. package/dist/auth.js.map +7 -0
  21. package/dist/browser-extension.d.ts +37 -0
  22. package/dist/browser-extension.js +113 -0
  23. package/dist/browser-extension.js.map +7 -0
  24. package/dist/captcha-solver.d.ts +16 -0
  25. package/dist/captcha-solver.js +105 -0
  26. package/dist/captcha-solver.js.map +7 -0
  27. package/dist/color-contrast.d.ts +30 -0
  28. package/dist/color-contrast.js +78 -0
  29. package/dist/color-contrast.js.map +7 -0
  30. package/dist/content-chunker.d.ts +18 -0
  31. package/dist/content-chunker.js +152 -0
  32. package/dist/content-chunker.js.map +7 -0
  33. package/dist/content-dedup.d.ts +23 -0
  34. package/dist/content-dedup.js +60 -0
  35. package/dist/content-dedup.js.map +7 -0
  36. package/dist/cookie-consent.d.ts +25 -0
  37. package/dist/cookie-consent.js +78 -0
  38. package/dist/cookie-consent.js.map +7 -0
  39. package/dist/cookie-jar.d.ts +20 -0
  40. package/dist/cookie-jar.js +61 -0
  41. package/dist/cookie-jar.js.map +7 -0
  42. package/dist/crawl-session-manager.d.ts +44 -0
  43. package/dist/crawl-session-manager.js +145 -0
  44. package/dist/crawl-session-manager.js.map +7 -0
  45. package/dist/crawler.d.ts +233 -0
  46. package/dist/crawler.js +6239 -0
  47. package/dist/crawler.js.map +7 -0
  48. package/dist/crud-interaction.d.ts +31 -0
  49. package/dist/crud-interaction.js +264 -0
  50. package/dist/crud-interaction.js.map +7 -0
  51. package/dist/custom-js-injector.d.ts +42 -0
  52. package/dist/custom-js-injector.js +50 -0
  53. package/dist/custom-js-injector.js.map +7 -0
  54. package/dist/dark-mode-capture.d.ts +23 -0
  55. package/dist/dark-mode-capture.js +75 -0
  56. package/dist/dark-mode-capture.js.map +7 -0
  57. package/dist/dead-link-detector.d.ts +37 -0
  58. package/dist/dead-link-detector.js +50 -0
  59. package/dist/dead-link-detector.js.map +7 -0
  60. package/dist/dropdown-enumerator.d.ts +20 -0
  61. package/dist/dropdown-enumerator.js +230 -0
  62. package/dist/dropdown-enumerator.js.map +7 -0
  63. package/dist/element-hash.d.ts +9 -0
  64. package/dist/element-hash.js +9 -0
  65. package/dist/element-hash.js.map +7 -0
  66. package/dist/email-otp.d.ts +42 -0
  67. package/dist/email-otp.js +177 -0
  68. package/dist/email-otp.js.map +7 -0
  69. package/dist/engine-router.d.ts +47 -0
  70. package/dist/engine-router.js +94 -0
  71. package/dist/engine-router.js.map +7 -0
  72. package/dist/export/bulk-export.d.ts +26 -0
  73. package/dist/export/bulk-export.js +76 -0
  74. package/dist/export/bulk-export.js.map +7 -0
  75. package/dist/export/vector-export.d.ts +76 -0
  76. package/dist/export/vector-export.js +85 -0
  77. package/dist/export/vector-export.js.map +7 -0
  78. package/dist/extractors/advanced.d.ts +64 -0
  79. package/dist/extractors/advanced.js +265 -0
  80. package/dist/extractors/advanced.js.map +7 -0
  81. package/dist/extractors/artifact-envelope.d.ts +63 -0
  82. package/dist/extractors/artifact-envelope.js +63 -0
  83. package/dist/extractors/artifact-envelope.js.map +7 -0
  84. package/dist/extractors/branding-extractor.d.ts +46 -0
  85. package/dist/extractors/branding-extractor.js +104 -0
  86. package/dist/extractors/branding-extractor.js.map +7 -0
  87. package/dist/extractors/summary-extractor.d.ts +10 -0
  88. package/dist/extractors/summary-extractor.js +36 -0
  89. package/dist/extractors/summary-extractor.js.map +7 -0
  90. package/dist/failure-analysis-agent.d.ts +16 -0
  91. package/dist/failure-analysis-agent.js +42 -0
  92. package/dist/failure-analysis-agent.js.map +7 -0
  93. package/dist/feature-flag-detector.d.ts +30 -0
  94. package/dist/feature-flag-detector.js +55 -0
  95. package/dist/feature-flag-detector.js.map +7 -0
  96. package/dist/filter-pagination-crawler.d.ts +52 -0
  97. package/dist/filter-pagination-crawler.js +299 -0
  98. package/dist/filter-pagination-crawler.js.map +7 -0
  99. package/dist/form-detector.d.ts +34 -0
  100. package/dist/form-detector.js +58 -0
  101. package/dist/form-detector.js.map +7 -0
  102. package/dist/frontier.d.ts +40 -0
  103. package/dist/frontier.js +103 -0
  104. package/dist/frontier.js.map +7 -0
  105. package/dist/gap-pass.d.ts +36 -0
  106. package/dist/gap-pass.js +115 -0
  107. package/dist/gap-pass.js.map +7 -0
  108. package/dist/graphql-detector.d.ts +39 -0
  109. package/dist/graphql-detector.js +86 -0
  110. package/dist/graphql-detector.js.map +7 -0
  111. package/dist/http-engine.d.ts +80 -0
  112. package/dist/http-engine.js +318 -0
  113. package/dist/http-engine.js.map +7 -0
  114. package/dist/incremental-diff.d.ts +116 -0
  115. package/dist/incremental-diff.js +137 -0
  116. package/dist/incremental-diff.js.map +7 -0
  117. package/dist/index.d.ts +52 -0
  118. package/dist/index.js +83 -0
  119. package/dist/index.js.map +7 -0
  120. package/dist/input-fuzzer.d.ts +30 -0
  121. package/dist/input-fuzzer.js +105 -0
  122. package/dist/input-fuzzer.js.map +7 -0
  123. package/dist/interactive-probe.d.ts +144 -0
  124. package/dist/interactive-probe.js +865 -0
  125. package/dist/interactive-probe.js.map +7 -0
  126. package/dist/job-queue.d.ts +297 -0
  127. package/dist/job-queue.js +3812 -0
  128. package/dist/job-queue.js.map +7 -0
  129. package/dist/js-coverage.d.ts +29 -0
  130. package/dist/js-coverage.js +56 -0
  131. package/dist/js-coverage.js.map +7 -0
  132. package/dist/js-router-detector.d.ts +17 -0
  133. package/dist/js-router-detector.js +90 -0
  134. package/dist/js-router-detector.js.map +7 -0
  135. package/dist/language-detector.d.ts +22 -0
  136. package/dist/language-detector.js +57 -0
  137. package/dist/language-detector.js.map +7 -0
  138. package/dist/link-classifier.d.ts +23 -0
  139. package/dist/link-classifier.js +40 -0
  140. package/dist/link-classifier.js.map +7 -0
  141. package/dist/live-view.d.ts +36 -0
  142. package/dist/live-view.js +105 -0
  143. package/dist/live-view.js.map +7 -0
  144. package/dist/locator-extractor.d.ts +46 -0
  145. package/dist/locator-extractor.js +220 -0
  146. package/dist/locator-extractor.js.map +7 -0
  147. package/dist/logger.d.ts +2 -0
  148. package/dist/logger.js +10 -0
  149. package/dist/logger.js.map +7 -0
  150. package/dist/markdown-extract.d.ts +8 -0
  151. package/dist/markdown-extract.js +54 -0
  152. package/dist/markdown-extract.js.map +7 -0
  153. package/dist/multi-context-handler.d.ts +55 -0
  154. package/dist/multi-context-handler.js +182 -0
  155. package/dist/multi-context-handler.js.map +7 -0
  156. package/dist/native-crawler.d.ts +69 -0
  157. package/dist/native-crawler.js +839 -0
  158. package/dist/native-crawler.js.map +7 -0
  159. package/dist/nested-window-crawler.d.ts +41 -0
  160. package/dist/nested-window-crawler.js +172 -0
  161. package/dist/nested-window-crawler.js.map +7 -0
  162. package/dist/network-action-correlator.d.ts +47 -0
  163. package/dist/network-action-correlator.js +209 -0
  164. package/dist/network-action-correlator.js.map +7 -0
  165. package/dist/network-observer.d.ts +49 -0
  166. package/dist/network-observer.js +149 -0
  167. package/dist/network-observer.js.map +7 -0
  168. package/dist/network-throttle.d.ts +25 -0
  169. package/dist/network-throttle.js +34 -0
  170. package/dist/network-throttle.js.map +7 -0
  171. package/dist/openapi-generator.d.ts +49 -0
  172. package/dist/openapi-generator.js +89 -0
  173. package/dist/openapi-generator.js.map +7 -0
  174. package/dist/pdf-extractor.d.ts +28 -0
  175. package/dist/pdf-extractor.js +81 -0
  176. package/dist/pdf-extractor.js.map +7 -0
  177. package/dist/performance-metrics-collector.d.ts +50 -0
  178. package/dist/performance-metrics-collector.js +155 -0
  179. package/dist/performance-metrics-collector.js.map +7 -0
  180. package/dist/performance-metrics.d.ts +52 -0
  181. package/dist/performance-metrics.js +83 -0
  182. package/dist/performance-metrics.js.map +7 -0
  183. package/dist/phash.d.ts +50 -0
  184. package/dist/phash.js +136 -0
  185. package/dist/phash.js.map +7 -0
  186. package/dist/pii-scrubber.d.ts +21 -0
  187. package/dist/pii-scrubber.js +75 -0
  188. package/dist/pii-scrubber.js.map +7 -0
  189. package/dist/playwright-recorder.d.ts +39 -0
  190. package/dist/playwright-recorder.js +123 -0
  191. package/dist/playwright-recorder.js.map +7 -0
  192. package/dist/policies/crawl-safety.d.ts +9 -0
  193. package/dist/policies/crawl-safety.js +41 -0
  194. package/dist/policies/crawl-safety.js.map +7 -0
  195. package/dist/profiles/domain-profile.d.ts +19 -0
  196. package/dist/profiles/domain-profile.js +160 -0
  197. package/dist/profiles/domain-profile.js.map +7 -0
  198. package/dist/proxy.d.ts +50 -0
  199. package/dist/proxy.js +165 -0
  200. package/dist/proxy.js.map +7 -0
  201. package/dist/rate-limiter.d.ts +31 -0
  202. package/dist/rate-limiter.js +64 -0
  203. package/dist/rate-limiter.js.map +7 -0
  204. package/dist/redirect-tracker.d.ts +37 -0
  205. package/dist/redirect-tracker.js +65 -0
  206. package/dist/redirect-tracker.js.map +7 -0
  207. package/dist/redis-frontier.d.ts +48 -0
  208. package/dist/redis-frontier.js +126 -0
  209. package/dist/redis-frontier.js.map +7 -0
  210. package/dist/redis-queue.d.ts +48 -0
  211. package/dist/redis-queue.js +165 -0
  212. package/dist/redis-queue.js.map +7 -0
  213. package/dist/response-cache.d.ts +38 -0
  214. package/dist/response-cache.js +140 -0
  215. package/dist/response-cache.js.map +7 -0
  216. package/dist/responsive-detector.d.ts +29 -0
  217. package/dist/responsive-detector.js +46 -0
  218. package/dist/responsive-detector.js.map +7 -0
  219. package/dist/retry-policy.d.ts +20 -0
  220. package/dist/retry-policy.js +54 -0
  221. package/dist/retry-policy.js.map +7 -0
  222. package/dist/robots-txt.d.ts +9 -0
  223. package/dist/robots-txt.js +77 -0
  224. package/dist/robots-txt.js.map +7 -0
  225. package/dist/screen-reader.d.ts +15 -0
  226. package/dist/screen-reader.js +48 -0
  227. package/dist/screen-reader.js.map +7 -0
  228. package/dist/screenshot-masker.d.ts +28 -0
  229. package/dist/screenshot-masker.js +62 -0
  230. package/dist/screenshot-masker.js.map +7 -0
  231. package/dist/seo-checker.d.ts +33 -0
  232. package/dist/seo-checker.js +91 -0
  233. package/dist/seo-checker.js.map +7 -0
  234. package/dist/service-worker-interceptor.d.ts +36 -0
  235. package/dist/service-worker-interceptor.js +136 -0
  236. package/dist/service-worker-interceptor.js.map +7 -0
  237. package/dist/session-capture.d.ts +39 -0
  238. package/dist/session-capture.js +274 -0
  239. package/dist/session-capture.js.map +7 -0
  240. package/dist/session-export.d.ts +49 -0
  241. package/dist/session-export.js +117 -0
  242. package/dist/session-export.js.map +7 -0
  243. package/dist/shadow-dom-crawler.d.ts +35 -0
  244. package/dist/shadow-dom-crawler.js +132 -0
  245. package/dist/shadow-dom-crawler.js.map +7 -0
  246. package/dist/sitemap-writer.d.ts +21 -0
  247. package/dist/sitemap-writer.js +47 -0
  248. package/dist/sitemap-writer.js.map +7 -0
  249. package/dist/sitemap.d.ts +51 -0
  250. package/dist/sitemap.js +160 -0
  251. package/dist/sitemap.js.map +7 -0
  252. package/dist/skyvern.d.ts +56 -0
  253. package/dist/skyvern.js +129 -0
  254. package/dist/skyvern.js.map +7 -0
  255. package/dist/sqs-queue.d.ts +13 -0
  256. package/dist/sqs-queue.js +115 -0
  257. package/dist/sqs-queue.js.map +7 -0
  258. package/dist/sso-token.d.ts +29 -0
  259. package/dist/sso-token.js +76 -0
  260. package/dist/sso-token.js.map +7 -0
  261. package/dist/state-graph.d.ts +59 -0
  262. package/dist/state-graph.js +193 -0
  263. package/dist/state-graph.js.map +7 -0
  264. package/dist/stealth/human-behavior.d.ts +20 -0
  265. package/dist/stealth/human-behavior.js +202 -0
  266. package/dist/stealth/human-behavior.js.map +7 -0
  267. package/dist/telemetry.d.ts +34 -0
  268. package/dist/telemetry.js +77 -0
  269. package/dist/telemetry.js.map +7 -0
  270. package/dist/test-executor.d.ts +81 -0
  271. package/dist/test-executor.js +443 -0
  272. package/dist/test-executor.js.map +7 -0
  273. package/dist/tls-fingerprint.d.ts +50 -0
  274. package/dist/tls-fingerprint.js +81 -0
  275. package/dist/tls-fingerprint.js.map +7 -0
  276. package/dist/url-pattern-completer.d.ts +28 -0
  277. package/dist/url-pattern-completer.js +122 -0
  278. package/dist/url-pattern-completer.js.map +7 -0
  279. package/dist/visual-diff-verdict.d.ts +40 -0
  280. package/dist/visual-diff-verdict.js +27 -0
  281. package/dist/visual-diff-verdict.js.map +7 -0
  282. package/dist/webhook-notifier.d.ts +30 -0
  283. package/dist/webhook-notifier.js +76 -0
  284. package/dist/webhook-notifier.js.map +7 -0
  285. package/dist/websocket-detector.d.ts +24 -0
  286. package/dist/websocket-detector.js +60 -0
  287. package/dist/websocket-detector.js.map +7 -0
  288. package/dist/worker.d.ts +1 -0
  289. package/dist/worker.js +33 -0
  290. package/dist/worker.js.map +7 -0
  291. package/package.json +49 -4
  292. package/src/accessibility-auditor.ts +102 -0
  293. package/src/accessibility-tree-crawler.ts +246 -0
  294. package/src/advanced-ui-probes.ts +470 -0
  295. package/src/ai-login.ts +298 -0
  296. package/src/auth-token-rotator.ts +89 -0
  297. package/src/auth.ts +418 -0
  298. package/src/browser-extension.ts +186 -0
  299. package/src/captcha-solver.ts +143 -0
  300. package/src/color-contrast.ts +116 -0
  301. package/src/content-chunker.ts +170 -0
  302. package/src/content-dedup.ts +99 -0
  303. package/src/cookie-consent.ts +106 -0
  304. package/src/cookie-jar.ts +91 -0
  305. package/src/crawl-session-manager.ts +231 -0
  306. package/src/crawler.ts +7123 -0
  307. package/src/crawler.ts.rej +12 -0
  308. package/src/crud-interaction.ts +386 -0
  309. package/src/custom-js-injector.ts +93 -0
  310. package/src/dark-mode-capture.ts +110 -0
  311. package/src/dead-link-detector.ts +76 -0
  312. package/src/dropdown-enumerator.ts +312 -0
  313. package/src/element-hash.ts +16 -0
  314. package/src/email-otp.ts +252 -0
  315. package/src/engine-router.ts +141 -0
  316. package/src/export/bulk-export.ts +85 -0
  317. package/src/export/vector-export.ts +160 -0
  318. package/src/extractors/advanced.ts +309 -0
  319. package/src/extractors/artifact-envelope.ts +111 -0
  320. package/src/extractors/branding-extractor.ts +159 -0
  321. package/src/extractors/summary-extractor.ts +49 -0
  322. package/src/failure-analysis-agent.ts +51 -0
  323. package/src/feature-flag-detector.ts +97 -0
  324. package/src/filter-pagination-crawler.ts +500 -0
  325. package/src/form-detector.ts +103 -0
  326. package/src/frontier.test.ts +64 -0
  327. package/src/frontier.ts +144 -0
  328. package/src/gap-pass.ts +165 -0
  329. package/src/graphql-detector.ts +129 -0
  330. package/src/http-engine.ts +453 -0
  331. package/src/incremental-diff.ts +259 -0
  332. package/src/index.ts +52 -0
  333. package/src/input-fuzzer.ts +129 -0
  334. package/src/interactive-probe.ts +1136 -0
  335. package/src/job-queue.test.ts +187 -0
  336. package/src/job-queue.ts +4504 -0
  337. package/src/js-coverage.ts +87 -0
  338. package/src/js-router-detector.ts +112 -0
  339. package/src/language-detector.ts +82 -0
  340. package/src/link-classifier.ts +65 -0
  341. package/src/live-view.ts +146 -0
  342. package/src/locator-extractor.ts +309 -0
  343. package/src/logger.ts +9 -0
  344. package/src/markdown-extract.test.ts +73 -0
  345. package/src/markdown-extract.ts +76 -0
  346. package/src/multi-context-handler.ts +296 -0
  347. package/src/native-crawler.ts +1108 -0
  348. package/src/nested-window-crawler.ts +310 -0
  349. package/src/network-action-correlator.ts +320 -0
  350. package/src/network-observer.ts +204 -0
  351. package/src/network-throttle.ts +69 -0
  352. package/src/openapi-generator.ts +135 -0
  353. package/src/pdf-extractor.ts +123 -0
  354. package/src/performance-metrics-collector.ts +243 -0
  355. package/src/performance-metrics.ts +134 -0
  356. package/src/phash.ts +184 -0
  357. package/src/pii-scrubber.ts +99 -0
  358. package/src/playwright-recorder.ts +170 -0
  359. package/src/policies/crawl-safety.ts +52 -0
  360. package/src/profiles/domain-profile.ts +190 -0
  361. package/src/proxy.ts +238 -0
  362. package/src/rate-limiter.ts +87 -0
  363. package/src/redirect-tracker.ts +97 -0
  364. package/src/redis-frontier.ts +143 -0
  365. package/src/redis-queue.ts +208 -0
  366. package/src/response-cache.ts +150 -0
  367. package/src/responsive-detector.ts +92 -0
  368. package/src/retry-policy.ts +87 -0
  369. package/src/robots-txt.ts +96 -0
  370. package/src/screen-reader.ts +98 -0
  371. package/src/screenshot-masker.ts +98 -0
  372. package/src/seo-checker.ts +134 -0
  373. package/src/service-worker-interceptor.ts +185 -0
  374. package/src/session-capture.ts +335 -0
  375. package/src/session-export.test.ts +75 -0
  376. package/src/session-export.ts +172 -0
  377. package/src/shadow-dom-crawler.ts +198 -0
  378. package/src/sitemap-writer.ts +65 -0
  379. package/src/sitemap.test.ts +127 -0
  380. package/src/sitemap.ts +233 -0
  381. package/src/skyvern.ts +199 -0
  382. package/src/sqs-queue.ts +129 -0
  383. package/src/sso-token.ts +120 -0
  384. package/src/state-graph.ts +280 -0
  385. package/src/stealth/human-behavior.ts +227 -0
  386. package/src/telemetry.ts +122 -0
  387. package/src/test-executor.test.ts +72 -0
  388. package/src/test-executor.ts +578 -0
  389. package/src/tls-fingerprint.ts +111 -0
  390. package/src/url-pattern-completer.ts +161 -0
  391. package/src/vendor.d.ts +20 -0
  392. package/src/visual-diff-verdict.test.ts +80 -0
  393. package/src/visual-diff-verdict.ts +59 -0
  394. package/src/webhook-notifier.ts +109 -0
  395. package/src/websocket-detector.ts +83 -0
  396. package/src/worker.ts +50 -0
  397. package/tsconfig.json +13 -0
  398. package/types/accessibility-auditor.d.ts +29 -0
  399. package/types/accessibility-tree-crawler.d.ts +44 -0
  400. package/types/advanced-ui-probes.d.ts +47 -0
  401. package/types/ai-login.d.ts +32 -0
  402. package/types/auth-token-rotator.d.ts +47 -0
  403. package/types/auth.d.ts +20 -0
  404. package/types/browser-extension.d.ts +37 -0
  405. package/types/bull-worker.d.ts +6 -0
  406. package/types/captcha-solver.d.ts +16 -0
  407. package/types/color-contrast.d.ts +30 -0
  408. package/types/content-chunker.d.ts +18 -0
  409. package/types/content-dedup.d.ts +23 -0
  410. package/types/cookie-consent.d.ts +25 -0
  411. package/types/cookie-jar.d.ts +20 -0
  412. package/types/crawl-session-manager.d.ts +44 -0
  413. package/types/crawler.d.ts +233 -0
  414. package/types/crud-interaction.d.ts +31 -0
  415. package/types/custom-js-injector.d.ts +42 -0
  416. package/types/dark-mode-capture.d.ts +23 -0
  417. package/types/dead-link-detector.d.ts +37 -0
  418. package/types/dropdown-enumerator.d.ts +20 -0
  419. package/types/element-hash.d.ts +9 -0
  420. package/types/email-otp.d.ts +42 -0
  421. package/types/engine-router.d.ts +47 -0
  422. package/types/export/bulk-export.d.ts +26 -0
  423. package/types/export/vector-export.d.ts +76 -0
  424. package/types/extractors/advanced.d.ts +64 -0
  425. package/types/extractors/artifact-envelope.d.ts +63 -0
  426. package/types/extractors/branding-extractor.d.ts +46 -0
  427. package/types/extractors/summary-extractor.d.ts +10 -0
  428. package/types/failure-analysis-agent.d.ts +16 -0
  429. package/types/feature-flag-detector.d.ts +30 -0
  430. package/types/filter-pagination-crawler.d.ts +52 -0
  431. package/types/form-detector.d.ts +34 -0
  432. package/types/frontier.d.ts +40 -0
  433. package/types/gap-pass.d.ts +36 -0
  434. package/types/graphql-detector.d.ts +39 -0
  435. package/types/http-engine.d.ts +80 -0
  436. package/types/incremental-diff.d.ts +116 -0
  437. package/types/index.d.ts +52 -0
  438. package/types/input-fuzzer.d.ts +30 -0
  439. package/types/interactive-probe.d.ts +144 -0
  440. package/types/job-queue.d.ts +308 -0
  441. package/types/js-coverage.d.ts +29 -0
  442. package/types/js-router-detector.d.ts +17 -0
  443. package/types/language-detector.d.ts +22 -0
  444. package/types/link-classifier.d.ts +23 -0
  445. package/types/live-view.d.ts +36 -0
  446. package/types/locator-extractor.d.ts +46 -0
  447. package/types/logger.d.ts +2 -0
  448. package/types/markdown-extract.d.ts +8 -0
  449. package/types/multi-context-handler.d.ts +55 -0
  450. package/types/native-crawler.d.ts +69 -0
  451. package/types/nested-window-crawler.d.ts +41 -0
  452. package/types/network-action-correlator.d.ts +47 -0
  453. package/types/network-observer.d.ts +49 -0
  454. package/types/network-throttle.d.ts +25 -0
  455. package/types/openapi-generator.d.ts +49 -0
  456. package/types/pdf-extractor.d.ts +28 -0
  457. package/types/performance-metrics-collector.d.ts +50 -0
  458. package/types/performance-metrics.d.ts +52 -0
  459. package/types/phash.d.ts +50 -0
  460. package/types/pii-scrubber.d.ts +21 -0
  461. package/types/playwright-recorder.d.ts +39 -0
  462. package/types/policies/crawl-safety.d.ts +9 -0
  463. package/types/profiles/domain-profile.d.ts +19 -0
  464. package/types/proxy.d.ts +50 -0
  465. package/types/rate-limiter.d.ts +31 -0
  466. package/types/redirect-tracker.d.ts +37 -0
  467. package/types/redis-frontier.d.ts +48 -0
  468. package/types/redis-queue.d.ts +48 -0
  469. package/types/response-cache.d.ts +38 -0
  470. package/types/responsive-detector.d.ts +29 -0
  471. package/types/retry-policy.d.ts +20 -0
  472. package/types/robots-txt.d.ts +9 -0
  473. package/types/screen-reader.d.ts +15 -0
  474. package/types/screenshot-masker.d.ts +28 -0
  475. package/types/seo-checker.d.ts +33 -0
  476. package/types/service-worker-interceptor.d.ts +36 -0
  477. package/types/session-capture.d.ts +39 -0
  478. package/types/session-export.d.ts +49 -0
  479. package/types/shadow-dom-crawler.d.ts +35 -0
  480. package/types/sitemap-writer.d.ts +21 -0
  481. package/types/sitemap.d.ts +51 -0
  482. package/types/skyvern.d.ts +56 -0
  483. package/types/sqs-queue.d.ts +13 -0
  484. package/types/sso-token.d.ts +29 -0
  485. package/types/state-graph.d.ts +59 -0
  486. package/types/stealth/human-behavior.d.ts +20 -0
  487. package/types/telemetry.d.ts +34 -0
  488. package/types/test-executor.d.ts +84 -0
  489. package/types/tls-fingerprint.d.ts +50 -0
  490. package/types/url-pattern-completer.d.ts +28 -0
  491. package/types/visual-diff-verdict.d.ts +40 -0
  492. package/types/webhook-notifier.d.ts +30 -0
  493. package/types/websocket-detector.d.ts +24 -0
  494. package/types/worker.d.ts +1 -0
@@ -0,0 +1,308 @@
1
+ /**
2
+ * ZeTa-AI Background Job Queue
3
+ *
4
+ * Postgres-backed durable queue. Each job becomes a PlatformJob record.
5
+ * enqueueJob() writes it QUEUED and, for same-process responsiveness, kicks
6
+ * an immediate best-effort claim attempt — but durability comes from
7
+ * startJobWorkerLoop()'s poll: it atomically claims QUEUED jobs (Postgres
8
+ * `FOR UPDATE SKIP LOCKED`, safe across any number of concurrent worker
9
+ * processes/containers) and requeues jobs whose heartbeat went stale,
10
+ * so a crashed/restarted worker never silently loses a job.
11
+ *
12
+ * CRAWL-type jobs additionally support AWS SQS as an alternate transport
13
+ * (JOB_QUEUE_BACKEND=sqs, see sqs-queue.ts) for horizontally-scaled crawler
14
+ * fleets; every other job type always goes through the DB-backed queue.
15
+ */
16
+ export declare enum FailureType {
17
+ TRANSIENT = "TRANSIENT",// network timeout, rate limit, 429, 503
18
+ INFRASTRUCTURE = "INFRASTRUCTURE",// DB connection, OOM, worker crash
19
+ LOGICAL = "LOGICAL",// bad input, business rule violation, 400/422
20
+ FATAL = "FATAL"
21
+ }
22
+ export declare function classifyFailure(error: string | Error | unknown): FailureType;
23
+ /**
24
+ * Centralized failure recorder for all PlatformJobs.
25
+ * - Classifies error into FailureType (TRANSIENT, INFRASTRUCTURE, LOGICAL, FATAL)
26
+ * - Computes exponential backoff per failure classification
27
+ * - If FATAL or retries exhausted: marks status='FAILED', dlq=true, dlqAt=NOW(), dlqReason=error
28
+ * - If retryable: marks status='RETRY_WAIT', nextRetryAt=NOW() + backoff, retryCount=retryCount+1
29
+ * - Persists checkpoint and checkpointAt if checkpointData provided
30
+ * - Updates failureType on the row and in result.failureType
31
+ */
32
+ export declare function recordJobFailure(tenantId: string | null | undefined, jobId: string, err: unknown, checkpointData?: any, options?: {
33
+ isAborted?: boolean;
34
+ }): Promise<void>;
35
+ export declare function generateTOTP(secret: string): string;
36
+ export interface PlatformJobConfig {
37
+ tenantId: string;
38
+ projectId: string;
39
+ appUrl?: string;
40
+ credentials?: {
41
+ username: string;
42
+ password: string;
43
+ oneTimeCode?: string;
44
+ };
45
+ /** Decrypted Playwright storageState JSON — if present, session is restored without AI login. */
46
+ storageState?: string;
47
+ screenshotDir?: string;
48
+ maxScreens?: number;
49
+ /** Seed URLs added to the initial crawl queue — link discovery still runs from each page. */
50
+ startUrls?: string[];
51
+ /** When provided, crawl ONLY these exact URLs (no link-following). Used for selected-screen recrawl. */
52
+ selectiveUrls?: string[];
53
+ /** Device profiles for multi-viewport screenshot pass after main DESKTOP crawl. */
54
+ deviceProfiles?: string[];
55
+ /** HTTP Basic Auth credentials — injected as Authorization header on same-origin requests. */
56
+ httpBasicUsername?: string;
57
+ httpBasicPassword?: string;
58
+ /** Bearer/API token — injected as a request header and into localStorage. Skips AI login. */
59
+ authToken?: string;
60
+ /** Header name for authToken (default: 'Authorization'). */
61
+ authTokenHeader?: string;
62
+ /** Prefix for authToken value (default: 'Bearer '). */
63
+ authTokenPrefix?: string;
64
+ /** CAPTCHA solving API key (2captcha or CapSolver). */
65
+ captchaSolverApiKey?: string;
66
+ /** CAPTCHA solving service provider (default: '2captcha'). */
67
+ captchaSolverProvider?: '2captcha' | 'capsolver';
68
+ /**
69
+ * Path to a Chrome user data directory for profile inheritance (local deployments only).
70
+ * When set, the crawler exports the existing session from this profile and injects it.
71
+ */
72
+ chromeProfilePath?: string;
73
+ /** MailSlurp API key for email OTP auto-retrieval. */
74
+ mailslurpApiKey?: string;
75
+ /** MailSlurp inbox ID to poll for OTP emails. */
76
+ mailslurpInboxId?: string;
77
+ /** SSO provider ('okta' | 'azure_ad' | 'generic_oidc'). */
78
+ ssoProvider?: string;
79
+ /** SSO domain or tenant ID. */
80
+ ssoDomain?: string;
81
+ /** SSO OAuth2 client ID. */
82
+ ssoClientId?: string;
83
+ /** SSO OAuth2 client secret (decrypted). */
84
+ ssoClientSecret?: string;
85
+ /** SSO scopes (space-separated). Default: 'openid profile'. */
86
+ ssoScope?: string;
87
+ /** HTTP/HTTPS/SOCKS5 proxy URL — routes browser through this proxy for bot-protected sites. */
88
+ proxyUrl?: string;
89
+ /** HTML extraction mode. 'normal'=raw, 'reader'=Readability article, 'prune'=strip nav/ads. Default: 'normal'. */
90
+ htmlMode?: 'normal' | 'reader' | 'prune';
91
+ /** Per-request screenshot dimensions and quality. Defaults: 1440×900, quality 80. */
92
+ screenshotConfig?: {
93
+ fullPage?: boolean;
94
+ width?: number;
95
+ height?: number;
96
+ quality?: number;
97
+ };
98
+ /** Enable/disable Playwright stealth plugin. Default: true (existing behaviour). */
99
+ stealth?: boolean;
100
+ /** Mock mode — intercept all navigation and return synthetic content. Good for CI. */
101
+ mock?: boolean | {
102
+ minKb?: number;
103
+ maxKb?: number;
104
+ minSleep?: number;
105
+ maxSleep?: number;
106
+ };
107
+ /** MIME type allowlist — crawler skips URLs returning disallowed content types. */
108
+ allowedTypes?: string[];
109
+ /** Glob-style include patterns for URL paths (e.g. '/blog/*'). Only matching paths crawled. */
110
+ includePatterns?: string[];
111
+ /** Glob-style exclude patterns for URL paths (e.g. '/admin/*'). Matching paths skipped. */
112
+ excludePatterns?: string[];
113
+ /** Allow crawler to follow links to external domains. Default: false. */
114
+ allowExternal?: boolean;
115
+ /** Requested output formats for a single-pass multi-format extraction. */
116
+ requestedFormats?: Array<'markdown' | 'html' | 'links' | 'images' | 'summary' | 'json' | 'branding' | 'screenshot'>;
117
+ /** LLM chunker configuration for AI extraction passes. */
118
+ chunkerConfig?: {
119
+ size?: number | 'dynamic';
120
+ overlap?: number;
121
+ };
122
+ /** ISO-3166-1 alpha-2 country code for geo-targeted proxy routing (e.g. 'us', 'gb'). */
123
+ proxyCountry?: string;
124
+ /** When true, after the primary crawl auto-enqueue one CRAWL job per credentialProfile. */
125
+ crawlAllRoles?: boolean;
126
+ /** Decrypted credential profiles used when crawlAllRoles is true. */
127
+ credentialProfiles?: Array<{
128
+ id: string;
129
+ name: string;
130
+ username: string;
131
+ password: string;
132
+ }>;
133
+ /** Set on role-crawl sub-jobs — profile name tagged on discovered screens via roleAccess column. */
134
+ roleProfileName?: string;
135
+ }
136
+ export declare function getActiveExecutionCount(): number;
137
+ type ClaimedJob = {
138
+ id: string;
139
+ tenantId: string;
140
+ projectId: string;
141
+ type: string;
142
+ config: any;
143
+ };
144
+ /** Atomically claims one specific QUEUED job for this worker. Returns null if it was already claimed. */
145
+ export declare function claimSpecificJob(jobId: string): Promise<ClaimedJob | null>;
146
+ /** Atomically claims the oldest QUEUED job across all tenants. SKIP LOCKED makes this
147
+ * race-safe against any number of other pollers doing the same thing concurrently.
148
+ * DISCOVER jobs are subject to MAX_CONCURRENT_DISCOVER — skipped when that many are
149
+ * already RUNNING to prevent Playwright/DB pool exhaustion from simultaneous crawls. */
150
+ export declare function claimNextQueuedJob(): Promise<ClaimedJob | null>;
151
+ /** Requeues RUNNING jobs whose heartbeat has gone stale — the worker that claimed them
152
+ * died (crash, restart, OOM) without ever marking them DONE/FAILED. Idempotent and
153
+ * safe to run from every worker process; only affects rows past the timeout.
154
+ * API-in-process job types (GENERATE_SCRIPT etc.) are failed directly — requeueing them
155
+ * would cause the worker to claim and fail them with a confusing "claimed by worker" error. */
156
+ export declare function requeueStaleRunningJobs(): Promise<void>;
157
+ /**
158
+ * Requeues any RUNNING jobs claimed by a different worker (i.e., a previous
159
+ * process instance). Call once at startup before the poll loop begins — this
160
+ * provides immediate recovery instead of waiting the full STALE_JOB_TIMEOUT_MINUTES.
161
+ * Safe to call from multiple replicas simultaneously (each uses its own WORKER_ID).
162
+ */
163
+ export declare function requeueOrphanedJobs(): Promise<void>;
164
+ /** Dispatches a claimed job to its type's processor. Last-resort safety net — every
165
+ * process*Job function already catches and records its own failures. */
166
+ export declare function dispatchClaimedJob(job: ClaimedJob): Promise<void>;
167
+ /** Re-promotes FAILED jobs to RETRY_WAIT if they are eligible for retry based on per-type limits.
168
+ * RETRY_WAIT makes the waiting period visible in the UI. A separate sweep then promotes
169
+ * RETRY_WAIT → QUEUED once nextRetryAt <= NOW(). */
170
+ export declare function retryEligibleFailedJobs(): Promise<void>;
171
+ /** Promotes FAILED jobs to DLQ if they exceed their per-type retry limits. */
172
+ export declare function promoteToDeadLetterQueue(): Promise<void>;
173
+ /**
174
+ * Starts the durable job worker poll loop. This is what makes job processing
175
+ * survive a restart — enqueueJob()'s immediate same-process claim attempt is
176
+ * only a latency optimization; if the process dies before that fires (or
177
+ * mid-job), this loop's next tick claims/requeues it. Call once at process
178
+ * startup (API server and/or a dedicated crawler worker process — safe to
179
+ * run in both, and safe to run in many container replicas at once).
180
+ */
181
+ export declare function startJobWorkerLoop(opts?: {
182
+ pollIntervalMs?: number;
183
+ concurrency?: number;
184
+ }): void;
185
+ /** Stops the poll loop. Mainly for tests. */
186
+ export declare function stopJobWorkerLoop(): void;
187
+ /** Create a job record that tracks a synchronous operation (telemetry only, no background processor). */
188
+ export declare function createTrackedJob(type: string, config: {
189
+ tenantId: string;
190
+ projectId: string;
191
+ [k: string]: any;
192
+ }): Promise<string>;
193
+ /** Mark a tracked job DONE or FAILED. Safe to call in finally — swallows errors.
194
+ * GAP-14/15: Uses failure-type classification for per-type backoff on FAILED. */
195
+ export declare function finishTrackedJob(tenantId: string, jobId: string, error?: string): Promise<void>;
196
+ /** Enqueue a generic platform job — returns the job ID immediately. */
197
+ export declare function enqueueJob(type: string, config: any): Promise<string>;
198
+ /** Get the current state of a platform job. */
199
+ export declare function getJob(tenantId: string, jobId: string): Promise<{
200
+ progress: number;
201
+ id: string;
202
+ name: string | null;
203
+ type: string;
204
+ error: string | null;
205
+ result: import("@prisma/client/runtime/library").JsonValue | null;
206
+ status: string;
207
+ tenantId: string;
208
+ projectId: string;
209
+ inline: boolean;
210
+ config: import("@prisma/client/runtime/library").JsonValue;
211
+ retryCount: number;
212
+ failureType: string | null;
213
+ queuedAt: Date;
214
+ startedAt: Date | null;
215
+ finishedAt: Date | null;
216
+ workerId: string | null;
217
+ heartbeatAt: Date | null;
218
+ totalPromptTokens: number | null;
219
+ totalCompletionTokens: number | null;
220
+ totalCacheReadTokens: number | null;
221
+ totalEstimatedCostUsd: number | null;
222
+ llmCallCount: number;
223
+ nextRetryAt: Date | null;
224
+ dlq: boolean;
225
+ dlqReason: string | null;
226
+ leaseExpiresAt: Date | null;
227
+ fencingToken: string | null;
228
+ checkpoint: import("@prisma/client/runtime/library").JsonValue | null;
229
+ checkpointAt: Date | null;
230
+ parentJobId: string | null;
231
+ rootJobId: string | null;
232
+ currentStep: string | null;
233
+ requeuedAt: Date | null;
234
+ dlqAt: Date | null;
235
+ dlqRedriveCount: number;
236
+ submittedBy: string | null;
237
+ priority: number;
238
+ } | null>;
239
+ /** List recent jobs for a project. */
240
+ export declare function listJobs(tenantId: string, projectId: string): Promise<{
241
+ progress: number;
242
+ id: string;
243
+ name: string | null;
244
+ type: string;
245
+ error: string | null;
246
+ result: import("@prisma/client/runtime/library").JsonValue | null;
247
+ status: string;
248
+ tenantId: string;
249
+ projectId: string;
250
+ inline: boolean;
251
+ config: import("@prisma/client/runtime/library").JsonValue;
252
+ retryCount: number;
253
+ failureType: string | null;
254
+ queuedAt: Date;
255
+ startedAt: Date | null;
256
+ finishedAt: Date | null;
257
+ workerId: string | null;
258
+ heartbeatAt: Date | null;
259
+ totalPromptTokens: number | null;
260
+ totalCompletionTokens: number | null;
261
+ totalCacheReadTokens: number | null;
262
+ totalEstimatedCostUsd: number | null;
263
+ llmCallCount: number;
264
+ nextRetryAt: Date | null;
265
+ dlq: boolean;
266
+ dlqReason: string | null;
267
+ leaseExpiresAt: Date | null;
268
+ fencingToken: string | null;
269
+ checkpoint: import("@prisma/client/runtime/library").JsonValue | null;
270
+ checkpointAt: Date | null;
271
+ parentJobId: string | null;
272
+ rootJobId: string | null;
273
+ currentStep: string | null;
274
+ requeuedAt: Date | null;
275
+ dlqAt: Date | null;
276
+ dlqRedriveCount: number;
277
+ submittedBy: string | null;
278
+ priority: number;
279
+ }[]>;
280
+ /** Cancel a RUNNING or QUEUED job.
281
+ * Sets status to CANCEL_REQUESTED (GAP-08) so the worker's abort handler can
282
+ * detect the request and set CANCELLED + finishedAt after the underlying work stops.
283
+ * The in-process AbortController is also triggered for same-process jobs. */
284
+ export declare function cancelJob(tenantId: string, jobId: string): Promise<void>;
285
+ /** Re-enqueue a job using the same config as a previous job. */
286
+ export declare function rerunJob(tenantId: string, jobId: string): Promise<string>;
287
+ export declare function resumeJob(tenantId: string, jobId: string): Promise<string>;
288
+ /** Update progress percentage and current step label on a running job (non-fatal). */
289
+ export declare function updateJobProgress(tenantId: string, jobId: string, progress: number, step: string): Promise<void>;
290
+ export interface ProcessJobOpts {
291
+ onProgress?: (pct: number) => Promise<void>;
292
+ }
293
+ export declare function processJob(jobId: string, config: any, opts?: ProcessJobOpts): Promise<void>;
294
+ /** After a job finishes, sum LLMCallLog entries for that project during the job window. */
295
+ export declare function aggregateJobTokens(tenantId: string, jobId: string, projectId: string, startedAt: Date): Promise<void>;
296
+ export declare function processDataRetentionPurge(): Promise<void>;
297
+ export declare function generateK6Script(params: {
298
+ endpoints: Array<{
299
+ method: string;
300
+ path: string;
301
+ summary?: string;
302
+ }>;
303
+ baseUrl: string;
304
+ vus?: number;
305
+ duration?: string;
306
+ thinkTimeSeconds?: number;
307
+ }): string;
308
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * JS/CSS coverage collector via Playwright's built-in coverage API.
3
+ *
4
+ * For each crawled page, records what percentage of loaded JS/CSS was actually
5
+ * executed/applied. High unused code % → performance opportunity (code splitting, lazy loading).
6
+ *
7
+ * Uses Playwright's page.coverage API (wraps CDP Coverage domain).
8
+ */
9
+ import type { Page } from 'playwright';
10
+ export interface CoverageEntry {
11
+ url: string;
12
+ type: 'js' | 'css';
13
+ totalBytes: number;
14
+ usedBytes: number;
15
+ unusedPercent: number;
16
+ }
17
+ export interface CoverageReport {
18
+ pageUrl: string;
19
+ entries: CoverageEntry[];
20
+ totalJsBytes: number;
21
+ usedJsBytes: number;
22
+ totalCssBytes: number;
23
+ usedCssBytes: number;
24
+ jsUnusedPercent: number;
25
+ cssUnusedPercent: number;
26
+ collectedAt: string;
27
+ }
28
+ export declare function startCoverage(page: Page): Promise<void>;
29
+ export declare function stopAndCollectCoverage(page: Page, pageUrl: string): Promise<CoverageReport | null>;
@@ -0,0 +1,17 @@
1
+ /**
2
+ * P2: JS Router Detection
3
+ *
4
+ * Scans the loaded page for client-side route tables declared by React Router v6,
5
+ * Vue Router, Angular Router, or custom window globals. Supplements the existing
6
+ * history.pushState interception (which only captures runtime navigation) with a
7
+ * static analysis of routes declared in the JS bundle.
8
+ *
9
+ * Called once per page after goto(). Runs entirely in-browser via page.evaluate().
10
+ * Adds discovered routes to the BFS frontier so the crawler visits them.
11
+ */
12
+ /**
13
+ * Extract absolute page URLs from the current page's JS router config.
14
+ * Returns deduplicated absolute URLs (same origin). Dynamic segments (:id, *)
15
+ * are skipped — the crawler can't resolve them without knowing valid IDs.
16
+ */
17
+ export declare function detectJsRoutes(page: any, origin: string): Promise<string[]>;
@@ -0,0 +1,22 @@
1
+ /**
2
+ * Language detector — identify page language from HTML attributes and content analysis.
3
+ *
4
+ * Sources (in priority order):
5
+ * 1. <html lang="..."> attribute
6
+ * 2. <meta http-equiv="Content-Language"> header
7
+ * 3. hreflang alternate links
8
+ * 4. Content-based n-gram fingerprint (detects top 20 languages)
9
+ *
10
+ * Used to: route pages to the correct markdown processor, group screens by locale,
11
+ * and detect missing hreflang implementations.
12
+ */
13
+ import type { Page } from 'playwright';
14
+ export interface LanguageDetectionResult {
15
+ url: string;
16
+ declaredLang: string;
17
+ detectedLang: string;
18
+ confidence: 'high' | 'medium' | 'low';
19
+ alternates: Record<string, string>;
20
+ isMultilingual: boolean;
21
+ }
22
+ export declare function detectLanguage(page: Page, url: string): Promise<LanguageDetectionResult>;
@@ -0,0 +1,23 @@
1
+ /**
2
+ * Link classifier — assigns priority and category to discovered URLs.
3
+ *
4
+ * Categories:
5
+ * - 'nav' : site navigation (homepage, top-level pages) — highest priority
6
+ * - 'auth' : login/register/password flows — high priority
7
+ * - 'app' : authenticated app screens — high priority
8
+ * - 'content' : blog/docs/articles — medium priority
9
+ * - 'api' : REST/GraphQL API endpoints — detected, not crawled as screens
10
+ * - 'resource' : static assets (JS/CSS/img/fonts) — skip
11
+ * - 'external' : different domain — skip unless cross-domain crawl enabled
12
+ * - 'low-value' : pagination, sort, filter query strings — deprioritize
13
+ */
14
+ export type LinkCategory = 'nav' | 'auth' | 'app' | 'content' | 'api' | 'resource' | 'external' | 'low-value';
15
+ export interface ClassifiedLink {
16
+ url: string;
17
+ category: LinkCategory;
18
+ priority: number;
19
+ reason: string;
20
+ }
21
+ export declare function classifyLink(url: string, baseUrl: string): ClassifiedLink;
22
+ export declare function classifyLinks(urls: string[], baseUrl: string): ClassifiedLink[];
23
+ export declare function filterCrawlable(classified: ClassifiedLink[]): ClassifiedLink[];
@@ -0,0 +1,36 @@
1
+ /**
2
+ * Start a live view session: launches a headless browser, navigates to appUrl,
3
+ * begins capturing frames. Returns the session ID.
4
+ */
5
+ export declare function startLiveView(appUrl: string, storageState?: string): Promise<string>;
6
+ /**
7
+ * Get the latest frame for a session (base64 JPEG).
8
+ */
9
+ export declare function getFrame(id: string): string | null;
10
+ /**
11
+ * Navigate the live view browser to a URL.
12
+ */
13
+ export declare function liveViewNavigate(id: string, url: string): Promise<void>;
14
+ /**
15
+ * Capture storageState from the live view session, close the browser, return JSON string.
16
+ */
17
+ export declare function completeLiveView(id: string): Promise<string>;
18
+ /**
19
+ * Send a mouse or keyboard input event to the live view browser.
20
+ */
21
+ export declare function sendInput(id: string, event: {
22
+ type: 'click' | 'type' | 'key';
23
+ x?: number;
24
+ y?: number;
25
+ button?: 'left' | 'right' | 'middle';
26
+ text?: string;
27
+ key?: string;
28
+ }): Promise<void>;
29
+ /**
30
+ * Close a live view session without capturing.
31
+ */
32
+ export declare function closeLiveView(id: string): Promise<void>;
33
+ /**
34
+ * List all active session IDs (for health checks / cleanup).
35
+ */
36
+ export declare function listLiveViews(): string[];
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Converts raw DB Element records (role, meaning, notes JSON) into Playwright-idiomatic locator strings.
3
+ * Priority: data-testid → aria-label/placeholder (inputs) → role+name (buttons/links) → heading → text → id
4
+ */
5
+ export interface PlaywrightLocator {
6
+ key: string;
7
+ expression: string;
8
+ elementType: string;
9
+ confidence: 'high' | 'medium' | 'low';
10
+ source: 'testid' | 'label' | 'placeholder' | 'role-name' | 'heading' | 'text' | 'id';
11
+ description: string;
12
+ }
13
+ /** Convert a single DB Element record to a Playwright locator. Returns null if insufficient data. */
14
+ export declare function elementToPlaywrightLocator(element: {
15
+ role?: string | null;
16
+ meaning?: string | null;
17
+ text?: string | null;
18
+ notes?: unknown;
19
+ selector?: string | null;
20
+ ariaState?: Record<string, unknown> | null;
21
+ }): PlaywrightLocator | null;
22
+ /**
23
+ * Convert an array of DB Element records to deduplicated Playwright locators.
24
+ * Deduplicates by key — higher confidence wins.
25
+ * Filters out crawl-analysis meta-annotations and produces an auth-wall warning when applicable.
26
+ */
27
+ export declare function elementsToPlaywrightLocators(elements: Array<{
28
+ role?: string | null;
29
+ meaning?: string | null;
30
+ text?: string | null;
31
+ notes?: unknown;
32
+ selector?: string | null;
33
+ isInteractive?: boolean | null;
34
+ ariaState?: Record<string, unknown> | null;
35
+ }>): PlaywrightLocator[];
36
+ /**
37
+ * Detect whether a set of locators was extracted from an auth-wall page.
38
+ * Returns a warning message if auth-wall detected, null otherwise.
39
+ * Heuristic: >50% of locators are low-confidence text matches AND at least one matches auth-wall pattern.
40
+ */
41
+ export declare function detectAuthWallLocators(locators: PlaywrightLocator[]): string | null;
42
+ /**
43
+ * Format locators as a block for injection into LLM script generation prompts.
44
+ * Returns empty string if no locators.
45
+ */
46
+ export declare function formatLocatorsForPrompt(locators: PlaywrightLocator[]): string;
@@ -0,0 +1,2 @@
1
+ import pino from 'pino';
2
+ export declare const logger: pino.Logger<never, boolean>;
@@ -0,0 +1,8 @@
1
+ export interface ExtractedMarkdown {
2
+ markdown: string;
3
+ method: 'readability' | 'full-page';
4
+ title: string | null;
5
+ wordCount: number;
6
+ }
7
+ /** Best-effort HTML→Markdown for one crawled page. Never throws. */
8
+ export declare function extractMarkdown(html: string, url: string): ExtractedMarkdown | null;
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Multi-context browser handling — detects and records new tabs, iframes,
3
+ * popups, and file downloads triggered during a page crawl.
4
+ * This lets ZeTa discover cross-origin flows, OAuth redirects, embedded
5
+ * third-party content, and downloadable resources that single-page HTTP
6
+ * crawlers would miss entirely.
7
+ */
8
+ import type { Page, BrowserContext } from 'playwright';
9
+ export interface NewTabRecord {
10
+ url: string;
11
+ linkText: string;
12
+ isInternal: boolean;
13
+ httpStatus?: number;
14
+ }
15
+ export interface IframeRecord {
16
+ src: string;
17
+ crossOrigin: boolean;
18
+ sandboxed: boolean;
19
+ sandboxValue: string | null;
20
+ accessible: boolean;
21
+ contentSample: string;
22
+ hasForm: boolean;
23
+ }
24
+ export interface PopupRecord {
25
+ url: string;
26
+ triggerLabel: string;
27
+ isOAuthLike: boolean;
28
+ }
29
+ export interface DownloadRecord {
30
+ filename: string;
31
+ downloadUrl: string;
32
+ triggerLabel: string;
33
+ }
34
+ export interface MultiContextResult {
35
+ newTabs: NewTabRecord[];
36
+ iframes: IframeRecord[];
37
+ popups: PopupRecord[];
38
+ downloads: DownloadRecord[];
39
+ }
40
+ /**
41
+ * Attaches a listener to the BrowserContext that records every new tab
42
+ * opened while the listener is active. Returns an unsubscribe function.
43
+ *
44
+ * Call this before navigating / clicking so that tabs opened during the
45
+ * crawl are captured, then call the returned function to stop listening.
46
+ */
47
+ export declare function attachNewTabListener(context: BrowserContext, seedUrl: string, result: MultiContextResult): () => void;
48
+ /**
49
+ * Probes the current page for multi-context browser events: iframes,
50
+ * popup windows, and file downloads.
51
+ *
52
+ * New-tab tracking is intentionally excluded here — it must be set up at
53
+ * the crawler level (before navigation) using `attachNewTabListener`.
54
+ */
55
+ export declare function probeMultiContext(page: Page, context: BrowserContext, seedUrl: string): Promise<MultiContextResult>;
@@ -0,0 +1,69 @@
1
+ /**
2
+ * ZeTa Native App Crawler — Appium-based crawler for Android APK and iOS IPA.
3
+ *
4
+ * Architecture:
5
+ * Appium Server (running at APPIUM_SERVER_URL) → WebDriverIO session
6
+ * → UiAutomator2 (Android) / XCUITest (iOS)
7
+ * → accessibility tree XML → ZeTa Element records
8
+ *
9
+ * TODO: requires Appium server running at APPIUM_SERVER_URL env var
10
+ * TODO: requires `webdriverio` package — add "webdriverio": "^9.x" to package.json
11
+ *
12
+ * Device farm support:
13
+ * - local_emulator: Appium server + local emulator/simulator
14
+ * - aws_device_farm: presigned S3 URL uploaded to Device Farm, session via WDIO
15
+ * - browserstack: BrowserStack Automate Appium endpoint
16
+ */
17
+ export interface NativeCrawlerOptions {
18
+ tenantId: string;
19
+ projectId: string;
20
+ jobId: string;
21
+ platform: 'android' | 'ios' | 'windows' | 'macos';
22
+ appS3Path: string;
23
+ packageName?: string;
24
+ deviceModel?: string;
25
+ osVersion?: string;
26
+ appActivity?: string;
27
+ appWaitActivity?: string;
28
+ deviceFarm: 'local_emulator' | 'aws_device_farm' | 'browserstack';
29
+ appiumServerUrl?: string;
30
+ browserstackUsername?: string;
31
+ browserstackAccessKey?: string;
32
+ awsAccessKeyId?: string;
33
+ awsSecretAccessKey?: string;
34
+ awsRegion?: string;
35
+ awsDeviceFarmProjectArn?: string;
36
+ credentials?: {
37
+ username?: string;
38
+ password?: string;
39
+ usernameFieldLabel?: string;
40
+ passwordFieldLabel?: string;
41
+ loginButtonLabel?: string;
42
+ };
43
+ visionLlmConfig?: {
44
+ provider: string;
45
+ model: string;
46
+ apiKey?: string;
47
+ baseUrl?: string;
48
+ } | null;
49
+ gestureConfig?: {
50
+ enableSwipe?: boolean;
51
+ enableLongPress?: boolean;
52
+ };
53
+ mitmProxyPort?: number;
54
+ }
55
+ /**
56
+ * Run a native app crawl session via Appium.
57
+ *
58
+ * Flow:
59
+ * 1. Download APK/IPA from S3 to local temp dir
60
+ * 2. Build Appium WebDriverIO capabilities for the target platform
61
+ * 3. Create WebDriverIO remote session (Appium server at APPIUM_SERVER_URL)
62
+ * 4. For each discovered screen:
63
+ * a. Get page source XML → parse elements
64
+ * b. Take screenshot → save to screenshotDir → persist via AppBrain
65
+ * c. Save screen + elements to DB
66
+ * d. Tap nav elements to discover next screens
67
+ * 5. Update PlatformJob as DONE (or FAILED on error)
68
+ */
69
+ export declare function runNativeCrawl(opts: NativeCrawlerOptions): Promise<void>;
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Nested window / browsing-context crawler — discovers and records frames,
3
+ * embedded apps, and popup windows that are already open in the browser
4
+ * context at the time of a crawl step.
5
+ *
6
+ * Complements multi-context-handler.ts: that module handles proactive popup
7
+ * interception via context.on('page'); this module snapshots what is already
8
+ * present in the frame tree and context page list.
9
+ */
10
+ import type { BrowserContext } from 'playwright';
11
+ export type BrowsingContextType = 'page' | 'frame' | 'popup' | 'embedded-app';
12
+ export interface BrowsingContextNode {
13
+ id: string;
14
+ type: BrowsingContextType;
15
+ url: string;
16
+ parentId: string | null;
17
+ depth: number;
18
+ title: string;
19
+ interactiveCount: number;
20
+ accessible: boolean;
21
+ isEmbeddedApp: boolean;
22
+ }
23
+ export interface NestedCrawlResult {
24
+ contextTree: BrowsingContextNode[];
25
+ totalContextsFound: number;
26
+ maxDepthReached: number;
27
+ inaccessibleCount: number;
28
+ frameUrls: string[];
29
+ embeddedAppUrls: string[];
30
+ }
31
+ /**
32
+ * Discovers all nested browsing contexts reachable from the current page:
33
+ * sub-frames, embedded applications, and already-open popup pages.
34
+ *
35
+ * All failures are non-fatal — errors are caught and an empty result is
36
+ * returned so the caller's crawl step can continue uninterrupted.
37
+ */
38
+ export declare function crawlNestedContexts(page: any, context: BrowserContext | null, seedUrl: string, opts?: {
39
+ maxFrameDepth?: number;
40
+ maxPopupDepth?: number;
41
+ }): Promise<NestedCrawlResult>;