@miradorlabs/web-grpc 2.59.0 → 2.60.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.
@@ -1,6 +1,6 @@
1
1
  // Code generated by protoc-gen-ts_proto. DO NOT EDIT.
2
2
  // versions:
3
- // protoc-gen-ts_proto v2.12.3
3
+ // protoc-gen-ts_proto v2.12.4
4
4
  // protoc v3.21.12
5
5
  // source: proto/gateway/web/v1/ai_gateway.proto
6
6
 
@@ -1208,6 +1208,48 @@ export interface TokenActivityMeasures {
1208
1208
  modelCalls: number;
1209
1209
  }
1210
1210
 
1211
+ export interface BurnRateRequest {
1212
+ organizationId: string;
1213
+ projectId: string;
1214
+ /** model / provider / source_system / user_id / api_key_id narrow current + sparkline; active_after ignored. */
1215
+ filter:
1216
+ | AISessionFilter
1217
+ | undefined;
1218
+ /** Slices current_groups only (sparkline is always the filtered total). UNSPECIFIED = no breakdown. */
1219
+ groupBy: AITokenActivityDimension;
1220
+ }
1221
+
1222
+ /**
1223
+ * BurnRate mirrors telemetry.api.v1.BurnRate: the trailing-60s rate + a 60-point one-minute sparkline,
1224
+ * replaced wholesale each tick (streams carry no ResponseStatus).
1225
+ */
1226
+ export interface BurnRate {
1227
+ asOf: Date | undefined;
1228
+ current: BurnRateMeasures | undefined;
1229
+ currentGroups: BurnRateGroup[];
1230
+ sparkline: BurnRateSparkPoint[];
1231
+ groupBy: AITokenActivityDimension;
1232
+ }
1233
+
1234
+ export interface BurnRateGroup {
1235
+ key: string;
1236
+ rate: BurnRateMeasures | undefined;
1237
+ }
1238
+
1239
+ export interface BurnRateSparkPoint {
1240
+ bucketStart: Date | undefined;
1241
+ rate: BurnRateMeasures | undefined;
1242
+ }
1243
+
1244
+ /** BurnRateMeasures — usd_per_hour = bucket cost x 60; tokens_per_min = cache-inclusive input + output. */
1245
+ export interface BurnRateMeasures {
1246
+ usdPerHour: number;
1247
+ tokensPerMin: number;
1248
+ modelCalls: number;
1249
+ costUnavailableCount: number;
1250
+ usageUnavailableCount: number;
1251
+ }
1252
+
1211
1253
  export interface DailyActivityRequest {
1212
1254
  organizationId: string;
1213
1255
  projectId: string;
@@ -8895,28 +8937,28 @@ export const TokenActivityMeasures: MessageFns<TokenActivityMeasures> = {
8895
8937
  },
8896
8938
  };
8897
8939
 
