myagent-ai 1.15.96 → 1.15.98
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.
- package/core/update_manager.py +18 -0
- package/main.py +1 -1
- package/package.json +1 -1
- package/web/ui/chat/flow_engine.js +33 -4
package/core/update_manager.py
CHANGED
|
@@ -1101,6 +1101,24 @@ class UpdateManager:
|
|
|
1101
1101
|
|
|
1102
1102
|
async def _auto_check_loop(self):
|
|
1103
1103
|
"""后台自动检查循环"""
|
|
1104
|
+
# [v1.15.97] 启动后立即执行一次检查,不等间隔
|
|
1105
|
+
try:
|
|
1106
|
+
logger.info("执行启动时版本检查...")
|
|
1107
|
+
info = await self.check_for_update()
|
|
1108
|
+
if info.has_update:
|
|
1109
|
+
logger.info(
|
|
1110
|
+
f"发现新版本: {info.latest_version} "
|
|
1111
|
+
f"(当前: {info.current_version})"
|
|
1112
|
+
)
|
|
1113
|
+
try:
|
|
1114
|
+
await self.apply_update(UpdateType.FULL)
|
|
1115
|
+
except Exception as e:
|
|
1116
|
+
logger.error(f"自动更新失败: {e}")
|
|
1117
|
+
except asyncio.CancelledError:
|
|
1118
|
+
return
|
|
1119
|
+
except Exception as e:
|
|
1120
|
+
logger.error(f"启动时检查异常: {e}")
|
|
1121
|
+
|
|
1104
1122
|
while self._auto_check_enabled:
|
|
1105
1123
|
try:
|
|
1106
1124
|
await asyncio.sleep(self._auto_check_interval)
|
package/main.py
CHANGED
|
@@ -1518,7 +1518,7 @@ def main():
|
|
|
1518
1518
|
|
|
1519
1519
|
# 启动自动更新检查(后台)
|
|
1520
1520
|
if app.update_manager:
|
|
1521
|
-
asyncio.create_task(app.update_manager.start_auto_check(interval=
|
|
1521
|
+
asyncio.create_task(app.update_manager.start_auto_check(interval=600))
|
|
1522
1522
|
|
|
1523
1523
|
app._running_service = web_port or app.chat_manager
|
|
1524
1524
|
if args.tray:
|
package/package.json
CHANGED
|
@@ -981,8 +981,23 @@ function renderInlineExecEvent(data, msgIdx) {
|
|
|
981
981
|
|
|
982
982
|
function showExecResultModal(msgIndex, eventId) {
|
|
983
983
|
const msg = state.messages[msgIndex];
|
|
984
|
-
if (!msg
|
|
985
|
-
|
|
984
|
+
if (!msg) return;
|
|
985
|
+
|
|
986
|
+
// 先尝试从 exec_events 查找(旧格式)
|
|
987
|
+
let evt = null;
|
|
988
|
+
if (msg.exec_events) {
|
|
989
|
+
evt = msg.exec_events.find(e => String(e.id) === String(eventId));
|
|
990
|
+
}
|
|
991
|
+
// 再从 parts 查找(V2 格式)
|
|
992
|
+
if (!evt && msg.parts) {
|
|
993
|
+
for (const part of msg.parts) {
|
|
994
|
+
const inner = (part.type === 'v2_tool') ? part.data : (part.type === 'exec') ? part.data : null;
|
|
995
|
+
if (inner && String(inner.id) === String(eventId)) {
|
|
996
|
+
evt = inner;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
986
1001
|
if (!evt) return;
|
|
987
1002
|
|
|
988
1003
|
const lang = evt.language || 'unknown';
|
|
@@ -1070,8 +1085,22 @@ function switchExecResultTab(tabId) {
|
|
|
1070
1085
|
|
|
1071
1086
|
function showToolResultModal(msgIndex, eventId) {
|
|
1072
1087
|
const msg = state.messages[msgIndex];
|
|
1073
|
-
if (!msg
|
|
1074
|
-
|
|
1088
|
+
if (!msg) return;
|
|
1089
|
+
|
|
1090
|
+
// 先尝试从 exec_events 查找(旧格式)
|
|
1091
|
+
let evt = null;
|
|
1092
|
+
if (msg.exec_events) {
|
|
1093
|
+
evt = msg.exec_events.find(e => String(e.id) === String(eventId));
|
|
1094
|
+
}
|
|
1095
|
+
// 再从 parts 查找(V2 格式:{type:'v2_tool', data:{id, tool_name, ...}})
|
|
1096
|
+
if (!evt && msg.parts) {
|
|
1097
|
+
for (const part of msg.parts) {
|
|
1098
|
+
if (part.type === 'v2_tool' && part.data && String(part.data.id) === String(eventId)) {
|
|
1099
|
+
evt = part.data;
|
|
1100
|
+
break;
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1075
1104
|
if (!evt) return;
|
|
1076
1105
|
|
|
1077
1106
|
const title = evt.title || (evt.tool_name || evt.skill_name || '工具调用');
|