- Register 'backlinking' FeatureGroup in feature_registry.py with
routers=routers.backlink_outreach:router
- Add 'backlinking' profile to PROFILE_GROUP_MAP (core + backlinking)
- Add backlink_outreach to OPTIONAL_ROUTER_REGISTRY with
features={'all', 'backlinking'}
- Remove direct import/include of backlink_outreach from app.py
(router manager handles both 'all' and 'backlinking' modes)
- Add BACKLINKING key to FEATURE_KEYS and route priority in
frontend demoMode.ts
- Change frontend route gate from feature='seo' to feature='backlinking'
so ALWRITY_ENABLED_FEATURES=backlinking enables the route
77 lines
2.2 KiB
Python
77 lines
2.2 KiB
Python
"""Feature registry for profile-based capability toggles.
|
|
|
|
This module stores normalized feature-group definitions used by the
|
|
feature profile runtime.
|
|
"""
|
|
|
|
from __future__ import annotations
|
|
|
|
from dataclasses import dataclass, field
|
|
from typing import Dict, Tuple
|
|
|
|
|
|
@dataclass(frozen=True)
|
|
class FeatureGroup:
|
|
"""Single feature group and the capabilities it enables."""
|
|
|
|
routers: Tuple[str, ...] = ()
|
|
startup_hooks: Tuple[str, ...] = ()
|
|
optional_services: Tuple[str, ...] = ()
|
|
features: Tuple[str, ...] = field(default_factory=tuple)
|
|
|
|
|
|
FEATURE_GROUPS: Dict[str, FeatureGroup] = {
|
|
"core": FeatureGroup(
|
|
features=("core", "health", "onboarding", "research"),
|
|
routers=(
|
|
"api.component_logic:router",
|
|
"api.subscription:router",
|
|
"api.onboarding_utils.step3_routes:router",
|
|
"api.research.router:router",
|
|
),
|
|
startup_hooks=(
|
|
"services.database:init_database",
|
|
),
|
|
optional_services=(
|
|
"services.scheduler:get_scheduler",
|
|
),
|
|
),
|
|
"podcast": FeatureGroup(
|
|
features=("podcast",),
|
|
routers=("api.podcast.router:router",),
|
|
),
|
|
"youtube": FeatureGroup(
|
|
features=("youtube",),
|
|
routers=("api.youtube.router:router",),
|
|
),
|
|
"content_planning": FeatureGroup(
|
|
features=("content_planning", "strategy_copilot"),
|
|
routers=(
|
|
"api.content_planning.api.router:router",
|
|
"api.content_planning.strategy_copilot:router",
|
|
),
|
|
),
|
|
"blog_writer": FeatureGroup(
|
|
features=("blog_writer",),
|
|
routers=(
|
|
"api.blog_writer.router:router",
|
|
"api.blog_writer.seo_analysis:router",
|
|
),
|
|
),
|
|
"backlinking": FeatureGroup(
|
|
features=("backlinking",),
|
|
routers=("routers.backlink_outreach:router",),
|
|
),
|
|
}
|
|
|
|
|
|
PROFILE_GROUP_MAP: Dict[str, Tuple[str, ...]] = {
|
|
"all": tuple(FEATURE_GROUPS.keys()),
|
|
"core": ("core",),
|
|
"podcast": ("core", "podcast"),
|
|
"youtube": ("core", "youtube"),
|
|
"blog_writer": ("core", "blog_writer"),
|
|
"backlinking": ("core", "backlinking"),
|
|
"planning": ("core", "content_planning"),
|
|
}
|