@miradorlabs/web-grpc 2.65.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 {
@@ -1587,6 +1603,42 @@ export interface AIFileRow {
1587
1603
  sessionId: string[];
1588
1604
  unlandedCostUsd: number;
1589
1605
  unlandedOutputTokens: number;
1606
+ /**
1607
+ * total_cost_usd is this file's share over ALL its edited turns (landed + unlanded);
1608
+ * landed = total_cost_usd - unlanded_cost_usd. subscription_* is the subscription-facility slice,
1609
+ * so Net = Notional - Subscription on either axis.
1610
+ */
1611
+ totalCostUsd: number;
1612
+ subscriptionTotalCostUsd: number;
1613
+ subscriptionUnlandedCostUsd: number;
1614
+ }
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;
1590
1642
  }
1591
1643
 
1592
1644
  export interface FilesSummaryRequest {
@@ -1621,6 +1673,9 @@ export interface FileTierBucket {
1621
1673
  outputTokens: number;
1622
1674
  oldestAge: Duration | undefined;
1623
1675
  filesUnverified: number;
1676
+ /** subscription-facility slice of the tier's unlanded cost (observed / inferred); Net subtracts these. */
1677
+ subscriptionCostUsd: number;
1678
+ subscriptionCostUsdUnverified: number;
1624
1679
  }
1625
1680
 
1626
1681
  export interface FileGroup {
@@ -9315,7 +9370,7 @@ export const BurnRateRequest: MessageFns<BurnRateRequest> = {
9315
9370
  };
9316
9371
 
9317
9372
  function createBaseBurnRate(): BurnRate {
9318
- return { asOf: undefined, current: undefined, currentGroups: [], sparkline: [], groupBy: 0 };
9373
+ return { asOf: undefined, current: undefined, currentGroups: [], sparkline: [], groupBy: 0, breakdowns: [] };
9319
9374
  }
9320
9375
 
9321
9376
  export const BurnRate: MessageFns<BurnRate> = {
@@ -9335,6 +9390,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9335
9390
  if (message.groupBy !== 0) {
9336
9391
  writer.uint32(40).int32(message.groupBy);
9337
9392
  }
9393
+ for (const v of message.breakdowns) {
9394
+ BurnRateBreakdown.encode(v!, writer.uint32(50).fork()).join();
9395
+ }
9338
9396
  return writer;
9339
9397
  },
9340
9398
 
@@ -9391,6 +9449,14 @@ export const BurnRate: MessageFns<BurnRate> = {
9391
9449
  message.groupBy = reader.int32() as any;
9392
9450
  continue;
9393
9451
  }
9452
+ case 6: {
9453
+ if (tag !== 50) {
9454
+ break;
9455
+ }
9456
+
9457
+ message.breakdowns.push(BurnRateBreakdown.decode(reader, reader.uint32()));
9458
+ continue;
9459
+ }
9394
9460
  }
9395
9461
  if ((tag & 7) === 4 || tag === 0) {
9396
9462
  break;
@@ -9424,6 +9490,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9424
9490
  : isSet(object.group_by)
9425
9491
  ? aITokenActivityDimensionFromJSON(object.group_by)
9426
9492
  : 0,
9493
+ breakdowns: globalThis.Array.isArray(object?.breakdowns)
9494
+ ? object.breakdowns.map((e: any) => BurnRateBreakdown.fromJSON(e))
9495
+ : [],
9427
9496
  };
9428
9497
  },
9429
9498
 
@@ -9444,6 +9513,9 @@ export const BurnRate: MessageFns<BurnRate> = {
9444
9513
  if (message.groupBy !== 0) {
9445
9514
  obj.groupBy = aITokenActivityDimensionToJSON(message.groupBy);
9446
9515
  }
9516
+ if (message.breakdowns?.length) {
9517
+ obj.breakdowns = message.breakdowns.map((e) => BurnRateBreakdown.toJSON(e));
9518
+ }
9447
9519
  return obj;
9448
9520
  },
