{"_id":"@aletheia-labs/store-sqlite","_rev":"3-049fc120d40ecd3440c5799c820a8dc5","name":"@aletheia-labs/store-sqlite","dist-tags":{"latest":"0.1.2"},"versions":{"0.1.0":{"name":"@aletheia-labs/store-sqlite","version":"0.1.0","keywords":["aletheia","llm","memory","sqlite","agents"],"license":"Apache-2.0","_id":"@aletheia-labs/store-sqlite@0.1.0","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"2c4a6e4e7318d76315ade8476cee74030e01b32e","tarball":"https://registry.npmjs.org/@aletheia-labs/store-sqlite/-/store-sqlite-0.1.0.tgz","fileCount":31,"integrity":"sha512-7H4Y1YHoxkaD78lU82B+bu5pKM6My8umQDKJfd9xON0wVfqawD76vTZ0sndiWRdNvL6CvUgdodoSNOXgmfhFWA==","signatures":[{"sig":"MEUCIQCW2/w57dXYz5oPbQrPJiHUKoXriJiXSznQuYbsM8YFJgIgAhOQx2vFThpwhUGLpVoFMtmf+Dj836Sw9TrlLtmtQKo=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87400},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-store-sqlite-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/6954f727bff20f5e1bb94168aec8ffaf/aletheia-labs-store-sqlite-0.1.0.tgz","_integrity":"sha512-7H4Y1YHoxkaD78lU82B+bu5pKM6My8umQDKJfd9xON0wVfqawD76vTZ0sndiWRdNvL6CvUgdodoSNOXgmfhFWA==","_npmVersion":"11.7.0","description":"SQLite-backed implementations of @aletheia-labs/core storage interfaces.","directories":{},"_nodeVersion":"25.4.0","dependencies":{"zod":"^3.23.8","better-sqlite3":"^11.5.0","@aletheia-labs/core":"0.1.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0","@types/better-sqlite3":"^7.6.12"},"_npmOperationalInternal":{"tmp":"tmp/store-sqlite_0.1.0_1779043956645_0.15275639148316178","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aletheia-labs/store-sqlite","version":"0.1.1","keywords":["aletheia","llm","memory","sqlite","agents"],"license":"Apache-2.0","_id":"@aletheia-labs/store-sqlite@0.1.1","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"dist":{"shasum":"a39e7f7ac81274581d35e4f4a4a9a0ab947f6595","tarball":"https://registry.npmjs.org/@aletheia-labs/store-sqlite/-/store-sqlite-0.1.1.tgz","fileCount":31,"integrity":"sha512-JbQdsbQyjF+sjGzufl3gNBLPBcp1w9xbJXJeuinuNI6PrCD54qv+filQsVCwbOdT3R26idnd/DxSREanUg+TEA==","signatures":[{"sig":"MEUCIQD2LhJdN9ySUOwDSqITYQUIw0cXr552cDoqw7U4gLHURwIgQVCRDrgQH0P93HLDGOE8nIH3JMUF9N4vD79nhp+mpsE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":87599},"main":"./dist/index.js","type":"module","_from":"file:aletheia-labs-store-sqlite-0.1.1.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest run","build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test:watch":"vitest"},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/50788d40937e99999f45e639eb287583/aletheia-labs-store-sqlite-0.1.1.tgz","_integrity":"sha512-JbQdsbQyjF+sjGzufl3gNBLPBcp1w9xbJXJeuinuNI6PrCD54qv+filQsVCwbOdT3R26idnd/DxSREanUg+TEA==","_npmVersion":"11.7.0","description":"SQLite-backed implementations of @aletheia-labs/core storage interfaces.","directories":{},"_nodeVersion":"25.4.0","dependencies":{"zod":"^3.23.8","better-sqlite3":"^11.5.0","@aletheia-labs/core":"0.1.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"vitest":"^2.1.8","typescript":"^5.6.3","@types/node":"^22.10.0","@types/better-sqlite3":"^7.6.12"},"_npmOperationalInternal":{"tmp":"tmp/store-sqlite_0.1.1_1779046321788_0.8887018941762346","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aletheia-labs/store-sqlite","version":"0.1.2","description":"SQLite-backed implementations of @aletheia-labs/core storage interfaces.","license":"Apache-2.0","type":"module","main":"./dist/index.js","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"dependencies":{"better-sqlite3":"^11.5.0","zod":"^3.23.8","@aletheia-labs/core":"0.2.1"},"devDependencies":{"@types/better-sqlite3":"^7.6.12","@types/node":"^22.10.0","typescript":"^5.6.3","vitest":"^2.1.8"},"publishConfig":{"access":"public"},"keywords":["aletheia","llm","memory","sqlite","agents"],"repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/store-sqlite"},"homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/store-sqlite#readme","bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"},"scripts":{"build":"tsc -p tsconfig.json","typecheck":"tsc -p tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest"},"_id":"@aletheia-labs/store-sqlite@0.1.2","_integrity":"sha512-iuJFRkc1lGpeCLiOiMx+wDaqH/T8PmVgu+ZAdyJD/hL4hnQH9+3Kp9b6iiTkLqTIv0IaUWi/m2nxQZrS+Q+Rjg==","_resolved":"/private/var/folders/9c/lly_9vqs1gv40hnyxgytthg00000gn/T/4b86f65deeac28d67b1c1fcdaaed88d4/aletheia-labs-store-sqlite-0.1.2.tgz","_from":"file:aletheia-labs-store-sqlite-0.1.2.tgz","_nodeVersion":"25.4.0","_npmVersion":"11.7.0","dist":{"integrity":"sha512-iuJFRkc1lGpeCLiOiMx+wDaqH/T8PmVgu+ZAdyJD/hL4hnQH9+3Kp9b6iiTkLqTIv0IaUWi/m2nxQZrS+Q+Rjg==","shasum":"be9ab0001c5d02716367b408dc3bddd7d3723b9e","tarball":"https://registry.npmjs.org/@aletheia-labs/store-sqlite/-/store-sqlite-0.1.2.tgz","fileCount":31,"unpackedSize":87920,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCi5zkNYSwrWvYAVAZFHYDpEsYgzp0obQbpCTuAi54m5gIgNIG9W5FZOZyZNtyogNWA3yN+BDgihlSaZznjf1UeIyI="}]},"_npmUser":{"name":"penagabriel22","email":"penagabriel22@gmail.com"},"directories":{},"maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/store-sqlite_0.1.2_1779475334907_0.6599877576055568"},"_hasShrinkwrap":false}},"time":{"created":"2026-05-17T18:52:36.569Z","modified":"2026-05-22T18:42:15.187Z","0.1.0":"2026-05-17T18:52:36.784Z","0.1.1":"2026-05-17T19:32:01.931Z","0.1.2":"2026-05-22T18:42:15.061Z"},"license":"Apache-2.0","keywords":["aletheia","llm","memory","sqlite","agents"],"description":"SQLite-backed implementations of @aletheia-labs/core storage interfaces.","maintainers":[{"name":"penagabriel22","email":"penagabriel22@gmail.com"}],"readme":"# @aletheia-labs/store-sqlite\n\nSQLite-backed implementations of the storage interfaces declared in `@aletheia-labs/core`.\n\n> **Status**: `0.1.0` public baseline. Event, memory, conflict, migrations, and audit-history paths are live.\n\n## Requirements\n\n- Node 20+.\n- ESM-only. Add `\"type\": \"module\"` to your `package.json`, use `.mjs`, or use\n  a build tool/runtime that handles ESM. CommonJS `require()` is not shipped in\n  `0.1.x`.\n\n## Quickstart\n\n```bash\npnpm add @aletheia-labs/core @aletheia-labs/store-sqlite\n```\n\n```ts\nimport { AletheiaAuthority, staticVisibilityPolicy } from '@aletheia-labs/core';\nimport { openSqliteStores } from '@aletheia-labs/store-sqlite';\n\nconst stores = openSqliteStores('./aletheia.sqlite');\nconst authority = new AletheiaAuthority({\n  eventLedger: stores.eventLedger,\n  memoryStore: stores.memoryStore,\n  conflictRegistry: stores.conflictRegistry,\n  visibilityPolicy: staticVisibilityPolicy([{ kind: 'private:user' }]),\n});\n```\n\nFor an in-memory database in tests or demos:\n\n```ts\nconst stores = openSqliteStores(':memory:');\n```\n\nAlways call `stores.close()` when the host is done.\n\n## What this package provides\n\n- `SqliteEventLedger` — append-only event log, with permission-filtered queries.\n- `SqliteMemoryStore` — atom storage with strict status-transition enforcement and audit history.\n- `SqliteConflictRegistry` — conflicts as first-class records with resolution history.\n- `openSqliteStores(path)` — convenience wrapper that opens one database connection, runs migrations, and returns all three stores with a shared `close()`.\n- `openConnection(options)` — lower-level connection helper for custom wiring.\n- `MIGRATIONS` / `applyMigrations` — embedded, idempotent SQL migrations.\n\n## Storage contract\n\n- Events are append-only.\n- Memory atoms are immutable by ID. Duplicate `memoryId` insertions throw.\n- Content, scope, visibility, source links, and lineage do not have UPDATE paths.\n- Status changes go through `transitionStatus()` and are recorded in `memory_status_history`.\n- Conflict resolution goes through `resolve()` and is recorded in `conflict_resolution_history`.\n- Visibility filtering happens in SQL before rows are decoded.\n- Reads decode through zod-backed codecs; corrupt persisted data becomes a parse error instead of a silent value.\n\n## Example\n\n```ts\nimport { EventSchema } from '@aletheia-labs/core';\nimport { openSqliteStores } from '@aletheia-labs/store-sqlite';\n\nconst stores = openSqliteStores(':memory:');\n\nawait stores.eventLedger.append(\n  EventSchema.parse({\n    eventId: 'evt-1',\n    kind: 'observation',\n    agentId: 'agent-1',\n    occurredAt: '2026-05-17T12:00:00Z',\n    payload: { note: 'source event' },\n    scope: { kind: 'project', projectId: 'demo' },\n    visibility: { kind: 'private:user' },\n  }),\n);\n\nconst events = await stores.eventLedger.query({\n  permittedVisibilities: [{ kind: 'private:user' }],\n  scope: { kind: 'project', projectId: 'demo' },\n  limit: 10,\n});\n\nconsole.log(events.length);\nstores.close();\n```\n\n## What this package does NOT do\n\n- No LLM calls.\n- No semantic retrieval, embeddings, vector index, or ranking.\n- No authorization service or OAuth.\n- No background daemon, watcher, or scheduler.\n- No automatic memory promotion beyond the status transition requested by the host.\n\n## Stability\n\nPublic surface for the initial library cycle:\n\n- `openSqliteStores(path)`\n- `openConnection(options)`\n- `SqliteEventLedger`\n- `SqliteMemoryStore`\n- `SqliteConflictRegistry`\n- migration exports\n\nThe SQL schema is versioned through `schema_migrations`. Future changes that alter persisted rows or zod codecs need both SQL migration and data compatibility notes, because existing SQLite files may fail to decode if the TypeScript schema changes without a migration path.\n\n## Development\n\nFrom the repo root:\n\n```bash\npnpm install\npnpm -F @aletheia-labs/store-sqlite typecheck\npnpm -F @aletheia-labs/store-sqlite test\npnpm -F @aletheia-labs/store-sqlite build\n```\n\nPublish dry-run:\n\n```bash\npnpm -F @aletheia-labs/store-sqlite publish --dry-run --no-git-checks\n```\n","readmeFilename":"README.md","homepage":"https://github.com/lechuit/synaptic-mesh/tree/main/packages/store-sqlite#readme","repository":{"type":"git","url":"git+https://github.com/lechuit/synaptic-mesh.git","directory":"packages/store-sqlite"},"bugs":{"url":"https://github.com/lechuit/synaptic-mesh/issues"}}