@reftrixmcp/mcp-server 0.1.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (1614) hide show
  1. package/LICENSE +661 -0
  2. package/README.md +1099 -0
  3. package/dist/api/health.d.ts +122 -0
  4. package/dist/api/health.d.ts.map +1 -0
  5. package/dist/api/health.js +267 -0
  6. package/dist/api/health.js.map +1 -0
  7. package/dist/config/index.d.ts +9 -0
  8. package/dist/config/index.d.ts.map +1 -0
  9. package/dist/config/index.js +27 -0
  10. package/dist/config/index.js.map +1 -0
  11. package/dist/config/redis.d.ts +99 -0
  12. package/dist/config/redis.d.ts.map +1 -0
  13. package/dist/config/redis.js +234 -0
  14. package/dist/config/redis.js.map +1 -0
  15. package/dist/index.d.ts +18 -0
  16. package/dist/index.d.ts.map +1 -0
  17. package/dist/index.js +247 -0
  18. package/dist/index.js.map +1 -0
  19. package/dist/lib/index.d.ts +6 -0
  20. package/dist/lib/index.d.ts.map +1 -0
  21. package/dist/lib/index.js +14 -0
  22. package/dist/lib/index.js.map +1 -0
  23. package/dist/lib/project-context.d.ts +51 -0
  24. package/dist/lib/project-context.d.ts.map +1 -0
  25. package/dist/lib/project-context.js +109 -0
  26. package/dist/lib/project-context.js.map +1 -0
  27. package/dist/middleware/args-type-coercion.d.ts +59 -0
  28. package/dist/middleware/args-type-coercion.d.ts.map +1 -0
  29. package/dist/middleware/args-type-coercion.js +187 -0
  30. package/dist/middleware/args-type-coercion.js.map +1 -0
  31. package/dist/middleware/auth.d.ts +122 -0
  32. package/dist/middleware/auth.d.ts.map +1 -0
  33. package/dist/middleware/auth.js +430 -0
  34. package/dist/middleware/auth.js.map +1 -0
  35. package/dist/middleware/index.d.ts +10 -0
  36. package/dist/middleware/index.d.ts.map +1 -0
  37. package/dist/middleware/index.js +38 -0
  38. package/dist/middleware/index.js.map +1 -0
  39. package/dist/middleware/light-response-controller.d.ts +206 -0
  40. package/dist/middleware/light-response-controller.d.ts.map +1 -0
  41. package/dist/middleware/light-response-controller.js +555 -0
  42. package/dist/middleware/light-response-controller.js.map +1 -0
  43. package/dist/middleware/response-size-warning.d.ts +97 -0
  44. package/dist/middleware/response-size-warning.d.ts.map +1 -0
  45. package/dist/middleware/response-size-warning.js +137 -0
  46. package/dist/middleware/response-size-warning.js.map +1 -0
  47. package/dist/queues/batch-quality-queue.d.ts +225 -0
  48. package/dist/queues/batch-quality-queue.d.ts.map +1 -0
  49. package/dist/queues/batch-quality-queue.js +375 -0
  50. package/dist/queues/batch-quality-queue.js.map +1 -0
  51. package/dist/queues/index.d.ts +10 -0
  52. package/dist/queues/index.d.ts.map +1 -0
  53. package/dist/queues/index.js +28 -0
  54. package/dist/queues/index.js.map +1 -0
  55. package/dist/queues/page-analyze-queue.d.ts +287 -0
  56. package/dist/queues/page-analyze-queue.d.ts.map +1 -0
  57. package/dist/queues/page-analyze-queue.js +219 -0
  58. package/dist/queues/page-analyze-queue.js.map +1 -0
  59. package/dist/router.d.ts +144 -0
  60. package/dist/router.d.ts.map +1 -0
  61. package/dist/router.js +261 -0
  62. package/dist/router.js.map +1 -0
  63. package/dist/schemas/creative/index.d.ts +8 -0
  64. package/dist/schemas/creative/index.d.ts.map +1 -0
  65. package/dist/schemas/creative/index.js +23 -0
  66. package/dist/schemas/creative/index.js.map +1 -0
  67. package/dist/schemas/creative/palette.schema.d.ts +741 -0
  68. package/dist/schemas/creative/palette.schema.d.ts.map +1 -0
  69. package/dist/schemas/creative/palette.schema.js +154 -0
  70. package/dist/schemas/creative/palette.schema.js.map +1 -0
  71. package/dist/schemas/mood-brandtone-filters.d.ts +740 -0
  72. package/dist/schemas/mood-brandtone-filters.d.ts.map +1 -0
  73. package/dist/schemas/mood-brandtone-filters.js +265 -0
  74. package/dist/schemas/mood-brandtone-filters.js.map +1 -0
  75. package/dist/scripts/backfill-embeddings.d.ts +3 -0
  76. package/dist/scripts/backfill-embeddings.d.ts.map +1 -0
  77. package/dist/scripts/backfill-embeddings.js +385 -0
  78. package/dist/scripts/backfill-embeddings.js.map +1 -0
  79. package/dist/scripts/check-embedding-coverage.d.ts +3 -0
  80. package/dist/scripts/check-embedding-coverage.d.ts.map +1 -0
  81. package/dist/scripts/check-embedding-coverage.js +103 -0
  82. package/dist/scripts/check-embedding-coverage.js.map +1 -0
  83. package/dist/scripts/start-workers.d.ts +3 -0
  84. package/dist/scripts/start-workers.d.ts.map +1 -0
  85. package/dist/scripts/start-workers.js +447 -0
  86. package/dist/scripts/start-workers.js.map +1 -0
  87. package/dist/server.d.ts +49 -0
  88. package/dist/server.d.ts.map +1 -0
  89. package/dist/server.js +237 -0
  90. package/dist/server.js.map +1 -0
  91. package/dist/services/background/background-design-db.service.d.ts +65 -0
  92. package/dist/services/background/background-design-db.service.d.ts.map +1 -0
  93. package/dist/services/background/background-design-db.service.js +138 -0
  94. package/dist/services/background/background-design-db.service.js.map +1 -0
  95. package/dist/services/background/background-design-detector.service.d.ts +125 -0
  96. package/dist/services/background/background-design-detector.service.d.ts.map +1 -0
  97. package/dist/services/background/background-design-detector.service.js +1106 -0
  98. package/dist/services/background/background-design-detector.service.js.map +1 -0
  99. package/dist/services/background/background-design-embedding.service.d.ts +188 -0
  100. package/dist/services/background/background-design-embedding.service.d.ts.map +1 -0
  101. package/dist/services/background/background-design-embedding.service.js +386 -0
  102. package/dist/services/background/background-design-embedding.service.js.map +1 -0
  103. package/dist/services/background-search.service.d.ts +43 -0
  104. package/dist/services/background-search.service.d.ts.map +1 -0
  105. package/dist/services/background-search.service.js +235 -0
  106. package/dist/services/background-search.service.js.map +1 -0
  107. package/dist/services/backup-service.d.ts +135 -0
  108. package/dist/services/backup-service.d.ts.map +1 -0
  109. package/dist/services/backup-service.js +357 -0
  110. package/dist/services/backup-service.js.map +1 -0
  111. package/dist/services/brief/brief-parser-service.d.ts +47 -0
  112. package/dist/services/brief/brief-parser-service.d.ts.map +1 -0
  113. package/dist/services/brief/brief-parser-service.js +380 -0
  114. package/dist/services/brief/brief-parser-service.js.map +1 -0
  115. package/dist/services/brief/schemas/brief-parser-schemas.d.ts +278 -0
  116. package/dist/services/brief/schemas/brief-parser-schemas.d.ts.map +1 -0
  117. package/dist/services/brief/schemas/brief-parser-schemas.js +116 -0
  118. package/dist/services/brief/schemas/brief-parser-schemas.js.map +1 -0
  119. package/dist/services/browser-process-manager.d.ts +116 -0
  120. package/dist/services/browser-process-manager.d.ts.map +1 -0
  121. package/dist/services/browser-process-manager.js +259 -0
  122. package/dist/services/browser-process-manager.js.map +1 -0
  123. package/dist/services/cache.d.ts +119 -0
  124. package/dist/services/cache.d.ts.map +1 -0
  125. package/dist/services/cache.js +233 -0
  126. package/dist/services/cache.js.map +1 -0
  127. package/dist/services/checksum-service.d.ts +122 -0
  128. package/dist/services/checksum-service.d.ts.map +1 -0
  129. package/dist/services/checksum-service.js +270 -0
  130. package/dist/services/checksum-service.js.map +1 -0
  131. package/dist/services/css-analysis-cache.service.d.ts +248 -0
  132. package/dist/services/css-analysis-cache.service.d.ts.map +1 -0
  133. package/dist/services/css-analysis-cache.service.js +398 -0
  134. package/dist/services/css-analysis-cache.service.js.map +1 -0
  135. package/dist/services/database-dumper.service.d.ts +181 -0
  136. package/dist/services/database-dumper.service.d.ts.map +1 -0
  137. package/dist/services/database-dumper.service.js +550 -0
  138. package/dist/services/database-dumper.service.js.map +1 -0
  139. package/dist/services/embedding-backfill.service.d.ts +53 -0
  140. package/dist/services/embedding-backfill.service.d.ts.map +1 -0
  141. package/dist/services/embedding-backfill.service.js +672 -0
  142. package/dist/services/embedding-backfill.service.js.map +1 -0
  143. package/dist/services/embedding-validation.service.d.ts +64 -0
  144. package/dist/services/embedding-validation.service.d.ts.map +1 -0
  145. package/dist/services/embedding-validation.service.js +141 -0
  146. package/dist/services/embedding-validation.service.js.map +1 -0
  147. package/dist/services/encryption-service.d.ts +171 -0
  148. package/dist/services/encryption-service.d.ts.map +1 -0
  149. package/dist/services/encryption-service.js +343 -0
  150. package/dist/services/encryption-service.js.map +1 -0
  151. package/dist/services/external-css-fetcher.d.ts +185 -0
  152. package/dist/services/external-css-fetcher.d.ts.map +1 -0
  153. package/dist/services/external-css-fetcher.js +667 -0
  154. package/dist/services/external-css-fetcher.js.map +1 -0
  155. package/dist/services/gpu-resource-manager.d.ts +180 -0
  156. package/dist/services/gpu-resource-manager.d.ts.map +1 -0
  157. package/dist/services/gpu-resource-manager.js +485 -0
  158. package/dist/services/gpu-resource-manager.js.map +1 -0
  159. package/dist/services/index.d.ts +15 -0
  160. package/dist/services/index.d.ts.map +1 -0
  161. package/dist/services/index.js +73 -0
  162. package/dist/services/index.js.map +1 -0
  163. package/dist/services/layout/component-splitter.d.ts +63 -0
  164. package/dist/services/layout/component-splitter.d.ts.map +1 -0
  165. package/dist/services/layout/component-splitter.js +508 -0
  166. package/dist/services/layout/component-splitter.js.map +1 -0
  167. package/dist/services/layout/html-to-jsx-converter.d.ts +40 -0
  168. package/dist/services/layout/html-to-jsx-converter.d.ts.map +1 -0
  169. package/dist/services/layout/html-to-jsx-converter.js +484 -0
  170. package/dist/services/layout/html-to-jsx-converter.js.map +1 -0
  171. package/dist/services/layout/semantic-html-converter.d.ts +67 -0
  172. package/dist/services/layout/semantic-html-converter.d.ts.map +1 -0
  173. package/dist/services/layout/semantic-html-converter.js +247 -0
  174. package/dist/services/layout/semantic-html-converter.js.map +1 -0
  175. package/dist/services/layout/style-to-tailwind-mapper.d.ts +82 -0
  176. package/dist/services/layout/style-to-tailwind-mapper.d.ts.map +1 -0
  177. package/dist/services/layout/style-to-tailwind-mapper.js +1334 -0
  178. package/dist/services/layout/style-to-tailwind-mapper.js.map +1 -0
  179. package/dist/services/layout-embedding.service.d.ts +415 -0
  180. package/dist/services/layout-embedding.service.d.ts.map +1 -0
  181. package/dist/services/layout-embedding.service.js +1147 -0
  182. package/dist/services/layout-embedding.service.js.map +1 -0
  183. package/dist/services/layout-generate-code-service-export.d.ts +38 -0
  184. package/dist/services/layout-generate-code-service-export.d.ts.map +1 -0
  185. package/dist/services/layout-generate-code-service-export.js +77 -0
  186. package/dist/services/layout-generate-code-service-export.js.map +1 -0
  187. package/dist/services/layout-search-service-export.d.ts +31 -0
  188. package/dist/services/layout-search-service-export.d.ts.map +1 -0
  189. package/dist/services/layout-search-service-export.js +43 -0
  190. package/dist/services/layout-search-service-export.js.map +1 -0
  191. package/dist/services/layout-search.service.d.ts +111 -0
  192. package/dist/services/layout-search.service.d.ts.map +1 -0
  193. package/dist/services/layout-search.service.js +716 -0
  194. package/dist/services/layout-search.service.js.map +1 -0
  195. package/dist/services/layout-to-code.service.d.ts +85 -0
  196. package/dist/services/layout-to-code.service.d.ts.map +1 -0
  197. package/dist/services/layout-to-code.service.js +1368 -0
  198. package/dist/services/layout-to-code.service.js.map +1 -0
  199. package/dist/services/metrics-collector.d.ts +189 -0
  200. package/dist/services/metrics-collector.d.ts.map +1 -0
  201. package/dist/services/metrics-collector.js +344 -0
  202. package/dist/services/metrics-collector.js.map +1 -0
  203. package/dist/services/ml/mood-brandtone-embedding.service.d.ts +253 -0
  204. package/dist/services/ml/mood-brandtone-embedding.service.d.ts.map +1 -0
  205. package/dist/services/ml/mood-brandtone-embedding.service.js +678 -0
  206. package/dist/services/ml/mood-brandtone-embedding.service.js.map +1 -0
  207. package/dist/services/motion/analyzers/color-change.analyzer.d.ts +274 -0
  208. package/dist/services/motion/analyzers/color-change.analyzer.d.ts.map +1 -0
  209. package/dist/services/motion/analyzers/color-change.analyzer.js +644 -0
  210. package/dist/services/motion/analyzers/color-change.analyzer.js.map +1 -0
  211. package/dist/services/motion/analyzers/frame-diff.analyzer.d.ts +109 -0
  212. package/dist/services/motion/analyzers/frame-diff.analyzer.d.ts.map +1 -0
  213. package/dist/services/motion/analyzers/frame-diff.analyzer.js +315 -0
  214. package/dist/services/motion/analyzers/frame-diff.analyzer.js.map +1 -0
  215. package/dist/services/motion/analyzers/layout-shift.detector.d.ts +132 -0
  216. package/dist/services/motion/analyzers/layout-shift.detector.d.ts.map +1 -0
  217. package/dist/services/motion/analyzers/layout-shift.detector.js +179 -0
  218. package/dist/services/motion/analyzers/layout-shift.detector.js.map +1 -0
  219. package/dist/services/motion/analyzers/motion-vector.estimator.d.ts +88 -0
  220. package/dist/services/motion/analyzers/motion-vector.estimator.d.ts.map +1 -0
  221. package/dist/services/motion/analyzers/motion-vector.estimator.js +494 -0
  222. package/dist/services/motion/analyzers/motion-vector.estimator.js.map +1 -0
  223. package/dist/services/motion/analyzers/webgl-motion-analyzer.d.ts +167 -0
  224. package/dist/services/motion/analyzers/webgl-motion-analyzer.d.ts.map +1 -0
  225. package/dist/services/motion/analyzers/webgl-motion-analyzer.js +500 -0
  226. package/dist/services/motion/analyzers/webgl-motion-analyzer.js.map +1 -0
  227. package/dist/services/motion/animation-metrics-collector.service.d.ts +215 -0
  228. package/dist/services/motion/animation-metrics-collector.service.d.ts.map +1 -0
  229. package/dist/services/motion/animation-metrics-collector.service.js +502 -0
  230. package/dist/services/motion/animation-metrics-collector.service.js.map +1 -0
  231. package/dist/services/motion/cls-calculator.service.d.ts +186 -0
  232. package/dist/services/motion/cls-calculator.service.d.ts.map +1 -0
  233. package/dist/services/motion/cls-calculator.service.js +329 -0
  234. package/dist/services/motion/cls-calculator.service.js.map +1 -0
  235. package/dist/services/motion/existing-animation-detector.service.d.ts +208 -0
  236. package/dist/services/motion/existing-animation-detector.service.d.ts.map +1 -0
  237. package/dist/services/motion/existing-animation-detector.service.js +591 -0
  238. package/dist/services/motion/existing-animation-detector.service.js.map +1 -0
  239. package/dist/services/motion/fade-detector.service.d.ts +114 -0
  240. package/dist/services/motion/fade-detector.service.d.ts.map +1 -0
  241. package/dist/services/motion/fade-detector.service.js +249 -0
  242. package/dist/services/motion/fade-detector.service.js.map +1 -0
  243. package/dist/services/motion/frame-analysis-save.helper.d.ts +41 -0
  244. package/dist/services/motion/frame-analysis-save.helper.d.ts.map +1 -0
  245. package/dist/services/motion/frame-analysis-save.helper.js +235 -0
  246. package/dist/services/motion/frame-analysis-save.helper.js.map +1 -0
  247. package/dist/services/motion/frame-capture.service.d.ts +170 -0
  248. package/dist/services/motion/frame-capture.service.d.ts.map +1 -0
  249. package/dist/services/motion/frame-capture.service.js +476 -0
  250. package/dist/services/motion/frame-capture.service.js.map +1 -0
  251. package/dist/services/motion/frame-embedding.service.d.ts +315 -0
  252. package/dist/services/motion/frame-embedding.service.d.ts.map +1 -0
  253. package/dist/services/motion/frame-embedding.service.js +1023 -0
  254. package/dist/services/motion/frame-embedding.service.js.map +1 -0
  255. package/dist/services/motion/frame-image-analysis.service.d.ts +126 -0
  256. package/dist/services/motion/frame-image-analysis.service.d.ts.map +1 -0
  257. package/dist/services/motion/frame-image-analysis.service.js +982 -0
  258. package/dist/services/motion/frame-image-analysis.service.js.map +1 -0
  259. package/dist/services/motion/frame-image-analyzer.adapter.d.ts +168 -0
  260. package/dist/services/motion/frame-image-analyzer.adapter.d.ts.map +1 -0
  261. package/dist/services/motion/frame-image-analyzer.adapter.js +520 -0
  262. package/dist/services/motion/frame-image-analyzer.adapter.js.map +1 -0
  263. package/dist/services/motion/frame-worker-pool.service.d.ts +133 -0
  264. package/dist/services/motion/frame-worker-pool.service.d.ts.map +1 -0
  265. package/dist/services/motion/frame-worker-pool.service.js +410 -0
  266. package/dist/services/motion/frame-worker-pool.service.js.map +1 -0
  267. package/dist/services/motion/infrastructure/frame-loader.d.ts +77 -0
  268. package/dist/services/motion/infrastructure/frame-loader.d.ts.map +1 -0
  269. package/dist/services/motion/infrastructure/frame-loader.js +430 -0
  270. package/dist/services/motion/infrastructure/frame-loader.js.map +1 -0
  271. package/dist/services/motion/js-animation-detector.d.ts +382 -0
  272. package/dist/services/motion/js-animation-detector.d.ts.map +1 -0
  273. package/dist/services/motion/js-animation-detector.js +911 -0
  274. package/dist/services/motion/js-animation-detector.js.map +1 -0
  275. package/dist/services/motion/js-animation-embedding.service.d.ts +114 -0
  276. package/dist/services/motion/js-animation-embedding.service.d.ts.map +1 -0
  277. package/dist/services/motion/js-animation-embedding.service.js +289 -0
  278. package/dist/services/motion/js-animation-embedding.service.js.map +1 -0
  279. package/dist/services/motion/js-animation-search.service.d.ts +138 -0
  280. package/dist/services/motion/js-animation-search.service.d.ts.map +1 -0
  281. package/dist/services/motion/js-animation-search.service.js +503 -0
  282. package/dist/services/motion/js-animation-search.service.js.map +1 -0
  283. package/dist/services/motion/motion-db.service.d.ts +231 -0
  284. package/dist/services/motion/motion-db.service.d.ts.map +1 -0
  285. package/dist/services/motion/motion-db.service.js +676 -0
  286. package/dist/services/motion/motion-db.service.js.map +1 -0
  287. package/dist/services/motion/three-js-scene-extractor.d.ts +274 -0
  288. package/dist/services/motion/three-js-scene-extractor.d.ts.map +1 -0
  289. package/dist/services/motion/three-js-scene-extractor.js +1126 -0
  290. package/dist/services/motion/three-js-scene-extractor.js.map +1 -0
  291. package/dist/services/motion/types.d.ts +592 -0
  292. package/dist/services/motion/types.d.ts.map +1 -0
  293. package/dist/services/motion/types.js +121 -0
  294. package/dist/services/motion/types.js.map +1 -0
  295. package/dist/services/motion/visual-category-classifier.d.ts +273 -0
  296. package/dist/services/motion/visual-category-classifier.d.ts.map +1 -0
  297. package/dist/services/motion/visual-category-classifier.js +1060 -0
  298. package/dist/services/motion/visual-category-classifier.js.map +1 -0
  299. package/dist/services/motion/webgl-animation-categorizer.d.ts +151 -0
  300. package/dist/services/motion/webgl-animation-categorizer.d.ts.map +1 -0
  301. package/dist/services/motion/webgl-animation-categorizer.js +568 -0
  302. package/dist/services/motion/webgl-animation-categorizer.js.map +1 -0
  303. package/dist/services/motion/webgl-animation-detector.service.d.ts +204 -0
  304. package/dist/services/motion/webgl-animation-detector.service.d.ts.map +1 -0
  305. package/dist/services/motion/webgl-animation-detector.service.js +518 -0
  306. package/dist/services/motion/webgl-animation-detector.service.js.map +1 -0
  307. package/dist/services/motion/webgl-animation-embedding.service.d.ts +238 -0
  308. package/dist/services/motion/webgl-animation-embedding.service.d.ts.map +1 -0
  309. package/dist/services/motion/webgl-animation-embedding.service.js +368 -0
  310. package/dist/services/motion/webgl-animation-embedding.service.js.map +1 -0
  311. package/dist/services/motion-detect-service-export.d.ts +130 -0
  312. package/dist/services/motion-detect-service-export.d.ts.map +1 -0
  313. package/dist/services/motion-detect-service-export.js +160 -0
  314. package/dist/services/motion-detect-service-export.js.map +1 -0
  315. package/dist/services/motion-persistence.service.d.ts +144 -0
  316. package/dist/services/motion-persistence.service.d.ts.map +1 -0
  317. package/dist/services/motion-persistence.service.js +398 -0
  318. package/dist/services/motion-persistence.service.js.map +1 -0
  319. package/dist/services/motion-search-service.d.ts +10 -0
  320. package/dist/services/motion-search-service.d.ts.map +1 -0
  321. package/dist/services/motion-search-service.js +22 -0
  322. package/dist/services/motion-search-service.js.map +1 -0
  323. package/dist/services/motion-search.service.d.ts +210 -0
  324. package/dist/services/motion-search.service.d.ts.map +1 -0
  325. package/dist/services/motion-search.service.js +900 -0
  326. package/dist/services/motion-search.service.js.map +1 -0
  327. package/dist/services/narrative/analyzers/layout-structure.analyzer.d.ts +75 -0
  328. package/dist/services/narrative/analyzers/layout-structure.analyzer.d.ts.map +1 -0
  329. package/dist/services/narrative/analyzers/layout-structure.analyzer.js +489 -0
  330. package/dist/services/narrative/analyzers/layout-structure.analyzer.js.map +1 -0
  331. package/dist/services/narrative/analyzers/worldview.analyzer.d.ts +92 -0
  332. package/dist/services/narrative/analyzers/worldview.analyzer.d.ts.map +1 -0
  333. package/dist/services/narrative/analyzers/worldview.analyzer.js +477 -0
  334. package/dist/services/narrative/analyzers/worldview.analyzer.js.map +1 -0
  335. package/dist/services/narrative/generators/confidence-calculator.d.ts +65 -0
  336. package/dist/services/narrative/generators/confidence-calculator.d.ts.map +1 -0
  337. package/dist/services/narrative/generators/confidence-calculator.js +316 -0
  338. package/dist/services/narrative/generators/confidence-calculator.js.map +1 -0
  339. package/dist/services/narrative/generators/text-representation.generator.d.ts +67 -0
  340. package/dist/services/narrative/generators/text-representation.generator.d.ts.map +1 -0
  341. package/dist/services/narrative/generators/text-representation.generator.js +312 -0
  342. package/dist/services/narrative/generators/text-representation.generator.js.map +1 -0
  343. package/dist/services/narrative/index.d.ts +16 -0
  344. package/dist/services/narrative/index.d.ts.map +1 -0
  345. package/dist/services/narrative/index.js +63 -0
  346. package/dist/services/narrative/index.js.map +1 -0
  347. package/dist/services/narrative/narrative-analysis.service.d.ts +120 -0
  348. package/dist/services/narrative/narrative-analysis.service.d.ts.map +1 -0
  349. package/dist/services/narrative/narrative-analysis.service.js +479 -0
  350. package/dist/services/narrative/narrative-analysis.service.js.map +1 -0
  351. package/dist/services/narrative/narrative-search.service.d.ts +126 -0
  352. package/dist/services/narrative/narrative-search.service.d.ts.map +1 -0
  353. package/dist/services/narrative/narrative-search.service.js +516 -0
  354. package/dist/services/narrative/narrative-search.service.js.map +1 -0
  355. package/dist/services/narrative/types/narrative.types.d.ts +372 -0
  356. package/dist/services/narrative/types/narrative.types.d.ts.map +1 -0
  357. package/dist/services/narrative/types/narrative.types.js +5 -0
  358. package/dist/services/narrative/types/narrative.types.js.map +1 -0
  359. package/dist/services/orphaned-job-utils.d.ts +62 -0
  360. package/dist/services/orphaned-job-utils.d.ts.map +1 -0
  361. package/dist/services/orphaned-job-utils.js +130 -0
  362. package/dist/services/orphaned-job-utils.js.map +1 -0
  363. package/dist/services/page/css-animation-parser.service.d.ts +173 -0
  364. package/dist/services/page/css-animation-parser.service.d.ts.map +1 -0
  365. package/dist/services/page/css-animation-parser.service.js +537 -0
  366. package/dist/services/page/css-animation-parser.service.js.map +1 -0
  367. package/dist/services/page/fallback-analyzer.service.d.ts +140 -0
  368. package/dist/services/page/fallback-analyzer.service.d.ts.map +1 -0
  369. package/dist/services/page/fallback-analyzer.service.js +289 -0
  370. package/dist/services/page/fallback-analyzer.service.js.map +1 -0
  371. package/dist/services/page/frame-analyzer.service.d.ts +208 -0
  372. package/dist/services/page/frame-analyzer.service.d.ts.map +1 -0
  373. package/dist/services/page/frame-analyzer.service.js +628 -0
  374. package/dist/services/page/frame-analyzer.service.js.map +1 -0
  375. package/dist/services/page/layout-analyzer.service.d.ts +323 -0
  376. package/dist/services/page/layout-analyzer.service.d.ts.map +1 -0
  377. package/dist/services/page/layout-analyzer.service.js +2001 -0
  378. package/dist/services/page/layout-analyzer.service.js.map +1 -0
  379. package/dist/services/page/motion-category-classifier.service.d.ts +72 -0
  380. package/dist/services/page/motion-category-classifier.service.d.ts.map +1 -0
  381. package/dist/services/page/motion-category-classifier.service.js +340 -0
  382. package/dist/services/page/motion-category-classifier.service.js.map +1 -0
  383. package/dist/services/page/motion-detector.service.d.ts +76 -0
  384. package/dist/services/page/motion-detector.service.d.ts.map +1 -0
  385. package/dist/services/page/motion-detector.service.js +255 -0
  386. package/dist/services/page/motion-detector.service.js.map +1 -0
  387. package/dist/services/page/motion-performance-analyzer.service.d.ts +114 -0
  388. package/dist/services/page/motion-performance-analyzer.service.d.ts.map +1 -0
  389. package/dist/services/page/motion-performance-analyzer.service.js +315 -0
  390. package/dist/services/page/motion-performance-analyzer.service.js.map +1 -0
  391. package/dist/services/page/playwright-crawler.service.d.ts +106 -0
  392. package/dist/services/page/playwright-crawler.service.d.ts.map +1 -0
  393. package/dist/services/page/playwright-crawler.service.js +373 -0
  394. package/dist/services/page/playwright-crawler.service.js.map +1 -0
  395. package/dist/services/page/quality-evaluator.service.d.ts +107 -0
  396. package/dist/services/page/quality-evaluator.service.d.ts.map +1 -0
  397. package/dist/services/page/quality-evaluator.service.js +1138 -0
  398. package/dist/services/page/quality-evaluator.service.js.map +1 -0
  399. package/dist/services/page/runtime-animation-detector.service.d.ts +154 -0
  400. package/dist/services/page/runtime-animation-detector.service.d.ts.map +1 -0
  401. package/dist/services/page/runtime-animation-detector.service.js +480 -0
  402. package/dist/services/page/runtime-animation-detector.service.js.map +1 -0
  403. package/dist/services/page/section-postprocessor.service.d.ts +55 -0
  404. package/dist/services/page/section-postprocessor.service.d.ts.map +1 -0
  405. package/dist/services/page/section-postprocessor.service.js +708 -0
  406. package/dist/services/page/section-postprocessor.service.js.map +1 -0
  407. package/dist/services/page/video-recorder.service.d.ts +110 -0
  408. package/dist/services/page/video-recorder.service.d.ts.map +1 -0
  409. package/dist/services/page/video-recorder.service.js +441 -0
  410. package/dist/services/page/video-recorder.service.js.map +1 -0
  411. package/dist/services/page/webgl-detector.service.d.ts +113 -0
  412. package/dist/services/page/webgl-detector.service.d.ts.map +1 -0
  413. package/dist/services/page/webgl-detector.service.js +280 -0
  414. package/dist/services/page/webgl-detector.service.js.map +1 -0
  415. package/dist/services/page-analyze-service.d.ts +30 -0
  416. package/dist/services/page-analyze-service.d.ts.map +1 -0
  417. package/dist/services/page-analyze-service.js +58 -0
  418. package/dist/services/page-analyze-service.js.map +1 -0
  419. package/dist/services/page-ingest-adapter.d.ts +479 -0
  420. package/dist/services/page-ingest-adapter.d.ts.map +1 -0
  421. package/dist/services/page-ingest-adapter.js +1726 -0
  422. package/dist/services/page-ingest-adapter.js.map +1 -0
  423. package/dist/services/palette-service-export.d.ts +26 -0
  424. package/dist/services/palette-service-export.d.ts.map +1 -0
  425. package/dist/services/palette-service-export.js +22 -0
  426. package/dist/services/palette-service-export.js.map +1 -0
  427. package/dist/services/part/index.d.ts +22 -0
  428. package/dist/services/part/index.d.ts.map +1 -0
  429. package/dist/services/part/index.js +72 -0
  430. package/dist/services/part/index.js.map +1 -0
  431. package/dist/services/part/part-backfill.service.d.ts +66 -0
  432. package/dist/services/part/part-backfill.service.d.ts.map +1 -0
  433. package/dist/services/part/part-backfill.service.js +195 -0
  434. package/dist/services/part/part-backfill.service.js.map +1 -0
  435. package/dist/services/part/part-bbox-playwright.service.d.ts +85 -0
  436. package/dist/services/part/part-bbox-playwright.service.d.ts.map +1 -0
  437. package/dist/services/part/part-bbox-playwright.service.js +362 -0
  438. package/dist/services/part/part-bbox-playwright.service.js.map +1 -0
  439. package/dist/services/part/part-db.service.d.ts +41 -0
  440. package/dist/services/part/part-db.service.d.ts.map +1 -0
  441. package/dist/services/part/part-db.service.js +82 -0
  442. package/dist/services/part/part-db.service.js.map +1 -0
  443. package/dist/services/part/part-embedding-db.service.d.ts +52 -0
  444. package/dist/services/part/part-embedding-db.service.d.ts.map +1 -0
  445. package/dist/services/part/part-embedding-db.service.js +122 -0
  446. package/dist/services/part/part-embedding-db.service.js.map +1 -0
  447. package/dist/services/part/part-embedding.service.d.ts +140 -0
  448. package/dist/services/part/part-embedding.service.d.ts.map +1 -0
  449. package/dist/services/part/part-embedding.service.js +276 -0
  450. package/dist/services/part/part-embedding.service.js.map +1 -0
  451. package/dist/services/part/part-extraction.service.d.ts +75 -0
  452. package/dist/services/part/part-extraction.service.d.ts.map +1 -0
  453. package/dist/services/part/part-extraction.service.js +519 -0
  454. package/dist/services/part/part-extraction.service.js.map +1 -0
  455. package/dist/services/part/part-search.service.d.ts +180 -0
  456. package/dist/services/part/part-search.service.d.ts.map +1 -0
  457. package/dist/services/part/part-search.service.js +565 -0
  458. package/dist/services/part/part-search.service.js.map +1 -0
  459. package/dist/services/part/schemas.d.ts +232 -0
  460. package/dist/services/part/schemas.d.ts.map +1 -0
  461. package/dist/services/part/schemas.js +167 -0
  462. package/dist/services/part/schemas.js.map +1 -0
  463. package/dist/services/part/section-screenshot-fallback.service.d.ts +101 -0
  464. package/dist/services/part/section-screenshot-fallback.service.d.ts.map +1 -0
  465. package/dist/services/part/section-screenshot-fallback.service.js +489 -0
  466. package/dist/services/part/section-screenshot-fallback.service.js.map +1 -0
  467. package/dist/services/part/types.d.ts +189 -0
  468. package/dist/services/part/types.d.ts.map +1 -0
  469. package/dist/services/part/types.js +139 -0
  470. package/dist/services/part/types.js.map +1 -0
  471. package/dist/services/persistent-cache.d.ts +209 -0
  472. package/dist/services/persistent-cache.d.ts.map +1 -0
  473. package/dist/services/persistent-cache.js +633 -0
  474. package/dist/services/persistent-cache.js.map +1 -0
  475. package/dist/services/preference-profile.service.d.ts +143 -0
  476. package/dist/services/preference-profile.service.d.ts.map +1 -0
  477. package/dist/services/preference-profile.service.js +604 -0
  478. package/dist/services/preference-profile.service.js.map +1 -0
  479. package/dist/services/preference-rerank.helper.d.ts +128 -0
  480. package/dist/services/preference-rerank.helper.d.ts.map +1 -0
  481. package/dist/services/preference-rerank.helper.js +397 -0
  482. package/dist/services/preference-rerank.helper.js.map +1 -0
  483. package/dist/services/production-guard.d.ts +213 -0
  484. package/dist/services/production-guard.d.ts.map +1 -0
  485. package/dist/services/production-guard.js +357 -0
  486. package/dist/services/production-guard.js.map +1 -0
  487. package/dist/services/project-context-analyzer.d.ts +194 -0
  488. package/dist/services/project-context-analyzer.d.ts.map +1 -0
  489. package/dist/services/project-context-analyzer.js +747 -0
  490. package/dist/services/project-context-analyzer.js.map +1 -0
  491. package/dist/services/quality/axe-accessibility.service.d.ts +87 -0
  492. package/dist/services/quality/axe-accessibility.service.d.ts.map +1 -0
  493. package/dist/services/quality/axe-accessibility.service.js +188 -0
  494. package/dist/services/quality/axe-accessibility.service.js.map +1 -0
  495. package/dist/services/quality/axe-core-shared.d.ts +108 -0
  496. package/dist/services/quality/axe-core-shared.d.ts.map +1 -0
  497. package/dist/services/quality/axe-core-shared.js +136 -0
  498. package/dist/services/quality/axe-core-shared.js.map +1 -0
  499. package/dist/services/quality/benchmark.service.d.ts +178 -0
  500. package/dist/services/quality/benchmark.service.d.ts.map +1 -0
  501. package/dist/services/quality/benchmark.service.js +394 -0
  502. package/dist/services/quality/benchmark.service.js.map +1 -0
  503. package/dist/services/quality/content-gap-detector.service.d.ts +133 -0
  504. package/dist/services/quality/content-gap-detector.service.d.ts.map +1 -0
  505. package/dist/services/quality/content-gap-detector.service.js +364 -0
  506. package/dist/services/quality/content-gap-detector.service.js.map +1 -0
  507. package/dist/services/quality/index.d.ts +12 -0
  508. package/dist/services/quality/index.d.ts.map +1 -0
  509. package/dist/services/quality/index.js +12 -0
  510. package/dist/services/quality/index.js.map +1 -0
  511. package/dist/services/quality/pattern-matcher.service.d.ts +195 -0
  512. package/dist/services/quality/pattern-matcher.service.d.ts.map +1 -0
  513. package/dist/services/quality/pattern-matcher.service.js +630 -0
  514. package/dist/services/quality/pattern-matcher.service.js.map +1 -0
  515. package/dist/services/quality/playwright-axe.service.d.ts +84 -0
  516. package/dist/services/quality/playwright-axe.service.d.ts.map +1 -0
  517. package/dist/services/quality/playwright-axe.service.js +267 -0
  518. package/dist/services/quality/playwright-axe.service.js.map +1 -0
  519. package/dist/services/quality/quality-evaluate.service.interface.d.ts +216 -0
  520. package/dist/services/quality/quality-evaluate.service.interface.d.ts.map +1 -0
  521. package/dist/services/quality/quality-evaluate.service.interface.js +5 -0
  522. package/dist/services/quality/quality-evaluate.service.interface.js.map +1 -0
  523. package/dist/services/quality/visual-design-analyzer.service.d.ts +72 -0
  524. package/dist/services/quality/visual-design-analyzer.service.d.ts.map +1 -0
  525. package/dist/services/quality/visual-design-analyzer.service.js +762 -0
  526. package/dist/services/quality/visual-design-analyzer.service.js.map +1 -0
  527. package/dist/services/quality-evaluate-service-export.d.ts +122 -0
  528. package/dist/services/quality-evaluate-service-export.d.ts.map +1 -0
  529. package/dist/services/quality-evaluate-service-export.js +138 -0
  530. package/dist/services/quality-evaluate-service-export.js.map +1 -0
  531. package/dist/services/quality-search.service.d.ts +20 -0
  532. package/dist/services/quality-search.service.d.ts.map +1 -0
  533. package/dist/services/quality-search.service.js +260 -0
  534. package/dist/services/quality-search.service.js.map +1 -0
  535. package/dist/services/query-analyzer.d.ts +107 -0
  536. package/dist/services/query-analyzer.d.ts.map +1 -0
  537. package/dist/services/query-analyzer.js +222 -0
  538. package/dist/services/query-analyzer.js.map +1 -0
  539. package/dist/services/query-context-analyzer.d.ts +85 -0
  540. package/dist/services/query-context-analyzer.d.ts.map +1 -0
  541. package/dist/services/query-context-analyzer.js +728 -0
  542. package/dist/services/query-context-analyzer.js.map +1 -0
  543. package/dist/services/queue-cleanup.service.d.ts +102 -0
  544. package/dist/services/queue-cleanup.service.d.ts.map +1 -0
  545. package/dist/services/queue-cleanup.service.js +259 -0
  546. package/dist/services/queue-cleanup.service.js.map +1 -0
  547. package/dist/services/responsive/difference-detector.service.d.ts +77 -0
  548. package/dist/services/responsive/difference-detector.service.d.ts.map +1 -0
  549. package/dist/services/responsive/difference-detector.service.js +525 -0
  550. package/dist/services/responsive/difference-detector.service.js.map +1 -0
  551. package/dist/services/responsive/index.d.ts +16 -0
  552. package/dist/services/responsive/index.d.ts.map +1 -0
  553. package/dist/services/responsive/index.js +60 -0
  554. package/dist/services/responsive/index.js.map +1 -0
  555. package/dist/services/responsive/multi-viewport-capture.service.d.ts +103 -0
  556. package/dist/services/responsive/multi-viewport-capture.service.d.ts.map +1 -0
  557. package/dist/services/responsive/multi-viewport-capture.service.js +841 -0
  558. package/dist/services/responsive/multi-viewport-capture.service.js.map +1 -0
  559. package/dist/services/responsive/responsive-analysis-embedding.service.d.ts +114 -0
  560. package/dist/services/responsive/responsive-analysis-embedding.service.d.ts.map +1 -0
  561. package/dist/services/responsive/responsive-analysis-embedding.service.js +232 -0
  562. package/dist/services/responsive/responsive-analysis-embedding.service.js.map +1 -0
  563. package/dist/services/responsive/responsive-analysis.service.d.ts +37 -0
  564. package/dist/services/responsive/responsive-analysis.service.d.ts.map +1 -0
  565. package/dist/services/responsive/responsive-analysis.service.js +262 -0
  566. package/dist/services/responsive/responsive-analysis.service.js.map +1 -0
  567. package/dist/services/responsive/responsive-persistence.service.d.ts +45 -0
  568. package/dist/services/responsive/responsive-persistence.service.d.ts.map +1 -0
  569. package/dist/services/responsive/responsive-persistence.service.js +102 -0
  570. package/dist/services/responsive/responsive-persistence.service.js.map +1 -0
  571. package/dist/services/responsive/responsive-quality-evaluator.service.d.ts +80 -0
  572. package/dist/services/responsive/responsive-quality-evaluator.service.d.ts.map +1 -0
  573. package/dist/services/responsive/responsive-quality-evaluator.service.js +448 -0
  574. package/dist/services/responsive/responsive-quality-evaluator.service.js.map +1 -0
  575. package/dist/services/responsive/shared-browser-manager.d.ts +65 -0
  576. package/dist/services/responsive/shared-browser-manager.d.ts.map +1 -0
  577. package/dist/services/responsive/shared-browser-manager.js +112 -0
  578. package/dist/services/responsive/shared-browser-manager.js.map +1 -0
  579. package/dist/services/responsive/types.d.ts +367 -0
  580. package/dist/services/responsive/types.d.ts.map +1 -0
  581. package/dist/services/responsive/types.js +5 -0
  582. package/dist/services/responsive/types.js.map +1 -0
  583. package/dist/services/responsive/viewport-diff.service.d.ts +49 -0
  584. package/dist/services/responsive/viewport-diff.service.d.ts.map +1 -0
  585. package/dist/services/responsive/viewport-diff.service.js +178 -0
  586. package/dist/services/responsive/viewport-diff.service.js.map +1 -0
  587. package/dist/services/responsive-search.service.d.ts +52 -0
  588. package/dist/services/responsive-search.service.d.ts.map +1 -0
  589. package/dist/services/responsive-search.service.js +136 -0
  590. package/dist/services/responsive-search.service.js.map +1 -0
  591. package/dist/services/search/mood-brandtone-search.service.d.ts +99 -0
  592. package/dist/services/search/mood-brandtone-search.service.d.ts.map +1 -0
  593. package/dist/services/search/mood-brandtone-search.service.js +310 -0
  594. package/dist/services/search/mood-brandtone-search.service.js.map +1 -0
  595. package/dist/services/search-performance.service.d.ts +118 -0
  596. package/dist/services/search-performance.service.d.ts.map +1 -0
  597. package/dist/services/search-performance.service.js +181 -0
  598. package/dist/services/search-performance.service.js.map +1 -0
  599. package/dist/services/section-screenshot.service.d.ts +163 -0
  600. package/dist/services/section-screenshot.service.d.ts.map +1 -0
  601. package/dist/services/section-screenshot.service.js +363 -0
  602. package/dist/services/section-screenshot.service.js.map +1 -0
  603. package/dist/services/service-client.d.ts +181 -0
  604. package/dist/services/service-client.d.ts.map +1 -0
  605. package/dist/services/service-client.js +450 -0
  606. package/dist/services/service-client.js.map +1 -0
  607. package/dist/services/service-initializer.d.ts +174 -0
  608. package/dist/services/service-initializer.d.ts.map +1 -0
  609. package/dist/services/service-initializer.js +942 -0
  610. package/dist/services/service-initializer.js.map +1 -0
  611. package/dist/services/storage/index.d.ts +7 -0
  612. package/dist/services/storage/index.d.ts.map +1 -0
  613. package/dist/services/storage/index.js +14 -0
  614. package/dist/services/storage/index.js.map +1 -0
  615. package/dist/services/storage/local-storage.provider.d.ts +140 -0
  616. package/dist/services/storage/local-storage.provider.d.ts.map +1 -0
  617. package/dist/services/storage/local-storage.provider.js +333 -0
  618. package/dist/services/storage/local-storage.provider.js.map +1 -0
  619. package/dist/services/style/index.d.ts +7 -0
  620. package/dist/services/style/index.d.ts.map +1 -0
  621. package/dist/services/style/index.js +25 -0
  622. package/dist/services/style/index.js.map +1 -0
  623. package/dist/services/style/palette-service.d.ts +212 -0
  624. package/dist/services/style/palette-service.d.ts.map +1 -0
  625. package/dist/services/style/palette-service.js +423 -0
  626. package/dist/services/style/palette-service.js.map +1 -0
  627. package/dist/services/style/prisma-palette-repository.d.ts +35 -0
  628. package/dist/services/style/prisma-palette-repository.d.ts.map +1 -0
  629. package/dist/services/style/prisma-palette-repository.js +165 -0
  630. package/dist/services/style/prisma-palette-repository.js.map +1 -0
  631. package/dist/services/vision/brandtone.analyzer.d.ts +104 -0
  632. package/dist/services/vision/brandtone.analyzer.d.ts.map +1 -0
  633. package/dist/services/vision/brandtone.analyzer.js +279 -0
  634. package/dist/services/vision/brandtone.analyzer.js.map +1 -0
  635. package/dist/services/vision/hardware-detector.d.ts +166 -0
  636. package/dist/services/vision/hardware-detector.d.ts.map +1 -0
  637. package/dist/services/vision/hardware-detector.js +330 -0
  638. package/dist/services/vision/hardware-detector.js.map +1 -0
  639. package/dist/services/vision/image-optimizer.d.ts +152 -0
  640. package/dist/services/vision/image-optimizer.d.ts.map +1 -0
  641. package/dist/services/vision/image-optimizer.js +266 -0
  642. package/dist/services/vision/image-optimizer.js.map +1 -0
  643. package/dist/services/vision/index.d.ts +26 -0
  644. package/dist/services/vision/index.d.ts.map +1 -0
  645. package/dist/services/vision/index.js +80 -0
  646. package/dist/services/vision/index.js.map +1 -0
  647. package/dist/services/vision/llama-vision-adapter.d.ts +178 -0
  648. package/dist/services/vision/llama-vision-adapter.d.ts.map +1 -0
  649. package/dist/services/vision/llama-vision-adapter.js +307 -0
  650. package/dist/services/vision/llama-vision-adapter.js.map +1 -0
  651. package/dist/services/vision/mcp-progress-adapter.d.ts +128 -0
  652. package/dist/services/vision/mcp-progress-adapter.d.ts.map +1 -0
  653. package/dist/services/vision/mcp-progress-adapter.js +150 -0
  654. package/dist/services/vision/mcp-progress-adapter.js.map +1 -0
  655. package/dist/services/vision/mood.analyzer.d.ts +74 -0
  656. package/dist/services/vision/mood.analyzer.d.ts.map +1 -0
  657. package/dist/services/vision/mood.analyzer.js +258 -0
  658. package/dist/services/vision/mood.analyzer.js.map +1 -0
  659. package/dist/services/vision/ollama-readiness-probe.d.ts +87 -0
  660. package/dist/services/vision/ollama-readiness-probe.d.ts.map +1 -0
  661. package/dist/services/vision/ollama-readiness-probe.js +211 -0
  662. package/dist/services/vision/ollama-readiness-probe.js.map +1 -0
  663. package/dist/services/vision/ollama-vision-client.d.ts +129 -0
  664. package/dist/services/vision/ollama-vision-client.d.ts.map +1 -0
  665. package/dist/services/vision/ollama-vision-client.js +478 -0
  666. package/dist/services/vision/ollama-vision-client.js.map +1 -0
  667. package/dist/services/vision/progress-reporter.d.ts +140 -0
  668. package/dist/services/vision/progress-reporter.d.ts.map +1 -0
  669. package/dist/services/vision/progress-reporter.js +306 -0
  670. package/dist/services/vision/progress-reporter.js.map +1 -0
  671. package/dist/services/vision/scroll-vision-capture.service.d.ts +117 -0
  672. package/dist/services/vision/scroll-vision-capture.service.d.ts.map +1 -0
  673. package/dist/services/vision/scroll-vision-capture.service.js +266 -0
  674. package/dist/services/vision/scroll-vision-capture.service.js.map +1 -0
  675. package/dist/services/vision/scroll-vision-persistence.service.d.ts +48 -0
  676. package/dist/services/vision/scroll-vision-persistence.service.d.ts.map +1 -0
  677. package/dist/services/vision/scroll-vision-persistence.service.js +161 -0
  678. package/dist/services/vision/scroll-vision-persistence.service.js.map +1 -0
  679. package/dist/services/vision/scroll-vision.analyzer.d.ts +90 -0
  680. package/dist/services/vision/scroll-vision.analyzer.d.ts.map +1 -0
  681. package/dist/services/vision/scroll-vision.analyzer.js +280 -0
  682. package/dist/services/vision/scroll-vision.analyzer.js.map +1 -0
  683. package/dist/services/vision/theme.analyzer.d.ts +108 -0
  684. package/dist/services/vision/theme.analyzer.d.ts.map +1 -0
  685. package/dist/services/vision/theme.analyzer.js +315 -0
  686. package/dist/services/vision/theme.analyzer.js.map +1 -0
  687. package/dist/services/vision/timeout-calculator.d.ts +85 -0
  688. package/dist/services/vision/timeout-calculator.d.ts.map +1 -0
  689. package/dist/services/vision/timeout-calculator.js +142 -0
  690. package/dist/services/vision/timeout-calculator.js.map +1 -0
  691. package/dist/services/vision/vision-fallback.service.d.ts +121 -0
  692. package/dist/services/vision/vision-fallback.service.d.ts.map +1 -0
  693. package/dist/services/vision/vision-fallback.service.js +253 -0
  694. package/dist/services/vision/vision-fallback.service.js.map +1 -0
  695. package/dist/services/vision/vision.cache.d.ts +124 -0
  696. package/dist/services/vision/vision.cache.d.ts.map +1 -0
  697. package/dist/services/vision/vision.cache.js +261 -0
  698. package/dist/services/vision/vision.cache.js.map +1 -0
  699. package/dist/services/vision/vision.errors.d.ts +104 -0
  700. package/dist/services/vision/vision.errors.d.ts.map +1 -0
  701. package/dist/services/vision/vision.errors.js +133 -0
  702. package/dist/services/vision/vision.errors.js.map +1 -0
  703. package/dist/services/vision/vision.prompts.d.ts +47 -0
  704. package/dist/services/vision/vision.prompts.d.ts.map +1 -0
  705. package/dist/services/vision/vision.prompts.js +272 -0
  706. package/dist/services/vision/vision.prompts.js.map +1 -0
  707. package/dist/services/vision/vram-utils.d.ts +22 -0
  708. package/dist/services/vision/vram-utils.d.ts.map +1 -0
  709. package/dist/services/vision/vram-utils.js +57 -0
  710. package/dist/services/vision/vram-utils.js.map +1 -0
  711. package/dist/services/vision-adapter/index.d.ts +18 -0
  712. package/dist/services/vision-adapter/index.d.ts.map +1 -0
  713. package/dist/services/vision-adapter/index.js +31 -0
  714. package/dist/services/vision-adapter/index.js.map +1 -0
  715. package/dist/services/vision-adapter/interface.d.ts +1434 -0
  716. package/dist/services/vision-adapter/interface.d.ts.map +1 -0
  717. package/dist/services/vision-adapter/interface.js +326 -0
  718. package/dist/services/vision-adapter/interface.js.map +1 -0
  719. package/dist/services/vision-adapter/llama-vision.adapter.d.ts +373 -0
  720. package/dist/services/vision-adapter/llama-vision.adapter.d.ts.map +1 -0
  721. package/dist/services/vision-adapter/llama-vision.adapter.js +1751 -0
  722. package/dist/services/vision-adapter/llama-vision.adapter.js.map +1 -0
  723. package/dist/services/vision-adapter/llama-vision.prompts.d.ts +63 -0
  724. package/dist/services/vision-adapter/llama-vision.prompts.d.ts.map +1 -0
  725. package/dist/services/vision-adapter/llama-vision.prompts.js +234 -0
  726. package/dist/services/vision-adapter/llama-vision.prompts.js.map +1 -0
  727. package/dist/services/vision-adapter/llama-vision.types.d.ts +68 -0
  728. package/dist/services/vision-adapter/llama-vision.types.d.ts.map +1 -0
  729. package/dist/services/vision-adapter/llama-vision.types.js +21 -0
  730. package/dist/services/vision-adapter/llama-vision.types.js.map +1 -0
  731. package/dist/services/vision-adapter/local.adapter.d.ts +185 -0
  732. package/dist/services/vision-adapter/local.adapter.d.ts.map +1 -0
  733. package/dist/services/vision-adapter/local.adapter.js +835 -0
  734. package/dist/services/vision-adapter/local.adapter.js.map +1 -0
  735. package/dist/services/vision-adapter/mock.adapter.d.ts +174 -0
  736. package/dist/services/vision-adapter/mock.adapter.d.ts.map +1 -0
  737. package/dist/services/vision-adapter/mock.adapter.js +812 -0
  738. package/dist/services/vision-adapter/mock.adapter.js.map +1 -0
  739. package/dist/services/vision-embedding-search.service.d.ts +205 -0
  740. package/dist/services/vision-embedding-search.service.d.ts.map +1 -0
  741. package/dist/services/vision-embedding-search.service.js +742 -0
  742. package/dist/services/vision-embedding-search.service.js.map +1 -0
  743. package/dist/services/vision-embedding.service.d.ts +150 -0
  744. package/dist/services/vision-embedding.service.d.ts.map +1 -0
  745. package/dist/services/vision-embedding.service.js +461 -0
  746. package/dist/services/vision-embedding.service.js.map +1 -0
  747. package/dist/services/visual/css-variable-extractor.service.d.ts +97 -0
  748. package/dist/services/visual/css-variable-extractor.service.d.ts.map +1 -0
  749. package/dist/services/visual/css-variable-extractor.service.js +460 -0
  750. package/dist/services/visual/css-variable-extractor.service.js.map +1 -0
  751. package/dist/services/visual/typography-extractor.service.d.ts +137 -0
  752. package/dist/services/visual/typography-extractor.service.d.ts.map +1 -0
  753. package/dist/services/visual/typography-extractor.service.js +539 -0
  754. package/dist/services/visual/typography-extractor.service.js.map +1 -0
  755. package/dist/services/visual-extractor/color-extractor.service.d.ts +55 -0
  756. package/dist/services/visual-extractor/color-extractor.service.d.ts.map +1 -0
  757. package/dist/services/visual-extractor/color-extractor.service.js +281 -0
  758. package/dist/services/visual-extractor/color-extractor.service.js.map +1 -0
  759. package/dist/services/visual-extractor/density-calculator.service.d.ts +85 -0
  760. package/dist/services/visual-extractor/density-calculator.service.d.ts.map +1 -0
  761. package/dist/services/visual-extractor/density-calculator.service.js +369 -0
  762. package/dist/services/visual-extractor/density-calculator.service.js.map +1 -0
  763. package/dist/services/visual-extractor/gradient-detector.service.d.ts +134 -0
  764. package/dist/services/visual-extractor/gradient-detector.service.d.ts.map +1 -0
  765. package/dist/services/visual-extractor/gradient-detector.service.js +1172 -0
  766. package/dist/services/visual-extractor/gradient-detector.service.js.map +1 -0
  767. package/dist/services/visual-extractor/image-utils.d.ts +135 -0
  768. package/dist/services/visual-extractor/image-utils.d.ts.map +1 -0
  769. package/dist/services/visual-extractor/image-utils.js +305 -0
  770. package/dist/services/visual-extractor/image-utils.js.map +1 -0
  771. package/dist/services/visual-extractor/pixel-theme-detector.service.d.ts +58 -0
  772. package/dist/services/visual-extractor/pixel-theme-detector.service.d.ts.map +1 -0
  773. package/dist/services/visual-extractor/pixel-theme-detector.service.js +358 -0
  774. package/dist/services/visual-extractor/pixel-theme-detector.service.js.map +1 -0
  775. package/dist/services/visual-extractor/theme-detector.service.d.ts +101 -0
  776. package/dist/services/visual-extractor/theme-detector.service.d.ts.map +1 -0
  777. package/dist/services/visual-extractor/theme-detector.service.js +463 -0
  778. package/dist/services/visual-extractor/theme-detector.service.js.map +1 -0
  779. package/dist/services/visual-extractor/visual-decoration-detector.service.d.ts +43 -0
  780. package/dist/services/visual-extractor/visual-decoration-detector.service.d.ts.map +1 -0
  781. package/dist/services/visual-extractor/visual-decoration-detector.service.js +628 -0
  782. package/dist/services/visual-extractor/visual-decoration-detector.service.js.map +1 -0
  783. package/dist/services/visual-extractor/visual-feature-merger.service.d.ts +230 -0
  784. package/dist/services/visual-extractor/visual-feature-merger.service.d.ts.map +1 -0
  785. package/dist/services/visual-extractor/visual-feature-merger.service.js +482 -0
  786. package/dist/services/visual-extractor/visual-feature-merger.service.js.map +1 -0
  787. package/dist/services/web-page.service.d.ts +80 -0
  788. package/dist/services/web-page.service.d.ts.map +1 -0
  789. package/dist/services/web-page.service.js +211 -0
  790. package/dist/services/web-page.service.js.map +1 -0
  791. package/dist/services/worker-constants.d.ts +40 -0
  792. package/dist/services/worker-constants.d.ts.map +1 -0
  793. package/dist/services/worker-constants.js +51 -0
  794. package/dist/services/worker-constants.js.map +1 -0
  795. package/dist/services/worker-db-save.service.d.ts +311 -0
  796. package/dist/services/worker-db-save.service.d.ts.map +1 -0
  797. package/dist/services/worker-db-save.service.js +771 -0
  798. package/dist/services/worker-db-save.service.js.map +1 -0
  799. package/dist/services/worker-memory-monitor.service.d.ts +24 -0
  800. package/dist/services/worker-memory-monitor.service.d.ts.map +1 -0
  801. package/dist/services/worker-memory-monitor.service.js +105 -0
  802. package/dist/services/worker-memory-monitor.service.js.map +1 -0
  803. package/dist/services/worker-memory-profile.d.ts +65 -0
  804. package/dist/services/worker-memory-profile.d.ts.map +1 -0
  805. package/dist/services/worker-memory-profile.js +225 -0
  806. package/dist/services/worker-memory-profile.js.map +1 -0
  807. package/dist/services/worker-stall-recovery.service.d.ts +166 -0
  808. package/dist/services/worker-stall-recovery.service.d.ts.map +1 -0
  809. package/dist/services/worker-stall-recovery.service.js +335 -0
  810. package/dist/services/worker-stall-recovery.service.js.map +1 -0
  811. package/dist/services/worker-supervisor.service.d.ts +145 -0
  812. package/dist/services/worker-supervisor.service.d.ts.map +1 -0
  813. package/dist/services/worker-supervisor.service.js +635 -0
  814. package/dist/services/worker-supervisor.service.js.map +1 -0
  815. package/dist/tools/background/schemas.d.ts +85 -0
  816. package/dist/tools/background/schemas.d.ts.map +1 -0
  817. package/dist/tools/background/schemas.js +79 -0
  818. package/dist/tools/background/schemas.js.map +1 -0
  819. package/dist/tools/background/search.tool.d.ts +179 -0
  820. package/dist/tools/background/search.tool.d.ts.map +1 -0
  821. package/dist/tools/background/search.tool.js +318 -0
  822. package/dist/tools/background/search.tool.js.map +1 -0
  823. package/dist/tools/brief/index.d.ts +10 -0
  824. package/dist/tools/brief/index.d.ts.map +1 -0
  825. package/dist/tools/brief/index.js +54 -0
  826. package/dist/tools/brief/index.js.map +1 -0
  827. package/dist/tools/brief/schemas.d.ts +750 -0
  828. package/dist/tools/brief/schemas.d.ts.map +1 -0
  829. package/dist/tools/brief/schemas.js +212 -0
  830. package/dist/tools/brief/schemas.js.map +1 -0
  831. package/dist/tools/brief/validate.handler.d.ts +149 -0
  832. package/dist/tools/brief/validate.handler.d.ts.map +1 -0
  833. package/dist/tools/brief/validate.handler.js +247 -0
  834. package/dist/tools/brief/validate.handler.js.map +1 -0
  835. package/dist/tools/brief/validate.service.d.ts +100 -0
  836. package/dist/tools/brief/validate.service.d.ts.map +1 -0
  837. package/dist/tools/brief/validate.service.js +296 -0
  838. package/dist/tools/brief/validate.service.js.map +1 -0
  839. package/dist/tools/common/error-codes.d.ts +35 -0
  840. package/dist/tools/common/error-codes.d.ts.map +1 -0
  841. package/dist/tools/common/error-codes.js +92 -0
  842. package/dist/tools/common/error-codes.js.map +1 -0
  843. package/dist/tools/common/index.d.ts +7 -0
  844. package/dist/tools/common/index.d.ts.map +1 -0
  845. package/dist/tools/common/index.js +20 -0
  846. package/dist/tools/common/index.js.map +1 -0
  847. package/dist/tools/index.d.ts +2756 -0
  848. package/dist/tools/index.d.ts.map +1 -0
  849. package/dist/tools/index.js +506 -0
  850. package/dist/tools/index.js.map +1 -0
  851. package/dist/tools/layout/batch-ingest.tool.d.ts +82 -0
  852. package/dist/tools/layout/batch-ingest.tool.d.ts.map +1 -0
  853. package/dist/tools/layout/batch-ingest.tool.js +410 -0
  854. package/dist/tools/layout/batch-ingest.tool.js.map +1 -0
  855. package/dist/tools/layout/index.d.ts +13 -0
  856. package/dist/tools/layout/index.d.ts.map +1 -0
  857. package/dist/tools/layout/index.js +62 -0
  858. package/dist/tools/layout/index.js.map +1 -0
  859. package/dist/tools/layout/ingest.tool.d.ts +338 -0
  860. package/dist/tools/layout/ingest.tool.d.ts.map +1 -0
  861. package/dist/tools/layout/ingest.tool.js +1308 -0
  862. package/dist/tools/layout/ingest.tool.js.map +1 -0
  863. package/dist/tools/layout/inspect/index.d.ts +11 -0
  864. package/dist/tools/layout/inspect/index.d.ts.map +1 -0
  865. package/dist/tools/layout/inspect/index.js +55 -0
  866. package/dist/tools/layout/inspect/index.js.map +1 -0
  867. package/dist/tools/layout/inspect/inspect.schemas.d.ts +4130 -0
  868. package/dist/tools/layout/inspect/inspect.schemas.d.ts.map +1 -0
  869. package/dist/tools/layout/inspect/inspect.schemas.js +400 -0
  870. package/dist/tools/layout/inspect/inspect.schemas.js.map +1 -0
  871. package/dist/tools/layout/inspect/inspect.tool.d.ts +164 -0
  872. package/dist/tools/layout/inspect/inspect.tool.d.ts.map +1 -0
  873. package/dist/tools/layout/inspect/inspect.tool.js +738 -0
  874. package/dist/tools/layout/inspect/inspect.tool.js.map +1 -0
  875. package/dist/tools/layout/inspect/inspect.utils.d.ts +200 -0
  876. package/dist/tools/layout/inspect/inspect.utils.d.ts.map +1 -0
  877. package/dist/tools/layout/inspect/inspect.utils.js +1104 -0
  878. package/dist/tools/layout/inspect/inspect.utils.js.map +1 -0
  879. package/dist/tools/layout/inspect/visual-extractors.schemas.d.ts +3372 -0
  880. package/dist/tools/layout/inspect/visual-extractors.schemas.d.ts.map +1 -0
  881. package/dist/tools/layout/inspect/visual-extractors.schemas.js +558 -0
  882. package/dist/tools/layout/inspect/visual-extractors.schemas.js.map +1 -0
  883. package/dist/tools/layout/inspect/visual-extractors.utils.d.ts +86 -0
  884. package/dist/tools/layout/inspect/visual-extractors.utils.d.ts.map +1 -0
  885. package/dist/tools/layout/inspect/visual-extractors.utils.js +231 -0
  886. package/dist/tools/layout/inspect/visual-extractors.utils.js.map +1 -0
  887. package/dist/tools/layout/schemas.d.ts +11074 -0
  888. package/dist/tools/layout/schemas.d.ts.map +1 -0
  889. package/dist/tools/layout/schemas.js +1497 -0
  890. package/dist/tools/layout/schemas.js.map +1 -0
  891. package/dist/tools/layout/search.tool.d.ts +470 -0
  892. package/dist/tools/layout/search.tool.d.ts.map +1 -0
  893. package/dist/tools/layout/search.tool.js +1582 -0
  894. package/dist/tools/layout/search.tool.js.map +1 -0
  895. package/dist/tools/layout/to-code.tool.d.ts +280 -0
  896. package/dist/tools/layout/to-code.tool.d.ts.map +1 -0
  897. package/dist/tools/layout/to-code.tool.js +317 -0
  898. package/dist/tools/layout/to-code.tool.js.map +1 -0
  899. package/dist/tools/motion/analyze-frames.handler.d.ts +157 -0
  900. package/dist/tools/motion/analyze-frames.handler.d.ts.map +1 -0
  901. package/dist/tools/motion/analyze-frames.handler.js +263 -0
  902. package/dist/tools/motion/analyze-frames.handler.js.map +1 -0
  903. package/dist/tools/motion/analyze-frames.schema.d.ts +4599 -0
  904. package/dist/tools/motion/analyze-frames.schema.d.ts.map +1 -0
  905. package/dist/tools/motion/analyze-frames.schema.js +420 -0
  906. package/dist/tools/motion/analyze-frames.schema.js.map +1 -0
  907. package/dist/tools/motion/css-mode-handler.d.ts +70 -0
  908. package/dist/tools/motion/css-mode-handler.d.ts.map +1 -0
  909. package/dist/tools/motion/css-mode-handler.js +754 -0
  910. package/dist/tools/motion/css-mode-handler.js.map +1 -0
  911. package/dist/tools/motion/detect.schemas.d.ts +14288 -0
  912. package/dist/tools/motion/detect.schemas.d.ts.map +1 -0
  913. package/dist/tools/motion/detect.schemas.js +1715 -0
  914. package/dist/tools/motion/detect.schemas.js.map +1 -0
  915. package/dist/tools/motion/detect.tool.d.ts +195 -0
  916. package/dist/tools/motion/detect.tool.d.ts.map +1 -0
  917. package/dist/tools/motion/detect.tool.js +1421 -0
  918. package/dist/tools/motion/detect.tool.js.map +1 -0
  919. package/dist/tools/motion/detection-modes.d.ts +72 -0
  920. package/dist/tools/motion/detection-modes.d.ts.map +1 -0
  921. package/dist/tools/motion/detection-modes.js +353 -0
  922. package/dist/tools/motion/detection-modes.js.map +1 -0
  923. package/dist/tools/motion/di-factories.d.ts +341 -0
  924. package/dist/tools/motion/di-factories.d.ts.map +1 -0
  925. package/dist/tools/motion/di-factories.js +376 -0
  926. package/dist/tools/motion/di-factories.js.map +1 -0
  927. package/dist/tools/motion/index.d.ts +12 -0
  928. package/dist/tools/motion/index.d.ts.map +1 -0
  929. package/dist/tools/motion/index.js +146 -0
  930. package/dist/tools/motion/index.js.map +1 -0
  931. package/dist/tools/motion/pattern-converter.d.ts +49 -0
  932. package/dist/tools/motion/pattern-converter.d.ts.map +1 -0
  933. package/dist/tools/motion/pattern-converter.js +493 -0
  934. package/dist/tools/motion/pattern-converter.js.map +1 -0
  935. package/dist/tools/motion/schemas.d.ts +10 -0
  936. package/dist/tools/motion/schemas.d.ts.map +1 -0
  937. package/dist/tools/motion/schemas.js +28 -0
  938. package/dist/tools/motion/schemas.js.map +1 -0
  939. package/dist/tools/motion/search.schemas.d.ts +7500 -0
  940. package/dist/tools/motion/search.schemas.d.ts.map +1 -0
  941. package/dist/tools/motion/search.schemas.js +596 -0
  942. package/dist/tools/motion/search.schemas.js.map +1 -0
  943. package/dist/tools/motion/search.tool.d.ts +416 -0
  944. package/dist/tools/motion/search.tool.d.ts.map +1 -0
  945. package/dist/tools/motion/search.tool.js +2088 -0
  946. package/dist/tools/motion/search.tool.js.map +1 -0
  947. package/dist/tools/motion/shared.schemas.d.ts +994 -0
  948. package/dist/tools/motion/shared.schemas.d.ts.map +1 -0
  949. package/dist/tools/motion/shared.schemas.js +354 -0
  950. package/dist/tools/motion/shared.schemas.js.map +1 -0
  951. package/dist/tools/narrative/analyze.tool.d.ts +96 -0
  952. package/dist/tools/narrative/analyze.tool.d.ts.map +1 -0
  953. package/dist/tools/narrative/analyze.tool.js +396 -0
  954. package/dist/tools/narrative/analyze.tool.js.map +1 -0
  955. package/dist/tools/narrative/index.d.ts +15 -0
  956. package/dist/tools/narrative/index.d.ts.map +1 -0
  957. package/dist/tools/narrative/index.js +83 -0
  958. package/dist/tools/narrative/index.js.map +1 -0
  959. package/dist/tools/narrative/schemas.d.ts +5553 -0
  960. package/dist/tools/narrative/schemas.d.ts.map +1 -0
  961. package/dist/tools/narrative/schemas.js +747 -0
  962. package/dist/tools/narrative/schemas.js.map +1 -0
  963. package/dist/tools/narrative/search.tool.d.ts +160 -0
  964. package/dist/tools/narrative/search.tool.d.ts.map +1 -0
  965. package/dist/tools/narrative/search.tool.js +434 -0
  966. package/dist/tools/narrative/search.tool.js.map +1 -0
  967. package/dist/tools/page/analyze.tool.d.ts +502 -0
  968. package/dist/tools/page/analyze.tool.d.ts.map +1 -0
  969. package/dist/tools/page/analyze.tool.js +875 -0
  970. package/dist/tools/page/analyze.tool.js.map +1 -0
  971. package/dist/tools/page/get-job-status.tool.d.ts +43 -0
  972. package/dist/tools/page/get-job-status.tool.d.ts.map +1 -0
  973. package/dist/tools/page/get-job-status.tool.js +178 -0
  974. package/dist/tools/page/get-job-status.tool.js.map +1 -0
  975. package/dist/tools/page/handlers/db-handler.d.ts +155 -0
  976. package/dist/tools/page/handlers/db-handler.d.ts.map +1 -0
  977. package/dist/tools/page/handlers/db-handler.js +368 -0
  978. package/dist/tools/page/handlers/db-handler.js.map +1 -0
  979. package/dist/tools/page/handlers/embedding-handler.d.ts +200 -0
  980. package/dist/tools/page/handlers/embedding-handler.d.ts.map +1 -0
  981. package/dist/tools/page/handlers/embedding-handler.js +541 -0
  982. package/dist/tools/page/handlers/embedding-handler.js.map +1 -0
  983. package/dist/tools/page/handlers/execution-status-tracker.d.ts +146 -0
  984. package/dist/tools/page/handlers/execution-status-tracker.d.ts.map +1 -0
  985. package/dist/tools/page/handlers/execution-status-tracker.js +348 -0
  986. package/dist/tools/page/handlers/execution-status-tracker.js.map +1 -0
  987. package/dist/tools/page/handlers/js-animation-handler.d.ts +197 -0
  988. package/dist/tools/page/handlers/js-animation-handler.d.ts.map +1 -0
  989. package/dist/tools/page/handlers/js-animation-handler.js +952 -0
  990. package/dist/tools/page/handlers/js-animation-handler.js.map +1 -0
  991. package/dist/tools/page/handlers/layout-handler.d.ts +31 -0
  992. package/dist/tools/page/handlers/layout-handler.d.ts.map +1 -0
  993. package/dist/tools/page/handlers/layout-handler.js +1181 -0
  994. package/dist/tools/page/handlers/layout-handler.js.map +1 -0
  995. package/dist/tools/page/handlers/motion-handler.d.ts +31 -0
  996. package/dist/tools/page/handlers/motion-handler.d.ts.map +1 -0
  997. package/dist/tools/page/handlers/motion-handler.js +940 -0
  998. package/dist/tools/page/handlers/motion-handler.js.map +1 -0
  999. package/dist/tools/page/handlers/narrative-handler.d.ts +23 -0
  1000. package/dist/tools/page/handlers/narrative-handler.d.ts.map +1 -0
  1001. package/dist/tools/page/handlers/narrative-handler.js +279 -0
  1002. package/dist/tools/page/handlers/narrative-handler.js.map +1 -0
  1003. package/dist/tools/page/handlers/phased-db-handler.d.ts +83 -0
  1004. package/dist/tools/page/handlers/phased-db-handler.d.ts.map +1 -0
  1005. package/dist/tools/page/handlers/phased-db-handler.js +120 -0
  1006. package/dist/tools/page/handlers/phased-db-handler.js.map +1 -0
  1007. package/dist/tools/page/handlers/phased-executor.d.ts +123 -0
  1008. package/dist/tools/page/handlers/phased-executor.d.ts.map +1 -0
  1009. package/dist/tools/page/handlers/phased-executor.js +205 -0
  1010. package/dist/tools/page/handlers/phased-executor.js.map +1 -0
  1011. package/dist/tools/page/handlers/quality-handler.d.ts +9 -0
  1012. package/dist/tools/page/handlers/quality-handler.d.ts.map +1 -0
  1013. package/dist/tools/page/handlers/quality-handler.js +100 -0
  1014. package/dist/tools/page/handlers/quality-handler.js.map +1 -0
  1015. package/dist/tools/page/handlers/result-builder.d.ts +105 -0
  1016. package/dist/tools/page/handlers/result-builder.d.ts.map +1 -0
  1017. package/dist/tools/page/handlers/result-builder.js +447 -0
  1018. package/dist/tools/page/handlers/result-builder.js.map +1 -0
  1019. package/dist/tools/page/handlers/retry-strategy.d.ts +106 -0
  1020. package/dist/tools/page/handlers/retry-strategy.d.ts.map +1 -0
  1021. package/dist/tools/page/handlers/retry-strategy.js +169 -0
  1022. package/dist/tools/page/handlers/retry-strategy.js.map +1 -0
  1023. package/dist/tools/page/handlers/sync-processing.d.ts +26 -0
  1024. package/dist/tools/page/handlers/sync-processing.d.ts.map +1 -0
  1025. package/dist/tools/page/handlers/sync-processing.js +1659 -0
  1026. package/dist/tools/page/handlers/sync-processing.js.map +1 -0
  1027. package/dist/tools/page/handlers/timeout-utils.d.ts +278 -0
  1028. package/dist/tools/page/handlers/timeout-utils.d.ts.map +1 -0
  1029. package/dist/tools/page/handlers/timeout-utils.js +600 -0
  1030. package/dist/tools/page/handlers/timeout-utils.js.map +1 -0
  1031. package/dist/tools/page/handlers/types.d.ts +1229 -0
  1032. package/dist/tools/page/handlers/types.d.ts.map +1 -0
  1033. package/dist/tools/page/handlers/types.js +21 -0
  1034. package/dist/tools/page/handlers/types.js.map +1 -0
  1035. package/dist/tools/page/handlers/video-handler.d.ts +11 -0
  1036. package/dist/tools/page/handlers/video-handler.d.ts.map +1 -0
  1037. package/dist/tools/page/handlers/video-handler.js +235 -0
  1038. package/dist/tools/page/handlers/video-handler.js.map +1 -0
  1039. package/dist/tools/page/handlers/webgl-animation-handler.d.ts +48 -0
  1040. package/dist/tools/page/handlers/webgl-animation-handler.d.ts.map +1 -0
  1041. package/dist/tools/page/handlers/webgl-animation-handler.js +237 -0
  1042. package/dist/tools/page/handlers/webgl-animation-handler.js.map +1 -0
  1043. package/dist/tools/page/handlers/webgl-detector.d.ts +184 -0
  1044. package/dist/tools/page/handlers/webgl-detector.d.ts.map +1 -0
  1045. package/dist/tools/page/handlers/webgl-detector.js +680 -0
  1046. package/dist/tools/page/handlers/webgl-detector.js.map +1 -0
  1047. package/dist/tools/page/handlers/webgl-domains.d.ts +133 -0
  1048. package/dist/tools/page/handlers/webgl-domains.d.ts.map +1 -0
  1049. package/dist/tools/page/handlers/webgl-domains.js +420 -0
  1050. package/dist/tools/page/handlers/webgl-domains.js.map +1 -0
  1051. package/dist/tools/page/handlers/webgl-pre-detector.d.ts +100 -0
  1052. package/dist/tools/page/handlers/webgl-pre-detector.d.ts.map +1 -0
  1053. package/dist/tools/page/handlers/webgl-pre-detector.js +248 -0
  1054. package/dist/tools/page/handlers/webgl-pre-detector.js.map +1 -0
  1055. package/dist/tools/page/index.d.ts +10 -0
  1056. package/dist/tools/page/index.d.ts.map +1 -0
  1057. package/dist/tools/page/index.js +84 -0
  1058. package/dist/tools/page/index.js.map +1 -0
  1059. package/dist/tools/page/input.schemas.d.ts +2223 -0
  1060. package/dist/tools/page/input.schemas.d.ts.map +1 -0
  1061. package/dist/tools/page/input.schemas.js +853 -0
  1062. package/dist/tools/page/input.schemas.js.map +1 -0
  1063. package/dist/tools/page/output.schemas.d.ts +26026 -0
  1064. package/dist/tools/page/output.schemas.d.ts.map +1 -0
  1065. package/dist/tools/page/output.schemas.js +1414 -0
  1066. package/dist/tools/page/output.schemas.js.map +1 -0
  1067. package/dist/tools/page/schemas.d.ts +10 -0
  1068. package/dist/tools/page/schemas.d.ts.map +1 -0
  1069. package/dist/tools/page/schemas.js +28 -0
  1070. package/dist/tools/page/schemas.js.map +1 -0
  1071. package/dist/tools/page/shared.schemas.d.ts +38 -0
  1072. package/dist/tools/page/shared.schemas.d.ts.map +1 -0
  1073. package/dist/tools/page/shared.schemas.js +69 -0
  1074. package/dist/tools/page/shared.schemas.js.map +1 -0
  1075. package/dist/tools/part/compare.tool.d.ts +106 -0
  1076. package/dist/tools/part/compare.tool.d.ts.map +1 -0
  1077. package/dist/tools/part/compare.tool.js +421 -0
  1078. package/dist/tools/part/compare.tool.js.map +1 -0
  1079. package/dist/tools/part/inspect.tool.d.ts +108 -0
  1080. package/dist/tools/part/inspect.tool.d.ts.map +1 -0
  1081. package/dist/tools/part/inspect.tool.js +279 -0
  1082. package/dist/tools/part/inspect.tool.js.map +1 -0
  1083. package/dist/tools/part/search.tool.d.ts +121 -0
  1084. package/dist/tools/part/search.tool.d.ts.map +1 -0
  1085. package/dist/tools/part/search.tool.js +381 -0
  1086. package/dist/tools/part/search.tool.js.map +1 -0
  1087. package/dist/tools/preference/get.tool.d.ts +74 -0
  1088. package/dist/tools/preference/get.tool.d.ts.map +1 -0
  1089. package/dist/tools/preference/get.tool.js +175 -0
  1090. package/dist/tools/preference/get.tool.js.map +1 -0
  1091. package/dist/tools/preference/hear.tool.d.ts +267 -0
  1092. package/dist/tools/preference/hear.tool.d.ts.map +1 -0
  1093. package/dist/tools/preference/hear.tool.js +268 -0
  1094. package/dist/tools/preference/hear.tool.js.map +1 -0
  1095. package/dist/tools/preference/index.d.ts +16 -0
  1096. package/dist/tools/preference/index.d.ts.map +1 -0
  1097. package/dist/tools/preference/index.js +43 -0
  1098. package/dist/tools/preference/index.js.map +1 -0
  1099. package/dist/tools/preference/reset.tool.d.ts +71 -0
  1100. package/dist/tools/preference/reset.tool.d.ts.map +1 -0
  1101. package/dist/tools/preference/reset.tool.js +205 -0
  1102. package/dist/tools/preference/reset.tool.js.map +1 -0
  1103. package/dist/tools/preference/schemas.d.ts +174 -0
  1104. package/dist/tools/preference/schemas.d.ts.map +1 -0
  1105. package/dist/tools/preference/schemas.js +142 -0
  1106. package/dist/tools/preference/schemas.js.map +1 -0
  1107. package/dist/tools/project-get.d.ts +42 -0
  1108. package/dist/tools/project-get.d.ts.map +1 -0
  1109. package/dist/tools/project-get.js +152 -0
  1110. package/dist/tools/project-get.js.map +1 -0
  1111. package/dist/tools/project-list.d.ts +66 -0
  1112. package/dist/tools/project-list.d.ts.map +1 -0
  1113. package/dist/tools/project-list.js +201 -0
  1114. package/dist/tools/project-list.js.map +1 -0
  1115. package/dist/tools/quality/batch-evaluate.tool.d.ts +101 -0
  1116. package/dist/tools/quality/batch-evaluate.tool.d.ts.map +1 -0
  1117. package/dist/tools/quality/batch-evaluate.tool.js +393 -0
  1118. package/dist/tools/quality/batch-evaluate.tool.js.map +1 -0
  1119. package/dist/tools/quality/evaluate-engine.d.ts +166 -0
  1120. package/dist/tools/quality/evaluate-engine.d.ts.map +1 -0
  1121. package/dist/tools/quality/evaluate-engine.js +1061 -0
  1122. package/dist/tools/quality/evaluate-engine.js.map +1 -0
  1123. package/dist/tools/quality/evaluate.tool.d.ts +286 -0
  1124. package/dist/tools/quality/evaluate.tool.d.ts.map +1 -0
  1125. package/dist/tools/quality/evaluate.tool.js +815 -0
  1126. package/dist/tools/quality/evaluate.tool.js.map +1 -0
  1127. package/dist/tools/quality/get-job-status.tool.d.ts +44 -0
  1128. package/dist/tools/quality/get-job-status.tool.d.ts.map +1 -0
  1129. package/dist/tools/quality/get-job-status.tool.js +291 -0
  1130. package/dist/tools/quality/get-job-status.tool.js.map +1 -0
  1131. package/dist/tools/quality/improvement-utils.d.ts +24 -0
  1132. package/dist/tools/quality/improvement-utils.d.ts.map +1 -0
  1133. package/dist/tools/quality/improvement-utils.js +307 -0
  1134. package/dist/tools/quality/improvement-utils.js.map +1 -0
  1135. package/dist/tools/quality/index.d.ts +11 -0
  1136. package/dist/tools/quality/index.d.ts.map +1 -0
  1137. package/dist/tools/quality/index.js +49 -0
  1138. package/dist/tools/quality/index.js.map +1 -0
  1139. package/dist/tools/quality/schemas.d.ts +14098 -0
  1140. package/dist/tools/quality/schemas.d.ts.map +1 -0
  1141. package/dist/tools/quality/schemas.js +950 -0
  1142. package/dist/tools/quality/schemas.js.map +1 -0
  1143. package/dist/tools/responsive/schemas.d.ts +156 -0
  1144. package/dist/tools/responsive/schemas.d.ts.map +1 -0
  1145. package/dist/tools/responsive/schemas.js +86 -0
  1146. package/dist/tools/responsive/schemas.js.map +1 -0
  1147. package/dist/tools/responsive/search.tool.d.ts +130 -0
  1148. package/dist/tools/responsive/search.tool.d.ts.map +1 -0
  1149. package/dist/tools/responsive/search.tool.js +324 -0
  1150. package/dist/tools/responsive/search.tool.js.map +1 -0
  1151. package/dist/tools/schemas/index.d.ts +10 -0
  1152. package/dist/tools/schemas/index.d.ts.map +1 -0
  1153. package/dist/tools/schemas/index.js +45 -0
  1154. package/dist/tools/schemas/index.js.map +1 -0
  1155. package/dist/tools/schemas/layout-schemas.d.ts +521 -0
  1156. package/dist/tools/schemas/layout-schemas.d.ts.map +1 -0
  1157. package/dist/tools/schemas/layout-schemas.js +281 -0
  1158. package/dist/tools/schemas/layout-schemas.js.map +1 -0
  1159. package/dist/tools/schemas/project-schemas.d.ts +417 -0
  1160. package/dist/tools/schemas/project-schemas.d.ts.map +1 -0
  1161. package/dist/tools/schemas/project-schemas.js +159 -0
  1162. package/dist/tools/schemas/project-schemas.js.map +1 -0
  1163. package/dist/tools/schemas/shared.d.ts +107 -0
  1164. package/dist/tools/schemas/shared.d.ts.map +1 -0
  1165. package/dist/tools/schemas/shared.js +150 -0
  1166. package/dist/tools/schemas/shared.js.map +1 -0
  1167. package/dist/tools/schemas/style-schemas.d.ts +114 -0
  1168. package/dist/tools/schemas/style-schemas.d.ts.map +1 -0
  1169. package/dist/tools/schemas/style-schemas.js +61 -0
  1170. package/dist/tools/schemas/style-schemas.js.map +1 -0
  1171. package/dist/tools/style-get-palette.d.ts +136 -0
  1172. package/dist/tools/style-get-palette.d.ts.map +1 -0
  1173. package/dist/tools/style-get-palette.js +259 -0
  1174. package/dist/tools/style-get-palette.js.map +1 -0
  1175. package/dist/tools/system-health.d.ts +255 -0
  1176. package/dist/tools/system-health.d.ts.map +1 -0
  1177. package/dist/tools/system-health.js +463 -0
  1178. package/dist/tools/system-health.js.map +1 -0
  1179. package/dist/transport.d.ts +29 -0
  1180. package/dist/transport.d.ts.map +1 -0
  1181. package/dist/transport.js +50 -0
  1182. package/dist/transport.js.map +1 -0
  1183. package/dist/types/creative/index.d.ts +8 -0
  1184. package/dist/types/creative/index.d.ts.map +1 -0
  1185. package/dist/types/creative/index.js +5 -0
  1186. package/dist/types/creative/index.js.map +1 -0
  1187. package/dist/types/creative/palette.d.ts +142 -0
  1188. package/dist/types/creative/palette.d.ts.map +1 -0
  1189. package/dist/types/creative/palette.js +5 -0
  1190. package/dist/types/creative/palette.js.map +1 -0
  1191. package/dist/types/reftrix-window.d.ts +124 -0
  1192. package/dist/types/reftrix-window.d.ts.map +1 -0
  1193. package/dist/types/reftrix-window.js +68 -0
  1194. package/dist/types/reftrix-window.js.map +1 -0
  1195. package/dist/utils/actionable-warning.d.ts +170 -0
  1196. package/dist/utils/actionable-warning.d.ts.map +1 -0
  1197. package/dist/utils/actionable-warning.js +818 -0
  1198. package/dist/utils/actionable-warning.js.map +1 -0
  1199. package/dist/utils/blank-image-detector.d.ts +22 -0
  1200. package/dist/utils/blank-image-detector.d.ts.map +1 -0
  1201. package/dist/utils/blank-image-detector.js +133 -0
  1202. package/dist/utils/blank-image-detector.js.map +1 -0
  1203. package/dist/utils/color.d.ts +203 -0
  1204. package/dist/utils/color.d.ts.map +1 -0
  1205. package/dist/utils/color.js +442 -0
  1206. package/dist/utils/color.js.map +1 -0
  1207. package/dist/utils/deprecation-warning.d.ts +43 -0
  1208. package/dist/utils/deprecation-warning.d.ts.map +1 -0
  1209. package/dist/utils/deprecation-warning.js +112 -0
  1210. package/dist/utils/deprecation-warning.js.map +1 -0
  1211. package/dist/utils/error-messages.d.ts +233 -0
  1212. package/dist/utils/error-messages.d.ts.map +1 -0
  1213. package/dist/utils/error-messages.js +721 -0
  1214. package/dist/utils/error-messages.js.map +1 -0
  1215. package/dist/utils/errors.d.ts +64 -0
  1216. package/dist/utils/errors.d.ts.map +1 -0
  1217. package/dist/utils/errors.js +82 -0
  1218. package/dist/utils/errors.js.map +1 -0
  1219. package/dist/utils/gpu-browser-args.d.ts +27 -0
  1220. package/dist/utils/gpu-browser-args.d.ts.map +1 -0
  1221. package/dist/utils/gpu-browser-args.js +42 -0
  1222. package/dist/utils/gpu-browser-args.js.map +1 -0
  1223. package/dist/utils/html-sanitizer.d.ts +116 -0
  1224. package/dist/utils/html-sanitizer.d.ts.map +1 -0
  1225. package/dist/utils/html-sanitizer.js +630 -0
  1226. package/dist/utils/html-sanitizer.js.map +1 -0
  1227. package/dist/utils/logger.d.ts +141 -0
  1228. package/dist/utils/logger.d.ts.map +1 -0
  1229. package/dist/utils/logger.js +249 -0
  1230. package/dist/utils/logger.js.map +1 -0
  1231. package/dist/utils/mcp-response.d.ts +317 -0
  1232. package/dist/utils/mcp-response.d.ts.map +1 -0
  1233. package/dist/utils/mcp-response.js +270 -0
  1234. package/dist/utils/mcp-response.js.map +1 -0
  1235. package/dist/utils/path-security.d.ts +73 -0
  1236. package/dist/utils/path-security.d.ts.map +1 -0
  1237. package/dist/utils/path-security.js +389 -0
  1238. package/dist/utils/path-security.js.map +1 -0
  1239. package/dist/utils/prisma-wrapper-factory.d.ts +152 -0
  1240. package/dist/utils/prisma-wrapper-factory.d.ts.map +1 -0
  1241. package/dist/utils/prisma-wrapper-factory.js +124 -0
  1242. package/dist/utils/prisma-wrapper-factory.js.map +1 -0
  1243. package/dist/utils/safe-parse-int.d.ts +41 -0
  1244. package/dist/utils/safe-parse-int.d.ts.map +1 -0
  1245. package/dist/utils/safe-parse-int.js +49 -0
  1246. package/dist/utils/safe-parse-int.js.map +1 -0
  1247. package/dist/utils/url-normalizer.d.ts +38 -0
  1248. package/dist/utils/url-normalizer.d.ts.map +1 -0
  1249. package/dist/utils/url-normalizer.js +103 -0
  1250. package/dist/utils/url-normalizer.js.map +1 -0
  1251. package/dist/utils/url-validator.d.ts +86 -0
  1252. package/dist/utils/url-validator.d.ts.map +1 -0
  1253. package/dist/utils/url-validator.js +533 -0
  1254. package/dist/utils/url-validator.js.map +1 -0
  1255. package/dist/workers/batch-quality-worker.d.ts +87 -0
  1256. package/dist/workers/batch-quality-worker.d.ts.map +1 -0
  1257. package/dist/workers/batch-quality-worker.js +300 -0
  1258. package/dist/workers/batch-quality-worker.js.map +1 -0
  1259. package/dist/workers/page-analyze-worker.d.ts +63 -0
  1260. package/dist/workers/page-analyze-worker.d.ts.map +1 -0
  1261. package/dist/workers/page-analyze-worker.js +872 -0
  1262. package/dist/workers/page-analyze-worker.js.map +1 -0
  1263. package/dist/workers/phases/phase-0-ingest.d.ts +42 -0
  1264. package/dist/workers/phases/phase-0-ingest.d.ts.map +1 -0
  1265. package/dist/workers/phases/phase-0-ingest.js +197 -0
  1266. package/dist/workers/phases/phase-0-ingest.js.map +1 -0
  1267. package/dist/workers/phases/phase-1-layout.d.ts +63 -0
  1268. package/dist/workers/phases/phase-1-layout.d.ts.map +1 -0
  1269. package/dist/workers/phases/phase-1-layout.js +362 -0
  1270. package/dist/workers/phases/phase-1-layout.js.map +1 -0
  1271. package/dist/workers/phases/phase-2-motion.d.ts +93 -0
  1272. package/dist/workers/phases/phase-2-motion.d.ts.map +1 -0
  1273. package/dist/workers/phases/phase-2-motion.js +408 -0
  1274. package/dist/workers/phases/phase-2-motion.js.map +1 -0
  1275. package/dist/workers/phases/phase-3-quality.d.ts +61 -0
  1276. package/dist/workers/phases/phase-3-quality.d.ts.map +1 -0
  1277. package/dist/workers/phases/phase-3-quality.js +191 -0
  1278. package/dist/workers/phases/phase-3-quality.js.map +1 -0
  1279. package/dist/workers/phases/phase-4-narrative.d.ts +37 -0
  1280. package/dist/workers/phases/phase-4-narrative.d.ts.map +1 -0
  1281. package/dist/workers/phases/phase-4-narrative.js +309 -0
  1282. package/dist/workers/phases/phase-4-narrative.js.map +1 -0
  1283. package/dist/workers/phases/phase-5-embedding.d.ts +56 -0
  1284. package/dist/workers/phases/phase-5-embedding.d.ts.map +1 -0
  1285. package/dist/workers/phases/phase-5-embedding.js +1350 -0
  1286. package/dist/workers/phases/phase-5-embedding.js.map +1 -0
  1287. package/dist/workers/phases/types.d.ts +411 -0
  1288. package/dist/workers/phases/types.d.ts.map +1 -0
  1289. package/dist/workers/phases/types.js +540 -0
  1290. package/dist/workers/phases/types.js.map +1 -0
  1291. package/package.json +117 -0
  1292. package/src/api/health.ts +372 -0
  1293. package/src/config/index.ts +12 -0
  1294. package/src/config/redis.ts +280 -0
  1295. package/src/index.ts +360 -0
  1296. package/src/lib/index.ts +9 -0
  1297. package/src/lib/project-context.ts +109 -0
  1298. package/src/middleware/args-type-coercion.ts +220 -0
  1299. package/src/middleware/auth.ts +558 -0
  1300. package/src/middleware/index.ts +56 -0
  1301. package/src/middleware/light-response-controller.ts +723 -0
  1302. package/src/middleware/response-size-warning.ts +196 -0
  1303. package/src/queues/batch-quality-queue.ts +580 -0
  1304. package/src/queues/index.ts +13 -0
  1305. package/src/queues/page-analyze-queue.ts +472 -0
  1306. package/src/router.ts +343 -0
  1307. package/src/schemas/creative/index.ts +34 -0
  1308. package/src/schemas/creative/palette.schema.ts +191 -0
  1309. package/src/schemas/mood-brandtone-filters.ts +306 -0
  1310. package/src/scripts/backfill-embeddings.ts +454 -0
  1311. package/src/scripts/check-embedding-coverage.ts +119 -0
  1312. package/src/scripts/start-workers.ts +560 -0
  1313. package/src/server.ts +290 -0
  1314. package/src/services/background/background-design-db.service.ts +206 -0
  1315. package/src/services/background/background-design-detector.service.ts +1442 -0
  1316. package/src/services/background/background-design-embedding.service.ts +599 -0
  1317. package/src/services/background-search.service.ts +372 -0
  1318. package/src/services/backup-service.ts +441 -0
  1319. package/src/services/brief/brief-parser-service.ts +435 -0
  1320. package/src/services/brief/schemas/brief-parser-schemas.ts +138 -0
  1321. package/src/services/browser-process-manager.ts +334 -0
  1322. package/src/services/cache.ts +297 -0
  1323. package/src/services/checksum-service.ts +293 -0
  1324. package/src/services/css-analysis-cache.service.ts +547 -0
  1325. package/src/services/database-dumper.service.ts +675 -0
  1326. package/src/services/embedding-backfill.service.ts +1055 -0
  1327. package/src/services/embedding-validation.service.ts +194 -0
  1328. package/src/services/encryption-service.ts +433 -0
  1329. package/src/services/external-css-fetcher.ts +872 -0
  1330. package/src/services/gpu-resource-manager.ts +615 -0
  1331. package/src/services/index.ts +169 -0
  1332. package/src/services/layout/component-splitter.ts +656 -0
  1333. package/src/services/layout/html-to-jsx-converter.ts +591 -0
  1334. package/src/services/layout/semantic-html-converter.ts +293 -0
  1335. package/src/services/layout/style-to-tailwind-mapper.ts +1530 -0
  1336. package/src/services/layout-embedding.service.ts +1552 -0
  1337. package/src/services/layout-generate-code-service-export.ts +109 -0
  1338. package/src/services/layout-search-service-export.ts +55 -0
  1339. package/src/services/layout-search.service.ts +933 -0
  1340. package/src/services/layout-to-code.service.ts +1631 -0
  1341. package/src/services/metrics-collector.ts +473 -0
  1342. package/src/services/ml/mood-brandtone-embedding.service.ts +1115 -0
  1343. package/src/services/motion/analyzers/color-change.analyzer.ts +935 -0
  1344. package/src/services/motion/analyzers/frame-diff.analyzer.ts +372 -0
  1345. package/src/services/motion/analyzers/layout-shift.detector.ts +296 -0
  1346. package/src/services/motion/analyzers/motion-vector.estimator.ts +698 -0
  1347. package/src/services/motion/analyzers/webgl-motion-analyzer.ts +700 -0
  1348. package/src/services/motion/animation-metrics-collector.service.ts +726 -0
  1349. package/src/services/motion/cls-calculator.service.ts +519 -0
  1350. package/src/services/motion/existing-animation-detector.service.ts +751 -0
  1351. package/src/services/motion/fade-detector.service.ts +383 -0
  1352. package/src/services/motion/frame-analysis-save.helper.ts +333 -0
  1353. package/src/services/motion/frame-capture.service.ts +654 -0
  1354. package/src/services/motion/frame-embedding.service.ts +1419 -0
  1355. package/src/services/motion/frame-image-analysis.service.ts +1271 -0
  1356. package/src/services/motion/frame-image-analyzer.adapter.ts +747 -0
  1357. package/src/services/motion/frame-worker-pool.service.ts +519 -0
  1358. package/src/services/motion/infrastructure/frame-loader.ts +450 -0
  1359. package/src/services/motion/js-animation-detector.ts +1563 -0
  1360. package/src/services/motion/js-animation-embedding.service.ts +423 -0
  1361. package/src/services/motion/js-animation-search.service.ts +715 -0
  1362. package/src/services/motion/motion-db.service.ts +952 -0
  1363. package/src/services/motion/three-js-scene-extractor.ts +1556 -0
  1364. package/src/services/motion/types.ts +820 -0
  1365. package/src/services/motion/visual-category-classifier.ts +1426 -0
  1366. package/src/services/motion/webgl-animation-categorizer.ts +761 -0
  1367. package/src/services/motion/webgl-animation-detector.service.ts +772 -0
  1368. package/src/services/motion/webgl-animation-embedding.service.ts +558 -0
  1369. package/src/services/motion-detect-service-export.ts +300 -0
  1370. package/src/services/motion-persistence.service.ts +541 -0
  1371. package/src/services/motion-search-service.ts +38 -0
  1372. package/src/services/motion-search.service.ts +1159 -0
  1373. package/src/services/narrative/analyzers/layout-structure.analyzer.ts +628 -0
  1374. package/src/services/narrative/analyzers/worldview.analyzer.ts +639 -0
  1375. package/src/services/narrative/generators/confidence-calculator.ts +419 -0
  1376. package/src/services/narrative/generators/text-representation.generator.ts +362 -0
  1377. package/src/services/narrative/index.ts +72 -0
  1378. package/src/services/narrative/narrative-analysis.service.ts +610 -0
  1379. package/src/services/narrative/narrative-search.service.ts +704 -0
  1380. package/src/services/narrative/types/narrative.types.ts +451 -0
  1381. package/src/services/orphaned-job-utils.ts +160 -0
  1382. package/src/services/page/css-animation-parser.service.ts +650 -0
  1383. package/src/services/page/fallback-analyzer.service.ts +435 -0
  1384. package/src/services/page/frame-analyzer.service.ts +824 -0
  1385. package/src/services/page/layout-analyzer.service.ts +2534 -0
  1386. package/src/services/page/motion-category-classifier.service.ts +463 -0
  1387. package/src/services/page/motion-detector.service.ts +430 -0
  1388. package/src/services/page/motion-performance-analyzer.service.ts +390 -0
  1389. package/src/services/page/playwright-crawler.service.ts +478 -0
  1390. package/src/services/page/quality-evaluator.service.ts +1473 -0
  1391. package/src/services/page/runtime-animation-detector.service.ts +743 -0
  1392. package/src/services/page/section-postprocessor.service.ts +874 -0
  1393. package/src/services/page/video-recorder.service.ts +516 -0
  1394. package/src/services/page/webgl-detector.service.ts +361 -0
  1395. package/src/services/page-analyze-service.ts +83 -0
  1396. package/src/services/page-ingest-adapter.ts +2256 -0
  1397. package/src/services/palette-service-export.ts +50 -0
  1398. package/src/services/part/index.ts +81 -0
  1399. package/src/services/part/part-backfill.service.ts +308 -0
  1400. package/src/services/part/part-bbox-playwright.service.ts +502 -0
  1401. package/src/services/part/part-db.service.ts +121 -0
  1402. package/src/services/part/part-embedding-db.service.ts +184 -0
  1403. package/src/services/part/part-embedding.service.ts +406 -0
  1404. package/src/services/part/part-extraction.service.ts +612 -0
  1405. package/src/services/part/part-search.service.ts +806 -0
  1406. package/src/services/part/schemas.ts +194 -0
  1407. package/src/services/part/section-screenshot-fallback.service.ts +644 -0
  1408. package/src/services/part/types.ts +299 -0
  1409. package/src/services/persistent-cache.ts +760 -0
  1410. package/src/services/preference-profile.service.ts +862 -0
  1411. package/src/services/preference-rerank.helper.ts +549 -0
  1412. package/src/services/production-guard.ts +423 -0
  1413. package/src/services/project-context-analyzer.ts +915 -0
  1414. package/src/services/quality/axe-accessibility.service.ts +253 -0
  1415. package/src/services/quality/axe-core-shared.ts +203 -0
  1416. package/src/services/quality/benchmark.service.ts +657 -0
  1417. package/src/services/quality/content-gap-detector.service.ts +485 -0
  1418. package/src/services/quality/index.ts +45 -0
  1419. package/src/services/quality/pattern-matcher.service.ts +941 -0
  1420. package/src/services/quality/playwright-axe.service.ts +343 -0
  1421. package/src/services/quality/quality-evaluate.service.interface.ts +262 -0
  1422. package/src/services/quality/visual-design-analyzer.service.ts +918 -0
  1423. package/src/services/quality-evaluate-service-export.ts +268 -0
  1424. package/src/services/quality-search.service.ts +406 -0
  1425. package/src/services/query-analyzer.ts +306 -0
  1426. package/src/services/query-context-analyzer.ts +843 -0
  1427. package/src/services/queue-cleanup.service.ts +376 -0
  1428. package/src/services/responsive/difference-detector.service.ts +647 -0
  1429. package/src/services/responsive/index.ts +64 -0
  1430. package/src/services/responsive/multi-viewport-capture.service.ts +943 -0
  1431. package/src/services/responsive/responsive-analysis-embedding.service.ts +413 -0
  1432. package/src/services/responsive/responsive-analysis.service.ts +325 -0
  1433. package/src/services/responsive/responsive-persistence.service.ts +133 -0
  1434. package/src/services/responsive/responsive-quality-evaluator.service.ts +515 -0
  1435. package/src/services/responsive/shared-browser-manager.ts +118 -0
  1436. package/src/services/responsive/types.ts +387 -0
  1437. package/src/services/responsive/viewport-diff.service.ts +236 -0
  1438. package/src/services/responsive-search.service.ts +230 -0
  1439. package/src/services/search/mood-brandtone-search.service.ts +400 -0
  1440. package/src/services/search-performance.service.ts +252 -0
  1441. package/src/services/section-screenshot.service.ts +581 -0
  1442. package/src/services/service-client.ts +643 -0
  1443. package/src/services/service-initializer.ts +1386 -0
  1444. package/src/services/storage/index.ts +15 -0
  1445. package/src/services/storage/local-storage.provider.ts +370 -0
  1446. package/src/services/style/index.ts +10 -0
  1447. package/src/services/style/palette-service.ts +655 -0
  1448. package/src/services/style/prisma-palette-repository.ts +216 -0
  1449. package/src/services/vision/brandtone.analyzer.ts +371 -0
  1450. package/src/services/vision/hardware-detector.ts +436 -0
  1451. package/src/services/vision/image-optimizer.ts +377 -0
  1452. package/src/services/vision/index.ts +131 -0
  1453. package/src/services/vision/llama-vision-adapter.ts +526 -0
  1454. package/src/services/vision/mcp-progress-adapter.ts +221 -0
  1455. package/src/services/vision/mood.analyzer.ts +332 -0
  1456. package/src/services/vision/ollama-readiness-probe.ts +271 -0
  1457. package/src/services/vision/ollama-vision-client.ts +631 -0
  1458. package/src/services/vision/progress-reporter.ts +377 -0
  1459. package/src/services/vision/scroll-vision-capture.service.ts +409 -0
  1460. package/src/services/vision/scroll-vision-persistence.service.ts +216 -0
  1461. package/src/services/vision/scroll-vision.analyzer.ts +416 -0
  1462. package/src/services/vision/theme.analyzer.ts +443 -0
  1463. package/src/services/vision/timeout-calculator.ts +155 -0
  1464. package/src/services/vision/vision-fallback.service.ts +368 -0
  1465. package/src/services/vision/vision.cache.ts +332 -0
  1466. package/src/services/vision/vision.errors.ts +186 -0
  1467. package/src/services/vision/vision.prompts.ts +298 -0
  1468. package/src/services/vision/vram-utils.ts +80 -0
  1469. package/src/services/vision-adapter/index.ts +71 -0
  1470. package/src/services/vision-adapter/interface.ts +911 -0
  1471. package/src/services/vision-adapter/llama-vision.adapter.ts +2254 -0
  1472. package/src/services/vision-adapter/llama-vision.prompts.ts +242 -0
  1473. package/src/services/vision-adapter/llama-vision.types.ts +103 -0
  1474. package/src/services/vision-adapter/local.adapter.ts +1079 -0
  1475. package/src/services/vision-adapter/mock.adapter.ts +978 -0
  1476. package/src/services/vision-embedding-search.service.ts +1071 -0
  1477. package/src/services/vision-embedding.service.ts +631 -0
  1478. package/src/services/visual/css-variable-extractor.service.ts +655 -0
  1479. package/src/services/visual/typography-extractor.service.ts +767 -0
  1480. package/src/services/visual-extractor/color-extractor.service.ts +397 -0
  1481. package/src/services/visual-extractor/density-calculator.service.ts +616 -0
  1482. package/src/services/visual-extractor/gradient-detector.service.ts +1794 -0
  1483. package/src/services/visual-extractor/image-utils.ts +333 -0
  1484. package/src/services/visual-extractor/pixel-theme-detector.service.ts +487 -0
  1485. package/src/services/visual-extractor/theme-detector.service.ts +697 -0
  1486. package/src/services/visual-extractor/visual-decoration-detector.service.ts +800 -0
  1487. package/src/services/visual-extractor/visual-feature-merger.service.ts +831 -0
  1488. package/src/services/web-page.service.ts +275 -0
  1489. package/src/services/worker-constants.ts +52 -0
  1490. package/src/services/worker-db-save.service.ts +1098 -0
  1491. package/src/services/worker-memory-monitor.service.ts +126 -0
  1492. package/src/services/worker-memory-profile.ts +336 -0
  1493. package/src/services/worker-stall-recovery.service.ts +486 -0
  1494. package/src/services/worker-supervisor.service.ts +746 -0
  1495. package/src/tools/background/schemas.ts +93 -0
  1496. package/src/tools/background/search.tool.ts +484 -0
  1497. package/src/tools/brief/index.ts +76 -0
  1498. package/src/tools/brief/schemas.ts +247 -0
  1499. package/src/tools/brief/validate.handler.ts +278 -0
  1500. package/src/tools/brief/validate.service.ts +409 -0
  1501. package/src/tools/common/error-codes.ts +116 -0
  1502. package/src/tools/common/index.ts +25 -0
  1503. package/src/tools/index.ts +723 -0
  1504. package/src/tools/layout/batch-ingest.tool.ts +466 -0
  1505. package/src/tools/layout/index.ts +72 -0
  1506. package/src/tools/layout/ingest.tool.ts +1564 -0
  1507. package/src/tools/layout/inspect/index.ts +49 -0
  1508. package/src/tools/layout/inspect/inspect.schemas.ts +518 -0
  1509. package/src/tools/layout/inspect/inspect.tool.ts +844 -0
  1510. package/src/tools/layout/inspect/inspect.utils.ts +1278 -0
  1511. package/src/tools/layout/inspect/visual-extractors.schemas.ts +642 -0
  1512. package/src/tools/layout/inspect/visual-extractors.utils.ts +328 -0
  1513. package/src/tools/layout/schemas.ts +1670 -0
  1514. package/src/tools/layout/search.tool.ts +2088 -0
  1515. package/src/tools/layout/to-code.tool.ts +503 -0
  1516. package/src/tools/motion/analyze-frames.handler.ts +388 -0
  1517. package/src/tools/motion/analyze-frames.schema.ts +484 -0
  1518. package/src/tools/motion/css-mode-handler.ts +939 -0
  1519. package/src/tools/motion/detect.schemas.ts +2005 -0
  1520. package/src/tools/motion/detect.tool.ts +1914 -0
  1521. package/src/tools/motion/detection-modes.ts +480 -0
  1522. package/src/tools/motion/di-factories.ts +767 -0
  1523. package/src/tools/motion/index.ts +229 -0
  1524. package/src/tools/motion/pattern-converter.ts +619 -0
  1525. package/src/tools/motion/schemas.ts +12 -0
  1526. package/src/tools/motion/search.schemas.ts +694 -0
  1527. package/src/tools/motion/search.tool.ts +2518 -0
  1528. package/src/tools/motion/shared.schemas.ts +414 -0
  1529. package/src/tools/narrative/PAGE_ANALYZE_INTEGRATION.md +249 -0
  1530. package/src/tools/narrative/analyze.tool.ts +460 -0
  1531. package/src/tools/narrative/index.ts +133 -0
  1532. package/src/tools/narrative/schemas.ts +886 -0
  1533. package/src/tools/narrative/search.tool.ts +536 -0
  1534. package/src/tools/page/analyze.tool.ts +992 -0
  1535. package/src/tools/page/get-job-status.tool.ts +217 -0
  1536. package/src/tools/page/handlers/db-handler.ts +638 -0
  1537. package/src/tools/page/handlers/embedding-handler.ts +813 -0
  1538. package/src/tools/page/handlers/execution-status-tracker.ts +461 -0
  1539. package/src/tools/page/handlers/js-animation-handler.ts +1229 -0
  1540. package/src/tools/page/handlers/layout-handler.ts +1423 -0
  1541. package/src/tools/page/handlers/motion-handler.ts +1156 -0
  1542. package/src/tools/page/handlers/narrative-handler.ts +345 -0
  1543. package/src/tools/page/handlers/phased-db-handler.ts +186 -0
  1544. package/src/tools/page/handlers/phased-executor.ts +356 -0
  1545. package/src/tools/page/handlers/quality-handler.ts +114 -0
  1546. package/src/tools/page/handlers/result-builder.ts +551 -0
  1547. package/src/tools/page/handlers/retry-strategy.ts +223 -0
  1548. package/src/tools/page/handlers/sync-processing.ts +2084 -0
  1549. package/src/tools/page/handlers/timeout-utils.ts +835 -0
  1550. package/src/tools/page/handlers/types.ts +1333 -0
  1551. package/src/tools/page/handlers/video-handler.ts +299 -0
  1552. package/src/tools/page/handlers/webgl-animation-handler.ts +309 -0
  1553. package/src/tools/page/handlers/webgl-detector.ts +833 -0
  1554. package/src/tools/page/handlers/webgl-domains.ts +482 -0
  1555. package/src/tools/page/handlers/webgl-pre-detector.ts +308 -0
  1556. package/src/tools/page/index.ts +142 -0
  1557. package/src/tools/page/input.schemas.ts +945 -0
  1558. package/src/tools/page/output.schemas.ts +1636 -0
  1559. package/src/tools/page/schemas.ts +12 -0
  1560. package/src/tools/page/shared.schemas.ts +86 -0
  1561. package/src/tools/part/compare.tool.ts +542 -0
  1562. package/src/tools/part/inspect.tool.ts +400 -0
  1563. package/src/tools/part/search.tool.ts +470 -0
  1564. package/src/tools/preference/get.tool.ts +238 -0
  1565. package/src/tools/preference/hear.tool.ts +504 -0
  1566. package/src/tools/preference/index.ts +65 -0
  1567. package/src/tools/preference/reset.tool.ts +264 -0
  1568. package/src/tools/preference/schemas.ts +161 -0
  1569. package/src/tools/project-get.ts +194 -0
  1570. package/src/tools/project-list.ts +240 -0
  1571. package/src/tools/quality/batch-evaluate.tool.ts +480 -0
  1572. package/src/tools/quality/evaluate-engine.ts +1329 -0
  1573. package/src/tools/quality/evaluate.tool.ts +981 -0
  1574. package/src/tools/quality/get-job-status.tool.ts +344 -0
  1575. package/src/tools/quality/improvement-utils.ts +361 -0
  1576. package/src/tools/quality/index.ts +49 -0
  1577. package/src/tools/quality/schemas.ts +1114 -0
  1578. package/src/tools/responsive/schemas.ts +103 -0
  1579. package/src/tools/responsive/search.tool.ts +421 -0
  1580. package/src/tools/schemas/index.ts +67 -0
  1581. package/src/tools/schemas/layout-schemas.ts +334 -0
  1582. package/src/tools/schemas/project-schemas.ts +233 -0
  1583. package/src/tools/schemas/shared.ts +176 -0
  1584. package/src/tools/schemas/style-schemas.ts +74 -0
  1585. package/src/tools/style-get-palette.ts +344 -0
  1586. package/src/tools/system-health.ts +729 -0
  1587. package/src/transport.ts +54 -0
  1588. package/src/types/creative/index.ts +22 -0
  1589. package/src/types/creative/palette.ts +197 -0
  1590. package/src/types/reftrix-window.ts +175 -0
  1591. package/src/utils/actionable-warning.ts +997 -0
  1592. package/src/utils/blank-image-detector.ts +143 -0
  1593. package/src/utils/color.ts +534 -0
  1594. package/src/utils/deprecation-warning.ts +146 -0
  1595. package/src/utils/error-messages.ts +965 -0
  1596. package/src/utils/errors.ts +95 -0
  1597. package/src/utils/gpu-browser-args.ts +41 -0
  1598. package/src/utils/html-sanitizer.ts +753 -0
  1599. package/src/utils/logger.ts +292 -0
  1600. package/src/utils/mcp-response.ts +397 -0
  1601. package/src/utils/path-security.ts +412 -0
  1602. package/src/utils/prisma-wrapper-factory.ts +283 -0
  1603. package/src/utils/safe-parse-int.ts +74 -0
  1604. package/src/utils/url-normalizer.ts +115 -0
  1605. package/src/utils/url-validator.ts +615 -0
  1606. package/src/workers/batch-quality-worker.ts +419 -0
  1607. package/src/workers/page-analyze-worker.ts +1056 -0
  1608. package/src/workers/phases/phase-0-ingest.ts +249 -0
  1609. package/src/workers/phases/phase-1-layout.ts +522 -0
  1610. package/src/workers/phases/phase-2-motion.ts +674 -0
  1611. package/src/workers/phases/phase-3-quality.ts +293 -0
  1612. package/src/workers/phases/phase-4-narrative.ts +409 -0
  1613. package/src/workers/phases/phase-5-embedding.ts +1816 -0
  1614. package/src/workers/phases/types.ts +909 -0
