@thinkai/tai-api-contract 2.216.0 → 2.220.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.
@@ -1,7 +1,7 @@
1
1
  openapi: 3.0.3
2
2
  info:
3
3
  title: ThinkAI API
4
- version: 2.216.0
4
+ version: 2.220.0
5
5
  description: >
6
6
  Contract surface for the AI Driven SDLC backend used by ThinkAI.
7
7
  Workspace-scoped routes use `/workspaces/{workspaceId}/...`.
@@ -4984,6 +4984,54 @@ paths:
4984
4984
  "404":
4985
4985
  description: Feature flag off or workspace not found
4986
4986
 
4987
+ /workspaces/{workspaceId}/insights/team-efficiency/bundle:
4988
+ get:
4989
+ tags: [TeamEfficiency]
4990
+ summary: Team Efficiency page bundle
4991
+ description: >
4992
+ One round trip for the Team Efficiency page. Metrics are computed for the rolling
4993
+ `months` calendar months (default 3) against the previous period. A department is the
4994
+ union of its teams. All departments plus all teams, and person scope, are rejected with
4995
+ 400. Returns 404 when `backend-api.teamEfficiency` is off (unless the workspace is on
4996
+ the allowlist).
4997
+ operationId: getTeamEfficiencyBundle
4998
+ parameters:
4999
+ - $ref: "#/components/parameters/WorkspaceId"
5000
+ - name: department
5001
+ in: query
5002
+ schema: { type: string }
5003
+ - name: team
5004
+ in: query
5005
+ schema: { type: string }
5006
+ - name: months
5007
+ in: query
5008
+ schema: { type: integer, minimum: 1, maximum: 6, default: 3 }
5009
+ responses:
5010
+ "200":
5011
+ description: Team Efficiency metrics, window, and setup checklist
5012
+ content:
5013
+ application/json:
5014
+ schema:
5015
+ $ref: "#/components/schemas/TeamEfficiencyBundleDto"
5016
+ "400":
5017
+ description: >
5018
+ Invalid scope or months (`scope_required`, `person_scope_not_supported`,
5019
+ `team_not_found`, `department_not_found`, `invalid_months`)
5020
+ content:
5021
+ application/json:
5022
+ schema:
5023
+ type: object
5024
+ required: [error, code]
5025
+ properties:
5026
+ error: { type: string }
5027
+ code: { type: string }
5028
+ "401":
5029
+ $ref: "#/components/responses/Unauthorized"
5030
+ "403":
5031
+ $ref: "#/components/responses/Forbidden"
5032
+ "404":
5033
+ description: Feature flag off or workspace not found
5034
+
4987
5035
  /workspaces/{workspaceId}/insights/devex/sync:
4988
5036
  post:
4989
5037
  tags: [TeamEfficiency]
@@ -11452,11 +11500,17 @@ paths:
11452
11500
  $ref: "#/components/schemas/CodeChatPostMessageBodyDto"
11453
11501
  responses:
11454
11502
  "200":
11455
- description: Assistant message
11503
+ description: >
11504
+ Assistant message. With `stream: true` the body is `text/event-stream`:
11505
+ `event: stage` (`{ stage, detail? }`), `event: token` (`{ text }`),
11506
+ `event: done` (CodeChatMessageReplyDto), or `event: error` (`{ error, code }`).
11456
11507
  content:
11457
11508
  application/json:
11458
11509
  schema:
11459
11510
  $ref: "#/components/schemas/CodeChatMessageReplyDto"
11511
+ text/event-stream:
11512
+ schema:
11513
+ type: string
11460
11514
  "401":
11461
11515
  $ref: "#/components/responses/Unauthorized"
11462
11516
  "403":
@@ -12278,6 +12332,39 @@ paths:
12278
12332
  "409":
12279
12333
  description: Corpus not ready
12280
12334
 
12335
+ /workspaces/{workspaceId}/code-chat/tools/ask:
12336
+ post:
12337
+ tags: [CodeChat]
12338
+ summary: MCP/agent tool — grounded Ask answer with citations
12339
+ description: >
12340
+ Read-only. Runs the same Ask pipeline as Conversations for the repos in `repoIds`
12341
+ (every ready repo when `repoIds` is omitted). Does not edit files or open pull requests.
12342
+ The answer is `result.content` with `result.citations`. Other graph tools, when given
12343
+ more than one repo, return the same rows as a single repo plus `repoId` and `repoName`.
12344
+ operationId: codeChatAskTool
12345
+ x-test-coverage-skip: covered by code-context MCP unit tests
12346
+ parameters:
12347
+ - $ref: "#/components/parameters/WorkspaceId"
12348
+ requestBody:
12349
+ required: true
12350
+ content:
12351
+ application/json:
12352
+ schema:
12353
+ $ref: "#/components/schemas/CodeChatAskToolBodyDto"
12354
+ responses:
12355
+ "200":
12356
+ description: Grounded answer
12357
+ content:
12358
+ application/json:
12359
+ schema:
12360
+ $ref: "#/components/schemas/CodeChatAskToolResponseDto"
12361
+ "400":
12362
+ description: Missing or oversized question
12363
+ "401":
12364
+ $ref: "#/components/responses/Unauthorized"
12365
+ "409":
12366
+ description: Corpus not ready
12367
+
12281
12368
  /notifications/email/unsubscribe:
12282
12369
  get:
12283
12370
  tags: [Notifications]
@@ -17117,6 +17204,256 @@ components:
17117
17204
  items:
17118
17205
  $ref: "#/components/schemas/DevexResultDto"
17119
17206
 
17207
+ TeamEfficiencyDataQualityDto:
17208
+ type: object
17209
+ required: [code, message]
17210
+ additionalProperties: false
17211
+ properties:
17212
+ code:
17213
+ type: string
17214
+ enum:
17215
+ - low_data
17216
+ - missing_start
17217
+ - batch_closed
17218
+ - no_roster
17219
+ - not_configured
17220
+ - no_bug_data
17221
+ - no_survey
17222
+ - unattributed_failures
17223
+ - excluded_incidents
17224
+ - unlinked_incidents
17225
+ - unknown_review_comments
17226
+ - no_linked_deploys
17227
+ - no_deployments
17228
+ - six_month_window
17229
+ message: { type: string }
17230
+ percent: { type: number }
17231
+ count: { type: integer }
17232
+
17233
+ TeamEfficiencyMetricDto:
17234
+ type: object
17235
+ required:
17236
+ - id
17237
+ - label
17238
+ - unit
17239
+ - monthly
17240
+ - sampleSize
17241
+ - lowData
17242
+ - reportable
17243
+ - owner
17244
+ - counterweightIds
17245
+ - dataQuality
17246
+ - href
17247
+ additionalProperties: false
17248
+ properties:
17249
+ id:
17250
+ type: string
17251
+ enum:
17252
+ - flow-time
17253
+ - pr-throughput-per-engineer
17254
+ - escaped-defects
17255
+ - devex-score
17256
+ - deployment-frequency
17257
+ - lead-time-for-changes
17258
+ - change-failure-rate
17259
+ - time-to-restore
17260
+ - pr-size
17261
+ - time-to-first-review
17262
+ - pr-approvals-without-comments
17263
+ label: { type: string }
17264
+ shortLabel:
17265
+ type: string
17266
+ description: Short card label, for example "Recovery time".
17267
+ unit: { type: string }
17268
+ value: { type: number }
17269
+ p85: { type: number }
17270
+ previous: { type: number }
17271
+ monthly:
17272
+ type: array
17273
+ description: Per calendar month in the window, oldest first. null when no data.
17274
+ items: { type: number, nullable: true }
17275
+ sampleSize: { type: integer }
17276
+ lowData:
17277
+ type: boolean
17278
+ description: Fewer than 10 samples.
17279
+ reportable: { type: boolean }
17280
+ numerator: { type: number }
17281
+ denominator: { type: number }
17282
+ owner: { type: string }
17283
+ counterweightIds:
17284
+ type: array
17285
+ items: { type: string }
17286
+ dataQuality:
17287
+ type: array
17288
+ items:
17289
+ $ref: "#/components/schemas/TeamEfficiencyDataQualityDto"
17290
+ href:
17291
+ type: string
17292
+ description: Drill-through route; the client appends scope and window.
17293
+ breakdown:
17294
+ type: object
17295
+ description: Counts by key, for example escaped defects by severity.
17296
+ additionalProperties: { type: number }
17297
+ previousMonthly:
17298
+ type: array
17299
+ description: The same series for the months before `monthly`, oldest first.
17300
+ items: { type: number, nullable: true }
17301
+ stages:
17302
+ $ref: "#/components/schemas/TeamEfficiencyLeadTimeStagesDto"
17303
+ devex:
17304
+ $ref: "#/components/schemas/TeamEfficiencyDevexDetailDto"
17305
+ signals:
17306
+ type: array
17307
+ items:
17308
+ $ref: "#/components/schemas/TeamEfficiencySignalDto"
17309
+
17310
+ TeamEfficiencyLeadTimeStagesDto:
17311
+ type: object
17312
+ description: Median hours per lead-time stage.
17313
+ required: [codingHours, pickupHours, reviewHours, deployHours]
17314
+ additionalProperties: false
17315
+ properties:
17316
+ codingHours: { type: number }
17317
+ pickupHours: { type: number }
17318
+ reviewHours: { type: number }
17319
+ deployHours: { type: number }
17320
+
17321
+ TeamEfficiencySignalDto:
17322
+ type: object
17323
+ required: [id, label, flagged]
17324
+ additionalProperties: false
17325
+ properties:
17326
+ id:
17327
+ type: string
17328
+ enum:
17329
+ - review-time-drop
17330
+ - approvals-without-comments-rise
17331
+ - pr-size-falling-flow-flat
17332
+ label: { type: string }
17333
+ flagged: { type: boolean }
17334
+ detail:
17335
+ type: string
17336
+ description: Short detail shown when flagged, for example "24% to 31%".
17337
+
17338
+ TeamEfficiencyDevexDetailDto:
17339
+ type: object
17340
+ required: [quarter, dimensions, quarters, responseCount, lowResponseRate, rolledUp]
17341
+ additionalProperties: false
17342
+ properties:
17343
+ quarter: { type: string, example: "2026-Q3" }
17344
+ dimensions:
17345
+ type: object
17346
+ required: [feedbackLoops, cognitiveLoad, flowState]
17347
+ additionalProperties: false
17348
+ properties:
17349
+ feedbackLoops: { type: number }
17350
+ cognitiveLoad: { type: number }
17351
+ flowState: { type: number }
17352
+ quarters:
17353
+ type: array
17354
+ description: Latest quarters, oldest first.
17355
+ items:
17356
+ type: object
17357
+ required: [quarter, score]
17358
+ additionalProperties: false
17359
+ properties:
17360
+ quarter: { type: string }
17361
+ score: { type: number }
17362
+ responseCount: { type: integer }
17363
+ rosterSize: { type: integer }
17364
+ responseRate:
17365
+ type: number
17366
+ description: 0 to 1.
17367
+ lowResponseRate: { type: boolean }
17368
+ rolledUp:
17369
+ type: boolean
17370
+ description: Fewer than 5 responses, so the score shown is the department's.
17371
+
17372
+ TeamEfficiencySetupItemDto:
17373
+ type: object
17374
+ required: [id, label, done, hint]
17375
+ additionalProperties: false
17376
+ properties:
17377
+ id: { type: string }
17378
+ label: { type: string }
17379
+ done: { type: boolean }
17380
+ hint: { type: string }
17381
+
17382
+ TeamEfficiencyBundleDto:
17383
+ type: object
17384
+ required: [scope, summary, aiAdoption, window, metrics, setup, generatedAt]
17385
+ additionalProperties: false
17386
+ properties:
17387
+ summary:
17388
+ type: object
17389
+ required: [engineers, issuesDone, mergedPrs, deployments]
17390
+ additionalProperties: false
17391
+ properties:
17392
+ engineers: { type: integer }
17393
+ issuesDone: { type: integer }
17394
+ mergedPrs: { type: integer }
17395
+ deployments: { type: integer }
17396
+ survey:
17397
+ type: object
17398
+ required: [responses]
17399
+ additionalProperties: false
17400
+ properties:
17401
+ responses: { type: integer }
17402
+ invited: { type: integer }
17403
+ aiAdoption:
17404
+ type: array
17405
+ description: >-
17406
+ Share of engineers using an AI tool per month, for the months before the window
17407
+ followed by the window months, oldest first. null when no data.
17408
+ items: { type: number, nullable: true }
17409
+ scope:
17410
+ type: object
17411
+ required: [teamIds, rosterEngineerCount]
17412
+ additionalProperties: false
17413
+ properties:
17414
+ department: { type: string }
17415
+ team: { type: string }
17416
+ teamIds:
17417
+ type: array
17418
+ items: { type: string }
17419
+ rosterEngineerCount:
17420
+ type: integer
17421
+ description: Org-chart engineers, excluding managers, product managers and designers.
17422
+ window:
17423
+ type: object
17424
+ required: [monthCount, start, end, previousStart, previousEnd, months]
17425
+ additionalProperties: false
17426
+ properties:
17427
+ monthCount: { type: integer }
17428
+ start: { type: string, format: date-time }
17429
+ end: { type: string, format: date-time }
17430
+ previousStart: { type: string, format: date-time }
17431
+ previousEnd: { type: string, format: date-time }
17432
+ months:
17433
+ type: array
17434
+ items:
17435
+ type: object
17436
+ required: [start, end]
17437
+ additionalProperties: false
17438
+ properties:
17439
+ start: { type: string, format: date-time }
17440
+ end: { type: string, format: date-time }
17441
+ metrics:
17442
+ type: array
17443
+ items:
17444
+ $ref: "#/components/schemas/TeamEfficiencyMetricDto"
17445
+ setup:
17446
+ type: object
17447
+ required: [items, complete]
17448
+ additionalProperties: false
17449
+ properties:
17450
+ items:
17451
+ type: array
17452
+ items:
17453
+ $ref: "#/components/schemas/TeamEfficiencySetupItemDto"
17454
+ complete: { type: boolean }
17455
+ generatedAt: { type: string, format: date-time }
17456
+
17120
17457
  DevexSyncRequestDto:
