@miradorlabs/web-grpc 2.66.0 → 2.68.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.
@@ -1330,6 +1330,17 @@ export interface BurnRate {
1330
1330
  currentGroups: BurnRateGroup[];
1331
1331
  sparkline: BurnRateSparkPoint[];
1332
1332
  groupBy: AITokenActivityDimension;
1333
+ /**
1334
+ * Every dimension's current-rate breakdown in one frame (model / provider / source_system / user /
1335
+ * api_key), computed from one scan — the burn card reads "by model" and "by user" from a single stream.
1336
+ */
1337
+ breakdowns: BurnRateBreakdown[];
1338
+ }
1339
+
1340
+ /** BurnRateBreakdown is one dimension's current-rate groups. */
1341
+ export interface BurnRateBreakdown {
1342
+ dimension: AITokenActivityDimension;
1343
+ groups: BurnRateGroup[];
1333
1344
  }
1334
1345
 
1335
1346
  export interface BurnRateGroup {
@@ -1496,7 +1507,11 @@ export interface ProjectOverviewTotals {
1496
1507
  commits: number;
1497
1508
  pushes: number;
1498
1509
  filesTouched: number;
1499
- lastActivityAt: Date | undefined;
1510
+ lastActivityAt:
1511
+ | Date
1512
+ | undefined;
1513
+ /** subscription-facility slice of cost_usd, so the dashboard renders net = cost_usd − subscription_cost_usd. */
1514
+ subscriptionCostUsd: number;
1500
1515
  }
1501
1516
 
1502
1517
  export interface ProjectOverviewSlice {
@@ -1505,6 +1520,7 @@ export interface ProjectOverviewSlice {
1505
1520
  inputTokens: number;
1506
1521
  outputTokens: number;
1507
1522
  costUsd: number;
1523
+ subscriptionCostUsd: number;
1508
1524
  }
1509
1525
 
1510
1526
  export interface ProjectSessionRef {
@@ -1597,6 +1613,34 @@ export interface AIFileRow {
1597
1613
  subscriptionUnlandedCostUsd: number;
1598
1614
  }
1599
1615
 
1616
+ export interface BurnMapRequest {
1617
+ organizationId: string;
1618
+ projectId: string;
1619
+ }
1620
+
1621
+ export interface BurnMapResponse {
1622
+ status: ResponseStatus | undefined;
1623
+ nodes: BurnMapNode[];
1624
+ }
1625
+
1626
+ /**
1627
+ * BurnMapNode is one (repository, directory) tile, pre-aggregated. Net = notional − subscription on either
1628
+ * axis; the client derives landed = total − unlanded and picks the tile metric.
1629
+ */
1630
+ export interface BurnMapNode {
1631
+ repositoryKey: string;
1632
+ directory: string;
1633
+ files: number;
1634
+ landedFiles: number;
1635
+ discardedFiles: number;
1636
+ edits: number;
1637
+ distinctSessions: number;
1638
+ unlandedCostUsd: number;
1639
+ subscriptionUnlandedCostUsd: number;
1640
+ totalCostUsd: number;
1641
+ subscriptionTotalCostUsd: number;
1642
+ }
1643
+
1600
1644
  export interface FilesSummaryRequest {
1601
1645
  organizationId: string;
1602
1646
  projectId: string;
@@ -9326,7 +9370,7 @@ export const BurnRateRequest: MessageFns<BurnRateRequest> = {
9326
9370
  };
9327
9371
 
9328
9372
  function createBaseBurnRate(): BurnRate {
9329
- return { asOf: undefined, current: undefined, currentGroups: [], sparkline: [], groupBy: 0 };
9373
+ return { asOf: undefined, current: undefined, currentGroups: [], sparkline: [], groupBy: 0, breakdowns: [] };
9330
9374
  }
9331
9375
 
9332
9376
  export const BurnRate: MessageFns<BurnRate> = {
@@ -9346,6 +9390,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9346
9390
  if (message.groupBy !== 0) {
9347
9391
  writer.uint32(40).int32(message.groupBy);
9348
9392
  }
9393
+ for (const v of message.breakdowns) {
9394
+ BurnRateBreakdown.encode(v!, writer.uint32(50).fork()).join();
9395
+ }
9349
9396
  return writer;
9350
9397
  },
9351
9398
 
@@ -9402,6 +9449,14 @@ export const BurnRate: MessageFns<BurnRate> = {
9402
9449
  message.groupBy = reader.int32() as any;
9403
9450
  continue;
9404
9451
  }
9452
+ case 6: {
9453
+ if (tag !== 50) {
9454
+ break;
9455
+ }
9456
+
9457
+ message.breakdowns.push(BurnRateBreakdown.decode(reader, reader.uint32()));
9458
+ continue;
9459
+ }
9405
9460
  }
9406
9461
  if ((tag & 7) === 4 || tag === 0) {
9407
9462
  break;
@@ -9435,6 +9490,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9435
9490
  : isSet(object.group_by)
9436
9491
  ? aITokenActivityDimensionFromJSON(object.group_by)
9437
9492
  : 0,
9493
+ breakdowns: globalThis.Array.isArray(object?.breakdowns)
9494
+ ? object.breakdowns.map((e: any) => BurnRateBreakdown.fromJSON(e))
9495
+ : [],
9438
9496
  };
9439
9497
  },
9440
9498
 
@@ -9455,6 +9513,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9455
9513
  if (message.groupBy !== 0) {
9456
9514
  obj.groupBy = aITokenActivityDimensionToJSON(message.groupBy);
9457
9515
  }
9516
+ if (message.breakdowns?.length) {
9517
+ obj.breakdowns = message.breakdowns.map((e) => BurnRateBreakdown.toJSON(e));
9518
+ }
9458
9519
  return obj;
9459
9520
  },
9460
9521
 
@@ -9470,6 +9531,92 @@ export const BurnRate: MessageFns<BurnRate> = {
9470
9531
  message.currentGroups = object.currentGroups?.map((e) => BurnRateGroup.fromPartial(e)) || [];
9471
9532
  message.sparkline = object.sparkline?.map((e) => BurnRateSparkPoint.fromPartial(e)) || [];
9472
9533
  message.groupBy = object.groupBy ?? 0;
9534
+ message.breakdowns = object.breakdowns?.map((e) => BurnRateBreakdown.fromPartial(e)) || [];
9535
+ return message;
9536
+ },
9537
+ };
9538
+
9539
+ function createBaseBurnRateBreakdown(): BurnRateBreakdown {
9540
+ return { dimension: 0, groups: [] };
9541
+ }
9542
+
9543
+ export const BurnRateBreakdown: MessageFns<BurnRateBreakdown> = {
9544
+ encode(message: BurnRateBreakdown, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
9545
+ if (message.dimension !== 0) {
9546
+ writer.uint32(8).int32(message.dimension);
9547
+ }
9548
+ for (const v of message.groups) {
9549
+ BurnRateGroup.encode(v!, writer.uint32(18).fork()).join();
9550
+ }
9551
+ return writer;
9552
+ },
9553
+
9554
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnRateBreakdown {
9555
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
9556
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
9557
+ if (previousRecursionDepth >= 100) {
9558
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
9559
+ }
9560
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
9561
+ try {
9562
+ const end = length === undefined ? reader.len : reader.pos + length;
9563
+ const message = createBaseBurnRateBreakdown();
9564
+ while (reader.pos < end) {
9565
+ const tag = reader.uint32();
9566
+ switch (tag >>> 3) {
9567
+ case 1: {
9568
+ if (tag !== 8) {
9569
+ break;
9570
+ }
9571
+
9572
+ message.dimension = reader.int32() as any;
9573
+ continue;
9574
+ }
9575
+ case 2: {
9576
+ if (tag !== 18) {
9577
+ break;
9578
+ }
9579
+
9580
+ message.groups.push(BurnRateGroup.decode(reader, reader.uint32()));
9581
+ continue;
9582
+ }
9583
+ }
9584
+ if ((tag & 7) === 4 || tag === 0) {
9585
+ break;
9586
+ }
9587
+ reader.skip(tag & 7);
9588
+ }
9589
+ return message;
9590
+ } finally {
9591
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
9592
+ }
9593
+ },
9594
+
9595
+ fromJSON(object: any): BurnRateBreakdown {
9596
+ return {
9597
+ dimension: isSet(object.dimension) ? aITokenActivityDimensionFromJSON(object.dimension) : 0,
9598
+ groups: globalThis.Array.isArray(object?.groups) ? object.groups.map((e: any) => BurnRateGroup.fromJSON(e)) : [],
9599
+ };
9600
+ },
9601
+
9602
+ toJSON(message: BurnRateBreakdown): unknown {
9603
+ const obj: any = {};
9604
+ if (message.dimension !== 0) {
9605
+ obj.dimension = aITokenActivityDimensionToJSON(message.dimension);
9606
+ }
9607
+ if (message.groups?.length) {
9608
+ obj.groups = message.groups.map((e) => BurnRateGroup.toJSON(e));
9609
+ }
9610
+ return obj;
9611
+ },
9612
+
9613
+ create<I extends Exact<DeepPartial<BurnRateBreakdown>, I>>(base?: I): BurnRateBreakdown {
9614
+ return BurnRateBreakdown.fromPartial(base ?? ({} as any));
9615
+ },
9616
+ fromPartial<I extends Exact<DeepPartial<BurnRateBreakdown>, I>>(object: I): BurnRateBreakdown {
9617
+ const message = createBaseBurnRateBreakdown();
9618
+ message.dimension = object.dimension ?? 0;
9619
+ message.groups = object.groups?.map((e) => BurnRateGroup.fromPartial(e)) || [];
9473
9620
  return message;
9474
9621
  },
9475
9622
  };
