AstrBot 3.5.26__tar.gz → 4.0.0b2__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 (519) hide show
  1. {astrbot-3.5.26 → astrbot-4.0.0b2}/PKG-INFO +4 -1
  2. astrbot-4.0.0b2/astrbot/api/__init__.py +20 -0
  3. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/__init__.py +1 -2
  4. astrbot-4.0.0b2/astrbot/core/agent/agent.py +13 -0
  5. astrbot-4.0.0b2/astrbot/core/agent/handoff.py +34 -0
  6. astrbot-4.0.0b2/astrbot/core/agent/hooks.py +27 -0
  7. astrbot-4.0.0b2/astrbot/core/agent/mcp_client.py +208 -0
  8. astrbot-4.0.0b2/astrbot/core/agent/response.py +12 -0
  9. astrbot-4.0.0b2/astrbot/core/agent/run_context.py +17 -0
  10. astrbot-4.0.0b2/astrbot/core/agent/runners/__init__.py +3 -0
  11. {astrbot-3.5.26/astrbot/core/pipeline/process_stage/agent_runner → astrbot-4.0.0b2/astrbot/core/agent/runners}/base.py +20 -19
  12. astrbot-3.5.26/astrbot/core/pipeline/process_stage/agent_runner/tool_loop_agent.py → astrbot-4.0.0b2/astrbot/core/agent/runners/tool_loop_agent_runner.py +126 -98
  13. astrbot-4.0.0b2/astrbot/core/agent/tool.py +256 -0
  14. astrbot-4.0.0b2/astrbot/core/agent/tool_executor.py +11 -0
  15. astrbot-4.0.0b2/astrbot/core/astr_agent_context.py +11 -0
  16. astrbot-4.0.0b2/astrbot/core/astrbot_config_mgr.py +276 -0
  17. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/default.py +598 -239
  18. astrbot-4.0.0b2/astrbot/core/conversation_mgr.py +297 -0
  19. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/core_lifecycle.py +66 -9
  20. astrbot-4.0.0b2/astrbot/core/db/__init__.py +284 -0
  21. astrbot-4.0.0b2/astrbot/core/db/migration/helper.py +64 -0
  22. astrbot-4.0.0b2/astrbot/core/db/migration/migra_3_to_4.py +338 -0
  23. astrbot-3.5.26/astrbot/core/utils/shared_preferences.py → astrbot-4.0.0b2/astrbot/core/db/migration/shared_preferences_v3.py +3 -1
  24. astrbot-3.5.26/astrbot/core/db/sqlite.py → astrbot-4.0.0b2/astrbot/core/db/migration/sqlite_v3.py +78 -152
  25. astrbot-4.0.0b2/astrbot/core/db/po.py +244 -0
  26. astrbot-4.0.0b2/astrbot/core/db/sqlite.py +542 -0
  27. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/vec_db.py +28 -5
  28. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/event_bus.py +21 -19
  29. astrbot-4.0.0b2/astrbot/core/persona_mgr.py +183 -0
  30. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/__init__.py +0 -3
  31. astrbot-4.0.0b2/astrbot/core/pipeline/context.py +15 -0
  32. astrbot-4.0.0b2/astrbot/core/pipeline/context_utils.py +98 -0
  33. astrbot-4.0.0b2/astrbot/core/pipeline/process_stage/method/llm_request.py +590 -0
  34. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/process_stage/method/star_request.py +2 -12
  35. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/respond/stage.py +2 -2
  36. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/result_decorate/stage.py +5 -4
  37. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/scheduler.py +9 -8
  38. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/stage.py +3 -3
  39. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/waking_check/stage.py +10 -1
  40. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/astr_message_event.py +15 -17
  41. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/manager.py +3 -0
  42. astrbot-4.0.0b2/astrbot/core/platform/message_session.py +28 -0
  43. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/platform.py +1 -1
  44. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/platform_metadata.py +1 -1
  45. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_adapter.py +1 -1
  46. astrbot-4.0.0b2/astrbot/core/platform_message_history_mgr.py +47 -0
  47. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/entities.py +10 -2
  48. astrbot-4.0.0b2/astrbot/core/provider/func_tool_manager.py +570 -0
  49. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/manager.py +115 -94
  50. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/provider.py +25 -16
  51. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dashscope_source.py +1 -2
  52. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dify_source.py +1 -2
  53. astrbot-4.0.0b2/astrbot/core/provider/sources/vllm_rerank_source.py +59 -0
  54. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/__init__.py +1 -1
  55. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/context.py +73 -78
  56. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/__init__.py +2 -0
  57. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/star_handler.py +67 -5
  58. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/session_llm_manager.py +42 -85
  59. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/session_plugin_manager.py +12 -4
  60. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star.py +0 -24
  61. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_handler.py +17 -33
  62. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_manager.py +33 -51
  63. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/metrics.py +4 -3
  64. astrbot-4.0.0b2/astrbot/core/utils/shared_preferences.py +180 -0
  65. astrbot-4.0.0b2/astrbot/core/utils/t2i/network_strategy.py +135 -0
  66. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/renderer.py +2 -4
  67. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/__init__.py +3 -2
  68. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/chat.py +83 -53
  69. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/config.py +263 -71
  70. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/conversation.py +26 -12
  71. astrbot-4.0.0b2/astrbot/dashboard/routes/persona.py +199 -0
  72. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/plugin.py +0 -105
  73. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/route.py +6 -4
  74. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/session_management.py +35 -199
  75. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/stat.py +5 -1
  76. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/tools.py +65 -65
  77. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/update.py +17 -0
  78. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/server.py +3 -0
  79. astrbot-4.0.0b2/changelogs/v4.0.0-beta.1.md +3 -0
  80. astrbot-4.0.0b2/changelogs/v4.0.0-beta.2.md +1 -0
  81. astrbot-4.0.0b2/dashboard/src/assets/images/astrbot_banner.png +0 -0
  82. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/AstrBotConfig.vue +106 -7
  83. astrbot-4.0.0b2/dashboard/src/components/shared/AstrBotConfigV4.vue +456 -0
  84. astrbot-4.0.0b2/dashboard/src/components/shared/KnowledgeBaseSelector.vue +225 -0
  85. astrbot-4.0.0b2/dashboard/src/components/shared/ListConfigItem.vue +216 -0
  86. astrbot-4.0.0b2/dashboard/src/components/shared/MigrationDialog.vue +275 -0
  87. astrbot-4.0.0b2/dashboard/src/components/shared/PersonaSelector.vue +152 -0
  88. astrbot-4.0.0b2/dashboard/src/components/shared/PluginSetSelector.vue +226 -0
  89. astrbot-4.0.0b2/dashboard/src/components/shared/ProviderSelector.vue +167 -0
  90. astrbot-4.0.0b2/dashboard/src/components/shared/T2ITemplateEditor.vue +307 -0
  91. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/loader.ts +2 -0
  92. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/navigation.json +2 -1
  93. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/knowledge-base.json +36 -18
  94. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/extension.json +0 -15
  95. astrbot-4.0.0b2/dashboard/src/i18n/locales/en-US/features/migration.json +16 -0
  96. astrbot-4.0.0b2/dashboard/src/i18n/locales/en-US/features/persona.json +67 -0
  97. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/provider.json +4 -2
  98. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/settings.json +5 -0
  99. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/tool-use.json +8 -3
  100. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/navigation.json +4 -3
  101. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/knowledge-base.json +37 -19
  102. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/config.json +5 -1
  103. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/extension.json +0 -15
  104. astrbot-4.0.0b2/dashboard/src/i18n/locales/zh-CN/features/migration.json +16 -0
  105. astrbot-4.0.0b2/dashboard/src/i18n/locales/zh-CN/features/persona.json +67 -0
  106. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/provider.json +5 -2
  107. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/settings.json +5 -0
  108. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/tool-use.json +46 -5
  109. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/translations.ts +10 -2
  110. astrbot-4.0.0b2/dashboard/src/layouts/full/FullLayout.vue +59 -0
  111. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-header/VerticalHeader.vue +3 -1
  112. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/VerticalSidebar.vue +1 -2
  113. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/sidebarItem.ts +13 -14
  114. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/MainRoutes.ts +30 -20
  115. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VTextField.scss +4 -14
  116. astrbot-4.0.0b2/dashboard/src/views/AboutPage.vue +40 -0
  117. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ChatPage.vue +69 -57
  118. astrbot-4.0.0b2/dashboard/src/views/ConfigPage.vue +1166 -0
  119. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ExtensionPage.vue +11 -197
  120. astrbot-4.0.0b2/dashboard/src/views/PersonaPage.vue +808 -0
  121. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/PlatformPage.vue +0 -5
  122. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ProviderPage.vue +28 -94
  123. astrbot-4.0.0b2/dashboard/src/views/Settings.vue +61 -0
  124. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ToolUsePage.vue +192 -414
  125. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/KnowledgeBase.vue +541 -94
  126. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/long_term_memory.py +54 -35
  127. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/main.py +112 -112
  128. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/session_controller/main.py +8 -7
  129. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/thinking_filter/main.py +4 -6
  130. astrbot-4.0.0b2/packages/web_searcher/main.py +352 -0
  131. {astrbot-3.5.26 → astrbot-4.0.0b2}/pyproject.toml +4 -1
  132. {astrbot-3.5.26 → astrbot-4.0.0b2}/requirements.txt +4 -1
  133. astrbot-3.5.26/astrbot/api/__init__.py +0 -7
  134. astrbot-3.5.26/astrbot/core/conversation_mgr.py +0 -209
  135. astrbot-3.5.26/astrbot/core/db/__init__.py +0 -161
  136. astrbot-3.5.26/astrbot/core/db/po.py +0 -89
  137. astrbot-3.5.26/astrbot/core/db/sqlite_init.sql +0 -50
  138. astrbot-3.5.26/astrbot/core/pipeline/context.py +0 -113
  139. astrbot-3.5.26/astrbot/core/pipeline/platform_compatibility/stage.py +0 -56
  140. astrbot-3.5.26/astrbot/core/pipeline/process_stage/method/llm_request.py +0 -373
  141. astrbot-3.5.26/astrbot/core/provider/func_tool_manager.py +0 -758
  142. astrbot-3.5.26/astrbot/core/utils/t2i/network_strategy.py +0 -81
  143. astrbot-3.5.26/dashboard/src/assets/images/logo-normal.svg +0 -40
  144. astrbot-3.5.26/dashboard/src/assets/images/logo-waifu.png +0 -0
  145. astrbot-3.5.26/dashboard/src/components/shared/ListConfigItem.vue +0 -135
  146. astrbot-3.5.26/dashboard/src/layouts/full/FullLayout.vue +0 -25
  147. astrbot-3.5.26/dashboard/src/views/AboutPage.vue +0 -244
  148. astrbot-3.5.26/dashboard/src/views/AlkaidPage_sigma.vue +0 -438
  149. astrbot-3.5.26/dashboard/src/views/ConfigPage.vue +0 -280
  150. astrbot-3.5.26/dashboard/src/views/Settings.vue +0 -48
  151. astrbot-3.5.26/packages/web_searcher/main.py +0 -150
  152. astrbot-3.5.26/uv.lock +0 -2748
  153. {astrbot-3.5.26 → astrbot-4.0.0b2}/.dockerignore +0 -0
  154. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/FUNDING.yml +0 -0
  155. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/PLUGIN_PUBLISH.yml +0 -0
  156. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/bug-report.yml +0 -0
  157. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/ISSUE_TEMPLATE/feature-request.yml +0 -0
  158. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  159. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/copilot-instructions.md +0 -0
  160. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/dependabot.yml +0 -0
  161. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/auto_release.yml +0 -0
  162. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/codeql.yml +0 -0
  163. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/coverage_test.yml +0 -0
  164. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/dashboard_ci.yml +0 -0
  165. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/docker-image.yml +0 -0
  166. {astrbot-3.5.26 → astrbot-4.0.0b2}/.github/workflows/stale.yml +0 -0
  167. {astrbot-3.5.26 → astrbot-4.0.0b2}/.gitignore +0 -0
  168. {astrbot-3.5.26 → astrbot-4.0.0b2}/.pre-commit-config.yaml +0 -0
  169. {astrbot-3.5.26 → astrbot-4.0.0b2}/.python-version +0 -0
  170. {astrbot-3.5.26 → astrbot-4.0.0b2}/CODE_OF_CONDUCT.md +0 -0
  171. {astrbot-3.5.26 → astrbot-4.0.0b2}/Dockerfile +0 -0
  172. {astrbot-3.5.26 → astrbot-4.0.0b2}/Dockerfile_with_node +0 -0
  173. {astrbot-3.5.26 → astrbot-4.0.0b2}/LICENSE +0 -0
  174. {astrbot-3.5.26 → astrbot-4.0.0b2}/README.md +0 -0
  175. {astrbot-3.5.26 → astrbot-4.0.0b2}/README_en.md +0 -0
  176. {astrbot-3.5.26 → astrbot-4.0.0b2}/README_ja.md +0 -0
  177. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/__init__.py +0 -0
  178. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/all.py +0 -0
  179. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/event/__init__.py +0 -0
  180. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/event/filter/__init__.py +0 -0
  181. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/message_components.py +0 -0
  182. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/platform/__init__.py +0 -0
  183. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/provider/__init__.py +0 -0
  184. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/star/__init__.py +0 -0
  185. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/api/util/__init__.py +0 -0
  186. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/__init__.py +0 -0
  187. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/__main__.py +0 -0
  188. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/__init__.py +0 -0
  189. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_conf.py +0 -0
  190. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_init.py +0 -0
  191. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_plug.py +0 -0
  192. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/commands/cmd_run.py +0 -0
  193. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/__init__.py +0 -0
  194. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/basic.py +0 -0
  195. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/plugin.py +0 -0
  196. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/cli/utils/version_comparator.py +0 -0
  197. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/__init__.py +0 -0
  198. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/config/astrbot_config.py +0 -0
  199. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/base.py +0 -0
  200. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/__init__.py +0 -0
  201. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/document_storage.py +0 -0
  202. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/embedding_storage.py +0 -0
  203. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/db/vec_db/faiss_impl/sqlite_init.sql +0 -0
  204. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/file_token_service.py +0 -0
  205. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/initial_loader.py +0 -0
  206. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/log.py +0 -0
  207. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/message/components.py +0 -0
  208. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/message/message_event_result.py +0 -0
  209. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/stage.py +0 -0
  210. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/__init__.py +0 -0
  211. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/baidu_aip.py +0 -0
  212. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/keywords.py +0 -0
  213. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/content_safety_check/strategies/strategy.py +0 -0
  214. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/preprocess_stage/stage.py +0 -0
  215. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/process_stage/stage.py +0 -0
  216. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/rate_limit_check/stage.py +0 -0
  217. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/session_status_check/stage.py +0 -0
  218. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/pipeline/whitelist_check/stage.py +0 -0
  219. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/__init__.py +0 -0
  220. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/astrbot_message.py +0 -0
  221. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/message_type.py +0 -0
  222. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/register.py +0 -0
  223. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py +0 -0
  224. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py +0 -0
  225. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py +0 -0
  226. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/dingtalk/dingtalk_event.py +0 -0
  227. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/client.py +0 -0
  228. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/components.py +0 -0
  229. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/discord_platform_adapter.py +0 -0
  230. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/discord/discord_platform_event.py +0 -0
  231. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/lark/lark_adapter.py +0 -0
  232. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/lark/lark_event.py +0 -0
  233. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +0 -0
  234. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py +0 -0
  235. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_adapter.py +0 -0
  236. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_event.py +0 -0
  237. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_server.py +0 -0
  238. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/client.py +0 -0
  239. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/slack_adapter.py +0 -0
  240. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/slack/slack_event.py +0 -0
  241. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/telegram/tg_adapter.py +0 -0
  242. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/telegram/tg_event.py +0 -0
  243. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_event.py +0 -0
  244. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/webchat/webchat_queue_mgr.py +0 -0
  245. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_adapter.py +0 -0
  246. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/wechatpadpro_message_event.py +0 -0
  247. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wechatpadpro/xml_data_parser.py +0 -0
  248. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_adapter.py +0 -0
  249. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_event.py +0 -0
  250. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_kf.py +0 -0
  251. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/wecom/wecom_kf_message.py +0 -0
  252. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/weixin_official_account/weixin_offacc_adapter.py +0 -0
  253. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/platform/sources/weixin_official_account/weixin_offacc_event.py +0 -0
  254. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/__init__.py +0 -0
  255. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/entites.py +0 -0
  256. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/register.py +0 -0
  257. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/anthropic_source.py +0 -0
  258. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/azure_tts_source.py +0 -0
  259. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/dashscope_tts.py +0 -0
  260. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/edge_tts_source.py +0 -0
  261. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/fishaudio_tts_api_source.py +0 -0
  262. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_embedding_source.py +0 -0
  263. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_source.py +0 -0
  264. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gemini_tts_source.py +0 -0
  265. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gsv_selfhosted_source.py +0 -0
  266. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/gsvi_tts_source.py +0 -0
  267. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/minimax_tts_api_source.py +0 -0
  268. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_embedding_source.py +0 -0
  269. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_source.py +0 -0
  270. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/openai_tts_api_source.py +0 -0
  271. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/sensevoice_selfhosted_source.py +0 -0
  272. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/volcengine_tts.py +0 -0
  273. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/whisper_api_source.py +0 -0
  274. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/whisper_selfhosted_source.py +0 -0
  275. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/provider/sources/zhipu_source.py +0 -0
  276. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/README.md +0 -0
  277. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/config.py +0 -0
  278. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/__init__.py +0 -0
  279. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/command.py +0 -0
  280. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/command_group.py +0 -0
  281. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/custom_filter.py +0 -0
  282. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/event_message_type.py +0 -0
  283. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/permission.py +0 -0
  284. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/platform_adapter_type.py +0 -0
  285. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/filter/regex.py +0 -0
  286. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/register/star.py +0 -0
  287. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/star_tools.py +0 -0
  288. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/star/updator.py +0 -0
  289. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/updator.py +0 -0
  290. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/astrbot_path.py +0 -0
  291. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/command_parser.py +0 -0
  292. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/dify_api_client.py +0 -0
  293. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/io.py +0 -0
  294. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/log_pipe.py +0 -0
  295. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/path_util.py +0 -0
  296. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/pip_installer.py +0 -0
  297. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/session_lock.py +0 -0
  298. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/session_waiter.py +0 -0
  299. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/__init__.py +0 -0
  300. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/local_strategy.py +0 -0
  301. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/t2i/template/base.html +0 -0
  302. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/tencent_record_helper.py +0 -0
  303. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/utils/version_comparator.py +0 -0
  304. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/core/zip_updator.py +0 -0
  305. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/auth.py +0 -0
  306. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/file.py +0 -0
  307. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/log.py +0 -0
  308. {astrbot-3.5.26 → astrbot-4.0.0b2}/astrbot/dashboard/routes/static_file.py +0 -0
  309. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.0.md +0 -0
  310. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.1.md +0 -0
  311. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.10.md +0 -0
  312. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.11.md +0 -0
  313. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.12.md +0 -0
  314. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.13.md +0 -0
  315. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.14.md +0 -0
  316. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.15.md +0 -0
  317. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.16.md +0 -0
  318. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.17.md +0 -0
  319. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.18.md +0 -0
  320. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.19.md +0 -0
  321. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.20.md +0 -0
  322. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.21.md +0 -0
  323. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.22.md +0 -0
  324. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.23.md +0 -0
  325. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.24.md +0 -0
  326. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.25.md +0 -0
  327. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.26.md +0 -0
  328. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.27.md +0 -0
  329. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.28.md +0 -0
  330. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.29.md +0 -0
  331. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.3.md +0 -0
  332. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.30.md +0 -0
  333. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.31.md +0 -0
  334. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.32.md +0 -0
  335. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.33.md +0 -0
  336. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.35.md +0 -0
  337. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.36.md +0 -0
  338. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.37.md +0 -0
  339. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.38.md +0 -0
  340. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.39.md +0 -0
  341. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.4.md +0 -0
  342. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.5.md +0 -0
  343. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.6.md +0 -0
  344. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.7.md +0 -0
  345. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.8.md +0 -0
  346. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.4.9.md +0 -0
  347. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.0.md +0 -0
  348. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.1.md +0 -0
  349. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.10.md +0 -0
  350. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.11.md +0 -0
  351. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.12.md +0 -0
  352. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.13.md +0 -0
  353. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.14.md +0 -0
  354. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.15.md +0 -0
  355. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.16.md +0 -0
  356. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.17.md +0 -0
  357. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.18.md +0 -0
  358. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.19.md +0 -0
  359. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.2.md +0 -0
  360. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.20.md +0 -0
  361. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.21.md +0 -0
  362. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.22.md +0 -0
  363. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.23.md +0 -0
  364. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.24.md +0 -0
  365. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.25.md +0 -0
  366. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.26.md +0 -0
  367. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.1.md +0 -0
  368. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.2.md +0 -0
  369. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.3.md +0 -0
  370. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.4.md +0 -0
  371. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.5.md +0 -0
  372. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.6.md +0 -0
  373. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.7.md +0 -0
  374. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.8.md +0 -0
  375. {astrbot-3.5.26 → astrbot-4.0.0b2}/changelogs/v3.5.9.md +0 -0
  376. {astrbot-3.5.26 → astrbot-4.0.0b2}/compose.yml +0 -0
  377. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/.gitignore +0 -0
  378. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/LICENSE +0 -0
  379. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/README.md +0 -0
  380. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/env.d.ts +0 -0
  381. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/index.html +0 -0
  382. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/public/_redirects +0 -0
  383. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/public/favicon.svg +0 -0
  384. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/App.vue +0 -0
  385. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/astrbot_logo_mini.webp +0 -0
  386. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/dingtalk.svg +0 -0
  387. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/discord.svg +0 -0
  388. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/kook.png +0 -0
  389. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/lark.png +0 -0
  390. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/qq.png +0 -0
  391. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/slack.svg +0 -0
  392. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/telegram.svg +0 -0
  393. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/vocechat.png +0 -0
  394. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/wechat.png +0 -0
  395. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/assets/images/platform_logos/wecom.png +0 -0
  396. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/ConfirmDialog.vue +0 -0
  397. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/chat/ProviderModelSelector.vue +0 -0
  398. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ConsoleDisplayer.vue +0 -0
  399. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ExtensionCard.vue +0 -0
  400. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ItemCard.vue +0 -0
  401. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ItemCardGrid.vue +0 -0
  402. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/LanguageSwitcher.vue +0 -0
  403. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/Logo.vue +0 -0
  404. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ProxySelector.vue +0 -0
  405. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/ReadmeDialog.vue +0 -0
  406. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/UiParentCard.vue +0 -0
  407. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/components/shared/WaitingForRestart.vue +0 -0
  408. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/config.ts +0 -0
  409. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/composables.ts +0 -0
  410. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/actions.json +0 -0
  411. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/common.json +0 -0
  412. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/header.json +0 -0
  413. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/core/status.json +0 -0
  414. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/about.json +0 -0
  415. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/index.json +0 -0
  416. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/alkaid/memory.json +0 -0
  417. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/auth.json +0 -0
  418. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/chart.json +0 -0
  419. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/chat.json +0 -0
  420. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/config.json +0 -0
  421. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/console.json +0 -0
  422. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/conversation.json +0 -0
  423. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/dashboard.json +0 -0
  424. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/platform.json +0 -0
  425. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/features/session-management.json +0 -0
  426. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/errors.json +0 -0
  427. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/success.json +0 -0
  428. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/en-US/messages/validation.json +0 -0
  429. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/actions.json +0 -0
  430. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/common.json +0 -0
  431. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/header.json +0 -0
  432. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/core/status.json +0 -0
  433. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/about.json +0 -0
  434. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/index.json +0 -0
  435. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/alkaid/memory.json +0 -0
  436. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/auth.json +0 -0
  437. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/chart.json +0 -0
  438. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/chat.json +0 -0
  439. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/console.json +0 -0
  440. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/conversation.json +0 -0
  441. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/dashboard.json +0 -0
  442. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/platform.json +0 -0
  443. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/features/session-management.json +0 -0
  444. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/errors.json +0 -0
  445. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/success.json +0 -0
  446. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/locales/zh-CN/messages/validation.json +0 -0
  447. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/tools/index.ts +0 -0
  448. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/types.ts +0 -0
  449. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/i18n/validator.ts +0 -0
  450. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/blank/BlankLayout.vue +0 -0
  451. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/layouts/full/vertical-sidebar/NavItem.vue +0 -0
  452. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/main.ts +0 -0
  453. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/plugins/confirmPlugin.ts +0 -0
  454. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/plugins/vuetify.ts +0 -0
  455. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/AuthRoutes.ts +0 -0
  456. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/ChatBoxRoutes.ts +0 -0
  457. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/router/index.ts +0 -0
  458. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/_override.scss +0 -0
  459. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/_variables.scss +0 -0
  460. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VButtons.scss +0 -0
  461. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VCard.scss +0 -0
  462. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VField.scss +0 -0
  463. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VInput.scss +0 -0
  464. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VNavigationDrawer.scss +0 -0
  465. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VScrollbar.scss +0 -0
  466. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VShadow.scss +0 -0
  467. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/components/_VTabs.scss +0 -0
  468. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/layout/_container.scss +0 -0
  469. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/layout/_sidebar.scss +0 -0
  470. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/pages/_dashboards.scss +0 -0
  471. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/scss/style.scss +0 -0
  472. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/auth.ts +0 -0
  473. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/common.js +0 -0
  474. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/stores/customizer.ts +0 -0
  475. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/theme/DarkTheme.ts +0 -0
  476. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/theme/LightTheme.ts +0 -0
  477. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/themeTypes/ThemeType.ts +0 -0
  478. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/vue3-print-nb.d.ts +0 -0
  479. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/types/vue_tabler_icon.d.ts +0 -0
  480. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/AlkaidPage.vue +0 -0
  481. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ChatBoxPage.vue +0 -0
  482. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ConsolePage.vue +0 -0
  483. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/ConversationPage.vue +0 -0
  484. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/SessionManagementPage.vue +0 -0
  485. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/LongTermMemory.vue +0 -0
  486. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/alkaid/Other.vue +0 -0
  487. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/authentication/auth/LoginPage.vue +0 -0
  488. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/authentication/authForms/AuthLogin.vue +0 -0
  489. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/DefaultDashboard.vue +0 -0
  490. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/MemoryUsage.vue +0 -0
  491. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/MessageStat.vue +0 -0
  492. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/OnlinePlatform.vue +0 -0
  493. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/OnlineTime.vue +0 -0
  494. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/PlatformStat.vue +0 -0
  495. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/RunningTime.vue +0 -0
  496. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/src/views/dashboards/default/components/TotalMessage.vue +0 -0
  497. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/tsconfig.json +0 -0
  498. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/tsconfig.vite-config.json +0 -0
  499. {astrbot-3.5.26 → astrbot-4.0.0b2}/dashboard/vite.config.ts +0 -0
  500. {astrbot-3.5.26 → astrbot-4.0.0b2}/main.py +0 -0
  501. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/astrbot/metadata.yaml +0 -0
  502. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/main.py +0 -0
  503. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/metadata.yaml +0 -0
  504. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/requirements.txt +0 -0
  505. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/python_interpreter/shared/api.py +0 -0
  506. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/reminder/main.py +0 -0
  507. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/reminder/metadata.yaml +0 -0
  508. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/session_controller/metadata.yaml +0 -0
  509. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/thinking_filter/metadata.yaml +0 -0
  510. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/__init__.py +0 -0
  511. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/bing.py +0 -0
  512. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/google.py +0 -0
  513. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/engines/sogo.py +0 -0
  514. {astrbot-3.5.26 → astrbot-4.0.0b2}/packages/web_searcher/metadata.yaml +0 -0
  515. {astrbot-3.5.26 → astrbot-4.0.0b2}/samples/stt_health_check.wav +0 -0
  516. {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_dashboard.py +0 -0
  517. {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_main.py +0 -0
  518. {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_pipeline.py +0 -0
  519. {astrbot-3.5.26 → astrbot-4.0.0b2}/tests/test_plugin_manager.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: AstrBot
3
- Version: 3.5.26
3
+ Version: 4.0.0b2
4
4
  Summary: 易上手的多平台 LLM 聊天机器人及开发框架
5
5
  License-File: LICENSE
6
6
  Requires-Python: >=3.10
@@ -17,6 +17,7 @@ Requires-Dist: colorlog>=6.9.0
17
17
  Requires-Dist: cryptography>=44.0.3
18
18
  Requires-Dist: dashscope>=1.23.2
19
19
  Requires-Dist: defusedxml>=0.7.1
20
+ Requires-Dist: deprecated>=1.2.18
20
21
  Requires-Dist: dingtalk-stream>=0.22.1
21
22
  Requires-Dist: docstring-parser>=0.16
22
23
  Requires-Dist: faiss-cpu>=1.10.0
@@ -41,6 +42,8 @@ Requires-Dist: quart>=0.20.0
41
42
  Requires-Dist: readability-lxml>=0.8.4.1
42
43
  Requires-Dist: silk-python>=0.2.6
43
44
  Requires-Dist: slack-sdk>=3.35.0
45
+ Requires-Dist: sqlalchemy[asyncio]>=2.0.41
46
+ Requires-Dist: sqlmodel>=0.0.24
44
47
  Requires-Dist: telegramify-markdown>=0.5.1
45
48
  Requires-Dist: watchfiles>=1.0.5
46
49
  Requires-Dist: websockets>=15.0.1
@@ -0,0 +1,20 @@
1
+ from astrbot.core.config.astrbot_config import AstrBotConfig
2
+ from astrbot import logger
3
+ from astrbot.core import html_renderer
4
+ from astrbot.core import sp
5
+ from astrbot.core.star.register import register_llm_tool as llm_tool
6
+ from astrbot.core.star.register import register_agent as agent
7
+ from astrbot.core.agent.tool import ToolSet, FunctionTool
8
+ from astrbot.core.agent.tool_executor import BaseFunctionToolExecutor
9
+
10
+ __all__ = [
11
+ "AstrBotConfig",
12
+ "logger",
13
+ "html_renderer",
14
+ "llm_tool",
15
+ "agent",
16
+ "sp",
17
+ "ToolSet",
18
+ "FunctionTool",
19
+ "BaseFunctionToolExecutor",
20
+ ]
@@ -1,5 +1,4 @@
1
1
  import os
2
- import asyncio
3
2
  from .log import LogManager, LogBroker # noqa
4
3
  from astrbot.core.utils.t2i.renderer import HtmlRenderer
5
4
  from astrbot.core.utils.shared_preferences import SharedPreferences
@@ -21,7 +20,7 @@ html_renderer = HtmlRenderer(t2i_base_url)
21
20
  logger = LogManager.GetLogger(log_name="astrbot")
22
21
  db_helper = SQLiteDatabase(DB_PATH)
23
22
  # 简单的偏好设置存储, 这里后续应该存储到数据库中, 一些部分可以存储到配置中
24
- sp = SharedPreferences()
23
+ sp = SharedPreferences(db_helper=db_helper)
25
24
  # 文件令牌服务
26
25
  file_token_service = FileTokenService()
27
26
  pip_installer = PipInstaller(
@@ -0,0 +1,13 @@
1
+ from dataclasses import dataclass
2
+ from .tool import FunctionTool
3
+ from typing import Generic
4
+ from .run_context import TContext
5
+ from .hooks import BaseAgentRunHooks
6
+
7
+
8
+ @dataclass
9
+ class Agent(Generic[TContext]):
10
+ name: str
11
+ instructions: str | None = None
12
+ tools: list[str, FunctionTool] | None = None
13
+ run_hooks: BaseAgentRunHooks[TContext] | None = None
@@ -0,0 +1,34 @@
1
+ from typing import Generic
2
+ from .tool import FunctionTool
3
+ from .agent import Agent
4
+ from .run_context import TContext
5
+
6
+
7
+ class HandoffTool(FunctionTool, Generic[TContext]):
8
+ """Handoff tool for delegating tasks to another agent."""
9
+
10
+ def __init__(
11
+ self, agent: Agent[TContext], parameters: dict | None = None, **kwargs
12
+ ):
13
+ self.agent = agent
14
+ super().__init__(
15
+ name=f"transfer_to_{agent.name}",
16
+ parameters=parameters or self.default_parameters(),
17
+ description=agent.instructions or self.default_description(agent.name),
18
+ **kwargs,
19
+ )
20
+
21
+ def default_parameters(self) -> dict:
22
+ return {
23
+ "type": "object",
24
+ "properties": {
25
+ "input": {
26
+ "type": "string",
27
+ "description": "The input to be handed off to another agent. This should be a clear and concise request or task.",
28
+ },
29
+ },
30
+ }
31
+
32
+ def default_description(self, agent_name: str | None) -> str:
33
+ agent_name = agent_name or "another"
34
+ return f"Delegate tasks to {self.name} agent to handle the request."
@@ -0,0 +1,27 @@
1
+ import mcp
2
+ from dataclasses import dataclass
3
+ from .run_context import ContextWrapper, TContext
4
+ from typing import Generic
5
+ from astrbot.core.provider.entities import LLMResponse
6
+ from astrbot.core.agent.tool import FunctionTool
7
+
8
+
9
+ @dataclass
10
+ class BaseAgentRunHooks(Generic[TContext]):
11
+ async def on_agent_begin(self, run_context: ContextWrapper[TContext]): ...
12
+ async def on_tool_start(
13
+ self,
14
+ run_context: ContextWrapper[TContext],
15
+ tool: FunctionTool,
16
+ tool_args: dict | None,
17
+ ): ...
18
+ async def on_tool_end(
19
+ self,
20
+ run_context: ContextWrapper[TContext],
21
+ tool: FunctionTool,
22
+ tool_args: dict | None,
23
+ tool_result: mcp.types.CallToolResult | None,
24
+ ): ...
25
+ async def on_agent_done(
26
+ self, run_context: ContextWrapper[TContext], llm_response: LLMResponse
27
+ ): ...
@@ -0,0 +1,208 @@
1
+ import asyncio
2
+ import logging
3
+ from datetime import timedelta
4
+ from typing import Optional
5
+ from contextlib import AsyncExitStack
6
+ from astrbot import logger
7
+ from astrbot.core.utils.log_pipe import LogPipe
8
+
9
+ try:
10
+ import mcp
11
+ from mcp.client.sse import sse_client
12
+ except (ModuleNotFoundError, ImportError):
13
+ logger.warning("警告: 缺少依赖库 'mcp',将无法使用 MCP 服务。")
14
+
15
+ try:
16
+ from mcp.client.streamable_http import streamablehttp_client
17
+ except (ModuleNotFoundError, ImportError):
18
+ logger.warning(
19
+ "警告: 缺少依赖库 'mcp' 或者 mcp 库版本过低,无法使用 Streamable HTTP 连接方式。"
20
+ )
21
+
22
+
23
+ def _prepare_config(config: dict) -> dict:
24
+ """准备配置,处理嵌套格式"""
25
+ if "mcpServers" in config and config["mcpServers"]:
26
+ first_key = next(iter(config["mcpServers"]))
27
+ config = config["mcpServers"][first_key]
28
+ config.pop("active", None)
29
+ return config
30
+
31
+
32
+ async def _quick_test_mcp_connection(config: dict) -> tuple[bool, str]:
33
+ """快速测试 MCP 服务器可达性"""
34
+ import aiohttp
35
+
36
+ cfg = _prepare_config(config.copy())
37
+
38
+ url = cfg["url"]
39
+ headers = cfg.get("headers", {})
40
+ timeout = cfg.get("timeout", 10)
41
+
42
+ try:
43
+ async with aiohttp.ClientSession() as session:
44
+ if cfg.get("transport") == "streamable_http":
45
+ test_payload = {
46
+ "jsonrpc": "2.0",
47
+ "method": "initialize",
48
+ "id": 0,
49
+ "params": {
50
+ "protocolVersion": "2024-11-05",
51
+ "capabilities": {},
52
+ "clientInfo": {"name": "test-client", "version": "1.2.3"},
53
+ },
54
+ }
55
+ async with session.post(
56
+ url,
57
+ headers={
58
+ **headers,
59
+ "Content-Type": "application/json",
60
+ "Accept": "application/json, text/event-stream",
61
+ },
62
+ json=test_payload,
63
+ timeout=aiohttp.ClientTimeout(total=timeout),
64
+ ) as response:
65
+ if response.status == 200:
66
+ return True, ""
67
+ else:
68
+ return False, f"HTTP {response.status}: {response.reason}"
69
+ else:
70
+ async with session.get(
71
+ url,
72
+ headers={
73
+ **headers,
74
+ "Accept": "application/json, text/event-stream",
75
+ },
76
+ timeout=aiohttp.ClientTimeout(total=timeout),
77
+ ) as response:
78
+ if response.status == 200:
79
+ return True, ""
80
+ else:
81
+ return False, f"HTTP {response.status}: {response.reason}"
82
+
83
+ except asyncio.TimeoutError:
84
+ return False, f"连接超时: {timeout}秒"
85
+ except Exception as e:
86
+ return False, f"{e!s}"
87
+
88
+
89
+ class MCPClient:
90
+ def __init__(self):
91
+ # Initialize session and client objects
92
+ self.session: Optional[mcp.ClientSession] = None
93
+ self.exit_stack = AsyncExitStack()
94
+
95
+ self.name = None
96
+ self.active: bool = True
97
+ self.tools: list[mcp.Tool] = []
98
+ self.server_errlogs: list[str] = []
99
+ self.running_event = asyncio.Event()
100
+
101
+ async def connect_to_server(self, mcp_server_config: dict, name: str):
102
+ """连接到 MCP 服务器
103
+
104
+ 如果 `url` 参数存在:
105
+ 1. 当 transport 指定为 `streamable_http` 时,使用 Streamable HTTP 连接方式。
106
+ 1. 当 transport 指定为 `sse` 时,使用 SSE 连接方式。
107
+ 2. 如果没有指定,默认使用 SSE 的方式连接到 MCP 服务。
108
+
109
+ Args:
110
+ mcp_server_config (dict): Configuration for the MCP server. See https://modelcontextprotocol.io/quickstart/server
111
+ """
112
+ cfg = _prepare_config(mcp_server_config.copy())
113
+
114
+ def logging_callback(msg: str):
115
+ # 处理 MCP 服务的错误日志
116
+ print(f"MCP Server {name} Error: {msg}")
117
+ self.server_errlogs.append(msg)
118
+
119
+ if "url" in cfg:
120
+ success, error_msg = await _quick_test_mcp_connection(cfg)
121
+ if not success:
122
+ raise Exception(error_msg)
123
+
124
+ if cfg.get("transport") != "streamable_http":
125
+ # SSE transport method
126
+ self._streams_context = sse_client(
127
+ url=cfg["url"],
128
+ headers=cfg.get("headers", {}),
129
+ timeout=cfg.get("timeout", 5),
130
+ sse_read_timeout=cfg.get("sse_read_timeout", 60 * 5),
131
+ )
132
+ streams = await self.exit_stack.enter_async_context(
133
+ self._streams_context
134
+ )
135
+
136
+ # Create a new client session
137
+ read_timeout = timedelta(seconds=cfg.get("session_read_timeout", 20))
138
+ self.session = await self.exit_stack.enter_async_context(
139
+ mcp.ClientSession(
140
+ *streams,
141
+ read_timeout_seconds=read_timeout,
142
+ logging_callback=logging_callback, # type: ignore
143
+ )
144
+ )
145
+ else:
146
+ timeout = timedelta(seconds=cfg.get("timeout", 30))
147
+ sse_read_timeout = timedelta(
148
+ seconds=cfg.get("sse_read_timeout", 60 * 5)
149
+ )
150
+ self._streams_context = streamablehttp_client(
151
+ url=cfg["url"],
152
+ headers=cfg.get("headers", {}),
153
+ timeout=timeout,
154
+ sse_read_timeout=sse_read_timeout,
155
+ terminate_on_close=cfg.get("terminate_on_close", True),
156
+ )
157
+ read_s, write_s, _ = await self.exit_stack.enter_async_context(
158
+ self._streams_context
159
+ )
160
+
161
+ # Create a new client session
162
+ read_timeout = timedelta(seconds=cfg.get("session_read_timeout", 20))
163
+ self.session = await self.exit_stack.enter_async_context(
164
+ mcp.ClientSession(
165
+ read_stream=read_s,
166
+ write_stream=write_s,
167
+ read_timeout_seconds=read_timeout,
168
+ logging_callback=logging_callback, # type: ignore
169
+ )
170
+ )
171
+
172
+ else:
173
+ server_params = mcp.StdioServerParameters(
174
+ **cfg,
175
+ )
176
+
177
+ def callback(msg: str):
178
+ # 处理 MCP 服务的错误日志
179
+ self.server_errlogs.append(msg)
180
+
181
+ stdio_transport = await self.exit_stack.enter_async_context(
182
+ mcp.stdio_client(
183
+ server_params,
184
+ errlog=LogPipe(
185
+ level=logging.ERROR,
186
+ logger=logger,
187
+ identifier=f"MCPServer-{name}",
188
+ callback=callback,
189
+ ), # type: ignore
190
+ ),
191
+ )
192
+
193
+ # Create a new client session
194
+ self.session = await self.exit_stack.enter_async_context(
195
+ mcp.ClientSession(*stdio_transport)
196
+ )
197
+ await self.session.initialize()
198
+
199
+ async def list_tools_and_save(self) -> mcp.ListToolsResult:
200
+ """List all tools from the server and save them to self.tools"""
201
+ response = await self.session.list_tools()
202
+ self.tools = response.tools
203
+ return response
204
+
205
+ async def cleanup(self):
206
+ """Clean up resources"""
207
+ await self.exit_stack.aclose()
208
+ self.running_event.set() # Set the running event to indicate cleanup is done
@@ -0,0 +1,12 @@
1
+ from dataclasses import dataclass
2
+ import typing as T
3
+ from astrbot.core.message.message_event_result import MessageChain
4
+
5
+ class AgentResponseData(T.TypedDict):
6
+ chain: MessageChain
7
+
8
+
9
+ @dataclass
10
+ class AgentResponse:
11
+ type: str
12
+ data: AgentResponseData
@@ -0,0 +1,17 @@
1
+ from dataclasses import dataclass
2
+ from typing import Any, Generic
3
+ from typing_extensions import TypeVar
4
+
5
+ from astrbot.core.platform.astr_message_event import AstrMessageEvent
6
+
7
+ TContext = TypeVar("TContext", default=Any)
8
+
9
+
10
+ @dataclass
11
+ class ContextWrapper(Generic[TContext]):
12
+ """A context for running an agent, which can be used to pass additional data or state."""
13
+
14
+ context: TContext
15
+ event: AstrMessageEvent
16
+
17
+ NoContext = ContextWrapper[None]
@@ -0,0 +1,3 @@
1
+ from .base import BaseAgentRunner
2
+
3
+ __all__ = ["BaseAgentRunner"]
@@ -1,32 +1,33 @@
1
1
  import abc
2
2
  import typing as T
3
- from dataclasses import dataclass
4
- from astrbot.core.provider.entities import LLMResponse
5
- from ....message.message_event_result import MessageChain
6
3
  from enum import Enum, auto
4
+ from ..run_context import ContextWrapper, TContext
5
+ from ..response import AgentResponse
6
+ from ..hooks import BaseAgentRunHooks
7
+ from ..tool_executor import BaseFunctionToolExecutor
8
+ from astrbot.core.provider import Provider
9
+ from astrbot.core.provider.entities import LLMResponse
7
10
 
8
11
 
9
12
  class AgentState(Enum):
10
- """Agent 状态枚举"""
11
- IDLE = auto() # 初始状态
12
- RUNNING = auto() # 运行中
13
- DONE = auto() # 完成
14
- ERROR = auto() # 错误状态
15
-
16
-
17
- class AgentResponseData(T.TypedDict):
18
- chain: MessageChain
19
-
13
+ """Defines the state of the agent."""
20
14
 
21
- @dataclass
22
- class AgentResponse:
23
- type: str
24
- data: AgentResponseData
15
+ IDLE = auto() # Initial state
16
+ RUNNING = auto() # Currently processing
17
+ DONE = auto() # Completed
18
+ ERROR = auto() # Error state
25
19
 
26
20
 
27
- class BaseAgentRunner:
21
+ class BaseAgentRunner(T.Generic[TContext]):
28
22
  @abc.abstractmethod
29
- async def reset(self) -> None:
23
+ async def reset(
24
+ self,
25
+ provider: Provider,
26
+ run_context: ContextWrapper[TContext],
27
+ tool_executor: BaseFunctionToolExecutor[TContext],
28
+ agent_hooks: BaseAgentRunHooks[TContext],
29
+ **kwargs: T.Any,
30
+ ) -> None:
30
31
  """
31
32
  Reset the agent to its initial state.
32
33
  This method should be called before starting a new run.