AstrBot 4.12.4__py3-none-any.whl → 4.13.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. astrbot/builtin_stars/astrbot/process_llm_request.py +42 -1
  2. astrbot/cli/__init__.py +1 -1
  3. astrbot/core/agent/runners/tool_loop_agent_runner.py +91 -1
  4. astrbot/core/agent/tool.py +61 -20
  5. astrbot/core/astr_agent_tool_exec.py +2 -2
  6. astrbot/core/{sandbox → computer}/booters/base.py +4 -4
  7. astrbot/core/{sandbox → computer}/booters/boxlite.py +2 -2
  8. astrbot/core/computer/booters/local.py +234 -0
  9. astrbot/core/{sandbox → computer}/booters/shipyard.py +2 -2
  10. astrbot/core/computer/computer_client.py +102 -0
  11. astrbot/core/{sandbox → computer}/tools/__init__.py +2 -1
  12. astrbot/core/{sandbox → computer}/tools/fs.py +1 -1
  13. astrbot/core/computer/tools/python.py +94 -0
  14. astrbot/core/{sandbox → computer}/tools/shell.py +13 -5
  15. astrbot/core/config/default.py +61 -9
  16. astrbot/core/db/__init__.py +3 -0
  17. astrbot/core/db/po.py +4 -0
  18. astrbot/core/db/sqlite.py +19 -1
  19. astrbot/core/message/components.py +2 -2
  20. astrbot/core/persona_mgr.py +8 -0
  21. astrbot/core/pipeline/context_utils.py +2 -2
  22. astrbot/core/pipeline/preprocess_stage/stage.py +1 -1
  23. astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py +16 -2
  24. astrbot/core/pipeline/process_stage/utils.py +19 -4
  25. astrbot/core/pipeline/scheduler.py +1 -1
  26. astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py +3 -3
  27. astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py +5 -7
  28. astrbot/core/provider/manager.py +31 -0
  29. astrbot/core/provider/sources/gemini_source.py +12 -9
  30. astrbot/core/skills/__init__.py +3 -0
  31. astrbot/core/skills/skill_manager.py +237 -0
  32. astrbot/core/star/command_management.py +1 -1
  33. astrbot/core/star/config.py +1 -1
  34. astrbot/core/star/filter/command.py +1 -1
  35. astrbot/core/star/filter/custom_filter.py +2 -2
  36. astrbot/core/star/register/star_handler.py +1 -1
  37. astrbot/core/utils/astrbot_path.py +6 -0
  38. astrbot/dashboard/routes/__init__.py +2 -0
  39. astrbot/dashboard/routes/config.py +236 -2
  40. astrbot/dashboard/routes/persona.py +7 -0
  41. astrbot/dashboard/routes/skills.py +148 -0
  42. astrbot/dashboard/routes/util.py +102 -0
  43. astrbot/dashboard/server.py +19 -5
  44. {astrbot-4.12.4.dist-info → astrbot-4.13.0.dist-info}/METADATA +1 -1
  45. {astrbot-4.12.4.dist-info → astrbot-4.13.0.dist-info}/RECORD +52 -47
  46. astrbot/core/sandbox/sandbox_client.py +0 -52
  47. astrbot/core/sandbox/tools/python.py +0 -74
  48. /astrbot/core/{sandbox → computer}/olayer/__init__.py +0 -0
  49. /astrbot/core/{sandbox → computer}/olayer/filesystem.py +0 -0
  50. /astrbot/core/{sandbox → computer}/olayer/python.py +0 -0
  51. /astrbot/core/{sandbox → computer}/olayer/shell.py +0 -0
  52. {astrbot-4.12.4.dist-info → astrbot-4.13.0.dist-info}/WHEEL +0 -0
  53. {astrbot-4.12.4.dist-info → astrbot-4.13.0.dist-info}/entry_points.txt +0 -0
  54. {astrbot-4.12.4.dist-info → astrbot-4.13.0.dist-info}/licenses/LICENSE +0 -0
@@ -11,7 +11,7 @@ astrbot/api/util/__init__.py,sha256=L1O_mFEUDk8V4lEPsT5iiNbIiOVh7HbrNmitqzUWMZg,
11
11
  astrbot/builtin_stars/astrbot/long_term_memory.py,sha256=Gra7dqiqXLBH_u4M6TZmu49lxiolotbDNTwbh2aVTiA,7676
12
12
  astrbot/builtin_stars/astrbot/main.py,sha256=KmiWqfQ1E7VR0Grf4jnO8d5_8tJJINbmFceAQ0FPeMU,4864
13
13
  astrbot/builtin_stars/astrbot/metadata.yaml,sha256=GCPK0piMKr4C6Bb0kaBJYhiqPDoMEAYJJp2MV5pXs4k,197
14
- astrbot/builtin_stars/astrbot/process_llm_request.py,sha256=qgzJDMCJB4l58-fPx-5k8HcN9mU9vMDV2JkHAPrCgIE,10248
14
+ astrbot/builtin_stars/astrbot/process_llm_request.py,sha256=oog7JIW2bZhaz8OeuqP4AUAMX96kglvmlVbvDxTwHpA,12286
15
15
  astrbot/builtin_stars/builtin_commands/main.py,sha256=T8bNer22YgFkKZbLn9Zl-5Y1SIbKpQe_HvDJpUiyte4,7613
16
16
  astrbot/builtin_stars/builtin_commands/metadata.yaml,sha256=x0URUKI3S14RRXQ-ewgJy4dYXMKxZcEo2pSKeApGleg,152
17
17
  astrbot/builtin_stars/builtin_commands/commands/__init__.py,sha256=jHIh8Dg5EX5FcyWCEey-z84-iPVSBEamIYwhR75c4Rk,705
@@ -37,7 +37,7 @@ astrbot/builtin_stars/web_searcher/metadata.yaml,sha256=aHAKtP8UZJaddzIN2eFfglTO
37
37
  astrbot/builtin_stars/web_searcher/engines/__init__.py,sha256=Gcp7k6m3w2Pb-hNCe3QIiYa9smQFcEzmb7jcfg2evuw,4300
38
38
  astrbot/builtin_stars/web_searcher/engines/bing.py,sha256=pn3DPR-5SO2D_RtBIU3l9Ph7PTUB-FCZAMCYuk6kd6Q,1035
39
39
  astrbot/builtin_stars/web_searcher/engines/sogo.py,sha256=YA7pA5-335r7UgKpyUPAeGGZQbYEwDBO8bm08Ro8Xg0,1701