@@ -11633,6 +11780,7 @@ function createBaseProjectOverviewTotals(): ProjectOverviewTotals {
11633
11780
  pushes: 0,
11634
11781
  filesTouched: 0,
11635
11782
  lastActivityAt: undefined,
11783
+ subscriptionCostUsd: 0,
11636
11784
  };
11637
11785
  }
11638
11786
 
@@ -11680,6 +11828,9 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11680
11828
  if (message.lastActivityAt !== undefined) {
11681
11829
  Timestamp.encode(toTimestamp(message.lastActivityAt), writer.uint32(114).fork()).join();
11682
11830
  }
11831
+ if (message.subscriptionCostUsd !== 0) {
11832
+ writer.uint32(121).double(message.subscriptionCostUsd);
11833
+ }
11683
11834
  return writer;
11684
11835
  },
11685
11836
 
@@ -11808,6 +11959,14 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11808
11959
  message.lastActivityAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
11809
11960
  continue;
11810
11961
  }
11962
+ case 15: {
11963
+ if (tag !== 121) {
11964
+ break;
11965
+ }
11966
+
11967
+ message.subscriptionCostUsd = reader.double();
11968
+ continue;
11969
+ }
11811
11970
  }
11812
11971
  if ((tag & 7) === 4 || tag === 0) {
11813
11972
  break;
@@ -11880,6 +12039,11 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11880
12039
  : isSet(object.last_activity_at)
11881
12040
  ? fromJsonTimestamp(object.last_activity_at)
11882
12041
  : undefined,
12042
+ subscriptionCostUsd: isSet(object.subscriptionCostUsd)
12043
+ ? globalThis.Number(object.subscriptionCostUsd)
12044
+ : isSet(object.subscription_cost_usd)
12045
+ ? globalThis.Number(object.subscription_cost_usd)
12046
+ : 0,
11883
12047
  };
