@detiq/crawler 0.1.3

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 (412) hide show
  1. package/Dockerfile +49 -0
  2. package/README.md +11 -0
  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/ai-login.d.ts +32 -0
  7. package/dist/ai-login.js +177 -0
  8. package/dist/ai-login.js.map +7 -0
  9. package/dist/auth-token-rotator.d.ts +47 -0
  10. package/dist/auth-token-rotator.js +58 -0
  11. package/dist/auth-token-rotator.js.map +7 -0
  12. package/dist/auth.d.ts +20 -0
  13. package/dist/auth.js +329 -0
  14. package/dist/auth.js.map +7 -0
  15. package/dist/browser-extension.d.ts +37 -0
  16. package/dist/browser-extension.js +113 -0
  17. package/dist/browser-extension.js.map +7 -0
  18. package/dist/captcha-solver.d.ts +16 -0
  19. package/dist/captcha-solver.js +105 -0
  20. package/dist/captcha-solver.js.map +7 -0
  21. package/dist/color-contrast.d.ts +30 -0
  22. package/dist/color-contrast.js +78 -0
  23. package/dist/color-contrast.js.map +7 -0
  24. package/dist/content-chunker.d.ts +18 -0
  25. package/dist/content-chunker.js +152 -0
  26. package/dist/content-chunker.js.map +7 -0
  27. package/dist/content-dedup.d.ts +23 -0
  28. package/dist/content-dedup.js +60 -0
  29. package/dist/content-dedup.js.map +7 -0
  30. package/dist/cookie-consent.d.ts +25 -0
  31. package/dist/cookie-consent.js +78 -0
  32. package/dist/cookie-consent.js.map +7 -0
  33. package/dist/cookie-jar.d.ts +20 -0
  34. package/dist/cookie-jar.js +61 -0
  35. package/dist/cookie-jar.js.map +7 -0
  36. package/dist/crawler.d.ts +179 -0
  37. package/dist/crawler.js +3672 -0
  38. package/dist/crawler.js.map +7 -0
  39. package/dist/custom-js-injector.d.ts +42 -0
  40. package/dist/custom-js-injector.js +50 -0
  41. package/dist/custom-js-injector.js.map +7 -0
  42. package/dist/dark-mode-capture.d.ts +23 -0
  43. package/dist/dark-mode-capture.js +75 -0
  44. package/dist/dark-mode-capture.js.map +7 -0
  45. package/dist/dead-link-detector.d.ts +37 -0
  46. package/dist/dead-link-detector.js +50 -0
  47. package/dist/dead-link-detector.js.map +7 -0
  48. package/dist/element-hash.d.ts +9 -0
  49. package/dist/element-hash.js +9 -0
  50. package/dist/element-hash.js.map +7 -0
  51. package/dist/email-otp.d.ts +42 -0
  52. package/dist/email-otp.js +177 -0
  53. package/dist/email-otp.js.map +7 -0
  54. package/dist/engine-router.d.ts +47 -0
  55. package/dist/engine-router.js +94 -0
  56. package/dist/engine-router.js.map +7 -0
  57. package/dist/export/bulk-export.d.ts +26 -0
  58. package/dist/export/bulk-export.js +76 -0
  59. package/dist/export/bulk-export.js.map +7 -0
  60. package/dist/export/vector-export.d.ts +76 -0
  61. package/dist/export/vector-export.js +85 -0
  62. package/dist/export/vector-export.js.map +7 -0
  63. package/dist/extractors/advanced.d.ts +54 -0
  64. package/dist/extractors/advanced.js +245 -0
  65. package/dist/extractors/advanced.js.map +7 -0
  66. package/dist/extractors/artifact-envelope.d.ts +63 -0
  67. package/dist/extractors/artifact-envelope.js +63 -0
  68. package/dist/extractors/artifact-envelope.js.map +7 -0
  69. package/dist/failure-analysis-agent.d.ts +16 -0
  70. package/dist/failure-analysis-agent.js +40 -0
  71. package/dist/failure-analysis-agent.js.map +7 -0
  72. package/dist/feature-flag-detector.d.ts +30 -0
  73. package/dist/feature-flag-detector.js +55 -0
  74. package/dist/feature-flag-detector.js.map +7 -0
  75. package/dist/form-detector.d.ts +34 -0
  76. package/dist/form-detector.js +58 -0
  77. package/dist/form-detector.js.map +7 -0
  78. package/dist/frontier.d.ts +32 -0
  79. package/dist/frontier.js +83 -0
  80. package/dist/frontier.js.map +7 -0
  81. package/dist/gap-pass.d.ts +35 -0
  82. package/dist/gap-pass.js +81 -0
  83. package/dist/gap-pass.js.map +7 -0
  84. package/dist/graphql-detector.d.ts +39 -0
  85. package/dist/graphql-detector.js +86 -0
  86. package/dist/graphql-detector.js.map +7 -0
  87. package/dist/http-engine.d.ts +80 -0
  88. package/dist/http-engine.js +304 -0
  89. package/dist/http-engine.js.map +7 -0
  90. package/dist/incremental-diff.d.ts +59 -0
  91. package/dist/incremental-diff.js +61 -0
  92. package/dist/incremental-diff.js.map +7 -0
  93. package/dist/index.d.ts +35 -0
  94. package/dist/index.js +61 -0
  95. package/dist/index.js.map +7 -0
  96. package/dist/input-fuzzer.d.ts +30 -0
  97. package/dist/input-fuzzer.js +105 -0
  98. package/dist/input-fuzzer.js.map +7 -0
  99. package/dist/interactive-probe.d.ts +104 -0
  100. package/dist/interactive-probe.js +442 -0
  101. package/dist/interactive-probe.js.map +7 -0
  102. package/dist/job-queue.d.ts +171 -0
  103. package/dist/job-queue.js +2256 -0
  104. package/dist/job-queue.js.map +7 -0
  105. package/dist/js-coverage.d.ts +29 -0
  106. package/dist/js-coverage.js +56 -0
  107. package/dist/js-coverage.js.map +7 -0
  108. package/dist/js-router-detector.d.ts +17 -0
  109. package/dist/js-router-detector.js +90 -0
  110. package/dist/js-router-detector.js.map +7 -0
  111. package/dist/language-detector.d.ts +22 -0
  112. package/dist/language-detector.js +57 -0
  113. package/dist/language-detector.js.map +7 -0
  114. package/dist/link-classifier.d.ts +23 -0
  115. package/dist/link-classifier.js +40 -0
  116. package/dist/link-classifier.js.map +7 -0
  117. package/dist/live-view.d.ts +36 -0
  118. package/dist/live-view.js +100 -0
  119. package/dist/live-view.js.map +7 -0
  120. package/dist/logger.d.ts +2 -0
  121. package/dist/logger.js +10 -0
  122. package/dist/logger.js.map +7 -0
  123. package/dist/markdown-extract.d.ts +8 -0
  124. package/dist/markdown-extract.js +54 -0
  125. package/dist/markdown-extract.js.map +7 -0
  126. package/dist/native-crawler.d.ts +69 -0
  127. package/dist/native-crawler.js +839 -0
  128. package/dist/native-crawler.js.map +7 -0
  129. package/dist/network-observer.d.ts +49 -0
  130. package/dist/network-observer.js +149 -0
  131. package/dist/network-observer.js.map +7 -0
  132. package/dist/network-throttle.d.ts +25 -0
  133. package/dist/network-throttle.js +34 -0
  134. package/dist/network-throttle.js.map +7 -0
  135. package/dist/openapi-generator.d.ts +49 -0
  136. package/dist/openapi-generator.js +89 -0
  137. package/dist/openapi-generator.js.map +7 -0
  138. package/dist/pdf-extractor.d.ts +28 -0
  139. package/dist/pdf-extractor.js +81 -0
  140. package/dist/pdf-extractor.js.map +7 -0
  141. package/dist/performance-metrics.d.ts +53 -0
  142. package/dist/performance-metrics.js +83 -0
  143. package/dist/performance-metrics.js.map +7 -0
  144. package/dist/phash.d.ts +38 -0
  145. package/dist/phash.js +115 -0
  146. package/dist/phash.js.map +7 -0
  147. package/dist/pii-scrubber.d.ts +21 -0
  148. package/dist/pii-scrubber.js +75 -0
  149. package/dist/pii-scrubber.js.map +7 -0
  150. package/dist/playwright-recorder.d.ts +39 -0
  151. package/dist/playwright-recorder.js +123 -0
  152. package/dist/playwright-recorder.js.map +7 -0
  153. package/dist/policies/crawl-safety.d.ts +9 -0
  154. package/dist/policies/crawl-safety.js +37 -0
  155. package/dist/policies/crawl-safety.js.map +7 -0
  156. package/dist/profiles/domain-profile.d.ts +19 -0
  157. package/dist/profiles/domain-profile.js +140 -0
  158. package/dist/profiles/domain-profile.js.map +7 -0
  159. package/dist/proxy.d.ts +50 -0
  160. package/dist/proxy.js +165 -0
  161. package/dist/proxy.js.map +7 -0
  162. package/dist/rate-limiter.d.ts +31 -0
  163. package/dist/rate-limiter.js +64 -0
  164. package/dist/rate-limiter.js.map +7 -0
  165. package/dist/redirect-tracker.d.ts +37 -0
  166. package/dist/redirect-tracker.js +65 -0
  167. package/dist/redirect-tracker.js.map +7 -0
  168. package/dist/redis-frontier.d.ts +48 -0
  169. package/dist/redis-frontier.js +126 -0
  170. package/dist/redis-frontier.js.map +7 -0
  171. package/dist/redis-queue.d.ts +48 -0
  172. package/dist/redis-queue.js +165 -0
  173. package/dist/redis-queue.js.map +7 -0
  174. package/dist/response-cache.d.ts +38 -0
  175. package/dist/response-cache.js +140 -0
  176. package/dist/response-cache.js.map +7 -0
  177. package/dist/responsive-detector.d.ts +29 -0
  178. package/dist/responsive-detector.js +46 -0
  179. package/dist/responsive-detector.js.map +7 -0
  180. package/dist/retry-policy.d.ts +20 -0
  181. package/dist/retry-policy.js +54 -0
  182. package/dist/retry-policy.js.map +7 -0
  183. package/dist/robots-txt.d.ts +9 -0
  184. package/dist/robots-txt.js +77 -0
  185. package/dist/robots-txt.js.map +7 -0
  186. package/dist/screen-reader.d.ts +16 -0
  187. package/dist/screen-reader.js +46 -0
  188. package/dist/screen-reader.js.map +7 -0
  189. package/dist/screenshot-masker.d.ts +28 -0
  190. package/dist/screenshot-masker.js +62 -0
  191. package/dist/screenshot-masker.js.map +7 -0
  192. package/dist/seo-checker.d.ts +33 -0
  193. package/dist/seo-checker.js +91 -0
  194. package/dist/seo-checker.js.map +7 -0
  195. package/dist/session-capture.d.ts +35 -0
  196. package/dist/session-capture.js +267 -0
  197. package/dist/session-capture.js.map +7 -0
  198. package/dist/session-export.d.ts +49 -0
  199. package/dist/session-export.js +117 -0
  200. package/dist/session-export.js.map +7 -0
  201. package/dist/sitemap-writer.d.ts +21 -0
  202. package/dist/sitemap-writer.js +47 -0
  203. package/dist/sitemap-writer.js.map +7 -0
  204. package/dist/sitemap.d.ts +51 -0
  205. package/dist/sitemap.js +152 -0
  206. package/dist/sitemap.js.map +7 -0
  207. package/dist/skyvern.d.ts +56 -0
  208. package/dist/skyvern.js +129 -0
  209. package/dist/skyvern.js.map +7 -0
  210. package/dist/sqs-queue.d.ts +2 -0
  211. package/dist/sqs-queue.js +47 -0
  212. package/dist/sqs-queue.js.map +7 -0
  213. package/dist/sso-token.d.ts +29 -0
  214. package/dist/sso-token.js +76 -0
  215. package/dist/sso-token.js.map +7 -0
  216. package/dist/stealth/human-behavior.d.ts +20 -0
  217. package/dist/stealth/human-behavior.js +168 -0
  218. package/dist/stealth/human-behavior.js.map +7 -0
  219. package/dist/telemetry.d.ts +34 -0
  220. package/dist/telemetry.js +77 -0
  221. package/dist/telemetry.js.map +7 -0
  222. package/dist/test-executor.d.ts +67 -0
  223. package/dist/test-executor.js +311 -0
  224. package/dist/test-executor.js.map +7 -0
  225. package/dist/tls-fingerprint.d.ts +50 -0
  226. package/dist/tls-fingerprint.js +81 -0
  227. package/dist/tls-fingerprint.js.map +7 -0
  228. package/dist/url-pattern-completer.d.ts +28 -0
  229. package/dist/url-pattern-completer.js +87 -0
  230. package/dist/url-pattern-completer.js.map +7 -0
  231. package/dist/visual-diff-verdict.d.ts +40 -0
  232. package/dist/visual-diff-verdict.js +25 -0
  233. package/dist/visual-diff-verdict.js.map +7 -0
  234. package/dist/webhook-notifier.d.ts +30 -0
  235. package/dist/webhook-notifier.js +76 -0
  236. package/dist/webhook-notifier.js.map +7 -0
  237. package/dist/websocket-detector.d.ts +24 -0
  238. package/dist/websocket-detector.js +60 -0
  239. package/dist/websocket-detector.js.map +7 -0
  240. package/dist/worker.d.ts +1 -0
  241. package/dist/worker.js +33 -0
  242. package/dist/worker.js.map +7 -0
  243. package/package.json +45 -0
  244. package/src/accessibility-auditor.ts +102 -0
  245. package/src/ai-login.ts +218 -0
  246. package/src/auth-token-rotator.ts +89 -0
  247. package/src/auth.ts +396 -0
  248. package/src/browser-extension.ts +186 -0
  249. package/src/captcha-solver.ts +143 -0
  250. package/src/color-contrast.ts +116 -0
  251. package/src/content-chunker.ts +170 -0
  252. package/src/content-dedup.ts +99 -0
  253. package/src/cookie-consent.ts +106 -0
  254. package/src/cookie-jar.ts +91 -0
  255. package/src/crawler.ts +4305 -0
  256. package/src/custom-js-injector.ts +93 -0
  257. package/src/dark-mode-capture.ts +110 -0
  258. package/src/dead-link-detector.ts +76 -0
  259. package/src/element-hash.ts +16 -0
  260. package/src/email-otp.ts +252 -0
  261. package/src/engine-router.ts +141 -0
  262. package/src/export/bulk-export.ts +85 -0
  263. package/src/export/vector-export.ts +160 -0
  264. package/src/extractors/advanced.ts +283 -0
  265. package/src/extractors/artifact-envelope.ts +111 -0
  266. package/src/failure-analysis-agent.ts +49 -0
  267. package/src/feature-flag-detector.ts +97 -0
  268. package/src/form-detector.ts +103 -0
  269. package/src/frontier.test.ts +64 -0
  270. package/src/frontier.ts +112 -0
  271. package/src/gap-pass.ts +122 -0
  272. package/src/graphql-detector.ts +129 -0
  273. package/src/http-engine.ts +433 -0
  274. package/src/incremental-diff.ts +121 -0
  275. package/src/index.ts +35 -0
  276. package/src/input-fuzzer.ts +129 -0
  277. package/src/interactive-probe.ts +623 -0
  278. package/src/job-queue.test.ts +120 -0
  279. package/src/job-queue.ts +2701 -0
  280. package/src/js-coverage.ts +87 -0
  281. package/src/js-router-detector.ts +112 -0
  282. package/src/language-detector.ts +82 -0
  283. package/src/link-classifier.ts +65 -0
  284. package/src/live-view.ts +141 -0
  285. package/src/logger.ts +9 -0
  286. package/src/markdown-extract.test.ts +73 -0
  287. package/src/markdown-extract.ts +76 -0
  288. package/src/native-crawler.ts +1106 -0
  289. package/src/network-observer.ts +204 -0
  290. package/src/network-throttle.ts +69 -0
  291. package/src/openapi-generator.ts +135 -0
  292. package/src/pdf-extractor.ts +123 -0
  293. package/src/performance-metrics.ts +134 -0
  294. package/src/phash.ts +151 -0
  295. package/src/pii-scrubber.ts +99 -0
  296. package/src/playwright-recorder.ts +170 -0
  297. package/src/policies/crawl-safety.ts +46 -0
  298. package/src/profiles/domain-profile.ts +167 -0
  299. package/src/proxy.ts +238 -0
  300. package/src/rate-limiter.ts +87 -0
  301. package/src/redirect-tracker.ts +97 -0
  302. package/src/redis-frontier.ts +143 -0
  303. package/src/redis-queue.ts +208 -0
  304. package/src/response-cache.ts +150 -0
  305. package/src/responsive-detector.ts +92 -0
  306. package/src/retry-policy.ts +87 -0
  307. package/src/robots-txt.ts +96 -0
  308. package/src/screen-reader.ts +89 -0
  309. package/src/screenshot-masker.ts +98 -0
  310. package/src/seo-checker.ts +134 -0
  311. package/src/session-capture.ts +325 -0
  312. package/src/session-export.test.ts +75 -0
  313. package/src/session-export.ts +172 -0
  314. package/src/sitemap-writer.ts +65 -0
  315. package/src/sitemap.test.ts +131 -0
  316. package/src/sitemap.ts +224 -0
  317. package/src/skyvern.ts +199 -0
  318. package/src/sqs-queue.ts +49 -0
  319. package/src/sso-token.ts +120 -0
  320. package/src/stealth/human-behavior.ts +191 -0
  321. package/src/telemetry.ts +122 -0
  322. package/src/test-executor.test.ts +72 -0
  323. package/src/test-executor.ts +424 -0
  324. package/src/tls-fingerprint.ts +111 -0
  325. package/src/url-pattern-completer.ts +114 -0
  326. package/src/visual-diff-verdict.test.ts +80 -0
  327. package/src/visual-diff-verdict.ts +57 -0
  328. package/src/webhook-notifier.ts +109 -0
  329. package/src/websocket-detector.ts +83 -0
  330. package/src/worker.ts +48 -0
  331. package/tsconfig.json +13 -0
  332. package/types/accessibility-auditor.d.ts +29 -0
  333. package/types/ai-login.d.ts +32 -0
  334. package/types/auth-token-rotator.d.ts +47 -0
  335. package/types/auth.d.ts +20 -0
  336. package/types/browser-extension.d.ts +37 -0
  337. package/types/bull-worker.d.ts +6 -0
  338. package/types/captcha-solver.d.ts +16 -0
  339. package/types/color-contrast.d.ts +30 -0
  340. package/types/content-chunker.d.ts +18 -0
  341. package/types/content-dedup.d.ts +23 -0
  342. package/types/cookie-consent.d.ts +25 -0
  343. package/types/cookie-jar.d.ts +20 -0
  344. package/types/crawler.d.ts +179 -0
  345. package/types/custom-js-injector.d.ts +42 -0
  346. package/types/dark-mode-capture.d.ts +23 -0
  347. package/types/dead-link-detector.d.ts +37 -0
  348. package/types/element-hash.d.ts +9 -0
  349. package/types/email-otp.d.ts +42 -0
  350. package/types/engine-router.d.ts +47 -0
  351. package/types/export/bulk-export.d.ts +26 -0
  352. package/types/export/vector-export.d.ts +76 -0
  353. package/types/extractors/advanced.d.ts +54 -0
  354. package/types/extractors/artifact-envelope.d.ts +63 -0
  355. package/types/failure-analysis-agent.d.ts +16 -0
  356. package/types/feature-flag-detector.d.ts +30 -0
  357. package/types/form-detector.d.ts +34 -0
  358. package/types/frontier.d.ts +32 -0
  359. package/types/gap-pass.d.ts +35 -0
  360. package/types/graphql-detector.d.ts +39 -0
  361. package/types/http-engine.d.ts +80 -0
  362. package/types/incremental-diff.d.ts +59 -0
  363. package/types/index.d.ts +35 -0
  364. package/types/input-fuzzer.d.ts +30 -0
  365. package/types/interactive-probe.d.ts +104 -0
  366. package/types/job-queue.d.ts +171 -0
  367. package/types/js-coverage.d.ts +29 -0
  368. package/types/js-router-detector.d.ts +17 -0
  369. package/types/language-detector.d.ts +22 -0
  370. package/types/link-classifier.d.ts +23 -0
  371. package/types/live-view.d.ts +36 -0
  372. package/types/logger.d.ts +2 -0
  373. package/types/markdown-extract.d.ts +8 -0
  374. package/types/native-crawler.d.ts +69 -0
  375. package/types/network-observer.d.ts +49 -0
  376. package/types/network-throttle.d.ts +25 -0
  377. package/types/openapi-generator.d.ts +49 -0
  378. package/types/pdf-extractor.d.ts +28 -0
  379. package/types/performance-metrics.d.ts +53 -0
  380. package/types/phash.d.ts +38 -0
  381. package/types/pii-scrubber.d.ts +21 -0
  382. package/types/playwright-recorder.d.ts +39 -0
  383. package/types/policies/crawl-safety.d.ts +9 -0
  384. package/types/profiles/domain-profile.d.ts +19 -0
  385. package/types/proxy.d.ts +50 -0
  386. package/types/rate-limiter.d.ts +31 -0
  387. package/types/redirect-tracker.d.ts +37 -0
  388. package/types/redis-frontier.d.ts +48 -0
  389. package/types/redis-queue.d.ts +48 -0
  390. package/types/response-cache.d.ts +38 -0
  391. package/types/responsive-detector.d.ts +29 -0
  392. package/types/retry-policy.d.ts +20 -0
  393. package/types/robots-txt.d.ts +9 -0
  394. package/types/screen-reader.d.ts +16 -0
  395. package/types/screenshot-masker.d.ts +28 -0
  396. package/types/seo-checker.d.ts +33 -0
  397. package/types/session-capture.d.ts +38 -0
  398. package/types/session-export.d.ts +49 -0
  399. package/types/sitemap-writer.d.ts +21 -0
  400. package/types/sitemap.d.ts +51 -0
  401. package/types/skyvern.d.ts +56 -0
  402. package/types/sqs-queue.d.ts +2 -0
  403. package/types/sso-token.d.ts +29 -0
  404. package/types/stealth/human-behavior.d.ts +20 -0
  405. package/types/telemetry.d.ts +34 -0
  406. package/types/test-executor.d.ts +67 -0
  407. package/types/tls-fingerprint.d.ts +50 -0
  408. package/types/url-pattern-completer.d.ts +28 -0
  409. package/types/visual-diff-verdict.d.ts +40 -0
  410. package/types/webhook-notifier.d.ts +30 -0
  411. package/types/websocket-detector.d.ts +24 -0
  412. package/types/worker.d.ts +1 -0
