@iblai/data-layer 1.37.0 → 1.38.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.
- package/dist/index.d.ts +2406 -437
- package/dist/index.esm.js +196 -51
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +207 -50
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/features/credentials/__tests__/connected-services-callback.test.d.ts +1 -0
- package/dist/src/features/mcp/__tests__/api-slice.test.d.ts +1 -0
- package/dist/src/features/mcp/api-slice.d.ts +1864 -134
- package/dist/src/features/mcp/constants.d.ts +17 -1
- package/dist/src/features/mcp/types.d.ts +211 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -53,5 +53,21 @@ export declare const MCP_ENDPOINTS: {
|
|
|
53
53
|
readonly path: (org: string, userId: string) => string;
|
|
54
54
|
readonly service: SERVICES.DM;
|
|
55
55
|
};
|
|
56
|
+
readonly MCP_SERVER_PREFERENCE: {
|
|
57
|
+
readonly path: (org: string, userId: string, id: number) => string;
|
|
58
|
+
readonly service: SERVICES.DM;
|
|
59
|
+
};
|
|
60
|
+
readonly MCP_SERVER_SESSION_PREFERENCE: {
|
|
61
|
+
readonly path: (org: string, userId: string, id: number) => string;
|
|
62
|
+
readonly service: SERVICES.DM;
|
|
63
|
+
};
|
|
64
|
+
readonly MCP_SERVER_MENTOR_AUTH_SCOPE: {
|
|
65
|
+
readonly path: (org: string, userId: string, id: number) => string;
|
|
66
|
+
readonly service: SERVICES.DM;
|
|
67
|
+
};
|
|
68
|
+
readonly MCP_SERVER_CREDENTIALS: {
|
|
69
|
+
readonly path: (org: string, userId: string, id: number) => string;
|
|
70
|
+
readonly service: SERVICES.DM;
|
|
71
|
+
};
|
|
56
72
|
};
|
|
57
|
-
export declare const MCP_TAG_TYPES: readonly ["MCPServers", "ConnectedServices", "MCPServerConnections"];
|
|
73
|
+
export declare const MCP_TAG_TYPES: readonly ["MCPServers", "ConnectedServices", "MCPServerConnections", "MCPServerPreferences", "MCPServerCredentials"];
|
|
@@ -12,6 +12,8 @@ export interface GetMCPServersParams extends MCPBaseParams {
|
|
|
12
12
|
page?: number;
|
|
13
13
|
pageSize?: number;
|
|
14
14
|
search?: string;
|
|
15
|
+
/** Makes each server's `user_enabled` reflect that conversation's choices. */
|
|
16
|
+
sessionId?: string;
|
|
15
17
|
transport?: TransportEnum;
|
|
16
18
|
url?: string;
|
|
17
19
|
}
|
|
@@ -59,10 +61,63 @@ export interface MCPServer {
|
|
|
59
61
|
connected_service_summary?: Record<string, unknown> | null;
|
|
60
62
|
oauth_service_data?: OAuthServiceData | null;
|
|
61
63
|
mentor?: string | null;
|
|
64
|
+
is_featured?: boolean;
|
|
65
|
+
/** When false the server is never used, whatever the agent or user chose. */
|
|
66
|
+
is_enabled?: boolean;
|
|
67
|
+
/** When false the server is mandatory: users cannot turn it off. */
|
|
68
|
+
user_can_disable?: boolean;
|
|
69
|
+
/**
|
|
70
|
+
* Whether the server is on for the caller after their permanent and, when
|
|
71
|
+
* the list was requested with `sessionId`, per-conversation choices.
|
|
72
|
+
*/
|
|
73
|
+
user_enabled?: boolean;
|
|
74
|
+
/** The agent's override of `auth_scope`; present when listed with `mentorUniqueId`. */
|
|
75
|
+
mentor_auth_scope?: string | null;
|
|
76
|
+
/** The credential scope in force for that agent; present when listed with `mentorUniqueId`. */
|
|
77
|
+
effective_auth_scope?: string;
|
|
78
|
+
/**
|
|
79
|
+
* Set on a connector seeded from the MCP directory (`source: "registry"`): the
|
|
80
|
+
* organization cannot edit or delete it, only choose how it signs in per agent.
|
|
81
|
+
*/
|
|
82
|
+
registry?: MCPServerRegistry | null;
|
|
62
83
|
created_at: string;
|
|
63
84
|
updated_at?: string;
|
|
64
85
|
permissions?: MCPServerPermissions;
|
|
65
86
|
}
|
|
87
|
+
export interface MCPServerRegistry {
|
|
88
|
+
name: string;
|
|
89
|
+
version?: string;
|
|
90
|
+
namespace?: string;
|
|
91
|
+
source: 'registry' | string;
|
|
92
|
+
trust_tier?: string;
|
|
93
|
+
status?: string;
|
|
94
|
+
website_url?: string;
|
|
95
|
+
icon_url?: string;
|
|
96
|
+
transport_deprecated?: boolean;
|
|
97
|
+
auth_kind?: string;
|
|
98
|
+
supports_dcr?: boolean | null;
|
|
99
|
+
setup?: string;
|
|
100
|
+
declared_headers?: string[];
|
|
101
|
+
}
|
|
102
|
+
/** The credential scopes the API accepts; `platform` is the organization-wide one. */
|
|
103
|
+
export type MCPAuthScope = 'user' | 'mentor' | 'platform';
|
|
104
|
+
/** How a server signs in for one agent (guide §5.9). */
|
|
105
|
+
export interface MCPServerMentorAuthScope {
|
|
106
|
+
server: number;
|
|
107
|
+
mentor: string;
|
|
108
|
+
/** The agent's override; null means the server's own `auth_scope`. */
|
|
109
|
+
auth_scope: MCPAuthScope | null;
|
|
110
|
+
server_auth_scope: MCPAuthScope | string;
|
|
111
|
+
effective_auth_scope: MCPAuthScope | string;
|
|
112
|
+
}
|
|
113
|
+
export interface GetMCPServerMentorAuthScopeParams extends MCPServerParams {
|
|
114
|
+
/** Agent unique id (uuid). */
|
|
115
|
+
mentor: string;
|
|
116
|
+
}
|
|
117
|
+
export interface SetMCPServerMentorAuthScopeParams extends GetMCPServerMentorAuthScopeParams {
|
|
118
|
+
/** null restores the server's own scope. */
|
|
119
|
+
authScope: MCPAuthScope | null;
|
|
120
|
+
}
|
|
66
121
|
export interface PaginatedMCPServerList {
|
|
67
122
|
count: number;
|
|
68
123
|
next: string | null;
|
|
@@ -80,6 +135,9 @@ export interface MCPServerRequestBody {
|
|
|
80
135
|
extra_headers?: Record<string, string>;
|
|
81
136
|
oauth_service?: number | null;
|
|
82
137
|
mentor?: string | null;
|
|
138
|
+
/** False makes the server mandatory: users cannot turn it off. Default true. */
|
|
139
|
+
user_can_disable?: boolean;
|
|
140
|
+
is_enabled?: boolean;
|
|
83
141
|
}
|
|
84
142
|
export interface CreateMCPServerArgs extends MCPBaseParams {
|
|
85
143
|
body?: MCPServerRequestBody;
|
|
@@ -96,6 +154,33 @@ export interface PartialUpdateMCPServerArgs extends MCPServerParams {
|
|
|
96
154
|
export interface OAuthServiceParams {
|
|
97
155
|
org: string;
|
|
98
156
|
}
|
|
157
|
+
/** One sign-in service of a provider, as `GET /api/ai-account/orgs/{org}/oauth-services/` lists them. */
|
|
158
|
+
export interface OAuthServiceSummary {
|
|
159
|
+
id: number;
|
|
160
|
+
oauth_provider: string;
|
|
161
|
+
oauth_provider_id: number;
|
|
162
|
+
name: string;
|
|
163
|
+
display_name: string;
|
|
164
|
+
description?: string;
|
|
165
|
+
scope?: string;
|
|
166
|
+
image?: string | null;
|
|
167
|
+
created_at?: string;
|
|
168
|
+
updated_at?: string;
|
|
169
|
+
}
|
|
170
|
+
/** A sign-in provider the platform knows, with its services (`services[].id` is an MCP server's `oauth_service`). */
|
|
171
|
+
export interface OAuthProviderSummary {
|
|
172
|
+
id: number;
|
|
173
|
+
name: string;
|
|
174
|
+
description?: string;
|
|
175
|
+
url?: string;
|
|
176
|
+
image?: string | null;
|
|
177
|
+
auth_url?: string;
|
|
178
|
+
token_url?: string;
|
|
179
|
+
is_enabled?: boolean;
|
|
180
|
+
services: OAuthServiceSummary[];
|
|
181
|
+
created_at?: string;
|
|
182
|
+
updated_at?: string;
|
|
183
|
+
}
|
|
99
184
|
export interface ConnectedServicesParams extends MCPBaseParams {
|
|
100
185
|
}
|
|
101
186
|
export interface StartOAuthFlowParams extends MCPBaseParams {
|
|
@@ -160,7 +245,20 @@ export interface ConnectedService {
|
|
|
160
245
|
export interface OAuthFindParams extends MCPBaseParams {
|
|
161
246
|
url: string;
|
|
162
247
|
name?: string;
|
|
248
|
+
/** The redirect URI; required with `client_id`, as registered in the vendor's console. */
|
|
163
249
|
callback_url?: string;
|
|
250
|
+
/**
|
|
251
|
+
* The organization's own OAuth app, for when automatic registration fails
|
|
252
|
+
* (guide §5.4). Every field below is accepted only together with it.
|
|
253
|
+
*/
|
|
254
|
+
client_id?: string;
|
|
255
|
+
/** `""` for a public client. */
|
|
256
|
+
client_secret?: string;
|
|
257
|
+
/** Only for a server that publishes no sign-in settings; send both or neither. */
|
|
258
|
+
authorization_url?: string;
|
|
259
|
+
token_url?: string;
|
|
260
|
+
token_endpoint_auth_method?: MCPTokenEndpointAuthMethod;
|
|
261
|
+
scopes?: string[];
|
|
164
262
|
}
|
|
165
263
|
export interface OAuthFindResponse {
|
|
166
264
|
id: number;
|
|
@@ -174,3 +272,116 @@ export interface OAuthFindResponse {
|
|
|
174
272
|
created_at: string;
|
|
175
273
|
updated_at: string;
|
|
176
274
|
}
|
|
275
|
+
export interface MCPServerPreference {
|
|
276
|
+
server: number;
|
|
277
|
+
/** The stored choice; `null` when the user never chose. */
|
|
278
|
+
is_enabled: boolean | null;
|
|
279
|
+
user_can_disable: boolean;
|
|
280
|
+
/** Whether the server is used for this user. */
|
|
281
|
+
effective_is_enabled: boolean;
|
|
282
|
+
}
|
|
283
|
+
export interface SetMCPServerPreferenceParams extends MCPServerParams {
|
|
284
|
+
isEnabled: boolean;
|
|
285
|
+
}
|
|
286
|
+
export interface MCPServerSessionPreference {
|
|
287
|
+
server: number;
|
|
288
|
+
session_id: string;
|
|
289
|
+
/** The stored choice for this conversation; `null` when the user never chose. */
|
|
290
|
+
is_enabled: boolean | null;
|
|
291
|
+
/** The user's permanent choice. */
|
|
292
|
+
user_is_enabled: boolean | null;
|
|
293
|
+
user_can_disable: boolean;
|
|
294
|
+
/** Whether the server is used in this conversation. */
|
|
295
|
+
effective_is_enabled: boolean;
|
|
296
|
+
}
|
|
297
|
+
export interface GetMCPServerSessionPreferenceParams extends MCPServerParams {
|
|
298
|
+
sessionId: string;
|
|
299
|
+
}
|
|
300
|
+
export interface SetMCPServerSessionPreferenceParams extends MCPServerParams {
|
|
301
|
+
sessionId: string;
|
|
302
|
+
isEnabled: boolean;
|
|
303
|
+
}
|
|
304
|
+
export type MCPOAuthClientSource = 'dcr' | 'manual' | 'legacy_backfill';
|
|
305
|
+
export type MCPTokenEndpointAuthMethod = 'client_secret_post' | 'client_secret_basic' | 'none';
|
|
306
|
+
export interface MCPServerOAuthCredentials {
|
|
307
|
+
auth_type: 'oauth2';
|
|
308
|
+
configured: boolean;
|
|
309
|
+
/** Users can already sign in through a client shared by ibl.ai; one of your own is optional. */
|
|
310
|
+
shared_client_allowed: boolean;
|
|
311
|
+
source?: MCPOAuthClientSource;
|
|
312
|
+
client_id?: string;
|
|
313
|
+
/** Masked, e.g. "****89"; `""` for a public client. */
|
|
314
|
+
client_secret?: string | null;
|
|
315
|
+
redirect_uri?: string;
|
|
316
|
+
scopes?: string[];
|
|
317
|
+
token_endpoint_auth_method?: MCPTokenEndpointAuthMethod | string;
|
|
318
|
+
authorization_params?: Record<string, string>;
|
|
319
|
+
token_params?: Record<string, string>;
|
|
320
|
+
/** The organization's endpoint overrides; `""` when the discovered ones are used. */
|
|
321
|
+
authorization_url?: string;
|
|
322
|
+
token_url?: string;
|
|
323
|
+
client_secret_expires_at?: string | null;
|
|
324
|
+
updated_at?: string;
|
|
325
|
+
}
|
|
326
|
+
export interface MCPServerApiKeyCredentials {
|
|
327
|
+
auth_type: 'token';
|
|
328
|
+
configured: boolean;
|
|
329
|
+
/** Masked, e.g. "****9f". */
|
|
330
|
+
api_key?: string;
|
|
331
|
+
authorization_scheme?: string;
|
|
332
|
+
header_name?: string;
|
|
333
|
+
updated_at?: string;
|
|
334
|
+
}
|
|
335
|
+
export type MCPServerCredentials = MCPServerOAuthCredentials | MCPServerApiKeyCredentials;
|
|
336
|
+
export interface SetMCPServerOAuthCredentialsBody {
|
|
337
|
+
client_id: string;
|
|
338
|
+
/** Required on the first save; omit to keep the stored one, `""` for a public client. */
|
|
339
|
+
client_secret?: string;
|
|
340
|
+
redirect_uri: string;
|
|
341
|
+
scopes?: string[];
|
|
342
|
+
token_endpoint_auth_method?: MCPTokenEndpointAuthMethod;
|
|
343
|
+
authorization_params?: Record<string, string>;
|
|
344
|
+
token_params?: Record<string, string>;
|
|
345
|
+
/** Omit to keep the stored overrides; `""` goes back to the discovered endpoints. */
|
|
346
|
+
authorization_url?: string;
|
|
347
|
+
token_url?: string;
|
|
348
|
+
}
|
|
349
|
+
export interface SetMCPServerApiKeyCredentialsBody {
|
|
350
|
+
/** Required on the first save; omit to keep the stored one. */
|
|
351
|
+
api_key?: string;
|
|
352
|
+
authorization_scheme?: string;
|
|
353
|
+
/** Blank for `Authorization`. */
|
|
354
|
+
header_name?: string;
|
|
355
|
+
}
|
|
356
|
+
export interface SetMCPServerCredentialsParams extends MCPServerParams {
|
|
357
|
+
body: SetMCPServerOAuthCredentialsBody | SetMCPServerApiKeyCredentialsBody;
|
|
358
|
+
}
|
|
359
|
+
export interface OAuthFindDiagnosticAttempt {
|
|
360
|
+
step: string;
|
|
361
|
+
url: string | null;
|
|
362
|
+
status_code: number | null;
|
|
363
|
+
outcome: string;
|
|
364
|
+
detail: string;
|
|
365
|
+
}
|
|
366
|
+
export type OAuthFindFailedStep = 'mcp_server_url' | 'authorization_server_metadata' | 'client_registration' | 'provider_name_conflict' | 'tenant_client_configured'
|
|
367
|
+
/** The organization's own app was refused; `hint` says why. */
|
|
368
|
+
| 'manual_client' | 'internal_error';
|
|
369
|
+
export interface OAuthFindDiagnostic {
|
|
370
|
+
succeeded: boolean;
|
|
371
|
+
failed_step: OAuthFindFailedStep | string | null;
|
|
372
|
+
hint: string;
|
|
373
|
+
/** The check ran out of time; the backend then refuses an organization's own app. */
|
|
374
|
+
timed_out?: boolean;
|
|
375
|
+
discovered?: {
|
|
376
|
+
authorization_endpoint?: string;
|
|
377
|
+
token_endpoint?: string;
|
|
378
|
+
registration_endpoint?: string;
|
|
379
|
+
scopes_supported?: string[];
|
|
380
|
+
token_endpoint_auth_methods_supported?: string[];
|
|
381
|
+
};
|
|
382
|
+
attempts?: OAuthFindDiagnosticAttempt[];
|
|
383
|
+
}
|
|
384
|
+
export interface OAuthFindErrorBody {
|
|
385
|
+
error: string;
|
|
386
|
+
diagnostic?: OAuthFindDiagnostic;
|
|
387
|
+
}
|