@thinkai/tai-api-contract 2.131.0 → 2.133.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.
@@ -1543,7 +1543,7 @@ export interface paths {
1543
1543
  };
1544
1544
  /**
1545
1545
  * GitHub App installation status for workspace
1546
- * @description Returns whether a GitHub App installation is linked and cached repo metadata. When no installation exists, returns 200 with `installed: false` (never 404 for missing install). Use `refresh=true` to bypass cache and re-list repositories from GitHub, and to run inline productivity ingest (`on_demand`) for the current UTC week when backfill phase is `complete`.
1546
+ * @description Returns whether a GitHub App installation is linked and cached repo metadata. When no installation exists, returns 200 with `installed: false` (never 404 for missing install). Use `refresh=true` to bypass cache and re-list repositories from GitHub, and to run inline productivity ingest (`on_demand`) for the current UTC week.
1547
1547
  */
1548
1548
  get: operations["getWorkspaceGithubInstallationStatus"];
1549
1549
  put?: never;
@@ -4123,7 +4123,7 @@ export interface paths {
4123
4123
  };
4124
4124
  /**
4125
4125
  * Ingest / backfill data coverage
4126
- * @description Read-only snapshot of historical ingest coverage for connected pipelines (productivity GitHub, AI usage/spend per provider, SDLC components, monitoring, HRIS). Aggregates existing watermarks and stored day/week evidence — does not trigger ingest or refresh. Requires workspace membership. Disconnected sources are omitted.
4126
+ * @description Read-only snapshot of historical ingest coverage for connected pipelines (productivity GitHub, AI usage/spend per provider, SDLC components, monitoring, HRIS). Aggregates existing watermarks and stored day/week evidence — does not trigger ingest or refresh. Productivity detail may include `selfHeal` (latest depth scan and week reconcile) read from stored activity rows; this GET does not run a scan. `selfHeal` is null when neither event exists. Requires workspace membership. Disconnected sources are omitted.
4127
4127
  */
4128
4128
  get: operations["getWorkspaceIngestCoverage"];
4129
4129
  put?: never;
@@ -4134,6 +4134,26 @@ export interface paths {
4134
4134
  patch?: never;
4135
4135
  trace?: never;
4136
4136
  };
