mnemo-engine 0.13.0__tar.gz → 0.13.1__tar.gz

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.
Files changed (67) hide show
  1. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/PKG-INFO +28 -23
  2. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/README.md +27 -22
  3. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/Cargo.lock +3 -3
  4. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/Cargo.toml +1 -1
  5. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/README.md +21 -7
  6. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/bin/mnemo/inspect.html +19 -2
  7. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/bin/mnemo/inspect.rs +263 -51
  8. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/bin/mnemo.rs +106 -30
  9. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/error.rs +2 -1
  10. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/maintenance.rs +8 -0
  11. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/open.rs +55 -15
  12. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/Cargo.lock +2 -2
  13. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/Cargo.toml +1 -1
  14. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/README.md +27 -22
  15. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/src/lib.rs +174 -2
  16. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/test_mnemo.py +88 -0
  17. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/pyproject.toml +1 -1
  18. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/.gitignore +0 -0
  19. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/benches/corpus.rs +0 -0
  20. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/deny.toml +0 -0
  21. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/ann_defaults_v0_6_0.rs +0 -0
  22. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/ann_diagnose.rs +0 -0
  23. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/ann_recall_grid.rs +0 -0
  24. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/ann_recall_grid_v2.rs +0 -0
  25. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/embedder_server.py +0 -0
  26. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/file_size_breakdown.rs +0 -0
  27. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/open_rss.rs +0 -0
  28. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/quickstart.rs +0 -0
  29. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/ranking_v2.rs +0 -0
  30. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/session.rs +0 -0
  31. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/examples/thread_profile.rs +0 -0
  32. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/bin/mnemo/export.rs +0 -0
  33. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/cache.rs +0 -0
  34. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/crypto.rs +0 -0
  35. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/embed.rs +0 -0
  36. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/embed_cmd.rs +0 -0
  37. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/format.rs +0 -0
  38. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/freelist.rs +0 -0
  39. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/index.rs +0 -0
  40. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/keyslot.rs +0 -0
  41. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/lib.rs +0 -0
  42. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/mcp.rs +0 -0
  43. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/memory.rs +0 -0
  44. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/pager.rs +0 -0
  45. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/result_cache.rs +0 -0
  46. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/session.rs +0 -0
  47. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/ann.rs +0 -0
  48. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/cache_api.rs +0 -0
  49. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/continuation.rs +0 -0
  50. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/crud.rs +0 -0
  51. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/essence.rs +0 -0
  52. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/flush.rs +0 -0
  53. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/header_graft_tests.rs +0 -0
  54. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/hooks.rs +0 -0
  55. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/keyed.rs +0 -0
  56. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/load.rs +0 -0
  57. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/mod.rs +0 -0
  58. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/recall.rs +0 -0
  59. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/records.rs +0 -0
  60. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/snapshots.rs +0 -0
  61. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/store/threads.rs +0 -0
  62. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/text.rs +0 -0
  63. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/transcript.rs +0 -0
  64. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/veccol.rs +0 -0
  65. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo/src/wal.rs +0 -0
  66. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/mnemo-python/.gitignore +0 -0
  67. {mnemo_engine-0.13.0 → mnemo_engine-0.13.1}/python/mnemo_engine/__init__.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: mnemo-engine
3
- Version: 0.13.0
3
+ Version: 0.13.1
4
4
  Classifier: Programming Language :: Rust
5
5
  Classifier: Programming Language :: Python :: 3
6
6
  Classifier: License :: OSI Approved :: Apache Software License
@@ -188,7 +188,7 @@ its own agent.
188
188
  | `set_turn_compress_after(secs)` | v9 files: compress thread turns once they're older than `secs` (default 7 days; `0` compresses at write). This handle only |
189
189
  | `memories()` | Enumerate every live (non-deleted, non-expired) memory as a list of dicts |
190
190
  | `dimensions()` | Embedding dimensionality this database was created with (also on `stats()["dimensions"]`) |
