{"_id":"@aeoess/storage-sqlite","name":"@aeoess/storage-sqlite","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@aeoess/storage-sqlite","version":"0.1.0","description":"SQLite persistence backend for Agent Passport System — single trust domain, WAL mode, atomic transactions","main":"dist/index.js","types":"dist/index.d.ts","type":"module","scripts":{"build":"tsc","test":"npx tsx --test tests/sqlite-backend.test.ts","clean":"rm -rf dist"},"keywords":["agent-passport","aeoess","sqlite","storage","governance"],"author":{"name":"Tymofii Pidlisnyi","email":"tima@aeoess.com"},"license":"Apache-2.0","repository":{"type":"git","url":"git+https://github.com/aeoess/agent-passport-storage-sqlite.git"},"peerDependencies":{"agent-passport-system":">=1.24.0"},"dependencies":{"better-sqlite3":"^11.0.0"},"devDependencies":{"@types/better-sqlite3":"^7.6.0","agent-passport-system":"^1.24.0","typescript":"^5.4.0","tsx":"^4.0.0"},"gitHead":"255937abf95b9ee7de911ab65b9e431fd0fe7347","_id":"@aeoess/storage-sqlite@0.1.0","bugs":{"url":"https://github.com/aeoess/agent-passport-storage-sqlite/issues"},"homepage":"https://github.com/aeoess/agent-passport-storage-sqlite#readme","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-UD9BVzqVUEtChKVm1Wm1osSV2dVPCUIJB5FkaJXWJeLR9lsXI8PYxFpRtCL/4FPOyvkxtlt12tiI+1yW1HkEpw==","shasum":"cb369e6d9149fe8d204335d19e96e7592022c20c","tarball":"https://registry.npmjs.org/@aeoess/storage-sqlite/-/storage-sqlite-0.1.0.tgz","fileCount":6,"unpackedSize":39185,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD7b7gEQJD+4C97jxnqhu2Epri3AEYyK/gLZdVDZ10AFQIhAOl+R3aAHDaHSenjxtQl6olHqPo7qgGz/jh0klze1EHJ"}]},"_npmUser":{"name":"aeoess","email":"tima@aeoess.com"},"directories":{},"maintainers":[{"name":"aeoess","email":"tima@aeoess.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/storage-sqlite_0.1.0_1774501922200_0.779313290718576"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-26T05:12:02.097Z","0.1.0":"2026-03-26T05:12:02.334Z","modified":"2026-03-26T05:12:02.523Z"},"maintainers":[{"name":"aeoess","email":"tima@aeoess.com"}],"description":"SQLite persistence backend for Agent Passport System — single trust domain, WAL mode, atomic transactions","homepage":"https://github.com/aeoess/agent-passport-storage-sqlite#readme","keywords":["agent-passport","aeoess","sqlite","storage","governance"],"repository":{"type":"git","url":"git+https://github.com/aeoess/agent-passport-storage-sqlite.git"},"author":{"name":"Tymofii Pidlisnyi","email":"tima@aeoess.com"},"bugs":{"url":"https://github.com/aeoess/agent-passport-storage-sqlite/issues"},"license":"Apache-2.0","readme":"# @aeoess/storage-sqlite\n\nSQLite persistence backend for [Agent Passport System](https://github.com/aeoess/agent-passport-system). Makes APS deployable — state survives restarts.\n\n## Install\n\n```bash\nnpm install agent-passport-system @aeoess/storage-sqlite\n```\n\n## Usage\n\n```typescript\nimport { SQLiteBackend } from '@aeoess/storage-sqlite'\nimport { createProxyGateway } from 'agent-passport-system'\n\nconst storage = new SQLiteBackend({ path: './gateway.db' })\nawait storage.initialize()\n\n// Use with gateway (PR 3 — coming soon)\n// const gateway = createProxyGateway(config, executor, { storage })\n\n// Or use directly\nawait storage.putAgent(agentRecord)\nawait storage.putDelegation(delegation)\nawait storage.appendReceipt(receipt)\n\n// Atomic spend — no race conditions\nconst res = await storage.reserveSpend('del-001', 50, 'USD')\nif (res.success) {\n  // ... execute action ...\n  await storage.commitSpend(res.reservationId!)\n  // If action fails: await storage.releaseSpend(res.reservationId!)\n}\n\n// Checkpoints with external anchoring\nstorage.onCheckpoint((hash, seq) => {\n  console.log(`Checkpoint ${seq}: ${hash}`)\n  // In production: post to webhook, log to S3, email principal\n})\nawait storage.createCheckpoint('gw-001', gatewayPrivateKey)\n\n// Startup integrity check\nconst report = await storage.verifyIntegrity()\nif (report.errors.length > 0) {\n  console.error('Integrity check failed:', report.errors)\n  // Enter read-only mode or fail closed\n}\n\nawait storage.close()\n```\n\n## What it provides\n\nSingle trust domain persistence. One gateway, one database, one authoritative view of delegations, revocations, receipts, and reputation.\n\n- **WAL mode** — concurrent reads, fast writes\n- **Atomic transactions** — `BEGIN IMMEDIATE` write lock, full rollback on error\n- **Reserve/commit/release spend** — no race conditions even with async execution\n- **Cursor pagination** on receipts — no OOM on large histories\n- **GDPR tombstoning** — redact payload, preserve chain integrity\n- **Signed checkpoints** — monotonic sequence, external anchoring callback\n- **Startup integrity verification** — receipt chain, checkpoint monotonicity, schema version\n- **Auto-pruning** of expired nonces and spend reservations\n\n## What it does NOT provide\n\n- Multi-gateway coordination (use the private gateway product)\n- Revocation propagation across gateways\n- Receipt replication or escrow\n- High-availability / clustering\n- Encryption at rest\n\n## Schema\n\n12 tables: `_meta`, `agents`, `delegations`, `reputation`, `revocations`, `receipts`, `demotions`, `key_rotations`, `replay_nonces`, `spend_reservations`, `checkpoints`. Additive-only migrations. Signed protocol objects stored as raw JSON in `payload` columns — never modified, never re-signed.\n\n## License\n\nApache 2.0 — Copyright 2024-2026 Tymofii Pidlisnyi\n","readmeFilename":"README.md","_rev":"1-109e72e0e35fff68cc919b30fe829df4"}