diff --git a/.github/workflows/claude-code-review.yml b/.github/workflows/claude-code-review.yml index 205b0fe2..81170e84 100644 --- a/.github/workflows/claude-code-review.yml +++ b/.github/workflows/claude-code-review.yml @@ -54,4 +54,3 @@ jobs: # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options claude_args: '--allowed-tools "Bash(gh issue view:*),Bash(gh search:*),Bash(gh issue list:*),Bash(gh pr comment:*),Bash(gh pr diff:*),Bash(gh pr view:*),Bash(gh pr list:*)"' - diff --git a/.github/workflows/claude.yml b/.github/workflows/claude.yml index 412cef9e..d2d60083 100644 --- a/.github/workflows/claude.yml +++ b/.github/workflows/claude.yml @@ -47,4 +47,3 @@ jobs: # See https://github.com/anthropics/claude-code-action/blob/main/docs/usage.md # or https://docs.claude.com/en/docs/claude-code/cli-reference for available options # claude_args: '--allowed-tools Bash(gh pr:*)' - diff --git a/src/celeste/artifacts.py b/src/celeste/artifacts.py new file mode 100644 index 00000000..e6424f2e --- /dev/null +++ b/src/celeste/artifacts.py @@ -0,0 +1,52 @@ +"""Unified artifact types for Celeste.""" + +from typing import Any + +from pydantic import BaseModel, Field + +from celeste.mime_types import AudioMimeType, ImageMimeType, MimeType, VideoMimeType + + +class Artifact(BaseModel): + """Base class for all media artifacts.""" + + url: str | None = None + data: bytes | None = None + path: str | None = None + mime_type: MimeType | None = None + metadata: dict[str, Any] = Field(default_factory=dict) + + @property + def has_content(self) -> bool: + """Check if artifact has any content.""" + return bool( + (self.url and self.url.strip()) + or self.data + or (self.path and self.path.strip()) + ) + + +class ImageArtifact(Artifact): + """Image artifact from generation/edit operations.""" + + mime_type: ImageMimeType | None = None + + +class VideoArtifact(Artifact): + """Video artifact from generation operations.""" + + mime_type: VideoMimeType | None = None + + +class AudioArtifact(Artifact): + """Audio artifact from TTS/transcription operations.""" + + mime_type: AudioMimeType | None = None + + +__all__ = [ + "Artifact", + "AudioArtifact", + "ImageArtifact", + "VideoArtifact", +] diff --git a/src/celeste/mime_types.py b/src/celeste/mime_types.py new file mode 100644 index 00000000..708d49e5 --- /dev/null +++ b/src/celeste/mime_types.py @@ -0,0 +1,47 @@ +"""MIME type enumerations for Celeste.""" + +from enum import StrEnum + + +class MimeType(StrEnum): + """Base class for all MIME types.""" + + pass + + +class ImageMimeType(MimeType): + """Standard MIME types for images.""" + + PNG = "image/png" + JPEG = "image/jpeg" + WEBP = "image/webp" + + +class VideoMimeType(MimeType): + """Standard MIME types for videos.""" + + MP4 = "video/mp4" + AVI = "video/x-msvideo" + MOV = "video/quicktime" + + +class AudioMimeType(MimeType): + """Standard MIME types for audio.""" + + MP3 = "audio/mpeg" + WAV = "audio/wav" + OGG = "audio/ogg" + WEBM = "audio/webm" + AAC = "audio/aac" + FLAC = "audio/flac" + AIFF = "audio/aiff" + M4A = "audio/mp4" + WMA = "audio/x-ms-wma" + + +__all__ = [ + "AudioMimeType", + "ImageMimeType", + "MimeType", + "VideoMimeType", +]