artcraft: add remaining PageScene enums + models to ui-pagescene lib

Pure additive prep for the editor.ts/scene.ts move. Lib now owns:

- Engine-internal enums (still local to PageScene -- not re-exported
  to artcraft via the ~/enums shim because those aren't shared with
  the rest of the host): MediaFileType + MediaFileSubtype,
  MediaFileClass, WeightCategory, WeightType, Visibility, FetchStatus,
  GenerateTtsAudioErrorType, JobState, ArtStyle.
- Full models surface: assets, mediaInfo, pagination, prompts,
  sceneGenerationMetadata, types, userBookmark + index.

Models imports rewritten on copy:
- mediaInfo.ts: ~/pages/PageScene/enums -> ../enums
- types.tsx: ~/pages/PageScene/enums -> ../enums; ./movies (broken
  pre-existing import) -> ./mediaInfo (where MediaInfo actually lives;
  fixing on the way through since it's a free type fix).

Apps copies stay in place; the lib copies are still orphaned (not
exported from src/index.ts). Proxy folder also tried but needs
engine/scene which isn't in the lib yet -- deferred to the next
checkpoint with editor.ts/scene.ts.

Verified: artcraft typecheck still at 124-error baseline.
This commit is contained in:
Tanish Manku committed 2026-05-08 14:05:39 -07:00
1 parent c6a0b43324
commit 40a6644c35
17 files changed
+475

No files matched your search

@@ -0,0 +1,35 @@
export enum ArtStyle {
Anime2_5D = "anime_2_5d",
Anime2DFlat = "anime_2d_flat",
Cartoon3D = "cartoon_3d",
ComicBook = "comic_book",
AnimeGhibli = "anime_ghibli",
InkPunk = "ink_punk",
InkSplash = "ink_splash",
InkBWStyle = "ink_bw_style",
JojoStyle = "jojo_style",
PaperOrigami = "paper_origami",
PixelArt = "pixel_art",
PopArt = "pop_art",
Realistic1 = "realistic_1",
Realistic2 = "realistic_2",
AnimeRetroNeon = "anime_retro_neon",
AnimeStandard = "anime_standard",
HRGiger = "hr_giger",
Simpsons = "simpsons",
Carnage = "carnage",
PastelCuteAnime = "pastel_cute_anime",
Bloom = "bloom_lighting",
Horror2_5D = "25d_horror",
Creepy = "creepy",
CreepyVHS = "creepy_vhs",
TrailCamFootage = "trail_cam_footage",
OldBWMovie = "old_black_white_movie",
HorrorNoirBW = "horror_noir_black_white",
TechnoNoirBW = "techno_noir_black_white",
BW20s = "black_white_20s",
AnimeCyberpunk = "cyberpunk_anime",
Dragonball = "dragonball",
RealisticMatrix = "realistic_matrix",
RealisticCyberpunk = "realistic_cyberpunk",
}
@@ -0,0 +1,8 @@
export enum FetchStatus {
PAUSED,
// ready triggers a new fetch
READY,
IN_PROGRESS,
SUCCESS,
ERROR,
}
@@ -0,0 +1,7 @@
export enum GenerateTtsAudioErrorType {
BadRequest = "bad_request",
NotFound = "not_found",
TooManyRequests = "too_many_requests",
ServerError = "server_error",
UnknownError = "unknown_error",
}
@@ -0,0 +1,10 @@
export enum JobState {
UNKNOWN = "unknown", // Only on frontend.
PENDING = "pending",
STARTED = "started",
COMPLETE_SUCCESS = "complete_success",
COMPLETE_FAILURE = "complete_failure",
ATTEMPT_FAILED = "attempt_failed",
DEAD = "dead",
CANCELED_BY_USER = "canceled_by_user",
}
@@ -0,0 +1,26 @@
export enum MediaFileClass {
/// Unknown (default value)
/// This will be present until we migrate all old files.
Unknown = "unknown",
/// Audio files: wav, mp3, etc.
Audio = "audio",
/// Image files: png, jpeg, etc.
Image = "image",
/// Video files: mp4, etc.
Video = "video",
/// Engine "animations"
Animation = "animation",
/// Engine "characters"
Character = "character",
/// Engine "prop" items
Prop = "prop",
/// Engine scenes (internal and external scenes)
Scene = "scene",
}
@@ -0,0 +1,61 @@
export enum MediaFileType {
Audio = "audio",
Video = "video",
Image = "image",
// BVH is a very popular file format for motion capture.
// It is compatible with our engine.
BVH = "bvh",
// GLTF is the text-based format of GLB. Unforunately it requires a
// second file to include the visual data, so we strongly discourage
// the use of this format in favor of GLB.
GLTF = "gltf",
// GLB is the format we convert FBX files into. It's a very popular
// open source 3D file format.
GLB = "glb",
// SPLAT file type. SPZ format is a compressed and smaller format.
SPZ = "spz",
// MMD is the format for anime characters.
// open source 3D file format.
MMD = "mmd",
// FBX isn't supported by Storyteller Engine, but we can get
// uploads in this format. It's a very popular 3D graphics format.
FBX = "fbx",
// Full Storyteller Engine scenes (RON = Rusty Object Notation)
// This is a temporary format that will eventually go away.
Scene = "scene",
None = "none",
}
export enum MediaFileSubtype {
/// Animation file from Mixamo
/// Primarily used for FBX and GLB.
Mixamo = "mixamo",
/// Animation file from MocapNet
/// Primarily used for BVH.
MocapNet = "mocap_net",
/// Generic animation case
/// Used for BVH files, but can also pertain to animation-only files of other types.
AnimationOnly = "animation_only",
// TODO(bt,2024-03-08): Migrate records and code, then remove
/// DEPRECATED: Use `SceneImport` instead.
Scene = "scene",
/// Generic 3D scene file.
/// Can pertain to glTF, glB, FBX, etc.
SceneImport = "scene_import",
/// Native Storyteller scene format.
/// Typically stored in a `.scn.ron` file.
StorytellerScene = "storyteller_scene",
}
@@ -0,0 +1,5 @@
export enum Visibility {
Public = "public",
Hidden = "hidden",
Private = "private",
}
@@ -0,0 +1,8 @@
export enum WeightCategory {
TTS = "text_to_speech",
VOCODER = "vocoder",
VC = "voice_conversion",
ZS = "zero_shot",
SD = "image_generation",
WF = "workflow_config",
}
@@ -0,0 +1,11 @@
export enum WeightType {
TT2 = "tt2",
HIFIGAN_TT2 = "hifigan_tt2",
RVCv2 = "rvc_v2",
SD_15 = "sd_1.5",
SDXL = "sdxl",
SVC = "so_vits_svc",
LORA = "loRA",
VALL_E = "vall_e",
NONE = "none",
}
@@ -2,3 +2,12 @@ export * from "./AssetType";
export * from "./AssetFilterOption";
export * from "./ClipGroup";
export * from "./EditorState";
export * from "./ArtStyle";
export * from "./FetchStatus";
export * from "./GenerateTtsAudioErrorType";
export * from "./JobState";
export * from "./MediaFileClass";
export * from "./MediaFileType";
export * from "./Visibility";
export * from "./WeightCategory";
export * from "./WeightType";
@@ -1 +1,6 @@
export * from "./assets";
export * from "./mediaInfo";
export * from "./pagination";
export * from "./prompts";
export * from "./types";
export * from "./userBookmark";
@@ -0,0 +1,95 @@
import { UserDetailsLight } from "./types";
import {
MediaFileClass,
MediaFileSubtype,
MediaFileType,
WeightCategory,
WeightType,
} from "../enums";
export interface MediaInfo {
token: string;
media_type: MediaFileType;
media_class: MediaFileClass | null;
maybe_animation_type: string | null;
maybe_media_subtype: MediaFileSubtype | null;
maybe_engine_extension: string | null;
maybe_batch_token: string;
maybe_original_filename: string | null;
maybe_creator_user: UserDetailsLight | null;
maybe_prompt_token: string | null;
origin: {
origin_category: string;
product_category: string;
maybe_model: { title: string } | null;
};
origin_category: string;
origin_product_category: string;
maybe_origin_model_type: null | string;
maybe_origin_model_token: null | string;
maybe_duration_millis: number | null;
maybe_style_name: null | string;
public_bucket_path: string;
cover_image: {
maybe_cover_image_public_bucket_path: null | string;
default_cover: {
image_index: number;
color_index: number;
};
};
creator_set_visibility: string;
maybe_title: null | string;
maybe_text_transcript: null | string;
stats: {
positive_rating_count: number;
bookmark_count: number;
};
maybe_model_weight_info: {
title: string;
weight_token: string;
weight_category: WeightCategory;
weight_type: WeightType;
maybe_weight_creator: UserDetailsLight;
maybe_cover_image_public_bucket_path: string;
};
created_at: string;
updated_at: string;
}
export interface MaybeResult {
entity_token: string;
entity_type: string;
maybe_public_bucket_media_path: string;
maybe_successfully_completed_at: string;
}
export interface Request {
inference_category: string;
maybe_model_title: string;
maybe_model_token: string;
maybe_model_type: string;
maybe_raw_inference_text: string;
maybe_style_name: string;
}
export interface Status {
attempt_count: number;
maybe_assigned_cluster: string;
maybe_assigned_worker: string;
maybe_extra_status_description: string;
maybe_failure_category: string;
progress_percentage: number;
maybe_first_started_at: string;
requires_keepalive: boolean;
status: string;
}
export interface ActiveJob {
created_at: string;
job_token: string;
maybe_result: MaybeResult;
request: Request;
status: Status;
updated_at: string;
}
@@ -0,0 +1,9 @@
export interface Pagination {
current: number;
total_page_count: number;
}
export interface PaginationInfinite {
cursor_is_reversed: boolean;
maybe_next?: string;
maybe_previous?: string;
}
@@ -0,0 +1,16 @@
export interface Prompts {
created_at: string;
lcm_disabled: boolean;
lipsync_enabled: boolean;
maybe_inference_duration_millis: number;
maybe_moderator_fields: string;
maybe_negative_prompt: string;
maybe_positive_prompt: string;
maybe_strength: number;
maybe_style_name: string;
prompt_type: string;
token: string;
use_cinematic: boolean;
used_face_detailer: boolean;
used_upscaler: boolean;
}
@@ -0,0 +1,6 @@
import { CameraAspectRatio } from "../enums";
export interface SceneGenereationMetaData {
positivePrompt: string;
cameraAspectRatio: CameraAspectRatio;
}
@@ -0,0 +1,89 @@
/// A common type returned by several endpoints.
/// Basic information to display a user and their avatar.
import {
MediaFileClass,
MediaFileSubtype,
MediaFileType,
WeightCategory,
WeightType,
} from "../enums";
import { MediaInfo } from "./mediaInfo";
import { Pagination } from "./pagination";
export interface UserDetailsLight {
user_token: string;
/// Username (lowercase)
username: string;
/// Username with user-specified capitalization
display_name: string;
gravatar_hash: string;
default_avatar: DefaultAvatarInfo;
}
export interface DefaultAvatarInfo {
image_index: number;
color_index: number;
}
export interface MediaFile {
token: string;
media_type: MediaFileType;
media_class: MediaFileClass | null;
maybe_media_subtype: MediaFileSubtype | null;
public_bucket_path: string;
maybe_engine_extension: string | null;
maybe_batch_token: string;
maybe_title: string | null;
maybe_original_filename: string | null;
maybe_creator_user: UserDetailsLight | null;
maybe_prompt_token: string | null;
creator_set_visibility: string;
created_at: Date;
updated_at: Date;
maybe_model_weight_info: {
title: string;
weight_token: string;
weight_category: WeightCategory;
weight_type: WeightType;
maybe_weight_creator: UserDetailsLight;
maybe_cover_image_public_bucket_path: string;
};
}
export interface GetMediaListResponse {
pagination: Pagination;
success: boolean;
results: MediaInfo[];
}
export interface GetMediaFileResponse {
success: boolean;
media_file?: MediaFile;
}
export interface VoiceConversionModelListItem {
token: string;
model_type: string;
title: string;
creator: CreatorDetails;
creator_set_visibility: string;
ietf_language_tag: string;
ietf_primary_language_subtag: string;
is_front_page_featured: boolean;
created_at: string;
updated_at: string;
}
export interface CreatorDetails {
user_token: string;
username: string;
display_name: string;
gravatar_hash: string;
}
export interface VoiceConversionModelListResponse {
success: boolean;
models: Array<VoiceConversionModelListItem>;
}
@@ -0,0 +1,75 @@
export interface UserBookmarkBatch {
entity_token: string;
entity_type: string;
is_bookmarked: boolean;
maybe_bookmark_token: string;
}
interface DefaultAvatar {
color_index: number;
image_index: number;
}
interface User {
default_avatar: DefaultAvatar;
display_name: string;
gravatar_hash: string;
user_token: string;
username: string;
}
export interface UserBookmarkByEntity {
created_at: string;
token: string;
updated_at: string;
user: User;
}
interface DefaultAvatar {
color_index: number;
image_index: number;
}
interface Creator {
default_avatar: DefaultAvatar;
display_name: string;
gravatar_hash: string;
user_token: string;
username: string;
}
interface MediaFileData {
maybe_creator: Creator;
media_type: string; // Adjust type as per your specific schema
public_bucket_path: string;
}
interface WeightData {
maybe_cover_image_public_bucket_path: string;
maybe_creator: Creator;
title: string;
weight_category: string; // Adjust type as per your specific schema
weight_type: string; // Adjust type as per your specific schema
}
interface Stats {
bookmark_count: number;
positive_rating_count: number;
}
interface Details {
entity_token: string;
entity_type: string; // Adjust type as per your specific schema
maybe_media_file_data?: MediaFileData;
maybe_summary_text?: string;
maybe_thumbnail_url?: string;
maybe_weight_data?: WeightData;
stats: Stats;
}
export interface UserBookmarkByUser {
created_at: string;
details: Details;
token: string;
updated_at: string;
}