from core_db import AuditMixin, Base, EntityMixin from core_shared import JSONValue from sqlalchemy import String, Text from sqlalchemy import JSON from sqlalchemy.orm import Mapped, mapped_column class SkillDefinition(EntityMixin, AuditMixin, Base): __tablename__ = "skill_definition" code: Mapped[str] = mapped_column(String(64), index=True) name: Mapped[str] = mapped_column(String(128)) skill_type: Mapped[str] = mapped_column(String(32), default="template", index=True) description: Mapped[str | None] = mapped_column(Text, nullable=True) status: Mapped[str] = mapped_column(String(32), default="draft", index=True) owner_user_id: Mapped[str | None] = mapped_column(String(36), nullable=True) runtime_type: Mapped[str] = mapped_column(String(32), default="template") entrypoint: Mapped[str | None] = mapped_column(String(128), nullable=True) parameter_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict) output_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict) implementation_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict) metadata_json: Mapped[dict[str, JSONValue] | None] = mapped_column(JSON, nullable=True)