lumnisai 0.1.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.
@@ -0,0 +1,1065 @@
1
+ interface PaginationParams {
2
+ page?: number;
3
+ pageSize?: number;
4
+ limit?: number;
5
+ offset?: number;
6
+ skip?: number;
7
+ }
8
+ interface PaginationInfo {
9
+ page: number;
10
+ pageSize: number;
11
+ total: number;
12
+ totalPages: number;
13
+ hasNext: boolean;
14
+ hasPrev: boolean;
15
+ }
16
+ interface ErrorResponse {
17
+ error: {
18
+ code: string;
19
+ message: string;
20
+ details?: Record<string, any>;
21
+ };
22
+ }
23
+ interface Message {
24
+ role: 'system' | 'user' | 'assistant';
25
+ content: string;
26
+ }
27
+ type Scope = 'user' | 'tenant';
28
+ type UUID = string;
29
+ type Email = string;
30
+ type UserIdentifier = UUID | Email;
31
+ interface BaseResource {
32
+ createdAt: string;
33
+ updatedAt?: string;
34
+ }
35
+
36
+ type Plan = 'shared';
37
+ type DatabaseStatus = 'provisioning' | 'active' | 'suspended' | 'failed';
38
+ type BillingStatus = 'trial' | 'active' | 'past_due' | 'canceled';
39
+ type ApiKeyMode = 'platform' | 'byo_keys';
40
+ interface TenantDetailsResponse {
41
+ id: UUID;
42
+ name: string;
43
+ developerId: UUID;
44
+ developerEmail: string;
45
+ plan: Plan;
46
+ dbStatus: DatabaseStatus;
47
+ billingStatus: BillingStatus;
48
+ apiKeyMode: ApiKeyMode;
49
+ createdAt: string;
50
+ updatedAt: string;
51
+ }
52
+
53
+ type ApiProvider = 'OPENAI_API_KEY' | 'ANTHROPIC_API_KEY' | 'EXA_API_KEY' | 'COHERE_API_KEY' | 'GOOGLE_API_KEY' | 'SERPAPI_API_KEY' | 'GROQ_API_KEY' | 'NVIDIA_API_KEY' | 'FIREWORKS_API_KEY' | 'MISTRAL_API_KEY' | 'TOGETHER_API_KEY' | 'XAI_API_KEY' | 'PPLX_API_KEY' | 'HUGGINGFACE_API_KEY' | 'DEEPSEEK_API_KEY' | 'IBM_API_KEY' | 'E2B_API_KEY';
54
+ interface StoreApiKeyRequest {
55
+ provider: ApiProvider;
56
+ apiKey: string;
57
+ }
58
+ interface ExternalApiKeyResponse {
59
+ keyId: string;
60
+ provider: string;
61
+ isActive: boolean;
62
+ createdAt?: string | null;
63
+ updatedAt?: string | null;
64
+ createdBy?: string | null;
65
+ }
66
+ interface ApiKeyModeResponse {
67
+ apiKeyMode: ApiKeyMode;
68
+ }
69
+ interface ApiKeyModeRequest {
70
+ mode: ApiKeyMode;
71
+ }
72
+ interface DeleteApiKeyResponse {
73
+ message: string;
74
+ }
75
+
76
+ type ConnectionStatus = 'pending' | 'active' | 'failed' | 'expired' | 'not_connected';
77
+ interface InitiateConnectionRequest {
78
+ userId: string;
79
+ appName: string;
80
+ redirectUrl?: string;
81
+ authMode?: string;
82
+ connectionParams?: Record<string, any>;
83
+ }
84
+ interface InitiateConnectionResponse {
85
+ redirectUrl?: string | null;
86
+ status: string;
87
+ message?: string | null;
88
+ }
89
+ interface ConnectionStatusResponse {
90
+ appName: string;
91
+ status: ConnectionStatus;
92
+ connectedAt?: string | null;
93
+ errorMessage?: string | null;
94
+ }
95
+ interface ConnectionInfo {
96
+ appName: string;
97
+ status: ConnectionStatus;
98
+ connectedAt?: string | null;
99
+ errorMessage?: string | null;
100
+ }
101
+ interface UserConnectionsResponse {
102
+ userId: string;
103
+ connections: ConnectionInfo[];
104
+ }
105
+ interface GetToolsRequest {
106
+ userId: string;
107
+ appFilter?: string[];
108
+ }
109
+ interface ToolInfo {
110
+ name: string;
111
+ description: string;
112
+ appName: string;
113
+ parameters?: Record<string, any> | null;
114
+ }
115
+ interface GetToolsResponse {
116
+ userId: string;
117
+ tools: ToolInfo[];
118
+ toolCount: number;
119
+ }
120
+ interface DisconnectRequest {
121
+ userId: string;
122
+ appName: string;
123
+ }
124
+ interface DisconnectResponse {
125
+ success: boolean;
126
+ message: string;
127
+ }
128
+ interface ConnectionCallbackRequest {
129
+ connectionId: string;
130
+ code?: string;
131
+ state?: string;
132
+ error?: string;
133
+ }
134
+ interface ConnectionCallbackResponse {
135
+ success: boolean;
136
+ status: string;
137
+ message: string;
138
+ }
139
+ interface AppsListResponse {
140
+ enabledApps: string[];
141
+ totalEnabled: number;
142
+ availableApps?: string[];
143
+ totalAvailable?: number;
144
+ }
145
+ interface AppEnabledResponse {
146
+ appName: string;
147
+ enabled: boolean;
148
+ message: string;
149
+ }
150
+ interface UpdateAppStatusResponse {
151
+ appName: string;
152
+ enabled: boolean;
153
+ message: string;
154
+ updatedAt: string;
155
+ }
156
+
157
+ type MCPTransport = 'stdio' | 'streamable_http' | 'sse';
158
+ type MCPScope = 'tenant' | 'user';
159
+ interface MCPServerCreateRequest {
160
+ name: string;
161
+ description?: string;
162
+ transport: MCPTransport;
163
+ scope: MCPScope;
164
+ userIdentifier?: string;
165
+ command?: string;
166
+ args?: string[];
167
+ url?: string;
168
+ env?: Record<string, string>;
169
+ headers?: Record<string, string>;
170
+ }
171
+ interface MCPServerResponse {
172
+ id: UUID;
173
+ tenantId: UUID;
174
+ userId?: UUID | null;
175
+ scope: MCPScope;
176
+ name: string;
177
+ description?: string | null;
178
+ transport: MCPTransport;
179
+ command?: string | null;
180
+ args?: string[] | null;
181
+ url?: string | null;
182
+ isActive: boolean;
183
+ createdAt: string;
184
+ updatedAt: string;
185
+ }
186
+ interface MCPServerUpdateRequest {
187
+ name?: string;
188
+ description?: string;
189
+ url?: string;
190
+ env?: Record<string, string>;
191
+ headers?: Record<string, string>;
192
+ isActive?: boolean;
193
+ }
194
+ interface MCPServerListResponse {
195
+ servers: MCPServerResponse[];
196
+ total: number;
197
+ skip: number;
198
+ limit: number;
199
+ }
200
+ interface MCPToolResponse {
201
+ name: string;
202
+ description: string;
203
+ inputSchema?: Record<string, any> | null;
204
+ }
205
+ interface MCPToolListResponse {
206
+ serverId: UUID;
207
+ serverName: string;
208
+ tools: MCPToolResponse[];
209
+ total: number;
210
+ }
211
+ interface TestConnectionResponse {
212
+ success: boolean;
213
+ message: string;
214
+ toolCount?: number | null;
215
+ errorDetails?: string | null;
216
+ }
217
+
218
+ type ModelType = 'CHEAP_MODEL' | 'FAST_MODEL' | 'SMART_MODEL' | 'REASONING_MODEL' | 'VISION_MODEL';
219
+ type ModelProvider = 'openai' | 'anthropic' | 'azure_openai' | 'azure_ai' | 'google_vertexai' | 'google_genai' | 'google_anthropic_vertex' | 'bedrock' | 'bedrock_converse' | 'cohere' | 'fireworks' | 'together' | 'mistralai' | 'huggingface' | 'groq' | 'ollama' | 'deepseek' | 'ibm' | 'nvidia' | 'xai' | 'perplexity';
220
+ interface TenantModelPreference {
221
+ tenantId: string;
222
+ modelType: ModelType;
223
+ provider: ModelProvider;
224
+ modelName: string;
225
+ isActive: boolean;
226
+ createdAt: string;
227
+ updatedAt: string;
228
+ }
229
+ interface TenantModelPreferencesResponse {
230
+ tenantId: string;
231
+ preferences: TenantModelPreference[];
232
+ defaultsApplied: ModelType[];
233
+ }
234
+ interface ModelPreferenceCreate {
235
+ modelType: ModelType;
236
+ provider: ModelProvider;
237
+ modelName: string;
238
+ }
239
+ interface ModelPreferencesBulkUpdate {
240
+ preferences: Record<ModelType, {
241
+ provider: ModelProvider;
242
+ modelName: string;
243
+ }>;
244
+ }
245
+ interface ModelAvailability {
246
+ modelType: ModelType;
247
+ provider: ModelProvider;
248
+ modelName: string;
249
+ isAvailable: boolean;
250
+ reason?: string | null;
251
+ requiresApiKey: boolean;
252
+ }
253
+
254
+ type ResponseStatus = 'queued' | 'in_progress' | 'succeeded' | 'failed' | 'cancelled';
255
+ type AgentEffort = 'low' | 'medium' | 'high';
256
+ interface FileAttachment {
257
+ name: string;
258
+ uri: string;
259
+ mimeType?: string | null;
260
+ sizeBytes?: number | null;
261
+ }
262
+ interface AgentConfig {
263
+ planStrategy?: 'llm_io' | string;
264
+ plannerModelType?: 'SMART_MODEL' | 'REASONING_MODEL' | string;
265
+ coordinatorModelType?: 'SMART_MODEL' | 'REASONING_MODEL' | string;
266
+ orchestratorModelType?: 'SMART_MODEL' | 'REASONING_MODEL' | string | null;
267
+ plannerModelName?: string | null;
268
+ coordinatorModelName?: string | null;
269
+ orchestratorModelName?: string | null;
270
+ finalResponseModelName?: string | null;
271
+ fastModelName?: string | null;
272
+ useCognitiveTools?: boolean;
273
+ enableTaskValidation?: boolean;
274
+ generateComprehensiveOutput?: boolean;
275
+ }
276
+ interface ModelOverrides {
277
+ [key: string]: string;
278
+ }
279
+ interface CreateResponseRequest {
280
+ threadId?: UUID;
281
+ messages: Message[];
282
+ agentEffort?: AgentEffort;
283
+ costCapUsd?: number;
284
+ files?: FileAttachment[];
285
+ options?: Record<string, any>;
286
+ priority?: number;
287
+ userId?: string;
288
+ agentConfig?: AgentConfig;
289
+ responseFormat?: Record<string, any>;
290
+ responseFormatInstructions?: string;
291
+ modelOverrides?: ModelOverrides;
292
+ }
293
+ interface ProgressEntry {
294
+ ts: string;
295
+ state: string;
296
+ message: string;
297
+ toolCalls?: Array<Record<string, any>> | null;
298
+ outputText?: string | null;
299
+ }
300
+ interface ResponseArtifact {
301
+ type: string;
302
+ language?: string;
303
+ content: string;
304
+ [key: string]: any;
305
+ }
306
+ interface ResponseObject {
307
+ responseId: UUID;
308
+ threadId: UUID;
309
+ tenantId: UUID;
310
+ userId?: UUID | null;
311
+ status: ResponseStatus;
312
+ progress: ProgressEntry[];
313
+ inputMessages: Message[];
314
+ outputText?: string | null;
315
+ content?: string | null;
316
+ structuredResponse?: Record<string, any> | null;
317
+ artifacts?: ResponseArtifact[] | null;
318
+ createdAt: string;
319
+ completedAt?: string | null;
320
+ error?: Record<string, any> | null;
321
+ options?: Record<string, any> | null;
322
+ }
323
+ interface CreateResponseResponse {
324
+ responseId: UUID;
325
+ threadId: UUID;
326
+ status: ResponseStatus;
327
+ tenantId: UUID;
328
+ createdAt: string;
329
+ }
330
+ interface CancelResponseResponse {
331
+ status: string;
332
+ message: string;
333
+ }
334
+ interface ArtifactObject {
335
+ artifactId: UUID;
336
+ responseId: UUID;
337
+ name: string;
338
+ uri: string;
339
+ mimeType: string;
340
+ bytes: number;
341
+ createdAt: string;
342
+ }
343
+ interface ArtifactsListResponse {
344
+ artifacts: ArtifactObject[];
345
+ total: number;
346
+ limit: number;
347
+ offset: number;
348
+ }
349
+ interface ResponseListResponse {
350
+ responses: ResponseObject[];
351
+ total: number;
352
+ limit: number;
353
+ offset: number;
354
+ }
355
+
356
+ interface ThreadObject {
357
+ threadId: UUID;
358
+ tenantId: UUID;
359
+ userId?: UUID | null;
360
+ title?: string | null;
361
+ createdAt: string;
362
+ updatedAt?: string | null;
363
+ responseCount: number;
364
+ lastResponseAt?: string | null;
365
+ }
366
+ interface ThreadListResponse {
367
+ threads: ThreadObject[];
368
+ total: number;
369
+ limit: number;
370
+ offset: number;
371
+ }
372
+ interface UpdateThreadRequest {
373
+ title?: string | null;
374
+ }
375
+ interface CreateThreadRequest {
376
+ userId?: string | null;
377
+ title?: string | null;
378
+ }
379
+ interface ThreadResponsesParams {
380
+ limit?: number;
381
+ offset?: number;
382
+ }
383
+
384
+ interface UserResponse {
385
+ id: UUID;
386
+ email: string;
387
+ tenantId: UUID;
388
+ firstName?: string | null;
389
+ lastName?: string | null;
390
+ createdAt: string;
391
+ updatedAt: string;
392
+ }
393
+ interface UserCreateRequest {
394
+ email: string;
395
+ firstName?: string;
396
+ lastName?: string;
397
+ }
398
+ interface UserUpdateRequest {
399
+ firstName?: string;
400
+ lastName?: string;
401
+ }
402
+ interface UserListResponse {
403
+ users: UserResponse[];
404
+ pagination: PaginationInfo;
405
+ }
406
+ interface UserDeleteResponse {
407
+ message: string;
408
+ }
409
+
410
+ interface HttpOptions {
411
+ baseUrl: string;
412
+ apiPrefix?: string;
413
+ headers?: Record<string, string>;
414
+ timeoutMs?: number;
415
+ maxRetries?: number;
416
+ backoffFactor?: number;
417
+ }
418
+ interface RequestOptions extends Omit<RequestInit, 'body'> {
419
+ body?: unknown;
420
+ idempotencyKey?: string;
421
+ params?: Record<string, any>;
422
+ }
423
+ declare class Http {
424
+ private readonly options;
425
+ constructor(options: HttpOptions);
426
+ private _handleResponse;
427
+ request<T = unknown>(path: string, init?: RequestOptions): Promise<T>;
428
+ get<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
429
+ post<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
430
+ put<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
431
+ patch<T = unknown>(path: string, body?: unknown, options?: RequestOptions): Promise<T>;
432
+ delete<T = unknown>(path: string, options?: RequestOptions): Promise<T>;
433
+ warnTenantScope(): Promise<void>;
434
+ }
435
+
436
+ declare class ExternalAPIKeysResource {
437
+ private readonly http;
438
+ constructor(http: Http);
439
+ /**
440
+ * Store a new external API key (encrypted)
441
+ */
442
+ store(data: StoreApiKeyRequest): Promise<ExternalApiKeyResponse>;
443
+ /**
444
+ * Create a new external API key (alias for store)
445
+ */
446
+ create(data: StoreApiKeyRequest): Promise<ExternalApiKeyResponse>;
447
+ /**
448
+ * List all configured external API keys (metadata only, no key values)
449
+ */
450
+ list(): Promise<ExternalApiKeyResponse[]>;
451
+ /**
452
+ * Get details for a specific external API key (no key value)
453
+ */
454
+ get(keyId: string): Promise<ExternalApiKeyResponse>;
455
+ /**
456
+ * Delete an external API key for a specific provider
457
+ */
458
+ delete(provider: ApiProvider): Promise<DeleteApiKeyResponse>;
459
+ /**
460
+ * Get the current API key mode
461
+ */
462
+ getMode(): Promise<ApiKeyModeResponse>;
463
+ /**
464
+ * Update the API key mode
465
+ */
466
+ updateMode(data: ApiKeyModeRequest): Promise<ApiKeyModeResponse>;
467
+ /**
468
+ * Set the API key mode (alias for updateMode)
469
+ */
470
+ setMode(data: ApiKeyModeRequest): Promise<ApiKeyModeResponse>;
471
+ }
472
+
473
+ type ProcessingStatus = 'pending' | 'parsing' | 'embedding' | 'completed' | 'partial_success' | 'error';
474
+ type FileScope = 'user' | 'tenant';
475
+ type ContentType = 'text' | 'transcript' | 'summary' | 'structured';
476
+ type DuplicateHandling = 'error' | 'skip' | 'replace' | 'suffix';
477
+ type ChunkingStrategy = 'sentence' | 'paragraph' | 'code' | 'markdown' | 'table';
478
+ interface FileMetadata {
479
+ id: UUID;
480
+ tenantId: UUID;
481
+ userId?: UUID | null;
482
+ fileName: string;
483
+ originalFileName: string;
484
+ fileType: string;
485
+ mimeType: string;
486
+ fileSize: number;
487
+ fileScope: FileScope;
488
+ tags?: string[] | null;
489
+ blobUrl?: string | null;
490
+ processingStatus: ProcessingStatus;
491
+ errorMessage?: string | null;
492
+ totalChunks: number;
493
+ chunksEmbedded: number;
494
+ createdAt: string;
495
+ updatedAt: string;
496
+ deletedAt?: string | null;
497
+ }
498
+ interface FileUploadResponse {
499
+ fileId: UUID;
500
+ fileName: string;
501
+ status: ProcessingStatus;
502
+ message: string;
503
+ }
504
+ interface FileContentResponse {
505
+ fileId: UUID;
506
+ contentType: ContentType;
507
+ text: string;
508
+ metadata?: Record<string, any> | null;
509
+ startLine?: number | null;
510
+ endLine?: number | null;
511
+ totalLines?: number | null;
512
+ }
513
+ interface FileChunk {
514
+ id: UUID;
515
+ chunkIndex: number;
516
+ chunkText: string;
517
+ startLine?: number | null;
518
+ endLine?: number | null;
519
+ tokenCount?: number | null;
520
+ metadata?: Record<string, any> | null;
521
+ similarityScore?: number | null;
522
+ }
523
+ interface FileSearchResult {
524
+ file: FileMetadata;
525
+ chunks: FileChunk[];
526
+ overallScore: number;
527
+ }
528
+ interface FileSearchRequest {
529
+ query: string;
530
+ limit?: number;
531
+ minScore?: number;
532
+ fileTypes?: string[];
533
+ tags?: string[];
534
+ userId?: string;
535
+ }
536
+ interface FileSearchResponse {
537
+ results: FileSearchResult[];
538
+ totalCount: number;
539
+ query: string;
540
+ processingTimeMs?: number | null;
541
+ }
542
+ interface ProcessingStatusResponse {
543
+ status: ProcessingStatus;
544
+ progressPercentage: number;
545
+ chunksEmbedded: number;
546
+ totalChunks: number;
547
+ estimatedTimeRemainingSeconds?: number | null;
548
+ errorMessage?: string | null;
549
+ jobs?: Array<Record<string, any>> | null;
550
+ }
551
+ interface FileListResponse {
552
+ files: FileMetadata[];
553
+ totalCount: number;
554
+ page: number;
555
+ limit: number;
556
+ hasMore: boolean;
557
+ }
558
+ interface BulkDeleteRequest {
559
+ fileIds: UUID[];
560
+ }
561
+ interface BulkDeleteResponse {
562
+ deleted: UUID[];
563
+ failed: UUID[];
564
+ hardDelete: boolean;
565
+ totalRequested: number;
566
+ }
567
+ interface FileScopeUpdateRequest {
568
+ scope: FileScope;
569
+ userId?: UUID;
570
+ }
571
+ interface FileStatisticsResponse {
572
+ totalFiles: number;
573
+ totalSizeBytes: number;
574
+ filesByType: Record<string, number>;
575
+ filesByStatus: Record<ProcessingStatus, number>;
576
+ filesByScope: Record<FileScope, number>;
577
+ averageFileSizeBytes: number;
578
+ averageProcessingTimeSeconds?: number | null;
579
+ storageUsagePercentage?: number | null;
580
+ }
581
+ interface BulkUploadResponse {
582
+ uploaded: FileUploadResponse[];
583
+ failed: Array<{
584
+ filename: string;
585
+ error: string;
586
+ }>;
587
+ totalUploaded: number;
588
+ totalFailed: number;
589
+ }
590
+
591
+ declare class FilesResource {
592
+ private readonly http;
593
+ constructor(http: Http);
594
+ /**
595
+ * Upload a new file for processing
596
+ * @param file - The file to upload (File or Blob)
597
+ * @param options - Upload options
598
+ * @param options.scope - File access scope (user or tenant)
599
+ * @param options.userId - User ID or email (required for user-scoped files)
600
+ * @param options.tags - Comma-separated tags for categorization
601
+ * @param options.duplicateHandling - How to handle duplicate filenames
602
+ */
603
+ upload(file: File | Blob, options: {
604
+ scope: FileScope;
605
+ userId?: string;
606
+ tags?: string;
607
+ duplicateHandling?: 'error' | 'skip' | 'replace' | 'suffix';
608
+ }): Promise<FileUploadResponse>;
609
+ /**
610
+ * Upload multiple files at once
611
+ */
612
+ bulkUpload(files: Array<File | Blob>, options: {
613
+ scope: FileScope;
614
+ userId?: string;
615
+ tags?: string;
616
+ }): Promise<BulkUploadResponse>;
617
+ /**
618
+ * Get file metadata by ID
619
+ */
620
+ get(fileId: string, userId?: string): Promise<FileMetadata>;
621
+ /**
622
+ * List files with optional filters
623
+ */
624
+ list(params?: {
625
+ userId?: string;
626
+ scope?: FileScope;
627
+ fileType?: string;
628
+ status?: ProcessingStatus;
629
+ tags?: string;
630
+ page?: number;
631
+ limit?: number;
632
+ }): Promise<FileListResponse>;
633
+ /**
634
+ * Get file content
635
+ */
636
+ getContent(fileId: string, options?: {
637
+ contentType?: 'text' | 'transcript' | 'summary' | 'structured';
638
+ startLine?: number;
639
+ endLine?: number;
640
+ userId?: string;
641
+ }): Promise<FileContentResponse>;
642
+ /**
643
+ * Download original file
644
+ * Returns a redirect URL for blob storage or file content directly
645
+ */
646
+ download(fileId: string, userId?: string): Promise<any>;
647
+ /**
648
+ * Update file access scope
649
+ */
650
+ updateScope(fileId: string, data: FileScopeUpdateRequest): Promise<FileMetadata>;
651
+ /**
652
+ * Delete a file
653
+ */
654
+ delete(fileId: string, options?: {
655
+ hardDelete?: boolean;
656
+ userId?: string;
657
+ }): Promise<{
658
+ message: string;
659
+ fileId: string;
660
+ hardDelete: boolean;
661
+ }>;
662
+ /**
663
+ * Delete multiple files at once
664
+ */
665
+ bulkDelete(data: BulkDeleteRequest, options?: {
666
+ hardDelete?: boolean;
667
+ userId?: string;
668
+ }): Promise<BulkDeleteResponse>;
669
+ /**
670
+ * Get file processing status
671
+ */
672
+ getStatus(fileId: string, userId?: string): Promise<ProcessingStatusResponse>;
673
+ /**
674
+ * Semantic search across files
675
+ */
676
+ search(request: FileSearchRequest): Promise<FileSearchResponse>;
677
+ /**
678
+ * Get file statistics for the tenant
679
+ */
680
+ getStatistics(): Promise<FileStatisticsResponse>;
681
+ }
682
+
683
+ declare class IntegrationsResource {
684
+ private readonly http;
685
+ constructor(http: Http);
686
+ /**
687
+ * Start an OAuth connection flow for a user
688
+ */
689
+ initiateConnection(data: InitiateConnectionRequest): Promise<InitiateConnectionResponse>;
690
+ /**
691
+ * Check the status of a specific connection
692
+ */
693
+ getConnectionStatus(userId: string, appName: string): Promise<ConnectionStatusResponse>;
694
+ /**
695
+ * Get all connections for a user
696
+ */
697
+ getUserConnections(userId: string, appFilter?: string): Promise<UserConnectionsResponse>;
698
+ /**
699
+ * Get available tools for a user based on connections
700
+ */
701
+ getTools(data: GetToolsRequest): Promise<GetToolsResponse>;
702
+ /**
703
+ * Disconnect a user from an external app
704
+ */
705
+ disconnect(data: DisconnectRequest): Promise<DisconnectResponse>;
706
+ /**
707
+ * Handle OAuth callback (for custom implementations)
708
+ */
709
+ handleCallback(data: ConnectionCallbackRequest): Promise<ConnectionCallbackResponse>;
710
+ /**
711
+ * List apps enabled for the tenant
712
+ */
713
+ listApps(params?: {
714
+ includeAvailable?: boolean;
715
+ }): Promise<AppsListResponse>;
716
+ /**
717
+ * Check if a specific app is enabled
718
+ */
719
+ checkAppEnabled(appName: string): Promise<AppEnabledResponse>;
720
+ /**
721
+ * Enable or disable an app for the tenant
722
+ */
723
+ updateAppStatus(appName: string, enabled: boolean): Promise<UpdateAppStatusResponse>;
724
+ /**
725
+ * Get required fields for non-OAuth authentication (future)
726
+ */
727
+ getNonOAuthRequiredFields(appName: string, authScheme: string): Promise<any>;
728
+ isAppEnabled(appName: string): Promise<AppEnabledResponse>;
729
+ setAppEnabled(appName: string, data: {
730
+ enabled: boolean;
731
+ }): Promise<UpdateAppStatusResponse>;
732
+ listConnections(userId: string, params?: {
733
+ appFilter?: string;
734
+ }): Promise<UserConnectionsResponse>;
735
+ }
736
+
737
+ declare class MCPServersResource {
738
+ private readonly http;
739
+ constructor(http: Http);
740
+ /**
741
+ * Create a new MCP server configuration
742
+ */
743
+ create(data: MCPServerCreateRequest): Promise<MCPServerResponse>;
744
+ /**
745
+ * List MCP server configurations
746
+ */
747
+ list(params?: {
748
+ scope?: MCPScope | 'all';
749
+ userIdentifier?: string;
750
+ isActive?: boolean;
751
+ skip?: number;
752
+ limit?: number;
753
+ }): Promise<MCPServerListResponse>;
754
+ /**
755
+ * Get a specific MCP server configuration
756
+ */
757
+ get(serverId: string): Promise<MCPServerResponse>;
758
+ /**
759
+ * Update an MCP server configuration
760
+ */
761
+ update(serverId: string, data: MCPServerUpdateRequest): Promise<MCPServerResponse>;
762
+ /**
763
+ * Delete an MCP server configuration
764
+ */
765
+ delete(serverId: string): Promise<void>;
766
+ /**
767
+ * List tools provided by an MCP server
768
+ * Note: Currently returns empty list, tool indexing coming in Phase 1
769
+ */
770
+ listTools(serverId: string): Promise<MCPToolListResponse>;
771
+ /**
772
+ * Test connection to an MCP server
773
+ * Note: Currently returns placeholder, testing coming in Phase 1
774
+ */
775
+ testConnection(serverId: string): Promise<TestConnectionResponse>;
776
+ /**
777
+ * Test an MCP server configuration before saving
778
+ * Validates that the server can be connected to without creating a permanent configuration
779
+ */
780
+ testConfig(config: {
781
+ transport: 'stdio' | 'streamable_http' | 'sse';
782
+ command?: string;
783
+ args?: string[];
784
+ url?: string;
785
+ env?: Record<string, string>;
786
+ headers?: Record<string, string>;
787
+ }): Promise<TestConnectionResponse>;
788
+ }
789
+
790
+ declare class ModelPreferencesResource {
791
+ private readonly http;
792
+ constructor(http: Http);
793
+ /**
794
+ * Get all model preferences for the tenant
795
+ */
796
+ get(includeDefaults?: boolean): Promise<TenantModelPreferencesResponse>;
797
+ /**
798
+ * Update multiple model preferences in a single request
799
+ */
800
+ updateBulk(data: ModelPreferencesBulkUpdate): Promise<TenantModelPreferencesResponse>;
801
+ /**
802
+ * Update a specific model type preference
803
+ */
804
+ update(modelType: ModelType, data: ModelPreferenceCreate): Promise<TenantModelPreference>;
805
+ /**
806
+ * Delete a model preference to revert to system default
807
+ */
808
+ delete(modelType: ModelType): Promise<void>;
809
+ /**
810
+ * Check which models are available based on API key configuration
811
+ */
812
+ checkAvailability(models: ModelPreferenceCreate[]): Promise<ModelAvailability[]>;
813
+ /**
814
+ * List all model preferences (alias for get)
815
+ */
816
+ list(params?: {
817
+ includeDefaults?: boolean;
818
+ }): Promise<TenantModelPreferencesResponse>;
819
+ }
820
+
821
+ declare class ResponsesResource {
822
+ private readonly http;
823
+ constructor(http: Http);
824
+ private _validateFileReference;
825
+ /**
826
+ * Create a new response request for asynchronous processing
827
+ */
828
+ create(request: CreateResponseRequest): Promise<CreateResponseResponse>;
829
+ /**
830
+ * Get response status and content
831
+ * @param responseId - The response ID
832
+ * @param options - Optional parameters
833
+ * @param options.wait - Wait time in seconds for long-polling
834
+ */
835
+ get(responseId: string, options?: {
836
+ wait?: number;
837
+ }): Promise<ResponseObject>;
838
+ /**
839
+ * List responses with optional filtering
840
+ * @param params - Optional filter parameters
841
+ * @param params.userId - Filter by user ID
842
+ * @param params.status - Filter by response status
843
+ * @param params.startDate - Filter responses created after this date
844
+ * @param params.endDate - Filter responses created before this date
845
+ * @param params.limit - Maximum number of responses to return
846
+ * @param params.offset - Number of responses to skip for pagination
847
+ */
848
+ list(params?: {
849
+ userId?: string;
850
+ status?: 'queued' | 'in_progress' | 'succeeded' | 'failed' | 'cancelled';
851
+ startDate?: string;
852
+ endDate?: string;
853
+ limit?: number;
854
+ offset?: number;
855
+ }): Promise<ResponseListResponse>;
856
+ /**
857
+ * Cancel a queued or in-progress response
858
+ */
859
+ cancel(responseId: string): Promise<CancelResponseResponse>;
860
+ /**
861
+ * List artifacts generated by a response
862
+ */
863
+ listArtifacts(responseId: string, params?: PaginationParams): Promise<ArtifactsListResponse>;
864
+ }
865
+
866
+ declare class TenantInfoResource {
867
+ private readonly http;
868
+ constructor(http: Http);
869
+ /**
870
+ * Get detailed information about a tenant
871
+ * Users can only access information about their own tenant
872
+ */
873
+ get(tenantId: string): Promise<TenantDetailsResponse>;
874
+ }
875
+
876
+ declare class ThreadsResource {
877
+ private readonly http;
878
+ constructor(http: Http);
879
+ /**
880
+ * Create a new thread
881
+ */
882
+ create(params?: CreateThreadRequest): Promise<ThreadObject>;
883
+ /**
884
+ * List threads for the authenticated tenant
885
+ */
886
+ list(params?: {
887
+ userId?: string;
888
+ limit?: number;
889
+ offset?: number;
890
+ }): Promise<ThreadListResponse>;
891
+ /**
892
+ * Get detailed information about a specific thread
893
+ */
894
+ get(threadId: string): Promise<ThreadObject>;
895
+ /**
896
+ * Get all responses associated with a specific thread
897
+ */
898
+ getResponses(threadId: string, params?: ThreadResponsesParams): Promise<ResponseObject[]>;
899
+ /**
900
+ * Update thread metadata
901
+ */
902
+ update(threadId: string, data: UpdateThreadRequest): Promise<ThreadObject>;
903
+ /**
904
+ * Delete a thread and all its associated responses
905
+ */
906
+ delete(threadId: string): Promise<void>;
907
+ }
908
+
909
+ declare class UsersResource {
910
+ private readonly http;
911
+ constructor(http: Http);
912
+ /**
913
+ * Create a new user within the tenant
914
+ * Returns existing user with 200 OK if user with same email already exists
915
+ */
916
+ create(data: UserCreateRequest): Promise<UserResponse>;
917
+ /**
918
+ * List all users in the tenant with pagination
919
+ */
920
+ list(params?: {
921
+ page?: number;
922
+ pageSize?: number;
923
+ }): Promise<UserListResponse>;
924
+ /**
925
+ * Get user details by ID or email
926
+ */
927
+ get(userIdentifier: string): Promise<UserResponse>;
928
+ /**
929
+ * Update user information by ID or email
930
+ */
931
+ update(userIdentifier: string, data: UserUpdateRequest): Promise<UserResponse>;
932
+ /**
933
+ * Delete (deactivate) a user by ID or email
934
+ */
935
+ delete(userIdentifier: string): Promise<UserDeleteResponse>;
936
+ /**
937
+ * Get all AI responses generated for a specific user
938
+ */
939
+ getResponses(userIdentifier: string, params?: {
940
+ page?: number;
941
+ pageSize?: number;
942
+ }): Promise<ResponseObject[]>;
943
+ /**
944
+ * Get all conversation threads for a specific user
945
+ */
946
+ getThreads(userIdentifier: string, params?: {
947
+ page?: number;
948
+ pageSize?: number;
949
+ }): Promise<ThreadObject[]>;
950
+ }
951
+
952
+ interface LumnisClientOptions {
953
+ apiKey?: string;
954
+ tenantId?: string;
955
+ baseUrl?: string;
956
+ timeoutMs?: number;
957
+ maxRetries?: number;
958
+ scope?: Scope;
959
+ _scopedUserId?: string;
960
+ }
961
+ type InvokeMessages = string | Message | Message[];
962
+ interface InvokeOptions extends Partial<Omit<CreateResponseRequest, 'messages'>> {
963
+ scope?: Scope;
964
+ showProgress?: boolean;
965
+ pollIntervalMs?: number;
966
+ maxWaitMs?: number;
967
+ }
968
+ declare class LumnisClient {
969
+ private readonly http;
970
+ readonly tenantId?: string;
971
+ readonly threads: ThreadsResource;
972
+ readonly responses: ResponsesResource;
973
+ readonly users: UsersResource;
974
+ readonly files: FilesResource;
975
+ readonly tenantInfo: TenantInfoResource;
976
+ readonly externalApiKeys: ExternalAPIKeysResource;
977
+ readonly integrations: IntegrationsResource;
978
+ readonly modelPreferences: ModelPreferencesResource;
979
+ readonly mcpServers: MCPServersResource;
980
+ private readonly _scopedUserId?;
981
+ private readonly _defaultScope;
982
+ constructor(options?: LumnisClientOptions);
983
+ forUser(userId: string): LumnisClient;
984
+ invoke(messages: InvokeMessages, options: InvokeOptions & {
985
+ stream?: false;
986
+ }): Promise<ResponseObject>;
987
+ invoke(messages: InvokeMessages, options: InvokeOptions & {
988
+ stream: true;
989
+ }): Promise<AsyncGenerator<ProgressEntry, void, unknown>>;
990
+ private _invokeStream;
991
+ private _invokeAndWait;
992
+ private _createResponse;
993
+ listThreads(params?: Parameters<ThreadsResource['list']>[0]): Promise<ThreadListResponse>;
994
+ createThread(params?: Parameters<ThreadsResource['create']>[0]): Promise<ThreadObject>;
995
+ getThread(threadId: string): Promise<ThreadObject>;
996
+ deleteThread(threadId: string): Promise<void>;
997
+ createUser(params: Parameters<UsersResource['create']>[0]): Promise<UserResponse>;
998
+ getUser(userId: string): Promise<UserResponse>;
999
+ updateUser(userId: string, params: Parameters<UsersResource['update']>[1]): Promise<UserResponse>;
1000
+ deleteUser(userId: string): Promise<UserDeleteResponse>;
1001
+ listUsers(params?: Parameters<UsersResource['list']>[0]): Promise<UserListResponse>;
1002
+ addApiKey(params: Parameters<ExternalAPIKeysResource['create']>[0]): Promise<ExternalApiKeyResponse>;
1003
+ listApiKeys(): Promise<ExternalApiKeyResponse[]>;
1004
+ getApiKey(keyId: string): Promise<ExternalApiKeyResponse>;
1005
+ deleteApiKey(provider: Parameters<ExternalAPIKeysResource['delete']>[0]): Promise<DeleteApiKeyResponse>;
1006
+ getApiKeyMode(): Promise<ApiKeyModeResponse>;
1007
+ setApiKeyMode(mode: Parameters<ExternalAPIKeysResource['setMode']>[0]): Promise<ApiKeyModeResponse>;
1008
+ listApps(params?: Parameters<IntegrationsResource['listApps']>[0]): Promise<AppsListResponse>;
1009
+ isAppEnabled(appName: string): Promise<AppEnabledResponse>;
1010
+ setAppEnabled(appName: string, enabled: boolean): Promise<UpdateAppStatusResponse>;
1011
+ initiateConnection(params: Parameters<IntegrationsResource['initiateConnection']>[0]): Promise<InitiateConnectionResponse>;
1012
+ getConnectionStatus(userId: string, appName: string): Promise<ConnectionStatusResponse>;
1013
+ listConnections(userId: string, params?: Parameters<IntegrationsResource['listConnections']>[1]): Promise<UserConnectionsResponse>;
1014
+ getIntegrationTools(userId: string, params?: {
1015
+ appFilter?: string[];
1016
+ }): Promise<GetToolsResponse>;
1017
+ getModelPreferences(params?: Parameters<ModelPreferencesResource['list']>[0]): Promise<TenantModelPreferencesResponse>;
1018
+ updateModelPreferences(params: Parameters<ModelPreferencesResource['updateBulk']>[0]): Promise<TenantModelPreferencesResponse>;
1019
+ createMcpServer(params: Parameters<MCPServersResource['create']>[0]): Promise<MCPServerResponse>;
1020
+ getMcpServer(serverId: string): Promise<MCPServerResponse>;
1021
+ listMcpServers(params?: Parameters<MCPServersResource['list']>[0]): Promise<MCPServerListResponse>;
1022
+ updateMcpServer(serverId: string, params: Parameters<MCPServersResource['update']>[1]): Promise<MCPServerResponse>;
1023
+ deleteMcpServer(serverId: string): Promise<void>;
1024
+ listMcpServerTools(serverId: string): Promise<MCPToolListResponse>;
1025
+ testMcpServer(serverId: string): Promise<TestConnectionResponse>;
1026
+ }
1027
+
1028
+ interface LumnisErrorOptions {
1029
+ code?: string;
1030
+ statusCode?: number;
1031
+ details?: any;
1032
+ requestId?: string | null;
1033
+ }
1034
+ declare class LumnisError extends Error {
1035
+ code: string;
1036
+ statusCode?: number;
1037
+ details?: any;
1038
+ requestId?: string | null;
1039
+ constructor(message: string, options?: LumnisErrorOptions);
1040
+ }
1041
+ interface RateLimitErrorOptions extends LumnisErrorOptions {
1042
+ retryAfter?: string | number | null;
1043
+ }
1044
+ declare class AuthenticationError extends LumnisError {
1045
+ constructor(message: string, options?: LumnisErrorOptions);
1046
+ }
1047
+ declare class ValidationError extends LumnisError {
1048
+ constructor(message: string, options?: LumnisErrorOptions);
1049
+ }
1050
+ declare class NotFoundError extends LumnisError {
1051
+ constructor(message: string, options?: LumnisErrorOptions);
1052
+ }
1053
+ declare class RateLimitError extends LumnisError {
1054
+ retryAfter?: string | number | null;
1055
+ constructor(options?: RateLimitErrorOptions);
1056
+ }
1057
+ declare class InternalServerError extends LumnisError {
1058
+ constructor(message: string, options?: LumnisErrorOptions);
1059
+ }
1060
+ declare class LocalFileNotSupportedError extends ValidationError {
1061
+ constructor(filePath: string);
1062
+ }
1063
+
1064
+ export = LumnisClient;
1065
+ export { type AgentConfig, type AgentEffort, type ApiKeyMode, type ApiKeyModeRequest, type ApiKeyModeResponse, type ApiProvider, type AppEnabledResponse, type AppsListResponse, type ArtifactObject, type ArtifactsListResponse, AuthenticationError, type BaseResource, type BillingStatus, type BulkDeleteRequest, type BulkDeleteResponse, type BulkUploadResponse, type CancelResponseResponse, type ChunkingStrategy, type ConnectionCallbackRequest, type ConnectionCallbackResponse, type ConnectionInfo, type ConnectionStatus, type ConnectionStatusResponse, type ContentType, type CreateResponseRequest, type CreateResponseResponse, type CreateThreadRequest, type DatabaseStatus, type DeleteApiKeyResponse, type DisconnectRequest, type DisconnectResponse, type DuplicateHandling, type Email, type ErrorResponse, ExternalAPIKeysResource, type ExternalApiKeyResponse, type FileAttachment, type FileChunk, type FileContentResponse, type FileListResponse, type FileMetadata, type FileScope, type FileScopeUpdateRequest, type FileSearchRequest, type FileSearchResponse, type FileSearchResult, type FileStatisticsResponse, type FileUploadResponse, FilesResource, type GetToolsRequest, type GetToolsResponse, type InitiateConnectionRequest, type InitiateConnectionResponse, IntegrationsResource, InternalServerError, LocalFileNotSupportedError, LumnisClient, type LumnisClientOptions, LumnisError, type LumnisErrorOptions, type MCPScope, type MCPServerCreateRequest, type MCPServerListResponse, type MCPServerResponse, type MCPServerUpdateRequest, MCPServersResource, type MCPToolListResponse, type MCPToolResponse, type MCPTransport, type Message, type ModelAvailability, type ModelOverrides, type ModelPreferenceCreate, type ModelPreferencesBulkUpdate, ModelPreferencesResource, type ModelProvider, type ModelType, NotFoundError, type PaginationInfo, type PaginationParams, type Plan, type ProcessingStatus, type ProcessingStatusResponse, type ProgressEntry, RateLimitError, type RateLimitErrorOptions, type ResponseArtifact, type ResponseListResponse, type ResponseObject, type ResponseStatus, ResponsesResource, type Scope, type StoreApiKeyRequest, type TenantDetailsResponse, TenantInfoResource, type TenantModelPreference, type TenantModelPreferencesResponse, type TestConnectionResponse, type ThreadListResponse, type ThreadObject, type ThreadResponsesParams, ThreadsResource, type ToolInfo, type UUID, type UpdateAppStatusResponse, type UpdateThreadRequest, type UserConnectionsResponse, type UserCreateRequest, type UserDeleteResponse, type UserIdentifier, type UserListResponse, type UserResponse, type UserUpdateRequest, UsersResource, ValidationError };