{"_id":"@lushly-dev/local-db","_rev":"12-aa59ec434be299e54a2a79dfa639d50f","name":"@lushly-dev/local-db","dist-tags":{"latest":"2.5.0"},"versions":{"0.1.0":{"name":"@lushly-dev/local-db","version":"0.1.0","keywords":["local-storage","lowdb","adapter","schema-migration","persistence"],"license":"MIT","_id":"@lushly-dev/local-db@0.1.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/libraries#readme","bugs":{"url":"https://github.com/lushly-dev/libraries/issues"},"dist":{"shasum":"bca2919ff98d9c71d7ce6bc2827d3303a92d5c2e","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-0.1.0.tgz","fileCount":5,"integrity":"sha512-iNc6gS/RVuHoBddRsKcAixT3PEj2ax15UEUtJN2dO9QdWQi29YN6/inK19nBuAk3aGmb2rE6ViqDjWAXp6s09w==","signatures":[{"sig":"MEUCIQCD1BgkzrZol5efc7msProOdPGz6W1Nrz1Nnq6R8egISgIgCMyw82a18wtFI3lexfO6JnXT0veep1ub9SBZYqmLKhs=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":14074},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-0.1.0.tgz","types":"./dist/index.d.ts","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"test":"vitest watch","build":"tsc --project tsconfig.build.json","test:run":"vitest run","typecheck":"tsc --noEmit"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/f8eb9a72537625590532758186c30c45/lushly-dev-local-db-0.1.0.tgz","_integrity":"sha512-iNc6gS/RVuHoBddRsKcAixT3PEj2ax15UEUtJN2dO9QdWQi29YN6/inK19nBuAk3aGmb2rE6ViqDjWAXp6s09w==","repository":{"url":"git+https://github.com/lushly-dev/libraries.git","type":"git","directory":"ts/packages/local-db"},"_npmVersion":"10.9.4","description":"Schema-migrating local storage adapter with swappable backends (LocalStorage, in-memory) and per-namespace data isolation.","directories":{},"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"lowdb":"^7.0.0","vitest":"^3.0.0","typescript":"^5.7.0"},"peerDependencies":{"lowdb":"^7.0.0"},"peerDependenciesMeta":{"lowdb":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/local-db_0.1.0_1771410407769_0.5791365820248335","host":"s3://npm-registry-packages-npm-production"}},"0.4.0":{"name":"@lushly-dev/local-db","version":"0.4.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@0.4.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"6793d29f25e5e0b028fab81ff51340fdd9c706f6","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-0.4.0.tgz","fileCount":19,"integrity":"sha512-LXz2TpWZqqMNwdio3lk3wtBYgTsLXw2BFqsi8ds6u7FaT0EAalgzi1AEFasanDVwrzbo4bmMrecb/yDy8rjZyw==","signatures":[{"sig":"MEQCIBkeiFSsNcpJztdMMilaTZ7lsfBv32+/GX16dqH8Ge6MAiB7JP/evSvD55Tv0eiKtEAAlDKMCZitWpmoQHB5Ia9rZQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@0.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36504},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-0.4.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/25fa3c269e44cf4341b5fbad846f40f0/lushly-dev-local-db-0.4.0.tgz","_integrity":"sha512-LXz2TpWZqqMNwdio3lk3wtBYgTsLXw2BFqsi8ds6u7FaT0EAalgzi1AEFasanDVwrzbo4bmMrecb/yDy8rjZyw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"10.9.4","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","vitest":"^4.0.18","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/local-db_0.4.0_1772310058895_0.2380389235545155","host":"s3://npm-registry-packages-npm-production"}},"0.5.0":{"name":"@lushly-dev/local-db","version":"0.5.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@0.5.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"3c5fd2f27246d4ccf0d867247cb42d78fa72c50d","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-0.5.0.tgz","fileCount":19,"integrity":"sha512-B2D4cUABxHv5Cd4SPbquBtHShDY+pLViVEXSa2nXvXwGCoIOnP1q+4rC63f1XKJ8hb445t38W7WfJ022egy1bw==","signatures":[{"sig":"MEQCIHzd3OgZ+TfVKgdRhaTrLj8YtSq6iJSVeVwAFizb1sg2AiADq7wQ87IruonCcAPpN1T2zisF1GXK/JXlBKDVwqbh9g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@0.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36504},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-0.5.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=20.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/b79af0867470935ec1127fed79ad9909/lushly-dev-local-db-0.5.0.tgz","_integrity":"sha512-B2D4cUABxHv5Cd4SPbquBtHShDY+pLViVEXSa2nXvXwGCoIOnP1q+4rC63f1XKJ8hb445t38W7WfJ022egy1bw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"10.9.4","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"22.22.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.0.1","vitest":"^4.0.18","typescript":"^5.7.2","@types/node":"^22.10.2","@vitest/coverage-v8":"^4.0.18"},"_npmOperationalInternal":{"tmp":"tmp/local-db_0.5.0_1773188881919_0.07771750822103574","host":"s3://npm-registry-packages-npm-production"}},"0.6.0":{"name":"@lushly-dev/local-db","version":"0.6.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@0.6.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"8205dd0c2d627ce28c7fd4ebd662eb19bcd26977","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-0.6.0.tgz","fileCount":19,"integrity":"sha512-gzB0AjGvMk1cliueQgBkf0W5Du228Y3yEQlOC6lIzQFPTYPFRUr+SDiUY7mvh4Vwm4oQy9x5SvjXhpx1lN7wMA==","signatures":[{"sig":"MEUCIHeSVSdruX5+JqS9hp4g5buzC0svVeeJKM3SCHXK0VOlAiEAyLO6SkrnLedG6kYB6HVQxc3CVWUutOIzF3w2uH8nNpg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@0.6.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36501},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-0.6.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/5250a064ce792c7a1cf78ff8003056aa/lushly-dev-local-db-0.6.0.tgz","_integrity":"sha512-gzB0AjGvMk1cliueQgBkf0W5Du228Y3yEQlOC6lIzQFPTYPFRUr+SDiUY7mvh4Vwm4oQy9x5SvjXhpx1lN7wMA==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.9.0","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^25.5.0","@vitest/coverage-v8":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/local-db_0.6.0_1773466658891_0.5820196028488538","host":"s3://npm-registry-packages-npm-production"}},"1.0.0":{"name":"@lushly-dev/local-db","version":"1.0.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@1.0.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"cbfa484fe65db0dfa5bdf835ff74d04966958883","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-1.0.0.tgz","fileCount":19,"integrity":"sha512-XswFxeNyFu9DwVfdNGINquTHBA9fTMsQaJtZht6gddJalHHK+GqXeKkn8Nhg1Ur2xjqB59H/NUIZCDsX4rXlKw==","signatures":[{"sig":"MEQCICueEZBvCoHd4nKTKhthUBQVyLyu+0HObGgbVyePWlocAiAqTxNecWY4ArLsI3p40XPO57kShWl3WC57vEHPx2EMOA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@1.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":36501},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-1.0.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc --noEmit","test:watch":"vitest"},"_npmUser":{"name":"lushly-admin","email":"falkicon@gmail.com"},"_resolved":"/tmp/db442e8f852755e3a42f7b20ffc5d787/lushly-dev-local-db-1.0.0.tgz","_integrity":"sha512-XswFxeNyFu9DwVfdNGINquTHBA9fTMsQaJtZht6gddJalHHK+GqXeKkn8Nhg1Ur2xjqB59H/NUIZCDsX4rXlKw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.9.0","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.14.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.0","typescript":"^5.9.3","@types/node":"^25.5.0","@vitest/coverage-v8":"^4.1.0"},"_npmOperationalInternal":{"tmp":"tmp/local-db_1.0.0_1773633892302_0.10056882035108083","host":"s3://npm-registry-packages-npm-production"}},"2.0.0":{"name":"@lushly-dev/local-db","version":"2.0.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.0.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"afcb36fce9f79e16906210af57bc4a8da13fd9f5","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.0.0.tgz","fileCount":23,"integrity":"sha512-YWSMUsnqtCZlvmVVRq0tPHhwlniM5CtIQfvEfF5Gk2rIiYSjba6/QUBx4Pb+bAfNcXj8OsxywADP7/wG+8Wz9g==","signatures":[{"sig":"MEUCIQCycyVo404q6Y+r+ib4KVWw/gjIO+Qtpu2CpQ8xITo7UQIgNdG4rWfH67yDrzV7iIzIarylex5/DHkUcOiDTcVXQPU=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIECnTbniJNQ7xKf34Ua978yeHDsXTJEGzUqdOZDbN2SjAiA2C5o5Ob0UNbVLxNL7WOG9NXQW0zFDxH/tiMT0OybVVQ==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.0.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":56463},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-2.0.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/tmp/0e1b30203480226bf81beb3328de59dc/lushly-dev-local-db-2.0.0.tgz","_integrity":"sha512-YWSMUsnqtCZlvmVVRq0tPHhwlniM5CtIQfvEfF5Gk2rIiYSjba6/QUBx4Pb+bAfNcXj8OsxywADP7/wG+8Wz9g==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.19.0","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.11","typescript":"^5.9.3","@types/node":"^25.9.5","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.0.0_1791773985360_0.32399614138989974","host":"s3://npm-registry-packages-npm-production"}},"2.1.0":{"name":"@lushly-dev/local-db","version":"2.1.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.1.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"606aa30ef25010c17c0248bc391748dc415c9560","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.1.0.tgz","fileCount":23,"integrity":"sha512-ZosicGBgNux95nozQzwPNxPtt92BDTQrvLQmrJp/v/6eW1CyWmcbHvfU4ak90SOTWlpqtPa76XQbxn7EdQNjrw==","signatures":[{"sig":"MEYCIQCXYf5iVzA4b2iySpwZsmyS283B63PbjhuQK2pWOt2x5gIhAO4QRCnAV81ST2p1E7Ke+C8/bkaDDqZG1+33V9Ks1/gN","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIFhABsDu01gdwn79nhh+A0fLQdMP7eXPFkMzknQt4DFkAiEAukkf4nMNxRjv33xSoqKH5TYJOpXdB+zCDPYEmyCXCzg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":58639},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-2.1.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/tmp/fa78f5c4403d4aea9599304a0a2405d8/lushly-dev-local-db-2.1.0.tgz","_integrity":"sha512-ZosicGBgNux95nozQzwPNxPtt92BDTQrvLQmrJp/v/6eW1CyWmcbHvfU4ak90SOTWlpqtPa76XQbxn7EdQNjrw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.19.0","description":"Async data adapter with swappable backends (Memory, HTTP, Browser) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.11","typescript":"^5.9.3","@types/node":"^25.9.5","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.1.0_1791774594553_0.454907195759622","host":"s3://npm-registry-packages-npm-production"}},"2.2.0":{"name":"@lushly-dev/local-db","version":"2.2.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.2.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"25b93c62fa4e25dd0e6e0c9f471ffad80e20a7da","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.2.0.tgz","fileCount":23,"integrity":"sha512-qaichVQnRVLrEmXcqcdR0khChh5iuh1Z6qQhi+Eu9PjSp6vMWheunAdywWT7Dn6KC4n0FGyjYX1rymWWG6/oYg==","signatures":[{"sig":"MEUCIGn1SQZr/4p3ePY354GSuo0OYVrNOeDikHi8e6ztmoweAiEAomgo3KbST7N9gSlFRDmTEzT/49Zpb6nNYIl4gqq+1dY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIEc7zR5K968ojJ2Rxh1UNf9NUcM8PuwGnOKsz+dEiYkVAiAVD53dq087t6j/L1DQXYhyPPGFcyUcSj1znEEBWhfPWA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.2.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59274},"main":"./dist/index.js","type":"module","_from":"file:lushly-dev-local-db-2.2.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","test:hosted":"node hosted/run-phase.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/tmp/671e0cdddfb42f168c7fc01caa11ac91/lushly-dev-local-db-2.2.0.tgz","_integrity":"sha512-qaichVQnRVLrEmXcqcdR0khChh5iuh1Z6qQhi+Eu9PjSp6vMWheunAdywWT7Dn6KC4n0FGyjYX1rymWWG6/oYg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.19.0","description":"Async data adapter with swappable backends (Memory, HTTP) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.21.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.11","typescript":"^5.9.3","@types/node":"^25.9.5","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.2.0_1793086523521_0.027706524696670898","host":"s3://npm-registry-packages-npm-production"}},"2.2.1":{"name":"@lushly-dev/local-db","version":"2.2.1","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.2.1","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"dcc817814bba32a1d606d6b5585c7e0002bf3a74","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.2.1.tgz","fileCount":23,"integrity":"sha512-LFapHHfWXGMA7qe25udi070BaJSvPcnURxo1wu4cL3teJCc8itb1VwvG3W7FFWxidjtyb91j04dlczleq6YFHQ==","signatures":[{"sig":"MEUCIGhL5+SmUFMOIXdYwfraXVtwblAblmYW4BbjD1Je5/f/AiEAuXXLAWXLBfKZ3TR0W2011sTHyuDeiNJDXVbXOBMkk3Q=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQC0ecnVpiLHee66i7DZGnQZhL2LnjboEEOY1/aPE03nVAIhAPjG7sLZ/L6FtY6VVnjfnd2Og4GSlBoys+YDn5xfcise","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.2.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":59274},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.2.1.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","test:hosted":"node hosted/run-phase.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.2.1.tgz","_integrity":"sha512-LFapHHfWXGMA7qe25udi070BaJSvPcnURxo1wu4cL3teJCc8itb1VwvG3W7FFWxidjtyb91j04dlczleq6YFHQ==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.19.1","description":"Async data adapter with swappable backends (Memory, HTTP) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"24.22.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.11","typescript":"^5.9.3","@types/node":"^25.9.5","@vitest/coverage-v8":"^4.1.11"},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.2.1_1793272657640_0.09432032341939534","host":"s3://npm-registry-packages-npm-production"}},"2.3.0":{"name":"@lushly-dev/local-db","version":"2.3.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","indexeddb","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.3.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"57ce209a12490fd135daa4292ba96f17da16683f","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.3.0.tgz","fileCount":31,"integrity":"sha512-6OrLBOxrFIQxzBe/znpIbmZR4UKVAyKxe8bdKX9d5+FTgMFoIYrw86xvn7jsvmY7NpLG1AXfs5TcyZ60K6QpIw==","signatures":[{"sig":"MEUCIQD4bUSuDLidD01nZi80tKRajqcGRrHx+paKKtmcpeUlEgIgR8oMWRKSIy7lKTU21+E15V6nh9ElC6lnlNS5SUPKHY0=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDRTvCWIhM+COtrIfXE8l97ysS/MNVccy98DTbMrAVGxAIhAKwPsGH3CaMoN9tiYgXOQ0GoKvzdbrWidhNEDJsPSExJ","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.3.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":119849},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.3.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./indexeddb":{"types":"./dist/indexeddb-adapter.d.ts","import":"./dist/indexeddb-adapter.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","test:hosted":"node hosted/run-phase.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.3.0.tgz","_integrity":"sha512-6OrLBOxrFIQxzBe/znpIbmZR4UKVAyKxe8bdKX9d5+FTgMFoIYrw86xvn7jsvmY7NpLG1AXfs5TcyZ60K6QpIw==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.20.0","description":"Async data adapter with swappable backends (Memory, HTTP, IndexedDB) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"26.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.3","vitest":"^4.1.12","typescript":"^7.0.2","@types/node":"^26.6.6","fake-indexeddb":"^6.2.7","@vitest/coverage-v8":"^4.1.12"},"peerDependencies":{"vitest":">=1.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.3.0_1794115358841_0.9258814213902302","host":"s3://npm-registry-packages-npm-production"}},"2.4.0":{"name":"@lushly-dev/local-db","version":"2.4.0","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","indexeddb","data-layer"],"author":{"name":"Falkicon"},"license":"MIT","_id":"@lushly-dev/local-db@2.4.0","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"homepage":"https://github.com/lushly-dev/afd#readme","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"2c2fdc0271179996ffbae617e161d6ef2a2ae365","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.4.0.tgz","fileCount":31,"integrity":"sha512-gngwQT9V41jvTCwsy4GFtj7taz1jk0mvy9kT1+0M7XwpERwjei6zoVgTsX6vsBYUah6UTKjEgDXb2gyoc7b6Fg==","signatures":[{"sig":"MEUCIQDxn6B7PC27cEHk6Ir3bQnImZJF/JHcNRko1lGw6R7/iAIgWsoMfHW9m+FynvqkswJ1szjtaaDjAbv+y0tn/mUA/70=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDH3A9A+8c3Q/IqGU0umpeETr7R1bYpqJeHTDkyM7S+sQIhALQdcsTaGm1ERvOrsrhPlgvfwry21HaB71PE0Wmogtl8","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.4.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":119847},"main":"./dist/index.js","type":"module","_from":"file:/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.4.0.tgz","types":"./dist/index.d.ts","engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./indexeddb":{"types":"./dist/indexeddb-adapter.d.ts","import":"./dist/indexeddb-adapter.js"}},"scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","test:hosted":"node hosted/run-phase.mjs"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"_resolved":"/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.4.0.tgz","_integrity":"sha512-gngwQT9V41jvTCwsy4GFtj7taz1jk0mvy9kT1+0M7XwpERwjei6zoVgTsX6vsBYUah6UTKjEgDXb2gyoc7b6Fg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.20.0","description":"Async data adapter with swappable backends (Memory, HTTP, IndexedDB) for Agent-First Development","directories":{},"sideEffects":false,"_nodeVersion":"26.13.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.4","vitest":"^5.1.0","typescript":"^7.0.2","@types/node":"^26.6.6","fake-indexeddb":"^6.2.7","@vitest/coverage-v8":"^5.1.0"},"peerDependencies":{"vitest":">=1.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/local-db_2.4.0_1794309066488_0.08899303401275882","host":"s3://npm-registry-packages-npm-production"}},"2.5.0":{"_id":"@lushly-dev/local-db@2.5.0","bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"dist":{"shasum":"2151431b81782804c35436eda21e5a9371f63fcd","tarball":"https://registry.npmjs.org/@lushly-dev/local-db/-/local-db-2.5.0.tgz","fileCount":35,"integrity":"sha512-jkW4onwDHqiXRk4n6W/Xj/xecfJNG1MsZhTFWx10jbnlW4GstsQJoUNpPloZgs8YUnSrP4U6vhbh0PCG7xb2Lg==","signatures":[{"sig":"MEYCIQD1iY8vsjegdrs7VdpGI9gDlKlBm1cmIYff6InV1g16bQIhAOoJ4JmeKkRkGuou67Udi9JIHickU0yBml8uEjsAvMJC","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQD10YiyaBviGswwOQMkF+2T2Z1qv2vj+SNI20ST5BGzYgIhAKVup/R80lDPQzoMBE2iAR/xqnPIzqCAn833mbmBRaY4"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@lushly-dev%2flocal-db@2.5.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":153251},"main":"./dist/index.js","name":"@lushly-dev/local-db","type":"module","_from":"file:/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.5.0.tgz","types":"./dist/index.d.ts","author":{"name":"Falkicon"},"engines":{"node":">=22.12.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"},"./sqlite":{"types":"./dist/sqlite-adapter.d.ts","import":"./dist/sqlite-adapter.js"},"./testing":{"types":"./dist/testing.d.ts","import":"./dist/testing.js"},"./indexeddb":{"types":"./dist/indexeddb-adapter.d.ts","import":"./dist/indexeddb-adapter.js"}},"license":"MIT","scripts":{"dev":"tsc --watch","test":"vitest run","build":"tsc","clean":"rimraf dist *.tsbuildinfo","typecheck":"tsc -p tsconfig.typecheck.json","test:watch":"vitest","test:hosted":"node hosted/run-phase.mjs"},"version":"2.5.0","_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"cb87d561-3073-43cc-b578-ba7e38a15ece"}},"homepage":"https://github.com/lushly-dev/afd#readme","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","indexeddb","data-layer"],"_resolved":"/home/runner/work/_temp/npm-plan.json.artifacts/5/lushly-dev-local-db-2.5.0.tgz","_integrity":"sha512-jkW4onwDHqiXRk4n6W/Xj/xecfJNG1MsZhTFWx10jbnlW4GstsQJoUNpPloZgs8YUnSrP4U6vhbh0PCG7xb2Lg==","repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"_npmVersion":"11.20.0","description":"Async data adapter with swappable backends (Memory, HTTP, IndexedDB, SQLite) for Agent-First Development","directories":{},"maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"sideEffects":false,"_nodeVersion":"26.13.1","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"rimraf":"^6.1.4","vitest":"^5.1.1","typescript":"^7.0.2","@types/node":"^26.6.6","fake-indexeddb":"^6.2.8","@vitest/coverage-v8":"^5.1.1"},"peerDependencies":{"vitest":">=1.0.0"},"peerDependenciesMeta":{"vitest":{"optional":true}},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/local-db_2.5.0_1795488921591_0.09111294290898264"}}},"time":{"created":"2026-02-18T10:26:47.649Z","modified":"2026-11-24T02:55:22.083Z","0.1.0":"2026-02-18T10:26:47.925Z","0.4.0":"2026-02-28T20:20:59.026Z","0.5.0":"2026-03-11T00:28:02.109Z","0.6.0":"2026-03-14T05:37:39.060Z","1.0.0":"2026-03-16T04:04:52.452Z","2.0.0":"2026-10-12T02:59:45.452Z","2.1.0":"2026-10-12T03:09:54.632Z","2.2.0":"2026-10-27T07:35:23.607Z","2.2.1":"2026-10-29T11:17:37.721Z","2.3.0":"2026-11-08T05:22:38.950Z","2.4.0":"2026-11-10T11:11:06.601Z","2.5.0":"2026-11-24T02:55:21.717Z"},"bugs":{"url":"https://github.com/lushly-dev/afd/issues"},"author":{"name":"Falkicon"},"license":"MIT","homepage":"https://github.com/lushly-dev/afd#readme","keywords":["afd","agent-first","database","adapter","sqlite","local-storage","indexeddb","data-layer"],"repository":{"url":"git+https://github.com/lushly-dev/afd.git","type":"git","directory":"packages/local-db"},"description":"Async data adapter with swappable backends (Memory, HTTP, IndexedDB, SQLite) for Agent-First Development","maintainers":[{"name":"lushly-admin","email":"falkicon@gmail.com"}],"readme":"# @lushly-dev/local-db\n\nAsync data adapter with swappable backends for [Agent-First Development](https://github.com/lushly-dev/afd).\n\n## Why\n\nAFD commands need persistent storage, but the backend varies:\n- **Unit tests** need fast, in-memory storage with no setup\n- **Browser apps** need offline storage in IndexedDB\n- **Servers and tools** need a file on disk: SQLite through Node.js's `node:sqlite`\n- **Local dev** needs a REST API backed by SQLite or similar\n- **Production** needs a cloud database (Azure SQL, Cosmos DB, Postgres)\n\n`@lushly-dev/local-db` provides a single `DataAdapter` interface that all backends implement. Your commands write to the interface once — swap the backend by changing one line.\n\n## Installation\n\n```bash\nnpm install @lushly-dev/local-db\n# or\npnpm add @lushly-dev/local-db\n```\n\n## Quick start\n\n```ts\nimport { createMemoryAdapter, createHttpAdapter } from '@lushly-dev/local-db';\n\n// Tests — no server needed\nconst db = createMemoryAdapter({\n  users: [{ id: 'u1', name: 'Alice' }],\n});\n\n// Production — talks to your REST API\nconst db = createHttpAdapter('https://api.example.com/v1');\n\n// Same API either way\nconst user = await db.get('users', 'u1');\nconst all = await db.list('users', { limit: 10 });\nawait db.create('users', { name: 'Bob' });\nawait db.update('users', 'u1', { name: 'Updated' });\nawait db.remove('users', 'u1');\n```\n\n## API\n\n### `DataAdapter` interface\n\n| Method | Signature | Description |\n|--------|-----------|-------------|\n| `get` | `get<T>(table, id): Promise<T \\| null>` | Get record by ID (`null` if missing) |\n| `list` | `list<T>(table, params?): Promise<ListResult<T>>` | List with filter/sort/paginate |\n| `create` | `create<T>(table, data): Promise<T>` | Create a record |\n| `update` | `update<T>(table, id, patch): Promise<T>` | Merge a patch; 404 if missing (upsert tables create) |\n| `remove` | `remove(table, id): Promise<void>` | Delete a record (missing is fine) |\n| `batch` | `batch(ops): Promise<BatchResult>` | Atomic multi-operation |\n| `health` | `health(): Promise<HealthStatus>` | Backend health check |\n\n## Entry points\n\n| Import | Contents | Runs in |\n|--------|----------|---------|\n| `@lushly-dev/local-db` | `DataAdapter` and its types, `MemoryAdapter`, `HttpAdapter`, `DataAdapterError` | Node.js and browsers |\n| `@lushly-dev/local-db/indexeddb` | `IndexedDbAdapter`, `createIndexedDbAdapter` | Browsers, workers and webviews (or Node.js with `fake-indexeddb`) |\n| `@lushly-dev/local-db/sqlite` | `SqliteAdapter`, `createSqliteAdapter` | Node.js 22.13 or later (`node:sqlite`) |\n| `@lushly-dev/local-db/testing` | `runDataAdapterContract`, the contract suite | Vitest, in Node.js or browser mode |\n\n### Contract\n\n`MemoryAdapter`, `HttpAdapter`, `IndexedDbAdapter` and `SqliteAdapter` pass one shared contract test suite, so\ntests written against the memory adapter describe production behavior:\n\n- **Records are JSON copies.** Changing a returned object, or the object you passed in, never\n  changes stored data. Values are stored as JSON, so a `Date` comes back as an ISO string and\n  `undefined` properties are dropped, exactly as over HTTP.\n- **`update()` of a missing record rejects** with a `DataAdapterError` whose `status` is 404, and\n  creates nothing. The upsert tables (`settings`, `flags`, `feature_flags`, `feature_data`,\n  `keyboard_shortcuts`) are the exception: there `update()` creates the record (`HttpAdapter`\n  sends `PUT`).\n- **`remove()` of a missing record succeeds.**\n- **Order without `sort` is the backend's:** insertion order in `MemoryAdapter`, ID order in\n  `IndexedDbAdapter`, the server's in `HttpAdapter`. Pass `sort` when order matters.\n- **Table and record names** can be any string except `''`, `.` and `..`, which reject with a\n  400 `DataAdapterError` (`code: 'INVALID_NAME'`). `HttpAdapter` sends an unmapped table as one\n  percent-encoded path segment, so names like `constructor` or `../admin` stay inside the base\n  URL.\n- **`batch()` is all or nothing.** Operations run in order (`PUT` upserts, `PATCH` needs an\n  existing record). If one fails (any status of 400 or more, except a `GET` of a missing record,\n  which reports 404 with `data: null`), no write is applied: the failed operation keeps its\n  status and error, every other operation reports `424`, and the summary counts all of them as\n  failed. `HttpAdapter` sends the batch as one `POST /batch`, so the server must implement the\n  same semantics.\n- **Errors** reject with `DataAdapterError` (`status`, `code`: `NOT_FOUND`, `CONFLICT`,\n  `INVALID_NAME`, `INVALID_PATH` or `HTTP_<status>`; `IndexedDbAdapter` adds\n  `STORAGE_UNAVAILABLE` and `STORAGE_ERROR`).\n\n#### Running the contract against your adapter\n\n`runDataAdapterContract(name, create)` registers the suite in a Vitest `describe` block.\n`create` runs before each test and returns an empty adapter, or `{ adapter, dispose }` when the\nadapter needs cleanup after each test:\n\n```ts\nimport { IndexedDbAdapter } from '@lushly-dev/local-db/indexeddb';\nimport { runDataAdapterContract } from '@lushly-dev/local-db/testing';\n\nrunDataAdapterContract('IndexedDbAdapter', () => {\n  const adapter = new IndexedDbAdapter({ name: `contract-${crypto.randomUUID()}` });\n  return { adapter, dispose: () => adapter.destroy() };\n});\n```\n\nThe entry imports `describe`, `it`, `expect`, `beforeEach` and `afterEach` from `vitest`, an\noptional peer dependency, and no Node.js builtin (a test bundles the entry for the browser), so\nthe same call can run in a Vitest browser-mode suite against the real IndexedDB. This package\nruns it in Node.js for all four adapters, with `IndexedDbAdapter` over `fake-indexeddb` and\n`SqliteAdapter` over a temporary file.\n\n### `QueryParams`\n\n```ts\ninterface QueryParams {\n  limit?: number;\n  offset?: number;\n  sort?: string;\n  order?: 'asc' | 'desc';\n  [key: string]: string | number | boolean | undefined; // filters\n}\n```\n\n### Adapters\n\n#### `MemoryAdapter`\n\nIn-memory storage backed by `Map`. Supports filtering, sorting, pagination, batch.\n\n```ts\nconst db = createMemoryAdapter(initialData?);\ndb.clear();        // reset all data\ndb.count('table'); // row count\n```\n\n#### `HttpAdapter`\n\nREST client via `fetch()`. Maps table names to URL paths.\n\n```ts\nconst db = createHttpAdapter(baseUrl, {\n  pathMap: { my_table: '/custom-endpoint' },\n  fetch: customFetchFn, // for Node or testing\n});\n```\n\nDefault path mapping: `accounts` → `/accounts`, `flags` → `/flags`, `settings` → `/settings`,\n`chat_sessions` → `/chat/sessions`, `chat_messages` → `/chat/messages`, etc. Other tables map to\n`/<encoded table name>`.\n\nUses PUT for upsert-style tables (settings, flags), PATCH for entity tables (accounts, annotations).\n\n#### `IndexedDbAdapter`\n\nIndexedDB storage for browsers, web workers and webviews, from its own entry so the root entry\nstays free of it.\n\n```ts\nimport { IndexedDbAdapter } from '@lushly-dev/local-db/indexeddb';\n\nconst db = new IndexedDbAdapter({ name: 'my-app-store' });\nawait db.update('settings', 'theme', { value: 'dark' });\nawait db.close();   // close the connection; the next call reopens it\nawait db.destroy(); // close and delete the database\n```\n\n- **Its own database.** The adapter owns the database `name`: one object store, `records`,\n  keyed by `[table, id]`, with an index on `table`, so any table name works. Adapters with the\n  same name share their data. A database of that name that something else created is refused\n  with `STORAGE_ERROR`.\n- **One transaction per call**, so `batch()` is atomic: a failed operation aborts the\n  transaction. `list()` without `sort` returns records in ID order.\n- **Other connections.** When another connection upgrades or deletes the database, the adapter\n  closes its connection and reopens it on the next call.\n- **Options.** `indexedDB` takes the factory to use (default `globalThis.indexedDB`); in Node.js\n  pass `new IDBFactory()` from `fake-indexeddb`. With no IndexedDB, calls reject with\n  `STORAGE_UNAVAILABLE` (503).\n\n#### `SqliteAdapter`\n\nSQLite storage in one file, for servers and tools on Node.js 22.13 or later, where `node:sqlite`\nneeds no flag. It is its own entry, so the root and browser entries never load it.\n\n```ts\nimport { SqliteAdapter } from '@lushly-dev/local-db/sqlite';\n\nconst db = new SqliteAdapter({ path: '/var/lib/app/data.sqlite' });\nawait db.update('settings', 'theme', { value: 'dark' });\ndb.close(); // close the database; the next call reopens it\n```\n\n- **Its own database.** One table, `records(tbl, id, value)`, keyed by `(tbl, id)` and\n  `WITHOUT ROWID`, each value the record's JSON, so any table name works. Adapters on the same\n  file share their data, across processes too. A file that something else created is refused\n  with `STORAGE_ERROR` and left as it was.\n- **Durable.** WAL mode with `synchronous = FULL`, so a committed write survives a power loss.\n  WAL needs the file on a local filesystem, not a network share.\n- **One transaction per write**, `BEGIN IMMEDIATE … COMMIT`, so `batch()` is atomic: a failed\n  operation rolls the transaction back. `list()` filters, sorts and paginates as the other\n  adapters do, and without `sort` returns records in ID order, compared as UTF-8 bytes (which\n  differs from IndexedDB's UTF-16 order only past U+FFFF). `list()` and `health()` read the whole\n  table, so their cost grows with it.\n- **Synchronous underneath.** `node:sqlite` blocks: a write waiting for another process's write\n  holds the event loop for up to `busyTimeoutMs`.\n- **IDs are text.** A table name or ID holding a lone UTF-16 surrogate is stored as U+FFFD, so\n  two such IDs can name the same record. Use well-formed strings.\n- **Options.** `busyTimeoutMs` (default 5000, a finite number 0 or more) is how long a write waits\n  for another connection's write before it rejects with `STORAGE_ERROR`. Without `node:sqlite`,\n  calls reject with `STORAGE_UNAVAILABLE` (503). Every other SQLite failure, reads included,\n  rejects with `STORAGE_ERROR` (500).\n\n## With AFD commands\n\n```ts\nimport { defineCommand, success } from '@lushly-dev/afd-server';\nimport type { DataAdapter } from '@lushly-dev/local-db';\nimport { z } from 'zod/v3';\n\n// Inject adapter — no storage coupling in command logic\nexport function createUserCommands(db: DataAdapter) {\n  return defineCommand({\n    name: 'user-list',\n    input: z.object({ limit: z.number().optional() }),\n    async handler(input) {\n      const result = await db.list('users', { limit: input.limit });\n      return success(result);\n    },\n  });\n}\n```\n\n## Integration evidence\n\n`pnpm -F @lushly-dev/local-db exec vitest run src/http.integration.test.ts`\nuses platform fetch against an ephemeral loopback HTTP server backed by the actual\n`MemoryAdapter`. It checks JSON round trips, CRUD, filtering/sorting/pagination,\nencoded paths, upserts, real HTTP error mapping, ordered batch commit and rollback\nwith independent storage read-back. Teardown closes sockets and clears memory.\nThis proves the REST transport contract; it does not prove durable hosted storage.\n\nAn optional hosted harness is available separately:\n\n```sh\nAFD_TEST_HTTP_BASE_URL=https://disposable-test-service.example/api/v1 \\\nAFD_TEST_HTTP_TABLE=integration_records \\\npnpm -F @lushly-dev/local-db exec vitest run src/hosted.integration.test.ts\n```\n\nProvision that disposable service and writable test table first. Set\n`AFD_TEST_HTTP_TOKEN` only if it requires a dedicated test bearer token. The harness\nwrites unique invocation IDs, reads through a separate client, verifies failed-batch\nrollback, then deletes exactly those IDs and checks deletion. Cleanup failures fail\nthe run; use the test service's record/audit view to remove leftovers before deleting\nthe disposable service. An absent endpoint reports a skipped test, never a pass.\nRecord the service/backend version, deployment revision and actual outcomes.\n\nThat baseline verifies persistence across requests/clients. The additional\n[durable REST harness](hosted/README.md) supplies a SQLite fixture and separate\nwrite/read/cleanup processes using the actual HttpAdapter and ViewStateRegistry.\n`pnpm test:hosted:local` (repository root, Node 24 or newer and Chromium) includes its\nrestart, unavailable/recovery, two-principal isolation and exact-ID cleanup checks.\n\nFor external execution, `pnpm -F @lushly-dev/local-db test:hosted` accepts explicit\nphases and run-scoped configuration documented in that README. A hosted durability\nclaim requires the matching write/read/cleanup receipts and external restart\nevidence over the same backing store. Missing required configuration fails\npreflight. Concurrent writers, browser storage and production authentication\nremain outside this fixture's promises. See [#362](https://github.com/lushly-dev/afd/issues/362)\nand the [verification handoff](../../docs/operations/hosted-verification.md).\n\n## License\n\nMIT\n","readmeFilename":"README.md"}