An open-source, privacy-first, self-hosted knowledge workspace where humans and AI agents work together 开源、隐私优先、自托管的知识工作空间,让人与智能体在此协作
TypeScript agentic-aiai-agentknowledge-baselocal-firstmarkdownmcpmindmapnote-takingself-hostedsiyuanworkspace
:rotating_light:
Vanessaaacf45d6a950
diff --git a/app/src/ai/actions.ts b/app/src/ai/actions.tsindex 461a3d64af..2dff06be68 100644--- a/app/src/ai/actions.ts+++ b/app/src/ai/actions.ts@@ -93,12 +93,12 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {window.siyuan.storage[Constants.LOCAL_AI].push({name: inputElement.value,memo: dialog.element.querySelector("textarea").value,- })+ });setStorageVal(Constants.LOCAL_AI, window.siyuan.storage[Constants.LOCAL_AI]);dialog.destroy();});}- }]+ }];window.siyuan.storage[Constants.LOCAL_AI].forEach((item: { name: string, memo: string }) => {customMenu.push({iconHTML: Constants.ZWSP,@@ -117,7 +117,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {element.remove();return true;}- })+ });} else {fetchPost("/api/ai/chatGPTWithAction", {ids,@@ -135,7 +135,7 @@ export const AIActions = (elements: Element[], protyle: IProtyle) => {event.stopPropagation();});}- })+ });});window.siyuan.menus.menu.append(new MenuItem({icon: "iconSparkles",diff --git a/app/src/protyle/header/Title.ts b/app/src/protyle/header/Title.tsindex c2b0e8d5c8..ee57016ce3 100644--- a/app/src/protyle/header/Title.ts+++ b/app/src/protyle/header/Title.ts@@ -389,7 +389,7 @@ export class Title {click: () => {quickMakeCard([this.element]);}- }]+ }];if (window.siyuan.config.flashcard.deck) {riffCardMenu.push({iconHTML: Constants.ZWSP,@@ -397,7 +397,7 @@ export class Title {click: () => {makeCard([protyle.block.rootID]);}- })+ });}window.siyuan.menus.menu.append(new MenuItem({label: window.siyuan.languages.riffCard,diff --git a/app/src/protyle/toolbar/index.ts b/app/src/protyle/toolbar/index.tsindex 305d8306a7..545f6d144d 100644--- a/app/src/protyle/toolbar/index.ts+++ b/app/src/protyle/toolbar/index.ts@@ -1280,7 +1280,7 @@ export class Toolbar {}}).forEach((item) => {if (inputElement.value === item) {- matchInput = true+ matchInput = true;}html += `<div class="b3-list-item">${item.replace(inputElement.value.toLowerCase(), "<b>" + inputElement.value.toLowerCase() + "</b>")}</div>`;});@@ -1369,7 +1369,7 @@ export class Toolbar {</div>`;const listElement = this.subElement.querySelector(".b3-list");const previewElement = this.subElement.firstElementChild.lastElementChild;- let previewPath = listElement.firstElementChild.getAttribute("data-value")+ let previewPath = listElement.firstElementChild.getAttribute("data-value");previewTemplate(previewPath, previewElement, protyle.block.parentID);listElement.addEventListener("mouseover", (event) => {const target = event.target as HTMLElement;@@ -1377,11 +1377,11 @@ export class Toolbar {if (!hoverItemElement) {return;}- const currentPath = hoverItemElement.getAttribute("data-value")+ const currentPath = hoverItemElement.getAttribute("data-value");if (previewPath === currentPath) {return;}- previewPath = currentPath+ previewPath = currentPath;previewTemplate(previewPath, previewElement, protyle.block.parentID);});const inputElement = this.subElement.querySelector("input");@@ -1394,11 +1394,11 @@ export class Toolbar {if (!isEmpty) {const currentElement = upDownHint(listElement, event);if (currentElement) {- const currentPath = currentElement.getAttribute("data-value")+ const currentPath = currentElement.getAttribute("data-value");if (previewPath === currentPath) {return;}- previewPath = currentPath+ previewPath = currentPath;previewTemplate(previewPath, previewElement, protyle.block.parentID);}}@@ -1425,11 +1425,11 @@ export class Toolbar {searchHTML += `<div data-value="${item.path}" class="b3-list-item${index === 0 ? " b3-list-item--focus" : ""}">${item.content}</div>`;});listElement.innerHTML = searchHTML || `<li class="b3-list--empty">${window.siyuan.languages.emptyContent}</li>`;- const currentPath = response.data.blocks[0]?.path+ const currentPath = response.data.blocks[0]?.path;if (previewPath === currentPath) {return;}- previewPath = currentPath+ previewPath = currentPath;previewTemplate(previewPath, previewElement, protyle.block.parentID);});});@@ -1459,11 +1459,11 @@ export class Toolbar {if (iconElement.parentElement.classList.contains("b3-list-item--focus")) {const sideElement = iconElement.parentElement.previousElementSibling || iconElement.parentElement.nextElementSibling;sideElement.classList.add("b3-list-item--focus");- const currentPath = sideElement.getAttribute("data-value")+ const currentPath = sideElement.getAttribute("data-value");if (previewPath === currentPath) {return;}- previewPath = currentPath+ previewPath = currentPath;previewTemplate(previewPath, previewElement, protyle.block.parentID);}iconElement.parentElement.remove();