@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,39 @@
1
+ /**
2
+ * Playwright test recorder — generate Playwright test code from crawl data.
3
+ *
4
+ * Given a list of crawled screens, generates a minimal Playwright test file that:
5
+ * 1. Navigates to each screen URL
6
+ * 2. Verifies the page title
7
+ * 3. Checks key elements visible on the page
8
+ * 4. Verifies no console errors (optional)
9
+ *
10
+ * This is a "smoke test" generator — not a full interaction recorder.
11
+ * Output: valid TypeScript Playwright test file ready to run with npx playwright test.
12
+ */
13
+ export interface RecorderScreen {
14
+ id: string;
15
+ name: string;
16
+ url: string;
17
+ title?: string;
18
+ heading?: string;
19
+ markdownWordCount?: number;
20
+ smartLocator?: {
21
+ tag: string;
22
+ text?: string;
23
+ role?: string;
24
+ placeholder?: string;
25
+ nearText?: string;
26
+ };
27
+ }
28
+ export interface RecorderOpts {
29
+ baseUrl?: string;
30
+ includeConsoleCheck?: boolean;
31
+ testTimeout?: number;
32
+ projectName?: string;
33
+ useSmartLocators?: boolean;
34
+ }
35
+ export declare function generatePlaywrightTest(screens: RecorderScreen[], opts?: RecorderOpts): string;
36
+ export declare function generatePlaywrightConfig(opts?: {
37
+ baseUrl?: string;
38
+ reportDir?: string;
39
+ }): string;
@@ -0,0 +1,9 @@
1
+ import type { DomainProfile } from '../profiles/domain-profile.js';
2
+ export interface CrawlSafetyDecision {
3
+ allowed: boolean;
4
+ reason?: string;
5
+ severity: 'info' | 'warn' | 'block';
6
+ }
7
+ export declare function assessActionSafety(label: string, profile: DomainProfile): CrawlSafetyDecision;
8
+ export declare function redactSensitiveValue(value: string): string;
9
+ export declare function redactJson(value: unknown): unknown;
@@ -0,0 +1,19 @@
1
+ export type Industry = 'ecommerce' | 'banking' | 'fintech' | 'healthcare' | 'pharma' | 'agriculture' | 'legacy-enterprise' | 'saas' | 'unknown';
2
+ export interface DomainProfile {
3
+ industry: Industry;
4
+ confidence: number;
5
+ importantScreenPatterns: string[];
6
+ workflowGoals: string[];
7
+ piiRules: string[];
8
+ riskyActions: string[];
9
+ safeProbeRules: string[];
10
+ requiredArtifacts: string[];
11
+ evidence: string[];
12
+ }
13
+ export declare function classifyDomainProfile(input: {
14
+ appUrl: string;
15
+ projectName?: string | null;
16
+ appType?: string | null;
17
+ seedText?: string;
18
+ }): DomainProfile;
19
+ export declare function getProfile(industry: Industry): DomainProfile;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Free proxy auto-selection for bot-protection bypass.
3
+ *
4
+ * Source: proxifly/free-proxy-list (MIT) via jsDelivr CDN.
5
+ * These are datacenter proxies — they bypass simple IP blocks but NOT
6
+ * full Cloudflare Bot Manager / Akamai. For Cloudflare-protected sites,
7
+ * users need a residential proxy (Bright Data, Oxylabs, etc.).
8
+ */
9
+ /**
10
+ * Pick a working free proxy. Tests in parallel batches of 10 with a 4s timeout.
11
+ * Returns null if no working proxy found (not an error — crawl can proceed without proxy).
12
+ */
13
+ export declare function pickFreeProxy(): Promise<string | null>;
14
+ export type ProxyTier = 'free' | 'datacenter' | 'residential' | 'premium';
15
+ export interface ProxyTierConfig {
16
+ /** List of proxy URLs for this tier. E.g. ['http://user:pass@dc1.proxy:8080'] */
17
+ urls: string[];
18
+ tier: ProxyTier;
19
+ }
20
+ /**
21
+ * Tiered proxy manager with per-domain error histograms.
22
+ *
23
+ * Tracks success/failure per domain and automatically escalates to higher proxy tiers
24
+ * on consecutive failures. Applies time-decay to probe returning to lower tiers.
25
+ *
26
+ * Usage:
27
+ * const mgr = new TieredProxyManager([{ tier: 'datacenter', urls: [...] }]);
28
+ * const proxy = await mgr.selectProxy('api.salesforce.com');
29
+ * // ... make request ...
30
+ * mgr.recordResult('api.salesforce.com', success);
31
+ */
32
+ export declare class TieredProxyManager {
33
+ private tiers;
34
+ private domainHistory;
35
+ private readonly ESCALATE_AFTER;
36
+ private readonly DECAY_AFTER_MS;
37
+ constructor(configs: ProxyTierConfig[]);
38
+ private getHistory;
39
+ private lowestAvailableTier;
40
+ /** Pick a proxy URL for this domain, based on its tier history. */
41
+ selectProxy(domain: string): string | null;
42
+ /** Record a request result for a domain. Triggers tier escalation on repeated failures. */
43
+ recordResult(domain: string, success: boolean): void;
44
+ stats(): Array<{
45
+ domain: string;
46
+ tier: ProxyTier;
47
+ successRate: number;
48
+ totalRequests: number;
49
+ }>;
50
+ }
@@ -0,0 +1,31 @@
1
+ /**
2
+ * Domain-aware rate limiter — ensures the crawler respects per-domain rate limits.
3
+ *
4
+ * Uses a token bucket algorithm per domain. When the bucket is empty, requests
5
+ * wait until a token is available. Tokens refill at a configurable rate.
6
+ *
7
+ * Default: 2 requests/second per domain, burst of 5.
8
+ * Can be configured per-domain via the rateMap (domain → requests/second).
9
+ */
10
+ export interface RateLimiterOpts {
11
+ defaultRps?: number;
12
+ burstSize?: number;
13
+ rateMap?: Record<string, number>;
14
+ }
15
+ export declare class DomainRateLimiter {
16
+ private buckets;
17
+ private readonly defaultRps;
18
+ private readonly burstSize;
19
+ private readonly rateMap;
20
+ constructor(opts?: RateLimiterOpts);
21
+ private getBucket;
22
+ private refill;
23
+ /** Wait until a token is available for the given URL's domain. */
24
+ throttle(url: string): Promise<void>;
25
+ /** Override rate for a specific domain at runtime (e.g. after seeing 429). */
26
+ setRate(domain: string, rps: number): void;
27
+ stats(): Record<string, {
28
+ tokens: number;
29
+ rps: number;
30
+ }>;
31
+ }
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Redirect chain tracker — records the full redirect chain for crawled URLs.
3
+ *
4
+ * Why: redirect chains (A→B→C) slow down pages; circular redirects crash crawlers;
5
+ * redirect loops indicate config errors. ZeTa records chains for SEO/perf audit.
6
+ *
7
+ * Integration: hook into Playwright's page.on('response') to see each redirect hop.
8
+ */
9
+ export interface RedirectHop {
10
+ from: string;
11
+ to: string;
12
+ statusCode: number;
13
+ durationMs: number;
14
+ }
15
+ export interface RedirectChain {
16
+ originalUrl: string;
17
+ finalUrl: string;
18
+ hops: RedirectHop[];
19
+ isCircular: boolean;
20
+ hopCount: number;
21
+ totalDurationMs: number;
22
+ }
23
+ import type { Page } from 'playwright';
24
+ export declare function trackRedirects(page: Page, url: string): Promise<RedirectChain>;
25
+ export declare class RedirectRegistry {
26
+ private chains;
27
+ register(chain: RedirectChain): void;
28
+ get(url: string): RedirectChain | undefined;
29
+ getAll(): RedirectChain[];
30
+ getProblematic(): RedirectChain[];
31
+ stats(): {
32
+ total: number;
33
+ withRedirects: number;
34
+ circular: number;
35
+ deepChains: number;
36
+ };
37
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Redis-backed distributed crawl frontier.
3
+ *
4
+ * Replaces the in-memory CrawlFrontier for horizontally-scaled crawler deployments.
5
+ * Multiple crawler workers on different containers can share the same URL queue for
6
+ * a given job — enabling 10x crawl throughput on large enterprise apps.
7
+ *
8
+ * Redis key namespace: zeta:frontier:{jobId}
9
+ * LIST zeta:frontier:{jobId}:queue — BFS queue (LPUSH/RPOP)
10
+ * SET zeta:frontier:{jobId}:visited — deduplication set
11
+ * EXPIRE — 24h TTL on all keys
12
+ *
13
+ * Graceful fallback: if REDIS_URL is not set, RedisCrawlFrontier silently falls
14
+ * back to in-memory arrays so local development works without Redis.
15
+ */
16
+ export declare class RedisCrawlFrontier {
17
+ private readonly jobId;
18
+ private redis;
19
+ private queueKey;
20
+ private visitedKey;
21
+ private inMemoryQueue;
22
+ private inMemoryVisited;
23
+ private useRedis;
24
+ constructor(jobId: string);
25
+ init(): Promise<void>;
26
+ /** Add a URL to the frontier. No-op if already visited. Returns true if added. */
27
+ push(url: string): Promise<boolean>;
28
+ /** Pop the next URL (FIFO/BFS). Returns null if queue empty. */
29
+ shift(): Promise<string | null>;
30
+ /** Check if a URL has already been visited/queued. */
31
+ hasVisited(url: string): Promise<boolean>;
32
+ /** Current queue length. */
33
+ length(): Promise<number>;
34
+ /** Total visited count. */
35
+ visitedCount(): Promise<number>;
36
+ /** Seed initial URLs (used at job start). */
37
+ seed(urls: string[]): Promise<void>;
38
+ /** Clean up all Redis keys for this frontier. Call at job completion. */
39
+ cleanup(): Promise<void>;
40
+ /** Stats for monitoring. */
41
+ stats(): Promise<{
42
+ backend: 'redis' | 'memory';
43
+ queued: number;
44
+ visited: number;
45
+ }>;
46
+ }
47
+ /** Check if Redis is configured for distributed frontier. */
48
+ export declare function isRedisFrontierEnabled(): boolean;
@@ -0,0 +1,48 @@
1
+ /**
2
+ * Redis Streams distributed job queue.
3
+ *
4
+ * Provides horizontal crawler scaling via Redis Streams consumer groups.
5
+ * Multiple crawler nodes can pull from the same stream — each job is
6
+ * delivered to exactly one consumer (at-least-once via ACK/PENDING).
7
+ *
8
+ * Used when REDIS_URL is set AND JOB_QUEUE_BACKEND=redis.
9
+ * Falls back to the Postgres-backed queue when Redis is unavailable.
10
+ *
11
+ * Stream key: zeta:crawl:stream
12
+ * Group name: zeta:crawl:workers
13
+ * Consumer id: zeta:worker:<hostname>:<pid>
14
+ */
15
+ export interface RedisQueueJob {
16
+ id: string;
17
+ jobId: string;
18
+ tenantId: string;
19
+ projectId: string;
20
+ payload: Record<string, unknown>;
21
+ enqueuedAt: string;
22
+ }
23
+ export interface RedisQueueClient {
24
+ enqueue(jobId: string, tenantId: string, projectId: string, payload?: Record<string, unknown>): Promise<string>;
25
+ dequeue(timeoutMs?: number): Promise<RedisQueueJob | null>;
26
+ ack(streamEntryId: string): Promise<void>;
27
+ nack(streamEntryId: string): Promise<void>;
28
+ reclaimStale(maxIdleMs?: number): Promise<RedisQueueJob[]>;
29
+ stats(): Promise<{
30
+ pending: number;
31
+ delivered: number;
32
+ groupLag: number;
33
+ }>;
34
+ close(): Promise<void>;
35
+ }
36
+ /**
37
+ * Create a Redis Streams job queue client.
38
+ * Throws if REDIS_URL is not set.
39
+ */
40
+ export declare function createRedisQueue(): Promise<RedisQueueClient>;
41
+ /**
42
+ * Check if Redis queue backend is configured.
43
+ */
44
+ export declare function isRedisQueueEnabled(): boolean;
45
+ /**
46
+ * Convenience: create queue only if enabled, else return null.
47
+ */
48
+ export declare function maybeCreateRedisQueue(): Promise<RedisQueueClient | null>;
@@ -0,0 +1,38 @@
1
+ export interface ResponseCacheEntry {
2
+ url: string;
3
+ etag?: string;
4
+ lastModified?: string;
5
+ cacheControl?: string;
6
+ body: string;
7
+ contentType: string;
8
+ statusCode: number;
9
+ cachedAt: number;
10
+ hitCount: number;
11
+ }
12
+ export declare class ResponseCache {
13
+ private readonly dir;
14
+ private totalHits;
15
+ private totalRequests;
16
+ constructor(cacheDir: string);
17
+ private key;
18
+ private path;
19
+ get(url: string): ResponseCacheEntry | null;
20
+ private read;
21
+ isFresh(url: string): boolean;
22
+ staleIfError(url: string): boolean;
23
+ set(url: string, entry: Omit<ResponseCacheEntry, 'cachedAt' | 'hitCount'>): void;
24
+ getValidationHeaders(url: string): {
25
+ 'If-None-Match'?: string;
26
+ 'If-Modified-Since'?: string;
27
+ };
28
+ markHit(url: string): void;
29
+ invalidate(url: string): void;
30
+ clear(): void;
31
+ stats(): {
32
+ entries: number;
33
+ totalSizeBytes: number;
34
+ hitRate: number;
35
+ totalHits: number;
36
+ };
37
+ prune(maxAgeMs: number): number;
38
+ }
@@ -0,0 +1,29 @@
1
+ /**
2
+ * Responsive design detector — captures page at multiple breakpoints
3
+ * and detects layout differences between desktop and mobile viewports.
4
+ *
5
+ * Breakpoints: mobile(375), tablet(768), desktop(1280), wide(1920)
6
+ * Detects: viewport-specific content visibility, menu collapse state,
7
+ * font size changes, hidden/shown elements.
8
+ */
9
+ import type { Page } from 'playwright';
10
+ export interface ViewportCapture {
11
+ width: number;
12
+ height: number;
13
+ label: 'mobile' | 'tablet' | 'desktop' | 'wide';
14
+ screenshotBuffer?: Buffer;
15
+ visibleTextLength: number;
16
+ hasHamburgerMenu: boolean;
17
+ hiddenElements: number;
18
+ scrollHeight: number;
19
+ }
20
+ export interface ResponsiveReport {
21
+ url: string;
22
+ captures: ViewportCapture[];
23
+ isResponsive: boolean;
24
+ hasMobileMenu: boolean;
25
+ issues: string[];
26
+ }
27
+ export declare function detectResponsive(page: Page, url: string, opts?: {
28
+ captureScreenshots?: boolean;
29
+ }): Promise<ResponsiveReport>;
@@ -0,0 +1,20 @@
1
+ /**
2
+ * Retry policy — configurable exponential backoff with jitter.
3
+ * Covers: 5xx server errors, network timeouts, ECONNREFUSED, ECONNRESET.
4
+ * NOT retried: 4xx client errors (except 429 — handled separately), redirects.
5
+ */
6
+ export interface RetryPolicyOpts {
7
+ maxRetries?: number;
8
+ baseDelayMs?: number;
9
+ maxDelayMs?: number;
10
+ jitterMs?: number;
11
+ retryOn?: number[];
12
+ }
13
+ export interface RetryResult<T> {
14
+ value: T;
15
+ attempts: number;
16
+ totalDelayMs: number;
17
+ }
18
+ export declare function withRetry<T>(fn: (attempt: number) => Promise<T>, opts?: RetryPolicyOpts): Promise<RetryResult<T>>;
19
+ /** Wraps fetch() with retry policy */
20
+ export declare function fetchWithRetry(url: string, init?: RequestInit, retryOpts?: RetryPolicyOpts): Promise<Response>;
@@ -0,0 +1,9 @@
1
+ /**
2
+ * Minimal robots.txt fetcher + parser. No external deps. Caches per origin.
3
+ * Implements the subset of robots.txt spec used in practice:
4
+ * User-agent, Disallow, Allow — longest match wins (RFC 9309).
5
+ */
6
+ export declare class RobotsCache {
7
+ private readonly cache;
8
+ isAllowed(url: string, userAgent?: string): Promise<boolean>;
9
+ }
@@ -0,0 +1,16 @@
1
+ import type { Page } from 'playwright';
2
+ /**
3
+ * Reads a page as a structured outline (cheap + reliable), the way
4
+ * Playwright MCP / the accessibility tree works — NOT by sending pixels to a
5
+ * vision model. Vision is a fallback for image-only pages (added later).
6
+ *
7
+ * Returns the interactive elements found, which the Screen Reader Agent then
8
+ * enriches with MEANING and saves to the Zeta Core.
9
+ */
10
+ export interface RawElement {
11
+ role: string;
12
+ label: string;
13
+ selectorHint: string;
14
+ expectedData?: string;
15
+ }
16
+ export declare function readScreen(page: Page): Promise<RawElement[]>;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * Screenshot masker — blur or black-box PII regions in captured screenshots.
3
+ *
4
+ * Strategy: inject a CSS overlay into the page before screenshot capture that
5
+ * covers detected PII-likely elements (input[type=email], input[type=password],
6
+ * elements with PII-containing text) with a blur or solid black mask.
7
+ *
8
+ * This is a CSS-based approach (no image processing library needed):
9
+ * 1. Identify likely-PII DOM elements via selectors
10
+ * 2. Add an overlaid <div> with blur/black filter at each element's bounding box
11
+ * 3. Take screenshot
12
+ * 4. Remove overlays
13
+ *
14
+ * Falls back gracefully if elements are not found or overlay injection fails.
15
+ */
16
+ import type { Page } from 'playwright';
17
+ export interface MaskingOpts {
18
+ /** Additional CSS selectors to mask (in addition to defaults) */
19
+ extraSelectors?: string[];
20
+ /** Masking style: 'blur' or 'blackout' */
21
+ style?: 'blur' | 'blackout';
22
+ /** Blur strength in px (default 8) */
23
+ blurPx?: number;
24
+ }
25
+ export declare function maskScreenshot(page: Page, opts?: MaskingOpts): Promise<{
26
+ maskedCount: number;
27
+ screenshot: Buffer;
28
+ }>;
@@ -0,0 +1,33 @@
1
+ /**
2
+ * SEO indexability checker — determines if a page is crawlable and indexable.
3
+ *
4
+ * Checks:
5
+ * 1. X-Robots-Tag response header (noindex, nofollow, noarchive)
6
+ * 2. <meta name="robots"> tag (noindex, nofollow)
7
+ * 3. Canonical URL (self-canonical vs cross-canonical)
8
+ * 4. rel="nofollow" on outbound links
9
+ * 5. hreflang tags (multilingual)
10
+ * 6. Open Graph completeness (og:title, og:description, og:image)
11
+ * 7. Structured data presence (JSON-LD)
12
+ * 8. Meta description
13
+ * 9. Title tag length (< 60 chars recommended)
14
+ * 10. URL structure (query params, fragments, excessive depth)
15
+ */
16
+ import type { Page } from 'playwright';
17
+ export interface SeoIssue {
18
+ rule: string;
19
+ severity: 'critical' | 'warning' | 'info';
20
+ message: string;
21
+ value?: string;
22
+ }
23
+ export interface SeoCheckResult {
24
+ url: string;
25
+ isIndexable: boolean;
26
+ canonicalUrl?: string;
27
+ isSelfCanonical?: boolean;
28
+ hreflang: Record<string, string>;
29
+ issues: SeoIssue[];
30
+ score: number;
31
+ checkedAt: string;
32
+ }
33
+ export declare function checkSeo(page: Page, url: string, responseHeaders?: Record<string, string>): Promise<SeoCheckResult>;
@@ -0,0 +1,38 @@
1
+ /**
2
+ * Opens a headed (visible) browser at appUrl and returns a captureId.
3
+ * The user logs in manually, then calls completeSessionCapture() to harvest storageState.
4
+ * Sessions expire after 10 minutes if not completed.
5
+ *
6
+ * Throws 'HEADLESS_ENV' if running in Docker/Linux without a display server.
7
+ * The API route surfaces this as a 503 so the frontend can switch to manual JSON paste.
8
+ */
9
+ export declare function startSessionCapture(appUrl: string): Promise<string>;
10
+ /** Captures storageState from the open browser, closes it, and returns the JSON string. */
11
+ export declare function completeSessionCapture(captureId: string): Promise<string>;
12
+ /** Closes the browser without capturing — called on Cancel. */
13
+ export declare function cancelSessionCapture(captureId: string): Promise<void>;
14
+ /**
15
+ * Headless login + session capture — works on Docker/cloud (no display needed).
16
+ * Tries DOM-based login first (fast, free). If it fails and llmConfig is provided,
17
+ * falls back to Stagehand AI-guided login (handles modals, multi-step, marketing pages).
18
+ *
19
+ * Returns { storageState, cookies, localStorage } on success.
20
+ * Throws a human-readable error on failure.
21
+ */
22
+ export declare function validateAndCaptureSession(appUrl: string, creds: {
23
+ username: string;
24
+ password: string;
25
+ totpSecret?: string;
26
+ httpBasicUsername?: string;
27
+ httpBasicPassword?: string;
28
+ }, llmConfig?: {
29
+ modelName: string;
30
+ apiKey: string;
31
+ }, captchaOpts?: {
32
+ apiKey?: string;
33
+ provider?: '2captcha' | 'capsolver';
34
+ }): Promise<{
35
+ storageState: string;
36
+ cookies: number;
37
+ localStorage: number;
38
+ }>;
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Converts a Playwright storageState (the format ZeTa already captures via
3
+ * session-capture.ts/live-view.ts and stores per-project) into snippets for
4
+ * other automation frameworks. Playwright's storageState is the de-facto
5
+ * standard for browser session export — see docs/UNIVERSAL-SESSION-CAPTURE-
6
+ * STRATEGY.md — so every other framework's import mechanism is a small,
7
+ * mechanical conversion away, not a new capture flow.
8
+ *
9
+ * Pure, dependency-free functions — no I/O, no network, fully unit-testable.
10
+ */
11
+ export interface StorageStateCookie {
12
+ name: string;
13
+ value: string;
14
+ domain: string;
15
+ path: string;
16
+ expires?: number;
17
+ httpOnly?: boolean;
18
+ secure?: boolean;
19
+ sameSite?: 'Strict' | 'Lax' | 'None';
20
+ }
21
+ export interface StorageStateOrigin {
22
+ origin: string;
23
+ localStorage: Array<{
24
+ name: string;
25
+ value: string;
26
+ }>;
27
+ }
28
+ export interface StorageState {
29
+ cookies: StorageStateCookie[];
30
+ origins: StorageStateOrigin[];
31
+ }
32
+ export type SessionExportFormat = 'cypress' | 'selenium-python' | 'webdriverio';
33
+ /** cy.setCookie() + localStorage.setItem() inside a reusable custom command,
34
+ * following Cypress's documented cy.session() pattern (see references in
35
+ * docs/UNIVERSAL-SESSION-CAPTURE-STRATEGY.md). */
36
+ export declare function toCypressSnippet(state: StorageState): string;
37
+ /** driver.add_cookie() (Selenium requires the browser already be on the
38
+ * cookie's domain before adding it) + execute_script() for localStorage,
39
+ * per Selenium's documented Cookie API. */
40
+ export declare function toSeleniumPythonDict(state: StorageState): string;
41
+ /** browser.setCookies() accepts an array shape very close to Playwright's own
42
+ * cookie objects (per WebdriverIO's documented API) — closest 1:1 mapping
43
+ * of the three target formats. */
44
+ export declare function toWebdriverIOSnippet(state: StorageState): string;
45
+ export declare function exportSessionAs(format: SessionExportFormat, state: StorageState): {
46
+ content: string;
47
+ filename: string;
48
+ mimeType: string;
49
+ };
@@ -0,0 +1,21 @@
1
+ /**
2
+ * Sitemap writer — generate XML sitemap from crawled screens.
3
+ *
4
+ * Compliant with sitemaps.org protocol (sitemap index + individual sitemap files).
5
+ * Splits into 50k-URL files per the spec when needed.
6
+ * Used for: SEO audit export, future crawl seed, and crawler/robots.txt comparison.
7
+ */
8
+ export interface SitemapUrl {
9
+ loc: string;
10
+ lastmod?: string;
11
+ changefreq?: 'always' | 'hourly' | 'daily' | 'weekly' | 'monthly' | 'yearly' | 'never';
12
+ priority?: number;
13
+ }
14
+ export declare function writeSitemap(urls: SitemapUrl[], outputPath: string): Promise<void>;
15
+ /** Convert crawled screen records to SitemapUrl objects */
16
+ export declare function screensToSitemapUrls(screens: Array<{
17
+ url: string;
18
+ updatedAt?: Date;
19
+ depth?: number;
20
+ }>): SitemapUrl[];
21
+ export declare function buildSitemapString(urls: SitemapUrl[]): string;
@@ -0,0 +1,51 @@
1
+ import { ProxyAgent } from 'undici';
2
+ /**
3
+ * Same-site check that tolerates www/non-www and http/https differences — a sitemap on
4
+ * `vercel.com` is valid for a project pointed at `www.vercel.com` (and vice versa).
5
+ */
6
+ export declare function sameSite(candidateUrl: string, siteOrigin: string): boolean;
7
+ /**
8
+ * Pulls page URLs and sub-sitemap URLs out of an already-XML-parsed sitemap
9
+ * document (either a <urlset> or a <sitemapindex>), filtered to same-origin
10
+ * and deduped. Pure function — no I/O — for direct unit testing without a
11
+ * real HTTP fetch.
12
+ */
13
+ export declare function extractUrlsFromParsedSitemap(parsed: any, origin: string): {
14
+ pageUrls: string[];
15
+ subSitemapUrls: string[];
16
+ };
17
+ /**
18
+ * Fetches and parses a sitemap (or sitemap index, recursed up to a small
19
+ * depth) into a flat, deduped list of same-origin URLs.
20
+ */
21
+ export declare function fetchSitemapUrls(sitemapUrl: string, origin: string, depth?: number, dispatcher?: any): Promise<string[]>;
22
+ /**
23
+ * Discovers a project's sitemap (default `${origin}/sitemap.xml`, or an
24
+ * explicit override) and returns the URLs it lists. Never throws.
25
+ */
26
+ export declare function discoverSitemapUrls(appUrl: string, sitemapUrl?: string): Promise<string[]>;
27
+ /**
28
+ * Build an undici ProxyAgent from a proxy URL. Parses credentials manually because
29
+ * DataImpulse-style usernames contain commas (country codes) that break new URL().
30
+ * Returns undefined for no/auto proxy — the caller then fetches directly.
31
+ */
32
+ export declare function buildProxyDispatcher(proxyUrl?: string): ProxyAgent | undefined;
33
+ /** Extract same-origin `Sitemap:` directives from a robots.txt body. */
34
+ export declare function parseRobotsSitemaps(robotsTxt: string, origin: string): string[];
35
+ export interface UrlCandidate {
36
+ url: string;
37
+ source: 'sitemap' | 'robots' | 'link';
38
+ }
39
+ /**
40
+ * Pre-crawl URL discovery for the review-before-crawl flow: reads robots.txt Sitemap
41
+ * directives and sitemap.xml (recursed, same-origin), proxy-aware. Returns a deduped
42
+ * candidate list the user can review and seed before launching the Playwright crawl.
43
+ * Never throws — bot-protected sites (Akamai/Cloudflare) simply yield an empty list.
44
+ */
45
+ export declare function discoverProjectUrls(appUrl: string, opts?: {
46
+ sitemapUrl?: string;
47
+ proxyUrl?: string;
48
+ }): Promise<{
49
+ candidates: UrlCandidate[];
50
+ sitemapFound: boolean;
51
+ }>;