40
- astrbot/cli/__init__.py,sha256=Aj1FgKj2dZfII4N9gUFqwsAT4s3MoYTSbFD8C-yVnS0,23
40
+ astrbot/cli/__init__.py,sha256=9Eu48ft2G9OmRml3_rfORRbpYtNuauG7kRVNg5FgKGw,23
41
41
  astrbot/cli/__main__.py,sha256=QobgMyFoLNTgI_OYddhGOZ9ZvQeBVjjz79mA2cC2OEU,1758
42
42
  astrbot/cli/commands/__init__.py,sha256=eAgppZQIqFO1ylQJFABeYrzQ0oZqPWjtE80aKIPB3ks,149
43
43
  astrbot/cli/commands/cmd_conf.py,sha256=6-YLicBt_zjWTzaVLUJ1VQLQPbDEPYACB9IVnN8Zvng,6330
@@ -52,7 +52,7 @@ astrbot/core/__init__.py,sha256=zsaF9IeON4NaHk_Ktr0eB7xQEFC5tUZ4UJCesC3-KHM,1220
52
52
  astrbot/core/astr_agent_context.py,sha256=bJnAm_CGzkhMnC99GA_j0Xwmi-OYoBPmgGanuS36DF4,637
53
53
  astrbot/core/astr_agent_hooks.py,sha256=FTCQqhl-N8b163nxoPeoyfqhSGCG0bcAmnF1dAHMOm8,3020
54
54
  astrbot/core/astr_agent_run_util.py,sha256=kPlWu2nLXfJzZddbtuoca0iZph9VRTJgdC9cLQf5UCQ,13592
55
- astrbot/core/astr_agent_tool_exec.py,sha256=DpGqVhQzSwL2EN6wfBJrlcwH7b1jLkX5b_1eI5xqUB8,10258
55
+ astrbot/core/astr_agent_tool_exec.py,sha256=VPCJqVK4Teyrg8UgvUywtwKfLbJ29dZ0bj-NTNYzdmQ,10256
56
56
  astrbot/core/astrbot_config_mgr.py,sha256=SUvusfo8Qk89eNpEmduWcXuczJ9g5TBH-VOV69ax28g,8950
57
57
  astrbot/core/conversation_mgr.py,sha256=iELU-454tCOFRVs0DwJLZvx59mUSD55TYLlCVTEccyQ,15968
58
58
  astrbot/core/core_lifecycle.py,sha256=gWzOi16v4EYJ176UVKV4L4cnwkZArIwZOj0YEYlm_ck,12847
@@ -61,7 +61,7 @@ astrbot/core/exceptions.py,sha256=GVCUgAjpvUHLL59MkJalFrSp_HbtliChu7XII_Px2WM,21
61
61
  astrbot/core/file_token_service.py,sha256=8X0Qyo-NPGhtxy6IcRsJg7Z2tx_ULPf_7OKvw-KBk6o,3317
62
62
  astrbot/core/initial_loader.py,sha256=q798G8wEti7-p3UC0y1GB3MOK-kO6z1Nt826iO5nJVA,1802
63
63
  astrbot/core/log.py,sha256=PfybPaZAL_eab7r9nPIa_1nCXdhMMa3iqHg1Ogh3r1c,9116
64
- astrbot/core/persona_mgr.py,sha256=-4kkkvODID3h2haTdalq8DUbIJWek1wF66TE1E2WGcs,12518
64
+ astrbot/core/persona_mgr.py,sha256=whlJNS5FiFGZ8CwLBoJGVcWr3ZuLeZx3h6OB4YI17e0,12883
65
65
  astrbot/core/platform_message_history_mgr.py,sha256=0frxrq6Bt18OXbt24uRnQl039wpi2gK5L9ONLtBuMsM,1580
66
66
  astrbot/core/umop_config_router.py,sha256=K1Ya1Ke5iTZgrxgRp7VEiREAI2BcSGYeM3Os_05dUkE,3733
67
67
  astrbot/core/updator.py,sha256=-F9elTgp4UwCdGEPwUwA0SAMQpouvAruktH4uh6nTwY,4666
@@ -73,7 +73,7 @@ astrbot/core/agent/mcp_client.py,sha256=u52GPgpeZ1DCCVbI6x4kOGyodD_kweB8H1OgaVg-
73
73
  astrbot/core/agent/message.py,sha256=ufmUrXjboQHi6j7PGttSR5pk-degwjR1kgV3q0slauw,6901
74
74
  astrbot/core/agent/response.py,sha256=g1aw5zE3Y_PsU7z1SVrNTJRlGnqdyuqG5-49LewsL2E,859
75
75
  astrbot/core/agent/run_context.py,sha256=PJYgGlq_m6eBo1ftHE0M37UzOwTcXJNeKgKri1NC2Hk,677
76
- astrbot/core/agent/tool.py,sha256=ITSAmYBp2y-QPWdZkc-KXof3UIHjQ2rmweyUPuYykFA,9440
76
+ astrbot/core/agent/tool.py,sha256=5MmvtvY4pDQVriuwIzwGSyene-qeFY0gy7ynqf3U9s8,11019
77
77
  astrbot/core/agent/tool_executor.py,sha256=8GGgVB_JaKGVLQUG1epeL-lvKMqgfQ7mJaOPnVytnXo,438
78
78
  astrbot/core/agent/context/compressor.py,sha256=YzMv7CLOIz96d2ZgT4Z-K4kx-mh82Es3VQwE_lkM4Jc,8319
79
79
  astrbot/core/agent/context/config.py,sha256=Dtta1VYxo0alm9Zd7I2w1Aa7ZX5Nn-bu_Wu6zuPPSOU,1424
@@ -82,7 +82,7 @@ astrbot/core/agent/context/token_counter.py,sha256=LuGNzcqE5_25VTg8qNXhI1DR-M58I
82
82
  astrbot/core/agent/context/truncator.py,sha256=KSmdVj0XsdTZRpx5LzleVg_D_G1lSe0CGpk7ie5Q1vI,4578
83
83
  astrbot/core/agent/runners/__init__.py,sha256=KwR34OKGVSQpJ_MaGVP_MX5L1SZ4oU-lv4GuMbSF5Ys,65
84
84
  astrbot/core/agent/runners/base.py,sha256=OHMt15x1C3O_F3EJI2Nb_3hwggGUkJHuPWWCa1kHX9o,1885
