feat: add generation trace and partial-ready workflow status

This commit is contained in:
2026-04-18 21:53:55 +08:00
parent 96dfc677e2
commit e99a7fbe14
36 changed files with 2597 additions and 144 deletions

View File

@@ -0,0 +1,51 @@
export interface GenerationJobSummary {
id: string
story_id: number | null
output_mode: string
input_type: string
status: string
current_step: string
progress_percent: number
progress_label: string
is_terminal: boolean
result_snapshot: Record<string, unknown>
error_message: string | null
created_at: string
updated_at: string
}
export interface GenerationJobEvent {
id: number
job_id: string
story_id: number | null
event_type: string
status: string
message: string | null
event_metadata: Record<string, unknown>
created_at: string
}
export interface GenerationJobDetail extends GenerationJobSummary {
request_payload: Record<string, unknown>
events: GenerationJobEvent[]
}
export interface GenerationProviderStat {
capability: string
adapter: string
call_count: number
success_count: number
failure_count: number
avg_latency_ms: number | null
estimated_cost_usd: number
}
export interface GenerationProviderStats {
story_id: number
total_calls: number
successful_calls: number
failed_calls: number
avg_latency_ms: number | null
estimated_cost_usd: number
by_provider: GenerationProviderStat[]
}