An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:art: fix https://github.com/siyuan-note/siyuan/issues/7894
Vanessaa674f8fbeca4
diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.tsindex 20b5aedf10..bc892e847d 100644--- a/app/src/ai/actions.ts+++ b/app/src/ai/actions.ts@@ -14,6 +14,9 @@ import {hasClosestByClassName} from "../protyle/util/hasClosest";import {escapeAttr, escapeHtml} from "../util/escape";export const fillContent = (protyle: IProtyle, data: string, elements: Element[]) => {+ if (!data) {+ return;+ }setLastNodeRange(getContenteditableElement(elements[elements.length - 1]), protyle.toolbar.range);protyle.toolbar.range.collapse(true);insertHTML(data, protyle, true, true);@@ -55,7 +58,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {action: inputElement.value,}, (response) => {dialog.destroy();- fillContent(protyle, response.data || "", elements);+ fillContent(protyle, response.data, elements);});});}@@ -119,11 +122,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {ids,action: item.memo,}, (response) => {- let respContent = "";- if (response.data && "" !== response.data) {- respContent = "\n\n" + response.data;- }- fillContent(protyle, `${item.memo}${respContent}`, elements);+ fillContent(protyle, response.data, elements);});window.siyuan.menus.menu.remove();}