85
- astrbot/core/agent/runners/tool_loop_agent_runner.py,sha256=TEuCJ7XB76jtfT26ZZBVb0pQ4AJ5h8fVbvDUlLNSxi8,22906
85
+ astrbot/core/agent/runners/tool_loop_agent_runner.py,sha256=WiiEQReoSgL5-58xDF0mvyR8HR2FZHsaf7L9kjAL3fE,26737
86
86
  astrbot/core/agent/runners/coze/coze_agent_runner.py,sha256=bc2GImNsBTyXuotl_ohKYiNqws5Dkcms_xmIoUtDJMM,13846
87
87
  astrbot/core/agent/runners/coze/coze_api_client.py,sha256=0k8pQsFsbjKdF-jkY91qZWsC8YSaSmwC98TMTK-zqw0,10853
88
88
  astrbot/core/agent/runners/dashscope/dashscope_agent_runner.py,sha256=xr3otT0o6kHEy_sWjUv4xh-KmES3fjlowIPrtcKYiVI,13339
@@ -92,13 +92,26 @@ astrbot/core/backup/__init__.py,sha256=8uBY2FPYWfIsVZcAgfMWh5-Kwkd50HtyiM0gCETuD
92
92
  astrbot/core/backup/constants.py,sha256=_e-SjZ-uvithscUqnqvPVtIPWN3PBPkSu4yHHKM7pHM,2251
93
93
  astrbot/core/backup/exporter.py,sha256=tULFmXhYqRhJtAwePFkxXMSKqct1MSMyISv9LrfKwVU,19058
94
94
  astrbot/core/backup/importer.py,sha256=efGW5-5ZAfvN1mg4rcc5OrcFTLfyj7L9T0Yd7SBUlNo,28618
95
+ astrbot/core/computer/computer_client.py,sha256=uy7l26qzOg_YM71jPdxcLrY6P6A37hndhP8LnG0HItQ,3432
96
+ astrbot/core/computer/booters/base.py,sha256=NgkkvkrTB4iaoIOck86FCtWNPwPhSo4-AuMB3GPKJGY,819
97
+ astrbot/core/computer/booters/boxlite.py,sha256=U1TsVqzm3qvbcQhB4Q1k7XBlmoiVam9iY0cpeazL7eQ,6495
98
+ astrbot/core/computer/booters/local.py,sha256=ILZfH7nH0MdHr0qAT0xsvuYDrf7Zs598__q5nmdIEO8,7358
99
+ astrbot/core/computer/booters/shipyard.py,sha256=L-SW_j2eNaxgUgfswup6ndXoT6mHIV3kk0fiNuLsLKw,2077
100
+ astrbot/core/computer/olayer/__init__.py,sha256=iNRCSk_uyTUJ_xXeoR2LOgPwziXwrisd8cokFcSuIp0,186
101
+ astrbot/core/computer/olayer/filesystem.py,sha256=e5vgzxZJlqxJctS2EAkHONGvESYbq52ZvVFQBfGGP8w,865
102
+ astrbot/core/computer/olayer/python.py,sha256=ksv0qdOgUFMWyb9iYSI3pLLSiBznojjerQv7y6En7co,368
103
+ astrbot/core/computer/olayer/shell.py,sha256=8vaNRpX_EjU0gXVT3rii1JFsYAyqTLlCr4fs7nZ-kQ0,430
104
+ astrbot/core/computer/tools/__init__.py,sha256=iFsuCjjyNIlkmxOXOSarXW70fGbXNc9ptT8QmzS6Jq4,259
105
+ astrbot/core/computer/tools/fs.py,sha256=OmSaKHpbhLVw-9Nj3ug8ZOBSBlghGfhg_qajK1_5X1o,6871
106
+ astrbot/core/computer/tools/python.py,sha256=QL3xZrmNY3OyVBBUcoHG2wpc_5EJars1x-mnp8WkG04,3018
107
+ astrbot/core/computer/tools/shell.py,sha256=nidNfEBhsfgvFEnv4mhhrqEMhgpkWA-yEwQKNbC9A18,2198
95
108
  astrbot/core/config/__init__.py,sha256=vZjtpC7vr-IvBgSUtbS04C0wpulmCG5tPmcEP1WYE_4,172
96
109
  astrbot/core/config/astrbot_config.py,sha256=5r2VhCNO4VuGCqct12g10-TcvAKyXV40-suk5vRMGns,6436
97
- astrbot/core/config/default.py,sha256=qzpVhL9rGYk31MfjVs70HD-P9mHPVQ-O8GYSOTXVr3Y,158516
110
+ astrbot/core/config/default.py,sha256=drP2iTwFmibBvYAFg074SGoB_gCeJJzITgvDGF2b2_w,160460
98
111
  astrbot/core/config/i18n_utils.py,sha256=HJn_0XeeVS9ryCBelYfnc0nEn10LlX702fcSSFrF1J8,3879
99
- astrbot/core/db/__init__.py,sha256=VCNY44O9nWoPT4Tiqu2m9VEyi0vIem4NtLfQGxPgzwI,18340
100
- astrbot/core/db/po.py,sha256=V2aekOguzPe9oOjNPLTj_C0_KD9h5BY3mNpn3PSyWpk,15640
101
- astrbot/core/db/sqlite.py,sha256=BxOjxgxAKn8G26BZvnwq3OpXmtTJhJrnwxbULUGjR4U,57885
112
+ astrbot/core/db/__init__.py,sha256=ldEFdHkuQn_WpSNEC9X6knfthF2lD5YYLLZD4phwtdg,18515
113
+ astrbot/core/db/po.py,sha256=I6Yd0gY3-JdjydYMoXH61u_xsy2T2b0rGPwIPnmQDuU,15936
114
+ astrbot/core/db/sqlite.py,sha256=ry_FhBHXDXMrfBb9Yq1qHAc-8rJEj0UP8l6pwRx1USA,58647
102
115
  astrbot/core/db/migration/helper.py,sha256=Kogq0FLJdvWTDuAVWLT1PlTGGJcWkDMWO37KM-G8lTk,2087
103
116
  astrbot/core/db/migration/migra_3_to_4.py,sha256=AZkywKcS2aKo81k04uD2qxHsPqKWRfVz9smEnHDxWqE,15343
104
117
  astrbot/core/db/migration/migra_45_to_46.py,sha256=wQk8NUiCNgmpSczO9U-OW6mMRHPWtJDlKuTCOGF8-WY,1560
@@ -133,24 +146,24 @@ astrbot/core/knowledge_base/retrieval/hit_stopwords.txt,sha256=8LikiRxpjLdAfJYyO
133
146
  astrbot/core/knowledge_base/retrieval/manager.py,sha256=1kjjcBco_TdfZ1g6mEp7lb9AVkHr1dfBHVqgWVAiBsw,8560
