@miradorlabs/web-grpc 2.61.0 → 2.63.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.
- package/package.json +1 -1
- package/proto/gateway/web/v1/ai_gateway.ts +1208 -138
- package/proto/gateway/web/v1/ai_gateway_grpc_pb.js +36 -0
- package/proto/gateway/web/v1/ai_gateway_pb.js +1849 -101
- package/proto/gateway/web/v1/model_gateway.ts +728 -0
- package/proto/gateway/web/v1/model_gateway_grpc_pb.js +85 -0
- package/proto/gateway/web/v1/model_gateway_pb.js +1261 -0
|
@@ -681,6 +681,98 @@ export function aIFileGroupByToJSON(object: AIFileGroupBy): string {
|
|
|
681
681
|
}
|
|
682
682
|
}
|
|
683
683
|
|
|
684
|
+
/** AIFundingMode mirrors telemetry.api.v1.AIFundingMode. */
|
|
685
|
+
export enum AIFundingMode {
|
|
686
|
+
AI_FUNDING_MODE_UNSPECIFIED = 0,
|
|
687
|
+
AI_FUNDING_MODE_SUBSCRIPTION = 1,
|
|
688
|
+
AI_FUNDING_MODE_PREPAID_CREDITS = 2,
|
|
689
|
+
AI_FUNDING_MODE_API_METERED = 3,
|
|
690
|
+
AI_FUNDING_MODE_UNKNOWN = 4,
|
|
691
|
+
UNRECOGNIZED = -1,
|
|
692
|
+
}
|
|
693
|
+
|
|
694
|
+
export function aIFundingModeFromJSON(object: any): AIFundingMode {
|
|
695
|
+
switch (object) {
|
|
696
|
+
case 0:
|
|
697
|
+
case "AI_FUNDING_MODE_UNSPECIFIED":
|
|
698
|
+
return AIFundingMode.AI_FUNDING_MODE_UNSPECIFIED;
|
|
699
|
+
case 1:
|
|
700
|
+
case "AI_FUNDING_MODE_SUBSCRIPTION":
|
|
701
|
+
return AIFundingMode.AI_FUNDING_MODE_SUBSCRIPTION;
|
|
702
|
+
case 2:
|
|
703
|
+
case "AI_FUNDING_MODE_PREPAID_CREDITS":
|
|
704
|
+
return AIFundingMode.AI_FUNDING_MODE_PREPAID_CREDITS;
|
|
705
|
+
case 3:
|
|
706
|
+
case "AI_FUNDING_MODE_API_METERED":
|
|
707
|
+
return AIFundingMode.AI_FUNDING_MODE_API_METERED;
|
|
708
|
+
case 4:
|
|
709
|
+
case "AI_FUNDING_MODE_UNKNOWN":
|
|
710
|
+
return AIFundingMode.AI_FUNDING_MODE_UNKNOWN;
|
|
711
|
+
case -1:
|
|
712
|
+
case "UNRECOGNIZED":
|
|
713
|
+
default:
|
|
714
|
+
return AIFundingMode.UNRECOGNIZED;
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
export function aIFundingModeToJSON(object: AIFundingMode): string {
|
|
719
|
+
switch (object) {
|
|
720
|
+
case AIFundingMode.AI_FUNDING_MODE_UNSPECIFIED:
|
|
721
|
+
return "AI_FUNDING_MODE_UNSPECIFIED";
|
|
722
|
+
case AIFundingMode.AI_FUNDING_MODE_SUBSCRIPTION:
|
|
723
|
+
return "AI_FUNDING_MODE_SUBSCRIPTION";
|
|
724
|
+
case AIFundingMode.AI_FUNDING_MODE_PREPAID_CREDITS:
|
|
725
|
+
return "AI_FUNDING_MODE_PREPAID_CREDITS";
|
|
726
|
+
case AIFundingMode.AI_FUNDING_MODE_API_METERED:
|
|
727
|
+
return "AI_FUNDING_MODE_API_METERED";
|
|
728
|
+
case AIFundingMode.AI_FUNDING_MODE_UNKNOWN:
|
|
729
|
+
return "AI_FUNDING_MODE_UNKNOWN";
|
|
730
|
+
case AIFundingMode.UNRECOGNIZED:
|
|
731
|
+
default:
|
|
732
|
+
return "UNRECOGNIZED";
|
|
733
|
+
}
|
|
734
|
+
}
|
|
735
|
+
|
|
736
|
+
/** AIEntitlementRole mirrors telemetry.api.v1.AIEntitlementRole. */
|
|
737
|
+
export enum AIEntitlementRole {
|
|
738
|
+
AI_ENTITLEMENT_ROLE_UNSPECIFIED = 0,
|
|
739
|
+
AI_ENTITLEMENT_ROLE_ALLOWANCE = 1,
|
|
740
|
+
AI_ENTITLEMENT_ROLE_SPEND_CAP = 2,
|
|
741
|
+
UNRECOGNIZED = -1,
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
export function aIEntitlementRoleFromJSON(object: any): AIEntitlementRole {
|
|
745
|
+
switch (object) {
|
|
746
|
+
case 0:
|
|
747
|
+
case "AI_ENTITLEMENT_ROLE_UNSPECIFIED":
|
|
748
|
+
return AIEntitlementRole.AI_ENTITLEMENT_ROLE_UNSPECIFIED;
|
|
749
|
+
case 1:
|
|
750
|
+
case "AI_ENTITLEMENT_ROLE_ALLOWANCE":
|
|
751
|
+
return AIEntitlementRole.AI_ENTITLEMENT_ROLE_ALLOWANCE;
|
|
752
|
+
case 2:
|
|
753
|
+
case "AI_ENTITLEMENT_ROLE_SPEND_CAP":
|
|
754
|
+
return AIEntitlementRole.AI_ENTITLEMENT_ROLE_SPEND_CAP;
|
|
755
|
+
case -1:
|
|
756
|
+
case "UNRECOGNIZED":
|
|
757
|
+
default:
|
|
758
|
+
return AIEntitlementRole.UNRECOGNIZED;
|
|
759
|
+
}
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
export function aIEntitlementRoleToJSON(object: AIEntitlementRole): string {
|
|
763
|
+
switch (object) {
|
|
764
|
+
case AIEntitlementRole.AI_ENTITLEMENT_ROLE_UNSPECIFIED:
|
|
765
|
+
return "AI_ENTITLEMENT_ROLE_UNSPECIFIED";
|
|
766
|
+
case AIEntitlementRole.AI_ENTITLEMENT_ROLE_ALLOWANCE:
|
|
767
|
+
return "AI_ENTITLEMENT_ROLE_ALLOWANCE";
|
|
768
|
+
case AIEntitlementRole.AI_ENTITLEMENT_ROLE_SPEND_CAP:
|
|
769
|
+
return "AI_ENTITLEMENT_ROLE_SPEND_CAP";
|
|
770
|
+
case AIEntitlementRole.UNRECOGNIZED:
|
|
771
|
+
default:
|
|
772
|
+
return "UNRECOGNIZED";
|
|
773
|
+
}
|
|
774
|
+
}
|
|
775
|
+
|
|
684
776
|
export interface ListSessionsRequest {
|
|
685
777
|
organizationId: string;
|
|
686
778
|
projectId: string;
|
|
@@ -866,6 +958,11 @@ export interface AISessionEvent {
|
|
|
866
958
|
version: number;
|
|
867
959
|
/** Opaque keyset cursor for this event's position. */
|
|
868
960
|
cursor: string;
|
|
961
|
+
/**
|
|
962
|
+
* The funding facility observed for this event at ingest (a per-event facility lens, not a reconciled
|
|
963
|
+
* figure). '' / unrecognized map to UNSPECIFIED.
|
|
964
|
+
*/
|
|
965
|
+
fundingMode: AIFundingMode;
|
|
869
966
|
}
|
|
870
967
|
|
|
871
968
|
export interface AIContentPart {
|
|
@@ -1560,6 +1657,83 @@ export interface AITokenUsage {
|
|
|
1560
1657
|
cacheReadTokens: number;
|
|
1561
1658
|
cacheWriteTokens: number;
|
|
1562
1659
|
providerCostUsd: number;
|
|
1660
|
+
/**
|
|
1661
|
+
* Session cost sliced by the funding facility observed on each event at ingest (a LENS, not a
|
|
1662
|
+
* reconciled billable figure). Populated only on a session summary's usage; nil elsewhere.
|
|
1663
|
+
*/
|
|
1664
|
+
facilityCostBreakdown: AIFacilityCostBreakdown | undefined;
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
/**
|
|
1668
|
+
* AIFacilityCostBreakdown mirrors telemetry.api.v1.AIFacilityCostBreakdown: a session's provider cost
|
|
1669
|
+
* partitioned by the funding facility observed on each model_call at ingest. A LENS on where spend
|
|
1670
|
+
* landed, NOT a reconciled billable/subsidised answer — a subscription facility can still incur
|
|
1671
|
+
* metered overage, and the facility is the one observed at ingest. Over ai_events FINAL (deduplicated).
|
|
1672
|
+
*/
|
|
1673
|
+
export interface AIFacilityCostBreakdown {
|
|
1674
|
+
/** sum of provider cost over priced model_calls — the gross */
|
|
1675
|
+
notionalUsd: number;
|
|
1676
|
+
/** _facility_usd = cost by OBSERVED facility, NOT reconciled billable dollars (name is load-bearing). */
|
|
1677
|
+
subscriptionFacilityUsd: number;
|
|
1678
|
+
prepaidCreditsFacilityUsd: number;
|
|
1679
|
+
apiMeteredFacilityUsd: number;
|
|
1680
|
+
/** unstamped or observed-unknown, one bucket */
|
|
1681
|
+
unknownFacilityUsd: number;
|
|
1682
|
+
pricedCalls: number;
|
|
1683
|
+
/** an unpriced call is not free, just uncosted */
|
|
1684
|
+
totalCalls: number;
|
|
1685
|
+
}
|
|
1686
|
+
|
|
1687
|
+
export interface StreamEntitlementsRequest {
|
|
1688
|
+
organizationId: string;
|
|
1689
|
+
projectId: string;
|
|
1690
|
+
}
|
|
1691
|
+
|
|
1692
|
+
/**
|
|
1693
|
+
* EntitlementsSnapshot is one tick of the funding-usage board (first frame = full snapshot). Streams
|
|
1694
|
+
* carry no ResponseStatus.
|
|
1695
|
+
*/
|
|
1696
|
+
export interface EntitlementsSnapshot {
|
|
1697
|
+
seats: SeatEntitlement[];
|
|
1698
|
+
asOf: Date | undefined;
|
|
1699
|
+
}
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* SeatEntitlement mirrors telemetry.api.v1.SeatEntitlement: one entitlement owner's latest observed
|
|
1703
|
+
* funding state. Seat-scoped ((source_system, account_id)); principal_id/name best-effort. Seat-scoped:
|
|
1704
|
+
* windows are one seat's usage bars, never a team-pool sum. credits_balance_raw is verbatim, not USD.
|
|
1705
|
+
*/
|
|
1706
|
+
export interface SeatEntitlement {
|
|
1707
|
+
sourceSystem: string;
|
|
1708
|
+
accountId: string;
|
|
1709
|
+
principalId: string;
|
|
1710
|
+
principalName: string;
|
|
1711
|
+
fundingMode: AIFundingMode;
|
|
1712
|
+
windows: EntitlementWindow[];
|
|
1713
|
+
/** As-of entitlement-state time (keyed on terma source_time), NOT ingest time. */
|
|
1714
|
+
eventTime: Date | undefined;
|
|
1715
|
+
creditsBalanceRaw?: string | undefined;
|
|
1716
|
+
creditsUnlimited?:
|
|
1717
|
+
| boolean
|
|
1718
|
+
| undefined;
|
|
1719
|
+
/** harness plan label verbatim ("Max 20x" / "Max 5x" / "Codex seat") */
|
|
1720
|
+
planType: string;
|
|
1721
|
+
seatTier: string;
|
|
1722
|
+
/** raw provenance for the registered/observed/inferred toggle */
|
|
1723
|
+
evidenceSource: string;
|
|
1724
|
+
}
|
|
1725
|
+
|
|
1726
|
+
/**
|
|
1727
|
+
* EntitlementWindow mirrors telemetry.api.v1.EntitlementWindow: one usage % bar. used_pct is nullable
|
|
1728
|
+
* (unset = unobserved, never 0). kind is the harness window discriminator verbatim; window_seconds is
|
|
1729
|
+
* the window's total span (unset = unobserved).
|
|
1730
|
+
*/
|
|
1731
|
+
export interface EntitlementWindow {
|
|
1732
|
+
kind: string;
|
|
1733
|
+
usedPct?: number | undefined;
|
|
1734
|
+
resetsAt: Date | undefined;
|
|
1735
|
+
role: AIEntitlementRole;
|
|
1736
|
+
windowSeconds?: number | undefined;
|
|
1563
1737
|
}
|
|
1564
1738
|
|
|
1565
1739
|
function createBaseListSessionsRequest(): ListSessionsRequest {
|
|
@@ -3689,6 +3863,7 @@ function createBaseAISessionEvent(): AISessionEvent {
|
|
|
3689
3863
|
logicalEventId: "",
|
|
3690
3864
|
version: 0,
|
|
3691
3865
|
cursor: "",
|
|
3866
|
+
fundingMode: 0,
|
|
3692
3867
|
};
|
|
3693
3868
|
}
|
|
3694
3869
|
|
|
@@ -3748,6 +3923,9 @@ export const AISessionEvent: MessageFns<AISessionEvent> = {
|
|
|
3748
3923
|
if (message.cursor !== "") {
|
|
3749
3924
|
writer.uint32(146).string(message.cursor);
|
|
3750
3925
|
}
|
|
3926
|
+
if (message.fundingMode !== 0) {
|
|
3927
|
+
writer.uint32(152).int32(message.fundingMode);
|
|
3928
|
+
}
|
|
3751
3929
|
return writer;
|
|
3752
3930
|
},
|
|
3753
3931
|
|
|
@@ -3908,6 +4086,14 @@ export const AISessionEvent: MessageFns<AISessionEvent> = {
|
|
|
3908
4086
|
message.cursor = reader.string();
|
|
3909
4087
|
continue;
|
|
3910
4088
|
}
|
|
4089
|
+
case 19: {
|
|
4090
|
+
if (tag !== 152) {
|
|
4091
|
+
break;
|
|
4092
|
+
}
|
|
4093
|
+
|
|
4094
|
+
message.fundingMode = reader.int32() as any;
|
|
4095
|
+
continue;
|
|
4096
|
+
}
|
|
3911
4097
|
}
|
|
3912
4098
|
if ((tag & 7) === 4 || tag === 0) {
|
|
3913
4099
|
break;
|
|
@@ -3978,6 +4164,11 @@ export const AISessionEvent: MessageFns<AISessionEvent> = {
|
|
|
3978
4164
|
: "",
|
|
3979
4165
|
version: isSet(object.version) ? globalThis.Number(object.version) : 0,
|
|
3980
4166
|
cursor: isSet(object.cursor) ? globalThis.String(object.cursor) : "",
|
|
4167
|
+
fundingMode: isSet(object.fundingMode)
|
|
4168
|
+
? aIFundingModeFromJSON(object.fundingMode)
|
|
4169
|
+
: isSet(object.funding_mode)
|
|
4170
|
+
? aIFundingModeFromJSON(object.funding_mode)
|
|
4171
|
+
: 0,
|
|
3981
4172
|
};
|
|
3982
4173
|
},
|
|
3983
4174
|
|
|
@@ -4037,6 +4228,9 @@ export const AISessionEvent: MessageFns<AISessionEvent> = {
|
|
|
4037
4228
|
if (message.cursor !== "") {
|
|
4038
4229
|
obj.cursor = message.cursor;
|
|
4039
4230
|
}
|
|
4231
|
+
if (message.fundingMode !== 0) {
|
|
4232
|
+
obj.fundingMode = aIFundingModeToJSON(message.fundingMode);
|
|
4233
|
+
}
|
|
4040
4234
|
return obj;
|
|
4041
4235
|
},
|
|
4042
4236
|
|
|
@@ -4065,6 +4259,7 @@ export const AISessionEvent: MessageFns<AISessionEvent> = {
|
|
|
4065
4259
|
message.logicalEventId = object.logicalEventId ?? "";
|
|
4066
4260
|
message.version = object.version ?? 0;
|
|
4067
4261
|
message.cursor = object.cursor ?? "";
|
|
4262
|
+
message.fundingMode = object.fundingMode ?? 0;
|
|
4068
4263
|
return message;
|
|
4069
4264
|
},
|
|
4070
4265
|
};
|
|
@@ -14795,7 +14990,14 @@ export const AIModelPrice: MessageFns<AIModelPrice> = {
|
|
|
14795
14990
|
};
|
|
14796
14991
|
|
|
14797
14992
|
function createBaseAITokenUsage(): AITokenUsage {
|
|
14798
|
-
return {
|
|
14993
|
+
return {
|
|
14994
|
+
inputTokens: 0,
|
|
14995
|
+
outputTokens: 0,
|
|
14996
|
+
cacheReadTokens: 0,
|
|
14997
|
+
cacheWriteTokens: 0,
|
|
14998
|
+
providerCostUsd: 0,
|
|
14999
|
+
facilityCostBreakdown: undefined,
|
|
15000
|
+
};
|
|
14799
15001
|
}
|
|
14800
15002
|
|
|
14801
15003
|
export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
@@ -14815,6 +15017,9 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
|
14815
15017
|
if (message.providerCostUsd !== 0) {
|
|
14816
15018
|
writer.uint32(41).double(message.providerCostUsd);
|
|
14817
15019
|
}
|
|
15020
|
+
if (message.facilityCostBreakdown !== undefined) {
|
|
15021
|
+
AIFacilityCostBreakdown.encode(message.facilityCostBreakdown, writer.uint32(50).fork()).join();
|
|
15022
|
+
}
|
|
14818
15023
|
return writer;
|
|
14819
15024
|
},
|
|
14820
15025
|
|
|
@@ -14871,6 +15076,14 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
|
14871
15076
|
message.providerCostUsd = reader.double();
|
|
14872
15077
|
continue;
|
|
14873
15078
|
}
|
|
15079
|
+
case 6: {
|
|
15080
|
+
if (tag !== 50) {
|
|
15081
|
+
break;
|
|
15082
|
+
}
|
|
15083
|
+
|
|
15084
|
+
message.facilityCostBreakdown = AIFacilityCostBreakdown.decode(reader, reader.uint32());
|
|
15085
|
+
continue;
|
|
15086
|
+
}
|
|
14874
15087
|
}
|
|
14875
15088
|
if ((tag & 7) === 4 || tag === 0) {
|
|
14876
15089
|
break;
|
|
@@ -14910,6 +15123,11 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
|
14910
15123
|
: isSet(object.provider_cost_usd)
|
|
14911
15124
|
? globalThis.Number(object.provider_cost_usd)
|
|
14912
15125
|
: 0,
|
|
15126
|
+
facilityCostBreakdown: isSet(object.facilityCostBreakdown)
|
|
15127
|
+
? AIFacilityCostBreakdown.fromJSON(object.facilityCostBreakdown)
|
|
15128
|
+
: isSet(object.facility_cost_breakdown)
|
|
15129
|
+
? AIFacilityCostBreakdown.fromJSON(object.facility_cost_breakdown)
|
|
15130
|
+
: undefined,
|
|
14913
15131
|
};
|
|
14914
15132
|
},
|
|
14915
15133
|
|
|
@@ -14930,6 +15148,9 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
|
14930
15148
|
if (message.providerCostUsd !== 0) {
|
|
14931
15149
|
obj.providerCostUsd = message.providerCostUsd;
|
|
14932
15150
|
}
|
|
15151
|
+
if (message.facilityCostBreakdown !== undefined) {
|
|
15152
|
+
obj.facilityCostBreakdown = AIFacilityCostBreakdown.toJSON(message.facilityCostBreakdown);
|
|
15153
|
+
}
|
|
14933
15154
|
return obj;
|
|
14934
15155
|
},
|
|
14935
15156
|
|
|
@@ -14943,150 +15164,993 @@ export const AITokenUsage: MessageFns<AITokenUsage> = {
|
|
|
14943
15164
|
message.cacheReadTokens = object.cacheReadTokens ?? 0;
|
|
14944
15165
|
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
14945
15166
|
message.providerCostUsd = object.providerCostUsd ?? 0;
|
|
15167
|
+
message.facilityCostBreakdown =
|
|
15168
|
+
(object.facilityCostBreakdown !== undefined && object.facilityCostBreakdown !== null)
|
|
15169
|
+
? AIFacilityCostBreakdown.fromPartial(object.facilityCostBreakdown)
|
|
15170
|
+
: undefined;
|
|
14946
15171
|
return message;
|
|
14947
15172
|
},
|
|
14948
15173
|
};
|
|
14949
15174
|
|
|
14950
|
-
|
|
14951
|
-
|
|
14952
|
-
|
|
14953
|
-
|
|
14954
|
-
|
|
14955
|
-
|
|
14956
|
-
|
|
14957
|
-
|
|
14958
|
-
|
|
14959
|
-
|
|
14960
|
-
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
|
|
14961
|
-
/**
|
|
14962
|
-
* Keeps the first conversation page live: the whole top-N page re-derived each tick
|
|
14963
|
-
* as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
|
|
14964
|
-
*/
|
|
14965
|
-
StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
|
|
14966
|
-
/** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
|
|
14967
|
-
StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
|
|
14968
|
-
ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
|
|
14969
|
-
StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
|
|
14970
|
-
/**
|
|
14971
|
-
* Live, backend-computed, per-event token series for one session (replacement snapshots):
|
|
14972
|
-
* one content-free point per logical event + whole-session totals; point count is capped.
|
|
14973
|
-
*/
|
|
14974
|
-
StreamSessionTokenTimeline(
|
|
14975
|
-
request: SessionTokenTimelineRequest,
|
|
14976
|
-
metadata?: Metadata,
|
|
14977
|
-
): Observable<SessionTokenTimeline>;
|
|
14978
|
-
/** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
|
|
14979
|
-
StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
|
|
14980
|
-
ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse>;
|
|
14981
|
-
UpdatePrincipal(request: UpdatePrincipalRequest, metadata?: Metadata): Promise<UpdatePrincipalResponse>;
|
|
14982
|
-
/** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
|
|
14983
|
-
ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
|
|
14984
|
-
/**
|
|
14985
|
-
* Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
|
|
14986
|
-
* activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
|
|
14987
|
-
*/
|
|
14988
|
-
StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
|
|
14989
|
-
/**
|
|
14990
|
-
* Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
|
|
14991
|
-
* git activities (whole-window totals ride each frame), re-derived each tick.
|
|
14992
|
-
*/
|
|
14993
|
-
StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
|
|
14994
|
-
/**
|
|
14995
|
-
* Live token burn calendar: a windowed, dimension-sliced token/cost trend series
|
|
14996
|
-
* plus whole-window totals.
|
|
14997
|
-
*/
|
|
14998
|
-
StreamTokenActivitySummary(
|
|
14999
|
-
request: TokenActivitySummaryRequest,
|
|
15000
|
-
metadata?: Metadata,
|
|
15001
|
-
): Observable<TokenActivitySummary>;
|
|
15002
|
-
/**
|
|
15003
|
-
* Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
|
|
15004
|
-
* breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
|
|
15005
|
-
* refresh; first frame is a full snapshot.
|
|
15006
|
-
*/
|
|
15007
|
-
StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
|
|
15008
|
-
/**
|
|
15009
|
-
* Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
|
|
15010
|
-
* covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
|
|
15011
|
-
* omitted; today is provisional.
|
|
15012
|
-
*/
|
|
15013
|
-
StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
|
|
15014
|
-
/**
|
|
15015
|
-
* Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
|
|
15016
|
-
* explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
|
|
15017
|
-
*/
|
|
15018
|
-
StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
|
|
15019
|
-
/**
|
|
15020
|
-
* Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
|
|
15021
|
-
* and top sessions by cost.
|
|
15022
|
-
*/
|
|
15023
|
-
StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
|
|
15024
|
-
/** Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel. */
|
|
15025
|
-
ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
|
|
15026
|
-
/**
|
|
15027
|
-
* Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), observed vs
|
|
15028
|
-
* unverified, a complete snapshot re-derived each tick.
|
|
15029
|
-
*/
|
|
15030
|
-
StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
|
|
15031
|
-
/** Latest observed list price per (source, provider, model) from the global catalog. */
|
|
15032
|
-
ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
|
|
15033
|
-
/**
|
|
15034
|
-
* Every stored observation for the filtered models over a time range, oldest first —
|
|
15035
|
-
* the rows ListModelPrices collapses. filter.model is required.
|
|
15036
|
-
*/
|
|
15037
|
-
ListModelPriceHistory(
|
|
15038
|
-
request: ListModelPriceHistoryRequest,
|
|
15039
|
-
metadata?: Metadata,
|
|
15040
|
-
): Promise<ListModelPriceHistoryResponse>;
|
|
15041
|
-
/**
|
|
15042
|
-
* Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
|
|
15043
|
-
* sliding window, each with the prior equal-length window's count for a trend delta and distinct
|
|
15044
|
-
* sessions. Mirrors telemetry.api.v1.
|
|
15045
|
-
*/
|
|
15046
|
-
ListResourceRankings(request: ResourceRankingsRequest, metadata?: Metadata): Promise<ResourceRankingsResponse>;
|
|
15175
|
+
function createBaseAIFacilityCostBreakdown(): AIFacilityCostBreakdown {
|
|
15176
|
+
return {
|
|
15177
|
+
notionalUsd: 0,
|
|
15178
|
+
subscriptionFacilityUsd: 0,
|
|
15179
|
+
prepaidCreditsFacilityUsd: 0,
|
|
15180
|
+
apiMeteredFacilityUsd: 0,
|
|
15181
|
+
unknownFacilityUsd: 0,
|
|
15182
|
+
pricedCalls: 0,
|
|
15183
|
+
totalCalls: 0,
|
|
15184
|
+
};
|
|
15047
15185
|
}
|
|
15048
15186
|
|
|
15049
|
-
export const
|
|
15050
|
-
|
|
15051
|
-
|
|
15052
|
-
|
|
15053
|
-
|
|
15054
|
-
|
|
15055
|
-
|
|
15056
|
-
|
|
15057
|
-
|
|
15058
|
-
|
|
15059
|
-
|
|
15060
|
-
|
|
15061
|
-
|
|
15062
|
-
|
|
15063
|
-
|
|
15064
|
-
|
|
15065
|
-
|
|
15066
|
-
|
|
15067
|
-
|
|
15068
|
-
|
|
15069
|
-
|
|
15070
|
-
|
|
15071
|
-
|
|
15072
|
-
|
|
15073
|
-
|
|
15074
|
-
this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
|
|
15075
|
-
this.ListModelPrices = this.ListModelPrices.bind(this);
|
|
15076
|
-
this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
|
|
15077
|
-
this.ListResourceRankings = this.ListResourceRankings.bind(this);
|
|
15078
|
-
}
|
|
15079
|
-
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
|
|
15080
|
-
const data = ListSessionsRequest.encode(request).finish();
|
|
15081
|
-
const promise = this.rpc.request(this.service, "ListSessions", data, metadata);
|
|
15082
|
-
return promise.then((data) => ListSessionsResponse.decode(new BinaryReader(data)));
|
|
15083
|
-
}
|
|
15187
|
+
export const AIFacilityCostBreakdown: MessageFns<AIFacilityCostBreakdown> = {
|
|
15188
|
+
encode(message: AIFacilityCostBreakdown, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
15189
|
+
if (message.notionalUsd !== 0) {
|
|
15190
|
+
writer.uint32(9).double(message.notionalUsd);
|
|
15191
|
+
}
|
|
15192
|
+
if (message.subscriptionFacilityUsd !== 0) {
|
|
15193
|
+
writer.uint32(17).double(message.subscriptionFacilityUsd);
|
|
15194
|
+
}
|
|
15195
|
+
if (message.prepaidCreditsFacilityUsd !== 0) {
|
|
15196
|
+
writer.uint32(25).double(message.prepaidCreditsFacilityUsd);
|
|
15197
|
+
}
|
|
15198
|
+
if (message.apiMeteredFacilityUsd !== 0) {
|
|
15199
|
+
writer.uint32(33).double(message.apiMeteredFacilityUsd);
|
|
15200
|
+
}
|
|
15201
|
+
if (message.unknownFacilityUsd !== 0) {
|
|
15202
|
+
writer.uint32(41).double(message.unknownFacilityUsd);
|
|
15203
|
+
}
|
|
15204
|
+
if (message.pricedCalls !== 0) {
|
|
15205
|
+
writer.uint32(48).uint64(message.pricedCalls);
|
|
15206
|
+
}
|
|
15207
|
+
if (message.totalCalls !== 0) {
|
|
15208
|
+
writer.uint32(56).uint64(message.totalCalls);
|
|
15209
|
+
}
|
|
15210
|
+
return writer;
|
|
15211
|
+
},
|
|
15084
15212
|
|
|
15085
|
-
|
|
15086
|
-
const
|
|
15087
|
-
const
|
|
15088
|
-
|
|
15089
|
-
|
|
15213
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AIFacilityCostBreakdown {
|
|
15214
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15215
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
15216
|
+
if (previousRecursionDepth >= 100) {
|
|
15217
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
15218
|
+
}
|
|
15219
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
15220
|
+
try {
|
|
15221
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
15222
|
+
const message = createBaseAIFacilityCostBreakdown();
|
|
15223
|
+
while (reader.pos < end) {
|
|
15224
|
+
const tag = reader.uint32();
|
|
15225
|
+
switch (tag >>> 3) {
|
|
15226
|
+
case 1: {
|
|
15227
|
+
if (tag !== 9) {
|
|
15228
|
+
break;
|
|
15229
|
+
}
|
|
15230
|
+
|
|
15231
|
+
message.notionalUsd = reader.double();
|
|
15232
|
+
continue;
|
|
15233
|
+
}
|
|
15234
|
+
case 2: {
|
|
15235
|
+
if (tag !== 17) {
|
|
15236
|
+
break;
|
|
15237
|
+
}
|
|
15238
|
+
|
|
15239
|
+
message.subscriptionFacilityUsd = reader.double();
|
|
15240
|
+
continue;
|
|
15241
|
+
}
|
|
15242
|
+
case 3: {
|
|
15243
|
+
if (tag !== 25) {
|
|
15244
|
+
break;
|
|
15245
|
+
}
|
|
15246
|
+
|
|
15247
|
+
message.prepaidCreditsFacilityUsd = reader.double();
|
|
15248
|
+
continue;
|
|
15249
|
+
}
|
|
15250
|
+
case 4: {
|
|
15251
|
+
if (tag !== 33) {
|
|
15252
|
+
break;
|
|
15253
|
+
}
|
|
15254
|
+
|
|
15255
|
+
message.apiMeteredFacilityUsd = reader.double();
|
|
15256
|
+
continue;
|
|
15257
|
+
}
|
|
15258
|
+
case 5: {
|
|
15259
|
+
if (tag !== 41) {
|
|
15260
|
+
break;
|
|
15261
|
+
}
|
|
15262
|
+
|
|
15263
|
+
message.unknownFacilityUsd = reader.double();
|
|
15264
|
+
continue;
|
|
15265
|
+
}
|
|
15266
|
+
case 6: {
|
|
15267
|
+
if (tag !== 48) {
|
|
15268
|
+
break;
|
|
15269
|
+
}
|
|
15270
|
+
|
|
15271
|
+
message.pricedCalls = longToNumber(reader.uint64());
|
|
15272
|
+
continue;
|
|
15273
|
+
}
|
|
15274
|
+
case 7: {
|
|
15275
|
+
if (tag !== 56) {
|
|
15276
|
+
break;
|
|
15277
|
+
}
|
|
15278
|
+
|
|
15279
|
+
message.totalCalls = longToNumber(reader.uint64());
|
|
15280
|
+
continue;
|
|
15281
|
+
}
|
|
15282
|
+
}
|
|
15283
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15284
|
+
break;
|
|
15285
|
+
}
|
|
15286
|
+
reader.skip(tag & 7);
|
|
15287
|
+
}
|
|
15288
|
+
return message;
|
|
15289
|
+
} finally {
|
|
15290
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
15291
|
+
}
|
|
15292
|
+
},
|
|
15293
|
+
|
|
15294
|
+
fromJSON(object: any): AIFacilityCostBreakdown {
|
|
15295
|
+
return {
|
|
15296
|
+
notionalUsd: isSet(object.notionalUsd)
|
|
15297
|
+
? globalThis.Number(object.notionalUsd)
|
|
15298
|
+
: isSet(object.notional_usd)
|
|
15299
|
+
? globalThis.Number(object.notional_usd)
|
|
15300
|
+
: 0,
|
|
15301
|
+
subscriptionFacilityUsd: isSet(object.subscriptionFacilityUsd)
|
|
15302
|
+
? globalThis.Number(object.subscriptionFacilityUsd)
|
|
15303
|
+
: isSet(object.subscription_facility_usd)
|
|
15304
|
+
? globalThis.Number(object.subscription_facility_usd)
|
|
15305
|
+
: 0,
|
|
15306
|
+
prepaidCreditsFacilityUsd: isSet(object.prepaidCreditsFacilityUsd)
|
|
15307
|
+
? globalThis.Number(object.prepaidCreditsFacilityUsd)
|
|
15308
|
+
: isSet(object.prepaid_credits_facility_usd)
|
|
15309
|
+
? globalThis.Number(object.prepaid_credits_facility_usd)
|
|
15310
|
+
: 0,
|
|
15311
|
+
apiMeteredFacilityUsd: isSet(object.apiMeteredFacilityUsd)
|
|
15312
|
+
? globalThis.Number(object.apiMeteredFacilityUsd)
|
|
15313
|
+
: isSet(object.api_metered_facility_usd)
|
|
15314
|
+
? globalThis.Number(object.api_metered_facility_usd)
|
|
15315
|
+
: 0,
|
|
15316
|
+
unknownFacilityUsd: isSet(object.unknownFacilityUsd)
|
|
15317
|
+
? globalThis.Number(object.unknownFacilityUsd)
|
|
15318
|
+
: isSet(object.unknown_facility_usd)
|
|
15319
|
+
? globalThis.Number(object.unknown_facility_usd)
|
|
15320
|
+
: 0,
|
|
15321
|
+
pricedCalls: isSet(object.pricedCalls)
|
|
15322
|
+
? globalThis.Number(object.pricedCalls)
|
|
15323
|
+
: isSet(object.priced_calls)
|
|
15324
|
+
? globalThis.Number(object.priced_calls)
|
|
15325
|
+
: 0,
|
|
15326
|
+
totalCalls: isSet(object.totalCalls)
|
|
15327
|
+
? globalThis.Number(object.totalCalls)
|
|
15328
|
+
: isSet(object.total_calls)
|
|
15329
|
+
? globalThis.Number(object.total_calls)
|
|
15330
|
+
: 0,
|
|
15331
|
+
};
|
|
15332
|
+
},
|
|
15333
|
+
|
|
15334
|
+
toJSON(message: AIFacilityCostBreakdown): unknown {
|
|
15335
|
+
const obj: any = {};
|
|
15336
|
+
if (message.notionalUsd !== 0) {
|
|
15337
|
+
obj.notionalUsd = message.notionalUsd;
|
|
15338
|
+
}
|
|
15339
|
+
if (message.subscriptionFacilityUsd !== 0) {
|
|
15340
|
+
obj.subscriptionFacilityUsd = message.subscriptionFacilityUsd;
|
|
15341
|
+
}
|
|
15342
|
+
if (message.prepaidCreditsFacilityUsd !== 0) {
|
|
15343
|
+
obj.prepaidCreditsFacilityUsd = message.prepaidCreditsFacilityUsd;
|
|
15344
|
+
}
|
|
15345
|
+
if (message.apiMeteredFacilityUsd !== 0) {
|
|
15346
|
+
obj.apiMeteredFacilityUsd = message.apiMeteredFacilityUsd;
|
|
15347
|
+
}
|
|
15348
|
+
if (message.unknownFacilityUsd !== 0) {
|
|
15349
|
+
obj.unknownFacilityUsd = message.unknownFacilityUsd;
|
|
15350
|
+
}
|
|
15351
|
+
if (message.pricedCalls !== 0) {
|
|
15352
|
+
obj.pricedCalls = Math.round(message.pricedCalls);
|
|
15353
|
+
}
|
|
15354
|
+
if (message.totalCalls !== 0) {
|
|
15355
|
+
obj.totalCalls = Math.round(message.totalCalls);
|
|
15356
|
+
}
|
|
15357
|
+
return obj;
|
|
15358
|
+
},
|
|
15359
|
+
|
|
15360
|
+
create<I extends Exact<DeepPartial<AIFacilityCostBreakdown>, I>>(base?: I): AIFacilityCostBreakdown {
|
|
15361
|
+
return AIFacilityCostBreakdown.fromPartial(base ?? ({} as any));
|
|
15362
|
+
},
|
|
15363
|
+
fromPartial<I extends Exact<DeepPartial<AIFacilityCostBreakdown>, I>>(object: I): AIFacilityCostBreakdown {
|
|
15364
|
+
const message = createBaseAIFacilityCostBreakdown();
|
|
15365
|
+
message.notionalUsd = object.notionalUsd ?? 0;
|
|
15366
|
+
message.subscriptionFacilityUsd = object.subscriptionFacilityUsd ?? 0;
|
|
15367
|
+
message.prepaidCreditsFacilityUsd = object.prepaidCreditsFacilityUsd ?? 0;
|
|
15368
|
+
message.apiMeteredFacilityUsd = object.apiMeteredFacilityUsd ?? 0;
|
|
15369
|
+
message.unknownFacilityUsd = object.unknownFacilityUsd ?? 0;
|
|
15370
|
+
message.pricedCalls = object.pricedCalls ?? 0;
|
|
15371
|
+
message.totalCalls = object.totalCalls ?? 0;
|
|
15372
|
+
return message;
|
|
15373
|
+
},
|
|
15374
|
+
};
|
|
15375
|
+
|
|
15376
|
+
function createBaseStreamEntitlementsRequest(): StreamEntitlementsRequest {
|
|
15377
|
+
return { organizationId: "", projectId: "" };
|
|
15378
|
+
}
|
|
15379
|
+
|
|
15380
|
+
export const StreamEntitlementsRequest: MessageFns<StreamEntitlementsRequest> = {
|
|
15381
|
+
encode(message: StreamEntitlementsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
15382
|
+
if (message.organizationId !== "") {
|
|
15383
|
+
writer.uint32(10).string(message.organizationId);
|
|
15384
|
+
}
|
|
15385
|
+
if (message.projectId !== "") {
|
|
15386
|
+
writer.uint32(18).string(message.projectId);
|
|
15387
|
+
}
|
|
15388
|
+
return writer;
|
|
15389
|
+
},
|
|
15390
|
+
|
|
15391
|
+
decode(input: BinaryReader | Uint8Array, length?: number): StreamEntitlementsRequest {
|
|
15392
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15393
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
15394
|
+
if (previousRecursionDepth >= 100) {
|
|
15395
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
15396
|
+
}
|
|
15397
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
15398
|
+
try {
|
|
15399
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
15400
|
+
const message = createBaseStreamEntitlementsRequest();
|
|
15401
|
+
while (reader.pos < end) {
|
|
15402
|
+
const tag = reader.uint32();
|
|
15403
|
+
switch (tag >>> 3) {
|
|
15404
|
+
case 1: {
|
|
15405
|
+
if (tag !== 10) {
|
|
15406
|
+
break;
|
|
15407
|
+
}
|
|
15408
|
+
|
|
15409
|
+
message.organizationId = reader.string();
|
|
15410
|
+
continue;
|
|
15411
|
+
}
|
|
15412
|
+
case 2: {
|
|
15413
|
+
if (tag !== 18) {
|
|
15414
|
+
break;
|
|
15415
|
+
}
|
|
15416
|
+
|
|
15417
|
+
message.projectId = reader.string();
|
|
15418
|
+
continue;
|
|
15419
|
+
}
|
|
15420
|
+
}
|
|
15421
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15422
|
+
break;
|
|
15423
|
+
}
|
|
15424
|
+
reader.skip(tag & 7);
|
|
15425
|
+
}
|
|
15426
|
+
return message;
|
|
15427
|
+
} finally {
|
|
15428
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
15429
|
+
}
|
|
15430
|
+
},
|
|
15431
|
+
|
|
15432
|
+
fromJSON(object: any): StreamEntitlementsRequest {
|
|
15433
|
+
return {
|
|
15434
|
+
organizationId: isSet(object.organizationId)
|
|
15435
|
+
? globalThis.String(object.organizationId)
|
|
15436
|
+
: isSet(object.organization_id)
|
|
15437
|
+
? globalThis.String(object.organization_id)
|
|
15438
|
+
: "",
|
|
15439
|
+
projectId: isSet(object.projectId)
|
|
15440
|
+
? globalThis.String(object.projectId)
|
|
15441
|
+
: isSet(object.project_id)
|
|
15442
|
+
? globalThis.String(object.project_id)
|
|
15443
|
+
: "",
|
|
15444
|
+
};
|
|
15445
|
+
},
|
|
15446
|
+
|
|
15447
|
+
toJSON(message: StreamEntitlementsRequest): unknown {
|
|
15448
|
+
const obj: any = {};
|
|
15449
|
+
if (message.organizationId !== "") {
|
|
15450
|
+
obj.organizationId = message.organizationId;
|
|
15451
|
+
}
|
|
15452
|
+
if (message.projectId !== "") {
|
|
15453
|
+
obj.projectId = message.projectId;
|
|
15454
|
+
}
|
|
15455
|
+
return obj;
|
|
15456
|
+
},
|
|
15457
|
+
|
|
15458
|
+
create<I extends Exact<DeepPartial<StreamEntitlementsRequest>, I>>(base?: I): StreamEntitlementsRequest {
|
|
15459
|
+
return StreamEntitlementsRequest.fromPartial(base ?? ({} as any));
|
|
15460
|
+
},
|
|
15461
|
+
fromPartial<I extends Exact<DeepPartial<StreamEntitlementsRequest>, I>>(object: I): StreamEntitlementsRequest {
|
|
15462
|
+
const message = createBaseStreamEntitlementsRequest();
|
|
15463
|
+
message.organizationId = object.organizationId ?? "";
|
|
15464
|
+
message.projectId = object.projectId ?? "";
|
|
15465
|
+
return message;
|
|
15466
|
+
},
|
|
15467
|
+
};
|
|
15468
|
+
|
|
15469
|
+
function createBaseEntitlementsSnapshot(): EntitlementsSnapshot {
|
|
15470
|
+
return { seats: [], asOf: undefined };
|
|
15471
|
+
}
|
|
15472
|
+
|
|
15473
|
+
export const EntitlementsSnapshot: MessageFns<EntitlementsSnapshot> = {
|
|
15474
|
+
encode(message: EntitlementsSnapshot, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
15475
|
+
for (const v of message.seats) {
|
|
15476
|
+
SeatEntitlement.encode(v!, writer.uint32(10).fork()).join();
|
|
15477
|
+
}
|
|
15478
|
+
if (message.asOf !== undefined) {
|
|
15479
|
+
Timestamp.encode(toTimestamp(message.asOf), writer.uint32(18).fork()).join();
|
|
15480
|
+
}
|
|
15481
|
+
return writer;
|
|
15482
|
+
},
|
|
15483
|
+
|
|
15484
|
+
decode(input: BinaryReader | Uint8Array, length?: number): EntitlementsSnapshot {
|
|
15485
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15486
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
15487
|
+
if (previousRecursionDepth >= 100) {
|
|
15488
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
15489
|
+
}
|
|
15490
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
15491
|
+
try {
|
|
15492
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
15493
|
+
const message = createBaseEntitlementsSnapshot();
|
|
15494
|
+
while (reader.pos < end) {
|
|
15495
|
+
const tag = reader.uint32();
|
|
15496
|
+
switch (tag >>> 3) {
|
|
15497
|
+
case 1: {
|
|
15498
|
+
if (tag !== 10) {
|
|
15499
|
+
break;
|
|
15500
|
+
}
|
|
15501
|
+
|
|
15502
|
+
message.seats.push(SeatEntitlement.decode(reader, reader.uint32()));
|
|
15503
|
+
continue;
|
|
15504
|
+
}
|
|
15505
|
+
case 2: {
|
|
15506
|
+
if (tag !== 18) {
|
|
15507
|
+
break;
|
|
15508
|
+
}
|
|
15509
|
+
|
|
15510
|
+
message.asOf = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
15511
|
+
continue;
|
|
15512
|
+
}
|
|
15513
|
+
}
|
|
15514
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15515
|
+
break;
|
|
15516
|
+
}
|
|
15517
|
+
reader.skip(tag & 7);
|
|
15518
|
+
}
|
|
15519
|
+
return message;
|
|
15520
|
+
} finally {
|
|
15521
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
15522
|
+
}
|
|
15523
|
+
},
|
|
15524
|
+
|
|
15525
|
+
fromJSON(object: any): EntitlementsSnapshot {
|
|
15526
|
+
return {
|
|
15527
|
+
seats: globalThis.Array.isArray(object?.seats) ? object.seats.map((e: any) => SeatEntitlement.fromJSON(e)) : [],
|
|
15528
|
+
asOf: isSet(object.asOf)
|
|
15529
|
+
? fromJsonTimestamp(object.asOf)
|
|
15530
|
+
: isSet(object.as_of)
|
|
15531
|
+
? fromJsonTimestamp(object.as_of)
|
|
15532
|
+
: undefined,
|
|
15533
|
+
};
|
|
15534
|
+
},
|
|
15535
|
+
|
|
15536
|
+
toJSON(message: EntitlementsSnapshot): unknown {
|
|
15537
|
+
const obj: any = {};
|
|
15538
|
+
if (message.seats?.length) {
|
|
15539
|
+
obj.seats = message.seats.map((e) => SeatEntitlement.toJSON(e));
|
|
15540
|
+
}
|
|
15541
|
+
if (message.asOf !== undefined) {
|
|
15542
|
+
obj.asOf = message.asOf.toISOString();
|
|
15543
|
+
}
|
|
15544
|
+
return obj;
|
|
15545
|
+
},
|
|
15546
|
+
|
|
15547
|
+
create<I extends Exact<DeepPartial<EntitlementsSnapshot>, I>>(base?: I): EntitlementsSnapshot {
|
|
15548
|
+
return EntitlementsSnapshot.fromPartial(base ?? ({} as any));
|
|
15549
|
+
},
|
|
15550
|
+
fromPartial<I extends Exact<DeepPartial<EntitlementsSnapshot>, I>>(object: I): EntitlementsSnapshot {
|
|
15551
|
+
const message = createBaseEntitlementsSnapshot();
|
|
15552
|
+
message.seats = object.seats?.map((e) => SeatEntitlement.fromPartial(e)) || [];
|
|
15553
|
+
message.asOf = object.asOf ?? undefined;
|
|
15554
|
+
return message;
|
|
15555
|
+
},
|
|
15556
|
+
};
|
|
15557
|
+
|
|
15558
|
+
function createBaseSeatEntitlement(): SeatEntitlement {
|
|
15559
|
+
return {
|
|
15560
|
+
sourceSystem: "",
|
|
15561
|
+
accountId: "",
|
|
15562
|
+
principalId: "",
|
|
15563
|
+
principalName: "",
|
|
15564
|
+
fundingMode: 0,
|
|
15565
|
+
windows: [],
|
|
15566
|
+
eventTime: undefined,
|
|
15567
|
+
creditsBalanceRaw: undefined,
|
|
15568
|
+
creditsUnlimited: undefined,
|
|
15569
|
+
planType: "",
|
|
15570
|
+
seatTier: "",
|
|
15571
|
+
evidenceSource: "",
|
|
15572
|
+
};
|
|
15573
|
+
}
|
|
15574
|
+
|
|
15575
|
+
export const SeatEntitlement: MessageFns<SeatEntitlement> = {
|
|
15576
|
+
encode(message: SeatEntitlement, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
15577
|
+
if (message.sourceSystem !== "") {
|
|
15578
|
+
writer.uint32(10).string(message.sourceSystem);
|
|
15579
|
+
}
|
|
15580
|
+
if (message.accountId !== "") {
|
|
15581
|
+
writer.uint32(18).string(message.accountId);
|
|
15582
|
+
}
|
|
15583
|
+
if (message.principalId !== "") {
|
|
15584
|
+
writer.uint32(26).string(message.principalId);
|
|
15585
|
+
}
|
|
15586
|
+
if (message.principalName !== "") {
|
|
15587
|
+
writer.uint32(34).string(message.principalName);
|
|
15588
|
+
}
|
|
15589
|
+
if (message.fundingMode !== 0) {
|
|
15590
|
+
writer.uint32(40).int32(message.fundingMode);
|
|
15591
|
+
}
|
|
15592
|
+
for (const v of message.windows) {
|
|
15593
|
+
EntitlementWindow.encode(v!, writer.uint32(50).fork()).join();
|
|
15594
|
+
}
|
|
15595
|
+
if (message.eventTime !== undefined) {
|
|
15596
|
+
Timestamp.encode(toTimestamp(message.eventTime), writer.uint32(58).fork()).join();
|
|
15597
|
+
}
|
|
15598
|
+
if (message.creditsBalanceRaw !== undefined) {
|
|
15599
|
+
writer.uint32(66).string(message.creditsBalanceRaw);
|
|
15600
|
+
}
|
|
15601
|
+
if (message.creditsUnlimited !== undefined) {
|
|
15602
|
+
writer.uint32(72).bool(message.creditsUnlimited);
|
|
15603
|
+
}
|
|
15604
|
+
if (message.planType !== "") {
|
|
15605
|
+
writer.uint32(82).string(message.planType);
|
|
15606
|
+
}
|
|
15607
|
+
if (message.seatTier !== "") {
|
|
15608
|
+
writer.uint32(90).string(message.seatTier);
|
|
15609
|
+
}
|
|
15610
|
+
if (message.evidenceSource !== "") {
|
|
15611
|
+
writer.uint32(98).string(message.evidenceSource);
|
|
15612
|
+
}
|
|
15613
|
+
return writer;
|
|
15614
|
+
},
|
|
15615
|
+
|
|
15616
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SeatEntitlement {
|
|
15617
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15618
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
15619
|
+
if (previousRecursionDepth >= 100) {
|
|
15620
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
15621
|
+
}
|
|
15622
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
15623
|
+
try {
|
|
15624
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
15625
|
+
const message = createBaseSeatEntitlement();
|
|
15626
|
+
while (reader.pos < end) {
|
|
15627
|
+
const tag = reader.uint32();
|
|
15628
|
+
switch (tag >>> 3) {
|
|
15629
|
+
case 1: {
|
|
15630
|
+
if (tag !== 10) {
|
|
15631
|
+
break;
|
|
15632
|
+
}
|
|
15633
|
+
|
|
15634
|
+
message.sourceSystem = reader.string();
|
|
15635
|
+
continue;
|
|
15636
|
+
}
|
|
15637
|
+
case 2: {
|
|
15638
|
+
if (tag !== 18) {
|
|
15639
|
+
break;
|
|
15640
|
+
}
|
|
15641
|
+
|
|
15642
|
+
message.accountId = reader.string();
|
|
15643
|
+
continue;
|
|
15644
|
+
}
|
|
15645
|
+
case 3: {
|
|
15646
|
+
if (tag !== 26) {
|
|
15647
|
+
break;
|
|
15648
|
+
}
|
|
15649
|
+
|
|
15650
|
+
message.principalId = reader.string();
|
|
15651
|
+
continue;
|
|
15652
|
+
}
|
|
15653
|
+
case 4: {
|
|
15654
|
+
if (tag !== 34) {
|
|
15655
|
+
break;
|
|
15656
|
+
}
|
|
15657
|
+
|
|
15658
|
+
message.principalName = reader.string();
|
|
15659
|
+
continue;
|
|
15660
|
+
}
|
|
15661
|
+
case 5: {
|
|
15662
|
+
if (tag !== 40) {
|
|
15663
|
+
break;
|
|
15664
|
+
}
|
|
15665
|
+
|
|
15666
|
+
message.fundingMode = reader.int32() as any;
|
|
15667
|
+
continue;
|
|
15668
|
+
}
|
|
15669
|
+
case 6: {
|
|
15670
|
+
if (tag !== 50) {
|
|
15671
|
+
break;
|
|
15672
|
+
}
|
|
15673
|
+
|
|
15674
|
+
message.windows.push(EntitlementWindow.decode(reader, reader.uint32()));
|
|
15675
|
+
continue;
|
|
15676
|
+
}
|
|
15677
|
+
case 7: {
|
|
15678
|
+
if (tag !== 58) {
|
|
15679
|
+
break;
|
|
15680
|
+
}
|
|
15681
|
+
|
|
15682
|
+
message.eventTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
15683
|
+
continue;
|
|
15684
|
+
}
|
|
15685
|
+
case 8: {
|
|
15686
|
+
if (tag !== 66) {
|
|
15687
|
+
break;
|
|
15688
|
+
}
|
|
15689
|
+
|
|
15690
|
+
message.creditsBalanceRaw = reader.string();
|
|
15691
|
+
continue;
|
|
15692
|
+
}
|
|
15693
|
+
case 9: {
|
|
15694
|
+
if (tag !== 72) {
|
|
15695
|
+
break;
|
|
15696
|
+
}
|
|
15697
|
+
|
|
15698
|
+
message.creditsUnlimited = reader.bool();
|
|
15699
|
+
continue;
|
|
15700
|
+
}
|
|
15701
|
+
case 10: {
|
|
15702
|
+
if (tag !== 82) {
|
|
15703
|
+
break;
|
|
15704
|
+
}
|
|
15705
|
+
|
|
15706
|
+
message.planType = reader.string();
|
|
15707
|
+
continue;
|
|
15708
|
+
}
|
|
15709
|
+
case 11: {
|
|
15710
|
+
if (tag !== 90) {
|
|
15711
|
+
break;
|
|
15712
|
+
}
|
|
15713
|
+
|
|
15714
|
+
message.seatTier = reader.string();
|
|
15715
|
+
continue;
|
|
15716
|
+
}
|
|
15717
|
+
case 12: {
|
|
15718
|
+
if (tag !== 98) {
|
|
15719
|
+
break;
|
|
15720
|
+
}
|
|
15721
|
+
|
|
15722
|
+
message.evidenceSource = reader.string();
|
|
15723
|
+
continue;
|
|
15724
|
+
}
|
|
15725
|
+
}
|
|
15726
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15727
|
+
break;
|
|
15728
|
+
}
|
|
15729
|
+
reader.skip(tag & 7);
|
|
15730
|
+
}
|
|
15731
|
+
return message;
|
|
15732
|
+
} finally {
|
|
15733
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
15734
|
+
}
|
|
15735
|
+
},
|
|
15736
|
+
|
|
15737
|
+
fromJSON(object: any): SeatEntitlement {
|
|
15738
|
+
return {
|
|
15739
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
15740
|
+
? globalThis.String(object.sourceSystem)
|
|
15741
|
+
: isSet(object.source_system)
|
|
15742
|
+
? globalThis.String(object.source_system)
|
|
15743
|
+
: "",
|
|
15744
|
+
accountId: isSet(object.accountId)
|
|
15745
|
+
? globalThis.String(object.accountId)
|
|
15746
|
+
: isSet(object.account_id)
|
|
15747
|
+
? globalThis.String(object.account_id)
|
|
15748
|
+
: "",
|
|
15749
|
+
principalId: isSet(object.principalId)
|
|
15750
|
+
? globalThis.String(object.principalId)
|
|
15751
|
+
: isSet(object.principal_id)
|
|
15752
|
+
? globalThis.String(object.principal_id)
|
|
15753
|
+
: "",
|
|
15754
|
+
principalName: isSet(object.principalName)
|
|
15755
|
+
? globalThis.String(object.principalName)
|
|
15756
|
+
: isSet(object.principal_name)
|
|
15757
|
+
? globalThis.String(object.principal_name)
|
|
15758
|
+
: "",
|
|
15759
|
+
fundingMode: isSet(object.fundingMode)
|
|
15760
|
+
? aIFundingModeFromJSON(object.fundingMode)
|
|
15761
|
+
: isSet(object.funding_mode)
|
|
15762
|
+
? aIFundingModeFromJSON(object.funding_mode)
|
|
15763
|
+
: 0,
|
|
15764
|
+
windows: globalThis.Array.isArray(object?.windows)
|
|
15765
|
+
? object.windows.map((e: any) => EntitlementWindow.fromJSON(e))
|
|
15766
|
+
: [],
|
|
15767
|
+
eventTime: isSet(object.eventTime)
|
|
15768
|
+
? fromJsonTimestamp(object.eventTime)
|
|
15769
|
+
: isSet(object.event_time)
|
|
15770
|
+
? fromJsonTimestamp(object.event_time)
|
|
15771
|
+
: undefined,
|
|
15772
|
+
creditsBalanceRaw: isSet(object.creditsBalanceRaw)
|
|
15773
|
+
? globalThis.String(object.creditsBalanceRaw)
|
|
15774
|
+
: isSet(object.credits_balance_raw)
|
|
15775
|
+
? globalThis.String(object.credits_balance_raw)
|
|
15776
|
+
: undefined,
|
|
15777
|
+
creditsUnlimited: isSet(object.creditsUnlimited)
|
|
15778
|
+
? globalThis.Boolean(object.creditsUnlimited)
|
|
15779
|
+
: isSet(object.credits_unlimited)
|
|
15780
|
+
? globalThis.Boolean(object.credits_unlimited)
|
|
15781
|
+
: undefined,
|
|
15782
|
+
planType: isSet(object.planType)
|
|
15783
|
+
? globalThis.String(object.planType)
|
|
15784
|
+
: isSet(object.plan_type)
|
|
15785
|
+
? globalThis.String(object.plan_type)
|
|
15786
|
+
: "",
|
|
15787
|
+
seatTier: isSet(object.seatTier)
|
|
15788
|
+
? globalThis.String(object.seatTier)
|
|
15789
|
+
: isSet(object.seat_tier)
|
|
15790
|
+
? globalThis.String(object.seat_tier)
|
|
15791
|
+
: "",
|
|
15792
|
+
evidenceSource: isSet(object.evidenceSource)
|
|
15793
|
+
? globalThis.String(object.evidenceSource)
|
|
15794
|
+
: isSet(object.evidence_source)
|
|
15795
|
+
? globalThis.String(object.evidence_source)
|
|
15796
|
+
: "",
|
|
15797
|
+
};
|
|
15798
|
+
},
|
|
15799
|
+
|
|
15800
|
+
toJSON(message: SeatEntitlement): unknown {
|
|
15801
|
+
const obj: any = {};
|
|
15802
|
+
if (message.sourceSystem !== "") {
|
|
15803
|
+
obj.sourceSystem = message.sourceSystem;
|
|
15804
|
+
}
|
|
15805
|
+
if (message.accountId !== "") {
|
|
15806
|
+
obj.accountId = message.accountId;
|
|
15807
|
+
}
|
|
15808
|
+
if (message.principalId !== "") {
|
|
15809
|
+
obj.principalId = message.principalId;
|
|
15810
|
+
}
|
|
15811
|
+
if (message.principalName !== "") {
|
|
15812
|
+
obj.principalName = message.principalName;
|
|
15813
|
+
}
|
|
15814
|
+
if (message.fundingMode !== 0) {
|
|
15815
|
+
obj.fundingMode = aIFundingModeToJSON(message.fundingMode);
|
|
15816
|
+
}
|
|
15817
|
+
if (message.windows?.length) {
|
|
15818
|
+
obj.windows = message.windows.map((e) => EntitlementWindow.toJSON(e));
|
|
15819
|
+
}
|
|
15820
|
+
if (message.eventTime !== undefined) {
|
|
15821
|
+
obj.eventTime = message.eventTime.toISOString();
|
|
15822
|
+
}
|
|
15823
|
+
if (message.creditsBalanceRaw !== undefined) {
|
|
15824
|
+
obj.creditsBalanceRaw = message.creditsBalanceRaw;
|
|
15825
|
+
}
|
|
15826
|
+
if (message.creditsUnlimited !== undefined) {
|
|
15827
|
+
obj.creditsUnlimited = message.creditsUnlimited;
|
|
15828
|
+
}
|
|
15829
|
+
if (message.planType !== "") {
|
|
15830
|
+
obj.planType = message.planType;
|
|
15831
|
+
}
|
|
15832
|
+
if (message.seatTier !== "") {
|
|
15833
|
+
obj.seatTier = message.seatTier;
|
|
15834
|
+
}
|
|
15835
|
+
if (message.evidenceSource !== "") {
|
|
15836
|
+
obj.evidenceSource = message.evidenceSource;
|
|
15837
|
+
}
|
|
15838
|
+
return obj;
|
|
15839
|
+
},
|
|
15840
|
+
|
|
15841
|
+
create<I extends Exact<DeepPartial<SeatEntitlement>, I>>(base?: I): SeatEntitlement {
|
|
15842
|
+
return SeatEntitlement.fromPartial(base ?? ({} as any));
|
|
15843
|
+
},
|
|
15844
|
+
fromPartial<I extends Exact<DeepPartial<SeatEntitlement>, I>>(object: I): SeatEntitlement {
|
|
15845
|
+
const message = createBaseSeatEntitlement();
|
|
15846
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
15847
|
+
message.accountId = object.accountId ?? "";
|
|
15848
|
+
message.principalId = object.principalId ?? "";
|
|
15849
|
+
message.principalName = object.principalName ?? "";
|
|
15850
|
+
message.fundingMode = object.fundingMode ?? 0;
|
|
15851
|
+
message.windows = object.windows?.map((e) => EntitlementWindow.fromPartial(e)) || [];
|
|
15852
|
+
message.eventTime = object.eventTime ?? undefined;
|
|
15853
|
+
message.creditsBalanceRaw = object.creditsBalanceRaw ?? undefined;
|
|
15854
|
+
message.creditsUnlimited = object.creditsUnlimited ?? undefined;
|
|
15855
|
+
message.planType = object.planType ?? "";
|
|
15856
|
+
message.seatTier = object.seatTier ?? "";
|
|
15857
|
+
message.evidenceSource = object.evidenceSource ?? "";
|
|
15858
|
+
return message;
|
|
15859
|
+
},
|
|
15860
|
+
};
|
|
15861
|
+
|
|
15862
|
+
function createBaseEntitlementWindow(): EntitlementWindow {
|
|
15863
|
+
return { kind: "", usedPct: undefined, resetsAt: undefined, role: 0, windowSeconds: undefined };
|
|
15864
|
+
}
|
|
15865
|
+
|
|
15866
|
+
export const EntitlementWindow: MessageFns<EntitlementWindow> = {
|
|
15867
|
+
encode(message: EntitlementWindow, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
15868
|
+
if (message.kind !== "") {
|
|
15869
|
+
writer.uint32(10).string(message.kind);
|
|
15870
|
+
}
|
|
15871
|
+
if (message.usedPct !== undefined) {
|
|
15872
|
+
writer.uint32(17).double(message.usedPct);
|
|
15873
|
+
}
|
|
15874
|
+
if (message.resetsAt !== undefined) {
|
|
15875
|
+
Timestamp.encode(toTimestamp(message.resetsAt), writer.uint32(26).fork()).join();
|
|
15876
|
+
}
|
|
15877
|
+
if (message.role !== 0) {
|
|
15878
|
+
writer.uint32(32).int32(message.role);
|
|
15879
|
+
}
|
|
15880
|
+
if (message.windowSeconds !== undefined) {
|
|
15881
|
+
writer.uint32(40).uint32(message.windowSeconds);
|
|
15882
|
+
}
|
|
15883
|
+
return writer;
|
|
15884
|
+
},
|
|
15885
|
+
|
|
15886
|
+
decode(input: BinaryReader | Uint8Array, length?: number): EntitlementWindow {
|
|
15887
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
15888
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
15889
|
+
if (previousRecursionDepth >= 100) {
|
|
15890
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
15891
|
+
}
|
|
15892
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
15893
|
+
try {
|
|
15894
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
15895
|
+
const message = createBaseEntitlementWindow();
|
|
15896
|
+
while (reader.pos < end) {
|
|
15897
|
+
const tag = reader.uint32();
|
|
15898
|
+
switch (tag >>> 3) {
|
|
15899
|
+
case 1: {
|
|
15900
|
+
if (tag !== 10) {
|
|
15901
|
+
break;
|
|
15902
|
+
}
|
|
15903
|
+
|
|
15904
|
+
message.kind = reader.string();
|
|
15905
|
+
continue;
|
|
15906
|
+
}
|
|
15907
|
+
case 2: {
|
|
15908
|
+
if (tag !== 17) {
|
|
15909
|
+
break;
|
|
15910
|
+
}
|
|
15911
|
+
|
|
15912
|
+
message.usedPct = reader.double();
|
|
15913
|
+
continue;
|
|
15914
|
+
}
|
|
15915
|
+
case 3: {
|
|
15916
|
+
if (tag !== 26) {
|
|
15917
|
+
break;
|
|
15918
|
+
}
|
|
15919
|
+
|
|
15920
|
+
message.resetsAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
15921
|
+
continue;
|
|
15922
|
+
}
|
|
15923
|
+
case 4: {
|
|
15924
|
+
if (tag !== 32) {
|
|
15925
|
+
break;
|
|
15926
|
+
}
|
|
15927
|
+
|
|
15928
|
+
message.role = reader.int32() as any;
|
|
15929
|
+
continue;
|
|
15930
|
+
}
|
|
15931
|
+
case 5: {
|
|
15932
|
+
if (tag !== 40) {
|
|
15933
|
+
break;
|
|
15934
|
+
}
|
|
15935
|
+
|
|
15936
|
+
message.windowSeconds = reader.uint32();
|
|
15937
|
+
continue;
|
|
15938
|
+
}
|
|
15939
|
+
}
|
|
15940
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
15941
|
+
break;
|
|
15942
|
+
}
|
|
15943
|
+
reader.skip(tag & 7);
|
|
15944
|
+
}
|
|
15945
|
+
return message;
|
|
15946
|
+
} finally {
|
|
15947
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
15948
|
+
}
|
|
15949
|
+
},
|
|
15950
|
+
|
|
15951
|
+
fromJSON(object: any): EntitlementWindow {
|
|
15952
|
+
return {
|
|
15953
|
+
kind: isSet(object.kind) ? globalThis.String(object.kind) : "",
|
|
15954
|
+
usedPct: isSet(object.usedPct)
|
|
15955
|
+
? globalThis.Number(object.usedPct)
|
|
15956
|
+
: isSet(object.used_pct)
|
|
15957
|
+
? globalThis.Number(object.used_pct)
|
|
15958
|
+
: undefined,
|
|
15959
|
+
resetsAt: isSet(object.resetsAt)
|
|
15960
|
+
? fromJsonTimestamp(object.resetsAt)
|
|
15961
|
+
: isSet(object.resets_at)
|
|
15962
|
+
? fromJsonTimestamp(object.resets_at)
|
|
15963
|
+
: undefined,
|
|
15964
|
+
role: isSet(object.role) ? aIEntitlementRoleFromJSON(object.role) : 0,
|
|
15965
|
+
windowSeconds: isSet(object.windowSeconds)
|
|
15966
|
+
? globalThis.Number(object.windowSeconds)
|
|
15967
|
+
: isSet(object.window_seconds)
|
|
15968
|
+
? globalThis.Number(object.window_seconds)
|
|
15969
|
+
: undefined,
|
|
15970
|
+
};
|
|
15971
|
+
},
|
|
15972
|
+
|
|
15973
|
+
toJSON(message: EntitlementWindow): unknown {
|
|
15974
|
+
const obj: any = {};
|
|
15975
|
+
if (message.kind !== "") {
|
|
15976
|
+
obj.kind = message.kind;
|
|
15977
|
+
}
|
|
15978
|
+
if (message.usedPct !== undefined) {
|
|
15979
|
+
obj.usedPct = message.usedPct;
|
|
15980
|
+
}
|
|
15981
|
+
if (message.resetsAt !== undefined) {
|
|
15982
|
+
obj.resetsAt = message.resetsAt.toISOString();
|
|
15983
|
+
}
|
|
15984
|
+
if (message.role !== 0) {
|
|
15985
|
+
obj.role = aIEntitlementRoleToJSON(message.role);
|
|
15986
|
+
}
|
|
15987
|
+
if (message.windowSeconds !== undefined) {
|
|
15988
|
+
obj.windowSeconds = Math.round(message.windowSeconds);
|
|
15989
|
+
}
|
|
15990
|
+
return obj;
|
|
15991
|
+
},
|
|
15992
|
+
|
|
15993
|
+
create<I extends Exact<DeepPartial<EntitlementWindow>, I>>(base?: I): EntitlementWindow {
|
|
15994
|
+
return EntitlementWindow.fromPartial(base ?? ({} as any));
|
|
15995
|
+
},
|
|
15996
|
+
fromPartial<I extends Exact<DeepPartial<EntitlementWindow>, I>>(object: I): EntitlementWindow {
|
|
15997
|
+
const message = createBaseEntitlementWindow();
|
|
15998
|
+
message.kind = object.kind ?? "";
|
|
15999
|
+
message.usedPct = object.usedPct ?? undefined;
|
|
16000
|
+
message.resetsAt = object.resetsAt ?? undefined;
|
|
16001
|
+
message.role = object.role ?? 0;
|
|
16002
|
+
message.windowSeconds = object.windowSeconds ?? undefined;
|
|
16003
|
+
return message;
|
|
16004
|
+
},
|
|
16005
|
+
};
|
|
16006
|
+
|
|
16007
|
+
/**
|
|
16008
|
+
* AIGatewayService is the frontend-facing proxy over telemetry.api.v1.AIService.
|
|
16009
|
+
* It stamps the authorized organization/project and forwards telemetry-api-shaped messages.
|
|
16010
|
+
*/
|
|
16011
|
+
export interface AIGatewayService {
|
|
16012
|
+
/**
|
|
16013
|
+
* One numbered page of the conversation catalog (sessions folded to
|
|
16014
|
+
* one rollup by source_system + session_id), ranked by sort. Weakly consistent
|
|
16015
|
+
* (latest-state, no frozen snapshot).
|
|
16016
|
+
*/
|
|
16017
|
+
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse>;
|
|
16018
|
+
/**
|
|
16019
|
+
* Keeps the first conversation page live: the whole top-N page re-derived each tick
|
|
16020
|
+
* as one SessionsSnapshot, replacing client state wholesale (not a delta feed).
|
|
16021
|
+
*/
|
|
16022
|
+
StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot>;
|
|
16023
|
+
/** Live sidebar rollup (session_id + source_system): re-derived and re-emitted whole each tick. */
|
|
16024
|
+
StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary>;
|
|
16025
|
+
ListSessionEvents(request: ListSessionEventsRequest, metadata?: Metadata): Promise<ListSessionEventsResponse>;
|
|
16026
|
+
StreamSessionEvents(request: StreamSessionEventsRequest, metadata?: Metadata): Observable<AISessionEventEnvelope>;
|
|
16027
|
+
/**
|
|
16028
|
+
* Live, backend-computed, per-event token series for one session (replacement snapshots):
|
|
16029
|
+
* one content-free point per logical event + whole-session totals; point count is capped.
|
|
16030
|
+
*/
|
|
16031
|
+
StreamSessionTokenTimeline(
|
|
16032
|
+
request: SessionTokenTimelineRequest,
|
|
16033
|
+
metadata?: Metadata,
|
|
16034
|
+
): Observable<SessionTokenTimeline>;
|
|
16035
|
+
/** Live "Files changed" card: per file the latest-observed git change-type + exact --numstat churn. */
|
|
16036
|
+
StreamSessionFileChanges(request: SessionFileChangesRequest, metadata?: Metadata): Observable<SessionFileChanges>;
|
|
16037
|
+
ListPrincipals(request: ListPrincipalsRequest, metadata?: Metadata): Promise<ListPrincipalsResponse>;
|
|
16038
|
+
UpdatePrincipal(request: UpdatePrincipalRequest, metadata?: Metadata): Promise<UpdatePrincipalResponse>;
|
|
16039
|
+
/** Filtered, keyset-paginated drill-down feed of git/GitHub actions (newest first). */
|
|
16040
|
+
ListGitActivities(request: ListGitActivitiesRequest, metadata?: Metadata): Promise<ListGitActivitiesResponse>;
|
|
16041
|
+
/**
|
|
16042
|
+
* Live stream of the filtered git/GitHub feed (UPSERT per activity keyed by
|
|
16043
|
+
* activity_id, a nonterminal GitActivitiesSnapshotCompleted, then open until cancel).
|
|
16044
|
+
*/
|
|
16045
|
+
StreamGitActivities(request: StreamGitActivitiesRequest, metadata?: Metadata): Observable<GitActivityFrame>;
|
|
16046
|
+
/**
|
|
16047
|
+
* Live stream of the git dashboard's overview: a full windowed, dimension-sliced rollup of the filtered
|
|
16048
|
+
* git activities (whole-window totals ride each frame), re-derived each tick.
|
|
16049
|
+
*/
|
|
16050
|
+
StreamGitActivitySummary(request: GitActivitySummaryRequest, metadata?: Metadata): Observable<GitActivitySummary>;
|
|
16051
|
+
/**
|
|
16052
|
+
* Live token burn calendar: a windowed, dimension-sliced token/cost trend series
|
|
16053
|
+
* plus whole-window totals.
|
|
16054
|
+
*/
|
|
16055
|
+
StreamTokenActivitySummary(
|
|
16056
|
+
request: TokenActivitySummaryRequest,
|
|
16057
|
+
metadata?: Metadata,
|
|
16058
|
+
): Observable<TokenActivitySummary>;
|
|
16059
|
+
/**
|
|
16060
|
+
* Live "burn rate now" gauge: the trailing-60s cost/hr + tokens/min (total plus a per-dimension
|
|
16061
|
+
* breakdown) and a fixed 60-minute one-minute rolling sparkline of that rate. Fixed horizon, fast
|
|
16062
|
+
* refresh; first frame is a full snapshot.
|
|
16063
|
+
*/
|
|
16064
|
+
StreamBurnRate(request: BurnRateRequest, metadata?: Metadata): Observable<BurnRate>;
|
|
16065
|
+
/**
|
|
16066
|
+
* Live token-burn calendar over an inclusive UTC [start_date, end_date] range: one complete row per
|
|
16067
|
+
* covered day off the precomputed daily rollup. Covered empty days are zero; uncomputed history is
|
|
16068
|
+
* omitted; today is provisional.
|
|
16069
|
+
*/
|
|
16070
|
+
StreamDailyActivity(request: DailyActivityRequest, metadata?: Metadata): Observable<DailyActivity>;
|
|
16071
|
+
/**
|
|
16072
|
+
* Live weekly activity rhythm: a sparse (weekday, hour) heatmap over a bounded sliding window in an
|
|
16073
|
+
* explicit IANA time zone. Every latest logical event counts; settled model calls add token/cost.
|
|
16074
|
+
*/
|
|
16075
|
+
StreamActivityRhythm(request: ActivityRhythmRequest, metadata?: Metadata): Observable<ActivityRhythm>;
|
|
16076
|
+
/**
|
|
16077
|
+
* Live stream of one project's dashboard bundle: headline totals, model/provider/source mix,
|
|
16078
|
+
* and top sessions by cost.
|
|
16079
|
+
*/
|
|
16080
|
+
StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
|
|
16081
|
+
/** Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel. */
|
|
16082
|
+
ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
|
|
16083
|
+
/**
|
|
16084
|
+
* Live stream of the unlanded-work funnel: aging tiers + discarded (git-invisible churn), observed vs
|
|
16085
|
+
* unverified, a complete snapshot re-derived each tick.
|
|
16086
|
+
*/
|
|
16087
|
+
StreamFilesSummary(request: FilesSummaryRequest, metadata?: Metadata): Observable<FilesSummary>;
|
|
16088
|
+
/** Latest observed list price per (source, provider, model) from the global catalog. */
|
|
16089
|
+
ListModelPrices(request: ListModelPricesRequest, metadata?: Metadata): Promise<ListModelPricesResponse>;
|
|
16090
|
+
/**
|
|
16091
|
+
* Every stored observation for the filtered models over a time range, oldest first —
|
|
16092
|
+
* the rows ListModelPrices collapses. filter.model is required.
|
|
16093
|
+
*/
|
|
16094
|
+
ListModelPriceHistory(
|
|
16095
|
+
request: ListModelPriceHistoryRequest,
|
|
16096
|
+
metadata?: Metadata,
|
|
16097
|
+
): Promise<ListModelPriceHistoryResponse>;
|
|
16098
|
+
/**
|
|
16099
|
+
* Top-N most-used resources of one kind (skills / tools / files / URLs / bash commands) over a
|
|
16100
|
+
* sliding window, each with the prior equal-length window's count for a trend delta and distinct
|
|
16101
|
+
* sessions. Mirrors telemetry.api.v1.
|
|
16102
|
+
*/
|
|
16103
|
+
ListResourceRankings(request: ResourceRankingsRequest, metadata?: Metadata): Promise<ResourceRankingsResponse>;
|
|
16104
|
+
/**
|
|
16105
|
+
* Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
|
|
16106
|
+
* per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
|
|
16107
|
+
* telemetry.api.v1.
|
|
16108
|
+
*/
|
|
16109
|
+
StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot>;
|
|
16110
|
+
}
|
|
16111
|
+
|
|
16112
|
+
export const AIGatewayServiceServiceName = "gateway.web.v1.AIGatewayService";
|
|
16113
|
+
export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
16114
|
+
private readonly rpc: Rpc;
|
|
16115
|
+
private readonly service: string;
|
|
16116
|
+
constructor(rpc: Rpc, opts?: { service?: string }) {
|
|
16117
|
+
this.service = opts?.service || AIGatewayServiceServiceName;
|
|
16118
|
+
this.rpc = rpc;
|
|
16119
|
+
this.ListSessions = this.ListSessions.bind(this);
|
|
16120
|
+
this.StreamSessions = this.StreamSessions.bind(this);
|
|
16121
|
+
this.StreamSessionSummary = this.StreamSessionSummary.bind(this);
|
|
16122
|
+
this.ListSessionEvents = this.ListSessionEvents.bind(this);
|
|
16123
|
+
this.StreamSessionEvents = this.StreamSessionEvents.bind(this);
|
|
16124
|
+
this.StreamSessionTokenTimeline = this.StreamSessionTokenTimeline.bind(this);
|
|
16125
|
+
this.StreamSessionFileChanges = this.StreamSessionFileChanges.bind(this);
|
|
16126
|
+
this.ListPrincipals = this.ListPrincipals.bind(this);
|
|
16127
|
+
this.UpdatePrincipal = this.UpdatePrincipal.bind(this);
|
|
16128
|
+
this.ListGitActivities = this.ListGitActivities.bind(this);
|
|
16129
|
+
this.StreamGitActivities = this.StreamGitActivities.bind(this);
|
|
16130
|
+
this.StreamGitActivitySummary = this.StreamGitActivitySummary.bind(this);
|
|
16131
|
+
this.StreamTokenActivitySummary = this.StreamTokenActivitySummary.bind(this);
|
|
16132
|
+
this.StreamBurnRate = this.StreamBurnRate.bind(this);
|
|
16133
|
+
this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
|
|
16134
|
+
this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
|
|
16135
|
+
this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
|
|
16136
|
+
this.ListFiles = this.ListFiles.bind(this);
|
|
16137
|
+
this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
|
|
16138
|
+
this.ListModelPrices = this.ListModelPrices.bind(this);
|
|
16139
|
+
this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
|
|
16140
|
+
this.ListResourceRankings = this.ListResourceRankings.bind(this);
|
|
16141
|
+
this.StreamEntitlements = this.StreamEntitlements.bind(this);
|
|
16142
|
+
}
|
|
16143
|
+
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
|
|
16144
|
+
const data = ListSessionsRequest.encode(request).finish();
|
|
16145
|
+
const promise = this.rpc.request(this.service, "ListSessions", data, metadata);
|
|
16146
|
+
return promise.then((data) => ListSessionsResponse.decode(new BinaryReader(data)));
|
|
16147
|
+
}
|
|
16148
|
+
|
|
16149
|
+
StreamSessions(request: StreamSessionsRequest, metadata?: Metadata): Observable<SessionsSnapshot> {
|
|
16150
|
+
const data = StreamSessionsRequest.encode(request).finish();
|
|
16151
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamSessions", data, metadata);
|
|
16152
|
+
return result.pipe(map((data) => SessionsSnapshot.decode(new BinaryReader(data))));
|
|
16153
|
+
}
|
|
15090
16154
|
|
|
15091
16155
|
StreamSessionSummary(request: GetSessionSummaryRequest, metadata?: Metadata): Observable<AISessionSummary> {
|
|
15092
16156
|
const data = GetSessionSummaryRequest.encode(request).finish();
|
|
@@ -15216,6 +16280,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
15216
16280
|
const promise = this.rpc.request(this.service, "ListResourceRankings", data, metadata);
|
|
15217
16281
|
return promise.then((data) => ResourceRankingsResponse.decode(new BinaryReader(data)));
|
|
15218
16282
|
}
|
|
16283
|
+
|
|
16284
|
+
StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot> {
|
|
16285
|
+
const data = StreamEntitlementsRequest.encode(request).finish();
|
|
16286
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamEntitlements", data, metadata);
|
|
16287
|
+
return result.pipe(map((data) => EntitlementsSnapshot.decode(new BinaryReader(data))));
|
|
16288
|
+
}
|
|
15219
16289
|
}
|
|
15220
16290
|
|
|
15221
16291
|
interface Rpc {
|