@thinkai/tai-api-contract 2.169.0 → 2.171.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.169.0
4
+ version: 2.171.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}/...`.
@@ -235,6 +235,339 @@ paths:
235
235
  example:
236
236
  error: Service unavailable
237
237
 
238
+ /admin/assessment-preflight:
239
+ post:
240
+ tags: [PlatformAdmin]
241
+ summary: Evaluate assessment preflight
242
+ operationId: runAssessmentPreflight
243
+ description: >
244
+ Returns whether one paid assessment may start the five-business-day clock.
245
+ Pending approval does not count as connected. Optional Jira and incident
246
+ gaps are chapters, not preflight failures. Premium stays false while
247
+ currency, confounder rules, the active-engineer rule, or the working-day
248
+ calendar is unset.
249
+
250
+ **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
251
+ requestBody:
252
+ required: true
253
+ content:
254
+ application/json:
255
+ schema:
256
+ type: object
257
+ required:
258
+ - offerId
259
+ - sourceControl
260
+ - platformExecutionReady
261
+ - scans
262
+ - windows
263
+ - premiumAi
264
+ - jiraSelected
265
+ - incidentSelected
266
+ - incidentAvailable
267
+ properties:
268
+ offerId:
269
+ type: string
270
+ enum: [engineering_readiness_baseline, agentic_ai_roi]
271
+ sourceControl:
272
+ type: string
273
+ enum: [connected, pending_approval, setup_in_progress, revoked, stale, missing]
274
+ platformExecutionReady:
275
+ type: boolean
276
+ repositoryCount:
277
+ type: integer
278
+ nullable: true
279
+ activeEngineerCount:
280
+ type: integer
281
+ nullable: true
282
+ scans:
283
+ type: object
284
+ required: [status]
285
+ properties:
286
+ status:
287
+ type: string
288
+ enum: [unknown, known]
289
+ fresh:
290
+ type: boolean
291
+ windows:
292
+ type: object
293
+ required: [status]
294
+ properties:
295
+ status:
296
+ type: string
297
+ enum: [unknown, known]
298
+ currentComplete:
299
+ type: boolean
300
+ preComplete:
301
+ type: boolean
302
+ postComplete:
303
+ type: boolean
304
+ premiumAi:
305
+ type: object
306
+ required: [cursor, claude, copilot]
307
+ properties:
308
+ cursor:
309
+ type: boolean
310
+ claude:
311
+ type: boolean
312
+ copilot:
313
+ type: boolean
314
+ jiraSelected:
315
+ type: boolean
316
+ incidentSelected:
317
+ type: boolean
318
+ incidentAvailable:
319
+ type: boolean
320
+ owner:
321
+ type: string
322
+ nullable: true
323
+ responses:
324
+ "200":
325
+ description: Preflight result. `dueDate` is set only when `ready` is true.
326
+ content:
327
+ application/json:
328
+ schema:
329
+ type: object
330
+ required:
331
+ [ready, clockStarted, dueDate, owner, blocker, nextAction, failures, chapters]
332
+ properties:
333
+ ready:
334
+ type: boolean
335
+ clockStarted:
336
+ type: boolean
337
+ dueDate:
338
+ type: string
339
+ nullable: true
340
+ format: date
341
+ owner:
342
+ type: string
343
+ nullable: true
344
+ blocker:
345
+ type: string
346
+ nullable: true
347
+ nextAction:
348
+ type: object
349
+ nullable: true
350
+ required: [label, href]
351
+ properties:
352
+ label:
353
+ type: string
354
+ href:
355
+ type: string
356
+ nullable: true
357
+ failures:
358
+ type: array
359
+ items:
360
+ type: object
361
+ required: [code, blocker, nextAction]
362
+ properties:
363
+ code:
364
+ type: string
365
+ blocker:
366
+ type: string
367
+ nextAction:
368
+ type: object
369
+ required: [label, href]
370
+ properties:
371
+ label:
372
+ type: string
373
+ href:
374
+ type: string
375
+ nullable: true
376
+ chapters:
377
+ type: array
378
+ items:
379
+ type: object
380
+ required: [id, status, reason]
381
+ properties:
382
+ id:
383
+ type: string
384
+ enum: [jira, incidents]
385
+ status:
386
+ type: string
387
+ enum: [unavailable]
388
+ reason:
389
+ type: string
390
+ "400":
391
+ description: Body failed validation.
392
+ content:
393
+ application/json:
394
+ schema:
395
+ $ref: "#/components/schemas/ErrorMessageDto"
396
+ example:
397
+ error: offerId is not a known assessment offer
398
+ code: invalid_body
399
+ "401":
400
+ description: Missing or invalid JWT.
401
+ content:
402
+ application/json:
403
+ schema:
404
+ $ref: "#/components/schemas/ErrorMessageDto"
405
+ "403":
406
+ description: Caller is not a platform admin.
407
+ content:
408
+ application/json:
409
+ schema:
410
+ $ref: "#/components/schemas/ErrorMessageDto"
411
+ example:
412
+ error: Forbidden
413
+ code: forbidden
414
+
415
+ /admin/assessment-manifest-validation:
416
+ post:
417
+ tags: [PlatformAdmin]
418
+ summary: Validate an assessment manifest before export
419
+ operationId: runAssessmentManifestValidation
420
+ description: >
421
+ Runs the fail-closed manifest check for one sold assessment. The server
422
+ ignores `manifest.validation` and `manifest.watermark` from the client.
423
+ `buyerDeliverable` is true only when the result is validated and
424
+ `shareMode` is internal. An external share-safe result can be validated
425
+ and is never the buyer file. Unset or exceeded tolerances fail. No
426
+ numeric tolerance is assumed. GitLab and Bitbucket fixtures are not part
427
+ of this operation.
428
+
429
+ **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
430
+ requestBody:
431
+ required: true
432
+ content:
433
+ application/json:
434
+ schema:
435
+ type: object
436
+ required:
437
+ - manifest
438
+ - workspaceId
439
+ - expectedWorkspaceId
440
+ - expectedRepositoryIds
441
+ - soldWindowComplete
442
+ - premiumAiAssessable
443
+ - namedPersonSectionIds
444
+ - tolerances
445
+ properties:
446
+ manifest:
447
+ type: object
448
+ required:
449
+ - offerId
450
+ - dictionaryVersion
451
+ - validation
452
+ - shareMode
453
+ - watermark
454
+ - scope
455
+ - windows
456
+ - sources
457
+ - consent
458
+ - sections
459
+ properties:
460
+ offerId:
461
+ type: string
462
+ enum: [engineering_readiness_baseline, agentic_ai_roi]
463
+ dictionaryVersion:
464
+ type: string
465
+ validation:
466
+ type: string
467
+ enum: [validated, not_validated]
468
+ shareMode:
469
+ type: string
470
+ enum: [internal, external]
471
+ watermark:
472
+ type: string
473
+ nullable: true
474
+ enum: ["NOT VALIDATED", "SAMPLE · SYNTHETIC DATA"]
475
+ scope:
476
+ type: object
477
+ windows:
478
+ type: object
479
+ sources:
480
+ type: array
481
+ items:
482
+ type: object
483
+ consent:
484
+ type: object
485
+ sections:
486
+ type: array
487
+ items:
488
+ type: object
489
+ workspaceId:
490
+ type: string
491
+ expectedWorkspaceId:
492
+ type: string
493
+ expectedRepositoryIds:
494
+ type: array
495
+ items:
496
+ type: string
497
+ soldWindowComplete:
498
+ type: boolean
499
+ premiumAiAssessable:
500
+ type: boolean
501
+ namedPersonSectionIds:
502
+ type: array
503
+ items:
504
+ type: string
505
+ tolerances:
506
+ type: array
507
+ items:
508
+ type: object
509
+ required: [id, status]
510
+ properties:
511
+ id:
512
+ type: string
513
+ status:
514
+ type: string
515
+ enum: [unset, exceeded, within]
516
+ responses:
517
+ "200":
518
+ description: Validation result. Client validation and watermark inputs are ignored.
519
+ content:
520
+ application/json:
521
+ schema:
522
+ type: object
523
+ required: [buyerDeliverable, validation, watermark, reasons, contentHash]
524
+ properties:
525
+ buyerDeliverable:
526
+ type: boolean
527
+ validation:
528
+ type: string
529
+ enum: [validated, not_validated]
530
+ watermark:
531
+ type: string
532
+ nullable: true
533
+ enum: ["NOT VALIDATED"]
534
+ reasons:
535
+ type: array
536
+ items:
537
+ type: object
538
+ required: [code, message]
539
+ properties:
540
+ code:
541
+ type: string
542
+ message:
543
+ type: string
544
+ contentHash:
545
+ type: string
546
+ "400":
547
+ description: Body failed validation.
548
+ content:
549
+ application/json:
550
+ schema:
551
+ $ref: "#/components/schemas/ErrorMessageDto"
552
+ example:
553
+ error: manifest.offerId is not a known assessment offer
554
+ code: invalid_body
555
+ "401":
556
+ description: Missing or invalid JWT.
557
+ content:
558
+ application/json:
559
+ schema:
560
+ $ref: "#/components/schemas/ErrorMessageDto"
561
+ "403":
562
+ description: Caller is not a platform admin.
563
+ content:
564
+ application/json:
565
+ schema:
566
+ $ref: "#/components/schemas/ErrorMessageDto"
567
+ example:
568
+ error: Forbidden
569
+ code: forbidden
570
+
238
571
  /admin/readiness/token-usage:
239
572
  get:
240
573
  tags: [PlatformAdmin]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.169.0",
3
+ "version": "2.171.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -46,6 +46,48 @@ export interface paths {
46
46
  patch?: never;
47
47
  trace?: never;
48
48
  };
49
+ "/admin/assessment-preflight": {
50
+ parameters: {
51
+ query?: never;
52
+ header?: never;
53
+ path?: never;
54
+ cookie?: never;
55
+ };
56
+ get?: never;
57
+ put?: never;
58
+ /**
59
+ * Evaluate assessment preflight
60
+ * @description Returns whether one paid assessment may start the five-business-day clock. Pending approval does not count as connected. Optional Jira and incident gaps are chapters, not preflight failures. Premium stays false while currency, confounder rules, the active-engineer rule, or the working-day calendar is unset.
61
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
62
+ */
63
+ post: operations["runAssessmentPreflight"];
64
+ delete?: never;
65
+ options?: never;
66
+ head?: never;
67
+ patch?: never;
68
+ trace?: never;
69
+ };
70
+ "/admin/assessment-manifest-validation": {
71
+ parameters: {
72
+ query?: never;
73
+ header?: never;
74
+ path?: never;
75
+ cookie?: never;
76
+ };
77
+ get?: never;
78
+ put?: never;
79
+ /**
80
+ * Validate an assessment manifest before export
81
+ * @description Runs the fail-closed manifest check for one sold assessment. The server ignores `manifest.validation` and `manifest.watermark` from the client. `buyerDeliverable` is true only when the result is validated and `shareMode` is internal. An external share-safe result can be validated and is never the buyer file. Unset or exceeded tolerances fail. No numeric tolerance is assumed. GitLab and Bitbucket fixtures are not part of this operation.
82
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
83
+ */
84
+ post: operations["runAssessmentManifestValidation"];
85
+ delete?: never;
86
+ options?: never;
87
+ head?: never;
88
+ patch?: never;
89
+ trace?: never;
90
+ };
49
91
  "/admin/readiness/token-usage": {
50
92
  parameters: {
51
93
  query?: never;
@@ -11875,6 +11917,226 @@ export interface operations {
11875
11917
  };
11876
11918
  };
11877
11919
  };
11920
+ runAssessmentPreflight: {
11921
+ parameters: {
11922
+ query?: never;
11923
+ header?: never;
11924
+ path?: never;
11925
+ cookie?: never;
11926
+ };
11927
+ requestBody: {
11928
+ content: {
11929
+ "application/json": {
11930
+ /** @enum {string} */
11931
+ offerId: "engineering_readiness_baseline" | "agentic_ai_roi";
11932
+ /** @enum {string} */
11933
+ sourceControl: "connected" | "pending_approval" | "setup_in_progress" | "revoked" | "stale" | "missing";
11934
+ platformExecutionReady: boolean;
11935
+ repositoryCount?: number | null;
11936
+ activeEngineerCount?: number | null;
11937
+ scans: {
11938
+ /** @enum {string} */
11939
+ status: "unknown" | "known";
11940
+ fresh?: boolean;
11941
+ };
11942
+ windows: {
11943
+ /** @enum {string} */
11944
+ status: "unknown" | "known";
11945
+ currentComplete?: boolean;
11946
+ preComplete?: boolean;
11947
+ postComplete?: boolean;
11948
+ };
11949
+ premiumAi: {
11950
+ cursor: boolean;
11951
+ claude: boolean;
11952
+ copilot: boolean;
11953
+ };
11954
+ jiraSelected: boolean;
11955
+ incidentSelected: boolean;
11956
+ incidentAvailable: boolean;
11957
+ owner?: string | null;
11958
+ };
11959
+ };
11960
+ };
11961
+ responses: {
11962
+ /** @description Preflight result. `dueDate` is set only when `ready` is true. */
11963
+ 200: {
11964
+ headers: {
11965
+ [name: string]: unknown;
11966
+ };
11967
+ content: {
11968
+ "application/json": {
11969
+ ready: boolean;
11970
+ clockStarted: boolean;
11971
+ /** Format: date */
11972
+ dueDate: string | null;
11973
+ owner: string | null;
11974
+ blocker: string | null;
11975
+ nextAction: {
11976
+ label: string;
11977
+ href: string | null;
11978
+ } | null;
11979
+ failures: {
11980
+ code: string;
11981
+ blocker: string;
11982
+ nextAction: {
11983
+ label: string;
11984
+ href: string | null;
11985
+ };
11986
+ }[];
11987
+ chapters: {
11988
+ /** @enum {string} */
11989
+ id: "jira" | "incidents";
11990
+ /** @enum {string} */
11991
+ status: "unavailable";
11992
+ reason: string;
11993
+ }[];
11994
+ };
11995
+ };
11996
+ };
11997
+ /** @description Body failed validation. */
11998
+ 400: {
11999
+ headers: {
12000
+ [name: string]: unknown;
12001
+ };
12002
+ content: {
12003
+ /**
12004
+ * @example {
12005
+ * "error": "offerId is not a known assessment offer",
12006
+ * "code": "invalid_body"
12007
+ * }
12008
+ */
12009
+ "application/json": components["schemas"]["ErrorMessageDto"];
12010
+ };
12011
+ };
12012
+ /** @description Missing or invalid JWT. */
12013
+ 401: {
12014
+ headers: {
12015
+ [name: string]: unknown;
12016
+ };
12017
+ content: {
12018
+ "application/json": components["schemas"]["ErrorMessageDto"];
12019
+ };
12020
+ };
12021
+ /** @description Caller is not a platform admin. */
12022
+ 403: {
12023
+ headers: {
12024
+ [name: string]: unknown;
12025
+ };
12026
+ content: {
12027
+ /**
12028
+ * @example {
12029
+ * "error": "Forbidden",
12030
+ * "code": "forbidden"
12031
+ * }
12032
+ */
12033
+ "application/json": components["schemas"]["ErrorMessageDto"];
12034
+ };
12035
+ };
12036
+ };
12037
+ };
12038
+ runAssessmentManifestValidation: {
12039
+ parameters: {
12040
+ query?: never;
12041
+ header?: never;
12042
+ path?: never;
12043
+ cookie?: never;
12044
+ };
12045
+ requestBody: {
12046
+ content: {
12047
+ "application/json": {
12048
+ manifest: {
12049
+ /** @enum {string} */
12050
+ offerId: "engineering_readiness_baseline" | "agentic_ai_roi";
12051
+ dictionaryVersion: string;
12052
+ /** @enum {string} */
12053
+ validation: "validated" | "not_validated";
12054
+ /** @enum {string} */
12055
+ shareMode: "internal" | "external";
12056
+ /** @enum {string|null} */
12057
+ watermark: "NOT VALIDATED" | "SAMPLE · SYNTHETIC DATA" | null;
12058
+ scope: Record<string, never>;
12059
+ windows: Record<string, never>;
12060
+ sources: Record<string, never>[];
12061
+ consent: Record<string, never>;
12062
+ sections: Record<string, never>[];
12063
+ };
12064
+ workspaceId: string;
12065
+ expectedWorkspaceId: string;
12066
+ expectedRepositoryIds: string[];
12067
+ soldWindowComplete: boolean;
12068
+ premiumAiAssessable: boolean;
12069
+ namedPersonSectionIds: string[];
12070
+ tolerances: {
12071
+ id: string;
12072
+ /** @enum {string} */
12073
+ status: "unset" | "exceeded" | "within";
12074
+ }[];
12075
+ };
12076
+ };
12077
+ };
12078
+ responses: {
12079
+ /** @description Validation result. Client validation and watermark inputs are ignored. */
12080
+ 200: {
12081
+ headers: {
12082
+ [name: string]: unknown;
12083
+ };
12084
+ content: {
12085
+ "application/json": {
12086
+ buyerDeliverable: boolean;
12087
+ /** @enum {string} */
12088
+ validation: "validated" | "not_validated";
12089
+ /** @enum {string|null} */
12090
+ watermark: "NOT VALIDATED" | null;
12091
+ reasons: {
12092
+ code: string;
12093
+ message: string;
12094
+ }[];
12095
+ contentHash: string;
12096
+ };
12097
+ };
12098
+ };
12099
+ /** @description Body failed validation. */
12100
+ 400: {
12101
+ headers: {
12102
+ [name: string]: unknown;
12103
+ };
12104
+ content: {
12105
+ /**
12106
+ * @example {
12107
+ * "error": "manifest.offerId is not a known assessment offer",
12108
+ * "code": "invalid_body"
12109
+ * }
12110
+ */
12111
+ "application/json": components["schemas"]["ErrorMessageDto"];
12112
+ };
12113
+ };
12114
+ /** @description Missing or invalid JWT. */
12115
+ 401: {
12116
+ headers: {
12117
+ [name: string]: unknown;
12118
+ };
12119
+ content: {
12120
+ "application/json": components["schemas"]["ErrorMessageDto"];
12121
+ };
12122
+ };
12123
+ /** @description Caller is not a platform admin. */
12124
+ 403: {
12125
+ headers: {
12126
+ [name: string]: unknown;
12127
+ };
12128
+ content: {
12129
+ /**
12130
+ * @example {
12131
+ * "error": "Forbidden",
12132
+ * "code": "forbidden"
12133
+ * }
12134
+ */
12135
+ "application/json": components["schemas"]["ErrorMessageDto"];
12136
+ };
12137
+ };
12138
+ };
12139
+ };
11878
12140
  adminListReadinessTokenUsage: {
11879
12141
  parameters: {
11880
12142
  query?: {