@maximem/synap-js-sdk 0.6.4 → 0.6.6
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-Q7IYC3ID.cjs +26 -0
- package/dist/anticipation-cache-Q7IYC3ID.cjs.map +1 -0
- package/dist/{anticipation-cache-RWKF55J4.js → anticipation-cache-VL5WHTJB.js} +8 -2
- package/dist/chunk-7IZHVYO2.cjs.map +1 -1
- package/dist/{chunk-ICUFS3B5.cjs → chunk-BYUGILQI.cjs} +136 -142
- package/dist/chunk-BYUGILQI.cjs.map +1 -0
- package/dist/{chunk-R72YL6Q4.js → chunk-CSG3N5E3.js} +136 -142
- package/dist/chunk-CSG3N5E3.js.map +1 -0
- package/dist/{chunk-2VJV4HCF.cjs → chunk-PYJOWTI5.cjs} +72 -20
- package/dist/chunk-PYJOWTI5.cjs.map +1 -0
- package/dist/{chunk-N55UBGER.js → chunk-VCCZ33ZU.js} +59 -7
- package/dist/chunk-VCCZ33ZU.js.map +1 -0
- package/dist/chunk-ZKOJDUN4.cjs.map +1 -1
- package/dist/env-55ULHNJZ.cjs.map +1 -1
- package/dist/{errors-DWjdpExq.d.cts → errors-x5bpgxmC.d.cts} +18 -3
- package/dist/{errors-DWjdpExq.d.ts → errors-x5bpgxmC.d.ts} +18 -3
- package/dist/grpc/index.cjs +4 -4
- package/dist/grpc/index.cjs.map +1 -1
- package/dist/grpc/index.d.cts +11 -3
- package/dist/grpc/index.d.ts +11 -3
- package/dist/grpc/index.js +3 -3
- package/dist/index.cjs +906 -185
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +242 -20
- package/dist/index.d.ts +242 -20
- package/dist/index.js +826 -105
- package/dist/index.js.map +1 -1
- package/dist/onnx-encoder-4RSL6ID4.cjs.map +1 -1
- package/dist/stream-client-BY5LNLVB.cjs +22 -0
- package/dist/stream-client-BY5LNLVB.cjs.map +1 -0
- package/dist/{stream-client-GRDVRBFA.js → stream-client-JKFBVZPN.js} +2 -2
- package/package.json +1 -1
- package/dist/anticipation-cache-LPNKMRBH.cjs +0 -20
- package/dist/anticipation-cache-LPNKMRBH.cjs.map +0 -1
- package/dist/chunk-2VJV4HCF.cjs.map +0 -1
- package/dist/chunk-ICUFS3B5.cjs.map +0 -1
- package/dist/chunk-N55UBGER.js.map +0 -1
- package/dist/chunk-R72YL6Q4.js.map +0 -1
- package/dist/stream-client-SZIYGVVJ.cjs +0 -22
- package/dist/stream-client-SZIYGVVJ.cjs.map +0 -1
- /package/dist/{anticipation-cache-RWKF55J4.js.map → anticipation-cache-VL5WHTJB.js.map} +0 -0
- /package/dist/{stream-client-GRDVRBFA.js.map → stream-client-JKFBVZPN.js.map} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { E as Encoder, a as AnticipationCacheSnapshot } from './errors-
|
|
2
|
-
export { b as ANY_SCOPE, c as AgentUnavailableError, A as AnticipationCache, d as AnticipationCacheOptions, e as AuthenticationError, B as BundleItem, C as ConflictError, f as ConnectionError, g as ContextBundle, h as ContextNotFoundError, i as CustomerIdNotAcceptedError, j as ExitReason, I as InstanceBuildFailedError, k as InstanceNotReadyError, l as InsufficientCreditsError, m as InvalidConversationIdError, n as InvalidInputError, o as InvalidInstanceIdError, L as ListeningAlreadyActiveError, p as ListeningNotActiveError, q as LookupParams, r as LookupResult, s as LookupTelemetry, N as NetworkTimeoutError, P as PermanentError, R as RateLimitError, t as SDKError, u as ServiceUnavailableError, v as SessionExpiredError, w as SnapshotBundle, x as SnapshotItemPreview, y as SnapshotItemRecord,
|
|
1
|
+
import { S as SynapError, E as Encoder, a as AnticipationCacheSnapshot } from './errors-x5bpgxmC.js';
|
|
2
|
+
export { b as ANY_SCOPE, c as AgentUnavailableError, A as AnticipationCache, d as AnticipationCacheOptions, e as AuthenticationError, B as BundleItem, C as ConflictError, f as ConnectionError, g as ContextBundle, h as ContextNotFoundError, i as CustomerIdNotAcceptedError, j as ExitReason, I as InstanceBuildFailedError, k as InstanceNotReadyError, l as InsufficientCreditsError, m as InvalidConversationIdError, n as InvalidInputError, o as InvalidInstanceIdError, L as ListeningAlreadyActiveError, p as ListeningNotActiveError, q as LookupParams, r as LookupResult, s as LookupTelemetry, N as NetworkTimeoutError, P as PermanentError, R as RateLimitError, t as SDKError, u as ServiceUnavailableError, v as SessionExpiredError, w as SnapshotBundle, x as SnapshotItemPreview, y as SnapshotItemRecord, z as SynapErrorCode, D as SynapErrorOptions, F as SynapPermanentError, G as SynapTransientError, T as TranscriptConflictError, H as TransientError, J as isSynapError } from './errors-x5bpgxmC.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* AUTOGENERATED FROM synap/sdk/CONTRACT/endpoints.yaml -- DO NOT EDIT.
|
|
@@ -40,6 +40,11 @@ declare const ENDPOINTS: {
|
|
|
40
40
|
readonly path: "/api/v1/memories/upload";
|
|
41
41
|
readonly idempotent: false;
|
|
42
42
|
};
|
|
43
|
+
readonly memories_create_multipart: {
|
|
44
|
+
readonly method: "POST";
|
|
45
|
+
readonly path: "/api/v1/memories/create-multipart";
|
|
46
|
+
readonly idempotent: false;
|
|
47
|
+
};
|
|
43
48
|
readonly memories_status: {
|
|
44
49
|
readonly method: "GET";
|
|
45
50
|
readonly path: "/api/v1/memories/status/{ingestion_id}";
|
|
@@ -65,6 +70,16 @@ declare const ENDPOINTS: {
|
|
|
65
70
|
readonly path: "/api/v1/memories/forget";
|
|
66
71
|
readonly idempotent: false;
|
|
67
72
|
};
|
|
73
|
+
readonly data_delete: {
|
|
74
|
+
readonly method: "POST";
|
|
75
|
+
readonly path: "/v1/data/delete";
|
|
76
|
+
readonly idempotent: true;
|
|
77
|
+
};
|
|
78
|
+
readonly data_delete_status: {
|
|
79
|
+
readonly method: "GET";
|
|
80
|
+
readonly path: "/v1/data/delete/{deletion_id}";
|
|
81
|
+
readonly idempotent: true;
|
|
82
|
+
};
|
|
68
83
|
readonly context_fetch_user: {
|
|
69
84
|
readonly method: "POST";
|
|
70
85
|
readonly path: "/v1/context/user/fetch";
|
|
@@ -290,6 +305,12 @@ interface RequestOptions {
|
|
|
290
305
|
correlationId?: string;
|
|
291
306
|
/** Overrides the endpoint's declared idempotency. */
|
|
292
307
|
idempotent?: boolean;
|
|
308
|
+
/**
|
|
309
|
+
* Re-map an HTTP error for this one call, given the status. Returns the
|
|
310
|
+
* error to throw instead, or undefined to keep it. Applied before the retry
|
|
311
|
+
* decision, so the retry policy sees what the caller will.
|
|
312
|
+
*/
|
|
313
|
+
mapError?: (status: number, error: SynapError) => SynapError | undefined;
|
|
293
314
|
signal?: AbortSignal;
|
|
294
315
|
}
|
|
295
316
|
declare class HttpTransport {
|
|
@@ -305,6 +326,14 @@ declare class HttpTransport {
|
|
|
305
326
|
private readonly clock;
|
|
306
327
|
private readonly notReadyCooldown;
|
|
307
328
|
constructor(options: HttpTransportOptions);
|
|
329
|
+
/**
|
|
330
|
+
* @internal Fetch a URL that is not Synap's, with this transport's fetch.
|
|
331
|
+
*
|
|
332
|
+
* Used to read a `FilePart` given by `url`: the SDK fetches it, the server
|
|
333
|
+
* never does. Deliberately sends none of this transport's headers, because
|
|
334
|
+
* the URL belongs to somebody else and the API key must not reach them.
|
|
335
|
+
*/
|
|
336
|
+
fetchExternal(url: string, init?: RequestInit): Promise<Response>;
|
|
308
337
|
/** Start keeping the connection warm. Opt-in: it is pointless in serverless. */
|
|
309
338
|
startHeartbeat(): void;
|
|
310
339
|
/**
|
|
@@ -727,6 +756,87 @@ interface FlatMemory {
|
|
|
727
756
|
}
|
|
728
757
|
declare function flattenContextItems(context: RawContext): FlatMemory[];
|
|
729
758
|
|
|
759
|
+
/**
|
|
760
|
+
* Content parts: text and files (today, images) carried by `memories.create`,
|
|
761
|
+
* `conversation.record_message` and `instance.send_message`.
|
|
762
|
+
*
|
|
763
|
+
* Mirrors `TextPart`, `FilePart` and `AttachmentResult` in the Python SDK.
|
|
764
|
+
*
|
|
765
|
+
* ## A text-only list is a string
|
|
766
|
+
*
|
|
767
|
+
* Every existing call has to keep sending exactly the bytes it sends today, so
|
|
768
|
+
* a list with no file in it is joined with `"\n"` and sent as that one string,
|
|
769
|
+
* down the same route a string always took. Only a file changes the shape of a
|
|
770
|
+
* request.
|
|
771
|
+
*
|
|
772
|
+
* ## Runs everywhere
|
|
773
|
+
*
|
|
774
|
+
* Nothing here imports a node builtin at the top level. Reading a `path` uses a
|
|
775
|
+
* lazy `import('node:fs/promises')`, the same as `create_from_file`, and base64
|
|
776
|
+
* uses `Buffer` when the runtime has it and `btoa` when it does not, so the main
|
|
777
|
+
* entry stays safe on Edge, Workers and in a browser.
|
|
778
|
+
*/
|
|
779
|
+
/**
|
|
780
|
+
* What the caller is asking a memory to do. Stored with the ingestion as
|
|
781
|
+
* metadata; any other string is accepted too. Mirrors Python's `OBJECTIVES`.
|
|
782
|
+
*/
|
|
783
|
+
declare const OBJECTIVES: readonly ["conversation", "bootstrap", "knowledge-base", "record", "profile"];
|
|
784
|
+
type Objective = (typeof OBJECTIVES)[number];
|
|
785
|
+
/** Raw bytes for a `FilePart`. A Node `Buffer` is a `Uint8Array`. */
|
|
786
|
+
type FileData = Uint8Array | ArrayBuffer | Blob;
|
|
787
|
+
interface TextPart {
|
|
788
|
+
type: 'text';
|
|
789
|
+
text: string;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* A file. Exactly one of `data`, `path` or `url`.
|
|
793
|
+
*
|
|
794
|
+
* Build one with `filePart()`, which fills `filename` and `media_type`. A
|
|
795
|
+
* literal `{ type: 'file', ... }` works too; the same defaults are applied when
|
|
796
|
+
* it is sent.
|
|
797
|
+
*/
|
|
798
|
+
interface FilePart {
|
|
799
|
+
type: 'file';
|
|
800
|
+
data?: FileData;
|
|
801
|
+
/** Node only: read from disk when the call is made. */
|
|
802
|
+
path?: string;
|
|
803
|
+
/** Fetched by the SDK when the call is made (30 s, at most 10 MB). */
|
|
804
|
+
url?: string;
|
|
805
|
+
/** Defaults to the basename of `path` or `url`, else `"file"`. */
|
|
806
|
+
filename?: string;
|
|
807
|
+
/** Defaults to a guess from `filename`, else `"application/octet-stream"`. */
|
|
808
|
+
media_type?: string;
|
|
809
|
+
}
|
|
810
|
+
interface FilePartInit {
|
|
811
|
+
data?: FileData | null;
|
|
812
|
+
path?: string | null;
|
|
813
|
+
url?: string | null;
|
|
814
|
+
filename?: string | null;
|
|
815
|
+
media_type?: string | null;
|
|
816
|
+
mediaType?: string | null;
|
|
817
|
+
}
|
|
818
|
+
/** One item of a content list. A bare string is a text part. */
|
|
819
|
+
type ContentPart = string | TextPart | FilePart;
|
|
820
|
+
/**
|
|
821
|
+
* What the server did with one file of a `memories.create` call, in the order
|
|
822
|
+
* the files were sent. Mirrors Python's `AttachmentResult`.
|
|
823
|
+
*/
|
|
824
|
+
interface AttachmentResult {
|
|
825
|
+
filename: string;
|
|
826
|
+
media_type: string;
|
|
827
|
+
status: 'read' | 'failed' | string;
|
|
828
|
+
error?: string | null;
|
|
829
|
+
}
|
|
830
|
+
/** `{ type: 'text', text }`. Mirrors Python's `TextPart(text)`. */
|
|
831
|
+
declare function textPart(text: string): TextPart;
|
|
832
|
+
/**
|
|
833
|
+
* A file part with its defaults filled in. Mirrors Python's `FilePart(...)`.
|
|
834
|
+
*
|
|
835
|
+
* Throws `InvalidInputError` unless exactly one of `data`, `path` or `url` is
|
|
836
|
+
* given.
|
|
837
|
+
*/
|
|
838
|
+
declare function filePart(init: FilePartInit): FilePart;
|
|
839
|
+
|
|
730
840
|
/**
|
|
731
841
|
* Memories namespace. Mirrors `maximem_synap.memories.interface.MemoriesInterface`.
|
|
732
842
|
*
|
|
@@ -754,8 +864,17 @@ declare const INGEST_MODES: readonly ["fast", "long-range"];
|
|
|
754
864
|
type IngestMode = (typeof INGEST_MODES)[number];
|
|
755
865
|
declare const DEFAULT_DOCUMENT_TYPE: DocumentType;
|
|
756
866
|
declare const DEFAULT_INGEST_MODE: IngestMode;
|
|
867
|
+
/**
|
|
868
|
+
* What `memories.create` takes as `document`. Mirrors Python's
|
|
869
|
+
* `Union[str, Dict[str, Any], TextPart, FilePart, List[Union[str, TextPart, FilePart]]]`.
|
|
870
|
+
*
|
|
871
|
+
* A string, a dict, a `TextPart` or a list with no file in it is sent as JSON
|
|
872
|
+
* to `/create`, byte for byte as a string always was (a list is joined with
|
|
873
|
+
* `"\n"`). Any `FilePart` sends the call as multipart to `/create-multipart`.
|
|
874
|
+
*/
|
|
875
|
+
type CreateDocument = string | Record<string, unknown> | TextPart | FilePart | Array<string | TextPart | FilePart>;
|
|
757
876
|
interface CreateMemoryOptions {
|
|
758
|
-
document:
|
|
877
|
+
document: CreateDocument;
|
|
759
878
|
user_id?: string | null;
|
|
760
879
|
userId?: string | null;
|
|
761
880
|
customer_id?: string | null;
|
|
@@ -784,6 +903,12 @@ interface CreateMemoryOptions {
|
|
|
784
903
|
* narrowed and is ignored gets widened instead.
|
|
785
904
|
*/
|
|
786
905
|
scope?: Record<string, string> | null;
|
|
906
|
+
/**
|
|
907
|
+
* What this memory is for. One of `OBJECTIVES` (`conversation`, `bootstrap`,
|
|
908
|
+
* `knowledge-base`, `record`, `profile`) or free text, at most 500
|
|
909
|
+
* characters. Sent only when set, so a call without it is unchanged.
|
|
910
|
+
*/
|
|
911
|
+
objective?: Objective | string | null;
|
|
787
912
|
}
|
|
788
913
|
/**
|
|
789
914
|
* Mirrors Python's `CreateMemoryResponse`.
|
|
@@ -802,6 +927,12 @@ interface CreateMemoryResult {
|
|
|
802
927
|
queued_at: string;
|
|
803
928
|
error_message?: string | null;
|
|
804
929
|
memories_created?: number;
|
|
930
|
+
/**
|
|
931
|
+
* One per file part, in order, when the call carried files. Absent
|
|
932
|
+
* otherwise. A file that could not be read is still `failed` here while the
|
|
933
|
+
* rest of the document was ingested.
|
|
934
|
+
*/
|
|
935
|
+
attachments?: AttachmentResult[] | null;
|
|
805
936
|
[key: string]: unknown;
|
|
806
937
|
}
|
|
807
938
|
/**
|
|
@@ -839,6 +970,19 @@ interface ForgetOptions {
|
|
|
839
970
|
scope?: Record<string, string> | null;
|
|
840
971
|
/** `"preview"` (default) or `"direct"`. See `MemoriesInterface.forget`. */
|
|
841
972
|
mode?: ForgetMode | string;
|
|
973
|
+
/**
|
|
974
|
+
* The conversation this request is made in (1 to 200 characters). Used only
|
|
975
|
+
* by `mode: "direct"`. Pass it when you record the conversation through the
|
|
976
|
+
* SDK's listening stream (gRPC): messages on that path are saved in batches,
|
|
977
|
+
* so what the user just said may not exist as a memory yet. With the id, the
|
|
978
|
+
* request also stays open until the batch of that conversation that holds it
|
|
979
|
+
* has been saved and checked, whether or not the search finds something now,
|
|
980
|
+
* and removes what it describes then (`retry_scheduled` is true). Without it,
|
|
981
|
+
* the request is answered once (`nothing_matches` if nothing is found) and
|
|
982
|
+
* nothing waits. Not needed for `memories.create()`.
|
|
983
|
+
*/
|
|
984
|
+
conversation_id?: string | null;
|
|
985
|
+
conversationId?: string | null;
|
|
842
986
|
}
|
|
843
987
|
/** A memory the description matched. Mirrors Python's `ForgetCandidate`. */
|
|
844
988
|
interface ForgetCandidate {
|
|
@@ -858,6 +1002,13 @@ interface ForgetResult {
|
|
|
858
1002
|
failed_ids: string[];
|
|
859
1003
|
still_present_in: string[];
|
|
860
1004
|
may_be_incomplete: boolean;
|
|
1005
|
+
/**
|
|
1006
|
+
* True when a `direct` request named its `conversation_id` and stays open until
|
|
1007
|
+
* the batch of that conversation that holds it has been saved and checked,
|
|
1008
|
+
* whether or not the search found something now. Absent from servers that
|
|
1009
|
+
* predate it; read it as false.
|
|
1010
|
+
*/
|
|
1011
|
+
retry_scheduled?: boolean;
|
|
861
1012
|
}
|
|
862
1013
|
interface MemoriesInterface {
|
|
863
1014
|
create(options: CreateMemoryOptions): Promise<CreateMemoryResult>;
|
|
@@ -980,7 +1131,13 @@ interface RecordMessageOptions {
|
|
|
980
1131
|
conversation_id?: string;
|
|
981
1132
|
conversationId?: string;
|
|
982
1133
|
role: string;
|
|
983
|
-
|
|
1134
|
+
/**
|
|
1135
|
+
* The message. A string, or a list of strings, `TextPart`s and `FilePart`s
|
|
1136
|
+
* (images today). A list with no file is joined with `"\n"` and sent as that
|
|
1137
|
+
* string. With a file, the parts are sent in order with each file inline as
|
|
1138
|
+
* base64; the server reads the images and stores the message as text.
|
|
1139
|
+
*/
|
|
1140
|
+
content: string | ContentPart[];
|
|
984
1141
|
user_id?: string;
|
|
985
1142
|
userId?: string;
|
|
986
1143
|
customer_id?: string;
|
|
@@ -1134,6 +1291,76 @@ type WriteInvalidator = (ids: {
|
|
|
1134
1291
|
customerId?: string | undefined;
|
|
1135
1292
|
}) => void;
|
|
1136
1293
|
|
|
1294
|
+
/**
|
|
1295
|
+
* Data namespace. Mirrors `maximem_synap.data.interface.DataInterface`.
|
|
1296
|
+
*
|
|
1297
|
+
* Delete personal data by scope (user, conversation, customer). Validation
|
|
1298
|
+
* messages are identical to Python's, and the body has the same keys in the
|
|
1299
|
+
* same order, nulls included.
|
|
1300
|
+
*/
|
|
1301
|
+
|
|
1302
|
+
declare const DATA_SCOPES: readonly ["user", "conversation", "customer"];
|
|
1303
|
+
type DataScope = (typeof DATA_SCOPES)[number];
|
|
1304
|
+
interface DeleteDataOptions {
|
|
1305
|
+
/** `"user"`, `"conversation"` or `"customer"`. Client-wide delete is not supported. */
|
|
1306
|
+
scope: DataScope | string;
|
|
1307
|
+
user_id?: string | null;
|
|
1308
|
+
userId?: string | null;
|
|
1309
|
+
customer_id?: string | null;
|
|
1310
|
+
customerId?: string | null;
|
|
1311
|
+
conversation_id?: string | null;
|
|
1312
|
+
conversationId?: string | null;
|
|
1313
|
+
/** Count what would be removed and change nothing. No `confirm` needed. */
|
|
1314
|
+
dry_run?: boolean;
|
|
1315
|
+
dryRun?: boolean;
|
|
1316
|
+
/** Required unless `dryRun`. Must equal the id of the scope being deleted. */
|
|
1317
|
+
confirm?: string | null;
|
|
1318
|
+
/** Repeat the call while the server says `continue` (default true, max 50 calls). */
|
|
1319
|
+
wait?: boolean;
|
|
1320
|
+
}
|
|
1321
|
+
/** Result of `data.delete` / `data.status`. Mirrors Python's `DeleteDataResult`. */
|
|
1322
|
+
interface DeleteDataResult {
|
|
1323
|
+
deletion_id: string | null;
|
|
1324
|
+
/** `complete`, `partial`, `in_progress` or `dry_run`. */
|
|
1325
|
+
status: string;
|
|
1326
|
+
scope: string | null;
|
|
1327
|
+
dry_run: boolean;
|
|
1328
|
+
found: boolean;
|
|
1329
|
+
counts: Record<string, unknown>;
|
|
1330
|
+
stores: Record<string, unknown>;
|
|
1331
|
+
still_present_in: string[];
|
|
1332
|
+
fully_removed: boolean;
|
|
1333
|
+
/** True when the server's size cap stopped the call. */
|
|
1334
|
+
continue: boolean;
|
|
1335
|
+
kept: string[];
|
|
1336
|
+
note: string | null;
|
|
1337
|
+
memories_kept: boolean;
|
|
1338
|
+
audit: string | null;
|
|
1339
|
+
/** What the SDK cleared on this machine after the server finished. */
|
|
1340
|
+
local_cleared: string[];
|
|
1341
|
+
[key: string]: unknown;
|
|
1342
|
+
}
|
|
1343
|
+
interface DataInterface {
|
|
1344
|
+
/**
|
|
1345
|
+
* Delete data for one user, one conversation or one customer. Permanent.
|
|
1346
|
+
* scope 'conversation' removes turns, summaries, telemetry and the turn buffer ONLY;
|
|
1347
|
+
* memories learned from it are kept (use scope 'user' or memories.delete). Data in
|
|
1348
|
+
* another instance is never touched; stores that cannot be scoped by instance are
|
|
1349
|
+
* skipped and named in still_present_in.
|
|
1350
|
+
*
|
|
1351
|
+
* scope 'customer' needs a management key (management:* or *); a runtime key gets 403.
|
|
1352
|
+
* LLM call traces are not removed (llm_call_bodies up to 14 days, llm_calls up to 180 days).
|
|
1353
|
+
*
|
|
1354
|
+
* A store that could not be cleared is in `still_present_in` and
|
|
1355
|
+
* `fully_removed` is false; it is a result, not an exception. Errors:
|
|
1356
|
+
* `InvalidInputError` (bad arguments, caught before any request, or 400),
|
|
1357
|
+
* `AuthenticationError` (401/403), `ConflictError` (409), `RateLimitError`.
|
|
1358
|
+
*/
|
|
1359
|
+
delete(options: DeleteDataOptions): Promise<DeleteDataResult>;
|
|
1360
|
+
/** The audit record of a delete (status, counts, still_present_in). */
|
|
1361
|
+
status(deletionId: string): Promise<DeleteDataResult>;
|
|
1362
|
+
}
|
|
1363
|
+
|
|
1137
1364
|
/** User namespace. Mirrors `UserInterface` in the Python SDK. */
|
|
1138
1365
|
|
|
1139
1366
|
interface UserNamespace {
|
|
@@ -1284,7 +1511,14 @@ interface ListenOptions {
|
|
|
1284
1511
|
useTls?: boolean;
|
|
1285
1512
|
}
|
|
1286
1513
|
interface SendMessageOptions {
|
|
1287
|
-
|
|
1514
|
+
/**
|
|
1515
|
+
* A string, or a list of strings, `TextPart`s and `FilePart`s (images). A
|
|
1516
|
+
* list with no file is joined with `"\n"`. With a file, the parts go in
|
|
1517
|
+
* `metadata.synap_content_parts` (images inline as base64, at most 2.5 MB of
|
|
1518
|
+
* raw image bytes per event) and `content` becomes the placeholder text,
|
|
1519
|
+
* each image as `[image: <filename>]`.
|
|
1520
|
+
*/
|
|
1521
|
+
content: string | ContentPart[];
|
|
1288
1522
|
role?: string;
|
|
1289
1523
|
conversation_id?: string;
|
|
1290
1524
|
conversationId?: string;
|
|
@@ -1734,6 +1968,7 @@ declare class SynapClient {
|
|
|
1734
1968
|
readonly client: ScopedContext;
|
|
1735
1969
|
readonly conversation: ConversationNamespace;
|
|
1736
1970
|
readonly memories: MemoriesInterface;
|
|
1971
|
+
readonly data: DataInterface;
|
|
1737
1972
|
readonly credits: CreditsNamespace;
|
|
1738
1973
|
readonly cache: CacheNamespace;
|
|
1739
1974
|
readonly instance: InstanceNamespace;
|
|
@@ -1907,7 +2142,7 @@ declare class SynapClient {
|
|
|
1907
2142
|
* build when the two disagree, which is the only thing that makes a manual
|
|
1908
2143
|
* publish safe.
|
|
1909
2144
|
*/
|
|
1910
|
-
declare const SDK_VERSION = "0.6.
|
|
2145
|
+
declare const SDK_VERSION = "0.6.6";
|
|
1911
2146
|
|
|
1912
2147
|
/**
|
|
1913
2148
|
* `response_shape: "ranked"`: one list in the order the server ranked it.
|
|
@@ -1999,19 +2234,8 @@ declare class BM25 {
|
|
|
1999
2234
|
* survive. It is the same failure mode as `@grpc/proto-loader` reading a
|
|
2000
2235
|
* `.proto` off disk (gotcha G-P).
|
|
2001
2236
|
*/
|
|
2002
|
-
interface RecallPattern {
|
|
2003
|
-
pattern: string;
|
|
2004
|
-
flags: string;
|
|
2005
|
-
note: string;
|
|
2006
|
-
}
|
|
2007
2237
|
interface BehaviorContract {
|
|
2008
2238
|
version: number;
|
|
2009
|
-
recall_bypass: {
|
|
2010
|
-
note: string;
|
|
2011
|
-
env_flag: string;
|
|
2012
|
-
default: boolean;
|
|
2013
|
-
patterns: RecallPattern[];
|
|
2014
|
-
};
|
|
2015
2239
|
thresholds: {
|
|
2016
2240
|
bm25: {
|
|
2017
2241
|
value: number;
|
|
@@ -2121,8 +2345,6 @@ declare const THRESHOLDS: {
|
|
|
2121
2345
|
/** Points of score allowed per query token when deriving the threshold. */
|
|
2122
2346
|
readonly queryTokenScale: number;
|
|
2123
2347
|
};
|
|
2124
|
-
/** True when any query string looks like an explicit memory-recall ask. */
|
|
2125
|
-
declare function isRecallQuery(searchQuery: readonly (string | null | undefined)[] | null | undefined): boolean;
|
|
2126
2348
|
|
|
2127
2349
|
/**
|
|
2128
2350
|
* @maximem/synap-js-sdk
|
|
@@ -2161,4 +2383,4 @@ interface SynapSdkLike {
|
|
|
2161
2383
|
};
|
|
2162
2384
|
}
|
|
2163
2385
|
|
|
2164
|
-
export { type AnthropicToolDefinition, AnticipationCacheSnapshot, type AsToolOptions, BM25, type BatchCreateResult, COMPACTION_LEVELS, CONTRACT, type CacheNamespace, type CacheStats, type CompactOptions, type CompactionCallback, type CompactionLevel, type ConfigureOptions, type ContextMetadata, type ConversationContext, type ConversationNamespace, type CreateFromFileOptions, type CreateMemoryOptions, type CreateMemoryResult, type Credentials, type CreditBalance, type CreditBucket, type CreditEstimate, type CreditLedgerEntry, type CreditLedgerPage, type CreditsNamespace, DEFAULT_BASE_URL, DEFAULT_DOCUMENT_TYPE, DEFAULT_INGEST_MODE, DEFAULT_RETRY_POLICY, DEFAULT_TIMEOUTS, DOCUMENT_TYPES, type DocumentType, ENDPOINTS, EXCERPT_CATEGORY, type Emotion, type EndpointName, type EndpointSpec, type Episode, type EstimateOptions, FORGET_MODES, type Fact, type FetchOptions, type FlatMemory, type ForgetCandidate, type ForgetMode, type ForgetOptions, type ForgetResult, type ForgetStatus, type FormatOptions, HttpTransport, type HttpTransportOptions, INGEST_MODES, ITEM_COLLECTIONS, type IngestMode, type IngestTranscriptOptions, type InstanceNamespace, type ItemCollection, type Json, type LedgerOptions, type ListenOptions, MEMORY_TYPES, type MemoriesInterface, type NormalisedContext, type OpenAiToolDefinition, type Preference, RESPONSE_SHAPES, type RawContext, type RawContextItem, type RawConversationContext, type RecordMessageOptions, type RecordThinkingOptions, type RedeemResult, type RequestOptions, type ResponseShape, type RetryPolicy, SDK_VERSION, type Scope, type SendMessageOptions, SynapClient, type SynapClientOptions, type SynapLogLevel, type SynapLogger, type SynapSdkLike, THRESHOLDS, type TemporalEvent, type TemporalFields, type TimeoutConfig, type ToolDefinition, type ToolHandler, type ToolScope, type ToolStyle, type TranscriptIngestResult, type TranscriptTurn, type UnifiedContext, type UnifiedFetchOptions, type UpdateMemoryOptions, type UserNamespace, type WaitOptions, type WriteInvalidator, applyResponseShape, flattenContextItems, formatForPrompt, isOutcomeUnknown,
|
|
2386
|
+
export { type AnthropicToolDefinition, AnticipationCacheSnapshot, type AsToolOptions, type AttachmentResult, BM25, type BatchCreateResult, COMPACTION_LEVELS, CONTRACT, type CacheNamespace, type CacheStats, type CompactOptions, type CompactionCallback, type CompactionLevel, type ConfigureOptions, type ContentPart, type ContextMetadata, type ConversationContext, type ConversationNamespace, type CreateDocument, type CreateFromFileOptions, type CreateMemoryOptions, type CreateMemoryResult, type Credentials, type CreditBalance, type CreditBucket, type CreditEstimate, type CreditLedgerEntry, type CreditLedgerPage, type CreditsNamespace, DATA_SCOPES, DEFAULT_BASE_URL, DEFAULT_DOCUMENT_TYPE, DEFAULT_INGEST_MODE, DEFAULT_RETRY_POLICY, DEFAULT_TIMEOUTS, DOCUMENT_TYPES, type DataInterface, type DataScope, type DeleteDataOptions, type DeleteDataResult, type DocumentType, ENDPOINTS, EXCERPT_CATEGORY, type Emotion, type EndpointName, type EndpointSpec, type Episode, type EstimateOptions, FORGET_MODES, type Fact, type FetchOptions, type FileData, type FilePart, type FilePartInit, type FlatMemory, type ForgetCandidate, type ForgetMode, type ForgetOptions, type ForgetResult, type ForgetStatus, type FormatOptions, HttpTransport, type HttpTransportOptions, INGEST_MODES, ITEM_COLLECTIONS, type IngestMode, type IngestTranscriptOptions, type InstanceNamespace, type ItemCollection, type Json, type LedgerOptions, type ListenOptions, MEMORY_TYPES, type MemoriesInterface, type NormalisedContext, OBJECTIVES, type Objective, type OpenAiToolDefinition, type Preference, RESPONSE_SHAPES, type RawContext, type RawContextItem, type RawConversationContext, type RecordMessageOptions, type RecordThinkingOptions, type RedeemResult, type RequestOptions, type ResponseShape, type RetryPolicy, SDK_VERSION, type Scope, type SendMessageOptions, SynapClient, type SynapClientOptions, SynapError, type SynapLogLevel, type SynapLogger, type SynapSdkLike, THRESHOLDS, type TemporalEvent, type TemporalFields, type TextPart, type TimeoutConfig, type ToolDefinition, type ToolHandler, type ToolScope, type ToolStyle, type TranscriptIngestResult, type TranscriptTurn, type UnifiedContext, type UnifiedFetchOptions, type UpdateMemoryOptions, type UserNamespace, type WaitOptions, type WriteInvalidator, applyResponseShape, filePart, flattenContextItems, formatForPrompt, isOutcomeUnknown, mergeScopeResults, rankItems, resolvePath, shouldRetry, stem, textPart, tokenize, wireRankScore };
|