mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-10-10 18:04:11 +02:00
Add files via upload
This commit is contained in:
6 files changed
+77
-16
No files matched your search
@@ -1690,8 +1690,8 @@
|
|||||||
"multiAgentPeLoop": "plan_execute outer loop limit",
|
"multiAgentPeLoop": "plan_execute outer loop limit",
|
||||||
"multiAgentPeLoopPlaceholder": "0 uses Eino default (10)",
|
"multiAgentPeLoopPlaceholder": "0 uses Eino default (10)",
|
||||||
"multiAgentPeLoopHint": "Only for plan_execute; max execute↔replan rounds.",
|
"multiAgentPeLoopHint": "Only for plan_execute; max execute↔replan rounds.",
|
||||||
"multiAgentRobotUse": "Use multi-agent for WeCom / DingTalk / Lark bots",
|
"multiAgentRobotMode": "Default conversation mode for bots",
|
||||||
"multiAgentRobotUseHint": "Requires 'Enable multi-agent' to be checked; usage and cost will be higher.",
|
"multiAgentRobotModeHint": "Execution mode for WeCom / DingTalk / Lark bot messages. Deep / Plan-Execute / Supervisor require multi-agent to be enabled.",
|
||||||
"multiAgentBatchUse": "Use multi-agent for batch task queues",
|
"multiAgentBatchUse": "Use multi-agent for batch task queues",
|
||||||
"multiAgentBatchUseHint": "When enabled, each sub-task executed by queue in Task Management will run through Eino DeepAgent (requires multi-agent).",
|
"multiAgentBatchUseHint": "When enabled, each sub-task executed by queue in Task Management will run through Eino DeepAgent (requires multi-agent).",
|
||||||
"enableKnowledge": "Enable knowledge retrieval",
|
"enableKnowledge": "Enable knowledge retrieval",
|
||||||
|
|||||||
@@ -1679,8 +1679,8 @@
|
|||||||
"multiAgentPeLoop": "plan_execute 外层循环上限",
|
"multiAgentPeLoop": "plan_execute 外层循环上限",
|
||||||
"multiAgentPeLoopPlaceholder": "0 表示 Eino 默认 10",
|
"multiAgentPeLoopPlaceholder": "0 表示 Eino 默认 10",
|
||||||
"multiAgentPeLoopHint": "仅 plan_execute 有效;execute 与 replan 之间的最大轮次。",
|
"multiAgentPeLoopHint": "仅 plan_execute 有效;execute 与 replan 之间的最大轮次。",
|
||||||
"multiAgentRobotUse": "企业微信 / 钉钉 / 飞书机器人也使用多代理",
|
"multiAgentRobotMode": "机器人默认对话模式",
|
||||||
"multiAgentRobotUseHint": "需同时勾选「启用多代理」;调用量与成本更高。",
|
"multiAgentRobotModeHint": "企业微信 / 钉钉 / 飞书机器人每条消息使用的执行模式;Deep / Plan-Execute / Supervisor 需启用多代理。",
|
||||||
"multiAgentBatchUse": "批量任务队列也使用多代理",
|
"multiAgentBatchUse": "批量任务队列也使用多代理",
|
||||||
"multiAgentBatchUseHint": "开启后,任务管理中按队列执行的每个子任务将走 Eino DeepAgent(需启用多代理)。",
|
"multiAgentBatchUseHint": "开启后,任务管理中按队列执行的每个子任务将走 Eino DeepAgent(需启用多代理)。",
|
||||||
"enableKnowledge": "启用知识检索功能",
|
"enableKnowledge": "启用知识检索功能",
|
||||||
|
|||||||
@@ -3064,6 +3064,27 @@ function getConversationGroup(dateObj, todayStart, sevenDaysCutoff, yesterdaySta
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 加载对话
|
// 加载对话
|
||||||
|
/** 轻量加载会话后,拉取最后一条助手消息的 process_details(机器人等无 SSE 场景) */
|
||||||
|
async function prefetchLastAssistantProcessDetails() {
|
||||||
|
const nodes = document.querySelectorAll('#chat-messages .message.assistant');
|
||||||
|
if (!nodes.length) return;
|
||||||
|
const last = nodes[nodes.length - 1];
|
||||||
|
if (!last || !last.id) return;
|
||||||
|
const container = document.getElementById('process-details-' + last.id);
|
||||||
|
if (!container || container.dataset.lazyNotLoaded !== '1') return;
|
||||||
|
const backendId = last.dataset && last.dataset.backendMessageId;
|
||||||
|
if (!backendId || typeof apiFetch !== 'function') return;
|
||||||
|
const res = await apiFetch('/api/messages/' + encodeURIComponent(String(backendId)) + '/process-details');
|
||||||
|
const j = await res.json().catch(() => ({}));
|
||||||
|
if (!res.ok || !Array.isArray(j.processDetails) || j.processDetails.length === 0) return;
|
||||||
|
if (typeof renderProcessDetails === 'function') {
|
||||||
|
renderProcessDetails(last.id, j.processDetails);
|
||||||
|
}
|
||||||
|
if (typeof window.expandProcessDetailsTimeline === 'function') {
|
||||||
|
window.expandProcessDetailsTimeline(last.id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
async function loadConversation(conversationId) {
|
async function loadConversation(conversationId) {
|
||||||
const seq = ++loadConversationRequestSeq;
|
const seq = ++loadConversationRequestSeq;
|
||||||
try {
|
try {
|
||||||
@@ -3283,6 +3304,11 @@ async function loadConversation(conversationId) {
|
|||||||
.catch((e) => {
|
.catch((e) => {
|
||||||
console.warn('attachRunningTaskEventStream on loadConversation failed', e);
|
console.warn('attachRunningTaskEventStream on loadConversation failed', e);
|
||||||
});
|
});
|
||||||
|
} else if (seq === loadConversationRequestSeq && currentConversationId === conversationId) {
|
||||||
|
// 机器人等非 Web 流式来源:会话已结束或未注册任务时,按需拉取最后一条助手消息的过程详情
|
||||||
|
prefetchLastAssistantProcessDetails().catch((e) => {
|
||||||
|
console.warn('prefetchLastAssistantProcessDetails failed', e);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('加载对话失败:', error);
|
console.error('加载对话失败:', error);
|
||||||
|
|||||||
@@ -2511,6 +2511,7 @@ async function attachRunningTaskEventStream(conversationId) {
|
|||||||
|
|
||||||
window.attachRunningTaskEventStream = attachRunningTaskEventStream;
|
window.attachRunningTaskEventStream = attachRunningTaskEventStream;
|
||||||
window.taskReplayProgressId = taskReplayProgressId;
|
window.taskReplayProgressId = taskReplayProgressId;
|
||||||
|
window.expandProcessDetailsTimeline = expandProcessDetailsTimeline;
|
||||||
|
|
||||||
/** 从工具参数提取短摘要(URL/命令等),便于同名工具批量调用时区分 */
|
/** 从工具参数提取短摘要(URL/命令等),便于同名工具批量调用时区分 */
|
||||||
function parseToolCallArgsFromData(data) {
|
function parseToolCallArgsFromData(data) {
|
||||||
|
|||||||
@@ -31,6 +31,19 @@ let toolsPagination = {
|
|||||||
|
|
||||||
let c2NavSyncedOnce = false;
|
let c2NavSyncedOnce = false;
|
||||||
|
|
||||||
|
/** 根据是否启用多代理,禁用/启用机器人模式中的 Eino 编排选项 */
|
||||||
|
function syncRobotAgentModeSelectOptions(multiEnabled) {
|
||||||
|
const sel = document.getElementById('multi-agent-robot-mode');
|
||||||
|
if (!sel) return;
|
||||||
|
['deep', 'plan_execute', 'supervisor'].forEach(function (v) {
|
||||||
|
const opt = sel.querySelector('option[value="' + v + '"]');
|
||||||
|
if (opt) opt.disabled = !multiEnabled;
|
||||||
|
});
|
||||||
|
if (!multiEnabled && ['deep', 'plan_execute', 'supervisor'].indexOf(sel.value) >= 0) {
|
||||||
|
sel.value = 'react';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** 首次进入仪表盘等页面前拉一次配置,隐藏侧栏 C2(避免禁用后仍显示) */
|
/** 首次进入仪表盘等页面前拉一次配置,隐藏侧栏 C2(避免禁用后仍显示) */
|
||||||
window.syncC2NavOnceFromServer = async function syncC2NavOnceFromServer() {
|
window.syncC2NavOnceFromServer = async function syncC2NavOnceFromServer() {
|
||||||
if (c2NavSyncedOnce || typeof apiFetch === 'undefined') {
|
if (c2NavSyncedOnce || typeof apiFetch === 'undefined') {
|
||||||
@@ -198,14 +211,27 @@ async function loadConfig(loadTools = true) {
|
|||||||
|
|
||||||
const ma = currentConfig.multi_agent || {};
|
const ma = currentConfig.multi_agent || {};
|
||||||
const maEn = document.getElementById('multi-agent-enabled');
|
const maEn = document.getElementById('multi-agent-enabled');
|
||||||
if (maEn) maEn.checked = ma.enabled === true;
|
if (maEn) {
|
||||||
|
maEn.checked = ma.enabled === true;
|
||||||
|
if (!maEn.dataset.robotModeBound) {
|
||||||
|
maEn.dataset.robotModeBound = '1';
|
||||||
|
maEn.addEventListener('change', function () {
|
||||||
|
syncRobotAgentModeSelectOptions(maEn.checked);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
const maPeLoop = document.getElementById('multi-agent-pe-loop');
|
const maPeLoop = document.getElementById('multi-agent-pe-loop');
|
||||||
if (maPeLoop) {
|
if (maPeLoop) {
|
||||||
const v = ma.plan_execute_loop_max_iterations;
|
const v = ma.plan_execute_loop_max_iterations;
|
||||||
maPeLoop.value = (v !== undefined && v !== null && !Number.isNaN(Number(v))) ? String(Number(v)) : '0';
|
maPeLoop.value = (v !== undefined && v !== null && !Number.isNaN(Number(v))) ? String(Number(v)) : '0';
|
||||||
}
|
}
|
||||||
const maRobot = document.getElementById('multi-agent-robot-use');
|
const maRobotMode = document.getElementById('multi-agent-robot-mode');
|
||||||
if (maRobot) maRobot.checked = ma.robot_use_multi_agent === true;
|
if (maRobotMode) {
|
||||||
|
let mode = (ma.robot_default_agent_mode || 'react').trim().toLowerCase();
|
||||||
|
if (mode === 'single') mode = 'react';
|
||||||
|
maRobotMode.value = mode;
|
||||||
|
syncRobotAgentModeSelectOptions(ma.enabled === true);
|
||||||
|
}
|
||||||
|
|
||||||
// 填充知识库配置
|
// 填充知识库配置
|
||||||
const knowledgeEnabledCheckbox = document.getElementById('knowledge-enabled');
|
const knowledgeEnabledCheckbox = document.getElementById('knowledge-enabled');
|
||||||
@@ -1133,9 +1159,14 @@ async function applySettings() {
|
|||||||
const peRaw = document.getElementById('multi-agent-pe-loop')?.value;
|
const peRaw = document.getElementById('multi-agent-pe-loop')?.value;
|
||||||
const peParsed = parseInt(peRaw, 10);
|
const peParsed = parseInt(peRaw, 10);
|
||||||
const peLoop = Number.isNaN(peParsed) ? 0 : Math.max(0, peParsed);
|
const peLoop = Number.isNaN(peParsed) ? 0 : Math.max(0, peParsed);
|
||||||
|
const maEnabled = document.getElementById('multi-agent-enabled')?.checked === true;
|
||||||
|
let robotMode = document.getElementById('multi-agent-robot-mode')?.value || 'react';
|
||||||
|
if (!maEnabled && ['deep', 'plan_execute', 'supervisor'].indexOf(robotMode) >= 0) {
|
||||||
|
robotMode = 'react';
|
||||||
|
}
|
||||||
return {
|
return {
|
||||||
enabled: document.getElementById('multi-agent-enabled')?.checked === true,
|
enabled: maEnabled,
|
||||||
robot_use_multi_agent: document.getElementById('multi-agent-robot-use')?.checked === true,
|
robot_default_agent_mode: robotMode,
|
||||||
batch_use_multi_agent: currentConfig?.multi_agent?.batch_use_multi_agent === true,
|
batch_use_multi_agent: currentConfig?.multi_agent?.batch_use_multi_agent === true,
|
||||||
plan_execute_loop_max_iterations: peLoop
|
plan_execute_loop_max_iterations: peLoop
|
||||||
};
|
};
|
||||||
@@ -1384,7 +1415,7 @@ async function saveToolsConfig() {
|
|||||||
agent: currentConfig.agent || {},
|
agent: currentConfig.agent || {},
|
||||||
multi_agent: {
|
multi_agent: {
|
||||||
enabled: currentConfig?.multi_agent?.enabled === true,
|
enabled: currentConfig?.multi_agent?.enabled === true,
|
||||||
robot_use_multi_agent: currentConfig?.multi_agent?.robot_use_multi_agent === true,
|
robot_default_agent_mode: currentConfig?.multi_agent?.robot_default_agent_mode || 'react',
|
||||||
batch_use_multi_agent: currentConfig?.multi_agent?.batch_use_multi_agent === true,
|
batch_use_multi_agent: currentConfig?.multi_agent?.batch_use_multi_agent === true,
|
||||||
plan_execute_loop_max_iterations: Number(currentConfig?.multi_agent?.plan_execute_loop_max_iterations || 0),
|
plan_execute_loop_max_iterations: Number(currentConfig?.multi_agent?.plan_execute_loop_max_iterations || 0),
|
||||||
tool_search_always_visible_tools: Array.from(alwaysVisibleToolNames).filter(name => !alwaysVisibleBuiltinToolNames.has(name))
|
tool_search_always_visible_tools: Array.from(alwaysVisibleToolNames).filter(name => !alwaysVisibleBuiltinToolNames.has(name))
|
||||||
|
|||||||
@@ -2144,12 +2144,15 @@
|
|||||||
<small class="form-hint" data-i18n="settingsBasic.multiAgentPeLoopHint">仅 orchestration=plan_execute 时有效;execute 与 replan 之间的最大轮次。</small>
|
<small class="form-hint" data-i18n="settingsBasic.multiAgentPeLoopHint">仅 orchestration=plan_execute 时有效;execute 与 replan 之间的最大轮次。</small>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="checkbox-label">
|
<label for="multi-agent-robot-mode" data-i18n="settingsBasic.multiAgentRobotMode">机器人默认对话模式</label>
|
||||||
<input type="checkbox" id="multi-agent-robot-use" class="modern-checkbox" />
|
<select id="multi-agent-robot-mode" class="form-select">
|
||||||
<span class="checkbox-custom"></span>
|
<option value="react" data-i18n="chat.agentModeReactNative">原生 ReAct</option>
|
||||||
<span class="checkbox-text" data-i18n="settingsBasic.multiAgentRobotUse">企业微信 / 钉钉 / 飞书机器人也使用多代理</span>
|
<option value="eino_single" data-i18n="chat.agentModeEinoSingle">Eino 单代理(ADK)</option>
|
||||||
</label>
|
<option value="deep" data-i18n="chat.agentModeDeep">Deep(DeepAgent)</option>
|
||||||
<small class="form-hint" data-i18n="settingsBasic.multiAgentRobotUseHint">需同时勾选「启用多代理」;调用量与成本更高。</small>
|
<option value="plan_execute" data-i18n="chat.agentModePlanExecuteLabel">Plan-Execute</option>
|
||||||
|
<option value="supervisor" data-i18n="chat.agentModeSupervisorLabel">Supervisor</option>
|
||||||
|
</select>
|
||||||
|
<small class="form-hint" data-i18n="settingsBasic.multiAgentRobotModeHint">企业微信 / 钉钉 / 飞书机器人每条消息使用的执行模式;Deep / Plan-Execute / Supervisor 需启用多代理。</small>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
Reference in new issue
Block a user