@reftrixmcp/mcp-server 0.1.7 → 0.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/README.md +36 -6
- package/package.json +46 -41
- package/src/admin/bull-board.ts +177 -0
- package/src/index.ts +32 -1
- package/src/middleware/auth.ts +6 -0
- package/src/middleware/index.ts +13 -0
- package/src/middleware/rate-limiter.ts +525 -0
- package/src/router.ts +36 -3
- package/src/schemas/common-search-filters.ts +42 -0
- package/src/services/background/background-design-db.service.ts +4 -6
- package/src/services/background/background-design-embedding.service.ts +6 -8
- package/src/services/background-search.service.ts +44 -16
- package/src/services/browser-process-manager.ts +29 -24
- package/src/services/layout-embedding.service.ts +18 -28
- package/src/services/layout-search.service.ts +52 -31
- package/src/services/layout-to-code.service.ts +13 -21
- package/src/services/ml/mood-brandtone-embedding.service.ts +4 -10
- package/src/services/motion/analyzers/webgl-motion-analyzer.ts +1 -3
- package/src/services/motion/existing-animation-detector.service.ts +11 -17
- package/src/services/motion/frame-analysis-save.helper.ts +3 -8
- package/src/services/motion/frame-capture.service.ts +5 -5
- package/src/services/motion/frame-embedding.service.ts +30 -46
- package/src/services/motion/js-animation-detector.ts +5 -15
- package/src/services/motion/js-animation-search.service.ts +12 -20
- package/src/services/motion/motion-db.service.ts +21 -31
- package/src/services/motion/three-js-scene-extractor.ts +1 -3
- package/src/services/motion/webgl-animation-detector.service.ts +5 -9
- package/src/services/motion/webgl-animation-embedding.service.ts +3 -5
- package/src/services/motion-persistence.service.ts +13 -19
- package/src/services/motion-search.service.ts +72 -57
- package/src/services/narrative/analyzers/worldview.analyzer.ts +6 -10
- package/src/services/narrative/narrative-analysis.service.ts +10 -16
- package/src/services/narrative/narrative-search.service.ts +89 -40
- package/src/services/narrative/types/narrative.types.ts +24 -6
- package/src/services/page/frame-analyzer.service.ts +1 -3
- package/src/services/page/layout-analyzer.service.ts +224 -303
- package/src/services/page/playwright-crawler.service.ts +14 -20
- package/src/services/page/quality-evaluator.service.ts +1 -3
- package/src/services/page/runtime-animation-detector.service.ts +7 -17
- package/src/services/page/video-recorder.service.ts +2 -6
- package/src/services/page/webgl-detector.service.ts +3 -5
- package/src/services/page-ingest-adapter.ts +269 -251
- package/src/services/part/part-search.service.ts +43 -22
- package/src/services/part/schemas.ts +6 -0
- package/src/services/project-context-analyzer.ts +3 -5
- package/src/services/quality/axe-accessibility.service.ts +3 -5
- package/src/services/quality/benchmark.service.ts +4 -16
- package/src/services/quality/pattern-matcher.service.ts +11 -21
- package/src/services/quality/playwright-axe.service.ts +10 -18
- package/src/services/quality-search.service.ts +16 -17
- package/src/services/responsive/multi-viewport-capture.service.ts +11 -17
- package/src/services/responsive/responsive-analysis-embedding.service.ts +7 -11
- package/src/services/responsive/responsive-analysis.service.ts +7 -11
- package/src/services/responsive/responsive-quality-evaluator.service.ts +4 -6
- package/src/services/responsive-search.service.ts +40 -5
- package/src/services/search-cache.service.ts +166 -0
- package/src/services/service-client.ts +16 -24
- package/src/services/service-initializer.ts +49 -945
- package/src/services/service-registrar-analysis.ts +679 -0
- package/src/services/service-registrar-search.ts +464 -0
- package/src/services/vision/scroll-vision-persistence.service.ts +4 -6
- package/src/services/vision-embedding-search.service.ts +57 -45
- package/src/services/vision-embedding.service.ts +8 -12
- package/src/services/worker-supervisor.service.ts +2 -6
- package/src/tools/background/schemas.ts +2 -1
- package/src/tools/background/search.tool.ts +93 -53
- package/src/tools/brief/validate.handler.ts +11 -26
- package/src/tools/design/search-by-image.tool.ts +891 -0
- package/src/tools/index.ts +42 -1
- package/src/tools/layout/batch-ingest.tool.ts +14 -21
- package/src/tools/layout/ingest.tool.ts +38 -88
- package/src/tools/layout/inspect/inspect.tool.ts +32 -59
- package/src/tools/layout/inspect/visual-extractors.utils.ts +3 -9
- package/src/tools/layout/schemas.ts +11 -8
- package/src/tools/layout/search-executor.ts +699 -0
- package/src/tools/layout/search-helpers.ts +620 -0
- package/src/tools/layout/search.tool.ts +148 -1371
- package/src/tools/layout/to-code.tool.ts +21 -42
- package/src/tools/motion/analyze-frames.handler.ts +19 -37
- package/src/tools/motion/code-generators.ts +1363 -0
- package/src/tools/motion/css-mode-handler.ts +14 -23
- package/src/tools/motion/detect.tool.ts +38 -60
- package/src/tools/motion/detection-modes.ts +4 -8
- package/src/tools/motion/di-factories.ts +87 -110
- package/src/tools/motion/search-helpers.ts +376 -0
- package/src/tools/motion/search.schemas.ts +9 -6
- package/src/tools/motion/search.tool.ts +81 -1717
- package/src/tools/narrative/analyze.tool.ts +14 -30
- package/src/tools/narrative/schemas.ts +14 -11
- package/src/tools/narrative/search.tool.ts +91 -77
- package/src/tools/page/analyze.tool.ts +21 -33
- package/src/tools/page/get-job-status.tool.ts +8 -12
- package/src/tools/page/handlers/db-handler.ts +3 -6
- package/src/tools/page/handlers/embedding-handler.ts +48 -81
- package/src/tools/page/handlers/execution-status-tracker.ts +3 -5
- package/src/tools/page/handlers/js-animation-handler.ts +29 -53
- package/src/tools/page/handlers/layout-handler.ts +45 -73
- package/src/tools/page/handlers/motion-handler.ts +24 -35
- package/src/tools/page/handlers/narrative-handler.ts +12 -24
- package/src/tools/page/handlers/phased-executor.ts +13 -16
- package/src/tools/page/handlers/quality-handler.ts +3 -4
- package/src/tools/page/handlers/result-builder.ts +21 -18
- package/src/tools/page/handlers/sync-helpers.ts +597 -0
- package/src/tools/page/handlers/sync-phase-handlers.ts +1170 -0
- package/src/tools/page/handlers/sync-processing.ts +192 -1542
- package/src/tools/page/handlers/timeout-utils.ts +23 -30
- package/src/tools/page/handlers/video-handler.ts +9 -9
- package/src/tools/page/handlers/webgl-animation-handler.ts +10 -13
- package/src/tools/part/compare.tool.ts +2 -20
- package/src/tools/part/inspect.tool.ts +11 -41
- package/src/tools/part/search.tool.ts +50 -28
- package/src/tools/preference/get.tool.ts +6 -19
- package/src/tools/preference/hear.tool.ts +6 -19
- package/src/tools/preference/reset.tool.ts +6 -19
- package/src/tools/project-get.ts +12 -14
- package/src/tools/project-list.ts +10 -22
- package/src/tools/quality/batch-evaluate.tool.ts +17 -23
- package/src/tools/quality/evaluate.tool.ts +42 -131
- package/src/tools/quality/get-job-status.tool.ts +2 -1
- package/src/tools/responsive/schemas.ts +2 -2
- package/src/tools/responsive/search.tool.ts +73 -46
- package/src/tools/search-unified.tool.ts +582 -0
- package/src/tools/style-get-palette.ts +18 -33
- package/src/tools/system-health.ts +24 -33
- package/src/utils/di-factory.ts +64 -0
- package/src/utils/prisma-wrapper-factory.ts +18 -17
- package/src/utils/sanitize-error.ts +132 -0
- package/src/utils/url-validator.ts +1 -3
- package/src/workers/batch-quality-worker.ts +5 -7
- package/src/workers/page-analyze-worker.ts +38 -24
- package/src/workers/phases/phase-0-ingest.ts +1 -1
- package/src/workers/phases/phase-1-layout.ts +10 -7
- package/src/workers/phases/phase-2-motion.ts +22 -23
- package/src/workers/phases/phase-4-narrative.ts +8 -12
- package/src/workers/phases/phase-5-embedding.ts +669 -457
- package/LICENSE +0 -661
- package/dist/api/health.d.ts +0 -122
- package/dist/api/health.d.ts.map +0 -1
- package/dist/api/health.js +0 -267
- package/dist/api/health.js.map +0 -1
- package/dist/config/index.d.ts +0 -9
- package/dist/config/index.d.ts.map +0 -1
- package/dist/config/index.js +0 -27
- package/dist/config/index.js.map +0 -1
- package/dist/config/redis.d.ts +0 -99
- package/dist/config/redis.d.ts.map +0 -1
- package/dist/config/redis.js +0 -234
- package/dist/config/redis.js.map +0 -1
- package/dist/index.d.ts +0 -18
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -247
- package/dist/index.js.map +0 -1
- package/dist/lib/index.d.ts +0 -6
- package/dist/lib/index.d.ts.map +0 -1
- package/dist/lib/index.js +0 -14
- package/dist/lib/index.js.map +0 -1
- package/dist/lib/project-context.d.ts +0 -51
- package/dist/lib/project-context.d.ts.map +0 -1
- package/dist/lib/project-context.js +0 -109
- package/dist/lib/project-context.js.map +0 -1
- package/dist/middleware/args-type-coercion.d.ts +0 -59
- package/dist/middleware/args-type-coercion.d.ts.map +0 -1
- package/dist/middleware/args-type-coercion.js +0 -187
- package/dist/middleware/args-type-coercion.js.map +0 -1
- package/dist/middleware/auth.d.ts +0 -122
- package/dist/middleware/auth.d.ts.map +0 -1
- package/dist/middleware/auth.js +0 -430
- package/dist/middleware/auth.js.map +0 -1
- package/dist/middleware/index.d.ts +0 -10
- package/dist/middleware/index.d.ts.map +0 -1
- package/dist/middleware/index.js +0 -38
- package/dist/middleware/index.js.map +0 -1
- package/dist/middleware/light-response-controller.d.ts +0 -206
- package/dist/middleware/light-response-controller.d.ts.map +0 -1
- package/dist/middleware/light-response-controller.js +0 -555
- package/dist/middleware/light-response-controller.js.map +0 -1
- package/dist/middleware/response-size-warning.d.ts +0 -97
- package/dist/middleware/response-size-warning.d.ts.map +0 -1
- package/dist/middleware/response-size-warning.js +0 -137
- package/dist/middleware/response-size-warning.js.map +0 -1
- package/dist/queues/batch-quality-queue.d.ts +0 -225
- package/dist/queues/batch-quality-queue.d.ts.map +0 -1
- package/dist/queues/batch-quality-queue.js +0 -375
- package/dist/queues/batch-quality-queue.js.map +0 -1
- package/dist/queues/index.d.ts +0 -10
- package/dist/queues/index.d.ts.map +0 -1
- package/dist/queues/index.js +0 -28
- package/dist/queues/index.js.map +0 -1
- package/dist/queues/page-analyze-queue.d.ts +0 -287
- package/dist/queues/page-analyze-queue.d.ts.map +0 -1
- package/dist/queues/page-analyze-queue.js +0 -219
- package/dist/queues/page-analyze-queue.js.map +0 -1
- package/dist/router.d.ts +0 -144
- package/dist/router.d.ts.map +0 -1
- package/dist/router.js +0 -261
- package/dist/router.js.map +0 -1
- package/dist/schemas/creative/index.d.ts +0 -8
- package/dist/schemas/creative/index.d.ts.map +0 -1
- package/dist/schemas/creative/index.js +0 -23
- package/dist/schemas/creative/index.js.map +0 -1
- package/dist/schemas/creative/palette.schema.d.ts +0 -741
- package/dist/schemas/creative/palette.schema.d.ts.map +0 -1
- package/dist/schemas/creative/palette.schema.js +0 -154
- package/dist/schemas/creative/palette.schema.js.map +0 -1
- package/dist/schemas/mood-brandtone-filters.d.ts +0 -740
- package/dist/schemas/mood-brandtone-filters.d.ts.map +0 -1
- package/dist/schemas/mood-brandtone-filters.js +0 -265
- package/dist/schemas/mood-brandtone-filters.js.map +0 -1
- package/dist/scripts/backfill-embeddings.d.ts +0 -3
- package/dist/scripts/backfill-embeddings.d.ts.map +0 -1
- package/dist/scripts/backfill-embeddings.js +0 -385
- package/dist/scripts/backfill-embeddings.js.map +0 -1
- package/dist/scripts/check-embedding-coverage.d.ts +0 -3
- package/dist/scripts/check-embedding-coverage.d.ts.map +0 -1
- package/dist/scripts/check-embedding-coverage.js +0 -103
- package/dist/scripts/check-embedding-coverage.js.map +0 -1
- package/dist/scripts/start-workers.d.ts +0 -3
- package/dist/scripts/start-workers.d.ts.map +0 -1
- package/dist/scripts/start-workers.js +0 -447
- package/dist/scripts/start-workers.js.map +0 -1
- package/dist/server.d.ts +0 -49
- package/dist/server.d.ts.map +0 -1
- package/dist/server.js +0 -237
- package/dist/server.js.map +0 -1
- package/dist/services/background/background-design-db.service.d.ts +0 -65
- package/dist/services/background/background-design-db.service.d.ts.map +0 -1
- package/dist/services/background/background-design-db.service.js +0 -138
- package/dist/services/background/background-design-db.service.js.map +0 -1
- package/dist/services/background/background-design-detector.service.d.ts +0 -125
- package/dist/services/background/background-design-detector.service.d.ts.map +0 -1
- package/dist/services/background/background-design-detector.service.js +0 -1106
- package/dist/services/background/background-design-detector.service.js.map +0 -1
- package/dist/services/background/background-design-embedding.service.d.ts +0 -188
- package/dist/services/background/background-design-embedding.service.d.ts.map +0 -1
- package/dist/services/background/background-design-embedding.service.js +0 -386
- package/dist/services/background/background-design-embedding.service.js.map +0 -1
- package/dist/services/background-search.service.d.ts +0 -43
- package/dist/services/background-search.service.d.ts.map +0 -1
- package/dist/services/background-search.service.js +0 -235
- package/dist/services/background-search.service.js.map +0 -1
- package/dist/services/backup-service.d.ts +0 -135
- package/dist/services/backup-service.d.ts.map +0 -1
- package/dist/services/backup-service.js +0 -357
- package/dist/services/backup-service.js.map +0 -1
- package/dist/services/brief/brief-parser-service.d.ts +0 -47
- package/dist/services/brief/brief-parser-service.d.ts.map +0 -1
- package/dist/services/brief/brief-parser-service.js +0 -380
- package/dist/services/brief/brief-parser-service.js.map +0 -1
- package/dist/services/brief/schemas/brief-parser-schemas.d.ts +0 -278
- package/dist/services/brief/schemas/brief-parser-schemas.d.ts.map +0 -1
- package/dist/services/brief/schemas/brief-parser-schemas.js +0 -116
- package/dist/services/brief/schemas/brief-parser-schemas.js.map +0 -1
- package/dist/services/browser-process-manager.d.ts +0 -116
- package/dist/services/browser-process-manager.d.ts.map +0 -1
- package/dist/services/browser-process-manager.js +0 -259
- package/dist/services/browser-process-manager.js.map +0 -1
- package/dist/services/cache.d.ts +0 -119
- package/dist/services/cache.d.ts.map +0 -1
- package/dist/services/cache.js +0 -233
- package/dist/services/cache.js.map +0 -1
- package/dist/services/checksum-service.d.ts +0 -122
- package/dist/services/checksum-service.d.ts.map +0 -1
- package/dist/services/checksum-service.js +0 -270
- package/dist/services/checksum-service.js.map +0 -1
- package/dist/services/css-analysis-cache.service.d.ts +0 -248
- package/dist/services/css-analysis-cache.service.d.ts.map +0 -1
- package/dist/services/css-analysis-cache.service.js +0 -398
- package/dist/services/css-analysis-cache.service.js.map +0 -1
- package/dist/services/database-dumper.service.d.ts +0 -181
- package/dist/services/database-dumper.service.d.ts.map +0 -1
- package/dist/services/database-dumper.service.js +0 -550
- package/dist/services/database-dumper.service.js.map +0 -1
- package/dist/services/embedding-backfill.service.d.ts +0 -53
- package/dist/services/embedding-backfill.service.d.ts.map +0 -1
- package/dist/services/embedding-backfill.service.js +0 -672
- package/dist/services/embedding-backfill.service.js.map +0 -1
- package/dist/services/embedding-validation.service.d.ts +0 -64
- package/dist/services/embedding-validation.service.d.ts.map +0 -1
- package/dist/services/embedding-validation.service.js +0 -141
- package/dist/services/embedding-validation.service.js.map +0 -1
- package/dist/services/encryption-service.d.ts +0 -171
- package/dist/services/encryption-service.d.ts.map +0 -1
- package/dist/services/encryption-service.js +0 -343
- package/dist/services/encryption-service.js.map +0 -1
- package/dist/services/external-css-fetcher.d.ts +0 -185
- package/dist/services/external-css-fetcher.d.ts.map +0 -1
- package/dist/services/external-css-fetcher.js +0 -667
- package/dist/services/external-css-fetcher.js.map +0 -1
- package/dist/services/gpu-resource-manager.d.ts +0 -180
- package/dist/services/gpu-resource-manager.d.ts.map +0 -1
- package/dist/services/gpu-resource-manager.js +0 -485
- package/dist/services/gpu-resource-manager.js.map +0 -1
- package/dist/services/index.d.ts +0 -15
- package/dist/services/index.d.ts.map +0 -1
- package/dist/services/index.js +0 -73
- package/dist/services/index.js.map +0 -1
- package/dist/services/layout/component-splitter.d.ts +0 -63
- package/dist/services/layout/component-splitter.d.ts.map +0 -1
- package/dist/services/layout/component-splitter.js +0 -508
- package/dist/services/layout/component-splitter.js.map +0 -1
- package/dist/services/layout/html-to-jsx-converter.d.ts +0 -40
- package/dist/services/layout/html-to-jsx-converter.d.ts.map +0 -1
- package/dist/services/layout/html-to-jsx-converter.js +0 -484
- package/dist/services/layout/html-to-jsx-converter.js.map +0 -1
- package/dist/services/layout/semantic-html-converter.d.ts +0 -67
- package/dist/services/layout/semantic-html-converter.d.ts.map +0 -1
- package/dist/services/layout/semantic-html-converter.js +0 -247
- package/dist/services/layout/semantic-html-converter.js.map +0 -1
- package/dist/services/layout/style-to-tailwind-mapper.d.ts +0 -82
- package/dist/services/layout/style-to-tailwind-mapper.d.ts.map +0 -1
- package/dist/services/layout/style-to-tailwind-mapper.js +0 -1334
- package/dist/services/layout/style-to-tailwind-mapper.js.map +0 -1
- package/dist/services/layout-embedding.service.d.ts +0 -415
- package/dist/services/layout-embedding.service.d.ts.map +0 -1
- package/dist/services/layout-embedding.service.js +0 -1147
- package/dist/services/layout-embedding.service.js.map +0 -1
- package/dist/services/layout-generate-code-service-export.d.ts +0 -38
- package/dist/services/layout-generate-code-service-export.d.ts.map +0 -1
- package/dist/services/layout-generate-code-service-export.js +0 -77
- package/dist/services/layout-generate-code-service-export.js.map +0 -1
- package/dist/services/layout-search-service-export.d.ts +0 -31
- package/dist/services/layout-search-service-export.d.ts.map +0 -1
- package/dist/services/layout-search-service-export.js +0 -43
- package/dist/services/layout-search-service-export.js.map +0 -1
- package/dist/services/layout-search.service.d.ts +0 -111
- package/dist/services/layout-search.service.d.ts.map +0 -1
- package/dist/services/layout-search.service.js +0 -716
- package/dist/services/layout-search.service.js.map +0 -1
- package/dist/services/layout-to-code.service.d.ts +0 -85
- package/dist/services/layout-to-code.service.d.ts.map +0 -1
- package/dist/services/layout-to-code.service.js +0 -1368
- package/dist/services/layout-to-code.service.js.map +0 -1
- package/dist/services/metrics-collector.d.ts +0 -189
- package/dist/services/metrics-collector.d.ts.map +0 -1
- package/dist/services/metrics-collector.js +0 -344
- package/dist/services/metrics-collector.js.map +0 -1
- package/dist/services/ml/mood-brandtone-embedding.service.d.ts +0 -253
- package/dist/services/ml/mood-brandtone-embedding.service.d.ts.map +0 -1
- package/dist/services/ml/mood-brandtone-embedding.service.js +0 -678
- package/dist/services/ml/mood-brandtone-embedding.service.js.map +0 -1
- package/dist/services/motion/analyzers/color-change.analyzer.d.ts +0 -274
- package/dist/services/motion/analyzers/color-change.analyzer.d.ts.map +0 -1
- package/dist/services/motion/analyzers/color-change.analyzer.js +0 -644
- package/dist/services/motion/analyzers/color-change.analyzer.js.map +0 -1
- package/dist/services/motion/analyzers/frame-diff.analyzer.d.ts +0 -109
- package/dist/services/motion/analyzers/frame-diff.analyzer.d.ts.map +0 -1
- package/dist/services/motion/analyzers/frame-diff.analyzer.js +0 -315
- package/dist/services/motion/analyzers/frame-diff.analyzer.js.map +0 -1
- package/dist/services/motion/analyzers/layout-shift.detector.d.ts +0 -132
- package/dist/services/motion/analyzers/layout-shift.detector.d.ts.map +0 -1
- package/dist/services/motion/analyzers/layout-shift.detector.js +0 -179
- package/dist/services/motion/analyzers/layout-shift.detector.js.map +0 -1
- package/dist/services/motion/analyzers/motion-vector.estimator.d.ts +0 -88
- package/dist/services/motion/analyzers/motion-vector.estimator.d.ts.map +0 -1
- package/dist/services/motion/analyzers/motion-vector.estimator.js +0 -494
- package/dist/services/motion/analyzers/motion-vector.estimator.js.map +0 -1
- package/dist/services/motion/analyzers/webgl-motion-analyzer.d.ts +0 -167
- package/dist/services/motion/analyzers/webgl-motion-analyzer.d.ts.map +0 -1
- package/dist/services/motion/analyzers/webgl-motion-analyzer.js +0 -500
- package/dist/services/motion/analyzers/webgl-motion-analyzer.js.map +0 -1
- package/dist/services/motion/animation-metrics-collector.service.d.ts +0 -215
- package/dist/services/motion/animation-metrics-collector.service.d.ts.map +0 -1
- package/dist/services/motion/animation-metrics-collector.service.js +0 -502
- package/dist/services/motion/animation-metrics-collector.service.js.map +0 -1
- package/dist/services/motion/cls-calculator.service.d.ts +0 -186
- package/dist/services/motion/cls-calculator.service.d.ts.map +0 -1
- package/dist/services/motion/cls-calculator.service.js +0 -329
- package/dist/services/motion/cls-calculator.service.js.map +0 -1
- package/dist/services/motion/existing-animation-detector.service.d.ts +0 -208
- package/dist/services/motion/existing-animation-detector.service.d.ts.map +0 -1
- package/dist/services/motion/existing-animation-detector.service.js +0 -591
- package/dist/services/motion/existing-animation-detector.service.js.map +0 -1
- package/dist/services/motion/fade-detector.service.d.ts +0 -114
- package/dist/services/motion/fade-detector.service.d.ts.map +0 -1
- package/dist/services/motion/fade-detector.service.js +0 -249
- package/dist/services/motion/fade-detector.service.js.map +0 -1
- package/dist/services/motion/frame-analysis-save.helper.d.ts +0 -41
- package/dist/services/motion/frame-analysis-save.helper.d.ts.map +0 -1
- package/dist/services/motion/frame-analysis-save.helper.js +0 -235
- package/dist/services/motion/frame-analysis-save.helper.js.map +0 -1
- package/dist/services/motion/frame-capture.service.d.ts +0 -170
- package/dist/services/motion/frame-capture.service.d.ts.map +0 -1
- package/dist/services/motion/frame-capture.service.js +0 -476
- package/dist/services/motion/frame-capture.service.js.map +0 -1
- package/dist/services/motion/frame-embedding.service.d.ts +0 -315
- package/dist/services/motion/frame-embedding.service.d.ts.map +0 -1
- package/dist/services/motion/frame-embedding.service.js +0 -1023
- package/dist/services/motion/frame-embedding.service.js.map +0 -1
- package/dist/services/motion/frame-image-analysis.service.d.ts +0 -126
- package/dist/services/motion/frame-image-analysis.service.d.ts.map +0 -1
- package/dist/services/motion/frame-image-analysis.service.js +0 -982
- package/dist/services/motion/frame-image-analysis.service.js.map +0 -1
- package/dist/services/motion/frame-image-analyzer.adapter.d.ts +0 -168
- package/dist/services/motion/frame-image-analyzer.adapter.d.ts.map +0 -1
- package/dist/services/motion/frame-image-analyzer.adapter.js +0 -520
- package/dist/services/motion/frame-image-analyzer.adapter.js.map +0 -1
- package/dist/services/motion/frame-worker-pool.service.d.ts +0 -133
- package/dist/services/motion/frame-worker-pool.service.d.ts.map +0 -1
- package/dist/services/motion/frame-worker-pool.service.js +0 -410
- package/dist/services/motion/frame-worker-pool.service.js.map +0 -1
- package/dist/services/motion/infrastructure/frame-loader.d.ts +0 -77
- package/dist/services/motion/infrastructure/frame-loader.d.ts.map +0 -1
- package/dist/services/motion/infrastructure/frame-loader.js +0 -430
- package/dist/services/motion/infrastructure/frame-loader.js.map +0 -1
- package/dist/services/motion/js-animation-detector.d.ts +0 -382
- package/dist/services/motion/js-animation-detector.d.ts.map +0 -1
- package/dist/services/motion/js-animation-detector.js +0 -911
- package/dist/services/motion/js-animation-detector.js.map +0 -1
- package/dist/services/motion/js-animation-embedding.service.d.ts +0 -114
- package/dist/services/motion/js-animation-embedding.service.d.ts.map +0 -1
- package/dist/services/motion/js-animation-embedding.service.js +0 -289
- package/dist/services/motion/js-animation-embedding.service.js.map +0 -1
- package/dist/services/motion/js-animation-search.service.d.ts +0 -138
- package/dist/services/motion/js-animation-search.service.d.ts.map +0 -1
- package/dist/services/motion/js-animation-search.service.js +0 -503
- package/dist/services/motion/js-animation-search.service.js.map +0 -1
- package/dist/services/motion/motion-db.service.d.ts +0 -231
- package/dist/services/motion/motion-db.service.d.ts.map +0 -1
- package/dist/services/motion/motion-db.service.js +0 -676
- package/dist/services/motion/motion-db.service.js.map +0 -1
- package/dist/services/motion/three-js-scene-extractor.d.ts +0 -274
- package/dist/services/motion/three-js-scene-extractor.d.ts.map +0 -1
- package/dist/services/motion/three-js-scene-extractor.js +0 -1126
- package/dist/services/motion/three-js-scene-extractor.js.map +0 -1
- package/dist/services/motion/types.d.ts +0 -592
- package/dist/services/motion/types.d.ts.map +0 -1
- package/dist/services/motion/types.js +0 -121
- package/dist/services/motion/types.js.map +0 -1
- package/dist/services/motion/visual-category-classifier.d.ts +0 -273
- package/dist/services/motion/visual-category-classifier.d.ts.map +0 -1
- package/dist/services/motion/visual-category-classifier.js +0 -1060
- package/dist/services/motion/visual-category-classifier.js.map +0 -1
- package/dist/services/motion/webgl-animation-categorizer.d.ts +0 -151
- package/dist/services/motion/webgl-animation-categorizer.d.ts.map +0 -1
- package/dist/services/motion/webgl-animation-categorizer.js +0 -568
- package/dist/services/motion/webgl-animation-categorizer.js.map +0 -1
- package/dist/services/motion/webgl-animation-detector.service.d.ts +0 -204
- package/dist/services/motion/webgl-animation-detector.service.d.ts.map +0 -1
- package/dist/services/motion/webgl-animation-detector.service.js +0 -518
- package/dist/services/motion/webgl-animation-detector.service.js.map +0 -1
- package/dist/services/motion/webgl-animation-embedding.service.d.ts +0 -238
- package/dist/services/motion/webgl-animation-embedding.service.d.ts.map +0 -1
- package/dist/services/motion/webgl-animation-embedding.service.js +0 -368
- package/dist/services/motion/webgl-animation-embedding.service.js.map +0 -1
- package/dist/services/motion-detect-service-export.d.ts +0 -130
- package/dist/services/motion-detect-service-export.d.ts.map +0 -1
- package/dist/services/motion-detect-service-export.js +0 -160
- package/dist/services/motion-detect-service-export.js.map +0 -1
- package/dist/services/motion-persistence.service.d.ts +0 -144
- package/dist/services/motion-persistence.service.d.ts.map +0 -1
- package/dist/services/motion-persistence.service.js +0 -398
- package/dist/services/motion-persistence.service.js.map +0 -1
- package/dist/services/motion-search-service.d.ts +0 -10
- package/dist/services/motion-search-service.d.ts.map +0 -1
- package/dist/services/motion-search-service.js +0 -22
- package/dist/services/motion-search-service.js.map +0 -1
- package/dist/services/motion-search.service.d.ts +0 -210
- package/dist/services/motion-search.service.d.ts.map +0 -1
- package/dist/services/motion-search.service.js +0 -900
- package/dist/services/motion-search.service.js.map +0 -1
- package/dist/services/narrative/analyzers/layout-structure.analyzer.d.ts +0 -75
- package/dist/services/narrative/analyzers/layout-structure.analyzer.d.ts.map +0 -1
- package/dist/services/narrative/analyzers/layout-structure.analyzer.js +0 -489
- package/dist/services/narrative/analyzers/layout-structure.analyzer.js.map +0 -1
- package/dist/services/narrative/analyzers/worldview.analyzer.d.ts +0 -92
- package/dist/services/narrative/analyzers/worldview.analyzer.d.ts.map +0 -1
- package/dist/services/narrative/analyzers/worldview.analyzer.js +0 -477
- package/dist/services/narrative/analyzers/worldview.analyzer.js.map +0 -1
- package/dist/services/narrative/generators/confidence-calculator.d.ts +0 -65
- package/dist/services/narrative/generators/confidence-calculator.d.ts.map +0 -1
- package/dist/services/narrative/generators/confidence-calculator.js +0 -316
- package/dist/services/narrative/generators/confidence-calculator.js.map +0 -1
- package/dist/services/narrative/generators/text-representation.generator.d.ts +0 -67
- package/dist/services/narrative/generators/text-representation.generator.d.ts.map +0 -1
- package/dist/services/narrative/generators/text-representation.generator.js +0 -312
- package/dist/services/narrative/generators/text-representation.generator.js.map +0 -1
- package/dist/services/narrative/index.d.ts +0 -16
- package/dist/services/narrative/index.d.ts.map +0 -1
- package/dist/services/narrative/index.js +0 -63
- package/dist/services/narrative/index.js.map +0 -1
- package/dist/services/narrative/narrative-analysis.service.d.ts +0 -120
- package/dist/services/narrative/narrative-analysis.service.d.ts.map +0 -1
- package/dist/services/narrative/narrative-analysis.service.js +0 -479
- package/dist/services/narrative/narrative-analysis.service.js.map +0 -1
- package/dist/services/narrative/narrative-search.service.d.ts +0 -126
- package/dist/services/narrative/narrative-search.service.d.ts.map +0 -1
- package/dist/services/narrative/narrative-search.service.js +0 -516
- package/dist/services/narrative/narrative-search.service.js.map +0 -1
- package/dist/services/narrative/types/narrative.types.d.ts +0 -372
- package/dist/services/narrative/types/narrative.types.d.ts.map +0 -1
- package/dist/services/narrative/types/narrative.types.js +0 -5
- package/dist/services/narrative/types/narrative.types.js.map +0 -1
- package/dist/services/orphaned-job-utils.d.ts +0 -62
- package/dist/services/orphaned-job-utils.d.ts.map +0 -1
- package/dist/services/orphaned-job-utils.js +0 -130
- package/dist/services/orphaned-job-utils.js.map +0 -1
- package/dist/services/page/css-animation-parser.service.d.ts +0 -173
- package/dist/services/page/css-animation-parser.service.d.ts.map +0 -1
- package/dist/services/page/css-animation-parser.service.js +0 -537
- package/dist/services/page/css-animation-parser.service.js.map +0 -1
- package/dist/services/page/fallback-analyzer.service.d.ts +0 -140
- package/dist/services/page/fallback-analyzer.service.d.ts.map +0 -1
- package/dist/services/page/fallback-analyzer.service.js +0 -289
- package/dist/services/page/fallback-analyzer.service.js.map +0 -1
- package/dist/services/page/frame-analyzer.service.d.ts +0 -208
- package/dist/services/page/frame-analyzer.service.d.ts.map +0 -1
- package/dist/services/page/frame-analyzer.service.js +0 -628
- package/dist/services/page/frame-analyzer.service.js.map +0 -1
- package/dist/services/page/layout-analyzer.service.d.ts +0 -323
- package/dist/services/page/layout-analyzer.service.d.ts.map +0 -1
- package/dist/services/page/layout-analyzer.service.js +0 -2001
- package/dist/services/page/layout-analyzer.service.js.map +0 -1
- package/dist/services/page/motion-category-classifier.service.d.ts +0 -72
- package/dist/services/page/motion-category-classifier.service.d.ts.map +0 -1
- package/dist/services/page/motion-category-classifier.service.js +0 -340
- package/dist/services/page/motion-category-classifier.service.js.map +0 -1
- package/dist/services/page/motion-detector.service.d.ts +0 -76
- package/dist/services/page/motion-detector.service.d.ts.map +0 -1
- package/dist/services/page/motion-detector.service.js +0 -255
- package/dist/services/page/motion-detector.service.js.map +0 -1
- package/dist/services/page/motion-performance-analyzer.service.d.ts +0 -114
- package/dist/services/page/motion-performance-analyzer.service.d.ts.map +0 -1
- package/dist/services/page/motion-performance-analyzer.service.js +0 -315
- package/dist/services/page/motion-performance-analyzer.service.js.map +0 -1
- package/dist/services/page/playwright-crawler.service.d.ts +0 -106
- package/dist/services/page/playwright-crawler.service.d.ts.map +0 -1
- package/dist/services/page/playwright-crawler.service.js +0 -373
- package/dist/services/page/playwright-crawler.service.js.map +0 -1
- package/dist/services/page/quality-evaluator.service.d.ts +0 -107
- package/dist/services/page/quality-evaluator.service.d.ts.map +0 -1
- package/dist/services/page/quality-evaluator.service.js +0 -1138
- package/dist/services/page/quality-evaluator.service.js.map +0 -1
- package/dist/services/page/runtime-animation-detector.service.d.ts +0 -154
- package/dist/services/page/runtime-animation-detector.service.d.ts.map +0 -1
- package/dist/services/page/runtime-animation-detector.service.js +0 -480
- package/dist/services/page/runtime-animation-detector.service.js.map +0 -1
- package/dist/services/page/section-postprocessor.service.d.ts +0 -55
- package/dist/services/page/section-postprocessor.service.d.ts.map +0 -1
- package/dist/services/page/section-postprocessor.service.js +0 -708
- package/dist/services/page/section-postprocessor.service.js.map +0 -1
- package/dist/services/page/video-recorder.service.d.ts +0 -110
- package/dist/services/page/video-recorder.service.d.ts.map +0 -1
- package/dist/services/page/video-recorder.service.js +0 -441
- package/dist/services/page/video-recorder.service.js.map +0 -1
- package/dist/services/page/webgl-detector.service.d.ts +0 -113
- package/dist/services/page/webgl-detector.service.d.ts.map +0 -1
- package/dist/services/page/webgl-detector.service.js +0 -280
- package/dist/services/page/webgl-detector.service.js.map +0 -1
- package/dist/services/page-analyze-service.d.ts +0 -30
- package/dist/services/page-analyze-service.d.ts.map +0 -1
- package/dist/services/page-analyze-service.js +0 -58
- package/dist/services/page-analyze-service.js.map +0 -1
- package/dist/services/page-ingest-adapter.d.ts +0 -479
- package/dist/services/page-ingest-adapter.d.ts.map +0 -1
- package/dist/services/page-ingest-adapter.js +0 -1726
- package/dist/services/page-ingest-adapter.js.map +0 -1
- package/dist/services/palette-service-export.d.ts +0 -26
- package/dist/services/palette-service-export.d.ts.map +0 -1
- package/dist/services/palette-service-export.js +0 -22
- package/dist/services/palette-service-export.js.map +0 -1
- package/dist/services/part/index.d.ts +0 -22
- package/dist/services/part/index.d.ts.map +0 -1
- package/dist/services/part/index.js +0 -72
- package/dist/services/part/index.js.map +0 -1
- package/dist/services/part/part-backfill.service.d.ts +0 -66
- package/dist/services/part/part-backfill.service.d.ts.map +0 -1
- package/dist/services/part/part-backfill.service.js +0 -195
- package/dist/services/part/part-backfill.service.js.map +0 -1
- package/dist/services/part/part-bbox-playwright.service.d.ts +0 -85
- package/dist/services/part/part-bbox-playwright.service.d.ts.map +0 -1
- package/dist/services/part/part-bbox-playwright.service.js +0 -362
- package/dist/services/part/part-bbox-playwright.service.js.map +0 -1
- package/dist/services/part/part-db.service.d.ts +0 -41
- package/dist/services/part/part-db.service.d.ts.map +0 -1
- package/dist/services/part/part-db.service.js +0 -82
- package/dist/services/part/part-db.service.js.map +0 -1
- package/dist/services/part/part-embedding-db.service.d.ts +0 -52
- package/dist/services/part/part-embedding-db.service.d.ts.map +0 -1
- package/dist/services/part/part-embedding-db.service.js +0 -122
- package/dist/services/part/part-embedding-db.service.js.map +0 -1
- package/dist/services/part/part-embedding.service.d.ts +0 -140
- package/dist/services/part/part-embedding.service.d.ts.map +0 -1
- package/dist/services/part/part-embedding.service.js +0 -276
- package/dist/services/part/part-embedding.service.js.map +0 -1
- package/dist/services/part/part-extraction.service.d.ts +0 -75
- package/dist/services/part/part-extraction.service.d.ts.map +0 -1
- package/dist/services/part/part-extraction.service.js +0 -519
- package/dist/services/part/part-extraction.service.js.map +0 -1
- package/dist/services/part/part-search.service.d.ts +0 -180
- package/dist/services/part/part-search.service.d.ts.map +0 -1
- package/dist/services/part/part-search.service.js +0 -565
- package/dist/services/part/part-search.service.js.map +0 -1
- package/dist/services/part/schemas.d.ts +0 -232
- package/dist/services/part/schemas.d.ts.map +0 -1
- package/dist/services/part/schemas.js +0 -167
- package/dist/services/part/schemas.js.map +0 -1
- package/dist/services/part/section-screenshot-fallback.service.d.ts +0 -101
- package/dist/services/part/section-screenshot-fallback.service.d.ts.map +0 -1
- package/dist/services/part/section-screenshot-fallback.service.js +0 -489
- package/dist/services/part/section-screenshot-fallback.service.js.map +0 -1
- package/dist/services/part/types.d.ts +0 -189
- package/dist/services/part/types.d.ts.map +0 -1
- package/dist/services/part/types.js +0 -139
- package/dist/services/part/types.js.map +0 -1
- package/dist/services/persistent-cache.d.ts +0 -209
- package/dist/services/persistent-cache.d.ts.map +0 -1
- package/dist/services/persistent-cache.js +0 -633
- package/dist/services/persistent-cache.js.map +0 -1
- package/dist/services/preference-profile.service.d.ts +0 -143
- package/dist/services/preference-profile.service.d.ts.map +0 -1
- package/dist/services/preference-profile.service.js +0 -604
- package/dist/services/preference-profile.service.js.map +0 -1
- package/dist/services/preference-rerank.helper.d.ts +0 -128
- package/dist/services/preference-rerank.helper.d.ts.map +0 -1
- package/dist/services/preference-rerank.helper.js +0 -397
- package/dist/services/preference-rerank.helper.js.map +0 -1
- package/dist/services/production-guard.d.ts +0 -213
- package/dist/services/production-guard.d.ts.map +0 -1
- package/dist/services/production-guard.js +0 -357
- package/dist/services/production-guard.js.map +0 -1
- package/dist/services/project-context-analyzer.d.ts +0 -194
- package/dist/services/project-context-analyzer.d.ts.map +0 -1
- package/dist/services/project-context-analyzer.js +0 -747
- package/dist/services/project-context-analyzer.js.map +0 -1
- package/dist/services/quality/axe-accessibility.service.d.ts +0 -87
- package/dist/services/quality/axe-accessibility.service.d.ts.map +0 -1
- package/dist/services/quality/axe-accessibility.service.js +0 -188
- package/dist/services/quality/axe-accessibility.service.js.map +0 -1
- package/dist/services/quality/axe-core-shared.d.ts +0 -108
- package/dist/services/quality/axe-core-shared.d.ts.map +0 -1
- package/dist/services/quality/axe-core-shared.js +0 -136
- package/dist/services/quality/axe-core-shared.js.map +0 -1
- package/dist/services/quality/benchmark.service.d.ts +0 -178
- package/dist/services/quality/benchmark.service.d.ts.map +0 -1
- package/dist/services/quality/benchmark.service.js +0 -394
- package/dist/services/quality/benchmark.service.js.map +0 -1
- package/dist/services/quality/content-gap-detector.service.d.ts +0 -133
- package/dist/services/quality/content-gap-detector.service.d.ts.map +0 -1
- package/dist/services/quality/content-gap-detector.service.js +0 -364
- package/dist/services/quality/content-gap-detector.service.js.map +0 -1
- package/dist/services/quality/index.d.ts +0 -12
- package/dist/services/quality/index.d.ts.map +0 -1
- package/dist/services/quality/index.js +0 -12
- package/dist/services/quality/index.js.map +0 -1
- package/dist/services/quality/pattern-matcher.service.d.ts +0 -195
- package/dist/services/quality/pattern-matcher.service.d.ts.map +0 -1
- package/dist/services/quality/pattern-matcher.service.js +0 -630
- package/dist/services/quality/pattern-matcher.service.js.map +0 -1
- package/dist/services/quality/playwright-axe.service.d.ts +0 -84
- package/dist/services/quality/playwright-axe.service.d.ts.map +0 -1
- package/dist/services/quality/playwright-axe.service.js +0 -267
- package/dist/services/quality/playwright-axe.service.js.map +0 -1
- package/dist/services/quality/quality-evaluate.service.interface.d.ts +0 -216
- package/dist/services/quality/quality-evaluate.service.interface.d.ts.map +0 -1
- package/dist/services/quality/quality-evaluate.service.interface.js +0 -5
- package/dist/services/quality/quality-evaluate.service.interface.js.map +0 -1
- package/dist/services/quality/visual-design-analyzer.service.d.ts +0 -72
- package/dist/services/quality/visual-design-analyzer.service.d.ts.map +0 -1
- package/dist/services/quality/visual-design-analyzer.service.js +0 -762
- package/dist/services/quality/visual-design-analyzer.service.js.map +0 -1
- package/dist/services/quality-evaluate-service-export.d.ts +0 -122
- package/dist/services/quality-evaluate-service-export.d.ts.map +0 -1
- package/dist/services/quality-evaluate-service-export.js +0 -138
- package/dist/services/quality-evaluate-service-export.js.map +0 -1
- package/dist/services/quality-search.service.d.ts +0 -20
- package/dist/services/quality-search.service.d.ts.map +0 -1
- package/dist/services/quality-search.service.js +0 -260
- package/dist/services/quality-search.service.js.map +0 -1
- package/dist/services/query-analyzer.d.ts +0 -107
- package/dist/services/query-analyzer.d.ts.map +0 -1
- package/dist/services/query-analyzer.js +0 -222
- package/dist/services/query-analyzer.js.map +0 -1
- package/dist/services/query-context-analyzer.d.ts +0 -85
- package/dist/services/query-context-analyzer.d.ts.map +0 -1
- package/dist/services/query-context-analyzer.js +0 -728
- package/dist/services/query-context-analyzer.js.map +0 -1
- package/dist/services/queue-cleanup.service.d.ts +0 -102
- package/dist/services/queue-cleanup.service.d.ts.map +0 -1
- package/dist/services/queue-cleanup.service.js +0 -259
- package/dist/services/queue-cleanup.service.js.map +0 -1
- package/dist/services/responsive/difference-detector.service.d.ts +0 -77
- package/dist/services/responsive/difference-detector.service.d.ts.map +0 -1
- package/dist/services/responsive/difference-detector.service.js +0 -525
- package/dist/services/responsive/difference-detector.service.js.map +0 -1
- package/dist/services/responsive/index.d.ts +0 -16
- package/dist/services/responsive/index.d.ts.map +0 -1
- package/dist/services/responsive/index.js +0 -60
- package/dist/services/responsive/index.js.map +0 -1
- package/dist/services/responsive/multi-viewport-capture.service.d.ts +0 -103
- package/dist/services/responsive/multi-viewport-capture.service.d.ts.map +0 -1
- package/dist/services/responsive/multi-viewport-capture.service.js +0 -841
- package/dist/services/responsive/multi-viewport-capture.service.js.map +0 -1
- package/dist/services/responsive/responsive-analysis-embedding.service.d.ts +0 -114
- package/dist/services/responsive/responsive-analysis-embedding.service.d.ts.map +0 -1
- package/dist/services/responsive/responsive-analysis-embedding.service.js +0 -232
- package/dist/services/responsive/responsive-analysis-embedding.service.js.map +0 -1
- package/dist/services/responsive/responsive-analysis.service.d.ts +0 -37
- package/dist/services/responsive/responsive-analysis.service.d.ts.map +0 -1
- package/dist/services/responsive/responsive-analysis.service.js +0 -262
- package/dist/services/responsive/responsive-analysis.service.js.map +0 -1
- package/dist/services/responsive/responsive-persistence.service.d.ts +0 -45
- package/dist/services/responsive/responsive-persistence.service.d.ts.map +0 -1
- package/dist/services/responsive/responsive-persistence.service.js +0 -102
- package/dist/services/responsive/responsive-persistence.service.js.map +0 -1
- package/dist/services/responsive/responsive-quality-evaluator.service.d.ts +0 -80
- package/dist/services/responsive/responsive-quality-evaluator.service.d.ts.map +0 -1
- package/dist/services/responsive/responsive-quality-evaluator.service.js +0 -448
- package/dist/services/responsive/responsive-quality-evaluator.service.js.map +0 -1
- package/dist/services/responsive/shared-browser-manager.d.ts +0 -65
- package/dist/services/responsive/shared-browser-manager.d.ts.map +0 -1
- package/dist/services/responsive/shared-browser-manager.js +0 -112
- package/dist/services/responsive/shared-browser-manager.js.map +0 -1
- package/dist/services/responsive/types.d.ts +0 -367
- package/dist/services/responsive/types.d.ts.map +0 -1
- package/dist/services/responsive/types.js +0 -5
- package/dist/services/responsive/types.js.map +0 -1
- package/dist/services/responsive/viewport-diff.service.d.ts +0 -49
- package/dist/services/responsive/viewport-diff.service.d.ts.map +0 -1
- package/dist/services/responsive/viewport-diff.service.js +0 -178
- package/dist/services/responsive/viewport-diff.service.js.map +0 -1
- package/dist/services/responsive-search.service.d.ts +0 -52
- package/dist/services/responsive-search.service.d.ts.map +0 -1
- package/dist/services/responsive-search.service.js +0 -136
- package/dist/services/responsive-search.service.js.map +0 -1
- package/dist/services/search/mood-brandtone-search.service.d.ts +0 -99
- package/dist/services/search/mood-brandtone-search.service.d.ts.map +0 -1
- package/dist/services/search/mood-brandtone-search.service.js +0 -310
- package/dist/services/search/mood-brandtone-search.service.js.map +0 -1
- package/dist/services/search-performance.service.d.ts +0 -118
- package/dist/services/search-performance.service.d.ts.map +0 -1
- package/dist/services/search-performance.service.js +0 -181
- package/dist/services/search-performance.service.js.map +0 -1
- package/dist/services/section-screenshot.service.d.ts +0 -163
- package/dist/services/section-screenshot.service.d.ts.map +0 -1
- package/dist/services/section-screenshot.service.js +0 -363
- package/dist/services/section-screenshot.service.js.map +0 -1
- package/dist/services/service-client.d.ts +0 -181
- package/dist/services/service-client.d.ts.map +0 -1
- package/dist/services/service-client.js +0 -450
- package/dist/services/service-client.js.map +0 -1
- package/dist/services/service-initializer.d.ts +0 -174
- package/dist/services/service-initializer.d.ts.map +0 -1
- package/dist/services/service-initializer.js +0 -942
- package/dist/services/service-initializer.js.map +0 -1
- package/dist/services/storage/index.d.ts +0 -7
- package/dist/services/storage/index.d.ts.map +0 -1
- package/dist/services/storage/index.js +0 -14
- package/dist/services/storage/index.js.map +0 -1
- package/dist/services/storage/local-storage.provider.d.ts +0 -140
- package/dist/services/storage/local-storage.provider.d.ts.map +0 -1
- package/dist/services/storage/local-storage.provider.js +0 -333
- package/dist/services/storage/local-storage.provider.js.map +0 -1
- package/dist/services/style/index.d.ts +0 -7
- package/dist/services/style/index.d.ts.map +0 -1
- package/dist/services/style/index.js +0 -25
- package/dist/services/style/index.js.map +0 -1
- package/dist/services/style/palette-service.d.ts +0 -212
- package/dist/services/style/palette-service.d.ts.map +0 -1
- package/dist/services/style/palette-service.js +0 -423
- package/dist/services/style/palette-service.js.map +0 -1
- package/dist/services/style/prisma-palette-repository.d.ts +0 -35
- package/dist/services/style/prisma-palette-repository.d.ts.map +0 -1
- package/dist/services/style/prisma-palette-repository.js +0 -165
- package/dist/services/style/prisma-palette-repository.js.map +0 -1
- package/dist/services/vision/brandtone.analyzer.d.ts +0 -104
- package/dist/services/vision/brandtone.analyzer.d.ts.map +0 -1
- package/dist/services/vision/brandtone.analyzer.js +0 -279
- package/dist/services/vision/brandtone.analyzer.js.map +0 -1
- package/dist/services/vision/hardware-detector.d.ts +0 -166
- package/dist/services/vision/hardware-detector.d.ts.map +0 -1
- package/dist/services/vision/hardware-detector.js +0 -330
- package/dist/services/vision/hardware-detector.js.map +0 -1
- package/dist/services/vision/image-optimizer.d.ts +0 -152
- package/dist/services/vision/image-optimizer.d.ts.map +0 -1
- package/dist/services/vision/image-optimizer.js +0 -266
- package/dist/services/vision/image-optimizer.js.map +0 -1
- package/dist/services/vision/index.d.ts +0 -26
- package/dist/services/vision/index.d.ts.map +0 -1
- package/dist/services/vision/index.js +0 -80
- package/dist/services/vision/index.js.map +0 -1
- package/dist/services/vision/llama-vision-adapter.d.ts +0 -178
- package/dist/services/vision/llama-vision-adapter.d.ts.map +0 -1
- package/dist/services/vision/llama-vision-adapter.js +0 -307
- package/dist/services/vision/llama-vision-adapter.js.map +0 -1
- package/dist/services/vision/mcp-progress-adapter.d.ts +0 -128
- package/dist/services/vision/mcp-progress-adapter.d.ts.map +0 -1
- package/dist/services/vision/mcp-progress-adapter.js +0 -150
- package/dist/services/vision/mcp-progress-adapter.js.map +0 -1
- package/dist/services/vision/mood.analyzer.d.ts +0 -74
- package/dist/services/vision/mood.analyzer.d.ts.map +0 -1
- package/dist/services/vision/mood.analyzer.js +0 -258
- package/dist/services/vision/mood.analyzer.js.map +0 -1
- package/dist/services/vision/ollama-readiness-probe.d.ts +0 -87
- package/dist/services/vision/ollama-readiness-probe.d.ts.map +0 -1
- package/dist/services/vision/ollama-readiness-probe.js +0 -211
- package/dist/services/vision/ollama-readiness-probe.js.map +0 -1
- package/dist/services/vision/ollama-vision-client.d.ts +0 -129
- package/dist/services/vision/ollama-vision-client.d.ts.map +0 -1
- package/dist/services/vision/ollama-vision-client.js +0 -478
- package/dist/services/vision/ollama-vision-client.js.map +0 -1
- package/dist/services/vision/progress-reporter.d.ts +0 -140
- package/dist/services/vision/progress-reporter.d.ts.map +0 -1
- package/dist/services/vision/progress-reporter.js +0 -306
- package/dist/services/vision/progress-reporter.js.map +0 -1
- package/dist/services/vision/scroll-vision-capture.service.d.ts +0 -117
- package/dist/services/vision/scroll-vision-capture.service.d.ts.map +0 -1
- package/dist/services/vision/scroll-vision-capture.service.js +0 -266
- package/dist/services/vision/scroll-vision-capture.service.js.map +0 -1
- package/dist/services/vision/scroll-vision-persistence.service.d.ts +0 -48
- package/dist/services/vision/scroll-vision-persistence.service.d.ts.map +0 -1
- package/dist/services/vision/scroll-vision-persistence.service.js +0 -161
- package/dist/services/vision/scroll-vision-persistence.service.js.map +0 -1
- package/dist/services/vision/scroll-vision.analyzer.d.ts +0 -90
- package/dist/services/vision/scroll-vision.analyzer.d.ts.map +0 -1
- package/dist/services/vision/scroll-vision.analyzer.js +0 -280
- package/dist/services/vision/scroll-vision.analyzer.js.map +0 -1
- package/dist/services/vision/theme.analyzer.d.ts +0 -108
- package/dist/services/vision/theme.analyzer.d.ts.map +0 -1
- package/dist/services/vision/theme.analyzer.js +0 -315
- package/dist/services/vision/theme.analyzer.js.map +0 -1
- package/dist/services/vision/timeout-calculator.d.ts +0 -85
- package/dist/services/vision/timeout-calculator.d.ts.map +0 -1
- package/dist/services/vision/timeout-calculator.js +0 -142
- package/dist/services/vision/timeout-calculator.js.map +0 -1
- package/dist/services/vision/vision-fallback.service.d.ts +0 -121
- package/dist/services/vision/vision-fallback.service.d.ts.map +0 -1
- package/dist/services/vision/vision-fallback.service.js +0 -253
- package/dist/services/vision/vision-fallback.service.js.map +0 -1
- package/dist/services/vision/vision.cache.d.ts +0 -124
- package/dist/services/vision/vision.cache.d.ts.map +0 -1
- package/dist/services/vision/vision.cache.js +0 -261
- package/dist/services/vision/vision.cache.js.map +0 -1
- package/dist/services/vision/vision.errors.d.ts +0 -104
- package/dist/services/vision/vision.errors.d.ts.map +0 -1
- package/dist/services/vision/vision.errors.js +0 -133
- package/dist/services/vision/vision.errors.js.map +0 -1
- package/dist/services/vision/vision.prompts.d.ts +0 -47
- package/dist/services/vision/vision.prompts.d.ts.map +0 -1
- package/dist/services/vision/vision.prompts.js +0 -272
- package/dist/services/vision/vision.prompts.js.map +0 -1
- package/dist/services/vision/vram-utils.d.ts +0 -22
- package/dist/services/vision/vram-utils.d.ts.map +0 -1
- package/dist/services/vision/vram-utils.js +0 -57
- package/dist/services/vision/vram-utils.js.map +0 -1
- package/dist/services/vision-adapter/index.d.ts +0 -18
- package/dist/services/vision-adapter/index.d.ts.map +0 -1
- package/dist/services/vision-adapter/index.js +0 -31
- package/dist/services/vision-adapter/index.js.map +0 -1
- package/dist/services/vision-adapter/interface.d.ts +0 -1434
- package/dist/services/vision-adapter/interface.d.ts.map +0 -1
- package/dist/services/vision-adapter/interface.js +0 -326
- package/dist/services/vision-adapter/interface.js.map +0 -1
- package/dist/services/vision-adapter/llama-vision.adapter.d.ts +0 -373
- package/dist/services/vision-adapter/llama-vision.adapter.d.ts.map +0 -1
- package/dist/services/vision-adapter/llama-vision.adapter.js +0 -1751
- package/dist/services/vision-adapter/llama-vision.adapter.js.map +0 -1
- package/dist/services/vision-adapter/llama-vision.prompts.d.ts +0 -63
- package/dist/services/vision-adapter/llama-vision.prompts.d.ts.map +0 -1
- package/dist/services/vision-adapter/llama-vision.prompts.js +0 -234
- package/dist/services/vision-adapter/llama-vision.prompts.js.map +0 -1
- package/dist/services/vision-adapter/llama-vision.types.d.ts +0 -68
- package/dist/services/vision-adapter/llama-vision.types.d.ts.map +0 -1
- package/dist/services/vision-adapter/llama-vision.types.js +0 -21
- package/dist/services/vision-adapter/llama-vision.types.js.map +0 -1
- package/dist/services/vision-adapter/local.adapter.d.ts +0 -185
- package/dist/services/vision-adapter/local.adapter.d.ts.map +0 -1
- package/dist/services/vision-adapter/local.adapter.js +0 -835
- package/dist/services/vision-adapter/local.adapter.js.map +0 -1
- package/dist/services/vision-adapter/mock.adapter.d.ts +0 -174
- package/dist/services/vision-adapter/mock.adapter.d.ts.map +0 -1
- package/dist/services/vision-adapter/mock.adapter.js +0 -812
- package/dist/services/vision-adapter/mock.adapter.js.map +0 -1
- package/dist/services/vision-embedding-search.service.d.ts +0 -205
- package/dist/services/vision-embedding-search.service.d.ts.map +0 -1
- package/dist/services/vision-embedding-search.service.js +0 -742
- package/dist/services/vision-embedding-search.service.js.map +0 -1
- package/dist/services/vision-embedding.service.d.ts +0 -150
- package/dist/services/vision-embedding.service.d.ts.map +0 -1
- package/dist/services/vision-embedding.service.js +0 -461
- package/dist/services/vision-embedding.service.js.map +0 -1
- package/dist/services/visual/css-variable-extractor.service.d.ts +0 -97
- package/dist/services/visual/css-variable-extractor.service.d.ts.map +0 -1
- package/dist/services/visual/css-variable-extractor.service.js +0 -460
- package/dist/services/visual/css-variable-extractor.service.js.map +0 -1
- package/dist/services/visual/typography-extractor.service.d.ts +0 -137
- package/dist/services/visual/typography-extractor.service.d.ts.map +0 -1
- package/dist/services/visual/typography-extractor.service.js +0 -539
- package/dist/services/visual/typography-extractor.service.js.map +0 -1
- package/dist/services/visual-extractor/color-extractor.service.d.ts +0 -55
- package/dist/services/visual-extractor/color-extractor.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/color-extractor.service.js +0 -281
- package/dist/services/visual-extractor/color-extractor.service.js.map +0 -1
- package/dist/services/visual-extractor/density-calculator.service.d.ts +0 -85
- package/dist/services/visual-extractor/density-calculator.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/density-calculator.service.js +0 -369
- package/dist/services/visual-extractor/density-calculator.service.js.map +0 -1
- package/dist/services/visual-extractor/gradient-detector.service.d.ts +0 -134
- package/dist/services/visual-extractor/gradient-detector.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/gradient-detector.service.js +0 -1172
- package/dist/services/visual-extractor/gradient-detector.service.js.map +0 -1
- package/dist/services/visual-extractor/image-utils.d.ts +0 -135
- package/dist/services/visual-extractor/image-utils.d.ts.map +0 -1
- package/dist/services/visual-extractor/image-utils.js +0 -305
- package/dist/services/visual-extractor/image-utils.js.map +0 -1
- package/dist/services/visual-extractor/pixel-theme-detector.service.d.ts +0 -58
- package/dist/services/visual-extractor/pixel-theme-detector.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/pixel-theme-detector.service.js +0 -358
- package/dist/services/visual-extractor/pixel-theme-detector.service.js.map +0 -1
- package/dist/services/visual-extractor/theme-detector.service.d.ts +0 -101
- package/dist/services/visual-extractor/theme-detector.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/theme-detector.service.js +0 -463
- package/dist/services/visual-extractor/theme-detector.service.js.map +0 -1
- package/dist/services/visual-extractor/visual-decoration-detector.service.d.ts +0 -43
- package/dist/services/visual-extractor/visual-decoration-detector.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/visual-decoration-detector.service.js +0 -628
- package/dist/services/visual-extractor/visual-decoration-detector.service.js.map +0 -1
- package/dist/services/visual-extractor/visual-feature-merger.service.d.ts +0 -230
- package/dist/services/visual-extractor/visual-feature-merger.service.d.ts.map +0 -1
- package/dist/services/visual-extractor/visual-feature-merger.service.js +0 -482
- package/dist/services/visual-extractor/visual-feature-merger.service.js.map +0 -1
- package/dist/services/web-page.service.d.ts +0 -80
- package/dist/services/web-page.service.d.ts.map +0 -1
- package/dist/services/web-page.service.js +0 -211
- package/dist/services/web-page.service.js.map +0 -1
- package/dist/services/worker-constants.d.ts +0 -40
- package/dist/services/worker-constants.d.ts.map +0 -1
- package/dist/services/worker-constants.js +0 -51
- package/dist/services/worker-constants.js.map +0 -1
- package/dist/services/worker-db-save.service.d.ts +0 -311
- package/dist/services/worker-db-save.service.d.ts.map +0 -1
- package/dist/services/worker-db-save.service.js +0 -771
- package/dist/services/worker-db-save.service.js.map +0 -1
- package/dist/services/worker-memory-monitor.service.d.ts +0 -24
- package/dist/services/worker-memory-monitor.service.d.ts.map +0 -1
- package/dist/services/worker-memory-monitor.service.js +0 -105
- package/dist/services/worker-memory-monitor.service.js.map +0 -1
- package/dist/services/worker-memory-profile.d.ts +0 -65
- package/dist/services/worker-memory-profile.d.ts.map +0 -1
- package/dist/services/worker-memory-profile.js +0 -225
- package/dist/services/worker-memory-profile.js.map +0 -1
- package/dist/services/worker-stall-recovery.service.d.ts +0 -166
- package/dist/services/worker-stall-recovery.service.d.ts.map +0 -1
- package/dist/services/worker-stall-recovery.service.js +0 -335
- package/dist/services/worker-stall-recovery.service.js.map +0 -1
- package/dist/services/worker-supervisor.service.d.ts +0 -145
- package/dist/services/worker-supervisor.service.d.ts.map +0 -1
- package/dist/services/worker-supervisor.service.js +0 -635
- package/dist/services/worker-supervisor.service.js.map +0 -1
- package/dist/tools/background/schemas.d.ts +0 -85
- package/dist/tools/background/schemas.d.ts.map +0 -1
- package/dist/tools/background/schemas.js +0 -79
- package/dist/tools/background/schemas.js.map +0 -1
- package/dist/tools/background/search.tool.d.ts +0 -179
- package/dist/tools/background/search.tool.d.ts.map +0 -1
- package/dist/tools/background/search.tool.js +0 -318
- package/dist/tools/background/search.tool.js.map +0 -1
- package/dist/tools/brief/index.d.ts +0 -10
- package/dist/tools/brief/index.d.ts.map +0 -1
- package/dist/tools/brief/index.js +0 -54
- package/dist/tools/brief/index.js.map +0 -1
- package/dist/tools/brief/schemas.d.ts +0 -750
- package/dist/tools/brief/schemas.d.ts.map +0 -1
- package/dist/tools/brief/schemas.js +0 -212
- package/dist/tools/brief/schemas.js.map +0 -1
- package/dist/tools/brief/validate.handler.d.ts +0 -149
- package/dist/tools/brief/validate.handler.d.ts.map +0 -1
- package/dist/tools/brief/validate.handler.js +0 -247
- package/dist/tools/brief/validate.handler.js.map +0 -1
- package/dist/tools/brief/validate.service.d.ts +0 -100
- package/dist/tools/brief/validate.service.d.ts.map +0 -1
- package/dist/tools/brief/validate.service.js +0 -296
- package/dist/tools/brief/validate.service.js.map +0 -1
- package/dist/tools/common/error-codes.d.ts +0 -35
- package/dist/tools/common/error-codes.d.ts.map +0 -1
- package/dist/tools/common/error-codes.js +0 -92
- package/dist/tools/common/error-codes.js.map +0 -1
- package/dist/tools/common/index.d.ts +0 -7
- package/dist/tools/common/index.d.ts.map +0 -1
- package/dist/tools/common/index.js +0 -20
- package/dist/tools/common/index.js.map +0 -1
- package/dist/tools/index.d.ts +0 -2756
- package/dist/tools/index.d.ts.map +0 -1
- package/dist/tools/index.js +0 -506
- package/dist/tools/index.js.map +0 -1
- package/dist/tools/layout/batch-ingest.tool.d.ts +0 -82
- package/dist/tools/layout/batch-ingest.tool.d.ts.map +0 -1
- package/dist/tools/layout/batch-ingest.tool.js +0 -410
- package/dist/tools/layout/batch-ingest.tool.js.map +0 -1
- package/dist/tools/layout/index.d.ts +0 -13
- package/dist/tools/layout/index.d.ts.map +0 -1
- package/dist/tools/layout/index.js +0 -62
- package/dist/tools/layout/index.js.map +0 -1
- package/dist/tools/layout/ingest.tool.d.ts +0 -338
- package/dist/tools/layout/ingest.tool.d.ts.map +0 -1
- package/dist/tools/layout/ingest.tool.js +0 -1308
- package/dist/tools/layout/ingest.tool.js.map +0 -1
- package/dist/tools/layout/inspect/index.d.ts +0 -11
- package/dist/tools/layout/inspect/index.d.ts.map +0 -1
- package/dist/tools/layout/inspect/index.js +0 -55
- package/dist/tools/layout/inspect/index.js.map +0 -1
- package/dist/tools/layout/inspect/inspect.schemas.d.ts +0 -4130
- package/dist/tools/layout/inspect/inspect.schemas.d.ts.map +0 -1
- package/dist/tools/layout/inspect/inspect.schemas.js +0 -400
- package/dist/tools/layout/inspect/inspect.schemas.js.map +0 -1
- package/dist/tools/layout/inspect/inspect.tool.d.ts +0 -164
- package/dist/tools/layout/inspect/inspect.tool.d.ts.map +0 -1
- package/dist/tools/layout/inspect/inspect.tool.js +0 -738
- package/dist/tools/layout/inspect/inspect.tool.js.map +0 -1
- package/dist/tools/layout/inspect/inspect.utils.d.ts +0 -200
- package/dist/tools/layout/inspect/inspect.utils.d.ts.map +0 -1
- package/dist/tools/layout/inspect/inspect.utils.js +0 -1104
- package/dist/tools/layout/inspect/inspect.utils.js.map +0 -1
- package/dist/tools/layout/inspect/visual-extractors.schemas.d.ts +0 -3372
- package/dist/tools/layout/inspect/visual-extractors.schemas.d.ts.map +0 -1
- package/dist/tools/layout/inspect/visual-extractors.schemas.js +0 -558
- package/dist/tools/layout/inspect/visual-extractors.schemas.js.map +0 -1
- package/dist/tools/layout/inspect/visual-extractors.utils.d.ts +0 -86
- package/dist/tools/layout/inspect/visual-extractors.utils.d.ts.map +0 -1
- package/dist/tools/layout/inspect/visual-extractors.utils.js +0 -231
- package/dist/tools/layout/inspect/visual-extractors.utils.js.map +0 -1
- package/dist/tools/layout/schemas.d.ts +0 -11074
- package/dist/tools/layout/schemas.d.ts.map +0 -1
- package/dist/tools/layout/schemas.js +0 -1497
- package/dist/tools/layout/schemas.js.map +0 -1
- package/dist/tools/layout/search.tool.d.ts +0 -470
- package/dist/tools/layout/search.tool.d.ts.map +0 -1
- package/dist/tools/layout/search.tool.js +0 -1582
- package/dist/tools/layout/search.tool.js.map +0 -1
- package/dist/tools/layout/to-code.tool.d.ts +0 -280
- package/dist/tools/layout/to-code.tool.d.ts.map +0 -1
- package/dist/tools/layout/to-code.tool.js +0 -317
- package/dist/tools/layout/to-code.tool.js.map +0 -1
- package/dist/tools/motion/analyze-frames.handler.d.ts +0 -157
- package/dist/tools/motion/analyze-frames.handler.d.ts.map +0 -1
- package/dist/tools/motion/analyze-frames.handler.js +0 -263
- package/dist/tools/motion/analyze-frames.handler.js.map +0 -1
- package/dist/tools/motion/analyze-frames.schema.d.ts +0 -4599
- package/dist/tools/motion/analyze-frames.schema.d.ts.map +0 -1
- package/dist/tools/motion/analyze-frames.schema.js +0 -420
- package/dist/tools/motion/analyze-frames.schema.js.map +0 -1
- package/dist/tools/motion/css-mode-handler.d.ts +0 -70
- package/dist/tools/motion/css-mode-handler.d.ts.map +0 -1
- package/dist/tools/motion/css-mode-handler.js +0 -754
- package/dist/tools/motion/css-mode-handler.js.map +0 -1
- package/dist/tools/motion/detect.schemas.d.ts +0 -14288
- package/dist/tools/motion/detect.schemas.d.ts.map +0 -1
- package/dist/tools/motion/detect.schemas.js +0 -1715
- package/dist/tools/motion/detect.schemas.js.map +0 -1
- package/dist/tools/motion/detect.tool.d.ts +0 -195
- package/dist/tools/motion/detect.tool.d.ts.map +0 -1
- package/dist/tools/motion/detect.tool.js +0 -1421
- package/dist/tools/motion/detect.tool.js.map +0 -1
- package/dist/tools/motion/detection-modes.d.ts +0 -72
- package/dist/tools/motion/detection-modes.d.ts.map +0 -1
- package/dist/tools/motion/detection-modes.js +0 -353
- package/dist/tools/motion/detection-modes.js.map +0 -1
- package/dist/tools/motion/di-factories.d.ts +0 -341
- package/dist/tools/motion/di-factories.d.ts.map +0 -1
- package/dist/tools/motion/di-factories.js +0 -376
- package/dist/tools/motion/di-factories.js.map +0 -1
- package/dist/tools/motion/index.d.ts +0 -12
- package/dist/tools/motion/index.d.ts.map +0 -1
- package/dist/tools/motion/index.js +0 -146
- package/dist/tools/motion/index.js.map +0 -1
- package/dist/tools/motion/pattern-converter.d.ts +0 -49
- package/dist/tools/motion/pattern-converter.d.ts.map +0 -1
- package/dist/tools/motion/pattern-converter.js +0 -493
- package/dist/tools/motion/pattern-converter.js.map +0 -1
- package/dist/tools/motion/schemas.d.ts +0 -10
- package/dist/tools/motion/schemas.d.ts.map +0 -1
- package/dist/tools/motion/schemas.js +0 -28
- package/dist/tools/motion/schemas.js.map +0 -1
- package/dist/tools/motion/search.schemas.d.ts +0 -7500
- package/dist/tools/motion/search.schemas.d.ts.map +0 -1
- package/dist/tools/motion/search.schemas.js +0 -596
- package/dist/tools/motion/search.schemas.js.map +0 -1
- package/dist/tools/motion/search.tool.d.ts +0 -416
- package/dist/tools/motion/search.tool.d.ts.map +0 -1
- package/dist/tools/motion/search.tool.js +0 -2088
- package/dist/tools/motion/search.tool.js.map +0 -1
- package/dist/tools/motion/shared.schemas.d.ts +0 -994
- package/dist/tools/motion/shared.schemas.d.ts.map +0 -1
- package/dist/tools/motion/shared.schemas.js +0 -354
- package/dist/tools/motion/shared.schemas.js.map +0 -1
- package/dist/tools/narrative/analyze.tool.d.ts +0 -96
- package/dist/tools/narrative/analyze.tool.d.ts.map +0 -1
- package/dist/tools/narrative/analyze.tool.js +0 -396
- package/dist/tools/narrative/analyze.tool.js.map +0 -1
- package/dist/tools/narrative/index.d.ts +0 -15
- package/dist/tools/narrative/index.d.ts.map +0 -1
- package/dist/tools/narrative/index.js +0 -83
- package/dist/tools/narrative/index.js.map +0 -1
- package/dist/tools/narrative/schemas.d.ts +0 -5553
- package/dist/tools/narrative/schemas.d.ts.map +0 -1
- package/dist/tools/narrative/schemas.js +0 -747
- package/dist/tools/narrative/schemas.js.map +0 -1
- package/dist/tools/narrative/search.tool.d.ts +0 -160
- package/dist/tools/narrative/search.tool.d.ts.map +0 -1
- package/dist/tools/narrative/search.tool.js +0 -434
- package/dist/tools/narrative/search.tool.js.map +0 -1
- package/dist/tools/page/analyze.tool.d.ts +0 -502
- package/dist/tools/page/analyze.tool.d.ts.map +0 -1
- package/dist/tools/page/analyze.tool.js +0 -875
- package/dist/tools/page/analyze.tool.js.map +0 -1
- package/dist/tools/page/get-job-status.tool.d.ts +0 -43
- package/dist/tools/page/get-job-status.tool.d.ts.map +0 -1
- package/dist/tools/page/get-job-status.tool.js +0 -178
- package/dist/tools/page/get-job-status.tool.js.map +0 -1
- package/dist/tools/page/handlers/db-handler.d.ts +0 -155
- package/dist/tools/page/handlers/db-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/db-handler.js +0 -368
- package/dist/tools/page/handlers/db-handler.js.map +0 -1
- package/dist/tools/page/handlers/embedding-handler.d.ts +0 -200
- package/dist/tools/page/handlers/embedding-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/embedding-handler.js +0 -541
- package/dist/tools/page/handlers/embedding-handler.js.map +0 -1
- package/dist/tools/page/handlers/execution-status-tracker.d.ts +0 -146
- package/dist/tools/page/handlers/execution-status-tracker.d.ts.map +0 -1
- package/dist/tools/page/handlers/execution-status-tracker.js +0 -348
- package/dist/tools/page/handlers/execution-status-tracker.js.map +0 -1
- package/dist/tools/page/handlers/js-animation-handler.d.ts +0 -197
- package/dist/tools/page/handlers/js-animation-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/js-animation-handler.js +0 -952
- package/dist/tools/page/handlers/js-animation-handler.js.map +0 -1
- package/dist/tools/page/handlers/layout-handler.d.ts +0 -31
- package/dist/tools/page/handlers/layout-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/layout-handler.js +0 -1181
- package/dist/tools/page/handlers/layout-handler.js.map +0 -1
- package/dist/tools/page/handlers/motion-handler.d.ts +0 -31
- package/dist/tools/page/handlers/motion-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/motion-handler.js +0 -940
- package/dist/tools/page/handlers/motion-handler.js.map +0 -1
- package/dist/tools/page/handlers/narrative-handler.d.ts +0 -23
- package/dist/tools/page/handlers/narrative-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/narrative-handler.js +0 -279
- package/dist/tools/page/handlers/narrative-handler.js.map +0 -1
- package/dist/tools/page/handlers/phased-db-handler.d.ts +0 -83
- package/dist/tools/page/handlers/phased-db-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/phased-db-handler.js +0 -120
- package/dist/tools/page/handlers/phased-db-handler.js.map +0 -1
- package/dist/tools/page/handlers/phased-executor.d.ts +0 -123
- package/dist/tools/page/handlers/phased-executor.d.ts.map +0 -1
- package/dist/tools/page/handlers/phased-executor.js +0 -205
- package/dist/tools/page/handlers/phased-executor.js.map +0 -1
- package/dist/tools/page/handlers/quality-handler.d.ts +0 -9
- package/dist/tools/page/handlers/quality-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/quality-handler.js +0 -100
- package/dist/tools/page/handlers/quality-handler.js.map +0 -1
- package/dist/tools/page/handlers/result-builder.d.ts +0 -105
- package/dist/tools/page/handlers/result-builder.d.ts.map +0 -1
- package/dist/tools/page/handlers/result-builder.js +0 -447
- package/dist/tools/page/handlers/result-builder.js.map +0 -1
- package/dist/tools/page/handlers/retry-strategy.d.ts +0 -106
- package/dist/tools/page/handlers/retry-strategy.d.ts.map +0 -1
- package/dist/tools/page/handlers/retry-strategy.js +0 -169
- package/dist/tools/page/handlers/retry-strategy.js.map +0 -1
- package/dist/tools/page/handlers/sync-processing.d.ts +0 -26
- package/dist/tools/page/handlers/sync-processing.d.ts.map +0 -1
- package/dist/tools/page/handlers/sync-processing.js +0 -1659
- package/dist/tools/page/handlers/sync-processing.js.map +0 -1
- package/dist/tools/page/handlers/timeout-utils.d.ts +0 -278
- package/dist/tools/page/handlers/timeout-utils.d.ts.map +0 -1
- package/dist/tools/page/handlers/timeout-utils.js +0 -600
- package/dist/tools/page/handlers/timeout-utils.js.map +0 -1
- package/dist/tools/page/handlers/types.d.ts +0 -1229
- package/dist/tools/page/handlers/types.d.ts.map +0 -1
- package/dist/tools/page/handlers/types.js +0 -21
- package/dist/tools/page/handlers/types.js.map +0 -1
- package/dist/tools/page/handlers/video-handler.d.ts +0 -11
- package/dist/tools/page/handlers/video-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/video-handler.js +0 -235
- package/dist/tools/page/handlers/video-handler.js.map +0 -1
- package/dist/tools/page/handlers/webgl-animation-handler.d.ts +0 -48
- package/dist/tools/page/handlers/webgl-animation-handler.d.ts.map +0 -1
- package/dist/tools/page/handlers/webgl-animation-handler.js +0 -237
- package/dist/tools/page/handlers/webgl-animation-handler.js.map +0 -1
- package/dist/tools/page/handlers/webgl-detector.d.ts +0 -184
- package/dist/tools/page/handlers/webgl-detector.d.ts.map +0 -1
- package/dist/tools/page/handlers/webgl-detector.js +0 -680
- package/dist/tools/page/handlers/webgl-detector.js.map +0 -1
- package/dist/tools/page/handlers/webgl-domains.d.ts +0 -133
- package/dist/tools/page/handlers/webgl-domains.d.ts.map +0 -1
- package/dist/tools/page/handlers/webgl-domains.js +0 -420
- package/dist/tools/page/handlers/webgl-domains.js.map +0 -1
- package/dist/tools/page/handlers/webgl-pre-detector.d.ts +0 -100
- package/dist/tools/page/handlers/webgl-pre-detector.d.ts.map +0 -1
- package/dist/tools/page/handlers/webgl-pre-detector.js +0 -248
- package/dist/tools/page/handlers/webgl-pre-detector.js.map +0 -1
- package/dist/tools/page/index.d.ts +0 -10
- package/dist/tools/page/index.d.ts.map +0 -1
- package/dist/tools/page/index.js +0 -84
- package/dist/tools/page/index.js.map +0 -1
- package/dist/tools/page/input.schemas.d.ts +0 -2223
- package/dist/tools/page/input.schemas.d.ts.map +0 -1
- package/dist/tools/page/input.schemas.js +0 -853
- package/dist/tools/page/input.schemas.js.map +0 -1
- package/dist/tools/page/output.schemas.d.ts +0 -26026
- package/dist/tools/page/output.schemas.d.ts.map +0 -1
- package/dist/tools/page/output.schemas.js +0 -1414
- package/dist/tools/page/output.schemas.js.map +0 -1
- package/dist/tools/page/schemas.d.ts +0 -10
- package/dist/tools/page/schemas.d.ts.map +0 -1
- package/dist/tools/page/schemas.js +0 -28
- package/dist/tools/page/schemas.js.map +0 -1
- package/dist/tools/page/shared.schemas.d.ts +0 -38
- package/dist/tools/page/shared.schemas.d.ts.map +0 -1
- package/dist/tools/page/shared.schemas.js +0 -69
- package/dist/tools/page/shared.schemas.js.map +0 -1
- package/dist/tools/part/compare.tool.d.ts +0 -106
- package/dist/tools/part/compare.tool.d.ts.map +0 -1
- package/dist/tools/part/compare.tool.js +0 -421
- package/dist/tools/part/compare.tool.js.map +0 -1
- package/dist/tools/part/inspect.tool.d.ts +0 -108
- package/dist/tools/part/inspect.tool.d.ts.map +0 -1
- package/dist/tools/part/inspect.tool.js +0 -279
- package/dist/tools/part/inspect.tool.js.map +0 -1
- package/dist/tools/part/search.tool.d.ts +0 -121
- package/dist/tools/part/search.tool.d.ts.map +0 -1
- package/dist/tools/part/search.tool.js +0 -381
- package/dist/tools/part/search.tool.js.map +0 -1
- package/dist/tools/preference/get.tool.d.ts +0 -74
- package/dist/tools/preference/get.tool.d.ts.map +0 -1
- package/dist/tools/preference/get.tool.js +0 -175
- package/dist/tools/preference/get.tool.js.map +0 -1
- package/dist/tools/preference/hear.tool.d.ts +0 -267
- package/dist/tools/preference/hear.tool.d.ts.map +0 -1
- package/dist/tools/preference/hear.tool.js +0 -268
- package/dist/tools/preference/hear.tool.js.map +0 -1
- package/dist/tools/preference/index.d.ts +0 -16
- package/dist/tools/preference/index.d.ts.map +0 -1
- package/dist/tools/preference/index.js +0 -43
- package/dist/tools/preference/index.js.map +0 -1
- package/dist/tools/preference/reset.tool.d.ts +0 -71
- package/dist/tools/preference/reset.tool.d.ts.map +0 -1
- package/dist/tools/preference/reset.tool.js +0 -205
- package/dist/tools/preference/reset.tool.js.map +0 -1
- package/dist/tools/preference/schemas.d.ts +0 -174
- package/dist/tools/preference/schemas.d.ts.map +0 -1
- package/dist/tools/preference/schemas.js +0 -142
- package/dist/tools/preference/schemas.js.map +0 -1
- package/dist/tools/project-get.d.ts +0 -42
- package/dist/tools/project-get.d.ts.map +0 -1
- package/dist/tools/project-get.js +0 -152
- package/dist/tools/project-get.js.map +0 -1
- package/dist/tools/project-list.d.ts +0 -66
- package/dist/tools/project-list.d.ts.map +0 -1
- package/dist/tools/project-list.js +0 -201
- package/dist/tools/project-list.js.map +0 -1
- package/dist/tools/quality/batch-evaluate.tool.d.ts +0 -101
- package/dist/tools/quality/batch-evaluate.tool.d.ts.map +0 -1
- package/dist/tools/quality/batch-evaluate.tool.js +0 -393
- package/dist/tools/quality/batch-evaluate.tool.js.map +0 -1
- package/dist/tools/quality/evaluate-engine.d.ts +0 -166
- package/dist/tools/quality/evaluate-engine.d.ts.map +0 -1
- package/dist/tools/quality/evaluate-engine.js +0 -1061
- package/dist/tools/quality/evaluate-engine.js.map +0 -1
- package/dist/tools/quality/evaluate.tool.d.ts +0 -286
- package/dist/tools/quality/evaluate.tool.d.ts.map +0 -1
- package/dist/tools/quality/evaluate.tool.js +0 -815
- package/dist/tools/quality/evaluate.tool.js.map +0 -1
- package/dist/tools/quality/get-job-status.tool.d.ts +0 -44
- package/dist/tools/quality/get-job-status.tool.d.ts.map +0 -1
- package/dist/tools/quality/get-job-status.tool.js +0 -291
- package/dist/tools/quality/get-job-status.tool.js.map +0 -1
- package/dist/tools/quality/improvement-utils.d.ts +0 -24
- package/dist/tools/quality/improvement-utils.d.ts.map +0 -1
- package/dist/tools/quality/improvement-utils.js +0 -307
- package/dist/tools/quality/improvement-utils.js.map +0 -1
- package/dist/tools/quality/index.d.ts +0 -11
- package/dist/tools/quality/index.d.ts.map +0 -1
- package/dist/tools/quality/index.js +0 -49
- package/dist/tools/quality/index.js.map +0 -1
- package/dist/tools/quality/schemas.d.ts +0 -14098
- package/dist/tools/quality/schemas.d.ts.map +0 -1
- package/dist/tools/quality/schemas.js +0 -950
- package/dist/tools/quality/schemas.js.map +0 -1
- package/dist/tools/responsive/schemas.d.ts +0 -156
- package/dist/tools/responsive/schemas.d.ts.map +0 -1
- package/dist/tools/responsive/schemas.js +0 -86
- package/dist/tools/responsive/schemas.js.map +0 -1
- package/dist/tools/responsive/search.tool.d.ts +0 -130
- package/dist/tools/responsive/search.tool.d.ts.map +0 -1
- package/dist/tools/responsive/search.tool.js +0 -324
- package/dist/tools/responsive/search.tool.js.map +0 -1
- package/dist/tools/schemas/index.d.ts +0 -10
- package/dist/tools/schemas/index.d.ts.map +0 -1
- package/dist/tools/schemas/index.js +0 -45
- package/dist/tools/schemas/index.js.map +0 -1
- package/dist/tools/schemas/layout-schemas.d.ts +0 -521
- package/dist/tools/schemas/layout-schemas.d.ts.map +0 -1
- package/dist/tools/schemas/layout-schemas.js +0 -281
- package/dist/tools/schemas/layout-schemas.js.map +0 -1
- package/dist/tools/schemas/project-schemas.d.ts +0 -417
- package/dist/tools/schemas/project-schemas.d.ts.map +0 -1
- package/dist/tools/schemas/project-schemas.js +0 -159
- package/dist/tools/schemas/project-schemas.js.map +0 -1
- package/dist/tools/schemas/shared.d.ts +0 -107
- package/dist/tools/schemas/shared.d.ts.map +0 -1
- package/dist/tools/schemas/shared.js +0 -150
- package/dist/tools/schemas/shared.js.map +0 -1
- package/dist/tools/schemas/style-schemas.d.ts +0 -114
- package/dist/tools/schemas/style-schemas.d.ts.map +0 -1
- package/dist/tools/schemas/style-schemas.js +0 -61
- package/dist/tools/schemas/style-schemas.js.map +0 -1
- package/dist/tools/style-get-palette.d.ts +0 -136
- package/dist/tools/style-get-palette.d.ts.map +0 -1
- package/dist/tools/style-get-palette.js +0 -259
- package/dist/tools/style-get-palette.js.map +0 -1
- package/dist/tools/system-health.d.ts +0 -255
- package/dist/tools/system-health.d.ts.map +0 -1
- package/dist/tools/system-health.js +0 -463
- package/dist/tools/system-health.js.map +0 -1
- package/dist/transport.d.ts +0 -29
- package/dist/transport.d.ts.map +0 -1
- package/dist/transport.js +0 -50
- package/dist/transport.js.map +0 -1
- package/dist/types/creative/index.d.ts +0 -8
- package/dist/types/creative/index.d.ts.map +0 -1
- package/dist/types/creative/index.js +0 -5
- package/dist/types/creative/index.js.map +0 -1
- package/dist/types/creative/palette.d.ts +0 -142
- package/dist/types/creative/palette.d.ts.map +0 -1
- package/dist/types/creative/palette.js +0 -5
- package/dist/types/creative/palette.js.map +0 -1
- package/dist/types/reftrix-window.d.ts +0 -124
- package/dist/types/reftrix-window.d.ts.map +0 -1
- package/dist/types/reftrix-window.js +0 -68
- package/dist/types/reftrix-window.js.map +0 -1
- package/dist/utils/actionable-warning.d.ts +0 -170
- package/dist/utils/actionable-warning.d.ts.map +0 -1
- package/dist/utils/actionable-warning.js +0 -818
- package/dist/utils/actionable-warning.js.map +0 -1
- package/dist/utils/blank-image-detector.d.ts +0 -22
- package/dist/utils/blank-image-detector.d.ts.map +0 -1
- package/dist/utils/blank-image-detector.js +0 -133
- package/dist/utils/blank-image-detector.js.map +0 -1
- package/dist/utils/color.d.ts +0 -203
- package/dist/utils/color.d.ts.map +0 -1
- package/dist/utils/color.js +0 -442
- package/dist/utils/color.js.map +0 -1
- package/dist/utils/deprecation-warning.d.ts +0 -43
- package/dist/utils/deprecation-warning.d.ts.map +0 -1
- package/dist/utils/deprecation-warning.js +0 -112
- package/dist/utils/deprecation-warning.js.map +0 -1
- package/dist/utils/error-messages.d.ts +0 -233
- package/dist/utils/error-messages.d.ts.map +0 -1
- package/dist/utils/error-messages.js +0 -721
- package/dist/utils/error-messages.js.map +0 -1
- package/dist/utils/errors.d.ts +0 -64
- package/dist/utils/errors.d.ts.map +0 -1
- package/dist/utils/errors.js +0 -82
- package/dist/utils/errors.js.map +0 -1
- package/dist/utils/gpu-browser-args.d.ts +0 -27
- package/dist/utils/gpu-browser-args.d.ts.map +0 -1
- package/dist/utils/gpu-browser-args.js +0 -42
- package/dist/utils/gpu-browser-args.js.map +0 -1
- package/dist/utils/html-sanitizer.d.ts +0 -116
- package/dist/utils/html-sanitizer.d.ts.map +0 -1
- package/dist/utils/html-sanitizer.js +0 -630
- package/dist/utils/html-sanitizer.js.map +0 -1
- package/dist/utils/logger.d.ts +0 -141
- package/dist/utils/logger.d.ts.map +0 -1
- package/dist/utils/logger.js +0 -249
- package/dist/utils/logger.js.map +0 -1
- package/dist/utils/mcp-response.d.ts +0 -317
- package/dist/utils/mcp-response.d.ts.map +0 -1
- package/dist/utils/mcp-response.js +0 -270
- package/dist/utils/mcp-response.js.map +0 -1
- package/dist/utils/path-security.d.ts +0 -73
- package/dist/utils/path-security.d.ts.map +0 -1
- package/dist/utils/path-security.js +0 -389
- package/dist/utils/path-security.js.map +0 -1
- package/dist/utils/prisma-wrapper-factory.d.ts +0 -152
- package/dist/utils/prisma-wrapper-factory.d.ts.map +0 -1
- package/dist/utils/prisma-wrapper-factory.js +0 -124
- package/dist/utils/prisma-wrapper-factory.js.map +0 -1
- package/dist/utils/safe-parse-int.d.ts +0 -41
- package/dist/utils/safe-parse-int.d.ts.map +0 -1
- package/dist/utils/safe-parse-int.js +0 -49
- package/dist/utils/safe-parse-int.js.map +0 -1
- package/dist/utils/url-normalizer.d.ts +0 -38
- package/dist/utils/url-normalizer.d.ts.map +0 -1
- package/dist/utils/url-normalizer.js +0 -103
- package/dist/utils/url-normalizer.js.map +0 -1
- package/dist/utils/url-validator.d.ts +0 -86
- package/dist/utils/url-validator.d.ts.map +0 -1
- package/dist/utils/url-validator.js +0 -533
- package/dist/utils/url-validator.js.map +0 -1
- package/dist/workers/batch-quality-worker.d.ts +0 -87
- package/dist/workers/batch-quality-worker.d.ts.map +0 -1
- package/dist/workers/batch-quality-worker.js +0 -300
- package/dist/workers/batch-quality-worker.js.map +0 -1
- package/dist/workers/page-analyze-worker.d.ts +0 -63
- package/dist/workers/page-analyze-worker.d.ts.map +0 -1
- package/dist/workers/page-analyze-worker.js +0 -872
- package/dist/workers/page-analyze-worker.js.map +0 -1
- package/dist/workers/phases/phase-0-ingest.d.ts +0 -42
- package/dist/workers/phases/phase-0-ingest.d.ts.map +0 -1
- package/dist/workers/phases/phase-0-ingest.js +0 -197
- package/dist/workers/phases/phase-0-ingest.js.map +0 -1
- package/dist/workers/phases/phase-1-layout.d.ts +0 -63
- package/dist/workers/phases/phase-1-layout.d.ts.map +0 -1
- package/dist/workers/phases/phase-1-layout.js +0 -362
- package/dist/workers/phases/phase-1-layout.js.map +0 -1
- package/dist/workers/phases/phase-2-motion.d.ts +0 -93
- package/dist/workers/phases/phase-2-motion.d.ts.map +0 -1
- package/dist/workers/phases/phase-2-motion.js +0 -408
- package/dist/workers/phases/phase-2-motion.js.map +0 -1
- package/dist/workers/phases/phase-3-quality.d.ts +0 -61
- package/dist/workers/phases/phase-3-quality.d.ts.map +0 -1
- package/dist/workers/phases/phase-3-quality.js +0 -191
- package/dist/workers/phases/phase-3-quality.js.map +0 -1
- package/dist/workers/phases/phase-4-narrative.d.ts +0 -37
- package/dist/workers/phases/phase-4-narrative.d.ts.map +0 -1
- package/dist/workers/phases/phase-4-narrative.js +0 -309
- package/dist/workers/phases/phase-4-narrative.js.map +0 -1
- package/dist/workers/phases/phase-5-embedding.d.ts +0 -56
- package/dist/workers/phases/phase-5-embedding.d.ts.map +0 -1
- package/dist/workers/phases/phase-5-embedding.js +0 -1350
- package/dist/workers/phases/phase-5-embedding.js.map +0 -1
- package/dist/workers/phases/types.d.ts +0 -411
- package/dist/workers/phases/types.d.ts.map +0 -1
- package/dist/workers/phases/types.js +0 -540
- package/dist/workers/phases/types.js.map +0 -1
|
@@ -1,1172 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// SPDX-FileCopyrightText: 2026 TKMD and Reftrix Contributors
|
|
3
|
-
// SPDX-License-Identifier: AGPL-3.0-only
|
|
4
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
5
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
6
|
-
};
|
|
7
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
-
exports.createGradientDetectorService = createGradientDetectorService;
|
|
9
|
-
/**
|
|
10
|
-
* Gradient Detector Service
|
|
11
|
-
*
|
|
12
|
-
* Detects gradient patterns (linear, radial, conic) from images using
|
|
13
|
-
* pixel analysis and color change patterns.
|
|
14
|
-
*
|
|
15
|
-
* Security features:
|
|
16
|
-
* - Input size validation (5MB max) - SEC H-1
|
|
17
|
-
* - Processing timeout (30s default) - SEC M-1
|
|
18
|
-
*
|
|
19
|
-
* @module services/visual-extractor/gradient-detector.service
|
|
20
|
-
*/
|
|
21
|
-
const logger_1 = require("../../utils/logger");
|
|
22
|
-
const sharp_1 = __importDefault(require("sharp"));
|
|
23
|
-
const image_utils_1 = require("./image-utils");
|
|
24
|
-
/** Default configuration */
|
|
25
|
-
const DEFAULT_CONFIG = {
|
|
26
|
-
maxProcessingWidth: 300,
|
|
27
|
-
maxProcessingHeight: 300,
|
|
28
|
-
minColorChangeThreshold: 15,
|
|
29
|
-
sampleStep: 2,
|
|
30
|
-
minGradientLength: 10,
|
|
31
|
-
};
|
|
32
|
-
/** Threshold for considering colors as similar */
|
|
33
|
-
const SIMILAR_COLOR_THRESHOLD = 5;
|
|
34
|
-
/** Threshold for continuous gradient detection */
|
|
35
|
-
const CONTINUOUS_GRADIENT_THRESHOLD = 20;
|
|
36
|
-
/** Minimum score threshold for linear gradient detection */
|
|
37
|
-
const LINEAR_MIN_SCORE_THRESHOLD = 5;
|
|
38
|
-
/** Minimum radial gradient consistency threshold */
|
|
39
|
-
const RADIAL_CONSISTENCY_THRESHOLD = 0.5;
|
|
40
|
-
/** Conic gradient angular variation threshold (reserved for future use) */
|
|
41
|
-
// const CONIC_ANGULAR_VARIATION_THRESHOLD = 15;
|
|
42
|
-
/** Minimum color samples ratio for conic gradient detection */
|
|
43
|
-
const CONIC_MIN_SAMPLES_RATIO = 0.8;
|
|
44
|
-
/** Minimum transitions for conic gradient detection */
|
|
45
|
-
const CONIC_MIN_TRANSITIONS = 4;
|
|
46
|
-
/**
|
|
47
|
-
* Parse CSS text into rules (simplified parser)
|
|
48
|
-
*/
|
|
49
|
-
function parseCSSRules(css) {
|
|
50
|
-
if (!css || typeof css !== "string") {
|
|
51
|
-
return [];
|
|
52
|
-
}
|
|
53
|
-
const rules = [];
|
|
54
|
-
// Remove comments
|
|
55
|
-
const cleanedCss = css.replace(/\/\*[\s\S]*?\*\//g, "");
|
|
56
|
-
// Match CSS rules (simple regex, handles most cases)
|
|
57
|
-
const ruleRegex = /([^{}]+)\{([^{}]*)\}/g;
|
|
58
|
-
let match;
|
|
59
|
-
while ((match = ruleRegex.exec(cleanedCss)) !== null) {
|
|
60
|
-
const selector = match[1]?.trim() ?? "";
|
|
61
|
-
const declarationBlock = match[2] ?? "";
|
|
62
|
-
// Skip @keyframes and @media (handle separately if needed)
|
|
63
|
-
if (selector.startsWith("@")) {
|
|
64
|
-
continue;
|
|
65
|
-
}
|
|
66
|
-
const declarations = new Map();
|
|
67
|
-
// Parse declarations
|
|
68
|
-
const declPairs = declarationBlock.split(";");
|
|
69
|
-
for (const pair of declPairs) {
|
|
70
|
-
const colonIndex = pair.indexOf(":");
|
|
71
|
-
if (colonIndex > 0) {
|
|
72
|
-
const property = pair.substring(0, colonIndex).trim();
|
|
73
|
-
const value = pair.substring(colonIndex + 1).trim();
|
|
74
|
-
if (property && value) {
|
|
75
|
-
declarations.set(property, value);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
if (selector) {
|
|
80
|
-
rules.push({ selector, declarations });
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
return rules;
|
|
84
|
-
}
|
|
85
|
-
/**
|
|
86
|
-
* Extract gradient matches from a CSS value
|
|
87
|
-
*/
|
|
88
|
-
function extractGradientMatches(value) {
|
|
89
|
-
const matches = [];
|
|
90
|
-
// Regex to match gradient functions (handles nested parentheses)
|
|
91
|
-
const gradientRegex = /(repeating-)?(linear|radial|conic)-gradient\(([^()]*(?:\([^()]*\)[^()]*)*)\)/g;
|
|
92
|
-
let match;
|
|
93
|
-
while ((match = gradientRegex.exec(value)) !== null) {
|
|
94
|
-
const isRepeating = !!match[1];
|
|
95
|
-
const type = match[2];
|
|
96
|
-
const fullMatch = match[0];
|
|
97
|
-
matches.push({
|
|
98
|
-
type,
|
|
99
|
-
fullMatch,
|
|
100
|
-
isRepeating,
|
|
101
|
-
});
|
|
102
|
-
}
|
|
103
|
-
return matches;
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* Parse animation shorthand or individual properties
|
|
107
|
-
*/
|
|
108
|
-
function parseAnimationInfo(declarations) {
|
|
109
|
-
// Check for animation shorthand
|
|
110
|
-
const animationShorthand = declarations.get("animation");
|
|
111
|
-
if (animationShorthand) {
|
|
112
|
-
// Parse: name duration timing-function delay iteration-count direction fill-mode
|
|
113
|
-
// Example: "gradient-shift 3s ease infinite"
|
|
114
|
-
const parts = animationShorthand.split(/\s+/);
|
|
115
|
-
const result = { name: "" };
|
|
116
|
-
for (const part of parts) {
|
|
117
|
-
if (/^\d+(\.\d+)?(s|ms)$/.test(part)) {
|
|
118
|
-
// Duration or delay
|
|
119
|
-
if (!result.duration) {
|
|
120
|
-
result.duration = part;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
result.delay = part;
|
|
124
|
-
}
|
|
125
|
-
}
|
|
126
|
-
else if (/^(ease|linear|ease-in|ease-out|ease-in-out|cubic-bezier\([^)]+\)|steps\([^)]+\))$/.test(part)) {
|
|
127
|
-
result.timingFunction = part;
|
|
128
|
-
}
|
|
129
|
-
else if (/^(infinite|\d+)$/.test(part)) {
|
|
130
|
-
result.iterationCount = part;
|
|
131
|
-
}
|
|
132
|
-
else if (/^(normal|reverse|alternate|alternate-reverse)$/.test(part)) {
|
|
133
|
-
result.direction = part;
|
|
134
|
-
}
|
|
135
|
-
else if (/^(none|forwards|backwards|both)$/.test(part)) {
|
|
136
|
-
result.fillMode = part;
|
|
137
|
-
}
|
|
138
|
-
else if (part && !result.name) {
|
|
139
|
-
result.name = part;
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
if (result.name) {
|
|
143
|
-
return result;
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
// Check for individual animation properties
|
|
147
|
-
const animationName = declarations.get("animation-name");
|
|
148
|
-
if (animationName && animationName !== "none") {
|
|
149
|
-
const result = {
|
|
150
|
-
name: animationName,
|
|
151
|
-
};
|
|
152
|
-
// Only add properties if they have values (exactOptionalPropertyTypes compliance)
|
|
153
|
-
const duration = declarations.get("animation-duration");
|
|
154
|
-
if (duration)
|
|
155
|
-
result.duration = duration;
|
|
156
|
-
const timingFunction = declarations.get("animation-timing-function");
|
|
157
|
-
if (timingFunction)
|
|
158
|
-
result.timingFunction = timingFunction;
|
|
159
|
-
const iterationCount = declarations.get("animation-iteration-count");
|
|
160
|
-
if (iterationCount)
|
|
161
|
-
result.iterationCount = iterationCount;
|
|
162
|
-
const direction = declarations.get("animation-direction");
|
|
163
|
-
if (direction)
|
|
164
|
-
result.direction = direction;
|
|
165
|
-
const delay = declarations.get("animation-delay");
|
|
166
|
-
if (delay)
|
|
167
|
-
result.delay = delay;
|
|
168
|
-
const fillMode = declarations.get("animation-fill-mode");
|
|
169
|
-
if (fillMode)
|
|
170
|
-
result.fillMode = fillMode;
|
|
171
|
-
return result;
|
|
172
|
-
}
|
|
173
|
-
return undefined;
|
|
174
|
-
}
|
|
175
|
-
/**
|
|
176
|
-
* Parse transition shorthand or individual properties
|
|
177
|
-
*/
|
|
178
|
-
function parseTransitionInfo(declarations) {
|
|
179
|
-
// Check for transition shorthand
|
|
180
|
-
const transitionShorthand = declarations.get("transition");
|
|
181
|
-
if (transitionShorthand) {
|
|
182
|
-
// Parse: property duration timing-function delay
|
|
183
|
-
// Example: "background 0.3s ease"
|
|
184
|
-
const parts = transitionShorthand.split(/\s+/);
|
|
185
|
-
const result = { property: "" };
|
|
186
|
-
for (const part of parts) {
|
|
187
|
-
if (/^\d+(\.\d+)?(s|ms)$/.test(part)) {
|
|
188
|
-
// Duration or delay
|
|
189
|
-
if (!result.duration) {
|
|
190
|
-
result.duration = part;
|
|
191
|
-
}
|
|
192
|
-
else {
|
|
193
|
-
result.delay = part;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
else if (/^(ease|linear|ease-in|ease-out|ease-in-out|cubic-bezier\([^)]+\)|steps\([^)]+\))$/.test(part)) {
|
|
197
|
-
result.timingFunction = part;
|
|
198
|
-
}
|
|
199
|
-
else if (part && !result.property) {
|
|
200
|
-
result.property = part;
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
// Check if the transition applies to background
|
|
204
|
-
if (result.property && (result.property === "all" || result.property.includes("background"))) {
|
|
205
|
-
return result;
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
// Check for individual transition properties
|
|
209
|
-
const transitionProperty = declarations.get("transition-property");
|
|
210
|
-
if (transitionProperty) {
|
|
211
|
-
// Check if background is included
|
|
212
|
-
const properties = transitionProperty.split(",").map((p) => p.trim());
|
|
213
|
-
const bgIndex = properties.findIndex((p) => p === "all" || p.includes("background"));
|
|
214
|
-
if (bgIndex >= 0) {
|
|
215
|
-
const durations = (declarations.get("transition-duration") ?? "")
|
|
216
|
-
.split(",")
|
|
217
|
-
.map((d) => d.trim());
|
|
218
|
-
const timings = (declarations.get("transition-timing-function") ?? "")
|
|
219
|
-
.split(",")
|
|
220
|
-
.map((t) => t.trim());
|
|
221
|
-
const delays = (declarations.get("transition-delay") ?? "").split(",").map((d) => d.trim());
|
|
222
|
-
const result = {
|
|
223
|
-
property: properties[bgIndex] ?? "background",
|
|
224
|
-
};
|
|
225
|
-
// Only add properties if they have values (exactOptionalPropertyTypes compliance)
|
|
226
|
-
const duration = durations[bgIndex] ?? durations[0];
|
|
227
|
-
if (duration)
|
|
228
|
-
result.duration = duration;
|
|
229
|
-
const timingFunction = timings[bgIndex] ?? timings[0];
|
|
230
|
-
if (timingFunction)
|
|
231
|
-
result.timingFunction = timingFunction;
|
|
232
|
-
const delay = delays[bgIndex] ?? delays[0];
|
|
233
|
-
if (delay)
|
|
234
|
-
result.delay = delay;
|
|
235
|
-
return result;
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
return undefined;
|
|
239
|
-
}
|
|
240
|
-
/**
|
|
241
|
-
* Parse color stops from gradient arguments (simplified)
|
|
242
|
-
*/
|
|
243
|
-
function parseColorStopsFromCSS(gradientArgs) {
|
|
244
|
-
const colorStops = [];
|
|
245
|
-
// Remove direction/shape arguments for linear/radial
|
|
246
|
-
// Split by comma but respect parentheses
|
|
247
|
-
const parts = [];
|
|
248
|
-
let depth = 0;
|
|
249
|
-
let current = "";
|
|
250
|
-
for (const char of gradientArgs) {
|
|
251
|
-
if (char === "(")
|
|
252
|
-
depth++;
|
|
253
|
-
if (char === ")")
|
|
254
|
-
depth--;
|
|
255
|
-
if (char === "," && depth === 0) {
|
|
256
|
-
parts.push(current.trim());
|
|
257
|
-
current = "";
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
current += char;
|
|
261
|
-
}
|
|
262
|
-
}
|
|
263
|
-
if (current.trim()) {
|
|
264
|
-
parts.push(current.trim());
|
|
265
|
-
}
|
|
266
|
-
// Skip first part if it's a direction/position
|
|
267
|
-
let startIndex = 0;
|
|
268
|
-
if (parts[0]) {
|
|
269
|
-
const firstPart = parts[0].toLowerCase();
|
|
270
|
-
if (firstPart.includes("deg") ||
|
|
271
|
-
firstPart.startsWith("to ") ||
|
|
272
|
-
firstPart.includes("at ") ||
|
|
273
|
-
firstPart === "circle" ||
|
|
274
|
-
firstPart === "ellipse" ||
|
|
275
|
-
firstPart.startsWith("from ")) {
|
|
276
|
-
startIndex = 1;
|
|
277
|
-
}
|
|
278
|
-
}
|
|
279
|
-
// Parse color stops
|
|
280
|
-
for (let i = startIndex; i < parts.length; i++) {
|
|
281
|
-
const part = parts[i]?.trim() ?? "";
|
|
282
|
-
// Extract position percentage if present
|
|
283
|
-
const posMatch = part.match(/(\d+(\.\d+)?%)/);
|
|
284
|
-
const position = posMatch
|
|
285
|
-
? parseFloat(posMatch[1] ?? "0") / 100
|
|
286
|
-
: i === startIndex
|
|
287
|
-
? 0
|
|
288
|
-
: i === parts.length - 1
|
|
289
|
-
? 1
|
|
290
|
-
: (i - startIndex) / (parts.length - 1 - startIndex);
|
|
291
|
-
// Extract color (simplified - just take the color part)
|
|
292
|
-
const colorPart = part.replace(/\d+(\.\d+)?%/g, "").trim();
|
|
293
|
-
if (colorPart) {
|
|
294
|
-
colorStops.push({
|
|
295
|
-
color: colorPart,
|
|
296
|
-
position,
|
|
297
|
-
});
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
return colorStops;
|
|
301
|
-
}
|
|
302
|
-
/**
|
|
303
|
-
* Parse direction/angle from linear gradient
|
|
304
|
-
*/
|
|
305
|
-
function parseLinearDirection(gradientArgs) {
|
|
306
|
-
const firstPart = gradientArgs.split(",")[0]?.trim() ?? "";
|
|
307
|
-
// Check for angle (e.g., "45deg", "90deg")
|
|
308
|
-
const angleMatch = firstPart.match(/^(-?\d+(\.\d+)?)(deg|grad|rad|turn)/);
|
|
309
|
-
if (angleMatch) {
|
|
310
|
-
let value = parseFloat(angleMatch[1] ?? "0");
|
|
311
|
-
const unit = angleMatch[3];
|
|
312
|
-
// Convert to degrees
|
|
313
|
-
switch (unit) {
|
|
314
|
-
case "grad":
|
|
315
|
-
value = (value * 360) / 400;
|
|
316
|
-
break;
|
|
317
|
-
case "rad":
|
|
318
|
-
value = (value * 180) / Math.PI;
|
|
319
|
-
break;
|
|
320
|
-
case "turn":
|
|
321
|
-
value = value * 360;
|
|
322
|
-
break;
|
|
323
|
-
}
|
|
324
|
-
return value;
|
|
325
|
-
}
|
|
326
|
-
// Check for direction keywords
|
|
327
|
-
const directionMap = {
|
|
328
|
-
"to top": 0,
|
|
329
|
-
"to top right": 45,
|
|
330
|
-
"to right": 90,
|
|
331
|
-
"to bottom right": 135,
|
|
332
|
-
"to bottom": 180,
|
|
333
|
-
"to bottom left": 225,
|
|
334
|
-
"to left": 270,
|
|
335
|
-
"to top left": 315,
|
|
336
|
-
};
|
|
337
|
-
const lowerFirst = firstPart.toLowerCase();
|
|
338
|
-
for (const [key, value] of Object.entries(directionMap)) {
|
|
339
|
-
if (lowerFirst === key) {
|
|
340
|
-
return value;
|
|
341
|
-
}
|
|
342
|
-
}
|
|
343
|
-
return undefined;
|
|
344
|
-
}
|
|
345
|
-
/**
|
|
346
|
-
* Parse center position from radial/conic gradient
|
|
347
|
-
*/
|
|
348
|
-
function parseGradientCenter(gradientArgs) {
|
|
349
|
-
const result = {};
|
|
350
|
-
// Check for "at X% Y%" or "at X Y"
|
|
351
|
-
const atMatch = gradientArgs.match(/at\s+(\d+%?)\s+(\d+%?)/i);
|
|
352
|
-
if (atMatch) {
|
|
353
|
-
const xStr = atMatch[1] ?? "50%";
|
|
354
|
-
const yStr = atMatch[2] ?? "50%";
|
|
355
|
-
result.centerX = xStr.includes("%") ? parseFloat(xStr) / 100 : parseFloat(xStr) / 100;
|
|
356
|
-
result.centerY = yStr.includes("%") ? parseFloat(yStr) / 100 : parseFloat(yStr) / 100;
|
|
357
|
-
}
|
|
358
|
-
// Check for 'at center' keyword
|
|
359
|
-
if (gradientArgs.toLowerCase().includes("at center")) {
|
|
360
|
-
result.centerX = 0.5;
|
|
361
|
-
result.centerY = 0.5;
|
|
362
|
-
}
|
|
363
|
-
return result;
|
|
364
|
-
}
|
|
365
|
-
// =============================================================================
|
|
366
|
-
// Conic Gradient Helper Functions
|
|
367
|
-
// =============================================================================
|
|
368
|
-
/**
|
|
369
|
-
* Sample colors around a circle at fixed radius
|
|
370
|
-
*/
|
|
371
|
-
function sampleColorsAroundCircle(data, width, height, channels, cx, cy, radius, numSamples) {
|
|
372
|
-
const colors = [];
|
|
373
|
-
for (let i = 0; i < numSamples; i++) {
|
|
374
|
-
const angle = (i / numSamples) * 2 * Math.PI;
|
|
375
|
-
const x = Math.floor(cx + Math.cos(angle) * radius);
|
|
376
|
-
const y = Math.floor(cy + Math.sin(angle) * radius);
|
|
377
|
-
if (x >= 0 && x < width && y >= 0 && y < height) {
|
|
378
|
-
const pixelIndex = (y * width + x) * channels;
|
|
379
|
-
const r = data[pixelIndex] ?? 0;
|
|
380
|
-
const g = data[pixelIndex + 1] ?? 0;
|
|
381
|
-
const b = data[pixelIndex + 2] ?? 0;
|
|
382
|
-
colors.push({ color: [r, g, b], angle });
|
|
383
|
-
}
|
|
384
|
-
}
|
|
385
|
-
return colors;
|
|
386
|
-
}
|
|
387
|
-
/**
|
|
388
|
-
* Analyze angular color variation to determine if conic gradient exists
|
|
389
|
-
*/
|
|
390
|
-
function analyzeAngularVariation(colors) {
|
|
391
|
-
let totalVariation = 0;
|
|
392
|
-
let numTransitions = 0;
|
|
393
|
-
// Calculate variation between adjacent samples
|
|
394
|
-
for (let i = 1; i < colors.length; i++) {
|
|
395
|
-
const prevColor = colors[i - 1];
|
|
396
|
-
const currColor = colors[i];
|
|
397
|
-
if (prevColor && currColor) {
|
|
398
|
-
const deltaE = (0, image_utils_1.colorDistance)(prevColor.color, currColor.color);
|
|
399
|
-
totalVariation += deltaE;
|
|
400
|
-
if (deltaE > SIMILAR_COLOR_THRESHOLD) {
|
|
401
|
-
numTransitions++;
|
|
402
|
-
}
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
// Check wrap-around
|
|
406
|
-
const lastColorEntry = colors[colors.length - 1];
|
|
407
|
-
const firstColorEntry = colors[0];
|
|
408
|
-
if (lastColorEntry && firstColorEntry) {
|
|
409
|
-
const wrapDeltaE = (0, image_utils_1.colorDistance)(lastColorEntry.color, firstColorEntry.color);
|
|
410
|
-
totalVariation += wrapDeltaE;
|
|
411
|
-
}
|
|
412
|
-
const avgVariation = colors.length > 0 ? totalVariation / colors.length : 0;
|
|
413
|
-
// Determine if this is a conic gradient
|
|
414
|
-
const hasEnoughTransitions = numTransitions >= CONIC_MIN_TRANSITIONS;
|
|
415
|
-
const hasSignificantVariation = avgVariation > SIMILAR_COLOR_THRESHOLD;
|
|
416
|
-
const hasTotalVariation = totalVariation > CONTINUOUS_GRADIENT_THRESHOLD * 2;
|
|
417
|
-
const isConic = hasEnoughTransitions && hasSignificantVariation && hasTotalVariation;
|
|
418
|
-
return { totalVariation, numTransitions, avgVariation, isConic };
|
|
419
|
-
}
|
|
420
|
-
/**
|
|
421
|
-
* Find significant color transition points for color stops
|
|
422
|
-
*/
|
|
423
|
-
function findSignificantColorPoints(colors) {
|
|
424
|
-
const significantColors = [];
|
|
425
|
-
for (let i = 0; i < colors.length; i++) {
|
|
426
|
-
const prevIndex = (i - 1 + colors.length) % colors.length;
|
|
427
|
-
const nextIndex = (i + 1) % colors.length;
|
|
428
|
-
const prevColorEntry = colors[prevIndex];
|
|
429
|
-
const currColorEntry = colors[i];
|
|
430
|
-
const nextColorEntry = colors[nextIndex];
|
|
431
|
-
if (prevColorEntry && currColorEntry && nextColorEntry) {
|
|
432
|
-
const prevDeltaE = (0, image_utils_1.colorDistance)(prevColorEntry.color, currColorEntry.color);
|
|
433
|
-
const nextDeltaE = (0, image_utils_1.colorDistance)(currColorEntry.color, nextColorEntry.color);
|
|
434
|
-
// Detect transition points
|
|
435
|
-
if (prevDeltaE > CONTINUOUS_GRADIENT_THRESHOLD ||
|
|
436
|
-
nextDeltaE > CONTINUOUS_GRADIENT_THRESHOLD) {
|
|
437
|
-
significantColors.push({
|
|
438
|
-
color: currColorEntry.color,
|
|
439
|
-
position: i / colors.length,
|
|
440
|
-
});
|
|
441
|
-
}
|
|
442
|
-
}
|
|
443
|
-
}
|
|
444
|
-
return significantColors;
|
|
445
|
-
}
|
|
446
|
-
/**
|
|
447
|
-
* Extract color stops from angular color samples
|
|
448
|
-
*/
|
|
449
|
-
function extractConicColorStops(colors, significantColors) {
|
|
450
|
-
const colorStops = [];
|
|
451
|
-
// If few significant points, use evenly distributed samples
|
|
452
|
-
if (significantColors.length < 3) {
|
|
453
|
-
const step = Math.floor(colors.length / 4);
|
|
454
|
-
for (let i = 0; i < 4; i++) {
|
|
455
|
-
const idx = i * step;
|
|
456
|
-
const colorEntry = colors[idx];
|
|
457
|
-
if (colorEntry) {
|
|
458
|
-
colorStops.push({
|
|
459
|
-
color: (0, image_utils_1.rgbToHex)(colorEntry.color[0], colorEntry.color[1], colorEntry.color[2]),
|
|
460
|
-
position: idx / colors.length,
|
|
461
|
-
});
|
|
462
|
-
}
|
|
463
|
-
}
|
|
464
|
-
}
|
|
465
|
-
else {
|
|
466
|
-
// Use significant transition points
|
|
467
|
-
for (const sc of significantColors.slice(0, 6)) {
|
|
468
|
-
colorStops.push({
|
|
469
|
-
color: (0, image_utils_1.rgbToHex)(sc.color[0], sc.color[1], sc.color[2]),
|
|
470
|
-
position: sc.position,
|
|
471
|
-
});
|
|
472
|
-
}
|
|
473
|
-
}
|
|
474
|
-
// Sort color stops by position
|
|
475
|
-
colorStops.sort((a, b) => a.position - b.position);
|
|
476
|
-
return colorStops;
|
|
477
|
-
}
|
|
478
|
-
/**
|
|
479
|
-
* Sample colors along a line from start to end
|
|
480
|
-
*/
|
|
481
|
-
function sampleColorsAlongLine(data, width, height, channels, startX, startY, endX, endY, step) {
|
|
482
|
-
const colors = [];
|
|
483
|
-
const dx = endX - startX;
|
|
484
|
-
const dy = endY - startY;
|
|
485
|
-
const length = Math.sqrt(dx * dx + dy * dy);
|
|
486
|
-
const steps = Math.ceil(length / step);
|
|
487
|
-
if (steps < 2) {
|
|
488
|
-
return colors;
|
|
489
|
-
}
|
|
490
|
-
for (let i = 0; i <= steps; i++) {
|
|
491
|
-
const t = i / steps;
|
|
492
|
-
const x = Math.round(startX + dx * t);
|
|
493
|
-
const y = Math.round(startY + dy * t);
|
|
494
|
-
if (x >= 0 && x < width && y >= 0 && y < height) {
|
|
495
|
-
const pixelIndex = (y * width + x) * channels;
|
|
496
|
-
const r = data[pixelIndex] ?? 0;
|
|
497
|
-
const g = data[pixelIndex + 1] ?? 0;
|
|
498
|
-
const b = data[pixelIndex + 2] ?? 0;
|
|
499
|
-
colors.push({ color: [r, g, b], position: t });
|
|
500
|
-
}
|
|
501
|
-
}
|
|
502
|
-
return colors;
|
|
503
|
-
}
|
|
504
|
-
/**
|
|
505
|
-
* Calculate color variation metrics along sampled colors
|
|
506
|
-
*/
|
|
507
|
-
function calculateColorVariation(colors) {
|
|
508
|
-
if (colors.length < 2) {
|
|
509
|
-
return { avgDeltaE: 0, totalChange: 0, firstColor: null, lastColor: null };
|
|
510
|
-
}
|
|
511
|
-
let totalDeltaE = 0;
|
|
512
|
-
for (let i = 1; i < colors.length; i++) {
|
|
513
|
-
const prevColor = colors[i - 1];
|
|
514
|
-
const currColor = colors[i];
|
|
515
|
-
if (prevColor && currColor) {
|
|
516
|
-
const deltaE = (0, image_utils_1.colorDistance)(prevColor.color, currColor.color);
|
|
517
|
-
totalDeltaE += deltaE;
|
|
518
|
-
}
|
|
519
|
-
}
|
|
520
|
-
const avgDeltaE = totalDeltaE / (colors.length - 1);
|
|
521
|
-
const firstColorEntry = colors[0];
|
|
522
|
-
const lastColorEntry = colors[colors.length - 1];
|
|
523
|
-
if (!firstColorEntry || !lastColorEntry) {
|
|
524
|
-
return { avgDeltaE, totalChange: 0, firstColor: null, lastColor: null };
|
|
525
|
-
}
|
|
526
|
-
const firstColor = firstColorEntry.color;
|
|
527
|
-
const lastColor = lastColorEntry.color;
|
|
528
|
-
const totalChange = (0, image_utils_1.colorDistance)(firstColor, lastColor);
|
|
529
|
-
return { avgDeltaE, totalChange, firstColor, lastColor };
|
|
530
|
-
}
|
|
531
|
-
/**
|
|
532
|
-
* Extract color stops from line gradient
|
|
533
|
-
*/
|
|
534
|
-
function extractLineColorStops(colors, firstColor, lastColor) {
|
|
535
|
-
const colorStops = [];
|
|
536
|
-
// Add start
|
|
537
|
-
colorStops.push({
|
|
538
|
-
color: (0, image_utils_1.rgbToHex)(firstColor[0], firstColor[1], firstColor[2]),
|
|
539
|
-
position: 0,
|
|
540
|
-
});
|
|
541
|
-
// Find significant intermediate stops
|
|
542
|
-
const middleIndex = Math.floor(colors.length / 2);
|
|
543
|
-
if (colors.length > 4) {
|
|
544
|
-
const midEntry = colors[middleIndex];
|
|
545
|
-
if (midEntry) {
|
|
546
|
-
const midColor = midEntry.color;
|
|
547
|
-
const distFromStart = (0, image_utils_1.colorDistance)(firstColor, midColor);
|
|
548
|
-
const distFromEnd = (0, image_utils_1.colorDistance)(midColor, lastColor);
|
|
549
|
-
if (distFromStart > CONTINUOUS_GRADIENT_THRESHOLD &&
|
|
550
|
-
distFromEnd > CONTINUOUS_GRADIENT_THRESHOLD) {
|
|
551
|
-
colorStops.push({
|
|
552
|
-
color: (0, image_utils_1.rgbToHex)(midColor[0], midColor[1], midColor[2]),
|
|
553
|
-
position: 0.5,
|
|
554
|
-
});
|
|
555
|
-
}
|
|
556
|
-
}
|
|
557
|
-
}
|
|
558
|
-
// Add end - always at position 1.0
|
|
559
|
-
colorStops.push({
|
|
560
|
-
color: (0, image_utils_1.rgbToHex)(lastColor[0], lastColor[1], lastColor[2]),
|
|
561
|
-
position: 1,
|
|
562
|
-
});
|
|
563
|
-
return colorStops;
|
|
564
|
-
}
|
|
565
|
-
/**
|
|
566
|
-
* Analyze color changes along a line to detect gradient
|
|
567
|
-
*
|
|
568
|
-
* Refactored to reduce cyclomatic complexity by extracting helper functions:
|
|
569
|
-
* - sampleColorsAlongLine: Color sampling
|
|
570
|
-
* - calculateColorVariation: Variation metrics calculation
|
|
571
|
-
* - extractLineColorStops: Color stop extraction
|
|
572
|
-
*/
|
|
573
|
-
function analyzeLineGradient(data, width, height, channels, startX, startY, endX, endY, step) {
|
|
574
|
-
// Step 1: Sample colors along the line
|
|
575
|
-
const colors = sampleColorsAlongLine(data, width, height, channels, startX, startY, endX, endY, step);
|
|
576
|
-
if (colors.length < 2) {
|
|
577
|
-
return { isGradient: false, colorStops: [], avgDeltaE: 0, totalChange: 0 };
|
|
578
|
-
}
|
|
579
|
-
// Step 2: Calculate color variation metrics
|
|
580
|
-
const { avgDeltaE, totalChange, firstColor, lastColor } = calculateColorVariation(colors);
|
|
581
|
-
if (!firstColor || !lastColor) {
|
|
582
|
-
return { isGradient: false, colorStops: [], avgDeltaE: 0, totalChange: 0 };
|
|
583
|
-
}
|
|
584
|
-
// Step 3: Determine if gradient exists
|
|
585
|
-
const isGradient = totalChange > CONTINUOUS_GRADIENT_THRESHOLD;
|
|
586
|
-
// Step 4: Extract color stops if gradient detected
|
|
587
|
-
const colorStops = isGradient ? extractLineColorStops(colors, firstColor, lastColor) : [];
|
|
588
|
-
return { isGradient, colorStops, avgDeltaE, totalChange };
|
|
589
|
-
}
|
|
590
|
-
/** Standard angles to test for linear gradient detection */
|
|
591
|
-
const LINEAR_TEST_ANGLES = [
|
|
592
|
-
0, 30, 45, 60, 90, 120, 135, 150, 180, 210, 225, 240, 270, 300, 315, 330,
|
|
593
|
-
];
|
|
594
|
-
/** Number of parallel lines to sample for each angle */
|
|
595
|
-
const LINEAR_NUM_SAMPLES = 7;
|
|
596
|
-
/**
|
|
597
|
-
* Calculate sampling line coordinates for a horizontal gradient
|
|
598
|
-
*/
|
|
599
|
-
function calculateHorizontalLine(width, height, offset) {
|
|
600
|
-
const y = Math.floor(height * (0.5 + offset * 0.6));
|
|
601
|
-
return { startX: 0, startY: y, endX: width - 1, endY: y };
|
|
602
|
-
}
|
|
603
|
-
/**
|
|
604
|
-
* Calculate sampling line coordinates for a vertical gradient
|
|
605
|
-
*/
|
|
606
|
-
function calculateVerticalLine(width, height, offset) {
|
|
607
|
-
const x = Math.floor(width * (0.5 + offset * 0.6));
|
|
608
|
-
return { startX: x, startY: 0, endX: x, endY: height - 1 };
|
|
609
|
-
}
|
|
610
|
-
/**
|
|
611
|
-
* Calculate sampling line coordinates for a diagonal gradient
|
|
612
|
-
*/
|
|
613
|
-
function calculateDiagonalLine(width, height, cosA, sinA, offset) {
|
|
614
|
-
const centerX = width / 2;
|
|
615
|
-
const centerY = height / 2;
|
|
616
|
-
const diagonalLen = (Math.sqrt(width * width + height * height) / 2) * 0.9;
|
|
617
|
-
let startX = Math.floor(centerX - cosA * diagonalLen);
|
|
618
|
-
let startY = Math.floor(centerY - sinA * diagonalLen);
|
|
619
|
-
let endX = Math.floor(centerX + cosA * diagonalLen);
|
|
620
|
-
let endY = Math.floor(centerY + sinA * diagonalLen);
|
|
621
|
-
// Apply perpendicular offset for parallel sampling lines
|
|
622
|
-
const perpX = -sinA * offset * height * 0.3;
|
|
623
|
-
const perpY = cosA * offset * height * 0.3;
|
|
624
|
-
startX += Math.floor(perpX);
|
|
625
|
-
startY += Math.floor(perpY);
|
|
626
|
-
endX += Math.floor(perpX);
|
|
627
|
-
endY += Math.floor(perpY);
|
|
628
|
-
return { startX, startY, endX, endY };
|
|
629
|
-
}
|
|
630
|
-
/**
|
|
631
|
-
* Calculate sampling line coordinates for a given angle and offset
|
|
632
|
-
*/
|
|
633
|
-
function calculateSamplingLine(width, height, angle, cosA, sinA, offset) {
|
|
634
|
-
let coords;
|
|
635
|
-
if (angle === 0 || angle === 180) {
|
|
636
|
-
coords = calculateHorizontalLine(width, height, offset);
|
|
637
|
-
}
|
|
638
|
-
else if (angle === 90 || angle === 270) {
|
|
639
|
-
coords = calculateVerticalLine(width, height, offset);
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
coords = calculateDiagonalLine(width, height, cosA, sinA, offset);
|
|
643
|
-
}
|
|
644
|
-
// Clamp to bounds
|
|
645
|
-
return {
|
|
646
|
-
startX: Math.max(0, Math.min(width - 1, coords.startX)),
|
|
647
|
-
startY: Math.max(0, Math.min(height - 1, coords.startY)),
|
|
648
|
-
endX: Math.max(0, Math.min(width - 1, coords.endX)),
|
|
649
|
-
endY: Math.max(0, Math.min(height - 1, coords.endY)),
|
|
650
|
-
};
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Analyze gradient at a specific angle by sampling multiple parallel lines
|
|
654
|
-
*/
|
|
655
|
-
function analyzeLinearAngle(data, width, height, channels, angle, step) {
|
|
656
|
-
const radians = (angle * Math.PI) / 180;
|
|
657
|
-
const cosA = Math.cos(radians);
|
|
658
|
-
const sinA = Math.sin(radians);
|
|
659
|
-
const lineResults = [];
|
|
660
|
-
for (let s = 0; s < LINEAR_NUM_SAMPLES; s++) {
|
|
661
|
-
const offset = s / (LINEAR_NUM_SAMPLES - 1) - 0.5;
|
|
662
|
-
const coords = calculateSamplingLine(width, height, angle, cosA, sinA, offset);
|
|
663
|
-
const result = analyzeLineGradient(data, width, height, channels, coords.startX, coords.startY, coords.endX, coords.endY, step);
|
|
664
|
-
lineResults.push(result);
|
|
665
|
-
}
|
|
666
|
-
// Score this angle based on consistency of gradients across samples
|
|
667
|
-
const gradientCount = lineResults.filter((r) => r.isGradient).length;
|
|
668
|
-
const avgDeltaE = lineResults.reduce((sum, r) => sum + r.avgDeltaE, 0) / lineResults.length;
|
|
669
|
-
const avgTotalChange = lineResults.reduce((sum, r) => sum + r.totalChange, 0) / lineResults.length;
|
|
670
|
-
const consistency = gradientCount / LINEAR_NUM_SAMPLES;
|
|
671
|
-
// Require at least half the lines to show gradient
|
|
672
|
-
if (gradientCount < Math.ceil(LINEAR_NUM_SAMPLES * 0.5)) {
|
|
673
|
-
return null;
|
|
674
|
-
}
|
|
675
|
-
const firstGradient = lineResults.find((r) => r.isGradient);
|
|
676
|
-
return {
|
|
677
|
-
angle,
|
|
678
|
-
colorStops: firstGradient?.colorStops ?? [],
|
|
679
|
-
avgDeltaE,
|
|
680
|
-
totalChange: avgTotalChange,
|
|
681
|
-
isGradient: true,
|
|
682
|
-
consistency,
|
|
683
|
-
};
|
|
684
|
-
}
|
|
685
|
-
/**
|
|
686
|
-
* Detect linear gradient pattern
|
|
687
|
-
*
|
|
688
|
-
* Refactored to reduce cyclomatic complexity by extracting helper functions:
|
|
689
|
-
* - calculateSamplingLine: Line coordinate calculation
|
|
690
|
-
* - analyzeLinearAngle: Per-angle analysis
|
|
691
|
-
*/
|
|
692
|
-
function detectLinearGradient(data, width, height, channels, config) {
|
|
693
|
-
const step = config.sampleStep;
|
|
694
|
-
let bestResult = null;
|
|
695
|
-
let bestScore = 0;
|
|
696
|
-
// Test each angle
|
|
697
|
-
for (const angle of LINEAR_TEST_ANGLES) {
|
|
698
|
-
const result = analyzeLinearAngle(data, width, height, channels, angle, step);
|
|
699
|
-
if (result) {
|
|
700
|
-
const score = result.consistency * result.totalChange;
|
|
701
|
-
if (score > bestScore) {
|
|
702
|
-
bestScore = score;
|
|
703
|
-
bestResult = result;
|
|
704
|
-
}
|
|
705
|
-
}
|
|
706
|
-
}
|
|
707
|
-
if (!bestResult || bestScore < LINEAR_MIN_SCORE_THRESHOLD) {
|
|
708
|
-
return null;
|
|
709
|
-
}
|
|
710
|
-
// Calculate confidence based on total color change and consistency
|
|
711
|
-
const colorChangeRatio = Math.min(1, bestResult.totalChange / 300);
|
|
712
|
-
const confidence = Math.min(1, colorChangeRatio * 0.7 + bestResult.consistency * 0.3);
|
|
713
|
-
return {
|
|
714
|
-
type: "linear",
|
|
715
|
-
direction: bestResult.angle,
|
|
716
|
-
colorStops: bestResult.colorStops,
|
|
717
|
-
region: { x: 0, y: 0, width, height },
|
|
718
|
-
confidence,
|
|
719
|
-
};
|
|
720
|
-
}
|
|
721
|
-
/** Standard center candidates for radial gradient detection */
|
|
722
|
-
const RADIAL_CENTER_CANDIDATES = [
|
|
723
|
-
{ x: 0.5, y: 0.5 },
|
|
724
|
-
{ x: 0.25, y: 0.5 },
|
|
725
|
-
{ x: 0.75, y: 0.5 },
|
|
726
|
-
{ x: 0.5, y: 0.25 },
|
|
727
|
-
{ x: 0.5, y: 0.75 },
|
|
728
|
-
{ x: 0.25, y: 0.25 },
|
|
729
|
-
{ x: 0.75, y: 0.75 },
|
|
730
|
-
{ x: 0.25, y: 0.75 },
|
|
731
|
-
{ x: 0.75, y: 0.25 },
|
|
732
|
-
];
|
|
733
|
-
/**
|
|
734
|
-
* Calculate the end point for a radial line from center at given angle
|
|
735
|
-
*/
|
|
736
|
-
function calculateRadialEndPoint(cx, cy, width, height, angle) {
|
|
737
|
-
const maxX = angle > Math.PI / 2 && angle < (3 * Math.PI) / 2 ? cx : width - cx;
|
|
738
|
-
const maxY = angle > 0 && angle < Math.PI ? height - cy : cy;
|
|
739
|
-
const radius = Math.min(maxX / Math.abs(Math.cos(angle) || 0.001), maxY / Math.abs(Math.sin(angle) || 0.001)) *
|
|
740
|
-
0.85;
|
|
741
|
-
const clampedRadius = Math.min(radius, Math.max(width, height) * 0.7);
|
|
742
|
-
const endX = Math.floor(cx + Math.cos(angle) * clampedRadius);
|
|
743
|
-
const endY = Math.floor(cy + Math.sin(angle) * clampedRadius);
|
|
744
|
-
return { endX, endY };
|
|
745
|
-
}
|
|
746
|
-
/**
|
|
747
|
-
* Analyze radial gradient from a specific center point
|
|
748
|
-
*/
|
|
749
|
-
function analyzeRadialCenter(data, width, height, channels, center, step, numAngles) {
|
|
750
|
-
const cx = Math.floor(width * center.x);
|
|
751
|
-
const cy = Math.floor(height * center.y);
|
|
752
|
-
const radialResults = [];
|
|
753
|
-
// Sample along multiple radial lines from center
|
|
754
|
-
for (let i = 0; i < numAngles; i++) {
|
|
755
|
-
const angle = (i / numAngles) * 2 * Math.PI;
|
|
756
|
-
const { endX, endY } = calculateRadialEndPoint(cx, cy, width, height, angle);
|
|
757
|
-
const result = analyzeLineGradient(data, width, height, channels, cx, cy, endX, endY, step);
|
|
758
|
-
radialResults.push(result);
|
|
759
|
-
}
|
|
760
|
-
// Calculate metrics
|
|
761
|
-
const gradientCount = radialResults.filter((r) => r.isGradient).length;
|
|
762
|
-
const avgTotalChange = radialResults.reduce((sum, r) => sum + r.totalChange, 0) / radialResults.length;
|
|
763
|
-
const consistency = gradientCount / numAngles;
|
|
764
|
-
// For radial gradient, at least half the radial lines should show gradient
|
|
765
|
-
const isRadial = consistency >= RADIAL_CONSISTENCY_THRESHOLD && gradientCount >= 6;
|
|
766
|
-
const score = consistency * avgTotalChange;
|
|
767
|
-
const firstGradient = radialResults.find((r) => r.isGradient);
|
|
768
|
-
return {
|
|
769
|
-
centerX: center.x,
|
|
770
|
-
centerY: center.y,
|
|
771
|
-
colorStops: firstGradient?.colorStops ?? [],
|
|
772
|
-
score,
|
|
773
|
-
consistency,
|
|
774
|
-
totalChange: avgTotalChange,
|
|
775
|
-
isRadial,
|
|
776
|
-
};
|
|
777
|
-
}
|
|
778
|
-
/**
|
|
779
|
-
* Detect radial gradient pattern
|
|
780
|
-
*
|
|
781
|
-
* Refactored to reduce cyclomatic complexity by extracting helper functions:
|
|
782
|
-
* - calculateRadialEndPoint: End point calculation
|
|
783
|
-
* - analyzeRadialCenter: Center point analysis
|
|
784
|
-
*/
|
|
785
|
-
function detectRadialGradient(data, width, height, channels, config) {
|
|
786
|
-
const step = config.sampleStep;
|
|
787
|
-
const numAngles = 16; // Increased for better detection
|
|
788
|
-
let bestResult = null;
|
|
789
|
-
// Test each center candidate
|
|
790
|
-
for (const center of RADIAL_CENTER_CANDIDATES) {
|
|
791
|
-
const result = analyzeRadialCenter(data, width, height, channels, center, step, numAngles);
|
|
792
|
-
if (result.isRadial && (!bestResult || result.score > bestResult.score)) {
|
|
793
|
-
bestResult = result;
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
if (!bestResult || !bestResult.isRadial) {
|
|
797
|
-
return null;
|
|
798
|
-
}
|
|
799
|
-
// Calculate confidence based on consistency and color change
|
|
800
|
-
const colorChangeRatio = Math.min(1, bestResult.totalChange / 250);
|
|
801
|
-
const confidence = Math.min(1, colorChangeRatio * 0.5 + bestResult.consistency * 0.5);
|
|
802
|
-
return {
|
|
803
|
-
type: "radial",
|
|
804
|
-
centerX: bestResult.centerX,
|
|
805
|
-
centerY: bestResult.centerY,
|
|
806
|
-
colorStops: bestResult.colorStops,
|
|
807
|
-
region: { x: 0, y: 0, width, height },
|
|
808
|
-
confidence,
|
|
809
|
-
};
|
|
810
|
-
}
|
|
811
|
-
/**
|
|
812
|
-
* Detect conic gradient pattern
|
|
813
|
-
*
|
|
814
|
-
* Refactored to reduce cyclomatic complexity by extracting helper functions:
|
|
815
|
-
* - sampleColorsAroundCircle: Color sampling
|
|
816
|
-
* - analyzeAngularVariation: Variation analysis
|
|
817
|
-
* - findSignificantColorPoints: Transition point detection
|
|
818
|
-
* - extractConicColorStops: Color stop extraction
|
|
819
|
-
*/
|
|
820
|
-
function detectConicGradient(data, width, height, channels, _config) {
|
|
821
|
-
const cx = Math.floor(width / 2);
|
|
822
|
-
const cy = Math.floor(height / 2);
|
|
823
|
-
const radius = Math.min(width, height) / 3;
|
|
824
|
-
const numSamples = 36; // Every 10 degrees
|
|
825
|
-
// Step 1: Sample colors around circle
|
|
826
|
-
const colors = sampleColorsAroundCircle(data, width, height, channels, cx, cy, radius, numSamples);
|
|
827
|
-
if (colors.length < numSamples * CONIC_MIN_SAMPLES_RATIO) {
|
|
828
|
-
return null;
|
|
829
|
-
}
|
|
830
|
-
// Step 2: Analyze angular variation
|
|
831
|
-
const variationResult = analyzeAngularVariation(colors);
|
|
832
|
-
if (!variationResult.isConic) {
|
|
833
|
-
return null;
|
|
834
|
-
}
|
|
835
|
-
// Step 3: Find significant color points
|
|
836
|
-
const significantColors = findSignificantColorPoints(colors);
|
|
837
|
-
// Step 4: Extract color stops
|
|
838
|
-
const colorStops = extractConicColorStops(colors, significantColors);
|
|
839
|
-
// Calculate confidence
|
|
840
|
-
const confidence = Math.min(1, variationResult.avgVariation / 30);
|
|
841
|
-
return {
|
|
842
|
-
type: "conic",
|
|
843
|
-
centerX: 0.5,
|
|
844
|
-
centerY: 0.5,
|
|
845
|
-
colorStops,
|
|
846
|
-
region: { x: 0, y: 0, width, height },
|
|
847
|
-
confidence,
|
|
848
|
-
};
|
|
849
|
-
}
|
|
850
|
-
/**
|
|
851
|
-
* Check if image is mostly solid color
|
|
852
|
-
*/
|
|
853
|
-
function isSolidColor(data, width, height, channels, sampleStep) {
|
|
854
|
-
const colors = [];
|
|
855
|
-
// Sample a grid of pixels
|
|
856
|
-
for (let y = 0; y < height; y += sampleStep) {
|
|
857
|
-
for (let x = 0; x < width; x += sampleStep) {
|
|
858
|
-
const pixelIndex = (y * width + x) * channels;
|
|
859
|
-
const r = data[pixelIndex] ?? 0;
|
|
860
|
-
const g = data[pixelIndex + 1] ?? 0;
|
|
861
|
-
const b = data[pixelIndex + 2] ?? 0;
|
|
862
|
-
colors.push([r, g, b]);
|
|
863
|
-
}
|
|
864
|
-
}
|
|
865
|
-
if (colors.length < 2) {
|
|
866
|
-
return true;
|
|
867
|
-
}
|
|
868
|
-
// Calculate max color distance from first sample
|
|
869
|
-
const firstColor = colors[0];
|
|
870
|
-
if (!firstColor) {
|
|
871
|
-
return true;
|
|
872
|
-
}
|
|
873
|
-
let maxDistance = 0;
|
|
874
|
-
for (let i = 1; i < colors.length; i++) {
|
|
875
|
-
const currentColor = colors[i];
|
|
876
|
-
if (currentColor) {
|
|
877
|
-
const dist = (0, image_utils_1.colorDistance)(firstColor, currentColor);
|
|
878
|
-
maxDistance = Math.max(maxDistance, dist);
|
|
879
|
-
}
|
|
880
|
-
}
|
|
881
|
-
// If max distance is small, consider it solid
|
|
882
|
-
return maxDistance < CONTINUOUS_GRADIENT_THRESHOLD;
|
|
883
|
-
}
|
|
884
|
-
// =============================================================================
|
|
885
|
-
// Helper Types and Functions for detectGradientInternal
|
|
886
|
-
// =============================================================================
|
|
887
|
-
/**
|
|
888
|
-
* Type weight mapping for gradient type specificity
|
|
889
|
-
* Higher weight = more specific gradient type
|
|
890
|
-
*/
|
|
891
|
-
const GRADIENT_TYPE_WEIGHTS = {
|
|
892
|
-
conic: 3,
|
|
893
|
-
radial: 2,
|
|
894
|
-
linear: 1,
|
|
895
|
-
};
|
|
896
|
-
/**
|
|
897
|
-
* Get type weight for sorting
|
|
898
|
-
*/
|
|
899
|
-
function getGradientTypeWeight(type) {
|
|
900
|
-
return GRADIENT_TYPE_WEIGHTS[type] ?? 0;
|
|
901
|
-
}
|
|
902
|
-
/**
|
|
903
|
-
* Detect all gradient types and collect results
|
|
904
|
-
*/
|
|
905
|
-
function detectAllGradientTypes(data, width, height, channels, config) {
|
|
906
|
-
const gradients = [];
|
|
907
|
-
const linearGradient = detectLinearGradient(data, width, height, channels, config);
|
|
908
|
-
const radialGradient = detectRadialGradient(data, width, height, channels, config);
|
|
909
|
-
const conicGradient = detectConicGradient(data, width, height, channels, config);
|
|
910
|
-
if (linearGradient) {
|
|
911
|
-
gradients.push(linearGradient);
|
|
912
|
-
}
|
|
913
|
-
if (radialGradient) {
|
|
914
|
-
gradients.push(radialGradient);
|
|
915
|
-
}
|
|
916
|
-
if (conicGradient) {
|
|
917
|
-
gradients.push(conicGradient);
|
|
918
|
-
}
|
|
919
|
-
return gradients;
|
|
920
|
-
}
|
|
921
|
-
/**
|
|
922
|
-
* Sort gradients by confidence and type specificity
|
|
923
|
-
*/
|
|
924
|
-
function sortGradientsByPriority(gradients) {
|
|
925
|
-
gradients.sort((a, b) => {
|
|
926
|
-
// If confidence difference is significant, use confidence
|
|
927
|
-
if (Math.abs(a.confidence - b.confidence) > 0.2) {
|
|
928
|
-
return b.confidence - a.confidence;
|
|
929
|
-
}
|
|
930
|
-
// Otherwise prioritize by type specificity
|
|
931
|
-
return getGradientTypeWeight(b.type) - getGradientTypeWeight(a.type);
|
|
932
|
-
});
|
|
933
|
-
}
|
|
934
|
-
/**
|
|
935
|
-
* Build the final gradient detection result
|
|
936
|
-
*/
|
|
937
|
-
function buildGradientResult(gradients, processingTimeMs) {
|
|
938
|
-
// Determine dominant type
|
|
939
|
-
let dominantGradientType = undefined;
|
|
940
|
-
const firstGradient = gradients[0];
|
|
941
|
-
if (firstGradient) {
|
|
942
|
-
dominantGradientType = firstGradient.type;
|
|
943
|
-
}
|
|
944
|
-
// Calculate overall confidence
|
|
945
|
-
const overallConfidence = gradients.length > 0 ? Math.max(...gradients.map((g) => g.confidence)) : 0;
|
|
946
|
-
const result = {
|
|
947
|
-
hasGradient: gradients.length > 0,
|
|
948
|
-
gradients,
|
|
949
|
-
confidence: overallConfidence,
|
|
950
|
-
processingTimeMs,
|
|
951
|
-
};
|
|
952
|
-
if (dominantGradientType) {
|
|
953
|
-
result.dominantGradientType = dominantGradientType;
|
|
954
|
-
}
|
|
955
|
-
return result;
|
|
956
|
-
}
|
|
957
|
-
// =============================================================================
|
|
958
|
-
// CSS String Generation (v0.1.0)
|
|
959
|
-
// =============================================================================
|
|
960
|
-
/**
|
|
961
|
-
* Generate CSS gradient string from DetectedGradient
|
|
962
|
-
*/
|
|
963
|
-
function generateCSSString(gradient) {
|
|
964
|
-
const colorStopsStr = gradient.colorStops
|
|
965
|
-
.map((stop) => `${stop.color} ${Math.round(stop.position * 100)}%`)
|
|
966
|
-
.join(", ");
|
|
967
|
-
switch (gradient.type) {
|
|
968
|
-
case "linear": {
|
|
969
|
-
const angle = gradient.direction ?? 0;
|
|
970
|
-
return `linear-gradient(${angle}deg, ${colorStopsStr})`;
|
|
971
|
-
}
|
|
972
|
-
case "radial": {
|
|
973
|
-
const cx = gradient.centerX ?? 0.5;
|
|
974
|
-
const cy = gradient.centerY ?? 0.5;
|
|
975
|
-
return `radial-gradient(circle at ${Math.round(cx * 100)}% ${Math.round(cy * 100)}%, ${colorStopsStr})`;
|
|
976
|
-
}
|
|
977
|
-
case "conic": {
|
|
978
|
-
const cx = gradient.centerX ?? 0.5;
|
|
979
|
-
const cy = gradient.centerY ?? 0.5;
|
|
980
|
-
return `conic-gradient(from 0deg at ${Math.round(cx * 100)}% ${Math.round(cy * 100)}%, ${colorStopsStr})`;
|
|
981
|
-
}
|
|
982
|
-
default:
|
|
983
|
-
return `linear-gradient(${colorStopsStr})`;
|
|
984
|
-
}
|
|
985
|
-
}
|
|
986
|
-
/**
|
|
987
|
-
* Internal implementation of GradientDetectorService
|
|
988
|
-
*/
|
|
989
|
-
class GradientDetectorServiceImpl {
|
|
990
|
-
config;
|
|
991
|
-
constructor(config = {}) {
|
|
992
|
-
this.config = { ...DEFAULT_CONFIG, ...config };
|
|
993
|
-
}
|
|
994
|
-
async detectGradient(image) {
|
|
995
|
-
const startTime = performance.now();
|
|
996
|
-
// Parse and validate input with size check (5MB max) - SEC H-1
|
|
997
|
-
const imageBuffer = (0, image_utils_1.parseAndValidateImageInput)(image);
|
|
998
|
-
(0, image_utils_1.logSecurityEvent)("GradientDetector", "Processing image", {
|
|
999
|
-
size: imageBuffer.length,
|
|
1000
|
-
sizeKB: Math.round(imageBuffer.length / 1024),
|
|
1001
|
-
});
|
|
1002
|
-
// Wrap processing with timeout (30s default) - SEC M-1
|
|
1003
|
-
const result = await (0, image_utils_1.withTimeout)(this.detectGradientInternal(imageBuffer, startTime), image_utils_1.DEFAULT_PROCESSING_TIMEOUT);
|
|
1004
|
-
return result;
|
|
1005
|
-
}
|
|
1006
|
-
/**
|
|
1007
|
-
* Detect gradients from CSS text (v0.1.0)
|
|
1008
|
-
*/
|
|
1009
|
-
detectGradientFromCSS(css) {
|
|
1010
|
-
const startTime = performance.now();
|
|
1011
|
-
// Handle null/undefined
|
|
1012
|
-
if (!css || typeof css !== "string") {
|
|
1013
|
-
return {
|
|
1014
|
-
hasGradient: false,
|
|
1015
|
-
gradients: [],
|
|
1016
|
-
confidence: 0,
|
|
1017
|
-
processingTimeMs: performance.now() - startTime,
|
|
1018
|
-
};
|
|
1019
|
-
}
|
|
1020
|
-
logger_1.logger.debug("[GradientDetector] Parsing CSS for gradients:", {
|
|
1021
|
-
cssLength: css.length,
|
|
1022
|
-
});
|
|
1023
|
-
const gradients = [];
|
|
1024
|
-
try {
|
|
1025
|
-
const rules = parseCSSRules(css);
|
|
1026
|
-
for (const rule of rules) {
|
|
1027
|
-
// Check background and background-image properties
|
|
1028
|
-
const bgProps = ["background", "background-image"];
|
|
1029
|
-
for (const prop of bgProps) {
|
|
1030
|
-
const value = rule.declarations.get(prop);
|
|
1031
|
-
if (!value)
|
|
1032
|
-
continue;
|
|
1033
|
-
// Extract gradient matches from the value
|
|
1034
|
-
const gradientMatches = extractGradientMatches(value);
|
|
1035
|
-
for (const match of gradientMatches) {
|
|
1036
|
-
// Extract gradient arguments (inside parentheses)
|
|
1037
|
-
const argsMatch = match.fullMatch.match(/\(([^()]*(?:\([^()]*\)[^()]*)*)\)/);
|
|
1038
|
-
const gradientArgs = argsMatch?.[1] ?? "";
|
|
1039
|
-
// Parse color stops
|
|
1040
|
-
const colorStops = parseColorStopsFromCSS(gradientArgs);
|
|
1041
|
-
// Create detected gradient
|
|
1042
|
-
const detectedGradient = {
|
|
1043
|
-
type: match.type,
|
|
1044
|
-
colorStops,
|
|
1045
|
-
region: { x: 0, y: 0, width: 0, height: 0 }, // Region not applicable for CSS
|
|
1046
|
-
confidence: 1.0, // High confidence for CSS parsing
|
|
1047
|
-
cssString: match.isRepeating ? match.fullMatch : match.fullMatch,
|
|
1048
|
-
parentElement: rule.selector,
|
|
1049
|
-
};
|
|
1050
|
-
// Parse type-specific properties
|
|
1051
|
-
if (match.type === "linear") {
|
|
1052
|
-
const direction = parseLinearDirection(gradientArgs);
|
|
1053
|
-
if (direction !== undefined) {
|
|
1054
|
-
detectedGradient.direction = direction;
|
|
1055
|
-
}
|
|
1056
|
-
}
|
|
1057
|
-
else if (match.type === "radial" || match.type === "conic") {
|
|
1058
|
-
const center = parseGradientCenter(gradientArgs);
|
|
1059
|
-
if (center.centerX !== undefined) {
|
|
1060
|
-
detectedGradient.centerX = center.centerX;
|
|
1061
|
-
}
|
|
1062
|
-
if (center.centerY !== undefined) {
|
|
1063
|
-
detectedGradient.centerY = center.centerY;
|
|
1064
|
-
}
|
|
1065
|
-
}
|
|
1066
|
-
// Parse animation info
|
|
1067
|
-
const animation = parseAnimationInfo(rule.declarations);
|
|
1068
|
-
if (animation) {
|
|
1069
|
-
detectedGradient.animation = animation;
|
|
1070
|
-
}
|
|
1071
|
-
// Parse transition info
|
|
1072
|
-
const transition = parseTransitionInfo(rule.declarations);
|
|
1073
|
-
if (transition) {
|
|
1074
|
-
detectedGradient.transition = transition;
|
|
1075
|
-
}
|
|
1076
|
-
gradients.push(detectedGradient);
|
|
1077
|
-
}
|
|
1078
|
-
}
|
|
1079
|
-
}
|
|
1080
|
-
}
|
|
1081
|
-
catch (error) {
|
|
1082
|
-
if (process.env.NODE_ENV === "development") {
|
|
1083
|
-
console.error("[GradientDetector] Error parsing CSS:", error);
|
|
1084
|
-
}
|
|
1085
|
-
}
|
|
1086
|
-
const processingTimeMs = performance.now() - startTime;
|
|
1087
|
-
// Determine dominant gradient type
|
|
1088
|
-
let dominantGradientType;
|
|
1089
|
-
if (gradients.length > 0) {
|
|
1090
|
-
dominantGradientType = gradients[0]?.type;
|
|
1091
|
-
}
|
|
1092
|
-
const result = {
|
|
1093
|
-
hasGradient: gradients.length > 0,
|
|
1094
|
-
gradients,
|
|
1095
|
-
confidence: gradients.length > 0 ? 1.0 : 0,
|
|
1096
|
-
processingTimeMs,
|
|
1097
|
-
};
|
|
1098
|
-
if (dominantGradientType) {
|
|
1099
|
-
result.dominantGradientType = dominantGradientType;
|
|
1100
|
-
}
|
|
1101
|
-
logger_1.logger.debug("[GradientDetector] CSS detection result:", {
|
|
1102
|
-
hasGradient: result.hasGradient,
|
|
1103
|
-
gradientCount: result.gradients.length,
|
|
1104
|
-
dominantType: result.dominantGradientType,
|
|
1105
|
-
processingTimeMs: processingTimeMs.toFixed(0),
|
|
1106
|
-
});
|
|
1107
|
-
return result;
|
|
1108
|
-
}
|
|
1109
|
-
async detectGradientInternal(imageBuffer, startTime) {
|
|
1110
|
-
try {
|
|
1111
|
-
const processedImage = (0, sharp_1.default)(imageBuffer);
|
|
1112
|
-
const metadata = await processedImage.metadata();
|
|
1113
|
-
if (!metadata.width || !metadata.height) {
|
|
1114
|
-
throw new Error("Invalid image: unable to read dimensions");
|
|
1115
|
-
}
|
|
1116
|
-
// Resize for performance while maintaining aspect ratio
|
|
1117
|
-
const resizeOptions = {
|
|
1118
|
-
width: Math.min(metadata.width, this.config.maxProcessingWidth),
|
|
1119
|
-
height: Math.min(metadata.height, this.config.maxProcessingHeight),
|
|
1120
|
-
fit: "inside",
|
|
1121
|
-
withoutEnlargement: true,
|
|
1122
|
-
};
|
|
1123
|
-
// Get raw RGB pixel data (flatten handles transparency)
|
|
1124
|
-
const { data, info } = await processedImage
|
|
1125
|
-
.resize(resizeOptions)
|
|
1126
|
-
.flatten({ background: { r: 255, g: 255, b: 255 } })
|
|
1127
|
-
.raw()
|
|
1128
|
-
.toBuffer({ resolveWithObject: true });
|
|
1129
|
-
const { width, height, channels } = info;
|
|
1130
|
-
// First check if image is solid color
|
|
1131
|
-
if (isSolidColor(data, width, height, channels, this.config.sampleStep)) {
|
|
1132
|
-
return {
|
|
1133
|
-
hasGradient: false,
|
|
1134
|
-
gradients: [],
|
|
1135
|
-
confidence: 1,
|
|
1136
|
-
processingTimeMs: performance.now() - startTime,
|
|
1137
|
-
};
|
|
1138
|
-
}
|
|
1139
|
-
// Detect all gradient types
|
|
1140
|
-
const gradients = detectAllGradientTypes(data, width, height, channels, this.config);
|
|
1141
|
-
// Add cssString to each gradient (v0.1.0)
|
|
1142
|
-
for (const gradient of gradients) {
|
|
1143
|
-
gradient.cssString = generateCSSString(gradient);
|
|
1144
|
-
}
|
|
1145
|
-
// Sort by type specificity and confidence
|
|
1146
|
-
sortGradientsByPriority(gradients);
|
|
1147
|
-
// Build and return the result
|
|
1148
|
-
const processingTimeMs = performance.now() - startTime;
|
|
1149
|
-
const result = buildGradientResult(gradients, processingTimeMs);
|
|
1150
|
-
logger_1.logger.debug("[GradientDetector] Detection result:", {
|
|
1151
|
-
hasGradient: result.hasGradient,
|
|
1152
|
-
gradientCount: result.gradients.length,
|
|
1153
|
-
dominantType: result.dominantGradientType,
|
|
1154
|
-
confidence: result.confidence.toFixed(2),
|
|
1155
|
-
processingTimeMs: processingTimeMs.toFixed(0),
|
|
1156
|
-
});
|
|
1157
|
-
return result;
|
|
1158
|
-
}
|
|
1159
|
-
catch (error) {
|
|
1160
|
-
throw (0, image_utils_1.wrapSharpError)(error);
|
|
1161
|
-
}
|
|
1162
|
-
}
|
|
1163
|
-
}
|
|
1164
|
-
/**
|
|
1165
|
-
* Create a new GradientDetectorService instance
|
|
1166
|
-
* @param config - Optional configuration options
|
|
1167
|
-
* @returns GradientDetectorService instance
|
|
1168
|
-
*/
|
|
1169
|
-
function createGradientDetectorService(config) {
|
|
1170
|
-
return new GradientDetectorServiceImpl(config);
|
|
1171
|
-
}
|
|
1172
|
-
//# sourceMappingURL=gradient-detector.service.js.map
|