@thinkai/tai-api-contract 2.116.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.116.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}/...`.
@@ -7878,6 +7878,23 @@ paths:
7878
7878
  "409":
7879
7879
  description: No ready repository index in scope
7880
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
+
7881
7898
  /workspaces/{workspaceId}/knowledge-pages/prd/generate:
7882
7899
  post:
7883
7900
  tags: [CodeChat]
@@ -7911,6 +7928,73 @@ paths:
7911
7928
  "409":
7912
7929
  description: No ready repository index in scope
7913
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
+
7914
7998
  /workspaces/{workspaceId}/code-intelligence/repo-wiki-json:
7915
7999
  get:
7916
8000
  tags: [CodeChat]
@@ -19069,6 +19153,11 @@ components:
19069
19153
  type: array
19070
19154
  description: Ready repository indexes to synthesize from. Omit or send empty for all ready indexes.
19071
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).
19072
19161
 
19073
19162
  GenerateWorkspaceKnowledgePagesResultDto:
19074
19163
  type: object
@@ -19091,6 +19180,26 @@ components:
19091
19180
  usage:
19092
19181
  $ref: "#/components/schemas/CodeIntelligenceUsageDto"
19093
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
+
19094
19203
  GeneratePrdDraftBodyDto:
19095
19204
  type: object
19096
19205
  required: [featureIntent]
@@ -19144,7 +19253,11 @@ components:
19144
19253
  properties:
19145
19254
  id: { type: string, format: uuid }
19146
19255
  workspaceId: { type: string, format: uuid }
19147
- 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.
19148
19261
  title: { type: string }
19149
19262
  bodyMd: { type: string }
19150
19263
  sortOrder: { type: integer }
@@ -19192,6 +19305,136 @@ components:
19192
19305
  platformSnippet:
19193
19306
  type: string
19194
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 }
19195
19438
 
19196
19439
  WorkspaceKnowledgePageListDto:
19197
19440
  type: object
@@ -19203,6 +19446,106 @@ components:
19203
19446
  systemContext:
19204
19447
  $ref: "#/components/schemas/WorkspaceKnowledgeSystemContextDto"
19205
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
+
19206
19549
  CodeIntelligenceUsageDto:
19207
19550
  type: object
19208
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.116.0",
3
+ "version": "2.118.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",