mnemocyte 0.1.5 → 0.3.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 +188 -14
- package/dist/embedders/openai.d.mts +1 -1
- package/dist/embedders/openai.mjs +1 -1
- package/dist/{errors-BG3-mNur.mjs → errors-B_7ZdjEO.mjs} +4 -3
- package/dist/{errors-BG3-mNur.mjs.map → errors-B_7ZdjEO.mjs.map} +1 -1
- package/dist/index.d.mts +9 -9
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +964 -806
- package/dist/index.mjs.map +1 -1
- package/dist/{types-QK_43oKJ.d.mts → types-gOPLre4V.d.mts} +63 -28
- package/dist/types-gOPLre4V.d.mts.map +1 -0
- package/migrations/0000_initial.sql.template +42 -0
- package/migrations/0001_add_mnemocyte_meta.sql +6 -0
- package/migrations/meta/0001_snapshot.json +309 -0
- package/migrations/meta/_journal.json +7 -0
- package/migrations/render-initial.mjs +36 -0
- package/package.json +5 -3
- package/dist/types-QK_43oKJ.d.mts.map +0 -1
package/README.md
CHANGED
|
@@ -16,7 +16,7 @@ logs, and duplicate-consolidation tools on top of your existing infrastructure.
|
|
|
16
16
|
- Hybrid recall with vector similarity, lexical matching, recency, confidence,
|
|
17
17
|
access count, and importance.
|
|
18
18
|
- Prompt-ready context output in Markdown, plain text, or XML.
|
|
19
|
-
- Provider
|
|
19
|
+
- Provider retries, per-attempt timeouts, and caller `AbortSignal` cancellation.
|
|
20
20
|
- Pruning, duplicate detection, audit logs, and experimental consolidation.
|
|
21
21
|
|
|
22
22
|
Mnemocyte is ESM-only. Use `import`, not CommonJS `require`.
|
|
@@ -70,6 +70,9 @@ When `databaseUrl` is omitted, Mnemocyte uses the in-memory backend.
|
|
|
70
70
|
## Embedder
|
|
71
71
|
|
|
72
72
|
Mnemocyte accepts any embedder that returns one vector per input text.
|
|
73
|
+
Each vector must match `embedder.dimensions` and contain only finite numbers;
|
|
74
|
+
invalid provider output fails with `MnemocyteError` code `"EMBEDDING"` before
|
|
75
|
+
anything is stored.
|
|
73
76
|
|
|
74
77
|
```ts
|
|
75
78
|
const client = createMnemocyte({
|
|
@@ -103,8 +106,8 @@ supported for consumers that prefer provider-specific imports.
|
|
|
103
106
|
|
|
104
107
|
## Postgres
|
|
105
108
|
|
|
106
|
-
For persistent storage,
|
|
107
|
-
|
|
109
|
+
For persistent storage, enable pgvector in your Postgres database, apply the
|
|
110
|
+
bundled migrations, then pass `databaseUrl`.
|
|
108
111
|
|
|
109
112
|
```ts
|
|
110
113
|
const client = createMnemocyte({
|
|
@@ -117,13 +120,46 @@ The package includes:
|
|
|
117
120
|
|
|
118
121
|
```txt
|
|
119
122
|
migrations/0000_initial.sql
|
|
123
|
+
migrations/0001_add_mnemocyte_meta.sql
|
|
124
|
+
migrations/0000_initial.sql.template
|
|
125
|
+
migrations/render-initial.mjs
|
|
120
126
|
```
|
|
121
127
|
|
|
122
|
-
|
|
123
|
-
|
|
128
|
+
For the default 1536-dimensional schema on a fresh install, apply these in
|
|
129
|
+
order:
|
|
124
130
|
|
|
125
|
-
|
|
126
|
-
|
|
131
|
+
```txt
|
|
132
|
+
migrations/0000_initial.sql
|
|
133
|
+
migrations/0001_add_mnemocyte_meta.sql
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
For an existing 0.1.x Postgres install, apply
|
|
137
|
+
`migrations/0001_add_mnemocyte_meta.sql` to record the current 1536-dimensional
|
|
138
|
+
installation metadata.
|
|
139
|
+
|
|
140
|
+
For a different embedding dimension on a fresh installation, render an explicit
|
|
141
|
+
initial migration from the template and apply that rendered file instead of the
|
|
142
|
+
default `0000_initial.sql`. The rendered initial migration includes the
|
|
143
|
+
matching `mnemocyte_meta` row.
|
|
144
|
+
|
|
145
|
+
```bash
|
|
146
|
+
node node_modules/mnemocyte/migrations/render-initial.mjs --dimensions 768 --out migrations/0000_initial.768.sql
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Inside this repository, the equivalent development shortcut is:
|
|
150
|
+
|
|
151
|
+
```bash
|
|
152
|
+
pnpm migration:render -- --dimensions 768 --out migrations/0000_initial.768.sql
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
The Postgres backend supports one embedding dimension per installation. Before
|
|
156
|
+
the first embedding-dependent Postgres operation, Mnemocyte reads
|
|
157
|
+
`mnemocyte_meta` and validates it against `embedder.dimensions` before calling
|
|
158
|
+
the embedder. A mismatch throws a `MnemocyteError` with code `"CONFIG"`; missing
|
|
159
|
+
v0.2.0 metadata throws code `"MIGRATION"`.
|
|
160
|
+
|
|
161
|
+
Use the embedding dimension documented for your chosen model, render or apply a
|
|
162
|
+
matching schema, and keep one dimension per Mnemocyte installation.
|
|
127
163
|
|
|
128
164
|
The migration creates the bundled HNSW pgvector index
|
|
129
165
|
`mnemocyte_memories_embedding_hnsw_idx` for cosine search. HNSW is approximate:
|
|
@@ -141,7 +177,8 @@ add full-text or tag-specific GIN indexes yet; add and benchmark expression
|
|
|
141
177
|
indexes such as `to_tsvector('english', content)` or tag-oriented indexes only
|
|
142
178
|
when your workload needs them.
|
|
143
179
|
|
|
144
|
-
|
|
180
|
+
Existing 0.1.x deployments remain on 1536 unless you plan and run your own
|
|
181
|
+
Postgres migration to a different pgvector dimension.
|
|
145
182
|
|
|
146
183
|
## API
|
|
147
184
|
|
|
@@ -157,6 +194,31 @@ await client.remember({
|
|
|
157
194
|
});
|
|
158
195
|
```
|
|
159
196
|
|
|
197
|
+
Memory metadata is persisted JSON value data. Use the exported `JsonObject`
|
|
198
|
+
and `JsonValue` types; unsupported values such as `undefined`, functions,
|
|
199
|
+
bigints, non-finite numbers, class instances, or cyclic objects are rejected
|
|
200
|
+
with `MnemocyteError` code `"VALIDATION"`. Mnemocyte deep-clones metadata when
|
|
201
|
+
writing and reading, so later mutations do not change stored state.
|
|
202
|
+
|
|
203
|
+
For batches, cancellation belongs to the whole operation:
|
|
204
|
+
|
|
205
|
+
```ts
|
|
206
|
+
const abortController = new AbortController();
|
|
207
|
+
|
|
208
|
+
const memories = await client.rememberMany({
|
|
209
|
+
inputs: [
|
|
210
|
+
{ entityId: "user_123", content: "Likes concise answers." },
|
|
211
|
+
{ entityId: "user_123", content: "Uses TypeScript." },
|
|
212
|
+
],
|
|
213
|
+
signal: abortController.signal,
|
|
214
|
+
});
|
|
215
|
+
```
|
|
216
|
+
|
|
217
|
+
The positional `rememberMany(inputs)` form remains as a deprecated pre-v1
|
|
218
|
+
compatibility overload and treats its first item's signal as the batch signal.
|
|
219
|
+
New code should use `{ inputs, signal }`; individual items in the object form do
|
|
220
|
+
not have cancellation signals.
|
|
221
|
+
|
|
160
222
|
### `recall`
|
|
161
223
|
|
|
162
224
|
```ts
|
|
@@ -179,6 +241,9 @@ const context = await client.buildContext({
|
|
|
179
241
|
});
|
|
180
242
|
```
|
|
181
243
|
|
|
244
|
+
When supplied, `maxTokens` must be a positive integer or `buildContext` rejects
|
|
245
|
+
with `"VALIDATION"`. Omitting it keeps the default token-budget path.
|
|
246
|
+
|
|
182
247
|
### `prune`
|
|
183
248
|
|
|
184
249
|
```ts
|
|
@@ -218,6 +283,12 @@ const events = await client.listAuditLog({
|
|
|
218
283
|
});
|
|
219
284
|
```
|
|
220
285
|
|
|
286
|
+
Ordinary audit writes are best-effort: an audit storage failure does not fail
|
|
287
|
+
the primary client operation, so `listAuditLog` returns only events that were
|
|
288
|
+
successfully persisted. Postgres consolidation is the exception; its
|
|
289
|
+
`"memory.superseded"` events share the consolidation transaction and commit or
|
|
290
|
+
roll back with it.
|
|
291
|
+
|
|
221
292
|
### `experimental.consolidate`
|
|
222
293
|
|
|
223
294
|
```ts
|
|
@@ -266,6 +337,7 @@ VALIDATION
|
|
|
266
337
|
CONFIG
|
|
267
338
|
DB
|
|
268
339
|
NOT_FOUND
|
|
340
|
+
MIGRATION
|
|
269
341
|
```
|
|
270
342
|
|
|
271
343
|
## Retrieval Tuning
|
|
@@ -289,29 +361,131 @@ const client = createMnemocyte({
|
|
|
289
361
|
});
|
|
290
362
|
```
|
|
291
363
|
|
|
364
|
+
Retrieval weights must be finite and non-negative, with a non-zero effective
|
|
365
|
+
total after defaults are applied. `recencyHalfLifeDays` and `accessSaturation`
|
|
366
|
+
must be positive finite numbers, and `candidateMultiplier` must be an integer
|
|
367
|
+
of at least 1. Invalid tuning is rejected at client construction with
|
|
368
|
+
`MnemocyteError` code `"CONFIG"`.
|
|
369
|
+
|
|
292
370
|
## Roadmap
|
|
293
371
|
|
|
294
372
|
Planned larger milestones:
|
|
295
373
|
|
|
296
|
-
-
|
|
297
|
-
- `MemoryStore` abstraction
|
|
374
|
+
- public `MemoryStore` adapter surface
|
|
298
375
|
- `drizzleStore(db)` for caller-owned Drizzle clients
|
|
299
376
|
- `@mnemocyte/mcp`
|
|
300
377
|
|
|
301
|
-
See [ROADMAP.md](./ROADMAP.md).
|
|
378
|
+
See [ROADMAP.md](./docs/ROADMAP.md).
|
|
379
|
+
|
|
380
|
+
## Pre-v1 Notes
|
|
381
|
+
|
|
382
|
+
Current behavior:
|
|
383
|
+
|
|
384
|
+
- `createMnemocyte()` selects either the in-memory backend or the
|
|
385
|
+
Postgres/pgvector backend.
|
|
386
|
+
- Both backends run through an internal `MemoryStore` boundary and shared
|
|
387
|
+
client orchestration; `MemoryStore` is not exported as a public adapter API
|
|
388
|
+
yet.
|
|
389
|
+
- Postgres schema setup is explicit; the client does not create tables or
|
|
390
|
+
indexes for you.
|
|
391
|
+
- `findDuplicates`, audit-log workflows, and `experimental.consolidate` are
|
|
392
|
+
available before v1 but still subject to API refinement.
|
|
393
|
+
|
|
394
|
+
Known limitations before v1:
|
|
395
|
+
|
|
396
|
+
- The internal `MemoryStore` boundary is not a public adapter API yet.
|
|
397
|
+
`drizzleStore(db)` is the planned first public store adapter.
|
|
398
|
+
- Configured provider timeouts abort the per-attempt `AbortSignal`; the
|
|
399
|
+
underlying provider request only stops promptly when the embedder honors that
|
|
400
|
+
signal.
|
|
401
|
+
- Postgres dimension metadata is installation-wide. Mixed embedding dimensions
|
|
402
|
+
in one database are intentionally out of scope for now.
|
|
403
|
+
|
|
404
|
+
Planned v1 direction:
|
|
405
|
+
|
|
406
|
+
- Keep storage adapters behind `MemoryStore` while shared core code owns
|
|
407
|
+
validation, embedding, scoring, observability, resilience, and context
|
|
408
|
+
building.
|
|
409
|
+
- Keep root `mnemocyte` imports provider-SDK-free.
|
|
410
|
+
- Keep migrations, dimensions, and production index choices explicit.
|
|
302
411
|
|
|
303
412
|
## Development
|
|
304
413
|
|
|
414
|
+
### Prerequisites
|
|
415
|
+
|
|
416
|
+
- Node.js 22.18 or newer. CI tests the minimum 22.18 release and Node 24.
|
|
417
|
+
- pnpm 11.1.1, matching the `packageManager` field in `package.json`.
|
|
418
|
+
- Postgres with pgvector only when you want to run the integration suite.
|
|
419
|
+
|
|
420
|
+
Clone the repository and install its locked dependencies:
|
|
421
|
+
|
|
422
|
+
```bash
|
|
423
|
+
git clone https://github.com/Meenic/mnemocyte.git
|
|
424
|
+
cd mnemocyte
|
|
425
|
+
pnpm install --frozen-lockfile
|
|
426
|
+
```
|
|
427
|
+
|
|
428
|
+
Mnemocyte is a library, not a standalone server. Use the quick-start example
|
|
429
|
+
from a consuming TypeScript project, or run the repository build in watch mode
|
|
430
|
+
while developing:
|
|
431
|
+
|
|
432
|
+
```bash
|
|
433
|
+
pnpm dev
|
|
434
|
+
```
|
|
435
|
+
|
|
436
|
+
Create the publishable ESM artifacts in `dist/` with:
|
|
437
|
+
|
|
438
|
+
```bash
|
|
439
|
+
pnpm build
|
|
440
|
+
```
|
|
441
|
+
|
|
442
|
+
### Validation
|
|
443
|
+
|
|
444
|
+
Run the same main gates used by CI before committing:
|
|
445
|
+
|
|
305
446
|
```bash
|
|
306
447
|
pnpm checktypes
|
|
307
448
|
pnpm lint
|
|
308
449
|
pnpm test
|
|
309
|
-
pnpm run test:integration
|
|
310
450
|
pnpm run pack:check
|
|
311
451
|
```
|
|
312
452
|
|
|
313
|
-
`test
|
|
453
|
+
`pnpm test` builds the package, runs unit behavior, verifies package exports,
|
|
454
|
+
and type-checks the public declarations. `pnpm lint` is a read-only formatting,
|
|
455
|
+
lint, and import-order check; use `pnpm lint:fix` to apply its safe fixes. The
|
|
456
|
+
Postgres suite is separate:
|
|
457
|
+
|
|
458
|
+
```bash
|
|
459
|
+
DATABASE_URL=postgres://... pnpm run test:integration
|
|
460
|
+
```
|
|
461
|
+
|
|
462
|
+
On PowerShell, set the environment variable for the current process first:
|
|
463
|
+
|
|
464
|
+
```powershell
|
|
465
|
+
$env:DATABASE_URL = "postgres://..."
|
|
466
|
+
pnpm run test:integration
|
|
467
|
+
```
|
|
468
|
+
|
|
469
|
+
`test:integration` skips when `DATABASE_URL` is not set. The database must have
|
|
470
|
+
pgvector available; the test applies the bundled migrations.
|
|
471
|
+
|
|
472
|
+
### Where changes belong
|
|
473
|
+
|
|
474
|
+
- Public exports and types: `src/index.ts`, `src/types.ts`, and `src/errors.ts`.
|
|
475
|
+
- Shared client behavior: `src/memory/client-core.ts`; backend mechanics stay
|
|
476
|
+
in `src/memory/in-memory.ts` or `src/memory/postgres.ts`.
|
|
477
|
+
- Postgres schema and SQL: `src/db/schema.ts` and `src/db/queries/`. Schema
|
|
478
|
+
changes require an explicit file under `migrations/`.
|
|
479
|
+
- Provider helpers: `src/embedders/`; keep the root package provider-SDK-free.
|
|
480
|
+
- Retrieval and context rendering: `src/retrieval/` and `src/context/`.
|
|
481
|
+
- Tests: mirror the affected responsibility under `test/`; package boundary
|
|
482
|
+
checks live under `test/package/`, and real Postgres coverage under
|
|
483
|
+
`test/integration/`.
|
|
484
|
+
|
|
485
|
+
See [AGENTS.md](./AGENTS.md) for repository rules and the validation/release
|
|
486
|
+
policy. Read [ARCHITECTURE.md](./docs/ARCHITECTURE.md) before changing module
|
|
487
|
+
boundaries or the public surface.
|
|
314
488
|
|
|
315
489
|
## Architecture
|
|
316
490
|
|
|
317
|
-
See [ARCHITECTURE.md](./ARCHITECTURE.md).
|
|
491
|
+
See [ARCHITECTURE.md](./docs/ARCHITECTURE.md).
|
|
@@ -38,8 +38,9 @@ var MnemocyteError = class extends Error {
|
|
|
38
38
|
/**
|
|
39
39
|
* Type guard for {@link MnemocyteError}.
|
|
40
40
|
*
|
|
41
|
-
*
|
|
42
|
-
*
|
|
41
|
+
* This guard uses `instanceof` and recognizes errors created by the same loaded
|
|
42
|
+
* Mnemocyte class. It does not recognize structurally similar errors or errors
|
|
43
|
+
* created by another installed copy of the package.
|
|
43
44
|
*
|
|
44
45
|
* @param error - Value to test (typically a caught `unknown`).
|
|
45
46
|
* @returns `true` if `error` is a {@link MnemocyteError}.
|
|
@@ -50,4 +51,4 @@ function isMnemocyteError(error) {
|
|
|
50
51
|
//#endregion
|
|
51
52
|
export { isMnemocyteError as n, MnemocyteError as t };
|
|
52
53
|
|
|
53
|
-
//# sourceMappingURL=errors-
|
|
54
|
+
//# sourceMappingURL=errors-B_7ZdjEO.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors-
|
|
1
|
+
{"version":3,"file":"errors-B_7ZdjEO.mjs","names":[],"sources":["../src/errors.ts"],"sourcesContent":["/**\n * Stable, machine-readable error code attached to every {@link MnemocyteError}.\n *\n * - `\"CONFIG\"` — invalid client configuration (e.g. missing or malformed embedder).\n * - `\"VALIDATION\"` — invalid argument passed to a client method.\n * - `\"DB\"` — Postgres or driver-level failure.\n * - `\"EMBEDDING\"` — embedder threw or returned an invalid vector.\n * - `\"NOT_FOUND\"` — referenced memory or entity does not exist.\n * - `\"MIGRATION\"` — schema/migration check failed against the target database.\n * - `\"TIMEOUT\"` — a provider call exceeded its configured timeout.\n * - `\"ABORTED\"` — the operation was cancelled via an `AbortSignal`.\n */\nexport type MnemocyteErrorCode =\n\t| \"CONFIG\"\n\t| \"VALIDATION\"\n\t| \"DB\"\n\t| \"EMBEDDING\"\n\t| \"NOT_FOUND\"\n\t| \"MIGRATION\"\n\t| \"TIMEOUT\"\n\t| \"ABORTED\";\n\n/**\n * Error type thrown by every public Mnemocyte API.\n *\n * Use the {@link MnemocyteError.code} property — not the message — to branch\n * on failure modes, or call {@link isMnemocyteError} as a type guard when\n * working with `unknown` errors.\n *\n * @example\n * ```ts\n * try {\n * await client.recall({ entityId: \"u1\", query: \"hi\" });\n * } catch (err) {\n * if (isMnemocyteError(err) && err.code === \"DB\") {\n * // handle database failure\n * }\n * throw err;\n * }\n * ```\n */\nexport class MnemocyteError extends Error {\n\t/** Stable, machine-readable failure code. See {@link MnemocyteErrorCode}. */\n\treadonly code: MnemocyteErrorCode;\n\t/** Underlying cause, if any (e.g. an original driver or embedder error). */\n\toverride readonly cause?: unknown;\n\n\t/**\n\t * @param message - Human-readable error message.\n\t * @param code - Stable failure code; see {@link MnemocyteErrorCode}.\n\t * @param cause - Optional underlying cause (driver error, network error, etc.).\n\t */\n\tconstructor(message: string, code: MnemocyteErrorCode, cause?: unknown) {\n\t\tsuper(message);\n\t\tthis.name = \"MnemocyteError\";\n\t\tthis.code = code;\n\t\tthis.cause = cause;\n\t}\n}\n\n/**\n * Type guard for {@link MnemocyteError}.\n *\n * This guard uses `instanceof` and recognizes errors created by the same loaded\n * Mnemocyte class. It does not recognize structurally similar errors or errors\n * created by another installed copy of the package.\n *\n * @param error - Value to test (typically a caught `unknown`).\n * @returns `true` if `error` is a {@link MnemocyteError}.\n */\nexport function isMnemocyteError(error: unknown): error is MnemocyteError {\n\treturn error instanceof MnemocyteError;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAyCA,IAAa,iBAAb,cAAoC,MAAM;;CAEzC;;CAEA;;;;;;CAOA,YAAY,SAAiB,MAA0B,OAAiB;EACvE,MAAM,OAAO;EACb,KAAK,OAAO;EACZ,KAAK,OAAO;EACZ,KAAK,QAAQ;CACd;AACD;;;;;;;;;;;AAYA,SAAgB,iBAAiB,OAAyC;CACzE,OAAO,iBAAiB;AACzB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as
|
|
1
|
+
import { A as RecallInput, C as MnemocyteObservation, D as ProviderResilienceConfig, E as ObservabilityConfig, F as RetrievalScoreWeights, I as RetrievalScores, L as TokenCounter, M as RememberManyInput, N as RetrievalConfig, O as PruneInput, P as RetrievalExplanation, S as MnemocyteConfig, T as MnemocyteOperation, _ as Memory, a as ConsolidateResult, b as MnemocyteBackend, c as Embedder, d as FindDuplicatesInput, f as GlobalStats, g as ListAuditLogInput, h as JsonValue, i as ConsolidateInput, j as RememberInput, k as PruneResult, l as EntityStats, m as JsonObject, n as AuditEvent, o as ContextFormat, p as ImportanceLevel, r as BuildContextInput, s as DuplicatePair, t as AuditConfig, u as ExperimentalMnemocyteClient, v as MemoryType, w as MnemocyteObservationPhase, x as MnemocyteClient, y as MemoryWithScore } from "./types-gOPLre4V.mjs";
|
|
2
2
|
|
|
3
3
|
//#region src/client.d.ts
|
|
4
4
|
/**
|
|
@@ -15,16 +15,15 @@ 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
|
-
*
|
|
20
|
-
* is
|
|
21
|
-
* `"VALIDATION"` if `databaseUrl` is provided but empty.
|
|
18
|
+
* @throws {MnemocyteError} With code `"CONFIG"` if `embedder`, retrieval
|
|
19
|
+
* tuning, or the database URL is malformed, or `"VALIDATION"` if
|
|
20
|
+
* `databaseUrl` is explicitly empty.
|
|
22
21
|
*
|
|
23
22
|
* @example Postgres-backed client
|
|
24
23
|
* ```ts
|
|
25
24
|
* const client = createMnemocyte({
|
|
26
25
|
* databaseUrl: process.env.DATABASE_URL,
|
|
27
|
-
* embedder, // embedder.dimensions
|
|
26
|
+
* embedder, // embedder.dimensions must match mnemocyte_meta
|
|
28
27
|
* });
|
|
29
28
|
* ```
|
|
30
29
|
*/
|
|
@@ -78,13 +77,14 @@ declare class MnemocyteError extends Error {
|
|
|
78
77
|
/**
|
|
79
78
|
* Type guard for {@link MnemocyteError}.
|
|
80
79
|
*
|
|
81
|
-
*
|
|
82
|
-
*
|
|
80
|
+
* This guard uses `instanceof` and recognizes errors created by the same loaded
|
|
81
|
+
* Mnemocyte class. It does not recognize structurally similar errors or errors
|
|
82
|
+
* created by another installed copy of the package.
|
|
83
83
|
*
|
|
84
84
|
* @param error - Value to test (typically a caught `unknown`).
|
|
85
85
|
* @returns `true` if `error` is a {@link MnemocyteError}.
|
|
86
86
|
*/
|
|
87
87
|
declare function isMnemocyteError(error: unknown): error is MnemocyteError;
|
|
88
88
|
//#endregion
|
|
89
|
-
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 };
|
|
89
|
+
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 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 };
|
|
90
90
|
//# 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":";;;;;AAoCA;;;;;;;;AAAyE;;;;ACxBzE;;;;AAA8B;AA6B9B;;;;;;;iBDLgB,eAAA,CAAgB,MAAA,EAAQ,eAAA,GAAkB,eAAe;;;;;;AAAzE;;;;;;;;AAAyE;KCxB7D,kBAAA;;;AAAZ;;;;AAA8B;AA6B9B;;;;;;;;;;;;cAAa,cAAA,SAAuB,KAAA;EAWvB;EAAA,SATH,IAAA,EAAM,kBAAA;EASc;EAAA,SAPX,KAAA;EAOoD;AAAA;AAkBvE;;;cAlBa,OAAA,UAAiB,IAAA,EAAM,kBAAA,EAAoB,KAAA;AAAA;;;;AAkBiB;;;;;;;iBAAzD,gBAAA,CAAiB,KAAA,YAAiB,KAAA,IAAS,cAAc"}
|