@thinkai/tai-api-contract 2.4.0 → 2.4.1

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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.4.0
4
+ version: 2.4.1
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -48,6 +48,8 @@ tags:
48
48
  description: Per-user per-workspace preferences (§12)
49
49
  - name: OrgChartImport
50
50
  description: Org chart import via storage path (§14)
51
+ - name: AgenticFoundation
52
+ description: Agentic Foundation pillars (epic #278); reads stored repository readiness snapshots
51
53
 
52
54
  paths:
53
55
  /me:
@@ -1397,6 +1399,9 @@ paths:
1397
1399
  get:
1398
1400
  tags: [RepositoryReadiness]
1399
1401
  summary: Single repo readiness
1402
+ description: >
1403
+ Returns one stored repository scorecard with all eight dimensions and nested issues.
1404
+ Unknown `repoId` or a repo that belongs to another workspace returns `404` (no cross-tenant leakage).
1400
1405
  operationId: getReadinessRepo
1401
1406
  parameters:
1402
1407
  - $ref: "#/components/parameters/WorkspaceId"
@@ -1408,8 +1413,343 @@ paths:
1408
1413
  application/json:
1409
1414
  schema:
1410
1415
  $ref: "#/components/schemas/RepoReadinessScoreDto"
1416
+ "400":
1417
+ description: Malformed `repoId` (not a UUID)
1418
+ content:
1419
+ application/json:
1420
+ schema:
1421
+ $ref: "#/components/schemas/ErrorMessageDto"
1422
+ "401":
1423
+ $ref: "#/components/responses/Unauthorized"
1424
+ "403":
1425
+ $ref: "#/components/responses/Forbidden"
1426
+ "404":
1427
+ description: Workspace or repository not found
1428
+ content:
1429
+ application/json:
1430
+ schema:
1431
+ $ref: "#/components/schemas/ErrorMessageDto"
1432
+
1433
+ /workspaces/{workspaceId}/agentic-foundation/dashboard:
1434
+ get:
1435
+ tags: [AgenticFoundation]
1436
+ summary: Agentic Foundation dashboard
1437
+ description: >
1438
+ Returns stored repository readiness scorecards plus a flattened issue queue for the
1439
+ Agentic Foundation dashboard surfaces. This is read-only and does not run scoring on
1440
+ the request path (issue #279). Field `generatedAt` is the server timestamp when this JSON
1441
+ payload was assembled; it is not the same as per-repo `lastAnalyzed` on `RepoReadinessScoreDto`.
1442
+ operationId: getAgenticFoundationDashboard
1443
+ parameters:
1444
+ - $ref: "#/components/parameters/WorkspaceId"
1445
+ responses:
1446
+ "200":
1447
+ description: Dashboard scorecards and issue queue
1448
+ content:
1449
+ application/json:
1450
+ schema:
1451
+ $ref: "#/components/schemas/AgenticFoundationDashboardDto"
1452
+ examples:
1453
+ emptyWorkspace:
1454
+ summary: No repos analyzed yet
1455
+ value:
1456
+ workspaceId: 00000000-0000-0000-0000-000000000001
1457
+ generatedAt: "2026-05-12T12:00:00.000Z"
1458
+ summary:
1459
+ repoCount: 0
1460
+ averageOverallScore: 0
1461
+ issueCount: 0
1462
+ criticalIssueCount: 0
1463
+ repos: []
1464
+ issueQueue: []
1465
+ "401":
1466
+ $ref: "#/components/responses/Unauthorized"
1467
+ "403":
1468
+ $ref: "#/components/responses/Forbidden"
1469
+ "404":
1470
+ description: Workspace does not exist
1471
+ content:
1472
+ application/json:
1473
+ schema:
1474
+ $ref: "#/components/schemas/ErrorMessageDto"
1475
+
1476
+ /workspaces/{workspaceId}/agentic-foundation/agentic-readiness:
1477
+ get:
1478
+ tags: [AgenticFoundation]
1479
+ summary: Agentic readiness pillar (stored dimension slice)
1480
+ description: >
1481
+ Returns `RepoReadinessScoreDto` rows with only the `ai-agent-readiness` dimension populated
1482
+ per repo. Same auth and persistence source as `GET .../readiness/repos` (issue #280).
1483
+ operationId: getAgenticFoundationAgenticReadiness
1484
+ parameters:
1485
+ - $ref: "#/components/parameters/WorkspaceId"
1486
+ responses:
1487
+ "200":
1488
+ description: Repositories with ai-agent-readiness slice
1489
+ content:
1490
+ application/json:
1491
+ schema:
1492
+ type: array
1493
+ items:
1494
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1495
+ examples:
1496
+ singleRepoSlice:
1497
+ summary: One repo, single pillar dimension
1498
+ value:
1499
+ - repoId: 00000000-0000-0000-0000-000000000002
1500
+ repoName: api-gateway
1501
+ language: typescript
1502
+ overallScore: 67
1503
+ dimensions:
1504
+ - dimensionId: ai-agent-readiness
1505
+ score: 2
1506
+ maxScore: 3
1507
+ issues: []
1508
+ lastAnalyzed: "2026-05-12T12:00:00.000Z"
1509
+ teamId: null
1510
+ provider:
1511
+ kind: github
1512
+ slug: acme/api-gateway
1513
+ webUrl: https://github.com/acme/api-gateway
1514
+ defaultBranch: main
1515
+ externalId: null
1516
+ hostBaseUrl: null
1517
+ "401":
1518
+ $ref: "#/components/responses/Unauthorized"
1519
+ "403":
1520
+ $ref: "#/components/responses/Forbidden"
1521
+ "404":
1522
+ description: Workspace does not exist
1523
+ content:
1524
+ application/json:
1525
+ schema:
1526
+ $ref: "#/components/schemas/ErrorMessageDto"
1527
+
1528
+ /workspaces/{workspaceId}/agentic-foundation/repository-health:
1529
+ get:
1530
+ tags: [AgenticFoundation]
1531
+ summary: Repository health pillar (repo-hygiene slice)
1532
+ description: Returns per-repo `repo-hygiene` dimension only (issue #281).
1533
+ operationId: getAgenticFoundationRepositoryHealth
1534
+ parameters:
1535
+ - $ref: "#/components/parameters/WorkspaceId"
1536
+ responses:
1537
+ "200":
1538
+ description: Repositories with repo-hygiene slice
1539
+ content:
1540
+ application/json:
1541
+ schema:
1542
+ type: array
1543
+ items:
1544
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1545
+ "401":
1546
+ $ref: "#/components/responses/Unauthorized"
1547
+ "403":
1548
+ $ref: "#/components/responses/Forbidden"
1549
+ "404":
1550
+ description: Workspace does not exist
1551
+ content:
1552
+ application/json:
1553
+ schema:
1554
+ $ref: "#/components/schemas/ErrorMessageDto"
1555
+
1556
+ /workspaces/{workspaceId}/agentic-foundation/codebase-quality:
1557
+ get:
1558
+ tags: [AgenticFoundation]
1559
+ summary: Codebase quality pillar (stack-quality slice)
1560
+ description: Returns per-repo `stack-quality` dimension only (issue #282).
1561
+ operationId: getAgenticFoundationCodebaseQuality
1562
+ parameters:
1563
+ - $ref: "#/components/parameters/WorkspaceId"
1564
+ responses:
1565
+ "200":
1566
+ description: Repositories with stack-quality slice
1567
+ content:
1568
+ application/json:
1569
+ schema:
1570
+ type: array
1571
+ items:
1572
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1573
+ "401":
1574
+ $ref: "#/components/responses/Unauthorized"
1575
+ "403":
1576
+ $ref: "#/components/responses/Forbidden"
1577
+ "404":
1578
+ description: Workspace does not exist
1579
+ content:
1580
+ application/json:
1581
+ schema:
1582
+ $ref: "#/components/schemas/ErrorMessageDto"
1583
+
1584
+ /workspaces/{workspaceId}/agentic-foundation/test-qa:
1585
+ get:
1586
+ tags: [AgenticFoundation]
1587
+ summary: Test and QA pillar (tests-qa slice)
1588
+ description: Returns per-repo `tests-qa` dimension only (issue #283).
1589
+ operationId: getAgenticFoundationTestQa
1590
+ parameters:
1591
+ - $ref: "#/components/parameters/WorkspaceId"
1592
+ responses:
1593
+ "200":
1594
+ description: Repositories with tests-qa slice
1595
+ content:
1596
+ application/json:
1597
+ schema:
1598
+ type: array
1599
+ items:
1600
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1601
+ "401":
1602
+ $ref: "#/components/responses/Unauthorized"
1603
+ "403":
1604
+ $ref: "#/components/responses/Forbidden"
1605
+ "404":
1606
+ description: Workspace does not exist
1607
+ content:
1608
+ application/json:
1609
+ schema:
1610
+ $ref: "#/components/schemas/ErrorMessageDto"
1611
+
1612
+ /workspaces/{workspaceId}/agentic-foundation/observability:
1613
+ get:
1614
+ tags: [AgenticFoundation]
1615
+ summary: Observability pillar (observability slice)
1616
+ description: Returns per-repo `observability` dimension only (issue #284).
1617
+ operationId: getAgenticFoundationObservability
1618
+ parameters:
1619
+ - $ref: "#/components/parameters/WorkspaceId"
1620
+ responses:
1621
+ "200":
1622
+ description: Repositories with observability slice
1623
+ content:
1624
+ application/json:
1625
+ schema:
1626
+ type: array
1627
+ items:
1628
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1629
+ "401":
1630
+ $ref: "#/components/responses/Unauthorized"
1631
+ "403":
1632
+ $ref: "#/components/responses/Forbidden"
1633
+ "404":
1634
+ description: Workspace does not exist
1635
+ content:
1636
+ application/json:
1637
+ schema:
1638
+ $ref: "#/components/schemas/ErrorMessageDto"
1639
+
1640
+ /workspaces/{workspaceId}/agentic-foundation/api-contract:
1641
+ get:
1642
+ tags: [AgenticFoundation]
1643
+ summary: API contract pillar (api-contracts slice)
1644
+ description: Returns per-repo `api-contracts` dimension only (issue #285).
1645
+ operationId: getAgenticFoundationApiContract
1646
+ parameters:
1647
+ - $ref: "#/components/parameters/WorkspaceId"
1648
+ responses:
1649
+ "200":
1650
+ description: Repositories with api-contracts slice
1651
+ content:
1652
+ application/json:
1653
+ schema:
1654
+ type: array
1655
+ items:
1656
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1411
1657
  "401":
1412
1658
  $ref: "#/components/responses/Unauthorized"
1659
+ "403":
1660
+ $ref: "#/components/responses/Forbidden"
1661
+ "404":
1662
+ description: Workspace does not exist
1663
+ content:
1664
+ application/json:
1665
+ schema:
1666
+ $ref: "#/components/schemas/ErrorMessageDto"
1667
+
1668
+ /workspaces/{workspaceId}/agentic-foundation/platform-governance:
1669
+ get:
1670
+ tags: [AgenticFoundation]
1671
+ summary: Platform governance pillar (platform-governance slice)
1672
+ description: Returns per-repo `platform-governance` dimension only (issue #286).
1673
+ operationId: getAgenticFoundationPlatformGovernance
1674
+ parameters:
1675
+ - $ref: "#/components/parameters/WorkspaceId"
1676
+ responses:
1677
+ "200":
1678
+ description: Repositories with platform-governance slice
1679
+ content:
1680
+ application/json:
1681
+ schema:
1682
+ type: array
1683
+ items:
1684
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1685
+ "401":
1686
+ $ref: "#/components/responses/Unauthorized"
1687
+ "403":
1688
+ $ref: "#/components/responses/Forbidden"
1689
+ "404":
1690
+ description: Workspace does not exist
1691
+ content:
1692
+ application/json:
1693
+ schema:
1694
+ $ref: "#/components/schemas/ErrorMessageDto"
1695
+
1696
+ /workspaces/{workspaceId}/agentic-foundation/delivery-governance:
1697
+ get:
1698
+ tags: [AgenticFoundation]
1699
+ summary: Delivery governance pillar (delivery slice)
1700
+ description: Returns per-repo `delivery` dimension only (issue #287).
1701
+ operationId: getAgenticFoundationDeliveryGovernance
1702
+ parameters:
1703
+ - $ref: "#/components/parameters/WorkspaceId"
1704
+ responses:
1705
+ "200":
1706
+ description: Repositories with delivery slice
1707
+ content:
1708
+ application/json:
1709
+ schema:
1710
+ type: array
1711
+ items:
1712
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1713
+ "401":
1714
+ $ref: "#/components/responses/Unauthorized"
1715
+ "403":
1716
+ $ref: "#/components/responses/Forbidden"
1717
+ "404":
1718
+ description: Workspace does not exist
1719
+ content:
1720
+ application/json:
1721
+ schema:
1722
+ $ref: "#/components/schemas/ErrorMessageDto"
1723
+
1724
+ /workspaces/{workspaceId}/agentic-foundation/ai-resolution-hub:
1725
+ get:
1726
+ tags: [AgenticFoundation]
1727
+ summary: AI resolution hub (full readiness scorecards)
1728
+ description: >
1729
+ Returns the same payload as `GET .../readiness/repos` (all dimensions per repo) for
1730
+ cross-pillar hub views (issue #288).
1731
+ operationId: getAgenticFoundationAiResolutionHub
1732
+ parameters:
1733
+ - $ref: "#/components/parameters/WorkspaceId"
1734
+ responses:
1735
+ "200":
1736
+ description: Full repository readiness scorecards
1737
+ content:
1738
+ application/json:
1739
+ schema:
1740
+ type: array
1741
+ items:
1742
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
1743
+ "401":
1744
+ $ref: "#/components/responses/Unauthorized"
1745
+ "403":
1746
+ $ref: "#/components/responses/Forbidden"
1747
+ "404":
1748
+ description: Workspace does not exist
1749
+ content:
1750
+ application/json:
1751
+ schema:
1752
+ $ref: "#/components/schemas/ErrorMessageDto"
1413
1753
 
1414
1754
  /workspaces/{workspaceId}/readiness/dimensions:
1415
1755
  get:
@@ -1795,6 +2135,7 @@ components:
1795
2135
  required: true
1796
2136
  schema:
1797
2137
  type: string
2138
+ format: uuid
1798
2139
  ProjectId:
1799
2140
  name: projectId
1800
2141
  in: path
@@ -2703,6 +3044,80 @@ components:
2703
3044
  provider:
2704
3045
  $ref: "#/components/schemas/RepoProviderDto"
2705
3046
 
3047
+ AgenticFoundationDashboardSummaryDto:
3048
+ type: object
3049
+ required: [repoCount, averageOverallScore, issueCount, criticalIssueCount]
3050
+ properties:
3051
+ repoCount:
3052
+ type: integer
3053
+ minimum: 0
3054
+ averageOverallScore:
3055
+ type: integer
3056
+ minimum: 0
3057
+ maximum: 100
3058
+ issueCount:
3059
+ type: integer
3060
+ minimum: 0
3061
+ criticalIssueCount:
3062
+ type: integer
3063
+ minimum: 0
3064
+
3065
+ AgenticFoundationDashboardIssueDto:
3066
+ type: object
3067
+ required:
3068
+ [id, repoId, repoName, provider, dimensionId, severity, title, description, filePath, fixStatus]
3069
+ properties:
3070
+ id:
3071
+ type: string
3072
+ format: uuid
3073
+ repoId:
3074
+ type: string
3075
+ format: uuid
3076
+ repoName:
3077
+ type: string
3078
+ maxLength: 256
3079
+ provider:
3080
+ $ref: "#/components/schemas/RepoProviderDto"
3081
+ dimensionId:
3082
+ $ref: "#/components/schemas/ReadinessDimensionId"
3083
+ severity:
3084
+ type: string
3085
+ enum: [critical, high, medium, low]
3086
+ title:
3087
+ type: string
3088
+ maxLength: 256
3089
+ description:
3090
+ type: string
3091
+ maxLength: 2048
3092
+ filePath:
3093
+ type: string
3094
+ maxLength: 512
3095
+ nullable: true
3096
+ fixStatus:
3097
+ type: string
3098
+ enum: [open, pr-pending, fixed]
3099
+
3100
+ AgenticFoundationDashboardDto:
3101
+ type: object
3102
+ required: [workspaceId, generatedAt, summary, repos, issueQueue]
3103
+ properties:
3104
+ workspaceId:
3105
+ type: string
3106
+ format: uuid
3107
+ generatedAt:
3108
+ type: string
3109
+ format: date-time
3110
+ summary:
3111
+ $ref: "#/components/schemas/AgenticFoundationDashboardSummaryDto"
3112
+ repos:
3113
+ type: array
3114
+ items:
3115
+ $ref: "#/components/schemas/RepoReadinessScoreDto"
3116
+ issueQueue:
3117
+ type: array
3118
+ items:
3119
+ $ref: "#/components/schemas/AgenticFoundationDashboardIssueDto"
3120
+
2706
3121
  FixRequestDto:
2707
3122
  type: object
2708
3123
  required: [id, issueId, repoId, repoName, issueTitle, dimensionId, severity, status, createdAt]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.4.0",
3
+ "version": "2.4.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",