@buyong/pi-devin 0.0.0-stage → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (107) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +214 -2
  3. package/index.ts +16 -0
  4. package/package.json +62 -3
  5. package/proto/README.md +78 -0
  6. package/proto/buf/validate/validate.proto +453 -0
  7. package/proto/cel/expr/checked.proto +109 -0
  8. package/proto/cel/expr/eval.proto +44 -0
  9. package/proto/cel/expr/explain.proto +22 -0
  10. package/proto/cel/expr/syntax.proto +119 -0
  11. package/proto/cel/expr/value.proto +47 -0
  12. package/proto/connectext/grpc/status/v1/status.proto +21 -0
  13. package/proto/errorspb/errors.proto +58 -0
  14. package/proto/errorspb/hintdetail.proto +9 -0
  15. package/proto/errorspb/markers.proto +12 -0
  16. package/proto/errorspb/tags.proto +14 -0
  17. package/proto/errorspb/testing.proto +8 -0
  18. package/proto/exa/analytics_pb/analytics.proto +190 -0
  19. package/proto/exa/api_server_pb/api_server.proto +2590 -0
  20. package/proto/exa/auth_pb/auth.proto +21 -0
  21. package/proto/exa/auto_cascade_common_pb/auto_cascade_common.proto +81 -0
  22. package/proto/exa/browser_preview_pb/browser_preview.proto +26 -0
  23. package/proto/exa/bug_checker_pb/bug_checker.proto +24 -0
  24. package/proto/exa/cascade_plugins_pb/cascade_plugins.proto +264 -0
  25. package/proto/exa/chat_client_server_pb/chat_client_server.proto +57 -0
  26. package/proto/exa/chat_pb/chat.proto +452 -0
  27. package/proto/exa/code_edit/code_edit_pb/code_edit.proto +186 -0
  28. package/proto/exa/codeium_common_pb/browser_context.proto +31 -0
  29. package/proto/exa/codeium_common_pb/codeium_common.proto +4183 -0
  30. package/proto/exa/context_module_pb/context_module.proto +174 -0
  31. package/proto/exa/cortex_pb/cortex.proto +3288 -0
  32. package/proto/exa/dev_pb/dev.proto +28 -0
  33. package/proto/exa/diff_action_pb/diff_action.proto +76 -0
  34. package/proto/exa/eval/pr_eval/datasets_pb/datasets.proto +106 -0
  35. package/proto/exa/eval_pb/eval.proto +1318 -0
  36. package/proto/exa/extension_server_pb/extension_server.proto +555 -0
  37. package/proto/exa/file_system_provider_pb/file_system_provider.proto +75 -0
  38. package/proto/exa/index_pb/index.proto +469 -0
  39. package/proto/exa/knowledge_base_pb/knowledge_base.proto +146 -0
  40. package/proto/exa/language_server_pb/language_server.proto +2435 -0
  41. package/proto/exa/model_management_pb/model_management.proto +184 -0
  42. package/proto/exa/opensearch_clients_pb/opensearch_clients.proto +495 -0
  43. package/proto/exa/product_analytics_pb/product_analytics.proto +39 -0
  44. package/proto/exa/prompt_pb/prompt.proto +97 -0
  45. package/proto/exa/reactive_component_pb/reactive_component.proto +98 -0
  46. package/proto/exa/seat_management_pb/seat_management.proto +2910 -0
  47. package/proto/exa/tokenizer_pb/tokenizer.proto +39 -0
  48. package/proto/exa/trainer_pb/config.proto +643 -0
  49. package/proto/exa/tree_sitter/language_data_pb/language_data.proto +14 -0
  50. package/proto/exa/trust_pb/trust.proto +192 -0
  51. package/proto/exa/user_analytics_pb/user_analytics.proto +752 -0
  52. package/proto/google/api/expr/v1alpha1/checked.proto +108 -0
  53. package/proto/google/api/expr/v1alpha1/eval.proto +38 -0
  54. package/proto/google/api/expr/v1alpha1/explain.proto +22 -0
  55. package/proto/google/api/expr/v1alpha1/syntax.proto +126 -0
  56. package/proto/google/api/expr/v1alpha1/value.proto +47 -0
  57. package/proto/google/protobuf/any.proto +15 -0
  58. package/proto/google/protobuf/cpp_features.proto +22 -0
  59. package/proto/google/protobuf/descriptor.proto +473 -0
  60. package/proto/google/protobuf/duration.proto +16 -0
  61. package/proto/google/protobuf/empty.proto +14 -0
  62. package/proto/google/protobuf/go_features.proto +31 -0
  63. package/proto/google/protobuf/struct.proto +34 -0
  64. package/proto/google/protobuf/timestamp.proto +16 -0
  65. package/proto/google/protobuf/wrappers.proto +47 -0
  66. package/proto/google/rpc/status.proto +18 -0
  67. package/proto/grpc/binlog/v1/binarylog.proto +89 -0
  68. package/proto/io/prometheus/client/metrics.proto +103 -0
  69. package/src/core/auth/access.ts +6 -0
  70. package/src/core/auth/index.ts +2 -0
  71. package/src/core/auth/login.ts +177 -0
  72. package/src/core/auth/rest-exchange.ts +35 -0
  73. package/src/core/client.ts +153 -0
  74. package/src/core/index.ts +12 -0
  75. package/src/core/inference/chat.ts +229 -0
  76. package/src/core/inference/images.ts +24 -0
  77. package/src/core/inference/messages.ts +34 -0
  78. package/src/core/inference/retry.ts +68 -0
  79. package/src/core/inference/state.ts +8 -0
  80. package/src/core/models/access.ts +7 -0
  81. package/src/core/models/catalog.ts +35 -0
  82. package/src/core/models/index.ts +4 -0
  83. package/src/core/models/select.ts +43 -0
  84. package/src/core/models/variants.ts +163 -0
  85. package/src/core/protocol/device.ts +73 -0
  86. package/src/core/protocol/fingerprint.ts +59 -0
  87. package/src/core/protocol/http.ts +109 -0
  88. package/src/core/protocol/protobuf.ts +112 -0
  89. package/src/core/protocol/transport.ts +501 -0
  90. package/src/core/types.ts +115 -0
  91. package/src/pi/auth.ts +134 -0
  92. package/src/pi/devin-command.ts +76 -0
  93. package/src/pi/devin-panel.ts +77 -0
  94. package/src/pi/devin-settings.ts +50 -0
  95. package/src/pi/extension.ts +80 -0
  96. package/src/pi/fusion-command.ts +83 -0
  97. package/src/pi/fusion-picker.ts +171 -0
  98. package/src/pi/fusion-settings.ts +44 -0
  99. package/src/pi/lifecycle.ts +217 -0
  100. package/src/pi/messages.ts +107 -0
  101. package/src/pi/models.ts +378 -0
  102. package/src/pi/provider.ts +241 -0
  103. package/src/pi/sidekick-report.ts +42 -0
  104. package/src/pi/sidekick-runtime.ts +287 -0
  105. package/src/pi/sidekick.ts +190 -0
  106. package/src/pi/stream.ts +124 -0
  107. package/src/pi/usage.ts +153 -0
