@thinkai/tai-api-contract 2.143.0 → 2.144.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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.143.0
4
+ version: 2.144.1
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -7767,6 +7767,107 @@ paths:
7767
7767
  "403":
7768
7768
  $ref: "#/components/responses/Forbidden"
7769
7769
 
7770
+ /workspaces/{workspaceId}/code-intelligence/agent-md:
7771
+ get:
7772
+ tags: [CodeChat]
7773
+ summary: Read the workspace agent.md
7774
+ description: >
7775
+ Any workspace member. Returns the persisted workspace agent file, or null fields when
7776
+ none has been written. 403 `code_intelligence_disabled` when Engineering Context Graph is off.
7777
+ operationId: getCodeIntelligenceAgentMd
7778
+ x-test-coverage-skip: thin read of persisted config; covered by readiness and maintain unit tests
7779
+ parameters:
7780
+ - $ref: "#/components/parameters/WorkspaceId"
7781
+ responses:
7782
+ "200":
7783
+ description: Persisted agent.md
7784
+ content:
7785
+ application/json:
7786
+ schema:
7787
+ $ref: "#/components/schemas/CodeIntelligenceAgentMdDto"
7788
+ "401":
7789
+ $ref: "#/components/responses/Unauthorized"
7790
+ "403":
7791
+ description: Engineering Context Graph is off, or the caller is not a member
7792
+ content:
7793
+ application/json:
7794
+ schema:
7795
+ $ref: "#/components/schemas/ErrorMessageDto"
7796
+ put:
7797
+ tags: [CodeChat]
7798
+ summary: Save an admin edit of the workspace agent.md
7799
+ description: >
7800
+ Admin only. Body is 1 to 12,000 characters. Saves source `admin`. Auto-generate and the
7801
+ cadence tick do not overwrite this text until an admin regenerates it. A non-admin receives 403.
7802
+ operationId: putCodeIntelligenceAgentMd
7803
+ x-test-coverage-skip: admin write of persisted config; covered by store and maintain unit tests
7804
+ parameters:
7805
+ - $ref: "#/components/parameters/WorkspaceId"
7806
+ requestBody:
7807
+ required: true
7808
+ content:
7809
+ application/json:
7810
+ schema:
7811
+ $ref: "#/components/schemas/PutCodeIntelligenceAgentMdDto"
7812
+ responses:
7813
+ "200":
7814
+ description: Saved agent.md
7815
+ content:
7816
+ application/json:
7817
+ schema:
7818
+ $ref: "#/components/schemas/CodeIntelligenceAgentMdDto"
7819
+ "400":
7820
+ description: Body missing or outside 1 to 12,000 characters
7821
+ content:
7822
+ application/json:
7823
+ schema:
7824
+ $ref: "#/components/schemas/ErrorMessageDto"
7825
+ "401":
7826
+ $ref: "#/components/responses/Unauthorized"
7827
+ "403":
7828
+ description: Caller is not an admin, or Engineering Context Graph is off
7829
+ content:
7830
+ application/json:
7831
+ schema:
7832
+ $ref: "#/components/schemas/ErrorMessageDto"
7833
+
7834
+ /workspaces/{workspaceId}/code-intelligence/agent-md/regenerate:
7835
+ post:
7836
+ tags: [CodeChat]
7837
+ summary: Rewrite workspace agent.md from ready code graphs
7838
+ description: >
7839
+ Admin only. Rewrites the file from current ready eligible graphs and sets source
7840
+ `generated`. Returns 409 `agent_md_not_ready` when no eligible repository index is ready.
7841
+ Does not call an LLM and does not clone repositories.
7842
+ operationId: regenerateCodeIntelligenceAgentMd
7843
+ x-test-coverage-skip: wraps regenerateWorkspaceAgentMd; covered by wave maintain unit tests
7844
+ parameters:
7845
+ - $ref: "#/components/parameters/WorkspaceId"
7846
+ responses:
7847
+ "200":
7848
+ description: Regenerated agent.md
7849
+ content:
7850
+ application/json:
7851
+ schema:
7852
+ $ref: "#/components/schemas/CodeIntelligenceAgentMdDto"
7853
+ "401":
7854
+ $ref: "#/components/responses/Unauthorized"
7855
+ "403":
7856
+ description: Caller is not an admin, or Engineering Context Graph is off
7857
+ content:
7858
+ application/json:
7859
+ schema:
7860
+ $ref: "#/components/schemas/ErrorMessageDto"
7861
+ "409":
7862
+ description: No ready eligible index
7863
+ content:
7864
+ application/json:
7865
+ schema:
7866
+ $ref: "#/components/schemas/ErrorMessageDto"
7867
+ example:
7868
+ error: No ready repository index is available to write the workspace agent file.
7869
+ code: agent_md_not_ready
7870
+
7770
7871
  /workspaces/{workspaceId}/code-intelligence/token-usage/summary:
7771
7872
  get:
7772
7873
  tags: [CodeChat]
@@ -8102,6 +8203,10 @@ paths:
8102
8203
  post:
8103
8204
  tags: [CodeChat]
8104
8205
  summary: Enqueue indexing for all (or selected) readiness GitHub repos
8206
+ description: >
8207
+ `indexOnly: true` enqueues a graph-only job. `{ "indexOnly": true, "force": true }` with
8208
+ no `repoIds` is admin-only and opens one index wave for every eligible GitHub repository.
8209
+ A single-repo indexOnly sync does not open a wave. Members who send that admin body receive 403.
8105
8210
  operationId: syncCodeChatIndexes
8106
8211
  x-test-coverage-skip: lightweight MVP; covered by package unit tests
8107
8212
  parameters:
@@ -8121,6 +8226,47 @@ paths:
8121
8226
  $ref: "#/components/schemas/CodeChatSyncIndexesResultDto"
8122
8227
  "401":
8123
8228
  $ref: "#/components/responses/Unauthorized"
8229
+ "403":
8230
+ description: >
8231
+ Engineering Context Graph is off, or a member sent the admin force body
8232
+ (`indexOnly` and `force` with no `repoIds`).
8233
+ content:
8234
+ application/json:
8235
+ schema:
8236
+ $ref: "#/components/schemas/ErrorMessageDto"
8237
+
8238
+ /workspaces/{workspaceId}/code-chat/readiness:
8239
+ get:
8240
+ tags: [CodeChat]
8241
+ summary: Workspace chat readiness
8242
+ description: >
8243
+ Any workspace member. 403 `code_intelligence_disabled` when Engineering Context Graph is off.
8244
+ `status` is `indexing`, `generating_agent_md`, `failed`, or `ready`. Chat stays closed
8245
+ until `ready`: create thread and post message return `409 chat_not_ready` with
8246
+ `progressMessage` when status is not ready. An open index wave reports `indexing` until
8247
+ every job in that wave is terminal.
8248
+ operationId: getCodeChatReadiness
8249
+ x-test-coverage-skip: thin HTTP over deriveCodeChatReadiness; covered by code-chat-readiness unit tests
8250
+ parameters:
8251
+ - $ref: "#/components/parameters/WorkspaceId"
8252
+ responses:
8253
+ "200":
8254
+ description: Readiness snapshot
8255
+ content:
8256
+ application/json:
8257
+ schema:
8258
+ $ref: "#/components/schemas/CodeChatReadinessDto"
8259
+ "401":
8260
+ $ref: "#/components/responses/Unauthorized"
8261
+ "403":
8262
+ description: Engineering Context Graph is off
8263
+ content:
8264
+ application/json:
8265
+ schema:
8266
+ $ref: "#/components/schemas/ErrorMessageDto"
8267
+ example:
8268
+ error: Code Intelligence is disabled for this workspace
8269
+ code: code_intelligence_disabled
8124
8270
 
8125
8271
  /workspaces/{workspaceId}/code-chat/indexes/{indexId}:
8126
8272
  get:
@@ -8189,6 +8335,12 @@ paths:
8189
8335
  $ref: "#/components/schemas/CodeChatThreadDto"
8190
8336
  "401":
8191
8337
  $ref: "#/components/responses/Unauthorized"
8338
+ "403":
8339
+ description: Engineering Context Graph is off
8340
+ content:
8341
+ application/json:
8342
+ schema:
8343
+ $ref: "#/components/schemas/ErrorMessageDto"
8192
8344
  "404":
8193
8345
  description: Not found
8194
8346
  content:
@@ -8196,7 +8348,23 @@ paths:
8196
8348
  schema:
8197
8349
  $ref: "#/components/schemas/ErrorMessageDto"
8198
8350
  "409":
8199
- description: Index not ready
8351
+ description: Chat not ready, or no ready corpus for a repo-scoped thread
8352
+ content:
8353
+ application/json:
8354
+ schema:
8355
+ $ref: "#/components/schemas/ErrorMessageDto"
8356
+ examples:
8357
+ chat_not_ready:
8358
+ value:
8359
+ error: Indexing repositories (0/2).
8360
+ code: chat_not_ready
8361
+ progressMessage: Indexing repositories (0/2).
8362
+ "422":
8363
+ description: Execution key required
8364
+ content:
8365
+ application/json:
8366
+ schema:
8367
+ $ref: "#/components/schemas/ErrorMessageDto"
8200
8368
 
8201
8369
  /workspaces/{workspaceId}/code-chat/threads/{threadId}:
8202
8370
  get:
