-
Notifications
You must be signed in to change notification settings - Fork 63
Expand file tree
/
Copy pathevents.ts
More file actions
188 lines (171 loc) · 5.2 KB
/
events.ts
File metadata and controls
188 lines (171 loc) · 5.2 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
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
// All Rovo Dev analytics events and types
// TODO: generate these automatically based on external spec, ideally with descriptions as docs
export type RovoDevEnv = 'IDE' | 'Boysenberry';
export const RovodevPerformanceTags = {
timeToFirstByte: 'api.rovodev.chat.response.timeToFirstByte',
timeToFirstMessage: 'api.rovodev.chat.response.timeToFirstMessage',
timeToTechPlan: 'api.rovodev.chat.response.timeToTechPlan',
timeToLastMessage: 'api.rovodev.chat.response.timeToLastMessage',
timeToRender: 'ui.rovodev.chat.response.timeToRender',
} as const;
export type RovodevPerformanceTag = (typeof RovodevPerformanceTags)[keyof typeof RovodevPerformanceTags];
export type RovoDevCommonParams = {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
rovoDevSessionId: string;
rovoDevPromptId: string;
};
export namespace Track {
export type NewSessionAction = {
action: 'rovoDevNewSessionAction';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
isManuallyCreated: boolean;
};
};
export type PromptSent = {
action: 'rovoDevPromptSent';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
deepPlanEnabled: boolean;
};
};
export type TechnicalPlanningShown = {
action: 'rovoDevTechnicalPlanningShown';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
stepsCount: number;
filesCount: number;
questionsCount: number;
};
};
export type FilesSummaryShown = {
action: 'rovoDevFilesSummaryShown';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
filesCount: number;
};
};
export type FileChangedAction = {
action: 'rovoDevFileChangedAction';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
action: 'undo' | 'keep';
filesCount: number;
};
};
export type StopAction = {
action: 'rovoDevStopAction';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
failed?: boolean;
};
};
export type GitPushAction = {
action: 'rovoDevGitPushAction';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
prCreated: boolean;
};
};
export type DetailsExpanded = {
action: 'rovoDevDetailsExpanded';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
};
};
export type CreatePrButtonClicked = {
action: 'clicked';
subject: 'rovoDevCreatePrButton';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
};
};
export type AiResultViewed = {
action: 'viewed';
subject: 'aiResult';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
promptId: string;
dwellMs: number;
xid: string;
singleInstrumentationID: string;
aiFeatureName: string;
proactiveGeneratedAI: number;
userGeneratedAI: number;
isAIFeature: number;
};
};
export type ReplayCompleted = {
action: 'rovoDevReplayCompleted';
subject: 'atlascode';
attributes: {
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
sessionId: string;
messagePartsCount: number;
};
};
// TODO: rovodev metadata fields here are different from other events, reconcile later?
export type PerformanceEvent = {
action: 'performanceEvent';
subject: 'atlascode';
attributes: {
tag: RovodevPerformanceTag;
measure: number;
rovoDevEnv: RovoDevEnv;
appInstanceId: string;
rovoDevSessionId: string;
rovoDevPromptId: string;
};
};
}
export type TrackEvent =
| Track.NewSessionAction
| Track.PromptSent
| Track.TechnicalPlanningShown
| Track.FilesSummaryShown
| Track.FileChangedAction
| Track.StopAction
| Track.GitPushAction
| Track.DetailsExpanded
| Track.CreatePrButtonClicked
| Track.AiResultViewed
| Track.ReplayCompleted
| Track.PerformanceEvent;