@thinkai/tai-api-contract 2.63.0 → 2.65.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/src/index.ts CHANGED
@@ -1537,6 +1537,169 @@ export interface SdlcDrilldownDto {
1537
1537
  nextCursor?: string;
1538
1538
  }
1539
1539
 
1540
+ /** Shared Insights & Recommendations response meta (`_meta.isMock` is always false in production). */
1541
+ export interface InsightsResponseMeta {
1542
+ syncedAt: string;
1543
+ isMock: false;
1544
+ }
1545
+
1546
+ export type InsightsVerdictStatus = "healthy" | "watch" | "at-risk";
1547
+
1548
+ export interface InsightsRecommendationsVerdictSummary {
1549
+ /** Merged-PR volume ratio vs prior equal-length window. */
1550
+ productivityMultiplier: number;
1551
+ productivityStatus: InsightsVerdictStatus;
1552
+ ciFailRatePct: number;
1553
+ qualityStatus: InsightsVerdictStatus;
1554
+ spendPerMergedPrUsd: number;
1555
+ spendPerMergedPrPrevUsd: number;
1556
+ costStatus: InsightsVerdictStatus;
1557
+ }
1558
+
1559
+ export interface InsightsRoiEngineerPoint {
1560
+ id: string;
1561
+ name: string;
1562
+ team: string;
1563
+ spendUsd: number;
1564
+ mergedPrs: number;
1565
+ }
1566
+
1567
+ export interface InsightsRecommendationsRoiQuadrant {
1568
+ medianSpendUsd: number;
1569
+ medianMergedPrs: number;
1570
+ engineers: InsightsRoiEngineerPoint[];
1571
+ correlationHint: string;
1572
+ }
1573
+
1574
+ export interface InsightsVelocityQualityWeek {
1575
+ weekStartIso: string;
1576
+ mergedPrs: number;
1577
+ ciFailRatePct: number;
1578
+ }
1579
+
1580
+ export interface InsightsRecommendationsVelocityQuality {
1581
+ weeks: InsightsVelocityQualityWeek[];
1582
+ targetFailRatePct: number;
1583
+ volumeGrowthPct: number;
1584
+ }
1585
+
1586
+ export const INSIGHTS_REVIEW_STAGE_IDS = [
1587
+ "open-review",
1588
+ "review-approval",
1589
+ "approval-merge",
1590
+ "merged",
1591
+ ] as const;
1592
+ export type InsightsReviewStageId = (typeof INSIGHTS_REVIEW_STAGE_IDS)[number];
1593
+
1594
+ export interface InsightsReviewStage {
1595
+ id: InsightsReviewStageId;
1596
+ name: string;
1597
+ medianHours: number;
1598
+ trendPct: number;
1599
+ }
1600
+
1601
+ export interface InsightsReviewerLoadItem {
1602
+ id: string;
1603
+ name: string;
1604
+ reviewsCount: number;
1605
+ sharePct: number;
1606
+ }
1607
+
1608
+ export interface InsightsRecommendationsReviewPipeline {
1609
+ stages: InsightsReviewStage[];
1610
+ bottleneckStageId: InsightsReviewStageId;
1611
+ reviewerLoad: InsightsReviewerLoadItem[];
1612
+ }
1613
+
1614
+ export interface InsightsCostPerPrTeam {
1615
+ id: string;
1616
+ name: string;
1617
+ activeAi: number;
1618
+ spendUsd: number;
1619
+ mergedPrs: number;
1620
+ costPerPrUsd: number;
1621
+ changePct: number;
1622
+ }
1623
+
1624
+ export interface InsightsRecommendationsCostPerPr {
1625
+ orgAvgCostUsd: number;
1626
+ orgAvgPrevUsd: number;
1627
+ teams: InsightsCostPerPrTeam[];
1628
+ }
1629
+
1630
+ export interface InsightsAdoptionTeam {
1631
+ id: string;
1632
+ name: string;
1633
+ activeAi: number;
1634
+ totalMembers: number;
1635
+ readinessPct: number;
1636
+ outputPerEngPerWeek: number;
1637
+ }
1638
+
1639
+ export interface InsightsRecommendationsAdoptionGap {
1640
+ totalContributors: number;
1641
+ activeContributors: number;
1642
+ upliftPct: number;
1643
+ teams: InsightsAdoptionTeam[];
1644
+ }
1645
+
1646
+ export const INSIGHTS_RECOMMENDATION_MODULE_IDS = [
1647
+ "mod-spend-vs-output",
1648
+ "mod-velocity-vs-quality",
1649
+ "mod-review-bottleneck",
1650
+ "mod-cost-per-pr",
1651
+ "mod-adoption-gap",
1652
+ ] as const;
1653
+ export type InsightsRecommendationModuleId = (typeof INSIGHTS_RECOMMENDATION_MODULE_IDS)[number];
1654
+
1655
+ export type InsightsRecommendationImpact = "high" | "medium";
1656
+ export type InsightsRecommendationTone = "action" | "no-action";
1657
+ export type InsightsEvidenceLinkKind = "user-spend" | "team" | "contributor" | "repo" | "module";
1658
+
1659
+ export interface InsightsEvidenceChip {
1660
+ label: string;
1661
+ kind: InsightsEvidenceLinkKind;
1662
+ targetId: string;
1663
+ }
1664
+
1665
+ export interface InsightsRecommendationEvidenceGroup {
1666
+ title: string;
1667
+ chips: InsightsEvidenceChip[];
1668
+ }
1669
+
1670
+ export interface InsightsRecommendationDto {
1671
+ moduleId: InsightsRecommendationModuleId;
1672
+ moduleName: string;
1673
+ tone: InsightsRecommendationTone;
1674
+ impact: InsightsRecommendationImpact;
1675
+ headline: string;
1676
+ observed: string;
1677
+ action: string;
1678
+ benefit: string;
1679
+ confidencePct: number;
1680
+ evidence: InsightsRecommendationEvidenceGroup[];
1681
+ }
1682
+
1683
+ export type WithInsightsMeta<T> = T & { _meta: InsightsResponseMeta };
1684
+
1685
+ export type InsightsRecommendationsVerdictSummaryResponse =
1686
+ WithInsightsMeta<InsightsRecommendationsVerdictSummary>;
1687
+ export type InsightsRecommendationsRoiQuadrantResponse =
1688
+ WithInsightsMeta<InsightsRecommendationsRoiQuadrant>;
1689
+ export type InsightsRecommendationsVelocityQualityResponse =
1690
+ WithInsightsMeta<InsightsRecommendationsVelocityQuality>;
1691
+ export type InsightsRecommendationsReviewPipelineResponse =
1692
+ WithInsightsMeta<InsightsRecommendationsReviewPipeline>;
1693
+ export type InsightsRecommendationsCostPerPrResponse =
1694
+ WithInsightsMeta<InsightsRecommendationsCostPerPr>;
1695
+ export type InsightsRecommendationsAdoptionGapResponse =
1696
+ WithInsightsMeta<InsightsRecommendationsAdoptionGap>;
1697
+
1698
+ export interface InsightsRecommendationsListResponse {
1699
+ items: InsightsRecommendationDto[];
1700
+ _meta: InsightsResponseMeta;
1701
+ }
1702
+
1540
1703
  export {
1541
1704
  JOURNEY_STEP_IDS,
1542
1705
  JOURNEY_STEP_REGISTRY,