@maximem/synap-js-sdk 0.4.6 → 0.4.7

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.cts CHANGED
@@ -597,6 +597,21 @@ interface CreateMemoryOptions {
597
597
  documentCreatedAt?: string | Date | null;
598
598
  mode?: IngestMode | string;
599
599
  metadata?: Json;
600
+ /**
601
+ * The level this memory belongs to, named in full, one entry per level down
602
+ * to it: `{ customer: "acme", team: "payments", user: "dana" }`.
603
+ *
604
+ * Only needed by an account whose scope ladder has a level between its
605
+ * customer and its user levels. `user_id` and `customer_id` cannot say which
606
+ * one a write belongs to, so on such a ladder the server refuses the write
607
+ * rather than guessing: a wrong guess at or above the customer level crosses
608
+ * a tenant boundary.
609
+ *
610
+ * Omit it and nothing changes. Sending one to an account without nested
611
+ * scoping is an error rather than ignored, because a caller who asks to be
612
+ * narrowed and is ignored gets widened instead.
613
+ */
614
+ scope?: Record<string, string> | null;
600
615
  }
601
616
  /**
602
617
  * Mirrors Python's `CreateMemoryResponse`.
@@ -672,6 +687,21 @@ interface CreateFromFileOptions {
672
687
  documentType?: string;
673
688
  mode?: IngestMode | string;
674
689
  metadata?: Json;
690
+ /**
691
+ * The level this memory belongs to, named in full, one entry per level down
692
+ * to it: `{ customer: "acme", team: "payments", user: "dana" }`.
693
+ *
694
+ * Only needed by an account whose scope ladder has a level between its
695
+ * customer and its user levels. `user_id` and `customer_id` cannot say which
696
+ * one a write belongs to, so on such a ladder the server refuses the write
697
+ * rather than guessing: a wrong guess at or above the customer level crosses
698
+ * a tenant boundary.
699
+ *
700
+ * Omit it and nothing changes. Sending one to an account without nested
701
+ * scoping is an error rather than ignored, because a caller who asks to be
702
+ * narrowed and is ignored gets widened instead.
703
+ */
704
+ scope?: Record<string, string> | null;
675
705
  }
676
706
  interface UpdateMemoryOptions {
677
707
  memory_id?: string;
package/dist/index.d.ts CHANGED
@@ -597,6 +597,21 @@ interface CreateMemoryOptions {
597
597
  documentCreatedAt?: string | Date | null;
598
598
  mode?: IngestMode | string;
599
599
  metadata?: Json;
600
+ /**
601
+ * The level this memory belongs to, named in full, one entry per level down
602
+ * to it: `{ customer: "acme", team: "payments", user: "dana" }`.
603
+ *
604
+ * Only needed by an account whose scope ladder has a level between its
605
+ * customer and its user levels. `user_id` and `customer_id` cannot say which
606
+ * one a write belongs to, so on such a ladder the server refuses the write
607
+ * rather than guessing: a wrong guess at or above the customer level crosses
608
+ * a tenant boundary.
609
+ *
610
+ * Omit it and nothing changes. Sending one to an account without nested
611
+ * scoping is an error rather than ignored, because a caller who asks to be
612
+ * narrowed and is ignored gets widened instead.
613
+ */
614
+ scope?: Record<string, string> | null;
600
615
  }
601
616
  /**
602
617
  * Mirrors Python's `CreateMemoryResponse`.
@@ -672,6 +687,21 @@ interface CreateFromFileOptions {
672
687
  documentType?: string;
673
688
  mode?: IngestMode | string;
674
689
  metadata?: Json;
690
+ /**
691
+ * The level this memory belongs to, named in full, one entry per level down
692
+ * to it: `{ customer: "acme", team: "payments", user: "dana" }`.
693
+ *
694
+ * Only needed by an account whose scope ladder has a level between its
695
+ * customer and its user levels. `user_id` and `customer_id` cannot say which
696
+ * one a write belongs to, so on such a ladder the server refuses the write
697
+ * rather than guessing: a wrong guess at or above the customer level crosses
698
+ * a tenant boundary.
699
+ *
700
+ * Omit it and nothing changes. Sending one to an account without nested
701
+ * scoping is an error rather than ignored, because a caller who asks to be
702
+ * narrowed and is ignored gets widened instead.
703
+ */
704
+ scope?: Record<string, string> | null;
675
705
  }
676
706
  interface UpdateMemoryOptions {
677
707
  memory_id?: string;
package/dist/index.js CHANGED
@@ -853,6 +853,10 @@ function buildCreateBody(options) {
853
853
  ),
854
854
  user_id: either(o2, "user_id", "userId") ?? null,
855
855
  customer_id: either(o2, "customer_id", "customerId") ?? null,
856
+ // null, never `{}`. An empty path is not absence: the server treats one as
857
+ // an error, because a caller asking to be narrowed and being ignored gets
858
+ // widened instead.
859
+ scope: options.scope ?? null,
856
860
  mode,
857
861
  metadata: options.metadata ?? {}
858
862
  };