11884
12048
  },
11885
12049
 
@@ -11927,6 +12091,9 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11927
12091
  if (message.lastActivityAt !== undefined) {
11928
12092
  obj.lastActivityAt = message.lastActivityAt.toISOString();
11929
12093
  }
12094
+ if (message.subscriptionCostUsd !== 0) {
12095
+ obj.subscriptionCostUsd = message.subscriptionCostUsd;
12096
+ }
11930
12097
  return obj;
11931
12098
  },
11932
12099
 
@@ -11949,12 +12116,13 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11949
12116
  message.pushes = object.pushes ?? 0;
11950
12117
  message.filesTouched = object.filesTouched ?? 0;
11951
12118
  message.lastActivityAt = object.lastActivityAt ?? undefined;
12119
+ message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
11952
12120
  return message;
11953
12121
  },
11954
12122
  };
11955
12123
 
11956
12124
  function createBaseProjectOverviewSlice(): ProjectOverviewSlice {
11957
- return { key: "", modelCalls: 0, inputTokens: 0, outputTokens: 0, costUsd: 0 };
12125
+ return { key: "", modelCalls: 0, inputTokens: 0, outputTokens: 0, costUsd: 0, subscriptionCostUsd: 0 };
11958
12126
  }
11959
12127
 
11960
12128
  export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
@@ -11974,6 +12142,9 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
11974
12142
  if (message.costUsd !== 0) {
11975
12143
  writer.uint32(41).double(message.costUsd);
11976
12144
  }
