@nebula-ai/sdk 1.1.26 → 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 CHANGED
@@ -109,11 +109,6 @@ interface SearchOptions {
109
109
  limit: number;
110
110
  filters?: Record<string, unknown>;
111
111
  }
112
- interface RecallFocus {
113
- schema_weight: number;
114
- fact_weight: number;
115
- episodic_weight: number;
116
- }
117
112
  interface ActivatedEntity {
118
113
  id?: string;
119
114
  name: string;
@@ -182,12 +177,7 @@ interface MemoryResponse {
182
177
  facts: ActivatedFact[];
183
178
  utterances: GroundedUtterance[];
184
179
  inference_hints?: InferenceHint[];
185
- focus?: RecallFocus;
186
- fact_to_chunks?: Record<string, string[]>;
187
- entity_to_facts?: Record<string, string[]>;
188
- retrieved_at?: string;
189
180
  total_traversal_time_ms?: number;
190
- query_intent?: string;
191
181
  token_count?: number;
192
182
  }
193
183
  interface NebulaClientConfig {
@@ -292,8 +282,12 @@ declare class Nebula {
292
282
  * @throws NebulaNotFoundException if memory_id doesn't exist
293
283
  */
294
284
  private _appendToMemory;
295
- /** Store multiple memories using the unified engrams API */
296
- storeMemories(memories: Memory$1[]): Promise<string[]>;
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[]>;
297
291
  /** Delete one or more memories */
298
292
  delete(memoryIds: string | string[]): Promise<boolean | {
299
293
  message: string;
@@ -486,6 +480,24 @@ declare class Nebula {
486
480
  filters?: Record<string, unknown>;
487
481
  searchSettings?: Record<string, unknown>;
488
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>>;
489
501
  healthCheck(): Promise<Record<string, unknown>>;
490
502
  private _collectionFromDict;
491
503
  private _memoryResponseFromDict;
@@ -534,4 +546,4 @@ type MemoryFactory = {
534
546
  declare const Memory: MemoryFactory;
535
547
  type Memory = Memory$1;
536
548
 
537
- export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type RecallFocus, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
549
+ export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
package/dist/index.d.ts CHANGED
@@ -109,11 +109,6 @@ interface SearchOptions {
109
109
  limit: number;
110
110
  filters?: Record<string, unknown>;
111
111
  }
112
- interface RecallFocus {
113
- schema_weight: number;
114
- fact_weight: number;
115
- episodic_weight: number;
116
- }
117
112
  interface ActivatedEntity {
118
113
  id?: string;
119
114
  name: string;
@@ -182,12 +177,7 @@ interface MemoryResponse {
182
177
  facts: ActivatedFact[];
183
178
  utterances: GroundedUtterance[];
184
179
  inference_hints?: InferenceHint[];
185
- focus?: RecallFocus;
186
- fact_to_chunks?: Record<string, string[]>;
187
- entity_to_facts?: Record<string, string[]>;
188
- retrieved_at?: string;
189
180
  total_traversal_time_ms?: number;
190
- query_intent?: string;
191
181
  token_count?: number;
192
182
  }
193
183
  interface NebulaClientConfig {
@@ -292,8 +282,12 @@ declare class Nebula {
292
282
  * @throws NebulaNotFoundException if memory_id doesn't exist
293
283
  */
294
284
  private _appendToMemory;
295
- /** Store multiple memories using the unified engrams API */
296
- storeMemories(memories: Memory$1[]): Promise<string[]>;
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[]>;
297
291
  /** Delete one or more memories */
298
292
  delete(memoryIds: string | string[]): Promise<boolean | {
299
293
  message: string;
@@ -486,6 +480,24 @@ declare class Nebula {
486
480
  filters?: Record<string, unknown>;
487
481
  searchSettings?: Record<string, unknown>;
488
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>>;
489
501
  healthCheck(): Promise<Record<string, unknown>>;
490
502
  private _collectionFromDict;
491
503
  private _memoryResponseFromDict;
@@ -534,4 +546,4 @@ type MemoryFactory = {
534
546
  declare const Memory: MemoryFactory;
535
547
  type Memory = Memory$1;
536
548
 
537
- export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type RecallFocus, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
549
+ export { type ActivatedEntity, type ActivatedFacet, type ActivatedFact, type Chunk, type Collection, type FileContentPart, type GraphCommunityResult, type GraphEntityResult, type GraphRelationshipResult, GraphSearchResultType, type GroundedUtterance, Memory, type MemoryResponse, type MultimodalContentPart, Nebula, NebulaAuthenticationException, type NebulaClientConfig, NebulaClientException, NebulaCollectionNotFoundException, NebulaContent, NebulaException, NebulaNotFoundException, NebulaRateLimitException, NebulaValidationException, type S3FileReferencePart, type SearchOptions, type SearchResult, type StructuredChunk, type TextContentPart, Nebula as default };
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
- async storeMemories(memories) {
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
  }
@@ -846,16 +850,63 @@ var _Nebula = class _Nebula {
846
850
  facts: memoryResponseData.facts || [],
847
851
  utterances: memoryResponseData.utterances || [],
848
852
  inference_hints: memoryResponseData.inference_hints || [],
849
- fact_to_chunks: memoryResponseData.fact_to_chunks || {},
850
- entity_to_facts: memoryResponseData.entity_to_facts || {},
851
- retrieved_at: memoryResponseData.retrieved_at || (/* @__PURE__ */ new Date()).toISOString(),
852
- focus: memoryResponseData.focus,
853
853
  total_traversal_time_ms: memoryResponseData.total_traversal_time_ms,
854
- query_intent: memoryResponseData.query_intent,
855
854
  token_count: memoryResponseData.token_count
856
855
  };
857
856
  return memoryResponse;
858
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
+ }
859
910
  // Health Check
860
911
  async healthCheck() {
861
912
  return this._makeRequest("GET", "/v1/health");