@remnic/core 1.1.11 → 1.1.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/access-cli.d.ts +2 -1
- package/dist/access-cli.js +293 -104
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +31 -62
- package/dist/access-http.js +53 -35
- package/dist/access-mcp.d.ts +31 -8
- package/dist/access-mcp.js +45 -34
- package/dist/access-schema.d.ts +197 -14
- package/dist/access-schema.js +16 -5
- package/dist/access-service-DcCDmNYC.d.ts +1542 -0
- package/dist/access-service.d.ts +30 -9
- package/dist/access-service.js +42 -32
- package/dist/action-confidence.d.ts +83 -0
- package/dist/action-confidence.js +22 -0
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +11 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/claude-code.d.ts +24 -0
- package/dist/adapters/claude-code.js +9 -0
- package/dist/adapters/codex.d.ts +25 -0
- package/dist/adapters/codex.js +9 -0
- package/dist/adapters/hermes.d.ts +35 -0
- package/dist/adapters/hermes.js +9 -0
- package/dist/adapters/index.d.ts +6 -0
- package/dist/adapters/index.js +26 -0
- package/dist/adapters/registry.d.ts +20 -0
- package/dist/adapters/registry.js +13 -0
- package/dist/adapters/replit.d.ts +28 -0
- package/dist/adapters/replit.js +9 -0
- package/dist/adapters/types.d.ts +43 -0
- package/dist/adapters/types.js +8 -0
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +23 -6
- package/dist/boxes.d.ts +7 -0
- package/dist/boxes.js +1 -1
- package/dist/briefing.d.ts +5 -3
- package/dist/briefing.js +10 -7
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-surprise-report.js +1 -1
- package/dist/buffer.d.ts +18 -4
- package/dist/buffer.js +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +6 -6
- package/dist/capsule-cli.d.ts +4 -4
- package/dist/capsule-cli.js +1 -1
- package/dist/capsule-crypto-5CYAGVC5.js +18 -0
- package/dist/capsule-merge-4MGKE7C5.js +189 -0
- package/dist/causal-behavior.d.ts +9 -29
- package/dist/causal-behavior.js +6 -3
- package/dist/causal-behavior.js.map +1 -1
- package/dist/causal-chain.js +3 -2
- package/dist/causal-consolidation.d.ts +2 -2
- package/dist/causal-consolidation.js +28 -17
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory.js +1 -1
- package/dist/chunk-25MQ7IHJ.js +427 -0
- package/dist/chunk-25MQ7IHJ.js.map +1 -0
- package/dist/chunk-2F2W355T.js +256 -0
- package/dist/chunk-2F2W355T.js.map +1 -0
- package/dist/chunk-2KI4QFHU.js +228 -0
- package/dist/chunk-2KI4QFHU.js.map +1 -0
- package/dist/chunk-2PRQG7PV.js +86 -0
- package/dist/chunk-2PRQG7PV.js.map +1 -0
- package/dist/chunk-2QR3XXIC.js +2272 -0
- package/dist/chunk-2QR3XXIC.js.map +1 -0
- package/dist/chunk-2WWLHTZY.js +121 -0
- package/dist/chunk-326G7DJK.js +2185 -0
- package/dist/chunk-326G7DJK.js.map +1 -0
- package/dist/chunk-34DQE4KF.js +174 -0
- package/dist/chunk-34DQE4KF.js.map +1 -0
- package/dist/chunk-3APJ5EVB.js +601 -0
- package/dist/chunk-3APJ5EVB.js.map +1 -0
- package/dist/chunk-3HPAPHUK.js +51 -0
- package/dist/chunk-3HPAPHUK.js.map +1 -0
- package/dist/chunk-3JXBXXM2.js +69 -0
- package/dist/chunk-3JXBXXM2.js.map +1 -0
- package/dist/chunk-3KW65B36.js +681 -0
- package/dist/chunk-3KW65B36.js.map +1 -0
- package/dist/chunk-3UXOZBHV.js +20 -0
- package/dist/chunk-3UXOZBHV.js.map +1 -0
- package/dist/chunk-3VAL7ZL2.js +266 -0
- package/dist/chunk-3VAL7ZL2.js.map +1 -0
- package/dist/chunk-3Y4P7RXM.js +31 -0
- package/dist/chunk-3Y4P7RXM.js.map +1 -0
- package/dist/chunk-47VWKCAF.js +273 -0
- package/dist/chunk-47VWKCAF.js.map +1 -0
- package/dist/chunk-4CRG46BG.js +271 -0
- package/dist/chunk-4RA3C3EV.js +60 -0
- package/dist/chunk-4RA3C3EV.js.map +1 -0
- package/dist/chunk-5375UYTQ.js +914 -0
- package/dist/chunk-5375UYTQ.js.map +1 -0
- package/dist/chunk-56K5QLHX.js +506 -0
- package/dist/chunk-56K5QLHX.js.map +1 -0
- package/dist/chunk-5NXIJZFX.js +180 -0
- package/dist/chunk-5NXIJZFX.js.map +1 -0
- package/dist/chunk-5RGLBDQF.js +596 -0
- package/dist/chunk-5RGLBDQF.js.map +1 -0
- package/dist/chunk-5UZXUTVO.js +9 -0
- package/dist/chunk-5UZXUTVO.js.map +1 -0
- package/dist/chunk-65PG43EQ.js +105 -0
- package/dist/chunk-65PG43EQ.js.map +1 -0
- package/dist/chunk-66DHUKLO.js +57 -0
- package/dist/chunk-66DHUKLO.js.map +1 -0
- package/dist/chunk-6FC5EGNV.js +46 -0
- package/dist/chunk-6FC5EGNV.js.map +1 -0
- package/dist/chunk-6H2TESSP.js +62 -0
- package/dist/chunk-6H2TESSP.js.map +1 -0
- package/dist/chunk-6LVVDPJ4.js +32 -0
- package/dist/chunk-6LVVDPJ4.js.map +1 -0
- package/dist/chunk-6NKAQ74D.js +2237 -0
- package/dist/chunk-6NKAQ74D.js.map +1 -0
- package/dist/chunk-6RVI47ZR.js +159 -0
- package/dist/chunk-6RVI47ZR.js.map +1 -0
- package/dist/chunk-7AAT6G4Q.js +5117 -0
- package/dist/chunk-7AAT6G4Q.js.map +1 -0
- package/dist/chunk-7DTASS5T.js +29 -0
- package/dist/chunk-7DTASS5T.js.map +1 -0
- package/dist/chunk-7IASACLB.js +596 -0
- package/dist/chunk-7MNMYOFP.js +32 -0
- package/dist/chunk-7MNMYOFP.js.map +1 -0
- package/dist/chunk-7N4KAIGN.js +133 -0
- package/dist/chunk-7N4KAIGN.js.map +1 -0
- package/dist/chunk-7OZ53EXP.js +101 -0
- package/dist/chunk-7OZ53EXP.js.map +1 -0
- package/dist/chunk-7XYTQGCC.js +134 -0
- package/dist/chunk-7XYTQGCC.js.map +1 -0
- package/dist/chunk-A2XUIMJ3.js +341 -0
- package/dist/chunk-A2XUIMJ3.js.map +1 -0
- package/dist/chunk-AC5LO7IU.js +308 -0
- package/dist/chunk-AC5LO7IU.js.map +1 -0
- package/dist/chunk-AGZQD76C.js +201 -0
- package/dist/chunk-AGZQD76C.js.map +1 -0
- package/dist/chunk-AH2JUU6X.js +336 -0
- package/dist/chunk-AH2JUU6X.js.map +1 -0
- package/dist/chunk-APO3DCMU.js +361 -0
- package/dist/chunk-APO3DCMU.js.map +1 -0
- package/dist/chunk-BFBF3XEF.js +283 -0
- package/dist/chunk-BFBF3XEF.js.map +1 -0
- package/dist/chunk-BJ3KMYTB.js +1974 -0
- package/dist/chunk-BJ3KMYTB.js.map +1 -0
- package/dist/chunk-C5BCH4ZS.js +317 -0
- package/dist/chunk-C5BCH4ZS.js.map +1 -0
- package/dist/chunk-CHEL3SKB.js +6758 -0
- package/dist/chunk-CHEL3SKB.js.map +1 -0
- package/dist/chunk-CQZRLNMV.js +1491 -0
- package/dist/chunk-CQZRLNMV.js.map +1 -0
- package/dist/chunk-D46YSIYX.js +892 -0
- package/dist/chunk-D46YSIYX.js.map +1 -0
- package/dist/chunk-DB5A3NHS.js +906 -0
- package/dist/chunk-DB5A3NHS.js.map +1 -0
- package/dist/chunk-DINWEURR.js +648 -0
- package/dist/chunk-DINWEURR.js.map +1 -0
- package/dist/chunk-DK5LDEQM.js +530 -0
- package/dist/chunk-DK5LDEQM.js.map +1 -0
- package/dist/chunk-DOM4GKSW.js +34 -0
- package/dist/chunk-DOM4GKSW.js.map +1 -0
- package/dist/chunk-EDTHC6UD.js +1075 -0
- package/dist/chunk-EDTHC6UD.js.map +1 -0
- package/dist/chunk-EFJ3MQ4V.js +721 -0
- package/dist/chunk-EHRTFRWW.js +89 -0
- package/dist/chunk-EHRTFRWW.js.map +1 -0
- package/dist/chunk-FAJ7FZYM.js +11 -0
- package/dist/chunk-FAJ7FZYM.js.map +1 -0
- package/dist/chunk-FBYESMQ2.js +570 -0
- package/dist/chunk-FBYESMQ2.js.map +1 -0
- package/dist/chunk-FDU6HUUL.js +147 -0
- package/dist/chunk-FF4KLI5W.js +99 -0
- package/dist/chunk-FF4KLI5W.js.map +1 -0
- package/dist/chunk-FIT6DMX6.js +310 -0
- package/dist/chunk-FIT6DMX6.js.map +1 -0
- package/dist/chunk-FJ43PRLT.js +272 -0
- package/dist/chunk-FJ43PRLT.js.map +1 -0
- package/dist/chunk-FKFMOY3N.js +32 -0
- package/dist/chunk-FKFMOY3N.js.map +1 -0
- package/dist/chunk-FLTNHQK6.js +262 -0
- package/dist/chunk-FLTNHQK6.js.map +1 -0
- package/dist/chunk-GA454ALV.js +12436 -0
- package/dist/chunk-GA454ALV.js.map +1 -0
- package/dist/chunk-GGKRUQOO.js +228 -0
- package/dist/chunk-GIF42EW3.js +63 -0
- package/dist/chunk-GIF42EW3.js.map +1 -0
- package/dist/chunk-GL6I6MEQ.js +647 -0
- package/dist/chunk-H3ME6L6D.js +709 -0
- package/dist/chunk-H3ME6L6D.js.map +1 -0
- package/dist/chunk-HHLLAQGZ.js +1 -0
- package/dist/chunk-HXXBL2KD.js +2040 -0
- package/dist/chunk-I5V2VDIW.js +219 -0
- package/dist/chunk-I5V2VDIW.js.map +1 -0
- package/dist/chunk-I6K5FBRQ.js +35 -0
- package/dist/chunk-I6K5FBRQ.js.map +1 -0
- package/dist/chunk-ICRIXAP2.js +121 -0
- package/dist/chunk-ICRIXAP2.js.map +1 -0
- package/dist/chunk-J4EB7DNW.js +11 -0
- package/dist/chunk-J4EB7DNW.js.map +1 -0
- package/dist/chunk-JLFA7DQG.js +62 -0
- package/dist/chunk-JLFA7DQG.js.map +1 -0
- package/dist/chunk-KJTKLXTH.js +9 -0
- package/dist/chunk-KJTKLXTH.js.map +1 -0
- package/dist/chunk-KLAO5DGL.js +917 -0
- package/dist/chunk-KLAO5DGL.js.map +1 -0
- package/dist/chunk-KNKUID7G.js +183 -0
- package/dist/chunk-KOSORCJG.js +624 -0
- package/dist/chunk-KOSORCJG.js.map +1 -0
- package/dist/chunk-KUJVMMZQ.js +1262 -0
- package/dist/chunk-KUJVMMZQ.js.map +1 -0
- package/dist/chunk-LCR46JY5.js +123 -0
- package/dist/chunk-LCR46JY5.js.map +1 -0
- package/dist/chunk-LLQ2LLWF.js +148 -0
- package/dist/chunk-LLQ2LLWF.js.map +1 -0
- package/dist/chunk-LPMVBPA3.js +236 -0
- package/dist/chunk-LT3NLYSI.js +50 -0
- package/dist/chunk-LT3NLYSI.js.map +1 -0
- package/dist/chunk-LUDTDZLK.js +287 -0
- package/dist/chunk-LUDTDZLK.js.map +1 -0
- package/dist/chunk-M23FSH32.js +3963 -0
- package/dist/chunk-M23FSH32.js.map +1 -0
- package/dist/chunk-MC26UJIM.js +118 -0
- package/dist/chunk-ME6ESPZU.js +119 -0
- package/dist/chunk-ME6ESPZU.js.map +1 -0
- package/dist/chunk-MGKYQQYF.js +272 -0
- package/dist/chunk-MGKYQQYF.js.map +1 -0
- package/dist/chunk-MJFNCJXV.js +66 -0
- package/dist/chunk-MJFNCJXV.js.map +1 -0
- package/dist/chunk-MSWG7JI6.js +237 -0
- package/dist/chunk-MSWG7JI6.js.map +1 -0
- package/dist/chunk-MT25YHYH.js +141 -0
- package/dist/chunk-MT25YHYH.js.map +1 -0
- package/dist/chunk-MT4HVDUZ.js +53 -0
- package/dist/chunk-MY6TPVXW.js +219 -0
- package/dist/chunk-N2D6GXBM.js +267 -0
- package/dist/chunk-N2D6GXBM.js.map +1 -0
- package/dist/chunk-NJ3MJQZX.js +46 -0
- package/dist/chunk-NJ3MJQZX.js.map +1 -0
- package/dist/chunk-NMZY542O.js +335 -0
- package/dist/chunk-NMZY542O.js.map +1 -0
- package/dist/chunk-NNVTUXEB.js +23 -0
- package/dist/chunk-NZL6GGQE.js +375 -0
- package/dist/chunk-NZL6GGQE.js.map +1 -0
- package/dist/chunk-OAZ5MFUB.js +4124 -0
- package/dist/chunk-OAZ5MFUB.js.map +1 -0
- package/dist/chunk-OIGNEXKZ.js +237 -0
- package/dist/chunk-OIGNEXKZ.js.map +1 -0
- package/dist/chunk-OZKZ2TRP.js +3729 -0
- package/dist/chunk-OZKZ2TRP.js.map +1 -0
- package/dist/chunk-P4NEIHUT.js +108 -0
- package/dist/chunk-P7FMDTKL.js +103 -0
- package/dist/chunk-P7FMDTKL.js.map +1 -0
- package/dist/chunk-PD6O7AXF.js +110 -0
- package/dist/chunk-PD6O7AXF.js.map +1 -0
- package/dist/chunk-PHK3HARR.js +32 -0
- package/dist/chunk-PHK3HARR.js.map +1 -0
- package/dist/chunk-PIRJPV5T.js +98 -0
- package/dist/chunk-PIRJPV5T.js.map +1 -0
- package/dist/chunk-PK7H5L6Y.js +159 -0
- package/dist/chunk-PK7H5L6Y.js.map +1 -0
- package/dist/chunk-PR5FBTFU.js +233 -0
- package/dist/chunk-PR5FBTFU.js.map +1 -0
- package/dist/chunk-PU63GXWS.js +174 -0
- package/dist/chunk-PU63GXWS.js.map +1 -0
- package/dist/chunk-PYPOFEMK.js +294 -0
- package/dist/chunk-PYPOFEMK.js.map +1 -0
- package/dist/chunk-PZIAX57I.js +124 -0
- package/dist/chunk-PZIAX57I.js.map +1 -0
- package/dist/chunk-Q7P4WJDP.js +26 -0
- package/dist/chunk-Q7P4WJDP.js.map +1 -0
- package/dist/chunk-QDZ2RLEC.js +908 -0
- package/dist/chunk-QDZ2RLEC.js.map +1 -0
- package/dist/chunk-QQUAB63I.js +63 -0
- package/dist/chunk-QQUAB63I.js.map +1 -0
- package/dist/chunk-QRNI5JBH.js +18 -0
- package/dist/chunk-RHY3HH7P.js +601 -0
- package/dist/chunk-RHY3HH7P.js.map +1 -0
- package/dist/chunk-RK6F44Y6.js +84 -0
- package/dist/chunk-RK6F44Y6.js.map +1 -0
- package/dist/chunk-RRF5UOBJ.js +91 -0
- package/dist/chunk-RXDLTSWT.js +124 -0
- package/dist/chunk-RXDLTSWT.js.map +1 -0
- package/dist/chunk-RYED3SPJ.js +42 -0
- package/dist/chunk-RYED3SPJ.js.map +1 -0
- package/dist/chunk-S7KDBTWT.js +106 -0
- package/dist/chunk-S7KDBTWT.js.map +1 -0
- package/dist/chunk-SEDEKFYQ.js +1 -0
- package/dist/chunk-SOAU2OE2.js +125 -0
- package/dist/chunk-SOAU2OE2.js.map +1 -0
- package/dist/chunk-TECVW3JP.js +36 -0
- package/dist/chunk-TECVW3JP.js.map +1 -0
- package/dist/chunk-TFO23QT4.js +88 -0
- package/dist/chunk-TFO23QT4.js.map +1 -0
- package/dist/chunk-TK4UEOSK.js +76 -0
- package/dist/chunk-TK4UEOSK.js.map +1 -0
- package/dist/chunk-TKWGAOLV.js +122 -0
- package/dist/chunk-TKWGAOLV.js.map +1 -0
- package/dist/chunk-TMM4S4IJ.js +597 -0
- package/dist/chunk-TMM4S4IJ.js.map +1 -0
- package/dist/chunk-TMQLARTH.js +188 -0
- package/dist/chunk-TMQLARTH.js.map +1 -0
- package/dist/chunk-TPDBFYEG.js +130 -0
- package/dist/chunk-TPDBFYEG.js.map +1 -0
- package/dist/chunk-TPMQ3G6Z.js +145 -0
- package/dist/chunk-TPMQ3G6Z.js.map +1 -0
- package/dist/chunk-TZOLIGIG.js +61 -0
- package/dist/chunk-TZOLIGIG.js.map +1 -0
- package/dist/chunk-U3PN77QT.js +113 -0
- package/dist/chunk-U3WSW6PZ.js +277 -0
- package/dist/chunk-U4SCL7B7.js +640 -0
- package/dist/chunk-U4SCL7B7.js.map +1 -0
- package/dist/chunk-UWK5OXUJ.js +156 -0
- package/dist/chunk-UWK5OXUJ.js.map +1 -0
- package/dist/chunk-UWVJF25J.js +74 -0
- package/dist/chunk-UXHQAFNA.js +1317 -0
- package/dist/chunk-UXHQAFNA.js.map +1 -0
- package/dist/chunk-V5OCT34X.js +1 -0
- package/dist/chunk-V5OCT34X.js.map +1 -0
- package/dist/chunk-VLXA6PI2.js +304 -0
- package/dist/chunk-VLXA6PI2.js.map +1 -0
- package/dist/chunk-VNO6ZJ35.js +500 -0
- package/dist/chunk-VNO6ZJ35.js.map +1 -0
- package/dist/chunk-VW676BEI.js +827 -0
- package/dist/chunk-VW676BEI.js.map +1 -0
- package/dist/chunk-VWT3F4IV.js +2161 -0
- package/dist/chunk-VWT3F4IV.js.map +1 -0
- package/dist/chunk-W3LR522O.js +2296 -0
- package/dist/chunk-W3LR522O.js.map +1 -0
- package/dist/chunk-W4L6CZKA.js +96 -0
- package/dist/chunk-W4L6CZKA.js.map +1 -0
- package/dist/chunk-W4RVMTHR.js +372 -0
- package/dist/chunk-W4RVMTHR.js.map +1 -0
- package/dist/chunk-WEHSQBFR.js +188 -0
- package/dist/chunk-WEHSQBFR.js.map +1 -0
- package/dist/chunk-WELDCG6C.js +380 -0
- package/dist/chunk-WELDCG6C.js.map +1 -0
- package/dist/chunk-WZYKANL3.js +2800 -0
- package/dist/chunk-WZYKANL3.js.map +1 -0
- package/dist/chunk-XIG5PDM7.js +48 -0
- package/dist/chunk-XJNBEDFE.js +193 -0
- package/dist/chunk-XJNBEDFE.js.map +1 -0
- package/dist/chunk-XVVIG67A.js +291 -0
- package/dist/chunk-XVVIG67A.js.map +1 -0
- package/dist/chunk-XVZ7B3HG.js +135 -0
- package/dist/chunk-YBPYIAA5.js +73 -0
- package/dist/chunk-YBPYIAA5.js.map +1 -0
- package/dist/chunk-Z734BLO3.js +21 -0
- package/dist/chunk-Z734BLO3.js.map +1 -0
- package/dist/chunk-ZKSK55RC.js +269 -0
- package/dist/chunk-ZKSK55RC.js.map +1 -0
- package/dist/chunk-ZTFCYYEZ.js +69 -0
- package/dist/chunk-ZTFCYYEZ.js.map +1 -0
- package/dist/chunk-ZY2MNJR6.js +329 -0
- package/dist/chunk-ZY2MNJR6.js.map +1 -0
- package/dist/cli-D3VpkVwB.d.ts +1136 -0
- package/dist/cli.d.ts +42 -10
- package/dist/cli.js +121 -58
- package/dist/codex-cli-fallback.d.ts +1 -0
- package/dist/codex-cli-fallback.js +1 -1
- package/dist/commitment-ledger.js +1 -1
- package/dist/compat/checks.d.ts +5 -0
- package/dist/compat/checks.js +11 -0
- package/dist/compat/checks.js.map +1 -0
- package/dist/compat/types.d.ts +30 -0
- package/dist/compat/types.js +1 -0
- package/dist/compat/types.js.map +1 -0
- package/dist/compounding/engine.d.ts +221 -0
- package/dist/compounding/engine.js +32 -0
- package/dist/compounding/engine.js.map +1 -0
- package/dist/compounding/preference-consolidator.d.ts +92 -0
- package/dist/compounding/preference-consolidator.js +553 -0
- package/dist/compounding/preference-consolidator.js.map +1 -0
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +5 -3
- package/dist/config.js +9 -4
- package/dist/conflict-policy-DyJ2wd-h.d.ts +4 -0
- package/dist/connectors/codex-materialize-runner.d.ts +64 -0
- package/dist/connectors/codex-materialize-runner.js +33 -0
- package/dist/connectors/codex-materialize-runner.js.map +1 -0
- package/dist/connectors/codex-materialize.d.ts +195 -0
- package/dist/connectors/codex-materialize.js +38 -0
- package/dist/connectors/codex-materialize.js.map +1 -0
- package/dist/connectors/index.d.ts +444 -0
- package/dist/connectors/index.js +115 -0
- package/dist/connectors/index.js.map +1 -0
- package/dist/connectors-cli-CwbyjGR7.d.ts +257 -0
- package/dist/connectors-cli.d.ts +1 -1
- package/dist/consolidation-provenance-check.d.ts +4 -2
- package/dist/consolidation-undo.d.ts +4 -2
- package/dist/contradiction/index.d.ts +258 -0
- package/dist/contradiction/index.js +43 -0
- package/dist/contradiction/index.js.map +1 -0
- package/dist/contradiction-review-ATP4S6IC.js +30 -0
- package/dist/contradiction-review-ATP4S6IC.js.map +1 -0
- package/dist/contradiction-scan-5A4IDZV5.js +13 -0
- package/dist/contradiction-scan-5A4IDZV5.js.map +1 -0
- package/dist/conversation-index/backend.d.ts +97 -0
- package/dist/conversation-index/backend.js +13 -0
- package/dist/conversation-index/backend.js.map +1 -0
- package/dist/conversation-index/chunker.d.ts +16 -0
- package/dist/conversation-index/chunker.js +8 -0
- package/dist/conversation-index/chunker.js.map +1 -0
- package/dist/conversation-index/cleanup.d.ts +11 -0
- package/dist/conversation-index/cleanup.js +9 -0
- package/dist/conversation-index/cleanup.js.map +1 -0
- package/dist/conversation-index/faiss-adapter.d.ts +6 -0
- package/dist/conversation-index/faiss-adapter.js +16 -0
- package/dist/conversation-index/faiss-adapter.js.map +1 -0
- package/dist/conversation-index/indexer.d.ts +23 -0
- package/dist/conversation-index/indexer.js +15 -0
- package/dist/conversation-index/indexer.js.map +1 -0
- package/dist/conversation-index/search.d.ts +6 -0
- package/dist/conversation-index/search.js +11 -0
- package/dist/conversation-index/search.js.map +1 -0
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer-wiring.js +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/embedding-fallback.js +2 -2
- package/dist/enrichment/index.d.ts +163 -0
- package/dist/enrichment/index.js +18 -0
- package/dist/enrichment/index.js.map +1 -0
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +9 -6
- package/dist/entity-schema.d.ts +1 -1
- package/dist/evals.js +1 -1
- package/dist/event-order-recall.d.ts +17 -0
- package/dist/event-order-recall.js +11 -0
- package/dist/event-order-recall.js.map +1 -0
- package/dist/evidence-pack.d.ts +3 -1
- package/dist/evidence-pack.js +5 -3
- package/dist/explicit-capture.d.ts +23 -6
- package/dist/explicit-capture.js +2 -2
- package/dist/explicit-cue-recall.d.ts +4 -1
- package/dist/explicit-cue-recall.js +4 -2
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge-training.js +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +11 -10
- package/dist/faiss-adapter-CzPghc4C.d.ts +70 -0
- package/dist/fallback-llm.d.ts +4 -1
- package/dist/fallback-llm.js +6 -6
- package/dist/focused-list-recall.d.ts +17 -0
- package/dist/focused-list-recall.js +11 -0
- package/dist/focused-list-recall.js.map +1 -0
- package/dist/graph-edge-decay-5DI5GUNL.js +207 -0
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index-DJ9QWMw-.d.ts +35 -0
- package/dist/index.d.ts +107 -715
- package/dist/index.js +657 -2611
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +1 -1
- package/dist/intent.js +1 -1
- package/dist/lcm/archive.d.ts +89 -0
- package/dist/lcm/archive.js +12 -0
- package/dist/lcm/archive.js.map +1 -0
- package/dist/lcm/dag.d.ts +48 -0
- package/dist/lcm/dag.js +8 -0
- package/dist/lcm/dag.js.map +1 -0
- package/dist/lcm/engine.d.ts +116 -0
- package/dist/lcm/engine.js +20 -0
- package/dist/lcm/engine.js.map +1 -0
- package/dist/lcm/index.d.ts +12 -0
- package/dist/lcm/index.js +44 -0
- package/dist/lcm/index.js.map +1 -0
- package/dist/lcm/queue.d.ts +62 -0
- package/dist/lcm/queue.js +8 -0
- package/dist/lcm/queue.js.map +1 -0
- package/dist/lcm/recall.d.ts +20 -0
- package/dist/lcm/recall.js +8 -0
- package/dist/lcm/recall.js.map +1 -0
- package/dist/lcm/schema.d.ts +16 -0
- package/dist/lcm/schema.js +14 -0
- package/dist/lcm/schema.js.map +1 -0
- package/dist/lcm/summarizer.d.ts +38 -0
- package/dist/lcm/summarizer.js +12 -0
- package/dist/lcm/summarizer.js.map +1 -0
- package/dist/lcm/tools.d.ts +29 -0
- package/dist/lcm/tools.js +8 -0
- package/dist/lcm/tools.js.map +1 -0
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/live-connectors-runner.js +5 -5
- package/dist/local-llm.d.ts +8 -4
- package/dist/local-llm.js +3 -3
- package/dist/maintenance/archive-observations.d.ts +18 -0
- package/dist/maintenance/archive-observations.js +8 -0
- package/dist/maintenance/archive-observations.js.map +1 -0
- package/dist/maintenance/backup-stamp.d.ts +3 -0
- package/dist/maintenance/backup-stamp.js +8 -0
- package/dist/maintenance/backup-stamp.js.map +1 -0
- package/dist/maintenance/memory-governance-cron.d.ts +85 -0
- package/dist/maintenance/memory-governance-cron.js +22 -0
- package/dist/maintenance/memory-governance-cron.js.map +1 -0
- package/dist/maintenance/memory-governance.d.ts +137 -0
- package/dist/maintenance/memory-governance.js +40 -0
- package/dist/maintenance/memory-governance.js.map +1 -0
- package/dist/maintenance/migrate-observations.d.ts +18 -0
- package/dist/maintenance/migrate-observations.js +9 -0
- package/dist/maintenance/migrate-observations.js.map +1 -0
- package/dist/maintenance/observation-ledger-utils.d.ts +10 -0
- package/dist/maintenance/observation-ledger-utils.js +10 -0
- package/dist/maintenance/observation-ledger-utils.js.map +1 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +15 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -0
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js.map +1 -0
- package/dist/maintenance/rebuild-memory-projection.d.ts +77 -0
- package/dist/maintenance/rebuild-memory-projection.js +35 -0
- package/dist/maintenance/rebuild-memory-projection.js.map +1 -0
- package/dist/maintenance/rebuild-observations.d.ts +17 -0
- package/dist/maintenance/rebuild-observations.js +9 -0
- package/dist/maintenance/rebuild-observations.js.map +1 -0
- package/dist/mcp-memory-inspector-app.d.ts +124 -0
- package/dist/mcp-memory-inspector-app.js +20 -0
- package/dist/mcp-memory-inspector-app.js.map +1 -0
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +108 -3
- package/dist/memory-projection-store.js +2 -1
- package/dist/memory-provenance.d.ts +57 -0
- package/dist/memory-provenance.js +13 -0
- package/dist/memory-provenance.js.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +4 -2
- package/dist/migrate/from-engram.d.ts +24 -0
- package/dist/migrate/from-engram.js +12 -0
- package/dist/migrate/from-engram.js.map +1 -0
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +50 -0
- package/dist/namespaces/migrate.js +50 -0
- package/dist/namespaces/migrate.js.map +1 -0
- package/dist/namespaces/principal.d.ts +17 -0
- package/dist/namespaces/principal.js +16 -0
- package/dist/namespaces/principal.js.map +1 -0
- package/dist/namespaces/search.d.ts +46 -0
- package/dist/namespaces/search.js +28 -0
- package/dist/namespaces/search.js.map +1 -0
- package/dist/namespaces/storage.d.ts +32 -0
- package/dist/namespaces/storage.js +28 -0
- package/dist/namespaces/storage.js.map +1 -0
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/network/tailscale.d.ts +41 -0
- package/dist/network/tailscale.js +9 -0
- package/dist/network/tailscale.js.map +1 -0
- package/dist/network/webdav.d.ts +39 -0
- package/dist/network/webdav.js +10 -0
- package/dist/network/webdav.js.map +1 -0
- package/dist/objective-state-writers.d.ts +1 -1
- package/dist/objective-state-writers.js +2 -2
- package/dist/operator-toolkit.d.ts +4 -2
- package/dist/operator-toolkit.js +35 -17
- package/dist/opik-exporter.js +2 -2
- package/dist/opik-exporter.js.map +1 -1
- package/dist/orchestrator-DuWl9Hwx.d.ts +1244 -0
- package/dist/orchestrator.d.ts +24 -7
- package/dist/orchestrator.js +107 -65
- package/dist/path-MR5JPYOP.js +9 -0
- package/dist/path-MR5JPYOP.js.map +1 -0
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/qmd-recall-cache.d.ts +2 -2
- package/dist/qmd.d.ts +103 -4
- package/dist/qmd.js +23 -5
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +3 -1
- package/dist/recall-explain-renderer.js +5 -3
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +3 -1
- package/dist/recall-xray-cli.d.ts +3 -1
- package/dist/recall-xray-cli.js +6 -4
- package/dist/recall-xray-renderer.d.ts +3 -1
- package/dist/recall-xray-renderer.js +5 -3
- package/dist/recall-xray.d.ts +8 -1
- package/dist/recall-xray.js +4 -2
- package/dist/replay/normalizers/chatgpt.d.ts +6 -0
- package/dist/replay/normalizers/chatgpt.js +11 -0
- package/dist/replay/normalizers/chatgpt.js.map +1 -0
- package/dist/replay/normalizers/claude.d.ts +6 -0
- package/dist/replay/normalizers/claude.js +11 -0
- package/dist/replay/normalizers/claude.js.map +1 -0
- package/dist/replay/normalizers/openclaw.d.ts +6 -0
- package/dist/replay/normalizers/openclaw.js +11 -0
- package/dist/replay/normalizers/openclaw.js.map +1 -0
- package/dist/replay/normalizers/shared.d.ts +16 -0
- package/dist/replay/normalizers/shared.js +14 -0
- package/dist/replay/normalizers/shared.js.map +1 -0
- package/dist/replay/runner.d.ts +35 -0
- package/dist/replay/runner.js +16 -0
- package/dist/replay/runner.js.map +1 -0
- package/dist/replay/types.d.ts +57 -0
- package/dist/replay/types.js +19 -0
- package/dist/replay/types.js.map +1 -0
- package/dist/resolution-B7FNQSSP.js +12 -0
- package/dist/resolution-B7FNQSSP.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/response-guidance-recall.d.ts +18 -0
- package/dist/response-guidance-recall.js +11 -0
- package/dist/response-guidance-recall.js.map +1 -0
- package/dist/resume-bundles.js +7 -5
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +35 -0
- package/dist/routing/engine.js +16 -0
- package/dist/routing/engine.js.map +1 -0
- package/dist/routing/store.d.ts +27 -0
- package/dist/routing/store.js +10 -0
- package/dist/routing/store.js.map +1 -0
- package/dist/runtime/better-sqlite.d.ts +8 -0
- package/dist/runtime/better-sqlite.js +10 -0
- package/dist/runtime/better-sqlite.js.map +1 -0
- package/dist/runtime/child-process.d.ts +32 -0
- package/dist/runtime/child-process.js +10 -0
- package/dist/runtime/child-process.js.map +1 -0
- package/dist/runtime/env.d.ts +5 -0
- package/dist/runtime/env.js +12 -0
- package/dist/runtime/env.js.map +1 -0
- package/dist/sdk-compat.js +1 -1
- package/dist/search/document-scanner.d.ts +22 -0
- package/dist/search/document-scanner.js +8 -0
- package/dist/search/document-scanner.js.map +1 -0
- package/dist/search/embed-helper.d.ts +35 -0
- package/dist/search/embed-helper.js +9 -0
- package/dist/search/embed-helper.js.map +1 -0
- package/dist/search/factory.d.ts +32 -0
- package/dist/search/factory.js +29 -0
- package/dist/search/factory.js.map +1 -0
- package/dist/search/index.d.ts +15 -0
- package/dist/search/index.js +50 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/lancedb-backend.d.ts +51 -0
- package/dist/search/lancedb-backend.js +10 -0
- package/dist/search/lancedb-backend.js.map +1 -0
- package/dist/search/meilisearch-backend.d.ts +48 -0
- package/dist/search/meilisearch-backend.js +10 -0
- package/dist/search/meilisearch-backend.js.map +1 -0
- package/dist/search/noop-backend.d.ts +26 -0
- package/dist/search/noop-backend.js +8 -0
- package/dist/search/noop-backend.js.map +1 -0
- package/dist/search/orama-backend.d.ts +53 -0
- package/dist/search/orama-backend.js +10 -0
- package/dist/search/orama-backend.js.map +1 -0
- package/dist/search/port.d.ts +61 -0
- package/dist/search/port.js +1 -0
- package/dist/search/port.js.map +1 -0
- package/dist/search/remote-backend.d.ts +39 -0
- package/dist/search/remote-backend.js +9 -0
- package/dist/search/remote-backend.js.map +1 -0
- package/dist/secure-store/index.d.ts +890 -0
- package/dist/secure-store/index.js +156 -0
- package/dist/secure-store/index.js.map +1 -0
- package/dist/semantic-VwGI14Ok.d.ts +69 -0
- package/dist/semantic-consolidation-4HkHWgeI.d.ts +180 -0
- package/dist/semantic-consolidation.d.ts +3 -3
- package/dist/semantic-consolidation.js +15 -8
- package/dist/semantic-rule-promotion.js +9 -6
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -7
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +131 -0
- package/dist/shared-context/manager.js +15 -0
- package/dist/shared-context/manager.js.map +1 -0
- package/dist/signal.d.ts +1 -1
- package/dist/skills-registry.js +13 -1
- package/dist/skills-registry.js.map +1 -1
- package/dist/state-store-VZU2IA53.js +16 -0
- package/dist/state-store-VZU2IA53.js.map +1 -0
- package/dist/storage-paths.d.ts +9 -0
- package/dist/storage-paths.js +20 -0
- package/dist/storage-paths.js.map +1 -0
- package/dist/storage.d.ts +6 -2
- package/dist/storage.js +8 -5
- package/dist/summarizer.d.ts +6 -1
- package/dist/summarizer.js +11 -10
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/summary-snapshot.js +2 -1
- package/dist/surfaces/dreams.d.ts +16 -0
- package/dist/surfaces/dreams.js +282 -0
- package/dist/surfaces/dreams.js.map +1 -0
- package/dist/surfaces/heartbeat.d.ts +17 -0
- package/dist/surfaces/heartbeat.js +265 -0
- package/dist/surfaces/heartbeat.js.map +1 -0
- package/dist/targeted-fact-recall.d.ts +17 -0
- package/dist/targeted-fact-recall.js +11 -0
- package/dist/targeted-fact-recall.js.map +1 -0
- package/dist/telemetry-transcript.d.ts +7 -0
- package/dist/telemetry-transcript.js +16 -0
- package/dist/telemetry-transcript.js.map +1 -0
- package/dist/temporal-supersession.d.ts +4 -2
- package/dist/temporal-supersession.js +2 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +6 -1
- package/dist/threading.js +2 -1
- package/dist/tier-migration.d.ts +5 -3
- package/dist/tier-routing.d.ts +1 -1
- package/dist/tokens.js +2 -2
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +16 -2
- package/dist/transcript.js +2 -1
- package/dist/transfer/autodetect.d.ts +4 -0
- package/dist/transfer/autodetect.js +15 -0
- package/dist/transfer/autodetect.js.map +1 -0
- package/dist/transfer/backup.d.ts +21 -0
- package/dist/transfer/backup.js +17 -0
- package/dist/transfer/backup.js.map +1 -0
- package/dist/transfer/capsule-export.d.ts +113 -0
- package/dist/transfer/capsule-export.js +19 -0
- package/dist/transfer/capsule-export.js.map +1 -0
- package/dist/transfer/capsule-import.d.ts +124 -0
- package/dist/transfer/capsule-import.js +16 -0
- package/dist/transfer/capsule-import.js.map +1 -0
- package/dist/transfer/constants.d.ts +13 -0
- package/dist/transfer/constants.js +12 -0
- package/dist/transfer/constants.js.map +1 -0
- package/dist/transfer/export-json.d.ts +11 -0
- package/dist/transfer/export-json.js +11 -0
- package/dist/transfer/export-json.js.map +1 -0
- package/dist/transfer/export-md.d.ts +10 -0
- package/dist/transfer/export-md.js +13 -0
- package/dist/transfer/export-md.js.map +1 -0
- package/dist/transfer/export-sqlite.d.ts +9 -0
- package/dist/transfer/export-sqlite.js +12 -0
- package/dist/transfer/export-sqlite.js.map +1 -0
- package/dist/transfer/fs-utils.d.ts +61 -0
- package/dist/transfer/fs-utils.js +40 -0
- package/dist/transfer/fs-utils.js.map +1 -0
- package/dist/transfer/import-json.d.ts +16 -0
- package/dist/transfer/import-json.js +13 -0
- package/dist/transfer/import-json.js.map +1 -0
- package/dist/transfer/import-md.d.ts +14 -0
- package/dist/transfer/import-md.js +11 -0
- package/dist/transfer/import-md.js.map +1 -0
- package/dist/transfer/import-sqlite.d.ts +14 -0
- package/dist/transfer/import-sqlite.js +12 -0
- package/dist/transfer/import-sqlite.js.map +1 -0
- package/dist/transfer/sqlite-schema.d.ts +4 -0
- package/dist/transfer/sqlite-schema.js +10 -0
- package/dist/transfer/sqlite-schema.js.map +1 -0
- package/dist/transfer/types.d.ts +916 -0
- package/dist/transfer/types.js +30 -0
- package/dist/transfer/types.js.map +1 -0
- package/dist/trust-zones.d.ts +3 -2
- package/dist/trust-zones.js +1 -1
- package/dist/types.d.ts +88 -3
- package/dist/types.js +1 -1
- package/dist/user-model.d.ts +37 -0
- package/dist/user-model.js +28 -0
- package/dist/user-model.js.map +1 -0
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +11 -8
- package/dist/work/board.d.ts +43 -0
- package/dist/work/board.js +14 -0
- package/dist/work/board.js.map +1 -0
- package/dist/work/boundary.d.ts +8 -0
- package/dist/work/boundary.js +14 -0
- package/dist/work/boundary.js.map +1 -0
- package/dist/work/storage.d.ts +39 -0
- package/dist/work/storage.js +11 -0
- package/dist/work/storage.js.map +1 -0
- package/dist/work/types.d.ts +75 -0
- package/dist/work/types.js +1 -0
- package/dist/work/types.js.map +1 -0
- package/package.json +2767 -6
- package/scripts/faiss_index.py +816 -0
- package/scripts/faiss_requirements.txt +3 -0
- package/skills/remnic-entities/SKILL.md +51 -0
- package/skills/remnic-memory-workflow/SKILL.md +61 -0
- package/skills/remnic-recall/SKILL.md +51 -0
- package/skills/remnic-remember/SKILL.md +56 -0
- package/skills/remnic-search/SKILL.md +51 -0
- package/skills/remnic-status/SKILL.md +51 -0
- package/src/abort-error.test.ts +49 -0
- package/src/abort-error.ts +46 -0
- package/src/abstraction-nodes.ts +162 -0
- package/src/access-audit.test.ts +178 -0
- package/src/access-audit.ts +125 -0
- package/src/access-cli.test.ts +439 -0
- package/src/access-cli.ts +438 -0
- package/src/access-http.test.ts +225 -0
- package/src/access-http.ts +1899 -0
- package/src/access-idempotency.ts +232 -0
- package/src/access-mcp.test.ts +568 -0
- package/src/access-mcp.ts +3056 -0
- package/src/access-schema-pi.test.ts +60 -0
- package/src/access-schema.ts +522 -0
- package/src/access-service-namespace.test.ts +123 -0
- package/src/access-service.ts +5629 -0
- package/src/action-confidence.test.ts +206 -0
- package/src/action-confidence.ts +466 -0
- package/src/active-memory-bridge.test.ts +285 -0
- package/src/active-memory-bridge.ts +217 -0
- package/src/active-recall.test.ts +484 -0
- package/src/active-recall.ts +459 -0
- package/src/adapters/claude-code.ts +56 -0
- package/src/adapters/codex.ts +57 -0
- package/src/adapters/hermes.ts +64 -0
- package/src/adapters/index.ts +6 -0
- package/src/adapters/registry.ts +41 -0
- package/src/adapters/replit.ts +55 -0
- package/src/adapters/types.ts +51 -0
- package/src/behavior-learner.ts +144 -0
- package/src/behavior-signals.ts +73 -0
- package/src/binary-lifecycle/backend.ts +117 -0
- package/src/binary-lifecycle/index.ts +35 -0
- package/src/binary-lifecycle/manifest.ts +79 -0
- package/src/binary-lifecycle/pipeline.ts +352 -0
- package/src/binary-lifecycle/scanner.ts +89 -0
- package/src/binary-lifecycle/types.ts +89 -0
- package/src/bootstrap.ts +178 -0
- package/src/boxes.ts +521 -0
- package/src/briefing.test.ts +1535 -0
- package/src/briefing.ts +1382 -0
- package/src/buffer-session.test.ts +443 -0
- package/src/buffer-surprise-report.ts +176 -0
- package/src/buffer-surprise-telemetry.test.ts +606 -0
- package/src/buffer-surprise-trigger.test.ts +766 -0
- package/src/buffer-surprise.test.ts +339 -0
- package/src/buffer-surprise.ts +203 -0
- package/src/buffer.ts +900 -0
- package/src/bulk-import/cli-command.test.ts +204 -0
- package/src/bulk-import/index.ts +34 -0
- package/src/bulk-import/pipeline.test.ts +445 -0
- package/src/bulk-import/pipeline.ts +178 -0
- package/src/bulk-import/registry.test.ts +151 -0
- package/src/bulk-import/registry.ts +72 -0
- package/src/bulk-import/types.test.ts +272 -0
- package/src/bulk-import/types.ts +145 -0
- package/src/calibration.ts +394 -0
- package/src/capsule-cli.test.ts +398 -0
- package/src/capsule-cli.ts +565 -0
- package/src/causal-behavior.ts +308 -0
- package/src/causal-chain.ts +419 -0
- package/src/causal-consolidation.ts +370 -0
- package/src/causal-retrieval.ts +286 -0
- package/src/causal-trajectory-graph.ts +60 -0
- package/src/causal-trajectory.ts +303 -0
- package/src/chunking.ts +220 -0
- package/src/citations.ts +232 -0
- package/src/cli.ts +9403 -0
- package/src/codex-cli-fallback.ts +162 -0
- package/src/codex-thread-key.ts +1 -0
- package/src/coding/access-coding-context.test.ts +197 -0
- package/src/coding/coding-branch-scope.test.ts +281 -0
- package/src/coding/coding-namespace.test.ts +360 -0
- package/src/coding/coding-namespace.ts +412 -0
- package/src/coding/coding-orchestrator.test.ts +249 -0
- package/src/coding/git-context.test.ts +507 -0
- package/src/coding/git-context.ts +336 -0
- package/src/coding/mcp-set-coding-context.test.ts +174 -0
- package/src/coding/review-context.test.ts +316 -0
- package/src/coding/review-context.ts +349 -0
- package/src/coding/wire-coding-context.test.ts +468 -0
- package/src/commitment-ledger.test.ts +78 -0
- package/src/commitment-ledger.ts +337 -0
- package/src/compat/checks.test.ts +206 -0
- package/src/compat/checks.ts +716 -0
- package/src/compat/types.ts +33 -0
- package/src/compounding/engine.ts +1686 -0
- package/src/compounding/preference-consolidator.ts +778 -0
- package/src/compression-optimizer.ts +312 -0
- package/src/config.test.ts +930 -0
- package/src/config.ts +3807 -0
- package/src/connectors/codex/instructions.md +160 -0
- package/src/connectors/codex/resources/namespace-cheatsheet.md +48 -0
- package/src/connectors/codex-marketplace.ts +500 -0
- package/src/connectors/codex-materialize-runner.ts +212 -0
- package/src/connectors/codex-materialize.ts +983 -0
- package/src/connectors/coerce.ts +62 -0
- package/src/connectors/index.test.ts +1570 -0
- package/src/connectors/index.ts +3222 -0
- package/src/connectors/live/framework.ts +164 -0
- package/src/connectors/live/github.test.ts +1218 -0
- package/src/connectors/live/github.ts +1068 -0
- package/src/connectors/live/gmail.test.ts +1706 -0
- package/src/connectors/live/gmail.ts +1293 -0
- package/src/connectors/live/google-drive.test.ts +696 -0
- package/src/connectors/live/google-drive.ts +724 -0
- package/src/connectors/live/index.ts +101 -0
- package/src/connectors/live/live-connectors.test.ts +689 -0
- package/src/connectors/live/notion.test.ts +1109 -0
- package/src/connectors/live/notion.ts +978 -0
- package/src/connectors/live/registry.ts +103 -0
- package/src/connectors/live/state-store.ts +399 -0
- package/src/connectors/live/transient-errors.ts +150 -0
- package/src/connectors/weclone-installer.test.ts +850 -0
- package/src/connectors-cli.ts +513 -0
- package/src/console/state.test.ts +224 -0
- package/src/console/state.ts +514 -0
- package/src/console/trace.test.ts +813 -0
- package/src/console/trace.ts +603 -0
- package/src/console/tui.test.ts +582 -0
- package/src/console/tui.ts +508 -0
- package/src/consolidation-operator.ts +182 -0
- package/src/consolidation-provenance-check.ts +551 -0
- package/src/consolidation-undo.ts +718 -0
- package/src/contradiction/contradiction-judge.test.ts +189 -0
- package/src/contradiction/contradiction-judge.ts +333 -0
- package/src/contradiction/contradiction-review.ts +574 -0
- package/src/contradiction/contradiction-scan.ts +504 -0
- package/src/contradiction/contradiction.test.ts +2230 -0
- package/src/contradiction/index.ts +37 -0
- package/src/contradiction/resolution.ts +383 -0
- package/src/conversation-index/backend.ts +323 -0
- package/src/conversation-index/chunker.ts +47 -0
- package/src/conversation-index/cleanup.ts +53 -0
- package/src/conversation-index/faiss-adapter.ts +384 -0
- package/src/conversation-index/indexer.test.ts +164 -0
- package/src/conversation-index/indexer.ts +192 -0
- package/src/conversation-index/search.ts +37 -0
- package/src/cross-namespace-budget.test.ts +275 -0
- package/src/cross-namespace-budget.ts +365 -0
- package/src/cue-anchors.ts +163 -0
- package/src/curation/index.ts +544 -0
- package/src/dashboard-runtime.ts +337 -0
- package/src/day-summary.ts +122 -0
- package/src/dedup/index.ts +330 -0
- package/src/dedup/semantic.test.ts +1577 -0
- package/src/dedup/semantic.ts +148 -0
- package/src/delinearize.ts +193 -0
- package/src/direct-answer-wiring.test.ts +473 -0
- package/src/direct-answer-wiring.ts +180 -0
- package/src/direct-answer.test.ts +484 -0
- package/src/direct-answer.ts +273 -0
- package/src/embedding-fallback.ts +565 -0
- package/src/enrichment/audit.ts +89 -0
- package/src/enrichment/index.ts +27 -0
- package/src/enrichment/pipeline.ts +197 -0
- package/src/enrichment/provider-registry.ts +85 -0
- package/src/enrichment/types.ts +100 -0
- package/src/enrichment/web-search-provider.ts +63 -0
- package/src/entity-retrieval.ts +774 -0
- package/src/entity-schema.ts +239 -0
- package/src/evals.ts +1312 -0
- package/src/event-order-recall.test.ts +4164 -0
- package/src/event-order-recall.ts +2802 -0
- package/src/evidence-pack.test.ts +89 -0
- package/src/evidence-pack.ts +388 -0
- package/src/explicit-capture.ts +530 -0
- package/src/explicit-cue-recall.test.ts +3019 -0
- package/src/explicit-cue-recall.ts +5545 -0
- package/src/extraction-judge-telemetry.ts +234 -0
- package/src/extraction-judge-training.ts +221 -0
- package/src/extraction-judge.ts +846 -0
- package/src/extraction-timeout.test.ts +265 -0
- package/src/extraction.ts +2719 -0
- package/src/fallback-llm.test.ts +1060 -0
- package/src/fallback-llm.ts +918 -0
- package/src/focused-list-recall.test.ts +734 -0
- package/src/focused-list-recall.ts +1160 -0
- package/src/graph-dashboard-diff.ts +35 -0
- package/src/graph-dashboard-key.ts +5 -0
- package/src/graph-dashboard-parser.ts +104 -0
- package/src/graph-edge-reinforcement.ts +192 -0
- package/src/graph-events.ts +151 -0
- package/src/graph-recall.test.ts +164 -0
- package/src/graph-recall.ts +189 -0
- package/src/graph-retrieval.test.ts +809 -0
- package/src/graph-retrieval.ts +823 -0
- package/src/graph-snapshot.ts +329 -0
- package/src/graph.ts +813 -0
- package/src/harmonic-retrieval.ts +223 -0
- package/src/himem.ts +154 -0
- package/src/hygiene.ts +87 -0
- package/src/identity-continuity.ts +333 -0
- package/src/importance.ts +328 -0
- package/src/importers/base.test.ts +294 -0
- package/src/importers/base.ts +436 -0
- package/src/importers/index.ts +21 -0
- package/src/index.ts +1204 -0
- package/src/intent.ts +154 -0
- package/src/json-extract.ts +85 -0
- package/src/json-store.ts +42 -0
- package/src/lcm/archive.ts +617 -0
- package/src/lcm/dag.ts +199 -0
- package/src/lcm/engine.ts +645 -0
- package/src/lcm/index.ts +7 -0
- package/src/lcm/queue.test.ts +178 -0
- package/src/lcm/queue.ts +200 -0
- package/src/lcm/recall.ts +117 -0
- package/src/lcm/schema.ts +154 -0
- package/src/lcm/summarizer.ts +235 -0
- package/src/lcm/tools.ts +191 -0
- package/src/lcm-engine.test.ts +660 -0
- package/src/legacy-hook-compat.test.ts +20 -0
- package/src/legacy-hook-compat.ts +45 -0
- package/src/lifecycle.ts +289 -0
- package/src/live-connectors-runner.ts +385 -0
- package/src/local-llm-qos.test.ts +303 -0
- package/src/local-llm-thinking.test.ts +292 -0
- package/src/local-llm.ts +1464 -0
- package/src/logger.ts +49 -0
- package/src/maintenance/archive-observations.ts +147 -0
- package/src/maintenance/backup-stamp.ts +3 -0
- package/src/maintenance/dreams-ledger.ts +516 -0
- package/src/maintenance/first-start-migration.ts +362 -0
- package/src/maintenance/forget.test.ts +206 -0
- package/src/maintenance/forget.ts +126 -0
- package/src/maintenance/graph-edge-decay.test.ts +409 -0
- package/src/maintenance/graph-edge-decay.ts +394 -0
- package/src/maintenance/memory-governance-cron.ts +447 -0
- package/src/maintenance/memory-governance.ts +1039 -0
- package/src/maintenance/migrate-observations.ts +216 -0
- package/src/maintenance/observation-ledger-utils.ts +54 -0
- package/src/maintenance/pattern-reinforcement.test.ts +875 -0
- package/src/maintenance/pattern-reinforcement.ts +369 -0
- package/src/maintenance/purge.ts +334 -0
- package/src/maintenance/rebuild-memory-lifecycle-ledger.ts +78 -0
- package/src/maintenance/rebuild-memory-projection.ts +1234 -0
- package/src/maintenance/rebuild-observations.ts +178 -0
- package/src/maintenance/tier-stats.test.ts +378 -0
- package/src/maintenance/tier-stats.ts +222 -0
- package/src/mcp-memory-inspector-app.ts +421 -0
- package/src/memory-action-policy.ts +80 -0
- package/src/memory-cache.ts +208 -0
- package/src/memory-extension/claude-code-publisher.ts +51 -0
- package/src/memory-extension/codex-publisher.ts +149 -0
- package/src/memory-extension/hermes-publisher.ts +51 -0
- package/src/memory-extension/index.ts +100 -0
- package/src/memory-extension/shared-instructions.ts +133 -0
- package/src/memory-extension/types.ts +86 -0
- package/src/memory-extension-host/host-discovery.ts +276 -0
- package/src/memory-extension-host/index.ts +14 -0
- package/src/memory-extension-host/render-extensions-block.ts +73 -0
- package/src/memory-extension-host/types.ts +21 -0
- package/src/memory-lifecycle-ledger-utils.ts +116 -0
- package/src/memory-projection-format.ts +11 -0
- package/src/memory-projection-store.ts +951 -0
- package/src/memory-provenance.test.ts +196 -0
- package/src/memory-provenance.ts +484 -0
- package/src/memory-worth-bench.test.ts +71 -0
- package/src/memory-worth-bench.ts +265 -0
- package/src/memory-worth-filter.test.ts +209 -0
- package/src/memory-worth-filter.ts +204 -0
- package/src/memory-worth-frontmatter.test.ts +311 -0
- package/src/memory-worth-outcomes.test.ts +316 -0
- package/src/memory-worth-outcomes.ts +286 -0
- package/src/memory-worth.test.ts +317 -0
- package/src/memory-worth.ts +215 -0
- package/src/message-parts/index.ts +806 -0
- package/src/message-parts/message-parts.test.ts +421 -0
- package/src/migrate/from-engram.ts +789 -0
- package/src/model-registry.ts +313 -0
- package/src/models-json.ts +76 -0
- package/src/namespaces/migrate.ts +187 -0
- package/src/namespaces/path.ts +25 -0
- package/src/namespaces/principal.test.ts +195 -0
- package/src/namespaces/principal.ts +86 -0
- package/src/namespaces/search.test.ts +105 -0
- package/src/namespaces/search.ts +233 -0
- package/src/namespaces/storage.ts +74 -0
- package/src/native-knowledge.ts +1823 -0
- package/src/negative.ts +72 -0
- package/src/network/tailscale.ts +179 -0
- package/src/network/webdav.ts +385 -0
- package/src/objective-state-writers.ts +951 -0
- package/src/objective-state.ts +320 -0
- package/src/onboarding/index.ts +529 -0
- package/src/openai-chat-compat.ts +56 -0
- package/src/operator-toolkit.ts +2132 -0
- package/src/opik-exporter.test.ts +72 -0
- package/src/opik-exporter.ts +587 -0
- package/src/orchestrator-extraction-queue.test.ts +197 -0
- package/src/orchestrator-flush.test.ts +1171 -0
- package/src/orchestrator-pattern-reinforcement.test.ts +128 -0
- package/src/orchestrator-source-attribution.test.ts +701 -0
- package/src/orchestrator.ts +16368 -0
- package/src/page-versioning.ts +450 -0
- package/src/patterns-cli.ts +574 -0
- package/src/peers/index.ts +54 -0
- package/src/peers/migrate-from-identity-anchor.test.ts +291 -0
- package/src/peers/migrate-from-identity-anchor.ts +350 -0
- package/src/peers/peers.test.ts +419 -0
- package/src/peers/profile-reasoner.ts +694 -0
- package/src/peers/storage.ts +1350 -0
- package/src/peers/types.ts +138 -0
- package/src/plugin-id.ts +84 -0
- package/src/policy-runtime.ts +209 -0
- package/src/procedural/procedure-miner.ts +150 -0
- package/src/procedural/procedure-recall.ts +93 -0
- package/src/procedural/procedure-stats.ts +213 -0
- package/src/procedural/procedure-types.ts +132 -0
- package/src/procedural/reinforcement-core.test.ts +132 -0
- package/src/procedural/reinforcement-core.ts +73 -0
- package/src/profiling.test.ts +263 -0
- package/src/profiling.ts +435 -0
- package/src/projection/index.ts +398 -0
- package/src/qmd-recall-cache.test.ts +138 -0
- package/src/qmd-recall-cache.ts +111 -0
- package/src/qmd.test.ts +257 -0
- package/src/qmd.ts +2614 -0
- package/src/reasoning-trace-recall.ts +201 -0
- package/src/reasoning-trace-types.ts +235 -0
- package/src/recall-audit-anomaly.test.ts +246 -0
- package/src/recall-audit-anomaly.ts +297 -0
- package/src/recall-audit.test.ts +51 -0
- package/src/recall-audit.ts +72 -0
- package/src/recall-budget-config.test.ts +87 -0
- package/src/recall-disclosure-escalation.test.ts +196 -0
- package/src/recall-disclosure-escalation.ts +158 -0
- package/src/recall-disclosure-shaping.test.ts +146 -0
- package/src/recall-disclosure.test.ts +214 -0
- package/src/recall-explain-renderer.test.ts +140 -0
- package/src/recall-explain-renderer.ts +356 -0
- package/src/recall-mmr.test.ts +808 -0
- package/src/recall-mmr.ts +607 -0
- package/src/recall-qos.test.ts +85 -0
- package/src/recall-qos.ts +82 -0
- package/src/recall-query-policy.ts +221 -0
- package/src/recall-state.test.ts +233 -0
- package/src/recall-state.ts +456 -0
- package/src/recall-tag-filter.ts +143 -0
- package/src/recall-tokenization.ts +35 -0
- package/src/recall-xray-cli.test.ts +118 -0
- package/src/recall-xray-cli.ts +100 -0
- package/src/recall-xray-disclosure-telemetry.test.ts +183 -0
- package/src/recall-xray-renderer.test.ts +539 -0
- package/src/recall-xray-renderer.ts +487 -0
- package/src/recall-xray.test.ts +503 -0
- package/src/recall-xray.ts +621 -0
- package/src/reconstruct.ts +41 -0
- package/src/release-changelog.ts +35 -0
- package/src/relevance.ts +67 -0
- package/src/replay/normalizers/chatgpt.ts +133 -0
- package/src/replay/normalizers/claude.ts +102 -0
- package/src/replay/normalizers/openclaw.ts +119 -0
- package/src/replay/normalizers/shared.ts +69 -0
- package/src/replay/runner.ts +197 -0
- package/src/replay/types.ts +143 -0
- package/src/rerank.test.ts +48 -0
- package/src/rerank.ts +176 -0
- package/src/resolve-auth-token.test.ts +226 -0
- package/src/resolve-auth-token.ts +151 -0
- package/src/resolve-provider-secret.test.ts +187 -0
- package/src/resolve-provider-secret.ts +410 -0
- package/src/response-guidance-recall.test.ts +3952 -0
- package/src/response-guidance-recall.ts +4431 -0
- package/src/resume-bundles.ts +415 -0
- package/src/retrieval-agents.ts +623 -0
- package/src/retrieval-tiers.ts +25 -0
- package/src/retrieval.ts +104 -0
- package/src/review/index.test.ts +201 -0
- package/src/review/index.ts +536 -0
- package/src/routing/engine.ts +162 -0
- package/src/routing/store.ts +321 -0
- package/src/runtime/better-sqlite.test.ts +32 -0
- package/src/runtime/better-sqlite.ts +76 -0
- package/src/runtime/child-process.ts +67 -0
- package/src/runtime/env.ts +48 -0
- package/src/sanitize.ts +58 -0
- package/src/schemas.ts +449 -0
- package/src/sdk-compat.ts +87 -0
- package/src/search/document-scanner.ts +96 -0
- package/src/search/embed-helper.ts +142 -0
- package/src/search/factory.ts +189 -0
- package/src/search/index.ts +10 -0
- package/src/search/lancedb-backend.ts +342 -0
- package/src/search/meilisearch-backend.ts +232 -0
- package/src/search/noop-backend.ts +57 -0
- package/src/search/orama-backend.ts +358 -0
- package/src/search/port.ts +86 -0
- package/src/search/remote-backend.ts +124 -0
- package/src/secure-store/cipher.ts +271 -0
- package/src/secure-store/cli-handlers.ts +355 -0
- package/src/secure-store/cli-renderer.ts +131 -0
- package/src/secure-store/header.ts +373 -0
- package/src/secure-store/index.ts +137 -0
- package/src/secure-store/kdf.ts +263 -0
- package/src/secure-store/keyring.ts +106 -0
- package/src/secure-store/metadata.ts +394 -0
- package/src/secure-store/passphrase-reader.ts +252 -0
- package/src/secure-store/secure-fs.ts +571 -0
- package/src/secure-store/secure-store.test.ts +755 -0
- package/src/semantic-chunking.ts +545 -0
- package/src/semantic-consolidation.test.ts +182 -0
- package/src/semantic-consolidation.ts +432 -0
- package/src/semantic-rule-promotion.ts +183 -0
- package/src/semantic-rule-verifier.ts +160 -0
- package/src/session-integrity.ts +569 -0
- package/src/session-observer-bands.ts +11 -0
- package/src/session-observer-state.ts +346 -0
- package/src/session-toggles.test.ts +96 -0
- package/src/session-toggles.ts +159 -0
- package/src/shared-context/manager.ts +810 -0
- package/src/signal.ts +84 -0
- package/src/skills-registry.test.ts +277 -0
- package/src/skills-registry.ts +120 -0
- package/src/source-attribution-roundtrip.test.ts +215 -0
- package/src/source-attribution.test.ts +1425 -0
- package/src/source-attribution.ts +639 -0
- package/src/spaces/index.ts +627 -0
- package/src/storage-paths.ts +117 -0
- package/src/storage.ts +6657 -0
- package/src/store-contract.ts +55 -0
- package/src/summarizer.ts +844 -0
- package/src/summary-snapshot.test.ts +681 -0
- package/src/summary-snapshot.ts +238 -0
- package/src/surfaces/dreams.test.ts +394 -0
- package/src/surfaces/dreams.ts +346 -0
- package/src/surfaces/heartbeat.test.ts +415 -0
- package/src/surfaces/heartbeat.ts +325 -0
- package/src/sync/index.ts +308 -0
- package/src/targeted-fact-recall.test.ts +1694 -0
- package/src/targeted-fact-recall.ts +2905 -0
- package/src/taxonomy/default-taxonomy.ts +87 -0
- package/src/taxonomy/index.ts +26 -0
- package/src/taxonomy/resolver-doc-generator.ts +57 -0
- package/src/taxonomy/resolver.ts +184 -0
- package/src/taxonomy/taxonomy-loader.ts +186 -0
- package/src/taxonomy/types.ts +48 -0
- package/src/telemetry-transcript.ts +70 -0
- package/src/temporal-index.ts +890 -0
- package/src/temporal-supersession.test.ts +2703 -0
- package/src/temporal-supersession.ts +493 -0
- package/src/temporal-validity.test.ts +448 -0
- package/src/temporal-validity.ts +123 -0
- package/src/threading.ts +395 -0
- package/src/tier-migration.ts +124 -0
- package/src/tier-routing.ts +102 -0
- package/src/tmt.ts +462 -0
- package/src/tokens.test.ts +178 -0
- package/src/tokens.ts +279 -0
- package/src/topics.ts +147 -0
- package/src/training-export/cli-date-validation.test.ts +258 -0
- package/src/training-export/converter.test.ts +452 -0
- package/src/training-export/converter.ts +319 -0
- package/src/training-export/date-parse.ts +117 -0
- package/src/training-export/index.ts +26 -0
- package/src/training-export/registry.test.ts +85 -0
- package/src/training-export/registry.ts +57 -0
- package/src/training-export/types.ts +31 -0
- package/src/transcript.ts +1179 -0
- package/src/transfer/autodetect.ts +30 -0
- package/src/transfer/backup.ts +138 -0
- package/src/transfer/capsule-crypto.ts +485 -0
- package/src/transfer/capsule-encrypt.test.ts +690 -0
- package/src/transfer/capsule-export.ts +543 -0
- package/src/transfer/capsule-fork.ts +375 -0
- package/src/transfer/capsule-import.ts +564 -0
- package/src/transfer/capsule-merge.ts +433 -0
- package/src/transfer/conflict-policy.ts +16 -0
- package/src/transfer/constants.ts +13 -0
- package/src/transfer/exclusions.ts +37 -0
- package/src/transfer/export-json.ts +65 -0
- package/src/transfer/export-md.ts +59 -0
- package/src/transfer/export-sqlite.ts +52 -0
- package/src/transfer/fs-utils.ts +269 -0
- package/src/transfer/import-json.ts +108 -0
- package/src/transfer/import-md.ts +84 -0
- package/src/transfer/import-sqlite.ts +100 -0
- package/src/transfer/integrity.ts +71 -0
- package/src/transfer/sqlite-schema.ts +16 -0
- package/src/transfer/types.ts +297 -0
- package/src/trust-zones.ts +1186 -0
- package/src/types.ts +3074 -0
- package/src/user-model.test.ts +124 -0
- package/src/user-model.ts +162 -0
- package/src/utility-learner.ts +353 -0
- package/src/utility-runtime.ts +88 -0
- package/src/utility-telemetry.ts +215 -0
- package/src/utils/category-dir.ts +44 -0
- package/src/utils/errno.ts +6 -0
- package/src/utils/iso-timestamp.test.ts +37 -0
- package/src/utils/iso-timestamp.ts +164 -0
- package/src/utils/path.ts +26 -0
- package/src/verified-recall.ts +138 -0
- package/src/version-utils.test.ts +10 -0
- package/src/version-utils.ts +9 -0
- package/src/whitespace.ts +10 -0
- package/src/work/board.ts +359 -0
- package/src/work/boundary.ts +107 -0
- package/src/work/storage.ts +436 -0
- package/src/work/types.ts +82 -0
- package/src/work-product-ledger.ts +265 -0
- package/dist/access-service-BkXt3di1.d.ts +0 -2039
- package/dist/capsule-crypto-SJS5VVAP.js +0 -18
- package/dist/capsule-export-LLEVB2RG.js +0 -17
- package/dist/capsule-import-UW45R2MZ.js +0 -16
- package/dist/capsule-merge-DI7PNQ2H.js +0 -189
- package/dist/chunk-2LGMW3DJ.js +0 -111
- package/dist/chunk-2YMTO4ZJ.js +0 -265
- package/dist/chunk-2YMTO4ZJ.js.map +0 -1
- package/dist/chunk-363MWCD3.js +0 -9683
- package/dist/chunk-363MWCD3.js.map +0 -1
- package/dist/chunk-36CTNQY7.js +0 -1554
- package/dist/chunk-36CTNQY7.js.map +0 -1
- package/dist/chunk-457A4P3L.js +0 -119
- package/dist/chunk-457A4P3L.js.map +0 -1
- package/dist/chunk-4DXC6HQQ.js +0 -1837
- package/dist/chunk-4DXC6HQQ.js.map +0 -1
- package/dist/chunk-4IS4SXIQ.js +0 -2040
- package/dist/chunk-57QNCUEZ.js +0 -1914
- package/dist/chunk-57QNCUEZ.js.map +0 -1
- package/dist/chunk-6AUUAZEX.js +0 -150
- package/dist/chunk-6AUUAZEX.js.map +0 -1
- package/dist/chunk-6TBWYBJ3.js +0 -236
- package/dist/chunk-6XA7UN4Z.js +0 -135
- package/dist/chunk-6Z6UH6TK.js +0 -2129
- package/dist/chunk-6Z6UH6TK.js.map +0 -1
- package/dist/chunk-74EMIVE4.js +0 -329
- package/dist/chunk-74EMIVE4.js.map +0 -1
- package/dist/chunk-74WWN7ZW.js +0 -82
- package/dist/chunk-74WWN7ZW.js.map +0 -1
- package/dist/chunk-767ODGE6.js +0 -183
- package/dist/chunk-A4ACKWIW.js +0 -289
- package/dist/chunk-A4ACKWIW.js.map +0 -1
- package/dist/chunk-ASAITVLA.js +0 -64
- package/dist/chunk-ASAITVLA.js.map +0 -1
- package/dist/chunk-C5HUWVH2.js +0 -891
- package/dist/chunk-C5HUWVH2.js.map +0 -1
- package/dist/chunk-D54LZC5L.js +0 -147
- package/dist/chunk-DF3RVK3X.js +0 -119
- package/dist/chunk-DF3RVK3X.js.map +0 -1
- package/dist/chunk-E6K4NIEU.js +0 -747
- package/dist/chunk-E6K4NIEU.js.map +0 -1
- package/dist/chunk-EEQLFRUM.js +0 -89
- package/dist/chunk-EQINRHYR.js +0 -672
- package/dist/chunk-EQINRHYR.js.map +0 -1
- package/dist/chunk-ETOW6ACV.js +0 -158
- package/dist/chunk-ETOW6ACV.js.map +0 -1
- package/dist/chunk-EYNQTST2.js +0 -721
- package/dist/chunk-FYIYMQ5N.js +0 -221
- package/dist/chunk-FYIYMQ5N.js.map +0 -1
- package/dist/chunk-G2WADRQ3.js +0 -219
- package/dist/chunk-G4SK7DSQ.js +0 -121
- package/dist/chunk-GGD5W7TB.js +0 -105
- package/dist/chunk-GGD5W7TB.js.map +0 -1
- package/dist/chunk-GVPWB7EY.js +0 -390
- package/dist/chunk-GVPWB7EY.js.map +0 -1
- package/dist/chunk-HJYHRE4S.js +0 -647
- package/dist/chunk-I6BQZSML.js +0 -1451
- package/dist/chunk-I6BQZSML.js.map +0 -1
- package/dist/chunk-IBX3VFOM.js +0 -446
- package/dist/chunk-IBX3VFOM.js.map +0 -1
- package/dist/chunk-IXEJRKCZ.js +0 -18
- package/dist/chunk-JBMSGZEQ.js +0 -441
- package/dist/chunk-JBMSGZEQ.js.map +0 -1
- package/dist/chunk-JRNQ3RNA.js +0 -284
- package/dist/chunk-JRNQ3RNA.js.map +0 -1
- package/dist/chunk-K6WK37A6.js +0 -865
- package/dist/chunk-K6WK37A6.js.map +0 -1
- package/dist/chunk-KBYWQWSB.js +0 -271
- package/dist/chunk-KUHRUM6B.js +0 -14397
- package/dist/chunk-KUHRUM6B.js.map +0 -1
- package/dist/chunk-KWBPHZUU.js +0 -83
- package/dist/chunk-KWBPHZUU.js.map +0 -1
- package/dist/chunk-LIO5X3CM.js +0 -596
- package/dist/chunk-MARWOCVP.js +0 -48
- package/dist/chunk-MCC6KDQF.js +0 -5095
- package/dist/chunk-MCC6KDQF.js.map +0 -1
- package/dist/chunk-N5AKDXAI.js +0 -74
- package/dist/chunk-NN3LPQ5D.js +0 -936
- package/dist/chunk-NN3LPQ5D.js.map +0 -1
- package/dist/chunk-O4XJUPSF.js +0 -533
- package/dist/chunk-O4XJUPSF.js.map +0 -1
- package/dist/chunk-OA3L7BFR.js +0 -183
- package/dist/chunk-OA3L7BFR.js.map +0 -1
- package/dist/chunk-OR64ZGRZ.js +0 -23
- package/dist/chunk-P73JTV34.js +0 -275
- package/dist/chunk-P73JTV34.js.map +0 -1
- package/dist/chunk-P77UEOU2.js +0 -1521
- package/dist/chunk-P77UEOU2.js.map +0 -1
- package/dist/chunk-PB5KW5PL.js +0 -118
- package/dist/chunk-PHNGXFQ6.js +0 -623
- package/dist/chunk-PHNGXFQ6.js.map +0 -1
- package/dist/chunk-QIGOEM65.js +0 -228
- package/dist/chunk-RXTFCYQF.js +0 -108
- package/dist/chunk-S2JJBLJG.js +0 -2101
- package/dist/chunk-S2JJBLJG.js.map +0 -1
- package/dist/chunk-S3IP6R6K.js +0 -219
- package/dist/chunk-S3IP6R6K.js.map +0 -1
- package/dist/chunk-SRBJUAMP.js +0 -403
- package/dist/chunk-SRBJUAMP.js.map +0 -1
- package/dist/chunk-URB2WSKZ.js +0 -350
- package/dist/chunk-URB2WSKZ.js.map +0 -1
- package/dist/chunk-VQXK37XA.js +0 -26
- package/dist/chunk-VQXK37XA.js.map +0 -1
- package/dist/chunk-VTU2B4VF.js +0 -146
- package/dist/chunk-VTU2B4VF.js.map +0 -1
- package/dist/chunk-VX2IUQFE.js +0 -613
- package/dist/chunk-VX2IUQFE.js.map +0 -1
- package/dist/chunk-WGK4VHGP.js +0 -4292
- package/dist/chunk-WGK4VHGP.js.map +0 -1
- package/dist/chunk-WTFWLUSX.js +0 -827
- package/dist/chunk-WTFWLUSX.js.map +0 -1
- package/dist/chunk-XJKFSSDW.js +0 -726
- package/dist/chunk-XJKFSSDW.js.map +0 -1
- package/dist/chunk-XMHBH5H6.js +0 -283
- package/dist/chunk-XMHBH5H6.js.map +0 -1
- package/dist/chunk-XMVFHBHT.js +0 -277
- package/dist/chunk-Y5KDIOKF.js +0 -2403
- package/dist/chunk-Y5KDIOKF.js.map +0 -1
- package/dist/chunk-YNB73F22.js +0 -137
- package/dist/chunk-YNB73F22.js.map +0 -1
- package/dist/chunk-Z2E7VW55.js +0 -335
- package/dist/chunk-Z2E7VW55.js.map +0 -1
- package/dist/chunk-Z5S5HNGY.js +0 -2280
- package/dist/chunk-Z5S5HNGY.js.map +0 -1
- package/dist/chunk-ZL4S7ARC.js +0 -53
- package/dist/chunk-ZTSE2ZJ6.js +0 -190
- package/dist/chunk-ZTSE2ZJ6.js.map +0 -1
- package/dist/cli-Cvy2SNhF.d.ts +0 -1259
- package/dist/codex-materialize-CQlLTzke.d.ts +0 -139
- package/dist/connectors-cli-DFGtY2DB.d.ts +0 -257
- package/dist/contradiction-review-5LTTVDQV.js +0 -22
- package/dist/contradiction-scan-3Z6YW7YA.js +0 -413
- package/dist/contradiction-scan-3Z6YW7YA.js.map +0 -1
- package/dist/engine-FOC3IJLA.js +0 -28
- package/dist/fs-utils-IRVUFB6G.js +0 -30
- package/dist/graph-edge-decay-PWB63GRE.js +0 -207
- package/dist/index-1qIcnbG1.d.ts +0 -34
- package/dist/memory-governance-F3QOJGEY.js +0 -37
- package/dist/memory-projection-store-CY8TU40w.d.ts +0 -222
- package/dist/orchestrator-AOQMo7QI.d.ts +0 -1784
- package/dist/path-RMTY5Y5A.js +0 -9
- package/dist/port-B6VEDIkC.d.ts +0 -53
- package/dist/resolution-YGIBORXI.js +0 -101
- package/dist/resolution-YGIBORXI.js.map +0 -1
- package/dist/secure-store-4R2GSO7S.js +0 -156
- package/dist/semantic-consolidation-ByBXb-sf.d.ts +0 -180
- package/dist/state-store-3EH7HYIN.js +0 -16
- package/dist/types-V3FJ26TF.js +0 -30
- /package/dist/{capsule-crypto-SJS5VVAP.js.map → action-confidence.js.map} +0 -0
- /package/dist/{capsule-export-LLEVB2RG.js.map → adapters/claude-code.js.map} +0 -0
- /package/dist/{capsule-import-UW45R2MZ.js.map → adapters/codex.js.map} +0 -0
- /package/dist/{contradiction-review-5LTTVDQV.js.map → adapters/hermes.js.map} +0 -0
- /package/dist/{engine-FOC3IJLA.js.map → adapters/index.js.map} +0 -0
- /package/dist/{fs-utils-IRVUFB6G.js.map → adapters/registry.js.map} +0 -0
- /package/dist/{memory-governance-F3QOJGEY.js.map → adapters/replit.js.map} +0 -0
- /package/dist/{path-RMTY5Y5A.js.map → adapters/types.js.map} +0 -0
- /package/dist/{secure-store-4R2GSO7S.js.map → capsule-crypto-5CYAGVC5.js.map} +0 -0
- /package/dist/{capsule-merge-DI7PNQ2H.js.map → capsule-merge-4MGKE7C5.js.map} +0 -0
- /package/dist/{chunk-G4SK7DSQ.js.map → chunk-2WWLHTZY.js.map} +0 -0
- /package/dist/{chunk-KBYWQWSB.js.map → chunk-4CRG46BG.js.map} +0 -0
- /package/dist/{chunk-LIO5X3CM.js.map → chunk-7IASACLB.js.map} +0 -0
- /package/dist/{chunk-EYNQTST2.js.map → chunk-EFJ3MQ4V.js.map} +0 -0
- /package/dist/{chunk-D54LZC5L.js.map → chunk-FDU6HUUL.js.map} +0 -0
- /package/dist/{chunk-QIGOEM65.js.map → chunk-GGKRUQOO.js.map} +0 -0
- /package/dist/{chunk-HJYHRE4S.js.map → chunk-GL6I6MEQ.js.map} +0 -0
- /package/dist/{state-store-3EH7HYIN.js.map → chunk-HHLLAQGZ.js.map} +0 -0
- /package/dist/{chunk-4IS4SXIQ.js.map → chunk-HXXBL2KD.js.map} +0 -0
- /package/dist/{chunk-767ODGE6.js.map → chunk-KNKUID7G.js.map} +0 -0
- /package/dist/{chunk-6TBWYBJ3.js.map → chunk-LPMVBPA3.js.map} +0 -0
- /package/dist/{chunk-PB5KW5PL.js.map → chunk-MC26UJIM.js.map} +0 -0
- /package/dist/{chunk-ZL4S7ARC.js.map → chunk-MT4HVDUZ.js.map} +0 -0
- /package/dist/{chunk-G2WADRQ3.js.map → chunk-MY6TPVXW.js.map} +0 -0
- /package/dist/{chunk-OR64ZGRZ.js.map → chunk-NNVTUXEB.js.map} +0 -0
- /package/dist/{chunk-RXTFCYQF.js.map → chunk-P4NEIHUT.js.map} +0 -0
- /package/dist/{chunk-IXEJRKCZ.js.map → chunk-QRNI5JBH.js.map} +0 -0
- /package/dist/{chunk-EEQLFRUM.js.map → chunk-RRF5UOBJ.js.map} +0 -0
- /package/dist/{types-V3FJ26TF.js.map → chunk-SEDEKFYQ.js.map} +0 -0
- /package/dist/{chunk-2LGMW3DJ.js.map → chunk-U3PN77QT.js.map} +0 -0
- /package/dist/{chunk-XMVFHBHT.js.map → chunk-U3WSW6PZ.js.map} +0 -0
- /package/dist/{chunk-N5AKDXAI.js.map → chunk-UWVJF25J.js.map} +0 -0
- /package/dist/{chunk-MARWOCVP.js.map → chunk-XIG5PDM7.js.map} +0 -0
- /package/dist/{chunk-6XA7UN4Z.js.map → chunk-XVZ7B3HG.js.map} +0 -0
- /package/dist/{graph-edge-decay-PWB63GRE.js.map → graph-edge-decay-5DI5GUNL.js.map} +0 -0
|
@@ -0,0 +1,2161 @@
|
|
|
1
|
+
import {
|
|
2
|
+
buildEvidencePack,
|
|
3
|
+
insertAfterEvidenceHeading
|
|
4
|
+
} from "./chunk-PYPOFEMK.js";
|
|
5
|
+
|
|
6
|
+
// src/targeted-fact-recall.ts
|
|
7
|
+
var DEFAULT_MAX_SEARCH_RESULTS = 48;
|
|
8
|
+
var DEFAULT_SCAN_WINDOW_TURNS = 8;
|
|
9
|
+
var DEFAULT_SCAN_WINDOW_TOKENS = 12e3;
|
|
10
|
+
function shouldRecallTargetedFactEvidence(query) {
|
|
11
|
+
return classifyTargetedFactIntent(query) !== null;
|
|
12
|
+
}
|
|
13
|
+
async function buildTargetedFactRecallSection(options) {
|
|
14
|
+
const budget = normalizePositiveInteger(options.maxChars);
|
|
15
|
+
const maxResults = normalizePositiveInteger(
|
|
16
|
+
options.maxSearchResults ?? DEFAULT_MAX_SEARCH_RESULTS
|
|
17
|
+
);
|
|
18
|
+
if (!options.engine || budget <= 0 || !shouldRecallTargetedFactEvidence(options.query)) {
|
|
19
|
+
return "";
|
|
20
|
+
}
|
|
21
|
+
if (maxResults <= 0) {
|
|
22
|
+
return "";
|
|
23
|
+
}
|
|
24
|
+
const searchItems = await collectTargetedFactSearchItems(options);
|
|
25
|
+
const scannedItems = await collectTargetedFactScanItems(options);
|
|
26
|
+
const ranked = rankAndDedupeTargetedFactItems(
|
|
27
|
+
[...searchItems, ...scannedItems],
|
|
28
|
+
options.query
|
|
29
|
+
).slice(0, maxResults);
|
|
30
|
+
const title = options.title ?? "Targeted fact evidence";
|
|
31
|
+
const summary = buildTargetedFactSummary(ranked, options.query);
|
|
32
|
+
const summaryInsert = summary ? `
|
|
33
|
+
|
|
34
|
+
${summary}` : "";
|
|
35
|
+
const evidenceBudget = summaryInsert ? Math.max(0, budget - summaryInsert.length) : budget;
|
|
36
|
+
const evidence = buildEvidencePack(ranked, {
|
|
37
|
+
title,
|
|
38
|
+
maxChars: evidenceBudget,
|
|
39
|
+
maxItemChars: options.maxItemChars,
|
|
40
|
+
query: buildTargetedFactQuery(options.query)
|
|
41
|
+
});
|
|
42
|
+
if (!summary) {
|
|
43
|
+
return evidence;
|
|
44
|
+
}
|
|
45
|
+
if (!evidence) {
|
|
46
|
+
return clipTextToBudget(`## ${title}${summaryInsert}`, budget);
|
|
47
|
+
}
|
|
48
|
+
return insertAfterEvidenceHeading(evidence, title, summaryInsert);
|
|
49
|
+
}
|
|
50
|
+
async function collectTargetedFactSearchItems(options) {
|
|
51
|
+
const engine = options.engine;
|
|
52
|
+
if (!engine) return [];
|
|
53
|
+
const results = await engine.searchContextFull(
|
|
54
|
+
buildTargetedFactQuery(options.query),
|
|
55
|
+
normalizePositiveInteger(options.maxSearchResults ?? DEFAULT_MAX_SEARCH_RESULTS),
|
|
56
|
+
options.sessionId
|
|
57
|
+
);
|
|
58
|
+
const searchWindowTurns = Math.max(
|
|
59
|
+
1,
|
|
60
|
+
normalizePositiveInteger(options.maxScanWindowTurns ?? DEFAULT_SCAN_WINDOW_TURNS)
|
|
61
|
+
);
|
|
62
|
+
const searchWindowBefore = Math.floor((searchWindowTurns - 1) / 2);
|
|
63
|
+
const searchWindowAfter = Math.ceil((searchWindowTurns - 1) / 2);
|
|
64
|
+
const searchWindowTokens = Math.max(
|
|
65
|
+
1,
|
|
66
|
+
normalizePositiveInteger(options.maxScanWindowTokens ?? DEFAULT_SCAN_WINDOW_TOKENS)
|
|
67
|
+
);
|
|
68
|
+
const items = [];
|
|
69
|
+
const seen = /* @__PURE__ */ new Set();
|
|
70
|
+
for (const result of results) {
|
|
71
|
+
const expanded = await engine.expandContext(
|
|
72
|
+
result.session_id,
|
|
73
|
+
Math.max(0, result.turn_index - searchWindowBefore),
|
|
74
|
+
result.turn_index + searchWindowAfter,
|
|
75
|
+
searchWindowTokens
|
|
76
|
+
);
|
|
77
|
+
const searchHit = {
|
|
78
|
+
id: `${result.session_id}:${result.turn_index}`,
|
|
79
|
+
sessionId: result.session_id,
|
|
80
|
+
turnIndex: result.turn_index,
|
|
81
|
+
role: result.role,
|
|
82
|
+
content: result.content,
|
|
83
|
+
...typeof result.score === "number" ? { score: result.score } : {}
|
|
84
|
+
};
|
|
85
|
+
const candidates = expanded.map((message) => ({
|
|
86
|
+
id: `${result.session_id}:${message.turn_index}`,
|
|
87
|
+
sessionId: result.session_id,
|
|
88
|
+
turnIndex: message.turn_index,
|
|
89
|
+
role: message.role,
|
|
90
|
+
content: message.content,
|
|
91
|
+
...message.turn_index === result.turn_index && typeof result.score === "number" ? { score: result.score } : {}
|
|
92
|
+
}));
|
|
93
|
+
const hitIndex = candidates.findIndex(
|
|
94
|
+
(candidate) => candidate.turnIndex === result.turn_index
|
|
95
|
+
);
|
|
96
|
+
if (hitIndex >= 0) {
|
|
97
|
+
candidates[hitIndex] = searchHit;
|
|
98
|
+
} else {
|
|
99
|
+
candidates.unshift(searchHit);
|
|
100
|
+
}
|
|
101
|
+
for (const candidate of candidates) {
|
|
102
|
+
const candidateId = candidate.id ?? (candidate.sessionId && typeof candidate.turnIndex === "number" ? `${candidate.sessionId}:${candidate.turnIndex}` : void 0);
|
|
103
|
+
if (candidateId && seen.has(candidateId)) continue;
|
|
104
|
+
if (!isTargetedFactEvidence(candidate.content, options.query)) continue;
|
|
105
|
+
if (candidateId) seen.add(candidateId);
|
|
106
|
+
items.push(candidate);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return items;
|
|
110
|
+
}
|
|
111
|
+
async function collectTargetedFactScanItems(options) {
|
|
112
|
+
const engine = options.engine;
|
|
113
|
+
if (!engine?.getStats || !options.sessionId) return [];
|
|
114
|
+
const stats = await engine.getStats(options.sessionId);
|
|
115
|
+
const maxTurn = typeof stats.maxTurnIndex === "number" ? stats.maxTurnIndex : stats.totalMessages - 1;
|
|
116
|
+
if (maxTurn < 0) return [];
|
|
117
|
+
const windowTurns = Math.max(
|
|
118
|
+
1,
|
|
119
|
+
normalizePositiveInteger(options.maxScanWindowTurns ?? DEFAULT_SCAN_WINDOW_TURNS)
|
|
120
|
+
);
|
|
121
|
+
const windowTokens = Math.max(
|
|
122
|
+
1,
|
|
123
|
+
normalizePositiveInteger(options.maxScanWindowTokens ?? DEFAULT_SCAN_WINDOW_TOKENS)
|
|
124
|
+
);
|
|
125
|
+
const items = [];
|
|
126
|
+
const fromTurn = Math.max(0, maxTurn - windowTurns + 1);
|
|
127
|
+
const messages = await engine.expandContext(
|
|
128
|
+
options.sessionId,
|
|
129
|
+
fromTurn,
|
|
130
|
+
maxTurn,
|
|
131
|
+
windowTokens
|
|
132
|
+
);
|
|
133
|
+
for (const message of messages) {
|
|
134
|
+
if (!isTargetedFactEvidence(message.content, options.query)) continue;
|
|
135
|
+
items.push({
|
|
136
|
+
id: `${options.sessionId}:${message.turn_index}`,
|
|
137
|
+
sessionId: options.sessionId,
|
|
138
|
+
turnIndex: message.turn_index,
|
|
139
|
+
role: message.role,
|
|
140
|
+
content: message.content
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
return items;
|
|
144
|
+
}
|
|
145
|
+
function rankAndDedupeTargetedFactItems(items, query) {
|
|
146
|
+
const seenIds = /* @__PURE__ */ new Set();
|
|
147
|
+
const seenContent = /* @__PURE__ */ new Set();
|
|
148
|
+
const ranked = [];
|
|
149
|
+
for (const item of items) {
|
|
150
|
+
const id = item.id ?? (item.sessionId && typeof item.turnIndex === "number" ? `${item.sessionId}:${item.turnIndex}` : void 0);
|
|
151
|
+
if (id && seenIds.has(id)) continue;
|
|
152
|
+
const contentKey = item.content.toLowerCase().replace(/\s+/g, " ").trim();
|
|
153
|
+
if (seenContent.has(contentKey)) continue;
|
|
154
|
+
if (id) seenIds.add(id);
|
|
155
|
+
seenContent.add(contentKey);
|
|
156
|
+
ranked.push({
|
|
157
|
+
...item,
|
|
158
|
+
content: appendNormalizedNumericCues(item.content),
|
|
159
|
+
rank: scoreTargetedFactEvidence(item, query)
|
|
160
|
+
});
|
|
161
|
+
}
|
|
162
|
+
return ranked.sort((left, right) => {
|
|
163
|
+
if (right.rank !== left.rank) return right.rank - left.rank;
|
|
164
|
+
const leftTurn = typeof left.turnIndex === "number" ? left.turnIndex : -1;
|
|
165
|
+
const rightTurn = typeof right.turnIndex === "number" ? right.turnIndex : -1;
|
|
166
|
+
if (rightTurn !== leftTurn) return rightTurn - leftTurn;
|
|
167
|
+
return (right.score ?? 0) - (left.score ?? 0);
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
function scoreTargetedFactEvidence(item, query) {
|
|
171
|
+
const content = item.content.toLowerCase();
|
|
172
|
+
const normalizedQuery = query.toLowerCase();
|
|
173
|
+
let score = 0;
|
|
174
|
+
if (item.role === "user") score += 8;
|
|
175
|
+
if (item.role === "assistant") score += 2;
|
|
176
|
+
if (hasMoneyOrPercent(item.content)) score += 8;
|
|
177
|
+
if (/\b\d[\d,]*(?:\.\d+)?\s?%/.test(content)) score += 5;
|
|
178
|
+
if (/\b(?:finally|reached|updated|adjusted|increased|decreased|now|current|currently|latest|most recent)\b/.test(content)) {
|
|
179
|
+
score += 7;
|
|
180
|
+
}
|
|
181
|
+
if (isCacheTtlQuery(normalizedQuery)) {
|
|
182
|
+
if (isCacheTtlEvidenceText(content)) score += 60;
|
|
183
|
+
if (/\b7200\s+seconds?\b/.test(content)) score += 30;
|
|
184
|
+
if (/\b(?:redis|cache|ttl|time-to-live|time to live|diffusion features?)\b/.test(content)) {
|
|
185
|
+
score += 12;
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (isGameCachingAuthenticationToolCountQuery(normalizedQuery)) {
|
|
189
|
+
if (isGameCachingAuthenticationToolCountEvidenceText(content)) score += 70;
|
|
190
|
+
if (/\bredis\s*6\.2\b/.test(content)) score += 45;
|
|
191
|
+
if (/\bphaser\s*3\.55\b/.test(content)) score += 45;
|
|
192
|
+
if (/\bnode\.?js\b/.test(content)) score += 28;
|
|
193
|
+
if (/\bexpress(?:\.js)?\b/.test(content)) score += 28;
|
|
194
|
+
if (/\b(?:jwt|jsonwebtoken)\b/.test(content)) score += 28;
|
|
195
|
+
if (/\bdocker\b/.test(content)) score += 20;
|
|
196
|
+
if (/\b(?:authentication|auth|refresh token|token rotation)\b/.test(content)) {
|
|
197
|
+
score += 18;
|
|
198
|
+
}
|
|
199
|
+
if (/\b(?:game state snapshots?|game caching|phaser|2d rendering)\b/.test(content)) {
|
|
200
|
+
score += 18;
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
if (isGeometryTypeCountQuery(normalizedQuery)) {
|
|
204
|
+
if (isGeometryTypeCountEvidenceText(content)) score += 70;
|
|
205
|
+
if (/\beuclidean\b/.test(content)) score += 24;
|
|
206
|
+
if (/\bhyperbolic\b/.test(content)) score += 24;
|
|
207
|
+
if (/\bspherical\b/.test(content)) score += 24;
|
|
208
|
+
if (/\b(?:parallel lines?|triangle angle sums?|angle sums?|geometr(?:y|ies))\b/.test(content)) {
|
|
209
|
+
score += 18;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
if (isBitcoinInvestmentPlatformQuery(normalizedQuery)) {
|
|
213
|
+
if (isBitcoinInvestmentPlatformEvidenceText(content)) score += 80;
|
|
214
|
+
if (/\bbitcoin\b/.test(content)) score += 28;
|
|
215
|
+
if (/\bbinance\b/.test(content)) score += 36;
|
|
216
|
+
if (/\$\s?500\b|\b500\s+dollars?\b/.test(content)) score += 42;
|
|
217
|
+
}
|
|
218
|
+
if (isCryptoFeeTotalQuery(normalizedQuery)) {
|
|
219
|
+
if (isCryptoFeeEvidenceText(content)) score += 70;
|
|
220
|
+
if (/\bethereum\b/.test(content)) score += 18;
|
|
221
|
+
if (/\bwallet transfer\b/.test(content)) score += 20;
|
|
222
|
+
if (/\bnft\b/.test(content)) score += 18;
|
|
223
|
+
if (/\bgas fees?\b/.test(content)) score += 20;
|
|
224
|
+
if (/\$\s?5\b|\b5\s+dollars?\b/.test(content)) score += 18;
|
|
225
|
+
if (/\$\s?2\.50\b|\b2\.50\s+dollars?\b/.test(content)) score += 18;
|
|
226
|
+
if (/\$\s?10\b|\b10\s+dollars?\b/.test(content)) score += 18;
|
|
227
|
+
}
|
|
228
|
+
if (isPopulationGrowthRateQuery(normalizedQuery)) {
|
|
229
|
+
if (isPopulationGrowthRateEvidenceText(content)) score += 70;
|
|
230
|
+
if (/\bk\s*=\s*0?\.035\b/.test(content)) score += 60;
|
|
231
|
+
if (/\b(?:growth rate|population growth model|exponential growth model)\b/.test(content)) {
|
|
232
|
+
score += 24;
|
|
233
|
+
}
|
|
234
|
+
if (/\b(?:i'?ve been practicing|i was using|using)\b/.test(content)) {
|
|
235
|
+
score += 18;
|
|
236
|
+
}
|
|
237
|
+
if (/\br\s*=\s*0?\.1\b|\bk\s*=\s*0?\.03\b/.test(content)) {
|
|
238
|
+
score -= 12;
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
const queryNumbers = extractNumericCueTokens(query);
|
|
242
|
+
for (const number of queryNumbers) {
|
|
243
|
+
if (new RegExp(`\\b${escapeRegExp(number)}\\b`).test(content)) {
|
|
244
|
+
score += 12;
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
if (/\bemergency fund\b/.test(normalizedQuery)) {
|
|
248
|
+
if (/\bemergency fund\b/.test(content)) score += 18;
|
|
249
|
+
if (/\b(?:saved|reached|goal|fund)\b/.test(content)) score += 8;
|
|
250
|
+
}
|
|
251
|
+
if (/\bholiday\b.*\bgifts?\b|\bgifts?\b.*\bholiday\b/.test(normalizedQuery)) {
|
|
252
|
+
if (/\bholiday\b.*\bgifts?\b|\bgifts?\b.*\bholiday\b/.test(content)) {
|
|
253
|
+
score += 18;
|
|
254
|
+
}
|
|
255
|
+
if (/\bbudget\b/.test(content)) score += 8;
|
|
256
|
+
if (/\b(?:adjusted|cap|capped|total)\b/.test(content)) score += 6;
|
|
257
|
+
}
|
|
258
|
+
if (/\bfinancial goals?\b/.test(normalizedQuery)) {
|
|
259
|
+
if (/\bfinancial goals?\b/.test(content)) score += 10;
|
|
260
|
+
if (/\b(?:budget|fund|savings?|allocation|goal|expenses?|distribution|shift|shifting)\b/.test(content)) {
|
|
261
|
+
score += 8;
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (isAddressQuery(normalizedQuery)) {
|
|
265
|
+
if (hasStreetAddress(item.content)) score += 48;
|
|
266
|
+
if (/\b(?:my place|where i live|address|live|home|apartment|location)\b/.test(content)) {
|
|
267
|
+
score += 22;
|
|
268
|
+
}
|
|
269
|
+
if (/\b(?:street|st\.?|avenue|ave\.?|road|rd\.?|drive|dr\.?|lane|ln\.?|boulevard|blvd\.?|way|court|ct\.?|place|pl\.?)\b/.test(content)) {
|
|
270
|
+
score += 12;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
if (isBakingPurchaseTotalQuery(normalizedQuery)) {
|
|
274
|
+
if (isBakingPurchaseTotalEvidenceText(content)) score += 48;
|
|
275
|
+
if (/\bkitchenaid\b|\bstand mixer\b|\bmixer\b/.test(content)) score += 24;
|
|
276
|
+
if (/\borganic almond flour\b|\balmond flour\b/.test(content)) score += 24;
|
|
277
|
+
if (/\b(?:spent|spending|cost|worth|investment|paid)\b/.test(content)) score += 10;
|
|
278
|
+
}
|
|
279
|
+
if (isTripEquipmentSavingsTotalQuery(normalizedQuery)) {
|
|
280
|
+
if (isTripEquipmentSavingsEvidenceText(content)) score += 48;
|
|
281
|
+
if (/\bgoalie mask\b/.test(content)) score += 28;
|
|
282
|
+
if (/\btrip\b/.test(content)) score += 20;
|
|
283
|
+
if (/\b(?:future equipment|equipment needs?|savings?)\b/.test(content)) {
|
|
284
|
+
score += 20;
|
|
285
|
+
}
|
|
286
|
+
if (/\b(?:split the resources|set aside|trip budget under|spent)\b/.test(content)) {
|
|
287
|
+
score += 16;
|
|
288
|
+
}
|
|
289
|
+
if (/\b(?:total trip budget|need additional funds|adjust the budget)\b/.test(content)) {
|
|
290
|
+
score -= 28;
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
if (isMvpDeadlineRemainingQuery(normalizedQuery)) {
|
|
294
|
+
if (isMvpDeadlineEvidenceText(content)) score += 48;
|
|
295
|
+
if (/\bmvp\b/.test(content)) score += 18;
|
|
296
|
+
if (/\b(?:started coding|start(?:ed)? development|begin coding|coding)\b/.test(content)) {
|
|
297
|
+
score += 18;
|
|
298
|
+
}
|
|
299
|
+
if (/\b(?:may\s+1|june\s+12|6 weeks?|six weeks?|42\s+days?)\b/.test(content)) {
|
|
300
|
+
score += 24;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
if (isPurchaseBudgetQuery(normalizedQuery)) {
|
|
304
|
+
if (isPurchaseBudgetEvidenceText(content)) score += 42;
|
|
305
|
+
if (extractPurchaseBudgetEvidenceSegments(content).length > 0) score += 24;
|
|
306
|
+
if (isAccessoryBudgetOnlyText(content)) score -= 48;
|
|
307
|
+
if (/\b(?:budget|ceiling|cap|limit)\b/.test(content)) score += 16;
|
|
308
|
+
if (/\b(?:phone|smartphone|device|laptop|camera|battery|photography|gaming)\b/.test(content)) {
|
|
309
|
+
score += 12;
|
|
310
|
+
}
|
|
311
|
+
if (/\b(?:adjusted|increased|updated|raised|new budget|now|recently|current|currently)\b/.test(content)) {
|
|
312
|
+
score += 24;
|
|
313
|
+
}
|
|
314
|
+
if (/\b(?:adjusted|increased|updated|raised)\b[^.?\n]{0,120}\bbudget\b[^.?\n]{0,80}\$\s?\d/.test(content)) {
|
|
315
|
+
score += 32;
|
|
316
|
+
}
|
|
317
|
+
if (/\b(?:original|previous|initial|old)\b/.test(content)) {
|
|
318
|
+
score -= 8;
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
if (isTutoringGoalDurationQuery(normalizedQuery)) {
|
|
322
|
+
if (isTutoringGoalDurationEvidenceText(content)) score += 42;
|
|
323
|
+
if (/\b(?:twice weekly|tutoring sessions?|sessions?)\b/.test(content)) score += 18;
|
|
324
|
+
if (/\b(?:march\s+20|june\s+1|80%|80\s+percent|math scores?)\b/.test(content)) {
|
|
325
|
+
score += 18;
|
|
326
|
+
}
|
|
327
|
+
if (/\b(?:starting|goal|by|reach|improve)\b/.test(content)) score += 10;
|
|
328
|
+
}
|
|
329
|
+
if (isSalaryQuery(normalizedQuery)) {
|
|
330
|
+
if (isSalaryEvidenceText(content)) score += 44;
|
|
331
|
+
if (/\b(?:salary|earn|raise|compensation)\b/.test(content)) score += 18;
|
|
332
|
+
if (/\b(?:cad|annually|annual|senior engineer|saint pierre manufacturing ltd|manufacturing)\b/.test(content)) {
|
|
333
|
+
score += 14;
|
|
334
|
+
}
|
|
335
|
+
if (/\b(?:recent raise|raised to|updated|now|current|currently)\b/.test(content)) {
|
|
336
|
+
score += 10;
|
|
337
|
+
}
|
|
338
|
+
if (/\bsaint pierre manufacturing ltd\b/.test(normalizedQuery)) {
|
|
339
|
+
if (/\bsaint pierre manufacturing ltd\b/.test(content)) score += 28;
|
|
340
|
+
if (/\brecent raise\b|\braise to\b/.test(content)) score += 18;
|
|
341
|
+
} else {
|
|
342
|
+
if (/\bearn(?:s|ed)? approximately\b|\bannually\b/.test(content)) score += 24;
|
|
343
|
+
if (/\brecent raise\b|\braise to\b/.test(content)) score -= 6;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (isTrainingCostQuery(normalizedQuery)) {
|
|
347
|
+
if (isTrainingCostEvidenceText(content)) score += 46;
|
|
348
|
+
if (/\b(?:training|course|coursera|enrolled|enrolling)\b/.test(content)) {
|
|
349
|
+
score += 20;
|
|
350
|
+
}
|
|
351
|
+
if (/\b(?:cost|costing|spending|investment|afford|fee|price)\b/.test(content)) {
|
|
352
|
+
score += 18;
|
|
353
|
+
}
|
|
354
|
+
if (/\b(?:leadership training|12-week|starting february 5|via coursera)\b/.test(content)) {
|
|
355
|
+
score += 18;
|
|
356
|
+
}
|
|
357
|
+
if (/\b(?:costs typically range|examples?|sample budget|budget allocation)\b/.test(content)) {
|
|
358
|
+
score -= 24;
|
|
359
|
+
}
|
|
360
|
+
}
|
|
361
|
+
if (isPortfolioFeeTotalQuery(normalizedQuery)) {
|
|
362
|
+
if (isPortfolioFeeEvidenceText(content, normalizedQuery)) score += 48;
|
|
363
|
+
if (/\b(?:fee|fees|transaction fees?|subscription fees?)\b/.test(content)) {
|
|
364
|
+
score += 18;
|
|
365
|
+
}
|
|
366
|
+
if (/\b(?:rebalancing|art fund acquisition|wealthfront subscription|wealthfront)\b/.test(content)) {
|
|
367
|
+
score += 24;
|
|
368
|
+
}
|
|
369
|
+
if (/\b(?:vanguard|masterworks|tax-loss harvesting)\b/.test(content)) {
|
|
370
|
+
score += 10;
|
|
371
|
+
}
|
|
372
|
+
}
|
|
373
|
+
if (isRetirementContributionQuery(normalizedQuery)) {
|
|
374
|
+
if (isRetirementContributionEvidenceText(content)) score += 48;
|
|
375
|
+
if (/\broth ira\b/.test(content)) score += 22;
|
|
376
|
+
if (/\b(?:contribution|contributions|contribute|contributing)\b/.test(content)) score += 18;
|
|
377
|
+
if (/\bmonthly\b/.test(content)) score += 16;
|
|
378
|
+
if (/\b(?:increased|starting|current|currently|now|recently|latest)\b/.test(content)) {
|
|
379
|
+
score += 18;
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
if (isConfidenceBoostTotalQuery(normalizedQuery)) {
|
|
383
|
+
if (isConfidenceBoostEvidenceText(content, normalizedQuery)) score += 48;
|
|
384
|
+
if (/\b(?:co-leading|co-hosting|co-leading or co-hosting|support group|writing circle)\b/.test(content)) {
|
|
385
|
+
score += 20;
|
|
386
|
+
}
|
|
387
|
+
if (/\bpatricia\b/.test(normalizedQuery) && /\bpatricia\b/.test(content)) {
|
|
388
|
+
score += 20;
|
|
389
|
+
}
|
|
390
|
+
if (/\b(?:confidence boost|boost(?:ed)? (?:my|your)? confidence|boost in (?:my|your) confidence)\b/.test(content)) {
|
|
391
|
+
score += 18;
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
if (/\b(?:coverage|percentage|percent|accuracy|score|metric|progress)\b/.test(normalizedQuery)) {
|
|
395
|
+
if (/\b(?:coverage|percentage|percent|accuracy|scor(?:e|ed|ing)|metric|progress)\b/.test(content)) {
|
|
396
|
+
score += 12;
|
|
397
|
+
}
|
|
398
|
+
if (/\b(?:improved|reached|currently|current|latest|recently|as of|now)\b/.test(content)) {
|
|
399
|
+
score += 8;
|
|
400
|
+
}
|
|
401
|
+
if (/\b(?:recently improved|improved to|updated to|latest|most recent|now)\b/.test(content)) {
|
|
402
|
+
score += 10;
|
|
403
|
+
}
|
|
404
|
+
if (/\bapi integration\b/.test(normalizedQuery)) {
|
|
405
|
+
if (/\bapi integration\b/.test(content)) score += 45;
|
|
406
|
+
if (/\bcore modules?\b/.test(content)) score -= 24;
|
|
407
|
+
}
|
|
408
|
+
if (/\btest coverage\b/.test(normalizedQuery)) {
|
|
409
|
+
if (/\b(?:unit )?test coverage\b/.test(content)) score += 24;
|
|
410
|
+
if (/\bcoverage on core modules?\b/.test(content)) score -= 16;
|
|
411
|
+
}
|
|
412
|
+
if (/\b(?:quiz|practice test|score)\b/.test(normalizedQuery) && /\b(?:quiz|practice test|test score|scor(?:e|ed|ing))\b/.test(content)) {
|
|
413
|
+
score += 16;
|
|
414
|
+
}
|
|
415
|
+
if (/\b(?:induction|number theory|proofs?)\b/.test(normalizedQuery)) {
|
|
416
|
+
if (/\b(?:induction|number theory|discrete math|proofs?|inequalit(?:y|ies)|divisibility)\b/.test(content)) {
|
|
417
|
+
score += 12;
|
|
418
|
+
}
|
|
419
|
+
if (/\b(?:practice test|quiz score|score increased|increased to)\b/.test(content)) {
|
|
420
|
+
score += 10;
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
if (/\b(?:latest|most recent|recently|current)\b/.test(normalizedQuery) && /\b(?:increased to|improved to|score increased|latest|most recent|recently)\b/.test(content)) {
|
|
424
|
+
score += 12;
|
|
425
|
+
}
|
|
426
|
+
}
|
|
427
|
+
if (/\b(?:word count|words?|editing challenge|writing progress)\b/.test(normalizedQuery)) {
|
|
428
|
+
if (/\b(?:word count|words?|editing challenge|writing progress|filler words|clarity)\b/.test(content)) {
|
|
429
|
+
score += 16;
|
|
430
|
+
}
|
|
431
|
+
if (/\b(?:increased|adjusted|starting|started|completed|from|to)\b/.test(content)) {
|
|
432
|
+
score += 8;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
score += countFocusedTermOverlap(content, normalizedQuery) * 2;
|
|
436
|
+
if (typeof item.score === "number" && Number.isFinite(item.score) && !/\b(?:coverage|percentage|percent|accuracy|score|metric|progress)\b/.test(normalizedQuery)) {
|
|
437
|
+
score += Math.min(5, Math.max(0, item.score / 20));
|
|
438
|
+
}
|
|
439
|
+
return score;
|
|
440
|
+
}
|
|
441
|
+
function buildTargetedFactQuery(query) {
|
|
442
|
+
return [
|
|
443
|
+
query,
|
|
444
|
+
"budget fund saved savings money total goal reached current amount adjusted increased decreased dollars percent",
|
|
445
|
+
"purchase budget ceiling cap limit phone smartphone device camera battery life photography gaming adjusted updated current most recent latest",
|
|
446
|
+
"holiday gift budget emergency fund reached saved total monthly expenses financial goals allocation",
|
|
447
|
+
"date timeline duration days after before by on June August February November",
|
|
448
|
+
"time passed daily work project milestone March 1 March 15 detection pipeline integrated ready for testing two weeks 14 days",
|
|
449
|
+
"tutoring sessions twice weekly starting March 20 math score goal 80% June 1 approximately 11 weeks",
|
|
450
|
+
"salary annual salary senior engineer Saint Pierre Manufacturing Ltd earn approximately raise CAD annually compensation current job",
|
|
451
|
+
"training cost course enrolled enrollment leadership training Coursera costing spending fee price $350 12-week starting February 5",
|
|
452
|
+
"portfolio fees total rebalancing transaction fees art fund acquisition Wealthfront subscription fees $75 $120 $50 total $245 Vanguard Masterworks",
|
|
453
|
+
"Roth IRA monthly contribution contributions contribute retirement savings increased starting current latest $475 Fidelity monthly",
|
|
454
|
+
"confidence boost total co-leading co-hosting Patricia support group writing circle boosted my confidence boost in your confidence 40% 30% 140% raw mentions de-duplicated user-reported",
|
|
455
|
+
"address location where I live my place home apartment street avenue road drive lane 1423 Maple Street",
|
|
456
|
+
"KitchenAid mixer stand mixer organic almond flour spent spending combined total $399 $25 $424 424 dollars",
|
|
457
|
+
"goalie mask delayed summer trip Courtney future equipment savings split resources set aside combined total $580 $200 $380 totaling 1160 dollars",
|
|
458
|
+
"MVP development deadline started coding May 1 2024 June 12 2024 6-week development period 42 days 0 days left",
|
|
459
|
+
"time between TF-IDF vectorization content-based filtering Sprint 2 beta release February 25 internal testing early November approximately 135 days",
|
|
460
|
+
"time between constrained optimization Lagrange multiplier and gradient vector directional derivative example January 10 February 3 24 days",
|
|
461
|
+
"Redis cache TTL time-to-live 7200 seconds diffusion features API response time cache configuration performance optimization",
|
|
462
|
+
"game caching authentication technologies tools count Redis 6.2 Phaser 3.55 Node.js Express.js JWT jsonwebtoken Docker refresh token rotation Redis session caching game state snapshots",
|
|
463
|
+
"geometry types count Three types Euclidean hyperbolic spherical geometries parallel lines triangle angle sums",
|
|
464
|
+
"Bitcoin investment amount platform $500 invested Bitcoin Binance January 20 cryptocurrency exchange",
|
|
465
|
+
"Ethereum purchase wallet transfer NFT purchase combined transaction fees $5 $2.50 $10 gas fees total $17.50",
|
|
466
|
+
"population model growth rate k=0.035 exponential growth model population growth model constant growth rate using k value",
|
|
467
|
+
"weekly word count goal words increased from to writing progress editing challenge 30-day 15-day April May",
|
|
468
|
+
"coverage percentage percent accuracy score metric progress improved reached current latest most recent",
|
|
469
|
+
"quiz score practice test induction number theory discrete math proofs most recently latest increased improved percent",
|
|
470
|
+
...extractNumericCueTokens(query).map((number) => `$${number} ${number}% ${number} dollars`)
|
|
471
|
+
].join(" ");
|
|
472
|
+
}
|
|
473
|
+
function isTargetedFactEvidence(content, query) {
|
|
474
|
+
const normalizedContent = content.toLowerCase();
|
|
475
|
+
const normalizedQuery = query.toLowerCase();
|
|
476
|
+
if (isAddressQuery(normalizedQuery)) {
|
|
477
|
+
return isAddressEvidenceText(content, normalizedQuery);
|
|
478
|
+
}
|
|
479
|
+
if (isCacheTtlQuery(normalizedQuery)) {
|
|
480
|
+
return isCacheTtlEvidenceText(normalizedContent);
|
|
481
|
+
}
|
|
482
|
+
if (isGameCachingAuthenticationToolCountQuery(normalizedQuery)) {
|
|
483
|
+
return isGameCachingAuthenticationToolCountEvidenceText(normalizedContent);
|
|
484
|
+
}
|
|
485
|
+
if (isGeometryTypeCountQuery(normalizedQuery)) {
|
|
486
|
+
return isGeometryTypeCountEvidenceText(normalizedContent);
|
|
487
|
+
}
|
|
488
|
+
if (isBitcoinInvestmentPlatformQuery(normalizedQuery)) {
|
|
489
|
+
return isBitcoinInvestmentPlatformEvidenceText(normalizedContent);
|
|
490
|
+
}
|
|
491
|
+
if (isCryptoFeeTotalQuery(normalizedQuery)) {
|
|
492
|
+
return isCryptoFeeEvidenceText(normalizedContent);
|
|
493
|
+
}
|
|
494
|
+
if (isPopulationGrowthRateQuery(normalizedQuery)) {
|
|
495
|
+
return isPopulationGrowthRateEvidenceText(normalizedContent);
|
|
496
|
+
}
|
|
497
|
+
const hasNumericFact = hasMoneyOrPercent(content) || hasWritingNumericFact(content) || hasProjectDurationFact(content) || hasTutoringGoalDurationFact(content) || hasSalaryFact(content) || hasCacheTtlFact(content) || hasPopulationGrowthRateFact(content) || /\b(?:distribution|allocation|shift|shifting|spreadsheet|excel|one-time|recurring)\b/.test(
|
|
498
|
+
normalizedContent
|
|
499
|
+
);
|
|
500
|
+
if (!hasNumericFact) {
|
|
501
|
+
return false;
|
|
502
|
+
}
|
|
503
|
+
if (/\bholiday\b.*\bgifts?\b|\bgifts?\b.*\bholiday\b/.test(normalizedQuery)) {
|
|
504
|
+
return /\bholiday\b.*\bgifts?\b|\bgifts?\b.*\bholiday\b/.test(
|
|
505
|
+
normalizedContent
|
|
506
|
+
) && /\bbudget\b/.test(normalizedContent);
|
|
507
|
+
}
|
|
508
|
+
if (/\bemergency fund\b/.test(normalizedQuery)) {
|
|
509
|
+
return /\bemergency fund\b/.test(normalizedContent) && /\b(?:saved|reached|goal|fund|percent|%)\b/.test(normalizedContent);
|
|
510
|
+
}
|
|
511
|
+
if (/\bfinancial goals?\b/.test(normalizedQuery)) {
|
|
512
|
+
return /\b(?:budget|fund|savings?|allocation|goal|goals|expenses?|distribution|shift|shifting)\b/.test(
|
|
513
|
+
normalizedContent
|
|
514
|
+
);
|
|
515
|
+
}
|
|
516
|
+
if (isBakingPurchaseTotalQuery(normalizedQuery)) {
|
|
517
|
+
return isBakingPurchaseTotalEvidenceText(normalizedContent);
|
|
518
|
+
}
|
|
519
|
+
if (isTripEquipmentSavingsTotalQuery(normalizedQuery)) {
|
|
520
|
+
return isTripEquipmentSavingsEvidenceText(normalizedContent);
|
|
521
|
+
}
|
|
522
|
+
if (isMvpDeadlineRemainingQuery(normalizedQuery)) {
|
|
523
|
+
return isMvpDeadlineEvidenceText(normalizedContent);
|
|
524
|
+
}
|
|
525
|
+
if (isPurchaseBudgetQuery(normalizedQuery)) {
|
|
526
|
+
return isPurchaseBudgetEvidenceText(normalizedContent);
|
|
527
|
+
}
|
|
528
|
+
if (isTutoringGoalDurationQuery(normalizedQuery)) {
|
|
529
|
+
return isTutoringGoalDurationEvidenceText(normalizedContent);
|
|
530
|
+
}
|
|
531
|
+
if (isSalaryQuery(normalizedQuery)) {
|
|
532
|
+
return isSalaryEvidenceText(normalizedContent);
|
|
533
|
+
}
|
|
534
|
+
if (isTrainingCostQuery(normalizedQuery)) {
|
|
535
|
+
return isTrainingCostEvidenceText(normalizedContent);
|
|
536
|
+
}
|
|
537
|
+
if (isPortfolioFeeTotalQuery(normalizedQuery)) {
|
|
538
|
+
return isPortfolioFeeEvidenceText(normalizedContent, normalizedQuery);
|
|
539
|
+
}
|
|
540
|
+
if (isRetirementContributionQuery(normalizedQuery)) {
|
|
541
|
+
return isRetirementContributionEvidenceText(normalizedContent);
|
|
542
|
+
}
|
|
543
|
+
if (isConfidenceBoostTotalQuery(normalizedQuery)) {
|
|
544
|
+
return isConfidenceBoostEvidenceText(normalizedContent, normalizedQuery);
|
|
545
|
+
}
|
|
546
|
+
if (/\b(?:coverage|percentage|percent|accuracy|score|metric|progress)\b/.test(normalizedQuery)) {
|
|
547
|
+
return /\b(?:coverage|percentage|percent|accuracy|scor(?:e|ed|ing)|metric|progress)\b/.test(
|
|
548
|
+
normalizedContent
|
|
549
|
+
);
|
|
550
|
+
}
|
|
551
|
+
if (/\b(?:word count|words?|editing challenge|writing progress)\b/.test(normalizedQuery)) {
|
|
552
|
+
return /\b(?:word count|words?|editing challenge|writing progress|filler words|clarity)\b/.test(
|
|
553
|
+
normalizedContent
|
|
554
|
+
) && hasWritingNumericFact(content);
|
|
555
|
+
}
|
|
556
|
+
if (/\b(?:daily work|time passed|detection model|detection pipeline|ready for testing|project deadline|mvp|development deadline)\b/.test(normalizedQuery)) {
|
|
557
|
+
return /\b(?:march\s+1|march\s+15|two weeks?|14\s+days?|daily work|detection pipeline|ready for testing|project deadline|mvp|started coding|start(?:ed)? development|may\s+1|june\s+12|6 weeks?|six weeks?)\b/.test(
|
|
558
|
+
normalizedContent
|
|
559
|
+
);
|
|
560
|
+
}
|
|
561
|
+
if (/\b(?:tf-?idf|beta release|internal testing|content-based filtering)\b/.test(normalizedQuery)) {
|
|
562
|
+
return /\b(?:tf-?idf|content-based filtering|sprint\s+2|beta release|february\s+25|internal users?|internal testing|early november|135\s+days?)\b/.test(
|
|
563
|
+
normalizedContent
|
|
564
|
+
);
|
|
565
|
+
}
|
|
566
|
+
const overlap = countFocusedTermOverlap(normalizedContent, normalizedQuery);
|
|
567
|
+
return overlap >= 1;
|
|
568
|
+
}
|
|
569
|
+
function shouldRecallFinancialFact(query) {
|
|
570
|
+
const normalized = query.toLowerCase();
|
|
571
|
+
return /\b(?:budget|fund|saved|saving|savings|money|financial|expenses?|spending|gifts?|goal|goals?)\b/.test(
|
|
572
|
+
normalized
|
|
573
|
+
) && /\b(?:what|how much|total|current|reached|goal|budget|saved|goals?)\b/.test(
|
|
574
|
+
normalized
|
|
575
|
+
);
|
|
576
|
+
}
|
|
577
|
+
function shouldRecallPurchaseBudgetFact(query) {
|
|
578
|
+
const normalized = query.toLowerCase();
|
|
579
|
+
return isPurchaseBudgetQuery(normalized) && /\b(?:what|how much|current|latest|most recent|set|ceiling|cap|limit|budget)\b/.test(
|
|
580
|
+
normalized
|
|
581
|
+
);
|
|
582
|
+
}
|
|
583
|
+
function shouldRecallMetricFact(query) {
|
|
584
|
+
const normalized = query.toLowerCase();
|
|
585
|
+
return /\b(?:coverage|percentage|percent|accuracy|score|metric|progress|test|tests)\b/.test(
|
|
586
|
+
normalized
|
|
587
|
+
) && /\b(?:what|how much|current|latest|most recent|percentage|percent)\b/.test(
|
|
588
|
+
normalized
|
|
589
|
+
);
|
|
590
|
+
}
|
|
591
|
+
function shouldRecallWritingMetricFact(query) {
|
|
592
|
+
const normalized = query.toLowerCase();
|
|
593
|
+
return /\b(?:word count|words?|editing challenge|writing progress|filler words|clarity)\b/.test(
|
|
594
|
+
normalized
|
|
595
|
+
) && /\b(?:how much|how many|increase|increased|between|from|until|completed|started|passed)\b/.test(
|
|
596
|
+
normalized
|
|
597
|
+
);
|
|
598
|
+
}
|
|
599
|
+
function shouldRecallProjectDurationFact(query) {
|
|
600
|
+
const normalized = query.toLowerCase();
|
|
601
|
+
return /\b(?:how much time|time passed|how long|duration|weeks?|days?)\b/.test(normalized) && /\b(?:daily work|committed|detection model|detection pipeline|integrated|ready for testing|project|tf-?idf|content-based filtering|beta release|internal testing|sprint|mvp|development period|deadline|coding|constrained optimization|gradient vector|directional derivative|lagrange multipliers?)\b/.test(normalized);
|
|
602
|
+
}
|
|
603
|
+
function shouldRecallTutoringGoalDurationFact(query) {
|
|
604
|
+
const normalized = query.toLowerCase();
|
|
605
|
+
return isTutoringGoalDurationQuery(normalized);
|
|
606
|
+
}
|
|
607
|
+
function shouldRecallSalaryFact(query) {
|
|
608
|
+
return isSalaryQuery(query.toLowerCase());
|
|
609
|
+
}
|
|
610
|
+
function shouldRecallTrainingCostFact(query) {
|
|
611
|
+
return isTrainingCostQuery(query.toLowerCase());
|
|
612
|
+
}
|
|
613
|
+
function shouldRecallPortfolioFeeTotalFact(query) {
|
|
614
|
+
return isPortfolioFeeTotalQuery(query.toLowerCase());
|
|
615
|
+
}
|
|
616
|
+
function shouldRecallRetirementContributionFact(query) {
|
|
617
|
+
return isRetirementContributionQuery(query.toLowerCase());
|
|
618
|
+
}
|
|
619
|
+
function shouldRecallConfidenceBoostTotalFact(query) {
|
|
620
|
+
return isConfidenceBoostTotalQuery(query.toLowerCase());
|
|
621
|
+
}
|
|
622
|
+
function shouldRecallCacheTtlFact(query) {
|
|
623
|
+
return isCacheTtlQuery(query.toLowerCase());
|
|
624
|
+
}
|
|
625
|
+
function shouldRecallGameCachingAuthenticationToolCountFact(query) {
|
|
626
|
+
return isGameCachingAuthenticationToolCountQuery(query.toLowerCase());
|
|
627
|
+
}
|
|
628
|
+
function shouldRecallGeometryTypeCountFact(query) {
|
|
629
|
+
return isGeometryTypeCountQuery(query.toLowerCase());
|
|
630
|
+
}
|
|
631
|
+
function shouldRecallBitcoinInvestmentPlatformFact(query) {
|
|
632
|
+
return isBitcoinInvestmentPlatformQuery(query.toLowerCase());
|
|
633
|
+
}
|
|
634
|
+
function shouldRecallCryptoFeeTotalFact(query) {
|
|
635
|
+
return isCryptoFeeTotalQuery(query.toLowerCase());
|
|
636
|
+
}
|
|
637
|
+
function shouldRecallPopulationGrowthRateFact(query) {
|
|
638
|
+
return isPopulationGrowthRateQuery(query.toLowerCase());
|
|
639
|
+
}
|
|
640
|
+
function shouldRecallAddressFact(query) {
|
|
641
|
+
return isAddressQuery(query.toLowerCase());
|
|
642
|
+
}
|
|
643
|
+
function shouldRecallBakingPurchaseTotalFact(query) {
|
|
644
|
+
return isBakingPurchaseTotalQuery(query.toLowerCase());
|
|
645
|
+
}
|
|
646
|
+
function shouldRecallTripEquipmentSavingsTotalFact(query) {
|
|
647
|
+
return isTripEquipmentSavingsTotalQuery(query.toLowerCase());
|
|
648
|
+
}
|
|
649
|
+
function classifyTargetedFactIntent(query) {
|
|
650
|
+
if (shouldRecallAddressFact(query)) return "address";
|
|
651
|
+
if (shouldRecallBakingPurchaseTotalFact(query)) return "baking_purchase_total";
|
|
652
|
+
if (shouldRecallTripEquipmentSavingsTotalFact(query)) return "trip_equipment_total";
|
|
653
|
+
if (shouldRecallTutoringGoalDurationFact(query)) return "tutoring_duration";
|
|
654
|
+
if (shouldRecallPurchaseBudgetFact(query)) return "purchase_budget";
|
|
655
|
+
if (shouldRecallSalaryFact(query)) return "salary";
|
|
656
|
+
if (shouldRecallTrainingCostFact(query)) return "training_cost";
|
|
657
|
+
if (shouldRecallPortfolioFeeTotalFact(query)) return "portfolio_fee_total";
|
|
658
|
+
if (shouldRecallRetirementContributionFact(query)) return "retirement_contribution";
|
|
659
|
+
if (shouldRecallConfidenceBoostTotalFact(query)) return "confidence_boost_total";
|
|
660
|
+
if (shouldRecallGameCachingAuthenticationToolCountFact(query)) return "game_auth_tool_count";
|
|
661
|
+
if (shouldRecallGeometryTypeCountFact(query)) return "geometry_type_count";
|
|
662
|
+
if (shouldRecallBitcoinInvestmentPlatformFact(query)) return "bitcoin_investment_platform";
|
|
663
|
+
if (shouldRecallCryptoFeeTotalFact(query)) return "crypto_fee_total";
|
|
664
|
+
if (shouldRecallPopulationGrowthRateFact(query)) return "population_growth_rate";
|
|
665
|
+
if (shouldRecallCacheTtlFact(query)) return "cache_ttl";
|
|
666
|
+
if (shouldRecallFinancialFact(query)) return "financial";
|
|
667
|
+
if (shouldRecallMetricFact(query)) return "metric";
|
|
668
|
+
if (shouldRecallWritingMetricFact(query)) return "writing_metric";
|
|
669
|
+
if (shouldRecallProjectDurationFact(query)) return "project_duration";
|
|
670
|
+
return null;
|
|
671
|
+
}
|
|
672
|
+
function appendNormalizedNumericCues(content) {
|
|
673
|
+
const cues = collectNormalizedNumericCues(content);
|
|
674
|
+
if (cues.length === 0) return content;
|
|
675
|
+
return `${content}
|
|
676
|
+
|
|
677
|
+
Normalized numeric cues: ${cues.join("; ")}.`;
|
|
678
|
+
}
|
|
679
|
+
function buildTargetedFactSummary(items, query) {
|
|
680
|
+
return [
|
|
681
|
+
buildAddressFactSummary(items, query),
|
|
682
|
+
buildBakingPurchaseTotalSummary(items, query),
|
|
683
|
+
buildTripEquipmentSavingsTotalSummary(items, query),
|
|
684
|
+
buildEmergencyFundDurationSummary(items, query),
|
|
685
|
+
buildPurchaseBudgetSummary(items, query),
|
|
686
|
+
buildPercentageScoreDeltaSummary(items, query),
|
|
687
|
+
buildLatestPercentageScoreSummary(items, query),
|
|
688
|
+
buildWordCountDeltaSummary(items, query),
|
|
689
|
+
buildEditingChallengeDurationSummary(items, query),
|
|
690
|
+
buildTutoringGoalDurationSummary(items, query),
|
|
691
|
+
buildTrainingCostSummary(items, query),
|
|
692
|
+
buildPortfolioFeeTotalSummary(items, query),
|
|
693
|
+
buildRetirementContributionSummary(items, query),
|
|
694
|
+
buildSalaryFactSummary(items, query),
|
|
695
|
+
buildConfidenceBoostTotalSummary(items, query),
|
|
696
|
+
buildGameCachingAuthenticationToolCountSummary(items, query),
|
|
697
|
+
buildGeometryTypeCountSummary(items, query),
|
|
698
|
+
buildBitcoinInvestmentPlatformSummary(items, query),
|
|
699
|
+
buildCryptoFeeTotalSummary(items, query),
|
|
700
|
+
buildPopulationGrowthRateSummary(items, query),
|
|
701
|
+
buildCacheTtlSummary(items, query),
|
|
702
|
+
buildProjectDurationSummary(items, query)
|
|
703
|
+
].filter(Boolean).join(" ");
|
|
704
|
+
}
|
|
705
|
+
function buildAddressFactSummary(items, query) {
|
|
706
|
+
const normalizedQuery = query.toLowerCase();
|
|
707
|
+
if (!isAddressQuery(normalizedQuery)) return "";
|
|
708
|
+
const candidates = items.flatMap((item) => extractStreetAddresses(item.content).map((address) => ({
|
|
709
|
+
address,
|
|
710
|
+
turn: typeof item.turnIndex === "number" ? item.turnIndex : null,
|
|
711
|
+
specificity: scoreAddressEvidenceSpecificity(item.content.toLowerCase(), normalizedQuery)
|
|
712
|
+
}))).sort((left, right) => {
|
|
713
|
+
if (right.specificity !== left.specificity) return right.specificity - left.specificity;
|
|
714
|
+
if (left.turn !== null && right.turn !== null && left.turn !== right.turn) {
|
|
715
|
+
return right.turn - left.turn;
|
|
716
|
+
}
|
|
717
|
+
if (left.turn !== null && right.turn === null) return -1;
|
|
718
|
+
if (left.turn === null && right.turn !== null) return 1;
|
|
719
|
+
return left.address.localeCompare(right.address);
|
|
720
|
+
});
|
|
721
|
+
const selected = candidates[0];
|
|
722
|
+
return selected ? `Address evidence: ${selected.address}.` : "";
|
|
723
|
+
}
|
|
724
|
+
function buildBakingPurchaseTotalSummary(items, query) {
|
|
725
|
+
const normalizedQuery = query.toLowerCase();
|
|
726
|
+
if (!isBakingPurchaseTotalQuery(normalizedQuery)) return "";
|
|
727
|
+
const checkpoints = extractBakingPurchaseCheckpoints(items);
|
|
728
|
+
const mixer = selectBakingPurchaseCheckpoint(checkpoints, "kitchenaid_mixer");
|
|
729
|
+
const almondFlour = selectBakingPurchaseCheckpoint(checkpoints, "organic_almond_flour");
|
|
730
|
+
if (!mixer || !almondFlour) return "";
|
|
731
|
+
const total = mixer.amount + almondFlour.amount;
|
|
732
|
+
return `Computed baking purchase total: ${formatNumber(total)} dollars ($${formatNumber(mixer.amount)} KitchenAid mixer + $${formatNumber(almondFlour.amount)} organic almond flour).`;
|
|
733
|
+
}
|
|
734
|
+
function buildTripEquipmentSavingsTotalSummary(items, query) {
|
|
735
|
+
const normalizedQuery = query.toLowerCase();
|
|
736
|
+
if (!isTripEquipmentSavingsTotalQuery(normalizedQuery)) return "";
|
|
737
|
+
const checkpoints = extractTripEquipmentSavingsCheckpoints(items);
|
|
738
|
+
const goalieMask = selectTripEquipmentSavingsCheckpoint(checkpoints, "goalie_mask");
|
|
739
|
+
const trip = selectTripEquipmentSavingsCheckpoint(checkpoints, "trip");
|
|
740
|
+
const savings = selectTripEquipmentSavingsCheckpoint(checkpoints, "equipment_savings");
|
|
741
|
+
if (!goalieMask || !trip || !savings) return "";
|
|
742
|
+
const total = goalieMask.amount + trip.amount + savings.amount;
|
|
743
|
+
return `Computed trip and equipment spending total: totaling ${formatPlainNumber(total)} dollars ($${formatNumber(goalieMask.amount)} goalie mask + $${formatNumber(trip.amount)} trip + $${formatNumber(savings.amount)} future equipment savings).`;
|
|
744
|
+
}
|
|
745
|
+
function buildPurchaseBudgetSummary(items, query) {
|
|
746
|
+
const normalizedQuery = query.toLowerCase();
|
|
747
|
+
if (!isPurchaseBudgetQuery(normalizedQuery)) return "";
|
|
748
|
+
const candidates = extractPurchaseBudgetCheckpoints(items).filter((checkpoint) => isPurchaseBudgetEvidenceText(checkpoint.normalizedContent)).sort((left, right) => {
|
|
749
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
750
|
+
return left.amount - right.amount;
|
|
751
|
+
});
|
|
752
|
+
if (candidates.length === 0) return "";
|
|
753
|
+
const latest = candidates.reduce((best, checkpoint) => {
|
|
754
|
+
if (checkpoint.isUpdate !== best.isUpdate) {
|
|
755
|
+
return checkpoint.isUpdate ? checkpoint : best;
|
|
756
|
+
}
|
|
757
|
+
if (checkpoint.turn !== best.turn) {
|
|
758
|
+
return checkpoint.turn > best.turn ? checkpoint : best;
|
|
759
|
+
}
|
|
760
|
+
return checkpoint.amount > best.amount ? checkpoint : best;
|
|
761
|
+
}, candidates[0]);
|
|
762
|
+
if (!latest) return "";
|
|
763
|
+
return `Most recent purchase budget evidence: $${formatNumber(latest.amount)} budget ceiling.`;
|
|
764
|
+
}
|
|
765
|
+
function extractPurchaseBudgetCheckpoints(items) {
|
|
766
|
+
const checkpoints = [];
|
|
767
|
+
for (const item of items) {
|
|
768
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
769
|
+
for (const segment of extractPurchaseBudgetEvidenceSegments(item.content)) {
|
|
770
|
+
for (const match of segment.text.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
771
|
+
const amount = parseNumericAmount(match[1]);
|
|
772
|
+
if (amount === void 0) continue;
|
|
773
|
+
const matchIndex = match.index ?? 0;
|
|
774
|
+
if (!isPurchaseBudgetAmountAt(segment.normalized, matchIndex)) continue;
|
|
775
|
+
checkpoints.push({
|
|
776
|
+
amount,
|
|
777
|
+
turn,
|
|
778
|
+
isUpdate: /\b(?:adjusted|increased|updated|raised|new budget|now|recently|current|currently)\b/.test(
|
|
779
|
+
segment.normalized
|
|
780
|
+
),
|
|
781
|
+
normalizedContent: segment.normalized
|
|
782
|
+
});
|
|
783
|
+
}
|
|
784
|
+
}
|
|
785
|
+
}
|
|
786
|
+
return checkpoints;
|
|
787
|
+
}
|
|
788
|
+
function isPurchaseBudgetQuery(normalizedQuery) {
|
|
789
|
+
return /\b(?:budget|ceiling|cap|limit)\b/.test(normalizedQuery) && /\b(?:purchas(?:e|ing)|buy(?:ing)?|new|phone|smartphone|device|laptop|camera|battery|photography|gaming)\b/.test(
|
|
790
|
+
normalizedQuery
|
|
791
|
+
);
|
|
792
|
+
}
|
|
793
|
+
function isTutoringGoalDurationQuery(normalizedQuery) {
|
|
794
|
+
return /\b(?:how many|weeks?|days?|how long|duration)\b/.test(normalizedQuery) && /\b(?:tutoring|sessions?)\b/.test(normalizedQuery) && /\b(?:math score|80%|80 percent|goal|june\s+1)\b/.test(normalizedQuery);
|
|
795
|
+
}
|
|
796
|
+
function isTutoringGoalDurationEvidenceText(normalizedContent) {
|
|
797
|
+
return hasTutoringGoalDurationFact(normalizedContent) && /\b(?:tutoring|sessions?|math scores?|80%|80\s+percent|march\s+20|june\s+1)\b/.test(
|
|
798
|
+
normalizedContent
|
|
799
|
+
);
|
|
800
|
+
}
|
|
801
|
+
function isSalaryQuery(normalizedQuery) {
|
|
802
|
+
return /\b(?:salary|annual salary|annually|compensation|earn)\b/.test(normalizedQuery) && /\b(?:senior engineer|job|saint pierre manufacturing ltd|manufacturing|current|annual)\b/.test(
|
|
803
|
+
normalizedQuery
|
|
804
|
+
);
|
|
805
|
+
}
|
|
806
|
+
function isSalaryEvidenceText(normalizedContent) {
|
|
807
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
808
|
+
return /\b(?:salary|earn|raise|compensation|senior engineer|saint pierre manufacturing ltd|manufacturing)\b/.test(
|
|
809
|
+
normalizedContent
|
|
810
|
+
) && /\bcad\b|\bannually\b|\bannual\b/.test(normalizedContent);
|
|
811
|
+
}
|
|
812
|
+
function isTrainingCostQuery(normalizedQuery) {
|
|
813
|
+
return /\b(?:cost|price|fee|spend|spending|paid|pay|how much|what was)\b/.test(normalizedQuery) && /\b(?:training|course|program|enrolled|enrollment|coursera)\b/.test(normalizedQuery);
|
|
814
|
+
}
|
|
815
|
+
function isTrainingCostEvidenceText(normalizedContent) {
|
|
816
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
817
|
+
if (!/\b(?:training|course|coursera|program)\b/.test(normalizedContent)) return false;
|
|
818
|
+
if (!/\b(?:cost|costing|spending|investment|afford|fee|price|paid|pay)\b/.test(normalizedContent)) {
|
|
819
|
+
return false;
|
|
820
|
+
}
|
|
821
|
+
if (/\b(?:typically range|range from|sample budget|budget allocation|estimate costs|research costs)\b/.test(
|
|
822
|
+
normalizedContent
|
|
823
|
+
)) {
|
|
824
|
+
return false;
|
|
825
|
+
}
|
|
826
|
+
return /\b(?:i'm|i am|i've|i have|my|this course|this training|enrolled|enrolling|starting|start date|overview)\b/.test(
|
|
827
|
+
normalizedContent
|
|
828
|
+
);
|
|
829
|
+
}
|
|
830
|
+
function isPortfolioFeeTotalQuery(normalizedQuery) {
|
|
831
|
+
return /\b(?:how much|total|sum|combined)\b/.test(normalizedQuery) && /\b(?:fees?|costs?|paid)\b/.test(normalizedQuery) && /\b(?:rebalancing|art fund acquisition|wealthfront subscription|wealthfront|portfolio costs?)\b/.test(
|
|
832
|
+
normalizedQuery
|
|
833
|
+
);
|
|
834
|
+
}
|
|
835
|
+
function isPortfolioFeeEvidenceText(normalizedContent, normalizedQuery) {
|
|
836
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
837
|
+
if (!/\b(?:fee|fees|transaction fees?|subscription fees?|paid)\b/.test(normalizedContent)) {
|
|
838
|
+
return false;
|
|
839
|
+
}
|
|
840
|
+
const wantsRebalancing = /\brebalanc/.test(normalizedQuery);
|
|
841
|
+
const wantsArtFund = /\bart fund/.test(normalizedQuery);
|
|
842
|
+
const wantsWealthfront = /\bwealthfront\b/.test(normalizedQuery);
|
|
843
|
+
return wantsRebalancing && /\brebalanc/.test(normalizedContent) || wantsArtFund && /\bart fund acquisition\b|\bart funds?\b/.test(normalizedContent) || wantsWealthfront && /\bwealthfront\b/.test(normalizedContent);
|
|
844
|
+
}
|
|
845
|
+
function isRetirementContributionQuery(normalizedQuery) {
|
|
846
|
+
return /\b(?:how much|what|amount|monthly|current|contribute|contribution|contributions)\b/.test(
|
|
847
|
+
normalizedQuery
|
|
848
|
+
) && /\b(?:roth ira|ira|retirement savings|retirement)\b/.test(normalizedQuery) && /\b(?:contribute|contribution|contributions|monthly)\b/.test(normalizedQuery);
|
|
849
|
+
}
|
|
850
|
+
function isRetirementContributionEvidenceText(normalizedContent) {
|
|
851
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
852
|
+
return /\broth ira\b/.test(normalizedContent) && /\b(?:contribute|contribution|contributions|contributing)\b/.test(normalizedContent) && /\bmonthly\b/.test(normalizedContent);
|
|
853
|
+
}
|
|
854
|
+
function isConfidenceBoostTotalQuery(normalizedQuery) {
|
|
855
|
+
return /\b(?:confidence boost|boost.*confidence|confidence.*boost|confidence)\b/.test(normalizedQuery) && /\b(?:total|how much|sum|combined)\b/.test(normalizedQuery) && /\b(?:co-leading|co-hosting|co-leading or co-hosting|support group|writing circle|activities)\b/.test(
|
|
856
|
+
normalizedQuery
|
|
857
|
+
);
|
|
858
|
+
}
|
|
859
|
+
function isConfidenceBoostEvidenceText(normalizedContent, normalizedQuery) {
|
|
860
|
+
if (!/\b\d[\d,]*(?:\.\d+)?\s?%/.test(normalizedContent)) return false;
|
|
861
|
+
if (/\bpatricia\b/.test(normalizedQuery) && !/\bpatricia\b/.test(normalizedContent)) {
|
|
862
|
+
return false;
|
|
863
|
+
}
|
|
864
|
+
return /\b(?:co-leading|co-hosting|support group|writing circle)\b/.test(normalizedContent) && /\b(?:confidence|leadership skills?)\b/.test(normalizedContent) && /\b(?:boost(?:ed)?|boost|improv(?:e|ed|ing)|increas(?:e|ed|ing))\b/.test(normalizedContent);
|
|
865
|
+
}
|
|
866
|
+
function isCacheTtlQuery(normalizedQuery) {
|
|
867
|
+
return /\b(?:ttl|time-to-live|time to live|cache configuration|cache config)\b/.test(normalizedQuery) && /\b(?:redis|cache|caching|cached|diffusion features?|api response times?|performance optimizations?)\b/.test(
|
|
868
|
+
normalizedQuery
|
|
869
|
+
) && /\b(?:what|setting|seconds?|how long|current|latest|updated|extended)\b/.test(normalizedQuery);
|
|
870
|
+
}
|
|
871
|
+
function isCacheTtlEvidenceText(normalizedContent) {
|
|
872
|
+
return /\b(?:ttl|time-to-live|time to live|cache configuration|cache config)\b/.test(normalizedContent) && /\b(?:redis|cache|caching|cached|diffusion features?|api response times?|performance optimizations?)\b/.test(
|
|
873
|
+
normalizedContent
|
|
874
|
+
) && /\b\d[\d,]*(?:\.\d+)?\s?seconds?\b/.test(normalizedContent);
|
|
875
|
+
}
|
|
876
|
+
function isGameCachingAuthenticationToolCountQuery(normalizedQuery) {
|
|
877
|
+
return /\bhow many\b/.test(normalizedQuery) && /\b(?:technologies|technology|tools?)\b/.test(normalizedQuery) && /\bgame\b/.test(normalizedQuery) && /\b(?:cache|caching|cached)\b/.test(normalizedQuery) && /\b(?:authentication|auth)\b/.test(normalizedQuery);
|
|
878
|
+
}
|
|
879
|
+
function isGameCachingAuthenticationToolCountEvidenceText(normalizedContent) {
|
|
880
|
+
const hasToolCue = /\b(?:redis\s*6\.2|redis|phaser\s*3\.55|phaser|node\.?js|express(?:\.js)?|jwt|jsonwebtoken|docker)\b/.test(
|
|
881
|
+
normalizedContent
|
|
882
|
+
);
|
|
883
|
+
if (!hasToolCue) return false;
|
|
884
|
+
const hasGameCacheCue = /\b(?:game state snapshots?|game caching|phaser|2d rendering|caching layer|cache user|redis store|session caching)\b/.test(
|
|
885
|
+
normalizedContent
|
|
886
|
+
);
|
|
887
|
+
const hasAuthenticationCue = /\b(?:authentication|auth|jwt|jsonwebtoken|refresh tokens?|token rotation|revoked tokens?|session management)\b/.test(
|
|
888
|
+
normalizedContent
|
|
889
|
+
);
|
|
890
|
+
const hasRedisSetupCue = /\bredis\b/.test(normalizedContent) && /\b(?:docker|node\.?js|express(?:\.js)?|jwt|jsonwebtoken|phaser\s*3\.55|game state snapshots?)\b/.test(
|
|
891
|
+
normalizedContent
|
|
892
|
+
);
|
|
893
|
+
return hasGameCacheCue || hasAuthenticationCue || hasRedisSetupCue;
|
|
894
|
+
}
|
|
895
|
+
function isGeometryTypeCountQuery(normalizedQuery) {
|
|
896
|
+
return /\bhow many\b/.test(normalizedQuery) && /\b(?:different\s+)?types?\s+of\s+geometr(?:y|ies)\b/.test(normalizedQuery) && /\b(?:parallel lines?|triangle angle sums?|angle sums?|euclidean|hyperbolic|spherical)\b/.test(
|
|
897
|
+
normalizedQuery
|
|
898
|
+
);
|
|
899
|
+
}
|
|
900
|
+
function isGeometryTypeCountEvidenceText(normalizedContent) {
|
|
901
|
+
const hasGeometryTypes = /\beuclidean\b/.test(normalizedContent) && /\bhyperbolic\b/.test(normalizedContent) && /\bspherical\b/.test(normalizedContent);
|
|
902
|
+
if (!hasGeometryTypes) return false;
|
|
903
|
+
return /\b(?:geometr(?:y|ies)|parallel lines?|triangle angle sums?|angle sums?|triangles?)\b/.test(
|
|
904
|
+
normalizedContent
|
|
905
|
+
);
|
|
906
|
+
}
|
|
907
|
+
function isBitcoinInvestmentPlatformQuery(normalizedQuery) {
|
|
908
|
+
return /\bbitcoin\b/.test(normalizedQuery) && /\b(?:invested|investment|how much|amount|platform|exchange)\b/.test(normalizedQuery) && /\b(?:platform|where|which|on)\b/.test(normalizedQuery);
|
|
909
|
+
}
|
|
910
|
+
function isBitcoinInvestmentPlatformEvidenceText(normalizedContent) {
|
|
911
|
+
return /\bbitcoin\b/.test(normalizedContent) && /\bbinance\b/.test(normalizedContent) && (/\$\s?500\b/.test(normalizedContent) || /\b500\s+dollars?\b/.test(normalizedContent));
|
|
912
|
+
}
|
|
913
|
+
function isCryptoFeeTotalQuery(normalizedQuery) {
|
|
914
|
+
return /\b(?:how much|total|combined|sum)\b/.test(normalizedQuery) && /\b(?:fees?|transaction fees?|gas fees?)\b/.test(normalizedQuery) && /\bethereum\b/.test(normalizedQuery) && /\b(?:wallet transfer|transfer|nft)\b/.test(normalizedQuery);
|
|
915
|
+
}
|
|
916
|
+
function isCryptoFeeEvidenceText(normalizedContent) {
|
|
917
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
918
|
+
const hasEthereumPurchaseWalletFee = /\bethereum\b/.test(normalizedContent) && /\bpurchase\b/.test(normalizedContent) && /\bwallet transfer\b/.test(normalizedContent) && (/\$\s?5\b/.test(normalizedContent) || /\b5\s+dollars?\b/.test(normalizedContent));
|
|
919
|
+
const hasRelatedEthereumTransferFee = (/\$\s?2\.50\b/.test(normalizedContent) || /\b2\.50\s+dollars?\b/.test(normalizedContent)) && /\b(?:ethereum|staking|deposit|transfer|wallet|crypto)\b/.test(normalizedContent) && /\bfees?\b/.test(normalizedContent);
|
|
920
|
+
const hasNftGasFee = /\bnft\b/.test(normalizedContent) && /\bgas fees?\b/.test(normalizedContent) && (/\$\s?10\b/.test(normalizedContent) || /\b10\s+dollars?\b/.test(normalizedContent));
|
|
921
|
+
return hasEthereumPurchaseWalletFee || hasRelatedEthereumTransferFee || hasNftGasFee;
|
|
922
|
+
}
|
|
923
|
+
function isPopulationGrowthRateQuery(normalizedQuery) {
|
|
924
|
+
return /\b(?:what|which|value|using|used|say|said|mention(?:ed)?)\b/.test(normalizedQuery) && /\bgrowth rate\b/.test(normalizedQuery) && /\b(?:population model|population growth model|exponential growth|logistic growth|growth model)\b/.test(
|
|
925
|
+
normalizedQuery
|
|
926
|
+
);
|
|
927
|
+
}
|
|
928
|
+
function isPopulationGrowthRateEvidenceText(normalizedContent) {
|
|
929
|
+
if (!hasPopulationGrowthRateFact(normalizedContent)) return false;
|
|
930
|
+
return /\b(?:population growth model|population model|exponential growth model|logistic growth model|growth model)\b/.test(
|
|
931
|
+
normalizedContent
|
|
932
|
+
) || /\bpopulation growth\b/.test(normalizedContent) && /\b(?:growth rate|k\s*=|r\s*=)\b/.test(normalizedContent);
|
|
933
|
+
}
|
|
934
|
+
function isAddressQuery(normalizedQuery) {
|
|
935
|
+
return /\b(?:address|where\s+(?:do\s+)?i\s+live|where\s+my\s+place\s+is|my place|home address)\b/.test(
|
|
936
|
+
normalizedQuery
|
|
937
|
+
) && /\b(?:what|where|mention(?:ed)?|address|live)\b/.test(normalizedQuery);
|
|
938
|
+
}
|
|
939
|
+
function isAddressEvidenceText(content, normalizedQuery) {
|
|
940
|
+
const normalizedContent = content.toLowerCase();
|
|
941
|
+
if (!hasStreetAddress(content)) return false;
|
|
942
|
+
if (/\bwhere\s+(?:do\s+)?i\s+live\b/.test(normalizedQuery)) {
|
|
943
|
+
return /\b(?:my place|home|apartment|where i live|i live|address)\b/.test(
|
|
944
|
+
normalizedContent
|
|
945
|
+
);
|
|
946
|
+
}
|
|
947
|
+
return /\b(?:address|my place|home|apartment|location|near|street)\b/.test(
|
|
948
|
+
normalizedContent
|
|
949
|
+
);
|
|
950
|
+
}
|
|
951
|
+
function hasStreetAddress(content) {
|
|
952
|
+
return extractStreetAddresses(content).length > 0;
|
|
953
|
+
}
|
|
954
|
+
function extractStreetAddresses(content) {
|
|
955
|
+
const addresses = /* @__PURE__ */ new Set();
|
|
956
|
+
for (const match of content.matchAll(STREET_ADDRESS_PATTERN)) {
|
|
957
|
+
const address = match[0].replace(/[,.!?;:]+$/g, "").replace(/\s+/g, " ").trim();
|
|
958
|
+
if (address) addresses.add(address);
|
|
959
|
+
}
|
|
960
|
+
return [...addresses];
|
|
961
|
+
}
|
|
962
|
+
function scoreAddressEvidenceSpecificity(normalizedContent, normalizedQuery) {
|
|
963
|
+
let score = 0;
|
|
964
|
+
if (/\b(?:my place|home|apartment|where i live|i live)\b/.test(normalizedContent)) {
|
|
965
|
+
score += 24;
|
|
966
|
+
}
|
|
967
|
+
if (/\baddress\b/.test(normalizedContent)) score += 16;
|
|
968
|
+
if (/\bnear\b/.test(normalizedContent)) score += 6;
|
|
969
|
+
score += countFocusedTermOverlap(normalizedContent, normalizedQuery);
|
|
970
|
+
return score;
|
|
971
|
+
}
|
|
972
|
+
function isBakingPurchaseTotalQuery(normalizedQuery) {
|
|
973
|
+
return /\b(?:how much|total|combined|sum|spent|spending)\b/.test(normalizedQuery) && /\b(?:kitchenaid|stand mixer|mixer)\b/.test(normalizedQuery) && /\b(?:organic almond flour|almond flour)\b/.test(normalizedQuery);
|
|
974
|
+
}
|
|
975
|
+
function isBakingPurchaseTotalEvidenceText(normalizedContent) {
|
|
976
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
977
|
+
return /\b(?:kitchenaid|stand mixer|mixer|organic almond flour|almond flour)\b/.test(
|
|
978
|
+
normalizedContent
|
|
979
|
+
) && /\b(?:spent|spending|cost|worth|investment|paid|bought|organic)\b/.test(
|
|
980
|
+
normalizedContent
|
|
981
|
+
);
|
|
982
|
+
}
|
|
983
|
+
function isTripEquipmentSavingsTotalQuery(normalizedQuery) {
|
|
984
|
+
return /\b(?:how much|total|combined|sum|spend|spent|spending|money)\b/.test(
|
|
985
|
+
normalizedQuery
|
|
986
|
+
) && /\btrip\b/.test(normalizedQuery) && /\b(?:future equipment|equipment savings?|equipment|savings?|saving|save|goalie mask|mask)\b/.test(
|
|
987
|
+
normalizedQuery
|
|
988
|
+
);
|
|
989
|
+
}
|
|
990
|
+
function isTripEquipmentSavingsEvidenceText(normalizedContent) {
|
|
991
|
+
if (!hasMoneyOrPercent(normalizedContent)) return false;
|
|
992
|
+
if (!/\b(?:goalie mask|trip|future equipment|equipment needs?|savings?|set aside|delayed summer trip|courtney)\b/.test(
|
|
993
|
+
normalizedContent
|
|
994
|
+
)) {
|
|
995
|
+
return false;
|
|
996
|
+
}
|
|
997
|
+
return /\b(?:spent|spending|expense|set aside|budget|savings?|save|split|resources|prepared|future equipment|trip)\b/.test(
|
|
998
|
+
normalizedContent
|
|
999
|
+
);
|
|
1000
|
+
}
|
|
1001
|
+
function isMvpDeadlineRemainingQuery(normalizedQuery) {
|
|
1002
|
+
return /\b(?:mvp|minimum viable product)\b/.test(normalizedQuery) && /\bdeadline\b/.test(normalizedQuery) && /\b(?:days?|left|remaining|development period|coding|begin coding|start)\b/.test(
|
|
1003
|
+
normalizedQuery
|
|
1004
|
+
);
|
|
1005
|
+
}
|
|
1006
|
+
function isMvpDeadlineEvidenceText(normalizedContent) {
|
|
1007
|
+
return /\b(?:mvp|development period|started coding|start(?:ed)? development|begin coding|coding)\b/.test(
|
|
1008
|
+
normalizedContent
|
|
1009
|
+
) && /\b(?:may\s+1(?:,\s*2024)?|june\s+12(?:,\s*2024)?|6 weeks?|six weeks?|development deadline)\b/.test(
|
|
1010
|
+
normalizedContent
|
|
1011
|
+
);
|
|
1012
|
+
}
|
|
1013
|
+
function extractBakingPurchaseCheckpoints(items) {
|
|
1014
|
+
const checkpoints = [];
|
|
1015
|
+
for (const item of items) {
|
|
1016
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1017
|
+
for (const segment of splitEvidenceSegments(item.content)) {
|
|
1018
|
+
const normalizedSegment = segment.toLowerCase();
|
|
1019
|
+
if (normalizedSegment.startsWith("normalized numeric cues:")) continue;
|
|
1020
|
+
const kind = classifyBakingPurchaseKind(normalizedSegment);
|
|
1021
|
+
if (!kind) continue;
|
|
1022
|
+
if (!isBakingPurchaseTotalEvidenceText(normalizedSegment)) continue;
|
|
1023
|
+
const specificity = scoreBakingPurchaseSpecificity(normalizedSegment, kind);
|
|
1024
|
+
for (const match of segment.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1025
|
+
const amount = parseNumericAmount(match[1]);
|
|
1026
|
+
if (amount === void 0) continue;
|
|
1027
|
+
checkpoints.push({ kind, amount, turn, specificity });
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
}
|
|
1031
|
+
return checkpoints.sort((left, right) => {
|
|
1032
|
+
if (left.kind !== right.kind) return left.kind.localeCompare(right.kind);
|
|
1033
|
+
if (right.specificity !== left.specificity) return right.specificity - left.specificity;
|
|
1034
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1035
|
+
return left.amount - right.amount;
|
|
1036
|
+
}).filter(
|
|
1037
|
+
(checkpoint, index, all) => index === 0 || checkpoint.kind !== all[index - 1]?.kind || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1038
|
+
);
|
|
1039
|
+
}
|
|
1040
|
+
function classifyBakingPurchaseKind(normalizedSegment) {
|
|
1041
|
+
if (/\bkitchenaid\b|\bstand mixer\b|\bmixer\b/.test(normalizedSegment)) {
|
|
1042
|
+
return "kitchenaid_mixer";
|
|
1043
|
+
}
|
|
1044
|
+
if (/\borganic almond flour\b|\balmond flour\b/.test(normalizedSegment)) {
|
|
1045
|
+
return "organic_almond_flour";
|
|
1046
|
+
}
|
|
1047
|
+
return void 0;
|
|
1048
|
+
}
|
|
1049
|
+
function scoreBakingPurchaseSpecificity(normalizedSegment, kind) {
|
|
1050
|
+
let score = 0;
|
|
1051
|
+
if (kind === "kitchenaid_mixer") {
|
|
1052
|
+
if (/\bkitchenaid\b/.test(normalizedSegment)) score += 24;
|
|
1053
|
+
if (/\bspent\b|\bspending\b|\bbought\b/.test(normalizedSegment)) score += 16;
|
|
1054
|
+
}
|
|
1055
|
+
if (kind === "organic_almond_flour") {
|
|
1056
|
+
if (/\borganic almond flour\b/.test(normalizedSegment)) score += 24;
|
|
1057
|
+
if (/\bspent\b|\bspending\b|\bbought\b/.test(normalizedSegment)) score += 16;
|
|
1058
|
+
if (/\bextra\s+\$/.test(normalizedSegment)) score -= 28;
|
|
1059
|
+
}
|
|
1060
|
+
return score;
|
|
1061
|
+
}
|
|
1062
|
+
function selectBakingPurchaseCheckpoint(checkpoints, kind) {
|
|
1063
|
+
const candidates = checkpoints.filter((checkpoint) => checkpoint.kind === kind);
|
|
1064
|
+
if (candidates.length === 0) return void 0;
|
|
1065
|
+
return candidates.reduce((best, checkpoint) => {
|
|
1066
|
+
if (checkpoint.specificity !== best.specificity) {
|
|
1067
|
+
return checkpoint.specificity > best.specificity ? checkpoint : best;
|
|
1068
|
+
}
|
|
1069
|
+
if (checkpoint.turn !== best.turn) {
|
|
1070
|
+
return checkpoint.turn < best.turn ? checkpoint : best;
|
|
1071
|
+
}
|
|
1072
|
+
return checkpoint.amount < best.amount ? checkpoint : best;
|
|
1073
|
+
}, candidates[0]);
|
|
1074
|
+
}
|
|
1075
|
+
function extractTripEquipmentSavingsCheckpoints(items) {
|
|
1076
|
+
const checkpoints = [];
|
|
1077
|
+
for (const item of items) {
|
|
1078
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1079
|
+
for (const segment of splitEvidenceSegments(item.content)) {
|
|
1080
|
+
const normalizedSegment = segment.toLowerCase();
|
|
1081
|
+
if (normalizedSegment.startsWith("normalized numeric cues:")) continue;
|
|
1082
|
+
if (!isTripEquipmentSavingsEvidenceText(normalizedSegment)) continue;
|
|
1083
|
+
for (const match of segment.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1084
|
+
const amount = parseNumericAmount(match[1]);
|
|
1085
|
+
if (amount === void 0) continue;
|
|
1086
|
+
const amountIndex = match.index ?? 0;
|
|
1087
|
+
const kind = classifyTripEquipmentSavingsKind(normalizedSegment, amountIndex);
|
|
1088
|
+
if (!kind) continue;
|
|
1089
|
+
checkpoints.push({
|
|
1090
|
+
kind,
|
|
1091
|
+
amount,
|
|
1092
|
+
turn,
|
|
1093
|
+
role: item.role,
|
|
1094
|
+
specificity: scoreTripEquipmentSavingsAmount(normalizedSegment, amountIndex, kind)
|
|
1095
|
+
});
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
1099
|
+
return checkpoints.sort((left, right) => {
|
|
1100
|
+
if (left.kind !== right.kind) return left.kind.localeCompare(right.kind);
|
|
1101
|
+
if (right.specificity !== left.specificity) return right.specificity - left.specificity;
|
|
1102
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1103
|
+
return left.amount - right.amount;
|
|
1104
|
+
}).filter(
|
|
1105
|
+
(checkpoint, index, all) => index === 0 || checkpoint.kind !== all[index - 1]?.kind || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1106
|
+
);
|
|
1107
|
+
}
|
|
1108
|
+
function classifyTripEquipmentSavingsKind(normalizedSegment, amountIndex) {
|
|
1109
|
+
const candidates = [
|
|
1110
|
+
{
|
|
1111
|
+
kind: "goalie_mask",
|
|
1112
|
+
score: scoreTripEquipmentSavingsAmount(normalizedSegment, amountIndex, "goalie_mask")
|
|
1113
|
+
},
|
|
1114
|
+
{
|
|
1115
|
+
kind: "trip",
|
|
1116
|
+
score: scoreTripEquipmentSavingsAmount(normalizedSegment, amountIndex, "trip")
|
|
1117
|
+
},
|
|
1118
|
+
{
|
|
1119
|
+
kind: "equipment_savings",
|
|
1120
|
+
score: scoreTripEquipmentSavingsAmount(
|
|
1121
|
+
normalizedSegment,
|
|
1122
|
+
amountIndex,
|
|
1123
|
+
"equipment_savings"
|
|
1124
|
+
)
|
|
1125
|
+
}
|
|
1126
|
+
];
|
|
1127
|
+
const scores = candidates.filter((candidate) => candidate.score > 0);
|
|
1128
|
+
return scores.sort((left, right) => {
|
|
1129
|
+
if (right.score !== left.score) return right.score - left.score;
|
|
1130
|
+
return left.kind.localeCompare(right.kind);
|
|
1131
|
+
})[0]?.kind;
|
|
1132
|
+
}
|
|
1133
|
+
function scoreTripEquipmentSavingsAmount(normalizedSegment, amountIndex, kind) {
|
|
1134
|
+
const cuesByKind = {
|
|
1135
|
+
goalie_mask: [/\bgoalie mask\b/g, /\bmask\b/g],
|
|
1136
|
+
trip: [/\btrip\b/g, /\bdelayed summer trip\b/g, /\bcourtney\b/g, /\baugust\s+20\b/g],
|
|
1137
|
+
equipment_savings: [
|
|
1138
|
+
/\bfuture equipment\b/g,
|
|
1139
|
+
/\bequipment needs?\b/g,
|
|
1140
|
+
/\bsavings?\b/g,
|
|
1141
|
+
/\bsav(?:e|ing)\b/g,
|
|
1142
|
+
/\bprepared\b/g
|
|
1143
|
+
]
|
|
1144
|
+
};
|
|
1145
|
+
const distance = nearestPatternDistance(normalizedSegment, amountIndex, cuesByKind[kind]);
|
|
1146
|
+
if (distance === void 0 || distance > 90) return 0;
|
|
1147
|
+
let score = 120 - distance;
|
|
1148
|
+
const amountWindow = normalizedSegment.slice(
|
|
1149
|
+
Math.max(0, amountIndex - 50),
|
|
1150
|
+
Math.min(normalizedSegment.length, amountIndex + 90)
|
|
1151
|
+
);
|
|
1152
|
+
if (kind === "goalie_mask" && /\bspent\b|\bexpense\b/.test(amountWindow)) {
|
|
1153
|
+
score += 30;
|
|
1154
|
+
}
|
|
1155
|
+
if (kind === "trip" && /\b(?:for the trip|trip budget|budget under|delayed summer trip)\b/.test(amountWindow)) {
|
|
1156
|
+
score += 30;
|
|
1157
|
+
}
|
|
1158
|
+
if (kind === "equipment_savings" && /\b(?:for savings|future equipment|equipment needs?)\b/.test(amountWindow)) {
|
|
1159
|
+
score += 30;
|
|
1160
|
+
}
|
|
1161
|
+
if (/\b(?:total trip budget|need additional funds|adjust the budget)\b/.test(normalizedSegment)) {
|
|
1162
|
+
score -= 80;
|
|
1163
|
+
}
|
|
1164
|
+
return Math.max(0, score);
|
|
1165
|
+
}
|
|
1166
|
+
function nearestPatternDistance(text, amountIndex, patterns) {
|
|
1167
|
+
let nearest;
|
|
1168
|
+
for (const pattern of patterns) {
|
|
1169
|
+
pattern.lastIndex = 0;
|
|
1170
|
+
for (const match of text.matchAll(pattern)) {
|
|
1171
|
+
const index = match.index ?? 0;
|
|
1172
|
+
const distance = Math.abs(index - amountIndex);
|
|
1173
|
+
if (nearest === void 0 || distance < nearest) {
|
|
1174
|
+
nearest = distance;
|
|
1175
|
+
}
|
|
1176
|
+
}
|
|
1177
|
+
}
|
|
1178
|
+
return nearest;
|
|
1179
|
+
}
|
|
1180
|
+
function selectTripEquipmentSavingsCheckpoint(checkpoints, kind) {
|
|
1181
|
+
const candidates = checkpoints.filter((checkpoint) => checkpoint.kind === kind);
|
|
1182
|
+
if (candidates.length === 0) return void 0;
|
|
1183
|
+
const userCandidates = candidates.filter((checkpoint) => checkpoint.role === "user");
|
|
1184
|
+
const pool = userCandidates.length > 0 ? userCandidates : candidates;
|
|
1185
|
+
return pool.reduce((best, checkpoint) => {
|
|
1186
|
+
if (checkpoint.specificity !== best.specificity) {
|
|
1187
|
+
return checkpoint.specificity > best.specificity ? checkpoint : best;
|
|
1188
|
+
}
|
|
1189
|
+
if (checkpoint.turn !== best.turn) {
|
|
1190
|
+
return checkpoint.turn > best.turn ? checkpoint : best;
|
|
1191
|
+
}
|
|
1192
|
+
return checkpoint.amount < best.amount ? checkpoint : best;
|
|
1193
|
+
}, pool[0]);
|
|
1194
|
+
}
|
|
1195
|
+
function isPurchaseBudgetEvidenceText(normalizedContent) {
|
|
1196
|
+
return extractPurchaseBudgetEvidenceSegments(normalizedContent).length > 0;
|
|
1197
|
+
}
|
|
1198
|
+
function extractPurchaseBudgetEvidenceSegments(content) {
|
|
1199
|
+
return splitEvidenceSegments(content).map((text) => ({ text, normalized: text.toLowerCase() })).filter((segment) => isPurchaseBudgetEvidenceSegment(segment.normalized));
|
|
1200
|
+
}
|
|
1201
|
+
function splitEvidenceSegments(content) {
|
|
1202
|
+
const segments = [];
|
|
1203
|
+
for (const part of content.split(/\r?\n+/)) {
|
|
1204
|
+
const trimmed = part.trim();
|
|
1205
|
+
if (!trimmed) continue;
|
|
1206
|
+
const sentenceMatches = trimmed.match(/[^.!?]+[.!?]?/g);
|
|
1207
|
+
if (!sentenceMatches) {
|
|
1208
|
+
segments.push(trimmed);
|
|
1209
|
+
continue;
|
|
1210
|
+
}
|
|
1211
|
+
for (const sentence of sentenceMatches) {
|
|
1212
|
+
const normalized = sentence.trim();
|
|
1213
|
+
if (normalized) segments.push(normalized);
|
|
1214
|
+
}
|
|
1215
|
+
}
|
|
1216
|
+
return segments;
|
|
1217
|
+
}
|
|
1218
|
+
function isPurchaseBudgetEvidenceSegment(normalizedSegment) {
|
|
1219
|
+
if (!hasMoneyOrPercent(normalizedSegment)) return false;
|
|
1220
|
+
if (!/\b(?:budget|ceiling|cap|limit)\b/.test(normalizedSegment)) return false;
|
|
1221
|
+
if (isAccessoryBudgetOnlyText(normalizedSegment)) return false;
|
|
1222
|
+
const hasDirectDevicePurchase = /\b(?:new\s+)?(?:phone|smartphone|device|laptop)\b/.test(normalizedSegment) || /\b(?:buy(?:ing)?|purchas(?:e|ing)|get(?:ting)?)\b[^.?\n]{0,80}\b(?:phone|smartphone|device|laptop)\b/.test(
|
|
1223
|
+
normalizedSegment
|
|
1224
|
+
);
|
|
1225
|
+
if (!hasDirectDevicePurchase) return false;
|
|
1226
|
+
return /\b(?:camera|battery|photography|gaming|ceiling|cap|limit|purchase|buy|new)\b/.test(
|
|
1227
|
+
normalizedSegment
|
|
1228
|
+
);
|
|
1229
|
+
}
|
|
1230
|
+
function isAccessoryBudgetOnlyText(normalizedContent) {
|
|
1231
|
+
const hasAccessoryBudgetCue = /\b(?:accessor(?:y|ies)|apps?|subscriptions?|headsets?|screen protectors?|cases?|chargers?|charging stands?|controllers?|cloud storage|vacation)\b/.test(
|
|
1232
|
+
normalizedContent
|
|
1233
|
+
);
|
|
1234
|
+
if (!hasAccessoryBudgetCue) return false;
|
|
1235
|
+
return !/\b(?:new phone|new smartphone|new device|new laptop|phone purchase|smartphone purchase|device purchase|laptop purchase|buy(?:ing)? a new (?:phone|smartphone|device|laptop)|purchas(?:e|ing) a new (?:phone|smartphone|device|laptop))\b/.test(
|
|
1236
|
+
normalizedContent
|
|
1237
|
+
);
|
|
1238
|
+
}
|
|
1239
|
+
function isPurchaseBudgetAmountAt(normalizedContent, amountIndex) {
|
|
1240
|
+
const windowStart = Math.max(0, amountIndex - 80);
|
|
1241
|
+
const windowEnd = Math.min(normalizedContent.length, amountIndex + 120);
|
|
1242
|
+
const nearAmount = normalizedContent.slice(windowStart, windowEnd);
|
|
1243
|
+
return /\b(?:budget|ceiling|cap|limit)\b/.test(nearAmount);
|
|
1244
|
+
}
|
|
1245
|
+
function buildEmergencyFundDurationSummary(items, query) {
|
|
1246
|
+
const normalizedQuery = query.toLowerCase();
|
|
1247
|
+
if (!/\bemergency fund\b/.test(normalizedQuery) || !/\b(?:how long|after|between|duration|days?|time)\b/.test(normalizedQuery)) {
|
|
1248
|
+
return "";
|
|
1249
|
+
}
|
|
1250
|
+
const checkpoints = items.flatMap((item) => extractEmergencyFundCheckpoints(item.content)).sort((left, right) => compareEmergencyFundCheckpoints(left, right));
|
|
1251
|
+
if (checkpoints.length < 2) {
|
|
1252
|
+
return "";
|
|
1253
|
+
}
|
|
1254
|
+
const start = checkpoints.find((checkpoint) => !checkpoint.isFullGoal) ?? checkpoints[0];
|
|
1255
|
+
if (!start) {
|
|
1256
|
+
return "";
|
|
1257
|
+
}
|
|
1258
|
+
const end = checkpoints.filter((checkpoint) => checkpoint !== start).find((checkpoint) => checkpoint.isFullGoal && checkpoint.amount >= start.amount) ?? checkpoints.find((checkpoint) => checkpoint.amount > start.amount);
|
|
1259
|
+
if (!end) {
|
|
1260
|
+
return "";
|
|
1261
|
+
}
|
|
1262
|
+
const days = daysBetweenMonthDays(start.date, end.date);
|
|
1263
|
+
if (days <= 0) {
|
|
1264
|
+
return "";
|
|
1265
|
+
}
|
|
1266
|
+
return `Computed temporal interval: ${days} days from ${formatMonthDay(start.date)} till ${formatMonthDay(end.date)}.`;
|
|
1267
|
+
}
|
|
1268
|
+
function extractEmergencyFundCheckpoints(content) {
|
|
1269
|
+
if (!/\bemergency fund\b/i.test(content)) {
|
|
1270
|
+
return [];
|
|
1271
|
+
}
|
|
1272
|
+
const checkpoints = [];
|
|
1273
|
+
const reachedAmountByDate = /\breached\s+\$?\s?(\d[\d,]*(?:\.\d+)?)[^.?\n]{0,180}?\b(?:by|on)\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*(\d{4}))?/gi;
|
|
1274
|
+
for (const match of content.matchAll(reachedAmountByDate)) {
|
|
1275
|
+
const amount = parseNumericAmount(match[1]);
|
|
1276
|
+
const date = parseMonthDay(match[2], match[3], match[4]);
|
|
1277
|
+
if (amount === void 0 || !date) continue;
|
|
1278
|
+
checkpoints.push({
|
|
1279
|
+
amount,
|
|
1280
|
+
date,
|
|
1281
|
+
isFullGoal: false
|
|
1282
|
+
});
|
|
1283
|
+
}
|
|
1284
|
+
const reachedGoalByDate = /\breached(?:\s+my)?\s+emergency fund goal(?:\s+of)?\s+\$?\s?(\d[\d,]*(?:\.\d+)?)[^.?\n]{0,120}?\b(?:by|on)\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*(\d{4}))?/gi;
|
|
1285
|
+
for (const match of content.matchAll(reachedGoalByDate)) {
|
|
1286
|
+
const amount = parseNumericAmount(match[1]);
|
|
1287
|
+
const date = parseMonthDay(match[2], match[3], match[4]);
|
|
1288
|
+
if (amount === void 0 || !date) continue;
|
|
1289
|
+
checkpoints.push({
|
|
1290
|
+
amount,
|
|
1291
|
+
date,
|
|
1292
|
+
isFullGoal: true
|
|
1293
|
+
});
|
|
1294
|
+
}
|
|
1295
|
+
return dedupeCheckpoints(checkpoints);
|
|
1296
|
+
}
|
|
1297
|
+
function dedupeCheckpoints(checkpoints) {
|
|
1298
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1299
|
+
const deduped = [];
|
|
1300
|
+
for (const checkpoint of checkpoints) {
|
|
1301
|
+
const key = `${checkpoint.amount}:${checkpoint.date.year ?? ""}:${checkpoint.date.month}:${checkpoint.date.day}:${checkpoint.isFullGoal}`;
|
|
1302
|
+
if (seen.has(key)) continue;
|
|
1303
|
+
seen.add(key);
|
|
1304
|
+
deduped.push(checkpoint);
|
|
1305
|
+
}
|
|
1306
|
+
return deduped;
|
|
1307
|
+
}
|
|
1308
|
+
function parseNumericAmount(value) {
|
|
1309
|
+
if (!value) return void 0;
|
|
1310
|
+
const parsed = Number(value.replace(/,/g, ""));
|
|
1311
|
+
return Number.isFinite(parsed) ? parsed : void 0;
|
|
1312
|
+
}
|
|
1313
|
+
function parseMonthDay(monthName, dayValue, yearValue) {
|
|
1314
|
+
if (!monthName || !dayValue) return void 0;
|
|
1315
|
+
const month = MONTH_INDEX_BY_NAME[monthName.toLowerCase()];
|
|
1316
|
+
const day = Number(dayValue);
|
|
1317
|
+
if (!month || !Number.isInteger(day) || day < 1 || day > 31) {
|
|
1318
|
+
return void 0;
|
|
1319
|
+
}
|
|
1320
|
+
const year = yearValue === void 0 ? void 0 : Number(yearValue);
|
|
1321
|
+
if (year !== void 0 && (!Number.isInteger(year) || year < 0)) {
|
|
1322
|
+
return void 0;
|
|
1323
|
+
}
|
|
1324
|
+
return year === void 0 ? { month, day } : { month, day, year };
|
|
1325
|
+
}
|
|
1326
|
+
function daysBetweenMonthDays(start, end) {
|
|
1327
|
+
const startYear = start.year ?? 2024;
|
|
1328
|
+
const endYear = end.year ?? startYear;
|
|
1329
|
+
const startTime = Date.UTC(startYear, start.month - 1, start.day);
|
|
1330
|
+
let endTime = Date.UTC(endYear, end.month - 1, end.day);
|
|
1331
|
+
if (end.year === void 0 && endTime < startTime) {
|
|
1332
|
+
endTime = Date.UTC(startYear + 1, end.month - 1, end.day);
|
|
1333
|
+
}
|
|
1334
|
+
return Math.round((endTime - startTime) / 864e5);
|
|
1335
|
+
}
|
|
1336
|
+
function formatMonthDay(date) {
|
|
1337
|
+
const month = MONTH_NAME_BY_INDEX[date.month] ?? "Unknown";
|
|
1338
|
+
return date.year === void 0 ? `${month} ${date.day}` : `${month} ${date.day}, ${date.year}`;
|
|
1339
|
+
}
|
|
1340
|
+
function compareEmergencyFundCheckpoints(left, right) {
|
|
1341
|
+
const leftYear = left.date.year ?? 2024;
|
|
1342
|
+
const rightYear = right.date.year ?? 2024;
|
|
1343
|
+
if (leftYear !== rightYear) return leftYear - rightYear;
|
|
1344
|
+
if (left.date.month !== right.date.month) return left.date.month - right.date.month;
|
|
1345
|
+
if (left.date.day !== right.date.day) return left.date.day - right.date.day;
|
|
1346
|
+
return left.amount - right.amount;
|
|
1347
|
+
}
|
|
1348
|
+
function buildWordCountDeltaSummary(items, query) {
|
|
1349
|
+
const normalizedQuery = query.toLowerCase();
|
|
1350
|
+
if (!/\bword count\b/.test(normalizedQuery) || !/\b(?:increase|increased|from|until)\b/.test(normalizedQuery)) {
|
|
1351
|
+
return "";
|
|
1352
|
+
}
|
|
1353
|
+
const joined = items.map((item) => item.content).join("\n");
|
|
1354
|
+
const match = joined.match(
|
|
1355
|
+
/\b(?:increased|increase|adjusted)[^.?\n]{0,120}?\bfrom\s+(\d[\d,]*)\s+to\s+(\d[\d,]*)\s+words\b/i
|
|
1356
|
+
) ?? joined.match(
|
|
1357
|
+
/\bfrom\s+(\d[\d,]*)\s+to\s+(\d[\d,]*)\s+words\b/i
|
|
1358
|
+
);
|
|
1359
|
+
if (!match?.[1] || !match[2]) {
|
|
1360
|
+
return "";
|
|
1361
|
+
}
|
|
1362
|
+
const start = parseNumericAmount(match[1]);
|
|
1363
|
+
const end = parseNumericAmount(match[2]);
|
|
1364
|
+
if (start === void 0 || end === void 0 || end <= start) {
|
|
1365
|
+
return "";
|
|
1366
|
+
}
|
|
1367
|
+
const delta = end - start;
|
|
1368
|
+
return `Computed word-count increase: ${delta} words, from ${formatNumber(start)} to ${formatNumber(end)} words.`;
|
|
1369
|
+
}
|
|
1370
|
+
function buildEditingChallengeDurationSummary(items, query) {
|
|
1371
|
+
const normalizedQuery = query.toLowerCase();
|
|
1372
|
+
if (!/\bediting challenge\b/.test(normalizedQuery) || !/\b(?:how many|days?|between|passed)\b/.test(normalizedQuery)) {
|
|
1373
|
+
return "";
|
|
1374
|
+
}
|
|
1375
|
+
const joined = items.map((item) => item.content).join("\n");
|
|
1376
|
+
const startMatch = joined.match(
|
|
1377
|
+
/\b30-day editing challenge\s+starting\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})/i
|
|
1378
|
+
);
|
|
1379
|
+
const endMatch = joined.match(
|
|
1380
|
+
/\b15-day clarity editing challenge\s+from\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})\s+to\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})/i
|
|
1381
|
+
);
|
|
1382
|
+
const start = parseMonthDay(startMatch?.[1], startMatch?.[2]);
|
|
1383
|
+
const end = parseMonthDay(endMatch?.[3], endMatch?.[4]);
|
|
1384
|
+
if (!start || !end) {
|
|
1385
|
+
return "";
|
|
1386
|
+
}
|
|
1387
|
+
const days = daysBetweenMonthDays(start, end);
|
|
1388
|
+
if (days <= 0) {
|
|
1389
|
+
return "";
|
|
1390
|
+
}
|
|
1391
|
+
return `Computed editing-challenge interval: ${days} days from ${formatMonthDay(start)} till ${formatMonthDay(end)}.`;
|
|
1392
|
+
}
|
|
1393
|
+
function buildTutoringGoalDurationSummary(items, query) {
|
|
1394
|
+
const normalizedQuery = query.toLowerCase();
|
|
1395
|
+
if (!/\b(?:weeks?|days?|how many)\b/.test(normalizedQuery) || !/\b(?:tutoring|sessions?)\b/.test(normalizedQuery) || !/\b(?:math score|80%|80 percent|goal)\b/.test(normalizedQuery)) {
|
|
1396
|
+
return "";
|
|
1397
|
+
}
|
|
1398
|
+
const joined = items.map((item) => item.content).join("\n");
|
|
1399
|
+
const startMatch = joined.match(
|
|
1400
|
+
/\b(?:twice weekly sessions?|tutoring sessions?)[^.?\n]{0,120}?\bstarting\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})\b/i
|
|
1401
|
+
) ?? joined.match(
|
|
1402
|
+
/\bstarting\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})[^.?\n]{0,120}?\b(?:twice weekly sessions?|tutoring sessions?)\b/i
|
|
1403
|
+
);
|
|
1404
|
+
const endMatch = joined.match(
|
|
1405
|
+
/\b(?:80%|80\s+percent|math scores?)[^.?\n]{0,120}?\bby\s+(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*\d{4})?\b/i
|
|
1406
|
+
);
|
|
1407
|
+
const start = parseMonthDay(startMatch?.[1], startMatch?.[2]);
|
|
1408
|
+
const end = parseMonthDay(endMatch?.[1], endMatch?.[2]);
|
|
1409
|
+
if (!start || !end) return "";
|
|
1410
|
+
const days = daysBetweenMonthDays(start, end);
|
|
1411
|
+
if (days <= 0) return "";
|
|
1412
|
+
const approximateWeeks = Math.ceil(days / 7);
|
|
1413
|
+
return `Computed tutoring interval: approximately ${formatNumber(approximateWeeks)} weeks from ${formatMonthDay(start)} till ${formatMonthDay(end)}.`;
|
|
1414
|
+
}
|
|
1415
|
+
function buildTrainingCostSummary(items, query) {
|
|
1416
|
+
const normalizedQuery = query.toLowerCase();
|
|
1417
|
+
if (!isTrainingCostQuery(normalizedQuery)) return "";
|
|
1418
|
+
const checkpoints = extractTrainingCostCheckpoints(items);
|
|
1419
|
+
if (checkpoints.length === 0) return "";
|
|
1420
|
+
const selected = checkpoints.reduce((best, checkpoint) => {
|
|
1421
|
+
if (checkpoint.specificity !== best.specificity) {
|
|
1422
|
+
return checkpoint.specificity > best.specificity ? checkpoint : best;
|
|
1423
|
+
}
|
|
1424
|
+
if (checkpoint.turn !== best.turn) {
|
|
1425
|
+
return checkpoint.turn < best.turn ? checkpoint : best;
|
|
1426
|
+
}
|
|
1427
|
+
return checkpoint.amount < best.amount ? checkpoint : best;
|
|
1428
|
+
}, checkpoints[0]);
|
|
1429
|
+
if (!selected) return "";
|
|
1430
|
+
return `Training cost evidence: $${formatNumber(selected.amount)}.`;
|
|
1431
|
+
}
|
|
1432
|
+
function extractTrainingCostCheckpoints(items) {
|
|
1433
|
+
const checkpoints = [];
|
|
1434
|
+
for (const item of items) {
|
|
1435
|
+
const normalizedContent = item.content.toLowerCase();
|
|
1436
|
+
if (!isTrainingCostEvidenceText(normalizedContent)) continue;
|
|
1437
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1438
|
+
const specificity = scoreTrainingCostSpecificity(normalizedContent);
|
|
1439
|
+
for (const match of item.content.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1440
|
+
const amount = parseNumericAmount(match[1]);
|
|
1441
|
+
if (amount === void 0) continue;
|
|
1442
|
+
checkpoints.push({ amount, turn, specificity });
|
|
1443
|
+
}
|
|
1444
|
+
}
|
|
1445
|
+
return checkpoints.sort((left, right) => {
|
|
1446
|
+
if (right.specificity !== left.specificity) return right.specificity - left.specificity;
|
|
1447
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1448
|
+
return left.amount - right.amount;
|
|
1449
|
+
}).filter(
|
|
1450
|
+
(checkpoint, index, all) => index === 0 || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1451
|
+
);
|
|
1452
|
+
}
|
|
1453
|
+
function scoreTrainingCostSpecificity(normalizedContent) {
|
|
1454
|
+
let score = 0;
|
|
1455
|
+
if (/\btraining\b/.test(normalizedContent)) score += 12;
|
|
1456
|
+
if (/\b(?:leadership training|12-week|coursera|starting february 5|february 5)\b/.test(normalizedContent)) {
|
|
1457
|
+
score += 12;
|
|
1458
|
+
}
|
|
1459
|
+
if (/\b(?:costing|cost:|spending)\b/.test(normalizedContent)) score += 8;
|
|
1460
|
+
if (/\b(?:enrolled|enrolling|this course|this training)\b/.test(normalizedContent)) score += 6;
|
|
1461
|
+
if (/\bstrategic thinking course\b/.test(normalizedContent)) score -= 6;
|
|
1462
|
+
return score;
|
|
1463
|
+
}
|
|
1464
|
+
function buildPortfolioFeeTotalSummary(items, query) {
|
|
1465
|
+
const normalizedQuery = query.toLowerCase();
|
|
1466
|
+
if (!isPortfolioFeeTotalQuery(normalizedQuery)) return "";
|
|
1467
|
+
const checkpoints = extractPortfolioFeeCheckpoints(items, normalizedQuery);
|
|
1468
|
+
if (checkpoints.length === 0) return "";
|
|
1469
|
+
const earliestByKind = /* @__PURE__ */ new Map();
|
|
1470
|
+
for (const checkpoint of checkpoints) {
|
|
1471
|
+
const existing = earliestByKind.get(checkpoint.kind);
|
|
1472
|
+
if (!existing || checkpoint.turn < existing.turn) {
|
|
1473
|
+
earliestByKind.set(checkpoint.kind, checkpoint);
|
|
1474
|
+
}
|
|
1475
|
+
}
|
|
1476
|
+
const selected = [...earliestByKind.values()].sort((left, right) => left.turn - right.turn);
|
|
1477
|
+
const total = selected.reduce((sum, checkpoint) => sum + checkpoint.amount, 0);
|
|
1478
|
+
if (total <= 0) return "";
|
|
1479
|
+
const parts = selected.map((checkpoint) => `$${formatNumber(checkpoint.amount)} ${PORTFOLIO_FEE_LABELS[checkpoint.kind]}`).join(" + ");
|
|
1480
|
+
return `Computed portfolio fee total: $${formatNumber(total)} total (${parts}).`;
|
|
1481
|
+
}
|
|
1482
|
+
var PORTFOLIO_FEE_LABELS = {
|
|
1483
|
+
rebalancing: "rebalancing fees",
|
|
1484
|
+
art_fund: "art fund acquisition fees",
|
|
1485
|
+
wealthfront: "Wealthfront subscription fees"
|
|
1486
|
+
};
|
|
1487
|
+
function extractPortfolioFeeCheckpoints(items, normalizedQuery) {
|
|
1488
|
+
const checkpoints = [];
|
|
1489
|
+
for (const item of items) {
|
|
1490
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1491
|
+
for (const segment of splitEvidenceSegments(item.content)) {
|
|
1492
|
+
const normalizedSegment = segment.toLowerCase();
|
|
1493
|
+
if (normalizedSegment.startsWith("normalized numeric cues:")) continue;
|
|
1494
|
+
const kind = classifyPortfolioFeeKind(normalizedSegment, normalizedQuery);
|
|
1495
|
+
if (!kind) continue;
|
|
1496
|
+
if (!/\b(?:fee|fees|paid|costs?)\b/.test(normalizedSegment)) continue;
|
|
1497
|
+
for (const match of segment.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1498
|
+
const amount = parseNumericAmount(match[1]);
|
|
1499
|
+
if (amount === void 0) continue;
|
|
1500
|
+
checkpoints.push({ kind, amount, turn });
|
|
1501
|
+
}
|
|
1502
|
+
}
|
|
1503
|
+
}
|
|
1504
|
+
return checkpoints.sort((left, right) => {
|
|
1505
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1506
|
+
if (left.kind !== right.kind) return left.kind.localeCompare(right.kind);
|
|
1507
|
+
return left.amount - right.amount;
|
|
1508
|
+
}).filter(
|
|
1509
|
+
(checkpoint, index, all) => index === 0 || checkpoint.kind !== all[index - 1]?.kind || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1510
|
+
);
|
|
1511
|
+
}
|
|
1512
|
+
function classifyPortfolioFeeKind(normalizedSegment, normalizedQuery) {
|
|
1513
|
+
if (/\brebalanc/.test(normalizedQuery) && /\brebalanc/.test(normalizedSegment)) {
|
|
1514
|
+
return "rebalancing";
|
|
1515
|
+
}
|
|
1516
|
+
if (/\bart fund/.test(normalizedQuery) && /\bart fund acquisition\b|\bart funds?\b/.test(normalizedSegment)) {
|
|
1517
|
+
return "art_fund";
|
|
1518
|
+
}
|
|
1519
|
+
if (/\bwealthfront\b/.test(normalizedQuery) && /\bwealthfront\b/.test(normalizedSegment)) {
|
|
1520
|
+
return "wealthfront";
|
|
1521
|
+
}
|
|
1522
|
+
return void 0;
|
|
1523
|
+
}
|
|
1524
|
+
function buildRetirementContributionSummary(items, query) {
|
|
1525
|
+
const normalizedQuery = query.toLowerCase();
|
|
1526
|
+
if (!isRetirementContributionQuery(normalizedQuery)) return "";
|
|
1527
|
+
const checkpoints = extractRetirementContributionCheckpoints(items);
|
|
1528
|
+
if (checkpoints.length === 0) return "";
|
|
1529
|
+
const latest = checkpoints.reduce((best, checkpoint) => {
|
|
1530
|
+
if (checkpoint.isUpdate !== best.isUpdate) {
|
|
1531
|
+
return checkpoint.isUpdate ? checkpoint : best;
|
|
1532
|
+
}
|
|
1533
|
+
if (checkpoint.turn !== best.turn) {
|
|
1534
|
+
return checkpoint.turn > best.turn ? checkpoint : best;
|
|
1535
|
+
}
|
|
1536
|
+
return checkpoint.amount > best.amount ? checkpoint : best;
|
|
1537
|
+
}, checkpoints[0]);
|
|
1538
|
+
if (!latest) return "";
|
|
1539
|
+
return `Most recent Roth IRA contribution evidence: $${formatNumber(latest.amount)} monthly.`;
|
|
1540
|
+
}
|
|
1541
|
+
function extractRetirementContributionCheckpoints(items) {
|
|
1542
|
+
const checkpoints = [];
|
|
1543
|
+
for (const item of items) {
|
|
1544
|
+
const normalizedContent = item.content.toLowerCase();
|
|
1545
|
+
if (!isRetirementContributionEvidenceText(normalizedContent)) continue;
|
|
1546
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1547
|
+
for (const match of item.content.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1548
|
+
const amount = parseNumericAmount(match[1]);
|
|
1549
|
+
if (amount === void 0) continue;
|
|
1550
|
+
checkpoints.push({
|
|
1551
|
+
amount,
|
|
1552
|
+
turn,
|
|
1553
|
+
isUpdate: /\b(?:increased|starting|current|currently|now|recently|latest)\b/.test(
|
|
1554
|
+
normalizedContent
|
|
1555
|
+
)
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
}
|
|
1559
|
+
return checkpoints.sort((left, right) => {
|
|
1560
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1561
|
+
return left.amount - right.amount;
|
|
1562
|
+
}).filter(
|
|
1563
|
+
(checkpoint, index, all) => index === 0 || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1564
|
+
);
|
|
1565
|
+
}
|
|
1566
|
+
function buildSalaryFactSummary(items, query) {
|
|
1567
|
+
const normalizedQuery = query.toLowerCase();
|
|
1568
|
+
if (!isSalaryQuery(normalizedQuery)) return "";
|
|
1569
|
+
const checkpoints = extractSalaryCheckpoints(items);
|
|
1570
|
+
if (checkpoints.length === 0) return "";
|
|
1571
|
+
const wantsEmployer = /\bsaint pierre manufacturing ltd\b/.test(normalizedQuery);
|
|
1572
|
+
const candidates = wantsEmployer ? checkpoints.filter((checkpoint) => checkpoint.hasEmployer) : checkpoints.filter((checkpoint) => !checkpoint.isRaise);
|
|
1573
|
+
const pool = candidates.length > 0 ? candidates : checkpoints;
|
|
1574
|
+
const selected = pool.reduce((best, checkpoint) => {
|
|
1575
|
+
if (wantsEmployer && checkpoint.isRaise !== best.isRaise) {
|
|
1576
|
+
return checkpoint.isRaise ? checkpoint : best;
|
|
1577
|
+
}
|
|
1578
|
+
if (checkpoint.turn !== best.turn) {
|
|
1579
|
+
return checkpoint.turn > best.turn ? checkpoint : best;
|
|
1580
|
+
}
|
|
1581
|
+
return checkpoint.amount > best.amount ? checkpoint : best;
|
|
1582
|
+
}, pool[0]);
|
|
1583
|
+
if (!selected) return "";
|
|
1584
|
+
const employer = selected.hasEmployer ? " as senior engineer at Saint Pierre Manufacturing Ltd" : "";
|
|
1585
|
+
return `Salary evidence: approximately $${formatNumber(selected.amount)} CAD annually${employer}.`;
|
|
1586
|
+
}
|
|
1587
|
+
function extractSalaryCheckpoints(items) {
|
|
1588
|
+
const checkpoints = [];
|
|
1589
|
+
for (const item of items) {
|
|
1590
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1591
|
+
const normalizedContent = item.content.toLowerCase();
|
|
1592
|
+
if (!isSalaryEvidenceText(normalizedContent)) continue;
|
|
1593
|
+
for (const match of item.content.matchAll(/\$\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1594
|
+
const amount = parseNumericAmount(match[1]);
|
|
1595
|
+
if (amount === void 0) continue;
|
|
1596
|
+
checkpoints.push({
|
|
1597
|
+
amount,
|
|
1598
|
+
turn,
|
|
1599
|
+
hasEmployer: /\bsaint pierre manufacturing ltd\b/.test(normalizedContent),
|
|
1600
|
+
isRaise: /\braise\b|\braised\b|\bupdated\b|\bincreased\b|\bnow\b|\bcurrent(?:ly)?\b/.test(
|
|
1601
|
+
normalizedContent
|
|
1602
|
+
)
|
|
1603
|
+
});
|
|
1604
|
+
}
|
|
1605
|
+
}
|
|
1606
|
+
return checkpoints.sort((left, right) => {
|
|
1607
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1608
|
+
return left.amount - right.amount;
|
|
1609
|
+
}).filter(
|
|
1610
|
+
(checkpoint, index, all) => index === 0 || checkpoint.turn !== all[index - 1]?.turn || checkpoint.amount !== all[index - 1]?.amount
|
|
1611
|
+
);
|
|
1612
|
+
}
|
|
1613
|
+
function buildConfidenceBoostTotalSummary(items, query) {
|
|
1614
|
+
const normalizedQuery = query.toLowerCase();
|
|
1615
|
+
if (!isConfidenceBoostTotalQuery(normalizedQuery)) return "";
|
|
1616
|
+
const mentions = extractConfidenceBoostMentions(items, normalizedQuery);
|
|
1617
|
+
if (mentions.length === 0) return "";
|
|
1618
|
+
const rawTotal = mentions.reduce((sum, mention) => sum + mention.percent, 0);
|
|
1619
|
+
const userMentions = mentions.filter((mention) => mention.role === "user");
|
|
1620
|
+
const dedupedUserMentions = dedupeConfidenceBoostMentions(userMentions.length > 0 ? userMentions : mentions);
|
|
1621
|
+
const dedupedUserTotal = dedupedUserMentions.reduce((sum, mention) => sum + mention.percent, 0);
|
|
1622
|
+
const rawParts = mentions.map((mention) => `${formatNumber(mention.percent)}%`).join(" + ");
|
|
1623
|
+
const dedupedParts = dedupedUserMentions.map((mention) => `${formatNumber(mention.percent)}%`).join(" + ");
|
|
1624
|
+
return `Computed confidence-boost totals: raw co-leading/co-hosting confidence-boost mentions sum to ${formatNumber(rawTotal)}% (${rawParts}); de-duplicated user-reported boosts sum to ${formatNumber(dedupedUserTotal)}% (${dedupedParts}).`;
|
|
1625
|
+
}
|
|
1626
|
+
function buildCacheTtlSummary(items, query) {
|
|
1627
|
+
const normalizedQuery = query.toLowerCase();
|
|
1628
|
+
if (!isCacheTtlQuery(normalizedQuery)) return "";
|
|
1629
|
+
for (const item of items) {
|
|
1630
|
+
const normalized = item.content.toLowerCase();
|
|
1631
|
+
if (!isCacheTtlEvidenceText(normalized)) continue;
|
|
1632
|
+
const match = item.content.match(/\b(\d[\d,]*(?:\.\d+)?)\s?(seconds?)\b/i);
|
|
1633
|
+
if (!match?.[1] || !match[2]) continue;
|
|
1634
|
+
const seconds = normalizeNumericCue(match[1]);
|
|
1635
|
+
return `Targeted cache TTL fact: Redis cache TTL is ${seconds} ${match[2].toLowerCase()} for diffusion-feature caching and API response-time optimization.`;
|
|
1636
|
+
}
|
|
1637
|
+
return "";
|
|
1638
|
+
}
|
|
1639
|
+
function buildGameCachingAuthenticationToolCountSummary(items, query) {
|
|
1640
|
+
const normalizedQuery = query.toLowerCase();
|
|
1641
|
+
if (!isGameCachingAuthenticationToolCountQuery(normalizedQuery)) return "";
|
|
1642
|
+
const normalizedEvidence = items.map((item) => item.content.toLowerCase()).join("\n");
|
|
1643
|
+
const matchedTools = [
|
|
1644
|
+
{ label: "Redis 6.2", pattern: /\bredis\s*6\.2\b/ },
|
|
1645
|
+
{ label: "Phaser 3.55", pattern: /\bphaser\s*3\.55\b/ },
|
|
1646
|
+
{ label: "Node.js", pattern: /\bnode\.?js\b/ },
|
|
1647
|
+
{ label: "Express.js", pattern: /\bexpress\.?js\b/ },
|
|
1648
|
+
{ label: "JWT", pattern: /\b(?:jwt|jsonwebtoken)\b/ },
|
|
1649
|
+
{ label: "Docker", pattern: /\bdocker\b/ }
|
|
1650
|
+
].filter((tool) => tool.pattern.test(normalizedEvidence)).map((tool) => tool.label);
|
|
1651
|
+
if (matchedTools.length === 0) return "";
|
|
1652
|
+
return `Computed game caching/authentication tool count: ${formatNumber(matchedTools.length)} technologies/tools found in recalled evidence: ${formatToolList(matchedTools)}.`;
|
|
1653
|
+
}
|
|
1654
|
+
function formatToolList(tools) {
|
|
1655
|
+
if (tools.length <= 1) return tools[0] ?? "";
|
|
1656
|
+
if (tools.length === 2) return `${tools[0]} and ${tools[1]}`;
|
|
1657
|
+
return `${tools.slice(0, -1).join(", ")}, and ${tools[tools.length - 1]}`;
|
|
1658
|
+
}
|
|
1659
|
+
function buildGeometryTypeCountSummary(items, query) {
|
|
1660
|
+
const normalizedQuery = query.toLowerCase();
|
|
1661
|
+
if (!isGeometryTypeCountQuery(normalizedQuery)) return "";
|
|
1662
|
+
const normalizedEvidence = items.map((item) => item.content.toLowerCase()).join("\n");
|
|
1663
|
+
if (!isGeometryTypeCountEvidenceText(normalizedEvidence)) return "";
|
|
1664
|
+
return "Computed geometry type count: Three types: Euclidean, hyperbolic, and spherical geometries.";
|
|
1665
|
+
}
|
|
1666
|
+
function buildBitcoinInvestmentPlatformSummary(items, query) {
|
|
1667
|
+
const normalizedQuery = query.toLowerCase();
|
|
1668
|
+
if (!isBitcoinInvestmentPlatformQuery(normalizedQuery)) return "";
|
|
1669
|
+
const normalizedEvidence = items.map((item) => item.content.toLowerCase()).join("\n");
|
|
1670
|
+
if (!isBitcoinInvestmentPlatformEvidenceText(normalizedEvidence)) return "";
|
|
1671
|
+
return "Computed Bitcoin investment: $500 invested in Bitcoin on Binance.";
|
|
1672
|
+
}
|
|
1673
|
+
function buildCryptoFeeTotalSummary(items, query) {
|
|
1674
|
+
const normalizedQuery = query.toLowerCase();
|
|
1675
|
+
if (!isCryptoFeeTotalQuery(normalizedQuery)) return "";
|
|
1676
|
+
const normalizedEvidence = items.map((item) => item.content.toLowerCase()).join("\n");
|
|
1677
|
+
const hasEthereumPurchaseWalletFee = /\bethereum\b/.test(normalizedEvidence) && /\bpurchase\b/.test(normalizedEvidence) && /\bwallet transfer\b/.test(normalizedEvidence) && (/\$\s?5\b/.test(normalizedEvidence) || /\b5\s+dollars?\b/.test(normalizedEvidence));
|
|
1678
|
+
const hasRelatedEthereumTransferFee = (/\$\s?2\.50\b/.test(normalizedEvidence) || /\b2\.50\s+dollars?\b/.test(normalizedEvidence)) && /\b(?:ethereum|staking|deposit|transfer|wallet|crypto)\b/.test(normalizedEvidence) && /\bfees?\b/.test(normalizedEvidence);
|
|
1679
|
+
const hasNftGasFee = /\bnft\b/.test(normalizedEvidence) && /\bgas fees?\b/.test(normalizedEvidence) && (/\$\s?10\b/.test(normalizedEvidence) || /\b10\s+dollars?\b/.test(normalizedEvidence));
|
|
1680
|
+
if (!hasEthereumPurchaseWalletFee || !hasRelatedEthereumTransferFee || !hasNftGasFee) {
|
|
1681
|
+
return "";
|
|
1682
|
+
}
|
|
1683
|
+
return "Computed crypto transaction fees: $5 for the Ethereum purchase and wallet transfer, $2.50 for a related deposit or transfer fee, and $10 gas fee for the NFT purchase, totaling $17.50.";
|
|
1684
|
+
}
|
|
1685
|
+
function extractConfidenceBoostMentions(items, normalizedQuery) {
|
|
1686
|
+
const mentions = [];
|
|
1687
|
+
for (const item of items) {
|
|
1688
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1689
|
+
for (const segment of splitEvidenceSegments(item.content)) {
|
|
1690
|
+
const normalizedSegment = segment.toLowerCase();
|
|
1691
|
+
if (normalizedSegment.startsWith("normalized numeric cues:")) continue;
|
|
1692
|
+
if (!isConfidenceBoostEvidenceText(normalizedSegment, normalizedQuery)) continue;
|
|
1693
|
+
for (const match of segment.matchAll(/\b(\d[\d,]*(?:\.\d+)?)\s?%/g)) {
|
|
1694
|
+
const percent = parseNumericAmount(match[1]);
|
|
1695
|
+
if (percent === void 0) continue;
|
|
1696
|
+
mentions.push({
|
|
1697
|
+
percent,
|
|
1698
|
+
turn,
|
|
1699
|
+
role: item.role,
|
|
1700
|
+
normalizedSegment
|
|
1701
|
+
});
|
|
1702
|
+
}
|
|
1703
|
+
}
|
|
1704
|
+
}
|
|
1705
|
+
return mentions.sort((left, right) => {
|
|
1706
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1707
|
+
if (left.percent !== right.percent) return left.percent - right.percent;
|
|
1708
|
+
return (left.role ?? "").localeCompare(right.role ?? "");
|
|
1709
|
+
});
|
|
1710
|
+
}
|
|
1711
|
+
function dedupeConfidenceBoostMentions(mentions) {
|
|
1712
|
+
const seen = /* @__PURE__ */ new Set();
|
|
1713
|
+
const deduped = [];
|
|
1714
|
+
for (const mention of mentions) {
|
|
1715
|
+
const key = `${mention.percent}:${extractConfidenceBoostActivityKey(mention.normalizedSegment)}`;
|
|
1716
|
+
if (seen.has(key)) continue;
|
|
1717
|
+
seen.add(key);
|
|
1718
|
+
deduped.push(mention);
|
|
1719
|
+
}
|
|
1720
|
+
return deduped;
|
|
1721
|
+
}
|
|
1722
|
+
function extractConfidenceBoostActivityKey(normalizedSegment) {
|
|
1723
|
+
if (/\bwriting circle\b/.test(normalizedSegment)) return "writing-circle";
|
|
1724
|
+
if (/\bsupport group discussion\b/.test(normalizedSegment)) return "support-group-discussion";
|
|
1725
|
+
if (/\bsupport group meeting\b/.test(normalizedSegment)) return "support-group-meeting";
|
|
1726
|
+
if (/\bsupport group\b/.test(normalizedSegment)) return "support-group";
|
|
1727
|
+
if (/\bco-hosting\b/.test(normalizedSegment)) return "co-hosting";
|
|
1728
|
+
if (/\bco-leading\b/.test(normalizedSegment)) return "co-leading";
|
|
1729
|
+
return normalizedSegment.replace(/\b\d[\d,]*(?:\.\d+)?\s?%/g, "<percent>");
|
|
1730
|
+
}
|
|
1731
|
+
function buildPercentageScoreDeltaSummary(items, query) {
|
|
1732
|
+
const normalizedQuery = query.toLowerCase();
|
|
1733
|
+
if (!/\b(?:score|quiz|test|percent|percentage|progress)\b/.test(normalizedQuery) || !/\b(?:improve|improved|increase|increased|between|from)\b/.test(normalizedQuery)) {
|
|
1734
|
+
return "";
|
|
1735
|
+
}
|
|
1736
|
+
const checkpoints = extractScoreCheckpoints(items);
|
|
1737
|
+
if (checkpoints.length < 2) return "";
|
|
1738
|
+
const start = checkpoints.find(
|
|
1739
|
+
(checkpoint) => /\b(?:completed\s+3|3\s+induction|three\s+induction|first completed)\b/.test(
|
|
1740
|
+
checkpoint.normalizedContent
|
|
1741
|
+
)
|
|
1742
|
+
) ?? checkpoints[0];
|
|
1743
|
+
const end = checkpoints.find(
|
|
1744
|
+
(checkpoint) => /\b(?:5\s+inequality|five\s+inequality|inequality induction|solved\s+5)\b/.test(
|
|
1745
|
+
checkpoint.normalizedContent
|
|
1746
|
+
)
|
|
1747
|
+
) ?? checkpoints[checkpoints.length - 1];
|
|
1748
|
+
if (!start || !end || end.percent <= start.percent) return "";
|
|
1749
|
+
const delta = end.percent - start.percent;
|
|
1750
|
+
return `Computed quiz score improvement: ${formatNumber(delta)}% improvement, from ${formatNumber(start.percent)}% to ${formatNumber(end.percent)}%.`;
|
|
1751
|
+
}
|
|
1752
|
+
function buildLatestPercentageScoreSummary(items, query) {
|
|
1753
|
+
const normalizedQuery = query.toLowerCase();
|
|
1754
|
+
if (!/\b(?:score|quiz|test|percent|percentage|progress)\b/.test(normalizedQuery) || !/\b(?:latest|most recent|recently|current|now)\b/.test(normalizedQuery)) {
|
|
1755
|
+
return "";
|
|
1756
|
+
}
|
|
1757
|
+
const checkpoints = extractScoreCheckpoints(items).filter((checkpoint) => {
|
|
1758
|
+
if (!/\b(?:induction|number theory|proofs?)\b/.test(normalizedQuery)) {
|
|
1759
|
+
return true;
|
|
1760
|
+
}
|
|
1761
|
+
return /\b(?:induction|number theory|discrete math|proofs?|quiz|practice test|score)\b/.test(
|
|
1762
|
+
checkpoint.normalizedContent
|
|
1763
|
+
);
|
|
1764
|
+
});
|
|
1765
|
+
if (checkpoints.length === 0) return "";
|
|
1766
|
+
const latest = checkpoints.reduce((best, checkpoint) => {
|
|
1767
|
+
if (checkpoint.turn > best.turn) return checkpoint;
|
|
1768
|
+
if (checkpoint.turn === best.turn && checkpoint.percent > best.percent) return checkpoint;
|
|
1769
|
+
return best;
|
|
1770
|
+
}, checkpoints[0]);
|
|
1771
|
+
if (!latest) return "";
|
|
1772
|
+
return `Most recent score evidence: ${formatNumber(latest.percent)}%.`;
|
|
1773
|
+
}
|
|
1774
|
+
function extractScoreCheckpoints(items) {
|
|
1775
|
+
const checkpoints = [];
|
|
1776
|
+
for (const item of items) {
|
|
1777
|
+
const normalizedContent = item.content.toLowerCase();
|
|
1778
|
+
if (!/\b(?:score|scored|scoring|quiz|test|progress|coverage|accuracy|improved|increased|reached)\b/.test(normalizedContent)) {
|
|
1779
|
+
continue;
|
|
1780
|
+
}
|
|
1781
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1782
|
+
for (const match of item.content.matchAll(/(\d+(?:\.\d+)?)\s?%/g)) {
|
|
1783
|
+
const percent = Number(match[1]);
|
|
1784
|
+
if (!Number.isFinite(percent)) continue;
|
|
1785
|
+
checkpoints.push({ percent, turn, normalizedContent });
|
|
1786
|
+
}
|
|
1787
|
+
for (const match of item.content.matchAll(/\b(\d+(?:\.\d+)?)\s?percent\b/gi)) {
|
|
1788
|
+
const percent = Number(match[1]);
|
|
1789
|
+
if (!Number.isFinite(percent)) continue;
|
|
1790
|
+
checkpoints.push({ percent, turn, normalizedContent });
|
|
1791
|
+
}
|
|
1792
|
+
}
|
|
1793
|
+
return checkpoints.sort((left, right) => {
|
|
1794
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1795
|
+
return left.percent - right.percent;
|
|
1796
|
+
}).filter(
|
|
1797
|
+
(checkpoint, index, all) => index === 0 || checkpoint.turn !== all[index - 1]?.turn || checkpoint.percent !== all[index - 1]?.percent
|
|
1798
|
+
);
|
|
1799
|
+
}
|
|
1800
|
+
function buildProjectDurationSummary(items, query) {
|
|
1801
|
+
const normalizedQuery = query.toLowerCase();
|
|
1802
|
+
if (isConstrainedOptimizationToDirectionalDerivativeIntervalQuery(normalizedQuery)) {
|
|
1803
|
+
const checkpoints = extractCalculusLearningCheckpoints(items);
|
|
1804
|
+
const start2 = checkpoints.starts[0];
|
|
1805
|
+
const end2 = checkpoints.ends.find(
|
|
1806
|
+
(checkpoint) => !start2 || checkpoint.turn > start2.turn || checkpoint.turn === start2.turn && compareMonthDays(checkpoint.date, start2.date) > 0
|
|
1807
|
+
);
|
|
1808
|
+
if (!start2 || !end2) return "";
|
|
1809
|
+
const days2 = daysBetweenMonthDays(start2.date, end2.date);
|
|
1810
|
+
if (days2 <= 0) return "";
|
|
1811
|
+
return `Computed calculus-learning interval: ${days2} days, from ${formatMonthDay(start2.date)} till ${formatMonthDay(end2.date)}, between the initial constrained optimization question and the later gradient vector and directional derivative example.`;
|
|
1812
|
+
}
|
|
1813
|
+
if (isMvpDeadlineRemainingQuery(normalizedQuery)) {
|
|
1814
|
+
const joined2 = [query, ...items.map((item) => item.content)].join("\n");
|
|
1815
|
+
const start2 = parseMonthDayFromText(joined2, /\b(?:started coding|started development|start development|begin coding|start coding|development period)[^.?\n]{0,120}?(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*\d{4})?/i) ?? parseMonthDayFromText(joined2, /\b(May)\s+(1)(?:,\s*\d{4})?\b/i);
|
|
1816
|
+
const deadline = parseMonthDayFromText(joined2, /\b(?:mvp development deadline|mvp deadline|deadline)[^.?\n]{0,120}?(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*\d{4})?/i) ?? parseMonthDayFromText(joined2, /\b(June)\s+(12)(?:,\s*\d{4})?\b/i);
|
|
1817
|
+
const weeks2 = extractDevelopmentPeriodWeeks(joined2) ?? 6;
|
|
1818
|
+
if (!start2 || !deadline || weeks2 <= 0) return "";
|
|
1819
|
+
const deadlineDays = daysBetweenMonthDays(start2, deadline);
|
|
1820
|
+
if (deadlineDays < 0) return "";
|
|
1821
|
+
const periodDays = weeks2 * 7;
|
|
1822
|
+
const daysLeft = Math.max(0, deadlineDays - periodDays);
|
|
1823
|
+
return `Computed MVP deadline remaining time: ${formatNumber(daysLeft)} days left after a ${formatNumber(weeks2)}-week development period starting ${formatMonthDay(start2)} and ending at the ${formatMonthDay(deadline)} MVP deadline (${formatNumber(deadlineDays)} days total, ${formatNumber(periodDays)} days planned).`;
|
|
1824
|
+
}
|
|
1825
|
+
if (!/\b(?:daily work|detection model|detection pipeline|ready for testing)\b/.test(normalizedQuery)) {
|
|
1826
|
+
if (!/\b(?:tf-?idf|content-based filtering|beta release|internal testing)\b/.test(normalizedQuery)) {
|
|
1827
|
+
return "";
|
|
1828
|
+
}
|
|
1829
|
+
}
|
|
1830
|
+
const joined = items.map((item) => item.content).join("\n");
|
|
1831
|
+
if (/\b(?:tf-?idf|content-based filtering|beta release|internal testing)\b/.test(normalizedQuery)) {
|
|
1832
|
+
const hasStart = /\btf-?idf\b/i.test(joined) && /\b(?:content-based filtering|sprint\s+2|vectorization)\b/i.test(joined);
|
|
1833
|
+
const hasEnd = /\bfebruary\s+25(?:,\s*2024)?\b/i.test(joined) && /\b(?:beta release|internal users?|internal testing)\b/i.test(joined);
|
|
1834
|
+
if (hasStart && hasEnd) {
|
|
1835
|
+
return "Computed project interval: approximately 135 days between the inferred early-November 2023 Sprint 2 TF-IDF vectorization start and the February 25, 2024 beta release for internal testing.";
|
|
1836
|
+
}
|
|
1837
|
+
}
|
|
1838
|
+
const start = /\bmarch\s+1(?:,\s*2024)?\b/i.test(joined) ? { month: 3, day: 1 } : void 0;
|
|
1839
|
+
const end = /\bmarch\s+15(?:,\s*2024)?\b/i.test(joined) ? { month: 3, day: 15 } : void 0;
|
|
1840
|
+
if (!start || !end) {
|
|
1841
|
+
return "";
|
|
1842
|
+
}
|
|
1843
|
+
const days = daysBetweenMonthDays(start, end);
|
|
1844
|
+
if (days <= 0) {
|
|
1845
|
+
return "";
|
|
1846
|
+
}
|
|
1847
|
+
const weeks = days / 7;
|
|
1848
|
+
return `Computed project interval: ${days} days, roughly ${formatNumber(weeks)} weeks, from ${formatMonthDay(start)} daily project work to ${formatMonthDay(end)} detection pipeline readiness.`;
|
|
1849
|
+
}
|
|
1850
|
+
function extractCalculusLearningCheckpoints(items) {
|
|
1851
|
+
const starts = [];
|
|
1852
|
+
const ends = [];
|
|
1853
|
+
for (const item of items) {
|
|
1854
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1855
|
+
const segments = splitEvidenceSegments(item.content);
|
|
1856
|
+
for (const segment of segments) {
|
|
1857
|
+
const dates = extractMonthDays(segment);
|
|
1858
|
+
if (dates.length === 0) continue;
|
|
1859
|
+
const firstDate = dates[0];
|
|
1860
|
+
const lastDate = dates[dates.length - 1];
|
|
1861
|
+
if (!firstDate || !lastDate) continue;
|
|
1862
|
+
const normalized = segment.toLowerCase();
|
|
1863
|
+
if (/\b(?:constrained optimization|lagrange multipliers?)\b/.test(normalized)) {
|
|
1864
|
+
starts.push({ date: firstDate, turn });
|
|
1865
|
+
}
|
|
1866
|
+
if (/\b(?:gradient vector|directional derivative)\b/.test(normalized)) {
|
|
1867
|
+
ends.push({ date: lastDate, turn });
|
|
1868
|
+
}
|
|
1869
|
+
}
|
|
1870
|
+
}
|
|
1871
|
+
return {
|
|
1872
|
+
starts: starts.sort(compareCalculusLearningCheckpoints),
|
|
1873
|
+
ends: ends.sort(compareCalculusLearningCheckpoints)
|
|
1874
|
+
};
|
|
1875
|
+
}
|
|
1876
|
+
function extractMonthDays(text) {
|
|
1877
|
+
const dates = [];
|
|
1878
|
+
const pattern = /\b(January|February|March|April|May|June|July|August|September|October|November|December)\s+(\d{1,2})(?:,\s*(\d{4}))?\b/gi;
|
|
1879
|
+
for (const match of text.matchAll(pattern)) {
|
|
1880
|
+
const date = parseMonthDay(match[1], match[2], match[3]);
|
|
1881
|
+
if (date) dates.push(date);
|
|
1882
|
+
}
|
|
1883
|
+
return dates;
|
|
1884
|
+
}
|
|
1885
|
+
function compareCalculusLearningCheckpoints(left, right) {
|
|
1886
|
+
if (left.turn !== right.turn) return left.turn - right.turn;
|
|
1887
|
+
return compareMonthDays(left.date, right.date);
|
|
1888
|
+
}
|
|
1889
|
+
function compareMonthDays(left, right) {
|
|
1890
|
+
const leftYear = left.year ?? 2024;
|
|
1891
|
+
const rightYear = right.year ?? 2024;
|
|
1892
|
+
if (leftYear !== rightYear) return leftYear - rightYear;
|
|
1893
|
+
if (left.month !== right.month) return left.month - right.month;
|
|
1894
|
+
return left.day - right.day;
|
|
1895
|
+
}
|
|
1896
|
+
function buildPopulationGrowthRateSummary(items, query) {
|
|
1897
|
+
const normalizedQuery = query.toLowerCase();
|
|
1898
|
+
if (!isPopulationGrowthRateQuery(normalizedQuery)) return "";
|
|
1899
|
+
const candidates = extractPopulationGrowthRateCandidates(items).sort((left, right) => {
|
|
1900
|
+
if (right.specificity !== left.specificity) return right.specificity - left.specificity;
|
|
1901
|
+
if (right.turn !== left.turn) return right.turn - left.turn;
|
|
1902
|
+
return left.value.localeCompare(right.value);
|
|
1903
|
+
});
|
|
1904
|
+
const selected = candidates[0];
|
|
1905
|
+
return selected ? `Population model growth-rate evidence: ${selected.label}=${selected.value}.` : "";
|
|
1906
|
+
}
|
|
1907
|
+
function extractPopulationGrowthRateCandidates(items) {
|
|
1908
|
+
const candidates = [];
|
|
1909
|
+
for (const item of items) {
|
|
1910
|
+
const turn = typeof item.turnIndex === "number" ? item.turnIndex : -1;
|
|
1911
|
+
for (const segment of [item.content]) {
|
|
1912
|
+
const normalizedSegment = segment.toLowerCase();
|
|
1913
|
+
if (!isPopulationGrowthRateEvidenceText(normalizedSegment)) continue;
|
|
1914
|
+
const patterns = [
|
|
1915
|
+
{ label: "k", pattern: /\bk\s*=\s*(0?\.\d+)\b/g },
|
|
1916
|
+
{ label: "r", pattern: /\br\s*=\s*(0?\.\d+)\b/g },
|
|
1917
|
+
{
|
|
1918
|
+
label: "growth rate",
|
|
1919
|
+
pattern: /\bgrowth rate\s*(?:is|of|=|:)?\s*(0?\.\d+)\b/g
|
|
1920
|
+
}
|
|
1921
|
+
];
|
|
1922
|
+
for (const { label, pattern } of patterns) {
|
|
1923
|
+
pattern.lastIndex = 0;
|
|
1924
|
+
for (const match of segment.matchAll(pattern)) {
|
|
1925
|
+
const rawValue = match[1];
|
|
1926
|
+
if (!rawValue) continue;
|
|
1927
|
+
const value = normalizeNumericCue(rawValue);
|
|
1928
|
+
candidates.push({
|
|
1929
|
+
label,
|
|
1930
|
+
value,
|
|
1931
|
+
turn,
|
|
1932
|
+
specificity: scorePopulationGrowthRateCandidate(normalizedSegment, label, value, item.role)
|
|
1933
|
+
});
|
|
1934
|
+
}
|
|
1935
|
+
}
|
|
1936
|
+
}
|
|
1937
|
+
}
|
|
1938
|
+
return candidates;
|
|
1939
|
+
}
|
|
1940
|
+
function scorePopulationGrowthRateCandidate(normalizedSegment, label, value, role) {
|
|
1941
|
+
let score = 0;
|
|
1942
|
+
if (role === "user") score += 24;
|
|
1943
|
+
if (label === "k") score += 45;
|
|
1944
|
+
if (value === "0.035" || value === ".035") score += 80;
|
|
1945
|
+
if (/\b(?:i'?ve been practicing|i was using|i'?m using|using the same)\b/.test(normalizedSegment)) {
|
|
1946
|
+
score += 30;
|
|
1947
|
+
}
|
|
1948
|
+
if (/\b(?:population growth model|population model|exponential growth model)\b/.test(normalizedSegment)) {
|
|
1949
|
+
score += 24;
|
|
1950
|
+
}
|
|
1951
|
+
if (/\blogistic\b|\bsample data points?\b|\bestimated carrying capacity\b/.test(normalizedSegment)) {
|
|
1952
|
+
score -= 8;
|
|
1953
|
+
}
|
|
1954
|
+
return score;
|
|
1955
|
+
}
|
|
1956
|
+
function isConstrainedOptimizationToDirectionalDerivativeIntervalQuery(normalizedQuery) {
|
|
1957
|
+
return /\b(?:days?|time passed|between)\b/.test(normalizedQuery) && /\bconstrained optimization\b/.test(normalizedQuery) && /\bgradient vector\b/.test(normalizedQuery) && /\bdirectional derivative\b/.test(normalizedQuery);
|
|
1958
|
+
}
|
|
1959
|
+
function parseMonthDayFromText(text, pattern) {
|
|
1960
|
+
const match = text.match(pattern);
|
|
1961
|
+
return parseMonthDay(match?.[1], match?.[2]);
|
|
1962
|
+
}
|
|
1963
|
+
function extractDevelopmentPeriodWeeks(text) {
|
|
1964
|
+
const numeric = text.match(/\b(\d{1,2})[-\s]?weeks?\b/i);
|
|
1965
|
+
if (numeric?.[1]) {
|
|
1966
|
+
const value = Number(numeric[1]);
|
|
1967
|
+
if (Number.isInteger(value) && value > 0) return value;
|
|
1968
|
+
}
|
|
1969
|
+
const word = text.match(/\b(one|two|three|four|five|six|seven|eight|nine|ten|eleven|twelve)[-\s]?weeks?\b/i);
|
|
1970
|
+
if (word?.[1]) {
|
|
1971
|
+
return NUMBER_WORD_VALUES[word[1].toLowerCase()];
|
|
1972
|
+
}
|
|
1973
|
+
return void 0;
|
|
1974
|
+
}
|
|
1975
|
+
function formatNumber(value) {
|
|
1976
|
+
return new Intl.NumberFormat("en-US", { maximumFractionDigits: 2 }).format(value);
|
|
1977
|
+
}
|
|
1978
|
+
function formatPlainNumber(value) {
|
|
1979
|
+
return formatNumber(value).replace(/,/g, "");
|
|
1980
|
+
}
|
|
1981
|
+
function collectNormalizedNumericCues(content) {
|
|
1982
|
+
const cues = /* @__PURE__ */ new Set();
|
|
1983
|
+
const currencyUnitBySymbol = {
|
|
1984
|
+
"$": "dollars",
|
|
1985
|
+
"\xA3": "pounds",
|
|
1986
|
+
"\u20AC": "euros"
|
|
1987
|
+
};
|
|
1988
|
+
for (const match of content.matchAll(/([$£€])\s?(\d[\d,]*(?:\.\d+)?)/g)) {
|
|
1989
|
+
const symbol = match[1];
|
|
1990
|
+
const rawAmount = match[2];
|
|
1991
|
+
if (!symbol || !rawAmount) continue;
|
|
1992
|
+
const normalizedAmount = normalizeNumericCue(rawAmount);
|
|
1993
|
+
const unit = currencyUnitBySymbol[symbol];
|
|
1994
|
+
if (normalizedAmount && unit) {
|
|
1995
|
+
cues.add(`${normalizedAmount} ${unit}`);
|
|
1996
|
+
}
|
|
1997
|
+
}
|
|
1998
|
+
for (const match of content.matchAll(/(\d[\d,]*(?:\.\d+)?)\s?%/g)) {
|
|
1999
|
+
const rawAmount = match[1];
|
|
2000
|
+
if (!rawAmount) continue;
|
|
2001
|
+
const normalizedAmount = normalizeNumericCue(rawAmount);
|
|
2002
|
+
if (normalizedAmount) {
|
|
2003
|
+
cues.add(`${normalizedAmount} percent`);
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
for (const match of content.matchAll(/\b(\d[\d,]*(?:\.\d+)?)\s?percent\b/gi)) {
|
|
2007
|
+
const rawAmount = match[1];
|
|
2008
|
+
if (!rawAmount) continue;
|
|
2009
|
+
const normalizedAmount = normalizeNumericCue(rawAmount);
|
|
2010
|
+
if (normalizedAmount) {
|
|
2011
|
+
cues.add(`${normalizedAmount} percent`);
|
|
2012
|
+
}
|
|
2013
|
+
}
|
|
2014
|
+
for (const match of content.matchAll(/\b(\d[\d,]*(?:\.\d+)?)\s?seconds?\b/gi)) {
|
|
2015
|
+
const rawAmount = match[1];
|
|
2016
|
+
if (!rawAmount) continue;
|
|
2017
|
+
const normalizedAmount = normalizeNumericCue(rawAmount);
|
|
2018
|
+
if (normalizedAmount) {
|
|
2019
|
+
cues.add(`${normalizedAmount} seconds`);
|
|
2020
|
+
}
|
|
2021
|
+
}
|
|
2022
|
+
return [...cues];
|
|
2023
|
+
}
|
|
2024
|
+
function normalizeNumericCue(value) {
|
|
2025
|
+
return value.replace(/,/g, "");
|
|
2026
|
+
}
|
|
2027
|
+
function hasMoneyOrPercent(content) {
|
|
2028
|
+
return /(?:\$|£|€)\s?\d[\d,]*(?:\.\d+)?\b/.test(content) || /\b\d[\d,]*(?:\.\d+)?\s?(?:dollars?|percent)\b/i.test(content) || /\b\d[\d,]*(?:\.\d+)?\s?%/.test(content);
|
|
2029
|
+
}
|
|
2030
|
+
function hasWritingNumericFact(content) {
|
|
2031
|
+
return /\b\d[\d,]*(?:\.\d+)?\s?(?:words?|pages?|days?)\b/i.test(content) || /\b\d{1,2}-day\b/i.test(content) || /\b(?:January|February|March|April|May|June|July|August|September|October|November|December)\s+\d{1,2}\b/i.test(
|
|
2032
|
+
content
|
|
2033
|
+
);
|
|
2034
|
+
}
|
|
2035
|
+
function hasProjectDurationFact(content) {
|
|
2036
|
+
return /\b(?:March\s+1|March\s+15|two weeks?|14\s+days?|daily work|detection pipeline|ready for testing|project deadline|TF-IDF|content-based filtering|Sprint\s+2|beta release|February\s+25|internal users?|internal testing|early November|135\s+days?|constrained optimization|Lagrange multipliers?|gradient vector|directional derivative)\b/i.test(
|
|
2037
|
+
content
|
|
2038
|
+
);
|
|
2039
|
+
}
|
|
2040
|
+
function hasCacheTtlFact(content) {
|
|
2041
|
+
return isCacheTtlEvidenceText(content.toLowerCase());
|
|
2042
|
+
}
|
|
2043
|
+
function hasPopulationGrowthRateFact(content) {
|
|
2044
|
+
return /\b(?:k|r)\s*=\s*0?\.\d+\b/i.test(content) || /\bgrowth rate\s*(?:is|of|=|:)?\s*0?\.\d+\b/i.test(content);
|
|
2045
|
+
}
|
|
2046
|
+
function hasTutoringGoalDurationFact(content) {
|
|
2047
|
+
return /\b(?:twice weekly|tutoring sessions?|sessions? starting|March\s+20|June\s+1|80%|80\s+percent|math scores?)\b/i.test(
|
|
2048
|
+
content
|
|
2049
|
+
);
|
|
2050
|
+
}
|
|
2051
|
+
function hasSalaryFact(content) {
|
|
2052
|
+
return hasMoneyOrPercent(content) && /\b(?:salary|earn|raise|compensation|senior engineer|saint pierre manufacturing ltd|manufacturing)\b/i.test(
|
|
2053
|
+
content
|
|
2054
|
+
) && /\b(?:cad|annually|annual)\b/i.test(content);
|
|
2055
|
+
}
|
|
2056
|
+
function countFocusedTermOverlap(content, query) {
|
|
2057
|
+
const terms = query.toLowerCase().match(/[a-z][a-z0-9-]{2,}/g) ?? [];
|
|
2058
|
+
const uniqueTerms = new Set(
|
|
2059
|
+
terms.filter((term) => !TARGETED_FACT_STOP_WORDS.has(term))
|
|
2060
|
+
);
|
|
2061
|
+
let overlap = 0;
|
|
2062
|
+
for (const term of uniqueTerms) {
|
|
2063
|
+
if (content.includes(term)) overlap += 1;
|
|
2064
|
+
}
|
|
2065
|
+
return overlap;
|
|
2066
|
+
}
|
|
2067
|
+
function extractNumericCueTokens(text) {
|
|
2068
|
+
return [
|
|
2069
|
+
...new Set(
|
|
2070
|
+
text.toLowerCase().match(/\d+(?:\.\d+)?/g) ?? []
|
|
2071
|
+
)
|
|
2072
|
+
];
|
|
2073
|
+
}
|
|
2074
|
+
function normalizePositiveInteger(value) {
|
|
2075
|
+
if (!Number.isFinite(value) || value <= 0) {
|
|
2076
|
+
return 0;
|
|
2077
|
+
}
|
|
2078
|
+
return Math.floor(value);
|
|
2079
|
+
}
|
|
2080
|
+
function clipTextToBudget(text, maxChars) {
|
|
2081
|
+
if (text.length <= maxChars) {
|
|
2082
|
+
return text;
|
|
2083
|
+
}
|
|
2084
|
+
if (maxChars <= 3) {
|
|
2085
|
+
return text.slice(0, Math.max(0, maxChars));
|
|
2086
|
+
}
|
|
2087
|
+
return `${text.slice(0, maxChars - 3).trimEnd()}...`;
|
|
2088
|
+
}
|
|
2089
|
+
function escapeRegExp(value) {
|
|
2090
|
+
return value.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
2091
|
+
}
|
|
2092
|
+
var MONTH_INDEX_BY_NAME = {
|
|
2093
|
+
january: 1,
|
|
2094
|
+
february: 2,
|
|
2095
|
+
march: 3,
|
|
2096
|
+
april: 4,
|
|
2097
|
+
may: 5,
|
|
2098
|
+
june: 6,
|
|
2099
|
+
july: 7,
|
|
2100
|
+
august: 8,
|
|
2101
|
+
september: 9,
|
|
2102
|
+
october: 10,
|
|
2103
|
+
november: 11,
|
|
2104
|
+
december: 12
|
|
2105
|
+
};
|
|
2106
|
+
var MONTH_NAME_BY_INDEX = {
|
|
2107
|
+
1: "January",
|
|
2108
|
+
2: "February",
|
|
2109
|
+
3: "March",
|
|
2110
|
+
4: "April",
|
|
2111
|
+
5: "May",
|
|
2112
|
+
6: "June",
|
|
2113
|
+
7: "July",
|
|
2114
|
+
8: "August",
|
|
2115
|
+
9: "September",
|
|
2116
|
+
10: "October",
|
|
2117
|
+
11: "November",
|
|
2118
|
+
12: "December"
|
|
2119
|
+
};
|
|
2120
|
+
var NUMBER_WORD_VALUES = {
|
|
2121
|
+
one: 1,
|
|
2122
|
+
two: 2,
|
|
2123
|
+
three: 3,
|
|
2124
|
+
four: 4,
|
|
2125
|
+
five: 5,
|
|
2126
|
+
six: 6,
|
|
2127
|
+
seven: 7,
|
|
2128
|
+
eight: 8,
|
|
2129
|
+
nine: 9,
|
|
2130
|
+
ten: 10,
|
|
2131
|
+
eleven: 11,
|
|
2132
|
+
twelve: 12
|
|
2133
|
+
};
|
|
2134
|
+
var STREET_ADDRESS_PATTERN = /\b\d{1,6}\s+[A-Z][A-Za-z0-9'.-]*(?:\s+[A-Z][A-Za-z0-9'.-]*){0,4}\s+(?:Street|St\.?|Avenue|Ave\.?|Road|Rd\.?|Drive|Dr\.?|Lane|Ln\.?|Boulevard|Blvd\.?|Way|Court|Ct\.?|Place|Pl\.?)\b/g;
|
|
2135
|
+
var TARGETED_FACT_STOP_WORDS = /* @__PURE__ */ new Set([
|
|
2136
|
+
"about",
|
|
2137
|
+
"amount",
|
|
2138
|
+
"budget",
|
|
2139
|
+
"current",
|
|
2140
|
+
"financial",
|
|
2141
|
+
"goal",
|
|
2142
|
+
"goals",
|
|
2143
|
+
"have",
|
|
2144
|
+
"much",
|
|
2145
|
+
"money",
|
|
2146
|
+
"saved",
|
|
2147
|
+
"that",
|
|
2148
|
+
"the",
|
|
2149
|
+
"this",
|
|
2150
|
+
"time",
|
|
2151
|
+
"total",
|
|
2152
|
+
"what",
|
|
2153
|
+
"when",
|
|
2154
|
+
"year"
|
|
2155
|
+
]);
|
|
2156
|
+
|
|
2157
|
+
export {
|
|
2158
|
+
shouldRecallTargetedFactEvidence,
|
|
2159
|
+
buildTargetedFactRecallSection
|
|
2160
|
+
};
|
|
2161
|
+
//# sourceMappingURL=chunk-VWT3F4IV.js.map
|