@xpert-ai/xpert-sdk 0.0.15 → 0.0.16

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.
Files changed (46) hide show
  1. package/dist/client.d.ts +5 -0
  2. package/dist/client.js +22 -0
  3. package/dist/client.js.map +1 -1
  4. package/dist/client.mjs +22 -0
  5. package/dist/client.mjs.map +1 -1
  6. package/dist/index.d.ts +2 -0
  7. package/dist/index.js +1 -0
  8. package/dist/index.js.map +1 -1
  9. package/dist/index.mjs +1 -0
  10. package/dist/index.mjs.map +1 -1
  11. package/dist/mcp/apps.d.ts +11 -0
  12. package/dist/mcp/apps.js +49 -0
  13. package/dist/mcp/apps.js.map +1 -0
  14. package/dist/mcp/apps.mjs +49 -0
  15. package/dist/mcp/apps.mjs.map +1 -0
  16. package/dist/mcp/apps.test.d.ts +1 -0
  17. package/dist/mcp/apps.test.js +77 -0
  18. package/dist/mcp/apps.test.js.map +1 -0
  19. package/dist/mcp/apps.test.mjs +77 -0
  20. package/dist/mcp/apps.test.mjs.map +1 -0
  21. package/dist/mcp/index.d.ts +11 -0
  22. package/dist/mcp/index.js +13 -0
  23. package/dist/mcp/index.js.map +1 -0
  24. package/dist/mcp/index.mjs +13 -0
  25. package/dist/mcp/index.mjs.map +1 -0
  26. package/dist/mcp/publications.d.ts +27 -0
  27. package/dist/mcp/publications.js +101 -0
  28. package/dist/mcp/publications.js.map +1 -0
  29. package/dist/mcp/publications.mjs +101 -0
  30. package/dist/mcp/publications.mjs.map +1 -0
  31. package/dist/mcp/publications.test.d.ts +1 -0
  32. package/dist/mcp/publications.test.js +176 -0
  33. package/dist/mcp/publications.test.js.map +1 -0
  34. package/dist/mcp/publications.test.mjs +176 -0
  35. package/dist/mcp/publications.test.mjs.map +1 -0
  36. package/dist/mcp/transport.d.ts +10 -0
  37. package/dist/mcp/transport.js +2 -0
  38. package/dist/mcp/transport.js.map +1 -0
  39. package/dist/mcp/transport.mjs +2 -0
  40. package/dist/mcp/transport.mjs.map +1 -0
  41. package/dist/mcp/types.d.ts +326 -0
  42. package/dist/mcp/types.js +2 -0
  43. package/dist/mcp/types.js.map +1 -0
  44. package/dist/mcp/types.mjs +2 -0
  45. package/dist/mcp/types.mjs.map +1 -0
  46. package/package.json +1 -1
