@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,56 @@
1
+ /**
2
+ * Skyvern Vision Fallback
3
+ *
4
+ * Skyvern combines computer vision + LLM reasoning to navigate sites that
5
+ * defeat DOM-based approaches: CAPTCHAs, legacy apps, visual-only login flows,
6
+ * government portals. It's the "break glass" option when Stagehand fails.
7
+ *
8
+ * Production setup (Phase 4+):
9
+ * 1. Self-host: https://github.com/Skyvern-AI/skyvern
10
+ * 2. Or use cloud: https://app.skyvern.com
11
+ * 3. Set SKYVERN_API_URL + SKYVERN_API_KEY in .env
12
+ *
13
+ * Pricing note: vision tasks cost more per step than DOM-based Stagehand.
14
+ * Use only when the fast path fails.
15
+ */
16
+ export interface SkyvernTask {
17
+ taskDescription: string;
18
+ url: string;
19
+ credentials?: {
20
+ username: string;
21
+ password: string;
22
+ oneTimeCode?: string;
23
+ };
24
+ }
25
+ export interface SkyvernConfig {
26
+ apiUrl: string;
27
+ apiKey: string;
28
+ llmKey?: string;
29
+ llmApiKey?: string;
30
+ }
31
+ export interface SkyvernStep {
32
+ order: number;
33
+ action_type: string;
34
+ element_description?: string;
35
+ reasoning?: string;
36
+ success: boolean;
37
+ screenshot_url?: string;
38
+ duration_ms?: number;
39
+ error?: string;
40
+ }
41
+ export interface SkyvernNavigateResult {
42
+ screenshotUrls: string[];
43
+ visitedUrls: string[];
44
+ status: 'success' | 'failed' | 'partial';
45
+ steps?: SkyvernStep[];
46
+ taskId?: string;
47
+ durationMs?: number;
48
+ triggerReason?: string;
49
+ }
50
+ /**
51
+ * Gap 5: Post-login navigation via Skyvern vision for apps where DOM analysis
52
+ * cannot discover screens (canvas, WebGL, legacy Flash-replacement stacks).
53
+ * Skyvern drives the browser via screenshot + LLM, returning visited page list.
54
+ */
55
+ export declare function skyvernNavigate(startUrl: string, navigationGoals: string[], tenantConfig?: SkyvernConfig, triggerReason?: string): Promise<SkyvernNavigateResult>;
56
+ export declare function skyvernFallback(task: SkyvernTask, tenantConfig?: SkyvernConfig): Promise<'success' | 'failed'>;
@@ -0,0 +1,2 @@
1
+ export declare function sendJobToSqs(jobId: string, tenantId: string, config: any): Promise<void>;
2
+ export declare function startSqsWorker(): Promise<void>;
@@ -0,0 +1,29 @@
1
+ /**
2
+ * SSO token retrieval for Okta and Azure AD.
3
+ * Uses OAuth2 ROPC (Resource Owner Password Credentials) flow to get access tokens
4
+ * without browser-based login.
5
+ *
6
+ * Note: ROPC is deprecated in OAuth 2.1 but still supported by Okta and Azure AD
7
+ * for service accounts and automated testing scenarios.
8
+ */
9
+ export type SsoProvider = 'okta' | 'azure_ad' | 'generic_oidc';
10
+ export interface SsoConfig {
11
+ provider: SsoProvider;
12
+ /** Okta domain (e.g. 'mycompany.okta.com') or Azure tenant ID */
13
+ domain: string;
14
+ /** OAuth2 client ID */
15
+ clientId: string;
16
+ /** OAuth2 client secret (for client_credentials or confidential ROPC) */
17
+ clientSecret?: string;
18
+ /** Scopes to request (space-separated). Default: 'openid profile' */
19
+ scope?: string;
20
+ }
21
+ /**
22
+ * Get an access token using ROPC flow (username + password → token).
23
+ * Returns the access token string.
24
+ */
25
+ export declare function getSsoToken(config: SsoConfig, username: string, password: string): Promise<string>;
26
+ /**
27
+ * Get a client credentials token (no user — for service accounts).
28
+ */
29
+ export declare function getSsoClientCredentialsToken(config: SsoConfig): Promise<string>;
@@ -0,0 +1,20 @@
1
+ import type { Page } from 'playwright';
2
+ export declare function humanDelay(min?: number, max?: number): Promise<void>;
3
+ export declare function simulateMouseMovement(page: Page, targetX: number, targetY: number): Promise<void>;
4
+ export declare function simulateMouseHover(page: Page, selector: string): Promise<void>;
5
+ export declare function simulateClick(page: Page, selector: string): Promise<void>;
6
+ export declare function injectFingerprintOverrides(page: Page): Promise<void>;
7
+ export declare function infiniteScrollToBottom(page: Page, opts?: {
8
+ maxScrolls?: number;
9
+ scrollDelay?: number;
10
+ stabilizeMs?: number;
11
+ }): Promise<{
12
+ scrollCount: number;
13
+ heightReached: number;
14
+ }>;
15
+ export declare function extractIframeContent(page: Page): Promise<Array<{
16
+ src: string;
17
+ content: string;
18
+ markdown: string;
19
+ }>>;
20
+ export declare function pierceShadowDom(page: Page): Promise<string>;
@@ -0,0 +1,34 @@
1
+ /**
2
+ * Lightweight OTel-compatible tracing for Zeta crawler.
3
+ *
4
+ * Emits spans as structured JSON logs compatible with OpenTelemetry format.
5
+ * Drop-in upgrade path: replace this module with @opentelemetry/sdk-node when needed.
6
+ *
7
+ * Usage:
8
+ * const span = startSpan('crawl.url', { url, engine });
9
+ * // ... do work ...
10
+ * endSpan(span, { screensFound: 3 });
11
+ */
12
+ export interface Span {
13
+ traceId: string;
14
+ spanId: string;
15
+ parentSpanId?: string;
16
+ name: string;
17
+ startTimeMs: number;
18
+ attributes: Record<string, string | number | boolean>;
19
+ }
20
+ export interface FinishedSpan extends Span {
21
+ endTimeMs: number;
22
+ durationMs: number;
23
+ status: 'ok' | 'error';
24
+ error?: string;
25
+ }
26
+ /** Start a new span. If a trace is already active, the new span is a child. */
27
+ export declare function startSpan(name: string, attributes?: Record<string, string | number | boolean>): Span;
28
+ /** End a span and emit it as a structured log line. */
29
+ export declare function endSpan(span: Span, extraAttributes?: Record<string, string | number | boolean>, error?: Error): FinishedSpan;
30
+ /** Convenience: wrap an async function in a span. */
31
+ export declare function withSpan<T>(name: string, attributes: Record<string, string | number | boolean>, fn: (span: Span) => Promise<T>): Promise<T>;
32
+ export declare function increment(metric: string, value?: number, tags?: Record<string, string>): void;
33
+ /** Flush counters as a structured log — call periodically (e.g. at job end). */
34
+ export declare function flushMetrics(): Record<string, number>;
@@ -0,0 +1,67 @@
1
+ import type { ExecutionStep } from '@detiq/agents';
2
+ export interface StepResult {
3
+ stepNumber: number;
4
+ description: string;
5
+ status: 'PASSED' | 'FAILED' | 'SKIPPED';
6
+ duration: number;
7
+ error?: string;
8
+ screenshotPath?: string;
9
+ healed?: boolean;
10
+ /** 'mechanical' = same selector text, different Playwright locator strategy.
11
+ * 'ai' = AI Self-Healing Agent matched a semantically different element
12
+ * (the app's selector text itself changed, e.g. "Sign In" -> "Log In"). */
13
+ healedVia?: 'mechanical' | 'ai';
14
+ healReasoning?: string;
15
+ healConfidence?: number;
16
+ }
17
+ export interface ExecutionResult {
18
+ stepResults: StepResult[];
19
+ status: 'PASSED' | 'FAILED' | 'ERROR' | 'FLAKY';
20
+ errorStep?: number;
21
+ totalDuration: number;
22
+ finalScreenshotPath?: string;
23
+ retryCount?: number;
24
+ consoleLogs?: Array<{
25
+ type: string;
26
+ text: string;
27
+ timestamp: number;
28
+ }>;
29
+ networkErrors?: Array<{
30
+ url: string;
31
+ status: number;
32
+ method: string;
33
+ timestamp: number;
34
+ }>;
35
+ rootCauseSummary?: string;
36
+ networkTimings?: Array<{
37
+ url: string;
38
+ method: string;
39
+ status: number;
40
+ duration: number;
41
+ }>;
42
+ }
43
+ export declare function executeTestPlan(plan: ExecutionStep[], options: {
44
+ screenshotDir: string;
45
+ testRunId: string;
46
+ viewport?: {
47
+ width: number;
48
+ height: number;
49
+ };
50
+ onStepComplete?: (result: StepResult) => void;
51
+ /** Run the test up to this many times to detect flakiness (default 1). */
52
+ maxRuns?: number;
53
+ browser?: 'chromium' | 'firefox' | 'webkit';
54
+ /** Data row for parameterized execution: substitutes {{varname}} in step fields. */
55
+ dataRow?: Record<string, string>;
56
+ /** Enables the AI Self-Healing Agent tier when a step's selector can't be resolved
57
+ * even after trying alternate locator strategies. Omit to keep mechanical-only
58
+ * healing (no LLM calls during execution). */
59
+ healCtx?: {
60
+ tenantId: string;
61
+ projectId: string;
62
+ };
63
+ /** Decrypted Playwright storageState JSON — restores a logged-in session so
64
+ * steps don't have to re-authenticate. Without this, any test case behind a
65
+ * login wall fails at the first authenticated step. */
66
+ storageState?: string;
67
+ }): Promise<ExecutionResult>;
@@ -0,0 +1,50 @@
1
+ /**
2
+ * TLS fingerprint spoofing — Chrome JA3 cipher suite ordering.
3
+ *
4
+ * Node.js TLS doesn't expose JA3 hash control directly, but ordering
5
+ * cipher suites to match Chrome's TLS ClientHello reduces fingerprint
6
+ * detectability vs the default OpenSSL order.
7
+ *
8
+ * For full JA3 bypass, pair with the browser-stealth engine (Camoufox).
9
+ */
10
+ import { Agent as HttpsAgent } from 'node:https';
11
+ export declare const CHROME_CIPHERS: string;
12
+ export declare const CHROME_CURVES = "X25519:P-256:P-384";
13
+ export interface TlsFingerprintOptions {
14
+ rejectUnauthorized?: boolean;
15
+ keepAlive?: boolean;
16
+ keepAliveMsecs?: number;
17
+ maxSockets?: number;
18
+ }
19
+ /**
20
+ * Returns an HTTPS agent configured with Chrome-like TLS settings.
21
+ * Drop-in replacement for the default agent in fetch/got/axios.
22
+ */
23
+ export declare function createChromeTlsAgent(opts?: TlsFingerprintOptions): HttpsAgent;
24
+ /**
25
+ * Probe a host and return its JA3-relevant TLS parameters.
26
+ * Useful for verifying that the fingerprint changed vs default.
27
+ */
28
+ export declare function probeTlsFingerprint(host: string, port?: number): Promise<{
29
+ protocol: string;
30
+ cipher: string;
31
+ authorized: boolean;
32
+ subjectCN: string | null;
33
+ }>;
34
+ /**
35
+ * Node.js fetch dispatcher options with Chrome TLS agent.
36
+ * Pass as the `dispatcher` option to undici or as `agent` to node-fetch.
37
+ */
38
+ export declare const chromeTlsAgent: HttpsAgent;
39
+ export declare const CHROME_TLS_HEADERS: {
40
+ 'Accept-Encoding': string;
41
+ 'Accept-Language': string;
42
+ 'sec-ch-ua': string;
43
+ 'sec-ch-ua-mobile': string;
44
+ 'sec-ch-ua-platform': string;
45
+ 'Sec-Fetch-Dest': string;
46
+ 'Sec-Fetch-Mode': string;
47
+ 'Sec-Fetch-Site': string;
48
+ 'Sec-Fetch-User': string;
49
+ 'Upgrade-Insecure-Requests': string;
50
+ };
@@ -0,0 +1,28 @@
1
+ /**
2
+ * P1: URL Pattern LLM Completion
3
+ *
4
+ * After BFS crawl completes, runs a single LLM call to predict URLs that exist
5
+ * but were never linked from within the app. Validates each candidate with
6
+ * HTTP HEAD before emitting as crawl evidence (URL_CANDIDATES).
7
+ *
8
+ * Cost: ~1 LLM call + N HEAD requests. Takes ~5-30 seconds depending on
9
+ * candidate count. Does NOT launch a browser.
10
+ */
11
+ export interface UrlCandidate {
12
+ url: string;
13
+ confidence: number;
14
+ reason: string;
15
+ status: 'hit' | 'miss' | 'error';
16
+ }
17
+ interface LlmCfg {
18
+ provider: string;
19
+ model: string;
20
+ apiKey?: string;
21
+ baseUrl?: string;
22
+ }
23
+ /**
24
+ * Returns validated URL candidates (HEAD=200) predicted by LLM from
25
+ * the pattern of already-discovered URLs.
26
+ */
27
+ export declare function runUrlPatternCompletion(discoveredUrls: string[], appUrl: string, llmCfg: LlmCfg | null | undefined): Promise<UrlCandidate[]>;
28
+ export {};
@@ -0,0 +1,40 @@
1
+ /**
2
+ * Pure visual-diff verdict logic, split out of crawler.ts so it can be unit-tested
3
+ * without pulling in crawler.ts's full import graph (Playwright, Stagehand, and
4
+ * transitively @detiq/database, which instantiates a PrismaClient at module load and
5
+ * so requires a live DATABASE_URL just to import the module).
6
+ */
7
+ export interface VisualDiffVerdict {
8
+ changeType: 'NONE' | 'MINOR' | 'SIGNIFICANT' | 'CRITICAL';
9
+ recommendation: 'APPROVE' | 'REVIEW' | 'FLAG' | 'BLOCK';
10
+ changes: Array<{
11
+ location: string;
12
+ severity: string;
13
+ description: string;
14
+ }>;
15
+ bugReportDraft?: {
16
+ title: string;
17
+ severity: string;
18
+ steps: string[];
19
+ expected: string;
20
+ actual: string;
21
+ };
22
+ aiSummary?: string;
23
+ }
24
+ /** Cheap, always-on first-pass verdict from perceptual hash distance + layout/element diffs. */
25
+ export declare function pHashVerdict(pHashDistance: number, changeLevel: 'IDENTICAL' | 'MINOR' | 'MODERATE' | 'SIGNIFICANT', changes: Array<{
26
+ location: string;
27
+ severity: string;
28
+ description: string;
29
+ }>): VisualDiffVerdict;
30
+ /** Replaces a pHash-only verdict with the AI's semantic judgment once it's available,
31
+ * and drafts a bug report for anything still CRITICAL/SIGNIFICANT after AI review
32
+ * (pHash flags plenty of anti-aliasing/font-rendering noise the AI correctly discards
33
+ * as NONE/MINOR — only what survives AI review is worth a draft). */
34
+ export declare function mergeAiVisualVerdict(pHashResult: VisualDiffVerdict, aiResult: {
35
+ changeType: string;
36
+ changes: any[];
37
+ recommendation: string;
38
+ diffScore: number;
39
+ summary?: string;
40
+ }, screenName: string): VisualDiffVerdict;
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Webhook notifier — fire HTTP POST callbacks on crawl lifecycle events.
3
+ *
4
+ * Supports: crawl.started, crawl.progress, crawl.completed, crawl.failed
5
+ * Payload format compatible with Slack, Discord, and generic REST webhooks.
6
+ * Retries 3x on failure with exponential backoff.
7
+ */
8
+ export type CrawlEventType = 'crawl.started' | 'crawl.progress' | 'crawl.completed' | 'crawl.failed';
9
+ export interface WebhookPayload {
10
+ event: CrawlEventType;
11
+ jobId: string;
12
+ projectId: string;
13
+ tenantId: string;
14
+ timestamp: string;
15
+ data: Record<string, unknown>;
16
+ }
17
+ export interface WebhookNotifierOpts {
18
+ url: string;
19
+ secret?: string;
20
+ headers?: Record<string, string>;
21
+ timeoutMs?: number;
22
+ maxRetries?: number;
23
+ }
24
+ export declare class WebhookNotifier {
25
+ private readonly opts;
26
+ constructor(opts: WebhookNotifierOpts);
27
+ notify(event: CrawlEventType, jobId: string, projectId: string, tenantId: string, data?: Record<string, unknown>): Promise<void>;
28
+ /** Slack-compatible message format */
29
+ static slackPayload(event: CrawlEventType, data: Record<string, unknown>): Record<string, unknown>;
30
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * WebSocket detection — intercepts WS connections opened during page crawl.
3
+ * Records connection URLs, message schemas, and message counts.
4
+ * This lets ZeTa discover real-time API contracts (chat, notifications, presence)
5
+ * that would be invisible to HTTP-only crawlers.
6
+ */
7
+ export interface WsConnection {
8
+ url: string;
9
+ framesSent: number;
10
+ framesReceived: number;
11
+ /** Sampled message bodies (first 10 per connection, truncated to 500 chars) */
12
+ samples: Array<{
13
+ direction: 'sent' | 'received';
14
+ payload: string;
15
+ ts: string;
16
+ }>;
17
+ /** Inferred protocol: 'json-rpc' | 'socket.io' | 'graphql-ws' | 'raw' */
18
+ protocol: string;
19
+ openedAt: string;
20
+ }
21
+ export declare function attachWebSocketDetector(cdpSession: any): {
22
+ getConnections(): WsConnection[];
23
+ detach(): void;
24
+ };
@@ -0,0 +1 @@
1
+ export {};