134
147
  astrbot/core/knowledge_base/retrieval/rank_fusion.py,sha256=OeE4dSAsmyCt_ssAnMf7CQ4tQHlBFxjePgXVf_YwHmY,4441
135
148
  astrbot/core/knowledge_base/retrieval/sparse_retriever.py,sha256=sOCZ9I636j3P5WGxjKXVu7Amp-2DB9jQVQn96Ff7asI,3815
136
- astrbot/core/message/components.py,sha256=TsY8_cGXzdloB5UB8eNZ2ekfX7MIxC__k1Fk78DmZWw,25897
149
+ astrbot/core/message/components.py,sha256=eW0GQqdYFOzTBSeLl42zQB7QOdm97CWWhRar4uWz5GE,25895
137
150
  astrbot/core/message/message_event_result.py,sha256=1jC6NLeO7lzcTCi2NO28057sWpTsDabICkmGsiggyhk,7204
138
151
  astrbot/core/pipeline/__init__.py,sha256=nEepE3tnYYo0EYnzdLLyrp_k7XYg0LpQ3W6QuEeGL6k,1461
139
152
  astrbot/core/pipeline/context.py,sha256=jfEyX9i34XM7uqeqqK6rKRDgBXfsV9UHgRpf9Wj_hnI,505
140
- astrbot/core/pipeline/context_utils.py,sha256=QAtlRPvPTAzVkzqlP3bhOkQmdd1ZTU12l9vPNUROf2k,3663
141
- astrbot/core/pipeline/scheduler.py,sha256=h6dwQBaZS6h4ou3EyxPWD0LMJLpS1x6KnFq8U-fTVPY,3498
153
+ astrbot/core/pipeline/context_utils.py,sha256=Fvx_f7zi0VhgKCM3jBPhvB3V74oBc7m_KQdAeCKqvPo,3661
154
+ astrbot/core/pipeline/scheduler.py,sha256=2iMvyblMwxxPxWO1Aj0_RPqm5Dqm9kTvsr3a97REedo,3497
142
155
  astrbot/core/pipeline/stage.py,sha256=hpzghbberezaBJtb2cwhY8x0xi6lZrgWfD2BYv-te1g,1350
143
156
  astrbot/core/pipeline/content_safety_check/stage.py,sha256=wzHadhasKyYswVXfRJ_8My6S3mo_0Xjm6DF95TxD57g,1389
144
157
  astrbot/core/pipeline/content_safety_check/strategies/__init__.py,sha256=47gYlyvW-Dr401fO0dMAAAmMXnSkTI63MnYak3GGvNw,164
145
158
  astrbot/core/pipeline/content_safety_check/strategies/baidu_aip.py,sha256=-DvF8O9dZ7PDzRtQwYmIJfYHz1aA5C_gKafGw9IVgYs,1005
146
159
  astrbot/core/pipeline/content_safety_check/strategies/keywords.py,sha256=N3bR19Deb3a-DOE-3hiuogsC068uYNL25fCe9BVkKKA,905
147
160
  astrbot/core/pipeline/content_safety_check/strategies/strategy.py,sha256=XM2c-6apssEtAllMAI6BUXaEN_t2XINHcCoAudeKNwc,1206
148
- astrbot/core/pipeline/preprocess_stage/stage.py,sha256=BFaON3u4MrQUXp0ZXETU5MIvN_w0p0KJDNc9D7Y3qsY,4202
161
+ astrbot/core/pipeline/preprocess_stage/stage.py,sha256=swnXm88qWvXPzYi75RpR-phef__NNyY7664fQKEl86U,4201
149
162
  astrbot/core/pipeline/process_stage/stage.py,sha256=tOg6HYGVU1GoY921YBYVO1MTM7a55M0N8uB9tOoTomg,2406
150
- astrbot/core/pipeline/process_stage/utils.py,sha256=V9ObKNwbCyaZFdVgySasgcrzzADIIDo-t05JAx-7I2Q,8483
163
+ astrbot/core/pipeline/process_stage/utils.py,sha256=aOAB6A-drxvoO3XYnncCbteW_DqCelR7cnSDqeb7MRM,9379
151
164
  astrbot/core/pipeline/process_stage/method/agent_request.py,sha256=vHC2Z73Fe96iW4j6ZbNvWQkfXD49pVWy6XKoG-20CS8,2049
152
165
  astrbot/core/pipeline/process_stage/method/star_request.py,sha256=C-PTq_Wpq4QMS2ecfRDCcDSX3rYyldfsAN-jAaEEb-w,2430
153
- astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py,sha256=rE7Dbpjf4FdTbHVNbReBssETdc72IO9VrhJ56mFE25g,33229
166
+ astrbot/core/pipeline/process_stage/method/agent_sub_stages/internal.py,sha256=N61nbOT3xJlKD0Csgzb9GxEuVI9UC984Jej-ICC8o0Y,33887
154
167
  astrbot/core/pipeline/process_stage/method/agent_sub_stages/third_party.py,sha256=LNBRItSpZn0MLP4fyHQ_3gUJ8lnmCwuPlqnZDVFLI6Q,7332
155
168
  astrbot/core/pipeline/rate_limit_check/stage.py,sha256=9EVJ0zYtxATFsj7ADyWDYcSGBRqmrMiKWp1kkD9LONI,3962
156
169
  astrbot/core/pipeline/respond/stage.py,sha256=RIYGXTG-XvBhgRqaHyJYWlsZjskS9pgV-2jm5o956ho,11042
@@ -167,7 +180,7 @@ astrbot/core/platform/message_type.py,sha256=uGn5KN8B_7b9F5nFTpvLAXRlXx2VFHP3JmJ
167
180
  astrbot/core/platform/platform.py,sha256=U2jq248bfPaAcIa8PUO5aiPyAOGIN1lz6LVnqQOPFik,5114
168
181
  astrbot/core/platform/platform_metadata.py,sha256=PCqNk-H-V7BtiQXbbyHd84s43BBIZNhUQ9X-SVKP3uM,693
169
182
  astrbot/core/platform/register.py,sha256=ptIPhVvbzODuWwXr8J0jJSzSPfv3rr7F67gXqvIpvvk,1985