191
- | `rekey(new_passphrase, fast=False)` | Change the passphrase. Re-derives the KEK and re-wraps the DEK; encrypted pages are not rewritten (O(1) in db size). `fast=True` uses the cheap-Argon2 test params — omit for production |
191
+ | `rekey(new_passphrase, fast=False)` | Change the passphrase. Re-derives the KEK and re-wraps the DEK; encrypted pages are not rewritten (O(1) in db size). `fast=True` uses the cheap-Argon2 test params — omit for production. If it raises, the file may already be under the new secret, or may move to it at the next write: close without writing more, then try both secrets |
192
192
  | `set_embedder(fn, *, name, dimensions, normalize=True)` | Register a Python callable `embed(texts: list[str]) -> list[list[float]]` as this handle's text embedder (Phase 3). Dimension-checks against the database's width; identity-checks against (and on first use upserts) the scaffold manifest's `embedder_name` / `embedder_dimensions` / `embedder_normalize` keys, so swapping embedders between opens fails loudly |
193
193
  | `remember_text(content, memory_type, **kwargs)` | Embed `content` via the registered embedder and `remember` the result. Accepts the same per-memory kwargs as `remember` (`agent_id`, `importance`, `session_id`, `ttl_secs`, `shared`, `metadata`) |
194
194
  | `recall_text(query, top_k=10, memory_types=None, agent_id=None, track_access=True, n_probe=None, n_rerank=None, filter=None, max_bytes=None, keywords=None, keyword_weight=None)` | Embed `query` via the registered embedder and run `recall`. Same return shape and kwargs as `recall`. `keywords` (v9 files): identifiers or exact terms to match (a version, a PR number, a function name), not the question; their BM25 score is added with weight `keyword_weight` (default 0.5) |
@@ -202,6 +202,7 @@ Plus two module-level functions:
202
202
  | Function | Purpose |
203
203
  |---|---|
204
204
  | `mnemo.compact_file(path, passphrase)` | Rewrite the file out-of-place, dropping tombstoned and expired memories and reclaiming stale pages. Caller's own handle must be closed first. Returns `{"before": int, "after": int}` |
205
+ | `mnemo.compact_file_with_key(path, key)` | The same for a raw-key file (`key`: 32 bytes, as from `generate_key()`), under the same key; converts a v8 file to v9 (since v0.13.1) |
205
206
  | `mnemo.build_info()` | Returns `{"version", "target", "aes_backend", "polyval_backend"}` for the installed wheel. Lets you verify an ARM wheel picked up the hardware AES path — `aes_backend` should read `"armv8 hardware"` on Apple Silicon / Graviton (anything else, like `"armv8 software (constant-time fallback)"`, means the compile missed the fix). PR 11.0, v0.5.1+ |
206
207
 
207
208
  `Session` methods: `add_turn(turn)`, `recall(query, top_k=10, memory_types=None)`,
@@ -213,35 +214,39 @@ nested dict.
213
214
 
214
215
  ### Errors
215
216
 
216
- Every engine error is raised as `RuntimeError` (argument errors the binding
217
- catches itself, before the engine sees them, are `ValueError`). Until the
218
- exception subclasses arrive (v0.13.1), tell them apart by how the message
219
- starts:
217
+ Since v0.13.1 every engine error is an `mnemo_engine.MnemoError`, which
218
+ subclasses `RuntimeError`, so `except RuntimeError` keeps working. The
219
+ subclasses tell the cases apart (argument errors the binding catches itself,
220
+ before the engine sees them, are still `ValueError`):
220
221
 
221
- | The message starts with | What happened | What to do |
222
+ | Exception | What happened | What to do |
222
223
  |---|---|---|
