@thinkai/tai-api-contract 2.162.0 → 2.164.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.
@@ -2419,6 +2419,30 @@ export interface paths {
2419
2419
  patch?: never;
2420
2420
  trace?: never;
2421
2421
  };
2422
+ "/workspaces/{workspaceId}/aggregate-use-consent": {
2423
+ parameters: {
2424
+ query?: never;
2425
+ header?: never;
2426
+ path?: never;
2427
+ cookie?: never;
2428
+ };
2429
+ /**
2430
+ * Read anonymized aggregate-use permission
2431
+ * @description Returns whether ThinkAI may use this workspace's anonymized aggregate results in marketing and peer benchmarks. A workspace that never chose returns `unset`, which behaves as opted out (`effective: false`). The permission never covers company name, logo, quote, raw report, repository or person identity, or customer reference. Any workspace member may read it.
2432
+ */
2433
+ get: operations["getAggregateUseConsent"];
2434
+ /**
2435
+ * Set anonymized aggregate-use permission
2436
+ * @description Workspace admins opt in or out. Every change writes one `workspace.aggregate_use.changed` activity-log row in the same transaction. Moving from `opt_in` to `opt_out` records a withdrawal and stops future extraction. Opt-in requires the current legal-approved notice version; while no notice is approved, opt-in returns `409 aggregate_use_notice_unapproved`. Opt-out is always accepted. A refusal does not change price, delivery, support, or assessment output.
2437
+ */
2438
+ put: operations["putAggregateUseConsent"];
2439
+ post?: never;
2440
+ delete?: never;
2441
+ options?: never;
2442
+ head?: never;
2443
+ patch?: never;
2444
+ trace?: never;
2445
+ };
2422
2446
  "/workspaces/{workspaceId}/report-center/exports": {
2423
2447
  parameters: {
2424
2448
  query?: never;
@@ -4723,7 +4747,7 @@ export interface components {
4723
4747
  * @enum {string}
4724
4748
  */
4725
4749
  WorkspaceInvitationStatusDto: "pending" | "accepted" | "expired" | "revoked" | "rejected";
4726
- /** @description Workspace invitation as seen by an authenticated admin or invitee. */
4750
+ /** @description Workspace invitation as seen by an authenticated admin or invitee. Inviter identity is omitted from this DTO (mailer uses store rows; public preview exposes `invitedByName` on `WorkspaceInvitationPreviewDto` only). */
4727
4751
  WorkspaceInvitationDto: {
4728
4752
  /** Format: uuid */
4729
4753
  id: string;
@@ -4735,8 +4759,6 @@ export interface components {
4735
4759
  /** @enum {string} */
4736
4760
  role: "admin" | "editor" | "viewer";
4737
4761
  status: components["schemas"]["WorkspaceInvitationStatusDto"];
4738
- invitedByName?: string | null;
4739
- invitedByEmail?: string | null;
4740
4762
  /** Format: date-time */
4741
4763
  expiresAt: string;
4742
4764
  /** Format: date-time */
@@ -6527,10 +6549,10 @@ export interface components {
6527
6549
  heatmap: components["schemas"]["AiToolMemberHeatmapDayDto"][];
6528
6550
  };
6529
6551
  MeProfileDto: {
6552
+ /** @description Authenticated subject id (JWT `sub`). */
6530
6553
  id: string;
6531
6554
  email: string;
6532
6555
  name: string;
6533
- roles: string[];
6534
6556
  defaultWorkspaceId?: string | null;
6535
6557
  /** @description True when the caller's email is on the `PLATFORM_ADMIN_EMAILS` allowlist. Lets the frontend gate platform-admin surfaces (e.g. the privacy-request queue) without duplicating the allowlist client-side. */
6536
6558
  isPlatformAdmin?: boolean;
@@ -8724,11 +8746,55 @@ export interface components {
8724
8746
  * @description Type of workspace lifecycle event.
8725
8747
  * @enum {string}
8726
8748
  */
8727
- ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "code_insights.design_run_started" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.hibob.sync_started" | "hris.hibob.sync_completed" | "hris.hibob.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "integrations.code_intelligence.settings_changed" | "integrations.code_intelligence.execution_key.added" | "integrations.code_intelligence.execution_key.updated" | "integrations.code_intelligence.execution_key.removed" | "integrations.code_intelligence.execution_key.check_failed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed" | "report.exported";
8749
+ ActivityLogEventTypeDto: "repo.added" | "repo.removed" | "repo.readded" | "integration.github.added" | "integration.github.updated" | "integration.github.removed" | "integration.github.permissions_changed" | "integration.github.repo_added" | "integration.github.repo_removed" | "fix.requested" | "fix.generating" | "fix.pr_created" | "fix.merged" | "fix.failed" | "readiness.scan_started" | "readiness.scan_completed" | "readiness.scan_failed" | "readiness.scan_partial" | "code_insights.design_run_started" | "integrations.agent_execution.provider_changed" | "integrations.repo_eligibility.overrides_changed" | "integrations.repo_eligibility.languages_refresh_requested" | "integrations.cursor.platform_key_enabled" | "integrations.cursor.platform_key_disabled" | "member.invited" | "member.invite_accepted" | "member.invite_rejected" | "member.role_changed" | "member.removed" | "hris.personio.sync_started" | "hris.personio.sync_completed" | "hris.personio.sync_failed" | "hris.zenhr.sync_started" | "hris.zenhr.sync_completed" | "hris.zenhr.sync_failed" | "hris.zelt.sync_started" | "hris.zelt.sync_completed" | "hris.zelt.sync_failed" | "hris.hibob.sync_started" | "hris.hibob.sync_completed" | "hris.hibob.sync_failed" | "hris.sync_started" | "hris.sync_completed" | "hris.sync_failed" | "repo.sync_skipped" | "integrations.cursor.execution_key.added" | "integrations.cursor.execution_key.updated" | "integrations.cursor.execution_key.removed" | "integrations.cursor.execution_key.check_failed" | "integrations.cursor.admin_key.added" | "integrations.cursor.admin_key.updated" | "integrations.cursor.admin_key.removed" | "integrations.claude.execution_key.added" | "integrations.claude.execution_key.updated" | "integrations.claude.execution_key.removed" | "integrations.claude.execution_key.check_failed" | "integrations.claude.admin_key.added" | "integrations.claude.admin_key.updated" | "integrations.claude.admin_key.removed" | "integrations.claude.analytics_key.added" | "integrations.claude.analytics_key.updated" | "integrations.claude.analytics_key.removed" | "integrations.code_intelligence.settings_changed" | "integrations.code_intelligence.execution_key.added" | "integrations.code_intelligence.execution_key.updated" | "integrations.code_intelligence.execution_key.removed" | "integrations.code_intelligence.execution_key.check_failed" | "readiness.scan_precheck_failed" | "productivity.ingest.completed" | "productivity.ingest.failed" | "productivity.ingest.skipped" | "productivity.ingest.repo_skipped" | "productivity.ingest.coverage_gap_detected" | "integrations.newrelic.added" | "integrations.newrelic.removed" | "integrations.newrelic.sync_completed" | "integrations.newrelic.sync_failed" | "integrations.prometheus.added" | "integrations.prometheus.removed" | "integrations.prometheus.sync_completed" | "integrations.prometheus.sync_failed" | "integrations.grafana.added" | "integrations.grafana.removed" | "integrations.grafana.sync_completed" | "integrations.grafana.sync_failed" | "integrations.zelt.added" | "integrations.zelt.removed" | "report.exported" | "workspace.aggregate_use.changed";
8728
8750
  UnsetAssessmentDecisionDto: {
8729
8751
  /** @enum {string} */
8730
8752
  status: "unset";
8731
8753
  };
8754
+ /** @description Current legal-approved opt-in notice, or `unset` while opt-in is unavailable. */
8755
+ AggregateUseNoticeStatusDto: {
8756
+ /** @enum {string} */
8757
+ status: "approved" | "unset";
8758
+ /** @description Present only when `status` is `approved`. Send it back on opt-in. */
8759
+ version?: string;
8760
+ };
8761
+ AggregateUseConsentDto: {
8762
+ /**
8763
+ * @description Saved choice. `unset` means the workspace never chose and is treated as opted out.
8764
+ * @enum {string}
8765
+ */
8766
+ aggregateUse: "opt_in" | "opt_out" | "unset";
8767
+ /** @description True only for `opt_in`. Benchmark and marketing extraction must check this. */
8768
+ effective: boolean;
8769
+ /** @description Notice version accepted with the current opt-in; null otherwise. */
8770
+ noticeVersion: string | null;
8771
+ /** @enum {string|null} */
8772
+ source: "workspace_settings" | null;
8773
+ /**
8774
+ * Format: date-time
8775
+ * @description When the current choice was saved; null when `unset`.
8776
+ */
8777
+ recordedAt: string | null;
8778
+ recordedBy: {
8779
+ /** Format: uuid */
8780
+ userId: string;
8781
+ displayName: string | null;
8782
+ } | null;
8783
+ /**
8784
+ * Format: date-time
8785
+ * @description Most recent opt-in withdrawal while the workspace remains opted out.
8786
+ */
8787
+ withdrawnAt: string | null;
8788
+ currentNotice: components["schemas"]["AggregateUseNoticeStatusDto"];
8789
+ /** @description Exact sentence the assessment PDF prints beside `recordedAt`. Opted-out and unset workspaces get the fixed refusal sentence. Opt-in returns the approved sentence for the accepted notice, or null if that notice is unknown, which blocks validation. */
8790
+ reportSentence: string | null;
8791
+ };
8792
+ AggregateUseConsentPutDto: {
8793
+ /** @enum {string} */
8794
+ aggregateUse: "opt_in" | "opt_out";
8795
+ /** @description Required for `opt_in` and must equal `currentNotice.version`. Ignored for `opt_out`. */
8796
+ noticeVersion?: string | null;
8797
+ };
8732
8798
  AssessmentDictionaryDto: {
8733
8799
  /** @enum {string} */
8734
8800
  version: "2026-10-18.1";
@@ -11323,6 +11389,9 @@ export type PutAgenticFoundationRepoScopeFailureDto = components['schemas']['Put
11323
11389
  export type PutAgenticFoundationRepoScopeResponseDto = components['schemas']['PutAgenticFoundationRepoScopeResponseDto'];
11324
11390
  export type ActivityLogEventTypeDto = components['schemas']['ActivityLogEventTypeDto'];
11325
11391
  export type UnsetAssessmentDecisionDto = components['schemas']['UnsetAssessmentDecisionDto'];
11392
+ export type AggregateUseNoticeStatusDto = components['schemas']['AggregateUseNoticeStatusDto'];
11393
+ export type AggregateUseConsentDto = components['schemas']['AggregateUseConsentDto'];
11394
+ export type AggregateUseConsentPutDto = components['schemas']['AggregateUseConsentPutDto'];
11326
11395
  export type AssessmentDictionaryDto = components['schemas']['AssessmentDictionaryDto'];
11327
11396
  export type ReportCenterExportRecordBodyDto = components['schemas']['ReportCenterExportRecordBodyDto'];
11328
11397
  export type ReportCenterExportRecordResponseDto = components['schemas']['ReportCenterExportRecordResponseDto'];
@@ -17983,6 +18052,102 @@ export interface operations {
17983
18052
  };
17984
18053
  };
17985
18054
  };
18055
+ getAggregateUseConsent: {
18056
+ parameters: {
18057
+ query?: never;
18058
+ header?: never;
18059
+ path: {
18060
+ workspaceId: components["parameters"]["WorkspaceId"];
18061
+ };
18062
+ cookie?: never;
18063
+ };
18064
+ requestBody?: never;
18065
+ responses: {
18066
+ /** @description Current permission and the sentence reports must print */
18067
+ 200: {
18068
+ headers: {
18069
+ [name: string]: unknown;
18070
+ };
18071
+ content: {
18072
+ "application/json": components["schemas"]["AggregateUseConsentDto"];
18073
+ };
18074
+ };
18075
+ 401: components["responses"]["Unauthorized"];
18076
+ 403: components["responses"]["Forbidden"];
18077
+ /** @description Workspace does not exist */
18078
+ 404: {
18079
+ headers: {
18080
+ [name: string]: unknown;
18081
+ };
18082
+ content: {
18083
+ "application/json": components["schemas"]["ErrorMessageDto"];
18084
+ };
18085
+ };
18086
+ };
18087
+ };
18088
+ putAggregateUseConsent: {
18089
+ parameters: {
18090
+ query?: never;
18091
+ header?: never;
18092
+ path: {
18093
+ workspaceId: components["parameters"]["WorkspaceId"];
18094
+ };
18095
+ cookie?: never;
18096
+ };
18097
+ requestBody: {
18098
+ content: {
18099
+ "application/json": components["schemas"]["AggregateUseConsentPutDto"];
18100
+ };
18101
+ };
18102
+ responses: {
18103
+ /** @description Saved permission */
18104
+ 200: {
18105
+ headers: {
18106
+ [name: string]: unknown;
18107
+ };
18108
+ content: {
18109
+ "application/json": components["schemas"]["AggregateUseConsentDto"];
18110
+ };
18111
+ };
18112
+ /** @description Invalid body (`code`: `invalid_input`) */
18113
+ 400: {
18114
+ headers: {
18115
+ [name: string]: unknown;
18116
+ };
18117
+ content: {
18118
+ "application/json": components["schemas"]["ErrorMessageDto"];
18119
+ };
18120
+ };
18121
+ 401: components["responses"]["Unauthorized"];
18122
+ /** @description Caller is not a workspace admin (`code`: `workspace_admin_required`) */
18123
+ 403: {
18124
+ headers: {
18125
+ [name: string]: unknown;
18126
+ };
18127
+ content: {
18128
+ "application/json": components["schemas"]["ErrorMessageDto"];
18129
+ };
18130
+ };
18131
+ /** @description Workspace does not exist */
18132
+ 404: {
18133
+ headers: {
18134
+ [name: string]: unknown;
18135
+ };
18136
+ content: {
18137
+ "application/json": components["schemas"]["ErrorMessageDto"];
18138
+ };
18139
+ };
18140
+ /** @description Opt-in refused because no notice is approved (`aggregate_use_notice_unapproved`) or the submitted notice version is not current (`aggregate_use_notice_stale`). */
18141
+ 409: {
18142
+ headers: {
18143
+ [name: string]: unknown;
18144
+ };
18145
+ content: {
18146
+ "application/json": components["schemas"]["ErrorMessageDto"];
18147
+ };
18148
+ };
18149
+ };
18150
+ };
17986
18151
  recordReportCenterExport: {
17987
18152
  parameters: {
17988
18153
  query?: never;
@@ -18049,7 +18214,7 @@ export interface operations {
18049
18214
  order?: components["parameters"]["PaginationOrder"];
18050
18215
  /** @description Server-side sort column (the activity "5 W's"). Combined with `order` (asc/desc). Defaults to `when` (occurredAt). `occurredAt`/`id` is always the tiebreaker. */
18051
18216
  sort?: "when" | "who" | "what" | "why" | "where";
18052
- /** @description Coarse product-area grouping filter (#156). `integration` = GitHub + AI-tool key events; `agentic_foundation` = repos, readiness scans, fixes; `workspace_team` = members + HRIS + report exports; `productivity` = productivity ingest lifecycle events. Omit (or pass `all`) for every area. */
18217
+ /** @description Coarse product-area grouping filter (#156). `integration` = GitHub + AI-tool key events; `agentic_foundation` = repos, readiness scans, fixes; `workspace_team` = members + HRIS + report exports + workspace settings; `productivity` = productivity ingest lifecycle events. Omit (or pass `all`) for every area. */
18053
18218
  productArea?: "integration" | "agentic_foundation" | "workspace_team" | "productivity" | "all";
18054
18219
  /** @description Filter to a specific event type. */
18055
18220
  eventType?: components["schemas"]["ActivityLogEventTypeDto"];