myagent-ai 1.14.0 → 1.14.1
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.
|
Binary file
|
package/core/output_parser.py
CHANGED
|
@@ -485,6 +485,11 @@ def _fallback_regex_parse(raw_text: str) -> ParsedOutput:
|
|
|
485
485
|
}
|
|
486
486
|
)
|
|
487
487
|
|
|
488
|
+
# 如果正则回退成功提取到了关键内容(response、工具调用等),
|
|
489
|
+
# 则标记为解析成功,避免主循环误判为解析失败而中断执行
|
|
490
|
+
if parsed.response or parsed.tools_to_call or parsed.ask_user:
|
|
491
|
+
parsed.parse_success = True
|
|
492
|
+
|
|
488
493
|
return parsed
|
|
489
494
|
|
|
490
495
|
|
package/package.json
CHANGED
package/requirements.txt
CHANGED
|
@@ -50,6 +50,11 @@ discord.py>=2.3.0
|
|
|
50
50
|
# ============================================================
|
|
51
51
|
edge-tts>=6.1.0
|
|
52
52
|
|
|
53
|
+
# ============================================================
|
|
54
|
+
# 语音识别 (本地 STT,默认启用)
|
|
55
|
+
# ============================================================
|
|
56
|
+
faster-whisper>=1.0.0
|
|
57
|
+
|
|
53
58
|
# ============================================================
|
|
54
59
|
# Anthropic Claude (可选)
|
|
55
60
|
# ============================================================
|
package/setup.py
CHANGED
package/web/ui/chat/chat.css
CHANGED
|
@@ -455,7 +455,9 @@ input,textarea,select{font:inherit}
|
|
|
455
455
|
|
|
456
456
|
/* ── Message Content Smooth Render ── */
|
|
457
457
|
.message-content{
|
|
458
|
-
flex:1;min-width:0;
|
|
458
|
+
flex:1;min-width:0;width:100%;
|
|
459
|
+
/* 确保所有子元素(thought-block, bubble 等)撑满宽度 */
|
|
460
|
+
display:flex;flex-direction:column;align-items:stretch;
|
|
459
461
|
}
|
|
460
462
|
.stream-text-node{
|
|
461
463
|
display:inline;
|
|
@@ -469,7 +471,7 @@ input,textarea,select{font:inherit}
|
|
|
469
471
|
}
|
|
470
472
|
|
|
471
473
|
/* ── Thought Block (Agent Thinking) ── */
|
|
472
|
-
.thought-block{width:100%;display:block;margin:0 0 10px 0;border:1px solid var(--border-light);border-radius:var(--radius-sm);overflow:hidden;background:linear-gradient(135deg,var(--accent-light),var(--bg2));animation:thoughtFadeIn .4s ease-out}
|
|
474
|
+
.thought-block{width:100%;max-width:100%;display:block;margin:0 0 10px 0;border:1px solid var(--border-light);border-radius:var(--radius-sm);overflow:hidden;background:linear-gradient(135deg,var(--accent-light),var(--bg2));animation:thoughtFadeIn .4s ease-out;flex-shrink:0;box-sizing:border-box}
|
|
473
475
|
.thought-block.streaming{border-color:var(--accent);box-shadow:0 0 12px rgba(99,102,241,.15)}
|
|
474
476
|
@keyframes thoughtFadeIn{from{opacity:0;transform:translateY(-6px)}to{opacity:1;transform:translateY(0)}}
|
|
475
477
|
.thought-block summary{display:flex;align-items:center;gap:8px;padding:8px 14px;cursor:pointer;font-size:12px;font-weight:600;color:var(--text2);user-select:none;transition:var(--transition);text-transform:uppercase;letter-spacing:.3px}
|
package/web/ui/chat/chat_main.js
CHANGED
|
@@ -353,14 +353,17 @@ function initChat() {
|
|
|
353
353
|
}
|
|
354
354
|
|
|
355
355
|
// 如果 URL 指定了 agent 或 session,等 agent 列表加载后自动选中
|
|
356
|
-
|
|
356
|
+
// 注意:loadSessions() 内部会检查 URL session 参数并自动恢复
|
|
357
|
+
if (urlAgent) {
|
|
357
358
|
const targetAgent = urlAgent || (urlSession ? urlSession.split('_web_')[0] || 'default' : null);
|
|
358
359
|
setTimeout(function() {
|
|
359
360
|
if (targetAgent) selectAgent(targetAgent);
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
361
|
+
}, 500);
|
|
362
|
+
} else if (urlSession) {
|
|
363
|
+
// 只有 session 没有 agent,尝试从 session ID 推断 agent
|
|
364
|
+
const targetAgent = urlSession.split('_web_')[0] || 'default';
|
|
365
|
+
setTimeout(function() {
|
|
366
|
+
selectAgent(targetAgent);
|
|
364
367
|
}, 500);
|
|
365
368
|
}
|
|
366
369
|
}
|
|
@@ -1581,7 +1584,13 @@ async function loadSessions() {
|
|
|
1581
1584
|
updateSidebarAgentIndicator();
|
|
1582
1585
|
|
|
1583
1586
|
// Auto-select most recent session if none selected
|
|
1584
|
-
|
|
1587
|
+
// 优先检查 URL 参数指定的 session(页面刷新恢复)
|
|
1588
|
+
const urlParams = new URLSearchParams(window.location.search);
|
|
1589
|
+
const urlSession = urlParams.get('session');
|
|
1590
|
+
if (urlSession && state.sessions.some(s => s.id === urlSession)) {
|
|
1591
|
+
// URL 指定了有效的 session ID,直接选中(刷新恢复)
|
|
1592
|
+
await selectSession(urlSession);
|
|
1593
|
+
} else if (!state.activeSessionId && state.sessions.length > 0) {
|
|
1585
1594
|
await selectSession(state.sessions[0].id);
|
|
1586
1595
|
}
|
|
1587
1596
|
}
|