@thinkai/tai-api-contract 2.225.0 → 2.227.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
@@ -1527,6 +1527,22 @@ export interface IngestCoverageShipWeightScoringDto {
1527
1527
  windowDays: number;
1528
1528
  }
1529
1529
 
1530
+ /** Per GitHub App install row for Data Coverage backfill / incremental progress. */
1531
+ export interface IngestCoverageProductivityInstallDto {
1532
+ vcsConnectionId: string;
1533
+ accountLogin: string;
1534
+ phase: "recent" | "historical" | "complete" | null;
1535
+ historicalWeekStart: string | null;
1536
+ /** `ceil(targetWindowDays / 7)` week slots for this install. */
1537
+ expectedWeeks: number;
1538
+ /** Fully finished week slots only (in-progress week excluded). */
1539
+ weeksCompleted: number;
1540
+ pendingRepoCount: number;
1541
+ totalRepoCount: number;
1542
+ failedRepoCount: number;
1543
+ skippedRepoCount: number;
1544
+ }
1545
+
1530
1546
  export interface IngestCoverageProductivityDetailDto {
1531
1547
  phase?: "recent" | "historical" | "complete" | null;
1532
1548
  historicalWeekStart?: string | null;
@@ -1537,9 +1553,18 @@ export interface IngestCoverageProductivityDetailDto {
1537
1553
  /**
1538
1554
  * Full repository count for this productivity pipeline before the `repos` array cap.
1539
1555
  * When greater than `repos.length`, the list is truncated for the response.
1556
+ * For multi-install workspaces this is the sum of per-install totals.
1540
1557
  */
1541
1558
  totalRepoCount?: number;
1542
1559
  repos?: IngestCoverageProductivityRepoDto[];
1560
+ /** One row per GitHub VCS connection (install) in the workspace. */
1561
+ installs?: IngestCoverageProductivityInstallDto[];
1562
+ /** Sum of `weeksCompleted` across installs (backfill overall). */
1563
+ overallWeeksCompleted?: number;
1564
+ /** `installCount × expectedWeeks` (backfill overall). */
1565
+ overallWeeksExpected?: number;
1566
+ /** `overallWeeksCompleted / overallWeeksExpected` as 0–100 (one decimal). */
1567
+ overallProgressPercent?: number;
1543
1568
  /**
1544
1569
  * Null when the pipeline exists but no depth-scan completed event and no week-reconcile
1545
1570
  * event are stored. Absent from pipelines that are omitted.
@@ -1985,7 +2010,7 @@ export const SDL_C_MODULE_IDS = [
1985
2010
  ] as const;
1986
2011
  export type SdlcModuleId = (typeof SDL_C_MODULE_IDS)[number];
1987
2012
 
1988
- /** Canonical SDLC Engineering Health metric ids (34). */
2013
+ /** Canonical SDLC Engineering Health metric ids (45). */
1989
2014
  export const SDL_C_METRIC_IDS = [
1990
2015
  "dora-deployment-frequency",
1991
2016
  "dora-lead-time",
@@ -2009,6 +2034,17 @@ export const SDL_C_METRIC_IDS = [
2009
2034
  "sec-secret-scanning",
2010
2035
  "sec-self-approvals",
2011
2036
  "sec-unreviewed-merge",
2037
+ "sec-critical-open",
2038
+ "sec-past-due",
2039
+ "sec-scan-coverage",
2040
+ "sec-code-scanning-backlog",
2041
+ "sec-sonar-vulnerabilities",
2042
+ "sec-quality-gate-failing",
2043
+ "sec-posture-gaps",
2044
+ "sec-security-incidents",
2045
+ "sec-security-tickets",
2046
+ "sec-ai-pr-share",
2047
+ "sec-ai-unreviewed-merge",
2012
2048
  "gov-branch-protection",
2013
2049
  "gov-stale-branches",
2014
2050
  "gov-orphaned-repos",
@@ -2054,6 +2090,12 @@ export interface SdlcDailySeriesPointDto {
2054
2090
  value: number;
2055
2091
  }
2056
2092
 
2093
+ export interface SdlcMetricBreakdownItemDto {
2094
+ key: string;
2095
+ label: string;
2096
+ value: number;
2097
+ }
2098
+
2057
2099
  export interface SdlcMetricDto {
2058
2100
  id: SdlcMetricId;
2059
2101
  name: string;
@@ -2067,6 +2109,8 @@ export interface SdlcMetricDto {
2067
2109
  benchmarkBand?: SdlcBenchmarkBand;
2068
2110
  drilldownAvailable: boolean;
2069
2111
  dailySeries?: SdlcDailySeriesPointDto[];
2112
+ /** Severity or category segments (e.g. Dependabot critical/high/medium/low). */
2113
+ breakdown?: SdlcMetricBreakdownItemDto[];
2070
2114
  unavailableReason?: string;
2071
2115
  }
2072
2116
 
@@ -2104,6 +2148,161 @@ export interface SdlcDrilldownDto {
2104
2148
  nextCursor?: string;
2105
2149
  }
2106
2150
 
2151
+ /** Security finding source connector / pipeline. */
2152
+ export type SecurityFindingSource =
2153
+ | "github_dependabot"
2154
+ | "github_secret_scanning"
2155
+ | "github_code_scanning"
2156
+ | "sonar_vulnerability"
2157
+ | "sonar_hotspot"
2158
+ | "readiness_gap"
2159
+ | "code_insights"
2160
+ | "incident"
2161
+ | "ticket";
2162
+
2163
+ export type SecurityFindingCategory =
2164
+ "dependency" | "secret" | "code" | "posture" | "incident" | "ticket";
2165
+
2166
+ export type SecuritySeverity = "critical" | "high" | "medium" | "low" | "unknown";
2167
+
2168
+ export type SecurityAiInvolvement = "measured" | "estimated" | "none" | "unknown";
2169
+
2170
+ export type SecurityFindingState = "open" | "fixed" | "dismissed";
2171
+
2172
+ export type SecurityFindingActionKind =
2173
+ "fix_pr" | "open_source" | "rotate_secret" | "assign_owner" | "open_incident" | "open_ticket";
2174
+
2175
+ export interface SecurityFindingActionDto {
2176
+ kind: SecurityFindingActionKind;
2177
+ href?: string;
2178
+ readinessIssueId?: string;
2179
+ }
2180
+
2181
+ export interface SecurityNamedRefDto {
2182
+ id: string;
2183
+ name: string;
2184
+ }
2185
+
2186
+ export interface SecurityRepoRefDto {
2187
+ id: string;
2188
+ slug: string;
2189
+ }
2190
+
2191
+ export interface SecurityFindingDto {
2192
+ id: string;
2193
+ source: SecurityFindingSource;
2194
+ sourceLabel: string;
2195
+ category: SecurityFindingCategory;
2196
+ severity: SecuritySeverity;
2197
+ title: string;
2198
+ repo: SecurityRepoRefDto | null;
2199
+ team: SecurityNamedRefDto | null;
2200
+ openedAt: string;
2201
+ dueAt: string | null;
2202
+ pastDue: boolean;
2203
+ state: SecurityFindingState;
2204
+ url: string | null;
2205
+ aiInvolvement: SecurityAiInvolvement;
2206
+ /** Other sources that reported the same advisory/CVE in this repo (headline collapse). */
2207
+ alsoSeenIn: SecurityFindingSource[];
2208
+ primaryAction: SecurityFindingActionDto;
2209
+ redacted: boolean;
2210
+ }
2211
+
2212
+ export type SecurityDataSourceCategory =
2213
+ "source_control" | "code_quality" | "ai_tools" | "incidents" | "tickets" | "security";
2214
+
2215
+ export type SecurityDataSourceStatus =
2216
+ "connected" | "stale" | "needs_permission" | "not_connected" | "coming_soon";
2217
+
2218
+ export interface SecurityDataSourceDto {
2219
+ id: string;
2220
+ name: string;
2221
+ category: SecurityDataSourceCategory;
2222
+ status: SecurityDataSourceStatus;
2223
+ lastSuccessAt: string | null;
2224
+ feeds: SdlcMetricId[];
2225
+ actionLabel?: string;
2226
+ actionHref?: string;
2227
+ }
2228
+
2229
+ export type SecurityBlindSpotMissing =
2230
+ "dependabot" | "secret_scanning" | "sast" | "review_rule" | "owner";
2231
+
2232
+ export interface SecurityBlindSpotDto {
2233
+ repo: SecurityRepoRefDto;
2234
+ team: SecurityNamedRefDto | null;
2235
+ missing: SecurityBlindSpotMissing[];
2236
+ }
2237
+
2238
+ export interface SecurityTeamRollupDto {
2239
+ team: SecurityNamedRefDto | null;
2240
+ criticalOpen: number;
2241
+ pastDue: number;
2242
+ scanCoveragePercent: number | null;
2243
+ aiUnreviewedPercent: number | null;
2244
+ openFindings: number;
2245
+ }
2246
+
2247
+ export interface SecurityAiRiskDto {
2248
+ agentPrSharePercent: number | null;
2249
+ agentUnreviewedPercent: number | null;
2250
+ humanUnreviewedPercent: number | null;
2251
+ acceptedAiLinesByTeam: Array<{ team: SecurityNamedRefDto | null; lines: number }>;
2252
+ guardrails: {
2253
+ reposWithAgentIgnore: number;
2254
+ reposWithMcpPosture: number;
2255
+ reposWithSecretsScanner: number;
2256
+ reposScanned: number;
2257
+ };
2258
+ attributionQuality: SecurityAiInvolvement;
2259
+ }
2260
+
2261
+ /** Response for GET /workspaces/:workspaceId/insights/security/posture */
2262
+ export interface SecurityPostureDto {
2263
+ asOf: string;
2264
+ rangeId: string;
2265
+ headline: {
2266
+ criticalOpen: number;
2267
+ pastDue: number;
2268
+ reposWithoutCoverage: number;
2269
+ unownedFindings: number;
2270
+ };
2271
+ dataSources: SecurityDataSourceDto[];
2272
+ fixFirst: SecurityFindingDto[];
2273
+ blindSpots: SecurityBlindSpotDto[];
2274
+ teams: SecurityTeamRollupDto[];
2275
+ aiRisk: SecurityAiRiskDto;
2276
+ viewer: { isAdmin: boolean; ownedTeamIds: string[] };
2277
+ _meta: InsightsResponseMeta;
2278
+ }
2279
+
2280
+ /** Response for GET /workspaces/:workspaceId/insights/security/findings */
2281
+ export interface SecurityFindingsPageDto {
2282
+ items: SecurityFindingDto[];
2283
+ nextCursor?: string;
2284
+ total: number;
2285
+ }
2286
+
2287
+ /** Response for GET/PUT /workspaces/:workspaceId/insights/security/settings */
2288
+ export interface SecuritySettingsDto {
2289
+ slaDays: {
2290
+ critical: number | null;
2291
+ high: number | null;
2292
+ medium: number | null;
2293
+ low: number | null;
2294
+ };
2295
+ incidentRules: {
2296
+ labels: string[];
2297
+ severityNames: string[];
2298
+ titleKeywords: string[];
2299
+ };
2300
+ ticketRules: {
2301
+ labels: string[];
2302
+ issueTypes: string[];
2303
+ };
2304
+ }
2305
+
2107
2306
  /** Shared Insights & Recommendations response meta (`_meta.isMock` is always false in production). */
2108
2307
  export interface InsightsResponseMeta {
2109
2308
  syncedAt: string;