@miradorlabs/web-grpc 4.34.0 → 4.36.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.
@@ -3253,6 +3253,18 @@ export interface GetSessionAnalysisOverviewResponse {
3253
3253
  scoredSessions: ScoredSession[];
3254
3254
  /** How many of the sessions carry a score; scored_sessions holds the first 20 of them. */
3255
3255
  scoredSessionCount: number;
3256
+ /**
3257
+ * One row per distinct session_score (0-100) among the window's filtered sessions that carry one, ordered by
3258
+ * score descending: the rows add up to scored_session_count, so a client bands them however it likes.
3259
+ */
3260
+ sessionScoreCounts: SessionScoreCount[];
3261
+ }
3262
+
3263
+ /** SessionScoreCount is how many sessions carry one score (AISessionSummary.session_score). */
3264
+ export interface SessionScoreCount {
3265
+ /** 0-100. */
3266
+ score: number;
3267
+ sessions: number;
3256
3268
  }
3257
3269
 
3258
3270
  /** SessionWorkTypeCount is how many sessions carry one work type (AISessionSummary.work_type) as their latest label. */
@@ -3282,6 +3294,97 @@ export interface ScoredSession {
3282
3294
  sessionScoreRubric: AISessionScoreRubric;
3283
3295
  }
3284
3296
 
3297
+ export interface GetSessionPeriodTotalsRequest {
3298
+ organizationId: string;
3299
+ projectId: string;
3300
+ /**
3301
+ * The window's start, which is scope: the sessions last active at or after it, as ListSessions' filter.active_after
3302
+ * keeps them. At most 35 days before the server's clock, else INVALID_ARGUMENT; a window that starts in the future
3303
+ * has no sessions.
3304
+ */
3305
+ activeAfter:
3306
+ | Date
3307
+ | undefined;
3308
+ /**
3309
+ * The prior window's start: prior_totals covers the sessions last active at or after it and before active_after.
3310
+ * Before active_after and at most 35 days before it, else INVALID_ARGUMENT.
3311
+ */
3312
+ priorActiveAfter: Date | undefined;
3313
+ }
3314
+
3315
+ export interface GetSessionPeriodTotalsResponse {
3316
+ status:
3317
+ | ResponseStatus
3318
+ | undefined;
3319
+ /** The sessions last active at or after active_after. */
3320
+ totals:
3321
+ | SessionPeriodTotals
3322
+ | undefined;
3323
+ /** The sessions last active at or after prior_active_after and before active_after. */
3324
+ priorTotals:
3325
+ | SessionPeriodTotals
3326
+ | undefined;
3327
+ /**
3328
+ * The window's sessions per actor, one row per actor with a session, ordered by source_system, user_id, then
3329
+ * api_key_id.
3330
+ */
3331
+ actors: SessionActorUsage[];
3332
+ /** The window's sessions per work type key of their latest label, as GetSessionAnalysisOverview counts them. */
3333
+ workTypeCounts: SessionWorkTypeCount[];
3334
+ /**
3335
+ * The window's sessions per work size key of their latest label, ordered by key, whatever their work type. A
3336
+ * session with no label, or whose label names no work size (""), is in no row.
3337
+ */
3338
+ workSizeCounts: SessionWorkSizeCount[];
3339
+ }
3340
+
3341
+ /**
3342
+ * SessionPeriodTotals sums whole-session figures over a window's sessions, one per (source_system, session_id) as
3343
+ * ListSessions lists them. input_tokens is cache-inclusive. A source that reports no usage has zero tokens here
3344
+ * (unknown, not none), as for SessionTotalsBucket.
3345
+ */
3346
+ export interface SessionPeriodTotals {
3347
+ /** For totals, ListSessions' pagination.total_count for the same active_after. */
3348
+ sessions: number;
3349
+ /** The sessions with at least one commit. */
3350
+ sessionsWithCommits: number;
3351
+ commits: number;
3352
+ gitPushes: number;
3353
+ pullRequestsCreated: number;
3354
+ /**
3355
+ * AISessionSummary.pull_requests_merged summed over the sessions: a pull request counts once in every session that
3356
+ * links to it, so this is not a count of distinct pull requests.
3357
+ */
3358
+ pullRequestsMerged: number;
3359
+ inputTokens: number;
3360
+ outputTokens: number;
3361
+ /** input_tokens + output_tokens of the sessions that have tokens and no provider cost. */
3362
+ unpricedTokens: number;
3363
+ }
3364
+
3365
+ /**
3366
+ * SessionActorUsage is one actor's sessions in the window, with their whole-session usage. The actor is the session's
3367
+ * user id, else its api key id, on its source system, as SessionFilter.principals matches it: api_key_id is set only
3368
+ * when user_id is empty, and both are empty for a session that carries neither. input_tokens is cache-inclusive.
3369
+ */
3370
+ export interface SessionActorUsage {
3371
+ sourceSystem: string;
3372
+ userId: string;
3373
+ apiKeyId: string;
3374
+ inputTokens: number;
3375
+ outputTokens: number;
3376
+ /** AITokenUsage.provider_cost_usd, summed. */
3377
+ providerCostUsd: number;
3378
+ /** AIFacilityCostBreakdown.subscription_facility_usd, summed: a facility lens, never reconciled billing. */
3379
+ subscriptionFacilityUsd: number;
3380
+ }
3381
+
3382
+ /** SessionWorkSizeCount is how many sessions carry one work size (AISessionSummary.work_size) as their latest label. */
3383
+ export interface SessionWorkSizeCount {
3384
+ workSize: string;
3385
+ sessions: number;
3386
+ }
3387
+
3285
3388
  export interface GetSessionAnalysisRequest {
3286
3389
  organizationId: string;
3287
3390
  projectId: string;
@@ -24262,7 +24365,14 @@ export const SessionAnalysisOverviewFilter: MessageFns<SessionAnalysisOverviewFi
24262
24365
  };
24263
24366
 
24264
24367
  function createBaseGetSessionAnalysisOverviewResponse(): GetSessionAnalysisOverviewResponse {
24265
- return { status: undefined, sessions: 0, workTypeCounts: [], scoredSessions: [], scoredSessionCount: 0 };
24368
+ return {
24369
+ status: undefined,
24370
+ sessions: 0,
24371
+ workTypeCounts: [],
24372
+ scoredSessions: [],
24373
+ scoredSessionCount: 0,
24374
+ sessionScoreCounts: [],
24375
+ };
24266
24376
  }
