mirror of
https://gitee.com/wanwujie/deer-flow
synced 2026-04-18 12:04:45 +08:00
feat: enable public skills by default
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -27,3 +27,4 @@ coverage.xml
|
|||||||
coverage/
|
coverage/
|
||||||
.deer-flow/
|
.deer-flow/
|
||||||
.claude/
|
.claude/
|
||||||
|
skills/custom/*
|
||||||
|
|||||||
@@ -8,6 +8,12 @@ gateway:
|
|||||||
uv run uvicorn src.gateway.app:app --host 0.0.0.0 --port 8001
|
uv run uvicorn src.gateway.app:app --host 0.0.0.0 --port 8001
|
||||||
|
|
||||||
nginx:
|
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)/..
|
nginx -c $(PWD)/../nginx.conf -p $(PWD)/..
|
||||||
|
|
||||||
serve:
|
serve:
|
||||||
@@ -16,6 +22,8 @@ serve:
|
|||||||
@-pkill -f "uvicorn src.gateway.app:app" 2>/dev/null || true
|
@-pkill -f "uvicorn src.gateway.app:app" 2>/dev/null || true
|
||||||
@-nginx -c $(PWD)/../nginx.conf -p $(PWD)/.. -s quit 2>/dev/null || true
|
@-nginx -c $(PWD)/../nginx.conf -p $(PWD)/.. -s quit 2>/dev/null || true
|
||||||
@sleep 1
|
@sleep 1
|
||||||
|
@-pkill -9 nginx 2>/dev/null || true
|
||||||
|
@sleep 1
|
||||||
@echo "Starting services..."
|
@echo "Starting services..."
|
||||||
@trap 'kill 0' EXIT; \
|
@trap 'kill 0' EXIT; \
|
||||||
uv run langgraph dev --no-browser --allow-blocking --no-reload & \
|
uv run langgraph dev --no-browser --allow-blocking --no-reload & \
|
||||||
|
|||||||
@@ -146,19 +146,20 @@ class ExtensionsConfig(BaseModel):
|
|||||||
"""
|
"""
|
||||||
return {name: config for name, config in self.mcp_servers.items() if config.enabled}
|
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.
|
"""Check if a skill is enabled.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
skill_name: Name of the skill
|
skill_name: Name of the skill
|
||||||
|
skill_category: Category of the skill
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
True if enabled, False otherwise (default if not in config)
|
True if enabled, False otherwise
|
||||||
"""
|
"""
|
||||||
skill_config = self.skills.get(skill_name)
|
skill_config = self.skills.get(skill_name)
|
||||||
if skill_config is None:
|
if skill_config is None:
|
||||||
# Default to disable if not in config
|
# Default to enable for public skill, disable for custom
|
||||||
return False
|
return skill_category == "public"
|
||||||
return skill_config.enabled
|
return skill_config.enabled
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -78,7 +78,7 @@ def load_skills(skills_path: Path | None = None, use_config: bool = True, enable
|
|||||||
|
|
||||||
extensions_config = get_extensions_config()
|
extensions_config = get_extensions_config()
|
||||||
for skill in skills:
|
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:
|
except Exception as e:
|
||||||
# If config loading fails, default to all enabled
|
# If config loading fails, default to all enabled
|
||||||
print(f"Warning: Failed to load extensions config: {e}")
|
print(f"Warning: Failed to load extensions config: {e}")
|
||||||
|
|||||||
Reference in New Issue
Block a user