@taodigital/crawler 0.0.0-stage → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/Dockerfile +82 -0
- package/README.md +10 -2
- package/dist/accessibility-auditor.d.ts +29 -0
- package/dist/accessibility-auditor.js +57 -0
- package/dist/accessibility-auditor.js.map +7 -0
- package/dist/accessibility-tree-crawler.d.ts +44 -0
- package/dist/accessibility-tree-crawler.js +156 -0
- package/dist/accessibility-tree-crawler.js.map +7 -0
- package/dist/advanced-ui-probes.d.ts +47 -0
- package/dist/advanced-ui-probes.js +310 -0
- package/dist/advanced-ui-probes.js.map +7 -0
- package/dist/ai-login.d.ts +32 -0
- package/dist/ai-login.js +250 -0
- package/dist/ai-login.js.map +7 -0
- package/dist/auth-token-rotator.d.ts +47 -0
- package/dist/auth-token-rotator.js +58 -0
- package/dist/auth-token-rotator.js.map +7 -0
- package/dist/auth.d.ts +20 -0
- package/dist/auth.js +348 -0
- package/dist/auth.js.map +7 -0
- package/dist/browser-extension.d.ts +37 -0
- package/dist/browser-extension.js +113 -0
- package/dist/browser-extension.js.map +7 -0
- package/dist/captcha-solver.d.ts +16 -0
- package/dist/captcha-solver.js +105 -0
- package/dist/captcha-solver.js.map +7 -0
- package/dist/color-contrast.d.ts +30 -0
- package/dist/color-contrast.js +78 -0
- package/dist/color-contrast.js.map +7 -0
- package/dist/content-chunker.d.ts +18 -0
- package/dist/content-chunker.js +152 -0
- package/dist/content-chunker.js.map +7 -0
- package/dist/content-dedup.d.ts +23 -0
- package/dist/content-dedup.js +60 -0
- package/dist/content-dedup.js.map +7 -0
- package/dist/cookie-consent.d.ts +25 -0
- package/dist/cookie-consent.js +78 -0
- package/dist/cookie-consent.js.map +7 -0
- package/dist/cookie-jar.d.ts +20 -0
- package/dist/cookie-jar.js +61 -0
- package/dist/cookie-jar.js.map +7 -0
- package/dist/crawl-session-manager.d.ts +44 -0
- package/dist/crawl-session-manager.js +145 -0
- package/dist/crawl-session-manager.js.map +7 -0
- package/dist/crawler.d.ts +233 -0
- package/dist/crawler.js +6239 -0
- package/dist/crawler.js.map +7 -0
- package/dist/crud-interaction.d.ts +31 -0
- package/dist/crud-interaction.js +264 -0
- package/dist/crud-interaction.js.map +7 -0
- package/dist/custom-js-injector.d.ts +42 -0
- package/dist/custom-js-injector.js +50 -0
- package/dist/custom-js-injector.js.map +7 -0
- package/dist/dark-mode-capture.d.ts +23 -0
- package/dist/dark-mode-capture.js +75 -0
- package/dist/dark-mode-capture.js.map +7 -0
- package/dist/dead-link-detector.d.ts +37 -0
- package/dist/dead-link-detector.js +50 -0
- package/dist/dead-link-detector.js.map +7 -0
- package/dist/dropdown-enumerator.d.ts +20 -0
- package/dist/dropdown-enumerator.js +230 -0
- package/dist/dropdown-enumerator.js.map +7 -0
- package/dist/element-hash.d.ts +9 -0
- package/dist/element-hash.js +9 -0
- package/dist/element-hash.js.map +7 -0
- package/dist/email-otp.d.ts +42 -0
- package/dist/email-otp.js +177 -0
- package/dist/email-otp.js.map +7 -0
- package/dist/engine-router.d.ts +47 -0
- package/dist/engine-router.js +94 -0
- package/dist/engine-router.js.map +7 -0
- package/dist/export/bulk-export.d.ts +26 -0
- package/dist/export/bulk-export.js +76 -0
- package/dist/export/bulk-export.js.map +7 -0
- package/dist/export/vector-export.d.ts +76 -0
- package/dist/export/vector-export.js +85 -0
- package/dist/export/vector-export.js.map +7 -0
- package/dist/extractors/advanced.d.ts +64 -0
- package/dist/extractors/advanced.js +265 -0
- package/dist/extractors/advanced.js.map +7 -0
- package/dist/extractors/artifact-envelope.d.ts +63 -0
- package/dist/extractors/artifact-envelope.js +63 -0
- package/dist/extractors/artifact-envelope.js.map +7 -0
- package/dist/extractors/branding-extractor.d.ts +46 -0
- package/dist/extractors/branding-extractor.js +104 -0
- package/dist/extractors/branding-extractor.js.map +7 -0
- package/dist/extractors/summary-extractor.d.ts +10 -0
- package/dist/extractors/summary-extractor.js +36 -0
- package/dist/extractors/summary-extractor.js.map +7 -0
- package/dist/failure-analysis-agent.d.ts +16 -0
- package/dist/failure-analysis-agent.js +42 -0
- package/dist/failure-analysis-agent.js.map +7 -0
- package/dist/feature-flag-detector.d.ts +30 -0
- package/dist/feature-flag-detector.js +55 -0
- package/dist/feature-flag-detector.js.map +7 -0
- package/dist/filter-pagination-crawler.d.ts +52 -0
- package/dist/filter-pagination-crawler.js +299 -0
- package/dist/filter-pagination-crawler.js.map +7 -0
- package/dist/form-detector.d.ts +34 -0
- package/dist/form-detector.js +58 -0
- package/dist/form-detector.js.map +7 -0
- package/dist/frontier.d.ts +40 -0
- package/dist/frontier.js +103 -0
- package/dist/frontier.js.map +7 -0
- package/dist/gap-pass.d.ts +36 -0
- package/dist/gap-pass.js +115 -0
- package/dist/gap-pass.js.map +7 -0
- package/dist/graphql-detector.d.ts +39 -0
- package/dist/graphql-detector.js +86 -0
- package/dist/graphql-detector.js.map +7 -0
- package/dist/http-engine.d.ts +80 -0
- package/dist/http-engine.js +318 -0
- package/dist/http-engine.js.map +7 -0
- package/dist/incremental-diff.d.ts +116 -0
- package/dist/incremental-diff.js +137 -0
- package/dist/incremental-diff.js.map +7 -0
- package/dist/index.d.ts +52 -0
- package/dist/index.js +83 -0
- package/dist/index.js.map +7 -0
- package/dist/input-fuzzer.d.ts +30 -0
- package/dist/input-fuzzer.js +105 -0
- package/dist/input-fuzzer.js.map +7 -0
- package/dist/interactive-probe.d.ts +144 -0
- package/dist/interactive-probe.js +865 -0
- package/dist/interactive-probe.js.map +7 -0
- package/dist/job-queue.d.ts +297 -0
- package/dist/job-queue.js +3812 -0
- package/dist/job-queue.js.map +7 -0
- package/dist/js-coverage.d.ts +29 -0
- package/dist/js-coverage.js +56 -0
- package/dist/js-coverage.js.map +7 -0
- package/dist/js-router-detector.d.ts +17 -0
- package/dist/js-router-detector.js +90 -0
- package/dist/js-router-detector.js.map +7 -0
- package/dist/language-detector.d.ts +22 -0
- package/dist/language-detector.js +57 -0
- package/dist/language-detector.js.map +7 -0
- package/dist/link-classifier.d.ts +23 -0
- package/dist/link-classifier.js +40 -0
- package/dist/link-classifier.js.map +7 -0
- package/dist/live-view.d.ts +36 -0
- package/dist/live-view.js +105 -0
- package/dist/live-view.js.map +7 -0
- package/dist/locator-extractor.d.ts +46 -0
- package/dist/locator-extractor.js +220 -0
- package/dist/locator-extractor.js.map +7 -0
- package/dist/logger.d.ts +2 -0
- package/dist/logger.js +10 -0
- package/dist/logger.js.map +7 -0
- package/dist/markdown-extract.d.ts +8 -0
- package/dist/markdown-extract.js +54 -0
- package/dist/markdown-extract.js.map +7 -0
- package/dist/multi-context-handler.d.ts +55 -0
- package/dist/multi-context-handler.js +182 -0
- package/dist/multi-context-handler.js.map +7 -0
- package/dist/native-crawler.d.ts +69 -0
- package/dist/native-crawler.js +839 -0
- package/dist/native-crawler.js.map +7 -0
- package/dist/nested-window-crawler.d.ts +41 -0
- package/dist/nested-window-crawler.js +172 -0
- package/dist/nested-window-crawler.js.map +7 -0
- package/dist/network-action-correlator.d.ts +47 -0
- package/dist/network-action-correlator.js +209 -0
- package/dist/network-action-correlator.js.map +7 -0
- package/dist/network-observer.d.ts +49 -0
- package/dist/network-observer.js +149 -0
- package/dist/network-observer.js.map +7 -0
- package/dist/network-throttle.d.ts +25 -0
- package/dist/network-throttle.js +34 -0
- package/dist/network-throttle.js.map +7 -0
- package/dist/openapi-generator.d.ts +49 -0
- package/dist/openapi-generator.js +89 -0
- package/dist/openapi-generator.js.map +7 -0
- package/dist/pdf-extractor.d.ts +28 -0
- package/dist/pdf-extractor.js +81 -0
- package/dist/pdf-extractor.js.map +7 -0
- package/dist/performance-metrics-collector.d.ts +50 -0
- package/dist/performance-metrics-collector.js +155 -0
- package/dist/performance-metrics-collector.js.map +7 -0
- package/dist/performance-metrics.d.ts +52 -0
- package/dist/performance-metrics.js +83 -0
- package/dist/performance-metrics.js.map +7 -0
- package/dist/phash.d.ts +50 -0
- package/dist/phash.js +136 -0
- package/dist/phash.js.map +7 -0
- package/dist/pii-scrubber.d.ts +21 -0
- package/dist/pii-scrubber.js +75 -0
- package/dist/pii-scrubber.js.map +7 -0
- package/dist/playwright-recorder.d.ts +39 -0
- package/dist/playwright-recorder.js +123 -0
- package/dist/playwright-recorder.js.map +7 -0
- package/dist/policies/crawl-safety.d.ts +9 -0
- package/dist/policies/crawl-safety.js +41 -0
- package/dist/policies/crawl-safety.js.map +7 -0
- package/dist/profiles/domain-profile.d.ts +19 -0
- package/dist/profiles/domain-profile.js +160 -0
- package/dist/profiles/domain-profile.js.map +7 -0
- package/dist/proxy.d.ts +50 -0
- package/dist/proxy.js +165 -0
- package/dist/proxy.js.map +7 -0
- package/dist/rate-limiter.d.ts +31 -0
- package/dist/rate-limiter.js +64 -0
- package/dist/rate-limiter.js.map +7 -0
- package/dist/redirect-tracker.d.ts +37 -0
- package/dist/redirect-tracker.js +65 -0
- package/dist/redirect-tracker.js.map +7 -0
- package/dist/redis-frontier.d.ts +48 -0
- package/dist/redis-frontier.js +126 -0
- package/dist/redis-frontier.js.map +7 -0
- package/dist/redis-queue.d.ts +48 -0
- package/dist/redis-queue.js +165 -0
- package/dist/redis-queue.js.map +7 -0
- package/dist/response-cache.d.ts +38 -0
- package/dist/response-cache.js +140 -0
- package/dist/response-cache.js.map +7 -0
- package/dist/responsive-detector.d.ts +29 -0
- package/dist/responsive-detector.js +46 -0
- package/dist/responsive-detector.js.map +7 -0
- package/dist/retry-policy.d.ts +20 -0
- package/dist/retry-policy.js +54 -0
- package/dist/retry-policy.js.map +7 -0
- package/dist/robots-txt.d.ts +9 -0
- package/dist/robots-txt.js +77 -0
- package/dist/robots-txt.js.map +7 -0
- package/dist/screen-reader.d.ts +15 -0
- package/dist/screen-reader.js +48 -0
- package/dist/screen-reader.js.map +7 -0
- package/dist/screenshot-masker.d.ts +28 -0
- package/dist/screenshot-masker.js +62 -0
- package/dist/screenshot-masker.js.map +7 -0
- package/dist/seo-checker.d.ts +33 -0
- package/dist/seo-checker.js +91 -0
- package/dist/seo-checker.js.map +7 -0
- package/dist/service-worker-interceptor.d.ts +36 -0
- package/dist/service-worker-interceptor.js +136 -0
- package/dist/service-worker-interceptor.js.map +7 -0
- package/dist/session-capture.d.ts +39 -0
- package/dist/session-capture.js +274 -0
- package/dist/session-capture.js.map +7 -0
- package/dist/session-export.d.ts +49 -0
- package/dist/session-export.js +117 -0
- package/dist/session-export.js.map +7 -0
- package/dist/shadow-dom-crawler.d.ts +35 -0
- package/dist/shadow-dom-crawler.js +132 -0
- package/dist/shadow-dom-crawler.js.map +7 -0
- package/dist/sitemap-writer.d.ts +21 -0
- package/dist/sitemap-writer.js +47 -0
- package/dist/sitemap-writer.js.map +7 -0
- package/dist/sitemap.d.ts +51 -0
- package/dist/sitemap.js +160 -0
- package/dist/sitemap.js.map +7 -0
- package/dist/skyvern.d.ts +56 -0
- package/dist/skyvern.js +129 -0
- package/dist/skyvern.js.map +7 -0
- package/dist/sqs-queue.d.ts +13 -0
- package/dist/sqs-queue.js +115 -0
- package/dist/sqs-queue.js.map +7 -0
- package/dist/sso-token.d.ts +29 -0
- package/dist/sso-token.js +76 -0
- package/dist/sso-token.js.map +7 -0
- package/dist/state-graph.d.ts +59 -0
- package/dist/state-graph.js +193 -0
- package/dist/state-graph.js.map +7 -0
- package/dist/stealth/human-behavior.d.ts +20 -0
- package/dist/stealth/human-behavior.js +202 -0
- package/dist/stealth/human-behavior.js.map +7 -0
- package/dist/telemetry.d.ts +34 -0
- package/dist/telemetry.js +77 -0
- package/dist/telemetry.js.map +7 -0
- package/dist/test-executor.d.ts +81 -0
- package/dist/test-executor.js +443 -0
- package/dist/test-executor.js.map +7 -0
- package/dist/tls-fingerprint.d.ts +50 -0
- package/dist/tls-fingerprint.js +81 -0
- package/dist/tls-fingerprint.js.map +7 -0
- package/dist/url-pattern-completer.d.ts +28 -0
- package/dist/url-pattern-completer.js +122 -0
- package/dist/url-pattern-completer.js.map +7 -0
- package/dist/visual-diff-verdict.d.ts +40 -0
- package/dist/visual-diff-verdict.js +27 -0
- package/dist/visual-diff-verdict.js.map +7 -0
- package/dist/webhook-notifier.d.ts +30 -0
- package/dist/webhook-notifier.js +76 -0
- package/dist/webhook-notifier.js.map +7 -0
- package/dist/websocket-detector.d.ts +24 -0
- package/dist/websocket-detector.js +60 -0
- package/dist/websocket-detector.js.map +7 -0
- package/dist/worker.d.ts +1 -0
- package/dist/worker.js +33 -0
- package/dist/worker.js.map +7 -0
- package/package.json +49 -4
- package/src/accessibility-auditor.ts +102 -0
- package/src/accessibility-tree-crawler.ts +246 -0
- package/src/advanced-ui-probes.ts +470 -0
- package/src/ai-login.ts +298 -0
- package/src/auth-token-rotator.ts +89 -0
- package/src/auth.ts +418 -0
- package/src/browser-extension.ts +186 -0
- package/src/captcha-solver.ts +143 -0
- package/src/color-contrast.ts +116 -0
- package/src/content-chunker.ts +170 -0
- package/src/content-dedup.ts +99 -0
- package/src/cookie-consent.ts +106 -0
- package/src/cookie-jar.ts +91 -0
- package/src/crawl-session-manager.ts +231 -0
- package/src/crawler.ts +7123 -0
- package/src/crawler.ts.rej +12 -0
- package/src/crud-interaction.ts +386 -0
- package/src/custom-js-injector.ts +93 -0
- package/src/dark-mode-capture.ts +110 -0
- package/src/dead-link-detector.ts +76 -0
- package/src/dropdown-enumerator.ts +312 -0
- package/src/element-hash.ts +16 -0
- package/src/email-otp.ts +252 -0
- package/src/engine-router.ts +141 -0
- package/src/export/bulk-export.ts +85 -0
- package/src/export/vector-export.ts +160 -0
- package/src/extractors/advanced.ts +309 -0
- package/src/extractors/artifact-envelope.ts +111 -0
- package/src/extractors/branding-extractor.ts +159 -0
- package/src/extractors/summary-extractor.ts +49 -0
- package/src/failure-analysis-agent.ts +51 -0
- package/src/feature-flag-detector.ts +97 -0
- package/src/filter-pagination-crawler.ts +500 -0
- package/src/form-detector.ts +103 -0
- package/src/frontier.test.ts +64 -0
- package/src/frontier.ts +144 -0
- package/src/gap-pass.ts +165 -0
- package/src/graphql-detector.ts +129 -0
- package/src/http-engine.ts +453 -0
- package/src/incremental-diff.ts +259 -0
- package/src/index.ts +52 -0
- package/src/input-fuzzer.ts +129 -0
- package/src/interactive-probe.ts +1136 -0
- package/src/job-queue.test.ts +187 -0
- package/src/job-queue.ts +4504 -0
- package/src/js-coverage.ts +87 -0
- package/src/js-router-detector.ts +112 -0
- package/src/language-detector.ts +82 -0
- package/src/link-classifier.ts +65 -0
- package/src/live-view.ts +146 -0
- package/src/locator-extractor.ts +309 -0
- package/src/logger.ts +9 -0
- package/src/markdown-extract.test.ts +73 -0
- package/src/markdown-extract.ts +76 -0
- package/src/multi-context-handler.ts +296 -0
- package/src/native-crawler.ts +1108 -0
- package/src/nested-window-crawler.ts +310 -0
- package/src/network-action-correlator.ts +320 -0
- package/src/network-observer.ts +204 -0
- package/src/network-throttle.ts +69 -0
- package/src/openapi-generator.ts +135 -0
- package/src/pdf-extractor.ts +123 -0
- package/src/performance-metrics-collector.ts +243 -0
- package/src/performance-metrics.ts +134 -0
- package/src/phash.ts +184 -0
- package/src/pii-scrubber.ts +99 -0
- package/src/playwright-recorder.ts +170 -0
- package/src/policies/crawl-safety.ts +52 -0
- package/src/profiles/domain-profile.ts +190 -0
- package/src/proxy.ts +238 -0
- package/src/rate-limiter.ts +87 -0
- package/src/redirect-tracker.ts +97 -0
- package/src/redis-frontier.ts +143 -0
- package/src/redis-queue.ts +208 -0
- package/src/response-cache.ts +150 -0
- package/src/responsive-detector.ts +92 -0
- package/src/retry-policy.ts +87 -0
- package/src/robots-txt.ts +96 -0
- package/src/screen-reader.ts +98 -0
- package/src/screenshot-masker.ts +98 -0
- package/src/seo-checker.ts +134 -0
- package/src/service-worker-interceptor.ts +185 -0
- package/src/session-capture.ts +335 -0
- package/src/session-export.test.ts +75 -0
- package/src/session-export.ts +172 -0
- package/src/shadow-dom-crawler.ts +198 -0
- package/src/sitemap-writer.ts +65 -0
- package/src/sitemap.test.ts +127 -0
- package/src/sitemap.ts +233 -0
- package/src/skyvern.ts +199 -0
- package/src/sqs-queue.ts +129 -0
- package/src/sso-token.ts +120 -0
- package/src/state-graph.ts +280 -0
- package/src/stealth/human-behavior.ts +227 -0
- package/src/telemetry.ts +122 -0
- package/src/test-executor.test.ts +72 -0
- package/src/test-executor.ts +578 -0
- package/src/tls-fingerprint.ts +111 -0
- package/src/url-pattern-completer.ts +161 -0
- package/src/vendor.d.ts +20 -0
- package/src/visual-diff-verdict.test.ts +80 -0
- package/src/visual-diff-verdict.ts +59 -0
- package/src/webhook-notifier.ts +109 -0
- package/src/websocket-detector.ts +83 -0
- package/src/worker.ts +50 -0
- package/tsconfig.json +13 -0
- package/types/accessibility-auditor.d.ts +29 -0
- package/types/accessibility-tree-crawler.d.ts +44 -0
- package/types/advanced-ui-probes.d.ts +47 -0
- package/types/ai-login.d.ts +32 -0
- package/types/auth-token-rotator.d.ts +47 -0
- package/types/auth.d.ts +20 -0
- package/types/browser-extension.d.ts +37 -0
- package/types/bull-worker.d.ts +6 -0
- package/types/captcha-solver.d.ts +16 -0
- package/types/color-contrast.d.ts +30 -0
- package/types/content-chunker.d.ts +18 -0
- package/types/content-dedup.d.ts +23 -0
- package/types/cookie-consent.d.ts +25 -0
- package/types/cookie-jar.d.ts +20 -0
- package/types/crawl-session-manager.d.ts +44 -0
- package/types/crawler.d.ts +233 -0
- package/types/crud-interaction.d.ts +31 -0
- package/types/custom-js-injector.d.ts +42 -0
- package/types/dark-mode-capture.d.ts +23 -0
- package/types/dead-link-detector.d.ts +37 -0
- package/types/dropdown-enumerator.d.ts +20 -0
- package/types/element-hash.d.ts +9 -0
- package/types/email-otp.d.ts +42 -0
- package/types/engine-router.d.ts +47 -0
- package/types/export/bulk-export.d.ts +26 -0
- package/types/export/vector-export.d.ts +76 -0
- package/types/extractors/advanced.d.ts +64 -0
- package/types/extractors/artifact-envelope.d.ts +63 -0
- package/types/extractors/branding-extractor.d.ts +46 -0
- package/types/extractors/summary-extractor.d.ts +10 -0
- package/types/failure-analysis-agent.d.ts +16 -0
- package/types/feature-flag-detector.d.ts +30 -0
- package/types/filter-pagination-crawler.d.ts +52 -0
- package/types/form-detector.d.ts +34 -0
- package/types/frontier.d.ts +40 -0
- package/types/gap-pass.d.ts +36 -0
- package/types/graphql-detector.d.ts +39 -0
- package/types/http-engine.d.ts +80 -0
- package/types/incremental-diff.d.ts +116 -0
- package/types/index.d.ts +52 -0
- package/types/input-fuzzer.d.ts +30 -0
- package/types/interactive-probe.d.ts +144 -0
- package/types/job-queue.d.ts +308 -0
- package/types/js-coverage.d.ts +29 -0
- package/types/js-router-detector.d.ts +17 -0
- package/types/language-detector.d.ts +22 -0
- package/types/link-classifier.d.ts +23 -0
- package/types/live-view.d.ts +36 -0
- package/types/locator-extractor.d.ts +46 -0
- package/types/logger.d.ts +2 -0
- package/types/markdown-extract.d.ts +8 -0
- package/types/multi-context-handler.d.ts +55 -0
- package/types/native-crawler.d.ts +69 -0
- package/types/nested-window-crawler.d.ts +41 -0
- package/types/network-action-correlator.d.ts +47 -0
- package/types/network-observer.d.ts +49 -0
- package/types/network-throttle.d.ts +25 -0
- package/types/openapi-generator.d.ts +49 -0
- package/types/pdf-extractor.d.ts +28 -0
- package/types/performance-metrics-collector.d.ts +50 -0
- package/types/performance-metrics.d.ts +52 -0
- package/types/phash.d.ts +50 -0
- package/types/pii-scrubber.d.ts +21 -0
- package/types/playwright-recorder.d.ts +39 -0
- package/types/policies/crawl-safety.d.ts +9 -0
- package/types/profiles/domain-profile.d.ts +19 -0
- package/types/proxy.d.ts +50 -0
- package/types/rate-limiter.d.ts +31 -0
- package/types/redirect-tracker.d.ts +37 -0
- package/types/redis-frontier.d.ts +48 -0
- package/types/redis-queue.d.ts +48 -0
- package/types/response-cache.d.ts +38 -0
- package/types/responsive-detector.d.ts +29 -0
- package/types/retry-policy.d.ts +20 -0
- package/types/robots-txt.d.ts +9 -0
- package/types/screen-reader.d.ts +15 -0
- package/types/screenshot-masker.d.ts +28 -0
- package/types/seo-checker.d.ts +33 -0
- package/types/service-worker-interceptor.d.ts +36 -0
- package/types/session-capture.d.ts +39 -0
- package/types/session-export.d.ts +49 -0
- package/types/shadow-dom-crawler.d.ts +35 -0
- package/types/sitemap-writer.d.ts +21 -0
- package/types/sitemap.d.ts +51 -0
- package/types/skyvern.d.ts +56 -0
- package/types/sqs-queue.d.ts +13 -0
- package/types/sso-token.d.ts +29 -0
- package/types/state-graph.d.ts +59 -0
- package/types/stealth/human-behavior.d.ts +20 -0
- package/types/telemetry.d.ts +34 -0
- package/types/test-executor.d.ts +84 -0
- package/types/tls-fingerprint.d.ts +50 -0
- package/types/url-pattern-completer.d.ts +28 -0
- package/types/visual-diff-verdict.d.ts +40 -0
- package/types/webhook-notifier.d.ts +30 -0
- package/types/websocket-detector.d.ts +24 -0
- package/types/worker.d.ts +1 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network-action correlator — captures XHR/fetch requests that occur during
|
|
3
|
+
* a named UI action (click, form submit, navigation) and maps them to API
|
|
4
|
+
* endpoint contracts.
|
|
5
|
+
*
|
|
6
|
+
* Usage:
|
|
7
|
+
* const correlator = createCorrelator();
|
|
8
|
+
* const detach = attachNetworkInterceptor(page, correlator);
|
|
9
|
+
* correlator.startWindow('Submit login form');
|
|
10
|
+
* await page.click('#login-btn');
|
|
11
|
+
* const correlation = correlator.endWindow();
|
|
12
|
+
* detach();
|
|
13
|
+
* const result = correlator.getResult();
|
|
14
|
+
*/
|
|
15
|
+
import type { Page } from 'playwright';
|
|
16
|
+
export interface NetworkRequestRecord {
|
|
17
|
+
url: string;
|
|
18
|
+
urlPattern: string;
|
|
19
|
+
method: string;
|
|
20
|
+
bodySchema: Record<string, string> | null;
|
|
21
|
+
status: number | null;
|
|
22
|
+
responseSchema: Record<string, string> | null;
|
|
23
|
+
isGraphQL: boolean;
|
|
24
|
+
graphQLOperation?: string;
|
|
25
|
+
resourceType: string;
|
|
26
|
+
correlatedActionLabel?: string;
|
|
27
|
+
}
|
|
28
|
+
export interface ActionCorrelation {
|
|
29
|
+
actionLabel: string;
|
|
30
|
+
requests: NetworkRequestRecord[];
|
|
31
|
+
}
|
|
32
|
+
export interface NetworkCorrelationResult {
|
|
33
|
+
correlations: ActionCorrelation[];
|
|
34
|
+
uniqueEndpoints: string[];
|
|
35
|
+
graphqlOperations: string[];
|
|
36
|
+
totalRequestsCaptured: number;
|
|
37
|
+
coverage: number;
|
|
38
|
+
}
|
|
39
|
+
interface NetworkCorrelator {
|
|
40
|
+
startWindow(actionLabel: string): void;
|
|
41
|
+
recordRequest(rec: NetworkRequestRecord): void;
|
|
42
|
+
endWindow(): ActionCorrelation;
|
|
43
|
+
getResult(): NetworkCorrelationResult;
|
|
44
|
+
}
|
|
45
|
+
export declare function createCorrelator(): NetworkCorrelator;
|
|
46
|
+
export declare function attachNetworkInterceptor(page: Page, correlator: ReturnType<typeof createCorrelator>): () => void;
|
|
47
|
+
export {};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { BrowserContext } from 'playwright';
|
|
2
|
+
export interface ApiEndpointObservationInput {
|
|
3
|
+
method: string;
|
|
4
|
+
urlPattern: string;
|
|
5
|
+
statusCode?: number;
|
|
6
|
+
requestKind?: string;
|
|
7
|
+
responseShape?: unknown;
|
|
8
|
+
durationMs?: number;
|
|
9
|
+
errorBody?: string;
|
|
10
|
+
}
|
|
11
|
+
export declare function attachNetworkObserver(context: BrowserContext, sink: ApiEndpointObservationInput[], onPageUrlDiscovered?: (relPath: string) => void): void;
|
|
12
|
+
export interface HarEntry {
|
|
13
|
+
startedAt: string;
|
|
14
|
+
method: string;
|
|
15
|
+
url: string;
|
|
16
|
+
status: number;
|
|
17
|
+
statusText: string;
|
|
18
|
+
requestHeaders: Record<string, string>;
|
|
19
|
+
responseHeaders: Record<string, string>;
|
|
20
|
+
contentType: string;
|
|
21
|
+
bodySize: number;
|
|
22
|
+
durationMs: number;
|
|
23
|
+
timings: {
|
|
24
|
+
send: number;
|
|
25
|
+
wait: number;
|
|
26
|
+
receive: number;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface HarLog {
|
|
30
|
+
version: '1.2';
|
|
31
|
+
creator: {
|
|
32
|
+
name: 'ZeTa-Crawler';
|
|
33
|
+
version: '1.0';
|
|
34
|
+
};
|
|
35
|
+
pages: Array<{
|
|
36
|
+
id: string;
|
|
37
|
+
title: string;
|
|
38
|
+
startedAt: string;
|
|
39
|
+
}>;
|
|
40
|
+
entries: HarEntry[];
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Full HAR capture via CDP — intercepts ALL network traffic, not just API endpoints.
|
|
44
|
+
* Returns a controller with getHar() and detach().
|
|
45
|
+
*/
|
|
46
|
+
export declare function attachHarCapture(cdpSession: any, pageTitle?: string): {
|
|
47
|
+
getHar(): HarLog;
|
|
48
|
+
detach(): void;
|
|
49
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Network throttle simulation via CDP.
|
|
3
|
+
*
|
|
4
|
+
* Simulates different network conditions during crawl to test how the app
|
|
5
|
+
* behaves under slow connections. Useful for detecting loading states, error
|
|
6
|
+
* handling, and performance degradation on poor networks.
|
|
7
|
+
*
|
|
8
|
+
* Conditions mirror Chrome DevTools presets:
|
|
9
|
+
* - slow3g: ~500kbps download, high latency
|
|
10
|
+
* - fast3g: ~1.6Mbps download, medium latency
|
|
11
|
+
* - 4g: ~9Mbps download, low latency
|
|
12
|
+
* - offline: no connectivity
|
|
13
|
+
* - none: no throttle (default)
|
|
14
|
+
*/
|
|
15
|
+
export type NetworkConditionPreset = 'none' | 'slow3g' | 'fast3g' | '4g' | 'offline';
|
|
16
|
+
export declare function applyNetworkThrottle(cdpSession: any, preset: NetworkConditionPreset): Promise<void>;
|
|
17
|
+
export declare function clearNetworkThrottle(cdpSession: any): Promise<void>;
|
|
18
|
+
export interface ThrottledCrawlOpts {
|
|
19
|
+
/** Network preset to apply during this URL's crawl */
|
|
20
|
+
preset: NetworkConditionPreset;
|
|
21
|
+
/** Restore to 'none' after navigation (default: true) */
|
|
22
|
+
restoreAfter?: boolean;
|
|
23
|
+
}
|
|
24
|
+
/** Apply throttle, run fn, restore. Returns fn's result. */
|
|
25
|
+
export declare function withNetworkThrottle<T>(cdpSession: any, preset: NetworkConditionPreset, fn: () => Promise<T>, restoreAfter?: boolean): Promise<T>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* OpenAPI 3.0 spec generator from observed network traffic.
|
|
3
|
+
*
|
|
4
|
+
* Takes the ApiEndpointObservationInput[] collected by the network observer
|
|
5
|
+
* during crawl and generates a minimal but valid OpenAPI 3.0 spec.
|
|
6
|
+
*
|
|
7
|
+
* The spec captures: endpoints, methods, observed response shapes, status codes.
|
|
8
|
+
* It does NOT capture request bodies (we'd need to intercept requests too) — that's
|
|
9
|
+
* marked as a TODO. But it's enough for generating smoke-test suites.
|
|
10
|
+
*/
|
|
11
|
+
import type { ApiEndpointObservationInput } from './network-observer.js';
|
|
12
|
+
export interface OpenApiSpec {
|
|
13
|
+
openapi: '3.0.3';
|
|
14
|
+
info: {
|
|
15
|
+
title: string;
|
|
16
|
+
version: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
};
|
|
19
|
+
servers: Array<{
|
|
20
|
+
url: string;
|
|
21
|
+
}>;
|
|
22
|
+
paths: Record<string, Record<string, OpenApiOperation>>;
|
|
23
|
+
}
|
|
24
|
+
interface OpenApiOperation {
|
|
25
|
+
summary: string;
|
|
26
|
+
parameters?: OpenApiParam[];
|
|
27
|
+
responses: Record<string, {
|
|
28
|
+
description: string;
|
|
29
|
+
content?: Record<string, {
|
|
30
|
+
schema: unknown;
|
|
31
|
+
}>;
|
|
32
|
+
}>;
|
|
33
|
+
tags?: string[];
|
|
34
|
+
}
|
|
35
|
+
interface OpenApiParam {
|
|
36
|
+
name: string;
|
|
37
|
+
in: 'path' | 'query';
|
|
38
|
+
required: boolean;
|
|
39
|
+
schema: {
|
|
40
|
+
type: string;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
export declare function generateOpenApiSpec(observations: ApiEndpointObservationInput[], opts?: {
|
|
44
|
+
title?: string;
|
|
45
|
+
baseUrl?: string;
|
|
46
|
+
version?: string;
|
|
47
|
+
}): OpenApiSpec;
|
|
48
|
+
export declare function specToYaml(spec: OpenApiSpec): string;
|
|
49
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PDF extraction — discovers and extracts text from PDF URLs found during crawl.
|
|
3
|
+
*
|
|
4
|
+
* When the HTTP engine or browser engine discovers a link to a .pdf file,
|
|
5
|
+
* this module fetches the PDF, extracts its text content, and returns it
|
|
6
|
+
* as a screen-compatible markdown string for test generation.
|
|
7
|
+
*
|
|
8
|
+
* Uses pdf-parse (already installed in API package, accessible via dynamic import).
|
|
9
|
+
*/
|
|
10
|
+
export interface PdfScreen {
|
|
11
|
+
url: string;
|
|
12
|
+
title: string;
|
|
13
|
+
markdown: string;
|
|
14
|
+
pageCount: number;
|
|
15
|
+
info: Record<string, string>;
|
|
16
|
+
sizeBytes: number;
|
|
17
|
+
}
|
|
18
|
+
export declare function isPdfUrl(url: string, contentType?: string): boolean;
|
|
19
|
+
export declare function extractPdfFromUrl(url: string, opts?: {
|
|
20
|
+
userAgent?: string;
|
|
21
|
+
timeoutMs?: number;
|
|
22
|
+
maxSizeBytes?: number;
|
|
23
|
+
}): Promise<PdfScreen | null>;
|
|
24
|
+
/**
|
|
25
|
+
* Filter a list of discovered URLs to find PDF links.
|
|
26
|
+
* Used by http-engine and browser crawler to decide which links to pass to extractPdfFromUrl.
|
|
27
|
+
*/
|
|
28
|
+
export declare function filterPdfUrls(urls: string[]): string[];
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance metrics collector — captures Core Web Vitals and navigation timing
|
|
3
|
+
* for pages visited during crawl runs.
|
|
4
|
+
* Collects LCP, CLS, INP, TTFB, long tasks, and slow resources via PerformanceObserver
|
|
5
|
+
* and the Navigation/Resource Timing APIs.
|
|
6
|
+
*/
|
|
7
|
+
import type { Page } from 'playwright';
|
|
8
|
+
export type CwvScore = 'good' | 'needs-improvement' | 'poor';
|
|
9
|
+
export interface LcpMetric {
|
|
10
|
+
value: number;
|
|
11
|
+
score: CwvScore;
|
|
12
|
+
elementTag: string | null;
|
|
13
|
+
url: string | null;
|
|
14
|
+
}
|
|
15
|
+
export interface ClsMetric {
|
|
16
|
+
value: number;
|
|
17
|
+
score: CwvScore;
|
|
18
|
+
shiftCount: number;
|
|
19
|
+
}
|
|
20
|
+
export interface InpMetric {
|
|
21
|
+
p75: number;
|
|
22
|
+
score: CwvScore;
|
|
23
|
+
sampleCount: number;
|
|
24
|
+
}
|
|
25
|
+
export interface NavTimingMetric {
|
|
26
|
+
ttfb: number;
|
|
27
|
+
ttfbScore: CwvScore;
|
|
28
|
+
domContentLoaded: number;
|
|
29
|
+
domComplete: number;
|
|
30
|
+
loadComplete: number;
|
|
31
|
+
transferSizeBytes: number;
|
|
32
|
+
protocol: string;
|
|
33
|
+
}
|
|
34
|
+
export interface SlowResource {
|
|
35
|
+
path: string;
|
|
36
|
+
durationMs: number;
|
|
37
|
+
transferSizeBytes: number;
|
|
38
|
+
initiatorType: string;
|
|
39
|
+
}
|
|
40
|
+
export interface PerformanceMetricsResult {
|
|
41
|
+
lcp: LcpMetric | null;
|
|
42
|
+
cls: ClsMetric | null;
|
|
43
|
+
inp: InpMetric | null;
|
|
44
|
+
navTiming: NavTimingMetric | null;
|
|
45
|
+
slowResources: SlowResource[];
|
|
46
|
+
longTaskCount: number;
|
|
47
|
+
captureSuccess: boolean;
|
|
48
|
+
}
|
|
49
|
+
export declare function injectPerformanceObservers(page: Page): Promise<void>;
|
|
50
|
+
export declare function collectPagePerformance(page: Page): Promise<PerformanceMetricsResult>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance metrics collection via CDP + Playwright page.evaluate().
|
|
3
|
+
*
|
|
4
|
+
* Collects Core Web Vitals and resource timing after page navigation.
|
|
5
|
+
* Stored alongside screen data for test generation context and regression detection.
|
|
6
|
+
*
|
|
7
|
+
* Metrics:
|
|
8
|
+
* - LCP (Largest Contentful Paint) — via PerformanceObserver in page
|
|
9
|
+
* - CLS (Cumulative Layout Shift) — via PerformanceObserver in page
|
|
10
|
+
* - TTFB (Time to First Byte) — from navigation timing
|
|
11
|
+
* - DOMContentLoaded — from navigation timing
|
|
12
|
+
* - Resource count and size by type
|
|
13
|
+
*/
|
|
14
|
+
export interface CoreWebVitals {
|
|
15
|
+
lcp?: number;
|
|
16
|
+
cls?: number;
|
|
17
|
+
ttfb?: number;
|
|
18
|
+
fcp?: number;
|
|
19
|
+
domContentLoaded?: number;
|
|
20
|
+
loadEventEnd?: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ResourceSummary {
|
|
23
|
+
scripts: {
|
|
24
|
+
count: number;
|
|
25
|
+
totalBytes: number;
|
|
26
|
+
};
|
|
27
|
+
styles: {
|
|
28
|
+
count: number;
|
|
29
|
+
totalBytes: number;
|
|
30
|
+
};
|
|
31
|
+
images: {
|
|
32
|
+
count: number;
|
|
33
|
+
totalBytes: number;
|
|
34
|
+
};
|
|
35
|
+
fonts: {
|
|
36
|
+
count: number;
|
|
37
|
+
totalBytes: number;
|
|
38
|
+
};
|
|
39
|
+
other: {
|
|
40
|
+
count: number;
|
|
41
|
+
totalBytes: number;
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
export interface PagePerfMetrics {
|
|
45
|
+
url: string;
|
|
46
|
+
vitals: CoreWebVitals;
|
|
47
|
+
resources: ResourceSummary;
|
|
48
|
+
totalTransferBytes: number;
|
|
49
|
+
requestCount: number;
|
|
50
|
+
measuredAt: string;
|
|
51
|
+
}
|
|
52
|
+
export declare function collectPerfMetrics(page: any, url: string): Promise<PagePerfMetrics>;
|
package/types/phash.d.ts
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Composites neutral grey (128,128,128) over each ignoredRegion (fractional
|
|
3
|
+
* 0-1 coordinates) so masked content — timestamps, live counters, ads —
|
|
4
|
+
* contributes nothing to any downstream pixel comparison. Shared by every
|
|
5
|
+
* comparison path (whole-image hash, per-cell grid hash, AI vision) so a
|
|
6
|
+
* region masked once is actually ignored everywhere, not just in the
|
|
7
|
+
* cheapest check.
|
|
8
|
+
*/
|
|
9
|
+
export declare function applyMask(imagePath: string, ignoredRegions: Array<{
|
|
10
|
+
x: number;
|
|
11
|
+
y: number;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
}>): Promise<Buffer>;
|
|
15
|
+
/**
|
|
16
|
+
* Generates a pixelmatch diff image highlighting changed pixels in red.
|
|
17
|
+
* Applies the same ignoredRegions mask as screenshotDiffPercent so masked
|
|
18
|
+
* zones don't show as "changed" in the visual output.
|
|
19
|
+
* Returns a PNG Buffer suitable for upload to S3.
|
|
20
|
+
*/
|
|
21
|
+
export declare function generatePixelmatchDiff(pathA: string, pathB: string, ignoredRegions?: Array<{
|
|
22
|
+
x: number;
|
|
23
|
+
y: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
}>): Promise<Buffer>;
|
|
27
|
+
export declare function screenshotDiffPercent(pathA: string, pathB: string, ignoredRegions?: Array<{
|
|
28
|
+
x: number;
|
|
29
|
+
y: number;
|
|
30
|
+
width: number;
|
|
31
|
+
height: number;
|
|
32
|
+
}>): Promise<{
|
|
33
|
+
pHashDistance: number;
|
|
34
|
+
changeLevel: 'IDENTICAL' | 'MINOR' | 'MODERATE' | 'SIGNIFICANT';
|
|
35
|
+
}>;
|
|
36
|
+
/**
|
|
37
|
+
* Grid-based layout analysis: divides screenshots into a 3×3 grid and computes
|
|
38
|
+
* pHash per cell. Returns which regions changed and where, for the VisualDiff.changes field.
|
|
39
|
+
* Uses sharp's `extract` to crop each cell before hashing.
|
|
40
|
+
*/
|
|
41
|
+
export declare function gridLayoutDiff(pathA: string, pathB: string, ignoredRegions?: Array<{
|
|
42
|
+
x: number;
|
|
43
|
+
y: number;
|
|
44
|
+
width: number;
|
|
45
|
+
height: number;
|
|
46
|
+
}>): Promise<Array<{
|
|
47
|
+
location: string;
|
|
48
|
+
severity: string;
|
|
49
|
+
description: string;
|
|
50
|
+
}>>;
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* PII scrubber — detects and redacts Personally Identifiable Information
|
|
3
|
+
* from crawled markdown, HTML, and extracted text before storage.
|
|
4
|
+
*
|
|
5
|
+
* GDPR Article 4(1): "any information relating to an identified or identifiable natural person"
|
|
6
|
+
*/
|
|
7
|
+
export interface PiiMatch {
|
|
8
|
+
type: 'email' | 'phone' | 'ssn' | 'credit-card' | 'ip-address' | 'passport' | 'iban' | 'dob';
|
|
9
|
+
value: string;
|
|
10
|
+
start: number;
|
|
11
|
+
end: number;
|
|
12
|
+
}
|
|
13
|
+
export interface ScrubResult {
|
|
14
|
+
text: string;
|
|
15
|
+
matches: PiiMatch[];
|
|
16
|
+
scrubbed: boolean;
|
|
17
|
+
}
|
|
18
|
+
export declare function detectPii(text: string): PiiMatch[];
|
|
19
|
+
export declare function scrubPii(text: string): ScrubResult;
|
|
20
|
+
export declare function hasPii(text: string): boolean;
|
|
21
|
+
export declare function scrubObject<T extends Record<string, unknown>>(obj: T, fields: (keyof T)[]): T;
|
|
@@ -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;
|
package/types/proxy.d.ts
ADDED
|
@@ -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>;
|