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/dist/index.d.mts CHANGED
@@ -1,4 +1,4 @@
1
- import { A as RetrievalConfig, C as MnemocyteOperation, D as PruneResult, E as PruneInput, M as RetrievalScoreWeights, N as RetrievalScores, O as RecallInput, P as TokenCounter, S as MnemocyteObservationPhase, T as ProviderResilienceConfig, _ as MemoryWithScore, a as ConsolidateResult, b as MnemocyteConfig, c as Embedder, d as FindDuplicatesInput, f as GlobalStats, g as MemoryType, h as Memory, i as ConsolidateInput, j as RetrievalExplanation, k as RememberInput, l as EntityStats, m as ListAuditLogInput, n as AuditEvent, o as ContextFormat, p as ImportanceLevel, r as BuildContextInput, s as DuplicatePair, t as AuditConfig, u as ExperimentalMnemocyteClient, v as MnemocyteBackend, w as ObservabilityConfig, x as MnemocyteObservation, y as MnemocyteClient } from "./types-DXEGcc47.mjs";
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` is missing or
19
- * invalid, or `"VALIDATION"` if `databaseUrl` is provided but empty.
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
- * Prefer this over `instanceof` when working across module boundaries or
80
- * bundlers where multiple copies of the class may exist.
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
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","names":[],"sources":["../src/client.ts","../src/errors.ts"],"mappings":";;;;;AA+BA;;;;;;;;AAAyE;;;;ACnBzE;;;;AAA8B;AA6B9B;;;;;;iBDVgB,eAAA,CAAgB,MAAA,EAAQ,eAAA,GAAkB,eAAe;;;;;;AAAzE;;;;;;;;AAAyE;KCnB7D,kBAAA;;;AAAZ;;;;AAA8B;AA6B9B;;;;;;;;;;;;cAAa,cAAA,SAAuB,KAAA;EAWvB;EAAA,SATH,IAAA,EAAM,kBAAA;EASc;EAAA,SAPX,KAAA;EAOoD;AAAA;AAiBvE;;;cAjBa,OAAA,UAAiB,IAAA,EAAM,kBAAA,EAAoB,KAAA;AAAA;;;;AAiBiB;;;;;;iBAAzD,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc"}
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"}