cnhkmcp 2.1.3__py3-none-any.whl → 2.1.4__py3-none-any.whl

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 (192) hide show
  1. cnhkmcp/__init__.py +126 -0
  2. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/README.md +38 -0
  3. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/ace.log +0 -0
  4. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/config.json +6 -0
  5. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/ace_lib.py +1514 -0
  6. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_datasets.py +157 -0
  7. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_documentation.py +132 -0
  8. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/fetch_all_operators.py +99 -0
  9. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/get_knowledgeBase_tool/helpful_functions.py +180 -0
  10. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/icon.ico +0 -0
  11. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/icon.png +0 -0
  12. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_10_Steps_to_Start_on_BRAIN_documentation.json +14 -0
  13. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Intermediate_Pack_-_Improve_your_Alpha_2_2_documentation.json +174 -0
  14. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Intermediate_Pack_-_Understand_Results_1_2_documentation.json +167 -0
  15. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Introduction_to_Alphas_documentation.json +145 -0
  16. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_Introduction_to_BRAIN_Expression_Language_documentation.json +107 -0
  17. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001_WorldQuant_Challenge_documentation.json +56 -0
  18. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/001__Read_this_First_-_Starter_Pack_documentation.json +404 -0
  19. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002_How_to_choose_the_Simulation_Settings_documentation.json +268 -0
  20. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002_Simulate_your_first_Alpha_documentation.json +88 -0
  21. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Beginners_documentation.json +254 -0
  22. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Bronze_Users_documentation.json +114 -0
  23. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__Alpha_Examples_for_Silver_Users_documentation.json +79 -0
  24. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/002__How_BRAIN_works_documentation.json +184 -0
  25. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/003_Clear_these_tests_before_submitting_an_Alpha_documentation.json +388 -0
  26. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/003_Parameters_in_the_Simulation_results_documentation.json +243 -0
  27. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Group_Data_Fields_documentation.json +69 -0
  28. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_How_to_use_the_Data_Explorer_documentation.json +142 -0
  29. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Model77_dataset_documentation.json +14 -0
  30. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Sentiment1_dataset_documentation.json +14 -0
  31. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Understanding_Data_in_BRAIN_Key_Concepts_and_Tips_documentation.json +182 -0
  32. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/004_Vector_Data_Fields_documentation.json +30 -0
  33. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Crowding_Risk-Neutralized_Alphas_documentation.json +64 -0
  34. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_D0_documentation.json +66 -0
  35. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Double_Neutralization_documentation.json +53 -0
  36. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Fast_D1_Documentation_documentation.json +304 -0
  37. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Investability_Constrained_Metrics_documentation.json +129 -0
  38. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Must-read_posts_How_to_improve_your_Alphas_documentation.json +14 -0
  39. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Neutralization_documentation.json +29 -0
  40. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_RAM_Risk-Neutralized_Alphas_documentation.json +64 -0
  41. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Risk_Neutralization_Default_setting_documentation.json +75 -0
  42. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Risk_Neutralized_Alphas_documentation.json +171 -0
  43. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/005_Statistical_Risk-Neutralized_Alphas_documentation.json +51 -0
  44. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_EUR_TOP2500_Universe_documentation.json +35 -0
  45. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_GLB_TOPDIV3000_Universe_documentation.json +48 -0
  46. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_Started_China_Research_for_Consultants_Gold_documentation.json +142 -0
  47. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_started_on_Illiquid_Universes_Gold_documentation.json +46 -0
  48. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Getting_started_with_USA_TOPSP500_universe_Gold_documentation.json +62 -0
  49. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_Global_Alphas_Gold_documentation.json +66 -0
  50. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/006_India_Alphas_documentation.json +35 -0
  51. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Dos_and_Don_ts_documentation.json +35 -0
  52. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Features_documentation.json +239 -0
  53. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Simulation_Features_documentation.json +149 -0
  54. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Consultant_Submission_Tests_documentation.json +363 -0
  55. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Finding_Consultant_Alphas_documentation.json +333 -0
  56. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Power_Pool_Alphas_documentation.json +14 -0
  57. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Research_Advisory_Program_documentation.json +35 -0
  58. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Starting_Guide_for_Research_Consultants_documentation.json +14 -0
  59. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Visualization_Tool_documentation.json +99 -0
  60. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007_Your_Advisor_-_Kunqi_Jiang_documentation.json +53 -0
  61. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007__Brain_Genius_documentation.json +288 -0
  62. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/007__Single_Dataset_Alphas_documentation.json +41 -0
  63. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Advisory_Theme_Calendar_documentation.json +14 -0
  64. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Multiplier_Rules_documentation.json +14 -0
  65. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Overview_of_Themes_documentation.json +14 -0
  66. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/008_Theme_Calendar_documentation.json +14 -0
  67. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Combo_Expression_documentation.json +272 -0
  68. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Global_SuperAlphas_documentation.json +14 -0
  69. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Helpful_Tips_documentation.json +58 -0
  70. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_Selection_Expression_documentation.json +1546 -0
  71. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_SuperAlpha_Operators_documentation.json +890 -0
  72. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_SuperAlpha_Results_documentation.json +83 -0
  73. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/009_What_is_a_SuperAlpha_documentation.json +261 -0
  74. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010_BRAIN_API_documentation.json +515 -0
  75. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010_Documentation_for_ACE_API_Library_Gold_documentation.json +27 -0
  76. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/010__Understanding_simulation_limits_documentation.json +210 -0
  77. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/arithmetic_operators.json +209 -0
  78. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/cross_sectional_operators.json +98 -0
  79. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/group_operators.json +121 -0
  80. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/logical_operators.json +145 -0
  81. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/reduce_operators.json +156 -0
  82. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/special_operators.json +35 -0
  83. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/test.txt +1 -0
  84. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/time_series_operators.json +386 -0
  85. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/transformational_operators.json +61 -0
  86. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/knowledge/vector_operators.json +38 -0
  87. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/main.py +576 -0
  88. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/process_knowledge_base.py +281 -0
  89. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/rag_engine.py +408 -0
  90. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/requirements.txt +7 -0
  91. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/run.bat +3 -0
  92. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/_manifest.json +302 -0
  93. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/_meta.json +1 -0
  94. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242/vector_db/chroma.sqlite3 +0 -0
  95. cnhkmcp/untracked/AI/321/206/320/261/320/234/321/211/320/255/320/262/321/206/320/237/320/242/321/204/342/225/227/342/225/242//321/211/320/266/320/246/321/206/320/274/320/261/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +265 -0
  96. cnhkmcp/untracked/APP/.gitignore +32 -0
  97. cnhkmcp/untracked/APP/MODULAR_STRUCTURE.md +112 -0
  98. cnhkmcp/untracked/APP/README.md +309 -0
  99. cnhkmcp/untracked/APP/Tranformer/Transformer.py +4989 -0
  100. cnhkmcp/untracked/APP/Tranformer/ace.log +0 -0
  101. cnhkmcp/untracked/APP/Tranformer/ace_lib.py +1514 -0
  102. cnhkmcp/untracked/APP/Tranformer/helpful_functions.py +180 -0
  103. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates.json +7187 -0
  104. cnhkmcp/untracked/APP/Tranformer/output/Alpha_candidates_/321/207/320/264/342/225/221/321/204/342/225/233/320/233.json +654 -0
  105. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_error.json +1 -0
  106. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_success.json +47312 -0
  107. cnhkmcp/untracked/APP/Tranformer/output/Alpha_generated_expressions_/321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/277/321/207/320/253/342/224/244/321/206/320/236/320/265/321/210/342/225/234/342/225/234/321/205/320/225/320/265Machine_lib.json +22 -0
  108. cnhkmcp/untracked/APP/Tranformer/parsetab.py +60 -0
  109. cnhkmcp/untracked/APP/Tranformer/template_summary.txt +3182 -0
  110. cnhkmcp/untracked/APP/Tranformer/transformer_config.json +7 -0
  111. cnhkmcp/untracked/APP/Tranformer/validator.py +889 -0
  112. cnhkmcp/untracked/APP/ace.log +69 -0
  113. cnhkmcp/untracked/APP/ace_lib.py +1514 -0
  114. cnhkmcp/untracked/APP/blueprints/__init__.py +6 -0
  115. cnhkmcp/untracked/APP/blueprints/feature_engineering.py +347 -0
  116. cnhkmcp/untracked/APP/blueprints/idea_house.py +221 -0
  117. cnhkmcp/untracked/APP/blueprints/inspiration_house.py +432 -0
  118. cnhkmcp/untracked/APP/blueprints/paper_analysis.py +570 -0
  119. cnhkmcp/untracked/APP/custom_templates/templates.json +1257 -0
  120. cnhkmcp/untracked/APP/give_me_idea/BRAIN_Alpha_Template_Expert_SystemPrompt.md +400 -0
  121. cnhkmcp/untracked/APP/give_me_idea/ace_lib.py +1514 -0
  122. cnhkmcp/untracked/APP/give_me_idea/alpha_data_specific_template_master.py +252 -0
  123. cnhkmcp/untracked/APP/give_me_idea/fetch_all_datasets.py +157 -0
  124. cnhkmcp/untracked/APP/give_me_idea/fetch_all_operators.py +99 -0
  125. cnhkmcp/untracked/APP/give_me_idea/helpful_functions.py +180 -0
  126. cnhkmcp/untracked/APP/give_me_idea/what_is_Alpha_template.md +11 -0
  127. cnhkmcp/untracked/APP/helpful_functions.py +180 -0
  128. cnhkmcp/untracked/APP/hkSimulator/ace_lib.py +1501 -0
  129. cnhkmcp/untracked/APP/hkSimulator/autosimulator.py +447 -0
  130. cnhkmcp/untracked/APP/hkSimulator/helpful_functions.py +180 -0
  131. cnhkmcp/untracked/APP/mirror_config.txt +20 -0
  132. cnhkmcp/untracked/APP/operaters.csv +129 -0
  133. cnhkmcp/untracked/APP/requirements.txt +53 -0
  134. cnhkmcp/untracked/APP/run_app.bat +28 -0
  135. cnhkmcp/untracked/APP/run_app.sh +34 -0
  136. cnhkmcp/untracked/APP/setup_tsinghua.bat +39 -0
  137. cnhkmcp/untracked/APP/setup_tsinghua.sh +43 -0
  138. cnhkmcp/untracked/APP/simulator/alpha_submitter.py +404 -0
  139. cnhkmcp/untracked/APP/simulator/simulator_wqb.py +618 -0
  140. cnhkmcp/untracked/APP/simulator/wqb20260107015647.log +57 -0
  141. cnhkmcp/untracked/APP/ssrn-3332513.pdf +109188 -19
  142. cnhkmcp/untracked/APP/static/brain.js +589 -0
  143. cnhkmcp/untracked/APP/static/decoder.js +1540 -0
  144. cnhkmcp/untracked/APP/static/feature_engineering.js +1729 -0
  145. cnhkmcp/untracked/APP/static/idea_house.js +937 -0
  146. cnhkmcp/untracked/APP/static/inspiration.js +465 -0
  147. cnhkmcp/untracked/APP/static/inspiration_house.js +868 -0
  148. cnhkmcp/untracked/APP/static/paper_analysis.js +390 -0
  149. cnhkmcp/untracked/APP/static/script.js +3082 -0
  150. cnhkmcp/untracked/APP/static/simulator.js +597 -0
  151. cnhkmcp/untracked/APP/static/styles.css +3127 -0
  152. cnhkmcp/untracked/APP/static/usage_widget.js +508 -0
  153. cnhkmcp/untracked/APP/templates/alpha_inspector.html +511 -0
  154. cnhkmcp/untracked/APP/templates/feature_engineering.html +960 -0
  155. cnhkmcp/untracked/APP/templates/idea_house.html +564 -0
  156. cnhkmcp/untracked/APP/templates/index.html +932 -0
  157. cnhkmcp/untracked/APP/templates/inspiration_house.html +861 -0
  158. cnhkmcp/untracked/APP/templates/paper_analysis.html +91 -0
  159. cnhkmcp/untracked/APP/templates/simulator.html +343 -0
  160. cnhkmcp/untracked/APP/templates/transformer_web.html +580 -0
  161. cnhkmcp/untracked/APP/usage.md +351 -0
  162. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/ace_lib.py +1514 -0
  163. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/brain_alpha_inspector.py +712 -0
  164. cnhkmcp/untracked/APP//321/207/342/225/235/320/250/321/205/320/230/320/226/321/204/342/225/225/320/220/321/211/320/221/320/243/321/206/320/261/320/265/helpful_functions.py +180 -0
  165. cnhkmcp/untracked/APP//321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/231/320/243/321/205/342/225/235/320/220/321/206/320/230/320/241.py +2460 -0
  166. cnhkmcp/untracked/__init__.py +0 -0
  167. cnhkmcp/untracked/arXiv_API_Tool_Manual.md +490 -0
  168. cnhkmcp/untracked/arxiv_api.py +229 -0
  169. cnhkmcp/untracked/forum_functions.py +998 -0
  170. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/forum_functions.py +407 -0
  171. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/platform_functions.py +2601 -0
  172. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272/user_config.json +31 -0
  173. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/210/320/276/320/271AI/321/210/320/277/342/225/227/321/210/342/224/220/320/251/321/204/342/225/225/320/272/321/206/320/246/320/227/321/206/320/261/320/263/321/206/320/255/320/265/321/205/320/275/320/266/321/204/342/225/235/320/252/321/204/342/225/225/320/233/321/210/342/225/234/342/225/234/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270.md +101 -0
  174. cnhkmcp/untracked/mcp/321/206/320/246/320/227/321/204/342/225/227/342/225/242/321/210/320/276/342/225/221/321/205/320/255/320/253/321/207/320/231/320/2302_/321/205/320/266/320/222/321/206/320/256/320/254/321/205/320/236/320/257/321/207/320/231/320/230/321/205/320/240/320/277/321/205/320/232/320/270/321/204/342/225/225/320/235/321/204/342/225/221/320/226/321/206/342/225/241/320/237/321/210/320/267/320/230/321/205/320/251/320/270/321/205/342/226/221/342/226/222/321/210/320/277/320/245/321/210/342/224/220/320/251/321/204/342/225/225/320/272//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  175. cnhkmcp/untracked/platform_functions.py +2886 -0
  176. cnhkmcp/untracked/sample_mcp_config.json +11 -0
  177. cnhkmcp/untracked/user_config.json +31 -0
  178. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/320/237/320/222/321/210/320/220/320/223/321/206/320/246/320/227/321/206/320/261/320/263_BRAIN_Alpha_Test_Requirements_and_Tips.md +202 -0
  179. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Alpha_explaination_workflow.md +56 -0
  180. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_6_Tips_Datafield_Exploration_Guide.md +194 -0
  181. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_BRAIN_Alpha_Improvement_Workflow.md +101 -0
  182. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_Dataset_Exploration_Expert_Manual.md +436 -0
  183. cnhkmcp/untracked//321/207/320/264/342/225/221/321/204/342/225/233/320/233/321/205/342/225/226/320/265/321/204/342/225/234/320/254/321/206/342/225/241/320/221_daily_report_workflow.md +128 -0
  184. cnhkmcp/untracked//321/211/320/225/320/235/321/207/342/225/234/320/276/321/205/320/231/320/235/321/210/342/224/220/320/240/321/210/320/261/320/234/321/206/320/230/320/241_/321/205/320/276/320/231/321/210/320/263/320/225/321/205/342/224/220/320/225/321/210/320/266/320/221/321/204/342/225/233/320/255/321/210/342/225/241/320/246/321/205/320/234/320/225.py +190 -0
  185. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/METADATA +1 -1
  186. cnhkmcp-2.1.4.dist-info/RECORD +190 -0
  187. cnhkmcp-2.1.4.dist-info/top_level.txt +1 -0
  188. cnhkmcp-2.1.3.dist-info/RECORD +0 -6
  189. cnhkmcp-2.1.3.dist-info/top_level.txt +0 -1
  190. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/WHEEL +0 -0
  191. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/entry_points.txt +0 -0
  192. {cnhkmcp-2.1.3.dist-info → cnhkmcp-2.1.4.dist-info}/licenses/LICENSE +0 -0
