@remnic/core 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/access-cli.d.ts +2 -1
- package/dist/access-cli.js +293 -104
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +31 -62
- package/dist/access-http.js +53 -35
- package/dist/access-mcp.d.ts +31 -8
- package/dist/access-mcp.js +45 -34
- package/dist/access-schema.d.ts +197 -14
- package/dist/access-schema.js +16 -5
- package/dist/access-service-DcCDmNYC.d.ts +1542 -0
- package/dist/access-service.d.ts +30 -9
- package/dist/access-service.js +42 -32
- package/dist/action-confidence.d.ts +83 -0
- package/dist/action-confidence.js +22 -0
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +11 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/claude-code.d.ts +24 -0
- package/dist/adapters/claude-code.js +9 -0
- package/dist/adapters/codex.d.ts +25 -0
- package/dist/adapters/codex.js +9 -0
- package/dist/adapters/hermes.d.ts +35 -0
- package/dist/adapters/hermes.js +9 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/registry.d.ts +20 -0
- package/dist/adapters/registry.js +13 -0
- package/dist/adapters/replit.d.ts +28 -0
- package/dist/adapters/replit.js +9 -0
- package/dist/adapters/types.d.ts +43 -0
- package/dist/adapters/types.js +8 -0
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +23 -6
- package/dist/boxes.d.ts +7 -0
- package/dist/boxes.js +1 -1
- package/dist/briefing.d.ts +5 -3
- package/dist/briefing.js +10 -7
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-surprise-report.js +1 -1
- package/dist/buffer.d.ts +18 -4
- package/dist/buffer.js +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +6 -6
- package/dist/capsule-cli.d.ts +4 -4
- package/dist/capsule-cli.js +1 -1
- package/dist/capsule-crypto-5CYAGVC5.js +18 -0
- package/dist/capsule-merge-4MGKE7C5.js +189 -0
- package/dist/causal-behavior.d.ts +9 -29
- package/dist/causal-behavior.js +6 -3
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +3 -2
- package/dist/causal-consolidation.d.ts +2 -2
- package/dist/causal-consolidation.js +28 -17
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/chunk-25MQ7IHJ.js +427 -0
- package/dist/chunk-25MQ7IHJ.js.map +1 -0
- package/dist/chunk-2F2W355T.js +256 -0
- package/dist/chunk-2F2W355T.js.map +1 -0
- package/dist/chunk-2KI4QFHU.js +228 -0
- package/dist/chunk-2KI4QFHU.js.map +1 -0
- package/dist/chunk-2PRQG7PV.js +86 -0
- package/dist/chunk-2PRQG7PV.js.map +1 -0
- package/dist/chunk-2QR3XXIC.js +2272 -0
- package/dist/chunk-2QR3XXIC.js.map +1 -0
- package/dist/chunk-2WWLHTZY.js +121 -0
- package/dist/chunk-326G7DJK.js +2185 -0
- package/dist/chunk-326G7DJK.js.map +1 -0
- package/dist/chunk-34DQE4KF.js +174 -0
- package/dist/chunk-34DQE4KF.js.map +1 -0
- package/dist/chunk-3APJ5EVB.js +601 -0
- package/dist/chunk-3APJ5EVB.js.map +1 -0
- package/dist/chunk-3HPAPHUK.js +51 -0
- package/dist/chunk-3HPAPHUK.js.map +1 -0
- package/dist/chunk-3JXBXXM2.js +69 -0
- package/dist/chunk-3JXBXXM2.js.map +1 -0
- package/dist/chunk-3KW65B36.js +681 -0
- package/dist/chunk-3KW65B36.js.map +1 -0
- package/dist/chunk-3UXOZBHV.js +20 -0
- package/dist/chunk-3UXOZBHV.js.map +1 -0
- package/dist/chunk-3VAL7ZL2.js +266 -0
- package/dist/chunk-3VAL7ZL2.js.map +1 -0
- package/dist/chunk-3Y4P7RXM.js +31 -0
- package/dist/chunk-3Y4P7RXM.js.map +1 -0
- package/dist/chunk-47VWKCAF.js +273 -0
- package/dist/chunk-47VWKCAF.js.map +1 -0
- package/dist/chunk-4CRG46BG.js +271 -0
- package/dist/chunk-4RA3C3EV.js +60 -0
- package/dist/chunk-4RA3C3EV.js.map +1 -0
- package/dist/chunk-5375UYTQ.js +914 -0
- package/dist/chunk-5375UYTQ.js.map +1 -0
- package/dist/chunk-56K5QLHX.js +506 -0
- package/dist/chunk-56K5QLHX.js.map +1 -0
- package/dist/chunk-5NXIJZFX.js +180 -0
- package/dist/chunk-5NXIJZFX.js.map +1 -0
- package/dist/chunk-5RGLBDQF.js +596 -0
- package/dist/chunk-5RGLBDQF.js.map +1 -0
- package/dist/chunk-5UZXUTVO.js +9 -0
- package/dist/chunk-5UZXUTVO.js.map +1 -0
- package/dist/chunk-65PG43EQ.js +105 -0
- package/dist/chunk-65PG43EQ.js.map +1 -0
- package/dist/chunk-66DHUKLO.js +57 -0
- package/dist/chunk-66DHUKLO.js.map +1 -0
- package/dist/chunk-6FC5EGNV.js +46 -0
- package/dist/chunk-6FC5EGNV.js.map +1 -0
- package/dist/chunk-6H2TESSP.js +62 -0
- package/dist/chunk-6H2TESSP.js.map +1 -0
- package/dist/chunk-6LVVDPJ4.js +32 -0
- package/dist/chunk-6LVVDPJ4.js.map +1 -0
- package/dist/chunk-6NKAQ74D.js +2237 -0
- package/dist/chunk-6NKAQ74D.js.map +1 -0
- package/dist/chunk-6RVI47ZR.js +159 -0
- package/dist/chunk-6RVI47ZR.js.map +1 -0
- package/dist/chunk-7AAT6G4Q.js +5117 -0
- package/dist/chunk-7AAT6G4Q.js.map +1 -0
- package/dist/chunk-7DTASS5T.js +29 -0
- package/dist/chunk-7DTASS5T.js.map +1 -0
- package/dist/chunk-7IASACLB.js +596 -0
- package/dist/chunk-7MNMYOFP.js +32 -0
- package/dist/chunk-7MNMYOFP.js.map +1 -0
- package/dist/chunk-7N4KAIGN.js +133 -0
- package/dist/chunk-7N4KAIGN.js.map +1 -0
- package/dist/chunk-7OZ53EXP.js +101 -0
- package/dist/chunk-7OZ53EXP.js.map +1 -0
- package/dist/chunk-7XYTQGCC.js +134 -0
- package/dist/chunk-7XYTQGCC.js.map +1 -0
- package/dist/chunk-A2XUIMJ3.js +341 -0
- package/dist/chunk-A2XUIMJ3.js.map +1 -0
- package/dist/chunk-AC5LO7IU.js +308 -0
- package/dist/chunk-AC5LO7IU.js.map +1 -0
- package/dist/chunk-AGZQD76C.js +201 -0
- package/dist/chunk-AGZQD76C.js.map +1 -0
- package/dist/chunk-AH2JUU6X.js +336 -0
- package/dist/chunk-AH2JUU6X.js.map +1 -0
- package/dist/chunk-APO3DCMU.js +361 -0
- package/dist/chunk-APO3DCMU.js.map +1 -0
- package/dist/chunk-BFBF3XEF.js +283 -0
- package/dist/chunk-BFBF3XEF.js.map +1 -0
- package/dist/chunk-BJ3KMYTB.js +1974 -0
- package/dist/chunk-BJ3KMYTB.js.map +1 -0
- package/dist/chunk-C5BCH4ZS.js +317 -0
- package/dist/chunk-C5BCH4ZS.js.map +1 -0
- package/dist/chunk-CHEL3SKB.js +6758 -0
- package/dist/chunk-CHEL3SKB.js.map +1 -0
- package/dist/chunk-CQZRLNMV.js +1491 -0
- package/dist/chunk-CQZRLNMV.js.map +1 -0
- package/dist/chunk-D46YSIYX.js +892 -0
- package/dist/chunk-D46YSIYX.js.map +1 -0
- package/dist/chunk-DB5A3NHS.js +906 -0
- package/dist/chunk-DB5A3NHS.js.map +1 -0
- package/dist/chunk-DINWEURR.js +648 -0
- package/dist/chunk-DINWEURR.js.map +1 -0
- package/dist/chunk-DK5LDEQM.js +530 -0
- package/dist/chunk-DK5LDEQM.js.map +1 -0
- package/dist/chunk-DOM4GKSW.js +34 -0
- package/dist/chunk-DOM4GKSW.js.map +1 -0
- package/dist/chunk-EDTHC6UD.js +1075 -0
- package/dist/chunk-EDTHC6UD.js.map +1 -0
- package/dist/chunk-EFJ3MQ4V.js +721 -0
- package/dist/chunk-EHRTFRWW.js +89 -0
- package/dist/chunk-EHRTFRWW.js.map +1 -0
- package/dist/chunk-FAJ7FZYM.js +11 -0
- package/dist/chunk-FAJ7FZYM.js.map +1 -0
- package/dist/chunk-FBYESMQ2.js +570 -0
- package/dist/chunk-FBYESMQ2.js.map +1 -0
- package/dist/chunk-FDU6HUUL.js +147 -0
- package/dist/chunk-FF4KLI5W.js +99 -0
- package/dist/chunk-FF4KLI5W.js.map +1 -0
- package/dist/chunk-FIT6DMX6.js +310 -0
- package/dist/chunk-FIT6DMX6.js.map +1 -0
- package/dist/chunk-FJ43PRLT.js +272 -0
- package/dist/chunk-FJ43PRLT.js.map +1 -0
- package/dist/chunk-FKFMOY3N.js +32 -0
- package/dist/chunk-FKFMOY3N.js.map +1 -0
- package/dist/chunk-FLTNHQK6.js +262 -0
- package/dist/chunk-FLTNHQK6.js.map +1 -0
- package/dist/chunk-GA454ALV.js +12436 -0
- package/dist/chunk-GA454ALV.js.map +1 -0
- package/dist/chunk-GGKRUQOO.js +228 -0
- package/dist/chunk-GIF42EW3.js +63 -0
- package/dist/chunk-GIF42EW3.js.map +1 -0
- package/dist/chunk-GL6I6MEQ.js +647 -0
- package/dist/chunk-H3ME6L6D.js +709 -0
- package/dist/chunk-H3ME6L6D.js.map +1 -0
- package/dist/chunk-HHLLAQGZ.js +1 -0
- package/dist/chunk-HXXBL2KD.js +2040 -0
- package/dist/chunk-I5V2VDIW.js +219 -0
- package/dist/chunk-I5V2VDIW.js.map +1 -0
- package/dist/chunk-I6K5FBRQ.js +35 -0
- package/dist/chunk-I6K5FBRQ.js.map +1 -0
- package/dist/chunk-ICRIXAP2.js +121 -0
- package/dist/chunk-ICRIXAP2.js.map +1 -0
- package/dist/chunk-J4EB7DNW.js +11 -0
- package/dist/chunk-J4EB7DNW.js.map +1 -0
- package/dist/chunk-JLFA7DQG.js +62 -0
- package/dist/chunk-JLFA7DQG.js.map +1 -0
- package/dist/chunk-KJTKLXTH.js +9 -0
- package/dist/chunk-KJTKLXTH.js.map +1 -0
- package/dist/chunk-KLAO5DGL.js +917 -0
- package/dist/chunk-KLAO5DGL.js.map +1 -0
- package/dist/chunk-KNKUID7G.js +183 -0
- package/dist/chunk-KOSORCJG.js +624 -0
- package/dist/chunk-KOSORCJG.js.map +1 -0
- package/dist/chunk-KUJVMMZQ.js +1262 -0
- package/dist/chunk-KUJVMMZQ.js.map +1 -0
- package/dist/chunk-LCR46JY5.js +123 -0
- package/dist/chunk-LCR46JY5.js.map +1 -0
- package/dist/chunk-LLQ2LLWF.js +148 -0
- package/dist/chunk-LLQ2LLWF.js.map +1 -0
- package/dist/chunk-LPMVBPA3.js +236 -0
- package/dist/chunk-LT3NLYSI.js +50 -0
- package/dist/chunk-LT3NLYSI.js.map +1 -0
- package/dist/chunk-LUDTDZLK.js +287 -0
- package/dist/chunk-LUDTDZLK.js.map +1 -0
- package/dist/chunk-M23FSH32.js +3963 -0
- package/dist/chunk-M23FSH32.js.map +1 -0
- package/dist/chunk-MC26UJIM.js +118 -0
- package/dist/chunk-ME6ESPZU.js +119 -0
- package/dist/chunk-ME6ESPZU.js.map +1 -0
- package/dist/chunk-MGKYQQYF.js +272 -0
- package/dist/chunk-MGKYQQYF.js.map +1 -0
- package/dist/chunk-MJFNCJXV.js +66 -0
- package/dist/chunk-MJFNCJXV.js.map +1 -0
- package/dist/chunk-MSWG7JI6.js +237 -0
- package/dist/chunk-MSWG7JI6.js.map +1 -0
- package/dist/chunk-MT25YHYH.js +141 -0
- package/dist/chunk-MT25YHYH.js.map +1 -0
- package/dist/chunk-MT4HVDUZ.js +53 -0
- package/dist/chunk-MY6TPVXW.js +219 -0
- package/dist/chunk-N2D6GXBM.js +267 -0
- package/dist/chunk-N2D6GXBM.js.map +1 -0
- package/dist/chunk-NJ3MJQZX.js +46 -0
- package/dist/chunk-NJ3MJQZX.js.map +1 -0
- package/dist/chunk-NMZY542O.js +335 -0
- package/dist/chunk-NMZY542O.js.map +1 -0
- package/dist/chunk-NNVTUXEB.js +23 -0
- package/dist/chunk-NZL6GGQE.js +375 -0
- package/dist/chunk-NZL6GGQE.js.map +1 -0
- package/dist/chunk-OAZ5MFUB.js +4124 -0
- package/dist/chunk-OAZ5MFUB.js.map +1 -0
- package/dist/chunk-OIGNEXKZ.js +237 -0
- package/dist/chunk-OIGNEXKZ.js.map +1 -0
- package/dist/chunk-OZKZ2TRP.js +3729 -0
- package/dist/chunk-OZKZ2TRP.js.map +1 -0
- package/dist/chunk-P4NEIHUT.js +108 -0
- package/dist/chunk-P7FMDTKL.js +103 -0
- package/dist/chunk-P7FMDTKL.js.map +1 -0
- package/dist/chunk-PD6O7AXF.js +110 -0
- package/dist/chunk-PD6O7AXF.js.map +1 -0
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/chunk-PIRJPV5T.js +98 -0
- package/dist/chunk-PIRJPV5T.js.map +1 -0
- package/dist/chunk-PK7H5L6Y.js +159 -0
- package/dist/chunk-PK7H5L6Y.js.map +1 -0
- package/dist/chunk-PR5FBTFU.js +233 -0
- package/dist/chunk-PR5FBTFU.js.map +1 -0
- package/dist/chunk-PU63GXWS.js +174 -0
- package/dist/chunk-PU63GXWS.js.map +1 -0
- package/dist/chunk-PYPOFEMK.js +294 -0
- package/dist/chunk-PYPOFEMK.js.map +1 -0
- package/dist/chunk-PZIAX57I.js +124 -0
- package/dist/chunk-PZIAX57I.js.map +1 -0
- package/dist/chunk-Q7P4WJDP.js +26 -0
- package/dist/chunk-Q7P4WJDP.js.map +1 -0
- package/dist/chunk-QDZ2RLEC.js +908 -0
- package/dist/chunk-QDZ2RLEC.js.map +1 -0
- package/dist/chunk-QQUAB63I.js +63 -0
- package/dist/chunk-QQUAB63I.js.map +1 -0
- package/dist/chunk-QRNI5JBH.js +18 -0
- package/dist/chunk-RHY3HH7P.js +601 -0
- package/dist/chunk-RHY3HH7P.js.map +1 -0
- package/dist/chunk-RK6F44Y6.js +84 -0
- package/dist/chunk-RK6F44Y6.js.map +1 -0
- package/dist/chunk-RRF5UOBJ.js +91 -0
- package/dist/chunk-RXDLTSWT.js +124 -0
- package/dist/chunk-RXDLTSWT.js.map +1 -0
- package/dist/chunk-RYED3SPJ.js +42 -0
- package/dist/chunk-RYED3SPJ.js.map +1 -0
- package/dist/chunk-S7KDBTWT.js +106 -0
- package/dist/chunk-S7KDBTWT.js.map +1 -0
- package/dist/chunk-SEDEKFYQ.js +1 -0
- package/dist/chunk-SOAU2OE2.js +125 -0
- package/dist/chunk-SOAU2OE2.js.map +1 -0
- package/dist/chunk-TECVW3JP.js +36 -0
- package/dist/chunk-TECVW3JP.js.map +1 -0
- package/dist/chunk-TFO23QT4.js +88 -0
- package/dist/chunk-TFO23QT4.js.map +1 -0
- package/dist/chunk-TK4UEOSK.js +76 -0
- package/dist/chunk-TK4UEOSK.js.map +1 -0
- package/dist/chunk-TKWGAOLV.js +122 -0
- package/dist/chunk-TKWGAOLV.js.map +1 -0
- package/dist/chunk-TMM4S4IJ.js +597 -0
- package/dist/chunk-TMM4S4IJ.js.map +1 -0
- package/dist/chunk-TMQLARTH.js +188 -0
- package/dist/chunk-TMQLARTH.js.map +1 -0
- package/dist/chunk-TPDBFYEG.js +130 -0
- package/dist/chunk-TPDBFYEG.js.map +1 -0
- package/dist/chunk-TPMQ3G6Z.js +145 -0
- package/dist/chunk-TPMQ3G6Z.js.map +1 -0
- package/dist/chunk-TZOLIGIG.js +61 -0
- package/dist/chunk-TZOLIGIG.js.map +1 -0
- package/dist/chunk-U3PN77QT.js +113 -0
- package/dist/chunk-U3WSW6PZ.js +277 -0
- package/dist/chunk-U4SCL7B7.js +640 -0
- package/dist/chunk-U4SCL7B7.js.map +1 -0
- package/dist/chunk-UWK5OXUJ.js +156 -0
- package/dist/chunk-UWK5OXUJ.js.map +1 -0
- package/dist/chunk-UWVJF25J.js +74 -0
- package/dist/chunk-UXHQAFNA.js +1317 -0
- package/dist/chunk-UXHQAFNA.js.map +1 -0
- package/dist/chunk-V5OCT34X.js +1 -0
- package/dist/chunk-V5OCT34X.js.map +1 -0
- package/dist/chunk-VLXA6PI2.js +304 -0
- package/dist/chunk-VLXA6PI2.js.map +1 -0
- package/dist/chunk-VNO6ZJ35.js +500 -0
- package/dist/chunk-VNO6ZJ35.js.map +1 -0
- package/dist/chunk-VW676BEI.js +827 -0
- package/dist/chunk-VW676BEI.js.map +1 -0
- package/dist/chunk-VWT3F4IV.js +2161 -0
- package/dist/chunk-VWT3F4IV.js.map +1 -0
- package/dist/chunk-W3LR522O.js +2296 -0
- package/dist/chunk-W3LR522O.js.map +1 -0
- package/dist/chunk-W4L6CZKA.js +96 -0
- package/dist/chunk-W4L6CZKA.js.map +1 -0
- package/dist/chunk-W4RVMTHR.js +372 -0
- package/dist/chunk-W4RVMTHR.js.map +1 -0
- package/dist/chunk-WEHSQBFR.js +188 -0
- package/dist/chunk-WEHSQBFR.js.map +1 -0
- package/dist/chunk-WELDCG6C.js +380 -0
- package/dist/chunk-WELDCG6C.js.map +1 -0
- package/dist/chunk-WZYKANL3.js +2800 -0
- package/dist/chunk-WZYKANL3.js.map +1 -0
- package/dist/chunk-XIG5PDM7.js +48 -0
- package/dist/chunk-XJNBEDFE.js +193 -0
- package/dist/chunk-XJNBEDFE.js.map +1 -0
- package/dist/chunk-XVVIG67A.js +291 -0
- package/dist/chunk-XVVIG67A.js.map +1 -0
- package/dist/chunk-XVZ7B3HG.js +135 -0
- package/dist/chunk-YBPYIAA5.js +73 -0
- package/dist/chunk-YBPYIAA5.js.map +1 -0
- package/dist/chunk-Z734BLO3.js +21 -0
- package/dist/chunk-Z734BLO3.js.map +1 -0
- package/dist/chunk-ZKSK55RC.js +269 -0
- package/dist/chunk-ZKSK55RC.js.map +1 -0
- package/dist/chunk-ZTFCYYEZ.js +69 -0
- package/dist/chunk-ZTFCYYEZ.js.map +1 -0
- package/dist/chunk-ZY2MNJR6.js +329 -0
- package/dist/chunk-ZY2MNJR6.js.map +1 -0
- package/dist/cli-D3VpkVwB.d.ts +1136 -0
- package/dist/cli.d.ts +42 -10
- package/dist/cli.js +121 -58
- package/dist/codex-cli-fallback.d.ts +1 -0
- package/dist/codex-cli-fallback.js +1 -1
- package/dist/commitment-ledger.js +1 -1
- package/dist/compat/checks.d.ts +5 -0
- package/dist/compat/checks.js +11 -0
- package/dist/compat/checks.js.map +1 -0
- package/dist/compat/types.d.ts +30 -0
- package/dist/compat/types.js +1 -0
- package/dist/compat/types.js.map +1 -0
- package/dist/compounding/engine.d.ts +221 -0
- package/dist/compounding/engine.js +32 -0
- package/dist/compounding/engine.js.map +1 -0
- package/dist/compounding/preference-consolidator.d.ts +92 -0
- package/dist/compounding/preference-consolidator.js +553 -0
- package/dist/compounding/preference-consolidator.js.map +1 -0
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +5 -3
- package/dist/config.js +9 -4
- package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
- package/dist/connectors/codex-materialize-runner.d.ts +64 -0
- package/dist/connectors/codex-materialize-runner.js +33 -0
- package/dist/connectors/codex-materialize-runner.js.map +1 -0
- package/dist/connectors/codex-materialize.d.ts +195 -0
- package/dist/connectors/codex-materialize.js +38 -0
- package/dist/connectors/codex-materialize.js.map +1 -0
- package/dist/connectors/index.d.ts +444 -0
- package/dist/connectors/index.js +115 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
- package/dist/connectors-cli.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +4 -2
- package/dist/consolidation-undo.d.ts +4 -2
- package/dist/contradiction/index.d.ts +258 -0
- package/dist/contradiction/index.js +43 -0
- package/dist/contradiction/index.js.map +1 -0
- package/dist/contradiction-review-ATP4S6IC.js +30 -0
- package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
- package/dist/contradiction-scan-5A4IDZV5.js +13 -0
- package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
- package/dist/conversation-index/backend.d.ts +97 -0
- package/dist/conversation-index/backend.js +13 -0
- package/dist/conversation-index/backend.js.map +1 -0
- package/dist/conversation-index/chunker.d.ts +16 -0
- package/dist/conversation-index/chunker.js +8 -0
- package/dist/conversation-index/chunker.js.map +1 -0
- package/dist/conversation-index/cleanup.d.ts +11 -0
- package/dist/conversation-index/cleanup.js +9 -0
- package/dist/conversation-index/cleanup.js.map +1 -0
- package/dist/conversation-index/faiss-adapter.d.ts +6 -0
- package/dist/conversation-index/faiss-adapter.js +16 -0
- package/dist/conversation-index/faiss-adapter.js.map +1 -0
- package/dist/conversation-index/indexer.d.ts +23 -0
- package/dist/conversation-index/indexer.js +15 -0
- package/dist/conversation-index/indexer.js.map +1 -0
- package/dist/conversation-index/search.d.ts +6 -0
- package/dist/conversation-index/search.js +11 -0
- package/dist/conversation-index/search.js.map +1 -0
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer-wiring.js +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +163 -0
- package/dist/enrichment/index.js +18 -0
- package/dist/enrichment/index.js.map +1 -0
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +9 -6
- package/dist/entity-schema.d.ts +1 -1
- package/dist/evals.js +1 -1
- package/dist/event-order-recall.d.ts +17 -0
- package/dist/event-order-recall.js +11 -0
- package/dist/event-order-recall.js.map +1 -0
- package/dist/evidence-pack.d.ts +3 -1
- package/dist/evidence-pack.js +5 -3
- package/dist/explicit-capture.d.ts +23 -6
- package/dist/explicit-capture.js +2 -2
- package/dist/explicit-cue-recall.d.ts +4 -1
- package/dist/explicit-cue-recall.js +4 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge-training.js +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +11 -10
- package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
- package/dist/fallback-llm.d.ts +4 -1
- package/dist/fallback-llm.js +6 -6
- package/dist/focused-list-recall.d.ts +17 -0
- package/dist/focused-list-recall.js +11 -0
- package/dist/focused-list-recall.js.map +1 -0
- package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index-DJ9QWMw-.d.ts +35 -0
- package/dist/index.d.ts +107 -715
- package/dist/index.js +657 -2611
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/intent.js +1 -1
- package/dist/lcm/archive.d.ts +89 -0
- package/dist/lcm/archive.js +12 -0
- package/dist/lcm/archive.js.map +1 -0
- package/dist/lcm/dag.d.ts +48 -0
- package/dist/lcm/dag.js +8 -0
- package/dist/lcm/dag.js.map +1 -0
- package/dist/lcm/engine.d.ts +116 -0
- package/dist/lcm/engine.js +20 -0
- package/dist/lcm/engine.js.map +1 -0
- package/dist/lcm/index.d.ts +12 -0
- package/dist/lcm/index.js +44 -0
- package/dist/lcm/index.js.map +1 -0
- package/dist/lcm/queue.d.ts +62 -0
- package/dist/lcm/queue.js +8 -0
- package/dist/lcm/queue.js.map +1 -0
- package/dist/lcm/recall.d.ts +20 -0
- package/dist/lcm/recall.js +8 -0
- package/dist/lcm/recall.js.map +1 -0
- package/dist/lcm/schema.d.ts +16 -0
- package/dist/lcm/schema.js +14 -0
- package/dist/lcm/schema.js.map +1 -0
- package/dist/lcm/summarizer.d.ts +38 -0
- package/dist/lcm/summarizer.js +12 -0
- package/dist/lcm/summarizer.js.map +1 -0
- package/dist/lcm/tools.d.ts +29 -0
- package/dist/lcm/tools.js +8 -0
- package/dist/lcm/tools.js.map +1 -0
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/live-connectors-runner.js +5 -5
- package/dist/local-llm.d.ts +8 -4
- package/dist/local-llm.js +3 -3
- package/dist/maintenance/archive-observations.d.ts +18 -0
- package/dist/maintenance/archive-observations.js +8 -0
- package/dist/maintenance/archive-observations.js.map +1 -0
- package/dist/maintenance/backup-stamp.d.ts +3 -0
- package/dist/maintenance/backup-stamp.js +8 -0
- package/dist/maintenance/backup-stamp.js.map +1 -0
- package/dist/maintenance/memory-governance-cron.d.ts +85 -0
- package/dist/maintenance/memory-governance-cron.js +22 -0
- package/dist/maintenance/memory-governance-cron.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +137 -0
- package/dist/maintenance/memory-governance.js +40 -0
- package/dist/maintenance/memory-governance.js.map +1 -0
- package/dist/maintenance/migrate-observations.d.ts +18 -0
- package/dist/maintenance/migrate-observations.js +9 -0
- package/dist/maintenance/migrate-observations.js.map +1 -0
- package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
- package/dist/maintenance/observation-ledger-utils.js +10 -0
- package/dist/maintenance/observation-ledger-utils.js.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
- package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
- package/dist/maintenance/rebuild-memory-projection.js +35 -0
- package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
- package/dist/maintenance/rebuild-observations.d.ts +17 -0
- package/dist/maintenance/rebuild-observations.js +9 -0
- package/dist/maintenance/rebuild-observations.js.map +1 -0
- package/dist/mcp-memory-inspector-app.d.ts +124 -0
- package/dist/mcp-memory-inspector-app.js +20 -0
- package/dist/mcp-memory-inspector-app.js.map +1 -0
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +108 -3
- package/dist/memory-projection-store.js +2 -1
- package/dist/memory-provenance.d.ts +57 -0
- package/dist/memory-provenance.js +13 -0
- package/dist/memory-provenance.js.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +4 -2
- package/dist/migrate/from-engram.d.ts +24 -0
- package/dist/migrate/from-engram.js +12 -0
- package/dist/migrate/from-engram.js.map +1 -0
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +50 -0
- package/dist/namespaces/migrate.js +50 -0
- package/dist/namespaces/migrate.js.map +1 -0
- package/dist/namespaces/principal.d.ts +17 -0
- package/dist/namespaces/principal.js +16 -0
- package/dist/namespaces/principal.js.map +1 -0
- package/dist/namespaces/search.d.ts +46 -0
- package/dist/namespaces/search.js +28 -0
- package/dist/namespaces/search.js.map +1 -0
- package/dist/namespaces/storage.d.ts +32 -0
- package/dist/namespaces/storage.js +28 -0
- package/dist/namespaces/storage.js.map +1 -0
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/network/tailscale.d.ts +41 -0
- package/dist/network/tailscale.js +9 -0
- package/dist/network/tailscale.js.map +1 -0
- package/dist/network/webdav.d.ts +39 -0
- package/dist/network/webdav.js +10 -0
- package/dist/network/webdav.js.map +1 -0
- package/dist/objective-state-writers.d.ts +1 -1
- package/dist/objective-state-writers.js +2 -2
- package/dist/operator-toolkit.d.ts +4 -2
- package/dist/operator-toolkit.js +35 -17
- package/dist/opik-exporter.js +2 -2
- package/dist/opik-exporter.js.map +1 -1
- package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
- package/dist/orchestrator.d.ts +24 -7
- package/dist/orchestrator.js +107 -65
- package/dist/path-MR5JPYOP.js +9 -0
- package/dist/path-MR5JPYOP.js.map +1 -0
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +2 -2
- package/dist/qmd.d.ts +103 -4
- package/dist/qmd.js +23 -5
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +3 -1
- package/dist/recall-explain-renderer.js +5 -3
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +3 -1
- package/dist/recall-xray-cli.d.ts +3 -1
- package/dist/recall-xray-cli.js +6 -4
- package/dist/recall-xray-renderer.d.ts +3 -1
- package/dist/recall-xray-renderer.js +5 -3
- package/dist/recall-xray.d.ts +8 -1
- package/dist/recall-xray.js +4 -2
- package/dist/replay/normalizers/chatgpt.d.ts +6 -0
- package/dist/replay/normalizers/chatgpt.js +11 -0
- package/dist/replay/normalizers/chatgpt.js.map +1 -0
- package/dist/replay/normalizers/claude.d.ts +6 -0
- package/dist/replay/normalizers/claude.js +11 -0
- package/dist/replay/normalizers/claude.js.map +1 -0
- package/dist/replay/normalizers/openclaw.d.ts +6 -0
- package/dist/replay/normalizers/openclaw.js +11 -0
- package/dist/replay/normalizers/openclaw.js.map +1 -0
- package/dist/replay/normalizers/shared.d.ts +16 -0
- package/dist/replay/normalizers/shared.js +14 -0
- package/dist/replay/normalizers/shared.js.map +1 -0
- package/dist/replay/runner.d.ts +35 -0
- package/dist/replay/runner.js +16 -0
- package/dist/replay/runner.js.map +1 -0
- package/dist/replay/types.d.ts +57 -0
- package/dist/replay/types.js +19 -0
- package/dist/replay/types.js.map +1 -0
- package/dist/resolution-B7FNQSSP.js +12 -0
- package/dist/resolution-B7FNQSSP.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/response-guidance-recall.d.ts +18 -0
- package/dist/response-guidance-recall.js +11 -0
- package/dist/response-guidance-recall.js.map +1 -0
- package/dist/resume-bundles.js +7 -5
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +35 -0
- package/dist/routing/engine.js +16 -0
- package/dist/routing/engine.js.map +1 -0
- package/dist/routing/store.d.ts +27 -0
- package/dist/routing/store.js +10 -0
- package/dist/routing/store.js.map +1 -0
- package/dist/runtime/better-sqlite.d.ts +8 -0
- package/dist/runtime/better-sqlite.js +10 -0
- package/dist/runtime/better-sqlite.js.map +1 -0
- package/dist/runtime/child-process.d.ts +32 -0
- package/dist/runtime/child-process.js +10 -0
- package/dist/runtime/child-process.js.map +1 -0
- package/dist/runtime/env.d.ts +5 -0
- package/dist/runtime/env.js +12 -0
- package/dist/runtime/env.js.map +1 -0
- package/dist/sdk-compat.js +1 -1
- package/dist/search/document-scanner.d.ts +22 -0
- package/dist/search/document-scanner.js +8 -0
- package/dist/search/document-scanner.js.map +1 -0
- package/dist/search/embed-helper.d.ts +35 -0
- package/dist/search/embed-helper.js +9 -0
- package/dist/search/embed-helper.js.map +1 -0
- package/dist/search/factory.d.ts +32 -0
- package/dist/search/factory.js +29 -0
- package/dist/search/factory.js.map +1 -0
- package/dist/search/index.d.ts +15 -0
- package/dist/search/index.js +50 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/lancedb-backend.d.ts +51 -0
- package/dist/search/lancedb-backend.js +10 -0
- package/dist/search/lancedb-backend.js.map +1 -0
- package/dist/search/meilisearch-backend.d.ts +48 -0
- package/dist/search/meilisearch-backend.js +10 -0
- package/dist/search/meilisearch-backend.js.map +1 -0
- package/dist/search/noop-backend.d.ts +26 -0
- package/dist/search/noop-backend.js +8 -0
- package/dist/search/noop-backend.js.map +1 -0
- package/dist/search/orama-backend.d.ts +53 -0
- package/dist/search/orama-backend.js +10 -0
- package/dist/search/orama-backend.js.map +1 -0
- package/dist/search/port.d.ts +61 -0
- package/dist/search/port.js +1 -0
- package/dist/search/port.js.map +1 -0
- package/dist/search/remote-backend.d.ts +39 -0
- package/dist/search/remote-backend.js +9 -0
- package/dist/search/remote-backend.js.map +1 -0
- package/dist/secure-store/index.d.ts +890 -0
- package/dist/secure-store/index.js +156 -0
- package/dist/secure-store/index.js.map +1 -0
- package/dist/semantic-VwGI14Ok.d.ts +69 -0
- package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
- package/dist/semantic-consolidation.d.ts +3 -3
- package/dist/semantic-consolidation.js +15 -8
- package/dist/semantic-rule-promotion.js +9 -6
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -7
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +131 -0
- package/dist/shared-context/manager.js +15 -0
- package/dist/shared-context/manager.js.map +1 -0
- package/dist/signal.d.ts +1 -1
- package/dist/skills-registry.js +13 -1
- package/dist/skills-registry.js.map +1 -1
- package/dist/state-store-VZU2IA53.js +16 -0
- package/dist/state-store-VZU2IA53.js.map +1 -0
- package/dist/storage-paths.d.ts +9 -0
- package/dist/storage-paths.js +20 -0
- package/dist/storage-paths.js.map +1 -0
- package/dist/storage.d.ts +6 -2
- package/dist/storage.js +8 -5
- package/dist/summarizer.d.ts +6 -1
- package/dist/summarizer.js +11 -10
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/summary-snapshot.js +2 -1
- package/dist/surfaces/dreams.d.ts +16 -0
- package/dist/surfaces/dreams.js +282 -0
- package/dist/surfaces/dreams.js.map +1 -0
- package/dist/surfaces/heartbeat.d.ts +17 -0
- package/dist/surfaces/heartbeat.js +265 -0
- package/dist/surfaces/heartbeat.js.map +1 -0
- package/dist/targeted-fact-recall.d.ts +17 -0
- package/dist/targeted-fact-recall.js +11 -0
- package/dist/targeted-fact-recall.js.map +1 -0
- package/dist/telemetry-transcript.d.ts +7 -0
- package/dist/telemetry-transcript.js +16 -0
- package/dist/telemetry-transcript.js.map +1 -0
- package/dist/temporal-supersession.d.ts +4 -2
- package/dist/temporal-supersession.js +2 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +6 -1
- package/dist/threading.js +2 -1
- package/dist/tier-migration.d.ts +5 -3
- package/dist/tier-routing.d.ts +1 -1
- package/dist/tokens.js +2 -2
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +16 -2
- package/dist/transcript.js +2 -1
- package/dist/transfer/autodetect.d.ts +4 -0
- package/dist/transfer/autodetect.js +15 -0
- package/dist/transfer/autodetect.js.map +1 -0
- package/dist/transfer/backup.d.ts +21 -0
- package/dist/transfer/backup.js +17 -0
- package/dist/transfer/backup.js.map +1 -0
- package/dist/transfer/capsule-export.d.ts +113 -0
- package/dist/transfer/capsule-export.js +19 -0
- package/dist/transfer/capsule-export.js.map +1 -0
- package/dist/transfer/capsule-import.d.ts +124 -0
- package/dist/transfer/capsule-import.js +16 -0
- package/dist/transfer/capsule-import.js.map +1 -0
- package/dist/transfer/constants.d.ts +13 -0
- package/dist/transfer/constants.js +12 -0
- package/dist/transfer/constants.js.map +1 -0
- package/dist/transfer/export-json.d.ts +11 -0
- package/dist/transfer/export-json.js +11 -0
- package/dist/transfer/export-json.js.map +1 -0
- package/dist/transfer/export-md.d.ts +10 -0
- package/dist/transfer/export-md.js +13 -0
- package/dist/transfer/export-md.js.map +1 -0
- package/dist/transfer/export-sqlite.d.ts +9 -0
- package/dist/transfer/export-sqlite.js +12 -0
- package/dist/transfer/export-sqlite.js.map +1 -0
- package/dist/transfer/fs-utils.d.ts +61 -0
- package/dist/transfer/fs-utils.js +40 -0
- package/dist/transfer/fs-utils.js.map +1 -0
- package/dist/transfer/import-json.d.ts +16 -0
- package/dist/transfer/import-json.js +13 -0
- package/dist/transfer/import-json.js.map +1 -0
- package/dist/transfer/import-md.d.ts +14 -0
- package/dist/transfer/import-md.js +11 -0
- package/dist/transfer/import-md.js.map +1 -0
- package/dist/transfer/import-sqlite.d.ts +14 -0
- package/dist/transfer/import-sqlite.js +12 -0
- package/dist/transfer/import-sqlite.js.map +1 -0
- package/dist/transfer/sqlite-schema.d.ts +4 -0
- package/dist/transfer/sqlite-schema.js +10 -0
- package/dist/transfer/sqlite-schema.js.map +1 -0
- package/dist/transfer/types.d.ts +916 -0
- package/dist/transfer/types.js +30 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/trust-zones.d.ts +3 -2
- package/dist/trust-zones.js +1 -1
- package/dist/types.d.ts +88 -3
- package/dist/types.js +1 -1
- package/dist/user-model.d.ts +37 -0
- package/dist/user-model.js +28 -0
- package/dist/user-model.js.map +1 -0
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +11 -8
- package/dist/work/board.d.ts +43 -0
- package/dist/work/board.js +14 -0
- package/dist/work/board.js.map +1 -0
- package/dist/work/boundary.d.ts +8 -0
- package/dist/work/boundary.js +14 -0
- package/dist/work/boundary.js.map +1 -0
- package/dist/work/storage.d.ts +39 -0
- package/dist/work/storage.js +11 -0
- package/dist/work/storage.js.map +1 -0
- package/dist/work/types.d.ts +75 -0
- package/dist/work/types.js +1 -0
- package/dist/work/types.js.map +1 -0
- package/package.json +2767 -6
- package/scripts/faiss_index.py +816 -0
- package/scripts/faiss_requirements.txt +3 -0
- package/skills/remnic-entities/SKILL.md +51 -0
- package/skills/remnic-memory-workflow/SKILL.md +61 -0
- package/skills/remnic-recall/SKILL.md +51 -0
- package/skills/remnic-remember/SKILL.md +56 -0
- package/skills/remnic-search/SKILL.md +51 -0
- package/skills/remnic-status/SKILL.md +51 -0
- package/src/abort-error.test.ts +49 -0
- package/src/abort-error.ts +46 -0
- package/src/abstraction-nodes.ts +162 -0
- package/src/access-audit.test.ts +178 -0
- package/src/access-audit.ts +125 -0
- package/src/access-cli.test.ts +439 -0
- package/src/access-cli.ts +438 -0
- package/src/access-http.test.ts +225 -0
- package/src/access-http.ts +1899 -0
- package/src/access-idempotency.ts +232 -0
- package/src/access-mcp.test.ts +568 -0
- package/src/access-mcp.ts +3056 -0
- package/src/access-schema-pi.test.ts +60 -0
- package/src/access-schema.ts +522 -0
- package/src/access-service-namespace.test.ts +123 -0
- package/src/access-service.ts +5629 -0
- package/src/action-confidence.test.ts +206 -0
- package/src/action-confidence.ts +466 -0
- package/src/active-memory-bridge.test.ts +285 -0
- package/src/active-memory-bridge.ts +217 -0
- package/src/active-recall.test.ts +484 -0
- package/src/active-recall.ts +459 -0
- package/src/adapters/claude-code.ts +56 -0
- package/src/adapters/codex.ts +57 -0
- package/src/adapters/hermes.ts +64 -0
- package/src/adapters/index.ts +6 -0
- package/src/adapters/registry.ts +41 -0
- package/src/adapters/replit.ts +55 -0
- package/src/adapters/types.ts +51 -0
- package/src/behavior-learner.ts +144 -0
- package/src/behavior-signals.ts +73 -0
- package/src/binary-lifecycle/backend.ts +117 -0
- package/src/binary-lifecycle/index.ts +35 -0
- package/src/binary-lifecycle/manifest.ts +79 -0
- package/src/binary-lifecycle/pipeline.ts +352 -0
- package/src/binary-lifecycle/scanner.ts +89 -0
- package/src/binary-lifecycle/types.ts +89 -0
- package/src/bootstrap.ts +178 -0
- package/src/boxes.ts +521 -0
- package/src/briefing.test.ts +1535 -0
- package/src/briefing.ts +1382 -0
- package/src/buffer-session.test.ts +443 -0
- package/src/buffer-surprise-report.ts +176 -0
- package/src/buffer-surprise-telemetry.test.ts +606 -0
- package/src/buffer-surprise-trigger.test.ts +766 -0
- package/src/buffer-surprise.test.ts +339 -0
- package/src/buffer-surprise.ts +203 -0
- package/src/buffer.ts +900 -0
- package/src/bulk-import/cli-command.test.ts +204 -0
- package/src/bulk-import/index.ts +34 -0
- package/src/bulk-import/pipeline.test.ts +445 -0
- package/src/bulk-import/pipeline.ts +178 -0
- package/src/bulk-import/registry.test.ts +151 -0
- package/src/bulk-import/registry.ts +72 -0
- package/src/bulk-import/types.test.ts +272 -0
- package/src/bulk-import/types.ts +145 -0
- package/src/calibration.ts +394 -0
- package/src/capsule-cli.test.ts +398 -0
- package/src/capsule-cli.ts +565 -0
- package/src/causal-behavior.ts +308 -0
- package/src/causal-chain.ts +419 -0
- package/src/causal-consolidation.ts +370 -0
- package/src/causal-retrieval.ts +286 -0
- package/src/causal-trajectory-graph.ts +60 -0
- package/src/causal-trajectory.ts +303 -0
- package/src/chunking.ts +220 -0
- package/src/citations.ts +232 -0
- package/src/cli.ts +9403 -0
- package/src/codex-cli-fallback.ts +162 -0
- package/src/codex-thread-key.ts +1 -0
- package/src/coding/access-coding-context.test.ts +197 -0
- package/src/coding/coding-branch-scope.test.ts +281 -0
- package/src/coding/coding-namespace.test.ts +360 -0
- package/src/coding/coding-namespace.ts +412 -0
- package/src/coding/coding-orchestrator.test.ts +249 -0
- package/src/coding/git-context.test.ts +507 -0
- package/src/coding/git-context.ts +336 -0
- package/src/coding/mcp-set-coding-context.test.ts +174 -0
- package/src/coding/review-context.test.ts +316 -0
- package/src/coding/review-context.ts +349 -0
- package/src/coding/wire-coding-context.test.ts +468 -0
- package/src/commitment-ledger.test.ts +78 -0
- package/src/commitment-ledger.ts +337 -0
- package/src/compat/checks.test.ts +206 -0
- package/src/compat/checks.ts +716 -0
- package/src/compat/types.ts +33 -0
- package/src/compounding/engine.ts +1686 -0
- package/src/compounding/preference-consolidator.ts +778 -0
- package/src/compression-optimizer.ts +312 -0
- package/src/config.test.ts +930 -0
- package/src/config.ts +3807 -0
- package/src/connectors/codex/instructions.md +160 -0
- package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
- package/src/connectors/codex-marketplace.ts +500 -0
- package/src/connectors/codex-materialize-runner.ts +212 -0
- package/src/connectors/codex-materialize.ts +983 -0
- package/src/connectors/coerce.ts +62 -0
- package/src/connectors/index.test.ts +1570 -0
- package/src/connectors/index.ts +3222 -0
- package/src/connectors/live/framework.ts +164 -0
- package/src/connectors/live/github.test.ts +1218 -0
- package/src/connectors/live/github.ts +1068 -0
- package/src/connectors/live/gmail.test.ts +1706 -0
- package/src/connectors/live/gmail.ts +1293 -0
- package/src/connectors/live/google-drive.test.ts +696 -0
- package/src/connectors/live/google-drive.ts +724 -0
- package/src/connectors/live/index.ts +101 -0
- package/src/connectors/live/live-connectors.test.ts +689 -0
- package/src/connectors/live/notion.test.ts +1109 -0
- package/src/connectors/live/notion.ts +978 -0
- package/src/connectors/live/registry.ts +103 -0
- package/src/connectors/live/state-store.ts +399 -0
- package/src/connectors/live/transient-errors.ts +150 -0
- package/src/connectors/weclone-installer.test.ts +850 -0
- package/src/connectors-cli.ts +513 -0
- package/src/console/state.test.ts +224 -0
- package/src/console/state.ts +514 -0
- package/src/console/trace.test.ts +813 -0
- package/src/console/trace.ts +603 -0
- package/src/console/tui.test.ts +582 -0
- package/src/console/tui.ts +508 -0
- package/src/consolidation-operator.ts +182 -0
- package/src/consolidation-provenance-check.ts +551 -0
- package/src/consolidation-undo.ts +718 -0
- package/src/contradiction/contradiction-judge.test.ts +189 -0
- package/src/contradiction/contradiction-judge.ts +333 -0
- package/src/contradiction/contradiction-review.ts +574 -0
- package/src/contradiction/contradiction-scan.ts +504 -0
- package/src/contradiction/contradiction.test.ts +2230 -0
- package/src/contradiction/index.ts +37 -0
- package/src/contradiction/resolution.ts +383 -0
- package/src/conversation-index/backend.ts +323 -0
- package/src/conversation-index/chunker.ts +47 -0
- package/src/conversation-index/cleanup.ts +53 -0
- package/src/conversation-index/faiss-adapter.ts +384 -0
- package/src/conversation-index/indexer.test.ts +164 -0
- package/src/conversation-index/indexer.ts +192 -0
- package/src/conversation-index/search.ts +37 -0
- package/src/cross-namespace-budget.test.ts +275 -0
- package/src/cross-namespace-budget.ts +365 -0
- package/src/cue-anchors.ts +163 -0
- package/src/curation/index.ts +544 -0
- package/src/dashboard-runtime.ts +337 -0
- package/src/day-summary.ts +122 -0
- package/src/dedup/index.ts +330 -0
- package/src/dedup/semantic.test.ts +1577 -0
- package/src/dedup/semantic.ts +148 -0
- package/src/delinearize.ts +193 -0
- package/src/direct-answer-wiring.test.ts +473 -0
- package/src/direct-answer-wiring.ts +180 -0
- package/src/direct-answer.test.ts +484 -0
- package/src/direct-answer.ts +273 -0
- package/src/embedding-fallback.ts +565 -0
- package/src/enrichment/audit.ts +89 -0
- package/src/enrichment/index.ts +27 -0
- package/src/enrichment/pipeline.ts +197 -0
- package/src/enrichment/provider-registry.ts +85 -0
- package/src/enrichment/types.ts +100 -0
- package/src/enrichment/web-search-provider.ts +63 -0
- package/src/entity-retrieval.ts +774 -0
- package/src/entity-schema.ts +239 -0
- package/src/evals.ts +1312 -0
- package/src/event-order-recall.test.ts +4164 -0
- package/src/event-order-recall.ts +2802 -0
- package/src/evidence-pack.test.ts +89 -0
- package/src/evidence-pack.ts +388 -0
- package/src/explicit-capture.ts +530 -0
- package/src/explicit-cue-recall.test.ts +3019 -0
- package/src/explicit-cue-recall.ts +5545 -0
- package/src/extraction-judge-telemetry.ts +234 -0
- package/src/extraction-judge-training.ts +221 -0
- package/src/extraction-judge.ts +846 -0
- package/src/extraction-timeout.test.ts +265 -0
- package/src/extraction.ts +2719 -0
- package/src/fallback-llm.test.ts +1060 -0
- package/src/fallback-llm.ts +918 -0
- package/src/focused-list-recall.test.ts +734 -0
- package/src/focused-list-recall.ts +1160 -0
- package/src/graph-dashboard-diff.ts +35 -0
- package/src/graph-dashboard-key.ts +5 -0
- package/src/graph-dashboard-parser.ts +104 -0
- package/src/graph-edge-reinforcement.ts +192 -0
- package/src/graph-events.ts +151 -0
- package/src/graph-recall.test.ts +164 -0
- package/src/graph-recall.ts +189 -0
- package/src/graph-retrieval.test.ts +809 -0
- package/src/graph-retrieval.ts +823 -0
- package/src/graph-snapshot.ts +329 -0
- package/src/graph.ts +813 -0
- package/src/harmonic-retrieval.ts +223 -0
- package/src/himem.ts +154 -0
- package/src/hygiene.ts +87 -0
- package/src/identity-continuity.ts +333 -0
- package/src/importance.ts +328 -0
- package/src/importers/base.test.ts +294 -0
- package/src/importers/base.ts +436 -0
- package/src/importers/index.ts +21 -0
- package/src/index.ts +1204 -0
- package/src/intent.ts +154 -0
- package/src/json-extract.ts +85 -0
- package/src/json-store.ts +42 -0
- package/src/lcm/archive.ts +617 -0
- package/src/lcm/dag.ts +199 -0
- package/src/lcm/engine.ts +645 -0
- package/src/lcm/index.ts +7 -0
- package/src/lcm/queue.test.ts +178 -0
- package/src/lcm/queue.ts +200 -0
- package/src/lcm/recall.ts +117 -0
- package/src/lcm/schema.ts +154 -0
- package/src/lcm/summarizer.ts +235 -0
- package/src/lcm/tools.ts +191 -0
- package/src/lcm-engine.test.ts +660 -0
- package/src/legacy-hook-compat.test.ts +20 -0
- package/src/legacy-hook-compat.ts +45 -0
- package/src/lifecycle.ts +289 -0
- package/src/live-connectors-runner.ts +385 -0
- package/src/local-llm-qos.test.ts +303 -0
- package/src/local-llm-thinking.test.ts +292 -0
- package/src/local-llm.ts +1464 -0
- package/src/logger.ts +49 -0
- package/src/maintenance/archive-observations.ts +147 -0
- package/src/maintenance/backup-stamp.ts +3 -0
- package/src/maintenance/dreams-ledger.ts +516 -0
- package/src/maintenance/first-start-migration.ts +362 -0
- package/src/maintenance/forget.test.ts +206 -0
- package/src/maintenance/forget.ts +126 -0
- package/src/maintenance/graph-edge-decay.test.ts +409 -0
- package/src/maintenance/graph-edge-decay.ts +394 -0
- package/src/maintenance/memory-governance-cron.ts +447 -0
- package/src/maintenance/memory-governance.ts +1039 -0
- package/src/maintenance/migrate-observations.ts +216 -0
- package/src/maintenance/observation-ledger-utils.ts +54 -0
- package/src/maintenance/pattern-reinforcement.test.ts +875 -0
- package/src/maintenance/pattern-reinforcement.ts +369 -0
- package/src/maintenance/purge.ts +334 -0
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
- package/src/maintenance/rebuild-memory-projection.ts +1234 -0
- package/src/maintenance/rebuild-observations.ts +178 -0
- package/src/maintenance/tier-stats.test.ts +378 -0
- package/src/maintenance/tier-stats.ts +222 -0
- package/src/mcp-memory-inspector-app.ts +421 -0
- package/src/memory-action-policy.ts +80 -0
- package/src/memory-cache.ts +208 -0
- package/src/memory-extension/claude-code-publisher.ts +51 -0
- package/src/memory-extension/codex-publisher.ts +149 -0
- package/src/memory-extension/hermes-publisher.ts +51 -0
- package/src/memory-extension/index.ts +100 -0
- package/src/memory-extension/shared-instructions.ts +133 -0
- package/src/memory-extension/types.ts +86 -0
- package/src/memory-extension-host/host-discovery.ts +276 -0
- package/src/memory-extension-host/index.ts +14 -0
- package/src/memory-extension-host/render-extensions-block.ts +73 -0
- package/src/memory-extension-host/types.ts +21 -0
- package/src/memory-lifecycle-ledger-utils.ts +116 -0
- package/src/memory-projection-format.ts +11 -0
- package/src/memory-projection-store.ts +951 -0
- package/src/memory-provenance.test.ts +196 -0
- package/src/memory-provenance.ts +484 -0
- package/src/memory-worth-bench.test.ts +71 -0
- package/src/memory-worth-bench.ts +265 -0
- package/src/memory-worth-filter.test.ts +209 -0
- package/src/memory-worth-filter.ts +204 -0
- package/src/memory-worth-frontmatter.test.ts +311 -0
- package/src/memory-worth-outcomes.test.ts +316 -0
- package/src/memory-worth-outcomes.ts +286 -0
- package/src/memory-worth.test.ts +317 -0
- package/src/memory-worth.ts +215 -0
- package/src/message-parts/index.ts +806 -0
- package/src/message-parts/message-parts.test.ts +421 -0
- package/src/migrate/from-engram.ts +789 -0
- package/src/model-registry.ts +313 -0
- package/src/models-json.ts +76 -0
- package/src/namespaces/migrate.ts +187 -0
- package/src/namespaces/path.ts +25 -0
- package/src/namespaces/principal.test.ts +195 -0
- package/src/namespaces/principal.ts +86 -0
- package/src/namespaces/search.test.ts +105 -0
- package/src/namespaces/search.ts +233 -0
- package/src/namespaces/storage.ts +74 -0
- package/src/native-knowledge.ts +1823 -0
- package/src/negative.ts +72 -0
- package/src/network/tailscale.ts +179 -0
- package/src/network/webdav.ts +385 -0
- package/src/objective-state-writers.ts +951 -0
- package/src/objective-state.ts +320 -0
- package/src/onboarding/index.ts +529 -0
- package/src/openai-chat-compat.ts +56 -0
- package/src/operator-toolkit.ts +2132 -0
- package/src/opik-exporter.test.ts +72 -0
- package/src/opik-exporter.ts +587 -0
- package/src/orchestrator-extraction-queue.test.ts +197 -0
- package/src/orchestrator-flush.test.ts +1171 -0
- package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
- package/src/orchestrator-source-attribution.test.ts +701 -0
- package/src/orchestrator.ts +16368 -0
- package/src/page-versioning.ts +450 -0
- package/src/patterns-cli.ts +574 -0
- package/src/peers/index.ts +54 -0
- package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
- package/src/peers/migrate-from-identity-anchor.ts +350 -0
- package/src/peers/peers.test.ts +419 -0
- package/src/peers/profile-reasoner.ts +694 -0
- package/src/peers/storage.ts +1350 -0
- package/src/peers/types.ts +138 -0
- package/src/plugin-id.ts +84 -0
- package/src/policy-runtime.ts +209 -0
- package/src/procedural/procedure-miner.ts +150 -0
- package/src/procedural/procedure-recall.ts +93 -0
- package/src/procedural/procedure-stats.ts +213 -0
- package/src/procedural/procedure-types.ts +132 -0
- package/src/procedural/reinforcement-core.test.ts +132 -0
- package/src/procedural/reinforcement-core.ts +73 -0
- package/src/profiling.test.ts +263 -0
- package/src/profiling.ts +435 -0
- package/src/projection/index.ts +398 -0
- package/src/qmd-recall-cache.test.ts +138 -0
- package/src/qmd-recall-cache.ts +111 -0
- package/src/qmd.test.ts +257 -0
- package/src/qmd.ts +2614 -0
- package/src/reasoning-trace-recall.ts +201 -0
- package/src/reasoning-trace-types.ts +235 -0
- package/src/recall-audit-anomaly.test.ts +246 -0
- package/src/recall-audit-anomaly.ts +297 -0
- package/src/recall-audit.test.ts +51 -0
- package/src/recall-audit.ts +72 -0
- package/src/recall-budget-config.test.ts +87 -0
- package/src/recall-disclosure-escalation.test.ts +196 -0
- package/src/recall-disclosure-escalation.ts +158 -0
- package/src/recall-disclosure-shaping.test.ts +146 -0
- package/src/recall-disclosure.test.ts +214 -0
- package/src/recall-explain-renderer.test.ts +140 -0
- package/src/recall-explain-renderer.ts +356 -0
- package/src/recall-mmr.test.ts +808 -0
- package/src/recall-mmr.ts +607 -0
- package/src/recall-qos.test.ts +85 -0
- package/src/recall-qos.ts +82 -0
- package/src/recall-query-policy.ts +221 -0
- package/src/recall-state.test.ts +233 -0
- package/src/recall-state.ts +456 -0
- package/src/recall-tag-filter.ts +143 -0
- package/src/recall-tokenization.ts +35 -0
- package/src/recall-xray-cli.test.ts +118 -0
- package/src/recall-xray-cli.ts +100 -0
- package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
- package/src/recall-xray-renderer.test.ts +539 -0
- package/src/recall-xray-renderer.ts +487 -0
- package/src/recall-xray.test.ts +503 -0
- package/src/recall-xray.ts +621 -0
- package/src/reconstruct.ts +41 -0
- package/src/release-changelog.ts +35 -0
- package/src/relevance.ts +67 -0
- package/src/replay/normalizers/chatgpt.ts +133 -0
- package/src/replay/normalizers/claude.ts +102 -0
- package/src/replay/normalizers/openclaw.ts +119 -0
- package/src/replay/normalizers/shared.ts +69 -0
- package/src/replay/runner.ts +197 -0
- package/src/replay/types.ts +143 -0
- package/src/rerank.test.ts +48 -0
- package/src/rerank.ts +176 -0
- package/src/resolve-auth-token.test.ts +226 -0
- package/src/resolve-auth-token.ts +151 -0
- package/src/resolve-provider-secret.test.ts +187 -0
- package/src/resolve-provider-secret.ts +410 -0
- package/src/response-guidance-recall.test.ts +3952 -0
- package/src/response-guidance-recall.ts +4431 -0
- package/src/resume-bundles.ts +415 -0
- package/src/retrieval-agents.ts +623 -0
- package/src/retrieval-tiers.ts +25 -0
- package/src/retrieval.ts +104 -0
- package/src/review/index.test.ts +201 -0
- package/src/review/index.ts +536 -0
- package/src/routing/engine.ts +162 -0
- package/src/routing/store.ts +321 -0
- package/src/runtime/better-sqlite.test.ts +32 -0
- package/src/runtime/better-sqlite.ts +76 -0
- package/src/runtime/child-process.ts +67 -0
- package/src/runtime/env.ts +48 -0
- package/src/sanitize.ts +58 -0
- package/src/schemas.ts +449 -0
- package/src/sdk-compat.ts +87 -0
- package/src/search/document-scanner.ts +96 -0
- package/src/search/embed-helper.ts +142 -0
- package/src/search/factory.ts +189 -0
- package/src/search/index.ts +10 -0
- package/src/search/lancedb-backend.ts +342 -0
- package/src/search/meilisearch-backend.ts +232 -0
- package/src/search/noop-backend.ts +57 -0
- package/src/search/orama-backend.ts +358 -0
- package/src/search/port.ts +86 -0
- package/src/search/remote-backend.ts +124 -0
- package/src/secure-store/cipher.ts +271 -0
- package/src/secure-store/cli-handlers.ts +355 -0
- package/src/secure-store/cli-renderer.ts +131 -0
- package/src/secure-store/header.ts +373 -0
- package/src/secure-store/index.ts +137 -0
- package/src/secure-store/kdf.ts +263 -0
- package/src/secure-store/keyring.ts +106 -0
- package/src/secure-store/metadata.ts +394 -0
- package/src/secure-store/passphrase-reader.ts +252 -0
- package/src/secure-store/secure-fs.ts +571 -0
- package/src/secure-store/secure-store.test.ts +755 -0
- package/src/semantic-chunking.ts +545 -0
- package/src/semantic-consolidation.test.ts +182 -0
- package/src/semantic-consolidation.ts +432 -0
- package/src/semantic-rule-promotion.ts +183 -0
- package/src/semantic-rule-verifier.ts +160 -0
- package/src/session-integrity.ts +569 -0
- package/src/session-observer-bands.ts +11 -0
- package/src/session-observer-state.ts +346 -0
- package/src/session-toggles.test.ts +96 -0
- package/src/session-toggles.ts +159 -0
- package/src/shared-context/manager.ts +810 -0
- package/src/signal.ts +84 -0
- package/src/skills-registry.test.ts +277 -0
- package/src/skills-registry.ts +120 -0
- package/src/source-attribution-roundtrip.test.ts +215 -0
- package/src/source-attribution.test.ts +1425 -0
- package/src/source-attribution.ts +639 -0
- package/src/spaces/index.ts +627 -0
- package/src/storage-paths.ts +117 -0
- package/src/storage.ts +6657 -0
- package/src/store-contract.ts +55 -0
- package/src/summarizer.ts +844 -0
- package/src/summary-snapshot.test.ts +681 -0
- package/src/summary-snapshot.ts +238 -0
- package/src/surfaces/dreams.test.ts +394 -0
- package/src/surfaces/dreams.ts +346 -0
- package/src/surfaces/heartbeat.test.ts +415 -0
- package/src/surfaces/heartbeat.ts +325 -0
- package/src/sync/index.ts +308 -0
- package/src/targeted-fact-recall.test.ts +1694 -0
- package/src/targeted-fact-recall.ts +2905 -0
- package/src/taxonomy/default-taxonomy.ts +87 -0
- package/src/taxonomy/index.ts +26 -0
- package/src/taxonomy/resolver-doc-generator.ts +57 -0
- package/src/taxonomy/resolver.ts +184 -0
- package/src/taxonomy/taxonomy-loader.ts +186 -0
- package/src/taxonomy/types.ts +48 -0
- package/src/telemetry-transcript.ts +70 -0
- package/src/temporal-index.ts +890 -0
- package/src/temporal-supersession.test.ts +2703 -0
- package/src/temporal-supersession.ts +493 -0
- package/src/temporal-validity.test.ts +448 -0
- package/src/temporal-validity.ts +123 -0
- package/src/threading.ts +395 -0
- package/src/tier-migration.ts +124 -0
- package/src/tier-routing.ts +102 -0
- package/src/tmt.ts +462 -0
- package/src/tokens.test.ts +178 -0
- package/src/tokens.ts +279 -0
- package/src/topics.ts +147 -0
- package/src/training-export/cli-date-validation.test.ts +258 -0
- package/src/training-export/converter.test.ts +452 -0
- package/src/training-export/converter.ts +319 -0
- package/src/training-export/date-parse.ts +117 -0
- package/src/training-export/index.ts +26 -0
- package/src/training-export/registry.test.ts +85 -0
- package/src/training-export/registry.ts +57 -0
- package/src/training-export/types.ts +31 -0
- package/src/transcript.ts +1179 -0
- package/src/transfer/autodetect.ts +30 -0
- package/src/transfer/backup.ts +138 -0
- package/src/transfer/capsule-crypto.ts +485 -0
- package/src/transfer/capsule-encrypt.test.ts +690 -0
- package/src/transfer/capsule-export.ts +543 -0
- package/src/transfer/capsule-fork.ts +375 -0
- package/src/transfer/capsule-import.ts +564 -0
- package/src/transfer/capsule-merge.ts +433 -0
- package/src/transfer/conflict-policy.ts +16 -0
- package/src/transfer/constants.ts +13 -0
- package/src/transfer/exclusions.ts +37 -0
- package/src/transfer/export-json.ts +65 -0
- package/src/transfer/export-md.ts +59 -0
- package/src/transfer/export-sqlite.ts +52 -0
- package/src/transfer/fs-utils.ts +269 -0
- package/src/transfer/import-json.ts +108 -0
- package/src/transfer/import-md.ts +84 -0
- package/src/transfer/import-sqlite.ts +100 -0
- package/src/transfer/integrity.ts +71 -0
- package/src/transfer/sqlite-schema.ts +16 -0
- package/src/transfer/types.ts +297 -0
- package/src/trust-zones.ts +1186 -0
- package/src/types.ts +3074 -0
- package/src/user-model.test.ts +124 -0
- package/src/user-model.ts +162 -0
- package/src/utility-learner.ts +353 -0
- package/src/utility-runtime.ts +88 -0
- package/src/utility-telemetry.ts +215 -0
- package/src/utils/category-dir.ts +44 -0
- package/src/utils/errno.ts +6 -0
- package/src/utils/iso-timestamp.test.ts +37 -0
- package/src/utils/iso-timestamp.ts +164 -0
- package/src/utils/path.ts +26 -0
- package/src/verified-recall.ts +138 -0
- package/src/version-utils.test.ts +10 -0
- package/src/version-utils.ts +9 -0
- package/src/whitespace.ts +10 -0
- package/src/work/board.ts +359 -0
- package/src/work/boundary.ts +107 -0
- package/src/work/storage.ts +436 -0
- package/src/work/types.ts +82 -0
- package/src/work-product-ledger.ts +265 -0
- package/dist/access-service-BkXt3di1.d.ts +0 -2039
- package/dist/capsule-crypto-SJS5VVAP.js +0 -18
- package/dist/capsule-export-LLEVB2RG.js +0 -17
- package/dist/capsule-import-UW45R2MZ.js +0 -16
- package/dist/capsule-merge-DI7PNQ2H.js +0 -189
- package/dist/chunk-2LGMW3DJ.js +0 -111
- package/dist/chunk-2YMTO4ZJ.js +0 -265
- package/dist/chunk-2YMTO4ZJ.js.map +0 -1
- package/dist/chunk-363MWCD3.js +0 -9683
- package/dist/chunk-363MWCD3.js.map +0 -1
- package/dist/chunk-36CTNQY7.js +0 -1554
- package/dist/chunk-36CTNQY7.js.map +0 -1
- package/dist/chunk-457A4P3L.js +0 -119
- package/dist/chunk-457A4P3L.js.map +0 -1
- package/dist/chunk-4DXC6HQQ.js +0 -1837
- package/dist/chunk-4DXC6HQQ.js.map +0 -1
- package/dist/chunk-4IS4SXIQ.js +0 -2040
- package/dist/chunk-57QNCUEZ.js +0 -1914
- package/dist/chunk-57QNCUEZ.js.map +0 -1
- package/dist/chunk-6AUUAZEX.js +0 -150
- package/dist/chunk-6AUUAZEX.js.map +0 -1
- package/dist/chunk-6TBWYBJ3.js +0 -236
- package/dist/chunk-6XA7UN4Z.js +0 -135
- package/dist/chunk-6Z6UH6TK.js +0 -2129
- package/dist/chunk-6Z6UH6TK.js.map +0 -1
- package/dist/chunk-74EMIVE4.js +0 -329
- package/dist/chunk-74EMIVE4.js.map +0 -1
- package/dist/chunk-74WWN7ZW.js +0 -82
- package/dist/chunk-74WWN7ZW.js.map +0 -1
- package/dist/chunk-767ODGE6.js +0 -183
- package/dist/chunk-A4ACKWIW.js +0 -289
- package/dist/chunk-A4ACKWIW.js.map +0 -1
- package/dist/chunk-ASAITVLA.js +0 -64
- package/dist/chunk-ASAITVLA.js.map +0 -1
- package/dist/chunk-C5HUWVH2.js +0 -891
- package/dist/chunk-C5HUWVH2.js.map +0 -1
- package/dist/chunk-D54LZC5L.js +0 -147
- package/dist/chunk-DF3RVK3X.js +0 -119
- package/dist/chunk-DF3RVK3X.js.map +0 -1
- package/dist/chunk-E6K4NIEU.js +0 -747
- package/dist/chunk-E6K4NIEU.js.map +0 -1
- package/dist/chunk-EEQLFRUM.js +0 -89
- package/dist/chunk-EQINRHYR.js +0 -672
- package/dist/chunk-EQINRHYR.js.map +0 -1
- package/dist/chunk-ETOW6ACV.js +0 -158
- package/dist/chunk-ETOW6ACV.js.map +0 -1
- package/dist/chunk-EYNQTST2.js +0 -721
- package/dist/chunk-FYIYMQ5N.js +0 -221
- package/dist/chunk-FYIYMQ5N.js.map +0 -1
- package/dist/chunk-G2WADRQ3.js +0 -219
- package/dist/chunk-G4SK7DSQ.js +0 -121
- package/dist/chunk-GGD5W7TB.js +0 -105
- package/dist/chunk-GGD5W7TB.js.map +0 -1
- package/dist/chunk-GVPWB7EY.js +0 -390
- package/dist/chunk-GVPWB7EY.js.map +0 -1
- package/dist/chunk-HJYHRE4S.js +0 -647
- package/dist/chunk-I6BQZSML.js +0 -1451
- package/dist/chunk-I6BQZSML.js.map +0 -1
- package/dist/chunk-IBX3VFOM.js +0 -446
- package/dist/chunk-IBX3VFOM.js.map +0 -1
- package/dist/chunk-IXEJRKCZ.js +0 -18
- package/dist/chunk-JBMSGZEQ.js +0 -441
- package/dist/chunk-JBMSGZEQ.js.map +0 -1
- package/dist/chunk-JRNQ3RNA.js +0 -284
- package/dist/chunk-JRNQ3RNA.js.map +0 -1
- package/dist/chunk-K6WK37A6.js +0 -865
- package/dist/chunk-K6WK37A6.js.map +0 -1
- package/dist/chunk-KBYWQWSB.js +0 -271
- package/dist/chunk-KUHRUM6B.js +0 -14397
- package/dist/chunk-KUHRUM6B.js.map +0 -1
- package/dist/chunk-KWBPHZUU.js +0 -83
- package/dist/chunk-KWBPHZUU.js.map +0 -1
- package/dist/chunk-LIO5X3CM.js +0 -596
- package/dist/chunk-MARWOCVP.js +0 -48
- package/dist/chunk-MCC6KDQF.js +0 -5095
- package/dist/chunk-MCC6KDQF.js.map +0 -1
- package/dist/chunk-N5AKDXAI.js +0 -74
- package/dist/chunk-NN3LPQ5D.js +0 -936
- package/dist/chunk-NN3LPQ5D.js.map +0 -1
- package/dist/chunk-O4XJUPSF.js +0 -533
- package/dist/chunk-O4XJUPSF.js.map +0 -1
- package/dist/chunk-OA3L7BFR.js +0 -183
- package/dist/chunk-OA3L7BFR.js.map +0 -1
- package/dist/chunk-OR64ZGRZ.js +0 -23
- package/dist/chunk-P73JTV34.js +0 -275
- package/dist/chunk-P73JTV34.js.map +0 -1
- package/dist/chunk-P77UEOU2.js +0 -1521
- package/dist/chunk-P77UEOU2.js.map +0 -1
- package/dist/chunk-PB5KW5PL.js +0 -118
- package/dist/chunk-PHNGXFQ6.js +0 -623
- package/dist/chunk-PHNGXFQ6.js.map +0 -1
- package/dist/chunk-QIGOEM65.js +0 -228
- package/dist/chunk-RXTFCYQF.js +0 -108
- package/dist/chunk-S2JJBLJG.js +0 -2101
- package/dist/chunk-S2JJBLJG.js.map +0 -1
- package/dist/chunk-S3IP6R6K.js +0 -219
- package/dist/chunk-S3IP6R6K.js.map +0 -1
- package/dist/chunk-SRBJUAMP.js +0 -403
- package/dist/chunk-SRBJUAMP.js.map +0 -1
- package/dist/chunk-URB2WSKZ.js +0 -350
- package/dist/chunk-URB2WSKZ.js.map +0 -1
- package/dist/chunk-VQXK37XA.js +0 -26
- package/dist/chunk-VQXK37XA.js.map +0 -1
- package/dist/chunk-VTU2B4VF.js +0 -146
- package/dist/chunk-VTU2B4VF.js.map +0 -1
- package/dist/chunk-VX2IUQFE.js +0 -613
- package/dist/chunk-VX2IUQFE.js.map +0 -1
- package/dist/chunk-WGK4VHGP.js +0 -4292
- package/dist/chunk-WGK4VHGP.js.map +0 -1
- package/dist/chunk-WTFWLUSX.js +0 -827
- package/dist/chunk-WTFWLUSX.js.map +0 -1
- package/dist/chunk-XJKFSSDW.js +0 -726
- package/dist/chunk-XJKFSSDW.js.map +0 -1
- package/dist/chunk-XMHBH5H6.js +0 -283
- package/dist/chunk-XMHBH5H6.js.map +0 -1
- package/dist/chunk-XMVFHBHT.js +0 -277
- package/dist/chunk-Y5KDIOKF.js +0 -2403
- package/dist/chunk-Y5KDIOKF.js.map +0 -1
- package/dist/chunk-YNB73F22.js +0 -137
- package/dist/chunk-YNB73F22.js.map +0 -1
- package/dist/chunk-Z2E7VW55.js +0 -335
- package/dist/chunk-Z2E7VW55.js.map +0 -1
- package/dist/chunk-Z5S5HNGY.js +0 -2280
- package/dist/chunk-Z5S5HNGY.js.map +0 -1
- package/dist/chunk-ZL4S7ARC.js +0 -53
- package/dist/chunk-ZTSE2ZJ6.js +0 -190
- package/dist/chunk-ZTSE2ZJ6.js.map +0 -1
- package/dist/cli-Cvy2SNhF.d.ts +0 -1259
- package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
- package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
- package/dist/contradiction-review-5LTTVDQV.js +0 -22
- package/dist/contradiction-scan-3Z6YW7YA.js +0 -413
- package/dist/contradiction-scan-3Z6YW7YA.js.map +0 -1
- package/dist/engine-FOC3IJLA.js +0 -28
- package/dist/fs-utils-IRVUFB6G.js +0 -30
- package/dist/graph-edge-decay-PWB63GRE.js +0 -207
- package/dist/index-1qIcnbG1.d.ts +0 -34
- package/dist/memory-governance-F3QOJGEY.js +0 -37
- package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
- package/dist/orchestrator-AOQMo7QI.d.ts +0 -1784
- package/dist/path-RMTY5Y5A.js +0 -9
- package/dist/port-B6VEDIkC.d.ts +0 -53
- package/dist/resolution-YGIBORXI.js +0 -101
- package/dist/resolution-YGIBORXI.js.map +0 -1
- package/dist/secure-store-4R2GSO7S.js +0 -156
- package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
- package/dist/state-store-3EH7HYIN.js +0 -16
- package/dist/types-V3FJ26TF.js +0 -30
- /package/dist/{capsule-crypto-SJS5VVAP.js.map → action-confidence.js.map} +0 -0
- /package/dist/{capsule-export-LLEVB2RG.js.map → adapters/claude-code.js.map} +0 -0
- /package/dist/{capsule-import-UW45R2MZ.js.map → adapters/codex.js.map} +0 -0
- /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/hermes.js.map} +0 -0
- /package/dist/{engine-FOC3IJLA.js.map → adapters/index.js.map} +0 -0
- /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/registry.js.map} +0 -0
- /package/dist/{memory-governance-F3QOJGEY.js.map → adapters/replit.js.map} +0 -0
- /package/dist/{path-RMTY5Y5A.js.map → adapters/types.js.map} +0 -0
- /package/dist/{secure-store-4R2GSO7S.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
- /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
- /package/dist/{chunk-KBYWQWSB.js.map → chunk-4CRG46BG.js.map} +0 -0
- /package/dist/{chunk-LIO5X3CM.js.map → chunk-7IASACLB.js.map} +0 -0
- /package/dist/{chunk-EYNQTST2.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
- /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
- /package/dist/{chunk-QIGOEM65.js.map → chunk-GGKRUQOO.js.map} +0 -0
- /package/dist/{chunk-HJYHRE4S.js.map → chunk-GL6I6MEQ.js.map} +0 -0
- /package/dist/{state-store-3EH7HYIN.js.map → chunk-HHLLAQGZ.js.map} +0 -0
- /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
- /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
- /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
- /package/dist/{chunk-PB5KW5PL.js.map → chunk-MC26UJIM.js.map} +0 -0
- /package/dist/{chunk-ZL4S7ARC.js.map → chunk-MT4HVDUZ.js.map} +0 -0
- /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
- /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
- /package/dist/{chunk-RXTFCYQF.js.map → chunk-P4NEIHUT.js.map} +0 -0
- /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
- /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
- /package/dist/{types-V3FJ26TF.js.map → chunk-SEDEKFYQ.js.map} +0 -0
- /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
- /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
- /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
- /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
- /package/dist/{chunk-6XA7UN4Z.js.map → chunk-XVZ7B3HG.js.map} +0 -0
- /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
|
@@ -0,0 +1,890 @@
|
|
|
1
|
+
import { Readable, Writable } from 'node:stream';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* AES-256-GCM encrypt / decrypt primitives for the secure-store
|
|
5
|
+
* module.
|
|
6
|
+
*
|
|
7
|
+
* Issue #690 (PR 1/4) — pure primitives, no I/O.
|
|
8
|
+
*
|
|
9
|
+
* Sealed envelope format
|
|
10
|
+
* ----------------------
|
|
11
|
+
* A "sealed" buffer is the canonical on-disk shape for a single
|
|
12
|
+
* encrypted blob. It contains the salt used to derive the key from
|
|
13
|
+
* the user's passphrase, so a caller who has the passphrase + the
|
|
14
|
+
* sealed buffer can decrypt without any external metadata.
|
|
15
|
+
*
|
|
16
|
+
* [VERSION:1][SALT:16][IV:12][AUTHTAG:16][CIPHERTEXT:...]
|
|
17
|
+
*
|
|
18
|
+
* - VERSION (1 byte): envelope format version. Currently 1. Future
|
|
19
|
+
* versions can change the layout (e.g. variable salt length, an
|
|
20
|
+
* algorithm identifier byte) by bumping this byte.
|
|
21
|
+
* - SALT (16 bytes): KDF salt. Persisted with the ciphertext so the
|
|
22
|
+
* same passphrase can re-derive the key on read.
|
|
23
|
+
* - IV (12 bytes): GCM nonce. Must be unique per (key, ciphertext)
|
|
24
|
+
* pair. We generate it fresh from `randomBytes` on every encrypt
|
|
25
|
+
* call. Reusing an IV with the same key destroys GCM's
|
|
26
|
+
* confidentiality and authenticity guarantees.
|
|
27
|
+
* - AUTHTAG (16 bytes): GCM authentication tag. Tampering with any
|
|
28
|
+
* byte of (salt | iv | tag | ciphertext) causes decryption to
|
|
29
|
+
* fail with an auth-tag mismatch.
|
|
30
|
+
* - CIPHERTEXT (variable): the encrypted payload.
|
|
31
|
+
*
|
|
32
|
+
* The salt is stored alongside the ciphertext (rather than only in a
|
|
33
|
+
* separate metadata file) so an individual encrypted blob is
|
|
34
|
+
* self-contained for diagnostics and recovery. The metadata file
|
|
35
|
+
* (see `metadata.ts`) records the *canonical* salt + KDF params for a
|
|
36
|
+
* store; the per-blob salt is expected to match the metadata salt in
|
|
37
|
+
* normal operation, but the format does not require it — a future PR
|
|
38
|
+
* could rotate per-blob salts if desired.
|
|
39
|
+
*
|
|
40
|
+
* AAD support
|
|
41
|
+
* -----------
|
|
42
|
+
* Callers can pass associated authenticated data (AAD) — typically a
|
|
43
|
+
* file path or namespace tag — that is authenticated but not
|
|
44
|
+
* encrypted. AAD must be supplied identically on encrypt and decrypt;
|
|
45
|
+
* a mismatch causes auth-tag failure. AAD is NOT serialized into the
|
|
46
|
+
* envelope; the caller is responsible for re-supplying it on decrypt.
|
|
47
|
+
*/
|
|
48
|
+
/** Current envelope format version. */
|
|
49
|
+
declare const ENVELOPE_VERSION: 1;
|
|
50
|
+
/** GCM nonce length. 96 bits is the NIST-recommended size for AES-GCM. */
|
|
51
|
+
declare const IV_LENGTH = 12;
|
|
52
|
+
/** GCM authentication tag length. 16 bytes (128 bits) — the maximum. */
|
|
53
|
+
declare const AUTH_TAG_LENGTH = 16;
|
|
54
|
+
/** Salt length carried in the envelope. Must match KDF_SALT_LENGTH. */
|
|
55
|
+
declare const ENVELOPE_SALT_LENGTH = 16;
|
|
56
|
+
/** Required key length for AES-256. */
|
|
57
|
+
declare const AES_KEY_LENGTH = 32;
|
|
58
|
+
/** Byte offsets of each envelope field (for clarity at call sites). */
|
|
59
|
+
declare const ENVELOPE_LAYOUT: Readonly<{
|
|
60
|
+
version: 0;
|
|
61
|
+
salt: 1;
|
|
62
|
+
iv: number;
|
|
63
|
+
authTag: number;
|
|
64
|
+
ciphertext: number;
|
|
65
|
+
}>;
|
|
66
|
+
/** Minimum envelope size: header + zero-length ciphertext. */
|
|
67
|
+
declare const ENVELOPE_HEADER_SIZE: number;
|
|
68
|
+
interface EncryptOptions {
|
|
69
|
+
/**
|
|
70
|
+
* Optional associated data — authenticated but not encrypted.
|
|
71
|
+
* Caller must supply the same value on decrypt.
|
|
72
|
+
*/
|
|
73
|
+
aad?: Uint8Array;
|
|
74
|
+
/**
|
|
75
|
+
* Override the per-call IV. Strongly discouraged outside of tests:
|
|
76
|
+
* GCM is catastrophically broken if an IV is reused under the same
|
|
77
|
+
* key. Production callers should always let the cipher generate a
|
|
78
|
+
* fresh random IV.
|
|
79
|
+
*/
|
|
80
|
+
iv?: Uint8Array;
|
|
81
|
+
}
|
|
82
|
+
interface DecryptOptions {
|
|
83
|
+
/** Same AAD that was supplied to `encrypt`. */
|
|
84
|
+
aad?: Uint8Array;
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Encrypt `plaintext` under `key` and return a sealed envelope buffer.
|
|
88
|
+
*
|
|
89
|
+
* @param key 32-byte AES-256 key (from `deriveKey`).
|
|
90
|
+
* @param salt 16-byte KDF salt to embed in the envelope. The caller is
|
|
91
|
+
* responsible for using the same salt that was passed to the KDF.
|
|
92
|
+
* @param plaintext the bytes to encrypt.
|
|
93
|
+
* @param options optional `aad` / `iv` overrides.
|
|
94
|
+
*/
|
|
95
|
+
declare function seal(key: Uint8Array, salt: Uint8Array, plaintext: Uint8Array, options?: EncryptOptions): Buffer;
|
|
96
|
+
/** Parsed view of a sealed envelope. Useful for inspection in tests. */
|
|
97
|
+
interface ParsedEnvelope {
|
|
98
|
+
version: number;
|
|
99
|
+
salt: Buffer;
|
|
100
|
+
iv: Buffer;
|
|
101
|
+
authTag: Buffer;
|
|
102
|
+
ciphertext: Buffer;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Parse a sealed envelope into its component fields without
|
|
106
|
+
* decrypting. Throws on malformed input. The returned buffers are
|
|
107
|
+
* sub-views (not copies) — do not mutate.
|
|
108
|
+
*/
|
|
109
|
+
declare function parseEnvelope(envelope: Uint8Array): ParsedEnvelope;
|
|
110
|
+
/**
|
|
111
|
+
* Decrypt a sealed envelope and return the plaintext.
|
|
112
|
+
*
|
|
113
|
+
* Throws on:
|
|
114
|
+
* - malformed envelope (wrong length, wrong version);
|
|
115
|
+
* - wrong key (auth-tag mismatch);
|
|
116
|
+
* - tampered ciphertext / iv / auth tag (auth-tag mismatch);
|
|
117
|
+
* - mismatched AAD (auth-tag mismatch).
|
|
118
|
+
*
|
|
119
|
+
* The same error class is intentional: from the caller's standpoint
|
|
120
|
+
* "wrong passphrase" and "tampered ciphertext" should both be
|
|
121
|
+
* non-recoverable failures.
|
|
122
|
+
*/
|
|
123
|
+
declare function open(key: Uint8Array, envelope: Uint8Array, options?: DecryptOptions): Buffer;
|
|
124
|
+
/**
|
|
125
|
+
* Generate a fresh random salt of the canonical envelope length.
|
|
126
|
+
* Convenience wrapper so callers don't reach into `node:crypto`.
|
|
127
|
+
*/
|
|
128
|
+
declare function generateSalt(): Buffer;
|
|
129
|
+
|
|
130
|
+
/**
|
|
131
|
+
* Key-derivation functions for the secure-store module.
|
|
132
|
+
*
|
|
133
|
+
* Issue #690 (PR 1/4) — pure primitives, no I/O.
|
|
134
|
+
*
|
|
135
|
+
* Naming note
|
|
136
|
+
* -----------
|
|
137
|
+
* The directory is named `secure-store/` — NOT `vault/` — because
|
|
138
|
+
* `vault` is already a content-source concept in `native-knowledge.ts`
|
|
139
|
+
* (Obsidian vaults: `ObsidianVaultState`, `vaultId`, `obsidianVaults`
|
|
140
|
+
* config, etc.). Reusing the `vault` namespace for at-rest encryption
|
|
141
|
+
* would cause symbol collisions and reader confusion.
|
|
142
|
+
*
|
|
143
|
+
* KDF choice — Argon2id primary, scrypt compatibility
|
|
144
|
+
* ---------------------------------------------------
|
|
145
|
+
* Issue #690 specifies Argon2id (OWASP m=64 MiB, t=3, p=4) as the
|
|
146
|
+
* preferred KDF. We use `@node-rs/argon2` for the Argon2id runtime
|
|
147
|
+
* and keep scrypt as the compatibility path for stores initialized
|
|
148
|
+
* before Argon2id support landed.
|
|
149
|
+
*
|
|
150
|
+
* The algorithm name + params are persisted in the metadata file, so
|
|
151
|
+
* stores keep deriving with the same KDF they were initialized with.
|
|
152
|
+
*
|
|
153
|
+
* Trade-off summary:
|
|
154
|
+
* - scrypt N=2^17, r=8, p=1 → ~128 MiB memory, ~150 ms on a modern
|
|
155
|
+
* laptop. Memory-hard. Resists GPU/ASIC attacks meaningfully.
|
|
156
|
+
* - Argon2id m=64 MiB, t=3, p=4 → ~64 MiB memory, similar wall
|
|
157
|
+
* time. Considered the modern best-in-class but requires native
|
|
158
|
+
* bindings.
|
|
159
|
+
*
|
|
160
|
+
* Both produce a 32-byte key suitable for AES-256-GCM.
|
|
161
|
+
*/
|
|
162
|
+
/** KDF algorithms supported by the secure-store metadata format. */
|
|
163
|
+
type KdfAlgorithm = "scrypt" | "argon2id";
|
|
164
|
+
/** Parameters for the scrypt KDF (RFC 7914). */
|
|
165
|
+
interface ScryptParams {
|
|
166
|
+
/** CPU/memory cost. Must be a power of 2. Default 2^17 = 131072. */
|
|
167
|
+
N: number;
|
|
168
|
+
/** Block size. Default 8. */
|
|
169
|
+
r: number;
|
|
170
|
+
/** Parallelization. Default 1. */
|
|
171
|
+
p: number;
|
|
172
|
+
/** Output key length in bytes. Default 32 (AES-256). */
|
|
173
|
+
keyLength: number;
|
|
174
|
+
/** maxmem ceiling for scrypt; defaults to 256 MiB. */
|
|
175
|
+
maxmem: number;
|
|
176
|
+
}
|
|
177
|
+
/** Parameters for the Argon2id KDF. */
|
|
178
|
+
interface Argon2idParams {
|
|
179
|
+
/** Memory cost in KiB. OWASP default 65536 (64 MiB). */
|
|
180
|
+
memoryKiB: number;
|
|
181
|
+
/** Time cost (iterations). OWASP default 3. */
|
|
182
|
+
iterations: number;
|
|
183
|
+
/** Parallelism. OWASP default 4. */
|
|
184
|
+
parallelism: number;
|
|
185
|
+
/** Output key length in bytes. Default 32 (AES-256). */
|
|
186
|
+
keyLength: number;
|
|
187
|
+
}
|
|
188
|
+
/** Strong scrypt defaults (OWASP-acceptable for 2024+). */
|
|
189
|
+
declare const DEFAULT_SCRYPT_PARAMS: Readonly<ScryptParams>;
|
|
190
|
+
/** OWASP Argon2id defaults. */
|
|
191
|
+
declare const DEFAULT_ARGON2ID_PARAMS: Readonly<Argon2idParams>;
|
|
192
|
+
/** Salt length in bytes. 128 bits is the modern minimum. */
|
|
193
|
+
declare const KDF_SALT_LENGTH = 16;
|
|
194
|
+
/** Required derived-key length for AES-256 (32 bytes). */
|
|
195
|
+
declare const KDF_KEY_LENGTH = 32;
|
|
196
|
+
/**
|
|
197
|
+
* Validate that scrypt parameters are within sane bounds and that
|
|
198
|
+
* `N` is a power of 2 (required by RFC 7914).
|
|
199
|
+
*/
|
|
200
|
+
declare function validateScryptParams(params: ScryptParams): void;
|
|
201
|
+
/**
|
|
202
|
+
* Derive a key from a passphrase + salt using scrypt.
|
|
203
|
+
*
|
|
204
|
+
* Pure: no I/O, no global state, deterministic for a given
|
|
205
|
+
* (passphrase, salt, params) tuple.
|
|
206
|
+
*
|
|
207
|
+
* @throws if params are invalid.
|
|
208
|
+
*/
|
|
209
|
+
declare function deriveKeyScrypt(passphrase: string, salt: Uint8Array, params?: ScryptParams): Buffer;
|
|
210
|
+
/**
|
|
211
|
+
* Algorithm-dispatching KDF. The algorithm name is recorded in the
|
|
212
|
+
* metadata file so existing stores continue using their original KDF.
|
|
213
|
+
*/
|
|
214
|
+
declare function deriveKey(algorithm: KdfAlgorithm, passphrase: string, salt: Uint8Array, params: ScryptParams | Argon2idParams): Buffer;
|
|
215
|
+
/**
|
|
216
|
+
* Constant-time equality for two derived keys / MACs. Re-exported so
|
|
217
|
+
* callers don't reach into `node:crypto` directly for this primitive.
|
|
218
|
+
*/
|
|
219
|
+
declare function constantTimeEqual(a: Uint8Array, b: Uint8Array): boolean;
|
|
220
|
+
|
|
221
|
+
/**
|
|
222
|
+
* Secure-store metadata file format.
|
|
223
|
+
*
|
|
224
|
+
* Issue #690 (PR 1/4) — pure data structure + serialize/parse helpers.
|
|
225
|
+
* No I/O. The eventual `secure-store init` CLI (PR 2/4) will be the
|
|
226
|
+
* surface that actually writes a metadata file to disk.
|
|
227
|
+
*
|
|
228
|
+
* Purpose
|
|
229
|
+
* -------
|
|
230
|
+
* When at-rest encryption is enabled, the memory directory needs a
|
|
231
|
+
* stable record of:
|
|
232
|
+
*
|
|
233
|
+
* - which KDF algorithm was used to derive the master key,
|
|
234
|
+
* - the algorithm parameters (so changing OWASP defaults later
|
|
235
|
+
* doesn't break existing stores),
|
|
236
|
+
* - the canonical salt for the master key,
|
|
237
|
+
* - the metadata format version (so we can evolve the file).
|
|
238
|
+
*
|
|
239
|
+
* Crucially, the metadata file does **not** contain the master key,
|
|
240
|
+
* the passphrase, or anything that would let an attacker decrypt
|
|
241
|
+
* memories. It contains only the public parameters needed to
|
|
242
|
+
* re-derive the same key from the same passphrase.
|
|
243
|
+
*
|
|
244
|
+
* On-disk shape
|
|
245
|
+
* -------------
|
|
246
|
+
* The file is JSON. All binary fields are encoded as lowercase hex
|
|
247
|
+
* strings (chosen over base64 for readability when the file is
|
|
248
|
+
* `cat`'d during incident response).
|
|
249
|
+
*
|
|
250
|
+
* {
|
|
251
|
+
* "format": "remnic.secure-store.metadata",
|
|
252
|
+
* "formatVersion": 1,
|
|
253
|
+
* "kdf": {
|
|
254
|
+
* "algorithm": "argon2id",
|
|
255
|
+
* "params": { "memoryKiB": 65536, "iterations": 3, "parallelism": 4, "keyLength": 32 },
|
|
256
|
+
* "salt": "<32-hex-chars-for-16-bytes>"
|
|
257
|
+
* },
|
|
258
|
+
* "createdAt": "<ISO-8601 timestamp>",
|
|
259
|
+
* "note": "<optional human-readable note>"
|
|
260
|
+
* }
|
|
261
|
+
*/
|
|
262
|
+
|
|
263
|
+
/** Stable identifier so we can sniff the file shape without parsing JSON. */
|
|
264
|
+
declare const METADATA_FORMAT: "remnic.secure-store.metadata";
|
|
265
|
+
/** Current metadata format version. Bump on breaking schema changes. */
|
|
266
|
+
declare const METADATA_FORMAT_VERSION: 1;
|
|
267
|
+
interface SecureStoreMetadataKdfScrypt {
|
|
268
|
+
algorithm: "scrypt";
|
|
269
|
+
params: ScryptParams;
|
|
270
|
+
/** Hex-encoded salt. Length must match `KDF_SALT_LENGTH` after decode. */
|
|
271
|
+
salt: string;
|
|
272
|
+
}
|
|
273
|
+
interface SecureStoreMetadataKdfArgon2id {
|
|
274
|
+
algorithm: "argon2id";
|
|
275
|
+
params: Argon2idParams;
|
|
276
|
+
salt: string;
|
|
277
|
+
}
|
|
278
|
+
type SecureStoreMetadataKdf = SecureStoreMetadataKdfScrypt | SecureStoreMetadataKdfArgon2id;
|
|
279
|
+
interface SecureStoreMetadata {
|
|
280
|
+
format: typeof METADATA_FORMAT;
|
|
281
|
+
formatVersion: number;
|
|
282
|
+
kdf: SecureStoreMetadataKdf;
|
|
283
|
+
/** ISO-8601 timestamp recorded at init time. */
|
|
284
|
+
createdAt: string;
|
|
285
|
+
/** Optional human-readable note. Never persist secrets here. */
|
|
286
|
+
note?: string;
|
|
287
|
+
}
|
|
288
|
+
interface BuildMetadataOptions {
|
|
289
|
+
algorithm: KdfAlgorithm;
|
|
290
|
+
salt: Uint8Array;
|
|
291
|
+
/** Optional override; defaults to `DEFAULT_SCRYPT_PARAMS` / `DEFAULT_ARGON2ID_PARAMS`. */
|
|
292
|
+
params?: ScryptParams | Argon2idParams;
|
|
293
|
+
/** Optional ISO timestamp. Defaults to `new Date().toISOString()`. */
|
|
294
|
+
createdAt?: string;
|
|
295
|
+
/** Optional human-readable note. */
|
|
296
|
+
note?: string;
|
|
297
|
+
}
|
|
298
|
+
/**
|
|
299
|
+
* Build an in-memory `SecureStoreMetadata` object from the given
|
|
300
|
+
* algorithm + salt. Pure: does not touch the filesystem or the clock
|
|
301
|
+
* unless `createdAt` is omitted (in which case `new Date()` is read).
|
|
302
|
+
*/
|
|
303
|
+
declare function buildMetadata(options: BuildMetadataOptions): SecureStoreMetadata;
|
|
304
|
+
/**
|
|
305
|
+
* Serialize metadata to a stable JSON string with sorted top-level
|
|
306
|
+
* keys. Stable ordering matters because hash-based integrity checks
|
|
307
|
+
* may eventually consume the serialized form.
|
|
308
|
+
*/
|
|
309
|
+
declare function serializeMetadata(meta: SecureStoreMetadata): string;
|
|
310
|
+
/**
|
|
311
|
+
* Parse a metadata JSON string. Throws on any structural problem.
|
|
312
|
+
* Callers that need to migrate older formats should branch on
|
|
313
|
+
* `formatVersion` *before* calling this; this function is strict
|
|
314
|
+
* about the current version.
|
|
315
|
+
*/
|
|
316
|
+
declare function parseMetadata(json: string): SecureStoreMetadata;
|
|
317
|
+
/** Validate a metadata object's invariants. Throws on the first problem. */
|
|
318
|
+
declare function validateMetadata(meta: SecureStoreMetadata): void;
|
|
319
|
+
/**
|
|
320
|
+
* Decode the salt field of a metadata object back into bytes.
|
|
321
|
+
* Convenience helper so callers don't reach into the hex codec.
|
|
322
|
+
*/
|
|
323
|
+
declare function decodeMetadataSalt(meta: SecureStoreMetadata): Buffer;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* On-disk header for an initialized secure-store (issue #690 PR 2/4).
|
|
327
|
+
*
|
|
328
|
+
* The header file is the persistent record that a memory directory
|
|
329
|
+
* has had `remnic secure-store init` run against it. It is a JSON
|
|
330
|
+
* file at `<memoryDir>/.secure-store/header.json` with two parts:
|
|
331
|
+
*
|
|
332
|
+
* 1. The KDF metadata from PR 1/4 (`SecureStoreMetadata`) —
|
|
333
|
+
* algorithm, params, and salt. Public; safe to read/copy.
|
|
334
|
+
* 2. A "verifier" — a tiny AES-GCM-encrypted envelope sealed under
|
|
335
|
+
* the derived key at init time. Unlock re-derives the key from
|
|
336
|
+
* the entered passphrase and tries to `open()` the verifier; if
|
|
337
|
+
* the auth tag validates, the passphrase is correct.
|
|
338
|
+
*
|
|
339
|
+
* Why a verifier?
|
|
340
|
+
* ---------------
|
|
341
|
+
* Without one, "wrong passphrase" can only be detected when the
|
|
342
|
+
* daemon tries to decrypt actual memory data — too late for a
|
|
343
|
+
* useful CLI error. The verifier gives the unlock command a fast,
|
|
344
|
+
* data-independent passphrase check.
|
|
345
|
+
*
|
|
346
|
+
* The verifier plaintext is a fixed magic string (no secret content).
|
|
347
|
+
* Its only role is to be sealable + openable; the auth-tag check is
|
|
348
|
+
* what proves the key.
|
|
349
|
+
*
|
|
350
|
+
* Naming
|
|
351
|
+
* ------
|
|
352
|
+
* Directory: `.secure-store/` (leading dot — hidden, hints at
|
|
353
|
+
* sensitivity). File: `header.json`. Avoids collision with
|
|
354
|
+
* `.secure-store-metadata.json` from PR 1/4 docs since the header
|
|
355
|
+
* is a strict superset.
|
|
356
|
+
*/
|
|
357
|
+
|
|
358
|
+
/** Subdirectory under `memoryDir` that holds the header + future state. */
|
|
359
|
+
declare const SECURE_STORE_DIR_NAME = ".secure-store";
|
|
360
|
+
/** Header filename. Stable name so operators can locate it. */
|
|
361
|
+
declare const HEADER_FILENAME = "header.json";
|
|
362
|
+
/** Stable identifier so the file shape is sniffable without parsing JSON. */
|
|
363
|
+
declare const HEADER_FORMAT: "remnic.secure-store.header";
|
|
364
|
+
/** Current header format version. Bump on breaking schema changes. */
|
|
365
|
+
declare const HEADER_FORMAT_VERSION: 1;
|
|
366
|
+
interface SecureStoreHeader {
|
|
367
|
+
format: typeof HEADER_FORMAT;
|
|
368
|
+
formatVersion: number;
|
|
369
|
+
/** KDF metadata (algorithm + params + salt). */
|
|
370
|
+
metadata: SecureStoreMetadata;
|
|
371
|
+
/** Hex-encoded sealed envelope. */
|
|
372
|
+
verifier: string;
|
|
373
|
+
/** ISO-8601 timestamp recorded at init time. */
|
|
374
|
+
createdAt: string;
|
|
375
|
+
}
|
|
376
|
+
/** Resolve the canonical secure-store directory for a memory root. */
|
|
377
|
+
declare function secureStoreDir(memoryDir: string): string;
|
|
378
|
+
/** Resolve the canonical header path for a memory root. */
|
|
379
|
+
declare function headerPath(memoryDir: string): string;
|
|
380
|
+
/**
|
|
381
|
+
* Build a `SecureStoreHeader` in memory from an already-derived key
|
|
382
|
+
* and metadata. Pure: does not touch the filesystem. The clock is
|
|
383
|
+
* read once if `createdAt` is omitted.
|
|
384
|
+
*/
|
|
385
|
+
declare function buildHeader(options: {
|
|
386
|
+
metadata: SecureStoreMetadata;
|
|
387
|
+
derivedKey: Buffer;
|
|
388
|
+
createdAt?: string;
|
|
389
|
+
}): SecureStoreHeader;
|
|
390
|
+
/** Stable JSON serialization with locked top-level key order. */
|
|
391
|
+
declare function serializeHeader(header: SecureStoreHeader): string;
|
|
392
|
+
/** Parse a header JSON string. Throws on any structural problem. */
|
|
393
|
+
declare function parseHeader(json: string): SecureStoreHeader;
|
|
394
|
+
/** Validate a header object's invariants. Throws on the first problem. */
|
|
395
|
+
declare function validateHeader(header: SecureStoreHeader): void;
|
|
396
|
+
/**
|
|
397
|
+
* Verify a candidate key against the header's verifier envelope.
|
|
398
|
+
*
|
|
399
|
+
* Returns true iff the AES-GCM auth tag validates. Wrong passphrase,
|
|
400
|
+
* tampered envelope, and tampered AAD all return false.
|
|
401
|
+
*/
|
|
402
|
+
declare function verifyKey(header: SecureStoreHeader, candidateKey: Buffer): boolean;
|
|
403
|
+
/**
|
|
404
|
+
* Derive a key from the passphrase using the algorithm + params +
|
|
405
|
+
* salt recorded in the header. Pure: no I/O.
|
|
406
|
+
*/
|
|
407
|
+
declare function deriveKeyFromHeader(header: SecureStoreHeader, passphrase: string): Buffer;
|
|
408
|
+
/**
|
|
409
|
+
* Read and parse the header at `<memoryDir>/.secure-store/header.json`.
|
|
410
|
+
* Returns `null` if the file does not exist; throws on malformed
|
|
411
|
+
* content.
|
|
412
|
+
*/
|
|
413
|
+
declare function readHeader(memoryDir: string): Promise<SecureStoreHeader | null>;
|
|
414
|
+
/**
|
|
415
|
+
* Write the header with atomic exclusive-create semantics.
|
|
416
|
+
*
|
|
417
|
+
* Uses the `wx` flag (`O_CREAT | O_EXCL`) so the OS rejects the call
|
|
418
|
+
* atomically when the file already exists. Two concurrent
|
|
419
|
+
* `secure-store init` invocations cannot both observe "missing" and
|
|
420
|
+
* race to overwrite each other — the second writer reliably gets
|
|
421
|
+
* `EEXIST` and surfaces "Refusing to overwrite".
|
|
422
|
+
*
|
|
423
|
+
* Codex P1 on PR #737: a previous version pre-checked existence with
|
|
424
|
+
* `readFile` then `writeFile`+`rename`, which is a check-then-act
|
|
425
|
+
* race. The `wx` flag closes that window at the kernel layer.
|
|
426
|
+
*
|
|
427
|
+
* Crash safety: if the write is interrupted mid-flight, a partial
|
|
428
|
+
* `header.json` may remain on disk. `parseHeader` rejects partial
|
|
429
|
+
* files cleanly and the operator can delete the stub and retry. We
|
|
430
|
+
* don't use temp+rename here because (a) headers are tiny (≤ 1 KiB),
|
|
431
|
+
* (b) there is no prior valid file to destroy, and (c) `wx` already
|
|
432
|
+
* gives us atomic exclusivity — the rename trick (CLAUDE.md gotcha
|
|
433
|
+
* #54) is for replacing an existing valid file, which is exactly the
|
|
434
|
+
* scenario this function refuses.
|
|
435
|
+
*/
|
|
436
|
+
declare function writeHeader(memoryDir: string, header: SecureStoreHeader): Promise<string>;
|
|
437
|
+
/** Convenience: build metadata + header in one call from a passphrase. */
|
|
438
|
+
declare function buildHeaderFromPassphrase(options: {
|
|
439
|
+
passphrase: string;
|
|
440
|
+
salt: Buffer;
|
|
441
|
+
/** Optional override; defaults to Argon2id with `DEFAULT_ARGON2ID_PARAMS`. */
|
|
442
|
+
algorithm?: "scrypt" | "argon2id";
|
|
443
|
+
params?: ScryptParams | Argon2idParams;
|
|
444
|
+
createdAt?: string;
|
|
445
|
+
note?: string;
|
|
446
|
+
}): {
|
|
447
|
+
header: SecureStoreHeader;
|
|
448
|
+
derivedKey: Buffer;
|
|
449
|
+
};
|
|
450
|
+
|
|
451
|
+
/**
|
|
452
|
+
* In-memory keyring for the secure-store module (issue #690 PR 2/4).
|
|
453
|
+
*
|
|
454
|
+
* Holds derived AES-256-GCM master keys for unlocked stores. The
|
|
455
|
+
* keyring is process-local: keys are NEVER persisted to disk, never
|
|
456
|
+
* logged, and never serialized. A daemon restart re-locks every
|
|
457
|
+
* registered store.
|
|
458
|
+
*
|
|
459
|
+
* Scoping
|
|
460
|
+
* -------
|
|
461
|
+
* Entries are keyed by a stable string id (typically the absolute
|
|
462
|
+
* path to the secure-store directory, after `~` expansion). This
|
|
463
|
+
* lets multiple memory roots share a single daemon process without
|
|
464
|
+
* one store's key bleeding into another (matches the per-`serviceId`
|
|
465
|
+
* scoping discipline called out in CLAUDE.md gotcha #11).
|
|
466
|
+
*
|
|
467
|
+
* Lifecycle
|
|
468
|
+
* ---------
|
|
469
|
+
* - `unlock(id, key)` — register a derived key.
|
|
470
|
+
* - `getKey(id)` — read a registered key (or `null`).
|
|
471
|
+
* - `lock(id)` — clear a single entry, zeroing the key bytes.
|
|
472
|
+
* - `lockAll()` — clear every entry, zeroing every key.
|
|
473
|
+
* - `status(id)` — non-secret status snapshot for `secure-store
|
|
474
|
+
* status`.
|
|
475
|
+
*
|
|
476
|
+
* Zeroization
|
|
477
|
+
* -----------
|
|
478
|
+
* `lock` and `lockAll` overwrite the key buffer with zeros before
|
|
479
|
+
* dropping the reference. The JS engine may keep additional copies
|
|
480
|
+
* outside our control; this is best-effort hygiene, not a defense
|
|
481
|
+
* against memory-dump attacks.
|
|
482
|
+
*/
|
|
483
|
+
/** Status snapshot — no secret material. */
|
|
484
|
+
interface KeyringStatus {
|
|
485
|
+
/** True iff a key is currently registered for this id. */
|
|
486
|
+
unlocked: boolean;
|
|
487
|
+
/** ISO-8601 timestamp the key was registered, or null when locked. */
|
|
488
|
+
unlockedAt: string | null;
|
|
489
|
+
}
|
|
490
|
+
/**
|
|
491
|
+
* Register a derived key for the given id. If an entry already
|
|
492
|
+
* exists, its old key is zeroed before being replaced.
|
|
493
|
+
*
|
|
494
|
+
* The caller MUST pass an exclusive 32-byte buffer; the keyring
|
|
495
|
+
* takes ownership and will zero it on lock.
|
|
496
|
+
*/
|
|
497
|
+
declare function unlock(id: string, key: Buffer, now?: () => Date): void;
|
|
498
|
+
/** Read the registered key for `id`, or `null` if locked. */
|
|
499
|
+
declare function getKey(id: string): Buffer | null;
|
|
500
|
+
/** Clear a single entry. Zeros the underlying buffer. Returns true if cleared. */
|
|
501
|
+
declare function lock(id: string): boolean;
|
|
502
|
+
/** Clear every registered key. Used on shutdown or for tests. */
|
|
503
|
+
declare function lockAll(): void;
|
|
504
|
+
/** Non-secret status snapshot. */
|
|
505
|
+
declare function status(id: string): KeyringStatus;
|
|
506
|
+
/** Test-only helper: how many entries are currently registered. */
|
|
507
|
+
declare function size(): number;
|
|
508
|
+
|
|
509
|
+
type keyring_KeyringStatus = KeyringStatus;
|
|
510
|
+
declare const keyring_getKey: typeof getKey;
|
|
511
|
+
declare const keyring_lock: typeof lock;
|
|
512
|
+
declare const keyring_lockAll: typeof lockAll;
|
|
513
|
+
declare const keyring_size: typeof size;
|
|
514
|
+
declare const keyring_status: typeof status;
|
|
515
|
+
declare const keyring_unlock: typeof unlock;
|
|
516
|
+
declare namespace keyring {
|
|
517
|
+
export { type keyring_KeyringStatus as KeyringStatus, keyring_getKey as getKey, keyring_lock as lock, keyring_lockAll as lockAll, keyring_size as size, keyring_status as status, keyring_unlock as unlock };
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Transparent file-level encryption for the secure-store module.
|
|
522
|
+
*
|
|
523
|
+
* Issue #690 (PR 3/4) — storage.ts integration layer.
|
|
524
|
+
*
|
|
525
|
+
* This module sits between the raw filesystem and StorageManager.
|
|
526
|
+
* Every memory file is either:
|
|
527
|
+
* - a plain UTF-8 text file (legacy, back-compat), or
|
|
528
|
+
* - a REMNIC-ENC sealed file (AES-256-GCM, see format below).
|
|
529
|
+
*
|
|
530
|
+
* On-disk format
|
|
531
|
+
* --------------
|
|
532
|
+
* Encrypted files begin with a 9-byte magic header:
|
|
533
|
+
*
|
|
534
|
+
* REMNIC-ENC (7 ASCII bytes)
|
|
535
|
+
* VER (1 byte, currently 0x01)
|
|
536
|
+
* FLAGS (1 byte, reserved, must be 0x00)
|
|
537
|
+
*
|
|
538
|
+
* Followed immediately by a `seal()` envelope from `cipher.ts`:
|
|
539
|
+
*
|
|
540
|
+
* [VERSION:1][SALT:16][IV:12][AUTHTAG:16][CIPHERTEXT:...]
|
|
541
|
+
*
|
|
542
|
+
* The magic header makes encrypted files sniffable without attempting
|
|
543
|
+
* a full `open()` call and gives operators a clear signal that the
|
|
544
|
+
* file cannot be read by opening it in an editor.
|
|
545
|
+
*
|
|
546
|
+
* AAD
|
|
547
|
+
* ---
|
|
548
|
+
* The file path relative to the memory root is bound as Associated
|
|
549
|
+
* Authenticated Data (AAD) on both encrypt and decrypt. This means
|
|
550
|
+
* moving or renaming an encrypted file without re-encrypting it will
|
|
551
|
+
* cause auth-tag failure on the next read — the file is tied to its
|
|
552
|
+
* path. Callers that move files must re-encrypt them.
|
|
553
|
+
*
|
|
554
|
+
* Back-compat
|
|
555
|
+
* -----------
|
|
556
|
+
* `readMaybeEncryptedFile` transparently handles both formats: if the
|
|
557
|
+
* file does NOT start with the magic bytes, it is returned as-is (plain
|
|
558
|
+
* text). This lets an operator migrate incrementally: newly-written
|
|
559
|
+
* files are encrypted while existing files continue to be read in plain
|
|
560
|
+
* form until `migrateMemoryDirToEncrypted` is run.
|
|
561
|
+
*
|
|
562
|
+
* Naming: `secure-fs.ts` (not `vault-fs.ts`) — see `kdf.ts` naming note.
|
|
563
|
+
*/
|
|
564
|
+
/**
|
|
565
|
+
* Thrown when a read is attempted but the keyring entry for this
|
|
566
|
+
* store is absent (i.e. `secure-store unlock` has not been run
|
|
567
|
+
* since the last daemon start).
|
|
568
|
+
*/
|
|
569
|
+
declare class SecureStoreLockedError extends Error {
|
|
570
|
+
constructor(message?: string);
|
|
571
|
+
}
|
|
572
|
+
/**
|
|
573
|
+
* Thrown when `open()` fails because the auth tag does not validate.
|
|
574
|
+
* This covers both wrong-key and tampered-ciphertext scenarios —
|
|
575
|
+
* intentionally indistinguishable from the caller's perspective.
|
|
576
|
+
*/
|
|
577
|
+
declare class SecureStoreDecryptError extends Error {
|
|
578
|
+
constructor(message?: string);
|
|
579
|
+
}
|
|
580
|
+
/** Magic bytes: the ASCII string "REMNIC-ENC" (10 bytes). */
|
|
581
|
+
declare const MAGIC_BYTES: Buffer<ArrayBuffer>;
|
|
582
|
+
/** Current on-disk version byte. */
|
|
583
|
+
declare const FILE_FORMAT_VERSION = 1;
|
|
584
|
+
/** Reserved flags byte — must be 0x00. */
|
|
585
|
+
declare const FILE_FORMAT_FLAGS = 0;
|
|
586
|
+
/** Total size of the magic header prefix (magic + version + flags). */
|
|
587
|
+
declare const MAGIC_HEADER_SIZE: number;
|
|
588
|
+
/**
|
|
589
|
+
* Return true iff `buf` begins with the REMNIC-ENC magic header.
|
|
590
|
+
* Does not validate the envelope; just identifies the format.
|
|
591
|
+
*/
|
|
592
|
+
declare function isEncryptedFile(buf: Uint8Array): boolean;
|
|
593
|
+
/**
|
|
594
|
+
* Encrypt `plain` (UTF-8 content of a memory file) and return a
|
|
595
|
+
* Buffer ready to write to disk.
|
|
596
|
+
*
|
|
597
|
+
* @param plain Plain-text file content (UTF-8 string or Buffer).
|
|
598
|
+
* @param key 32-byte AES-256 key from the keyring.
|
|
599
|
+
* @param aad Optional associated data — defaults to empty if omitted.
|
|
600
|
+
* Callers should pass the file path relative to memoryDir
|
|
601
|
+
* so the ciphertext is bound to its location.
|
|
602
|
+
*/
|
|
603
|
+
declare function encryptFileBody(plain: string | Buffer, key: Buffer, aad?: Buffer): Buffer;
|
|
604
|
+
/**
|
|
605
|
+
* Decrypt a buffer produced by `encryptFileBody` and return the
|
|
606
|
+
* original UTF-8 content.
|
|
607
|
+
*
|
|
608
|
+
* Throws `SecureStoreDecryptError` on auth failure (wrong key or
|
|
609
|
+
* tampered ciphertext). Throws a plain `Error` for structural problems
|
|
610
|
+
* (truncated buffer, wrong magic, unsupported version).
|
|
611
|
+
*/
|
|
612
|
+
declare function decryptFileBody(buf: Buffer, key: Buffer, aad?: Buffer): Buffer;
|
|
613
|
+
/**
|
|
614
|
+
* Build the AAD buffer for a file at `filePath` relative to
|
|
615
|
+
* `memoryDir`. The AAD binds the ciphertext to its path so a
|
|
616
|
+
* file cannot be silently relocated without re-encryption.
|
|
617
|
+
*
|
|
618
|
+
* When `memoryDir` is supplied and `filePath` is absolute, the
|
|
619
|
+
* relative sub-path is used. Otherwise `filePath` is used verbatim.
|
|
620
|
+
*/
|
|
621
|
+
declare function filePathAad(filePath: string, memoryDir?: string): Buffer;
|
|
622
|
+
/**
|
|
623
|
+
* Read a file from `filePath`.
|
|
624
|
+
*
|
|
625
|
+
* - If the file is plaintext (no magic header), return its content
|
|
626
|
+
* as-is — back-compat with unencrypted stores.
|
|
627
|
+
* - If the file is encrypted AND `key` is provided, decrypt and return
|
|
628
|
+
* the plaintext content.
|
|
629
|
+
* - If the file is encrypted AND `key` is null, throw
|
|
630
|
+
* `SecureStoreLockedError`.
|
|
631
|
+
*
|
|
632
|
+
* @param filePath Absolute path to the file.
|
|
633
|
+
* @param key 32-byte AES-256 key, or null when the store is locked.
|
|
634
|
+
* @param memoryDir Memory root for path-bound AAD. Should be absolute.
|
|
635
|
+
*/
|
|
636
|
+
declare function readMaybeEncryptedFile(filePath: string, key: Buffer | null, memoryDir?: string): Promise<string>;
|
|
637
|
+
interface WriteMaybeEncryptedFileOptions {
|
|
638
|
+
/**
|
|
639
|
+
* File mode bits. Default 0o600 (owner read/write only).
|
|
640
|
+
* Applied only on create; existing files inherit their existing mode.
|
|
641
|
+
*/
|
|
642
|
+
mode?: number;
|
|
643
|
+
/**
|
|
644
|
+
* If true, write atomically via a temp file + rename (CLAUDE.md gotcha #54).
|
|
645
|
+
* Default true.
|
|
646
|
+
*/
|
|
647
|
+
atomic?: boolean;
|
|
648
|
+
}
|
|
649
|
+
/**
|
|
650
|
+
* Write `content` to `filePath`.
|
|
651
|
+
*
|
|
652
|
+
* - If `key` is provided and non-null, encrypt the content first.
|
|
653
|
+
* - If `key` is null, write the content as plain UTF-8 (unencrypted store).
|
|
654
|
+
*
|
|
655
|
+
* Writes atomically: content is written to a `.tmp-<pid>-<ts>` file
|
|
656
|
+
* first, then renamed into place (CLAUDE.md gotcha #54 — never delete
|
|
657
|
+
* before write).
|
|
658
|
+
*/
|
|
659
|
+
declare function writeMaybeEncryptedFile(filePath: string, content: string, key: Buffer | null, options?: WriteMaybeEncryptedFileOptions, memoryDir?: string): Promise<void>;
|
|
660
|
+
interface MigrateResult {
|
|
661
|
+
/** Number of files successfully encrypted. */
|
|
662
|
+
encrypted: number;
|
|
663
|
+
/** Number of files already encrypted (skipped). */
|
|
664
|
+
skipped: number;
|
|
665
|
+
/** Files that failed to encrypt (path → error message). */
|
|
666
|
+
errors: Array<{
|
|
667
|
+
filePath: string;
|
|
668
|
+
error: string;
|
|
669
|
+
}>;
|
|
670
|
+
}
|
|
671
|
+
interface DecryptResult {
|
|
672
|
+
/** Number of files successfully decrypted back to plaintext. */
|
|
673
|
+
decrypted: number;
|
|
674
|
+
/** Number of files already plaintext (skipped). */
|
|
675
|
+
skipped: number;
|
|
676
|
+
/** Files that failed to decrypt (path → error message). */
|
|
677
|
+
errors: Array<{
|
|
678
|
+
filePath: string;
|
|
679
|
+
error: string;
|
|
680
|
+
}>;
|
|
681
|
+
}
|
|
682
|
+
/**
|
|
683
|
+
* Walk `dir` recursively, find encryptable storage-managed files that are not
|
|
684
|
+
* yet encrypted, and re-write them as encrypted files under `key`.
|
|
685
|
+
*
|
|
686
|
+
* Safety rules per CLAUDE.md gotchas #54 and #25:
|
|
687
|
+
* 1. A page-version snapshot is taken (via `createVersion`) BEFORE
|
|
688
|
+
* each overwrite so the plaintext version is preserved in history.
|
|
689
|
+
* Since this module has no direct access to `page-versioning.ts`
|
|
690
|
+
* internals, callers who have page-versioning configured should
|
|
691
|
+
* pass `onBeforeEncrypt` to take the snapshot.
|
|
692
|
+
* 2. The new encrypted content is written to a temp file first,
|
|
693
|
+
* then renamed atomically — never deleted before written.
|
|
694
|
+
* 3. If encryption of any file fails, the error is recorded and the
|
|
695
|
+
* original file is left intact (partial migration is safe).
|
|
696
|
+
*
|
|
697
|
+
* @param dir Absolute path to the memory directory.
|
|
698
|
+
* @param key 32-byte AES-256 key.
|
|
699
|
+
* @param onBeforeEncrypt Optional callback invoked before encrypting
|
|
700
|
+
* each file. Can be used to take page-version
|
|
701
|
+
* snapshots. Errors here are non-fatal.
|
|
702
|
+
*/
|
|
703
|
+
declare function migrateMemoryDirToEncrypted(dir: string, key: Buffer, onBeforeEncrypt?: (filePath: string) => Promise<void>): Promise<MigrateResult>;
|
|
704
|
+
/**
|
|
705
|
+
* Walk `dir` recursively, find storage-managed encrypted files, and
|
|
706
|
+
* re-write them as plaintext under the same paths.
|
|
707
|
+
*
|
|
708
|
+
* This is the reversible counterpart to {@link migrateMemoryDirToEncrypted}.
|
|
709
|
+
* It only touches files under the same storage-managed roots, skips
|
|
710
|
+
* plaintext files, skips symlinks, excludes `.secure-store/`, and writes
|
|
711
|
+
* each plaintext replacement via temp-file + rename so a per-file failure
|
|
712
|
+
* leaves the ciphertext intact.
|
|
713
|
+
*/
|
|
714
|
+
declare function decryptMemoryDirToPlaintext(dir: string, key: Buffer): Promise<DecryptResult>;
|
|
715
|
+
|
|
716
|
+
/**
|
|
717
|
+
* Pure handlers behind the `remnic secure-store {init,unlock,lock,
|
|
718
|
+
* status,migrate,disable}` CLI surface (issue #690 PR 2/4 + #779/#780).
|
|
719
|
+
*
|
|
720
|
+
* Each handler:
|
|
721
|
+
* - takes an explicit `memoryDir` (already `~`-expanded by the CLI),
|
|
722
|
+
* - takes an injectable passphrase reader (so tests don't need a
|
|
723
|
+
* real TTY and never touch real readline state),
|
|
724
|
+
* - returns a structured report (no `console.log` inside),
|
|
725
|
+
* - never logs the passphrase or any secret material.
|
|
726
|
+
*
|
|
727
|
+
* The actual `console.log` formatting lives in `cli-renderer.ts` so
|
|
728
|
+
* tests can assert on the report shape without parsing text.
|
|
729
|
+
*/
|
|
730
|
+
|
|
731
|
+
/** Passphrase source — async so callers can read from a TTY without echo. */
|
|
732
|
+
type PassphraseReader = (prompt: string, options?: {
|
|
733
|
+
confirm?: boolean;
|
|
734
|
+
}) => Promise<string>;
|
|
735
|
+
/** Common options accepted by every handler. */
|
|
736
|
+
interface SecureStoreHandlerCommon {
|
|
737
|
+
memoryDir: string;
|
|
738
|
+
/**
|
|
739
|
+
* Stable identifier for the in-memory keyring entry. Defaults to
|
|
740
|
+
* the secure-store directory under `memoryDir`. Tests override
|
|
741
|
+
* this to keep entries from leaking across cases.
|
|
742
|
+
*/
|
|
743
|
+
keyringId?: string;
|
|
744
|
+
/** Optional clock injection for deterministic tests. */
|
|
745
|
+
now?: () => Date;
|
|
746
|
+
}
|
|
747
|
+
interface SecureStoreInitOptions extends SecureStoreHandlerCommon {
|
|
748
|
+
/** Passphrase reader — called twice (entry + confirmation). */
|
|
749
|
+
readPassphrase: PassphraseReader;
|
|
750
|
+
/**
|
|
751
|
+
* KDF algorithm. Defaults to `"argon2id"` for new stores.
|
|
752
|
+
* `"scrypt"` remains supported for explicit compatibility cases.
|
|
753
|
+
*/
|
|
754
|
+
algorithm?: KdfAlgorithm;
|
|
755
|
+
/** KDF parameter override; defaults to OWASP-acceptable params for the selected KDF. */
|
|
756
|
+
params?: ScryptParams | Argon2idParams;
|
|
757
|
+
/** Pre-generated salt for tests; production callers should omit. */
|
|
758
|
+
salt?: Buffer;
|
|
759
|
+
/** Optional human-readable note recorded in metadata. Never persist secrets. */
|
|
760
|
+
note?: string;
|
|
761
|
+
}
|
|
762
|
+
interface SecureStoreInitReport {
|
|
763
|
+
ok: true;
|
|
764
|
+
/** Absolute path of the header file that was written. */
|
|
765
|
+
headerPath: string;
|
|
766
|
+
/** Algorithm + params used for the master key derivation. */
|
|
767
|
+
kdf: SecureStoreHeader["metadata"]["kdf"];
|
|
768
|
+
/** ISO-8601 timestamp recorded in the header. */
|
|
769
|
+
createdAt: string;
|
|
770
|
+
}
|
|
771
|
+
/**
|
|
772
|
+
* Initialize a new secure-store header. Refuses to overwrite an
|
|
773
|
+
* existing header (use `header.ts:writeHeader` directly with explicit
|
|
774
|
+
* intent if you need to reinitialize a destroyed store).
|
|
775
|
+
*/
|
|
776
|
+
declare function runSecureStoreInit(options: SecureStoreInitOptions): Promise<SecureStoreInitReport>;
|
|
777
|
+
interface SecureStoreUnlockOptions extends SecureStoreHandlerCommon {
|
|
778
|
+
readPassphrase: PassphraseReader;
|
|
779
|
+
}
|
|
780
|
+
type SecureStoreUnlockReport = {
|
|
781
|
+
ok: true;
|
|
782
|
+
unlockedAt: string;
|
|
783
|
+
algorithm: KdfAlgorithm;
|
|
784
|
+
} | {
|
|
785
|
+
ok: false;
|
|
786
|
+
reason: "not-initialized" | "wrong-passphrase";
|
|
787
|
+
};
|
|
788
|
+
declare function runSecureStoreUnlock(options: SecureStoreUnlockOptions): Promise<SecureStoreUnlockReport>;
|
|
789
|
+
interface SecureStoreLockOptions extends SecureStoreHandlerCommon {
|
|
790
|
+
}
|
|
791
|
+
interface SecureStoreLockReport {
|
|
792
|
+
ok: true;
|
|
793
|
+
/** True if a key was registered and is now cleared; false if it was already locked. */
|
|
794
|
+
cleared: boolean;
|
|
795
|
+
}
|
|
796
|
+
declare function runSecureStoreLock(options: SecureStoreLockOptions): SecureStoreLockReport;
|
|
797
|
+
interface SecureStoreMigrateOptions extends SecureStoreHandlerCommon {
|
|
798
|
+
}
|
|
799
|
+
type SecureStoreMigrateReport = ({
|
|
800
|
+
ok: true;
|
|
801
|
+
} & MigrateResult) | ({
|
|
802
|
+
ok: false;
|
|
803
|
+
reason: "not-initialized" | "locked" | "file-errors";
|
|
804
|
+
} & MigrateResult);
|
|
805
|
+
declare function runSecureStoreMigrate(options: SecureStoreMigrateOptions): Promise<SecureStoreMigrateReport>;
|
|
806
|
+
interface SecureStoreDisableOptions extends SecureStoreHandlerCommon {
|
|
807
|
+
}
|
|
808
|
+
type SecureStoreDisableReport = ({
|
|
809
|
+
ok: true;
|
|
810
|
+
} & DecryptResult) | ({
|
|
811
|
+
ok: false;
|
|
812
|
+
reason: "not-initialized" | "locked" | "file-errors";
|
|
813
|
+
} & DecryptResult);
|
|
814
|
+
declare function runSecureStoreDisable(options: SecureStoreDisableOptions): Promise<SecureStoreDisableReport>;
|
|
815
|
+
interface SecureStoreStatusOptions extends SecureStoreHandlerCommon {
|
|
816
|
+
}
|
|
817
|
+
interface SecureStoreStatusReport {
|
|
818
|
+
/** True iff a header file exists in `<memoryDir>/.secure-store/`. */
|
|
819
|
+
initialized: boolean;
|
|
820
|
+
/** Path the status check probed. Useful for operators. */
|
|
821
|
+
headerPath: string;
|
|
822
|
+
/** Locked/unlocked state of the in-memory keyring entry. */
|
|
823
|
+
locked: boolean;
|
|
824
|
+
/** ISO-8601 timestamp of the most recent unlock, or null when locked. */
|
|
825
|
+
unlockedAt: string | null;
|
|
826
|
+
/** Header metadata (algorithm + params + salt hex), or null when uninitialized. */
|
|
827
|
+
kdf: SecureStoreHeader["metadata"]["kdf"] | null;
|
|
828
|
+
/** Header `createdAt`, or null when uninitialized. */
|
|
829
|
+
createdAt: string | null;
|
|
830
|
+
}
|
|
831
|
+
declare function runSecureStoreStatus(options: SecureStoreStatusOptions): Promise<SecureStoreStatusReport>;
|
|
832
|
+
/** Minimum passphrase length. 8 chars is intentionally permissive — operators may use phrase managers. */
|
|
833
|
+
declare const MIN_PASSPHRASE_LENGTH = 8;
|
|
834
|
+
|
|
835
|
+
/**
|
|
836
|
+
* Console-text renderers for the `remnic engram secure-store {init,unlock,
|
|
837
|
+
* lock,status,migrate,disable}` CLI surface (issue #690 PR 2/4 + #779/#780).
|
|
838
|
+
*
|
|
839
|
+
* Pure: each `render*` function takes a typed report and returns a
|
|
840
|
+
* string. CLI handlers do the `console.log`. Tests assert on the
|
|
841
|
+
* returned text directly so behavior stays decoupled from stdout.
|
|
842
|
+
*/
|
|
843
|
+
|
|
844
|
+
declare function renderInitReport(report: SecureStoreInitReport): string;
|
|
845
|
+
declare function renderUnlockReport(report: SecureStoreUnlockReport): string;
|
|
846
|
+
declare function renderLockReport(report: SecureStoreLockReport): string;
|
|
847
|
+
declare function renderMigrateReport(report: SecureStoreMigrateReport): string;
|
|
848
|
+
declare function renderDisableReport(report: SecureStoreDisableReport): string;
|
|
849
|
+
declare function renderStatusReport(report: SecureStoreStatusReport): string;
|
|
850
|
+
|
|
851
|
+
/**
|
|
852
|
+
* TTY passphrase reader (issue #690 PR 2/4).
|
|
853
|
+
*
|
|
854
|
+
* Reads a line from stdin without echoing it back to the terminal.
|
|
855
|
+
* Disables echo by setting raw mode + manually buffering input until
|
|
856
|
+
* Enter / EOT.
|
|
857
|
+
*
|
|
858
|
+
* Why not `readline.question`?
|
|
859
|
+
* ----------------------------
|
|
860
|
+
* `readline` echoes by default and has no clean "no-echo" toggle that
|
|
861
|
+
* survives across Node versions. The raw-mode loop is the canonical
|
|
862
|
+
* idiom for reading passwords on Node and matches what `npm` uses
|
|
863
|
+
* internally.
|
|
864
|
+
*
|
|
865
|
+
* Security
|
|
866
|
+
* --------
|
|
867
|
+
* - Never log the passphrase (no `console.log`, no debug output).
|
|
868
|
+
* - Never include it in a thrown error message.
|
|
869
|
+
* - On Ctrl+C / Ctrl+D, abort with a clear error rather than
|
|
870
|
+
* silently treating EOF as an empty submission.
|
|
871
|
+
* - On non-TTY stdin (pipe, redirect), read a line via line-buffered
|
|
872
|
+
* readline so automation (`echo "passphrase" | remnic ...`) works.
|
|
873
|
+
* Operators are responsible for not piping plaintext passphrases
|
|
874
|
+
* in shell history; we surface a stderr warning.
|
|
875
|
+
*/
|
|
876
|
+
|
|
877
|
+
interface CreatePassphraseReaderOptions {
|
|
878
|
+
input?: Readable;
|
|
879
|
+
output?: Writable;
|
|
880
|
+
/** Override stderr for warning surface; defaults to `process.stderr`. */
|
|
881
|
+
errorStream?: Writable;
|
|
882
|
+
}
|
|
883
|
+
/**
|
|
884
|
+
* Build a `PassphraseReader` bound to the given streams. Exported so
|
|
885
|
+
* tests can construct one against in-memory streams without touching
|
|
886
|
+
* the real TTY.
|
|
887
|
+
*/
|
|
888
|
+
declare function createPassphraseReader(options?: CreatePassphraseReaderOptions): PassphraseReader;
|
|
889
|
+
|
|
890
|
+
export { AES_KEY_LENGTH, AUTH_TAG_LENGTH, type Argon2idParams, type BuildMetadataOptions, DEFAULT_ARGON2ID_PARAMS, DEFAULT_SCRYPT_PARAMS, type DecryptOptions, type DecryptResult, ENVELOPE_HEADER_SIZE, ENVELOPE_LAYOUT, ENVELOPE_SALT_LENGTH, ENVELOPE_VERSION, type EncryptOptions, FILE_FORMAT_FLAGS, FILE_FORMAT_VERSION, HEADER_FILENAME, HEADER_FORMAT, HEADER_FORMAT_VERSION, IV_LENGTH, KDF_KEY_LENGTH, KDF_SALT_LENGTH, type KdfAlgorithm, MAGIC_BYTES, MAGIC_HEADER_SIZE, METADATA_FORMAT, METADATA_FORMAT_VERSION, MIN_PASSPHRASE_LENGTH, type MigrateResult, type ParsedEnvelope, type PassphraseReader, SECURE_STORE_DIR_NAME, type ScryptParams, SecureStoreDecryptError, type SecureStoreDisableOptions, type SecureStoreDisableReport, type SecureStoreHeader, type SecureStoreInitOptions, type SecureStoreInitReport, type SecureStoreLockOptions, type SecureStoreLockReport, SecureStoreLockedError, type SecureStoreMetadata, type SecureStoreMetadataKdf, type SecureStoreMetadataKdfArgon2id, type SecureStoreMetadataKdfScrypt, type SecureStoreMigrateOptions, type SecureStoreMigrateReport, type SecureStoreStatusOptions, type SecureStoreStatusReport, type SecureStoreUnlockOptions, type SecureStoreUnlockReport, type WriteMaybeEncryptedFileOptions, buildHeader, buildHeaderFromPassphrase, buildMetadata, constantTimeEqual, createPassphraseReader, decodeMetadataSalt, decryptFileBody, decryptMemoryDirToPlaintext, deriveKey, deriveKeyFromHeader, deriveKeyScrypt, encryptFileBody, filePathAad, generateSalt, headerPath, isEncryptedFile, keyring, migrateMemoryDirToEncrypted, open, parseEnvelope, parseHeader, parseMetadata, readHeader, readMaybeEncryptedFile, renderDisableReport, renderInitReport, renderLockReport, renderMigrateReport, renderStatusReport, renderUnlockReport, runSecureStoreDisable, runSecureStoreInit, runSecureStoreLock, runSecureStoreMigrate, runSecureStoreStatus, runSecureStoreUnlock, seal, secureStoreDir, serializeHeader, serializeMetadata, validateHeader, validateMetadata, validateScryptParams, verifyKey, writeHeader, writeMaybeEncryptedFile };
|