@remnic/core 9.69.36 → 9.69.38
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/access-admin-ops-surface.d.ts +14 -12
- package/dist/access-admin-ops-surface.js +77 -74
- package/dist/access-authorization-probe.d.ts +14 -12
- package/dist/access-authorization-probe.js +78 -75
- package/dist/access-boundary.d.ts +14 -12
- package/dist/access-boundary.js +77 -74
- package/dist/access-cli.js +180 -170
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -1
- package/dist/access-extraction-force-flush.d.ts +14 -12
- package/dist/access-extraction-force-flush.js +77 -74
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-briefing.d.ts +14 -12
- package/dist/access-http-briefing.js +78 -75
- package/dist/access-http-lcm-compaction.d.ts +14 -12
- package/dist/access-http-lifecycle-flush.d.ts +14 -12
- package/dist/access-http-offline-stream.d.ts +14 -12
- package/dist/access-http-query.d.ts +3 -2
- package/dist/access-http-query.js +79 -76
- package/dist/access-http.d.ts +15 -13
- package/dist/access-http.js +97 -94
- package/dist/access-identity-continuity-surface.d.ts +12 -10
- package/dist/access-identity-continuity-surface.js +77 -74
- package/dist/access-lcm-surface.d.ts +14 -12
- package/dist/access-lcm-surface.js +77 -74
- package/dist/access-mcp.d.ts +14 -12
- package/dist/access-mcp.js +86 -83
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-D8qri11P.d.ts → access-namespace-preflight-DY4z6L5X.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +77 -74
- package/dist/access-observe-transcript.d.ts +12 -10
- package/dist/access-observe-write-category.d.ts +37 -0
- package/dist/access-observe-write-category.js +34 -0
- package/dist/access-observe-write-surface.d.ts +17 -15
- package/dist/access-observe-write-surface.js +77 -74
- package/dist/access-offline-manifest.d.ts +12 -10
- package/dist/access-offline-manifest.js +15 -15
- package/dist/access-operations-batch.js +80 -77
- package/dist/access-operations.d.ts +17 -30
- package/dist/access-operations.js +85 -82
- package/dist/access-recall-concurrency.d.ts +14 -12
- package/dist/access-recall-concurrency.js +77 -74
- package/dist/access-recall-response.d.ts +14 -12
- package/dist/access-recall-response.js +77 -74
- package/dist/access-recall-surface.d.ts +14 -12
- package/dist/access-recall-surface.js +77 -74
- package/dist/access-schema.d.ts +214 -111
- package/dist/access-schema.js +7 -13
- package/dist/{access-service-Cl_x57xR.d.ts → access-service-gBcdRUHY.d.ts} +101 -77
- package/dist/access-service-helpers.d.ts +14 -12
- package/dist/access-service.d.ts +14 -12
- package/dist/access-service.js +77 -74
- package/dist/access-surface-catalog.d.ts +14 -12
- package/dist/access-surface-catalog.js +79 -76
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +5 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-memory-bridge.js +3 -3
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +20 -16
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +2 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +2 -1
- package/dist/artifact-search.d.ts +2 -1
- package/dist/{auto-sync-4YFATLFQ.js → auto-sync-RP4C6ZPF.js} +12 -10
- package/dist/{auto-sync-4YFATLFQ.js.map → auto-sync-RP4C6ZPF.js.map} +1 -1
- package/dist/background-generation-config.d.ts +10 -0
- package/dist/background-generation-config.js +9 -0
- package/dist/background-generation.d.ts +25 -0
- package/dist/background-generation.js +11 -0
- package/dist/background-generation.js.map +1 -0
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +12 -10
- package/dist/briefing-window.d.ts +3 -2
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +25 -24
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.js +8 -8
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +3 -1
- package/dist/calibration.js +5 -3
- package/dist/calibration.js.map +1 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{capsule-merge-ZCXUPLNJ.js → capsule-merge-IPG4IOFP.js} +2 -2
- package/dist/{catalog-Bq1AxZwF.d.ts → catalog-CW87xGx8.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +27 -26
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-LO4UKPKX.js → chunk-27MKMTBY.js} +2 -2
- package/dist/{chunk-TK4FHQRN.js → chunk-2J3V5QEO.js} +4 -4
- package/dist/{chunk-DVOBLPSQ.js → chunk-2MT4ADLQ.js} +15 -39
- package/dist/chunk-2MT4ADLQ.js.map +1 -0
- package/dist/{chunk-JSRVXI6E.js → chunk-2OGTN37H.js} +10 -10
- package/dist/{chunk-DK4X5B6I.js → chunk-2PTNJTBE.js} +2 -2
- package/dist/chunk-2QG4SLZI.js +44 -0
- package/dist/chunk-2QG4SLZI.js.map +1 -0
- package/dist/{chunk-27IOSH2W.js → chunk-375ARKRS.js} +32 -11
- package/dist/chunk-375ARKRS.js.map +1 -0
- package/dist/{chunk-PWPIERBM.js → chunk-37CAEC7E.js} +4 -4
- package/dist/{chunk-S2ULTQZR.js → chunk-3N3PBBEH.js} +2 -2
- package/dist/{chunk-ZTG4P7NZ.js → chunk-3OYSIVOO.js} +168 -168
- package/dist/{chunk-ZBEGS7OB.js → chunk-474DL7UB.js} +3 -3
- package/dist/{chunk-YNN26CIZ.js → chunk-4B3HBIFX.js} +2 -2
- package/dist/{chunk-HC4GFLMQ.js → chunk-4BCHFSC7.js} +3 -3
- package/dist/{chunk-YEDVOYL2.js → chunk-4RX5O34R.js} +2 -2
- package/dist/{chunk-W6IJMWTZ.js → chunk-5AERZWJD.js} +2 -2
- package/dist/{chunk-XPJNT6PI.js → chunk-5N4MZLEH.js} +10 -6
- package/dist/chunk-5N4MZLEH.js.map +1 -0
- package/dist/{chunk-UBG4GAEP.js → chunk-5U7K4W6K.js} +6 -2
- package/dist/chunk-5U7K4W6K.js.map +1 -0
- package/dist/{chunk-PAAJWQH5.js → chunk-62D2PAAM.js} +4 -4
- package/dist/{chunk-JHZCXUQI.js → chunk-62QIQEUC.js} +157 -154
- package/dist/chunk-62QIQEUC.js.map +1 -0
- package/dist/{chunk-52II7PB6.js → chunk-645WOU5I.js} +4 -4
- package/dist/{chunk-326KUXIR.js → chunk-6EHM2AV7.js} +6 -6
- package/dist/{chunk-YM7YN37H.js → chunk-6ET2VII7.js} +2 -2
- package/dist/chunk-6H2G7RFT.js +58 -0
- package/dist/chunk-6H2G7RFT.js.map +1 -0
- package/dist/{chunk-A2YQL2FF.js → chunk-6P4REYKL.js} +5 -5
- package/dist/{chunk-FVJ4D6L7.js → chunk-6PRY6CLC.js} +4 -4
- package/dist/{chunk-GLZH5VEN.js → chunk-6ZMNTRU3.js} +2 -2
- package/dist/{chunk-Z7ACR6MJ.js → chunk-74AHCL56.js} +3 -3
- package/dist/{chunk-5VAF4ID4.js → chunk-7S53BPTU.js} +25 -25
- package/dist/{chunk-EEBQFG5E.js → chunk-A6CKMIPK.js} +14 -14
- package/dist/chunk-A6CXG5WI.js +51 -0
- package/dist/chunk-A6CXG5WI.js.map +1 -0
- package/dist/{chunk-JR6PP7UM.js → chunk-ACY4ZPF7.js} +28 -2
- package/dist/chunk-ACY4ZPF7.js.map +1 -0
- package/dist/{chunk-2YLMUME2.js → chunk-AECJY3GJ.js} +2 -2
- package/dist/{chunk-NPNSKE76.js → chunk-B36GUU6T.js} +4 -4
- package/dist/{chunk-Y63ZFP4X.js → chunk-BJEJUOGM.js} +2 -2
- package/dist/{chunk-7CBKAQIG.js → chunk-BOADKFN4.js} +28 -4
- package/dist/chunk-BOADKFN4.js.map +1 -0
- package/dist/{chunk-TLHNF6GA.js → chunk-BV4ZKIZH.js} +1 -1
- package/dist/{chunk-3FJKJ5UZ.js → chunk-BX4EOMKT.js} +2 -2
- package/dist/{chunk-6J6K3STG.js → chunk-BYZKLEWG.js} +15 -12
- package/dist/chunk-BYZKLEWG.js.map +1 -0
- package/dist/{chunk-BJETIR53.js → chunk-CBFYCDYO.js} +3 -3
- package/dist/{chunk-ZWEZXVYH.js → chunk-CEO4DONG.js} +2 -2
- package/dist/chunk-CWTCMZGE.js +858 -0
- package/dist/chunk-CWTCMZGE.js.map +1 -0
- package/dist/{chunk-WPDKBUWX.js → chunk-DPMTLJCT.js} +2 -2
- package/dist/{chunk-65RENJGB.js → chunk-E2AWJ7KQ.js} +8 -4
- package/dist/chunk-E2AWJ7KQ.js.map +1 -0
- package/dist/{chunk-LYDJRF45.js → chunk-EY5JAWZC.js} +2 -2
- package/dist/{chunk-R4OCGPSH.js → chunk-FJMYMJLR.js} +2 -2
- package/dist/{chunk-OS2AT2JU.js → chunk-G43PMSME.js} +27 -10
- package/dist/chunk-G43PMSME.js.map +1 -0
- package/dist/{chunk-YXLUTALO.js → chunk-GAS7KYC7.js} +5 -5
- package/dist/{chunk-LSLCFCCQ.js → chunk-GDYU6VF4.js} +1 -1
- package/dist/chunk-GDYU6VF4.js.map +1 -0
- package/dist/{chunk-UDZYNIDJ.js → chunk-GGAXFTNH.js} +2 -2
- package/dist/{chunk-QURNMKME.js → chunk-GQQVEH6V.js} +6 -6
- package/dist/{chunk-J7PB5UQ4.js → chunk-GT4ZHOKT.js} +3 -3
- package/dist/{chunk-WIKO4SCR.js → chunk-H3TKENU4.js} +5 -5
- package/dist/{chunk-ZLN7AROH.js → chunk-HIP6DKJJ.js} +5 -5
- package/dist/{chunk-UYUCCQ46.js → chunk-HVS7TH2Y.js} +2 -2
- package/dist/{chunk-Z3O53WZR.js → chunk-IWO6QXWJ.js} +2 -2
- package/dist/{chunk-4MDKNUV4.js → chunk-IYKZJVL5.js} +1 -1
- package/dist/chunk-IYKZJVL5.js.map +1 -0
- package/dist/{chunk-42DJ235G.js → chunk-J272ODKJ.js} +2 -2
- package/dist/{chunk-JR6H5CYS.js → chunk-JA2QJOAX.js} +2 -2
- package/dist/{chunk-R3TLVTWW.js → chunk-JDX2OA4R.js} +3 -3
- package/dist/chunk-JE26AUX6.js +16 -0
- package/dist/chunk-JE26AUX6.js.map +1 -0
- package/dist/{chunk-AJTG3CP7.js → chunk-JHU4EYDV.js} +11 -1
- package/dist/chunk-JHU4EYDV.js.map +1 -0
- package/dist/{chunk-HXSAWV3A.js → chunk-JNSENHV5.js} +6 -6
- package/dist/{chunk-RRZKTSFG.js → chunk-JPOX2AJB.js} +2 -2
- package/dist/{chunk-TKFSXDOB.js → chunk-K5DA5TRG.js} +9 -9
- package/dist/{chunk-AZSKROVQ.js → chunk-KDFDXEXZ.js} +2 -2
- package/dist/{chunk-AKE4GGQ3.js → chunk-KQW3YGEN.js} +2 -2
- package/dist/{chunk-B3O3IRZN.js → chunk-L63GFNKL.js} +1 -1
- package/dist/{chunk-YEN4TREG.js → chunk-LQNRVPTV.js} +54 -567
- package/dist/chunk-LQNRVPTV.js.map +1 -0
- package/dist/{chunk-YJ6VCDMZ.js → chunk-M6HBPLBA.js} +2 -2
- package/dist/chunk-MCRVQ5YQ.js +14 -0
- package/dist/chunk-MCRVQ5YQ.js.map +1 -0
- package/dist/{chunk-L2WQVSKP.js → chunk-MLWMR2GE.js} +2 -2
- package/dist/{chunk-WHHEPAO3.js → chunk-NWMUSKED.js} +8 -8
- package/dist/chunk-OEBLZZKK.js +53 -0
- package/dist/chunk-OEBLZZKK.js.map +1 -0
- package/dist/{chunk-JRWW7GM6.js → chunk-OKO57IXB.js} +7 -7
- package/dist/{chunk-L2QLDZJC.js → chunk-P4ZAEYKG.js} +67 -33
- package/dist/chunk-P4ZAEYKG.js.map +1 -0
- package/dist/{chunk-MPAJFFP3.js → chunk-PGAB2V53.js} +5 -5
- package/dist/{chunk-MPAJFFP3.js.map → chunk-PGAB2V53.js.map} +1 -1
- package/dist/{chunk-VYXDUPYE.js → chunk-PPQEP4OH.js} +2 -2
- package/dist/{chunk-LEMD7WZJ.js → chunk-QHT7MOUF.js} +70 -25
- package/dist/chunk-QHT7MOUF.js.map +1 -0
- package/dist/chunk-QJ2AX6DU.js +19 -0
- package/dist/chunk-QJ2AX6DU.js.map +1 -0
- package/dist/{chunk-Q4AUIFUA.js → chunk-QMWKENNK.js} +4 -4
- package/dist/{chunk-XCOV45MO.js → chunk-R4VAUNNC.js} +3 -3
- package/dist/{chunk-353KGBKY.js → chunk-RW4QNB4J.js} +4 -4
- package/dist/{chunk-FQXJAC3T.js → chunk-SGUDMW2K.js} +4 -4
- package/dist/{chunk-S5G2LAL7.js → chunk-SV4Z2S67.js} +4 -4
- package/dist/{chunk-HUT2JR6I.js → chunk-T32B72QX.js} +3 -3
- package/dist/{chunk-OQ7SSRXP.js → chunk-TRHBQVVO.js} +23 -17
- package/dist/chunk-TRHBQVVO.js.map +1 -0
- package/dist/{chunk-LMCD5W5B.js → chunk-TRLOFIQC.js} +2 -2
- package/dist/{chunk-JZ2CHRLB.js → chunk-TTSJ7WUC.js} +2 -2
- package/dist/{chunk-CNV2A557.js → chunk-TUKGXQ5T.js} +3 -3
- package/dist/{chunk-QATYVTP7.js → chunk-UIOIDW3L.js} +2 -2
- package/dist/{chunk-776GVKL7.js → chunk-ULDBGA5W.js} +2 -2
- package/dist/{chunk-NN4JEFON.js → chunk-UQNYPK7G.js} +3 -3
- package/dist/{chunk-A5UQ52YQ.js → chunk-UZZ7SQT3.js} +5 -5
- package/dist/{chunk-F6IVBYFS.js → chunk-V6G2PSXA.js} +72 -72
- package/dist/{chunk-RUXPVSML.js → chunk-VHOSM5G4.js} +6 -6
- package/dist/{chunk-QBLDCI6E.js → chunk-VMNCZ627.js} +2 -2
- package/dist/{chunk-P3ONDDIJ.js → chunk-VV4ZVUE6.js} +2 -2
- package/dist/{chunk-A7GQBJP5.js → chunk-X2NFFBTO.js} +4 -4
- package/dist/{chunk-ECKG5WSI.js → chunk-XGRXQR6T.js} +2 -2
- package/dist/{chunk-LNDLXMH6.js → chunk-XN6XT6GR.js} +3 -3
- package/dist/{chunk-C6KRO3SU.js → chunk-XVDZFTN5.js} +4 -4
- package/dist/chunk-XVZA6VXC.js +160 -0
- package/dist/chunk-XVZA6VXC.js.map +1 -0
- package/dist/{chunk-2BQ4ZIWC.js → chunk-XWLLFKHM.js} +8 -8
- package/dist/chunk-YFTNZMGR.js +71 -0
- package/dist/chunk-YFTNZMGR.js.map +1 -0
- package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
- package/dist/{chunk-BNGHPYZU.js → chunk-YUW66UAH.js} +3 -3
- package/dist/{chunk-5JG5EBVL.js → chunk-ZEGL7YCC.js} +2 -2
- package/dist/{chunk-PHP3MUGF.js → chunk-ZKZFFWLV.js} +2 -2
- package/dist/{chunk-GCBIXUPT.js → chunk-ZMWSYUUL.js} +2 -2
- package/dist/{chunk-X2QPKLPL.js → chunk-ZZUVBZL2.js} +2 -2
- package/dist/{cli-p813oxbm.d.ts → cli-BNg-TAlz.d.ts} +5 -5
- package/dist/cli-fallback.d.ts +4 -2
- package/dist/cli-fallback.js +3 -1
- package/dist/cli.d.ts +16 -14
- package/dist/cli.js +125 -119
- package/dist/coding/export-okf-codegraph.d.ts +2 -1
- package/dist/coding/export-okf-codegraph.js +24 -23
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/coding/pre-action-gate.d.ts +2 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compat/codex-cli-fallback.d.ts +1 -1
- package/dist/compat/codex-cli-fallback.js +3 -1
- package/dist/compat/codex-cli-fallback.js.map +1 -1
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +25 -24
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +18 -14
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +24 -23
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +27 -26
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +5 -3
- package/dist/contradiction/index.js +7 -7
- package/dist/{contradiction-scan-GVD4JJ7B.js → contradiction-scan-BSGKZHYJ.js} +4 -4
- package/dist/contradiction-scan-BSGKZHYJ.js.map +1 -0
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +3 -2
- package/dist/convergence-refresh.js +27 -26
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +27 -26
- package/dist/cross-lingual-recall.d.ts +2 -1
- package/dist/dashboard-runtime.js +2 -2
- package/dist/day-summary.d.ts +2 -1
- package/dist/deep-recall-http-glue.d.ts +14 -12
- package/dist/deep-recall-http-glue.js +2 -12
- package/dist/deep-recall-mcp-tools.d.ts +14 -12
- package/dist/deep-recall-policy-llm.d.ts +3 -1
- package/dist/deep-recall-policy-llm.js +5 -3
- package/dist/deep-recall-seeds.d.ts +2 -1
- package/dist/deep-recall.js +2 -2
- package/dist/delinearize.d.ts +2 -1
- package/dist/dependency-propagation-config.d.ts +2 -1
- package/dist/{dependency-propagation-delivery-DLiAtj25.d.ts → dependency-propagation-delivery-Cq1ekOwV.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-origin-fields.d.ts +2 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +26 -25
- package/dist/entity-schema.d.ts +2 -1
- package/dist/episodic-context.d.ts +2 -1
- package/dist/eval-trajectory-contracts.d.ts +2 -1
- package/dist/eval-trajectory-store.d.ts +2 -1
- package/dist/eval-trajectory.d.ts +2 -1
- package/dist/event-order-recall.js +3 -3
- package/dist/explicit-capture.d.ts +12 -10
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.d.ts +14 -12
- package/dist/external-wiki-access.js +78 -75
- package/dist/external-wiki-collection-registration.d.ts +2 -1
- package/dist/external-wiki-collection.d.ts +2 -1
- package/dist/external-wiki-mcp-tools.d.ts +14 -12
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +3 -1
- package/dist/extraction-faithfulness.js +5 -3
- package/dist/extraction-judge-telemetry.d.ts +3 -1
- package/dist/extraction-judge-training.d.ts +3 -1
- package/dist/extraction-judge.d.ts +3 -1
- package/dist/extraction-judge.js +6 -4
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-normalization.d.ts +2 -1
- package/dist/extraction-normalization.js +2 -2
- package/dist/extraction-prompt.d.ts +12 -2
- package/dist/extraction-prompt.js +7 -3
- package/dist/extraction-source-grounding-rules.d.ts +4 -2
- package/dist/extraction-source-grounding-rules.js +1 -1
- package/dist/extraction-source-grounding.d.ts +3 -2
- package/dist/extraction-source-grounding.js +4 -4
- package/dist/extraction-span-config.d.ts +16 -0
- package/dist/extraction-span-config.js +15 -0
- package/dist/extraction-span-config.js.map +1 -0
- package/dist/extraction-span-materialize.d.ts +106 -0
- package/dist/extraction-span-materialize.js +30 -0
- package/dist/extraction-span-materialize.js.map +1 -0
- package/dist/extraction-span-slice.js +3 -12
- package/dist/extraction-span-slice.js.map +1 -1
- package/dist/extraction-span-source-hash.js +4 -46
- package/dist/extraction-span-source-hash.js.map +1 -1
- package/dist/extraction-span-validate.js +3 -15
- package/dist/extraction-span-validate.js.map +1 -1
- package/dist/extraction.d.ts +8 -1
- package/dist/extraction.js +48 -43
- package/dist/fallback-llm-codex-subscription.d.ts +79 -0
- package/dist/fallback-llm-codex-subscription.js +22 -0
- package/dist/fallback-llm-codex-subscription.js.map +1 -0
- package/dist/fallback-llm.d.ts +5 -1
- package/dist/fallback-llm.js +4 -2
- package/dist/{first-start-migration-L3UFX5CU.js → first-start-migration-ZWMV5CX4.js} +4 -4
- package/dist/{generic-recall-paths-DbitKJI5.d.ts → generic-recall-paths-BcySh_f9.d.ts} +1 -1
- package/dist/graph-append-error.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-jsonl.d.ts +2 -1
- package/dist/graph-path-reconstruction.d.ts +2 -1
- package/dist/graph-path-scoring.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph.d.ts +2 -1
- package/dist/harmonic-retrieval.js +3 -3
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/importers/test-utils.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/{index-BINUgPFo.d.ts → index-DWOb4wz9.d.ts} +2 -2
- package/dist/index.d.ts +712 -704
- package/dist/index.js +368 -299
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +7 -7
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm-config.d.ts +7 -1
- package/dist/local-llm-config.js +12 -0
- package/dist/local-llm.d.ts +2 -1
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/location/index.d.ts +4 -3
- package/dist/location/index.js +60 -59
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +24 -23
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +25 -24
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +26 -25
- package/dist/{maintenance-ag1gYztC.d.ts → maintenance-CW9wCzMP.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +14 -12
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-controller.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-snapshot.d.ts +2 -1
- package/dist/memory-subject-cli.d.ts +14 -12
- package/dist/memory-subject.d.ts +14 -12
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +25 -24
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +4 -4
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +24 -23
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/offline-sync-impression-drain.js +4 -4
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +28 -27
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +49 -44
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +37 -36
- package/dist/{orchestrator-Cf3G-3Ed.d.ts → orchestrator-DocO0_hw.d.ts} +9 -9
- package/dist/orchestrator.d.ts +12 -10
- package/dist/orchestrator.js +208 -198
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-AwB03fw_.d.ts → pipeline-CiYcqqhl.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/provenance.js +2 -2
- package/dist/{public-http-C3bLjE-L.d.ts → public-http-C0FoTiL_.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -2
- package/dist/{qmd-Bfaydrfm.d.ts → qmd-qXD4vatU.d.ts} +1 -1
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +3 -2
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-navigate-access.d.ts +2 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +2 -1
- package/dist/recall-navigate-disclosure.js +1 -1
- package/dist/recall-navigate.d.ts +2 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-planner-llm.d.ts +3 -1
- package/dist/recall-planner-llm.js +4 -2
- package/dist/recall-planner-llm.js.map +1 -1
- package/dist/recall-state-view-admission.d.ts +3 -2
- package/dist/recall-state-view-admission.js +6 -6
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +2 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +2 -1
- package/dist/reconcile/cursor.js +2 -2
- package/dist/reconcile/manifest.d.ts +12 -2
- package/dist/reconcile/manifest.js +8 -6
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/reconcile/plan.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/{resolution-OHJZG45O.js → resolution-4GG3QZRJ.js} +8 -8
- package/dist/resolution-4GG3QZRJ.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +19 -15
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/salvage-envelope.js +2 -2
- package/dist/schemas.d.ts +370 -160
- package/dist/schemas.js +1 -1
- package/dist/{scope-profiles-nxTKvjE-.d.ts → scope-profiles-BT9rqC3w.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/factory.d.ts +2 -1
- package/dist/search/factory.js +3 -3
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +7 -7
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/port.d.ts +2 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/{semantic-consolidation-C83DVakV.d.ts → semantic-consolidation-CmZi7thY.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +25 -24
- package/dist/semantic-rule-promotion.js +24 -23
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +24 -23
- package/dist/{service-q-xtOoAr.d.ts → service-CLkA7AQB.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +8 -7
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +40 -39
- package/dist/standup/build.js +25 -24
- package/dist/{storage-Ca0MbTfm.d.ts → storage-wvX01lht.d.ts} +1 -1
- package/dist/storage.d.ts +3 -2
- package/dist/storage.js +23 -22
- package/dist/subject-config.d.ts +2 -1
- package/dist/subject-config.js +2 -2
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +6 -3
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/support-passport/index.d.ts +17 -15
- package/dist/support-passport/index.js +83 -80
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/tier-routing.js +3 -3
- package/dist/{tier-stats-VK5PCO2L.js → tier-stats-LUSUUNU6.js} +4 -4
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/capsule-import.js +1 -1
- package/dist/transfer/export-okf.d.ts +2 -1
- package/dist/transfer/export-okf.js +24 -23
- package/dist/transfer/types.d.ts +98 -98
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-yDgWDkrJ.d.ts → types-Cyr32ABj.d.ts} +51 -10
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +24 -23
- package/dist/who-knows-cli.d.ts +14 -12
- package/dist/who-knows-cli.js +25 -24
- package/dist/who-knows.d.ts +14 -12
- package/dist/who-knows.js +24 -23
- package/dist/write-envelope.d.ts +7 -1
- package/dist/write-envelope.js +1 -1
- package/package.json +42 -2
- package/src/access-boundary.ts +21 -6
- package/src/access-category-alias.test.ts +488 -51
- package/src/access-http.test.ts +292 -5
- package/src/access-http.ts +4 -0
- package/src/access-mcp.test.ts +2 -2
- package/src/access-observe-write-category.ts +25 -0
- package/src/access-observe-write-surface.ts +58 -57
- package/src/access-operations-batch.ts +28 -2
- package/src/access-operations.ts +6 -4
- package/src/access-schema.ts +106 -50
- package/src/access-service.ts +23 -9
- package/src/background-generation-config.ts +79 -0
- package/src/background-generation.test.ts +123 -0
- package/src/background-generation.ts +52 -0
- package/src/cli-fallback.ts +8 -2
- package/src/config.test.ts +172 -0
- package/src/config.ts +4 -45
- package/src/extraction-prompt.ts +37 -3
- package/src/extraction-source-grounding-rules.ts +46 -9
- package/src/extraction-source-grounding.ts +2 -1
- package/src/extraction-span-config.ts +81 -0
- package/src/extraction-span-materialize.test.ts +376 -0
- package/src/extraction-span-materialize.ts +241 -0
- package/src/extraction.ts +70 -25
- package/src/fallback-llm-codex-subscription.ts +168 -0
- package/src/fallback-llm.test.ts +46 -0
- package/src/fallback-llm.ts +60 -48
- package/src/index.ts +2 -16
- package/src/local-llm-config.ts +84 -0
- package/src/providers/codex-subscription.test.ts +804 -1
- package/src/providers/codex-subscription.ts +407 -65
- package/src/reconcile/manifest.test.ts +11 -1
- package/src/reconcile/manifest.ts +12 -0
- package/src/schemas.ts +14 -0
- package/src/source-agent-qualifier.ts +5 -1
- package/src/summarizer.ts +25 -0
- package/src/testing/subjects/extraction-lifecycle.test.ts +27 -10
- package/src/types.ts +12 -11
- package/src/write-envelope.ts +5 -0
- package/dist/chunk-27IOSH2W.js.map +0 -1
- package/dist/chunk-4MDKNUV4.js.map +0 -1
- package/dist/chunk-65RENJGB.js.map +0 -1
- package/dist/chunk-6J6K3STG.js.map +0 -1
- package/dist/chunk-7CBKAQIG.js.map +0 -1
- package/dist/chunk-AJTG3CP7.js.map +0 -1
- package/dist/chunk-DVOBLPSQ.js.map +0 -1
- package/dist/chunk-JHZCXUQI.js.map +0 -1
- package/dist/chunk-JR6PP7UM.js.map +0 -1
- package/dist/chunk-L2QLDZJC.js.map +0 -1
- package/dist/chunk-LEMD7WZJ.js.map +0 -1
- package/dist/chunk-LSLCFCCQ.js.map +0 -1
- package/dist/chunk-OQ7SSRXP.js.map +0 -1
- package/dist/chunk-OS2AT2JU.js.map +0 -1
- package/dist/chunk-UBG4GAEP.js.map +0 -1
- package/dist/chunk-XPJNT6PI.js.map +0 -1
- package/dist/chunk-YEN4TREG.js.map +0 -1
- /package/dist/{contradiction-scan-GVD4JJ7B.js.map → access-observe-write-category.js.map} +0 -0
- /package/dist/{resolution-OHJZG45O.js.map → background-generation-config.js.map} +0 -0
- /package/dist/{capsule-merge-ZCXUPLNJ.js.map → capsule-merge-IPG4IOFP.js.map} +0 -0
- /package/dist/{chunk-LO4UKPKX.js.map → chunk-27MKMTBY.js.map} +0 -0
- /package/dist/{chunk-TK4FHQRN.js.map → chunk-2J3V5QEO.js.map} +0 -0
- /package/dist/{chunk-JSRVXI6E.js.map → chunk-2OGTN37H.js.map} +0 -0
- /package/dist/{chunk-DK4X5B6I.js.map → chunk-2PTNJTBE.js.map} +0 -0
- /package/dist/{chunk-PWPIERBM.js.map → chunk-37CAEC7E.js.map} +0 -0
- /package/dist/{chunk-S2ULTQZR.js.map → chunk-3N3PBBEH.js.map} +0 -0
- /package/dist/{chunk-ZTG4P7NZ.js.map → chunk-3OYSIVOO.js.map} +0 -0
- /package/dist/{chunk-ZBEGS7OB.js.map → chunk-474DL7UB.js.map} +0 -0
- /package/dist/{chunk-YNN26CIZ.js.map → chunk-4B3HBIFX.js.map} +0 -0
- /package/dist/{chunk-HC4GFLMQ.js.map → chunk-4BCHFSC7.js.map} +0 -0
- /package/dist/{chunk-YEDVOYL2.js.map → chunk-4RX5O34R.js.map} +0 -0
- /package/dist/{chunk-W6IJMWTZ.js.map → chunk-5AERZWJD.js.map} +0 -0
- /package/dist/{chunk-PAAJWQH5.js.map → chunk-62D2PAAM.js.map} +0 -0
- /package/dist/{chunk-52II7PB6.js.map → chunk-645WOU5I.js.map} +0 -0
- /package/dist/{chunk-326KUXIR.js.map → chunk-6EHM2AV7.js.map} +0 -0
- /package/dist/{chunk-YM7YN37H.js.map → chunk-6ET2VII7.js.map} +0 -0
- /package/dist/{chunk-A2YQL2FF.js.map → chunk-6P4REYKL.js.map} +0 -0
- /package/dist/{chunk-FVJ4D6L7.js.map → chunk-6PRY6CLC.js.map} +0 -0
- /package/dist/{chunk-GLZH5VEN.js.map → chunk-6ZMNTRU3.js.map} +0 -0
- /package/dist/{chunk-Z7ACR6MJ.js.map → chunk-74AHCL56.js.map} +0 -0
- /package/dist/{chunk-5VAF4ID4.js.map → chunk-7S53BPTU.js.map} +0 -0
- /package/dist/{chunk-EEBQFG5E.js.map → chunk-A6CKMIPK.js.map} +0 -0
- /package/dist/{chunk-2YLMUME2.js.map → chunk-AECJY3GJ.js.map} +0 -0
- /package/dist/{chunk-NPNSKE76.js.map → chunk-B36GUU6T.js.map} +0 -0
- /package/dist/{chunk-Y63ZFP4X.js.map → chunk-BJEJUOGM.js.map} +0 -0
- /package/dist/{chunk-TLHNF6GA.js.map → chunk-BV4ZKIZH.js.map} +0 -0
- /package/dist/{chunk-3FJKJ5UZ.js.map → chunk-BX4EOMKT.js.map} +0 -0
- /package/dist/{chunk-BJETIR53.js.map → chunk-CBFYCDYO.js.map} +0 -0
- /package/dist/{chunk-ZWEZXVYH.js.map → chunk-CEO4DONG.js.map} +0 -0
- /package/dist/{chunk-WPDKBUWX.js.map → chunk-DPMTLJCT.js.map} +0 -0
- /package/dist/{chunk-LYDJRF45.js.map → chunk-EY5JAWZC.js.map} +0 -0
- /package/dist/{chunk-R4OCGPSH.js.map → chunk-FJMYMJLR.js.map} +0 -0
- /package/dist/{chunk-YXLUTALO.js.map → chunk-GAS7KYC7.js.map} +0 -0
- /package/dist/{chunk-UDZYNIDJ.js.map → chunk-GGAXFTNH.js.map} +0 -0
- /package/dist/{chunk-QURNMKME.js.map → chunk-GQQVEH6V.js.map} +0 -0
- /package/dist/{chunk-J7PB5UQ4.js.map → chunk-GT4ZHOKT.js.map} +0 -0
- /package/dist/{chunk-WIKO4SCR.js.map → chunk-H3TKENU4.js.map} +0 -0
- /package/dist/{chunk-ZLN7AROH.js.map → chunk-HIP6DKJJ.js.map} +0 -0
- /package/dist/{chunk-UYUCCQ46.js.map → chunk-HVS7TH2Y.js.map} +0 -0
- /package/dist/{chunk-Z3O53WZR.js.map → chunk-IWO6QXWJ.js.map} +0 -0
- /package/dist/{chunk-42DJ235G.js.map → chunk-J272ODKJ.js.map} +0 -0
- /package/dist/{chunk-JR6H5CYS.js.map → chunk-JA2QJOAX.js.map} +0 -0
- /package/dist/{chunk-R3TLVTWW.js.map → chunk-JDX2OA4R.js.map} +0 -0
- /package/dist/{chunk-HXSAWV3A.js.map → chunk-JNSENHV5.js.map} +0 -0
- /package/dist/{chunk-RRZKTSFG.js.map → chunk-JPOX2AJB.js.map} +0 -0
- /package/dist/{chunk-TKFSXDOB.js.map → chunk-K5DA5TRG.js.map} +0 -0
- /package/dist/{chunk-AZSKROVQ.js.map → chunk-KDFDXEXZ.js.map} +0 -0
- /package/dist/{chunk-AKE4GGQ3.js.map → chunk-KQW3YGEN.js.map} +0 -0
- /package/dist/{chunk-B3O3IRZN.js.map → chunk-L63GFNKL.js.map} +0 -0
- /package/dist/{chunk-YJ6VCDMZ.js.map → chunk-M6HBPLBA.js.map} +0 -0
- /package/dist/{chunk-L2WQVSKP.js.map → chunk-MLWMR2GE.js.map} +0 -0
- /package/dist/{chunk-WHHEPAO3.js.map → chunk-NWMUSKED.js.map} +0 -0
- /package/dist/{chunk-JRWW7GM6.js.map → chunk-OKO57IXB.js.map} +0 -0
- /package/dist/{chunk-VYXDUPYE.js.map → chunk-PPQEP4OH.js.map} +0 -0
- /package/dist/{chunk-Q4AUIFUA.js.map → chunk-QMWKENNK.js.map} +0 -0
- /package/dist/{chunk-XCOV45MO.js.map → chunk-R4VAUNNC.js.map} +0 -0
- /package/dist/{chunk-353KGBKY.js.map → chunk-RW4QNB4J.js.map} +0 -0
- /package/dist/{chunk-FQXJAC3T.js.map → chunk-SGUDMW2K.js.map} +0 -0
- /package/dist/{chunk-S5G2LAL7.js.map → chunk-SV4Z2S67.js.map} +0 -0
- /package/dist/{chunk-HUT2JR6I.js.map → chunk-T32B72QX.js.map} +0 -0
- /package/dist/{chunk-LMCD5W5B.js.map → chunk-TRLOFIQC.js.map} +0 -0
- /package/dist/{chunk-JZ2CHRLB.js.map → chunk-TTSJ7WUC.js.map} +0 -0
- /package/dist/{chunk-CNV2A557.js.map → chunk-TUKGXQ5T.js.map} +0 -0
- /package/dist/{chunk-QATYVTP7.js.map → chunk-UIOIDW3L.js.map} +0 -0
- /package/dist/{chunk-776GVKL7.js.map → chunk-ULDBGA5W.js.map} +0 -0
- /package/dist/{chunk-NN4JEFON.js.map → chunk-UQNYPK7G.js.map} +0 -0
- /package/dist/{chunk-A5UQ52YQ.js.map → chunk-UZZ7SQT3.js.map} +0 -0
- /package/dist/{chunk-F6IVBYFS.js.map → chunk-V6G2PSXA.js.map} +0 -0
- /package/dist/{chunk-RUXPVSML.js.map → chunk-VHOSM5G4.js.map} +0 -0
- /package/dist/{chunk-QBLDCI6E.js.map → chunk-VMNCZ627.js.map} +0 -0
- /package/dist/{chunk-P3ONDDIJ.js.map → chunk-VV4ZVUE6.js.map} +0 -0
- /package/dist/{chunk-A7GQBJP5.js.map → chunk-X2NFFBTO.js.map} +0 -0
- /package/dist/{chunk-ECKG5WSI.js.map → chunk-XGRXQR6T.js.map} +0 -0
- /package/dist/{chunk-LNDLXMH6.js.map → chunk-XN6XT6GR.js.map} +0 -0
- /package/dist/{chunk-C6KRO3SU.js.map → chunk-XVDZFTN5.js.map} +0 -0
- /package/dist/{chunk-2BQ4ZIWC.js.map → chunk-XWLLFKHM.js.map} +0 -0
- /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
- /package/dist/{chunk-BNGHPYZU.js.map → chunk-YUW66UAH.js.map} +0 -0
- /package/dist/{chunk-5JG5EBVL.js.map → chunk-ZEGL7YCC.js.map} +0 -0
- /package/dist/{chunk-PHP3MUGF.js.map → chunk-ZKZFFWLV.js.map} +0 -0
- /package/dist/{chunk-GCBIXUPT.js.map → chunk-ZMWSYUUL.js.map} +0 -0
- /package/dist/{chunk-X2QPKLPL.js.map → chunk-ZZUVBZL2.js.map} +0 -0
- /package/dist/{first-start-migration-L3UFX5CU.js.map → first-start-migration-ZWMV5CX4.js.map} +0 -0
- /package/dist/{tier-stats-VK5PCO2L.js.map → tier-stats-LUSUUNU6.js.map} +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/summarizer.ts"],"sourcesContent":["import { mkdir, readFile, writeFile, readdir } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { z } from \"zod\";\nimport { log } from \"./logger.js\";\nimport { LocalLlmClient } from \"./local-llm.js\";\nimport { FallbackLlmClient, fallbackLlmRuntimeContextFromConfig, gatewayTaskChainOptions } from \"./fallback-llm.js\";\nimport { ModelRegistry } from \"./model-registry.js\";\nimport { extractJsonCandidates } from \"./json-extract.js\";\nimport {\n completeBackgroundGeneration,\n parseBackgroundGenerationJson,\n} from \"./background-generation.js\";\nimport type { HourlySummary, TranscriptEntry, PluginConfig, GatewayConfig } from \"./types.js\";\nimport type { TranscriptManager } from \"./transcript.js\";\nimport { readSummarySnapshot, upsertSummarySnapshot, writeSummarySnapshot } from \"./summary-snapshot.js\";\nimport { encodeStoragePathSegment, resolveSafeStoragePath } from \"./storage-paths.js\";\nimport { sessionStoragePaths } from \"./session-identity.js\";\nimport { resolveLocalLlmCapabilities } from \"./capabilities.js\";\nimport { resolvePipelineProcessingCapabilities } from \"./capabilities.js\";\n\n// Schema for LLM summary output\nconst HourlySummarySchema = z.object({\n bullets: z.array(z.string().trim().min(1)).min(1).describe(\"3-5 bullet points summarizing the hour's activity\"),\n});\n\ntype HourlySummaryResult = z.infer<typeof HourlySummarySchema>;\n\nconst HourlySummaryExtendedSchema = z.object({\n topics: z.array(z.string()).default([]),\n decisions: z.array(z.string()).default([]),\n actionItems: z.array(z.string()).default([]),\n rejected: z.array(z.string()).default([]),\n});\n\ntype HourlySummaryExtendedResult = z.infer<typeof HourlySummaryExtendedSchema>;\n\ntype HourlySummaryExtendedMeta = {\n userTurns: number;\n assistantTurns: number;\n toolCalls: number;\n toolCounts: Record<string, number>;\n};\n\nfunction escapeRegExp(value: string): string {\n return value.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n}\n\n/**\n * Outcome stats of one `runHourly` pass (issue #2783). The summarizer must\n * not report success on empty work: an empty or stale transcript store is\n * the delegate-mode starvation signature, and callers surface these counts\n * and the staleness flag as a distinct warning instead of a bare ok.\n */\nexport interface HourlySummarizerRunStats {\n sessionsConsidered: number;\n sessionsWithEntries: number;\n summariesWritten: number;\n /** True when the newest transcript entry across the store is older than STALE_STORE_MS. */\n staleStore: boolean;\n /** ISO timestamp of the newest transcript entry seen by the scan, when any exist. */\n newestEntryTimestamp: string | null;\n /** True when the transcript scan itself FAILED (unreadable store) — distinct from an empty store. */\n scanFailed: boolean;\n}\n\n/** A store whose newest entry is older than this is considered stale (starvation signal, issue #2783). */\nconst STALE_STORE_MS = 2 * 60 * 60 * 1000;\n\n/**\n * Interpret one {@link HourlySummarizerRunStats} into the operator-facing\n * message/warning (issue #2783). Every degraded shape — failed scan, empty\n * store, backend-down, stale store — is DISTINCT from success; monitoring\n * alerts on `warning`, never on `ok` (ok only means \"the run completed\").\n */\nexport function summarizeHourlyStatus(stats: HourlySummarizerRunStats): {\n message: string;\n warning?: string;\n} {\n if (stats.scanFailed) {\n return {\n message:\n \"Hourly summarization completed, but the transcript store scan FAILED (unreadable directory or I/O error). Investigate the daemon's memoryDir.\",\n warning: \"transcript store scan failed\",\n };\n }\n if (stats.sessionsConsidered === 0) {\n return {\n message:\n \"Hourly summarization completed, but the transcript store is empty — no sessions found. If turns are ingested via observe, transcript persistence may be disabled or failing.\",\n warning: \"transcript store is empty\",\n };\n }\n if (stats.sessionsWithEntries > 0 && stats.summariesWritten === 0) {\n return {\n message: `Hourly summarization found ${stats.sessionsWithEntries} session(s) with transcript entries but wrote no summaries — the summarizer backend may be down.`,\n warning: \"sessions with entries produced no summaries\",\n };\n }\n if (stats.sessionsWithEntries === 0 && stats.staleStore) {\n return {\n message: `Hourly summarization completed with no transcript entries for the target hour, and the store looks stale (newest entry ${stats.newestEntryTimestamp ?? \"unknown\"}).`,\n warning: \"no transcript entries for the target hour and no new entries recently\",\n };\n }\n return {\n message: `Hourly summarization completed: ${stats.summariesWritten} summar${stats.summariesWritten === 1 ? \"y\" : \"ies\"} written across ${stats.sessionsWithEntries} session${stats.sessionsWithEntries === 1 ? \"\" : \"s\"} with transcript entries.`,\n };\n}\n\nexport class HourlySummarizer {\n private summariesDir: string;\n private config: PluginConfig;\n private localLlm: LocalLlmClient;\n private fallbackLlm: FallbackLlmClient;\n private modelRegistry: ModelRegistry;\n private transcript?: TranscriptManager;\n\n constructor(\n config: PluginConfig,\n gatewayConfig?: GatewayConfig,\n modelRegistry?: ModelRegistry,\n transcript?: TranscriptManager\n ) {\n this.config = config;\n this.summariesDir = path.join(config.memoryDir, \"summaries\", \"hourly\");\n this.modelRegistry = modelRegistry ?? new ModelRegistry(config.memoryDir);\n this.transcript = transcript;\n\n // Initialize local LLM client with shared model registry\n this.localLlm = new LocalLlmClient(config, this.modelRegistry);\n\n // Initialize fallback client with gateway config\n this.fallbackLlm = new FallbackLlmClient(gatewayConfig, fallbackLlmRuntimeContextFromConfig(config));\n\n if (\n !gatewayConfig?.agents?.defaults?.model?.primary &&\n !resolveLocalLlmCapabilities(config).localLlm &&\n config.modelSource !== \"gateway\"\n ) {\n log.warn(\"no gateway default AI and local LLM disabled — hourly summarization disabled\");\n }\n }\n\n private get useGatewayModelSource(): boolean {\n return this.config.modelSource === \"gateway\";\n }\n\n private get shouldUseLocalLlm(): boolean {\n return resolveLocalLlmCapabilities(this.config).localLlm && !this.useGatewayModelSource;\n }\n\n private withGatewayAgent(\n options: import(\"./fallback-llm.js\").FallbackLlmOptions\n ): import(\"./fallback-llm.js\").FallbackLlmOptions {\n if (!this.useGatewayModelSource) return options;\n // Shared resolution (taskModelChain > gatewayAgentId) — gotcha #22. Issue #1365.\n return { ...options, ...gatewayTaskChainOptions(this.config) };\n }\n\n async initialize(): Promise<void> {\n await mkdir(this.summariesDir, { recursive: true });\n log.info(\"hourly summarizer initialized\");\n }\n\n private async summarySessionDir(sessionKey: string): Promise<string> {\n return resolveSafeStoragePath(this.summariesDir, encodeStoragePathSegment(sessionKey, \"session\"));\n }\n\n private async legacySummarySessionDir(sessionKey: string): Promise<string | null> {\n if (sessionKey.includes(\"\\0\")) return null;\n try {\n return await resolveSafeStoragePath(this.summariesDir, sessionKey);\n } catch {\n return null;\n }\n }\n\n private summaryDateString(hour: string): string {\n const dateStr = hour.slice(0, 10);\n if (!/^\\d{4}-\\d{2}-\\d{2}$/.test(dateStr)) {\n throw new Error(`invalid hourly summary timestamp: ${hour}`);\n }\n return dateStr;\n }\n\n // Generate summary for a specific hour and session\n async generateSummary(\n sessionKey: string,\n hourStart: Date,\n entries: TranscriptEntry[]\n ): Promise<HourlySummary | null> {\n if (entries.length === 0) return null;\n\n // Format entries for the LLM\n const conversation = entries.map((e) => `[${e.role}] ${e.content}`).join(\"\\n\\n\");\n\n if (resolvePipelineProcessingCapabilities(this.config).hourlySummariesExtended) {\n const extended = await this.generateExtended(sessionKey, hourStart, conversation, entries);\n if (!extended) return null;\n const meta: HourlySummaryExtendedMeta = {\n userTurns: entries.filter((e) => e.role === \"user\").length,\n assistantTurns: entries.filter((e) => e.role === \"assistant\").length,\n toolCalls: extended._meta.toolCalls,\n toolCounts: extended._meta.toolCounts,\n };\n // Keep HourlySummary surface stable; encode \"topics\" as bullets for recall injection.\n const base: HourlySummary = {\n hour: hourStart.toISOString(),\n sessionKey,\n bullets: extended.topics.length > 0 ? extended.topics.slice(0, 5) : [\"(summary generated)\"],\n turnCount: entries.length,\n generatedAt: new Date().toISOString(),\n };\n const withExtras = base as any;\n withExtras._extended = extended;\n withExtras._extendedMeta = meta;\n return base;\n }\n\n const hourIso = hourStart.toISOString();\n const startTime = Date.now();\n\n if (this.config.backgroundGeneration) {\n try {\n const text = await completeBackgroundGeneration(this.config, [\n { role: \"system\", content: \"You are a conversation summarization system. Output valid JSON only.\" },\n { role: \"user\", content: `Summarize this conversation:\\n\\n${conversation}` },\n ]);\n const parsed = parseBackgroundGenerationJson(text, (value) => HourlySummarySchema.parse(value));\n if (parsed) {\n return {\n hour: hourIso,\n sessionKey,\n bullets: parsed.bullets,\n turnCount: entries.length,\n generatedAt: new Date().toISOString(),\n };\n }\n } catch {\n log.info(\"summary generation: background generation unavailable, continuing\");\n }\n }\n\n // Try local LLM first if enabled\n if (this.shouldUseLocalLlm) {\n try {\n const localResult = await this.generateWithLocalLlm(conversation);\n if (localResult) {\n const durationMs = Date.now() - startTime;\n log.debug(`generated hourly summary for ${sessionKey} at ${hourIso} in ${durationMs}ms using local LLM`);\n return {\n hour: hourIso,\n sessionKey,\n bullets: localResult.bullets,\n turnCount: entries.length,\n generatedAt: new Date().toISOString(),\n };\n }\n // Local failed, fall back if allowed\n if (!this.config.localLlmFallback) {\n log.warn(\"summary generation: local LLM failed and fallback disabled\");\n return null;\n }\n log.info(\"summary generation: local LLM unavailable, falling back to gateway default AI\");\n } catch (err) {\n if (!this.config.localLlmFallback) {\n log.warn(\"summary generation: local LLM error and fallback disabled:\", err);\n return null;\n }\n log.info(\"summary generation: local LLM error, falling back to gateway default AI:\", err);\n }\n }\n\n // Fall back to gateway's default AI\n log.info(\"summary generation: falling back to gateway default AI\");\n\n try {\n const messages = [\n {\n role: \"system\" as const,\n content: `You are a conversation summarization system. Summarize the following conversation transcript into 3-5 concise bullet points.\n\nGuidelines:\n- Focus on what was accomplished, decided, or discussed\n- Include specific topics, projects, or entities mentioned\n- Note any significant user requests or agent actions\n- Keep bullets brief but informative (1-2 sentences each)\n- Skip trivial greetings or meta-conversation\n- Use present tense for ongoing work, past for completed items\n\nRespond with valid JSON matching this schema:\n{\n \"bullets\": [\"bullet 1\", \"bullet 2\", \"bullet 3\"]\n}`,\n },\n { role: \"user\" as const, content: `Summarize this conversation:\\n\\n${conversation}` },\n ];\n\n const result = await this.fallbackLlm.parseWithSchema(\n messages,\n HourlySummarySchema,\n this.withGatewayAgent({ temperature: 0.3, maxTokens: 8192 })\n );\n\n const durationMs = Date.now() - startTime;\n\n if (result) {\n log.debug(`generated hourly summary for ${sessionKey} at ${hourIso} in ${durationMs}ms via fallback`);\n return {\n hour: hourIso,\n sessionKey,\n bullets: result.bullets,\n turnCount: entries.length,\n generatedAt: new Date().toISOString(),\n };\n }\n\n log.warn(\"summary generation fallback returned no parsed output\");\n return null;\n } catch (err) {\n log.error(\"summary generation fallback failed\", err);\n return null;\n }\n }\n\n private async generateExtended(\n sessionKey: string,\n hourStart: Date,\n conversation: string,\n entries: TranscriptEntry[]\n ): Promise<(HourlySummaryExtendedResult & { _meta: HourlySummaryExtendedMeta }) | null> {\n const hourIso = hourStart.toISOString();\n const startTime = Date.now();\n\n const hourEnd = new Date(hourStart.getTime() + 60 * 60 * 1000);\n let toolCounts: Record<string, number> = {};\n if (this.config.hourlySummariesIncludeToolStats && this.transcript) {\n const uses = await this.transcript.readToolUse(sessionKey, hourStart, hourEnd);\n for (const u of uses) toolCounts[u.tool] = (toolCounts[u.tool] ?? 0) + 1;\n }\n\n const sys = `You are a conversation summarization system.\\n\\nSummarize the hour into structured sections.\\n\\nReturn valid JSON matching:\\n{\\n \\\"topics\\\": [\\\"...\\\"],\\n \\\"decisions\\\": [\\\"...\\\"],\\n \\\"actionItems\\\": [\\\"...\\\"],\\n \\\"rejected\\\": [\\\"...\\\"]\\n}\\n\\nGuidelines:\\n- Prefer concrete topics and decisions.\\n- Action items should be imperative.\\n- Rejected ideas are things that were explicitly discarded or reversed.\\n- If there are none for a section, return an empty array.\\n`;\n\n const toolStatsLine =\n Object.keys(toolCounts).length > 0\n ? `Tools used (counts): ${Object.entries(toolCounts)\n .sort((a, b) => b[1] - a[1])\n .slice(0, 10)\n .map(([k, v]) => `${k}=${v}`)\n .join(\", \")}\\n\\n`\n : \"\";\n const userTurns = entries.filter((e) => e.role === \"user\").length;\n const assistantTurns = entries.filter((e) => e.role === \"assistant\").length;\n const toolCalls = Object.values(toolCounts).reduce((a, b) => a + b, 0);\n const statsLine = `Stats: userTurns=${userTurns}, assistantTurns=${assistantTurns}, toolCalls=${toolCalls}\\n\\n`;\n\n const user = `Hour: ${hourIso}\\nSession: ${sessionKey}\\n\\n${statsLine}${toolStatsLine}Conversation:\\n${conversation}\\n`;\n\n // Try local LLM first if enabled\n if (this.shouldUseLocalLlm) {\n try {\n const contextSizes = this.modelRegistry.calculateContextSizes(\n this.config.localLlmModel,\n this.config.localLlmMaxContext\n );\n const truncated =\n user.length > contextSizes.maxInputChars\n ? user.slice(0, contextSizes.maxInputChars) + \"\\n\\n[truncated]\"\n : user;\n const response = await this.localLlm.chatCompletion(\n [\n { role: \"system\", content: \"Output valid JSON only.\" },\n { role: \"user\", content: sys + \"\\n\\n\" + truncated },\n ],\n {\n temperature: 0.2,\n maxTokens: contextSizes.maxOutputTokens,\n operation: \"hourly_summary_extended\",\n priority: \"background\",\n }\n );\n if (response?.content) {\n const content = response.content.trim();\n for (const candidate of extractJsonCandidates(content)) {\n try {\n const parsed = JSON.parse(candidate);\n const result = HourlySummaryExtendedSchema.parse(parsed);\n log.debug(\n `generated extended hourly summary for ${sessionKey} at ${hourIso} in ${Date.now() - startTime}ms (local)`\n );\n return { ...result, _meta: { userTurns, assistantTurns, toolCalls, toolCounts } };\n } catch {\n // keep trying candidates\n }\n }\n }\n } catch (err) {\n if (!this.config.localLlmFallback) return null;\n log.info(\"extended summary: local failed, falling back:\", err);\n }\n }\n\n try {\n const result = await this.fallbackLlm.parseWithSchema(\n [\n { role: \"system\" as const, content: sys },\n { role: \"user\" as const, content: user },\n ],\n HourlySummaryExtendedSchema,\n this.withGatewayAgent({ temperature: 0.2, maxTokens: 2048 })\n );\n if (result) {\n log.debug(\n `generated extended hourly summary for ${sessionKey} at ${hourIso} in ${Date.now() - startTime}ms (fallback)`\n );\n return { ...result, _meta: { userTurns, assistantTurns, toolCalls, toolCounts } };\n }\n return null;\n } catch (err) {\n log.error(\"extended summary generation failed\", err);\n return null;\n }\n }\n\n /**\n * Generate summary using local LLM with JSON mode.\n * Uses dynamic context sizing based on model capabilities.\n */\n private async generateWithLocalLlm(conversation: string): Promise<HourlySummaryResult | null> {\n // Get dynamic context sizes based on model capabilities\n const contextSizes = this.modelRegistry.calculateContextSizes(\n this.config.localLlmModel,\n this.config.localLlmMaxContext\n );\n log.debug(`Summarizer model context: ${contextSizes.description}`);\n\n const maxConversationChars = contextSizes.maxInputChars;\n const truncatedConversation =\n conversation.length > maxConversationChars\n ? conversation.slice(0, maxConversationChars) + \"\\n\\n[truncated]\"\n : conversation;\n\n const instructions = `You are a conversation summarization system. Summarize the following conversation transcript into 3-5 concise bullet points.\n\nGuidelines:\n- Focus on what was accomplished, decided, or discussed\n- Include specific topics, projects, or entities mentioned\n- Note any significant user requests or agent actions\n- Keep bullets brief but informative (1-2 sentences each)\n- Skip trivial greetings or meta-conversation\n- Use present tense for ongoing work, past for completed items\n\nRespond with valid JSON matching this schema:\n{\n \"bullets\": [\"bullet 1\", \"bullet 2\", \"bullet 3\"]\n}`;\n\n const fullPrompt = `${instructions}\\n\\nConversation to summarize:\\n${truncatedConversation}`;\n\n const response = await this.localLlm.chatCompletion(\n [\n { role: \"system\", content: \"You are a conversation summarization system. Output valid JSON only.\" },\n { role: \"user\", content: fullPrompt },\n ],\n {\n temperature: 0.3,\n maxTokens: contextSizes.maxOutputTokens,\n operation: \"hourly_summary\",\n priority: \"background\",\n }\n );\n\n if (!response?.content) {\n return null;\n }\n\n try {\n // Parse JSON response\n const content = response.content.trim();\n for (const candidate of extractJsonCandidates(content)) {\n try {\n const parsed = JSON.parse(candidate);\n return HourlySummarySchema.parse(parsed);\n } catch {\n // keep trying candidates\n }\n }\n return null;\n } catch (err) {\n log.warn(\"local LLM summary: failed to parse JSON response:\", err);\n return null;\n }\n }\n\n // Save summary to file\n async saveSummary(summary: HourlySummary): Promise<void> {\n const sessionDir = await this.summarySessionDir(summary.sessionKey);\n await mkdir(sessionDir, { recursive: true });\n\n // Format date as YYYY-MM-DD for the filename\n const dateStr = this.summaryDateString(summary.hour);\n const filePath = await resolveSafeStoragePath(sessionDir, `${dateStr}.md`);\n\n // Format hour as HH:00 for display\n const hourStr = summary.hour.slice(11, 13);\n\n // Build markdown content\n const lines: string[] = [];\n\n // Check if file exists to append or create\n let existingContent = \"\";\n try {\n existingContent = await readFile(filePath, \"utf-8\");\n } catch {\n // File doesn't exist yet, will create new\n }\n\n // Check if this hour already exists (idempotent)\n const hourHeader = `## ${hourStr}:00`;\n if (existingContent.includes(hourHeader)) {\n // Replace existing hour section\n const headerMatch = new RegExp(`(^|\\\\n)${escapeRegExp(hourHeader)}\\\\n`).exec(existingContent);\n const sectionStart = headerMatch\n ? headerMatch.index + headerMatch[1].length\n : existingContent.indexOf(hourHeader);\n const nextHeaderPattern = /\\n## \\d{2}:00\\n/g;\n nextHeaderPattern.lastIndex = sectionStart + hourHeader.length;\n const nextHeader = nextHeaderPattern.exec(existingContent);\n const beforeHour = existingContent.slice(0, sectionStart);\n const afterHour = nextHeader ? existingContent.slice(nextHeader.index + 1) : \"\";\n const newSection = this.formatHourSection(summary, hourHeader);\n existingContent = beforeHour + newSection.trimEnd() + (afterHour ? \"\\n\\n\" + afterHour : \"\\n\");\n\n await writeFile(filePath, existingContent, \"utf-8\");\n log.debug(`updated hourly summary for ${summary.sessionKey} at ${hourStr}:00`);\n } else {\n // Append new hour section\n const newSection = this.formatHourSection(summary, hourHeader);\n\n if (existingContent) {\n // Add to existing file\n await writeFile(filePath, existingContent.trimEnd() + \"\\n\\n\" + newSection, \"utf-8\");\n } else {\n // Create new file with header\n const header = `# Hourly Summaries — ${dateStr}\\n\\n*Session: ${summary.sessionKey}*\\n`;\n await writeFile(filePath, header + \"\\n\" + newSection, \"utf-8\");\n }\n log.debug(`saved hourly summary for ${summary.sessionKey} at ${hourStr}:00`);\n }\n try {\n await upsertSummarySnapshot(this.config.memoryDir, summary);\n } catch (error) {\n log.warn(\n `hourly summarizer: failed to update summary snapshot for ${summary.sessionKey} (fail-open): ${String(error)}`\n );\n }\n }\n\n private formatHourSection(summary: HourlySummary, hourHeader: string): string {\n const ext = (summary as any)._extended as\n | (HourlySummaryExtendedResult & { _meta?: HourlySummaryExtendedMeta })\n | undefined;\n const meta = (summary as any)._extendedMeta as HourlySummaryExtendedMeta | undefined;\n const lines: string[] = [hourHeader, \"\"];\n\n if (resolvePipelineProcessingCapabilities(this.config).hourlySummariesExtended && ext) {\n lines.push(\"### Topics Discussed\");\n for (const t of ext.topics) lines.push(`- ${t}`);\n lines.push(\"\");\n lines.push(\"### Decisions Made\");\n for (const d of ext.decisions) lines.push(`- ${d}`);\n lines.push(\"\");\n lines.push(\"### Action Items\");\n for (const a of ext.actionItems) lines.push(`- ${a}`);\n lines.push(\"\");\n lines.push(\"### Rejected Ideas / Reversals\");\n for (const r of ext.rejected) lines.push(`- ${r}`);\n lines.push(\"\");\n if (meta && Object.keys(meta.toolCounts).length > 0) {\n lines.push(\"### Tools Used\");\n const top = Object.entries(meta.toolCounts)\n .sort((a, b) => b[1] - a[1])\n .slice(0, 12);\n for (const [name, count] of top) lines.push(`- ${name}: ${count}`);\n lines.push(\"\");\n }\n lines.push(\"### Stats\");\n lines.push(`- Turns: ${summary.turnCount}`);\n if (meta) {\n lines.push(`- User turns: ${meta.userTurns}`);\n lines.push(`- Assistant turns: ${meta.assistantTurns}`);\n lines.push(`- Tool calls: ${meta.toolCalls}`);\n }\n lines.push(\"\");\n return lines.join(\"\\n\");\n }\n\n for (const bullet of summary.bullets) lines.push(`- ${bullet}`);\n lines.push(` *(${summary.turnCount} turns)*`);\n lines.push(\"\");\n return lines.join(\"\\n\");\n }\n\n // Read recent summaries for recall injection\n async readRecent(sessionKey: string, hours: number): Promise<HourlySummary[]> {\n try {\n const cutoffTime = Date.now() - hours * 60 * 60 * 1000;\n\n const snapshot = await readSummarySnapshot(this.config.memoryDir, sessionKey);\n if (snapshot) {\n return snapshot\n .filter((s) => new Date(s.hour).getTime() >= cutoffTime)\n .sort((a, b) => new Date(b.hour).getTime() - new Date(a.hour).getTime());\n }\n\n const summaries: HourlySummary[] = [];\n const encodedDir = await this.summarySessionDir(sessionKey);\n const legacyDir = await this.legacySummarySessionDir(sessionKey);\n const seenDirs = new Set<string>();\n\n for (const sessionDir of [encodedDir, legacyDir]) {\n if (!sessionDir || seenDirs.has(sessionDir)) continue;\n seenDirs.add(sessionDir);\n const parsed = await this.readSummaryDir(sessionDir, sessionKey);\n summaries.push(...parsed);\n }\n\n const byHour = new Map<string, HourlySummary>();\n for (const summary of summaries) {\n if (!byHour.has(summary.hour)) byHour.set(summary.hour, summary);\n }\n\n const sortedSummaries = Array.from(byHour.values()).sort(\n (a, b) => new Date(b.hour).getTime() - new Date(a.hour).getTime()\n );\n\n // Filter to recent hours while materializing the full parsed history.\n const recent = sortedSummaries.filter((s) => new Date(s.hour).getTime() >= cutoffTime);\n\n if (sortedSummaries.length > 0) {\n try {\n await writeSummarySnapshot(this.config.memoryDir, sessionKey, sortedSummaries);\n } catch (error) {\n log.warn(\n `hourly summarizer: failed to materialize summary snapshot for ${sessionKey} (fail-open): ${String(error)}`\n );\n }\n }\n\n return recent;\n } catch {\n // Directory doesn't exist or error reading\n return [];\n }\n }\n\n private async readSummaryDir(sessionDir: string, sessionKey: string): Promise<HourlySummary[]> {\n let files: string[];\n try {\n files = await readdir(sessionDir);\n } catch {\n return [];\n }\n\n const summaries: HourlySummary[] = [];\n const mdFiles = files.filter((f) => f.endsWith(\".md\"));\n for (const file of mdFiles) {\n const filePath = await resolveSafeStoragePath(sessionDir, file).catch(() => null);\n if (filePath === null) continue;\n\n try {\n const content = await readFile(filePath, \"utf-8\");\n summaries.push(...this.parseSummaryFile(content, sessionKey, file));\n } catch {\n // Skip unreadable summary files.\n }\n }\n\n return summaries;\n }\n\n private parseSummaryFile(content: string, sessionKey: string, filename: string): HourlySummary[] {\n const summaries: HourlySummary[] = [];\n\n // Extract date from filename (YYYY-MM-DD.md)\n const dateMatch = filename.match(/^(\\d{4}-\\d{2}-\\d{2})\\.md$/);\n if (!dateMatch) return summaries;\n const dateStr = dateMatch[1];\n\n // Split by hour sections\n const hourSections = content.split(/\\n## (\\d{2}):00\\n/);\n\n // First element is the header, skip it\n for (let i = 1; i < hourSections.length; i += 2) {\n const hourStr = hourSections[i];\n const sectionContent = hourSections[i + 1] || \"\";\n\n // Parse bullets\n const bullets: string[] = [];\n const lines = sectionContent.split(\"\\n\");\n let turnCount = 0;\n\n let inTopics = false;\n let sawExtendedTopicsHeader = false;\n for (const line of lines) {\n if (line.startsWith(\"### Topics\")) {\n inTopics = true;\n sawExtendedTopicsHeader = true;\n continue;\n }\n if (line.startsWith(\"### \") && !line.startsWith(\"### Topics\")) {\n inTopics = false;\n }\n const bulletMatch = line.match(/^- (.+)$/);\n if (bulletMatch) {\n // For extended format, only treat topic bullets as recall bullets.\n if (!sawExtendedTopicsHeader || inTopics) bullets.push(bulletMatch[1]);\n }\n const turnMatch = line.match(/\\((\\d+) turns?\\)/);\n if (turnMatch) turnCount = parseInt(turnMatch[1], 10);\n }\n\n if (bullets.length > 0) {\n summaries.push({\n hour: `${dateStr}T${hourStr}:00:00.000Z`,\n sessionKey,\n bullets,\n turnCount,\n generatedAt: \"\", // Not stored in file, not needed for recall\n });\n }\n }\n\n return summaries;\n }\n\n // Format summaries for recall injection\n formatForRecall(summaries: HourlySummary[], maxCount: number): string {\n if (summaries.length === 0) return \"\";\n\n const limited = summaries.slice(0, maxCount);\n const lines: string[] = [`## Recent Activity (last ${limited.length} hours)`];\n\n for (const summary of limited) {\n const hourStr = summary.hour.slice(11, 16); // HH:MM\n for (const bullet of summary.bullets) {\n lines.push(`- ${hourStr}: ${bullet}`);\n }\n }\n\n return lines.join(\"\\n\");\n }\n\n // Main entry point for cron job\n async runHourly(): Promise<HourlySummarizerRunStats> {\n log.debug(\"running hourly summary generation\");\n\n // Get active sessions from transcript. The scan outcome is kept LOCAL to\n // this invocation (review round 2): shared instance state would let two\n // concurrent runHourly calls cross-report each other's timestamps.\n const scan = await this.getActiveSessions();\n const sessions = scan.sessionKeys;\n let sessionsWithEntries = 0;\n let summariesWritten = 0;\n\n for (const sessionKey of sessions) {\n // Calculate the hour we want to summarize (previous hour)\n const now = new Date();\n const hourStart = new Date(now.getTime() - 60 * 60 * 1000);\n hourStart.setMinutes(0, 0, 0);\n const hourEnd = new Date(hourStart.getTime() + 60 * 60 * 1000);\n\n // Get entries for this session in the target hour\n const entries = await this.getTranscriptEntries(sessionKey, hourStart, hourEnd);\n\n if (entries.length === 0) {\n log.debug(`no transcript entries for ${sessionKey} at ${hourStart.toISOString()}`);\n continue;\n }\n sessionsWithEntries += 1;\n\n // Generate and save summary\n const summary = await this.generateSummary(sessionKey, hourStart, entries);\n if (summary) {\n await this.saveSummary(summary);\n summariesWritten += 1;\n log.info(`generated hourly summary for ${sessionKey} (${entries.length} turns)`);\n }\n }\n\n return {\n sessionsConsidered: sessions.length,\n sessionsWithEntries,\n summariesWritten,\n // Staleness signal (issue #2783): newest entry across the whole\n // store, from the same scan getActiveSessions already performs.\n staleStore:\n scan.newestEntryTimestamp !== null &&\n Date.now() - new Date(scan.newestEntryTimestamp).getTime() > STALE_STORE_MS,\n newestEntryTimestamp: scan.newestEntryTimestamp,\n scanFailed: scan.scanFailed,\n };\n }\n\n // Get list of active sessions from the transcript directory, plus the\n // scan bookkeeping runHourly reports: newest entry timestamp (staleness\n // signal) and whether the scan itself FAILED. A failed scan must not be\n // reported as an empty store — those are different incidents (review\n // round 2).\n private async getActiveSessions(): Promise<{\n sessionKeys: string[];\n newestEntryTimestamp: string | null;\n scanFailed: boolean;\n }> {\n const transcriptDir = await resolveSafeStoragePath(this.config.memoryDir, \"transcripts\").catch(() => null);\n if (transcriptDir === null) {\n return { sessionKeys: [], newestEntryTimestamp: null, scanFailed: false };\n }\n\n const sessionKeys = new Set<string>();\n let newestEntryTimestamp: string | null = null;\n let newestEntryTimeMs = Number.NaN;\n let fileReadFailed = false;\n const collect = async (transcriptPath: string): Promise<void> => {\n try {\n const raw = await readFile(transcriptPath, \"utf-8\");\n for (const line of raw.split(\"\\n\")) {\n if (!line.trim()) continue;\n try {\n const entry = JSON.parse(line) as TranscriptEntry;\n if (typeof entry.sessionKey === \"string\" && entry.sessionKey.length > 0) {\n sessionKeys.add(entry.sessionKey);\n }\n // Compare parsed epoch values, never strings: a malformed\n // timestamp in a hand-edited file must not poison the staleness\n // signal with a lexically-maximal garbage value (review).\n if (typeof entry.timestamp === \"string\") {\n const timeMs = new Date(entry.timestamp).getTime();\n if (Number.isFinite(timeMs) && (Number.isNaN(newestEntryTimeMs) || timeMs > newestEntryTimeMs)) {\n newestEntryTimeMs = timeMs;\n newestEntryTimestamp = entry.timestamp;\n }\n }\n } catch {\n // ignore malformed transcript lines\n }\n }\n } catch (err) {\n // ENOENT is a concurrently-deleted file — ignore. Any other read\n // failure (permissions, I/O) means the store is partially UNREADABLE:\n // mark the scan failed so the caller warns instead of reporting an\n // empty store (review round 3).\n if ((err as NodeJS.ErrnoException)?.code !== \"ENOENT\") {\n fileReadFailed = true;\n }\n }\n };\n\n try {\n const typeEntries = await readdir(transcriptDir, { withFileTypes: true });\n for (const typeEnt of typeEntries) {\n if (!typeEnt.isDirectory()) continue;\n const typeDir = await resolveSafeStoragePath(transcriptDir, typeEnt.name).catch(() => null);\n if (typeDir === null) continue;\n const idEntries = await readdir(typeDir, { withFileTypes: true });\n for (const idEnt of idEntries) {\n if (!idEnt.isDirectory()) continue;\n const chanDir = await resolveSafeStoragePath(typeDir, idEnt.name).catch(() => null);\n if (chanDir === null) continue;\n const files = (await readdir(chanDir)).filter((f) => f.endsWith(\".jsonl\")).sort();\n for (const file of files) {\n const transcriptPath = await resolveSafeStoragePath(chanDir, file).catch(() => null);\n if (transcriptPath === null) continue;\n await collect(transcriptPath);\n }\n }\n }\n return {\n sessionKeys: Array.from(sessionKeys),\n newestEntryTimestamp,\n scanFailed: fileReadFailed,\n };\n } catch (err) {\n // ENOENT on the root is a never-written store — an EMPTY store, not a\n // scan failure (those are different incidents).\n const code = (err as NodeJS.ErrnoException)?.code;\n if (code === \"ENOENT\") {\n return { sessionKeys: [], newestEntryTimestamp: null, scanFailed: false };\n }\n log.warn(`transcript scan failed: ${err}`);\n return { sessionKeys: [], newestEntryTimestamp: null, scanFailed: true };\n }\n }\n\n // Get transcript entries for a session within a time range\n private async getTranscriptEntries(sessionKey: string, startTime: Date, endTime: Date): Promise<TranscriptEntry[]> {\n // Shared session-identity layer (issue #1496, rule #22). Arbitrary keys\n // route to `session/<hash>`; legacy `agent:<id>:...` keep their paths. The\n // shared helper also supplies the read-back-only candidate dirs (mirrors\n // TranscriptManager) so legacy `other/default` AND old `parts.length >= 3`\n // data stays discoverable here too.\n const paths = sessionStoragePaths(sessionKey);\n\n try {\n const transcriptRoot = path.join(this.config.memoryDir, \"transcripts\");\n const candidateDirs = new Set(\n [paths.dir, paths.alternateDir, paths.legacyDir, ...paths.readbackDirs].filter(\n (dir): dir is string => typeof dir === \"string\" && dir.length > 0\n )\n );\n const entries: TranscriptEntry[] = [];\n // Dedup identical raw rows that a partially-applied migration may have\n // left in both the primary dir and a read-back dir (issue #1496, cursor\n // review). Exact raw JSONL line is the stable identity.\n const seenRawLines = new Set<string>();\n\n // Read all daily transcript files in the directory\n for (const candidateDir of candidateDirs) {\n const transcriptDir = await resolveSafeStoragePath(transcriptRoot, candidateDir).catch(() => null);\n if (transcriptDir === null) continue;\n\n const files = await readdir(transcriptDir).catch(() => []);\n for (const file of files) {\n if (!file.endsWith(\".jsonl\")) continue;\n\n const transcriptPath = await resolveSafeStoragePath(transcriptDir, file).catch(() => null);\n if (transcriptPath === null) continue;\n\n try {\n const content = await readFile(transcriptPath, \"utf-8\");\n const lines = content.trim().split(\"\\n\");\n\n for (const line of lines) {\n if (!line.trim()) continue;\n try {\n const entry = JSON.parse(line) as TranscriptEntry;\n const entryTime = new Date(entry.timestamp).getTime();\n\n if (\n entry.sessionKey === sessionKey &&\n entryTime >= startTime.getTime() &&\n entryTime < endTime.getTime() &&\n !seenRawLines.has(line)\n ) {\n seenRawLines.add(line);\n entries.push(entry);\n }\n } catch {\n // Skip malformed lines\n }\n }\n } catch {\n // Skip unreadable files\n }\n }\n }\n\n return entries;\n } catch {\n return [];\n }\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,SAAS,OAAO,UAAU,WAAW,eAAe;AACpD,OAAO,UAAU;AACjB,SAAS,SAAS;AAmBlB,IAAM,sBAAsB,EAAE,OAAO;AAAA,EACnC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,EAAE,IAAI,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,SAAS,mDAAmD;AAChH,CAAC;AAID,IAAM,8BAA8B,EAAE,OAAO;AAAA,EAC3C,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACtC,WAAW,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EACzC,aAAa,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,QAAQ,CAAC,CAAC;AAAA,EAC3C,UAAU,EAAE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AQ,OAAO;AACxB,kBAAI,CAAC,KAAK,KAAK,EAAG;AAClB,kBAAI;AACF,sBAAM,QAAQ,KAAK,MAAM,IAAI;AAC7B,sBAAM,YAAY,IAAI,KAAK,MAAM,SAAS,EAAE,QAAQ;AAEpD,oBACE,MAAM,eAAe,cACrB,aAAa,UAAU,QAAQ,KAC/B,YAAY,QAAQ,QAAQ,KAC5B,CAAC,aAAa,IAAI,IAAI,GACtB;AACA,+BAAa,IAAI,IAAI;AACrB,0BAAQ,KAAK,KAAK;AAAA,gBACpB;AAAA,cACF,QAAQ;AAAA,cAER;AAAA,YACF;AAAA,UACF,QAAQ;AAAA,UAER;AAAA,QACF;AAAA,MACF;AAEA,aAAO;AAAA,IACT,QAAQ;AACN,aAAO,CAAC;AAAA,IACV;AAAA,EACF;AACF;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
RECALL_DISCLOSURE_LEVELS
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-IYKZJVL5.js";
|
|
4
4
|
|
|
5
5
|
// src/recall-navigate.ts
|
|
6
6
|
var RECALL_NAV_LINK_TYPES = [
|
|
@@ -48,4 +48,4 @@ export {
|
|
|
48
48
|
expandRecallNode,
|
|
49
49
|
traverseRecallLink
|
|
50
50
|
};
|
|
51
|
-
//# sourceMappingURL=chunk-
|
|
51
|
+
//# sourceMappingURL=chunk-AECJY3GJ.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
citationTemplateFingerprint,
|
|
6
6
|
isCachedIdentityReusable,
|
|
7
7
|
isReconcileMemoryIdentity
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-5U7K4W6K.js";
|
|
9
9
|
import {
|
|
10
10
|
offlineSyncStorageForSnapshot
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XVDZFTN5.js";
|
|
12
12
|
import {
|
|
13
13
|
createPersistedSupportPassportPrivateFileExclusion
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-37CAEC7E.js";
|
|
15
15
|
import {
|
|
16
16
|
iterateOfflineSyncSnapshotFileRecords
|
|
17
17
|
} from "./chunk-WQZZDN5M.js";
|
|
@@ -217,4 +217,4 @@ export {
|
|
|
217
217
|
planServerIdentityCacheWrite,
|
|
218
218
|
createOfflineSyncManifestStream
|
|
219
219
|
};
|
|
220
|
-
//# sourceMappingURL=chunk-
|
|
220
|
+
//# sourceMappingURL=chunk-B36GUU6T.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSearchBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-OKO57IXB.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceIdentityToken,
|
|
6
6
|
normalizeNamespaceIdentity
|
|
@@ -470,4 +470,4 @@ export {
|
|
|
470
470
|
NamespaceSearchRouter,
|
|
471
471
|
normalizeQmdResultPath
|
|
472
472
|
};
|
|
473
|
-
//# sourceMappingURL=chunk-
|
|
473
|
+
//# sourceMappingURL=chunk-BJEJUOGM.js.map
|
|
@@ -42,9 +42,19 @@ var EXTRACTION_RESPONSE_SHAPE = `{
|
|
|
42
42
|
"episodeTitle": "<six-to-eight word conversation segment title>",
|
|
43
43
|
"relationships": [{"source": "<normalized-name>", "target": "<normalized-name>", "label": "<source-grounded relationship>"}]
|
|
44
44
|
}`;
|
|
45
|
+
function extractionResponseShape(spanMode = "off") {
|
|
46
|
+
if (spanMode === "off") return EXTRACTION_RESPONSE_SHAPE;
|
|
47
|
+
return EXTRACTION_RESPONSE_SHAPE.replace(
|
|
48
|
+
`"eventTime": "<optional source temporal expression>"`,
|
|
49
|
+
`"eventTime": "<optional source temporal expression>",
|
|
50
|
+
"span": {"sourceMessageIndex": <message number>, "charStart": <number>, "charEnd": <number>, "frame": "<at most 15 words>"}`
|
|
51
|
+
);
|
|
52
|
+
}
|
|
45
53
|
var EXTRACTION_RESPONSE_PLACEHOLDERS = {};
|
|
46
|
-
for (const
|
|
47
|
-
|
|
54
|
+
for (const shape of [EXTRACTION_RESPONSE_SHAPE, extractionResponseShape("on")]) {
|
|
55
|
+
for (const placeholder of shape.match(/<[^<>\r\n]+>/g) ?? []) {
|
|
56
|
+
EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;
|
|
57
|
+
}
|
|
48
58
|
}
|
|
49
59
|
var CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 "cueAnchors".
|
|
50
60
|
- Each cue anchor value must be a source-grounded search hook of at most 120 characters, in the form "<main entity or topic> <key aspect>".
|
|
@@ -57,6 +67,18 @@ function eventTimePromptInstruction(config) {
|
|
|
57
67
|
return `
|
|
58
68
|
When a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into "eventTime". Omit "eventTime" when no such expression appears; never infer dates.`;
|
|
59
69
|
}
|
|
70
|
+
function spanModePromptSection(spanMode) {
|
|
71
|
+
if (spanMode === "off") return "";
|
|
72
|
+
const requestBoth = spanMode === "shadow";
|
|
73
|
+
return `
|
|
74
|
+
Span mode (numbered-message offsets):
|
|
75
|
+
- Conversation messages are numbered in order starting at 0 (the "[role] text" blocks).
|
|
76
|
+
- For each fact, return "span": {"sourceMessageIndex": <message number>, "charStart": <number>, "charEnd": <number>, "frame": "<at most 15 words>"} pointing at the verbatim supporting words in that message's text (the text after the "] "). Offsets are [charStart, charEnd), end-exclusive, counting from the first character of the message text.
|
|
77
|
+
- "frame" is at most 15 generated words that make the span self-contained: resolve pronouns to names, name the subject (e.g., frame "Maya's relocation:" + span "moved to Seattle last spring\u2026").${requestBoth ? `
|
|
78
|
+
- This run is in SHADOW mode: ALSO include the full standalone "content" restatement exactly as you would normally write it, in addition to "span".` : `
|
|
79
|
+
- Set "content" to the frame text (the short \u226415-word frame) \u2014 do not restate the full fact; the span plus frame carry it.`}
|
|
80
|
+
- Invalid spans fall back to the frame, so keep the frame informative.`;
|
|
81
|
+
}
|
|
60
82
|
function buildExtractionInstructions(config, existingEntities, ambientCapture = false) {
|
|
61
83
|
const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);
|
|
62
84
|
return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.
|
|
@@ -121,7 +143,7 @@ ${existingEntities.join(", ")}
|
|
|
121
143
|
|
|
122
144
|
When you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.
|
|
123
145
|
` : ""}
|
|
124
|
-
${eventTimePromptInstruction(config)}
|
|
146
|
+
${eventTimePromptInstruction(config)}${spanModePromptSection(config.extraction?.spanMode ?? "off")}
|
|
125
147
|
Also extract relationships between entities mentioned in the conversation.
|
|
126
148
|
- Format: {source: "entity-name", target: "entity-name", label: "relationship description"}
|
|
127
149
|
- Max 5 relationships per extraction
|
|
@@ -185,14 +207,16 @@ The output should be the COMPLETE consolidated profile as valid markdown, starti
|
|
|
185
207
|
|
|
186
208
|
export {
|
|
187
209
|
EXTRACTION_RESPONSE_SHAPE,
|
|
210
|
+
extractionResponseShape,
|
|
188
211
|
EXTRACTION_RESPONSE_PLACEHOLDERS,
|
|
189
212
|
CUE_ANCHOR_PROMPT_INSTRUCTION,
|
|
190
213
|
OUTPUT_LANGUAGE_POLICY,
|
|
191
214
|
eventTimePromptInstruction,
|
|
215
|
+
spanModePromptSection,
|
|
192
216
|
buildExtractionInstructions,
|
|
193
217
|
CONSOLIDATION_RESPONSE_SCHEMA,
|
|
194
218
|
PROFILE_CONSOLIDATION_RESPONSE_SCHEMA,
|
|
195
219
|
buildConsolidationSystemPrompt,
|
|
196
220
|
buildProfileConsolidationSystemPrompt
|
|
197
221
|
};
|
|
198
|
-
//# sourceMappingURL=chunk-
|
|
222
|
+
//# sourceMappingURL=chunk-BOADKFN4.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/extraction-prompt.ts"],"sourcesContent":["/**\n * Extraction prompt construction (issue #1995 sibling extraction).\n *\n * The system prompt, its JSON response shape, and the placeholder table\n * derived from that shape are prompt DATA, not engine behavior. They live here\n * so `extraction.ts` holds the pipeline and one module owns the text every\n * extraction path — local LLM, direct client, gateway fallback — sends.\n */\n\nimport { AMBIENT_CAPTURE_PROMPT_SECTION, AMBIENT_SPECULATIVE_TIER_CLAUSE } from \"./ambient-provenance.js\";\nimport { resolveMemoryLifecycleCapabilities, resolveRecallAuxiliaryCapabilities } from \"./capabilities.js\";\nimport type { PluginConfig } from \"./types.js\";\n\nexport const EXTRACTION_RESPONSE_SHAPE = `{\n \"facts\": [{\n \"category\": \"<category>\",\n \"content\": \"<source-grounded statement>\",\n \"confidence\": 0.0,\n \"tags\": [\"<tag>\"],\n \"entityRef\": \"<optional normalized-name>\",\n \"cueAnchors\": [{\"type\": \"<anchor-type>\", \"value\": \"<entity-or-topic plus key aspect>\"}],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"quote\": \"<optional exact contiguous source span>\",\n \"scope\": \"<optional project-or-global>\",\n \"subject\": \"<optional user-or-agent>\",\n \"structuredAttributes\": {\"<key>\": \"<value>\"},\n \"procedureSteps\": [{\"order\": 1, \"intent\": \"<step>\"}, {\"order\": 2, \"intent\": \"<step>\"}],\n \"reasoningTrace\": {\n \"steps\": [{\"order\": 1, \"description\": \"<step>\"}, {\"order\": 2, \"description\": \"<step>\"}],\n \"finalAnswer\": \"<answer>\",\n \"observedOutcome\": \"<optional outcome>\"\n },\n \"eventTime\": \"<optional source temporal expression>\"\n }],\n \"entities\": [{\n \"name\": \"<normalized-name>\",\n \"type\": \"<entity-type>\",\n \"facts\": [\"<source-grounded statement>\"],\n \"promptedByQuestion\": \"<optional source-grounded question>\",\n \"structuredSections\": [{\"key\": \"<section-key>\", \"title\": \"<section-title>\", \"facts\": [\"<source-grounded statement>\"]}]\n }],\n \"profileUpdates\": [\"<source-grounded profile update>\"],\n \"questions\": [{\"question\": \"<source-grounded unresolved question>\", \"context\": \"<source-grounded context>\", \"priority\": 0.0}],\n \"identityReflection\": \"<conversation-grounded agent reflection>\",\n \"episodeTitle\": \"<six-to-eight word conversation segment title>\",\n \"relationships\": [{\"source\": \"<normalized-name>\", \"target\": \"<normalized-name>\", \"label\": \"<source-grounded relationship>\"}]\n}`;\nexport function extractionResponseShape(spanMode: \"off\" | \"shadow\" | \"on\" = \"off\"): string {\n if (spanMode === \"off\") return EXTRACTION_RESPONSE_SHAPE;\n return EXTRACTION_RESPONSE_SHAPE.replace(\n `\"eventTime\": \"<optional source temporal expression>\"`,\n `\"eventTime\": \"<optional source temporal expression>\",\n \"span\": {\"sourceMessageIndex\": <message number>, \"charStart\": <number>, \"charEnd\": <number>, \"frame\": \"<at most 15 words>\"}`,\n );\n}\nexport const EXTRACTION_RESPONSE_PLACEHOLDERS: Record<string, true> = {};\nfor (const shape of [EXTRACTION_RESPONSE_SHAPE, extractionResponseShape(\"on\")]) {\n for (const placeholder of shape.match(/<[^<>\\r\\n]+>/g) ?? []) {\n EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;\n }\n}\nexport const CUE_ANCHOR_PROMPT_INSTRUCTION = `- For each fact, emit at most 3 \"cueAnchors\".\n- Each cue anchor value must be a source-grounded search hook of at most 120 characters, in the form \"<main entity or topic> <key aspect>\".\n- Set each cue anchor type to entity, file, tool, outcome, constraint, or date.\n- Omit cue anchors when the conversation does not support a useful search hook.\n- Example: \"Alice booked Bistro Max for Mike's surprise party\" can use {\"type\":\"entity\",\"value\":\"Mike surprise party\"} and {\"type\":\"entity\",\"value\":\"Alice restaurant booking\"}.`;\n\n/**\n * Output-language policy (issue #2190). Every prompt that produces memory\n * content embeds this verbatim so non-English conversations are not silently\n * translated to English — translated memories fail later lexical recall.\n */\nexport const OUTPUT_LANGUAGE_POLICY = `Output language: write facts, profile updates, entity names and aliases, tags, questions, and any rewritten or merged memory content in the source language of the conversation or input memories. Never translate into English or another language unless the user explicitly asked for a translation.`;\n\n/**\n * Bi-temporal event-time extraction instruction (#1578 PR2). Emitted on\n * every extraction entry path when `temporal.biTemporal` is on so the LLM\n * emits an optional per-fact `eventTime` expression. The expression is\n * resolved against the source turn timestamp at write time — never\n * wall-clock — so replay/import of old transcripts anchors correctly.\n * Returns an empty string when the gate is off (byte-identical prompt).\n */\nexport function eventTimePromptInstruction(config: PluginConfig): string {\n if (!config.temporalBiTemporal) return \"\";\n return `\nWhen a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into \"eventTime\". Omit \"eventTime\" when no such expression appears; never infer dates.`;\n}\n\n/**\n * Span-mode extraction instructions (issue #2333 Phase B). Empty when the\n * mode is off (byte-identical prompt). The offset convention mirrors the\n * Phase A bench: messages numbered in order from 0, offsets index the\n * message's own text (after the `[role] ` tag), [charStart, charEnd)\n * end-exclusive.\n */\nexport function spanModePromptSection(spanMode: \"off\" | \"shadow\" | \"on\"): string {\n if (spanMode === \"off\") return \"\";\n const requestBoth = spanMode === \"shadow\";\n return `\nSpan mode (numbered-message offsets):\n- Conversation messages are numbered in order starting at 0 (the \"[role] text\" blocks).\n- For each fact, return \"span\": {\"sourceMessageIndex\": <message number>, \"charStart\": <number>, \"charEnd\": <number>, \"frame\": \"<at most 15 words>\"} pointing at the verbatim supporting words in that message's text (the text after the \"] \"). Offsets are [charStart, charEnd), end-exclusive, counting from the first character of the message text.\n- \"frame\" is at most 15 generated words that make the span self-contained: resolve pronouns to names, name the subject (e.g., frame \"Maya's relocation:\" + span \"moved to Seattle last spring…\").${\n requestBoth\n ? `\n- This run is in SHADOW mode: ALSO include the full standalone \"content\" restatement exactly as you would normally write it, in addition to \"span\".`\n : `\n- Set \"content\" to the frame text (the short ≤15-word frame) — do not restate the full fact; the span plus frame carry it.`\n }\n- Invalid spans fall back to the frame, so keep the frame informative.`;\n}\n\n/**\n * Build extraction instructions shared between local and cloud LLM.\n *\n * `ambientCapture` marks input from an always-on recorder, which may carry\n * speech the user never authored (issue #2294).\n */\nexport function buildExtractionInstructions(\n config: PluginConfig,\n existingEntities?: string[],\n ambientCapture = false\n): string {\n const lifecycleCaps = resolveMemoryLifecycleCapabilities(config);\n return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.\n\nMemory categories:\n- fact: Objective information about the world\n- preference: User likes, dislikes, or stylistic choices\n- correction: User correcting a mistake or misconception (highest priority)\n- entity: Information about a specific person, project, tool, or company\n- decision: A choice that was made with rationale\n- relationship: How two entities relate to each other (e.g., \"Alice is Bob's manager\", \"Acme Corp uses Shopify\")\n- principle: Durable rules, values, or operating beliefs (e.g., \"never use Chat Completions API\")\n- commitment: Promises, obligations, or deadlines (e.g., \"deploy by Friday\", \"call accountant Monday\")\n- moment: Emotionally significant events or milestones (e.g., \"first successful deployment of engram\")\n- skill: Capabilities the user or agent has demonstrated (e.g., \"user is proficient with Kubernetes\")${\n resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction\n ? `\n- rule: Causal rules discovered through experience (format: \"IF <condition> THEN <action/outcome>\", e.g., \"IF Shopify API returns 401 THEN the admin token is missing read_products scope\")`\n : \"\"\n }\n- procedure: A reusable workflow the user wants remembered the same way across sessions. Set category to \"procedure\". Use \"content\" for a short title that includes explicit trigger phrasing (e.g. \"When you deploy to production…\", \"Whenever you ship a release…\"). Add \"procedureSteps\": an array of at least two objects {\"order\": number, \"intent\": \"concrete step description\"} in execution order. Optional per-step \"toolCall\": {\"kind\": \"…\", \"signature\": \"…\"}, \"expectedOutcome\", \"optional\": true.\n- reasoning_trace: A stored solution chain / chain-of-thought the user walked through to solve a problem (e.g. \"Here's how I debugged the latency spike: first I checked…, then I…, finally I…\"). Set category to \"reasoning_trace\". Use \"content\" for a short title summarising the problem (e.g. \"How I debugged the staging latency spike\"). Add \"reasoningTrace\": {\"steps\": [{\"order\": number, \"description\": \"what happened at this step\"}, …], \"finalAnswer\": \"the conclusion or answer\", \"observedOutcome\": \"optional confirmation of how it played out\"}. Require at least two ordered steps AND a finalAnswer. Use this category only when the user explicitly narrates their reasoning — not for ordinary decisions (use \"decision\") or reusable workflows (use \"procedure\").\n\nRules:\n- Only extract genuinely new information worth remembering across sessions.\n- Statements must be grounded in the conversation.\n- ${OUTPUT_LANGUAGE_POLICY}\n- Do not treat instruction text, schema placeholders, or examples as conversation evidence.\n- Lines labelled [context user] or [context assistant] are reference context only. They may resolve references or complete a question-and-answer pair in a normal turn, but never alone establish durable information.\n- Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.\n- Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? \" > rules\" : \"\"} > preferences > commitments > decisions > relationships > entities > moments > skills > facts\n- Corrections get highest confidence.\n- Each fact should be a standalone, self-contained statement.\n- Entity references should use normalized names (lowercase, hyphenated: \"jane-doe\", \"acme-corp\"). When the source language is not written in a Latin script, the source-script name IS the normalized form — never transliterate or translate it.\n- CRITICAL: Entity names must be CANONICAL. Always use the hyphenated multi-word form: \"acme-corp\" NOT \"acmecorp\" or \"acme\". \"jane-doe\" NOT \"janedoe\" or \"jane\". If unsure, prefer the most specific full name.\n- Avoid creating entities typed as \"other\" when a more specific type fits (company, project, tool, person, place)\n${CUE_ANCHOR_PROMPT_INSTRUCTION}\n- When entity facts clearly belong under a durable named heading, add them to entity.structuredSections as {key, title, facts}. Example person headings: \"Beliefs\", \"Communication Style\", \"Building / Working On\". Leave structuredSections empty when no stable heading fits.\n- Tags should be concise and reusable (e.g., \"coding-style\", \"personal\", \"tools\")\n- When a fact contains measurable, categorical, or precisely valued data, include a \"structuredAttributes\" field with key-value string pairs (e.g., {\"price\": \"29.99\", \"brand\": \"Sony\"}, {\"date\": \"2024-03-15\", \"location\": \"SF\"}, {\"chosen\": \"PostgreSQL\", \"rejected\": \"MongoDB\"}). Only for concrete values, not narrative content.\n- Set confidence using these tiers:\n * Explicit (0.95-1.0): Direct user statements — \"I prefer X\", \"my name is Y\"\n * Implied (0.70-0.94): Strong contextual inference — user consistently does X, clear from conversation flow\n * Inferred (0.40-0.69): Pattern recognition — reasonable guess from limited evidence\n * Speculative (0.00-0.39): Tentative hypothesis — weak signal, needs future confirmation. Speculative memories auto-expire after 30 days if not confirmed.${ambientCapture ? AMBIENT_SPECULATIVE_TIER_CLAUSE : \"\"}${\n config.provenance?.enabled\n ? `\n- Source quotes: For each fact, include a \"quote\" field containing the EXACT verbatim words from the conversation that support the fact. Copy a contiguous span from a single speaker turn (not a paraphrase, not a summary). Cap at ~300 characters. This grounds every memory in the literal utterance that created it.`\n : \"\"\n }\n- For commitments: include any deadline or timeframe mentioned${\n lifecycleCaps.extractionScopeClassification\n ? `\n\nScope classification:\nFor each fact, set \"scope\" to one of:\n- \"global\" — knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style), general coding patterns, infrastructure knowledge, technology facts not tied to one codebase\n- \"project\" — knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions. Tool, command, or CLI-flag instructions TIED TO ONE AGENT are also \"project\", because the same tool name means different things in different agent integrations (a \"search\" tool may search repository code in one agent and the web in another); when keeping such an agent-tied instruction, the fact text MUST name the originating agent as a leading \"In <agent>,\" clause (e.g. \"In Pi, use the search tool with a repository path.\"). A tool/command fact that holds in every agent and every repo is NOT agent-tied — leave it \"global\" and do not add a qualifier (e.g. \"\\`git status --short\\` emits compact output\"). Examples: \"In Pi, the search tool takes a repository path\" -> \"project\"; \"\\`git status --short\\` emits compact output\" -> \"global\".\nWhen in doubt, prefer \"project\" — it is safer to keep knowledge scoped narrowly.`\n : \"\"\n }\n${\n ambientCapture\n ? `${AMBIENT_CAPTURE_PROMPT_SECTION}\n`\n : \"\"\n}\nEntity creation rules (STRICT):\n- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects\n- NEVER create entities for transient items: individual PRs, branches, Jira tickets, meetings, agent task IDs, log files, database tables, cron job runs, sessions\n- When you learn something about a transient item (e.g., PR #58 fixed a bug), store it as a FACT with an entityRef to the parent project — do NOT create an entity for the PR itself\n- Prefer attaching facts to broad parent entities rather than creating sub-entities. E.g., \"acme-store uses Algolia for search\" is a fact on entity \"acme-store\", NOT a new entity \"acme-store-algolia-connector\"\n- The entity list should be SHORT — think \"things that would have their own Wikipedia page\" not \"things mentioned in passing\"\n\n${\n existingEntities && existingEntities.length > 0\n ? `\nKNOWN ENTITIES (use these exact names when referencing existing things):\n${existingEntities.join(\", \")}\n\nWhen you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.\n`\n : \"\"\n}\n${eventTimePromptInstruction(config)}${spanModePromptSection(config.extraction?.spanMode ?? \"off\")}\nAlso extract relationships between entities mentioned in the conversation.\n- Format: {source: \"entity-name\", target: \"entity-name\", label: \"relationship description\"}\n- Max 5 relationships per extraction\n- Only include clear, durable relationships (e.g., \"works at\", \"created\", \"manages\", \"uses\")\n- Use normalized entity names (e.g., \"person-jane-doe\", \"company-acme-corp\")\n\n\nAlso emit \"episodeTitle\" as a six-to-eight word title for this conversation segment.\nQuestions are optional. Include only source-grounded unresolved questions that would be useful in future sessions; otherwise return an empty array.\n\nFinally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;\n}\n\nexport const CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"items\": [\n {\n \"existingId\": \"id\",\n \"action\": \"ADD\",\n \"mergeWith\": \"optional-existing-id\",\n \"updatedContent\": \"optional replacement content\",\n \"reason\": \"brief reason for this action\"\n }\n ],\n \"profileUpdates\": [\"optional profile update\"],\n \"entityUpdates\": [{\"name\": \"person-jane-doe\", \"type\": \"person\", \"facts\": [\"Now leads the backend team\", \"Recently migrated the user service to TypeScript\"]}]\n}`;\n\nexport const PROFILE_CONSOLIDATION_RESPONSE_SCHEMA = `{\n \"consolidatedProfile\": \"# Behavioral Profile\\\\n\\\\n... (complete markdown)\",\n \"removedCount\": 42,\n \"summary\": \"brief summary of what was consolidated\"\n}`;\n\n/**\n * System prompt shared by every consolidation path (gateway, direct client,\n * local LLM). Owns the causal-rule clause and the output-language policy so\n * the three paths cannot drift (issue #2190).\n */\nexport function buildConsolidationSystemPrompt(config: PluginConfig): string {\n return `You are a memory consolidation system. Compare new memories against existing ones and decide what to do with each.\n\nActions:\n- ADD: Keep the new memory as-is (no duplicate exists)\n- MERGE: Combine with an existing memory (provide mergeWith ID and updated content)\n- UPDATE: Replace existing memory content (provide updated content)\n- INVALIDATE: Remove existing memory (it's been superseded or is wrong)\n- SKIP: This new memory is redundant (exact duplicate or subset of existing)\n\nAlso:\n- Suggest profile updates based on patterns across memories\n- Identify entity updates for entity tracking${resolveRecallAuxiliaryCapabilities(config).causalRuleExtraction ? `\n- When merging or updating memories, look for IF→THEN causal patterns. If a memory describes \"X failed/succeeded because Y\" or \"doing X led to Y\", rewrite its content to make the causal rule explicit in the form \"IF <condition> THEN <action/outcome>\".` : \"\"}\n- ${OUTPUT_LANGUAGE_POLICY}`;\n}\n\n/**\n * System prompt shared by every profile-consolidation path (gateway, direct\n * client, local LLM). Owns the output-language policy (issue #2190).\n */\nexport function buildProfileConsolidationSystemPrompt(targetLines: number): string {\n return `You are a profile consolidation system. You are given a behavioral profile (markdown) that has grown too large. Your job is to produce a CONSOLIDATED version that:\n\n1. PRESERVES all ## section headers and their structure\n2. MERGES duplicate or near-duplicate bullet points into single, clear statements\n3. REMOVES stale information that has been superseded by newer bullets\n4. REMOVES trivial or overly specific operational details that won't be useful across sessions\n5. KEEPS the most important, durable observations about the user's preferences, habits, identity, and working style\n6. Target roughly ${targetLines} lines — this is a soft target, prioritize quality over length\n7. Write in the same style as the existing profile — concise bullets, no fluff\n8. ${OUTPUT_LANGUAGE_POLICY}\n\nThe output should be the COMPLETE consolidated profile as valid markdown, starting with \"# Behavioral Profile\".`;\n}\n"],"mappings":";;;;;;;;;;AAaO,IAAM,4BAA4B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAkClC,SAAS,wBAAwB,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AG,8BAA8B;AAAA,IAEjC,EACN;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASE,oBAAoB,iBAAiB,SAAS,IAC1C;AAAA;AAAA,EAEJ,iBAAiB,KAAK,IAAI,CAAC;AAAA;AAAA;AAAA,IAIvB,EACN;AAAA,EACE,2BAA2B,MAAM,CAAC,GAAG,sBAAsB,OAAO,YAAY,YAAY,KAAK,CAAC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYlG;AAEO,IAAM,gCAAgC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AActC,IAAM,wCAAwC;AAAA;AAAA;AAAA;AAAA;AAW9C,SAAS,+BAA+B,QAA8B;AAC3E,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,+CAWsC,mCAAmC,MAAM,EAAE,uBAAuB;AAAA,oQAC8I,EAAE;AAAA,IAC7P,sBAAsB;AAC1B;AAMO,SAAS,sCAAsC,aAA6B;AACjF,SAAO;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAOW,WAAW;AAAA;AAAA,KAE1B,sBAAsB;AAAA;AAAA;AAG3B;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseEntityFile
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7S53BPTU.js";
|
|
4
4
|
import {
|
|
5
5
|
inferMemoryStatus
|
|
6
6
|
} from "./chunk-7RJUVTVF.js";
|
|
@@ -253,4 +253,4 @@ export {
|
|
|
253
253
|
WHO_KNOWS_MCP_TOOLS,
|
|
254
254
|
handleWhoKnowsHttpQuery
|
|
255
255
|
};
|
|
256
|
-
//# sourceMappingURL=chunk-
|
|
256
|
+
//# sourceMappingURL=chunk-BX4EOMKT.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import {
|
|
2
2
|
buildStandup,
|
|
3
3
|
parseStandupDate
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-JA2QJOAX.js";
|
|
5
5
|
import {
|
|
6
6
|
backfillMemoryStorage,
|
|
7
7
|
runLocationBackfill,
|
|
@@ -9,26 +9,27 @@ import {
|
|
|
9
9
|
runLocationDay,
|
|
10
10
|
runLocationStatus,
|
|
11
11
|
runLocationSync
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-JNSENHV5.js";
|
|
13
13
|
import {
|
|
14
14
|
externalWikiSearchOperation
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-EY5JAWZC.js";
|
|
16
16
|
import {
|
|
17
17
|
DECISION_SUBCOMMANDS,
|
|
18
18
|
DELTA_SUBCOMMANDS,
|
|
19
19
|
defineOperation,
|
|
20
20
|
isCodegraphToolName
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-62QIQEUC.js";
|
|
22
22
|
import {
|
|
23
23
|
CorrectionContractError
|
|
24
24
|
} from "./chunk-QLK3SL7Q.js";
|
|
25
|
-
import {
|
|
26
|
-
memoryStoreRequestSchema
|
|
27
|
-
} from "./chunk-L2QLDZJC.js";
|
|
28
25
|
import {
|
|
29
26
|
serializeMutations,
|
|
30
27
|
withHeldFileLock
|
|
31
28
|
} from "./chunk-FFAZ2XFU.js";
|
|
29
|
+
import {
|
|
30
|
+
memoryStoreRequestSchema,
|
|
31
|
+
retainedCategoryAlias
|
|
32
|
+
} from "./chunk-P4ZAEYKG.js";
|
|
32
33
|
import {
|
|
33
34
|
EngramAccessInputError
|
|
34
35
|
} from "./chunk-2Z24E5W2.js";
|
|
@@ -1484,16 +1485,18 @@ var memorySearchOperation = defineOperation({
|
|
|
1484
1485
|
var memoryStoreOperation = defineOperation({
|
|
1485
1486
|
name: "memory_store",
|
|
1486
1487
|
description: "Store an explicit memory through the access layer.",
|
|
1487
|
-
//
|
|
1488
|
-
//
|
|
1489
|
-
//
|
|
1488
|
+
// The canonical wire schema (issue #2482): its category transform already
|
|
1489
|
+
// mapped compat aliases to "fact", so `input.category` is finite here. The
|
|
1490
|
+
// raw spelling survives on `ctx.rawInput` for the coercion note (#2829).
|
|
1490
1491
|
schema: memoryStoreRequestSchema,
|
|
1491
1492
|
handler: async (input, ctx) => {
|
|
1493
|
+
const rawCategory = retainedCategoryAlias(ctx.rawInput);
|
|
1492
1494
|
const result = await ctx.service.memoryStore(
|
|
1493
1495
|
{
|
|
1494
1496
|
...input,
|
|
1495
1497
|
authenticatedPrincipal: ctx.authenticatedPrincipal,
|
|
1496
|
-
...ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {}
|
|
1498
|
+
...ctx.sourceConnector ? { sourceConnector: ctx.sourceConnector } : {},
|
|
1499
|
+
...rawCategory ? { rawCategory } : {}
|
|
1497
1500
|
},
|
|
1498
1501
|
// Forward transport-level hooks (e.g. HTTP's atomic write-quota gate)
|
|
1499
1502
|
// so the hook still fires inside the service's idempotent-write lock —
|
|
@@ -1911,4 +1914,4 @@ export {
|
|
|
1911
1914
|
codegraphIngestTracesOperation,
|
|
1912
1915
|
REGISTERED_OPERATIONS
|
|
1913
1916
|
};
|
|
1914
|
-
//# sourceMappingURL=chunk-
|
|
1917
|
+
//# sourceMappingURL=chunk-BYZKLEWG.js.map
|