@maximem/synap-js-sdk 0.4.5 → 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/anticipation-cache-ARYEEKMU.cjs.map +1 -1
- package/dist/chunk-2TVL5IPQ.cjs.map +1 -1
- package/dist/chunk-3JSE64GW.cjs.map +1 -1
- package/dist/chunk-RB57I2IQ.cjs.map +1 -1
- package/dist/chunk-ZKOJDUN4.cjs.map +1 -1
- package/dist/env-55ULHNJZ.cjs.map +1 -1
- package/dist/grpc/index.cjs.map +1 -1
- package/dist/index.cjs +4 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +36 -6
- package/dist/index.d.ts +36 -6
- package/dist/index.js +4 -0
- package/dist/index.js.map +1 -1
- package/dist/stream-client-PRTOH62B.cjs.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -1190,8 +1220,8 @@ interface SynapClientOptions {
|
|
|
1190
1220
|
* matching Python's `st_verbatim_overlay`. `SYNAP_ST_VERBATIM_OVERLAY`
|
|
1191
1221
|
* overrides this either way.
|
|
1192
1222
|
*/
|
|
1193
|
-
st_verbatim_overlay?: boolean;
|
|
1194
|
-
stVerbatimOverlay?: boolean;
|
|
1223
|
+
st_verbatim_overlay?: boolean | undefined;
|
|
1224
|
+
stVerbatimOverlay?: boolean | undefined;
|
|
1195
1225
|
/**
|
|
1196
1226
|
* Let the SDK answer `get_context_for_prompt` and `get_compacted` from its
|
|
1197
1227
|
* own short-term store when the conversation is warm, skipping the cloud
|
|
@@ -1200,13 +1230,13 @@ interface SynapClientOptions {
|
|
|
1200
1230
|
* This is the COST switch. `st_verbatim_overlay` is the correctness one and
|
|
1201
1231
|
* is independent of it.
|
|
1202
1232
|
*/
|
|
1203
|
-
sdk_st_authoritative?: boolean;
|
|
1204
|
-
sdkStAuthoritative?: boolean;
|
|
1233
|
+
sdk_st_authoritative?: boolean | undefined;
|
|
1234
|
+
sdkStAuthoritative?: boolean | undefined;
|
|
1205
1235
|
/**
|
|
1206
1236
|
* Where the SDK's diagnostics go. Defaults to `console.warn` prefixed with
|
|
1207
1237
|
* `[synap]`. Pass a no-op to silence them, or your own logger to route them.
|
|
1208
1238
|
*/
|
|
1209
|
-
logger?: SynapLogger;
|
|
1239
|
+
logger?: SynapLogger | undefined;
|
|
1210
1240
|
/**
|
|
1211
1241
|
* Bypass the process registry and build a genuinely separate client.
|
|
1212
1242
|
*
|
|
@@ -1241,7 +1271,7 @@ interface ConfigureOptions {
|
|
|
1241
1271
|
/** Accepted and ignored. Python-only. */
|
|
1242
1272
|
log_level?: string;
|
|
1243
1273
|
/** Replaces the diagnostic sink, same as the constructor option. */
|
|
1244
|
-
logger?: SynapLogger;
|
|
1274
|
+
logger?: SynapLogger | undefined;
|
|
1245
1275
|
}
|
|
1246
1276
|
/** Options for the cross-scope `fetch()`. Snake_case, matching Python's kwargs. */
|
|
1247
1277
|
interface UnifiedFetchOptions {
|
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;
|
|
@@ -1190,8 +1220,8 @@ interface SynapClientOptions {
|
|
|
1190
1220
|
* matching Python's `st_verbatim_overlay`. `SYNAP_ST_VERBATIM_OVERLAY`
|
|
1191
1221
|
* overrides this either way.
|
|
1192
1222
|
*/
|
|
1193
|
-
st_verbatim_overlay?: boolean;
|
|
1194
|
-
stVerbatimOverlay?: boolean;
|
|
1223
|
+
st_verbatim_overlay?: boolean | undefined;
|
|
1224
|
+
stVerbatimOverlay?: boolean | undefined;
|
|
1195
1225
|
/**
|
|
1196
1226
|
* Let the SDK answer `get_context_for_prompt` and `get_compacted` from its
|
|
1197
1227
|
* own short-term store when the conversation is warm, skipping the cloud
|
|
@@ -1200,13 +1230,13 @@ interface SynapClientOptions {
|
|
|
1200
1230
|
* This is the COST switch. `st_verbatim_overlay` is the correctness one and
|
|
1201
1231
|
* is independent of it.
|
|
1202
1232
|
*/
|
|
1203
|
-
sdk_st_authoritative?: boolean;
|
|
1204
|
-
sdkStAuthoritative?: boolean;
|
|
1233
|
+
sdk_st_authoritative?: boolean | undefined;
|
|
1234
|
+
sdkStAuthoritative?: boolean | undefined;
|
|
1205
1235
|
/**
|
|
1206
1236
|
* Where the SDK's diagnostics go. Defaults to `console.warn` prefixed with
|
|
1207
1237
|
* `[synap]`. Pass a no-op to silence them, or your own logger to route them.
|
|
1208
1238
|
*/
|
|
1209
|
-
logger?: SynapLogger;
|
|
1239
|
+
logger?: SynapLogger | undefined;
|
|
1210
1240
|
/**
|
|
1211
1241
|
* Bypass the process registry and build a genuinely separate client.
|
|
1212
1242
|
*
|
|
@@ -1241,7 +1271,7 @@ interface ConfigureOptions {
|
|
|
1241
1271
|
/** Accepted and ignored. Python-only. */
|
|
1242
1272
|
log_level?: string;
|
|
1243
1273
|
/** Replaces the diagnostic sink, same as the constructor option. */
|
|
1244
|
-
logger?: SynapLogger;
|
|
1274
|
+
logger?: SynapLogger | undefined;
|
|
1245
1275
|
}
|
|
1246
1276
|
/** Options for the cross-scope `fetch()`. Snake_case, matching Python's kwargs. */
|
|
1247
1277
|
interface UnifiedFetchOptions {
|
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
|
};
|