24267
24377
 
24268
24378
  export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOverviewResponse> = {
@@ -24282,6 +24392,9 @@ export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOv
24282
24392
  if (message.scoredSessionCount !== 0) {
24283
24393
  writer.uint32(40).uint64(message.scoredSessionCount);
24284
24394
  }
24395
+ for (const v of message.sessionScoreCounts) {
24396
+ SessionScoreCount.encode(v!, writer.uint32(50).fork()).join();
24397
+ }
24285
24398
  return writer;
24286
24399
  },
24287
24400
 
@@ -24338,6 +24451,14 @@ export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOv
24338
24451
  message.scoredSessionCount = longToNumber(reader.uint64());
24339
24452
  continue;
24340
24453
  }
24454
+ case 6: {
24455
+ if (tag !== 50) {
24456
+ break;
24457
+ }
24458
+
24459
+ message.sessionScoreCounts.push(SessionScoreCount.decode(reader, reader.uint32()));
24460
+ continue;
24461
+ }
24341
24462
  }
24342
24463
  if ((tag & 7) === 4 || tag === 0) {
24343
24464
  break;
@@ -24369,6 +24490,11 @@ export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOv
24369
24490
  : isSet(object.scored_session_count)
24370
24491
  ? globalThis.Number(object.scored_session_count)
24371
24492
  : 0,
24493
+ sessionScoreCounts: globalThis.Array.isArray(object?.sessionScoreCounts)
24494
+ ? object.sessionScoreCounts.map((e: any) => SessionScoreCount.fromJSON(e))
24495
+ : globalThis.Array.isArray(object?.session_score_counts)
24496
+ ? object.session_score_counts.map((e: any) => SessionScoreCount.fromJSON(e))
24497
+ : [],
24372
24498
  };
24373
24499
  },
24374
24500
 
@@ -24389,6 +24515,9 @@ export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOv
24389
24515
  if (message.scoredSessionCount !== 0) {
24390
24516
  obj.scoredSessionCount = Math.round(message.scoredSessionCount);
24391
24517
  }
24518
+ if (message.sessionScoreCounts?.length) {
24519
+ obj.sessionScoreCounts = message.sessionScoreCounts.map((e) => SessionScoreCount.toJSON(e));
24520
+ }
24392
24521
  return obj;
24393
24522
  },
24394
24523
 
@@ -24408,6 +24537,92 @@ export const GetSessionAnalysisOverviewResponse: MessageFns<GetSessionAnalysisOv
24408
24537
  message.workTypeCounts = object.workTypeCounts?.map((e) => SessionWorkTypeCount.fromPartial(e)) || [];
24409
24538
  message.scoredSessions = object.scoredSessions?.map((e) => ScoredSession.fromPartial(e)) || [];
24410
24539
  message.scoredSessionCount = object.scoredSessionCount ?? 0;
24540
+ message.sessionScoreCounts = object.sessionScoreCounts?.map((e) => SessionScoreCount.fromPartial(e)) || [];
24541
+ return message;
24542
+ },
24543
+ };
24544
+
24545
+ function createBaseSessionScoreCount(): SessionScoreCount {
24546
+ return { score: 0, sessions: 0 };
24547
+ }
24548
+
24549
+ export const SessionScoreCount: MessageFns<SessionScoreCount> = {
24550
+ encode(message: SessionScoreCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
24551
+ if (message.score !== 0) {
24552
+ writer.uint32(8).int32(message.score);
24553
+ }
24554
+ if (message.sessions !== 0) {
24555
+ writer.uint32(16).uint64(message.sessions);
24556
+ }
24557
+ return writer;
24558
+ },
24559
+
24560
+ decode(input: BinaryReader | Uint8Array, length?: number): SessionScoreCount {
24561
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24562
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
24563
+ if (previousRecursionDepth >= 100) {
24564
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
24565
+ }
24566
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
24567
+ try {
24568
+ const end = length === undefined ? reader.len : reader.pos + length;
24569
+ const message = createBaseSessionScoreCount();
24570
+ while (reader.pos < end) {
24571
+ const tag = reader.uint32();
24572
+ switch (tag >>> 3) {
24573
+ case 1: {
24574
+ if (tag !== 8) {
24575
+ break;
24576
+ }
24577
+
24578
+ message.score = reader.int32();
24579
+ continue;
24580
+ }
24581
+ case 2: {
24582
+ if (tag !== 16) {
24583
+ break;
24584
+ }
24585
+
24586
+ message.sessions = longToNumber(reader.uint64());
24587
+ continue;
24588
+ }
24589
+ }
24590
+ if ((tag & 7) === 4 || tag === 0) {
24591
+ break;
24592
+ }
24593
+ reader.skip(tag & 7);
24594
+ }
24595
+ return message;
24596
+ } finally {
24597
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
24598
+ }
24599
+ },
24600
+
24601
+ fromJSON(object: any): SessionScoreCount {
24602
+ return {
24603
+ score: isSet(object.score) ? globalThis.Number(object.score) : 0,
24604
+ sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
24605
+ };
24606
+ },
24607
+
24608
+ toJSON(message: SessionScoreCount): unknown {
24609
+ const obj: any = {};
24610
+ if (message.score !== 0) {
24611
+ obj.score = Math.round(message.score);
24612
+ }
24613
+ if (message.sessions !== 0) {
24614
+ obj.sessions = Math.round(message.sessions);
24615
+ }
24616
+ return obj;
24617
+ },
24618
+
24619
+ create<I extends Exact<DeepPartial<SessionScoreCount>, I>>(base?: I): SessionScoreCount {
24620
+ return SessionScoreCount.fromPartial(base ?? ({} as any));
24621
+ },
24622
+ fromPartial<I extends Exact<DeepPartial<SessionScoreCount>, I>>(object: I): SessionScoreCount {
24623
+ const message = createBaseSessionScoreCount();
24624
+ message.score = object.score ?? 0;
24625
+ message.sessions = object.sessions ?? 0;
24411
24626
  return message;
24412
24627
  },
24413
24628
  };
@@ -24714,6 +24929,844 @@ export const ScoredSession: MessageFns<ScoredSession> = {
24714
24929
  },
24715
24930
  };
24716
24931
 