17121
17458
  type: object
17122
17459
  additionalProperties: false
@@ -18430,6 +18767,53 @@ components:
18430
18767
  version:
18431
18768
  type: string
18432
18769
  description: Present for Prometheus verify success — Alertmanager version when available.
18770
+ survey:
18771
+ type: object
18772
+ description: >
18773
+ Present for SurveyMonkey verify success. Question and choice labels only (never
18774
+ answers), so the connect screen can pick the team question and rating questions.
18775
+ required: [title, questions]
18776
+ properties:
18777
+ title:
18778
+ type: string
18779
+ questions:
18780
+ type: array
18781
+ items:
18782
+ type: object
18783
+ required: [id, text, ratingScale, choices]
18784
+ properties:
18785
+ id:
18786
+ type: string
18787
+ text:
18788
+ type: string
18789
+ ratingScale:
18790
+ type: boolean
18791
+ description: Every choice carries a 1-5 weight or position, so the question can be scored.
18792
+ choices:
18793
+ type: array
18794
+ items:
18795
+ type: object
18796
+ required: [id, text]
18797
+ properties:
18798
+ id:
18799
+ type: string
18800
+ text:
18801
+ type: string
18802
+ teamMatch:
18803
+ type: object
18804
+ description: >
18805
+ Present for SurveyMonkey verify success when the request carried `teamQuestionId`.
18806
+ How many survey choices matched an org-chart team by name.
18807
+ required: [matched, total, unmatched]
18808
+ properties:
18809
+ matched:
18810
+ type: integer
18811
+ total:
18812
+ type: integer
18813
+ unmatched:
18814
+ type: array
18815
+ items:
18816
+ type: string
18433
18817
 
