Skip to content

Commit 60577d9

Browse files
authored
Merge branch 'master' into refactor/subagent-orchestration
2 parents 30952c0 + 101580f commit 60577d9

26 files changed

Lines changed: 2124 additions & 101 deletions

File tree

.github/workflows/dashboard_ci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
zip -r dist.zip dist
3737
3838
- name: Archive production artifacts
39-
uses: actions/upload-artifact@v6
39+
uses: actions/upload-artifact@v7
4040
with:
4141
name: dist-without-markdown
4242
path: |

.github/workflows/release.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
zip -r "AstrBot-${{ steps.tag.outputs.tag }}-dashboard.zip" dist
7272
7373
- name: Upload dashboard artifact
74-
uses: actions/upload-artifact@v6
74+
uses: actions/upload-artifact@v7
7575
with:
7676
name: Dashboard-${{ steps.tag.outputs.tag }}
7777
if-no-files-found: error
@@ -132,7 +132,7 @@ jobs:
132132
echo "tag=$tag" >> "$GITHUB_OUTPUT"
133133
134134
- name: Download dashboard artifact
135-
uses: actions/download-artifact@v7
135+
uses: actions/download-artifact@v8
136136
with:
137137
name: Dashboard-${{ steps.tag.outputs.tag }}
138138
path: release-assets

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,13 @@ Connect AstrBot to your favorite chat platform.
184184
| Minimax TTS | Text-to-Speech Services |
185185
| Volcano Engine TTS | Text-to-Speech Services |
186186

187+
## ❤️ Sponsors
188+
189+
<p align="center">
190+
<img alt="sponsors" src="https://sponsors.astrbot.app/?v=1">
191+
</p>
192+
193+
187194
## ❤️ Contributing
188195

189196
Issues and Pull Requests are always welcome! Feel free to submit your changes to this project :)
@@ -202,6 +209,7 @@ pip install pre-commit
202209
pre-commit install
203210
```
204211

212+
205213
## 🌍 Community
206214

207215
### QQ Groups

astrbot/core/computer/computer_client.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import json
2+
import os
23
import shutil
34
import uuid
45
from pathlib import Path
@@ -41,8 +42,6 @@ def _discover_bay_credentials(endpoint: str) -> str:
4142
Returns:
4243
API key string, or empty string if not found.
4344
"""
44-
import os
45-
4645
candidates: list[Path] = []
4746

4847
# 1. BAY_DATA_DIR env var

astrbot/core/computer/tools/python.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import platform
12
from dataclasses import dataclass, field
23

34
import mcp
@@ -10,6 +11,8 @@
1011
from astrbot.core.computer.tools.permissions import check_admin_permission
1112
from astrbot.core.message.message_event_result import MessageChain
1213

14+
_OS_NAME = platform.system()
15+
1316
param_schema = {
1417
"type": "object",
1518
"properties": {
@@ -61,7 +64,7 @@ async def handle_result(result: dict, event: AstrMessageEvent) -> ToolExecResult
6164
@dataclass
6265
class PythonTool(FunctionTool):
6366
name: str = "astrbot_execute_ipython"
64-
description: str = "Run codes in an IPython shell."
67+
description: str = f"Run codes in an IPython shell. Current OS: {_OS_NAME}."
6568
parameters: dict = field(default_factory=lambda: param_schema)
6669

6770
async def call(
@@ -83,7 +86,10 @@ async def call(
8386
@dataclass
8487
class LocalPythonTool(FunctionTool):
8588
name: str = "astrbot_execute_python"
86-
description: str = "Execute codes in a Python environment."
89+
description: str = (
90+
f"Execute codes in a Python environment. Current OS: {_OS_NAME}. "
91+
"Use system-compatible commands."
92+
)
8793

8894
parameters: dict = field(default_factory=lambda: param_schema)
8995

astrbot/core/config/default.py

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -462,6 +462,20 @@ class ChatProviderTemplate(TypedDict):
462462
"satori_heartbeat_interval": 10,
463463
"satori_reconnect_delay": 5,
464464
},
465+
"kook": {
466+
"id": "kook",
467+
"type": "kook",
468+
"enable": False,
469+
"kook_bot_token": "",
470+
"kook_bot_nickname": "",
471+
"kook_reconnect_delay": 1,
472+
"kook_max_reconnect_delay": 60,
473+
"kook_max_retry_delay": 60,
474+
"kook_heartbeat_interval": 30,
475+
"kook_heartbeat_timeout": 6,
476+
"kook_max_heartbeat_failures": 3,
477+
"kook_max_consecutive_failures": 5,
478+
},
465479
# "WebChat": {
466480
# "id": "webchat",
467481
# "type": "webchat",
@@ -803,6 +817,51 @@ class ChatProviderTemplate(TypedDict):
803817
"type": "string",
804818
"hint": "统一 Webhook 模式下的唯一标识符,创建平台时自动生成。",
805819
},
820+
"kook_bot_token": {
821+
"description": "机器人 Token",
822+
"type": "string",
823+
"hint": "必填项。从 KOOK 开发者平台获取的机器人 Token。",
824+
},
825+
"kook_bot_nickname": {
826+
"description": "Bot Nickname",
827+
"type": "string",
828+
"hint": "可选项。若发送者昵称与此值一致,将忽略该消息以避免广播风暴。",
829+
},
830+
"kook_reconnect_delay": {
831+
"description": "重连延迟",
832+
"type": "int",
833+
"hint": "重连延迟时间(秒),使用指数退避策略。",
834+
},
835+
"kook_max_reconnect_delay": {
836+
"description": "最大重连延迟",
837+
"type": "int",
838+
"hint": "重连延迟的最大值(秒)。",
839+
},
840+
"kook_max_retry_delay": {
841+
"description": "最大重试延迟",
842+
"type": "int",
843+
"hint": "重试的最大延迟时间(秒)。",
844+
},
845+
"kook_heartbeat_interval": {
846+
"description": "心跳间隔",
847+
"type": "int",
848+
"hint": "心跳检测间隔时间(秒)。",
849+
},
850+
"kook_heartbeat_timeout": {
851+
"description": "心跳超时时间",
852+
"type": "int",
853+
"hint": "心跳检测超时时间(秒)。",
854+
},
855+
"kook_max_heartbeat_failures": {
856+
"description": "最大心跳失败次数",
857+
"type": "int",
858+
"hint": "允许的最大心跳失败次数,超过后断开连接。",
859+
},
860+
"kook_max_consecutive_failures": {
861+
"description": "最大连续失败次数",
862+
"type": "int",
863+
"hint": "允许的最大连续失败次数,超过后停止重试。",
864+
},
806865
},
807866
},
808867
"platform_settings": {

astrbot/core/platform/manager.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,10 @@ async def load_platform(self, platform_config: dict) -> None:
180180
from .sources.line.line_adapter import (
181181
LinePlatformAdapter, # noqa: F401
182182
)
183+
case "kook":
184+
from .sources.kook.kook_adapter import (
185+
KookPlatformAdapter, # noqa: F401
186+
)
183187
except (ImportError, ModuleNotFoundError) as e:
184188
logger.error(
185189
f"加载平台适配器 {platform_config['type']} 失败,原因:{e}。请检查依赖库是否安装。提示:可以在 管理面板->平台日志->安装Pip库 中安装依赖库。",

0 commit comments

Comments
 (0)