@thinkai/tai-api-contract 2.115.0 → 2.118.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.115.0
4
+ version: 2.118.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}/...`.
@@ -1537,6 +1537,75 @@ paths:
1537
1537
  schema:
1538
1538
  $ref: "#/components/schemas/ErrorMessageDto"
1539
1539
 
1540
+ /workspaces/{workspaceId}/ai-email-aliases:
1541
+ get:
1542
+ tags: [Workspace]
1543
+ summary: Get workspace email aliases for people not on the org chart
1544
+ description: >
1545
+ Returns workspace-level mappings from alternate work emails to a canonical email
1546
+ (same behaviour as org-chart `alternate_emails`, without adding org-chart members).
1547
+ Empty `aliases` array when unset. Member-level read access.
1548
+ operationId: getWorkspaceAiEmailAliases
1549
+ parameters:
1550
+ - $ref: "#/components/parameters/WorkspaceId"
1551
+ responses:
1552
+ "200":
1553
+ description: Current alias mappings (may be empty)
1554
+ content:
1555
+ application/json:
1556
+ schema:
1557
+ $ref: "#/components/schemas/AiEmailAliasesDto"
1558
+ "401":
1559
+ $ref: "#/components/responses/Unauthorized"
1560
+ "403":
1561
+ $ref: "#/components/responses/Forbidden"
1562
+ "404":
1563
+ description: Workspace does not exist or malformed workspaceId
1564
+ content:
1565
+ application/json:
1566
+ schema:
1567
+ $ref: "#/components/schemas/ErrorMessageDto"
1568
+ put:
1569
+ tags: [Workspace]
1570
+ summary: Set workspace email aliases for people not on the org chart
1571
+ description: >
1572
+ Full-replace workspace-level email alias mappings (e.g.
1573
+ `jane.doe.contractor@example.com` → `jane.doe@example.com`). Same effect as
1574
+ `alternate_emails` on an org row. Does not add org-chart members.
1575
+ `PUT { aliases: [] }` clears all aliases. Requires workspace **admin**.
1576
+ operationId: putWorkspaceAiEmailAliases
1577
+ parameters:
1578
+ - $ref: "#/components/parameters/WorkspaceId"
1579
+ requestBody:
1580
+ required: true
1581
+ content:
1582
+ application/json:
1583
+ schema:
1584
+ $ref: "#/components/schemas/AiEmailAliasesDto"
1585
+ responses:
1586
+ "204":
1587
+ description: Aliases persisted (or cleared).
1588
+ "400":
1589
+ description: Invalid payload
1590
+ content:
1591
+ application/json:
1592
+ schema:
1593
+ $ref: "#/components/schemas/ErrorMessageDto"
1594
+ "401":
1595
+ $ref: "#/components/responses/Unauthorized"
1596
+ "403":
1597
+ description: Forbidden — workspace admin required
1598
+ content:
1599
+ application/json:
1600
+ schema:
1601
+ $ref: "#/components/schemas/ErrorMessageDto"
1602
+ "404":
1603
+ description: Workspace does not exist or malformed workspaceId
1604
+ content:
1605
+ application/json:
1606
+ schema:
1607
+ $ref: "#/components/schemas/ErrorMessageDto"
1608
+
1540
1609
  /workspaces/{workspaceId}/productivity-targets:
1541
1610
  get:
1542
1611
  tags: [Workspace]
@@ -7809,6 +7878,23 @@ paths:
7809
7878
  "409":
7810
7879
  description: No ready repository index in scope
7811
7880
 
7881
+ /workspaces/{workspaceId}/knowledge-pages/generate/status:
7882
+ get:
7883
+ tags: [CodeChat]
7884
+ summary: Get live workspace context generation progress
7885
+ operationId: getWorkspaceContextGenerationStatus
7886
+ parameters:
7887
+ - $ref: "#/components/parameters/WorkspaceId"
7888
+ responses:
7889
+ "200":
7890
+ description: Current or most recent workspace context generation phase
7891
+ content:
7892
+ application/json:
7893
+ schema:
7894
+ $ref: "#/components/schemas/WorkspaceContextGenerationStatusDto"
7895
+ "401":
7896
+ $ref: "#/components/responses/Unauthorized"
7897
+
7812
7898
  /workspaces/{workspaceId}/knowledge-pages/prd/generate:
7813
7899
  post:
7814
7900
  tags: [CodeChat]
@@ -7842,6 +7928,73 @@ paths:
7842
7928
  "409":
7843
7929
  description: No ready repository index in scope
7844
7930
 
7931
+ /workspaces/{workspaceId}/knowledge-graph:
7932
+ get:
7933
+ tags: [CodeChat]
7934
+ summary: Get the persisted workspace knowledge graph
7935
+ description: >-
7936
+ Cross-repository graph (repo nodes and dependency edges) built when workspace
7937
+ knowledge pages are generated. Empty until the first successful generate.
7938
+ operationId: getWorkspaceKnowledgeGraph
7939
+ parameters:
7940
+ - $ref: "#/components/parameters/WorkspaceId"
7941
+ responses:
7942
+ "200":
7943
+ description: Workspace knowledge graph
7944
+ content:
7945
+ application/json:
7946
+ schema:
7947
+ $ref: "#/components/schemas/WorkspaceKnowledgeGraphDto"
7948
+ "401":
7949
+ $ref: "#/components/responses/Unauthorized"
7950
+ "404":
7951
+ description: Graph not generated yet
7952
+
7953
+ /workspaces/{workspaceId}/knowledge-pages/export:
7954
+ get:
7955
+ tags: [CodeChat]
7956
+ summary: Export workspace knowledge for local use
7957
+ description: >-
7958
+ Download workspace context as `WORKSPACE.md` (markdown) or a structured
7959
+ `wkg-pack` JSON bundle. Markdown rewrites `ecg://` deep links per `linkMode`.
7960
+ operationId: exportWorkspaceKnowledgePages
7961
+ parameters:
7962
+ - $ref: "#/components/parameters/WorkspaceId"
7963
+ - name: format
7964
+ in: query
7965
+ required: false
7966
+ schema:
7967
+ type: string
7968
+ enum: [markdown, wkg-pack, zip]
7969
+ default: markdown
7970
+ - name: linkMode
7971
+ in: query
7972
+ required: false
7973
+ description: How to rewrite ecg:// links in markdown export
7974
+ schema:
7975
+ type: string
7976
+ enum: [github, platform, relative]
7977
+ default: github
7978
+ responses:
7979
+ "200":
7980
+ description: Export payload (markdown body or wkg-pack JSON)
7981
+ content:
7982
+ text/markdown:
7983
+ schema:
7984
+ type: string
7985
+ description: WORKSPACE.md body when format=markdown
7986
+ application/json:
7987
+ schema:
7988
+ $ref: "#/components/schemas/WorkspaceKnowledgePackDto"
7989
+ "401":
7990
+ $ref: "#/components/responses/Unauthorized"
7991
+ "403":
7992
+ description: Code Intelligence is disabled for this workspace
7993
+ "404":
7994
+ description: No workspace knowledge pages to export
7995
+ "501":
7996
+ description: ZIP export not implemented (use markdown or wkg-pack)
7997
+
7845
7998
  /workspaces/{workspaceId}/code-intelligence/repo-wiki-json:
7846
7999
  get:
7847
8000
  tags: [CodeChat]
@@ -11171,6 +11324,32 @@ components:
11171
11324
  maximum: 10000
11172
11325
  description: Ceiling — stay at or below this many CI failures per engineer per week. `0` is valid.
11173
11326
 
11327
+ AiEmailAliasEntryDto:
11328
+ type: object
11329
+ required: [canonicalEmail, aliasEmail]
11330
+ additionalProperties: false
11331
+ properties:
11332
+ canonicalEmail:
11333
+ type: string
11334
+ format: email
11335
+ description: Canonical identity for AI tool attribution (person_id target).
11336
+ aliasEmail:
11337
+ type: string
11338
+ format: email
11339
+ description: Alternate Claude/Cursor login email mapped to canonicalEmail.
11340
+
11341
+ AiEmailAliasesDto:
11342
+ type: object
11343
+ required: [aliases]
11344
+ additionalProperties: false
11345
+ properties:
11346
+ aliases:
11347
+ type: array
11348
+ maxItems: 5000
11349
+ items:
11350
+ $ref: "#/components/schemas/AiEmailAliasEntryDto"
11351
+ description: Workspace-level alias mappings (empty array when unset).
11352
+
11174
11353
  TestConnectionResponseDto:
11175
11354
  type: object