12145
+ if (message.subscriptionCostUsd !== 0) {
12146
+ writer.uint32(49).double(message.subscriptionCostUsd);
12147
+ }
11977
12148
  return writer;
11978
12149
  },
11979
12150
 
@@ -12030,6 +12201,14 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12030
12201
  message.costUsd = reader.double();
12031
12202
  continue;
12032
12203
  }
12204
+ case 6: {
12205
+ if (tag !== 49) {
12206
+ break;
12207
+ }
12208
+
12209
+ message.subscriptionCostUsd = reader.double();
12210
+ continue;
12211
+ }
12033
12212
  }
12034
12213
  if ((tag & 7) === 4 || tag === 0) {
12035
12214
  break;
@@ -12065,6 +12244,11 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12065
12244
  : isSet(object.cost_usd)
12066
12245
  ? globalThis.Number(object.cost_usd)
12067
12246
  : 0,
12247
+ subscriptionCostUsd: isSet(object.subscriptionCostUsd)
12248
+ ? globalThis.Number(object.subscriptionCostUsd)
12249
+ : isSet(object.subscription_cost_usd)
12250
+ ? globalThis.Number(object.subscription_cost_usd)
12251
+ : 0,
12068
12252
  };
12069
12253
  },
12070
12254
 
@@ -12085,6 +12269,9 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12085
12269
  if (message.costUsd !== 0) {
12086
12270
  obj.costUsd = message.costUsd;
12087
12271
  }
12272
+ if (message.subscriptionCostUsd !== 0) {
12273
+ obj.subscriptionCostUsd = message.subscriptionCostUsd;
12274
+ }
12088
12275
  return obj;
12089
12276
  },
12090
12277
 
@@ -12098,6 +12285,7 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12098
12285
  message.inputTokens = object.inputTokens ?? 0;
12099
12286
  message.outputTokens = object.outputTokens ?? 0;
12100
12287
  message.costUsd = object.costUsd ?? 0;
12288
+ message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
12101
12289
  return message;
12102
12290
  },
12103
12291
  };
@@ -13732,6 +13920,459 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13732
13920
  },
13733
13921
  };
13734
13922
 
