@remnic/core 1.0.0
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/dist/abstraction-nodes.d.ts +52 -0
- package/dist/abstraction-nodes.js +15 -0
- package/dist/abstraction-nodes.js.map +1 -0
- package/dist/access-cli.d.ts +5 -0
- package/dist/access-cli.js +308 -0
- package/dist/access-cli.js.map +1 -0
- package/dist/access-http.d.ts +158 -0
- package/dist/access-http.js +32 -0
- package/dist/access-http.js.map +1 -0
- package/dist/access-idempotency.d.ts +31 -0
- package/dist/access-idempotency.js +11 -0
- package/dist/access-idempotency.js.map +1 -0
- package/dist/access-mcp.d.ts +76 -0
- package/dist/access-mcp.js +8 -0
- package/dist/access-mcp.js.map +1 -0
- package/dist/access-schema.d.ts +266 -0
- package/dist/access-schema.js +29 -0
- package/dist/access-schema.js.map +1 -0
- package/dist/access-service.d.ts +614 -0
- package/dist/access-service.js +32 -0
- package/dist/access-service.js.map +1 -0
- package/dist/behavior-learner.d.ts +16 -0
- package/dist/behavior-learner.js +124 -0
- package/dist/behavior-learner.js.map +1 -0
- package/dist/behavior-signals.d.ts +15 -0
- package/dist/behavior-signals.js +11 -0
- package/dist/behavior-signals.js.map +1 -0
- package/dist/bootstrap.d.ts +46 -0
- package/dist/bootstrap.js +9 -0
- package/dist/bootstrap.js.map +1 -0
- package/dist/boxes.d.ts +93 -0
- package/dist/boxes.js +14 -0
- package/dist/boxes.js.map +1 -0
- package/dist/buffer.d.ts +22 -0
- package/dist/buffer.js +9 -0
- package/dist/buffer.js.map +1 -0
- package/dist/calibration.d.ts +81 -0
- package/dist/calibration.js +239 -0
- package/dist/calibration.js.map +1 -0
- package/dist/causal-behavior.d.ts +79 -0
- package/dist/causal-behavior.js +190 -0
- package/dist/causal-behavior.js.map +1 -0
- package/dist/causal-chain.d.ts +61 -0
- package/dist/causal-chain.js +24 -0
- package/dist/causal-chain.js.map +1 -0
- package/dist/causal-consolidation.d.ts +71 -0
- package/dist/causal-consolidation.js +211 -0
- package/dist/causal-consolidation.js.map +1 -0
- package/dist/causal-retrieval.d.ts +44 -0
- package/dist/causal-retrieval.js +184 -0
- package/dist/causal-retrieval.js.map +1 -0
- package/dist/causal-trajectory-graph.d.ts +13 -0
- package/dist/causal-trajectory-graph.js +59 -0
- package/dist/causal-trajectory-graph.js.map +1 -0
- package/dist/causal-trajectory.d.ts +68 -0
- package/dist/causal-trajectory.js +18 -0
- package/dist/causal-trajectory.js.map +1 -0
- package/dist/chunk-2CJCWDMR.js +87 -0
- package/dist/chunk-2CJCWDMR.js.map +1 -0
- package/dist/chunk-2NMMFZ5T.js +216 -0
- package/dist/chunk-2NMMFZ5T.js.map +1 -0
- package/dist/chunk-2PO5ZRKV.js +103 -0
- package/dist/chunk-2PO5ZRKV.js.map +1 -0
- package/dist/chunk-3QKK7QOS.js +154 -0
- package/dist/chunk-3QKK7QOS.js.map +1 -0
- package/dist/chunk-3SLRNYNG.js +26 -0
- package/dist/chunk-3SLRNYNG.js.map +1 -0
- package/dist/chunk-4A24LIM2.js +68 -0
- package/dist/chunk-4A24LIM2.js.map +1 -0
- package/dist/chunk-6HZ6AO2P.js +164 -0
- package/dist/chunk-6HZ6AO2P.js.map +1 -0
- package/dist/chunk-763GUIOU.js +302 -0
- package/dist/chunk-763GUIOU.js.map +1 -0
- package/dist/chunk-AAI7JARD.js +173 -0
- package/dist/chunk-AAI7JARD.js.map +1 -0
- package/dist/chunk-B7LOFDVE.js +112 -0
- package/dist/chunk-B7LOFDVE.js.map +1 -0
- package/dist/chunk-BDFZXRSO.js +318 -0
- package/dist/chunk-BDFZXRSO.js.map +1 -0
- package/dist/chunk-BOUYNNYD.js +707 -0
- package/dist/chunk-BOUYNNYD.js.map +1 -0
- package/dist/chunk-BRK4ODMI.js +60 -0
- package/dist/chunk-BRK4ODMI.js.map +1 -0
- package/dist/chunk-C6QPK5GG.js +111 -0
- package/dist/chunk-C6QPK5GG.js.map +1 -0
- package/dist/chunk-C7VW7C3F.js +117 -0
- package/dist/chunk-C7VW7C3F.js.map +1 -0
- package/dist/chunk-CDW777AI.js +621 -0
- package/dist/chunk-CDW777AI.js.map +1 -0
- package/dist/chunk-CULXMQJH.js +185 -0
- package/dist/chunk-CULXMQJH.js.map +1 -0
- package/dist/chunk-CXWFUJR2.js +1203 -0
- package/dist/chunk-CXWFUJR2.js.map +1 -0
- package/dist/chunk-DGXUHMOV.js +61 -0
- package/dist/chunk-DGXUHMOV.js.map +1 -0
- package/dist/chunk-DM2T26WE.js +61 -0
- package/dist/chunk-DM2T26WE.js.map +1 -0
- package/dist/chunk-DORBM6OB.js +81 -0
- package/dist/chunk-DORBM6OB.js.map +1 -0
- package/dist/chunk-DT5TVLJE.js +32 -0
- package/dist/chunk-DT5TVLJE.js.map +1 -0
- package/dist/chunk-EEQLFRUM.js +89 -0
- package/dist/chunk-EEQLFRUM.js.map +1 -0
- package/dist/chunk-EQINRHYR.js +672 -0
- package/dist/chunk-EQINRHYR.js.map +1 -0
- package/dist/chunk-ESSMF2FR.js +146 -0
- package/dist/chunk-ESSMF2FR.js.map +1 -0
- package/dist/chunk-ETOW6ACV.js +158 -0
- package/dist/chunk-ETOW6ACV.js.map +1 -0
- package/dist/chunk-FYIYMQ5N.js +221 -0
- package/dist/chunk-FYIYMQ5N.js.map +1 -0
- package/dist/chunk-G3AG3KZN.js +78 -0
- package/dist/chunk-G3AG3KZN.js.map +1 -0
- package/dist/chunk-GJR6D6KC.js +61 -0
- package/dist/chunk-GJR6D6KC.js.map +1 -0
- package/dist/chunk-GPGBSNKM.js +380 -0
- package/dist/chunk-GPGBSNKM.js.map +1 -0
- package/dist/chunk-H63EDPFJ.js +57 -0
- package/dist/chunk-H63EDPFJ.js.map +1 -0
- package/dist/chunk-HG2NKWR2.js +185 -0
- package/dist/chunk-HG2NKWR2.js.map +1 -0
- package/dist/chunk-HL4DB7TO.js +13 -0
- package/dist/chunk-HL4DB7TO.js.map +1 -0
- package/dist/chunk-HLBYLYRD.js +346 -0
- package/dist/chunk-HLBYLYRD.js.map +1 -0
- package/dist/chunk-HLXVTBF3.js +109 -0
- package/dist/chunk-HLXVTBF3.js.map +1 -0
- package/dist/chunk-IFFFR3MR.js +68 -0
- package/dist/chunk-IFFFR3MR.js.map +1 -0
- package/dist/chunk-ISY75RLM.js +1027 -0
- package/dist/chunk-ISY75RLM.js.map +1 -0
- package/dist/chunk-IZME7KW2.js +1886 -0
- package/dist/chunk-IZME7KW2.js.map +1 -0
- package/dist/chunk-J3BT33K7.js +720 -0
- package/dist/chunk-J3BT33K7.js.map +1 -0
- package/dist/chunk-J47FNDR7.js +113 -0
- package/dist/chunk-J47FNDR7.js.map +1 -0
- package/dist/chunk-JWPLJLDU.js +63 -0
- package/dist/chunk-JWPLJLDU.js.map +1 -0
- package/dist/chunk-K6WK37A6.js +865 -0
- package/dist/chunk-K6WK37A6.js.map +1 -0
- package/dist/chunk-KL4CP4SB.js +130 -0
- package/dist/chunk-KL4CP4SB.js.map +1 -0
- package/dist/chunk-KT4NEUNF.js +315 -0
- package/dist/chunk-KT4NEUNF.js.map +1 -0
- package/dist/chunk-KWBU5S5U.js +42 -0
- package/dist/chunk-KWBU5S5U.js.map +1 -0
- package/dist/chunk-L5RPWGFK.js +59 -0
- package/dist/chunk-L5RPWGFK.js.map +1 -0
- package/dist/chunk-L7WO3MZ4.js +128 -0
- package/dist/chunk-L7WO3MZ4.js.map +1 -0
- package/dist/chunk-LIRZNNUP.js +74 -0
- package/dist/chunk-LIRZNNUP.js.map +1 -0
- package/dist/chunk-LK6SGL53.js +22 -0
- package/dist/chunk-LK6SGL53.js.map +1 -0
- package/dist/chunk-LOBRX7VD.js +200 -0
- package/dist/chunk-LOBRX7VD.js.map +1 -0
- package/dist/chunk-LPSF4OQH.js +47 -0
- package/dist/chunk-LPSF4OQH.js.map +1 -0
- package/dist/chunk-LU3GQNDQ.js +152 -0
- package/dist/chunk-LU3GQNDQ.js.map +1 -0
- package/dist/chunk-M5KEYE5E.js +350 -0
- package/dist/chunk-M5KEYE5E.js.map +1 -0
- package/dist/chunk-M62O4P4T.js +41 -0
- package/dist/chunk-M62O4P4T.js.map +1 -0
- package/dist/chunk-MARWOCVP.js +48 -0
- package/dist/chunk-MARWOCVP.js.map +1 -0
- package/dist/chunk-MDDAA2AO.js +925 -0
- package/dist/chunk-MDDAA2AO.js.map +1 -0
- package/dist/chunk-MWGVGUIS.js +198 -0
- package/dist/chunk-MWGVGUIS.js.map +1 -0
- package/dist/chunk-N5AKDXAI.js +74 -0
- package/dist/chunk-N5AKDXAI.js.map +1 -0
- package/dist/chunk-NGAVDO7E.js +115 -0
- package/dist/chunk-NGAVDO7E.js.map +1 -0
- package/dist/chunk-NTTLPF7F.js +283 -0
- package/dist/chunk-NTTLPF7F.js.map +1 -0
- package/dist/chunk-ONRU4L2N.js +240 -0
- package/dist/chunk-ONRU4L2N.js.map +1 -0
- package/dist/chunk-ORZMT74A.js +209 -0
- package/dist/chunk-ORZMT74A.js.map +1 -0
- package/dist/chunk-OTAVQCSF.js +268 -0
- package/dist/chunk-OTAVQCSF.js.map +1 -0
- package/dist/chunk-PGK3VUHN.js +160 -0
- package/dist/chunk-PGK3VUHN.js.map +1 -0
- package/dist/chunk-Q6FETXJA.js +1362 -0
- package/dist/chunk-Q6FETXJA.js.map +1 -0
- package/dist/chunk-QANCTXQF.js +271 -0
- package/dist/chunk-QANCTXQF.js.map +1 -0
- package/dist/chunk-QCCCQT3O.js +189 -0
- package/dist/chunk-QCCCQT3O.js.map +1 -0
- package/dist/chunk-QDOSNLB4.js +1048 -0
- package/dist/chunk-QDOSNLB4.js.map +1 -0
- package/dist/chunk-QFQVZOGA.js +2168 -0
- package/dist/chunk-QFQVZOGA.js.map +1 -0
- package/dist/chunk-QPKFPHOO.js +178 -0
- package/dist/chunk-QPKFPHOO.js.map +1 -0
- package/dist/chunk-QSVPYQPG.js +268 -0
- package/dist/chunk-QSVPYQPG.js.map +1 -0
- package/dist/chunk-QWUUMMIK.js +3045 -0
- package/dist/chunk-QWUUMMIK.js.map +1 -0
- package/dist/chunk-QY2BHY5O.js +2378 -0
- package/dist/chunk-QY2BHY5O.js.map +1 -0
- package/dist/chunk-SCHEKPYH.js +349 -0
- package/dist/chunk-SCHEKPYH.js.map +1 -0
- package/dist/chunk-SCU65EZI.js +15 -0
- package/dist/chunk-SCU65EZI.js.map +1 -0
- package/dist/chunk-T4WRIV2C.js +170 -0
- package/dist/chunk-T4WRIV2C.js.map +1 -0
- package/dist/chunk-TKO4HZCK.js +1852 -0
- package/dist/chunk-TKO4HZCK.js.map +1 -0
- package/dist/chunk-TP4FZJIZ.js +93 -0
- package/dist/chunk-TP4FZJIZ.js.map +1 -0
- package/dist/chunk-TPB3I2AC.js +403 -0
- package/dist/chunk-TPB3I2AC.js.map +1 -0
- package/dist/chunk-TVVVQQAK.js +1431 -0
- package/dist/chunk-TVVVQQAK.js.map +1 -0
- package/dist/chunk-U4PV25RD.js +14 -0
- package/dist/chunk-U4PV25RD.js.map +1 -0
- package/dist/chunk-UCYSTFZR.js +284 -0
- package/dist/chunk-UCYSTFZR.js.map +1 -0
- package/dist/chunk-UHGBNIOS.js +205 -0
- package/dist/chunk-UHGBNIOS.js.map +1 -0
- package/dist/chunk-UIYZ5T3I.js +108 -0
- package/dist/chunk-UIYZ5T3I.js.map +1 -0
- package/dist/chunk-UV2FO7J4.js +747 -0
- package/dist/chunk-UV2FO7J4.js.map +1 -0
- package/dist/chunk-UZB5KHKX.js +63 -0
- package/dist/chunk-UZB5KHKX.js.map +1 -0
- package/dist/chunk-V3RXWQIE.js +626 -0
- package/dist/chunk-V3RXWQIE.js.map +1 -0
- package/dist/chunk-V4YC4LUK.js +444 -0
- package/dist/chunk-V4YC4LUK.js.map +1 -0
- package/dist/chunk-VEWZZM3H.js +133 -0
- package/dist/chunk-VEWZZM3H.js.map +1 -0
- package/dist/chunk-WWIQTB2Y.js +98 -0
- package/dist/chunk-WWIQTB2Y.js.map +1 -0
- package/dist/chunk-X7XN6YU4.js +24 -0
- package/dist/chunk-X7XN6YU4.js.map +1 -0
- package/dist/chunk-XKECPATV.js +202 -0
- package/dist/chunk-XKECPATV.js.map +1 -0
- package/dist/chunk-XYIK4LF6.js +75 -0
- package/dist/chunk-XYIK4LF6.js.map +1 -0
- package/dist/chunk-Y27UJK6V.js +39 -0
- package/dist/chunk-Y27UJK6V.js.map +1 -0
- package/dist/chunk-Y4Z4I6WK.js +9 -0
- package/dist/chunk-Y4Z4I6WK.js.map +1 -0
- package/dist/chunk-YAPUAHAY.js +10761 -0
- package/dist/chunk-YAPUAHAY.js.map +1 -0
- package/dist/chunk-YAZNBMNF.js +92 -0
- package/dist/chunk-YAZNBMNF.js.map +1 -0
- package/dist/chunk-YCN4BVDK.js +66 -0
- package/dist/chunk-YCN4BVDK.js.map +1 -0
- package/dist/chunk-YNCQ7E4M.js +388 -0
- package/dist/chunk-YNCQ7E4M.js.map +1 -0
- package/dist/chunk-YNI4S5WT.js +143 -0
- package/dist/chunk-YNI4S5WT.js.map +1 -0
- package/dist/chunk-YRMVARQP.js +406 -0
- package/dist/chunk-YRMVARQP.js.map +1 -0
- package/dist/chunk-Z5AAYHUC.js +79 -0
- package/dist/chunk-Z5AAYHUC.js.map +1 -0
- package/dist/chunk-Z5LAYHGJ.js +15 -0
- package/dist/chunk-Z5LAYHGJ.js.map +1 -0
- package/dist/chunk-ZJLY4QSU.js +823 -0
- package/dist/chunk-ZJLY4QSU.js.map +1 -0
- package/dist/chunk-ZKYI7UVO.js +276 -0
- package/dist/chunk-ZKYI7UVO.js.map +1 -0
- package/dist/chunk-ZPKBYX2F.js +297 -0
- package/dist/chunk-ZPKBYX2F.js.map +1 -0
- package/dist/chunking.d.ts +48 -0
- package/dist/chunking.js +11 -0
- package/dist/chunking.js.map +1 -0
- package/dist/cli.d.ts +1162 -0
- package/dist/cli.js +7187 -0
- package/dist/cli.js.map +1 -0
- package/dist/commitment-ledger.d.ts +83 -0
- package/dist/commitment-ledger.js +19 -0
- package/dist/commitment-ledger.js.map +1 -0
- package/dist/compression-optimizer.d.ts +37 -0
- package/dist/compression-optimizer.js +13 -0
- package/dist/compression-optimizer.js.map +1 -0
- package/dist/config.d.ts +6 -0
- package/dist/config.js +12 -0
- package/dist/config.js.map +1 -0
- package/dist/cue-anchors.d.ts +50 -0
- package/dist/cue-anchors.js +15 -0
- package/dist/cue-anchors.js.map +1 -0
- package/dist/dashboard-runtime.d.ts +46 -0
- package/dist/dashboard-runtime.js +10 -0
- package/dist/dashboard-runtime.js.map +1 -0
- package/dist/day-summary.d.ts +6 -0
- package/dist/day-summary.js +10 -0
- package/dist/day-summary.js.map +1 -0
- package/dist/delinearize.d.ts +34 -0
- package/dist/delinearize.js +11 -0
- package/dist/delinearize.js.map +1 -0
- package/dist/embedding-fallback.d.ts +22 -0
- package/dist/embedding-fallback.js +8 -0
- package/dist/embedding-fallback.js.map +1 -0
- package/dist/engine-P26JFSVY.js +19 -0
- package/dist/engine-P26JFSVY.js.map +1 -0
- package/dist/entity-retrieval.d.ts +23 -0
- package/dist/entity-retrieval.js +24 -0
- package/dist/entity-retrieval.js.map +1 -0
- package/dist/evals.d.ts +282 -0
- package/dist/evals.js +32 -0
- package/dist/evals.js.map +1 -0
- package/dist/explicit-capture.d.ts +60 -0
- package/dist/explicit-capture.js +23 -0
- package/dist/explicit-capture.js.map +1 -0
- package/dist/extraction.d.ts +141 -0
- package/dist/extraction.js +22 -0
- package/dist/extraction.js.map +1 -0
- package/dist/fallback-llm.d.ts +95 -0
- package/dist/fallback-llm.js +12 -0
- package/dist/fallback-llm.js.map +1 -0
- package/dist/graph-dashboard-diff.d.ts +12 -0
- package/dist/graph-dashboard-diff.js +8 -0
- package/dist/graph-dashboard-diff.js.map +1 -0
- package/dist/graph-dashboard-key.d.ts +5 -0
- package/dist/graph-dashboard-key.js +7 -0
- package/dist/graph-dashboard-key.js.map +1 -0
- package/dist/graph-dashboard-parser.d.ts +20 -0
- package/dist/graph-dashboard-parser.js +8 -0
- package/dist/graph-dashboard-parser.js.map +1 -0
- package/dist/graph.d.ts +157 -0
- package/dist/graph.js +27 -0
- package/dist/graph.js.map +1 -0
- package/dist/harmonic-retrieval.d.ts +27 -0
- package/dist/harmonic-retrieval.js +12 -0
- package/dist/harmonic-retrieval.js.map +1 -0
- package/dist/himem.d.ts +23 -0
- package/dist/himem.js +7 -0
- package/dist/himem.js.map +1 -0
- package/dist/hygiene.d.ts +24 -0
- package/dist/hygiene.js +9 -0
- package/dist/hygiene.js.map +1 -0
- package/dist/identity-continuity.d.ts +17 -0
- package/dist/identity-continuity.js +19 -0
- package/dist/identity-continuity.js.map +1 -0
- package/dist/importance.d.ts +25 -0
- package/dist/importance.js +11 -0
- package/dist/importance.js.map +1 -0
- package/dist/index.d.ts +923 -0
- package/dist/index.js +2512 -0
- package/dist/index.js.map +1 -0
- package/dist/intent.d.ts +8 -0
- package/dist/intent.js +13 -0
- package/dist/intent.js.map +1 -0
- package/dist/json-extract.d.ts +14 -0
- package/dist/json-extract.js +9 -0
- package/dist/json-extract.js.map +1 -0
- package/dist/json-store.d.ts +5 -0
- package/dist/json-store.js +11 -0
- package/dist/json-store.js.map +1 -0
- package/dist/legacy-hook-compat.d.ts +3 -0
- package/dist/legacy-hook-compat.js +35 -0
- package/dist/legacy-hook-compat.js.map +1 -0
- package/dist/lifecycle.d.ts +52 -0
- package/dist/lifecycle.js +21 -0
- package/dist/lifecycle.js.map +1 -0
- package/dist/local-llm.d.ts +154 -0
- package/dist/local-llm.js +10 -0
- package/dist/local-llm.js.map +1 -0
- package/dist/logger.d.ts +15 -0
- package/dist/logger.js +9 -0
- package/dist/logger.js.map +1 -0
- package/dist/memory-action-policy.d.ts +13 -0
- package/dist/memory-action-policy.js +7 -0
- package/dist/memory-action-policy.js.map +1 -0
- package/dist/memory-cache.d.ts +35 -0
- package/dist/memory-cache.js +37 -0
- package/dist/memory-cache.js.map +1 -0
- package/dist/memory-lifecycle-ledger-utils.d.ts +13 -0
- package/dist/memory-lifecycle-ledger-utils.js +23 -0
- package/dist/memory-lifecycle-ledger-utils.js.map +1 -0
- package/dist/memory-projection-format.d.ts +4 -0
- package/dist/memory-projection-format.js +9 -0
- package/dist/memory-projection-format.js.map +1 -0
- package/dist/memory-projection-store-NxMkbocT.d.ts +221 -0
- package/dist/memory-projection-store.d.ts +3 -0
- package/dist/memory-projection-store.js +31 -0
- package/dist/memory-projection-store.js.map +1 -0
- package/dist/model-registry.d.ts +60 -0
- package/dist/model-registry.js +8 -0
- package/dist/model-registry.js.map +1 -0
- package/dist/native-knowledge.d.ts +94 -0
- package/dist/native-knowledge.js +26 -0
- package/dist/native-knowledge.js.map +1 -0
- package/dist/negative.d.ts +26 -0
- package/dist/negative.js +8 -0
- package/dist/negative.js.map +1 -0
- package/dist/objective-state-writers.d.ts +22 -0
- package/dist/objective-state-writers.js +313 -0
- package/dist/objective-state-writers.js.map +1 -0
- package/dist/objective-state.d.ts +75 -0
- package/dist/objective-state.js +17 -0
- package/dist/objective-state.js.map +1 -0
- package/dist/openai-chat-compat.d.ts +13 -0
- package/dist/openai-chat-compat.js +11 -0
- package/dist/openai-chat-compat.js.map +1 -0
- package/dist/operator-toolkit.d.ts +304 -0
- package/dist/operator-toolkit.js +41 -0
- package/dist/operator-toolkit.js.map +1 -0
- package/dist/opik-exporter.d.ts +72 -0
- package/dist/opik-exporter.js +361 -0
- package/dist/opik-exporter.js.map +1 -0
- package/dist/orchestrator-zTa-Qo-1.d.ts +1104 -0
- package/dist/orchestrator.d.ts +21 -0
- package/dist/orchestrator.js +145 -0
- package/dist/orchestrator.js.map +1 -0
- package/dist/policy-runtime.d.ts +37 -0
- package/dist/policy-runtime.js +13 -0
- package/dist/policy-runtime.js.map +1 -0
- package/dist/port-C1GZFv8h.d.ts +41 -0
- package/dist/profiling.d.ts +80 -0
- package/dist/profiling.js +10 -0
- package/dist/profiling.js.map +1 -0
- package/dist/qmd-recall-cache.d.ts +29 -0
- package/dist/qmd-recall-cache.js +13 -0
- package/dist/qmd-recall-cache.js.map +1 -0
- package/dist/qmd.d.ts +105 -0
- package/dist/qmd.js +13 -0
- package/dist/qmd.js.map +1 -0
- package/dist/recall-qos.d.ts +33 -0
- package/dist/recall-qos.js +10 -0
- package/dist/recall-qos.js.map +1 -0
- package/dist/recall-query-policy.d.ts +20 -0
- package/dist/recall-query-policy.js +11 -0
- package/dist/recall-query-policy.js.map +1 -0
- package/dist/recall-state.d.ts +113 -0
- package/dist/recall-state.js +12 -0
- package/dist/recall-state.js.map +1 -0
- package/dist/recall-tokenization.d.ts +4 -0
- package/dist/recall-tokenization.js +9 -0
- package/dist/recall-tokenization.js.map +1 -0
- package/dist/reconstruct.d.ts +16 -0
- package/dist/reconstruct.js +7 -0
- package/dist/reconstruct.js.map +1 -0
- package/dist/release-changelog.d.ts +7 -0
- package/dist/release-changelog.js +30 -0
- package/dist/release-changelog.js.map +1 -0
- package/dist/relevance.d.ts +18 -0
- package/dist/relevance.js +8 -0
- package/dist/relevance.js.map +1 -0
- package/dist/rerank.d.ts +57 -0
- package/dist/rerank.js +11 -0
- package/dist/rerank.js.map +1 -0
- package/dist/resolve-provider-secret.d.ts +16 -0
- package/dist/resolve-provider-secret.js +11 -0
- package/dist/resolve-provider-secret.js.map +1 -0
- package/dist/resume-bundles.d.ts +66 -0
- package/dist/resume-bundles.js +27 -0
- package/dist/resume-bundles.js.map +1 -0
- package/dist/retrieval-agents.d.ts +129 -0
- package/dist/retrieval-agents.js +23 -0
- package/dist/retrieval-agents.js.map +1 -0
- package/dist/retrieval.d.ts +19 -0
- package/dist/retrieval.js +10 -0
- package/dist/retrieval.js.map +1 -0
- package/dist/sanitize.d.ts +9 -0
- package/dist/sanitize.js +9 -0
- package/dist/sanitize.js.map +1 -0
- package/dist/schemas.d.ts +688 -0
- package/dist/schemas.js +51 -0
- package/dist/schemas.js.map +1 -0
- package/dist/sdk-compat.d.ts +21 -0
- package/dist/sdk-compat.js +28 -0
- package/dist/sdk-compat.js.map +1 -0
- package/dist/semantic-consolidation.d.ts +42 -0
- package/dist/semantic-consolidation.js +12 -0
- package/dist/semantic-consolidation.js.map +1 -0
- package/dist/semantic-rule-promotion.d.ts +28 -0
- package/dist/semantic-rule-promotion.js +17 -0
- package/dist/semantic-rule-promotion.js.map +1 -0
- package/dist/semantic-rule-verifier.d.ts +19 -0
- package/dist/semantic-rule-verifier.js +18 -0
- package/dist/semantic-rule-verifier.js.map +1 -0
- package/dist/session-integrity.d.ts +67 -0
- package/dist/session-integrity.js +11 -0
- package/dist/session-integrity.js.map +1 -0
- package/dist/session-observer-bands.d.ts +6 -0
- package/dist/session-observer-bands.js +9 -0
- package/dist/session-observer-bands.js.map +1 -0
- package/dist/session-observer-state.d.ts +40 -0
- package/dist/session-observer-state.js +11 -0
- package/dist/session-observer-state.js.map +1 -0
- package/dist/signal.d.ts +6 -0
- package/dist/signal.js +9 -0
- package/dist/signal.js.map +1 -0
- package/dist/storage.d.ts +453 -0
- package/dist/storage.js +24 -0
- package/dist/storage.js.map +1 -0
- package/dist/store-contract.d.ts +10 -0
- package/dist/store-contract.js +21 -0
- package/dist/store-contract.js.map +1 -0
- package/dist/summarizer.d.ts +35 -0
- package/dist/summarizer.js +17 -0
- package/dist/summarizer.js.map +1 -0
- package/dist/summary-snapshot.d.ts +8 -0
- package/dist/summary-snapshot.js +13 -0
- package/dist/summary-snapshot.js.map +1 -0
- package/dist/temporal-index.d.ts +139 -0
- package/dist/temporal-index.js +29 -0
- package/dist/temporal-index.js.map +1 -0
- package/dist/threading.d.ts +62 -0
- package/dist/threading.js +8 -0
- package/dist/threading.js.map +1 -0
- package/dist/tier-migration.d.ts +44 -0
- package/dist/tier-migration.js +7 -0
- package/dist/tier-migration.js.map +1 -0
- package/dist/tier-routing.d.ts +21 -0
- package/dist/tier-routing.js +10 -0
- package/dist/tier-routing.js.map +1 -0
- package/dist/tmt.d.ts +79 -0
- package/dist/tmt.js +29 -0
- package/dist/tmt.js.map +1 -0
- package/dist/tokens.d.ts +24 -0
- package/dist/tokens.js +21 -0
- package/dist/tokens.js.map +1 -0
- package/dist/topics.d.ts +29 -0
- package/dist/topics.js +9 -0
- package/dist/topics.js.map +1 -0
- package/dist/transcript.d.ts +171 -0
- package/dist/transcript.js +9 -0
- package/dist/transcript.js.map +1 -0
- package/dist/trust-zones.d.ts +170 -0
- package/dist/trust-zones.js +32 -0
- package/dist/trust-zones.js.map +1 -0
- package/dist/types.d.ts +1243 -0
- package/dist/types.js +9 -0
- package/dist/types.js.map +1 -0
- package/dist/utility-learner.d.ts +59 -0
- package/dist/utility-learner.js +17 -0
- package/dist/utility-learner.js.map +1 -0
- package/dist/utility-runtime.d.ts +21 -0
- package/dist/utility-runtime.js +16 -0
- package/dist/utility-runtime.js.map +1 -0
- package/dist/utility-telemetry.d.ts +68 -0
- package/dist/utility-telemetry.js +17 -0
- package/dist/utility-telemetry.js.map +1 -0
- package/dist/verified-recall.d.ts +17 -0
- package/dist/verified-recall.js +19 -0
- package/dist/verified-recall.js.map +1 -0
- package/dist/version-utils.d.ts +4 -0
- package/dist/version-utils.js +7 -0
- package/dist/version-utils.js.map +1 -0
- package/dist/work-product-ledger.d.ts +65 -0
- package/dist/work-product-ledger.js +18 -0
- package/dist/work-product-ledger.js.map +1 -0
- package/package.json +58 -0
|
@@ -0,0 +1,672 @@
|
|
|
1
|
+
import {
|
|
2
|
+
countRecallTokenOverlap,
|
|
3
|
+
normalizeRecallTokens
|
|
4
|
+
} from "./chunk-DT5TVLJE.js";
|
|
5
|
+
import {
|
|
6
|
+
assertIsoRecordedAt,
|
|
7
|
+
assertSafePathSegment,
|
|
8
|
+
assertString,
|
|
9
|
+
isRecord,
|
|
10
|
+
optionalString,
|
|
11
|
+
optionalStringArray,
|
|
12
|
+
recordStoreDay,
|
|
13
|
+
validateStringRecord
|
|
14
|
+
} from "./chunk-DGXUHMOV.js";
|
|
15
|
+
import {
|
|
16
|
+
listJsonFiles,
|
|
17
|
+
readJsonFile
|
|
18
|
+
} from "./chunk-LPSF4OQH.js";
|
|
19
|
+
|
|
20
|
+
// src/trust-zones.ts
|
|
21
|
+
import path from "path";
|
|
22
|
+
import { mkdir, writeFile } from "fs/promises";
|
|
23
|
+
function isTrustZoneName(value) {
|
|
24
|
+
return value === "quarantine" || value === "working" || value === "trusted";
|
|
25
|
+
}
|
|
26
|
+
function validateMetadata(raw) {
|
|
27
|
+
return validateStringRecord(raw, "metadata");
|
|
28
|
+
}
|
|
29
|
+
function validateZone(raw, field) {
|
|
30
|
+
const value = assertString(raw, field);
|
|
31
|
+
if (!["quarantine", "working", "trusted"].includes(value)) {
|
|
32
|
+
throw new Error(`${field} must be one of quarantine|working|trusted`);
|
|
33
|
+
}
|
|
34
|
+
return value;
|
|
35
|
+
}
|
|
36
|
+
function validateKind(raw) {
|
|
37
|
+
const value = assertString(raw, "kind");
|
|
38
|
+
if (!["memory", "artifact", "state", "trajectory", "external"].includes(value)) {
|
|
39
|
+
throw new Error("kind must be one of memory|artifact|state|trajectory|external");
|
|
40
|
+
}
|
|
41
|
+
return value;
|
|
42
|
+
}
|
|
43
|
+
function validateProvenance(raw) {
|
|
44
|
+
if (!isRecord(raw)) throw new Error("provenance must be an object");
|
|
45
|
+
const sourceClass = assertString(raw.sourceClass, "provenance.sourceClass");
|
|
46
|
+
if (!["tool_output", "web_content", "subagent_trace", "system_memory", "user_input", "manual"].includes(sourceClass)) {
|
|
47
|
+
throw new Error("provenance.sourceClass must be one of tool_output|web_content|subagent_trace|system_memory|user_input|manual");
|
|
48
|
+
}
|
|
49
|
+
return {
|
|
50
|
+
sourceClass,
|
|
51
|
+
observedAt: assertIsoRecordedAt(assertString(raw.observedAt, "provenance.observedAt"), "provenance.observedAt"),
|
|
52
|
+
sessionKey: optionalString(raw.sessionKey),
|
|
53
|
+
sourceId: optionalString(raw.sourceId),
|
|
54
|
+
evidenceHash: optionalString(raw.evidenceHash)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
function resolveTrustZoneStoreDir(memoryDir, overrideDir) {
|
|
58
|
+
if (typeof overrideDir === "string" && overrideDir.trim().length > 0) {
|
|
59
|
+
return overrideDir.trim();
|
|
60
|
+
}
|
|
61
|
+
return path.join(memoryDir, "state", "trust-zones");
|
|
62
|
+
}
|
|
63
|
+
function validateTrustZoneRecord(raw) {
|
|
64
|
+
if (!isRecord(raw)) throw new Error("trust-zone record must be an object");
|
|
65
|
+
if (raw.schemaVersion !== 1) throw new Error("schemaVersion must be 1");
|
|
66
|
+
return {
|
|
67
|
+
schemaVersion: 1,
|
|
68
|
+
recordId: assertSafePathSegment(assertString(raw.recordId, "recordId"), "recordId"),
|
|
69
|
+
zone: validateZone(raw.zone, "zone"),
|
|
70
|
+
recordedAt: assertIsoRecordedAt(assertString(raw.recordedAt, "recordedAt")),
|
|
71
|
+
kind: validateKind(raw.kind),
|
|
72
|
+
summary: assertString(raw.summary, "summary"),
|
|
73
|
+
provenance: validateProvenance(raw.provenance),
|
|
74
|
+
promotedFromZone: raw.promotedFromZone === void 0 ? void 0 : validateZone(raw.promotedFromZone, "promotedFromZone"),
|
|
75
|
+
entityRefs: optionalStringArray(raw.entityRefs, "entityRefs"),
|
|
76
|
+
tags: optionalStringArray(raw.tags, "tags"),
|
|
77
|
+
metadata: validateMetadata(raw.metadata)
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
async function recordTrustZoneRecord(options) {
|
|
81
|
+
const rootDir = resolveTrustZoneStoreDir(options.memoryDir, options.trustZoneStoreDir);
|
|
82
|
+
const validated = validateTrustZoneRecord(options.record);
|
|
83
|
+
const day = recordStoreDay(validated.recordedAt);
|
|
84
|
+
const zoneDir = path.join(rootDir, "zones", validated.zone, day);
|
|
85
|
+
const filePath = path.join(zoneDir, `${validated.recordId}.json`);
|
|
86
|
+
await mkdir(zoneDir, { recursive: true });
|
|
87
|
+
await writeFile(filePath, JSON.stringify(validated, null, 2), "utf8");
|
|
88
|
+
return filePath;
|
|
89
|
+
}
|
|
90
|
+
function hasAnchoredProvenance(record) {
|
|
91
|
+
return Boolean(record.provenance.sourceId && record.provenance.evidenceHash);
|
|
92
|
+
}
|
|
93
|
+
function buildPromotionRecordId(sourceRecordId, targetZone, recordedAt) {
|
|
94
|
+
const suffix = recordedAt.replace(/[^0-9]/g, "").slice(0, 14);
|
|
95
|
+
return `${sourceRecordId}-${targetZone}-${suffix}`;
|
|
96
|
+
}
|
|
97
|
+
function dedupeStrings(values) {
|
|
98
|
+
const out = values.filter((value) => typeof value === "string" && value.length > 0);
|
|
99
|
+
if (out.length === 0) return void 0;
|
|
100
|
+
return [...new Set(out)];
|
|
101
|
+
}
|
|
102
|
+
function hasOverlap(left, right) {
|
|
103
|
+
if (!left || !right || left.length === 0 || right.length === 0) return false;
|
|
104
|
+
const rightSet = new Set(right);
|
|
105
|
+
return left.some((value) => rightSet.has(value));
|
|
106
|
+
}
|
|
107
|
+
function corroborationTags(record) {
|
|
108
|
+
if (!record.tags || record.tags.length === 0) return void 0;
|
|
109
|
+
const filtered = record.tags.filter((tag) => tag !== "trust-zone-demo" && tag !== "enterprise-demo");
|
|
110
|
+
return filtered.length > 0 ? filtered : void 0;
|
|
111
|
+
}
|
|
112
|
+
function requiresCorroboration(record, targetZone, poisoningDefenseEnabled) {
|
|
113
|
+
return poisoningDefenseEnabled === true && targetZone === "trusted" && record.zone === "working" && ["tool_output", "web_content", "subagent_trace"].includes(record.provenance.sourceClass);
|
|
114
|
+
}
|
|
115
|
+
function summarizeCorroboration(options) {
|
|
116
|
+
const corroborating = options.records.filter((candidate) => {
|
|
117
|
+
if (candidate.recordId === options.sourceRecord.recordId) return false;
|
|
118
|
+
if (candidate.zone === "quarantine") return false;
|
|
119
|
+
if (hasAnchoredProvenance(candidate) !== true) return false;
|
|
120
|
+
if (candidate.provenance.sourceClass === options.sourceRecord.provenance.sourceClass) return false;
|
|
121
|
+
return hasOverlap(candidate.entityRefs, options.sourceRecord.entityRefs) || hasOverlap(corroborationTags(candidate), corroborationTags(options.sourceRecord));
|
|
122
|
+
});
|
|
123
|
+
return {
|
|
124
|
+
count: corroborating.length,
|
|
125
|
+
sourceClasses: [...new Set(corroborating.map((record) => record.provenance.sourceClass))]
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
var SOURCE_CLASS_WEIGHTS = {
|
|
129
|
+
manual: 0.9,
|
|
130
|
+
system_memory: 0.85,
|
|
131
|
+
user_input: 0.75,
|
|
132
|
+
tool_output: 0.55,
|
|
133
|
+
subagent_trace: 0.45,
|
|
134
|
+
web_content: 0.35
|
|
135
|
+
};
|
|
136
|
+
function roundTrustScore(value) {
|
|
137
|
+
return Math.round(value * 1e3) / 1e3;
|
|
138
|
+
}
|
|
139
|
+
function trustScoreBand(total) {
|
|
140
|
+
if (total >= 0.8) return "high";
|
|
141
|
+
if (total >= 0.5) return "medium";
|
|
142
|
+
return "low";
|
|
143
|
+
}
|
|
144
|
+
function scoreTrustZoneProvenance(record) {
|
|
145
|
+
const sourceClassWeight = SOURCE_CLASS_WEIGHTS[record.provenance.sourceClass];
|
|
146
|
+
const sourceIdBonus = typeof record.provenance.sourceId === "string" ? 0.1 : 0;
|
|
147
|
+
const evidenceHashBonus = typeof record.provenance.evidenceHash === "string" ? 0.2 : 0;
|
|
148
|
+
const sessionKeyBonus = typeof record.provenance.sessionKey === "string" ? 0.05 : 0;
|
|
149
|
+
const total = roundTrustScore(
|
|
150
|
+
Math.min(1, sourceClassWeight + sourceIdBonus + evidenceHashBonus + sessionKeyBonus)
|
|
151
|
+
);
|
|
152
|
+
return {
|
|
153
|
+
total,
|
|
154
|
+
band: trustScoreBand(total),
|
|
155
|
+
anchored: hasAnchoredProvenance(record),
|
|
156
|
+
sourceClassWeight,
|
|
157
|
+
sourceIdBonus,
|
|
158
|
+
evidenceHashBonus,
|
|
159
|
+
sessionKeyBonus
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function planTrustZonePromotion(options) {
|
|
163
|
+
const { record, targetZone } = options;
|
|
164
|
+
const reasons = [];
|
|
165
|
+
const provenanceAnchored = hasAnchoredProvenance(record);
|
|
166
|
+
if (record.zone === targetZone) {
|
|
167
|
+
reasons.push(`record is already in the ${targetZone} zone`);
|
|
168
|
+
}
|
|
169
|
+
if (record.zone === "trusted") {
|
|
170
|
+
reasons.push("trusted records are terminal and cannot be promoted again");
|
|
171
|
+
}
|
|
172
|
+
if (record.zone === "quarantine" && targetZone === "trusted") {
|
|
173
|
+
reasons.push("quarantine records must pass through working before trusted promotion");
|
|
174
|
+
}
|
|
175
|
+
if (record.zone === "working" && targetZone === "quarantine") {
|
|
176
|
+
reasons.push("working records cannot be demoted back into quarantine in this promotion path");
|
|
177
|
+
}
|
|
178
|
+
if (record.zone === "quarantine" && targetZone !== "working") {
|
|
179
|
+
reasons.push("quarantine promotions only support the working zone");
|
|
180
|
+
}
|
|
181
|
+
if (record.zone === "working" && targetZone !== "trusted") {
|
|
182
|
+
reasons.push("working promotions only support the trusted zone");
|
|
183
|
+
}
|
|
184
|
+
if (targetZone === "trusted" && ["tool_output", "web_content", "subagent_trace"].includes(record.provenance.sourceClass) && provenanceAnchored !== true) {
|
|
185
|
+
reasons.push("trusted promotion for external/tool-derived provenance requires both provenance.sourceId and provenance.evidenceHash");
|
|
186
|
+
}
|
|
187
|
+
return {
|
|
188
|
+
allowed: reasons.length === 0,
|
|
189
|
+
reasons,
|
|
190
|
+
sourceRecordId: record.recordId,
|
|
191
|
+
sourceZone: record.zone,
|
|
192
|
+
targetZone,
|
|
193
|
+
provenanceAnchored
|
|
194
|
+
};
|
|
195
|
+
}
|
|
196
|
+
async function findTrustZoneRecordById(options) {
|
|
197
|
+
const { entries } = await readTrustZoneRecordEntries(options);
|
|
198
|
+
entries.sort((a, b) => b.record.recordedAt.localeCompare(a.record.recordedAt));
|
|
199
|
+
return entries.find((entry) => entry.record.recordId === options.recordId)?.record ?? null;
|
|
200
|
+
}
|
|
201
|
+
async function promoteTrustZoneRecord(options) {
|
|
202
|
+
if (options.enabled !== true) {
|
|
203
|
+
throw new Error("trust zone promotion requires trustZonesEnabled=true");
|
|
204
|
+
}
|
|
205
|
+
if (options.promotionEnabled !== true) {
|
|
206
|
+
throw new Error("trust zone promotion requires quarantinePromotionEnabled=true");
|
|
207
|
+
}
|
|
208
|
+
const sourceRecord = await findTrustZoneRecordById({
|
|
209
|
+
memoryDir: options.memoryDir,
|
|
210
|
+
trustZoneStoreDir: options.trustZoneStoreDir,
|
|
211
|
+
recordId: assertSafePathSegment(assertString(options.sourceRecordId, "sourceRecordId"), "sourceRecordId")
|
|
212
|
+
});
|
|
213
|
+
if (!sourceRecord) {
|
|
214
|
+
throw new Error(`source trust-zone record not found: ${options.sourceRecordId}`);
|
|
215
|
+
}
|
|
216
|
+
const plan = planTrustZonePromotion({
|
|
217
|
+
record: sourceRecord,
|
|
218
|
+
targetZone: options.targetZone
|
|
219
|
+
});
|
|
220
|
+
if (!plan.allowed) {
|
|
221
|
+
throw new Error(`trust-zone promotion denied: ${plan.reasons.join("; ")}`);
|
|
222
|
+
}
|
|
223
|
+
const corroboration = requiresCorroboration(sourceRecord, options.targetZone, options.poisoningDefenseEnabled === true) ? summarizeCorroboration({
|
|
224
|
+
sourceRecord,
|
|
225
|
+
records: (await readTrustZoneRecordEntries({
|
|
226
|
+
memoryDir: options.memoryDir,
|
|
227
|
+
trustZoneStoreDir: options.trustZoneStoreDir
|
|
228
|
+
})).entries.map((entry) => entry.record)
|
|
229
|
+
}) : null;
|
|
230
|
+
if (corroboration && corroboration.count === 0) {
|
|
231
|
+
throw new Error("trust-zone promotion denied: corroboration is required for risky trusted promotions");
|
|
232
|
+
}
|
|
233
|
+
const recordedAt = assertIsoRecordedAt(assertString(options.recordedAt, "recordedAt"));
|
|
234
|
+
const promotionReason = assertString(options.promotionReason, "promotionReason");
|
|
235
|
+
const nextRecord = {
|
|
236
|
+
schemaVersion: 1,
|
|
237
|
+
recordId: buildPromotionRecordId(sourceRecord.recordId, options.targetZone, recordedAt),
|
|
238
|
+
zone: options.targetZone,
|
|
239
|
+
recordedAt,
|
|
240
|
+
kind: sourceRecord.kind,
|
|
241
|
+
summary: optionalString(options.summary) ?? sourceRecord.summary,
|
|
242
|
+
provenance: sourceRecord.provenance,
|
|
243
|
+
promotedFromZone: sourceRecord.zone,
|
|
244
|
+
entityRefs: sourceRecord.entityRefs,
|
|
245
|
+
tags: dedupeStrings([...sourceRecord.tags ?? [], "promotion"]),
|
|
246
|
+
metadata: {
|
|
247
|
+
...sourceRecord.metadata ?? {},
|
|
248
|
+
sourceRecordId: sourceRecord.recordId,
|
|
249
|
+
promotionReason,
|
|
250
|
+
...corroboration ? {
|
|
251
|
+
corroborated: "true",
|
|
252
|
+
corroborationCount: String(corroboration.count),
|
|
253
|
+
corroborationSources: corroboration.sourceClasses.join(",")
|
|
254
|
+
} : {}
|
|
255
|
+
}
|
|
256
|
+
};
|
|
257
|
+
if (options.dryRun === true) {
|
|
258
|
+
return {
|
|
259
|
+
plan,
|
|
260
|
+
wroteRecord: false,
|
|
261
|
+
record: nextRecord,
|
|
262
|
+
sourceRecord
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const filePath = await recordTrustZoneRecord({
|
|
266
|
+
memoryDir: options.memoryDir,
|
|
267
|
+
trustZoneStoreDir: options.trustZoneStoreDir,
|
|
268
|
+
record: nextRecord
|
|
269
|
+
});
|
|
270
|
+
return {
|
|
271
|
+
plan,
|
|
272
|
+
wroteRecord: true,
|
|
273
|
+
record: nextRecord,
|
|
274
|
+
filePath,
|
|
275
|
+
sourceRecord
|
|
276
|
+
};
|
|
277
|
+
}
|
|
278
|
+
async function readTrustZoneRecordEntries(options) {
|
|
279
|
+
const rootDir = resolveTrustZoneStoreDir(options.memoryDir, options.trustZoneStoreDir);
|
|
280
|
+
const files = await listJsonFiles(path.join(rootDir, "zones"));
|
|
281
|
+
const entries = [];
|
|
282
|
+
const invalidRecords = [];
|
|
283
|
+
for (const filePath of files) {
|
|
284
|
+
try {
|
|
285
|
+
entries.push({
|
|
286
|
+
filePath,
|
|
287
|
+
record: validateTrustZoneRecord(await readJsonFile(filePath))
|
|
288
|
+
});
|
|
289
|
+
} catch (error) {
|
|
290
|
+
invalidRecords.push({
|
|
291
|
+
path: filePath,
|
|
292
|
+
error: error instanceof Error ? error.message : String(error)
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
}
|
|
296
|
+
return { files, entries, invalidRecords };
|
|
297
|
+
}
|
|
298
|
+
function lexicalScoreTrustZoneRecord(record, queryTokens) {
|
|
299
|
+
const weightedFields = [
|
|
300
|
+
["summary", record.summary, 4],
|
|
301
|
+
["kind", record.kind, 1],
|
|
302
|
+
["zone", record.zone, 1],
|
|
303
|
+
["sourceClass", record.provenance.sourceClass, 1],
|
|
304
|
+
["entityRefs", record.entityRefs?.join(" "), 2],
|
|
305
|
+
["tags", record.tags?.join(" "), 2],
|
|
306
|
+
["metadata", record.metadata ? Object.values(record.metadata).join(" ") : void 0, 1]
|
|
307
|
+
];
|
|
308
|
+
let score = 0;
|
|
309
|
+
const matchedFields = [];
|
|
310
|
+
for (const [field, value, weight] of weightedFields) {
|
|
311
|
+
const matches = countRecallTokenOverlap(queryTokens, value, ["what"]);
|
|
312
|
+
if (matches > 0) matchedFields.push(field);
|
|
313
|
+
score += matches * weight;
|
|
314
|
+
}
|
|
315
|
+
return { score, matchedFields };
|
|
316
|
+
}
|
|
317
|
+
function zonePriority(zone) {
|
|
318
|
+
switch (zone) {
|
|
319
|
+
case "trusted":
|
|
320
|
+
return 3;
|
|
321
|
+
case "working":
|
|
322
|
+
return 2;
|
|
323
|
+
case "quarantine":
|
|
324
|
+
return 1;
|
|
325
|
+
}
|
|
326
|
+
}
|
|
327
|
+
function scoreTrustZoneRecord(record, lexicalScore, sessionKey) {
|
|
328
|
+
let score = lexicalScore;
|
|
329
|
+
score += zonePriority(record.zone);
|
|
330
|
+
if (sessionKey && record.provenance.sessionKey === sessionKey) score += 1;
|
|
331
|
+
const recordedAtMs = Date.parse(record.recordedAt);
|
|
332
|
+
if (Number.isFinite(recordedAtMs)) {
|
|
333
|
+
const ageHours = Math.max(0, (Date.now() - recordedAtMs) / 36e5);
|
|
334
|
+
score += 1 / (1 + ageHours);
|
|
335
|
+
}
|
|
336
|
+
return score;
|
|
337
|
+
}
|
|
338
|
+
async function searchTrustZoneRecords(options) {
|
|
339
|
+
const maxResults = Math.max(0, Math.floor(options.maxResults));
|
|
340
|
+
if (maxResults === 0) return [];
|
|
341
|
+
const { entries } = await readTrustZoneRecordEntries(options);
|
|
342
|
+
const records = entries.map((entry) => entry.record);
|
|
343
|
+
const candidates = records.filter((record) => record.zone !== "quarantine");
|
|
344
|
+
if (candidates.length === 0) return [];
|
|
345
|
+
const queryTokens = new Set(normalizeRecallTokens(options.query, ["what"]));
|
|
346
|
+
if (queryTokens.size === 0) return [];
|
|
347
|
+
const scored = candidates.map((record) => {
|
|
348
|
+
const lexical = lexicalScoreTrustZoneRecord(record, queryTokens);
|
|
349
|
+
return {
|
|
350
|
+
record,
|
|
351
|
+
matchedFields: lexical.matchedFields,
|
|
352
|
+
lexicalScore: lexical.score,
|
|
353
|
+
score: scoreTrustZoneRecord(record, lexical.score, options.sessionKey)
|
|
354
|
+
};
|
|
355
|
+
});
|
|
356
|
+
const filtered = scored.filter((result) => result.lexicalScore > 0);
|
|
357
|
+
filtered.sort((left, right) => {
|
|
358
|
+
if (right.score !== left.score) return right.score - left.score;
|
|
359
|
+
return right.record.recordedAt.localeCompare(left.record.recordedAt);
|
|
360
|
+
});
|
|
361
|
+
return filtered.slice(0, maxResults).map(({ record, score, matchedFields }) => ({
|
|
362
|
+
record,
|
|
363
|
+
score,
|
|
364
|
+
matchedFields
|
|
365
|
+
}));
|
|
366
|
+
}
|
|
367
|
+
async function listTrustZoneRecords(options) {
|
|
368
|
+
const limit = Number.isFinite(options.limit) ? Math.max(1, Math.min(200, Math.floor(options.limit ?? 25))) : 25;
|
|
369
|
+
const offset = Number.isFinite(options.offset) ? Math.max(0, Math.floor(options.offset ?? 0)) : 0;
|
|
370
|
+
const zoneFilter = options.zone?.trim();
|
|
371
|
+
const kindFilter = options.kind?.trim();
|
|
372
|
+
const sourceClassFilter = options.sourceClass?.trim();
|
|
373
|
+
const queryTokens = new Set(normalizeRecallTokens(options.query ?? "", ["what"]));
|
|
374
|
+
const { entries } = await readTrustZoneRecordEntries(options);
|
|
375
|
+
const filtered = entries.filter((entry) => !zoneFilter || entry.record.zone === zoneFilter).filter((entry) => !kindFilter || entry.record.kind === kindFilter).filter((entry) => !sourceClassFilter || entry.record.provenance.sourceClass === sourceClassFilter).map((entry) => ({
|
|
376
|
+
entry,
|
|
377
|
+
lexical: queryTokens.size > 0 ? lexicalScoreTrustZoneRecord(entry.record, queryTokens) : null
|
|
378
|
+
})).filter((candidate) => queryTokens.size === 0 || (candidate.lexical?.score ?? 0) > 0);
|
|
379
|
+
filtered.sort((left, right) => {
|
|
380
|
+
const leftScore = left.lexical?.score ?? 0;
|
|
381
|
+
const rightScore = right.lexical?.score ?? 0;
|
|
382
|
+
if (rightScore !== leftScore) return rightScore - leftScore;
|
|
383
|
+
return right.entry.record.recordedAt.localeCompare(left.entry.record.recordedAt);
|
|
384
|
+
});
|
|
385
|
+
return {
|
|
386
|
+
total: filtered.length,
|
|
387
|
+
count: filtered.slice(offset, offset + limit).length,
|
|
388
|
+
limit,
|
|
389
|
+
offset,
|
|
390
|
+
records: filtered.slice(offset, offset + limit).map((candidate) => candidate.entry),
|
|
391
|
+
allRecords: entries.map((entry) => entry.record)
|
|
392
|
+
};
|
|
393
|
+
}
|
|
394
|
+
function summarizeTrustZonePromotionReadiness(options) {
|
|
395
|
+
if (options.record.zone === "trusted") {
|
|
396
|
+
return {
|
|
397
|
+
allowed: false,
|
|
398
|
+
reasons: ["trusted records are terminal and do not have a next promotion step"],
|
|
399
|
+
requiresCorroboration: false,
|
|
400
|
+
corroborationCount: 0,
|
|
401
|
+
corroborationSourceClasses: []
|
|
402
|
+
};
|
|
403
|
+
}
|
|
404
|
+
const nextTargetZone = options.record.zone === "quarantine" ? "working" : "trusted";
|
|
405
|
+
const plan = planTrustZonePromotion({
|
|
406
|
+
record: options.record,
|
|
407
|
+
targetZone: nextTargetZone
|
|
408
|
+
});
|
|
409
|
+
const requires = requiresCorroboration(options.record, nextTargetZone, options.poisoningDefenseEnabled);
|
|
410
|
+
const corroboration = requires ? summarizeCorroboration({
|
|
411
|
+
sourceRecord: options.record,
|
|
412
|
+
records: options.allRecords
|
|
413
|
+
}) : { count: 0, sourceClasses: [] };
|
|
414
|
+
const reasons = [...plan.reasons];
|
|
415
|
+
if (requires && corroboration.count === 0) {
|
|
416
|
+
reasons.push("trusted promotion requires corroboration from an independent non-quarantine source");
|
|
417
|
+
}
|
|
418
|
+
return {
|
|
419
|
+
nextTargetZone,
|
|
420
|
+
allowed: plan.allowed && (!requires || corroboration.count > 0),
|
|
421
|
+
reasons,
|
|
422
|
+
requiresCorroboration: requires,
|
|
423
|
+
corroborationCount: corroboration.count,
|
|
424
|
+
corroborationSourceClasses: corroboration.sourceClasses
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
function addMinutes(baseIso, minutes) {
|
|
428
|
+
const baseMs = Date.parse(baseIso);
|
|
429
|
+
if (!Number.isFinite(baseMs)) {
|
|
430
|
+
throw new Error("recordedAt must be a valid ISO timestamp");
|
|
431
|
+
}
|
|
432
|
+
return new Date(baseMs + minutes * 6e4).toISOString();
|
|
433
|
+
}
|
|
434
|
+
function buildTrustZoneDemoSeedRunId(baseRecordedAt) {
|
|
435
|
+
return baseRecordedAt.replace(/[^0-9]/g, "");
|
|
436
|
+
}
|
|
437
|
+
function buildTrustZoneDemoRecordId(baseId, seedRunId) {
|
|
438
|
+
return `${baseId}-${seedRunId}`;
|
|
439
|
+
}
|
|
440
|
+
function buildTrustZoneDemoRecords(baseRecordedAt, scenario) {
|
|
441
|
+
const demoTag = "trust-zone-demo";
|
|
442
|
+
const commonMetadata = {
|
|
443
|
+
demoScenario: scenario,
|
|
444
|
+
demoSeed: "true"
|
|
445
|
+
};
|
|
446
|
+
const seedRunId = buildTrustZoneDemoSeedRunId(baseRecordedAt);
|
|
447
|
+
return [
|
|
448
|
+
{
|
|
449
|
+
schemaVersion: 1,
|
|
450
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-quarantine-ready", seedRunId),
|
|
451
|
+
zone: "quarantine",
|
|
452
|
+
recordedAt: addMinutes(baseRecordedAt, 0),
|
|
453
|
+
kind: "external",
|
|
454
|
+
summary: "Vendor portal policy excerpt captured before validation for Acme Industrial onboarding.",
|
|
455
|
+
provenance: {
|
|
456
|
+
sourceClass: "web_content",
|
|
457
|
+
observedAt: addMinutes(baseRecordedAt, -2),
|
|
458
|
+
sessionKey: "demo:enterprise-buyer-v1",
|
|
459
|
+
sourceId: "https://vendor.example.com/policies/acme-industrial.pdf",
|
|
460
|
+
evidenceHash: "sha256:vendor-portal-policy-proof"
|
|
461
|
+
},
|
|
462
|
+
entityRefs: ["account:acme-industrial", "policy:vendor-onboarding"],
|
|
463
|
+
tags: [demoTag, "enterprise-demo", "vendor-policy"],
|
|
464
|
+
metadata: {
|
|
465
|
+
...commonMetadata,
|
|
466
|
+
story: "captured-external-policy"
|
|
467
|
+
}
|
|
468
|
+
},
|
|
469
|
+
{
|
|
470
|
+
schemaVersion: 1,
|
|
471
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-working-blocked", seedRunId),
|
|
472
|
+
zone: "working",
|
|
473
|
+
recordedAt: addMinutes(baseRecordedAt, 2),
|
|
474
|
+
kind: "external",
|
|
475
|
+
summary: "Unverified rumor about a production freeze captured without source evidence.",
|
|
476
|
+
provenance: {
|
|
477
|
+
sourceClass: "subagent_trace",
|
|
478
|
+
observedAt: addMinutes(baseRecordedAt, 1),
|
|
479
|
+
sessionKey: "demo:enterprise-buyer-v1"
|
|
480
|
+
},
|
|
481
|
+
entityRefs: ["workspace:finance", "incident:freeze-rumor"],
|
|
482
|
+
tags: [demoTag, "enterprise-demo", "needs-evidence"],
|
|
483
|
+
metadata: {
|
|
484
|
+
...commonMetadata,
|
|
485
|
+
story: "working-missing-provenance"
|
|
486
|
+
}
|
|
487
|
+
},
|
|
488
|
+
{
|
|
489
|
+
schemaVersion: 1,
|
|
490
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-working-awaiting-corroboration", seedRunId),
|
|
491
|
+
zone: "working",
|
|
492
|
+
recordedAt: addMinutes(baseRecordedAt, 6),
|
|
493
|
+
kind: "state",
|
|
494
|
+
summary: "Tool output says the finance SSO certificate rotation completed successfully.",
|
|
495
|
+
provenance: {
|
|
496
|
+
sourceClass: "tool_output",
|
|
497
|
+
observedAt: addMinutes(baseRecordedAt, 5),
|
|
498
|
+
sessionKey: "demo:enterprise-buyer-v1",
|
|
499
|
+
sourceId: "tool:sso-rotation-run-42",
|
|
500
|
+
evidenceHash: "sha256:sso-rotation-log"
|
|
501
|
+
},
|
|
502
|
+
entityRefs: ["finding:finance-sso-certificate-rotation-tool-output-pending"],
|
|
503
|
+
tags: [demoTag, "enterprise-demo", "sso-rotation-pending"],
|
|
504
|
+
metadata: {
|
|
505
|
+
...commonMetadata,
|
|
506
|
+
story: "working-awaiting-corroboration"
|
|
507
|
+
}
|
|
508
|
+
},
|
|
509
|
+
{
|
|
510
|
+
schemaVersion: 1,
|
|
511
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-working-corroborated", seedRunId),
|
|
512
|
+
zone: "working",
|
|
513
|
+
recordedAt: addMinutes(baseRecordedAt, 7),
|
|
514
|
+
kind: "state",
|
|
515
|
+
summary: "Tool output says the vendor onboarding policy sync completed with anchored evidence ready for promotion.",
|
|
516
|
+
provenance: {
|
|
517
|
+
sourceClass: "tool_output",
|
|
518
|
+
observedAt: addMinutes(baseRecordedAt, 6),
|
|
519
|
+
sessionKey: "demo:enterprise-buyer-v1",
|
|
520
|
+
sourceId: "tool:vendor-policy-sync-run-9",
|
|
521
|
+
evidenceHash: "sha256:vendor-policy-sync-log"
|
|
522
|
+
},
|
|
523
|
+
entityRefs: ["account:acme-industrial", "policy:vendor-onboarding"],
|
|
524
|
+
tags: [demoTag, "enterprise-demo", "vendor-policy"],
|
|
525
|
+
metadata: {
|
|
526
|
+
...commonMetadata,
|
|
527
|
+
story: "working-with-corroboration"
|
|
528
|
+
}
|
|
529
|
+
},
|
|
530
|
+
{
|
|
531
|
+
schemaVersion: 1,
|
|
532
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-working-corroboration", seedRunId),
|
|
533
|
+
zone: "working",
|
|
534
|
+
recordedAt: addMinutes(baseRecordedAt, 9),
|
|
535
|
+
kind: "external",
|
|
536
|
+
summary: "Change ticket confirms the same vendor onboarding policy sync with matching artifact hash.",
|
|
537
|
+
provenance: {
|
|
538
|
+
sourceClass: "web_content",
|
|
539
|
+
observedAt: addMinutes(baseRecordedAt, 7),
|
|
540
|
+
sessionKey: "demo:enterprise-buyer-v1",
|
|
541
|
+
sourceId: "https://tickets.example.com/changes/CHG-4821",
|
|
542
|
+
evidenceHash: "sha256:sso-rotation-ticket-proof"
|
|
543
|
+
},
|
|
544
|
+
entityRefs: ["account:acme-industrial", "policy:vendor-onboarding"],
|
|
545
|
+
tags: [demoTag, "enterprise-demo", "vendor-policy"],
|
|
546
|
+
metadata: {
|
|
547
|
+
...commonMetadata,
|
|
548
|
+
story: "independent-corroboration"
|
|
549
|
+
}
|
|
550
|
+
},
|
|
551
|
+
{
|
|
552
|
+
schemaVersion: 1,
|
|
553
|
+
recordId: buildTrustZoneDemoRecordId("tz-demo-enterprise-buyer-v1-trusted-governance-rule", seedRunId),
|
|
554
|
+
zone: "trusted",
|
|
555
|
+
recordedAt: addMinutes(baseRecordedAt, 13),
|
|
556
|
+
kind: "memory",
|
|
557
|
+
summary: "Trusted promotion requires a ticket id and artifact hash before shared recall can use operator actions.",
|
|
558
|
+
provenance: {
|
|
559
|
+
sourceClass: "manual",
|
|
560
|
+
observedAt: addMinutes(baseRecordedAt, 11),
|
|
561
|
+
sessionKey: "demo:enterprise-buyer-v1",
|
|
562
|
+
sourceId: "review:trust-zone-policy",
|
|
563
|
+
evidenceHash: "sha256:trust-zone-policy"
|
|
564
|
+
},
|
|
565
|
+
promotedFromZone: "working",
|
|
566
|
+
entityRefs: ["policy:trust-zone-promotion"],
|
|
567
|
+
tags: [demoTag, "enterprise-demo", "operator-policy"],
|
|
568
|
+
metadata: {
|
|
569
|
+
...commonMetadata,
|
|
570
|
+
story: "trusted-policy"
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
];
|
|
574
|
+
}
|
|
575
|
+
async function seedTrustZoneDemoDataset(options) {
|
|
576
|
+
if (options.enabled !== true) {
|
|
577
|
+
throw new Error("trust zone demo seed requires trustZonesEnabled=true");
|
|
578
|
+
}
|
|
579
|
+
const scenario = (options.scenario ?? "enterprise-buyer-v1").trim();
|
|
580
|
+
if (scenario !== "enterprise-buyer-v1") {
|
|
581
|
+
throw new Error(`unsupported trust-zone demo scenario: ${scenario}`);
|
|
582
|
+
}
|
|
583
|
+
const baseRecordedAt = assertIsoRecordedAt(options.recordedAt ?? (/* @__PURE__ */ new Date()).toISOString(), "recordedAt");
|
|
584
|
+
if (!Number.isFinite(Date.parse(baseRecordedAt))) {
|
|
585
|
+
throw new Error("recordedAt must be a valid ISO timestamp");
|
|
586
|
+
}
|
|
587
|
+
const records = buildTrustZoneDemoRecords(baseRecordedAt, scenario);
|
|
588
|
+
if (options.dryRun === true) {
|
|
589
|
+
return {
|
|
590
|
+
scenario,
|
|
591
|
+
dryRun: true,
|
|
592
|
+
recordsWritten: 0,
|
|
593
|
+
records,
|
|
594
|
+
filePaths: []
|
|
595
|
+
};
|
|
596
|
+
}
|
|
597
|
+
const filePaths = [];
|
|
598
|
+
for (const record of records) {
|
|
599
|
+
filePaths.push(await recordTrustZoneRecord({
|
|
600
|
+
memoryDir: options.memoryDir,
|
|
601
|
+
trustZoneStoreDir: options.trustZoneStoreDir,
|
|
602
|
+
record
|
|
603
|
+
}));
|
|
604
|
+
}
|
|
605
|
+
return {
|
|
606
|
+
scenario,
|
|
607
|
+
dryRun: false,
|
|
608
|
+
recordsWritten: filePaths.length,
|
|
609
|
+
records,
|
|
610
|
+
filePaths
|
|
611
|
+
};
|
|
612
|
+
}
|
|
613
|
+
async function getTrustZoneStoreStatus(options) {
|
|
614
|
+
const rootDir = resolveTrustZoneStoreDir(options.memoryDir, options.trustZoneStoreDir);
|
|
615
|
+
const zonesDir = path.join(rootDir, "zones");
|
|
616
|
+
const { files, entries, invalidRecords } = await readTrustZoneRecordEntries(options);
|
|
617
|
+
const records = entries.map((entry) => entry.record);
|
|
618
|
+
records.sort((a, b) => b.recordedAt.localeCompare(a.recordedAt));
|
|
619
|
+
const byZone = {};
|
|
620
|
+
const byKind = {};
|
|
621
|
+
const byTrustBand = {};
|
|
622
|
+
let trustScoreTotal = 0;
|
|
623
|
+
for (const record of records) {
|
|
624
|
+
byZone[record.zone] = (byZone[record.zone] ?? 0) + 1;
|
|
625
|
+
byKind[record.kind] = (byKind[record.kind] ?? 0) + 1;
|
|
626
|
+
if (options.poisoningDefenseEnabled === true) {
|
|
627
|
+
const score = scoreTrustZoneProvenance(record);
|
|
628
|
+
byTrustBand[score.band] = (byTrustBand[score.band] ?? 0) + 1;
|
|
629
|
+
trustScoreTotal += score.total;
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
const averageTrustScore = options.poisoningDefenseEnabled === true && records.length > 0 ? roundTrustScore(trustScoreTotal / records.length) : void 0;
|
|
633
|
+
const latestRecordTrustScore = options.poisoningDefenseEnabled === true && records[0] ? scoreTrustZoneProvenance(records[0]) : void 0;
|
|
634
|
+
return {
|
|
635
|
+
enabled: options.enabled,
|
|
636
|
+
promotionEnabled: options.promotionEnabled,
|
|
637
|
+
poisoningDefenseEnabled: options.poisoningDefenseEnabled,
|
|
638
|
+
rootDir,
|
|
639
|
+
zonesDir,
|
|
640
|
+
records: {
|
|
641
|
+
total: files.length,
|
|
642
|
+
valid: records.length,
|
|
643
|
+
invalid: invalidRecords.length,
|
|
644
|
+
byZone,
|
|
645
|
+
byKind,
|
|
646
|
+
latestRecordId: records[0]?.recordId,
|
|
647
|
+
latestRecordedAt: records[0]?.recordedAt,
|
|
648
|
+
latestZone: records[0]?.zone,
|
|
649
|
+
averageTrustScore,
|
|
650
|
+
byTrustBand: options.poisoningDefenseEnabled === true ? byTrustBand : void 0
|
|
651
|
+
},
|
|
652
|
+
latestRecord: records[0],
|
|
653
|
+
latestRecordTrustScore,
|
|
654
|
+
invalidRecords
|
|
655
|
+
};
|
|
656
|
+
}
|
|
657
|
+
|
|
658
|
+
export {
|
|
659
|
+
isTrustZoneName,
|
|
660
|
+
resolveTrustZoneStoreDir,
|
|
661
|
+
validateTrustZoneRecord,
|
|
662
|
+
recordTrustZoneRecord,
|
|
663
|
+
scoreTrustZoneProvenance,
|
|
664
|
+
planTrustZonePromotion,
|
|
665
|
+
promoteTrustZoneRecord,
|
|
666
|
+
searchTrustZoneRecords,
|
|
667
|
+
listTrustZoneRecords,
|
|
668
|
+
summarizeTrustZonePromotionReadiness,
|
|
669
|
+
seedTrustZoneDemoDataset,
|
|
670
|
+
getTrustZoneStoreStatus
|
|
671
|
+
};
|
|
672
|
+
//# sourceMappingURL=chunk-EQINRHYR.js.map
|