9449
9521
 
@@ -9459,6 +9531,92 @@ export const BurnRate: MessageFns<BurnRate> = {
9459
9531
  message.currentGroups = object.currentGroups?.map((e) => BurnRateGroup.fromPartial(e)) || [];
9460
9532
  message.sparkline = object.sparkline?.map((e) => BurnRateSparkPoint.fromPartial(e)) || [];
9461
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)) || [];
9462
9620
  return message;
9463
9621
  },
9464
9622
  };
@@ -11622,6 +11780,7 @@ function createBaseProjectOverviewTotals(): ProjectOverviewTotals {
11622
11780
  pushes: 0,
11623
11781
  filesTouched: 0,
11624
11782
  lastActivityAt: undefined,
11783
+ subscriptionCostUsd: 0,
11625
11784
  };
11626
11785
  }
11627
11786
 
@@ -11669,6 +11828,9 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11669
11828
  if (message.lastActivityAt !== undefined) {
11670
11829
  Timestamp.encode(toTimestamp(message.lastActivityAt), writer.uint32(114).fork()).join();
11671
11830
  }
11831
+ if (message.subscriptionCostUsd !== 0) {
11832
+ writer.uint32(121).double(message.subscriptionCostUsd);
11833
+ }
11672
11834
  return writer;
11673
11835
  },
11674
11836
 
@@ -11797,6 +11959,14 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11797
11959
  message.lastActivityAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
11798
11960
  continue;
11799
11961
  }
11962
+ case 15: {
11963
+ if (tag !== 121) {
11964
+ break;
11965
+ }
11966
+
11967
+ message.subscriptionCostUsd = reader.double();
11968
+ continue;
11969
+ }
11800
11970
  }
11801
11971
  if ((tag & 7) === 4 || tag === 0) {
11802
11972
  break;
@@ -11869,6 +12039,11 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11869
12039
  : isSet(object.last_activity_at)
11870
12040
  ? fromJsonTimestamp(object.last_activity_at)
11871
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,
11872
12047
  };
11873
12048
  },
11874
12049
 
@@ -11916,6 +12091,9 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11916
12091
  if (message.lastActivityAt !== undefined) {
11917
12092
  obj.lastActivityAt = message.lastActivityAt.toISOString();
11918
12093
  }
12094
+ if (message.subscriptionCostUsd !== 0) {
12095
+ obj.subscriptionCostUsd = message.subscriptionCostUsd;
12096
+ }
11919
12097
  return obj;
11920
12098
  },
11921
12099
 
@@ -11938,12 +12116,13 @@ export const ProjectOverviewTotals: MessageFns<ProjectOverviewTotals> = {
11938
12116
  message.pushes = object.pushes ?? 0;
11939
12117
  message.filesTouched = object.filesTouched ?? 0;
11940
12118
  message.lastActivityAt = object.lastActivityAt ?? undefined;
12119
+ message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
11941
12120
  return message;
11942
12121
  },
11943
12122
  };
11944
12123
 
11945
12124
  function createBaseProjectOverviewSlice(): ProjectOverviewSlice {
11946
- return { key: "", modelCalls: 0, inputTokens: 0, outputTokens: 0, costUsd: 0 };
12125
+ return { key: "", modelCalls: 0, inputTokens: 0, outputTokens: 0, costUsd: 0, subscriptionCostUsd: 0 };
11947
12126
  }
11948
12127
 
11949
12128
  export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
@@ -11963,6 +12142,9 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
11963
12142
  if (message.costUsd !== 0) {
11964
12143
  writer.uint32(41).double(message.costUsd);
11965
12144
  }
12145
+ if (message.subscriptionCostUsd !== 0) {
12146
+ writer.uint32(49).double(message.subscriptionCostUsd);
12147
+ }
11966
12148
  return writer;
11967
12149
  },
11968
12150
 
@@ -12019,6 +12201,14 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12019
12201
  message.costUsd = reader.double();
12020
12202
  continue;