13923
+ function createBaseBurnMapRequest(): BurnMapRequest {
13924
+ return { organizationId: "", projectId: "" };
13925
+ }
13926
+
13927
+ export const BurnMapRequest: MessageFns<BurnMapRequest> = {
13928
+ encode(message: BurnMapRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
13929
+ if (message.organizationId !== "") {
13930
+ writer.uint32(10).string(message.organizationId);
13931
+ }
13932
+ if (message.projectId !== "") {
13933
+ writer.uint32(18).string(message.projectId);
13934
+ }
13935
+ return writer;
13936
+ },
13937
+
13938
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnMapRequest {
13939
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
13940
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
13941
+ if (previousRecursionDepth >= 100) {
13942
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
13943
+ }
13944
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
13945
+ try {
13946
+ const end = length === undefined ? reader.len : reader.pos + length;
13947
+ const message = createBaseBurnMapRequest();
13948
+ while (reader.pos < end) {
13949
+ const tag = reader.uint32();
13950
+ switch (tag >>> 3) {
13951
+ case 1: {
13952
+ if (tag !== 10) {
13953
+ break;
13954
+ }
13955
+
13956
+ message.organizationId = reader.string();
13957
+ continue;
13958
+ }
13959
+ case 2: {
13960
+ if (tag !== 18) {
13961
+ break;
13962
+ }
13963
+
13964
+ message.projectId = reader.string();
13965
+ continue;
13966
+ }
13967
+ }
13968
+ if ((tag & 7) === 4 || tag === 0) {
13969
+ break;
13970
+ }
13971
+ reader.skip(tag & 7);
13972
+ }
13973
+ return message;
13974
+ } finally {
13975
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
13976
+ }
13977
+ },
13978
+
13979
+ fromJSON(object: any): BurnMapRequest {
13980
+ return {
13981
+ organizationId: isSet(object.organizationId)
13982
+ ? globalThis.String(object.organizationId)
13983
+ : isSet(object.organization_id)
13984
+ ? globalThis.String(object.organization_id)
13985
+ : "",
13986
+ projectId: isSet(object.projectId)
13987
+ ? globalThis.String(object.projectId)
13988
+ : isSet(object.project_id)
13989
+ ? globalThis.String(object.project_id)
13990
+ : "",
13991
+ };
13992
+ },
13993
+
13994
+ toJSON(message: BurnMapRequest): unknown {
13995
+ const obj: any = {};
13996
+ if (message.organizationId !== "") {
13997
+ obj.organizationId = message.organizationId;
13998
+ }
13999
+ if (message.projectId !== "") {
14000
+ obj.projectId = message.projectId;
14001
+ }
14002
+ return obj;
14003
+ },
14004
+
14005
+ create<I extends Exact<DeepPartial<BurnMapRequest>, I>>(base?: I): BurnMapRequest {
14006
+ return BurnMapRequest.fromPartial(base ?? ({} as any));
14007
+ },
14008
+ fromPartial<I extends Exact<DeepPartial<BurnMapRequest>, I>>(object: I): BurnMapRequest {
14009
+ const message = createBaseBurnMapRequest();
14010
+ message.organizationId = object.organizationId ?? "";
14011
+ message.projectId = object.projectId ?? "";
14012
+ return message;
14013
+ },
14014
+ };
14015
+
14016
+ function createBaseBurnMapResponse(): BurnMapResponse {
14017
+ return { status: undefined, nodes: [] };
14018
+ }
14019
+
14020
+ export const BurnMapResponse: MessageFns<BurnMapResponse> = {
14021
+ encode(message: BurnMapResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
14022
+ if (message.status !== undefined) {
14023
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
14024
+ }
14025
+ for (const v of message.nodes) {
14026
+ BurnMapNode.encode(v!, writer.uint32(18).fork()).join();
14027
+ }
14028
+ return writer;
14029
+ },
14030
+
14031
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnMapResponse {
14032
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
14033
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
14034
+ if (previousRecursionDepth >= 100) {
14035
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
14036
+ }
14037
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
14038
+ try {
14039
+ const end = length === undefined ? reader.len : reader.pos + length;
14040
+ const message = createBaseBurnMapResponse();
14041
+ while (reader.pos < end) {
14042
+ const tag = reader.uint32();
14043
+ switch (tag >>> 3) {
14044
+ case 1: {
14045
+ if (tag !== 10) {
14046
+ break;
14047
+ }
14048
+
14049
+ message.status = ResponseStatus.decode(reader, reader.uint32());
14050
+ continue;
14051
+ }
14052
+ case 2: {
14053
+ if (tag !== 18) {
14054
+ break;
14055
+ }
14056
+
14057
+ message.nodes.push(BurnMapNode.decode(reader, reader.uint32()));
14058
+ continue;
14059
+ }
14060
+ }
14061
+ if ((tag & 7) === 4 || tag === 0) {
14062
+ break;
14063
+ }
14064
+ reader.skip(tag & 7);
14065
+ }
14066
+ return message;
14067
+ } finally {
14068
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
14069
+ }
14070
+ },
14071
+
14072
+ fromJSON(object: any): BurnMapResponse {
14073
+ return {
14074
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
14075
+ nodes: globalThis.Array.isArray(object?.nodes) ? object.nodes.map((e: any) => BurnMapNode.fromJSON(e)) : [],
14076
+ };
14077
+ },
14078
+
14079
+ toJSON(message: BurnMapResponse): unknown {
14080
+ const obj: any = {};
14081
+ if (message.status !== undefined) {
14082
+ obj.status = ResponseStatus.toJSON(message.status);
14083
+ }
14084
+ if (message.nodes?.length) {
14085
+ obj.nodes = message.nodes.map((e) => BurnMapNode.toJSON(e));
14086
+ }
14087
+ return obj;
14088
+ },
14089
+
14090
+ create<I extends Exact<DeepPartial<BurnMapResponse>, I>>(base?: I): BurnMapResponse {
14091
+ return BurnMapResponse.fromPartial(base ?? ({} as any));
14092
+ },
14093
+ fromPartial<I extends Exact<DeepPartial<BurnMapResponse>, I>>(object: I): BurnMapResponse {
14094
+ const message = createBaseBurnMapResponse();
14095
+ message.status = (object.status !== undefined && object.status !== null)
14096
+ ? ResponseStatus.fromPartial(object.status)
14097
+ : undefined;
14098
+ message.nodes = object.nodes?.map((e) => BurnMapNode.fromPartial(e)) || [];
14099
+ return message;
14100
+ },
14101
+ };
14102
+
14103
+ function createBaseBurnMapNode(): BurnMapNode {
14104
+ return {
14105
+ repositoryKey: "",
14106
+ directory: "",
14107
+ files: 0,
14108
+ landedFiles: 0,
14109
+ discardedFiles: 0,
14110
+ edits: 0,
14111
+ distinctSessions: 0,
14112
+ unlandedCostUsd: 0,
14113
+ subscriptionUnlandedCostUsd: 0,
14114
+ totalCostUsd: 0,
14115
+ subscriptionTotalCostUsd: 0,
14116
+ };
14117
+ }
14118
+
14119
+ export const BurnMapNode: MessageFns<BurnMapNode> = {
14120
+ encode(message: BurnMapNode, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
14121
+ if (message.repositoryKey !== "") {
14122
+ writer.uint32(10).string(message.repositoryKey);
14123
+ }
14124
+ if (message.directory !== "") {
14125
+ writer.uint32(18).string(message.directory);
14126
+ }
14127
+ if (message.files !== 0) {
14128
+ writer.uint32(24).uint64(message.files);
14129
+ }
14130
+ if (message.landedFiles !== 0) {
14131
+ writer.uint32(32).uint64(message.landedFiles);
14132
+ }
14133
+ if (message.discardedFiles !== 0) {
14134
+ writer.uint32(40).uint64(message.discardedFiles);
14135
+ }
14136
+ if (message.edits !== 0) {
14137
+ writer.uint32(48).uint64(message.edits);
14138
+ }
14139
+ if (message.distinctSessions !== 0) {
14140
+ writer.uint32(56).uint64(message.distinctSessions);
14141
+ }
14142
+ if (message.unlandedCostUsd !== 0) {
14143
+ writer.uint32(65).double(message.unlandedCostUsd);
14144
+ }
14145
+ if (message.subscriptionUnlandedCostUsd !== 0) {
14146
+ writer.uint32(73).double(message.subscriptionUnlandedCostUsd);
14147
+ }
14148
+ if (message.totalCostUsd !== 0) {
14149
+ writer.uint32(81).double(message.totalCostUsd);
14150
+ }
14151
+ if (message.subscriptionTotalCostUsd !== 0) {
14152
+ writer.uint32(89).double(message.subscriptionTotalCostUsd);
14153
+ }
14154
+ return writer;
14155
+ },
14156
+
14157
+ decode(input: BinaryReader | Uint8Array, length?: number): BurnMapNode {
14158
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
14159
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
14160
+ if (previousRecursionDepth >= 100) {
14161
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
14162
+ }
14163
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
14164
+ try {
14165
+ const end = length === undefined ? reader.len : reader.pos + length;
14166
+ const message = createBaseBurnMapNode();
14167
+ while (reader.pos < end) {
14168
+ const tag = reader.uint32();
14169
+ switch (tag >>> 3) {
14170
+ case 1: {
14171
+ if (tag !== 10) {
14172
+ break;
14173
+ }
14174
+
14175
+ message.repositoryKey = reader.string();
14176
+ continue;
14177
+ }
14178
+ case 2: {
14179
+ if (tag !== 18) {
14180
+ break;
14181
+ }
14182
+
14183
+ message.directory = reader.string();
14184
+ continue;
14185
+ }
14186
+ case 3: {
14187
+ if (tag !== 24) {
14188
+ break;
14189
+ }
14190
+
14191
+ message.files = longToNumber(reader.uint64());
14192
+ continue;
14193
+ }
14194
+ case 4: {
14195
+ if (tag !== 32) {
14196
+ break;
14197
+ }
14198
+
14199
+ message.landedFiles = longToNumber(reader.uint64());
14200
+ continue;
14201
+ }
14202
+ case 5: {
14203
+ if (tag !== 40) {
14204
+ break;
14205
+ }
14206
+
14207
+ message.discardedFiles = longToNumber(reader.uint64());
14208
+ continue;
14209
+ }
14210
+ case 6: {
14211
+ if (tag !== 48) {
14212
+ break;
14213
+ }
14214
+
14215
+ message.edits = longToNumber(reader.uint64());
14216
+ continue;
14217
+ }
14218
+ case 7: {
14219
+ if (tag !== 56) {
14220
+ break;
14221
+ }
14222
+
14223
+ message.distinctSessions = longToNumber(reader.uint64());
14224
+ continue;
14225
+ }
14226
+ case 8: {
14227
+ if (tag !== 65) {
14228
+ break;
14229
+ }
14230
+
14231
+ message.unlandedCostUsd = reader.double();
14232
+ continue;
14233
+ }
14234
+ case 9: {
14235
+ if (tag !== 73) {
14236
+ break;
14237
+ }
14238
+
14239
+ message.subscriptionUnlandedCostUsd = reader.double();
14240
+ continue;
14241
+ }
14242
+ case 10: {
14243
+ if (tag !== 81) {
14244
+ break;
14245
+ }
14246
+
14247
+ message.totalCostUsd = reader.double();
14248
+ continue;
14249
+ }
14250
+ case 11: {
14251
+ if (tag !== 89) {
14252
+ break;
14253
+ }
14254
+
14255
+ message.subscriptionTotalCostUsd = reader.double();
14256
+ continue;
14257
+ }
14258
+ }
14259
+ if ((tag & 7) === 4 || tag === 0) {
14260
+ break;
14261
+ }
14262
+ reader.skip(tag & 7);
14263
+ }
14264
+ return message;
14265
+ } finally {
14266
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
14267
+ }
14268
+ },
14269
+
14270
+ fromJSON(object: any): BurnMapNode {
14271
+ return {
14272
+ repositoryKey: isSet(object.repositoryKey)
14273
+ ? globalThis.String(object.repositoryKey)
14274
+ : isSet(object.repository_key)
14275
+ ? globalThis.String(object.repository_key)
14276
+ : "",
14277
+ directory: isSet(object.directory) ? globalThis.String(object.directory) : "",
14278
+ files: isSet(object.files) ? globalThis.Number(object.files) : 0,
14279
+ landedFiles: isSet(object.landedFiles)
14280
+ ? globalThis.Number(object.landedFiles)
14281
+ : isSet(object.landed_files)
14282
+ ? globalThis.Number(object.landed_files)
14283
+ : 0,
14284
+ discardedFiles: isSet(object.discardedFiles)
14285
+ ? globalThis.Number(object.discardedFiles)
14286
+ : isSet(object.discarded_files)
14287
+ ? globalThis.Number(object.discarded_files)
14288
+ : 0,
14289
+ edits: isSet(object.edits) ? globalThis.Number(object.edits) : 0,
14290
+ distinctSessions: isSet(object.distinctSessions)
14291
+ ? globalThis.Number(object.distinctSessions)
14292
+ : isSet(object.distinct_sessions)
14293
+ ? globalThis.Number(object.distinct_sessions)
14294
+ : 0,
14295
+ unlandedCostUsd: isSet(object.unlandedCostUsd)
14296
+ ? globalThis.Number(object.unlandedCostUsd)
14297
+ : isSet(object.unlanded_cost_usd)
14298
+ ? globalThis.Number(object.unlanded_cost_usd)
14299
+ : 0,
14300
+ subscriptionUnlandedCostUsd: isSet(object.subscriptionUnlandedCostUsd)
14301
+ ? globalThis.Number(object.subscriptionUnlandedCostUsd)
14302
+ : isSet(object.subscription_unlanded_cost_usd)
14303
+ ? globalThis.Number(object.subscription_unlanded_cost_usd)
14304
+ : 0,
14305
+ totalCostUsd: isSet(object.totalCostUsd)
14306
+ ? globalThis.Number(object.totalCostUsd)
14307
+ : isSet(object.total_cost_usd)
14308
+ ? globalThis.Number(object.total_cost_usd)
14309
+ : 0,
14310
+ subscriptionTotalCostUsd: isSet(object.subscriptionTotalCostUsd)
14311
+ ? globalThis.Number(object.subscriptionTotalCostUsd)
14312
+ : isSet(object.subscription_total_cost_usd)
14313
+ ? globalThis.Number(object.subscription_total_cost_usd)
14314
+ : 0,
14315
+ };
14316
+ },
14317
+
14318
+ toJSON(message: BurnMapNode): unknown {
14319
+ const obj: any = {};
14320
+ if (message.repositoryKey !== "") {
14321
+ obj.repositoryKey = message.repositoryKey;
14322
+ }
14323
+ if (message.directory !== "") {
14324
+ obj.directory = message.directory;
14325
+ }
14326
+ if (message.files !== 0) {
14327
+ obj.files = Math.round(message.files);
14328
+ }
14329
+ if (message.landedFiles !== 0) {
14330
+ obj.landedFiles = Math.round(message.landedFiles);
14331
+ }
14332
+ if (message.discardedFiles !== 0) {
14333
+ obj.discardedFiles = Math.round(message.discardedFiles);
14334
+ }
14335
+ if (message.edits !== 0) {
14336
+ obj.edits = Math.round(message.edits);
14337
+ }
14338
+ if (message.distinctSessions !== 0) {
14339
+ obj.distinctSessions = Math.round(message.distinctSessions);
14340
+ }
14341
+ if (message.unlandedCostUsd !== 0) {
14342
+ obj.unlandedCostUsd = message.unlandedCostUsd;
14343
+ }
14344
+ if (message.subscriptionUnlandedCostUsd !== 0) {
14345
+ obj.subscriptionUnlandedCostUsd = message.subscriptionUnlandedCostUsd;
14346
+ }
14347
+ if (message.totalCostUsd !== 0) {
14348
+ obj.totalCostUsd = message.totalCostUsd;
14349
+ }
14350
+ if (message.subscriptionTotalCostUsd !== 0) {
14351
+ obj.subscriptionTotalCostUsd = message.subscriptionTotalCostUsd;
14352
+ }
14353
+ return obj;
14354
+ },
14355
+
14356
+ create<I extends Exact<DeepPartial<BurnMapNode>, I>>(base?: I): BurnMapNode {
14357
+ return BurnMapNode.fromPartial(base ?? ({} as any));
14358
+ },
14359
+ fromPartial<I extends Exact<DeepPartial<BurnMapNode>, I>>(object: I): BurnMapNode {
14360
+ const message = createBaseBurnMapNode();
14361
+ message.repositoryKey = object.repositoryKey ?? "";
14362
+ message.directory = object.directory ?? "";
14363
+ message.files = object.files ?? 0;
14364
+ message.landedFiles = object.landedFiles ?? 0;
14365
+ message.discardedFiles = object.discardedFiles ?? 0;
14366
+ message.edits = object.edits ?? 0;
14367
+ message.distinctSessions = object.distinctSessions ?? 0;
14368
+ message.unlandedCostUsd = object.unlandedCostUsd ?? 0;
14369
+ message.subscriptionUnlandedCostUsd = object.subscriptionUnlandedCostUsd ?? 0;
14370
+ message.totalCostUsd = object.totalCostUsd ?? 0;
14371
+ message.subscriptionTotalCostUsd = object.subscriptionTotalCostUsd ?? 0;
14372
+ return message;
14373
+ },
14374
+ };
14375
+
13735
14376
  function createBaseFilesSummaryRequest(): FilesSummaryRequest {
13736
14377
  return { organizationId: "", projectId: "", filter: undefined, abandonedHorizon: undefined, groupBy: 0 };
13737
14378
  }
