{"_id":"@adhd/sox-extension-memory-flush","_rev":"8-c60aa27d9334747e42bb26c75eebc3b5","name":"@adhd/sox-extension-memory-flush","dist-tags":{"latest":"0.2.7"},"versions":{"0.2.0":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.0","license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.0","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"dist":{"shasum":"d2a4b729ca27eca4e62eac5a6645288b8fc1d5b9","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.0.tgz","fileCount":6,"integrity":"sha512-1CEtjxNiI/AkPz5mJ3Xctf2B5Lz+RmV7yuDy2SaQAUAYZAzqj/6OCSDLTxcre0pb/eugLq25XOsQOf/IGhou7g==","signatures":[{"sig":"MEYCIQDk3+6sHZDrif3etNyWuDMBs/XaDn86yfBgMykNcdg36QIhAMZge/3Z8+cEpg2ozySt4wT+kzJQKArAMTB+mYMxqs5V","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":550499},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.0.tgz","types":"dist/index.d.ts","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/2d9a7d850e1895416fc78a382825dcc4/adhd-sox-extension-memory-flush-0.2.0.tgz","_integrity":"sha512-1CEtjxNiI/AkPz5mJ3Xctf2B5Lz+RmV7yuDy2SaQAUAYZAzqj/6OCSDLTxcre0pb/eugLq25XOsQOf/IGhou7g==","_npmVersion":"11.6.2","description":"> Use this when you need session memory durably persisted at conversation end and scope promotions reviewed at policy boundaries.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"sqlite-vec":"^0.1.9","better-sqlite3":"^12.10.0"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-memory-core":"0.2.0"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.0_1782451182765_0.03420510972659008","host":"s3://npm-registry-packages-npm-production"}},"0.2.1":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.1","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.1","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"afc0ca5096370912f555a8cc7b99b3cf79f3f775","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.1.tgz","fileCount":14,"integrity":"sha512-6zmrLLSJ08T6K17lNB9xEC6iYit56+fMR9FOwvGTc9RL5UoVrcRoML4TPPO7CY0OgefPK7GhRk5WMpXWqGC0Sg==","signatures":[{"sig":"MEUCICwLDh1SPUYiO2DGk9FGE4PCAo27GjB3uvyycDcgQ2reAiEAtKrhAjY4ULz73FXXfsJe2xFB0Q/jtOmI9BpWh+/wXJM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":15168318},"main":"dist/index.js","engines":{"node":">=20"},"gitHead":"3ef01dd0b00e22901e45d613c801918f2a710697","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Use this when you need session memory durably persisted at conversation end and scope promotions reviewed at policy boundaries.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"workspace:*","@adhd/sox-memory-core":"workspace:*","@adhd/sox-store-adapter":"workspace:*"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.1_1787936323087_0.2262313831486693","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.2","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.2","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"fa6dc3a25b385e686c4776abd91053059690f0b9","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.2.tgz","fileCount":15,"integrity":"sha512-5NcyM8KlCEXVTcuDDsdCh06SOBUc3TQhmjhpACaNqt81gXQBaATUQBFPFEXmCfsYIhv4/WJY1uBOCqUJTTL9+w==","signatures":[{"sig":"MEQCIEnTFdVgNU05KRbCQE/s9W6qgxHw98u1IjgjD6uv2EQVAiALqS0ByjSoz10aHTs126sxGo2GGVyMMTC8ZEa33GynlA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":19156130},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.2.tgz","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/0b188a9e34866a545e7f512953cad883/adhd-sox-extension-memory-flush-0.2.2.tgz","_integrity":"sha512-5NcyM8KlCEXVTcuDDsdCh06SOBUc3TQhmjhpACaNqt81gXQBaATUQBFPFEXmCfsYIhv4/WJY1uBOCqUJTTL9+w==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.3.0","@adhd/sox-memory-core":"0.10.0","@adhd/sox-store-adapter":"0.9.0"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.2_1788566482554_0.8501811285182543","host":"s3://npm-registry-packages-npm-production"}},"0.2.3":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.3","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.3","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"0358de39ce2b3aeba68746604a6ceef02657bd4f","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.3.tgz","fileCount":17,"integrity":"sha512-wCnGjR2bDbw4Mbsib5/BBPz1U/rkrO5UDyCwLIl+500ijzftmqU9V+TqAqGraehEHUbfnNvDGUh1GVt8xEEyGg==","signatures":[{"sig":"MEUCIQDfogZ7MVCroRiDfE9zHWJc5+gmoSkfNkNj2o+FKa4YrAIgDPHCbERcnut1Mhghy9gQubnIIcPcnrWbB0j6L5DofgI=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEYCIQDtZP+EbisRGAPGCCqGXAiqlTlsyDz2gPUcAd3YuL7EYwIhAMrHIhvJq1GwD6bs9embIeBDch1HGBzYV2/FbOX2dn/u","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22262149},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.3.tgz","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/99d0f386dc194ddf6a1fbf25dcf2886c/adhd-sox-extension-memory-flush-0.2.3.tgz","_integrity":"sha512-wCnGjR2bDbw4Mbsib5/BBPz1U/rkrO5UDyCwLIl+500ijzftmqU9V+TqAqGraehEHUbfnNvDGUh1GVt8xEEyGg==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.3.1","@adhd/sox-memory-core":"0.11.0","@adhd/sox-store-adapter":"0.9.3"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.3_1790298546102_0.4500030177865608","host":"s3://npm-registry-packages-npm-production"}},"0.2.4":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.4","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.4","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"1f18c5e8446badcb055b5a9c5fe0582a6ad981cb","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.4.tgz","fileCount":17,"integrity":"sha512-Aq43PDUyRsd235x4sICqGmrSB9v/1VBU93XvKW8dni9OozgsVmkwPcaqT1VW6NJ6jnuNpYIuQXKzsFmWMwcufw==","signatures":[{"sig":"MEQCIFo1IEfG0Lf9zs+QtR2a1nd5V+TwrmgHOKUX416YYdUwAiA8fiRoGePO9jaBTb1UtveWey1XmReWR5nzqJgRbp3Reg==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIQCbQncgNCvG86rXjMSlJaEm+iDPDTl+k7BTOWEgk8UpMgIgWPdxLblX9UKfptUxmQt3mgrf16/Jna4yC4trOa7KURY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":22689160},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.4.tgz","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/e3d3052b398c1d79aa537faf7088bcc2/adhd-sox-extension-memory-flush-0.2.4.tgz","_integrity":"sha512-Aq43PDUyRsd235x4sICqGmrSB9v/1VBU93XvKW8dni9OozgsVmkwPcaqT1VW6NJ6jnuNpYIuQXKzsFmWMwcufw==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.3.2","@adhd/sox-memory-core":"0.11.1","@adhd/sox-store-adapter":"0.10.0"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.4_1790391339740_0.9546209531110912","host":"s3://npm-registry-packages-npm-production"}},"0.2.5":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.5","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.5","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"24abea8f050e75f26fae4b6d415ceba509a55dca","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.5.tgz","fileCount":21,"integrity":"sha512-vtp8mBMHzHk3yHLo1Y059f5vSFK53j5zRjd/kBSmGvFyDaujozpsU2uFAF1Juc4PEmO6/qnpUnKTsRS4QxLKiQ==","signatures":[{"sig":"MEYCIQCQImEo0Lb1mNMdntr1KuHT+J5bLEqjucIYlUF3cwbh9QIhAM4Eidx39pg++qZHdbURwrrxZOnK1zLMkAvyPXLZHcW9","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEQCIFE0CCO4J8nPMcZEVcHn2oxd+Sd7NedKAiG2zFhw2VGKAiBXYrcD523U9vBEdGteQIsWlp1U6jtYmj+SPR/3KxgR0g==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27308285},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.5.tgz","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/f10807900f61bd475d408deab9ea273f/adhd-sox-extension-memory-flush-0.2.5.tgz","_integrity":"sha512-vtp8mBMHzHk3yHLo1Y059f5vSFK53j5zRjd/kBSmGvFyDaujozpsU2uFAF1Juc4PEmO6/qnpUnKTsRS4QxLKiQ==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.3.2","@adhd/sox-memory-core":"0.12.2","@adhd/sox-store-adapter":"0.13.0"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.5_1790727483586_0.5311210468561469","host":"s3://npm-registry-packages-npm-production"}},"0.2.6":{"name":"@adhd/sox-extension-memory-flush","version":"0.2.6","keywords":["memory","maintenance","sqlite","typescript"],"license":"MIT","_id":"@adhd/sox-extension-memory-flush@0.2.6","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"homepage":"https://github.com/PseudoSky/adhd","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"5a9dc8ff35bbf1142b2678c357c9806b4f515404","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.6.tgz","fileCount":21,"integrity":"sha512-dBZlOCNgLUKkOfj+t5h/Va9/MN8Irl/ylKWylOy8qOCujfDdxg4pvfGPbiGZgeY2c0GYtvZ1ZESzYa2U3m86Hg==","signatures":[{"sig":"MEUCIQDir+vhmldFZHcTuDNBm4fuAkJSOD8otYIP/a3OjEsOfQIgVqqLavDC/AQmewCkEdjpvse+ec94ciymzQ03x0bDo9c=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"sig":"MEUCIAHVZ07/A069O5DSyuCCZN5VDnjPp+jEvWepSxR/i8ahAiEAoHC3B1924yMhYGdoYQoSl4RYIGJ5AFkxMQA4cNGYWAY=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":27873064},"main":"dist/index.js","_from":"file:adhd-sox-extension-memory-flush-0.2.6.tgz","engines":{"node":">=20"},"_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/35dd61f9d1c48a1459df08198896043f/adhd-sox-extension-memory-flush-0.2.6.tgz","_integrity":"sha512-dBZlOCNgLUKkOfj+t5h/Va9/MN8Irl/ylKWylOy8qOCujfDdxg4pvfGPbiGZgeY2c0GYtvZ1ZESzYa2U3m86Hg==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.4.0","@adhd/sox-memory-core":"0.12.3","@adhd/sox-store-adapter":"0.13.1"},"_npmOperationalInternal":{"tmp":"tmp/sox-extension-memory-flush_0.2.6_1790798849364_0.9349278087380806","host":"s3://npm-registry-packages-npm-production"}},"0.2.7":{"_id":"@adhd/sox-extension-memory-flush@0.2.7","bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"dist":{"shasum":"0ced80f3c5613efcfdd20f2ca1f0d9598dd6bee2","tarball":"https://registry.npmjs.org/@adhd/sox-extension-memory-flush/-/sox-extension-memory-flush-0.2.7.tgz","fileCount":21,"integrity":"sha512-RjeIyUJ8bRjkvVTDbPkEmLPSnSJiQzgYc7H1wz78DqdlE7scq0msbqr26EudAQbCWQvkbwuxnXHvXZPdF/PTbw==","signatures":[{"sig":"MEYCIQD49MLT8rbgEUMEjXSRgZjCSPhcmb9/gmg+dYZHR7eCyAIhAJ5STYiQo0Gm25u/aqnzjT8U+ppBfvBuC5lv4LQuN80e","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"},{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIE/Crzx2vnfv12+AASzZMVj8aKeqZJJiJGEqQuSkz3qoAiEAqC58jyb6tbnfyfG2TPiTElu8P4lh7JArDbGOzpdPcBU="}],"unpackedSize":28066209},"main":"dist/index.js","name":"@adhd/sox-extension-memory-flush","_from":"file:adhd-sox-extension-memory-flush-0.2.7.tgz","engines":{"node":">=20"},"license":"MIT","version":"0.2.7","_npmUser":{"name":"pseudosky","email":"skywinston.sk@gmail.com"},"homepage":"https://github.com/PseudoSky/adhd","keywords":["memory","maintenance","sqlite","typescript"],"_resolved":"/private/var/folders/yg/cfczgtx54bzfh74lx2_mv0z80000gp/T/849cbf7db05bbfaf4f9bb4fbc69f6c89/adhd-sox-extension-memory-flush-0.2.7.tgz","_integrity":"sha512-RjeIyUJ8bRjkvVTDbPkEmLPSnSJiQzgYc7H1wz78DqdlE7scq0msbqr26EudAQbCWQvkbwuxnXHvXZPdF/PTbw==","repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"_npmVersion":"11.6.2","description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","directories":{},"maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"_nodeVersion":"24.11.1","dependencies":{"@tursodatabase/database":"^0.7.1"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"@adhd/sox-telemetry":"0.4.0","@adhd/sox-memory-core":"0.12.3","@adhd/sox-store-adapter":"0.13.2"},"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/sox-extension-memory-flush_0.2.7_1790807428575_0.018662610721946304"}}},"time":{"created":"2026-06-26T05:19:42.652Z","modified":"2026-09-30T22:30:29.007Z","0.2.0":"2026-06-26T05:19:42.929Z","0.2.1":"2026-08-28T16:58:43.318Z","0.2.2":"2026-09-05T00:01:22.797Z","0.2.3":"2026-09-25T01:09:06.312Z","0.2.4":"2026-09-26T02:55:39.912Z","0.2.5":"2026-09-30T00:18:03.788Z","0.2.6":"2026-09-30T20:07:29.559Z","0.2.7":"2026-09-30T22:30:28.820Z"},"bugs":{"url":"https://github.com/PseudoSky/adhd/issues"},"license":"MIT","homepage":"https://github.com/PseudoSky/adhd","keywords":["memory","maintenance","sqlite","typescript"],"repository":{"url":"git+https://github.com/PseudoSky/adhd.git","type":"git"},"description":"> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.","maintainers":[{"name":"pseudosky","email":"skywinston.sk@gmail.com"}],"readme":"# Memory Session Flush\n\n> Persist session working memory at conversation end, and gate scope-promotion requests — deterministic, zero LLM calls.\n\n## Overview\n\n`@adhd/sox-extension-memory-flush` binds two host lifecycle events:\n\n**`SessionEnd`** — when a conversation closes:\n\n1. Upserts a `session` node with the working-memory state (invalidates the previous entry for that `session_id`, inserts a new one).\n2. Writes any pending episodes into the store (content-hash deduped) and enqueues each into the enrichment queue, so `memory-server`'s in-process batch pass picks them up — there is no separate daemon to notify.\n3. If `export_enabled` + `export_dir` are configured (directly, or via `payload.export_config`), auto-exports the store to a markdown mirror, throttled to at most once per `export_throttle_secs` (default 60s) and fully failure-isolated — a failed export never breaks the flush.\n\n**`ScopePromotionProposed`** — when a caller proposes promoting memory items from a narrower scope (e.g. `project`) to a wider one (e.g. `user`), the hook runs whatever promotion-approval callback has been registered via `setPromotionApprover`. If it approves, the hook copies the node(s) to the destination scope's store with a `SAME_AS` edge and marks the promotion applied. If it rejects, or no approver is registered, the row stays `proposed` and nothing is copied.\n\n`order: 100` — ascending; ties broken by extension id.\n\n```bash\npnpm add @adhd/sox-extension-memory-flush\n```\n\n## Quick start\n\nThe entrypoint exports `handler`, `events`, and the config setters — this is exactly how the package's own test suite drives it:\n\n> **No type declarations ship with this package.** It is built as an executable bundle, so\n> `dist/` contains no `.d.ts` and `package.json` declares no `types` field. The examples below\n> are JavaScript. Importing it from TypeScript under `noImplicitAny` raises\n> `TS7016: Could not find a declaration file for module` — add your own ambient declaration, or\n> drive the package through its command line / MCP interface, which is its intended seam.\n\n```js\nimport { handler, setExportConfig, _resetExportThrottle } from '@adhd/sox-extension-memory-flush';\n\n// The store file must already exist — SessionEnd silently no-ops without it (see Gotchas).\n// Create it first with `npx memory-cli init --scope project`, or let memory-server create it\n// on its own first write.\nconst dbPath = `${process.cwd()}/.memory/project.db`;\n\n// Optional: turn on auto-export for this process (default is off)\nsetExportConfig({ export_enabled: true, export_dir: '/path/to/export', export_throttle_secs: 0 });\n\nconst result = handler({\n  event: 'SessionEnd',\n  timestamp: new Date().toISOString(),\n  payload: {\n    session_id: 'session-123',\n    db_path: dbPath,\n    working_memory: { openFiles: ['src/index.ts'], lastGoal: 'fix the deadlock' },\n    episodes: [{ content: 'Decided to retry on SQLITE_BUSY.', source: 'observation', importance: 6 }],\n  },\n});\nif (result) await result; // SessionEnd returns a Promise; await it to know the flush completed\n```\n\n`handler` dispatches on `ctx.event` (`events` lists the two it binds) and never throws — a handler failure is caught and logged, never propagated to the host.\n\n### As an installed hook\n\n```bash\nsoxe install memory-flush --host=opencode --scope=project\n```\n\nThe host fires `SessionEnd`/`ScopePromotionProposed` into `handler` automatically; you don't call it yourself. `memory-flush` requires `memory-server` to already be installed — it writes into the same store schema.\n\n## When to use\n\n- Install alongside `memory-server` whenever you want session continuity — without this hook, working memory is lost when the conversation ends.\n- Install it when you need scope-promotion approval gating (e.g. policy-gated promotion from project to org memory).\n\n## Lifecycle events bound\n\n| Event | Behaviour |\n| --- | --- |\n| `SessionEnd` | Persist working memory, write + enqueue pending episodes, optionally auto-export. |\n| `ScopePromotionProposed` | Run the registered promotion-approval callback; copy nodes on approval. |\n\n## Configuration\n\nSet the promotion approver programmatically — there is no CLI subcommand for it:\n\n```js\nimport { setPromotionApprover } from '@adhd/sox-extension-memory-flush';\n\nsetPromotionApprover(async (payload) => {\n  // payload: { extension_id, from_scope, to_scope, items: [{ uid, content? }], proposed_at }\n  return { approved: true, srcDbPath: '/path/project.db', dstDbPath: '/path/user.db', decidedBy: 'policy' };\n});\n```\n\nWithout an approver registered, `ScopePromotionProposed` is logged and the proposal stays `proposed` — no action is taken.\n\nAuto-export config keys (set via `setExportConfig`, or per-call via `payload.export_config`):\n\n| Key | Default | Description |\n| --- | --- | --- |\n| `export_enabled` | `false` | Opt-in: run a markdown export after every `SessionEnd` flush. |\n| `export_dir` | — | Required when `export_enabled` is true. |\n| `export_throttle_secs` | `60` | Minimum seconds between auto-exports per process lifetime. |\n\n## Constraints\n\n- Deterministic: zero LLM calls in either handler.\n- Side effects (DB writes, queue inserts, export) are scoped to the `db_path` in the event payload.\n- `SessionEnd` returns a `Promise` (awaits the full flush + export cycle); `ScopePromotionProposed` also returns a `Promise`. Both catch their own errors internally rather than throwing into the host.\n\n## Gotchas\n\n- **`SessionEnd` silently no-ops if `db_path` doesn't already exist.** The session-state upsert and episode writes only run against a store file that's already on disk (`fs.existsSync(db_path)` gates the open); a missing file makes the whole write half of the handler return with **no write, no thrown error, and no log line** — `result` still resolves normally. Create the store first (`memory-cli init`, or let `memory-server` create it on its own first write) before pointing `handler` at it. The auto-export half is more forgiving: it checks existence separately and prints `[memory-flush] auto-export skipped: db_path not found: <path>` when it's missing, so a `SessionEnd` with export enabled can log an export-skip message while the session/episode write silently did nothing at all — those are two independent silent-vs-logged failure paths, not one.\n- A literal `~`-prefixed path (e.g. `'~/.memory/project.db'`) is **not** shell-expanded by this package — pass an already-resolved absolute path (`` `${os.homedir()}/.memory/project.db` `` or similar).\n\n## Usage\n\n```bash\nsoxe install memory-flush\n# or install the full subsystem:\nsoxe install sox-memory-bundle\n```\n\n## License\n\nMIT\n","readmeFilename":"README.md"}