@@ -0,0 +1,326 @@
1
+ export type McpPublicationStatus = 'draft' | 'active' | 'disabled';
2
+ export type McpPublicationReviewStatus = 'current' | 'required';
3
+ export type McpAuthMethod = 'api_key' | 'oauth';
4
+ export type McpCapabilityType = 'tool' | 'resource' | 'resource_template' | 'prompt' | 'app';
5
+ export type McpCapabilityApprovalMode = 'deny' | 'allow' | 'confirm';
6
+ export type McpApiKeySubjectType = 'user' | 'service_account';
7
+ export type McpToolRisk = 'read' | 'write' | 'dangerous';
8
+ export type McpToolSideEffect = 'none' | 'reversible' | 'irreversible';
9
+ export type McpToolIdempotency = 'safe' | 'idempotent' | 'non_idempotent';
10
+ export type McpRequiredContext = 'tenant' | 'organization' | 'workspace' | 'principal' | 'project' | 'conversation' | 'agent' | 'execution' | 'store' | 'checkpoint';
11
+ export type McpCapabilityVisibility = 'model' | 'app';
12
+ export type McpJsonValue = null | boolean | number | string | McpJsonValue[] | {
13
+ [key: string]: McpJsonValue;
14
+ };
15
+ export type McpJsonSchema = {
16
+ [keyword: string]: McpJsonValue;
17
+ };
18
+ export interface McpCapabilityPolicy {
19
+ approvalMode?: McpCapabilityApprovalMode;
20
+ timeoutMs?: number;
21
+ rateLimit?: {
22
+ requests: number;
23
+ windowSeconds: number;
24
+ };
25
+ }
26
+ export interface McpCapabilitySource {
27
+ toolsetId: string;
28
+ pluginName?: string;
29
+ pluginVersion?: string;
30
+ serverName?: string;
31
+ remoteName?: string;
32
+ }
33
+ export interface McpCapabilityDescriptorBase {
34
+ descriptorVersion: 1;
35
+ capabilityType: McpCapabilityType;
36
+ capabilityKey: string;
37
+ title?: string;
38
+ description?: string;
39
+ providerInstructions?: string;
40
+ source: McpCapabilitySource;
41
+ requiredContext: McpRequiredContext[];
42
+ visibility: McpCapabilityVisibility[];
43
+ }
44
+ export interface McpToolCapabilityDescriptor extends McpCapabilityDescriptorBase {
45
+ capabilityType: 'tool';
46
+ inputSchema: McpJsonSchema;
47
+ outputSchema?: McpJsonSchema;
48
+ behavior: {
49
+ risk: McpToolRisk;
50
+ sideEffect: McpToolSideEffect;
51
+ idempotency: McpToolIdempotency;
52
+ };
53
+ annotations?: {
54
+ title?: string;
55
+ readOnlyHint?: boolean;
56
+ destructiveHint?: boolean;
57
+ idempotentHint?: boolean;
58
+ openWorldHint?: boolean;
59
+ };
60
+ appResourceKey?: string;
61
+ taskMode?: 'optional' | 'required';
62
+ taskMaxLifetimeMs?: number;
63
+ }
64
+ export interface McpResourceCapabilityDescriptor extends McpCapabilityDescriptorBase {
65
+ capabilityType: 'resource';
66
+ uri: string;
67
+ mimeType?: string;
68
+ cacheTtlMs?: number;
69
+ }
70
+ export interface McpResourceTemplateCapabilityDescriptor extends McpCapabilityDescriptorBase {
71
+ capabilityType: 'resource_template';
72
+ uriTemplate: string;
73
+ mimeType?: string;
74
+ argumentSchema: McpJsonSchema;
75
+ supportsCompletion: boolean;
76
+ cacheTtlMs?: number;
77
+ }
78
+ export interface McpPromptCapabilityDescriptor extends McpCapabilityDescriptorBase {
79
+ capabilityType: 'prompt';
80
+ name: string;
81
+ argumentSchema: McpJsonSchema;
82
+ supportsCompletion?: boolean;
83
+ }
84
+ export interface McpAppCapabilityDescriptor extends McpCapabilityDescriptorBase {
85
+ capabilityType: 'app';
86
+ entry: string;
87
+ csp?: {
88
+ connectDomains?: string[];
89
+ resourceDomains?: string[];
90
+ };
91
+ permissions?: {
92
+ clipboardWrite?: boolean;
93
+ camera?: boolean;
94
+ microphone?: boolean;
95
+ geolocation?: boolean;
96
+ };
97
+ }
98
+ export type McpCapabilityDescriptor = McpToolCapabilityDescriptor | McpResourceCapabilityDescriptor | McpResourceTemplateCapabilityDescriptor | McpPromptCapabilityDescriptor | McpAppCapabilityDescriptor;
99
+ export interface McpTenantOrganizationScope {
100
+ tenantId?: string;
101
+ organizationId?: string;
102
+ }
103
+ export interface McpPublicationCapability extends McpTenantOrganizationScope {
104
+ id: string;
105
+ publicationId: string;
106
+ toolsetId: string;
107
+ capabilityType: McpCapabilityType;
108
+ capabilityKey: string;
109
+ publicName: string;
110
+ enabled: boolean;
111
+ policy?: McpCapabilityPolicy | null;
112
+ descriptorHash: string;
113
+ descriptorSnapshot: McpCapabilityDescriptor;
114
+ pluginVersion?: string | null;
115
+ }
116
+ export interface McpPublication extends McpTenantOrganizationScope {
117
+ id: string;
118
+ name: string;
119
+ slug: string;
120
+ status: McpPublicationStatus;
121
+ authMethods: McpAuthMethod[];
122
+ instructions?: string | null;
123
+ protocolVersion: '2026-07-28';
124
+ reviewStatus: McpPublicationReviewStatus;
125
+ reviewReason?: string | null;
126
+ reviewedAt?: string | null;
127
+ reviewedById?: string | null;
128
+ capabilities?: McpPublicationCapability[];
129
+ createdAt?: string;
130
+ updatedAt?: string;
131
+ }
132
+ export interface McpPublicationSummary extends McpPublication {
133
+ capabilityCount: number;
134
+ apiKeyCount: number;
135
+ oauthEnabled: boolean;
136
+ recentInvocationAt?: string | null;
137
+ recentErrorAt?: string | null;
138
+ }
139
+ export interface McpCapabilityCatalogItem extends McpTenantOrganizationScope {
140
+ id: string;
141
+ toolsetId: string;
142
+ capabilityType: McpCapabilityType;
143
+ capabilityKey: string;
144
+ descriptorHash: string;
145
+ descriptor: McpCapabilityDescriptor;
146
+ enabled: boolean;
147
+ }
148
+ export interface CreateMcpPublicationInput {
149
+ name: string;
150
+ slug: string;
151
+ authMethods?: McpAuthMethod[];
152
+ instructions?: string | null;
153
+ }
154
+ export interface UpdateMcpPublicationInput {
155
+ name?: string;
156
+ slug?: string;
157
+ authMethods?: McpAuthMethod[];
158
+ instructions?: string | null;
159
+ status?: McpPublicationStatus;
160
+ }
161
+ export interface McpCapabilityBindingInput {
162
+ toolsetId: string;
163
+ capabilityType: McpCapabilityType;
164
+ capabilityKey: string;
165
+ publicName: string;
166
+ enabled?: boolean;
167
+ policy?: McpCapabilityPolicy | null;
168
+ }
169
+ export interface PatchMcpCapabilityBindingInput {
170
+ publicName?: string;
171
+ enabled?: boolean;
172
+ policy?: McpCapabilityPolicy | null;
173
+ }
174
+ export interface McpApiKey extends McpTenantOrganizationScope {
175
+ id: string;
176
+ publicationId: string;
177
+ name: string;
178
+ keyPrefix: string;
179
+ subjectType: McpApiKeySubjectType;
180
+ subjectId: string;
181
+ scopes: string[];
182
+ expiresAt?: string | null;
183
+ lastUsedAt?: string | null;
184
+ revokedAt?: string | null;
185
+ revokedById?: string | null;
186
+ createdAt?: string;
187
+ }
188
+ export interface CreateMcpApiKeyInput {
189
+ name: string;
190
+ subjectType?: McpApiKeySubjectType;
191
+ subjectId?: string;
192
+ scopes?: string[];
193
+ expiresAt?: string | Date | null;
194
+ }
195
+ export interface McpApiKeySecret {
196
+ apiKey: McpApiKey;
197
+ secret: string;
198
+ }
199
+ export interface McpOAuthSubjectMapping {
200
+ subjectClaim: string;
201
+ emailClaim?: string;
202
+ clientIdClaim?: string;
203
+ }
204
+ export interface McpOAuthPolicy extends McpTenantOrganizationScope {
205
+ id: string;
206
+ publicationId: string;
207
+ issuer: string;
208
+ audience: string;
209
+ requiredScopes: string[];
210
+ subjectMapping: McpOAuthSubjectMapping;
211
+ introspectionEnabled: boolean;
212
+ introspectionEndpoint?: string | null;
213
+ introspectionClientId?: string | null;
214
+ introspectionClientSecretConfigured: boolean;
215
+ enabled: boolean;
216
+ }
217
+ export interface UpsertMcpOAuthPolicyInput {
218
+ issuer: string;
219
+ audience: string;
220
+ requiredScopes?: string[];
221
+ subjectMapping?: McpOAuthSubjectMapping;
222
+ introspection?: {
223
+ enabled: boolean;
224
+ endpoint?: string | null;
225
+ clientId?: string | null;
226
+ clientSecret?: string | null;
227
+ };
228
+ enabled?: boolean;
229
+ }
230
+ export interface McpOAuthPolicyTestResult {
231
+ issuer: string;
232
+ authorizationEndpoint?: string;
233
+ tokenEndpoint?: string;
234
+ introspectionEndpoint?: string;
235
+ introspectionEnabled: boolean;
236
+ introspectionClientSecretConfigured: boolean;
237
+ jwksUri: string;
238
+ scopesSupported: string[];
239
+ }
240
+ export interface McpInvocationAudit extends McpTenantOrganizationScope {
241
+ id: string;
242
+ publicationId: string;
243
+ capabilityId?: string | null;
244
+ toolsetId?: string | null;
245
+ capabilityKey?: string | null;
246
+ publicName?: string | null;
247
+ authMethod: McpAuthMethod;
248
+ subjectType: McpApiKeySubjectType;
249
+ subjectId: string;
250
+ clientName?: string | null;
251
+ requestId: string;
252
+ traceId?: string | null;
253
+ status: 'started' | 'succeeded' | 'failed' | 'denied';
254
+ durationMs?: number | null;
255
+ errorCode?: string | null;
256
+ argumentSummary?: McpJsonValue | null;
257
+ createdAt?: string;
258
+ }
259
+ export interface McpPagination<T> {
260
+ readonly items: T[];
261
+ readonly total: number;
262
+ }
263
+ export interface McpAuditRequestOptions extends McpRequestOptions {
264
+ skip?: number;
265
+ take?: number;
266
+ }
267
+ export interface McpPublicationTestCheck {
268
+ key: string;
269
+ status: 'passed' | 'failed' | 'warning';
270
+ message: string;
271
+ }
272
+ export interface McpPublicationTestResult {
273
+ ready: boolean;
274
+ protocolVersion: '2026-07-28';
275
+ status: McpPublicationStatus;
276
+ reviewStatus: McpPublicationReviewStatus;
277
+ enabledCapabilityCount: number;
278
+ capabilityCounts: Partial<Record<McpCapabilityType, number>>;
279
+ checks: McpPublicationTestCheck[];
280
+ }
281
+ export interface McpConnectionInfo {
282
+ protocolVersion: '2026-07-28';
283
+ transport: 'streamable-http';
284
+ endpoint: string;
285
+ authorization: 'Bearer';
286
+ serverInstructions?: string | null;
287
+ }
288
+ export interface McpAppReviveQuery {
289
+ toolsetId?: string;
290
+ serverName?: string;
291
+ toolName?: string;
292
+ toolCallId?: string;
293
+ resourceUri?: string;
294
+ title?: string;
295
+ token?: string;
296
+ messageId?: string;
297
+ }
298
+ export interface McpAppResourceResponse {
299
+ uri?: string;
300
+ mimeType?: string;
301
+ text?: string;
302
+ blob?: string;
303
+ appInstanceToken?: string;
304
+ resourceUri?: string;
305
+ title?: unknown;
306
+ description?: unknown;
307
+ icon?: unknown;
308
+ csp?: unknown;
309
+ permissions?: unknown;
310
+ domain?: string;
311
+ prefersBorder?: boolean;
312
+ toolInfo?: unknown;
313
+ toolInput?: unknown;
314
+ toolResult?: unknown;
315
+ }
316
+ export interface McpAppApprovalResult {
317
+ approved: boolean;
318
+ rejected?: boolean;
319
+ approvalId: string;
320
+ expiresAt?: number;
321
+ toolName: string;
322
+ risk: 'write' | 'destructive';
323
+ }
324
+ export interface McpRequestOptions {
325
+ signal?: AbortSignal;
326
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.mjs","sourceRoot":"","sources":["../../src/mcp/types.ts"],"names":[],"mappings":""}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpert-ai/xpert-sdk",
3
- "version": "0.0.15",
3
+ "version": "0.0.16",
4
4
  "description": "SDK Core functionality package",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",