223
- | `this file is format v` | the file predates v9: a v8 file opens only with `read_only=True`, v4–v7 not at all | run `mnemo compact <file>` once (it keeps every live memory) |
224
- | `read-only open blocked:` | the file has pending work (a committed write to finish, a torn header to repair) | open it read-write once; on a pre-v9 file the message says to run `mnemo compact` instead |
225
- | `embedder identity mismatch` | the embedder given isn't the one the file's vectors came from | use the original embedder, or create a new file for the new model |
226
- | `wrong passphrase` | the passphrase or key doesn't open this file | check the secret |
227
- | `file already locked by another handle` | another handle (another process, or one not yet closed) has the file | close it, or open read-only alongside a reader |
228
- | `operation requires a read-write handle` | a write on a `read_only=True` handle | reopen read-write |
229
- | `vector dimension mismatch` | a vector of the wrong width | embed with the file's model |
230
- | `invalid argument:` | a bad argument the engine refused | fix the call |
231
- | `memory '` | the id isn't in the file (`… not found`) | |
232
- | `unsupported .mnemo format version` | a file from a newer engine | upgrade `mnemo-engine` |
233
- | `bad magic bytes`, `header checksum mismatch`, `header seal authentication failed`, `page ` | not a `.mnemo` file, or a corrupt or tampered one | restore from a backup or an export |
224
+ | `FormatTooOldError` | the file predates v9: a v8 file opens only with `read_only=True`, v4–v7 not at all | run `mnemo compact <file>` once (`--key-file` for a raw-key file, or `compact_file_with_key`); it keeps every live memory |
225
+ | `NeedsWriteOpenError` | the file has pending work (a committed write to finish, a torn header to repair) | open it read-write once; on a pre-v9 file the message says to run `mnemo compact` instead |
226
+ | `EmbedderMismatchError` | the embedder given isn't the one the file's vectors came from | use the original embedder, or create a new file for the new model |
227
+ | `WrongPassphraseError` | the passphrase or key doesn't open this file | check the secret |
228
+ | `LockedError` | another handle (another process, or one not yet closed) has the file | close it, or open read-only alongside a reader |
229
+ | `ReadOnlyError` | a write on a `read_only=True` handle | reopen read-write |
230
+ | `DimensionMismatchError` | a vector of the wrong width | embed with the file's model |
231
+ | `InvalidArgumentError` | a bad argument the engine refused (an all-zero vector, say) | fix the call |
232
+ | `NotFoundError` | the id isn't in the file | |
233
+ | `UnsupportedVersionError` | a file from a newer engine | upgrade `mnemo-engine` |
234
+ | `NotAMnemoFileError` | not a `.mnemo` file | check the path |
235
+ | `CorruptError` | a page or the header failed its integrity check: corrupt or tampered | restore from a backup or an export |
236
+ | `MnemoError` (only) | I/O, cryptography, key derivation or serialization | the message says which |
234
237
 
235
238
  ```python
239
+ import mnemo_engine as mnemo
240
+
236
241
  try:
237
242
  db = mnemo.open(path, passphrase)
238
- except RuntimeError as e:
239
- if str(e).startswith("this file is format v"):
240
- db = mnemo.open(path, passphrase, read_only=True) # a v8 file; compact it later
241
- else:
242
- raise
243
+ except mnemo.FormatTooOldError:
244
+ db = mnemo.open(path, passphrase, read_only=True) # a v8 file; compact it later
243
245
  ```
244
246
 
247
+ Each message is the engine's own, unchanged from before, so code that
248
+ matched on a message's start keeps working too.
249
+
245
250
  ## Result caching
246
251
 
247
252
  MNemo doubles as a durable result cache — memoize LLM tool-call outputs,
@@ -174,7 +174,7 @@ its own agent.
174
174
  | `set_turn_compress_after(secs)` | v9 files: compress thread turns once they're older than `secs` (default 7 days; `0` compresses at write). This handle only |
175
175
  | `memories()` | Enumerate every live (non-deleted, non-expired) memory as a list of dicts |
176
176
  | `dimensions()` | Embedding dimensionality this database was created with (also on `stats()["dimensions"]`) |
177
- | `rekey(new_passphrase, fast=False)` | Change the passphrase. Re-derives the KEK and re-wraps the DEK; encrypted pages are not rewritten (O(1) in db size). `fast=True` uses the cheap-Argon2 test params — omit for production |
177
+ | `rekey(new_passphrase, fast=False)` | Change the passphrase. Re-derives the KEK and re-wraps the DEK; encrypted pages are not rewritten (O(1) in db size). `fast=True` uses the cheap-Argon2 test params — omit for production. If it raises, the file may already be under the new secret, or may move to it at the next write: close without writing more, then try both secrets |
178
178
  | `set_embedder(fn, *, name, dimensions, normalize=True)` | Register a Python callable `embed(texts: list[str]) -> list[list[float]]` as this handle's text embedder (Phase 3). Dimension-checks against the database's width; identity-checks against (and on first use upserts) the scaffold manifest's `embedder_name` / `embedder_dimensions` / `embedder_normalize` keys, so swapping embedders between opens fails loudly |
