@thinkai/tai-api-contract 2.8.4 → 2.8.6

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.
@@ -934,6 +934,26 @@ export interface paths {
934
934
  patch?: never;
935
935
  trace?: never;
936
936
  };
937
+ "/workspaces/{workspaceId}/readiness/audit": {
938
+ parameters: {
939
+ query?: never;
940
+ header?: never;
941
+ path?: never;
942
+ cookie?: never;
943
+ };
944
+ /**
945
+ * Foundation activity audit log
946
+ * @description Paginated chronological feed of Agentic Foundation events for a workspace: readiness scans, fix requests, PR merges, and score changes derived from existing run and fix tables. Never includes secrets or raw tokens. Config-change events are not included until dedicated event storage exists (issue #473).
947
+ */
948
+ get: operations["listReadinessAudit"];
949
+ put?: never;
950
+ post?: never;
951
+ delete?: never;
952
+ options?: never;
953
+ head?: never;
954
+ patch?: never;
955
+ trace?: never;
956
+ };
937
957
  "/workspaces/{workspaceId}/readiness/score-history": {
938
958
  parameters: {
939
959
  query?: never;
@@ -2047,10 +2067,15 @@ export interface components {
2047
2067
  items: components["schemas"]["AiUsageSpendKeyInsightItemDto"][];
2048
2068
  };
2049
2069
  /**
2050
- * @description **measured** — derived from scoped productivity ingest (`aiAdoption.aiAssistedContributionRatioPercent`). **estimated** — derived from AI-tool token volume heuristics when ingest ratios are absent for that bucket.
2070
+ * @description **measured** — derived from scoped productivity ingest (`aiAdoption.aiAssistedContributionRatioPercent`). **estimated** — derived from AI-tool token volume, spend proxy, or adoption heuristics when ingest ratios are absent.
2051
2071
  * @enum {string}
2052
2072
  */
2053
2073
  AiAssistedCodeDataQuality: "estimated" | "measured";
2074
+ /**
2075
+ * @description Primary signal for the period rollup. **ingest** — productivity metrics; **token_volume** — AI-tool tokens ÷ LOC heuristic; **spend_proxy** — spend converted to proxy tokens when usage rows omit counts; **adoption** — active AI-tool users vs org headcount; **unavailable** — no usable signal for the selected scope.
2076
+ * @enum {string}
2077
+ */
2078
+ AiAssistedCodeEstimationSource: "ingest" | "token_volume" | "spend_proxy" | "adoption" | "unavailable";
2054
2079
  AiUsageSpendAiAssistedCodeWeekDto: {
2055
2080
  /** Format: date-time */
2056
2081
  bucketStart: string;
@@ -2084,6 +2109,11 @@ export interface components {
2084
2109
  targetMinPercent: number;
2085
2110
  /** @default 75 */
2086
2111
  targetMaxPercent: number;
2112
+ estimationSource?: components["schemas"]["AiAssistedCodeEstimationSource"];
2113
+ /** @description Scoped AI-tool token volume for the selected period. */
2114
+ totalTokenCount?: number;
2115
+ /** @description Scoped AI-tool spend in cents for the selected period. */
2116
+ totalSpendCents?: number;
2087
2117
  weeks: components["schemas"]["AiUsageSpendAiAssistedCodeWeekDto"][];
2088
2118
  };
2089
2119
  AiUsageSpendAiToolUsageSpendProviderItemDto: {
@@ -2474,10 +2504,17 @@ export interface components {
2474
2504
  /** @description Pass as `cursor` query param to fetch the next page; null when no more rows. */
2475
2505
  nextCursor: string | null;
2476
2506
  };
2507
+ ReadinessScoreHistoryDimensionScoreDto: {
2508
+ dimensionId: components["schemas"]["ReadinessDimensionId"];
2509
+ /** @description Dimension score as a percentage (0–100) for this scan run. */
2510
+ scorePercent: number;
2511
+ };
2477
2512
  ReadinessScoreHistoryPointDto: {
2478
2513
  /** Format: date-time */
2479
2514
  finishedAt: string;
2480
2515
  overallScore: number;
2516
+ /** @description Per-dimension percentages captured on this scan run. */
2517
+ dimensionScores?: components["schemas"]["ReadinessScoreHistoryDimensionScoreDto"][];
2481
2518
  };
2482
2519
  ReadinessRepoScoreHistoryDto: {
2483
2520
  /** Format: uuid */
@@ -2550,6 +2587,39 @@ export interface components {
2550
2587
  ReadinessFixListDto: components["schemas"]["PageMetaDto"] & {
2551
2588
  items: components["schemas"]["FixRequestDto"][];
2552
2589
  };
2590
+ /** @enum {string} */
2591
+ ReadinessAuditEventType: "scan-started" | "scan-completed" | "fix-requested" | "pr-merged" | "score-changed";
2592
+ /** @enum {string} */
2593
+ ReadinessAuditOutcome: "success" | "partial" | "failed";
2594
+ ReadinessAuditEntryDto: {
2595
+ /** @description Stable event identifier within the workspace feed. */
2596
+ id: string;
2597
+ /** Format: date-time */
2598
+ occurredAt: string;
2599
+ eventType: components["schemas"]["ReadinessAuditEventType"];
2600
+ /** @description Human-readable summary of the action. */
2601
+ actionLabel: string;
2602
+ actorName: string;
2603
+ /** @description Omitted for system actors. */
2604
+ actorEmail?: string | null;
2605
+ /** @description Present for fix and score events; null for repo-wide scans. */
2606
+ dimensionId?: components["schemas"]["ReadinessDimensionId"] | null;
2607
+ /** Format: uuid */
2608
+ repoId?: string | null;
2609
+ repoName?: string | null;
2610
+ outcome?: components["schemas"]["ReadinessAuditOutcome"] | null;
2611
+ /** @description Short label for linked PR, fix queue item, or run. */
2612
+ artifactLabel?: string | null;
2613
+ /** @description External URL when available (e.g. GitHub PR). */
2614
+ artifactUrl?: string | null;
2615
+ /** Format: uuid */
2616
+ runId?: string | null;
2617
+ /** Format: uuid */
2618
+ fixId?: string | null;
2619
+ };
2620
+ ReadinessAuditListDto: components["schemas"]["PageMetaDto"] & {
2621
+ items: components["schemas"]["ReadinessAuditEntryDto"][];
2622
+ };
2553
2623
  AgenticFoundationDimensionAggregateDto: {
2554
2624
  dimensionId: components["schemas"]["ReadinessDimensionId"];
2555
2625
  /** @description Mean dimension score percent across repos with maxScore > 0. */
@@ -3007,6 +3077,7 @@ export type AiUsageSpendContributorToolHeatmapDto = components['schemas']['AiUsa
3007
3077
  export type AiUsageSpendKeyInsightItemDto = components['schemas']['AiUsageSpendKeyInsightItemDto'];
3008
3078
  export type AiUsageSpendKeyInsightsDto = components['schemas']['AiUsageSpendKeyInsightsDto'];
3009
3079
  export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDataQuality'];
3080
+ export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
3010
3081
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
3011
3082
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
3012
3083
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
@@ -3053,6 +3124,7 @@ export type ReadinessIssueDto = components['schemas']['ReadinessIssueDto'];
3053
3124
  export type DimensionScoreDto = components['schemas']['DimensionScoreDto'];
3054
3125
  export type ReadinessRepoRunHistoryItemDto = components['schemas']['ReadinessRepoRunHistoryItemDto'];
3055
3126
  export type ReadinessRepoRunListDto = components['schemas']['ReadinessRepoRunListDto'];
3127
+ export type ReadinessScoreHistoryDimensionScoreDto = components['schemas']['ReadinessScoreHistoryDimensionScoreDto'];
3056
3128
  export type ReadinessScoreHistoryPointDto = components['schemas']['ReadinessScoreHistoryPointDto'];
3057
3129
  export type ReadinessRepoScoreHistoryDto = components['schemas']['ReadinessRepoScoreHistoryDto'];
3058
3130
  export type WorkspaceReadinessScoreHistoryDto = components['schemas']['WorkspaceReadinessScoreHistoryDto'];
@@ -3061,6 +3133,10 @@ export type AgenticFoundationDashboardSummaryDto = components['schemas']['Agenti
3061
3133
  export type PageMetaDto = components['schemas']['PageMetaDto'];
3062
3134
  export type ReadinessRepoListDto = components['schemas']['ReadinessRepoListDto'];
3063
3135
  export type ReadinessFixListDto = components['schemas']['ReadinessFixListDto'];
3136
+ export type ReadinessAuditEventType = components['schemas']['ReadinessAuditEventType'];
3137
+ export type ReadinessAuditOutcome = components['schemas']['ReadinessAuditOutcome'];
3138
+ export type ReadinessAuditEntryDto = components['schemas']['ReadinessAuditEntryDto'];
3139
+ export type ReadinessAuditListDto = components['schemas']['ReadinessAuditListDto'];
3064
3140
  export type AgenticFoundationDimensionAggregateDto = components['schemas']['AgenticFoundationDimensionAggregateDto'];
3065
3141
  export type ReadinessFixStatusSummaryDto = components['schemas']['ReadinessFixStatusSummaryDto'];
3066
3142
  export type GithubInstalledRepoListDto = components['schemas']['GithubInstalledRepoListDto'];
@@ -5485,6 +5561,61 @@ export interface operations {
5485
5561
  };
5486
5562
  };
5487
5563
  };
5564
+ listReadinessAudit: {
5565
+ parameters: {
5566
+ query?: {
5567
+ limit?: number;
5568
+ offset?: number;
5569
+ order?: "asc" | "desc";
5570
+ /** @description Sort column for the activity feed. */
5571
+ sort?: "occurredAt" | "actorName" | "repoName" | "eventType" | "dimensionId";
5572
+ /** @description Case-insensitive match on actor name or email. */
5573
+ search?: string;
5574
+ eventType?: components["schemas"]["ReadinessAuditEventType"];
5575
+ dimensionId?: components["schemas"]["ReadinessDimensionId"];
5576
+ repoId?: string;
5577
+ /** @description ISO-8601 lower bound on `occurredAt` (inclusive). */
5578
+ since?: string;
5579
+ };
5580
+ header?: never;
5581
+ path: {
5582
+ workspaceId: components["parameters"]["WorkspaceId"];
5583
+ };
5584
+ cookie?: never;
5585
+ };
5586
+ requestBody?: never;
5587
+ responses: {
5588
+ /** @description Paginated audit entries */
5589
+ 200: {
5590
+ headers: {
5591
+ [name: string]: unknown;
5592
+ };
5593
+ content: {
5594
+ "application/json": components["schemas"]["ReadinessAuditListDto"];
5595
+ };
5596
+ };
5597
+ /** @description Invalid query */
5598
+ 400: {
5599
+ headers: {
5600
+ [name: string]: unknown;
5601
+ };
5602
+ content: {
5603
+ "application/json": components["schemas"]["ErrorMessageDto"];
5604
+ };
5605
+ };
5606
+ 401: components["responses"]["Unauthorized"];
5607
+ 403: components["responses"]["Forbidden"];
5608
+ /** @description Workspace does not exist */
5609
+ 404: {
5610
+ headers: {
5611
+ [name: string]: unknown;
5612
+ };
5613
+ content: {
5614
+ "application/json": components["schemas"]["ErrorMessageDto"];
5615
+ };
5616
+ };
5617
+ };
5618
+ };
5488
5619
  getReadinessScoreHistory: {
5489
5620
  parameters: {
5490
5621
  query?: {