12021
12203
  }
12204
+ case 6: {
12205
+ if (tag !== 49) {
12206
+ break;
12207
+ }
12208
+
12209
+ message.subscriptionCostUsd = reader.double();
12210
+ continue;
12211
+ }
12022
12212
  }
12023
12213
  if ((tag & 7) === 4 || tag === 0) {
12024
12214
  break;
@@ -12054,6 +12244,11 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12054
12244
  : isSet(object.cost_usd)
12055
12245
  ? globalThis.Number(object.cost_usd)
12056
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,
12057
12252
  };
12058
12253
  },
12059
12254
 
@@ -12074,6 +12269,9 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12074
12269
  if (message.costUsd !== 0) {
12075
12270
  obj.costUsd = message.costUsd;
12076
12271
  }
12272
+ if (message.subscriptionCostUsd !== 0) {
12273
+ obj.subscriptionCostUsd = message.subscriptionCostUsd;
12274
+ }
12077
12275
  return obj;
12078
12276
  },
12079
12277
 
@@ -12087,6 +12285,7 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
12087
12285
  message.inputTokens = object.inputTokens ?? 0;
12088
12286
  message.outputTokens = object.outputTokens ?? 0;
12089
12287
  message.costUsd = object.costUsd ?? 0;
12288
+ message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
12090
12289
  return message;
12091
12290
  },
12092
12291
  };
@@ -13246,6 +13445,9 @@ function createBaseAIFileRow(): AIFileRow {
13246
13445
  sessionId: [],
13247
13446
  unlandedCostUsd: 0,
13248
13447
  unlandedOutputTokens: 0,
13448
+ totalCostUsd: 0,
13449
+ subscriptionTotalCostUsd: 0,
13450
+ subscriptionUnlandedCostUsd: 0,
13249
13451
  };
13250
13452
  }
13251
13453
 
@@ -13308,6 +13510,15 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13308
13510
  if (message.unlandedOutputTokens !== 0) {
13309
13511
  writer.uint32(152).uint64(message.unlandedOutputTokens);
13310
13512
  }
13513
+ if (message.totalCostUsd !== 0) {
13514
+ writer.uint32(161).double(message.totalCostUsd);
13515
+ }
13516
+ if (message.subscriptionTotalCostUsd !== 0) {
13517
+ writer.uint32(169).double(message.subscriptionTotalCostUsd);
13518
+ }
13519
+ if (message.subscriptionUnlandedCostUsd !== 0) {
13520
+ writer.uint32(177).double(message.subscriptionUnlandedCostUsd);
13521
+ }
13311
13522
  return writer;
13312
13523
  },
13313
13524
 
@@ -13476,6 +13687,30 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13476
13687
  message.unlandedOutputTokens = longToNumber(reader.uint64());
13477
13688
  continue;
13478
13689
  }
13690
+ case 20: {
13691
+ if (tag !== 161) {
13692
+ break;
13693
+ }
13694
+
13695
+ message.totalCostUsd = reader.double();
13696
+ continue;
13697
+ }
13698
+ case 21: {
13699
+ if (tag !== 169) {
13700
+ break;
13701
+ }
13702
+
13703
+ message.subscriptionTotalCostUsd = reader.double();
13704
+ continue;
13705
+ }
13706
+ case 22: {
13707
+ if (tag !== 177) {
13708
+ break;
13709
+ }
13710
+
13711
+ message.subscriptionUnlandedCostUsd = reader.double();
13712
+ continue;
13713
+ }
13479
13714
  }
