@thinkai/tai-api-contract 2.120.0 → 2.123.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.
@@ -1109,6 +1109,26 @@ export interface paths {
1109
1109
  patch?: never;
1110
1110
  trace?: never;
1111
1111
  };
1112
+ "/workspaces/{workspaceId}/ingest/sdlc/rollups/rebuild": {
1113
+ parameters: {
1114
+ query?: never;
1115
+ header?: never;
1116
+ path?: never;
1117
+ cookie?: never;
1118
+ };
1119
+ get?: never;
1120
+ put?: never;
1121
+ /**
1122
+ * Rebuild SDLC DORA/CI daily rollups for a day range
1123
+ * @description Queues a rebuild of DORA/CI daily rollups for this workspace from stored dashboard productivity history for the inclusive `from`/`to` UTC day range (max 90 days). Does not re-pull GitHub. Returns immediately with `{ ok: true }` while the rebuild runs under an advisory lock; ingest-coverage reports `sdlc_github` as `in_progress` until the lock is released. Returns 409 when another rebuild holds the advisory lock.
1124
+ */
1125
+ post: operations["rebuildSdlcRollups"];
1126
+ delete?: never;
1127
+ options?: never;
1128
+ head?: never;
1129
+ patch?: never;
1130
+ trace?: never;
1131
+ };
1112
1132
  "/workspaces/{workspaceId}/insights/sdlc/overview": {
1113
1133
  parameters: {
1114
1134
  query?: never;
@@ -1629,7 +1649,7 @@ export interface paths {
1629
1649
  put?: never;
1630
1650
  /**
1631
1651
  * Refresh AI tool integration snapshots
1632
- * @description Provider-agnostic refresh. Returns 409 when an advisory-lock refresh is already in progress. On upstream auth/rate/network failures, returns `200` with `{ ok:false, error }` so the SPA can render inline error. Pass `full=true` to force a full re-sync that re-pulls the full history instead of the incremental window, used to backfill historical months. Provider-specific behavior: Claude Enterprise re-pulls six calendar months of daily usage; Claude Team widens its daily-usage window to the configured history depth (`spendHistoryDays`, default 180 days); Cursor resets its spend/model/daily backfill cursors so the full `spendHistoryDays` window re-ingests from the retention floor even when the backfill was already complete. Omitted/false performs a normal incremental refresh.
1652
+ * @description Provider-agnostic refresh. Queues work for `ai-tool-refresher` and returns immediately with `{ ok: true }` when accepted. Progress is visible via ingest-coverage (`ai.refreshInProgress`) and the provider status endpoint while the on-demand flag (or advisory lock) is held. Returns 409 when an advisory-lock refresh is already in progress. Returns 404 when the provider source is missing. Pass `full=true` to force a full re-sync that re-pulls the full history instead of the incremental window, used to backfill historical months. Provider-specific behavior: Claude Enterprise re-pulls six calendar months of daily usage; Claude Team widens its daily-usage window to the configured history depth (`spendHistoryDays`, default 180 days); Cursor resets its spend/model/daily backfill cursors so the full `spendHistoryDays` window re-ingests from the retention floor even when the backfill was already complete. Omitted/false performs a normal incremental refresh. Pass `from` and `to` (UTC `YYYY-MM-DD`) together to re-ingest only that inclusive day range without resetting incremental watermarks; mutually exclusive with `full`. Day-range behavior is provider-specific: all providers re-pull generic daily usage for the window (Cursor does this via the spend-daily path instead of a duplicate top-level poll); Cursor additionally re-ingests spend/model daily for the window without resetting backfill cursors. Claude Enterprise model/product/engagement ingest paths are not day-range scoped and continue to use their normal refresh windows.
1633
1653
  */
1634
1654
  post: operations["refreshWorkspaceAiTool"];
1635
1655
  delete?: never;
@@ -13001,6 +13021,93 @@ export interface operations {
13001
13021
  };
13002
13022
  };
13003
13023
  };
13024
+ rebuildSdlcRollups: {
13025
+ parameters: {
13026
+ query: {
13027
+ /** @description Inclusive UTC start day (`YYYY-MM-DD`). */
13028
+ from: string;
13029
+ /** @description Inclusive UTC end day (`YYYY-MM-DD`). */
13030
+ to: string;
13031
+ };
13032
+ header?: never;
13033
+ path: {
13034
+ workspaceId: components["parameters"]["WorkspaceId"];
13035
+ };
13036
+ cookie?: never;
13037
+ };
13038
+ requestBody?: never;
13039
+ responses: {
13040
+ /** @description Rebuild accepted and running asynchronously */
13041
+ 200: {
13042
+ headers: {
13043
+ [name: string]: unknown;
13044
+ };
13045
+ content: {
13046
+ /**
13047
+ * @example {
13048
+ * "ok": true
13049
+ * }
13050
+ */
13051
+ "application/json": {
13052
+ /** @enum {boolean} */
13053
+ ok: true;
13054
+ /** @description Optional. Omitted when the rebuild is queued asynchronously (current behavior). */
13055
+ rollupRows?: number;
13056
+ };
13057
+ };
13058
+ };
13059
+ /** @description Invalid range. Stable `error` codes: `invalid_day_range` (missing pair, bad calendar date, or from > to) and `range_too_large` (more than 90 days). */
13060
+ 400: {
13061
+ headers: {
13062
+ [name: string]: unknown;
13063
+ };
13064
+ content: {
13065
+ "application/json": {
13066
+ /** @enum {boolean} */
13067
+ ok: false;
13068
+ /** @enum {string} */
13069
+ error: "invalid_day_range" | "range_too_large";
13070
+ };
13071
+ };
13072
+ };
13073
+ 401: components["responses"]["Unauthorized"];
13074
+ 403: components["responses"]["Forbidden"];
13075
+ /** @description Feature off or no dashboard metrics source. Stable `error` codes: `feature_off`, `no_source`. */
13076
+ 404: {
13077
+ headers: {
13078
+ [name: string]: unknown;
13079
+ };
13080
+ content: {
13081
+ "application/json": {
13082
+ /** @enum {boolean} */
13083
+ ok: false;
13084
+ /** @enum {string} */
13085
+ error: "feature_off" | "no_source";
13086
+ };
13087
+ };
13088
+ };
13089
+ /** @description Rebuild already in progress */
13090
+ 409: {
13091
+ headers: {
13092
+ [name: string]: unknown;
13093
+ };
13094
+ content: {
13095
+ /**
13096
+ * @example {
13097
+ * "ok": false,
13098
+ * "error": "already_in_progress"
13099
+ * }
13100
+ */
13101
+ "application/json": {
13102
+ /** @enum {boolean} */
13103
+ ok: false;
13104
+ /** @enum {string} */
13105
+ error: "already_in_progress";
13106
+ };
13107
+ };
13108
+ };
13109
+ };
13110
+ };
13004
13111
  getSdlcInsightsOverview: {
13005
13112
  parameters: {
13006
13113
  query?: {
@@ -14419,6 +14526,10 @@ export interface operations {
14419
14526
  query?: {
14420
14527
  /** @description Force a full history re-sync instead of the incremental window (Enterprise: 6 months; Team: `spendHistoryDays`-day daily-usage window; Cursor: spend/model/daily backfill reset over `spendHistoryDays`). Truthy only for `true` or `1`. */
14421
14528
  full?: "true" | "1";
14529
+ /** @description Inclusive UTC start day (`YYYY-MM-DD`) for a targeted re-ingest window. Must be paired with `to`. Mutually exclusive with `full`. Clamped to the configured retention floor (`spendHistoryDays`). Cursor also re-ingests spend/model daily for the window; Claude Enterprise model/product/engagement paths are not day-range scoped. */
14530
+ from?: string;
14531
+ /** @description Inclusive UTC end day (`YYYY-MM-DD`) for a targeted re-ingest window. Must be paired with `from`. Mutually exclusive with `full`. */
14532
+ to?: string;
14422
14533
  };
14423
14534
  header?: never;
14424
14535
  path: {
@@ -14429,7 +14540,7 @@ export interface operations {
14429
14540
  };
14430
14541
  requestBody?: never;
14431
14542
  responses: {
14432
- /** @description Refresh result */
14543
+ /** @description Refresh accepted and queued for `ai-tool-refresher`. Upstream auth/rate/network failures are reported later via refresh status / ingest-coverage, not on this response. */
14433
14544
  200: {
14434
14545
  headers: {
14435
14546
  [name: string]: unknown;
@@ -14438,6 +14549,15 @@ export interface operations {
14438
14549
  "application/json": components["schemas"]["AiToolRefreshResponseDto"];
14439
14550
  };
14440
14551
  };
14552
+ /** @description Invalid request. Stable `error` codes: `invalid_day_range` (missing pair, bad calendar date, or from > to), `full_and_day_range_conflict` (`full` combined with `from`/`to`), and `invalid_provider` (path provider is not a supported AI-tool integration id). */
14553
+ 400: {
14554
+ headers: {
14555
+ [name: string]: unknown;
14556
+ };
14557
+ content: {
14558
+ "application/json": components["schemas"]["AiToolRefreshResponseDto"];
14559
+ };
14560
+ };
14441
14561
  401: components["responses"]["Unauthorized"];
14442
14562
  403: components["responses"]["Forbidden"];
14443
14563
  /** @description Provider source missing for this workspace */
@@ -14455,7 +14575,7 @@ export interface operations {
14455
14575
  "application/json": components["schemas"]["AiToolRefreshResponseDto"];
14456
14576
  };
14457
14577
  };
14458
- /** @description Refresh already in progress */
14578
+ /** @description Refresh already in progress — advisory lock held, or an on-demand refresh is already queued for this workspace/provider. */
14459
14579
  409: {
14460
14580
  headers: {
14461
14581
  [name: string]: unknown;