@thinkai/tai-api-contract 2.216.0 → 2.220.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.
@@ -1637,6 +1637,26 @@ export interface paths {
1637
1637
  patch?: never;
1638
1638
  trace?: never;
1639
1639
  };
1640
+ "/workspaces/{workspaceId}/insights/team-efficiency/bundle": {
1641
+ parameters: {
1642
+ query?: never;
1643
+ header?: never;
1644
+ path?: never;
1645
+ cookie?: never;
1646
+ };
1647
+ /**
1648
+ * Team Efficiency page bundle
1649
+ * @description One round trip for the Team Efficiency page. Metrics are computed for the rolling `months` calendar months (default 3) against the previous period. A department is the union of its teams. All departments plus all teams, and person scope, are rejected with 400. Returns 404 when `backend-api.teamEfficiency` is off (unless the workspace is on the allowlist).
1650
+ */
1651
+ get: operations["getTeamEfficiencyBundle"];
1652
+ put?: never;
1653
+ post?: never;
1654
+ delete?: never;
1655
+ options?: never;
1656
+ head?: never;
1657
+ patch?: never;
1658
+ trace?: never;
1659
+ };
1640
1660
  "/workspaces/{workspaceId}/insights/devex/sync": {
1641
1661
  parameters: {
1642
1662
  query?: never;
@@ -4707,6 +4727,26 @@ export interface paths {
4707
4727
  patch?: never;
4708
4728
  trace?: never;
4709
4729
  };
4730
+ "/workspaces/{workspaceId}/code-chat/tools/ask": {
4731
+ parameters: {
4732
+ query?: never;
4733
+ header?: never;
4734
+ path?: never;
4735
+ cookie?: never;
4736
+ };
4737
+ get?: never;
4738
+ put?: never;
4739
+ /**
4740
+ * MCP/agent tool — grounded Ask answer with citations
4741
+ * @description Read-only. Runs the same Ask pipeline as Conversations for the repos in `repoIds` (every ready repo when `repoIds` is omitted). Does not edit files or open pull requests. The answer is `result.content` with `result.citations`. Other graph tools, when given more than one repo, return the same rows as a single repo plus `repoId` and `repoName`.
4742
+ */
4743
+ post: operations["codeChatAskTool"];
4744
+ delete?: never;
4745
+ options?: never;
4746
+ head?: never;
4747
+ patch?: never;
4748
+ trace?: never;
4749
+ };
4710
4750
  "/notifications/email/unsubscribe": {
4711
4751
  parameters: {
4712
4752
  query?: never;
@@ -6650,6 +6690,133 @@ export interface components {
6650
6690
  metricId: "devex-score";
6651
6691
  results: components["schemas"]["DevexResultDto"][];
6652
6692
  };
6693
+ TeamEfficiencyDataQualityDto: {
6694
+ /** @enum {string} */
6695
+ code: "low_data" | "missing_start" | "batch_closed" | "no_roster" | "not_configured" | "no_bug_data" | "no_survey" | "unattributed_failures" | "excluded_incidents" | "unlinked_incidents" | "unknown_review_comments" | "no_linked_deploys" | "no_deployments" | "six_month_window";
6696
+ message: string;
6697
+ percent?: number;
6698
+ count?: number;
6699
+ };
6700
+ TeamEfficiencyMetricDto: {
6701
+ /** @enum {string} */
6702
+ id: "flow-time" | "pr-throughput-per-engineer" | "escaped-defects" | "devex-score" | "deployment-frequency" | "lead-time-for-changes" | "change-failure-rate" | "time-to-restore" | "pr-size" | "time-to-first-review" | "pr-approvals-without-comments";
6703
+ label: string;
6704
+ /** @description Short card label, for example "Recovery time". */
6705
+ shortLabel?: string;
6706
+ unit: string;
6707
+ value?: number;
6708
+ p85?: number;
6709
+ previous?: number;
6710
+ /** @description Per calendar month in the window, oldest first. null when no data. */
6711
+ monthly: (number | null)[];
6712
+ sampleSize: number;
6713
+ /** @description Fewer than 10 samples. */
6714
+ lowData: boolean;
6715
+ reportable: boolean;
6716
+ numerator?: number;
6717
+ denominator?: number;
6718
+ owner: string;
6719
+ counterweightIds: string[];
6720
+ dataQuality: components["schemas"]["TeamEfficiencyDataQualityDto"][];
6721
+ /** @description Drill-through route; the client appends scope and window. */
6722
+ href: string;
6723
+ /** @description Counts by key, for example escaped defects by severity. */
6724
+ breakdown?: {
6725
+ [key: string]: number;
6726
+ };
6727
+ /** @description The same series for the months before `monthly`, oldest first. */
6728
+ previousMonthly?: (number | null)[];
6729
+ stages?: components["schemas"]["TeamEfficiencyLeadTimeStagesDto"];
6730
+ devex?: components["schemas"]["TeamEfficiencyDevexDetailDto"];
6731
+ signals?: components["schemas"]["TeamEfficiencySignalDto"][];
6732
+ };
6733
+ /** @description Median hours per lead-time stage. */
6734
+ TeamEfficiencyLeadTimeStagesDto: {
6735
+ codingHours: number;
6736
+ pickupHours: number;
6737
+ reviewHours: number;
6738
+ deployHours: number;
6739
+ };
6740
+ TeamEfficiencySignalDto: {
6741
+ /** @enum {string} */
6742
+ id: "review-time-drop" | "approvals-without-comments-rise" | "pr-size-falling-flow-flat";
6743
+ label: string;
6744
+ flagged: boolean;
6745
+ /** @description Short detail shown when flagged, for example "24% to 31%". */
6746
+ detail?: string;
6747
+ };
6748
+ TeamEfficiencyDevexDetailDto: {
6749
+ /** @example 2026-Q3 */
6750
+ quarter: string;
6751
+ dimensions: {
6752
+ feedbackLoops: number;
6753
+ cognitiveLoad: number;
6754
+ flowState: number;
6755
+ };
6756
+ /** @description Latest quarters, oldest first. */
6757
+ quarters: {
6758
+ quarter: string;
6759
+ score: number;
6760
+ }[];
6761
+ responseCount: number;
6762
+ rosterSize?: number;
6763
+ /** @description 0 to 1. */
6764
+ responseRate?: number;
6765
+ lowResponseRate: boolean;
6766
+ /** @description Fewer than 5 responses, so the score shown is the department's. */
6767
+ rolledUp: boolean;
6768
+ };
6769
+ TeamEfficiencySetupItemDto: {
6770
+ id: string;
6771
+ label: string;
6772
+ done: boolean;
6773
+ hint: string;
6774
+ };
6775
+ TeamEfficiencyBundleDto: {
6776
+ summary: {
6777
+ engineers: number;
6778
+ issuesDone: number;
6779
+ mergedPrs: number;
6780
+ deployments: number;
6781
+ survey?: {
6782
+ responses: number;
6783
+ invited?: number;
6784
+ };
6785
+ };
6786
+ /** @description Share of engineers using an AI tool per month, for the months before the window followed by the window months, oldest first. null when no data. */
6787
+ aiAdoption: (number | null)[];
6788
+ scope: {
6789
+ department?: string;
6790
+ team?: string;
6791
+ teamIds: string[];
6792
+ /** @description Org-chart engineers, excluding managers, product managers and designers. */
6793
+ rosterEngineerCount: number;
6794
+ };
6795
+ window: {
6796
+ monthCount: number;
6797
+ /** Format: date-time */
6798
+ start: string;
6799
+ /** Format: date-time */
6800
+ end: string;
6801
+ /** Format: date-time */
6802
+ previousStart: string;
6803
+ /** Format: date-time */
6804
+ previousEnd: string;
6805
+ months: {
6806
+ /** Format: date-time */
6807
+ start: string;
6808
+ /** Format: date-time */
6809
+ end: string;
6810
+ }[];
6811
+ };
6812
+ metrics: components["schemas"]["TeamEfficiencyMetricDto"][];
6813
+ setup: {
6814
+ items: components["schemas"]["TeamEfficiencySetupItemDto"][];
6815
+ complete: boolean;
6816
+ };
6817
+ /** Format: date-time */
6818
+ generatedAt: string;
6819
+ };
6653
6820
  DevexSyncRequestDto: {
6654
6821
  /** @example 2026-Q1 */
6655
6822
  quarter?: string;
@@ -7261,6 +7428,26 @@ export interface components {
7261
7428
  clusterName?: string;
7262
7429
  /** @description Present for Prometheus verify success — Alertmanager version when available. */
7263
7430
  version?: string;
7431
+ /** @description Present for SurveyMonkey verify success. Question and choice labels only (never answers), so the connect screen can pick the team question and rating questions. */
7432
+ survey?: {
7433
+ title: string;
7434
+ questions: {
7435
+ id: string;
7436
+ text: string;
7437
+ /** @description Every choice carries a 1-5 weight or position, so the question can be scored. */
7438
+ ratingScale: boolean;
7439
+ choices: {
7440
+ id: string;
7441
+ text: string;
7442
+ }[];
7443
+ }[];
7444
+ };
7445
+ /** @description Present for SurveyMonkey verify success when the request carried `teamQuestionId`. How many survey choices matched an org-chart team by name. */
7446
+ teamMatch?: {
7447
+ matched: number;
7448
+ total: number;
7449
+ unmatched: string[];
7450
+ };
7264
7451
  };
7265
7452
  CursorKeyUsageDto: {
7266
7453
  /** @description Readiness runs this calendar month that used the ThinkAI platform Cursor key. */
@@ -12493,6 +12680,15 @@ export interface components {
12493
12680
  intent?: "inventory_apis" | "inventory_modules";
12494
12681
  /** @description Previously uploaded attachment ids to bind to this user turn */
12495
12682
  attachmentIds?: string[];
12683
+ /** @description Slug of the wiki page the user has open. Prepended to Ask wiki context when the question is relevant to it or refers to it deictically ("explain this page"). */
12684
+ focusWikiSlug?: string;
12685
+ /**
12686
+ * Format: uuid
12687
+ * @description Repository of `focusWikiSlug` (slugs such as `overview` repeat across repos).
12688
+ */
12689
+ focusWikiRepoId?: string;
12690
+ /** @description When true the server replies with `text/event-stream` (`stage`, `token`, `done`, `error` events). The `done` event carries the same JSON as the non-streaming 200 body. */
12691
+ stream?: boolean;
12496
12692
  };
12497
12693
  CodeChatUploadAttachmentBodyDto: {
12498
12694
  filename: string;
@@ -13207,6 +13403,26 @@ export interface components {
13207
13403
  maxTokensApprox?: number;
13208
13404
  repoIds?: string[];
13209
13405
  };
13406
+ CodeChatAskToolBodyDto: {
13407
+ question: string;
13408
+ repoIds?: string[];
13409
+ };
13410
+ CodeChatAskToolResponseDto: {
13411
+ /** @enum {string} */
13412
+ tool: "ask";
13413
+ note?: string;
13414
+ scanned?: {
13415
+ [key: string]: unknown;
13416
+ }[];
13417
+ result: {
13418
+ content: string;
13419
+ mode: string;
13420
+ intent?: string;
13421
+ citations: {
13422
+ [key: string]: unknown;
13423
+ }[];
13424
+ };
13425
+ };
13210
13426
  CodeChatContextPackDto: {
13211
13427
  /** Format: uuid */
13212
13428
  repoId?: string;
@@ -14102,6 +14318,13 @@ export type SurveyMonkeySourceDto = components['schemas']['SurveyMonkeySourceDto
14102
14318
  export type SurveyMonkeySourceConfigDto = components['schemas']['SurveyMonkeySourceConfigDto'];
14103
14319
  export type DevexResultDto = components['schemas']['DevexResultDto'];
14104
14320
  export type DevexResultsResponseDto = components['schemas']['DevexResultsResponseDto'];
14321
+ export type TeamEfficiencyDataQualityDto = components['schemas']['TeamEfficiencyDataQualityDto'];
14322
+ export type TeamEfficiencyMetricDto = components['schemas']['TeamEfficiencyMetricDto'];
14323
+ export type TeamEfficiencyLeadTimeStagesDto = components['schemas']['TeamEfficiencyLeadTimeStagesDto'];
14324
+ export type TeamEfficiencySignalDto = components['schemas']['TeamEfficiencySignalDto'];
14325
+ export type TeamEfficiencyDevexDetailDto = components['schemas']['TeamEfficiencyDevexDetailDto'];
14326
+ export type TeamEfficiencySetupItemDto = components['schemas']['TeamEfficiencySetupItemDto'];
14327
+ export type TeamEfficiencyBundleDto = components['schemas']['TeamEfficiencyBundleDto'];
14105
14328
  export type DevexSyncRequestDto = components['schemas']['DevexSyncRequestDto'];
14106
14329
  export type DevexSyncResultDto = components['schemas']['DevexSyncResultDto'];
14107
14330
  export type IncidentIoSourceDto = components['schemas']['IncidentIoSourceDto'];
@@ -14675,6 +14898,8 @@ export type CodeChatVisualizeResultDto = components['schemas']['CodeChatVisualiz
14675
14898
  export type CodeChatCrossEdgesBodyDto = components['schemas']['CodeChatCrossEdgesBodyDto'];
14676
14899
  export type CodeChatCrossEdgesResultDto = components['schemas']['CodeChatCrossEdgesResultDto'];
14677
14900
  export type CodeChatContextPackBodyDto = components['schemas']['CodeChatContextPackBodyDto'];
14901
+ export type CodeChatAskToolBodyDto = components['schemas']['CodeChatAskToolBodyDto'];
14902
+ export type CodeChatAskToolResponseDto = components['schemas']['CodeChatAskToolResponseDto'];
14678
14903
  export type CodeChatContextPackDto = components['schemas']['CodeChatContextPackDto'];
14679
14904
  export type CodeInsightsMetricProvenance = components['schemas']['CodeInsightsMetricProvenance'];
14680
14905
  export type CodeInsightsMaintainabilityBand = components['schemas']['CodeInsightsMaintainabilityBand'];
@@ -19644,6 +19869,53 @@ export interface operations {
19644
19869
  };
19645
19870
  };
19646
19871
  };
19872
+ getTeamEfficiencyBundle: {
19873
+ parameters: {
19874
+ query?: {
19875
+ department?: string;
19876
+ team?: string;
19877
+ months?: number;
19878
+ };
19879
+ header?: never;
19880
+ path: {
19881
+ workspaceId: components["parameters"]["WorkspaceId"];
19882
+ };
19883
+ cookie?: never;
19884
+ };
19885
+ requestBody?: never;
19886
+ responses: {
19887
+ /** @description Team Efficiency metrics, window, and setup checklist */
19888
+ 200: {
19889
+ headers: {
19890
+ [name: string]: unknown;
19891
+ };
19892
+ content: {
19893
+ "application/json": components["schemas"]["TeamEfficiencyBundleDto"];
19894
+ };
19895
+ };
19896
+ /** @description Invalid scope or months (`scope_required`, `person_scope_not_supported`, `team_not_found`, `department_not_found`, `invalid_months`) */
19897
+ 400: {
19898
+ headers: {
19899
+ [name: string]: unknown;
19900
+ };
19901
+ content: {
19902
+ "application/json": {
19903
+ error: string;
19904
+ code: string;
19905
+ };
19906
+ };
19907
+ };
19908
+ 401: components["responses"]["Unauthorized"];
19909
+ 403: components["responses"]["Forbidden"];
19910
+ /** @description Feature flag off or workspace not found */
19911
+ 404: {
19912
+ headers: {
19913
+ [name: string]: unknown;
19914
+ };
19915
+ content?: never;
19916
+ };
19917
+ };
19918
+ };
19647
19919
  syncDevexSurvey: {
19648
19920
  parameters: {
19649
19921
  query?: never;
@@ -26396,13 +26668,14 @@ export interface operations {
26396
26668
  };
26397
26669
  };
26398
26670
  responses: {
26399
- /** @description Assistant message */
26671
+ /** @description Assistant message. With `stream: true` the body is `text/event-stream`: `event: stage` (`{ stage, detail? }`), `event: token` (`{ text }`), `event: done` (CodeChatMessageReplyDto), or `event: error` (`{ error, code }`). */
26400
26672
  200: {
26401
26673
  headers: {
26402
26674
  [name: string]: unknown;
26403
26675
  };
26404
26676
  content: {
26405
26677
  "application/json": components["schemas"]["CodeChatMessageReplyDto"];
26678
+ "text/event-stream": string;
26406
26679
  };
26407
26680
  };
26408
26681
  401: components["responses"]["Unauthorized"];
@@ -27480,6 +27753,47 @@ export interface operations {
27480
27753
  };
27481
27754
  };
27482
27755
  };
27756
+ codeChatAskTool: {
27757
+ parameters: {
27758
+ query?: never;
27759
+ header?: never;
27760
+ path: {
27761
+ workspaceId: components["parameters"]["WorkspaceId"];
27762
+ };
27763
+ cookie?: never;
27764
+ };
27765
+ requestBody: {
27766
+ content: {
27767
+ "application/json": components["schemas"]["CodeChatAskToolBodyDto"];
27768
+ };
27769
+ };
27770
+ responses: {
27771
+ /** @description Grounded answer */
27772
+ 200: {
27773
+ headers: {
27774
+ [name: string]: unknown;
27775
+ };
27776
+ content: {
27777
+ "application/json": components["schemas"]["CodeChatAskToolResponseDto"];
27778
+ };
27779
+ };
27780
+ /** @description Missing or oversized question */
27781
+ 400: {
27782
+ headers: {
27783
+ [name: string]: unknown;
27784
+ };
27785
+ content?: never;
27786
+ };
27787
+ 401: components["responses"]["Unauthorized"];
27788
+ /** @description Corpus not ready */
27789
+ 409: {
27790
+ headers: {
27791
+ [name: string]: unknown;
27792
+ };
27793
+ content?: never;
27794
+ };
27795
+ };
27796
+ };
27483
27797
  getNotificationEmailUnsubscribe: {
27484
27798
  parameters: {
27485
27799
  query: {