@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
package/dist/index.js
CHANGED
|
@@ -13,8 +13,49 @@ import {
|
|
|
13
13
|
writePeerProfile
|
|
14
14
|
} from "./chunk-4DWOBS2A.js";
|
|
15
15
|
import {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
EnrichmentProviderRegistry,
|
|
17
|
+
WebSearchProvider,
|
|
18
|
+
appendAuditEntry,
|
|
19
|
+
defaultEnrichmentPipelineConfig,
|
|
20
|
+
readAuditLog,
|
|
21
|
+
runEnrichmentPipeline
|
|
22
|
+
} from "./chunk-N2D6GXBM.js";
|
|
23
|
+
import {
|
|
24
|
+
MARKETPLACE_MANIFEST_FILENAME,
|
|
25
|
+
MARKETPLACE_SCHEMA_VERSION,
|
|
26
|
+
checkMarketplaceManifest,
|
|
27
|
+
doctorConnector,
|
|
28
|
+
generateMarketplaceManifest,
|
|
29
|
+
getConnectorToken,
|
|
30
|
+
installConnector,
|
|
31
|
+
installFromMarketplace,
|
|
32
|
+
listConnectors,
|
|
33
|
+
loadRegistry,
|
|
34
|
+
removeConnector,
|
|
35
|
+
saveRegistry,
|
|
36
|
+
validateMarketplaceManifest,
|
|
37
|
+
writeMarketplaceManifest
|
|
38
|
+
} from "./chunk-326G7DJK.js";
|
|
39
|
+
import "./chunk-V5OCT34X.js";
|
|
40
|
+
import {
|
|
41
|
+
executeResolution,
|
|
42
|
+
isValidResolutionVerb
|
|
43
|
+
} from "./chunk-47VWKCAF.js";
|
|
44
|
+
import {
|
|
45
|
+
ACTIVE_STATUSES,
|
|
46
|
+
judgeContradictionPairs,
|
|
47
|
+
runContradictionScan
|
|
48
|
+
} from "./chunk-DK5LDEQM.js";
|
|
49
|
+
import {
|
|
50
|
+
computePairId,
|
|
51
|
+
isCoolingDown,
|
|
52
|
+
listPairs,
|
|
53
|
+
readPair,
|
|
54
|
+
resolvePair,
|
|
55
|
+
writePair,
|
|
56
|
+
writePairs
|
|
57
|
+
} from "./chunk-APO3DCMU.js";
|
|
58
|
+
import {
|
|
18
59
|
generateToken,
|
|
19
60
|
getAllValidTokens,
|
|
20
61
|
getAllValidTokensCached,
|
|
@@ -23,7 +64,7 @@ import {
|
|
|
23
64
|
resolveConnectorFromToken,
|
|
24
65
|
revokeToken,
|
|
25
66
|
saveTokenStore
|
|
26
|
-
} from "./chunk-
|
|
67
|
+
} from "./chunk-MSWG7JI6.js";
|
|
27
68
|
import {
|
|
28
69
|
runGraphRecall
|
|
29
70
|
} from "./chunk-DGVM5SFL.js";
|
|
@@ -53,22 +94,48 @@ import {
|
|
|
53
94
|
runBulkImportCliCommand,
|
|
54
95
|
runBulkImportPipeline,
|
|
55
96
|
validateImportTurn
|
|
56
|
-
} from "./chunk-
|
|
57
|
-
import "./chunk-
|
|
58
|
-
import "./chunk-
|
|
97
|
+
} from "./chunk-CHEL3SKB.js";
|
|
98
|
+
import "./chunk-ICRIXAP2.js";
|
|
99
|
+
import "./chunk-EHRTFRWW.js";
|
|
100
|
+
import "./chunk-S7KDBTWT.js";
|
|
101
|
+
import "./chunk-TZOLIGIG.js";
|
|
102
|
+
import "./chunk-TK4UEOSK.js";
|
|
103
|
+
import "./chunk-TFO23QT4.js";
|
|
104
|
+
import "./chunk-7OZ53EXP.js";
|
|
105
|
+
import "./chunk-GIF42EW3.js";
|
|
106
|
+
import "./chunk-66DHUKLO.js";
|
|
107
|
+
import "./chunk-Z734BLO3.js";
|
|
108
|
+
import "./chunk-DOM4GKSW.js";
|
|
109
|
+
import "./chunk-W4L6CZKA.js";
|
|
110
|
+
import "./chunk-3JXBXXM2.js";
|
|
111
|
+
import "./chunk-6H2TESSP.js";
|
|
112
|
+
import "./chunk-TKWGAOLV.js";
|
|
113
|
+
import "./chunk-FIT6DMX6.js";
|
|
114
|
+
import "./chunk-TPMQ3G6Z.js";
|
|
115
|
+
import "./chunk-JLFA7DQG.js";
|
|
116
|
+
import "./chunk-KLAO5DGL.js";
|
|
117
|
+
import "./chunk-PZIAX57I.js";
|
|
118
|
+
import "./chunk-65PG43EQ.js";
|
|
119
|
+
import "./chunk-KJTKLXTH.js";
|
|
120
|
+
import "./chunk-PK7H5L6Y.js";
|
|
121
|
+
import "./chunk-LT3NLYSI.js";
|
|
122
|
+
import "./chunk-TMM4S4IJ.js";
|
|
123
|
+
import "./chunk-XVZ7B3HG.js";
|
|
59
124
|
import {
|
|
60
125
|
clearAuthTokenSecretCache,
|
|
61
126
|
isAgentAccessSecretRef,
|
|
62
127
|
resolveAgentAccessAuthToken
|
|
63
128
|
} from "./chunk-MXC3AP5I.js";
|
|
129
|
+
import "./chunk-4CRG46BG.js";
|
|
64
130
|
import {
|
|
65
131
|
parseXrayBudgetFlag,
|
|
66
132
|
parseXrayCliOptions
|
|
67
|
-
} from "./chunk-
|
|
68
|
-
import "./chunk-I6BQZSML.js";
|
|
133
|
+
} from "./chunk-MT4HVDUZ.js";
|
|
69
134
|
import {
|
|
70
135
|
parseStrictCliDate
|
|
71
136
|
} from "./chunk-AJA46VX5.js";
|
|
137
|
+
import "./chunk-UXHQAFNA.js";
|
|
138
|
+
import "./chunk-MT25YHYH.js";
|
|
72
139
|
import "./chunk-HL4DB7TO.js";
|
|
73
140
|
import "./chunk-ZPKBYX2F.js";
|
|
74
141
|
import "./chunk-3SLRNYNG.js";
|
|
@@ -77,7 +144,7 @@ import "./chunk-Y4Z4I6WK.js";
|
|
|
77
144
|
import "./chunk-5HRY2WRF.js";
|
|
78
145
|
import {
|
|
79
146
|
reportBufferSurpriseDistribution
|
|
80
|
-
} from "./chunk-
|
|
147
|
+
} from "./chunk-YBPYIAA5.js";
|
|
81
148
|
import {
|
|
82
149
|
DEFAULT_SURPRISE_K,
|
|
83
150
|
computeSurprise
|
|
@@ -85,35 +152,52 @@ import {
|
|
|
85
152
|
import {
|
|
86
153
|
getMemoryForActiveMemory,
|
|
87
154
|
recallForActiveMemory
|
|
88
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-2WWLHTZY.js";
|
|
89
156
|
import "./chunk-6MKAMLQL.js";
|
|
90
157
|
import {
|
|
91
158
|
DEFAULT_TAXONOMY,
|
|
92
159
|
Orchestrator,
|
|
93
|
-
applyLcmSchema,
|
|
94
160
|
branchNamespaceName,
|
|
95
161
|
buildProcedureRecallSection,
|
|
96
162
|
decideSemanticDedup,
|
|
97
163
|
defaultWorkspaceDir,
|
|
98
164
|
describeCodingScope,
|
|
99
|
-
ensureLcmStateDir,
|
|
100
165
|
generateResolverDocument,
|
|
101
166
|
getTaxonomyDir,
|
|
102
167
|
getTaxonomyFilePath,
|
|
103
168
|
loadTaxonomy,
|
|
104
|
-
migrateFromEngram,
|
|
105
|
-
openLcmDatabase,
|
|
106
169
|
projectNamespaceName,
|
|
107
170
|
resolveCodingNamespaceOverlay,
|
|
108
|
-
rollbackFromEngramMigration,
|
|
109
171
|
sanitizeSessionKeyForFilename,
|
|
110
172
|
saveTaxonomy,
|
|
111
173
|
validateSlug,
|
|
112
174
|
validateTaxonomy
|
|
113
|
-
} from "./chunk-
|
|
114
|
-
import "./chunk-4DXC6HQQ.js";
|
|
175
|
+
} from "./chunk-GA454ALV.js";
|
|
115
176
|
import "./chunk-CK5NTM2S.js";
|
|
177
|
+
import {
|
|
178
|
+
migrateFromEngram,
|
|
179
|
+
rollbackFromEngramMigration
|
|
180
|
+
} from "./chunk-KOSORCJG.js";
|
|
181
|
+
import "./chunk-BFBF3XEF.js";
|
|
182
|
+
import "./chunk-HHLLAQGZ.js";
|
|
183
|
+
import "./chunk-UWK5OXUJ.js";
|
|
184
|
+
import "./chunk-VNO6ZJ35.js";
|
|
185
|
+
import "./chunk-34DQE4KF.js";
|
|
186
|
+
import "./chunk-56K5QLHX.js";
|
|
187
|
+
import "./chunk-7N4KAIGN.js";
|
|
188
|
+
import "./chunk-TPDBFYEG.js";
|
|
189
|
+
import "./chunk-ZTFCYYEZ.js";
|
|
190
|
+
import {
|
|
191
|
+
applyLcmSchema,
|
|
192
|
+
ensureLcmStateDir,
|
|
193
|
+
openLcmDatabase
|
|
194
|
+
} from "./chunk-7XYTQGCC.js";
|
|
195
|
+
import "./chunk-TECVW3JP.js";
|
|
196
|
+
import "./chunk-RYED3SPJ.js";
|
|
197
|
+
import "./chunk-KUJVMMZQ.js";
|
|
198
|
+
import "./chunk-U4SCL7B7.js";
|
|
116
199
|
import "./chunk-FSFEQI74.js";
|
|
200
|
+
import "./chunk-OIGNEXKZ.js";
|
|
117
201
|
import "./chunk-MDYG7VI7.js";
|
|
118
202
|
import "./chunk-Z5AAYHUC.js";
|
|
119
203
|
import {
|
|
@@ -122,28 +206,34 @@ import {
|
|
|
122
206
|
} from "./chunk-S75M5ZRK.js";
|
|
123
207
|
import "./chunk-TPB3I2AC.js";
|
|
124
208
|
import "./chunk-UHGBNIOS.js";
|
|
125
|
-
import "./chunk-
|
|
126
|
-
import "./chunk-
|
|
127
|
-
import
|
|
209
|
+
import "./chunk-H3ME6L6D.js";
|
|
210
|
+
import "./chunk-XJNBEDFE.js";
|
|
211
|
+
import {
|
|
212
|
+
buildTargetedFactRecallSection,
|
|
213
|
+
shouldRecallTargetedFactEvidence
|
|
214
|
+
} from "./chunk-VWT3F4IV.js";
|
|
128
215
|
import "./chunk-JR4ZC3G4.js";
|
|
129
|
-
import "./chunk-K4FLSOR5.js";
|
|
130
|
-
import "./chunk-V3RXWQIE.js";
|
|
131
216
|
import "./chunk-5IZL4DCV.js";
|
|
132
|
-
import "./chunk-X7XN6YU4.js";
|
|
133
217
|
import "./chunk-5NPGSAVB.js";
|
|
134
218
|
import "./chunk-C7VW7C3F.js";
|
|
135
|
-
import
|
|
136
|
-
|
|
219
|
+
import {
|
|
220
|
+
buildResponseGuidanceRecallSection,
|
|
221
|
+
shouldRecallResponseGuidance
|
|
222
|
+
} from "./chunk-OZKZ2TRP.js";
|
|
223
|
+
import "./chunk-K4FLSOR5.js";
|
|
224
|
+
import "./chunk-V3RXWQIE.js";
|
|
137
225
|
import "./chunk-WPGJYVUH.js";
|
|
138
|
-
import "./chunk-
|
|
226
|
+
import "./chunk-X7XN6YU4.js";
|
|
139
227
|
import {
|
|
140
228
|
DEFAULT_REASONING_TRACE_BOOST,
|
|
141
229
|
applyReasoningTraceBoost,
|
|
142
230
|
isReasoningTracePath,
|
|
143
231
|
looksLikeProblemSolvingQuery
|
|
144
232
|
} from "./chunk-ZZTOURJI.js";
|
|
233
|
+
import "./chunk-YDBIWGNI.js";
|
|
234
|
+
import "./chunk-7DHTMOND.js";
|
|
235
|
+
import "./chunk-YCN4BVDK.js";
|
|
145
236
|
import "./chunk-D654IBA6.js";
|
|
146
|
-
import "./chunk-H63EDPFJ.js";
|
|
147
237
|
import {
|
|
148
238
|
applyMemoryWorthFilter,
|
|
149
239
|
buildMemoryWorthCounterMap
|
|
@@ -151,51 +241,67 @@ import {
|
|
|
151
241
|
import {
|
|
152
242
|
computeMemoryWorth
|
|
153
243
|
} from "./chunk-IISBCCWR.js";
|
|
244
|
+
import {
|
|
245
|
+
builtInLiveConnectorDefinitions,
|
|
246
|
+
hasEnabledLiveConnector,
|
|
247
|
+
runLiveConnectorsOnce
|
|
248
|
+
} from "./chunk-U3WSW6PZ.js";
|
|
249
|
+
import "./chunk-H63EDPFJ.js";
|
|
154
250
|
import {
|
|
155
251
|
hasBroadGraphIntent,
|
|
156
252
|
inferIntentFromText,
|
|
157
253
|
intentCompatibilityScore,
|
|
158
254
|
isTaskInitiationIntent,
|
|
159
255
|
planRecallMode
|
|
160
|
-
} from "./chunk-
|
|
161
|
-
import {
|
|
162
|
-
builtInLiveConnectorDefinitions,
|
|
163
|
-
hasEnabledLiveConnector,
|
|
164
|
-
runLiveConnectorsOnce
|
|
165
|
-
} from "./chunk-XMVFHBHT.js";
|
|
256
|
+
} from "./chunk-PD6O7AXF.js";
|
|
166
257
|
import "./chunk-YAZNBMNF.js";
|
|
258
|
+
import "./chunk-LCR46JY5.js";
|
|
259
|
+
import {
|
|
260
|
+
clearVerdictCache,
|
|
261
|
+
createVerdictCache,
|
|
262
|
+
getVerdictKind,
|
|
263
|
+
isDurableVerdict,
|
|
264
|
+
isValidCachedVerdict,
|
|
265
|
+
judgeFactDurability,
|
|
266
|
+
normalizeCachedVerdict,
|
|
267
|
+
verdictCacheSize
|
|
268
|
+
} from "./chunk-C4SQJZAF.js";
|
|
167
269
|
import {
|
|
168
270
|
ExtractionEngine
|
|
169
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-W3LR522O.js";
|
|
272
|
+
import "./chunk-4RA3C3EV.js";
|
|
170
273
|
import "./chunk-WW3QQF4H.js";
|
|
171
274
|
import "./chunk-54V4BZWP.js";
|
|
172
|
-
import
|
|
173
|
-
|
|
275
|
+
import {
|
|
276
|
+
ModelRegistry
|
|
277
|
+
} from "./chunk-QR3C7BKQ.js";
|
|
278
|
+
import "./chunk-EDTHC6UD.js";
|
|
279
|
+
import {
|
|
280
|
+
buildFocusedListRecallSection,
|
|
281
|
+
shouldRecallFocusedListEvidence
|
|
282
|
+
} from "./chunk-DB5A3NHS.js";
|
|
283
|
+
import {
|
|
284
|
+
buildEntityRecallSection
|
|
285
|
+
} from "./chunk-7IASACLB.js";
|
|
286
|
+
import {
|
|
287
|
+
buildEventOrderRecallSection,
|
|
288
|
+
shouldRecallEventOrderEvidence
|
|
289
|
+
} from "./chunk-6NKAQ74D.js";
|
|
174
290
|
import {
|
|
175
291
|
buildExplicitCueRecallSection,
|
|
176
292
|
buildTrajectoryAnalysisRecallSection,
|
|
177
293
|
collectBenchmarkAnchorCues,
|
|
294
|
+
collectContentLexicalCues,
|
|
178
295
|
collectExplicitTurnReferences,
|
|
179
296
|
collectLexicalCues,
|
|
180
297
|
collectQuestionSlotCues,
|
|
181
298
|
collectStructuredPlanCues,
|
|
182
299
|
collectTemporalLexicalCues,
|
|
183
300
|
normalizeTurnExpansionEnd
|
|
184
|
-
} from "./chunk-
|
|
301
|
+
} from "./chunk-OAZ5MFUB.js";
|
|
185
302
|
import {
|
|
186
303
|
buildEvidencePack
|
|
187
|
-
} from "./chunk-
|
|
188
|
-
import "./chunk-DF3RVK3X.js";
|
|
189
|
-
import {
|
|
190
|
-
clearVerdictCache,
|
|
191
|
-
createVerdictCache,
|
|
192
|
-
getVerdictKind,
|
|
193
|
-
isDurableVerdict,
|
|
194
|
-
isValidCachedVerdict,
|
|
195
|
-
judgeFactDurability,
|
|
196
|
-
normalizeCachedVerdict,
|
|
197
|
-
verdictCacheSize
|
|
198
|
-
} from "./chunk-C4SQJZAF.js";
|
|
304
|
+
} from "./chunk-PYPOFEMK.js";
|
|
199
305
|
import {
|
|
200
306
|
buildExtensionsFooterForSummary,
|
|
201
307
|
loadDaySummaryPrompt
|
|
@@ -203,39 +309,77 @@ import {
|
|
|
203
309
|
import "./chunk-VEWZZM3H.js";
|
|
204
310
|
import {
|
|
205
311
|
resolveCategory
|
|
206
|
-
} from "./chunk-
|
|
312
|
+
} from "./chunk-5NXIJZFX.js";
|
|
207
313
|
import {
|
|
208
314
|
FILTER_LABELS,
|
|
209
315
|
isDirectAnswerEligible
|
|
210
316
|
} from "./chunk-Y4FHOFJ2.js";
|
|
211
|
-
import "./chunk-
|
|
317
|
+
import "./chunk-NMZY542O.js";
|
|
212
318
|
import {
|
|
213
|
-
|
|
214
|
-
} from "./chunk-
|
|
319
|
+
CODEX_THREAD_KEY_PREFIX
|
|
320
|
+
} from "./chunk-3PG3H5TD.js";
|
|
215
321
|
import "./chunk-2NMMFZ5T.js";
|
|
216
|
-
import
|
|
322
|
+
import {
|
|
323
|
+
buildExtensionsBlockForConsolidation
|
|
324
|
+
} from "./chunk-I5V2VDIW.js";
|
|
325
|
+
import {
|
|
326
|
+
runCodexMaterialize,
|
|
327
|
+
runPostConsolidationMaterialize
|
|
328
|
+
} from "./chunk-ME6ESPZU.js";
|
|
329
|
+
import {
|
|
330
|
+
MATERIALIZE_VERSION,
|
|
331
|
+
SENTINEL_FILE,
|
|
332
|
+
describeMemoriesDir,
|
|
333
|
+
ensureSentinel,
|
|
334
|
+
materializeForNamespace
|
|
335
|
+
} from "./chunk-RHY3HH7P.js";
|
|
336
|
+
import {
|
|
337
|
+
REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT,
|
|
338
|
+
discoverMemoryExtensions,
|
|
339
|
+
renderExtensionsBlock,
|
|
340
|
+
renderExtensionsFooter,
|
|
341
|
+
resolveExtensionsRoot
|
|
342
|
+
} from "./chunk-EJI5XIBB.js";
|
|
343
|
+
import "./chunk-2PRQG7PV.js";
|
|
344
|
+
import "./chunk-LUDTDZLK.js";
|
|
217
345
|
import "./chunk-PYXS46O7.js";
|
|
218
346
|
import "./chunk-3QKK7QOS.js";
|
|
219
|
-
import "./chunk-
|
|
220
|
-
import "./chunk-
|
|
221
|
-
import "./chunk-
|
|
347
|
+
import "./chunk-P4NEIHUT.js";
|
|
348
|
+
import "./chunk-W4RVMTHR.js";
|
|
349
|
+
import "./chunk-MC26UJIM.js";
|
|
222
350
|
import "./chunk-CULXMQJH.js";
|
|
223
|
-
import "./chunk-
|
|
351
|
+
import "./chunk-5375UYTQ.js";
|
|
352
|
+
import "./chunk-FF4KLI5W.js";
|
|
353
|
+
import "./chunk-EABGC2TL.js";
|
|
354
|
+
import "./chunk-PU63GXWS.js";
|
|
355
|
+
import "./chunk-6RVI47ZR.js";
|
|
224
356
|
import {
|
|
225
|
-
LanceDbBackend,
|
|
226
|
-
MeilisearchBackend,
|
|
227
357
|
OramaBackend
|
|
228
|
-
} from "./chunk-
|
|
229
|
-
import "./chunk-
|
|
358
|
+
} from "./chunk-XVVIG67A.js";
|
|
359
|
+
import "./chunk-PIRJPV5T.js";
|
|
360
|
+
import "./chunk-RXDLTSWT.js";
|
|
230
361
|
import {
|
|
231
|
-
|
|
232
|
-
} from "./chunk-
|
|
362
|
+
LanceDbBackend
|
|
363
|
+
} from "./chunk-3VAL7ZL2.js";
|
|
364
|
+
import {
|
|
365
|
+
MeilisearchBackend
|
|
366
|
+
} from "./chunk-TMQLARTH.js";
|
|
367
|
+
import "./chunk-MJFNCJXV.js";
|
|
368
|
+
import "./chunk-NJ3MJQZX.js";
|
|
369
|
+
import "./chunk-QQUAB63I.js";
|
|
370
|
+
import "./chunk-PR5FBTFU.js";
|
|
371
|
+
import "./chunk-FJ43PRLT.js";
|
|
372
|
+
import "./chunk-LLQ2LLWF.js";
|
|
373
|
+
import "./chunk-7DTASS5T.js";
|
|
374
|
+
import "./chunk-YRMVARQP.js";
|
|
233
375
|
import {
|
|
234
376
|
LEGACY_PLUGIN_ID,
|
|
235
377
|
PLUGIN_ID,
|
|
236
378
|
resolveRemnicPluginEntry
|
|
237
379
|
} from "./chunk-U66YHYC7.js";
|
|
238
|
-
import
|
|
380
|
+
import {
|
|
381
|
+
QmdClient
|
|
382
|
+
} from "./chunk-BJ3KMYTB.js";
|
|
239
383
|
import {
|
|
240
384
|
DEFAULT_POLL_INTERVAL_MS,
|
|
241
385
|
GOOGLE_DRIVE_CONNECTOR_ID,
|
|
@@ -250,26 +394,21 @@ import {
|
|
|
250
394
|
defaultGoogleDriveClientFactory,
|
|
251
395
|
validateGoogleDriveConfig,
|
|
252
396
|
validateNotionConfig
|
|
253
|
-
} from "./chunk-
|
|
397
|
+
} from "./chunk-HXXBL2KD.js";
|
|
254
398
|
import {
|
|
255
399
|
CONNECTOR_ID_PATTERN,
|
|
256
400
|
isValidConnectorId,
|
|
257
401
|
listConnectorStates,
|
|
258
402
|
readConnectorState,
|
|
259
403
|
writeConnectorState
|
|
260
|
-
} from "./chunk-
|
|
261
|
-
import "./chunk-HMDCOMYU.js";
|
|
404
|
+
} from "./chunk-LPMVBPA3.js";
|
|
262
405
|
import "./chunk-JXS5PDQ7.js";
|
|
263
|
-
import "./chunk-
|
|
406
|
+
import "./chunk-HMDCOMYU.js";
|
|
407
|
+
import "./chunk-7SEAZFFB.js";
|
|
408
|
+
import "./chunk-D46YSIYX.js";
|
|
264
409
|
import "./chunk-AJU4PJGY.js";
|
|
265
410
|
import "./chunk-C6QPK5GG.js";
|
|
266
|
-
import "./chunk-
|
|
267
|
-
import "./chunk-FYIYMQ5N.js";
|
|
268
|
-
import {
|
|
269
|
-
coerceInstallExtension,
|
|
270
|
-
parseConfig
|
|
271
|
-
} from "./chunk-6Z6UH6TK.js";
|
|
272
|
-
import "./chunk-Z5LAYHGJ.js";
|
|
411
|
+
import "./chunk-2KI4QFHU.js";
|
|
273
412
|
import {
|
|
274
413
|
CONNECTORS_OUTPUT_FORMATS,
|
|
275
414
|
parseConnectorsFormat,
|
|
@@ -280,56 +419,62 @@ import {
|
|
|
280
419
|
renderConnectorsRunResult,
|
|
281
420
|
runConnectorPollOnce
|
|
282
421
|
} from "./chunk-OZHRDTDX.js";
|
|
283
|
-
import
|
|
284
|
-
CODEX_THREAD_KEY_PREFIX
|
|
285
|
-
} from "./chunk-3PG3H5TD.js";
|
|
422
|
+
import "./chunk-3UXOZBHV.js";
|
|
286
423
|
import "./chunk-KVE7R4CG.js";
|
|
287
424
|
import "./chunk-4WMCPJWX.js";
|
|
288
425
|
import {
|
|
289
426
|
SmartBuffer
|
|
290
|
-
} from "./chunk-
|
|
291
|
-
import {
|
|
292
|
-
MATERIALIZE_VERSION,
|
|
293
|
-
SENTINEL_FILE,
|
|
294
|
-
buildExtensionsBlockForConsolidation,
|
|
295
|
-
describeMemoriesDir,
|
|
296
|
-
ensureSentinel,
|
|
297
|
-
materializeForNamespace,
|
|
298
|
-
runCodexMaterialize,
|
|
299
|
-
runPostConsolidationMaterialize
|
|
300
|
-
} from "./chunk-C5HUWVH2.js";
|
|
301
|
-
import {
|
|
302
|
-
REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT,
|
|
303
|
-
discoverMemoryExtensions,
|
|
304
|
-
renderExtensionsBlock,
|
|
305
|
-
renderExtensionsFooter,
|
|
306
|
-
resolveExtensionsRoot
|
|
307
|
-
} from "./chunk-EJI5XIBB.js";
|
|
427
|
+
} from "./chunk-5RGLBDQF.js";
|
|
308
428
|
import {
|
|
309
429
|
FallbackLlmClient
|
|
310
|
-
} from "./chunk-
|
|
311
|
-
import "./chunk-
|
|
312
|
-
import "./chunk-L2EXJQJP.js";
|
|
430
|
+
} from "./chunk-DINWEURR.js";
|
|
431
|
+
import "./chunk-FLTNHQK6.js";
|
|
313
432
|
import "./chunk-7SI52C65.js";
|
|
433
|
+
import "./chunk-L2EXJQJP.js";
|
|
314
434
|
import "./chunk-UZB5KHKX.js";
|
|
315
435
|
import {
|
|
316
436
|
setCodexCliFallbackRunnerForProcess
|
|
317
|
-
} from "./chunk-
|
|
437
|
+
} from "./chunk-RK6F44Y6.js";
|
|
438
|
+
import {
|
|
439
|
+
isOpenaiApiKeyDisabled,
|
|
440
|
+
parseConfig,
|
|
441
|
+
resolveEnvVars
|
|
442
|
+
} from "./chunk-2QR3XXIC.js";
|
|
443
|
+
import {
|
|
444
|
+
coerceInstallExtension
|
|
445
|
+
} from "./chunk-PHK3HARR.js";
|
|
446
|
+
import "./chunk-Z5LAYHGJ.js";
|
|
318
447
|
import "./chunk-6HZ6AO2P.js";
|
|
319
448
|
import "./chunk-JWPLJLDU.js";
|
|
320
449
|
import {
|
|
321
450
|
BootstrapEngine
|
|
322
451
|
} from "./chunk-N53K2EXC.js";
|
|
323
452
|
import "./chunk-XYIK4LF6.js";
|
|
324
|
-
import "./chunk-
|
|
453
|
+
import "./chunk-NZL6GGQE.js";
|
|
325
454
|
import "./chunk-PVGDJXVK.js";
|
|
326
455
|
import "./chunk-NGAVDO7E.js";
|
|
327
456
|
import {
|
|
328
457
|
EngramAccessHttpServer
|
|
329
|
-
} from "./chunk-
|
|
458
|
+
} from "./chunk-CQZRLNMV.js";
|
|
459
|
+
import "./chunk-SEDEKFYQ.js";
|
|
460
|
+
import "./chunk-6FC5EGNV.js";
|
|
461
|
+
import "./chunk-3Y4P7RXM.js";
|
|
462
|
+
import "./chunk-6LVVDPJ4.js";
|
|
463
|
+
import "./chunk-7MNMYOFP.js";
|
|
464
|
+
import "./chunk-FKFMOY3N.js";
|
|
465
|
+
import "./chunk-FAJ7FZYM.js";
|
|
330
466
|
import {
|
|
331
467
|
EngramMcpServer
|
|
332
|
-
} from "./chunk-
|
|
468
|
+
} from "./chunk-WZYKANL3.js";
|
|
469
|
+
import {
|
|
470
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_CANONICAL_TOOL,
|
|
471
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
472
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
|
|
473
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
|
|
474
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
475
|
+
buildChatGptMemoryInspectorActionRequest,
|
|
476
|
+
buildChatGptMemoryInspectorResult
|
|
477
|
+
} from "./chunk-C5BCH4ZS.js";
|
|
333
478
|
import {
|
|
334
479
|
buildCitationGuidance,
|
|
335
480
|
formatOaiMemCitation,
|
|
@@ -341,11 +486,14 @@ import {
|
|
|
341
486
|
EngramAccessService,
|
|
342
487
|
computeProcedureStats,
|
|
343
488
|
formatProcedureStatsText
|
|
344
|
-
} from "./chunk-
|
|
489
|
+
} from "./chunk-M23FSH32.js";
|
|
490
|
+
import "./chunk-ZKSK55RC.js";
|
|
491
|
+
import "./chunk-WELDCG6C.js";
|
|
345
492
|
import {
|
|
346
493
|
importCapsule
|
|
347
|
-
} from "./chunk-
|
|
494
|
+
} from "./chunk-GGKRUQOO.js";
|
|
348
495
|
import "./chunk-BT7NVCML.js";
|
|
496
|
+
import "./chunk-H7XKCNR6.js";
|
|
349
497
|
import {
|
|
350
498
|
RECALL_XRAY_FORMATS,
|
|
351
499
|
parseXrayFormat,
|
|
@@ -353,24 +501,18 @@ import {
|
|
|
353
501
|
renderXrayJson,
|
|
354
502
|
renderXrayMarkdown,
|
|
355
503
|
renderXrayText
|
|
356
|
-
} from "./chunk-
|
|
504
|
+
} from "./chunk-FBYESMQ2.js";
|
|
357
505
|
import "./chunk-SOBJ6NEY.js";
|
|
358
|
-
import "./chunk-H7XKCNR6.js";
|
|
359
|
-
import "./chunk-EYNQTST2.js";
|
|
360
506
|
import {
|
|
361
507
|
normalizeOriginUrl,
|
|
362
508
|
resolveGitContext,
|
|
363
509
|
stableHash
|
|
364
|
-
} from "./chunk-
|
|
510
|
+
} from "./chunk-FDU6HUUL.js";
|
|
365
511
|
import {
|
|
366
512
|
isTrustZoneName
|
|
367
|
-
} from "./chunk-
|
|
368
|
-
import "./chunk-
|
|
369
|
-
import
|
|
370
|
-
memoryWorthOutcomeEligibleCategories,
|
|
371
|
-
recordMemoryOutcome
|
|
372
|
-
} from "./chunk-EIR5VLIH.js";
|
|
373
|
-
import "./chunk-HJYHRE4S.js";
|
|
513
|
+
} from "./chunk-QDZ2RLEC.js";
|
|
514
|
+
import "./chunk-MGKYQQYF.js";
|
|
515
|
+
import "./chunk-GL6I6MEQ.js";
|
|
374
516
|
import {
|
|
375
517
|
isLcmMessagePartKind,
|
|
376
518
|
normalizeExplicitParts,
|
|
@@ -378,38 +520,32 @@ import {
|
|
|
378
520
|
parseMessageParts,
|
|
379
521
|
parseOpenAiMessageParts,
|
|
380
522
|
parseOpenClawMessageParts,
|
|
523
|
+
parsePiMessageParts,
|
|
381
524
|
partsFromRenderedText
|
|
382
|
-
} from "./chunk-
|
|
525
|
+
} from "./chunk-3APJ5EVB.js";
|
|
383
526
|
import "./chunk-5UM2VJ6D.js";
|
|
527
|
+
import "./chunk-EFJ3MQ4V.js";
|
|
528
|
+
import {
|
|
529
|
+
memoryWorthOutcomeEligibleCategories,
|
|
530
|
+
recordMemoryOutcome
|
|
531
|
+
} from "./chunk-EIR5VLIH.js";
|
|
384
532
|
import "./chunk-PCUKNJAZ.js";
|
|
385
|
-
import "./chunk-
|
|
533
|
+
import "./chunk-RRF5UOBJ.js";
|
|
386
534
|
import "./chunk-NBNN5GOB.js";
|
|
387
|
-
import
|
|
388
|
-
launchProcessSync
|
|
389
|
-
} from "./chunk-OR64ZGRZ.js";
|
|
390
|
-
import "./chunk-GVPWB7EY.js";
|
|
391
|
-
import "./chunk-2LGMW3DJ.js";
|
|
535
|
+
import "./chunk-NNVTUXEB.js";
|
|
392
536
|
import {
|
|
393
537
|
buildProcedureMarkdownBody,
|
|
394
538
|
parseProcedureStepsFromBody
|
|
395
539
|
} from "./chunk-QDW3E4RD.js";
|
|
540
|
+
import "./chunk-25MQ7IHJ.js";
|
|
396
541
|
import {
|
|
397
542
|
CrossNamespaceBudget,
|
|
398
543
|
DEFAULT_CROSS_NAMESPACE_BUDGET
|
|
399
544
|
} from "./chunk-GDFS42HT.js";
|
|
545
|
+
import "./chunk-U3PN77QT.js";
|
|
400
546
|
import "./chunk-RK2Y4XOM.js";
|
|
401
547
|
import "./chunk-2LSZVONP.js";
|
|
402
548
|
import "./chunk-WIICJPET.js";
|
|
403
|
-
import "./chunk-G2WADRQ3.js";
|
|
404
|
-
import "./chunk-74EMIVE4.js";
|
|
405
|
-
import {
|
|
406
|
-
expandTildePath
|
|
407
|
-
} from "./chunk-IXEJRKCZ.js";
|
|
408
|
-
import "./chunk-DT5TVLJE.js";
|
|
409
|
-
import {
|
|
410
|
-
resolvePrincipal
|
|
411
|
-
} from "./chunk-N5AKDXAI.js";
|
|
412
|
-
import "./chunk-TBBDFYXW.js";
|
|
413
549
|
import {
|
|
414
550
|
BRIEFING_FORMAT_ALLOWED,
|
|
415
551
|
FileCalendarSource,
|
|
@@ -422,11 +558,19 @@ import {
|
|
|
422
558
|
renderBriefingMarkdown,
|
|
423
559
|
resolveBriefingSaveDir,
|
|
424
560
|
validateBriefingFormat
|
|
425
|
-
} from "./chunk-
|
|
561
|
+
} from "./chunk-VW676BEI.js";
|
|
426
562
|
import {
|
|
427
|
-
StorageManager
|
|
428
|
-
|
|
563
|
+
StorageManager,
|
|
564
|
+
parseEntityFile,
|
|
565
|
+
serializeEntityFile
|
|
566
|
+
} from "./chunk-7AAT6G4Q.js";
|
|
567
|
+
import "./chunk-5UZXUTVO.js";
|
|
429
568
|
import "./chunk-YNJHCGDT.js";
|
|
569
|
+
import {
|
|
570
|
+
parseFlexibleIsoTimestamp,
|
|
571
|
+
parseIsoOffsetTimestamp,
|
|
572
|
+
parseIsoUtcTimestamp
|
|
573
|
+
} from "./chunk-P7FMDTKL.js";
|
|
430
574
|
import {
|
|
431
575
|
CITATION_UNKNOWN,
|
|
432
576
|
DEFAULT_CITATION_FORMAT,
|
|
@@ -442,15 +586,18 @@ import {
|
|
|
442
586
|
DEFAULT_RECALL_DISCLOSURE,
|
|
443
587
|
RECALL_DISCLOSURE_LEVELS,
|
|
444
588
|
isRecallDisclosure
|
|
445
|
-
} from "./chunk-
|
|
589
|
+
} from "./chunk-Q7P4WJDP.js";
|
|
590
|
+
import {
|
|
591
|
+
normalizeProjectionPreview,
|
|
592
|
+
normalizeProjectionTags
|
|
593
|
+
} from "./chunk-SCU65EZI.js";
|
|
594
|
+
import "./chunk-3KW65B36.js";
|
|
595
|
+
import "./chunk-3HPAPHUK.js";
|
|
446
596
|
import "./chunk-PFV5C235.js";
|
|
447
597
|
import "./chunk-RULE4VG5.js";
|
|
448
|
-
import "./chunk-SCU65EZI.js";
|
|
449
|
-
import "./chunk-XJKFSSDW.js";
|
|
450
598
|
import "./chunk-DM2T26WE.js";
|
|
451
599
|
import "./chunk-QSVPYQPG.js";
|
|
452
600
|
import "./chunk-FVQJYWH7.js";
|
|
453
|
-
import "./chunk-4DJQYKMN.js";
|
|
454
601
|
import "./chunk-G7D6GZ5J.js";
|
|
455
602
|
import {
|
|
456
603
|
createVersion,
|
|
@@ -460,10 +607,20 @@ import {
|
|
|
460
607
|
revertToVersion
|
|
461
608
|
} from "./chunk-FAAFWE4G.js";
|
|
462
609
|
import {
|
|
463
|
-
|
|
610
|
+
expandTildePath
|
|
611
|
+
} from "./chunk-QRNI5JBH.js";
|
|
612
|
+
import "./chunk-ZY2MNJR6.js";
|
|
613
|
+
import "./chunk-MY6TPVXW.js";
|
|
614
|
+
import "./chunk-DT5TVLJE.js";
|
|
615
|
+
import {
|
|
616
|
+
resolvePrincipal
|
|
617
|
+
} from "./chunk-UWVJF25J.js";
|
|
618
|
+
import "./chunk-4DJQYKMN.js";
|
|
619
|
+
import {
|
|
464
620
|
readEnvVar,
|
|
465
621
|
resolveHomeDir
|
|
466
|
-
} from "./chunk-
|
|
622
|
+
} from "./chunk-XIG5PDM7.js";
|
|
623
|
+
import "./chunk-TBBDFYXW.js";
|
|
467
624
|
import {
|
|
468
625
|
initLogger,
|
|
469
626
|
log
|
|
@@ -487,20 +644,49 @@ import {
|
|
|
487
644
|
recallRequestSchema,
|
|
488
645
|
suggestionSubmitRequestSchema,
|
|
489
646
|
validateRequest
|
|
490
|
-
} from "./chunk-
|
|
491
|
-
import "./chunk-
|
|
647
|
+
} from "./chunk-A2XUIMJ3.js";
|
|
648
|
+
import "./chunk-2F2W355T.js";
|
|
649
|
+
import "./chunk-KNKUID7G.js";
|
|
650
|
+
import {
|
|
651
|
+
CAPSULE_ID_PATTERN
|
|
652
|
+
} from "./chunk-WEHSQBFR.js";
|
|
653
|
+
import "./chunk-J4EB7DNW.js";
|
|
654
|
+
import "./chunk-I6K5FBRQ.js";
|
|
492
655
|
import {
|
|
493
656
|
assertIsDirectoryNotSymlink,
|
|
494
657
|
assertRealpathInsideRoot
|
|
495
|
-
} from "./chunk-
|
|
496
|
-
import {
|
|
497
|
-
CAPSULE_ID_PATTERN
|
|
498
|
-
} from "./chunk-OA3L7BFR.js";
|
|
499
|
-
import "./chunk-767ODGE6.js";
|
|
658
|
+
} from "./chunk-AGZQD76C.js";
|
|
500
659
|
import "./chunk-BJMBJZ2Y.js";
|
|
501
660
|
import "./chunk-UKJAGEXH.js";
|
|
502
661
|
import "./chunk-FP2373TW.js";
|
|
503
662
|
import "./chunk-A6XUJE5D.js";
|
|
663
|
+
import {
|
|
664
|
+
ACTION_CONFIDENCE_CONTEXT_READINESS,
|
|
665
|
+
ACTION_CONFIDENCE_DECISIONS,
|
|
666
|
+
ACTION_CONFIDENCE_RISK_CATEGORIES,
|
|
667
|
+
ACTION_CONFIDENCE_RULE_KINDS,
|
|
668
|
+
buildActionConfidenceInputFromOptions,
|
|
669
|
+
evaluateActionConfidence,
|
|
670
|
+
renderActionConfidenceText
|
|
671
|
+
} from "./chunk-AH2JUU6X.js";
|
|
672
|
+
import {
|
|
673
|
+
buildRetrievedMemoryProvenance,
|
|
674
|
+
normalizeRetrievedMemoryProvenance,
|
|
675
|
+
summarizeRetrievedMemoryProvenance
|
|
676
|
+
} from "./chunk-AC5LO7IU.js";
|
|
677
|
+
import {
|
|
678
|
+
USER_BOUNDARY_SCOPES,
|
|
679
|
+
USER_CONTEXT_SCOPES,
|
|
680
|
+
USER_MODEL_CORE_QUESTION,
|
|
681
|
+
USER_MODEL_DIMENSIONS,
|
|
682
|
+
facetHasBoundary,
|
|
683
|
+
isUserBoundaryScope,
|
|
684
|
+
isUserContextScope,
|
|
685
|
+
isUserModelDimension,
|
|
686
|
+
normalizeUserContextScope,
|
|
687
|
+
normalizeUserModelDimension,
|
|
688
|
+
summarizeUserModelCoverage
|
|
689
|
+
} from "./chunk-SOAU2OE2.js";
|
|
504
690
|
import "./chunk-PZ5AY32C.js";
|
|
505
691
|
|
|
506
692
|
// src/coding/review-context.ts
|
|
@@ -2171,15 +2357,21 @@ function walkMdFiles(dir, callback) {
|
|
|
2171
2357
|
// src/review/index.ts
|
|
2172
2358
|
import fs6 from "fs";
|
|
2173
2359
|
import path10 from "path";
|
|
2360
|
+
var DEFAULT_CONFIDENCE_THRESHOLD = 0.7;
|
|
2174
2361
|
function listReviewItems(options) {
|
|
2175
2362
|
const startTime = Date.now();
|
|
2176
2363
|
const {
|
|
2177
2364
|
memoryDir,
|
|
2178
2365
|
reason: filterReason,
|
|
2179
2366
|
limit = 50,
|
|
2180
|
-
confidenceThreshold =
|
|
2367
|
+
confidenceThreshold = DEFAULT_CONFIDENCE_THRESHOLD
|
|
2181
2368
|
} = options;
|
|
2182
2369
|
const items = [];
|
|
2370
|
+
const addItem = (item) => {
|
|
2371
|
+
if (items.length >= limit) return;
|
|
2372
|
+
if (filterReason && item.reviewReason !== filterReason) return;
|
|
2373
|
+
items.push(item);
|
|
2374
|
+
};
|
|
2183
2375
|
const suggestionsDir = path10.join(memoryDir, "suggestions");
|
|
2184
2376
|
if (fs6.existsSync(suggestionsDir)) {
|
|
2185
2377
|
walkMd(suggestionsDir, (filePath, content) => {
|
|
@@ -2187,7 +2379,7 @@ function listReviewItems(options) {
|
|
|
2187
2379
|
const fm = parseFrontmatter4(content);
|
|
2188
2380
|
const body = extractBody4(content);
|
|
2189
2381
|
if (!fm?.id) return;
|
|
2190
|
-
|
|
2382
|
+
addItem({
|
|
2191
2383
|
id: fm.id,
|
|
2192
2384
|
content: body,
|
|
2193
2385
|
category: fm.category ?? "suggestion",
|
|
@@ -2207,7 +2399,7 @@ function listReviewItems(options) {
|
|
|
2207
2399
|
const fm = parseFrontmatter4(content);
|
|
2208
2400
|
const body = extractBody4(content);
|
|
2209
2401
|
if (!fm?.id) return;
|
|
2210
|
-
|
|
2402
|
+
addItem({
|
|
2211
2403
|
id: fm.id,
|
|
2212
2404
|
content: body,
|
|
2213
2405
|
category: fm.category ?? "review",
|
|
@@ -2233,8 +2425,9 @@ function listReviewItems(options) {
|
|
|
2233
2425
|
if (!fm?.id) return;
|
|
2234
2426
|
const confidence = parseConfidence(fm.confidence, 1);
|
|
2235
2427
|
if (confidence >= confidenceThreshold) return;
|
|
2428
|
+
if (parseBoolean(fm.reviewDismissed)) return;
|
|
2236
2429
|
if (items.some((i) => i.id === fm.id)) return;
|
|
2237
|
-
|
|
2430
|
+
addItem({
|
|
2238
2431
|
id: fm.id,
|
|
2239
2432
|
content: body,
|
|
2240
2433
|
category: fm.category ?? category.slice(0, -1),
|
|
@@ -2247,95 +2440,136 @@ function listReviewItems(options) {
|
|
|
2247
2440
|
});
|
|
2248
2441
|
});
|
|
2249
2442
|
}
|
|
2250
|
-
const filtered = filterReason ? items.filter((i) => i.reviewReason === filterReason) : items;
|
|
2251
2443
|
return {
|
|
2252
|
-
items
|
|
2253
|
-
total:
|
|
2444
|
+
items,
|
|
2445
|
+
total: items.length,
|
|
2254
2446
|
durationMs: Date.now() - startTime
|
|
2255
2447
|
};
|
|
2256
2448
|
}
|
|
2257
|
-
function performReview(memoryDir, itemId, action) {
|
|
2449
|
+
function performReview(memoryDir, itemId, action, options = {}) {
|
|
2258
2450
|
switch (action) {
|
|
2259
2451
|
case "approve":
|
|
2260
|
-
return approveItem(memoryDir, itemId);
|
|
2452
|
+
return approveItem(memoryDir, itemId, options);
|
|
2261
2453
|
case "dismiss":
|
|
2262
|
-
return dismissItem(memoryDir, itemId);
|
|
2454
|
+
return dismissItem(memoryDir, itemId, options);
|
|
2263
2455
|
case "flag":
|
|
2264
|
-
return flagItem(memoryDir, itemId);
|
|
2456
|
+
return flagItem(memoryDir, itemId, options);
|
|
2265
2457
|
}
|
|
2266
2458
|
}
|
|
2267
|
-
function approveItem(memoryDir, itemId) {
|
|
2268
|
-
const
|
|
2269
|
-
|
|
2270
|
-
|
|
2271
|
-
|
|
2272
|
-
|
|
2273
|
-
|
|
2274
|
-
|
|
2275
|
-
|
|
2276
|
-
|
|
2277
|
-
|
|
2278
|
-
|
|
2279
|
-
|
|
2280
|
-
|
|
2281
|
-
|
|
2282
|
-
const updatedContent = content.replace(/confidence: [\d.]+/, "confidence: 0.9").replace(/confidenceTier: \w+/, "confidenceTier: high");
|
|
2283
|
-
fs6.mkdirSync(path10.dirname(outputPath), { recursive: true });
|
|
2284
|
-
fs6.writeFileSync(outputPath, updatedContent);
|
|
2285
|
-
fs6.unlinkSync(found);
|
|
2459
|
+
function approveItem(memoryDir, itemId, options) {
|
|
2460
|
+
const found = findReviewFileById(memoryDir, itemId, options);
|
|
2461
|
+
if (!found) {
|
|
2462
|
+
return { itemId, action: "approve", message: "Item not found" };
|
|
2463
|
+
}
|
|
2464
|
+
const content = fs6.readFileSync(found.filePath, "utf8");
|
|
2465
|
+
const fm = parseFrontmatter4(content);
|
|
2466
|
+
if (!fm) return { itemId, action: "approve", message: "Could not parse frontmatter" };
|
|
2467
|
+
const updatedContent = updateFrontmatterFields(content, {
|
|
2468
|
+
confidence: "0.9",
|
|
2469
|
+
confidenceTier: "high",
|
|
2470
|
+
reviewDismissed: null
|
|
2471
|
+
});
|
|
2472
|
+
if (found.location === "category") {
|
|
2473
|
+
fs6.writeFileSync(found.filePath, updatedContent, "utf8");
|
|
2286
2474
|
return {
|
|
2287
2475
|
itemId,
|
|
2288
2476
|
action: "approve",
|
|
2289
|
-
updatedPath:
|
|
2290
|
-
message:
|
|
2477
|
+
updatedPath: found.filePath,
|
|
2478
|
+
message: "Approved low-confidence memory in place with confidence 0.9"
|
|
2291
2479
|
};
|
|
2292
2480
|
}
|
|
2293
|
-
|
|
2481
|
+
const category = fm.category ?? "fact";
|
|
2482
|
+
const targetDir = getCategoryDir(memoryDir, category);
|
|
2483
|
+
const dateDir = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
2484
|
+
const outputPath = path10.join(targetDir, dateDir, path10.basename(found.filePath));
|
|
2485
|
+
fs6.mkdirSync(path10.dirname(outputPath), { recursive: true });
|
|
2486
|
+
const promotedPath = writeFileWithoutClobber(outputPath, updatedContent, itemId);
|
|
2487
|
+
fs6.unlinkSync(found.filePath);
|
|
2488
|
+
return {
|
|
2489
|
+
itemId,
|
|
2490
|
+
action: "approve",
|
|
2491
|
+
updatedPath: promotedPath,
|
|
2492
|
+
message: `Promoted to ${category} with confidence 0.9`
|
|
2493
|
+
};
|
|
2294
2494
|
}
|
|
2295
|
-
function dismissItem(memoryDir, itemId) {
|
|
2296
|
-
const
|
|
2297
|
-
|
|
2298
|
-
|
|
2299
|
-
|
|
2300
|
-
|
|
2301
|
-
|
|
2302
|
-
|
|
2303
|
-
|
|
2304
|
-
|
|
2495
|
+
function dismissItem(memoryDir, itemId, options) {
|
|
2496
|
+
const found = findReviewFileById(memoryDir, itemId, options);
|
|
2497
|
+
if (!found) {
|
|
2498
|
+
return { itemId, action: "dismiss", message: "Item not found" };
|
|
2499
|
+
}
|
|
2500
|
+
if (found.location === "queue") {
|
|
2501
|
+
fs6.unlinkSync(found.filePath);
|
|
2502
|
+
return { itemId, action: "dismiss", message: "Dismissed and removed" };
|
|
2503
|
+
}
|
|
2504
|
+
const content = fs6.readFileSync(found.filePath, "utf8");
|
|
2505
|
+
fs6.writeFileSync(
|
|
2506
|
+
found.filePath,
|
|
2507
|
+
updateFrontmatterFields(content, {
|
|
2508
|
+
reviewDismissed: "true",
|
|
2509
|
+
reviewDismissedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2510
|
+
}),
|
|
2511
|
+
"utf8"
|
|
2512
|
+
);
|
|
2513
|
+
return {
|
|
2514
|
+
itemId,
|
|
2515
|
+
action: "dismiss",
|
|
2516
|
+
updatedPath: found.filePath,
|
|
2517
|
+
message: "Dismissed low-confidence memory in place"
|
|
2518
|
+
};
|
|
2519
|
+
}
|
|
2520
|
+
function flagItem(memoryDir, itemId, options) {
|
|
2521
|
+
const found = findReviewFileById(memoryDir, itemId, options);
|
|
2522
|
+
if (!found) {
|
|
2523
|
+
return { itemId, action: "flag", message: "Item not found" };
|
|
2305
2524
|
}
|
|
2306
|
-
|
|
2525
|
+
const content = fs6.readFileSync(found.filePath, "utf8");
|
|
2526
|
+
const fixed = updateFrontmatterFields(content, {
|
|
2527
|
+
flagged: "true",
|
|
2528
|
+
flaggedAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
2529
|
+
});
|
|
2530
|
+
fs6.writeFileSync(found.filePath, fixed);
|
|
2531
|
+
return {
|
|
2532
|
+
itemId,
|
|
2533
|
+
action: "flag",
|
|
2534
|
+
updatedPath: found.filePath,
|
|
2535
|
+
message: "Flagged for further review"
|
|
2536
|
+
};
|
|
2307
2537
|
}
|
|
2308
|
-
function
|
|
2309
|
-
const
|
|
2310
|
-
for (const loc of locations) {
|
|
2538
|
+
function findReviewFileById(memoryDir, id, options = {}) {
|
|
2539
|
+
for (const loc of ["suggestions", "review"]) {
|
|
2311
2540
|
const dir = path10.join(memoryDir, loc);
|
|
2312
2541
|
if (!fs6.existsSync(dir)) continue;
|
|
2313
|
-
const found = findFileById(dir,
|
|
2314
|
-
if (found) {
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
`
|
|
2322
|
-
);
|
|
2323
|
-
fs6.writeFileSync(found, fixed);
|
|
2324
|
-
return { itemId, action: "flag", message: "Flagged for further review" };
|
|
2325
|
-
}
|
|
2542
|
+
const found = findFileById(dir, id);
|
|
2543
|
+
if (found) return { filePath: found, location: "queue" };
|
|
2544
|
+
}
|
|
2545
|
+
for (const category of ALL_CATEGORY_DIRS) {
|
|
2546
|
+
const dir = path10.join(memoryDir, category);
|
|
2547
|
+
if (!fs6.existsSync(dir)) continue;
|
|
2548
|
+
const found = findFileById(dir, id, (fm) => isLowConfidenceReviewCandidate(fm, options));
|
|
2549
|
+
if (found) return { filePath: found, location: "category" };
|
|
2326
2550
|
}
|
|
2327
|
-
return
|
|
2551
|
+
return null;
|
|
2328
2552
|
}
|
|
2329
|
-
function findFileById(dir, id) {
|
|
2553
|
+
function findFileById(dir, id, include) {
|
|
2330
2554
|
const files = walkMdPaths(dir);
|
|
2331
2555
|
for (const filePath of files) {
|
|
2332
2556
|
const content = readFileSafe3(filePath);
|
|
2333
2557
|
if (!content) continue;
|
|
2334
2558
|
const fm = parseFrontmatter4(content);
|
|
2335
|
-
if (fm?.id === id) return filePath;
|
|
2559
|
+
if (fm?.id === id && (!include || include(fm))) return filePath;
|
|
2336
2560
|
}
|
|
2337
2561
|
return null;
|
|
2338
2562
|
}
|
|
2563
|
+
function isLowConfidenceReviewCandidate(fm, options) {
|
|
2564
|
+
const threshold = options.confidenceThreshold ?? DEFAULT_CONFIDENCE_THRESHOLD;
|
|
2565
|
+
return parseConfidence(fm.confidence, 1) < threshold && !parseBoolean(fm.reviewDismissed);
|
|
2566
|
+
}
|
|
2567
|
+
function parseBoolean(value) {
|
|
2568
|
+
if (typeof value === "boolean") return value;
|
|
2569
|
+
if (typeof value !== "string") return false;
|
|
2570
|
+
const normalized = value.trim().toLowerCase();
|
|
2571
|
+
return normalized === "true" || normalized === "1" || normalized === "yes";
|
|
2572
|
+
}
|
|
2339
2573
|
function parseConfidence(value, fallback) {
|
|
2340
2574
|
if (typeof value === "number") return Number.isFinite(value) ? value : fallback;
|
|
2341
2575
|
if (typeof value === "string") {
|
|
@@ -2344,6 +2578,36 @@ function parseConfidence(value, fallback) {
|
|
|
2344
2578
|
}
|
|
2345
2579
|
return fallback;
|
|
2346
2580
|
}
|
|
2581
|
+
function updateFrontmatterFields(content, fields) {
|
|
2582
|
+
const match = content.match(/^(---\n)([\s\S]*?)(\n---(?:\n|$))/);
|
|
2583
|
+
if (!match) return content;
|
|
2584
|
+
const seen = /* @__PURE__ */ new Set();
|
|
2585
|
+
const lines = match[2].split("\n");
|
|
2586
|
+
const nextLines = [];
|
|
2587
|
+
for (const line of lines) {
|
|
2588
|
+
const colonIdx = line.indexOf(":");
|
|
2589
|
+
if (colonIdx === -1) {
|
|
2590
|
+
nextLines.push(line);
|
|
2591
|
+
continue;
|
|
2592
|
+
}
|
|
2593
|
+
const key = line.slice(0, colonIdx).trim();
|
|
2594
|
+
if (!Object.prototype.hasOwnProperty.call(fields, key)) {
|
|
2595
|
+
nextLines.push(line);
|
|
2596
|
+
continue;
|
|
2597
|
+
}
|
|
2598
|
+
seen.add(key);
|
|
2599
|
+
const value = fields[key];
|
|
2600
|
+
if (value !== null) {
|
|
2601
|
+
nextLines.push(`${key}: ${value}`);
|
|
2602
|
+
}
|
|
2603
|
+
}
|
|
2604
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
2605
|
+
if (value !== null && !seen.has(key)) {
|
|
2606
|
+
nextLines.push(`${key}: ${value}`);
|
|
2607
|
+
}
|
|
2608
|
+
}
|
|
2609
|
+
return `${match[1]}${nextLines.join("\n")}${match[3]}${content.slice(match[0].length)}`;
|
|
2610
|
+
}
|
|
2347
2611
|
function readFileSafe3(filePath) {
|
|
2348
2612
|
try {
|
|
2349
2613
|
return fs6.readFileSync(filePath, "utf8");
|
|
@@ -2351,6 +2615,46 @@ function readFileSafe3(filePath) {
|
|
|
2351
2615
|
return null;
|
|
2352
2616
|
}
|
|
2353
2617
|
}
|
|
2618
|
+
function writeFileWithoutClobber(basePath, content, discriminator) {
|
|
2619
|
+
const parsed = path10.parse(basePath);
|
|
2620
|
+
const safeDiscriminator = sanitizeFilePart(discriminator);
|
|
2621
|
+
for (let attempt = 0; attempt < 1e3; attempt++) {
|
|
2622
|
+
const candidate = attempt === 0 ? basePath : path10.join(
|
|
2623
|
+
parsed.dir,
|
|
2624
|
+
`${parsed.name}-${safeDiscriminator}${attempt === 1 ? "" : `-${attempt}`}${parsed.ext || ".md"}`
|
|
2625
|
+
);
|
|
2626
|
+
try {
|
|
2627
|
+
fs6.writeFileSync(candidate, content, { encoding: "utf8", flag: "wx" });
|
|
2628
|
+
return candidate;
|
|
2629
|
+
} catch (error) {
|
|
2630
|
+
if (error.code === "EEXIST") continue;
|
|
2631
|
+
throw error;
|
|
2632
|
+
}
|
|
2633
|
+
}
|
|
2634
|
+
throw new Error(`Could not find a free review promotion path for ${basePath}`);
|
|
2635
|
+
}
|
|
2636
|
+
function sanitizeFilePart(value) {
|
|
2637
|
+
const chars = [];
|
|
2638
|
+
let previousWasDash = false;
|
|
2639
|
+
for (const char of value) {
|
|
2640
|
+
const next = isSafeFilePartChar(char) ? char : "-";
|
|
2641
|
+
if (next === "-" && previousWasDash) continue;
|
|
2642
|
+
chars.push(next);
|
|
2643
|
+
previousWasDash = next === "-";
|
|
2644
|
+
if (chars.length >= 64) break;
|
|
2645
|
+
}
|
|
2646
|
+
let start = 0;
|
|
2647
|
+
let end = chars.length;
|
|
2648
|
+
while (start < end && chars[start] === "-") start++;
|
|
2649
|
+
while (end > start && chars[end - 1] === "-") end--;
|
|
2650
|
+
const sanitized = chars.slice(start, end).join("");
|
|
2651
|
+
return sanitized || "review-item";
|
|
2652
|
+
}
|
|
2653
|
+
function isSafeFilePartChar(value) {
|
|
2654
|
+
if (value.length !== 1) return false;
|
|
2655
|
+
const code = value.charCodeAt(0);
|
|
2656
|
+
return code >= 48 && code <= 57 || code >= 65 && code <= 90 || code >= 97 && code <= 122 || value === "." || value === "_" || value === "-";
|
|
2657
|
+
}
|
|
2354
2658
|
function parseFrontmatter4(content) {
|
|
2355
2659
|
const match = content.match(/^---\n([\s\S]*?)\n---/);
|
|
2356
2660
|
if (!match) return null;
|
|
@@ -2561,2104 +2865,43 @@ function hashContent3(content) {
|
|
|
2561
2865
|
return crypto5.createHash("sha256").update(content).digest("hex").slice(0, 16);
|
|
2562
2866
|
}
|
|
2563
2867
|
|
|
2564
|
-
// src/
|
|
2565
|
-
import fs9 from "fs";
|
|
2566
|
-
import path13 from "path";
|
|
2567
|
-
import os from "os";
|
|
2568
|
-
import { createRequire } from "module";
|
|
2569
|
-
import { fileURLToPath } from "url";
|
|
2570
|
-
|
|
2571
|
-
// src/connectors/codex-marketplace.ts
|
|
2868
|
+
// src/spaces/index.ts
|
|
2572
2869
|
import fs8 from "fs";
|
|
2573
2870
|
import path12 from "path";
|
|
2574
|
-
|
|
2575
|
-
var
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
return {
|
|
2580
|
-
version: MARKETPLACE_SCHEMA_VERSION,
|
|
2581
|
-
name: "remnic",
|
|
2582
|
-
description: "Remnic: Local-first AI memory with semantic search and consolidation",
|
|
2583
|
-
plugins: [
|
|
2584
|
-
{
|
|
2585
|
-
name: "remnic",
|
|
2586
|
-
version,
|
|
2587
|
-
description: "Persistent memory plugin for Codex CLI",
|
|
2588
|
-
repository: "joshuaswarren/remnic",
|
|
2589
|
-
installType: "github",
|
|
2590
|
-
entry: "packages/plugin-codex",
|
|
2591
|
-
configSchema: "openclaw.plugin.json"
|
|
2592
|
-
}
|
|
2593
|
-
]
|
|
2594
|
-
};
|
|
2871
|
+
import crypto6 from "crypto";
|
|
2872
|
+
var MANIFEST_VERSION = 1;
|
|
2873
|
+
function getSpacesDir(baseDir) {
|
|
2874
|
+
const homeDir = baseDir ?? resolveHomeDir();
|
|
2875
|
+
return path12.join(homeDir, ".config", "engram", "spaces");
|
|
2595
2876
|
}
|
|
2596
|
-
function
|
|
2597
|
-
|
|
2598
|
-
if (!validation.valid) {
|
|
2599
|
-
throw new Error(
|
|
2600
|
-
`Invalid marketplace manifest: ${validation.errors.join("; ")}`
|
|
2601
|
-
);
|
|
2602
|
-
}
|
|
2603
|
-
return manifest;
|
|
2877
|
+
function getManifestPath(baseDir) {
|
|
2878
|
+
return path12.join(getSpacesDir(baseDir), "manifest.json");
|
|
2604
2879
|
}
|
|
2605
|
-
function
|
|
2606
|
-
const
|
|
2607
|
-
if (
|
|
2608
|
-
|
|
2609
|
-
|
|
2610
|
-
|
|
2611
|
-
|
|
2612
|
-
|
|
2613
|
-
|
|
2614
|
-
|
|
2615
|
-
|
|
2616
|
-
}
|
|
2617
|
-
if (typeof obj.description !== "string" || obj.description.trim().length === 0) {
|
|
2618
|
-
errors.push("description must be a non-empty string");
|
|
2880
|
+
function loadManifest(baseDir, memoryDirOverride) {
|
|
2881
|
+
const manifestPath2 = getManifestPath(baseDir);
|
|
2882
|
+
if (!fs8.existsSync(manifestPath2)) {
|
|
2883
|
+
const personalSpace = createPersonalSpace(baseDir, memoryDirOverride);
|
|
2884
|
+
const manifest = {
|
|
2885
|
+
activeSpaceId: personalSpace.id,
|
|
2886
|
+
spaces: [personalSpace],
|
|
2887
|
+
version: MANIFEST_VERSION
|
|
2888
|
+
};
|
|
2889
|
+
saveManifest(manifest, baseDir);
|
|
2890
|
+
return manifest;
|
|
2619
2891
|
}
|
|
2620
|
-
|
|
2621
|
-
errors.push("plugins must be an array");
|
|
2622
|
-
} else if (obj.plugins.length === 0) {
|
|
2623
|
-
errors.push("plugins must contain at least one entry");
|
|
2624
|
-
} else {
|
|
2625
|
-
for (let i = 0; i < obj.plugins.length; i++) {
|
|
2626
|
-
const plugin = obj.plugins[i];
|
|
2627
|
-
const prefix = `plugins[${i}]`;
|
|
2628
|
-
if (typeof plugin !== "object" || plugin === null) {
|
|
2629
|
-
errors.push(`${prefix} must be a non-null object`);
|
|
2630
|
-
continue;
|
|
2631
|
-
}
|
|
2632
|
-
if (typeof plugin.name !== "string" || plugin.name.trim().length === 0) {
|
|
2633
|
-
errors.push(`${prefix}.name must be a non-empty string`);
|
|
2634
|
-
}
|
|
2635
|
-
if (typeof plugin.version !== "string" || plugin.version.trim().length === 0) {
|
|
2636
|
-
errors.push(`${prefix}.version must be a non-empty string`);
|
|
2637
|
-
}
|
|
2638
|
-
if (typeof plugin.description !== "string" || plugin.description.trim().length === 0) {
|
|
2639
|
-
errors.push(`${prefix}.description must be a non-empty string`);
|
|
2640
|
-
}
|
|
2641
|
-
if (typeof plugin.repository !== "string" || plugin.repository.trim().length === 0) {
|
|
2642
|
-
errors.push(`${prefix}.repository must be a non-empty string`);
|
|
2643
|
-
}
|
|
2644
|
-
if (typeof plugin.installType !== "string" || !VALID_INSTALL_TYPES.has(plugin.installType)) {
|
|
2645
|
-
errors.push(
|
|
2646
|
-
`${prefix}.installType must be one of: ${[...VALID_INSTALL_TYPES].join(", ")}; got ${JSON.stringify(plugin.installType)}`
|
|
2647
|
-
);
|
|
2648
|
-
}
|
|
2649
|
-
if ("manifestUrl" in plugin && plugin.manifestUrl !== void 0) {
|
|
2650
|
-
if (typeof plugin.manifestUrl !== "string" || plugin.manifestUrl.trim().length === 0) {
|
|
2651
|
-
errors.push(`${prefix}.manifestUrl must be a non-empty string when provided`);
|
|
2652
|
-
}
|
|
2653
|
-
}
|
|
2654
|
-
if ("entry" in plugin && plugin.entry !== void 0) {
|
|
2655
|
-
if (typeof plugin.entry !== "string" || plugin.entry.trim().length === 0) {
|
|
2656
|
-
errors.push(`${prefix}.entry must be a non-empty string when provided`);
|
|
2657
|
-
}
|
|
2658
|
-
}
|
|
2659
|
-
if ("configSchema" in plugin && plugin.configSchema !== void 0) {
|
|
2660
|
-
if (typeof plugin.configSchema !== "string" || plugin.configSchema.trim().length === 0) {
|
|
2661
|
-
errors.push(`${prefix}.configSchema must be a non-empty string when provided`);
|
|
2662
|
-
}
|
|
2663
|
-
}
|
|
2664
|
-
}
|
|
2665
|
-
}
|
|
2666
|
-
return { valid: errors.length === 0, errors };
|
|
2667
|
-
}
|
|
2668
|
-
async function writeMarketplaceManifest(outputDir, manifest) {
|
|
2669
|
-
const validation = checkMarketplaceManifest(manifest);
|
|
2670
|
-
if (!validation.valid) {
|
|
2671
|
-
throw new Error(
|
|
2672
|
-
`Refusing to write invalid manifest: ${validation.errors.join("; ")}`
|
|
2673
|
-
);
|
|
2674
|
-
}
|
|
2675
|
-
fs8.mkdirSync(outputDir, { recursive: true });
|
|
2676
|
-
const destPath = path12.join(outputDir, MARKETPLACE_MANIFEST_FILENAME);
|
|
2677
|
-
const tmpPath = `${destPath}.tmp.${process.pid}`;
|
|
2678
|
-
const content = JSON.stringify(manifest, null, 2) + "\n";
|
|
2679
|
-
fs8.writeFileSync(tmpPath, content);
|
|
2680
|
-
fs8.renameSync(tmpPath, destPath);
|
|
2681
|
-
}
|
|
2682
|
-
async function installFromMarketplace(source, sourceType, config, logger) {
|
|
2683
|
-
const _log = logger ?? {
|
|
2684
|
-
info: (msg) => log.info(`[marketplace] ${msg}`),
|
|
2685
|
-
warn: (msg) => log.warn(`[marketplace] ${msg}`),
|
|
2686
|
-
debug: (msg) => log.debug(`[marketplace] ${msg}`)
|
|
2687
|
-
};
|
|
2688
|
-
if (!config.codexMarketplaceEnabled) {
|
|
2689
|
-
return {
|
|
2690
|
-
ok: false,
|
|
2691
|
-
message: "Codex marketplace is disabled in config (codexMarketplaceEnabled: false)",
|
|
2692
|
-
source,
|
|
2693
|
-
sourceType,
|
|
2694
|
-
pluginsFound: [],
|
|
2695
|
-
errors: ["marketplace_disabled"]
|
|
2696
|
-
};
|
|
2697
|
-
}
|
|
2698
|
-
try {
|
|
2699
|
-
const manifest = await resolveManifest(source, sourceType, _log);
|
|
2700
|
-
const pluginNames = manifest.plugins.map((p) => p.name);
|
|
2701
|
-
_log.info(`marketplace install: found ${pluginNames.length} plugin(s) from ${sourceType}://${source}`);
|
|
2702
|
-
return {
|
|
2703
|
-
ok: true,
|
|
2704
|
-
message: `Successfully resolved ${pluginNames.length} plugin(s) from marketplace: ${pluginNames.join(", ")}`,
|
|
2705
|
-
source,
|
|
2706
|
-
sourceType,
|
|
2707
|
-
pluginsFound: pluginNames,
|
|
2708
|
-
errors: []
|
|
2709
|
-
};
|
|
2710
|
-
} catch (err) {
|
|
2711
|
-
const errMsg = err instanceof Error ? err.message : String(err);
|
|
2712
|
-
_log.warn(`marketplace install failed: ${errMsg}`);
|
|
2713
|
-
return {
|
|
2714
|
-
ok: false,
|
|
2715
|
-
message: `Failed to install from marketplace: ${errMsg}`,
|
|
2716
|
-
source,
|
|
2717
|
-
sourceType,
|
|
2718
|
-
pluginsFound: [],
|
|
2719
|
-
errors: [errMsg]
|
|
2720
|
-
};
|
|
2721
|
-
}
|
|
2722
|
-
}
|
|
2723
|
-
async function resolveManifest(source, sourceType, logger) {
|
|
2724
|
-
switch (sourceType) {
|
|
2725
|
-
case "local":
|
|
2726
|
-
return resolveLocal(source, logger);
|
|
2727
|
-
case "url":
|
|
2728
|
-
return resolveUrl(source, logger);
|
|
2729
|
-
case "github":
|
|
2730
|
-
return resolveGithub(source, logger);
|
|
2731
|
-
case "git":
|
|
2732
|
-
return resolveGit(source, logger);
|
|
2733
|
-
default: {
|
|
2734
|
-
const _ = sourceType;
|
|
2735
|
-
throw new Error(`Invalid source type: ${String(_)}`);
|
|
2736
|
-
}
|
|
2737
|
-
}
|
|
2738
|
-
}
|
|
2739
|
-
function resolveLocal(dirPath, logger) {
|
|
2740
|
-
const manifestPath2 = path12.join(dirPath, MARKETPLACE_MANIFEST_FILENAME);
|
|
2741
|
-
if (!fs8.existsSync(manifestPath2)) {
|
|
2742
|
-
throw new Error(`marketplace.json not found at ${manifestPath2}`);
|
|
2743
|
-
}
|
|
2744
|
-
logger.debug?.(`reading local marketplace manifest: ${manifestPath2}`);
|
|
2745
|
-
const raw = fs8.readFileSync(manifestPath2, "utf-8");
|
|
2746
|
-
let parsed;
|
|
2747
|
-
try {
|
|
2748
|
-
parsed = JSON.parse(raw);
|
|
2749
|
-
} catch {
|
|
2750
|
-
throw new Error(`Invalid JSON in ${manifestPath2}`);
|
|
2751
|
-
}
|
|
2752
|
-
if (typeof parsed !== "object" || parsed === null) {
|
|
2753
|
-
throw new Error(`marketplace.json at ${manifestPath2} is not a valid object`);
|
|
2754
|
-
}
|
|
2755
|
-
return validateMarketplaceManifest(parsed);
|
|
2756
|
-
}
|
|
2757
|
-
async function resolveUrl(url, logger) {
|
|
2758
|
-
logger.debug?.(`fetching marketplace manifest from URL: ${url}`);
|
|
2759
|
-
let parsedUrl;
|
|
2760
|
-
try {
|
|
2761
|
-
parsedUrl = new URL(url);
|
|
2762
|
-
} catch {
|
|
2763
|
-
throw new Error(`Invalid URL: ${url}`);
|
|
2764
|
-
}
|
|
2765
|
-
if (parsedUrl.protocol !== "https:" && parsedUrl.protocol !== "http:") {
|
|
2766
|
-
throw new Error(`Unsupported URL protocol: ${parsedUrl.protocol} (use https or http)`);
|
|
2767
|
-
}
|
|
2768
|
-
const response = await fetch(url);
|
|
2769
|
-
if (!response.ok) {
|
|
2770
|
-
throw new Error(`HTTP ${response.status} fetching ${url}`);
|
|
2771
|
-
}
|
|
2772
|
-
const body = await response.json();
|
|
2773
|
-
return validateMarketplaceManifest(body);
|
|
2774
|
-
}
|
|
2775
|
-
async function resolveGithub(repo, logger) {
|
|
2776
|
-
if (!/^[a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+$/u.test(repo)) {
|
|
2777
|
-
throw new Error(`Invalid GitHub repo format: "${repo}" (expected owner/repo)`);
|
|
2778
|
-
}
|
|
2779
|
-
const rawUrl = `https://raw.githubusercontent.com/${repo}/HEAD/${MARKETPLACE_MANIFEST_FILENAME}`;
|
|
2780
|
-
logger.debug?.(`fetching marketplace manifest from GitHub: ${rawUrl}`);
|
|
2781
|
-
return resolveUrl(rawUrl, logger);
|
|
2782
|
-
}
|
|
2783
|
-
async function resolveGit(gitUrl, logger) {
|
|
2784
|
-
const ghMatch = gitUrl.match(
|
|
2785
|
-
/^(?:https?:\/\/)?github\.com\/([a-zA-Z0-9._-]+\/[a-zA-Z0-9._-]+?)(?:\.git)?$/u
|
|
2786
|
-
);
|
|
2787
|
-
if (ghMatch?.[1]) {
|
|
2788
|
-
logger.debug?.(`git URL looks like GitHub \u2014 delegating to github resolver`);
|
|
2789
|
-
return resolveGithub(ghMatch[1], logger);
|
|
2790
|
-
}
|
|
2791
|
-
throw new Error(
|
|
2792
|
-
`Git URL resolution requires a GitHub-format URL for now. Got: ${gitUrl}. Use --type github or --type url instead.`
|
|
2793
|
-
);
|
|
2794
|
-
}
|
|
2795
|
-
function readPackageVersion() {
|
|
2796
|
-
const candidates = [
|
|
2797
|
-
path12.resolve(import.meta.dirname ?? ".", "../../../.."),
|
|
2798
|
-
path12.resolve(import.meta.dirname ?? ".", "../../../../.."),
|
|
2799
|
-
path12.resolve(import.meta.dirname ?? ".", "..")
|
|
2800
|
-
];
|
|
2801
|
-
for (const candidate of candidates) {
|
|
2802
|
-
const pkgPath = path12.join(candidate, "package.json");
|
|
2803
|
-
try {
|
|
2804
|
-
if (!fs8.existsSync(pkgPath)) continue;
|
|
2805
|
-
const raw = fs8.readFileSync(pkgPath, "utf-8");
|
|
2806
|
-
const parsed = JSON.parse(raw);
|
|
2807
|
-
if (typeof parsed === "object" && parsed !== null && typeof parsed.version === "string") {
|
|
2808
|
-
return parsed.version;
|
|
2809
|
-
}
|
|
2810
|
-
} catch {
|
|
2811
|
-
}
|
|
2812
|
-
}
|
|
2813
|
-
return void 0;
|
|
2814
|
-
}
|
|
2815
|
-
|
|
2816
|
-
// src/connectors/index.ts
|
|
2817
|
-
var BUILTIN_CONNECTORS = [
|
|
2818
|
-
{
|
|
2819
|
-
id: "claude-code",
|
|
2820
|
-
name: "Claude Code",
|
|
2821
|
-
version: "1.0.0",
|
|
2822
|
-
description: "Anthropic's Claude Code CLI \u2014 direct memory access via MCP",
|
|
2823
|
-
capabilities: {
|
|
2824
|
-
observe: true,
|
|
2825
|
-
recall: true,
|
|
2826
|
-
store: true,
|
|
2827
|
-
search: true,
|
|
2828
|
-
entities: true,
|
|
2829
|
-
realtimeSync: true,
|
|
2830
|
-
batch: false,
|
|
2831
|
-
maxBudgetChars: 32e3,
|
|
2832
|
-
connectionType: "mcp"
|
|
2833
|
-
},
|
|
2834
|
-
configSchema: {
|
|
2835
|
-
mcpServerUrl: "URL of the MCP Remnic server",
|
|
2836
|
-
namespace: "Optional namespace (default: 'default')"
|
|
2837
|
-
},
|
|
2838
|
-
homepage: "https://claude.ai/code",
|
|
2839
|
-
author: "Anthropic",
|
|
2840
|
-
tags: ["official", "ai", "claude"],
|
|
2841
|
-
requiresToken: true
|
|
2842
|
-
},
|
|
2843
|
-
{
|
|
2844
|
-
id: "codex-cli",
|
|
2845
|
-
name: "Codex CLI",
|
|
2846
|
-
version: "1.0.0",
|
|
2847
|
-
description: "OpenAI Codex CLI \u2014 memory via MCP tool",
|
|
2848
|
-
capabilities: {
|
|
2849
|
-
observe: true,
|
|
2850
|
-
recall: true,
|
|
2851
|
-
store: true,
|
|
2852
|
-
search: false,
|
|
2853
|
-
entities: false,
|
|
2854
|
-
realtimeSync: false,
|
|
2855
|
-
batch: true,
|
|
2856
|
-
maxBudgetChars: 8e3,
|
|
2857
|
-
connectionType: "mcp"
|
|
2858
|
-
},
|
|
2859
|
-
configSchema: {
|
|
2860
|
-
mcpServerUrl: "URL of the MCP Remnic server",
|
|
2861
|
-
namespace: "Optional namespace"
|
|
2862
|
-
},
|
|
2863
|
-
homepage: "https://openai.com/codex",
|
|
2864
|
-
author: "OpenAI",
|
|
2865
|
-
tags: ["official", "ai", "codex"],
|
|
2866
|
-
requiresToken: true
|
|
2867
|
-
},
|
|
2868
|
-
{
|
|
2869
|
-
id: "cursor",
|
|
2870
|
-
name: "Cursor IDE",
|
|
2871
|
-
version: "1.0.0",
|
|
2872
|
-
description: "Cursor IDE \u2014 memory via config file + tool calls",
|
|
2873
|
-
capabilities: {
|
|
2874
|
-
observe: false,
|
|
2875
|
-
recall: true,
|
|
2876
|
-
store: false,
|
|
2877
|
-
search: true,
|
|
2878
|
-
entities: false,
|
|
2879
|
-
realtimeSync: false,
|
|
2880
|
-
batch: false,
|
|
2881
|
-
maxBudgetChars: 32e3,
|
|
2882
|
-
connectionType: "embedded"
|
|
2883
|
-
},
|
|
2884
|
-
configSchema: {
|
|
2885
|
-
memoryDir: "Path to Remnic memory directory"
|
|
2886
|
-
},
|
|
2887
|
-
homepage: "https://cursor.com",
|
|
2888
|
-
author: "Cursor Inc.",
|
|
2889
|
-
tags: ["official", "ide"]
|
|
2890
|
-
},
|
|
2891
|
-
{
|
|
2892
|
-
id: "cline",
|
|
2893
|
-
name: "Cline",
|
|
2894
|
-
version: "1.0.0",
|
|
2895
|
-
description: "VS Code Cline extension \u2014 memory via MCP",
|
|
2896
|
-
capabilities: {
|
|
2897
|
-
observe: true,
|
|
2898
|
-
recall: true,
|
|
2899
|
-
store: true,
|
|
2900
|
-
search: false,
|
|
2901
|
-
entities: false,
|
|
2902
|
-
realtimeSync: false,
|
|
2903
|
-
batch: true,
|
|
2904
|
-
maxBudgetChars: 8e3,
|
|
2905
|
-
connectionType: "mcp"
|
|
2906
|
-
},
|
|
2907
|
-
configSchema: {
|
|
2908
|
-
mcpServerUrl: "URL of the MCP Remnic server",
|
|
2909
|
-
namespace: "Optional namespace"
|
|
2910
|
-
},
|
|
2911
|
-
homepage: "https://github.com/cline/cline",
|
|
2912
|
-
author: "Cline",
|
|
2913
|
-
tags: ["community", "vscode"]
|
|
2914
|
-
},
|
|
2915
|
-
{
|
|
2916
|
-
id: "github-copilot",
|
|
2917
|
-
name: "GitHub Copilot",
|
|
2918
|
-
version: "1.0.0",
|
|
2919
|
-
description: "GitHub Copilot \u2014 memory via MCP server",
|
|
2920
|
-
capabilities: {
|
|
2921
|
-
observe: false,
|
|
2922
|
-
recall: true,
|
|
2923
|
-
store: false,
|
|
2924
|
-
search: true,
|
|
2925
|
-
entities: false,
|
|
2926
|
-
realtimeSync: false,
|
|
2927
|
-
batch: false,
|
|
2928
|
-
maxBudgetChars: 16e3,
|
|
2929
|
-
connectionType: "mcp"
|
|
2930
|
-
},
|
|
2931
|
-
configSchema: {
|
|
2932
|
-
mcpServerUrl: "URL of the MCP Remnic server"
|
|
2933
|
-
},
|
|
2934
|
-
homepage: "https://github.com/features/copilot",
|
|
2935
|
-
author: "GitHub",
|
|
2936
|
-
tags: ["official", "ai", "github"]
|
|
2937
|
-
},
|
|
2938
|
-
{
|
|
2939
|
-
id: "roo-code",
|
|
2940
|
-
name: "Roo Code",
|
|
2941
|
-
version: "1.0.0",
|
|
2942
|
-
description: "Roo Code \u2014 memory via MCP",
|
|
2943
|
-
capabilities: {
|
|
2944
|
-
observe: true,
|
|
2945
|
-
recall: true,
|
|
2946
|
-
store: true,
|
|
2947
|
-
search: false,
|
|
2948
|
-
entities: false,
|
|
2949
|
-
realtimeSync: false,
|
|
2950
|
-
batch: true,
|
|
2951
|
-
maxBudgetChars: 16e3,
|
|
2952
|
-
connectionType: "mcp"
|
|
2953
|
-
},
|
|
2954
|
-
configSchema: {
|
|
2955
|
-
mcpServerUrl: "URL of the MCP Remnic server",
|
|
2956
|
-
namespace: "Optional namespace"
|
|
2957
|
-
},
|
|
2958
|
-
homepage: "https://roocode.com",
|
|
2959
|
-
author: "Roo Code",
|
|
2960
|
-
tags: ["community", "vscode"]
|
|
2961
|
-
},
|
|
2962
|
-
{
|
|
2963
|
-
id: "windsurf",
|
|
2964
|
-
name: "Windsurf",
|
|
2965
|
-
version: "1.0.0",
|
|
2966
|
-
description: "Windsurf IDE \u2014 memory via MCP",
|
|
2967
|
-
capabilities: {
|
|
2968
|
-
observe: true,
|
|
2969
|
-
recall: true,
|
|
2970
|
-
store: true,
|
|
2971
|
-
search: true,
|
|
2972
|
-
entities: false,
|
|
2973
|
-
realtimeSync: false,
|
|
2974
|
-
batch: false,
|
|
2975
|
-
maxBudgetChars: 32e3,
|
|
2976
|
-
connectionType: "mcp"
|
|
2977
|
-
},
|
|
2978
|
-
configSchema: {
|
|
2979
|
-
mcpServerUrl: "URL of the MCP Remnic server"
|
|
2980
|
-
},
|
|
2981
|
-
homepage: "https://windsurf.com",
|
|
2982
|
-
author: "Codeium",
|
|
2983
|
-
tags: ["official", "ide"]
|
|
2984
|
-
},
|
|
2985
|
-
{
|
|
2986
|
-
id: "amp",
|
|
2987
|
-
name: "Amp",
|
|
2988
|
-
version: "1.0.0",
|
|
2989
|
-
description: "Amp coding agent \u2014 memory via MCP",
|
|
2990
|
-
capabilities: {
|
|
2991
|
-
observe: true,
|
|
2992
|
-
recall: true,
|
|
2993
|
-
store: true,
|
|
2994
|
-
search: true,
|
|
2995
|
-
entities: false,
|
|
2996
|
-
realtimeSync: false,
|
|
2997
|
-
batch: false,
|
|
2998
|
-
maxBudgetChars: 32e3,
|
|
2999
|
-
connectionType: "mcp"
|
|
3000
|
-
},
|
|
3001
|
-
configSchema: {
|
|
3002
|
-
mcpServerUrl: "URL of the MCP Remnic server"
|
|
3003
|
-
},
|
|
3004
|
-
homepage: "https://ampcode.com",
|
|
3005
|
-
author: "Sourcegraph",
|
|
3006
|
-
tags: ["official", "ai"]
|
|
3007
|
-
},
|
|
3008
|
-
{
|
|
3009
|
-
id: "replit",
|
|
3010
|
-
name: "Replit Agent",
|
|
3011
|
-
version: "1.0.0",
|
|
3012
|
-
description: "Replit Agent \u2014 memory via HTTP API (reduced capabilities)",
|
|
3013
|
-
capabilities: {
|
|
3014
|
-
observe: true,
|
|
3015
|
-
recall: true,
|
|
3016
|
-
store: true,
|
|
3017
|
-
search: false,
|
|
3018
|
-
entities: false,
|
|
3019
|
-
realtimeSync: false,
|
|
3020
|
-
batch: false,
|
|
3021
|
-
maxBudgetChars: 8e3,
|
|
3022
|
-
connectionType: "http"
|
|
3023
|
-
},
|
|
3024
|
-
configSchema: {
|
|
3025
|
-
apiUrl: "URL of the Remnic HTTP API",
|
|
3026
|
-
authToken: "Bearer token for authentication"
|
|
3027
|
-
},
|
|
3028
|
-
homepage: "https://replit.com",
|
|
3029
|
-
author: "Replit",
|
|
3030
|
-
tags: ["official", "cloud"],
|
|
3031
|
-
requiresToken: true
|
|
3032
|
-
},
|
|
3033
|
-
{
|
|
3034
|
-
id: "generic-mcp",
|
|
3035
|
-
name: "Generic MCP Client",
|
|
3036
|
-
version: "1.0.0",
|
|
3037
|
-
description: "Any MCP-compatible client \u2014 connect via standard MCP protocol",
|
|
3038
|
-
capabilities: {
|
|
3039
|
-
observe: true,
|
|
3040
|
-
recall: true,
|
|
3041
|
-
store: true,
|
|
3042
|
-
search: true,
|
|
3043
|
-
entities: true,
|
|
3044
|
-
realtimeSync: true,
|
|
3045
|
-
batch: true,
|
|
3046
|
-
maxBudgetChars: 64e3,
|
|
3047
|
-
connectionType: "mcp"
|
|
3048
|
-
},
|
|
3049
|
-
configSchema: {
|
|
3050
|
-
mcpServerUrl: "URL of the MCP Remnic server",
|
|
3051
|
-
namespace: "Optional namespace",
|
|
3052
|
-
authToken: "Bearer token for authentication"
|
|
3053
|
-
},
|
|
3054
|
-
homepage: "https://github.com/joshuaswarren/remnic",
|
|
3055
|
-
author: "Remnic",
|
|
3056
|
-
tags: ["generic", "mcp"],
|
|
3057
|
-
requiresToken: true
|
|
3058
|
-
},
|
|
3059
|
-
{
|
|
3060
|
-
id: "weclone",
|
|
3061
|
-
name: "WeClone Avatar",
|
|
3062
|
-
version: "1.0.0",
|
|
3063
|
-
description: "Memory-aware OpenAI-compatible proxy for deployed WeClone avatars \u2014 injects Remnic recall into chat completions and buffers turns via observe",
|
|
3064
|
-
capabilities: {
|
|
3065
|
-
observe: true,
|
|
3066
|
-
recall: true,
|
|
3067
|
-
store: false,
|
|
3068
|
-
search: false,
|
|
3069
|
-
entities: false,
|
|
3070
|
-
realtimeSync: false,
|
|
3071
|
-
batch: false,
|
|
3072
|
-
maxBudgetChars: 32e3,
|
|
3073
|
-
connectionType: "http"
|
|
3074
|
-
},
|
|
3075
|
-
configSchema: {
|
|
3076
|
-
wecloneApiUrl: "Base URL of the WeClone OpenAI-compatible API (e.g. http://localhost:8000/v1)",
|
|
3077
|
-
proxyPort: "Local port where the memory proxy will listen (default 8100)",
|
|
3078
|
-
remnicDaemonUrl: "URL of the Remnic daemon exposing /engram/v1/recall and /engram/v1/observe",
|
|
3079
|
-
sessionStrategy: "Per-caller session mapping strategy: 'caller-id' | 'single'",
|
|
3080
|
-
wecloneModelName: "Optional fine-tuned model name passed through to WeClone"
|
|
3081
|
-
},
|
|
3082
|
-
homepage: "https://github.com/xming521/weclone",
|
|
3083
|
-
author: "Remnic",
|
|
3084
|
-
tags: ["official", "ai", "weclone", "proxy"],
|
|
3085
|
-
requiresToken: true
|
|
3086
|
-
},
|
|
3087
|
-
{
|
|
3088
|
-
id: "hermes",
|
|
3089
|
-
name: "Hermes Agent",
|
|
3090
|
-
version: "1.0.0",
|
|
3091
|
-
description: "Hermes Agent MemoryProvider \u2014 automatic recall/observe on every turn via Python plugin protocol",
|
|
3092
|
-
capabilities: {
|
|
3093
|
-
observe: true,
|
|
3094
|
-
recall: true,
|
|
3095
|
-
store: true,
|
|
3096
|
-
search: true,
|
|
3097
|
-
entities: false,
|
|
3098
|
-
realtimeSync: true,
|
|
3099
|
-
batch: false,
|
|
3100
|
-
maxBudgetChars: 32e3,
|
|
3101
|
-
connectionType: "http"
|
|
3102
|
-
},
|
|
3103
|
-
configSchema: {
|
|
3104
|
-
host: "Remnic daemon host (default: 127.0.0.1)",
|
|
3105
|
-
port: "Remnic daemon port (default: 4318)",
|
|
3106
|
-
profile: "Hermes profile name (default: default)"
|
|
3107
|
-
},
|
|
3108
|
-
homepage: "https://github.com/joshuaswarren/remnic/tree/main/packages/plugin-hermes",
|
|
3109
|
-
author: "Remnic",
|
|
3110
|
-
tags: ["official", "python", "hermes"],
|
|
3111
|
-
requiresToken: true
|
|
3112
|
-
}
|
|
3113
|
-
];
|
|
3114
|
-
var REGISTRY_DIR_NAME = ".engram-connectors";
|
|
3115
|
-
function getRegistryPath() {
|
|
3116
|
-
const xdgConfigHome = readEnvVar("XDG_CONFIG_HOME");
|
|
3117
|
-
const configDir = xdgConfigHome ? path13.join(xdgConfigHome, "engram") : path13.join(resolveHomeDir(), ".config", "engram");
|
|
3118
|
-
return path13.join(configDir, REGISTRY_DIR_NAME, "registry.json");
|
|
3119
|
-
}
|
|
3120
|
-
function loadRegistry() {
|
|
3121
|
-
const regPath = getRegistryPath();
|
|
3122
|
-
if (!fs9.existsSync(regPath)) {
|
|
3123
|
-
const registry = {
|
|
3124
|
-
connectors: BUILTIN_CONNECTORS,
|
|
3125
|
-
registryPath: regPath
|
|
3126
|
-
};
|
|
3127
|
-
saveRegistry(registry);
|
|
3128
|
-
return registry;
|
|
3129
|
-
}
|
|
3130
|
-
const raw = fs9.readFileSync(regPath, "utf8");
|
|
3131
|
-
try {
|
|
3132
|
-
const parsed = JSON.parse(raw);
|
|
3133
|
-
const builtinIds = new Set(BUILTIN_CONNECTORS.map((b) => b.id));
|
|
3134
|
-
const customOnly = (parsed.connectors ?? []).filter((c) => !builtinIds.has(c.id));
|
|
3135
|
-
const merged = [...BUILTIN_CONNECTORS, ...customOnly];
|
|
3136
|
-
return {
|
|
3137
|
-
connectors: merged,
|
|
3138
|
-
registryPath: regPath
|
|
3139
|
-
};
|
|
3140
|
-
} catch {
|
|
3141
|
-
const registry = {
|
|
3142
|
-
connectors: BUILTIN_CONNECTORS,
|
|
3143
|
-
registryPath: regPath
|
|
3144
|
-
};
|
|
3145
|
-
saveRegistry(registry);
|
|
3146
|
-
return registry;
|
|
3147
|
-
}
|
|
3148
|
-
}
|
|
3149
|
-
function saveRegistry(registry) {
|
|
3150
|
-
const regPath = registry.registryPath;
|
|
3151
|
-
fs9.mkdirSync(path13.dirname(regPath), { recursive: true });
|
|
3152
|
-
fs9.writeFileSync(regPath, JSON.stringify({ connectors: registry.connectors }, null, 2));
|
|
3153
|
-
}
|
|
3154
|
-
function listConnectors() {
|
|
3155
|
-
const registry = loadRegistry();
|
|
3156
|
-
const connectorsDir = getConnectorsDir();
|
|
3157
|
-
const installedIds = /* @__PURE__ */ new Set();
|
|
3158
|
-
if (fs9.existsSync(connectorsDir)) {
|
|
3159
|
-
for (const entry of fs9.readdirSync(connectorsDir)) {
|
|
3160
|
-
if (entry.endsWith(".json")) {
|
|
3161
|
-
try {
|
|
3162
|
-
const config = JSON.parse(
|
|
3163
|
-
fs9.readFileSync(path13.join(connectorsDir, entry), "utf8")
|
|
3164
|
-
);
|
|
3165
|
-
installedIds.add(config.connectorId);
|
|
3166
|
-
} catch {
|
|
3167
|
-
}
|
|
3168
|
-
}
|
|
3169
|
-
}
|
|
3170
|
-
}
|
|
3171
|
-
const available = registry.connectors.map((manifest) => ({
|
|
3172
|
-
...manifest,
|
|
3173
|
-
installed: installedIds.has(manifest.id)
|
|
3174
|
-
}));
|
|
3175
|
-
const installed = [];
|
|
3176
|
-
for (const id of installedIds) {
|
|
3177
|
-
const configPath = path13.join(connectorsDir, `${id}.json`);
|
|
3178
|
-
try {
|
|
3179
|
-
const raw = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3180
|
-
const { token: _redacted, ...config } = raw;
|
|
3181
|
-
installed.push({
|
|
3182
|
-
connectorId: id,
|
|
3183
|
-
config,
|
|
3184
|
-
status: "installed",
|
|
3185
|
-
installedAt: raw.installedAt
|
|
3186
|
-
});
|
|
3187
|
-
} catch {
|
|
3188
|
-
}
|
|
3189
|
-
}
|
|
3190
|
-
return { installed, available };
|
|
3191
|
-
}
|
|
3192
|
-
function installConnector(options) {
|
|
3193
|
-
const registry = loadRegistry();
|
|
3194
|
-
const manifest = registry.connectors.find((c) => c.id === options.connectorId);
|
|
3195
|
-
if (!manifest) {
|
|
3196
|
-
return {
|
|
3197
|
-
connectorId: options.connectorId,
|
|
3198
|
-
status: "error",
|
|
3199
|
-
message: `Unknown connector: ${options.connectorId}`
|
|
3200
|
-
};
|
|
3201
|
-
}
|
|
3202
|
-
const existing = listConnectors().installed.find(
|
|
3203
|
-
(c) => c.connectorId === options.connectorId
|
|
3204
|
-
);
|
|
3205
|
-
if (existing && !options.force) {
|
|
3206
|
-
return {
|
|
3207
|
-
connectorId: options.connectorId,
|
|
3208
|
-
status: "already_installed",
|
|
3209
|
-
message: "Already installed. Use --force to reinstall."
|
|
3210
|
-
};
|
|
3211
|
-
}
|
|
3212
|
-
const configDir = getConnectorsDir();
|
|
3213
|
-
fs9.mkdirSync(configDir, { recursive: true });
|
|
3214
|
-
const configPath = path13.join(configDir, `${options.connectorId}.json`);
|
|
3215
|
-
let hermesSavedProfile;
|
|
3216
|
-
let hermesSavedHost;
|
|
3217
|
-
let hermesSavedPort;
|
|
3218
|
-
let hermesResolvedProfile;
|
|
3219
|
-
let hermesResolvedHost;
|
|
3220
|
-
let hermesResolvedPort;
|
|
3221
|
-
if (options.connectorId === "hermes") {
|
|
3222
|
-
if (fs9.existsSync(configPath)) {
|
|
3223
|
-
try {
|
|
3224
|
-
const prev = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3225
|
-
if (prev?.profile != null) {
|
|
3226
|
-
try {
|
|
3227
|
-
hermesSavedProfile = sanitizeHermesProfile(String(prev.profile));
|
|
3228
|
-
} catch {
|
|
3229
|
-
}
|
|
3230
|
-
}
|
|
3231
|
-
if (prev?.host != null) {
|
|
3232
|
-
try {
|
|
3233
|
-
hermesSavedHost = sanitizeHermesHost(String(prev.host));
|
|
3234
|
-
} catch {
|
|
3235
|
-
}
|
|
3236
|
-
}
|
|
3237
|
-
if (prev?.port != null) {
|
|
3238
|
-
try {
|
|
3239
|
-
const coercedPort = Number(String(prev.port));
|
|
3240
|
-
hermesSavedPort = sanitizeHermesPort(coercedPort);
|
|
3241
|
-
} catch {
|
|
3242
|
-
}
|
|
3243
|
-
}
|
|
3244
|
-
} catch {
|
|
3245
|
-
}
|
|
3246
|
-
}
|
|
3247
|
-
hermesResolvedProfile = hermesSavedProfile ?? "default";
|
|
3248
|
-
hermesResolvedHost = hermesSavedHost ?? "127.0.0.1";
|
|
3249
|
-
if (options.config?.port !== void 0) {
|
|
3250
|
-
try {
|
|
3251
|
-
hermesResolvedPort = sanitizeHermesPort(Number(String(options.config.port)));
|
|
3252
|
-
} catch (err) {
|
|
3253
|
-
return {
|
|
3254
|
-
connectorId: options.connectorId,
|
|
3255
|
-
status: "error",
|
|
3256
|
-
message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
|
|
3257
|
-
};
|
|
3258
|
-
}
|
|
3259
|
-
}
|
|
3260
|
-
if (hermesResolvedPort === void 0) {
|
|
3261
|
-
hermesResolvedPort = hermesSavedPort ?? 4318;
|
|
3262
|
-
}
|
|
3263
|
-
if (options.config?.profile !== void 0) {
|
|
3264
|
-
try {
|
|
3265
|
-
hermesResolvedProfile = sanitizeHermesProfile(String(options.config.profile));
|
|
3266
|
-
} catch (err) {
|
|
3267
|
-
return {
|
|
3268
|
-
connectorId: options.connectorId,
|
|
3269
|
-
status: "error",
|
|
3270
|
-
message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
|
|
3271
|
-
};
|
|
3272
|
-
}
|
|
3273
|
-
}
|
|
3274
|
-
if (options.config?.host !== void 0) {
|
|
3275
|
-
try {
|
|
3276
|
-
hermesResolvedHost = sanitizeHermesHost(String(options.config.host));
|
|
3277
|
-
} catch (err) {
|
|
3278
|
-
return {
|
|
3279
|
-
connectorId: options.connectorId,
|
|
3280
|
-
status: "error",
|
|
3281
|
-
message: `Invalid Hermes config: ${err instanceof Error ? err.message : String(err)}`
|
|
3282
|
-
};
|
|
3283
|
-
}
|
|
3284
|
-
}
|
|
3285
|
-
}
|
|
3286
|
-
const nonHermesPriorTokenStore = options.connectorId !== "hermes" && manifest.requiresToken ? loadTokenStore() : null;
|
|
3287
|
-
let tokenEntry = null;
|
|
3288
|
-
if (options.connectorId === "hermes") {
|
|
3289
|
-
try {
|
|
3290
|
-
tokenEntry = buildTokenEntry(options.connectorId);
|
|
3291
|
-
} catch {
|
|
3292
|
-
}
|
|
3293
|
-
} else if (manifest.requiresToken) {
|
|
3294
|
-
try {
|
|
3295
|
-
tokenEntry = generateToken(options.connectorId);
|
|
3296
|
-
} catch {
|
|
3297
|
-
if (nonHermesPriorTokenStore !== null) {
|
|
3298
|
-
try {
|
|
3299
|
-
saveTokenStore(nonHermesPriorTokenStore);
|
|
3300
|
-
} catch {
|
|
3301
|
-
}
|
|
3302
|
-
}
|
|
3303
|
-
}
|
|
3304
|
-
}
|
|
3305
|
-
if (options.connectorId !== "hermes" && manifest.requiresToken && tokenEntry === null) {
|
|
3306
|
-
return {
|
|
3307
|
-
connectorId: options.connectorId,
|
|
3308
|
-
status: "error",
|
|
3309
|
-
message: `${manifest.name} install aborted: token generation failed. Run \`remnic token generate ${options.connectorId}\` to create the token, then reinstall.`
|
|
3310
|
-
};
|
|
3311
|
-
}
|
|
3312
|
-
const { token: _callerToken, ...safeUserConfig } = options.config ?? {};
|
|
3313
|
-
const resolvedConfig = {
|
|
3314
|
-
connectorId: options.connectorId,
|
|
3315
|
-
installedAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
3316
|
-
...safeUserConfig,
|
|
3317
|
-
// For hermes, always overlay the sanitized/coerced resolved values so that
|
|
3318
|
-
// the connector JSON always has a numeric port and validated profile/host.
|
|
3319
|
-
// This also ensures options.config string values (from --config=port=5555)
|
|
3320
|
-
// are replaced with their sanitized numeric equivalents (Fix 2 root cause).
|
|
3321
|
-
...hermesResolvedProfile !== void 0 ? {
|
|
3322
|
-
profile: hermesResolvedProfile,
|
|
3323
|
-
host: hermesResolvedHost,
|
|
3324
|
-
port: hermesResolvedPort
|
|
3325
|
-
} : {}
|
|
3326
|
-
};
|
|
3327
|
-
if (options.connectorId === "hermes") {
|
|
3328
|
-
const rawProfile = hermesResolvedProfile;
|
|
3329
|
-
const hermesHost = hermesResolvedHost;
|
|
3330
|
-
const hermesPort = hermesResolvedPort;
|
|
3331
|
-
let hermesProfile;
|
|
3332
|
-
try {
|
|
3333
|
-
hermesProfile = sanitizeHermesProfile(rawProfile);
|
|
3334
|
-
} catch (err) {
|
|
3335
|
-
return {
|
|
3336
|
-
connectorId: options.connectorId,
|
|
3337
|
-
status: "error",
|
|
3338
|
-
message: `Hermes install aborted: ${err instanceof Error ? err.message : String(err)}`
|
|
3339
|
-
};
|
|
3340
|
-
}
|
|
3341
|
-
if (!tokenEntry) {
|
|
3342
|
-
return {
|
|
3343
|
-
connectorId: options.connectorId,
|
|
3344
|
-
status: "error",
|
|
3345
|
-
message: "Hermes install aborted: token store unavailable. Run `remnic token generate hermes` then reinstall to complete setup."
|
|
3346
|
-
};
|
|
3347
|
-
}
|
|
3348
|
-
let yamlResult;
|
|
3349
|
-
try {
|
|
3350
|
-
yamlResult = upsertHermesConfig({
|
|
3351
|
-
profile: hermesProfile,
|
|
3352
|
-
host: hermesHost,
|
|
3353
|
-
port: hermesPort,
|
|
3354
|
-
token: tokenEntry.token
|
|
3355
|
-
});
|
|
3356
|
-
} catch (err) {
|
|
3357
|
-
return {
|
|
3358
|
-
connectorId: options.connectorId,
|
|
3359
|
-
status: "error",
|
|
3360
|
-
message: `Hermes install aborted: config.yaml write failed \u2014 ${err instanceof Error ? err.message : String(err)}`
|
|
3361
|
-
};
|
|
3362
|
-
}
|
|
3363
|
-
if (!yamlResult.updated) {
|
|
3364
|
-
return {
|
|
3365
|
-
connectorId: options.connectorId,
|
|
3366
|
-
status: "error",
|
|
3367
|
-
message: `Hermes install aborted: ${yamlResult.reason ?? "config.yaml not written"}. Create the Hermes profile directory first, then reinstall.`
|
|
3368
|
-
};
|
|
3369
|
-
}
|
|
3370
|
-
const priorTokenStore = loadTokenStore();
|
|
3371
|
-
let committed = false;
|
|
3372
|
-
try {
|
|
3373
|
-
commitTokenEntry(tokenEntry);
|
|
3374
|
-
committed = true;
|
|
3375
|
-
} catch (commitErr) {
|
|
3376
|
-
let tokensRolledBack = true;
|
|
3377
|
-
let tokensRollbackErrMsg = "";
|
|
3378
|
-
try {
|
|
3379
|
-
saveTokenStore(priorTokenStore);
|
|
3380
|
-
} catch (tokenRestoreErr) {
|
|
3381
|
-
tokensRolledBack = false;
|
|
3382
|
-
tokensRollbackErrMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
|
|
3383
|
-
}
|
|
3384
|
-
let yamlRolledBack = true;
|
|
3385
|
-
let yamlRollbackErrMsg = "";
|
|
3386
|
-
try {
|
|
3387
|
-
if (yamlResult.priorContent === null) {
|
|
3388
|
-
fs9.unlinkSync(yamlResult.configPath);
|
|
3389
|
-
} else if (typeof yamlResult.priorContent === "string") {
|
|
3390
|
-
writeSecretFileSync(yamlResult.configPath, yamlResult.priorContent);
|
|
3391
|
-
}
|
|
3392
|
-
} catch (yamlRestoreErr) {
|
|
3393
|
-
yamlRolledBack = false;
|
|
3394
|
-
yamlRollbackErrMsg = yamlRestoreErr instanceof Error ? yamlRestoreErr.message : String(yamlRestoreErr);
|
|
3395
|
-
}
|
|
3396
|
-
const commitErrMsg = commitErr instanceof Error ? commitErr.message : String(commitErr);
|
|
3397
|
-
let message;
|
|
3398
|
-
if (tokensRolledBack && yamlRolledBack) {
|
|
3399
|
-
message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. config.yaml and tokens.json restored to prior state. Resolve the tokens.json access issue, then reinstall.`;
|
|
3400
|
-
} else if (!yamlRolledBack && tokensRolledBack) {
|
|
3401
|
-
message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. tokens.json restored but config.yaml rollback ALSO failed (${yamlRollbackErrMsg}). Hermes daemon may be in an inconsistent state: config references a stale token. Manually inspect ${yamlResult.configPath} and reinstall.`;
|
|
3402
|
-
} else if (yamlRolledBack && !tokensRolledBack) {
|
|
3403
|
-
message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. config.yaml restored but tokens.json rollback ALSO failed (${tokensRollbackErrMsg}). Hermes daemon may be in an inconsistent state: tokens.json is corrupt or incomplete. Manually inspect ~/.remnic/tokens.json and reinstall.`;
|
|
3404
|
-
} else {
|
|
3405
|
-
message = `Hermes install failed during token commit \u2014 ${commitErrMsg}. BOTH rollbacks failed: config.yaml rollback failed (${yamlRollbackErrMsg}); tokens.json rollback failed (${tokensRollbackErrMsg}). Hermes daemon is likely in an inconsistent state. Manually inspect ${yamlResult.configPath} and ~/.remnic/tokens.json, then reinstall.`;
|
|
3406
|
-
}
|
|
3407
|
-
return {
|
|
3408
|
-
connectorId: options.connectorId,
|
|
3409
|
-
status: "error",
|
|
3410
|
-
message
|
|
3411
|
-
};
|
|
3412
|
-
}
|
|
3413
|
-
try {
|
|
3414
|
-
writeSecretFileSync(configPath, JSON.stringify(resolvedConfig, null, 2));
|
|
3415
|
-
} catch (writeErr) {
|
|
3416
|
-
let tokenRollbackFailed = false;
|
|
3417
|
-
let tokenRollbackMsg = "token store restored to pre-install snapshot";
|
|
3418
|
-
try {
|
|
3419
|
-
saveTokenStore(priorTokenStore);
|
|
3420
|
-
} catch (tokenRestoreErr) {
|
|
3421
|
-
tokenRollbackFailed = true;
|
|
3422
|
-
tokenRollbackMsg = `token rollback failed: ${tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr)}`;
|
|
3423
|
-
}
|
|
3424
|
-
let yamlRollbackMsg = "config.yaml restored";
|
|
3425
|
-
try {
|
|
3426
|
-
if (yamlResult.priorContent === null) {
|
|
3427
|
-
let unlinkSucceeded = false;
|
|
3428
|
-
let unlinkErr;
|
|
3429
|
-
try {
|
|
3430
|
-
fs9.unlinkSync(yamlResult.configPath);
|
|
3431
|
-
unlinkSucceeded = true;
|
|
3432
|
-
} catch (err) {
|
|
3433
|
-
unlinkErr = err;
|
|
3434
|
-
}
|
|
3435
|
-
if (unlinkSucceeded) {
|
|
3436
|
-
yamlRollbackMsg = "config.yaml removed (was newly created)";
|
|
3437
|
-
} else {
|
|
3438
|
-
const unlinkMsg = unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr);
|
|
3439
|
-
yamlRollbackMsg = `config.yaml rollback failed: could not remove newly-created file \u2014 ${unlinkMsg}`;
|
|
3440
|
-
}
|
|
3441
|
-
} else if (typeof yamlResult.priorContent === "string") {
|
|
3442
|
-
writeSecretFileSync(yamlResult.configPath, yamlResult.priorContent);
|
|
3443
|
-
yamlRollbackMsg = "config.yaml restored to prior content";
|
|
3444
|
-
}
|
|
3445
|
-
} catch (yamlRollbackErr) {
|
|
3446
|
-
yamlRollbackMsg = `config.yaml rollback failed: ${yamlRollbackErr instanceof Error ? yamlRollbackErr.message : String(yamlRollbackErr)}`;
|
|
3447
|
-
}
|
|
3448
|
-
const urgentSuffix = tokenRollbackFailed ? ` tokens.json may be in an inconsistent state \u2014 manually restore hermes token with 'remnic token generate hermes'.` : "";
|
|
3449
|
-
return {
|
|
3450
|
-
connectorId: options.connectorId,
|
|
3451
|
-
status: "error",
|
|
3452
|
-
message: `Hermes install aborted: connector config write failed \u2014 connector directory may not be writable. Rollback: ${tokenRollbackMsg}; ${yamlRollbackMsg}.${urgentSuffix} Resolve the permission issue, then reinstall.`
|
|
3453
|
-
};
|
|
3454
|
-
}
|
|
3455
|
-
const notes = [];
|
|
3456
|
-
notes.push(`Updated Hermes config: ${yamlResult.configPath}`);
|
|
3457
|
-
if (hermesProfile === "default") {
|
|
3458
|
-
const legacyDefaultConfigPath = hermesDefaultProfileConfigPath();
|
|
3459
|
-
if (!sameHermesConfigTarget(yamlResult.configPath, legacyDefaultConfigPath)) {
|
|
3460
|
-
try {
|
|
3461
|
-
const legacyDefaultCleanResult = removeHermesConfigFile(legacyDefaultConfigPath);
|
|
3462
|
-
if (legacyDefaultCleanResult.updated) {
|
|
3463
|
-
notes.push(`Cleaned stale remnic: block from legacy default profile: ${legacyDefaultConfigPath}`);
|
|
3464
|
-
}
|
|
3465
|
-
} catch {
|
|
3466
|
-
notes.push("Note: could not clean stale remnic: block from legacy default profile");
|
|
3467
|
-
}
|
|
3468
|
-
}
|
|
3469
|
-
}
|
|
3470
|
-
let oldProfileResolvesToDifferentFile = false;
|
|
3471
|
-
if (hermesSavedProfile !== void 0) {
|
|
3472
|
-
try {
|
|
3473
|
-
oldProfileResolvesToDifferentFile = !sameHermesConfigTarget(hermesConfigPath(hermesSavedProfile), hermesConfigPath(hermesProfile));
|
|
3474
|
-
} catch {
|
|
3475
|
-
oldProfileResolvesToDifferentFile = false;
|
|
3476
|
-
}
|
|
3477
|
-
}
|
|
3478
|
-
if (oldProfileResolvesToDifferentFile) {
|
|
3479
|
-
try {
|
|
3480
|
-
const oldCleanResult = removeHermesConfig({ profile: hermesSavedProfile });
|
|
3481
|
-
if (oldCleanResult.updated) {
|
|
3482
|
-
notes.push(`Cleaned stale remnic: block from previous profile: ${oldCleanResult.configPath}`);
|
|
3483
|
-
}
|
|
3484
|
-
} catch {
|
|
3485
|
-
notes.push(`Note: could not clean stale remnic: block from previous profile "${hermesSavedProfile}"`);
|
|
3486
|
-
}
|
|
3487
|
-
}
|
|
3488
|
-
if (committed && tokenEntry) {
|
|
3489
|
-
const daemonOk = checkDaemonHealth(hermesHost, hermesPort, tokenEntry.token);
|
|
3490
|
-
if (daemonOk) {
|
|
3491
|
-
notes.push("Daemon health check: OK");
|
|
3492
|
-
} else {
|
|
3493
|
-
notes.push(
|
|
3494
|
-
`Daemon not reachable at ${hermesHost}:${hermesPort} \u2014 start with: remnic daemon start`
|
|
3495
|
-
);
|
|
3496
|
-
}
|
|
3497
|
-
}
|
|
3498
|
-
const suffix = notes.length > 0 ? `
|
|
3499
|
-
${notes.join("\n ")}` : "";
|
|
3500
|
-
return {
|
|
3501
|
-
connectorId: options.connectorId,
|
|
3502
|
-
status: "installed",
|
|
3503
|
-
configPath,
|
|
3504
|
-
message: `Installed ${manifest.name} v${manifest.version}${suffix}`
|
|
3505
|
-
};
|
|
3506
|
-
}
|
|
3507
|
-
let extensionMessage = "";
|
|
3508
|
-
let extensionInstalled = false;
|
|
3509
|
-
let extensionHandle = null;
|
|
3510
|
-
if (options.connectorId === "codex-cli") {
|
|
3511
|
-
const coerced = coerceInstallExtension(resolvedConfig.installExtension);
|
|
3512
|
-
if (coerced !== void 0) {
|
|
3513
|
-
resolvedConfig.installExtension = coerced;
|
|
3514
|
-
}
|
|
3515
|
-
const shouldInstall = resolvedConfig.installExtension !== false;
|
|
3516
|
-
resolvedConfig.installExtension = shouldInstall;
|
|
3517
|
-
const codexHomeOverride = typeof resolvedConfig.codexHome === "string" && resolvedConfig.codexHome.length > 0 ? resolvedConfig.codexHome : null;
|
|
3518
|
-
const resolvedCodexHome = resolveCodexHome(codexHomeOverride);
|
|
3519
|
-
resolvedConfig.codexHome = resolvedCodexHome;
|
|
3520
|
-
if (shouldInstall) {
|
|
3521
|
-
try {
|
|
3522
|
-
const extensionSourceOverride = typeof resolvedConfig.extensionSourceDir === "string" && resolvedConfig.extensionSourceDir.length > 0 ? resolvedConfig.extensionSourceDir : null;
|
|
3523
|
-
const extResult = installCodexMemoryExtension({
|
|
3524
|
-
codexHome: resolvedCodexHome,
|
|
3525
|
-
sourceDir: extensionSourceOverride
|
|
3526
|
-
});
|
|
3527
|
-
extensionMessage = ` (memory extension: ${extResult.remnicExtensionDir})`;
|
|
3528
|
-
extensionInstalled = true;
|
|
3529
|
-
extensionHandle = extResult;
|
|
3530
|
-
} catch (err) {
|
|
3531
|
-
const errMsg = err instanceof Error ? err.message : "unknown error";
|
|
3532
|
-
let extensionErrTokenRolledBack = false;
|
|
3533
|
-
let extensionErrTokenRollbackMsg = "";
|
|
3534
|
-
if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
|
|
3535
|
-
try {
|
|
3536
|
-
saveTokenStore(nonHermesPriorTokenStore);
|
|
3537
|
-
extensionErrTokenRolledBack = true;
|
|
3538
|
-
} catch (tokenRestoreErr) {
|
|
3539
|
-
extensionErrTokenRolledBack = false;
|
|
3540
|
-
extensionErrTokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
|
|
3541
|
-
}
|
|
3542
|
-
}
|
|
3543
|
-
const tokenRollbackSuffix = manifest.requiresToken ? extensionErrTokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${extensionErrTokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
|
|
3544
|
-
return {
|
|
3545
|
-
connectorId: options.connectorId,
|
|
3546
|
-
status: "error",
|
|
3547
|
-
message: `Memory extension install failed \u2014 ${errMsg}.${tokenRollbackSuffix} Resolve the issue, then reinstall.`
|
|
3548
|
-
};
|
|
3549
|
-
}
|
|
3550
|
-
} else {
|
|
3551
|
-
extensionMessage = " (memory extension: skipped via installExtension=false)";
|
|
3552
|
-
}
|
|
3553
|
-
}
|
|
3554
|
-
let weCloneProxyHandleRollback = null;
|
|
3555
|
-
if (options.connectorId === "weclone") {
|
|
3556
|
-
try {
|
|
3557
|
-
let proxyConfigPath = null;
|
|
3558
|
-
if (existing && fs9.existsSync(configPath)) {
|
|
3559
|
-
try {
|
|
3560
|
-
const savedRegistryConfig = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3561
|
-
if (typeof savedRegistryConfig.proxyConfigPath === "string" && savedRegistryConfig.proxyConfigPath.length > 0) {
|
|
3562
|
-
proxyConfigPath = savedRegistryConfig.proxyConfigPath;
|
|
3563
|
-
}
|
|
3564
|
-
} catch {
|
|
3565
|
-
}
|
|
3566
|
-
}
|
|
3567
|
-
if (proxyConfigPath === null) {
|
|
3568
|
-
proxyConfigPath = resolveWeCloneProxyConfigPath();
|
|
3569
|
-
}
|
|
3570
|
-
const prior = readWeCloneProxyConfigIfExists(proxyConfigPath);
|
|
3571
|
-
const proxyConfig = buildWeCloneProxyConfig({
|
|
3572
|
-
userConfig: safeUserConfig,
|
|
3573
|
-
priorConfig: prior ? safeParseJson(prior) : null,
|
|
3574
|
-
authToken: tokenEntry?.token
|
|
3575
|
-
});
|
|
3576
|
-
fs9.mkdirSync(path13.dirname(proxyConfigPath), { recursive: true });
|
|
3577
|
-
weCloneProxyHandleRollback = () => {
|
|
3578
|
-
try {
|
|
3579
|
-
if (prior === null) {
|
|
3580
|
-
if (fs9.existsSync(proxyConfigPath)) {
|
|
3581
|
-
fs9.unlinkSync(proxyConfigPath);
|
|
3582
|
-
}
|
|
3583
|
-
} else {
|
|
3584
|
-
writeSecretFileSync(proxyConfigPath, prior);
|
|
3585
|
-
}
|
|
3586
|
-
} catch {
|
|
3587
|
-
}
|
|
3588
|
-
};
|
|
3589
|
-
try {
|
|
3590
|
-
writeSecretFileSync(
|
|
3591
|
-
proxyConfigPath,
|
|
3592
|
-
JSON.stringify(proxyConfig, null, 2)
|
|
3593
|
-
);
|
|
3594
|
-
} catch (writeErr) {
|
|
3595
|
-
try {
|
|
3596
|
-
weCloneProxyHandleRollback();
|
|
3597
|
-
} catch {
|
|
3598
|
-
}
|
|
3599
|
-
weCloneProxyHandleRollback = null;
|
|
3600
|
-
throw writeErr;
|
|
3601
|
-
}
|
|
3602
|
-
resolvedConfig.proxyConfigPath = proxyConfigPath;
|
|
3603
|
-
resolvedConfig.proxyPort = proxyConfig.proxyPort;
|
|
3604
|
-
resolvedConfig.wecloneApiUrl = proxyConfig.wecloneApiUrl;
|
|
3605
|
-
resolvedConfig.remnicDaemonUrl = proxyConfig.remnicDaemonUrl;
|
|
3606
|
-
resolvedConfig.sessionStrategy = proxyConfig.sessionStrategy;
|
|
3607
|
-
} catch (weCloneErr) {
|
|
3608
|
-
let tokenRolledBack = false;
|
|
3609
|
-
let tokenRollbackMsg = "";
|
|
3610
|
-
if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
|
|
3611
|
-
try {
|
|
3612
|
-
saveTokenStore(nonHermesPriorTokenStore);
|
|
3613
|
-
tokenRolledBack = true;
|
|
3614
|
-
} catch (tokenRestoreErr) {
|
|
3615
|
-
tokenRolledBack = false;
|
|
3616
|
-
tokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
|
|
3617
|
-
}
|
|
3618
|
-
}
|
|
3619
|
-
const tokenSuffix = manifest.requiresToken && tokenEntry !== null ? tokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${tokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
|
|
3620
|
-
return {
|
|
3621
|
-
connectorId: options.connectorId,
|
|
3622
|
-
status: "error",
|
|
3623
|
-
message: `WeClone install aborted: proxy config write failed \u2014 ${weCloneErr instanceof Error ? weCloneErr.message : String(weCloneErr)}.${tokenSuffix} Resolve the write permission issue on ~/.remnic/connectors/, then reinstall.`
|
|
3624
|
-
};
|
|
3625
|
-
}
|
|
3626
|
-
}
|
|
3627
|
-
const INTERNAL_KEYS_DENYLIST = [
|
|
3628
|
-
"extensionSourceDir"
|
|
3629
|
-
// test-only override for the plugin-codex source path
|
|
3630
|
-
];
|
|
3631
|
-
for (const key of INTERNAL_KEYS_DENYLIST) {
|
|
3632
|
-
delete resolvedConfig[key];
|
|
3633
|
-
}
|
|
3634
|
-
try {
|
|
3635
|
-
writeSecretFileSync(configPath, JSON.stringify(resolvedConfig, null, 2));
|
|
3636
|
-
} catch (writeErr) {
|
|
3637
|
-
let configWriteTokenRolledBack = false;
|
|
3638
|
-
let configWriteTokenRollbackMsg = "";
|
|
3639
|
-
if (tokenEntry !== null && nonHermesPriorTokenStore !== null) {
|
|
3640
|
-
try {
|
|
3641
|
-
saveTokenStore(nonHermesPriorTokenStore);
|
|
3642
|
-
configWriteTokenRolledBack = true;
|
|
3643
|
-
} catch (tokenRestoreErr) {
|
|
3644
|
-
configWriteTokenRolledBack = false;
|
|
3645
|
-
configWriteTokenRollbackMsg = tokenRestoreErr instanceof Error ? tokenRestoreErr.message : String(tokenRestoreErr);
|
|
3646
|
-
}
|
|
3647
|
-
}
|
|
3648
|
-
if (extensionInstalled && extensionHandle !== null) {
|
|
3649
|
-
try {
|
|
3650
|
-
extensionHandle.rollback();
|
|
3651
|
-
} catch {
|
|
3652
|
-
console.warn(
|
|
3653
|
-
"[remnic/connectors] installConnector: config write failed and extension rollback also failed \u2014 manual cleanup of memories_extensions/remnic may be required."
|
|
3654
|
-
);
|
|
3655
|
-
}
|
|
3656
|
-
}
|
|
3657
|
-
if (weCloneProxyHandleRollback !== null) {
|
|
3658
|
-
try {
|
|
3659
|
-
weCloneProxyHandleRollback();
|
|
3660
|
-
} catch {
|
|
3661
|
-
}
|
|
3662
|
-
}
|
|
3663
|
-
const configWriteTokenSuffix = manifest.requiresToken && tokenEntry !== null ? configWriteTokenRolledBack ? " Token has been rolled back." : ` Token rollback FAILED (${configWriteTokenRollbackMsg}) \u2014 tokens.json may contain an orphaned entry. Manually inspect ~/.remnic/tokens.json and reinstall.` : "";
|
|
3664
|
-
return {
|
|
3665
|
-
connectorId: options.connectorId,
|
|
3666
|
-
status: "error",
|
|
3667
|
-
message: `${manifest.name} install aborted: connector config write failed \u2014 ${writeErr instanceof Error ? writeErr.message : String(writeErr)}.${configWriteTokenSuffix} Resolve the write permission issue, then reinstall.`
|
|
3668
|
-
};
|
|
3669
|
-
}
|
|
3670
|
-
if (extensionInstalled && extensionHandle !== null) {
|
|
3671
|
-
extensionHandle.commit();
|
|
3672
|
-
}
|
|
3673
|
-
return {
|
|
3674
|
-
connectorId: options.connectorId,
|
|
3675
|
-
status: "installed",
|
|
3676
|
-
configPath,
|
|
3677
|
-
message: `Installed ${manifest.name} v${manifest.version}${extensionMessage}`
|
|
3678
|
-
};
|
|
3679
|
-
}
|
|
3680
|
-
function removeConnector(connectorId) {
|
|
3681
|
-
const configDir = getConnectorsDir();
|
|
3682
|
-
const configPath = path13.join(configDir, `${connectorId}.json`);
|
|
3683
|
-
let codexHomeOverride = null;
|
|
3684
|
-
let savedInstallExtension = void 0;
|
|
3685
|
-
let configParsed = false;
|
|
3686
|
-
if (connectorId === "codex-cli" && fs9.existsSync(configPath)) {
|
|
3687
|
-
try {
|
|
3688
|
-
const parsed = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3689
|
-
configParsed = true;
|
|
3690
|
-
if (typeof parsed.codexHome === "string" && parsed.codexHome.length > 0) {
|
|
3691
|
-
codexHomeOverride = parsed.codexHome;
|
|
3692
|
-
}
|
|
3693
|
-
const coerced = coerceInstallExtension(parsed.installExtension);
|
|
3694
|
-
if (coerced !== void 0) {
|
|
3695
|
-
savedInstallExtension = coerced;
|
|
3696
|
-
}
|
|
3697
|
-
} catch {
|
|
3698
|
-
console.debug(
|
|
3699
|
-
"[remnic/connectors] removeConnector: codex-cli.json parse failed \u2014 skipping extension removal to avoid touching unverified paths"
|
|
3700
|
-
);
|
|
3701
|
-
}
|
|
3702
|
-
}
|
|
3703
|
-
if (!fs9.existsSync(configPath)) {
|
|
3704
|
-
let staleTokenRevoked = false;
|
|
3705
|
-
try {
|
|
3706
|
-
staleTokenRevoked = revokeToken(connectorId);
|
|
3707
|
-
} catch {
|
|
3708
|
-
}
|
|
3709
|
-
const message = staleTokenRevoked ? `${connectorId} is not installed. Removed stale token entry for ${connectorId}.` : "Not installed";
|
|
3710
|
-
return {
|
|
3711
|
-
connectorId,
|
|
3712
|
-
configPath,
|
|
3713
|
-
status: "not_found",
|
|
3714
|
-
message
|
|
3715
|
-
};
|
|
3716
|
-
}
|
|
3717
|
-
let storedProfile = "default";
|
|
3718
|
-
if (connectorId === "hermes") {
|
|
3719
|
-
try {
|
|
3720
|
-
const stored = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3721
|
-
if (typeof stored?.profile === "string") storedProfile = stored.profile;
|
|
3722
|
-
} catch {
|
|
3723
|
-
}
|
|
3724
|
-
}
|
|
3725
|
-
let weCloneProxyConfigPath = null;
|
|
3726
|
-
let weCloneRegistryParseFailed = false;
|
|
3727
|
-
if (connectorId === "weclone") {
|
|
3728
|
-
try {
|
|
3729
|
-
const stored = JSON.parse(fs9.readFileSync(configPath, "utf8"));
|
|
3730
|
-
if (typeof stored.proxyConfigPath === "string" && stored.proxyConfigPath.length > 0) {
|
|
3731
|
-
weCloneProxyConfigPath = stored.proxyConfigPath;
|
|
3732
|
-
}
|
|
3733
|
-
} catch {
|
|
3734
|
-
weCloneRegistryParseFailed = true;
|
|
3735
|
-
}
|
|
3736
|
-
if (weCloneProxyConfigPath === null && !weCloneRegistryParseFailed) {
|
|
3737
|
-
try {
|
|
3738
|
-
weCloneProxyConfigPath = resolveWeCloneProxyConfigPath();
|
|
3739
|
-
} catch {
|
|
3740
|
-
}
|
|
3741
|
-
}
|
|
3742
|
-
}
|
|
3743
|
-
if (connectorId === "weclone" && weCloneRegistryParseFailed) {
|
|
3744
|
-
console.warn(
|
|
3745
|
-
"[remnic/connectors] removeConnector: weclone.json is malformed \u2014 aborting removal to preserve provenance. Fix or delete " + configPath + " manually and retry."
|
|
3746
|
-
);
|
|
3747
|
-
return {
|
|
3748
|
-
connectorId,
|
|
3749
|
-
configPath,
|
|
3750
|
-
message: "Removal aborted: weclone.json is malformed. Registry config left in place for inspection; proxy config NOT removed.",
|
|
3751
|
-
status: "skipped",
|
|
3752
|
-
reason: "config-parse-failed"
|
|
3753
|
-
};
|
|
3754
|
-
}
|
|
3755
|
-
if (connectorId === "codex-cli" && fs9.existsSync(configPath) && !configParsed) {
|
|
3756
|
-
console.warn(
|
|
3757
|
-
"[remnic/connectors] removeConnector: codex-cli.json is malformed \u2014 aborting removal to preserve provenance. Fix or delete " + configPath + " manually and retry."
|
|
3758
|
-
);
|
|
3759
|
-
return {
|
|
3760
|
-
connectorId,
|
|
3761
|
-
configPath,
|
|
3762
|
-
message: "Removal aborted: codex-cli.json is malformed. Config file left in place for inspection.",
|
|
3763
|
-
status: "skipped",
|
|
3764
|
-
reason: "config-parse-failed"
|
|
3765
|
-
};
|
|
3766
|
-
}
|
|
3767
|
-
let extensionMessage = "";
|
|
3768
|
-
if (connectorId === "codex-cli") {
|
|
3769
|
-
if (savedInstallExtension === false) {
|
|
3770
|
-
extensionMessage = " (memory extension: skipped \u2014 installExtension=false)";
|
|
3771
|
-
} else if (savedInstallExtension !== true || codexHomeOverride === null) {
|
|
3772
|
-
extensionMessage = " (memory extension: skipped \u2014 no install provenance in saved config)";
|
|
3773
|
-
} else {
|
|
3774
|
-
const extResult = removeCodexMemoryExtension({ codexHome: codexHomeOverride });
|
|
3775
|
-
extensionMessage = extResult.removed ? ` (memory extension removed: ${extResult.remnicExtensionDir})` : " (no memory extension present)";
|
|
3776
|
-
}
|
|
3777
|
-
}
|
|
3778
|
-
try {
|
|
3779
|
-
fs9.unlinkSync(configPath);
|
|
3780
|
-
} catch (unlinkErr) {
|
|
3781
|
-
const sanitizedErr = unlinkErr instanceof Error ? unlinkErr.message : String(unlinkErr);
|
|
3782
|
-
return {
|
|
3783
|
-
connectorId,
|
|
3784
|
-
configPath,
|
|
3785
|
-
status: "error",
|
|
3786
|
-
message: `${connectorId} remove aborted: could not delete connector file (${sanitizedErr}). Token and any connector-specific state were not modified.`
|
|
3787
|
-
};
|
|
3788
|
-
}
|
|
3789
|
-
const notes = [];
|
|
3790
|
-
let tokenRevoked = true;
|
|
3791
|
-
try {
|
|
3792
|
-
revokeToken(connectorId);
|
|
3793
|
-
} catch (revokeErr) {
|
|
3794
|
-
tokenRevoked = false;
|
|
3795
|
-
const revokeMsg = revokeErr instanceof Error ? revokeErr.message : String(revokeErr);
|
|
3796
|
-
notes.push(`Warning: token revocation failed \u2014 ${revokeMsg}. The token for ${connectorId} may still be present in tokens.json.`);
|
|
3797
|
-
}
|
|
3798
|
-
let weCloneProxyDeleteFailed = null;
|
|
3799
|
-
if (connectorId === "weclone") {
|
|
3800
|
-
if (weCloneProxyConfigPath === null) {
|
|
3801
|
-
notes.push(
|
|
3802
|
-
"WeClone proxy config cleanup skipped: no persisted path found in saved config (likely a legacy install predating proxyConfigPath provenance)."
|
|
3803
|
-
);
|
|
3804
|
-
} else {
|
|
3805
|
-
const expectedSuffix = path13.join("connectors", "weclone.json");
|
|
3806
|
-
const isSafePath = path13.isAbsolute(weCloneProxyConfigPath) && weCloneProxyConfigPath.endsWith(expectedSuffix);
|
|
3807
|
-
if (!isSafePath) {
|
|
3808
|
-
weCloneProxyDeleteFailed = `Proxy config path ${JSON.stringify(weCloneProxyConfigPath)} failed safety validation (must be absolute and end with "${expectedSuffix}"). Refusing to delete \u2014 remove the file manually if it exists.`;
|
|
3809
|
-
} else {
|
|
3810
|
-
try {
|
|
3811
|
-
if (fs9.existsSync(weCloneProxyConfigPath)) {
|
|
3812
|
-
fs9.unlinkSync(weCloneProxyConfigPath);
|
|
3813
|
-
notes.push(`Removed WeClone proxy config: ${weCloneProxyConfigPath}`);
|
|
3814
|
-
}
|
|
3815
|
-
} catch (err) {
|
|
3816
|
-
weCloneProxyDeleteFailed = err instanceof Error ? err.message : String(err);
|
|
3817
|
-
}
|
|
3818
|
-
}
|
|
3819
|
-
}
|
|
3820
|
-
}
|
|
3821
|
-
if (weCloneProxyDeleteFailed !== null && weCloneProxyConfigPath !== null) {
|
|
3822
|
-
const tokenStatus = tokenRevoked ? "the registry config was deleted and the token was revoked" : "the registry config was deleted but TOKEN REVOCATION ALSO FAILED \u2014 inspect ~/.remnic/tokens.json and revoke manually";
|
|
3823
|
-
return {
|
|
3824
|
-
connectorId,
|
|
3825
|
-
configPath,
|
|
3826
|
-
status: "error",
|
|
3827
|
-
message: `WeClone remove partially succeeded: ${tokenStatus}, but the proxy config at ${weCloneProxyConfigPath} could not be deleted (${weCloneProxyDeleteFailed}). Manually remove that file \u2014 it may still contain a Remnic daemon bearer token.`
|
|
3828
|
-
};
|
|
3829
|
-
}
|
|
3830
|
-
if (connectorId === "hermes") {
|
|
3831
|
-
try {
|
|
3832
|
-
const yamlResult = removeHermesConfig({ profile: storedProfile });
|
|
3833
|
-
if (yamlResult.updated) {
|
|
3834
|
-
notes.push(`Removed remnic: block from Hermes config: ${yamlResult.configPath}`);
|
|
3835
|
-
} else if (yamlResult.reason?.startsWith("Hermes config cleanup partially failed:")) {
|
|
3836
|
-
const tokenStatus = tokenRevoked ? "the connector registry config was deleted and the token was revoked" : "the connector registry config was deleted but TOKEN REVOCATION ALSO FAILED \u2014 inspect ~/.remnic/tokens.json and revoke manually";
|
|
3837
|
-
return {
|
|
3838
|
-
connectorId,
|
|
3839
|
-
configPath,
|
|
3840
|
-
status: "error",
|
|
3841
|
-
message: `Hermes remove partially succeeded: ${tokenStatus}, but ${yamlResult.reason}. Updated paths: ${yamlResult.configPath}. Manually remove any stale remnic: block and token material from the failed Hermes config path.`
|
|
3842
|
-
};
|
|
3843
|
-
} else if (yamlResult.skipped) {
|
|
3844
|
-
notes.push(`Hermes config cleanup skipped: ${yamlResult.reason}`);
|
|
3845
|
-
}
|
|
3846
|
-
} catch (err) {
|
|
3847
|
-
notes.push(
|
|
3848
|
-
`Hermes config cleanup skipped: ${err instanceof Error ? err.message : String(err)}`
|
|
3849
|
-
);
|
|
3850
|
-
}
|
|
3851
|
-
}
|
|
3852
|
-
const suffix = notes.length > 0 ? `
|
|
3853
|
-
${notes.join("\n ")}` : "";
|
|
3854
|
-
return {
|
|
3855
|
-
connectorId,
|
|
3856
|
-
configPath,
|
|
3857
|
-
status: "removed",
|
|
3858
|
-
message: `Removed${extensionMessage}${suffix}`
|
|
3859
|
-
};
|
|
3860
|
-
}
|
|
3861
|
-
function sanitizeHermesProfile(profile) {
|
|
3862
|
-
if (typeof profile !== "string" || profile.length === 0) {
|
|
3863
|
-
throw new Error("Hermes profile name must be a non-empty string");
|
|
3864
|
-
}
|
|
3865
|
-
if (!/^[A-Za-z0-9][A-Za-z0-9._-]*$/.test(profile)) {
|
|
3866
|
-
throw new Error(
|
|
3867
|
-
`Invalid Hermes profile name: ${JSON.stringify(profile)} \u2014 must match [A-Za-z0-9][A-Za-z0-9._-]*`
|
|
3868
|
-
);
|
|
3869
|
-
}
|
|
3870
|
-
if (profile.includes("..")) {
|
|
3871
|
-
throw new Error(`Invalid Hermes profile name: ${JSON.stringify(profile)} \u2014 must not contain ".."`);
|
|
3872
|
-
}
|
|
3873
|
-
return profile;
|
|
3874
|
-
}
|
|
3875
|
-
function hermesConfigPath(profile) {
|
|
3876
|
-
const safeProfile = sanitizeHermesProfile(profile);
|
|
3877
|
-
const hermesRoot = path13.resolve(resolveHomeDir(), ".hermes");
|
|
3878
|
-
const rootConfigPath = path13.join(hermesRoot, "config.yaml");
|
|
3879
|
-
const profilesRoot = path13.join(hermesRoot, "profiles");
|
|
3880
|
-
if (safeProfile === "default") {
|
|
3881
|
-
const defaultProfileDir = path13.join(profilesRoot, safeProfile);
|
|
3882
|
-
if (isFile(rootConfigPath) || !fs9.existsSync(rootConfigPath) && !isDirectory(defaultProfileDir)) {
|
|
3883
|
-
return rootConfigPath;
|
|
3884
|
-
}
|
|
3885
|
-
}
|
|
3886
|
-
const cfgPath = path13.resolve(profilesRoot, safeProfile, "config.yaml");
|
|
3887
|
-
const rel = path13.relative(profilesRoot, cfgPath);
|
|
3888
|
-
if (rel.startsWith("..") || path13.isAbsolute(rel)) {
|
|
3889
|
-
throw new Error(
|
|
3890
|
-
`Invalid Hermes profile path: resolved outside ${profilesRoot}`
|
|
3891
|
-
);
|
|
3892
|
-
}
|
|
3893
|
-
return cfgPath;
|
|
3894
|
-
}
|
|
3895
|
-
function isDirectory(filePath) {
|
|
3896
|
-
try {
|
|
3897
|
-
return fs9.statSync(filePath).isDirectory();
|
|
3898
|
-
} catch {
|
|
3899
|
-
return false;
|
|
3900
|
-
}
|
|
3901
|
-
}
|
|
3902
|
-
function isFile(filePath) {
|
|
3903
|
-
try {
|
|
3904
|
-
return fs9.statSync(filePath).isFile();
|
|
3905
|
-
} catch {
|
|
3906
|
-
return false;
|
|
3907
|
-
}
|
|
3908
|
-
}
|
|
3909
|
-
function hermesConfigTarget(filePath) {
|
|
3910
|
-
try {
|
|
3911
|
-
return fs9.realpathSync.native(filePath);
|
|
3912
|
-
} catch {
|
|
3913
|
-
return path13.resolve(filePath);
|
|
3914
|
-
}
|
|
3915
|
-
}
|
|
3916
|
-
function sameHermesConfigTarget(leftPath, rightPath) {
|
|
3917
|
-
return hermesConfigTarget(leftPath) === hermesConfigTarget(rightPath);
|
|
3918
|
-
}
|
|
3919
|
-
function hermesDefaultProfileConfigPath() {
|
|
3920
|
-
const hermesRoot = path13.resolve(resolveHomeDir(), ".hermes");
|
|
3921
|
-
return path13.join(hermesRoot, "profiles", "default", "config.yaml");
|
|
3922
|
-
}
|
|
3923
|
-
function hermesConfigCleanupPaths(profile) {
|
|
3924
|
-
const cfgPath = hermesConfigPath(profile);
|
|
3925
|
-
const safeProfile = sanitizeHermesProfile(profile);
|
|
3926
|
-
if (safeProfile !== "default") {
|
|
3927
|
-
return [cfgPath];
|
|
3928
|
-
}
|
|
3929
|
-
return [.../* @__PURE__ */ new Set([cfgPath, hermesDefaultProfileConfigPath()])];
|
|
3930
|
-
}
|
|
3931
|
-
function sanitizeHermesHost(host) {
|
|
3932
|
-
if (typeof host !== "string" || host.length === 0) {
|
|
3933
|
-
throw new Error("Hermes host must be a non-empty string");
|
|
3934
|
-
}
|
|
3935
|
-
if (host.length > 253) {
|
|
3936
|
-
throw new Error(`Hermes host too long (max 253 chars): ${JSON.stringify(host.slice(0, 32))}\u2026`);
|
|
3937
|
-
}
|
|
3938
|
-
if (host.startsWith("[")) {
|
|
3939
|
-
if (!host.endsWith("]")) {
|
|
3940
|
-
throw new Error(
|
|
3941
|
-
`Invalid Hermes host: ${JSON.stringify(host)} \u2014 unbalanced brackets in IPv6 literal`
|
|
3942
|
-
);
|
|
3943
|
-
}
|
|
3944
|
-
const inner = host.slice(1, -1);
|
|
3945
|
-
if (inner.length === 0 || !/^[0-9A-Fa-f:]+$/.test(inner)) {
|
|
3946
|
-
throw new Error(
|
|
3947
|
-
`Invalid Hermes host: ${JSON.stringify(host)} \u2014 bracketed IPv6 literal must contain only hex digits and colons`
|
|
3948
|
-
);
|
|
3949
|
-
}
|
|
3950
|
-
return host;
|
|
3951
|
-
}
|
|
3952
|
-
if (host.includes(":")) {
|
|
3953
|
-
throw new Error(
|
|
3954
|
-
`Invalid Hermes host: ${JSON.stringify(host)} \u2014 host must not include a port; supply the port separately with --config port=<n>`
|
|
3955
|
-
);
|
|
3956
|
-
}
|
|
3957
|
-
if (!/^[A-Za-z0-9._\-]+$/.test(host)) {
|
|
3958
|
-
throw new Error(
|
|
3959
|
-
`Invalid Hermes host: ${JSON.stringify(host)} \u2014 must be a plain hostname or IP literal`
|
|
3960
|
-
);
|
|
3961
|
-
}
|
|
3962
|
-
return host;
|
|
3963
|
-
}
|
|
3964
|
-
function sanitizeHermesPort(port) {
|
|
3965
|
-
const numeric = Number(port);
|
|
3966
|
-
if (!Number.isInteger(numeric)) {
|
|
3967
|
-
throw new Error(
|
|
3968
|
-
`Invalid Hermes port "${port}": must be a positive integer`
|
|
3969
|
-
);
|
|
3970
|
-
}
|
|
3971
|
-
if (numeric < 1 || numeric > 65535) {
|
|
3972
|
-
throw new Error(`Invalid Hermes port: ${JSON.stringify(port)} \u2014 must be an integer in [1, 65535]`);
|
|
3973
|
-
}
|
|
3974
|
-
return numeric;
|
|
3975
|
-
}
|
|
3976
|
-
function writeSecretFileSync(filePath, data) {
|
|
3977
|
-
fs9.writeFileSync(filePath, data, { mode: 384 });
|
|
3978
|
-
try {
|
|
3979
|
-
fs9.chmodSync(filePath, 384);
|
|
3980
|
-
} catch {
|
|
3981
|
-
}
|
|
3982
|
-
}
|
|
3983
|
-
function upsertHermesConfig(opts) {
|
|
3984
|
-
const cfgPath = hermesConfigPath(opts.profile);
|
|
3985
|
-
const profileDir = path13.dirname(cfgPath);
|
|
3986
|
-
const safeHost = sanitizeHermesHost(opts.host);
|
|
3987
|
-
const safePort = sanitizeHermesPort(opts.port);
|
|
3988
|
-
if (!/^[A-Za-z0-9_]+$/.test(opts.token)) {
|
|
3989
|
-
throw new Error("Invalid Hermes token: contains non-alphanumeric characters");
|
|
3990
|
-
}
|
|
3991
|
-
if (!isDirectory(profileDir)) {
|
|
3992
|
-
return {
|
|
3993
|
-
updated: false,
|
|
3994
|
-
skipped: true,
|
|
3995
|
-
reason: `Hermes profile directory not found: ${profileDir}`,
|
|
3996
|
-
configPath: cfgPath
|
|
3997
|
-
};
|
|
3998
|
-
}
|
|
3999
|
-
const block = [
|
|
4000
|
-
"remnic:",
|
|
4001
|
-
` host: "${safeHost}"`,
|
|
4002
|
-
` port: ${safePort}`,
|
|
4003
|
-
` token: "${opts.token}"`
|
|
4004
|
-
].join("\n");
|
|
4005
|
-
if (!fs9.existsSync(cfgPath)) {
|
|
4006
|
-
writeSecretFileSync(cfgPath, block + "\n");
|
|
4007
|
-
return { updated: true, skipped: false, configPath: cfgPath, priorContent: null };
|
|
4008
|
-
}
|
|
4009
|
-
const raw = fs9.readFileSync(cfgPath, "utf8");
|
|
4010
|
-
const hasRemnicBlock = /^remnic:/m.test(raw);
|
|
4011
|
-
if (!hasRemnicBlock) {
|
|
4012
|
-
const separator = raw.endsWith("\n") ? "\n" : "\n\n";
|
|
4013
|
-
writeSecretFileSync(cfgPath, raw + separator + block + "\n");
|
|
4014
|
-
return { updated: true, skipped: false, configPath: cfgPath, priorContent: raw };
|
|
4015
|
-
}
|
|
4016
|
-
const splitLines = raw.split("\n");
|
|
4017
|
-
if (splitLines.length > 0 && splitLines[splitLines.length - 1] === "") {
|
|
4018
|
-
splitLines.pop();
|
|
4019
|
-
}
|
|
4020
|
-
const lines = splitLines;
|
|
4021
|
-
const newLines = [];
|
|
4022
|
-
let inRemnicBlock = false;
|
|
4023
|
-
let blockWritten = false;
|
|
4024
|
-
const written = { host: false, port: false, token: false };
|
|
4025
|
-
for (let i = 0; i < lines.length; i++) {
|
|
4026
|
-
const line = lines[i];
|
|
4027
|
-
if (/^remnic:/.test(line)) {
|
|
4028
|
-
inRemnicBlock = true;
|
|
4029
|
-
newLines.push(line);
|
|
4030
|
-
continue;
|
|
4031
|
-
}
|
|
4032
|
-
if (inRemnicBlock) {
|
|
4033
|
-
if (line.length > 0 && !/^\s/.test(line)) {
|
|
4034
|
-
if (!written.host) newLines.push(` host: "${safeHost}"`);
|
|
4035
|
-
if (!written.port) newLines.push(` port: ${safePort}`);
|
|
4036
|
-
if (!written.token) newLines.push(` token: "${opts.token}"`);
|
|
4037
|
-
blockWritten = true;
|
|
4038
|
-
inRemnicBlock = false;
|
|
4039
|
-
newLines.push(line);
|
|
4040
|
-
continue;
|
|
4041
|
-
}
|
|
4042
|
-
if (/^\s+host:/.test(line)) {
|
|
4043
|
-
newLines.push(` host: "${safeHost}"`);
|
|
4044
|
-
written.host = true;
|
|
4045
|
-
} else if (/^\s+port:/.test(line)) {
|
|
4046
|
-
newLines.push(` port: ${safePort}`);
|
|
4047
|
-
written.port = true;
|
|
4048
|
-
} else if (/^\s+token:/.test(line)) {
|
|
4049
|
-
newLines.push(` token: "${opts.token}"`);
|
|
4050
|
-
written.token = true;
|
|
4051
|
-
} else {
|
|
4052
|
-
newLines.push(line);
|
|
4053
|
-
}
|
|
4054
|
-
continue;
|
|
4055
|
-
}
|
|
4056
|
-
newLines.push(line);
|
|
4057
|
-
}
|
|
4058
|
-
if (inRemnicBlock && !blockWritten) {
|
|
4059
|
-
if (!written.host) newLines.push(` host: "${safeHost}"`);
|
|
4060
|
-
if (!written.port) newLines.push(` port: ${safePort}`);
|
|
4061
|
-
if (!written.token) newLines.push(` token: "${opts.token}"`);
|
|
4062
|
-
}
|
|
4063
|
-
writeSecretFileSync(cfgPath, newLines.join("\n") + "\n");
|
|
4064
|
-
return { updated: true, skipped: false, configPath: cfgPath, priorContent: raw };
|
|
4065
|
-
}
|
|
4066
|
-
function removeHermesConfig(opts) {
|
|
4067
|
-
const cfgPaths = hermesConfigCleanupPaths(opts.profile);
|
|
4068
|
-
const results = cfgPaths.map((cfgPath) => {
|
|
4069
|
-
try {
|
|
4070
|
-
return removeHermesConfigFile(cfgPath);
|
|
4071
|
-
} catch (err) {
|
|
4072
|
-
return {
|
|
4073
|
-
updated: false,
|
|
4074
|
-
skipped: true,
|
|
4075
|
-
reason: `Hermes config cleanup failed: ${err instanceof Error ? err.message : String(err)}`,
|
|
4076
|
-
configPath: cfgPath
|
|
4077
|
-
};
|
|
4078
|
-
}
|
|
4079
|
-
});
|
|
4080
|
-
const updated = results.filter((result) => result.updated);
|
|
4081
|
-
const cleanupFailures = results.filter((result) => result.reason?.startsWith("Hermes config cleanup failed:"));
|
|
4082
|
-
if (updated.length > 0) {
|
|
4083
|
-
const updatedPaths = updated.map((result) => result.configPath).join(", ");
|
|
4084
|
-
if (cleanupFailures.length > 0) {
|
|
4085
|
-
const failedPaths = cleanupFailures.map((result) => result.configPath).join(", ");
|
|
4086
|
-
return {
|
|
4087
|
-
updated: false,
|
|
4088
|
-
skipped: true,
|
|
4089
|
-
reason: `Hermes config cleanup partially failed: updated ${updatedPaths}; failed ${failedPaths}`,
|
|
4090
|
-
configPath: `${updatedPaths}; failed: ${failedPaths}`
|
|
4091
|
-
};
|
|
4092
|
-
}
|
|
4093
|
-
return {
|
|
4094
|
-
updated: true,
|
|
4095
|
-
skipped: false,
|
|
4096
|
-
configPath: updatedPaths
|
|
4097
|
-
};
|
|
4098
|
-
}
|
|
4099
|
-
const cleanupFailure = cleanupFailures[0];
|
|
4100
|
-
if (cleanupFailure) {
|
|
4101
|
-
return cleanupFailure;
|
|
4102
|
-
}
|
|
4103
|
-
const existingWithoutBlock = results.find((result) => result.reason !== "Hermes config.yaml not found");
|
|
4104
|
-
return existingWithoutBlock ?? results[0] ?? {
|
|
4105
|
-
updated: false,
|
|
4106
|
-
skipped: true,
|
|
4107
|
-
reason: "Hermes config.yaml not found",
|
|
4108
|
-
configPath: hermesConfigPath(opts.profile)
|
|
4109
|
-
};
|
|
4110
|
-
}
|
|
4111
|
-
function removeHermesConfigFile(cfgPath) {
|
|
4112
|
-
if (!fs9.existsSync(cfgPath)) {
|
|
4113
|
-
return {
|
|
4114
|
-
updated: false,
|
|
4115
|
-
skipped: true,
|
|
4116
|
-
reason: "Hermes config.yaml not found",
|
|
4117
|
-
configPath: cfgPath
|
|
4118
|
-
};
|
|
4119
|
-
}
|
|
4120
|
-
const raw = fs9.readFileSync(cfgPath, "utf8");
|
|
4121
|
-
if (!/^remnic:/m.test(raw)) {
|
|
4122
|
-
return {
|
|
4123
|
-
updated: false,
|
|
4124
|
-
skipped: true,
|
|
4125
|
-
reason: "No remnic: block found in config.yaml",
|
|
4126
|
-
configPath: cfgPath
|
|
4127
|
-
};
|
|
4128
|
-
}
|
|
4129
|
-
const lines = raw.split("\n");
|
|
4130
|
-
const newLines = [];
|
|
4131
|
-
let inRemnicBlock = false;
|
|
4132
|
-
for (const line of lines) {
|
|
4133
|
-
if (/^remnic:/.test(line)) {
|
|
4134
|
-
inRemnicBlock = true;
|
|
4135
|
-
continue;
|
|
4136
|
-
}
|
|
4137
|
-
if (inRemnicBlock) {
|
|
4138
|
-
if (line.length > 0 && !/^\s/.test(line)) {
|
|
4139
|
-
inRemnicBlock = false;
|
|
4140
|
-
newLines.push(line);
|
|
4141
|
-
}
|
|
4142
|
-
continue;
|
|
4143
|
-
}
|
|
4144
|
-
newLines.push(line);
|
|
4145
|
-
}
|
|
4146
|
-
while (newLines.length > 0 && newLines[newLines.length - 1]?.trim() === "") {
|
|
4147
|
-
newLines.pop();
|
|
4148
|
-
}
|
|
4149
|
-
writeSecretFileSync(cfgPath, newLines.length > 0 ? newLines.join("\n") + "\n" : "");
|
|
4150
|
-
return { updated: true, skipped: false, configPath: cfgPath };
|
|
4151
|
-
}
|
|
4152
|
-
var HEALTH_EXIT_OK = 0;
|
|
4153
|
-
var HEALTH_EXIT_UNAUTHORIZED = 2;
|
|
4154
|
-
function checkDaemonHealth(host, port, authToken) {
|
|
4155
|
-
try {
|
|
4156
|
-
const safePort = Math.trunc(Number(port));
|
|
4157
|
-
if (!Number.isFinite(safePort) || safePort < 1 || safePort > 65535) {
|
|
4158
|
-
return false;
|
|
4159
|
-
}
|
|
4160
|
-
const bareHost = host.startsWith("[") && host.endsWith("]") ? host.slice(1, -1) : host;
|
|
4161
|
-
const script = [
|
|
4162
|
-
"const http = require('http');",
|
|
4163
|
-
"const env = process['env'];",
|
|
4164
|
-
"const headers = {};",
|
|
4165
|
-
"if (env.REMNIC_HEALTH_TOKEN) {",
|
|
4166
|
-
" headers['authorization'] = 'Bearer ' + env.REMNIC_HEALTH_TOKEN;",
|
|
4167
|
-
"}",
|
|
4168
|
-
"const req = http.get({",
|
|
4169
|
-
" host: env.REMNIC_HEALTH_HOST,",
|
|
4170
|
-
" port: parseInt(env.REMNIC_HEALTH_PORT, 10),",
|
|
4171
|
-
" path: '/engram/v1/health',",
|
|
4172
|
-
" headers,",
|
|
4173
|
-
" timeout: 3000,",
|
|
4174
|
-
"}, (res) => { process.exit(res.statusCode === 200 ? 0 : res.statusCode === 401 ? 2 : 1); });",
|
|
4175
|
-
"req.on('error', () => process.exit(1));",
|
|
4176
|
-
"req.on('timeout', () => { req.destroy(); process.exit(1); });"
|
|
4177
|
-
].join("\n");
|
|
4178
|
-
const env = mergeEnv({
|
|
4179
|
-
REMNIC_HEALTH_HOST: bareHost,
|
|
4180
|
-
REMNIC_HEALTH_PORT: String(safePort)
|
|
4181
|
-
});
|
|
4182
|
-
if (authToken) {
|
|
4183
|
-
env.REMNIC_HEALTH_TOKEN = authToken;
|
|
4184
|
-
}
|
|
4185
|
-
const processPath = process.execPath;
|
|
4186
|
-
const launchOptions = { timeout: 4e3, env };
|
|
4187
|
-
const result = launchProcessSync(processPath, ["-e", script], launchOptions);
|
|
4188
|
-
if (result.status === HEALTH_EXIT_OK) {
|
|
4189
|
-
return true;
|
|
4190
|
-
}
|
|
4191
|
-
if (result.status === HEALTH_EXIT_UNAUTHORIZED) {
|
|
4192
|
-
console.error(
|
|
4193
|
-
"[remnic/connectors] health probe got 401 \u2014 retrying after token cache TTL..."
|
|
4194
|
-
);
|
|
4195
|
-
launchProcessSync(processPath, ["-e", "setTimeout(() => {}, 6000)"], {
|
|
4196
|
-
timeout: 7e3,
|
|
4197
|
-
env: {}
|
|
4198
|
-
});
|
|
4199
|
-
const retry = launchProcessSync(processPath, ["-e", script], launchOptions);
|
|
4200
|
-
return retry.status === HEALTH_EXIT_OK;
|
|
4201
|
-
}
|
|
4202
|
-
return false;
|
|
4203
|
-
} catch {
|
|
4204
|
-
return false;
|
|
4205
|
-
}
|
|
4206
|
-
}
|
|
4207
|
-
async function doctorConnector(connectorId) {
|
|
4208
|
-
const installed = listConnectors().installed;
|
|
4209
|
-
const instance = installed.find((c) => c.connectorId === connectorId);
|
|
4210
|
-
if (!instance) {
|
|
4211
|
-
return {
|
|
4212
|
-
connectorId,
|
|
4213
|
-
checks: [{ name: "Installed", ok: false, detail: "Not installed" }],
|
|
4214
|
-
healthy: false
|
|
4215
|
-
};
|
|
4216
|
-
}
|
|
4217
|
-
const configPath = path13.join(getConnectorsDir(), `${connectorId}.json`);
|
|
4218
|
-
const checks = [];
|
|
4219
|
-
checks.push({
|
|
4220
|
-
name: "Config file",
|
|
4221
|
-
ok: fs9.existsSync(configPath),
|
|
4222
|
-
detail: configPath
|
|
4223
|
-
});
|
|
4224
|
-
try {
|
|
4225
|
-
const raw = fs9.readFileSync(configPath, "utf8");
|
|
4226
|
-
JSON.parse(raw);
|
|
4227
|
-
checks.push({ name: "Config valid", ok: true, detail: "OK" });
|
|
4228
|
-
} catch (e) {
|
|
4229
|
-
checks.push({ name: "Config valid", ok: false, detail: String(e) });
|
|
4230
|
-
}
|
|
4231
|
-
const mcpUrl = instance.config.mcpServerUrl;
|
|
4232
|
-
if (mcpUrl) {
|
|
4233
|
-
try {
|
|
4234
|
-
const controller = new AbortController();
|
|
4235
|
-
const timeoutId = setTimeout(() => controller.abort(), 3e3);
|
|
4236
|
-
const response = await fetch(mcpUrl, { signal: controller.signal });
|
|
4237
|
-
clearTimeout(timeoutId);
|
|
4238
|
-
checks.push({ name: "MCP server", ok: response.ok, detail: mcpUrl });
|
|
4239
|
-
} catch (e) {
|
|
4240
|
-
checks.push({
|
|
4241
|
-
name: "MCP server",
|
|
4242
|
-
ok: false,
|
|
4243
|
-
detail: `Cannot reach ${mcpUrl}: ${e instanceof Error ? e.message : "unknown"}`
|
|
4244
|
-
});
|
|
4245
|
-
}
|
|
4246
|
-
}
|
|
4247
|
-
const memoryDir = instance.config.memoryDir;
|
|
4248
|
-
if (memoryDir) {
|
|
4249
|
-
if (fs9.existsSync(memoryDir)) {
|
|
4250
|
-
checks.push({ name: "Memory directory", ok: true, detail: memoryDir });
|
|
4251
|
-
} else {
|
|
4252
|
-
checks.push({ name: "Memory directory", ok: false, detail: `Not found: ${memoryDir}` });
|
|
4253
|
-
}
|
|
4254
|
-
}
|
|
4255
|
-
const healthy = checks.every((c) => c.ok);
|
|
4256
|
-
return { connectorId, checks, healthy };
|
|
4257
|
-
}
|
|
4258
|
-
var CODEX_MEMORIES_SUBDIR = "memories";
|
|
4259
|
-
var CODEX_EXTENSIONS_SUBDIR = "memories_extensions";
|
|
4260
|
-
var REMNIC_EXTENSION_DIR_NAME = "remnic";
|
|
4261
|
-
function resolveCodexHome(override) {
|
|
4262
|
-
if (override && typeof override === "string" && override.trim().length > 0) {
|
|
4263
|
-
return path13.resolve(override.trim());
|
|
4264
|
-
}
|
|
4265
|
-
const envHome = readEnvVar("CODEX_HOME");
|
|
4266
|
-
if (envHome && envHome.trim().length > 0) {
|
|
4267
|
-
return path13.resolve(envHome.trim());
|
|
4268
|
-
}
|
|
4269
|
-
const home = readEnvVar("HOME") || readEnvVar("USERPROFILE") || resolveHomeDir();
|
|
4270
|
-
return path13.resolve(home, ".codex");
|
|
4271
|
-
}
|
|
4272
|
-
function resolveCodexMemoryExtensionPaths(codexHomeOverride) {
|
|
4273
|
-
const codexHome = resolveCodexHome(codexHomeOverride);
|
|
4274
|
-
const memoriesDir = path13.join(codexHome, CODEX_MEMORIES_SUBDIR);
|
|
4275
|
-
const extensionsRoot = path13.join(path13.dirname(memoriesDir), CODEX_EXTENSIONS_SUBDIR);
|
|
4276
|
-
const remnicExtensionDir = path13.join(extensionsRoot, REMNIC_EXTENSION_DIR_NAME);
|
|
4277
|
-
return { codexHome, memoriesDir, extensionsRoot, remnicExtensionDir };
|
|
4278
|
-
}
|
|
4279
|
-
function locatePluginCodexExtensionSource(override) {
|
|
4280
|
-
if (override && typeof override === "string" && override.trim().length > 0) {
|
|
4281
|
-
const resolved = path13.resolve(override.trim());
|
|
4282
|
-
if (fs9.existsSync(resolved) && fs9.statSync(resolved).isDirectory()) {
|
|
4283
|
-
return resolved;
|
|
4284
|
-
}
|
|
4285
|
-
throw new Error(`Codex extension source directory not found: ${resolved}`);
|
|
4286
|
-
}
|
|
4287
|
-
const EXTENSION_SUBPATH = path13.join("memories_extensions", "remnic");
|
|
4288
|
-
const WORKSPACE_RELATIVE_PATH = path13.join(
|
|
4289
|
-
"packages",
|
|
4290
|
-
"plugin-codex",
|
|
4291
|
-
"memories_extensions",
|
|
4292
|
-
"remnic"
|
|
4293
|
-
);
|
|
4294
|
-
const searched = [];
|
|
4295
|
-
try {
|
|
4296
|
-
const moduleDir = path13.dirname(fileURLToPath(import.meta.url));
|
|
4297
|
-
const bundledCandidate = path13.join(moduleDir, "codex");
|
|
4298
|
-
searched.push(bundledCandidate);
|
|
4299
|
-
if (fs9.existsSync(bundledCandidate) && fs9.statSync(bundledCandidate).isDirectory()) {
|
|
4300
|
-
return bundledCandidate;
|
|
4301
|
-
}
|
|
4302
|
-
const distConnectorsCandidate = path13.join(moduleDir, "connectors", "codex");
|
|
4303
|
-
searched.push(distConnectorsCandidate);
|
|
4304
|
-
if (fs9.existsSync(distConnectorsCandidate) && fs9.statSync(distConnectorsCandidate).isDirectory()) {
|
|
4305
|
-
return distConnectorsCandidate;
|
|
4306
|
-
}
|
|
4307
|
-
} catch {
|
|
4308
|
-
}
|
|
4309
|
-
try {
|
|
4310
|
-
const requireFromHere = createRequire(import.meta.url);
|
|
4311
|
-
const pluginPkgJsonPath = requireFromHere.resolve("@remnic/plugin-codex/package.json");
|
|
4312
|
-
const pluginPkgRoot = path13.dirname(pluginPkgJsonPath);
|
|
4313
|
-
const candidate = path13.join(pluginPkgRoot, EXTENSION_SUBPATH);
|
|
4314
|
-
searched.push(candidate);
|
|
4315
|
-
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4316
|
-
return candidate;
|
|
4317
|
-
}
|
|
4318
|
-
} catch {
|
|
4319
|
-
}
|
|
4320
|
-
try {
|
|
4321
|
-
const moduleDir = path13.dirname(fileURLToPath(import.meta.url));
|
|
4322
|
-
let dir = moduleDir;
|
|
4323
|
-
for (let depth = 0; depth < 8; depth += 1) {
|
|
4324
|
-
const candidate = path13.join(
|
|
4325
|
-
dir,
|
|
4326
|
-
"node_modules",
|
|
4327
|
-
"@remnic",
|
|
4328
|
-
"plugin-codex",
|
|
4329
|
-
EXTENSION_SUBPATH
|
|
4330
|
-
);
|
|
4331
|
-
searched.push(candidate);
|
|
4332
|
-
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4333
|
-
return candidate;
|
|
4334
|
-
}
|
|
4335
|
-
const parent = path13.dirname(dir);
|
|
4336
|
-
if (parent === dir) break;
|
|
4337
|
-
dir = parent;
|
|
4338
|
-
}
|
|
4339
|
-
} catch {
|
|
4340
|
-
}
|
|
4341
|
-
const anchors = [];
|
|
4342
|
-
try {
|
|
4343
|
-
anchors.push(path13.dirname(fileURLToPath(import.meta.url)));
|
|
4344
|
-
} catch {
|
|
4345
|
-
}
|
|
4346
|
-
anchors.push(process.cwd());
|
|
4347
|
-
for (const anchor of anchors) {
|
|
4348
|
-
let dir = anchor;
|
|
4349
|
-
for (let depth = 0; depth < 12; depth += 1) {
|
|
4350
|
-
const candidate = path13.join(dir, WORKSPACE_RELATIVE_PATH);
|
|
4351
|
-
searched.push(candidate);
|
|
4352
|
-
if (fs9.existsSync(candidate) && fs9.statSync(candidate).isDirectory()) {
|
|
4353
|
-
return candidate;
|
|
4354
|
-
}
|
|
4355
|
-
const parent = path13.dirname(dir);
|
|
4356
|
-
if (parent === dir) break;
|
|
4357
|
-
dir = parent;
|
|
4358
|
-
}
|
|
4359
|
-
}
|
|
4360
|
-
throw new Error(
|
|
4361
|
-
"Could not locate the plugin-codex memories_extensions/remnic source directory.\nPaths searched:\n" + searched.map((p) => ` - ${p}`).join("\n") + "\nInstall @remnic/plugin-codex or pass sourceDir explicitly."
|
|
4362
|
-
);
|
|
4363
|
-
}
|
|
4364
|
-
function copyDirRecursiveSync(src, dest) {
|
|
4365
|
-
let count = 0;
|
|
4366
|
-
fs9.mkdirSync(dest, { recursive: true });
|
|
4367
|
-
const entries = fs9.readdirSync(src, { withFileTypes: true });
|
|
4368
|
-
for (const entry of entries) {
|
|
4369
|
-
const from = path13.join(src, entry.name);
|
|
4370
|
-
const to = path13.join(dest, entry.name);
|
|
4371
|
-
if (entry.isDirectory()) {
|
|
4372
|
-
count += copyDirRecursiveSync(from, to);
|
|
4373
|
-
} else if (entry.isFile()) {
|
|
4374
|
-
fs9.copyFileSync(from, to);
|
|
4375
|
-
count += 1;
|
|
4376
|
-
}
|
|
4377
|
-
}
|
|
4378
|
-
return count;
|
|
4379
|
-
}
|
|
4380
|
-
function installCodexMemoryExtension(options = {}) {
|
|
4381
|
-
const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
|
|
4382
|
-
const sourceDir = locatePluginCodexExtensionSource(options.sourceDir ?? null);
|
|
4383
|
-
fs9.mkdirSync(paths.extensionsRoot, { recursive: true });
|
|
4384
|
-
const tmpPrefix = `.${REMNIC_EXTENSION_DIR_NAME}.tmp-`;
|
|
4385
|
-
const STALE_TMP_THRESHOLD_MS = 10 * 60 * 1e3;
|
|
4386
|
-
const now = Date.now();
|
|
4387
|
-
try {
|
|
4388
|
-
const existingEntries = fs9.readdirSync(paths.extensionsRoot);
|
|
4389
|
-
for (const entry of existingEntries) {
|
|
4390
|
-
if (!entry.startsWith(tmpPrefix)) continue;
|
|
4391
|
-
const stalePath = path13.join(paths.extensionsRoot, entry);
|
|
4392
|
-
try {
|
|
4393
|
-
const stat = fs9.statSync(stalePath);
|
|
4394
|
-
const ageMs = now - stat.mtimeMs;
|
|
4395
|
-
if (ageMs < STALE_TMP_THRESHOLD_MS) {
|
|
4396
|
-
continue;
|
|
4397
|
-
}
|
|
4398
|
-
fs9.rmSync(stalePath, { recursive: true, force: true });
|
|
4399
|
-
} catch {
|
|
4400
|
-
}
|
|
4401
|
-
}
|
|
4402
|
-
} catch {
|
|
4403
|
-
}
|
|
4404
|
-
const tmpName = `${tmpPrefix}${process.pid}-${Date.now()}`;
|
|
4405
|
-
const tmpDir = path13.join(paths.extensionsRoot, tmpName);
|
|
4406
|
-
let filesCopied = 0;
|
|
4407
|
-
let commitFn = () => {
|
|
4408
|
-
};
|
|
4409
|
-
let rollbackFn = () => {
|
|
4410
|
-
};
|
|
4411
|
-
try {
|
|
4412
|
-
filesCopied = copyDirRecursiveSync(sourceDir, tmpDir);
|
|
4413
|
-
const backupDir = `${paths.remnicExtensionDir}.bak-${Date.now()}`;
|
|
4414
|
-
const hadExisting = fs9.existsSync(paths.remnicExtensionDir);
|
|
4415
|
-
if (hadExisting) {
|
|
4416
|
-
fs9.renameSync(paths.remnicExtensionDir, backupDir);
|
|
4417
|
-
}
|
|
4418
|
-
try {
|
|
4419
|
-
fs9.renameSync(tmpDir, paths.remnicExtensionDir);
|
|
4420
|
-
} catch (renameErr) {
|
|
4421
|
-
if (hadExisting) {
|
|
4422
|
-
try {
|
|
4423
|
-
fs9.renameSync(backupDir, paths.remnicExtensionDir);
|
|
4424
|
-
} catch {
|
|
4425
|
-
}
|
|
4426
|
-
}
|
|
4427
|
-
throw renameErr;
|
|
4428
|
-
}
|
|
4429
|
-
commitFn = () => {
|
|
4430
|
-
if (hadExisting) {
|
|
4431
|
-
try {
|
|
4432
|
-
fs9.rmSync(backupDir, { recursive: true, force: true });
|
|
4433
|
-
} catch {
|
|
4434
|
-
}
|
|
4435
|
-
}
|
|
4436
|
-
};
|
|
4437
|
-
rollbackFn = () => {
|
|
4438
|
-
if (hadExisting) {
|
|
4439
|
-
try {
|
|
4440
|
-
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4441
|
-
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4442
|
-
}
|
|
4443
|
-
fs9.renameSync(backupDir, paths.remnicExtensionDir);
|
|
4444
|
-
} catch {
|
|
4445
|
-
}
|
|
4446
|
-
} else {
|
|
4447
|
-
try {
|
|
4448
|
-
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4449
|
-
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4450
|
-
}
|
|
4451
|
-
} catch {
|
|
4452
|
-
}
|
|
4453
|
-
}
|
|
4454
|
-
};
|
|
4455
|
-
} catch (err) {
|
|
4456
|
-
if (fs9.existsSync(tmpDir)) {
|
|
4457
|
-
try {
|
|
4458
|
-
fs9.rmSync(tmpDir, { recursive: true, force: true });
|
|
4459
|
-
} catch {
|
|
4460
|
-
}
|
|
4461
|
-
}
|
|
4462
|
-
throw err;
|
|
4463
|
-
}
|
|
4464
|
-
const instructionsPath = path13.join(paths.remnicExtensionDir, "instructions.md");
|
|
4465
|
-
return {
|
|
4466
|
-
...paths,
|
|
4467
|
-
instructionsPath,
|
|
4468
|
-
filesCopied,
|
|
4469
|
-
commit: commitFn,
|
|
4470
|
-
rollback: rollbackFn
|
|
4471
|
-
};
|
|
4472
|
-
}
|
|
4473
|
-
function removeCodexMemoryExtension(options = {}) {
|
|
4474
|
-
const paths = resolveCodexMemoryExtensionPaths(options.codexHome ?? null);
|
|
4475
|
-
let removed = false;
|
|
4476
|
-
if (fs9.existsSync(paths.remnicExtensionDir)) {
|
|
4477
|
-
fs9.rmSync(paths.remnicExtensionDir, { recursive: true, force: true });
|
|
4478
|
-
removed = true;
|
|
4479
|
-
}
|
|
4480
|
-
return { ...paths, removed };
|
|
4481
|
-
}
|
|
4482
|
-
function getConnectorsDir() {
|
|
4483
|
-
const xdgConfigHome = readEnvVar("XDG_CONFIG_HOME");
|
|
4484
|
-
const configDir = xdgConfigHome ? path13.join(xdgConfigHome, "engram") : path13.join(resolveHomeDir(), ".config", "engram");
|
|
4485
|
-
return path13.join(configDir, REGISTRY_DIR_NAME, "connectors");
|
|
4486
|
-
}
|
|
4487
|
-
var WECLONE_PROXY_CONFIG_DIRNAME = ".remnic";
|
|
4488
|
-
var WECLONE_PROXY_CONFIG_FILENAME = "weclone.json";
|
|
4489
|
-
function resolveWeCloneProxyConfigPath() {
|
|
4490
|
-
const override = readEnvVar("REMNIC_HOME") ?? readEnvVar("ENGRAM_HOME");
|
|
4491
|
-
if (override && override.length > 0) {
|
|
4492
|
-
return path13.resolve(override, "connectors", WECLONE_PROXY_CONFIG_FILENAME);
|
|
4493
|
-
}
|
|
4494
|
-
const envHome = readEnvVar("HOME");
|
|
4495
|
-
const home = envHome && envHome.length > 0 ? envHome : os.homedir();
|
|
4496
|
-
return path13.resolve(
|
|
4497
|
-
home,
|
|
4498
|
-
WECLONE_PROXY_CONFIG_DIRNAME,
|
|
4499
|
-
"connectors",
|
|
4500
|
-
WECLONE_PROXY_CONFIG_FILENAME
|
|
4501
|
-
);
|
|
4502
|
-
}
|
|
4503
|
-
function readWeCloneProxyConfigIfExists(configPath) {
|
|
4504
|
-
try {
|
|
4505
|
-
if (!fs9.existsSync(configPath)) return null;
|
|
4506
|
-
return fs9.readFileSync(configPath, "utf8");
|
|
4507
|
-
} catch {
|
|
4508
|
-
return null;
|
|
4509
|
-
}
|
|
4510
|
-
}
|
|
4511
|
-
function safeParseJson(raw) {
|
|
4512
|
-
try {
|
|
4513
|
-
const parsed = JSON.parse(raw);
|
|
4514
|
-
if (typeof parsed === "object" && parsed !== null && !Array.isArray(parsed)) {
|
|
4515
|
-
return parsed;
|
|
4516
|
-
}
|
|
4517
|
-
return null;
|
|
4518
|
-
} catch {
|
|
4519
|
-
return null;
|
|
4520
|
-
}
|
|
4521
|
-
}
|
|
4522
|
-
var WECLONE_DEFAULTS = {
|
|
4523
|
-
wecloneApiUrl: "http://localhost:8000/v1",
|
|
4524
|
-
wecloneModelName: "weclone-avatar",
|
|
4525
|
-
proxyPort: 8100,
|
|
4526
|
-
remnicDaemonUrl: "http://localhost:4318",
|
|
4527
|
-
sessionStrategy: "single",
|
|
4528
|
-
memoryInjection: {
|
|
4529
|
-
maxTokens: 1500,
|
|
4530
|
-
position: "system-append",
|
|
4531
|
-
template: "[Memory Context]\n{memories}\n[End Memory Context]"
|
|
4532
|
-
}
|
|
4533
|
-
};
|
|
4534
|
-
function resolveStringField(userConfig, priorConfig, key, fallback) {
|
|
4535
|
-
const fromUser = userConfig[key];
|
|
4536
|
-
if (typeof fromUser === "string" && fromUser.length > 0) return fromUser;
|
|
4537
|
-
if (priorConfig) {
|
|
4538
|
-
const fromPrior = priorConfig[key];
|
|
4539
|
-
if (typeof fromPrior === "string" && fromPrior.length > 0) return fromPrior;
|
|
4540
|
-
}
|
|
4541
|
-
return fallback;
|
|
4542
|
-
}
|
|
4543
|
-
function coercePort(value) {
|
|
4544
|
-
if (typeof value === "number" && Number.isInteger(value) && value >= 1 && value <= 65535) {
|
|
4545
|
-
return value;
|
|
4546
|
-
}
|
|
4547
|
-
if (typeof value === "string" && value.length > 0) {
|
|
4548
|
-
const n = Number(value);
|
|
4549
|
-
if (Number.isInteger(n) && n >= 1 && n <= 65535) return n;
|
|
4550
|
-
}
|
|
4551
|
-
return null;
|
|
4552
|
-
}
|
|
4553
|
-
function resolvePort(userConfig, priorConfig, fallback) {
|
|
4554
|
-
const fromUser = coercePort(userConfig.proxyPort);
|
|
4555
|
-
if (fromUser !== null) return fromUser;
|
|
4556
|
-
if (priorConfig) {
|
|
4557
|
-
const fromPrior = coercePort(priorConfig.proxyPort);
|
|
4558
|
-
if (fromPrior !== null) return fromPrior;
|
|
4559
|
-
}
|
|
4560
|
-
return fallback;
|
|
4561
|
-
}
|
|
4562
|
-
function resolveSessionStrategy(userConfig, priorConfig) {
|
|
4563
|
-
const valid = /* @__PURE__ */ new Set(["caller-id", "single"]);
|
|
4564
|
-
const fromUser = userConfig.sessionStrategy;
|
|
4565
|
-
if (typeof fromUser === "string" && valid.has(fromUser)) {
|
|
4566
|
-
return fromUser;
|
|
4567
|
-
}
|
|
4568
|
-
if (priorConfig) {
|
|
4569
|
-
const fromPrior = priorConfig.sessionStrategy;
|
|
4570
|
-
if (typeof fromPrior === "string" && valid.has(fromPrior)) {
|
|
4571
|
-
return fromPrior;
|
|
4572
|
-
}
|
|
4573
|
-
}
|
|
4574
|
-
return WECLONE_DEFAULTS.sessionStrategy;
|
|
4575
|
-
}
|
|
4576
|
-
function buildWeCloneProxyConfig(args) {
|
|
4577
|
-
const { userConfig, priorConfig, authToken } = args;
|
|
4578
|
-
const wecloneApiUrl = resolveStringField(
|
|
4579
|
-
userConfig,
|
|
4580
|
-
priorConfig,
|
|
4581
|
-
"wecloneApiUrl",
|
|
4582
|
-
WECLONE_DEFAULTS.wecloneApiUrl
|
|
4583
|
-
);
|
|
4584
|
-
const wecloneModelName = resolveStringField(
|
|
4585
|
-
userConfig,
|
|
4586
|
-
priorConfig,
|
|
4587
|
-
"wecloneModelName",
|
|
4588
|
-
WECLONE_DEFAULTS.wecloneModelName
|
|
4589
|
-
);
|
|
4590
|
-
const remnicDaemonUrl = resolveStringField(
|
|
4591
|
-
userConfig,
|
|
4592
|
-
priorConfig,
|
|
4593
|
-
"remnicDaemonUrl",
|
|
4594
|
-
WECLONE_DEFAULTS.remnicDaemonUrl
|
|
4595
|
-
);
|
|
4596
|
-
const proxyPort = resolvePort(
|
|
4597
|
-
userConfig,
|
|
4598
|
-
priorConfig,
|
|
4599
|
-
WECLONE_DEFAULTS.proxyPort
|
|
4600
|
-
);
|
|
4601
|
-
const sessionStrategy = resolveSessionStrategy(userConfig, priorConfig);
|
|
4602
|
-
const memoryInjection = {
|
|
4603
|
-
...WECLONE_DEFAULTS.memoryInjection,
|
|
4604
|
-
...priorConfig && typeof priorConfig.memoryInjection === "object" && priorConfig.memoryInjection !== null && !Array.isArray(priorConfig.memoryInjection) ? priorConfig.memoryInjection : {},
|
|
4605
|
-
...typeof userConfig.memoryInjection === "object" && userConfig.memoryInjection !== null && !Array.isArray(userConfig.memoryInjection) ? userConfig.memoryInjection : {}
|
|
4606
|
-
};
|
|
4607
|
-
const config = {
|
|
4608
|
-
wecloneApiUrl,
|
|
4609
|
-
wecloneModelName,
|
|
4610
|
-
proxyPort,
|
|
4611
|
-
remnicDaemonUrl,
|
|
4612
|
-
sessionStrategy,
|
|
4613
|
-
memoryInjection
|
|
4614
|
-
};
|
|
4615
|
-
if (authToken && authToken.length > 0) {
|
|
4616
|
-
config.remnicAuthToken = authToken;
|
|
4617
|
-
} else if (typeof userConfig.remnicAuthToken === "string" && userConfig.remnicAuthToken.length > 0) {
|
|
4618
|
-
config.remnicAuthToken = userConfig.remnicAuthToken;
|
|
4619
|
-
} else if (priorConfig && typeof priorConfig.remnicAuthToken === "string" && priorConfig.remnicAuthToken.length > 0) {
|
|
4620
|
-
config.remnicAuthToken = priorConfig.remnicAuthToken;
|
|
4621
|
-
}
|
|
4622
|
-
return config;
|
|
4623
|
-
}
|
|
4624
|
-
|
|
4625
|
-
// src/spaces/index.ts
|
|
4626
|
-
import fs10 from "fs";
|
|
4627
|
-
import path14 from "path";
|
|
4628
|
-
import crypto6 from "crypto";
|
|
4629
|
-
var MANIFEST_VERSION = 1;
|
|
4630
|
-
function getSpacesDir(baseDir) {
|
|
4631
|
-
const homeDir = baseDir ?? resolveHomeDir();
|
|
4632
|
-
return path14.join(homeDir, ".config", "engram", "spaces");
|
|
4633
|
-
}
|
|
4634
|
-
function getManifestPath(baseDir) {
|
|
4635
|
-
return path14.join(getSpacesDir(baseDir), "manifest.json");
|
|
4636
|
-
}
|
|
4637
|
-
function loadManifest(baseDir, memoryDirOverride) {
|
|
4638
|
-
const manifestPath2 = getManifestPath(baseDir);
|
|
4639
|
-
if (!fs10.existsSync(manifestPath2)) {
|
|
4640
|
-
const personalSpace = createPersonalSpace(baseDir, memoryDirOverride);
|
|
4641
|
-
const manifest = {
|
|
4642
|
-
activeSpaceId: personalSpace.id,
|
|
4643
|
-
spaces: [personalSpace],
|
|
4644
|
-
version: MANIFEST_VERSION
|
|
4645
|
-
};
|
|
4646
|
-
saveManifest(manifest, baseDir);
|
|
4647
|
-
return manifest;
|
|
4648
|
-
}
|
|
4649
|
-
const raw = JSON.parse(fs10.readFileSync(manifestPath2, "utf8"));
|
|
2892
|
+
const raw = JSON.parse(fs8.readFileSync(manifestPath2, "utf8"));
|
|
4650
2893
|
return raw;
|
|
4651
2894
|
}
|
|
4652
2895
|
function saveManifest(manifest, baseDir) {
|
|
4653
2896
|
const manifestPath2 = getManifestPath(baseDir);
|
|
4654
|
-
|
|
4655
|
-
|
|
2897
|
+
fs8.mkdirSync(path12.dirname(manifestPath2), { recursive: true });
|
|
2898
|
+
fs8.writeFileSync(manifestPath2, JSON.stringify(manifest, null, 2) + "\n");
|
|
4656
2899
|
}
|
|
4657
2900
|
function createPersonalSpace(baseDir, memoryDirOverride) {
|
|
4658
2901
|
const homeDir = baseDir ?? resolveHomeDir();
|
|
4659
|
-
const standalonePath =
|
|
4660
|
-
const openclawPath =
|
|
4661
|
-
const memoryDir = memoryDirOverride ?? readEnvVar("ENGRAM_MEMORY_DIR") ?? (
|
|
2902
|
+
const standalonePath = path12.join(homeDir, ".engram", "memory");
|
|
2903
|
+
const openclawPath = path12.join(homeDir, ".openclaw", "workspace", "memory", "local");
|
|
2904
|
+
const memoryDir = memoryDirOverride ?? readEnvVar("ENGRAM_MEMORY_DIR") ?? (fs8.existsSync(standalonePath) ? standalonePath : fs8.existsSync(openclawPath) ? openclawPath : standalonePath);
|
|
4662
2905
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4663
2906
|
return {
|
|
4664
2907
|
id: "personal",
|
|
@@ -4691,7 +2934,7 @@ function createSpace(options) {
|
|
|
4691
2934
|
throw new Error(`Parent space "${options.parentSpaceId}" not found`);
|
|
4692
2935
|
}
|
|
4693
2936
|
const now = (/* @__PURE__ */ new Date()).toISOString();
|
|
4694
|
-
const memoryDir = options.memoryDir ??
|
|
2937
|
+
const memoryDir = options.memoryDir ?? path12.join(
|
|
4695
2938
|
getSpacesDir(options.baseDir),
|
|
4696
2939
|
id,
|
|
4697
2940
|
"memory"
|
|
@@ -4707,7 +2950,7 @@ function createSpace(options) {
|
|
|
4707
2950
|
owner: readEnvVar("USER"),
|
|
4708
2951
|
parentSpaceId: options.parentSpaceId
|
|
4709
2952
|
};
|
|
4710
|
-
|
|
2953
|
+
fs8.mkdirSync(memoryDir, { recursive: true });
|
|
4711
2954
|
manifest.spaces.push(space);
|
|
4712
2955
|
manifest.updatedAt = now;
|
|
4713
2956
|
saveManifest(manifest, options.baseDir);
|
|
@@ -4881,34 +3124,34 @@ function mergeSpaces(sourceSpaceId, targetSpaceId, options) {
|
|
|
4881
3124
|
};
|
|
4882
3125
|
}
|
|
4883
3126
|
function getAuditLog(baseDir) {
|
|
4884
|
-
const auditPath =
|
|
4885
|
-
if (!
|
|
4886
|
-
const lines =
|
|
3127
|
+
const auditPath = path12.join(getSpacesDir(baseDir), "audit.jsonl");
|
|
3128
|
+
if (!fs8.existsSync(auditPath)) return [];
|
|
3129
|
+
const lines = fs8.readFileSync(auditPath, "utf8").trim().split("\n");
|
|
4887
3130
|
return lines.filter((l) => l.trim()).map((l) => JSON.parse(l));
|
|
4888
3131
|
}
|
|
4889
3132
|
function appendAudit(entry, baseDir) {
|
|
4890
|
-
const auditPath =
|
|
4891
|
-
|
|
3133
|
+
const auditPath = path12.join(getSpacesDir(baseDir), "audit.jsonl");
|
|
3134
|
+
fs8.mkdirSync(path12.dirname(auditPath), { recursive: true });
|
|
4892
3135
|
const full = {
|
|
4893
3136
|
id: crypto6.randomUUID(),
|
|
4894
3137
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
4895
3138
|
...entry
|
|
4896
3139
|
};
|
|
4897
|
-
|
|
3140
|
+
fs8.appendFileSync(auditPath, JSON.stringify(full) + "\n");
|
|
4898
3141
|
}
|
|
4899
3142
|
function copyMemories(sourceDir, targetDir, options) {
|
|
4900
3143
|
let merged = 0;
|
|
4901
3144
|
const conflicts = [];
|
|
4902
3145
|
let skipped = 0;
|
|
4903
|
-
if (!
|
|
3146
|
+
if (!fs8.existsSync(sourceDir)) {
|
|
4904
3147
|
return { merged: 0, conflicts: [], skipped: 0 };
|
|
4905
3148
|
}
|
|
4906
|
-
|
|
3149
|
+
fs8.mkdirSync(targetDir, { recursive: true });
|
|
4907
3150
|
const sourceFiles = walkMd2(sourceDir);
|
|
4908
3151
|
for (const sourcePath of sourceFiles) {
|
|
4909
|
-
const content =
|
|
4910
|
-
const relativePath =
|
|
4911
|
-
const targetPath =
|
|
3152
|
+
const content = fs8.readFileSync(sourcePath, "utf8");
|
|
3153
|
+
const relativePath = path12.relative(sourceDir, sourcePath);
|
|
3154
|
+
const targetPath = path12.join(targetDir, relativePath);
|
|
4912
3155
|
const sourceHash = hashContent4(content);
|
|
4913
3156
|
if (options?.filterIds?.length) {
|
|
4914
3157
|
const fm = parseSimpleFrontmatter(content);
|
|
@@ -4917,8 +3160,8 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
4917
3160
|
continue;
|
|
4918
3161
|
}
|
|
4919
3162
|
}
|
|
4920
|
-
if (
|
|
4921
|
-
const targetContent =
|
|
3163
|
+
if (fs8.existsSync(targetPath) && !options?.force) {
|
|
3164
|
+
const targetContent = fs8.readFileSync(targetPath, "utf8");
|
|
4922
3165
|
const targetHash = hashContent4(targetContent);
|
|
4923
3166
|
if (sourceHash !== targetHash) {
|
|
4924
3167
|
conflicts.push({
|
|
@@ -4934,8 +3177,8 @@ function copyMemories(sourceDir, targetDir, options) {
|
|
|
4934
3177
|
skipped++;
|
|
4935
3178
|
continue;
|
|
4936
3179
|
}
|
|
4937
|
-
|
|
4938
|
-
|
|
3180
|
+
fs8.mkdirSync(path12.dirname(targetPath), { recursive: true });
|
|
3181
|
+
fs8.writeFileSync(targetPath, content);
|
|
4939
3182
|
merged++;
|
|
4940
3183
|
}
|
|
4941
3184
|
return { merged, conflicts, skipped };
|
|
@@ -4946,8 +3189,8 @@ function hashContent4(content) {
|
|
|
4946
3189
|
function walkMd2(dir) {
|
|
4947
3190
|
const results = [];
|
|
4948
3191
|
function walk(d) {
|
|
4949
|
-
for (const entry of
|
|
4950
|
-
const fullPath =
|
|
3192
|
+
for (const entry of fs8.readdirSync(d, { withFileTypes: true })) {
|
|
3193
|
+
const fullPath = path12.join(d, entry.name);
|
|
4951
3194
|
if (entry.isDirectory()) {
|
|
4952
3195
|
walk(fullPath);
|
|
4953
3196
|
} else if (entry.name.endsWith(".md")) {
|
|
@@ -5075,10 +3318,10 @@ var REMNIC_RECALL_DECISION_RULES = `## When to Use Recall vs Direct Read
|
|
|
5075
3318
|
`;
|
|
5076
3319
|
|
|
5077
3320
|
// src/memory-extension/codex-publisher.ts
|
|
5078
|
-
import
|
|
5079
|
-
import
|
|
5080
|
-
import
|
|
5081
|
-
var
|
|
3321
|
+
import fs9 from "fs";
|
|
3322
|
+
import os from "os";
|
|
3323
|
+
import path13 from "path";
|
|
3324
|
+
var REMNIC_EXTENSION_DIR_NAME = "remnic";
|
|
5082
3325
|
var CodexMemoryExtensionPublisher = class {
|
|
5083
3326
|
hostId = "codex";
|
|
5084
3327
|
static capabilities = {
|
|
@@ -5088,13 +3331,13 @@ var CodexMemoryExtensionPublisher = class {
|
|
|
5088
3331
|
readPathTemplate: true
|
|
5089
3332
|
};
|
|
5090
3333
|
async resolveExtensionRoot(env) {
|
|
5091
|
-
const codexHome = env === void 0 ? readEnvVar("CODEX_HOME")?.trim() ||
|
|
5092
|
-
return
|
|
3334
|
+
const codexHome = env === void 0 ? readEnvVar("CODEX_HOME")?.trim() || path13.join(resolveHomeDir(), ".codex") : env.CODEX_HOME?.trim() || path13.join(env.HOME ?? env.USERPROFILE ?? os.homedir(), ".codex");
|
|
3335
|
+
return path13.join(codexHome, "memories_extensions", REMNIC_EXTENSION_DIR_NAME);
|
|
5093
3336
|
}
|
|
5094
3337
|
async isHostAvailable() {
|
|
5095
3338
|
try {
|
|
5096
|
-
const home = readEnvVar("CODEX_HOME")?.trim() ||
|
|
5097
|
-
return
|
|
3339
|
+
const home = readEnvVar("CODEX_HOME")?.trim() || path13.join(resolveHomeDir(), ".codex");
|
|
3340
|
+
return fs9.existsSync(home);
|
|
5098
3341
|
} catch {
|
|
5099
3342
|
return false;
|
|
5100
3343
|
}
|
|
@@ -5144,22 +3387,22 @@ When running inside the Codex phase-2 consolidation sandbox:
|
|
|
5144
3387
|
}
|
|
5145
3388
|
async publish(ctx) {
|
|
5146
3389
|
const extensionRoot = await this.resolveExtensionRoot();
|
|
5147
|
-
const instructionsPath =
|
|
3390
|
+
const instructionsPath = path13.join(extensionRoot, "instructions.md");
|
|
5148
3391
|
const filesWritten = [];
|
|
5149
3392
|
const skipped = [];
|
|
5150
3393
|
ctx.log.info(`Publishing Codex memory extension to ${extensionRoot}`);
|
|
5151
|
-
|
|
3394
|
+
fs9.mkdirSync(extensionRoot, { recursive: true });
|
|
5152
3395
|
const content = await this.renderInstructions(ctx);
|
|
5153
3396
|
const tmpPath = `${instructionsPath}.tmp-${process.pid}-${Date.now()}`;
|
|
5154
3397
|
try {
|
|
5155
|
-
|
|
5156
|
-
|
|
3398
|
+
fs9.writeFileSync(tmpPath, content, "utf-8");
|
|
3399
|
+
fs9.renameSync(tmpPath, instructionsPath);
|
|
5157
3400
|
filesWritten.push(instructionsPath);
|
|
5158
3401
|
ctx.log.info(`Wrote ${instructionsPath}`);
|
|
5159
3402
|
} catch (err) {
|
|
5160
3403
|
try {
|
|
5161
|
-
if (
|
|
5162
|
-
|
|
3404
|
+
if (fs9.existsSync(tmpPath)) {
|
|
3405
|
+
fs9.unlinkSync(tmpPath);
|
|
5163
3406
|
}
|
|
5164
3407
|
} catch {
|
|
5165
3408
|
}
|
|
@@ -5174,8 +3417,8 @@ When running inside the Codex phase-2 consolidation sandbox:
|
|
|
5174
3417
|
}
|
|
5175
3418
|
async unpublish() {
|
|
5176
3419
|
const extensionRoot = await this.resolveExtensionRoot();
|
|
5177
|
-
if (
|
|
5178
|
-
|
|
3420
|
+
if (fs9.existsSync(extensionRoot)) {
|
|
3421
|
+
fs9.rmSync(extensionRoot, { recursive: true, force: true });
|
|
5179
3422
|
}
|
|
5180
3423
|
}
|
|
5181
3424
|
};
|
|
@@ -5259,264 +3502,6 @@ function publisherForConnector(connectorId) {
|
|
|
5259
3502
|
return publisherFor(hostIdForConnector(connectorId));
|
|
5260
3503
|
}
|
|
5261
3504
|
|
|
5262
|
-
// src/enrichment/types.ts
|
|
5263
|
-
function defaultEnrichmentPipelineConfig() {
|
|
5264
|
-
return {
|
|
5265
|
-
enabled: false,
|
|
5266
|
-
providers: [],
|
|
5267
|
-
importanceThresholds: {
|
|
5268
|
-
critical: [],
|
|
5269
|
-
high: [],
|
|
5270
|
-
normal: [],
|
|
5271
|
-
low: []
|
|
5272
|
-
},
|
|
5273
|
-
maxCandidatesPerEntity: 20,
|
|
5274
|
-
autoEnrichOnCreate: false,
|
|
5275
|
-
scheduleIntervalMs: 36e5
|
|
5276
|
-
};
|
|
5277
|
-
}
|
|
5278
|
-
|
|
5279
|
-
// src/enrichment/provider-registry.ts
|
|
5280
|
-
var EnrichmentProviderRegistry = class {
|
|
5281
|
-
providers = /* @__PURE__ */ new Map();
|
|
5282
|
-
/** Register a provider. Overwrites any existing provider with the same id. */
|
|
5283
|
-
register(provider) {
|
|
5284
|
-
this.providers.set(provider.id, provider);
|
|
5285
|
-
}
|
|
5286
|
-
/** Look up a single provider by id. */
|
|
5287
|
-
get(id) {
|
|
5288
|
-
return this.providers.get(id);
|
|
5289
|
-
}
|
|
5290
|
-
/**
|
|
5291
|
-
* Return all registered providers whose id appears in the config's
|
|
5292
|
-
* `providers` list with `enabled: true`.
|
|
5293
|
-
*/
|
|
5294
|
-
listEnabled(config) {
|
|
5295
|
-
const enabledIds = new Set(
|
|
5296
|
-
config.providers.filter((p) => p.enabled).map((p) => p.id)
|
|
5297
|
-
);
|
|
5298
|
-
const result = [];
|
|
5299
|
-
for (const [id, provider] of this.providers.entries()) {
|
|
5300
|
-
if (enabledIds.has(id)) {
|
|
5301
|
-
result.push(provider);
|
|
5302
|
-
}
|
|
5303
|
-
}
|
|
5304
|
-
return result;
|
|
5305
|
-
}
|
|
5306
|
-
/**
|
|
5307
|
-
* Return providers that should run for a given importance level.
|
|
5308
|
-
* Providers are resolved from `config.importanceThresholds[level]` and
|
|
5309
|
-
* filtered to only those that are both registered and enabled.
|
|
5310
|
-
*/
|
|
5311
|
-
getForImportance(level, config) {
|
|
5312
|
-
if (level === "trivial") return [];
|
|
5313
|
-
const thresholds = config.importanceThresholds;
|
|
5314
|
-
const providerIds = level === "critical" ? thresholds.critical : level === "high" ? thresholds.high : level === "normal" ? thresholds.normal : thresholds.low;
|
|
5315
|
-
const enabledIds = new Set(
|
|
5316
|
-
config.providers.filter((p) => p.enabled).map((p) => p.id)
|
|
5317
|
-
);
|
|
5318
|
-
const result = [];
|
|
5319
|
-
for (const id of providerIds) {
|
|
5320
|
-
if (!enabledIds.has(id)) continue;
|
|
5321
|
-
const provider = this.providers.get(id);
|
|
5322
|
-
if (provider) {
|
|
5323
|
-
result.push(provider);
|
|
5324
|
-
}
|
|
5325
|
-
}
|
|
5326
|
-
return result;
|
|
5327
|
-
}
|
|
5328
|
-
};
|
|
5329
|
-
|
|
5330
|
-
// src/enrichment/web-search-provider.ts
|
|
5331
|
-
var WebSearchProvider = class {
|
|
5332
|
-
id = "web-search";
|
|
5333
|
-
costTier = "cheap";
|
|
5334
|
-
searchFn;
|
|
5335
|
-
constructor(options = {}) {
|
|
5336
|
-
this.searchFn = options.searchFn;
|
|
5337
|
-
}
|
|
5338
|
-
async isAvailable() {
|
|
5339
|
-
return this.searchFn !== void 0;
|
|
5340
|
-
}
|
|
5341
|
-
async enrich(entity) {
|
|
5342
|
-
if (!this.searchFn) return [];
|
|
5343
|
-
const query = `${entity.name} ${entity.type}`;
|
|
5344
|
-
let snippets;
|
|
5345
|
-
try {
|
|
5346
|
-
snippets = await this.searchFn(query);
|
|
5347
|
-
} catch {
|
|
5348
|
-
return [];
|
|
5349
|
-
}
|
|
5350
|
-
return snippets.filter((s) => typeof s === "string" && s.trim().length > 0).map((snippet) => ({
|
|
5351
|
-
text: snippet.trim(),
|
|
5352
|
-
source: this.id,
|
|
5353
|
-
sourceUrl: void 0,
|
|
5354
|
-
confidence: 0.5,
|
|
5355
|
-
category: "fact",
|
|
5356
|
-
tags: ["web-search"]
|
|
5357
|
-
}));
|
|
5358
|
-
}
|
|
5359
|
-
};
|
|
5360
|
-
|
|
5361
|
-
// src/enrichment/pipeline.ts
|
|
5362
|
-
function isRateLimited(provider, config, buckets) {
|
|
5363
|
-
const providerCfg = config.providers.find((p) => p.id === provider.id);
|
|
5364
|
-
if (!providerCfg?.rateLimit) return false;
|
|
5365
|
-
const now = Date.now();
|
|
5366
|
-
let bucket = buckets.get(provider.id);
|
|
5367
|
-
if (!bucket) {
|
|
5368
|
-
bucket = {
|
|
5369
|
-
minuteCount: 0,
|
|
5370
|
-
minuteReset: now + 6e4,
|
|
5371
|
-
dayCount: 0,
|
|
5372
|
-
dayReset: now + 864e5
|
|
5373
|
-
};
|
|
5374
|
-
buckets.set(provider.id, bucket);
|
|
5375
|
-
}
|
|
5376
|
-
if (now >= bucket.minuteReset) {
|
|
5377
|
-
bucket.minuteCount = 0;
|
|
5378
|
-
bucket.minuteReset = now + 6e4;
|
|
5379
|
-
}
|
|
5380
|
-
if (now >= bucket.dayReset) {
|
|
5381
|
-
bucket.dayCount = 0;
|
|
5382
|
-
bucket.dayReset = now + 864e5;
|
|
5383
|
-
}
|
|
5384
|
-
const { maxPerMinute, maxPerDay } = providerCfg.rateLimit;
|
|
5385
|
-
return bucket.minuteCount >= maxPerMinute || bucket.dayCount >= maxPerDay;
|
|
5386
|
-
}
|
|
5387
|
-
function recordCall(providerId, buckets) {
|
|
5388
|
-
const bucket = buckets.get(providerId);
|
|
5389
|
-
if (bucket) {
|
|
5390
|
-
bucket.minuteCount += 1;
|
|
5391
|
-
bucket.dayCount += 1;
|
|
5392
|
-
}
|
|
5393
|
-
}
|
|
5394
|
-
async function runEnrichmentPipeline(entities, registry, config, log2) {
|
|
5395
|
-
if (!config.enabled) return [];
|
|
5396
|
-
if (entities.length === 0) return [];
|
|
5397
|
-
const rateBuckets = /* @__PURE__ */ new Map();
|
|
5398
|
-
const results = [];
|
|
5399
|
-
for (const entity of entities) {
|
|
5400
|
-
const providers = registry.getForImportance(entity.importanceLevel, config);
|
|
5401
|
-
for (const provider of providers) {
|
|
5402
|
-
const start = Date.now();
|
|
5403
|
-
let available;
|
|
5404
|
-
try {
|
|
5405
|
-
available = await provider.isAvailable();
|
|
5406
|
-
} catch {
|
|
5407
|
-
available = false;
|
|
5408
|
-
}
|
|
5409
|
-
if (!available) {
|
|
5410
|
-
log2.debug?.(
|
|
5411
|
-
`enrichment: skipping provider ${provider.id} for ${entity.name} \u2014 unavailable`
|
|
5412
|
-
);
|
|
5413
|
-
results.push({
|
|
5414
|
-
entityName: entity.name,
|
|
5415
|
-
provider: provider.id,
|
|
5416
|
-
candidatesFound: 0,
|
|
5417
|
-
candidatesAccepted: 0,
|
|
5418
|
-
candidatesRejected: 0,
|
|
5419
|
-
acceptedCandidates: [],
|
|
5420
|
-
elapsed: Date.now() - start
|
|
5421
|
-
});
|
|
5422
|
-
continue;
|
|
5423
|
-
}
|
|
5424
|
-
if (isRateLimited(provider, config, rateBuckets)) {
|
|
5425
|
-
log2.debug?.(
|
|
5426
|
-
`enrichment: skipping provider ${provider.id} for ${entity.name} \u2014 rate limited`
|
|
5427
|
-
);
|
|
5428
|
-
results.push({
|
|
5429
|
-
entityName: entity.name,
|
|
5430
|
-
provider: provider.id,
|
|
5431
|
-
candidatesFound: 0,
|
|
5432
|
-
candidatesAccepted: 0,
|
|
5433
|
-
candidatesRejected: 0,
|
|
5434
|
-
acceptedCandidates: [],
|
|
5435
|
-
elapsed: Date.now() - start
|
|
5436
|
-
});
|
|
5437
|
-
continue;
|
|
5438
|
-
}
|
|
5439
|
-
let candidates;
|
|
5440
|
-
try {
|
|
5441
|
-
candidates = await provider.enrich(entity);
|
|
5442
|
-
} catch (err) {
|
|
5443
|
-
recordCall(provider.id, rateBuckets);
|
|
5444
|
-
log2.error?.(
|
|
5445
|
-
`enrichment: provider ${provider.id} failed for ${entity.name}: ${err instanceof Error ? err.message : String(err)}`
|
|
5446
|
-
);
|
|
5447
|
-
results.push({
|
|
5448
|
-
entityName: entity.name,
|
|
5449
|
-
provider: provider.id,
|
|
5450
|
-
candidatesFound: 0,
|
|
5451
|
-
candidatesAccepted: 0,
|
|
5452
|
-
candidatesRejected: 0,
|
|
5453
|
-
acceptedCandidates: [],
|
|
5454
|
-
elapsed: Date.now() - start
|
|
5455
|
-
});
|
|
5456
|
-
continue;
|
|
5457
|
-
}
|
|
5458
|
-
recordCall(provider.id, rateBuckets);
|
|
5459
|
-
for (const candidate of candidates) {
|
|
5460
|
-
candidate.source = provider.id;
|
|
5461
|
-
}
|
|
5462
|
-
const maxCandidates = config.maxCandidatesPerEntity;
|
|
5463
|
-
let accepted;
|
|
5464
|
-
if (maxCandidates === 0) {
|
|
5465
|
-
accepted = [];
|
|
5466
|
-
} else if (maxCandidates > 0 && candidates.length > maxCandidates) {
|
|
5467
|
-
accepted = candidates.slice(0, maxCandidates);
|
|
5468
|
-
} else {
|
|
5469
|
-
accepted = candidates;
|
|
5470
|
-
}
|
|
5471
|
-
const rejected = candidates.length - accepted.length;
|
|
5472
|
-
results.push({
|
|
5473
|
-
entityName: entity.name,
|
|
5474
|
-
provider: provider.id,
|
|
5475
|
-
candidatesFound: candidates.length,
|
|
5476
|
-
candidatesAccepted: accepted.length,
|
|
5477
|
-
candidatesRejected: rejected,
|
|
5478
|
-
acceptedCandidates: accepted,
|
|
5479
|
-
elapsed: Date.now() - start
|
|
5480
|
-
});
|
|
5481
|
-
}
|
|
5482
|
-
}
|
|
5483
|
-
return results;
|
|
5484
|
-
}
|
|
5485
|
-
|
|
5486
|
-
// src/enrichment/audit.ts
|
|
5487
|
-
import { mkdir, readFile, appendFile } from "fs/promises";
|
|
5488
|
-
import { existsSync } from "fs";
|
|
5489
|
-
import path16 from "path";
|
|
5490
|
-
var AUDIT_FILENAME = "enrichment-audit.jsonl";
|
|
5491
|
-
function auditFilePath(auditDir) {
|
|
5492
|
-
return path16.join(auditDir, AUDIT_FILENAME);
|
|
5493
|
-
}
|
|
5494
|
-
async function appendAuditEntry(auditDir, entry) {
|
|
5495
|
-
await mkdir(auditDir, { recursive: true });
|
|
5496
|
-
const line = JSON.stringify(entry) + "\n";
|
|
5497
|
-
await appendFile(auditFilePath(auditDir), line, "utf-8");
|
|
5498
|
-
}
|
|
5499
|
-
async function readAuditLog(auditDir, since) {
|
|
5500
|
-
const filePath = auditFilePath(auditDir);
|
|
5501
|
-
if (!existsSync(filePath)) return [];
|
|
5502
|
-
const raw = await readFile(filePath, "utf-8");
|
|
5503
|
-
const entries = [];
|
|
5504
|
-
for (const line of raw.split("\n")) {
|
|
5505
|
-
const trimmed = line.trim();
|
|
5506
|
-
if (trimmed.length === 0) continue;
|
|
5507
|
-
try {
|
|
5508
|
-
const parsed = JSON.parse(trimmed);
|
|
5509
|
-
if (typeof parsed === "object" && parsed !== null && "timestamp" in parsed && "entityName" in parsed) {
|
|
5510
|
-
const entry = parsed;
|
|
5511
|
-
if (since && entry.timestamp < since) continue;
|
|
5512
|
-
entries.push(entry);
|
|
5513
|
-
}
|
|
5514
|
-
} catch {
|
|
5515
|
-
}
|
|
5516
|
-
}
|
|
5517
|
-
return entries;
|
|
5518
|
-
}
|
|
5519
|
-
|
|
5520
3505
|
// src/importers/base.ts
|
|
5521
3506
|
var DEFAULT_IMPORT_BATCH_SIZE = 25;
|
|
5522
3507
|
var MIN_IMPORT_BATCH_SIZE = 1;
|
|
@@ -5638,20 +3623,20 @@ async function defaultWriteMemoriesToOrchestrator(target, memories) {
|
|
|
5638
3623
|
}
|
|
5639
3624
|
|
|
5640
3625
|
// src/transfer/capsule-fork.ts
|
|
5641
|
-
import { lstat, mkdir
|
|
5642
|
-
import
|
|
3626
|
+
import { lstat, mkdir, readFile, realpath, writeFile } from "fs/promises";
|
|
3627
|
+
import path14 from "path";
|
|
5643
3628
|
async function forkCapsule(opts) {
|
|
5644
3629
|
validateForkId(opts.forkId);
|
|
5645
|
-
const rootAbs =
|
|
3630
|
+
const rootAbs = path14.resolve(opts.targetRoot);
|
|
5646
3631
|
await assertIsDirectoryNotSymlink(rootAbs, "forkCapsule", "targetRoot");
|
|
5647
|
-
const forkDirAbs =
|
|
3632
|
+
const forkDirAbs = path14.join(rootAbs, "forks", opts.forkId);
|
|
5648
3633
|
const forkEntryExists = await pathEntryExists(forkDirAbs);
|
|
5649
3634
|
if (forkEntryExists) {
|
|
5650
3635
|
throw new Error(
|
|
5651
3636
|
`forkCapsule: fork path already exists \u2014 forkId "${opts.forkId}" is already in use at: ${forkDirAbs}`
|
|
5652
3637
|
);
|
|
5653
3638
|
}
|
|
5654
|
-
const archiveAbs =
|
|
3639
|
+
const archiveAbs = path14.resolve(opts.sourceArchive);
|
|
5655
3640
|
const importResult = await importCapsule({
|
|
5656
3641
|
archivePath: archiveAbs,
|
|
5657
3642
|
root: rootAbs,
|
|
@@ -5673,10 +3658,10 @@ async function forkCapsule(opts) {
|
|
|
5673
3658
|
importedRecords: importResult.imported.length,
|
|
5674
3659
|
skippedRecords: importResult.skipped.length
|
|
5675
3660
|
};
|
|
5676
|
-
const lineagePath =
|
|
3661
|
+
const lineagePath = path14.join(forkDirAbs, "lineage.json");
|
|
5677
3662
|
const rootReal = await realpath(rootAbs);
|
|
5678
3663
|
await assertRealpathInsideRoot(rootReal, lineagePath, `forks/${opts.forkId}/lineage.json`, "forkCapsule");
|
|
5679
|
-
await
|
|
3664
|
+
await mkdir(path14.dirname(lineagePath), { recursive: true });
|
|
5680
3665
|
await writeFile(lineagePath, JSON.stringify(lineage, null, 2) + "\n", "utf-8");
|
|
5681
3666
|
return {
|
|
5682
3667
|
archivePath: archiveAbs,
|
|
@@ -5690,17 +3675,17 @@ async function readForkLineage(targetRoot, forkId) {
|
|
|
5690
3675
|
if (typeof forkId !== "string" || forkId.length === 0 || forkId.length > 64 || !CAPSULE_ID_PATTERN.test(forkId)) {
|
|
5691
3676
|
return null;
|
|
5692
3677
|
}
|
|
5693
|
-
const rootAbs =
|
|
3678
|
+
const rootAbs = path14.resolve(targetRoot);
|
|
5694
3679
|
const rootReal = await realpath(rootAbs).catch(() => rootAbs);
|
|
5695
|
-
const lineagePath =
|
|
5696
|
-
const rel =
|
|
5697
|
-
if (rel.startsWith("..") ||
|
|
3680
|
+
const lineagePath = path14.join(rootReal, "forks", forkId, "lineage.json");
|
|
3681
|
+
const rel = path14.relative(rootReal, lineagePath);
|
|
3682
|
+
if (rel.startsWith("..") || path14.isAbsolute(rel)) {
|
|
5698
3683
|
return null;
|
|
5699
3684
|
}
|
|
5700
3685
|
if (!await isLineagePathContained(rootReal, lineagePath)) {
|
|
5701
3686
|
return null;
|
|
5702
3687
|
}
|
|
5703
|
-
const raw = await
|
|
3688
|
+
const raw = await readFile(lineagePath, "utf-8").catch(() => null);
|
|
5704
3689
|
if (raw === null) return null;
|
|
5705
3690
|
try {
|
|
5706
3691
|
const parsed = JSON.parse(raw);
|
|
@@ -5735,22 +3720,27 @@ async function pathEntryExists(absPath) {
|
|
|
5735
3720
|
async function isLineagePathContained(rootReal, lineagePath) {
|
|
5736
3721
|
let existing = lineagePath;
|
|
5737
3722
|
const suffix = [];
|
|
5738
|
-
while (existing !==
|
|
3723
|
+
while (existing !== path14.dirname(existing)) {
|
|
5739
3724
|
const st = await lstat(existing).catch(() => null);
|
|
5740
3725
|
if (st !== null) break;
|
|
5741
|
-
suffix.unshift(
|
|
5742
|
-
existing =
|
|
3726
|
+
suffix.unshift(path14.basename(existing));
|
|
3727
|
+
existing = path14.dirname(existing);
|
|
5743
3728
|
}
|
|
5744
3729
|
const existingReal = await realpath(existing).catch(() => existing);
|
|
5745
|
-
const targetReal = suffix.length > 0 ?
|
|
5746
|
-
const rel =
|
|
3730
|
+
const targetReal = suffix.length > 0 ? path14.join(existingReal, ...suffix) : existingReal;
|
|
3731
|
+
const rel = path14.relative(rootReal, targetReal);
|
|
5747
3732
|
if (rel === "") return true;
|
|
5748
3733
|
if (rel === "..") return false;
|
|
5749
|
-
if (rel.startsWith(`..${
|
|
5750
|
-
if (
|
|
3734
|
+
if (rel.startsWith(`..${path14.sep}`)) return false;
|
|
3735
|
+
if (path14.isAbsolute(rel)) return false;
|
|
5751
3736
|
return true;
|
|
5752
3737
|
}
|
|
5753
3738
|
export {
|
|
3739
|
+
ACTION_CONFIDENCE_CONTEXT_READINESS,
|
|
3740
|
+
ACTION_CONFIDENCE_DECISIONS,
|
|
3741
|
+
ACTION_CONFIDENCE_RISK_CATEGORIES,
|
|
3742
|
+
ACTION_CONFIDENCE_RULE_KINDS,
|
|
3743
|
+
ACTIVE_STATUSES,
|
|
5754
3744
|
AccessAuditAdapter,
|
|
5755
3745
|
BRIEFING_FORMAT_ALLOWED,
|
|
5756
3746
|
BootstrapEngine,
|
|
@@ -5797,6 +3787,7 @@ export {
|
|
|
5797
3787
|
MARKETPLACE_SCHEMA_VERSION,
|
|
5798
3788
|
MATERIALIZE_VERSION,
|
|
5799
3789
|
MeilisearchBackend,
|
|
3790
|
+
ModelRegistry,
|
|
5800
3791
|
NOTION_CONNECTOR_ID,
|
|
5801
3792
|
NOTION_CURSOR_KIND,
|
|
5802
3793
|
NOTION_DEFAULT_POLL_INTERVAL_MS,
|
|
@@ -5811,6 +3802,11 @@ export {
|
|
|
5811
3802
|
QmdClient,
|
|
5812
3803
|
RECALL_DISCLOSURE_LEVELS,
|
|
5813
3804
|
RECALL_XRAY_FORMATS,
|
|
3805
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_CANONICAL_TOOL,
|
|
3806
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_MIME_TYPE,
|
|
3807
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_TOOL,
|
|
3808
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_HTML,
|
|
3809
|
+
REMNIC_CHATGPT_MEMORY_INSPECTOR_WIDGET_URI,
|
|
5814
3810
|
REMNIC_CITATION_FORMAT,
|
|
5815
3811
|
REMNIC_EXTENSIONS_TOTAL_TOKEN_LIMIT,
|
|
5816
3812
|
REMNIC_MCP_TOOL_INVENTORY,
|
|
@@ -5819,6 +3815,10 @@ export {
|
|
|
5819
3815
|
SENTINEL_FILE,
|
|
5820
3816
|
SmartBuffer,
|
|
5821
3817
|
StorageManager,
|
|
3818
|
+
USER_BOUNDARY_SCOPES,
|
|
3819
|
+
USER_CONTEXT_SCOPES,
|
|
3820
|
+
USER_MODEL_CORE_QUESTION,
|
|
3821
|
+
USER_MODEL_DIMENSIONS,
|
|
5822
3822
|
WebSearchProvider,
|
|
5823
3823
|
appendAuditEntry,
|
|
5824
3824
|
appendInteractionLog,
|
|
@@ -5829,17 +3829,25 @@ export {
|
|
|
5829
3829
|
attachCitation,
|
|
5830
3830
|
branchNamespaceName,
|
|
5831
3831
|
briefingFilename,
|
|
3832
|
+
buildActionConfidenceInputFromOptions,
|
|
5832
3833
|
buildBriefing,
|
|
3834
|
+
buildChatGptMemoryInspectorActionRequest,
|
|
3835
|
+
buildChatGptMemoryInspectorResult,
|
|
5833
3836
|
buildCitationGuidance,
|
|
5834
3837
|
buildEntityRecallSection,
|
|
3838
|
+
buildEventOrderRecallSection,
|
|
5835
3839
|
buildEvidencePack,
|
|
5836
3840
|
buildExplicitCueRecallSection,
|
|
5837
3841
|
buildExtensionsBlockForConsolidation,
|
|
5838
3842
|
buildExtensionsFooterForSummary,
|
|
3843
|
+
buildFocusedListRecallSection,
|
|
5839
3844
|
buildGraphFromMemories,
|
|
5840
3845
|
buildMemoryWorthCounterMap,
|
|
5841
3846
|
buildProcedureMarkdownBody,
|
|
5842
3847
|
buildProcedureRecallSection,
|
|
3848
|
+
buildResponseGuidanceRecallSection,
|
|
3849
|
+
buildRetrievedMemoryProvenance,
|
|
3850
|
+
buildTargetedFactRecallSection,
|
|
5843
3851
|
buildTrajectoryAnalysisRecallSection,
|
|
5844
3852
|
builtInLiveConnectorDefinitions,
|
|
5845
3853
|
checkMarketplaceManifest,
|
|
@@ -5849,12 +3857,14 @@ export {
|
|
|
5849
3857
|
clearVerdictCache,
|
|
5850
3858
|
coerceInstallExtension,
|
|
5851
3859
|
collectBenchmarkAnchorCues,
|
|
3860
|
+
collectContentLexicalCues,
|
|
5852
3861
|
collectExplicitTurnReferences,
|
|
5853
3862
|
collectLexicalCues,
|
|
5854
3863
|
collectQuestionSlotCues,
|
|
5855
3864
|
collectStructuredPlanCues,
|
|
5856
3865
|
collectTemporalLexicalCues,
|
|
5857
3866
|
computeMemoryWorth,
|
|
3867
|
+
computePairId,
|
|
5858
3868
|
computeProcedureStats,
|
|
5859
3869
|
computeSurprise,
|
|
5860
3870
|
computeTierValueScore,
|
|
@@ -5883,8 +3893,11 @@ export {
|
|
|
5883
3893
|
emptyManifest,
|
|
5884
3894
|
ensureLcmStateDir,
|
|
5885
3895
|
ensureSentinel,
|
|
3896
|
+
evaluateActionConfidence,
|
|
3897
|
+
executeResolution,
|
|
5886
3898
|
expandTildePath,
|
|
5887
3899
|
extractGraphEdges,
|
|
3900
|
+
facetHasBoundary,
|
|
5888
3901
|
findContradictions,
|
|
5889
3902
|
findDuplicates,
|
|
5890
3903
|
focusMatchesEntity,
|
|
@@ -5904,6 +3917,7 @@ export {
|
|
|
5904
3917
|
getAllValidTokensCached,
|
|
5905
3918
|
getAuditLog,
|
|
5906
3919
|
getBulkImportSource,
|
|
3920
|
+
getConnectorToken,
|
|
5907
3921
|
getManifestPath,
|
|
5908
3922
|
getMemoryForActiveMemory,
|
|
5909
3923
|
getSpacesDir,
|
|
@@ -5923,23 +3937,31 @@ export {
|
|
|
5923
3937
|
installFromMarketplace,
|
|
5924
3938
|
intentCompatibilityScore,
|
|
5925
3939
|
isAgentAccessSecretRef,
|
|
3940
|
+
isCoolingDown,
|
|
5926
3941
|
isDirectAnswerEligible,
|
|
5927
3942
|
isDurableVerdict,
|
|
5928
3943
|
isEdgeType,
|
|
5929
3944
|
isImportRole,
|
|
5930
3945
|
isLcmMessagePartKind,
|
|
5931
3946
|
isNodeType,
|
|
3947
|
+
isOpenaiApiKeyDisabled,
|
|
5932
3948
|
isReasoningTracePath,
|
|
5933
3949
|
isRecallDisclosure,
|
|
5934
3950
|
isReviewPrompt,
|
|
5935
3951
|
isTaskInitiationIntent,
|
|
5936
3952
|
isTrustZoneName,
|
|
3953
|
+
isUserBoundaryScope,
|
|
3954
|
+
isUserContextScope,
|
|
3955
|
+
isUserModelDimension,
|
|
5937
3956
|
isValidCachedVerdict,
|
|
5938
3957
|
isValidConnectorId,
|
|
3958
|
+
isValidResolutionVerb,
|
|
3959
|
+
judgeContradictionPairs,
|
|
5939
3960
|
judgeFactDurability,
|
|
5940
3961
|
listBulkImportSources,
|
|
5941
3962
|
listConnectorStates,
|
|
5942
3963
|
listConnectors,
|
|
3964
|
+
listPairs,
|
|
5943
3965
|
listPeers,
|
|
5944
3966
|
listReviewItems,
|
|
5945
3967
|
listSpaces,
|
|
@@ -5964,8 +3986,13 @@ export {
|
|
|
5964
3986
|
normalizeCachedVerdict,
|
|
5965
3987
|
normalizeExplicitParts,
|
|
5966
3988
|
normalizeOriginUrl,
|
|
3989
|
+
normalizeProjectionPreview,
|
|
3990
|
+
normalizeProjectionTags,
|
|
5967
3991
|
normalizeQueryText,
|
|
3992
|
+
normalizeRetrievedMemoryProvenance,
|
|
5968
3993
|
normalizeTurnExpansionEnd,
|
|
3994
|
+
normalizeUserContextScope,
|
|
3995
|
+
normalizeUserModelDimension,
|
|
5969
3996
|
observeRequestSchema,
|
|
5970
3997
|
onboard,
|
|
5971
3998
|
openLcmDatabase,
|
|
@@ -5980,11 +4007,16 @@ export {
|
|
|
5980
4007
|
parseConnectorsListOptions,
|
|
5981
4008
|
parseConnectorsRunName,
|
|
5982
4009
|
parseConnectorsStatusOptions,
|
|
4010
|
+
parseEntityFile,
|
|
4011
|
+
parseFlexibleIsoTimestamp,
|
|
4012
|
+
parseIsoOffsetTimestamp,
|
|
5983
4013
|
parseIsoTimestamp,
|
|
4014
|
+
parseIsoUtcTimestamp,
|
|
5984
4015
|
parseMessageParts,
|
|
5985
4016
|
parseOaiMemCitation,
|
|
5986
4017
|
parseOpenAiMessageParts,
|
|
5987
4018
|
parseOpenClawMessageParts,
|
|
4019
|
+
parsePiMessageParts,
|
|
5988
4020
|
parseProcedureStepsFromBody,
|
|
5989
4021
|
parseStrictCliDate,
|
|
5990
4022
|
parseTouchedFiles,
|
|
@@ -6007,6 +4039,7 @@ export {
|
|
|
6007
4039
|
readForkLineage,
|
|
6008
4040
|
readInteractionLogRaw,
|
|
6009
4041
|
readManifest,
|
|
4042
|
+
readPair,
|
|
6010
4043
|
readPeer,
|
|
6011
4044
|
readPeerProfile,
|
|
6012
4045
|
recallForActiveMemory,
|
|
@@ -6016,6 +4049,7 @@ export {
|
|
|
6016
4049
|
registerPublisher,
|
|
6017
4050
|
registerTrainingExportAdapter,
|
|
6018
4051
|
removeConnector,
|
|
4052
|
+
renderActionConfidenceText,
|
|
6019
4053
|
renderBriefingMarkdown,
|
|
6020
4054
|
renderConnectorsList,
|
|
6021
4055
|
renderConnectorsRunResult,
|
|
@@ -6031,8 +4065,10 @@ export {
|
|
|
6031
4065
|
resolveCategory,
|
|
6032
4066
|
resolveCodingNamespaceOverlay,
|
|
6033
4067
|
resolveConnectorFromToken,
|
|
4068
|
+
resolveEnvVars,
|
|
6034
4069
|
resolveExtensionsRoot,
|
|
6035
4070
|
resolveGitContext,
|
|
4071
|
+
resolvePair,
|
|
6036
4072
|
resolvePrincipal,
|
|
6037
4073
|
resolveRemnicPluginEntry,
|
|
6038
4074
|
revertToVersion,
|
|
@@ -6043,6 +4079,7 @@ export {
|
|
|
6043
4079
|
runBulkImportPipeline,
|
|
6044
4080
|
runCodexMaterialize,
|
|
6045
4081
|
runConnectorPollOnce,
|
|
4082
|
+
runContradictionScan,
|
|
6046
4083
|
runEnrichmentPipeline,
|
|
6047
4084
|
runGraphRecall,
|
|
6048
4085
|
runImporter,
|
|
@@ -6055,11 +4092,18 @@ export {
|
|
|
6055
4092
|
saveTaxonomy,
|
|
6056
4093
|
saveTokenStore,
|
|
6057
4094
|
scanForBinaries,
|
|
4095
|
+
serializeEntityFile,
|
|
6058
4096
|
setCodexCliFallbackRunnerForProcess,
|
|
6059
4097
|
shareSpace,
|
|
4098
|
+
shouldRecallEventOrderEvidence,
|
|
4099
|
+
shouldRecallFocusedListEvidence,
|
|
4100
|
+
shouldRecallResponseGuidance,
|
|
4101
|
+
shouldRecallTargetedFactEvidence,
|
|
6060
4102
|
stableHash,
|
|
6061
4103
|
stripCitation,
|
|
6062
4104
|
suggestionSubmitRequestSchema,
|
|
4105
|
+
summarizeRetrievedMemoryProvenance,
|
|
4106
|
+
summarizeUserModelCoverage,
|
|
6063
4107
|
switchSpace,
|
|
6064
4108
|
syncChanges,
|
|
6065
4109
|
validateBriefingFormat,
|
|
@@ -6077,6 +4121,8 @@ export {
|
|
|
6077
4121
|
writeConnectorState,
|
|
6078
4122
|
writeManifest,
|
|
6079
4123
|
writeMarketplaceManifest,
|
|
4124
|
+
writePair,
|
|
4125
|
+
writePairs,
|
|
6080
4126
|
writePeer,
|
|
6081
4127
|
writePeerProfile
|
|
6082
4128
|
};
|