@@ -0,0 +1,54 @@
1
+ export interface ExtractionResult {
2
+ matches: string[];
3
+ count: number;
4
+ method: string;
5
+ }
6
+ export type TableRow = Record<string, string>;
7
+ export interface PageMetadata {
8
+ title: string | null;
9
+ description: string | null;
10
+ keywords: string | null;
11
+ ogTitle: string | null;
12
+ ogDescription: string | null;
13
+ ogImage: string | null;
14
+ ogUrl: string | null;
15
+ ogType: string | null;
16
+ twitterCard: string | null;
17
+ twitterTitle: string | null;
18
+ twitterDescription: string | null;
19
+ canonical: string | null;
20
+ robots: string | null;
21
+ jsonLd: object[];
22
+ schemaTypes: string[];
23
+ lang: string | null;
24
+ }
25
+ export declare function extractByCssSelector(html: string, selector: string, attr?: string): ExtractionResult;
26
+ export declare function extractByXPath(html: string, xpath: string): ExtractionResult;
27
+ export declare function extractByRegex(text: string, pattern: string, flags?: string): ExtractionResult;
28
+ export declare function extractTables(html: string): TableRow[][];
29
+ export declare function extractMetadata(html: string, url: string): PageMetadata;
30
+ export interface ProductData {
31
+ name: string | null;
32
+ description: string | null;
33
+ brand: string | null;
34
+ sku: string | null;
35
+ price: number | null;
36
+ priceCurrency: string | null;
37
+ availability: string | null;
38
+ rating: number | null;
39
+ reviewCount: number | null;
40
+ image: string | null;
41
+ url: string | null;
42
+ }
43
+ export declare function extractStructuredProduct(jsonLd: object[]): ProductData | null;
44
+ export declare function extractImages(html: string, baseUrl: string): Array<{
45
+ src: string;
46
+ alt: string;
47
+ width?: number;
48
+ height?: number;
49
+ }>;
50
+ export declare function extractMediaFiles(html: string, baseUrl: string): Array<{
51
+ url: string;
52
+ type: 'image' | 'video' | 'audio' | 'document';
53
+ tag: string;
54
+ }>;
@@ -0,0 +1,63 @@
1
+ import type { RawElement } from '../screen-reader.js';
2
+ export interface CrawlEvidenceFact {
3
+ type: string;
4
+ payload: unknown;
5
+ }
6
+ export interface CrawlArtifactEnvelope {
7
+ tenantId: string;
8
+ projectId: string;
9
+ jobId?: string;
10
+ url: string;
11
+ canonicalUrl: string;
12
+ screenId?: string;
13
+ status: 'ok' | 'blocked' | 'auth_expired' | 'error' | 'skipped';
14
+ outputs: {
15
+ screenshot?: string;
16
+ html?: string;
17
+ markdown?: string;
18
+ fitMarkdown?: string;
19
+ accessibilityTree?: string;
20
+ structuredJson?: unknown;
21
+ networkTrace?: string;
22
+ consoleLog?: string;
23
+ };
24
+ fingerprints: {
25
+ textHash?: string;
26
+ domHash?: string;
27
+ accessibilityHash?: string;
28
+ urlCanonicalHash: string;
29
+ };
30
+ evidence: CrawlEvidenceFact[];
31
+ }
32
+ export declare function sha256(input: string): string;
33
+ export declare function buildFitMarkdown(markdown: string, keywords?: string[]): string;
34
+ export declare function summarizeStructuredElements(elements: RawElement[]): {
35
+ elementCount: number;
36
+ formFieldCount: number;
37
+ actionCount: number;
38
+ fields: {
39
+ label: string;
40
+ role: string;
41
+ expectedData: string | undefined;
42
+ }[];
43
+ actions: {
44
+ label: string;
45
+ role: string;
46
+ }[];
47
+ };
48
+ export declare function buildCrawlArtifactEnvelope(input: {
49
+ tenantId: string;
50
+ projectId: string;
51
+ jobId?: string;
52
+ url: string;
53
+ canonicalUrl: string;
54
+ screenId?: string;
55
+ screenshotPath?: string;
56
+ domPath?: string;
57
+ domContent?: string;
58
+ markdown?: string;
59
+ fitMarkdown?: string;
60
+ accessibilityElements?: RawElement[];
61
+ structuredJson?: unknown;
62
+ evidence?: CrawlEvidenceFact[];
63
+ }): CrawlArtifactEnvelope;
@@ -0,0 +1,16 @@
1
+ export interface FailureContext {
2
+ tenantId?: string;
3
+ error: string;
4
+ stepDescription?: string;
5
+ consoleLogs?: Array<{
6
+ type: string;
7
+ text: string;
8
+ }>;
9
+ networkErrors?: Array<{
10
+ url: string;
11
+ status: number;
12
+ method: string;
13
+ }>;
14
+ screenshotPath?: string;
15
+ }
16
+ export declare function analyzeFailure(ctx: FailureContext): Promise<string | null>;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Feature flag + A/B test detector.
3
+ *
4
+ * Detects popular feature flag / experiment SDKs loaded on the page:
5
+ * LaunchDarkly, Optimizely, Split.io, Unleash, GrowthBook, Statsig, Flagsmith, Amplitude Experiment.
6
+ *
7
+ * Also detects common A/B test patterns: data-testid attributes, gtm.js experiment layers,
8
+ * Optimizely variation IDs, VWO, etc.
9
+ *
10
+ * Why: ZeTa needs to know when a page shows different content to different users
11
+ * so test generation can account for variants and not generate flaky tests.
12
+ */
13
+ import type { Page } from 'playwright';
14
+ export interface FeatureFlagInfo {
15
+ sdk: string;
16
+ confidence: 'high' | 'medium' | 'low';
17
+ details?: string;
18
+ }
19
+ export interface AbTestInfo {
20
+ tool: string;
21
+ experiments?: string[];
22
+ }
23
+ export interface FeatureFlagDetectionResult {
24
+ url: string;
25
+ flagSdks: FeatureFlagInfo[];
26
+ abTools: AbTestInfo[];
27
+ hasAnyFlags: boolean;
28
+ detectedAt: string;
29
+ }
30
+ export declare function detectFeatureFlags(page: Page, url: string): Promise<FeatureFlagDetectionResult>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Form detector — extract form metadata from crawled pages.
3
+ *
4
+ * For each form found on a page, captures: action URL, method, all input fields
5
+ * with their types/names/required/validation constraints, and submit button text.
6
+ *
7
+ * This data feeds ZeTa's test generator to create form validation test cases
8
+ * automatically (happy path + boundary/error cases per field type).
9
+ */
10
+ import type { Page } from 'playwright';
11
+ export interface FormField {
12
+ name: string;
13
+ type: string;
14
+ label?: string;
15
+ required: boolean;
16
+ placeholder?: string;
17
+ minLength?: number;
18
+ maxLength?: number;
19
+ min?: string;
20
+ max?: string;
21
+ pattern?: string;
22
+ options?: string[];
23
+ autocomplete?: string;
24
+ }
25
+ export interface DetectedForm {
26
+ index: number;
27
+ action?: string;
28
+ method: string;
29
+ fields: FormField[];
30
+ submitText?: string;
31
+ hasFileUpload: boolean;
32
+ purpose: 'login' | 'search' | 'registration' | 'contact' | 'checkout' | 'settings' | 'unknown';
33
+ }
34
+ export declare function detectForms(page: Page): Promise<DetectedForm[]>;
@@ -0,0 +1,32 @@
1
+ /**
2
+ * Configurable crawl traversal strategy — matches crawl4AI's BFS/DFS/
3
+ * Best-First deep-crawl strategies (ZeTa previously had a single hardcoded
4
+ * FIFO queue, i.e. always BFS).
5
+ *
6
+ * Array-like on purpose (`length`, `shift()`, `push()`, `filter()`) so it
7
+ * drops into crawler.ts's existing queue call sites with a rename, not a
8
+ * rewrite — BFS's `shift()` behavior is byte-for-byte the same as the plain
9
+ * array it replaces, so BFS (the default) has zero behavior change.
10
+ */
11
+ export type TraversalStrategy = 'BFS' | 'DFS' | 'BEST_FIRST';
12
+ export declare class CrawlFrontier {
13
+ private items;
14
+ private readonly strategy;
15
+ private readonly keywords;
16
+ private readonly urlFilter;
17
+ constructor(strategy: TraversalStrategy, seedUrls: string[], keywords?: string[], urlFilter?: string);
18
+ get length(): number;
19
+ /**
20
+ * P3b: sparse-parent boost — if the parent page had fewer than 5 interactive
21
+ * elements (thin/canvas page), its child URLs score +1 in BEST_FIRST mode so
22
+ * the frontier revisits sparse branches before deep-linked content.
23
+ */
24
+ push(url: string, pushOpts?: {
25
+ parentElements?: number;
26
+ }): void;
27
+ /** Dequeues the next URL per this frontier's strategy. undefined if empty. */
28
+ shift(): string | undefined;
29
+ filter(predicate: (url: string) => boolean): string[];
30
+ /** Remove queued URLs not matching the regex pattern. Returns count removed. */
31
+ filterByPattern(pattern: string): number;
32
+ }
@@ -0,0 +1,35 @@
1
+ /**
2
+ * P6: Gap Pass — LLM-guided second crawl pass
3
+ *
4
+ * After the primary BFS crawl completes, this module:
5
+ * 1. Sends the discovered screen list to an LLM for gap analysis
6
+ * 2. HEAD-validates each suggested URL
7
+ * 3. Returns confirmed gap URLs for targeted re-crawl
8
+ *
9
+ * The caller (crawler.ts) is responsible for actually visiting the confirmed
10
+ * URLs with the existing browser — this module only identifies them.
11
+ */
12
+ export interface GapCandidate {
13
+ category: string;
14
+ urlPatterns: string[];
15
+ confidence: number;
16
+ rationale: string;
17
+ confirmedUrl: string | null;
18
+ headStatus: number | null;
19
+ }
20
+ interface DiscoveredScreen {
21
+ url: string;
22
+ name?: string;
23
+ elements?: number;
24
+ }
25
+ interface LlmCfg {
26
+ provider: string;
27
+ model: string;
28
+ apiKey?: string;
29
+ }
30
+ /**
31
+ * Run LLM gap analysis + HEAD validation.
32
+ * Returns candidates with `confirmedUrl` set for those where HEAD returned 200.
33
+ */
34
+ export declare function runGapAnalysis(screens: DiscoveredScreen[], appUrl: string, llmCfg: LlmCfg | null | undefined): Promise<GapCandidate[]>;
35
+ export {};
@@ -0,0 +1,39 @@
1
+ /**
2
+ * GraphQL detection + introspection.
3
+ *
4
+ * During crawl, if a GraphQL endpoint is discovered (via network observer or
5
+ * known-URL heuristics), fire a minimal introspection query to get the schema.
6
+ * The schema is stored in the crawl artifact for use during test generation.
7
+ */
8
+ export interface GqlType {
9
+ name: string;
10
+ kind: string;
11
+ fields?: Array<{
12
+ name: string;
13
+ type: string;
14
+ }>;
15
+ inputFields?: Array<{
16
+ name: string;
17
+ type: string;
18
+ }>;
19
+ enumValues?: string[];
20
+ }
21
+ export interface GqlSchema {
22
+ queryType?: string;
23
+ mutationType?: string;
24
+ subscriptionType?: string;
25
+ types: GqlType[];
26
+ }
27
+ export interface GqlIntrospectionResult {
28
+ endpoint: string;
29
+ schema: GqlSchema | null;
30
+ error?: string;
31
+ durationMs: number;
32
+ }
33
+ export declare function introspectGraphQL(endpoint: string, opts?: {
34
+ headers?: Record<string, string>;
35
+ timeoutMs?: number;
36
+ cookies?: string;
37
+ }): Promise<GqlIntrospectionResult>;
38
+ /** Guess GraphQL endpoint URLs from a known app URL. */
39
+ export declare function guessGraphQLEndpoints(appUrl: string): string[];
@@ -0,0 +1,80 @@
1
+ /**
2
+ * HTTP-only crawl engine — 10-50x faster than browser for SSR/static sites.
3
+ *
4
+ * Uses native Node.js fetch (HTTP/2), linkedom, Readability, and Turndown.
5
+ * No browser overhead. Falls back to browser engine on JS-heavy sites.
6
+ *
7
+ * Features:
8
+ * - HTTP/2 native (Node 20 built-in fetch)
9
+ * - ETag / Last-Modified response caching
10
+ * - 429 / 503 exponential backoff with jitter
11
+ * - BFS / DFS traversal
12
+ * - URL regex filtering
13
+ * - Robots.txt compliance
14
+ * - Link discovery (href, action, src)
15
+ * - Markdown extraction (Readability + Turndown)
16
+ * - OG / schema.org / meta extraction
17
+ * - Table → JSON extraction
18
+ * - JSON Lines, CSV, raw HTML output formats
19
+ * - Streaming progress via onProgress callback
20
+ */
21
+ export type HttpOutputFormat = 'json' | 'jsonlines' | 'csv' | 'markdown' | 'html';
22
+ export interface HttpScreen {
23
+ url: string;
24
+ title: string | null;
25
+ markdown: string;
26
+ html?: string;
27
+ metadata: {
28
+ description: string | null;
29
+ ogTitle: string | null;
30
+ ogDescription: string | null;
31
+ ogImage: string | null;
32
+ canonical: string | null;
33
+ schemaTypes: string[];
34
+ lang: string | null;
35
+ };
36
+ tables: Array<Record<string, string>[]>;
37
+ links: string[];
38
+ images: Array<{
39
+ src: string;
40
+ alt: string;
41
+ }>;
42
+ statusCode: number;
43
+ fromCache: boolean;
44
+ requiresBrowser?: boolean;
45
+ durationMs: number;
46
+ }
47
+ export interface HttpCrawlOpts {
48
+ appUrl: string;
49
+ maxScreens?: number;
50
+ urlFilter?: string;
51
+ traversalStrategy?: 'BFS' | 'DFS';
52
+ outputFormats?: HttpOutputFormat[];
53
+ cacheDir?: string;
54
+ userAgent?: string;
55
+ headers?: Record<string, string>;
56
+ respectRobotsTxt?: boolean;
57
+ includeRawHtml?: boolean;
58
+ timeoutMs?: number;
59
+ concurrency?: number;
60
+ onProgress?: (update: {
61
+ url: string;
62
+ screensFound: number;
63
+ total: number;
64
+ cached: boolean;
65
+ }) => void;
66
+ }
67
+ export interface HttpCrawlResult {
68
+ screens: HttpScreen[];
69
+ stats: {
70
+ total: number;
71
+ cached: number;
72
+ errors: number;
73
+ rateLimited: number;
74
+ durationMs: number;
75
+ cacheHitRate: number;
76
+ };
77
+ jsonLines?: string;
78
+ csv?: string;
79
+ }
80
+ export declare function httpCrawl(opts: HttpCrawlOpts): Promise<HttpCrawlResult>;
@@ -0,0 +1,59 @@
1
+ /**
2
+ * Incremental crawl diff — compute stable content hashes and skip unchanged screens.
3
+ *
4
+ * Each crawled page gets a content fingerprint (murmurhash-free, pure JS).
5
+ * On the next crawl of the same project, pages with the same fingerprint are
6
+ * marked SKIPPED instead of re-processed, drastically reducing crawl time and
7
+ * LLM token spend for sites with mostly-static content.
8
+ *
9
+ * Design: "same content hash" means the meaningful text hasn't changed.
10
+ * Layout/CSS/JS changes that don't affect visible text are ignored intentionally.
11
+ */
12
+ export interface ContentHash {
13
+ url: string;
14
+ hash: string;
15
+ textLength: number;
16
+ computedAt: string;
17
+ }
18
+ export interface DiffResult {
19
+ url: string;
20
+ changed: boolean;
21
+ previousHash?: string;
22
+ currentHash: string;
23
+ reason: 'new' | 'changed' | 'unchanged';
24
+ }
25
+ /**
26
+ * Compute a stable 64-bit-ish hash from text content.
27
+ * djb2 variant — fast, no deps, collision-resistant enough for content fingerprinting.
28
+ */
29
+ export declare function hashContent(text: string): string;
30
+ /**
31
+ * Normalize text before hashing — strips whitespace-only lines, trims each line,
32
+ * collapses runs of blank lines. Makes hash stable across minor formatting changes.
33
+ */
34
+ export declare function normalizeText(text: string): string;
35
+ export declare function computeContentHash(url: string, markdownText: string): ContentHash;
36
+ /**
37
+ * Compare a page's current content against prior hashes.
38
+ * Returns { changed: false } for unchanged pages — caller should skip re-processing.
39
+ */
40
+ export declare function diffContent(url: string, currentMarkdown: string, priorHashes: Map<string, string>): DiffResult;
41
+ /**
42
+ * Build a hash map from prior screen records (from DB query result).
43
+ * screenRecords: Array<{ url: string; elementHash?: string | null }>
44
+ */
45
+ export declare function buildPriorHashMap(screenRecords: Array<{
46
+ url: string;
47
+ elementHash?: string | null;
48
+ }>): Map<string, string>;
49
+ /**
50
+ * Filter a batch of discovered URLs against prior hashes.
51
+ * Returns { toProcess, toSkip } — caller enqueues toProcess, logs toSkip count.
52
+ *
53
+ * Note: filtering at URL level only works if the prior crawl already visited the URL.
54
+ * For new URLs, they're always in toProcess.
55
+ */
56
+ export declare function partitionByChange(urls: string[], priorHashes: Map<string, string>): {
57
+ toProcess: string[];
58
+ toSkip: string[];
59
+ };
@@ -0,0 +1,35 @@
1
+ export * from './crawler.js';
2
+ export * from './visual-diff-verdict.js';
3
+ export * from './auth.js';
4
+ export * from './screen-reader.js';
5
+ export * from './job-queue.js';
6
+ export { startSqsWorker } from './sqs-queue.js';
7
+ export * from './session-capture.js';
8
+ export * from './session-export.js';
9
+ export * from './test-executor.js';
10
+ export { startLiveView, getFrame, liveViewNavigate, completeLiveView, closeLiveView, sendInput } from './live-view.js';
11
+ export { waitForEmailOTP, getInboxEmail } from './email-otp.js';
12
+ export { getSsoToken, getSsoClientCredentialsToken } from './sso-token.js';
13
+ export type { SsoConfig, SsoProvider } from './sso-token.js';
14
+ export * from './engine-router.js';
15
+ export * from './profiles/domain-profile.js';
16
+ export * from './policies/crawl-safety.js';
17
+ export * from './extractors/artifact-envelope.js';
18
+ export * from './network-observer.js';
19
+ export { createChromeTlsAgent, probeTlsFingerprint, chromeTlsAgent, CHROME_TLS_HEADERS } from './tls-fingerprint.js';
20
+ export type { TlsFingerprintOptions } from './tls-fingerprint.js';
21
+ export { prepareExtensionProfile, adBlockerProfile } from './browser-extension.js';
22
+ export type { ExtensionSource, ExtensionProfile } from './browser-extension.js';
23
+ export { createRedisQueue, maybeCreateRedisQueue, isRedisQueueEnabled } from './redis-queue.js';
24
+ export type { RedisQueueJob, RedisQueueClient } from './redis-queue.js';
25
+ export { discoverProjectUrls, discoverSitemapUrls } from './sitemap.js';
26
+ export type { UrlCandidate } from './sitemap.js';
27
+ export { httpCrawl } from './http-engine.js';
28
+ export { extractMarkdown } from './markdown-extract.js';
29
+ export type { ExtractedMarkdown } from './markdown-extract.js';
30
+ export type { HttpScreen, HttpCrawlOpts, HttpCrawlResult, HttpOutputFormat } from './http-engine.js';
31
+ export { TieredProxyManager } from './proxy.js';
32
+ export type { ProxyTier, ProxyTierConfig } from './proxy.js';
33
+ export { RedisCrawlFrontier, isRedisFrontierEnabled } from './redis-frontier.js';
34
+ export { startSpan, endSpan, withSpan, increment, flushMetrics } from './telemetry.js';
35
+ export type { Span, FinishedSpan } from './telemetry.js';
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Input fuzzer — generate test data for form fields.
3
+ *
4
+ * For each field type, produces a set of test values covering:
5
+ * - Happy path (valid, normal input)
6
+ * - Boundary (min/max length, min/max value)
7
+ * - Edge cases (empty, very long, special chars, SQL injection probe, XSS probe)
8
+ * - Type-invalid (wrong type for the field)
9
+ *
10
+ * This feeds ZeTa's test generator to automatically create form validation tests.
11
+ * Values are safe probes (NOT actual exploits) — they test whether the app
12
+ * properly rejects/accepts boundary inputs.
13
+ */
14
+ import type { FormField } from './form-detector.js';
15
+ export type InputCase = {
16
+ label: string;
17
+ value: string;
18
+ expectedValid: boolean;
19
+ category: 'happy' | 'boundary' | 'edge' | 'invalid';
20
+ };
21
+ export declare function generateFieldCases(field: FormField): InputCase[];
22
+ export interface FuzzedForm {
23
+ formIndex: number;
24
+ purpose: string;
25
+ fieldCases: Array<{
26
+ field: FormField;
27
+ cases: InputCase[];
28
+ }>;
29
+ }
30
+ export declare function fuzzForm(form: import('./form-detector.js').DetectedForm): FuzzedForm;
@@ -0,0 +1,104 @@
1
+ /**
2
+ * Interactive Probe — Phase 2 Dynamic Observation
3
+ *
4
+ * The static crawl captures DOM structure at rest. This module runs AFTER the static crawl
5
+ * to observe dynamic behaviour by actually interacting with the UI:
6
+ *
7
+ * 1. Empty submit → captures required-field validation error messages
8
+ * 2. Invalid format → captures format validation errors (bad email, short password)
9
+ * 3. Button clicks → captures modal/dialog contents
10
+ * 4. Select changes → captures conditional reveals (show/hide logic)
11
+ * 5. Success paths → captures toast/banner messages (where input is safe)
12
+ *
13
+ * Results are stored as KnowledgeChunks (sourceType='probe') and update the
14
+ * ERROR_CATALOGUE + INTERACTION_PATTERNS skill files with real observed data
15
+ * instead of LLM inference.
16
+ *
17
+ * Call signature: probeScreen(page, screenId, elements, opts)
18
+ * Called from crawlProject() after static element extraction when opts.interactive=true.
19
+ */
20
+ import type { Page } from 'playwright';
21
+ export interface ProbeElementFact {
22
+ meaning: string;
23
+ role: string;
24
+ expectedData?: string;
25
+ }
26
+ export interface ValidationError {
27
+ field: string;
28
+ trigger: 'empty_submit' | 'invalid_format' | 'boundary';
29
+ errorText: string;
30
+ }
31
+ export interface SuccessMessage {
32
+ type: 'toast' | 'inline_success' | 'redirect';
33
+ content: string;
34
+ }
35
+ export interface ModalObservation {
36
+ triggerElement: string;
37
+ title: string;
38
+ content: string;
39
+ fields: string[];
40
+ }
41
+ export interface ConditionalReveal {
42
+ triggerElement: string;
43
+ triggerValue: string;
44
+ revealedText: string;
45
+ }
46
+ export interface ProbeResult {
47
+ screenId: string;
48
+ url: string;
49
+ validationErrors: ValidationError[];
50
+ successMessages: SuccessMessage[];
51
+ modals: ModalObservation[];
52
+ conditionals: ConditionalReveal[];
53
+ loadingPatterns: string[];
54
+ }
55
+ /**
56
+ * Run interactive probing on a single screen page.
57
+ * The page must already be navigated to the screen URL.
58
+ * `elements` is the output of the static extractElements pass.
59
+ */
60
+ export declare function probeScreen(page: Page, screenId: string, url: string, elements: ProbeElementFact[]): Promise<ProbeResult>;
61
+ /** Phase 5: Convert ProbeResult to typed ProbeObservationFact rows for direct DB storage. */
62
+ export declare function probeResultToObservations(result: ProbeResult): Array<{
63
+ elementMeaning: string;
64
+ observationType: string;
65
+ observedText: string;
66
+ triggeredBy: string;
67
+ }>;
68
+ /**
69
+ * Convert a ProbeResult into markdown to store as KnowledgeChunks
70
+ * and update ERROR_CATALOGUE + INTERACTION_PATTERNS skill files.
71
+ */
72
+ export declare function probeResultToMarkdown(result: ProbeResult): {
73
+ errorCatalogueChunk: string;
74
+ interactionPatternsChunk: string;
75
+ };
76
+ /**
77
+ * Run interactive probing for all screens discovered in a crawl session.
78
+ * Called from crawlProject() when opts.interactive = true.
79
+ */
80
+ export declare function probeAllScreens(page: any, tenantId: string, projectId: string, discovered: Array<{
81
+ url: string;
82
+ screenId?: string;
83
+ elements?: any[];
84
+ }>, onProgress?: (pct: number, step: string) => Promise<void>): Promise<void>;
85
+ export interface FocusableElement {
86
+ tag: string;
87
+ role: string | null;
88
+ ariaLabel: string | null;
89
+ text: string | null;
90
+ hasFocusIndicator: boolean;
91
+ tabIndex: number | null;
92
+ }
93
+ export interface KeyboardNavResult {
94
+ focusableCount: number;
95
+ elementsWithNoFocusIndicator: number;
96
+ sequence: FocusableElement[];
97
+ issues: string[];
98
+ }
99
+ /**
100
+ * Probe keyboard navigation accessibility by pressing Tab up to 50 times and
101
+ * recording each focused element's properties and focus-indicator visibility.
102
+ * Stops early if focus wraps back to the start or hits the same element twice.
103
+ */
104
+ export declare function probeKeyboardNav(page: Page): Promise<KeyboardNavResult>;