// StreamingWorkspace.tsx type StreamPhase = "idle" | "streaming" | "cancelling" | "reconciling" | "complete" | "failed"; async function consume(response: Response, operationId: string) { if (!response.ok || !response.body) throw new Error("stream_failed"); const reader = response.body.getReader(); // Incremental output is visible before terminal state; cancellation reconciles the same operation identity. }