@thinkai/tai-api-contract 2.177.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.177.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]
@@ -9268,6 +9497,32 @@ paths:
9268
9497
  "401":
9269
9498
  $ref: "#/components/responses/Unauthorized"
9270
9499
 
9500
+ /workspaces/{workspaceId}/knowledge-pages/{slug}:
9501
+ delete:
9502
+ tags: [CodeChat]
9503
+ summary: Delete a workspace knowledge page by slug
9504
+ description: >-
9505
+ Removes one page (typically a `prd-*` / `rfc-*` / `adr-*` draft). Does not
9506
+ regenerate the rest of the knowledge base.
9507
+ operationId: deleteWorkspaceKnowledgePage
9508
+ parameters:
9509
+ - $ref: "#/components/parameters/WorkspaceId"
9510
+ - name: slug
9511
+ in: path
9512
+ required: true
9513
+ schema: { type: string, minLength: 1, maxLength: 200 }
9514
+ responses:
9515
+ "204":
9516
+ description: Page deleted
9517
+ "401":
9518
+ $ref: "#/components/responses/Unauthorized"
9519
+ "404":
9520
+ description: Page not found (`knowledge_page_not_found`)
9521
+ content:
9522
+ application/json:
9523
+ schema:
9524
+ $ref: "#/components/schemas/ErrorMessageDto"
9525
+
9271
9526
  /workspaces/{workspaceId}/knowledge-pages/generate:
9272
9527
  post:
9273
9528
  tags: [CodeChat]
@@ -24463,6 +24718,7 @@ components:
24463
24718
  - explain
24464
24719
  - platform_ops
24465
24720
  - feature_impact
24721
+ - pr_review
24466
24722
  - prd_request
24467
24723
  description: Classified Ask intent for the turn
24468
24724
  skillId:
@@ -24475,8 +24731,30 @@ components:
24475
24731
  - chat-cicd
24476
24732
  - chat-stack
24477
24733
  - chat-platform
24734
+ - chat-workspace
24735
+ - chat-product
24736
+ - chat-pr-review
24478
24737
  - chat-wiki
24479
24738
  description: Conversation skill pack that grounded the LLM answer (Wave 10)
24739
+ userMessage:
24740
+ type: string
24741
+ description: >
24742
+ Short customer-safe summary when mode is failed. Shown in the reply body;
24743
+ raw provider detail is only in providerFailures / debug marker.
24744
+ providerFailures:
24745
+ type: array
24746
+ description: >
24747
+ Structured provider failures for Conversations ⓘ hover (primary first).
24748
+ Also embedded in content as `<!-- code-intel-debug:{...} -->` for reload.
24749
+ items:
24750
+ type: object
24751
+ required: [provider, sanitized, raw]
24752
+ properties:
24753
+ provider:
24754
+ type: string
24755
+ enum: [anthropic_messages, cursor_agent]
24756
+ sanitized: { type: string }
24757
+ raw: { type: string }
24480
24758
  usage:
24481
24759
  $ref: "#/components/schemas/CodeIntelligenceUsageDto"
24482
24760
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thinkai/tai-api-contract",
3
- "version": "2.177.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;
@@ -3432,6 +3474,26 @@ export interface paths {
3432
3474
  patch?: never;
3433
3475
  trace?: never;
3434
3476
  };
3477
+ "/workspaces/{workspaceId}/knowledge-pages/{slug}": {
3478
+ parameters: {
3479
+ query?: never;
3480
+ header?: never;
3481
+ path?: never;
3482
+ cookie?: never;
3483
+ };
3484
+ get?: never;
3485
+ put?: never;
3486
+ post?: never;
3487
+ /**
3488
+ * Delete a workspace knowledge page by slug
3489
+ * @description Removes one page (typically a `prd-*` / `rfc-*` / `adr-*` draft). Does not regenerate the rest of the knowledge base.
3490
+ */
3491
+ delete: operations["deleteWorkspaceKnowledgePage"];
3492
+ options?: never;
3493
+ head?: never;
3494
+ patch?: never;
3495
+ trace?: never;
3496
+ };
3435
3497
  "/workspaces/{workspaceId}/knowledge-pages/generate": {
3436
3498
  parameters: {
3437
3499
  query?: never;
@@ -10305,12 +10367,21 @@ export interface components {
10305
10367
  * @description Classified Ask intent for the turn
10306
10368
  * @enum {string}
10307
10369
  */
10308
- intent?: "inventory_apis" | "inventory_modules" | "explain" | "platform_ops" | "feature_impact" | "prd_request";
10370
+ intent?: "inventory_apis" | "inventory_modules" | "explain" | "platform_ops" | "feature_impact" | "pr_review" | "prd_request";
10309
10371
  /**
10310
10372
  * @description Conversation skill pack that grounded the LLM answer (Wave 10)
10311
10373
  * @enum {string}
10312
10374
  */
10313
- skillId?: "chat-api-detail" | "chat-architecture" | "chat-tests" | "chat-contracts" | "chat-cicd" | "chat-stack" | "chat-platform" | "chat-wiki";
10375
+ skillId?: "chat-api-detail" | "chat-architecture" | "chat-tests" | "chat-contracts" | "chat-cicd" | "chat-stack" | "chat-platform" | "chat-workspace" | "chat-product" | "chat-pr-review" | "chat-wiki";
10376
+ /** @description Short customer-safe summary when mode is failed. Shown in the reply body; raw provider detail is only in providerFailures / debug marker. */
10377
+ userMessage?: string;
10378
+ /** @description Structured provider failures for Conversations ⓘ hover (primary first). Also embedded in content as `<!-- code-intel-debug:{...} -->` for reload. */
10379
+ providerFailures?: {
10380
+ /** @enum {string} */
10381
+ provider: "anthropic_messages" | "cursor_agent";
10382
+ sanitized: string;
10383
+ raw: string;
10384
+ }[];
10314
10385
  usage?: components["schemas"]["CodeIntelligenceUsageDto"];
10315
10386
  };
10316
10387
  CodeChatApiRouteRowDto: {
@@ -12706,6 +12777,182 @@ export interface operations {
12706
12777
  };
12707
12778
  };
12708
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
+ };
12709
12956
  runAssessmentManifestValidation: {
12710
12957
  parameters: {
12711
12958
  query?: never;
@@ -21748,6 +21995,37 @@ export interface operations {
21748
21995
  401: components["responses"]["Unauthorized"];
21749
21996
  };
21750
21997
  };
21998
+ deleteWorkspaceKnowledgePage: {
21999
+ parameters: {
22000
+ query?: never;
22001
+ header?: never;
22002
+ path: {
22003
+ workspaceId: components["parameters"]["WorkspaceId"];
22004
+ slug: string;
22005
+ };
22006
+ cookie?: never;
22007
+ };
22008
+ requestBody?: never;
22009
+ responses: {
22010
+ /** @description Page deleted */
22011
+ 204: {
22012
+ headers: {
22013
+ [name: string]: unknown;
22014
+ };
22015
+ content?: never;
22016
+ };
22017
+ 401: components["responses"]["Unauthorized"];
22018
+ /** @description Page not found (`knowledge_page_not_found`) */
22019
+ 404: {
22020
+ headers: {
22021
+ [name: string]: unknown;
22022
+ };
22023
+ content: {
22024
+ "application/json": components["schemas"]["ErrorMessageDto"];
22025
+ };
22026
+ };
22027
+ };
22028
+ };
21751
22029
  generateWorkspaceKnowledgePages: {
21752
22030
  parameters: {
21753
22031
  query?: never;