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

1
.gitignore vendored
View File

@@ -27,3 +27,4 @@ coverage.xml
coverage/
.deer-flow/
.claude/
skills/custom/*

View File

@@ -8,6 +8,12 @@ gateway:
uv run uvicorn src.gateway.app:app --host 0.0.0.0 --port 8001
nginx:
@echo "Stopping existing nginx if any..."
@-nginx -c $(PWD)/../nginx.conf -p $(PWD)/.. -s quit 2>/dev/null || true
@sleep 1
@-pkill -9 nginx 2>/dev/null || true
@sleep 1
@echo "Starting nginx..."
nginx -c $(PWD)/../nginx.conf -p $(PWD)/..
serve:
@@ -16,6 +22,8 @@ serve:
@-pkill -f "uvicorn src.gateway.app:app" 2>/dev/null || true
@-nginx -c $(PWD)/../nginx.conf -p $(PWD)/.. -s quit 2>/dev/null || true
@sleep 1
@-pkill -9 nginx 2>/dev/null || true
@sleep 1
@echo "Starting services..."
@trap 'kill 0' EXIT; \
uv run langgraph dev --no-browser --allow-blocking --no-reload & \

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}")