@thinkai/tai-api-contract 2.8.4 → 2.8.5

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: {
@@ -2550,6 +2580,39 @@ export interface components {
2550
2580
  ReadinessFixListDto: components["schemas"]["PageMetaDto"] & {
2551
2581
  items: components["schemas"]["FixRequestDto"][];
2552
2582
  };
2583
+ /** @enum {string} */
2584
+ ReadinessAuditEventType: "scan-started" | "scan-completed" | "fix-requested" | "pr-merged" | "score-changed";
2585
+ /** @enum {string} */
2586
+ ReadinessAuditOutcome: "success" | "partial" | "failed";
2587
+ ReadinessAuditEntryDto: {
2588
+ /** @description Stable event identifier within the workspace feed. */
2589
+ id: string;
2590
+ /** Format: date-time */
2591
+ occurredAt: string;
2592
+ eventType: components["schemas"]["ReadinessAuditEventType"];
2593
+ /** @description Human-readable summary of the action. */
2594
+ actionLabel: string;
2595
+ actorName: string;
2596
+ /** @description Omitted for system actors. */
2597
+ actorEmail?: string | null;
2598
+ /** @description Present for fix and score events; null for repo-wide scans. */
2599
+ dimensionId?: components["schemas"]["ReadinessDimensionId"] | null;
2600
+ /** Format: uuid */
2601
+ repoId?: string | null;
2602
+ repoName?: string | null;
2603
+ outcome?: components["schemas"]["ReadinessAuditOutcome"] | null;
2604
+ /** @description Short label for linked PR, fix queue item, or run. */
2605
+ artifactLabel?: string | null;
2606
+ /** @description External URL when available (e.g. GitHub PR). */
2607
+ artifactUrl?: string | null;
2608
+ /** Format: uuid */
2609
+ runId?: string | null;
2610
+ /** Format: uuid */
2611
+ fixId?: string | null;
2612
+ };
2613
+ ReadinessAuditListDto: components["schemas"]["PageMetaDto"] & {
2614
+ items: components["schemas"]["ReadinessAuditEntryDto"][];
2615
+ };
2553
2616
  AgenticFoundationDimensionAggregateDto: {
2554
2617
  dimensionId: components["schemas"]["ReadinessDimensionId"];
2555
2618
  /** @description Mean dimension score percent across repos with maxScore > 0. */
@@ -3007,6 +3070,7 @@ export type AiUsageSpendContributorToolHeatmapDto = components['schemas']['AiUsa
3007
3070
  export type AiUsageSpendKeyInsightItemDto = components['schemas']['AiUsageSpendKeyInsightItemDto'];
3008
3071
  export type AiUsageSpendKeyInsightsDto = components['schemas']['AiUsageSpendKeyInsightsDto'];
3009
3072
  export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDataQuality'];
3073
+ export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
3010
3074
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
3011
3075
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
3012
3076
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
@@ -3061,6 +3125,10 @@ export type AgenticFoundationDashboardSummaryDto = components['schemas']['Agenti
3061
3125
  export type PageMetaDto = components['schemas']['PageMetaDto'];
3062
3126
  export type ReadinessRepoListDto = components['schemas']['ReadinessRepoListDto'];
3063
3127
  export type ReadinessFixListDto = components['schemas']['ReadinessFixListDto'];
3128
+ export type ReadinessAuditEventType = components['schemas']['ReadinessAuditEventType'];
3129
+ export type ReadinessAuditOutcome = components['schemas']['ReadinessAuditOutcome'];
3130
+ export type ReadinessAuditEntryDto = components['schemas']['ReadinessAuditEntryDto'];
3131
+ export type ReadinessAuditListDto = components['schemas']['ReadinessAuditListDto'];
3064
3132
  export type AgenticFoundationDimensionAggregateDto = components['schemas']['AgenticFoundationDimensionAggregateDto'];
3065
3133
  export type ReadinessFixStatusSummaryDto = components['schemas']['ReadinessFixStatusSummaryDto'];
3066
3134
  export type GithubInstalledRepoListDto = components['schemas']['GithubInstalledRepoListDto'];
@@ -5485,6 +5553,61 @@ export interface operations {
5485
5553
  };
5486
5554
  };
5487
5555
  };
5556
+ listReadinessAudit: {
5557
+ parameters: {
5558
+ query?: {
5559
+ limit?: number;
5560
+ offset?: number;
5561
+ order?: "asc" | "desc";
5562
+ /** @description Sort column for the activity feed. */
5563
+ sort?: "occurredAt" | "actorName" | "repoName" | "eventType" | "dimensionId";
5564
+ /** @description Case-insensitive match on actor name or email. */
5565
+ search?: string;
5566
+ eventType?: components["schemas"]["ReadinessAuditEventType"];
5567
+ dimensionId?: components["schemas"]["ReadinessDimensionId"];
5568
+ repoId?: string;
5569
+ /** @description ISO-8601 lower bound on `occurredAt` (inclusive). */
5570
+ since?: string;
5571
+ };
5572
+ header?: never;
5573
+ path: {
5574
+ workspaceId: components["parameters"]["WorkspaceId"];
5575
+ };
5576
+ cookie?: never;
5577
+ };
5578
+ requestBody?: never;
5579
+ responses: {
5580
+ /** @description Paginated audit entries */
5581
+ 200: {
5582
+ headers: {
5583
+ [name: string]: unknown;
5584
+ };
5585
+ content: {
5586
+ "application/json": components["schemas"]["ReadinessAuditListDto"];
5587
+ };
5588
+ };
5589
+ /** @description Invalid query */
5590
+ 400: {
5591
+ headers: {
5592
+ [name: string]: unknown;
5593
+ };
5594
+ content: {
5595
+ "application/json": components["schemas"]["ErrorMessageDto"];
5596
+ };
5597
+ };
5598
+ 401: components["responses"]["Unauthorized"];
5599
+ 403: components["responses"]["Forbidden"];
5600
+ /** @description Workspace does not exist */
5601
+ 404: {
5602
+ headers: {
5603
+ [name: string]: unknown;
5604
+ };
5605
+ content: {
5606
+ "application/json": components["schemas"]["ErrorMessageDto"];
5607
+ };
5608
+ };
5609
+ };
5610
+ };
5488
5611
  getReadinessScoreHistory: {
5489
5612
  parameters: {
5490
5613
  query?: {