@@ -8271,6 +8439,12 @@ paths:
8271
8439
  $ref: "#/components/schemas/CodeChatMessageReplyDto"
8272
8440
  "401":
8273
8441
  $ref: "#/components/responses/Unauthorized"
8442
+ "403":
8443
+ description: Engineering Context Graph is off
8444
+ content:
8445
+ application/json:
8446
+ schema:
8447
+ $ref: "#/components/schemas/ErrorMessageDto"
8274
8448
  "404":
8275
8449
  description: Not found
8276
8450
  content:
@@ -8278,7 +8452,17 @@ paths:
8278
8452
  schema:
8279
8453
  $ref: "#/components/schemas/ErrorMessageDto"
8280
8454
  "409":
8281
- description: Index not ready
8455
+ description: Chat not ready, or no ready corpus in thread scope
8456
+ content:
8457
+ application/json:
8458
+ schema:
8459
+ $ref: "#/components/schemas/ErrorMessageDto"
8460
+ "422":
8461
+ description: Execution key required
8462
+ content:
8463
+ application/json:
8464
+ schema:
8465
+ $ref: "#/components/schemas/ErrorMessageDto"
8282
8466
 
8283
8467
  /workspaces/{workspaceId}/code-chat/indexes/{indexId}/wiki:
8284
8468
  get:
@@ -10712,6 +10896,11 @@ components:
10712
10896
  code:
10713
10897
  type: string
10714
10898
  description: Machine-readable error code when present (for example `last_admin`).
10899
+ progressMessage:
10900
+ type: string
10901
+ description: >
10902
+ Human-readable progress when `code` is `chat_not_ready` (same text as `error`
10903
+ for that response).
10715
10904
 
10716
10905
  TeamMemberDto:
10717
10906
  type: object
@@ -11919,6 +12108,17 @@ components:
11919
12108
  type: string
11920
12109
  nullable: true
11921
12110
  minLength: 1
12111
+ indexingEnabled:
12112
+ type: boolean
12113
+ description: >
12114
+ When false, turning Engineering Context Graph on and the cadence tick do not enqueue
12115
+ index jobs. Stored graphs, wiki pages, and agent.md stay. Defaults to true.
12116
+ indexingCadence:
12117
+ type: string
12118
+ enum: [daily, weekly, manual]
12119
+ description: >
12120
+ How often the code-knowledge worker enqueues an index-only wave for eligible GitHub
12121
+ repositories. `manual` never ticks. Defaults to `daily`.
11922
12122
  wikiGuidance:
11923
12123
  allOf:
11924
12124
  - $ref: "#/components/schemas/CodeWikiGuidanceDto"
@@ -11946,6 +12146,71 @@ components:
11946
12146
  maxLength: 120
11947
12147
  description: Title of the parent topic for hierarchy (must match another topic title).
11948
12148
 
12149
+ PutCodeIntelligenceAgentMdDto:
12150
+ type: object
12151
+ required: [body]
12152
+ properties:
12153
+ body:
12154
+ type: string
12155
+ minLength: 1
12156
+ maxLength: 12000
12157
+
12158
+ CodeIntelligenceAgentMdDto:
12159
+ type: object
12160
+ required: [body, source, updatedAt]
12161
+ properties:
12162
+ body:
12163
+ type: string
12164
+ nullable: true
12165
+ source:
12166
+ type: string
12167
+ nullable: true
12168
+ enum: [generated, admin]
12169
+ updatedAt:
12170
+ type: string
12171
+ format: date-time
12172
+ nullable: true
12173
+
12174
+ CodeChatReadinessDto:
12175
+ type: object
12176
+ required:
12177
+ - status
12178
+ - progressMessage
12179
+ - eligibleCount
12180
+ - readyCount
12181
+ - failedCount
12182
+ - inProgressCount
12183
+ - indexingEnabled
12184
+ - indexingCadence
12185
+ - agentMdSource
12186
+ properties:
12187
+ status:
12188
+ type: string
12189
+ enum: [indexing, generating_agent_md, failed, ready]
12190
+ progressMessage:
12191
+ type: string
12192
+ eligibleCount:
12193
+ type: integer
12194
+ minimum: 0
12195
+ readyCount:
12196
+ type: integer
12197
+ minimum: 0
12198
+ failedCount:
12199
+ type: integer
12200
+ minimum: 0
12201
+ inProgressCount:
12202
+ type: integer
12203
+ minimum: 0
12204
+ indexingEnabled:
12205
+ type: boolean
12206
+ indexingCadence:
12207
+ type: string
12208
+ enum: [daily, weekly, manual]
12209
+ agentMdSource:
12210
+ type: string
12211
+ nullable: true
12212
+ enum: [generated, admin]
12213
+
11949
12214
  CodeWikiGuidanceDto:
11950
12215
  type: object
11951
12216
  properties:
@@ -12026,6 +12291,15 @@ components:
12026
12291
  type: string
12027
12292
  nullable: true
12028
12293
  description: Optional Claude model override for Code Intelligence (null/empty → env default).
12294
+ codeIntelligenceIndexingEnabled:
12295
+ type: boolean
12296
+ description: >
12297
+ When false, enable-enqueue and the cadence tick do not start an index wave.
12298
+ Defaults to true.
12299
+ codeIntelligenceIndexingCadence:
12300
+ type: string
12301
+ enum: [daily, weekly, manual]
12302
+ description: Index wave cadence. `manual` does not tick. Defaults to `daily`.
12029
12303
  hasCodeIntelligenceExecutionToken:
12030
12304
  type: boolean
12031
12305
  description: True when a dedicated `code_intelligence` source has a stored executionToken.
@@ -20887,6 +21161,7 @@ components:
20887
21161
  Omit or false to keep the full pipeline, including wiki. Distinct from
20888
21162
  skipLlm, which still writes a skeleton wiki. A job that is already
20889
21163
  queued or running keeps the options it was enqueued with.
21164
+ Together with `force: true` and no `repoIds`, this opens an admin index wave.
20890
21165
 
20891
21166
  CodeChatSyncIndexesResultDto:
20892
21167
  type: object
@@ -20909,12 +21184,15 @@ components:
20909
21184
  repoName: { type: string }
20910
21185
  code:
20911
21186
  type: string
20912
- enum: [repo_ineligible, indexed_recently, index_in_progress]
20913
- description: Stable machine-readable skip reason
21187
+ enum: [repo_ineligible, indexed_recently, index_in_progress, ecg_source_off]
21188
+ description: >
21189
+ Stable machine-readable skip reason. `ecg_source_off` covers a source turned off
21190
+ for Engineering Context Graph and non-GitHub providers that stay listed but are
21191
+ never indexed.
20914
21192
 
20915
21193
  CodeChatThreadDto:
20916
21194
  type: object
20917
- required: [id, workspaceId, repoIds, title, createdAt, updatedAt]
21195
+ required: [id, workspaceId, repoIds, title, scope, createdAt, updatedAt]
20918
21196
  properties:
20919
21197
  id: { type: string, format: uuid }
20920
21198
  workspaceId: { type: string, format: uuid }
@@ -20925,6 +21203,12 @@ components:
20925
21203
  description: Empty means all ready repos in the workspace.
20926
21204
  revisionRef: { type: string, nullable: true }
20927
21205
  title: { type: string }
21206
+ scope:
21207
+ type: string
21208
+ enum: [workspace, repo]
21209
+ description: >
21210
+ `workspace` when `repoIds` is empty or has more than one id (Conversations).
21211
+ `repo` when exactly one repository is bound (System / Wiki).
20928
21212
  createdAt: { type: string, format: date-time }
20929
21213
  updatedAt: { type: string, format: date-time }
20930
21214
 
@@ -20939,6 +21223,12 @@ components:
20939
21223
  CodeChatCreateThreadBodyDto:
20940
21224
  type: object
20941
21225
  properties:
21226
+ scope:
21227
+ type: string
21228
+ enum: [workspace]
21229
+ description: >
21230
+ Create a workspace conversation with empty `repoIds`. Does not reuse an older
21231
+ thread. Requires chat readiness and an execution key.
20942
21232
  indexId:
20943
21233
  type: string
20944
21234
  format: uuid
@@ -20946,7 +21236,7 @@ components:
20946
21236
  repoIds:
20947
21237
  type: array
20948
21238
  items: { type: string, format: uuid }
20949
- description: Empty or omitted = all ready repos.
21239
+ description: Empty or omitted = all ready repos. Ignored when scope is workspace.
20950
21240
  revisionRef: { type: string }
20951
21241
  title: { type: string }
20952
21242
 
@@ -21011,10 +21301,11 @@ components:
21011
21301
  properties:
21012
21302
  mode:
21013
21303
  type: string
21014
- enum: [llm, retrieval, inventory]
21304
+ enum: [llm, retrieval, inventory, failed]
21015
21305
  description: >
21016
21306
  How the assistant answer was produced. `inventory` returns a deterministic
21017
- catalog (APIs or modules) rather than LLM synthesis.
21307
+ catalog (APIs or modules) rather than LLM synthesis. `failed` is a short
21308
+ assistant message after provider timeout or error (no retrieval substitute).
21018
21309
  structured:
21019
21310
  description: Optional typed inventory payload for rich UI tables
21020
21311
  allOf:
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.143.0",
3
+ "version": "2.144.1",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",