18434
18818
  CursorKeyUsageDto:
18435
18819
  type: object
@@ -29777,6 +30161,21 @@ components:
29777
30161
  maxItems: 5
29778
30162
  items: { type: string, format: uuid }
29779
30163
  description: Previously uploaded attachment ids to bind to this user turn
30164
+ focusWikiSlug:
30165
+ type: string
30166
+ maxLength: 200
30167
+ description: >
30168
+ Slug of the wiki page the user has open. Prepended to Ask wiki context when the
30169
+ question is relevant to it or refers to it deictically ("explain this page").
30170
+ focusWikiRepoId:
30171
+ type: string
30172
+ format: uuid
30173
+ description: Repository of `focusWikiSlug` (slugs such as `overview` repeat across repos).
30174
+ stream:
30175
+ type: boolean
30176
+ description: >
30177
+ When true the server replies with `text/event-stream` (`stage`, `token`, `done`,
30178
+ `error` events). The `done` event carries the same JSON as the non-streaming 200 body.
29780
30179
 
29781
30180
  CodeChatUploadAttachmentBodyDto:
29782
30181
  type: object
@@ -30978,6 +31377,39 @@ components:
30978
31377
  type: array
30979
31378
  items: { type: string, format: uuid }
30980
31379
 
31380
+ CodeChatAskToolBodyDto:
31381
+ type: object
31382
+ required: [question]
31383
+ properties:
31384
+ question: { type: string, maxLength: 4000 }
31385
+ repoIds:
31386
+ type: array
31387
+ items: { type: string, format: uuid }
31388
+
31389
+ CodeChatAskToolResponseDto:
31390
+ type: object
31391
+ required: [tool, result]
31392
+ properties:
31393
+ tool: { type: string, enum: [ask] }
31394
+ note: { type: string }
31395
+ scanned:
31396
+ type: array
31397
+ items:
31398
+ type: object
31399
+ additionalProperties: true
31400
+ result:
31401
+ type: object
31402
+ required: [content, citations, mode]
31403
+ properties:
31404
+ content: { type: string }
31405
+ mode: { type: string }
31406
+ intent: { type: string }
31407
+ citations:
31408
+ type: array
31409
+ items:
31410
+ type: object
31411
+ additionalProperties: true
31412
+
30981
31413
  CodeChatContextPackDto:
30982
31414
  type: object
30983
31415
  required: [summary, symbols, references, citations, snippets]
@@ -1306,6 +1306,11 @@
1306
1306
  "method": "POST",
1307
1307
  "path": "/workspaces/{workspaceId}/code-chat/tools/get_context_pack"
1308
1308
  },
1309
+ "codeChatAskTool": {
1310
+ "status": "implemented",
1311
+ "method": "POST",
1312
+ "path": "/workspaces/{workspaceId}/code-chat/tools/ask"
1313
+ },
1309
1314
  "getNotificationEmailUnsubscribe": {
1310
1315
  "status": "implemented",
1311
1316
  "method": "GET",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.216.0",
3
+ "version": "2.220.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",