memorio 5.1.0 → 5.1.2

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 CHANGED
@@ -1,5 +1,25 @@
1
1
  # 🧠 memorio
2
2
 
3
+ ![banner](https://raw.githubusercontent.com/passariello/container/refs/heads/main/memorio/banner.svg)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/memorio)](https://www.npmjs.com/package/memorio)
6
+ [![license](https://img.shields.io/npm/l/memorio)](./LICENSE)
7
+ [![bundle size](https://img.shields.io/bundlephobia/minzip/memorio)](https://bundlephobia.com/package/memorio)
8
+ [![Socket Badge](https://socket.dev/api/badge/npm/package/memorio)](https://socket.dev/npm/package/memorio)
9
+ [![Known Vulnerabilities](https://snyk.io/test/npm/memorio/badge.svg)](https://snyk.io/test/npm/memorio)
10
+ [![zero deps](https://img.shields.io/badge/dependencies-0-brightgreen)](#security)
11
+ ![Browser](https://img.shields.io/badge/Browser-Chrome%20/%20Firefox%20/%20Safari-gray?logo=google-chrome)
12
+ ![Deno](https://img.shields.io/badge/Deno-compatible-gray?logo=deno)
13
+ ![Edge Workers](https://img.shields.io/badge/Edge%20Workers-compatible-gray)
14
+ ![TypeScript](https://img.shields.io/badge/TypeScript-native-gray?logo=typescript)
15
+ ![React](https://img.shields.io/badge/React-compatible-gray?logo=react)
16
+ ![Tests](https://img.shields.io/badge/tests-500+%20passed-green)
17
+ [![license](https://img.shields.io/npm/l/memorio.svg)](#license)
18
+
19
+ <!--
20
+ [![CI](https://img.shields.io/github/actions/workflow/status/GITHUB_ORG/GITHUB_REPO/ci.yml?branch=main)](https://github.com/GITHUB_ORG/GITHUB_REPO/actions)
21
+ -->
22
+
3
23
  **The memory layer for AI agents and apps — owned by the user, not the vendor.**
4
24
 
5
25
  ```ts
@@ -19,9 +39,9 @@ Just data, available where your application needs it.
19
39
 
20
40
  ## Why memorio
21
41
 
22
- Most AI-powered apps (and most apps in general) eventually need more than "just state": reactive values, persistent data, session data, caches, structured browser storage, local SQL, application memory, history, and optional sync.
42
+ That's the whole API for the simple case. No provider tree, no boilerplate.
23
43
 
24
- Usually that means a different library — and a different mental model — for each. Memorio gives them one consistent runtime, without making the simple case complicated:
44
+ But real apps grow. Most AI-powered apps (and most apps in general) eventually need more than "just state" — persistence, session data, caches, structured browser storage, local SQL, application memory, history, optional sync. Usually that means pulling in a different library — and a different mental model — for each. Memorio gives them one consistent runtime, without making the simple case complicated:
25
45
 
26
46
  ```ts
27
47
  state.value = 42
@@ -64,15 +84,15 @@ observer('state.user', user => {
64
84
  And this is what makes memorio a *memory* layer, not just a state manager - structured, inspectable facts about a user or agent, not just ephemeral UI state:
65
85
 
66
86
  ```ts
67
- import { memorio } from 'memorio'
87
+ import { memory } from 'memorio'
68
88
 
69
- await memorio.memory.remember('user.language', 'Italian', {
89
+ await memory.remember('user.language', 'Italian', {
70
90
  type: 'preference',
71
91
  confidence: 0.92,
72
92
  source: 'conversation'
73
93
  })
74
94
 
75
- const language = await memorio.memory.recall('user.language')
95
+ const language = await memory.recall('user.language')
76
96
  // { value: 'Italian', confidence: 0.92, source: 'conversation', ... }
77
97
  ```
78
98
 
@@ -134,6 +154,18 @@ For most apps, that's enough. Everything below is an optional capability you can
134
154
 
135
155
  ---
136
156
 
157
+ ## Honest limitations
158
+
159
+ Memorio is upfront about what it doesn't do, so you don't find out the hard way:
160
+
161
+ - **No encryption by default.** Data is stored in plain text unless you explicitly turn on `memorio.encryption` or pass an `encryptionKey`. See [`SECURITY.md`](./SECURITY.md).
162
+ - **Namespaces/contexts aren't a security boundary.** `memorio.isolate()` gives you logical separation between tenants or sessions, not authorization or access control — enforce that at your application layer.
163
+ - **SQLite persistence (`sql.js` backend) isn't incremental.** Each write exports and re-saves the whole database, which gets costly as data grows. The `bun:sqlite` backend avoids this cost but doesn't support `export()` at all — see [`markdown/SQLITE.md`](./markdown/SQLITE.md).
164
+ - **`memory.context()` is rule-based, not embedding-based.** It ranks structured entries by recency, confidence, and type — it does not do semantic similarity search. Pair it with a vector store if your agent needs "find things like this."
165
+ - **Key management is your responsibility.** Memorio's encryption is client-side; it doesn't manage, rotate, or store keys for you.
166
+
167
+ ---
168
+
137
169
  ## When to use something else
138
170
 
139
171
  - **A strict Redux-style architecture** - when you need action pipelines, extensive middleware, event-sourcing, or mature time-travel tooling. Memorio can integrate rather than replace - see [`markdown/REDUX.md`](./markdown/REDUX.md).
@@ -152,7 +184,7 @@ For most apps, that's enough. Everything below is an optional capability you can
152
184
  5. **Memory has meaning** - confidence, source, type, scope, TTL, tags, history, status: more than "just a value."
153
185
  6. **Memory belongs to whoever it's about** - structured and inspectable by default, encryptable with a key the vendor doesn't have to hold.
154
186
  7. **Global access is explicit** - opt in with `import 'memorio/global'`, or keep it explicit with named imports.
155
- 8. **Tell the truth about boundaries** - encryption is opt-in (not default), contexts aren't authorization, and there's no embedding search unless paired with one.
187
+ 8. **Tell the truth about boundaries** - encryption is opt-in (not default), contexts aren't authorization, and there's no embedding search unless paired with one. (See [Honest limitations](#honest-limitations) above.)
156
188
  9. **Keep the common case tiny** - `state.value = 42` is a complete, valid program.
157
189
 
158
190
  ---
package/global.cjs CHANGED
@@ -4638,7 +4638,7 @@ init_internal();
4638
4638
 
4639
4639
  // package.json
4640
4640
  var package_default = {
4641
- version: "5.1.0"};
4641
+ version: "5.1.2"};
4642
4642
 
4643
4643
  // core/global.ts
4644
4644
  init_env();
package/global.js CHANGED
@@ -4635,7 +4635,7 @@ init_internal();
4635
4635
 
4636
4636
  // package.json
4637
4637
  var package_default = {
4638
- version: "5.1.0"};
4638
+ version: "5.1.2"};
4639
4639
 
4640
4640
  // core/global.ts
4641
4641
  init_env();
package/index.cjs CHANGED
@@ -4635,7 +4635,7 @@ init_internal();
4635
4635
 
4636
4636
  // package.json
4637
4637
  var package_default = {
4638
- version: "5.1.0"};
4638
+ version: "5.1.2"};
4639
4639
 
4640
4640
  // core/global.ts
4641
4641
  init_env();
package/index.js CHANGED
@@ -4632,7 +4632,7 @@ init_internal();
4632
4632
 
4633
4633
  // package.json
4634
4634
  var package_default = {
4635
- version: "5.1.0"};
4635
+ version: "5.1.2"};
4636
4636
 
4637
4637
  // core/global.ts
4638
4638
  init_env();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "memorio",
3
3
  "codeName": "memorio",
4
- "version": "5.1.0",
4
+ "version": "5.1.2",
5
5
  "description": "Memorio, State + Observer, Store and iDB for an easy life - Cross-platform compatible",
6
6
  "main": "./index.cjs",
7
7
  "browser": {
@@ -0,0 +1,14 @@
1
+ declare module 'bun:sqlite' {
2
+ export class Database {
3
+ constructor(path: string)
4
+ run(sql: string, ...params: any[]): any
5
+ query(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
6
+ close(): void
7
+ prepare(sql: string): { all(...params: any[]): any[]; get(...params: any[]): any }
8
+ }
9
+ export class Statement {
10
+ all(...params: any[]): any[]
11
+ get(...params: any[]): any
12
+ run(...params: any[]): any
13
+ }
14
+ }
@@ -29,8 +29,8 @@ interface _encryption {
29
29
  deriveKey: (
30
30
  password: string,
31
31
  salt?: string | Uint8Array,
32
- alg?: 'AES-GCM' | 'AES-CBC'
33
- iterations?: number
32
+ alg?: 'AES-GCM' | 'AES-CBC',
33
+ iterations?: number
34
34
  ) => Promise<CryptoKey>
35
35
 
36
36
  /**
package/vsix/memorio.vsix CHANGED
Binary file