4137
+ "/workspaces/{workspaceId}/ingest-runs": {
4138
+ parameters: {
4139
+ query?: never;
4140
+ header?: never;
4141
+ path?: never;
4142
+ cookie?: never;
4143
+ };
4144
+ /**
4145
+ * List durable ingest runs
4146
+ * @description Newest-first history of ingest worker ticks that polled. Quiet skips (lock held, rate-limit deferral, and other non-poll skips) are omitted. This wave writes `productivity_github` only; other kinds return an empty list. Requires workspace membership. Does not include run history on ingest-coverage.
4147
+ */
4148
+ get: operations["getWorkspaceIngestRuns"];
4149
+ put?: never;
4150
+ post?: never;
4151
+ delete?: never;
4152
+ options?: never;
4153
+ head?: never;
4154
+ patch?: never;
4155
+ trace?: never;
4156
+ };
4137
4157
  "/workspaces/{workspaceId}/hris/status": {
4138
4158
  parameters: {
4139
4159
  query?: never;
@@ -8059,6 +8079,26 @@ export interface components {
8059
8079
  gaps?: components["schemas"]["IngestCoverageGapDto"][];
8060
8080
  lastErrorKind?: string | null;
8061
8081
  };
8082
+ /** @description Latest depth scan read from stored activity. `capturePercent` is the minimum existing capture ratio over that scan's repo checks with a GitHub merge count, or null when none qualify. */
8083
+ IngestCoverageProductivityDepthScanDto: {
8084
+ /** Format: date-time */
8085
+ completedAt: string | null;
8086
+ reposScanned: number;
8087
+ /** @description Metadata underIngestedCount from the completed depth-scan event. */
8088
+ gapCount: number;
8089
+ capturePercent: number | null;
8090
+ weeksQueued: number;
8091
+ };
8092
+ IngestCoverageProductivityWeekReconcileDto: {
8093
+ /** Format: date-time */
8094
+ completedAt: string | null;
8095
+ weeksChecked: number;
8096
+ weeksQueued: number;
8097
+ };
8098
+ IngestCoverageProductivitySelfHealDto: {
8099
+ depthScan: components["schemas"]["IngestCoverageProductivityDepthScanDto"];
8100
+ weekReconcile: components["schemas"]["IngestCoverageProductivityWeekReconcileDto"];
8101
+ };
8062
8102
  IngestCoverageProductivityDetailDto: {
8063
8103
  /** @enum {string|null} */
8064
8104
  phase?: "recent" | "historical" | "complete" | null;
@@ -8068,6 +8108,8 @@ export interface components {
8068
8108
  failedRepoCount?: number;
8069
8109
  coveragePercent?: number | null;
8070
8110
  repos?: components["schemas"]["IngestCoverageProductivityRepoDto"][];
8111
+ /** @description Latest depth-scan and week-reconcile summary from stored activity rows. Null when neither event exists. The coverage GET does not run a scan. */
8112
+ selfHeal?: components["schemas"]["IngestCoverageProductivitySelfHealDto"] | null;
8071
8113
  };
8072
8114
  IngestCoverageFactFamilyDto: {
8073
8115
  /** @enum {string} */
@@ -8143,6 +8185,27 @@ export interface components {
8143
8185
  /** Format: date-time */
8144
8186
  generatedAt?: string;
8145
8187
  };
8188
+ IngestRunDto: {
8189
+ /** Format: uuid */
8190
+ runId: string;
8191
+ /** @enum {string} */
8192
+ kind: "productivity_github" | "ai_usage" | "sdlc_github" | "monitoring" | "hris";
8193
+ /** Format: date-time */
8194
+ startedAt: string;
8195
+ /** Format: date-time */
8196
+ completedAt: string | null;
8197
+ /** @enum {string} */
8198
+ outcome: "in_progress" | "ok" | "partial" | "failed" | "cancelled";
8199
+ reposPolled: number | null;
8200
+ reposOk: number | null;
8201
+ reposFailed: number | null;
8202
+ errorSummary: string | null;
8203
+ /** @description ISO lastIngestAt after the cursor moved; null when it did not. */
8204
+ watermark: string | null;
8205
+ };
8206
+ IngestRunListDto: {
8207
+ runs: components["schemas"]["IngestRunDto"][];
8208
+ };
8146
8209
  HrisSyncStatusDto: {
8147
8210
  /** @description Provider identifier (e.g. 'personio', 'zenhr'). */
8148
8211
  provider: string;
@@ -10316,6 +10379,9 @@ export type WorkspaceAbsenceListDto = components['schemas']['WorkspaceAbsenceLis
10316
10379
  export type IngestCoverageGapDto = components['schemas']['IngestCoverageGapDto'];
10317
10380
  export type IngestCoverageLastRunDto = components['schemas']['IngestCoverageLastRunDto'];
10318
10381
  export type IngestCoverageProductivityRepoDto = components['schemas']['IngestCoverageProductivityRepoDto'];
10382
+ export type IngestCoverageProductivityDepthScanDto = components['schemas']['IngestCoverageProductivityDepthScanDto'];
10383
+ export type IngestCoverageProductivityWeekReconcileDto = components['schemas']['IngestCoverageProductivityWeekReconcileDto'];
10384
+ export type IngestCoverageProductivitySelfHealDto = components['schemas']['IngestCoverageProductivitySelfHealDto'];
10319
10385
  export type IngestCoverageProductivityDetailDto = components['schemas']['IngestCoverageProductivityDetailDto'];
10320
10386
  export type IngestCoverageFactFamilyDto = components['schemas']['IngestCoverageFactFamilyDto'];
10321
10387
  export type IngestCoverageAiDetailDto = components['schemas']['IngestCoverageAiDetailDto'];
@@ -10324,6 +10390,8 @@ export type IngestCoverageSdlcDetailDto = components['schemas']['IngestCoverageS
10324
10390
  export type IngestCoverageSyncDetailDto = components['schemas']['IngestCoverageSyncDetailDto'];
10325
10391
  export type IngestCoveragePipelineDto = components['schemas']['IngestCoveragePipelineDto'];
10326
10392
  export type IngestCoverageDto = components['schemas']['IngestCoverageDto'];
10393
+ export type IngestRunDto = components['schemas']['IngestRunDto'];
10394
+ export type IngestRunListDto = components['schemas']['IngestRunListDto'];
10327
10395
  export type HrisSyncStatusDto = components['schemas']['HrisSyncStatusDto'];
10328
10396
  export type HrisSyncStatusListDto = components['schemas']['HrisSyncStatusListDto'];
10329
10397
  export type ZenHrReconnectResultDto = components['schemas']['ZenHrReconnectResultDto'];
@@ -14828,7 +14896,7 @@ export interface operations {
14828
14896
  getWorkspaceGithubInstallationStatus: {
14829
14897
  parameters: {
14830
14898
  query?: {
14831
- /** @description When true, bypass `tai_workspace_vcs_repos_cache` and re-fetch from GitHub. When productivity backfill phase is `complete`, also triggers inline `on_demand` ingest for the current UTC week (gap-fill only when metrics are missing). Response includes `productivityRefreshInProgress` while the workspace advisory lock is held. */
14899
+ /** @description When true, bypass `tai_workspace_vcs_repos_cache` and re-fetch from GitHub, then poll and merge productivity metrics for the current UTC week even while historical backfill is active or metrics already exist. Response includes `productivityRefreshInProgress` while the workspace advisory lock is held. */
14832
14900
  refresh?: boolean;
14833
14901
  /** @description When true, re-fetch GitHub App and installation permission metadata (used by the login permission gate after the user approves on GitHub). Clears App-permission and product-settings caches so the next `productSettingsRefresh` re-probes. Does not itself call alert-list APIs; use `productSettingsRefresh` for that. */
14834
14902
  permissionsRefresh?: boolean;
@@ -20942,6 +21010,55 @@ export interface operations {
20942
21010
  403: components["responses"]["Forbidden"];
20943
21011
  };
20944
21012
  };
21013
+ getWorkspaceIngestRuns: {
21014
+ parameters: {
21015
+ query?: {
21016
+ /** @description Coverage pipeline kind. Omit to list every kind stored for the workspace. */
21017
+ kind?: "productivity_github" | "ai_usage" | "sdlc_github" | "monitoring" | "hris";
21018
+ /** @description Page size. Default 20. Values above 100 are rejected. */
21019
+ limit?: number;
21020
+ };
21021
+ header?: never;
21022
+ path: {
21023
+ workspaceId: components["parameters"]["WorkspaceId"];
21024
+ };
21025
+ cookie?: never;
21026
+ };
21027
+ requestBody?: never;
21028
+ responses: {
21029
+ /** @description Ingest runs, newest startedAt first */
21030
+ 200: {
21031
+ headers: {
21032
+ [name: string]: unknown;
21033
+ };
21034
+ content: {
21035
+ /**
21036
+ * @example {
21037
+ * "runs": []
21038
+ * }
21039
+ */
21040
+ "application/json": components["schemas"]["IngestRunListDto"];
21041
+ };
21042
+ };
21043
+ /** @description Invalid kind or limit */
21044
+ 400: {
21045
+ headers: {
21046
+ [name: string]: unknown;
21047
+ };
21048
+ content: {
21049
+ /**
21050
+ * @example {
21051
+ * "error": "Invalid ingest-runs query",
21052
+ * "code": "invalid_query"
21053
+ * }
21054
+ */
21055
+ "application/json": components["schemas"]["ErrorMessageDto"];
21056
+ };
21057
+ };
21058
+ 401: components["responses"]["Unauthorized"];
21059
+ 403: components["responses"]["Forbidden"];
21060
+ };
21061
+ };
20945
21062
  getHrisSyncStatus: {
20946
21063
  parameters: {
20947
21064
  query?: never;