Skip to content

An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作

:sparkles: AI Agent https://github.com/siyuan-note/siyuan/issues/17797

Daniel61ce34707be5
diff --git a/app/src/layout/dock/Files.ts b/app/src/layout/dock/Files.ts
index 5cac16a39b..872c9c6044 100644
--- a/app/src/layout/dock/Files.ts
+++ b/app/src/layout/dock/Files.ts
@@ -1257,6 +1257,7 @@ data-type="navigation-root" data-path="/">
box: string,
path: string
}, setStorage = true, isSetCurrent = true) {
+ filePath = filePath.replace(/\/\/+/g, "/");
const treeElement = this.element.querySelector(`[data-url="${notebookId}"]`);
if (!treeElement) {
// 有文件树和编辑器的布局初始化时,文件树还未挂载
diff --git a/kernel/mcp/tools/document.go b/kernel/mcp/tools/document.go
index 42d39e7897..dee9d9616f 100644
--- a/kernel/mcp/tools/document.go
+++ b/kernel/mcp/tools/document.go
@@ -126,7 +126,7 @@ func documentCreate(args map[string]interface{}) (CallToolResult, error) {
}
id := ast.NewNodeID()
- docPath := parentPath + "/" + id + ".sy"
+ docPath := strings.TrimRight(parentPath, "/") + "/" + id + ".sy"
tree, err := model.CreateDocByMd(notebook, docPath, title, markdown, nil, nil)
if err != nil {
return CallToolResult{Content: []ContentItem{{Type: "text", Text: fmt.Sprintf("create doc failed: %s", err)}}, IsError: true}, nil