| 1 | export type WorkspaceLine = |
| 2 | | {kind: 'user'; text: string} |
| 3 | | {kind: 'assistant'; text: string} |
| 4 | | {kind: 'thinking'; text: string} |
| 5 | | {kind: 'status'; text: string} |
| 6 | | {kind: 'workflow'; text: string} |
| 7 | | {kind: 'tool'; text: string; status?: 'running' | 'done' | 'error'} |
| 8 | | {kind: 'terminal'; text: string} |
| 9 | | {kind: 'session'; text: string} |
| 10 | | {kind: 'error'; text: string}; |
| 11 | |
| 12 | export type ToolResult = { |
| 13 | name?: string; |
| 14 | ok?: boolean; |
| 15 | content?: string; |
| 16 | metadata?: Record<string, unknown>; |
| 17 | }; |
| 18 | |
| 19 | export type StreamEvent = { |
| 20 | type?: string; |
| 21 | turn_id?: string; |
| 22 | delta?: string; |
| 23 | phase?: string; |
| 24 | message?: string; |
| 25 | stream?: string; |
| 26 | line?: string; |
| 27 | assistant?: string; |
| 28 | tool?: {name?: string; requested_name?: string; arguments?: Record<string, unknown>}; |
| 29 | progress?: {stage?: string; message?: string; metadata?: Record<string, unknown>}; |
| 30 | tool_result?: ToolResult; |
| 31 | session?: { |
| 32 | active_session_id?: string; |
| 33 | session?: { |
| 34 | session_id?: string; |
| 35 | stage?: string; |
| 36 | working_dir?: string; |
| 37 | } | null; |
| 38 | }; |
| 39 | prompt_trace?: { |
| 40 | total_estimated_tokens?: number; |
| 41 | totals?: { |
| 42 | total_tokens?: number; |
| 43 | total_estimated_tokens?: number; |
| 44 | }; |
| 45 | }; |
| 46 | }; |
| 47 | |
| 48 | export type MappingState = { |
| 49 | assistantStreaming: boolean; |
| 50 | }; |
| 51 |