11176
11355
  required: [success]
@@ -18974,6 +19153,11 @@ components:
18974
19153
  type: array
18975
19154
  description: Ready repository indexes to synthesize from. Omit or send empty for all ready indexes.
18976
19155
  items: { type: string, format: uuid }
19156
+ deepResearch:
19157
+ type: boolean
19158
+ description: >-
19159
+ When true and execution keys are configured, run a deeper LLM pass to
19160
+ expand Key decisions with multi-repo citations (falls back to deterministic on failure).
18977
19161
 
18978
19162
  GenerateWorkspaceKnowledgePagesResultDto:
18979
19163
  type: object
@@ -18996,6 +19180,26 @@ components:
18996
19180
  usage:
18997
19181
  $ref: "#/components/schemas/CodeIntelligenceUsageDto"
18998
19182
 
19183
+ WorkspaceContextGenerationStatusDto:
19184
+ type: object
19185
+ required: [phase, status, detail, updatedAt]
19186
+ properties:
19187
+ phase:
19188
+ type: string
19189
+ enum: [inventory, facts, contracts, integrations, clustering, llm, persisted]
19190
+ status:
19191
+ type: string
19192
+ enum: [running, complete, failed]
19193
+ detail: { type: string }
19194
+ updatedAt: { type: string, format: date-time }
19195
+ partial:
19196
+ type: object
19197
+ properties:
19198
+ repoCount: { type: integer }
19199
+ contractCount: { type: integer }
19200
+ groupCount: { type: integer }
19201
+ standaloneCount: { type: integer }
19202
+
18999
19203
  GeneratePrdDraftBodyDto:
19000
19204
  type: object
19001
19205
  required: [featureIntent]
@@ -19049,7 +19253,11 @@ components:
19049
19253
  properties:
19050
19254
  id: { type: string, format: uuid }
19051
19255
  workspaceId: { type: string, format: uuid }
19052
- slug: { type: string }
19256
+ slug:
19257
+ type: string
19258
+ description: >-
19259
+ Page slug. `workspace-agent` is the canonical hub; supporting pages include
19260
+ `workspace-overview`, `cross-repo-map`, `shared-concepts`, and `prd-*` drafts.
19053
19261
  title: { type: string }
19054
19262
  bodyMd: { type: string }
19055
19263
  sortOrder: { type: integer }
@@ -19097,6 +19305,136 @@ components:
19097
19305
  platformSnippet:
19098
19306
  type: string
19099
19307
  description: Bounded markdown summary of platform evidence for the system panel
