mirror of
https://github.com/Ed1s0nZ/CyberStrikeAI.git
synced 2026-06-03 21:08:08 +02:00
Add files via upload
This commit is contained in:
@@ -501,8 +501,6 @@
|
||||
"historyGroupEarlier": "Older",
|
||||
"agentModeSelectAria": "Choose conversation execution mode",
|
||||
"agentModePanelTitle": "Conversation mode",
|
||||
"agentModeReactNative": "Native ReAct",
|
||||
"agentModeReactNativeHint": "Classic single-agent ReAct with MCP tools",
|
||||
"agentModeEinoSingle": "Eino single (ADK)",
|
||||
"agentModeEinoSingleHint": "Eino ChatModelAgent + Runner with MCP tools (/api/eino-agent)",
|
||||
"agentModeDeep": "Deep (DeepAgent)",
|
||||
@@ -513,7 +511,7 @@
|
||||
"agentModeSupervisorHint": "Supervisor coordinates via transfer to sub-agents",
|
||||
"agentModeSingle": "Single-agent",
|
||||
"agentModeMulti": "Multi-agent",
|
||||
"agentModeSingleHint": "Single-model ReAct loop for chat and tool use",
|
||||
"agentModeSingleHint": "Eino ADK single-agent for chat and tool use",
|
||||
"agentModeMultiHint": "Eino prebuilt orchestration (deep / plan_execute / supervisor) for complex tasks",
|
||||
"reasoningModeLabel": "Model reasoning",
|
||||
"reasoningEffortLabel": "Reasoning effort",
|
||||
@@ -2289,9 +2287,9 @@
|
||||
"projectNone": "(Unbound)",
|
||||
"projectHint": "Optionally bind this queue to a project; leave empty to keep it unbound.",
|
||||
"agentMode": "Agent mode",
|
||||
"agentModeSingle": "Single-agent (ReAct)",
|
||||
"agentModeSingle": "Single-agent (Eino ADK)",
|
||||
"agentModeMulti": "Multi-agent (Eino)",
|
||||
"agentModeHint": "Same as chat: native ReAct, Eino single-agent (ADK), or Deep / Plan-Execute / Supervisor (the last three require multi-agent enabled).",
|
||||
"agentModeHint": "Same as chat: Eino single-agent (ADK), or Deep / Plan-Execute / Supervisor (last three require multi_agent.enabled).",
|
||||
"scheduleMode": "Schedule mode",
|
||||
"scheduleModeManual": "Manual",
|
||||
"scheduleModeCron": "Cron expression",
|
||||
|
||||
@@ -490,8 +490,6 @@
|
||||
"historyGroupEarlier": "更早",
|
||||
"agentModeSelectAria": "选择对话执行模式",
|
||||
"agentModePanelTitle": "对话模式",
|
||||
"agentModeReactNative": "原生 ReAct 模式",
|
||||
"agentModeReactNativeHint": "经典单代理 ReAct 与 MCP 工具",
|
||||
"agentModeEinoSingle": "Eino 单代理(ADK)",
|
||||
"agentModeEinoSingleHint": "Eino ChatModelAgent + Runner,MCP 工具(/api/eino-agent)",
|
||||
"agentModeDeep": "Deep(DeepAgent)",
|
||||
@@ -502,7 +500,7 @@
|
||||
"agentModeSupervisorHint": "监督者协调,transfer 委派子代理",
|
||||
"agentModeSingle": "单代理",
|
||||
"agentModeMulti": "多代理",
|
||||
"agentModeSingleHint": "单模型 ReAct 循环,适合常规对话与工具调用",
|
||||
"agentModeSingleHint": "Eino ADK 单代理,适合常规对话与工具调用",
|
||||
"agentModeMultiHint": "Eino 预置编排(deep / plan_execute / supervisor),适合复杂任务",
|
||||
"reasoningModeLabel": "模型推理",
|
||||
"reasoningEffortLabel": "推理强度",
|
||||
@@ -2278,9 +2276,9 @@
|
||||
"projectNone": "(未绑定)",
|
||||
"projectHint": "可为队列绑定项目;留空则不绑定项目上下文。",
|
||||
"agentMode": "代理模式",
|
||||
"agentModeSingle": "单代理(ReAct)",
|
||||
"agentModeSingle": "单代理(Eino ADK)",
|
||||
"agentModeMulti": "多代理(Eino)",
|
||||
"agentModeHint": "与对话页一致:原生 ReAct、Eino 单代理(ADK),或 Deep / Plan-Execute / Supervisor(后三种需已启用多代理)。",
|
||||
"agentModeHint": "与对话页一致:Eino 单代理(ADK),或 Deep / Plan-Execute / Supervisor(后三种需已启用多代理)。",
|
||||
"scheduleMode": "调度方式",
|
||||
"scheduleModeManual": "手工执行",
|
||||
"scheduleModeCron": "调度表达式(Cron)",
|
||||
|
||||
+12
-22
@@ -38,11 +38,10 @@ function isInterruptContinueInjectChatMessage(content) {
|
||||
let chatAttachments = [];
|
||||
let chatAttachmentSeq = 0;
|
||||
|
||||
// 对话模式:react = 原生 ReAct(/agent-loop);eino_single = Eino ADK 单代理(/api/eino-agent/stream);deep / plan_execute / supervisor = Eino 多代理(/api/multi-agent/stream,请求体 orchestration)
|
||||
// 对话模式:eino_single = Eino ADK 单代理(/api/eino-agent/stream);deep / plan_execute / supervisor = Eino 多代理(/api/multi-agent/stream,请求体 orchestration)
|
||||
const AGENT_MODE_STORAGE_KEY = 'cyberstrike-chat-agent-mode';
|
||||
const REASONING_MODE_LS = 'cyberstrike-chat-reasoning-mode';
|
||||
const REASONING_EFFORT_LS = 'cyberstrike-chat-reasoning-effort';
|
||||
const CHAT_AGENT_MODE_REACT = 'react';
|
||||
const CHAT_AGENT_MODE_EINO_SINGLE = 'eino_single';
|
||||
const CHAT_AGENT_EINO_MODES = ['deep', 'plan_execute', 'supervisor'];
|
||||
let multiAgentAPIEnabled = false;
|
||||
@@ -391,19 +390,16 @@ async function applyHitlSidebarConfig() {
|
||||
}
|
||||
}
|
||||
|
||||
/** 将 localStorage / 历史值规范为 react | eino_single | deep | plan_execute | supervisor */
|
||||
/** 将 localStorage 规范为 eino_single | deep | plan_execute | supervisor */
|
||||
function chatAgentModeNormalizeStored(stored, cfg) {
|
||||
const pub = cfg && cfg.multi_agent ? cfg.multi_agent : null;
|
||||
const multiOn = !!(pub && pub.enabled);
|
||||
const defOrch = 'deep';
|
||||
let s = stored;
|
||||
if (s === 'single') s = CHAT_AGENT_MODE_REACT;
|
||||
if (s === 'multi') s = defOrch;
|
||||
if (s === CHAT_AGENT_MODE_REACT || chatAgentModeIsEinoSingle(s)) return s;
|
||||
const s = stored;
|
||||
if (chatAgentModeIsEinoSingle(s)) return s;
|
||||
if (chatAgentModeIsEino(s)) {
|
||||
return multiOn ? s : CHAT_AGENT_MODE_REACT;
|
||||
return multiOn ? s : CHAT_AGENT_MODE_EINO_SINGLE;
|
||||
}
|
||||
return CHAT_AGENT_MODE_REACT;
|
||||
return CHAT_AGENT_MODE_EINO_SINGLE;
|
||||
}
|
||||
|
||||
if (typeof window !== 'undefined') {
|
||||
@@ -411,7 +407,6 @@ if (typeof window !== 'undefined') {
|
||||
window.csaiChatAgentMode = {
|
||||
EINO_MODES: CHAT_AGENT_EINO_MODES,
|
||||
EINO_SINGLE: CHAT_AGENT_MODE_EINO_SINGLE,
|
||||
REACT: CHAT_AGENT_MODE_REACT,
|
||||
isEino: chatAgentModeIsEino,
|
||||
isEinoSingle: chatAgentModeIsEinoSingle,
|
||||
normalizeStored: chatAgentModeNormalizeStored,
|
||||
@@ -448,8 +443,6 @@ document.addEventListener('DOMContentLoaded', function () {
|
||||
function getAgentModeLabelForValue(mode) {
|
||||
if (typeof window.t === 'function') {
|
||||
switch (mode) {
|
||||
case CHAT_AGENT_MODE_REACT:
|
||||
return window.t('chat.agentModeReactNative');
|
||||
case 'deep':
|
||||
return window.t('chat.agentModeDeep');
|
||||
case 'plan_execute':
|
||||
@@ -463,7 +456,6 @@ function getAgentModeLabelForValue(mode) {
|
||||
}
|
||||
}
|
||||
switch (mode) {
|
||||
case CHAT_AGENT_MODE_REACT: return '原生 ReAct';
|
||||
case CHAT_AGENT_MODE_EINO_SINGLE: return 'Eino 单代理';
|
||||
case 'deep': return 'Deep';
|
||||
case 'plan_execute': return 'Plan-Execute';
|
||||
@@ -474,7 +466,6 @@ function getAgentModeLabelForValue(mode) {
|
||||
|
||||
function getAgentModeIconForValue(mode) {
|
||||
switch (mode) {
|
||||
case CHAT_AGENT_MODE_REACT: return '🤖';
|
||||
case CHAT_AGENT_MODE_EINO_SINGLE: return '⚡';
|
||||
case 'deep': return '🧩';
|
||||
case 'plan_execute': return '📋';
|
||||
@@ -655,7 +646,7 @@ function toggleAgentModePanel() {
|
||||
}
|
||||
|
||||
function selectAgentMode(mode) {
|
||||
const ok = mode === CHAT_AGENT_MODE_REACT || chatAgentModeIsEinoSingle(mode) || chatAgentModeIsEino(mode);
|
||||
const ok = chatAgentModeIsEinoSingle(mode) || chatAgentModeIsEino(mode);
|
||||
if (!ok) return;
|
||||
try {
|
||||
localStorage.setItem(AGENT_MODE_STORAGE_KEY, mode);
|
||||
@@ -672,8 +663,8 @@ async function initChatAgentModeFromConfig() {
|
||||
// 先展示基础模式,避免首次登录时配置接口短暂失败导致入口被隐藏。
|
||||
wrap.style.display = '';
|
||||
let stored = localStorage.getItem(AGENT_MODE_STORAGE_KEY);
|
||||
if (!(stored === CHAT_AGENT_MODE_REACT || chatAgentModeIsEinoSingle(stored) || chatAgentModeIsEino(stored))) {
|
||||
stored = CHAT_AGENT_MODE_REACT;
|
||||
if (!(chatAgentModeIsEinoSingle(stored) || chatAgentModeIsEino(stored))) {
|
||||
stored = CHAT_AGENT_MODE_EINO_SINGLE;
|
||||
}
|
||||
sel.value = stored;
|
||||
syncAgentModeFromValue(stored);
|
||||
@@ -725,7 +716,7 @@ document.addEventListener('languagechange', function () {
|
||||
const hid = document.getElementById('agent-mode-select');
|
||||
if (!hid) return;
|
||||
const v = hid.value;
|
||||
if (v === CHAT_AGENT_MODE_REACT || chatAgentModeIsEinoSingle(v) || chatAgentModeIsEino(v)) {
|
||||
if (chatAgentModeIsEinoSingle(v) || chatAgentModeIsEino(v)) {
|
||||
syncAgentModeFromValue(v);
|
||||
}
|
||||
if (typeof updateChatReasoningSummary === 'function') {
|
||||
@@ -945,10 +936,9 @@ async function sendMessage() {
|
||||
|
||||
try {
|
||||
const modeSel = document.getElementById('agent-mode-select');
|
||||
const modeVal = modeSel ? modeSel.value : CHAT_AGENT_MODE_REACT;
|
||||
const useEinoSingle = chatAgentModeIsEinoSingle(modeVal);
|
||||
let modeVal = modeSel ? modeSel.value : CHAT_AGENT_MODE_EINO_SINGLE;
|
||||
const useMulti = multiAgentAPIEnabled && chatAgentModeIsEino(modeVal);
|
||||
const streamPath = useEinoSingle ? '/api/eino-agent/stream' : useMulti ? '/api/multi-agent/stream' : '/api/agent-loop/stream';
|
||||
const streamPath = useMulti ? '/api/multi-agent/stream' : '/api/eino-agent/stream';
|
||||
if (useMulti && modeVal) {
|
||||
body.orchestration = modeVal;
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ function syncRobotAgentModeSelectOptions(multiEnabled) {
|
||||
if (opt) opt.disabled = !multiEnabled;
|
||||
});
|
||||
if (!multiEnabled && ['deep', 'plan_execute', 'supervisor'].indexOf(sel.value) >= 0) {
|
||||
sel.value = 'react';
|
||||
sel.value = 'eino_single';
|
||||
}
|
||||
}
|
||||
|
||||
@@ -227,8 +227,7 @@ async function loadConfig(loadTools = true) {
|
||||
}
|
||||
const maRobotMode = document.getElementById('multi-agent-robot-mode');
|
||||
if (maRobotMode) {
|
||||
let mode = (ma.robot_default_agent_mode || 'react').trim().toLowerCase();
|
||||
if (mode === 'single') mode = 'react';
|
||||
let mode = (ma.robot_default_agent_mode || 'eino_single').trim().toLowerCase();
|
||||
maRobotMode.value = mode;
|
||||
syncRobotAgentModeSelectOptions(ma.enabled === true);
|
||||
}
|
||||
@@ -1160,9 +1159,9 @@ async function applySettings() {
|
||||
const peParsed = parseInt(peRaw, 10);
|
||||
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';
|
||||
let robotMode = document.getElementById('multi-agent-robot-mode')?.value || 'eino_single';
|
||||
if (!maEnabled && ['deep', 'plan_execute', 'supervisor'].indexOf(robotMode) >= 0) {
|
||||
robotMode = 'react';
|
||||
robotMode = 'eino_single';
|
||||
}
|
||||
return {
|
||||
enabled: maEnabled,
|
||||
@@ -1415,7 +1414,7 @@ async function saveToolsConfig() {
|
||||
agent: currentConfig.agent || {},
|
||||
multi_agent: {
|
||||
enabled: currentConfig?.multi_agent?.enabled === true,
|
||||
robot_default_agent_mode: currentConfig?.multi_agent?.robot_default_agent_mode || 'react',
|
||||
robot_default_agent_mode: currentConfig?.multi_agent?.robot_default_agent_mode || 'eino_single',
|
||||
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),
|
||||
tool_search_always_visible_tools: Array.from(alwaysVisibleToolNames).filter(name => !alwaysVisibleBuiltinToolNames.has(name))
|
||||
|
||||
+11
-14
@@ -15,7 +15,7 @@ function _tPlain(key, opts) {
|
||||
}
|
||||
|
||||
/** 与创建队列 / API 一致的合法 agentMode */
|
||||
const BATCH_QUEUE_AGENT_MODES = ['single', 'eino_single', 'deep', 'plan_execute', 'supervisor'];
|
||||
const BATCH_QUEUE_AGENT_MODES = ['eino_single', 'deep', 'plan_execute', 'supervisor'];
|
||||
|
||||
function isBatchQueueAgentMode(mode) {
|
||||
return BATCH_QUEUE_AGENT_MODES.indexOf(String(mode || '').toLowerCase()) >= 0;
|
||||
@@ -23,13 +23,12 @@ function isBatchQueueAgentMode(mode) {
|
||||
|
||||
/** 批量队列 agentMode 展示文案(与对话模式命名一致) */
|
||||
function batchQueueAgentModeLabel(mode) {
|
||||
const m = String(mode || 'single').toLowerCase();
|
||||
if (m === 'single') return _t('chat.agentModeReactNative');
|
||||
const m = String(mode || 'eino_single').toLowerCase();
|
||||
if (m === 'eino_single') return _t('chat.agentModeEinoSingle');
|
||||
if (m === 'multi' || m === 'deep') return _t('chat.agentModeDeep');
|
||||
if (m === 'deep') return _t('chat.agentModeDeep');
|
||||
if (m === 'plan_execute') return _t('chat.agentModePlanExecuteLabel');
|
||||
if (m === 'supervisor') return _t('chat.agentModeSupervisorLabel');
|
||||
return _t('chat.agentModeReactNative');
|
||||
return _t('chat.agentModeEinoSingle');
|
||||
}
|
||||
|
||||
/** Cron 队列在「本轮 completed」等状态下的展示文案(底层 status 不变,仅 UI 强调循环调度) */
|
||||
@@ -867,7 +866,7 @@ async function showBatchImportModal() {
|
||||
projectSelect.value = '';
|
||||
}
|
||||
if (agentModeSelect) {
|
||||
agentModeSelect.value = 'single';
|
||||
agentModeSelect.value = 'eino_single';
|
||||
}
|
||||
if (scheduleModeSelect) {
|
||||
scheduleModeSelect.value = 'manual';
|
||||
@@ -997,8 +996,8 @@ async function createBatchQueue() {
|
||||
// 获取角色(可选,空字符串表示默认角色)
|
||||
const role = roleSelect ? roleSelect.value || '' : '';
|
||||
const projectId = projectSelect ? (projectSelect.value || '').trim() : '';
|
||||
const rawMode = agentModeSelect ? agentModeSelect.value : 'single';
|
||||
const agentMode = isBatchQueueAgentMode(rawMode) ? rawMode : 'single';
|
||||
const rawMode = agentModeSelect ? agentModeSelect.value : 'eino_single';
|
||||
const agentMode = isBatchQueueAgentMode(rawMode) ? rawMode : 'eino_single';
|
||||
const scheduleMode = scheduleModeSelect ? (scheduleModeSelect.value === 'cron' ? 'cron' : 'manual') : 'manual';
|
||||
const cronExpr = cronExprInput ? cronExprInput.value.trim() : '';
|
||||
const executeNow = executeNowCheckbox ? !!executeNowCheckbox.checked : false;
|
||||
@@ -2217,12 +2216,10 @@ function startInlineEditAgentMode() {
|
||||
if (!queueId) return;
|
||||
apiFetch(`/api/batch-tasks/${queueId}`).then(r => r.json()).then(detail => {
|
||||
const queue = detail.queue;
|
||||
let currentMode = (queue.agentMode || 'single').toLowerCase();
|
||||
if (currentMode === 'multi') currentMode = 'deep';
|
||||
if (!isBatchQueueAgentMode(currentMode)) currentMode = 'single';
|
||||
let currentMode = (queue.agentMode || 'eino_single').toLowerCase();
|
||||
if (!isBatchQueueAgentMode(currentMode)) currentMode = 'eino_single';
|
||||
container.innerHTML = `<span class="bq-inline-edit-controls">
|
||||
<select id="bq-edit-agentmode">
|
||||
<option value="single" ${currentMode === 'single' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeReactNative'))}</option>
|
||||
<option value="eino_single" ${currentMode === 'eino_single' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeEinoSingle'))}</option>
|
||||
<option value="deep" ${currentMode === 'deep' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModeDeep'))}</option>
|
||||
<option value="plan_execute" ${currentMode === 'plan_execute' ? 'selected' : ''}>${escapeHtml(_t('chat.agentModePlanExecuteLabel'))}</option>
|
||||
@@ -2247,8 +2244,8 @@ async function saveInlineAgentMode() {
|
||||
const queueId = batchQueuesState.currentQueueId;
|
||||
if (!queueId) { _bqInlineSaving = false; return; }
|
||||
const sel = document.getElementById('bq-edit-agentmode');
|
||||
const raw = sel ? sel.value : 'single';
|
||||
const agentMode = isBatchQueueAgentMode(raw) ? raw : 'single';
|
||||
const raw = sel ? sel.value : 'eino_single';
|
||||
const agentMode = isBatchQueueAgentMode(raw) ? raw : 'eino_single';
|
||||
try {
|
||||
const detailResp = await apiFetch(`/api/batch-tasks/${queueId}`);
|
||||
const detail = await detailResp.json();
|
||||
|
||||
+18
-21
@@ -154,33 +154,26 @@ function applyWebshellDetectedOS(conn, data) {
|
||||
/** 与主对话页一致:Eino 模式走 /api/multi-agent/stream,body 带 orchestration */
|
||||
function resolveWebshellAiStreamRequest() {
|
||||
if (typeof apiFetch === 'undefined') {
|
||||
return Promise.resolve({ path: '/api/agent-loop/stream', orchestration: null });
|
||||
return Promise.resolve({ path: '/api/eino-agent/stream', orchestration: null });
|
||||
}
|
||||
return apiFetch('/api/config').then(function (r) {
|
||||
if (!r.ok) return null;
|
||||
return r.json();
|
||||
}).then(function (cfg) {
|
||||
var norm = null;
|
||||
var norm = 'eino_single';
|
||||
if (typeof window.csaiChatAgentMode === 'object' && typeof window.csaiChatAgentMode.normalizeStored === 'function') {
|
||||
norm = window.csaiChatAgentMode.normalizeStored(localStorage.getItem('cyberstrike-chat-agent-mode'), cfg);
|
||||
} else {
|
||||
var mode = localStorage.getItem('cyberstrike-chat-agent-mode');
|
||||
if (mode === 'single') mode = 'react';
|
||||
if (mode === 'multi') mode = 'deep';
|
||||
norm = mode || 'react';
|
||||
norm = (mode && (mode === 'eino_single' || mode === 'deep' || mode === 'plan_execute' || mode === 'supervisor')) ? mode : 'eino_single';
|
||||
}
|
||||
if (typeof window.csaiChatAgentMode === 'object' && typeof window.csaiChatAgentMode.isEinoSingle === 'function' && window.csaiChatAgentMode.isEinoSingle(norm)) {
|
||||
return { path: '/api/eino-agent/stream', orchestration: null };
|
||||
}
|
||||
if (!cfg || !cfg.multi_agent || !cfg.multi_agent.enabled) {
|
||||
return { path: '/api/agent-loop/stream', orchestration: null };
|
||||
}
|
||||
if (typeof window.csaiChatAgentMode === 'object' && typeof window.csaiChatAgentMode.isEino === 'function' && window.csaiChatAgentMode.isEino(norm)) {
|
||||
if (cfg && cfg.multi_agent && cfg.multi_agent.enabled &&
|
||||
typeof window.csaiChatAgentMode === 'object' && typeof window.csaiChatAgentMode.isEino === 'function' && window.csaiChatAgentMode.isEino(norm)) {
|
||||
return { path: '/api/multi-agent/stream', orchestration: norm };
|
||||
}
|
||||
return { path: '/api/agent-loop/stream', orchestration: null };
|
||||
return { path: '/api/eino-agent/stream', orchestration: null };
|
||||
}).catch(function () {
|
||||
return { path: '/api/agent-loop/stream', orchestration: null };
|
||||
return { path: '/api/eino-agent/stream', orchestration: null };
|
||||
});
|
||||
}
|
||||
|
||||
@@ -304,15 +297,17 @@ function wsInitAgentMode() {
|
||||
if (typeof window.csaiChatAgentMode === 'object' && typeof window.csaiChatAgentMode.normalizeStored === 'function') {
|
||||
norm = window.csaiChatAgentMode.normalizeStored(stored, cfg);
|
||||
} else {
|
||||
norm = stored || 'react';
|
||||
if (norm === 'single') norm = 'react';
|
||||
norm = stored || 'eino_single';
|
||||
if (norm !== 'eino_single' && norm !== 'deep' && norm !== 'plan_execute' && norm !== 'supervisor') {
|
||||
norm = 'eino_single';
|
||||
}
|
||||
if (norm === 'multi') norm = 'deep';
|
||||
}
|
||||
wsSyncAgentMode(norm);
|
||||
}).catch(function () {
|
||||
var wrapper = document.getElementById('ws-agent-mode-wrapper');
|
||||
if (wrapper) wrapper.style.display = '';
|
||||
wsSyncAgentMode('react');
|
||||
wsSyncAgentMode('eino_single');
|
||||
});
|
||||
}
|
||||
|
||||
@@ -356,7 +351,10 @@ function wsCloseAgentModePanel() {
|
||||
function wsRefreshSelectors() {
|
||||
wsUpdateRoleSelectorDisplay();
|
||||
wsRenderRoleList();
|
||||
var stored = localStorage.getItem('cyberstrike-chat-agent-mode') || 'react';
|
||||
var stored = localStorage.getItem('cyberstrike-chat-agent-mode') || 'eino_single';
|
||||
if (stored !== 'eino_single' && stored !== 'deep' && stored !== 'plan_execute' && stored !== 'supervisor') {
|
||||
stored = 'eino_single';
|
||||
}
|
||||
wsSyncAgentMode(stored);
|
||||
}
|
||||
|
||||
@@ -2020,7 +2018,7 @@ function selectWebshell(id, stateReady) {
|
||||
'<div class="agent-mode-inner">' +
|
||||
'<button type="button" class="role-selector-btn agent-mode-btn" id="ws-agent-mode-btn" onclick="wsToggleAgentModePanel()">' +
|
||||
'<span id="ws-agent-mode-icon" class="role-selector-icon">\ud83e\udd16</span>' +
|
||||
'<span id="ws-agent-mode-text" class="role-selector-text">' + (wsT('chat.agentModeReactNative') || '原生 ReAct') + '</span>' +
|
||||
'<span id="ws-agent-mode-text" class="role-selector-text">' + (wsT('chat.agentModeEinoSingle') || 'Eino 单代理') + '</span>' +
|
||||
'<svg class="role-selector-arrow" width="10" height="10" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M6 9l6 6 6-6" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg>' +
|
||||
'</button>' +
|
||||
'<div id="ws-agent-mode-panel" class="agent-mode-panel" style="display:none;" role="listbox">' +
|
||||
@@ -2028,13 +2026,12 @@ function selectWebshell(id, stateReady) {
|
||||
'<button type="button" class="role-selection-panel-close" onclick="wsCloseAgentModePanel()"><svg width="16" height="16" viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M18 6L6 18M6 6l12 12" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/></svg></button>' +
|
||||
'</div>' +
|
||||
'<div class="agent-mode-options">' +
|
||||
'<button type="button" class="role-selection-item-main agent-mode-option ws-agent-mode-option" data-value="react" role="option" onclick="wsSelectAgentMode(\'react\')"><div class="role-selection-item-icon-main">\ud83e\udd16</div><div class="role-selection-item-content-main"><div class="role-selection-item-name-main">' + (wsT('chat.agentModeReactNative') || '原生 ReAct 模式') + '</div><div class="role-selection-item-description-main">' + (wsT('chat.agentModeReactNativeHint') || '经典单代理 ReAct 与 MCP 工具') + '</div></div><div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="react">\u2713</div></button>' +
|
||||
'<button type="button" class="role-selection-item-main agent-mode-option ws-agent-mode-option" data-value="eino_single" role="option" onclick="wsSelectAgentMode(\'eino_single\')"><div class="role-selection-item-icon-main">\u26a1</div><div class="role-selection-item-content-main"><div class="role-selection-item-name-main">' + (wsT('chat.agentModeEinoSingle') || 'Eino 单代理(ADK)') + '</div><div class="role-selection-item-description-main">' + (wsT('chat.agentModeEinoSingleHint') || 'Eino ChatModelAgent + Runner') + '</div></div><div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="eino_single">\u2713</div></button>' +
|
||||
'<button type="button" class="role-selection-item-main agent-mode-option ws-agent-mode-option" data-value="deep" role="option" onclick="wsSelectAgentMode(\'deep\')"><div class="role-selection-item-icon-main">\ud83e\udde9</div><div class="role-selection-item-content-main"><div class="role-selection-item-name-main">' + (wsT('chat.agentModeDeep') || 'Deep(DeepAgent)') + '</div><div class="role-selection-item-description-main">' + (wsT('chat.agentModeDeepHint') || 'Eino DeepAgent,task 调度子代理') + '</div></div><div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="deep">\u2713</div></button>' +
|
||||
'<button type="button" class="role-selection-item-main agent-mode-option ws-agent-mode-option" data-value="plan_execute" role="option" onclick="wsSelectAgentMode(\'plan_execute\')"><div class="role-selection-item-icon-main">\ud83d\udccb</div><div class="role-selection-item-content-main"><div class="role-selection-item-name-main">' + (wsT('chat.agentModePlanExecuteLabel') || 'Plan-Execute') + '</div><div class="role-selection-item-description-main">' + (wsT('chat.agentModePlanExecuteHint') || '规划 → 执行 → 重规划') + '</div></div><div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="plan_execute">\u2713</div></button>' +
|
||||
'<button type="button" class="role-selection-item-main agent-mode-option ws-agent-mode-option" data-value="supervisor" role="option" onclick="wsSelectAgentMode(\'supervisor\')"><div class="role-selection-item-icon-main">\ud83c\udfaf</div><div class="role-selection-item-content-main"><div class="role-selection-item-name-main">' + (wsT('chat.agentModeSupervisorLabel') || 'Supervisor') + '</div><div class="role-selection-item-description-main">' + (wsT('chat.agentModeSupervisorHint') || '监督者协调,transfer 委派子代理') + '</div></div><div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="supervisor">\u2713</div></button>' +
|
||||
'</div></div></div>' +
|
||||
'<input type="hidden" id="ws-agent-mode-select" value="react" autocomplete="off" />' +
|
||||
'<input type="hidden" id="ws-agent-mode-select" value="eino_single" autocomplete="off" />' +
|
||||
'</div>' +
|
||||
'</div>' +
|
||||
'<div class="webshell-ai-input-row">' +
|
||||
|
||||
@@ -1031,14 +1031,6 @@
|
||||
</button>
|
||||
</div>
|
||||
<div class="agent-mode-options">
|
||||
<button type="button" class="role-selection-item-main agent-mode-option" data-value="react" role="option" onclick="selectAgentMode('react')">
|
||||
<div class="role-selection-item-icon-main" aria-hidden="true">🤖</div>
|
||||
<div class="role-selection-item-content-main">
|
||||
<div class="role-selection-item-name-main" data-i18n="chat.agentModeReactNative">原生 ReAct 模式</div>
|
||||
<div class="role-selection-item-description-main" data-i18n="chat.agentModeReactNativeHint">经典单代理 ReAct 与 MCP 工具(/api/agent-loop)</div>
|
||||
</div>
|
||||
<div class="role-selection-checkmark-main agent-mode-check" data-agent-mode-check="react">✓</div>
|
||||
</button>
|
||||
<button type="button" class="role-selection-item-main agent-mode-option" data-value="eino_single" role="option" onclick="selectAgentMode('eino_single')">
|
||||
<div class="role-selection-item-icon-main" aria-hidden="true">⚡</div>
|
||||
<div class="role-selection-item-content-main">
|
||||
@@ -1074,7 +1066,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" id="agent-mode-select" value="react" autocomplete="off">
|
||||
<input type="hidden" id="agent-mode-select" value="eino_single" autocomplete="off">
|
||||
</div>
|
||||
</div>
|
||||
<div class="chat-input-with-files">
|
||||
@@ -2507,7 +2499,6 @@
|
||||
<div class="form-group">
|
||||
<label for="multi-agent-robot-mode" data-i18n="settingsBasic.multiAgentRobotMode">机器人默认对话模式</label>
|
||||
<select id="multi-agent-robot-mode" class="form-select">
|
||||
<option value="react" data-i18n="chat.agentModeReactNative">原生 ReAct</option>
|
||||
<option value="eino_single" data-i18n="chat.agentModeEinoSingle">Eino 单代理(ADK)</option>
|
||||
<option value="deep" data-i18n="chat.agentModeDeep">Deep(DeepAgent)</option>
|
||||
<option value="plan_execute" data-i18n="chat.agentModePlanExecuteLabel">Plan-Execute</option>
|
||||
@@ -3760,13 +3751,12 @@
|
||||
<div class="form-group">
|
||||
<label for="batch-queue-agent-mode" data-i18n="batchImportModal.agentMode">代理模式</label>
|
||||
<select id="batch-queue-agent-mode" style="width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 4px; font-size: 0.875rem;">
|
||||
<option value="single" data-i18n="chat.agentModeReactNative">原生 ReAct 模式</option>
|
||||
<option value="eino_single" data-i18n="chat.agentModeEinoSingle">Eino 单代理(ADK)</option>
|
||||
<option value="deep" data-i18n="chat.agentModeDeep">Deep(DeepAgent)</option>
|
||||
<option value="plan_execute" data-i18n="chat.agentModePlanExecuteLabel">Plan-Execute</option>
|
||||
<option value="supervisor" data-i18n="chat.agentModeSupervisorLabel">Supervisor</option>
|
||||
</select>
|
||||
<div class="form-hint" style="margin-top: 4px;" data-i18n="batchImportModal.agentModeHint">与对话页一致:原生 ReAct、Eino 单代理(ADK),或 Deep / Plan-Execute / Supervisor(后三种需已启用多代理)。</div>
|
||||
<div class="form-hint" style="margin-top: 4px;" data-i18n="batchImportModal.agentModeHint">与对话页一致:Eino 单代理(ADK),或 Deep / Plan-Execute / Supervisor(后三种需已启用多代理)。</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="batch-queue-schedule-mode" data-i18n="batchImportModal.scheduleMode">调度方式</label>
|
||||
|
||||
Reference in New Issue
Block a user