@@ -16468,6 +17109,11 @@ export interface AIGatewayService {
16468
17109
  * unverified, a complete snapshot re-derived each tick.
16469
17110
  */
16470
17111
  StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
17112
+ /**
17113
+ * GetBurnMap returns the burn-map treemap pre-aggregated by (repository, directory) so the client no
17114
+ * longer pulls every file row to group in the browser. Squarify geometry stays client-side.
17115
+ */
17116
+ GetBurnMap(request: BurnMapRequest, metadata?: Metadata): Promise<BurnMapResponse>;
16471
17117
  /** Latest observed list price per (source, provider, model) from the global catalog. */
16472
17118
  ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
16473
17119
  /**
@@ -16518,6 +17164,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
16518
17164
  this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
16519
17165
  this.ListFiles = this.ListFiles.bind(this);
16520
17166
  this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
17167
+ this.GetBurnMap = this.GetBurnMap.bind(this);
16521
17168
  this.ListModelPrices = this.ListModelPrices.bind(this);
16522
17169
  this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
16523
17170
  this.ListResourceRankings = this.ListResourceRankings.bind(this);
@@ -16643,6 +17290,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
16643
17290
  return result.pipe(map((data) => FilesSummary.decode(new BinaryReader(data))));
16644
17291
  }
16645
17292
 
17293
+ GetBurnMap(request: BurnMapRequest, metadata?: Metadata): Promise<BurnMapResponse> {
17294
+ const data = BurnMapRequest.encode(request).finish();
17295
+ const promise = this.rpc.request(this.service, "GetBurnMap", data, metadata);
17296
+ return promise.then((data) => BurnMapResponse.decode(new BinaryReader(data)));
17297
+ }
17298
+
16646
17299
  ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse> {
16647
17300
  const data = ListModelPricesRequest.encode(request).finish();
16648
17301
  const promise = this.rpc.request(this.service, "ListModelPrices", data, metadata);