19308
+ insights:
19309
+ $ref: "#/components/schemas/WorkspaceContextInsightsDto"
19310
+
19311
+ WorkspaceContextInsightsDto:
19312
+ type: object
19313
+ required:
19314
+ [
19315
+ kind,
19316
+ version,
19317
+ generatedAt,
19318
+ repoRoles,
19319
+ emergentInsights,
19320
+ sharedConcepts,
19321
+ crossRepoLinks,
19322
+ contracts,
19323
+ groups,
19324
+ standaloneRepos,
19325
+ coverage,
19326
+ integrationFootprints,
19327
+ integrationOpportunities,
19328
+ ]
19329
+ properties:
19330
+ kind: { type: string, enum: [workspace-insights] }
19331
+ version: { type: integer, enum: [2] }
19332
+ generatedAt: { type: string, format: date-time }
19333
+ repoRoles:
19334
+ type: array
19335
+ items:
19336
+ type: object
19337
+ required: [repoId, repoName, role, rationale]
19338
+ properties:
19339
+ repoId: { type: string, format: uuid }
19340
+ repoName: { type: string }
19341
+ role: { type: string }
19342
+ rationale: { type: string }
19343
+ emergentInsights:
19344
+ type: array
19345
+ items:
19346
+ type: object
19347
+ required: [kind, title, detail, repoIds, certainty]
19348
+ properties:
19349
+ kind: { type: string }
19350
+ title: { type: string }
19351
+ detail: { type: string }
19352
+ repoIds: { type: array, items: { type: string, format: uuid } }
19353
+ certainty: { type: string, enum: [fact, inference, possibility] }
19354
+ evidenceRefs: { type: array, items: { type: string } }
19355
+ sharedConcepts:
19356
+ type: array
19357
+ items:
19358
+ type: object
19359
+ required: [term, repoNames, kind]
19360
+ properties:
19361
+ term: { type: string }
19362
+ repoNames: { type: array, items: { type: string } }
19363
+ kind: { type: string }
19364
+ crossRepoLinks:
19365
+ type: array
19366
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgeCrossRepoLinkDto" }
19367
+ contracts:
19368
+ type: array
19369
+ items:
19370
+ type: object
19371
+ required: [id, kind, specKey, producers, consumers, certainty, score]
19372
+ properties:
19373
+ id: { type: string }
19374
+ kind: { type: string }
19375
+ specKey: { type: string }
19376
+ producers: { type: array, items: { type: object, additionalProperties: true } }
19377
+ consumers: { type: array, items: { type: object, additionalProperties: true } }
19378
+ certainty: { type: string, enum: [fact, inference, possibility] }
19379
+ score: { type: number, minimum: 0, maximum: 1 }
19380
+ groups:
19381
+ type: array
19382
+ items:
19383
+ type: object
19384
+ required:
19385
+ [
19386
+ id,
19387
+ kind,
19388
+ label,
19389
+ repoIds,
19390
+ backboneContractIds,
19391
+ possibilityLinkCount,
19392
+ integrationSummary,
19393
+ summary,
19394
+ ]
19395
+ properties:
19396
+ id: { type: string }
19397
+ kind: { type: string }
19398
+ label: { type: string }
19399
+ repoIds: { type: array, items: { type: string, format: uuid } }
19400
+ backboneContractIds: { type: array, items: { type: string } }
19401
+ possibilityLinkCount: { type: integer }
19402
+ integrationSummary: { type: string }
19403
+ summary: { type: string }
19404
+ standaloneRepos:
19405
+ type: array
19406
+ items:
19407
+ type: object
19408
+ required: [repoId, repoName, summary]
19409
+ properties:
19410
+ repoId: { type: string, format: uuid }
19411
+ repoName: { type: string }
19412
+ summary: { type: string }
19413
+ coverage:
19414
+ type: array
19415
+ items:
19416
+ type: object
19417
+ required: [repoId, detected, resolved, external, unresolved]
19418
+ properties:
19419
+ repoId: { type: string, format: uuid }
19420
+ detected: { type: integer }
19421
+ resolved: { type: integer }
19422
+ external: { type: integer }
19423
+ unresolved: { type: integer }
19424
+ integrationFootprints:
19425
+ type: array
19426
+ items:
19427
+ type: object
19428
+ required: [repoId, repoName, availableSignals, missingSignals, gaps]
19429
+ properties:
19430
+ repoId: { type: string, format: uuid }
19431
+ repoName: { type: string }
19432
+ availableSignals: { type: array, items: { type: string } }
19433
+ missingSignals: { type: array, items: { type: string } }
19434
+ gaps: { type: array, items: { type: string } }
19435
+ integrationOpportunities:
19436
+ type: array
19437
+ items: { type: string }
19100
19438
 
19101
19439
  WorkspaceKnowledgePageListDto:
19102
19440
  type: object
@@ -19108,6 +19446,106 @@ components:
19108
19446
  systemContext:
19109
19447
  $ref: "#/components/schemas/WorkspaceKnowledgeSystemContextDto"
19110
19448
 
