@thinkai/tai-api-contract 2.180.0 → 2.181.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.180.0
4
+ version: 2.181.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}/...`.
@@ -419,6 +419,235 @@ paths:
419
419
  error: Forbidden
420
420
  code: forbidden
421
421
 
422
+ /admin/workspaces/{workspaceId}/assessment-preflight:
423
+ post:
424
+ tags: [PlatformAdmin]
425
+ summary: Evaluate assessment preflight from server-loaded evidence
426
+ operationId: runLiveAssessmentPreflight
427
+ description: >
428
+ Loads repository scope, readiness scan age, and window coverage for one
429
+ workspace. Client fields for scope, scans, windows, and engineer counts
430
+ are ignored, so an unscanned source cannot be marked fresh. The
431
+ five-business-day clock uses Monday–Friday in America/New_York and is
432
+ stored on the first passing result. A later blocker does not clear it.
433
+ Active-engineer counts stay unloaded until stored activity can be counted.
434
+
435
+ **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
436
+ parameters:
437
+ - $ref: "#/components/parameters/WorkspaceId"
438
+ requestBody:
439
+ required: true
440
+ content:
441
+ application/json:
442
+ schema:
443
+ type: object
444
+ required:
445
+ - offerId
446
+ - sourceControl
447
+ - platformExecutionReady
448
+ - premiumAi
449
+ - jiraSelected
450
+ - incidentSelected
451
+ - incidentAvailable
452
+ properties:
453
+ offerId:
454
+ type: string
455
+ enum: [engineering_readiness_baseline, agentic_ai_roi]
456
+ sourceControl:
457
+ type: string
458
+ enum: [connected, pending_approval, setup_in_progress, revoked, stale, missing]
459
+ platformExecutionReady:
460
+ type: boolean
461
+ premiumAi:
462
+ type: object
463
+ required: [cursor, claude, copilot]
464
+ properties:
465
+ cursor:
466
+ type: boolean
467
+ claude:
468
+ type: boolean
469
+ copilot:
470
+ type: boolean
471
+ jiraSelected:
472
+ type: boolean
473
+ incidentSelected:
474
+ type: boolean
475
+ incidentAvailable:
476
+ type: boolean
477
+ owner:
478
+ type: string
479
+ nullable: true
480
+ responses:
481
+ "200":
482
+ description: >
483
+ Preflight result. `dueDate` is set once the clock has started and stays
484
+ set if a later check is blocked.
485
+ content:
486
+ application/json:
487
+ schema:
488
+ type: object
489
+ required:
490
+ [ready, clockStarted, dueDate, owner, blocker, nextAction, failures, chapters]
491
+ properties:
492
+ ready:
493
+ type: boolean
494
+ clockStarted:
495
+ type: boolean
496
+ dueDate:
497
+ type: string
498
+ nullable: true
499
+ format: date
500
+ owner:
501
+ type: string
502
+ nullable: true
503
+ blocker:
504
+ type: string
505
+ nullable: true
506
+ nextAction:
507
+ type: object
508
+ nullable: true
509
+ required: [label, href]
510
+ properties:
511
+ label:
512
+ type: string
513
+ href:
514
+ type: string
515
+ nullable: true
516
+ failures:
517
+ type: array
518
+ items:
519
+ type: object
520
+ required: [code, blocker, nextAction]
521
+ properties:
522
+ code:
523
+ type: string
524
+ blocker:
525
+ type: string
526
+ nextAction:
527
+ type: object
528
+ required: [label, href]
529
+ properties:
530
+ label:
531
+ type: string
532
+ href:
533
+ type: string
534
+ nullable: true
535
+ chapters:
536
+ type: array
537
+ items:
538
+ type: object
539
+ required: [id, status, reason]
540
+ properties:
541
+ id:
542
+ type: string
543
+ enum: [jira, incidents]
544
+ status:
545
+ type: string
546
+ enum: [unavailable]
547
+ reason:
548
+ type: string
549
+ "400":
550
+ description: Body or workspace id failed validation.
551
+ content:
552
+ application/json:
553
+ schema:
554
+ $ref: "#/components/schemas/ErrorMessageDto"
555
+ example:
556
+ error: offerId is not a known assessment offer
557
+ code: invalid_body
558
+ "401":
559
+ description: Missing or invalid JWT.
560
+ content:
561
+ application/json:
562
+ schema:
563
+ $ref: "#/components/schemas/ErrorMessageDto"
564
+ "403":
565
+ description: Caller is not a platform admin.
566
+ content:
567
+ application/json:
568
+ schema:
569
+ $ref: "#/components/schemas/ErrorMessageDto"
570
+ example:
571
+ error: Forbidden
572
+ code: forbidden
573
+ "503":
574
+ description: Evidence store is unavailable.
575
+ content:
576
+ application/json:
577
+ schema:
578
+ $ref: "#/components/schemas/ErrorMessageDto"
579
+
580
+ /admin/assessment-queue:
581
+ get:
582
+ tags: [PlatformAdmin]
583
+ summary: List operator assessment records
584
+ operationId: listAssessmentQueue
585
+ description: >
586
+ Returns the stored assessment record for each workspace an operator has
587
+ evaluated. The next blocker is on this list. A second workspace is not
588
+ required.
589
+
590
+ **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
591
+ responses:
592
+ "200":
593
+ description: Operator queue.
594
+ content:
595
+ application/json:
596
+ schema:
597
+ type: object
598
+ required: [records]
599
+ properties:
600
+ records:
601
+ type: array
602
+ items:
603
+ type: object
604
+ required:
605
+ [workspaceId, offerId, ready, blocker, nextAction, dueDate, evaluatedAt]
606
+ properties:
607
+ workspaceId:
608
+ type: string
609
+ format: uuid
610
+ offerId:
611
+ type: string
612
+ enum: [engineering_readiness_baseline, agentic_ai_roi]
613
+ ready:
614
+ type: boolean
615
+ blocker:
616
+ type: string
617
+ nullable: true
618
+ nextAction:
619
+ type: object
620
+ nullable: true
621
+ required: [label, href]
622
+ properties:
623
+ label:
624
+ type: string
625
+ href:
626
+ type: string
627
+ nullable: true
628
+ dueDate:
629
+ type: string
630
+ nullable: true
631
+ format: date
632
+ evaluatedAt:
633
+ type: string
634
+ format: date-time
635
+ "401":
636
+ description: Missing or invalid JWT.
637
+ content:
638
+ application/json:
639
+ schema:
640
+ $ref: "#/components/schemas/ErrorMessageDto"
641
+ "403":
642
+ description: Caller is not a platform admin.
643
+ content:
644
+ application/json:
645
+ schema:
646
+ $ref: "#/components/schemas/ErrorMessageDto"
647
+ example:
648
+ error: Forbidden
649
+ code: forbidden
650
+
422
651
  /admin/assessment-manifest-validation:
423
652
  post:
424
653
  tags: [PlatformAdmin]
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.180.0",
3
+ "version": "2.181.0",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "main": "dist/index.js",
@@ -67,6 +67,48 @@ export interface paths {
67
67
  patch?: never;
68
68
  trace?: never;
69
69
  };
70
+ "/admin/workspaces/{workspaceId}/assessment-preflight": {
71
+ parameters: {
72
+ query?: never;
73
+ header?: never;
74
+ path?: never;
75
+ cookie?: never;
76
+ };
77
+ get?: never;
78
+ put?: never;
79
+ /**
80
+ * Evaluate assessment preflight from server-loaded evidence
81
+ * @description Loads repository scope, readiness scan age, and window coverage for one workspace. Client fields for scope, scans, windows, and engineer counts are ignored, so an unscanned source cannot be marked fresh. The five-business-day clock uses Monday–Friday in America/New_York and is stored on the first passing result. A later blocker does not clear it. Active-engineer counts stay unloaded until stored activity can be counted.
82
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
83
+ */
84
+ post: operations["runLiveAssessmentPreflight"];
85
+ delete?: never;
86
+ options?: never;
87
+ head?: never;
88
+ patch?: never;
89
+ trace?: never;
90
+ };
91
+ "/admin/assessment-queue": {
92
+ parameters: {
93
+ query?: never;
94
+ header?: never;
95
+ path?: never;
96
+ cookie?: never;
97
+ };
98
+ /**
99
+ * List operator assessment records
100
+ * @description Returns the stored assessment record for each workspace an operator has evaluated. The next blocker is on this list. A second workspace is not required.
101
+ * **Authorization:** Bearer JWT required. Caller email must appear in `PLATFORM_ADMIN_EMAILS`.
102
+ */
103
+ get: operations["listAssessmentQueue"];
104
+ put?: never;
105
+ post?: never;
106
+ delete?: never;
107
+ options?: never;
108
+ head?: never;
109
+ patch?: never;
110
+ trace?: never;
111
+ };
70
112
  "/admin/assessment-manifest-validation": {
71
113
  parameters: {
72
114
  query?: never;
@@ -12735,6 +12777,182 @@ export interface operations {
12735
12777
  };
12736
12778
  };
12737
12779
  };
12780
+ runLiveAssessmentPreflight: {
12781
+ parameters: {
12782
+ query?: never;
12783
+ header?: never;
12784
+ path: {
12785
+ workspaceId: components["parameters"]["WorkspaceId"];
12786
+ };
12787
+ cookie?: never;
12788
+ };
12789
+ requestBody: {
12790
+ content: {
12791
+ "application/json": {
12792
+ /** @enum {string} */
12793
+ offerId: "engineering_readiness_baseline" | "agentic_ai_roi";
12794
+ /** @enum {string} */
12795
+ sourceControl: "connected" | "pending_approval" | "setup_in_progress" | "revoked" | "stale" | "missing";
12796
+ platformExecutionReady: boolean;
12797
+ premiumAi: {
12798
+ cursor: boolean;
12799
+ claude: boolean;
12800
+ copilot: boolean;
12801
+ };
12802
+ jiraSelected: boolean;
12803
+ incidentSelected: boolean;
12804
+ incidentAvailable: boolean;
12805
+ owner?: string | null;
12806
+ };
12807
+ };
12808
+ };
12809
+ responses: {
12810
+ /** @description Preflight result. `dueDate` is set once the clock has started and stays set if a later check is blocked. */
12811
+ 200: {
12812
+ headers: {
12813
+ [name: string]: unknown;
12814
+ };
12815
+ content: {
12816
+ "application/json": {
12817
+ ready: boolean;
12818
+ clockStarted: boolean;
12819
+ /** Format: date */
12820
+ dueDate: string | null;
12821
+ owner: string | null;
12822
+ blocker: string | null;
12823
+ nextAction: {
12824
+ label: string;
12825
+ href: string | null;
12826
+ } | null;
12827
+ failures: {
12828
+ code: string;
12829
+ blocker: string;
12830
+ nextAction: {
12831
+ label: string;
12832
+ href: string | null;
12833
+ };
12834
+ }[];
12835
+ chapters: {
12836
+ /** @enum {string} */
12837
+ id: "jira" | "incidents";
12838
+ /** @enum {string} */
12839
+ status: "unavailable";
12840
+ reason: string;
12841
+ }[];
12842
+ };
12843
+ };
12844
+ };
12845
+ /** @description Body or workspace id failed validation. */
12846
+ 400: {
12847
+ headers: {
12848
+ [name: string]: unknown;
12849
+ };
12850
+ content: {
12851
+ /**
12852
+ * @example {
12853
+ * "error": "offerId is not a known assessment offer",
12854
+ * "code": "invalid_body"
12855
+ * }
12856
+ */
12857
+ "application/json": components["schemas"]["ErrorMessageDto"];
12858
+ };
12859
+ };
12860
+ /** @description Missing or invalid JWT. */
12861
+ 401: {
12862
+ headers: {
12863
+ [name: string]: unknown;
12864
+ };
12865
+ content: {
12866
+ "application/json": components["schemas"]["ErrorMessageDto"];
12867
+ };
12868
+ };
12869
+ /** @description Caller is not a platform admin. */
12870
+ 403: {
12871
+ headers: {
12872
+ [name: string]: unknown;
12873
+ };
12874
+ content: {
12875
+ /**
12876
+ * @example {
12877
+ * "error": "Forbidden",
12878
+ * "code": "forbidden"
12879
+ * }
12880
+ */
12881
+ "application/json": components["schemas"]["ErrorMessageDto"];
12882
+ };
12883
+ };
12884
+ /** @description Evidence store is unavailable. */
12885
+ 503: {
12886
+ headers: {
12887
+ [name: string]: unknown;
12888
+ };
12889
+ content: {
12890
+ "application/json": components["schemas"]["ErrorMessageDto"];
12891
+ };
12892
+ };
12893
+ };
12894
+ };
12895
+ listAssessmentQueue: {
12896
+ parameters: {
12897
+ query?: never;
12898
+ header?: never;
12899
+ path?: never;
12900
+ cookie?: never;
12901
+ };
12902
+ requestBody?: never;
12903
+ responses: {
12904
+ /** @description Operator queue. */
12905
+ 200: {
12906
+ headers: {
12907
+ [name: string]: unknown;
12908
+ };
12909
+ content: {
12910
+ "application/json": {
12911
+ records: {
12912
+ /** Format: uuid */
12913
+ workspaceId: string;
12914
+ /** @enum {string} */
12915
+ offerId: "engineering_readiness_baseline" | "agentic_ai_roi";
12916
+ ready: boolean;
12917
+ blocker: string | null;
12918
+ nextAction: {
12919
+ label: string;
12920
+ href: string | null;
12921
+ } | null;
12922
+ /** Format: date */
12923
+ dueDate: string | null;
12924
+ /** Format: date-time */
12925
+ evaluatedAt: string;
12926
+ }[];
12927
+ };
12928
+ };
12929
+ };
12930
+ /** @description Missing or invalid JWT. */
12931
+ 401: {
12932
+ headers: {
12933
+ [name: string]: unknown;
12934
+ };
12935
+ content: {
12936
+ "application/json": components["schemas"]["ErrorMessageDto"];
12937
+ };
12938
+ };
12939
+ /** @description Caller is not a platform admin. */
12940
+ 403: {
12941
+ headers: {
12942
+ [name: string]: unknown;
12943
+ };
12944
+ content: {
12945
+ /**
12946
+ * @example {
12947
+ * "error": "Forbidden",
12948
+ * "code": "forbidden"
12949
+ * }
12950
+ */
12951
+ "application/json": components["schemas"]["ErrorMessageDto"];
12952
+ };
12953
+ };
12954
+ };
12955
+ };
12738
12956
  runAssessmentManifestValidation: {
12739
12957
  parameters: {
12740
12958
  query?: never;