@thinkai/tai-api-contract 2.237.0 → 2.239.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.
@@ -4638,6 +4638,232 @@ export interface paths {
4638
4638
  patch?: never;
4639
4639
  trace?: never;
4640
4640
  };
4641
+ "/workspaces/{workspaceId}/code-chat/deep-wiki/generate": {
4642
+ parameters: {
4643
+ query?: never;
4644
+ header?: never;
4645
+ path?: never;
4646
+ cookie?: never;
4647
+ };
4648
+ get?: never;
4649
+ put?: never;
4650
+ /**
4651
+ * Start writing the workspace wiki (Deep Wiki)
4652
+ * @description Starts a background run that writes the cross-repository workspace wiki from stored architecture documents (`.arch.md`). It does not clone or re-index. Member auth, and Code Intelligence must be on for the workspace. Returns `202` at once; poll `GET …/code-chat/deep-wiki/generate/status` until `status` is `done` or `failed`.
4653
+ * One run per workspace. Run state is stored durably, so it survives a restart and is the same on every replica. A run that is still going after 12 minutes is stopped and reads `failed`; pages saved before then (the outline) are kept and the next run replaces them. Draft pages (PRD / RFC / ADR) are left in place.
4654
+ */
4655
+ post: operations["generateWorkspaceDeepWiki"];
4656
+ delete?: never;
4657
+ options?: never;
4658
+ head?: never;
4659
+ patch?: never;
4660
+ trace?: never;
4661
+ };
4662
+ "/workspaces/{workspaceId}/code-chat/deep-wiki/generate/status": {
4663
+ parameters: {
4664
+ query?: never;
4665
+ header?: never;
4666
+ path?: never;
4667
+ cookie?: never;
4668
+ };
4669
+ /**
4670
+ * Get the workspace wiki run status
4671
+ * @description Current or most recent Deep Wiki run for the workspace, read from durable storage. `idle` with null fields means no run has been started. A `running` row older than the run limit (12 minutes) reads `failed`, so a crashed replica cannot hold the lock forever.
4672
+ */
4673
+ get: operations["getWorkspaceDeepWikiStatus"];
4674
+ put?: never;
4675
+ post?: never;
4676
+ delete?: never;
4677
+ options?: never;
4678
+ head?: never;
4679
+ patch?: never;
4680
+ trace?: never;
4681
+ };
4682
+ "/workspaces/{workspaceId}/mcp/oauth/approve": {
4683
+ parameters: {
4684
+ query?: never;
4685
+ header?: never;
4686
+ path?: never;
4687
+ cookie?: never;
4688
+ };
4689
+ get?: never;
4690
+ put?: never;
4691
+ /**
4692
+ * Approve an MCP client sign-in
4693
+ * @description Called by the app's consent page after a member agrees to let an MCP client read this workspace. Issues a single-use authorization code and returns the client's redirect URL with `code` (and `state` when sent). The client then exchanges the code at `POST /mcp/oauth/token`. `clientId` and `redirectUri` must match a client registered at `POST /mcp/oauth/register`.
4694
+ */
4695
+ post: operations["approveMcpOauth"];
4696
+ delete?: never;
4697
+ options?: never;
4698
+ head?: never;
4699
+ patch?: never;
4700
+ trace?: never;
4701
+ };
4702
+ "/workspaces/{workspaceId}/mcp/tokens": {
4703
+ parameters: {
4704
+ query?: never;
4705
+ header?: never;
4706
+ path?: never;
4707
+ cookie?: never;
4708
+ };
4709
+ /**
4710
+ * List personal MCP tokens
4711
+ * @description Personal tokens, newest first, at most 50. Workspace admins see every member's tokens; other members see only their own. Includes revoked and expired rows. The secret is never returned here; only `tokenPrefix`.
4712
+ */
4713
+ get: operations["listMcpTokens"];
4714
+ put?: never;
4715
+ /**
4716
+ * Create a personal MCP token
4717
+ * @description Creates a read-only token for scripts that cannot use OAuth. Valid for 90 days. The full `token` is returned once, in this response only. Use it as `Authorization: Bearer <token>` on `POST /workspaces/{workspaceId}/mcp`.
4718
+ */
4719
+ post: operations["createMcpToken"];
4720
+ delete?: never;
4721
+ options?: never;
4722
+ head?: never;
4723
+ patch?: never;
4724
+ trace?: never;
4725
+ };
4726
+ "/workspaces/{workspaceId}/mcp/tokens/{tokenId}": {
4727
+ parameters: {
4728
+ query?: never;
4729
+ header?: never;
4730
+ path?: never;
4731
+ cookie?: never;
4732
+ };
4733
+ get?: never;
4734
+ put?: never;
4735
+ post?: never;
4736
+ /**
4737
+ * Revoke a personal MCP token
4738
+ * @description Revokes one token. The owner can revoke their own token; a workspace admin can revoke any token in the workspace.
4739
+ */
4740
+ delete: operations["revokeMcpToken"];
4741
+ options?: never;
4742
+ head?: never;
4743
+ patch?: never;
4744
+ trace?: never;
4745
+ };
4746
+ "/.well-known/oauth-authorization-server": {
4747
+ parameters: {
4748
+ query?: never;
4749
+ header?: never;
4750
+ path?: never;
4751
+ cookie?: never;
4752
+ };
4753
+ /**
4754
+ * OAuth authorization server metadata for MCP clients
4755
+ * @description Public. Discovery document for the MCP sign-in: authorization code with PKCE (`S256`), public clients, scope `read`. URLs are built from the configured public API origin, not from request headers. Rate limited per client IP.
4756
+ */
4757
+ get: operations["getMcpOauthAuthorizationServerMetadata"];
4758
+ put?: never;
4759
+ post?: never;
4760
+ delete?: never;
4761
+ options?: never;
4762
+ head?: never;
4763
+ patch?: never;
4764
+ trace?: never;
4765
+ };
4766
+ "/.well-known/oauth-protected-resource/workspaces/{workspaceId}/mcp": {
4767
+ parameters: {
4768
+ query?: never;
4769
+ header?: never;
4770
+ path?: never;
4771
+ cookie?: never;
4772
+ };
4773
+ /**
4774
+ * OAuth protected resource metadata for one workspace MCP endpoint
4775
+ * @description Public. Tells an MCP client which authorization server protects the workspace MCP endpoint. Linked from the `WWW-Authenticate` header of a `401` on `POST /workspaces/{workspaceId}/mcp`.
4776
+ */
4777
+ get: operations["getMcpOauthProtectedResourceMetadata"];
4778
+ put?: never;
4779
+ post?: never;
4780
+ delete?: never;
4781
+ options?: never;
4782
+ head?: never;
4783
+ patch?: never;
4784
+ trace?: never;
4785
+ };
4786
+ "/mcp/oauth/register": {
4787
+ parameters: {
4788
+ query?: never;
4789
+ header?: never;
4790
+ path?: never;
4791
+ cookie?: never;
4792
+ };
4793
+ get?: never;
4794
+ put?: never;
4795
+ /**
4796
+ * Register an MCP OAuth client (dynamic registration)
4797
+ * @description Public. Registers a public client (no secret) and returns its `client_id`. Up to 10 `redirect_uris`; each must be `https`, or `http` on `localhost`, `127.0.0.1`, or `::1`, with no fragment (`400` `mcp_redirect_uri_invalid` otherwise).
4798
+ */
4799
+ post: operations["registerMcpOauthClient"];
4800
+ delete?: never;
4801
+ options?: never;
4802
+ head?: never;
4803
+ patch?: never;
4804
+ trace?: never;
4805
+ };
4806
+ "/mcp/oauth/authorize": {
4807
+ parameters: {
4808
+ query?: never;
4809
+ header?: never;
4810
+ path?: never;
4811
+ cookie?: never;
4812
+ };
4813
+ /**
4814
+ * Start an MCP OAuth sign-in
4815
+ * @description Public. Browser entry point of the authorization code flow. After checking the client, redirect URI, and PKCE challenge, it redirects (`302`) to the app's `/mcp/consent` page where a signed-in member approves. `resource` must be the workspace MCP URL (`…/workspaces/{workspaceId}/mcp`). Only `response_type=code` and `code_challenge_method=S256` are accepted.
4816
+ */
4817
+ get: operations["authorizeMcpOauth"];
4818
+ put?: never;
4819
+ post?: never;
4820
+ delete?: never;
4821
+ options?: never;
4822
+ head?: never;
4823
+ patch?: never;
4824
+ trace?: never;
4825
+ };
4826
+ "/mcp/oauth/token": {
4827
+ parameters: {
4828
+ query?: never;
4829
+ header?: never;
4830
+ path?: never;
4831
+ cookie?: never;
4832
+ };
4833
+ get?: never;
4834
+ put?: never;
4835
+ /**
4836
+ * Exchange an MCP authorization code for an access token
4837
+ * @description Public. Accepts `application/x-www-form-urlencoded` (standard) or JSON. Only `grant_type=authorization_code` is supported. `code_verifier` is 43 to 128 characters and must match the challenge sent at authorize. A code is single use. The response is never cached (`Cache-Control: no-store`). The access token is read-only and lasts 8 hours. Errors follow OAuth: the body carries `error` (`unsupported_grant_type`, `invalid_grant`).
4838
+ */
4839
+ post: operations["exchangeMcpOauthToken"];
4840
+ delete?: never;
4841
+ options?: never;
4842
+ head?: never;
4843
+ patch?: never;
4844
+ trace?: never;
4845
+ };
4846
+ "/workspaces/{workspaceId}/mcp": {
4847
+ parameters: {
4848
+ query?: never;
4849
+ header?: never;
4850
+ path?: never;
4851
+ cookie?: never;
4852
+ };
4853
+ get?: never;
4854
+ put?: never;
4855
+ /**
4856
+ * Workspace MCP endpoint (Streamable HTTP, JSON-RPC)
4857
+ * @description Hosted, read-only MCP server for one workspace. Authenticate with an MCP bearer token (an OAuth access token or a personal token), not a Supabase JWT. Each call carries one JSON-RPC 2.0 message and gets one JSON response. A message without `id` (a notification) gets `202` with no body. Supported methods: `initialize`, `tools/list`, `tools/call`; any other method returns JSON-RPC error `-32601`. A tool failure returns `200` with `result.isError: true`.
4858
+ * Tools: the Code Chat tools (including `ask`), `read_wiki_structure` and `read_wiki_contents` (one repository, pass `repoId`), and `read_workspace_wiki_structure` and `read_workspace_wiki_contents` (the workspace wiki, pass `slug`; stale pages are marked). Code Intelligence must be on for the workspace. Rate limited per client IP.
4859
+ */
4860
+ post: operations["callWorkspaceMcp"];
4861
+ delete?: never;
4862
+ options?: never;
4863
+ head?: never;
4864
+ patch?: never;
4865
+ trace?: never;
4866
+ };
4641
4867
  "/workspaces/{workspaceId}/knowledge-pages/prd/generate": {
4642
4868
  parameters: {
4643
4869
  query?: never;
@@ -4649,7 +4875,7 @@ export interface paths {
4649
4875
  put?: never;
4650
4876
  /**
4651
4877
  * Generate a workspace-scoped PRD draft
4652
- * @description Builds a PRD draft from ready indexes (required) plus optional wiki pages and platform evidence (readiness, quality, delivery, AI adoption, monitoring). Wiki is optional — scan at least one repository first. Upserts one workspace knowledge page (`prd-<slug>` / `prd-draft`) without replacing the whole knowledge base.
4878
+ * @description Builds a PRD draft from ready indexes (required) plus optional wiki pages and platform evidence (readiness, quality, delivery, AI adoption, monitoring). Wiki is optional — scan at least one repository first. Upserts one workspace knowledge page (`prd-<slug>` / `prd-draft`) without replacing the whole knowledge base. When no model is configured the saved page is a labeled skeleton (`mode: deterministic`); when models are configured and the draft fails or times out, nothing is saved (`502` / `504`).
4653
4879
  */
4654
4880
  post: operations["generatePrdDraft"];
4655
4881
  delete?: never;
@@ -12598,10 +12824,10 @@ export interface components {
12598
12824
  IngestCoveragePipelineDto: {
12599
12825
  id: string;
12600
12826
  /**
12601
- * @description `linear` (v2.210.0+) is the last Linear poll from the productivity worker: `failed` with `lastErrorKind` `invalid_token` when the key was revoked, `incremental` after a successful poll, `sync.eventCount` for tickets read. Listed only while Linear is connected.
12827
+ * @description PM delivery kinds (`linear` v2.210.0+, `jira`, `github_issues`, `azure_boards`) are the last poll from the delivery lane (`productivity.delivery`, ADR 005): `failed` with `lastErrorKind` `invalid_token` when the key was revoked, `incremental` after a successful poll, `sync.eventCount` for tickets read. Each is listed only while that provider is connected.
12602
12828
  * @enum {string}
12603
12829
  */
12604
- kind: "productivity_github" | "productivity_bitbucket" | "ai_usage" | "sdlc_github" | "monitoring" | "hris" | "jira" | "pagerduty" | "linear";
12830
+ kind: "productivity_github" | "productivity_bitbucket" | "ai_usage" | "sdlc_github" | "monitoring" | "hris" | "jira" | "pagerduty" | "linear" | "github_issues" | "azure_boards";
12605
12831
  provider?: string | null;
12606
12832
  /** @enum {string} */
12607
12833
  status: "not_started" | "backfilling" | "incremental" | "complete" | "failed" | "in_progress";
@@ -13512,7 +13738,7 @@ export interface components {
13512
13738
  reason: string | null;
13513
13739
  /** Format: date-time */
13514
13740
  updatedAt: string | null;
13515
- /** @description The document was written for an earlier commit than the index now holds. */
13741
+ /** @description The last scan did not confirm the document for the commit the index now holds. A newer commit that left the architecture unchanged is not stale. */
13516
13742
  stale: boolean;
13517
13743
  /** @description The `.arch.md` file content. Standard headings, in the same order for every repository. */
13518
13744
  markdown: string | null;
@@ -13892,6 +14118,153 @@ export interface components {
13892
14118
  standaloneCount?: number;
13893
14119
  };
13894
14120
  };
14121
+ GenerateWorkspaceDeepWikiBodyDto: {
14122
+ /** @description Limit the run to these repositories' architecture documents. Omit or send empty for all (capped at 40). */
14123
+ repoIds?: string[];
14124
+ };
14125
+ WorkspaceDeepWikiRunDto: {
14126
+ /** @enum {string} */
14127
+ status: "idle" | "running" | "done" | "failed";
14128
+ /**
14129
+ * @description Current generate step while `status` is running; `done` when finished.
14130
+ * @enum {string|null}
14131
+ */
14132
+ phase?: "evidence" | "outline" | "skeleton" | "enrich" | "done" | null;
14133
+ /** Format: date-time */
14134
+ startedAt: string | null;
14135
+ /** Format: date-time */
14136
+ finishedAt: string | null;
14137
+ /** @description Pages saved by a finished run; null otherwise. */
14138
+ pageCount: number | null;
14139
+ /** @description Plain-words reason when `status` is `failed`; null otherwise. */
14140
+ error: string | null;
14141
+ /** @description Repositories whose architecture documents feed the run. Sent only on the `202` start response. */
14142
+ reposInEvidence?: number;
14143
+ };
14144
+ McpOauthApproveBodyDto: {
14145
+ clientId: string;
14146
+ redirectUri: string;
14147
+ /** @description PKCE `S256` challenge from the authorize request. */
14148
+ codeChallenge: string;
14149
+ state?: string;
14150
+ };
14151
+ McpOauthApproveResultDto: {
14152
+ /** @description The client's redirect URI with `code` (and `state` when sent). Send the browser here. */
14153
+ redirectTo: string;
14154
+ };
14155
+ McpTokenDto: {
14156
+ /** Format: uuid */
14157
+ id: string;
14158
+ name: string;
14159
+ /** @description First 16 characters of the token, to tell tokens apart. Not usable as a secret. */
14160
+ tokenPrefix: string;
14161
+ /** @description Always `personal` in this list. */
14162
+ tokenKind: string;
14163
+ /** Format: date-time */
14164
+ expiresAt: string;
14165
+ /** Format: date-time */
14166
+ revokedAt: string | null;
14167
+ /** Format: date-time */
14168
+ createdAt: string;
14169
+ /**
14170
+ * Format: uuid
14171
+ * @description Owner of the token.
14172
+ */
14173
+ userId: string;
14174
+ };
14175
+ McpTokenListDto: {
14176
+ items: components["schemas"]["McpTokenDto"][];
14177
+ };
14178
+ McpTokenCreateBodyDto: {
14179
+ /** @description Label for the token. Trimmed and cut to 80 characters. */
14180
+ name: string;
14181
+ };
14182
+ McpTokenCreatedDto: {
14183
+ /** Format: uuid */
14184
+ id: string;
14185
+ /** @description Full secret (`tai_mcp_…`). Shown once; it cannot be read again. */
14186
+ token: string;
14187
+ tokenPrefix: string;
14188
+ /**
14189
+ * Format: date-time
14190
+ * @description 90 days after creation.
14191
+ */
14192
+ expiresAt: string;
14193
+ };
14194
+ McpOauthServerMetadataDto: {
14195
+ issuer: string;
14196
+ authorization_endpoint: string;
14197
+ token_endpoint: string;
14198
+ registration_endpoint: string;
14199
+ response_types_supported: string[];
14200
+ grant_types_supported: string[];
14201
+ code_challenge_methods_supported: string[];
14202
+ scopes_supported: string[];
14203
+ token_endpoint_auth_methods_supported: string[];
14204
+ };
14205
+ McpOauthProtectedResourceDto: {
14206
+ resource: string;
14207
+ authorization_servers: string[];
14208
+ scopes_supported: string[];
14209
+ bearer_methods_supported: string[];
14210
+ };
14211
+ McpOauthRegisterBodyDto: {
14212
+ redirect_uris: string[];
14213
+ /** @description Defaults to `MCP client`. */
14214
+ client_name?: string;
14215
+ };
14216
+ McpOauthRegisterResultDto: {
14217
+ client_id: string;
14218
+ client_name: string;
14219
+ redirect_uris: string[];
14220
+ /** @enum {string} */
14221
+ token_endpoint_auth_method: "none";
14222
+ grant_types: string[];
14223
+ response_types: string[];
14224
+ };
14225
+ McpOauthTokenBodyDto: {
14226
+ /** @enum {string} */
14227
+ grant_type: "authorization_code";
14228
+ code: string;
14229
+ code_verifier: string;
14230
+ client_id: string;
14231
+ /** @description Must match the redirect used at authorize. */
14232
+ redirect_uri?: string;
14233
+ };
14234
+ McpOauthTokenResultDto: {
14235
+ access_token: string;
14236
+ /** @enum {string} */
14237
+ token_type: "Bearer";
14238
+ /** @description Seconds (28800, 8 hours). */
14239
+ expires_in: number;
14240
+ /** @enum {string} */
14241
+ scope: "read";
14242
+ };
14243
+ McpJsonRpcRequestDto: {
14244
+ /** @enum {string} */
14245
+ jsonrpc: "2.0";
14246
+ /** @description Omit for a notification. */
14247
+ id?: string | number;
14248
+ /** @description `initialize`, `tools/list`, or `tools/call` */
14249
+ method: string;
14250
+ /** @description For `tools/call`, `{ name, arguments }`. */
14251
+ params?: {
14252
+ [key: string]: unknown;
14253
+ };
14254
+ };
14255
+ McpJsonRpcResponseDto: {
14256
+ /** @enum {string} */
14257
+ jsonrpc: "2.0";
14258
+ id: string | number;
14259
+ /** @description For `tools/call`: `{ content: [{ type: "text", text }], isError }`, where `text` is JSON for a successful tool call or an error message when `isError` is true. */
14260
+ result?: {
14261
+ [key: string]: unknown;
14262
+ };
14263
+ error?: {
14264
+ code: number;
14265
+ message: string;
14266
+ };
14267
+ };
13895
14268
  GeneratePrdDraftBodyDto: {
13896
14269
  /** @description Feature or change the PRD, RFC, or ADR should describe */
13897
14270
  featureIntent: string;
@@ -13938,6 +14311,20 @@ export interface components {
13938
14311
  excerpt?: string;
13939
14312
  /** @description Display names for sourceRepoIds when resolvable */
13940
14313
  sourceRepoNames?: string[];
14314
+ /**
14315
+ * @description kb = legacy synthesis, wiki = workspace Deep Wiki, draft = PRD/RFC/ADR
14316
+ * @enum {string}
14317
+ */
14318
+ pageKind?: "kb" | "wiki" | "draft";
14319
+ parentSlug?: string | null;
14320
+ /** @description True when the page is still a grounded skeleton (enrich not finished) */
14321
+ shallow?: boolean;
14322
+ /**
14323
+ * Format: date-time
14324
+ * @description Set when a cited architecture document changed; clear after Refresh
14325
+ */
14326
+ staleAt?: string | null;
14327
+ diagramMermaid?: string | null;
13941
14328
  };
13942
14329
  WorkspaceKnowledgeSystemContextDto: {
13943
14330
  indexes: {
@@ -15168,6 +15555,22 @@ export interface components {
15168
15555
  "application/json": components["schemas"]["ErrorMessageDto"];
15169
15556
  };
15170
15557
  };
15558
+ /** @description Too many requests from this client IP; wait `Retry-After` seconds */
15559
+ McpRateLimited: {
15560
+ headers: {
15561
+ "Retry-After"?: number;
15562
+ [name: string]: unknown;
15563
+ };
15564
+ content: {
15565
+ /**
15566
+ * @example {
15567
+ * "error": "Too many requests",
15568
+ * "code": "too_many_requests"
15569
+ * }
15570
+ */
15571
+ "application/json": components["schemas"]["ErrorMessageDto"];
15572
+ };
15573
+ };
15171
15574
  /** @description HRIS sync or ZenHR OAuth refresh already in progress for this workspace */
15172
15575
  ZenHrSyncInProgress: {
15173
15576
  headers: {
@@ -15945,6 +16348,22 @@ export type RepoWikiJsonSummaryListDto = components['schemas']['RepoWikiJsonSumm
15945
16348
  export type GenerateWorkspaceKnowledgePagesBodyDto = components['schemas']['GenerateWorkspaceKnowledgePagesBodyDto'];
15946
16349
  export type GenerateWorkspaceKnowledgePagesResultDto = components['schemas']['GenerateWorkspaceKnowledgePagesResultDto'];
15947
16350
  export type WorkspaceContextGenerationStatusDto = components['schemas']['WorkspaceContextGenerationStatusDto'];
16351
+ export type GenerateWorkspaceDeepWikiBodyDto = components['schemas']['GenerateWorkspaceDeepWikiBodyDto'];
16352
+ export type WorkspaceDeepWikiRunDto = components['schemas']['WorkspaceDeepWikiRunDto'];
16353
+ export type McpOauthApproveBodyDto = components['schemas']['McpOauthApproveBodyDto'];
16354
+ export type McpOauthApproveResultDto = components['schemas']['McpOauthApproveResultDto'];
16355
+ export type McpTokenDto = components['schemas']['McpTokenDto'];
16356
+ export type McpTokenListDto = components['schemas']['McpTokenListDto'];
16357
+ export type McpTokenCreateBodyDto = components['schemas']['McpTokenCreateBodyDto'];
16358
+ export type McpTokenCreatedDto = components['schemas']['McpTokenCreatedDto'];
16359
+ export type McpOauthServerMetadataDto = components['schemas']['McpOauthServerMetadataDto'];
16360
+ export type McpOauthProtectedResourceDto = components['schemas']['McpOauthProtectedResourceDto'];
16361
+ export type McpOauthRegisterBodyDto = components['schemas']['McpOauthRegisterBodyDto'];
16362
+ export type McpOauthRegisterResultDto = components['schemas']['McpOauthRegisterResultDto'];
16363
+ export type McpOauthTokenBodyDto = components['schemas']['McpOauthTokenBodyDto'];
16364
+ export type McpOauthTokenResultDto = components['schemas']['McpOauthTokenResultDto'];
16365
+ export type McpJsonRpcRequestDto = components['schemas']['McpJsonRpcRequestDto'];
16366
+ export type McpJsonRpcResponseDto = components['schemas']['McpJsonRpcResponseDto'];
15948
16367
  export type GeneratePrdDraftBodyDto = components['schemas']['GeneratePrdDraftBodyDto'];
15949
16368
  export type GeneratePrdDraftResultDto = components['schemas']['GeneratePrdDraftResultDto'];
15950
16369
  export type WorkspaceKnowledgePageDto = components['schemas']['WorkspaceKnowledgePageDto'];
@@ -16058,6 +16477,7 @@ export type EvalDecisionListDto = components['schemas']['EvalDecisionListDto'];
16058
16477
  export type CreateEvalDecisionBodyDto = components['schemas']['CreateEvalDecisionBodyDto'];
16059
16478
  export type ResponseUnauthorized = components['responses']['Unauthorized'];
16060
16479
  export type ResponseForbidden = components['responses']['Forbidden'];
16480
+ export type ResponseMcpRateLimited = components['responses']['McpRateLimited'];
16061
16481
  export type ResponseZenHrSyncInProgress = components['responses']['ZenHrSyncInProgress'];
16062
16482
  export type ParameterWorkspaceId = components['parameters']['WorkspaceId'];
16063
16483
  export type ParameterAssessmentReportId = components['parameters']['AssessmentReportId'];
@@ -28740,7 +29160,7 @@ export interface operations {
28740
29160
  401: components["responses"]["Unauthorized"];
28741
29161
  };
28742
29162
  };
28743
- generatePrdDraft: {
29163
+ generateWorkspaceDeepWiki: {
28744
29164
  parameters: {
28745
29165
  query?: never;
28746
29166
  header?: never;
@@ -28749,9 +29169,528 @@ export interface operations {
28749
29169
  };
28750
29170
  cookie?: never;
28751
29171
  };
28752
- requestBody: {
29172
+ requestBody?: {
28753
29173
  content: {
28754
- "application/json": components["schemas"]["GeneratePrdDraftBodyDto"];
29174
+ "application/json": components["schemas"]["GenerateWorkspaceDeepWikiBodyDto"];
29175
+ };
29176
+ };
29177
+ responses: {
29178
+ /** @description Run started. `reposInEvidence` is how many repositories' architecture documents feed the run. */
29179
+ 202: {
29180
+ headers: {
29181
+ [name: string]: unknown;
29182
+ };
29183
+ content: {
29184
+ "application/json": components["schemas"]["WorkspaceDeepWikiRunDto"];
29185
+ };
29186
+ };
29187
+ 401: components["responses"]["Unauthorized"];
29188
+ /** @description Not a workspace member, or Code Intelligence is off (`code_intelligence_disabled`) */
29189
+ 403: {
29190
+ headers: {
29191
+ [name: string]: unknown;
29192
+ };
29193
+ content: {
29194
+ "application/json": components["schemas"]["ErrorMessageDto"];
29195
+ };
29196
+ };
29197
+ /** @description Workspace not found */
29198
+ 404: {
29199
+ headers: {
29200
+ [name: string]: unknown;
29201
+ };
29202
+ content: {
29203
+ "application/json": components["schemas"]["ErrorMessageDto"];
29204
+ };
29205
+ };
29206
+ /** @description No architecture documents yet (`arch_docs_missing`), or a run is already going (`generation_in_progress`). */
29207
+ 409: {
29208
+ headers: {
29209
+ [name: string]: unknown;
29210
+ };
29211
+ content: {
29212
+ /**
29213
+ * @example {
29214
+ * "error": "A workspace wiki is already being written. Wait for it to finish.",
29215
+ * "code": "generation_in_progress"
29216
+ * }
29217
+ */
29218
+ "application/json": components["schemas"]["ErrorMessageDto"];
29219
+ };
29220
+ };
29221
+ };
29222
+ };
29223
+ getWorkspaceDeepWikiStatus: {
29224
+ parameters: {
29225
+ query?: never;
29226
+ header?: never;
29227
+ path: {
29228
+ workspaceId: components["parameters"]["WorkspaceId"];
29229
+ };
29230
+ cookie?: never;
29231
+ };
29232
+ requestBody?: never;
29233
+ responses: {
29234
+ /** @description Run state */
29235
+ 200: {
29236
+ headers: {
29237
+ [name: string]: unknown;
29238
+ };
29239
+ content: {
29240
+ "application/json": components["schemas"]["WorkspaceDeepWikiRunDto"];
29241
+ };
29242
+ };
29243
+ 401: components["responses"]["Unauthorized"];
29244
+ 403: components["responses"]["Forbidden"];
29245
+ /** @description Workspace not found */
29246
+ 404: {
29247
+ headers: {
29248
+ [name: string]: unknown;
29249
+ };
29250
+ content: {
29251
+ "application/json": components["schemas"]["ErrorMessageDto"];
29252
+ };
29253
+ };
29254
+ };
29255
+ };
29256
+ approveMcpOauth: {
29257
+ parameters: {
29258
+ query?: never;
29259
+ header?: never;
29260
+ path: {
29261
+ workspaceId: components["parameters"]["WorkspaceId"];
29262
+ };
29263
+ cookie?: never;
29264
+ };
29265
+ requestBody: {
29266
+ content: {
29267
+ "application/json": components["schemas"]["McpOauthApproveBodyDto"];
29268
+ };
29269
+ };
29270
+ responses: {
29271
+ /** @description Code issued */
29272
+ 200: {
29273
+ headers: {
29274
+ [name: string]: unknown;
29275
+ };
29276
+ content: {
29277
+ "application/json": components["schemas"]["McpOauthApproveResultDto"];
29278
+ };
29279
+ };
29280
+ /** @description Invalid redirect URI (`mcp_redirect_uri_invalid`), unknown client, redirect not registered for the client, or missing `codeChallenge`. */
29281
+ 400: {
29282
+ headers: {
29283
+ [name: string]: unknown;
29284
+ };
29285
+ content: {
29286
+ "application/json": components["schemas"]["ErrorMessageDto"];
29287
+ };
29288
+ };
29289
+ 401: components["responses"]["Unauthorized"];
29290
+ 403: components["responses"]["Forbidden"];
29291
+ /** @description Workspace not found */
29292
+ 404: {
29293
+ headers: {
29294
+ [name: string]: unknown;
29295
+ };
29296
+ content: {
29297
+ "application/json": components["schemas"]["ErrorMessageDto"];
29298
+ };
29299
+ };
29300
+ };
29301
+ };
29302
+ listMcpTokens: {
29303
+ parameters: {
29304
+ query?: never;
29305
+ header?: never;
29306
+ path: {
29307
+ workspaceId: components["parameters"]["WorkspaceId"];
29308
+ };
29309
+ cookie?: never;
29310
+ };
29311
+ requestBody?: never;
29312
+ responses: {
29313
+ /** @description Token list */
29314
+ 200: {
29315
+ headers: {
29316
+ [name: string]: unknown;
29317
+ };
29318
+ content: {
29319
+ "application/json": components["schemas"]["McpTokenListDto"];
29320
+ };
29321
+ };
29322
+ 401: components["responses"]["Unauthorized"];
29323
+ 403: components["responses"]["Forbidden"];
29324
+ /** @description Workspace not found */
29325
+ 404: {
29326
+ headers: {
29327
+ [name: string]: unknown;
29328
+ };
29329
+ content: {
29330
+ "application/json": components["schemas"]["ErrorMessageDto"];
29331
+ };
29332
+ };
29333
+ };
29334
+ };
29335
+ createMcpToken: {
29336
+ parameters: {
29337
+ query?: never;
29338
+ header?: never;
29339
+ path: {
29340
+ workspaceId: components["parameters"]["WorkspaceId"];
29341
+ };
29342
+ cookie?: never;
29343
+ };
29344
+ requestBody: {
29345
+ content: {
29346
+ "application/json": components["schemas"]["McpTokenCreateBodyDto"];
29347
+ };
29348
+ };
29349
+ responses: {
29350
+ /** @description Token created */
29351
+ 201: {
29352
+ headers: {
29353
+ [name: string]: unknown;
29354
+ };
29355
+ content: {
29356
+ "application/json": components["schemas"]["McpTokenCreatedDto"];
29357
+ };
29358
+ };
29359
+ /** @description `name` missing or empty */
29360
+ 400: {
29361
+ headers: {
29362
+ [name: string]: unknown;
29363
+ };
29364
+ content: {
29365
+ "application/json": components["schemas"]["ErrorMessageDto"];
29366
+ };
29367
+ };
29368
+ 401: components["responses"]["Unauthorized"];
29369
+ 403: components["responses"]["Forbidden"];
29370
+ /** @description Workspace not found */
29371
+ 404: {
29372
+ headers: {
29373
+ [name: string]: unknown;
29374
+ };
29375
+ content: {
29376
+ "application/json": components["schemas"]["ErrorMessageDto"];
29377
+ };
29378
+ };
29379
+ };
29380
+ };
29381
+ revokeMcpToken: {
29382
+ parameters: {
29383
+ query?: never;
29384
+ header?: never;
29385
+ path: {
29386
+ workspaceId: components["parameters"]["WorkspaceId"];
29387
+ tokenId: string;
29388
+ };
29389
+ cookie?: never;
29390
+ };
29391
+ requestBody?: never;
29392
+ responses: {
29393
+ /** @description Token revoked */
29394
+ 204: {
29395
+ headers: {
29396
+ [name: string]: unknown;
29397
+ };
29398
+ content?: never;
29399
+ };
29400
+ 401: components["responses"]["Unauthorized"];
29401
+ /** @description The token belongs to someone else and the caller is not a workspace admin */
29402
+ 403: {
29403
+ headers: {
29404
+ [name: string]: unknown;
29405
+ };
29406
+ content: {
29407
+ "application/json": components["schemas"]["ErrorMessageDto"];
29408
+ };
29409
+ };
29410
+ /** @description Workspace or token not found, token already revoked, or `tokenId` is not a UUID */
29411
+ 404: {
29412
+ headers: {
29413
+ [name: string]: unknown;
29414
+ };
29415
+ content: {
29416
+ "application/json": components["schemas"]["ErrorMessageDto"];
29417
+ };
29418
+ };
29419
+ };
29420
+ };
29421
+ getMcpOauthAuthorizationServerMetadata: {
29422
+ parameters: {
29423
+ query?: never;
29424
+ header?: never;
29425
+ path?: never;
29426
+ cookie?: never;
29427
+ };
29428
+ requestBody?: never;
29429
+ responses: {
29430
+ /** @description Server metadata */
29431
+ 200: {
29432
+ headers: {
29433
+ [name: string]: unknown;
29434
+ };
29435
+ content: {
29436
+ "application/json": components["schemas"]["McpOauthServerMetadataDto"];
29437
+ };
29438
+ };
29439
+ 429: components["responses"]["McpRateLimited"];
29440
+ /** @description Public API origin is not configured (`mcp_api_origin_missing`) */
29441
+ 503: {
29442
+ headers: {
29443
+ [name: string]: unknown;
29444
+ };
29445
+ content: {
29446
+ "application/json": components["schemas"]["ErrorMessageDto"];
29447
+ };
29448
+ };
29449
+ };
29450
+ };
29451
+ getMcpOauthProtectedResourceMetadata: {
29452
+ parameters: {
29453
+ query?: never;
29454
+ header?: never;
29455
+ path: {
29456
+ workspaceId: components["parameters"]["WorkspaceId"];
29457
+ };
29458
+ cookie?: never;
29459
+ };
29460
+ requestBody?: never;
29461
+ responses: {
29462
+ /** @description Resource metadata */
29463
+ 200: {
29464
+ headers: {
29465
+ [name: string]: unknown;
29466
+ };
29467
+ content: {
29468
+ "application/json": components["schemas"]["McpOauthProtectedResourceDto"];
29469
+ };
29470
+ };
29471
+ /** @description `workspaceId` is not a UUID */
29472
+ 404: {
29473
+ headers: {
29474
+ [name: string]: unknown;
29475
+ };
29476
+ content: {
29477
+ "application/json": components["schemas"]["ErrorMessageDto"];
29478
+ };
29479
+ };
29480
+ 429: components["responses"]["McpRateLimited"];
29481
+ /** @description Public API origin is not configured (`mcp_api_origin_missing`) */
29482
+ 503: {
29483
+ headers: {
29484
+ [name: string]: unknown;
29485
+ };
29486
+ content: {
29487
+ "application/json": components["schemas"]["ErrorMessageDto"];
29488
+ };
29489
+ };
29490
+ };
29491
+ };
29492
+ registerMcpOauthClient: {
29493
+ parameters: {
29494
+ query?: never;
29495
+ header?: never;
29496
+ path?: never;
29497
+ cookie?: never;
29498
+ };
29499
+ requestBody: {
29500
+ content: {
29501
+ "application/json": components["schemas"]["McpOauthRegisterBodyDto"];
29502
+ };
29503
+ };
29504
+ responses: {
29505
+ /** @description Client registered */
29506
+ 201: {
29507
+ headers: {
29508
+ [name: string]: unknown;
29509
+ };
29510
+ content: {
29511
+ "application/json": components["schemas"]["McpOauthRegisterResultDto"];
29512
+ };
29513
+ };
29514
+ /** @description `redirect_uris` missing, or one is not allowed (`mcp_redirect_uri_invalid`) */
29515
+ 400: {
29516
+ headers: {
29517
+ [name: string]: unknown;
29518
+ };
29519
+ content: {
29520
+ "application/json": components["schemas"]["ErrorMessageDto"];
29521
+ };
29522
+ };
29523
+ 429: components["responses"]["McpRateLimited"];
29524
+ };
29525
+ };
29526
+ authorizeMcpOauth: {
29527
+ parameters: {
29528
+ query: {
29529
+ response_type?: "code";
29530
+ client_id: string;
29531
+ redirect_uri: string;
29532
+ code_challenge: string;
29533
+ code_challenge_method?: "S256";
29534
+ /** @description Workspace MCP URL, for example `https://api.example.com/workspaces/{workspaceId}/mcp` */
29535
+ resource: string;
29536
+ state?: string;
29537
+ };
29538
+ header?: never;
29539
+ path?: never;
29540
+ cookie?: never;
29541
+ };
29542
+ requestBody?: never;
29543
+ responses: {
29544
+ /** @description Redirect to the app consent page */
29545
+ 302: {
29546
+ headers: {
29547
+ Location?: string;
29548
+ [name: string]: unknown;
29549
+ };
29550
+ content?: never;
29551
+ };
29552
+ /** @description Missing or invalid parameter, or `redirect_uri` is not registered for the client */
29553
+ 400: {
29554
+ headers: {
29555
+ [name: string]: unknown;
29556
+ };
29557
+ content: {
29558
+ "application/json": components["schemas"]["ErrorMessageDto"];
29559
+ };
29560
+ };
29561
+ 429: components["responses"]["McpRateLimited"];
29562
+ /** @description App URL is not configured (`mcp_app_url_missing`) */
29563
+ 503: {
29564
+ headers: {
29565
+ [name: string]: unknown;
29566
+ };
29567
+ content: {
29568
+ "application/json": components["schemas"]["ErrorMessageDto"];
29569
+ };
29570
+ };
29571
+ };
29572
+ };
29573
+ exchangeMcpOauthToken: {
29574
+ parameters: {
29575
+ query?: never;
29576
+ header?: never;
29577
+ path?: never;
29578
+ cookie?: never;
29579
+ };
29580
+ requestBody: {
29581
+ content: {
29582
+ "application/x-www-form-urlencoded": components["schemas"]["McpOauthTokenBodyDto"];
29583
+ "application/json": components["schemas"]["McpOauthTokenBodyDto"];
29584
+ };
29585
+ };
29586
+ responses: {
29587
+ /** @description Access token */
29588
+ 200: {
29589
+ headers: {
29590
+ [name: string]: unknown;
29591
+ };
29592
+ content: {
29593
+ "application/json": components["schemas"]["McpOauthTokenResultDto"];
29594
+ };
29595
+ };
29596
+ /** @description `unsupported_grant_type` or `invalid_grant` (bad, used, or expired code, verifier, or redirect) */
29597
+ 400: {
29598
+ headers: {
29599
+ [name: string]: unknown;
29600
+ };
29601
+ content: {
29602
+ /**
29603
+ * @example {
29604
+ * "error": "invalid_grant"
29605
+ * }
29606
+ */
29607
+ "application/json": components["schemas"]["ErrorMessageDto"];
29608
+ };
29609
+ };
29610
+ 429: components["responses"]["McpRateLimited"];
29611
+ };
29612
+ };
29613
+ callWorkspaceMcp: {
29614
+ parameters: {
29615
+ query?: never;
29616
+ header?: never;
29617
+ path: {
29618
+ workspaceId: components["parameters"]["WorkspaceId"];
29619
+ };
29620
+ cookie?: never;
29621
+ };
29622
+ requestBody: {
29623
+ content: {
29624
+ /**
29625
+ * @example {
29626
+ * "jsonrpc": "2.0",
29627
+ * "id": 1,
29628
+ * "method": "tools/list"
29629
+ * }
29630
+ */
29631
+ "application/json": components["schemas"]["McpJsonRpcRequestDto"];
29632
+ };
29633
+ };
29634
+ responses: {
29635
+ /** @description JSON-RPC response (result or error) */
29636
+ 200: {
29637
+ headers: {
29638
+ [name: string]: unknown;
29639
+ };
29640
+ content: {
29641
+ "application/json": components["schemas"]["McpJsonRpcResponseDto"];
29642
+ };
29643
+ };
29644
+ /** @description Notification accepted (no `id`); no body */
29645
+ 202: {
29646
+ headers: {
29647
+ [name: string]: unknown;
29648
+ };
29649
+ content?: never;
29650
+ };
29651
+ /** @description Missing, invalid, expired, or wrong-workspace token (`mcp_unauthorized`). The `WWW-Authenticate` header points to the protected resource metadata. */
29652
+ 401: {
29653
+ headers: {
29654
+ "WWW-Authenticate"?: string;
29655
+ [name: string]: unknown;
29656
+ };
29657
+ content: {
29658
+ "application/json": components["schemas"]["ErrorMessageDto"];
29659
+ };
29660
+ };
29661
+ /** @description Code Intelligence is off for the workspace (`code_intelligence_disabled`) */
29662
+ 403: {
29663
+ headers: {
29664
+ [name: string]: unknown;
29665
+ };
29666
+ content: {
29667
+ "application/json": components["schemas"]["ErrorMessageDto"];
29668
+ };
29669
+ };
29670
+ /** @description `workspaceId` is not a UUID */
29671
+ 404: {
29672
+ headers: {
29673
+ [name: string]: unknown;
29674
+ };
29675
+ content: {
29676
+ "application/json": components["schemas"]["ErrorMessageDto"];
29677
+ };
29678
+ };
29679
+ 429: components["responses"]["McpRateLimited"];
29680
+ };
29681
+ };
29682
+ generatePrdDraft: {
29683
+ parameters: {
29684
+ query?: never;
29685
+ header?: never;
29686
+ path: {
29687
+ workspaceId: components["parameters"]["WorkspaceId"];
29688
+ };
29689
+ cookie?: never;
29690
+ };
29691
+ requestBody: {
29692
+ content: {
29693
+ "application/json": components["schemas"]["GeneratePrdDraftBodyDto"];
28755
29694
  };
28756
29695
  };
28757
29696
  responses: {
@@ -28786,6 +29725,24 @@ export interface operations {
28786
29725
  };
28787
29726
  content?: never;
28788
29727
  };
29728
+ /** @description Models are configured but none returned a usable draft after a retry (`artifact_polish_failed`). Nothing was saved. */
29729
+ 502: {
29730
+ headers: {
29731
+ [name: string]: unknown;
29732
+ };
29733
+ content: {
29734
+ "application/json": components["schemas"]["ErrorMessageDto"];
29735
+ };
29736
+ };
29737
+ /** @description The draft took longer than the time limit (`artifact_timed_out`). Nothing was saved. */
29738
+ 504: {
29739
+ headers: {
29740
+ [name: string]: unknown;
29741
+ };
29742
+ content: {
29743
+ "application/json": components["schemas"]["ErrorMessageDto"];
29744
+ };
29745
+ };
28789
29746
  };
28790
29747
  };
28791
29748
  generateRfcDraft: {
@@ -28834,6 +29791,24 @@ export interface operations {
28834
29791
  };
28835
29792
  content?: never;
28836
29793
  };
29794
+ /** @description Models are configured but none returned a usable draft after a retry (`artifact_polish_failed`). Nothing was saved. */
29795
+ 502: {
29796
+ headers: {
29797
+ [name: string]: unknown;
29798
+ };
29799
+ content: {
29800
+ "application/json": components["schemas"]["ErrorMessageDto"];
29801
+ };
29802
+ };
29803
+ /** @description The draft took longer than the time limit (`artifact_timed_out`). Nothing was saved. */
29804
+ 504: {
29805
+ headers: {
29806
+ [name: string]: unknown;
29807
+ };
29808
+ content: {
29809
+ "application/json": components["schemas"]["ErrorMessageDto"];
29810
+ };
29811
+ };
28837
29812
  };
28838
29813
  };
28839
29814
  generateAdrDraft: {
@@ -28882,6 +29857,24 @@ export interface operations {
28882
29857
  };
28883
29858
  content?: never;
28884
29859
  };
29860
+ /** @description Models are configured but none returned a usable draft after a retry (`artifact_polish_failed`). Nothing was saved. */
29861
+ 502: {
29862
+ headers: {
29863
+ [name: string]: unknown;
29864
+ };
29865
+ content: {
29866
+ "application/json": components["schemas"]["ErrorMessageDto"];
29867
+ };
29868
+ };
29869
+ /** @description The draft took longer than the time limit (`artifact_timed_out`). Nothing was saved. */
29870
+ 504: {
29871
+ headers: {
29872
+ [name: string]: unknown;
29873
+ };
29874
+ content: {
29875
+ "application/json": components["schemas"]["ErrorMessageDto"];
29876
+ };
29877
+ };
28885
29878
  };
28886
29879
  };
28887
29880
  getWorkspaceKnowledgeGraph: {