后端: trace/graph.go(RunGraph 图构建器,kind/status 映射,父子优先连线,脱敏白名单+截断);
loop/flow.go(FlowPublisher 按会话增量发布 ws.graph_update,仅主人web会话); loop span
start/finish 折入图; run.go StartRound/EndRound; wire.go 组装+注入.
前端: Flow.tsx(全链路流程页:FlowGraphView+会话/节点/开始/耗时卡片+状态计数+节点点开日志);
FlowGraph 组件加 onNodeClick; types/wsParse 扩展; router/sections/AdminApp 注册 flow;
api-client.md §3.5 graph_update 契约.
验证: 后端 build/vet/test 全绿+flow_test.go 集成(span→graph→ws.graph_update主干); 前端 build 绿.
红线: 单二进制零新依赖; 工具参数/结果脱敏; 仅主人web会话; 身份靠actor元数据; 只读不虚构.
P2(并行子代理分支/泳道/节点实时日志)后置.
39 lines
2.0 KiB
TypeScript
39 lines
2.0 KiB
TypeScript
import type { AdminSectionId } from "./router";
|
|
import type { IconName } from "../components/Icon";
|
|
|
|
/** Sidebar grouping for the 15 admin modules. Groups are visual only. */
|
|
export interface AdminSectionMeta {
|
|
id: AdminSectionId;
|
|
label: string;
|
|
icon: IconName;
|
|
group: string;
|
|
}
|
|
|
|
/**
|
|
* The 16-module registry (design/10 §3). Order drives the sidebar; group drives
|
|
* the section headers. All are clickable — several are shells until M10+ backend.
|
|
*/
|
|
export const ADMIN_SECTIONS: ReadonlyArray<AdminSectionMeta> = [
|
|
{ id: "dashboard", label: "仪表盘", icon: "chart", group: "总览" },
|
|
{ id: "personas", label: "人格管理", icon: "dna", group: "内容" },
|
|
{ id: "sessions", label: "会话管理", icon: "chat", group: "内容" },
|
|
{ id: "memories", label: "记忆管理", icon: "memory", group: "内容" },
|
|
{ id: "rag", label: "知识库 RAG", icon: "docs", group: "内容" },
|
|
{ id: "plugins", label: "插件与能力", icon: "plugin", group: "能力与连接" },
|
|
{ id: "channels", label: "渠道管理", icon: "channel", group: "能力与连接" },
|
|
{ id: "iot", label: "IoT 设备", icon: "device", group: "能力与连接" },
|
|
{ id: "llm", label: "LLM 模型", icon: "robot", group: "能力与连接" },
|
|
{ id: "automations", label: "自动化与提醒", icon: "clock", group: "能力与连接" },
|
|
{ id: "agents", label: "Agent 监控", icon: "agent", group: "运行时" },
|
|
{ id: "flow", label: "全链路流程", icon: "chart", group: "运行时" },
|
|
{ id: "backthink", label: "后台思考", icon: "night", group: "运行时" },
|
|
{ id: "observability", label: "可观测性", icon: "trend", group: "运行时" },
|
|
{ id: "users", label: "用户与权限", icon: "users", group: "治理" },
|
|
{ id: "system", label: "系统设置", icon: "settings", group: "治理" },
|
|
];
|
|
|
|
/** Group headers in sidebar order (derived from ADMIN_SECTIONS). */
|
|
export const ADMIN_GROUPS: ReadonlyArray<string> = Array.from(
|
|
new Set(ADMIN_SECTIONS.map((s) => s.group))
|
|
);
|