13480
13715
  if ((tag & 7) === 4 || tag === 0) {
13481
13716
  break;
@@ -13565,6 +13800,21 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13565
13800
  : isSet(object.unlanded_output_tokens)
13566
13801
  ? globalThis.Number(object.unlanded_output_tokens)
13567
13802
  : 0,
13803
+ totalCostUsd: isSet(object.totalCostUsd)
13804
+ ? globalThis.Number(object.totalCostUsd)
13805
+ : isSet(object.total_cost_usd)
13806
+ ? globalThis.Number(object.total_cost_usd)
13807
+ : 0,
13808
+ subscriptionTotalCostUsd: isSet(object.subscriptionTotalCostUsd)
13809
+ ? globalThis.Number(object.subscriptionTotalCostUsd)
13810
+ : isSet(object.subscription_total_cost_usd)
13811
+ ? globalThis.Number(object.subscription_total_cost_usd)
13812
+ : 0,
13813
+ subscriptionUnlandedCostUsd: isSet(object.subscriptionUnlandedCostUsd)
13814
+ ? globalThis.Number(object.subscriptionUnlandedCostUsd)
13815
+ : isSet(object.subscription_unlanded_cost_usd)
13816
+ ? globalThis.Number(object.subscription_unlanded_cost_usd)
13817
+ : 0,
13568
13818
  };
13569
13819
  },
13570
13820
 
@@ -13627,6 +13877,15 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13627
13877
  if (message.unlandedOutputTokens !== 0) {
13628
13878
  obj.unlandedOutputTokens = Math.round(message.unlandedOutputTokens);
13629
13879
  }
13880
+ if (message.totalCostUsd !== 0) {
13881
+ obj.totalCostUsd = message.totalCostUsd;
13882
+ }
13883
+ if (message.subscriptionTotalCostUsd !== 0) {
13884
+ obj.subscriptionTotalCostUsd = message.subscriptionTotalCostUsd;
13885
+ }
13886
+ if (message.subscriptionUnlandedCostUsd !== 0) {
13887
+ obj.subscriptionUnlandedCostUsd = message.subscriptionUnlandedCostUsd;
13888
+ }
13630
13889
  return obj;
13631
13890
  },
13632
13891
 
@@ -13654,6 +13913,462 @@ export const AIFileRow: MessageFns<AIFileRow> = {
13654
13913
  message.sessionId = object.sessionId?.map((e) => e) || [];
13655
13914
  message.unlandedCostUsd = object.unlandedCostUsd ?? 0;
13656
13915
  message.unlandedOutputTokens = object.unlandedOutputTokens ?? 0;
13916
+ message.totalCostUsd = object.totalCostUsd ?? 0;
13917
+ message.subscriptionTotalCostUsd = object.subscriptionTotalCostUsd ?? 0;
13918
+ message.subscriptionUnlandedCostUsd = object.subscriptionUnlandedCostUsd ?? 0;
13919
+ return message;
13920
+ },
13921
+ };
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;
13657
14372
  return message;
13658
14373
  },
13659
14374
  };
@@ -14095,6 +14810,8 @@ function createBaseFileTierBucket(): FileTierBucket {
14095
14810
  outputTokens: 0,
14096
14811
  oldestAge: undefined,
14097
14812
  filesUnverified: 0,
14813
+ subscriptionCostUsd: 0,
14814
+ subscriptionCostUsdUnverified: 0,
14098
14815
  };
14099
14816
  }
14100
14817
 
@@ -14124,6 +14841,12 @@ export const FileTierBucket: MessageFns<FileTierBucket> = {
14124
14841
  if (message.filesUnverified !== 0) {
14125
14842
  writer.uint32(64).uint64(message.filesUnverified);
14126
14843
  }
14844
+ if (message.subscriptionCostUsd !== 0) {
14845
+ writer.uint32(73).double(message.subscriptionCostUsd);
14846
+ }
14847
+ if (message.subscriptionCostUsdUnverified !== 0) {
14848
+ writer.uint32(81).double(message.subscriptionCostUsdUnverified);
14849
+ }
14127
14850
  return writer;
14128
14851
  },
14129
14852
 
@@ -14204,6 +14927,22 @@ export const FileTierBucket: MessageFns<FileTierBucket> = {
14204
14927
  message.filesUnverified = longToNumber(reader.uint64());
14205
14928
  continue;
14206
14929
  }
