* initial * refactor: centralize SSE plumbing for client and server * docs: add centralized SSE usage standards to agents guide * use sse to stream actions to the client * ui: align bulk progress toast with default sonner style * ui: remove hide action from bulk progress toast * full width progress bar * fix(stream): track client disconnect and writability * fix(stream): stop bulk loop when SSE client disconnects * fix(stream): avoid writing error/end to closed SSE response * fix(stream): gate started/progress frames on writable SSE socket * types(api): narrow SSE stream payload input contract * refactor(ui): share clamp helper for bulk progress * fix(stream): add heartbeat to bulk action SSE route * feat(stream): include completed count in bulk completion event * fix(client-sse): separate parse vs handler errors and cancel reader
This commit is contained in:
@@ -621,6 +621,43 @@ export interface BulkJobActionResponse {
|
||||
results: BulkJobActionResult[];
|
||||
}
|
||||
|
||||
export type BulkJobActionStreamEvent =
|
||||
| {
|
||||
type: "started";
|
||||
action: BulkJobAction;
|
||||
requested: number;
|
||||
completed: number;
|
||||
succeeded: number;
|
||||
failed: number;
|
||||
requestId: string;
|
||||
}
|
||||
| {
|
||||
type: "progress";
|
||||
action: BulkJobAction;
|
||||
requested: number;
|
||||
completed: number;
|
||||
succeeded: number;
|
||||
failed: number;
|
||||
result: BulkJobActionResult;
|
||||
requestId: string;
|
||||
}
|
||||
| {
|
||||
type: "completed";
|
||||
action: BulkJobAction;
|
||||
requested: number;
|
||||
completed: number;
|
||||
succeeded: number;
|
||||
failed: number;
|
||||
results: BulkJobActionResult[];
|
||||
requestId: string;
|
||||
}
|
||||
| {
|
||||
type: "error";
|
||||
code: string;
|
||||
message: string;
|
||||
requestId: string;
|
||||
};
|
||||
|
||||
export const JOB_CHAT_MESSAGE_ROLES = [
|
||||
"system",
|
||||
"user",
|
||||
|
||||
Reference in New Issue
Block a user