@thinkai/tai-api-contract 2.7.2 → 2.8.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.
@@ -914,6 +914,46 @@ export interface paths {
914
914
  patch?: never;
915
915
  trace?: never;
916
916
  };
917
+ "/workspaces/{workspaceId}/readiness/repos/{repoId}/runs": {
918
+ parameters: {
919
+ query?: never;
920
+ header?: never;
921
+ path?: never;
922
+ cookie?: never;
923
+ };
924
+ /**
925
+ * Paginated readiness run history for one repository
926
+ * @description Append-only scan history for charts on repo detail. Ordered by scan finish time (or `createdAt` when still in progress). Use `cursor` from the previous response for the next page. Failed and `partial_failed` runs are included with nullable `overallScore`.
927
+ */
928
+ get: operations["listReadinessRepoRuns"];
929
+ put?: never;
930
+ post?: never;
931
+ delete?: never;
932
+ options?: never;
933
+ head?: never;
934
+ patch?: never;
935
+ trace?: never;
936
+ };
937
+ "/workspaces/{workspaceId}/readiness/score-history": {
938
+ parameters: {
939
+ query?: never;
940
+ header?: never;
941
+ path?: never;
942
+ cookie?: never;
943
+ };
944
+ /**
945
+ * Workspace score time-series for all repositories
946
+ * @description Returns succeeded runs with stored `overallScore` per repo in one call (avoids N+1). Points are ordered ascending by `finishedAt` within each repo. Omit failed and `partial_failed` runs. Use `since` to bound the window; `limitPerRepo` caps points per repo (most recent first, then returned oldest-to-newest within the cap).
947
+ */
948
+ get: operations["getReadinessScoreHistory"];
949
+ put?: never;
950
+ post?: never;
951
+ delete?: never;
952
+ options?: never;
953
+ head?: never;
954
+ patch?: never;
955
+ trace?: never;
956
+ };
917
957
  "/workspaces/{workspaceId}/agentic-foundation/dashboard": {
918
958
  parameters: {
919
959
  query?: never;
@@ -2374,6 +2414,46 @@ export interface components {
2374
2414
  criteriaSummary?: components["schemas"]["ReadinessCriteriaSummaryDto"] | null;
2375
2415
  issues: components["schemas"]["ReadinessIssueDto"][];
2376
2416
  };
2417
+ ReadinessRepoRunHistoryItemDto: {
2418
+ /** Format: uuid */
2419
+ runId: string;
2420
+ status: components["schemas"]["ReadinessRunStatusDto"];
2421
+ /** @description Present for succeeded runs after migration 050; null otherwise. */
2422
+ overallScore: number | null;
2423
+ /** Format: date-time */
2424
+ createdAt: string;
2425
+ /** Format: date-time */
2426
+ finishedAt: string | null;
2427
+ };
2428
+ ReadinessRepoRunListDto: {
2429
+ items: components["schemas"]["ReadinessRepoRunHistoryItemDto"][];
2430
+ limit: number;
2431
+ /** @description Pass as `cursor` query param to fetch the next page; null when no more rows. */
2432
+ nextCursor: string | null;
2433
+ };
2434
+ ReadinessScoreHistoryPointDto: {
2435
+ /** Format: date-time */
2436
+ finishedAt: string;
2437
+ overallScore: number;
2438
+ };
2439
+ ReadinessRepoScoreHistoryDto: {
2440
+ /** Format: uuid */
2441
+ repoId: string;
2442
+ repoName: string;
2443
+ /**
2444
+ * Format: date-time
2445
+ * @description When the repository was first materialized in the workspace (GitHub connect).
2446
+ */
2447
+ connectedAt: string;
2448
+ points: components["schemas"]["ReadinessScoreHistoryPointDto"][];
2449
+ };
2450
+ WorkspaceReadinessScoreHistoryDto: {
2451
+ /** Format: uuid */
2452
+ workspaceId: string;
2453
+ /** Format: date-time */
2454
+ generatedAt: string;
2455
+ repos: components["schemas"]["ReadinessRepoScoreHistoryDto"][];
2456
+ };
2377
2457
  RepoReadinessScoreDto: {
2378
2458
  /** Format: uuid */
2379
2459
  repoId: string;
@@ -2384,6 +2464,11 @@ export interface components {
2384
2464
  dimensions: components["schemas"]["DimensionScoreDto"][];
2385
2465
  /** Format: date-time */
2386
2466
  lastAnalyzed: string;
2467
+ /**
2468
+ * Format: date-time
2469
+ * @description First time this repository was materialized in the workspace (GitHub connect).
2470
+ */
2471
+ connectedAt: string;
2387
2472
  /** Format: uuid */
2388
2473
  teamId?: string | null;
2389
2474
  provider: components["schemas"]["RepoProviderDto"];
@@ -2393,6 +2478,16 @@ export interface components {
2393
2478
  * @description Present when `analysisStatus` is `queued` or `running`; use with `GET .../readiness/runs/{runId}`.
2394
2479
  */
2395
2480
  activeRunId?: string | null;
2481
+ /**
2482
+ * Format: date-time
2483
+ * @description Set when the repo has been soft-archived (removed from installation or integration disconnected). Null means active.
2484
+ */
2485
+ archivedAt?: string | null;
2486
+ /**
2487
+ * @description Why the repo was archived. Only present when `archivedAt` is set.
2488
+ * @enum {string|null}
2489
+ */
2490
+ archivedReason?: "github_removed" | "installation_disconnected" | "installation_replaced" | "superseded" | null;
2396
2491
  };
2397
2492
  AgenticFoundationDashboardSummaryDto: {
2398
2493
  repoCount: number;
@@ -2459,8 +2554,8 @@ export interface components {
2459
2554
  status: "queued" | "generating" | "pr-created" | "merged" | "failed";
2460
2555
  prUrl?: string;
2461
2556
  prNumber?: number;
2462
- /** @description Machine-readable failure code when status is `failed`. Values in `FixRetryableErrorCode` may be re-queued via POST .../readiness/fixes/{fixId}/retry. */
2463
- errorCode?: components["schemas"]["FixRetryableErrorCode"] | string;
2557
+ /** @description Machine-readable failure code when status is `failed`. Values in `FixRetryableErrorCode` may be re-queued via POST .../readiness/fixes/{fixId}/retry. Values in `FixNonRetryableErrorCode` are permanent failures that require human intervention or configuration changes before retrying. */
2558
+ errorCode?: components["schemas"]["FixRetryableErrorCode"] | components["schemas"]["FixNonRetryableErrorCode"] | string;
2464
2559
  /** @description Human-readable failure summary. Present when status is failed. */
2465
2560
  errorMessage?: string | null;
2466
2561
  /** @description Structured failure context for UI rendering (e.g. file path, provider status). Never contains secrets. */
@@ -2475,6 +2570,11 @@ export interface components {
2475
2570
  * @enum {string}
2476
2571
  */
2477
2572
  FixRetryableErrorCode: "PROVIDER_TIMEOUT" | "RATE_LIMITED" | "TRANSIENT_NETWORK" | "RUNNER_INTERRUPTED";
2573
+ /**
2574
+ * @description Permanent failure codes that cannot be resolved by retrying the same fix. `POLICY_DENIED` — blocked by repo/dimension/path allowlist policy (admin must update `READINESS_FIX_*` env config). `CHANGE_LIMIT_EXCEEDED` — generated diff exceeded max files or lines guardrail. `BUILD_FAILED` — pre-PR gate command or GitHub check run failed on the fix branch. `MERGE_CONFLICT` — could not apply the generated fix cleanly to the target branch. `AUTH_REVOKED` — GitHub installation token or Cursor API key is missing or revoked. `UNSUPPORTED_DIMENSION` — no skill is implemented for this readiness dimension. `DUPLICATE_ACTIVE` — another fix is already in progress for the same issue. `processor_error` — unexpected processor-level failure; check batch-runner logs.
2575
+ * @enum {string}
2576
+ */
2577
+ FixNonRetryableErrorCode: "POLICY_DENIED" | "CHANGE_LIMIT_EXCEEDED" | "BUILD_FAILED" | "MERGE_CONFLICT" | "AUTH_REVOKED" | "UNSUPPORTED_DIMENSION" | "DUPLICATE_ACTIVE" | "processor_error";
2478
2578
  CreateFixRequestBodyDto: {
2479
2579
  /**
2480
2580
  * Format: uuid
@@ -2905,6 +3005,11 @@ export type ReadinessRunSummaryDto = components['schemas']['ReadinessRunSummaryD
2905
3005
  export type ReadinessCriteriaSummaryDto = components['schemas']['ReadinessCriteriaSummaryDto'];
2906
3006
  export type ReadinessIssueDto = components['schemas']['ReadinessIssueDto'];
2907
3007
  export type DimensionScoreDto = components['schemas']['DimensionScoreDto'];
3008
+ export type ReadinessRepoRunHistoryItemDto = components['schemas']['ReadinessRepoRunHistoryItemDto'];
3009
+ export type ReadinessRepoRunListDto = components['schemas']['ReadinessRepoRunListDto'];
3010
+ export type ReadinessScoreHistoryPointDto = components['schemas']['ReadinessScoreHistoryPointDto'];
3011
+ export type ReadinessRepoScoreHistoryDto = components['schemas']['ReadinessRepoScoreHistoryDto'];
3012
+ export type WorkspaceReadinessScoreHistoryDto = components['schemas']['WorkspaceReadinessScoreHistoryDto'];
2908
3013
  export type RepoReadinessScoreDto = components['schemas']['RepoReadinessScoreDto'];
2909
3014
  export type AgenticFoundationDashboardSummaryDto = components['schemas']['AgenticFoundationDashboardSummaryDto'];
2910
3015
  export type PageMetaDto = components['schemas']['PageMetaDto'];
@@ -2916,6 +3021,7 @@ export type GithubInstalledRepoListDto = components['schemas']['GithubInstalledR
2916
3021
  export type AgenticFoundationDashboardDto = components['schemas']['AgenticFoundationDashboardDto'];
2917
3022
  export type FixRequestDto = components['schemas']['FixRequestDto'];
2918
3023
  export type FixRetryableErrorCode = components['schemas']['FixRetryableErrorCode'];
3024
+ export type FixNonRetryableErrorCode = components['schemas']['FixNonRetryableErrorCode'];
2919
3025
  export type CreateFixRequestBodyDto = components['schemas']['CreateFixRequestBodyDto'];
2920
3026
  export type PhaseRoleDto = components['schemas']['PhaseRoleDto'];
2921
3027
  export type SquadMemberDto = components['schemas']['SquadMemberDto'];
@@ -5281,6 +5387,100 @@ export interface operations {
5281
5387
  };
5282
5388
  };
5283
5389
  };
5390
+ listReadinessRepoRuns: {
5391
+ parameters: {
5392
+ query?: {
5393
+ limit?: number;
5394
+ order?: "asc" | "desc";
5395
+ /** @description Opaque cursor from a prior response `nextCursor` field. */
5396
+ cursor?: string;
5397
+ };
5398
+ header?: never;
5399
+ path: {
5400
+ workspaceId: components["parameters"]["WorkspaceId"];
5401
+ repoId: components["parameters"]["RepoId"];
5402
+ };
5403
+ cookie?: never;
5404
+ };
5405
+ requestBody?: never;
5406
+ responses: {
5407
+ /** @description Run history page */
5408
+ 200: {
5409
+ headers: {
5410
+ [name: string]: unknown;
5411
+ };
5412
+ content: {
5413
+ "application/json": components["schemas"]["ReadinessRepoRunListDto"];
5414
+ };
5415
+ };
5416
+ /** @description Invalid pagination query */
5417
+ 400: {
5418
+ headers: {
5419
+ [name: string]: unknown;
5420
+ };
5421
+ content: {
5422
+ "application/json": components["schemas"]["ErrorMessageDto"];
5423
+ };
5424
+ };
5425
+ 401: components["responses"]["Unauthorized"];
5426
+ 403: components["responses"]["Forbidden"];
5427
+ /** @description Workspace or repository not found */
5428
+ 404: {
5429
+ headers: {
5430
+ [name: string]: unknown;
5431
+ };
5432
+ content: {
5433
+ "application/json": components["schemas"]["ErrorMessageDto"];
5434
+ };
5435
+ };
5436
+ };
5437
+ };
5438
+ getReadinessScoreHistory: {
5439
+ parameters: {
5440
+ query?: {
5441
+ /** @description ISO-8601 lower bound on `finishedAt` (inclusive). */
5442
+ since?: string;
5443
+ limitPerRepo?: number;
5444
+ };
5445
+ header?: never;
5446
+ path: {
5447
+ workspaceId: components["parameters"]["WorkspaceId"];
5448
+ };
5449
+ cookie?: never;
5450
+ };
5451
+ requestBody?: never;
5452
+ responses: {
5453
+ /** @description Score history grouped by repository */
5454
+ 200: {
5455
+ headers: {
5456
+ [name: string]: unknown;
5457
+ };
5458
+ content: {
5459
+ "application/json": components["schemas"]["WorkspaceReadinessScoreHistoryDto"];
5460
+ };
5461
+ };
5462
+ /** @description Invalid query */
5463
+ 400: {
5464
+ headers: {
5465
+ [name: string]: unknown;
5466
+ };
5467
+ content: {
5468
+ "application/json": components["schemas"]["ErrorMessageDto"];
5469
+ };
5470
+ };
5471
+ 401: components["responses"]["Unauthorized"];
5472
+ 403: components["responses"]["Forbidden"];
5473
+ /** @description Workspace does not exist */
5474
+ 404: {
5475
+ headers: {
5476
+ [name: string]: unknown;
5477
+ };
5478
+ content: {
5479
+ "application/json": components["schemas"]["ErrorMessageDto"];
5480
+ };
5481
+ };
5482
+ };
5483
+ };
5284
5484
  getAgenticFoundationDashboard: {
5285
5485
  parameters: {
5286
5486
  query?: never;