8898
- function createBaseDailyActivityRequest(): DailyActivityRequest {
8899
- return { organizationId: "", projectId: "", startDate: "", endDate: "" };
8940
+ function createBaseBurnRateRequest(): BurnRateRequest {
8941
+ return { organizationId: "", projectId: "", filter: undefined, groupBy: 0 };
8900
8942
  }
8901
8943
 
8902
- export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
8903
- encode(message: DailyActivityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8944
+ export const BurnRateRequest: MessageFns<BurnRateRequest> = {
8945
+ encode(message: BurnRateRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
8904
8946
  if (message.organizationId !== "") {
8905
8947
  writer.uint32(10).string(message.organizationId);
8906
8948
  }
8907
8949
  if (message.projectId !== "") {
8908
8950
  writer.uint32(18).string(message.projectId);
8909
8951
  }
8910
- if (message.startDate !== "") {
8911
- writer.uint32(26).string(message.startDate);
8952
+ if (message.filter !== undefined) {
8953
+ AISessionFilter.encode(message.filter, writer.uint32(26).fork()).join();
8912
8954
  }
8913
- if (message.endDate !== "") {
8914
- writer.uint32(34).string(message.endDate);
8955
+ if (message.groupBy !== 0) {
8956
+ writer.uint32(32).int32(message.groupBy);
8915
8957
  }
8916
8958
  return writer;
8917
8959
  },
8918
8960
 
8919
- decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityRequest {
8961
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRateRequest {
8920
8962
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
8921
8963
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
8922
8964
  if (previousRecursionDepth >= 100) {
@@ -8925,7 +8967,7 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
8925
8967
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
8926
8968
  try {
8927
8969
  const end = length === undefined ? reader.len : reader.pos + length;
8928
- const message = createBaseDailyActivityRequest();
8970
+ const message = createBaseBurnRateRequest();
8929
8971
  while (reader.pos < end) {
8930
8972
  const tag = reader.uint32();
8931
8973
  switch (tag >>> 3) {
@@ -8950,15 +8992,15 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
8950
8992
  break;
8951
8993
  }
8952
8994
 
8953
- message.startDate = reader.string();
8995
+ message.filter = AISessionFilter.decode(reader, reader.uint32());
8954
8996
  continue;
8955
8997
  }
8956
8998
  case 4: {
8957
- if (tag !== 34) {
8999
+ if (tag !== 32) {
8958
9000
  break;
8959
9001
  }
8960
9002
 
8961
- message.endDate = reader.string();
9003
+ message.groupBy = reader.int32() as any;
8962
9004
  continue;
8963
9005
  }
8964
9006
  }
@@ -8973,7 +9015,7 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
8973
9015
  }
8974
9016
  },
8975
9017
 
8976
- fromJSON(object: any): DailyActivityRequest {
9018
+ fromJSON(object: any): BurnRateRequest {
8977
9019
  return {
8978
9020
  organizationId: isSet(object.organizationId)
8979
9021
  ? globalThis.String(object.organizationId)
@@ -8985,20 +9027,16 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
8985
9027
  : isSet(object.project_id)
8986
9028
  ? globalThis.String(object.project_id)
8987
9029
  : "",
8988
- startDate: isSet(object.startDate)
8989
- ? globalThis.String(object.startDate)
8990
- : isSet(object.start_date)
8991
- ? globalThis.String(object.start_date)
8992
- : "",
8993
- endDate: isSet(object.endDate)
8994
- ? globalThis.String(object.endDate)
8995
- : isSet(object.end_date)
8996
- ? globalThis.String(object.end_date)
8997
- : "",
9030
+ filter: isSet(object.filter) ? AISessionFilter.fromJSON(object.filter) : undefined,
9031
+ groupBy: isSet(object.groupBy)
9032
+ ? aITokenActivityDimensionFromJSON(object.groupBy)
9033
+ : isSet(object.group_by)
9034
+ ? aITokenActivityDimensionFromJSON(object.group_by)
9035
+ : 0,
8998
9036
  };
8999
9037
  },
9000
9038
 
9001
- toJSON(message: DailyActivityRequest): unknown {
9039
+ toJSON(message: BurnRateRequest): unknown {
9002
9040
  const obj: any = {};
9003
9041
  if (message.organizationId !== "") {
9004
9042
  obj.organizationId = message.organizationId;
@@ -9006,56 +9044,55 @@ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
9006
9044
  if (message.projectId !== "") {
9007
9045
  obj.projectId = message.projectId;
9008
9046
  }
9009
- if (message.startDate !== "") {
9010
- obj.startDate = message.startDate;
9047
+ if (message.filter !== undefined) {
9048
+ obj.filter = AISessionFilter.toJSON(message.filter);
9011
9049
  }
9012
- if (message.endDate !== "") {
9013
- obj.endDate = message.endDate;
9050
+ if (message.groupBy !== 0) {
9051
+ obj.groupBy = aITokenActivityDimensionToJSON(message.groupBy);
9014
9052
  }
9015
9053
  return obj;
9016
9054
  },
9017
9055
 
9018
- create<I extends Exact<DeepPartial<DailyActivityRequest>, I>>(base?: I): DailyActivityRequest {
9019
- return DailyActivityRequest.fromPartial(base ?? ({} as any));
9056
+ create<I extends Exact<DeepPartial<BurnRateRequest>, I>>(base?: I): BurnRateRequest {
9057
+ return BurnRateRequest.fromPartial(base ?? ({} as any));
9020
9058
  },
9021
- fromPartial<I extends Exact<DeepPartial<DailyActivityRequest>, I>>(object: I): DailyActivityRequest {
9022
- const message = createBaseDailyActivityRequest();
9059
+ fromPartial<I extends Exact<DeepPartial<BurnRateRequest>, I>>(object: I): BurnRateRequest {
9060
+ const message = createBaseBurnRateRequest();
9023
9061
  message.organizationId = object.organizationId ?? "";
9024
9062
  message.projectId = object.projectId ?? "";
9025
- message.startDate = object.startDate ?? "";
9026
- message.endDate = object.endDate ?? "";
9063
+ message.filter = (object.filter !== undefined && object.filter !== null)
9064
+ ? AISessionFilter.fromPartial(object.filter)
9065
+ : undefined;
9066
+ message.groupBy = object.groupBy ?? 0;
9027
9067
  return message;
9028
9068
  },
9029
9069
  };
9030
9070
 
9031
- function createBaseDailyActivity(): DailyActivity {
9032
- return { days: [], startDate: "", endDate: "", coverageStart: "", today: "", asOf: undefined };
9071
+ function createBaseBurnRate(): BurnRate {
9072
+ return { asOf: undefined, current: undefined, currentGroups: [], sparkline: [], groupBy: 0 };
9033
9073
  }
9034
9074
 
9035
- export const DailyActivity: MessageFns<DailyActivity> = {
9036
- encode(message: DailyActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9037
- for (const v of message.days) {
9038
- DailyActivityDay.encode(v!, writer.uint32(10).fork()).join();
9039
- }
9040
- if (message.startDate !== "") {
9041
- writer.uint32(18).string(message.startDate);
9075
+ export const BurnRate: MessageFns<BurnRate> = {
9076
+ encode(message: BurnRate, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9077
+ if (message.asOf !== undefined) {
9078
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(10).fork()).join();
9042
9079
  }
9043
- if (message.endDate !== "") {
9044
- writer.uint32(26).string(message.endDate);
9080
+ if (message.current !== undefined) {
9081
+ BurnRateMeasures.encode(message.current, writer.uint32(18).fork()).join();
9045
9082
  }
9046
- if (message.coverageStart !== "") {
9047
- writer.uint32(34).string(message.coverageStart);
9083
+ for (const v of message.currentGroups) {
9084
+ BurnRateGroup.encode(v!, writer.uint32(26).fork()).join();
9048
9085
  }
9049
- if (message.today !== "") {
9050
- writer.uint32(42).string(message.today);
9086
+ for (const v of message.sparkline) {
9087
+ BurnRateSparkPoint.encode(v!, writer.uint32(34).fork()).join();
9051
9088
  }
9052
- if (message.asOf !== undefined) {
9053
- Timestamp.encode(toTimestamp(message.asOf), writer.uint32(50).fork()).join();
9089
+ if (message.groupBy !== 0) {
9090
+ writer.uint32(40).int32(message.groupBy);
9054
9091
  }
9055
9092
  return writer;
9056
9093
  },
9057
9094
 
9058
- decode(input: BinaryReader | Uint8Array, length?: number): DailyActivity {
9095
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRate {
9059
9096
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9060
9097
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9061
9098
  if (previousRecursionDepth >= 100) {
@@ -9064,7 +9101,7 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9064
9101
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9065
9102
  try {
9066
9103
  const end = length === undefined ? reader.len : reader.pos + length;
9067
- const message = createBaseDailyActivity();
9104
+ const message = createBaseBurnRate();
9068
9105
  while (reader.pos < end) {
9069
9106
  const tag = reader.uint32();
9070
9107
  switch (tag >>> 3) {
@@ -9073,7 +9110,7 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9073
9110
  break;
9074
9111
  }
9075
9112
 
9076
- message.days.push(DailyActivityDay.decode(reader, reader.uint32()));
9113
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
9077
9114
  continue;
9078
9115
  }
9079
9116
  case 2: {
@@ -9081,7 +9118,7 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9081
9118
  break;
9082
9119
  }
9083
9120
 
9084
- message.startDate = reader.string();
9121
+ message.current = BurnRateMeasures.decode(reader, reader.uint32());
9085
9122
  continue;
9086
9123
  }
9087
9124
  case 3: {
@@ -9089,7 +9126,7 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9089
9126
  break;
9090
9127
  }
9091
9128
 
9092
- message.endDate = reader.string();
9129
+ message.currentGroups.push(BurnRateGroup.decode(reader, reader.uint32()));
9093
9130
  continue;
9094
9131
  }
9095
9132
  case 4: {
@@ -9097,23 +9134,15 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9097
9134
  break;
9098
9135
  }
9099
9136
 
9100
- message.coverageStart = reader.string();
9137
+ message.sparkline.push(BurnRateSparkPoint.decode(reader, reader.uint32()));
9101
9138
  continue;
9102
9139
  }
9103
9140
  case 5: {
9104
- if (tag !== 42) {
9105
- break;
9106
- }
9107
-
9108
- message.today = reader.string();
9109
- continue;
9110
- }
9111
- case 6: {
9112
- if (tag !== 50) {
9141
+ if (tag !== 40) {
9113
9142
  break;
9114
9143
  }
9115
9144
 
9116
- message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
9145
+ message.groupBy = reader.int32() as any;
9117
9146
  continue;
9118
9147
  }
9119
9148
  }
@@ -9128,90 +9157,82 @@ export const DailyActivity: MessageFns<DailyActivity> = {
9128
9157
  }
9129
9158
  },
9130
9159
 
9131
- fromJSON(object: any): DailyActivity {
9160
+ fromJSON(object: any): BurnRate {
9132
9161
  return {
9133
- days: globalThis.Array.isArray(object?.days) ? object.days.map((e: any) => DailyActivityDay.fromJSON(e)) : [],
9134
- startDate: isSet(object.startDate)
9135
- ? globalThis.String(object.startDate)
9136
- : isSet(object.start_date)
9137
- ? globalThis.String(object.start_date)
9138
- : "",
9139
- endDate: isSet(object.endDate)
9140
- ? globalThis.String(object.endDate)
9141
- : isSet(object.end_date)
9142
- ? globalThis.String(object.end_date)
9143
- : "",
9144
- coverageStart: isSet(object.coverageStart)
9145
- ? globalThis.String(object.coverageStart)
9146
- : isSet(object.coverage_start)
9147
- ? globalThis.String(object.coverage_start)
9148
- : "",
9149
- today: isSet(object.today) ? globalThis.String(object.today) : "",
9150
9162
  asOf: isSet(object.asOf)
9151
9163
  ? fromJsonTimestamp(object.asOf)
9152
9164
  : isSet(object.as_of)
9153
9165
  ? fromJsonTimestamp(object.as_of)
9154
9166
  : undefined,
9167
+ current: isSet(object.current) ? BurnRateMeasures.fromJSON(object.current) : undefined,
9168
+ currentGroups: globalThis.Array.isArray(object?.currentGroups)
9169
+ ? object.currentGroups.map((e: any) => BurnRateGroup.fromJSON(e))
9170
+ : globalThis.Array.isArray(object?.current_groups)
9171
+ ? object.current_groups.map((e: any) => BurnRateGroup.fromJSON(e))
9172
+ : [],
9173
+ sparkline: globalThis.Array.isArray(object?.sparkline)
9174
+ ? object.sparkline.map((e: any) => BurnRateSparkPoint.fromJSON(e))
9175
+ : [],
9176
+ groupBy: isSet(object.groupBy)
9177
+ ? aITokenActivityDimensionFromJSON(object.groupBy)
9178
+ : isSet(object.group_by)
9179
+ ? aITokenActivityDimensionFromJSON(object.group_by)
9180
+ : 0,
9155
9181
  };
9156
9182
  },
9157
9183
 
9158
- toJSON(message: DailyActivity): unknown {
9184
+ toJSON(message: BurnRate): unknown {
9159
9185
  const obj: any = {};
9160
- if (message.days?.length) {
9161
- obj.days = message.days.map((e) => DailyActivityDay.toJSON(e));
9162
- }
9163
- if (message.startDate !== "") {
9164
- obj.startDate = message.startDate;
9186
+ if (message.asOf !== undefined) {
9187
+ obj.asOf = message.asOf.toISOString();
9165
9188
  }
9166
- if (message.endDate !== "") {
9167
- obj.endDate = message.endDate;
9189
+ if (message.current !== undefined) {
9190
+ obj.current = BurnRateMeasures.toJSON(message.current);
9168
9191
  }
9169
- if (message.coverageStart !== "") {
9170
- obj.coverageStart = message.coverageStart;
9192
+ if (message.currentGroups?.length) {
9193
+ obj.currentGroups = message.currentGroups.map((e) => BurnRateGroup.toJSON(e));
9171
9194
  }
9172
- if (message.today !== "") {
9173
- obj.today = message.today;
9195
+ if (message.sparkline?.length) {
9196
+ obj.sparkline = message.sparkline.map((e) => BurnRateSparkPoint.toJSON(e));
9174
9197
  }
9175
- if (message.asOf !== undefined) {
9176
- obj.asOf = message.asOf.toISOString();
9198
+ if (message.groupBy !== 0) {
9199
+ obj.groupBy = aITokenActivityDimensionToJSON(message.groupBy);
9177
9200
  }
9178
9201
  return obj;
9179
9202
  },
9180
9203
 
9181
- create<I extends Exact<DeepPartial<DailyActivity>, I>>(base?: I): DailyActivity {
9182
- return DailyActivity.fromPartial(base ?? ({} as any));
9204
+ create<I extends Exact<DeepPartial<BurnRate>, I>>(base?: I): BurnRate {
9205
+ return BurnRate.fromPartial(base ?? ({} as any));
9183
9206
  },
9184
- fromPartial<I extends Exact<DeepPartial<DailyActivity>, I>>(object: I): DailyActivity {
9185
- const message = createBaseDailyActivity();
9186
- message.days = object.days?.map((e) => DailyActivityDay.fromPartial(e)) || [];
9187
- message.startDate = object.startDate ?? "";
9188
- message.endDate = object.endDate ?? "";
9189
- message.coverageStart = object.coverageStart ?? "";
9190
- message.today = object.today ?? "";
9207
+ fromPartial<I extends Exact<DeepPartial<BurnRate>, I>>(object: I): BurnRate {
9208
+ const message = createBaseBurnRate();
9191
9209
  message.asOf = object.asOf ?? undefined;
9210
+ message.current = (object.current !== undefined && object.current !== null)
9211
+ ? BurnRateMeasures.fromPartial(object.current)
9212
+ : undefined;
9213
+ message.currentGroups = object.currentGroups?.map((e) => BurnRateGroup.fromPartial(e)) || [];
9214
+ message.sparkline = object.sparkline?.map((e) => BurnRateSparkPoint.fromPartial(e)) || [];
9215
+ message.groupBy = object.groupBy ?? 0;
9192
9216
  return message;
9193
9217
  },
9194
9218
  };
9195
9219
 
9196
- function createBaseDailyActivityDay(): DailyActivityDay {
9197
- return { day: "", measures: undefined, provisional: false };
9220
+ function createBaseBurnRateGroup(): BurnRateGroup {
9221
+ return { key: "", rate: undefined };
9198
9222
  }
9199
9223
 
9200
- export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9201
- encode(message: DailyActivityDay, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9202
- if (message.day !== "") {
9203
- writer.uint32(10).string(message.day);
9204
- }
9205
- if (message.measures !== undefined) {
9206
- DailyActivityMeasures.encode(message.measures, writer.uint32(18).fork()).join();
9224
+ export const BurnRateGroup: MessageFns<BurnRateGroup> = {
9225
+ encode(message: BurnRateGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9226
+ if (message.key !== "") {
9227
+ writer.uint32(10).string(message.key);
9207
9228
  }
9208
- if (message.provisional !== false) {
9209
- writer.uint32(24).bool(message.provisional);
9229
+ if (message.rate !== undefined) {
9230
+ BurnRateMeasures.encode(message.rate, writer.uint32(18).fork()).join();
9210
9231
  }
9211
9232
  return writer;
9212
9233
  },
9213
9234
 
9214
- decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityDay {
9235
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRateGroup {
9215
9236
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9216
9237
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9217
9238
  if (previousRecursionDepth >= 100) {
@@ -9220,7 +9241,7 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9220
9241
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9221
9242
  try {
9222
9243
  const end = length === undefined ? reader.len : reader.pos + length;
9223
- const message = createBaseDailyActivityDay();
9244
+ const message = createBaseBurnRateGroup();
9224
9245
  while (reader.pos < end) {
9225
9246
  const tag = reader.uint32();
9226
9247
  switch (tag >>> 3) {
@@ -9229,7 +9250,7 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9229
9250
  break;
9230
9251
  }
9231
9252
 
9232
- message.day = reader.string();
9253
+ message.key = reader.string();
9233
9254
  continue;
9234
9255
  }
9235
9256
  case 2: {
@@ -9237,15 +9258,7 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9237
9258
  break;
9238
9259
  }
9239
9260
 
9240
- message.measures = DailyActivityMeasures.decode(reader, reader.uint32());
9241
- continue;
9242
- }
9243
- case 3: {
9244
- if (tag !== 24) {
9245
- break;
9246
- }
9247
-
9248
- message.provisional = reader.bool();
9261
+ message.rate = BurnRateMeasures.decode(reader, reader.uint32());
9249
9262
  continue;
9250
9263
  }
9251
9264
  }
@@ -9260,76 +9273,716 @@ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9260
9273
  }
9261
9274
  },
9262
9275
 
9263
- fromJSON(object: any): DailyActivityDay {
9276
+ fromJSON(object: any): BurnRateGroup {
9264
9277
  return {
9265
- day: isSet(object.day) ? globalThis.String(object.day) : "",
9266
- measures: isSet(object.measures) ? DailyActivityMeasures.fromJSON(object.measures) : undefined,
9267
- provisional: isSet(object.provisional) ? globalThis.Boolean(object.provisional) : false,
9278
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
9279
+ rate: isSet(object.rate) ? BurnRateMeasures.fromJSON(object.rate) : undefined,
9268
9280
  };
9269
9281
  },
9270
9282
 
9271
- toJSON(message: DailyActivityDay): unknown {
9283
+ toJSON(message: BurnRateGroup): unknown {
9272
9284
  const obj: any = {};
9273
- if (message.day !== "") {
9274
- obj.day = message.day;
9275
- }
9276
- if (message.measures !== undefined) {
9277
- obj.measures = DailyActivityMeasures.toJSON(message.measures);
9285
+ if (message.key !== "") {
9286
+ obj.key = message.key;
9278
9287
  }
9279
- if (message.provisional !== false) {
9280
- obj.provisional = message.provisional;
9288
+ if (message.rate !== undefined) {
9289
+ obj.rate = BurnRateMeasures.toJSON(message.rate);
9281
9290
  }
9282
9291
  return obj;
9283
9292
  },
9284
9293
 
9285
- create<I extends Exact<DeepPartial<DailyActivityDay>, I>>(base?: I): DailyActivityDay {
9286
- return DailyActivityDay.fromPartial(base ?? ({} as any));
9294
+ create<I extends Exact<DeepPartial<BurnRateGroup>, I>>(base?: I): BurnRateGroup {
9295
+ return BurnRateGroup.fromPartial(base ?? ({} as any));
9287
9296
  },
9288
- fromPartial<I extends Exact<DeepPartial<DailyActivityDay>, I>>(object: I): DailyActivityDay {
9289
- const message = createBaseDailyActivityDay();
9290
- message.day = object.day ?? "";
9291
- message.measures = (object.measures !== undefined && object.measures !== null)
9292
- ? DailyActivityMeasures.fromPartial(object.measures)
9297
+ fromPartial<I extends Exact<DeepPartial<BurnRateGroup>, I>>(object: I): BurnRateGroup {
9298
+ const message = createBaseBurnRateGroup();
9299
+ message.key = object.key ?? "";
9300
+ message.rate = (object.rate !== undefined && object.rate !== null)
9301
+ ? BurnRateMeasures.fromPartial(object.rate)
9293
9302
  : undefined;
9294
- message.provisional = object.provisional ?? false;
9295
9303
  return message;
9296
9304
  },
9297
9305
  };
9298
9306
 
9299
- function createBaseDailyActivityMeasures(): DailyActivityMeasures {
9300
- return {
9301
- inputTokens: 0,
9302
- outputTokens: 0,
9303
- cacheReadTokens: 0,
9304
- cacheWriteTokens: 0,
9305
- costUsd: 0,
9306
- modelCalls: 0,
9307
- toolCalls: 0,
9308
- userMessages: 0,
9309
- filesTouched: 0,
9310
- commits: 0,
9311
- gitPushes: 0,
9312
- pullRequestsCreated: 0,
9313
- pullRequestsMerged: 0,
9314
- branchesCreated: 0,
9315
- };
9307
+ function createBaseBurnRateSparkPoint(): BurnRateSparkPoint {
9308
+ return { bucketStart: undefined, rate: undefined };
9316
9309
  }
9317
9310
 
9318
- export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
9319
- encode(message: DailyActivityMeasures, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9320
- if (message.inputTokens !== 0) {
9321
- writer.uint32(8).uint64(message.inputTokens);
9322
- }
9323
- if (message.outputTokens !== 0) {
9324
- writer.uint32(16).uint64(message.outputTokens);
9325
- }
9326
- if (message.cacheReadTokens !== 0) {
9327
- writer.uint32(24).uint64(message.cacheReadTokens);
9311
+ export const BurnRateSparkPoint: MessageFns<BurnRateSparkPoint> = {
9312
+ encode(message: BurnRateSparkPoint, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9313
+ if (message.bucketStart !== undefined) {
9314
+ Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
9328
9315
  }
9329
- if (message.cacheWriteTokens !== 0) {
9330
- writer.uint32(32).uint64(message.cacheWriteTokens);
9316
+ if (message.rate !== undefined) {
9317
+ BurnRateMeasures.encode(message.rate, writer.uint32(18).fork()).join();
9331
9318
  }
9332
- if (message.costUsd !== 0) {
9319
+ return writer;
9320
+ },
9321
+
9322
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRateSparkPoint {
9323
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9324
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9325
+ if (previousRecursionDepth >= 100) {
9326
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9327
+ }
9328
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9329
+ try {
9330
+ const end = length === undefined ? reader.len : reader.pos + length;
9331
+ const message = createBaseBurnRateSparkPoint();
9332
+ while (reader.pos < end) {
9333
+ const tag = reader.uint32();
9334
+ switch (tag >>> 3) {
9335
+ case 1: {
9336
+ if (tag !== 10) {
9337
+ break;
9338
+ }
9339
+
9340
+ message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
9341
+ continue;
9342
+ }
9343
+ case 2: {
9344
+ if (tag !== 18) {
9345
+ break;
9346
+ }
9347
+
9348
+ message.rate = BurnRateMeasures.decode(reader, reader.uint32());
9349
+ continue;
9350
+ }
9351
+ }
9352
+ if ((tag & 7) === 4 || tag === 0) {
9353
+ break;
9354
+ }
9355
+ reader.skip(tag & 7);
9356
+ }
9357
+ return message;
9358
+ } finally {
9359
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9360
+ }
9361
+ },
9362
+
9363
+ fromJSON(object: any): BurnRateSparkPoint {
9364
+ return {
9365
+ bucketStart: isSet(object.bucketStart)
9366
+ ? fromJsonTimestamp(object.bucketStart)
9367
+ : isSet(object.bucket_start)
9368
+ ? fromJsonTimestamp(object.bucket_start)
9369
+ : undefined,
9370
+ rate: isSet(object.rate) ? BurnRateMeasures.fromJSON(object.rate) : undefined,
9371
+ };
9372
+ },
9373
+
9374
+ toJSON(message: BurnRateSparkPoint): unknown {
9375
+ const obj: any = {};
9376
+ if (message.bucketStart !== undefined) {
9377
+ obj.bucketStart = message.bucketStart.toISOString();
9378
+ }
9379
+ if (message.rate !== undefined) {
9380
+ obj.rate = BurnRateMeasures.toJSON(message.rate);
9381
+ }
9382
+ return obj;
9383
+ },
9384
+
9385
+ create<I extends Exact<DeepPartial<BurnRateSparkPoint>, I>>(base?: I): BurnRateSparkPoint {
9386
+ return BurnRateSparkPoint.fromPartial(base ?? ({} as any));
9387
+ },
9388
+ fromPartial<I extends Exact<DeepPartial<BurnRateSparkPoint>, I>>(object: I): BurnRateSparkPoint {
9389
+ const message = createBaseBurnRateSparkPoint();
9390
+ message.bucketStart = object.bucketStart ?? undefined;
9391
+ message.rate = (object.rate !== undefined && object.rate !== null)
9392
+ ? BurnRateMeasures.fromPartial(object.rate)
9393
+ : undefined;
9394
+ return message;
9395
+ },
9396
+ };
9397
+
9398
+ function createBaseBurnRateMeasures(): BurnRateMeasures {
9399
+ return { usdPerHour: 0, tokensPerMin: 0, modelCalls: 0, costUnavailableCount: 0, usageUnavailableCount: 0 };
9400
+ }
9401
+
9402
+ export const BurnRateMeasures: MessageFns<BurnRateMeasures> = {
9403
+ encode(message: BurnRateMeasures, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9404
+ if (message.usdPerHour !== 0) {
9405
+ writer.uint32(9).double(message.usdPerHour);
9406
+ }
9407
+ if (message.tokensPerMin !== 0) {
9408
+ writer.uint32(17).double(message.tokensPerMin);
9409
+ }
9410
+ if (message.modelCalls !== 0) {
9411
+ writer.uint32(24).uint64(message.modelCalls);
9412
+ }
9413
+ if (message.costUnavailableCount !== 0) {
9414
+ writer.uint32(32).uint64(message.costUnavailableCount);
9415
+ }
9416
+ if (message.usageUnavailableCount !== 0) {
9417
+ writer.uint32(40).uint64(message.usageUnavailableCount);
9418
+ }
9419
+ return writer;
9420
+ },
9421
+
9422
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRateMeasures {
9423
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9424
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9425
+ if (previousRecursionDepth >= 100) {
9426
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9427
+ }
9428
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9429
+ try {
9430
+ const end = length === undefined ? reader.len : reader.pos + length;
9431
+ const message = createBaseBurnRateMeasures();
9432
+ while (reader.pos < end) {
9433
+ const tag = reader.uint32();
9434
+ switch (tag >>> 3) {
9435
+ case 1: {
9436
+ if (tag !== 9) {
9437
+ break;
9438
+ }
9439
+
9440
+ message.usdPerHour = reader.double();
9441
+ continue;
9442
+ }
9443
+ case 2: {
9444
+ if (tag !== 17) {
9445
+ break;
9446
+ }
9447
+
9448
+ message.tokensPerMin = reader.double();
9449
+ continue;
9450
+ }
9451
+ case 3: {
9452
+ if (tag !== 24) {
9453
+ break;
9454
+ }
9455
+
9456
+ message.modelCalls = longToNumber(reader.uint64());
9457
+ continue;
9458
+ }
9459
+ case 4: {
9460
+ if (tag !== 32) {
9461
+ break;
9462
+ }
9463
+
9464
+ message.costUnavailableCount = longToNumber(reader.uint64());
9465
+ continue;
9466
+ }
9467
+ case 5: {
9468
+ if (tag !== 40) {
9469
+ break;
9470
+ }
9471
+
9472
+ message.usageUnavailableCount = longToNumber(reader.uint64());
9473
+ continue;
9474
+ }
9475
+ }
9476
+ if ((tag & 7) === 4 || tag === 0) {
9477
+ break;
9478
+ }
9479
+ reader.skip(tag & 7);
9480
+ }
9481
+ return message;
9482
+ } finally {
9483
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9484
+ }
9485
+ },
9486
+
9487
+ fromJSON(object: any): BurnRateMeasures {
9488
+ return {
9489
+ usdPerHour: isSet(object.usdPerHour)
9490
+ ? globalThis.Number(object.usdPerHour)
9491
+ : isSet(object.usd_per_hour)
9492
+ ? globalThis.Number(object.usd_per_hour)
9493
+ : 0,
9494
+ tokensPerMin: isSet(object.tokensPerMin)
9495
+ ? globalThis.Number(object.tokensPerMin)
9496
+ : isSet(object.tokens_per_min)
9497
+ ? globalThis.Number(object.tokens_per_min)
9498
+ : 0,
9499
+ modelCalls: isSet(object.modelCalls)
9500
+ ? globalThis.Number(object.modelCalls)
9501
+ : isSet(object.model_calls)
9502
+ ? globalThis.Number(object.model_calls)
9503
+ : 0,
9504
+ costUnavailableCount: isSet(object.costUnavailableCount)
9505
+ ? globalThis.Number(object.costUnavailableCount)
9506
+ : isSet(object.cost_unavailable_count)
9507
+ ? globalThis.Number(object.cost_unavailable_count)
9508
+ : 0,
9509
+ usageUnavailableCount: isSet(object.usageUnavailableCount)
9510
+ ? globalThis.Number(object.usageUnavailableCount)
9511
+ : isSet(object.usage_unavailable_count)
9512
+ ? globalThis.Number(object.usage_unavailable_count)
9513
+ : 0,
9514
+ };
9515
+ },
9516
+
9517
+ toJSON(message: BurnRateMeasures): unknown {
9518
+ const obj: any = {};
9519
+ if (message.usdPerHour !== 0) {
9520
+ obj.usdPerHour = message.usdPerHour;
9521
+ }
9522
+ if (message.tokensPerMin !== 0) {
9523
+ obj.tokensPerMin = message.tokensPerMin;
9524
+ }
9525
+ if (message.modelCalls !== 0) {
9526
+ obj.modelCalls = Math.round(message.modelCalls);
9527
+ }
9528
+ if (message.costUnavailableCount !== 0) {
9529
+ obj.costUnavailableCount = Math.round(message.costUnavailableCount);
9530
+ }
9531
+ if (message.usageUnavailableCount !== 0) {
9532
+ obj.usageUnavailableCount = Math.round(message.usageUnavailableCount);
9533
+ }
9534
+ return obj;
9535
+ },
9536
+
9537
+ create<I extends Exact<DeepPartial<BurnRateMeasures>, I>>(base?: I): BurnRateMeasures {
9538
+ return BurnRateMeasures.fromPartial(base ?? ({} as any));
9539
+ },
9540
+ fromPartial<I extends Exact<DeepPartial<BurnRateMeasures>, I>>(object: I): BurnRateMeasures {
9541
+ const message = createBaseBurnRateMeasures();
9542
+ message.usdPerHour = object.usdPerHour ?? 0;
9543
+ message.tokensPerMin = object.tokensPerMin ?? 0;
9544
+ message.modelCalls = object.modelCalls ?? 0;
9545
+ message.costUnavailableCount = object.costUnavailableCount ?? 0;
9546
+ message.usageUnavailableCount = object.usageUnavailableCount ?? 0;
9547
+ return message;
9548
+ },
9549
+ };
9550
+
9551
+ function createBaseDailyActivityRequest(): DailyActivityRequest {
9552
+ return { organizationId: "", projectId: "", startDate: "", endDate: "" };
9553
+ }
9554
+
9555
+ export const DailyActivityRequest: MessageFns<DailyActivityRequest> = {
9556
+ encode(message: DailyActivityRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9557
+ if (message.organizationId !== "") {
9558
+ writer.uint32(10).string(message.organizationId);
9559
+ }
9560
+ if (message.projectId !== "") {
9561
+ writer.uint32(18).string(message.projectId);
9562
+ }
9563
+ if (message.startDate !== "") {
9564
+ writer.uint32(26).string(message.startDate);
9565
+ }
9566
+ if (message.endDate !== "") {
9567
+ writer.uint32(34).string(message.endDate);
9568
+ }
9569
+ return writer;
9570
+ },
9571
+
9572
+ decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityRequest {
9573
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9574
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9575
+ if (previousRecursionDepth >= 100) {
9576
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9577
+ }
9578
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9579
+ try {
9580
+ const end = length === undefined ? reader.len : reader.pos + length;
9581
+ const message = createBaseDailyActivityRequest();
9582
+ while (reader.pos < end) {
9583
+ const tag = reader.uint32();
9584
+ switch (tag >>> 3) {
9585
+ case 1: {
9586
+ if (tag !== 10) {
9587
+ break;
9588
+ }
9589
+
9590
+ message.organizationId = reader.string();
9591
+ continue;
9592
+ }
9593
+ case 2: {
9594
+ if (tag !== 18) {
9595
+ break;
9596
+ }
9597
+
9598
+ message.projectId = reader.string();
9599
+ continue;
9600
+ }
9601
+ case 3: {
9602
+ if (tag !== 26) {
9603
+ break;
9604
+ }
9605
+
9606
+ message.startDate = reader.string();
9607
+ continue;
9608
+ }
9609
+ case 4: {
9610
+ if (tag !== 34) {
9611
+ break;
9612
+ }
9613
+
9614
+ message.endDate = reader.string();
9615
+ continue;
9616
+ }
9617
+ }
9618
+ if ((tag & 7) === 4 || tag === 0) {
9619
+ break;
9620
+ }
9621
+ reader.skip(tag & 7);
9622
+ }
9623
+ return message;
9624
+ } finally {
9625
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9626
+ }
9627
+ },
9628
+
9629
+ fromJSON(object: any): DailyActivityRequest {
9630
+ return {
9631
+ organizationId: isSet(object.organizationId)
9632
+ ? globalThis.String(object.organizationId)
9633
+ : isSet(object.organization_id)
9634
+ ? globalThis.String(object.organization_id)
9635
+ : "",
9636
+ projectId: isSet(object.projectId)
9637
+ ? globalThis.String(object.projectId)
9638
+ : isSet(object.project_id)
9639
+ ? globalThis.String(object.project_id)
9640
+ : "",
9641
+ startDate: isSet(object.startDate)
9642
+ ? globalThis.String(object.startDate)
9643
+ : isSet(object.start_date)
9644
+ ? globalThis.String(object.start_date)
9645
+ : "",
9646
+ endDate: isSet(object.endDate)
9647
+ ? globalThis.String(object.endDate)
9648
+ : isSet(object.end_date)
9649
+ ? globalThis.String(object.end_date)
9650
+ : "",
9651
+ };
9652
+ },
9653
+
9654
+ toJSON(message: DailyActivityRequest): unknown {
9655
+ const obj: any = {};
9656
+ if (message.organizationId !== "") {
9657
+ obj.organizationId = message.organizationId;
9658
+ }
9659
+ if (message.projectId !== "") {
9660
+ obj.projectId = message.projectId;
9661
+ }
9662
+ if (message.startDate !== "") {
9663
+ obj.startDate = message.startDate;
9664
+ }
9665
+ if (message.endDate !== "") {
9666
+ obj.endDate = message.endDate;
9667
+ }
9668
+ return obj;
9669
+ },
9670
+
9671
+ create<I extends Exact<DeepPartial<DailyActivityRequest>, I>>(base?: I): DailyActivityRequest {
9672
+ return DailyActivityRequest.fromPartial(base ?? ({} as any));
9673
+ },
9674
+ fromPartial<I extends Exact<DeepPartial<DailyActivityRequest>, I>>(object: I): DailyActivityRequest {
9675
+ const message = createBaseDailyActivityRequest();
9676
+ message.organizationId = object.organizationId ?? "";
9677
+ message.projectId = object.projectId ?? "";
9678
+ message.startDate = object.startDate ?? "";
9679
+ message.endDate = object.endDate ?? "";
9680
+ return message;
9681
+ },
9682
+ };
9683
+
9684
+ function createBaseDailyActivity(): DailyActivity {
9685
+ return { days: [], startDate: "", endDate: "", coverageStart: "", today: "", asOf: undefined };
9686
+ }
9687
+
9688
+ export const DailyActivity: MessageFns<DailyActivity> = {
9689
+ encode(message: DailyActivity, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9690
+ for (const v of message.days) {
9691
+ DailyActivityDay.encode(v!, writer.uint32(10).fork()).join();
9692
+ }
9693
+ if (message.startDate !== "") {
9694
+ writer.uint32(18).string(message.startDate);
9695
+ }
9696
+ if (message.endDate !== "") {
9697
+ writer.uint32(26).string(message.endDate);
9698
+ }
9699
+ if (message.coverageStart !== "") {
9700
+ writer.uint32(34).string(message.coverageStart);
9701
+ }
9702
+ if (message.today !== "") {
9703
+ writer.uint32(42).string(message.today);
9704
+ }
9705
+ if (message.asOf !== undefined) {
9706
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(50).fork()).join();
9707
+ }
9708
+ return writer;
9709
+ },
9710
+
9711
+ decode(input: BinaryReader | Uint8Array, length?: number): DailyActivity {
9712
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9713
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9714
+ if (previousRecursionDepth >= 100) {
9715
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9716
+ }
9717
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9718
+ try {
9719
+ const end = length === undefined ? reader.len : reader.pos + length;
9720
+ const message = createBaseDailyActivity();
9721
+ while (reader.pos < end) {
9722
+ const tag = reader.uint32();
9723
+ switch (tag >>> 3) {
9724
+ case 1: {
9725
+ if (tag !== 10) {
9726
+ break;
9727
+ }
9728
+
9729
+ message.days.push(DailyActivityDay.decode(reader, reader.uint32()));
9730
+ continue;
9731
+ }
9732
+ case 2: {
9733
+ if (tag !== 18) {
9734
+ break;
9735
+ }
9736
+
9737
+ message.startDate = reader.string();
9738
+ continue;
9739
+ }
9740
+ case 3: {
9741
+ if (tag !== 26) {
9742
+ break;
9743
+ }
9744
+
9745
+ message.endDate = reader.string();
9746
+ continue;
9747
+ }
9748
+ case 4: {
9749
+ if (tag !== 34) {
9750
+ break;
9751
+ }
9752
+
9753
+ message.coverageStart = reader.string();
9754
+ continue;
9755
+ }
9756
+ case 5: {
9757
+ if (tag !== 42) {
9758
+ break;
9759
+ }
9760
+
9761
+ message.today = reader.string();
9762
+ continue;
9763
+ }
9764
+ case 6: {
9765
+ if (tag !== 50) {
9766
+ break;
9767
+ }
9768
+
9769
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
9770
+ continue;
9771
+ }
9772
+ }
9773
+ if ((tag & 7) === 4 || tag === 0) {
9774
+ break;
9775
+ }
9776
+ reader.skip(tag & 7);
9777
+ }
9778
+ return message;
9779
+ } finally {
9780
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9781
+ }
9782
+ },
9783
+
9784
+ fromJSON(object: any): DailyActivity {
9785
+ return {
9786
+ days: globalThis.Array.isArray(object?.days) ? object.days.map((e: any) => DailyActivityDay.fromJSON(e)) : [],
9787
+ startDate: isSet(object.startDate)
9788
+ ? globalThis.String(object.startDate)
9789
+ : isSet(object.start_date)
9790
+ ? globalThis.String(object.start_date)
9791
+ : "",
9792
+ endDate: isSet(object.endDate)
9793
+ ? globalThis.String(object.endDate)
9794
+ : isSet(object.end_date)
9795
+ ? globalThis.String(object.end_date)
9796
+ : "",
9797
+ coverageStart: isSet(object.coverageStart)
9798
+ ? globalThis.String(object.coverageStart)
9799
+ : isSet(object.coverage_start)
9800
+ ? globalThis.String(object.coverage_start)
9801
+ : "",
9802
+ today: isSet(object.today) ? globalThis.String(object.today) : "",
9803
+ asOf: isSet(object.asOf)
9804
+ ? fromJsonTimestamp(object.asOf)
9805
+ : isSet(object.as_of)
9806
+ ? fromJsonTimestamp(object.as_of)
9807
+ : undefined,
9808
+ };
9809
+ },
9810
+
9811
+ toJSON(message: DailyActivity): unknown {
9812
+ const obj: any = {};
9813
+ if (message.days?.length) {
9814
+ obj.days = message.days.map((e) => DailyActivityDay.toJSON(e));
9815
+ }
9816
+ if (message.startDate !== "") {
9817
+ obj.startDate = message.startDate;
9818
+ }
9819
+ if (message.endDate !== "") {
9820
+ obj.endDate = message.endDate;
9821
+ }
9822
+ if (message.coverageStart !== "") {
9823
+ obj.coverageStart = message.coverageStart;
9824
+ }
9825
+ if (message.today !== "") {
9826
+ obj.today = message.today;
9827
+ }
9828
+ if (message.asOf !== undefined) {
9829
+ obj.asOf = message.asOf.toISOString();
9830
+ }
9831
+ return obj;
9832
+ },
9833
+
9834
+ create<I extends Exact<DeepPartial<DailyActivity>, I>>(base?: I): DailyActivity {
9835
+ return DailyActivity.fromPartial(base ?? ({} as any));
9836
+ },
9837
+ fromPartial<I extends Exact<DeepPartial<DailyActivity>, I>>(object: I): DailyActivity {
9838
+ const message = createBaseDailyActivity();
9839
+ message.days = object.days?.map((e) => DailyActivityDay.fromPartial(e)) || [];
9840
+ message.startDate = object.startDate ?? "";
9841
+ message.endDate = object.endDate ?? "";
9842
+ message.coverageStart = object.coverageStart ?? "";
9843
+ message.today = object.today ?? "";
9844
+ message.asOf = object.asOf ?? undefined;
9845
+ return message;
9846
+ },
9847
+ };
9848
+
9849
+ function createBaseDailyActivityDay(): DailyActivityDay {
9850
+ return { day: "", measures: undefined, provisional: false };
9851
+ }
9852
+
9853
+ export const DailyActivityDay: MessageFns<DailyActivityDay> = {
9854
+ encode(message: DailyActivityDay, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9855
+ if (message.day !== "") {
9856
+ writer.uint32(10).string(message.day);
9857
+ }
9858
+ if (message.measures !== undefined) {
9859
+ DailyActivityMeasures.encode(message.measures, writer.uint32(18).fork()).join();
9860
+ }
9861
+ if (message.provisional !== false) {
9862
+ writer.uint32(24).bool(message.provisional);
9863
+ }
9864
+ return writer;
9865
+ },
9866
+
9867
+ decode(input: BinaryReader | Uint8Array, length?: number): DailyActivityDay {
9868
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9869
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9870
+ if (previousRecursionDepth >= 100) {
9871
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9872
+ }
9873
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9874
+ try {
9875
+ const end = length === undefined ? reader.len : reader.pos + length;
9876
+ const message = createBaseDailyActivityDay();
9877
+ while (reader.pos < end) {
9878
+ const tag = reader.uint32();
9879
+ switch (tag >>> 3) {
9880
+ case 1: {
9881
+ if (tag !== 10) {
9882
+ break;
9883
+ }
9884
+
9885
+ message.day = reader.string();
9886
+ continue;
9887
+ }
9888
+ case 2: {
9889
+ if (tag !== 18) {
9890
+ break;
9891
+ }
9892
+
9893
+ message.measures = DailyActivityMeasures.decode(reader, reader.uint32());
9894
+ continue;
9895
+ }
9896
+ case 3: {
9897
+ if (tag !== 24) {
9898
+ break;
9899
+ }
9900
+
9901
+ message.provisional = reader.bool();
9902
+ continue;
9903
+ }
9904
+ }
9905
+ if ((tag & 7) === 4 || tag === 0) {
9906
+ break;
9907
+ }
9908
+ reader.skip(tag & 7);
9909
+ }
9910
+ return message;
9911
+ } finally {
9912
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9913
+ }
9914
+ },
9915
+
9916
+ fromJSON(object: any): DailyActivityDay {
9917
+ return {
9918
+ day: isSet(object.day) ? globalThis.String(object.day) : "",
9919
+ measures: isSet(object.measures) ? DailyActivityMeasures.fromJSON(object.measures) : undefined,
9920
+ provisional: isSet(object.provisional) ? globalThis.Boolean(object.provisional) : false,
9921
+ };
9922
+ },
9923
+
9924
+ toJSON(message: DailyActivityDay): unknown {
9925
+ const obj: any = {};
9926
+ if (message.day !== "") {
9927
+ obj.day = message.day;
9928
+ }
9929
+ if (message.measures !== undefined) {
9930
+ obj.measures = DailyActivityMeasures.toJSON(message.measures);
9931
+ }
9932
+ if (message.provisional !== false) {
9933
+ obj.provisional = message.provisional;
9934
+ }
9935
+ return obj;
9936
+ },
9937
+
9938
+ create<I extends Exact<DeepPartial<DailyActivityDay>, I>>(base?: I): DailyActivityDay {
9939
+ return DailyActivityDay.fromPartial(base ?? ({} as any));
9940
+ },
9941
+ fromPartial<I extends Exact<DeepPartial<DailyActivityDay>, I>>(object: I): DailyActivityDay {
9942
+ const message = createBaseDailyActivityDay();
9943
+ message.day = object.day ?? "";
9944
+ message.measures = (object.measures !== undefined && object.measures !== null)
9945
+ ? DailyActivityMeasures.fromPartial(object.measures)
9946
+ : undefined;
9947
+ message.provisional = object.provisional ?? false;
9948
+ return message;
9949
+ },
9950
+ };
9951
+
9952
+ function createBaseDailyActivityMeasures(): DailyActivityMeasures {
9953
+ return {
9954
+ inputTokens: 0,
9955
+ outputTokens: 0,
9956
+ cacheReadTokens: 0,
9957
+ cacheWriteTokens: 0,
9958
+ costUsd: 0,
9959
+ modelCalls: 0,
9960
+ toolCalls: 0,
9961
+ userMessages: 0,
9962
+ filesTouched: 0,
9963
+ commits: 0,
9964
+ gitPushes: 0,
9965
+ pullRequestsCreated: 0,
9966
+ pullRequestsMerged: 0,
9967
+ branchesCreated: 0,
9968
+ };
9969
+ }
9970
+
9971
+ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
9972
+ encode(message: DailyActivityMeasures, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9973
+ if (message.inputTokens !== 0) {
9974
+ writer.uint32(8).uint64(message.inputTokens);
9975
+ }
9976
+ if (message.outputTokens !== 0) {
9977
+ writer.uint32(16).uint64(message.outputTokens);
9978
+ }
9979
+ if (message.cacheReadTokens !== 0) {
9980
+ writer.uint32(24).uint64(message.cacheReadTokens);
9981
+ }
9982
+ if (message.cacheWriteTokens !== 0) {
9983
+ writer.uint32(32).uint64(message.cacheWriteTokens);
9984
+ }
9985
+ if (message.costUsd !== 0) {
9333
9986
  writer.uint32(41).double(message.costUsd);
9334
9987
  }
9335
9988
  if (message.modelCalls !== 0) {
@@ -14346,6 +14999,12 @@ export interface AIGatewayService {
14346
14999
  request: TokenActivitySummaryRequest,
14347
15000
  metadata?: Metadata,
14348
15001
  ): Observable<TokenActivitySummary>;
15002
+ /**
15003
+ * Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
15004
+ * breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
15005
+ * refresh; first frame is a full snapshot.
15006
+ */
15007
+ StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
14349
15008
  /**
14350
15009
  * Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
14351
15010
  * covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
@@ -14407,6 +15066,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
14407
15066
  this.StreamGitActivities = this.StreamGitActivities.bind(this);
14408
15067
  this.StreamGitActivitySummary = this.StreamGitActivitySummary.bind(this);
14409
15068
  this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
15069
+ this.StreamBurnRate = this.StreamBurnRate.bind(this);
14410
15070
  this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
14411
15071
  this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
14412
15072
  this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
@@ -14500,6 +15160,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
14500
15160
  return result.pipe(map((data) => TokenActivitySummary.decode(new BinaryReader(data))));
14501
15161
  }
14502
15162
 
15163
+ StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate> {
15164
+ const data = BurnRateRequest.encode(request).finish();
15165
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamBurnRate", data, metadata);
15166
+ return result.pipe(map((data) => BurnRate.decode(new BinaryReader(data))));
15167
+ }
15168
+
14503
15169
  StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity> {
14504
15170
  const data = DailyActivityRequest.encode(request).finish();
14505
15171
  const result = this.rpc.serverStreamingRequest(this.service, "StreamDailyActivity", data, metadata);