MaiBot 1.3.8__tar.gz

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 (722) hide show
  1. maibot-1.3.8/EULA.md +135 -0
  2. maibot-1.3.8/LICENSE +674 -0
  3. maibot-1.3.8/MANIFEST.in +8 -0
  4. maibot-1.3.8/MaiBot.egg-info/PKG-INFO +245 -0
  5. maibot-1.3.8/MaiBot.egg-info/SOURCES.txt +720 -0
  6. maibot-1.3.8/MaiBot.egg-info/dependency_links.txt +1 -0
  7. maibot-1.3.8/MaiBot.egg-info/entry_points.txt +2 -0
  8. maibot-1.3.8/MaiBot.egg-info/requires.txt +45 -0
  9. maibot-1.3.8/MaiBot.egg-info/top_level.txt +1 -0
  10. maibot-1.3.8/PKG-INFO +245 -0
  11. maibot-1.3.8/PRIVACY.md +60 -0
  12. maibot-1.3.8/README.md +191 -0
  13. maibot-1.3.8/changelogs/changelog.md +918 -0
  14. maibot-1.3.8/locales/en-US/config.json +39 -0
  15. maibot-1.3.8/locales/en-US/core.json +8 -0
  16. maibot-1.3.8/locales/en-US/prompts.json +8 -0
  17. maibot-1.3.8/locales/en-US/startup.json +98 -0
  18. maibot-1.3.8/locales/ja-JP/config.json +39 -0
  19. maibot-1.3.8/locales/ja-JP/core.json +8 -0
  20. maibot-1.3.8/locales/ja-JP/prompts.json +8 -0
  21. maibot-1.3.8/locales/ja-JP/startup.json +98 -0
  22. maibot-1.3.8/locales/ko/config.json +39 -0
  23. maibot-1.3.8/locales/ko/core.json +8 -0
  24. maibot-1.3.8/locales/ko/prompts.json +8 -0
  25. maibot-1.3.8/locales/ko/startup.json +98 -0
  26. maibot-1.3.8/locales/zh-CN/config.json +39 -0
  27. maibot-1.3.8/locales/zh-CN/core.json +8 -0
  28. maibot-1.3.8/locales/zh-CN/prompts.json +8 -0
  29. maibot-1.3.8/locales/zh-CN/startup.json +98 -0
  30. maibot-1.3.8/prompts/en-US/.meta.toml +164 -0
  31. maibot-1.3.8/prompts/en-US/a_memorix_chat_summary.prompt +45 -0
  32. maibot-1.3.8/prompts/en-US/emoji_content_analysis.prompt +3 -0
  33. maibot-1.3.8/prompts/en-US/emoji_content_filtration.prompt +6 -0
  34. maibot-1.3.8/prompts/en-US/emoji_replace.prompt +12 -0
  35. maibot-1.3.8/prompts/en-US/emoji_selection.prompt +6 -0
  36. maibot-1.3.8/prompts/en-US/expression_evaluation.prompt +14 -0
  37. maibot-1.3.8/prompts/en-US/heuristic_memory_impression.prompt +15 -0
  38. maibot-1.3.8/prompts/en-US/image_description.prompt +1 -0
  39. maibot-1.3.8/prompts/en-US/jargon_compare_inference.prompt +14 -0
  40. maibot-1.3.8/prompts/en-US/jargon_inference_content_only.prompt +11 -0
  41. maibot-1.3.8/prompts/en-US/jargon_inference_with_context.prompt +19 -0
  42. maibot-1.3.8/prompts/en-US/learn_jargon.prompt +31 -0
  43. maibot-1.3.8/prompts/en-US/learn_style.prompt +28 -0
  44. maibot-1.3.8/prompts/en-US/maisaka_chat.prompt +28 -0
  45. maibot-1.3.8/prompts/en-US/maisaka_chat_focus.prompt +39 -0
  46. maibot-1.3.8/prompts/en-US/maisaka_chat_optimized.prompt +19 -0
  47. maibot-1.3.8/prompts/en-US/maisaka_replyer.prompt +10 -0
  48. maibot-1.3.8/prompts/en-US/memory_fuzzy_modify_plan.prompt +45 -0
  49. maibot-1.3.8/prompts/en-US/mid_term_memory_summary.prompt +10 -0
  50. maibot-1.3.8/prompts/en-US/reply_attachments.prompt +3 -0
  51. maibot-1.3.8/prompts/en-US/retro_private_replyer.prompt +13 -0
  52. maibot-1.3.8/prompts/en-US/retro_private_replyer_self.prompt +13 -0
  53. maibot-1.3.8/prompts/en-US/retro_replyer.prompt +17 -0
  54. maibot-1.3.8/prompts/en-US/retro_replyer_light.prompt +17 -0
  55. maibot-1.3.8/prompts/en-US/webui_ai_search.prompt +24 -0
  56. maibot-1.3.8/prompts/en-US/webui_ai_search_correction.prompt +1 -0
  57. maibot-1.3.8/prompts/en-US/webui_ai_search_evidence.prompt +3 -0
  58. maibot-1.3.8/prompts/en-US/webui_ai_search_final.prompt +1 -0
  59. maibot-1.3.8/prompts/ja-JP/.meta.toml +164 -0
  60. maibot-1.3.8/prompts/ja-JP/a_memorix_chat_summary.prompt +45 -0
  61. maibot-1.3.8/prompts/ja-JP/emoji_content_analysis.prompt +3 -0
  62. maibot-1.3.8/prompts/ja-JP/emoji_content_filtration.prompt +6 -0
  63. maibot-1.3.8/prompts/ja-JP/emoji_replace.prompt +12 -0
  64. maibot-1.3.8/prompts/ja-JP/emoji_selection.prompt +6 -0
  65. maibot-1.3.8/prompts/ja-JP/expression_evaluation.prompt +14 -0
  66. maibot-1.3.8/prompts/ja-JP/heuristic_memory_impression.prompt +15 -0
  67. maibot-1.3.8/prompts/ja-JP/image_description.prompt +1 -0
  68. maibot-1.3.8/prompts/ja-JP/jargon_compare_inference.prompt +14 -0
  69. maibot-1.3.8/prompts/ja-JP/jargon_inference_content_only.prompt +11 -0
  70. maibot-1.3.8/prompts/ja-JP/jargon_inference_with_context.prompt +19 -0
  71. maibot-1.3.8/prompts/ja-JP/learn_jargon.prompt +31 -0
  72. maibot-1.3.8/prompts/ja-JP/learn_style.prompt +28 -0
  73. maibot-1.3.8/prompts/ja-JP/maisaka_chat.prompt +28 -0
  74. maibot-1.3.8/prompts/ja-JP/maisaka_chat_focus.prompt +39 -0
  75. maibot-1.3.8/prompts/ja-JP/maisaka_chat_optimized.prompt +19 -0
  76. maibot-1.3.8/prompts/ja-JP/maisaka_replyer.prompt +10 -0
  77. maibot-1.3.8/prompts/ja-JP/memory_fuzzy_modify_plan.prompt +45 -0
  78. maibot-1.3.8/prompts/ja-JP/mid_term_memory_summary.prompt +10 -0
  79. maibot-1.3.8/prompts/ja-JP/reply_attachments.prompt +3 -0
  80. maibot-1.3.8/prompts/ja-JP/retro_private_replyer.prompt +13 -0
  81. maibot-1.3.8/prompts/ja-JP/retro_private_replyer_self.prompt +13 -0
  82. maibot-1.3.8/prompts/ja-JP/retro_replyer.prompt +17 -0
  83. maibot-1.3.8/prompts/ja-JP/retro_replyer_light.prompt +17 -0
  84. maibot-1.3.8/prompts/ja-JP/webui_ai_search.prompt +24 -0
  85. maibot-1.3.8/prompts/ja-JP/webui_ai_search_correction.prompt +1 -0
  86. maibot-1.3.8/prompts/ja-JP/webui_ai_search_evidence.prompt +3 -0
  87. maibot-1.3.8/prompts/ja-JP/webui_ai_search_final.prompt +1 -0
  88. maibot-1.3.8/prompts/ko/.meta.toml +4 -0
  89. maibot-1.3.8/prompts/ko/reply_attachments.prompt +3 -0
  90. maibot-1.3.8/prompts/zh-CN/.meta.toml +159 -0
  91. maibot-1.3.8/prompts/zh-CN/a_memorix_chat_summary.prompt +59 -0
  92. maibot-1.3.8/prompts/zh-CN/emoji_content_analysis.prompt +3 -0
  93. maibot-1.3.8/prompts/zh-CN/emoji_content_filtration.prompt +6 -0
  94. maibot-1.3.8/prompts/zh-CN/emoji_replace.prompt +12 -0
  95. maibot-1.3.8/prompts/zh-CN/emoji_selection.prompt +6 -0
  96. maibot-1.3.8/prompts/zh-CN/expression_evaluation.prompt +14 -0
  97. maibot-1.3.8/prompts/zh-CN/heuristic_memory_impression.prompt +15 -0
  98. maibot-1.3.8/prompts/zh-CN/image_description.prompt +1 -0
  99. maibot-1.3.8/prompts/zh-CN/jargon_compare_inference.prompt +14 -0
  100. maibot-1.3.8/prompts/zh-CN/jargon_inference_content_only.prompt +11 -0
  101. maibot-1.3.8/prompts/zh-CN/jargon_inference_with_context.prompt +19 -0
  102. maibot-1.3.8/prompts/zh-CN/learn_jargon.prompt +31 -0
  103. maibot-1.3.8/prompts/zh-CN/learn_style.prompt +28 -0
  104. maibot-1.3.8/prompts/zh-CN/maisaka_chat.prompt +28 -0
  105. maibot-1.3.8/prompts/zh-CN/maisaka_chat_focus.prompt +39 -0
  106. maibot-1.3.8/prompts/zh-CN/maisaka_chat_optimized.prompt +19 -0
  107. maibot-1.3.8/prompts/zh-CN/maisaka_replyer.prompt +6 -0
  108. maibot-1.3.8/prompts/zh-CN/memory_fuzzy_modify_plan.prompt +45 -0
  109. maibot-1.3.8/prompts/zh-CN/mid_term_memory_summary.prompt +10 -0
  110. maibot-1.3.8/prompts/zh-CN/reply_attachments.prompt +3 -0
  111. maibot-1.3.8/prompts/zh-CN/retro_private_replyer.prompt +13 -0
  112. maibot-1.3.8/prompts/zh-CN/retro_private_replyer_self.prompt +13 -0
  113. maibot-1.3.8/prompts/zh-CN/retro_replyer.prompt +17 -0
  114. maibot-1.3.8/prompts/zh-CN/retro_replyer_light.prompt +17 -0
  115. maibot-1.3.8/prompts/zh-CN/webui_ai_search.prompt +24 -0
  116. maibot-1.3.8/prompts/zh-CN/webui_ai_search_correction.prompt +1 -0
  117. maibot-1.3.8/prompts/zh-CN/webui_ai_search_evidence.prompt +3 -0
  118. maibot-1.3.8/prompts/zh-CN/webui_ai_search_final.prompt +1 -0
  119. maibot-1.3.8/pyproject.toml +156 -0
  120. maibot-1.3.8/setup.cfg +4 -0
  121. maibot-1.3.8/setup.py +28 -0
  122. maibot-1.3.8/src/A_memorix/LICENSE +661 -0
  123. maibot-1.3.8/src/A_memorix/LICENSE-MAIBOT-GPL.md +22 -0
  124. maibot-1.3.8/src/A_memorix/__init__.py +5 -0
  125. maibot-1.3.8/src/A_memorix/config_schema.json +1640 -0
  126. maibot-1.3.8/src/A_memorix/core/__init__.py +83 -0
  127. maibot-1.3.8/src/A_memorix/core/embedding/__init__.py +17 -0
  128. maibot-1.3.8/src/A_memorix/core/embedding/api_adapter.py +650 -0
  129. maibot-1.3.8/src/A_memorix/core/embedding/manager.py +506 -0
  130. maibot-1.3.8/src/A_memorix/core/embedding/presets.py +68 -0
  131. maibot-1.3.8/src/A_memorix/core/image/__init__.py +6 -0
  132. maibot-1.3.8/src/A_memorix/core/image/asset_store.py +141 -0
  133. maibot-1.3.8/src/A_memorix/core/image/component_paths.py +36 -0
  134. maibot-1.3.8/src/A_memorix/core/image/embedder.py +129 -0
  135. maibot-1.3.8/src/A_memorix/core/image/fingerprints.py +36 -0
  136. maibot-1.3.8/src/A_memorix/core/image/runtime.py +900 -0
  137. maibot-1.3.8/src/A_memorix/core/retrieval/__init__.py +66 -0
  138. maibot-1.3.8/src/A_memorix/core/retrieval/dual_path.py +3272 -0
  139. maibot-1.3.8/src/A_memorix/core/retrieval/graph_relation_recall.py +285 -0
  140. maibot-1.3.8/src/A_memorix/core/retrieval/pagerank.py +471 -0
  141. maibot-1.3.8/src/A_memorix/core/retrieval/posterior_graph.py +787 -0
  142. maibot-1.3.8/src/A_memorix/core/retrieval/score_calibration.py +180 -0
  143. maibot-1.3.8/src/A_memorix/core/retrieval/sparse_bm25.py +717 -0
  144. maibot-1.3.8/src/A_memorix/core/retrieval/threshold.py +404 -0
  145. maibot-1.3.8/src/A_memorix/core/runtime/__init__.py +26 -0
  146. maibot-1.3.8/src/A_memorix/core/runtime/admin_contracts.py +293 -0
  147. maibot-1.3.8/src/A_memorix/core/runtime/kernel_compat.py +269 -0
  148. maibot-1.3.8/src/A_memorix/core/runtime/lifecycle_orchestrator.py +368 -0
  149. maibot-1.3.8/src/A_memorix/core/runtime/models.py +27 -0
  150. maibot-1.3.8/src/A_memorix/core/runtime/runtime_facade.py +141 -0
  151. maibot-1.3.8/src/A_memorix/core/runtime/runtime_writer_lock.py +105 -0
  152. maibot-1.3.8/src/A_memorix/core/runtime/sdk_memory_kernel.py +1907 -0
  153. maibot-1.3.8/src/A_memorix/core/runtime/search_runtime_initializer.py +290 -0
  154. maibot-1.3.8/src/A_memorix/core/runtime/services/__init__.py +63 -0
  155. maibot-1.3.8/src/A_memorix/core/runtime/services/background_task_service.py +477 -0
  156. maibot-1.3.8/src/A_memorix/core/runtime/services/base.py +28 -0
  157. maibot-1.3.8/src/A_memorix/core/runtime/services/bundle_admin_service.py +2200 -0
  158. maibot-1.3.8/src/A_memorix/core/runtime/services/chat_filter_service.py +88 -0
  159. maibot-1.3.8/src/A_memorix/core/runtime/services/correction_admin_service.py +1274 -0
  160. maibot-1.3.8/src/A_memorix/core/runtime/services/delete_admin_service.py +2018 -0
  161. maibot-1.3.8/src/A_memorix/core/runtime/services/dual_vector_migration_service.py +109 -0
  162. maibot-1.3.8/src/A_memorix/core/runtime/services/dual_vector_state_service.py +503 -0
  163. maibot-1.3.8/src/A_memorix/core/runtime/services/embedding_state_service.py +515 -0
  164. maibot-1.3.8/src/A_memorix/core/runtime/services/episode_admin_service.py +104 -0
  165. maibot-1.3.8/src/A_memorix/core/runtime/services/fact_admin_service.py +199 -0
  166. maibot-1.3.8/src/A_memorix/core/runtime/services/feedback_correction_service.py +1523 -0
  167. maibot-1.3.8/src/A_memorix/core/runtime/services/graph_admin_service.py +1521 -0
  168. maibot-1.3.8/src/A_memorix/core/runtime/services/image_service.py +158 -0
  169. maibot-1.3.8/src/A_memorix/core/runtime/services/import_tuning_admin_service.py +158 -0
  170. maibot-1.3.8/src/A_memorix/core/runtime/services/ingest_service.py +787 -0
  171. maibot-1.3.8/src/A_memorix/core/runtime/services/memory_maintenance_service.py +404 -0
  172. maibot-1.3.8/src/A_memorix/core/runtime/services/memory_search_service.py +373 -0
  173. maibot-1.3.8/src/A_memorix/core/runtime/services/profile_admin_service.py +646 -0
  174. maibot-1.3.8/src/A_memorix/core/runtime/services/request_dedup_service.py +34 -0
  175. maibot-1.3.8/src/A_memorix/core/runtime/services/runtime_config_service.py +94 -0
  176. maibot-1.3.8/src/A_memorix/core/runtime/services/runtime_dependency_service.py +105 -0
  177. maibot-1.3.8/src/A_memorix/core/runtime/services/runtime_lifecycle_service.py +409 -0
  178. maibot-1.3.8/src/A_memorix/core/runtime/services/search_hit_processing_service.py +891 -0
  179. maibot-1.3.8/src/A_memorix/core/runtime/services/source_admin_service.py +52 -0
  180. maibot-1.3.8/src/A_memorix/core/runtime/services/stats_service.py +35 -0
  181. maibot-1.3.8/src/A_memorix/core/runtime/services/summary_service.py +50 -0
  182. maibot-1.3.8/src/A_memorix/core/runtime/services/v5_admin_service.py +326 -0
  183. maibot-1.3.8/src/A_memorix/core/runtime/services/vector_delete_service.py +30 -0
  184. maibot-1.3.8/src/A_memorix/core/runtime/services/vector_rebuild_checkpoint.py +65 -0
  185. maibot-1.3.8/src/A_memorix/core/runtime/services/vector_recovery_service.py +460 -0
  186. maibot-1.3.8/src/A_memorix/core/runtime/services/vector_runtime_service.py +1417 -0
  187. maibot-1.3.8/src/A_memorix/core/runtime/services/vector_space_service.py +251 -0
  188. maibot-1.3.8/src/A_memorix/core/storage/__init__.py +62 -0
  189. maibot-1.3.8/src/A_memorix/core/storage/format_migration.py +676 -0
  190. maibot-1.3.8/src/A_memorix/core/storage/graph_store.py +1733 -0
  191. maibot-1.3.8/src/A_memorix/core/storage/knowledge_types.py +183 -0
  192. maibot-1.3.8/src/A_memorix/core/storage/metadata_cleanup.py +913 -0
  193. maibot-1.3.8/src/A_memorix/core/storage/metadata_episode.py +1659 -0
  194. maibot-1.3.8/src/A_memorix/core/storage/metadata_fact.py +1410 -0
  195. maibot-1.3.8/src/A_memorix/core/storage/metadata_feedback.py +745 -0
  196. maibot-1.3.8/src/A_memorix/core/storage/metadata_fts.py +937 -0
  197. maibot-1.3.8/src/A_memorix/core/storage/metadata_image.py +1076 -0
  198. maibot-1.3.8/src/A_memorix/core/storage/metadata_profile.py +782 -0
  199. maibot-1.3.8/src/A_memorix/core/storage/metadata_schema.py +2503 -0
  200. maibot-1.3.8/src/A_memorix/core/storage/metadata_store.py +4565 -0
  201. maibot-1.3.8/src/A_memorix/core/storage/sqlite_connection.py +176 -0
  202. maibot-1.3.8/src/A_memorix/core/storage/tokenizer_runtime.py +9 -0
  203. maibot-1.3.8/src/A_memorix/core/storage/transaction.py +42 -0
  204. maibot-1.3.8/src/A_memorix/core/storage/type_detection.py +137 -0
  205. maibot-1.3.8/src/A_memorix/core/storage/value_coercion.py +10 -0
  206. maibot-1.3.8/src/A_memorix/core/storage/vector_store.py +2851 -0
  207. maibot-1.3.8/src/A_memorix/core/strategies/__init__.py +0 -0
  208. maibot-1.3.8/src/A_memorix/core/strategies/base.py +92 -0
  209. maibot-1.3.8/src/A_memorix/core/strategies/chat_log.py +80 -0
  210. maibot-1.3.8/src/A_memorix/core/strategies/factual.py +104 -0
  211. maibot-1.3.8/src/A_memorix/core/strategies/narrative.py +148 -0
  212. maibot-1.3.8/src/A_memorix/core/strategies/quote.py +47 -0
  213. maibot-1.3.8/src/A_memorix/core/utils/__init__.py +33 -0
  214. maibot-1.3.8/src/A_memorix/core/utils/aggregate_query_service.py +359 -0
  215. maibot-1.3.8/src/A_memorix/core/utils/episode_retrieval_service.py +222 -0
  216. maibot-1.3.8/src/A_memorix/core/utils/episode_segmentation_service.py +322 -0
  217. maibot-1.3.8/src/A_memorix/core/utils/episode_service.py +646 -0
  218. maibot-1.3.8/src/A_memorix/core/utils/feedback_policy.py +149 -0
  219. maibot-1.3.8/src/A_memorix/core/utils/hash.py +128 -0
  220. maibot-1.3.8/src/A_memorix/core/utils/import_payloads.py +222 -0
  221. maibot-1.3.8/src/A_memorix/core/utils/io.py +85 -0
  222. maibot-1.3.8/src/A_memorix/core/utils/matcher.py +175 -0
  223. maibot-1.3.8/src/A_memorix/core/utils/memory_lifecycle_policy.py +336 -0
  224. maibot-1.3.8/src/A_memorix/core/utils/metadata.py +11 -0
  225. maibot-1.3.8/src/A_memorix/core/utils/model_routing.py +239 -0
  226. maibot-1.3.8/src/A_memorix/core/utils/monitor.py +188 -0
  227. maibot-1.3.8/src/A_memorix/core/utils/path_fallback_service.py +182 -0
  228. maibot-1.3.8/src/A_memorix/core/utils/person_profile_service.py +1277 -0
  229. maibot-1.3.8/src/A_memorix/core/utils/plugin_id_policy.py +26 -0
  230. maibot-1.3.8/src/A_memorix/core/utils/profile_evidence.py +25 -0
  231. maibot-1.3.8/src/A_memorix/core/utils/profile_policy.py +45 -0
  232. maibot-1.3.8/src/A_memorix/core/utils/profile_text.py +204 -0
  233. maibot-1.3.8/src/A_memorix/core/utils/quantization.py +343 -0
  234. maibot-1.3.8/src/A_memorix/core/utils/relation_query.py +121 -0
  235. maibot-1.3.8/src/A_memorix/core/utils/relation_write_service.py +504 -0
  236. maibot-1.3.8/src/A_memorix/core/utils/retrieval_tuning_manager.py +2369 -0
  237. maibot-1.3.8/src/A_memorix/core/utils/runtime_payloads.py +132 -0
  238. maibot-1.3.8/src/A_memorix/core/utils/runtime_self_check.py +303 -0
  239. maibot-1.3.8/src/A_memorix/core/utils/search_execution_service.py +445 -0
  240. maibot-1.3.8/src/A_memorix/core/utils/search_postprocess.py +91 -0
  241. maibot-1.3.8/src/A_memorix/core/utils/summary_importer.py +991 -0
  242. maibot-1.3.8/src/A_memorix/core/utils/time_parser.py +156 -0
  243. maibot-1.3.8/src/A_memorix/core/utils/web_import_manager.py +4511 -0
  244. maibot-1.3.8/src/A_memorix/host_service.py +1018 -0
  245. maibot-1.3.8/src/A_memorix/paths.py +58 -0
  246. maibot-1.3.8/src/A_memorix/plugin.py +321 -0
  247. maibot-1.3.8/src/A_memorix/runtime_registry.py +30 -0
  248. maibot-1.3.8/src/A_memorix/scripts/_bootstrap.py +22 -0
  249. maibot-1.3.8/src/A_memorix/scripts/audit_vector_consistency.py +205 -0
  250. maibot-1.3.8/src/A_memorix/scripts/backfill_relation_vectors.py +265 -0
  251. maibot-1.3.8/src/A_memorix/scripts/backfill_temporal_metadata.py +67 -0
  252. maibot-1.3.8/src/A_memorix/scripts/convert_lpmm.py +537 -0
  253. maibot-1.3.8/src/A_memorix/scripts/import_lpmm_json.py +189 -0
  254. maibot-1.3.8/src/A_memorix/scripts/migrate_chat_history.py +101 -0
  255. maibot-1.3.8/src/A_memorix/scripts/migrate_maibot_memory.py +1955 -0
  256. maibot-1.3.8/src/A_memorix/scripts/migrate_person_memory_points.py +113 -0
  257. maibot-1.3.8/src/A_memorix/scripts/process_knowledge.py +831 -0
  258. maibot-1.3.8/src/A_memorix/scripts/rebuild_episodes.py +207 -0
  259. maibot-1.3.8/src/A_memorix/scripts/release_vnext_migrate.py +875 -0
  260. maibot-1.3.8/src/A_memorix/scripts/runtime_self_check.py +144 -0
  261. maibot-1.3.8/src/__init__.py +14 -0
  262. maibot-1.3.8/src/chat/__init__.py +13 -0
  263. maibot-1.3.8/src/chat/heart_flow/heartFC_utils.py +29 -0
  264. maibot-1.3.8/src/chat/heart_flow/heartflow_manager.py +138 -0
  265. maibot-1.3.8/src/chat/heart_flow/heartflow_message_processor.py +104 -0
  266. maibot-1.3.8/src/chat/image_system/image_cache_cleanup.py +300 -0
  267. maibot-1.3.8/src/chat/image_system/image_manager.py +516 -0
  268. maibot-1.3.8/src/chat/message_receive/__init__.py +5 -0
  269. maibot-1.3.8/src/chat/message_receive/bot.py +893 -0
  270. maibot-1.3.8/src/chat/message_receive/chat_manager.py +540 -0
  271. maibot-1.3.8/src/chat/message_receive/image_receive_compressor.py +135 -0
  272. maibot-1.3.8/src/chat/message_receive/message.py +546 -0
  273. maibot-1.3.8/src/chat/message_receive/uni_message_sender.py +332 -0
  274. maibot-1.3.8/src/chat/replyer/expression_vector_index.py +3176 -0
  275. maibot-1.3.8/src/chat/replyer/maisaka_expression_selector.py +678 -0
  276. maibot-1.3.8/src/chat/replyer/maisaka_generator.py +25 -0
  277. maibot-1.3.8/src/chat/replyer/maisaka_generator_base.py +1457 -0
  278. maibot-1.3.8/src/chat/replyer/replyer_manager.py +62 -0
  279. maibot-1.3.8/src/chat/replyer/retro_prompt.py +512 -0
  280. maibot-1.3.8/src/chat/utils/llm_sentence_splitter.py +151 -0
  281. maibot-1.3.8/src/chat/utils/statistic.py +3170 -0
  282. maibot-1.3.8/src/chat/utils/typo_generator.py +495 -0
  283. maibot-1.3.8/src/chat/utils/utils.py +922 -0
  284. maibot-1.3.8/src/cli/__init__.py +3 -0
  285. maibot-1.3.8/src/cli/bot_console.py +281 -0
  286. maibot-1.3.8/src/cli/console.py +17 -0
  287. maibot-1.3.8/src/cli/input_reader.py +55 -0
  288. maibot-1.3.8/src/cli/maisaka_cli.py +122 -0
  289. maibot-1.3.8/src/cli/maisaka_cli_sender.py +28 -0
  290. maibot-1.3.8/src/cli/tool.py +62 -0
  291. maibot-1.3.8/src/common/__init__.py +1 -0
  292. maibot-1.3.8/src/common/data_models/__init__.py +28 -0
  293. maibot-1.3.8/src/common/data_models/chat_session_data_model.py +73 -0
  294. maibot-1.3.8/src/common/data_models/chat_target_info_data_model.py +73 -0
  295. maibot-1.3.8/src/common/data_models/embedding_service_data_models.py +31 -0
  296. maibot-1.3.8/src/common/data_models/expression_data_model.py +83 -0
  297. maibot-1.3.8/src/common/data_models/image_data_model.py +247 -0
  298. maibot-1.3.8/src/common/data_models/jargon_data_model.py +101 -0
  299. maibot-1.3.8/src/common/data_models/llm_data_model.py +23 -0
  300. maibot-1.3.8/src/common/data_models/llm_service_data_models.py +298 -0
  301. maibot-1.3.8/src/common/data_models/mai_message_data_model.py +226 -0
  302. maibot-1.3.8/src/common/data_models/message_component_data_model.py +560 -0
  303. maibot-1.3.8/src/common/data_models/person_info_data_model.py +177 -0
  304. maibot-1.3.8/src/common/data_models/reply_generation_data_models.py +275 -0
  305. maibot-1.3.8/src/common/data_models/tool_record_data_model.py +51 -0
  306. maibot-1.3.8/src/common/database/__init__.py +0 -0
  307. maibot-1.3.8/src/common/database/database.py +240 -0
  308. maibot-1.3.8/src/common/database/database_model.py +477 -0
  309. maibot-1.3.8/src/common/database/migrations/__init__.py +161 -0
  310. maibot-1.3.8/src/common/database/migrations/behavior_generic_tags.py +532 -0
  311. maibot-1.3.8/src/common/database/migrations/bootstrap.py +171 -0
  312. maibot-1.3.8/src/common/database/migrations/builtin.py +1966 -0
  313. maibot-1.3.8/src/common/database/migrations/exceptions.py +33 -0
  314. maibot-1.3.8/src/common/database/migrations/frozen_v2_schema.py +282 -0
  315. maibot-1.3.8/src/common/database/migrations/legacy_v1_to_v2.py +1300 -0
  316. maibot-1.3.8/src/common/database/migrations/manager.py +209 -0
  317. maibot-1.3.8/src/common/database/migrations/models.py +305 -0
  318. maibot-1.3.8/src/common/database/migrations/planner.py +108 -0
  319. maibot-1.3.8/src/common/database/migrations/progress.py +319 -0
  320. maibot-1.3.8/src/common/database/migrations/registry.py +98 -0
  321. maibot-1.3.8/src/common/database/migrations/resolver.py +135 -0
  322. maibot-1.3.8/src/common/database/migrations/schema.py +98 -0
  323. maibot-1.3.8/src/common/database/migrations/v10_to_v11.py +60 -0
  324. maibot-1.3.8/src/common/database/migrations/v11_to_v12.py +92 -0
  325. maibot-1.3.8/src/common/database/migrations/v12_to_v13.py +42 -0
  326. maibot-1.3.8/src/common/database/migrations/v13_to_v14.py +55 -0
  327. maibot-1.3.8/src/common/database/migrations/v14_to_v15.py +44 -0
  328. maibot-1.3.8/src/common/database/migrations/v15_to_v16.py +39 -0
  329. maibot-1.3.8/src/common/database/migrations/v16_to_v17.py +66 -0
  330. maibot-1.3.8/src/common/database/migrations/v17_to_v18.py +64 -0
  331. maibot-1.3.8/src/common/database/migrations/v18_to_v19.py +355 -0
  332. maibot-1.3.8/src/common/database/migrations/v19_to_v20.py +169 -0
  333. maibot-1.3.8/src/common/database/migrations/v20_to_v21.py +149 -0
  334. maibot-1.3.8/src/common/database/migrations/v21_to_v22.py +343 -0
  335. maibot-1.3.8/src/common/database/migrations/v22_to_v23.py +114 -0
  336. maibot-1.3.8/src/common/database/migrations/v23_to_v24.py +465 -0
  337. maibot-1.3.8/src/common/database/migrations/v24_to_v25.py +96 -0
  338. maibot-1.3.8/src/common/database/migrations/v25_to_v26.py +32 -0
  339. maibot-1.3.8/src/common/database/migrations/v26_to_v27.py +86 -0
  340. maibot-1.3.8/src/common/database/migrations/v27_to_v28.py +185 -0
  341. maibot-1.3.8/src/common/database/migrations/v28_to_v29.py +80 -0
  342. maibot-1.3.8/src/common/database/migrations/v29_to_v30.py +217 -0
  343. maibot-1.3.8/src/common/database/migrations/v2_to_v3.py +269 -0
  344. maibot-1.3.8/src/common/database/migrations/v30_to_v31.py +323 -0
  345. maibot-1.3.8/src/common/database/migrations/v31_to_v32.py +250 -0
  346. maibot-1.3.8/src/common/database/migrations/v32_to_v33.py +84 -0
  347. maibot-1.3.8/src/common/database/migrations/v33_to_v34.py +119 -0
  348. maibot-1.3.8/src/common/database/migrations/v34_to_v35.py +68 -0
  349. maibot-1.3.8/src/common/database/migrations/v35_to_v36.py +35 -0
  350. maibot-1.3.8/src/common/database/migrations/v36_to_v37.py +54 -0
  351. maibot-1.3.8/src/common/database/migrations/v37_to_v38.py +95 -0
  352. maibot-1.3.8/src/common/database/migrations/v38_to_v39.py +85 -0
  353. maibot-1.3.8/src/common/database/migrations/v39_to_v40.py +53 -0
  354. maibot-1.3.8/src/common/database/migrations/v3_to_v4.py +155 -0
  355. maibot-1.3.8/src/common/database/migrations/v40_to_v41.py +23 -0
  356. maibot-1.3.8/src/common/database/migrations/v41_to_v42.py +44 -0
  357. maibot-1.3.8/src/common/database/migrations/v42_to_v43.py +29 -0
  358. maibot-1.3.8/src/common/database/migrations/v4_to_v5.py +77 -0
  359. maibot-1.3.8/src/common/database/migrations/v5_to_v6.py +51 -0
  360. maibot-1.3.8/src/common/database/migrations/v6_to_v7.py +164 -0
  361. maibot-1.3.8/src/common/database/migrations/v7_to_v8.py +73 -0
  362. maibot-1.3.8/src/common/database/migrations/v8_to_v9.py +313 -0
  363. maibot-1.3.8/src/common/database/migrations/v9_to_v10.py +53 -0
  364. maibot-1.3.8/src/common/database/migrations/version_store.py +57 -0
  365. maibot-1.3.8/src/common/embedding_identity.py +43 -0
  366. maibot-1.3.8/src/common/event_loop_watchdog.py +72 -0
  367. maibot-1.3.8/src/common/i18n/__init__.py +70 -0
  368. maibot-1.3.8/src/common/i18n/exceptions.py +18 -0
  369. maibot-1.3.8/src/common/i18n/formatting.py +29 -0
  370. maibot-1.3.8/src/common/i18n/loaders.py +162 -0
  371. maibot-1.3.8/src/common/i18n/manager.py +201 -0
  372. maibot-1.3.8/src/common/logger.py +1009 -0
  373. maibot-1.3.8/src/common/logger_color_and_mapping.py +430 -0
  374. maibot-1.3.8/src/common/message_repository.py +287 -0
  375. maibot-1.3.8/src/common/message_server/__init__.py +19 -0
  376. maibot-1.3.8/src/common/message_server/api.py +190 -0
  377. maibot-1.3.8/src/common/message_server/server.py +130 -0
  378. maibot-1.3.8/src/common/operation_timing.py +52 -0
  379. maibot-1.3.8/src/common/paths.py +32 -0
  380. maibot-1.3.8/src/common/process_runner.py +142 -0
  381. maibot-1.3.8/src/common/prompt_i18n.py +416 -0
  382. maibot-1.3.8/src/common/remote.py +288 -0
  383. maibot-1.3.8/src/common/reply_effect_fingerprint.py +119 -0
  384. maibot-1.3.8/src/common/reply_effect_record_codec.py +40 -0
  385. maibot-1.3.8/src/common/runtime_loop.py +31 -0
  386. maibot-1.3.8/src/common/self_update.py +580 -0
  387. maibot-1.3.8/src/common/shutdown.py +55 -0
  388. maibot-1.3.8/src/common/update_notice.py +351 -0
  389. maibot-1.3.8/src/common/utils/image_path.py +39 -0
  390. maibot-1.3.8/src/common/utils/math_utils.py +122 -0
  391. maibot-1.3.8/src/common/utils/port_checker.py +97 -0
  392. maibot-1.3.8/src/common/utils/system_utils.py +11 -0
  393. maibot-1.3.8/src/common/utils/utils_action.py +32 -0
  394. maibot-1.3.8/src/common/utils/utils_config.py +613 -0
  395. maibot-1.3.8/src/common/utils/utils_file.py +56 -0
  396. maibot-1.3.8/src/common/utils/utils_image.py +257 -0
  397. maibot-1.3.8/src/common/utils/utils_message.py +871 -0
  398. maibot-1.3.8/src/common/utils/utils_person.py +55 -0
  399. maibot-1.3.8/src/common/utils/utils_session.py +42 -0
  400. maibot-1.3.8/src/common/utils/utils_voice.py +42 -0
  401. maibot-1.3.8/src/common/version.py +33 -0
  402. maibot-1.3.8/src/config/__init__.py +0 -0
  403. maibot-1.3.8/src/config/config.py +927 -0
  404. maibot-1.3.8/src/config/config_base.py +308 -0
  405. maibot-1.3.8/src/config/config_upgrade_hooks.py +675 -0
  406. maibot-1.3.8/src/config/config_utils.py +166 -0
  407. maibot-1.3.8/src/config/default_model_config.py +131 -0
  408. maibot-1.3.8/src/config/file_watcher.py +238 -0
  409. maibot-1.3.8/src/config/legacy_migration.py +424 -0
  410. maibot-1.3.8/src/config/legacy_upgrade_confirmation.py +225 -0
  411. maibot-1.3.8/src/config/model_configs.py +548 -0
  412. maibot-1.3.8/src/config/official_configs.py +6166 -0
  413. maibot-1.3.8/src/config/startup_bindings.py +201 -0
  414. maibot-1.3.8/src/core/__init__.py +6 -0
  415. maibot-1.3.8/src/core/announcement_manager.py +120 -0
  416. maibot-1.3.8/src/core/config_types.py +273 -0
  417. maibot-1.3.8/src/core/event_bus.py +225 -0
  418. maibot-1.3.8/src/core/local_operator.py +98 -0
  419. maibot-1.3.8/src/core/tooling.py +420 -0
  420. maibot-1.3.8/src/core/types.py +423 -0
  421. maibot-1.3.8/src/emoji_system/emoji_cache_cleanup.py +326 -0
  422. maibot-1.3.8/src/emoji_system/emoji_manager.py +1314 -0
  423. maibot-1.3.8/src/emoji_system/maisaka_tool.py +286 -0
  424. maibot-1.3.8/src/learners/expression_learner.py +927 -0
  425. maibot-1.3.8/src/learners/expression_review_store.py +216 -0
  426. maibot-1.3.8/src/learners/expression_style_utils.py +32 -0
  427. maibot-1.3.8/src/learners/expression_utils.py +299 -0
  428. maibot-1.3.8/src/learners/jargon_learner.py +873 -0
  429. maibot-1.3.8/src/learners/jargon_miner.py +885 -0
  430. maibot-1.3.8/src/learners/weighted_sampling.py +75 -0
  431. maibot-1.3.8/src/llm_models/LICENSE +21 -0
  432. maibot-1.3.8/src/llm_models/__init__.py +0 -0
  433. maibot-1.3.8/src/llm_models/exceptions.py +140 -0
  434. maibot-1.3.8/src/llm_models/generation_diagnostics.py +155 -0
  435. maibot-1.3.8/src/llm_models/image_normalizer.py +128 -0
  436. maibot-1.3.8/src/llm_models/model_client/__init__.py +29 -0
  437. maibot-1.3.8/src/llm_models/model_client/adapter_base.py +362 -0
  438. maibot-1.3.8/src/llm_models/model_client/base_client.py +678 -0
  439. maibot-1.3.8/src/llm_models/model_client/embedding_rate_limit.py +55 -0
  440. maibot-1.3.8/src/llm_models/model_client/gemini_client.py +1379 -0
  441. maibot-1.3.8/src/llm_models/model_client/image_embedding_protocols.py +397 -0
  442. maibot-1.3.8/src/llm_models/model_client/openai_client.py +2200 -0
  443. maibot-1.3.8/src/llm_models/model_client/openai_responses_client.py +817 -0
  444. maibot-1.3.8/src/llm_models/model_client/plugin_client.py +307 -0
  445. maibot-1.3.8/src/llm_models/openai_compat.py +165 -0
  446. maibot-1.3.8/src/llm_models/payload_content/__init__.py +51 -0
  447. maibot-1.3.8/src/llm_models/payload_content/context_item.py +699 -0
  448. maibot-1.3.8/src/llm_models/payload_content/context_protocol.py +243 -0
  449. maibot-1.3.8/src/llm_models/payload_content/native_tool.py +18 -0
  450. maibot-1.3.8/src/llm_models/payload_content/resp_format.py +239 -0
  451. maibot-1.3.8/src/llm_models/payload_content/tool_option.py +547 -0
  452. maibot-1.3.8/src/llm_models/request_snapshot.py +1311 -0
  453. maibot-1.3.8/src/llm_models/utils.py +276 -0
  454. maibot-1.3.8/src/llm_models/utils_model.py +1604 -0
  455. maibot-1.3.8/src/main.py +300 -0
  456. maibot-1.3.8/src/maisaka/attention_drift.py +116 -0
  457. maibot-1.3.8/src/maisaka/builtin_tool/__init__.py +236 -0
  458. maibot-1.3.8/src/maisaka/builtin_tool/context.py +530 -0
  459. maibot-1.3.8/src/maisaka/builtin_tool/fetch_history.py +62 -0
  460. maibot-1.3.8/src/maisaka/builtin_tool/provider.py +74 -0
  461. maibot-1.3.8/src/maisaka/builtin_tool/query_image_memory.py +103 -0
  462. maibot-1.3.8/src/maisaka/builtin_tool/query_memory.py +335 -0
  463. maibot-1.3.8/src/maisaka/builtin_tool/query_person_profile.py +152 -0
  464. maibot-1.3.8/src/maisaka/builtin_tool/read_tool_result.py +142 -0
  465. maibot-1.3.8/src/maisaka/builtin_tool/reply.py +695 -0
  466. maibot-1.3.8/src/maisaka/builtin_tool/send_emoji.py +543 -0
  467. maibot-1.3.8/src/maisaka/builtin_tool/show_emoji_list.py +76 -0
  468. maibot-1.3.8/src/maisaka/builtin_tool/subagent.py +549 -0
  469. maibot-1.3.8/src/maisaka/builtin_tool/switch_chat.py +78 -0
  470. maibot-1.3.8/src/maisaka/builtin_tool/tool_search.py +92 -0
  471. maibot-1.3.8/src/maisaka/builtin_tool/view_forward_message.py +153 -0
  472. maibot-1.3.8/src/maisaka/builtin_tool/wait.py +77 -0
  473. maibot-1.3.8/src/maisaka/chat_loop_service.py +1579 -0
  474. maibot-1.3.8/src/maisaka/context/__init__.py +1 -0
  475. maibot-1.3.8/src/maisaka/context/clear_context.py +42 -0
  476. maibot-1.3.8/src/maisaka/context/emoji_candidates.py +36 -0
  477. maibot-1.3.8/src/maisaka/context/history.py +384 -0
  478. maibot-1.3.8/src/maisaka/context/image_attachment.py +52 -0
  479. maibot-1.3.8/src/maisaka/context/message_adapter.py +126 -0
  480. maibot-1.3.8/src/maisaka/context/message_id_alias.py +52 -0
  481. maibot-1.3.8/src/maisaka/context/messages.py +825 -0
  482. maibot-1.3.8/src/maisaka/context/planner_messages.py +199 -0
  483. maibot-1.3.8/src/maisaka/context/post_processor.py +204 -0
  484. maibot-1.3.8/src/maisaka/context/usage.py +141 -0
  485. maibot-1.3.8/src/maisaka/display/__init__.py +25 -0
  486. maibot-1.3.8/src/maisaka/display/display_utils.py +144 -0
  487. maibot-1.3.8/src/maisaka/display/preview_path_utils.py +64 -0
  488. maibot-1.3.8/src/maisaka/display/prompt_cli_renderer.py +1110 -0
  489. maibot-1.3.8/src/maisaka/display/prompt_preview_logger.py +603 -0
  490. maibot-1.3.8/src/maisaka/display/runtime_mixin.py +709 -0
  491. maibot-1.3.8/src/maisaka/display/stage_status_board.py +129 -0
  492. maibot-1.3.8/src/maisaka/focus/__init__.py +10 -0
  493. maibot-1.3.8/src/maisaka/focus/manager.py +442 -0
  494. maibot-1.3.8/src/maisaka/focus/runtime_mixin.py +753 -0
  495. maibot-1.3.8/src/maisaka/jargon_context_matcher.py +363 -0
  496. maibot-1.3.8/src/maisaka/memory/__init__.py +1 -0
  497. maibot-1.3.8/src/maisaka/memory/heuristic_injector.py +393 -0
  498. maibot-1.3.8/src/maisaka/memory/image_injector.py +81 -0
  499. maibot-1.3.8/src/maisaka/memory/mid_term.py +995 -0
  500. maibot-1.3.8/src/maisaka/memory/person_profile.py +280 -0
  501. maibot-1.3.8/src/maisaka/mode_policy.py +28 -0
  502. maibot-1.3.8/src/maisaka/monitor/__init__.py +1 -0
  503. maibot-1.3.8/src/maisaka/monitor/event_store.py +351 -0
  504. maibot-1.3.8/src/maisaka/monitor/events.py +795 -0
  505. maibot-1.3.8/src/maisaka/monitor/message_payload.py +172 -0
  506. maibot-1.3.8/src/maisaka/monitor/planner_delta.py +77 -0
  507. maibot-1.3.8/src/maisaka/monitor/tool_media.py +58 -0
  508. maibot-1.3.8/src/maisaka/planner_reply_guard.py +69 -0
  509. maibot-1.3.8/src/maisaka/reasoning_engine.py +2186 -0
  510. maibot-1.3.8/src/maisaka/reply_effect/__init__.py +18 -0
  511. maibot-1.3.8/src/maisaka/reply_effect/image_utils.py +100 -0
  512. maibot-1.3.8/src/maisaka/reply_effect/judge.py +382 -0
  513. maibot-1.3.8/src/maisaka/reply_effect/models.py +185 -0
  514. maibot-1.3.8/src/maisaka/reply_effect/path_utils.py +24 -0
  515. maibot-1.3.8/src/maisaka/reply_effect/quote_utils.py +32 -0
  516. maibot-1.3.8/src/maisaka/reply_effect/scoring.py +205 -0
  517. maibot-1.3.8/src/maisaka/reply_effect/storage.py +380 -0
  518. maibot-1.3.8/src/maisaka/reply_effect/tracker.py +568 -0
  519. maibot-1.3.8/src/maisaka/runtime.py +2218 -0
  520. maibot-1.3.8/src/maisaka/subagent_tasks.py +171 -0
  521. maibot-1.3.8/src/maisaka/tool_result_condenser.py +143 -0
  522. maibot-1.3.8/src/maisaka/tool_result_store.py +57 -0
  523. maibot-1.3.8/src/maisaka/turn_trigger/__init__.py +9 -0
  524. maibot-1.3.8/src/maisaka/turn_trigger/dynamic_gate.py +211 -0
  525. maibot-1.3.8/src/maisaka/turn_trigger/gates.py +252 -0
  526. maibot-1.3.8/src/maisaka/turn_trigger/idle_backoff.py +93 -0
  527. maibot-1.3.8/src/maisaka/turn_trigger/reply_likelihood.py +88 -0
  528. maibot-1.3.8/src/maisaka/turn_trigger/scheduler.py +113 -0
  529. maibot-1.3.8/src/maisaka/utils/__init__.py +1 -0
  530. maibot-1.3.8/src/maisaka/utils/tool_post_execution.py +76 -0
  531. maibot-1.3.8/src/maisaka/utils/tool_record_payload.py +155 -0
  532. maibot-1.3.8/src/maisaka/visual/__init__.py +1 -0
  533. maibot-1.3.8/src/maisaka/visual/chat_history_refresher.py +303 -0
  534. maibot-1.3.8/src/maisaka/visual/message_limiter.py +69 -0
  535. maibot-1.3.8/src/maisaka/visual/mode_utils.py +33 -0
  536. maibot-1.3.8/src/manager/async_task_manager.py +193 -0
  537. maibot-1.3.8/src/manager/local_store_manager.py +126 -0
  538. maibot-1.3.8/src/mcp_module/__init__.py +9 -0
  539. maibot-1.3.8/src/mcp_module/config.py +174 -0
  540. maibot-1.3.8/src/mcp_module/connection.py +726 -0
  541. maibot-1.3.8/src/mcp_module/hooks.py +20 -0
  542. maibot-1.3.8/src/mcp_module/host_llm_bridge.py +654 -0
  543. maibot-1.3.8/src/mcp_module/manager.py +680 -0
  544. maibot-1.3.8/src/mcp_module/models.py +437 -0
  545. maibot-1.3.8/src/mcp_module/provider.py +62 -0
  546. maibot-1.3.8/src/mcp_module/service.py +308 -0
  547. maibot-1.3.8/src/mcp_module/stdio_filter.py +177 -0
  548. maibot-1.3.8/src/person_info/__init__.py +0 -0
  549. maibot-1.3.8/src/person_info/person_info.py +600 -0
  550. maibot-1.3.8/src/platform_io/__init__.py +39 -0
  551. maibot-1.3.8/src/platform_io/adapter_policy.py +839 -0
  552. maibot-1.3.8/src/platform_io/avatar.py +197 -0
  553. maibot-1.3.8/src/platform_io/dedupe.py +133 -0
  554. maibot-1.3.8/src/platform_io/drivers/__init__.py +11 -0
  555. maibot-1.3.8/src/platform_io/drivers/base.py +104 -0
  556. maibot-1.3.8/src/platform_io/drivers/legacy_driver.py +92 -0
  557. maibot-1.3.8/src/platform_io/drivers/plugin_driver.py +213 -0
  558. maibot-1.3.8/src/platform_io/manager.py +716 -0
  559. maibot-1.3.8/src/platform_io/outbound_tracker.py +286 -0
  560. maibot-1.3.8/src/platform_io/registry.py +70 -0
  561. maibot-1.3.8/src/platform_io/route_key_factory.py +174 -0
  562. maibot-1.3.8/src/platform_io/routing.py +141 -0
  563. maibot-1.3.8/src/platform_io/types.py +265 -0
  564. maibot-1.3.8/src/plugin_runtime/__init__.py +60 -0
  565. maibot-1.3.8/src/plugin_runtime/avatar_provider.py +64 -0
  566. maibot-1.3.8/src/plugin_runtime/capabilities/__init__.py +11 -0
  567. maibot-1.3.8/src/plugin_runtime/capabilities/components.py +977 -0
  568. maibot-1.3.8/src/plugin_runtime/capabilities/core.py +868 -0
  569. maibot-1.3.8/src/plugin_runtime/capabilities/data.py +1415 -0
  570. maibot-1.3.8/src/plugin_runtime/capabilities/registry.py +116 -0
  571. maibot-1.3.8/src/plugin_runtime/capabilities/render.py +131 -0
  572. maibot-1.3.8/src/plugin_runtime/compat_policy.py +47 -0
  573. maibot-1.3.8/src/plugin_runtime/component_query.py +1119 -0
  574. maibot-1.3.8/src/plugin_runtime/dependency_pipeline.py +547 -0
  575. maibot-1.3.8/src/plugin_runtime/docker_layout_migration.py +275 -0
  576. maibot-1.3.8/src/plugin_runtime/hook_catalog.py +52 -0
  577. maibot-1.3.8/src/plugin_runtime/hook_payloads.py +197 -0
  578. maibot-1.3.8/src/plugin_runtime/hook_schema_utils.py +31 -0
  579. maibot-1.3.8/src/plugin_runtime/host/__init__.py +1 -0
  580. maibot-1.3.8/src/plugin_runtime/host/api_registry.py +353 -0
  581. maibot-1.3.8/src/plugin_runtime/host/authorization.py +67 -0
  582. maibot-1.3.8/src/plugin_runtime/host/capability_service.py +91 -0
  583. maibot-1.3.8/src/plugin_runtime/host/circuit_breaker.py +243 -0
  584. maibot-1.3.8/src/plugin_runtime/host/component_registry.py +1336 -0
  585. maibot-1.3.8/src/plugin_runtime/host/component_timeout.py +32 -0
  586. maibot-1.3.8/src/plugin_runtime/host/event_dispatcher.py +228 -0
  587. maibot-1.3.8/src/plugin_runtime/host/hook_dispatcher.py +711 -0
  588. maibot-1.3.8/src/plugin_runtime/host/hook_spec_registry.py +190 -0
  589. maibot-1.3.8/src/plugin_runtime/host/logger_bridge.py +64 -0
  590. maibot-1.3.8/src/plugin_runtime/host/message_gateway.py +116 -0
  591. maibot-1.3.8/src/plugin_runtime/host/message_utils.py +572 -0
  592. maibot-1.3.8/src/plugin_runtime/host/reply_extension_schema.py +65 -0
  593. maibot-1.3.8/src/plugin_runtime/host/reply_extensions.py +204 -0
  594. maibot-1.3.8/src/plugin_runtime/host/rpc_server.py +509 -0
  595. maibot-1.3.8/src/plugin_runtime/host/supervisor.py +2269 -0
  596. maibot-1.3.8/src/plugin_runtime/integration.py +2063 -0
  597. maibot-1.3.8/src/plugin_runtime/local_sdk.py +147 -0
  598. maibot-1.3.8/src/plugin_runtime/protocol/__init__.py +1 -0
  599. maibot-1.3.8/src/plugin_runtime/protocol/codec.py +71 -0
  600. maibot-1.3.8/src/plugin_runtime/protocol/envelope.py +600 -0
  601. maibot-1.3.8/src/plugin_runtime/protocol/errors.py +77 -0
  602. maibot-1.3.8/src/plugin_runtime/runner/__init__.py +1 -0
  603. maibot-1.3.8/src/plugin_runtime/runner/log_handler.py +239 -0
  604. maibot-1.3.8/src/plugin_runtime/runner/manifest_validator.py +1517 -0
  605. maibot-1.3.8/src/plugin_runtime/runner/plugin_loader.py +711 -0
  606. maibot-1.3.8/src/plugin_runtime/runner/plugin_paths.py +59 -0
  607. maibot-1.3.8/src/plugin_runtime/runner/rpc_client.py +336 -0
  608. maibot-1.3.8/src/plugin_runtime/runner/runner_main.py +2670 -0
  609. maibot-1.3.8/src/plugin_runtime/tool_provider.py +58 -0
  610. maibot-1.3.8/src/plugin_runtime/transport/__init__.py +1 -0
  611. maibot-1.3.8/src/plugin_runtime/transport/base.py +116 -0
  612. maibot-1.3.8/src/plugin_runtime/transport/factory.py +57 -0
  613. maibot-1.3.8/src/plugin_runtime/transport/named_pipe.py +206 -0
  614. maibot-1.3.8/src/plugin_runtime/transport/tcp.py +62 -0
  615. maibot-1.3.8/src/plugin_runtime/transport/uds.py +133 -0
  616. maibot-1.3.8/src/plugin_runtime/update_compatibility_notice.py +303 -0
  617. maibot-1.3.8/src/plugin_runtime/upload_store.py +173 -0
  618. maibot-1.3.8/src/plugin_runtime/webui_schema.py +571 -0
  619. maibot-1.3.8/src/plugins/__init__.py +1 -0
  620. maibot-1.3.8/src/plugins/built_in/plugin_management/_manifest.json +48 -0
  621. maibot-1.3.8/src/plugins/built_in/plugin_management/plugin.py +665 -0
  622. maibot-1.3.8/src/prompt/prompt_manager.py +440 -0
  623. maibot-1.3.8/src/runtime.py +688 -0
  624. maibot-1.3.8/src/services/__init__.py +7 -0
  625. maibot-1.3.8/src/services/bot_account_service.py +327 -0
  626. maibot-1.3.8/src/services/database_service.py +203 -0
  627. maibot-1.3.8/src/services/embedding_service.py +271 -0
  628. maibot-1.3.8/src/services/expression_vector_service.py +106 -0
  629. maibot-1.3.8/src/services/html_render_service.py +945 -0
  630. maibot-1.3.8/src/services/image_path_maintenance_service.py +454 -0
  631. maibot-1.3.8/src/services/image_writeback_journal.py +98 -0
  632. maibot-1.3.8/src/services/llm_cache_stats.py +1521 -0
  633. maibot-1.3.8/src/services/llm_service.py +799 -0
  634. maibot-1.3.8/src/services/memory_flow_service.py +1019 -0
  635. maibot-1.3.8/src/services/memory_service.py +528 -0
  636. maibot-1.3.8/src/services/message_service.py +295 -0
  637. maibot-1.3.8/src/services/message_word_frequency_service.py +595 -0
  638. maibot-1.3.8/src/services/news_service.py +123 -0
  639. maibot-1.3.8/src/services/person_fact_reverification.py +90 -0
  640. maibot-1.3.8/src/services/person_fact_verifier.py +79 -0
  641. maibot-1.3.8/src/services/send_service.py +1483 -0
  642. maibot-1.3.8/src/services/service_task_resolver.py +59 -0
  643. maibot-1.3.8/src/services/statistics_aggregation_service.py +349 -0
  644. maibot-1.3.8/src/services/statistics_service.py +850 -0
  645. maibot-1.3.8/src/services/telemetry_stats_service.py +294 -0
  646. maibot-1.3.8/src/services/tool_record_cleanup_service.py +205 -0
  647. maibot-1.3.8/src/webui/app.py +374 -0
  648. maibot-1.3.8/src/webui/config_schema.py +481 -0
  649. maibot-1.3.8/src/webui/core/__init__.py +32 -0
  650. maibot-1.3.8/src/webui/core/auth.py +153 -0
  651. maibot-1.3.8/src/webui/core/rate_limiter.py +247 -0
  652. maibot-1.3.8/src/webui/core/security.py +361 -0
  653. maibot-1.3.8/src/webui/dependencies.py +70 -0
  654. maibot-1.3.8/src/webui/logs_ws.py +195 -0
  655. maibot-1.3.8/src/webui/middleware/__init__.py +17 -0
  656. maibot-1.3.8/src/webui/middleware/anti_crawler.py +824 -0
  657. maibot-1.3.8/src/webui/middleware/compression.py +88 -0
  658. maibot-1.3.8/src/webui/routers/__init__.py +33 -0
  659. maibot-1.3.8/src/webui/routers/avatar.py +250 -0
  660. maibot-1.3.8/src/webui/routers/bot_accounts.py +103 -0
  661. maibot-1.3.8/src/webui/routers/chat/__init__.py +18 -0
  662. maibot-1.3.8/src/webui/routers/chat/routes.py +1715 -0
  663. maibot-1.3.8/src/webui/routers/chat/serializers.py +248 -0
  664. maibot-1.3.8/src/webui/routers/chat/service.py +1489 -0
  665. maibot-1.3.8/src/webui/routers/config.py +1964 -0
  666. maibot-1.3.8/src/webui/routers/data_transfer.py +769 -0
  667. maibot-1.3.8/src/webui/routers/emoji/__init__.py +3 -0
  668. maibot-1.3.8/src/webui/routers/emoji/routes.py +1230 -0
  669. maibot-1.3.8/src/webui/routers/emoji/schemas.py +182 -0
  670. maibot-1.3.8/src/webui/routers/emoji/support.py +143 -0
  671. maibot-1.3.8/src/webui/routers/expression.py +2298 -0
  672. maibot-1.3.8/src/webui/routers/jargon.py +1319 -0
  673. maibot-1.3.8/src/webui/routers/mcp.py +99 -0
  674. maibot-1.3.8/src/webui/routers/memory.py +5589 -0
  675. maibot-1.3.8/src/webui/routers/model.py +910 -0
  676. maibot-1.3.8/src/webui/routers/news.py +23 -0
  677. maibot-1.3.8/src/webui/routers/person.py +427 -0
  678. maibot-1.3.8/src/webui/routers/plugin/__init__.py +31 -0
  679. maibot-1.3.8/src/webui/routers/plugin/catalog.py +218 -0
  680. maibot-1.3.8/src/webui/routers/plugin/config_routes.py +592 -0
  681. maibot-1.3.8/src/webui/routers/plugin/icon_routes.py +71 -0
  682. maibot-1.3.8/src/webui/routers/plugin/management.py +908 -0
  683. maibot-1.3.8/src/webui/routers/plugin/marketplace.py +116 -0
  684. maibot-1.3.8/src/webui/routers/plugin/progress.py +172 -0
  685. maibot-1.3.8/src/webui/routers/plugin/release_install.py +313 -0
  686. maibot-1.3.8/src/webui/routers/plugin/releases.py +181 -0
  687. maibot-1.3.8/src/webui/routers/plugin/runtime_routes.py +243 -0
  688. maibot-1.3.8/src/webui/routers/plugin/schemas.py +131 -0
  689. maibot-1.3.8/src/webui/routers/plugin/stats_proxy.py +127 -0
  690. maibot-1.3.8/src/webui/routers/plugin/support.py +366 -0
  691. maibot-1.3.8/src/webui/routers/plugin/webui_extensions.py +346 -0
  692. maibot-1.3.8/src/webui/routers/plugin/zip_install.py +125 -0
  693. maibot-1.3.8/src/webui/routers/reasoning_process.py +2326 -0
  694. maibot-1.3.8/src/webui/routers/reply_effects.py +926 -0
  695. maibot-1.3.8/src/webui/routers/search.py +249 -0
  696. maibot-1.3.8/src/webui/routers/self_update.py +194 -0
  697. maibot-1.3.8/src/webui/routers/statistics.py +61 -0
  698. maibot-1.3.8/src/webui/routers/system.py +1790 -0
  699. maibot-1.3.8/src/webui/routers/user_emoji.py +168 -0
  700. maibot-1.3.8/src/webui/routers/websocket/__init__.py +7 -0
  701. maibot-1.3.8/src/webui/routers/websocket/auth.py +104 -0
  702. maibot-1.3.8/src/webui/routers/websocket/manager.py +373 -0
  703. maibot-1.3.8/src/webui/routers/websocket/plugin_runtime.py +54 -0
  704. maibot-1.3.8/src/webui/routers/websocket/unified.py +761 -0
  705. maibot-1.3.8/src/webui/routes.py +416 -0
  706. maibot-1.3.8/src/webui/schemas/__init__.py +18 -0
  707. maibot-1.3.8/src/webui/schemas/news.py +24 -0
  708. maibot-1.3.8/src/webui/schemas/statistics.py +173 -0
  709. maibot-1.3.8/src/webui/services/__init__.py +1 -0
  710. maibot-1.3.8/src/webui/services/ai_search_agent.py +509 -0
  711. maibot-1.3.8/src/webui/services/ai_search_documents.py +329 -0
  712. maibot-1.3.8/src/webui/services/ai_search_grounding.py +103 -0
  713. maibot-1.3.8/src/webui/services/ai_search_local_config.py +129 -0
  714. maibot-1.3.8/src/webui/services/ai_search_models.py +98 -0
  715. maibot-1.3.8/src/webui/services/git_mirror_service.py +1024 -0
  716. maibot-1.3.8/src/webui/services/plugin_market_service.py +56 -0
  717. maibot-1.3.8/src/webui/utils/__init__.py +1 -0
  718. maibot-1.3.8/src/webui/utils/http_client.py +27 -0
  719. maibot-1.3.8/src/webui/utils/network_security.py +133 -0
  720. maibot-1.3.8/src/webui/utils/toml_utils.py +124 -0
  721. maibot-1.3.8/src/webui/version_compatibility.py +180 -0
  722. maibot-1.3.8/src/webui/webui_server.py +422 -0
