@thinkai/tai-api-contract 2.91.0 → 2.92.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.
@@ -2608,6 +2608,26 @@ export interface paths {
2608
2608
  patch?: never;
2609
2609
  trace?: never;
2610
2610
  };
2611
+ "/workspaces/{workspaceId}/code-intelligence": {
2612
+ parameters: {
2613
+ query?: never;
2614
+ header?: never;
2615
+ path?: never;
2616
+ cookie?: never;
2617
+ };
2618
+ get?: never;
2619
+ /**
2620
+ * Update Code Intelligence workspace settings
2621
+ * @description Admin-only. Enables/disables Code Intelligence for the workspace, chooses whether to reuse the Agent Execution key or a dedicated `code_intelligence` source credential, and optional Cursor/Claude model overrides. Does not store secrets — use `PUT .../sources` with `type: code_intelligence` and `executionToken` when key mode is `dedicated` (except `thinkai_platform_cursor`, which uses the platform key). Preview UI remains behind `?code_kn=true`.
2622
+ */
2623
+ put: operations["putCodeIntelligenceSettings"];
2624
+ post?: never;
2625
+ delete?: never;
2626
+ options?: never;
2627
+ head?: never;
2628
+ patch?: never;
2629
+ trace?: never;
2630
+ };
2611
2631
  "/workspaces/{workspaceId}/repo-eligibility": {
2612
2632
  parameters: {
2613
2633
  query?: never;
@@ -3871,6 +3891,20 @@ export interface components {
3871
3891
  /** @description Masked preview of the stored insights key (prefix + last four characters). Never includes the full secret. */
3872
3892
  insightsTokenHint?: string;
3873
3893
  };
3894
+ /** @description Dedicated Engineering Context Graph execution credential for `PUT /workspaces/{workspaceId}/sources` when `codeIntelligenceKeyMode` is `dedicated`. Provide `executionToken` (Cursor user/service key or Anthropic `sk-ant-api…`). Admin keys are rejected. Reads from `GET /workspaces/{workspaceId}/config` redact the secret to `hasExecutionToken` via `CodeIntelligenceSourceConfigDto`. */
3895
+ CodeIntelligenceSourcePatchDto: {
3896
+ /** @enum {string} */
3897
+ type: "code_intelligence";
3898
+ /** @description Execution key for wiki/chat LLM calls in dedicated key mode. Whitespace and `env:` prefix are rejected. */
3899
+ executionToken?: string;
3900
+ };
3901
+ /** @description Redacted Engineering Context Graph source returned by `GET /workspaces/{workspaceId}/config`. Raw `executionToken` values are never returned. */
3902
+ CodeIntelligenceSourceConfigDto: {
3903
+ /** @enum {string} */
3904
+ type: "code_intelligence";
3905
+ /** @description Whether a dedicated ECG execution token is stored for this workspace. */
3906
+ hasExecutionToken: boolean;
3907
+ };
3874
3908
  /** @description New Relic monitoring source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Requires a User API key and numeric account ID. */
3875
3909
  NewRelicSourceDto: {
3876
3910
  /** @enum {string} */
@@ -4012,8 +4046,17 @@ export interface components {
4012
4046
  * @enum {string}
4013
4047
  */
4014
4048
  AgentExecutionProviderDto: "thinkai_platform_cursor" | "cursor_user_api_key" | "claude_api_key";
4049
+ /** @description Partial update for Code Intelligence workspace settings (admin-only). */
4050
+ PutCodeIntelligenceSettingsDto: {
4051
+ enabled?: boolean;
4052
+ /** @enum {string} */
4053
+ keyMode?: "reuse_agent_execution" | "dedicated";
4054
+ provider?: components["schemas"]["AgentExecutionProviderDto"] | null;
4055
+ cursorModel?: string | null;
4056
+ claudeModel?: string | null;
4057
+ };
4015
4058
  WorkspaceConfigDto: {
4016
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4059
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["CodeIntelligenceSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4017
4060
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
4018
4061
  /** @enum {string|null} */
4019
4062
  region?: "us" | "eu" | "me" | null;
@@ -4024,6 +4067,21 @@ export interface components {
4024
4067
  cursorPlatformKeyEnabled?: boolean;
4025
4068
  /** @description The single active agent execution account for this workspace's readiness scanner and fix processor. Defaults to `cursor_user_api_key`. Change via `PUT /workspaces/{workspaceId}/agent-execution-provider`. */
4026
4069
  agentExecutionProvider?: components["schemas"]["AgentExecutionProviderDto"];
4070
+ /** @description When false (default), Code Intelligence write APIs (`/code-chat/*` index/sync/wiki/messages) return 403. Preview UI still requires `?code_kn=true`. Change via `PUT /workspaces/{workspaceId}/code-intelligence`. */
4071
+ codeIntelligenceEnabled?: boolean;
4072
+ /**
4073
+ * @description `reuse_agent_execution` uses the workspace Agent Execution key. `dedicated` uses the `code_intelligence` source token (or platform Cursor when provider is `thinkai_platform_cursor`).
4074
+ * @enum {string}
4075
+ */
4076
+ codeIntelligenceKeyMode?: "reuse_agent_execution" | "dedicated";
4077
+ /** @description Active when `codeIntelligenceKeyMode` is `dedicated`. Null when reusing Agent Execution. */
4078
+ codeIntelligenceProvider?: components["schemas"]["AgentExecutionProviderDto"] | null;
4079
+ /** @description Optional Cursor model override for Code Intelligence (null/empty → env default). */
4080
+ codeIntelligenceCursorModel?: string | null;
4081
+ /** @description Optional Claude model override for Code Intelligence (null/empty → env default). */
4082
+ codeIntelligenceClaudeModel?: string | null;
4083
+ /** @description True when a dedicated `code_intelligence` source has a stored executionToken. */
4084
+ hasCodeIntelligenceExecutionToken?: boolean;
4027
4085
  };
4028
4086
  TestConnectionResponseDto: {
4029
4087
  success: boolean;
@@ -6805,7 +6863,7 @@ export interface components {
6805
6863
  * @description Type of workspace lifecycle event.
6806
6864
  * @enum {string}
6807
6865
  */
6808
- ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed";
6866
+ ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "integrations.code_intelligence.settings_changed" | "integrations.code_intelligence.execution_key.added" | "integrations.code_intelligence.execution_key.updated" | "integrations.code_intelligence.execution_key.removed" | "integrations.code_intelligence.execution_key.check_failed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed";
6809
6867
  ActivityLogActorDto: {
6810
6868
  /** Format: uuid */
6811
6869
  userId: string;
@@ -8050,6 +8108,8 @@ export type CursorSourceConfigDto = components['schemas']['CursorSourceConfigDto
8050
8108
  export type ClaudeSourceDto = components['schemas']['ClaudeSourceDto'];
8051
8109
  export type ClaudeSourcePatchDto = components['schemas']['ClaudeSourcePatchDto'];
8052
8110
  export type ClaudeSourceConfigDto = components['schemas']['ClaudeSourceConfigDto'];
8111
+ export type CodeIntelligenceSourcePatchDto = components['schemas']['CodeIntelligenceSourcePatchDto'];
8112
+ export type CodeIntelligenceSourceConfigDto = components['schemas']['CodeIntelligenceSourceConfigDto'];
8053
8113
  export type NewRelicSourceDto = components['schemas']['NewRelicSourceDto'];
8054
8114
  export type NewRelicSourceConfigDto = components['schemas']['NewRelicSourceConfigDto'];
8055
8115
  export type PrometheusSourceDto = components['schemas']['PrometheusSourceDto'];
@@ -8061,6 +8121,7 @@ export type SonarQubeSourceConfigDto = components['schemas']['SonarQubeSourceCon
8061
8121
  export type PagerDutySourceDto = components['schemas']['PagerDutySourceDto'];
8062
8122
  export type PagerDutySourceConfigDto = components['schemas']['PagerDutySourceConfigDto'];
8063
8123
  export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
8124
+ export type PutCodeIntelligenceSettingsDto = components['schemas']['PutCodeIntelligenceSettingsDto'];
8064
8125
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
8065
8126
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
8066
8127
  export type CursorKeyUsageDto = components['schemas']['CursorKeyUsageDto'];
@@ -10025,7 +10086,7 @@ export interface operations {
10025
10086
  requestBody: {
10026
10087
  content: {
10027
10088
  "application/json": {
10028
- 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"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
10089
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
10029
10090
  };
10030
10091
  };
10031
10092
  };
@@ -10079,7 +10140,7 @@ export interface operations {
10079
10140
  };
10080
10141
  requestBody: {
10081
10142
  content: {
10082
- "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"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"];
10143
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["TenantSourceEntryDto"];
10083
10144
  };
10084
10145
  };
10085
10146
  responses: {
@@ -15298,7 +15359,52 @@ export interface operations {
15298
15359
  [name: string]: unknown;
15299
15360
  };
15300
15361
  content: {
15301
- "application/json": components["schemas"]["ErrorMessageDto"];
15362
+ "application/json": {
15363
+ /** @example invalid_body */
15364
+ error: string;
15365
+ };
15366
+ };
15367
+ };
15368
+ 401: components["responses"]["Unauthorized"];
15369
+ 403: components["responses"]["Forbidden"];
15370
+ };
15371
+ };
15372
+ putCodeIntelligenceSettings: {
15373
+ parameters: {
15374
+ query?: never;
15375
+ header?: never;
15376
+ path: {
15377
+ workspaceId: components["parameters"]["WorkspaceId"];
15378
+ };
15379
+ cookie?: never;
15380
+ };
15381
+ requestBody: {
15382
+ content: {
15383
+ "application/json": components["schemas"]["PutCodeIntelligenceSettingsDto"];
15384
+ };
15385
+ };
15386
+ responses: {
15387
+ /** @description Settings updated */
15388
+ 200: {
15389
+ headers: {
15390
+ [name: string]: unknown;
15391
+ };
15392
+ content: {
15393
+ "application/json": {
15394
+ ok: boolean;
15395
+ };
15396
+ };
15397
+ };
15398
+ /** @description Invalid request body */
15399
+ 400: {
15400
+ headers: {
15401
+ [name: string]: unknown;
15402
+ };
15403
+ content: {
15404
+ "application/json": {
15405
+ /** @example invalid_body */
15406
+ error: string;
15407
+ };
15302
15408
  };
15303
15409
  };
15304
15410
  401: components["responses"]["Unauthorized"];