skill_definition.py 1.2 KB

12345678910111213141516171819202122
  1. from core_db import AuditMixin, Base, EntityMixin
  2. from core_shared import JSONValue
  3. from sqlalchemy import String, Text
  4. from sqlalchemy import JSON
  5. from sqlalchemy.orm import Mapped, mapped_column
  6. class SkillDefinition(EntityMixin, AuditMixin, Base):
  7. __tablename__ = "skill_definition"
  8. code: Mapped[str] = mapped_column(String(64), index=True)
  9. name: Mapped[str] = mapped_column(String(128))
  10. skill_type: Mapped[str] = mapped_column(String(32), default="template", index=True)
  11. description: Mapped[str | None] = mapped_column(Text, nullable=True)
  12. status: Mapped[str] = mapped_column(String(32), default="draft", index=True)
  13. owner_user_id: Mapped[str | None] = mapped_column(String(36), nullable=True)
  14. runtime_type: Mapped[str] = mapped_column(String(32), default="template")
  15. entrypoint: Mapped[str | None] = mapped_column(String(128), nullable=True)
  16. parameter_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  17. output_schema_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  18. implementation_json: Mapped[dict[str, JSONValue]] = mapped_column(JSON, default=dict)
  19. metadata_json: Mapped[dict[str, JSONValue] | None] = mapped_column(JSON, nullable=True)