@thinkai/tai-api-contract 2.49.0 → 2.50.0-pr.877.6ff333f6

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.
@@ -747,7 +747,7 @@ export interface paths {
747
747
  };
748
748
  /**
749
749
  * AI usage & spend insights — AI-assisted code percentage
750
- * @description Period and weekly AI-assisted code percentage for the Measure **AI-assisted code** card on `/phase-c/c7` and the **AI impact** curve on `/phase-c/c4`. When scoped productivity metrics include `aiAssistedContributionRatioPercent`, values are **measured** from ingest; otherwise the API falls back to token→LOC heuristics and sets `dataQuality` to **estimated**. Clients should not present estimated series as Cursor-measured signal.
750
+ * @description Period and weekly AI-assisted code percentage for the Measure **AI-assisted code** card on `/phase-c/c7` and the **AI impact** curve on `/phase-c/c4`. When engagement daily rows exist for the scope, values are **measured** from Σ `ai_lines_added` ÷ merged-PR lines (`dashboard_metrics`); otherwise the API falls back to token→LOC heuristics and sets `dataQuality` to **estimated**. Clients should not present estimated series as editor-measured signal.
751
751
  */
752
752
  get: operations["getAiUsageSpendAiAssistedCodePercentage"];
753
753
  put?: never;
@@ -758,6 +758,26 @@ export interface paths {
758
758
  patch?: never;
759
759
  trace?: never;
760
760
  };
761
+ "/workspaces/{workspaceId}/insights/ai-usage-spend/provider-engagement-insights": {
762
+ parameters: {
763
+ query?: never;
764
+ header?: never;
765
+ path?: never;
766
+ cookie?: never;
767
+ };
768
+ /**
769
+ * AI usage & spend insights — provider engagement cards
770
+ * @description Provider-specific engagement insight metrics derived from `tai_workspace_ai_tool_engagement_daily` (accepted AI lines, tab completions, suggestion accept rates, Claude Code sessions, etc.). Metrics are **provider- and data-gated**: structurally absent signals render as N/A, not zero. Claude per-user cards require Enterprise Analytics (`insightsPlan` ≠ team).
771
+ */
772
+ get: operations["getAiUsageSpendProviderEngagementInsights"];
773
+ put?: never;
774
+ post?: never;
775
+ delete?: never;
776
+ options?: never;
777
+ head?: never;
778
+ patch?: never;
779
+ trace?: never;
780
+ };
761
781
  "/workspaces/{workspaceId}/insights/ai-usage-spend/ai-tool-usage-spend": {
762
782
  parameters: {
763
783
  query?: never;
@@ -3248,6 +3268,32 @@ export interface components {
3248
3268
  totalSpendCents?: number;
3249
3269
  weeks: components["schemas"]["AiUsageSpendAiAssistedCodeWeekDto"][];
3250
3270
  };
3271
+ /** @enum {string} */
3272
+ ProviderEngagementInsightAvailability: "measured" | "not_applicable";
3273
+ AiUsageSpendProviderEngagementMetricDto: {
3274
+ id: string;
3275
+ label: string;
3276
+ value: number | null;
3277
+ displayValue: string;
3278
+ availability: components["schemas"]["ProviderEngagementInsightAvailability"];
3279
+ unit?: string;
3280
+ methodologyNote?: string;
3281
+ };
3282
+ AiUsageSpendProviderEngagementCardDto: {
3283
+ providerId: string;
3284
+ providerName: string;
3285
+ metrics: components["schemas"]["AiUsageSpendProviderEngagementMetricDto"][];
3286
+ };
3287
+ AiUsageSpendProviderEngagementInsightsDto: {
3288
+ /** Format: uuid */
3289
+ workspaceId: string;
3290
+ /** @enum {string} */
3291
+ range: "4w" | "8w" | "q";
3292
+ scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3293
+ /** Format: date-time */
3294
+ generatedAt: string;
3295
+ providers: components["schemas"]["AiUsageSpendProviderEngagementCardDto"][];
3296
+ };
3251
3297
  AiUsageSpendAiToolUsageSpendProviderItemDto: {
3252
3298
  providerId: string;
3253
3299
  providerName: string;
@@ -5212,6 +5258,10 @@ export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDat
5212
5258
  export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
5213
5259
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
5214
5260
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
5261
+ export type ProviderEngagementInsightAvailability = components['schemas']['ProviderEngagementInsightAvailability'];
5262
+ export type AiUsageSpendProviderEngagementMetricDto = components['schemas']['AiUsageSpendProviderEngagementMetricDto'];
5263
+ export type AiUsageSpendProviderEngagementCardDto = components['schemas']['AiUsageSpendProviderEngagementCardDto'];
5264
+ export type AiUsageSpendProviderEngagementInsightsDto = components['schemas']['AiUsageSpendProviderEngagementInsightsDto'];
5215
5265
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
5216
5266
  export type AiUsageSpendAiToolUsageSpendModelItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendModelItemDto'];
5217
5267
  export type AiUsageSpendAiToolUsageSpendDto = components['schemas']['AiUsageSpendAiToolUsageSpendDto'];
@@ -7514,6 +7564,58 @@ export interface operations {
7514
7564
  };
7515
7565
  };
7516
7566
  };
7567
+ getAiUsageSpendProviderEngagementInsights: {
7568
+ parameters: {
7569
+ query?: {
7570
+ /** @description Measure time range (maps to weekly bucket count). */
7571
+ rangeId?: "4w" | "8w" | "q";
7572
+ /** @description Department filter; send `All departments` to include every department. Scoped using imported `thinkai_org_structure` members when present, otherwise SPA org chart `department` nodes and their descendant teams. When neither source defines the requested department, insights return no scoped teams or contributors (not org-wide data). */
7573
+ department?: components["parameters"]["InsightsDepartmentFilter"];
7574
+ /** @description Team name filter; send `All teams` to include every team. */
7575
+ team?: string;
7576
+ /** @description ISO timestamp for the end of the last weekly bucket; omit for current week. */
7577
+ windowEnd?: string;
7578
+ };
7579
+ header?: never;
7580
+ path: {
7581
+ workspaceId: components["parameters"]["WorkspaceId"];
7582
+ };
7583
+ cookie?: never;
7584
+ };
7585
+ requestBody?: never;
7586
+ responses: {
7587
+ /** @description Provider engagement insight cards */
7588
+ 200: {
7589
+ headers: {
7590
+ [name: string]: unknown;
7591
+ };
7592
+ content: {
7593
+ "application/json": components["schemas"]["AiUsageSpendProviderEngagementInsightsDto"];
7594
+ };
7595
+ };
7596
+ /** @description Invalid query parameters */
7597
+ 400: {
7598
+ headers: {
7599
+ [name: string]: unknown;
7600
+ };
7601
+ content: {
7602
+ "application/json": {
7603
+ /** @example invalid_query */
7604
+ error: string;
7605
+ };
7606
+ };
7607
+ };
7608
+ 401: components["responses"]["Unauthorized"];
7609
+ 403: components["responses"]["Forbidden"];
7610
+ /** @description Workspace does not exist or malformed workspaceId */
7611
+ 404: {
7612
+ headers: {
7613
+ [name: string]: unknown;
7614
+ };
7615
+ content?: never;
7616
+ };
7617
+ };
7618
+ };
7517
7619
  getAiUsageSpendAiToolUsageSpend: {
7518
7620
  parameters: {
7519
7621
  query?: {