@@ -0,0 +1,2088 @@
1
+ "use strict";
2
+ // SPDX-FileCopyrightText: 2026 TKMD and Reftrix Contributors
3
+ // SPDX-License-Identifier: AGPL-3.0-only
4
+ Object.defineProperty(exports, "__esModule", { value: true });
5
+ exports.motionSearchToolDefinition = void 0;
6
+ exports.setMotionSearchServiceFactory = setMotionSearchServiceFactory;
7
+ exports.resetMotionSearchServiceFactory = resetMotionSearchServiceFactory;
8
+ exports.setMotionImplementationServiceFactory = setMotionImplementationServiceFactory;
9
+ exports.resetMotionImplementationServiceFactory = resetMotionImplementationServiceFactory;
10
+ exports.setMotionSearchPrismaClientFactory = setMotionSearchPrismaClientFactory;
11
+ exports.resetMotionSearchPrismaClientFactory = resetMotionSearchPrismaClientFactory;
12
+ exports.motionSearchHandler = motionSearchHandler;
13
+ /**
14
+ * motion.search MCPツール
15
+ * モーションパターンを類似検索します
16
+ *
17
+ * 機能:
18
+ * - 自然言語クエリによる検索
19
+ * - サンプルパターンによる類似検索
20
+ * - フィルタリング(タイプ、duration範囲、トリガー)
21
+ * - 類似度しきい値によるフィルタリング
22
+ * - Phase3-3: コード生成機能の統合(action: 'generate')
23
+ *
24
+ * @module tools/motion/search.tool
25
+ */
26
+ const logger_1 = require("../../utils/logger");
27
+ const schemas_1 = require("./schemas");
28
+ const existing_animation_detector_service_1 = require("../../services/motion/existing-animation-detector.service");
29
+ const preference_rerank_helper_1 = require("../../services/preference-rerank.helper");
30
+ let serviceFactory = null;
31
+ let implementationServiceFactory = null;
32
+ /**
33
+ * サービスファクトリを設定
34
+ */
35
+ function setMotionSearchServiceFactory(factory) {
36
+ serviceFactory = factory;
37
+ }
38
+ /**
39
+ * サービスファクトリをリセット
40
+ */
41
+ function resetMotionSearchServiceFactory() {
42
+ serviceFactory = null;
43
+ }
44
+ /**
45
+ * コード生成サービスファクトリを設定(Phase3-3統合用)
46
+ */
47
+ function setMotionImplementationServiceFactory(factory) {
48
+ implementationServiceFactory = factory;
49
+ }
50
+ /**
51
+ * コード生成サービスファクトリをリセット
52
+ */
53
+ function resetMotionImplementationServiceFactory() {
54
+ implementationServiceFactory = null;
55
+ }
56
+ /**
57
+ * PrismaClientファクトリー(嗜好リランキング用DI)
58
+ * PrismaClient factory (DI for preference reranking)
59
+ */
60
+ let prismaClientFactory = null;
61
+ /**
62
+ * PrismaClientファクトリーを設定(嗜好リランキング用)
63
+ * Set PrismaClient factory (for preference reranking)
64
+ */
65
+ function setMotionSearchPrismaClientFactory(factory) {
66
+ prismaClientFactory = factory;
67
+ }
68
+ /**
69
+ * PrismaClientファクトリーをリセット(テスト用)
70
+ * Reset PrismaClient factory (for testing)
71
+ */
72
+ function resetMotionSearchPrismaClientFactory() {
73
+ prismaClientFactory = null;
74
+ }
75
+ // =====================================================
76
+ // デフォルトコード生成実装(Phase3-3統合用)
77
+ // =====================================================
78
+ /**
79
+ * ミリ秒をCSS時間単位に変換
80
+ */
81
+ function formatDuration(ms) {
82
+ if (ms >= 1000 && ms % 1000 === 0) {
83
+ return `${ms / 1000}s`;
84
+ }
85
+ return `${ms}ms`;
86
+ }
87
+ /**
88
+ * キーフレームのパーセンテージを計算
89
+ */
90
+ function offsetToPercent(offset) {
91
+ return `${Math.round(offset * 100)}%`;
92
+ }
93
+ /**
94
+ * 行数をカウント
95
+ */
96
+ function countLines(code) {
97
+ return code.split("\n").length;
98
+ }
99
+ /**
100
+ * PascalCaseに変換
101
+ */
102
+ function toPascalCase(str) {
103
+ return str.replace(/[-_](\w)/g, (_, c) => c.toUpperCase()).replace(/^\w/, (c) => c.toUpperCase());
104
+ }
105
+ /**
106
+ * CSS生成
107
+ */
108
+ function generateCSS(pattern, options) {
109
+ const lines = [];
110
+ const selector = options.selector || ".animated";
111
+ const hasKeyframes = pattern.properties.some((p) => p.keyframes && p.keyframes.length > 0);
112
+ // @keyframes 生成
113
+ if (pattern.type !== "transition") {
114
+ lines.push(`@keyframes ${pattern.name} {`);
115
+ if (hasKeyframes) {
116
+ const allOffsets = new Set();
117
+ pattern.properties.forEach((prop) => {
118
+ prop.keyframes?.forEach((kf) => allOffsets.add(kf.offset));
119
+ });
120
+ allOffsets.add(0);
121
+ allOffsets.add(1);
122
+ const sortedOffsets = Array.from(allOffsets).sort((a, b) => a - b);
123
+ for (const offset of sortedOffsets) {
124
+ lines.push(` ${offsetToPercent(offset)} {`);
125
+ for (const prop of pattern.properties) {
126
+ const kf = prop.keyframes?.find((k) => k.offset === offset);
127
+ if (kf) {
128
+ lines.push(` ${prop.name}: ${kf.value};`);
129
+ }
130
+ else if (offset === 0) {
131
+ lines.push(` ${prop.name}: ${prop.from};`);
132
+ }
133
+ else if (offset === 1) {
134
+ lines.push(` ${prop.name}: ${prop.to};`);
135
+ }
136
+ }
137
+ lines.push(" }");
138
+ }
139
+ }
140
+ else {
141
+ lines.push(" from {");
142
+ for (const prop of pattern.properties) {
143
+ lines.push(` ${prop.name}: ${prop.from};`);
144
+ }
145
+ lines.push(" }");
146
+ lines.push(" to {");
147
+ for (const prop of pattern.properties) {
148
+ lines.push(` ${prop.name}: ${prop.to};`);
149
+ }
150
+ lines.push(" }");
151
+ }
152
+ lines.push("}");
153
+ lines.push("");
154
+ // ベンダープレフィックス
155
+ if (options.includeVendorPrefixes) {
156
+ lines.push(`@-webkit-keyframes ${pattern.name} {`);
157
+ if (hasKeyframes) {
158
+ const allOffsets = new Set();
159
+ pattern.properties.forEach((prop) => {
160
+ prop.keyframes?.forEach((kf) => allOffsets.add(kf.offset));
161
+ });
162
+ allOffsets.add(0);
163
+ allOffsets.add(1);
164
+ const sortedOffsets = Array.from(allOffsets).sort((a, b) => a - b);
165
+ for (const offset of sortedOffsets) {
166
+ lines.push(` ${offsetToPercent(offset)} {`);
167
+ for (const prop of pattern.properties) {
168
+ const kf = prop.keyframes?.find((k) => k.offset === offset);
169
+ if (kf) {
170
+ lines.push(` ${prop.name}: ${kf.value};`);
171
+ }
172
+ else if (offset === 0) {
173
+ lines.push(` ${prop.name}: ${prop.from};`);
174
+ }
175
+ else if (offset === 1) {
176
+ lines.push(` ${prop.name}: ${prop.to};`);
177
+ }
178
+ }
179
+ lines.push(" }");
180
+ }
181
+ }
182
+ else {
183
+ lines.push(" from {");
184
+ for (const prop of pattern.properties) {
185
+ lines.push(` ${prop.name}: ${prop.from};`);
186
+ }
187
+ lines.push(" }");
188
+ lines.push(" to {");
189
+ for (const prop of pattern.properties) {
190
+ lines.push(` ${prop.name}: ${prop.to};`);
191
+ }
192
+ lines.push(" }");
193
+ }
194
+ lines.push("}");
195
+ lines.push("");
196
+ }
197
+ }
198
+ // セレクタルール
199
+ lines.push(`${selector} {`);
200
+ if (pattern.type === "transition") {
201
+ const props = pattern.properties.map((p) => p.name).join(", ");
202
+ lines.push(` transition: ${props} ${formatDuration(pattern.duration)} ${pattern.easing};`);
203
+ if (options.includeVendorPrefixes) {
204
+ lines.push(` -webkit-transition: ${props} ${formatDuration(pattern.duration)} ${pattern.easing};`);
205
+ }
206
+ }
207
+ else {
208
+ const iterations = pattern.iterations === "infinite" ? "infinite" : pattern.iterations;
209
+ const animationValue = [
210
+ pattern.name,
211
+ formatDuration(pattern.duration),
212
+ pattern.easing,
213
+ pattern.delay > 0 ? formatDuration(pattern.delay) : null,
214
+ iterations !== 1 ? iterations : null,
215
+ pattern.direction !== "normal" ? pattern.direction : null,
216
+ pattern.fillMode !== "none" ? pattern.fillMode : null,
217
+ ]
218
+ .filter(Boolean)
219
+ .join(" ");
220
+ lines.push(` animation: ${animationValue};`);
221
+ if (options.includeVendorPrefixes) {
222
+ lines.push(` -webkit-animation: ${animationValue};`);
223
+ }
224
+ }
225
+ lines.push("}");
226
+ // hover/scroll タイプの追加ルール
227
+ if (pattern.type === "hover") {
228
+ lines.push("");
229
+ lines.push(`${selector}:hover {`);
230
+ for (const prop of pattern.properties) {
231
+ lines.push(` ${prop.name}: ${prop.to};`);
232
+ }
233
+ lines.push("}");
234
+ }
235
+ // prefers-reduced-motion
236
+ if (options.includeReducedMotion) {
237
+ lines.push("");
238
+ lines.push("@media (prefers-reduced-motion: reduce) {");
239
+ lines.push(` ${selector} {`);
240
+ if (pattern.type === "transition") {
241
+ lines.push(" transition: none;");
242
+ }
243
+ else {
244
+ lines.push(" animation: none;");
245
+ }
246
+ lines.push(" }");
247
+ lines.push("}");
248
+ }
249
+ const code = lines.join("\n");
250
+ return {
251
+ code,
252
+ metadata: {
253
+ linesOfCode: countLines(code),
254
+ hasKeyframes: pattern.type !== "transition",
255
+ hasReducedMotion: options.includeReducedMotion ?? true,
256
+ dependencies: [],
257
+ },
258
+ };
259
+ }
260
+ /**
261
+ * CSS Module生成
262
+ */
263
+ function generateCSSModule(pattern, options) {
264
+ const result = generateCSS(pattern, {
265
+ ...options,
266
+ selector: `.${pattern.name}`,
267
+ });
268
+ return {
269
+ ...result,
270
+ metadata: {
271
+ ...result.metadata,
272
+ dependencies: [],
273
+ },
274
+ };
275
+ }
276
+ /**
277
+ * Tailwind生成
278
+ */
279
+ function generateTailwind(pattern, options) {
280
+ const lines = [];
281
+ lines.push("/* Add to tailwind.config.js */");
282
+ lines.push("module.exports = {");
283
+ lines.push(" theme: {");
284
+ lines.push(" extend: {");
285
+ lines.push(" animation: {");
286
+ const iterations = pattern.iterations === "infinite" ? "infinite" : "";
287
+ const direction = pattern.direction !== "normal" ? pattern.direction : "";
288
+ lines.push(` '${pattern.name}': '${pattern.name} ${formatDuration(pattern.duration)} ${pattern.easing} ${iterations} ${direction}'.trim(),`);
289
+ lines.push(" },");
290
+ lines.push(" keyframes: {");
291
+ lines.push(` '${pattern.name}': {`);
292
+ if (pattern.properties.some((p) => p.keyframes && p.keyframes.length > 0)) {
293
+ const allOffsets = new Set();
294
+ pattern.properties.forEach((prop) => {
295
+ prop.keyframes?.forEach((kf) => allOffsets.add(kf.offset));
296
+ });
297
+ allOffsets.add(0);
298
+ allOffsets.add(1);
299
+ const sortedOffsets = Array.from(allOffsets).sort((a, b) => a - b);
300
+ for (const offset of sortedOffsets) {
301
+ lines.push(` '${offsetToPercent(offset)}': {`);
302
+ for (const prop of pattern.properties) {
303
+ const kf = prop.keyframes?.find((k) => k.offset === offset);
304
+ if (kf) {
305
+ lines.push(` ${prop.name}: '${kf.value}',`);
306
+ }
307
+ else if (offset === 0) {
308
+ lines.push(` ${prop.name}: '${prop.from}',`);
309
+ }
310
+ else if (offset === 1) {
311
+ lines.push(` ${prop.name}: '${prop.to}',`);
312
+ }
313
+ }
314
+ lines.push(" },");
315
+ }
316
+ }
317
+ else {
318
+ lines.push(" '0%': {");
319
+ for (const prop of pattern.properties) {
320
+ lines.push(` ${prop.name}: '${prop.from}',`);
321
+ }
322
+ lines.push(" },");
323
+ lines.push(" '100%': {");
324
+ for (const prop of pattern.properties) {
325
+ lines.push(` ${prop.name}: '${prop.to}',`);
326
+ }
327
+ lines.push(" },");
328
+ }
329
+ lines.push(" },");
330
+ lines.push(" },");
331
+ lines.push(" },");
332
+ lines.push(" },");
333
+ lines.push("};");
334
+ lines.push("");
335
+ lines.push("/* Usage in JSX */");
336
+ lines.push(`<div className="animate-${pattern.name}">Content</div>`);
337
+ if (options.includeReducedMotion) {
338
+ lines.push("");
339
+ lines.push("/* For reduced motion support */");
340
+ lines.push(`<div className="animate-${pattern.name} motion-reduce:animate-none">Content</div>`);
341
+ }
342
+ const code = lines.join("\n");
343
+ return {
344
+ code,
345
+ metadata: {
346
+ linesOfCode: countLines(code),
347
+ hasKeyframes: true,
348
+ hasReducedMotion: options.includeReducedMotion ?? true,
349
+ dependencies: ["tailwindcss"],
350
+ },
351
+ };
352
+ }
353
+ /**
354
+ * styled-components生成
355
+ */
356
+ function generateStyledComponents(pattern, options) {
357
+ const lines = [];
358
+ const componentName = options.componentName || toPascalCase(pattern.name) + "Animation";
359
+ const ts = options.typescript ?? true;
360
+ lines.push("import styled, { keyframes } from 'styled-components';");
361
+ if (ts) {
362
+ lines.push("import type { FC, ReactNode } from 'react';");
363
+ }
364
+ lines.push("");
365
+ lines.push(`const ${pattern.name}Keyframes = keyframes\``);
366
+ if (pattern.properties.some((p) => p.keyframes && p.keyframes.length > 0)) {
367
+ const allOffsets = new Set();
368
+ pattern.properties.forEach((prop) => {
369
+ prop.keyframes?.forEach((kf) => allOffsets.add(kf.offset));
370
+ });
371
+ allOffsets.add(0);
372
+ allOffsets.add(1);
373
+ const sortedOffsets = Array.from(allOffsets).sort((a, b) => a - b);
374
+ for (const offset of sortedOffsets) {
375
+ lines.push(` ${offsetToPercent(offset)} {`);
376
+ for (const prop of pattern.properties) {
377
+ const kf = prop.keyframes?.find((k) => k.offset === offset);
378
+ if (kf) {
379
+ lines.push(` ${prop.name}: ${kf.value};`);
380
+ }
381
+ else if (offset === 0) {
382
+ lines.push(` ${prop.name}: ${prop.from};`);
383
+ }
384
+ else if (offset === 1) {
385
+ lines.push(` ${prop.name}: ${prop.to};`);
386
+ }
387
+ }
388
+ lines.push(" }");
389
+ }
390
+ }
391
+ else {
392
+ lines.push(" from {");
393
+ for (const prop of pattern.properties) {
394
+ lines.push(` ${prop.name}: ${prop.from};`);
395
+ }
396
+ lines.push(" }");
397
+ lines.push(" to {");
398
+ for (const prop of pattern.properties) {
399
+ lines.push(` ${prop.name}: ${prop.to};`);
400
+ }
401
+ lines.push(" }");
402
+ }
403
+ lines.push("`;");
404
+ lines.push("");
405
+ const iterationsVal = pattern.iterations === "infinite" ? "infinite" : pattern.iterations;
406
+ const directionVal = pattern.direction !== "normal" ? pattern.direction : "";
407
+ const fillModeVal = pattern.fillMode !== "none" ? pattern.fillMode : "";
408
+ lines.push(`const ${componentName}Container = styled.div\``);
409
+ lines.push(` animation: \${${pattern.name}Keyframes} ${formatDuration(pattern.duration)} ${pattern.easing}${pattern.delay > 0 ? ` ${formatDuration(pattern.delay)}` : ""}${iterationsVal !== 1 ? ` ${iterationsVal}` : ""}${directionVal ? ` ${directionVal}` : ""}${fillModeVal ? ` ${fillModeVal}` : ""};`);
410
+ if (options.includeReducedMotion) {
411
+ lines.push("");
412
+ lines.push(" @media (prefers-reduced-motion: reduce) {");
413
+ lines.push(" animation: none;");
414
+ lines.push(" }");
415
+ }
416
+ lines.push("`;");
417
+ lines.push("");
418
+ if (ts) {
419
+ lines.push(`interface ${componentName}Props {`);
420
+ lines.push(" children: ReactNode;");
421
+ lines.push(" className?: string;");
422
+ lines.push("}");
423
+ lines.push("");
424
+ lines.push(`export const ${componentName}: FC<${componentName}Props> = ({ children, className }) => {`);
425
+ }
426
+ else {
427
+ lines.push(`export const ${componentName} = ({ children, className }) => {`);
428
+ }
429
+ lines.push(` return <${componentName}Container className={className}>{children}</${componentName}Container>;`);
430
+ lines.push("};");
431
+ const code = lines.join("\n");
432
+ return {
433
+ code,
434
+ metadata: {
435
+ linesOfCode: countLines(code),
436
+ hasKeyframes: true,
437
+ hasReducedMotion: options.includeReducedMotion ?? true,
438
+ dependencies: ["styled-components"],
439
+ },
440
+ };
441
+ }
442
+ /**
443
+ * Emotion生成
444
+ */
445
+ function generateEmotion(pattern, options) {
446
+ const lines = [];
447
+ const componentName = options.componentName || toPascalCase(pattern.name) + "Animation";
448
+ const ts = options.typescript ?? true;
449
+ lines.push("/** @jsxImportSource @emotion/react */");
450
+ lines.push("import { css, keyframes } from '@emotion/react';");
451
+ if (ts) {
452
+ lines.push("import type { FC, ReactNode } from 'react';");
453
+ }
454
+ lines.push("");
455
+ lines.push(`const ${pattern.name}Keyframes = keyframes\``);
456
+ if (pattern.properties.some((p) => p.keyframes && p.keyframes.length > 0)) {
457
+ const allOffsets = new Set();
458
+ pattern.properties.forEach((prop) => {
459
+ prop.keyframes?.forEach((kf) => allOffsets.add(kf.offset));
460
+ });
461
+ allOffsets.add(0);
462
+ allOffsets.add(1);
463
+ const sortedOffsets = Array.from(allOffsets).sort((a, b) => a - b);
464
+ for (const offset of sortedOffsets) {
465
+ lines.push(` ${offsetToPercent(offset)} {`);
466
+ for (const prop of pattern.properties) {
467
+ const kf = prop.keyframes?.find((k) => k.offset === offset);
468
+ if (kf) {
469
+ lines.push(` ${prop.name}: ${kf.value};`);
470
+ }
471
+ else if (offset === 0) {
472
+ lines.push(` ${prop.name}: ${prop.from};`);
473
+ }
474
+ else if (offset === 1) {
475
+ lines.push(` ${prop.name}: ${prop.to};`);
476
+ }
477
+ }
478
+ lines.push(" }");
479
+ }
480
+ }
481
+ else {
482
+ lines.push(" from {");
483
+ for (const prop of pattern.properties) {
484
+ lines.push(` ${prop.name}: ${prop.from};`);
485
+ }
486
+ lines.push(" }");
487
+ lines.push(" to {");
488
+ for (const prop of pattern.properties) {
489
+ lines.push(` ${prop.name}: ${prop.to};`);
490
+ }
491
+ lines.push(" }");
492
+ }
493
+ lines.push("`;");
494
+ lines.push("");
495
+ const iterationsVal = pattern.iterations === "infinite" ? "infinite" : pattern.iterations;
496
+ const directionVal = pattern.direction !== "normal" ? pattern.direction : "";
497
+ const fillModeVal = pattern.fillMode !== "none" ? pattern.fillMode : "";
498
+ lines.push(`const ${pattern.name}Style = css\``);
499
+ lines.push(` animation: \${${pattern.name}Keyframes} ${formatDuration(pattern.duration)} ${pattern.easing}${pattern.delay > 0 ? ` ${formatDuration(pattern.delay)}` : ""}${iterationsVal !== 1 ? ` ${iterationsVal}` : ""}${directionVal ? ` ${directionVal}` : ""}${fillModeVal ? ` ${fillModeVal}` : ""};`);
500
+ if (options.includeReducedMotion) {
501
+ lines.push("");
502
+ lines.push(" @media (prefers-reduced-motion: reduce) {");
503
+ lines.push(" animation: none;");
504
+ lines.push(" }");
505
+ }
506
+ lines.push("`;");
507
+ lines.push("");
508
+ if (ts) {
509
+ lines.push(`interface ${componentName}Props {`);
510
+ lines.push(" children: ReactNode;");
511
+ lines.push(" className?: string;");
512
+ lines.push("}");
513
+ lines.push("");
514
+ lines.push(`export const ${componentName}: FC<${componentName}Props> = ({ children, className }) => {`);
515
+ }
516
+ else {
517
+ lines.push(`export const ${componentName} = ({ children, className }) => {`);
518
+ }
519
+ lines.push(` return <div css={${pattern.name}Style} className={className}>{children}</div>;`);
520
+ lines.push("};");
521
+ const code = lines.join("\n");
522
+ return {
523
+ code,
524
+ metadata: {
525
+ linesOfCode: countLines(code),
526
+ hasKeyframes: true,
527
+ hasReducedMotion: options.includeReducedMotion ?? true,
528
+ dependencies: ["@emotion/react"],
529
+ },
530
+ };
531
+ }
532
+ /**
533
+ * Framer Motion生成
534
+ */
535
+ function generateFramerMotion(pattern, options) {
536
+ const lines = [];
537
+ const componentName = options.componentName || toPascalCase(pattern.name) + "Motion";
538
+ const ts = options.typescript ?? true;
539
+ const isScroll = pattern.type === "scroll";
540
+ lines.push("import { motion } from 'framer-motion';");
541
+ if (ts) {
542
+ lines.push("import type { FC, ReactNode } from 'react';");
543
+ }
544
+ lines.push("");
545
+ lines.push(`const ${pattern.name}Variants = {`);
546
+ lines.push(" initial: {");
547
+ for (const prop of pattern.properties) {
548
+ const cssName = prop.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
549
+ lines.push(` ${cssName}: ${JSON.stringify(prop.from)},`);
550
+ }
551
+ lines.push(" },");
552
+ lines.push(" animate: {");
553
+ for (const prop of pattern.properties) {
554
+ const cssName = prop.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
555
+ lines.push(` ${cssName}: ${JSON.stringify(prop.to)},`);
556
+ }
557
+ lines.push(" },");
558
+ lines.push("};");
559
+ lines.push("");
560
+ lines.push(`const ${pattern.name}Transition = {`);
561
+ lines.push(` duration: ${pattern.duration / 1000},`);
562
+ lines.push(` ease: ${JSON.stringify(pattern.easing)},`);
563
+ if (pattern.delay > 0) {
564
+ lines.push(` delay: ${pattern.delay / 1000},`);
565
+ }
566
+ if (pattern.iterations === "infinite") {
567
+ lines.push(" repeat: Infinity,");
568
+ }
569
+ else if (pattern.iterations > 1) {
570
+ lines.push(` repeat: ${pattern.iterations - 1},`);
571
+ }
572
+ if (pattern.direction === "alternate" || pattern.direction === "alternate-reverse") {
573
+ lines.push(" repeatType: 'reverse',");
574
+ }
575
+ lines.push("};");
576
+ lines.push("");
577
+ if (ts) {
578
+ lines.push(`interface ${componentName}Props {`);
579
+ lines.push(" children: ReactNode;");
580
+ lines.push(" className?: string;");
581
+ lines.push("}");
582
+ lines.push("");
583
+ lines.push(`export const ${componentName}: FC<${componentName}Props> = ({ children, className }) => {`);
584
+ }
585
+ else {
586
+ lines.push(`export const ${componentName} = ({ children, className }) => {`);
587
+ }
588
+ lines.push(" return (");
589
+ lines.push(" <motion.div");
590
+ lines.push(` variants={${pattern.name}Variants}`);
591
+ lines.push(' initial="initial"');
592
+ if (isScroll) {
593
+ lines.push(' whileInView="animate"');
594
+ lines.push(" viewport={{ once: true }}");
595
+ }
596
+ else {
597
+ lines.push(' animate="animate"');
598
+ }
599
+ lines.push(` transition={${pattern.name}Transition}`);
600
+ lines.push(" className={className}");
601
+ lines.push(" >");
602
+ lines.push(" {children}");
603
+ lines.push(" </motion.div>");
604
+ lines.push(" );");
605
+ lines.push("};");
606
+ if (options.includeReducedMotion) {
607
+ lines.push("");
608
+ lines.push("/* Note: Framer Motion automatically respects prefers-reduced-motion */");
609
+ lines.push('/* Set reducedMotion="user" in AnimatePresence or MotionConfig for custom handling */');
610
+ }
611
+ const code = lines.join("\n");
612
+ return {
613
+ code,
614
+ metadata: {
615
+ linesOfCode: countLines(code),
616
+ hasKeyframes: false,
617
+ hasReducedMotion: options.includeReducedMotion ?? true,
618
+ dependencies: ["framer-motion"],
619
+ },
620
+ };
621
+ }
622
+ /**
623
+ * GSAP生成
624
+ */
625
+ function generateGSAP(pattern, options) {
626
+ const lines = [];
627
+ const componentName = options.componentName || toPascalCase(pattern.name) + "GSAP";
628
+ const ts = options.typescript ?? true;
629
+ const isScroll = pattern.type === "scroll";
630
+ lines.push("import { gsap } from 'gsap';");
631
+ if (isScroll) {
632
+ lines.push("import { ScrollTrigger } from 'gsap/ScrollTrigger';");
633
+ lines.push("");
634
+ lines.push("gsap.registerPlugin(ScrollTrigger);");
635
+ }
636
+ if (ts) {
637
+ lines.push("import { useRef, useEffect } from 'react';");
638
+ lines.push("import type { FC, ReactNode } from 'react';");
639
+ }
640
+ else {
641
+ lines.push("import { useRef, useEffect } from 'react';");
642
+ }
643
+ lines.push("");
644
+ lines.push(`const use${toPascalCase(pattern.name)}Animation = (ref${ts ? ": React.RefObject<HTMLDivElement>" : ""}) => {`);
645
+ lines.push(" useEffect(() => {");
646
+ lines.push(" if (!ref.current) return;");
647
+ lines.push("");
648
+ const toProps = [];
649
+ for (const prop of pattern.properties) {
650
+ const propName = prop.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
651
+ toProps.push(` ${propName}: ${JSON.stringify(prop.to)}`);
652
+ }
653
+ const fromProps = [];
654
+ for (const prop of pattern.properties) {
655
+ const propName = prop.name.replace(/-([a-z])/g, (_, c) => c.toUpperCase());
656
+ fromProps.push(` ${propName}: ${JSON.stringify(prop.from)}`);
657
+ }
658
+ lines.push(" const animation = gsap.fromTo(");
659
+ lines.push(" ref.current,");
660
+ lines.push(" {");
661
+ lines.push(fromProps.join(",\n"));
662
+ lines.push(" },");
663
+ lines.push(" {");
664
+ lines.push(toProps.join(",\n") + ",");
665
+ lines.push(` duration: ${pattern.duration / 1000},`);
666
+ lines.push(` ease: ${JSON.stringify(pattern.easing)},`);
667
+ if (pattern.delay > 0) {
668
+ lines.push(` delay: ${pattern.delay / 1000},`);
669
+ }
670
+ if (pattern.iterations === "infinite") {
671
+ lines.push(" repeat: -1,");
672
+ }
673
+ else if (pattern.iterations > 1) {
674
+ lines.push(` repeat: ${pattern.iterations - 1},`);
675
+ }
676
+ if (pattern.direction === "alternate" || pattern.direction === "alternate-reverse") {
677
+ lines.push(" yoyo: true,");
678
+ }
679
+ if (isScroll) {
680
+ lines.push(" scrollTrigger: {");
681
+ lines.push(" trigger: ref.current,");
682
+ lines.push(" start: 'top 80%',");
683
+ lines.push(" end: 'bottom 20%',");
684
+ lines.push(" toggleActions: 'play none none reverse',");
685
+ lines.push(" },");
686
+ }
687
+ lines.push(" }");
688
+ lines.push(" );");
689
+ lines.push("");
690
+ lines.push(" return () => {");
691
+ lines.push(" animation.kill();");
692
+ lines.push(" };");
693
+ lines.push(" }, [ref]);");
694
+ lines.push("};");
695
+ lines.push("");
696
+ if (ts) {
697
+ lines.push(`interface ${componentName}Props {`);
698
+ lines.push(" children: ReactNode;");
699
+ lines.push(" className?: string;");
700
+ lines.push("}");
701
+ lines.push("");
702
+ lines.push(`export const ${componentName}: FC<${componentName}Props> = ({ children, className }) => {`);
703
+ }
704
+ else {
705
+ lines.push(`export const ${componentName} = ({ children, className }) => {`);
706
+ }
707
+ lines.push(` const ref = useRef${ts ? "<HTMLDivElement>" : ""}(null);`);
708
+ lines.push(` use${toPascalCase(pattern.name)}Animation(ref);`);
709
+ lines.push("");
710
+ lines.push(" return (");
711
+ lines.push(" <div ref={ref} className={className}>");
712
+ lines.push(" {children}");
713
+ lines.push(" </div>");
714
+ lines.push(" );");
715
+ lines.push("};");
716
+ if (options.includeReducedMotion) {
717
+ lines.push("");
718
+ lines.push("/* Add reduced motion check */");
719
+ lines.push('// const prefersReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)").matches;');
720
+ lines.push("// if (prefersReducedMotion) return;");
721
+ }
722
+ const code = lines.join("\n");
723
+ const dependencies = isScroll ? ["gsap", "gsap/ScrollTrigger"] : ["gsap"];
724
+ return {
725
+ code,
726
+ metadata: {
727
+ linesOfCode: countLines(code),
728
+ hasKeyframes: false,
729
+ hasReducedMotion: options.includeReducedMotion ?? true,
730
+ dependencies,
731
+ },
732
+ };
733
+ }
734
+ /**
735
+ * Three.js (React Three Fiber) 生成
736
+ *
737
+ * @react-three/fiber を使用した3Dアニメーションコードを生成
738
+ * - useFrame によるアニメーションループ
739
+ * - scroll-driven アニメーション対応
740
+ * - TypeScript 型定義付き
741
+ */
742
+ function generateThreeJS(pattern, options) {
743
+ const lines = [];
744
+ const componentName = options.componentName || toPascalCase(pattern.name) + "Scene";
745
+ const ts = options.typescript ?? true;
746
+ const isScroll = pattern.type === "scroll";
747
+ // Imports
748
+ lines.push("import { useRef } from 'react';");
749
+ lines.push("import { Canvas, useFrame } from '@react-three/fiber';");
750
+ if (isScroll) {
751
+ lines.push("import { useScroll } from '@react-three/drei';");
752
+ }
753
+ if (ts) {
754
+ lines.push("import type { FC } from 'react';");
755
+ lines.push("import type { Mesh, Group } from 'three';");
756
+ }
757
+ lines.push("");
758
+ // Extract animation properties and convert to Three.js-compatible values
759
+ const positionProps = pattern.properties.filter((p) => ["translateX", "translateY", "translateZ", "x", "y", "z"].includes(p.name));
760
+ const rotationProps = pattern.properties.filter((p) => ["rotateX", "rotateY", "rotateZ", "rotate"].includes(p.name));
761
+ const scaleProps = pattern.properties.filter((p) => ["scale", "scaleX", "scaleY", "scaleZ"].includes(p.name));
762
+ const opacityProps = pattern.properties.filter((p) => ["opacity"].includes(p.name));
763
+ // Helper function name
764
+ const animatedObjectName = toPascalCase(pattern.name) + "Object";
765
+ // Animated Object Component
766
+ if (ts) {
767
+ lines.push(`interface ${animatedObjectName}Props {`);
768
+ lines.push(" children?: React.ReactNode;");
769
+ lines.push("}");
770
+ lines.push("");
771
+ }
772
+ lines.push(`const ${animatedObjectName}${ts ? `: FC<${animatedObjectName}Props>` : ""} = ({ children }) => {`);
773
+ lines.push(` const meshRef = useRef${ts ? "<Mesh>" : ""}(null);`);
774
+ if (isScroll) {
775
+ lines.push(" const scroll = useScroll();");
776
+ lines.push("");
777
+ lines.push(" useFrame(() => {");
778
+ lines.push(" if (!meshRef.current) return;");
779
+ lines.push(" const progress = scroll.offset;");
780
+ }
781
+ else {
782
+ lines.push(` const duration = ${pattern.duration / 1000}; // seconds`);
783
+ lines.push(` const startTime = useRef${ts ? "<number>" : ""}(0);`);
784
+ lines.push("");
785
+ lines.push(" useFrame((state) => {");
786
+ lines.push(" if (!meshRef.current) return;");
787
+ lines.push(" if (startTime.current === 0) startTime.current = state.clock.elapsedTime;");
788
+ lines.push("");
789
+ lines.push(" const elapsed = state.clock.elapsedTime - startTime.current;");
790
+ if (pattern.iterations === "infinite") {
791
+ lines.push(" const progress = (elapsed % duration) / duration;");
792
+ }
793
+ else {
794
+ lines.push(" const progress = Math.min(elapsed / duration, 1);");
795
+ }
796
+ }
797
+ lines.push("");
798
+ // Apply easing
799
+ lines.push(" // Apply easing function");
800
+ lines.push(` const eased = ease${toPascalCase(pattern.easing.replace(/[^a-zA-Z]/g, ""))}(progress);`);
801
+ lines.push("");
802
+ // Position animations
803
+ if (positionProps.length > 0) {
804
+ lines.push(" // Position animation");
805
+ for (const prop of positionProps) {
806
+ const axis = prop.name.replace(/translate|[XYZ]/gi, "").toLowerCase() ||
807
+ prop.name.charAt(prop.name.length - 1).toLowerCase();
808
+ const fromVal = parseFloat(prop.from) || 0;
809
+ const toVal = parseFloat(prop.to) || 0;
810
+ lines.push(` meshRef.current.position.${axis} = ${fromVal} + (${toVal} - ${fromVal}) * eased;`);
811
+ }
812
+ }
813
+ // Rotation animations
814
+ if (rotationProps.length > 0) {
815
+ lines.push(" // Rotation animation");
816
+ for (const prop of rotationProps) {
817
+ const axis = prop.name.replace("rotate", "").toLowerCase() || "y";
818
+ const fromVal = parseFloat(prop.from) || 0;
819
+ const toVal = parseFloat(prop.to) || Math.PI * 2;
820
+ lines.push(` meshRef.current.rotation.${axis} = ${fromVal} + (${toVal} - ${fromVal}) * eased;`);
821
+ }
822
+ }
823
+ // Scale animations
824
+ const scaleProp = scaleProps[0];
825
+ if (scaleProp) {
826
+ lines.push(" // Scale animation");
827
+ const fromVal = parseFloat(scaleProp.from) || 1;
828
+ const toVal = parseFloat(scaleProp.to) || 1;
829
+ lines.push(` const scaleValue = ${fromVal} + (${toVal} - ${fromVal}) * eased;`);
830
+ lines.push(" meshRef.current.scale.setScalar(scaleValue);");
831
+ }
832
+ // Opacity animations (material)
833
+ const opacityProp = opacityProps[0];
834
+ if (opacityProp) {
835
+ lines.push(" // Opacity animation");
836
+ const fromVal = parseFloat(opacityProp.from) || 1;
837
+ const toVal = parseFloat(opacityProp.to) || 0;
838
+ lines.push(` if (meshRef.current.material && 'opacity' in meshRef.current.material) {`);
839
+ lines.push(` (meshRef.current.material as any).opacity = ${fromVal} + (${toVal} - ${fromVal}) * eased;`);
840
+ lines.push(" }");
841
+ }
842
+ lines.push(" });");
843
+ lines.push("");
844
+ lines.push(" return (");
845
+ lines.push(" <mesh ref={meshRef}>");
846
+ lines.push(" {children || (");
847
+ lines.push(" <>");
848
+ lines.push(" <boxGeometry args={[1, 1, 1]} />");
849
+ lines.push(' <meshStandardMaterial color="#4f46e5" transparent />');
850
+ lines.push(" </>");
851
+ lines.push(" )}");
852
+ lines.push(" </mesh>");
853
+ lines.push(" );");
854
+ lines.push("};");
855
+ lines.push("");
856
+ // Easing function
857
+ lines.push("// Easing function");
858
+ const easingName = `ease${toPascalCase(pattern.easing.replace(/[^a-zA-Z]/g, ""))}`;
859
+ lines.push(`function ${easingName}(t${ts ? ": number" : ""})${ts ? ": number" : ""} {`);
860
+ switch (pattern.easing) {
861
+ case "ease-in":
862
+ lines.push(" return t * t;");
863
+ break;
864
+ case "ease-out":
865
+ lines.push(" return t * (2 - t);");
866
+ break;
867
+ case "ease-in-out":
868
+ lines.push(" return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;");
869
+ break;
870
+ case "linear":
871
+ lines.push(" return t;");
872
+ break;
873
+ default:
874
+ // Default to ease-out for unknown easing
875
+ lines.push(" return t * (2 - t);");
876
+ }
877
+ lines.push("}");
878
+ lines.push("");
879
+ // Main Scene Component
880
+ if (ts) {
881
+ lines.push(`interface ${componentName}Props {`);
882
+ lines.push(" className?: string;");
883
+ lines.push("}");
884
+ lines.push("");
885
+ }
886
+ lines.push(`export const ${componentName}${ts ? `: FC<${componentName}Props>` : ""} = ({ className }) => {`);
887
+ if (options.includeReducedMotion) {
888
+ lines.push(" // Check for reduced motion preference");
889
+ lines.push(' const prefersReducedMotion = typeof window !== "undefined"');
890
+ lines.push(' && window.matchMedia("(prefers-reduced-motion: reduce)").matches;');
891
+ lines.push("");
892
+ lines.push(" if (prefersReducedMotion) {");
893
+ lines.push(" return (");
894
+ lines.push(' <div className={className} style={{ width: "100%", height: "400px", background: "#1a1a2e" }}>');
895
+ lines.push(" {/* Static fallback for reduced motion */}");
896
+ lines.push(" </div>");
897
+ lines.push(" );");
898
+ lines.push(" }");
899
+ lines.push("");
900
+ }
901
+ lines.push(" return (");
902
+ lines.push(' <div className={className} style={{ width: "100%", height: "400px" }}>');
903
+ lines.push(" <Canvas camera={{ position: [0, 0, 5], fov: 50 }}>");
904
+ lines.push(" <ambientLight intensity={0.5} />");
905
+ lines.push(" <pointLight position={[10, 10, 10]} />");
906
+ lines.push(` <${animatedObjectName} />`);
907
+ lines.push(" </Canvas>");
908
+ lines.push(" </div>");
909
+ lines.push(" );");
910
+ lines.push("};");
911
+ const code = lines.join("\n");
912
+ const dependencies = isScroll
913
+ ? ["@react-three/fiber", "@react-three/drei", "three"]
914
+ : ["@react-three/fiber", "three"];
915
+ return {
916
+ code,
917
+ metadata: {
918
+ linesOfCode: countLines(code),
919
+ hasKeyframes: false,
920
+ hasReducedMotion: options.includeReducedMotion ?? true,
921
+ dependencies,
922
+ },
923
+ };
924
+ }
925
+ /**
926
+ * Lottie (lottie-react) 生成
927
+ *
928
+ * lottie-react を使用したアニメーションコンポーネントを生成
929
+ * - アニメーションデータ構造生成(Lottie JSON形式)
930
+ * - React コンポーネントラッパー
931
+ * - TypeScript 型定義付き
932
+ */
933
+ function generateLottie(pattern, options) {
934
+ const lines = [];
935
+ const componentName = options.componentName || toPascalCase(pattern.name) + "Animation";
936
+ const ts = options.typescript ?? true;
937
+ // Imports
938
+ lines.push("import Lottie from 'lottie-react';");
939
+ if (ts) {
940
+ lines.push("import type { FC } from 'react';");
941
+ lines.push("import type { LottieComponentProps } from 'lottie-react';");
942
+ }
943
+ lines.push("");
944
+ // Convert CSS animation properties to Lottie keyframes format
945
+ // Note: This generates a simplified Lottie JSON structure
946
+ lines.push("/**");
947
+ lines.push(" * Lottie Animation Data");
948
+ lines.push(" * Generated from CSS animation pattern.");
949
+ lines.push(" * For complex animations, replace with actual Lottie JSON export from After Effects/Figma.");
950
+ lines.push(" */");
951
+ // Generate Lottie-like animation data structure
952
+ const durationInFrames = Math.round((pattern.duration / 1000) * 60); // 60fps
953
+ const startFrame = Math.round((pattern.delay / 1000) * 60);
954
+ lines.push(`const ${pattern.name}AnimationData = {`);
955
+ lines.push(' v: "5.7.8",');
956
+ lines.push(` fr: 60,`); // Frame rate
957
+ lines.push(` ip: ${startFrame},`); // In point
958
+ lines.push(` op: ${startFrame + durationInFrames},`); // Out point
959
+ lines.push(" w: 200,"); // Width
960
+ lines.push(" h: 200,"); // Height
961
+ lines.push(' nm: "' + pattern.name + '",');
962
+ lines.push(" ddd: 0,");
963
+ lines.push(" assets: [],");
964
+ lines.push(" layers: [");
965
+ lines.push(" {");
966
+ lines.push(" ddd: 0,");
967
+ lines.push(" ind: 1,");
968
+ lines.push(" ty: 4,"); // Shape layer
969
+ lines.push(` nm: "${pattern.name}",`);
970
+ lines.push(` sr: 1,`);
971
+ lines.push(" ks: {"); // Transform
972
+ // Opacity animation
973
+ const opacityProp = pattern.properties.find((p) => p.name === "opacity");
974
+ if (opacityProp) {
975
+ const fromOpacity = parseFloat(opacityProp.from) * 100 || 0;
976
+ const toOpacity = parseFloat(opacityProp.to) * 100 || 100;
977
+ lines.push(" o: {"); // Opacity
978
+ lines.push(" a: 1,"); // Animated
979
+ lines.push(" k: [");
980
+ lines.push(` { i: { x: [0.4], y: [1] }, o: { x: [0.6], y: [0] }, t: ${startFrame}, s: [${fromOpacity}] },`);
981
+ lines.push(` { t: ${startFrame + durationInFrames}, s: [${toOpacity}] }`);
982
+ lines.push(" ]");
983
+ lines.push(" },");
984
+ }
985
+ else {
986
+ lines.push(" o: { a: 0, k: 100 },");
987
+ }
988
+ // Position animation (transform: translate)
989
+ const translateXProp = pattern.properties.find((p) => p.name === "translateX");
990
+ const translateYProp = pattern.properties.find((p) => p.name === "translateY");
991
+ if (translateXProp || translateYProp) {
992
+ const fromX = translateXProp ? parseFloat(translateXProp.from) || 0 : 0;
993
+ const toX = translateXProp ? parseFloat(translateXProp.to) || 0 : 0;
994
+ const fromY = translateYProp ? parseFloat(translateYProp.from) || 0 : 0;
995
+ const toY = translateYProp ? parseFloat(translateYProp.to) || 0 : 0;
996
+ lines.push(" p: {"); // Position
997
+ lines.push(" a: 1,");
998
+ lines.push(" k: [");
999
+ lines.push(` { i: { x: 0.4, y: 1 }, o: { x: 0.6, y: 0 }, t: ${startFrame}, s: [${100 + fromX}, ${100 + fromY}, 0] },`);
1000
+ lines.push(` { t: ${startFrame + durationInFrames}, s: [${100 + toX}, ${100 + toY}, 0] }`);
1001
+ lines.push(" ]");
1002
+ lines.push(" },");
1003
+ }
1004
+ else {
1005
+ lines.push(" p: { a: 0, k: [100, 100, 0] },");
1006
+ }
1007
+ // Scale animation
1008
+ const scaleProp = pattern.properties.find((p) => p.name === "scale");
1009
+ if (scaleProp) {
1010
+ const fromScale = parseFloat(scaleProp.from) * 100 || 100;
1011
+ const toScale = parseFloat(scaleProp.to) * 100 || 100;
1012
+ lines.push(" s: {"); // Scale
1013
+ lines.push(" a: 1,");
1014
+ lines.push(" k: [");
1015
+ lines.push(` { i: { x: [0.4], y: [1] }, o: { x: [0.6], y: [0] }, t: ${startFrame}, s: [${fromScale}, ${fromScale}, 100] },`);
1016
+ lines.push(` { t: ${startFrame + durationInFrames}, s: [${toScale}, ${toScale}, 100] }`);
1017
+ lines.push(" ]");
1018
+ lines.push(" },");
1019
+ }
1020
+ else {
1021
+ lines.push(" s: { a: 0, k: [100, 100, 100] },");
1022
+ }
1023
+ // Rotation animation
1024
+ const rotateProp = pattern.properties.find((p) => p.name === "rotate");
1025
+ if (rotateProp) {
1026
+ const fromRotate = parseFloat(rotateProp.from) || 0;
1027
+ const toRotate = parseFloat(rotateProp.to) || 0;
1028
+ lines.push(" r: {"); // Rotation
1029
+ lines.push(" a: 1,");
1030
+ lines.push(" k: [");
1031
+ lines.push(` { i: { x: [0.4], y: [1] }, o: { x: [0.6], y: [0] }, t: ${startFrame}, s: [${fromRotate}] },`);
1032
+ lines.push(` { t: ${startFrame + durationInFrames}, s: [${toRotate}] }`);
1033
+ lines.push(" ]");
1034
+ lines.push(" },");
1035
+ }
1036
+ else {
1037
+ lines.push(" r: { a: 0, k: 0 },");
1038
+ }
1039
+ lines.push(" a: { a: 0, k: [100, 100, 0] }"); // Anchor point
1040
+ lines.push(" },");
1041
+ // Shape contents (simple rectangle)
1042
+ lines.push(" shapes: [");
1043
+ lines.push(" {");
1044
+ lines.push(' ty: "rc",'); // Rectangle
1045
+ lines.push(" d: 1,");
1046
+ lines.push(" s: { a: 0, k: [100, 100] },"); // Size
1047
+ lines.push(" p: { a: 0, k: [0, 0] },"); // Position
1048
+ lines.push(" r: { a: 0, k: 8 },"); // Corner radius
1049
+ lines.push(' nm: "Rectangle"');
1050
+ lines.push(" },");
1051
+ lines.push(" {");
1052
+ lines.push(' ty: "fl",'); // Fill
1053
+ lines.push(" c: { a: 0, k: [0.31, 0.275, 0.898, 1] },"); // Color (#4f46e5)
1054
+ lines.push(" o: { a: 0, k: 100 },");
1055
+ lines.push(' nm: "Fill"');
1056
+ lines.push(" }");
1057
+ lines.push(" ],");
1058
+ lines.push(` ip: ${startFrame},`);
1059
+ lines.push(` op: ${startFrame + durationInFrames},`);
1060
+ lines.push(" st: 0");
1061
+ lines.push(" }");
1062
+ lines.push(" ]");
1063
+ lines.push("};");
1064
+ lines.push("");
1065
+ // React component
1066
+ if (ts) {
1067
+ lines.push(`interface ${componentName}Props {`);
1068
+ lines.push(" className?: string;");
1069
+ lines.push(" loop?: boolean;");
1070
+ lines.push(" autoplay?: boolean;");
1071
+ lines.push("}");
1072
+ lines.push("");
1073
+ }
1074
+ lines.push(`export const ${componentName}${ts ? `: FC<${componentName}Props>` : ""} = ({`);
1075
+ lines.push(" className,");
1076
+ lines.push(` loop = ${pattern.iterations === "infinite"},`);
1077
+ lines.push(" autoplay = true,");
1078
+ lines.push("}) => {");
1079
+ if (options.includeReducedMotion) {
1080
+ lines.push(" // Check for reduced motion preference");
1081
+ lines.push(' const prefersReducedMotion = typeof window !== "undefined"');
1082
+ lines.push(' && window.matchMedia("(prefers-reduced-motion: reduce)").matches;');
1083
+ lines.push("");
1084
+ lines.push(" if (prefersReducedMotion) {");
1085
+ lines.push(" return (");
1086
+ lines.push(" <div className={className} style={{ width: 200, height: 200 }}>");
1087
+ lines.push(" {/* Static fallback for reduced motion */}");
1088
+ lines.push(' <div style={{ width: 100, height: 100, background: "#4f46e5", borderRadius: 8, margin: "auto" }} />');
1089
+ lines.push(" </div>");
1090
+ lines.push(" );");
1091
+ lines.push(" }");
1092
+ lines.push("");
1093
+ }
1094
+ lines.push(" return (");
1095
+ lines.push(" <Lottie");
1096
+ lines.push(` animationData={${pattern.name}AnimationData}`);
1097
+ lines.push(" loop={loop}");
1098
+ lines.push(" autoplay={autoplay}");
1099
+ lines.push(" className={className}");
1100
+ lines.push(" style={{ width: 200, height: 200 }}");
1101
+ lines.push(" />");
1102
+ lines.push(" );");
1103
+ lines.push("};");
1104
+ lines.push("");
1105
+ // Usage instructions
1106
+ lines.push("/**");
1107
+ lines.push(" * Usage:");
1108
+ lines.push(` * import { ${componentName} } from './path-to-component';`);
1109
+ lines.push(" *");
1110
+ lines.push(` * <${componentName} />`);
1111
+ lines.push(` * <${componentName} loop={false} autoplay={true} />`);
1112
+ lines.push(" *");
1113
+ lines.push(" * Note: For production use, export your animation from After Effects with");
1114
+ lines.push(" * Bodymovin plugin or from Figma, and replace the animationData above.");
1115
+ lines.push(" */");
1116
+ const code = lines.join("\n");
1117
+ return {
1118
+ code,
1119
+ metadata: {
1120
+ linesOfCode: countLines(code),
1121
+ hasKeyframes: false,
1122
+ hasReducedMotion: options.includeReducedMotion ?? true,
1123
+ dependencies: ["lottie-react"],
1124
+ },
1125
+ };
1126
+ }
1127
+ /**
1128
+ * メイン生成関数
1129
+ */
1130
+ function generateImplementation(pattern, format, options) {
1131
+ switch (format) {
1132
+ case "css":
1133
+ return generateCSS(pattern, options);
1134
+ case "css-module":
1135
+ return generateCSSModule(pattern, options);
1136
+ case "tailwind":
1137
+ return generateTailwind(pattern, options);
1138
+ case "styled-components":
1139
+ return generateStyledComponents(pattern, options);
1140
+ case "emotion":
1141
+ return generateEmotion(pattern, options);
1142
+ case "framer-motion":
1143
+ return generateFramerMotion(pattern, options);
1144
+ case "gsap":
1145
+ return generateGSAP(pattern, options);
1146
+ case "three-js":
1147
+ return generateThreeJS(pattern, options);
1148
+ case "lottie":
1149
+ return generateLottie(pattern, options);
1150
+ default:
1151
+ return generateCSS(pattern, options);
1152
+ }
1153
+ }
1154
+ // =====================================================
1155
+ // 実装コード生成ヘルパー(v0.1.0: include_implementation用)
1156
+ // =====================================================
1157
+ /**
1158
+ * MotionTypeをMotionPatternInput用のtypeに変換
1159
+ * @param type MotionType
1160
+ * @returns MotionPatternInputType
1161
+ */
1162
+ function mapMotionType(type) {
1163
+ switch (type) {
1164
+ case "css_animation":
1165
+ case "library_animation":
1166
+ case "video_motion":
1167
+ return "animation";
1168
+ case "css_transition":
1169
+ return "transition";
1170
+ case "keyframes":
1171
+ return "keyframe";
1172
+ default:
1173
+ return "animation";
1174
+ }
1175
+ }
1176
+ /**
1177
+ * MotionPatternからMotionPatternInputに変換
1178
+ * @param pattern 検索結果のパターン
1179
+ * @returns コード生成用のパターン入力
1180
+ */
1181
+ function patternToPatternInput(pattern) {
1182
+ // animationオブジェクトから値を抽出、easingはオブジェクトの可能性あり
1183
+ const duration = pattern.animation?.duration ?? 300;
1184
+ const easingConfig = pattern.animation?.easing;
1185
+ // easingConfigがオブジェクトの場合はtypeまたはcubicBezierを使用
1186
+ let easing = "ease";
1187
+ if (easingConfig) {
1188
+ if (easingConfig.cubicBezier) {
1189
+ easing = `cubic-bezier(${easingConfig.cubicBezier.join(", ")})`;
1190
+ }
1191
+ else if (easingConfig.type && easingConfig.type !== "cubic-bezier") {
1192
+ easing = easingConfig.type;
1193
+ }
1194
+ }
1195
+ const delay = pattern.animation?.delay ?? 0;
1196
+ const iterations = pattern.animation?.iterations ?? 1;
1197
+ const direction = pattern.animation?.direction ?? "normal";
1198
+ const fillMode = pattern.animation?.fillMode ?? "none";
1199
+ return {
1200
+ type: mapMotionType(pattern.type),
1201
+ name: pattern.name ?? "unnamed",
1202
+ duration,
1203
+ delay,
1204
+ easing,
1205
+ iterations,
1206
+ direction,
1207
+ fillMode,
1208
+ // propertiesのpropertyをnameに変換
1209
+ properties: pattern.properties?.map((p) => ({
1210
+ name: p.property ?? "opacity",
1211
+ from: String(p.from ?? "0"),
1212
+ to: String(p.to ?? "1"),
1213
+ })) ?? [{ name: "opacity", from: "0", to: "1" }],
1214
+ };
1215
+ }
1216
+ /**
1217
+ * 検索結果のパターンから実装コード情報を生成
1218
+ * @param pattern 検索結果のパターン
1219
+ * @returns 実装コード情報
1220
+ */
1221
+ function generateImplementationForPattern(pattern) {
1222
+ const patternInput = patternToPatternInput(pattern);
1223
+ const implementation = {};
1224
+ // transitionタイプの場合(css_transition)
1225
+ if (pattern.type === "css_transition") {
1226
+ const props = patternInput.properties.map((p) => p.name).join(", ");
1227
+ implementation.transition = `transition: ${props} ${formatDuration(patternInput.duration)} ${patternInput.easing};`;
1228
+ return implementation;
1229
+ }
1230
+ // animation/@keyframesタイプの場合
1231
+ // @keyframes生成
1232
+ const keyframeLines = [];
1233
+ keyframeLines.push(`@keyframes ${pattern.name} {`);
1234
+ keyframeLines.push(" from {");
1235
+ for (const prop of patternInput.properties) {
1236
+ keyframeLines.push(` ${prop.name}: ${prop.from};`);
1237
+ }
1238
+ keyframeLines.push(" }");
1239
+ keyframeLines.push(" to {");
1240
+ for (const prop of patternInput.properties) {
1241
+ keyframeLines.push(` ${prop.name}: ${prop.to};`);
1242
+ }
1243
+ keyframeLines.push(" }");
1244
+ keyframeLines.push("}");
1245
+ implementation.keyframes = keyframeLines.join("\n");
1246
+ // animationプロパティ生成
1247
+ implementation.animation = `animation: ${pattern.name} ${formatDuration(patternInput.duration)} ${patternInput.easing};`;
1248
+ // Tailwindクラス生成
1249
+ implementation.tailwind = `animate-${pattern.name}`;
1250
+ return implementation;
1251
+ }
1252
+ // =====================================================
1253
+ // 多様性フィルタリング (MMR強化)
1254
+ // =====================================================
1255
+ /**
1256
+ * 2つの文字列の類似度を計算(Levenshtein距離ベース)
1257
+ * @param a 比較元文字列
1258
+ * @param b 比較先文字列
1259
+ * @returns 類似度 (0.0-1.0)
1260
+ */
1261
+ function calculateNameSimilarity(a, b) {
1262
+ if (!a || !b) {
1263
+ return 0;
1264
+ }
1265
+ const normalizedA = a.toLowerCase().replace(/[-_\s]/g, "");
1266
+ const normalizedB = b.toLowerCase().replace(/[-_\s]/g, "");
1267
+ if (normalizedA === normalizedB) {
1268
+ return 1.0;
1269
+ }
1270
+ // 共通のプレフィックスをチェック(例: fadeIn, fadeInUp → 高い類似度)
1271
+ let commonPrefixLen = 0;
1272
+ const minLen = Math.min(normalizedA.length, normalizedB.length);
1273
+ for (let i = 0; i < minLen; i++) {
1274
+ if (normalizedA[i] === normalizedB[i]) {
1275
+ commonPrefixLen++;
1276
+ }
1277
+ else {
1278
+ break;
1279
+ }
1280
+ }
1281
+ // プレフィックス類似度(4文字以上の共通プレフィックスで高い類似度)
1282
+ if (commonPrefixLen >= 4) {
1283
+ return 0.6 + 0.4 * (commonPrefixLen / Math.max(normalizedA.length, normalizedB.length));
1284
+ }
1285
+ // 部分文字列チェック
1286
+ if (normalizedA.includes(normalizedB) || normalizedB.includes(normalizedA)) {
1287
+ return 0.7;
1288
+ }
1289
+ return 0;
1290
+ }
1291
+ /**
1292
+ * 2つのモーションパターン間の類似度を計算
1293
+ * 名前、カテゴリ、トリガー、アニメーション設定を比較
1294
+ * @param a 比較元パターン
1295
+ * @param b 比較先パターン
1296
+ * @returns 類似度 (0.0-1.0)
1297
+ */
1298
+ function calculatePatternSimilarity(a, b) {
1299
+ let similarityScore = 0;
1300
+ let weightTotal = 0;
1301
+ // 名前の類似度 (重み: 0.25) - v0.1.0追加
1302
+ const nameWeight = 0.25;
1303
+ const nameSimilarity = calculateNameSimilarity(a.pattern.name, b.pattern.name);
1304
+ similarityScore += nameWeight * nameSimilarity;
1305
+ weightTotal += nameWeight;
1306
+ // カテゴリの一致 (重み: 0.25)
1307
+ const categoryWeight = 0.25;
1308
+ if (a.pattern.category === b.pattern.category) {
1309
+ similarityScore += categoryWeight;
1310
+ }
1311
+ weightTotal += categoryWeight;
1312
+ // トリガーの一致 (重み: 0.15)
1313
+ const triggerWeight = 0.15;
1314
+ if (a.pattern.trigger === b.pattern.trigger) {
1315
+ similarityScore += triggerWeight;
1316
+ }
1317
+ weightTotal += triggerWeight;
1318
+ // タイプの一致 (重み: 0.1)
1319
+ const typeWeight = 0.1;
1320
+ if (a.pattern.type === b.pattern.type) {
1321
+ similarityScore += typeWeight;
1322
+ }
1323
+ weightTotal += typeWeight;
1324
+ // duration類似度 (重み: 0.1)
1325
+ const durationWeight = 0.1;
1326
+ const durationA = a.pattern.animation?.duration ?? 0;
1327
+ const durationB = b.pattern.animation?.duration ?? 0;
1328
+ if (durationA > 0 && durationB > 0) {
1329
+ const durationRatio = Math.min(durationA, durationB) / Math.max(durationA, durationB);
1330
+ similarityScore += durationWeight * durationRatio;
1331
+ }
1332
+ else if (durationA === 0 && durationB === 0) {
1333
+ similarityScore += durationWeight;
1334
+ }
1335
+ weightTotal += durationWeight;
1336
+ // easing類似度 (重み: 0.075)
1337
+ const easingWeight = 0.075;
1338
+ const easingA = a.pattern.animation?.easing?.type ?? "unknown";
1339
+ const easingB = b.pattern.animation?.easing?.type ?? "unknown";
1340
+ if (easingA === easingB) {
1341
+ similarityScore += easingWeight;
1342
+ }
1343
+ weightTotal += easingWeight;
1344
+ // プロパティ類似度 (重み: 0.075)
1345
+ const propertiesWeight = 0.075;
1346
+ const propsA = new Set(a.pattern.properties?.map((p) => p.property) ?? []);
1347
+ const propsB = new Set(b.pattern.properties?.map((p) => p.property) ?? []);
1348
+ if (propsA.size > 0 && propsB.size > 0) {
1349
+ const intersection = [...propsA].filter((p) => propsB.has(p)).length;
1350
+ const union = new Set([...propsA, ...propsB]).size;
1351
+ similarityScore += propertiesWeight * (intersection / union);
1352
+ }
1353
+ else if (propsA.size === 0 && propsB.size === 0) {
1354
+ similarityScore += propertiesWeight;
1355
+ }
1356
+ weightTotal += propertiesWeight;
1357
+ return weightTotal > 0 ? similarityScore / weightTotal : 0;
1358
+ }
1359
+ /**
1360
+ * MMR (Maximal Marginal Relevance) アルゴリズムで多様性フィルタリングを適用
1361
+ *
1362
+ * MMRスコア = λ * relevance - (1-λ) * max_similarity_to_selected
1363
+ *
1364
+ * @param results 検索結果配列(類似度順)
1365
+ * @param lambda λ値(0.0-1.0)- 0.0で最大多様性、1.0で関連度のみ
1366
+ * @param ensureCategoryDiversity カテゴリ分散を強制するか
1367
+ * @param limit 最大結果数
1368
+ * @returns フィルタリング後の検索結果
1369
+ */
1370
+ function applyDiversityFilter(results, lambda, ensureCategoryDiversity, limit) {
1371
+ if (results.length === 0) {
1372
+ return results;
1373
+ }
1374
+ // λ=1.0 の場合、多様性フィルタなし(関連度順のまま)
1375
+ if (lambda >= 1.0) {
1376
+ return results.slice(0, limit);
1377
+ }
1378
+ // λ=0.0 かつ ensureCategoryDiversity=false の場合、類似度順でフィルタリングのみ
1379
+ // ただし、同一名パターンは除外
1380
+ if (lambda <= 0.0 && !ensureCategoryDiversity) {
1381
+ const selected = [];
1382
+ const usedNames = new Set();
1383
+ for (const result of results) {
1384
+ if (selected.length >= limit)
1385
+ break;
1386
+ const name = result.pattern.name?.toLowerCase() ?? "";
1387
+ if (!usedNames.has(name)) {
1388
+ selected.push(result);
1389
+ if (name)
1390
+ usedNames.add(name);
1391
+ }
1392
+ }
1393
+ return selected;
1394
+ }
1395
+ // MMRアルゴリズムによる選択
1396
+ const selected = [];
1397
+ const remaining = [...results];
1398
+ const usedCategories = new Map();
1399
+ while (remaining.length > 0 && selected.length < limit) {
1400
+ let bestIdx = 0;
1401
+ let bestScore = -Infinity;
1402
+ for (let i = 0; i < remaining.length; i++) {
1403
+ const candidate = remaining[i];
1404
+ if (!candidate)
1405
+ continue;
1406
+ // 関連度スコア(検索結果の類似度)
1407
+ const relevance = candidate.similarity;
1408
+ // 選択済み結果との最大類似度を計算
1409
+ let maxSimilarityToSelected = 0;
1410
+ for (const sel of selected) {
1411
+ const sim = calculatePatternSimilarity(sel, candidate);
1412
+ if (sim > maxSimilarityToSelected) {
1413
+ maxSimilarityToSelected = sim;
1414
+ }
1415
+ }
1416
+ // MMRスコア計算: λ * relevance - (1-λ) * max_similarity_to_selected
1417
+ let mmrScore = lambda * relevance - (1 - lambda) * maxSimilarityToSelected;
1418
+ // カテゴリ分散ボーナス(ensureCategoryDiversity=true の場合)
1419
+ if (ensureCategoryDiversity) {
1420
+ const category = candidate.pattern.category;
1421
+ const categoryCount = usedCategories.get(category) ?? 0;
1422
+ // 未使用カテゴリにはボーナス
1423
+ if (categoryCount === 0) {
1424
+ mmrScore += 0.1;
1425
+ }
1426
+ else if (categoryCount >= 2) {
1427
+ // 同一カテゴリ3件以上は大きくペナルティ
1428
+ mmrScore -= 0.2 * categoryCount;
1429
+ }
1430
+ }
1431
+ if (mmrScore > bestScore) {
1432
+ bestScore = mmrScore;
1433
+ bestIdx = i;
1434
+ }
1435
+ }
1436
+ // 最良候補を選択
1437
+ const chosenItem = remaining.splice(bestIdx, 1)[0];
1438
+ if (!chosenItem)
1439
+ break;
1440
+ selected.push(chosenItem);
1441
+ // カテゴリカウントを更新
1442
+ const category = chosenItem.pattern.category;
1443
+ usedCategories.set(category, (usedCategories.get(category) ?? 0) + 1);
1444
+ }
1445
+ if ((0, logger_1.isDevelopment)()) {
1446
+ logger_1.logger.info("[MCP Tool] motion.search MMR diversity filter applied", {
1447
+ originalCount: results.length,
1448
+ filteredCount: selected.length,
1449
+ lambda,
1450
+ ensureCategoryDiversity,
1451
+ categoryDistribution: Object.fromEntries(usedCategories),
1452
+ });
1453
+ }
1454
+ return selected;
1455
+ }
1456
+ /**
1457
+ * 検索結果に実装コードを付与
1458
+ * @param results 検索結果配列
1459
+ * @returns 実装コードが付与された検索結果
1460
+ */
1461
+ function enrichResultsWithImplementation(results) {
1462
+ return results.map((result) => ({
1463
+ ...result,
1464
+ implementation: generateImplementationForPattern(result.pattern),
1465
+ }));
1466
+ }
1467
+ // =====================================================
1468
+ // ハンドラー
1469
+ // =====================================================
1470
+ /**
1471
+ * motion.search ツールハンドラー
1472
+ *
1473
+ * Phase3-3: action パラメータによる機能統合
1474
+ * - action: 'search' (デフォルト) → 検索機能
1475
+ * - action: 'generate' → コード生成機能
1476
+ */
1477
+ async function motionSearchHandler(input) {
1478
+ if ((0, logger_1.isDevelopment)()) {
1479
+ logger_1.logger.info("[MCP Tool] motion.search called", {
1480
+ hasInput: input !== null && input !== undefined,
1481
+ });
1482
+ }
1483
+ // 入力バリデーション
1484
+ let validated;
1485
+ try {
1486
+ validated = schemas_1.motionSearchInputSchema.parse(input);
1487
+ }
1488
+ catch (error) {
1489
+ if ((0, logger_1.isDevelopment)()) {
1490
+ logger_1.logger.error("[MCP Tool] motion.search validation error", { error });
1491
+ }
1492
+ return {
1493
+ success: false,
1494
+ error: {
1495
+ code: schemas_1.MOTION_SEARCH_ERROR_CODES.VALIDATION_ERROR,
1496
+ message: error instanceof Error ? error.message : "Invalid input",
1497
+ },
1498
+ };
1499
+ }
1500
+ // Phase3-3: action分岐
1501
+ const action = validated.action ?? "search";
1502
+ if (action === "generate") {
1503
+ // コード生成処理
1504
+ return handleGenerateAction(validated);
1505
+ }
1506
+ // 検索処理(既存ロジック)
1507
+ return handleSearchAction(validated);
1508
+ }
1509
+ /**
1510
+ * action: 'search' の処理
1511
+ */
1512
+ async function handleSearchAction(validated) {
1513
+ // サービスファクトリのチェック
1514
+ if (!serviceFactory) {
1515
+ if ((0, logger_1.isDevelopment)()) {
1516
+ logger_1.logger.error("[MCP Tool] motion.search service factory not set");
1517
+ }
1518
+ return {
1519
+ success: false,
1520
+ error: {
1521
+ code: schemas_1.MOTION_SEARCH_ERROR_CODES.SERVICE_UNAVAILABLE,
1522
+ message: "Motion search service is not available",
1523
+ },
1524
+ };
1525
+ }
1526
+ try {
1527
+ const service = serviceFactory();
1528
+ // 検索パラメータを構築(v0.1.0: JSアニメーション検索パラメータ追加、v0.1.0: WebGLアニメーション検索パラメータ追加、v0.1.0: include_implementation追加)
1529
+ const searchParams = {
1530
+ query: validated.query,
1531
+ samplePattern: validated.samplePattern,
1532
+ filters: validated.filters,
1533
+ limit: validated.limit,
1534
+ minSimilarity: validated.minSimilarity,
1535
+ include_js_animations: validated.include_js_animations,
1536
+ js_animation_filters: validated.js_animation_filters,
1537
+ include_webgl_animations: validated.include_webgl_animations,
1538
+ webgl_animation_filters: validated.webgl_animation_filters,
1539
+ include_implementation: validated.include_implementation,
1540
+ };
1541
+ if ((0, logger_1.isDevelopment)()) {
1542
+ logger_1.logger.info("[MCP Tool] motion.search executing search", {
1543
+ hasQuery: !!searchParams.query,
1544
+ hasSamplePattern: !!searchParams.samplePattern,
1545
+ hasFilters: !!searchParams.filters,
1546
+ limit: searchParams.limit,
1547
+ minSimilarity: searchParams.minSimilarity,
1548
+ includeJsAnimations: searchParams.include_js_animations,
1549
+ hasJsAnimationFilters: !!searchParams.js_animation_filters,
1550
+ includeWebglAnimations: searchParams.include_webgl_animations,
1551
+ hasWebglAnimationFilters: !!searchParams.webgl_animation_filters,
1552
+ includeImplementation: searchParams.include_implementation,
1553
+ diversityThreshold: validated.diversity_threshold ?? 0.3,
1554
+ ensureCategoryDiversity: validated.ensure_category_diversity ?? true,
1555
+ });
1556
+ }
1557
+ // 検索実行(ハイブリッド検索優先)
1558
+ const searchResult = service.searchHybrid
1559
+ ? await service.searchHybrid(searchParams)
1560
+ : await service.search(searchParams);
1561
+ // v0.1.0: 多様性フィルタリングを適用
1562
+ const diversityThreshold = validated.diversity_threshold ?? 0.3;
1563
+ const ensureCategoryDiversity = validated.ensure_category_diversity ?? true;
1564
+ const diverseResults = applyDiversityFilter(searchResult.results, diversityThreshold, ensureCategoryDiversity, validated.limit);
1565
+ // v0.1.0: include_implementation が true の場合、実装コードを付与
1566
+ let results = validated.include_implementation
1567
+ ? enrichResultsWithImplementation(diverseResults)
1568
+ : diverseResults;
1569
+ // 嗜好プロファイルによるリランキング / Preference profile reranking
1570
+ // motion結果はpattern.idにIDがあるため、top-levelにidをマッピング
1571
+ // Motion results have ID in pattern.id, so map id to top-level
1572
+ const resultsWithId = results.map((r) => ({ ...r, id: r.pattern.id }));
1573
+ results = (await (0, preference_rerank_helper_1.applyPreferenceReranking)(resultsWithId, validated.profile_id, prismaClientFactory, "motion", "motion.search"));
1574
+ if ((0, logger_1.isDevelopment)()) {
1575
+ logger_1.logger.info("[MCP Tool] motion.search completed", {
1576
+ resultsCount: results.length,
1577
+ originalCount: searchResult.results.length,
1578
+ total: searchResult.total,
1579
+ includeImplementation: validated.include_implementation,
1580
+ diversityThreshold,
1581
+ ensureCategoryDiversity,
1582
+ });
1583
+ }
1584
+ return {
1585
+ success: true,
1586
+ data: {
1587
+ results,
1588
+ total: searchResult.total,
1589
+ query: searchResult.query,
1590
+ },
1591
+ };
1592
+ }
1593
+ catch (error) {
1594
+ if ((0, logger_1.isDevelopment)()) {
1595
+ logger_1.logger.error("[MCP Tool] motion.search error", { error });
1596
+ }
1597
+ // エラータイプに基づいてエラーコードを決定
1598
+ const errorCode = error instanceof Error && error.message.includes("Embedding")
1599
+ ? schemas_1.MOTION_SEARCH_ERROR_CODES.EMBEDDING_ERROR
1600
+ : schemas_1.MOTION_SEARCH_ERROR_CODES.SEARCH_ERROR;
1601
+ return {
1602
+ success: false,
1603
+ error: {
1604
+ code: errorCode,
1605
+ message: error instanceof Error ? error.message : "Search failed",
1606
+ },
1607
+ };
1608
+ }
1609
+ }
1610
+ /**
1611
+ * action: 'generate' の処理(Phase3-3統合)
1612
+ * v0.1.0: 重複検出機能追加
1613
+ */
1614
+ async function handleGenerateAction(validated) {
1615
+ if ((0, logger_1.isDevelopment)()) {
1616
+ logger_1.logger.info("[MCP Tool] motion.search action: generate", {
1617
+ hasPattern: !!validated.pattern,
1618
+ format: validated.format,
1619
+ checkDuplicates: validated.generation_options?.check_duplicates,
1620
+ });
1621
+ }
1622
+ // pattern が必須
1623
+ if (!validated.pattern) {
1624
+ return {
1625
+ success: false,
1626
+ error: {
1627
+ code: schemas_1.MOTION_MCP_ERROR_CODES.VALIDATION_ERROR,
1628
+ message: "action: generate には pattern パラメータが必要です",
1629
+ },
1630
+ };
1631
+ }
1632
+ try {
1633
+ const pattern = validated.pattern;
1634
+ const format = validated.format ?? "css";
1635
+ const options = {
1636
+ selector: validated.options?.selector ?? ".animated",
1637
+ includeVendorPrefixes: validated.options?.includeVendorPrefixes ?? false,
1638
+ includeReducedMotion: validated.options?.includeReducedMotion ?? true,
1639
+ typescript: validated.options?.typescript ?? true,
1640
+ componentName: validated.options?.componentName,
1641
+ };
1642
+ const generationOptions = validated.generation_options;
1643
+ // v0.1.0: 重複チェック実行
1644
+ let duplicateCheckResult;
1645
+ if (generationOptions?.check_duplicates) {
1646
+ try {
1647
+ duplicateCheckResult = await performDuplicateCheck(pattern, generationOptions);
1648
+ if ((0, logger_1.isDevelopment)()) {
1649
+ logger_1.logger.info("[MCP Tool] motion.search duplicate check completed", {
1650
+ hasDuplicates: duplicateCheckResult.has_duplicates,
1651
+ matchCount: duplicateCheckResult.existing_matches.length,
1652
+ });
1653
+ }
1654
+ }
1655
+ catch (error) {
1656
+ if ((0, logger_1.isDevelopment)()) {
1657
+ logger_1.logger.warn("[MCP Tool] motion.search duplicate check failed, continuing generation", {
1658
+ error: error instanceof Error ? error.message : "Unknown error",
1659
+ });
1660
+ }
1661
+ // 重複チェック失敗時は警告のみでコード生成は続行
1662
+ }
1663
+ }
1664
+ // サービス経由で生成(DIパターン)
1665
+ let result = null;
1666
+ const service = implementationServiceFactory?.();
1667
+ if (service?.generate) {
1668
+ try {
1669
+ result = service.generate(pattern, format, options);
1670
+ }
1671
+ catch (error) {
1672
+ if ((0, logger_1.isDevelopment)()) {
1673
+ logger_1.logger.error("[MCP Tool] motion.search generate service error", { error });
1674
+ }
1675
+ return {
1676
+ success: false,
1677
+ error: {
1678
+ code: schemas_1.MOTION_MCP_ERROR_CODES.INTERNAL_ERROR,
1679
+ message: error instanceof Error ? error.message : "Generation failed",
1680
+ },
1681
+ };
1682
+ }
1683
+ }
1684
+ else {
1685
+ // デフォルト実装
1686
+ result = generateImplementation(pattern, format, options);
1687
+ }
1688
+ if (!result) {
1689
+ return {
1690
+ success: false,
1691
+ error: {
1692
+ code: schemas_1.MOTION_MCP_ERROR_CODES.INTERNAL_ERROR,
1693
+ message: "Generation returned null",
1694
+ },
1695
+ };
1696
+ }
1697
+ if ((0, logger_1.isDevelopment)()) {
1698
+ logger_1.logger.info("[MCP Tool] motion.search generate completed", {
1699
+ format,
1700
+ linesOfCode: result.metadata.linesOfCode,
1701
+ hasDuplicateCheck: !!duplicateCheckResult,
1702
+ });
1703
+ }
1704
+ return {
1705
+ success: true,
1706
+ data: {
1707
+ code: result.code,
1708
+ format,
1709
+ metadata: result.metadata,
1710
+ duplicate_check: duplicateCheckResult,
1711
+ },
1712
+ };
1713
+ }
1714
+ catch (error) {
1715
+ if ((0, logger_1.isDevelopment)()) {
1716
+ logger_1.logger.error("[MCP Tool] motion.search generate error", { error });
1717
+ }
1718
+ return {
1719
+ success: false,
1720
+ error: {
1721
+ code: schemas_1.MOTION_MCP_ERROR_CODES.INTERNAL_ERROR,
1722
+ message: error instanceof Error ? error.message : "Generation failed",
1723
+ },
1724
+ };
1725
+ }
1726
+ }
1727
+ /**
1728
+ * 重複チェックを実行
1729
+ * v0.1.0: ExistingAnimationDetectorServiceを使用
1730
+ */
1731
+ async function performDuplicateCheck(pattern, generationOptions) {
1732
+ const detector = new existing_animation_detector_service_1.ExistingAnimationDetectorService();
1733
+ // MotionPatternInput を NewAnimationPattern に変換
1734
+ const newPattern = {
1735
+ name: pattern.name,
1736
+ type: pattern.type,
1737
+ duration: pattern.duration,
1738
+ easing: pattern.easing,
1739
+ properties: pattern.properties.map((p) => {
1740
+ const prop = {
1741
+ name: p.name,
1742
+ from: p.from,
1743
+ to: p.to,
1744
+ };
1745
+ // keyframesがundefinedでない場合のみ設定
1746
+ if (p.keyframes) {
1747
+ prop.keyframes = p.keyframes;
1748
+ }
1749
+ return prop;
1750
+ }),
1751
+ };
1752
+ // オプションを構築(undefinedフィールドを除外)
1753
+ const checkOptions = {
1754
+ similarityThreshold: generationOptions.similarity_threshold,
1755
+ };
1756
+ if (generationOptions.project_css_path) {
1757
+ checkOptions.projectCSSPath = generationOptions.project_css_path;
1758
+ }
1759
+ if (generationOptions.project_css_paths) {
1760
+ checkOptions.projectCSSPaths = generationOptions.project_css_paths;
1761
+ }
1762
+ const result = await detector.checkDuplicates(newPattern, checkOptions);
1763
+ // DuplicateCheckResult スキーマ形式に変換
1764
+ return {
1765
+ has_duplicates: result.hasDuplicates,
1766
+ existing_matches: result.existingMatches.map((match) => ({
1767
+ animation_name: match.animationName,
1768
+ file_path: match.filePath,
1769
+ similarity: match.similarity,
1770
+ suggestion: match.suggestion,
1771
+ })),
1772
+ warnings: result.warnings,
1773
+ };
1774
+ }
1775
+ // =====================================================
1776
+ // ツール定義
1777
+ // =====================================================
1778
+ exports.motionSearchToolDefinition = {
1779
+ name: "motion.search",
1780
+ description: "モーションパターンを類似検索、または実装コードを生成します。action: search(デフォルト)で検索、action: generateでCSS/JS実装コードを生成します。",
1781
+ annotations: {
1782
+ title: "Motion Search",
1783
+ readOnlyHint: true,
1784
+ idempotentHint: true,
1785
+ openWorldHint: false,
1786
+ },
1787
+ inputSchema: {
1788
+ type: "object",
1789
+ properties: {
1790
+ // Phase3-3: action parameter for consolidation
1791
+ action: {
1792
+ type: "string",
1793
+ enum: ["search", "generate"],
1794
+ default: "search",
1795
+ description: "アクション: search(デフォルト)= モーション検索、generate = 実装コード生成",
1796
+ },
1797
+ // === Search parameters (action: search) ===
1798
+ query: {
1799
+ type: "string",
1800
+ minLength: 1,
1801
+ maxLength: 500,
1802
+ description: "検索クエリ(自然言語、1-500文字)。action: searchで使用。",
1803
+ },
1804
+ samplePattern: {
1805
+ type: "object",
1806
+ description: "サンプルパターンで類似検索。action: searchで使用。",
1807
+ properties: {
1808
+ type: {
1809
+ type: "string",
1810
+ enum: ["animation", "transition", "transform", "scroll", "hover", "keyframe"],
1811
+ description: "モーションタイプ",
1812
+ },
1813
+ duration: {
1814
+ type: "number",
1815
+ minimum: 0,
1816
+ description: "アニメーション時間(ms)",
1817
+ },
1818
+ easing: {
1819
+ type: "string",
1820
+ description: "イージング関数",
1821
+ },
1822
+ properties: {
1823
+ type: "array",
1824
+ items: { type: "string" },
1825
+ description: "アニメーション対象プロパティ",
1826
+ },
1827
+ },
1828
+ },
1829
+ filters: {
1830
+ type: "object",
1831
+ description: "検索フィルター。action: searchで使用。",
1832
+ properties: {
1833
+ type: {
1834
+ type: "string",
1835
+ enum: ["animation", "transition", "transform", "scroll", "hover", "keyframe"],
1836
+ description: "タイプでフィルタリング",
1837
+ },
1838
+ minDuration: {
1839
+ type: "number",
1840
+ minimum: 0,
1841
+ description: "最小duration(ms)",
1842
+ },
1843
+ maxDuration: {
1844
+ type: "number",
1845
+ minimum: 0,
1846
+ description: "最大duration(ms)",
1847
+ },
1848
+ trigger: {
1849
+ type: "string",
1850
+ enum: ["load", "hover", "scroll", "click", "focus", "custom"],
1851
+ description: "トリガーでフィルタリング",
1852
+ },
1853
+ },
1854
+ },
1855
+ limit: {
1856
+ type: "number",
1857
+ minimum: 1,
1858
+ maximum: 50,
1859
+ default: 10,
1860
+ description: "結果制限(1-50、デフォルト: 10)。action: searchで使用。",
1861
+ },
1862
+ minSimilarity: {
1863
+ type: "number",
1864
+ minimum: 0,
1865
+ maximum: 1,
1866
+ default: 0.5,
1867
+ description: "最小類似度しきい値(0-1、デフォルト: 0.5)。action: searchで使用。",
1868
+ },
1869
+ // === JSAnimation search parameters (v0.1.0) ===
1870
+ include_js_animations: {
1871
+ type: "boolean",
1872
+ default: true,
1873
+ description: "JSアニメーションパターンを検索結果に含める(デフォルト: true)。action: searchで使用。",
1874
+ },
1875
+ js_animation_filters: {
1876
+ type: "object",
1877
+ description: "JSアニメーション検索フィルター。action: searchで使用。",
1878
+ properties: {
1879
+ libraryType: {
1880
+ type: "string",
1881
+ enum: [
1882
+ "gsap",
1883
+ "framer_motion",
1884
+ "anime_js",
1885
+ "three_js",
1886
+ "lottie",
1887
+ "web_animations_api",
1888
+ "unknown",
1889
+ ],
1890
+ description: "ライブラリタイプでフィルタリング(gsap, framer_motion, anime_js, three_js, lottie, web_animations_api, unknown)",
1891
+ },
1892
+ animationType: {
1893
+ type: "string",
1894
+ enum: [
1895
+ "tween",
1896
+ "timeline",
1897
+ "spring",
1898
+ "physics",
1899
+ "keyframe",
1900
+ "morphing",
1901
+ "path",
1902
+ "scroll_driven",
1903
+ "gesture",
1904
+ ],
1905
+ description: "アニメーションタイプでフィルタリング(tween, timeline, spring, physics, keyframe, morphing, path, scroll_driven, gesture)",
1906
+ },
1907
+ },
1908
+ },
1909
+ // === WebGLAnimation search parameters (v0.1.0) ===
1910
+ include_webgl_animations: {
1911
+ type: "boolean",
1912
+ default: true,
1913
+ description: "WebGLアニメーションパターンを検索結果に含める(デフォルト: true)。action: searchで使用。",
1914
+ },
1915
+ webgl_animation_filters: {
1916
+ type: "object",
1917
+ description: "WebGLアニメーション検索フィルター。action: searchで使用。",
1918
+ properties: {
1919
+ category: {
1920
+ type: "string",
1921
+ enum: [
1922
+ "fade",
1923
+ "pulse",
1924
+ "wave",
1925
+ "particle",
1926
+ "morph",
1927
+ "rotation",
1928
+ "parallax",
1929
+ "noise",
1930
+ "complex",
1931
+ ],
1932
+ description: "カテゴリでフィルタリング(fade, pulse, wave, particle, morph, rotation, parallax, noise, complex)",
1933
+ },
1934
+ detectedLibrary: {
1935
+ type: "string",
1936
+ description: "検出されたライブラリでフィルタリング(例: three.js, babylon.js)",
1937
+ },
1938
+ minConfidence: {
1939
+ type: "number",
1940
+ minimum: 0,
1941
+ maximum: 1,
1942
+ description: "最小信頼度しきい値(0-1)",
1943
+ },
1944
+ },
1945
+ },
1946
+ // === Implementation code parameter (v0.1.0) ===
1947
+ include_implementation: {
1948
+ type: "boolean",
1949
+ default: false,
1950
+ description: "検索結果に実装コード(@keyframes, animation, tailwindクラス)を含める(デフォルト: false)。action: searchで使用。",
1951
+ },
1952
+ // === Generate parameters (action: generate) ===
1953
+ pattern: {
1954
+ type: "object",
1955
+ description: "モーションパターン定義。action: generateで必須。",
1956
+ properties: {
1957
+ type: {
1958
+ type: "string",
1959
+ enum: ["animation", "transition", "transform", "scroll", "hover", "keyframe"],
1960
+ description: "パターンタイプ",
1961
+ },
1962
+ name: {
1963
+ type: "string",
1964
+ minLength: 1,
1965
+ maxLength: 100,
1966
+ description: "アニメーション名(1-100文字)",
1967
+ },
1968
+ properties: {
1969
+ type: "array",
1970
+ minItems: 1,
1971
+ description: "アニメーション対象プロパティ",
1972
+ items: {
1973
+ type: "object",
1974
+ properties: {
1975
+ name: { type: "string", description: "CSSプロパティ名" },
1976
+ from: { type: "string", description: "開始値" },
1977
+ to: { type: "string", description: "終了値" },
1978
+ keyframes: {
1979
+ type: "array",
1980
+ description: "中間キーフレーム(オプション)",
1981
+ items: {
1982
+ type: "object",
1983
+ properties: {
1984
+ offset: { type: "number", minimum: 0, maximum: 1 },
1985
+ value: { type: "string" },
1986
+ },
1987
+ },
1988
+ },
1989
+ },
1990
+ required: ["name", "from", "to"],
1991
+ },
1992
+ },
1993
+ duration: {
1994
+ type: "number",
1995
+ minimum: 0,
1996
+ maximum: 60000,
1997
+ default: 300,
1998
+ description: "アニメーション時間(ms、デフォルト: 300)",
1999
+ },
2000
+ delay: {
2001
+ type: "number",
2002
+ minimum: 0,
2003
+ maximum: 60000,
2004
+ default: 0,
2005
+ description: "遅延時間(ms、デフォルト: 0)",
2006
+ },
2007
+ easing: {
2008
+ type: "string",
2009
+ default: "ease",
2010
+ description: "イージング関数(デフォルト: ease)",
2011
+ },
2012
+ iterations: {
2013
+ oneOf: [
2014
+ { type: "number", minimum: 1 },
2015
+ { type: "string", enum: ["infinite"] },
2016
+ ],
2017
+ default: 1,
2018
+ description: "繰り返し回数(デフォルト: 1、またはinfinite)",
2019
+ },
2020
+ direction: {
2021
+ type: "string",
2022
+ enum: ["normal", "reverse", "alternate", "alternate-reverse"],
2023
+ default: "normal",
2024
+ description: "アニメーション方向(デフォルト: normal)",
2025
+ },
2026
+ fillMode: {
2027
+ type: "string",
2028
+ enum: ["none", "forwards", "backwards", "both"],
2029
+ default: "none",
2030
+ description: "フィルモード(デフォルト: none)",
2031
+ },
2032
+ },
2033
+ required: ["type", "name", "properties"],
2034
+ },
2035
+ format: {
2036
+ type: "string",
2037
+ enum: [
2038
+ "css",
2039
+ "css-module",
2040
+ "tailwind",
2041
+ "styled-components",
2042
+ "emotion",
2043
+ "framer-motion",
2044
+ "gsap",
2045
+ ],
2046
+ default: "css",
2047
+ description: "出力フォーマット(デフォルト: css)。action: generateで使用。",
2048
+ },
2049
+ options: {
2050
+ type: "object",
2051
+ description: "生成オプション。action: generateで使用。",
2052
+ properties: {
2053
+ selector: {
2054
+ type: "string",
2055
+ default: ".animated",
2056
+ description: "CSSセレクタ(デフォルト: .animated)",
2057
+ },
2058
+ componentName: {
2059
+ type: "string",
2060
+ description: "コンポーネント名(JSライブラリ用、省略時は自動生成)",
2061
+ },
2062
+ typescript: {
2063
+ type: "boolean",
2064
+ default: true,
2065
+ description: "TypeScriptコードを生成(デフォルト: true)",
2066
+ },
2067
+ includeReducedMotion: {
2068
+ type: "boolean",
2069
+ default: true,
2070
+ description: "prefers-reduced-motion対応を含める(デフォルト: true)",
2071
+ },
2072
+ includeVendorPrefixes: {
2073
+ type: "boolean",
2074
+ default: false,
2075
+ description: "ベンダープレフィックスを含める(デフォルト: false)",
2076
+ },
2077
+ },
2078
+ },
2079
+ // Preference reranking
2080
+ profile_id: {
2081
+ type: "string",
2082
+ format: "uuid",
2083
+ description: "嗜好プロファイルID(検索結果のリランキングに使用) / Preference profile ID (used for search result reranking)",
2084
+ },
2085
+ },
2086
+ },
2087
+ };
2088
+ //# sourceMappingURL=search.tool.js.map