@@ -0,0 +1,932 @@
1
+ <!DOCTYPE html>
2
+ <html lang="en">
3
+ <head>
4
+ <meta charset="UTF-8">
5
+ <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
+ <title>BRAIN Expression Template Decoder</title>
7
+ <link rel="stylesheet" href="{{ url_for('static', filename='styles.css') }}">
8
+ </head>
9
+ <body>
10
+ <div class="container">
11
+ <header>
12
+ <div class="header-top">
13
+ <div class="header-left">
14
+ <button onclick="openSubmitter()" class="btn btn-submitter">📤 Alpha_Submitter提交器</button>
15
+ <button onclick="openHKSimulator()" class="btn btn-submitter" style="margin-top: 10px; display: block;">🚀 Open Simulator_hk</button>
16
+ <button onclick="openTransformer()" class="btn btn-submitter" style="margin-top: 10px; display: block;">七十二变</button>
17
+ <button onclick="window.location.href='/alpha_inspector'" class="btn btn-submitter" style="margin-top: 10px; display: block; background-color: #ff9800; border-color: #ff9800;">🌉 缘分一道桥</button>
18
+ </div>
19
+ <div class="header-center">
20
+ <h1>BRAIN Expression Template Decoder</h1>
21
+ <p class="subtitle">Specialized template decoder with grammar checking for expression-like language</p>
22
+ </div>
23
+ </div>
24
+ <div class="header-buttons">
25
+ <div class="header-buttons-row">
26
+ <div style="display: flex; gap: 10px; align-items: center;">
27
+ <button id="connectToBrain" class="btn btn-brain">Connect to BRAIN</button>
28
+ <button onclick="runSimulator()" class="btn btn-primary">🚀 打开回测器</button>
29
+ </div>
30
+ <a href="{{ url_for('inspiration_house.inspiration_house') }}" class="btn btn-primary">AI创意工坊</a>
31
+ <a href="{{ url_for('paper_analysis.paper_analysis') }}" class="btn btn-primary">论文分析</a>
32
+ <a href="{{ url_for('feature_engineering.feature_engineering') }}" class="btn btn-primary">数据字段指南</a>
33
+
34
+
35
+ </div>
36
+ </div>
37
+ </header>
38
+
39
+ <!-- Unified Templates Section -->
40
+ <div class="templates-section">
41
+ <div class="templates-header">
42
+ <h3>模板空间</h3>
43
+ <div class="template-actions">
44
+ <button class="btn btn-small btn-primary" id="toggleTemplateView" onclick="toggleTemplateView()">
45
+ <span id="toggleTemplateViewText">只展示用户自建模板</span>
46
+ </button>
47
+ <button class="btn btn-small btn-outline" onclick="exportCustomTemplates()" title="Export all custom templates">
48
+ <span style="margin-right: 5px;">📤</span>导出用户自建模板
49
+ </button>
50
+ <button class="btn btn-small btn-outline" onclick="document.getElementById('importTemplatesFile').click()" title="Import templates from file">
51
+ <span style="margin-right: 5px;">📥</span>导入用户自建模板
52
+ </button>
53
+ <button class="btn btn-small btn-outline" onclick="document.getElementById('transformerFile').click()" title="Load Transformer Candidates from JSON file">
54
+ <span style="margin-right: 5px;">🤖</span>加载72变生成的模板
55
+ </button>
56
+ <button class="btn btn-small btn-outline" onclick="document.getElementById('generatedExpressionsFile').click()" title="Load Generated Expressions from JSON file">
57
+ <span style="margin-right: 5px;">📄</span>载入72变生成的表达式
58
+ </button>
59
+ <input type="file" id="importTemplatesFile" accept=".json" style="display: none;" onchange="importCustomTemplates(event)">
60
+ <input type="file" id="transformerFile" accept=".json" style="display: none;" onchange="handleTransformerFileSelect(event)">
61
+ <input type="file" id="generatedExpressionsFile" accept=".json" style="display: none;" onchange="handleGeneratedExpressionsFileSelect(event)">
62
+ </div>
63
+ </div>
64
+ <div class="all-template-buttons">
65
+ <!-- Example Templates -->
66
+ <div id="exampleTemplateButtons">
67
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(2)">Vector数据处理模板</button>
68
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(1)">单字段深度处理</button>
69
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(3)">双重中性化</button>
70
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(4)">组内均值超额信号_Matrix Data</button>
71
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(5)">组内均值超额信号_Vector Data</button>
72
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(6)">换手率变动Delta模板</button>
73
+ <button class="btn btn-template btn-template-example" data-template-type="example" onclick="loadTemplateExample(7)">换手率Hump模板</button>
74
+ </div>
75
+
76
+ <!-- Custom Templates will be loaded here -->
77
+ <div id="customTemplateButtons">
78
+ <!-- Custom templates will be dynamically inserted here -->
79
+ </div>
80
+
81
+ <!-- Transformer Templates will be loaded here -->
82
+ <div id="transformerTemplateButtons">
83
+ <!-- Transformer templates will be dynamically inserted here -->
84
+ </div>
85
+ </div>
86
+ <div class="custom-template-info" id="noCustomTemplates" style="display: none;">
87
+ <p style="margin-top: 10px; color: #6c757d; font-style: italic;">No custom templates saved yet. Create your expression and click "Save Current" to save it as a template.</p>
88
+ </div>
89
+ </div>
90
+
91
+ <!-- Navigation Tabs -->
92
+ <nav class="page-navigation">
93
+ <button class="nav-tab active" data-page="editor">
94
+ <span class="nav-icon">✏️</span>
95
+ <span class="nav-text">Expression Editor</span>
96
+ </button>
97
+ <button class="nav-tab" data-page="decode">
98
+ <span class="nav-icon">🔄</span>
99
+ <span class="nav-text">Decode Templates</span>
100
+ </button>
101
+ <button class="nav-tab" data-page="results" id="resultsTab" style="display: none;">
102
+ <span class="nav-icon">📊</span>
103
+ <span class="nav-text">Results</span>
104
+ <span class="nav-badge" id="resultsBadge">0</span>
105
+ </button>
106
+ </nav>
107
+
108
+ <!-- Page Content Container -->
109
+ <div class="page-container">
110
+ <!-- Editor Page -->
111
+ <div class="page-content active" id="editorPage">
112
+ <div class="main-content">
113
+ <div class="editor-section">
114
+ <div class="editor-header">
115
+ <h2>Expression Editor</h2>
116
+ <div class="editor-actions">
117
+ <button id="clearEditor" class="btn btn-outline">Clear</button>
118
+ <button class="btn btn-secondary" onclick="saveCurrentTemplate()">
119
+ <span style="margin-right: 5px;">💾</span>Save Current Template
120
+ </button>
121
+ <button class="btn btn-outline" onclick="overwriteExistingTemplate()">
122
+ <span style="margin-right: 5px;">🔄</span>Overwrite Existing
123
+ </button>
124
+ <button id="inspirationBtn" class="btn btn-primary" style="background-color: #6f42c1; border-color: #6f42c1; opacity: 0.5; cursor: not-allowed;" disabled>
125
+ <span style="margin-right: 5px;">💡</span>找灵感
126
+ </button>
127
+ </div>
128
+ </div>
129
+
130
+ <div class="editor-wrapper">
131
+ <div class="line-numbers" id="lineNumbers"></div>
132
+ <div class="editor-container">
133
+ <div id="highlightedText" class="highlighted-text"></div>
134
+ <textarea id="expressionEditor" class="expression-editor" placeholder="Enter your expression here...">
135
+ <time_series_operator/>(sentiment_difference, <days/>)</textarea>
136
+ </div>
137
+ </div>
138
+
139
+ <div id="grammarErrors" class="grammar-errors"></div>
140
+ </div>
141
+
142
+ <div class="info-panel">
143
+ <h3>Detected Templates</h3>
144
+ <div id="templateList" class="template-list"></div>
145
+
146
+ <h3>Grammar Rules</h3>
147
+ <ul class="grammar-rules">
148
+ <li><code>/* */</code> - Block comments for multiple lines</li>
149
+ <li><code>;</code> - Statement separator (not needed for last line)</li>
150
+ <li>Last statement is the Alpha expression for BRAIN simulator</li>
151
+ <li>Alpha expression cannot be assigned to a variable</li>
152
+ <li>No classes, objects, pointers, or functions allowed</li>
153
+ </ul>
154
+
155
+ <div class="next-step-hint">
156
+ <button class="btn btn-primary" onclick="navigateToPage('decode')">
157
+ Next: Decode Templates →
158
+ </button>
159
+ </div>
160
+ </div>
161
+ </div>
162
+ </div>
163
+
164
+ <!-- Decode Page -->
165
+ <div class="page-content" id="decodePage">
166
+ <div class="decode-content">
167
+ <h2>Template Decoding Options</h2>
168
+ <div class="template-status" id="templateStatus">
169
+ <!-- Template configuration status will be shown here -->
170
+ </div>
171
+
172
+ <div class="decode-buttons">
173
+ <button id="decodeTemplates" class="btn btn-primary btn-large">full_iteration</button>
174
+ <div class="random-iteration-container">
175
+ <button id="randomIterationBtn" class="btn btn-primary btn-large">random_iteration</button>
176
+ <input type="number" id="randomCount" class="random-count-input" placeholder="Count" min="1" value="10" title="Number of random expressions to generate">
177
+ </div>
178
+ </div>
179
+
180
+ <div class="decode-info">
181
+ <p><strong>full_iteration:</strong> Generate all possible combinations of configured templates</p>
182
+ <p><strong>random_iteration:</strong> Generate random samples from the possible combinations</p>
183
+ </div>
184
+
185
+ <div class="navigation-buttons">
186
+ <button class="btn btn-outline" onclick="navigateToPage('editor')">
187
+ ← Back to Editor
188
+ </button>
189
+ </div>
190
+ </div>
191
+ </div>
192
+
193
+ <!-- Results Page -->
194
+ <div class="page-content" id="resultsPage">
195
+ <div class="results-content">
196
+ <h2>Decoded Expressions</h2>
197
+ <div id="resultsList" class="results-list"></div>
198
+ <div class="results-actions">
199
+ <button id="nextMoveBtn" class="btn btn-secondary btn-small">Append Expression with Settings</button>
200
+ <button id="downloadResults" class="btn btn-primary btn-small" title="Download all generated expressions">Download All Expression in txt</button>
201
+ </div>
202
+
203
+ <div class="navigation-buttons">
204
+ <button class="btn btn-outline" onclick="navigateToPage('decode')">
205
+ ← Back to Decode
206
+ </button>
207
+ <button class="btn btn-outline" onclick="navigateToPage('editor')">
208
+ ← Back to Editor
209
+ </button>
210
+ </div>
211
+ </div>
212
+ </div>
213
+ </div>
214
+ </div>
215
+
216
+ <!-- Template Variable Input Modal -->
217
+ <div id="templateModal" class="modal">
218
+ <div class="modal-content">
219
+ <div class="modal-header">
220
+ <h3 id="modalTitle">Enter Variables</h3>
221
+ <span class="close" onclick="closeModal()">&times;</span>
222
+ </div>
223
+ <div class="modal-body">
224
+ <p id="modalDescription">Enter a comma-separated list of variables:</p>
225
+ <textarea id="variableInput" class="variable-input" placeholder="variable1, variable2, variable3"></textarea>
226
+ <div id="brainChooseSection" class="brain-choose-section" style="display: none;">
227
+ <button id="chooseBrainBtn" class="btn btn-secondary btn-small">Choose from BRAIN</button>
228
+ </div>
229
+ </div>
230
+ <div class="modal-footer">
231
+ <button onclick="closeModal()" class="btn btn-outline">Cancel</button>
232
+ <button onclick="applyTemplate()" class="btn btn-primary">Apply</button>
233
+ </div>
234
+ </div>
235
+ </div>
236
+
237
+ <!-- Template Configuration Info Modal -->
238
+ <div id="configInfoModal" class="modal">
239
+ <div class="modal-content">
240
+ <div class="modal-header">
241
+ <h3 id="configInfoTitle">Template Configuration</h3>
242
+ <span class="close" onclick="closeConfigInfoModal()">&times;</span>
243
+ </div>
244
+ <div class="modal-body">
245
+ <div id="configInfoContent" class="config-info-content">
246
+ <!-- Configuration details will be inserted here -->
247
+ </div>
248
+ </div>
249
+ <div class="modal-footer">
250
+ <button onclick="closeConfigInfoModal()" class="btn btn-primary">Close</button>
251
+ </div>
252
+ </div>
253
+ </div>
254
+
255
+ <!-- BRAIN Login Modal -->
256
+ <div id="brainLoginModal" class="modal">
257
+ <div class="modal-content">
258
+ <div class="modal-header">
259
+ <h3>Connect to WorldQuant BRAIN</h3>
260
+ <span class="close" onclick="closeBrainLoginModal()">&times;</span>
261
+ </div>
262
+ <div class="modal-body">
263
+ <form id="brainLoginForm" onsubmit="event.preventDefault(); authenticateBrain();">
264
+ <div class="form-group">
265
+ <label for="brainUsername">Username:</label>
266
+ <input type="email" id="brainUsername" class="form-input" placeholder="your.email@domain.com" required>
267
+ </div>
268
+ <div class="form-group">
269
+ <label for="brainPassword">Password:</label>
270
+ <input type="password" id="brainPassword" class="form-input" placeholder="Your password" required>
271
+ </div>
272
+ <div id="brainLoginStatus" class="login-status"></div>
273
+ <div id="loginSpinner" class="login-spinner" style="display: none;">
274
+ <div class="spinner"></div>
275
+ </div>
276
+ </form>
277
+ </div>
278
+ <div class="modal-footer">
279
+ <button onclick="closeBrainLoginModal()" class="btn btn-outline" id="cancelBtn">Cancel</button>
280
+ <button onclick="authenticateBrain()" class="btn btn-primary" id="loginBtn">Connect</button>
281
+ </div>
282
+ </div>
283
+ </div>
284
+
285
+ <!-- BRAIN Operators Selection Modal -->
286
+ <div id="brainOperatorsModal" class="modal">
287
+ <div class="modal-content">
288
+ <div class="modal-header">
289
+ <h3>Choose Operators from BRAIN</h3>
290
+ <span class="close" onclick="closeBrainOperatorsModal()">&times;</span>
291
+ </div>
292
+ <div class="modal-body">
293
+ <div class="search-section">
294
+ <input type="text" id="operatorSearch" class="form-input" placeholder="Search operators...">
295
+ </div>
296
+ <div class="category-filter">
297
+ <label>Filter by category:</label>
298
+ <select id="categoryFilter" class="form-input">
299
+ <option value="">All Categories</option>
300
+ </select>
301
+ </div>
302
+ <div class="operator-actions">
303
+ <button id="selectAllFilteredOperators" class="btn btn-small btn-secondary">Select All Filtered</button>
304
+ <button id="clearAllOperators" class="btn btn-small btn-outline">Clear All</button>
305
+ </div>
306
+ <div id="operatorsList" class="operators-list">
307
+ <!-- Operators will be populated here -->
308
+ </div>
309
+ <div class="selected-operators">
310
+ <strong>Selected operators:</strong>
311
+ <div id="selectedOperators" class="selected-items"></div>
312
+ </div>
313
+ </div>
314
+ <div class="modal-footer">
315
+ <button onclick="closeBrainOperatorsModal()" class="btn btn-outline">Cancel</button>
316
+ <button onclick="applySelectedOperators()" class="btn btn-primary">Apply Selected</button>
317
+ </div>
318
+ </div>
319
+ </div>
320
+
321
+ <!-- BRAIN Data Fields Selection Modal -->
322
+ <div id="brainDataFieldsModal" class="modal">
323
+ <div class="modal-content">
324
+ <div class="modal-header">
325
+ <h3>Get Data Fields via BRAINAPI</h3>
326
+ <span class="close" onclick="closeBrainDataFieldsModal()">&times;</span>
327
+ </div>
328
+ <div class="modal-body">
329
+ <div class="data-fields-params">
330
+ <div class="params-row">
331
+ <div class="param-group">
332
+ <label for="regionInput">Region:</label>
333
+ <div style="display: flex; gap: 5px;">
334
+ <input type="text" id="regionInput" class="form-input" placeholder="e.g., USA" value="USA" style="flex: 1;">
335
+ <select id="regionSelect" class="form-input" style="flex: 1; display: none;" onchange="if(this.value) { document.getElementById('regionInput').value = this.value; updateDelayOptions(); }">
336
+ <option value="">Select...</option>
337
+ </select>
338
+ </div>
339
+ </div>
340
+ <div class="param-group">
341
+ <label for="delayInput">Delay:</label>
342
+ <div style="display: flex; gap: 5px;">
343
+ <input type="text" id="delayInput" class="form-input" placeholder="e.g., 1" value="1" style="flex: 1;">
344
+ <select id="delaySelect" class="form-input" style="flex: 1; display: none;" onchange="if(this.value) { document.getElementById('delayInput').value = this.value; updateUniverseOptions(); }">
345
+ <option value="">Select...</option>
346
+ </select>
347
+ </div>
348
+ </div>
349
+ <div class="param-group">
350
+ <label for="universeInput">Universe:</label>
351
+ <div style="display: flex; gap: 5px;">
352
+ <input type="text" id="universeInput" class="form-input" placeholder="e.g., TOP3000" value="TOP3000" style="flex: 1;">
353
+ <select id="universeSelect" class="form-input" style="flex: 1; display: none;" onchange="if(this.value) document.getElementById('universeInput').value = this.value">
354
+ <option value="">Select...</option>
355
+ </select>
356
+ </div>
357
+ </div>
358
+ <div class="param-group">
359
+ <label for="datasetInput">Dataset ID:</label>
360
+ <div style="display: flex; gap: 5px;">
361
+ <input type="text" id="datasetInput" class="form-input" placeholder="e.g., fundamental6" value="fundamental6" style="flex: 1;">
362
+ <select id="datasetSelect" class="form-input" style="flex: 1; display: none;" onchange="if(this.value) document.getElementById('datasetInput').value = this.value">
363
+ <option value="">Select dataset...</option>
364
+ </select>
365
+ <button id="loadDatasetsBtn" class="btn btn-small btn-secondary" onclick="loadDatasets()" title="Load Datasets from BRAIN">Load List</button>
366
+ </div>
367
+ </div>
368
+ <div class="param-group">
369
+ <button id="loadDataFieldsBtn" class="btn btn-secondary">Load Data Fields</button>
370
+ </div>
371
+ </div>
372
+ </div>
373
+ <div id="dataFieldsLoading" class="loading-message" style="display: none;">
374
+ Loading data fields...
375
+ </div>
376
+ <div id="dataFieldsContent" class="data-fields-content" style="display: none;">
377
+ <div class="data-fields-controls">
378
+ <div class="filter-label">
379
+ <span>Sample filtering👉</span>
380
+ </div>
381
+ <div class="filter-options">
382
+ <label>
383
+ <input type="checkbox" id="filterHighCoverage"> High Coverage (>90%)
384
+ </label>
385
+ <label>
386
+ <input type="checkbox" id="filterPopular"> Popular (>1000 users)
387
+ </label>
388
+ <label>
389
+ <input type="checkbox" id="filterMatrixOnly"> Matrix Type Only
390
+ </label>
391
+ </div>
392
+ <div class="filter-actions">
393
+ <button id="selectAllFiltered" class="btn btn-small btn-secondary">Select All Filtered</button>
394
+ <button id="clearAllSelected" class="btn btn-small btn-outline">Clear All</button>
395
+ </div>
396
+ </div>
397
+ <div class="data-fields-stats">
398
+ <span id="dataFieldsCount">0 fields loaded</span> |
399
+ <span id="filteredCount">0 filtered</span> |
400
+ <span id="selectedCount">0 selected</span>
401
+ </div>
402
+ <div class="data-fields-table-container">
403
+ <table class="data-fields-table">
404
+ <thead>
405
+ <tr class="header-row">
406
+ <th style="width: 40px;">
407
+ <input type="checkbox" id="selectAllCheckbox" title="Select/Deselect All">
408
+ </th>
409
+ <th style="width: 200px; min-width: 150px;">
410
+ Field ID
411
+ <button class="sort-btn" data-column="id" data-order="asc">↕</button>
412
+ </th>
413
+ <th style="min-width: 300px;">
414
+ Description
415
+ <button class="sort-btn" data-column="description" data-order="asc">↕</button>
416
+ </th>
417
+ <th style="width: 100px;">
418
+ Type
419
+ <button class="sort-btn" data-column="type" data-order="asc">↕</button>
420
+ </th>
421
+ <th style="width: 150px;">
422
+ Coverage
423
+ <button class="sort-btn" data-column="coverage" data-order="asc">↕</button>
424
+ </th>
425
+ <th style="width: 100px;">
426
+ Users
427
+ <button class="sort-btn" data-column="userCount" data-order="asc">↕</button>
428
+ </th>
429
+ <th style="width: 100px;">
430
+ Alphas
431
+ <button class="sort-btn" data-column="alphaCount" data-order="asc">↕</button>
432
+ </th>
433
+ </tr>
434
+ <tr class="filter-row">
435
+ <th></th>
436
+ <th>
437
+ <input type="text" class="column-filter" data-column="id" placeholder="Filter ID...">
438
+ </th>
439
+ <th>
440
+ <input type="text" class="column-filter" data-column="description" placeholder="Filter description...">
441
+ </th>
442
+ <th>
443
+ <select class="column-filter" data-column="type" id="typeFilter">
444
+ <option value="">All Types</option>
445
+ </select>
446
+ </th>
447
+ <th>
448
+ <div class="range-filter">
449
+ <input type="number" class="column-filter-min" data-column="coverage" placeholder="Min %" min="0" max="100" step="0.1">
450
+ <span>-</span>
451
+ <input type="number" class="column-filter-max" data-column="coverage" placeholder="Max %" min="0" max="100" step="0.1">
452
+ </div>
453
+ </th>
454
+ <th>
455
+ <input type="number" class="column-filter" data-column="userCount" placeholder="Min users" min="0">
456
+ </th>
457
+ <th>
458
+ <input type="number" class="column-filter" data-column="alphaCount" placeholder="Min alphas" min="0">
459
+ </th>
460
+ </tr>
461
+ </thead>
462
+ <tbody id="dataFieldsTableBody">
463
+ <!-- Data fields will be populated here -->
464
+ </tbody>
465
+ </table>
466
+ </div>
467
+ <div class="selected-data-fields">
468
+ <strong>Selected data fields:</strong>
469
+ <div id="selectedDataFields" class="selected-items"></div>
470
+ </div>
471
+ </div>
472
+ </div>
473
+ <div class="modal-footer">
474
+ <button onclick="closeBrainDataFieldsModal()" class="btn btn-outline">Cancel</button>
475
+ <button onclick="applySelectedDataFields()" class="btn btn-primary">Apply Selected</button>
476
+ </div>
477
+ </div>
478
+ </div>
479
+
480
+ <!-- Settings Modal for Next Move -->
481
+ <div id="settingsModal" class="modal settings-modal">
482
+ <div class="modal-content settings-modal-content">
483
+ <div class="modal-header">
484
+ <h3>Expression Settings Configuration</h3>
485
+ <span class="close" onclick="closeSettingsModal()">&times;</span>
486
+ </div>
487
+ <div class="modal-body settings-modal-body">
488
+ <div class="settings-info">
489
+ <p><strong>Configure settings to append to your decoded expressions</strong></p>
490
+ <p class="settings-note">You can enter multiple comma-separated values for any setting to create iterations</p>
491
+ </div>
492
+
493
+ <div class="settings-container">
494
+ <table class="settings-table">
495
+ <thead>
496
+ <tr>
497
+ <th width="20%">Setting Name</th>
498
+ <th width="50%">Value(s)</th>
499
+ <th width="15%">Type</th>
500
+ <th width="15%">Action</th>
501
+ </tr>
502
+ </thead>
503
+ <tbody id="settingsTableBody">
504
+ <tr>
505
+ <td>instrumentType</td>
506
+ <td><input type="text" class="setting-value-input" data-setting="instrumentType" placeholder="EQUITY" readonly></td>
507
+ <td><select class="setting-type-select" data-setting="instrumentType" disabled><option>string</option></select></td>
508
+ <td></td>
509
+ </tr>
510
+ <tr>
511
+ <td>region</td>
512
+ <td><input type="text" class="setting-value-input" data-setting="region" placeholder="sample: USA (e.g., USA, EUR, ASI)"></td>
513
+ <td><select class="setting-type-select" data-setting="region"><option>string</option><option>number</option></select></td>
514
+ <td></td>
515
+ </tr>
516
+ <tr>
517
+ <td>universe</td>
518
+ <td><input type="text" class="setting-value-input" data-setting="universe" placeholder="sample: TOP3000 (e.g., TOP3000, TOP1000, TOP500)"></td>
519
+ <td><select class="setting-type-select" data-setting="universe"><option>string</option><option>number</option></select></td>
520
+ <td></td>
521
+ </tr>
522
+ <tr>
523
+ <td>delay</td>
524
+ <td>
525
+ <select class="setting-value-input" data-setting="delay">
526
+ <option value="1" selected>1</option>
527
+ <option value="0">0</option>
528
+ </select>
529
+ </td>
530
+ <td><select class="setting-type-select" data-setting="delay"><option>number</option><option>string</option></select></td>
531
+ <td></td>
532
+ </tr>
533
+ <tr>
534
+ <td>decay</td>
535
+ <td><input type="text" class="setting-value-input" data-setting="decay" placeholder="sample: 20 (e.g., 0, 5, 20, 60)"></td>
536
+ <td><select class="setting-type-select" data-setting="decay"><option>number</option><option>string</option></select></td>
537
+ <td></td>
538
+ </tr>
539
+ <tr>
540
+ <td>neutralization</td>
541
+ <td><input type="text" class="setting-value-input" data-setting="neutralization" placeholder="sample: SUBINDUSTRY (e.g., NONE, SECTOR, INDUSTRY, SUBINDUSTRY)"></td>
542
+ <td><select class="setting-type-select" data-setting="neutralization"><option>string</option><option>number</option></select></td>
543
+ <td></td>
544
+ </tr>
545
+ <tr>
546
+ <td>truncation</td>
547
+ <td><input type="text" class="setting-value-input" data-setting="truncation" placeholder="sample: 0.08 (e.g., 0.01, 0.05, 0.08, 0.1)"></td>
548
+ <td><select class="setting-type-select" data-setting="truncation"><option>number</option><option>string</option></select></td>
549
+ <td></td>
550
+ </tr>
551
+ <tr>
552
+ <td>pasteurization</td>
553
+ <td>
554
+ <select class="setting-value-input" data-setting="pasteurization">
555
+ <option value="ON" selected>ON</option>
556
+ <option value="OFF">OFF</option>
557
+ </select>
558
+ </td>
559
+ <td><select class="setting-type-select" data-setting="pasteurization"><option>string</option><option>number</option></select></td>
560
+ <td></td>
561
+ </tr>
562
+ <tr>
563
+ <td>testPeriod</td>
564
+ <td>
565
+ <div style="display: flex; align-items: center; gap: 10px;">
566
+ <input type="range" class="setting-value-input test-period-slider" data-setting="testPeriod"
567
+ min="0" max="60" value="0" step="1"
568
+ style="flex: 1; min-width: 200px; margin: 0; padding: 0;
569
+ -webkit-appearance: none; appearance: none;
570
+ background: #ddd; height: 6px; border-radius: 3px; outline: none;">
571
+ <style>
572
+ .test-period-slider::-webkit-slider-thumb {
573
+ -webkit-appearance: none;
574
+ appearance: none;
575
+ width: 18px;
576
+ height: 18px;
577
+ border-radius: 50%;
578
+ background: #2196F3;
579
+ cursor: pointer;
580
+ border: none;
581
+ }
582
+ .test-period-slider::-moz-range-thumb {
583
+ width: 18px;
584
+ height: 18px;
585
+ border-radius: 50%;
586
+ background: #2196F3;
587
+ cursor: pointer;
588
+ border: none;
589
+ }
590
+ .test-period-slider::-webkit-slider-track {
591
+ background: #ddd;
592
+ height: 6px;
593
+ border-radius: 3px;
594
+ }
595
+ .test-period-slider::-moz-range-track {
596
+ background: #ddd;
597
+ height: 6px;
598
+ border-radius: 3px;
599
+ border: none;
600
+ }
601
+ </style>
602
+ <span id="testPeriodValue" style="min-width: 70px; font-family: monospace; font-size: 12px;">P0Y0M</span>
603
+ </div>
604
+ </td>
605
+ <td><select class="setting-type-select" data-setting="testPeriod"><option>string</option><option>number</option></select></td>
606
+ <td></td>
607
+ </tr>
608
+ <tr>
609
+ <td>unitHandling</td>
610
+ <td><input type="text" class="setting-value-input" data-setting="unitHandling" placeholder="VERIFY" value="VERIFY" readonly></td>
611
+ <td><select class="setting-type-select" data-setting="unitHandling" disabled><option>string</option></select></td>
612
+ <td></td>
613
+ </tr>
614
+ <tr>
615
+ <td>nanHandling</td>
616
+ <td>
617
+ <select class="setting-value-input" data-setting="nanHandling">
618
+ <option value="OFF" selected>OFF</option>
619
+ <option value="ON">ON</option>
620
+ </select>
621
+ </td>
622
+ <td><select class="setting-type-select" data-setting="nanHandling"><option>string</option><option>number</option></select></td>
623
+ <td></td>
624
+ </tr>
625
+ <tr>
626
+ <td>maxTrade</td>
627
+ <td>
628
+ <select class="setting-value-input" data-setting="maxTrade">
629
+ <option value="ON" selected>ON</option>
630
+ <option value="OFF">OFF</option>
631
+ </select>
632
+ </td>
633
+ <td><select class="setting-type-select" data-setting="maxTrade"><option>string</option><option>number</option></select></td>
634
+ <td></td>
635
+ </tr>
636
+ <tr>
637
+ <td>language</td>
638
+ <td><input type="text" class="setting-value-input" data-setting="language" placeholder="FASTEXPR" readonly></td>
639
+ <td><select class="setting-type-select" data-setting="language" disabled><option>string</option></select></td>
640
+ <td></td>
641
+ </tr>
642
+ <tr>
643
+ <td>visualization</td>
644
+ <td>
645
+ <select class="setting-value-input" data-setting="visualization">
646
+ <option value="false" selected>False</option>
647
+ <option value="true">True</option>
648
+ </select>
649
+ </td>
650
+ <td><select class="setting-type-select" data-setting="visualization"><option>boolean</option><option>string</option><option>number</option></select></td>
651
+ <td></td>
652
+ </tr>
653
+ </tbody>
654
+ </table>
655
+
656
+ <div class="add-setting-container">
657
+ <button id="addSettingBtn" class="btn btn-secondary btn-small">+ Add Custom Setting</button>
658
+ </div>
659
+ </div>
660
+
661
+ <div class="settings-preview">
662
+ <div class="preview-header">
663
+ <strong>Preview:</strong>
664
+ <span id="totalCombinations">0</span> total combinations will be generated
665
+ </div>
666
+ </div>
667
+ </div>
668
+ <div class="modal-footer">
669
+ <button onclick="closeSettingsModal()" class="btn btn-outline">Cancel</button>
670
+ <button onclick="confirmAndApplySettings()" class="btn btn-primary" id="generateDownloadBtn">
671
+ <span class="btn-text">Generate & Download</span>
672
+ <div class="btn-progress" style="display: none;">
673
+ <div class="progress-bar">
674
+ <div class="progress-bar-fill" style="width: 0%;"></div>
675
+ </div>
676
+ <span class="progress-text">Generating...</span>
677
+ </div>
678
+ </button>
679
+ <button onclick="generateAndTest()" class="btn btn-primary" style="background-color: #28a745;">Generate & Test</button>
680
+ </div>
681
+ </div>
682
+ </div>
683
+
684
+ <!-- BRAIN Test Results Modal -->
685
+ <div id="brainTestResultsModal" class="modal">
686
+ <div class="modal-content" style="max-width: 800px;">
687
+ <div class="modal-header">
688
+ <h3>BRAIN API Test Results</h3>
689
+ <span class="close" onclick="closeBrainTestResultsModal()">&times;</span>
690
+ </div>
691
+ <div class="modal-body" style="max-height: 600px; overflow-y: auto;">
692
+ <div id="brainTestProgress" class="test-progress" style="display: none;">
693
+ <div class="progress-bar">
694
+ <div id="progressBarFill" class="progress-bar-fill" style="width: 0%;"></div>
695
+ </div>
696
+ <p id="progressText">Testing expressions...</p>
697
+ </div>
698
+ <div id="brainTestResults" class="test-results">
699
+ <!-- Test results will be displayed here -->
700
+ </div>
701
+ </div>
702
+ <div class="modal-footer">
703
+ <button onclick="closeBrainTestResultsModal()" class="btn btn-primary">Close</button>
704
+ <button onclick="goToSimulator()" class="btn btn-secondary" id="downloadTestResultsBtn" style="display: none;">🚀 Open Simulator_mainland</button>
705
+ <button onclick="confirmAndDownloadExpressionWithSettings()" class="btn btn-secondary" id="downloadExpressionWithSettingsBtn" style="display: none;">
706
+ <span class="btn-text">Download Expression with Settings</span>
707
+ <div class="btn-progress" style="display: none;">
708
+ <div class="progress-bar">
709
+ <div class="progress-bar-fill" style="width: 0%;"></div>
710
+ </div>
711
+ <span class="progress-text">Generating...</span>
712
+ </div>
713
+ </button>
714
+ </div>
715
+ </div>
716
+ </div>
717
+
718
+ <!-- Save Template Modal -->
719
+ <div id="saveTemplateModal" class="modal">
720
+ <div class="modal-content">
721
+ <div class="modal-header">
722
+ <h3>Save Custom Template</h3>
723
+ <span class="close" onclick="closeSaveTemplateModal()">&times;</span>
724
+ </div>
725
+ <div class="modal-body">
726
+ <div class="form-group">
727
+ <label for="templateName">Template Name:</label>
728
+ <input type="text" id="templateName" class="form-input" placeholder="Enter a name for your template" maxlength="50">
729
+ </div>
730
+ <div class="form-group">
731
+ <label for="templateDescription">Description (optional):</label>
732
+ <textarea id="templateDescription" class="form-input" placeholder="Describe what this template does" rows="3"></textarea>
733
+ </div>
734
+ <div class="template-configurations-info" id="templateConfigurationsInfo" style="display: none;">
735
+ <div style="background-color: #e8f4fd; border: 1px solid #bee5eb; border-radius: 5px; padding: 12px; margin: 10px 0; font-size: 13px;">
736
+ <div style="color: #0c5460; font-weight: 500; margin-bottom: 5px;">
737
+ 📊 Template Configurations Detected
738
+ </div>
739
+ <div id="configurationsList" style="color: #0c5460;">
740
+ <!-- Template configurations will be listed here -->
741
+ </div>
742
+ <div style="color: #0c5460; font-size: 12px; margin-top: 5px; font-style: italic;">
743
+ ✓ These configurations will be saved with your template
744
+ </div>
745
+ </div>
746
+ </div>
747
+ <div class="template-preview">
748
+ <div class="preview-label">Preview:</div>
749
+ <pre id="templatePreview" style="margin: 0; white-space: pre-wrap; word-wrap: break-word;"></pre>
750
+ </div>
751
+ </div>
752
+ <div class="modal-footer">
753
+ <button onclick="closeSaveTemplateModal()" class="btn btn-outline">Cancel</button>
754
+ <button onclick="confirmSaveTemplate()" class="btn btn-primary">Save Template</button>
755
+ </div>
756
+ </div>
757
+ </div>
758
+
759
+ <!-- Overwrite Template Modal -->
760
+ <div id="overwriteTemplateModal" class="modal">
761
+ <div class="modal-content">
762
+ <div class="modal-header">
763
+ <h3>Overwrite Existing Template</h3>
764
+ <span class="close" onclick="closeOverwriteTemplateModal()">&times;</span>
765
+ </div>
766
+ <div class="modal-body">
767
+ <div class="form-group">
768
+ <label for="existingTemplateSelect">Select Template to Overwrite:</label>
769
+ <select id="existingTemplateSelect" class="form-input">
770
+ <option value="">Select a template...</option>
771
+ </select>
772
+ </div>
773
+ <div id="selectedTemplateInfo" class="form-group" style="display: none;">
774
+ <label>Current Description:</label>
775
+ <div id="currentTemplateDescription" class="form-input" style="background: #f8f9fa; border: 1px solid #dee2e6; padding: 10px; min-height: 40px; color: #6c757d; font-style: italic;">
776
+ <!-- Current template description will be shown here -->
777
+ </div>
778
+ </div>
779
+ <div class="template-configurations-info" id="overwriteConfigurationsInfo" style="display: none;">
780
+ <div style="background-color: #e8f4fd; border: 1px solid #bee5eb; border-radius: 5px; padding: 12px; margin: 10px 0; font-size: 13px;">
781
+ <div style="color: #0c5460; font-weight: 500; margin-bottom: 5px;">
782
+ 📊 Template Configurations Detected
783
+ </div>
784
+ <div id="overwriteConfigurationsList" style="color: #0c5460;">
785
+ <!-- Template configurations will be listed here -->
786
+ </div>
787
+ <div style="color: #0c5460; font-size: 12px; margin-top: 5px; font-style: italic;">
788
+ ✓ These configurations will replace the existing template
789
+ </div>
790
+ </div>
791
+ </div>
792
+ <div class="template-preview">
793
+ <div class="preview-label">New Expression Preview:</div>
794
+ <pre id="overwriteTemplatePreview" style="margin: 0; white-space: pre-wrap; word-wrap: break-word;"></pre>
795
+ </div>
796
+ </div>
797
+ <div class="modal-footer">
798
+ <button onclick="closeOverwriteTemplateModal()" class="btn btn-outline">Cancel</button>
799
+ <button onclick="confirmOverwriteTemplate()" class="btn btn-primary" id="overwriteConfirmBtn" disabled>Overwrite Template</button>
800
+ </div>
801
+ </div>
802
+ </div>
803
+
804
+ <!-- Inspiration Modal -->
805
+ <div id="inspirationModal" class="modal" style="display: none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; overflow: hidden; background-color: rgba(0,0,0,0.4);">
806
+ <div class="modal-content" style="background-color: #fefefe; margin: 1% auto; padding: 0; border: 1px solid #888; width: 98%; max-width: 1800px; height: 95vh; border-radius: 8px; display: flex; flex-direction: column;">
807
+ <div class="modal-header" style="display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid #eee; padding: 15px 20px;">
808
+ <h3 style="margin: 0;">Alpha Inspiration Master (找灵感)</h3>
809
+ <span id="inspire-close" style="color: #aaa; float: right; font-size: 28px; font-weight: bold; cursor: pointer;">&times;</span>
810
+ </div>
811
+
812
+ <div class="modal-body" style="padding: 20px; display: flex; gap: 20px; flex: 1; overflow: hidden;">
813
+ <style>
814
+ .inspire-col { transition: all 0.3s ease; position: relative; }
815
+ .inspire-col.collapsed { flex: 0 0 50px !important; min-width: 50px; overflow: hidden; background: #f8f9fa; border-radius: 4px; cursor: pointer; border: 1px solid #eee; }
816
+ .inspire-col.collapsed .inspire-col-content { display: none; }
817
+ .inspire-col.collapsed .col-header { flex-direction: column; align-items: center; height: 100%; justify-content: flex-start; padding-top: 10px; border-bottom: none !important; }
818
+ .inspire-col.collapsed .col-header h4 { display: none; }
819
+ .inspire-col.collapsed .toggle-btn { transform: rotate(180deg); margin-bottom: 20px; }
820
+ .vertical-label { display: none; writing-mode: vertical-rl; text-orientation: mixed; font-weight: bold; font-size: 1.2em; white-space: nowrap; letter-spacing: 2px; padding-top: 10px; }
821
+ .inspire-col.collapsed .vertical-label { display: block; }
822
+ .toggle-btn { background: none; border: none; cursor: pointer; font-size: 1.2em; color: #666; padding: 0 5px; transition: transform 0.3s; }
823
+ .toggle-btn:hover { color: #000; }
824
+ </style>
825
+
826
+ <!-- Column 1: Configuration -->
827
+ <div id="inspire-col-1" class="inspire-col" style="flex: 0 0 320px; display: flex; flex-direction: column; border-right: 1px solid #eee; padding-right: 15px; overflow-y: auto;">
828
+ <div class="col-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #007bff; padding-bottom: 5px;">
829
+ <h4 style="margin: 0; color: #007bff;">1. Configuration</h4>
830
+ <button class="toggle-btn" onclick="toggleInspireColumn('inspire-col-1')" title="Toggle Column">◀</button>
831
+ <span class="vertical-label" style="color: #007bff;">Configuration</span>
832
+ </div>
833
+
834
+ <div class="inspire-col-content" style="display: flex; flex-direction: column; gap: 20px;">
835
+ <div style="background: #f8f9fa; padding: 15px; border-radius: 5px;">
836
+ <h5 style="margin-top: 0; margin-bottom: 10px;">LLM Settings</h5>
837
+ <div style="margin-bottom: 10px;">
838
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Base URL</label>
839
+ <input type="text" id="inspire-llm-url" value="https://api.moonshot.cn/v1" class="form-input" style="width: 100%;">
840
+ </div>
841
+ <div style="margin-bottom: 10px;">
842
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Model Name</label>
843
+ <input type="text" id="inspire-llm-model" value="kimi-k2-turbo-preview" class="form-input" style="width: 100%;">
844
+ </div>
845
+ <div style="margin-bottom: 10px;">
846
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">API Key</label>
847
+ <div style="display: flex; gap: 5px;">
848
+ <input type="password" id="inspire-llm-key" placeholder="Enter API Key" class="form-input" style="width: 100%;">
849
+ <button id="inspire-test-llm" class="btn btn-secondary" style="white-space: nowrap;">测试连接</button>
850
+ </div>
851
+ </div>
852
+ </div>
853
+
854
+ <div style="background: #f8f9fa; padding: 15px; border-radius: 5px;">
855
+ <h5 style="margin-top: 0; margin-bottom: 10px;">Simulation Settings</h5>
856
+ <div style="margin-bottom: 10px;">
857
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Region</label>
858
+ <select id="inspire-region" class="form-input" style="width: 100%;"><option>Loading...</option></select>
859
+ </div>
860
+ <div style="margin-bottom: 10px;">
861
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Universe</label>
862
+ <select id="inspire-universe" class="form-input" style="width: 100%;"><option>Select Region First</option></select>
863
+ </div>
864
+ <div style="margin-bottom: 10px;">
865
+ <label style="display: block; margin-bottom: 5px; font-size: 0.9em; color: #666;">Delay</label>
866
+ <select id="inspire-delay" class="form-input" style="width: 100%;"><option>Select Region First</option></select>
867
+ </div>
868
+ </div>
869
+ </div>
870
+ </div>
871
+
872
+ <!-- Column 2: Dataset Selection -->
873
+ <div id="inspire-col-2" class="inspire-col" style="flex: 0 0 500px; display: flex; flex-direction: column; border-right: 1px solid #eee; padding-right: 15px; overflow-y: auto;">
874
+ <div class="col-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #28a745; padding-bottom: 5px;">
875
+ <h4 style="margin: 0; color: #28a745;">2. Select Dataset</h4>
876
+ <button class="toggle-btn" onclick="toggleInspireColumn('inspire-col-2')" title="Toggle Column">◀</button>
877
+ <span class="vertical-label" style="color: #28a745;">Select Dataset</span>
878
+ </div>
879
+
880
+ <div class="inspire-col-content" style="display: flex; flex-direction: column; flex: 1;">
881
+ <div style="display: flex; gap: 10px; margin-bottom: 10px;">
882
+ <input type="text" id="inspire-dataset-search" placeholder="Search dataset..." class="form-input" style="flex-grow: 1;">
883
+ <button id="inspire-search-dataset" class="btn btn-secondary">搜索</button>
884
+ </div>
885
+
886
+ <div id="inspire-selected-dataset" style="margin-bottom: 10px; padding: 10px; background-color: #e8f5e9; border: 1px solid #c3e6cb; border-radius: 4px; display: none;"></div>
887
+
888
+ <div id="inspire-dataset-results" style="flex-grow: 1; overflow-y: auto; border: 1px solid #eee; border-radius: 4px;">
889
+ <!-- Results will appear here -->
890
+ <div style="padding: 20px; text-align: center; color: #666;">
891
+ 搜索数据集以开始。
892
+ </div>
893
+ </div>
894
+ </div>
895
+ </div>
896
+
897
+ <!-- Column 3: Results -->
898
+ <div id="inspire-col-3" class="inspire-col" style="flex: 1; display: flex; flex-direction: column; overflow-y: auto;">
899
+ <div class="col-header" style="display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; border-bottom: 2px solid #ffc107; padding-bottom: 5px;">
900
+ <h4 style="margin: 0; color: #d39e00;">3. Results</h4>
901
+ <div style="display: flex; gap: 10px; align-items: center;">
902
+ <button id="inspire-generate" class="btn btn-primary">生成 Alpha 模板</button>
903
+ <button id="inspire-download" class="btn btn-success" style="display: none;">下载模板到本地 📥</button>
904
+ </div>
905
+ <span class="vertical-label" style="color: #d39e00;">Results</span>
906
+ </div>
907
+
908
+ <div class="inspire-col-content" style="display: flex; flex-direction: column; flex: 1;">
909
+ <div id="inspire-output" style="flex-grow: 1; background: #fff; border: 1px solid #ddd; padding: 15px; overflow-y: auto; border-radius: 4px;">
910
+ <div style="text-align: center; color: #666; margin-top: 50px;">
911
+ 生成的灵感将显示在这里。
912
+ </div>
913
+ </div>
914
+
915
+ <div style="margin-top: 15px;">
916
+ <button id="inspire-new-task" class="btn btn-secondary" style="width: 100%;">开始新任务</button>
917
+ </div>
918
+ </div>
919
+ </div>
920
+
921
+ </div>
922
+ </div>
923
+ </div>
924
+
925
+ <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
926
+ <script src="{{ url_for('static', filename='brain.js') }}"></script>
927
+ <script src="{{ url_for('static', filename='script.js') }}"></script>
928
+ <script src="{{ url_for('static', filename='inspiration.js') }}"></script>
929
+ <script src="{{ url_for('static', filename='decoder.js') }}"></script>
930
+ <script src="{{ url_for('static', filename='usage_widget.js') }}"></script>
931
+ </body>
932
+ </html>