170
- astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py,sha256=ycNdNPKUnBJ3hJuDn_S8GM_W7XFbhumpotM8yqcOrqg,8146
183
+ astrbot/core/platform/sources/aiocqhttp/aiocqhttp_message_event.py,sha256=rlCB8f9Wmysq7C3vcbSgXKbY5jSW5SjhNn2GrZ34cFs,8144
171
184
  astrbot/core/platform/sources/aiocqhttp/aiocqhttp_platform_adapter.py,sha256=J9Nrv2VNxP12Ybg9LRZbvEnbw9JxZtCME8QxTj6XdbE,18612
172
185
  astrbot/core/platform/sources/dingtalk/dingtalk_adapter.py,sha256=36oOlr6AcqcqlebcRdSNhllPXb9QyZcKdJI3go5Mw6c,11463
173
186
  astrbot/core/platform/sources/dingtalk/dingtalk_event.py,sha256=k6tIeP_2UEjGyg4sV4woEwkpWBWP0BOqyqvtDZf6Hnc,5479
@@ -182,7 +195,7 @@ astrbot/core/platform/sources/misskey/misskey_adapter.py,sha256=hbO9ZL0FCLcL2sxq
182
195
  astrbot/core/platform/sources/misskey/misskey_api.py,sha256=YlE1zxHs0dPWJVuVsWR0Lr0d9TPQmnTwsLCQKI4p6Gk,35905
183
196
  astrbot/core/platform/sources/misskey/misskey_event.py,sha256=2PYSU9arxzbS71jz5D__3maFFNKqxYZiGmXtLuC_aAc,6550
184
197
  astrbot/core/platform/sources/misskey/misskey_utils.py,sha256=_B1Sr8ajI1ljWBoxhwzOVMNt_pFoVNfhIsOVokKI18g,17741
185
- astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py,sha256=cfUsFRmm18-5RvMeYTXl2A3_-Me4sxb1vrjODrbuG4o,13725
198
+ astrbot/core/platform/sources/qqofficial/qqofficial_message_event.py,sha256=VB_zIxXchKCURl8JfIiTzYMGQ62I0sE7HHhTf5oFFks,13682
186
199
  astrbot/core/platform/sources/qqofficial/qqofficial_platform_adapter.py,sha256=p8ifAmXtvs7BBqRukqnkkPQ62niwGTjUIP50YUrQa7E,7388
187
200
  astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_adapter.py,sha256=AoELYkwpEUDhe10Yq1ltjpnL2kCIGsgjy3Ok90abWl0,5574
188
201
  astrbot/core/platform/sources/qqofficial_webhook/qo_webhook_event.py,sha256=vqifw9itvrcr7sV9cL0T19qLZ7I9CWORi4oUBgZrOqc,501
@@ -216,7 +229,7 @@ astrbot/core/provider/__init__.py,sha256=0NVyKtTapnrUy0lkXVYWyM5KetwtDwXmTwBzqLG
216
229
  astrbot/core/provider/entites.py,sha256=0eYiQ-xttqFTb3WZR2b1oemdZy3d5sevELvj9FixJtE,388
217
230
  astrbot/core/provider/entities.py,sha256=1Az26czWgrnJn2zCi0_WfC3MRyAYrN_cxcYemFZqhxs,15604
218
231
  astrbot/core/provider/func_tool_manager.py,sha256=2pBKHAuj-6rITOipHmH8hrs8D4N2bAUx5TcJfUVYtsk,21241
219
- astrbot/core/provider/manager.py,sha256=G5hMk41Z819Y442Gtpap_ilaXsc1YK8HzyzDfC5Aeao,30248
232
+ astrbot/core/provider/manager.py,sha256=_5qq7EEMYuWqVWHcxvmj-0N7e-DxTCnyIWgNVB6bwxs,31576
220
233
  astrbot/core/provider/provider.py,sha256=p4l4qSTPimtkH0tba4D5k97bhVNczE9SNHw4bnos5SI,14336
221
234
  astrbot/core/provider/register.py,sha256=0WMYrT9vbRjeq-72HD0oRT45kJmeKA96UgSItpTJbX8,1904
222
235
  astrbot/core/provider/sources/anthropic_source.py,sha256=F3pFJvUrLdqhzNFHU7N9zPT8PdIxXVCgH-RcNaR1y0U,25123
@@ -226,7 +239,7 @@ astrbot/core/provider/sources/dashscope_tts.py,sha256=-qBMwbIt_QSmWCT_uPAxrXSYuE
226
239
  astrbot/core/provider/sources/edge_tts_source.py,sha256=dsf6YtSGzCJvas3BqBwHSn8vlMgQ_vgD9NEwngqDlEo,4690
227
240
  astrbot/core/provider/sources/fishaudio_tts_api_source.py,sha256=w3TUrNpJ9preNd4jeyCcjjjXZpaAo8TesSFIDxtLqyA,5917
228
241
  astrbot/core/provider/sources/gemini_embedding_source.py,sha256=OoLMY-5-QXgLbj8KCnJ04SIHgTckvygxp5tkCopocKY,2612
229
- astrbot/core/provider/sources/gemini_source.py,sha256=puj7RsH7ZXQ-XyElc4ZYRDXFw4JwxkPDk1pVDtXQPBg,37350
242
+ astrbot/core/provider/sources/gemini_source.py,sha256=nyWBCXeX7CpjI6vq4zLmM5QmrMpYRoIpqa8243dGbPA,37476
230
243
  astrbot/core/provider/sources/gemini_tts_source.py,sha256=6LJIT2aTjoZaMszjYRzDu38prsO9G5Xg7SzJmQb2TzE,2880
231
244
  astrbot/core/provider/sources/genie_tts.py,sha256=RCKj0sMt1fUquvBzxXdR2Isa0hJ5s4gKWuYoc8ZlA4Q,4253
232
245
  astrbot/core/provider/sources/groq_source.py,sha256=NqmiQn37mrMsaTyGX25eNzMpIgkCifY-5TJO8DFzHaA,456
@@ -245,22 +258,12 @@ astrbot/core/provider/sources/xai_source.py,sha256=wxAlbmQnbzhTKsVWK8fe6w7DNadZV
245
258
  astrbot/core/provider/sources/xinference_rerank_source.py,sha256=DsF4JVlXGeeqqycyP05zz0I-jJ3R1cXiTUsjDeaQNpE,4692
246
259
  astrbot/core/provider/sources/xinference_stt_provider.py,sha256=A2kzsVZD6Fnbfgv7r1xY1y5tT05mRKZYfRVfe8vN8JA,8198
247
260
  astrbot/core/provider/sources/zhipu_source.py,sha256=oOCPXGsR9PLWOuu3h8RSVNRw1Qy2Se6dwmeFR3zk3GM,612
