fix: sse response (#6468)

This commit is contained in:
Archer
2026-02-26 17:45:26 +08:00
committed by GitHub
parent 2fd4b6030b
commit 2f7427e108
2 changed files with 7 additions and 4 deletions
@@ -49,7 +49,9 @@ const WorkflowResponseItemSchema = z.object({
id: z.string().optional(),
stepId: z.string().optional(),
event: z.custom<SseResponseEventEnum>(),
data: z.record(z.string(), z.any())
data: z.custom<Record<string, any> & { length?: never }>(
(val) => typeof val === 'object' && val !== null && !Array.isArray(val)
)
});
export type WorkflowResponseItemType = z.infer<typeof WorkflowResponseItemSchema>;
export const WorkflowResponseFnSchema = z.function({