maibot-1.3.8/EULA.md ADDED
@@ -0,0 +1,135 @@
1
+ # **MaiBot最终用户许可协议**
2
+
3
+ **版本:V1.3**
4
+ **更新日期:2026年05月30日**
5
+ **生效日期:2026年05月30日**
6
+ **适用的MaiBot版本号:所有版本**
7
+
8
+ **2025© MaiBot项目团队**
9
+
10
+ ---
11
+
12
+ ## 一、一般条款
13
+
14
+ **1.1** MaiBot项目(包括MaiBot的源代码、可执行文件、文档,以及其它在本协议中所列出的文件)(以下简称“本项目”)是由开发者及贡献者(以下简称“项目团队”)共同维护,为用户提供自动回复功能的机器人代码项目。以下最终用户许可协议(EULA,以下简称“本协议”)是用户(以下简称“您”)与项目团队之间关于使用本项目所订立的合同条件。
15
+
16
+ **1.2** 在运行或使用本项目之前,您**必须阅读并同意本协议的所有条款**。未成年人或其它无/不完全民事行为能力责任人请**在监护人的陪同下**阅读并同意本协议。如果您不同意,则不得运行或使用本项目。在这种情况下,您应立即从您的设备上卸载或删除本项目及其所有副本。
17
+
18
+ ## 二、许可授权
19
+
20
+ ### 源代码许可
21
+
22
+ **2.1** 您**了解**除本项目子目录、第三方组件或随附文件另有许可证声明的部分外,本项目主程序源代码基于GPLv3(GNU通用公共许可证第三版)开源协议发布。您**可以自由使用、修改、分发**相应源代码,但**必须遵守**对应开源许可证的要求。详细内容请参阅项目仓库中的LICENSE文件、相关子目录内的LICENSE文件及其它许可证声明文件。
23
+
24
+ **2.2** 您**了解**本项目可能包含独立子项目、第三方开源代码或经额外授权纳入本项目的代码;这些内容的许可证可能与GPLv3许可证不同,或存在特定适用范围。您**同意**在使用、修改、分发这些内容时**遵守**相应的许可证要求。
25
+
26
+ ### 输入输出内容授权
27
+
28
+ **2.3** 您**了解**本项目是使用您的配置信息、提交的指令(以下简称“输入内容”)和生成的内容(以下简称“输出内容”)构建请求发送到第三方生成回复的机器人项目。
29
+ **2.4** 您**授权**本项目使用您的输入和输出内容按照项目的隐私政策用于以下行为:
30
+
31
+ - 调用第三方API生成回复;
32
+ - 调用第三方API用于构建本项目专用的存储于您使用的数据库中的知识库和记忆库;
33
+ - 调用第三方开发的插件系统功能;
34
+ - 收集并记录本项目专用的存储于您使用的设备中的日志;
35
+ - 在遥测功能启用时,向项目团队的遥测服务发送有限的运行状态与使用统计数据,用于版本分布、稳定性分析、容量规划和功能改进。遥测数据的具体范围、关闭方式、保存期限和处理规则以本项目隐私条款为准。
36
+
37
+ **2.5** 您**了解**本项目的源代码中包含第三方API的调用代码,这些API的使用可能受到第三方的服务条款和隐私政策的约束。在使用这些API时,您**必须遵守**相应的服务条款。
38
+
39
+ **2.6** 项目团队**不对**第三方API的服务质量、稳定性、准确性、安全性负责,亦**不对**第三方API的服务变更、终止、限制等行为负责。
40
+
41
+ ## 三、用户行为
42
+
43
+ **3.1** 您**了解**本项目会将您的配置信息、输入指令和生成内容发送到第三方,您**不应**在输入指令和生成内容中包含以下内容:
44
+
45
+ - 涉及任何国家或地区秘密、商业秘密或其他可能会对国家或地区安全或者公共利益造成不利影响的数据;
46
+ - 涉及个人隐私、个人信息或其他敏感信息的数据;
47
+ - 任何侵犯他人合法权益的内容;
48
+ - 任何违反国家或地区法律法规、政策规定的内容;
49
+
50
+ **3.2** 您**不应**将本项目用于以下用途:
51
+
52
+ - 违反任何国家或地区法律法规、政策规定的行为;
53
+
54
+ **3.3** 您**应当**自行确保您被存储在本项目的知识库、记忆库和日志中的输入和输出内容的合法性与合规性以及存储行为的合法性与合规性。您需**自行承担**由此产生的任何法律责任。
55
+
56
+ **3.4** 对于第三方插件的使用,您**不应**:
57
+
58
+ - 安装、使用任何来源不明或未经验证的第三方插件;
59
+ - 使用任何违反法律法规、政策规定或第三方平台规则的第三方插件;
60
+
61
+ **3.5** 您**应当**自行确保您安装和使用的第三方插件的合法性与合规性以及安装和使用行为的合法性与合规性。您需**自行承担**由此产生的任何法律责任。
62
+
63
+ **3.6** 由于本项目会将您的输入指令和生成内容发送到第三方,当您将本项目用于第三方交流环境(如与除您以外的人私聊、群聊、论坛、直播等)时,您**应当**事先明确告知其他交流参与者本项目的使用情况,包括但不限于:
64
+
65
+ - 本项目的输出内容是由人工智能生成的;
66
+ - 本项目会将交流内容发送到第三方;
67
+ - 本项目的隐私政策和用户行为要求;
68
+
69
+ 您需**自行承担**由此产生的任何后果和法律责任。
70
+
71
+ **3.7** 项目团队**不鼓励**也**不支持**将本项目用于商业用途,但若您确实需要将本项目用于商业用途,您**应当**标明项目地址(如“本项目由MaiBot(<https://github.com/Mai-with-u/MaiBot>)驱动”),并**自行承担**由此产生的任何法律责任。
72
+
73
+ ## 四、免责条款
74
+
75
+ **4.1** 本项目的输出内容依赖第三方API,**不受**项目团队控制,亦**不代表**项目团队的观点。
76
+
77
+ **4.2** 除本协议条目2.4提到的隐私政策之外,项目团队**不会**对您提供任何形式的担保,亦**不对**使用本项目的造成的任何直接或间接后果负责。
78
+
79
+ **4.3** 关于第三方插件,项目团队**声明**:
80
+
81
+ - 项目团队**不对**任何第三方插件的功能、安全性、稳定性、合规性或适用性提供任何形式的保证或担保;
82
+ - 项目团队**不对**因使用第三方插件而产生的任何直接或间接后果承担责任;
83
+ - 项目团队**不对**第三方插件的质量问题、技术支持、bug修复等事宜负责。如有相关问题,应**直接联系插件开发者**;
84
+
85
+ ## 五、其他条款
86
+
87
+ **5.1** 项目团队有权**随时修改本协议的条款**,但**无义务**通知您。修改后的协议将在本项目的新版本中推送,您应定期检查本协议的最新版本。
88
+
89
+ **5.2** 项目团队**保留**本协议的最终解释权。
90
+
91
+ ## 附录:其他重要须知
92
+
93
+ ### 一、风险提示
94
+
95
+ **附录1.1** 隐私安全风险
96
+
97
+ - 本项目会将您的配置信息、输入指令和生成内容发送到第三方API,而这些API的服务质量、稳定性、准确性、安全性不受项目团队控制。
98
+ - 本项目会收集您的输入和输出内容,用于构建本项目专用的知识库和记忆库,以提高回复的准确性和连贯性。
99
+
100
+ **因此,为了保障您的隐私信息安全,请注意以下事项:**
101
+
102
+ - 避免在涉及个人隐私、个人信息或其他敏感信息的环境中使用本项目;
103
+ - 避免在不可信的环境中使用本项目;
104
+
105
+ **附录1.2** 精神健康风险
106
+
107
+ 本项目仅为工具型机器人,不具备情感交互能力。建议用户:
108
+
109
+ - 避免过度依赖AI回复处理现实问题或情绪困扰;
110
+ - 如感到心理不适,请及时寻求专业心理咨询服务;
111
+ - 如遇心理困扰,请寻求专业帮助(全国心理援助热线:12355);
112
+
113
+ **附录1.3** 第三方插件风险
114
+
115
+ 本项目的插件系统允许加载第三方开发的插件,这可能带来以下风险:
116
+
117
+ - **安全风险**:第三方插件可能包含恶意代码、安全漏洞或未知的安全威胁;
118
+ - **稳定性风险**:插件可能导致系统崩溃、性能下降或功能异常;
119
+ - **隐私风险**:插件可能收集、传输或泄露您的个人信息和数据;
120
+ - **合规风险**:插件的功能或行为可能违反相关法律法规或平台规则;
121
+ - **兼容性风险**:插件可能与主程序或其他插件产生冲突;
122
+
123
+ **因此,在使用第三方插件时,请务必:**
124
+
125
+ - 仅从可信来源获取和安装插件;
126
+ - 在安装前仔细了解插件的功能、权限和开发者信息;
127
+ - 定期检查和更新已安装的插件;
128
+ - 如发现插件异常行为,请立即停止使用并卸载;
129
+
130
+ ### 二、其他
131
+
132
+ **附录2.1** 争议解决
133
+
134
+ - 本协议适用中国法律,争议提交相关地区法院管辖;
135
+ - 若因GPLv3许可产生纠纷,以许可证官方解释为准。