@maximem/synap-js-sdk 0.4.0 → 0.4.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/anticipation-cache-ARYEEKMU.cjs +10 -0
- package/dist/{anticipation-cache-JBZHTJ3O.cjs.map → anticipation-cache-ARYEEKMU.cjs.map} +1 -1
- package/dist/{anticipation-cache-BgkqcTPJ.d.cts → anticipation-cache-BMVF5sXb.d.cts} +10 -0
- package/dist/{anticipation-cache-BgkqcTPJ.d.ts → anticipation-cache-BMVF5sXb.d.ts} +10 -0
- package/dist/{anticipation-cache-D5YHEPV3.js → anticipation-cache-H7HEVWQC.js} +2 -2
- package/dist/{chunk-TCEP5OVR.js → chunk-6LDUDKHS.js} +33 -1
- package/dist/{chunk-TCEP5OVR.js.map → chunk-6LDUDKHS.js.map} +1 -1
- package/dist/{chunk-NIDPTBNC.cjs → chunk-RB57I2IQ.cjs} +33 -1
- package/dist/chunk-RB57I2IQ.cjs.map +1 -0
- package/dist/grpc/index.cjs +1 -1
- package/dist/grpc/index.d.cts +1 -1
- package/dist/grpc/index.d.ts +1 -1
- package/dist/grpc/index.js +1 -1
- package/dist/index.cjs +626 -35
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +26 -12
- package/dist/index.d.ts +26 -12
- package/dist/index.js +614 -23
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/dist/anticipation-cache-JBZHTJ3O.cjs +0 -10
- package/dist/chunk-NIDPTBNC.cjs.map +0 -1
- /package/dist/{anticipation-cache-D5YHEPV3.js.map → anticipation-cache-H7HEVWQC.js.map} +0 -0
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as AnticipationCacheSnapshot } from './anticipation-cache-
|
|
2
|
-
export { b as ANY_SCOPE, A as AnticipationCache, c as AnticipationCacheOptions, B as BundleItem, C as ContextBundle, E as ExitReason, L as LookupParams, d as LookupResult, e as LookupTelemetry, S as SnapshotBundle, f as SnapshotItemPreview, g as SnapshotItemRecord } from './anticipation-cache-
|
|
1
|
+
import { a as AnticipationCacheSnapshot } from './anticipation-cache-BMVF5sXb.cjs';
|
|
2
|
+
export { b as ANY_SCOPE, A as AnticipationCache, c as AnticipationCacheOptions, B as BundleItem, C as ContextBundle, E as ExitReason, L as LookupParams, d as LookupResult, e as LookupTelemetry, S as SnapshotBundle, f as SnapshotItemPreview, g as SnapshotItemRecord } from './anticipation-cache-BMVF5sXb.cjs';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AUTOGENERATED FROM synap/sdk/CONTRACT/endpoints.yaml -- DO NOT EDIT.
|
|
@@ -714,6 +714,16 @@ type WriteInvalidator = (ids: {
|
|
|
714
714
|
customerId?: string | undefined;
|
|
715
715
|
}) => void;
|
|
716
716
|
|
|
717
|
+
/**
|
|
718
|
+
* Scope-aware context fetching.
|
|
719
|
+
*
|
|
720
|
+
* Scopes are client > customer > user. `conversation_id` is NOT a tier: it
|
|
721
|
+
* groups turns within a scope. Passing it narrows an existing scope rather
|
|
722
|
+
* than selecting a different one.
|
|
723
|
+
*/
|
|
724
|
+
|
|
725
|
+
type Scope = 'user' | 'customer' | 'client' | 'conversation';
|
|
726
|
+
|
|
717
727
|
/** User namespace. Mirrors `UserInterface` in the Python SDK. */
|
|
718
728
|
|
|
719
729
|
interface UserNamespace {
|
|
@@ -846,6 +856,12 @@ interface InstanceNamespace {
|
|
|
846
856
|
/** @internal Shared with the conversation namespace so both use one stream. */
|
|
847
857
|
interface InstanceInternals {
|
|
848
858
|
onCompactionUpdate(conversationId: string, bundle: Record<string, unknown>): void;
|
|
859
|
+
/** Set by the client so a compaction can prune the locally buffered tail. */
|
|
860
|
+
setCompactionApplier(apply: (bundle: Record<string, unknown>) => void): void;
|
|
861
|
+
/** Learning-loop event, fired after a fetch is served from the cache. */
|
|
862
|
+
sendContextUsed(event: Record<string, unknown>): void;
|
|
863
|
+
/** Audit event, fired after every fetch resolves. */
|
|
864
|
+
sendContextAssembled(event: Record<string, unknown>): void;
|
|
849
865
|
setCompactionDispatcher(dispatch: (conversationId: string, bundle: Record<string, unknown>) => void): void;
|
|
850
866
|
isListening(): boolean;
|
|
851
867
|
}
|
|
@@ -979,6 +995,14 @@ interface SynapClientOptions {
|
|
|
979
995
|
*/
|
|
980
996
|
heartbeat?: boolean;
|
|
981
997
|
fetchImpl?: typeof fetch;
|
|
998
|
+
/**
|
|
999
|
+
* Bypass the process registry and build a genuinely separate client.
|
|
1000
|
+
*
|
|
1001
|
+
* Underscored because it mirrors Python's `_force_new` and is not part of the
|
|
1002
|
+
* everyday surface. Needed in tests, and for the rare case of deliberately
|
|
1003
|
+
* running two clients on one identity with separate caches.
|
|
1004
|
+
*/
|
|
1005
|
+
_force_new?: boolean;
|
|
982
1006
|
}
|
|
983
1007
|
interface ScopedContext {
|
|
984
1008
|
context: {
|
|
@@ -1310,16 +1334,6 @@ declare const TransientError: typeof SynapTransientError;
|
|
|
1310
1334
|
declare const PermanentError: typeof SynapPermanentError;
|
|
1311
1335
|
declare const ConnectionError: typeof NetworkTimeoutError;
|
|
1312
1336
|
|
|
1313
|
-
/**
|
|
1314
|
-
* Scope-aware context fetching.
|
|
1315
|
-
*
|
|
1316
|
-
* Scopes are client > customer > user. `conversation_id` is NOT a tier: it
|
|
1317
|
-
* groups turns within a scope. Passing it narrows an existing scope rather
|
|
1318
|
-
* than selecting a different one.
|
|
1319
|
-
*/
|
|
1320
|
-
|
|
1321
|
-
type Scope = 'user' | 'customer' | 'client' | 'conversation';
|
|
1322
|
-
|
|
1323
1337
|
/**
|
|
1324
1338
|
* BM25 scorer for the anticipation cache.
|
|
1325
1339
|
*
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { a as AnticipationCacheSnapshot } from './anticipation-cache-
|
|
2
|
-
export { b as ANY_SCOPE, A as AnticipationCache, c as AnticipationCacheOptions, B as BundleItem, C as ContextBundle, E as ExitReason, L as LookupParams, d as LookupResult, e as LookupTelemetry, S as SnapshotBundle, f as SnapshotItemPreview, g as SnapshotItemRecord } from './anticipation-cache-
|
|
1
|
+
import { a as AnticipationCacheSnapshot } from './anticipation-cache-BMVF5sXb.js';
|
|
2
|
+
export { b as ANY_SCOPE, A as AnticipationCache, c as AnticipationCacheOptions, B as BundleItem, C as ContextBundle, E as ExitReason, L as LookupParams, d as LookupResult, e as LookupTelemetry, S as SnapshotBundle, f as SnapshotItemPreview, g as SnapshotItemRecord } from './anticipation-cache-BMVF5sXb.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AUTOGENERATED FROM synap/sdk/CONTRACT/endpoints.yaml -- DO NOT EDIT.
|
|
@@ -714,6 +714,16 @@ type WriteInvalidator = (ids: {
|
|
|
714
714
|
customerId?: string | undefined;
|
|
715
715
|
}) => void;
|
|
716
716
|
|
|
717
|
+
/**
|
|
718
|
+
* Scope-aware context fetching.
|
|
719
|
+
*
|
|
720
|
+
* Scopes are client > customer > user. `conversation_id` is NOT a tier: it
|
|
721
|
+
* groups turns within a scope. Passing it narrows an existing scope rather
|
|
722
|
+
* than selecting a different one.
|
|
723
|
+
*/
|
|
724
|
+
|
|
725
|
+
type Scope = 'user' | 'customer' | 'client' | 'conversation';
|
|
726
|
+
|
|
717
727
|
/** User namespace. Mirrors `UserInterface` in the Python SDK. */
|
|
718
728
|
|
|
719
729
|
interface UserNamespace {
|
|
@@ -846,6 +856,12 @@ interface InstanceNamespace {
|
|
|
846
856
|
/** @internal Shared with the conversation namespace so both use one stream. */
|
|
847
857
|
interface InstanceInternals {
|
|
848
858
|
onCompactionUpdate(conversationId: string, bundle: Record<string, unknown>): void;
|
|
859
|
+
/** Set by the client so a compaction can prune the locally buffered tail. */
|
|
860
|
+
setCompactionApplier(apply: (bundle: Record<string, unknown>) => void): void;
|
|
861
|
+
/** Learning-loop event, fired after a fetch is served from the cache. */
|
|
862
|
+
sendContextUsed(event: Record<string, unknown>): void;
|
|
863
|
+
/** Audit event, fired after every fetch resolves. */
|
|
864
|
+
sendContextAssembled(event: Record<string, unknown>): void;
|
|
849
865
|
setCompactionDispatcher(dispatch: (conversationId: string, bundle: Record<string, unknown>) => void): void;
|
|
850
866
|
isListening(): boolean;
|
|
851
867
|
}
|
|
@@ -979,6 +995,14 @@ interface SynapClientOptions {
|
|
|
979
995
|
*/
|
|
980
996
|
heartbeat?: boolean;
|
|
981
997
|
fetchImpl?: typeof fetch;
|
|
998
|
+
/**
|
|
999
|
+
* Bypass the process registry and build a genuinely separate client.
|
|
1000
|
+
*
|
|
1001
|
+
* Underscored because it mirrors Python's `_force_new` and is not part of the
|
|
1002
|
+
* everyday surface. Needed in tests, and for the rare case of deliberately
|
|
1003
|
+
* running two clients on one identity with separate caches.
|
|
1004
|
+
*/
|
|
1005
|
+
_force_new?: boolean;
|
|
982
1006
|
}
|
|
983
1007
|
interface ScopedContext {
|
|
984
1008
|
context: {
|
|
@@ -1310,16 +1334,6 @@ declare const TransientError: typeof SynapTransientError;
|
|
|
1310
1334
|
declare const PermanentError: typeof SynapPermanentError;
|
|
1311
1335
|
declare const ConnectionError: typeof NetworkTimeoutError;
|
|
1312
1336
|
|
|
1313
|
-
/**
|
|
1314
|
-
* Scope-aware context fetching.
|
|
1315
|
-
*
|
|
1316
|
-
* Scopes are client > customer > user. `conversation_id` is NOT a tier: it
|
|
1317
|
-
* groups turns within a scope. Passing it narrows an existing scope rather
|
|
1318
|
-
* than selecting a different one.
|
|
1319
|
-
*/
|
|
1320
|
-
|
|
1321
|
-
type Scope = 'user' | 'customer' | 'client' | 'conversation';
|
|
1322
|
-
|
|
1323
1337
|
/**
|
|
1324
1338
|
* BM25 scorer for the anticipation cache.
|
|
1325
1339
|
*
|