248
- astrbot/core/sandbox/sandbox_client.py,sha256=SkUxGbGdkhk7lTEHzgO0NJpVuNHym6k86c_32GOameM,1713
249
- astrbot/core/sandbox/booters/base.py,sha256=mp-aLZTPOxYw4AtJIzAgNBymVwDVlYfGAAJe0gNDY8A,807
250
- astrbot/core/sandbox/booters/boxlite.py,sha256=j80H1N362dRnDM9Qj2eFOcF9GdPZNkJfHLrjI0ae8ko,6493
251
- astrbot/core/sandbox/booters/shipyard.py,sha256=4lbir-o_mQ1nWWxZCuPxcEgnsuP10yWeiqNy_5Y7Xqc,2075
252
- astrbot/core/sandbox/olayer/__init__.py,sha256=iNRCSk_uyTUJ_xXeoR2LOgPwziXwrisd8cokFcSuIp0,186
253
- astrbot/core/sandbox/olayer/filesystem.py,sha256=e5vgzxZJlqxJctS2EAkHONGvESYbq52ZvVFQBfGGP8w,865
254
- astrbot/core/sandbox/olayer/python.py,sha256=ksv0qdOgUFMWyb9iYSI3pLLSiBznojjerQv7y6En7co,368
255
- astrbot/core/sandbox/olayer/shell.py,sha256=8vaNRpX_EjU0gXVT3rii1JFsYAyqTLlCr4fs7nZ-kQ0,430
256
- astrbot/core/sandbox/tools/__init__.py,sha256=5c0r6OK_DHZv_POegHri6St73M_a-OL9iJQzzV-l2BM,219
257
- astrbot/core/sandbox/tools/fs.py,sha256=cCUcunZX6xXr2HBEqfwdBzT1qsqONQ2fDVCBGkgj2G8,6870
258
- astrbot/core/sandbox/tools/python.py,sha256=53ITRd4a49p4LNOF4IEsrYwb9buElOBDa8LEAyDK5VI,2472
259
- astrbot/core/sandbox/tools/shell.py,sha256=m4xysCMLwxvX5-DyoIaGcAm5ziHC019DQLOl1-YE_I4,1883
261
+ astrbot/core/skills/__init__.py,sha256=6ADR-BbIwB_QlXnWPki4RBPH5XbhNOQDlP5PHFKB32s,136
262
+ astrbot/core/skills/skill_manager.py,sha256=zx_LZRc6sPRV85KHwWtm_ueYF3_yMoBA1lKkGy6Ihv0,9658
260
263
  astrbot/core/star/README.md,sha256=LXxqxp3xv_oejO8ocBPOrbmLe0WB4feu43fYDNddHTQ,161
261
264
  astrbot/core/star/__init__.py,sha256=iTlnjfEGJGy--78PhG7F1cKj9VwJVcDNFtGomX8hRO0,2229
262
- astrbot/core/star/command_management.py,sha256=V6LT_xNGCEQ6f6vMh0H8vSolsPx0bIPcFQnbN7QyGOY,18100
263
- astrbot/core/star/config.py,sha256=FgrBz_fUrBU0-9BxD8enX-xGNGVbFxst3UT10sboYNA,3531
265
+ astrbot/core/star/command_management.py,sha256=AAmbY-saiIoExPzDY5DMxQwCnUvtsWztMJxQIVk2Qco,18099
266
+ astrbot/core/star/config.py,sha256=dwIERy7S4k-2RHoMweZ_dYwNqkjiW78J_Gwoy3DLUq0,3533
264
267
  astrbot/core/star/context.py,sha256=6THd6T3MsHyGukX7UJf4iJg4jWzC8eQmuvp1JyO7sXg,24650
265
268
  astrbot/core/star/session_llm_manager.py,sha256=6y5rxQQ5RpuzOcw-4DAOeUBEep7nKIfBc6kTGTUkJX8,5707
266
269
  astrbot/core/star/session_plugin_manager.py,sha256=2mGUhwWHsAOC1F575d7GwcVdoc3Brv-w-pbISJSmP38,3144
@@ -270,17 +273,17 @@ astrbot/core/star/star_manager.py,sha256=YP8bEy5zecAzTWtj2Oz1hZwX3CFLq4yJu-7tWJ9
270
273
  astrbot/core/star/star_tools.py,sha256=4q8emjyTbyIsVXHmzT88kX9uK28rIhlHc0re40Xm6m0,10847
271
274
  astrbot/core/star/updator.py,sha256=4pl42Ks_yjJ3kydx3BwOqocAczhhFBrRnxhBKh4_0Eo,3106
272
275
  astrbot/core/star/filter/__init__.py,sha256=bC6eHXh0CjzHmn-LTvsanWReoGIPhhMnBSrMLh97hZQ,470
273
- astrbot/core/star/filter/command.py,sha256=U-ZANHFIeSm4Zilx0KxoXdfkd1Y-_DKSqo5ZxoGU0mk,8908
276
+ astrbot/core/star/filter/command.py,sha256=ao_u1oTbtd-ThJPaCQkIqLEMApcIt4dQZf9Oks5Wvg4,8907
274
277
  astrbot/core/star/filter/command_group.py,sha256=JC_cMkOe-DCBDwqNGPDi_hDb0V8t_l4gqNRnkAb1CKA,5049
275
- astrbot/core/star/filter/custom_filter.py,sha256=vyMqtRoiLx3CtTHLqhqamKZSeSkoj2GnW4YMQ1ihbC8,2241
278
+ astrbot/core/star/filter/custom_filter.py,sha256=2SfHLrYJEuNceR81nzLRIhpcnx0J4AuXNCV4HP4kC2I,2241
276
279
  astrbot/core/star/filter/event_message_type.py,sha256=DMQy1463oTcwZbIZwbr4uxH7wIVkzsQ6bSe4aRrYn2M,1164
277
280
  astrbot/core/star/filter/permission.py,sha256=BYO9kd0coAJ4ayy0YOvTb4b35mavBSCKqR4mjm47jjQ,917
278
281
  astrbot/core/star/filter/platform_adapter_type.py,sha256=yTJDeYRY_nH-LhRkkMUb6n6W1toiyP_WUJo-maJq8xM,2100
279
282
  astrbot/core/star/filter/regex.py,sha256=GHB5YvBMLFbOOiFVUnEHaqHTER7sU1pAVrAcXdwBtkQ,545
280
283
  astrbot/core/star/register/__init__.py,sha256=U1LfqaZ5NbLj6lLuABLQHjpzh-x1qonR43oJMFn9rrc,1204
