From 1244fb1f2f83a415dfc2597ef68caaa96dcdcd90 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=91=A3=E5=AE=8F=E5=87=AF?= Date: Mon, 7 Sep 2026 17:30:53 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=8F=90=E4=BA=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/EightBfStep1Workspace.tsx | 54 ++- .../pages/EightBfRoundtablePage.tsx | 10 + .../deep-research/WorkflowConfigDialog.tsx | 21 +- .../components/PositionIntentInput.tsx | 18 +- .../src/roundtable-planning/api/intent.ts | 3 + .../components/Step1Panel.tsx | 14 +- .../hooks/useStep2Orchestration.ts | 42 ++- .../pages/RoundtablePlanningPage.tsx | 34 ++ .../routers/_builtin_agent_tag_seed.py | 2 + .../app/gateway/routers/_roundtable_seed.py | 5 + .../eightbf-roundtable-intent/SOUL.md | 324 ++++++++++++++++++ .../eightbf-roundtable-intent/config.yaml | 3 + .../backend/app/gateway/routers/intent.py | 11 +- offline-backend-20260512/backend/config.yaml | 12 +- 14 files changed, 515 insertions(+), 38 deletions(-) create mode 100644 offline-backend-20260512/backend/app/gateway/routers/_roundtable_seed_assets/eightbf-roundtable-intent/SOUL.md create mode 100644 offline-backend-20260512/backend/app/gateway/routers/_roundtable_seed_assets/eightbf-roundtable-intent/config.yaml diff --git a/frontend-web/src/eightbf-roundtable/components/EightBfStep1Workspace.tsx b/frontend-web/src/eightbf-roundtable/components/EightBfStep1Workspace.tsx index 62d06b13..ef351e87 100644 --- a/frontend-web/src/eightbf-roundtable/components/EightBfStep1Workspace.tsx +++ b/frontend-web/src/eightbf-roundtable/components/EightBfStep1Workspace.tsx @@ -31,6 +31,7 @@ import { syncPositionOptionsFromRoles, } from "@/position-roundtable/lib/positions"; import type { DraftStep3SummarySnapshot } from "@/roundtable-planning/api/drafts"; +import { EIGHTBF_INTENT_AGENT_ID } from "@/roundtable-planning/api/intent"; import type { ThreadIdMap } from "@/roundtable-planning/api/multi-agent"; import "@/position-roundtable/styles/intent-understanding.css"; import type { Step1PanelProps } from "@/roundtable-planning/components/Step1Panel"; @@ -96,6 +97,8 @@ export function EightBfStep1Panel({ }: EightBfStep1PanelProps) { const [rightPanelOpen, setRightPanelOpen] = useState(true); const [rightTab, setRightTab] = useState<"agents" | "results">("agents"); + // 第一步内置任务理解智能体:其「常用问题」显示在输入框左上角,点击直接发送。 + const { agent: intentAgent } = useAgent(EIGHTBF_INTENT_AGENT_ID); const openPanel = (tab: "agents" | "results") => { if (rightPanelOpen && rightTab === tab) { @@ -167,6 +170,8 @@ export function EightBfStep1Panel({ modelOptions={modelOptions} selectedModel={selectedModel} onSelectedModelChange={onSelectedModelChange} + commonQuestions={intentAgent?.common_questions ?? null} + sendCommonQuestionOnClick /> )} intentReady={intentReady} @@ -331,8 +336,26 @@ function EightBfAgentWorkspace({ summaryReport: step3Summary, }); + // 第一步绑定的内置任务理解智能体:不在业务链席位里,固定置顶展示, + // 供管理员在本面板查看 / 配置其提示词与常用问题。 + const intentAgent = useMemo( + () => agents.find((agent) => agent.id === EIGHTBF_INTENT_AGENT_ID) ?? null, + [agents], + ); + const intentAgentMatchesKeyword = useMemo(() => { + const keyword = agentKeyword.trim().toLowerCase(); + if (!keyword) return true; + const name = (intentAgent?.name || "8BF 任务理解").toLowerCase(); + const description = (intentAgent?.description || "").toLowerCase(); + return name.includes(keyword) || description.includes(keyword); + }, [agentKeyword, intentAgent]); + useEffect(() => { - if (selectedAgentId && !seats.some((seat) => seat.agent_id === selectedAgentId)) { + if ( + selectedAgentId && + selectedAgentId !== EIGHTBF_INTENT_AGENT_ID && + !seats.some((seat) => seat.agent_id === selectedAgentId) + ) { setSelectedAgentId(null); } }, [seats, selectedAgentId]); @@ -412,7 +435,12 @@ function EightBfAgentWorkspace({ ) : ( toast.info("请在中间对话区向任务理解智能体发起问题")} showRecentChats={false} avatarSrc={agentConfigLogo} @@ -468,7 +496,7 @@ function EightBfAgentWorkspace({ {isLoading && seats.length > 0 ? (
正在加载智能体…
- ) : filteredSeatAgents.length === 0 ? ( + ) : filteredSeatAgents.length === 0 && !intentAgentMatchesKeyword ? (

{seatAgents.length ? "没有符合条件的智能体" : "当前岗位尚未配置智能体"}

{!seatAgents.length && canConfigureChain && ( @@ -477,6 +505,13 @@ function EightBfAgentWorkspace({
) : (
+ {intentAgentMatchesKeyword && ( + setSelectedAgentId(EIGHTBF_INTENT_AGENT_ID)} + /> + )} {filteredSeatAgents.map(({ seat, agent }) => ( ; +} + +/** 智能体列表卡片:席位智能体与置顶的内置任务理解智能体共用同一展示结构。 */ +function EightBfAgentCard({ + name, + description, + onSelect, +}: { + name: string; + description: string; + onSelect: () => void; +}) { const avatarText = firstAgentAvatarChar(name); return (

- 点击卡片选择报告结构(自动填充到报告结构配置);可启停、编辑、删除。 + 点击卡片选择报告结构(自动填充到报告结构配置);点击卡片上的眼睛图标查看大纲详情;可启停、编辑、删除。

)} + {/* 8BF:第二步「人工干预」开关。开启后第二步每走一步暂停,等待用户输入 / + 恢复后继续;关闭则自动推进(与原行为一致)。仅独立业务页传入受控回调时渲染。 */} + {onStep2InterventionChange && ( + + )} + {/* 深链接(taskId)模式:任务固定,把「新建任务」换成「重新分析」——清空会话、对同一任务重做意图分析。 */} {prefillRef.current?.taskId ? (