@miradorlabs/web-grpc 3.20.0 → 3.22.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.
|
@@ -1593,8 +1593,8 @@ export interface ProjectOverview {
|
|
|
1593
1593
|
byProvider: ProjectOverviewSlice[];
|
|
1594
1594
|
bySource: ProjectOverviewSlice[];
|
|
1595
1595
|
topSessions: ProjectSessionRef[];
|
|
1596
|
-
|
|
1597
|
-
|
|
1596
|
+
buckets: ProjectUsageBucket[];
|
|
1597
|
+
prior: ProjectUsageBucket[];
|
|
1598
1598
|
}
|
|
1599
1599
|
|
|
1600
1600
|
export interface ProjectOverviewTotals {
|
|
@@ -1627,6 +1627,49 @@ export interface ProjectOverviewSlice {
|
|
|
1627
1627
|
subscriptionCostUsd: number;
|
|
1628
1628
|
}
|
|
1629
1629
|
|
|
1630
|
+
export interface ProjectUsageBucket {
|
|
1631
|
+
startTime: Date | undefined;
|
|
1632
|
+
model: string;
|
|
1633
|
+
provider: string;
|
|
1634
|
+
sourceSystem: string;
|
|
1635
|
+
fundingMode: AIFundingMode;
|
|
1636
|
+
modelCalls: number;
|
|
1637
|
+
inputTokens: number;
|
|
1638
|
+
outputTokens: number;
|
|
1639
|
+
cacheReadTokens: number;
|
|
1640
|
+
cacheWriteTokens: number;
|
|
1641
|
+
costUsd: number;
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
export interface ProjectSummariesRequest {
|
|
1645
|
+
organizationId: string;
|
|
1646
|
+
projectIds: string[];
|
|
1647
|
+
activeAfter: Date | undefined;
|
|
1648
|
+
}
|
|
1649
|
+
|
|
1650
|
+
export interface ProjectSummaries {
|
|
1651
|
+
projects: ProjectSummary[];
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
export interface ProjectSummary {
|
|
1655
|
+
projectId: string;
|
|
1656
|
+
sessions: number;
|
|
1657
|
+
pullRequestsMerged: number;
|
|
1658
|
+
repositories: number;
|
|
1659
|
+
sessionTokens: number;
|
|
1660
|
+
unpricedTokens: number;
|
|
1661
|
+
/** over all history; absent = never active */
|
|
1662
|
+
lastActivityAt: Date | undefined;
|
|
1663
|
+
actors: ProjectSummaryActor[];
|
|
1664
|
+
byModel: ProjectOverviewSlice[];
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
export interface ProjectSummaryActor {
|
|
1668
|
+
sourceSystem: string;
|
|
1669
|
+
userId: string;
|
|
1670
|
+
apiKeyId: string;
|
|
1671
|
+
}
|
|
1672
|
+
|
|
1630
1673
|
export interface ProjectSessionRef {
|
|
1631
1674
|
sessionId: string;
|
|
1632
1675
|
sourceSystem: string;
|
|
@@ -12184,7 +12227,7 @@ export const ProjectOverviewRequest: MessageFns<ProjectOverviewRequest> = {
|
|
|
12184
12227
|
};
|
|
12185
12228
|
|
|
12186
12229
|
function createBaseProjectOverview(): ProjectOverview {
|
|
12187
|
-
return { totals: undefined, byModel: [], byProvider: [], bySource: [], topSessions: [],
|
|
12230
|
+
return { totals: undefined, byModel: [], byProvider: [], bySource: [], topSessions: [], buckets: [], prior: [] };
|
|
12188
12231
|
}
|
|
12189
12232
|
|
|
12190
12233
|
export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
@@ -12204,8 +12247,11 @@ export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
|
12204
12247
|
for (const v of message.topSessions) {
|
|
12205
12248
|
ProjectSessionRef.encode(v!, writer.uint32(42).fork()).join();
|
|
12206
12249
|
}
|
|
12207
|
-
for (const v of message.
|
|
12208
|
-
|
|
12250
|
+
for (const v of message.buckets) {
|
|
12251
|
+
ProjectUsageBucket.encode(v!, writer.uint32(50).fork()).join();
|
|
12252
|
+
}
|
|
12253
|
+
for (const v of message.prior) {
|
|
12254
|
+
ProjectUsageBucket.encode(v!, writer.uint32(58).fork()).join();
|
|
12209
12255
|
}
|
|
12210
12256
|
return writer;
|
|
12211
12257
|
},
|
|
@@ -12268,7 +12314,15 @@ export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
|
12268
12314
|
break;
|
|
12269
12315
|
}
|
|
12270
12316
|
|
|
12271
|
-
message.
|
|
12317
|
+
message.buckets.push(ProjectUsageBucket.decode(reader, reader.uint32()));
|
|
12318
|
+
continue;
|
|
12319
|
+
}
|
|
12320
|
+
case 7: {
|
|
12321
|
+
if (tag !== 58) {
|
|
12322
|
+
break;
|
|
12323
|
+
}
|
|
12324
|
+
|
|
12325
|
+
message.prior.push(ProjectUsageBucket.decode(reader, reader.uint32()));
|
|
12272
12326
|
continue;
|
|
12273
12327
|
}
|
|
12274
12328
|
}
|
|
@@ -12306,10 +12360,11 @@ export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
|
12306
12360
|
: globalThis.Array.isArray(object?.top_sessions)
|
|
12307
12361
|
? object.top_sessions.map((e: any) => ProjectSessionRef.fromJSON(e))
|
|
12308
12362
|
: [],
|
|
12309
|
-
|
|
12310
|
-
? object.
|
|
12311
|
-
:
|
|
12312
|
-
|
|
12363
|
+
buckets: globalThis.Array.isArray(object?.buckets)
|
|
12364
|
+
? object.buckets.map((e: any) => ProjectUsageBucket.fromJSON(e))
|
|
12365
|
+
: [],
|
|
12366
|
+
prior: globalThis.Array.isArray(object?.prior)
|
|
12367
|
+
? object.prior.map((e: any) => ProjectUsageBucket.fromJSON(e))
|
|
12313
12368
|
: [],
|
|
12314
12369
|
};
|
|
12315
12370
|
},
|
|
@@ -12331,8 +12386,11 @@ export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
|
12331
12386
|
if (message.topSessions?.length) {
|
|
12332
12387
|
obj.topSessions = message.topSessions.map((e) => ProjectSessionRef.toJSON(e));
|
|
12333
12388
|
}
|
|
12334
|
-
if (message.
|
|
12335
|
-
obj.
|
|
12389
|
+
if (message.buckets?.length) {
|
|
12390
|
+
obj.buckets = message.buckets.map((e) => ProjectUsageBucket.toJSON(e));
|
|
12391
|
+
}
|
|
12392
|
+
if (message.prior?.length) {
|
|
12393
|
+
obj.prior = message.prior.map((e) => ProjectUsageBucket.toJSON(e));
|
|
12336
12394
|
}
|
|
12337
12395
|
return obj;
|
|
12338
12396
|
},
|
|
@@ -12349,7 +12407,8 @@ export const ProjectOverview: MessageFns<ProjectOverview> = {
|
|
|
12349
12407
|
message.byProvider = object.byProvider?.map((e) => ProjectOverviewSlice.fromPartial(e)) || [];
|
|
12350
12408
|
message.bySource = object.bySource?.map((e) => ProjectOverviewSlice.fromPartial(e)) || [];
|
|
12351
12409
|
message.topSessions = object.topSessions?.map((e) => ProjectSessionRef.fromPartial(e)) || [];
|
|
12352
|
-
message.
|
|
12410
|
+
message.buckets = object.buckets?.map((e) => ProjectUsageBucket.fromPartial(e)) || [];
|
|
12411
|
+
message.prior = object.prior?.map((e) => ProjectUsageBucket.fromPartial(e)) || [];
|
|
12353
12412
|
return message;
|
|
12354
12413
|
},
|
|
12355
12414
|
};
|
|
@@ -12880,31 +12939,61 @@ export const ProjectOverviewSlice: MessageFns<ProjectOverviewSlice> = {
|
|
|
12880
12939
|
},
|
|
12881
12940
|
};
|
|
12882
12941
|
|
|
12883
|
-
function
|
|
12884
|
-
return {
|
|
12942
|
+
function createBaseProjectUsageBucket(): ProjectUsageBucket {
|
|
12943
|
+
return {
|
|
12944
|
+
startTime: undefined,
|
|
12945
|
+
model: "",
|
|
12946
|
+
provider: "",
|
|
12947
|
+
sourceSystem: "",
|
|
12948
|
+
fundingMode: 0,
|
|
12949
|
+
modelCalls: 0,
|
|
12950
|
+
inputTokens: 0,
|
|
12951
|
+
outputTokens: 0,
|
|
12952
|
+
cacheReadTokens: 0,
|
|
12953
|
+
cacheWriteTokens: 0,
|
|
12954
|
+
costUsd: 0,
|
|
12955
|
+
};
|
|
12885
12956
|
}
|
|
12886
12957
|
|
|
12887
|
-
export const
|
|
12888
|
-
encode(message:
|
|
12889
|
-
if (message.
|
|
12890
|
-
writer.uint32(10).
|
|
12958
|
+
export const ProjectUsageBucket: MessageFns<ProjectUsageBucket> = {
|
|
12959
|
+
encode(message: ProjectUsageBucket, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
12960
|
+
if (message.startTime !== undefined) {
|
|
12961
|
+
Timestamp.encode(toTimestamp(message.startTime), writer.uint32(10).fork()).join();
|
|
12962
|
+
}
|
|
12963
|
+
if (message.model !== "") {
|
|
12964
|
+
writer.uint32(18).string(message.model);
|
|
12965
|
+
}
|
|
12966
|
+
if (message.provider !== "") {
|
|
12967
|
+
writer.uint32(26).string(message.provider);
|
|
12891
12968
|
}
|
|
12892
12969
|
if (message.sourceSystem !== "") {
|
|
12893
|
-
writer.uint32(
|
|
12970
|
+
writer.uint32(34).string(message.sourceSystem);
|
|
12894
12971
|
}
|
|
12895
|
-
if (message.
|
|
12896
|
-
writer.uint32(
|
|
12972
|
+
if (message.fundingMode !== 0) {
|
|
12973
|
+
writer.uint32(40).int32(message.fundingMode);
|
|
12897
12974
|
}
|
|
12898
12975
|
if (message.modelCalls !== 0) {
|
|
12899
|
-
writer.uint32(
|
|
12976
|
+
writer.uint32(48).uint64(message.modelCalls);
|
|
12900
12977
|
}
|
|
12901
|
-
if (message.
|
|
12902
|
-
|
|
12978
|
+
if (message.inputTokens !== 0) {
|
|
12979
|
+
writer.uint32(56).uint64(message.inputTokens);
|
|
12980
|
+
}
|
|
12981
|
+
if (message.outputTokens !== 0) {
|
|
12982
|
+
writer.uint32(64).uint64(message.outputTokens);
|
|
12983
|
+
}
|
|
12984
|
+
if (message.cacheReadTokens !== 0) {
|
|
12985
|
+
writer.uint32(72).uint64(message.cacheReadTokens);
|
|
12986
|
+
}
|
|
12987
|
+
if (message.cacheWriteTokens !== 0) {
|
|
12988
|
+
writer.uint32(80).uint64(message.cacheWriteTokens);
|
|
12989
|
+
}
|
|
12990
|
+
if (message.costUsd !== 0) {
|
|
12991
|
+
writer.uint32(89).double(message.costUsd);
|
|
12903
12992
|
}
|
|
12904
12993
|
return writer;
|
|
12905
12994
|
},
|
|
12906
12995
|
|
|
12907
|
-
decode(input: BinaryReader | Uint8Array, length?: number):
|
|
12996
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectUsageBucket {
|
|
12908
12997
|
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
12909
12998
|
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
12910
12999
|
if (previousRecursionDepth >= 100) {
|
|
@@ -12913,7 +13002,7 @@ export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
|
|
|
12913
13002
|
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
12914
13003
|
try {
|
|
12915
13004
|
const end = length === undefined ? reader.len : reader.pos + length;
|
|
12916
|
-
const message =
|
|
13005
|
+
const message = createBaseProjectUsageBucket();
|
|
12917
13006
|
while (reader.pos < end) {
|
|
12918
13007
|
const tag = reader.uint32();
|
|
12919
13008
|
switch (tag >>> 3) {
|
|
@@ -12922,7 +13011,7 @@ export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
|
|
|
12922
13011
|
break;
|
|
12923
13012
|
}
|
|
12924
13013
|
|
|
12925
|
-
message.
|
|
13014
|
+
message.startTime = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
12926
13015
|
continue;
|
|
12927
13016
|
}
|
|
12928
13017
|
case 2: {
|
|
@@ -12930,31 +13019,79 @@ export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
|
|
|
12930
13019
|
break;
|
|
12931
13020
|
}
|
|
12932
13021
|
|
|
12933
|
-
message.
|
|
13022
|
+
message.model = reader.string();
|
|
12934
13023
|
continue;
|
|
12935
13024
|
}
|
|
12936
13025
|
case 3: {
|
|
12937
|
-
if (tag !==
|
|
13026
|
+
if (tag !== 26) {
|
|
12938
13027
|
break;
|
|
12939
13028
|
}
|
|
12940
13029
|
|
|
12941
|
-
message.
|
|
13030
|
+
message.provider = reader.string();
|
|
12942
13031
|
continue;
|
|
12943
13032
|
}
|
|
12944
13033
|
case 4: {
|
|
12945
|
-
if (tag !==
|
|
13034
|
+
if (tag !== 34) {
|
|
12946
13035
|
break;
|
|
12947
13036
|
}
|
|
12948
13037
|
|
|
12949
|
-
message.
|
|
13038
|
+
message.sourceSystem = reader.string();
|
|
12950
13039
|
continue;
|
|
12951
13040
|
}
|
|
12952
13041
|
case 5: {
|
|
12953
|
-
if (tag !==
|
|
13042
|
+
if (tag !== 40) {
|
|
12954
13043
|
break;
|
|
12955
13044
|
}
|
|
12956
13045
|
|
|
12957
|
-
message.
|
|
13046
|
+
message.fundingMode = reader.int32() as any;
|
|
13047
|
+
continue;
|
|
13048
|
+
}
|
|
13049
|
+
case 6: {
|
|
13050
|
+
if (tag !== 48) {
|
|
13051
|
+
break;
|
|
13052
|
+
}
|
|
13053
|
+
|
|
13054
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
13055
|
+
continue;
|
|
13056
|
+
}
|
|
13057
|
+
case 7: {
|
|
13058
|
+
if (tag !== 56) {
|
|
13059
|
+
break;
|
|
13060
|
+
}
|
|
13061
|
+
|
|
13062
|
+
message.inputTokens = longToNumber(reader.uint64());
|
|
13063
|
+
continue;
|
|
13064
|
+
}
|
|
13065
|
+
case 8: {
|
|
13066
|
+
if (tag !== 64) {
|
|
13067
|
+
break;
|
|
13068
|
+
}
|
|
13069
|
+
|
|
13070
|
+
message.outputTokens = longToNumber(reader.uint64());
|
|
13071
|
+
continue;
|
|
13072
|
+
}
|
|
13073
|
+
case 9: {
|
|
13074
|
+
if (tag !== 72) {
|
|
13075
|
+
break;
|
|
13076
|
+
}
|
|
13077
|
+
|
|
13078
|
+
message.cacheReadTokens = longToNumber(reader.uint64());
|
|
13079
|
+
continue;
|
|
13080
|
+
}
|
|
13081
|
+
case 10: {
|
|
13082
|
+
if (tag !== 80) {
|
|
13083
|
+
break;
|
|
13084
|
+
}
|
|
13085
|
+
|
|
13086
|
+
message.cacheWriteTokens = longToNumber(reader.uint64());
|
|
13087
|
+
continue;
|
|
13088
|
+
}
|
|
13089
|
+
case 11: {
|
|
13090
|
+
if (tag !== 89) {
|
|
13091
|
+
break;
|
|
13092
|
+
}
|
|
13093
|
+
|
|
13094
|
+
message.costUsd = reader.double();
|
|
12958
13095
|
continue;
|
|
12959
13096
|
}
|
|
12960
13097
|
}
|
|
@@ -12969,80 +13106,809 @@ export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
|
|
|
12969
13106
|
}
|
|
12970
13107
|
},
|
|
12971
13108
|
|
|
12972
|
-
fromJSON(object: any):
|
|
13109
|
+
fromJSON(object: any): ProjectUsageBucket {
|
|
12973
13110
|
return {
|
|
12974
|
-
|
|
12975
|
-
?
|
|
12976
|
-
: isSet(object.
|
|
12977
|
-
?
|
|
12978
|
-
:
|
|
13111
|
+
startTime: isSet(object.startTime)
|
|
13112
|
+
? fromJsonTimestamp(object.startTime)
|
|
13113
|
+
: isSet(object.start_time)
|
|
13114
|
+
? fromJsonTimestamp(object.start_time)
|
|
13115
|
+
: undefined,
|
|
13116
|
+
model: isSet(object.model) ? globalThis.String(object.model) : "",
|
|
13117
|
+
provider: isSet(object.provider) ? globalThis.String(object.provider) : "",
|
|
12979
13118
|
sourceSystem: isSet(object.sourceSystem)
|
|
12980
13119
|
? globalThis.String(object.sourceSystem)
|
|
12981
13120
|
: isSet(object.source_system)
|
|
12982
13121
|
? globalThis.String(object.source_system)
|
|
12983
13122
|
: "",
|
|
12984
|
-
|
|
12985
|
-
?
|
|
12986
|
-
: isSet(object.
|
|
12987
|
-
?
|
|
13123
|
+
fundingMode: isSet(object.fundingMode)
|
|
13124
|
+
? aIFundingModeFromJSON(object.fundingMode)
|
|
13125
|
+
: isSet(object.funding_mode)
|
|
13126
|
+
? aIFundingModeFromJSON(object.funding_mode)
|
|
12988
13127
|
: 0,
|
|
12989
13128
|
modelCalls: isSet(object.modelCalls)
|
|
12990
13129
|
? globalThis.Number(object.modelCalls)
|
|
12991
13130
|
: isSet(object.model_calls)
|
|
12992
13131
|
? globalThis.Number(object.model_calls)
|
|
12993
13132
|
: 0,
|
|
12994
|
-
|
|
12995
|
-
?
|
|
12996
|
-
: isSet(object.
|
|
12997
|
-
?
|
|
12998
|
-
:
|
|
13133
|
+
inputTokens: isSet(object.inputTokens)
|
|
13134
|
+
? globalThis.Number(object.inputTokens)
|
|
13135
|
+
: isSet(object.input_tokens)
|
|
13136
|
+
? globalThis.Number(object.input_tokens)
|
|
13137
|
+
: 0,
|
|
13138
|
+
outputTokens: isSet(object.outputTokens)
|
|
13139
|
+
? globalThis.Number(object.outputTokens)
|
|
13140
|
+
: isSet(object.output_tokens)
|
|
13141
|
+
? globalThis.Number(object.output_tokens)
|
|
13142
|
+
: 0,
|
|
13143
|
+
cacheReadTokens: isSet(object.cacheReadTokens)
|
|
13144
|
+
? globalThis.Number(object.cacheReadTokens)
|
|
13145
|
+
: isSet(object.cache_read_tokens)
|
|
13146
|
+
? globalThis.Number(object.cache_read_tokens)
|
|
13147
|
+
: 0,
|
|
13148
|
+
cacheWriteTokens: isSet(object.cacheWriteTokens)
|
|
13149
|
+
? globalThis.Number(object.cacheWriteTokens)
|
|
13150
|
+
: isSet(object.cache_write_tokens)
|
|
13151
|
+
? globalThis.Number(object.cache_write_tokens)
|
|
13152
|
+
: 0,
|
|
13153
|
+
costUsd: isSet(object.costUsd)
|
|
13154
|
+
? globalThis.Number(object.costUsd)
|
|
13155
|
+
: isSet(object.cost_usd)
|
|
13156
|
+
? globalThis.Number(object.cost_usd)
|
|
13157
|
+
: 0,
|
|
12999
13158
|
};
|
|
13000
13159
|
},
|
|
13001
13160
|
|
|
13002
|
-
toJSON(message:
|
|
13161
|
+
toJSON(message: ProjectUsageBucket): unknown {
|
|
13003
13162
|
const obj: any = {};
|
|
13004
|
-
if (message.
|
|
13005
|
-
obj.
|
|
13163
|
+
if (message.startTime !== undefined) {
|
|
13164
|
+
obj.startTime = message.startTime.toISOString();
|
|
13165
|
+
}
|
|
13166
|
+
if (message.model !== "") {
|
|
13167
|
+
obj.model = message.model;
|
|
13168
|
+
}
|
|
13169
|
+
if (message.provider !== "") {
|
|
13170
|
+
obj.provider = message.provider;
|
|
13006
13171
|
}
|
|
13007
13172
|
if (message.sourceSystem !== "") {
|
|
13008
13173
|
obj.sourceSystem = message.sourceSystem;
|
|
13009
13174
|
}
|
|
13010
|
-
if (message.
|
|
13011
|
-
obj.
|
|
13175
|
+
if (message.fundingMode !== 0) {
|
|
13176
|
+
obj.fundingMode = aIFundingModeToJSON(message.fundingMode);
|
|
13012
13177
|
}
|
|
13013
13178
|
if (message.modelCalls !== 0) {
|
|
13014
13179
|
obj.modelCalls = Math.round(message.modelCalls);
|
|
13015
13180
|
}
|
|
13016
|
-
if (message.
|
|
13017
|
-
obj.
|
|
13181
|
+
if (message.inputTokens !== 0) {
|
|
13182
|
+
obj.inputTokens = Math.round(message.inputTokens);
|
|
13183
|
+
}
|
|
13184
|
+
if (message.outputTokens !== 0) {
|
|
13185
|
+
obj.outputTokens = Math.round(message.outputTokens);
|
|
13186
|
+
}
|
|
13187
|
+
if (message.cacheReadTokens !== 0) {
|
|
13188
|
+
obj.cacheReadTokens = Math.round(message.cacheReadTokens);
|
|
13189
|
+
}
|
|
13190
|
+
if (message.cacheWriteTokens !== 0) {
|
|
13191
|
+
obj.cacheWriteTokens = Math.round(message.cacheWriteTokens);
|
|
13192
|
+
}
|
|
13193
|
+
if (message.costUsd !== 0) {
|
|
13194
|
+
obj.costUsd = message.costUsd;
|
|
13018
13195
|
}
|
|
13019
13196
|
return obj;
|
|
13020
13197
|
},
|
|
13021
13198
|
|
|
13022
|
-
create<I extends Exact<DeepPartial<
|
|
13023
|
-
return
|
|
13199
|
+
create<I extends Exact<DeepPartial<ProjectUsageBucket>, I>>(base?: I): ProjectUsageBucket {
|
|
13200
|
+
return ProjectUsageBucket.fromPartial(base ?? ({} as any));
|
|
13024
13201
|
},
|
|
13025
|
-
fromPartial<I extends Exact<DeepPartial<
|
|
13026
|
-
const message =
|
|
13027
|
-
message.
|
|
13202
|
+
fromPartial<I extends Exact<DeepPartial<ProjectUsageBucket>, I>>(object: I): ProjectUsageBucket {
|
|
13203
|
+
const message = createBaseProjectUsageBucket();
|
|
13204
|
+
message.startTime = object.startTime ?? undefined;
|
|
13205
|
+
message.model = object.model ?? "";
|
|
13206
|
+
message.provider = object.provider ?? "";
|
|
13028
13207
|
message.sourceSystem = object.sourceSystem ?? "";
|
|
13029
|
-
message.
|
|
13208
|
+
message.fundingMode = object.fundingMode ?? 0;
|
|
13030
13209
|
message.modelCalls = object.modelCalls ?? 0;
|
|
13031
|
-
message.
|
|
13210
|
+
message.inputTokens = object.inputTokens ?? 0;
|
|
13211
|
+
message.outputTokens = object.outputTokens ?? 0;
|
|
13212
|
+
message.cacheReadTokens = object.cacheReadTokens ?? 0;
|
|
13213
|
+
message.cacheWriteTokens = object.cacheWriteTokens ?? 0;
|
|
13214
|
+
message.costUsd = object.costUsd ?? 0;
|
|
13032
13215
|
return message;
|
|
13033
13216
|
},
|
|
13034
13217
|
};
|
|
13035
13218
|
|
|
13036
|
-
function
|
|
13037
|
-
return { organizationId: "",
|
|
13219
|
+
function createBaseProjectSummariesRequest(): ProjectSummariesRequest {
|
|
13220
|
+
return { organizationId: "", projectIds: [], activeAfter: undefined };
|
|
13038
13221
|
}
|
|
13039
13222
|
|
|
13040
|
-
export const
|
|
13041
|
-
encode(message:
|
|
13223
|
+
export const ProjectSummariesRequest: MessageFns<ProjectSummariesRequest> = {
|
|
13224
|
+
encode(message: ProjectSummariesRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13042
13225
|
if (message.organizationId !== "") {
|
|
13043
13226
|
writer.uint32(10).string(message.organizationId);
|
|
13044
13227
|
}
|
|
13045
|
-
|
|
13228
|
+
for (const v of message.projectIds) {
|
|
13229
|
+
writer.uint32(18).string(v!);
|
|
13230
|
+
}
|
|
13231
|
+
if (message.activeAfter !== undefined) {
|
|
13232
|
+
Timestamp.encode(toTimestamp(message.activeAfter), writer.uint32(26).fork()).join();
|
|
13233
|
+
}
|
|
13234
|
+
return writer;
|
|
13235
|
+
},
|
|
13236
|
+
|
|
13237
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectSummariesRequest {
|
|
13238
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13239
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13240
|
+
if (previousRecursionDepth >= 100) {
|
|
13241
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13242
|
+
}
|
|
13243
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13244
|
+
try {
|
|
13245
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13246
|
+
const message = createBaseProjectSummariesRequest();
|
|
13247
|
+
while (reader.pos < end) {
|
|
13248
|
+
const tag = reader.uint32();
|
|
13249
|
+
switch (tag >>> 3) {
|
|
13250
|
+
case 1: {
|
|
13251
|
+
if (tag !== 10) {
|
|
13252
|
+
break;
|
|
13253
|
+
}
|
|
13254
|
+
|
|
13255
|
+
message.organizationId = reader.string();
|
|
13256
|
+
continue;
|
|
13257
|
+
}
|
|
13258
|
+
case 2: {
|
|
13259
|
+
if (tag !== 18) {
|
|
13260
|
+
break;
|
|
13261
|
+
}
|
|
13262
|
+
|
|
13263
|
+
message.projectIds.push(reader.string());
|
|
13264
|
+
continue;
|
|
13265
|
+
}
|
|
13266
|
+
case 3: {
|
|
13267
|
+
if (tag !== 26) {
|
|
13268
|
+
break;
|
|
13269
|
+
}
|
|
13270
|
+
|
|
13271
|
+
message.activeAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
13272
|
+
continue;
|
|
13273
|
+
}
|
|
13274
|
+
}
|
|
13275
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13276
|
+
break;
|
|
13277
|
+
}
|
|
13278
|
+
reader.skip(tag & 7);
|
|
13279
|
+
}
|
|
13280
|
+
return message;
|
|
13281
|
+
} finally {
|
|
13282
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13283
|
+
}
|
|
13284
|
+
},
|
|
13285
|
+
|
|
13286
|
+
fromJSON(object: any): ProjectSummariesRequest {
|
|
13287
|
+
return {
|
|
13288
|
+
organizationId: isSet(object.organizationId)
|
|
13289
|
+
? globalThis.String(object.organizationId)
|
|
13290
|
+
: isSet(object.organization_id)
|
|
13291
|
+
? globalThis.String(object.organization_id)
|
|
13292
|
+
: "",
|
|
13293
|
+
projectIds: globalThis.Array.isArray(object?.projectIds)
|
|
13294
|
+
? object.projectIds.map((e: any) => globalThis.String(e))
|
|
13295
|
+
: globalThis.Array.isArray(object?.project_ids)
|
|
13296
|
+
? object.project_ids.map((e: any) => globalThis.String(e))
|
|
13297
|
+
: [],
|
|
13298
|
+
activeAfter: isSet(object.activeAfter)
|
|
13299
|
+
? fromJsonTimestamp(object.activeAfter)
|
|
13300
|
+
: isSet(object.active_after)
|
|
13301
|
+
? fromJsonTimestamp(object.active_after)
|
|
13302
|
+
: undefined,
|
|
13303
|
+
};
|
|
13304
|
+
},
|
|
13305
|
+
|
|
13306
|
+
toJSON(message: ProjectSummariesRequest): unknown {
|
|
13307
|
+
const obj: any = {};
|
|
13308
|
+
if (message.organizationId !== "") {
|
|
13309
|
+
obj.organizationId = message.organizationId;
|
|
13310
|
+
}
|
|
13311
|
+
if (message.projectIds?.length) {
|
|
13312
|
+
obj.projectIds = message.projectIds;
|
|
13313
|
+
}
|
|
13314
|
+
if (message.activeAfter !== undefined) {
|
|
13315
|
+
obj.activeAfter = message.activeAfter.toISOString();
|
|
13316
|
+
}
|
|
13317
|
+
return obj;
|
|
13318
|
+
},
|
|
13319
|
+
|
|
13320
|
+
create<I extends Exact<DeepPartial<ProjectSummariesRequest>, I>>(base?: I): ProjectSummariesRequest {
|
|
13321
|
+
return ProjectSummariesRequest.fromPartial(base ?? ({} as any));
|
|
13322
|
+
},
|
|
13323
|
+
fromPartial<I extends Exact<DeepPartial<ProjectSummariesRequest>, I>>(object: I): ProjectSummariesRequest {
|
|
13324
|
+
const message = createBaseProjectSummariesRequest();
|
|
13325
|
+
message.organizationId = object.organizationId ?? "";
|
|
13326
|
+
message.projectIds = object.projectIds?.map((e) => e) || [];
|
|
13327
|
+
message.activeAfter = object.activeAfter ?? undefined;
|
|
13328
|
+
return message;
|
|
13329
|
+
},
|
|
13330
|
+
};
|
|
13331
|
+
|
|
13332
|
+
function createBaseProjectSummaries(): ProjectSummaries {
|
|
13333
|
+
return { projects: [] };
|
|
13334
|
+
}
|
|
13335
|
+
|
|
13336
|
+
export const ProjectSummaries: MessageFns<ProjectSummaries> = {
|
|
13337
|
+
encode(message: ProjectSummaries, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13338
|
+
for (const v of message.projects) {
|
|
13339
|
+
ProjectSummary.encode(v!, writer.uint32(10).fork()).join();
|
|
13340
|
+
}
|
|
13341
|
+
return writer;
|
|
13342
|
+
},
|
|
13343
|
+
|
|
13344
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectSummaries {
|
|
13345
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13346
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13347
|
+
if (previousRecursionDepth >= 100) {
|
|
13348
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13349
|
+
}
|
|
13350
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13351
|
+
try {
|
|
13352
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13353
|
+
const message = createBaseProjectSummaries();
|
|
13354
|
+
while (reader.pos < end) {
|
|
13355
|
+
const tag = reader.uint32();
|
|
13356
|
+
switch (tag >>> 3) {
|
|
13357
|
+
case 1: {
|
|
13358
|
+
if (tag !== 10) {
|
|
13359
|
+
break;
|
|
13360
|
+
}
|
|
13361
|
+
|
|
13362
|
+
message.projects.push(ProjectSummary.decode(reader, reader.uint32()));
|
|
13363
|
+
continue;
|
|
13364
|
+
}
|
|
13365
|
+
}
|
|
13366
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13367
|
+
break;
|
|
13368
|
+
}
|
|
13369
|
+
reader.skip(tag & 7);
|
|
13370
|
+
}
|
|
13371
|
+
return message;
|
|
13372
|
+
} finally {
|
|
13373
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13374
|
+
}
|
|
13375
|
+
},
|
|
13376
|
+
|
|
13377
|
+
fromJSON(object: any): ProjectSummaries {
|
|
13378
|
+
return {
|
|
13379
|
+
projects: globalThis.Array.isArray(object?.projects)
|
|
13380
|
+
? object.projects.map((e: any) => ProjectSummary.fromJSON(e))
|
|
13381
|
+
: [],
|
|
13382
|
+
};
|
|
13383
|
+
},
|
|
13384
|
+
|
|
13385
|
+
toJSON(message: ProjectSummaries): unknown {
|
|
13386
|
+
const obj: any = {};
|
|
13387
|
+
if (message.projects?.length) {
|
|
13388
|
+
obj.projects = message.projects.map((e) => ProjectSummary.toJSON(e));
|
|
13389
|
+
}
|
|
13390
|
+
return obj;
|
|
13391
|
+
},
|
|
13392
|
+
|
|
13393
|
+
create<I extends Exact<DeepPartial<ProjectSummaries>, I>>(base?: I): ProjectSummaries {
|
|
13394
|
+
return ProjectSummaries.fromPartial(base ?? ({} as any));
|
|
13395
|
+
},
|
|
13396
|
+
fromPartial<I extends Exact<DeepPartial<ProjectSummaries>, I>>(object: I): ProjectSummaries {
|
|
13397
|
+
const message = createBaseProjectSummaries();
|
|
13398
|
+
message.projects = object.projects?.map((e) => ProjectSummary.fromPartial(e)) || [];
|
|
13399
|
+
return message;
|
|
13400
|
+
},
|
|
13401
|
+
};
|
|
13402
|
+
|
|
13403
|
+
function createBaseProjectSummary(): ProjectSummary {
|
|
13404
|
+
return {
|
|
13405
|
+
projectId: "",
|
|
13406
|
+
sessions: 0,
|
|
13407
|
+
pullRequestsMerged: 0,
|
|
13408
|
+
repositories: 0,
|
|
13409
|
+
sessionTokens: 0,
|
|
13410
|
+
unpricedTokens: 0,
|
|
13411
|
+
lastActivityAt: undefined,
|
|
13412
|
+
actors: [],
|
|
13413
|
+
byModel: [],
|
|
13414
|
+
};
|
|
13415
|
+
}
|
|
13416
|
+
|
|
13417
|
+
export const ProjectSummary: MessageFns<ProjectSummary> = {
|
|
13418
|
+
encode(message: ProjectSummary, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13419
|
+
if (message.projectId !== "") {
|
|
13420
|
+
writer.uint32(10).string(message.projectId);
|
|
13421
|
+
}
|
|
13422
|
+
if (message.sessions !== 0) {
|
|
13423
|
+
writer.uint32(16).uint64(message.sessions);
|
|
13424
|
+
}
|
|
13425
|
+
if (message.pullRequestsMerged !== 0) {
|
|
13426
|
+
writer.uint32(24).uint64(message.pullRequestsMerged);
|
|
13427
|
+
}
|
|
13428
|
+
if (message.repositories !== 0) {
|
|
13429
|
+
writer.uint32(32).uint64(message.repositories);
|
|
13430
|
+
}
|
|
13431
|
+
if (message.sessionTokens !== 0) {
|
|
13432
|
+
writer.uint32(40).uint64(message.sessionTokens);
|
|
13433
|
+
}
|
|
13434
|
+
if (message.unpricedTokens !== 0) {
|
|
13435
|
+
writer.uint32(48).uint64(message.unpricedTokens);
|
|
13436
|
+
}
|
|
13437
|
+
if (message.lastActivityAt !== undefined) {
|
|
13438
|
+
Timestamp.encode(toTimestamp(message.lastActivityAt), writer.uint32(58).fork()).join();
|
|
13439
|
+
}
|
|
13440
|
+
for (const v of message.actors) {
|
|
13441
|
+
ProjectSummaryActor.encode(v!, writer.uint32(66).fork()).join();
|
|
13442
|
+
}
|
|
13443
|
+
for (const v of message.byModel) {
|
|
13444
|
+
ProjectOverviewSlice.encode(v!, writer.uint32(74).fork()).join();
|
|
13445
|
+
}
|
|
13446
|
+
return writer;
|
|
13447
|
+
},
|
|
13448
|
+
|
|
13449
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectSummary {
|
|
13450
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13451
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13452
|
+
if (previousRecursionDepth >= 100) {
|
|
13453
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13454
|
+
}
|
|
13455
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13456
|
+
try {
|
|
13457
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13458
|
+
const message = createBaseProjectSummary();
|
|
13459
|
+
while (reader.pos < end) {
|
|
13460
|
+
const tag = reader.uint32();
|
|
13461
|
+
switch (tag >>> 3) {
|
|
13462
|
+
case 1: {
|
|
13463
|
+
if (tag !== 10) {
|
|
13464
|
+
break;
|
|
13465
|
+
}
|
|
13466
|
+
|
|
13467
|
+
message.projectId = reader.string();
|
|
13468
|
+
continue;
|
|
13469
|
+
}
|
|
13470
|
+
case 2: {
|
|
13471
|
+
if (tag !== 16) {
|
|
13472
|
+
break;
|
|
13473
|
+
}
|
|
13474
|
+
|
|
13475
|
+
message.sessions = longToNumber(reader.uint64());
|
|
13476
|
+
continue;
|
|
13477
|
+
}
|
|
13478
|
+
case 3: {
|
|
13479
|
+
if (tag !== 24) {
|
|
13480
|
+
break;
|
|
13481
|
+
}
|
|
13482
|
+
|
|
13483
|
+
message.pullRequestsMerged = longToNumber(reader.uint64());
|
|
13484
|
+
continue;
|
|
13485
|
+
}
|
|
13486
|
+
case 4: {
|
|
13487
|
+
if (tag !== 32) {
|
|
13488
|
+
break;
|
|
13489
|
+
}
|
|
13490
|
+
|
|
13491
|
+
message.repositories = longToNumber(reader.uint64());
|
|
13492
|
+
continue;
|
|
13493
|
+
}
|
|
13494
|
+
case 5: {
|
|
13495
|
+
if (tag !== 40) {
|
|
13496
|
+
break;
|
|
13497
|
+
}
|
|
13498
|
+
|
|
13499
|
+
message.sessionTokens = longToNumber(reader.uint64());
|
|
13500
|
+
continue;
|
|
13501
|
+
}
|
|
13502
|
+
case 6: {
|
|
13503
|
+
if (tag !== 48) {
|
|
13504
|
+
break;
|
|
13505
|
+
}
|
|
13506
|
+
|
|
13507
|
+
message.unpricedTokens = longToNumber(reader.uint64());
|
|
13508
|
+
continue;
|
|
13509
|
+
}
|
|
13510
|
+
case 7: {
|
|
13511
|
+
if (tag !== 58) {
|
|
13512
|
+
break;
|
|
13513
|
+
}
|
|
13514
|
+
|
|
13515
|
+
message.lastActivityAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
13516
|
+
continue;
|
|
13517
|
+
}
|
|
13518
|
+
case 8: {
|
|
13519
|
+
if (tag !== 66) {
|
|
13520
|
+
break;
|
|
13521
|
+
}
|
|
13522
|
+
|
|
13523
|
+
message.actors.push(ProjectSummaryActor.decode(reader, reader.uint32()));
|
|
13524
|
+
continue;
|
|
13525
|
+
}
|
|
13526
|
+
case 9: {
|
|
13527
|
+
if (tag !== 74) {
|
|
13528
|
+
break;
|
|
13529
|
+
}
|
|
13530
|
+
|
|
13531
|
+
message.byModel.push(ProjectOverviewSlice.decode(reader, reader.uint32()));
|
|
13532
|
+
continue;
|
|
13533
|
+
}
|
|
13534
|
+
}
|
|
13535
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13536
|
+
break;
|
|
13537
|
+
}
|
|
13538
|
+
reader.skip(tag & 7);
|
|
13539
|
+
}
|
|
13540
|
+
return message;
|
|
13541
|
+
} finally {
|
|
13542
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13543
|
+
}
|
|
13544
|
+
},
|
|
13545
|
+
|
|
13546
|
+
fromJSON(object: any): ProjectSummary {
|
|
13547
|
+
return {
|
|
13548
|
+
projectId: isSet(object.projectId)
|
|
13549
|
+
? globalThis.String(object.projectId)
|
|
13550
|
+
: isSet(object.project_id)
|
|
13551
|
+
? globalThis.String(object.project_id)
|
|
13552
|
+
: "",
|
|
13553
|
+
sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
|
|
13554
|
+
pullRequestsMerged: isSet(object.pullRequestsMerged)
|
|
13555
|
+
? globalThis.Number(object.pullRequestsMerged)
|
|
13556
|
+
: isSet(object.pull_requests_merged)
|
|
13557
|
+
? globalThis.Number(object.pull_requests_merged)
|
|
13558
|
+
: 0,
|
|
13559
|
+
repositories: isSet(object.repositories) ? globalThis.Number(object.repositories) : 0,
|
|
13560
|
+
sessionTokens: isSet(object.sessionTokens)
|
|
13561
|
+
? globalThis.Number(object.sessionTokens)
|
|
13562
|
+
: isSet(object.session_tokens)
|
|
13563
|
+
? globalThis.Number(object.session_tokens)
|
|
13564
|
+
: 0,
|
|
13565
|
+
unpricedTokens: isSet(object.unpricedTokens)
|
|
13566
|
+
? globalThis.Number(object.unpricedTokens)
|
|
13567
|
+
: isSet(object.unpriced_tokens)
|
|
13568
|
+
? globalThis.Number(object.unpriced_tokens)
|
|
13569
|
+
: 0,
|
|
13570
|
+
lastActivityAt: isSet(object.lastActivityAt)
|
|
13571
|
+
? fromJsonTimestamp(object.lastActivityAt)
|
|
13572
|
+
: isSet(object.last_activity_at)
|
|
13573
|
+
? fromJsonTimestamp(object.last_activity_at)
|
|
13574
|
+
: undefined,
|
|
13575
|
+
actors: globalThis.Array.isArray(object?.actors)
|
|
13576
|
+
? object.actors.map((e: any) => ProjectSummaryActor.fromJSON(e))
|
|
13577
|
+
: [],
|
|
13578
|
+
byModel: globalThis.Array.isArray(object?.byModel)
|
|
13579
|
+
? object.byModel.map((e: any) => ProjectOverviewSlice.fromJSON(e))
|
|
13580
|
+
: globalThis.Array.isArray(object?.by_model)
|
|
13581
|
+
? object.by_model.map((e: any) => ProjectOverviewSlice.fromJSON(e))
|
|
13582
|
+
: [],
|
|
13583
|
+
};
|
|
13584
|
+
},
|
|
13585
|
+
|
|
13586
|
+
toJSON(message: ProjectSummary): unknown {
|
|
13587
|
+
const obj: any = {};
|
|
13588
|
+
if (message.projectId !== "") {
|
|
13589
|
+
obj.projectId = message.projectId;
|
|
13590
|
+
}
|
|
13591
|
+
if (message.sessions !== 0) {
|
|
13592
|
+
obj.sessions = Math.round(message.sessions);
|
|
13593
|
+
}
|
|
13594
|
+
if (message.pullRequestsMerged !== 0) {
|
|
13595
|
+
obj.pullRequestsMerged = Math.round(message.pullRequestsMerged);
|
|
13596
|
+
}
|
|
13597
|
+
if (message.repositories !== 0) {
|
|
13598
|
+
obj.repositories = Math.round(message.repositories);
|
|
13599
|
+
}
|
|
13600
|
+
if (message.sessionTokens !== 0) {
|
|
13601
|
+
obj.sessionTokens = Math.round(message.sessionTokens);
|
|
13602
|
+
}
|
|
13603
|
+
if (message.unpricedTokens !== 0) {
|
|
13604
|
+
obj.unpricedTokens = Math.round(message.unpricedTokens);
|
|
13605
|
+
}
|
|
13606
|
+
if (message.lastActivityAt !== undefined) {
|
|
13607
|
+
obj.lastActivityAt = message.lastActivityAt.toISOString();
|
|
13608
|
+
}
|
|
13609
|
+
if (message.actors?.length) {
|
|
13610
|
+
obj.actors = message.actors.map((e) => ProjectSummaryActor.toJSON(e));
|
|
13611
|
+
}
|
|
13612
|
+
if (message.byModel?.length) {
|
|
13613
|
+
obj.byModel = message.byModel.map((e) => ProjectOverviewSlice.toJSON(e));
|
|
13614
|
+
}
|
|
13615
|
+
return obj;
|
|
13616
|
+
},
|
|
13617
|
+
|
|
13618
|
+
create<I extends Exact<DeepPartial<ProjectSummary>, I>>(base?: I): ProjectSummary {
|
|
13619
|
+
return ProjectSummary.fromPartial(base ?? ({} as any));
|
|
13620
|
+
},
|
|
13621
|
+
fromPartial<I extends Exact<DeepPartial<ProjectSummary>, I>>(object: I): ProjectSummary {
|
|
13622
|
+
const message = createBaseProjectSummary();
|
|
13623
|
+
message.projectId = object.projectId ?? "";
|
|
13624
|
+
message.sessions = object.sessions ?? 0;
|
|
13625
|
+
message.pullRequestsMerged = object.pullRequestsMerged ?? 0;
|
|
13626
|
+
message.repositories = object.repositories ?? 0;
|
|
13627
|
+
message.sessionTokens = object.sessionTokens ?? 0;
|
|
13628
|
+
message.unpricedTokens = object.unpricedTokens ?? 0;
|
|
13629
|
+
message.lastActivityAt = object.lastActivityAt ?? undefined;
|
|
13630
|
+
message.actors = object.actors?.map((e) => ProjectSummaryActor.fromPartial(e)) || [];
|
|
13631
|
+
message.byModel = object.byModel?.map((e) => ProjectOverviewSlice.fromPartial(e)) || [];
|
|
13632
|
+
return message;
|
|
13633
|
+
},
|
|
13634
|
+
};
|
|
13635
|
+
|
|
13636
|
+
function createBaseProjectSummaryActor(): ProjectSummaryActor {
|
|
13637
|
+
return { sourceSystem: "", userId: "", apiKeyId: "" };
|
|
13638
|
+
}
|
|
13639
|
+
|
|
13640
|
+
export const ProjectSummaryActor: MessageFns<ProjectSummaryActor> = {
|
|
13641
|
+
encode(message: ProjectSummaryActor, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13642
|
+
if (message.sourceSystem !== "") {
|
|
13643
|
+
writer.uint32(10).string(message.sourceSystem);
|
|
13644
|
+
}
|
|
13645
|
+
if (message.userId !== "") {
|
|
13646
|
+
writer.uint32(18).string(message.userId);
|
|
13647
|
+
}
|
|
13648
|
+
if (message.apiKeyId !== "") {
|
|
13649
|
+
writer.uint32(26).string(message.apiKeyId);
|
|
13650
|
+
}
|
|
13651
|
+
return writer;
|
|
13652
|
+
},
|
|
13653
|
+
|
|
13654
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectSummaryActor {
|
|
13655
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13656
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13657
|
+
if (previousRecursionDepth >= 100) {
|
|
13658
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13659
|
+
}
|
|
13660
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13661
|
+
try {
|
|
13662
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13663
|
+
const message = createBaseProjectSummaryActor();
|
|
13664
|
+
while (reader.pos < end) {
|
|
13665
|
+
const tag = reader.uint32();
|
|
13666
|
+
switch (tag >>> 3) {
|
|
13667
|
+
case 1: {
|
|
13668
|
+
if (tag !== 10) {
|
|
13669
|
+
break;
|
|
13670
|
+
}
|
|
13671
|
+
|
|
13672
|
+
message.sourceSystem = reader.string();
|
|
13673
|
+
continue;
|
|
13674
|
+
}
|
|
13675
|
+
case 2: {
|
|
13676
|
+
if (tag !== 18) {
|
|
13677
|
+
break;
|
|
13678
|
+
}
|
|
13679
|
+
|
|
13680
|
+
message.userId = reader.string();
|
|
13681
|
+
continue;
|
|
13682
|
+
}
|
|
13683
|
+
case 3: {
|
|
13684
|
+
if (tag !== 26) {
|
|
13685
|
+
break;
|
|
13686
|
+
}
|
|
13687
|
+
|
|
13688
|
+
message.apiKeyId = reader.string();
|
|
13689
|
+
continue;
|
|
13690
|
+
}
|
|
13691
|
+
}
|
|
13692
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13693
|
+
break;
|
|
13694
|
+
}
|
|
13695
|
+
reader.skip(tag & 7);
|
|
13696
|
+
}
|
|
13697
|
+
return message;
|
|
13698
|
+
} finally {
|
|
13699
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13700
|
+
}
|
|
13701
|
+
},
|
|
13702
|
+
|
|
13703
|
+
fromJSON(object: any): ProjectSummaryActor {
|
|
13704
|
+
return {
|
|
13705
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
13706
|
+
? globalThis.String(object.sourceSystem)
|
|
13707
|
+
: isSet(object.source_system)
|
|
13708
|
+
? globalThis.String(object.source_system)
|
|
13709
|
+
: "",
|
|
13710
|
+
userId: isSet(object.userId)
|
|
13711
|
+
? globalThis.String(object.userId)
|
|
13712
|
+
: isSet(object.user_id)
|
|
13713
|
+
? globalThis.String(object.user_id)
|
|
13714
|
+
: "",
|
|
13715
|
+
apiKeyId: isSet(object.apiKeyId)
|
|
13716
|
+
? globalThis.String(object.apiKeyId)
|
|
13717
|
+
: isSet(object.api_key_id)
|
|
13718
|
+
? globalThis.String(object.api_key_id)
|
|
13719
|
+
: "",
|
|
13720
|
+
};
|
|
13721
|
+
},
|
|
13722
|
+
|
|
13723
|
+
toJSON(message: ProjectSummaryActor): unknown {
|
|
13724
|
+
const obj: any = {};
|
|
13725
|
+
if (message.sourceSystem !== "") {
|
|
13726
|
+
obj.sourceSystem = message.sourceSystem;
|
|
13727
|
+
}
|
|
13728
|
+
if (message.userId !== "") {
|
|
13729
|
+
obj.userId = message.userId;
|
|
13730
|
+
}
|
|
13731
|
+
if (message.apiKeyId !== "") {
|
|
13732
|
+
obj.apiKeyId = message.apiKeyId;
|
|
13733
|
+
}
|
|
13734
|
+
return obj;
|
|
13735
|
+
},
|
|
13736
|
+
|
|
13737
|
+
create<I extends Exact<DeepPartial<ProjectSummaryActor>, I>>(base?: I): ProjectSummaryActor {
|
|
13738
|
+
return ProjectSummaryActor.fromPartial(base ?? ({} as any));
|
|
13739
|
+
},
|
|
13740
|
+
fromPartial<I extends Exact<DeepPartial<ProjectSummaryActor>, I>>(object: I): ProjectSummaryActor {
|
|
13741
|
+
const message = createBaseProjectSummaryActor();
|
|
13742
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
13743
|
+
message.userId = object.userId ?? "";
|
|
13744
|
+
message.apiKeyId = object.apiKeyId ?? "";
|
|
13745
|
+
return message;
|
|
13746
|
+
},
|
|
13747
|
+
};
|
|
13748
|
+
|
|
13749
|
+
function createBaseProjectSessionRef(): ProjectSessionRef {
|
|
13750
|
+
return { sessionId: "", sourceSystem: "", costUsd: 0, modelCalls: 0, lastActivityAt: undefined };
|
|
13751
|
+
}
|
|
13752
|
+
|
|
13753
|
+
export const ProjectSessionRef: MessageFns<ProjectSessionRef> = {
|
|
13754
|
+
encode(message: ProjectSessionRef, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13755
|
+
if (message.sessionId !== "") {
|
|
13756
|
+
writer.uint32(10).string(message.sessionId);
|
|
13757
|
+
}
|
|
13758
|
+
if (message.sourceSystem !== "") {
|
|
13759
|
+
writer.uint32(18).string(message.sourceSystem);
|
|
13760
|
+
}
|
|
13761
|
+
if (message.costUsd !== 0) {
|
|
13762
|
+
writer.uint32(25).double(message.costUsd);
|
|
13763
|
+
}
|
|
13764
|
+
if (message.modelCalls !== 0) {
|
|
13765
|
+
writer.uint32(32).uint64(message.modelCalls);
|
|
13766
|
+
}
|
|
13767
|
+
if (message.lastActivityAt !== undefined) {
|
|
13768
|
+
Timestamp.encode(toTimestamp(message.lastActivityAt), writer.uint32(42).fork()).join();
|
|
13769
|
+
}
|
|
13770
|
+
return writer;
|
|
13771
|
+
},
|
|
13772
|
+
|
|
13773
|
+
decode(input: BinaryReader | Uint8Array, length?: number): ProjectSessionRef {
|
|
13774
|
+
const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
|
|
13775
|
+
const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
|
|
13776
|
+
if (previousRecursionDepth >= 100) {
|
|
13777
|
+
throw new globalThis.Error("protobuf decode recursion limit exceeded");
|
|
13778
|
+
}
|
|
13779
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
|
|
13780
|
+
try {
|
|
13781
|
+
const end = length === undefined ? reader.len : reader.pos + length;
|
|
13782
|
+
const message = createBaseProjectSessionRef();
|
|
13783
|
+
while (reader.pos < end) {
|
|
13784
|
+
const tag = reader.uint32();
|
|
13785
|
+
switch (tag >>> 3) {
|
|
13786
|
+
case 1: {
|
|
13787
|
+
if (tag !== 10) {
|
|
13788
|
+
break;
|
|
13789
|
+
}
|
|
13790
|
+
|
|
13791
|
+
message.sessionId = reader.string();
|
|
13792
|
+
continue;
|
|
13793
|
+
}
|
|
13794
|
+
case 2: {
|
|
13795
|
+
if (tag !== 18) {
|
|
13796
|
+
break;
|
|
13797
|
+
}
|
|
13798
|
+
|
|
13799
|
+
message.sourceSystem = reader.string();
|
|
13800
|
+
continue;
|
|
13801
|
+
}
|
|
13802
|
+
case 3: {
|
|
13803
|
+
if (tag !== 25) {
|
|
13804
|
+
break;
|
|
13805
|
+
}
|
|
13806
|
+
|
|
13807
|
+
message.costUsd = reader.double();
|
|
13808
|
+
continue;
|
|
13809
|
+
}
|
|
13810
|
+
case 4: {
|
|
13811
|
+
if (tag !== 32) {
|
|
13812
|
+
break;
|
|
13813
|
+
}
|
|
13814
|
+
|
|
13815
|
+
message.modelCalls = longToNumber(reader.uint64());
|
|
13816
|
+
continue;
|
|
13817
|
+
}
|
|
13818
|
+
case 5: {
|
|
13819
|
+
if (tag !== 42) {
|
|
13820
|
+
break;
|
|
13821
|
+
}
|
|
13822
|
+
|
|
13823
|
+
message.lastActivityAt = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
|
|
13824
|
+
continue;
|
|
13825
|
+
}
|
|
13826
|
+
}
|
|
13827
|
+
if ((tag & 7) === 4 || tag === 0) {
|
|
13828
|
+
break;
|
|
13829
|
+
}
|
|
13830
|
+
reader.skip(tag & 7);
|
|
13831
|
+
}
|
|
13832
|
+
return message;
|
|
13833
|
+
} finally {
|
|
13834
|
+
(reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
|
|
13835
|
+
}
|
|
13836
|
+
},
|
|
13837
|
+
|
|
13838
|
+
fromJSON(object: any): ProjectSessionRef {
|
|
13839
|
+
return {
|
|
13840
|
+
sessionId: isSet(object.sessionId)
|
|
13841
|
+
? globalThis.String(object.sessionId)
|
|
13842
|
+
: isSet(object.session_id)
|
|
13843
|
+
? globalThis.String(object.session_id)
|
|
13844
|
+
: "",
|
|
13845
|
+
sourceSystem: isSet(object.sourceSystem)
|
|
13846
|
+
? globalThis.String(object.sourceSystem)
|
|
13847
|
+
: isSet(object.source_system)
|
|
13848
|
+
? globalThis.String(object.source_system)
|
|
13849
|
+
: "",
|
|
13850
|
+
costUsd: isSet(object.costUsd)
|
|
13851
|
+
? globalThis.Number(object.costUsd)
|
|
13852
|
+
: isSet(object.cost_usd)
|
|
13853
|
+
? globalThis.Number(object.cost_usd)
|
|
13854
|
+
: 0,
|
|
13855
|
+
modelCalls: isSet(object.modelCalls)
|
|
13856
|
+
? globalThis.Number(object.modelCalls)
|
|
13857
|
+
: isSet(object.model_calls)
|
|
13858
|
+
? globalThis.Number(object.model_calls)
|
|
13859
|
+
: 0,
|
|
13860
|
+
lastActivityAt: isSet(object.lastActivityAt)
|
|
13861
|
+
? fromJsonTimestamp(object.lastActivityAt)
|
|
13862
|
+
: isSet(object.last_activity_at)
|
|
13863
|
+
? fromJsonTimestamp(object.last_activity_at)
|
|
13864
|
+
: undefined,
|
|
13865
|
+
};
|
|
13866
|
+
},
|
|
13867
|
+
|
|
13868
|
+
toJSON(message: ProjectSessionRef): unknown {
|
|
13869
|
+
const obj: any = {};
|
|
13870
|
+
if (message.sessionId !== "") {
|
|
13871
|
+
obj.sessionId = message.sessionId;
|
|
13872
|
+
}
|
|
13873
|
+
if (message.sourceSystem !== "") {
|
|
13874
|
+
obj.sourceSystem = message.sourceSystem;
|
|
13875
|
+
}
|
|
13876
|
+
if (message.costUsd !== 0) {
|
|
13877
|
+
obj.costUsd = message.costUsd;
|
|
13878
|
+
}
|
|
13879
|
+
if (message.modelCalls !== 0) {
|
|
13880
|
+
obj.modelCalls = Math.round(message.modelCalls);
|
|
13881
|
+
}
|
|
13882
|
+
if (message.lastActivityAt !== undefined) {
|
|
13883
|
+
obj.lastActivityAt = message.lastActivityAt.toISOString();
|
|
13884
|
+
}
|
|
13885
|
+
return obj;
|
|
13886
|
+
},
|
|
13887
|
+
|
|
13888
|
+
create<I extends Exact<DeepPartial<ProjectSessionRef>, I>>(base?: I): ProjectSessionRef {
|
|
13889
|
+
return ProjectSessionRef.fromPartial(base ?? ({} as any));
|
|
13890
|
+
},
|
|
13891
|
+
fromPartial<I extends Exact<DeepPartial<ProjectSessionRef>, I>>(object: I): ProjectSessionRef {
|
|
13892
|
+
const message = createBaseProjectSessionRef();
|
|
13893
|
+
message.sessionId = object.sessionId ?? "";
|
|
13894
|
+
message.sourceSystem = object.sourceSystem ?? "";
|
|
13895
|
+
message.costUsd = object.costUsd ?? 0;
|
|
13896
|
+
message.modelCalls = object.modelCalls ?? 0;
|
|
13897
|
+
message.lastActivityAt = object.lastActivityAt ?? undefined;
|
|
13898
|
+
return message;
|
|
13899
|
+
},
|
|
13900
|
+
};
|
|
13901
|
+
|
|
13902
|
+
function createBaseResourceRankingsRequest(): ResourceRankingsRequest {
|
|
13903
|
+
return { organizationId: "", projectId: "", filter: undefined, dimension: 0, timeWindow: 0, limit: 0 };
|
|
13904
|
+
}
|
|
13905
|
+
|
|
13906
|
+
export const ResourceRankingsRequest: MessageFns<ResourceRankingsRequest> = {
|
|
13907
|
+
encode(message: ResourceRankingsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
|
|
13908
|
+
if (message.organizationId !== "") {
|
|
13909
|
+
writer.uint32(10).string(message.organizationId);
|
|
13910
|
+
}
|
|
13911
|
+
if (message.projectId !== "") {
|
|
13046
13912
|
writer.uint32(18).string(message.projectId);
|
|
13047
13913
|
}
|
|
13048
13914
|
if (message.filter !== undefined) {
|
|
@@ -19098,6 +19964,11 @@ export interface AIGatewayService {
|
|
|
19098
19964
|
* and top sessions by cost.
|
|
19099
19965
|
*/
|
|
19100
19966
|
StreamProjectOverview(request: ProjectOverviewRequest, metadata?: Metadata): Observable<ProjectOverview>;
|
|
19967
|
+
/**
|
|
19968
|
+
* Live organization home cards: one summary per requested project (zeros when it has no AI activity) —
|
|
19969
|
+
* conversations last active in the window, their principals and git counts, and the window's burn by model.
|
|
19970
|
+
*/
|
|
19971
|
+
StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries>;
|
|
19101
19972
|
/** Per-file working-state feed (keyset-paginated) behind the unlanded-work funnel. */
|
|
19102
19973
|
ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse>;
|
|
19103
19974
|
/**
|
|
@@ -19162,6 +20033,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
19162
20033
|
this.StreamDailyActivity = this.StreamDailyActivity.bind(this);
|
|
19163
20034
|
this.StreamActivityRhythm = this.StreamActivityRhythm.bind(this);
|
|
19164
20035
|
this.StreamProjectOverview = this.StreamProjectOverview.bind(this);
|
|
20036
|
+
this.StreamProjectSummaries = this.StreamProjectSummaries.bind(this);
|
|
19165
20037
|
this.ListFiles = this.ListFiles.bind(this);
|
|
19166
20038
|
this.StreamFilesSummary = this.StreamFilesSummary.bind(this);
|
|
19167
20039
|
this.ListModelPrices = this.ListModelPrices.bind(this);
|
|
@@ -19267,6 +20139,12 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
|
|
|
19267
20139
|
return result.pipe(map((data) => ProjectOverview.decode(new BinaryReader(data))));
|
|
19268
20140
|
}
|
|
19269
20141
|
|
|
20142
|
+
StreamProjectSummaries(request: ProjectSummariesRequest, metadata?: Metadata): Observable<ProjectSummaries> {
|
|
20143
|
+
const data = ProjectSummariesRequest.encode(request).finish();
|
|
20144
|
+
const result = this.rpc.serverStreamingRequest(this.service, "StreamProjectSummaries", data, metadata);
|
|
20145
|
+
return result.pipe(map((data) => ProjectSummaries.decode(new BinaryReader(data))));
|
|
20146
|
+
}
|
|
20147
|
+
|
|
19270
20148
|
ListFiles(request: ListFilesRequest, metadata?: Metadata): Promise<ListFilesResponse> {
|
|
19271
20149
|
const data = ListFilesRequest.encode(request).finish();
|
|
19272
20150
|
const promise = this.rpc.request(this.service, "ListFiles", data, metadata);
|