@nebula-ai/sdk 1.5.0 → 1.6.1

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.js CHANGED
@@ -281,9 +281,8 @@ var ClientResource = class {
281
281
  this.core = core;
282
282
  }
283
283
  /**
284
- *
285
284
  * Health probe
286
- *
285
+ *
287
286
  * Lightweight liveness probe. Returns a 200 with a fixed message when the API process is up. Does not verify downstream dependencies (database, storage, workers) — use the internal status endpoints for those.
288
287
  * @operationId client.health
289
288
  * @endpoint GET /v1/health
@@ -307,12 +306,11 @@ var CollectionsResource = class {
307
306
  this.core = core;
308
307
  }
309
308
  /**
310
- *
311
309
  * Create a new collection
312
- *
310
+ *
313
311
  * Create a new collection and automatically add the creating user
314
312
  * to it.
315
- *
313
+ *
316
314
  * This endpoint allows authenticated users to create a new collection
317
315
  * with a specified name and optional description. The user creating
318
316
  * the collection is automatically added as a member.
@@ -331,11 +329,10 @@ var CollectionsResource = class {
331
329
  })).results;
332
330
  }
333
331
  /**
334
- *
335
332
  * Delete collection
336
- *
333
+ *
337
334
  * Delete an existing collection.
338
- *
335
+ *
339
336
  * This endpoint allows deletion of a collection identified by its
340
337
  * UUID. The user must have appropriate permissions to delete the
341
338
  * collection. Deleting a collection removes all associations but does
@@ -354,16 +351,15 @@ var CollectionsResource = class {
354
351
  })).results;
355
352
  }
356
353
  /**
357
- *
358
354
  * List collections
359
- *
355
+ *
360
356
  * Returns a cursor-paginated list of collections the authenticated
361
357
  * user has access to.
362
- *
358
+ *
363
359
  * Results can be filtered by providing specific collection IDs.
364
360
  * Regular users will only see collections they own or have access to.
365
361
  * Superusers can see all collections.
366
- *
362
+ *
367
363
  * The collections are returned in order of last modification, with
368
364
  * most recent first.
369
365
  * @operationId collections.list
@@ -387,11 +383,10 @@ var CollectionsResource = class {
387
383
  });
388
384
  }
389
385
  /**
390
- *
391
386
  * Get collection details
392
- *
387
+ *
393
388
  * Get details of a specific collection.
394
- *
389
+ *
395
390
  * This endpoint retrieves detailed information about a single
396
391
  * collection identified by its UUID. The user must have access to the
397
392
  * collection to view its details.
@@ -409,11 +404,10 @@ var CollectionsResource = class {
409
404
  })).results;
410
405
  }
411
406
  /**
412
- *
413
407
  * Get a collection by name
414
- *
408
+ *
415
409
  * Retrieve a collection by its (owner_id, name) combination.
416
- *
410
+ *
417
411
  * The authenticated user can only fetch collections they own, or, if
418
412
  * superuser, from anyone.
419
413
  * @operationId collections.retrieveByName
@@ -430,11 +424,10 @@ var CollectionsResource = class {
430
424
  })).results;
431
425
  }
432
426
  /**
433
- *
434
427
  * Update collection
435
- *
428
+ *
436
429
  * Update an existing collection's configuration.
437
- *
430
+ *
438
431
  * This endpoint allows updating the name, description, and access settings of an
439
432
  * existing collection. The user must have appropriate permissions to
440
433
  * modify the collection.
@@ -461,9 +454,8 @@ var ConnectorsResource = class {
461
454
  this.core = core;
462
455
  }
463
456
  /**
464
- *
465
457
  * Start OAuth connection flow
466
- *
458
+ *
467
459
  * Start the OAuth connection flow for the given external provider. Returns the authorization URL the user should visit to grant Nebula access. After consent the provider redirects back to Nebula and the connection becomes active.
468
460
  * @operationId connectors.connect
469
461
  * @endpoint POST /v1/connectors/{provider}/connect
@@ -480,9 +472,8 @@ var ConnectorsResource = class {
480
472
  })).results;
481
473
  }
482
474
  /**
483
- *
484
475
  * Disconnect an external data source
485
- *
476
+ *
486
477
  * Disconnect the named connection, revoking the stored OAuth credentials and stopping future syncs. Optionally pass `delete_memories=true` to also remove every memory this connection had ingested.
487
478
  * @operationId connectors.disconnect
488
479
  * @endpoint DELETE /v1/connectors/{connection_id}
@@ -498,9 +489,8 @@ var ConnectorsResource = class {
498
489
  })).results;
499
490
  }
500
491
  /**
501
- *
502
492
  * List active connections for a collection
503
- *
493
+ *
504
494
  * Return every connector connection associated with the given collection, with encrypted credentials redacted. Useful for showing the user which third-party data sources are wired up to a collection.
505
495
  * @operationId connectors.list
506
496
  * @endpoint GET /v1/connectors
@@ -516,9 +506,8 @@ var ConnectorsResource = class {
516
506
  })).results;
517
507
  }
518
508
  /**
519
- *
520
509
  * List available connector providers
521
- *
510
+ *
522
511
  * Return the set of connector provider identifiers (e.g. `google_drive`, `slack`) that this Nebula instance is configured to expose. Pass one of these to `POST /connectors/{provider}/connect` to start an OAuth flow.
523
512
  * @operationId connectors.listProviders
524
513
  * @endpoint GET /v1/connectors/providers
@@ -534,9 +523,8 @@ var ConnectorsResource = class {
534
523
  })).results;
535
524
  }
536
525
  /**
537
- *
538
526
  * Get a single connection by ID
539
- *
527
+ *
540
528
  * Fetch a single connector connection by its UUID. Returns the connection metadata plus whether the underlying subscription is active. Encrypted credentials are never returned to clients.
541
529
  * @operationId connectors.retrieve
542
530
  * @endpoint GET /v1/connectors/{connection_id}
@@ -552,9 +540,8 @@ var ConnectorsResource = class {
552
540
  })).results;
553
541
  }
554
542
  /**
555
- *
556
543
  * Manually trigger a sync
557
- *
544
+ *
558
545
  * Schedule an immediate sync for an active connection, bypassing the normal cadence. Returns 409 if a sync is already in progress and 400 if the connection isn't in the `active` state.
559
546
  * @operationId connectors.sync
560
547
  * @endpoint POST /v1/connectors/{connection_id}/sync
@@ -578,15 +565,14 @@ var MemoriesResource = class {
578
565
  this.core = core;
579
566
  }
580
567
  /**
581
- *
582
568
  * Append content to an engram
583
- *
569
+ *
584
570
  * Append content to an existing engram.
585
- *
571
+ *
586
572
  * **For conversation engrams:**
587
573
  * - Provide `messages` array with content, role, and optional metadata
588
574
  * - Works like `/conversations/{id}/messages` endpoint
589
- *
575
+ *
590
576
  * **For document engrams:**
591
577
  * - Provide either `raw_text` or `chunks` to append additional content
592
578
  * - Content will be processed and added to the engram
@@ -605,11 +591,10 @@ var MemoriesResource = class {
605
591
  })).results;
606
592
  }
607
593
  /**
608
- *
609
594
  * Create a new memory (conversation or document)
610
- *
595
+ *
611
596
  * Create a new memory (conversation or document) using clean JSON body.
612
- *
597
+ *
613
598
  * - Use `collection_id` (UUID)
614
599
  * - `kind` is optional and inferred from payload shape:
615
600
  * - If `messages` present -> conversation
@@ -632,19 +617,18 @@ var MemoriesResource = class {
632
617
  })).results;
633
618
  }
634
619
  /**
635
- *
636
620
  * Get presigned URL for large file upload
637
- *
621
+ *
638
622
  * Get a presigned URL for uploading large files directly to S3.
639
- *
623
+ *
640
624
  * Use this for files larger than 5MB that cannot be sent inline as base64.
641
625
  * After uploading, reference the file in memory creation using S3FileReference.
642
- *
626
+ *
643
627
  * Args:
644
628
  * filename: Original filename (e.g., "image.jpg")
645
629
  * content_type: MIME type (e.g., "image/jpeg", "application/pdf")
646
630
  * file_size: Expected file size in bytes (max 100MB)
647
- *
631
+ *
648
632
  * Returns:
649
633
  * dict with:
650
634
  * - upload_url: Presigned URL for PUT request (expires in 1 hour)
@@ -671,13 +655,12 @@ var MemoriesResource = class {
671
655
  })).results;
672
656
  }
673
657
  /**
674
- *
675
658
  * Delete an engram
676
- *
659
+ *
677
660
  * Delete a specific engram with graph awareness. All chunks corresponding to the
678
661
  * engram are deleted, and graph components (entities/relationships) are updated
679
662
  * or deleted based on remaining chunk references from other engrams.
680
- *
663
+ *
681
664
  * This method now properly handles graph components and maintains graph integrity
682
665
  * for search operations.
683
666
  * @operationId memories.delete
@@ -694,17 +677,16 @@ var MemoriesResource = class {
694
677
  })).results;
695
678
  }
696
679
  /**
697
- *
698
680
  * Delete one or more engrams
699
- *
681
+ *
700
682
  * Delete one or more engrams.
701
- *
683
+ *
702
684
  * This endpoint efficiently handles both single and batch deletions.
703
685
  * When multiple IDs are provided, it uses optimized batch operations.
704
- *
686
+ *
705
687
  * Args:
706
688
  * ids: Either a single UUID or a list of UUIDs to delete
707
- *
689
+ *
708
690
  * Returns:
709
691
  * For single deletion: boolean success response
710
692
  * For batch deletion: detailed results with successful and failed deletions
@@ -723,9 +705,8 @@ var MemoriesResource = class {
723
705
  });
724
706
  }
725
707
  /**
726
- *
727
708
  * Delete a previously uploaded S3 file
728
- *
709
+ *
729
710
  * Delete a file from S3 that was uploaded via a presigned URL.
730
711
  * Verifies the caller owns the file via S3 object metadata.
731
712
  * @operationId memories.deleteUpload
@@ -742,16 +723,15 @@ var MemoriesResource = class {
742
723
  })).results;
743
724
  }
744
725
  /**
745
- *
746
726
  * List engrams
747
- *
727
+ *
748
728
  * Returns a cursor-paginated list of engrams the authenticated user
749
729
  * has access to.
750
- *
730
+ *
751
731
  * Results can be filtered by providing specific engram IDs or collection IDs.
752
732
  * Regular users will only see engrams they own or have access to through
753
733
  * collections. Superusers can see all engrams.
754
- *
734
+ *
755
735
  * The engrams are returned in order of creation time, most recent
756
736
  * first. The response includes the engram's text field if available.
757
737
  * @operationId memories.list
@@ -777,11 +757,10 @@ var MemoriesResource = class {
777
757
  });
778
758
  }
779
759
  /**
780
- *
781
760
  * Recall workflow patterns by intent
782
- *
761
+ *
783
762
  * Workflow-pattern recall over 5 intents.
784
- *
763
+ *
785
764
  * * ``cursor`` -- match the caller's anchor against pattern
786
765
  * canonical states, return ranked patterns + position.
787
766
  * * ``predict`` -- like cursor but include the predicted next
@@ -805,15 +784,14 @@ var MemoriesResource = class {
805
784
  })).results;
806
785
  }
807
786
  /**
808
- *
809
787
  * Retrieve an engram
810
- *
788
+ *
811
789
  * Retrieves detailed information about a specific engram by its
812
790
  * ID.
813
- *
791
+ *
814
792
  * This endpoint returns the engram's metadata, status, and system information. It does not
815
793
  * return the engram's content - use the `/engrams/{id}/download` endpoint for that.
816
- *
794
+ *
817
795
  * Users can only retrieve engrams they own or have access to through collections.
818
796
  * Superusers can retrieve any engram.
819
797
  * @operationId memories.retrieve
@@ -830,14 +808,13 @@ var MemoriesResource = class {
830
808
  })).results;
831
809
  }
832
810
  /**
833
- *
834
811
  * Search memories
835
- *
812
+ *
836
813
  * Perform a search query across your memories.
837
- *
814
+ *
838
815
  * **Standard mode** (collection_ids or readable-scope search): returns hierarchical MemoryRecall
839
816
  * with semantics, episodes, procedures, and sources.
840
- *
817
+ *
841
818
  * **Snapshot mode** (snapshot field): returns graph-search results with
842
819
  * {entities, relationships} from stateless in-memory traversal.
843
820
  * @operationId memories.search
@@ -855,20 +832,19 @@ var MemoriesResource = class {
855
832
  })).results;
856
833
  }
857
834
  /**
858
- *
859
835
  * Update a memory
860
- *
836
+ *
861
837
  * Update memory-level properties including name, metadata, and collection associations.
862
- *
838
+ *
863
839
  * This endpoint allows updating properties of an entire memory (document or conversation)
864
840
  * without modifying its content:
865
841
  * - **name**: Updates the authoritative engram title
866
842
  * - **metadata**: Can replace or merge with existing metadata
867
843
  * - **collection_ids**: Updates authoritative engram collection associations
868
- *
844
+ *
869
845
  * Users can only update memories they own or have access to through collections.
870
846
  * At least one collection association must be maintained.
871
- *
847
+ *
872
848
  * If collection_id is provided and the engram is shared across collections, a copy-on-write
873
849
  * will be performed to create a collection-specific copy before modification.
874
850
  * @operationId memories.update
@@ -894,9 +870,8 @@ var SnapshotsResource = class {
894
870
  this.core = core;
895
871
  }
896
872
  /**
897
- *
898
873
  * Export a collection snapshot
899
- *
874
+ *
900
875
  * Export a collection's full graph state as a
901
876
  * portable SnapshotEnvelope.
902
877
  * @operationId snapshots.export
@@ -914,9 +889,8 @@ var SnapshotsResource = class {
914
889
  })).results;
915
890
  }
916
891
  /**
917
- *
918
892
  * Import a snapshot into an ephemeral collection
919
- *
893
+ *
920
894
  * Import a SnapshotEnvelope into an ephemeral
921
895
  * collection. Returns the ephemeral collection UUID.
922
896
  * @operationId snapshots.import
@@ -935,6 +909,89 @@ var SnapshotsResource = class {
935
909
  }
936
910
  };
937
911
  //#endregion
912
+ //#region src/resources/workspaces.ts
913
+ var WorkspacesResource = class {
914
+ core;
915
+ constructor(core) {
916
+ this.core = core;
917
+ }
918
+ /**
919
+ * Create workspace storage target
920
+ *
921
+ * Register a customer S3 bucket for hosted BYOC storage.
922
+ * @operationId workspaces.createStorageTarget
923
+ * @endpoint POST /v1/workspaces/{workspace_id}/storage-targets
924
+ */
925
+ async createStorageTarget(params, options) {
926
+ return (await this.core.request({
927
+ method: "POST",
928
+ path: "/v1/workspaces/{workspace_id}/storage-targets",
929
+ pathParams: { workspace_id: params.workspaceId },
930
+ query: void 0,
931
+ body: params.body,
932
+ idempotent: false,
933
+ signal: options?.signal
934
+ })).results;
935
+ }
936
+ /**
937
+ * Disable workspace storage target
938
+ *
939
+ * Disable a customer storage target for future collection binds.
940
+ * @operationId workspaces.disableStorageTarget
941
+ * @endpoint DELETE /v1/workspaces/{workspace_id}/storage-targets/{target_id}
942
+ */
943
+ async disableStorageTarget(params, options) {
944
+ return (await this.core.request({
945
+ method: "DELETE",
946
+ path: "/v1/workspaces/{workspace_id}/storage-targets/{target_id}",
947
+ pathParams: {
948
+ workspace_id: params.workspaceId,
949
+ target_id: params.targetId
950
+ },
951
+ query: void 0,
952
+ idempotent: false,
953
+ signal: options?.signal
954
+ })).results;
955
+ }
956
+ /**
957
+ * List workspace storage targets
958
+ *
959
+ * List customer-owned object storage targets for a workspace.
960
+ * @operationId workspaces.listStorageTargets
961
+ * @endpoint GET /v1/workspaces/{workspace_id}/storage-targets
962
+ */
963
+ async listStorageTargets(workspaceId, options) {
964
+ return (await this.core.request({
965
+ method: "GET",
966
+ path: "/v1/workspaces/{workspace_id}/storage-targets",
967
+ pathParams: { workspace_id: workspaceId },
968
+ query: void 0,
969
+ idempotent: true,
970
+ signal: options?.signal
971
+ })).results;
972
+ }
973
+ /**
974
+ * Validate workspace storage target
975
+ *
976
+ * Probe a customer storage target and mark it active on success.
977
+ * @operationId workspaces.validateStorageTarget
978
+ * @endpoint POST /v1/workspaces/{workspace_id}/storage-targets/{target_id}/validate
979
+ */
980
+ async validateStorageTarget(params, options) {
981
+ return (await this.core.request({
982
+ method: "POST",
983
+ path: "/v1/workspaces/{workspace_id}/storage-targets/{target_id}/validate",
984
+ pathParams: {
985
+ workspace_id: params.workspaceId,
986
+ target_id: params.targetId
987
+ },
988
+ query: void 0,
989
+ idempotent: false,
990
+ signal: options?.signal
991
+ })).results;
992
+ }
993
+ };
994
+ //#endregion
938
995
  //#region src/client.ts
939
996
  var NebulaClient = class {
940
997
  core;
@@ -943,6 +1000,7 @@ var NebulaClient = class {
943
1000
  connectors;
944
1001
  memories;
945
1002
  snapshots;
1003
+ workspaces;
946
1004
  constructor(options = {}) {
947
1005
  this.core = new NebulaCore(options);
948
1006
  this.client = new ClientResource(this.core);
@@ -950,6 +1008,7 @@ var NebulaClient = class {
950
1008
  this.connectors = new ConnectorsResource(this.core);
951
1009
  this.memories = new MemoriesResource(this.core);
952
1010
  this.snapshots = new SnapshotsResource(this.core);
1011
+ this.workspaces = new WorkspacesResource(this.core);
953
1012
  }
954
1013
  };
955
1014
  //#endregion