feat: enable public skills by default

This commit is contained in:
hetaoBackend
2026-01-20 20:37:44 +08:00
parent faba2784e1
commit abc6c21b11
4 changed files with 15 additions and 5 deletions

View File

@@ -146,19 +146,20 @@ class ExtensionsConfig(BaseModel):
"""
return {name: config for name, config in self.mcp_servers.items() if config.enabled}
def is_skill_enabled(self, skill_name: str) -> bool:
def is_skill_enabled(self, skill_name: str, skill_category: str) -> bool:
"""Check if a skill is enabled.
Args:
skill_name: Name of the skill
skill_category: Category of the skill
Returns:
True if enabled, False otherwise (default if not in config)
True if enabled, False otherwise
"""
skill_config = self.skills.get(skill_name)
if skill_config is None:
# Default to disable if not in config
return False
# Default to enable for public skill, disable for custom
return skill_category == "public"
return skill_config.enabled

View File

@@ -78,7 +78,7 @@ def load_skills(skills_path: Path | None = None, use_config: bool = True, enable
extensions_config = get_extensions_config()
for skill in skills:
skill.enabled = extensions_config.is_skill_enabled(skill.name)
skill.enabled = extensions_config.is_skill_enabled(skill.name, skill.category)
except Exception as e:
# If config loading fails, default to all enabled
print(f"Warning: Failed to load extensions config: {e}")