@@ -0,0 +1,752 @@
1
+ syntax = "proto3";
2
+
3
+ package exa.user_analytics_pb;
4
+
5
+ import "buf/validate/validate.proto";
6
+ import "exa/codeium_common_pb/codeium_common.proto";
7
+ import "google/protobuf/timestamp.proto";
8
+
9
+ option go_package = "github.com/Exafunction/Exafunction/exa/user_analytics_pb";
10
+
11
+ enum QueryDataSource {
12
+ QUERY_DATA_SOURCE_UNSPECIFIED = 0;
13
+ QUERY_DATA_SOURCE_USER_DATA = 1;
14
+ QUERY_DATA_SOURCE_CHAT_DATA = 2;
15
+ QUERY_DATA_SOURCE_COMMAND_DATA = 3;
16
+ QUERY_DATA_SOURCE_CASCADE_DATA = 4;
17
+ QUERY_DATA_SOURCE_PCW_DATA = 5;
18
+ QUERY_DATA_SOURCE_CASCADE_LINES_ANALYTICS = 6;
19
+ QUERY_DATA_SOURCE_CASCADE_TOOL_ANALYTICS = 7;
20
+ }
21
+
22
+ enum QueryAggregation {
23
+ QUERY_AGGREGATION_UNSPECIFIED = 0;
24
+ QUERY_AGGREGATION_COUNT = 1;
25
+ QUERY_AGGREGATION_SUM = 2;
26
+ QUERY_AGGREGATION_AVG = 3;
27
+ QUERY_AGGREGATION_MAX = 4;
28
+ QUERY_AGGREGATION_MIN = 5;
29
+ }
30
+
31
+ enum QueryFilter {
32
+ QUERY_FILTER_UNSPECIFIED = 0;
33
+ QUERY_FILTER_EQUAL = 1;
34
+ QUERY_FILTER_NOT_EQUAL = 2;
35
+ QUERY_FILTER_GREATER_THAN = 3;
36
+ QUERY_FILTER_LESS_THAN = 4;
37
+ QUERY_FILTER_GE = 5;
38
+ QUERY_FILTER_LE = 6;
39
+ }
40
+
41
+ enum IDEType {
42
+ IDE_TYPE_UNSPECIFIED = 0;
43
+ IDE_TYPE_WINDSURF = 1;
44
+ IDE_TYPE_JETBRAINS = 2;
45
+ IDE_TYPE_PLUGINS = 3;
46
+ IDE_TYPE_CLI = 4;
47
+ }
48
+
49
+ message QuerySelectionField {
50
+ QueryAggregation aggregation_function = 1;
51
+ string field = 2;
52
+ string name = 3;
53
+ }
54
+
55
+ message QueryFilterField {
56
+ QueryFilter filter = 1;
57
+ string name = 2;
58
+ string value = 3;
59
+ }
60
+
61
+ message QueryAggregationField {
62
+ string field = 1;
63
+ string name = 2;
64
+ }
65
+
66
+ message QueryOrderField {
67
+ bool ascending = 1;
68
+ string name = 2;
69
+ }
70
+
71
+ message CustomQueryRequest {
72
+ QueryDataSource data_source = 1;
73
+ repeated QuerySelectionField selections = 2;
74
+ repeated QueryFilterField filters = 3;
75
+ repeated QueryAggregationField aggregations = 5;
76
+ repeated QueryOrderField orderings = 4;
77
+ bool use_real_api_key = 6;
78
+ }
79
+
80
+ message QueryResponseItem {
81
+ map<string, string> item = 1;
82
+ }
83
+
84
+ message CustomQueryResponse {
85
+ repeated QueryResponseItem response_items = 1;
86
+ }
87
+
88
+ message GetAnalyticsRequest {
89
+ repeated QueryRequest query_requests = 2;
90
+ .google.protobuf.Timestamp start_timestamp = 3;
91
+ .google.protobuf.Timestamp end_timestamp = 4;
92
+ string group_id = 6;
93
+ repeated string api_keys = 7;
94
+ repeated string group_ids = 8;
95
+ repeated IDEType ide_types = 9;
96
+ reserved 1;
97
+ reserved 5;
98
+ }
99
+
100
+ message CascadeAnalyticsRequest {
101
+ string service_key = 1;
102
+ string group_name = 2;
103
+ repeated string emails = 3;
104
+ repeated string ide_types = 4;
105
+ .google.protobuf.Timestamp start_timestamp = 5;
106
+ .google.protobuf.Timestamp end_timestamp = 6;
107
+ repeated QueryRequest query_requests = 7;
108
+ string multitenant_team_id = 8;
109
+ string secret = 9;
110
+ string team_id = 10;
111
+ }
112
+
113
+ message CascadeAnalyticsResponse {
114
+ repeated QueryResult query_results = 1;
115
+ }
116
+
117
+ message GetAnalyticsResponse {
118
+ repeated QueryResult query_results = 1;
119
+ }
120
+
121
+ message AnalyticsRequest {
122
+ repeated CustomQueryRequest query_requests = 1;
123
+ string service_key = 2;
124
+ string group_name = 3;
125
+ .google.protobuf.Timestamp start_timestamp = 4;
126
+ .google.protobuf.Timestamp end_timestamp = 5;
127
+ string multitenant_team_id = 6;
128
+ string secret = 7;
129
+ string team_id = 8;
130
+ AcuConsumptionQuery acu_consumption_query = 9;
131
+ }
132
+
133
+ message AnalyticsResponse {
134
+ repeated CustomQueryResponse query_results = 1;
135
+ AcuConsumptionResponse acu_consumption = 2;
136
+ }
137
+
138
+ message UserPageAnalyticsRequest {
139
+ string service_key = 1;
140
+ string group_name = 2;
141
+ .google.protobuf.Timestamp start_timestamp = 3;
142
+ .google.protobuf.Timestamp end_timestamp = 4;
143
+ string multitenant_team_id = 5;
144
+ string secret = 6;
145
+ string team_id = 7;
146
+ }
147
+
148
+ message UserPageAnalyticsResponse {
149
+ repeated .exa.codeium_common_pb.UserTableStats user_table_stats = 1;
150
+ .google.protobuf.Timestamp billing_cycle_start = 2;
151
+ .google.protobuf.Timestamp billing_cycle_end = 3;
152
+ string billing_mode = 4;
153
+ }
154
+
155
+ message QueryRequest {
156
+ oneof request_type {
157
+ QueryRequestCompletionStats completion_stats = 1;
158
+ QueryRequestCompletionsByDay completions_by_day = 2;
159
+ QueryRequestCompletionsByLanguage completions_by_language = 3;
160
+ QueryRequestAllUsersCompletionStats all_users_completion_stats = 4;
161
+ QueryRequestAllUsersCompletionsByDay all_users_completions_by_day = 5;
162
+ QueryRequestAllUsersCompletionsByLanguage all_users_completions_by_language = 6;
163
+ QueryRequestCompletionsByIde completions_by_ide = 7;
164
+ QueryRequestCompletionsByIde all_users_completions_by_ide = 8;
165
+ QueryRequestCompletionsByApiKey completions_by_api_key = 9;
166
+ QueryRequestCompletionsByRepository completions_by_repository = 19;
167
+ QueryRequestChatsByDay chats_by_day = 10;
168
+ QueryRequestAllChatsByDay all_users_chats_by_day = 11;
169
+ QueryRequestChatStatsByModel chats_by_model = 12;
170
+ QueryRequestAllChatStatsByModel all_users_chats_by_model = 13;
171
+ QueryRequestActiveUserCount active_user_count = 14;
172
+ QueryRequestPercentCodeWritten percent_code_written = 15;
173
+ QueryRequestCharsPerOpportunity chars_per_opportunity = 16;
174
+ QueryRequestChatStats chat_stats = 17;
175
+ QueryRequestActiveDaysByApiKey active_days_by_api_key = 18;
176
+ QueryRequestCommandStats command_stats = 20;
177
+ CustomQueryRequest custom_query = 21;
178
+ UserPageAnalyticsRequest user_page_analytics = 22;
179
+ QueryRequestCascadeLines cascade_lines = 23;
180
+ QueryRequestCascadeToolUsage cascade_tool_usage = 24;
181
+ QueryRequestCascadeRuns cascade_runs = 25;
182
+ QueryRequestAllUsersCascadeLines all_users_cascade_lines = 26;
183
+ QueryRequestAllUsersCascadeToolUsage all_users_cascade_tool_usage = 27;
184
+ QueryRequestAllUsersCascadeRuns all_users_cascade_runs = 28;
185
+ QueryRequestAllUsersDailyActiveUserCounts all_users_daily_active_user_counts = 29;
186
+ QueryRequestAllUsersCommandStats all_users_command_stats = 30;
187
+ QueryRequestIndividualPercentCodeWritten individual_percent_code_written = 31;
188
+ QueryRequestCompletionsByLanguagePerUser completions_by_language_per_user = 32;
189
+ }
190
+ }
191
+
192
+ message QueryResult {
193
+ oneof result_type {
194
+ QueryResultCompletionStats completion_stats = 1;
195
+ QueryResultCompletionsByDay completions_by_day = 2;
196
+ QueryResultCompletionsByLanguage completions_by_language = 3;
197
+ QueryResultCompletionsByIde completions_by_ide = 4;
198
+ QueryResultCompletionsByApiKey completions_by_api_key = 5;
199
+ QueryResultCompletionsByRepository completions_by_repository = 13;
200
+ QueryResultChatsByDay chats_by_day = 6;
201
+ QueryResultChatStatsByModel chats_by_model = 7;
202
+ QueryResultActiveUserCount active_user_count = 8;
203
+ QueryResultPercentCodeWritten percent_code_written = 9;
204
+ QueryResultCharsPerOpportunity chars_per_opportunity = 10;
205
+ QueryResultChatStats chat_stats = 11;
206
+ QueryResultActiveDaysByApiKey active_days_by_api_key = 12;
207
+ QueryResultError error = 14;
208
+ QueryResultCommandStats command_stats = 15;
209
+ CustomQueryResponse custom_stats = 16;
210
+ UserPageAnalyticsResponse user_page_analytics = 17;
211
+ QueryResultCascadeLines cascade_lines = 18;
212
+ QueryResultCascadeToolUsage cascade_tool_usage = 19;
213
+ QueryResultCascadeRuns cascade_runs = 20;
214
+ QueryResultDailyActiveUserCounts daily_active_user_counts = 21;
215
+ QueryResultCompletionsByLanguagePerUser completions_by_language_per_user = 22;
216
+ }
217
+ }
218
+
219
+ message DailyActiveUserCount {
220
+ .google.protobuf.Timestamp day = 1;
221
+ int64 active_user_count = 2;
222
+ }
223
+
224
+ message QueryResultDailyActiveUserCounts {
225
+ repeated DailyActiveUserCount daily_active_user_counts = 1;
226
+ }
227
+
228
+ message QueryRequestAllUsersDailyActiveUserCounts {
229
+ }
230
+
231
+ message QueryRequestCompletionStats {
232
+ }
233
+
234
+ message QueryResultCompletionStats {
235
+ .exa.codeium_common_pb.CompletionStatistics completion_statistics = 1;
236
+ }
237
+
238
+ message QueryRequestCompletionsByDay {
239
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
240
+ }
241
+
242
+ message QueryResultCompletionsByDay {
243
+ repeated .exa.codeium_common_pb.CompletionByDateEntry completions_by_day = 1;
244
+ }
245
+
246
+ message QueryRequestCompletionsByLanguage {
247
+ }
248
+
249
+ message QueryResultCompletionsByLanguage {
250
+ repeated .exa.codeium_common_pb.CompletionByLanguageEntry completions_by_language = 1;
251
+ }
252
+
253
+ message QueryRequestCompletionsByLanguagePerUser {
254
+ }
255
+
256
+ message CompletionsByLanguagePerUserEntry {
257
+ string api_key = 1;
258
+ repeated .exa.codeium_common_pb.CompletionByLanguageEntry completions_by_language = 2;
259
+ }
260
+
261
+ message QueryResultCompletionsByLanguagePerUser {
262
+ repeated CompletionsByLanguagePerUserEntry entries = 1;
263
+ }
264
+
265
+ message QueryRequestCompletionsByIde {
266
+ }
267
+
268
+ message QueryResultCompletionsByIde {
269
+ map<string, .exa.codeium_common_pb.CompletionStatistics> completions_by_ide = 1;
270
+ }
271
+
272
+ message QueryRequestCompletionsByRepository {
273
+ }
274
+
275
+ message QueryResultCompletionsByRepository {
276
+ map<string, .exa.codeium_common_pb.CompletionStatistics> completions_by_repository = 1;
277
+ }
278
+
279
+ message QueryRequestChatsByDay {
280
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
281
+ }
282
+
283
+ message QueryResultChatsByDay {
284
+ repeated .exa.codeium_common_pb.ChatStatsByDateEntry chats_by_day = 1;
285
+ }
286
+
287
+ message QueryRequestAllChatsByDay {
288
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
289
+ }
290
+
291
+ message QueryRequestActiveUserCount {
292
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
293
+ .google.protobuf.Timestamp start_timestamp = 2;
294
+ .google.protobuf.Timestamp end_timestamp = 3;
295
+ }
296
+
297
+ message QueryRequestActiveUserCountByUsers {
298
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
299
+ }
300
+
301
+ message QueryRequestDailyActiveUserCounts {
302
+ }
303
+
304
+ message QueryRequestChatStatsByModel {
305
+ }
306
+
307
+ message QueryRequestAllChatStatsByModel {
308
+ }
309
+
310
+ message QueryResultChatStatsByModel {
311
+ repeated .exa.codeium_common_pb.ChatStatsByModelEntry chats_by_model = 1;
312
+ }
313
+
314
+ message QueryRequestAllUsersCompletionsByDay {
315
+ string time_zone = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
316
+ }
317
+
318
+ message QueryRequestAllUsersCompletionsByLanguage {
319
+ }
320
+
321
+ message QueryRequestAllUsersCompletionStats {
322
+ }
323
+
324
+ message QueryRequestCompletionsByApiKey {
325
+ }
326
+
327
+ message QueryResultCompletionsByApiKey {
328
+ map<string, .exa.codeium_common_pb.CompletionStatistics> completions_by_api_key = 1;
329
+ }
330
+
331
+ message QueryResultActiveUserCount {
332
+ int64 active_user_count = 1;
333
+ }
334
+
335
+ message QueryRequestIndividualPercentCodeWritten {
336
+ }
337
+
338
+ message QueryRequestPercentCodeWritten {
339
+ }
340
+
341
+ message QueryResultPercentCodeWritten {
342
+ double percent_code_written = 1;
343
+ int64 codeium_bytes_by_autocomplete = 2;
344
+ int64 codeium_bytes_by_command = 3;
345
+ int64 codeium_bytes_by_supercomplete = 7;
346
+ int64 codeium_bytes_by_cascade = 8;
347
+ int64 user_bytes = 4;
348
+ int64 codeium_bytes = 5;
349
+ int64 total_bytes = 6;
350
+ }
351
+
352
+ message QueryRequestCharsPerOpportunity {
353
+ }
354
+
355
+ message QueryResultCharsPerOpportunity {
356
+ double chars_per_opportunity = 1;
357
+ uint64 num_bytes_accepted = 2;
358
+ uint64 num_completion_attempts = 3;
359
+ }
360
+
361
+ message QueryRequestChatStats {
362
+ }
363
+
364
+ message QueryResultChatStats {
365
+ .exa.codeium_common_pb.ChatStats chat_stats = 1;
366
+ }
367
+
368
+ message QueryRequestCommandStats {
369
+ }
370
+
371
+ message QueryRequestAllUsersCommandStats {
372
+ }
373
+
374
+ message QueryResultCommandStats {
375
+ .exa.codeium_common_pb.CommandStats command_stats = 1;
376
+ }
377
+
378
+ message QueryRequestActiveDaysByApiKey {
379
+ }
380
+
381
+ message QueryResultActiveDaysByApiKey {
382
+ map<string, uint32> active_days_by_api_key = 1;
383
+ }
384
+
385
+ message QueryResultError {
386
+ string error = 1;
387
+ }
388
+
389
+ message QueryRequestCascadeLines {
390
+ }
391
+
392
+ message CascadeLineQueryEntry {
393
+ .google.protobuf.Timestamp day = 1;
394
+ int64 lines_suggested = 2;
395
+ int64 lines_accepted = 3;
396
+ }
397
+
398
+ message QueryResultCascadeLines {
399
+ repeated CascadeLineQueryEntry cascade_lines = 1;
400
+ }
401
+
402
+ message QueryRequestCascadeToolUsage {
403
+ }
404
+
405
+ message CascadeToolUsageQueryEntry {
406
+ .google.protobuf.Timestamp day = 1;
407
+ string tool = 2;
408
+ int64 count = 3;
409
+ }
410
+
411
+ message QueryResultCascadeToolUsage {
412
+ repeated CascadeToolUsageQueryEntry cascade_tool_usage = 1;
413
+ }
414
+
415
+ message QueryRequestCascadeRuns {
416
+ }
417
+
418
+ message CascadeRunsQueryEntry {
419
+ .google.protobuf.Timestamp day = 1;
420
+ string model = 2;
421
+ string mode = 3;
422
+ int64 messages_sent = 4;
423
+ int64 prompts_used = 5;
424
+ string cascade_id = 6;
425
+ }
426
+
427
+ message QueryResultCascadeRuns {
428
+ repeated CascadeRunsQueryEntry cascade_runs = 1;
429
+ }
430
+
431
+ message QueryRequestAllUsersCascadeRuns {
432
+ }
433
+
434
+ message QueryRequestAllUsersCascadeToolUsage {
435
+ }
436
+
437
+ message QueryRequestAllUsersCascadeLines {
438
+ }
439
+
440
+ message GetGlobalLeaderboardApiKeyRequest {
441
+ }
442
+
443
+ message GetGlobalLeaderboardApiKeyResponse {
444
+ string api_key = 1;
445
+ }
446
+
447
+ message GetBigQueryAnalyticsRequest {
448
+ string api_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
449
+ .google.protobuf.Timestamp start_timestamp = 2;
450
+ .google.protobuf.Timestamp end_timestamp = 3;
451
+ repeated BigQueryRequest query_requests = 4;
452
+ }
453
+
454
+ message GetBigQueryAnalyticsResponse {
455
+ repeated BigQueryResult query_results = 1;
456
+ }
457
+
458
+ message BigQueryRequest {
459
+ oneof request_type {
460
+ BigQueryLeaderboardRequest leaderboard_request = 1;
461
+ }
462
+ }
463
+
464
+ message BigQueryResult {
465
+ oneof result_type {
466
+ BigQueryResultError error = 1;
467
+ BigQueryLeaderboardResult leaderboard_result = 2;
468
+ }
469
+ }
470
+
471
+ message BigQueryResultError {
472
+ string error = 1;
473
+ }
474
+
475
+ message BigQueryLeaderboardRequest {
476
+ }
477
+
478
+ message BigQueryLeaderboardResult {
479
+ repeated ModelStats model_stats = 1;
480
+ .google.protobuf.Timestamp last_queried_at = 2;
481
+ }
482
+
483
+ message ModelStats {
484
+ string model = 1;
485
+ int64 elo_rating = 2;
486
+ int64 votes = 3;
487
+ double win_rate = 4;
488
+ int64 confidence_lower = 6;
489
+ int64 confidence_upper = 7;
490
+ double model_speed = 8;
491
+ string model_group = 9;
492
+ reserved 5;
493
+ reserved "model_provider";
494
+ }
495
+
496
+ message GetDevinUserAnalyticsRequest {
497
+ string start_date = 1 [deprecated = true];
498
+ string end_date = 2 [deprecated = true];
499
+ .google.protobuf.Timestamp start_date_ts = 3;
500
+ .google.protobuf.Timestamp end_date_ts = 4;
501
+ }
502
+
503
+ message GetDevinUserAnalyticsResponse {
504
+ repeated DevinUsageEntry devin_usage_entries = 1;
505
+ double total_acus = 2;
506
+ }
507
+
508
+ message DevinUsageEntry {
509
+ string day = 1;
510
+ double acus = 2;
511
+ }
512
+
513
+ message AcuConsumptionQuery {
514
+ oneof period {
515
+ AcuConsumptionHistoricalPeriod historical = 1;
516
+ AcuConsumptionCurrentCyclePeriod current_cycle = 2;
517
+ option (buf.validate.oneof) = { required: true };
518
+ }
519
+ bool include_team_total = 3;
520
+ repeated string group_ids = 4 [(buf.validate.field) = { repeated: { max_items: 100 } }];
521
+ AcuConsumptionUserScope user_scope = 5;
522
+ int32 page_size = 6 [(buf.validate.field) = { int32: { lte: 1000, gte: 0 } }];
523
+ string page_token = 7;
524
+ }
525
+
526
+ message AcuConsumptionHistoricalPeriod {
527
+ }
528
+
529
+ message AcuConsumptionCurrentCyclePeriod {
530
+ }
531
+
532
+ message AcuConsumptionUserScope {
533
+ oneof scope {
534
+ AcuConsumptionTeamScope team = 1;
535
+ string group_id = 2 [(buf.validate.field) = { string: { min_len: 1 } }];
536
+ option (buf.validate.oneof) = { required: true };
537
+ }
538
+ }
539
+
540
+ message AcuConsumptionTeamScope {
541
+ }
542
+
543
+ message AcuConsumptionResponse {
544
+ AcuConsumptionTeamResult team = 1;
545
+ repeated AcuConsumptionGroupResult groups = 2;
546
+ string next_page_token = 3;
547
+ AcuConsumptionMetadata metadata = 4;
548
+ }
549
+
550
+ message AcuConsumptionTeamResult {
551
+ optional double total_acus = 1;
552
+ repeated AcuConsumptionUserRow user_rows = 2;
553
+ }
554
+
555
+ message AcuConsumptionGroupResult {
556
+ string group_id = 1;
557
+ string group_name = 2;
558
+ double total_acus = 3;
559
+ repeated AcuConsumptionUserRow user_rows = 4;
560
+ }
561
+
562
+ message AcuConsumptionUserRow {
563
+ string user_id = 1;
564
+ string email = 2;
565
+ bool current_member = 3;
566
+ double total_acus = 4;
567
+ }
568
+
569
+ message AcuConsumptionMetadata {
570
+ .google.protobuf.Timestamp period_start = 1;
571
+ .google.protobuf.Timestamp period_end = 2;
572
+ .google.protobuf.Timestamp generated_at = 3;
573
+ string team_id = 4;
574
+ repeated string group_ids = 5;
575
+ string billing_mode = 6;
576
+ }
577
+
578
+ message ListGroupsRequest {
579
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
580
+ string multitenant_team_id = 2;
581
+ int32 page_size = 3 [(buf.validate.field) = { int32: { lte: 1000, gte: 0 } }];
582
+ string page_token = 4;
583
+ }
584
+
585
+ message ListGroupsResponse {
586
+ repeated ManagedGroupSummary groups = 1;
587
+ string next_page_token = 2;
588
+ }
589
+
590
+ message ManagedGroupSummary {
591
+ string group_id = 1;
592
+ string name = 2;
593
+ int32 member_count = 3;
594
+ }
595
+
596
+ message GetGroupRequest {
597
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
598
+ string multitenant_team_id = 2;
599
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
600
+ }
601
+
602
+ message GetGroupResponse {
603
+ ManagedGroup group = 1;
604
+ }
605
+
606
+ message ManagedGroup {
607
+ string group_id = 1;
608
+ string name = 2;
609
+ int32 member_count = 3;
610
+ repeated string cascade_model_uids = 4;
611
+ repeated string command_model_uids = 5;
612
+ optional double configured_cycle_acu_limit = 6;
613
+ optional double effective_cycle_acu_limit = 7;
614
+ }
615
+
616
+ message CreateGroupRequest {
617
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
618
+ string multitenant_team_id = 2;
619
+ string name = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
620
+ }
621
+
622
+ message CreateGroupResponse {
623
+ ManagedGroup group = 1;
624
+ }
625
+
626
+ message GroupModelAllowlist {
627
+ repeated string model_uids = 1;
628
+ }
629
+
630
+ message UpdateGroupRequest {
631
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
632
+ string multitenant_team_id = 2;
633
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
634
+ optional string name = 4 [(buf.validate.field) = { string: { min_len: 1 } }];
635
+ GroupModelAllowlist cascade_models = 5;
636
+ GroupModelAllowlist command_models = 6;
637
+ oneof acu_cap_update {
638
+ double set_cycle_acu_limit = 7 [(buf.validate.field) = { double: { gt: 0.0 } }];
639
+ bool clear_cycle_acu_limit = 8;
640
+ }
641
+ }
642
+
643
+ message UpdateGroupResponse {
644
+ ManagedGroup group = 1;
645
+ }
646
+
647
+ message DeleteGroupRequest {
648
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
649
+ string multitenant_team_id = 2;
650
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
651
+ }
652
+
653
+ message DeleteGroupResponse {
654
+ }
655
+
656
+ message ListGroupMembersRequest {
657
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
658
+ string multitenant_team_id = 2;
659
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
660
+ int32 page_size = 4 [(buf.validate.field) = { int32: { lte: 1000, gte: 0 } }];
661
+ string page_token = 5;
662
+ }
663
+
664
+ message ListGroupMembersResponse {
665
+ repeated ManagedGroupMember members = 1;
666
+ string next_page_token = 2;
667
+ }
668
+
669
+ message ManagedGroupMember {
670
+ string user_id = 1;
671
+ string email = 2;
672
+ }
673
+
674
+ message AddGroupMembersRequest {
675
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
676
+ string multitenant_team_id = 2;
677
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
678
+ repeated string user_emails = 4 [(buf.validate.field) = { repeated: { min_items: 1, max_items: 1000 } }];
679
+ }
680
+
681
+ message AddGroupMembersResponse {
682
+ }
683
+
684
+ message RemoveGroupMembersRequest {
685
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
686
+ string multitenant_team_id = 2;
687
+ string group_id = 3 [(buf.validate.field) = { string: { min_len: 1 } }];
688
+ repeated string user_emails = 4 [(buf.validate.field) = { repeated: { min_items: 1, max_items: 1000 } }];
689
+ }
690
+
691
+ message RemoveGroupMembersResponse {
692
+ }
693
+
694
+ message UserAcuCapSelector {
695
+ oneof selector {
696
+ string email = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
697
+ string user_id = 2 [(buf.validate.field) = { string: { min_len: 1 } }];
698
+ option (buf.validate.oneof) = { required: true };
699
+ }
700
+ }
701
+
702
+ message GetUserAcuCapRequest {
703
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
704
+ string multitenant_team_id = 2;
705
+ UserAcuCapSelector user = 3 [(buf.validate.field) = { required: true }];
706
+ }
707
+
708
+ message GetUserAcuCapResponse {
709
+ UserAcuCap cap = 1;
710
+ }
711
+
712
+ message UserAcuCap {
713
+ string user_id = 1;
714
+ string email = 2;
715
+ optional double configured_cycle_acu_limit = 3;
716
+ optional double effective_cycle_acu_limit = 4;
717
+ }
718
+
719
+ message UpdateUserAcuCapRequest {
720
+ string service_key = 1 [(buf.validate.field) = { string: { min_len: 1 } }];
721
+ string multitenant_team_id = 2;
722
+ UserAcuCapSelector user = 3 [(buf.validate.field) = { required: true }];
723
+ oneof acu_cap_update {
724
+ double set_cycle_acu_limit = 4 [(buf.validate.field) = { double: { gte: 0.0 } }];
725
+ bool clear_cycle_acu_limit = 5;
726
+ option (buf.validate.oneof) = { required: true };
727
+ }
728
+ }
729
+
730
+ message UpdateUserAcuCapResponse {
731
+ UserAcuCap cap = 1;
732
+ }
733
+
734
+ service UserAnalyticsService {
735
+ rpc Analytics(AnalyticsRequest) returns (AnalyticsResponse);
736
+ rpc UserPageAnalytics(UserPageAnalyticsRequest) returns (UserPageAnalyticsResponse);
737
+ rpc CascadeAnalytics(CascadeAnalyticsRequest) returns (CascadeAnalyticsResponse);
738
+ rpc GetAnalytics(GetAnalyticsRequest) returns (GetAnalyticsResponse);
739
+ rpc GetGlobalLeaderboardApiKey(GetGlobalLeaderboardApiKeyRequest) returns (GetGlobalLeaderboardApiKeyResponse);
740
+ rpc GetBigQueryAnalytics(GetBigQueryAnalyticsRequest) returns (GetBigQueryAnalyticsResponse);
741
+ rpc GetDevinUserAnalytics(GetDevinUserAnalyticsRequest) returns (GetDevinUserAnalyticsResponse);
742
+ rpc ListGroups(ListGroupsRequest) returns (ListGroupsResponse);
743
+ rpc GetGroup(GetGroupRequest) returns (GetGroupResponse);
744
+ rpc CreateGroup(CreateGroupRequest) returns (CreateGroupResponse);
745
+ rpc UpdateGroup(UpdateGroupRequest) returns (UpdateGroupResponse);
746
+ rpc DeleteGroup(DeleteGroupRequest) returns (DeleteGroupResponse);
747
+ rpc ListGroupMembers(ListGroupMembersRequest) returns (ListGroupMembersResponse);
748
+ rpc AddGroupMembers(AddGroupMembersRequest) returns (AddGroupMembersResponse);
749
+ rpc RemoveGroupMembers(RemoveGroupMembersRequest) returns (RemoveGroupMembersResponse);
750
+ rpc GetUserAcuCap(GetUserAcuCapRequest) returns (GetUserAcuCapResponse);
751
+ rpc UpdateUserAcuCap(UpdateUserAcuCapRequest) returns (UpdateUserAcuCapResponse);
752
+ }