mirror of
https://github.com/bleak-ai/gcontext.git
synced 2026-08-11 13:19:23 +02:00
API: replace the marketplace (submit/approve/reject/moderation) with a minimal counter table (id + downloads). Single upsert endpoint auto-creates rows on first ping, X-Source: site exclusion preserved. Inline migration copies existing counts and drops legacy tables. Removes slowapi, pyyaml, manifest validation, and all moderation routes. CLI: gcontext add now pings the API after a successful registry install so the download counter reflects real usage. Fire-and-forget with 3s timeout, gated to skip when GCONTEXT_REGISTRY is overridden (tests, private registries). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
16 lines
373 B
Python
16 lines
373 B
Python
from sqlalchemy import Integer, Text
|
|
from sqlalchemy.orm import DeclarativeBase, Mapped, mapped_column
|
|
|
|
|
|
class Base(DeclarativeBase):
|
|
pass
|
|
|
|
|
|
class Workflow(Base):
|
|
__tablename__ = "workflows"
|
|
|
|
id: Mapped[str] = mapped_column(Text, primary_key=True)
|
|
downloads: Mapped[int] = mapped_column(
|
|
Integer, nullable=False, default=0, server_default="0"
|
|
)
|