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: https://github.com/siyuan-note/siyuan/issues/17797
Vanessa4234d8cb076d
diff --git a/app/src/layout/dock/agent/AgentChat.ts b/app/src/layout/dock/agent/AgentChat.tsindex b437c2a375..06aecc9dcb 100644--- a/app/src/layout/dock/agent/AgentChat.ts+++ b/app/src/layout/dock/agent/AgentChat.ts@@ -631,10 +631,12 @@ export class AgentChat extends Model {});this.newSessionBtn.addEventListener("click", (e: MouseEvent) => {e.stopPropagation();+ setPanelFocus(this.parent.panelElement);this.createSession();});this.sessionMenuBtn.addEventListener("click", (e: MouseEvent) => {e.stopPropagation();+ setPanelFocus(this.parent.panelElement);this.sessionPanel.toggle();});@@ -1328,7 +1330,7 @@ export class AgentChat extends Model {}// Capture a read-only snapshot of the user's editor to inject into the system prompt.- // Strategy: scan ALL editors. Prefer one that (a) is visible and (b) has selected blocks;+ // Strategy: scan ALL editors. Prefer one that (a) is visible and (b) has selected blocks;// this directly targets "user selected blocks here" regardless of which window has focus.// Falls back to the editor hosting the DOM selection, then the most-recently-activated tab.private captureEditorContext(): IEditorContext | undefined {