@thinkai/tai-api-contract 2.215.0 → 2.216.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.
@@ -1618,6 +1618,66 @@ export interface paths {
1618
1618
  patch?: never;
1619
1619
  trace?: never;
1620
1620
  };
1621
+ "/workspaces/{workspaceId}/insights/devex/results": {
1622
+ parameters: {
1623
+ query?: never;
1624
+ header?: never;
1625
+ path?: never;
1626
+ cookie?: never;
1627
+ };
1628
+ /**
1629
+ * DevEx survey aggregates (SurveyMonkey)
1630
+ * @description Persisted DevEx aggregates (`devex-score`) for a workspace. Aggregates only — never email or free text. Returns 404 when `backend-api.teamEfficiency.enabled` is false (unless the workspace is on the optional allowlist).
1631
+ */
1632
+ get: operations["getDevexResults"];
1633
+ put?: never;
1634
+ post?: never;
1635
+ delete?: never;
1636
+ options?: never;
1637
+ head?: never;
1638
+ patch?: never;
1639
+ trace?: never;
1640
+ };
1641
+ "/workspaces/{workspaceId}/insights/devex/sync": {
1642
+ parameters: {
1643
+ query?: never;
1644
+ header?: never;
1645
+ path?: never;
1646
+ cookie?: never;
1647
+ };
1648
+ get?: never;
1649
+ put?: never;
1650
+ /**
1651
+ * Sync DevEx aggregates from SurveyMonkey
1652
+ * @description Pull SurveyMonkey responses, score dimensions (% favourable after reverse-score), apply team min-response rollup and response-rate flags, and persist aggregates only. Admin only. 404 when Team Efficiency is disabled.
1653
+ */
1654
+ post: operations["syncDevexSurvey"];
1655
+ delete?: never;
1656
+ options?: never;
1657
+ head?: never;
1658
+ patch?: never;
1659
+ trace?: never;
1660
+ };
1661
+ "/workspaces/{workspaceId}/connectors/surveymonkey/verify": {
1662
+ parameters: {
1663
+ query?: never;
1664
+ header?: never;
1665
+ path?: never;
1666
+ cookie?: never;
1667
+ };
1668
+ get?: never;
1669
+ put?: never;
1670
+ /**
1671
+ * Re-verify SurveyMonkey connection
1672
+ * @description Re-tests the stored SurveyMonkey token and returns an anonymity warning when the collector is not anonymous (when the API exposes that setting). 404 when flag off.
1673
+ */
1674
+ post: operations["verifySurveyMonkeyConnector"];
1675
+ delete?: never;
1676
+ options?: never;
1677
+ head?: never;
1678
+ patch?: never;
1679
+ trace?: never;
1680
+ };
1621
1681
  "/workspaces/{workspaceId}/insights/sdlc/overview": {
1622
1682
  parameters: {
1623
1683
  query?: never;
@@ -6511,6 +6571,106 @@ export interface components {
6511
6571
  /** @description PagerDuty user email when known from the last successful verify. */
6512
6572
  userEmail?: string;
6513
6573
  };
6574
+ /** @description SurveyMonkey DevEx survey source for Team Efficiency (`devex-score`). Requires a private-app access token with Responses API read. Plan tier: Advantage (or Premier / Enterprise) with API access. Hidden when `backend-api.teamEfficiency.enabled` is false (404 on PUT/test). */
6575
+ SurveyMonkeySourceDto: {
6576
+ /** @enum {string} */
6577
+ type: "surveymonkey";
6578
+ /** @description SurveyMonkey private app access token (Bearer, write-only on PUT). */
6579
+ token: string;
6580
+ /** @description SurveyMonkey survey id to score. */
6581
+ surveyId: string;
6582
+ /** @description Optional collector id for anonymity checks. */
6583
+ collectorId?: string;
6584
+ /** @description Optional API base URL override. Default `https://api.surveymonkey.com/v3`. */
6585
+ baseUrl?: string;
6586
+ /** @description Required choice question whose options map to org-chart teams. */
6587
+ teamQuestionId?: string;
6588
+ /** @description SurveyMonkey choice id → org-chart team id. */
6589
+ teamOptionMap?: {
6590
+ [key: string]: string;
6591
+ };
6592
+ /** @description SurveyMonkey choice id → department id (for <5 response rollup). */
6593
+ teamDepartmentMap?: {
6594
+ [key: string]: string;
6595
+ };
6596
+ questions?: {
6597
+ questionId: string;
6598
+ /** @enum {string} */
6599
+ dimension: "feedback_loops" | "cognitive_load" | "flow_state";
6600
+ /** @description Negatively worded questions are reverse-scored before % favourable. */
6601
+ reverse?: boolean;
6602
+ }[];
6603
+ /** @description Optional display name from a successful connection test (echo-after-test). */
6604
+ userName?: string;
6605
+ };
6606
+ /** @description Redacted SurveyMonkey source returned by `GET /workspaces/{workspaceId}/config` when Team Efficiency is enabled. Raw token is never returned. Omitted from sources when the feature flag is off. */
6607
+ SurveyMonkeySourceConfigDto: {
6608
+ /** @enum {string} */
6609
+ type: "surveymonkey";
6610
+ hasToken: boolean;
6611
+ surveyId?: string;
6612
+ collectorId?: string;
6613
+ baseUrl?: string;
6614
+ teamQuestionId?: string;
6615
+ teamOptionMap?: {
6616
+ [key: string]: string;
6617
+ };
6618
+ teamDepartmentMap?: {
6619
+ [key: string]: string;
6620
+ };
6621
+ questions?: {
6622
+ questionId: string;
6623
+ /** @enum {string} */
6624
+ dimension: "feedback_loops" | "cognitive_load" | "flow_state";
6625
+ reverse?: boolean;
6626
+ }[];
6627
+ userName?: string;
6628
+ };
6629
+ /** @description One persisted DevEx aggregate row (never email / free text). */
6630
+ DevexResultDto: {
6631
+ teamId?: string | null;
6632
+ departmentId?: string | null;
6633
+ /** @example 2026-Q1 */
6634
+ quarter: string;
6635
+ feedbackLoopsScore: number;
6636
+ cognitiveLoadScore: number;
6637
+ flowStateScore: number;
6638
+ /** @description Average of the three dimension scores (0–100). */
6639
+ devexScore: number;
6640
+ responseCount: number;
6641
+ rosterSize?: number | null;
6642
+ responseRate?: number | null;
6643
+ lowResponseRate: boolean;
6644
+ /** @description True when the team had fewer than 5 responses and rolled to department. */
6645
+ rolledUp: boolean;
6646
+ /** Format: date-time */
6647
+ updatedAt: string;
6648
+ };
6649
+ DevexResultsResponseDto: {
6650
+ /** @enum {string} */
6651
+ metricId: "devex-score";
6652
+ results: components["schemas"]["DevexResultDto"][];
6653
+ };
6654
+ DevexSyncRequestDto: {
6655
+ /** @example 2026-Q1 */
6656
+ quarter?: string;
6657
+ rosterByTeam?: {
6658
+ [key: string]: number;
6659
+ };
6660
+ rosterByDepartment?: {
6661
+ [key: string]: number;
6662
+ };
6663
+ };
6664
+ DevexSyncResultDto: {
6665
+ /** @enum {string} */
6666
+ status?: "ok" | "skipped" | "error";
6667
+ quarter?: string;
6668
+ responseCount?: number;
6669
+ resultCount?: number;
6670
+ code?: string;
6671
+ reason?: string;
6672
+ error?: string;
6673
+ };
6514
6674
  /** @description incident.io incident-management source for `PUT /workspaces/{workspaceId}/sources` and `POST /workspaces/{workspaceId}/sources/test`. Requires an incident.io API key (incident.io → Settings → API keys) with permission to view incidents. The API host is fixed (`https://api.incident.io`); there is no base URL field. */
6515
6675
  IncidentIoSourceDto: {
6516
6676
  /** @enum {string} */
@@ -6736,7 +6896,7 @@ export interface components {
6736
6896
  topics?: components["schemas"]["CodeWikiGuidanceTopicDto"][];
6737
6897
  };
6738
6898
  WorkspaceConfigDto: {
6739
- sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["CodeIntelligenceSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["DatadogSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["IncidentIoSourceConfigDto"] | components["schemas"]["SentrySourceConfigDto"] | components["schemas"]["JiraSourceConfigDto"] | components["schemas"]["LinearSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
6899
+ sources: (components["schemas"]["CursorSourceConfigDto"] | components["schemas"]["ClaudeSourceConfigDto"] | components["schemas"]["CodeIntelligenceSourceConfigDto"] | components["schemas"]["NewRelicSourceConfigDto"] | components["schemas"]["DatadogSourceConfigDto"] | components["schemas"]["PrometheusSourceConfigDto"] | components["schemas"]["GrafanaSourceConfigDto"] | components["schemas"]["SonarQubeSourceConfigDto"] | components["schemas"]["PagerDutySourceConfigDto"] | components["schemas"]["SurveyMonkeySourceConfigDto"] | components["schemas"]["IncidentIoSourceConfigDto"] | components["schemas"]["SentrySourceConfigDto"] | components["schemas"]["JiraSourceConfigDto"] | components["schemas"]["LinearSourceConfigDto"] | components["schemas"]["TenantSourceEntryDto"])[];
6740
6900
  orgChart?: components["schemas"]["ScoringOrgChartDto"] | null;
6741
6901
  /** @enum {string|null} */
6742
6902
  region?: "us" | "eu" | "me" | null;
@@ -13939,6 +14099,12 @@ export type SonarQubeRepoMappingValidateRowDto = components['schemas']['SonarQub
13939
14099
  export type SonarQubeRepoMappingsValidateResponseDto = components['schemas']['SonarQubeRepoMappingsValidateResponseDto'];
13940
14100
  export type PagerDutySourceDto = components['schemas']['PagerDutySourceDto'];
13941
14101
  export type PagerDutySourceConfigDto = components['schemas']['PagerDutySourceConfigDto'];
14102
+ export type SurveyMonkeySourceDto = components['schemas']['SurveyMonkeySourceDto'];
14103
+ export type SurveyMonkeySourceConfigDto = components['schemas']['SurveyMonkeySourceConfigDto'];
14104
+ export type DevexResultDto = components['schemas']['DevexResultDto'];
14105
+ export type DevexResultsResponseDto = components['schemas']['DevexResultsResponseDto'];
14106
+ export type DevexSyncRequestDto = components['schemas']['DevexSyncRequestDto'];
14107
+ export type DevexSyncResultDto = components['schemas']['DevexSyncResultDto'];
13942
14108
  export type IncidentIoSourceDto = components['schemas']['IncidentIoSourceDto'];
13943
14109
  export type IncidentIoSourceConfigDto = components['schemas']['IncidentIoSourceConfigDto'];
13944
14110
  export type SentrySourceDto = components['schemas']['SentrySourceDto'];
@@ -18040,7 +18206,7 @@ export interface operations {
18040
18206
  requestBody: {
18041
18207
  content: {
18042
18208
  "application/json": {
18043
- sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["DatadogSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["IncidentIoSourceDto"] | components["schemas"]["SentrySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["LinearSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
18209
+ sources: (components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["DatadogSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["SurveyMonkeySourceDto"] | components["schemas"]["IncidentIoSourceDto"] | components["schemas"]["SentrySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["LinearSourceDto"] | components["schemas"]["TenantSourceEntryDto"])[];
18044
18210
  };
18045
18211
  };
18046
18212
  };
@@ -18094,7 +18260,7 @@ export interface operations {
18094
18260
  };
18095
18261
  requestBody: {
18096
18262
  content: {
18097
- "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["DatadogSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["IncidentIoSourceDto"] | components["schemas"]["SentrySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["LinearSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
18263
+ "application/json": components["schemas"]["CursorSourcePatchDto"] | components["schemas"]["CursorSourceDto"] | components["schemas"]["ClaudeSourcePatchDto"] | components["schemas"]["ClaudeSourceDto"] | components["schemas"]["CodeIntelligenceSourcePatchDto"] | components["schemas"]["NewRelicSourceDto"] | components["schemas"]["DatadogSourceDto"] | components["schemas"]["PrometheusSourceDto"] | components["schemas"]["GrafanaSourceDto"] | components["schemas"]["SonarQubeSourceDto"] | components["schemas"]["PagerDutySourceDto"] | components["schemas"]["SurveyMonkeySourceDto"] | components["schemas"]["IncidentIoSourceDto"] | components["schemas"]["SentrySourceDto"] | components["schemas"]["JiraSourceDto"] | components["schemas"]["LinearSourceDto"] | components["schemas"]["TenantSourceEntryDto"];
18098
18264
  };
18099
18265
  };
18100
18266
  responses: {
@@ -19444,6 +19610,128 @@ export interface operations {
19444
19610
  };
19445
19611
  };
19446
19612
  };
19613
+ getDevexResults: {
19614
+ parameters: {
19615
+ query?: {
19616
+ quarter?: string;
19617
+ team?: string;
19618
+ department?: string;
19619
+ };
19620
+ header?: never;
19621
+ path: {
19622
+ workspaceId: components["parameters"]["WorkspaceId"];
19623
+ };
19624
+ cookie?: never;
19625
+ };
19626
+ requestBody?: never;
19627
+ responses: {
19628
+ /** @description DevEx aggregate rows */
19629
+ 200: {
19630
+ headers: {
19631
+ [name: string]: unknown;
19632
+ };
19633
+ content: {
19634
+ "application/json": components["schemas"]["DevexResultsResponseDto"];
19635
+ };
19636
+ };
19637
+ 401: components["responses"]["Unauthorized"];
19638
+ 403: components["responses"]["Forbidden"];
19639
+ /** @description Feature flag off or workspace not found */
19640
+ 404: {
19641
+ headers: {
19642
+ [name: string]: unknown;
19643
+ };
19644
+ content?: never;
19645
+ };
19646
+ };
19647
+ };
19648
+ syncDevexSurvey: {
19649
+ parameters: {
19650
+ query?: never;
19651
+ header?: never;
19652
+ path: {
19653
+ workspaceId: components["parameters"]["WorkspaceId"];
19654
+ };
19655
+ cookie?: never;
19656
+ };
19657
+ requestBody?: {
19658
+ content: {
19659
+ "application/json": components["schemas"]["DevexSyncRequestDto"];
19660
+ };
19661
+ };
19662
+ responses: {
19663
+ /** @description Sync completed */
19664
+ 200: {
19665
+ headers: {
19666
+ [name: string]: unknown;
19667
+ };
19668
+ content: {
19669
+ "application/json": components["schemas"]["DevexSyncResultDto"];
19670
+ };
19671
+ };
19672
+ 401: components["responses"]["Unauthorized"];
19673
+ 403: components["responses"]["Forbidden"];
19674
+ /** @description Feature flag off */
19675
+ 404: {
19676
+ headers: {
19677
+ [name: string]: unknown;
19678
+ };
19679
+ content?: never;
19680
+ };
19681
+ /** @description SurveyMonkey not connected or mapping incomplete */
19682
+ 422: {
19683
+ headers: {
19684
+ [name: string]: unknown;
19685
+ };
19686
+ content?: never;
19687
+ };
19688
+ /** @description SurveyMonkey API failure */
19689
+ 502: {
19690
+ headers: {
19691
+ [name: string]: unknown;
19692
+ };
19693
+ content?: never;
19694
+ };
19695
+ };
19696
+ };
19697
+ verifySurveyMonkeyConnector: {
19698
+ parameters: {
19699
+ query?: never;
19700
+ header?: never;
19701
+ path: {
19702
+ workspaceId: components["parameters"]["WorkspaceId"];
19703
+ };
19704
+ cookie?: never;
19705
+ };
19706
+ requestBody?: never;
19707
+ responses: {
19708
+ /** @description Connection test result */
19709
+ 200: {
19710
+ headers: {
19711
+ [name: string]: unknown;
19712
+ };
19713
+ content: {
19714
+ "application/json": components["schemas"]["TestConnectionResponseDto"];
19715
+ };
19716
+ };
19717
+ 401: components["responses"]["Unauthorized"];
19718
+ 403: components["responses"]["Forbidden"];
19719
+ /** @description Feature flag off */
19720
+ 404: {
19721
+ headers: {
19722
+ [name: string]: unknown;
19723
+ };
19724
+ content?: never;
19725
+ };
19726
+ /** @description SurveyMonkey not connected */
19727
+ 422: {
19728
+ headers: {
19729
+ [name: string]: unknown;
19730
+ };
19731
+ content?: never;
19732
+ };
19733
+ };
19734
+ };
19447
19735
  getSdlcInsightsOverview: {
19448
19736
  parameters: {
19449
19737
  query?: {
package/src/index.ts CHANGED
@@ -2004,6 +2004,10 @@ export const SDL_C_METRIC_IDS = [
2004
2004
  ] as const;
2005
2005
  export type SdlcMetricId = (typeof SDL_C_METRIC_IDS)[number];
2006
2006
 
2007
+ /** Team Efficiency metric ids (Shine). Bundle assembly lands in T8. */
2008
+ export const TEAM_EFFICIENCY_METRIC_IDS = ["devex-score"] as const;
2009
+ export type TeamEfficiencyMetricId = (typeof TEAM_EFFICIENCY_METRIC_IDS)[number];
2010
+
2007
2011
  export type SdlcMetricDataStatus = "live" | "preview" | "unavailable";
2008
2012
  export type SdlcMetricHealthStatus = "healthy" | "warning" | "critical" | "unknown";
2009
2013
  export type SdlcBenchmarkBand = "elite" | "high" | "medium" | "low";