@thinkai/tai-api-contract 2.5.17 → 2.7.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
@@ -3,6 +3,8 @@
3
3
  * The ONLY package the frontend may import.
4
4
  */
5
5
 
6
+ import type { AgenticFoundationDashboardDto } from "./generated/openapi.js";
7
+
6
8
  /** Run metadata (window, ruleset, created). M5.4: optional tenantId, personId. */
7
9
  export interface RunMetadataDto {
8
10
  runId: string;
@@ -287,6 +289,8 @@ export interface DashboardProductivityMetricsDto {
287
289
  velocity?: {
288
290
  avgFirstCommitToPrDays?: number;
289
291
  prsPerDeveloperPerWeek?: number;
292
+ /** Raw merged PR count in the metrics window (all scopes). */
293
+ mergedPrCount?: number;
290
294
  avgPrMergeTimeHours?: number;
291
295
  };
292
296
  quality?: {
@@ -470,6 +474,10 @@ export interface ProductivityInsightsMergedPrContributorRowDto {
470
474
  personId: string;
471
475
  personName: string;
472
476
  teamName?: string;
477
+ /** True when the contributor is a GitHub login not mapped in the org chart. */
478
+ notInOrgChart?: boolean;
479
+ /** GitHub login for unattributed contributors (`notInOrgChart: true`). */
480
+ githubLogin?: string;
473
481
  weeks: ProductivityInsightsMergedPrTrendWeekDto[];
474
482
  }
475
483
 
@@ -832,4 +840,117 @@ export interface ExportEventsResponseDto {
832
840
  }
833
841
 
834
842
  /** OpenAPI path and operation typings (generated from `openapi/openapi.yaml`). */
835
- export type { paths, operations } from "./generated/openapi.js";
843
+ export type { paths, operations, AgenticFoundationDashboardDto } from "./generated/openapi.js";
844
+
845
+ // ---------------------------------------------------------------------------
846
+ // Your AI Journey — /workspaces/:workspaceId/your-ai-journey/...
847
+ // ---------------------------------------------------------------------------
848
+
849
+ /** One week bucket in the PR-signals time series. */
850
+ export interface YourAiJourneyPrSignalsWeekDto {
851
+ bucketStart: string;
852
+ bucketEnd: string;
853
+ weekLabel: string;
854
+ /** Average PRs per developer per week (from stored metrics). */
855
+ prsPerDeveloperPerWeek: number;
856
+ /** Change failure rate percent (from stored DORA metrics). */
857
+ changeFailureRatePercent: number;
858
+ }
859
+
860
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/pr-signals */
861
+ export interface YourAiJourneyPrSignalsDto {
862
+ workspaceId: string;
863
+ generatedAt: string;
864
+ windowStart: string;
865
+ windowEnd: string;
866
+ weeks: YourAiJourneyPrSignalsWeekDto[];
867
+ summary: {
868
+ avgPrsPerDeveloperPerWeek: number;
869
+ avgFailureRatePercent: number;
870
+ prVelocityDeltaPercent: number;
871
+ };
872
+ }
873
+
874
+ /** One dimension entry in the readiness aggregate. */
875
+ export interface YourAiJourneyReadinessDimensionDto {
876
+ dimensionId: string;
877
+ name: string;
878
+ totalScore: number;
879
+ maxScore: number;
880
+ percent: number;
881
+ }
882
+
883
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/readiness/aggregate */
884
+ export interface YourAiJourneyReadinessAggregateDto {
885
+ workspaceId: string;
886
+ generatedAt: string;
887
+ dimensions: YourAiJourneyReadinessDimensionDto[];
888
+ summary: {
889
+ avgScore: number;
890
+ repoCount: number;
891
+ fixRate: number;
892
+ totalOpenIssues: number;
893
+ totalFixedIssues: number;
894
+ };
895
+ }
896
+
897
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/analytics */
898
+ export interface YourAiJourneyAnalyticsDto {
899
+ workspaceId: string;
900
+ generatedAt: string;
901
+ windowStart: string;
902
+ windowEnd: string;
903
+ journey: {
904
+ completedSteps: string[];
905
+ updatedAt: string | null;
906
+ };
907
+ readiness: {
908
+ avgScore: number;
909
+ repoCount: number;
910
+ fixRate: number;
911
+ totalOpenIssues: number;
912
+ totalFixedIssues: number;
913
+ };
914
+ prSignals: {
915
+ avgPrsPerDeveloperPerWeek: number;
916
+ prVelocityDeltaPercent: number;
917
+ avgFailureRatePercent: number;
918
+ };
919
+ }
920
+
921
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/productivity — same shape as DashboardProductivityDto. */
922
+ export type YourAiJourneyProductivityDto = DashboardProductivityDto;
923
+
924
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/agentic-foundation — same shape as AgenticFoundationDashboardDto. */
925
+ export type YourAiJourneyAgenticFoundationDto = AgenticFoundationDashboardDto;
926
+
927
+ /** One week in the AI spend series. */
928
+ export interface YourAiJourneyAiSpendWeekDto {
929
+ bucketStart: string;
930
+ bucketEnd: string;
931
+ weekLabel: string;
932
+ mergedPrCount: number;
933
+ tokenCount: number;
934
+ }
935
+
936
+ /** Response for GET /workspaces/:workspaceId/your-ai-journey/ai-spend */
937
+ export interface YourAiJourneyAiSpendDto {
938
+ workspaceId: string;
939
+ generatedAt: string;
940
+ windowStart: string;
941
+ windowEnd: string;
942
+ totalSpendCents: number;
943
+ totalTokenCount: number;
944
+ activeUsers: number;
945
+ aiAssistedPrRatio: number;
946
+ prThroughputDeltaPercent: number;
947
+ usageDeltaPercent: number;
948
+ weeks: YourAiJourneyAiSpendWeekDto[];
949
+ providers: {
950
+ providerId: string;
951
+ providerName: string;
952
+ tokenCount: number;
953
+ spendCents: number;
954
+ activeUsers: number;
955
+ }[];
956
+ }