refactor: remove core skill direct loading, skills owned by clawhubadapter only

- Drop skill.NewManager from homed bootstrap; skills dir no longer core-managed
- Remove GetInjectedPrompt system-prompt injection (skills are not first-class)
- Delete internal/skill package, SkillAPI, webui /api/v1/skills, status skills block
- ConfigRegistry: plugin config tables now created only via RegisterDef; arbitrary
  scope Set/Get no longer implicitly creates config_<name> tables (fixes stray
  config_today_task table from SKILL directory name being used as a scope)
This commit is contained in:
root
2026-08-02 11:40:13 +08:00
parent 1013aa0aa9
commit c7ee45d6e1
13 changed files with 10 additions and 333 deletions

View File

@ -711,7 +711,6 @@ func (r *ConfigRegistry) ListPlugins() []string {
}
func (r *ConfigRegistry) PluginConfig(name string) *PluginSettings {
r.ensurePluginTable(name)
return &PluginSettings{
registry: r,
table: r.pluginTableName(name),
@ -768,6 +767,9 @@ func (p *PluginSettings) List(prefix string) ([]string, error) {
func (p *PluginSettings) RegisterDef(def ConfigDef) {
p.registry.mu.Lock()
defer p.registry.mu.Unlock()
// 只有注册配置定义才创建插件配置表:任意 scope 的读写不得隐式建表,
// 避免非插件(如 SKILL 目录名)被注册成配置命名空间。
p.registry.ensurePluginTable(p.name)
p.registry.db.Exec(fmt.Sprintf(`INSERT OR IGNORE INTO %s (key, value) VALUES (?, ?)`, p.table), def.Key, def.Default)
qualified := "plugin." + p.name + "." + def.Key
def.Key = qualified

View File

@ -121,6 +121,7 @@ func TestPluginConfig(t *testing.T) {
r := NewConfigRegistry(path)
ps := r.PluginConfig("test_deepseek")
ps.RegisterDef(ConfigDef{Key: "api_key", Default: "sk-test123"})
if err := ps.Set("api_key", "sk-test123"); err != nil {
t.Fatalf("PluginSettings.Set: %v", err)
}