@nebula-ai/sdk 1.1.27 → 1.1.28
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.mts +24 -2
- package/dist/index.d.ts +24 -2
- package/dist/index.js +60 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +60 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -282,8 +282,12 @@ declare class Nebula {
|
|
|
282
282
|
* @throws NebulaNotFoundException if memory_id doesn't exist
|
|
283
283
|
*/
|
|
284
284
|
private _appendToMemory;
|
|
285
|
-
/** Store multiple memories using the unified engrams API
|
|
286
|
-
|
|
285
|
+
/** Store multiple memories using the unified engrams API.
|
|
286
|
+
* @param memories - List of Memory objects to store.
|
|
287
|
+
* @param metadata - Optional memory-level metadata for conversation groups.
|
|
288
|
+
* Each Memory's own metadata is used as per-message metadata.
|
|
289
|
+
*/
|
|
290
|
+
storeMemories(memories: Memory$1[], metadata?: Record<string, unknown>): Promise<string[]>;
|
|
287
291
|
/** Delete one or more memories */
|
|
288
292
|
delete(memoryIds: string | string[]): Promise<boolean | {
|
|
289
293
|
message: string;
|
|
@@ -476,6 +480,24 @@ declare class Nebula {
|
|
|
476
480
|
filters?: Record<string, unknown>;
|
|
477
481
|
searchSettings?: Record<string, unknown>;
|
|
478
482
|
}): Promise<MemoryResponse>;
|
|
483
|
+
/** List available connector providers */
|
|
484
|
+
listProviders(): Promise<string[]>;
|
|
485
|
+
/** Start an OAuth connection flow */
|
|
486
|
+
connectProvider(provider: string, collectionId: string, config?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
487
|
+
/** List active connections for a collection */
|
|
488
|
+
listConnections(collectionId: string): Promise<Record<string, unknown>[]>;
|
|
489
|
+
/** Browse Google Drive folders for a connection */
|
|
490
|
+
listFolders(connectionId: string, parentId?: string): Promise<Record<string, unknown>[]>;
|
|
491
|
+
/** List Slack channels for a connection */
|
|
492
|
+
listChannels(connectionId: string): Promise<Record<string, unknown>[]>;
|
|
493
|
+
/** Get a single connection by ID */
|
|
494
|
+
getConnection(connectionId: string): Promise<Record<string, unknown>>;
|
|
495
|
+
/** Manually trigger a sync for a connection */
|
|
496
|
+
triggerSync(connectionId: string): Promise<Record<string, unknown>>;
|
|
497
|
+
/** Update connection config (e.g., folder/channel selection) */
|
|
498
|
+
updateConnectionConfig(connectionId: string, config: Record<string, unknown>, apply?: string): Promise<Record<string, unknown>>;
|
|
499
|
+
/** Disconnect an external data source */
|
|
500
|
+
disconnect(connectionId: string, deleteMemories?: boolean): Promise<Record<string, unknown>>;
|
|
479
501
|
healthCheck(): Promise<Record<string, unknown>>;
|
|
480
502
|
private _collectionFromDict;
|
|
481
503
|
private _memoryResponseFromDict;
|
package/dist/index.d.ts
CHANGED
|
@@ -282,8 +282,12 @@ declare class Nebula {
|
|
|
282
282
|
* @throws NebulaNotFoundException if memory_id doesn't exist
|
|
283
283
|
*/
|
|
284
284
|
private _appendToMemory;
|
|
285
|
-
/** Store multiple memories using the unified engrams API
|
|
286
|
-
|
|
285
|
+
/** Store multiple memories using the unified engrams API.
|
|
286
|
+
* @param memories - List of Memory objects to store.
|
|
287
|
+
* @param metadata - Optional memory-level metadata for conversation groups.
|
|
288
|
+
* Each Memory's own metadata is used as per-message metadata.
|
|
289
|
+
*/
|
|
290
|
+
storeMemories(memories: Memory$1[], metadata?: Record<string, unknown>): Promise<string[]>;
|
|
287
291
|
/** Delete one or more memories */
|
|
288
292
|
delete(memoryIds: string | string[]): Promise<boolean | {
|
|
289
293
|
message: string;
|
|
@@ -476,6 +480,24 @@ declare class Nebula {
|
|
|
476
480
|
filters?: Record<string, unknown>;
|
|
477
481
|
searchSettings?: Record<string, unknown>;
|
|
478
482
|
}): Promise<MemoryResponse>;
|
|
483
|
+
/** List available connector providers */
|
|
484
|
+
listProviders(): Promise<string[]>;
|
|
485
|
+
/** Start an OAuth connection flow */
|
|
486
|
+
connectProvider(provider: string, collectionId: string, config?: Record<string, unknown>): Promise<Record<string, unknown>>;
|
|
487
|
+
/** List active connections for a collection */
|
|
488
|
+
listConnections(collectionId: string): Promise<Record<string, unknown>[]>;
|
|
489
|
+
/** Browse Google Drive folders for a connection */
|
|
490
|
+
listFolders(connectionId: string, parentId?: string): Promise<Record<string, unknown>[]>;
|
|
491
|
+
/** List Slack channels for a connection */
|
|
492
|
+
listChannels(connectionId: string): Promise<Record<string, unknown>[]>;
|
|
493
|
+
/** Get a single connection by ID */
|
|
494
|
+
getConnection(connectionId: string): Promise<Record<string, unknown>>;
|
|
495
|
+
/** Manually trigger a sync for a connection */
|
|
496
|
+
triggerSync(connectionId: string): Promise<Record<string, unknown>>;
|
|
497
|
+
/** Update connection config (e.g., folder/channel selection) */
|
|
498
|
+
updateConnectionConfig(connectionId: string, config: Record<string, unknown>, apply?: string): Promise<Record<string, unknown>>;
|
|
499
|
+
/** Disconnect an external data source */
|
|
500
|
+
disconnect(connectionId: string, deleteMemories?: boolean): Promise<Record<string, unknown>>;
|
|
479
501
|
healthCheck(): Promise<Record<string, unknown>>;
|
|
480
502
|
private _collectionFromDict;
|
|
481
503
|
private _memoryResponseFromDict;
|
package/dist/index.js
CHANGED
|
@@ -473,8 +473,12 @@ var _Nebula = class _Nebula {
|
|
|
473
473
|
throw error;
|
|
474
474
|
}
|
|
475
475
|
}
|
|
476
|
-
/** Store multiple memories using the unified engrams API
|
|
477
|
-
|
|
476
|
+
/** Store multiple memories using the unified engrams API.
|
|
477
|
+
* @param memories - List of Memory objects to store.
|
|
478
|
+
* @param metadata - Optional memory-level metadata for conversation groups.
|
|
479
|
+
* Each Memory's own metadata is used as per-message metadata.
|
|
480
|
+
*/
|
|
481
|
+
async storeMemories(memories, metadata) {
|
|
478
482
|
const results = [];
|
|
479
483
|
const convGroups = {};
|
|
480
484
|
const others = [];
|
|
@@ -517,7 +521,7 @@ var _Nebula = class _Nebula {
|
|
|
517
521
|
collection_id: collectionId,
|
|
518
522
|
name: "Conversation",
|
|
519
523
|
messages,
|
|
520
|
-
metadata: {}
|
|
524
|
+
metadata: metadata ?? {}
|
|
521
525
|
};
|
|
522
526
|
const response = await this._makeRequest("POST", "/v1/memories", data);
|
|
523
527
|
if (response.results) {
|
|
@@ -534,7 +538,7 @@ var _Nebula = class _Nebula {
|
|
|
534
538
|
collection_id: collectionId,
|
|
535
539
|
content: messages,
|
|
536
540
|
memory_id: convId,
|
|
537
|
-
metadata: {}
|
|
541
|
+
metadata: metadata ?? {}
|
|
538
542
|
};
|
|
539
543
|
await this._appendToMemory(convId, appendMem);
|
|
540
544
|
}
|
|
@@ -851,6 +855,58 @@ var _Nebula = class _Nebula {
|
|
|
851
855
|
};
|
|
852
856
|
return memoryResponse;
|
|
853
857
|
}
|
|
858
|
+
// Connector Methods
|
|
859
|
+
/** List available connector providers */
|
|
860
|
+
async listProviders() {
|
|
861
|
+
const response = await this._makeRequest("GET", "/v1/connectors/providers");
|
|
862
|
+
return this._unwrapResultsArray(response);
|
|
863
|
+
}
|
|
864
|
+
/** Start an OAuth connection flow */
|
|
865
|
+
async connectProvider(provider, collectionId, config) {
|
|
866
|
+
const body = { collection_id: collectionId };
|
|
867
|
+
if (config !== void 0) body.config = config;
|
|
868
|
+
const response = await this._makeRequest("POST", `/v1/connectors/${provider}/connect`, body);
|
|
869
|
+
return this._unwrapResults(response);
|
|
870
|
+
}
|
|
871
|
+
/** List active connections for a collection */
|
|
872
|
+
async listConnections(collectionId) {
|
|
873
|
+
const response = await this._makeRequest("GET", "/v1/connectors", void 0, { collection_id: collectionId });
|
|
874
|
+
return this._unwrapResultsArray(response);
|
|
875
|
+
}
|
|
876
|
+
/** Browse Google Drive folders for a connection */
|
|
877
|
+
async listFolders(connectionId, parentId) {
|
|
878
|
+
const params = {};
|
|
879
|
+
if (parentId !== void 0) params.parent_id = parentId;
|
|
880
|
+
const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}/folders`, void 0, Object.keys(params).length ? params : void 0);
|
|
881
|
+
return this._unwrapResultsArray(response);
|
|
882
|
+
}
|
|
883
|
+
/** List Slack channels for a connection */
|
|
884
|
+
async listChannels(connectionId) {
|
|
885
|
+
const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}/channels`);
|
|
886
|
+
return this._unwrapResultsArray(response);
|
|
887
|
+
}
|
|
888
|
+
/** Get a single connection by ID */
|
|
889
|
+
async getConnection(connectionId) {
|
|
890
|
+
const response = await this._makeRequest("GET", `/v1/connectors/${connectionId}`);
|
|
891
|
+
return this._unwrapResults(response);
|
|
892
|
+
}
|
|
893
|
+
/** Manually trigger a sync for a connection */
|
|
894
|
+
async triggerSync(connectionId) {
|
|
895
|
+
const response = await this._makeRequest("POST", `/v1/connectors/${connectionId}/sync`);
|
|
896
|
+
return this._unwrapResults(response);
|
|
897
|
+
}
|
|
898
|
+
/** Update connection config (e.g., folder/channel selection) */
|
|
899
|
+
async updateConnectionConfig(connectionId, config, apply = "full_resync") {
|
|
900
|
+
const response = await this._makeRequest("PATCH", `/v1/connectors/${connectionId}/config`, { config, apply });
|
|
901
|
+
return this._unwrapResults(response);
|
|
902
|
+
}
|
|
903
|
+
/** Disconnect an external data source */
|
|
904
|
+
async disconnect(connectionId, deleteMemories = false) {
|
|
905
|
+
const params = {};
|
|
906
|
+
if (deleteMemories) params.delete_memories = "true";
|
|
907
|
+
const response = await this._makeRequest("DELETE", `/v1/connectors/${connectionId}`, void 0, Object.keys(params).length ? params : void 0);
|
|
908
|
+
return this._unwrapResults(response);
|
|
909
|
+
}
|
|
854
910
|
// Health Check
|
|
855
911
|
async healthCheck() {
|
|
856
912
|
return this._makeRequest("GET", "/v1/health");
|