feat: 7-61 Yuxi reference — extensions panel, KB detail, manifest split, event router, dashboard
Batch B: settings popover 新增"扩展"tab,按知识库/Skills/MCP/Agent工具分面板 Batch C: knowledge-rag popover 新增"资料源管理/检索测试/检索参数"三tab Batch A: manifest.rs 按能力域拆为 10 个分组函数(context/doc/knowledge_rag/block/page/mindmap/office/onlyoffice/artifact) Batch D: 新增 agent-stream-event-router.js 共享模块(事件状态机 + SSE 帧解析) Batch E: settings popover 新增"仪表盘"tab — 知识库文件数/Skills数量/MCP连接状态/Agent run次数 836/838 Rust 测试通过(仅 2 个预存失败)
This commit is contained in:
@@ -5,25 +5,76 @@ pub const MANIFEST_SCHEMA_VERSION: &str = "mnote.hermes_tool_manifest.v1";
|
||||
pub const TOOL_SCHEMA_VERSION: &str = "mnote.hermes_tool.v1";
|
||||
|
||||
pub fn manifest() -> Value {
|
||||
let tools = annotate_tools_with_capabilities(vec![
|
||||
skill_read_tool(),
|
||||
let tools = annotate_tools_with_capabilities(assemble_all_tools());
|
||||
json!({
|
||||
"schemaVersion": MANIFEST_SCHEMA_VERSION,
|
||||
"plugin": {
|
||||
"name": "mnote",
|
||||
"description": "mnote 页面、树、artifact 与 edge 工具",
|
||||
"runtimeOwner": "mnote-web",
|
||||
"writeOwner": "rust-runtime-kernel"
|
||||
},
|
||||
"capabilities": skill::manifest_capabilities(),
|
||||
"tools": tools
|
||||
})
|
||||
}
|
||||
|
||||
// ── 按能力域分组的工具组装函数 ──
|
||||
|
||||
fn assemble_all_tools() -> Vec<Value> {
|
||||
let mut tools = Vec::new();
|
||||
tools.push(skill_read_tool());
|
||||
tools.append(&mut context_tools());
|
||||
tools.append(&mut doc_tools());
|
||||
tools.append(&mut knowledge_rag_tools());
|
||||
tools.append(&mut block_tools());
|
||||
tools.append(&mut page_tools());
|
||||
tools.append(&mut mindmap_tools());
|
||||
tools.append(&mut office_tools());
|
||||
tools.append(&mut onlyoffice_tools());
|
||||
tools.append(&mut artifact_tools());
|
||||
tools
|
||||
}
|
||||
|
||||
fn context_tools() -> Vec<Value> {
|
||||
vec![
|
||||
context_snapshot_tool(),
|
||||
context_read_current_page_tool(),
|
||||
context_resolve_target_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn doc_tools() -> Vec<Value> {
|
||||
vec![
|
||||
doc_fetch_tool(),
|
||||
doc_find_tool(),
|
||||
doc_markdown_edit_tool(),
|
||||
doc_apply_block_ops_tool(),
|
||||
doc_plan_update_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn knowledge_rag_tools() -> Vec<Value> {
|
||||
vec![
|
||||
knowledge_rag_status_tool(),
|
||||
knowledge_rag_query_tool(),
|
||||
knowledge_rag_section_context_tool(),
|
||||
knowledge_rag_open_reference_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn block_tools() -> Vec<Value> {
|
||||
vec![
|
||||
block_fetch_tool(),
|
||||
doc_plan_update_tool(),
|
||||
block_replace_tool(),
|
||||
block_insert_after_tool(),
|
||||
block_delete_tool(),
|
||||
block_move_after_tool(),
|
||||
doc_apply_block_ops_tool(),
|
||||
doc_markdown_edit_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn page_tools() -> Vec<Value> {
|
||||
vec![
|
||||
page_get_tool(),
|
||||
page_save_tool(),
|
||||
available_tool(
|
||||
@@ -36,11 +87,26 @@ pub fn manifest() -> Value {
|
||||
"更新当前页面设置",
|
||||
["page.write"],
|
||||
),
|
||||
]
|
||||
}
|
||||
|
||||
fn mindmap_tools() -> Vec<Value> {
|
||||
vec![
|
||||
mindmap_fetch_tool(),
|
||||
mindmap_apply_ops_tool(),
|
||||
mindmap_create_from_outline_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn office_tools() -> Vec<Value> {
|
||||
vec![
|
||||
office_fetch_summary_tool(),
|
||||
office_propose_changes_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn onlyoffice_tools() -> Vec<Value> {
|
||||
vec![
|
||||
onlyoffice_session_current_tool(),
|
||||
onlyoffice_capabilities_tool(),
|
||||
onlyoffice_selection_get_tool(),
|
||||
@@ -76,6 +142,11 @@ pub fn manifest() -> Value {
|
||||
onlyoffice_presentation_add_table_tool(),
|
||||
onlyoffice_presentation_clear_slide_tool(),
|
||||
onlyoffice_presentation_add_shape_tool(),
|
||||
]
|
||||
}
|
||||
|
||||
fn artifact_tools() -> Vec<Value> {
|
||||
vec![
|
||||
available_tool(
|
||||
"mnote.artifact.create_summary",
|
||||
"为当前页面创建或更新 AI Summary",
|
||||
@@ -86,20 +157,11 @@ pub fn manifest() -> Value {
|
||||
"基于当前页面创建新的 AI Note",
|
||||
["artifact.write"],
|
||||
),
|
||||
]);
|
||||
json!({
|
||||
"schemaVersion": MANIFEST_SCHEMA_VERSION,
|
||||
"plugin": {
|
||||
"name": "mnote",
|
||||
"description": "mnote 页面、树、artifact 与 edge 工具",
|
||||
"runtimeOwner": "mnote-web",
|
||||
"writeOwner": "rust-runtime-kernel"
|
||||
},
|
||||
"capabilities": skill::manifest_capabilities(),
|
||||
"tools": tools
|
||||
})
|
||||
]
|
||||
}
|
||||
|
||||
|
||||
|
||||
fn annotate_tools_with_capabilities(tools: Vec<Value>) -> Vec<Value> {
|
||||
tools
|
||||
.into_iter()
|
||||
|
||||
Reference in New Issue
Block a user