c1eef4c6aa
Screen-capture lead tool: capture agent, Claude vision extractor with pluggable site recipes (LinkedIn), canonical funnel model, SQLite storage, FastAPI backend, dashboard, and setup/run scripts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
26 lines
694 B
Python
26 lines
694 B
Python
"""Recipe registry. Register new site recipes here — nothing else changes."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from core.models import PageContext, PageMatch
|
|
from .base import SiteRecipe
|
|
from .linkedin import LinkedInRecipe
|
|
|
|
REGISTRY: list[SiteRecipe] = [
|
|
LinkedInRecipe(),
|
|
]
|
|
|
|
|
|
def enabled_recipes() -> list[SiteRecipe]:
|
|
return [r for r in REGISTRY if r.enabled]
|
|
|
|
|
|
def match(ctx: PageContext) -> Optional[tuple[SiteRecipe, PageMatch]]:
|
|
"""Return the first enabled recipe that recognises the page context."""
|
|
for recipe in enabled_recipes():
|
|
m = recipe.matches(ctx)
|
|
if m is not None:
|
|
return recipe, m
|
|
return None
|