281
284
  astrbot/core/star/register/star.py,sha256=Eto7nD_HFuCNt-VJnXUXKv2D7a5TQ6qkhzLJ_itXo_8,1920
282
- astrbot/core/star/register/star_handler.py,sha256=sVHWtLvuACdJY-EpyHx650FTurm29zbcKxKOXUVl2Iw,20059
283
- astrbot/core/utils/astrbot_path.py,sha256=RhuIbIH9sWJQxJYbVkxwD0xBK4lG-ZSQGKg35mLdTpk,2526
285
+ astrbot/core/star/register/star_handler.py,sha256=qr0YFcNEiDWNbwgB3eDKfl5y79FrR-VYIQiXGzZE9zc,20058
286
+ astrbot/core/utils/astrbot_path.py,sha256=KPtOk8EpXC7_ThhCjtiXdxMZrXwWokRtxEWWm_v_cDY,2751
284
287
  astrbot/core/utils/command_parser.py,sha256=Cwd4zzyKEoC-er0a-9WZ5n2g4F8eH9p6BHxD96gjaVM,617
285
288
  astrbot/core/utils/file_extract.py,sha256=I9jgcaPYK74-BwuI18oUpoupnPYINeP3QFD3kFodqBA,697
286
289
  astrbot/core/utils/io.py,sha256=WUgM6V9_a-hi3CRKS9a-RFRAkZ5yu0M3WgpbR3-3tCw,10817
@@ -304,32 +307,34 @@ astrbot/core/utils/t2i/renderer.py,sha256=3IH-eLxOCIpEPHjXA1GF-ylGGyKz4GlMIbkjfv
304
307
  astrbot/core/utils/t2i/template_manager.py,sha256=Pfht7PZCdVteF93lja1LZQcUFNeCOKLs6EFx9XMeYKQ,4520
305
308
  astrbot/core/utils/t2i/template/astrbot_powershell.html,sha256=UcjetoIJG3pJRUHMDOor3Nhj7FFmVXXpkySkpXXztO4,4943
306
309
  astrbot/core/utils/t2i/template/base.html,sha256=fQvq4I4lrlH2s_jwAzj62lWeC4g87xXsYJMJ0XunCPA,6619
307
- astrbot/dashboard/server.py,sha256=eBKcTpN9qrzBlhREmhVe7X-lGvvuJXDWJfQenqQLuGE,10221
310
+ astrbot/dashboard/server.py,sha256=Xd5POZMZa8NCGLGhpLiaNc3chaphKU1bqVve9zwGvQw,10849
308
311
  astrbot/dashboard/utils.py,sha256=KrAv0lnPaVR0bx8yevT1CLGbSNsJizlfkKkPEtVVANI,5355
309
- astrbot/dashboard/routes/__init__.py,sha256=8cDzg025ESDCzqWk0ng3bwuC-lvDcbMudRWq4yH0HUA,1018
312
+ astrbot/dashboard/routes/__init__.py,sha256=nskGN0EwGPQAPNdZYySjKjQyusGsIYPOQ8HR1V6P3m4,1069
310
313
  astrbot/dashboard/routes/auth.py,sha256=rYkvt3MpCY9BhWjG0DUoX3YaBkJT1Id7M2pKqTmXbvo,2946
311
314
  astrbot/dashboard/routes/backup.py,sha256=npYpOdFAxcBmzPyTWtzAV1WtoO916Rv61CJgcfisHgU,39382
312
315
  astrbot/dashboard/routes/chat.py,sha256=4Mb3n6a2A8LSVvViEX3-FyN2BLl0eDtJd7aVK-cN6sY,31398
313
316
  astrbot/dashboard/routes/chatui_project.py,sha256=AUHP3fXNQ91nz0SGsICSeBfDgvKcz3AQtv-FVEAEfY0,8715
314
317
  astrbot/dashboard/routes/command.py,sha256=DYwcqUF1ibFVQ4qMX3Nob7f0Kz5HmQE0iBWrVNF3Hk8,2917
315
- astrbot/dashboard/routes/config.py,sha256=fAXfPhmR8_mlMTpA8ZIB5Gi9AHW5eMOgwvPR2Cfenf0,44787
318
+ astrbot/dashboard/routes/config.py,sha256=Xv6TOmL1JLNeVfxugWBd2f6Msmro9f-43x08xJINWFc,54146
316
319
  astrbot/dashboard/routes/conversation.py,sha256=TWGY7BJ9QfmbxurAieBrbMmCi4_Ua2klxsAUlSRXbng,14302
317
320
  astrbot/dashboard/routes/file.py,sha256=gULvXP9PnVOQlyv_PCEzZQE5ptnGQEjFPvwOLxdVgb4,708
318
321
  astrbot/dashboard/routes/knowledge_base.py,sha256=GZ_iDYV2uXXzvGMF-4VJ8hZxLdHIWSSfg_3wlWwsizA,46081
319
322
  astrbot/dashboard/routes/live_chat.py,sha256=3a1QdH0vz51xfd1e4VYKpYj19pw6ml69GlG4DYXbFIc,16029
320
323
  astrbot/dashboard/routes/log.py,sha256=YyRG6rrxxCAdbJP4dJyywP1CH_GwXrKCBr5XU_eo230,3335
321
- astrbot/dashboard/routes/persona.py,sha256=jmPolsvSNc6m_XME0pht_WpEtv7hlO7MRtllBY7zrSg,18229
324
+ astrbot/dashboard/routes/persona.py,sha256=HS3pT0WtcY-4T6a8cDBAtRqLx4cVjSJfpbfSUJERvM0,18555
322
325
  astrbot/dashboard/routes/platform.py,sha256=JfQzzmWSnahKjke3lBUeXo7Auzz_nTB0mUv0fIf_Nag,3392
323
326
  astrbot/dashboard/routes/plugin.py,sha256=qQvAtIY_33gF6F_D_iyQDbvrgO8t0IV_Gt6Qy_lcLlA,27475
324
327
  astrbot/dashboard/routes/route.py,sha256=vhNIWFhic1eVHRx7ej8OUmmcNDA3FPaRPdXO_-SS4K4,1572
325
328
  astrbot/dashboard/routes/session_management.py,sha256=KV1OhBbs0iTV3gv8NL1A5zzhyNVLrhbUKL9-L-2tEPM,36575
329
+ astrbot/dashboard/routes/skills.py,sha256=Obt6a_bbScQiiwU1TRbbq_QhhFGLxJolO-2eMjDbVSE,5761
326
330
  astrbot/dashboard/routes/stat.py,sha256=8t1VjuSjk1IomUpOS9EFLIqh5484TSIZX5VYGVTbNyc,11028
