myagent-ai 1.11.2 → 1.12.2

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 (414) hide show
  1. package/agents/__pycache__/main_agent.cpython-312.pyc +0 -0
  2. package/agents/__pycache__/memory_agent.cpython-312.pyc +0 -0
  3. package/agents/main_agent.py +49 -26
  4. package/agents/memory_agent.py +88 -0
  5. package/config.py +1 -0
  6. package/core/__pycache__/context_builder.cpython-312.pyc +0 -0
  7. package/core/__pycache__/output_parser.cpython-312.pyc +0 -0
  8. package/core/context_builder.py +102 -44
  9. package/main.py +32 -3
  10. package/memory/__pycache__/manager.cpython-312.pyc +0 -0
  11. package/memory/manager.py +69 -4
  12. package/package.json +1 -1
  13. package/skills/__pycache__/browser_skill.cpython-312.pyc +0 -0
  14. package/skills/__pycache__/file_skill.cpython-312.pyc +0 -0
  15. package/skills/__pycache__/registry.cpython-312.pyc +0 -0
  16. package/web/__pycache__/api_server.cpython-312.pyc +0 -0
  17. package/web/api_server.py +79 -76
  18. package/web/ui/chat/chat.css +13 -8
  19. package/web/ui/chat/chat_main.js +44 -10
  20. package/web/ui/chat/flow_engine.js +46 -4
  21. package/web/ui/chat/groupchat.js +1 -3
  22. package/web/ui/chat/left_sessions.html +1 -1
  23. package/web/ui/chat/right_agents.html +1 -1
  24. package/web/ui/index.html +20 -107
  25. package/skills/ASR/LICENSE.txt +0 -21
  26. package/skills/ASR/SKILL.md +0 -580
  27. package/skills/ASR/scripts/asr.ts +0 -27
  28. package/skills/LLM/LICENSE.txt +0 -21
  29. package/skills/LLM/SKILL.md +0 -856
  30. package/skills/LLM/scripts/chat.ts +0 -32
  31. package/skills/TTS/LICENSE.txt +0 -21
  32. package/skills/TTS/SKILL.md +0 -735
  33. package/skills/TTS/scripts/tts.ts +0 -25
  34. package/skills/VLM/LICENSE.txt +0 -21
  35. package/skills/VLM/SKILL.md +0 -621
  36. package/skills/VLM/scripts/vlm.ts +0 -57
  37. package/skills/agent-browser/SKILL.md +0 -327
  38. package/skills/ai-news-collectors/SKILL.md +0 -157
  39. package/skills/ai-news-collectors/_meta.json +0 -6
  40. package/skills/ai-news-collectors/references/sources.md +0 -128
  41. package/skills/aminer-open-academic/SKILL.md +0 -312
  42. package/skills/aminer-open-academic/_meta.json +0 -6
  43. package/skills/aminer-open-academic/evals/evals.json +0 -46
  44. package/skills/aminer-open-academic/references/api-catalog.md +0 -1032
  45. package/skills/aminer-open-academic/scripts/aminer_client.py +0 -875
  46. package/skills/auto-target-tracker/SKILL.md +0 -316
  47. package/skills/charts/LICENSE.txt +0 -13
  48. package/skills/charts/SKILL.md +0 -427
  49. package/skills/charts/references/_rules.md +0 -49
  50. package/skills/charts/references/d3.md +0 -199
  51. package/skills/charts/references/echarts.md +0 -651
  52. package/skills/charts/references/matplotlib.md +0 -617
  53. package/skills/charts/references/mermaid.md +0 -797
  54. package/skills/charts/references/mindmap-css.md +0 -911
  55. package/skills/charts/references/playwright-css.md +0 -801
  56. package/skills/charts/references/radial-grid.md +0 -576
  57. package/skills/charts/references/seaborn.md +0 -324
  58. package/skills/charts/setup.sh +0 -228
  59. package/skills/coding-agent/SKILL.md +0 -119
  60. package/skills/coding-agent/_meta.json +0 -6
  61. package/skills/coding-agent/criteria.md +0 -48
  62. package/skills/coding-agent/execution.md +0 -42
  63. package/skills/coding-agent/memory-template.md +0 -38
  64. package/skills/coding-agent/planning.md +0 -31
  65. package/skills/coding-agent/state.md +0 -60
  66. package/skills/coding-agent/verification.md +0 -39
  67. package/skills/contentanalysis/ExtractWisdom/SKILL.md +0 -226
  68. package/skills/contentanalysis/ExtractWisdom/Workflows/Extract.md +0 -60
  69. package/skills/contentanalysis/SKILL.md +0 -14
  70. package/skills/docx/CHANGELOG.md +0 -85
  71. package/skills/docx/LICENSE.txt +0 -13
  72. package/skills/docx/SKILL.md +0 -200
  73. package/skills/docx/docx-js.md +0 -681
  74. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  75. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  76. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  77. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  78. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  79. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  80. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  81. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  82. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  83. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  84. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  85. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  86. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  87. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  88. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  89. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  90. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  91. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  92. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  93. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  94. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  95. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  96. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  97. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  98. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  99. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  100. package/skills/docx/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  101. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  102. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  103. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  104. package/skills/docx/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  105. package/skills/docx/ooxml/schemas/mce/mc.xsd +0 -75
  106. package/skills/docx/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
  107. package/skills/docx/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
  108. package/skills/docx/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
  109. package/skills/docx/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
  110. package/skills/docx/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
  111. package/skills/docx/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  112. package/skills/docx/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
  113. package/skills/docx/ooxml/scripts/pack.py +0 -159
  114. package/skills/docx/ooxml/scripts/unpack.py +0 -29
  115. package/skills/docx/ooxml/scripts/validate.py +0 -69
  116. package/skills/docx/ooxml/scripts/validation/__init__.py +0 -15
  117. package/skills/docx/ooxml/scripts/validation/base.py +0 -951
  118. package/skills/docx/ooxml/scripts/validation/docx.py +0 -274
  119. package/skills/docx/ooxml/scripts/validation/pptx.py +0 -315
  120. package/skills/docx/ooxml/scripts/validation/redlining.py +0 -279
  121. package/skills/docx/ooxml.md +0 -615
  122. package/skills/docx/references/chart-templates.md +0 -386
  123. package/skills/docx/references/common-rules.md +0 -419
  124. package/skills/docx/references/decorations.md +0 -538
  125. package/skills/docx/references/design-system.md +0 -1797
  126. package/skills/docx/references/docx-js-advanced.md +0 -257
  127. package/skills/docx/references/docx-js-core.md +0 -333
  128. package/skills/docx/references/faq.md +0 -323
  129. package/skills/docx/references/math-formulas.md +0 -276
  130. package/skills/docx/references/ooxml.md +0 -222
  131. package/skills/docx/references/toc.md +0 -254
  132. package/skills/docx/routes/comment.md +0 -88
  133. package/skills/docx/routes/create.md +0 -207
  134. package/skills/docx/routes/edit.md +0 -115
  135. package/skills/docx/routes/format.md +0 -120
  136. package/skills/docx/routes/read.md +0 -114
  137. package/skills/docx/scenes/academic.md +0 -783
  138. package/skills/docx/scenes/contract.md +0 -463
  139. package/skills/docx/scenes/copywriting.md +0 -139
  140. package/skills/docx/scenes/exam.md +0 -698
  141. package/skills/docx/scenes/official-doc.md +0 -411
  142. package/skills/docx/scenes/report.md +0 -340
  143. package/skills/docx/scenes/resume.md +0 -534
  144. package/skills/docx/scripts/__init__.py +0 -1
  145. package/skills/docx/scripts/add_toc_placeholders.py +0 -749
  146. package/skills/docx/scripts/document.py +0 -1333
  147. package/skills/docx/scripts/postcheck.py +0 -807
  148. package/skills/docx/scripts/templates/comments.xml +0 -3
  149. package/skills/docx/scripts/templates/commentsExtended.xml +0 -3
  150. package/skills/docx/scripts/templates/commentsExtensible.xml +0 -3
  151. package/skills/docx/scripts/templates/commentsIds.xml +0 -3
  152. package/skills/docx/scripts/templates/people.xml +0 -3
  153. package/skills/docx/scripts/utilities.py +0 -374
  154. package/skills/docx/setup.sh +0 -177
  155. package/skills/finance/Finance_API_Doc.md +0 -445
  156. package/skills/finance/SKILL.md +0 -53
  157. package/skills/gift-evaluator/SKILL.md +0 -83
  158. package/skills/gift-evaluator/html_tools.py +0 -268
  159. package/skills/image-edit/LICENSE.txt +0 -21
  160. package/skills/image-edit/SKILL.md +0 -896
  161. package/skills/image-edit/scripts/image-edit.ts +0 -36
  162. package/skills/image-generation/LICENSE.txt +0 -21
  163. package/skills/image-generation/SKILL.md +0 -583
  164. package/skills/image-generation/scripts/image-generation.ts +0 -28
  165. package/skills/market-research-reports/SKILL.md +0 -901
  166. package/skills/market-research-reports/assets/FORMATTING_GUIDE.md +0 -428
  167. package/skills/market-research-reports/assets/market_report_template.tex +0 -1380
  168. package/skills/market-research-reports/assets/market_research.sty +0 -564
  169. package/skills/market-research-reports/references/data_analysis_patterns.md +0 -548
  170. package/skills/market-research-reports/references/report_structure_guide.md +0 -999
  171. package/skills/market-research-reports/references/visual_generation_guide.md +0 -1077
  172. package/skills/market-research-reports/scripts/generate_market_visuals.py +0 -529
  173. package/skills/marketing-mode/README.md +0 -49
  174. package/skills/marketing-mode/SKILL.md +0 -677
  175. package/skills/marketing-mode/_meta.json +0 -6
  176. package/skills/marketing-mode/mode-prompt.md +0 -39
  177. package/skills/marketing-mode/skill.json +0 -20
  178. package/skills/pdf/LICENSE.txt +0 -13
  179. package/skills/pdf/SKILL.md +0 -927
  180. package/skills/pdf/briefs/academic.md +0 -1049
  181. package/skills/pdf/briefs/creative.md +0 -770
  182. package/skills/pdf/briefs/poster.md +0 -702
  183. package/skills/pdf/briefs/process-advanced.md +0 -284
  184. package/skills/pdf/briefs/process.md +0 -319
  185. package/skills/pdf/briefs/report.md +0 -1657
  186. package/skills/pdf/configs/components.md +0 -153
  187. package/skills/pdf/configs/fonts.md +0 -93
  188. package/skills/pdf/configs/visual_framework.md +0 -263
  189. package/skills/pdf/forms.md +0 -205
  190. package/skills/pdf/reference.md +0 -765
  191. package/skills/pdf/references/resume-academic.tex +0 -130
  192. package/skills/pdf/references/resume-altacv.tex +0 -190
  193. package/skills/pdf/scripts/add_zai_metadata.py +0 -172
  194. package/skills/pdf/scripts/check_bounding_boxes.py +0 -70
  195. package/skills/pdf/scripts/check_bounding_boxes_test.py +0 -226
  196. package/skills/pdf/scripts/check_fillable_fields.py +0 -12
  197. package/skills/pdf/scripts/convert_pdf_to_images.py +0 -35
  198. package/skills/pdf/scripts/cover_validate.js +0 -367
  199. package/skills/pdf/scripts/create_validation_image.py +0 -41
  200. package/skills/pdf/scripts/design_engine.py +0 -2816
  201. package/skills/pdf/scripts/extract_form_field_info.py +0 -152
  202. package/skills/pdf/scripts/fill_fillable_fields.py +0 -114
  203. package/skills/pdf/scripts/fill_pdf_form_with_annotations.py +0 -108
  204. package/skills/pdf/scripts/html2pdf-next.js +0 -754
  205. package/skills/pdf/scripts/html2poster.js +0 -256
  206. package/skills/pdf/scripts/pdf.py +0 -2959
  207. package/skills/pdf/scripts/pdf_qa.py +0 -901
  208. package/skills/pdf/scripts/poster_validate.py +0 -1337
  209. package/skills/pdf/scripts/sanitize_code.py +0 -110
  210. package/skills/pdf/scripts/setup.sh +0 -269
  211. package/skills/pdf/scripts/tectonic +0 -0
  212. package/skills/pdf/scripts/toc_validate.py +0 -2075
  213. package/skills/pdf/typesetting/charts.md +0 -320
  214. package/skills/pdf/typesetting/cover-backgrounds.md +0 -384
  215. package/skills/pdf/typesetting/cover.md +0 -1442
  216. package/skills/pdf/typesetting/fill-engine.md +0 -527
  217. package/skills/pdf/typesetting/geometry.md +0 -142
  218. package/skills/pdf/typesetting/overflow.md +0 -630
  219. package/skills/pdf/typesetting/pagination.md +0 -367
  220. package/skills/pdf/typesetting/palette.md +0 -217
  221. package/skills/pdf/typesetting/typography.md +0 -20
  222. package/skills/podcast-generate/LICENSE.txt +0 -21
  223. package/skills/podcast-generate/SKILL.md +0 -198
  224. package/skills/podcast-generate/generate.ts +0 -661
  225. package/skills/podcast-generate/package.json +0 -30
  226. package/skills/podcast-generate/readme.md +0 -177
  227. package/skills/podcast-generate/test_data/segments.jsonl +0 -3
  228. package/skills/podcast-generate/tsconfig.json +0 -26
  229. package/skills/ppt/LICENSE.txt +0 -13
  230. package/skills/ppt/SKILL.md +0 -436
  231. package/skills/ppt/beamer.md +0 -1457
  232. package/skills/ppt/components.md +0 -1634
  233. package/skills/ppt/data-viz-components.md +0 -529
  234. package/skills/ppt/design-system.md +0 -206
  235. package/skills/ppt/html2pptx.md +0 -394
  236. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-chart.xsd +0 -1499
  237. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-chartDrawing.xsd +0 -146
  238. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-diagram.xsd +0 -1085
  239. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-lockedCanvas.xsd +0 -11
  240. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-main.xsd +0 -3081
  241. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-picture.xsd +0 -23
  242. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-spreadsheetDrawing.xsd +0 -185
  243. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/dml-wordprocessingDrawing.xsd +0 -287
  244. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/pml.xsd +0 -1676
  245. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-additionalCharacteristics.xsd +0 -28
  246. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-bibliography.xsd +0 -144
  247. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-commonSimpleTypes.xsd +0 -174
  248. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlDataProperties.xsd +0 -25
  249. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-customXmlSchemaProperties.xsd +0 -18
  250. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesCustom.xsd +0 -59
  251. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesExtended.xsd +0 -56
  252. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-documentPropertiesVariantTypes.xsd +0 -195
  253. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-math.xsd +0 -582
  254. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/shared-relationshipReference.xsd +0 -25
  255. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/sml.xsd +0 -4439
  256. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/vml-main.xsd +0 -570
  257. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/vml-officeDrawing.xsd +0 -509
  258. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/vml-presentationDrawing.xsd +0 -12
  259. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/vml-spreadsheetDrawing.xsd +0 -108
  260. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/vml-wordprocessingDrawing.xsd +0 -96
  261. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/wml.xsd +0 -3646
  262. package/skills/ppt/ooxml/schemas/ISO-IEC29500-4_2016/xml.xsd +0 -116
  263. package/skills/ppt/ooxml/schemas/ecma/fouth-edition/opc-contentTypes.xsd +0 -42
  264. package/skills/ppt/ooxml/schemas/ecma/fouth-edition/opc-coreProperties.xsd +0 -50
  265. package/skills/ppt/ooxml/schemas/ecma/fouth-edition/opc-digSig.xsd +0 -49
  266. package/skills/ppt/ooxml/schemas/ecma/fouth-edition/opc-relationships.xsd +0 -33
  267. package/skills/ppt/ooxml/schemas/mce/mc.xsd +0 -75
  268. package/skills/ppt/ooxml/schemas/microsoft/wml-2010.xsd +0 -560
  269. package/skills/ppt/ooxml/schemas/microsoft/wml-2012.xsd +0 -67
  270. package/skills/ppt/ooxml/schemas/microsoft/wml-2018.xsd +0 -14
  271. package/skills/ppt/ooxml/schemas/microsoft/wml-cex-2018.xsd +0 -20
  272. package/skills/ppt/ooxml/schemas/microsoft/wml-cid-2016.xsd +0 -13
  273. package/skills/ppt/ooxml/schemas/microsoft/wml-sdtdatahash-2020.xsd +0 -4
  274. package/skills/ppt/ooxml/schemas/microsoft/wml-symex-2015.xsd +0 -8
  275. package/skills/ppt/ooxml/scripts/pack.py +0 -159
  276. package/skills/ppt/ooxml/scripts/unpack.py +0 -29
  277. package/skills/ppt/ooxml/scripts/validate.py +0 -69
  278. package/skills/ppt/ooxml/scripts/validation/__init__.py +0 -15
  279. package/skills/ppt/ooxml/scripts/validation/base.py +0 -951
  280. package/skills/ppt/ooxml/scripts/validation/docx.py +0 -274
  281. package/skills/ppt/ooxml/scripts/validation/pptx.py +0 -315
  282. package/skills/ppt/ooxml/scripts/validation/redlining.py +0 -279
  283. package/skills/ppt/ooxml.md +0 -427
  284. package/skills/ppt/references/beamer.md +0 -721
  285. package/skills/ppt/references/latex.md +0 -342
  286. package/skills/ppt/references/paper-navbar.tex +0 -73
  287. package/skills/ppt/references/progress-navbar.tex +0 -151
  288. package/skills/ppt/scripts/html2pptx.js +0 -1329
  289. package/skills/ppt/scripts/inventory.py +0 -512
  290. package/skills/ppt/scripts/pdf.py +0 -2959
  291. package/skills/ppt/scripts/rearrange.py +0 -135
  292. package/skills/ppt/scripts/replace.py +0 -231
  293. package/skills/ppt/scripts/tectonic +0 -0
  294. package/skills/ppt/scripts/thumbnail.py +0 -352
  295. package/skills/ppt/setup.sh +0 -197
  296. package/skills/ppt/themes.md +0 -506
  297. package/skills/qingyan-research/SKILL.md +0 -294
  298. package/skills/qingyan-research/generate_html.py +0 -33
  299. package/skills/seo-content-writer/SKILL.md +0 -625
  300. package/skills/seo-content-writer/_meta.json +0 -6
  301. package/skills/seo-content-writer/references/content-structure-templates.md +0 -875
  302. package/skills/seo-content-writer/references/title-formulas.md +0 -339
  303. package/skills/skill-creator/LICENSE.txt +0 -202
  304. package/skills/skill-creator/SKILL.md +0 -485
  305. package/skills/skill-creator/agents/analyzer.md +0 -274
  306. package/skills/skill-creator/agents/comparator.md +0 -202
  307. package/skills/skill-creator/agents/grader.md +0 -223
  308. package/skills/skill-creator/assets/eval_review.html +0 -146
  309. package/skills/skill-creator/eval-viewer/generate_review.py +0 -471
  310. package/skills/skill-creator/eval-viewer/viewer.html +0 -1325
  311. package/skills/skill-creator/references/schemas.md +0 -430
  312. package/skills/skill-creator/scripts/__init__.py +0 -0
  313. package/skills/skill-creator/scripts/aggregate_benchmark.py +0 -401
  314. package/skills/skill-creator/scripts/generate_report.py +0 -326
  315. package/skills/skill-creator/scripts/improve_description.py +0 -236
  316. package/skills/skill-creator/scripts/package_skill.py +0 -136
  317. package/skills/skill-creator/scripts/quick_validate.py +0 -103
  318. package/skills/skill-creator/scripts/run_eval.py +0 -310
  319. package/skills/skill-creator/scripts/run_loop.py +0 -328
  320. package/skills/skill-creator/scripts/utils.py +0 -47
  321. package/skills/stock-analysis-skill/SKILL.md +0 -156
  322. package/skills/stock-analysis-skill/package.json +0 -21
  323. package/skills/stock-analysis-skill/src/analyzer.ts +0 -264
  324. package/skills/stock-analysis-skill/src/dataFetcher.ts +0 -130
  325. package/skills/stock-analysis-skill/src/dividend.ts +0 -226
  326. package/skills/stock-analysis-skill/src/index.ts +0 -327
  327. package/skills/stock-analysis-skill/src/rumorScanner.ts +0 -200
  328. package/skills/stock-analysis-skill/src/types.ts +0 -167
  329. package/skills/stock-analysis-skill/src/watchlist.ts +0 -308
  330. package/skills/stock-analysis-skill/tsconfig.json +0 -15
  331. package/skills/storyboard-manager/SKILL.md +0 -532
  332. package/skills/storyboard-manager/index.js +0 -9
  333. package/skills/storyboard-manager/package.json +0 -11
  334. package/skills/storyboard-manager/references/character_development.md +0 -232
  335. package/skills/storyboard-manager/references/story_structures.md +0 -148
  336. package/skills/storyboard-manager/scripts/consistency_checker.py +0 -391
  337. package/skills/storyboard-manager/scripts/timeline_tracker.py +0 -352
  338. package/skills/ui-ux-pro-max/SKILL.md +0 -43
  339. package/skills/ui-ux-pro-max/_meta.json +0 -6
  340. package/skills/ui-ux-pro-max/assets/data/charts.csv +0 -26
  341. package/skills/ui-ux-pro-max/assets/data/colors.csv +0 -97
  342. package/skills/ui-ux-pro-max/assets/data/icons.csv +0 -101
  343. package/skills/ui-ux-pro-max/assets/data/landing.csv +0 -31
  344. package/skills/ui-ux-pro-max/assets/data/products.csv +0 -97
  345. package/skills/ui-ux-pro-max/assets/data/react-performance.csv +0 -45
  346. package/skills/ui-ux-pro-max/assets/data/stacks/astro.csv +0 -54
  347. package/skills/ui-ux-pro-max/assets/data/stacks/flutter.csv +0 -53
  348. package/skills/ui-ux-pro-max/assets/data/stacks/html-tailwind.csv +0 -56
  349. package/skills/ui-ux-pro-max/assets/data/stacks/jetpack-compose.csv +0 -53
  350. package/skills/ui-ux-pro-max/assets/data/stacks/nextjs.csv +0 -53
  351. package/skills/ui-ux-pro-max/assets/data/stacks/nuxt-ui.csv +0 -51
  352. package/skills/ui-ux-pro-max/assets/data/stacks/nuxtjs.csv +0 -59
  353. package/skills/ui-ux-pro-max/assets/data/stacks/react-native.csv +0 -52
  354. package/skills/ui-ux-pro-max/assets/data/stacks/react.csv +0 -54
  355. package/skills/ui-ux-pro-max/assets/data/stacks/shadcn.csv +0 -61
  356. package/skills/ui-ux-pro-max/assets/data/stacks/svelte.csv +0 -54
  357. package/skills/ui-ux-pro-max/assets/data/stacks/swiftui.csv +0 -51
  358. package/skills/ui-ux-pro-max/assets/data/stacks/vue.csv +0 -50
  359. package/skills/ui-ux-pro-max/assets/data/styles.csv +0 -68
  360. package/skills/ui-ux-pro-max/assets/data/typography.csv +0 -58
  361. package/skills/ui-ux-pro-max/assets/data/ui-reasoning.csv +0 -101
  362. package/skills/ui-ux-pro-max/assets/data/ux-guidelines.csv +0 -100
  363. package/skills/ui-ux-pro-max/assets/data/web-interface.csv +0 -31
  364. package/skills/ui-ux-pro-max/references/upstream-README.md +0 -488
  365. package/skills/ui-ux-pro-max/references/upstream-skill-content.md +0 -288
  366. package/skills/ui-ux-pro-max/scripts/__init__.py +0 -0
  367. package/skills/ui-ux-pro-max/scripts/core.py +0 -253
  368. package/skills/ui-ux-pro-max/scripts/design_system.py +0 -1071
  369. package/skills/ui-ux-pro-max/scripts/search.py +0 -111
  370. package/skills/video-generation/LICENSE.txt +0 -21
  371. package/skills/video-generation/SKILL.md +0 -1082
  372. package/skills/video-generation/scripts/video.ts +0 -168
  373. package/skills/web-reader/LICENSE.txt +0 -21
  374. package/skills/web-reader/SKILL.md +0 -1140
  375. package/skills/web-reader/scripts/web-reader.ts +0 -37
  376. package/skills/web-search/LICENSE.txt +0 -21
  377. package/skills/web-search/SKILL.md +0 -912
  378. package/skills/web-search/scripts/web_search.ts +0 -44
  379. package/skills/web-shader-extractor/SKILL.md +0 -145
  380. package/skills/web-shader-extractor/references/config-extraction.md +0 -50
  381. package/skills/web-shader-extractor/references/encoded-definitions.md +0 -53
  382. package/skills/web-shader-extractor/references/extraction-workflow.md +0 -61
  383. package/skills/web-shader-extractor/references/porting-strategy.md +0 -164
  384. package/skills/web-shader-extractor/references/shader-injection.md +0 -126
  385. package/skills/web-shader-extractor/references/shaders-com.md +0 -190
  386. package/skills/web-shader-extractor/references/tech-signatures.md +0 -54
  387. package/skills/web-shader-extractor/references/tsl-extraction.md +0 -41
  388. package/skills/web-shader-extractor/references/unicorn-studio.md +0 -353
  389. package/skills/web-shader-extractor/scripts/fetch-rendered-dom.mjs +0 -153
  390. package/skills/web-shader-extractor/scripts/scan-bundle.sh +0 -76
  391. package/skills/writing-plans/SKILL.md +0 -113
  392. package/skills/writing-plans/_meta.json +0 -6
  393. package/skills/xlsx/LICENSE.txt +0 -13
  394. package/skills/xlsx/SKILL.md +0 -230
  395. package/skills/xlsx/engines/chart-templates.md +0 -167
  396. package/skills/xlsx/engines/chart.md +0 -87
  397. package/skills/xlsx/engines/design.md +0 -575
  398. package/skills/xlsx/engines/vba-templates.md +0 -435
  399. package/skills/xlsx/quality/pipeline.md +0 -196
  400. package/skills/xlsx/recalc.py +0 -178
  401. package/skills/xlsx/scenes/advanced.md +0 -271
  402. package/skills/xlsx/scenes/analyze-recipes.md +0 -234
  403. package/skills/xlsx/scenes/analyze.md +0 -95
  404. package/skills/xlsx/scenes/convert.md +0 -133
  405. package/skills/xlsx/scenes/create.md +0 -105
  406. package/skills/xlsx/scenes/edit-patterns.md +0 -222
  407. package/skills/xlsx/scenes/edit.md +0 -195
  408. package/skills/xlsx/scenes/finance.md +0 -318
  409. package/skills/xlsx/scenes/finance_lite.md +0 -192
  410. package/skills/xlsx/scenes/vba.md +0 -298
  411. package/skills/xlsx/setup.sh +0 -136
  412. package/skills/xlsx/templates/base.py +0 -632
  413. package/skills/xlsx/templates/palettes.py +0 -521
  414. package/skills/xlsx/xlsx.py +0 -1299
