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: Add plugin name to command palette https://github.com/siyuan-note/siyuan/issues/8644
Danielba3f5fe5e530
diff --git a/kernel/bazaar/plugin.go b/kernel/bazaar/plugin.goindex 1d9b7674fa..002be1dc49 100644--- a/kernel/bazaar/plugin.go+++ b/kernel/bazaar/plugin.go@@ -108,7 +108,7 @@ func Plugins(frontend string) (plugins []*Plugin) {return}-func IsIncompatibleInstalledPlugin(name, frontend string) (found, incompatible bool) {+func ParseInstalledPlugin(name, frontend string) (found bool, displayName string, incompatible bool) {pluginsPath := filepath.Join(util.DataDir, "plugins")if !util.IsPathRegularDirOrSymlinkDir(pluginsPath) {return@@ -135,6 +135,7 @@ func IsIncompatibleInstalledPlugin(name, frontend string) (found, incompatible b}found = true+ displayName = getPreferredName(plugin.Package)incompatible = isIncompatiblePlugin(plugin, frontend)}returndiff --git a/kernel/model/plugin.go b/kernel/model/plugin.goindex 775b1d8559..1bdccc7097 100644--- a/kernel/model/plugin.go+++ b/kernel/model/plugin.go@@ -32,6 +32,7 @@ import (// Petal represents a plugin's management status.type Petal struct {Name string `json:"name"` // Plugin name+ DisplayName string `json:"displayName"` // Plugin display nameEnabled bool `json:"enabled"` // Whether enabledIncompatible bool `json:"incompatible"` // Whether incompatible@@ -43,7 +44,7 @@ type Petal struct {func SetPetalEnabled(name string, enabled bool, frontend string) (ret *Petal, err error) {petals := getPetals()- found, incompatible := bazaar.IsIncompatibleInstalledPlugin(name, frontend)+ found, displayName, incompatible := bazaar.ParseInstalledPlugin(name, frontend)if !found {logging.LogErrorf("plugin [%s] not found", name)return@@ -56,6 +57,7 @@ func SetPetalEnabled(name string, enabled bool, frontend string) (ret *Petal, er}petals = append(petals, ret)}+ ret.DisplayName = displayNameret.Enabled = enabledret.Incompatible = incompatible@@ -78,7 +80,7 @@ func LoadPetals(frontend string) (ret []*Petal) {petals := getPetals()for _, petal := range petals {- _, petal.Incompatible = bazaar.IsIncompatibleInstalledPlugin(petal.Name, frontend)+ _, petal.DisplayName, petal.Incompatible = bazaar.ParseInstalledPlugin(petal.Name, frontend)if !petal.Enabled || petal.Incompatible {continue}