327
331
  astrbot/dashboard/routes/static_file.py,sha256=7KnNcOb1BVqSTft114LhGsDkfg69X2jHEm0tOK0kW0Y,1169
328
332
  astrbot/dashboard/routes/t2i.py,sha256=F6smxdL99MF7cRw3hqS6-2GErw8Zhsv0V0mfBUeEk-c,8931
329
333
  astrbot/dashboard/routes/tools.py,sha256=mMwVFw_VOlpqy_WZg1A-ddGtYa5L5QLWYawl37PT0-c,15354
330
334
  astrbot/dashboard/routes/update.py,sha256=qXiqQ_dbqRVftOzGgCQrvK8-qopVK6zKhhVVJ9SK26U,6648
331
- astrbot-4.12.4.dist-info/METADATA,sha256=F3LyvMIkm2z5QQBS3q68kY_8XpDcO9g6aeSauCDQdNc,12183
332
- astrbot-4.12.4.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
333
- astrbot-4.12.4.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
334
- astrbot-4.12.4.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
335
- astrbot-4.12.4.dist-info/RECORD,,
335
+ astrbot/dashboard/routes/util.py,sha256=Ewf5EgWs0evjOyIbgFffJH6T4DzgDrIoacd6VZ5Ix2c,2856
336
+ astrbot-4.13.0.dist-info/METADATA,sha256=Ml_PZSDNuEQ7wOV6WUIl2m99kC4mmJs3VelFiOolS_o,12183
337
+ astrbot-4.13.0.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
338
+ astrbot-4.13.0.dist-info/entry_points.txt,sha256=OEF09YmhBWYuViXrvTLLpstF4ccmNwDL8r7nnFD0pfI,53
339
+ astrbot-4.13.0.dist-info/licenses/LICENSE,sha256=zPfQj5Mq8-gThIiBcxETr7t8gND9bZWOjTGQAr80TQI,34500
340
+ astrbot-4.13.0.dist-info/RECORD,,
@@ -1,52 +0,0 @@
1
- import uuid
2
-
3
- from astrbot.api import logger
4
- from astrbot.core.star.context import Context
5
-
6
- from .booters.base import SandboxBooter
7
-
8
- session_booter: dict[str, SandboxBooter] = {}
9
-
10
-
11
- async def get_booter(
12
- context: Context,
13
- session_id: str,
14
- ) -> SandboxBooter:
15
- config = context.get_config(umo=session_id)
16
-
17
- sandbox_cfg = config.get("provider_settings", {}).get("sandbox", {})
18
- booter_type = sandbox_cfg.get("booter", "shipyard")
19
-
20
- if session_id in session_booter:
21
- booter = session_booter[session_id]
22
- if not await booter.available():
23
- # rebuild
24
- session_booter.pop(session_id, None)
25
- if session_id not in session_booter:
26
- uuid_str = uuid.uuid5(uuid.NAMESPACE_DNS, session_id).hex
27
- if booter_type == "shipyard":
28
- from .booters.shipyard import ShipyardBooter
29
-
30
- ep = sandbox_cfg.get("shipyard_endpoint", "")
31
- token = sandbox_cfg.get("shipyard_access_token", "")
32
- ttl = sandbox_cfg.get("shipyard_ttl", 3600)
33
- max_sessions = sandbox_cfg.get("shipyard_max_sessions", 10)
34
-
35
- client = ShipyardBooter(
36
- endpoint_url=ep, access_token=token, ttl=ttl, session_num=max_sessions
37
- )
38
- elif booter_type == "boxlite":
39
- from .booters.boxlite import BoxliteBooter
40
-
41
- client = BoxliteBooter()
42
- else:
43
- raise ValueError(f"Unknown booter type: {booter_type}")
44
-
45
- try:
46
- await client.boot(uuid_str)
47
- except Exception as e:
48
- logger.error(f"Error booting sandbox for session {session_id}: {e}")
49
- raise e
50
-
51
- session_booter[session_id] = client
52
- return session_booter[session_id]
@@ -1,74 +0,0 @@
1
- from dataclasses import dataclass, field
2
-
3
- import mcp
4
-
5
- from astrbot.api import FunctionTool
6
- from astrbot.core.agent.run_context import ContextWrapper
7
- from astrbot.core.agent.tool import ToolExecResult
8
- from astrbot.core.astr_agent_context import AstrAgentContext
9
- from astrbot.core.sandbox.sandbox_client import get_booter
10
-
11
-
12
- @dataclass
13
- class PythonTool(FunctionTool):
14
- name: str = "astrbot_execute_ipython"
15
- description: str = "Execute a command in an IPython shell."
16
- parameters: dict = field(
17
- default_factory=lambda: {
18
- "type": "object",
19
- "properties": {
20
- "code": {
21
- "type": "string",
22
- "description": "The Python code to execute.",
23
- },
24
- "silent": {
25
- "type": "boolean",
26
- "description": "Whether to suppress the output of the code execution.",
27
- "default": False,
28
- },
29
- },
30
- "required": ["code"],
31
- }
32
- )
33
-
34
- async def call(
35
- self, context: ContextWrapper[AstrAgentContext], code: str, silent: bool = False
36
- ) -> ToolExecResult:
37
- sb = await get_booter(
38
- context.context.context,
39
- context.context.event.unified_msg_origin,
40
- )
41
- try:
42
- result = await sb.python.exec(code, silent=silent)
43
- data = result.get("data", {})
44
- output = data.get("output", {})
45
- error = data.get("error", "")
46
- images: list[dict] = output.get("images", [])
47
- text: str = output.get("text", "")
48
-
49
- resp = mcp.types.CallToolResult(content=[])
50
-
51
- if error:
52
- resp.content.append(
53
- mcp.types.TextContent(type="text", text=f"error: {error}")
54
- )
55
-
56
- if images:
57
- for img in images:
58
- resp.content.append(
59
- mcp.types.ImageContent(
60
- type="image", data=img["image/png"], mimeType="image/png"
61
- )
62
- )
63
- if text:
64
- resp.content.append(mcp.types.TextContent(type="text", text=text))
65
-
66
- if not resp.content:
67
- resp.content.append(
68
- mcp.types.TextContent(type="text", text="No output.")
69
- )
70
-
71
- return resp
72
-
73
- except Exception as e:
74
- return f"Error executing code: {str(e)}"
File without changes
File without changes
File without changes
File without changes