Spaces:
Sleeping
Sleeping
| /** | |
| * agentSSETypes.ts — S549: tipi SSE puri estratti da agentSSE.ts | |
| * | |
| * Contiene solo TypeScript types/interfaces senza dipendenze runtime. | |
| * Permette import type-only senza pull-in di agentSSE.ts | |
| * (StreamWorker, backoff, TTFT tracking, action parsing, ecc.). | |
| * | |
| * Consumato da agentSSE.ts (re-esporta per backward compat) e | |
| * da componenti che ricevono/gestiscono eventi SSE senza importare il client. | |
| */ | |
| export type SSEEventType = | |
| | "task_start" | |
| | "task_done" | |
| | "task_error" | |
| | "task_cancelled" | |
| | "step_start" | |
| | "step_done" | |
| | "step_error" | |
| | "action" | |
| | "tool_use" // S758-P4.1: pre-execution notification (fires BEFORE tool runs) | |
| | "task_thinking" // S758-P4.1: LLM generating, no step received yet | |
| | "text_chunk" // S420: streaming token-by-token | |
| | "vfs_update" // S723-GAP3.2: VFS write/delete event from backend | |
| | "task_aborted" // ABORT: task fermato via POST /api/agent/abort — alias di task_cancelled con cleanup | |
| | "vfs_sync_complete" // P34: manifesto atomico VFS — tutti i file del task sono stati inviati | |
| | "connector_needed" // P39-UX: agente richiede OAuth connector per continuare (Tocco Finale Manus) | |
| | "persona_classified" // P17-F5: server ha classificato la persona (auto-detection) | |
| | "thought" // SYNC-2: goal esplicito dopo planning | |
| | "plan_update" // SYNC-2: subtask list dal backend | |
| | "subtask_done" // SYNC-2: singolo subtask completato | |
| | "task_interrupted" // SYNC-2: backend riavviato durante esecuzione | |
| | "partial_output"; // S-PARTIAL: output parziale da delegate timeout — backend si riprende | |
| export interface SSEEvent { | |
| event: SSEEventType; | |
| taskId: string; | |
| [key: string]: unknown; | |
| } | |
| export interface SSEHandle { | |
| taskId: string; | |
| cancel: () => void; | |
| rejected?: true; | |
| } | |