@thinkai/tai-api-contract 2.211.0 → 2.212.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.
@@ -951,12 +951,12 @@ export interface paths {
951
951
  };
952
952
  /**
953
953
  * Get enterprise SAML SSO configuration
954
- * @description Returns per-workspace enterprise SSO binding (`ssoProviderId`, domains, join policy). Member-level read. Does not return IdP metadata XML.
954
+ * @description Returns per-workspace enterprise SSO status (`pending` / `active` / …), domains, join policy, and optional IdP metadata URL. Member-level read. Does not return IdP metadata XML. `ssoProviderId` is present only after platform Apply.
955
955
  */
956
956
  get: operations["getWorkspaceEnterpriseSso"];
957
957
  /**
958
- * Set enterprise SAML SSO configuration
959
- * @description Full-replace workspace enterprise SSO config. Bind a Supabase `sso_provider_id` (from `supabase sso add` for Okta or Entra) and one or more email domains. `joinPolicy: domain_auto_join` grants viewer membership on first `GET /me/workspaces` after SSO login when the JWT email domain matches. Requires workspace **admin**. Domains must be unique across enabled workspaces (`409 sso_domain_conflict`).
958
+ * Submit or update a pending enterprise SSO request
959
+ * @description Workspace **admin** submits Okta or Entra IdP details (`metadataUrl`, domains, join policy). Sets `status=pending`, `enabled=false`, and clears `ssoProviderId`. Platform admins register the IdP via `POST /admin/enterprise-sso/{workspaceId}/apply`. Domains must be unique across pending and active workspaces (`409 sso_domain_conflict`). Rejected when SSO is already active (`409 enterprise_sso_already_active`).
960
960
  */
961
961
  put: operations["putWorkspaceEnterpriseSso"];
962
962
  post?: never;
@@ -966,6 +966,66 @@ export interface paths {
966
966
  patch?: never;
967
967
  trace?: never;
968
968
  };
