@thinkai/tai-api-contract 2.7.3 → 2.8.1

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.
@@ -195,7 +195,7 @@ export interface paths {
195
195
  * @description Replace the workspace's `sources` array. Cursor entries are validated strictly (`token` 1-256 chars, no whitespace, no `env:` prefix; optional deprecated `baseUrl` is accepted for backwards compatibility and ignored at runtime; verification and future refresh use the fixed Cursor Admin API host. Other types pass through with only a non-empty `type` requirement so existing jira / sonarqube / bitbucket callers are not regressed. **`type: github` is rejected** with HTTP 400 and `code: github_sources_deprecated`; use the GitHub App integration (`POST /workspaces/{workspaceId}/integrations/github/install-url` and callback) instead.
196
196
  * Every secret-keyed top-level string field (`token`, `password`, `api_key`, `secret`, `private_key`, `client_secret`) is encrypted at rest with AES-256-GCM under `SOURCES_TOKEN_ENC_KEY` before persistence; `env:`-prefixed values pass through unchanged. `GET /workspaces/{workspaceId}/config` continues to redact every secret-keyed field to `***` regardless of whether the stored value is encrypted, plaintext, or `env:` ref.
197
197
  * Requires editor or admin workspace role.
198
- * **Typical outcomes:** Valid typed sources → `200` with `{ ok: true, workspaceId }`. Missing required fields for a given `type` → `400` with `error` text. Unknown `type` strings (non-cursor, non-github) currently pass through to storage (lenient compatibility); only `cursor` entries get strict field validation. Cursor sources enforce strict token shape (no whitespace, no `env:` prefix).
198
+ * **Typical outcomes:** Valid typed sources → `200` with `{ ok: true, workspaceId }`. Missing required fields for a given `type` → `400` with `error` text. Unknown `type` strings (non-AI-tool, non-github) currently pass through to storage (lenient compatibility). Registered AI tools (`cursor`, `claude`) get strict field validation (no whitespace, no `env:` prefix on tokens).
199
199
  */
200
200
  put: operations["putTenantSources"];
201
201
  post?: never;
@@ -217,8 +217,8 @@ export interface paths {
217
217
  /**
218
218
  * Test one source connection (does not persist)
219
219
  * @description Verify a source's credentials without persisting them. Always returns 200 — upstream auth, rate-limit, and network failures surface as `{ success: false, error }` so the SPA can render an inline error.
220
- * Currently only `type: cursor` is verified end-to-end (Cursor Admin API, HTTP Basic against `https://api.cursor.com`; optional `baseUrl` in the body is deprecated and ignored). Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for cursor: `invalid_token`, `rate_limited`, `network_error`.
221
- * **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable service → `200` with `{ success: false, error: "..." }` (Cursor verifier and non-cursor paths as documented above).
220
+ * Registered AI tools are verified end-to-end: `cursor` (Cursor Admin API at `https://api.cursor.com`, HTTP Basic; optional `baseUrl` is deprecated and ignored) and `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
221
+ * **Typical outcomes:** Malformed body, missing `type`, invalid `type`, or missing required fields for the declared type → `400` with `{ error: "..." }`. Well-formed body with bad credentials or unreachable service → `200` with `{ success: false, error: "..." }`.
222
222
  */
223
223
  post: operations["postTenantSourceTest"];
224
224
  delete?: never;
@@ -915,6 +915,46 @@ export interface paths {
915
915
  patch?: never;
916
916
  trace?: never;
917
917
  };
918
+ "/workspaces/{workspaceId}/readiness/repos/{repoId}/runs": {
919
+ parameters: {
920
+ query?: never;
921
+ header?: never;
922
+ path?: never;
923
+ cookie?: never;
924
+ };
925
+ /**
926
+ * Paginated readiness run history for one repository
927
+ * @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`.
928
+ */
929
+ get: operations["listReadinessRepoRuns"];
930
+ put?: never;
931
+ post?: never;
932
+ delete?: never;
933
+ options?: never;
934
+ head?: never;
935
+ patch?: never;
936
+ trace?: never;
937
+ };
938
+ "/workspaces/{workspaceId}/readiness/score-history": {
939
+ parameters: {
940
+ query?: never;
941
+ header?: never;
942
+ path?: never;
943
+ cookie?: never;
944
+ };
945
+ /**
946
+ * Workspace score time-series for all repositories
947
+ * @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).
948
+ */
949
+ get: operations["getReadinessScoreHistory"];
950
+ put?: never;
951
+ post?: never;
952
+ delete?: never;
953
+ options?: never;
954
+ head?: never;
955
+ patch?: never;
956
+ trace?: never;
957
+ };
918
958
  "/workspaces/{workspaceId}/agentic-foundation/dashboard": {
919
959
  parameters: {
920
960
  query?: never;
@@ -1606,6 +1646,13 @@ export interface components {
1606
1646
  */
1607
1647
  baseUrl: string;
1608
1648
  };
1649
+ /** @description Claude (Anthropic) source entry for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. The `token` field carries a literal Organization Admin API key on writes (`sk-ant-admin...`); reads from `GET /workspaces/{workspaceId}/config` redact it to `***`. Runtime calls use the Anthropic Admin API at `https://api.anthropic.com`. Provision keys in Claude Console → Organization settings (admin role required). */
1650
+ ClaudeSourceDto: {
1651
+ /** @enum {string} */
1652
+ type: "claude";
1653
+ /** @description Anthropic Organization Admin API key (literal, must start with sk-ant-admin). Standard API keys (sk-ant-api...) are rejected. Whitespace and `env:` prefix are rejected. */
1654
+ token: string;
1655
+ };
1609
1656
  WorkspaceConfigDto: {
1610
1657
  sources: components["schemas"]["TenantSourceEntryDto"][];
1611
1658
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
@@ -2375,6 +2422,46 @@ export interface components {
2375
2422
  criteriaSummary?: components["schemas"]["ReadinessCriteriaSummaryDto"] | null;
2376
2423
  issues: components["schemas"]["ReadinessIssueDto"][];
2377
2424
  };
2425
+ ReadinessRepoRunHistoryItemDto: {
2426
+ /** Format: uuid */
2427
+ runId: string;
2428
+ status: components["schemas"]["ReadinessRunStatusDto"];
2429
+ /** @description Present for succeeded runs after migration 050; null otherwise. */
2430
+ overallScore: number | null;
2431
+ /** Format: date-time */
2432
+ createdAt: string;
2433
+ /** Format: date-time */
2434
+ finishedAt: string | null;
2435
+ };
2436
+ ReadinessRepoRunListDto: {
2437
+ items: components["schemas"]["ReadinessRepoRunHistoryItemDto"][];
2438
+ limit: number;
2439
+ /** @description Pass as `cursor` query param to fetch the next page; null when no more rows. */
2440
+ nextCursor: string | null;
2441
+ };
2442
+ ReadinessScoreHistoryPointDto: {
2443
+ /** Format: date-time */
2444
+ finishedAt: string;
2445
+ overallScore: number;
2446
+ };
2447
+ ReadinessRepoScoreHistoryDto: {
2448
+ /** Format: uuid */
2449
+ repoId: string;
2450
+ repoName: string;
2451
+ /**
2452
+ * Format: date-time
2453
+ * @description When the repository was first materialized in the workspace (GitHub connect).
2454
+ */
2455
+ connectedAt: string;
2456
+ points: components["schemas"]["ReadinessScoreHistoryPointDto"][];
2457
+ };
2458
+ WorkspaceReadinessScoreHistoryDto: {
2459
+ /** Format: uuid */
2460
+ workspaceId: string;
2461
+ /** Format: date-time */
2462
+ generatedAt: string;
2463
+ repos: components["schemas"]["ReadinessRepoScoreHistoryDto"][];
2464
+ };
2378
2465
  RepoReadinessScoreDto: {
2379
2466
  /** Format: uuid */
2380
2467
  repoId: string;
@@ -2385,6 +2472,11 @@ export interface components {
2385
2472
  dimensions: components["schemas"]["DimensionScoreDto"][];
2386
2473
  /** Format: date-time */
2387
2474
  lastAnalyzed: string;
2475
+ /**
2476
+ * Format: date-time
2477
+ * @description First time this repository was materialized in the workspace (GitHub connect).
2478
+ */
2479
+ connectedAt: string;
2388
2480
  /** Format: uuid */
2389
2481
  teamId?: string | null;
2390
2482
  provider: components["schemas"]["RepoProviderDto"];
@@ -2840,6 +2932,7 @@ export type OrgChartImportResultDto = components['schemas']['OrgChartImportResul
2840
2932
  export type OrgChartSaveResultDto = components['schemas']['OrgChartSaveResultDto'];
2841
2933
  export type TenantSourceEntryDto = components['schemas']['TenantSourceEntryDto'];
2842
2934
  export type CursorSourceDto = components['schemas']['CursorSourceDto'];
2935
+ export type ClaudeSourceDto = components['schemas']['ClaudeSourceDto'];
2843
2936
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
2844
2937
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
2845
2938
  export type AiToolSeatDto = components['schemas']['AiToolSeatDto'];
@@ -2921,6 +3014,11 @@ export type ReadinessRunSummaryDto = components['schemas']['ReadinessRunSummaryD
2921
3014
  export type ReadinessCriteriaSummaryDto = components['schemas']['ReadinessCriteriaSummaryDto'];
2922
3015
  export type ReadinessIssueDto = components['schemas']['ReadinessIssueDto'];
2923
3016
  export type DimensionScoreDto = components['schemas']['DimensionScoreDto'];
3017
+ export type ReadinessRepoRunHistoryItemDto = components['schemas']['ReadinessRepoRunHistoryItemDto'];
3018
+ export type ReadinessRepoRunListDto = components['schemas']['ReadinessRepoRunListDto'];
3019
+ export type ReadinessScoreHistoryPointDto = components['schemas']['ReadinessScoreHistoryPointDto'];
3020
+ export type ReadinessRepoScoreHistoryDto = components['schemas']['ReadinessRepoScoreHistoryDto'];
3021
+ export type WorkspaceReadinessScoreHistoryDto = components['schemas']['WorkspaceReadinessScoreHistoryDto'];
2924
3022
  export type RepoReadinessScoreDto = components['schemas']['RepoReadinessScoreDto'];
2925
3023
  export type AgenticFoundationDashboardSummaryDto = components['schemas']['AgenticFoundationDashboardSummaryDto'];
2926
3024
  export type PageMetaDto = components['schemas']['PageMetaDto'];
@@ -3487,7 +3585,7 @@ export interface operations {
3487
3585
  requestBody: {
3488
3586
  content: {
3489
3587
  "application/json": {
3490
- sources: (components["schemas"]["CursorSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3588
+ sources: (components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3491
3589
  };
3492
3590
  };
3493
3591
  };
@@ -3541,7 +3639,7 @@ export interface operations {
3541
3639
  };
3542
3640
  requestBody: {
3543
3641
  content: {
3544
- "application/json": components["schemas"]["CursorSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
3642
+ "application/json": components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
3545
3643
  };
3546
3644
  };
3547
3645
  responses: {
@@ -4567,7 +4665,7 @@ export interface operations {
4567
4665
  header?: never;
4568
4666
  path: {
4569
4667
  workspaceId: components["parameters"]["WorkspaceId"];
4570
- provider: "cursor";
4668
+ provider: "cursor" | "claude";
4571
4669
  };
4572
4670
  cookie?: never;
4573
4671
  };
@@ -4622,7 +4720,7 @@ export interface operations {
4622
4720
  header?: never;
4623
4721
  path: {
4624
4722
  workspaceId: components["parameters"]["WorkspaceId"];
4625
- provider: "cursor";
4723
+ provider: "cursor" | "claude";
4626
4724
  };
4627
4725
  cookie?: never;
4628
4726
  };
@@ -4653,7 +4751,7 @@ export interface operations {
4653
4751
  header?: never;
4654
4752
  path: {
4655
4753
  workspaceId: components["parameters"]["WorkspaceId"];
4656
- provider: "cursor";
4754
+ provider: "cursor" | "claude";
4657
4755
  };
4658
4756
  cookie?: never;
4659
4757
  };
@@ -4682,7 +4780,7 @@ export interface operations {
4682
4780
  header?: never;
4683
4781
  path: {
4684
4782
  workspaceId: components["parameters"]["WorkspaceId"];
4685
- provider: "cursor";
4783
+ provider: "cursor" | "claude";
4686
4784
  };
4687
4785
  cookie?: never;
4688
4786
  };
@@ -4709,7 +4807,7 @@ export interface operations {
4709
4807
  header?: never;
4710
4808
  path: {
4711
4809
  workspaceId: components["parameters"]["WorkspaceId"];
4712
- provider: "cursor";
4810
+ provider: "cursor" | "claude";
4713
4811
  };
4714
4812
  cookie?: never;
4715
4813
  };
@@ -5298,6 +5396,100 @@ export interface operations {
5298
5396
  };
5299
5397
  };
5300
5398
  };
5399
+ listReadinessRepoRuns: {
5400
+ parameters: {
5401
+ query?: {
5402
+ limit?: number;
5403
+ order?: "asc" | "desc";
5404
+ /** @description Opaque cursor from a prior response `nextCursor` field. */
5405
+ cursor?: string;
5406
+ };
5407
+ header?: never;
5408
+ path: {
5409
+ workspaceId: components["parameters"]["WorkspaceId"];
5410
+ repoId: components["parameters"]["RepoId"];
5411
+ };
5412
+ cookie?: never;
5413
+ };
5414
+ requestBody?: never;
5415
+ responses: {
5416
+ /** @description Run history page */
5417
+ 200: {
5418
+ headers: {
5419
+ [name: string]: unknown;
5420
+ };
5421
+ content: {
5422
+ "application/json": components["schemas"]["ReadinessRepoRunListDto"];
5423
+ };
5424
+ };
5425
+ /** @description Invalid pagination query */
5426
+ 400: {
5427
+ headers: {
5428
+ [name: string]: unknown;
5429
+ };
5430
+ content: {
5431
+ "application/json": components["schemas"]["ErrorMessageDto"];
5432
+ };
5433
+ };
5434
+ 401: components["responses"]["Unauthorized"];
5435
+ 403: components["responses"]["Forbidden"];
5436
+ /** @description Workspace or repository not found */
5437
+ 404: {
5438
+ headers: {
5439
+ [name: string]: unknown;
5440
+ };
5441
+ content: {
5442
+ "application/json": components["schemas"]["ErrorMessageDto"];
5443
+ };
5444
+ };
5445
+ };
5446
+ };
5447
+ getReadinessScoreHistory: {
5448
+ parameters: {
5449
+ query?: {
5450
+ /** @description ISO-8601 lower bound on `finishedAt` (inclusive). */
5451
+ since?: string;
5452
+ limitPerRepo?: number;
5453
+ };
5454
+ header?: never;
5455
+ path: {
5456
+ workspaceId: components["parameters"]["WorkspaceId"];
5457
+ };
5458
+ cookie?: never;
5459
+ };
5460
+ requestBody?: never;
5461
+ responses: {
5462
+ /** @description Score history grouped by repository */
5463
+ 200: {
5464
+ headers: {
5465
+ [name: string]: unknown;
5466
+ };
5467
+ content: {
5468
+ "application/json": components["schemas"]["WorkspaceReadinessScoreHistoryDto"];
5469
+ };
5470
+ };
5471
+ /** @description Invalid query */
5472
+ 400: {
5473
+ headers: {
5474
+ [name: string]: unknown;
5475
+ };
5476
+ content: {
5477
+ "application/json": components["schemas"]["ErrorMessageDto"];
5478
+ };
5479
+ };
5480
+ 401: components["responses"]["Unauthorized"];
5481
+ 403: components["responses"]["Forbidden"];
5482
+ /** @description Workspace does not exist */
5483
+ 404: {
5484
+ headers: {
5485
+ [name: string]: unknown;
5486
+ };
5487
+ content: {
5488
+ "application/json": components["schemas"]["ErrorMessageDto"];
5489
+ };
5490
+ };
5491
+ };
5492
+ };
5301
5493
  getAgenticFoundationDashboard: {
5302
5494
  parameters: {
5303
5495
  query?: never;