@thinkai/tai-api-contract 2.62.0 → 2.64.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/dist/generated/openapi.d.ts +978 -0
- package/dist/generated/openapi.d.ts.map +1 -1
- package/dist/index.d.ts +187 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +59 -0
- package/dist/index.js.map +1 -1
- package/openapi/openapi.yaml +1017 -17
- package/package.json +1 -1
- package/src/generated/openapi.ts +978 -0
- package/src/index.ts +277 -0
package/src/index.ts
CHANGED
|
@@ -1423,6 +1423,283 @@ export interface AiToolMemberDetailDto {
|
|
|
1423
1423
|
heatmap: AiToolMemberHeatmapDayDto[];
|
|
1424
1424
|
}
|
|
1425
1425
|
|
|
1426
|
+
/** Canonical SDLC Engineering Health module ids. */
|
|
1427
|
+
export const SDL_C_MODULE_IDS = [
|
|
1428
|
+
"dora",
|
|
1429
|
+
"ci-pipeline",
|
|
1430
|
+
"collaboration-pr",
|
|
1431
|
+
"security-risk",
|
|
1432
|
+
"governance-architecture",
|
|
1433
|
+
"financial-operational",
|
|
1434
|
+
] as const;
|
|
1435
|
+
export type SdlcModuleId = (typeof SDL_C_MODULE_IDS)[number];
|
|
1436
|
+
|
|
1437
|
+
/** Canonical SDLC Engineering Health metric ids (34). */
|
|
1438
|
+
export const SDL_C_METRIC_IDS = [
|
|
1439
|
+
"dora-deployment-frequency",
|
|
1440
|
+
"dora-lead-time",
|
|
1441
|
+
"dora-cfr",
|
|
1442
|
+
"dora-mttr",
|
|
1443
|
+
"ci-success-rate",
|
|
1444
|
+
"ci-duration-p50-p95",
|
|
1445
|
+
"ci-flakiness",
|
|
1446
|
+
"ci-queue-wait",
|
|
1447
|
+
"ci-cache-hit",
|
|
1448
|
+
"pr-review-time",
|
|
1449
|
+
"pr-bus-factor",
|
|
1450
|
+
"pr-size",
|
|
1451
|
+
"pr-abandonment",
|
|
1452
|
+
"pr-review-depth",
|
|
1453
|
+
"pr-draft-duration",
|
|
1454
|
+
"pr-merge-conflicts",
|
|
1455
|
+
"pr-commit-density",
|
|
1456
|
+
"sec-dependabot-backlog",
|
|
1457
|
+
"sec-vuln-mttr",
|
|
1458
|
+
"sec-secret-scanning",
|
|
1459
|
+
"sec-self-approvals",
|
|
1460
|
+
"sec-unreviewed-merge",
|
|
1461
|
+
"gov-branch-protection",
|
|
1462
|
+
"gov-stale-branches",
|
|
1463
|
+
"gov-orphaned-repos",
|
|
1464
|
+
"gov-readme-health",
|
|
1465
|
+
"gov-codeowners",
|
|
1466
|
+
"gov-issue-pr-linkage",
|
|
1467
|
+
"fin-gha-minutes",
|
|
1468
|
+
"fin-copilot-utilization",
|
|
1469
|
+
"fin-org-inactivity",
|
|
1470
|
+
"fin-env-drift",
|
|
1471
|
+
"fin-release-cadence",
|
|
1472
|
+
"fin-api-rate-limit",
|
|
1473
|
+
] as const;
|
|
1474
|
+
export type SdlcMetricId = (typeof SDL_C_METRIC_IDS)[number];
|
|
1475
|
+
|
|
1476
|
+
export type SdlcMetricDataStatus = "live" | "preview" | "unavailable";
|
|
1477
|
+
export type SdlcMetricHealthStatus = "healthy" | "warning" | "critical" | "unknown";
|
|
1478
|
+
export type SdlcBenchmarkBand = "elite" | "high" | "medium" | "low";
|
|
1479
|
+
|
|
1480
|
+
export interface SdlcMetricTrendDto {
|
|
1481
|
+
direction: "up" | "down" | "flat";
|
|
1482
|
+
deltaPercent?: number;
|
|
1483
|
+
}
|
|
1484
|
+
|
|
1485
|
+
export interface SdlcDailySeriesPointDto {
|
|
1486
|
+
date: string;
|
|
1487
|
+
value: number;
|
|
1488
|
+
}
|
|
1489
|
+
|
|
1490
|
+
export interface SdlcMetricDto {
|
|
1491
|
+
id: SdlcMetricId;
|
|
1492
|
+
name: string;
|
|
1493
|
+
dataStatus: SdlcMetricDataStatus;
|
|
1494
|
+
healthStatus: SdlcMetricHealthStatus;
|
|
1495
|
+
value: number | string | null;
|
|
1496
|
+
unit?: string;
|
|
1497
|
+
secondaryValue?: number | string | null;
|
|
1498
|
+
secondaryLabel?: string;
|
|
1499
|
+
trend?: SdlcMetricTrendDto;
|
|
1500
|
+
benchmarkBand?: SdlcBenchmarkBand;
|
|
1501
|
+
drilldownAvailable: boolean;
|
|
1502
|
+
dailySeries?: SdlcDailySeriesPointDto[];
|
|
1503
|
+
unavailableReason?: string;
|
|
1504
|
+
}
|
|
1505
|
+
|
|
1506
|
+
export interface SdlcModuleDto {
|
|
1507
|
+
id: SdlcModuleId;
|
|
1508
|
+
name: string;
|
|
1509
|
+
metrics: SdlcMetricDto[];
|
|
1510
|
+
}
|
|
1511
|
+
|
|
1512
|
+
/** Response for GET /workspaces/:workspaceId/insights/sdlc/overview */
|
|
1513
|
+
export interface SdlcOverviewDto {
|
|
1514
|
+
rangeId: string;
|
|
1515
|
+
from: string;
|
|
1516
|
+
to: string;
|
|
1517
|
+
department: string;
|
|
1518
|
+
team: string;
|
|
1519
|
+
repoIds: string[];
|
|
1520
|
+
asOf: string;
|
|
1521
|
+
modules: SdlcModuleDto[];
|
|
1522
|
+
}
|
|
1523
|
+
|
|
1524
|
+
export interface SdlcDrilldownItemDto {
|
|
1525
|
+
id: string;
|
|
1526
|
+
title: string;
|
|
1527
|
+
subtitle?: string;
|
|
1528
|
+
url?: string;
|
|
1529
|
+
occurredAt?: string;
|
|
1530
|
+
metadata?: Record<string, string | number>;
|
|
1531
|
+
}
|
|
1532
|
+
|
|
1533
|
+
/** Response for GET /workspaces/:workspaceId/insights/sdlc/drilldown/{metricId} */
|
|
1534
|
+
export interface SdlcDrilldownDto {
|
|
1535
|
+
metricId: SdlcMetricId;
|
|
1536
|
+
items: SdlcDrilldownItemDto[];
|
|
1537
|
+
nextCursor?: string;
|
|
1538
|
+
}
|
|
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
|
+
|
|
1426
1703
|
export {
|
|
1427
1704
|
JOURNEY_STEP_IDS,
|
|
1428
1705
|
JOURNEY_STEP_REGISTRY,
|