mnemocyte 0.2.0 → 0.4.0
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/README.md +292 -27
- package/dist/embedders/openai.d.mts +1 -1
- package/dist/embedders/openai.d.mts.map +1 -1
- package/dist/embedders/openai.mjs +24 -9
- package/dist/embedders/openai.mjs.map +1 -1
- package/dist/{errors-BG3-mNur.mjs → errors-B_7ZdjEO.mjs} +4 -3
- package/dist/errors-B_7ZdjEO.mjs.map +1 -0
- package/dist/index.d.mts +11 -7
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1724 -1092
- package/dist/index.mjs.map +1 -1
- package/dist/{types-DXEGcc47.d.mts → types-DH0inEay.d.mts} +166 -52
- package/dist/types-DH0inEay.d.mts.map +1 -0
- package/migrations/0000_initial.sql.template +2 -1
- package/migrations/0002_add_embedding_model.sql +15 -0
- package/migrations/meta/0002_snapshot.json +315 -0
- package/migrations/meta/_journal.json +7 -0
- package/package.json +4 -3
- package/dist/errors-BG3-mNur.mjs.map +0 -1
- package/dist/types-DXEGcc47.d.mts.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as PruneResult, C as MnemocyteConfig, D as ObservabilityConfig, E as MnemocyteOperation, F as RetrievalExplanation, I as RetrievalScoreWeights, L as RetrievalScores, M as RememberInput, N as RememberManyInput, O as ProviderResilienceConfig, P as RetrievalConfig, R as TokenCounter, S as MnemocyteClient, T as MnemocyteObservationPhase, _ as ListAuditLogInput, a as ConsolidateInput, b as MemoryWithScore, c as DuplicatePair, d as ExperimentalMnemocyteClient, f as FindDuplicatesInput, g as JsonValue, h as JsonObject, i as BuildContextInput, j as RecallInput, k as PruneInput, l as Embedder, m as ImportanceLevel, n as AuditEvent, o as ConsolidateResult, p as GlobalStats, r as AuditLogCursor, s as ContextFormat, t as AuditConfig, u as EntityStats, v as Memory, w as MnemocyteObservation, x as MnemocyteBackend, y as MemoryType } from "./types-DH0inEay.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/client.d.ts
|
|
4
4
|
/**
|
|
@@ -15,8 +15,10 @@ import { A as RetrievalConfig, C as MnemocyteOperation, D as PruneResult, E as P
|
|
|
15
15
|
*
|
|
16
16
|
* @param config - Client configuration. {@link MnemocyteConfig.embedder} is required.
|
|
17
17
|
* @returns A {@link MnemocyteClient} instance.
|
|
18
|
-
* @throws {MnemocyteError} With code `"CONFIG"` if `embedder
|
|
19
|
-
*
|
|
18
|
+
* @throws {MnemocyteError} With code `"CONFIG"` if `embedder`, retrieval
|
|
19
|
+
* tuning, provider resilience, or the database URL is malformed or does not
|
|
20
|
+
* use the `postgres:` / `postgresql:` protocol, or `"VALIDATION"` if
|
|
21
|
+
* `databaseUrl` is explicitly empty.
|
|
20
22
|
*
|
|
21
23
|
* @example Postgres-backed client
|
|
22
24
|
* ```ts
|
|
@@ -37,11 +39,12 @@ declare function createMnemocyte(config: MnemocyteConfig): MnemocyteClient;
|
|
|
37
39
|
* - `"DB"` — Postgres or driver-level failure.
|
|
38
40
|
* - `"EMBEDDING"` — embedder threw or returned an invalid vector.
|
|
39
41
|
* - `"NOT_FOUND"` — referenced memory or entity does not exist.
|
|
42
|
+
* - `"CONFLICT"` — the requested mutation conflicts with stored relationships.
|
|
40
43
|
* - `"MIGRATION"` — schema/migration check failed against the target database.
|
|
41
44
|
* - `"TIMEOUT"` — a provider call exceeded its configured timeout.
|
|
42
45
|
* - `"ABORTED"` — the operation was cancelled via an `AbortSignal`.
|
|
43
46
|
*/
|
|
44
|
-
type MnemocyteErrorCode = "CONFIG" | "VALIDATION" | "DB" | "EMBEDDING" | "NOT_FOUND" | "MIGRATION" | "TIMEOUT" | "ABORTED";
|
|
47
|
+
type MnemocyteErrorCode = "CONFIG" | "VALIDATION" | "DB" | "EMBEDDING" | "NOT_FOUND" | "CONFLICT" | "MIGRATION" | "TIMEOUT" | "ABORTED";
|
|
45
48
|
/**
|
|
46
49
|
* Error type thrown by every public Mnemocyte API.
|
|
47
50
|
*
|
|
@@ -76,13 +79,14 @@ declare class MnemocyteError extends Error {
|
|
|
76
79
|
/**
|
|
77
80
|
* Type guard for {@link MnemocyteError}.
|
|
78
81
|
*
|
|
79
|
-
*
|
|
80
|
-
*
|
|
82
|
+
* This guard uses `instanceof` and recognizes errors created by the same loaded
|
|
83
|
+
* Mnemocyte class. It does not recognize structurally similar errors or errors
|
|
84
|
+
* created by another installed copy of the package.
|
|
81
85
|
*
|
|
82
86
|
* @param error - Value to test (typically a caught `unknown`).
|
|
83
87
|
* @returns `true` if `error` is a {@link MnemocyteError}.
|
|
84
88
|
*/
|
|
85
89
|
declare function isMnemocyteError(error: unknown): error is MnemocyteError;
|
|
86
90
|
//#endregion
|
|
87
|
-
export { type AuditConfig, type AuditEvent, type BuildContextInput, type ConsolidateInput, type ConsolidateResult, type ContextFormat, type DuplicatePair, type Embedder, type EntityStats, type ExperimentalMnemocyteClient, type FindDuplicatesInput, type GlobalStats, type ImportanceLevel, type ListAuditLogInput, type Memory, type MemoryType, type MemoryWithScore, type MnemocyteBackend, type MnemocyteClient, type MnemocyteConfig, MnemocyteError, type MnemocyteErrorCode, type MnemocyteObservation, type MnemocyteObservationPhase, type MnemocyteOperation, type ObservabilityConfig, type ProviderResilienceConfig, type PruneInput, type PruneResult, type RecallInput, type RememberInput, type RetrievalConfig, type RetrievalExplanation, type RetrievalScoreWeights, type RetrievalScores, type TokenCounter, createMnemocyte, isMnemocyteError };
|
|
91
|
+
export { type AuditConfig, type AuditEvent, type AuditLogCursor, type BuildContextInput, type ConsolidateInput, type ConsolidateResult, type ContextFormat, type DuplicatePair, type Embedder, type EntityStats, type ExperimentalMnemocyteClient, type FindDuplicatesInput, type GlobalStats, type ImportanceLevel, type JsonObject, type JsonValue, type ListAuditLogInput, type Memory, type MemoryType, type MemoryWithScore, type MnemocyteBackend, type MnemocyteClient, type MnemocyteConfig, MnemocyteError, type MnemocyteErrorCode, type MnemocyteObservation, type MnemocyteObservationPhase, type MnemocyteOperation, type ObservabilityConfig, type ProviderResilienceConfig, type PruneInput, type PruneResult, type RecallInput, type RememberInput, type RememberManyInput, type RetrievalConfig, type RetrievalExplanation, type RetrievalScoreWeights, type RetrievalScores, type TokenCounter, createMnemocyte, isMnemocyteError };
|
|
88
92
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.ts","../src/errors.ts"],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.ts","../src/errors.ts"],"mappings":";;;;;AAsCA;;;;;;;;AAAyE;;;;ACzBzE;;;;AAA8B;AA8B9B;;;;;;;;iBDLgB,eAAA,CAAgB,MAAA,EAAQ,eAAA,GAAkB,eAAe;;;;;;AAAzE;;;;;;;;AAAyE;;KCzB7D,kBAAA;;AAAZ;;;;AAA8B;AA8B9B;;;;;;;;;;;;;cAAa,cAAA,SAAuB,KAAA;EAWA;EAAA,SAT1B,IAAA,EAAM,kBAAA;EASwC;EAAA,SAPrC,KAAA;EAOoD;AAkBvE;;;;cAlBa,OAAA,UAAiB,IAAA,EAAM,kBAAA,EAAoB,KAAA;AAAA;;;AAkBiB;;;;;;;;iBAAzD,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc"}
|