@miradorlabs/web-grpc 3.6.0 → 3.8.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.
|
@@ -1409,6 +1409,29 @@ export interface DailyActivityRequest {
|
|
|
1409
1409
|
/** Inclusive UTC calendar-day bounds, YYYY-MM-DD. end_date >= start_date. */
|
|
1410
1410
|
startDate: string;
|
|
1411
1411
|
endDate: string;
|
|
1412
|
+
/** Optional slice; unset returns the whole project. */
|
|
1413
|
+
filter: DailyActivityRequest_Filter | undefined;
|
|
1414
|
+
}
|
|
1415
|
+
|
|
1416
|
+
/**
|
|
1417
|
+
* Filter slices the calendar by stored names: OR within a list, AND across lists, empty = no filter, at
|
|
1418
|
+
* most 500 entries each. A tool call or user message counts for its turn's model and provider; git
|
|
1419
|
+
* activity and files for the model of the tool call that produced them; "" selects what recorded none.
|
|
1420
|
+
* Work belongs to its user id, else its api key: an api-key principal matches only work with no user id.
|
|
1421
|
+
*/
|
|
1422
|
+
export interface DailyActivityRequest_Filter {
|
|
1423
|
+
sourceSystems: string[];
|
|
1424
|
+
models: string[];
|
|
1425
|
+
providers: string[];
|
|
1426
|
+
/** A principal with an empty id selects work that recorded neither a user id nor an api key. */
|
|
1427
|
+
principals: DailyActivityPrincipal[];
|
|
1428
|
+
}
|
|
1429
|
+
|
|
1430
|
+
/** DailyActivityPrincipal is one user id or api key, as one source system reported it (empty = any source). */
|
|
1431
|
+
export interface DailyActivityPrincipal {
|
|
1432
|
+
kind: AIPrincipalKind;
|
|
1433
|
+
id: string;
|
|
1434
|
+
sourceSystem: string;
|
|
1412
1435
|
}
|
|
1413
1436
|
|
|
1414
1437
|
/**
|
|
@@ -1425,11 +1448,13 @@ export interface DailyActivity {
|
|
|
1425
1448
|
asOf: Date | undefined;
|
|
1426
1449
|
}
|
|
1427
1450
|
|
|
1451
|
+
/** principals are the ids with activity in the slice that day: a call's user id, else its api key. */
|
|
1428
1452
|
export interface DailyActivityDay {
|
|
1429
1453
|
/** YYYY-MM-DD UTC */
|
|
1430
1454
|
day: string;
|
|
1431
1455
|
measures: DailyActivityMeasures | undefined;
|
|
1432
1456
|
provisional: boolean;
|
|
1457
|
+
principals: DailyActivityPrincipal[];
|
|
1433
1458
|
}
|
|
1434
1459
|
|
|
1435
1460
|
/**
|
|
@@ -1462,6 +1487,8 @@ export interface DailyActivityMeasures {
|
|
|
1462
1487
|
subscriptionFacilityCacheReadTokens: number;
|
|
1463
1488
|
subscriptionFacilityCacheWriteTokens: number;
|
|
1464
1489
|
subscriptionFacilityUsd: number;
|
|
1490
|
+
/** distinct sessions with activity in the slice that day (exact to a few thousand, ~0.5% beyond) */
|
|
1491
|
+
sessions: number;
|
|
1465
1492
|
}
|
|
1466
1493
|
|
|
1467
1494
|
export interface ActivityRhythmRequest {
|
|
@@ -1636,6 +1663,57 @@ export interface ModelActivityPrincipal {
|
|
|
1636
1663
|
costUsd: number;
|
|
1637
1664
|
}
|
|
1638
1665
|
|
|
1666
|
+
export interface SessionUsageTrendRequest {
|
|
1667
|
+
organizationId: string;
|
|
1668
|
+
projectId: string;
|
|
1669
|
+
sourceSystem: string;
|
|
1670
|
+
/** The session's routing-key partitions, 1 to 100, read as one session. */
|
|
1671
|
+
sessionIds: string[];
|
|
1672
|
+
/**
|
|
1673
|
+
* Bucket width in seconds, > 0; buckets start at multiples of it since the Unix epoch (UTC). Widened to
|
|
1674
|
+
* the next step of 1, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200 s or a
|
|
1675
|
+
* whole number of days when the session would span more than 2000 buckets.
|
|
1676
|
+
*/
|
|
1677
|
+
bucketSeconds: number;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
export interface SessionUsageTrendResponse {
|
|
1681
|
+
status:
|
|
1682
|
+
| ResponseStatus
|
|
1683
|
+
| undefined;
|
|
1684
|
+
/** the width the buckets use */
|
|
1685
|
+
bucketSeconds: number;
|
|
1686
|
+
/** per (bucket, model), by bucket_start then model */
|
|
1687
|
+
buckets: SessionUsageBucket[];
|
|
1688
|
+
/** per (bucket, action), by bucket_start then action */
|
|
1689
|
+
gitBuckets: SessionGitBucket[];
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* SessionUsageBucket: model is the stored name, '' when unreported; input_tokens is cache-inclusive, the
|
|
1694
|
+
* cache fields are subsets.
|
|
1695
|
+
*/
|
|
1696
|
+
export interface SessionUsageBucket {
|
|
1697
|
+
bucketStart: Date | undefined;
|
|
1698
|
+
model: string;
|
|
1699
|
+
modelCalls: number;
|
|
1700
|
+
inputTokens: number;
|
|
1701
|
+
outputTokens: number;
|
|
1702
|
+
cacheReadTokens: number;
|
|
1703
|
+
cacheWriteTokens: number;
|
|
1704
|
+
costUsd: number;
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
/**
|
|
1708
|
+
* SessionGitBucket: the stored action (commit, push, pr_create, pr_merge, …), counted as the session rollup
|
|
1709
|
+
* counts it (known failures left out).
|
|
1710
|
+
*/
|
|
1711
|
+
export interface SessionGitBucket {
|
|
1712
|
+
bucketStart: Date | undefined;
|
|
1713
|
+
action: string;
|
|
1714
|
+
count: number;
|
|
1715
|
+
}
|
|
1716
|
+
|
|
1639
1717
|
/** AISessionRef is a session's identity: two sources can issue the same session_id. */
|
|
1640
1718
|
export interface AISessionRef {
|
|
1641
1719
|
sourceSystem: string;
|
|
@@ -9870,7 +9948,7 @@ export const BurnRateMeasures: MessageFns<BurnRateMeasures> = {
|
|
|
9870
9948
|
};
|
|
9871
9949
|
|
|
9872
9950
|
function createBaseDailyActivityRequest(): DailyActivityRequest {
|
|
9873
|
-
return { organizationId: "", projectId: "", startDate: "", endDate: "" };
|
|
9951
|
+
return { organizationId: "", projectId: "", startDate: "", endDate: "", filter: undefined };
|
|
9874
9952
|
}
|
|
9875
9953
|
|
|
9876
9954
|
export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
@@ -9887,6 +9965,9 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
|
9887
9965
|
if (message.endDate !== "") {
|
|
9888
9966
|
writer.uint32(34).string(message.endDate);
|
|
9889
9967
|
}
|
|
9968
|
+
if (message.filter !== undefined) {
|
|
9969
|
+
DailyActivityRequest_Filter.encode(message.filter, writer.uint32(42).fork()).join();
|
|
9970
|
+
}
|
|
9890
9971
|
return writer;
|
|
9891
9972
|
},
|
|
9892
9973
|
|
|
@@ -9935,6 +10016,14 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
|
9935
10016
|
message.endDate = reader.string();
|
|
9936
10017
|
continue;
|
|
9937
10018
|
}
|
|
10019
|
+
case 5: {
|
|
10020
|
+
if (tag !== 42) {
|
|
10021
|
+
break;
|
|
10022
|
+
}
|
|
10023
|
+
|
|
10024
|
+
message.filter = DailyActivityRequest_Filter.decode(reader, reader.uint32());
|
|
10025
|
+
continue;
|
|
10026
|
+
}
|
|
9938
10027
|
}
|
|
9939
10028
|
if ((tag & 7) === 4 || tag === 0) {
|
|
9940
10029
|
break;
|
|
@@ -9969,6 +10058,7 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
|
9969
10058
|
: isSet(object.end_date)
|
|
9970
10059
|
? globalThis.String(object.end_date)
|
|
9971
10060
|
: "",
|
|
10061
|
+
filter: isSet(object.filter) ? DailyActivityRequest_Filter.fromJSON(object.filter) : undefined,
|
|
9972
10062
|
};
|
|
9973
10063
|
},
|
|
9974
10064
|
|
|
@@ -9986,6 +10076,9 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
|
9986
10076
|
if (message.endDate !== "") {
|
|
9987
10077
|
obj.endDate = message.endDate;
|
|
9988
10078
|
}
|
|
10079
|
+
if (message.filter !== undefined) {
|
|
10080
|
+
obj.filter = DailyActivityRequest_Filter.toJSON(message.filter);
|
|
10081
|
+
}
|
|
9989
10082
|
return obj;
|
|
9990
10083
|
},
|
|
9991
10084
|
|
|
@@ -9998,6 +10091,239 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
|
|
|
9998
10091
|
message.projectId = object.projectId ?? "";
|
|
9999
10092
|
message.startDate = object.startDate ?? "";
|
|
10000
10093
|
message.endDate = object.endDate ?? "";
|
|
10094
|
+
message.filter = (object.filter !== undefined && object.filter !== null)
|
|
10095
|
+
? DailyActivityRequest_Filter.fromPartial(object.filter)
|
|
10096
|
+
: undefined;
|
|
10097
|
+
return message;
|
|
10098
|
+
},
|
|
10099
|
+
};
|
|
10100
|
+
|
|
10101
|
+
function createBaseDailyActivityRequest_Filter(): DailyActivityRequest_Filter {
|
|
10102
|
+
return { sourceSystems: [], models: [], providers: [], principals: [] };
|
|
10103
|
+
}
|
|
10104
|
+
|
|
10105
|
+
export const DailyActivityRequest_Filter: MessageFns<DailyActivityRequest_Filter> = {
|
|
10106
|
+
encode(message: DailyActivityRequest_Filter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
10107
|
+
for (const v of message.sourceSystems) {
|
|
10108
|
+
writer.uint32(10).string(v!);
|
|
10109
|
+
}
|
|
10110
|
+
for (const v of message.models) {
|
|
10111
|
+
writer.uint32(18).string(v!);
|
|
10112
|
+
}
|
|
10113
|
+
for (const v of message.providers) {
|
|
10114
|
+
writer.uint32(26).string(v!);
|
|
10115
|
+
}
|
|
10116
|
+
for (const v of message.principals) {
|
|
10117
|
+
DailyActivityPrincipal.encode(v!, writer.uint32(34).fork()).join();
|
|
10118
|
+
}
|
|
10119
|
+
return writer;
|
|
10120
|
+
},
|
|
10121
|
+
|
|
10122
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityRequest_Filter {
|
|
10123
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10124
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
10125
|
+
if (previousRecursionDepth >= 100) {
|
|
10126
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
10127
|
+
}
|
|
10128
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
10129
|
+
try {
|
|
10130
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
10131
|
+
const message = createBaseDailyActivityRequest_Filter();
|
|
10132
|
+
while (reader.pos < end) {
|
|
10133
|
+
const tag = reader.uint32();
|
|
10134
|
+
switch (tag >>> 3) {
|
|
10135
|
+
case 1: {
|
|
10136
|
+
if (tag !== 10) {
|
|
10137
|
+
break;
|
|
10138
|
+
}
|
|
10139
|
+
|
|
10140
|
+
message.sourceSystems.push(reader.string());
|
|
10141
|
+
continue;
|
|
10142
|
+
}
|
|
10143
|
+
case 2: {
|
|
10144
|
+
if (tag !== 18) {
|
|
10145
|
+
break;
|
|
10146
|
+
}
|
|
10147
|
+
|
|
10148
|
+
message.models.push(reader.string());
|
|
10149
|
+
continue;
|
|
10150
|
+
}
|
|
10151
|
+
case 3: {
|
|
10152
|
+
if (tag !== 26) {
|
|
10153
|
+
break;
|
|
10154
|
+
}
|
|
10155
|
+
|
|
10156
|
+
message.providers.push(reader.string());
|
|
10157
|
+
continue;
|
|
10158
|
+
}
|
|
10159
|
+
case 4: {
|
|
10160
|
+
if (tag !== 34) {
|
|
10161
|
+
break;
|
|
10162
|
+
}
|
|
10163
|
+
|
|
10164
|
+
message.principals.push(DailyActivityPrincipal.decode(reader, reader.uint32()));
|
|
10165
|
+
continue;
|
|
10166
|
+
}
|
|
10167
|
+
}
|
|
10168
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10169
|
+
break;
|
|
10170
|
+
}
|
|
10171
|
+
reader.skip(tag & 7);
|
|
10172
|
+
}
|
|
10173
|
+
return message;
|
|
10174
|
+
} finally {
|
|
10175
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
10176
|
+
}
|
|
10177
|
+
},
|
|
10178
|
+
|
|
10179
|
+
fromJSON(object: any): DailyActivityRequest_Filter {
|
|
10180
|
+
return {
|
|
10181
|
+
sourceSystems: globalThis.Array.isArray(object?.sourceSystems)
|
|
10182
|
+
? object.sourceSystems.map((e: any) => globalThis.String(e))
|
|
10183
|
+
: globalThis.Array.isArray(object?.source_systems)
|
|
10184
|
+
? object.source_systems.map((e: any) => globalThis.String(e))
|
|
10185
|
+
: [],
|
|
10186
|
+
models: globalThis.Array.isArray(object?.models) ? object.models.map((e: any) => globalThis.String(e)) : [],
|
|
10187
|
+
providers: globalThis.Array.isArray(object?.providers)
|
|
10188
|
+
? object.providers.map((e: any) => globalThis.String(e))
|
|
10189
|
+
: [],
|
|
10190
|
+
principals: globalThis.Array.isArray(object?.principals)
|
|
10191
|
+
? object.principals.map((e: any) => DailyActivityPrincipal.fromJSON(e))
|
|
10192
|
+
: [],
|
|
10193
|
+
};
|
|
10194
|
+
},
|
|
10195
|
+
|
|
10196
|
+
toJSON(message: DailyActivityRequest_Filter): unknown {
|
|
10197
|
+
const obj: any = {};
|
|
10198
|
+
if (message.sourceSystems?.length) {
|
|
10199
|
+
obj.sourceSystems = message.sourceSystems;
|
|
10200
|
+
}
|
|
10201
|
+
if (message.models?.length) {
|
|
10202
|
+
obj.models = message.models;
|
|
10203
|
+
}
|
|
10204
|
+
if (message.providers?.length) {
|
|
10205
|
+
obj.providers = message.providers;
|
|
10206
|
+
}
|
|
10207
|
+
if (message.principals?.length) {
|
|
10208
|
+
obj.principals = message.principals.map((e) => DailyActivityPrincipal.toJSON(e));
|
|
10209
|
+
}
|
|
10210
|
+
return obj;
|
|
10211
|
+
},
|
|
10212
|
+
|
|
10213
|
+
create<I extends Exact<DeepPartial<DailyActivityRequest_Filter>, I>>(base?: I): DailyActivityRequest_Filter {
|
|
10214
|
+
return DailyActivityRequest_Filter.fromPartial(base ?? ({} as any));
|
|
10215
|
+
},
|
|
10216
|
+
fromPartial<I extends Exact<DeepPartial<DailyActivityRequest_Filter>, I>>(object: I): DailyActivityRequest_Filter {
|
|
10217
|
+
const message = createBaseDailyActivityRequest_Filter();
|
|
10218
|
+
message.sourceSystems = object.sourceSystems?.map((e) => e) || [];
|
|
10219
|
+
message.models = object.models?.map((e) => e) || [];
|
|
10220
|
+
message.providers = object.providers?.map((e) => e) || [];
|
|
10221
|
+
message.principals = object.principals?.map((e) => DailyActivityPrincipal.fromPartial(e)) || [];
|
|
10222
|
+
return message;
|
|
10223
|
+
},
|
|
10224
|
+
};
|
|
10225
|
+
|
|
10226
|
+
function createBaseDailyActivityPrincipal(): DailyActivityPrincipal {
|
|
10227
|
+
return { kind: 0, id: "", sourceSystem: "" };
|
|
10228
|
+
}
|
|
10229
|
+
|
|
10230
|
+
export const DailyActivityPrincipal: MessageFns<DailyActivityPrincipal> = {
|
|
10231
|
+
encode(message: DailyActivityPrincipal, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
10232
|
+
if (message.kind !== 0) {
|
|
10233
|
+
writer.uint32(8).int32(message.kind);
|
|
10234
|
+
}
|
|
10235
|
+
if (message.id !== "") {
|
|
10236
|
+
writer.uint32(18).string(message.id);
|
|
10237
|
+
}
|
|
10238
|
+
if (message.sourceSystem !== "") {
|
|
10239
|
+
writer.uint32(26).string(message.sourceSystem);
|
|
10240
|
+
}
|
|
10241
|
+
return writer;
|
|
10242
|
+
},
|
|
10243
|
+
|
|
10244
|
+
decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityPrincipal {
|
|
10245
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
10246
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
10247
|
+
if (previousRecursionDepth >= 100) {
|
|
10248
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
10249
|
+
}
|
|
10250
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
10251
|
+
try {
|
|
10252
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
10253
|
+
const message = createBaseDailyActivityPrincipal();
|
|
10254
|
+
while (reader.pos < end) {
|
|
10255
|
+
const tag = reader.uint32();
|
|
10256
|
+
switch (tag >>> 3) {
|
|
10257
|
+
case 1: {
|
|
10258
|
+
if (tag !== 8) {
|
|
10259
|
+
break;
|
|
10260
|
+
}
|
|
10261
|
+
|
|
10262
|
+
message.kind = reader.int32() as any;
|
|
10263
|
+
continue;
|
|
10264
|
+
}
|
|
10265
|
+
case 2: {
|
|
10266
|
+
if (tag !== 18) {
|
|
10267
|
+
break;
|
|
10268
|
+
}
|
|
10269
|
+
|
|
10270
|
+
message.id = reader.string();
|
|
10271
|
+
continue;
|
|
10272
|
+
}
|
|
10273
|
+
case 3: {
|
|
10274
|
+
if (tag !== 26) {
|
|
10275
|
+
break;
|
|
10276
|
+
}
|
|
10277
|
+
|
|
10278
|
+
message.sourceSystem = reader.string();
|
|
10279
|
+
continue;
|
|
10280
|
+
}
|
|
10281
|
+
}
|
|
10282
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
10283
|
+
break;
|
|
10284
|
+
}
|
|
10285
|
+
reader.skip(tag & 7);
|
|
10286
|
+
}
|
|
10287
|
+
return message;
|
|
10288
|
+
} finally {
|
|
10289
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
10290
|
+
}
|
|
10291
|
+
},
|
|
10292
|
+
|
|
10293
|
+
fromJSON(object: any): DailyActivityPrincipal {
|
|
10294
|
+
return {
|
|
10295
|
+
kind: isSet(object.kind) ? aIPrincipalKindFromJSON(object.kind) : 0,
|
|
10296
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
10297
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
10298
|
+
? globalThis.String(object.sourceSystem)
|
|
10299
|
+
: isSet(object.source_system)
|
|
10300
|
+
? globalThis.String(object.source_system)
|
|
10301
|
+
: "",
|
|
10302
|
+
};
|
|
10303
|
+
},
|
|
10304
|
+
|
|
10305
|
+
toJSON(message: DailyActivityPrincipal): unknown {
|
|
10306
|
+
const obj: any = {};
|
|
10307
|
+
if (message.kind !== 0) {
|
|
10308
|
+
obj.kind = aIPrincipalKindToJSON(message.kind);
|
|
10309
|
+
}
|
|
10310
|
+
if (message.id !== "") {
|
|
10311
|
+
obj.id = message.id;
|
|
10312
|
+
}
|
|
10313
|
+
if (message.sourceSystem !== "") {
|
|
10314
|
+
obj.sourceSystem = message.sourceSystem;
|
|
10315
|
+
}
|
|
10316
|
+
return obj;
|
|
10317
|
+
},
|
|
10318
|
+
|
|
10319
|
+
create<I extends Exact<DeepPartial<DailyActivityPrincipal>, I>>(base?: I): DailyActivityPrincipal {
|
|
10320
|
+
return DailyActivityPrincipal.fromPartial(base ?? ({} as any));
|
|
10321
|
+
},
|
|
10322
|
+
fromPartial<I extends Exact<DeepPartial<DailyActivityPrincipal>, I>>(object: I): DailyActivityPrincipal {
|
|
10323
|
+
const message = createBaseDailyActivityPrincipal();
|
|
10324
|
+
message.kind = object.kind ?? 0;
|
|
10325
|
+
message.id = object.id ?? "";
|
|
10326
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
10001
10327
|
return message;
|
|
10002
10328
|
},
|
|
10003
10329
|
};
|
|
@@ -10168,7 +10494,7 @@ export const DailyActivity: MessageFns<DailyActivity> = {
|
|
|
10168
10494
|
};
|
|
10169
10495
|
|
|
10170
10496
|
function createBaseDailyActivityDay(): DailyActivityDay {
|
|
10171
|
-
return { day: "", measures: undefined, provisional: false };
|
|
10497
|
+
return { day: "", measures: undefined, provisional: false, principals: [] };
|
|
10172
10498
|
}
|
|
10173
10499
|
|
|
10174
10500
|
export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
@@ -10182,6 +10508,9 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
|
10182
10508
|
if (message.provisional !== false) {
|
|
10183
10509
|
writer.uint32(24).bool(message.provisional);
|
|
10184
10510
|
}
|
|
10511
|
+
for (const v of message.principals) {
|
|
10512
|
+
DailyActivityPrincipal.encode(v!, writer.uint32(34).fork()).join();
|
|
10513
|
+
}
|
|
10185
10514
|
return writer;
|
|
10186
10515
|
},
|
|
10187
10516
|
|
|
@@ -10222,6 +10551,14 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
|
10222
10551
|
message.provisional = reader.bool();
|
|
10223
10552
|
continue;
|
|
10224
10553
|
}
|
|
10554
|
+
case 4: {
|
|
10555
|
+
if (tag !== 34) {
|
|
10556
|
+
break;
|
|
10557
|
+
}
|
|
10558
|
+
|
|
10559
|
+
message.principals.push(DailyActivityPrincipal.decode(reader, reader.uint32()));
|
|
10560
|
+
continue;
|
|
10561
|
+
}
|
|
10225
10562
|
}
|
|
10226
10563
|
if ((tag & 7) === 4 || tag === 0) {
|
|
10227
10564
|
break;
|
|
@@ -10239,6 +10576,9 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
|
10239
10576
|
day: isSet(object.day) ? globalThis.String(object.day) : "",
|
|
10240
10577
|
measures: isSet(object.measures) ? DailyActivityMeasures.fromJSON(object.measures) : undefined,
|
|
10241
10578
|
provisional: isSet(object.provisional) ? globalThis.Boolean(object.provisional) : false,
|
|
10579
|
+
principals: globalThis.Array.isArray(object?.principals)
|
|
10580
|
+
? object.principals.map((e: any) => DailyActivityPrincipal.fromJSON(e))
|
|
10581
|
+
: [],
|
|
10242
10582
|
};
|
|
10243
10583
|
},
|
|
10244
10584
|
|
|
@@ -10253,6 +10593,9 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
|
10253
10593
|
if (message.provisional !== false) {
|
|
10254
10594
|
obj.provisional = message.provisional;
|
|
10255
10595
|
}
|
|
10596
|
+
if (message.principals?.length) {
|
|
10597
|
+
obj.principals = message.principals.map((e) => DailyActivityPrincipal.toJSON(e));
|
|
10598
|
+
}
|
|
10256
10599
|
return obj;
|
|
10257
10600
|
},
|
|
10258
10601
|
|
|
@@ -10266,6 +10609,7 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
|
|
|
10266
10609
|
? DailyActivityMeasures.fromPartial(object.measures)
|
|
10267
10610
|
: undefined;
|
|
10268
10611
|
message.provisional = object.provisional ?? false;
|
|
10612
|
+
message.principals = object.principals?.map((e) => DailyActivityPrincipal.fromPartial(e)) || [];
|
|
10269
10613
|
return message;
|
|
10270
10614
|
},
|
|
10271
10615
|
};
|
|
@@ -10291,6 +10635,7 @@ function createBaseDailyActivityMeasures(): DailyActivityMeasures {
|
|
|
10291
10635
|
subscriptionFacilityCacheReadTokens: 0,
|
|
10292
10636
|
subscriptionFacilityCacheWriteTokens: 0,
|
|
10293
10637
|
subscriptionFacilityUsd: 0,
|
|
10638
|
+
sessions: 0,
|
|
10294
10639
|
};
|
|
10295
10640
|
}
|
|
10296
10641
|
|
|
@@ -10353,6 +10698,9 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
|
|
|
10353
10698
|
if (message.subscriptionFacilityUsd !== 0) {
|
|
10354
10699
|
writer.uint32(153).double(message.subscriptionFacilityUsd);
|
|
10355
10700
|
}
|
|
10701
|
+
if (message.sessions !== 0) {
|
|
10702
|
+
writer.uint32(160).uint64(message.sessions);
|
|
10703
|
+
}
|
|
10356
10704
|
return writer;
|
|
10357
10705
|
},
|
|
10358
10706
|
|
|
@@ -10521,6 +10869,14 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
|
|
|
10521
10869
|
message.subscriptionFacilityUsd = reader.double();
|
|
10522
10870
|
continue;
|
|
10523
10871
|
}
|
|
10872
|
+
case 20: {
|
|
10873
|
+
if (tag !== 160) {
|
|
10874
|
+
break;
|
|
10875
|
+
}
|
|
10876
|
+
|
|
10877
|
+
message.sessions = longToNumber(reader.uint64());
|
|
10878
|
+
continue;
|
|
10879
|
+
}
|
|
10524
10880
|
}
|
|
10525
10881
|
if ((tag & 7) === 4 || tag === 0) {
|
|
10526
10882
|
break;
|
|
@@ -10626,6 +10982,7 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
|
|
|
10626
10982
|
: isSet(object.subscription_facility_usd)
|
|
10627
10983
|
? globalThis.Number(object.subscription_facility_usd)
|
|
10628
10984
|
: 0,
|
|
10985
|
+
sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
|
|
10629
10986
|
};
|
|
10630
10987
|
},
|
|
10631
10988
|
|
|
@@ -10688,6 +11045,9 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
|
|
|
10688
11045
|
if (message.subscriptionFacilityUsd !== 0) {
|
|
10689
11046
|
obj.subscriptionFacilityUsd = message.subscriptionFacilityUsd;
|
|
10690
11047
|
}
|
|
11048
|
+
if (message.sessions !== 0) {
|
|
11049
|
+
obj.sessions = Math.round(message.sessions);
|
|
11050
|
+
}
|
|
10691
11051
|
return obj;
|
|
10692
11052
|
},
|
|
10693
11053
|
|
|
@@ -10715,6 +11075,7 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
|
|
|
10715
11075
|
message.subscriptionFacilityCacheReadTokens = object.subscriptionFacilityCacheReadTokens ?? 0;
|
|
10716
11076
|
message.subscriptionFacilityCacheWriteTokens = object.subscriptionFacilityCacheWriteTokens ?? 0;
|
|
10717
11077
|
message.subscriptionFacilityUsd = object.subscriptionFacilityUsd ?? 0;
|
|
11078
|
+
message.sessions = object.sessions ?? 0;
|
|
10718
11079
|
return message;
|
|
10719
11080
|
},
|
|
10720
11081
|
};
|
|
@@ -13454,73 +13815,565 @@ export const ModelActivity: MessageFns<ModelActivity> = {
|
|
|
13454
13815
|
if (message.subagentRuns !== 0) {
|
|
13455
13816
|
obj.subagentRuns = Math.round(message.subagentRuns);
|
|
13456
13817
|
}
|
|
13457
|
-
if (message.ttftMsSum !== 0) {
|
|
13458
|
-
obj.ttftMsSum = Math.round(message.ttftMsSum);
|
|
13818
|
+
if (message.ttftMsSum !== 0) {
|
|
13819
|
+
obj.ttftMsSum = Math.round(message.ttftMsSum);
|
|
13820
|
+
}
|
|
13821
|
+
if (message.ttftCalls !== 0) {
|
|
13822
|
+
obj.ttftCalls = Math.round(message.ttftCalls);
|
|
13823
|
+
}
|
|
13824
|
+
if (message.providers?.length) {
|
|
13825
|
+
obj.providers = message.providers;
|
|
13826
|
+
}
|
|
13827
|
+
if (message.principals?.length) {
|
|
13828
|
+
obj.principals = message.principals.map((e) => ModelActivityPrincipal.toJSON(e));
|
|
13829
|
+
}
|
|
13830
|
+
return obj;
|
|
13831
|
+
},
|
|
13832
|
+
|
|
13833
|
+
create<I extends Exact<DeepPartial<ModelActivity>, I>>(base?: I): ModelActivity {
|
|
13834
|
+
return ModelActivity.fromPartial(base ?? ({} as any));
|
|
13835
|
+
},
|
|
13836
|
+
fromPartial<I extends Exact<DeepPartial<ModelActivity>, I>>(object: I): ModelActivity {
|
|
13837
|
+
const message = createBaseModelActivity();
|
|
13838
|
+
message.key = object.key ?? "";
|
|
13839
|
+
message.modelCalls = object.modelCalls ?? 0;
|
|
13840
|
+
message.failedCalls = object.failedCalls ?? 0;
|
|
13841
|
+
message.inputTokens = object.inputTokens ?? 0;
|
|
13842
|
+
message.outputTokens = object.outputTokens ?? 0;
|
|
13843
|
+
message.cacheReadTokens = object.cacheReadTokens ?? 0;
|
|
13844
|
+
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
13845
|
+
message.costUsd = object.costUsd ?? 0;
|
|
13846
|
+
message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
|
|
13847
|
+
message.sessions = object.sessions ?? 0;
|
|
13848
|
+
message.toolCalls = object.toolCalls ?? 0;
|
|
13849
|
+
message.compactions = object.compactions ?? 0;
|
|
13850
|
+
message.subagentRuns = object.subagentRuns ?? 0;
|
|
13851
|
+
message.ttftMsSum = object.ttftMsSum ?? 0;
|
|
13852
|
+
message.ttftCalls = object.ttftCalls ?? 0;
|
|
13853
|
+
message.providers = object.providers?.map((e) => e) || [];
|
|
13854
|
+
message.principals = object.principals?.map((e) => ModelActivityPrincipal.fromPartial(e)) || [];
|
|
13855
|
+
return message;
|
|
13856
|
+
},
|
|
13857
|
+
};
|
|
13858
|
+
|
|
13859
|
+
function createBaseModelActivityPrincipal(): ModelActivityPrincipal {
|
|
13860
|
+
return { kind: 0, id: "", sourceSystem: "", modelCalls: 0, sessions: 0, inputTokens: 0, outputTokens: 0, costUsd: 0 };
|
|
13861
|
+
}
|
|
13862
|
+
|
|
13863
|
+
export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
13864
|
+
encode(message: ModelActivityPrincipal, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13865
|
+
if (message.kind !== 0) {
|
|
13866
|
+
writer.uint32(8).int32(message.kind);
|
|
13867
|
+
}
|
|
13868
|
+
if (message.id !== "") {
|
|
13869
|
+
writer.uint32(18).string(message.id);
|
|
13870
|
+
}
|
|
13871
|
+
if (message.sourceSystem !== "") {
|
|
13872
|
+
writer.uint32(26).string(message.sourceSystem);
|
|
13873
|
+
}
|
|
13874
|
+
if (message.modelCalls !== 0) {
|
|
13875
|
+
writer.uint32(32).uint64(message.modelCalls);
|
|
13876
|
+
}
|
|
13877
|
+
if (message.sessions !== 0) {
|
|
13878
|
+
writer.uint32(40).uint64(message.sessions);
|
|
13879
|
+
}
|
|
13880
|
+
if (message.inputTokens !== 0) {
|
|
13881
|
+
writer.uint32(48).uint64(message.inputTokens);
|
|
13882
|
+
}
|
|
13883
|
+
if (message.outputTokens !== 0) {
|
|
13884
|
+
writer.uint32(56).uint64(message.outputTokens);
|
|
13885
|
+
}
|
|
13886
|
+
if (message.costUsd !== 0) {
|
|
13887
|
+
writer.uint32(65).double(message.costUsd);
|
|
13888
|
+
}
|
|
13889
|
+
return writer;
|
|
13890
|
+
},
|
|
13891
|
+
|
|
13892
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ModelActivityPrincipal {
|
|
13893
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13894
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13895
|
+
if (previousRecursionDepth >= 100) {
|
|
13896
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13897
|
+
}
|
|
13898
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13899
|
+
try {
|
|
13900
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13901
|
+
const message = createBaseModelActivityPrincipal();
|
|
13902
|
+
while (reader.pos < end) {
|
|
13903
|
+
const tag = reader.uint32();
|
|
13904
|
+
switch (tag >>> 3) {
|
|
13905
|
+
case 1: {
|
|
13906
|
+
if (tag !== 8) {
|
|
13907
|
+
break;
|
|
13908
|
+
}
|
|
13909
|
+
|
|
13910
|
+
message.kind = reader.int32() as any;
|
|
13911
|
+
continue;
|
|
13912
|
+
}
|
|
13913
|
+
case 2: {
|
|
13914
|
+
if (tag !== 18) {
|
|
13915
|
+
break;
|
|
13916
|
+
}
|
|
13917
|
+
|
|
13918
|
+
message.id = reader.string();
|
|
13919
|
+
continue;
|
|
13920
|
+
}
|
|
13921
|
+
case 3: {
|
|
13922
|
+
if (tag !== 26) {
|
|
13923
|
+
break;
|
|
13924
|
+
}
|
|
13925
|
+
|
|
13926
|
+
message.sourceSystem = reader.string();
|
|
13927
|
+
continue;
|
|
13928
|
+
}
|
|
13929
|
+
case 4: {
|
|
13930
|
+
if (tag !== 32) {
|
|
13931
|
+
break;
|
|
13932
|
+
}
|
|
13933
|
+
|
|
13934
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
13935
|
+
continue;
|
|
13936
|
+
}
|
|
13937
|
+
case 5: {
|
|
13938
|
+
if (tag !== 40) {
|
|
13939
|
+
break;
|
|
13940
|
+
}
|
|
13941
|
+
|
|
13942
|
+
message.sessions = longToNumber(reader.uint64());
|
|
13943
|
+
continue;
|
|
13944
|
+
}
|
|
13945
|
+
case 6: {
|
|
13946
|
+
if (tag !== 48) {
|
|
13947
|
+
break;
|
|
13948
|
+
}
|
|
13949
|
+
|
|
13950
|
+
message.inputTokens = longToNumber(reader.uint64());
|
|
13951
|
+
continue;
|
|
13952
|
+
}
|
|
13953
|
+
case 7: {
|
|
13954
|
+
if (tag !== 56) {
|
|
13955
|
+
break;
|
|
13956
|
+
}
|
|
13957
|
+
|
|
13958
|
+
message.outputTokens = longToNumber(reader.uint64());
|
|
13959
|
+
continue;
|
|
13960
|
+
}
|
|
13961
|
+
case 8: {
|
|
13962
|
+
if (tag !== 65) {
|
|
13963
|
+
break;
|
|
13964
|
+
}
|
|
13965
|
+
|
|
13966
|
+
message.costUsd = reader.double();
|
|
13967
|
+
continue;
|
|
13968
|
+
}
|
|
13969
|
+
}
|
|
13970
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13971
|
+
break;
|
|
13972
|
+
}
|
|
13973
|
+
reader.skip(tag & 7);
|
|
13974
|
+
}
|
|
13975
|
+
return message;
|
|
13976
|
+
} finally {
|
|
13977
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13978
|
+
}
|
|
13979
|
+
},
|
|
13980
|
+
|
|
13981
|
+
fromJSON(object: any): ModelActivityPrincipal {
|
|
13982
|
+
return {
|
|
13983
|
+
kind: isSet(object.kind) ? aIPrincipalKindFromJSON(object.kind) : 0,
|
|
13984
|
+
id: isSet(object.id) ? globalThis.String(object.id) : "",
|
|
13985
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
13986
|
+
? globalThis.String(object.sourceSystem)
|
|
13987
|
+
: isSet(object.source_system)
|
|
13988
|
+
? globalThis.String(object.source_system)
|
|
13989
|
+
: "",
|
|
13990
|
+
modelCalls: isSet(object.modelCalls)
|
|
13991
|
+
? globalThis.Number(object.modelCalls)
|
|
13992
|
+
: isSet(object.model_calls)
|
|
13993
|
+
? globalThis.Number(object.model_calls)
|
|
13994
|
+
: 0,
|
|
13995
|
+
sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
|
|
13996
|
+
inputTokens: isSet(object.inputTokens)
|
|
13997
|
+
? globalThis.Number(object.inputTokens)
|
|
13998
|
+
: isSet(object.input_tokens)
|
|
13999
|
+
? globalThis.Number(object.input_tokens)
|
|
14000
|
+
: 0,
|
|
14001
|
+
outputTokens: isSet(object.outputTokens)
|
|
14002
|
+
? globalThis.Number(object.outputTokens)
|
|
14003
|
+
: isSet(object.output_tokens)
|
|
14004
|
+
? globalThis.Number(object.output_tokens)
|
|
14005
|
+
: 0,
|
|
14006
|
+
costUsd: isSet(object.costUsd)
|
|
14007
|
+
? globalThis.Number(object.costUsd)
|
|
14008
|
+
: isSet(object.cost_usd)
|
|
14009
|
+
? globalThis.Number(object.cost_usd)
|
|
14010
|
+
: 0,
|
|
14011
|
+
};
|
|
14012
|
+
},
|
|
14013
|
+
|
|
14014
|
+
toJSON(message: ModelActivityPrincipal): unknown {
|
|
14015
|
+
const obj: any = {};
|
|
14016
|
+
if (message.kind !== 0) {
|
|
14017
|
+
obj.kind = aIPrincipalKindToJSON(message.kind);
|
|
14018
|
+
}
|
|
14019
|
+
if (message.id !== "") {
|
|
14020
|
+
obj.id = message.id;
|
|
14021
|
+
}
|
|
14022
|
+
if (message.sourceSystem !== "") {
|
|
14023
|
+
obj.sourceSystem = message.sourceSystem;
|
|
14024
|
+
}
|
|
14025
|
+
if (message.modelCalls !== 0) {
|
|
14026
|
+
obj.modelCalls = Math.round(message.modelCalls);
|
|
14027
|
+
}
|
|
14028
|
+
if (message.sessions !== 0) {
|
|
14029
|
+
obj.sessions = Math.round(message.sessions);
|
|
14030
|
+
}
|
|
14031
|
+
if (message.inputTokens !== 0) {
|
|
14032
|
+
obj.inputTokens = Math.round(message.inputTokens);
|
|
14033
|
+
}
|
|
14034
|
+
if (message.outputTokens !== 0) {
|
|
14035
|
+
obj.outputTokens = Math.round(message.outputTokens);
|
|
14036
|
+
}
|
|
14037
|
+
if (message.costUsd !== 0) {
|
|
14038
|
+
obj.costUsd = message.costUsd;
|
|
14039
|
+
}
|
|
14040
|
+
return obj;
|
|
14041
|
+
},
|
|
14042
|
+
|
|
14043
|
+
create<I extends Exact<DeepPartial<ModelActivityPrincipal>, I>>(base?: I): ModelActivityPrincipal {
|
|
14044
|
+
return ModelActivityPrincipal.fromPartial(base ?? ({} as any));
|
|
14045
|
+
},
|
|
14046
|
+
fromPartial<I extends Exact<DeepPartial<ModelActivityPrincipal>, I>>(object: I): ModelActivityPrincipal {
|
|
14047
|
+
const message = createBaseModelActivityPrincipal();
|
|
14048
|
+
message.kind = object.kind ?? 0;
|
|
14049
|
+
message.id = object.id ?? "";
|
|
14050
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
14051
|
+
message.modelCalls = object.modelCalls ?? 0;
|
|
14052
|
+
message.sessions = object.sessions ?? 0;
|
|
14053
|
+
message.inputTokens = object.inputTokens ?? 0;
|
|
14054
|
+
message.outputTokens = object.outputTokens ?? 0;
|
|
14055
|
+
message.costUsd = object.costUsd ?? 0;
|
|
14056
|
+
return message;
|
|
14057
|
+
},
|
|
14058
|
+
};
|
|
14059
|
+
|
|
14060
|
+
function createBaseSessionUsageTrendRequest(): SessionUsageTrendRequest {
|
|
14061
|
+
return { organizationId: "", projectId: "", sourceSystem: "", sessionIds: [], bucketSeconds: 0 };
|
|
14062
|
+
}
|
|
14063
|
+
|
|
14064
|
+
export const SessionUsageTrendRequest: MessageFns<SessionUsageTrendRequest> = {
|
|
14065
|
+
encode(message: SessionUsageTrendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14066
|
+
if (message.organizationId !== "") {
|
|
14067
|
+
writer.uint32(10).string(message.organizationId);
|
|
14068
|
+
}
|
|
14069
|
+
if (message.projectId !== "") {
|
|
14070
|
+
writer.uint32(18).string(message.projectId);
|
|
14071
|
+
}
|
|
14072
|
+
if (message.sourceSystem !== "") {
|
|
14073
|
+
writer.uint32(26).string(message.sourceSystem);
|
|
14074
|
+
}
|
|
14075
|
+
for (const v of message.sessionIds) {
|
|
14076
|
+
writer.uint32(34).string(v!);
|
|
14077
|
+
}
|
|
14078
|
+
if (message.bucketSeconds !== 0) {
|
|
14079
|
+
writer.uint32(40).uint32(message.bucketSeconds);
|
|
14080
|
+
}
|
|
14081
|
+
return writer;
|
|
14082
|
+
},
|
|
14083
|
+
|
|
14084
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageTrendRequest {
|
|
14085
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14086
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14087
|
+
if (previousRecursionDepth >= 100) {
|
|
14088
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14089
|
+
}
|
|
14090
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14091
|
+
try {
|
|
14092
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14093
|
+
const message = createBaseSessionUsageTrendRequest();
|
|
14094
|
+
while (reader.pos < end) {
|
|
14095
|
+
const tag = reader.uint32();
|
|
14096
|
+
switch (tag >>> 3) {
|
|
14097
|
+
case 1: {
|
|
14098
|
+
if (tag !== 10) {
|
|
14099
|
+
break;
|
|
14100
|
+
}
|
|
14101
|
+
|
|
14102
|
+
message.organizationId = reader.string();
|
|
14103
|
+
continue;
|
|
14104
|
+
}
|
|
14105
|
+
case 2: {
|
|
14106
|
+
if (tag !== 18) {
|
|
14107
|
+
break;
|
|
14108
|
+
}
|
|
14109
|
+
|
|
14110
|
+
message.projectId = reader.string();
|
|
14111
|
+
continue;
|
|
14112
|
+
}
|
|
14113
|
+
case 3: {
|
|
14114
|
+
if (tag !== 26) {
|
|
14115
|
+
break;
|
|
14116
|
+
}
|
|
14117
|
+
|
|
14118
|
+
message.sourceSystem = reader.string();
|
|
14119
|
+
continue;
|
|
14120
|
+
}
|
|
14121
|
+
case 4: {
|
|
14122
|
+
if (tag !== 34) {
|
|
14123
|
+
break;
|
|
14124
|
+
}
|
|
14125
|
+
|
|
14126
|
+
message.sessionIds.push(reader.string());
|
|
14127
|
+
continue;
|
|
14128
|
+
}
|
|
14129
|
+
case 5: {
|
|
14130
|
+
if (tag !== 40) {
|
|
14131
|
+
break;
|
|
14132
|
+
}
|
|
14133
|
+
|
|
14134
|
+
message.bucketSeconds = reader.uint32();
|
|
14135
|
+
continue;
|
|
14136
|
+
}
|
|
14137
|
+
}
|
|
14138
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14139
|
+
break;
|
|
14140
|
+
}
|
|
14141
|
+
reader.skip(tag & 7);
|
|
14142
|
+
}
|
|
14143
|
+
return message;
|
|
14144
|
+
} finally {
|
|
14145
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14146
|
+
}
|
|
14147
|
+
},
|
|
14148
|
+
|
|
14149
|
+
fromJSON(object: any): SessionUsageTrendRequest {
|
|
14150
|
+
return {
|
|
14151
|
+
organizationId: isSet(object.organizationId)
|
|
14152
|
+
? globalThis.String(object.organizationId)
|
|
14153
|
+
: isSet(object.organization_id)
|
|
14154
|
+
? globalThis.String(object.organization_id)
|
|
14155
|
+
: "",
|
|
14156
|
+
projectId: isSet(object.projectId)
|
|
14157
|
+
? globalThis.String(object.projectId)
|
|
14158
|
+
: isSet(object.project_id)
|
|
14159
|
+
? globalThis.String(object.project_id)
|
|
14160
|
+
: "",
|
|
14161
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
14162
|
+
? globalThis.String(object.sourceSystem)
|
|
14163
|
+
: isSet(object.source_system)
|
|
14164
|
+
? globalThis.String(object.source_system)
|
|
14165
|
+
: "",
|
|
14166
|
+
sessionIds: globalThis.Array.isArray(object?.sessionIds)
|
|
14167
|
+
? object.sessionIds.map((e: any) => globalThis.String(e))
|
|
14168
|
+
: globalThis.Array.isArray(object?.session_ids)
|
|
14169
|
+
? object.session_ids.map((e: any) => globalThis.String(e))
|
|
14170
|
+
: [],
|
|
14171
|
+
bucketSeconds: isSet(object.bucketSeconds)
|
|
14172
|
+
? globalThis.Number(object.bucketSeconds)
|
|
14173
|
+
: isSet(object.bucket_seconds)
|
|
14174
|
+
? globalThis.Number(object.bucket_seconds)
|
|
14175
|
+
: 0,
|
|
14176
|
+
};
|
|
14177
|
+
},
|
|
14178
|
+
|
|
14179
|
+
toJSON(message: SessionUsageTrendRequest): unknown {
|
|
14180
|
+
const obj: any = {};
|
|
14181
|
+
if (message.organizationId !== "") {
|
|
14182
|
+
obj.organizationId = message.organizationId;
|
|
14183
|
+
}
|
|
14184
|
+
if (message.projectId !== "") {
|
|
14185
|
+
obj.projectId = message.projectId;
|
|
14186
|
+
}
|
|
14187
|
+
if (message.sourceSystem !== "") {
|
|
14188
|
+
obj.sourceSystem = message.sourceSystem;
|
|
14189
|
+
}
|
|
14190
|
+
if (message.sessionIds?.length) {
|
|
14191
|
+
obj.sessionIds = message.sessionIds;
|
|
14192
|
+
}
|
|
14193
|
+
if (message.bucketSeconds !== 0) {
|
|
14194
|
+
obj.bucketSeconds = Math.round(message.bucketSeconds);
|
|
14195
|
+
}
|
|
14196
|
+
return obj;
|
|
14197
|
+
},
|
|
14198
|
+
|
|
14199
|
+
create<I extends Exact<DeepPartial<SessionUsageTrendRequest>, I>>(base?: I): SessionUsageTrendRequest {
|
|
14200
|
+
return SessionUsageTrendRequest.fromPartial(base ?? ({} as any));
|
|
14201
|
+
},
|
|
14202
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageTrendRequest>, I>>(object: I): SessionUsageTrendRequest {
|
|
14203
|
+
const message = createBaseSessionUsageTrendRequest();
|
|
14204
|
+
message.organizationId = object.organizationId ?? "";
|
|
14205
|
+
message.projectId = object.projectId ?? "";
|
|
14206
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
14207
|
+
message.sessionIds = object.sessionIds?.map((e) => e) || [];
|
|
14208
|
+
message.bucketSeconds = object.bucketSeconds ?? 0;
|
|
14209
|
+
return message;
|
|
14210
|
+
},
|
|
14211
|
+
};
|
|
14212
|
+
|
|
14213
|
+
function createBaseSessionUsageTrendResponse(): SessionUsageTrendResponse {
|
|
14214
|
+
return { status: undefined, bucketSeconds: 0, buckets: [], gitBuckets: [] };
|
|
14215
|
+
}
|
|
14216
|
+
|
|
14217
|
+
export const SessionUsageTrendResponse: MessageFns<SessionUsageTrendResponse> = {
|
|
14218
|
+
encode(message: SessionUsageTrendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14219
|
+
if (message.status !== undefined) {
|
|
14220
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
14221
|
+
}
|
|
14222
|
+
if (message.bucketSeconds !== 0) {
|
|
14223
|
+
writer.uint32(16).uint32(message.bucketSeconds);
|
|
14224
|
+
}
|
|
14225
|
+
for (const v of message.buckets) {
|
|
14226
|
+
SessionUsageBucket.encode(v!, writer.uint32(26).fork()).join();
|
|
14227
|
+
}
|
|
14228
|
+
for (const v of message.gitBuckets) {
|
|
14229
|
+
SessionGitBucket.encode(v!, writer.uint32(34).fork()).join();
|
|
14230
|
+
}
|
|
14231
|
+
return writer;
|
|
14232
|
+
},
|
|
14233
|
+
|
|
14234
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageTrendResponse {
|
|
14235
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14236
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14237
|
+
if (previousRecursionDepth >= 100) {
|
|
14238
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14239
|
+
}
|
|
14240
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14241
|
+
try {
|
|
14242
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14243
|
+
const message = createBaseSessionUsageTrendResponse();
|
|
14244
|
+
while (reader.pos < end) {
|
|
14245
|
+
const tag = reader.uint32();
|
|
14246
|
+
switch (tag >>> 3) {
|
|
14247
|
+
case 1: {
|
|
14248
|
+
if (tag !== 10) {
|
|
14249
|
+
break;
|
|
14250
|
+
}
|
|
14251
|
+
|
|
14252
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
14253
|
+
continue;
|
|
14254
|
+
}
|
|
14255
|
+
case 2: {
|
|
14256
|
+
if (tag !== 16) {
|
|
14257
|
+
break;
|
|
14258
|
+
}
|
|
14259
|
+
|
|
14260
|
+
message.bucketSeconds = reader.uint32();
|
|
14261
|
+
continue;
|
|
14262
|
+
}
|
|
14263
|
+
case 3: {
|
|
14264
|
+
if (tag !== 26) {
|
|
14265
|
+
break;
|
|
14266
|
+
}
|
|
14267
|
+
|
|
14268
|
+
message.buckets.push(SessionUsageBucket.decode(reader, reader.uint32()));
|
|
14269
|
+
continue;
|
|
14270
|
+
}
|
|
14271
|
+
case 4: {
|
|
14272
|
+
if (tag !== 34) {
|
|
14273
|
+
break;
|
|
14274
|
+
}
|
|
14275
|
+
|
|
14276
|
+
message.gitBuckets.push(SessionGitBucket.decode(reader, reader.uint32()));
|
|
14277
|
+
continue;
|
|
14278
|
+
}
|
|
14279
|
+
}
|
|
14280
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14281
|
+
break;
|
|
14282
|
+
}
|
|
14283
|
+
reader.skip(tag & 7);
|
|
14284
|
+
}
|
|
14285
|
+
return message;
|
|
14286
|
+
} finally {
|
|
14287
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14288
|
+
}
|
|
14289
|
+
},
|
|
14290
|
+
|
|
14291
|
+
fromJSON(object: any): SessionUsageTrendResponse {
|
|
14292
|
+
return {
|
|
14293
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
14294
|
+
bucketSeconds: isSet(object.bucketSeconds)
|
|
14295
|
+
? globalThis.Number(object.bucketSeconds)
|
|
14296
|
+
: isSet(object.bucket_seconds)
|
|
14297
|
+
? globalThis.Number(object.bucket_seconds)
|
|
14298
|
+
: 0,
|
|
14299
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
14300
|
+
? object.buckets.map((e: any) => SessionUsageBucket.fromJSON(e))
|
|
14301
|
+
: [],
|
|
14302
|
+
gitBuckets: globalThis.Array.isArray(object?.gitBuckets)
|
|
14303
|
+
? object.gitBuckets.map((e: any) => SessionGitBucket.fromJSON(e))
|
|
14304
|
+
: globalThis.Array.isArray(object?.git_buckets)
|
|
14305
|
+
? object.git_buckets.map((e: any) => SessionGitBucket.fromJSON(e))
|
|
14306
|
+
: [],
|
|
14307
|
+
};
|
|
14308
|
+
},
|
|
14309
|
+
|
|
14310
|
+
toJSON(message: SessionUsageTrendResponse): unknown {
|
|
14311
|
+
const obj: any = {};
|
|
14312
|
+
if (message.status !== undefined) {
|
|
14313
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
13459
14314
|
}
|
|
13460
|
-
if (message.
|
|
13461
|
-
obj.
|
|
14315
|
+
if (message.bucketSeconds !== 0) {
|
|
14316
|
+
obj.bucketSeconds = Math.round(message.bucketSeconds);
|
|
13462
14317
|
}
|
|
13463
|
-
if (message.
|
|
13464
|
-
obj.
|
|
14318
|
+
if (message.buckets?.length) {
|
|
14319
|
+
obj.buckets = message.buckets.map((e) => SessionUsageBucket.toJSON(e));
|
|
13465
14320
|
}
|
|
13466
|
-
if (message.
|
|
13467
|
-
obj.
|
|
14321
|
+
if (message.gitBuckets?.length) {
|
|
14322
|
+
obj.gitBuckets = message.gitBuckets.map((e) => SessionGitBucket.toJSON(e));
|
|
13468
14323
|
}
|
|
13469
14324
|
return obj;
|
|
13470
14325
|
},
|
|
13471
14326
|
|
|
13472
|
-
create<I extends Exact<DeepPartial<
|
|
13473
|
-
return
|
|
14327
|
+
create<I extends Exact<DeepPartial<SessionUsageTrendResponse>, I>>(base?: I): SessionUsageTrendResponse {
|
|
14328
|
+
return SessionUsageTrendResponse.fromPartial(base ?? ({} as any));
|
|
13474
14329
|
},
|
|
13475
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
13476
|
-
const message =
|
|
13477
|
-
message.
|
|
13478
|
-
|
|
13479
|
-
|
|
13480
|
-
message.
|
|
13481
|
-
message.
|
|
13482
|
-
message.
|
|
13483
|
-
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
13484
|
-
message.costUsd = object.costUsd ?? 0;
|
|
13485
|
-
message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
|
|
13486
|
-
message.sessions = object.sessions ?? 0;
|
|
13487
|
-
message.toolCalls = object.toolCalls ?? 0;
|
|
13488
|
-
message.compactions = object.compactions ?? 0;
|
|
13489
|
-
message.subagentRuns = object.subagentRuns ?? 0;
|
|
13490
|
-
message.ttftMsSum = object.ttftMsSum ?? 0;
|
|
13491
|
-
message.ttftCalls = object.ttftCalls ?? 0;
|
|
13492
|
-
message.providers = object.providers?.map((e) => e) || [];
|
|
13493
|
-
message.principals = object.principals?.map((e) => ModelActivityPrincipal.fromPartial(e)) || [];
|
|
14330
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageTrendResponse>, I>>(object: I): SessionUsageTrendResponse {
|
|
14331
|
+
const message = createBaseSessionUsageTrendResponse();
|
|
14332
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
14333
|
+
? ResponseStatus.fromPartial(object.status)
|
|
14334
|
+
: undefined;
|
|
14335
|
+
message.bucketSeconds = object.bucketSeconds ?? 0;
|
|
14336
|
+
message.buckets = object.buckets?.map((e) => SessionUsageBucket.fromPartial(e)) || [];
|
|
14337
|
+
message.gitBuckets = object.gitBuckets?.map((e) => SessionGitBucket.fromPartial(e)) || [];
|
|
13494
14338
|
return message;
|
|
13495
14339
|
},
|
|
13496
14340
|
};
|
|
13497
14341
|
|
|
13498
|
-
function
|
|
13499
|
-
return {
|
|
14342
|
+
function createBaseSessionUsageBucket(): SessionUsageBucket {
|
|
14343
|
+
return {
|
|
14344
|
+
bucketStart: undefined,
|
|
14345
|
+
model: "",
|
|
14346
|
+
modelCalls: 0,
|
|
14347
|
+
inputTokens: 0,
|
|
14348
|
+
outputTokens: 0,
|
|
14349
|
+
cacheReadTokens: 0,
|
|
14350
|
+
cacheWriteTokens: 0,
|
|
14351
|
+
costUsd: 0,
|
|
14352
|
+
};
|
|
13500
14353
|
}
|
|
13501
14354
|
|
|
13502
|
-
export const
|
|
13503
|
-
encode(message:
|
|
13504
|
-
if (message.
|
|
13505
|
-
writer.uint32(
|
|
13506
|
-
}
|
|
13507
|
-
if (message.id !== "") {
|
|
13508
|
-
writer.uint32(18).string(message.id);
|
|
14355
|
+
export const SessionUsageBucket: MessageFns<SessionUsageBucket> = {
|
|
14356
|
+
encode(message: SessionUsageBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14357
|
+
if (message.bucketStart !== undefined) {
|
|
14358
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
13509
14359
|
}
|
|
13510
|
-
if (message.
|
|
13511
|
-
writer.uint32(
|
|
14360
|
+
if (message.model !== "") {
|
|
14361
|
+
writer.uint32(18).string(message.model);
|
|
13512
14362
|
}
|
|
13513
14363
|
if (message.modelCalls !== 0) {
|
|
13514
|
-
writer.uint32(
|
|
13515
|
-
}
|
|
13516
|
-
if (message.sessions !== 0) {
|
|
13517
|
-
writer.uint32(40).uint64(message.sessions);
|
|
14364
|
+
writer.uint32(24).uint64(message.modelCalls);
|
|
13518
14365
|
}
|
|
13519
14366
|
if (message.inputTokens !== 0) {
|
|
13520
|
-
writer.uint32(
|
|
14367
|
+
writer.uint32(32).uint64(message.inputTokens);
|
|
13521
14368
|
}
|
|
13522
14369
|
if (message.outputTokens !== 0) {
|
|
13523
|
-
writer.uint32(
|
|
14370
|
+
writer.uint32(40).uint64(message.outputTokens);
|
|
14371
|
+
}
|
|
14372
|
+
if (message.cacheReadTokens !== 0) {
|
|
14373
|
+
writer.uint32(48).uint64(message.cacheReadTokens);
|
|
14374
|
+
}
|
|
14375
|
+
if (message.cacheWriteTokens !== 0) {
|
|
14376
|
+
writer.uint32(56).uint64(message.cacheWriteTokens);
|
|
13524
14377
|
}
|
|
13525
14378
|
if (message.costUsd !== 0) {
|
|
13526
14379
|
writer.uint32(65).double(message.costUsd);
|
|
@@ -13528,7 +14381,7 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13528
14381
|
return writer;
|
|
13529
14382
|
},
|
|
13530
14383
|
|
|
13531
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
14384
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageBucket {
|
|
13532
14385
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13533
14386
|
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13534
14387
|
if (previousRecursionDepth >= 100) {
|
|
@@ -13537,16 +14390,16 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13537
14390
|
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13538
14391
|
try {
|
|
13539
14392
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13540
|
-
const message =
|
|
14393
|
+
const message = createBaseSessionUsageBucket();
|
|
13541
14394
|
while (reader.pos < end) {
|
|
13542
14395
|
const tag = reader.uint32();
|
|
13543
14396
|
switch (tag >>> 3) {
|
|
13544
14397
|
case 1: {
|
|
13545
|
-
if (tag !==
|
|
14398
|
+
if (tag !== 10) {
|
|
13546
14399
|
break;
|
|
13547
14400
|
}
|
|
13548
14401
|
|
|
13549
|
-
message.
|
|
14402
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
13550
14403
|
continue;
|
|
13551
14404
|
}
|
|
13552
14405
|
case 2: {
|
|
@@ -13554,15 +14407,15 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13554
14407
|
break;
|
|
13555
14408
|
}
|
|
13556
14409
|
|
|
13557
|
-
message.
|
|
14410
|
+
message.model = reader.string();
|
|
13558
14411
|
continue;
|
|
13559
14412
|
}
|
|
13560
14413
|
case 3: {
|
|
13561
|
-
if (tag !==
|
|
14414
|
+
if (tag !== 24) {
|
|
13562
14415
|
break;
|
|
13563
14416
|
}
|
|
13564
14417
|
|
|
13565
|
-
message.
|
|
14418
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
13566
14419
|
continue;
|
|
13567
14420
|
}
|
|
13568
14421
|
case 4: {
|
|
@@ -13570,7 +14423,7 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13570
14423
|
break;
|
|
13571
14424
|
}
|
|
13572
14425
|
|
|
13573
|
-
message.
|
|
14426
|
+
message.inputTokens = longToNumber(reader.uint64());
|
|
13574
14427
|
continue;
|
|
13575
14428
|
}
|
|
13576
14429
|
case 5: {
|
|
@@ -13578,7 +14431,7 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13578
14431
|
break;
|
|
13579
14432
|
}
|
|
13580
14433
|
|
|
13581
|
-
message.
|
|
14434
|
+
message.outputTokens = longToNumber(reader.uint64());
|
|
13582
14435
|
continue;
|
|
13583
14436
|
}
|
|
13584
14437
|
case 6: {
|
|
@@ -13586,7 +14439,7 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13586
14439
|
break;
|
|
13587
14440
|
}
|
|
13588
14441
|
|
|
13589
|
-
message.
|
|
14442
|
+
message.cacheReadTokens = longToNumber(reader.uint64());
|
|
13590
14443
|
continue;
|
|
13591
14444
|
}
|
|
13592
14445
|
case 7: {
|
|
@@ -13594,7 +14447,7 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13594
14447
|
break;
|
|
13595
14448
|
}
|
|
13596
14449
|
|
|
13597
|
-
message.
|
|
14450
|
+
message.cacheWriteTokens = longToNumber(reader.uint64());
|
|
13598
14451
|
continue;
|
|
13599
14452
|
}
|
|
13600
14453
|
case 8: {
|
|
@@ -13617,21 +14470,19 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13617
14470
|
}
|
|
13618
14471
|
},
|
|
13619
14472
|
|
|
13620
|
-
fromJSON(object: any):
|
|
14473
|
+
fromJSON(object: any): SessionUsageBucket {
|
|
13621
14474
|
return {
|
|
13622
|
-
|
|
13623
|
-
|
|
13624
|
-
|
|
13625
|
-
?
|
|
13626
|
-
:
|
|
13627
|
-
|
|
13628
|
-
: "",
|
|
14475
|
+
bucketStart: isSet(object.bucketStart)
|
|
14476
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
14477
|
+
: isSet(object.bucket_start)
|
|
14478
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
14479
|
+
: undefined,
|
|
14480
|
+
model: isSet(object.model) ? globalThis.String(object.model) : "",
|
|
13629
14481
|
modelCalls: isSet(object.modelCalls)
|
|
13630
14482
|
? globalThis.Number(object.modelCalls)
|
|
13631
14483
|
: isSet(object.model_calls)
|
|
13632
14484
|
? globalThis.Number(object.model_calls)
|
|
13633
14485
|
: 0,
|
|
13634
|
-
sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
|
|
13635
14486
|
inputTokens: isSet(object.inputTokens)
|
|
13636
14487
|
? globalThis.Number(object.inputTokens)
|
|
13637
14488
|
: isSet(object.input_tokens)
|
|
@@ -13642,6 +14493,16 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13642
14493
|
: isSet(object.output_tokens)
|
|
13643
14494
|
? globalThis.Number(object.output_tokens)
|
|
13644
14495
|
: 0,
|
|
14496
|
+
cacheReadTokens: isSet(object.cacheReadTokens)
|
|
14497
|
+
? globalThis.Number(object.cacheReadTokens)
|
|
14498
|
+
: isSet(object.cache_read_tokens)
|
|
14499
|
+
? globalThis.Number(object.cache_read_tokens)
|
|
14500
|
+
: 0,
|
|
14501
|
+
cacheWriteTokens: isSet(object.cacheWriteTokens)
|
|
14502
|
+
? globalThis.Number(object.cacheWriteTokens)
|
|
14503
|
+
: isSet(object.cache_write_tokens)
|
|
14504
|
+
? globalThis.Number(object.cache_write_tokens)
|
|
14505
|
+
: 0,
|
|
13645
14506
|
costUsd: isSet(object.costUsd)
|
|
13646
14507
|
? globalThis.Number(object.costUsd)
|
|
13647
14508
|
: isSet(object.cost_usd)
|
|
@@ -13650,52 +14511,157 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13650
14511
|
};
|
|
13651
14512
|
},
|
|
13652
14513
|
|
|
13653
|
-
toJSON(message:
|
|
14514
|
+
toJSON(message: SessionUsageBucket): unknown {
|
|
13654
14515
|
const obj: any = {};
|
|
13655
|
-
if (message.
|
|
13656
|
-
obj.
|
|
13657
|
-
}
|
|
13658
|
-
if (message.id !== "") {
|
|
13659
|
-
obj.id = message.id;
|
|
14516
|
+
if (message.bucketStart !== undefined) {
|
|
14517
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
13660
14518
|
}
|
|
13661
|
-
if (message.
|
|
13662
|
-
obj.
|
|
14519
|
+
if (message.model !== "") {
|
|
14520
|
+
obj.model = message.model;
|
|
13663
14521
|
}
|
|
13664
14522
|
if (message.modelCalls !== 0) {
|
|
13665
14523
|
obj.modelCalls = Math.round(message.modelCalls);
|
|
13666
14524
|
}
|
|
13667
|
-
if (message.sessions !== 0) {
|
|
13668
|
-
obj.sessions = Math.round(message.sessions);
|
|
13669
|
-
}
|
|
13670
14525
|
if (message.inputTokens !== 0) {
|
|
13671
14526
|
obj.inputTokens = Math.round(message.inputTokens);
|
|
13672
14527
|
}
|
|
13673
14528
|
if (message.outputTokens !== 0) {
|
|
13674
14529
|
obj.outputTokens = Math.round(message.outputTokens);
|
|
13675
14530
|
}
|
|
14531
|
+
if (message.cacheReadTokens !== 0) {
|
|
14532
|
+
obj.cacheReadTokens = Math.round(message.cacheReadTokens);
|
|
14533
|
+
}
|
|
14534
|
+
if (message.cacheWriteTokens !== 0) {
|
|
14535
|
+
obj.cacheWriteTokens = Math.round(message.cacheWriteTokens);
|
|
14536
|
+
}
|
|
13676
14537
|
if (message.costUsd !== 0) {
|
|
13677
14538
|
obj.costUsd = message.costUsd;
|
|
13678
14539
|
}
|
|
13679
14540
|
return obj;
|
|
13680
14541
|
},
|
|
13681
14542
|
|
|
13682
|
-
create<I extends Exact<DeepPartial<
|
|
13683
|
-
return
|
|
14543
|
+
create<I extends Exact<DeepPartial<SessionUsageBucket>, I>>(base?: I): SessionUsageBucket {
|
|
14544
|
+
return SessionUsageBucket.fromPartial(base ?? ({} as any));
|
|
13684
14545
|
},
|
|
13685
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
13686
|
-
const message =
|
|
13687
|
-
message.
|
|
13688
|
-
message.
|
|
13689
|
-
message.sourceSystem = object.sourceSystem ?? "";
|
|
14546
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageBucket>, I>>(object: I): SessionUsageBucket {
|
|
14547
|
+
const message = createBaseSessionUsageBucket();
|
|
14548
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
14549
|
+
message.model = object.model ?? "";
|
|
13690
14550
|
message.modelCalls = object.modelCalls ?? 0;
|
|
13691
|
-
message.sessions = object.sessions ?? 0;
|
|
13692
14551
|
message.inputTokens = object.inputTokens ?? 0;
|
|
13693
14552
|
message.outputTokens = object.outputTokens ?? 0;
|
|
14553
|
+
message.cacheReadTokens = object.cacheReadTokens ?? 0;
|
|
14554
|
+
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
13694
14555
|
message.costUsd = object.costUsd ?? 0;
|
|
13695
14556
|
return message;
|
|
13696
14557
|
},
|
|
13697
14558
|
};
|
|
13698
14559
|
|
|
14560
|
+
function createBaseSessionGitBucket(): SessionGitBucket {
|
|
14561
|
+
return { bucketStart: undefined, action: "", count: 0 };
|
|
14562
|
+
}
|
|
14563
|
+
|
|
14564
|
+
export const SessionGitBucket: MessageFns<SessionGitBucket> = {
|
|
14565
|
+
encode(message: SessionGitBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14566
|
+
if (message.bucketStart !== undefined) {
|
|
14567
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
14568
|
+
}
|
|
14569
|
+
if (message.action !== "") {
|
|
14570
|
+
writer.uint32(18).string(message.action);
|
|
14571
|
+
}
|
|
14572
|
+
if (message.count !== 0) {
|
|
14573
|
+
writer.uint32(24).uint64(message.count);
|
|
14574
|
+
}
|
|
14575
|
+
return writer;
|
|
14576
|
+
},
|
|
14577
|
+
|
|
14578
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionGitBucket {
|
|
14579
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14580
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14581
|
+
if (previousRecursionDepth >= 100) {
|
|
14582
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14583
|
+
}
|
|
14584
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14585
|
+
try {
|
|
14586
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14587
|
+
const message = createBaseSessionGitBucket();
|
|
14588
|
+
while (reader.pos < end) {
|
|
14589
|
+
const tag = reader.uint32();
|
|
14590
|
+
switch (tag >>> 3) {
|
|
14591
|
+
case 1: {
|
|
14592
|
+
if (tag !== 10) {
|
|
14593
|
+
break;
|
|
14594
|
+
}
|
|
14595
|
+
|
|
14596
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14597
|
+
continue;
|
|
14598
|
+
}
|
|
14599
|
+
case 2: {
|
|
14600
|
+
if (tag !== 18) {
|
|
14601
|
+
break;
|
|
14602
|
+
}
|
|
14603
|
+
|
|
14604
|
+
message.action = reader.string();
|
|
14605
|
+
continue;
|
|
14606
|
+
}
|
|
14607
|
+
case 3: {
|
|
14608
|
+
if (tag !== 24) {
|
|
14609
|
+
break;
|
|
14610
|
+
}
|
|
14611
|
+
|
|
14612
|
+
message.count = longToNumber(reader.uint64());
|
|
14613
|
+
continue;
|
|
14614
|
+
}
|
|
14615
|
+
}
|
|
14616
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14617
|
+
break;
|
|
14618
|
+
}
|
|
14619
|
+
reader.skip(tag & 7);
|
|
14620
|
+
}
|
|
14621
|
+
return message;
|
|
14622
|
+
} finally {
|
|
14623
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14624
|
+
}
|
|
14625
|
+
},
|
|
14626
|
+
|
|
14627
|
+
fromJSON(object: any): SessionGitBucket {
|
|
14628
|
+
return {
|
|
14629
|
+
bucketStart: isSet(object.bucketStart)
|
|
14630
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
14631
|
+
: isSet(object.bucket_start)
|
|
14632
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
14633
|
+
: undefined,
|
|
14634
|
+
action: isSet(object.action) ? globalThis.String(object.action) : "",
|
|
14635
|
+
count: isSet(object.count) ? globalThis.Number(object.count) : 0,
|
|
14636
|
+
};
|
|
14637
|
+
},
|
|
14638
|
+
|
|
14639
|
+
toJSON(message: SessionGitBucket): unknown {
|
|
14640
|
+
const obj: any = {};
|
|
14641
|
+
if (message.bucketStart !== undefined) {
|
|
14642
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
14643
|
+
}
|
|
14644
|
+
if (message.action !== "") {
|
|
14645
|
+
obj.action = message.action;
|
|
14646
|
+
}
|
|
14647
|
+
if (message.count !== 0) {
|
|
14648
|
+
obj.count = Math.round(message.count);
|
|
14649
|
+
}
|
|
14650
|
+
return obj;
|
|
14651
|
+
},
|
|
14652
|
+
|
|
14653
|
+
create<I extends Exact<DeepPartial<SessionGitBucket>, I>>(base?: I): SessionGitBucket {
|
|
14654
|
+
return SessionGitBucket.fromPartial(base ?? ({} as any));
|
|
14655
|
+
},
|
|
14656
|
+
fromPartial<I extends Exact<DeepPartial<SessionGitBucket>, I>>(object: I): SessionGitBucket {
|
|
14657
|
+
const message = createBaseSessionGitBucket();
|
|
14658
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
14659
|
+
message.action = object.action ?? "";
|
|
14660
|
+
message.count = object.count ?? 0;
|
|
14661
|
+
return message;
|
|
14662
|
+
},
|
|
14663
|
+
};
|
|
14664
|
+
|
|
13699
14665
|
function createBaseAISessionRef(): AISessionRef {
|
|
13700
14666
|
return { sourceSystem: "", sessionId: "" };
|
|
13701
14667
|
}
|
|
@@ -17741,6 +18707,11 @@ export interface AIGatewayService {
|
|
|
17741
18707
|
* costliest first. Mirrors telemetry.api.v1.
|
|
17742
18708
|
*/
|
|
17743
18709
|
ListModelActivity(request: ModelActivityRequest, metadata?: Metadata): Promise<ModelActivityResponse>;
|
|
18710
|
+
/**
|
|
18711
|
+
* One session's model calls and git activity on one epoch-aligned time grid: per bucket, each model's
|
|
18712
|
+
* calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
|
|
18713
|
+
*/
|
|
18714
|
+
GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
|
|
17744
18715
|
/**
|
|
17745
18716
|
* Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
|
|
17746
18717
|
* per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
|
|
@@ -17777,6 +18748,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
17777
18748
|
this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
|
|
17778
18749
|
this.ListResourceRankings = this.ListResourceRankings.bind(this);
|
|
17779
18750
|
this.ListModelActivity = this.ListModelActivity.bind(this);
|
|
18751
|
+
this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
|
|
17780
18752
|
this.StreamEntitlements = this.StreamEntitlements.bind(this);
|
|
17781
18753
|
}
|
|
17782
18754
|
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
|
|
@@ -17914,6 +18886,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
17914
18886
|
return promise.then((data) => ModelActivityResponse.decode(new BinaryReader(data)));
|
|
17915
18887
|
}
|
|
17916
18888
|
|
|
18889
|
+
GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse> {
|
|
18890
|
+
const data = SessionUsageTrendRequest.encode(request).finish();
|
|
18891
|
+
const promise = this.rpc.request(this.service, "GetSessionUsageTrend", data, metadata);
|
|
18892
|
+
return promise.then((data) => SessionUsageTrendResponse.decode(new BinaryReader(data)));
|
|
18893
|
+
}
|
|
18894
|
+
|
|
17917
18895
|
StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot> {
|
|
17918
18896
|
const data = StreamEntitlementsRequest.encode(request).finish();
|
|
17919
18897
|
const result = this.rpc.serverStreamingRequest(this.service, "StreamEntitlements", data, metadata);
|