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

Daniel32cbfe5f18c7
diff --git a/app/src/layout/dock/AgentComposer.ts b/app/src/layout/dock/AgentComposer.ts
index 18baa206ea..da4597015c 100644
--- a/app/src/layout/dock/AgentComposer.ts
+++ b/app/src/layout/dock/AgentComposer.ts
@@ -301,6 +301,17 @@ export function mountComposer(host: HTMLElement, onSend: () => void): ComposerHa
const slashPos = $from.pos - query.length - 1;
slashActive = true;
slashRange = {from: slashPos, to: $from.pos};
+ const slashCoords = editor.view.coordsAtPos($from.pos);
+ const slashClientRect = function () {
+ return {
+ left: slashCoords.left,
+ top: slashCoords.top,
+ right: slashCoords.right,
+ bottom: slashCoords.bottom,
+ width: slashCoords.right - slashCoords.left,
+ height: slashCoords.bottom - slashCoords.top,
+ } as DOMRect;
+ };
const filterAndOpen = function (skills: BlockHit[]) {
const q = query.toLowerCase();
@@ -313,7 +324,7 @@ export function mountComposer(host: HTMLElement, onSend: () => void): ComposerHa
slashActive = false;
slashRange = null;
};
- openMenu(filtered, suggestionCommand!);
+ openMenu(filtered, suggestionCommand!, slashClientRect);
cachedSkills = skills;
};
diff --git a/kernel/util/skill.go b/kernel/util/skill.go
index f2deaa34ba..c559bedb84 100644
--- a/kernel/util/skill.go
+++ b/kernel/util/skill.go
@@ -25,8 +25,8 @@ import (
)
type SkillInfo struct {
- Name string
- Description string
+ Name string `json:"name"`
+ Description string `json:"description"`
}
func SkillsDir() string {