mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-07-20 02:47:39 +02:00
Add files via upload
This commit is contained in:
@@ -2252,10 +2252,22 @@ async function syncAssistantReasoningContentFromServer(backendMessageId, domAssi
|
||||
window.normalizeReasoningContentForDisplay = normalizeReasoningContentForDisplay;
|
||||
window.setMessageReasoningContent = setMessageReasoningContent;
|
||||
window.getMessageReasoningContent = getMessageReasoningContent;
|
||||
window.filterNoiseProcessDetails = filterNoiseProcessDetails;
|
||||
window.mergeMessageReasoningContentIntoProcessDetails = mergeMessageReasoningContentIntoProcessDetails;
|
||||
window.syncAssistantReasoningContentFromServer = syncAssistantReasoningContentFromServer;
|
||||
|
||||
/** 相邻且类型/正文/data 完全一致的过程详情只保留一条(与后端去重一致,避免时间线叠多条相同块) */
|
||||
function isEinoAgentHeartbeatProgress(detail) {
|
||||
if (!detail || detail.eventType !== 'progress') return false;
|
||||
const msg = String(detail.message != null ? detail.message : '').trim();
|
||||
return /^\[Eino\]\s+\S/.test(msg);
|
||||
}
|
||||
|
||||
function filterNoiseProcessDetails(details) {
|
||||
if (!Array.isArray(details)) return details;
|
||||
return details.filter(function (d) { return !isEinoAgentHeartbeatProgress(d); });
|
||||
}
|
||||
|
||||
function dedupeConsecutiveProcessDetailRows(details) {
|
||||
if (!Array.isArray(details) || details.length < 2) {
|
||||
return details;
|
||||
@@ -2394,6 +2406,7 @@ function renderProcessDetails(messageId, processDetails) {
|
||||
detailsContainer.dataset.loaded = '1';
|
||||
}
|
||||
processDetails = mergeMessageReasoningContentIntoProcessDetails(processDetails, reasoningFromMessage);
|
||||
processDetails = filterNoiseProcessDetails(processDetails);
|
||||
processDetails = dedupeConsecutiveProcessDetailRows(processDetails);
|
||||
if (typeof window.coalesceProcessDetailsToolPairs === 'function') {
|
||||
processDetails = window.coalesceProcessDetailsToolPairs(processDetails);
|
||||
|
||||
@@ -1989,6 +1989,10 @@ function buildWebshellTimelineItemFromDetail(detail) {
|
||||
// 渲染「执行过程及调用工具」折叠块(默认折叠,刷新后加载历史时保留并可展开)
|
||||
function renderWebshellProcessDetailsBlock(processDetails, defaultCollapsed) {
|
||||
if (!processDetails || processDetails.length === 0) return null;
|
||||
if (typeof window.filterNoiseProcessDetails === 'function') {
|
||||
processDetails = window.filterNoiseProcessDetails(processDetails);
|
||||
}
|
||||
if (!processDetails.length) return null;
|
||||
if (typeof window.coalesceProcessDetailsToolPairs === 'function') {
|
||||
processDetails = window.coalesceProcessDetailsToolPairs(processDetails);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user