feat: add thinking protocol events

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
David Kaya
2026-03-30 16:11:58 +01:00
co-authored by Copilot
parent 38dd358755
commit 56de8b7bd6
7 changed files with 346 additions and 1 deletions
+30
View File
@@ -239,6 +239,14 @@ export interface TurnCompleteEvent {
cancelled?: boolean;
}
export interface MessageReclassifiedEvent {
type: 'message-reclassified';
requestId: string;
sessionId: string;
messageId: string;
newKind: 'thinking';
}
export type AgentActivityType = 'thinking' | 'tool-calling' | 'handoff' | 'completed';
export interface ToolCallFileChangePreview {
@@ -297,6 +305,25 @@ export interface SkillInvokedEvent {
description?: string;
}
export interface AssistantIntentEvent {
type: 'assistant-intent';
requestId: string;
sessionId: string;
agentId?: string;
agentName?: string;
intent: string;
}
export interface ReasoningDeltaEvent {
type: 'reasoning-delta';
requestId: string;
sessionId: string;
agentId?: string;
agentName?: string;
reasoningId: string;
contentDelta: string;
}
export interface HookLifecycleEvent {
type: 'hook-lifecycle';
requestId: string;
@@ -526,9 +553,12 @@ export type SidecarEvent =
| PatternValidationEvent
| TurnDeltaEvent
| TurnCompleteEvent
| MessageReclassifiedEvent
| AgentActivityEvent
| SubagentEvent
| SkillInvokedEvent
| AssistantIntentEvent
| ReasoningDeltaEvent
| HookLifecycleEvent
| SessionUsageEvent
| SessionCompactionEvent
+3
View File
@@ -1,4 +1,5 @@
import type { SessionRunRecord } from '@shared/domain/runTimeline';
import type { ChatMessageKind } from '@shared/domain/session';
import type { QuotaSnapshot, ToolCallFileChangePreview } from '@shared/contracts/sidecar';
@@ -8,6 +9,7 @@ export type SessionEventKind =
| 'status'
| 'message-delta'
| 'message-complete'
| 'message-reclassified'
| 'agent-activity'
| 'run-updated'
| 'error'
@@ -27,6 +29,7 @@ export interface SessionEventRecord {
occurredAt: string;
status?: 'idle' | 'running' | 'error';
messageId?: string;
messageKind?: ChatMessageKind;
authorName?: string;
contentDelta?: string;
content?: string;
+2
View File
@@ -18,6 +18,7 @@ import type { ChatMessageAttachment } from '@shared/domain/attachment';
import type { InteractionMode } from '@shared/contracts/sidecar';
export type ChatRole = 'system' | 'user' | 'assistant';
export type ChatMessageKind = 'response' | 'thinking';
export type SessionStatus = 'idle' | 'running' | 'error';
export type SessionTitleSource = 'auto' | 'manual';
export type SessionBranchOriginAction = 'branch' | 'regenerate' | 'edit-and-resend';
@@ -33,6 +34,7 @@ export interface ChatMessageRecord {
authorName: string;
content: string;
createdAt: string;
messageKind?: ChatMessageKind;
isPinned?: boolean;
pending?: boolean;
attachments?: ChatMessageAttachment[];