This commit is contained in:
2026-03-26 06:10:19 -03:00
parent 731964ca10
commit e27cb5bcc3
41 changed files with 2079 additions and 95 deletions

View File

@@ -7,6 +7,9 @@
export type AssetStatus = "pending" | "ready" | "error";
export type JobStatus = "pending" | "processing" | "completed" | "failed" | "cancelled";
export type ChunkJobStatus = "pending" | "chunking" | "processing" | "collecting" | "completed" | "failed" | "cancelled";
export type DetectJobStatus = "pending" | "running" | "paused" | "completed" | "failed" | "cancelled";
export type RunType = "initial" | "replay" | "retry";
export type BrandSource = "ocr" | "local_vlm" | "cloud_llm" | "manual";
export interface MediaAsset {
id: string;
@@ -97,6 +100,75 @@ export interface ChunkJob {
completed_at: string | null;
}
export interface DetectJob {
id: string;
source_asset_id: string;
video_path: string;
profile_name: string;
parent_job_id: string | null;
run_type: RunType;
replay_from_stage: string | null;
config_overrides: Record<string, unknown>;
status: DetectJobStatus;
current_stage: string | null;
progress: number;
error_message: string | null;
total_detections: number;
brands_found: number;
cloud_llm_calls: number;
estimated_cost_usd: number;
celery_task_id: string | null;
priority: number;
created_at: string | null;
started_at: string | null;
completed_at: string | null;
}
export interface StageCheckpoint {
id: string;
job_id: string;
stage: string;
stage_index: number;
frames_prefix: string;
frames_manifest: Record<string, unknown>;
frames_meta: string[];
filtered_frame_sequences: number[];
boxes_by_frame: Record<string, unknown>;
text_candidates: string[];
unresolved_candidates: string[];
detections: string[];
stats: Record<string, unknown>;
config_snapshot: Record<string, unknown>;
config_overrides: Record<string, unknown>;
video_path: string;
profile_name: string;
created_at: string | null;
}
export interface KnownBrand {
id: string;
canonical_name: string;
aliases: string[];
first_source: BrandSource;
total_occurrences: number;
confirmed: boolean;
created_at: string | null;
updated_at: string | null;
}
export interface SourceBrandSighting {
id: string;
source_asset_id: string;
brand_id: string;
brand_name: string;
first_seen_timestamp: number;
last_seen_timestamp: number;
occurrences: number;
detection_source: BrandSource;
avg_confidence: number;
created_at: string | null;
}
export interface CreateJobRequest {
source_asset_id: string;
preset_id: string | null;