19449
+ WorkspaceKnowledgeGraphNodeDto:
19450
+ type: object
19451
+ required: [id, label, kind]
19452
+ properties:
19453
+ id: { type: string }
19454
+ label: { type: string }
19455
+ score: { type: number, minimum: 0, maximum: 1 }
19456
+ contractId: { type: string }
19457
+ kind:
19458
+ type: string
19459
+ enum: [repo, package, protocol]
19460
+
19461
+ WorkspaceKnowledgeGraphEdgeDto:
19462
+ type: object
19463
+ required: [from, to, relation]
19464
+ properties:
19465
+ from: { type: string, description: Source node id (usually repoId) }
19466
+ to: { type: string, description: Target node id (usually repoId) }
19467
+ relation: { type: string }
19468
+ label: { type: string }
19469
+ certainty:
19470
+ type: string
19471
+ enum: [fact, inference, possibility]
19472
+
19473
+ WorkspaceKnowledgeGraphDto:
19474
+ type: object
19475
+ required: [kind, version, exportedAt, nodes, edges]
19476
+ properties:
19477
+ kind: { type: string, enum: [workspace-kg] }
19478
+ version: { type: integer }
19479
+ exportedAt: { type: string, format: date-time }
19480
+ nodes:
19481
+ type: array
19482
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgeGraphNodeDto" }
19483
+ edges:
19484
+ type: array
19485
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgeGraphEdgeDto" }
19486
+
19487
+ WorkspaceKnowledgeCrossRepoLinkDto:
19488
+ type: object
19489
+ required: [fromRepoId, toRepoId, relation, certainty, evidence, label]
19490
+ properties:
19491
+ fromRepoId: { type: string, format: uuid }
19492
+ toRepoId: { type: string, format: uuid }
19493
+ fromRepoName: { type: string }
19494
+ toRepoName: { type: string }
19495
+ relation: { type: string }
19496
+ certainty:
19497
+ type: string
19498
+ enum: [fact, inference, possibility]
19499
+ evidence: { type: string }
19500
+ label: { type: string }
19501
+
19502
+ WorkspaceKnowledgePackRepoDto:
19503
+ type: object
19504
+ required: [repoId, repoName]
19505
+ properties:
19506
+ repoId: { type: string, format: uuid }
19507
+ repoName: { type: string }
19508
+ commitSha: { type: string, nullable: true }
19509
+ providerSlug: { type: string, nullable: true }
19510
+ wikiOutline:
19511
+ type: array
19512
+ items:
19513
+ type: object
19514
+ required: [slug, title]
19515
+ properties:
19516
+ slug: { type: string }
19517
+ title: { type: string }
19518
+
19519
+ WorkspaceKnowledgePackPageDto:
19520
+ type: object
19521
+ required: [slug, title, bodyMd]
19522
+ properties:
19523
+ slug: { type: string }
19524
+ title: { type: string }
19525
+ bodyMd: { type: string }
19526
+
19527
+ WorkspaceKnowledgePackDto:
19528
+ type: object
19529
+ required: [kind, version, exportedAt, pages, crossRepoLinks, repos]
19530
+ properties:
19531
+ kind: { type: string, enum: [wkg-pack] }
19532
+ version: { type: integer }
19533
+ exportedAt: { type: string, format: date-time }
19534
+ workspaceName: { type: string }
19535
+ pages:
19536
+ type: array
19537
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgePackPageDto" }
19538
+ crossRepoLinks:
19539
+ type: array
19540
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgeCrossRepoLinkDto" }
19541
+ repos:
19542
+ type: array
19543
+ items: { $ref: "#/components/schemas/WorkspaceKnowledgePackRepoDto" }
19544
+ graph:
19545
+ $ref: "#/components/schemas/WorkspaceKnowledgeGraphDto"
19546
+ workspaceContext:
19547
+ $ref: "#/components/schemas/WorkspaceContextInsightsDto"
19548
+
19111
19549
  CodeIntelligenceUsageDto:
19112
19550
  type: object
19113
19551
  required: [operation, provider, inputTokens, outputTokens]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.115.0",
3
+ "version": "2.118.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",