179
179
  | `remember_text(content, memory_type, **kwargs)` | Embed `content` via the registered embedder and `remember` the result. Accepts the same per-memory kwargs as `remember` (`agent_id`, `importance`, `session_id`, `ttl_secs`, `shared`, `metadata`) |
180
180
  | `recall_text(query, top_k=10, memory_types=None, agent_id=None, track_access=True, n_probe=None, n_rerank=None, filter=None, max_bytes=None, keywords=None, keyword_weight=None)` | Embed `query` via the registered embedder and run `recall`. Same return shape and kwargs as `recall`. `keywords` (v9 files): identifiers or exact terms to match (a version, a PR number, a function name), not the question; their BM25 score is added with weight `keyword_weight` (default 0.5) |
@@ -188,6 +188,7 @@ Plus two module-level functions:
188
188
  | Function | Purpose |
189
189
  |---|---|
190
190
  | `mnemo.compact_file(path, passphrase)` | Rewrite the file out-of-place, dropping tombstoned and expired memories and reclaiming stale pages. Caller's own handle must be closed first. Returns `{"before": int, "after": int}` |
191
+ | `mnemo.compact_file_with_key(path, key)` | The same for a raw-key file (`key`: 32 bytes, as from `generate_key()`), under the same key; converts a v8 file to v9 (since v0.13.1) |
191
192
  | `mnemo.build_info()` | Returns `{"version", "target", "aes_backend", "polyval_backend"}` for the installed wheel. Lets you verify an ARM wheel picked up the hardware AES path — `aes_backend` should read `"armv8 hardware"` on Apple Silicon / Graviton (anything else, like `"armv8 software (constant-time fallback)"`, means the compile missed the fix). PR 11.0, v0.5.1+ |
192
193
 
193
194
  `Session` methods: `add_turn(turn)`, `recall(query, top_k=10, memory_types=None)`,
@@ -199,35 +200,39 @@ nested dict.
199
200
 
200
201
  ### Errors
201
202
 
202
- Every engine error is raised as `RuntimeError` (argument errors the binding
203
- catches itself, before the engine sees them, are `ValueError`). Until the
204
- exception subclasses arrive (v0.13.1), tell them apart by how the message
205
- starts:
203
+ Since v0.13.1 every engine error is an `mnemo_engine.MnemoError`, which
204
+ subclasses `RuntimeError`, so `except RuntimeError` keeps working. The
205
+ subclasses tell the cases apart (argument errors the binding catches itself,
206
+ before the engine sees them, are still `ValueError`):
206
207
 
207
- | The message starts with | What happened | What to do |
208
+ | Exception | What happened | What to do |
208
209
  |---|---|---|
209
- | `this file is format v` | the file predates v9: a v8 file opens only with `read_only=True`, v4–v7 not at all | run `mnemo compact <file>` once (it keeps every live memory) |
210
- | `read-only open blocked:` | the file has pending work (a committed write to finish, a torn header to repair) | open it read-write once; on a pre-v9 file the message says to run `mnemo compact` instead |
211
- | `embedder identity mismatch` | the embedder given isn't the one the file's vectors came from | use the original embedder, or create a new file for the new model |
212
- | `wrong passphrase` | the passphrase or key doesn't open this file | check the secret |
213
- | `file already locked by another handle` | another handle (another process, or one not yet closed) has the file | close it, or open read-only alongside a reader |
214
- | `operation requires a read-write handle` | a write on a `read_only=True` handle | reopen read-write |
215
- | `vector dimension mismatch` | a vector of the wrong width | embed with the file's model |
216
- | `invalid argument:` | a bad argument the engine refused | fix the call |
217
- | `memory '` | the id isn't in the file (`… not found`) | |
218
- | `unsupported .mnemo format version` | a file from a newer engine | upgrade `mnemo-engine` |
219
- | `bad magic bytes`, `header checksum mismatch`, `header seal authentication failed`, `page ` | not a `.mnemo` file, or a corrupt or tampered one | restore from a backup or an export |
210
+ | `FormatTooOldError` | the file predates v9: a v8 file opens only with `read_only=True`, v4–v7 not at all | run `mnemo compact <file>` once (`--key-file` for a raw-key file, or `compact_file_with_key`); it keeps every live memory |
211
+ | `NeedsWriteOpenError` | the file has pending work (a committed write to finish, a torn header to repair) | open it read-write once; on a pre-v9 file the message says to run `mnemo compact` instead |
212
+ | `EmbedderMismatchError` | the embedder given isn't the one the file's vectors came from | use the original embedder, or create a new file for the new model |
213
+ | `WrongPassphraseError` | the passphrase or key doesn't open this file | check the secret |
214
+ | `LockedError` | another handle (another process, or one not yet closed) has the file | close it, or open read-only alongside a reader |
215
+ | `ReadOnlyError` | a write on a `read_only=True` handle | reopen read-write |
216
+ | `DimensionMismatchError` | a vector of the wrong width | embed with the file's model |
217
+ | `InvalidArgumentError` | a bad argument the engine refused (an all-zero vector, say) | fix the call |
218
+ | `NotFoundError` | the id isn't in the file | |
219
+ | `UnsupportedVersionError` | a file from a newer engine | upgrade `mnemo-engine` |
220
+ | `NotAMnemoFileError` | not a `.mnemo` file | check the path |
221
+ | `CorruptError` | a page or the header failed its integrity check: corrupt or tampered | restore from a backup or an export |
222
+ | `MnemoError` (only) | I/O, cryptography, key derivation or serialization | the message says which |
220
223
 
