{"_id":"@absolutejs/agent-exchange-secure-messaging-stores","name":"@absolutejs/agent-exchange-secure-messaging-stores","dist-tags":{"latest":"0.0.1"},"versions":{"0.0.1":{"name":"@absolutejs/agent-exchange-secure-messaging-stores","version":"0.0.1","description":"Tenant-scoped atomic memory, Redis, and PostgreSQL receipt stores for Agent Exchange secure messaging.","type":"module","license":"Apache-2.0","author":{"name":"Alex Kahn"},"repository":{"type":"git","url":"git+https://github.com/absolutejs/agent-exchange-providers.git","directory":"secure-messaging-stores"},"homepage":"https://github.com/absolutejs/agent-exchange-providers/tree/main/secure-messaging-stores","bugs":{"url":"https://github.com/absolutejs/agent-exchange-providers/issues"},"main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js","default":"./dist/index.js"},"./migrations/postgres.sql":"./migrations/001_receipts.sql"},"publishConfig":{"access":"public"},"scripts":{"build":"rm -rf dist && bun build src/index.ts --outdir dist --root src --sourcemap --target=browser --external @absolutejs/agent-exchange --external @absolutejs/agent-exchange-secure-messaging && tsc --project tsconfig.build.json","check:package":"bun run format:check && bun run typecheck && bun run test && bun run build","format":"prettier --write \"./**/*.{ts,json,md}\"","format:check":"prettier --check \"./**/*.{ts,json,md}\"","release":"bun run check:package && npm publish --access public","test":"bun test tests/","typecheck":"tsc --noEmit"},"peerDependencies":{"@absolutejs/agent-exchange":">=0.5.0 <0.6","@absolutejs/agent-exchange-secure-messaging":">=0.1.0 <0.2"},"devDependencies":{"@absolutejs/agent-exchange":"0.5.0","@absolutejs/agent-exchange-secure-messaging":"0.1.0"},"_id":"@absolutejs/agent-exchange-secure-messaging-stores@0.0.1","gitHead":"5e62a0f8d8291cb35a29fd0217f8473cdc8cf05b","_nodeVersion":"22.14.0","_npmVersion":"10.9.2","dist":{"integrity":"sha512-SwRD1fF/iRPIf64t4U/h/AAdZeqAsO6VxVS0tEJhomwih08q6mnXqplyWUSKtvEoY06zbhTGmX77hU6afSk+Sw==","shasum":"83aa9c8885409b53b901357df6eb949d793ef509","tarball":"https://registry.npmjs.org/@absolutejs/agent-exchange-secure-messaging-stores/-/agent-exchange-secure-messaging-stores-0.0.1.tgz","fileCount":8,"unpackedSize":50516,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQClFW9rNUJSdE+v7mRy7WiG1JGK2CEtCAOCB6G+ifUocAIhAM+9hBUBwqXIk/28uaMGGYpV4e4oBp2y+MmAlGTqpY2q"}]},"_npmUser":{"name":"alexkahndev","email":"alexkahn2019@gmail.com"},"directories":{},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/agent-exchange-secure-messaging-stores_0.0.1_1787872707506_0.0830884006535959"},"_hasShrinkwrap":false}},"time":{"created":"2026-08-27T23:18:27.334Z","0.0.1":"2026-08-27T23:18:27.646Z","modified":"2026-08-27T23:18:27.892Z"},"maintainers":[{"name":"alexkahndev","email":"alexkahn2019@gmail.com"}],"description":"Tenant-scoped atomic memory, Redis, and PostgreSQL receipt stores for Agent Exchange secure messaging.","homepage":"https://github.com/absolutejs/agent-exchange-providers/tree/main/secure-messaging-stores","repository":{"type":"git","url":"git+https://github.com/absolutejs/agent-exchange-providers.git","directory":"secure-messaging-stores"},"author":{"name":"Alex Kahn"},"bugs":{"url":"https://github.com/absolutejs/agent-exchange-providers/issues"},"license":"Apache-2.0","readme":"# `@absolutejs/agent-exchange-secure-messaging-stores`\n\nTenant-scoped, atomic receipt stores for\n`@absolutejs/agent-exchange-secure-messaging`. The package provides memory,\nRedis, and PostgreSQL implementations behind the same receipt-store contract.\n\n```ts\nconst receipts = createRedisAgentExchangeReceiptStore({\n  client: redisAdapter,\n  tenantId: authenticatedTenant.id,\n});\n```\n\nThe tenant is bound when a store is constructed; callers cannot select a tenant\nper operation. Tenant and exchange identifiers are SHA-256 digested before use\nin keys. Receipts are strictly parsed, size bounded, expiration aware, and\ncompared as canonical JSON. Saving an identical receipt and expiry returns\n`duplicate`; any different receipt or expiry for that live key returns\n`conflict`.\n\n## Redis adapter\n\nImplement `get(key)` and `eval(script, keys, arguments_)` with the official\nclient of your choice. The exported Lua script performs compare-or-insert and\nabsolute expiration (`PXAT`) as one Redis operation. Do not replace it with a\nclient-side `GET` followed by `SET`.\n\n## PostgreSQL adapter and migration\n\nRun `AGENT_EXCHANGE_RECEIPT_POSTGRES_MIGRATION` through your normal migration\nsystem before constructing the store. The same idempotent SQL ships at the\nexported `./migrations/postgres.sql` package subpath for migration tools. Pass a\nclient with a parameterized `query(text, values)` method. Save uses one `INSERT ... ON CONFLICT ...\nRETURNING` statement, including a random per-attempt token, to distinguish a new\nwrite from duplicate and conflicting concurrent writes without a read/write\nrace.\n\nCall `deleteExpired({ now })` from a repeatable maintenance job until it returns\nzero. It deletes at most 1,000 rows per call by default; `batchSize` is bounded\nto 10,000. Redis expiry is automatic.\n\nThe memory store is process-local and intended for tests and examples only.\n\nLicensed under Apache-2.0.\n","readmeFilename":"README.md","_rev":"1-2914f4116de059419eaccd4c5481c429"}