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