14930
+ case 9: {
14931
+ if (tag !== 73) {
14932
+ break;
14933
+ }
14934
+
14935
+ message.subscriptionCostUsd = reader.double();
14936
+ continue;
14937
+ }
14938
+ case 10: {
14939
+ if (tag !== 81) {
14940
+ break;
14941
+ }
14942
+
14943
+ message.subscriptionCostUsdUnverified = reader.double();
14944
+ continue;
14945
+ }
14207
14946
  }
14208
14947
  if ((tag & 7) === 4 || tag === 0) {
14209
14948
  break;
@@ -14246,6 +14985,16 @@ export const FileTierBucket: MessageFns<FileTierBucket> = {
14246
14985
  : isSet(object.files_unverified)
14247
14986
  ? globalThis.Number(object.files_unverified)
14248
14987
  : 0,
14988
+ subscriptionCostUsd: isSet(object.subscriptionCostUsd)
14989
+ ? globalThis.Number(object.subscriptionCostUsd)
14990
+ : isSet(object.subscription_cost_usd)
14991
+ ? globalThis.Number(object.subscription_cost_usd)
14992
+ : 0,
14993
+ subscriptionCostUsdUnverified: isSet(object.subscriptionCostUsdUnverified)
14994
+ ? globalThis.Number(object.subscriptionCostUsdUnverified)
14995
+ : isSet(object.subscription_cost_usd_unverified)
14996
+ ? globalThis.Number(object.subscription_cost_usd_unverified)
14997
+ : 0,
14249
14998
  };
14250
14999
  },
14251
15000
 
@@ -14275,6 +15024,12 @@ export const FileTierBucket: MessageFns<FileTierBucket> = {
14275
15024
  if (message.filesUnverified !== 0) {
14276
15025
  obj.filesUnverified = Math.round(message.filesUnverified);
14277
15026
  }
15027
+ if (message.subscriptionCostUsd !== 0) {
15028
+ obj.subscriptionCostUsd = message.subscriptionCostUsd;
15029
+ }
15030
+ if (message.subscriptionCostUsdUnverified !== 0) {
15031
+ obj.subscriptionCostUsdUnverified = message.subscriptionCostUsdUnverified;
15032
+ }
14278
15033
  return obj;
14279
15034
  },
14280
15035
 
@@ -14293,6 +15048,8 @@ export const FileTierBucket: MessageFns<FileTierBucket> = {
14293
15048
  ? Duration.fromPartial(object.oldestAge)
14294
15049
  : undefined;
14295
15050
  message.filesUnverified = object.filesUnverified ?? 0;
15051
+ message.subscriptionCostUsd = object.subscriptionCostUsd ?? 0;
15052
+ message.subscriptionCostUsdUnverified = object.subscriptionCostUsdUnverified ?? 0;
14296
15053
  return message;
14297
15054
  },
14298
15055
  };
@@ -16352,6 +17109,11 @@ export interface AIGatewayService {
16352
17109
  * unverified, a complete snapshot re-derived each tick.
16353
17110
  */
16354
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>;
16355
17117
  /** Latest observed list price per (source, provider, model) from the global catalog. */
16356
17118
  ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
16357
17119
  /**
@@ -16402,6 +17164,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
16402
17164
  this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
16403
17165
  this.ListFiles = this.ListFiles.bind(this);
16404
17166
  this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
17167
+ this.GetBurnMap = this.GetBurnMap.bind(this);
16405
17168
  this.ListModelPrices = this.ListModelPrices.bind(this);
16406
17169
  this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
16407
17170
  this.ListResourceRankings = this.ListResourceRankings.bind(this);
@@ -16527,6 +17290,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
16527
17290
  return result.pipe(map((data) => FilesSummary.decode(new BinaryReader(data))));
16528
17291
  }
16529
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
+
16530
17299
  ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse> {
16531
17300
  const data = ListModelPricesRequest.encode(request).finish();
16532
17301
  const promise = this.rpc.request(this.service, "ListModelPrices", data, metadata);