@miradorlabs/web-grpc 3.6.0 → 3.7.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.
|
@@ -1636,6 +1636,57 @@ export interface ModelActivityPrincipal {
|
|
|
1636
1636
|
costUsd: number;
|
|
1637
1637
|
}
|
|
1638
1638
|
|
|
1639
|
+
export interface SessionUsageTrendRequest {
|
|
1640
|
+
organizationId: string;
|
|
1641
|
+
projectId: string;
|
|
1642
|
+
sourceSystem: string;
|
|
1643
|
+
/** The session's routing-key partitions, 1 to 100, read as one session. */
|
|
1644
|
+
sessionIds: string[];
|
|
1645
|
+
/**
|
|
1646
|
+
* Bucket width in seconds, > 0; buckets start at multiples of it since the Unix epoch (UTC). Widened to
|
|
1647
|
+
* the next step of 1, 5, 10, 15, 30, 60, 120, 300, 600, 900, 1800, 3600, 7200, 10800, 21600, 43200 s or a
|
|
1648
|
+
* whole number of days when the session would span more than 2000 buckets.
|
|
1649
|
+
*/
|
|
1650
|
+
bucketSeconds: number;
|
|
1651
|
+
}
|
|
1652
|
+
|
|
1653
|
+
export interface SessionUsageTrendResponse {
|
|
1654
|
+
status:
|
|
1655
|
+
| ResponseStatus
|
|
1656
|
+
| undefined;
|
|
1657
|
+
/** the width the buckets use */
|
|
1658
|
+
bucketSeconds: number;
|
|
1659
|
+
/** per (bucket, model), by bucket_start then model */
|
|
1660
|
+
buckets: SessionUsageBucket[];
|
|
1661
|
+
/** per (bucket, action), by bucket_start then action */
|
|
1662
|
+
gitBuckets: SessionGitBucket[];
|
|
1663
|
+
}
|
|
1664
|
+
|
|
1665
|
+
/**
|
|
1666
|
+
* SessionUsageBucket: model is the stored name, '' when unreported; input_tokens is cache-inclusive, the
|
|
1667
|
+
* cache fields are subsets.
|
|
1668
|
+
*/
|
|
1669
|
+
export interface SessionUsageBucket {
|
|
1670
|
+
bucketStart: Date | undefined;
|
|
1671
|
+
model: string;
|
|
1672
|
+
modelCalls: number;
|
|
1673
|
+
inputTokens: number;
|
|
1674
|
+
outputTokens: number;
|
|
1675
|
+
cacheReadTokens: number;
|
|
1676
|
+
cacheWriteTokens: number;
|
|
1677
|
+
costUsd: number;
|
|
1678
|
+
}
|
|
1679
|
+
|
|
1680
|
+
/**
|
|
1681
|
+
* SessionGitBucket: the stored action (commit, push, pr_create, pr_merge, …), counted as the session rollup
|
|
1682
|
+
* counts it (known failures left out).
|
|
1683
|
+
*/
|
|
1684
|
+
export interface SessionGitBucket {
|
|
1685
|
+
bucketStart: Date | undefined;
|
|
1686
|
+
action: string;
|
|
1687
|
+
count: number;
|
|
1688
|
+
}
|
|
1689
|
+
|
|
1639
1690
|
/** AISessionRef is a session's identity: two sources can issue the same session_id. */
|
|
1640
1691
|
export interface AISessionRef {
|
|
1641
1692
|
sourceSystem: string;
|
|
@@ -13696,22 +13747,31 @@ export const ModelActivityPrincipal: MessageFns<ModelActivityPrincipal> = {
|
|
|
13696
13747
|
},
|
|
13697
13748
|
};
|
|
13698
13749
|
|
|
13699
|
-
function
|
|
13700
|
-
return {
|
|
13750
|
+
function createBaseSessionUsageTrendRequest(): SessionUsageTrendRequest {
|
|
13751
|
+
return { organizationId: "", projectId: "", sourceSystem: "", sessionIds: [], bucketSeconds: 0 };
|
|
13701
13752
|
}
|
|
13702
13753
|
|
|
13703
|
-
export const
|
|
13704
|
-
encode(message:
|
|
13754
|
+
export const SessionUsageTrendRequest: MessageFns<SessionUsageTrendRequest> = {
|
|
13755
|
+
encode(message: SessionUsageTrendRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13756
|
+
if (message.organizationId !== "") {
|
|
13757
|
+
writer.uint32(10).string(message.organizationId);
|
|
13758
|
+
}
|
|
13759
|
+
if (message.projectId !== "") {
|
|
13760
|
+
writer.uint32(18).string(message.projectId);
|
|
13761
|
+
}
|
|
13705
13762
|
if (message.sourceSystem !== "") {
|
|
13706
|
-
writer.uint32(
|
|
13763
|
+
writer.uint32(26).string(message.sourceSystem);
|
|
13707
13764
|
}
|
|
13708
|
-
|
|
13709
|
-
writer.uint32(
|
|
13765
|
+
for (const v of message.sessionIds) {
|
|
13766
|
+
writer.uint32(34).string(v!);
|
|
13767
|
+
}
|
|
13768
|
+
if (message.bucketSeconds !== 0) {
|
|
13769
|
+
writer.uint32(40).uint32(message.bucketSeconds);
|
|
13710
13770
|
}
|
|
13711
13771
|
return writer;
|
|
13712
13772
|
},
|
|
13713
13773
|
|
|
13714
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
13774
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageTrendRequest {
|
|
13715
13775
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13716
13776
|
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13717
13777
|
if (previousRecursionDepth >= 100) {
|
|
@@ -13720,7 +13780,7 @@ export const AISessionRef: MessageFns<AISessionRef> = {
|
|
|
13720
13780
|
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13721
13781
|
try {
|
|
13722
13782
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13723
|
-
const message =
|
|
13783
|
+
const message = createBaseSessionUsageTrendRequest();
|
|
13724
13784
|
while (reader.pos < end) {
|
|
13725
13785
|
const tag = reader.uint32();
|
|
13726
13786
|
switch (tag >>> 3) {
|
|
@@ -13729,7 +13789,7 @@ export const AISessionRef: MessageFns<AISessionRef> = {
|
|
|
13729
13789
|
break;
|
|
13730
13790
|
}
|
|
13731
13791
|
|
|
13732
|
-
message.
|
|
13792
|
+
message.organizationId = reader.string();
|
|
13733
13793
|
continue;
|
|
13734
13794
|
}
|
|
13735
13795
|
case 2: {
|
|
@@ -13737,7 +13797,31 @@ export const AISessionRef: MessageFns<AISessionRef> = {
|
|
|
13737
13797
|
break;
|
|
13738
13798
|
}
|
|
13739
13799
|
|
|
13740
|
-
message.
|
|
13800
|
+
message.projectId = reader.string();
|
|
13801
|
+
continue;
|
|
13802
|
+
}
|
|
13803
|
+
case 3: {
|
|
13804
|
+
if (tag !== 26) {
|
|
13805
|
+
break;
|
|
13806
|
+
}
|
|
13807
|
+
|
|
13808
|
+
message.sourceSystem = reader.string();
|
|
13809
|
+
continue;
|
|
13810
|
+
}
|
|
13811
|
+
case 4: {
|
|
13812
|
+
if (tag !== 34) {
|
|
13813
|
+
break;
|
|
13814
|
+
}
|
|
13815
|
+
|
|
13816
|
+
message.sessionIds.push(reader.string());
|
|
13817
|
+
continue;
|
|
13818
|
+
}
|
|
13819
|
+
case 5: {
|
|
13820
|
+
if (tag !== 40) {
|
|
13821
|
+
break;
|
|
13822
|
+
}
|
|
13823
|
+
|
|
13824
|
+
message.bucketSeconds = reader.uint32();
|
|
13741
13825
|
continue;
|
|
13742
13826
|
}
|
|
13743
13827
|
}
|
|
@@ -13752,94 +13836,92 @@ export const AISessionRef: MessageFns<AISessionRef> = {
|
|
|
13752
13836
|
}
|
|
13753
13837
|
},
|
|
13754
13838
|
|
|
13755
|
-
fromJSON(object: any):
|
|
13839
|
+
fromJSON(object: any): SessionUsageTrendRequest {
|
|
13756
13840
|
return {
|
|
13841
|
+
organizationId: isSet(object.organizationId)
|
|
13842
|
+
? globalThis.String(object.organizationId)
|
|
13843
|
+
: isSet(object.organization_id)
|
|
13844
|
+
? globalThis.String(object.organization_id)
|
|
13845
|
+
: "",
|
|
13846
|
+
projectId: isSet(object.projectId)
|
|
13847
|
+
? globalThis.String(object.projectId)
|
|
13848
|
+
: isSet(object.project_id)
|
|
13849
|
+
? globalThis.String(object.project_id)
|
|
13850
|
+
: "",
|
|
13757
13851
|
sourceSystem: isSet(object.sourceSystem)
|
|
13758
13852
|
? globalThis.String(object.sourceSystem)
|
|
13759
13853
|
: isSet(object.source_system)
|
|
13760
13854
|
? globalThis.String(object.source_system)
|
|
13761
13855
|
: "",
|
|
13762
|
-
|
|
13763
|
-
? globalThis.String(
|
|
13764
|
-
:
|
|
13765
|
-
? globalThis.String(
|
|
13766
|
-
:
|
|
13856
|
+
sessionIds: globalThis.Array.isArray(object?.sessionIds)
|
|
13857
|
+
? object.sessionIds.map((e: any) => globalThis.String(e))
|
|
13858
|
+
: globalThis.Array.isArray(object?.session_ids)
|
|
13859
|
+
? object.session_ids.map((e: any) => globalThis.String(e))
|
|
13860
|
+
: [],
|
|
13861
|
+
bucketSeconds: isSet(object.bucketSeconds)
|
|
13862
|
+
? globalThis.Number(object.bucketSeconds)
|
|
13863
|
+
: isSet(object.bucket_seconds)
|
|
13864
|
+
? globalThis.Number(object.bucket_seconds)
|
|
13865
|
+
: 0,
|
|
13767
13866
|
};
|
|
13768
13867
|
},
|
|
13769
13868
|
|
|
13770
|
-
toJSON(message:
|
|
13869
|
+
toJSON(message: SessionUsageTrendRequest): unknown {
|
|
13771
13870
|
const obj: any = {};
|
|
13871
|
+
if (message.organizationId !== "") {
|
|
13872
|
+
obj.organizationId = message.organizationId;
|
|
13873
|
+
}
|
|
13874
|
+
if (message.projectId !== "") {
|
|
13875
|
+
obj.projectId = message.projectId;
|
|
13876
|
+
}
|
|
13772
13877
|
if (message.sourceSystem !== "") {
|
|
13773
13878
|
obj.sourceSystem = message.sourceSystem;
|
|
13774
13879
|
}
|
|
13775
|
-
if (message.
|
|
13776
|
-
obj.
|
|
13880
|
+
if (message.sessionIds?.length) {
|
|
13881
|
+
obj.sessionIds = message.sessionIds;
|
|
13882
|
+
}
|
|
13883
|
+
if (message.bucketSeconds !== 0) {
|
|
13884
|
+
obj.bucketSeconds = Math.round(message.bucketSeconds);
|
|
13777
13885
|
}
|
|
13778
13886
|
return obj;
|
|
13779
13887
|
},
|
|
13780
13888
|
|
|
13781
|
-
create<I extends Exact<DeepPartial<
|
|
13782
|
-
return
|
|
13889
|
+
create<I extends Exact<DeepPartial<SessionUsageTrendRequest>, I>>(base?: I): SessionUsageTrendRequest {
|
|
13890
|
+
return SessionUsageTrendRequest.fromPartial(base ?? ({} as any));
|
|
13783
13891
|
},
|
|
13784
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
13785
|
-
const message =
|
|
13892
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageTrendRequest>, I>>(object: I): SessionUsageTrendRequest {
|
|
13893
|
+
const message = createBaseSessionUsageTrendRequest();
|
|
13894
|
+
message.organizationId = object.organizationId ?? "";
|
|
13895
|
+
message.projectId = object.projectId ?? "";
|
|
13786
13896
|
message.sourceSystem = object.sourceSystem ?? "";
|
|
13787
|
-
message.
|
|
13897
|
+
message.sessionIds = object.sessionIds?.map((e) => e) || [];
|
|
13898
|
+
message.bucketSeconds = object.bucketSeconds ?? 0;
|
|
13788
13899
|
return message;
|
|
13789
13900
|
},
|
|
13790
13901
|
};
|
|
13791
13902
|
|
|
13792
|
-
function
|
|
13793
|
-
return {
|
|
13794
|
-
repositoryKey: [],
|
|
13795
|
-
ref: [],
|
|
13796
|
-
state: [],
|
|
13797
|
-
tier: [],
|
|
13798
|
-
session: [],
|
|
13799
|
-
minAge: undefined,
|
|
13800
|
-
activeAfter: undefined,
|
|
13801
|
-
activeBefore: undefined,
|
|
13802
|
-
abandonedHorizon: undefined,
|
|
13803
|
-
};
|
|
13903
|
+
function createBaseSessionUsageTrendResponse(): SessionUsageTrendResponse {
|
|
13904
|
+
return { status: undefined, bucketSeconds: 0, buckets: [], gitBuckets: [] };
|
|
13804
13905
|
}
|
|
13805
13906
|
|
|
13806
|
-
export const
|
|
13807
|
-
encode(message:
|
|
13808
|
-
|
|
13809
|
-
writer.uint32(10).
|
|
13810
|
-
}
|
|
13811
|
-
for (const v of message.ref) {
|
|
13812
|
-
writer.uint32(18).string(v!);
|
|
13813
|
-
}
|
|
13814
|
-
writer.uint32(26).fork();
|
|
13815
|
-
for (const v of message.state) {
|
|
13816
|
-
writer.int32(v);
|
|
13817
|
-
}
|
|
13818
|
-
writer.join();
|
|
13819
|
-
writer.uint32(34).fork();
|
|
13820
|
-
for (const v of message.tier) {
|
|
13821
|
-
writer.int32(v);
|
|
13822
|
-
}
|
|
13823
|
-
writer.join();
|
|
13824
|
-
for (const v of message.session) {
|
|
13825
|
-
AISessionRef.encode(v!, writer.uint32(42).fork()).join();
|
|
13826
|
-
}
|
|
13827
|
-
if (message.minAge !== undefined) {
|
|
13828
|
-
Duration.encode(message.minAge, writer.uint32(50).fork()).join();
|
|
13907
|
+
export const SessionUsageTrendResponse: MessageFns<SessionUsageTrendResponse> = {
|
|
13908
|
+
encode(message: SessionUsageTrendResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13909
|
+
if (message.status !== undefined) {
|
|
13910
|
+
ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
|
|
13829
13911
|
}
|
|
13830
|
-
if (message.
|
|
13831
|
-
|
|
13912
|
+
if (message.bucketSeconds !== 0) {
|
|
13913
|
+
writer.uint32(16).uint32(message.bucketSeconds);
|
|
13832
13914
|
}
|
|
13833
|
-
|
|
13834
|
-
|
|
13915
|
+
for (const v of message.buckets) {
|
|
13916
|
+
SessionUsageBucket.encode(v!, writer.uint32(26).fork()).join();
|
|
13835
13917
|
}
|
|
13836
|
-
|
|
13837
|
-
|
|
13918
|
+
for (const v of message.gitBuckets) {
|
|
13919
|
+
SessionGitBucket.encode(v!, writer.uint32(34).fork()).join();
|
|
13838
13920
|
}
|
|
13839
13921
|
return writer;
|
|
13840
13922
|
},
|
|
13841
13923
|
|
|
13842
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
13924
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageTrendResponse {
|
|
13843
13925
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13844
13926
|
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13845
13927
|
if (previousRecursionDepth >= 100) {
|
|
@@ -13848,7 +13930,7 @@ export const AIFileFilter: MessageFns<AIFileFilter> = {
|
|
|
13848
13930
|
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13849
13931
|
try {
|
|
13850
13932
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13851
|
-
const message =
|
|
13933
|
+
const message = createBaseSessionUsageTrendResponse();
|
|
13852
13934
|
while (reader.pos < end) {
|
|
13853
13935
|
const tag = reader.uint32();
|
|
13854
13936
|
switch (tag >>> 3) {
|
|
@@ -13857,91 +13939,31 @@ export const AIFileFilter: MessageFns<AIFileFilter> = {
|
|
|
13857
13939
|
break;
|
|
13858
13940
|
}
|
|
13859
13941
|
|
|
13860
|
-
message.
|
|
13942
|
+
message.status = ResponseStatus.decode(reader, reader.uint32());
|
|
13861
13943
|
continue;
|
|
13862
13944
|
}
|
|
13863
13945
|
case 2: {
|
|
13864
|
-
if (tag !==
|
|
13946
|
+
if (tag !== 16) {
|
|
13865
13947
|
break;
|
|
13866
13948
|
}
|
|
13867
13949
|
|
|
13868
|
-
message.
|
|
13950
|
+
message.bucketSeconds = reader.uint32();
|
|
13869
13951
|
continue;
|
|
13870
13952
|
}
|
|
13871
13953
|
case 3: {
|
|
13872
|
-
if (tag
|
|
13873
|
-
message.state.push(reader.int32() as any);
|
|
13874
|
-
|
|
13875
|
-
continue;
|
|
13876
|
-
}
|
|
13877
|
-
|
|
13878
|
-
if (tag === 26) {
|
|
13879
|
-
const end2 = reader.uint32() + reader.pos;
|
|
13880
|
-
while (reader.pos < end2) {
|
|
13881
|
-
message.state.push(reader.int32() as any);
|
|
13882
|
-
}
|
|
13883
|
-
|
|
13884
|
-
continue;
|
|
13885
|
-
}
|
|
13886
|
-
|
|
13887
|
-
break;
|
|
13888
|
-
}
|
|
13889
|
-
case 4: {
|
|
13890
|
-
if (tag === 32) {
|
|
13891
|
-
message.tier.push(reader.int32() as any);
|
|
13892
|
-
|
|
13893
|
-
continue;
|
|
13894
|
-
}
|
|
13895
|
-
|
|
13896
|
-
if (tag === 34) {
|
|
13897
|
-
const end2 = reader.uint32() + reader.pos;
|
|
13898
|
-
while (reader.pos < end2) {
|
|
13899
|
-
message.tier.push(reader.int32() as any);
|
|
13900
|
-
}
|
|
13901
|
-
|
|
13902
|
-
continue;
|
|
13903
|
-
}
|
|
13904
|
-
|
|
13905
|
-
break;
|
|
13906
|
-
}
|
|
13907
|
-
case 5: {
|
|
13908
|
-
if (tag !== 42) {
|
|
13909
|
-
break;
|
|
13910
|
-
}
|
|
13911
|
-
|
|
13912
|
-
message.session.push(AISessionRef.decode(reader, reader.uint32()));
|
|
13913
|
-
continue;
|
|
13914
|
-
}
|
|
13915
|
-
case 6: {
|
|
13916
|
-
if (tag !== 50) {
|
|
13917
|
-
break;
|
|
13918
|
-
}
|
|
13919
|
-
|
|
13920
|
-
message.minAge = Duration.decode(reader, reader.uint32());
|
|
13921
|
-
continue;
|
|
13922
|
-
}
|
|
13923
|
-
case 7: {
|
|
13924
|
-
if (tag !== 58) {
|
|
13925
|
-
break;
|
|
13926
|
-
}
|
|
13927
|
-
|
|
13928
|
-
message.activeAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
13929
|
-
continue;
|
|
13930
|
-
}
|
|
13931
|
-
case 8: {
|
|
13932
|
-
if (tag !== 66) {
|
|
13954
|
+
if (tag !== 26) {
|
|
13933
13955
|
break;
|
|
13934
13956
|
}
|
|
13935
13957
|
|
|
13936
|
-
message.
|
|
13958
|
+
message.buckets.push(SessionUsageBucket.decode(reader, reader.uint32()));
|
|
13937
13959
|
continue;
|
|
13938
13960
|
}
|
|
13939
|
-
case
|
|
13940
|
-
if (tag !==
|
|
13961
|
+
case 4: {
|
|
13962
|
+
if (tag !== 34) {
|
|
13941
13963
|
break;
|
|
13942
13964
|
}
|
|
13943
13965
|
|
|
13944
|
-
message.
|
|
13966
|
+
message.gitBuckets.push(SessionGitBucket.decode(reader, reader.uint32()));
|
|
13945
13967
|
continue;
|
|
13946
13968
|
}
|
|
13947
13969
|
}
|
|
@@ -13956,36 +13978,670 @@ export const AIFileFilter: MessageFns<AIFileFilter> = {
|
|
|
13956
13978
|
}
|
|
13957
13979
|
},
|
|
13958
13980
|
|
|
13959
|
-
fromJSON(object: any):
|
|
13981
|
+
fromJSON(object: any): SessionUsageTrendResponse {
|
|
13960
13982
|
return {
|
|
13961
|
-
|
|
13962
|
-
|
|
13963
|
-
|
|
13964
|
-
|
|
13983
|
+
status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
|
|
13984
|
+
bucketSeconds: isSet(object.bucketSeconds)
|
|
13985
|
+
? globalThis.Number(object.bucketSeconds)
|
|
13986
|
+
: isSet(object.bucket_seconds)
|
|
13987
|
+
? globalThis.Number(object.bucket_seconds)
|
|
13988
|
+
: 0,
|
|
13989
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
13990
|
+
? object.buckets.map((e: any) => SessionUsageBucket.fromJSON(e))
|
|
13965
13991
|
: [],
|
|
13966
|
-
|
|
13967
|
-
|
|
13968
|
-
|
|
13969
|
-
|
|
13970
|
-
? object.session.map((e: any) => AISessionRef.fromJSON(e))
|
|
13992
|
+
gitBuckets: globalThis.Array.isArray(object?.gitBuckets)
|
|
13993
|
+
? object.gitBuckets.map((e: any) => SessionGitBucket.fromJSON(e))
|
|
13994
|
+
: globalThis.Array.isArray(object?.git_buckets)
|
|
13995
|
+
? object.git_buckets.map((e: any) => SessionGitBucket.fromJSON(e))
|
|
13971
13996
|
: [],
|
|
13972
|
-
|
|
13973
|
-
|
|
13974
|
-
|
|
13975
|
-
|
|
13976
|
-
|
|
13977
|
-
|
|
13978
|
-
|
|
13979
|
-
|
|
13980
|
-
|
|
13981
|
-
|
|
13982
|
-
|
|
13983
|
-
|
|
13984
|
-
|
|
13985
|
-
|
|
13986
|
-
|
|
13987
|
-
|
|
13988
|
-
|
|
13997
|
+
};
|
|
13998
|
+
},
|
|
13999
|
+
|
|
14000
|
+
toJSON(message: SessionUsageTrendResponse): unknown {
|
|
14001
|
+
const obj: any = {};
|
|
14002
|
+
if (message.status !== undefined) {
|
|
14003
|
+
obj.status = ResponseStatus.toJSON(message.status);
|
|
14004
|
+
}
|
|
14005
|
+
if (message.bucketSeconds !== 0) {
|
|
14006
|
+
obj.bucketSeconds = Math.round(message.bucketSeconds);
|
|
14007
|
+
}
|
|
14008
|
+
if (message.buckets?.length) {
|
|
14009
|
+
obj.buckets = message.buckets.map((e) => SessionUsageBucket.toJSON(e));
|
|
14010
|
+
}
|
|
14011
|
+
if (message.gitBuckets?.length) {
|
|
14012
|
+
obj.gitBuckets = message.gitBuckets.map((e) => SessionGitBucket.toJSON(e));
|
|
14013
|
+
}
|
|
14014
|
+
return obj;
|
|
14015
|
+
},
|
|
14016
|
+
|
|
14017
|
+
create<I extends Exact<DeepPartial<SessionUsageTrendResponse>, I>>(base?: I): SessionUsageTrendResponse {
|
|
14018
|
+
return SessionUsageTrendResponse.fromPartial(base ?? ({} as any));
|
|
14019
|
+
},
|
|
14020
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageTrendResponse>, I>>(object: I): SessionUsageTrendResponse {
|
|
14021
|
+
const message = createBaseSessionUsageTrendResponse();
|
|
14022
|
+
message.status = (object.status !== undefined && object.status !== null)
|
|
14023
|
+
? ResponseStatus.fromPartial(object.status)
|
|
14024
|
+
: undefined;
|
|
14025
|
+
message.bucketSeconds = object.bucketSeconds ?? 0;
|
|
14026
|
+
message.buckets = object.buckets?.map((e) => SessionUsageBucket.fromPartial(e)) || [];
|
|
14027
|
+
message.gitBuckets = object.gitBuckets?.map((e) => SessionGitBucket.fromPartial(e)) || [];
|
|
14028
|
+
return message;
|
|
14029
|
+
},
|
|
14030
|
+
};
|
|
14031
|
+
|
|
14032
|
+
function createBaseSessionUsageBucket(): SessionUsageBucket {
|
|
14033
|
+
return {
|
|
14034
|
+
bucketStart: undefined,
|
|
14035
|
+
model: "",
|
|
14036
|
+
modelCalls: 0,
|
|
14037
|
+
inputTokens: 0,
|
|
14038
|
+
outputTokens: 0,
|
|
14039
|
+
cacheReadTokens: 0,
|
|
14040
|
+
cacheWriteTokens: 0,
|
|
14041
|
+
costUsd: 0,
|
|
14042
|
+
};
|
|
14043
|
+
}
|
|
14044
|
+
|
|
14045
|
+
export const SessionUsageBucket: MessageFns<SessionUsageBucket> = {
|
|
14046
|
+
encode(message: SessionUsageBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14047
|
+
if (message.bucketStart !== undefined) {
|
|
14048
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
14049
|
+
}
|
|
14050
|
+
if (message.model !== "") {
|
|
14051
|
+
writer.uint32(18).string(message.model);
|
|
14052
|
+
}
|
|
14053
|
+
if (message.modelCalls !== 0) {
|
|
14054
|
+
writer.uint32(24).uint64(message.modelCalls);
|
|
14055
|
+
}
|
|
14056
|
+
if (message.inputTokens !== 0) {
|
|
14057
|
+
writer.uint32(32).uint64(message.inputTokens);
|
|
14058
|
+
}
|
|
14059
|
+
if (message.outputTokens !== 0) {
|
|
14060
|
+
writer.uint32(40).uint64(message.outputTokens);
|
|
14061
|
+
}
|
|
14062
|
+
if (message.cacheReadTokens !== 0) {
|
|
14063
|
+
writer.uint32(48).uint64(message.cacheReadTokens);
|
|
14064
|
+
}
|
|
14065
|
+
if (message.cacheWriteTokens !== 0) {
|
|
14066
|
+
writer.uint32(56).uint64(message.cacheWriteTokens);
|
|
14067
|
+
}
|
|
14068
|
+
if (message.costUsd !== 0) {
|
|
14069
|
+
writer.uint32(65).double(message.costUsd);
|
|
14070
|
+
}
|
|
14071
|
+
return writer;
|
|
14072
|
+
},
|
|
14073
|
+
|
|
14074
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionUsageBucket {
|
|
14075
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14076
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14077
|
+
if (previousRecursionDepth >= 100) {
|
|
14078
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14079
|
+
}
|
|
14080
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14081
|
+
try {
|
|
14082
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14083
|
+
const message = createBaseSessionUsageBucket();
|
|
14084
|
+
while (reader.pos < end) {
|
|
14085
|
+
const tag = reader.uint32();
|
|
14086
|
+
switch (tag >>> 3) {
|
|
14087
|
+
case 1: {
|
|
14088
|
+
if (tag !== 10) {
|
|
14089
|
+
break;
|
|
14090
|
+
}
|
|
14091
|
+
|
|
14092
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14093
|
+
continue;
|
|
14094
|
+
}
|
|
14095
|
+
case 2: {
|
|
14096
|
+
if (tag !== 18) {
|
|
14097
|
+
break;
|
|
14098
|
+
}
|
|
14099
|
+
|
|
14100
|
+
message.model = reader.string();
|
|
14101
|
+
continue;
|
|
14102
|
+
}
|
|
14103
|
+
case 3: {
|
|
14104
|
+
if (tag !== 24) {
|
|
14105
|
+
break;
|
|
14106
|
+
}
|
|
14107
|
+
|
|
14108
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
14109
|
+
continue;
|
|
14110
|
+
}
|
|
14111
|
+
case 4: {
|
|
14112
|
+
if (tag !== 32) {
|
|
14113
|
+
break;
|
|
14114
|
+
}
|
|
14115
|
+
|
|
14116
|
+
message.inputTokens = longToNumber(reader.uint64());
|
|
14117
|
+
continue;
|
|
14118
|
+
}
|
|
14119
|
+
case 5: {
|
|
14120
|
+
if (tag !== 40) {
|
|
14121
|
+
break;
|
|
14122
|
+
}
|
|
14123
|
+
|
|
14124
|
+
message.outputTokens = longToNumber(reader.uint64());
|
|
14125
|
+
continue;
|
|
14126
|
+
}
|
|
14127
|
+
case 6: {
|
|
14128
|
+
if (tag !== 48) {
|
|
14129
|
+
break;
|
|
14130
|
+
}
|
|
14131
|
+
|
|
14132
|
+
message.cacheReadTokens = longToNumber(reader.uint64());
|
|
14133
|
+
continue;
|
|
14134
|
+
}
|
|
14135
|
+
case 7: {
|
|
14136
|
+
if (tag !== 56) {
|
|
14137
|
+
break;
|
|
14138
|
+
}
|
|
14139
|
+
|
|
14140
|
+
message.cacheWriteTokens = longToNumber(reader.uint64());
|
|
14141
|
+
continue;
|
|
14142
|
+
}
|
|
14143
|
+
case 8: {
|
|
14144
|
+
if (tag !== 65) {
|
|
14145
|
+
break;
|
|
14146
|
+
}
|
|
14147
|
+
|
|
14148
|
+
message.costUsd = reader.double();
|
|
14149
|
+
continue;
|
|
14150
|
+
}
|
|
14151
|
+
}
|
|
14152
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14153
|
+
break;
|
|
14154
|
+
}
|
|
14155
|
+
reader.skip(tag & 7);
|
|
14156
|
+
}
|
|
14157
|
+
return message;
|
|
14158
|
+
} finally {
|
|
14159
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14160
|
+
}
|
|
14161
|
+
},
|
|
14162
|
+
|
|
14163
|
+
fromJSON(object: any): SessionUsageBucket {
|
|
14164
|
+
return {
|
|
14165
|
+
bucketStart: isSet(object.bucketStart)
|
|
14166
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
14167
|
+
: isSet(object.bucket_start)
|
|
14168
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
14169
|
+
: undefined,
|
|
14170
|
+
model: isSet(object.model) ? globalThis.String(object.model) : "",
|
|
14171
|
+
modelCalls: isSet(object.modelCalls)
|
|
14172
|
+
? globalThis.Number(object.modelCalls)
|
|
14173
|
+
: isSet(object.model_calls)
|
|
14174
|
+
? globalThis.Number(object.model_calls)
|
|
14175
|
+
: 0,
|
|
14176
|
+
inputTokens: isSet(object.inputTokens)
|
|
14177
|
+
? globalThis.Number(object.inputTokens)
|
|
14178
|
+
: isSet(object.input_tokens)
|
|
14179
|
+
? globalThis.Number(object.input_tokens)
|
|
14180
|
+
: 0,
|
|
14181
|
+
outputTokens: isSet(object.outputTokens)
|
|
14182
|
+
? globalThis.Number(object.outputTokens)
|
|
14183
|
+
: isSet(object.output_tokens)
|
|
14184
|
+
? globalThis.Number(object.output_tokens)
|
|
14185
|
+
: 0,
|
|
14186
|
+
cacheReadTokens: isSet(object.cacheReadTokens)
|
|
14187
|
+
? globalThis.Number(object.cacheReadTokens)
|
|
14188
|
+
: isSet(object.cache_read_tokens)
|
|
14189
|
+
? globalThis.Number(object.cache_read_tokens)
|
|
14190
|
+
: 0,
|
|
14191
|
+
cacheWriteTokens: isSet(object.cacheWriteTokens)
|
|
14192
|
+
? globalThis.Number(object.cacheWriteTokens)
|
|
14193
|
+
: isSet(object.cache_write_tokens)
|
|
14194
|
+
? globalThis.Number(object.cache_write_tokens)
|
|
14195
|
+
: 0,
|
|
14196
|
+
costUsd: isSet(object.costUsd)
|
|
14197
|
+
? globalThis.Number(object.costUsd)
|
|
14198
|
+
: isSet(object.cost_usd)
|
|
14199
|
+
? globalThis.Number(object.cost_usd)
|
|
14200
|
+
: 0,
|
|
14201
|
+
};
|
|
14202
|
+
},
|
|
14203
|
+
|
|
14204
|
+
toJSON(message: SessionUsageBucket): unknown {
|
|
14205
|
+
const obj: any = {};
|
|
14206
|
+
if (message.bucketStart !== undefined) {
|
|
14207
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
14208
|
+
}
|
|
14209
|
+
if (message.model !== "") {
|
|
14210
|
+
obj.model = message.model;
|
|
14211
|
+
}
|
|
14212
|
+
if (message.modelCalls !== 0) {
|
|
14213
|
+
obj.modelCalls = Math.round(message.modelCalls);
|
|
14214
|
+
}
|
|
14215
|
+
if (message.inputTokens !== 0) {
|
|
14216
|
+
obj.inputTokens = Math.round(message.inputTokens);
|
|
14217
|
+
}
|
|
14218
|
+
if (message.outputTokens !== 0) {
|
|
14219
|
+
obj.outputTokens = Math.round(message.outputTokens);
|
|
14220
|
+
}
|
|
14221
|
+
if (message.cacheReadTokens !== 0) {
|
|
14222
|
+
obj.cacheReadTokens = Math.round(message.cacheReadTokens);
|
|
14223
|
+
}
|
|
14224
|
+
if (message.cacheWriteTokens !== 0) {
|
|
14225
|
+
obj.cacheWriteTokens = Math.round(message.cacheWriteTokens);
|
|
14226
|
+
}
|
|
14227
|
+
if (message.costUsd !== 0) {
|
|
14228
|
+
obj.costUsd = message.costUsd;
|
|
14229
|
+
}
|
|
14230
|
+
return obj;
|
|
14231
|
+
},
|
|
14232
|
+
|
|
14233
|
+
create<I extends Exact<DeepPartial<SessionUsageBucket>, I>>(base?: I): SessionUsageBucket {
|
|
14234
|
+
return SessionUsageBucket.fromPartial(base ?? ({} as any));
|
|
14235
|
+
},
|
|
14236
|
+
fromPartial<I extends Exact<DeepPartial<SessionUsageBucket>, I>>(object: I): SessionUsageBucket {
|
|
14237
|
+
const message = createBaseSessionUsageBucket();
|
|
14238
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
14239
|
+
message.model = object.model ?? "";
|
|
14240
|
+
message.modelCalls = object.modelCalls ?? 0;
|
|
14241
|
+
message.inputTokens = object.inputTokens ?? 0;
|
|
14242
|
+
message.outputTokens = object.outputTokens ?? 0;
|
|
14243
|
+
message.cacheReadTokens = object.cacheReadTokens ?? 0;
|
|
14244
|
+
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
14245
|
+
message.costUsd = object.costUsd ?? 0;
|
|
14246
|
+
return message;
|
|
14247
|
+
},
|
|
14248
|
+
};
|
|
14249
|
+
|
|
14250
|
+
function createBaseSessionGitBucket(): SessionGitBucket {
|
|
14251
|
+
return { bucketStart: undefined, action: "", count: 0 };
|
|
14252
|
+
}
|
|
14253
|
+
|
|
14254
|
+
export const SessionGitBucket: MessageFns<SessionGitBucket> = {
|
|
14255
|
+
encode(message: SessionGitBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14256
|
+
if (message.bucketStart !== undefined) {
|
|
14257
|
+
Timestamp.encode(toTimestamp(message.bucketStart), writer.uint32(10).fork()).join();
|
|
14258
|
+
}
|
|
14259
|
+
if (message.action !== "") {
|
|
14260
|
+
writer.uint32(18).string(message.action);
|
|
14261
|
+
}
|
|
14262
|
+
if (message.count !== 0) {
|
|
14263
|
+
writer.uint32(24).uint64(message.count);
|
|
14264
|
+
}
|
|
14265
|
+
return writer;
|
|
14266
|
+
},
|
|
14267
|
+
|
|
14268
|
+
decode(input: BinaryReader | Uint8Array, length?: number): SessionGitBucket {
|
|
14269
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14270
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14271
|
+
if (previousRecursionDepth >= 100) {
|
|
14272
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14273
|
+
}
|
|
14274
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14275
|
+
try {
|
|
14276
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14277
|
+
const message = createBaseSessionGitBucket();
|
|
14278
|
+
while (reader.pos < end) {
|
|
14279
|
+
const tag = reader.uint32();
|
|
14280
|
+
switch (tag >>> 3) {
|
|
14281
|
+
case 1: {
|
|
14282
|
+
if (tag !== 10) {
|
|
14283
|
+
break;
|
|
14284
|
+
}
|
|
14285
|
+
|
|
14286
|
+
message.bucketStart = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14287
|
+
continue;
|
|
14288
|
+
}
|
|
14289
|
+
case 2: {
|
|
14290
|
+
if (tag !== 18) {
|
|
14291
|
+
break;
|
|
14292
|
+
}
|
|
14293
|
+
|
|
14294
|
+
message.action = reader.string();
|
|
14295
|
+
continue;
|
|
14296
|
+
}
|
|
14297
|
+
case 3: {
|
|
14298
|
+
if (tag !== 24) {
|
|
14299
|
+
break;
|
|
14300
|
+
}
|
|
14301
|
+
|
|
14302
|
+
message.count = longToNumber(reader.uint64());
|
|
14303
|
+
continue;
|
|
14304
|
+
}
|
|
14305
|
+
}
|
|
14306
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14307
|
+
break;
|
|
14308
|
+
}
|
|
14309
|
+
reader.skip(tag & 7);
|
|
14310
|
+
}
|
|
14311
|
+
return message;
|
|
14312
|
+
} finally {
|
|
14313
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14314
|
+
}
|
|
14315
|
+
},
|
|
14316
|
+
|
|
14317
|
+
fromJSON(object: any): SessionGitBucket {
|
|
14318
|
+
return {
|
|
14319
|
+
bucketStart: isSet(object.bucketStart)
|
|
14320
|
+
? fromJsonTimestamp(object.bucketStart)
|
|
14321
|
+
: isSet(object.bucket_start)
|
|
14322
|
+
? fromJsonTimestamp(object.bucket_start)
|
|
14323
|
+
: undefined,
|
|
14324
|
+
action: isSet(object.action) ? globalThis.String(object.action) : "",
|
|
14325
|
+
count: isSet(object.count) ? globalThis.Number(object.count) : 0,
|
|
14326
|
+
};
|
|
14327
|
+
},
|
|
14328
|
+
|
|
14329
|
+
toJSON(message: SessionGitBucket): unknown {
|
|
14330
|
+
const obj: any = {};
|
|
14331
|
+
if (message.bucketStart !== undefined) {
|
|
14332
|
+
obj.bucketStart = message.bucketStart.toISOString();
|
|
14333
|
+
}
|
|
14334
|
+
if (message.action !== "") {
|
|
14335
|
+
obj.action = message.action;
|
|
14336
|
+
}
|
|
14337
|
+
if (message.count !== 0) {
|
|
14338
|
+
obj.count = Math.round(message.count);
|
|
14339
|
+
}
|
|
14340
|
+
return obj;
|
|
14341
|
+
},
|
|
14342
|
+
|
|
14343
|
+
create<I extends Exact<DeepPartial<SessionGitBucket>, I>>(base?: I): SessionGitBucket {
|
|
14344
|
+
return SessionGitBucket.fromPartial(base ?? ({} as any));
|
|
14345
|
+
},
|
|
14346
|
+
fromPartial<I extends Exact<DeepPartial<SessionGitBucket>, I>>(object: I): SessionGitBucket {
|
|
14347
|
+
const message = createBaseSessionGitBucket();
|
|
14348
|
+
message.bucketStart = object.bucketStart ?? undefined;
|
|
14349
|
+
message.action = object.action ?? "";
|
|
14350
|
+
message.count = object.count ?? 0;
|
|
14351
|
+
return message;
|
|
14352
|
+
},
|
|
14353
|
+
};
|
|
14354
|
+
|
|
14355
|
+
function createBaseAISessionRef(): AISessionRef {
|
|
14356
|
+
return { sourceSystem: "", sessionId: "" };
|
|
14357
|
+
}
|
|
14358
|
+
|
|
14359
|
+
export const AISessionRef: MessageFns<AISessionRef> = {
|
|
14360
|
+
encode(message: AISessionRef, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14361
|
+
if (message.sourceSystem !== "") {
|
|
14362
|
+
writer.uint32(10).string(message.sourceSystem);
|
|
14363
|
+
}
|
|
14364
|
+
if (message.sessionId !== "") {
|
|
14365
|
+
writer.uint32(18).string(message.sessionId);
|
|
14366
|
+
}
|
|
14367
|
+
return writer;
|
|
14368
|
+
},
|
|
14369
|
+
|
|
14370
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AISessionRef {
|
|
14371
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14372
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14373
|
+
if (previousRecursionDepth >= 100) {
|
|
14374
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14375
|
+
}
|
|
14376
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14377
|
+
try {
|
|
14378
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14379
|
+
const message = createBaseAISessionRef();
|
|
14380
|
+
while (reader.pos < end) {
|
|
14381
|
+
const tag = reader.uint32();
|
|
14382
|
+
switch (tag >>> 3) {
|
|
14383
|
+
case 1: {
|
|
14384
|
+
if (tag !== 10) {
|
|
14385
|
+
break;
|
|
14386
|
+
}
|
|
14387
|
+
|
|
14388
|
+
message.sourceSystem = reader.string();
|
|
14389
|
+
continue;
|
|
14390
|
+
}
|
|
14391
|
+
case 2: {
|
|
14392
|
+
if (tag !== 18) {
|
|
14393
|
+
break;
|
|
14394
|
+
}
|
|
14395
|
+
|
|
14396
|
+
message.sessionId = reader.string();
|
|
14397
|
+
continue;
|
|
14398
|
+
}
|
|
14399
|
+
}
|
|
14400
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14401
|
+
break;
|
|
14402
|
+
}
|
|
14403
|
+
reader.skip(tag & 7);
|
|
14404
|
+
}
|
|
14405
|
+
return message;
|
|
14406
|
+
} finally {
|
|
14407
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14408
|
+
}
|
|
14409
|
+
},
|
|
14410
|
+
|
|
14411
|
+
fromJSON(object: any): AISessionRef {
|
|
14412
|
+
return {
|
|
14413
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
14414
|
+
? globalThis.String(object.sourceSystem)
|
|
14415
|
+
: isSet(object.source_system)
|
|
14416
|
+
? globalThis.String(object.source_system)
|
|
14417
|
+
: "",
|
|
14418
|
+
sessionId: isSet(object.sessionId)
|
|
14419
|
+
? globalThis.String(object.sessionId)
|
|
14420
|
+
: isSet(object.session_id)
|
|
14421
|
+
? globalThis.String(object.session_id)
|
|
14422
|
+
: "",
|
|
14423
|
+
};
|
|
14424
|
+
},
|
|
14425
|
+
|
|
14426
|
+
toJSON(message: AISessionRef): unknown {
|
|
14427
|
+
const obj: any = {};
|
|
14428
|
+
if (message.sourceSystem !== "") {
|
|
14429
|
+
obj.sourceSystem = message.sourceSystem;
|
|
14430
|
+
}
|
|
14431
|
+
if (message.sessionId !== "") {
|
|
14432
|
+
obj.sessionId = message.sessionId;
|
|
14433
|
+
}
|
|
14434
|
+
return obj;
|
|
14435
|
+
},
|
|
14436
|
+
|
|
14437
|
+
create<I extends Exact<DeepPartial<AISessionRef>, I>>(base?: I): AISessionRef {
|
|
14438
|
+
return AISessionRef.fromPartial(base ?? ({} as any));
|
|
14439
|
+
},
|
|
14440
|
+
fromPartial<I extends Exact<DeepPartial<AISessionRef>, I>>(object: I): AISessionRef {
|
|
14441
|
+
const message = createBaseAISessionRef();
|
|
14442
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
14443
|
+
message.sessionId = object.sessionId ?? "";
|
|
14444
|
+
return message;
|
|
14445
|
+
},
|
|
14446
|
+
};
|
|
14447
|
+
|
|
14448
|
+
function createBaseAIFileFilter(): AIFileFilter {
|
|
14449
|
+
return {
|
|
14450
|
+
repositoryKey: [],
|
|
14451
|
+
ref: [],
|
|
14452
|
+
state: [],
|
|
14453
|
+
tier: [],
|
|
14454
|
+
session: [],
|
|
14455
|
+
minAge: undefined,
|
|
14456
|
+
activeAfter: undefined,
|
|
14457
|
+
activeBefore: undefined,
|
|
14458
|
+
abandonedHorizon: undefined,
|
|
14459
|
+
};
|
|
14460
|
+
}
|
|
14461
|
+
|
|
14462
|
+
export const AIFileFilter: MessageFns<AIFileFilter> = {
|
|
14463
|
+
encode(message: AIFileFilter, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
14464
|
+
for (const v of message.repositoryKey) {
|
|
14465
|
+
writer.uint32(10).string(v!);
|
|
14466
|
+
}
|
|
14467
|
+
for (const v of message.ref) {
|
|
14468
|
+
writer.uint32(18).string(v!);
|
|
14469
|
+
}
|
|
14470
|
+
writer.uint32(26).fork();
|
|
14471
|
+
for (const v of message.state) {
|
|
14472
|
+
writer.int32(v);
|
|
14473
|
+
}
|
|
14474
|
+
writer.join();
|
|
14475
|
+
writer.uint32(34).fork();
|
|
14476
|
+
for (const v of message.tier) {
|
|
14477
|
+
writer.int32(v);
|
|
14478
|
+
}
|
|
14479
|
+
writer.join();
|
|
14480
|
+
for (const v of message.session) {
|
|
14481
|
+
AISessionRef.encode(v!, writer.uint32(42).fork()).join();
|
|
14482
|
+
}
|
|
14483
|
+
if (message.minAge !== undefined) {
|
|
14484
|
+
Duration.encode(message.minAge, writer.uint32(50).fork()).join();
|
|
14485
|
+
}
|
|
14486
|
+
if (message.activeAfter !== undefined) {
|
|
14487
|
+
Timestamp.encode(toTimestamp(message.activeAfter), writer.uint32(58).fork()).join();
|
|
14488
|
+
}
|
|
14489
|
+
if (message.activeBefore !== undefined) {
|
|
14490
|
+
Timestamp.encode(toTimestamp(message.activeBefore), writer.uint32(66).fork()).join();
|
|
14491
|
+
}
|
|
14492
|
+
if (message.abandonedHorizon !== undefined) {
|
|
14493
|
+
Duration.encode(message.abandonedHorizon, writer.uint32(74).fork()).join();
|
|
14494
|
+
}
|
|
14495
|
+
return writer;
|
|
14496
|
+
},
|
|
14497
|
+
|
|
14498
|
+
decode(input: BinaryReader | Uint8Array, length?: number): AIFileFilter {
|
|
14499
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
14500
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
14501
|
+
if (previousRecursionDepth >= 100) {
|
|
14502
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
14503
|
+
}
|
|
14504
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
14505
|
+
try {
|
|
14506
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
14507
|
+
const message = createBaseAIFileFilter();
|
|
14508
|
+
while (reader.pos < end) {
|
|
14509
|
+
const tag = reader.uint32();
|
|
14510
|
+
switch (tag >>> 3) {
|
|
14511
|
+
case 1: {
|
|
14512
|
+
if (tag !== 10) {
|
|
14513
|
+
break;
|
|
14514
|
+
}
|
|
14515
|
+
|
|
14516
|
+
message.repositoryKey.push(reader.string());
|
|
14517
|
+
continue;
|
|
14518
|
+
}
|
|
14519
|
+
case 2: {
|
|
14520
|
+
if (tag !== 18) {
|
|
14521
|
+
break;
|
|
14522
|
+
}
|
|
14523
|
+
|
|
14524
|
+
message.ref.push(reader.string());
|
|
14525
|
+
continue;
|
|
14526
|
+
}
|
|
14527
|
+
case 3: {
|
|
14528
|
+
if (tag === 24) {
|
|
14529
|
+
message.state.push(reader.int32() as any);
|
|
14530
|
+
|
|
14531
|
+
continue;
|
|
14532
|
+
}
|
|
14533
|
+
|
|
14534
|
+
if (tag === 26) {
|
|
14535
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14536
|
+
while (reader.pos < end2) {
|
|
14537
|
+
message.state.push(reader.int32() as any);
|
|
14538
|
+
}
|
|
14539
|
+
|
|
14540
|
+
continue;
|
|
14541
|
+
}
|
|
14542
|
+
|
|
14543
|
+
break;
|
|
14544
|
+
}
|
|
14545
|
+
case 4: {
|
|
14546
|
+
if (tag === 32) {
|
|
14547
|
+
message.tier.push(reader.int32() as any);
|
|
14548
|
+
|
|
14549
|
+
continue;
|
|
14550
|
+
}
|
|
14551
|
+
|
|
14552
|
+
if (tag === 34) {
|
|
14553
|
+
const end2 = reader.uint32() + reader.pos;
|
|
14554
|
+
while (reader.pos < end2) {
|
|
14555
|
+
message.tier.push(reader.int32() as any);
|
|
14556
|
+
}
|
|
14557
|
+
|
|
14558
|
+
continue;
|
|
14559
|
+
}
|
|
14560
|
+
|
|
14561
|
+
break;
|
|
14562
|
+
}
|
|
14563
|
+
case 5: {
|
|
14564
|
+
if (tag !== 42) {
|
|
14565
|
+
break;
|
|
14566
|
+
}
|
|
14567
|
+
|
|
14568
|
+
message.session.push(AISessionRef.decode(reader, reader.uint32()));
|
|
14569
|
+
continue;
|
|
14570
|
+
}
|
|
14571
|
+
case 6: {
|
|
14572
|
+
if (tag !== 50) {
|
|
14573
|
+
break;
|
|
14574
|
+
}
|
|
14575
|
+
|
|
14576
|
+
message.minAge = Duration.decode(reader, reader.uint32());
|
|
14577
|
+
continue;
|
|
14578
|
+
}
|
|
14579
|
+
case 7: {
|
|
14580
|
+
if (tag !== 58) {
|
|
14581
|
+
break;
|
|
14582
|
+
}
|
|
14583
|
+
|
|
14584
|
+
message.activeAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14585
|
+
continue;
|
|
14586
|
+
}
|
|
14587
|
+
case 8: {
|
|
14588
|
+
if (tag !== 66) {
|
|
14589
|
+
break;
|
|
14590
|
+
}
|
|
14591
|
+
|
|
14592
|
+
message.activeBefore = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
14593
|
+
continue;
|
|
14594
|
+
}
|
|
14595
|
+
case 9: {
|
|
14596
|
+
if (tag !== 74) {
|
|
14597
|
+
break;
|
|
14598
|
+
}
|
|
14599
|
+
|
|
14600
|
+
message.abandonedHorizon = Duration.decode(reader, reader.uint32());
|
|
14601
|
+
continue;
|
|
14602
|
+
}
|
|
14603
|
+
}
|
|
14604
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
14605
|
+
break;
|
|
14606
|
+
}
|
|
14607
|
+
reader.skip(tag & 7);
|
|
14608
|
+
}
|
|
14609
|
+
return message;
|
|
14610
|
+
} finally {
|
|
14611
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
14612
|
+
}
|
|
14613
|
+
},
|
|
14614
|
+
|
|
14615
|
+
fromJSON(object: any): AIFileFilter {
|
|
14616
|
+
return {
|
|
14617
|
+
repositoryKey: globalThis.Array.isArray(object?.repositoryKey)
|
|
14618
|
+
? object.repositoryKey.map((e: any) => globalThis.String(e))
|
|
14619
|
+
: globalThis.Array.isArray(object?.repository_key)
|
|
14620
|
+
? object.repository_key.map((e: any) => globalThis.String(e))
|
|
14621
|
+
: [],
|
|
14622
|
+
ref: globalThis.Array.isArray(object?.ref) ? object.ref.map((e: any) => globalThis.String(e)) : [],
|
|
14623
|
+
state: globalThis.Array.isArray(object?.state) ? object.state.map((e: any) => aIFileLifecycleFromJSON(e)) : [],
|
|
14624
|
+
tier: globalThis.Array.isArray(object?.tier) ? object.tier.map((e: any) => aIFileTierFromJSON(e)) : [],
|
|
14625
|
+
session: globalThis.Array.isArray(object?.session)
|
|
14626
|
+
? object.session.map((e: any) => AISessionRef.fromJSON(e))
|
|
14627
|
+
: [],
|
|
14628
|
+
minAge: isSet(object.minAge)
|
|
14629
|
+
? Duration.fromJSON(object.minAge)
|
|
14630
|
+
: isSet(object.min_age)
|
|
14631
|
+
? Duration.fromJSON(object.min_age)
|
|
14632
|
+
: undefined,
|
|
14633
|
+
activeAfter: isSet(object.activeAfter)
|
|
14634
|
+
? fromJsonTimestamp(object.activeAfter)
|
|
14635
|
+
: isSet(object.active_after)
|
|
14636
|
+
? fromJsonTimestamp(object.active_after)
|
|
14637
|
+
: undefined,
|
|
14638
|
+
activeBefore: isSet(object.activeBefore)
|
|
14639
|
+
? fromJsonTimestamp(object.activeBefore)
|
|
14640
|
+
: isSet(object.active_before)
|
|
14641
|
+
? fromJsonTimestamp(object.active_before)
|
|
14642
|
+
: undefined,
|
|
14643
|
+
abandonedHorizon: isSet(object.abandonedHorizon)
|
|
14644
|
+
? Duration.fromJSON(object.abandonedHorizon)
|
|
13989
14645
|
: isSet(object.abandoned_horizon)
|
|
13990
14646
|
? Duration.fromJSON(object.abandoned_horizon)
|
|
13991
14647
|
: undefined,
|
|
@@ -17741,6 +18397,11 @@ export interface AIGatewayService {
|
|
|
17741
18397
|
* costliest first. Mirrors telemetry.api.v1.
|
|
17742
18398
|
*/
|
|
17743
18399
|
ListModelActivity(request: ModelActivityRequest, metadata?: Metadata): Promise<ModelActivityResponse>;
|
|
18400
|
+
/**
|
|
18401
|
+
* One session's model calls and git activity on one epoch-aligned time grid: per bucket, each model's
|
|
18402
|
+
* calls, tokens and cost, and each git action's count. Mirrors telemetry.api.v1.
|
|
18403
|
+
*/
|
|
18404
|
+
GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse>;
|
|
17744
18405
|
/**
|
|
17745
18406
|
* Per-seat entitlement usage board: every entitlement owner's latest observed funding facility and
|
|
17746
18407
|
* per-harness usage % windows. Stream-first (first frame = full snapshot), seat-scoped. Mirrors
|
|
@@ -17777,6 +18438,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
17777
18438
|
this.ListModelPriceHistory = this.ListModelPriceHistory.bind(this);
|
|
17778
18439
|
this.ListResourceRankings = this.ListResourceRankings.bind(this);
|
|
17779
18440
|
this.ListModelActivity = this.ListModelActivity.bind(this);
|
|
18441
|
+
this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
|
|
17780
18442
|
this.StreamEntitlements = this.StreamEntitlements.bind(this);
|
|
17781
18443
|
}
|
|
17782
18444
|
ListSessions(request: ListSessionsRequest, metadata?: Metadata): Promise<ListSessionsResponse> {
|
|
@@ -17914,6 +18576,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
17914
18576
|
return promise.then((data) => ModelActivityResponse.decode(new BinaryReader(data)));
|
|
17915
18577
|
}
|
|
17916
18578
|
|
|
18579
|
+
GetSessionUsageTrend(request: SessionUsageTrendRequest, metadata?: Metadata): Promise<SessionUsageTrendResponse> {
|
|
18580
|
+
const data = SessionUsageTrendRequest.encode(request).finish();
|
|
18581
|
+
const promise = this.rpc.request(this.service, "GetSessionUsageTrend", data, metadata);
|
|
18582
|
+
return promise.then((data) => SessionUsageTrendResponse.decode(new BinaryReader(data)));
|
|
18583
|
+
}
|
|
18584
|
+
|
|
17917
18585
|
StreamEntitlements(request: StreamEntitlementsRequest, metadata?: Metadata): Observable<EntitlementsSnapshot> {
|
|
17918
18586
|
const data = StreamEntitlementsRequest.encode(request).finish();
|
|
17919
18587
|
const result = this.rpc.serverStreamingRequest(this.service, "StreamEntitlements", data, metadata);
|