24932
+ function createBaseGetSessionPeriodTotalsRequest(): GetSessionPeriodTotalsRequest {
24933
+ return { organizationId: "", projectId: "", activeAfter: undefined, priorActiveAfter: undefined };
24934
+ }
24935
+
24936
+ export const GetSessionPeriodTotalsRequest: MessageFns<GetSessionPeriodTotalsRequest> = {
24937
+ encode(message: GetSessionPeriodTotalsRequest, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
24938
+ if (message.organizationId !== "") {
24939
+ writer.uint32(10).string(message.organizationId);
24940
+ }
24941
+ if (message.projectId !== "") {
24942
+ writer.uint32(18).string(message.projectId);
24943
+ }
24944
+ if (message.activeAfter !== undefined) {
24945
+ Timestamp.encode(toTimestamp(message.activeAfter), writer.uint32(26).fork()).join();
24946
+ }
24947
+ if (message.priorActiveAfter !== undefined) {
24948
+ Timestamp.encode(toTimestamp(message.priorActiveAfter), writer.uint32(34).fork()).join();
24949
+ }
24950
+ return writer;
24951
+ },
24952
+
24953
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionPeriodTotalsRequest {
24954
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
24955
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
24956
+ if (previousRecursionDepth >= 100) {
24957
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
24958
+ }
24959
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
24960
+ try {
24961
+ const end = length === undefined ? reader.len : reader.pos + length;
24962
+ const message = createBaseGetSessionPeriodTotalsRequest();
24963
+ while (reader.pos < end) {
24964
+ const tag = reader.uint32();
24965
+ switch (tag >>> 3) {
24966
+ case 1: {
24967
+ if (tag !== 10) {
24968
+ break;
24969
+ }
24970
+
24971
+ message.organizationId = reader.string();
24972
+ continue;
24973
+ }
24974
+ case 2: {
24975
+ if (tag !== 18) {
24976
+ break;
24977
+ }
24978
+
24979
+ message.projectId = reader.string();
24980
+ continue;
24981
+ }
24982
+ case 3: {
24983
+ if (tag !== 26) {
24984
+ break;
24985
+ }
24986
+
24987
+ message.activeAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
24988
+ continue;
24989
+ }
24990
+ case 4: {
24991
+ if (tag !== 34) {
24992
+ break;
24993
+ }
24994
+
24995
+ message.priorActiveAfter = fromTimestamp(Timestamp.decode(reader, reader.uint32()));
24996
+ continue;
24997
+ }
24998
+ }
24999
+ if ((tag & 7) === 4 || tag === 0) {
25000
+ break;
25001
+ }
25002
+ reader.skip(tag & 7);
25003
+ }
25004
+ return message;
25005
+ } finally {
25006
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
25007
+ }
25008
+ },
25009
+
25010
+ fromJSON(object: any): GetSessionPeriodTotalsRequest {
25011
+ return {
25012
+ organizationId: isSet(object.organizationId)
25013
+ ? globalThis.String(object.organizationId)
25014
+ : isSet(object.organization_id)
25015
+ ? globalThis.String(object.organization_id)
25016
+ : "",
25017
+ projectId: isSet(object.projectId)
25018
+ ? globalThis.String(object.projectId)
25019
+ : isSet(object.project_id)
25020
+ ? globalThis.String(object.project_id)
25021
+ : "",
25022
+ activeAfter: isSet(object.activeAfter)
25023
+ ? fromJsonTimestamp(object.activeAfter)
25024
+ : isSet(object.active_after)
25025
+ ? fromJsonTimestamp(object.active_after)
25026
+ : undefined,
25027
+ priorActiveAfter: isSet(object.priorActiveAfter)
25028
+ ? fromJsonTimestamp(object.priorActiveAfter)
25029
+ : isSet(object.prior_active_after)
25030
+ ? fromJsonTimestamp(object.prior_active_after)
25031
+ : undefined,
25032
+ };
25033
+ },
25034
+
25035
+ toJSON(message: GetSessionPeriodTotalsRequest): unknown {
25036
+ const obj: any = {};
25037
+ if (message.organizationId !== "") {
25038
+ obj.organizationId = message.organizationId;
25039
+ }
25040
+ if (message.projectId !== "") {
25041
+ obj.projectId = message.projectId;
25042
+ }
25043
+ if (message.activeAfter !== undefined) {
25044
+ obj.activeAfter = message.activeAfter.toISOString();
25045
+ }
25046
+ if (message.priorActiveAfter !== undefined) {
25047
+ obj.priorActiveAfter = message.priorActiveAfter.toISOString();
25048
+ }
25049
+ return obj;
25050
+ },
25051
+
25052
+ create<I extends Exact<DeepPartial<GetSessionPeriodTotalsRequest>, I>>(base?: I): GetSessionPeriodTotalsRequest {
25053
+ return GetSessionPeriodTotalsRequest.fromPartial(base ?? ({} as any));
25054
+ },
25055
+ fromPartial<I extends Exact<DeepPartial<GetSessionPeriodTotalsRequest>, I>>(
25056
+ object: I,
25057
+ ): GetSessionPeriodTotalsRequest {
25058
+ const message = createBaseGetSessionPeriodTotalsRequest();
25059
+ message.organizationId = object.organizationId ?? "";
25060
+ message.projectId = object.projectId ?? "";
25061
+ message.activeAfter = object.activeAfter ?? undefined;
25062
+ message.priorActiveAfter = object.priorActiveAfter ?? undefined;
25063
+ return message;
25064
+ },
25065
+ };
25066
+
25067
+ function createBaseGetSessionPeriodTotalsResponse(): GetSessionPeriodTotalsResponse {
25068
+ return {
25069
+ status: undefined,
25070
+ totals: undefined,
25071
+ priorTotals: undefined,
25072
+ actors: [],
25073
+ workTypeCounts: [],
25074
+ workSizeCounts: [],
25075
+ };
25076
+ }
25077
+
25078
+ export const GetSessionPeriodTotalsResponse: MessageFns<GetSessionPeriodTotalsResponse> = {
25079
+ encode(message: GetSessionPeriodTotalsResponse, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25080
+ if (message.status !== undefined) {
25081
+ ResponseStatus.encode(message.status, writer.uint32(10).fork()).join();
25082
+ }
25083
+ if (message.totals !== undefined) {
25084
+ SessionPeriodTotals.encode(message.totals, writer.uint32(18).fork()).join();
25085
+ }
25086
+ if (message.priorTotals !== undefined) {
25087
+ SessionPeriodTotals.encode(message.priorTotals, writer.uint32(26).fork()).join();
25088
+ }
25089
+ for (const v of message.actors) {
25090
+ SessionActorUsage.encode(v!, writer.uint32(34).fork()).join();
25091
+ }
25092
+ for (const v of message.workTypeCounts) {
25093
+ SessionWorkTypeCount.encode(v!, writer.uint32(42).fork()).join();
25094
+ }
25095
+ for (const v of message.workSizeCounts) {
25096
+ SessionWorkSizeCount.encode(v!, writer.uint32(50).fork()).join();
25097
+ }
25098
+ return writer;
25099
+ },
25100
+
25101
+ decode(input: BinaryReader | Uint8Array, length?: number): GetSessionPeriodTotalsResponse {
25102
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25103
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
25104
+ if (previousRecursionDepth >= 100) {
25105
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
25106
+ }
25107
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
25108
+ try {
25109
+ const end = length === undefined ? reader.len : reader.pos + length;
25110
+ const message = createBaseGetSessionPeriodTotalsResponse();
25111
+ while (reader.pos < end) {
25112
+ const tag = reader.uint32();
25113
+ switch (tag >>> 3) {
25114
+ case 1: {
25115
+ if (tag !== 10) {
25116
+ break;
25117
+ }
25118
+
25119
+ message.status = ResponseStatus.decode(reader, reader.uint32());
25120
+ continue;
25121
+ }
25122
+ case 2: {
25123
+ if (tag !== 18) {
25124
+ break;
25125
+ }
25126
+
25127
+ message.totals = SessionPeriodTotals.decode(reader, reader.uint32());
25128
+ continue;
25129
+ }
25130
+ case 3: {
25131
+ if (tag !== 26) {
25132
+ break;
25133
+ }
25134
+
25135
+ message.priorTotals = SessionPeriodTotals.decode(reader, reader.uint32());
25136
+ continue;
25137
+ }
25138
+ case 4: {
25139
+ if (tag !== 34) {
25140
+ break;
25141
+ }
25142
+
25143
+ message.actors.push(SessionActorUsage.decode(reader, reader.uint32()));
25144
+ continue;
25145
+ }
25146
+ case 5: {
25147
+ if (tag !== 42) {
25148
+ break;
25149
+ }
25150
+
25151
+ message.workTypeCounts.push(SessionWorkTypeCount.decode(reader, reader.uint32()));
25152
+ continue;
25153
+ }
25154
+ case 6: {
25155
+ if (tag !== 50) {
25156
+ break;
25157
+ }
25158
+
25159
+ message.workSizeCounts.push(SessionWorkSizeCount.decode(reader, reader.uint32()));
25160
+ continue;
25161
+ }
25162
+ }
25163
+ if ((tag & 7) === 4 || tag === 0) {
25164
+ break;
25165
+ }
25166
+ reader.skip(tag & 7);
25167
+ }
25168
+ return message;
25169
+ } finally {
25170
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
25171
+ }
25172
+ },
25173
+
25174
+ fromJSON(object: any): GetSessionPeriodTotalsResponse {
25175
+ return {
25176
+ status: isSet(object.status) ? ResponseStatus.fromJSON(object.status) : undefined,
25177
+ totals: isSet(object.totals) ? SessionPeriodTotals.fromJSON(object.totals) : undefined,
25178
+ priorTotals: isSet(object.priorTotals)
25179
+ ? SessionPeriodTotals.fromJSON(object.priorTotals)
25180
+ : isSet(object.prior_totals)
25181
+ ? SessionPeriodTotals.fromJSON(object.prior_totals)
25182
+ : undefined,
25183
+ actors: globalThis.Array.isArray(object?.actors)
25184
+ ? object.actors.map((e: any) => SessionActorUsage.fromJSON(e))
25185
+ : [],
25186
+ workTypeCounts: globalThis.Array.isArray(object?.workTypeCounts)
25187
+ ? object.workTypeCounts.map((e: any) => SessionWorkTypeCount.fromJSON(e))
25188
+ : globalThis.Array.isArray(object?.work_type_counts)
25189
+ ? object.work_type_counts.map((e: any) => SessionWorkTypeCount.fromJSON(e))
25190
+ : [],
25191
+ workSizeCounts: globalThis.Array.isArray(object?.workSizeCounts)
25192
+ ? object.workSizeCounts.map((e: any) => SessionWorkSizeCount.fromJSON(e))
25193
+ : globalThis.Array.isArray(object?.work_size_counts)
25194
+ ? object.work_size_counts.map((e: any) => SessionWorkSizeCount.fromJSON(e))
25195
+ : [],
25196
+ };
25197
+ },
25198
+
25199
+ toJSON(message: GetSessionPeriodTotalsResponse): unknown {
25200
+ const obj: any = {};
25201
+ if (message.status !== undefined) {
25202
+ obj.status = ResponseStatus.toJSON(message.status);
25203
+ }
25204
+ if (message.totals !== undefined) {
25205
+ obj.totals = SessionPeriodTotals.toJSON(message.totals);
25206
+ }
25207
+ if (message.priorTotals !== undefined) {
25208
+ obj.priorTotals = SessionPeriodTotals.toJSON(message.priorTotals);
25209
+ }
25210
+ if (message.actors?.length) {
25211
+ obj.actors = message.actors.map((e) => SessionActorUsage.toJSON(e));
25212
+ }
25213
+ if (message.workTypeCounts?.length) {
25214
+ obj.workTypeCounts = message.workTypeCounts.map((e) => SessionWorkTypeCount.toJSON(e));
25215
+ }
25216
+ if (message.workSizeCounts?.length) {
25217
+ obj.workSizeCounts = message.workSizeCounts.map((e) => SessionWorkSizeCount.toJSON(e));
25218
+ }
25219
+ return obj;
25220
+ },
25221
+
25222
+ create<I extends Exact<DeepPartial<GetSessionPeriodTotalsResponse>, I>>(base?: I): GetSessionPeriodTotalsResponse {
25223
+ return GetSessionPeriodTotalsResponse.fromPartial(base ?? ({} as any));
25224
+ },
25225
+ fromPartial<I extends Exact<DeepPartial<GetSessionPeriodTotalsResponse>, I>>(
25226
+ object: I,
25227
+ ): GetSessionPeriodTotalsResponse {
25228
+ const message = createBaseGetSessionPeriodTotalsResponse();
25229
+ message.status = (object.status !== undefined && object.status !== null)
25230
+ ? ResponseStatus.fromPartial(object.status)
25231
+ : undefined;
25232
+ message.totals = (object.totals !== undefined && object.totals !== null)
25233
+ ? SessionPeriodTotals.fromPartial(object.totals)
25234
+ : undefined;
25235
+ message.priorTotals = (object.priorTotals !== undefined && object.priorTotals !== null)
25236
+ ? SessionPeriodTotals.fromPartial(object.priorTotals)
25237
+ : undefined;
25238
+ message.actors = object.actors?.map((e) => SessionActorUsage.fromPartial(e)) || [];
25239
+ message.workTypeCounts = object.workTypeCounts?.map((e) => SessionWorkTypeCount.fromPartial(e)) || [];
25240
+ message.workSizeCounts = object.workSizeCounts?.map((e) => SessionWorkSizeCount.fromPartial(e)) || [];
25241
+ return message;
25242
+ },
25243
+ };
25244
+
25245
+ function createBaseSessionPeriodTotals(): SessionPeriodTotals {
25246
+ return {
25247
+ sessions: 0,
25248
+ sessionsWithCommits: 0,
25249
+ commits: 0,
25250
+ gitPushes: 0,
25251
+ pullRequestsCreated: 0,
25252
+ pullRequestsMerged: 0,
25253
+ inputTokens: 0,
25254
+ outputTokens: 0,
25255
+ unpricedTokens: 0,
25256
+ };
25257
+ }
25258
+
25259
+ export const SessionPeriodTotals: MessageFns<SessionPeriodTotals> = {
25260
+ encode(message: SessionPeriodTotals, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25261
+ if (message.sessions !== 0) {
25262
+ writer.uint32(8).uint64(message.sessions);
25263
+ }
25264
+ if (message.sessionsWithCommits !== 0) {
25265
+ writer.uint32(16).uint64(message.sessionsWithCommits);
25266
+ }
25267
+ if (message.commits !== 0) {
25268
+ writer.uint32(24).uint64(message.commits);
25269
+ }
25270
+ if (message.gitPushes !== 0) {
25271
+ writer.uint32(32).uint64(message.gitPushes);
25272
+ }
25273
+ if (message.pullRequestsCreated !== 0) {
25274
+ writer.uint32(40).uint64(message.pullRequestsCreated);
25275
+ }
25276
+ if (message.pullRequestsMerged !== 0) {
25277
+ writer.uint32(48).uint64(message.pullRequestsMerged);
25278
+ }
25279
+ if (message.inputTokens !== 0) {
25280
+ writer.uint32(56).uint64(message.inputTokens);
25281
+ }
25282
+ if (message.outputTokens !== 0) {
25283
+ writer.uint32(64).uint64(message.outputTokens);
25284
+ }
25285
+ if (message.unpricedTokens !== 0) {
25286
+ writer.uint32(72).uint64(message.unpricedTokens);
25287
+ }
25288
+ return writer;
25289
+ },
25290
+
25291
+ decode(input: BinaryReader | Uint8Array, length?: number): SessionPeriodTotals {
25292
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25293
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
25294
+ if (previousRecursionDepth >= 100) {
25295
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
25296
+ }
25297
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
25298
+ try {
25299
+ const end = length === undefined ? reader.len : reader.pos + length;
25300
+ const message = createBaseSessionPeriodTotals();
25301
+ while (reader.pos < end) {
25302
+ const tag = reader.uint32();
25303
+ switch (tag >>> 3) {
25304
+ case 1: {
25305
+ if (tag !== 8) {
25306
+ break;
25307
+ }
25308
+
25309
+ message.sessions = longToNumber(reader.uint64());
25310
+ continue;
25311
+ }
25312
+ case 2: {
25313
+ if (tag !== 16) {
25314
+ break;
25315
+ }
25316
+
25317
+ message.sessionsWithCommits = longToNumber(reader.uint64());
25318
+ continue;
25319
+ }
25320
+ case 3: {
25321
+ if (tag !== 24) {
25322
+ break;
25323
+ }
25324
+
25325
+ message.commits = longToNumber(reader.uint64());
25326
+ continue;
25327
+ }
25328
+ case 4: {
25329
+ if (tag !== 32) {
25330
+ break;
25331
+ }
25332
+
25333
+ message.gitPushes = longToNumber(reader.uint64());
25334
+ continue;
25335
+ }
25336
+ case 5: {
25337
+ if (tag !== 40) {
25338
+ break;
25339
+ }
25340
+
25341
+ message.pullRequestsCreated = longToNumber(reader.uint64());
25342
+ continue;
25343
+ }
25344
+ case 6: {
25345
+ if (tag !== 48) {
25346
+ break;
25347
+ }
25348
+
25349
+ message.pullRequestsMerged = longToNumber(reader.uint64());
25350
+ continue;
25351
+ }
25352
+ case 7: {
25353
+ if (tag !== 56) {
25354
+ break;
25355
+ }
25356
+
25357
+ message.inputTokens = longToNumber(reader.uint64());
25358
+ continue;
25359
+ }
25360
+ case 8: {
25361
+ if (tag !== 64) {
25362
+ break;
25363
+ }
25364
+
25365
+ message.outputTokens = longToNumber(reader.uint64());
25366
+ continue;
25367
+ }
25368
+ case 9: {
25369
+ if (tag !== 72) {
25370
+ break;
25371
+ }
25372
+
25373
+ message.unpricedTokens = longToNumber(reader.uint64());
25374
+ continue;
25375
+ }
25376
+ }
25377
+ if ((tag & 7) === 4 || tag === 0) {
25378
+ break;
25379
+ }
25380
+ reader.skip(tag & 7);
25381
+ }
25382
+ return message;
25383
+ } finally {
25384
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
25385
+ }
25386
+ },
25387
+
25388
+ fromJSON(object: any): SessionPeriodTotals {
25389
+ return {
25390
+ sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
25391
+ sessionsWithCommits: isSet(object.sessionsWithCommits)
25392
+ ? globalThis.Number(object.sessionsWithCommits)
25393
+ : isSet(object.sessions_with_commits)
25394
+ ? globalThis.Number(object.sessions_with_commits)
25395
+ : 0,
25396
+ commits: isSet(object.commits) ? globalThis.Number(object.commits) : 0,
25397
+ gitPushes: isSet(object.gitPushes)
25398
+ ? globalThis.Number(object.gitPushes)
25399
+ : isSet(object.git_pushes)
25400
+ ? globalThis.Number(object.git_pushes)
25401
+ : 0,
25402
+ pullRequestsCreated: isSet(object.pullRequestsCreated)
25403
+ ? globalThis.Number(object.pullRequestsCreated)
25404
+ : isSet(object.pull_requests_created)
25405
+ ? globalThis.Number(object.pull_requests_created)
25406
+ : 0,
25407
+ pullRequestsMerged: isSet(object.pullRequestsMerged)
25408
+ ? globalThis.Number(object.pullRequestsMerged)
25409
+ : isSet(object.pull_requests_merged)
25410
+ ? globalThis.Number(object.pull_requests_merged)
25411
+ : 0,
25412
+ inputTokens: isSet(object.inputTokens)
25413
+ ? globalThis.Number(object.inputTokens)
25414
+ : isSet(object.input_tokens)
25415
+ ? globalThis.Number(object.input_tokens)
25416
+ : 0,
25417
+ outputTokens: isSet(object.outputTokens)
25418
+ ? globalThis.Number(object.outputTokens)
25419
+ : isSet(object.output_tokens)
25420
+ ? globalThis.Number(object.output_tokens)
25421
+ : 0,
25422
+ unpricedTokens: isSet(object.unpricedTokens)
25423
+ ? globalThis.Number(object.unpricedTokens)
25424
+ : isSet(object.unpriced_tokens)
25425
+ ? globalThis.Number(object.unpriced_tokens)
25426
+ : 0,
25427
+ };
25428
+ },
25429
+
25430
+ toJSON(message: SessionPeriodTotals): unknown {
25431
+ const obj: any = {};
25432
+ if (message.sessions !== 0) {
25433
+ obj.sessions = Math.round(message.sessions);
25434
+ }
25435
+ if (message.sessionsWithCommits !== 0) {
25436
+ obj.sessionsWithCommits = Math.round(message.sessionsWithCommits);
25437
+ }
25438
+ if (message.commits !== 0) {
25439
+ obj.commits = Math.round(message.commits);
25440
+ }
25441
+ if (message.gitPushes !== 0) {
25442
+ obj.gitPushes = Math.round(message.gitPushes);
25443
+ }
25444
+ if (message.pullRequestsCreated !== 0) {
25445
+ obj.pullRequestsCreated = Math.round(message.pullRequestsCreated);
25446
+ }
25447
+ if (message.pullRequestsMerged !== 0) {
25448
+ obj.pullRequestsMerged = Math.round(message.pullRequestsMerged);
25449
+ }
25450
+ if (message.inputTokens !== 0) {
25451
+ obj.inputTokens = Math.round(message.inputTokens);
25452
+ }
25453
+ if (message.outputTokens !== 0) {
25454
+ obj.outputTokens = Math.round(message.outputTokens);
25455
+ }
25456
+ if (message.unpricedTokens !== 0) {
25457
+ obj.unpricedTokens = Math.round(message.unpricedTokens);
25458
+ }
25459
+ return obj;
25460
+ },
25461
+
25462
+ create<I extends Exact<DeepPartial<SessionPeriodTotals>, I>>(base?: I): SessionPeriodTotals {
25463
+ return SessionPeriodTotals.fromPartial(base ?? ({} as any));
25464
+ },
25465
+ fromPartial<I extends Exact<DeepPartial<SessionPeriodTotals>, I>>(object: I): SessionPeriodTotals {
25466
+ const message = createBaseSessionPeriodTotals();
25467
+ message.sessions = object.sessions ?? 0;
25468
+ message.sessionsWithCommits = object.sessionsWithCommits ?? 0;
25469
+ message.commits = object.commits ?? 0;
25470
+ message.gitPushes = object.gitPushes ?? 0;
25471
+ message.pullRequestsCreated = object.pullRequestsCreated ?? 0;
25472
+ message.pullRequestsMerged = object.pullRequestsMerged ?? 0;
25473
+ message.inputTokens = object.inputTokens ?? 0;
25474
+ message.outputTokens = object.outputTokens ?? 0;
25475
+ message.unpricedTokens = object.unpricedTokens ?? 0;
25476
+ return message;
25477
+ },
25478
+ };
25479
+
25480
+ function createBaseSessionActorUsage(): SessionActorUsage {
25481
+ return {
25482
+ sourceSystem: "",
25483
+ userId: "",
25484
+ apiKeyId: "",
25485
+ inputTokens: 0,
25486
+ outputTokens: 0,
25487
+ providerCostUsd: 0,
25488
+ subscriptionFacilityUsd: 0,
25489
+ };
25490
+ }
25491
+
25492
+ export const SessionActorUsage: MessageFns<SessionActorUsage> = {
25493
+ encode(message: SessionActorUsage, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25494
+ if (message.sourceSystem !== "") {
25495
+ writer.uint32(10).string(message.sourceSystem);
25496
+ }
25497
+ if (message.userId !== "") {
25498
+ writer.uint32(18).string(message.userId);
25499
+ }
25500
+ if (message.apiKeyId !== "") {
25501
+ writer.uint32(26).string(message.apiKeyId);
25502
+ }
25503
+ if (message.inputTokens !== 0) {
25504
+ writer.uint32(32).uint64(message.inputTokens);
25505
+ }
25506
+ if (message.outputTokens !== 0) {
25507
+ writer.uint32(40).uint64(message.outputTokens);
25508
+ }
25509
+ if (message.providerCostUsd !== 0) {
25510
+ writer.uint32(49).double(message.providerCostUsd);
25511
+ }
25512
+ if (message.subscriptionFacilityUsd !== 0) {
25513
+ writer.uint32(57).double(message.subscriptionFacilityUsd);
25514
+ }
25515
+ return writer;
25516
+ },
25517
+
25518
+ decode(input: BinaryReader | Uint8Array, length?: number): SessionActorUsage {
25519
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25520
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
25521
+ if (previousRecursionDepth >= 100) {
25522
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
25523
+ }
25524
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
25525
+ try {
25526
+ const end = length === undefined ? reader.len : reader.pos + length;
25527
+ const message = createBaseSessionActorUsage();
25528
+ while (reader.pos < end) {
25529
+ const tag = reader.uint32();
25530
+ switch (tag >>> 3) {
25531
+ case 1: {
25532
+ if (tag !== 10) {
25533
+ break;
25534
+ }
25535
+
25536
+ message.sourceSystem = reader.string();
25537
+ continue;
25538
+ }
25539
+ case 2: {
25540
+ if (tag !== 18) {
25541
+ break;
25542
+ }
25543
+
25544
+ message.userId = reader.string();
25545
+ continue;
25546
+ }
25547
+ case 3: {
25548
+ if (tag !== 26) {
25549
+ break;
25550
+ }
25551
+
25552
+ message.apiKeyId = reader.string();
25553
+ continue;
25554
+ }
25555
+ case 4: {
25556
+ if (tag !== 32) {
25557
+ break;
25558
+ }
25559
+
25560
+ message.inputTokens = longToNumber(reader.uint64());
25561
+ continue;
25562
+ }
25563
+ case 5: {
25564
+ if (tag !== 40) {
25565
+ break;
25566
+ }
25567
+
25568
+ message.outputTokens = longToNumber(reader.uint64());
25569
+ continue;
25570
+ }
25571
+ case 6: {
25572
+ if (tag !== 49) {
25573
+ break;
25574
+ }
25575
+
25576
+ message.providerCostUsd = reader.double();
25577
+ continue;
25578
+ }
25579
+ case 7: {
25580
+ if (tag !== 57) {
25581
+ break;
25582
+ }
25583
+
25584
+ message.subscriptionFacilityUsd = reader.double();
25585
+ continue;
25586
+ }
25587
+ }
25588
+ if ((tag & 7) === 4 || tag === 0) {
25589
+ break;
25590
+ }
25591
+ reader.skip(tag & 7);
25592
+ }
25593
+ return message;
25594
+ } finally {
25595
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
25596
+ }
25597
+ },
25598
+
25599
+ fromJSON(object: any): SessionActorUsage {
25600
+ return {
25601
+ sourceSystem: isSet(object.sourceSystem)
25602
+ ? globalThis.String(object.sourceSystem)
25603
+ : isSet(object.source_system)
25604
+ ? globalThis.String(object.source_system)
25605
+ : "",
25606
+ userId: isSet(object.userId)
25607
+ ? globalThis.String(object.userId)
25608
+ : isSet(object.user_id)
25609
+ ? globalThis.String(object.user_id)
25610
+ : "",
25611
+ apiKeyId: isSet(object.apiKeyId)
25612
+ ? globalThis.String(object.apiKeyId)
25613
+ : isSet(object.api_key_id)
25614
+ ? globalThis.String(object.api_key_id)
25615
+ : "",
25616
+ inputTokens: isSet(object.inputTokens)
25617
+ ? globalThis.Number(object.inputTokens)
25618
+ : isSet(object.input_tokens)
25619
+ ? globalThis.Number(object.input_tokens)
25620
+ : 0,
25621
+ outputTokens: isSet(object.outputTokens)
25622
+ ? globalThis.Number(object.outputTokens)
25623
+ : isSet(object.output_tokens)
25624
+ ? globalThis.Number(object.output_tokens)
25625
+ : 0,
25626
+ providerCostUsd: isSet(object.providerCostUsd)
25627
+ ? globalThis.Number(object.providerCostUsd)
25628
+ : isSet(object.provider_cost_usd)
25629
+ ? globalThis.Number(object.provider_cost_usd)
25630
+ : 0,
25631
+ subscriptionFacilityUsd: isSet(object.subscriptionFacilityUsd)
25632
+ ? globalThis.Number(object.subscriptionFacilityUsd)
25633
+ : isSet(object.subscription_facility_usd)
25634
+ ? globalThis.Number(object.subscription_facility_usd)
25635
+ : 0,
25636
+ };
25637
+ },
25638
+
25639
+ toJSON(message: SessionActorUsage): unknown {
25640
+ const obj: any = {};
25641
+ if (message.sourceSystem !== "") {
25642
+ obj.sourceSystem = message.sourceSystem;
25643
+ }
25644
+ if (message.userId !== "") {
25645
+ obj.userId = message.userId;
25646
+ }
25647
+ if (message.apiKeyId !== "") {
25648
+ obj.apiKeyId = message.apiKeyId;
25649
+ }
25650
+ if (message.inputTokens !== 0) {
25651
+ obj.inputTokens = Math.round(message.inputTokens);
25652
+ }
25653
+ if (message.outputTokens !== 0) {
25654
+ obj.outputTokens = Math.round(message.outputTokens);
25655
+ }
25656
+ if (message.providerCostUsd !== 0) {
25657
+ obj.providerCostUsd = floatToJson(message.providerCostUsd);
25658
+ }
25659
+ if (message.subscriptionFacilityUsd !== 0) {
25660
+ obj.subscriptionFacilityUsd = floatToJson(message.subscriptionFacilityUsd);
25661
+ }
25662
+ return obj;
25663
+ },
25664
+
25665
+ create<I extends Exact<DeepPartial<SessionActorUsage>, I>>(base?: I): SessionActorUsage {
25666
+ return SessionActorUsage.fromPartial(base ?? ({} as any));
25667
+ },
25668
+ fromPartial<I extends Exact<DeepPartial<SessionActorUsage>, I>>(object: I): SessionActorUsage {
25669
+ const message = createBaseSessionActorUsage();
25670
+ message.sourceSystem = object.sourceSystem ?? "";
25671
+ message.userId = object.userId ?? "";
25672
+ message.apiKeyId = object.apiKeyId ?? "";
25673
+ message.inputTokens = object.inputTokens ?? 0;
25674
+ message.outputTokens = object.outputTokens ?? 0;
25675
+ message.providerCostUsd = object.providerCostUsd ?? 0;
25676
+ message.subscriptionFacilityUsd = object.subscriptionFacilityUsd ?? 0;
25677
+ return message;
25678
+ },
25679
+ };
25680
+
25681
+ function createBaseSessionWorkSizeCount(): SessionWorkSizeCount {
25682
+ return { workSize: "", sessions: 0 };
25683
+ }
25684
+
25685
+ export const SessionWorkSizeCount: MessageFns<SessionWorkSizeCount> = {
25686
+ encode(message: SessionWorkSizeCount, writer: BinaryWriter = new BinaryWriter()): BinaryWriter {
25687
+ if (message.workSize !== "") {
25688
+ writer.uint32(10).string(message.workSize);
25689
+ }
25690
+ if (message.sessions !== 0) {
25691
+ writer.uint32(16).uint64(message.sessions);
25692
+ }
25693
+ return writer;
25694
+ },
25695
+
25696
+ decode(input: BinaryReader | Uint8Array, length?: number): SessionWorkSizeCount {
25697
+ const reader = input instanceof BinaryReader ? input : new BinaryReader(input);
25698
+ const previousRecursionDepth = (reader as any).__tsProtoDecodeDepth ?? 0;
25699
+ if (previousRecursionDepth >= 100) {
25700
+ throw new globalThis.Error("protobuf decode recursion limit exceeded");
25701
+ }
25702
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth + 1;
25703
+ try {
25704
+ const end = length === undefined ? reader.len : reader.pos + length;
25705
+ const message = createBaseSessionWorkSizeCount();
25706
+ while (reader.pos < end) {
25707
+ const tag = reader.uint32();
25708
+ switch (tag >>> 3) {
25709
+ case 1: {
25710
+ if (tag !== 10) {
25711
+ break;
25712
+ }
25713
+
25714
+ message.workSize = reader.string();
25715
+ continue;
25716
+ }
25717
+ case 2: {
25718
+ if (tag !== 16) {
25719
+ break;
25720
+ }
25721
+
25722
+ message.sessions = longToNumber(reader.uint64());
25723
+ continue;
25724
+ }
25725
+ }
25726
+ if ((tag & 7) === 4 || tag === 0) {
25727
+ break;
25728
+ }
25729
+ reader.skip(tag & 7);
25730
+ }
25731
+ return message;
25732
+ } finally {
25733
+ (reader as any).__tsProtoDecodeDepth = previousRecursionDepth;
25734
+ }
25735
+ },
25736
+
25737
+ fromJSON(object: any): SessionWorkSizeCount {
25738
+ return {
25739
+ workSize: isSet(object.workSize)
25740
+ ? globalThis.String(object.workSize)
25741
+ : isSet(object.work_size)
25742
+ ? globalThis.String(object.work_size)
25743
+ : "",
25744
+ sessions: isSet(object.sessions) ? globalThis.Number(object.sessions) : 0,
25745
+ };
25746
+ },
25747
+
25748
+ toJSON(message: SessionWorkSizeCount): unknown {
25749
+ const obj: any = {};
25750
+ if (message.workSize !== "") {
25751
+ obj.workSize = message.workSize;
25752
+ }
25753
+ if (message.sessions !== 0) {
25754
+ obj.sessions = Math.round(message.sessions);
25755
+ }
25756
+ return obj;
25757
+ },
25758
+
25759
+ create<I extends Exact<DeepPartial<SessionWorkSizeCount>, I>>(base?: I): SessionWorkSizeCount {
25760
+ return SessionWorkSizeCount.fromPartial(base ?? ({} as any));
25761
+ },
25762
+ fromPartial<I extends Exact<DeepPartial<SessionWorkSizeCount>, I>>(object: I): SessionWorkSizeCount {
25763
+ const message = createBaseSessionWorkSizeCount();
25764
+ message.workSize = object.workSize ?? "";
25765
+ message.sessions = object.sessions ?? 0;
25766
+ return message;
25767
+ },
25768
+ };
25769
+
24717
25770
  function createBaseGetSessionAnalysisRequest(): GetSessionAnalysisRequest {
24718
25771
  return { organizationId: "", projectId: "", sourceSystem: "", sessionId: "" };
24719
25772
  }
