feat: 提交 task-045 至 task-058 收口产物

- 收口 rust final closure checklist,推进页面/块系统/Mindmap/CLI/AI tools 到最终 cutover 状态

- 按 ai-frontend-simplification-plan-v1 接入 Hermes bridge,合并 AI 面板并清理旧前端编排残留

- 补充 harness 任务与进度记录,加入 CLI smoke 夹具/脚本,并修正文档页 bridge SSR 自请求回退逻辑
This commit is contained in:
lix-2026
2026-04-16 15:24:37 +08:00
parent 98db79b301
commit 2ff10fa86c
47 changed files with 6494 additions and 2674 deletions
+10 -2
View File
@@ -28,8 +28,9 @@ pub use tool::{
default_tool_registry, invocation_kind_label, tool_effect_label, tool_mode_label,
InvocationKind, ToolEffect, ToolExecutionMode, ToolInvocation, ToolRegistry, ToolSetSpec,
ToolSpec, BRIDGE_TOOL_COMMAND_GET, BRIDGE_TOOL_REQUEST_GET, BRIDGE_TOOL_TRACE_GET,
DOC_TOOL_FIND, DOC_TOOL_GET, DOC_TOOL_INSERT_BLOCKS, DOC_TOOL_REPLACE_RANGE,
DOC_TOOLSET_READ, DOC_TOOLSET_WRITE, INDEX_TOOL_REBUILD, MINDMAP_TOOL_APPLY_OPS,
DOCS_TOOL_READ, DOCS_TOOL_SEARCH, DOCS_TOOLSET_READ, DOC_TOOL_FIND, DOC_TOOL_GET,
DOC_TOOL_INSERT_BLOCKS, DOC_TOOL_REPLACE_RANGE, DOC_TOOLSET_READ, DOC_TOOLSET_WRITE,
INDEX_TOOL_REBUILD, MINDMAP_TOOL_APPLY_OPS,
MINDMAP_TOOL_EMPTY_TRASH, MINDMAP_TOOL_EXPAND_NODE, MINDMAP_TOOL_GET,
MINDMAP_TOOL_GET_SUBTREE,
MINDMAP_TOOL_OUTLINE_TO_MINDMAP, MINDMAP_TOOL_PUT, MINDMAP_TOOLSET_READ,
@@ -81,6 +82,8 @@ mod tests {
"search_web",
"doc_get",
"doc_find",
"docs_search",
"docs_read",
"image_read",
"doc_insert_blocks",
"doc_replace_range",
@@ -140,6 +143,11 @@ mod tests {
.expect("slash toolset should exist");
assert!(slash.write_toolset);
assert_eq!(slash.tool_names, &["slash_run"]);
let docs_read = registry
.toolset("toolset.docs_read")
.expect("docs_read toolset should exist");
assert!(!docs_read.write_toolset);
assert_eq!(docs_read.tool_names, &["docs_search", "docs_read"]);
let doc_write = registry
.toolset("toolset.doc_write")
.expect("doc_write toolset should exist");
+37
View File
@@ -121,6 +121,31 @@ pub const DOC_TOOL_FIND: ToolSpec = ToolSpec {
r#"{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"maxResults":{"type":"integer","minimum":1,"maximum":30}}}"#,
};
pub const DOCS_TOOL_SEARCH: ToolSpec = ToolSpec {
name: "docs_search",
display_name: "跨页文档搜索",
description: "在工作区内搜索文档标题、正文、导图、表格与 OCR 结果。",
toolset_id: "toolset.docs_read",
invocation_kind: InvocationKind::Query,
effect: ToolEffect::Read,
requires_confirmation: false,
input_schema_json:
r#"{"type":"object","required":["query"],"properties":{"query":{"type":"string"},"workspaceId":{"type":"string"},"limit":{"type":"integer","minimum":1,"maximum":30},"includeDeleted":{"type":"boolean"},"pageId":{"type":"string"},"titleOnly":{"type":"boolean"},"exact":{"type":"boolean"},"includeOcr":{"type":"boolean"},"timeRange":{"type":"string"},"timeField":{"type":"string"},"customRangeFrom":{"type":"string"},"customRangeTo":{"type":"string"}}}"#,
};
pub const DOCS_TOOL_READ: ToolSpec = ToolSpec {
name: "docs_read",
display_name: "跨页文档读取",
description: "读取指定文档的标题、正文摘要与可选 content 快照。",
toolset_id: "toolset.docs_read",
invocation_kind: InvocationKind::Query,
effect: ToolEffect::Read,
requires_confirmation: false,
input_schema_json:
r#"{"type":"object","required":["documentId"],"properties":{"documentId":{"type":"string"},"maxChars":{"type":"integer","minimum":200,"maximum":20000},"includeContent":{"type":"boolean"}}}"#,
};
pub const IMAGE_READ_TOOL: ToolSpec = ToolSpec {
name: "image_read",
display_name: "读取图片",
@@ -381,6 +406,15 @@ pub const DOC_TOOLSET_READ: ToolSetSpec = ToolSetSpec {
tool_names: &["doc_get", "doc_find"],
};
pub const DOCS_TOOLSET_READ: ToolSetSpec = ToolSetSpec {
id: "toolset.docs_read",
display_name: "跨页文档读取",
description: "跨页面搜索与读取文档的工具集合。",
write_toolset: false,
tool_names: &["docs_search", "docs_read"],
};
pub const READONLY_TOOLSET: ToolSetSpec = ToolSetSpec {
id: "toolset.readonly",
display_name: "只读工具",
@@ -470,6 +504,7 @@ pub const DOC_TOOL_REGISTRY: ToolRegistry = ToolRegistry::new(
READONLY_TOOLSET,
MEDIA_TOOLSET,
SLASH_TOOLSET_WRITE,
DOCS_TOOLSET_READ,
DOC_TOOLSET_READ,
DOC_TOOLSET_WRITE,
MINDMAP_TOOLSET_READ,
@@ -482,6 +517,8 @@ pub const DOC_TOOL_REGISTRY: ToolRegistry = ToolRegistry::new(
SEARCH_WEB_TOOL,
DOC_TOOL_GET,
DOC_TOOL_FIND,
DOCS_TOOL_SEARCH,
DOCS_TOOL_READ,
IMAGE_READ_TOOL,
DOC_TOOL_INSERT_BLOCKS,
DOC_TOOL_REPLACE_RANGE,