Skip to content

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 标准事件类型联合

{ 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: "history:changed"

workflowId: string

entries: HistoryEntry[]

currentIndex: number

当前游标(指向最后一条已应用的 entry;-1 表示无已应用条目)


{ 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:item:failed"

jobId: string

itemId: string

index: number

total: number

error: Error

attempts: number

已重试次数(达到 maxRetries 后才发 failed 事件)


{ 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; }