@@ -35309,6 +36362,15 @@ export interface AIGatewayService {
35309
36362
  request: GetSessionAnalysisOverviewRequest,
35310
36363
  metadata?: Metadata,
35311
36364
  ): Promise<GetSessionAnalysisOverviewResponse>;
36365
+ /**
36366
+ * The sessions ListSessions lists with filter.active_after, and those of the window before it, rolled up from their
36367
+ * whole-session figures: git and pull request counts and tokens per window, and for the window itself each actor's
36368
+ * usage and the work type and size counts. Mirrors ai.api.v1.
36369
+ */
36370
+ GetSessionPeriodTotals(
36371
+ request: GetSessionPeriodTotalsRequest,
36372
+ metadata?: Metadata,
36373
+ ): Promise<GetSessionPeriodTotalsResponse>;
35312
36374
  /**
35313
36375
  * One session's latest score against the scorer's rubric, with each criterion's assessment and improvement, and
35314
36376
  * its latest insights with their cause and action; each part absent until its job has run. Mirrors ai.api.v1.
@@ -35436,6 +36498,7 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
35436
36498
  this.GetSessionUsageTrend = this.GetSessionUsageTrend.bind(this);
35437
36499
  this.GetSessionTotalsTrend = this.GetSessionTotalsTrend.bind(this);
35438
36500
  this.GetSessionAnalysisOverview = this.GetSessionAnalysisOverview.bind(this);
36501
+ this.GetSessionPeriodTotals = this.GetSessionPeriodTotals.bind(this);
35439
36502
  this.GetSessionAnalysis = this.GetSessionAnalysis.bind(this);
35440
36503
  this.GetSessionScoreTrend = this.GetSessionScoreTrend.bind(this);
35441
36504
  this.GetPromptLabelTrend = this.GetPromptLabelTrend.bind(this);
@@ -35659,6 +36722,15 @@ export class AIGatewayServiceClientImpl implements AIGatewayService {
35659
36722
  return promise.then((data) => GetSessionAnalysisOverviewResponse.decode(new BinaryReader(data)));
35660
36723
  }
35661
36724
 
36725
+ GetSessionPeriodTotals(
36726
+ request: GetSessionPeriodTotalsRequest,
36727
+ metadata?: Metadata,
36728
+ ): Promise<GetSessionPeriodTotalsResponse> {
36729
+ const data = GetSessionPeriodTotalsRequest.encode(request).finish();
36730
+ const promise = this.rpc.request(this.service, "GetSessionPeriodTotals", data, metadata);
36731
+ return promise.then((data) => GetSessionPeriodTotalsResponse.decode(new BinaryReader(data)));
36732
+ }
36733
+
35662
36734
  GetSessionAnalysis(request: GetSessionAnalysisRequest, metadata?: Metadata): Promise<GetSessionAnalysisResponse> {
35663
36735
  const data = GetSessionAnalysisRequest.encode(request).finish();
35664
36736
  const promise = this.rpc.request(this.service, "GetSessionAnalysis", data, metadata);