@remnic/core 1.0.1 → 1.0.3
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/LICENSE +21 -0
- package/README.md +48 -0
- package/dist/access-cli.d.ts +13 -3
- package/dist/access-cli.js +90 -75
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +10 -3
- package/dist/access-http.js +25 -18
- package/dist/access-mcp.d.ts +30 -3
- package/dist/access-mcp.js +16 -1
- package/dist/access-schema.d.ts +46 -46
- package/dist/access-schema.js +1 -1
- package/dist/access-service.d.ts +65 -4
- package/dist/access-service.js +21 -15
- package/dist/active-memory-bridge.d.ts +66 -0
- package/dist/active-memory-bridge.js +11 -0
- package/dist/active-recall.d.ts +96 -0
- package/dist/active-recall.js +308 -0
- package/dist/active-recall.js.map +1 -0
- package/dist/behavior-learner.js +1 -1
- package/dist/bootstrap.d.ts +6 -3
- package/dist/bootstrap.js +2 -2
- package/dist/boxes.js +2 -2
- package/dist/briefing.d.ts +169 -0
- package/dist/briefing.js +52 -0
- package/dist/briefing.js.map +1 -0
- package/dist/buffer.d.ts +19 -5
- package/dist/buffer.js +2 -2
- package/dist/calibration.js +6 -6
- package/dist/causal-behavior.js +5 -5
- package/dist/causal-chain.js +3 -3
- package/dist/causal-consolidation.d.ts +22 -2
- package/dist/causal-consolidation.js +36 -9
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +6 -6
- package/dist/causal-trajectory-graph.js +1 -1
- package/dist/causal-trajectory.d.ts +14 -1
- package/dist/causal-trajectory.js +5 -1
- package/dist/{chunk-KWBU5S5U.js → chunk-2ODBA7MQ.js} +9 -3
- package/dist/chunk-2ODBA7MQ.js.map +1 -0
- package/dist/{chunk-6UJQNRIO.js → chunk-2VFW5K5U.js} +93 -36
- package/dist/chunk-2VFW5K5U.js.map +1 -0
- package/dist/chunk-3PG3H5TD.js +7 -0
- package/dist/chunk-3PG3H5TD.js.map +1 -0
- package/dist/{chunk-NTTLPF7F.js → chunk-3QFQGRHO.js} +5 -5
- package/dist/chunk-4DJQYKMN.js +187 -0
- package/dist/chunk-4DJQYKMN.js.map +1 -0
- package/dist/chunk-4KAN3GZ3.js +225 -0
- package/dist/chunk-4KAN3GZ3.js.map +1 -0
- package/dist/{chunk-ORZMT74A.js → chunk-4NRAJUDS.js} +11 -1
- package/dist/chunk-4NRAJUDS.js.map +1 -0
- package/dist/{chunk-B7LOFDVE.js → chunk-4WMCPJWX.js} +8 -3
- package/dist/chunk-4WMCPJWX.js.map +1 -0
- package/dist/{chunk-G3AG3KZN.js → chunk-5IZL4DCV.js} +2 -2
- package/dist/{chunk-BRK4ODMI.js → chunk-5NPGSAVB.js} +2 -2
- package/dist/chunk-6MKAMLQL.js +16 -0
- package/dist/chunk-6MKAMLQL.js.map +1 -0
- package/dist/{chunk-ESSMF2FR.js → chunk-6PFRXT4K.js} +15 -6
- package/dist/chunk-6PFRXT4K.js.map +1 -0
- package/dist/chunk-6ZH4TU6I.js +245 -0
- package/dist/chunk-6ZH4TU6I.js.map +1 -0
- package/dist/{chunk-V4YC4LUK.js → chunk-74JR4N5J.js} +175 -63
- package/dist/chunk-74JR4N5J.js.map +1 -0
- package/dist/{chunk-L5RPWGFK.js → chunk-7DHTMOND.js} +2 -2
- package/dist/{chunk-TVVVQQAK.js → chunk-7PA4OZEU.js} +53 -11
- package/dist/chunk-7PA4OZEU.js.map +1 -0
- package/dist/{chunk-Q6FETXJA.js → chunk-7SEAZFFB.js} +2 -2
- package/dist/chunk-ALXMCZEU.js +332 -0
- package/dist/chunk-ALXMCZEU.js.map +1 -0
- package/dist/{chunk-QANCTXQF.js → chunk-AYPYCLR7.js} +3 -3
- package/dist/{chunk-WWIQTB2Y.js → chunk-BKQJBXXX.js} +9 -2
- package/dist/chunk-BKQJBXXX.js.map +1 -0
- package/dist/{chunk-LP47L3ZX.js → chunk-BTY5RRRF.js} +7 -7
- package/dist/{chunk-SCHEKPYH.js → chunk-C2EFFULQ.js} +1 -1
- package/dist/{chunk-GJR6D6KC.js → chunk-D654IBA6.js} +2 -2
- package/dist/{chunk-UV2FO7J4.js → chunk-E6K4NIEU.js} +2 -2
- package/dist/{chunk-T4WRIV2C.js → chunk-EABGC2TL.js} +2 -2
- package/dist/chunk-ECKDIK5F.js +813 -0
- package/dist/chunk-ECKDIK5F.js.map +1 -0
- package/dist/chunk-EJI5XIBB.js +232 -0
- package/dist/chunk-EJI5XIBB.js.map +1 -0
- package/dist/{chunk-ONRU4L2N.js → chunk-FEMOX5AD.js} +2 -2
- package/dist/{chunk-IFFFR3MR.js → chunk-FSFEQI74.js} +3 -3
- package/dist/chunk-G4SK7DSQ.js +121 -0
- package/dist/chunk-G4SK7DSQ.js.map +1 -0
- package/dist/{chunk-UIYZ5T3I.js → chunk-GJQPH5G3.js} +8 -8
- package/dist/{chunk-2PO5ZRKV.js → chunk-GZCUW5IC.js} +16 -3
- package/dist/chunk-GZCUW5IC.js.map +1 -0
- package/dist/{chunk-IZME7KW2.js → chunk-HITJFT7E.js} +24 -10
- package/dist/{chunk-IZME7KW2.js.map → chunk-HITJFT7E.js.map} +1 -1
- package/dist/chunk-IQT3XTKW.js +121 -0
- package/dist/chunk-IQT3XTKW.js.map +1 -0
- package/dist/{chunk-BDFZXRSO.js → chunk-J4IYOZZ5.js} +15 -2
- package/dist/chunk-J4IYOZZ5.js.map +1 -0
- package/dist/{chunk-ZKYI7UVO.js → chunk-JR4ZC3G4.js} +2 -2
- package/dist/{chunk-UCYSTFZR.js → chunk-JRNQ3RNA.js} +2 -2
- package/dist/{chunk-UYSKNO6E.js → chunk-JROGC36Y.js} +15 -4
- package/dist/chunk-JROGC36Y.js.map +1 -0
- package/dist/{chunk-GPGBSNKM.js → chunk-K4FLSOR5.js} +2 -2
- package/dist/{chunk-M5ZBBBJI.js → chunk-KEG4GNGI.js} +2 -2
- package/dist/chunk-KVE7R4CG.js +320 -0
- package/dist/chunk-KVE7R4CG.js.map +1 -0
- package/dist/{chunk-L7WO3MZ4.js → chunk-KWP7T3DP.js} +2 -2
- package/dist/chunk-LAYN4LDC.js +267 -0
- package/dist/chunk-LAYN4LDC.js.map +1 -0
- package/dist/{chunk-PGK3VUHN.js → chunk-MTLYEMJB.js} +3 -2
- package/dist/chunk-MTLYEMJB.js.map +1 -0
- package/dist/{chunk-J47FNDR7.js → chunk-MYQWXITD.js} +7 -7
- package/dist/{chunk-YNI4S5WT.js → chunk-N53K2EXC.js} +2 -2
- package/dist/{chunk-763GUIOU.js → chunk-NBNN5GOB.js} +2 -2
- package/dist/{chunk-CXWFUJR2.js → chunk-NSB3WSYS.js} +125 -6
- package/dist/chunk-NSB3WSYS.js.map +1 -0
- package/dist/{chunk-KL4CP4SB.js → chunk-O5ETUNBT.js} +17 -5
- package/dist/chunk-O5ETUNBT.js.map +1 -0
- package/dist/{chunk-OOSWAUYB.js → chunk-ODWDQNRE.js} +2 -2
- package/dist/{chunk-ISY75RLM.js → chunk-OJFGVJS6.js} +288 -7
- package/dist/chunk-OJFGVJS6.js.map +1 -0
- package/dist/{chunk-HLBYLYRD.js → chunk-PAORGQRI.js} +70 -13
- package/dist/chunk-PAORGQRI.js.map +1 -0
- package/dist/{chunk-ZJLY4QSU.js → chunk-PMB3WGDL.js} +69 -6
- package/dist/chunk-PMB3WGDL.js.map +1 -0
- package/dist/{chunk-J3BT33K7.js → chunk-POBPGDWI.js} +5 -5
- package/dist/{chunk-QWUUMMIK.js → chunk-POMSFKTB.js} +1351 -76
- package/dist/chunk-POMSFKTB.js.map +1 -0
- package/dist/{chunk-OTAVQCSF.js → chunk-PYXS46O7.js} +2 -2
- package/dist/chunk-QDW3E4RD.js +108 -0
- package/dist/chunk-QDW3E4RD.js.map +1 -0
- package/dist/{chunk-YNCQ7E4M.js → chunk-QDYXG4CS.js} +4 -3
- package/dist/chunk-QDYXG4CS.js.map +1 -0
- package/dist/{chunk-XUHI52HK.js → chunk-QKAH5B6E.js} +4 -4
- package/dist/{chunk-HLXVTBF3.js → chunk-QNJMBKFK.js} +3 -2
- package/dist/chunk-QNJMBKFK.js.map +1 -0
- package/dist/chunk-RCICHSHL.js +789 -0
- package/dist/chunk-RCICHSHL.js.map +1 -0
- package/dist/{chunk-HG2NKWR2.js → chunk-S4LX5EBI.js} +2 -2
- package/dist/{chunk-4A24LIM2.js → chunk-S75M5ZRK.js} +2 -2
- package/dist/{chunk-QCCCQT3O.js → chunk-TBBDFYXW.js} +2 -2
- package/dist/chunk-TBBDFYXW.js.map +1 -0
- package/dist/{chunk-U4PV25RD.js → chunk-U2IQTSBY.js} +1 -1
- package/dist/chunk-U2IQTSBY.js.map +1 -0
- package/dist/chunk-U66YHYC7.js +31 -0
- package/dist/chunk-U66YHYC7.js.map +1 -0
- package/dist/{chunk-MWGVGUIS.js → chunk-UEYA6UC7.js} +36 -4
- package/dist/chunk-UEYA6UC7.js.map +1 -0
- package/dist/{chunk-MDDAA2AO.js → chunk-UPMD5XND.js} +2 -2
- package/dist/{chunk-M5KEYE5E.js → chunk-URB2WSKZ.js} +2 -2
- package/dist/chunk-UVJFDP7P.js +202 -0
- package/dist/chunk-UVJFDP7P.js.map +1 -0
- package/dist/{chunk-QY2BHY5O.js → chunk-V7XCAHIB.js} +265 -25
- package/dist/chunk-V7XCAHIB.js.map +1 -0
- package/dist/chunk-W6SL7OFG.js +180 -0
- package/dist/chunk-W6SL7OFG.js.map +1 -0
- package/dist/{chunk-QDOSNLB4.js → chunk-X4WESCKA.js} +17 -15
- package/dist/chunk-X4WESCKA.js.map +1 -0
- package/dist/{chunk-OTFNI3OO.js → chunk-XMGSSBFX.js} +1738 -383
- package/dist/chunk-XMGSSBFX.js.map +1 -0
- package/dist/chunk-YDBIWGNI.js +298 -0
- package/dist/chunk-YDBIWGNI.js.map +1 -0
- package/dist/chunk-YFYL2SIJ.js +7857 -0
- package/dist/chunk-YFYL2SIJ.js.map +1 -0
- package/dist/chunking.js +1 -1
- package/dist/citations.d.ts +67 -0
- package/dist/citations.js +13 -0
- package/dist/citations.js.map +1 -0
- package/dist/cli-DwIBnp2g.d.ts +1240 -0
- package/dist/cli.d.ts +31 -1147
- package/dist/cli.js +149 -7092
- package/dist/cli.js.map +1 -1
- package/dist/codex-materialize-CQlLTzke.d.ts +139 -0
- package/dist/codex-thread-key.d.ts +3 -0
- package/dist/codex-thread-key.js +7 -0
- package/dist/codex-thread-key.js.map +1 -0
- package/dist/config.js +3 -2
- package/dist/connectors/codex/instructions.md +160 -0
- package/dist/connectors/codex/resources/namespace-cheatsheet.md +48 -0
- package/dist/day-summary.d.ts +7 -2
- package/dist/day-summary.js +5 -2
- package/dist/embedding-fallback.d.ts +96 -2
- package/dist/embedding-fallback.js +6 -4
- package/dist/{engine-2A6J4XEX.js → engine-X7X3AAG3.js} +10 -7
- package/dist/engine-X7X3AAG3.js.map +1 -0
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +10 -7
- package/dist/entity-schema.d.ts +11 -0
- package/dist/entity-schema.js +19 -0
- package/dist/entity-schema.js.map +1 -0
- package/dist/explicit-capture.d.ts +6 -3
- package/dist/explicit-capture.js +2 -2
- package/dist/extraction-judge.d.ts +66 -0
- package/dist/extraction-judge.js +18 -0
- package/dist/extraction-judge.js.map +1 -0
- package/dist/extraction.d.ts +1 -0
- package/dist/extraction.js +12 -10
- package/dist/fallback-llm.js +4 -4
- package/dist/graph.js +1 -1
- package/dist/importance.d.ts +11 -1
- package/dist/importance.js +3 -1
- package/dist/index.d.ts +1140 -8
- package/dist/index.js +3350 -333
- package/dist/index.js.map +1 -1
- package/dist/intent.d.ts +2 -1
- package/dist/intent.js +3 -1
- package/dist/lifecycle.js +1 -1
- package/dist/local-llm.js +2 -2
- package/dist/logger.d.ts +1 -1
- package/dist/logger.js +1 -1
- package/dist/memory-cache.d.ts +2 -2
- package/dist/memory-cache.js +1 -1
- package/dist/{memory-projection-store-NxMkbocT.d.ts → memory-projection-store-DeSXPh1j.d.ts} +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/model-registry.js +2 -2
- package/dist/models-json.js +2 -2
- package/dist/native-knowledge.js +2 -2
- package/dist/negative.js +2 -2
- package/dist/operator-toolkit.js +20 -16
- package/dist/{orchestrator-CIvLFHx3.d.ts → orchestrator-B9kwlCep.d.ts} +254 -9
- package/dist/orchestrator.d.ts +6 -3
- package/dist/orchestrator.js +70 -58
- package/dist/page-versioning.d.ts +77 -0
- package/dist/page-versioning.js +15 -0
- package/dist/page-versioning.js.map +1 -0
- package/dist/plugin-id.d.ts +37 -0
- package/dist/plugin-id.js +11 -0
- package/dist/plugin-id.js.map +1 -0
- package/dist/policy-runtime.js +2 -2
- package/dist/profiling.js +2 -2
- package/dist/qmd.d.ts +5 -2
- package/dist/qmd.js +3 -3
- package/dist/recall-audit.d.ts +20 -0
- package/dist/recall-audit.js +50 -0
- package/dist/recall-audit.js.map +1 -0
- package/dist/recall-mmr.d.ts +152 -0
- package/dist/recall-mmr.js +17 -0
- package/dist/recall-mmr.js.map +1 -0
- package/dist/recall-qos.js +2 -2
- package/dist/recall-state.js +2 -2
- package/dist/relevance.js +2 -2
- package/dist/resolve-provider-secret.js +2 -2
- package/dist/resume-bundles.js +5 -4
- package/dist/retrieval-agents.js +2 -2
- package/dist/retrieval.js +2 -2
- package/dist/schemas.d.ts +422 -64
- package/dist/schemas.js +3 -1
- package/dist/sdk-compat.d.ts +2 -0
- package/dist/sdk-compat.js +6 -3
- package/dist/sdk-compat.js.map +1 -1
- package/dist/semantic-chunking.d.ts +87 -0
- package/dist/semantic-chunking.js +20 -0
- package/dist/semantic-chunking.js.map +1 -0
- package/dist/semantic-consolidation-DrvSYRdB.d.ts +119 -0
- package/dist/semantic-consolidation.d.ts +4 -42
- package/dist/semantic-consolidation.js +23 -2
- package/dist/semantic-rule-promotion.js +9 -6
- package/dist/semantic-rule-verifier.js +10 -7
- package/dist/session-observer-state.js +2 -2
- package/dist/session-toggles.d.ts +22 -0
- package/dist/session-toggles.js +116 -0
- package/dist/session-toggles.js.map +1 -0
- package/dist/skills-registry.d.ts +47 -0
- package/dist/skills-registry.js +48 -0
- package/dist/skills-registry.js.map +1 -0
- package/dist/source-attribution.d.ts +169 -0
- package/dist/source-attribution.js +27 -0
- package/dist/source-attribution.js.map +1 -0
- package/dist/storage.d.ts +171 -10
- package/dist/storage.js +16 -5
- package/dist/summarizer.js +7 -7
- package/dist/temporal-supersession.d.ts +127 -0
- package/dist/temporal-supersession.js +20 -0
- package/dist/temporal-supersession.js.map +1 -0
- package/dist/threading.js +2 -2
- package/dist/tier-migration.d.ts +2 -1
- package/dist/tier-routing.js +2 -2
- package/dist/tokens.d.ts +21 -1
- package/dist/tokens.js +5 -1
- package/dist/transcript.js +2 -2
- package/dist/types.d.ts +497 -3
- package/dist/types.js +1 -1
- package/dist/utility-learner.js +2 -2
- package/dist/utility-runtime.js +3 -3
- package/dist/verified-recall.js +11 -8
- package/dist/whitespace.d.ts +4 -0
- package/dist/whitespace.js +9 -0
- package/dist/whitespace.js.map +1 -0
- package/package.json +14 -8
- package/dist/chunk-2CJCWDMR.js +0 -87
- package/dist/chunk-2CJCWDMR.js.map +0 -1
- package/dist/chunk-2PO5ZRKV.js.map +0 -1
- package/dist/chunk-6UJQNRIO.js.map +0 -1
- package/dist/chunk-B7LOFDVE.js.map +0 -1
- package/dist/chunk-BDFZXRSO.js.map +0 -1
- package/dist/chunk-CXWFUJR2.js.map +0 -1
- package/dist/chunk-DORBM6OB.js +0 -81
- package/dist/chunk-DORBM6OB.js.map +0 -1
- package/dist/chunk-ESSMF2FR.js.map +0 -1
- package/dist/chunk-HLBYLYRD.js.map +0 -1
- package/dist/chunk-HLXVTBF3.js.map +0 -1
- package/dist/chunk-ISY75RLM.js.map +0 -1
- package/dist/chunk-KL4CP4SB.js.map +0 -1
- package/dist/chunk-KWBU5S5U.js.map +0 -1
- package/dist/chunk-MWGVGUIS.js.map +0 -1
- package/dist/chunk-ORZMT74A.js.map +0 -1
- package/dist/chunk-OTFNI3OO.js.map +0 -1
- package/dist/chunk-PGK3VUHN.js.map +0 -1
- package/dist/chunk-QCCCQT3O.js.map +0 -1
- package/dist/chunk-QDOSNLB4.js.map +0 -1
- package/dist/chunk-QPKFPHOO.js +0 -178
- package/dist/chunk-QPKFPHOO.js.map +0 -1
- package/dist/chunk-QWUUMMIK.js.map +0 -1
- package/dist/chunk-QY2BHY5O.js.map +0 -1
- package/dist/chunk-TVVVQQAK.js.map +0 -1
- package/dist/chunk-U4PV25RD.js.map +0 -1
- package/dist/chunk-UYSKNO6E.js.map +0 -1
- package/dist/chunk-V4YC4LUK.js.map +0 -1
- package/dist/chunk-WWIQTB2Y.js.map +0 -1
- package/dist/chunk-YNCQ7E4M.js.map +0 -1
- package/dist/chunk-ZJLY4QSU.js.map +0 -1
- /package/dist/{engine-2A6J4XEX.js.map → active-memory-bridge.js.map} +0 -0
- /package/dist/{chunk-NTTLPF7F.js.map → chunk-3QFQGRHO.js.map} +0 -0
- /package/dist/{chunk-G3AG3KZN.js.map → chunk-5IZL4DCV.js.map} +0 -0
- /package/dist/{chunk-BRK4ODMI.js.map → chunk-5NPGSAVB.js.map} +0 -0
- /package/dist/{chunk-L5RPWGFK.js.map → chunk-7DHTMOND.js.map} +0 -0
- /package/dist/{chunk-Q6FETXJA.js.map → chunk-7SEAZFFB.js.map} +0 -0
- /package/dist/{chunk-QANCTXQF.js.map → chunk-AYPYCLR7.js.map} +0 -0
- /package/dist/{chunk-LP47L3ZX.js.map → chunk-BTY5RRRF.js.map} +0 -0
- /package/dist/{chunk-SCHEKPYH.js.map → chunk-C2EFFULQ.js.map} +0 -0
- /package/dist/{chunk-GJR6D6KC.js.map → chunk-D654IBA6.js.map} +0 -0
- /package/dist/{chunk-UV2FO7J4.js.map → chunk-E6K4NIEU.js.map} +0 -0
- /package/dist/{chunk-T4WRIV2C.js.map → chunk-EABGC2TL.js.map} +0 -0
- /package/dist/{chunk-ONRU4L2N.js.map → chunk-FEMOX5AD.js.map} +0 -0
- /package/dist/{chunk-IFFFR3MR.js.map → chunk-FSFEQI74.js.map} +0 -0
- /package/dist/{chunk-UIYZ5T3I.js.map → chunk-GJQPH5G3.js.map} +0 -0
- /package/dist/{chunk-ZKYI7UVO.js.map → chunk-JR4ZC3G4.js.map} +0 -0
- /package/dist/{chunk-UCYSTFZR.js.map → chunk-JRNQ3RNA.js.map} +0 -0
- /package/dist/{chunk-GPGBSNKM.js.map → chunk-K4FLSOR5.js.map} +0 -0
- /package/dist/{chunk-M5ZBBBJI.js.map → chunk-KEG4GNGI.js.map} +0 -0
- /package/dist/{chunk-L7WO3MZ4.js.map → chunk-KWP7T3DP.js.map} +0 -0
- /package/dist/{chunk-J47FNDR7.js.map → chunk-MYQWXITD.js.map} +0 -0
- /package/dist/{chunk-YNI4S5WT.js.map → chunk-N53K2EXC.js.map} +0 -0
- /package/dist/{chunk-763GUIOU.js.map → chunk-NBNN5GOB.js.map} +0 -0
- /package/dist/{chunk-OOSWAUYB.js.map → chunk-ODWDQNRE.js.map} +0 -0
- /package/dist/{chunk-J3BT33K7.js.map → chunk-POBPGDWI.js.map} +0 -0
- /package/dist/{chunk-OTAVQCSF.js.map → chunk-PYXS46O7.js.map} +0 -0
- /package/dist/{chunk-XUHI52HK.js.map → chunk-QKAH5B6E.js.map} +0 -0
- /package/dist/{chunk-HG2NKWR2.js.map → chunk-S4LX5EBI.js.map} +0 -0
- /package/dist/{chunk-4A24LIM2.js.map → chunk-S75M5ZRK.js.map} +0 -0
- /package/dist/{chunk-MDDAA2AO.js.map → chunk-UPMD5XND.js.map} +0 -0
- /package/dist/{chunk-M5KEYE5E.js.map → chunk-URB2WSKZ.js.map} +0 -0
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* skills-registry.ts
|
|
3
|
+
*
|
|
4
|
+
* Built-in Remnic procedural memory skills — the canonical SKILL.md sources
|
|
5
|
+
* shipped with the monorepo. Consumers (e.g. the Codex materializer in #378)
|
|
6
|
+
* read this registry to discover which skills to materialize into
|
|
7
|
+
* `~/.codex/memories/skills/<slug>/SKILL.md`.
|
|
8
|
+
*
|
|
9
|
+
* This module is intentionally free of Codex/Claude Code host coupling —
|
|
10
|
+
* it only exposes the static metadata each host needs.
|
|
11
|
+
*/
|
|
12
|
+
/**
|
|
13
|
+
* A single procedural-memory skill source that Remnic ships.
|
|
14
|
+
*
|
|
15
|
+
* - `slug` is the canonical folder name under `skills/` and the file on disk
|
|
16
|
+
* must live at `<pluginRoot>/skills/<slug>/SKILL.md`.
|
|
17
|
+
* - `staticPath`, when set, points at a pre-authored SKILL.md on disk.
|
|
18
|
+
* - `generator`, when set, produces a SKILL.md body at materialization time.
|
|
19
|
+
* Exactly one of `staticPath` or `generator` should be provided.
|
|
20
|
+
* - `disableModelInvocation` mirrors the `disable-model-invocation` frontmatter
|
|
21
|
+
* key and indicates a skill that writes or mutates state and therefore
|
|
22
|
+
* should not be auto-invoked by a model without explicit opt-in.
|
|
23
|
+
*/
|
|
24
|
+
interface RemnicSkillSource {
|
|
25
|
+
slug: string;
|
|
26
|
+
staticPath?: string;
|
|
27
|
+
generator?: () => Promise<string>;
|
|
28
|
+
disableModelInvocation: boolean;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Validate a Remnic skill slug. Rules:
|
|
32
|
+
*
|
|
33
|
+
* - lowercase letters, digits, and `-` only
|
|
34
|
+
* - must start with a letter or digit
|
|
35
|
+
* - 1–64 characters
|
|
36
|
+
*
|
|
37
|
+
* This is the same shape the Codex skills directory expects.
|
|
38
|
+
*/
|
|
39
|
+
declare function isValidSkillSlug(slug: string): boolean;
|
|
40
|
+
/**
|
|
41
|
+
* The canonical list of Remnic procedural memory skills shipped with the
|
|
42
|
+
* monorepo. The Codex materializer (#378) copies these into
|
|
43
|
+
* `~/.codex/memories/skills/<slug>/SKILL.md`.
|
|
44
|
+
*/
|
|
45
|
+
declare const BUILTIN_SKILLS: RemnicSkillSource[];
|
|
46
|
+
|
|
47
|
+
export { BUILTIN_SKILLS, type RemnicSkillSource, isValidSkillSlug };
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
// src/skills-registry.ts
|
|
2
|
+
import { fileURLToPath } from "url";
|
|
3
|
+
import { dirname, resolve } from "path";
|
|
4
|
+
function isValidSkillSlug(slug) {
|
|
5
|
+
return /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,63}$/.test(slug);
|
|
6
|
+
}
|
|
7
|
+
var HERE = dirname(fileURLToPath(import.meta.url));
|
|
8
|
+
var PLUGIN_CODEX_SKILLS_DIR = resolve(HERE, "..", "..", "plugin-codex", "skills");
|
|
9
|
+
function codexSkillPath(slug) {
|
|
10
|
+
return resolve(PLUGIN_CODEX_SKILLS_DIR, slug, "SKILL.md");
|
|
11
|
+
}
|
|
12
|
+
var BUILTIN_SKILLS = [
|
|
13
|
+
{
|
|
14
|
+
slug: "remnic-memory-workflow",
|
|
15
|
+
staticPath: codexSkillPath("remnic-memory-workflow"),
|
|
16
|
+
disableModelInvocation: true
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
slug: "remnic-recall",
|
|
20
|
+
staticPath: codexSkillPath("remnic-recall"),
|
|
21
|
+
disableModelInvocation: false
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
slug: "remnic-remember",
|
|
25
|
+
staticPath: codexSkillPath("remnic-remember"),
|
|
26
|
+
disableModelInvocation: true
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
slug: "remnic-search",
|
|
30
|
+
staticPath: codexSkillPath("remnic-search"),
|
|
31
|
+
disableModelInvocation: false
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
slug: "remnic-entities",
|
|
35
|
+
staticPath: codexSkillPath("remnic-entities"),
|
|
36
|
+
disableModelInvocation: false
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
slug: "remnic-status",
|
|
40
|
+
staticPath: codexSkillPath("remnic-status"),
|
|
41
|
+
disableModelInvocation: false
|
|
42
|
+
}
|
|
43
|
+
];
|
|
44
|
+
export {
|
|
45
|
+
BUILTIN_SKILLS,
|
|
46
|
+
isValidSkillSlug
|
|
47
|
+
};
|
|
48
|
+
//# sourceMappingURL=skills-registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/skills-registry.ts"],"sourcesContent":["/**\n * skills-registry.ts\n *\n * Built-in Remnic procedural memory skills — the canonical SKILL.md sources\n * shipped with the monorepo. Consumers (e.g. the Codex materializer in #378)\n * read this registry to discover which skills to materialize into\n * `~/.codex/memories/skills/<slug>/SKILL.md`.\n *\n * This module is intentionally free of Codex/Claude Code host coupling —\n * it only exposes the static metadata each host needs.\n */\n\nimport { fileURLToPath } from \"node:url\";\nimport { dirname, resolve } from \"node:path\";\n\n/**\n * A single procedural-memory skill source that Remnic ships.\n *\n * - `slug` is the canonical folder name under `skills/` and the file on disk\n * must live at `<pluginRoot>/skills/<slug>/SKILL.md`.\n * - `staticPath`, when set, points at a pre-authored SKILL.md on disk.\n * - `generator`, when set, produces a SKILL.md body at materialization time.\n * Exactly one of `staticPath` or `generator` should be provided.\n * - `disableModelInvocation` mirrors the `disable-model-invocation` frontmatter\n * key and indicates a skill that writes or mutates state and therefore\n * should not be auto-invoked by a model without explicit opt-in.\n */\nexport interface RemnicSkillSource {\n slug: string;\n staticPath?: string;\n generator?: () => Promise<string>;\n disableModelInvocation: boolean;\n}\n\n/**\n * Validate a Remnic skill slug. Rules:\n *\n * - lowercase letters, digits, and `-` only\n * - must start with a letter or digit\n * - 1–64 characters\n *\n * This is the same shape the Codex skills directory expects.\n */\nexport function isValidSkillSlug(slug: string): boolean {\n // Must start with alphanumeric; each dash must be followed by alphanumeric\n // (no trailing dashes, no consecutive dashes); 1–64 characters total.\n return /^[a-z0-9](?:[a-z0-9]|-(?=[a-z0-9])){0,63}$/.test(slug);\n}\n\n// ---------------------------------------------------------------------------\n// Built-in skill paths — resolved relative to this source file.\n// ---------------------------------------------------------------------------\n//\n// This file lives at `packages/remnic-core/src/skills-registry.ts`.\n// After tsup build it lives at `packages/remnic-core/dist/skills-registry.js`.\n// In both cases, the shipped skill sources live four levels up at\n// `packages/plugin-codex/skills/<slug>/SKILL.md`.\n//\n// We compute the absolute path from the current module so that callers in any\n// cwd can resolve the files.\n\nconst HERE = dirname(fileURLToPath(import.meta.url));\nconst PLUGIN_CODEX_SKILLS_DIR = resolve(HERE, \"..\", \"..\", \"plugin-codex\", \"skills\");\n\nfunction codexSkillPath(slug: string): string {\n return resolve(PLUGIN_CODEX_SKILLS_DIR, slug, \"SKILL.md\");\n}\n\n/**\n * The canonical list of Remnic procedural memory skills shipped with the\n * monorepo. The Codex materializer (#378) copies these into\n * `~/.codex/memories/skills/<slug>/SKILL.md`.\n */\nexport const BUILTIN_SKILLS: RemnicSkillSource[] = [\n {\n slug: \"remnic-memory-workflow\",\n staticPath: codexSkillPath(\"remnic-memory-workflow\"),\n disableModelInvocation: true,\n },\n {\n slug: \"remnic-recall\",\n staticPath: codexSkillPath(\"remnic-recall\"),\n disableModelInvocation: false,\n },\n {\n slug: \"remnic-remember\",\n staticPath: codexSkillPath(\"remnic-remember\"),\n disableModelInvocation: true,\n },\n {\n slug: \"remnic-search\",\n staticPath: codexSkillPath(\"remnic-search\"),\n disableModelInvocation: false,\n },\n {\n slug: \"remnic-entities\",\n staticPath: codexSkillPath(\"remnic-entities\"),\n disableModelInvocation: false,\n },\n {\n slug: \"remnic-status\",\n staticPath: codexSkillPath(\"remnic-status\"),\n disableModelInvocation: false,\n },\n];\n"],"mappings":";AAYA,SAAS,qBAAqB;AAC9B,SAAS,SAAS,eAAe;AA8B1B,SAAS,iBAAiB,MAAuB;AAGtD,SAAO,6CAA6C,KAAK,IAAI;AAC/D;AAcA,IAAM,OAAO,QAAQ,cAAc,YAAY,GAAG,CAAC;AACnD,IAAM,0BAA0B,QAAQ,MAAM,MAAM,MAAM,gBAAgB,QAAQ;AAElF,SAAS,eAAe,MAAsB;AAC5C,SAAO,QAAQ,yBAAyB,MAAM,UAAU;AAC1D;AAOO,IAAM,iBAAsC;AAAA,EACjD;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,wBAAwB;AAAA,IACnD,wBAAwB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,eAAe;AAAA,IAC1C,wBAAwB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,iBAAiB;AAAA,IAC5C,wBAAwB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,eAAe;AAAA,IAC1C,wBAAwB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,iBAAiB;AAAA,IAC5C,wBAAwB;AAAA,EAC1B;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN,YAAY,eAAe,eAAe;AAAA,IAC1C,wBAAwB;AAAA,EAC1B;AACF;","names":[]}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Inline Source Attribution Protocol (issue #369)
|
|
3
|
+
*
|
|
4
|
+
* Extracted facts carry provenance inline inside the fact body, so the
|
|
5
|
+
* citation survives prompt injection, copy/paste, and LLM quoting. This
|
|
6
|
+
* complements — never replaces — the YAML frontmatter provenance stored on
|
|
7
|
+
* disk.
|
|
8
|
+
*
|
|
9
|
+
* Default format (matches issue #369 proposal):
|
|
10
|
+
*
|
|
11
|
+
* The foo service uses Redis for rate limiting. [Source: agent=planner, session=abc123, ts=2026-04-10T14:25:07Z]
|
|
12
|
+
*
|
|
13
|
+
* Key properties:
|
|
14
|
+
* - Inline (part of the body, not metadata).
|
|
15
|
+
* - Compact (typically <80 chars of overhead per fact).
|
|
16
|
+
* - Machine-parseable by a single regex.
|
|
17
|
+
* - Opt-in via `inlineSourceAttributionEnabled` config flag (default off
|
|
18
|
+
* for backwards compatibility with existing downstream consumers).
|
|
19
|
+
* - Legacy facts without a citation remain fully readable.
|
|
20
|
+
*
|
|
21
|
+
* The format template is configurable via `inlineSourceAttributionFormat`
|
|
22
|
+
* with supported placeholders:
|
|
23
|
+
*
|
|
24
|
+
* {agent} — principal / agent identifier
|
|
25
|
+
* {session} — full session key (colon-delimited)
|
|
26
|
+
* {sessionId} — short stable session id (trailing component)
|
|
27
|
+
* {ts} — extraction timestamp (ISO 8601)
|
|
28
|
+
* {date} — extraction date (YYYY-MM-DD)
|
|
29
|
+
*
|
|
30
|
+
* Any privacy-sensitive identifiers should be normalized before being passed
|
|
31
|
+
* to `formatCitation` — the helper treats them as opaque strings.
|
|
32
|
+
*/
|
|
33
|
+
/** Default citation format template (matches issue #369). */
|
|
34
|
+
declare const DEFAULT_CITATION_FORMAT = "[Source: agent={agent}, session={sessionId}, ts={ts}]";
|
|
35
|
+
/** Sentinel value used when a provenance field is missing. */
|
|
36
|
+
declare const CITATION_UNKNOWN = "unknown";
|
|
37
|
+
interface CitationContext {
|
|
38
|
+
/** Principal / agent identifier (e.g. resolved via resolvePrincipal). */
|
|
39
|
+
agent?: string;
|
|
40
|
+
/** Full session key (e.g. "agent:planner:main"). */
|
|
41
|
+
session?: string;
|
|
42
|
+
/**
|
|
43
|
+
* Opaque short session id. Derived from the trailing component of the
|
|
44
|
+
* session key when not provided explicitly. Use this for compact formats
|
|
45
|
+
* that do not need the full colon-delimited session key.
|
|
46
|
+
*/
|
|
47
|
+
sessionId?: string;
|
|
48
|
+
/** Extraction timestamp as an ISO 8601 string. */
|
|
49
|
+
ts?: string;
|
|
50
|
+
}
|
|
51
|
+
interface ParsedCitation {
|
|
52
|
+
/** Agent identifier parsed from the citation (never crashes on malformed input). */
|
|
53
|
+
agent?: string;
|
|
54
|
+
/** Session identifier parsed from the citation. */
|
|
55
|
+
session?: string;
|
|
56
|
+
/** Extraction timestamp parsed from the citation. */
|
|
57
|
+
ts?: string;
|
|
58
|
+
/** The full matched citation substring. */
|
|
59
|
+
raw: string;
|
|
60
|
+
}
|
|
61
|
+
/**
|
|
62
|
+
* Derive a short session id from a full session key.
|
|
63
|
+
* Falls back to the raw session string if no colon is present.
|
|
64
|
+
*/
|
|
65
|
+
declare function deriveSessionId(session: string | undefined): string | undefined;
|
|
66
|
+
/**
|
|
67
|
+
* Format an inline citation tag using the provided template.
|
|
68
|
+
*
|
|
69
|
+
* Missing context fields fall back to {@link CITATION_UNKNOWN} — the caller
|
|
70
|
+
* should always get a non-empty, parseable tag.
|
|
71
|
+
*
|
|
72
|
+
* Uses a single-pass substitution so that values which themselves contain
|
|
73
|
+
* placeholder syntax (e.g. an agent literally named `"{ts}"`) cannot be
|
|
74
|
+
* re-interpreted by subsequent replacement steps. Each placeholder slot
|
|
75
|
+
* receives exactly one lookup and the substituted value is treated as
|
|
76
|
+
* terminal text, not template source.
|
|
77
|
+
*/
|
|
78
|
+
declare function formatCitation(ctx: CitationContext, template?: string): string;
|
|
79
|
+
/**
|
|
80
|
+
* Returns true if the text already carries at least one citation marker.
|
|
81
|
+
* Safe to call on any string — never throws.
|
|
82
|
+
*/
|
|
83
|
+
declare function hasCitation(text: string): boolean;
|
|
84
|
+
/**
|
|
85
|
+
* Returns true if `text` already carries a citation produced by `template`
|
|
86
|
+
* **or** by the default `[Source: ...]` format (for facts that were tagged
|
|
87
|
+
* before a config change).
|
|
88
|
+
*
|
|
89
|
+
* Use this instead of {@link hasCitation} whenever the caller has access to
|
|
90
|
+
* the configured `inlineSourceAttributionFormat`.
|
|
91
|
+
*
|
|
92
|
+
* All-placeholder templates such as `{agent}{sessionId}` have no literal
|
|
93
|
+
* content to anchor on and therefore cannot be reliably detected without
|
|
94
|
+
* dedicated sentinel markers. In that case the function returns `false` —
|
|
95
|
+
* callers that need idempotent dedup for such templates should either adopt
|
|
96
|
+
* a template with literal delimiters (recommended) or rely on the default
|
|
97
|
+
* `[Source: ...]` marker detection which is always available via
|
|
98
|
+
* {@link hasCitation}.
|
|
99
|
+
*/
|
|
100
|
+
declare function hasCitationForTemplate(text: string, template: string): boolean;
|
|
101
|
+
/**
|
|
102
|
+
* Attach an inline citation to fact text.
|
|
103
|
+
*
|
|
104
|
+
* If the text already has a citation — either the default `[Source: ...]`
|
|
105
|
+
* marker or one produced by the configured template — it is returned unchanged.
|
|
106
|
+
* Existing provenance is respected and never overwritten. Otherwise the
|
|
107
|
+
* citation is appended to the trimmed text with a single space separator,
|
|
108
|
+
* which keeps the marker visually adjacent to the fact body.
|
|
109
|
+
*/
|
|
110
|
+
declare function attachCitation(text: string, ctx: CitationContext, template?: string): string;
|
|
111
|
+
/**
|
|
112
|
+
* Parse a single inline citation from a piece of text. Returns the first
|
|
113
|
+
* citation encountered or `null` when none is present. Malformed citations
|
|
114
|
+
* do not throw — fields that cannot be parsed simply remain `undefined`.
|
|
115
|
+
*/
|
|
116
|
+
declare function parseCitation(text: string): ParsedCitation | null;
|
|
117
|
+
/**
|
|
118
|
+
* Parse every citation embedded in the text. Always returns an array; empty
|
|
119
|
+
* when none are present.
|
|
120
|
+
*/
|
|
121
|
+
declare function parseAllCitations(text: string): ParsedCitation[];
|
|
122
|
+
/**
|
|
123
|
+
* Remove all inline citations from a piece of text.
|
|
124
|
+
*
|
|
125
|
+
* Callers that want the raw fact body (for dedup hashing, display, or
|
|
126
|
+
* comparison) should use this helper instead of hand-rolled regexes so the
|
|
127
|
+
* whole codebase agrees on the citation syntax.
|
|
128
|
+
*
|
|
129
|
+
* Finding 2 fix: when the input contains no citation marker, the input is
|
|
130
|
+
* returned byte-for-byte unchanged. When a citation IS removed, whitespace
|
|
131
|
+
* normalization is applied only at each join seam (the single space between
|
|
132
|
+
* the preceding text and where the citation was), rather than across the
|
|
133
|
+
* entire string. This preserves markdown hard-break spacing, aligned text,
|
|
134
|
+
* and code-like snippets in fact bodies that happen to carry a citation.
|
|
135
|
+
*
|
|
136
|
+
* Implementation: each citation match is replaced by its "seam fix" — the
|
|
137
|
+
* content before the match has its trailing whitespace trimmed and then a
|
|
138
|
+
* single space is appended if any text remains, collapsing only the gap
|
|
139
|
+
* left by the removed marker. Whitespace elsewhere in the body is untouched.
|
|
140
|
+
*/
|
|
141
|
+
declare function stripCitation(text: string): string;
|
|
142
|
+
/**
|
|
143
|
+
* Strip an inline citation from text using a specific template regex.
|
|
144
|
+
*
|
|
145
|
+
* This is the template-aware counterpart to {@link stripCitation}. When the
|
|
146
|
+
* caller holds the configured `inlineSourceAttributionFormat`, use this
|
|
147
|
+
* function to strip citations produced by that template — including custom
|
|
148
|
+
* templates that differ from the default `[Source: ...]` pattern.
|
|
149
|
+
*
|
|
150
|
+
* Behaviour:
|
|
151
|
+
* - If the text has a **default-format** citation, delegates to
|
|
152
|
+
* {@link stripCitation} (always safe).
|
|
153
|
+
* - If the text has a **custom-template** citation detected by
|
|
154
|
+
* `hasCitationForTemplate`, builds the template regex and removes every
|
|
155
|
+
* occurrence (citations are appended at the end of the fact body by
|
|
156
|
+
* {@link attachCitation}).
|
|
157
|
+
* - All-placeholder templates (no literal prefix/suffix/separator) cannot
|
|
158
|
+
* produce a reliable matcher. `hasCitationForTemplate` already returns
|
|
159
|
+
* `false` for such templates, so this function never attempts to strip an
|
|
160
|
+
* undetectable citation. The text is returned unchanged when no citation
|
|
161
|
+
* is detected.
|
|
162
|
+
* - If no citation is detected for the given template, returns the text
|
|
163
|
+
* unchanged.
|
|
164
|
+
*
|
|
165
|
+
* @returns The stripped text (or the original text when no citation is found).
|
|
166
|
+
*/
|
|
167
|
+
declare function stripCitationForTemplate(text: string, template: string): string;
|
|
168
|
+
|
|
169
|
+
export { CITATION_UNKNOWN, type CitationContext, DEFAULT_CITATION_FORMAT, type ParsedCitation, attachCitation, deriveSessionId, formatCitation, hasCitation, hasCitationForTemplate, parseAllCitations, parseCitation, stripCitation, stripCitationForTemplate };
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import {
|
|
2
|
+
CITATION_UNKNOWN,
|
|
3
|
+
DEFAULT_CITATION_FORMAT,
|
|
4
|
+
attachCitation,
|
|
5
|
+
deriveSessionId,
|
|
6
|
+
formatCitation,
|
|
7
|
+
hasCitation,
|
|
8
|
+
hasCitationForTemplate,
|
|
9
|
+
parseAllCitations,
|
|
10
|
+
parseCitation,
|
|
11
|
+
stripCitation,
|
|
12
|
+
stripCitationForTemplate
|
|
13
|
+
} from "./chunk-4KAN3GZ3.js";
|
|
14
|
+
export {
|
|
15
|
+
CITATION_UNKNOWN,
|
|
16
|
+
DEFAULT_CITATION_FORMAT,
|
|
17
|
+
attachCitation,
|
|
18
|
+
deriveSessionId,
|
|
19
|
+
formatCitation,
|
|
20
|
+
hasCitation,
|
|
21
|
+
hasCitationForTemplate,
|
|
22
|
+
parseAllCitations,
|
|
23
|
+
parseCitation,
|
|
24
|
+
stripCitation,
|
|
25
|
+
stripCitationForTemplate
|
|
26
|
+
};
|
|
27
|
+
//# sourceMappingURL=source-attribution.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/storage.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { VersioningConfig } from './page-versioning.js';
|
|
2
|
+
import { PluginConfig, MemoryCategory, ImportanceScore, MemoryLink, MemoryFrontmatter, MemoryStatus, MemoryFile, EntityStructuredSection, BufferState, MetaState, MemoryActionEvent, MemoryLifecycleEvent, BehaviorSignalEvent, CompressionGuidelineOptimizerState, ContinuityIncidentOpenInput, ContinuityIncidentRecord, ContinuityIncidentCloseInput, ContinuityImprovementLoop, ContinuityLoopUpsertInput, ContinuityLoopReviewInput, FileHygieneConfig, EntityRelationship, EntityActivityEntry, EntityFile, AccessTrackingEntry, MemoryProjectionCurrentState, MemorySummary, TopicScore } from './types.js';
|
|
3
|
+
import { P as ProjectedMemoryBrowseOptions, a as ProjectedMemoryBrowsePage, b as readProjectedGovernanceRecord } from './memory-projection-store-DeSXPh1j.js';
|
|
3
4
|
import 'better-sqlite3';
|
|
4
5
|
|
|
5
6
|
interface ReextractJobRequest {
|
|
@@ -46,37 +47,92 @@ declare class ContentHashIndex {
|
|
|
46
47
|
save(): Promise<void>;
|
|
47
48
|
/** Remove a hash from the index (used when archiving/deleting). */
|
|
48
49
|
remove(content: string): void;
|
|
50
|
+
/**
|
|
51
|
+
* Remove a pre-computed SHA-256 hash directly from the index without
|
|
52
|
+
* re-hashing. Use this when the caller already holds the stored hash
|
|
53
|
+
* (e.g. `memory.frontmatter.contentHash`) to avoid the double-hash bug
|
|
54
|
+
* where `remove(hash)` would compute `hash(hash)` and never match the
|
|
55
|
+
* entry.
|
|
56
|
+
*/
|
|
57
|
+
removeByHash(hash: string): void;
|
|
58
|
+
/**
|
|
59
|
+
* Add a pre-computed SHA-256 hash directly to the index without re-hashing.
|
|
60
|
+
* Use this when the caller already holds the stored hash
|
|
61
|
+
* (e.g. `memory.frontmatter.contentHash`) so that the index records the raw
|
|
62
|
+
* content hash rather than re-hashing the citation-annotated body.
|
|
63
|
+
*
|
|
64
|
+
* @internal Only called from `StorageManager.ensureFactHashIndexAuthoritative`.
|
|
65
|
+
* Not part of the public API — prefer `add(content)` for external callers.
|
|
66
|
+
*/
|
|
67
|
+
addByHash(hash: string): void;
|
|
49
68
|
/** Normalize content and compute SHA-256 hash. */
|
|
50
69
|
static normalizeContent(content: string): string;
|
|
51
70
|
/** Normalize content and compute SHA-256 hash. */
|
|
52
71
|
static computeHash(content: string): string;
|
|
53
72
|
}
|
|
73
|
+
/**
|
|
74
|
+
* Render a structured-attributes map into a stable, canonical string fragment
|
|
75
|
+
* suitable for appending to enriched memory content before hashing.
|
|
76
|
+
*
|
|
77
|
+
* Normalization rules:
|
|
78
|
+
* - Keys are trimmed and lowercased (values are trimmed but preserve case)
|
|
79
|
+
* - Key-value pairs are sorted alphabetically by normalized key
|
|
80
|
+
* - Pairs are joined with "; " and rendered as "key: value"
|
|
81
|
+
*
|
|
82
|
+
* Using this helper at BOTH the write path (enrichedContent) and the
|
|
83
|
+
* dedup-lookup path (dedupContent) guarantees identical output regardless of
|
|
84
|
+
* the insertion order or casing used by the caller.
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* normalizeAttributePairs({ foo: "bar", BAZ: "qux" })
|
|
88
|
+
* // → "baz: qux; foo: bar"
|
|
89
|
+
*/
|
|
90
|
+
declare function normalizeAttributePairs(pairs: Record<string, string>): string;
|
|
91
|
+
declare function compareEntityTimestamps(left?: string, right?: string): number;
|
|
92
|
+
declare function fingerprintEntityStructuredFacts(entity: Pick<EntityFile, "structuredSections">): string | undefined;
|
|
93
|
+
declare function isEntitySynthesisStale(entity: EntityFile): boolean;
|
|
54
94
|
/**
|
|
55
95
|
* Parse an entity markdown file into a structured EntityFile.
|
|
56
96
|
* Backward compatible: old files without new sections get empty arrays.
|
|
57
97
|
*/
|
|
58
|
-
declare function parseEntityFile(content: string): EntityFile;
|
|
98
|
+
declare function parseEntityFile(content: string, entitySchemas?: PluginConfig["entitySchemas"]): EntityFile;
|
|
59
99
|
/**
|
|
60
100
|
* Serialize an EntityFile back to markdown.
|
|
61
|
-
*
|
|
101
|
+
* Writes the compiled-truth + timeline format while remaining parse-compatible
|
|
102
|
+
* with the legacy in-memory `summary` and `facts` fields.
|
|
62
103
|
*/
|
|
63
|
-
declare function serializeEntityFile(entity: EntityFile): string;
|
|
104
|
+
declare function serializeEntityFile(entity: EntityFile, entitySchemas?: PluginConfig["entitySchemas"]): string;
|
|
64
105
|
declare class StorageManager {
|
|
65
106
|
private readonly baseDir;
|
|
107
|
+
private readonly entitySchemas?;
|
|
66
108
|
private knowledgeIndexCache;
|
|
67
109
|
private static readonly KNOWLEDGE_INDEX_CACHE_TTL_MS;
|
|
68
110
|
private artifactIndexCache;
|
|
69
111
|
private static readonly ARTIFACT_INDEX_CACHE_TTL_MS;
|
|
70
112
|
private static readonly artifactWriteVersionByDir;
|
|
71
113
|
private static readonly memoryStatusVersionByDir;
|
|
114
|
+
private static readonly coldWriteVersionByDir;
|
|
72
115
|
private static readonly allMemoriesInFlight;
|
|
116
|
+
private static readonly COLD_SCAN_CACHE_TTL_MS;
|
|
117
|
+
private static readonly coldMemoriesCache;
|
|
73
118
|
private static readonly QUESTIONS_CACHE_TTL_MS;
|
|
74
119
|
private static readonly questionsCache;
|
|
75
120
|
private factHashIndex;
|
|
76
121
|
private factHashIndexLoadPromise;
|
|
77
122
|
private factHashIndexAuthoritative;
|
|
78
123
|
private factHashIndexAuthoritativePromise;
|
|
79
|
-
|
|
124
|
+
/** Optional: set by the orchestrator after construction to enable template-aware citation stripping during legacy hash rebuild. */
|
|
125
|
+
citationTemplate: string;
|
|
126
|
+
/** Page-versioning configuration. Set by the orchestrator after construction. */
|
|
127
|
+
private _versioningConfig;
|
|
128
|
+
/** Set the page-versioning configuration. When `enabled` is false (default), all versioning calls are no-ops. */
|
|
129
|
+
setVersioningConfig(config: VersioningConfig): void;
|
|
130
|
+
/**
|
|
131
|
+
* Snapshot the current content of a page before overwriting.
|
|
132
|
+
* No-op when versioning is disabled or the file does not yet exist.
|
|
133
|
+
*/
|
|
134
|
+
private snapshotBeforeWrite;
|
|
135
|
+
constructor(baseDir: string, entitySchemas?: PluginConfig["entitySchemas"]);
|
|
80
136
|
/** The root directory of this storage instance. */
|
|
81
137
|
get dir(): string;
|
|
82
138
|
private identityFilePath;
|
|
@@ -89,8 +145,10 @@ declare class StorageManager {
|
|
|
89
145
|
private getArtifactWriteVersion;
|
|
90
146
|
private get factsDir();
|
|
91
147
|
private get correctionsDir();
|
|
148
|
+
private get proceduresDir();
|
|
92
149
|
private get entitiesDir();
|
|
93
150
|
private get stateDir();
|
|
151
|
+
private get entitySynthesisQueuePath();
|
|
94
152
|
private get factHashIndexReadyPath();
|
|
95
153
|
private getFactHashIndex;
|
|
96
154
|
private ensureFactHashIndexAuthoritative;
|
|
@@ -137,6 +195,19 @@ declare class StorageManager {
|
|
|
137
195
|
memoryKind?: MemoryFrontmatter["memoryKind"];
|
|
138
196
|
expiresAt?: string;
|
|
139
197
|
structuredAttributes?: Record<string, string>;
|
|
198
|
+
/**
|
|
199
|
+
* When provided, this string is used as the source for the fact-content
|
|
200
|
+
* dedup hash index instead of the persisted body (`content`).
|
|
201
|
+
*
|
|
202
|
+
* Use this when the persisted body differs from the canonical fact text
|
|
203
|
+
* — for example when `content` is a citation-annotated variant of a raw
|
|
204
|
+
* fact. Passing the raw fact as `contentHashSource` ensures that
|
|
205
|
+
* `hasFactContentHash(rawFact)` returns `true` after the write, so
|
|
206
|
+
* subsequent extractions of the same logical fact are correctly deduped
|
|
207
|
+
* even when their citation timestamp differs.
|
|
208
|
+
*/
|
|
209
|
+
contentHashSource?: string;
|
|
210
|
+
status?: MemoryStatus;
|
|
140
211
|
}): Promise<string>;
|
|
141
212
|
hasFactContentHash(content: string): Promise<boolean>;
|
|
142
213
|
isFactContentHashAuthoritative(): Promise<boolean>;
|
|
@@ -153,7 +224,13 @@ declare class StorageManager {
|
|
|
153
224
|
}): Promise<string>;
|
|
154
225
|
private readAllArtifactsCached;
|
|
155
226
|
searchArtifacts(query: string, maxResults: number): Promise<MemoryFile[]>;
|
|
156
|
-
writeEntity(name: string, type: string, facts: string[]
|
|
227
|
+
writeEntity(name: string, type: string, facts: string[], options?: {
|
|
228
|
+
timestamp?: string;
|
|
229
|
+
source?: string;
|
|
230
|
+
sessionKey?: string;
|
|
231
|
+
principal?: string;
|
|
232
|
+
structuredSections?: EntityStructuredSection[];
|
|
233
|
+
}): Promise<string>;
|
|
157
234
|
readProfile(): Promise<string>;
|
|
158
235
|
writeProfile(content: string): Promise<void>;
|
|
159
236
|
/**
|
|
@@ -177,8 +254,38 @@ declare class StorageManager {
|
|
|
177
254
|
* (bypassing StorageManager.writeMemory) to avoid stale reads. */
|
|
178
255
|
static clearAllStaticCaches(): void;
|
|
179
256
|
/** Cancel any in-flight concurrent read so the next readAllMemories()
|
|
180
|
-
* starts a fresh disk scan and sees the just-written data.
|
|
257
|
+
* starts a fresh disk scan and sees the just-written data.
|
|
258
|
+
*
|
|
259
|
+
* Finding UvBq (PR #402 round-11): this method intentionally does NOT
|
|
260
|
+
* invalidate the cold-scan cache. Ordinary hot-tier writes (writeMemory)
|
|
261
|
+
* do not change cold-tier content, so evicting the cold cache on every hot
|
|
262
|
+
* write was defeating the burst-dedup optimisation — the cold cache was
|
|
263
|
+
* cleared before applyTemporalSupersession ran, causing a full cold-tree
|
|
264
|
+
* disk scan on every write in a burst. Cold cache invalidation is handled
|
|
265
|
+
* exclusively by invalidateColdMemoriesCache(), which is called only when
|
|
266
|
+
* cold content actually changes (hot→cold demotions, writeMemoryFileAtomic
|
|
267
|
+
* inside cold/, archiveMemory, etc.). */
|
|
181
268
|
private invalidateAllMemoriesCache;
|
|
269
|
+
/**
|
|
270
|
+
* Invalidate the cold-scan cache for this storage root and bump the
|
|
271
|
+
* on-disk cold-version sentinel so that other processes (gateway, CLI) see
|
|
272
|
+
* the change immediately on their next readAllColdMemories() call.
|
|
273
|
+
*
|
|
274
|
+
* Must be called whenever a memory is written INTO the cold tier — hot→cold
|
|
275
|
+
* demotion, atomic writes inside cold/, archiving a cold memory, etc.
|
|
276
|
+
* NOT called on ordinary hot-tier writes (those don't change cold contents).
|
|
277
|
+
*
|
|
278
|
+
* Finding UvUy (PR #402 round-11): bumping the sentinel here makes the
|
|
279
|
+
* per-process in-memory cache safe across process boundaries.
|
|
280
|
+
*/
|
|
281
|
+
private invalidateColdMemoriesCache;
|
|
282
|
+
/** Return the current cold-write version counter for this storage root.
|
|
283
|
+
* Reads the on-disk sentinel (state/cold-write.log) so it reflects writes
|
|
284
|
+
* made by other processes. */
|
|
285
|
+
private readColdWriteVersion;
|
|
286
|
+
/** Bump the on-disk cold-write version sentinel and update the in-process
|
|
287
|
+
* fallback map. Called by invalidateColdMemoriesCache(). */
|
|
288
|
+
private bumpColdWriteVersion;
|
|
182
289
|
private normalizeMemoryReadBatchSize;
|
|
183
290
|
private collectActiveMemoryPaths;
|
|
184
291
|
private readParsedMemoriesFromPaths;
|
|
@@ -195,6 +302,32 @@ declare class StorageManager {
|
|
|
195
302
|
filePaths: string[];
|
|
196
303
|
}>;
|
|
197
304
|
private _readAllMemoriesFromDisk;
|
|
305
|
+
/**
|
|
306
|
+
* Read all memories from the cold tier by scanning the entire cold/ root
|
|
307
|
+
* tree. Previously this only scanned cold/facts/ and cold/corrections/, but
|
|
308
|
+
* structuredAttributes can appear on any MemoryCategory (preference, decision,
|
|
309
|
+
* entity, etc.). Although buildTierMemoryPath currently routes all
|
|
310
|
+
* non-correction, non-artifact memories to cold/facts/, scanning the full
|
|
311
|
+
* coldRoot ensures correctness if that routing ever changes and guards against
|
|
312
|
+
* files placed in unexpected subdirectories during manual operations or future
|
|
313
|
+
* refactors.
|
|
314
|
+
*
|
|
315
|
+
* Broadened in PR #402 round-6 (Finding UTsP): scanning only facts/ and
|
|
316
|
+
* corrections/ was a narrower-than-necessary subset of the cold directory
|
|
317
|
+
* tree. Correctness trumps the minor performance difference — cold scans
|
|
318
|
+
* already happen at most once per supersession write.
|
|
319
|
+
*
|
|
320
|
+
* Used by applyTemporalSupersession so that memories already demoted to
|
|
321
|
+
* cold/ can still be marked superseded when a newer hot fact arrives.
|
|
322
|
+
*
|
|
323
|
+
* Cached with a TTL (Finding UOGi, PR #402 round-6): back-to-back
|
|
324
|
+
* structured-attribute writes in the same burst reuse the cached result
|
|
325
|
+
* instead of re-scanning the cold tree on every call. The cache is
|
|
326
|
+
* invalidated whenever a write calls invalidateAllMemoriesCache() (which
|
|
327
|
+
* covers any hot→cold demotion that changes cold-tier contents) and
|
|
328
|
+
* expires after COLD_SCAN_CACHE_TTL_MS as a safety net.
|
|
329
|
+
*/
|
|
330
|
+
readAllColdMemories(): Promise<MemoryFile[]>;
|
|
198
331
|
/**
|
|
199
332
|
* Read archived memory markdown files under archive/.
|
|
200
333
|
* Used by long-term recall fallback when hot recall has no hits.
|
|
@@ -340,9 +473,27 @@ declare class StorageManager {
|
|
|
340
473
|
*/
|
|
341
474
|
addEntityAlias(name: string, alias: string): Promise<void>;
|
|
342
475
|
/**
|
|
343
|
-
* Set or
|
|
476
|
+
* Set or rewrite the synthesis layer of an entity file.
|
|
477
|
+
*/
|
|
478
|
+
updateEntitySynthesis(name: string, synthesis: string, options?: {
|
|
479
|
+
entityUpdatedAt?: string;
|
|
480
|
+
synthesisStructuredFactCount?: number;
|
|
481
|
+
synthesisStructuredFactDigest?: string;
|
|
482
|
+
synthesisTimelineCount?: number;
|
|
483
|
+
updatedAt?: string;
|
|
484
|
+
incrementVersion?: boolean;
|
|
485
|
+
}): Promise<void>;
|
|
486
|
+
/**
|
|
487
|
+
* Backward-compatible alias for legacy callers/tests.
|
|
344
488
|
*/
|
|
345
489
|
updateEntitySummary(name: string, summary: string): Promise<void>;
|
|
490
|
+
readEntitySynthesisQueue(): Promise<string[]>;
|
|
491
|
+
refreshEntitySynthesisQueue(): Promise<string[]>;
|
|
492
|
+
removeEntitySynthesisQueueEntries(entityNames: string[]): Promise<void>;
|
|
493
|
+
migrateEntityFilesToCompiledTruthTimeline(): Promise<{
|
|
494
|
+
total: number;
|
|
495
|
+
migrated: number;
|
|
496
|
+
}>;
|
|
346
497
|
/**
|
|
347
498
|
* Read all entity files and return lightweight EntityFile objects.
|
|
348
499
|
* Parsing is fast (~50-100ms for ~1,800 files) since entity files are small.
|
|
@@ -386,6 +537,16 @@ declare class StorageManager {
|
|
|
386
537
|
* Get a memory by its ID.
|
|
387
538
|
*/
|
|
388
539
|
getMemoryById(id: string): Promise<MemoryFile | null>;
|
|
540
|
+
/**
|
|
541
|
+
* Check which of the given memory IDs actually exist on disk.
|
|
542
|
+
*
|
|
543
|
+
* Uses a lightweight directory scan (collectActiveMemoryPaths) that reads
|
|
544
|
+
* file names without parsing frontmatter — much cheaper than readAllMemories()
|
|
545
|
+
* for simple existence checks like citation usage tracking.
|
|
546
|
+
*
|
|
547
|
+
* Returns the subset of `ids` that correspond to real memory files.
|
|
548
|
+
*/
|
|
549
|
+
filterExistingMemoryIds(ids: string[]): Promise<Set<string>>;
|
|
389
550
|
getProjectedMemoryState(id: string): Promise<MemoryProjectionCurrentState | null>;
|
|
390
551
|
browseProjectedMemories(options: ProjectedMemoryBrowseOptions): Promise<ProjectedMemoryBrowsePage | null>;
|
|
391
552
|
getProjectedGovernanceRecord(): Promise<ReturnType<typeof readProjectedGovernanceRecord>>;
|
|
@@ -450,4 +611,4 @@ declare class StorageManager {
|
|
|
450
611
|
private appendGeneratedMemoryLifecycleEventFailOpen;
|
|
451
612
|
}
|
|
452
613
|
|
|
453
|
-
export { ContentHashIndex, type MemoryLifecycleEventWriteOptions, type ReextractJobRequest, StorageManager, normalizeEntityName, parseEntityFile, serializeEntityFile };
|
|
614
|
+
export { ContentHashIndex, type MemoryLifecycleEventWriteOptions, type ReextractJobRequest, StorageManager, compareEntityTimestamps, fingerprintEntityStructuredFacts, isEntitySynthesisStale, normalizeAttributePairs, normalizeEntityName, parseEntityFile, serializeEntityFile };
|
package/dist/storage.js
CHANGED
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ContentHashIndex,
|
|
3
3
|
StorageManager,
|
|
4
|
+
compareEntityTimestamps,
|
|
5
|
+
fingerprintEntityStructuredFacts,
|
|
6
|
+
isEntitySynthesisStale,
|
|
7
|
+
normalizeAttributePairs,
|
|
4
8
|
normalizeEntityName,
|
|
5
9
|
parseEntityFile,
|
|
6
10
|
serializeEntityFile
|
|
7
|
-
} from "./chunk-
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
11
|
+
} from "./chunk-POMSFKTB.js";
|
|
12
|
+
import "./chunk-U2IQTSBY.js";
|
|
13
|
+
import "./chunk-4KAN3GZ3.js";
|
|
14
|
+
import "./chunk-6ZH4TU6I.js";
|
|
15
|
+
import "./chunk-6PFRXT4K.js";
|
|
10
16
|
import "./chunk-TP4FZJIZ.js";
|
|
11
17
|
import "./chunk-SCU65EZI.js";
|
|
12
18
|
import "./chunk-BOUYNNYD.js";
|
|
13
|
-
import "./chunk-DM2T26WE.js";
|
|
14
19
|
import "./chunk-QSVPYQPG.js";
|
|
20
|
+
import "./chunk-DM2T26WE.js";
|
|
15
21
|
import "./chunk-M62O4P4T.js";
|
|
16
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-4DJQYKMN.js";
|
|
23
|
+
import "./chunk-2ODBA7MQ.js";
|
|
17
24
|
export {
|
|
18
25
|
ContentHashIndex,
|
|
19
26
|
StorageManager,
|
|
27
|
+
compareEntityTimestamps,
|
|
28
|
+
fingerprintEntityStructuredFacts,
|
|
29
|
+
isEntitySynthesisStale,
|
|
30
|
+
normalizeAttributePairs,
|
|
20
31
|
normalizeEntityName,
|
|
21
32
|
parseEntityFile,
|
|
22
33
|
serializeEntityFile
|
package/dist/summarizer.js
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
HourlySummarizer
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BTY5RRRF.js";
|
|
4
4
|
import "./chunk-ETOW6ACV.js";
|
|
5
|
-
import "./chunk-
|
|
6
|
-
import "./chunk-
|
|
5
|
+
import "./chunk-UPMD5XND.js";
|
|
6
|
+
import "./chunk-FEMOX5AD.js";
|
|
7
7
|
import "./chunk-LK6SGL53.js";
|
|
8
|
-
import "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
8
|
+
import "./chunk-QKAH5B6E.js";
|
|
9
|
+
import "./chunk-KEG4GNGI.js";
|
|
10
|
+
import "./chunk-ODWDQNRE.js";
|
|
11
11
|
import "./chunk-Y27UJK6V.js";
|
|
12
12
|
import "./chunk-UZB5KHKX.js";
|
|
13
13
|
import "./chunk-MARWOCVP.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-2ODBA7MQ.js";
|
|
15
15
|
export {
|
|
16
16
|
HourlySummarizer
|
|
17
17
|
};
|