mentedb 0.45.0 → 0.47.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.
Binary file
Binary file
Binary file
Binary file
Binary file
package/npm/client.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- import { EdgeType, type StoreOptions, type RecallResult, type SearchResult, type ProcessTurnResult, type IngestResult } from './types';
1
+ import { EdgeType, type StoreOptions, type RecallResult, type SearchResult, type ProcessTurnResult, type IngestResult, type ErasureReceipt } from './types';
2
2
  /**
3
3
  * MenteDB client. Wraps the native Rust database engine and exposes a
4
4
  * TypeScript-friendly API for storing, recalling, searching, relating, and
@@ -38,6 +38,17 @@ export declare class MenteDB {
38
38
  relate(source: string, target: string, edgeType?: EdgeType, weight?: number): void;
39
39
  /** Remove a memory by ID. */
40
40
  forget(memoryId: string): void;
41
+ /**
42
+ * Verified erase: remove the memory, everything derived from it, and every
43
+ * copy of their bytes in the database directory. `includeSources` also
44
+ * erases what the memory was derived from; `verify` scans every file
45
+ * afterwards. Returns the erasure receipt (ids, SHA-256 hashes, the scrub
46
+ * steps, and the scan result), never the content. See docs/FORGETTING.md.
47
+ */
48
+ erase(memoryId: string, options?: {
49
+ includeSources?: boolean;
50
+ verify?: boolean;
51
+ }): ErasureReceipt;
41
52
  /** Flush all data and close the database. */
42
53
  close(): void;
43
54
  }
package/npm/client.js CHANGED
@@ -120,6 +120,17 @@ class MenteDB {
120
120
  forget(memoryId) {
121
121
  this.native.forget(memoryId);
122
122
  }
123
+ /**
124
+ * Verified erase: remove the memory, everything derived from it, and every
125
+ * copy of their bytes in the database directory. `includeSources` also
126
+ * erases what the memory was derived from; `verify` scans every file
127
+ * afterwards. Returns the erasure receipt (ids, SHA-256 hashes, the scrub
128
+ * steps, and the scan result), never the content. See docs/FORGETTING.md.
129
+ */
130
+ erase(memoryId, options = {}) {
131
+ const json = this.native.erase(memoryId, options.includeSources, options.verify);
132
+ return JSON.parse(json);
133
+ }
123
134
  /** Flush all data and close the database. */
124
135
  close() {
125
136
  this.native.close();
package/npm/index.d.ts CHANGED
@@ -1,3 +1,3 @@
1
1
  export { MenteDB, CognitionStream, TrajectoryTracker } from './client';
2
2
  export { MemoryType, EdgeType } from './types';
3
- export type { RecallResult, SearchResult, StoreOptions } from './types';
3
+ export type { RecallResult, SearchResult, StoreOptions, ErasureReceipt } from './types';
package/npm/types.d.ts CHANGED
@@ -87,3 +87,44 @@ export interface IngestResult {
87
87
  contradictions: number;
88
88
  storedIds: string[];
89
89
  }
90
+ /** One erased memory: its id, why it went, and hashes of what it held. */
91
+ export interface ErasedMemory {
92
+ id: string;
93
+ reason: 'requested' | 'derived' | 'source' | 'identical';
94
+ /** SHA-256 of the content, lowercase hex. */
95
+ content_sha256: string;
96
+ /** SHA-256 of the embedding as little endian f32 bytes, when it had one. */
97
+ embedding_sha256: string | null;
98
+ }
99
+ /** A file in which the verification scan found erased bytes. */
100
+ export interface ResidualHit {
101
+ file: string;
102
+ memory: string;
103
+ kind: 'content' | 'embedding';
104
+ }
105
+ /** Result of `MenteDB.erase`. Carries ids and hashes, never content. */
106
+ export interface ErasureReceipt {
107
+ requested: string;
108
+ erased: ErasedMemory[];
109
+ ancestors_kept: string[];
110
+ profiles_to_review: string[];
111
+ erased_at_us: number;
112
+ steps: {
113
+ records_zeroed: number;
114
+ index_vectors_scrubbed: number;
115
+ free_space_bytes_zeroed: number | null;
116
+ wal_scrubbed: boolean;
117
+ snapshots_rewritten: boolean;
118
+ replaced_files_zeroed: number;
119
+ legacy_files_removed: string[];
120
+ cache_entries_dropped: number;
121
+ };
122
+ verification: {
123
+ files_scanned: number;
124
+ bytes_scanned: number;
125
+ residual_found: boolean;
126
+ hits: ResidualHit[];
127
+ unreadable: string[];
128
+ content_not_checked: string[];
129
+ } | null;
130
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mentedb",
3
- "version": "0.45.0",
3
+ "version": "0.47.0",
4
4
  "description": "The mind database for AI agents",
5
5
  "main": "npm/index.js",
6
6
  "types": "npm/index.d.ts",