diff --git a/frontend/web/src/admin/modules/Agents.tsx b/frontend/web/src/admin/modules/Agents.tsx index d2f88dc..28ed318 100644 --- a/frontend/web/src/admin/modules/Agents.tsx +++ b/frontend/web/src/admin/modules/Agents.tsx @@ -6,6 +6,7 @@ import { Button, EmptyState, Surface, Tag, type TagTone } from "../../components import { sendUp } from "../../lib/ws"; import { useAuditStore } from "../audit"; import { Icon } from "../../components/Icon"; +import { FlowGraphView } from "./FlowGraph"; const statusTone: Record = { idle: { label: "空闲", tone: "neutral" }, @@ -15,8 +16,21 @@ const statusTone: Record = { error: { label: "错误", tone: "err" }, }; -function AgentCard({ agent, onKill }: { agent: AgentInfo; onKill: (id: string) => void }): React.ReactNode { +function AgentCard({ agent }: { agent: AgentInfo }): React.ReactNode { const meta = statusTone[agent.status] ?? statusTone.idle; + const log = useAuditStore((s) => s.log); + const [hint, setHint] = useState(null); + + const query = () => { + const ok = sendUp({ type: "task_output_query", data: { taskId: agent.id } }); + log(`agent.query:${agent.id}`, ok ? "ok" : "error"); + setHint(ok ? "已请求上下文,输出见下方「任务日志」。" : "WS 未连接,无法查询。"); + }; + const kill = () => { + log(`agent.kill:${agent.id}`, "error"); + setHint("终止子代理需后端 M10+ 能力接入,当前为只读展示,未执行任何操作。"); + }; + return (
@@ -40,13 +54,14 @@ function AgentCard({ agent, onKill }: { agent: AgentInfo; onKill: (id: string) = ))} {agent.message ?
{agent.message}
: null}
- -
+ {hint ?
{hint}
: null} ); } @@ -58,6 +73,7 @@ export function AgentsModule(): React.ReactNode { const clearTaskLog = useAppStore((s) => s.clearTaskLog); const log = useAuditStore((s) => s.log); const [tab, setTab] = useState<"main" | "sub">("main"); + const [respawnHint, setRespawnHint] = useState(false); const subAgents = agents.filter((a) => a.id !== "main"); const list = tab === "main" ? agents.filter((a) => a.id === "main") : subAgents; @@ -71,8 +87,8 @@ export function AgentsModule(): React.ReactNode {
)) )} - 子代理链上下文查询、终止/重派、流程图导出需后端 M10+ 提供。 + + 任务日志实时来自 task_output 事件;「上下文查询」通过 task_output_query 上行帧查询真实输出(已接后端)。终止 / 重派需后端 M10+ 提供,当前为只读展示。 +
); diff --git a/frontend/web/src/admin/modules/Backthink.tsx b/frontend/web/src/admin/modules/Backthink.tsx index 9852303..523e3bc 100644 --- a/frontend/web/src/admin/modules/Backthink.tsx +++ b/frontend/web/src/admin/modules/Backthink.tsx @@ -5,9 +5,11 @@ import { Notice, PageHeader } from "../components"; import { Button, EmptyState, Surface, Tag } from "../../components/primitives"; import type { BackthinkItem } from "../../lib/types"; import { Icon } from "../../components/Icon"; +import { FlowGraphView } from "./FlowGraph"; function BackthinkRow({ item }: { item: BackthinkItem }): React.ReactNode { const markPushed = useAppStore((s) => s.markBackthinkPushed); + const flowGraph = useAppStore((s) => s.flowGraph); const [open, setOpen] = useState(false); return ( @@ -35,9 +37,13 @@ function BackthinkRow({ item }: { item: BackthinkItem }): React.ReactNode { {open ? "收起链路" : "查看完整链路导图"} {open ? ( -
- 链路导图占位 —— 后端 M10+ 提供思维链 / 流程图(graph_update 事件已接入实时通道)。 -
+ flowGraph ? ( + + ) : ( +
+ 暂无链路导图数据 —— 等待 graph_update 事件。 +
+ ) ) : null} ); @@ -47,6 +53,7 @@ export function BackthinkModule(): React.ReactNode { const backthink = useAppStore((s) => s.backthink); const log = useAuditStore((s) => s.log); const [filter, setFilter] = useState<"all" | "notify" | "silent">("all"); + const [interveneHint, setInterveneHint] = useState(false); const items = backthink.filter((b) => { if (filter === "notify") return b.shouldNotify === true; @@ -63,8 +70,8 @@ export function BackthinkModule(): React.ReactNode {