@thinkai/tai-api-contract 2.25.0 → 2.26.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.
@@ -1465,6 +1465,26 @@ export interface paths {
1465
1465
  patch?: never;
1466
1466
  trace?: never;
1467
1467
  };
1468
+ "/workspaces/{workspaceId}/agent-execution-provider": {
1469
+ parameters: {
1470
+ query?: never;
1471
+ header?: never;
1472
+ path?: never;
1473
+ cookie?: never;
1474
+ };
1475
+ get?: never;
1476
+ /**
1477
+ * Select the agent execution account for this workspace
1478
+ * @description Sets the single active agent execution account (`thinkai_platform_cursor`, `cursor_user_api_key`, or `claude_api_key`) used by this workspace's readiness scanner and fix processor. Defaults to `cursor_user_api_key`. `thinkai_platform_cursor` is never the default and implies consent to platform-key billing. Requires workspace editor or admin role.
1479
+ */
1480
+ put: operations["putAgentExecutionProvider"];
1481
+ post?: never;
1482
+ delete?: never;
1483
+ options?: never;
1484
+ head?: never;
1485
+ patch?: never;
1486
+ trace?: never;
1487
+ };
1468
1488
  "/workspaces/{workspaceId}/readiness/cursor-key-usage": {
1469
1489
  parameters: {
1470
1490
  query?: never;
@@ -2001,20 +2021,53 @@ export interface components {
2001
2021
  /** @description Whether the execution key is stored. If false and `cursorPlatformKeyEnabled` is true in `WorkspaceConfigDto`, the platform key will be used for readiness runs (additional cost applies). */
2002
2022
  hasExecutionToken: boolean;
2003
2023
  };
2004
- /** @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). */
2024
+ /** @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...`); the optional `executionToken` carries a standard API key (`sk-ant-api...`) that powers the Claude Code agent (readiness scanner + fix processor). Reads from `GET /workspaces/{workspaceId}/config` redact secrets to `hasToken` / `hasExecutionToken` booleans. Provision keys in Claude Console. */
2005
2025
  ClaudeSourceDto: {
2006
2026
  /** @enum {string} */
2007
2027
  type: "claude";
2008
2028
  /** @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. */
2009
2029
  token: string;
2030
+ /** @description Claude Code execution key (literal standard Anthropic API key, sk-ant-api...). Used by the readiness scanner and fix processor when this workspace selects the `claude` agent. NOT the Admin API key. Omit to use the ThinkAI platform key (requires `claudePlatformKeyEnabled` on the workspace). Whitespace and `env:` prefix are rejected. */
2031
+ executionToken?: string;
2032
+ };
2033
+ /** @description Partial Claude source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Admin API key (`token`) powers insights sync; execution key (`executionToken`) powers the Claude Code agent. At least one of `token` or `executionToken` must be present. */
2034
+ ClaudeSourcePatchDto: {
2035
+ /** @enum {string} */
2036
+ type: "claude";
2037
+ /** @description Anthropic Organization Admin API key (literal, must start with sk-ant-admin). Whitespace and `env:` prefix are rejected. */
2038
+ token?: string;
2039
+ /** @description Claude Code execution key (literal standard Anthropic API key, sk-ant-api...) — NOT the Admin API key. Whitespace and `env:` prefix are rejected. */
2040
+ executionToken?: string;
2041
+ };
2042
+ /** @description Redacted Claude source returned by `GET /workspaces/{workspaceId}/config`. `hasToken` and `hasExecutionToken` indicate which keys are stored. Raw values are never returned. */
2043
+ ClaudeSourceConfigDto: {
2044
+ /** @enum {string} */
2045
+ type: "claude";
2046
+ /** @description Whether the Admin API key (`token`) is stored for this workspace. */
2047
+ hasToken: boolean;
2048
+ /** @description Whether the Claude Code execution key is stored. If false and `claudePlatformKeyEnabled` is true in `WorkspaceConfigDto`, the platform key will be used for readiness runs (additional cost applies). */
2049
+ hasExecutionToken: boolean;
2010
2050
  };
2051
+ /**
2052
+ * @description The agent execution account used for Agentic Foundation runs (readiness scanner + fix queue). Exactly one is active per workspace.
2053
+ * - `thinkai_platform_cursor`: ThinkAI platform Cursor key (Cursor Agent CLI) — opt-in, never default.
2054
+ * - `cursor_user_api_key`: the workspace's own Cursor user API key (Cursor Agent CLI).
2055
+ * - `claude_api_key`: the workspace's own Anthropic API key (Claude Code CLI).
2056
+ * @enum {string}
2057
+ */
2058
+ AgentExecutionProviderDto: "thinkai_platform_cursor" | "cursor_user_api_key" | "claude_api_key";
2011
2059
  WorkspaceConfigDto: {
2012
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
2060
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
2013
2061
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
2014
2062
  /** @enum {string|null} */
2015
2063
  region?: "us" | "eu" | "me" | null;
2016
- /** @description When true, readiness runs may use the ThinkAI platform Cursor key if this workspace has no `executionToken` configured. Additional cost applies. Requires explicit opt-in via `PUT /workspaces/{workspaceId}/cursor/platform-key-consent`. */
2064
+ /**
2065
+ * @deprecated
2066
+ * @description Deprecated: superseded by `agentExecutionProvider = thinkai_platform_cursor`. When true, readiness runs may use the ThinkAI platform Cursor key. Kept for one release; new clients should read/write `agentExecutionProvider`.
2067
+ */
2017
2068
  cursorPlatformKeyEnabled?: boolean;
2069
+ /** @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`. */
2070
+ agentExecutionProvider?: components["schemas"]["AgentExecutionProviderDto"];
2018
2071
  };
2019
2072
  TestConnectionResponseDto: {
2020
2073
  success: boolean;
@@ -3516,7 +3569,7 @@ export interface components {
3516
3569
  * @description Type of workspace lifecycle event.
3517
3570
  * @enum {string}
3518
3571
  */
3519
- 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" | "config.cursor.added" | "config.cursor.updated" | "config.cursor.removed" | "config.cursor.platform_key_enabled" | "config.cursor.platform_key_disabled" | "config.claude.added" | "config.claude.updated" | "config.claude.removed" | "member.invited" | "member.role_changed" | "member.removed";
3572
+ 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" | "config.cursor.added" | "config.cursor.updated" | "config.cursor.removed" | "config.cursor.platform_key_enabled" | "config.cursor.platform_key_disabled" | "config.claude.added" | "config.claude.updated" | "config.claude.removed" | "config.agent_execution.provider_changed" | "member.invited" | "member.role_changed" | "member.removed";
3520
3573
  ActivityLogActorDto: {
3521
3574
  /** Format: uuid */
3522
3575
  userId: string;
@@ -3813,6 +3866,9 @@ export type CursorSourceDto = components['schemas']['CursorSourceDto'];
3813
3866
  export type CursorSourcePatchDto = components['schemas']['CursorSourcePatchDto'];
3814
3867
  export type CursorSourceConfigDto = components['schemas']['CursorSourceConfigDto'];
3815
3868
  export type ClaudeSourceDto = components['schemas']['ClaudeSourceDto'];
3869
+ export type ClaudeSourcePatchDto = components['schemas']['ClaudeSourcePatchDto'];
3870
+ export type ClaudeSourceConfigDto = components['schemas']['ClaudeSourceConfigDto'];
3871
+ export type AgentExecutionProviderDto = components['schemas']['AgentExecutionProviderDto'];
3816
3872
  export type WorkspaceConfigDto = components['schemas']['WorkspaceConfigDto'];
3817
3873
  export type TestConnectionResponseDto = components['schemas']['TestConnectionResponseDto'];
3818
3874
  export type CursorKeyUsageDto = components['schemas']['CursorKeyUsageDto'];
@@ -4623,7 +4679,7 @@ export interface operations {
4623
4679
  requestBody: {
4624
4680
  content: {
4625
4681
  "application/json": {
4626
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4682
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
4627
4683
  };
4628
4684
  };
4629
4685
  };
@@ -4677,7 +4733,7 @@ export interface operations {
4677
4733
  };
4678
4734
  requestBody: {
4679
4735
  content: {
4680
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
4736
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
4681
4737
  };
4682
4738
  };
4683
4739
  responses: {
@@ -7794,6 +7850,47 @@ export interface operations {
7794
7850
  403: components["responses"]["Forbidden"];
7795
7851
  };
7796
7852
  };
7853
+ putAgentExecutionProvider: {
7854
+ parameters: {
7855
+ query?: never;
7856
+ header?: never;
7857
+ path: {
7858
+ workspaceId: components["parameters"]["WorkspaceId"];
7859
+ };
7860
+ cookie?: never;
7861
+ };
7862
+ requestBody: {
7863
+ content: {
7864
+ "application/json": {
7865
+ provider: components["schemas"]["AgentExecutionProviderDto"];
7866
+ };
7867
+ };
7868
+ };
7869
+ responses: {
7870
+ /** @description Provider updated */
7871
+ 200: {
7872
+ headers: {
7873
+ [name: string]: unknown;
7874
+ };
7875
+ content: {
7876
+ "application/json": {
7877
+ ok: boolean;
7878
+ };
7879
+ };
7880
+ };
7881
+ /** @description Invalid request body */
7882
+ 400: {
7883
+ headers: {
7884
+ [name: string]: unknown;
7885
+ };
7886
+ content: {
7887
+ "application/json": components["schemas"]["ErrorMessageDto"];
7888
+ };
7889
+ };
7890
+ 401: components["responses"]["Unauthorized"];
7891
+ 403: components["responses"]["Forbidden"];
7892
+ };
7893
+ };
7797
7894
  getCursorKeyUsage: {
7798
7895
  parameters: {
7799
7896
  query?: never;