LokvisEvent
LokvisEvent = {
type:"asset:imported";assetId:AssetId;metadata:AssetMetadata; } | {type:"asset:removed";assetId:AssetId; } | {type:"workflow:started";workflowId:string;workflow:Workflow; } | {type:"workflow:paused";workflowId:string; } | {type:"workflow:resumed";workflowId:string; } | {type:"workflow:cancelled";workflowId:string; } | {type:"node:started";workflowId:string;nodeId:string;inputs:Asset[]; } | {type:"node:finished";workflowId:string;nodeId:string;capability:string;params:Record<string,unknown>;outputs:Asset[];duration:number; } | {type:"node:failed";workflowId:string;nodeId:string;error:Error; } | {type:"workflow:completed";workflowId:string;result:WorkflowResult; } | {type:"export:completed";assetId:AssetId;format:string;size:number; } | {type:"history:changed";workflowId:string;entries:HistoryEntry[];currentIndex:number; } | {type:"capability:registered";capability:string;engine:string; } | {type:"plugin:loaded";name:string;version:string; } | {type:"panel:registered";panel:PanelDefinition; } | {type:"batch:started";jobId:string;total:number; } | {type:"batch:item:started";jobId:string;itemId:string;index:number;total:number; } | {type:"batch:item:finished";jobId:string;itemId:string;index:number;total:number;outputAssetId:AssetId;duration:number; } | {type:"batch:item:failed";jobId:string;itemId:string;index:number;total:number;error:Error;attempts:number; } | {type:"batch:progress";jobId:string;completed:number;failed:number;total:number; } | {type:"batch:completed";jobId:string;total:number;completed:number;failed:number;duration:number; } | {type:"batch:cancelled";jobId:string;cancelled:number; } | {type:"batch:paused";jobId:string; } | {type:"batch:resumed";jobId:string; }
Defined in: packages/schema/src/event.ts:30
Lokvis 标准事件类型联合
Union Members
Section titled “Union Members”Type Literal
Section titled “Type Literal”{ type: "asset:imported"; assetId: AssetId; metadata: AssetMetadata; }
Type Literal
Section titled “Type Literal”{ type: "asset:removed"; assetId: AssetId; }
Type Literal
Section titled “Type Literal”{ type: "workflow:started"; workflowId: string; workflow: Workflow; }
Type Literal
Section titled “Type Literal”{ type: "workflow:paused"; workflowId: string; }
Type Literal
Section titled “Type Literal”{ type: "workflow:resumed"; workflowId: string; }
Type Literal
Section titled “Type Literal”{ type: "workflow:cancelled"; workflowId: string; }
Type Literal
Section titled “Type Literal”{ type: "node:started"; workflowId: string; nodeId: string; inputs: Asset[]; }
Type Literal
Section titled “Type Literal”{ type: "node:finished"; workflowId: string; nodeId: string; capability: string; params: Record<string, unknown>; outputs: Asset[]; duration: number; }
Type Literal
Section titled “Type Literal”{ type: "node:failed"; workflowId: string; nodeId: string; error: Error; }
Type Literal
Section titled “Type Literal”{ type: "workflow:completed"; workflowId: string; result: WorkflowResult; }
Type Literal
Section titled “Type Literal”{ type: "export:completed"; assetId: AssetId; format: string; size: number; }
Type Literal
Section titled “Type Literal”{ type: "history:changed"; workflowId: string; entries: HistoryEntry[]; currentIndex: number; }
type:
"history:changed"
workflowId
Section titled “workflowId”workflowId:
string
entries
Section titled “entries”entries:
HistoryEntry[]
currentIndex
Section titled “currentIndex”currentIndex:
number
当前游标(指向最后一条已应用的 entry;-1 表示无已应用条目)
Type Literal
Section titled “Type Literal”{ type: "capability:registered"; capability: string; engine: string; }
Type Literal
Section titled “Type Literal”{ type: "plugin:loaded"; name: string; version: string; }
Type Literal
Section titled “Type Literal”{ type: "panel:registered"; panel: PanelDefinition; }
Type Literal
Section titled “Type Literal”{ type: "batch:started"; jobId: string; total: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:item:started"; jobId: string; itemId: string; index: number; total: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:item:finished"; jobId: string; itemId: string; index: number; total: number; outputAssetId: AssetId; duration: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:item:failed"; jobId: string; itemId: string; index: number; total: number; error: Error; attempts: number; }
type:
"batch:item:failed"
jobId:
string
itemId
Section titled “itemId”itemId:
string
index:
number
total:
number
error:
Error
attempts
Section titled “attempts”attempts:
number
已重试次数(达到 maxRetries 后才发 failed 事件)
Type Literal
Section titled “Type Literal”{ type: "batch:progress"; jobId: string; completed: number; failed: number; total: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:completed"; jobId: string; total: number; completed: number; failed: number; duration: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:cancelled"; jobId: string; cancelled: number; }
Type Literal
Section titled “Type Literal”{ type: "batch:paused"; jobId: string; }
Type Literal
Section titled “Type Literal”{ type: "batch:resumed"; jobId: string; }