@miradorlabs/web-grpc 3.31.1 → 3.33.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.
@@ -26,7 +26,8 @@ export const protobufPackage = "gateway.web.v1";
26
26
 
27
27
  /**
28
28
  * SessionSort ranks the conversation catalog, descending. Unspecified is RECENCY. RECENCY is the last activity;
29
- * the rest are summed conversation totals. source_system, then session_id, breaks ties.
29
+ * the rest are summed conversation totals. source_system, then session_id, breaks ties. A value the backend does
30
+ * not know is rejected with INVALID_ARGUMENT.
30
31
  */
31
32
  export enum SessionSort {
32
33
  SESSION_SORT_UNSPECIFIED = 0,
@@ -35,6 +36,8 @@ export enum SessionSort {
35
36
  SESSION_SORT_TURNS = 3,
36
37
  SESSION_SORT_TOOLS = 4,
37
38
  SESSION_SORT_RECENCY = 5,
39
+ /** SESSION_SORT_NET_COST - provider cost less its subscription facility slice (at least 0) */
40
+ SESSION_SORT_NET_COST = 6,
38
41
  UNRECOGNIZED = -1,
39
42
  }
40
43
 
@@ -58,6 +61,9 @@ export function sessionSortFromJSON(object: any): SessionSort {
58
61
  case 5:
59
62
  case "SESSION_SORT_RECENCY":
60
63
  return SessionSort.SESSION_SORT_RECENCY;
64
+ case 6:
65
+ case "SESSION_SORT_NET_COST":
66
+ return SessionSort.SESSION_SORT_NET_COST;
61
67
  case -1:
62
68
  case "UNRECOGNIZED":
63
69
  default:
@@ -79,6 +85,8 @@ export function sessionSortToJSON(object: SessionSort): string {
79
85
  return "SESSION_SORT_TOOLS";
80
86
  case SessionSort.SESSION_SORT_RECENCY:
81
87
  return "SESSION_SORT_RECENCY";
88
+ case SessionSort.SESSION_SORT_NET_COST:
89
+ return "SESSION_SORT_NET_COST";
82
90
  case SessionSort.UNRECOGNIZED:
83
91
  default:
84
92
  return "UNRECOGNIZED";
@@ -440,6 +448,64 @@ export function aITokenActivityDimensionToJSON(object: AITokenActivityDimension)
440
448
  }
441
449
  }
442
450
 
451
+ /** AISpendForecastDimension mirrors telemetry.api.v1.AISpendForecastDimension. */
452
+ export enum AISpendForecastDimension {
453
+ AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED = 0,
454
+ AI_SPEND_FORECAST_DIMENSION_MODEL = 1,
455
+ AI_SPEND_FORECAST_DIMENSION_PROVIDER = 2,
456
+ AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM = 3,
457
+ AI_SPEND_FORECAST_DIMENSION_USER = 4,
458
+ AI_SPEND_FORECAST_DIMENSION_API_KEY = 5,
459
+ UNRECOGNIZED = -1,
460
+ }
461
+
462
+ export function aISpendForecastDimensionFromJSON(object: any): AISpendForecastDimension {
463
+ switch (object) {
464
+ case 0:
465
+ case "AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED":
466
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED;
467
+ case 1:
468
+ case "AI_SPEND_FORECAST_DIMENSION_MODEL":
469
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_MODEL;
470
+ case 2:
471
+ case "AI_SPEND_FORECAST_DIMENSION_PROVIDER":
472
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_PROVIDER;
473
+ case 3:
474
+ case "AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM":
475
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM;
476
+ case 4:
477
+ case "AI_SPEND_FORECAST_DIMENSION_USER":
478
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_USER;
479
+ case 5:
480
+ case "AI_SPEND_FORECAST_DIMENSION_API_KEY":
481
+ return AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_API_KEY;
482
+ case -1:
483
+ case "UNRECOGNIZED":
484
+ default:
485
+ return AISpendForecastDimension.UNRECOGNIZED;
486
+ }
487
+ }
488
+
489
+ export function aISpendForecastDimensionToJSON(object: AISpendForecastDimension): string {
490
+ switch (object) {
491
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED:
492
+ return "AI_SPEND_FORECAST_DIMENSION_UNSPECIFIED";
493
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_MODEL:
494
+ return "AI_SPEND_FORECAST_DIMENSION_MODEL";
495
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_PROVIDER:
496
+ return "AI_SPEND_FORECAST_DIMENSION_PROVIDER";
497
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM:
498
+ return "AI_SPEND_FORECAST_DIMENSION_SOURCE_SYSTEM";
499
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_USER:
500
+ return "AI_SPEND_FORECAST_DIMENSION_USER";
501
+ case AISpendForecastDimension.AI_SPEND_FORECAST_DIMENSION_API_KEY:
502
+ return "AI_SPEND_FORECAST_DIMENSION_API_KEY";
503
+ case AISpendForecastDimension.UNRECOGNIZED:
504
+ default:
505
+ return "UNRECOGNIZED";
506
+ }
507
+ }
508
+
443
509
  export enum AIResourceDimension {
444
510
  AI_RESOURCE_DIMENSION_UNSPECIFIED = 0,
445
511
  AI_RESOURCE_DIMENSION_SKILL = 1,
@@ -1583,6 +1649,83 @@ export interface DailyActivityMeasures {
1583
1649
  sessions: number;
1584
1650
  }
1585
1651
 
1652
+ export interface SpendForecastRequest {
1653
+ organizationId: string;
1654
+ projectId: string;
1655
+ /** Optional slice; unset forecasts the cost on every funding facility. */
1656
+ filter: SpendForecastFilter | undefined;
1657
+ }
1658
+
1659
+ /** SpendForecastFilter narrows the cost a forecast counts. An empty list does not filter. */
1660
+ export interface SpendForecastFilter {
1661
+ /**
1662
+ * OR within the list. UNKNOWN selects every cost off the three named facilities (observed-unknown, never-stamped
1663
+ * or an unrecognized facility); UNSPECIFIED is rejected.
1664
+ * [API_METERED, PREPAID_CREDITS, UNKNOWN] is the cost not drawn on a subscription facility.
1665
+ */
1666
+ fundingModes: AIFundingMode[];
1667
+ }
1668
+
1669
+ /**
1670
+ * SpendForecast mirrors telemetry.api.v1.SpendForecast, replaced wholesale each tick. Cost is notional (the
1671
+ * source's reported figure, else tokens x list price), never an invoice: an unpriced call counts 0.
1672
+ */
1673
+ export interface SpendForecast {
1674
+ /** first UTC day of the current month, YYYY-MM-DD */
1675
+ periodStart: string;
1676
+ /** last UTC day of the current month */
1677
+ periodEnd: string;
1678
+ /** provisional; its cost so far is in month_to_date_usd */
1679
+ today: string;
1680
+ /**
1681
+ * Earliest UTC day the rollup is authoritative for this project; empty when nothing is materialized. Month
1682
+ * days before it are uncomputed and not in month_to_date_usd.
1683
+ */
1684
+ coverageStart: string;
1685
+ /**
1686
+ * Complete trailing 7-day weeks (0 to 4, newest ending yesterday) the projection replays. 0 means too little
1687
+ * history, and every projection is absent.
1688
+ */
1689
+ historyWeeks: number;
1690
+ total:
1691
+ | SpendForecastMeasures
1692
+ | undefined;
1693
+ /**
1694
+ * One breakdown per AISpendForecastDimension. Each partitions total's month_to_date_usd and
1695
+ * projection.expected_usd exactly; a group's low_usd and high_usd do not sum to total's.
1696
+ */
1697
+ breakdowns: SpendForecastBreakdown[];
1698
+ asOf: Date | undefined;
1699
+ }
1700
+
1701
+ export interface SpendForecastBreakdown {
1702
+ dimension: AISpendForecastDimension;
1703
+ /** ascending by key */
1704
+ groups: SpendForecastGroup[];
1705
+ }
1706
+
1707
+ /** An empty key is cost that recorded none. */
1708
+ export interface SpendForecastGroup {
1709
+ key: string;
1710
+ measures: SpendForecastMeasures | undefined;
1711
+ }
1712
+
1713
+ export interface SpendForecastMeasures {
1714
+ monthToDateUsd: number;
1715
+ /** absent when history_weeks is 0 */
1716
+ projection: SpendProjection | undefined;
1717
+ }
1718
+
1719
+ /**
1720
+ * SpendProjection is the projected month-end total, month to date included: the mean, the quietest and the
1721
+ * busiest of the history weeks replayed weekday by weekday over the rest of the month.
1722
+ */
1723
+ export interface SpendProjection {
1724
+ expectedUsd: number;
1725
+ lowUsd: number;
1726
+ highUsd: number;
1727
+ }
1728
+
1586
1729
  export interface ActivityRhythmRequest {
1587
1730
  organizationId: string;
1588
1731
  projectId: string;
@@ -1780,11 +1923,14 @@ export interface ModelActivity {
1780
1923
  toolCalls: number;
1781
1924
  compactions: number;
1782
1925
  subagentRuns: number;
1926
+ /** Time to first token over the status-known calls that report a positive one, and those calls. */
1783
1927
  ttftMsSum: number;
1784
1928
  ttftCalls: number;
1785
1929
  providers: string[];
1786
1930
  /** busiest first, at most 200; user id, else api key */
1787
1931
  principals: ModelActivityPrincipal[];
1932
+ /** Calls that reported a status, the denominator of failed_calls; absent (an older backend) means unavailable. */
1933
+ settledCalls?: number | undefined;
1788
1934
  }
1789
1935
 
1790
1936
  export interface ModelActivityPrincipal {
@@ -11674,28 +11820,25 @@ export const DailyActivityMeasures: MessageFns<DailyActivityMeasures> = {
11674
11820
  },
11675
11821
  };
11676
11822
 
11677
- function createBaseActivityRhythmRequest(): ActivityRhythmRequest {
11678
- return { organizationId: "", projectId: "", timeWindow: 0, timeZone: "" };
11823
+ function createBaseSpendForecastRequest(): SpendForecastRequest {
11824
+ return { organizationId: "", projectId: "", filter: undefined };
11679
11825
  }
11680
11826
 
11681
- export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11682
- encode(message: ActivityRhythmRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11827
+ export const SpendForecastRequest: MessageFns<SpendForecastRequest> = {
11828
+ encode(message: SpendForecastRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11683
11829
  if (message.organizationId !== "") {
11684
11830
  writer.uint32(10).string(message.organizationId);
11685
11831
  }
11686
11832
  if (message.projectId !== "") {
11687
11833
  writer.uint32(18).string(message.projectId);
11688
11834
  }
11689
- if (message.timeWindow !== 0) {
11690
- writer.uint32(24).int32(message.timeWindow);
11691
- }
11692
- if (message.timeZone !== "") {
11693
- writer.uint32(34).string(message.timeZone);
11835
+ if (message.filter !== undefined) {
11836
+ SpendForecastFilter.encode(message.filter, writer.uint32(26).fork()).join();
11694
11837
  }
11695
11838
  return writer;
11696
11839
  },
11697
11840
 
11698
- decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythmRequest {
11841
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastRequest {
11699
11842
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11700
11843
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11701
11844
  if (previousRecursionDepth >= 100) {
@@ -11704,7 +11847,7 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11704
11847
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11705
11848
  try {
11706
11849
  const end = length === undefined ? reader.len : reader.pos + length;
11707
- const message = createBaseActivityRhythmRequest();
11850
+ const message = createBaseSpendForecastRequest();
11708
11851
  while (reader.pos < end) {
11709
11852
  const tag = reader.uint32();
11710
11853
  switch (tag >>> 3) {
@@ -11725,19 +11868,11 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11725
11868
  continue;
11726
11869
  }
11727
11870
  case 3: {
11728
- if (tag !== 24) {
11729
- break;
11730
- }
11731
-
11732
- message.timeWindow = reader.int32() as any;
11733
- continue;
11734
- }
11735
- case 4: {
11736
- if (tag !== 34) {
11871
+ if (tag !== 26) {
11737
11872
  break;
11738
11873
  }
11739
11874
 
11740
- message.timeZone = reader.string();
11875
+ message.filter = SpendForecastFilter.decode(reader, reader.uint32());
11741
11876
  continue;
11742
11877
  }
11743
11878
  }
@@ -11752,7 +11887,7 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11752
11887
  }
11753
11888
  },
11754
11889
 
11755
- fromJSON(object: any): ActivityRhythmRequest {
11890
+ fromJSON(object: any): SpendForecastRequest {
11756
11891
  return {
11757
11892
  organizationId: isSet(object.organizationId)
11758
11893
  ? globalThis.String(object.organizationId)
@@ -11764,20 +11899,11 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11764
11899
  : isSet(object.project_id)
11765
11900
  ? globalThis.String(object.project_id)
11766
11901
  : "",
11767
- timeWindow: isSet(object.timeWindow)
11768
- ? analyticsTimeWindowFromJSON(object.timeWindow)
11769
- : isSet(object.time_window)
11770
- ? analyticsTimeWindowFromJSON(object.time_window)
11771
- : 0,
11772
- timeZone: isSet(object.timeZone)
11773
- ? globalThis.String(object.timeZone)
11774
- : isSet(object.time_zone)
11775
- ? globalThis.String(object.time_zone)
11776
- : "",
11902
+ filter: isSet(object.filter) ? SpendForecastFilter.fromJSON(object.filter) : undefined,
11777
11903
  };
11778
11904
  },
11779
11905
 
11780
- toJSON(message: ActivityRhythmRequest): unknown {
11906
+ toJSON(message: SpendForecastRequest): unknown {
11781
11907
  const obj: any = {};
11782
11908
  if (message.organizationId !== "") {
11783
11909
  obj.organizationId = message.organizationId;
@@ -11785,53 +11911,152 @@ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
11785
11911
  if (message.projectId !== "") {
11786
11912
  obj.projectId = message.projectId;
11787
11913
  }
11788
- if (message.timeWindow !== 0) {
11789
- obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
11790
- }
11791
- if (message.timeZone !== "") {
11792
- obj.timeZone = message.timeZone;
11914
+ if (message.filter !== undefined) {
11915
+ obj.filter = SpendForecastFilter.toJSON(message.filter);
11793
11916
  }
11794
11917
  return obj;
11795
11918
  },
11796
11919
 
11797
- create<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(base?: I): ActivityRhythmRequest {
11798
- return ActivityRhythmRequest.fromPartial(base ?? ({} as any));
11920
+ create<I extends Exact<DeepPartial<SpendForecastRequest>, I>>(base?: I): SpendForecastRequest {
11921
+ return SpendForecastRequest.fromPartial(base ?? ({} as any));
11799
11922
  },
11800
- fromPartial<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(object: I): ActivityRhythmRequest {
11801
- const message = createBaseActivityRhythmRequest();
11923
+ fromPartial<I extends Exact<DeepPartial<SpendForecastRequest>, I>>(object: I): SpendForecastRequest {
11924
+ const message = createBaseSpendForecastRequest();
11802
11925
  message.organizationId = object.organizationId ?? "";
11803
11926
  message.projectId = object.projectId ?? "";
11804
- message.timeWindow = object.timeWindow ?? 0;
11805
- message.timeZone = object.timeZone ?? "";
11927
+ message.filter = (object.filter !== undefined && object.filter !== null)
11928
+ ? SpendForecastFilter.fromPartial(object.filter)
11929
+ : undefined;
11806
11930
  return message;
11807
11931
  },
11808
11932
  };
11809
11933
 
11810
- function createBaseActivityRhythm(): ActivityRhythm {
11811
- return { buckets: [], windowStart: undefined, windowEnd: undefined, asOf: undefined, timeZone: "" };
11934
+ function createBaseSpendForecastFilter(): SpendForecastFilter {
11935
+ return { fundingModes: [] };
11812
11936
  }
11813
11937
 
11814
- export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11815
- encode(message: ActivityRhythm, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11816
- for (const v of message.buckets) {
11817
- ActivityRhythmBucket.encode(v!, writer.uint32(10).fork()).join();
11938
+ export const SpendForecastFilter: MessageFns<SpendForecastFilter> = {
11939
+ encode(message: SpendForecastFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
11940
+ for (const v of message.fundingModes) {
11941
+ writer.uint32(8).int32(v!);
11818
11942
  }
11819
- if (message.windowStart !== undefined) {
11820
- Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(18).fork()).join();
11943
+ return writer;
11944
+ },
11945
+
11946
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastFilter {
11947
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11948
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11949
+ if (previousRecursionDepth >= 100) {
11950
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
11821
11951
  }
11822
- if (message.windowEnd !== undefined) {
11823
- Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(26).fork()).join();
11952
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11953
+ try {
11954
+ const end = length === undefined ? reader.len : reader.pos + length;
11955
+ const message = createBaseSpendForecastFilter();
11956
+ while (reader.pos < end) {
11957
+ const tag = reader.uint32();
11958
+ switch (tag >>> 3) {
11959
+ case 1: {
11960
+ if (tag === 8) {
11961
+ message.fundingModes.push(reader.int32() as any);
11962
+
11963
+ continue;
11964
+ }
11965
+
11966
+ if (tag === 10) {
11967
+ const end2 = reader.uint32() + reader.pos;
11968
+ while (reader.pos < end2) {
11969
+ message.fundingModes.push(reader.int32() as any);
11970
+ }
11971
+
11972
+ continue;
11973
+ }
11974
+
11975
+ break;
11976
+ }
11977
+ }
11978
+ if ((tag & 7) === 4 || tag === 0) {
11979
+ break;
11980
+ }
11981
+ reader.skip(tag & 7);
11982
+ }
11983
+ return message;
11984
+ } finally {
11985
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
11824
11986
  }
11825
- if (message.asOf !== undefined) {
11826
- Timestamp.encode(toTimestamp(message.asOf), writer.uint32(34).fork()).join();
11987
+ },
11988
+
11989
+ fromJSON(object: any): SpendForecastFilter {
11990
+ return {
11991
+ fundingModes: globalThis.Array.isArray(object?.fundingModes)
11992
+ ? object.fundingModes.map((e: any) => aIFundingModeFromJSON(e))
11993
+ : globalThis.Array.isArray(object?.funding_modes)
11994
+ ? object.funding_modes.map((e: any) => aIFundingModeFromJSON(e))
11995
+ : [],
11996
+ };
11997
+ },
11998
+
11999
+ toJSON(message: SpendForecastFilter): unknown {
12000
+ const obj: any = {};
12001
+ if (message.fundingModes?.length) {
12002
+ obj.fundingModes = message.fundingModes.map((e) => aIFundingModeToJSON(e));
11827
12003
  }
11828
- if (message.timeZone !== "") {
11829
- writer.uint32(42).string(message.timeZone);
12004
+ return obj;
12005
+ },
12006
+
12007
+ create<I extends Exact<DeepPartial<SpendForecastFilter>, I>>(base?: I): SpendForecastFilter {
12008
+ return SpendForecastFilter.fromPartial(base ?? ({} as any));
12009
+ },
12010
+ fromPartial<I extends Exact<DeepPartial<SpendForecastFilter>, I>>(object: I): SpendForecastFilter {
12011
+ const message = createBaseSpendForecastFilter();
12012
+ message.fundingModes = object.fundingModes?.map((e) => e) || [];
12013
+ return message;
12014
+ },
12015
+ };
12016
+
12017
+ function createBaseSpendForecast(): SpendForecast {
12018
+ return {
12019
+ periodStart: "",
12020
+ periodEnd: "",
12021
+ today: "",
12022
+ coverageStart: "",
12023
+ historyWeeks: 0,
12024
+ total: undefined,
12025
+ breakdowns: [],
12026
+ asOf: undefined,
12027
+ };
12028
+ }
12029
+
12030
+ export const SpendForecast: MessageFns<SpendForecast> = {
12031
+ encode(message: SpendForecast, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12032
+ if (message.periodStart !== "") {
12033
+ writer.uint32(10).string(message.periodStart);
12034
+ }
12035
+ if (message.periodEnd !== "") {
12036
+ writer.uint32(18).string(message.periodEnd);
12037
+ }
12038
+ if (message.today !== "") {
12039
+ writer.uint32(26).string(message.today);
12040
+ }
12041
+ if (message.coverageStart !== "") {
12042
+ writer.uint32(34).string(message.coverageStart);
12043
+ }
12044
+ if (message.historyWeeks !== 0) {
12045
+ writer.uint32(40).uint32(message.historyWeeks);
12046
+ }
12047
+ if (message.total !== undefined) {
12048
+ SpendForecastMeasures.encode(message.total, writer.uint32(50).fork()).join();
12049
+ }
12050
+ for (const v of message.breakdowns) {
12051
+ SpendForecastBreakdown.encode(v!, writer.uint32(58).fork()).join();
12052
+ }
12053
+ if (message.asOf !== undefined) {
12054
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(66).fork()).join();
11830
12055
  }
11831
12056
  return writer;
11832
12057
  },
11833
12058
 
11834
- decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythm {
12059
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecast {
11835
12060
  const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
11836
12061
  const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
11837
12062
  if (previousRecursionDepth >= 100) {
@@ -11840,7 +12065,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11840
12065
  (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
11841
12066
  try {
11842
12067
  const end = length === undefined ? reader.len : reader.pos + length;
11843
- const message = createBaseActivityRhythm();
12068
+ const message = createBaseSpendForecast();
11844
12069
  while (reader.pos < end) {
11845
12070
  const tag = reader.uint32();
11846
12071
  switch (tag >>> 3) {
@@ -11849,7 +12074,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11849
12074
  break;
11850
12075
  }
11851
12076
 
11852
- message.buckets.push(ActivityRhythmBucket.decode(reader, reader.uint32()));
12077
+ message.periodStart = reader.string();
11853
12078
  continue;
11854
12079
  }
11855
12080
  case 2: {
@@ -11857,7 +12082,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11857
12082
  break;
11858
12083
  }
11859
12084
 
11860
- message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12085
+ message.periodEnd = reader.string();
11861
12086
  continue;
11862
12087
  }
11863
12088
  case 3: {
@@ -11865,7 +12090,7 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11865
12090
  break;
11866
12091
  }
11867
12092
 
11868
- message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12093
+ message.today = reader.string();
11869
12094
  continue;
11870
12095
  }
11871
12096
  case 4: {
@@ -11873,15 +12098,39 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11873
12098
  break;
11874
12099
  }
11875
12100
 
11876
- message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12101
+ message.coverageStart = reader.string();
11877
12102
  continue;
11878
12103
  }
11879
12104
  case 5: {
11880
- if (tag !== 42) {
12105
+ if (tag !== 40) {
11881
12106
  break;
11882
12107
  }
11883
12108
 
11884
- message.timeZone = reader.string();
12109
+ message.historyWeeks = reader.uint32();
12110
+ continue;
12111
+ }
12112
+ case 6: {
12113
+ if (tag !== 50) {
12114
+ break;
12115
+ }
12116
+
12117
+ message.total = SpendForecastMeasures.decode(reader, reader.uint32());
12118
+ continue;
12119
+ }
12120
+ case 7: {
12121
+ if (tag !== 58) {
12122
+ break;
12123
+ }
12124
+
12125
+ message.breakdowns.push(SpendForecastBreakdown.decode(reader, reader.uint32()));
12126
+ continue;
12127
+ }
12128
+ case 8: {
12129
+ if (tag !== 66) {
12130
+ break;
12131
+ }
12132
+
12133
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
11885
12134
  continue;
11886
12135
  }
11887
12136
  }
@@ -11896,43 +12145,726 @@ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
11896
12145
  }
11897
12146
  },
11898
12147
 
11899
- fromJSON(object: any): ActivityRhythm {
12148
+ fromJSON(object: any): SpendForecast {
11900
12149
  return {
11901
- buckets: globalThis.Array.isArray(object?.buckets)
11902
- ? object.buckets.map((e: any) => ActivityRhythmBucket.fromJSON(e))
12150
+ periodStart: isSet(object.periodStart)
12151
+ ? globalThis.String(object.periodStart)
12152
+ : isSet(object.period_start)
12153
+ ? globalThis.String(object.period_start)
12154
+ : "",
12155
+ periodEnd: isSet(object.periodEnd)
12156
+ ? globalThis.String(object.periodEnd)
12157
+ : isSet(object.period_end)
12158
+ ? globalThis.String(object.period_end)
12159
+ : "",
12160
+ today: isSet(object.today) ? globalThis.String(object.today) : "",
12161
+ coverageStart: isSet(object.coverageStart)
12162
+ ? globalThis.String(object.coverageStart)
12163
+ : isSet(object.coverage_start)
12164
+ ? globalThis.String(object.coverage_start)
12165
+ : "",
12166
+ historyWeeks: isSet(object.historyWeeks)
12167
+ ? globalThis.Number(object.historyWeeks)
12168
+ : isSet(object.history_weeks)
12169
+ ? globalThis.Number(object.history_weeks)
12170
+ : 0,
12171
+ total: isSet(object.total) ? SpendForecastMeasures.fromJSON(object.total) : undefined,
12172
+ breakdowns: globalThis.Array.isArray(object?.breakdowns)
12173
+ ? object.breakdowns.map((e: any) => SpendForecastBreakdown.fromJSON(e))
11903
12174
  : [],
11904
- windowStart: isSet(object.windowStart)
11905
- ? fromJsonTimestamp(object.windowStart)
11906
- : isSet(object.window_start)
11907
- ? fromJsonTimestamp(object.window_start)
11908
- : undefined,
11909
- windowEnd: isSet(object.windowEnd)
11910
- ? fromJsonTimestamp(object.windowEnd)
11911
- : isSet(object.window_end)
11912
- ? fromJsonTimestamp(object.window_end)
11913
- : undefined,
11914
12175
  asOf: isSet(object.asOf)
11915
12176
  ? fromJsonTimestamp(object.asOf)
11916
12177
  : isSet(object.as_of)
11917
12178
  ? fromJsonTimestamp(object.as_of)
11918
12179
  : undefined,
11919
- timeZone: isSet(object.timeZone)
11920
- ? globalThis.String(object.timeZone)
11921
- : isSet(object.time_zone)
11922
- ? globalThis.String(object.time_zone)
11923
- : "",
11924
12180
  };
11925
12181
  },
11926
12182
 
11927
- toJSON(message: ActivityRhythm): unknown {
12183
+ toJSON(message: SpendForecast): unknown {
11928
12184
  const obj: any = {};
11929
- if (message.buckets?.length) {
11930
- obj.buckets = message.buckets.map((e) => ActivityRhythmBucket.toJSON(e));
12185
+ if (message.periodStart !== "") {
12186
+ obj.periodStart = message.periodStart;
11931
12187
  }
11932
- if (message.windowStart !== undefined) {
11933
- obj.windowStart = message.windowStart.toISOString();
12188
+ if (message.periodEnd !== "") {
12189
+ obj.periodEnd = message.periodEnd;
11934
12190
  }
11935
- if (message.windowEnd !== undefined) {
12191
+ if (message.today !== "") {
12192
+ obj.today = message.today;
12193
+ }
12194
+ if (message.coverageStart !== "") {
12195
+ obj.coverageStart = message.coverageStart;
12196
+ }
12197
+ if (message.historyWeeks !== 0) {
12198
+ obj.historyWeeks = Math.round(message.historyWeeks);
12199
+ }
12200
+ if (message.total !== undefined) {
12201
+ obj.total = SpendForecastMeasures.toJSON(message.total);
12202
+ }
12203
+ if (message.breakdowns?.length) {
12204
+ obj.breakdowns = message.breakdowns.map((e) => SpendForecastBreakdown.toJSON(e));
12205
+ }
12206
+ if (message.asOf !== undefined) {
12207
+ obj.asOf = message.asOf.toISOString();
12208
+ }
12209
+ return obj;
12210
+ },
12211
+
12212
+ create<I extends Exact<DeepPartial<SpendForecast>, I>>(base?: I): SpendForecast {
12213
+ return SpendForecast.fromPartial(base ?? ({} as any));
12214
+ },
12215
+ fromPartial<I extends Exact<DeepPartial<SpendForecast>, I>>(object: I): SpendForecast {
12216
+ const message = createBaseSpendForecast();
12217
+ message.periodStart = object.periodStart ?? "";
12218
+ message.periodEnd = object.periodEnd ?? "";
12219
+ message.today = object.today ?? "";
12220
+ message.coverageStart = object.coverageStart ?? "";
12221
+ message.historyWeeks = object.historyWeeks ?? 0;
12222
+ message.total = (object.total !== undefined && object.total !== null)
12223
+ ? SpendForecastMeasures.fromPartial(object.total)
12224
+ : undefined;
12225
+ message.breakdowns = object.breakdowns?.map((e) => SpendForecastBreakdown.fromPartial(e)) || [];
12226
+ message.asOf = object.asOf ?? undefined;
12227
+ return message;
12228
+ },
12229
+ };
12230
+
12231
+ function createBaseSpendForecastBreakdown(): SpendForecastBreakdown {
12232
+ return { dimension: 0, groups: [] };
12233
+ }
12234
+
12235
+ export const SpendForecastBreakdown: MessageFns<SpendForecastBreakdown> = {
12236
+ encode(message: SpendForecastBreakdown, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12237
+ if (message.dimension !== 0) {
12238
+ writer.uint32(8).int32(message.dimension);
12239
+ }
12240
+ for (const v of message.groups) {
12241
+ SpendForecastGroup.encode(v!, writer.uint32(18).fork()).join();
12242
+ }
12243
+ return writer;
12244
+ },
12245
+
12246
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastBreakdown {
12247
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12248
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12249
+ if (previousRecursionDepth >= 100) {
12250
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12251
+ }
12252
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12253
+ try {
12254
+ const end = length === undefined ? reader.len : reader.pos + length;
12255
+ const message = createBaseSpendForecastBreakdown();
12256
+ while (reader.pos < end) {
12257
+ const tag = reader.uint32();
12258
+ switch (tag >>> 3) {
12259
+ case 1: {
12260
+ if (tag !== 8) {
12261
+ break;
12262
+ }
12263
+
12264
+ message.dimension = reader.int32() as any;
12265
+ continue;
12266
+ }
12267
+ case 2: {
12268
+ if (tag !== 18) {
12269
+ break;
12270
+ }
12271
+
12272
+ message.groups.push(SpendForecastGroup.decode(reader, reader.uint32()));
12273
+ continue;
12274
+ }
12275
+ }
12276
+ if ((tag & 7) === 4 || tag === 0) {
12277
+ break;
12278
+ }
12279
+ reader.skip(tag & 7);
12280
+ }
12281
+ return message;
12282
+ } finally {
12283
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12284
+ }
12285
+ },
12286
+
12287
+ fromJSON(object: any): SpendForecastBreakdown {
12288
+ return {
12289
+ dimension: isSet(object.dimension) ? aISpendForecastDimensionFromJSON(object.dimension) : 0,
12290
+ groups: globalThis.Array.isArray(object?.groups)
12291
+ ? object.groups.map((e: any) => SpendForecastGroup.fromJSON(e))
12292
+ : [],
12293
+ };
12294
+ },
12295
+
12296
+ toJSON(message: SpendForecastBreakdown): unknown {
12297
+ const obj: any = {};
12298
+ if (message.dimension !== 0) {
12299
+ obj.dimension = aISpendForecastDimensionToJSON(message.dimension);
12300
+ }
12301
+ if (message.groups?.length) {
12302
+ obj.groups = message.groups.map((e) => SpendForecastGroup.toJSON(e));
12303
+ }
12304
+ return obj;
12305
+ },
12306
+
12307
+ create<I extends Exact<DeepPartial<SpendForecastBreakdown>, I>>(base?: I): SpendForecastBreakdown {
12308
+ return SpendForecastBreakdown.fromPartial(base ?? ({} as any));
12309
+ },
12310
+ fromPartial<I extends Exact<DeepPartial<SpendForecastBreakdown>, I>>(object: I): SpendForecastBreakdown {
12311
+ const message = createBaseSpendForecastBreakdown();
12312
+ message.dimension = object.dimension ?? 0;
12313
+ message.groups = object.groups?.map((e) => SpendForecastGroup.fromPartial(e)) || [];
12314
+ return message;
12315
+ },
12316
+ };
12317
+
12318
+ function createBaseSpendForecastGroup(): SpendForecastGroup {
12319
+ return { key: "", measures: undefined };
12320
+ }
12321
+
12322
+ export const SpendForecastGroup: MessageFns<SpendForecastGroup> = {
12323
+ encode(message: SpendForecastGroup, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12324
+ if (message.key !== "") {
12325
+ writer.uint32(10).string(message.key);
12326
+ }
12327
+ if (message.measures !== undefined) {
12328
+ SpendForecastMeasures.encode(message.measures, writer.uint32(18).fork()).join();
12329
+ }
12330
+ return writer;
12331
+ },
12332
+
12333
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastGroup {
12334
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12335
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12336
+ if (previousRecursionDepth >= 100) {
12337
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12338
+ }
12339
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12340
+ try {
12341
+ const end = length === undefined ? reader.len : reader.pos + length;
12342
+ const message = createBaseSpendForecastGroup();
12343
+ while (reader.pos < end) {
12344
+ const tag = reader.uint32();
12345
+ switch (tag >>> 3) {
12346
+ case 1: {
12347
+ if (tag !== 10) {
12348
+ break;
12349
+ }
12350
+
12351
+ message.key = reader.string();
12352
+ continue;
12353
+ }
12354
+ case 2: {
12355
+ if (tag !== 18) {
12356
+ break;
12357
+ }
12358
+
12359
+ message.measures = SpendForecastMeasures.decode(reader, reader.uint32());
12360
+ continue;
12361
+ }
12362
+ }
12363
+ if ((tag & 7) === 4 || tag === 0) {
12364
+ break;
12365
+ }
12366
+ reader.skip(tag & 7);
12367
+ }
12368
+ return message;
12369
+ } finally {
12370
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12371
+ }
12372
+ },
12373
+
12374
+ fromJSON(object: any): SpendForecastGroup {
12375
+ return {
12376
+ key: isSet(object.key) ? globalThis.String(object.key) : "",
12377
+ measures: isSet(object.measures) ? SpendForecastMeasures.fromJSON(object.measures) : undefined,
12378
+ };
12379
+ },
12380
+
12381
+ toJSON(message: SpendForecastGroup): unknown {
12382
+ const obj: any = {};
12383
+ if (message.key !== "") {
12384
+ obj.key = message.key;
12385
+ }
12386
+ if (message.measures !== undefined) {
12387
+ obj.measures = SpendForecastMeasures.toJSON(message.measures);
12388
+ }
12389
+ return obj;
12390
+ },
12391
+
12392
+ create<I extends Exact<DeepPartial<SpendForecastGroup>, I>>(base?: I): SpendForecastGroup {
12393
+ return SpendForecastGroup.fromPartial(base ?? ({} as any));
12394
+ },
12395
+ fromPartial<I extends Exact<DeepPartial<SpendForecastGroup>, I>>(object: I): SpendForecastGroup {
12396
+ const message = createBaseSpendForecastGroup();
12397
+ message.key = object.key ?? "";
12398
+ message.measures = (object.measures !== undefined && object.measures !== null)
12399
+ ? SpendForecastMeasures.fromPartial(object.measures)
12400
+ : undefined;
12401
+ return message;
12402
+ },
12403
+ };
12404
+
12405
+ function createBaseSpendForecastMeasures(): SpendForecastMeasures {
12406
+ return { monthToDateUsd: 0, projection: undefined };
12407
+ }
12408
+
12409
+ export const SpendForecastMeasures: MessageFns<SpendForecastMeasures> = {
12410
+ encode(message: SpendForecastMeasures, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12411
+ if (message.monthToDateUsd !== 0) {
12412
+ writer.uint32(9).double(message.monthToDateUsd);
12413
+ }
12414
+ if (message.projection !== undefined) {
12415
+ SpendProjection.encode(message.projection, writer.uint32(18).fork()).join();
12416
+ }
12417
+ return writer;
12418
+ },
12419
+
12420
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendForecastMeasures {
12421
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12422
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12423
+ if (previousRecursionDepth >= 100) {
12424
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12425
+ }
12426
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12427
+ try {
12428
+ const end = length === undefined ? reader.len : reader.pos + length;
12429
+ const message = createBaseSpendForecastMeasures();
12430
+ while (reader.pos < end) {
12431
+ const tag = reader.uint32();
12432
+ switch (tag >>> 3) {
12433
+ case 1: {
12434
+ if (tag !== 9) {
12435
+ break;
12436
+ }
12437
+
12438
+ message.monthToDateUsd = reader.double();
12439
+ continue;
12440
+ }
12441
+ case 2: {
12442
+ if (tag !== 18) {
12443
+ break;
12444
+ }
12445
+
12446
+ message.projection = SpendProjection.decode(reader, reader.uint32());
12447
+ continue;
12448
+ }
12449
+ }
12450
+ if ((tag & 7) === 4 || tag === 0) {
12451
+ break;
12452
+ }
12453
+ reader.skip(tag & 7);
12454
+ }
12455
+ return message;
12456
+ } finally {
12457
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12458
+ }
12459
+ },
12460
+
12461
+ fromJSON(object: any): SpendForecastMeasures {
12462
+ return {
12463
+ monthToDateUsd: isSet(object.monthToDateUsd)
12464
+ ? globalThis.Number(object.monthToDateUsd)
12465
+ : isSet(object.month_to_date_usd)
12466
+ ? globalThis.Number(object.month_to_date_usd)
12467
+ : 0,
12468
+ projection: isSet(object.projection) ? SpendProjection.fromJSON(object.projection) : undefined,
12469
+ };
12470
+ },
12471
+
12472
+ toJSON(message: SpendForecastMeasures): unknown {
12473
+ const obj: any = {};
12474
+ if (message.monthToDateUsd !== 0) {
12475
+ obj.monthToDateUsd = floatToJson(message.monthToDateUsd);
12476
+ }
12477
+ if (message.projection !== undefined) {
12478
+ obj.projection = SpendProjection.toJSON(message.projection);
12479
+ }
12480
+ return obj;
12481
+ },
12482
+
12483
+ create<I extends Exact<DeepPartial<SpendForecastMeasures>, I>>(base?: I): SpendForecastMeasures {
12484
+ return SpendForecastMeasures.fromPartial(base ?? ({} as any));
12485
+ },
12486
+ fromPartial<I extends Exact<DeepPartial<SpendForecastMeasures>, I>>(object: I): SpendForecastMeasures {
12487
+ const message = createBaseSpendForecastMeasures();
12488
+ message.monthToDateUsd = object.monthToDateUsd ?? 0;
12489
+ message.projection = (object.projection !== undefined && object.projection !== null)
12490
+ ? SpendProjection.fromPartial(object.projection)
12491
+ : undefined;
12492
+ return message;
12493
+ },
12494
+ };
12495
+
12496
+ function createBaseSpendProjection(): SpendProjection {
12497
+ return { expectedUsd: 0, lowUsd: 0, highUsd: 0 };
12498
+ }
12499
+
12500
+ export const SpendProjection: MessageFns<SpendProjection> = {
12501
+ encode(message: SpendProjection, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12502
+ if (message.expectedUsd !== 0) {
12503
+ writer.uint32(9).double(message.expectedUsd);
12504
+ }
12505
+ if (message.lowUsd !== 0) {
12506
+ writer.uint32(17).double(message.lowUsd);
12507
+ }
12508
+ if (message.highUsd !== 0) {
12509
+ writer.uint32(25).double(message.highUsd);
12510
+ }
12511
+ return writer;
12512
+ },
12513
+
12514
+ decode(input: BinaryReader | Uint8Array, length?: number): SpendProjection {
12515
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12516
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12517
+ if (previousRecursionDepth >= 100) {
12518
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12519
+ }
12520
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12521
+ try {
12522
+ const end = length === undefined ? reader.len : reader.pos + length;
12523
+ const message = createBaseSpendProjection();
12524
+ while (reader.pos < end) {
12525
+ const tag = reader.uint32();
12526
+ switch (tag >>> 3) {
12527
+ case 1: {
12528
+ if (tag !== 9) {
12529
+ break;
12530
+ }
12531
+
12532
+ message.expectedUsd = reader.double();
12533
+ continue;
12534
+ }
12535
+ case 2: {
12536
+ if (tag !== 17) {
12537
+ break;
12538
+ }
12539
+
12540
+ message.lowUsd = reader.double();
12541
+ continue;
12542
+ }
12543
+ case 3: {
12544
+ if (tag !== 25) {
12545
+ break;
12546
+ }
12547
+
12548
+ message.highUsd = reader.double();
12549
+ continue;
12550
+ }
12551
+ }
12552
+ if ((tag & 7) === 4 || tag === 0) {
12553
+ break;
12554
+ }
12555
+ reader.skip(tag & 7);
12556
+ }
12557
+ return message;
12558
+ } finally {
12559
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12560
+ }
12561
+ },
12562
+
12563
+ fromJSON(object: any): SpendProjection {
12564
+ return {
12565
+ expectedUsd: isSet(object.expectedUsd)
12566
+ ? globalThis.Number(object.expectedUsd)
12567
+ : isSet(object.expected_usd)
12568
+ ? globalThis.Number(object.expected_usd)
12569
+ : 0,
12570
+ lowUsd: isSet(object.lowUsd)
12571
+ ? globalThis.Number(object.lowUsd)
12572
+ : isSet(object.low_usd)
12573
+ ? globalThis.Number(object.low_usd)
12574
+ : 0,
12575
+ highUsd: isSet(object.highUsd)
12576
+ ? globalThis.Number(object.highUsd)
12577
+ : isSet(object.high_usd)
12578
+ ? globalThis.Number(object.high_usd)
12579
+ : 0,
12580
+ };
12581
+ },
12582
+
12583
+ toJSON(message: SpendProjection): unknown {
12584
+ const obj: any = {};
12585
+ if (message.expectedUsd !== 0) {
12586
+ obj.expectedUsd = floatToJson(message.expectedUsd);
12587
+ }
12588
+ if (message.lowUsd !== 0) {
12589
+ obj.lowUsd = floatToJson(message.lowUsd);
12590
+ }
12591
+ if (message.highUsd !== 0) {
12592
+ obj.highUsd = floatToJson(message.highUsd);
12593
+ }
12594
+ return obj;
12595
+ },
12596
+
12597
+ create<I extends Exact<DeepPartial<SpendProjection>, I>>(base?: I): SpendProjection {
12598
+ return SpendProjection.fromPartial(base ?? ({} as any));
12599
+ },
12600
+ fromPartial<I extends Exact<DeepPartial<SpendProjection>, I>>(object: I): SpendProjection {
12601
+ const message = createBaseSpendProjection();
12602
+ message.expectedUsd = object.expectedUsd ?? 0;
12603
+ message.lowUsd = object.lowUsd ?? 0;
12604
+ message.highUsd = object.highUsd ?? 0;
12605
+ return message;
12606
+ },
12607
+ };
12608
+
12609
+ function createBaseActivityRhythmRequest(): ActivityRhythmRequest {
12610
+ return { organizationId: "", projectId: "", timeWindow: 0, timeZone: "" };
12611
+ }
12612
+
12613
+ export const ActivityRhythmRequest: MessageFns<ActivityRhythmRequest> = {
12614
+ encode(message: ActivityRhythmRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12615
+ if (message.organizationId !== "") {
12616
+ writer.uint32(10).string(message.organizationId);
12617
+ }
12618
+ if (message.projectId !== "") {
12619
+ writer.uint32(18).string(message.projectId);
12620
+ }
12621
+ if (message.timeWindow !== 0) {
12622
+ writer.uint32(24).int32(message.timeWindow);
12623
+ }
12624
+ if (message.timeZone !== "") {
12625
+ writer.uint32(34).string(message.timeZone);
12626
+ }
12627
+ return writer;
12628
+ },
12629
+
12630
+ decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythmRequest {
12631
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12632
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12633
+ if (previousRecursionDepth >= 100) {
12634
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12635
+ }
12636
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12637
+ try {
12638
+ const end = length === undefined ? reader.len : reader.pos + length;
12639
+ const message = createBaseActivityRhythmRequest();
12640
+ while (reader.pos < end) {
12641
+ const tag = reader.uint32();
12642
+ switch (tag >>> 3) {
12643
+ case 1: {
12644
+ if (tag !== 10) {
12645
+ break;
12646
+ }
12647
+
12648
+ message.organizationId = reader.string();
12649
+ continue;
12650
+ }
12651
+ case 2: {
12652
+ if (tag !== 18) {
12653
+ break;
12654
+ }
12655
+
12656
+ message.projectId = reader.string();
12657
+ continue;
12658
+ }
12659
+ case 3: {
12660
+ if (tag !== 24) {
12661
+ break;
12662
+ }
12663
+
12664
+ message.timeWindow = reader.int32() as any;
12665
+ continue;
12666
+ }
12667
+ case 4: {
12668
+ if (tag !== 34) {
12669
+ break;
12670
+ }
12671
+
12672
+ message.timeZone = reader.string();
12673
+ continue;
12674
+ }
12675
+ }
12676
+ if ((tag & 7) === 4 || tag === 0) {
12677
+ break;
12678
+ }
12679
+ reader.skip(tag & 7);
12680
+ }
12681
+ return message;
12682
+ } finally {
12683
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12684
+ }
12685
+ },
12686
+
12687
+ fromJSON(object: any): ActivityRhythmRequest {
12688
+ return {
12689
+ organizationId: isSet(object.organizationId)
12690
+ ? globalThis.String(object.organizationId)
12691
+ : isSet(object.organization_id)
12692
+ ? globalThis.String(object.organization_id)
12693
+ : "",
12694
+ projectId: isSet(object.projectId)
12695
+ ? globalThis.String(object.projectId)
12696
+ : isSet(object.project_id)
12697
+ ? globalThis.String(object.project_id)
12698
+ : "",
12699
+ timeWindow: isSet(object.timeWindow)
12700
+ ? analyticsTimeWindowFromJSON(object.timeWindow)
12701
+ : isSet(object.time_window)
12702
+ ? analyticsTimeWindowFromJSON(object.time_window)
12703
+ : 0,
12704
+ timeZone: isSet(object.timeZone)
12705
+ ? globalThis.String(object.timeZone)
12706
+ : isSet(object.time_zone)
12707
+ ? globalThis.String(object.time_zone)
12708
+ : "",
12709
+ };
12710
+ },
12711
+
12712
+ toJSON(message: ActivityRhythmRequest): unknown {
12713
+ const obj: any = {};
12714
+ if (message.organizationId !== "") {
12715
+ obj.organizationId = message.organizationId;
12716
+ }
12717
+ if (message.projectId !== "") {
12718
+ obj.projectId = message.projectId;
12719
+ }
12720
+ if (message.timeWindow !== 0) {
12721
+ obj.timeWindow = analyticsTimeWindowToJSON(message.timeWindow);
12722
+ }
12723
+ if (message.timeZone !== "") {
12724
+ obj.timeZone = message.timeZone;
12725
+ }
12726
+ return obj;
12727
+ },
12728
+
12729
+ create<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(base?: I): ActivityRhythmRequest {
12730
+ return ActivityRhythmRequest.fromPartial(base ?? ({} as any));
12731
+ },
12732
+ fromPartial<I extends Exact<DeepPartial<ActivityRhythmRequest>, I>>(object: I): ActivityRhythmRequest {
12733
+ const message = createBaseActivityRhythmRequest();
12734
+ message.organizationId = object.organizationId ?? "";
12735
+ message.projectId = object.projectId ?? "";
12736
+ message.timeWindow = object.timeWindow ?? 0;
12737
+ message.timeZone = object.timeZone ?? "";
12738
+ return message;
12739
+ },
12740
+ };
12741
+
12742
+ function createBaseActivityRhythm(): ActivityRhythm {
12743
+ return { buckets: [], windowStart: undefined, windowEnd: undefined, asOf: undefined, timeZone: "" };
12744
+ }
12745
+
12746
+ export const ActivityRhythm: MessageFns<ActivityRhythm> = {
12747
+ encode(message: ActivityRhythm, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
12748
+ for (const v of message.buckets) {
12749
+ ActivityRhythmBucket.encode(v!, writer.uint32(10).fork()).join();
12750
+ }
12751
+ if (message.windowStart !== undefined) {
12752
+ Timestamp.encode(toTimestamp(message.windowStart), writer.uint32(18).fork()).join();
12753
+ }
12754
+ if (message.windowEnd !== undefined) {
12755
+ Timestamp.encode(toTimestamp(message.windowEnd), writer.uint32(26).fork()).join();
12756
+ }
12757
+ if (message.asOf !== undefined) {
12758
+ Timestamp.encode(toTimestamp(message.asOf), writer.uint32(34).fork()).join();
12759
+ }
12760
+ if (message.timeZone !== "") {
12761
+ writer.uint32(42).string(message.timeZone);
12762
+ }
12763
+ return writer;
12764
+ },
12765
+
12766
+ decode(input: BinaryReader | Uint8Array, length?: number): ActivityRhythm {
12767
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
12768
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
12769
+ if (previousRecursionDepth >= 100) {
12770
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
12771
+ }
12772
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
12773
+ try {
12774
+ const end = length === undefined ? reader.len : reader.pos + length;
12775
+ const message = createBaseActivityRhythm();
12776
+ while (reader.pos < end) {
12777
+ const tag = reader.uint32();
12778
+ switch (tag >>> 3) {
12779
+ case 1: {
12780
+ if (tag !== 10) {
12781
+ break;
12782
+ }
12783
+
12784
+ message.buckets.push(ActivityRhythmBucket.decode(reader, reader.uint32()));
12785
+ continue;
12786
+ }
12787
+ case 2: {
12788
+ if (tag !== 18) {
12789
+ break;
12790
+ }
12791
+
12792
+ message.windowStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12793
+ continue;
12794
+ }
12795
+ case 3: {
12796
+ if (tag !== 26) {
12797
+ break;
12798
+ }
12799
+
12800
+ message.windowEnd = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12801
+ continue;
12802
+ }
12803
+ case 4: {
12804
+ if (tag !== 34) {
12805
+ break;
12806
+ }
12807
+
12808
+ message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
12809
+ continue;
12810
+ }
12811
+ case 5: {
12812
+ if (tag !== 42) {
12813
+ break;
12814
+ }
12815
+
12816
+ message.timeZone = reader.string();
12817
+ continue;
12818
+ }
12819
+ }
12820
+ if ((tag & 7) === 4 || tag === 0) {
12821
+ break;
12822
+ }
12823
+ reader.skip(tag & 7);
12824
+ }
12825
+ return message;
12826
+ } finally {
12827
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
12828
+ }
12829
+ },
12830
+
12831
+ fromJSON(object: any): ActivityRhythm {
12832
+ return {
12833
+ buckets: globalThis.Array.isArray(object?.buckets)
12834
+ ? object.buckets.map((e: any) => ActivityRhythmBucket.fromJSON(e))
12835
+ : [],
12836
+ windowStart: isSet(object.windowStart)
12837
+ ? fromJsonTimestamp(object.windowStart)
12838
+ : isSet(object.window_start)
12839
+ ? fromJsonTimestamp(object.window_start)
12840
+ : undefined,
12841
+ windowEnd: isSet(object.windowEnd)
12842
+ ? fromJsonTimestamp(object.windowEnd)
12843
+ : isSet(object.window_end)
12844
+ ? fromJsonTimestamp(object.window_end)
12845
+ : undefined,
12846
+ asOf: isSet(object.asOf)
12847
+ ? fromJsonTimestamp(object.asOf)
12848
+ : isSet(object.as_of)
12849
+ ? fromJsonTimestamp(object.as_of)
12850
+ : undefined,
12851
+ timeZone: isSet(object.timeZone)
12852
+ ? globalThis.String(object.timeZone)
12853
+ : isSet(object.time_zone)
12854
+ ? globalThis.String(object.time_zone)
12855
+ : "",
12856
+ };
12857
+ },
12858
+
12859
+ toJSON(message: ActivityRhythm): unknown {
12860
+ const obj: any = {};
12861
+ if (message.buckets?.length) {
12862
+ obj.buckets = message.buckets.map((e) => ActivityRhythmBucket.toJSON(e));
12863
+ }
12864
+ if (message.windowStart !== undefined) {
12865
+ obj.windowStart = message.windowStart.toISOString();
12866
+ }
12867
+ if (message.windowEnd !== undefined) {
11936
12868
  obj.windowEnd = message.windowEnd.toISOString();
11937
12869
  }
11938
12870
  if (message.asOf !== undefined) {
@@ -14893,6 +15825,7 @@ function createBaseModelActivity(): ModelActivity {
14893
15825
  ttftCalls: 0,
14894
15826
  providers: [],
14895
15827
  principals: [],
15828
+ settledCalls: undefined,
14896
15829
  };
14897
15830
  }
14898
15831
 
@@ -14949,6 +15882,9 @@ export const ModelActivity: MessageFns<ModelActivity> = {
14949
15882
  for (const v of message.principals) {
14950
15883
  ModelActivityPrincipal.encode(v!, writer.uint32(138).fork()).join();
14951
15884
  }
15885
+ if (message.settledCalls !== undefined) {
15886
+ writer.uint32(144).uint64(message.settledCalls);
15887
+ }
14952
15888
  return writer;
14953
15889
  },
14954
15890
 
@@ -15101,6 +16037,14 @@ export const ModelActivity: MessageFns<ModelActivity> = {
15101
16037
  message.principals.push(ModelActivityPrincipal.decode(reader, reader.uint32()));
15102
16038
  continue;
15103
16039
  }
16040
+ case 18: {
16041
+ if (tag !== 144) {
16042
+ break;
16043
+ }
16044
+
16045
+ message.settledCalls = longToNumber(reader.uint64());
16046
+ continue;
16047
+ }
15104
16048
  }
15105
16049
  if ((tag & 7) === 4 || tag === 0) {
15106
16050
  break;
@@ -15184,6 +16128,11 @@ export const ModelActivity: MessageFns<ModelActivity> = {
15184
16128
  principals: globalThis.Array.isArray(object?.principals)
15185
16129
  ? object.principals.map((e: any) => ModelActivityPrincipal.fromJSON(e))
15186
16130
  : [],
16131
+ settledCalls: isSet(object.settledCalls)
16132
+ ? globalThis.Number(object.settledCalls)
16133
+ : isSet(object.settled_calls)
16134
+ ? globalThis.Number(object.settled_calls)
16135
+ : undefined,
15187
16136
  };
15188
16137
  },
15189
16138
 
@@ -15240,6 +16189,9 @@ export const ModelActivity: MessageFns<ModelActivity> = {
15240
16189
  if (message.principals?.length) {
15241
16190
  obj.principals = message.principals.map((e) => ModelActivityPrincipal.toJSON(e));
15242
16191
  }
16192
+ if (message.settledCalls !== undefined) {
16193
+ obj.settledCalls = Math.round(message.settledCalls);
16194
+ }
15243
16195
  return obj;
15244
16196
  },
15245
16197
 
@@ -15265,6 +16217,7 @@ export const ModelActivity: MessageFns<ModelActivity> = {
15265
16217
  message.ttftCalls = object.ttftCalls ?? 0;
15266
16218
  message.providers = object.providers?.map((e) => e) || [];
15267
16219
  message.principals = object.principals?.map((e) => ModelActivityPrincipal.fromPartial(e)) || [];
16220
+ message.settledCalls = object.settledCalls ?? undefined;
15268
16221
  return message;
15269
16222
  },
15270
16223
  };
@@ -20785,6 +21738,13 @@ export interface AIGatewayService {
20785
21738
  * omitted; today is provisional.
20786
21739
  */
20787
21740
  StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
21741
+ /**
21742
+ * Live current-UTC-month spend forecast: month-to-date cost and the projected month-end total (a band from
21743
+ * replaying recent weeks), for the project and per model, provider, source system, user and api key, off the
21744
+ * same daily rollup as StreamDailyActivity; filter.funding_modes forecasts the cost on the listed funding modes. Mirrors
21745
+ * telemetry.api.v1.
21746
+ */
21747
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast>;
20788
21748
  /**
20789
21749
  * Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
20790
21750
  * explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
@@ -20871,6 +21831,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
20871
21831
  this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
20872
21832
  this.StreamBurnRate = this.StreamBurnRate.bind(this);
20873
21833
  this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
21834
+ this.StreamSpendForecast = this.StreamSpendForecast.bind(this);
20874
21835
  this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
20875
21836
  this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
20876
21837
  this.StreamProjectSummaries = this.StreamProjectSummaries.bind(this);
@@ -20968,6 +21929,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
20968
21929
  return result.pipe(map((data) => DailyActivity.decode(new BinaryReader(data))));
20969
21930
  }
20970
21931
 
21932
+ StreamSpendForecast(request: SpendForecastRequest, metadata?: Metadata): Observable<SpendForecast> {
21933
+ const data = SpendForecastRequest.encode(request).finish();
21934
+ const result = this.rpc.serverStreamingRequest(this.service, "StreamSpendForecast", data, metadata);
21935
+ return result.pipe(map((data) => SpendForecast.decode(new BinaryReader(data))));
21936
+ }
21937
+
20971
21938
  StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm> {
20972
21939
  const data = ActivityRhythmRequest.encode(request).finish();
20973
21940
  const result = this.rpc.serverStreamingRequest(this.service, "StreamActivityRhythm", data, metadata);