feat: unify source libraries, generation plans and terminal bindings
Community checks / verify (push) Skipped
Verify Frame Flow / verify (push) Failing after 6m24s

This commit is contained in:
渡口浪人
2026-10-23 17:45:30 +08:00
parent 081d8b6ee0
commit 6277c9d563
25 changed files with 5731 additions and 45 deletions
+13
View File
@@ -170,6 +170,10 @@ class ErrorResponse(BaseModel):
class OperationResult(BaseModel):
source_image_id: str | None = None
outputs: list[dict[str, Any]] = Field(default_factory=list)
errors: list[dict[str, Any]] = Field(default_factory=list)
wrist_thumbnail: dict[str, Any] | None = None
image_name: str | None = None
preview_url: str | None = None
cover_id: int | None = None
@@ -283,6 +287,7 @@ class RestoreContent(StrictModel):
class JobInput(StrictModel):
library_pipeline: bool = False
generate_thumbnail: bool = False
thumbnail_plan_id: str | None = Field(default=None, pattern=r"^[a-f0-9]{32}$")
cleanup_unstarred: bool = False
@@ -297,6 +302,14 @@ class JobInput(StrictModel):
@model_validator(mode="after")
def validate_options(self):
if self.library_pipeline and (
not isinstance(self.source, PhotoSourceContent)
or self.generate_thumbnail
or self.cleanup_unstarred
):
raise ValueError(
"Source-library tasks require a photo source and use terminal-bound generation plans"
)
if self.generate_thumbnail and (
not self.thumbnail_plan_id
or not isinstance(self.source, PhotoSourceContent)