-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtypes.ts
More file actions
115 lines (108 loc) · 2.1 KB
/
Copy pathtypes.ts
File metadata and controls
115 lines (108 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
export interface IPartData {
toolCallId?: string;
toolName?: string;
sessionId?: string;
phase?: 'start' | 'end';
label?: string;
input?: any;
output?: any;
durationMs?: number;
toolInfo?: string;
status?: 'pending' | 'processing' | 'approved' | 'rejected';
messages?: string[];
error?: string;
}
export interface IPart {
type: 'reasoning' | 'data-tool-call' | 'data-rendering' | 'data-tool-approval' | 'text';
text?: string;
state?: 'started' | 'thinking' | 'processing' | 'streaming' | 'done';
data?: IPartData;
}
export interface IFormattedToolCallPart {
type: 'data-tool-call';
toolInfo: IPartData;
}
export interface IToolGroup {
title: string;
groupedTools: IFormattedToolCallPart[];
}
export interface IMessage {
id?: string;
role: 'user' | 'assistant' | 'system';
metadata?: any,
parts: IPart[];
}
export interface IStoredMessage {
role: 'user' | 'assistant' | 'system';
text: string;
turnId?: string;
}
export interface IAgentSession {
sessionId: string;
title: string;
timestamp: string;
messages: IMessage[];
}
export interface ISessionsListItem {
sessionId: string;
title: string;
timestamp: string;
}
export type SpeechStreamEvent =
| {
type: 'error';
error: string;
}
| {
type: 'transcript';
data: {
text: string;
language?: string;
};
}
| {
type: 'speech-response';
data: {
transcript: {
text: string;
language?: string;
};
response: {
text: string;
};
sessionId: string;
turnId: string;
};
}
| {
type: 'audio-start';
data: {
mimeType: string;
format: string;
sampleRate: number;
channelCount: number;
bitsPerSample: number;
};
}
| {
type: 'audio-delta';
data: {
base64: string;
};
}
| {
type: 'audio-done';
}
| {
type: 'data-tool-call';
data: any;
}
| {
type: 'open-page';
data: {
targetPath: string;
};
}
| {
type: 'finish';
};