969
+ "/admin/enterprise-sso/pending": {
970
+ parameters: {
971
+ query?: never;
972
+ header?: never;
973
+ path?: never;
974
+ cookie?: never;
975
+ };
976
+ /**
977
+ * List pending enterprise SSO requests
978
+ * @description Platform admin only. Returns workspaces with `status=pending`.
979
+ */
980
+ get: operations["listAdminEnterpriseSsoPending"];
981
+ put?: never;
982
+ post?: never;
983
+ delete?: never;
984
+ options?: never;
985
+ head?: never;
986
+ patch?: never;
987
+ trace?: never;
988
+ };
989
+ "/admin/enterprise-sso/{workspaceId}/apply": {
990
+ parameters: {
991
+ query?: never;
992
+ header?: never;
993
+ path?: never;
994
+ cookie?: never;
995
+ };
996
+ get?: never;
997
+ put?: never;
998
+ /**
999
+ * Apply a pending enterprise SSO request
1000
+ * @description Platform admin only. Creates a SAML SSO provider on ThinkAI Auth from the workspace pending `metadataUrl` and domains, then sets `status=active` and `enabled=true`. `dedicatedScope` defaults to true when `idpType` is `entra`.
1001
+ */
1002
+ post: operations["postAdminEnterpriseSsoApply"];
1003
+ delete?: never;
1004
+ options?: never;
1005
+ head?: never;
1006
+ patch?: never;
1007
+ trace?: never;
1008
+ };
1009
+ "/admin/enterprise-sso/{workspaceId}/reject": {
1010
+ parameters: {
1011
+ query?: never;
1012
+ header?: never;
1013
+ path?: never;
1014
+ cookie?: never;
1015
+ };
1016
+ get?: never;
1017
+ put?: never;
1018
+ /**
1019
+ * Reject a pending enterprise SSO request
1020
+ * @description Platform admin only. Sets `status=rejected` and optional `rejectReason`.
1021
+ */
1022
+ post: operations["postAdminEnterpriseSsoReject"];
1023
+ delete?: never;
1024
+ options?: never;
1025
+ head?: never;
1026
+ patch?: never;
1027
+ trace?: never;
1028
+ };
969
1029
  "/workspaces/{workspaceId}/productivity-targets": {
970
1030
  parameters: {
971
1031
  query?: never;
@@ -3906,6 +3966,26 @@ export interface paths {
3906
3966
  patch?: never;
3907
3967
  trace?: never;
3908
3968
  };
3969
+ "/workspaces/{workspaceId}/code-chat/knowledge-jobs/{jobId}/cancel": {
3970
+ parameters: {
3971
+ query?: never;
3972
+ header?: never;
3973
+ path?: never;
3974
+ cookie?: never;
3975
+ };
3976
+ get?: never;
3977
+ put?: never;
3978
+ /**
3979
+ * Cancel a queued or running knowledge job
3980
+ * @description Any workspace member when Engineering Context Graph is on. Clears the worker lease so in-flight work stops at the next ownership check. Restores the index to ready when a usable graph already exists (`graph_json` and `node_count > 0`); otherwise marks the index failed with "Cancelled by user". Authz matches other CodeChat member routes (Code Intelligence enabled); unlike continue, no execution key is required.
3981
+ */
3982
+ post: operations["cancelCodeChatKnowledgeJob"];
3983
+ delete?: never;
3984
+ options?: never;
3985
+ head?: never;
3986
+ patch?: never;
3987
+ trace?: never;
3988
+ };
3909
3989
  "/workspaces/{workspaceId}/code-chat/readiness": {
3910
3990
  parameters: {
3911
3991
  query?: never;
@@ -6738,11 +6818,16 @@ export interface components {
6738
6818
  };
6739
6819
  };
6740
6820
  WorkspaceSsoConfigDto: {
6741
- /** @description When true, enterprise SAML SSO is active for the listed domains. */
6821
+ /**
6822
+ * @description Lifecycle of the SSO binding. Sign-in (`/auth/sso-lookup`) is available only when `status` is `active` and `enabled` is true with a provider id.
6823
+ * @enum {string}
6824
+ */
6825
+ status: "pending" | "active" | "rejected" | "disabled";
6826
+ /** @description When true with `status=active`, enterprise SAML SSO is live for the listed domains. */
6742
6827
  enabled: boolean;
6743
6828
  /**
6744
6829
  * Format: uuid
6745
- * @description Supabase Auth SSO provider id from `supabase sso add` / dashboard.
6830
+ * @description ThinkAI Auth SSO provider id set by platform Apply (null while pending).
6746
6831
  */
6747
6832
  ssoProviderId: string | null;
6748
6833
  /**
@@ -6758,13 +6843,77 @@ export interface components {
6758
6843
  */
6759
6844
  joinPolicy: "invite_only" | "domain_auto_join";
6760
6845
  /**
6761
- * @description Optional label for UI / ops (Okta, Microsoft Entra, or generic SAML).
6846
+ * @description IdP label (Okta / Microsoft Entra; `saml` is legacy).
6762
6847
  * @enum {string|null}
6763
6848
  */
6764
6849
  idpType?: "okta" | "entra" | "saml" | null;
6765
- /** @description Ops-only label or URL reference; never raw SAML metadata XML. */
6850
+ /**
6851
+ * Format: uri
6852
+ * @description HTTPS IdP SAML metadata URL from the customer IdP admin.
6853
+ */
6854
+ metadataUrl?: string | null;
6855
+ /** @description Optional ops label; not the IdP metadata URL. */
6856
+ metadataRef?: string | null;
6857
+ /** @description Present when `status` is `rejected`. */
6858
+ rejectReason?: string | null;
6859
+ };
6860
+ WorkspaceSsoRequestDto: {
6861
+ /**
6862
+ * @description Which company IdP the workspace is connecting.
6863
+ * @enum {string}
6864
+ */
6865
+ idpType: "okta" | "entra";
6866
+ /**
6867
+ * Format: uri
6868
+ * @description HTTPS Identity Provider metadata URL from Okta or Entra.
6869
+ */
6870
+ metadataUrl: string;
6871
+ /**
6872
+ * @description Work email domains that should use this IdP.
6873
+ * @example [
6874
+ * "acme.com"
6875
+ * ]
6876
+ */
6877
+ domains: string[];
6878
+ /** @enum {string} */
6879
+ joinPolicy: "invite_only" | "domain_auto_join";
6880
+ /** @description Optional internal ops label (not the metadata URL). */
6881
+ metadataRef?: string | null;
6882
+ };
6883
+ AdminEnterpriseSsoPendingListDto: {
6884
+ items: components["schemas"]["AdminEnterpriseSsoPendingItemDto"][];
6885
+ };
6886
+ AdminEnterpriseSsoPendingItemDto: {
6887
+ /** Format: uuid */
6888
+ workspaceId: string;
6889
+ workspaceSlug: string;
6890
+ workspaceName: string;
6891
+ /** Format: date-time */
6892
+ submittedAt: string;
6893
+ /** @enum {string|null} */
6894
+ idpType?: "okta" | "entra" | "saml" | null;
6895
+ domains: string[];
6896
+ metadataUrl?: string | null;
6897
+ /** @enum {string} */
6898
+ joinPolicy: "invite_only" | "domain_auto_join";
6766
6899
  metadataRef?: string | null;
6767
6900
  };
6901
+ AdminEnterpriseSsoApplyRequestDto: {
6902
+ /** @description When true, Auth may allocate a dedicated ACS (recommended for Entra). Defaults to true for Entra and false for Okta when omitted. */
6903
+ dedicatedScope?: boolean;
6904
+ };
6905
+ AdminEnterpriseSsoApplyResponseDto: {
6906
+ /** Format: uuid */
6907
+ workspaceId: string;
6908
+ /** Format: uuid */
6909
+ ssoProviderId: string;
6910
+ /** @enum {string} */
6911
+ status: "active";
6912
+ dedicatedScope: boolean;
6913
+ };
6914
+ AdminEnterpriseSsoRejectRequestDto: {
6915
+ reason?: string;
6916
+ };
6768
6917
  AuthSsoLookupDto: {
6769
6918
  available: boolean;
6770
6919
  domain: string;
@@ -13706,6 +13855,12 @@ export type AiModelPolicyConfigDto = components['schemas']['AiModelPolicyConfigD
13706
13855
  export type AiModelPolicyPersonOverrideDto = components['schemas']['AiModelPolicyPersonOverrideDto'];
13707
13856
  export type AiModelPolicyDto = components['schemas']['AiModelPolicyDto'];
13708
13857
  export type WorkspaceSsoConfigDto = components['schemas']['WorkspaceSsoConfigDto'];
13858
+ export type WorkspaceSsoRequestDto = components['schemas']['WorkspaceSsoRequestDto'];
13859
+ export type AdminEnterpriseSsoPendingListDto = components['schemas']['AdminEnterpriseSsoPendingListDto'];
13860
+ export type AdminEnterpriseSsoPendingItemDto = components['schemas']['AdminEnterpriseSsoPendingItemDto'];
13861
+ export type AdminEnterpriseSsoApplyRequestDto = components['schemas']['AdminEnterpriseSsoApplyRequestDto'];
13862
+ export type AdminEnterpriseSsoApplyResponseDto = components['schemas']['AdminEnterpriseSsoApplyResponseDto'];
13863
+ export type AdminEnterpriseSsoRejectRequestDto = components['schemas']['AdminEnterpriseSsoRejectRequestDto'];
13709
13864
  export type AuthSsoLookupDto = components['schemas']['AuthSsoLookupDto'];
13710
13865
  export type ProductivityTargetsDto = components['schemas']['ProductivityTargetsDto'];
13711
13866
  export type DimensionTargetPercentsDto = components['schemas']['DimensionTargetPercentsDto'];
@@ -17263,11 +17418,11 @@ export interface operations {
17263
17418
  };
17264
17419
  requestBody: {
17265
17420
  content: {
17266
- "application/json": components["schemas"]["WorkspaceSsoConfigDto"];
17421
+ "application/json": components["schemas"]["WorkspaceSsoRequestDto"];
17267
17422
  };
17268
17423
  };
17269
17424
  responses: {
17270
- /** @description Config persisted */
17425
+ /** @description Pending request persisted */
17271
17426
  204: {
17272
17427
  headers: {
17273
17428
  [name: string]: unknown;
@@ -17302,7 +17457,137 @@ export interface operations {
17302
17457
  "application/json": components["schemas"]["ErrorMessageDto"];
17303
17458
  };
17304
17459
  };
17305
- /** @description Email domain already bound to another workspace */
17460
+ /** @description Domain conflict or SSO already active */
17461
+ 409: {
17462
+ headers: {
17463
+ [name: string]: unknown;
17464
+ };
17465
+ content: {
17466
+ "application/json": components["schemas"]["ErrorMessageDto"];
17467
+ };
17468
+ };
17469
+ };
17470
+ };
17471
+ listAdminEnterpriseSsoPending: {
17472
+ parameters: {
17473
+ query?: never;
17474
+ header?: never;
17475
+ path?: never;
17476
+ cookie?: never;
17477
+ };
17478
+ requestBody?: never;
17479
+ responses: {
17480
+ /** @description Pending queue */
17481
+ 200: {
17482
+ headers: {
17483
+ [name: string]: unknown;
17484
+ };
17485
+ content: {
17486
+ "application/json": components["schemas"]["AdminEnterpriseSsoPendingListDto"];
17487
+ };
17488
+ };
17489
+ 401: components["responses"]["Unauthorized"];
17490
+ 403: components["responses"]["Forbidden"];
17491
+ };
17492
+ };
17493
+ postAdminEnterpriseSsoApply: {
17494
+ parameters: {
17495
+ query?: never;
17496
+ header?: never;
17497
+ path: {
17498
+ workspaceId: components["parameters"]["WorkspaceId"];
17499
+ };
17500
+ cookie?: never;
17501
+ };
17502
+ requestBody?: {
17503
+ content: {
17504
+ "application/json": components["schemas"]["AdminEnterpriseSsoApplyRequestDto"];
17505
+ };
17506
+ };
17507
+ responses: {
17508
+ /** @description Provider created and workspace activated */
17509
+ 200: {
17510
+ headers: {
17511
+ [name: string]: unknown;
17512
+ };
17513
+ content: {
17514
+ "application/json": components["schemas"]["AdminEnterpriseSsoApplyResponseDto"];
17515
+ };
17516
+ };
17517
+ /** @description Invalid pending payload */
17518
+ 400: {
17519
+ headers: {
17520
+ [name: string]: unknown;
17521
+ };
17522
+ content: {
17523
+ "application/json": components["schemas"]["ErrorMessageDto"];
17524
+ };
17525
+ };
17526
+ 401: components["responses"]["Unauthorized"];
17527
+ 403: components["responses"]["Forbidden"];
17528
+ /** @description Workspace not found */
17529
+ 404: {
17530
+ headers: {
17531
+ [name: string]: unknown;
17532
+ };
17533
+ content: {
17534
+ "application/json": components["schemas"]["ErrorMessageDto"];
17535
+ };
17536
+ };
17537
+ /** @description Not pending */
17538
+ 409: {
17539
+ headers: {
17540
+ [name: string]: unknown;
17541
+ };
17542
+ content: {
17543
+ "application/json": components["schemas"]["ErrorMessageDto"];
17544
+ };
17545
+ };
17546
+ /** @description ThinkAI Auth rejected provider create */
17547
+ 502: {
17548
+ headers: {
17549
+ [name: string]: unknown;
17550
+ };
17551
+ content: {
17552
+ "application/json": components["schemas"]["ErrorMessageDto"];
17553
+ };
17554
+ };
17555
+ };
17556
+ };
17557
+ postAdminEnterpriseSsoReject: {
17558
+ parameters: {
17559
+ query?: never;
17560
+ header?: never;
17561
+ path: {
17562
+ workspaceId: components["parameters"]["WorkspaceId"];
17563
+ };
17564
+ cookie?: never;
17565
+ };
17566
+ requestBody?: {
17567
+ content: {
17568
+ "application/json": components["schemas"]["AdminEnterpriseSsoRejectRequestDto"];
17569
+ };
17570
+ };
17571
+ responses: {
17572
+ /** @description Rejected */
17573
+ 204: {
17574
+ headers: {
17575
+ [name: string]: unknown;
17576
+ };
17577
+ content?: never;
17578
+ };
17579
+ 401: components["responses"]["Unauthorized"];
17580
+ 403: components["responses"]["Forbidden"];
17581
+ /** @description Workspace not found */
17582
+ 404: {
17583
+ headers: {
17584
+ [name: string]: unknown;
17585
+ };
17586
+ content: {
17587
+ "application/json": components["schemas"]["ErrorMessageDto"];
17588
+ };
17589
+ };
17590
+ /** @description Not pending */
17306
17591
  409: {
17307
17592
  headers: {
17308
17593
  [name: string]: unknown;
@@ -25149,6 +25434,62 @@ export interface operations {
25149
25434
  };
25150
25435
  };
25151
25436
  };
25437
+ cancelCodeChatKnowledgeJob: {
25438
+ parameters: {
25439
+ query?: never;
25440
+ header?: never;
25441
+ path: {
25442
+ workspaceId: components["parameters"]["WorkspaceId"];
25443
+ /** @description Active knowledge job id (`tai_workspace_code_knowledge_jobs.id`). */
25444
+ jobId: string;
25445
+ };
25446
+ cookie?: never;
25447
+ };
25448
+ requestBody?: never;
25449
+ responses: {
25450
+ /** @description Job cancelled */
25451
+ 200: {
25452
+ headers: {
25453
+ [name: string]: unknown;
25454
+ };
25455
+ content: {
25456
+ "application/json": {
25457
+ job: components["schemas"]["CodeKnowledgeJobDto"];
25458
+ };
25459
+ };
25460
+ };
25461
+ 401: components["responses"]["Unauthorized"];
25462
+ /** @description Engineering Context Graph is off */
25463
+ 403: {
25464
+ headers: {
25465
+ [name: string]: unknown;
25466
+ };
25467
+ content: {
25468
+ /**
25469
+ * @example {
25470
+ * "error": "Code Intelligence is disabled for this workspace",
25471
+ * "code": "code_intelligence_disabled"
25472
+ * }
25473
+ */
25474
+ "application/json": components["schemas"]["ErrorMessageDto"];
25475
+ };
25476
+ };
25477
+ /** @description No active knowledge job to cancel */
25478
+ 404: {
25479
+ headers: {
25480
+ [name: string]: unknown;
25481
+ };
25482
+ content: {
25483
+ /**
25484
+ * @example {
25485
+ * "error": "No active knowledge job to cancel"
25486
+ * }
25487
+ */
25488
+ "application/json": components["schemas"]["ErrorMessageDto"];
25489
+ };
25490
+ };
25491
+ };
25492
+ };
25152
25493
  getCodeChatReadiness: {
25153
25494
  parameters: {
25154
25495
  query?: never;