@thinkai/tai-api-contract 2.8.3 → 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: {
@@ -2234,11 +2264,27 @@ export interface components {
2234
2264
  /** @description Human-readable summary for UI when permissionsUpgradeRequired is true. */
2235
2265
  upgradeMessage?: string | null;
2236
2266
  };
2267
+ GithubPendingApprovalDto: {
2268
+ /**
2269
+ * Format: uuid
2270
+ * @description Pending workspace integration row id (for cancel).
2271
+ */
2272
+ integrationId: string;
2273
+ /** @description GitHub org login from the install request, when known. */
2274
+ requestedAccountLogin?: string | null;
2275
+ /**
2276
+ * Format: date-time
2277
+ * @description When the pending install request was recorded.
2278
+ */
2279
+ pendingSince: string;
2280
+ };
2237
2281
  GithubInstallationStatusDto: {
2238
2282
  installed: boolean;
2239
2283
  installations: components["schemas"]["GithubInstallationSummaryDto"][];
2240
2284
  /** @description True if any connected installation is under-permissioned. */
2241
2285
  permissionsUpgradeRequired: boolean;
2286
+ /** @description Present when an org admin must approve the GitHub App install request. */
2287
+ pendingApproval?: components["schemas"]["GithubPendingApprovalDto"] | null;
2242
2288
  installationId?: string | null;
2243
2289
  account?: components["schemas"]["GithubAccountDto"] | null;
2244
2290
  /** @description Paginated merged installation repositories when `installed` is true. */
@@ -2534,6 +2580,39 @@ export interface components {
2534
2580
  ReadinessFixListDto: components["schemas"]["PageMetaDto"] & {
2535
2581
  items: components["schemas"]["FixRequestDto"][];
2536
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
+ };
2537
2616
  AgenticFoundationDimensionAggregateDto: {
2538
2617
  dimensionId: components["schemas"]["ReadinessDimensionId"];
2539
2618
  /** @description Mean dimension score percent across repos with maxScore > 0. */
@@ -2991,6 +3070,7 @@ export type AiUsageSpendContributorToolHeatmapDto = components['schemas']['AiUsa
2991
3070
  export type AiUsageSpendKeyInsightItemDto = components['schemas']['AiUsageSpendKeyInsightItemDto'];
2992
3071
  export type AiUsageSpendKeyInsightsDto = components['schemas']['AiUsageSpendKeyInsightsDto'];
2993
3072
  export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDataQuality'];
3073
+ export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
2994
3074
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
2995
3075
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
2996
3076
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
@@ -3009,6 +3089,7 @@ export type GithubAccountDto = components['schemas']['GithubAccountDto'];
3009
3089
  export type GithubInstalledRepoDto = components['schemas']['GithubInstalledRepoDto'];
3010
3090
  export type GithubMissingPermissionDto = components['schemas']['GithubMissingPermissionDto'];
3011
3091
  export type GithubInstallationSummaryDto = components['schemas']['GithubInstallationSummaryDto'];
3092
+ export type GithubPendingApprovalDto = components['schemas']['GithubPendingApprovalDto'];
3012
3093
  export type GithubInstallationStatusDto = components['schemas']['GithubInstallationStatusDto'];
3013
3094
  export type GithubInstallUrlRequestDto = components['schemas']['GithubInstallUrlRequestDto'];
3014
3095
  export type GithubInstallUrlResponseDto = components['schemas']['GithubInstallUrlResponseDto'];
@@ -3044,6 +3125,10 @@ export type AgenticFoundationDashboardSummaryDto = components['schemas']['Agenti
3044
3125
  export type PageMetaDto = components['schemas']['PageMetaDto'];
3045
3126
  export type ReadinessRepoListDto = components['schemas']['ReadinessRepoListDto'];
3046
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'];
3047
3132
  export type AgenticFoundationDimensionAggregateDto = components['schemas']['AgenticFoundationDimensionAggregateDto'];
3048
3133
  export type ReadinessFixStatusSummaryDto = components['schemas']['ReadinessFixStatusSummaryDto'];
3049
3134
  export type GithubInstalledRepoListDto = components['schemas']['GithubInstalledRepoListDto'];
@@ -5468,6 +5553,61 @@ export interface operations {
5468
5553
  };
5469
5554
  };
5470
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
+ };
5471
5611
  getReadinessScoreHistory: {
5472
5612
  parameters: {
5473
5613
  query?: {