@thinkai/tai-api-contract 2.68.0 → 2.70.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.
@@ -490,7 +490,7 @@ export interface paths {
490
490
  get?: never;
491
491
  /**
492
492
  * Replace workspace data sources
493
- * @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.
493
+ * @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 / bitbucket callers are not regressed. `sonarqube` entries get strict validation (`baseUrl`, `token`, `projectKey` required; optional `branch`). **`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.
494
494
  * 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.
495
495
  * Requires editor or admin workspace role.
496
496
  * **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). For `cursor`, each PUT entry may include `token` (admin key), `executionToken` (execution key), or both; at least one key field is required per entry. Cursor-specific `400` codes: `cursor_execution_token_is_admin_key` (admin key in `executionToken`), `invalid_cursor_execution_token` (execution key failed Cloud Agents verification).
@@ -515,7 +515,7 @@ export interface paths {
515
515
  /**
516
516
  * Test one source connection (does not persist)
517
517
  * @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.
518
- * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `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`.
518
+ * Registered AI tools are verified end-to-end: `cursor` (Admin API key in `token` and/or execution key in `executionToken`; at least one must be present). Execution-only tests validate the key against the Cloud Agents API (`GET /v1/me`, with `GET /v1/models` fallback for service accounts) and return `executionKeyValid` / `executionKeyError` without calling the Admin API on `token`. Malformed cursor entries return `400` with `code: invalid_source_entry`. `claude` (Anthropic Admin API at `https://api.anthropic.com`, `X-Api-Key` with an organization Admin API key `sk-ant-admin...`). `sonarqube` (`baseUrl`, `token`, `projectKey` required; optional `branch`) calls `GET {baseUrl}/api/measures/component` with a Bearer token. Other types report `{ success: false, error: "unsupported_type" }`. Documented `error` codes for AI tool verifiers: `invalid_token`, `rate_limited`, `network_error`.
519
519
  * **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: "..." }`.
520
520
  */
521
521
  post: operations["postTenantSourceTest"];
@@ -3414,6 +3414,28 @@ export interface components {
3414
3414
  orgId?: string;
3415
3415
  orgName?: string;
3416
3416
  };
3417
+ /** @description SonarQube source for workspace sources PUT and connection test. Every field is re-submitted on each save; `token` is never round-tripped from `GET` workspace config. */
3418
+ SonarQubeSourceDto: {
3419
+ /** @enum {string} */
3420
+ type: "sonarqube";
3421
+ /** @description SonarQube server URL, e.g. https://sonarqube.example.com. */
3422
+ baseUrl: string;
3423
+ /** @description User or project analysis token (write-only on PUT). Literal tokens are encrypted at rest. Operator-managed secrets may use an `env:VAR` reference (resolved at runtime / batch poll), matching other non-AI-tool sources. */
3424
+ token: string;
3425
+ /** @description SonarQube project key (component key). */
3426
+ projectKey: string;
3427
+ /** @description Optional branch name for branch-scoped measures. */
3428
+ branch?: string;
3429
+ };
3430
+ /** @description Redacted SonarQube source returned by GET workspace config. */
3431
+ SonarQubeSourceConfigDto: {
3432
+ /** @enum {string} */
3433
+ type: "sonarqube";
3434
+ hasToken: boolean;
3435
+ baseUrl: string;
3436
+ projectKey: string;
3437
+ branch?: string;
3438
+ };
3417
3439
  /**
3418
3440
  * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
3419
3441
  * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
@@ -3423,7 +3445,7 @@ export interface components {
3423
3445
  */
3424
3446
  AgentExecutionProviderDto: "thinkai_platform_cursor" | "cursor_user_api_key" | "claude_api_key";
3425
3447
  WorkspaceConfigDto: {
3426
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3448
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
3427
3449
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
3428
3450
  /** @enum {string|null} */
3429
3451
  region?: "us" | "eu" | "me" | null;
@@ -5454,6 +5476,8 @@ export interface components {
5454
5476
  createdAt: string;
5455
5477
  /** Format: date-time */
5456
5478
  finishedAt: string | null;
5479
+ /** @description Per-dimension percentages from the run's readiness_output_contract when present. Omitted when the run has no stored dimension breakdown. */
5480
+ dimensionScores?: components["schemas"]["ReadinessScoreHistoryDimensionScoreDto"][];
5457
5481
  };
5458
5482
  ReadinessRepoRunListDto: {
5459
5483
  items: components["schemas"]["ReadinessRepoRunHistoryItemDto"][];
@@ -6838,6 +6862,8 @@ export type PrometheusSourceDto = components['schemas']['PrometheusSourceDto'];
6838
6862
  export type PrometheusSourceConfigDto = components['schemas']['PrometheusSourceConfigDto'];
6839
6863
  export type GrafanaSourceDto = components['schemas']['GrafanaSourceDto'];
6840
6864
  export type GrafanaSourceConfigDto = components['schemas']['GrafanaSourceConfigDto'];
6865
+ export type SonarQubeSourceDto = components['schemas']['SonarQubeSourceDto'];
6866
+ export type SonarQubeSourceConfigDto = components['schemas']['SonarQubeSourceConfigDto'];
6841
6867
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
6842
6868
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
6843
6869
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
@@ -8553,7 +8579,7 @@ export interface operations {
8553
8579
  requestBody: {
8554
8580
  content: {
8555
8581
  "application/json": {
8556
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
8582
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
8557
8583
  };
8558
8584
  };
8559
8585
  };
@@ -8607,7 +8633,7 @@ export interface operations {
8607
8633
  };
8608
8634
  requestBody: {
8609
8635
  content: {
8610
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
8636
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
8611
8637
  };
8612
8638
  };
8613
8639
  responses: {