221
224
  ```python
225
+ import mnemo_engine as mnemo
226
+
222
227
  try:
223
228
  db = mnemo.open(path, passphrase)
224
- except RuntimeError as e:
225
- if str(e).startswith("this file is format v"):
226
- db = mnemo.open(path, passphrase, read_only=True) # a v8 file; compact it later
227
- else:
228
- raise
229
+ except mnemo.FormatTooOldError:
230
+ db = mnemo.open(path, passphrase, read_only=True) # a v8 file; compact it later
229
231
  ```
230
232
 
233
+ Each message is the engine's own, unchanged from before, so code that
234
+ matched on a message's start keeps working too.
235
+
231
236
  ## Result caching
232
237
 
233
238
  MNemo doubles as a durable result cache — memoize LLM tool-call outputs,
@@ -821,7 +821,7 @@ checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a"
821
821
 
822
822
  [[package]]
823
823
  name = "mnemo-engine"
824
- version = "0.13.0"
824
+ version = "0.13.1"
825
825
  dependencies = [
826
826
  "aes-gcm",
827
827
  "argon2",
@@ -850,7 +850,7 @@ dependencies = [
850
850
 
851
851
  [[package]]
852
852
  name = "mnemo-node"
853
- version = "0.13.0"
853
+ version = "0.13.1"
854
854
  dependencies = [
855
855
  "mnemo-engine",
856
856
  "napi",
@@ -860,7 +860,7 @@ dependencies = [
860
860
 
861
861
  [[package]]
862
862
  name = "mnemo-uniffi"
863
- version = "0.13.0"
863
+ version = "0.13.1"
864
864
  dependencies = [
865
865
  "mnemo-engine",
866
866
  "serde_json",
@@ -10,7 +10,7 @@
10
10
  # The CLI binary name stays `mnemo`, so users still invoke `mnemo` on
11
11
  # the command line after `cargo install mnemo-engine`.
12
12
  name = "mnemo-engine"
13
- version = "0.13.0"
13
+ version = "0.13.1"
14
14
  edition = "2021"
15
15
  rust-version = "1.75"
16
16
  # `benches/corpus.rs` is a shared helper module pulled into real benches
@@ -862,6 +862,13 @@ The passphrase is resolved in this priority order:
862
862
  passphrase follows the same chain via `--new-passphrase`,
863
863
  `MNEMO_NEW_PASSPHRASE`, or a double-prompt.
864
864
 
865
+ **Raw-key files** (what `Mnemo::create_with_key` writes, and what the
866
+ phone libraries keep) open with `--key-file <path>` instead, on `info`,
867
+ `about`, `list`, `verify`, `recall`, `export`, `compact` and `inspect`
868
+ (since v0.13.1). The file holds the 32-byte key, raw or as 64 hex digits;
869
+ it can't be combined with `--passphrase`. `mnemo compact --key-file` is
870
+ how a raw-key v8 file becomes v9.
871
+
865
872
  For real applications, prefer the library API and supply the passphrase
866
873
  in-process.
867
874
 
@@ -907,13 +914,13 @@ cargo run --bin mnemo -- export agent.mnemo --git -o memory.md
907
914
  ```sh
908
915
  cargo run --bin mnemo -- inspect agent.mnemo # prints a URL with a token: open it in your browser
909
916
  cargo run --bin mnemo -- inspect app.mnemo --key-file app.key # a raw-key file (32 bytes or 64 hex digits)
910
- cargo run --bin mnemo -- inspect agent.mnemo --open # opens the browser for you: single-user machines only
917
+ cargo run --bin mnemo -- inspect agent.mnemo --open # opens the browser for you
911
918
  ```
912
919
 
913
- The passphrase comes from the prompt or `MNEMO_PASSPHRASE`. **Copy the
914
- printed URL** into your browser. `--open` does that for you, but it hands
915
- the URL, token included, to the system's browser launcher, so use it only
916
- on a machine nobody else logs into.
920
+ The passphrase comes from the prompt or `MNEMO_PASSPHRASE`. Copy the
921
+ printed URL into your browser, or pass `--open`, which hands the browser a
922
+ private local page (owner-only, deleted once it has loaded) that forwards
923
+ to the URL.
917
924
 
918
925
  - **Views:** memories (filter by type, agent, keyed or not, and thread;
919
926
  keyword search with BM25, no embedder needed), keyed history (each
@@ -927,10 +934,17 @@ on a machine nobody else logs into.
927
934
  open at that moment, it says so and keeps the last read.
928
935
  - **It stays on your machine.** It binds `127.0.0.1` only (a random free
929
936
  port unless `--port`), and the printed URL carries a random token. Every
930
- request must carry that token and a `Host` of the loopback address and
937
+ data request must carry that token and a `Host` of the loopback address and
931
938
  port, which stops other sites' pages (DNS rebinding included). Only `GET`
932
939
  is served, with no CORS, and no endpoint writes the file. Nothing is
933
- written to disk.
940
+ written to disk. Once the page has loaded, it keeps the token for that
941
+ tab only and takes it out of the address bar. The browser's history
942
+ still records the first visit; the token stops working when the
943
+ inspector stops.
944
+ - **It stops when it's left alone.** After `--idle-timeout` without a
945
+ request from the page (30 minutes by default; `90s`, `1h`, or `0` for
946
+ never) it wipes the passphrase or key from memory and exits. It holds
947
+ the secret only so that Reload works.
934
948
  - It works on v8 files too, and on passphrase exports from the phone
935
949
  libraries.
936
950
 
@@ -91,7 +91,19 @@
91
91
  <main id="main"></main>
92
92
  <script>
93
93
  "use strict";
94
- const TOKEN = new URLSearchParams(location.search).get("t") || "";
94
+ // The token arrives in the URL once. Keep it for this tab only and take it
95
+ // out of the address bar, so it isn't on the screen or in a copied link. The
96
+ // browser's history still records the first visit; the token stops working
97
+ // when the inspector stops.
98
+ const TOKEN = (() => {
99
+ const fromUrl = new URLSearchParams(location.search).get("t");
100
+ if (fromUrl) {
101
+ try { sessionStorage.setItem("mnemo-inspect-token", fromUrl); } catch (e) {}
102
+ history.replaceState(null, "", location.pathname);
103
+ return fromUrl;
104
+ }
105
+ try { return sessionStorage.getItem("mnemo-inspect-token") || ""; } catch (e) { return ""; }
106
+ })();
95
107
  const main = document.getElementById("main");
96
108
  let view = "memories";
97
109
  const state = { q: "", type: "", agent: "", keyed: "", thread: "", key: null, threadId: null };
@@ -285,7 +297,12 @@ document.getElementById("reload").addEventListener("click", async () => {
285
297
  catch (e) { document.getElementById("loaded").textContent = "reload failed: " + e.message; }
286
298
  finally { btn.disabled = false; btn.textContent = "Reload"; }
287
299
  });
288
- header(); render();
300
+ if (!TOKEN) {
301
+ main.replaceChildren(el("p", { class: "error" },
302
+ "This tab has no access token. Open the URL that `mnemo inspect` printed."));
303
+ } else {
304
+ header(); render();
305
+ }
289
306
  </script>
290
307
  </body>
291
308
  </html>