@@ -1,190 +0,0 @@
1
- # shaders.com 提取工作流
2
-
3
- shaders.com 是一个 shader 设计工具,使用 Nuxt.js + Three.js r183 TSL + Supabase。
4
-
5
- ## 识别特征
6
-
7
- - URL: `shaders.com/collection/{slug}/{presetId}` 或 `shaders.com/preset/{id}`
8
- - Canvas: `data-renderer="shaders"` + `data-engine="three.js r183"`
9
- - Nuxt.js (`_nuxt/` 路径)
10
- - Clerk 认证
11
- - Supabase 存储 (`data.shaders.com/storage/v1/`)
12
-
13
- ## 关键架构差异
14
-
15
- 与 Unicorn Studio 完全不同:
16
- - **不使用 GLSL** — 使用 Three.js TSL (Three Shader Language) 节点系统
17
- - **87 种组件类型** — 每种有自己的 TSL `fragmentNode` 函数
18
- - **定义数据是 XOR + base64 编码的**
19
- - **组件可嵌套** — 树形结构(Glass 的 children 是其内部效果)
20
-
21
- ## 数据获取
22
-
23
- ### API 端点
24
-
25
- ```bash
26
- # 集合变体(含编码定义)— 公开,无需认证
27
- curl -s "https://shaders.com/api/collections/{slug}/{variantId}"
28
-
29
- # 预览 API(含编码定义 + 水印注入)
30
- curl -s "https://shaders.com/api/preview/preset/{presetId}"
31
-
32
- # Nuxt payload(只含元数据,不含 shader 定义)
33
- curl -s "https://shaders.com/collection/{slug}/{id}/_payload.json"
34
- ```
35
-
36
- ### 定义解码
37
-
38
- 定义使用 XOR + base64 编码,有两套密钥:
39
-
40
- 1. **网站 API**(`/api/collections/`):
41
- - 混淆密钥: `a5e7244ad0973f07e10285bfa75ddbe4`(来自 Nuxt runtime config)
42
- - 组件/属性名用短代码(`C52`=Plasma, `p06`=angle, 等)
43
- - 解码: `JSON.parse(XOR(base64decode(encoded), keyBytes))`
44
- - 然后需要 code→name 映射表还原可读名称
45
-
46
- 2. **预览 API**(`/api/preview/`):
47
- - 密钥: `shaders-preview-key`
48
- - 使用人类可读属性名(无需映射)
49
- - 注意:会注入水印 `ImageTexture` 组件
50
-
51
- ### 代码映射表
52
-
53
- 87 种组件按字母排序编号 `C00-C86`,233 种属性按字母排序编号 `p00-p232`。
54
- 映射表可从 JS bundle 中提取。
55
-
56
- ## 已知陷阱
57
-
58
- ### Y 轴翻转(反复出现!)
59
-
60
- **SDF 纹理和 UV 坐标系统性 Y 翻转** — 已在多次提取中确认:
61
-
62
- shaders.com 的 SDF 二进制(`.bin`)使用**图像坐标系**(Y=0 在顶部),
63
- 而 WebGL 纹理坐标 Y=0 在底部。直接加载会导致形状上下翻转。
64
-
65
- ```glsl
66
- // 错误:直接用 shapeUV 采样
67
- float sdf = texture(tSDF, shapeUV).r;
68
-
69
- // 正确:翻转 Y
70
- vec2 sdfUV = vec2(shapeUV.x, 1.0 - shapeUV.y);
71
- float sdf = texture(tSDF, sdfUV).r;
72
-
73
- // 注意:梯度的 Y 分量也需要取反
74
- float dSdy = -(texture(tSDF, sdfUV - vec2(0, eps)).r - sdf) / eps;
75
- ```
76
-
77
- 同样,组件定义中的 `center.y` 使用 DOM 坐标(Y=0 在顶部),
78
- 在 Glass shader 中需要翻转:`center.y = 1.0 - center.y`。
79
-
80
- ### SDF 二进制格式
81
-
82
- - 格式:512×512 Float32 单通道(1,048,576 bytes = 512² × 4)
83
- - 值域:有符号距离,负值=内部,正值=外部(如 [-0.065, 0.486])
84
- - **不需要重映射**(不要做 `*2-1`),直接使用原始值
85
- - 需要 `OES_texture_float_linear` 扩展做线性过滤
86
- - WebGL2 加载:`gl.texImage2D(gl.TEXTURE_2D, 0, gl.R32F, 512, 512, 0, gl.RED, gl.FLOAT, data)`
87
-
88
- ## 组件类型速查
89
-
90
- | 类别 | 组件 | 复杂度 |
91
- |------|------|--------|
92
- | 纹理 | Plasma, Godrays, SimplexNoise, LinearGradient, RadialGradient | 中 |
93
- | 形状 | Glass, Blob, Circle, Ring, Star, RoundedRect, Polygon | 高(Glass 最复杂) |
94
- | 畸变 | WaveDistortion, ChromaticAberration, Liquify, Twirl, Bulge | 低-中 |
95
- | 风格化 | FilmGrain, Halftone, Ascii, Dither, Glow, Bloom | 低-中 |
96
- | 后处理 | Blur, ProgressiveBlur, BrightnessContrast, HueShift | 低 |
97
-
98
- ## 渲染管线
99
-
100
- ```
101
- Three.js r183 TSL 渲染器
102
- ├─ 优先尝试 WebGPU,降级到 WebGL
103
- ├─ 正交相机 + 单个全屏四边形
104
- ├─ 组件树从底到顶合成
105
- ├─ 有 children 的组件用 RTT (render-to-texture) 捕获子内容
106
- ├─ blend mode 用自定义混合函数
107
- └─ Glass 组件最复杂:SDF 评估 → 梯度法线 → 折射 → 色差 → 模糊 → 着色 → 高光 → 菲涅尔 → 合成
108
- ```
109
-
110
- ## 移植策略
111
-
112
- 1. **TSL 不能直接复制** — 需要翻译为 GLSL
113
- 2. **从 JS bundle 提取 TSL `fragmentNode`** → 反混淆 → 翻译为 GLSL
114
- 3. **组件树 → multi-pass FBO 管线**
115
- 4. **SDF 纹理需要 Y-flip**(见上方陷阱)
116
- 5. **Glass 组件参数多**(20+),需要精确匹配每个值
117
-
118
- ## 颜色空间处理(关键)
119
-
120
- shaders.com 的 Three.js 渲染器全程在 **linear 空间** 工作:
121
- - 组件定义中的 hex 颜色(如 `#2c2c42`)是 **sRGB** 值
122
- - TSL 的 `color()` 函数自动将 sRGB→linear
123
- - 所有中间 FBO 均存储 linear 值
124
- - 最终由渲染器做 linear→sRGB 输出编码
125
-
126
- 移植时:
127
- ```glsl
128
- // 1. 颜色定义时:sRGB hex → linear
129
- vec3 colorA = pow(vec3(0.173, 0.173, 0.259), vec3(2.2)); // #2c2c42
130
-
131
- // 2. 中间 pass:全部在 linear 空间计算,不做 gamma
132
- // 3. 最终输出 pass(仅一次):linear → sRGB
133
- fragColor = vec4(pow(color.rgb, vec3(1.0/2.2)), color.a);
134
- ```
135
-
136
- **常见错误**:在中间 pass 做 gamma 校正,导致后续 pass 在错误空间累加高光/菲涅尔。
137
-
138
- ## 参数精确对齐原则
139
-
140
- **绝对禁止手动调参**。所有参数必须严格匹配 TSL 翻译中的公式和乘数:
141
-
142
- ```
143
- TSL 原始乘数 → GLSL 必须使用的值
144
- aberration * 0.06 → 不能改为 0.12
145
- fresnelSoftness * 0.06 → 不能改为 0.12
146
- fresnel (0.17) → 不能改为 0.4
147
- SDF gradient eps = 0.01 → 不能改为 0.005
148
- ```
149
-
150
- 如果视觉效果不匹配,应检查:
151
- 1. 颜色空间是否正确(sRGB/linear 混乱是最常见原因)
152
- 2. 噪声函数实现差异(Perlin 实现 vs `mx_noise_float`)
153
- 3. 时间基准是否正确
154
- 4. FBO 管线顺序是否与组件树匹配
155
-
156
- **不要**通过修改乘数来"补偿"视觉差异 — 这会在其他参数配置下崩溃。
157
-
158
- ## TSL 时间约定
159
-
160
- `timerLocal(speed)` = 每秒递增 `speed` 单位。移植时:`uTime = seconds * speed`。
161
-
162
- 然后 shader 内部再乘自己的系数:
163
-
164
- | 组件 | speed 参数 | shader 内部乘数 | 实际速率/秒 |
165
- |------|-----------|----------------|------------|
166
- | Plasma | 2 | × 0.125 | 0.25 |
167
- | Godrays | 0.7 | × 0.2 | 0.14 |
168
- | WaveDistortion | 0.8 | × 0.5 | 0.4 |
169
- | FilmGrain | — | 无时间(静态) | 0 |
170
-
171
- ## TSL→GLSL 标识符映射(SPCVwBqR.js)
172
-
173
- 常用映射(随构建版本变化,需动态提取):
174
-
175
- | 本地名 | TSL 函数 | GLSL |
176
- |--------|---------|------|
177
- | C / z | vec4() | vec4 |
178
- | x / D | vec2() | vec2 |
179
- | q / N | vec3() | vec3 |
180
- | P / J | resolution | u_resolution |
181
- | A / $ | uv | vUv |
182
- | se / Oe | sin() | sin() |
183
- | W / I | cos() | cos() |
184
- | ne | mix() | mix() |
185
- | D | smoothstep() | smoothstep() |
186
- | fe | clamp() | clamp() |
187
- | ar | mx_noise_float() | perlinNoise3D() |
188
- | dr / Gt | timerLocal() | u_time × speed |
189
- | Me / wt | rtt() | FBO pass |
190
- | Ce | renderOutput() | fragColor |
@@ -1,54 +0,0 @@
1
- # 框架识别特征
2
-
3
- ## Three.js
4
-
5
- **未混淆**:`THREE.`, `WebGLRenderer`, `ShaderMaterial`, `BufferGeometry`
6
-
7
- **混淆后**(通过构造参数推断):
8
-
9
- | 调用模式 | 原始类 |
10
- |---------|--------|
11
- | `new X({canvas, antialias, alpha})` | `WebGLRenderer` |
12
- | `new X(fov, aspect, near, far)` — 4 数字 | `PerspectiveCamera` |
13
- | `new X(-1, 1, 1, -1, 0, 1)` — 6 参数 | `OrthographicCamera` |
14
- | `new X(w, h, {wrapS, minFilter})` | `WebGLRenderTarget` |
15
- | `new X(data, w, h, format, type)` — Float32Array | `DataTexture` |
16
- | `new X(2, 2)` 作为几何体 | `PlaneGeometry` |
17
- | `new X({uniforms, vertexShader, fragmentShader})` | `ShaderMaterial` |
18
- | `X.getElapsedTime()` | `Clock` |
19
-
20
- **常量**:`ClampToEdgeWrapping`, `NearestFilter`, `RGBAFormat`, `FloatType`, `DoubleSide`
21
-
22
- ## 2D Canvas
23
-
24
- `dataEngine: null` 时,用 `getContext('2d')` 有无 + `createShader`/`shaderSource` 有无区分:
25
- - 有 `getContext('2d')`,无 WebGL 调用 → 纯 2D Canvas
26
- - 有 WebGL 调用 → Raw WebGL / PixiJS
27
-
28
- ## Raw WebGL
29
-
30
- ```javascript
31
- gl.createShader / gl.shaderSource / gl.compileShader / gl.createProgram
32
- gl.bindBuffer / gl.bindFramebuffer / gl.drawArrays
33
- ```
34
-
35
- ## PixiJS
36
-
37
- `PIXI.Application`, `PIXI.Filter`, `new PIXI.Filter(vertSrc, fragSrc, uniforms)`
38
-
39
- ## Babylon.js
40
-
41
- `BABYLON.Engine`, `BABYLON.ShaderMaterial`, `BABYLON.Effect.ShadersStore`
42
-
43
- ## GPGPU 模式
44
-
45
- 两个 `WebGLRenderTarget`(ping-pong)+ `OrthographicCamera(-1,1,1,-1,0,1)` + `PlaneGeometry(2,2)` + `DataTexture` 初始位置 + `setRenderTarget` 循环
46
-
47
- ## 常见噪声
48
-
49
- | 函数 | 类型 |
50
- |------|------|
51
- | `snoise` | Simplex noise (Ashima) |
52
- | `cnoise` | Classic Perlin |
53
- | `cellular` | Worley/Voronoi |
54
- | `fbm` | Fractal Brownian Motion |
@@ -1,41 +0,0 @@
1
- # Three.js TSL 识别与重建
2
-
3
- Three.js r170+ 的 TSL (Three Shading Language) 用 JS 函数调用链组合 shader 节点图,运行时编译为 GLSL。
4
-
5
- ## 识别信号
6
-
7
- 1. Bundle 有大量 `uniform`/`shader` 但几乎没有 `precision`/`gl_FragColor`
8
- 2. canvas `data-engine` 显示 r170+
9
- 3. 存在 `.mul()`/`.add()`/`.toVar()`/`.assign()` 链式调用
10
-
11
- ## TSL → GLSL 映射
12
-
13
- | TSL | GLSL |
14
- |-----|------|
15
- | `screenUV` | `gl_FragCoord.xy / resolution` |
16
- | `viewportSize` | `uniform vec2 resolution` |
17
- | `float()`/`vec2()`/`vec3()`/`vec4()` | 同名(但 TSL 中是 JS 函数) |
18
- | `.mul()`/`.add()`/`.sub()`/`.div()` | `*`/`+`/`-`/`/` |
19
- | `sin()`/`cos()`/`mix()`/`smoothstep()` | 同名 |
20
- | `clamp()`/`abs()`/`fract()`/`floor()` | 同名 |
21
- | `pow()`/`exp()`/`sqrt()`/`dot()`/`length()` | 同名 |
22
- | `Fn()` | shader 函数包裹器(内联到 GLSL) |
23
- | `uniform()` | `uniform <type> name` |
24
- | `convertToTexture()` | RTT(多 pass 渲染) |
25
- | `.sample(uv)` | `texture(sampler, uv)` |
26
- | `.toVar()`/`.assign()` | 声明/赋值可变变量 |
27
- | `.oneMinus()` | `1.0 - x` |
28
-
29
- ## 重建步骤
30
-
31
- 1. **定位**:搜索组件名附近的 `fragmentNode` 属性
32
- 2. **映射表**:从 bundle 顶部 import 语句推断 minified → TSL 函数名
33
- ```javascript
34
- import { A as screenUV, W as sin, ... } from "three-module"
35
- ```
36
- 3. **翻译**:链式调用 → GLSL 表达式
37
- ```javascript
38
- // TSL: screenUV.x.sub(center.x).mul(aspect)
39
- // GLSL: (uv.x - center.x) * aspect
40
- ```
41
- 4. **RTT**:`convertToTexture(childNode)` → 独立 pass 渲染到 FBO,主 shader 中 `texture()` 采样
@@ -1,353 +0,0 @@
1
- # Unicorn Studio 提取工作流
2
-
3
- Unicorn Studio (unicorn.studio) 是一个 no-code WebGL 设计工具,使用 curtains.js 作为渲染引擎,Firebase/Firestore 作为后端。
4
-
5
- ## 识别特征
6
-
7
- - URL 模式: `unicorn.studio/remix/{remixId}` 或 `unicorn.studio/edit/{designId}`
8
- - Meta tag: `<meta name="ai:technical-stack" content="Vue 3, curtains.js, Firebase, JavaScript SDK">`
9
- - 嵌入 SDK: `unicornStudio-*.js`(~84KB embed 版本)
10
- - 主应用 bundle: `index-*.js`(~2.1MB,含 shader 模板)
11
-
12
- ## 数据获取路径
13
-
14
- ### 路径 1: Firestore REST API(推荐,适用于 remix)
15
-
16
- ```bash
17
- # Firebase 配置(从 unicorn.studio 前端 JS bundle 中提取,每次提取时动态获取)
18
- # 获取方式:curl -s https://www.unicorn.studio/ | grep -oP 'apiKey:"[^"]+"' | head -1
19
- API_KEY="<从网站 bundle 动态提取>"
20
- PROJECT="unicorn-studio"
21
-
22
- # Step 1: 获取 remix 元数据(含 versionId、designId、cre建者信息)
23
- curl -s "https://firestore.googleapis.com/v1/projects/$PROJECT/databases/(default)/documents/remixes/{REMIX_ID}?key=$API_KEY"
24
-
25
- # Step 2: 获取版本数据(含所有图层定义、参数、纹理引用)
26
- # versionId 从 Step 1 的 fields.versionId.stringValue 提取
27
- curl -s "https://firestore.googleapis.com/v1/projects/$PROJECT/databases/(default)/documents/versions/{VERSION_ID}?key=$API_KEY"
28
- ```
29
-
30
- ### 路径 2: GCS/CDN Embed 数据(适用于已发布的嵌入)
31
-
32
- ```bash
33
- # 非 Pro 用户
34
- curl -s "https://storage.googleapis.com/unicornstudio-production/embeds/{DESIGN_ID}"
35
-
36
- # Pro 用户
37
- curl -s "https://assets.unicorn.studio/embeds/{DESIGN_ID}"
38
- ```
39
-
40
- Embed JSON 格式: `{ options: {...}, layers/history: [...], modules: [...] }`
41
- 包含 `compiledFragmentShaders[]` 和 `compiledVertexShaders[]`(已编译的 GLSL)。
42
-
43
- ### 路径 3: 从页面内嵌 JSON 提取
44
-
45
- Unicorn Studio 嵌入使用 `data-us-project` 或 `data-us-project-src` HTML 属性,
46
- SDK `init()` 会扫描这些属性并加载对应项目。
47
-
48
- ## 先判断数据形态
49
-
50
- Unicorn Studio 至少有两种常见数据形态:
51
-
52
- ### 1. embed/export scene
53
-
54
- - 一般是最终给 `addScene()` 的 scene JSON
55
- - 往往已经带 `compiledFragmentShaders[]` / `compiledVertexShaders[]`
56
- - 这种格式可以直接喂给 embed runtime
57
-
58
- ### 2. editor/version history
59
-
60
- - 常见来源是 Firestore `versions/{id}` 的 `history`
61
- - 这是编辑器原始层数据,**不能**直接喂给 `addScene()`
62
-
63
- 如果把 `history` 误当 embed scene,典型症状是:
64
-
65
- - `Plane: No fragment shader provided, will use a default one`
66
- - `Plane: No vertex shader provided, will use a default one`
67
- - `No composite shader data for element`
68
- - canvas 创建成功,但画面全黑或只剩默认层
69
-
70
- ## Firestore 集合结构
71
-
72
- | Collection | 用途 | 关键字段 |
73
- |---|---|---|
74
- | `designs` | 设计元数据 | creatorId, name, versionId, hasEmbed |
75
- | `versions` | 版本数据(核心) | history[], options |
76
- | `remixes` | 可 remix 设计 | designId, versionId, creatorId, thumbnail |
77
-
78
- ## 版本数据结构
79
-
80
- Firestore REST 返回格式用 `{stringValue, integerValue, arrayValue, mapValue, ...}` 包裹,需递归解析。
81
-
82
- `history` 数组中每个元素是一个图层:
83
-
84
- ```
85
- layerType: "effect" | "text" | "image" | "model" | "shape"
86
- type: 效果类型 (gradient, noiseFill, sdf_shape, glyphDither, bloomFast, ...)
87
- ```
88
-
89
- ### 图层参数(常见)
90
-
91
- - `pos`, `scale`, `speed`, `opacity`, `blendMode`
92
- - `trackMouse`, `trackAxes`, `mouseMomentum`
93
- - `parentLayer`: UUID 或 false(关联父元素)
94
- - `breakpoints[]`: 响应式断点配置
95
- - `states`: appear/scroll/hover/mousemove 动画
96
- - `customFragmentShaders[]`, `customVertexShaders[]`(通常为空,用内置效果时)
97
-
98
- ## 正确初始化策略
99
-
100
- 如果拿到的是 Firestore `version/history`,优先模仿站点自己的初始化链路,不要硬套 embed API。
101
-
102
- 典型调用顺序:
103
-
104
- 1. `unpackageHistory()` 或 `unpackVersion()`
105
- 2. `createFontScript()`
106
- 3. `createCurtains()`
107
- 4. `handleItemPlanes()`
108
- 5. `fullRedraw()`
109
-
110
- 如果页面 bundle 里有专门的 Remix/Preview 组件,优先跟着它走,不要只看公开 UMD/SDK 文档。
111
-
112
- ### 资源本地化
113
-
114
- - image/font/texture 尽量下载到本地
115
- - `history` 里的 `src`、`fontCSS.src` 要改成本地路径
116
- - 某些对象字段可能是数字 key 的 map,落地前要规整成数组
117
-
118
- ### 效果类型特有参数
119
-
120
- | 效果 | 关键参数 |
121
- |---|---|
122
- | gradient | fill[], stops[], gradientType, gradientAngle, wrap |
123
- | noiseFill | noiseType, turbulence, color1, color2, colorPhase, chroma, direction |
124
- | sdf_shape | shape(0-22), refraction, extrude, smoothing, axis, animationDirection, lightPosition |
125
- | glyphDither | characters, glyphSet, scale, gamma, monochrome, texture(sprite atlas) |
126
- | bloomFast | amount, intensity, exposure, tint |
127
-
128
- ## Shader 代码提取
129
-
130
- **关键发现**: Embed SDK(~84KB)不含 GLSL shader 代码。Shader 模板在主应用 bundle(~2.1MB)中,经 7 步编译管线处理后存入 embed JSON。
131
-
132
- ### Shader 在 App Bundle 中的位置
133
-
134
- Shader 模板是字符串字面量,通过变量名标识:
135
-
136
- ```
137
- 效果名 → 变量名
138
- glyphDither → X$ (fragment)
139
- noiseFill → WY (fragment)
140
- sdf_shape → XY (fragment)
141
- gradient → eX (fragment)
142
- bloomFast → Hj (fragment)
143
- 通用顶点 → ye (vertex)
144
- 梯度顶点 → ko (vertex)
145
- 合成片段 → Uz (composite fragment)
146
- 合成顶点 → Nz (composite vertex)
147
- ```
148
-
149
- 注意:变量名会随构建版本变化,需搜索关键特征定位。
150
-
151
- ### 模板变量
152
-
153
- Shader 模板中含 `${variable}` 占位符,编译时替换:
154
-
155
- | 变量 | 内容 |
156
- |---|---|
157
- | `${fe}` | mask 相关 uniform 声明 |
158
- | `${Vt}` | 图层混合辅助函数 (applyLayerMix, applyLayerMixAlpha, applyLayerMixClip) |
159
- | `${gt}` | PCG hash / 随机数函数 (pcg2d, randFibo) |
160
- | `${ht}` | 混合模式函数 (17 种模式: Normal, Add, Multiply, Screen, Overlay, ...) |
161
- | `${pe("var")}` | mask 应用 + fragColor 输出 |
162
- | `${wf}` | BCC noise derivatives (OpenSimplex2S) |
163
- | `${Aa}` | Perlin noise 函数 |
164
- | `${yr}` | deband 抖动函数 |
165
- | `${cm}` | 渐变颜色/停止点 uniform 声明 |
166
- | `${xz}` | 高斯权重函数 (bloom blur) |
167
-
168
- ### 编译管线
169
-
170
- ```
171
- 1. Fz(): 替换 uniform 值为常量
172
- 2. Dz(): 处理渐变颜色数量(switch case 裁剪)
173
- 3. Mz(): 求值常量 switch(死代码消除)
174
- 4. Rz(): 处理 #ifelseopen/#ifelseclose 块(条件编译)
175
- 5. Iz(): 移除未使用函数
176
- 6. Cz(): 移除未使用 uniform 声明
177
- 7. Bp(): 去注释、规范化空白
178
- ```
179
-
180
- ## 渲染管线(核心,移植时必须正确还原)
181
-
182
- ```
183
- curtains.js WebGL2 渲染器
184
- ├─ 每个效果图层 = 一个 Plane + 独立 FBO
185
- ├─ 图层按 renderOrder 线性链式渲染,每个 plane 读前一个 FBO 为 uTexture
186
- ├─ Element(shape/text/image)+ 子效果形成 render group:
187
- │ 1. Element 自身 plane 先渲染 → FBO_elem
188
- │ 2. 子效果按 effects 数组顺序依次渲染 → FBO_child1, FBO_child2, ...
189
- │ 3. Composite plane 最后渲染:alpha-blend 子效果输出到背景场景
190
- ├─ 独立后处理效果 (parentLayer=false) 处理全局场景
191
- └─ 最后一个 plane 直接输出到 canvas(无 FBO)
192
- ```
193
-
194
- ### Element + 子效果的 FBO 链(关键)
195
-
196
- ```
197
- 以 shape group (sdf + noise) 为例:
198
-
199
- FBO_before ─────────────────────────────────────────┐
200
-
201
- Shape 自身 plane → FBO_shape (渲染基础几何) │
202
- ↓ │
203
- Child noiseFill → FBO_noise (uBgTexture = FBO_shape) │
204
- ↓ │
205
- Child sdf_shape → FBO_sdf (uTexture = FBO_noise) │
206
- ↓ (showBg=0: 形状外 = vec4(0) 透明) │
207
- ↓ │
208
- Composite plane → FBO_result │
209
- uTexture = FBO_sdf (最后一个子效果输出) │
210
- uBgTexture = FBO_before (element 之前的场景) ←─────┘
211
- output = alpha_blend(fg, bg) = fg + bg * (1 - fg.a)
212
- ```
213
-
214
- ### 子效果关联机制
215
-
216
- ```js
217
- // Element 的 effects 数组 → 子效果的 parentLayer UUID 列表
218
- shape.effects = ["e270a7cd-...", "fb591190-..."]
219
-
220
- // 每个子效果引用父 element 的 UUID
221
- noiseFill.parentLayer = "e270a7cd-..." // effects[0]
222
- sdf_shape.parentLayer = "fb591190-..." // effects[1]
223
-
224
- // embed SDK 中查找子效果:
225
- getChildEffectItems() {
226
- return this.effects.map(uuid =>
227
- state.layers.find(l => l.parentLayer === uuid)
228
- ).filter(Boolean)
229
- }
230
- ```
231
-
232
- ### uTime 时间基准(关键陷阱)
233
-
234
- Embed SDK 中 `uTime` **不是秒数**,而是逐帧累加:
235
- ```js
236
- // setEffectPlaneUniforms() 中:
237
- t.uniforms.time.value += speed * 60 / this.fps;
238
- ```
239
-
240
- 在 60fps 下:`uTime += speed` 每帧。1 秒后 `uTime = speed × 60`。
241
-
242
- | 效果层 | speed | 1 秒后 uTime |
243
- |--------|-------|-------------|
244
- | noiseFill | 0.25 | 15 |
245
- | sdf_shape | 0.5 | 30 |
246
- | gradient | 0.25 | 15 |
247
-
248
- **移植时必须乘以 `speed × 60`**,否则动画慢 15-60 倍:
249
- ```js
250
- // 正确:
251
- uni1f(prog, 'uTime', elapsedSeconds * speed * 60);
252
- // 错误:
253
- uni1f(prog, 'uTime', elapsedSeconds);
254
- ```
255
-
256
- ### showBg 参数的关键作用
257
-
258
- - `showBg=0`:光线未命中几何体时输出 `vec4(0)` **透明**(不是黑色!)
259
- - `showBg=1`:光线未命中时采样 `uTexture/uBgTexture`(显示背景内容)
260
-
261
- **移植时 showBg=0 是最常见的陷阱**:如果错误地输出 `vec4(0,0,0,1)` 不透明黑色,
262
- composite alpha blend 会被覆盖而不是透过下方图层。必须确保 alpha=0。
263
-
264
- ## 移植策略
265
-
266
- 1. **纯 2D 后处理效果** (glyphDither, bloomFast): 原生 WebGL2 全屏四边形
267
- 2. **生成式效果** (noiseFill, gradient): 原生 WebGL2
268
- 3. **3D SDF** (sdf_shape): 原生 WebGL2 raymarching
269
- 4. **复杂场景** (多图层合成): 需要 multi-pass FBO 管线
270
- 5. **文字图层**: Canvas 2D 渲染文字 → 作为纹理上传 WebGL
271
-
272
- ## Playwright 验证
273
-
274
- Playwright 默认 headless 环境可能没有可用 WebGL。出现下面症状时,先怀疑环境,不要立刻怀疑提取逻辑:
275
-
276
- - `Renderer: WebGL context could not be created`
277
- - `0 canvas(es) found`
278
- - `Error creating Curtains instance`
279
- - 截图纯黑
280
-
281
- 这时改用 `swiftshader` 再验证:
282
-
283
- ```bash
284
- --use-angle=swiftshader
285
- --use-gl=angle
286
- --enable-unsafe-swiftshader
287
- --ignore-gpu-blocklist
288
- ```
289
-
290
- 建议验证顺序:
291
-
292
- 1. 看 console 是 shader/runtime 错误,还是 WebGL context 创建失败
293
- 2. 看 DOM 里是否真的生成了 `canvas`
294
- 3. 用 `swiftshader` 截图
295
- 4. 和原站缩略图或首屏截图做构图对比
296
-
297
- ### Glyph Atlas 生成
298
-
299
- 原始 glyph atlas 是 base64 PNG(存在跨浏览器兼容问题)。
300
- 推荐用 Canvas 2D 动态生成:
301
-
302
- ```js
303
- function createGlyphAtlas(chars, size = 40) {
304
- const canvas = document.createElement('canvas');
305
- canvas.width = size * chars.length;
306
- canvas.height = size;
307
- const ctx = canvas.getContext('2d');
308
- ctx.fillStyle = '#000';
309
- ctx.fillRect(0, 0, canvas.width, canvas.height);
310
- ctx.fillStyle = '#fff';
311
- ctx.font = `bold ${size * 0.8}px monospace`;
312
- ctx.textAlign = 'center';
313
- ctx.textBaseline = 'middle';
314
- for (let i = 0; i < chars.length; i++) {
315
- ctx.fillText(chars[i], size * i + size / 2, size / 2);
316
- }
317
- return canvas; // → gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, gl.RGBA, gl.UNSIGNED_BYTE, canvas)
318
- }
319
- ```
320
-
321
- ## Cloud Functions 端点
322
-
323
- 所有位于 `https://us-central1-unicorn-studio.cloudfunctions.net/`:
324
- - `publishEmbedTest` — 发布/更新 embed(需认证)
325
- - `getUserIdByUsername` — 用户名→userId
326
- - `handleVideos/handleModels/handleImages` — 资源处理
327
- - `generateImprovedMSDF` — MSDF 文字渲染
328
- - `generateDepthMap` — 深度图生成
329
- - `copyRemixAssets` — remix 资源复制
330
-
331
- ## 示例:完整提取流程
332
-
333
- ```bash
334
- # 1. 从 URL 提取 remix ID
335
- REMIX_ID="QZxhNFb1X1OaUqaJLT9S"
336
-
337
- # 2. 获取 remix 元数据
338
- curl -s "https://firestore.googleapis.com/v1/projects/unicorn-studio/databases/(default)/documents/remixes/$REMIX_ID?key=$API_KEY" > remix.json
339
-
340
- # 3. 提取 versionId
341
- VERSION_ID=$(python3 -c "import json; print(json.load(open('remix.json'))['fields']['versionId']['stringValue'])")
342
-
343
- # 4. 获取版本数据
344
- curl -s "https://firestore.googleapis.com/v1/projects/unicorn-studio/databases/(default)/documents/versions/$VERSION_ID?key=$API_KEY" > version.json
345
-
346
- # 5. 解析版本数据中的图层和参数 → 用 Python/Node 递归解析 Firestore REST 格式
347
-
348
- # 6. 从 app bundle 提取对应效果类型的 shader 模板
349
- curl -s "https://www.unicorn.studio/assets/index-*.js" > app-bundle.js
350
- # 搜索效果类型名定位 shader 代码
351
-
352
- # 7. 组合参数 + shader 模板 → 构建独立 WebGL2 项目
353
- ```