@thinkai/tai-api-contract 2.49.0 → 2.51.0-pr.877.bf4a3821

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;
@@ -3108,6 +3128,25 @@ export interface components {
3108
3128
  githubActionsCiEnabled?: boolean;
3109
3129
  items: components["schemas"]["ProductivityInsightsNeedsAttentionItemDto"][];
3110
3130
  };
3131
+ /**
3132
+ * @description Echo of the resolved time bucket for this response. `day` when the request used an `Nd`/`cr:`/`from`+`to` window; `week` for legacy weekly rangeIds.
3133
+ * @enum {string}
3134
+ */
3135
+ AiUsageSpendGranularity: "day" | "week";
3136
+ /** @description Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. */
3137
+ AiUsageSpendRangeId: string;
3138
+ AiUsageSpendDailyBucketDto: {
3139
+ /**
3140
+ * Format: date
3141
+ * @description UTC calendar day (`YYYY-MM-DD`).
3142
+ */
3143
+ date: string;
3144
+ /** @description Short label for table headers (e.g. MM/DD). */
3145
+ dayLabel?: string;
3146
+ tokenCount: number;
3147
+ spendCents: number;
3148
+ activeUsers: number;
3149
+ };
3111
3150
  AiUsageSpendAggregatedTeamWeekDto: {
3112
3151
  /** Format: date-time */
3113
3152
  bucketStart: string;
@@ -3127,7 +3166,9 @@ export interface components {
3127
3166
  teamName: string;
3128
3167
  headcount: number;
3129
3168
  managerLabel?: string;
3130
- weeks: components["schemas"]["AiUsageSpendAggregatedTeamWeekDto"][];
3169
+ /** @description Present in day-mode responses — daily token, spend, and active-user counts. */
3170
+ days?: components["schemas"]["AiUsageSpendDailyBucketDto"][];
3171
+ weeks?: components["schemas"]["AiUsageSpendAggregatedTeamWeekDto"][];
3131
3172
  };
3132
3173
  AiUsageSpendAggregatedTeamsSummaryDto: {
3133
3174
  totalTokenCount: number;
@@ -3142,8 +3183,18 @@ export interface components {
3142
3183
  AiUsageSpendAggregatedTeamsDto: {
3143
3184
  /** Format: uuid */
3144
3185
  workspaceId: string;
3145
- /** @enum {string} */
3146
- range: "4w" | "8w" | "q";
3186
+ range: components["schemas"]["AiUsageSpendRangeId"];
3187
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3188
+ /**
3189
+ * Format: date
3190
+ * @description Inclusive start day when `granularity` is `day`.
3191
+ */
3192
+ from?: string;
3193
+ /**
3194
+ * Format: date
3195
+ * @description Inclusive end day when `granularity` is `day`.
3196
+ */
3197
+ to?: string;
3147
3198
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3148
3199
  /** Format: date-time */
3149
3200
  generatedAt: string;
@@ -3157,13 +3208,25 @@ export interface components {
3157
3208
  title?: string;
3158
3209
  team?: string;
3159
3210
  department?: string;
3160
- weeks: components["schemas"]["AiUsageSpendAggregatedTeamWeekDto"][];
3211
+ /** @description Present in day-mode responses — daily token, spend, and active-user counts. */
3212
+ days?: components["schemas"]["AiUsageSpendDailyBucketDto"][];
3213
+ weeks?: components["schemas"]["AiUsageSpendAggregatedTeamWeekDto"][];
3161
3214
  };
3162
3215
  AiUsageSpendAggregatedContributorsDto: {
3163
3216
  /** Format: uuid */
3164
3217
  workspaceId: string;
3165
- /** @enum {string} */
3166
- range: "4w" | "8w" | "q";
3218
+ range: components["schemas"]["AiUsageSpendRangeId"];
3219
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3220
+ /**
3221
+ * Format: date
3222
+ * @description Inclusive start day when `granularity` is `day`.
3223
+ */
3224
+ from?: string;
3225
+ /**
3226
+ * Format: date
3227
+ * @description Inclusive end day when `granularity` is `day`.
3228
+ */
3229
+ to?: string;
3167
3230
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3168
3231
  /** Format: date-time */
3169
3232
  generatedAt: string;
@@ -3173,8 +3236,18 @@ export interface components {
3173
3236
  AiUsageSpendContributorToolHeatmapDto: {
3174
3237
  /** Format: uuid */
3175
3238
  workspaceId: string;
3176
- /** @enum {string} */
3177
- range: "4w" | "8w" | "q";
3239
+ range: components["schemas"]["AiUsageSpendRangeId"];
3240
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3241
+ /**
3242
+ * Format: date
3243
+ * @description Inclusive start day when `granularity` is `day`.
3244
+ */
3245
+ from?: string;
3246
+ /**
3247
+ * Format: date
3248
+ * @description Inclusive end day when `granularity` is `day`.
3249
+ */
3250
+ to?: string;
3178
3251
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3179
3252
  /** Format: date-time */
3180
3253
  generatedAt: string;
@@ -3191,8 +3264,18 @@ export interface components {
3191
3264
  AiUsageSpendKeyInsightsDto: {
3192
3265
  /** Format: uuid */
3193
3266
  workspaceId: string;
3194
- /** @enum {string} */
3195
- range: "4w" | "8w" | "q";
3267
+ range: components["schemas"]["AiUsageSpendRangeId"];
3268
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3269
+ /**
3270
+ * Format: date
3271
+ * @description Inclusive start day when `granularity` is `day`.
3272
+ */
3273
+ from?: string;
3274
+ /**
3275
+ * Format: date
3276
+ * @description Inclusive end day when `granularity` is `day`.
3277
+ */
3278
+ to?: string;
3196
3279
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3197
3280
  /** Format: date-time */
3198
3281
  generatedAt: string;
@@ -3208,6 +3291,16 @@ export interface components {
3208
3291
  * @enum {string}
3209
3292
  */
3210
3293
  AiAssistedCodeEstimationSource: "ingest" | "token_volume" | "spend_proxy" | "adoption" | "unavailable";
3294
+ AiUsageSpendAiAssistedCodeDayDto: {
3295
+ /** Format: date */
3296
+ date: string;
3297
+ dayLabel?: string;
3298
+ aiAssistedCodePercent: number;
3299
+ totalLoc: number;
3300
+ aiLoc: number;
3301
+ humanLoc: number;
3302
+ dataQuality: components["schemas"]["AiAssistedCodeDataQuality"];
3303
+ };
3211
3304
  AiUsageSpendAiAssistedCodeWeekDto: {
3212
3305
  /** Format: date-time */
3213
3306
  bucketStart: string;
@@ -3223,8 +3316,18 @@ export interface components {
3223
3316
  AiUsageSpendAiAssistedCodePercentageDto: {
3224
3317
  /** Format: uuid */
3225
3318
  workspaceId: string;
3226
- /** @enum {string} */
3227
- range: "4w" | "8w" | "q";
3319
+ range: components["schemas"]["AiUsageSpendRangeId"];
3320
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3321
+ /**
3322
+ * Format: date
3323
+ * @description Inclusive start day when `granularity` is `day`.
3324
+ */
3325
+ from?: string;
3326
+ /**
3327
+ * Format: date
3328
+ * @description Inclusive end day when `granularity` is `day`.
3329
+ */
3330
+ to?: string;
3228
3331
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3229
3332
  /** Format: date-time */
3230
3333
  generatedAt: string;
@@ -3246,7 +3349,45 @@ export interface components {
3246
3349
  totalTokenCount?: number;
3247
3350
  /** @description Scoped AI-tool spend in cents for the selected period. */
3248
3351
  totalSpendCents?: number;
3249
- weeks: components["schemas"]["AiUsageSpendAiAssistedCodeWeekDto"][];
3352
+ /** @description Present in day-mode responses — daily AI-assisted code share series. */
3353
+ days?: components["schemas"]["AiUsageSpendAiAssistedCodeDayDto"][];
3354
+ weeks?: components["schemas"]["AiUsageSpendAiAssistedCodeWeekDto"][];
3355
+ };
3356
+ /** @enum {string} */
3357
+ ProviderEngagementInsightAvailability: "measured" | "not_applicable";
3358
+ AiUsageSpendProviderEngagementMetricDto: {
3359
+ id: string;
3360
+ label: string;
3361
+ value: number | null;
3362
+ displayValue: string;
3363
+ availability: components["schemas"]["ProviderEngagementInsightAvailability"];
3364
+ unit?: string;
3365
+ methodologyNote?: string;
3366
+ };
3367
+ AiUsageSpendProviderEngagementCardDto: {
3368
+ providerId: string;
3369
+ providerName: string;
3370
+ metrics: components["schemas"]["AiUsageSpendProviderEngagementMetricDto"][];
3371
+ };
3372
+ AiUsageSpendProviderEngagementInsightsDto: {
3373
+ /** Format: uuid */
3374
+ workspaceId: string;
3375
+ range: components["schemas"]["AiUsageSpendRangeId"];
3376
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3377
+ /**
3378
+ * Format: date
3379
+ * @description Inclusive start day when `granularity` is `day`.
3380
+ */
3381
+ from?: string;
3382
+ /**
3383
+ * Format: date
3384
+ * @description Inclusive end day when `granularity` is `day`.
3385
+ */
3386
+ to?: string;
3387
+ scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3388
+ /** Format: date-time */
3389
+ generatedAt: string;
3390
+ providers: components["schemas"]["AiUsageSpendProviderEngagementCardDto"][];
3250
3391
  };
3251
3392
  AiUsageSpendAiToolUsageSpendProviderItemDto: {
3252
3393
  providerId: string;
@@ -3265,8 +3406,18 @@ export interface components {
3265
3406
  AiUsageSpendAiToolUsageSpendDto: {
3266
3407
  /** Format: uuid */
3267
3408
  workspaceId: string;
3268
- /** @enum {string} */
3269
- range: "4w" | "8w" | "q";
3409
+ range: components["schemas"]["AiUsageSpendRangeId"];
3410
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3411
+ /**
3412
+ * Format: date
3413
+ * @description Inclusive start day when `granularity` is `day`.
3414
+ */
3415
+ from?: string;
3416
+ /**
3417
+ * Format: date
3418
+ * @description Inclusive end day when `granularity` is `day`.
3419
+ */
3420
+ to?: string;
3270
3421
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3271
3422
  /** Format: date-time */
3272
3423
  generatedAt: string;
@@ -3277,13 +3428,30 @@ export interface components {
3277
3428
  AiUsageSpendTeamToolHeatmapDto: {
3278
3429
  /** Format: uuid */
3279
3430
  workspaceId: string;
3280
- /** @enum {string} */
3281
- range: "4w" | "8w" | "q";
3431
+ range: components["schemas"]["AiUsageSpendRangeId"];
3432
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3433
+ /**
3434
+ * Format: date
3435
+ * @description Inclusive start day when `granularity` is `day`.
3436
+ */
3437
+ from?: string;
3438
+ /**
3439
+ * Format: date
3440
+ * @description Inclusive end day when `granularity` is `day`.
3441
+ */
3442
+ to?: string;
3282
3443
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3283
3444
  /** Format: date-time */
3284
3445
  generatedAt: string;
3285
3446
  teams: components["schemas"]["AiUsageSpendAggregatedTeamRowDto"][];
3286
3447
  };
3448
+ AiUsageSpendRoiProductivitySignalDayDto: {
3449
+ /** Format: date */
3450
+ date: string;
3451
+ dayLabel?: string;
3452
+ mergedPrCount: number;
3453
+ tokenCount: number;
3454
+ };
3287
3455
  AiUsageSpendRoiProductivitySignalWeekDto: {
3288
3456
  /** Format: date-time */
3289
3457
  bucketStart: string;
@@ -3298,8 +3466,18 @@ export interface components {
3298
3466
  AiUsageSpendRoiProductivitySignalDto: {
3299
3467
  /** Format: uuid */
3300
3468
  workspaceId: string;
3301
- /** @enum {string} */
3302
- range: "4w" | "8w" | "q";
3469
+ range: components["schemas"]["AiUsageSpendRangeId"];
3470
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3471
+ /**
3472
+ * Format: date
3473
+ * @description Inclusive start day when `granularity` is `day`.
3474
+ */
3475
+ from?: string;
3476
+ /**
3477
+ * Format: date
3478
+ * @description Inclusive end day when `granularity` is `day`.
3479
+ */
3480
+ to?: string;
3303
3481
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3304
3482
  /** Format: date-time */
3305
3483
  generatedAt: string;
@@ -3313,7 +3491,16 @@ export interface components {
3313
3491
  prThroughputDeltaPercent: number;
3314
3492
  /** @description Percent change in token usage (recent half vs prior half of range). */
3315
3493
  usageDeltaPercent: number;
3316
- weeks: components["schemas"]["AiUsageSpendRoiProductivitySignalWeekDto"][];
3494
+ /** @description Present in day-mode responses — daily merged PR and token counts. */
3495
+ days?: components["schemas"]["AiUsageSpendRoiProductivitySignalDayDto"][];
3496
+ weeks?: components["schemas"]["AiUsageSpendRoiProductivitySignalWeekDto"][];
3497
+ };
3498
+ AiUsageSpendUsageTrendsProviderDayDto: {
3499
+ providerId: string;
3500
+ providerName: string;
3501
+ spendCents: number;
3502
+ tokenCount: number;
3503
+ activeUsers: number;
3317
3504
  };
3318
3505
  AiUsageSpendUsageTrendsProviderWeekDto: {
3319
3506
  providerId: string;
@@ -3322,6 +3509,12 @@ export interface components {
3322
3509
  tokenCount: number;
3323
3510
  activeUsers: number;
3324
3511
  };
3512
+ AiUsageSpendUsageTrendsDayDto: {
3513
+ /** Format: date */
3514
+ date: string;
3515
+ dayLabel?: string;
3516
+ providers: components["schemas"]["AiUsageSpendUsageTrendsProviderDayDto"][];
3517
+ };
3325
3518
  AiUsageSpendUsageTrendsWeekDto: {
3326
3519
  /** Format: date-time */
3327
3520
  bucketStart: string;
@@ -3333,12 +3526,24 @@ export interface components {
3333
3526
  AiUsageSpendUsageTrendsDto: {
3334
3527
  /** Format: uuid */
3335
3528
  workspaceId: string;
3336
- /** @enum {string} */
3337
- range: "4w" | "8w" | "q";
3529
+ range: components["schemas"]["AiUsageSpendRangeId"];
3530
+ granularity?: components["schemas"]["AiUsageSpendGranularity"];
3531
+ /**
3532
+ * Format: date
3533
+ * @description Inclusive start day when `granularity` is `day`.
3534
+ */
3535
+ from?: string;
3536
+ /**
3537
+ * Format: date
3538
+ * @description Inclusive end day when `granularity` is `day`.
3539
+ */
3540
+ to?: string;
3338
3541
  scope: components["schemas"]["ProductivityInsightsAggregatedTeamsScopeDto"];
3339
3542
  /** Format: date-time */
3340
3543
  generatedAt: string;
3341
- weeks: components["schemas"]["AiUsageSpendUsageTrendsWeekDto"][];
3544
+ /** @description Present in day-mode responses — per-provider spend and usage by day. */
3545
+ days?: components["schemas"]["AiUsageSpendUsageTrendsDayDto"][];
3546
+ weeks?: components["schemas"]["AiUsageSpendUsageTrendsWeekDto"][];
3342
3547
  };
3343
3548
  AiToolMemberSummaryDto: {
3344
3549
  externalId: string;
@@ -5199,6 +5404,9 @@ export type ProductivityInsightsContributorActivitySummaryDto = components['sche
5199
5404
  export type ProductivityInsightsContributorDetailDto = components['schemas']['ProductivityInsightsContributorDetailDto'];
5200
5405
  export type ProductivityInsightsNeedsAttentionItemDto = components['schemas']['ProductivityInsightsNeedsAttentionItemDto'];
5201
5406
  export type ProductivityInsightsNeedsAttentionDto = components['schemas']['ProductivityInsightsNeedsAttentionDto'];
5407
+ export type AiUsageSpendGranularity = components['schemas']['AiUsageSpendGranularity'];
5408
+ export type AiUsageSpendRangeId = components['schemas']['AiUsageSpendRangeId'];
5409
+ export type AiUsageSpendDailyBucketDto = components['schemas']['AiUsageSpendDailyBucketDto'];
5202
5410
  export type AiUsageSpendAggregatedTeamWeekDto = components['schemas']['AiUsageSpendAggregatedTeamWeekDto'];
5203
5411
  export type AiUsageSpendAggregatedTeamRowDto = components['schemas']['AiUsageSpendAggregatedTeamRowDto'];
5204
5412
  export type AiUsageSpendAggregatedTeamsSummaryDto = components['schemas']['AiUsageSpendAggregatedTeamsSummaryDto'];
@@ -5210,15 +5418,23 @@ export type AiUsageSpendKeyInsightItemDto = components['schemas']['AiUsageSpendK
5210
5418
  export type AiUsageSpendKeyInsightsDto = components['schemas']['AiUsageSpendKeyInsightsDto'];
5211
5419
  export type AiAssistedCodeDataQuality = components['schemas']['AiAssistedCodeDataQuality'];
5212
5420
  export type AiAssistedCodeEstimationSource = components['schemas']['AiAssistedCodeEstimationSource'];
5421
+ export type AiUsageSpendAiAssistedCodeDayDto = components['schemas']['AiUsageSpendAiAssistedCodeDayDto'];
5213
5422
  export type AiUsageSpendAiAssistedCodeWeekDto = components['schemas']['AiUsageSpendAiAssistedCodeWeekDto'];
5214
5423
  export type AiUsageSpendAiAssistedCodePercentageDto = components['schemas']['AiUsageSpendAiAssistedCodePercentageDto'];
5424
+ export type ProviderEngagementInsightAvailability = components['schemas']['ProviderEngagementInsightAvailability'];
5425
+ export type AiUsageSpendProviderEngagementMetricDto = components['schemas']['AiUsageSpendProviderEngagementMetricDto'];
5426
+ export type AiUsageSpendProviderEngagementCardDto = components['schemas']['AiUsageSpendProviderEngagementCardDto'];
5427
+ export type AiUsageSpendProviderEngagementInsightsDto = components['schemas']['AiUsageSpendProviderEngagementInsightsDto'];
5215
5428
  export type AiUsageSpendAiToolUsageSpendProviderItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendProviderItemDto'];
5216
5429
  export type AiUsageSpendAiToolUsageSpendModelItemDto = components['schemas']['AiUsageSpendAiToolUsageSpendModelItemDto'];
5217
5430
  export type AiUsageSpendAiToolUsageSpendDto = components['schemas']['AiUsageSpendAiToolUsageSpendDto'];
5218
5431
  export type AiUsageSpendTeamToolHeatmapDto = components['schemas']['AiUsageSpendTeamToolHeatmapDto'];
5432
+ export type AiUsageSpendRoiProductivitySignalDayDto = components['schemas']['AiUsageSpendRoiProductivitySignalDayDto'];
5219
5433
  export type AiUsageSpendRoiProductivitySignalWeekDto = components['schemas']['AiUsageSpendRoiProductivitySignalWeekDto'];
5220
5434
  export type AiUsageSpendRoiProductivitySignalDto = components['schemas']['AiUsageSpendRoiProductivitySignalDto'];
5435
+ export type AiUsageSpendUsageTrendsProviderDayDto = components['schemas']['AiUsageSpendUsageTrendsProviderDayDto'];
5221
5436
  export type AiUsageSpendUsageTrendsProviderWeekDto = components['schemas']['AiUsageSpendUsageTrendsProviderWeekDto'];
5437
+ export type AiUsageSpendUsageTrendsDayDto = components['schemas']['AiUsageSpendUsageTrendsDayDto'];
5222
5438
  export type AiUsageSpendUsageTrendsWeekDto = components['schemas']['AiUsageSpendUsageTrendsWeekDto'];
5223
5439
  export type AiUsageSpendUsageTrendsDto = components['schemas']['AiUsageSpendUsageTrendsDto'];
5224
5440
  export type AiToolMemberSummaryDto = components['schemas']['AiToolMemberSummaryDto'];
@@ -7257,8 +7473,12 @@ export interface operations {
7257
7473
  getAiUsageSpendAggregatedTeams: {
7258
7474
  parameters: {
7259
7475
  query?: {
7260
- /** @description Measure time range (maps to weekly bucket count). */
7261
- rangeId?: "4w" | "8w" | "q";
7476
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7477
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7478
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7479
+ from?: components["parameters"]["InsightsProductivityFrom"];
7480
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7481
+ to?: components["parameters"]["InsightsProductivityTo"];
7262
7482
  /** @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). */
7263
7483
  department?: components["parameters"]["InsightsDepartmentFilter"];
7264
7484
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7309,8 +7529,12 @@ export interface operations {
7309
7529
  getAiUsageSpendAggregatedContributors: {
7310
7530
  parameters: {
7311
7531
  query?: {
7312
- /** @description Measure time range (maps to weekly bucket count). */
7313
- rangeId?: "4w" | "8w" | "q";
7532
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7533
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7534
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7535
+ from?: components["parameters"]["InsightsProductivityFrom"];
7536
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7537
+ to?: components["parameters"]["InsightsProductivityTo"];
7314
7538
  /** @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). */
7315
7539
  department?: components["parameters"]["InsightsDepartmentFilter"];
7316
7540
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7361,8 +7585,12 @@ export interface operations {
7361
7585
  getAiUsageSpendContributorToolHeatmap: {
7362
7586
  parameters: {
7363
7587
  query?: {
7364
- /** @description Measure time range (maps to weekly bucket count). */
7365
- rangeId?: "4w" | "8w" | "q";
7588
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7589
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7590
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7591
+ from?: components["parameters"]["InsightsProductivityFrom"];
7592
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7593
+ to?: components["parameters"]["InsightsProductivityTo"];
7366
7594
  /** @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). */
7367
7595
  department?: components["parameters"]["InsightsDepartmentFilter"];
7368
7596
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7413,8 +7641,12 @@ export interface operations {
7413
7641
  getAiUsageSpendKeyInsights: {
7414
7642
  parameters: {
7415
7643
  query?: {
7416
- /** @description Measure time range (maps to weekly bucket count). */
7417
- rangeId?: "4w" | "8w" | "q";
7644
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7645
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7646
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7647
+ from?: components["parameters"]["InsightsProductivityFrom"];
7648
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7649
+ to?: components["parameters"]["InsightsProductivityTo"];
7418
7650
  /** @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). */
7419
7651
  department?: components["parameters"]["InsightsDepartmentFilter"];
7420
7652
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7465,8 +7697,12 @@ export interface operations {
7465
7697
  getAiUsageSpendAiAssistedCodePercentage: {
7466
7698
  parameters: {
7467
7699
  query?: {
7468
- /** @description Measure time range (maps to weekly bucket count). */
7469
- rangeId?: "4w" | "8w" | "q";
7700
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7701
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7702
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7703
+ from?: components["parameters"]["InsightsProductivityFrom"];
7704
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7705
+ to?: components["parameters"]["InsightsProductivityTo"];
7470
7706
  /** @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). */
7471
7707
  department?: components["parameters"]["InsightsDepartmentFilter"];
7472
7708
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7514,11 +7750,77 @@ export interface operations {
7514
7750
  };
7515
7751
  };
7516
7752
  };
7753
+ getAiUsageSpendProviderEngagementInsights: {
7754
+ parameters: {
7755
+ query?: {
7756
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7757
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7758
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7759
+ from?: components["parameters"]["InsightsProductivityFrom"];
7760
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7761
+ to?: components["parameters"]["InsightsProductivityTo"];
7762
+ /** @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). */
7763
+ department?: components["parameters"]["InsightsDepartmentFilter"];
7764
+ /** @description Team name filter; send `All teams` to include every team. */
7765
+ team?: string;
7766
+ /** @description ISO timestamp for the end of the last weekly bucket; omit for current week. */
7767
+ windowEnd?: string;
7768
+ /** @description When set, aggregate engagement metrics for a single AI-tool member (user detail pages). Mutually exclusive with `scopeTeamId`. */
7769
+ memberExternalId?: string;
7770
+ /** @description Org-chart team id — aggregate engagement for members mapped to that team (team detail pages). Mutually exclusive with `memberExternalId`. */
7771
+ scopeTeamId?: string;
7772
+ /** @description Optional provider id filter (`cursor`, `claude`) for detail pages. */
7773
+ provider?: "cursor" | "claude";
7774
+ };
7775
+ header?: never;
7776
+ path: {
7777
+ workspaceId: components["parameters"]["WorkspaceId"];
7778
+ };
7779
+ cookie?: never;
7780
+ };
7781
+ requestBody?: never;
7782
+ responses: {
7783
+ /** @description Provider engagement insight cards */
7784
+ 200: {
7785
+ headers: {
7786
+ [name: string]: unknown;
7787
+ };
7788
+ content: {
7789
+ "application/json": components["schemas"]["AiUsageSpendProviderEngagementInsightsDto"];
7790
+ };
7791
+ };
7792
+ /** @description Invalid query parameters */
7793
+ 400: {
7794
+ headers: {
7795
+ [name: string]: unknown;
7796
+ };
7797
+ content: {
7798
+ "application/json": {
7799
+ /** @example invalid_query */
7800
+ error: string;
7801
+ };
7802
+ };
7803
+ };
7804
+ 401: components["responses"]["Unauthorized"];
7805
+ 403: components["responses"]["Forbidden"];
7806
+ /** @description Workspace does not exist or malformed workspaceId */
7807
+ 404: {
7808
+ headers: {
7809
+ [name: string]: unknown;
7810
+ };
7811
+ content?: never;
7812
+ };
7813
+ };
7814
+ };
7517
7815
  getAiUsageSpendAiToolUsageSpend: {
7518
7816
  parameters: {
7519
7817
  query?: {
7520
- /** @description Measure time range (maps to weekly bucket count). */
7521
- rangeId?: "4w" | "8w" | "q";
7818
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7819
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7820
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7821
+ from?: components["parameters"]["InsightsProductivityFrom"];
7822
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7823
+ to?: components["parameters"]["InsightsProductivityTo"];
7522
7824
  /** @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). */
7523
7825
  department?: components["parameters"]["InsightsDepartmentFilter"];
7524
7826
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7569,8 +7871,12 @@ export interface operations {
7569
7871
  getAiUsageSpendTeamToolHeatmap: {
7570
7872
  parameters: {
7571
7873
  query?: {
7572
- /** @description Measure time range (maps to weekly bucket count). */
7573
- rangeId?: "4w" | "8w" | "q";
7874
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7875
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7876
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7877
+ from?: components["parameters"]["InsightsProductivityFrom"];
7878
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7879
+ to?: components["parameters"]["InsightsProductivityTo"];
7574
7880
  /** @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). */
7575
7881
  department?: components["parameters"]["InsightsDepartmentFilter"];
7576
7882
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7621,8 +7927,12 @@ export interface operations {
7621
7927
  getAiUsageSpendRoiProductivitySignal: {
7622
7928
  parameters: {
7623
7929
  query?: {
7624
- /** @description Measure time range (maps to weekly bucket count). */
7625
- rangeId?: "4w" | "8w" | "q";
7930
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7931
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7932
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7933
+ from?: components["parameters"]["InsightsProductivityFrom"];
7934
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7935
+ to?: components["parameters"]["InsightsProductivityTo"];
7626
7936
  /** @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). */
7627
7937
  department?: components["parameters"]["InsightsDepartmentFilter"];
7628
7938
  /** @description Team name filter; send `All teams` to include every team. */
@@ -7673,8 +7983,12 @@ export interface operations {
7673
7983
  getAiUsageSpendUsageTrends: {
7674
7984
  parameters: {
7675
7985
  query?: {
7676
- /** @description Measure time range (maps to weekly bucket count). */
7677
- rangeId?: "4w" | "8w" | "q";
7986
+ /** @description Productivity insights time range. Daily windows: `7d`, `30d`, `90d`, `180d`, or custom `cr:YYYY-MM-DD:YYYY-MM-DD`. Weekly legacy: `4w`, `8w`, `q` (12 weeks), `12w`, `16w`. Omit when using explicit `from`/`to` day bounds. */
7987
+ rangeId?: components["parameters"]["InsightsProductivityRangeId"];
7988
+ /** @description Inclusive start of a daily window (`YYYY-MM-DD`). When set with `to`, overrides `rangeId` for day-mode responses (max 180 days). */
7989
+ from?: components["parameters"]["InsightsProductivityFrom"];
7990
+ /** @description Inclusive end of a daily window (`YYYY-MM-DD`). When set with `from`, overrides `rangeId` for day-mode responses (max 180 days). */
7991
+ to?: components["parameters"]["InsightsProductivityTo"];
7678
7992
  /** @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). */
7679
7993
  department?: components["parameters"]["InsightsDepartmentFilter"];
7680
7994
  /** @description Team name filter; send `All teams` to include every team. */