@thinkai/tai-api-contract 2.92.0 → 2.94.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.
@@ -4178,6 +4178,16 @@ export interface components {
4178
4178
  };
4179
4179
  /** @description Nested metric groups; see TypeScript `DashboardProductivityMetricsDto` in @thinkai/tai-api-contract. */
4180
4180
  DashboardProductivityMetricsDto: {
4181
+ velocity?: {
4182
+ mergedPrCount?: number;
4183
+ shipWeightSum?: number;
4184
+ totalShipWeight?: number;
4185
+ /** @description GitHub merged PR ledger rows in the metrics window still awaiting ship-weight scoring (omit when zero). */
4186
+ shipWeightPendingCount?: number;
4187
+ } & {
4188
+ [key: string]: unknown;
4189
+ };
4190
+ } & {
4181
4191
  [key: string]: unknown;
4182
4192
  };
4183
4193
  DashboardProductivityDto: {
@@ -4230,6 +4240,10 @@ export interface components {
4230
4240
  */
4231
4241
  date: string;
4232
4242
  mergedPrCount: number;
4243
+ /** @description Sum of ship-weight scores for PRs merged on this day. */
4244
+ shipWeightSum?: number;
4245
+ /** @description GitHub merged PRs on this day still awaiting ship-weight scoring. */
4246
+ shipWeightPendingCount?: number;
4233
4247
  /** @description GitHub Actions CI build failures on this day from `ciFailureRuns` ledger when CI ingest is enabled. */
4234
4248
  ciFailuresCount?: number;
4235
4249
  /** @description Mean hours from PR creation to first review for PRs merged on this day. */
@@ -4249,6 +4263,10 @@ export interface components {
4249
4263
  /** @description Short label for the week column (MM/DD), aligned with Measure charts. */
4250
4264
  weekLabel?: string;
4251
4265
  mergedPrCount: number;
4266
+ /** @description Sum of ship-weight scores for PRs merged in this week bucket. */
4267
+ shipWeightSum?: number;
4268
+ /** @description GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
4269
+ shipWeightPendingCount?: number;
4252
4270
  /** @description DORA change failure rate (deployments/incidents), not CI build failures. */
4253
4271
  failRatePercent: number;
4254
4272
  /** @description GitHub Actions / Checks CI build failure rate for the week bucket (failed runs / (failed + passed) * 100). Zero when GitHub Actions CI is disabled. */
@@ -4309,6 +4327,10 @@ export interface components {
4309
4327
  /** @description Short label for the week column (MM/DD), aligned with Measure charts. */
4310
4328
  weekLabel?: string;
4311
4329
  mergedPrCount: number;
4330
+ /** @description Sum of ship-weight scores for PRs merged in this week bucket. */
4331
+ shipWeightSum?: number;
4332
+ /** @description GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
4333
+ shipWeightPendingCount?: number;
4312
4334
  };
4313
4335
  ProductivityInsightsMergedPrContributorRowDto: {
4314
4336
  /** @description Canonical person identifier (matches org chart person_id / employeeId). */
@@ -4358,6 +4380,8 @@ export interface components {
4358
4380
  subtitle?: string;
4359
4381
  /** @description Average weekly merged PR count over the selected range. */
4360
4382
  periodAvgMergedPrs: number;
4383
+ /** @description Average weekly ship-weight sum over the selected range. */
4384
+ periodAvgShipWeight?: number;
4361
4385
  /** @description Average change failure rate over the range when available. */
4362
4386
  avgFailRatePercent?: number;
4363
4387
  /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
@@ -4365,7 +4389,13 @@ export interface components {
4365
4389
  };
4366
4390
  ProductivityInsightsTeamSummaryDto: {
4367
4391
  totalMergedPrs: number;
4392
+ /** @description Sum of ship-weight scores for merged PRs over the selected range. */
4393
+ totalShipWeight?: number;
4394
+ /** @description True when merged GitHub PRs in scope still lack ship-weight scores (ingest backfill in progress). */
4395
+ shipWeightBackfillPending?: boolean;
4368
4396
  avgMergedPrsPerWeek: number;
4397
+ /** @description Mean weekly ship-weight sum over the selected range. */
4398
+ avgShipWeightPerWeek?: number;
4369
4399
  /** @description Average DORA change failure rate over the range when available. */
4370
4400
  avgFailRatePercent: number;
4371
4401
  /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
@@ -4435,6 +4465,10 @@ export interface components {
4435
4465
  date: string;
4436
4466
  dayIndex: number;
4437
4467
  mergedPrCount: number;
4468
+ /** @description Sum of ship-weight scores for PRs merged on this day. */
4469
+ shipWeightSum?: number;
4470
+ /** @description GitHub merged PRs on this day still awaiting ship-weight scoring. */
4471
+ shipWeightPendingCount?: number;
4438
4472
  mergedPrs: string[];
4439
4473
  absent: boolean;
4440
4474
  absenceType?: string;
@@ -4471,14 +4505,24 @@ export interface components {
4471
4505
  };
4472
4506
  ProductivityInsightsContributorActivitySummaryDto: {
4473
4507
  totalMergedPrs: number;
4508
+ /** @description Sum of ship-weight scores for merged PRs over the selected range. */
4509
+ totalShipWeight?: number;
4510
+ /** @description True when merged GitHub PRs in scope still lack ship-weight scores (ingest backfill in progress). */
4511
+ shipWeightBackfillPending?: boolean;
4474
4512
  avgMergedPrsPerWeek: number;
4513
+ /** @description Mean weekly ship-weight sum over the selected range. */
4514
+ avgShipWeightPerWeek?: number;
4475
4515
  totalAbsenceDays: number;
4476
4516
  /** @description CI failure rate (%) over the selected range when GitHub Actions CI ingest is enabled (failures / runs × 100); otherwise average DORA change failure rate when available. */
4477
4517
  avgFailRate: number;
4478
4518
  /** @description Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
4479
4519
  avgCiFailRate?: number;
4480
4520
  mergedPrDelta: number;
4521
+ /** @description Change in total ship-weight sum vs the prior comparison window. */
4522
+ shipWeightDelta?: number;
4481
4523
  avgMergedPrsPerWeekDelta: number;
4524
+ /** @description Change in mean weekly ship-weight sum vs the prior comparison window. */
4525
+ avgShipWeightPerWeekDelta?: number;
4482
4526
  totalAbsenceDaysDelta: number;
4483
4527
  avgFailRateDelta: number;
4484
4528
  /** @description Change in average CI build failure rate vs the prior comparison window. */
@@ -4525,6 +4569,8 @@ export interface components {
4525
4569
  subtitle?: string;
4526
4570
  /** @description Mean weekly merged PR count across the selected range. */
4527
4571
  periodAvgMergedPrs: number;
4572
+ /** @description Mean weekly ship-weight sum across the selected range. */
4573
+ periodAvgShipWeight?: number;
4528
4574
  /** @description Mean weekly change-failure rate when available. */
4529
4575
  avgFailRatePercent?: number;
4530
4576
  /** @description Mean weekly GitHub Actions CI build failure rate when CI ingest is enabled. */
@@ -4884,6 +4930,10 @@ export interface components {
4884
4930
  date: string;
4885
4931
  dayLabel?: string;
4886
4932
  mergedPrCount: number;
4933
+ /** @description Sum of ship-weight scores for PRs merged on this day. */
4934
+ shipWeightSum?: number;
4935
+ /** @description GitHub merged PRs on this day still awaiting ship-weight scoring. */
4936
+ shipWeightPendingCount?: number;
4887
4937
  tokenCount: number;
4888
4938
  };
4889
4939
  AiUsageSpendRoiProductivitySignalWeekDto: {
@@ -4894,6 +4944,10 @@ export interface components {
4894
4944
  weekLabel?: string;
4895
4945
  /** @description Estimated merged PR count in the bucket from dashboard velocity metrics. */
4896
4946
  mergedPrCount: number;
4947
+ /** @description Sum of ship-weight scores for PRs merged in this week bucket. */
4948
+ shipWeightSum?: number;
4949
+ /** @description GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
4950
+ shipWeightPendingCount?: number;
4897
4951
  /** @description Total AI-tool tokens consumed in the bucket. */
4898
4952
  tokenCount: number;
4899
4953
  };
@@ -4916,6 +4970,8 @@ export interface components {
4916
4970
  /** Format: date-time */
4917
4971
  generatedAt: string;
4918
4972
  totalMergedPrs: number;
4973
+ /** @description Sum of ship-weight scores for merged PRs over the selected range. */
4974
+ totalShipWeight?: number;
4919
4975
  totalSpendCents: number;
4920
4976
  activeUsers: number;
4921
4977
  totalEngineers: number;
@@ -6787,6 +6843,10 @@ export interface components {
6787
6843
  bucketEnd: string;
6788
6844
  weekLabel: string;
6789
6845
  mergedPrCount: number;
6846
+ /** @description Sum of ship-weight scores for PRs merged in this week bucket. */
6847
+ shipWeightSum?: number;
6848
+ /** @description GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
6849
+ shipWeightPendingCount?: number;
6790
6850
  tokenCount: number;
6791
6851
  };
6792
6852
  YourAiJourneyAiSpendDto: {
package/src/index.ts CHANGED
@@ -291,6 +291,12 @@ export interface DashboardProductivityMetricsDto {
291
291
  prsPerDeveloperPerWeek?: number;
292
292
  /** Raw merged PR count in the metrics window (all scopes). */
293
293
  mergedPrCount?: number;
294
+ /** Sum of ship-weight scores for PRs merged in the metrics window. */
295
+ shipWeightSum?: number;
296
+ /** Alias of shipWeightSum for single-window productivity cards. */
297
+ totalShipWeight?: number;
298
+ /** GitHub ledger rows in the window still awaiting ship-weight scoring. */
299
+ shipWeightPendingCount?: number;
294
300
  avgPrMergeTimeHours?: number;
295
301
  /** Per-PR summaries for contributor drilldown (stored during productivity ingest). */
296
302
  mergedPullRequests?: {
@@ -486,6 +492,10 @@ export type ProductivityInsightsGranularity = "day" | "week";
486
492
  export interface ProductivityInsightsDailyBucketDto {
487
493
  date: string;
488
494
  mergedPrCount: number;
495
+ /** Sum of ship-weight scores for PRs merged on this day. */
496
+ shipWeightSum?: number;
497
+ /** GitHub merged PRs on this day still awaiting ship-weight scoring. */
498
+ shipWeightPendingCount?: number;
489
499
  ciFailuresCount?: number;
490
500
  /** Mean hours from PR creation to first review for PRs merged on this day. */
491
501
  avgReviewWaitHours?: number;
@@ -506,6 +516,10 @@ export interface ProductivityInsightsAggregatedTeamWeekDto {
506
516
  bucketEnd: string;
507
517
  weekLabel?: string;
508
518
  mergedPrCount: number;
519
+ /** Sum of ship-weight scores for PRs merged in this week bucket. */
520
+ shipWeightSum?: number;
521
+ /** GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
522
+ shipWeightPendingCount?: number;
509
523
  failRatePercent: number;
510
524
  /** GitHub Actions CI build failure rate (failed / (failed + passed) * 100). */
511
525
  ciFailRatePercent?: number;
@@ -551,6 +565,10 @@ export interface ProductivityInsightsMergedPrTrendWeekDto {
551
565
  bucketEnd: string;
552
566
  weekLabel?: string;
553
567
  mergedPrCount: number;
568
+ /** Sum of ship-weight scores for PRs merged in this week bucket. */
569
+ shipWeightSum?: number;
570
+ /** GitHub merged PRs in this week bucket still awaiting ship-weight scoring. */
571
+ shipWeightPendingCount?: number;
554
572
  }
555
573
 
556
574
  /** Per-contributor merged PR weekly series. */
@@ -591,6 +609,8 @@ export interface ProductivityInsightsTeamLeaderItemDto {
591
609
  teamName: string;
592
610
  subtitle?: string;
593
611
  periodAvgMergedPrs: number;
612
+ /** Period average ship-weight sum per week. */
613
+ periodAvgShipWeight?: number;
594
614
  avgFailRatePercent?: number;
595
615
  avgCiFailRatePercent?: number;
596
616
  }
@@ -598,7 +618,11 @@ export interface ProductivityInsightsTeamLeaderItemDto {
598
618
  /** Period summary for a single-team drilldown. */
599
619
  export interface ProductivityInsightsTeamSummaryDto {
600
620
  totalMergedPrs: number;
621
+ totalShipWeight?: number;
622
+ /** True when merged GitHub PRs in scope still lack ship-weight scores. */
623
+ shipWeightBackfillPending?: boolean;
601
624
  avgMergedPrsPerWeek: number;
625
+ avgShipWeightPerWeek?: number;
602
626
  avgFailRatePercent: number;
603
627
  /** Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
604
628
  avgCiFailRatePercent?: number;
@@ -681,6 +705,10 @@ export interface ProductivityInsightsContributorActivityDayDto {
681
705
  date: string;
682
706
  dayIndex: number;
683
707
  mergedPrCount: number;
708
+ /** Sum of ship-weight scores for PRs merged on this day. */
709
+ shipWeightSum?: number;
710
+ /** GitHub merged PRs on this day still awaiting ship-weight scoring. */
711
+ shipWeightPendingCount?: number;
684
712
  mergedPrs: string[];
685
713
  /** Optional PR links when ingest stored URLs. */
686
714
  mergedPrItems?: ProductivityInsightsContributorMergedPrItemDto[];
@@ -703,14 +731,20 @@ export interface ProductivityInsightsContributorActivityWeekDto {
703
731
  /** Summary stats for contributor activity drilldown. */
704
732
  export interface ProductivityInsightsContributorActivitySummaryDto {
705
733
  totalMergedPrs: number;
734
+ totalShipWeight?: number;
735
+ /** True when merged GitHub PRs in scope still lack ship-weight scores. */
736
+ shipWeightBackfillPending?: boolean;
706
737
  avgMergedPrsPerWeek: number;
738
+ avgShipWeightPerWeek?: number;
707
739
  totalAbsenceDays: number;
708
740
  /** CI failure rate (%) over the range when GitHub Actions CI ingest is enabled; otherwise DORA change failure rate when available. */
709
741
  avgFailRate: number;
710
742
  /** Average GitHub Actions CI build failure rate over the range when CI ingest is enabled. */
711
743
  avgCiFailRate?: number;
712
744
  mergedPrDelta: number;
745
+ shipWeightDelta?: number;
713
746
  avgMergedPrsPerWeekDelta: number;
747
+ avgShipWeightPerWeekDelta?: number;
714
748
  totalAbsenceDaysDelta: number;
715
749
  avgFailRateDelta: number;
716
750
  /** Change in average CI build failure rate vs the prior comparison window. */
@@ -746,6 +780,8 @@ export interface ProductivityInsightsNeedsAttentionItemDto {
746
780
  name: string;
747
781
  subtitle?: string;
748
782
  periodAvgMergedPrs: number;
783
+ /** Period average ship-weight sum per week. */
784
+ periodAvgShipWeight?: number;
749
785
  avgFailRatePercent?: number;
750
786
  avgCiFailRatePercent?: number;
751
787
  }