@remnic/core 9.65.1 → 9.65.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +44 -44
- package/dist/access-admin-ops-surface.js +36 -35
- package/dist/access-authorization-probe.d.ts +39 -40
- package/dist/access-authorization-probe.js +37 -36
- package/dist/access-boundary.d.ts +41 -185
- package/dist/access-boundary.js +36 -35
- package/dist/access-cli.js +110 -107
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +3 -1
- package/dist/access-extraction-force-flush.d.ts +25 -25
- package/dist/access-extraction-force-flush.js +36 -35
- package/dist/access-health-types.d.ts +3 -1
- package/dist/access-http-lcm-compaction.d.ts +39 -39
- package/dist/access-http-lifecycle-flush.d.ts +40 -41
- package/dist/access-http-offline-stream.d.ts +25 -25
- package/dist/access-http-query.d.ts +4 -2
- package/dist/access-http-query.js +38 -37
- package/dist/access-http.d.ts +51 -44
- package/dist/access-http.js +57 -56
- package/dist/access-identity-continuity-surface.d.ts +12 -12
- package/dist/access-identity-continuity-surface.js +36 -35
- package/dist/access-lcm-surface.d.ts +27 -27
- package/dist/access-lcm-surface.js +36 -35
- package/dist/access-mcp-admin-tools.d.ts +9 -1
- package/dist/access-mcp-admin-tools.js +3 -1
- package/dist/access-mcp-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +39 -39
- package/dist/access-mcp.js +50 -47
- package/dist/access-memory-search-fanout.d.ts +4 -2
- package/dist/{access-namespace-preflight-BKUnKsBv.d.ts → access-namespace-preflight-B7Usyz-K.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +5 -3
- package/dist/access-namespace-preflight.js +36 -35
- package/dist/access-observe-write-surface.d.ts +39 -39
- package/dist/access-observe-write-surface.js +36 -35
- package/dist/access-offline-manifest.d.ts +12 -12
- package/dist/access-offline-manifest.js +5 -5
- package/dist/access-operations-batch.js +41 -40
- package/dist/access-operations.d.ts +46 -47
- package/dist/access-operations.js +44 -43
- package/dist/access-recall-concurrency.d.ts +40 -40
- package/dist/access-recall-concurrency.js +36 -35
- package/dist/access-recall-response.d.ts +24 -24
- package/dist/access-recall-response.js +36 -35
- package/dist/access-recall-surface.d.ts +24 -24
- package/dist/access-recall-surface.js +36 -35
- package/dist/access-schema.d.ts +139 -139
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-B1Lbb-nQ.d.ts → access-service-DkaIG3n8.d.ts} +688 -140
- package/dist/access-service-helpers.d.ts +40 -40
- package/dist/access-service.d.ts +47 -47
- package/dist/access-service.js +36 -35
- package/dist/access-surface-catalog.d.ts +41 -42
- package/dist/access-surface-catalog.js +44 -37
- 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 +3 -1
- package/dist/active-memory-bridge.d.ts +3 -1
- package/dist/active-recall.d.ts +3 -1
- package/dist/active-recall.js +11 -1
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +3 -1
- package/dist/artifact-search.d.ts +3 -1
- package/dist/{auto-sync-5L7EUZ27.js → auto-sync-H64ZCNIR.js} +13 -5
- package/dist/{auto-sync-5L7EUZ27.js.map → auto-sync-H64ZCNIR.js.map} +1 -1
- package/dist/behavior-learner.d.ts +3 -1
- package/dist/behavior-signals.d.ts +3 -1
- package/dist/bootstrap.d.ts +12 -12
- package/dist/briefing-window.d.ts +4 -2
- package/dist/briefing.d.ts +4 -2
- package/dist/briefing.js +16 -15
- package/dist/buffer-surprise-report.d.ts +3 -1
- package/dist/buffer-turn-helpers.d.ts +3 -1
- package/dist/buffer.d.ts +4 -2
- package/dist/buffer.js +4 -4
- package/dist/bulk-import/index.d.ts +5 -3
- package/dist/calibration.d.ts +3 -1
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +3 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{catalog-DjVhJoRM.d.ts → catalog-CX2BZEJh.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +3 -1
- package/dist/causal-consolidation.js +20 -19
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-MIBKEW7A.js → chunk-2VXWFYJE.js} +3 -3
- package/dist/{chunk-3YTTAGPB.js → chunk-3DVBKTSO.js} +2 -2
- package/dist/{chunk-EIR5VLIH.js → chunk-4K7IW3F7.js} +2 -2
- package/dist/chunk-4K7IW3F7.js.map +1 -0
- package/dist/{chunk-JTSVMJHV.js → chunk-4XDGYCZI.js} +3 -3
- package/dist/chunk-573TEZCD.js +88 -0
- package/dist/chunk-573TEZCD.js.map +1 -0
- package/dist/{chunk-HQSBYI5X.js → chunk-57HVIG5U.js} +2 -2
- package/dist/{chunk-PMVPCZJZ.js → chunk-6433HV72.js} +2 -2
- package/dist/{chunk-N6TRHP72.js → chunk-6TAX66IA.js} +2 -2
- package/dist/{chunk-AGKIG3YA.js → chunk-6VALIZKG.js} +2 -2
- package/dist/{chunk-YQ3CBLL4.js → chunk-76PL4XLG.js} +512 -8
- package/dist/chunk-76PL4XLG.js.map +1 -0
- package/dist/{chunk-4NZHHGVL.js → chunk-7BDZTALN.js} +4 -1
- package/dist/chunk-7BDZTALN.js.map +1 -0
- package/dist/{chunk-NS5ETDYD.js → chunk-7BEPVIH3.js} +3 -3
- package/dist/{chunk-JG22O53B.js → chunk-7CBKAQIG.js} +2 -1
- package/dist/chunk-7CBKAQIG.js.map +1 -0
- package/dist/{chunk-LYIZXQYY.js → chunk-7KFIMGMP.js} +2 -2
- package/dist/{chunk-LWVO2QZV.js → chunk-7QOO4LGC.js} +56 -56
- package/dist/chunk-AAXJNINV.js +55 -0
- package/dist/chunk-AAXJNINV.js.map +1 -0
- package/dist/{chunk-56BSXSHC.js → chunk-AB3A7EFH.js} +31 -2
- package/dist/{chunk-56BSXSHC.js.map → chunk-AB3A7EFH.js.map} +1 -1
- package/dist/{chunk-CCTVAVTT.js → chunk-AUO2LJ3K.js} +2 -2
- package/dist/{chunk-ALCJRQ72.js → chunk-AYDDB3XI.js} +2 -2
- package/dist/{chunk-3TMYV3LP.js → chunk-AYYGRVRP.js} +5 -5
- package/dist/{chunk-W6TSGWYS.js → chunk-AZAA5DNP.js} +2 -2
- package/dist/{chunk-WTOE7CW4.js → chunk-BKYPJUQL.js} +122 -16
- package/dist/chunk-BKYPJUQL.js.map +1 -0
- package/dist/{chunk-6JJT5AKI.js → chunk-BQUEAVNW.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-CEH2AFXG.js → chunk-C24UZSFW.js} +6 -6
- package/dist/{chunk-ZPN7W3OP.js → chunk-CDUUDBWJ.js} +3 -3
- package/dist/{chunk-35NN3ZFA.js → chunk-CTVWELNK.js} +21 -3
- package/dist/chunk-CTVWELNK.js.map +1 -0
- package/dist/{chunk-Y23B2QXP.js → chunk-D27J626P.js} +2 -2
- package/dist/{chunk-2572MRP2.js → chunk-DHTQP334.js} +2 -2
- package/dist/{chunk-HJQZQUPC.js → chunk-DJZWNKFO.js} +5 -5
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-VJ6ECBIP.js → chunk-E4MVQQVX.js} +2 -2
- package/dist/{chunk-SYJ6EKKE.js → chunk-EIVIB73I.js} +2 -2
- package/dist/{chunk-HUNSEO5U.js → chunk-EV3YFLCB.js} +2 -2
- package/dist/{chunk-GEULB2VI.js → chunk-FC7TIRFS.js} +21 -1
- package/dist/chunk-FC7TIRFS.js.map +1 -0
- package/dist/{chunk-VPGRXEAB.js → chunk-G57LQRP6.js} +2 -2
- package/dist/{chunk-BC4QD3FM.js → chunk-GN55KU2P.js} +2 -2
- package/dist/{chunk-4W6INNXO.js → chunk-GUXS322H.js} +2 -2
- package/dist/{chunk-DBXZZIDU.js → chunk-H5FW4S5Q.js} +434 -693
- package/dist/chunk-H5FW4S5Q.js.map +1 -0
- package/dist/chunk-I32NKXE2.js +879 -0
- package/dist/chunk-I32NKXE2.js.map +1 -0
- package/dist/{chunk-3MADV4YC.js → chunk-IQSC3V2E.js} +2 -2
- package/dist/{chunk-UYCIS6V5.js → chunk-JCWY73FK.js} +2 -2
- package/dist/{chunk-T42L3S6A.js → chunk-LBWQ65SX.js} +4 -4
- package/dist/{chunk-MSTNSVXI.js → chunk-LDBFXD4F.js} +2 -1
- package/dist/chunk-LDBFXD4F.js.map +1 -0
- package/dist/{chunk-CEQF6L5K.js → chunk-LUNJ3WFO.js} +9 -7
- package/dist/chunk-LUNJ3WFO.js.map +1 -0
- package/dist/{chunk-256FBCVX.js → chunk-M4AHBM72.js} +7 -7
- package/dist/{chunk-YEQEGSJA.js → chunk-MBDJJTAT.js} +3 -3
- package/dist/{chunk-IAY7YBXS.js → chunk-MRTUN665.js} +2 -2
- package/dist/{chunk-JFJ3MHGV.js → chunk-NXKJHSDN.js} +1 -1
- package/dist/chunk-NXKJHSDN.js.map +1 -0
- package/dist/{chunk-R3AAOKR2.js → chunk-NZWEEALH.js} +2 -2
- package/dist/{chunk-I2HTKOOP.js → chunk-ODZG724P.js} +2 -2
- package/dist/{chunk-7QFBLYFP.js → chunk-OJD4WS2E.js} +3 -3
- package/dist/{chunk-CUS6S7PN.js → chunk-OLWTCWQ2.js} +9 -9
- package/dist/chunk-OLWTCWQ2.js.map +1 -0
- package/dist/{chunk-53ENM6F6.js → chunk-P4DHENRE.js} +2 -2
- package/dist/{chunk-DEFI2QBT.js → chunk-PAYGC3BD.js} +52 -22
- package/dist/chunk-PAYGC3BD.js.map +1 -0
- package/dist/{chunk-KPBLJCCV.js → chunk-PDVQ5JU3.js} +2 -2
- package/dist/{chunk-7BY7V4YX.js → chunk-Q4WONDMJ.js} +4 -3
- package/dist/{chunk-7BY7V4YX.js.map → chunk-Q4WONDMJ.js.map} +1 -1
- package/dist/{chunk-ESCQ6LY7.js → chunk-QFMO32TO.js} +3 -3
- package/dist/{chunk-HQSPXTQO.js → chunk-QXIQPCCN.js} +1 -1
- package/dist/{chunk-CFRBTATE.js → chunk-R47WINCY.js} +3 -3
- package/dist/{chunk-G72IPMR7.js → chunk-R4OCGPSH.js} +2 -2
- package/dist/{chunk-LCU5R6TQ.js → chunk-RAIUTAZZ.js} +22 -3
- package/dist/chunk-RAIUTAZZ.js.map +1 -0
- package/dist/chunk-RIAM7DND.js +167 -0
- package/dist/chunk-RIAM7DND.js.map +1 -0
- package/dist/{chunk-VZVP2W4O.js → chunk-RK4WXUI2.js} +2 -2
- package/dist/{chunk-JBPKEARU.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-6L27N6YI.js → chunk-S7Q5CM7E.js} +2 -2
- package/dist/{chunk-CTQRPANJ.js → chunk-SVSRPG6M.js} +2 -2
- package/dist/{chunk-GXWDWOWP.js → chunk-TDKSCV62.js} +2 -2
- package/dist/{chunk-S2VBSTTA.js → chunk-THG4GYIE.js} +2 -2
- package/dist/{chunk-IXRC7EQG.js → chunk-TR7DGXGI.js} +2 -2
- package/dist/{chunk-63FHSH7E.js → chunk-TYUS5TLG.js} +4 -4
- package/dist/{chunk-7PWWGYGO.js → chunk-URHCUXKI.js} +2 -2
- package/dist/{chunk-Z54TXZ2F.js → chunk-VA5KMSAE.js} +16 -7
- package/dist/chunk-VA5KMSAE.js.map +1 -0
- package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-MUJ4QFUQ.js → chunk-W4BMEGQA.js} +4 -4
- package/dist/{chunk-5HK3CJAR.js → chunk-W675UJCZ.js} +2 -2
- package/dist/{chunk-3PXVYJMC.js → chunk-WN5FSGLE.js} +2077 -215
- package/dist/chunk-WN5FSGLE.js.map +1 -0
- package/dist/{chunk-3RHFGGI5.js → chunk-YF6UHWOV.js} +30 -10
- package/dist/chunk-YF6UHWOV.js.map +1 -0
- package/dist/{chunk-X5SDZMO7.js → chunk-YHCBJULX.js} +2 -2
- package/dist/{chunk-5UYSCYR7.js → chunk-Z4RPXHJH.js} +4 -4
- package/dist/{cli-Pulnz-qm.d.ts → cli-ChKeYMZv.d.ts} +5 -5
- package/dist/cli.d.ts +25 -25
- package/dist/cli.js +81 -78
- package/dist/coding/pre-action-gate.d.ts +2 -60
- package/dist/compounding/engine.d.ts +4 -2
- package/dist/compounding/engine.js +17 -16
- package/dist/compounding/preference-consolidator.d.ts +3 -1
- package/dist/compression-optimizer.d.ts +3 -1
- package/dist/config.d.ts +3 -1
- package/dist/config.js +11 -1
- package/dist/connectors/codex-materialize-runner.d.ts +3 -1
- package/dist/connectors/codex-materialize-runner.js +16 -15
- package/dist/connectors/codex-materialize.d.ts +3 -1
- package/dist/connectors/index.d.ts +3 -1
- package/dist/connectors/index.js +16 -15
- package/dist/consolidation-provenance-check.d.ts +4 -2
- package/dist/consolidation-undo.d.ts +4 -2
- package/dist/contradiction/index.d.ts +10 -270
- package/dist/contradiction/index.js +20 -7
- package/dist/{contradiction-review-QKJH5DKD.js → contradiction-review-WRVLRWHS.js} +6 -2
- package/dist/{contradiction-scan-VOTQRRSX.js → contradiction-scan-AKUWPX5N.js} +5 -3
- package/dist/converge-config.d.ts +3 -1
- package/dist/convergence-refresh.d.ts +4 -2
- package/dist/convergence-refresh.js +18 -17
- package/dist/conversation-index/backend.d.ts +3 -1
- package/dist/conversation-index/chunker.d.ts +3 -1
- package/dist/conversation-index/faiss-adapter.d.ts +3 -1
- package/dist/conversation-index/indexer.d.ts +3 -1
- package/dist/conversation-index/search.d.ts +3 -1
- package/dist/corpus-watermark.d.ts +3 -1
- package/dist/corpus-watermark.js +18 -17
- package/dist/cross-lingual-recall.d.ts +3 -1
- package/dist/day-summary.d.ts +3 -1
- package/dist/delinearize.d.ts +3 -1
- package/dist/dependency-propagation-config.d.ts +3 -1
- package/dist/{dependency-propagation-delivery-Co17gxYb.d.ts → dependency-propagation-delivery-B8ZMBBCY.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +3 -1
- package/dist/direct-answer.d.ts +3 -1
- package/dist/embedding-fallback.d.ts +3 -1
- package/dist/enrichment/index.d.ts +3 -1
- package/dist/entity-origin-fields.d.ts +3 -1
- package/dist/entity-retrieval.d.ts +4 -2
- package/dist/entity-retrieval.js +16 -15
- package/dist/entity-schema.d.ts +3 -1
- package/dist/episodic-context.d.ts +3 -1
- package/dist/explicit-capture.d.ts +12 -12
- package/dist/explicit-capture.js +7 -6
- package/dist/external-wiki-access.d.ts +41 -42
- package/dist/external-wiki-access.js +37 -36
- package/dist/external-wiki-collection-registration.d.ts +3 -1
- package/dist/external-wiki-collection.d.ts +3 -1
- package/dist/external-wiki-mcp-tools.d.ts +40 -40
- package/dist/extraction-error-classification.d.ts +3 -1
- package/dist/extraction-faithfulness.d.ts +3 -1
- 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 +2 -2
- package/dist/extraction-liveness.d.ts +3 -1
- package/dist/extraction-normalization.d.ts +3 -1
- package/dist/extraction-normalization.js +2 -2
- package/dist/extraction-prompt.d.ts +4 -2
- package/dist/extraction-prompt.js +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +3 -1
- package/dist/extraction-source-grounding.d.ts +3 -1
- package/dist/extraction.d.ts +3 -1
- package/dist/extraction.js +22 -21
- package/dist/fallback-llm.d.ts +3 -1
- package/dist/graph-dashboard-diff.d.ts +3 -1
- package/dist/graph-dashboard-key.d.ts +3 -1
- package/dist/graph-dashboard-parser.d.ts +3 -1
- package/dist/graph-edge-reinforcement.d.ts +3 -1
- package/dist/graph-path-reconstruction.d.ts +3 -1
- package/dist/graph-path-scoring.d.ts +3 -1
- package/dist/graph-snapshot.d.ts +3 -1
- package/dist/graph.d.ts +3 -1
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +3 -1
- package/dist/importers/index.d.ts +3 -1
- package/dist/in-flight-reads.d.ts +3 -1
- package/dist/index-CexDrJzC.d.ts +284 -0
- package/dist/index.d.ts +946 -707
- package/dist/index.js +253 -151
- package/dist/intent.d.ts +3 -1
- package/dist/lcm/engine.d.ts +3 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +3 -1
- package/dist/lcm/index.js +6 -6
- package/dist/lcm/tools.d.ts +3 -1
- package/dist/lifecycle.d.ts +3 -1
- package/dist/live-connectors-runner.d.ts +3 -1
- package/dist/local-llm.d.ts +3 -1
- package/dist/local-model-endpoint.d.ts +3 -1
- package/dist/maintenance/memory-governance.d.ts +3 -1
- package/dist/maintenance/memory-governance.js +16 -15
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +4 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +16 -15
- package/dist/maintenance/rebuild-memory-projection.d.ts +4 -2
- package/dist/maintenance/rebuild-memory-projection.js +17 -16
- package/dist/{maintenance-DiSLtVN7.d.ts → maintenance-nkdtSrVr.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +37 -37
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +3 -1
- package/dist/memory-cache.d.ts +3 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +3 -1
- package/dist/memory-projection-store.d.ts +3 -1
- package/dist/memory-provenance.d.ts +3 -1
- package/dist/memory-snapshot.d.ts +3 -1
- package/dist/memory-subject-cli.d.ts +177 -0
- package/dist/memory-subject-cli.js +16 -0
- package/dist/memory-subject.d.ts +128 -0
- package/dist/memory-subject.js +44 -0
- package/dist/memory-subject.js.map +1 -0
- package/dist/memory-worth-outcomes.d.ts +7 -4
- package/dist/memory-worth-outcomes.js +1 -1
- package/dist/models-json.d.ts +3 -1
- package/dist/namespaces/migrate.d.ts +5 -3
- package/dist/namespaces/migrate.js +17 -16
- package/dist/namespaces/principal.d.ts +3 -1
- package/dist/namespaces/search.d.ts +3 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +5 -3
- package/dist/namespaces/storage.js +16 -15
- package/dist/native-knowledge.d.ts +3 -1
- package/dist/offline-sync-impression-drain.d.ts +3 -1
- package/dist/operator-doctor-corpus.d.ts +3 -1
- package/dist/operator-doctor-corpus.js +19 -18
- package/dist/operator-doctor-replica.d.ts +3 -1
- package/dist/operator-toolkit.d.ts +5 -3
- package/dist/operator-toolkit.js +29 -24
- package/dist/orchestration/compression-guideline-coordinator.d.ts +4 -2
- package/dist/orchestration/maintenance.d.ts +6 -4
- package/dist/orchestration/maintenance.js +22 -21
- package/dist/{orchestrator-DzCaxNS4.d.ts → orchestrator-Bvq1-RQs.d.ts} +23 -9
- package/dist/orchestrator.d.ts +12 -12
- package/dist/orchestrator.js +111 -108
- package/dist/patterns-cli.d.ts +3 -1
- package/dist/{pipeline-HJ8DKbFl.d.ts → pipeline-C8vfIiTX.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +3 -1
- package/dist/proactive-contention.d.ts +3 -1
- package/dist/provenance.d.ts +3 -1
- package/dist/{public-http-DwXauTX3.d.ts → public-http-Cy0aYbys.d.ts} +1 -1
- package/dist/{qmd-BzxluoLt.d.ts → qmd-B9p1SZTZ.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +4 -2
- package/dist/qmd-recall-cache.d.ts +3 -1
- package/dist/qmd.d.ts +4 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-concurrency-config.d.ts +3 -1
- package/dist/recall-disclosure-escalation.d.ts +3 -1
- package/dist/recall-explain-renderer.d.ts +3 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +3 -1
- package/dist/recall-planner-llm.d.ts +3 -1
- package/dist/recall-state.d.ts +3 -1
- package/dist/recall-tag-filter.d.ts +3 -1
- package/dist/recall-timings.d.ts +3 -1
- package/dist/recall-xray-cli.d.ts +3 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +3 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +3 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +3 -1
- package/dist/reconcile/manifest.d.ts +3 -1
- package/dist/reconcile/manifest.js +3 -3
- package/dist/reconcile/plan.d.ts +3 -1
- package/dist/replay/normalizers/chatgpt.d.ts +3 -1
- package/dist/replay/normalizers/claude.d.ts +3 -1
- package/dist/replay/normalizers/openclaw.d.ts +3 -1
- package/dist/replay/normalizers/shared.d.ts +3 -1
- package/dist/replay/runner.d.ts +3 -1
- package/dist/replay/types.d.ts +3 -1
- package/dist/replica-divergence.d.ts +3 -1
- package/dist/replica-peers-config.d.ts +3 -1
- package/dist/resolution-4552BNRV.js +36 -0
- package/dist/resolution-4552BNRV.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +3 -1
- package/dist/resume-bundles.js +9 -2
- package/dist/retrieval-agents.d.ts +4 -2
- package/dist/retrieval-tiers.d.ts +3 -1
- package/dist/routing/engine.d.ts +3 -1
- package/dist/routing/store.d.ts +3 -1
- package/dist/salvage-envelope.d.ts +3 -1
- package/dist/salvage-envelope.js +10 -2
- package/dist/schemas.d.ts +130 -116
- package/dist/schemas.js +1 -1
- package/dist/{scope-profiles-CEMZz0t5.d.ts → scope-profiles-DLrRxFWR.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +3 -1
- package/dist/search/factory.d.ts +3 -1
- package/dist/search/factory.js +5 -5
- package/dist/search/index.d.ts +3 -1
- package/dist/search/index.js +9 -9
- package/dist/search/lancedb-backend.d.ts +3 -1
- package/dist/search/meilisearch-backend.d.ts +3 -1
- package/dist/search/noop-backend.d.ts +3 -1
- package/dist/search/orama-backend.d.ts +3 -1
- package/dist/search/port.d.ts +3 -1
- package/dist/search/remote-backend.d.ts +3 -1
- package/dist/{semantic-TddhF0y7.d.ts → semantic-BalR6EXU.d.ts} +1 -1
- package/dist/{semantic-consolidation-D9dYj6vu.d.ts → semantic-consolidation-DlN6xe20.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +4 -2
- package/dist/semantic-consolidation.js +17 -16
- package/dist/semantic-rule-promotion.js +16 -15
- package/dist/semantic-rule-verifier.d.ts +3 -1
- package/dist/semantic-rule-verifier.js +16 -15
- package/dist/{service-_qgST_0y.d.ts → service-GkYyVfm9.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +3 -1
- package/dist/session-observer-state.d.ts +3 -1
- package/dist/shared-context/manager.d.ts +13 -11
- package/dist/signal.d.ts +3 -1
- package/dist/source-agent-qualifier.d.ts +3 -1
- package/dist/source-agent-qualifier.js +18 -17
- package/dist/{storage-B9lbNTYE.d.ts → storage-BIDzuKIn.d.ts} +3 -2
- package/dist/storage.d.ts +4 -2
- package/dist/storage.js +18 -17
- package/dist/subject-config.d.ts +40 -0
- package/dist/subject-config.js +20 -0
- package/dist/subject-config.js.map +1 -0
- package/dist/summarizer.d.ts +3 -1
- package/dist/summary-snapshot.d.ts +3 -1
- package/dist/support-passport/index.d.ts +43 -43
- package/dist/support-passport/index.js +39 -38
- package/dist/temporal-supersession.d.ts +4 -2
- package/dist/temporal-timeline-recall.d.ts +3 -1
- package/dist/temporal-validity.d.ts +3 -1
- package/dist/threading.d.ts +3 -1
- package/dist/tier-migration.d.ts +4 -2
- package/dist/tier-routing.d.ts +3 -1
- package/dist/topics.d.ts +3 -1
- package/dist/transcript.d.ts +3 -1
- package/dist/transfer/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/types.d.ts +86 -86
- package/dist/trust-score-stage.d.ts +3 -1
- package/dist/trust-score.d.ts +3 -1
- package/dist/{types-BrEzuxPA.d.ts → types-BxAcOl5Q.d.ts} +360 -32
- package/dist/types.d.ts +3 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +3 -1
- package/dist/verified-recall.js +16 -15
- package/dist/who-knows-cli.d.ts +40 -40
- package/dist/who-knows-cli.js +17 -16
- package/dist/who-knows.d.ts +42 -42
- package/dist/who-knows.js +16 -15
- package/dist/write-envelope.d.ts +7 -2
- package/dist/write-envelope.js +10 -1
- package/package.json +2 -2
- package/scripts/build-with-heap.mjs +1 -1
- package/src/access-boundary.ts +6 -0
- package/src/access-http.ts +6 -5
- package/src/access-mcp-admin-tools.ts +38 -0
- package/src/access-mcp-output-schemas.ts +20 -0
- package/src/access-mcp.ts +8 -8
- package/src/access-operations-batch.ts +13 -0
- package/src/access-service.ts +112 -0
- package/src/access-surface-catalog.test.ts +24 -0
- package/src/access-surface-catalog.ts +6 -0
- package/src/coding/action-gate.test.ts +341 -0
- package/src/coding/action-gate.ts +556 -0
- package/src/config.ts +15 -17
- package/src/contradiction/contradiction-review.ts +50 -4
- package/src/contradiction/contradiction-scan.ts +14 -3
- package/src/contradiction/resolution.ts +50 -2
- package/src/extraction-prompt.ts +1 -0
- package/src/extraction.ts +4 -1
- package/src/index.ts +9 -9
- package/src/mcp-read-only-tools.ts +1 -0
- package/src/memory-subject-cli.ts +135 -0
- package/src/memory-subject.test.ts +48 -0
- package/src/memory-subject.ts +314 -0
- package/src/memory-worth-outcomes.test.ts +6 -2
- package/src/memory-worth-outcomes.ts +11 -7
- package/src/operator-toolkit.ts +1 -1
- package/src/orchestration/extraction-persist.ts +48 -48
- package/src/orchestration/recall-internal.ts +6 -5
- package/src/orchestration/recall-rerank-coordinator.ts +123 -4
- package/src/orchestration/recall-result-formatter.ts +6 -2
- package/src/orchestration/recall-search-pipeline.ts +14 -1
- package/src/preferences/drift-config.ts +118 -0
- package/src/preferences/drift-recall.ts +133 -0
- package/src/preferences/drift-types.ts +87 -0
- package/src/preferences/index.ts +12 -0
- package/src/preferences/preference-drift.test.ts +690 -0
- package/src/preferences/preference-drift.ts +724 -0
- package/src/procedural/library-maintenance.test.ts +582 -0
- package/src/procedural/library-maintenance.ts +546 -0
- package/src/procedural/maintenance-config.ts +78 -0
- package/src/procedural/procedure-recall.ts +29 -1
- package/src/procedural/procedure-stats.ts +20 -0
- package/src/review/review-deck-access.test.ts +325 -0
- package/src/review/review-deck-http-base.ts +133 -0
- package/src/review/review-deck-mutation.test.ts +417 -0
- package/src/review/review-deck-mutation.ts +677 -0
- package/src/review/review-deck-snapshot.ts +196 -0
- package/src/review/review-deck-surface.ts +117 -0
- package/src/review/review-deck.test.ts +347 -0
- package/src/review/review-deck.ts +311 -0
- package/src/schemas.ts +7 -0
- package/src/spaces/index.ts +38 -2
- package/src/storage.ts +10 -8
- package/src/subject-config.ts +80 -0
- package/src/types.ts +33 -32
- package/src/write-envelope.test.ts +14 -0
- package/src/write-envelope.ts +24 -3
- package/dist/chunk-35NN3ZFA.js.map +0 -1
- package/dist/chunk-3PXVYJMC.js.map +0 -1
- package/dist/chunk-3RHFGGI5.js.map +0 -1
- package/dist/chunk-4NZHHGVL.js.map +0 -1
- package/dist/chunk-CEQF6L5K.js.map +0 -1
- package/dist/chunk-CUS6S7PN.js.map +0 -1
- package/dist/chunk-DBXZZIDU.js.map +0 -1
- package/dist/chunk-DEFI2QBT.js.map +0 -1
- package/dist/chunk-EIR5VLIH.js.map +0 -1
- package/dist/chunk-GEULB2VI.js.map +0 -1
- package/dist/chunk-JFJ3MHGV.js.map +0 -1
- package/dist/chunk-JG22O53B.js.map +0 -1
- package/dist/chunk-LCU5R6TQ.js.map +0 -1
- package/dist/chunk-MDVBCPOS.js +0 -402
- package/dist/chunk-MDVBCPOS.js.map +0 -1
- package/dist/chunk-MSTNSVXI.js.map +0 -1
- package/dist/chunk-WTOE7CW4.js.map +0 -1
- package/dist/chunk-YQ3CBLL4.js.map +0 -1
- package/dist/chunk-Z54TXZ2F.js.map +0 -1
- package/dist/resolution-DKMBPXHI.js +0 -18
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-MIBKEW7A.js.map → chunk-2VXWFYJE.js.map} +0 -0
- /package/dist/{chunk-3YTTAGPB.js.map → chunk-3DVBKTSO.js.map} +0 -0
- /package/dist/{chunk-JTSVMJHV.js.map → chunk-4XDGYCZI.js.map} +0 -0
- /package/dist/{chunk-HQSBYI5X.js.map → chunk-57HVIG5U.js.map} +0 -0
- /package/dist/{chunk-PMVPCZJZ.js.map → chunk-6433HV72.js.map} +0 -0
- /package/dist/{chunk-N6TRHP72.js.map → chunk-6TAX66IA.js.map} +0 -0
- /package/dist/{chunk-AGKIG3YA.js.map → chunk-6VALIZKG.js.map} +0 -0
- /package/dist/{chunk-NS5ETDYD.js.map → chunk-7BEPVIH3.js.map} +0 -0
- /package/dist/{chunk-LYIZXQYY.js.map → chunk-7KFIMGMP.js.map} +0 -0
- /package/dist/{chunk-LWVO2QZV.js.map → chunk-7QOO4LGC.js.map} +0 -0
- /package/dist/{chunk-CCTVAVTT.js.map → chunk-AUO2LJ3K.js.map} +0 -0
- /package/dist/{chunk-ALCJRQ72.js.map → chunk-AYDDB3XI.js.map} +0 -0
- /package/dist/{chunk-3TMYV3LP.js.map → chunk-AYYGRVRP.js.map} +0 -0
- /package/dist/{chunk-W6TSGWYS.js.map → chunk-AZAA5DNP.js.map} +0 -0
- /package/dist/{chunk-6JJT5AKI.js.map → chunk-BQUEAVNW.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-CEH2AFXG.js.map → chunk-C24UZSFW.js.map} +0 -0
- /package/dist/{chunk-ZPN7W3OP.js.map → chunk-CDUUDBWJ.js.map} +0 -0
- /package/dist/{chunk-Y23B2QXP.js.map → chunk-D27J626P.js.map} +0 -0
- /package/dist/{chunk-2572MRP2.js.map → chunk-DHTQP334.js.map} +0 -0
- /package/dist/{chunk-HJQZQUPC.js.map → chunk-DJZWNKFO.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-VJ6ECBIP.js.map → chunk-E4MVQQVX.js.map} +0 -0
- /package/dist/{chunk-SYJ6EKKE.js.map → chunk-EIVIB73I.js.map} +0 -0
- /package/dist/{chunk-HUNSEO5U.js.map → chunk-EV3YFLCB.js.map} +0 -0
- /package/dist/{chunk-VPGRXEAB.js.map → chunk-G57LQRP6.js.map} +0 -0
- /package/dist/{chunk-BC4QD3FM.js.map → chunk-GN55KU2P.js.map} +0 -0
- /package/dist/{chunk-4W6INNXO.js.map → chunk-GUXS322H.js.map} +0 -0
- /package/dist/{chunk-3MADV4YC.js.map → chunk-IQSC3V2E.js.map} +0 -0
- /package/dist/{chunk-UYCIS6V5.js.map → chunk-JCWY73FK.js.map} +0 -0
- /package/dist/{chunk-T42L3S6A.js.map → chunk-LBWQ65SX.js.map} +0 -0
- /package/dist/{chunk-256FBCVX.js.map → chunk-M4AHBM72.js.map} +0 -0
- /package/dist/{chunk-YEQEGSJA.js.map → chunk-MBDJJTAT.js.map} +0 -0
- /package/dist/{chunk-IAY7YBXS.js.map → chunk-MRTUN665.js.map} +0 -0
- /package/dist/{chunk-R3AAOKR2.js.map → chunk-NZWEEALH.js.map} +0 -0
- /package/dist/{chunk-I2HTKOOP.js.map → chunk-ODZG724P.js.map} +0 -0
- /package/dist/{chunk-7QFBLYFP.js.map → chunk-OJD4WS2E.js.map} +0 -0
- /package/dist/{chunk-53ENM6F6.js.map → chunk-P4DHENRE.js.map} +0 -0
- /package/dist/{chunk-KPBLJCCV.js.map → chunk-PDVQ5JU3.js.map} +0 -0
- /package/dist/{chunk-ESCQ6LY7.js.map → chunk-QFMO32TO.js.map} +0 -0
- /package/dist/{chunk-HQSPXTQO.js.map → chunk-QXIQPCCN.js.map} +0 -0
- /package/dist/{chunk-CFRBTATE.js.map → chunk-R47WINCY.js.map} +0 -0
- /package/dist/{chunk-G72IPMR7.js.map → chunk-R4OCGPSH.js.map} +0 -0
- /package/dist/{chunk-VZVP2W4O.js.map → chunk-RK4WXUI2.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-6L27N6YI.js.map → chunk-S7Q5CM7E.js.map} +0 -0
- /package/dist/{chunk-CTQRPANJ.js.map → chunk-SVSRPG6M.js.map} +0 -0
- /package/dist/{chunk-GXWDWOWP.js.map → chunk-TDKSCV62.js.map} +0 -0
- /package/dist/{chunk-S2VBSTTA.js.map → chunk-THG4GYIE.js.map} +0 -0
- /package/dist/{chunk-IXRC7EQG.js.map → chunk-TR7DGXGI.js.map} +0 -0
- /package/dist/{chunk-63FHSH7E.js.map → chunk-TYUS5TLG.js.map} +0 -0
- /package/dist/{chunk-7PWWGYGO.js.map → chunk-URHCUXKI.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-MUJ4QFUQ.js.map → chunk-W4BMEGQA.js.map} +0 -0
- /package/dist/{chunk-5HK3CJAR.js.map → chunk-W675UJCZ.js.map} +0 -0
- /package/dist/{chunk-X5SDZMO7.js.map → chunk-YHCBJULX.js.map} +0 -0
- /package/dist/{chunk-5UYSCYR7.js.map → chunk-Z4RPXHJH.js.map} +0 -0
- /package/dist/{contradiction-review-QKJH5DKD.js.map → contradiction-review-WRVLRWHS.js.map} +0 -0
- /package/dist/{contradiction-scan-VOTQRRSX.js.map → contradiction-scan-AKUWPX5N.js.map} +0 -0
- /package/dist/{resolution-DKMBPXHI.js.map → memory-subject-cli.js.map} +0 -0
|
@@ -69,6 +69,9 @@ var ExtractedFactSchema = z.object({
|
|
|
69
69
|
scope: z.enum(["project", "global"]).optional().nullable().describe(
|
|
70
70
|
'Scope classification: "global" for cross-project knowledge (framework bugs, library behavior, API patterns, user preferences, general coding patterns); "project" for project-specific knowledge (file paths, env configs, deployment details, project workarounds) and for tool, command, or CLI-flag instructions tied to one agent, since the same tool name can mean different things across agents. When keeping such an agent-tied instruction, begin the fact with a leading "In <agent>," clause naming that agent. Defaults to "project" when a coding context is active.'
|
|
71
71
|
),
|
|
72
|
+
subject: z.enum(["user", "agent"]).optional().nullable().describe(
|
|
73
|
+
'Memory subject: "user" when the fact models the person (preferences, relationships, biography, moments, commitments about their life); "agent" when it is reusable operating knowledge (procedures, principles, tool-usage lessons, debugging strategies, environment facts with no personal content). Emit only for fact/decision-like facts; the category defaults cover preference, relationship, moment, commitment, procedure, principle, and skill.'
|
|
74
|
+
),
|
|
72
75
|
quote: z.string().optional().nullable().describe(
|
|
73
76
|
"The EXACT verbatim words from the conversation that support this fact. Copy a contiguous span from a single speaker turn (not a paraphrase). Cap at ~300 characters. This is the grounding evidence for downstream faithfulness verification (issue #1575)."
|
|
74
77
|
),
|
|
@@ -301,4 +304,4 @@ export {
|
|
|
301
304
|
BehaviorLoopAdjustmentSchema,
|
|
302
305
|
BehaviorLoopPolicyStateSchema
|
|
303
306
|
};
|
|
304
|
-
//# sourceMappingURL=chunk-
|
|
307
|
+
//# sourceMappingURL=chunk-7BDZTALN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/schemas.ts"],"sourcesContent":["import { z } from \"zod\";\n\nexport const MemoryActionTypeSchema = z.enum([\n \"store_episode\",\n \"store_note\",\n \"update_note\",\n \"create_artifact\",\n \"summarize_node\",\n \"discard\",\n \"link_graph\",\n]);\n\nexport const MemoryActionEligibilityContextSchema = z\n .object({\n confidence: z.number().min(0).max(1),\n lifecycleState: z.enum([\"active\", \"validated\", \"candidate\", \"stale\", \"archived\"]),\n importance: z.number().min(0).max(1),\n source: z.enum([\"extraction\", \"consolidation\", \"replay\", \"manual\", \"unknown\"]),\n })\n .strict();\n\nexport function parseMemoryActionType(value: unknown): z.infer<typeof MemoryActionTypeSchema> {\n const parsed = MemoryActionTypeSchema.safeParse(value);\n return parsed.success ? parsed.data : \"discard\";\n}\n\nexport function parseMemoryActionEligibilityContext(\n value: unknown,\n): z.infer<typeof MemoryActionEligibilityContextSchema> {\n const parsed = MemoryActionEligibilityContextSchema.safeParse(value);\n if (parsed.success) return parsed.data;\n return {\n confidence: 0,\n lifecycleState: \"candidate\",\n importance: 0,\n source: \"unknown\",\n };\n}\n\nexport const ProcedureStepExtractSchema = z.object({\n order: z.number(),\n intent: z.string(),\n toolCall: z\n .object({\n kind: z.string(),\n signature: z.string(),\n })\n .optional()\n .nullable(),\n expectedOutcome: z.string().optional().nullable(),\n optional: z.boolean().optional().nullable(),\n});\n\nexport const ExtractedFactSchema = z.object({\n category: z.enum([\n \"fact\",\n \"preference\",\n \"correction\",\n \"entity\",\n \"decision\",\n \"relationship\",\n \"principle\",\n \"commitment\",\n \"moment\",\n \"skill\",\n \"rule\",\n \"procedure\",\n \"reasoning_trace\",\n ]),\n content: z\n .string()\n .describe(\"The memory content — a clear, standalone statement\"),\n confidence: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How confident are you this is correct (0-1)\"),\n tags: z.array(z.string()).describe(\"Relevant tags for categorization\"),\n entityRef: z\n .string()\n .optional()\n .nullable()\n .describe(\"If about an entity, its normalized name (e.g. person-jane-doe)\"),\n cueAnchors: z\n .array(\n z.object({\n type: z.enum([\"entity\", \"file\", \"tool\", \"outcome\", \"constraint\", \"date\"]),\n value: z.string(),\n }),\n )\n .optional()\n .nullable()\n .describe(\"Up to three short retrieval cues for this fact.\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this fact.\"),\n scope: z\n .enum([\"project\", \"global\"])\n .optional()\n .nullable()\n .describe(\n 'Scope classification: \"global\" for cross-project knowledge (framework bugs, library behavior, API patterns, user preferences, general coding patterns); \"project\" for project-specific knowledge (file paths, env configs, deployment details, project workarounds) and for tool, command, or CLI-flag instructions tied to one agent, since the same tool name can mean different things across agents. When keeping such an agent-tied instruction, begin the fact with a leading \"In <agent>,\" clause naming that agent. Defaults to \"project\" when a coding context is active.',\n ),\n subject: z\n .enum([\"user\", \"agent\"])\n .optional()\n .nullable()\n .describe(\n 'Memory subject: \"user\" when the fact models the person (preferences, relationships, biography, moments, commitments about their life); \"agent\" when it is reusable operating knowledge (procedures, principles, tool-usage lessons, debugging strategies, environment facts with no personal content). Emit only for fact/decision-like facts; the category defaults cover preference, relationship, moment, commitment, procedure, principle, and skill.',\n ),\n quote: z\n .string()\n .optional()\n .nullable()\n .describe(\n \"The EXACT verbatim words from the conversation that support this fact. Copy a contiguous span from a single speaker turn (not a paraphrase). Cap at ~300 characters. This is the grounding evidence for downstream faithfulness verification (issue #1575).\",\n ),\n structuredAttributes: z\n .record(z.string(), z.string())\n .optional()\n .nullable()\n .describe(\"Structured key-value attributes when the fact contains measurable or categorical data (e.g., {\\\"price\\\": \\\"29.99\\\", \\\"color\\\": \\\"blue\\\", \\\"date\\\": \\\"2024-03-15\\\"}).\"),\n procedureSteps: z\n .array(ProcedureStepExtractSchema)\n .optional()\n .nullable()\n .describe(\n 'For category \"procedure\" only: ordered steps (intent per step). At least two steps; include explicit trigger phrasing in content (e.g. \"When you deploy…\").',\n ),\n reasoningTrace: z\n .object({\n steps: z\n .array(\n z.object({\n order: z.number(),\n description: z.string(),\n }),\n )\n // Prompts and normalizer require >=2 ordered steps; enforce it at\n // the schema layer so gateway-path parsing rejects malformed traces\n // rather than persisting them (local/direct-client normalization\n // already enforces this, keeping the two paths symmetric).\n .min(2)\n .describe(\"Ordered reasoning steps the user walked through (require >=2).\"),\n // Accept snake_case aliases so a loose gateway model using\n // `final_answer` / `observed_outcome` does not fail schema parsing\n // and drop the entire extraction result. Local/direct-client\n // normalization already tolerates these keys; the gateway path must\n // too. Zod's `union` keeps the parse successful either way.\n finalAnswer: z\n .string()\n .optional()\n .nullable()\n .describe(\"The conclusion, decision, or answer the chain arrived at.\"),\n final_answer: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for finalAnswer (snake_case). Gateway-tolerance shim.\"),\n observedOutcome: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional note about how the answer actually played out.\"),\n observed_outcome: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for observedOutcome (snake_case). Gateway-tolerance shim.\"),\n })\n // Either finalAnswer OR final_answer must be present — enforce here so\n // the rest of the pipeline can assume a usable string downstream.\n .refine(\n (v) =>\n (typeof v.finalAnswer === \"string\" && v.finalAnswer.trim().length > 0) ||\n (typeof v.final_answer === \"string\" && v.final_answer.trim().length > 0),\n { message: \"reasoningTrace requires finalAnswer (or final_answer)\" },\n )\n .optional()\n .nullable()\n .describe(\n 'For category \"reasoning_trace\" only: a stored solution chain with ordered steps, a final answer, and an optional observed outcome. Require at least two steps.',\n ),\n eventTime: z\n .string()\n .optional()\n .nullable()\n .describe(\n 'Optional event-time expression for bi-temporal validity (#1578). An ISO date (\"2025-03-01\") or a relative expression verbatim (\"last March\", \"yesterday\", \"since 2024\", \"until 2025-06-01\"). Resolved against the source turn timestamp at write time — NOT wall-clock. Omit when the fact has no explicit temporal anchor.',\n ),\n event_time: z\n .string()\n .optional()\n .nullable()\n .describe(\"Alias for eventTime (snake_case). Gateway-tolerance shim (#1578).\"),\n}).superRefine((value, ctx) => {\n if (value.category === \"procedure\" && (!Array.isArray(value.procedureSteps) || value.procedureSteps.length < 2)) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"procedureSteps\"],\n message: \"procedure facts require at least two procedureSteps\",\n });\n }\n\n if (value.category === \"reasoning_trace\" && value.reasoningTrace == null) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n path: [\"reasoningTrace\"],\n message: \"reasoning_trace facts require reasoningTrace\",\n });\n }\n});\n\nexport const EntityMentionSchema = z.object({\n name: z\n .string()\n .describe(\"Normalized entity name (e.g. jane-doe, acme-corp, my-project)\"),\n type: z.enum([\"person\", \"project\", \"tool\", \"company\", \"place\", \"other\"]),\n facts: z\n .array(z.string())\n .describe(\"New facts learned about this entity in this conversation\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this entity.\"),\n structuredSections: z\n .array(z.object({\n key: z.string(),\n title: z.string(),\n facts: z.array(z.string()),\n }))\n .optional()\n .nullable()\n .describe(\"Optional named sections for entity-specific facts. Use when facts clearly belong under a durable heading such as Beliefs or Building / Working On.\"),\n});\n\nexport const ExtractedQuestionSchema = z.object({\n question: z.string().describe(\"A genuine question the AI is curious about based on this conversation\"),\n context: z.string().describe(\"Why this question matters or what prompted it\"),\n priority: z.number().min(0).max(1).describe(\"How important/urgent this question is (0-1)\"),\n});\n\nexport const ProactiveQuestionsResultSchema = z.object({\n questions: z\n .array(ExtractedQuestionSchema)\n .describe(\"Additional follow-up questions discovered in a proactive second-pass extraction.\"),\n});\n\nexport const ExtractedRelationshipSchema = z.object({\n source: z.string().describe(\"Source entity name (normalized, e.g. person-jane-doe)\"),\n target: z.string().describe(\"Target entity name (normalized, e.g. company-acme-corp)\"),\n label: z.string().describe(\"Relationship label (e.g. 'works at', 'created', 'manages')\"),\n promptedByQuestion: z\n .string()\n .optional()\n .nullable()\n .describe(\"Optional proactive follow-up question that surfaced this relationship.\"),\n});\n\nexport const ProactiveExtractionResultSchema = z.object({\n facts: z\n .array(ExtractedFactSchema)\n .describe(\n \"Additional high-confidence memories recovered only after answering proactive follow-up questions from the same buffered conversation.\",\n ),\n profileUpdates: z\n .array(z.string())\n .describe(\n \"Additional profile updates directly supported by the buffered conversation. Omit anything speculative.\",\n ),\n entities: z\n .array(EntityMentionSchema)\n .describe(\n \"Additional entities or entity facts surfaced by the proactive follow-up pass.\",\n ),\n relationships: z\n .array(ExtractedRelationshipSchema)\n .optional()\n .nullable()\n .describe(\n \"Additional relationships surfaced by the proactive follow-up pass.\",\n ),\n});\n\n/**\n * Salvage array for model-produced extraction output (issue #2455).\n *\n * Mixed valid+invalid items parse to the valid subset so one malformed\n * element no longer discards the whole extraction. A non-empty array with\n * zero valid items still fails, so bounded retry stays effective and wholly\n * malformed output is never silently accepted as empty. Empty arrays stay\n * valid. Consolidation schemas intentionally stay strict — do not use this\n * for them.\n */\nfunction salvageArray<T extends z.ZodTypeAny>(itemSchema: T) {\n return z\n .array(z.unknown())\n .transform((items, ctx) => {\n const valid: z.infer<T>[] = [];\n for (const raw of items) {\n const parsed = itemSchema.safeParse(raw);\n if (parsed.success) {\n valid.push(parsed.data);\n }\n }\n if (items.length > 0 && valid.length === 0) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"array contains no items matching the schema\",\n });\n return z.NEVER;\n }\n return valid;\n });\n}\n\nexport const ExtractionResultSchema = z.object({\n facts: salvageArray(ExtractedFactSchema).describe(\n \"Extracted memories from the conversation. Include facts, preferences, corrections, and decisions. Only extract genuinely new, durable information — skip transient task state.\",\n ),\n profileUpdates: salvageArray(z.string()).describe(\n \"Updates to the user's behavioral profile. Each string is a standalone statement about the user's preferences, habits, or personality. Only include genuinely new insights.\",\n ),\n entities: salvageArray(EntityMentionSchema).describe(\n \"Entities mentioned in the conversation with new facts about them.\",\n ),\n questions: salvageArray(ExtractedQuestionSchema).describe(\n \"Zero to three source-grounded questions useful in future sessions. Return an empty array when the conversation supports none.\",\n ),\n identityReflection: z\n .string()\n .optional()\n .nullable()\n .describe(\n \"A brief reflection on what you learned about yourself as an agent in this interaction — patterns in your behavior, growth, things you did well or could improve.\",\n ),\n episodeTitle: z\n .string()\n .optional()\n .nullable()\n .describe(\"A six-to-eight word title for this conversation segment.\"),\n relationships: salvageArray(ExtractedRelationshipSchema)\n .optional()\n .nullable()\n .describe(\n \"Relationships between entities discovered in this conversation. Max 5 per extraction. Format: {source, target, label}.\",\n ),\n});\n\nexport const ConsolidationItemSchema = z.object({\n existingId: z\n .string()\n .describe(\"The ID of the existing memory being evaluated\"),\n action: z.enum([\"ADD\", \"MERGE\", \"UPDATE\", \"INVALIDATE\", \"SKIP\"]),\n mergeWith: z\n .string()\n .optional()\n .nullable()\n .describe(\"If MERGE, the ID of the memory to merge with\"),\n updatedContent: z\n .string()\n .optional()\n .nullable()\n .describe(\"If UPDATE or MERGE, the new content\"),\n reason: z.string().describe(\"Brief reason for this decision\"),\n});\n\nexport const ConsolidationResultSchema = z.object({\n items: z\n .array(ConsolidationItemSchema)\n .describe(\n \"Decisions for each existing memory: ADD (keep as-is), MERGE (combine with another), UPDATE (revise content), INVALIDATE (mark as outdated/wrong), SKIP (no action needed)\",\n ),\n profileUpdates: z\n .array(z.string())\n .describe(\"New profile statements to add or update\"),\n entityUpdates: z\n .array(EntityMentionSchema)\n .describe(\"Entity updates from consolidation analysis\"),\n});\n\nexport function buildProfileConsolidationResultSchema(targetLines: number) {\n return z.object({\n consolidatedProfile: z\n .string()\n .describe(\n `The full consolidated profile as markdown. Preserve all ## section headers. Merge duplicate or near-duplicate bullets into single clear statements. Remove stale or superseded information. Keep the most important and durable observations. Target roughly ${targetLines} lines.`,\n ),\n removedCount: z\n .number()\n .describe(\"Number of bullets removed or merged during consolidation\"),\n summary: z\n .string()\n .describe(\"Brief summary of what was consolidated\"),\n });\n}\n\nexport const ProfileConsolidationResultSchema = buildProfileConsolidationResultSchema(50);\n\nexport const IdentityConsolidationResultSchema = z.object({\n learnedPatterns: z\n .array(z.string())\n .describe(\n \"Consolidated behavioral patterns and lessons learned, each a concise standalone statement\",\n ),\n summary: z\n .string()\n .describe(\n \"A brief paragraph summarizing the agent's core identity insights\",\n ),\n});\n\nexport type IdentityConsolidationResultParsed = z.infer<\n typeof IdentityConsolidationResultSchema\n>;\n\n// Contradiction Verification (Phase 2B)\nexport const ContradictionVerificationSchema = z.object({\n isContradiction: z\n .boolean()\n .describe(\"Whether the two memories truly contradict each other\"),\n confidence: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How confident are you in this assessment (0-1)\"),\n reasoning: z\n .string()\n .describe(\"Explanation of why these are or are not contradictory\"),\n whichIsNewer: z\n .enum([\"first\", \"second\", \"unclear\"])\n .describe(\"Which memory represents the more recent/current state\"),\n});\n\nexport type ContradictionVerificationResult = z.infer<\n typeof ContradictionVerificationSchema\n>;\n\n// Memory Linking (Phase 3A)\nexport const MemoryLinkSchema = z.object({\n targetId: z\n .string()\n .describe(\"The ID of the memory this links to\"),\n linkType: z\n .enum([\"follows\", \"references\", \"contradicts\", \"supports\", \"related\"])\n .describe(\"The type of relationship\"),\n strength: z\n .number()\n .min(0)\n .max(1)\n .describe(\"How strong is this relationship (0-1)\"),\n reason: z\n .string()\n .optional()\n .nullable()\n .describe(\"Why this link exists\"),\n});\n\nexport const SuggestedLinksSchema = z.object({\n links: z\n .array(MemoryLinkSchema)\n .describe(\"Suggested links between memories based on semantic analysis\"),\n});\n\nexport type MemoryLink = z.infer<typeof MemoryLinkSchema>;\nexport type SuggestedLinks = z.infer<typeof SuggestedLinksSchema>;\n\n// Memory Summarization (Phase 4A)\nexport const MemorySummarySchema = z.object({\n summaryText: z\n .string()\n .describe(\"A concise summary of the batch of memories\"),\n keyFacts: z\n .array(z.string())\n .describe(\"The most important facts extracted from these memories\"),\n keyEntities: z\n .array(z.string())\n .describe(\"Key entities mentioned across these memories\"),\n});\n\nexport type MemorySummaryResult = z.infer<typeof MemorySummarySchema>;\n\nexport const DaySummaryResultSchema = z.object({\n summary: z.string().min(1).describe(\"A concise end-of-day summary paragraph.\"),\n bullets: z.array(z.string()).default([]).describe(\"The most important moments from the day.\"),\n next_actions: z.array(z.string()).default([]).describe(\"Concrete next actions for tomorrow.\"),\n risks_or_open_loops: z.array(z.string()).default([]).describe(\"Open loops, blockers, or fragile assumptions still needing attention.\"),\n});\n\n// v8.15 behavior-loop auto-tuning state contracts\nexport const BehaviorLoopAdjustmentSchema = z.object({\n parameter: z.string().min(1),\n previousValue: z.number(),\n nextValue: z.number(),\n delta: z.number(),\n evidenceCount: z.number().int().min(0),\n confidence: z.number().min(0).max(1),\n reason: z.string(),\n appliedAt: z.string(),\n});\n\nexport const BehaviorLoopPolicyStateSchema = z.object({\n version: z.number().int().min(0),\n windowDays: z.number().int().min(0),\n minSignalCount: z.number().int().min(0),\n maxDeltaPerCycle: z.number().min(0).max(1),\n protectedParams: z.array(z.string()),\n adjustments: z.array(BehaviorLoopAdjustmentSchema),\n updatedAt: z.string(),\n});\n\nexport type BehaviorLoopAdjustmentParsed = z.infer<typeof BehaviorLoopAdjustmentSchema>;\nexport type BehaviorLoopPolicyStateParsed = z.infer<typeof BehaviorLoopPolicyStateSchema>;\n\nexport type MemoryActionTypeParsed = z.infer<typeof MemoryActionTypeSchema>;\nexport type MemoryActionEligibilityContextParsed = z.infer<typeof MemoryActionEligibilityContextSchema>;\nexport type ExtractedFactParsed = z.infer<typeof ExtractedFactSchema>;\nexport type EntityMentionParsed = z.infer<typeof EntityMentionSchema>;\nexport type ExtractedQuestionParsed = z.infer<typeof ExtractedQuestionSchema>;\nexport type ProactiveQuestionsResultParsed = z.infer<typeof ProactiveQuestionsResultSchema>;\nexport type ExtractionResultParsed = z.infer<typeof ExtractionResultSchema>;\nexport type ConsolidationItemParsed = z.infer<typeof ConsolidationItemSchema>;\nexport type ConsolidationResultParsed = z.infer<\n typeof ConsolidationResultSchema\n>;\n"],"mappings":";AAAA,SAAS,SAAS;AAEX,IAAM,yBAAyB,EAAE,KAAK;AAAA,EAC3C;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAEM,IAAM,uCAAuC,EACjD,OAAO;AAAA,EACN,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACnC,gBAAgB,EAAE,KAAK,CAAC,UAAU,aAAa,aAAa,SAAS,UAAU,CAAC;AAAA,EAChF,YAAY,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACnC,QAAQ,EAAE,KAAK,CAAC,cAAc,iBAAiB,UAAU,UAAU,SAAS,CAAC;AAC/E,CAAC,EACA,OAAO;AAEH,SAAS,sBAAsB,OAAwD;AAC5F,QAAM,SAAS,uBAAuB,UAAU,KAAK;AACrD,SAAO,OAAO,UAAU,OAAO,OAAO;AACxC;AAEO,SAAS,oCACd,OACsD;AACtD,QAAM,SAAS,qCAAqC,UAAU,KAAK;AACnE,MAAI,OA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AA,EACtC,kBAAkB,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,IAAI,CAAC;AAAA,EACzC,iBAAiB,EAAE,MAAM,EAAE,OAAO,CAAC;AAAA,EACnC,aAAa,EAAE,MAAM,4BAA4B;AAAA,EACjD,WAAW,EAAE,OAAO;AACtB,CAAC;","names":[]}
|
|
@@ -2,11 +2,11 @@ import {
|
|
|
2
2
|
buildExplicitCaptureDedupKey,
|
|
3
3
|
isTombstoneBlockedCaptureWriteLockBusy,
|
|
4
4
|
normalizeExplicitCaptureContent
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-W4BMEGQA.js";
|
|
6
6
|
import {
|
|
7
7
|
TAG_LIMITS,
|
|
8
8
|
composeMemoryEnvelope
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-RAIUTAZZ.js";
|
|
10
10
|
import {
|
|
11
11
|
isSupportPassportPrivateMemory
|
|
12
12
|
} from "./chunk-XDL5CYZN.js";
|
|
@@ -787,4 +787,4 @@ export {
|
|
|
787
787
|
shouldProcessInlineExplicitCapture,
|
|
788
788
|
InlineExplicitCaptureProcessor
|
|
789
789
|
};
|
|
790
|
-
//# sourceMappingURL=chunk-
|
|
790
|
+
//# sourceMappingURL=chunk-7BEPVIH3.js.map
|
|
@@ -19,6 +19,7 @@ var EXTRACTION_RESPONSE_SHAPE = `{
|
|
|
19
19
|
"promptedByQuestion": "<optional source-grounded question>",
|
|
20
20
|
"quote": "<optional exact contiguous source span>",
|
|
21
21
|
"scope": "<optional project-or-global>",
|
|
22
|
+
"subject": "<optional user-or-agent>",
|
|
22
23
|
"structuredAttributes": {"<key>": "<value>"},
|
|
23
24
|
"procedureSteps": [{"order": 1, "intent": "<step>"}, {"order": 2, "intent": "<step>"}],
|
|
24
25
|
"reasoningTrace": {
|
|
@@ -194,4 +195,4 @@ export {
|
|
|
194
195
|
buildConsolidationSystemPrompt,
|
|
195
196
|
buildProfileConsolidationSystemPrompt
|
|
196
197
|
};
|
|
197
|
-
//# sourceMappingURL=chunk-
|
|
198
|
+
//# sourceMappingURL=chunk-7CBKAQIG.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 const EXTRACTION_RESPONSE_PLACEHOLDERS: Record<string, true> = {};\nfor (const placeholder of EXTRACTION_RESPONSE_SHAPE.match(/<[^<>\\r\\n]+>/g) ?? []) {\n EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;\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 * 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)}\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_LANGUA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AAA;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;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAYpC;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":[]}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-B7RWBZXW.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PAYGC3BD.js";
|
|
7
7
|
import {
|
|
8
8
|
getCachedEpisodeMap,
|
|
9
9
|
setCachedEpisodeMap
|
|
@@ -109,4 +109,4 @@ export {
|
|
|
109
109
|
compareVerifiedEpisodeResults,
|
|
110
110
|
searchVerifiedEpisodes
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-7KFIMGMP.js.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import {
|
|
2
|
+
chatgptReplayNormalizer
|
|
3
|
+
} from "./chunk-MMACM5G2.js";
|
|
1
4
|
import {
|
|
2
5
|
claudeReplayNormalizer
|
|
3
6
|
} from "./chunk-54BGIBCR.js";
|
|
@@ -5,20 +8,17 @@ import {
|
|
|
5
8
|
openclawReplayNormalizer
|
|
6
9
|
} from "./chunk-H4CKS5B2.js";
|
|
7
10
|
import {
|
|
8
|
-
|
|
9
|
-
} from "./chunk-
|
|
11
|
+
importMarkdownBundle
|
|
12
|
+
} from "./chunk-HDDRVXX4.js";
|
|
13
|
+
import {
|
|
14
|
+
importSqlite
|
|
15
|
+
} from "./chunk-PYHOAXTI.js";
|
|
10
16
|
import {
|
|
11
17
|
exportJsonBundle
|
|
12
18
|
} from "./chunk-UP6MOYCB.js";
|
|
13
19
|
import {
|
|
14
20
|
exportSqlite
|
|
15
21
|
} from "./chunk-BV2TIZ4F.js";
|
|
16
|
-
import {
|
|
17
|
-
importMarkdownBundle
|
|
18
|
-
} from "./chunk-HDDRVXX4.js";
|
|
19
|
-
import {
|
|
20
|
-
importSqlite
|
|
21
|
-
} from "./chunk-PYHOAXTI.js";
|
|
22
22
|
import {
|
|
23
23
|
detectImportFormat
|
|
24
24
|
} from "./chunk-OZKVVUJB.js";
|
|
@@ -27,10 +27,16 @@ import {
|
|
|
27
27
|
} from "./chunk-2DL3OFLD.js";
|
|
28
28
|
import {
|
|
29
29
|
backupMemoryDir
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BXLOS5AJ.js";
|
|
31
31
|
import {
|
|
32
32
|
exportMarkdownBundle
|
|
33
33
|
} from "./chunk-765K3SAT.js";
|
|
34
|
+
import {
|
|
35
|
+
RoutingRulesStore
|
|
36
|
+
} from "./chunk-TBUEE7XF.js";
|
|
37
|
+
import {
|
|
38
|
+
WebDavServer
|
|
39
|
+
} from "./chunk-PYIFUBRK.js";
|
|
34
40
|
import {
|
|
35
41
|
buildReplayNormalizerRegistry,
|
|
36
42
|
clampBatchSize,
|
|
@@ -41,23 +47,17 @@ import {
|
|
|
41
47
|
normalizeReplaySessionKey
|
|
42
48
|
} from "./chunk-AJVLDJU6.js";
|
|
43
49
|
import {
|
|
44
|
-
|
|
45
|
-
} from "./chunk-
|
|
50
|
+
rebuildObservations
|
|
51
|
+
} from "./chunk-DQTCGVFK.js";
|
|
46
52
|
import {
|
|
47
53
|
TailscaleHelper
|
|
48
54
|
} from "./chunk-EEC4PCG5.js";
|
|
49
|
-
import {
|
|
50
|
-
WebDavServer
|
|
51
|
-
} from "./chunk-PYIFUBRK.js";
|
|
52
55
|
import {
|
|
53
56
|
migrateObservations
|
|
54
57
|
} from "./chunk-IIFFC3RL.js";
|
|
55
58
|
import {
|
|
56
59
|
rebuildMemoryLifecycleLedger
|
|
57
|
-
} from "./chunk-
|
|
58
|
-
import {
|
|
59
|
-
rebuildObservations
|
|
60
|
-
} from "./chunk-DQTCGVFK.js";
|
|
60
|
+
} from "./chunk-TDKSCV62.js";
|
|
61
61
|
import {
|
|
62
62
|
archiveObservations
|
|
63
63
|
} from "./chunk-YLBE6PLR.js";
|
|
@@ -80,21 +80,21 @@ import {
|
|
|
80
80
|
} from "./chunk-6FC3IZ26.js";
|
|
81
81
|
import {
|
|
82
82
|
searchVerifiedEpisodes
|
|
83
|
-
} from "./chunk-
|
|
83
|
+
} from "./chunk-7KFIMGMP.js";
|
|
84
84
|
import {
|
|
85
85
|
ThreadingManager
|
|
86
86
|
} from "./chunk-OJP3N7UK.js";
|
|
87
87
|
import {
|
|
88
88
|
promoteSemanticRuleFromMemory
|
|
89
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-4XDGYCZI.js";
|
|
90
90
|
import {
|
|
91
91
|
searchVerifiedSemanticRules
|
|
92
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-AYDDB3XI.js";
|
|
93
93
|
import {
|
|
94
94
|
buildResumeBundleFromState,
|
|
95
95
|
getResumeBundleStatus,
|
|
96
96
|
recordResumeBundle
|
|
97
|
-
} from "./chunk-
|
|
97
|
+
} from "./chunk-URHCUXKI.js";
|
|
98
98
|
import {
|
|
99
99
|
getWorkProductLedgerStatus,
|
|
100
100
|
recordWorkProductLedgerEntry,
|
|
@@ -105,7 +105,16 @@ import {
|
|
|
105
105
|
} from "./chunk-AM4T6CHX.js";
|
|
106
106
|
import {
|
|
107
107
|
parseXrayCliOptions
|
|
108
|
-
} from "./chunk-
|
|
108
|
+
} from "./chunk-2VXWFYJE.js";
|
|
109
|
+
import {
|
|
110
|
+
collectPatternMemories,
|
|
111
|
+
explainPatternMemory,
|
|
112
|
+
parsePatternsExplainOptions,
|
|
113
|
+
parsePatternsListOptions,
|
|
114
|
+
parseStrictCliDate,
|
|
115
|
+
renderPatternExplain,
|
|
116
|
+
renderPatternsList
|
|
117
|
+
} from "./chunk-3T74IZB3.js";
|
|
109
118
|
import {
|
|
110
119
|
readRuntimePolicySnapshot,
|
|
111
120
|
sanitizeRuntimePolicyValues
|
|
@@ -118,21 +127,12 @@ import {
|
|
|
118
127
|
runOperatorInventory,
|
|
119
128
|
runOperatorRepair,
|
|
120
129
|
runOperatorSetup
|
|
121
|
-
} from "./chunk-
|
|
130
|
+
} from "./chunk-OLWTCWQ2.js";
|
|
122
131
|
import {
|
|
123
132
|
analyzeSessionIntegrity,
|
|
124
133
|
applySessionRepair,
|
|
125
134
|
planSessionRepair
|
|
126
135
|
} from "./chunk-KFY3SGN7.js";
|
|
127
|
-
import {
|
|
128
|
-
collectPatternMemories,
|
|
129
|
-
explainPatternMemory,
|
|
130
|
-
parsePatternsExplainOptions,
|
|
131
|
-
parsePatternsListOptions,
|
|
132
|
-
parseStrictCliDate,
|
|
133
|
-
renderPatternExplain,
|
|
134
|
-
renderPatternsList
|
|
135
|
-
} from "./chunk-3T74IZB3.js";
|
|
136
136
|
import {
|
|
137
137
|
GITHUB_CONNECTOR_ID,
|
|
138
138
|
GMAIL_CONNECTOR_ID,
|
|
@@ -152,7 +152,7 @@ import {
|
|
|
152
152
|
} from "./chunk-6GUG4YNM.js";
|
|
153
153
|
import {
|
|
154
154
|
searchHarmonicRetrieval
|
|
155
|
-
} from "./chunk-
|
|
155
|
+
} from "./chunk-QXIQPCCN.js";
|
|
156
156
|
import {
|
|
157
157
|
rescoreMemoryImportance
|
|
158
158
|
} from "./chunk-UOBPK2OS.js";
|
|
@@ -175,7 +175,7 @@ import {
|
|
|
175
175
|
rebuildMemoryProjection,
|
|
176
176
|
repairMemoryProjection,
|
|
177
177
|
verifyMemoryProjection
|
|
178
|
-
} from "./chunk-
|
|
178
|
+
} from "./chunk-QFMO32TO.js";
|
|
179
179
|
import {
|
|
180
180
|
buildConnectorRowsFromDefinitions,
|
|
181
181
|
parseConnectorsListOptions,
|
|
@@ -196,11 +196,11 @@ import {
|
|
|
196
196
|
} from "./chunk-6TBIWIAG.js";
|
|
197
197
|
import {
|
|
198
198
|
parseConfig
|
|
199
|
-
} from "./chunk-
|
|
199
|
+
} from "./chunk-76PL4XLG.js";
|
|
200
200
|
import {
|
|
201
201
|
EngramAccessHttpServer,
|
|
202
202
|
MeetingsInputError
|
|
203
|
-
} from "./chunk-
|
|
203
|
+
} from "./chunk-BKYPJUQL.js";
|
|
204
204
|
import {
|
|
205
205
|
WearablesInputError
|
|
206
206
|
} from "./chunk-V7IZKJI3.js";
|
|
@@ -210,13 +210,13 @@ import {
|
|
|
210
210
|
loadChatSession,
|
|
211
211
|
processChatMessage,
|
|
212
212
|
sessionBelongsToPrincipal
|
|
213
|
-
} from "./chunk-
|
|
213
|
+
} from "./chunk-VA5KMSAE.js";
|
|
214
214
|
import {
|
|
215
215
|
getAbstractionNodeStoreStatus
|
|
216
216
|
} from "./chunk-DJUKBGAD.js";
|
|
217
217
|
import {
|
|
218
218
|
EngramAccessService
|
|
219
|
-
} from "./chunk-
|
|
219
|
+
} from "./chunk-WN5FSGLE.js";
|
|
220
220
|
import {
|
|
221
221
|
WorkStorage
|
|
222
222
|
} from "./chunk-GDB4J2H3.js";
|
|
@@ -233,10 +233,10 @@ import {
|
|
|
233
233
|
parseRecallExplainFormat,
|
|
234
234
|
renderRecallExplain,
|
|
235
235
|
renderXray
|
|
236
|
-
} from "./chunk-
|
|
236
|
+
} from "./chunk-AZAA5DNP.js";
|
|
237
237
|
import {
|
|
238
238
|
readAggregateExtractionWatermark
|
|
239
|
-
} from "./chunk-
|
|
239
|
+
} from "./chunk-GUXS322H.js";
|
|
240
240
|
import {
|
|
241
241
|
getObjectiveStateStoreStatus
|
|
242
242
|
} from "./chunk-HTP6XRUI.js";
|
|
@@ -245,33 +245,30 @@ import {
|
|
|
245
245
|
readMemoryGovernanceRunArtifact,
|
|
246
246
|
restoreMemoryGovernanceRun,
|
|
247
247
|
runMemoryGovernance
|
|
248
|
-
} from "./chunk-
|
|
248
|
+
} from "./chunk-EIVIB73I.js";
|
|
249
249
|
import {
|
|
250
250
|
listNamespaces,
|
|
251
251
|
runNamespaceMigration,
|
|
252
252
|
verifyNamespaces
|
|
253
|
-
} from "./chunk-
|
|
253
|
+
} from "./chunk-OJD4WS2E.js";
|
|
254
254
|
import {
|
|
255
255
|
analyzeGraphHealth
|
|
256
256
|
} from "./chunk-BIJAWZYW.js";
|
|
257
257
|
import {
|
|
258
258
|
resolveNamespaceChildRoot
|
|
259
|
-
} from "./chunk-
|
|
260
|
-
import {
|
|
261
|
-
getCausalTrajectoryStoreStatus
|
|
262
|
-
} from "./chunk-PP7R754B.js";
|
|
259
|
+
} from "./chunk-S7Q5CM7E.js";
|
|
263
260
|
import {
|
|
264
261
|
OKF_RESERVED_BASENAMES,
|
|
265
262
|
meetingIdDate,
|
|
266
263
|
okfTypeForCategory
|
|
267
|
-
} from "./chunk-
|
|
264
|
+
} from "./chunk-PAYGC3BD.js";
|
|
268
265
|
import {
|
|
269
266
|
isValidTranscriptDate
|
|
270
267
|
} from "./chunk-UHVXE24Y.js";
|
|
271
268
|
import {
|
|
272
269
|
RECALL_DISCLOSURE_LEVELS,
|
|
273
270
|
isRecallDisclosure
|
|
274
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-NXKJHSDN.js";
|
|
275
272
|
import {
|
|
276
273
|
bumpMemoryCorpusVersionForDir
|
|
277
274
|
} from "./chunk-XCB6QDL6.js";
|
|
@@ -286,6 +283,9 @@ import {
|
|
|
286
283
|
import {
|
|
287
284
|
renderExtractionLivenessStats
|
|
288
285
|
} from "./chunk-3SG4FGDV.js";
|
|
286
|
+
import {
|
|
287
|
+
getCausalTrajectoryStoreStatus
|
|
288
|
+
} from "./chunk-PP7R754B.js";
|
|
289
289
|
import {
|
|
290
290
|
padEndDisplay,
|
|
291
291
|
truncateGraphemeSafe
|
|
@@ -5139,7 +5139,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
|
|
|
5139
5139
|
}
|
|
5140
5140
|
}
|
|
5141
5141
|
if (sourceArchive.endsWith(".enc")) {
|
|
5142
|
-
const { isEncryptedCapsuleFile } = await import("./capsule-crypto-
|
|
5142
|
+
const { isEncryptedCapsuleFile } = await import("./capsule-crypto-YO5QJ6L3.js");
|
|
5143
5143
|
const encDetected = await isEncryptedCapsuleFile(sourceArchive).catch(() => true);
|
|
5144
5144
|
if (encDetected) {
|
|
5145
5145
|
throw new Error(
|
|
@@ -5302,7 +5302,7 @@ function registerCli(api, orchestrator, registerOptions = {}) {
|
|
|
5302
5302
|
const { parseExportBundle } = await import("./transfer/types.js");
|
|
5303
5303
|
let decryptedBuf;
|
|
5304
5304
|
try {
|
|
5305
|
-
const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-
|
|
5305
|
+
const { decryptCapsuleFileInMemory } = await import("./capsule-crypto-YO5QJ6L3.js");
|
|
5306
5306
|
decryptedBuf = await decryptCapsuleFileInMemory(archivePath, memoryDir);
|
|
5307
5307
|
} catch (decErr) {
|
|
5308
5308
|
const msg = decErr instanceof Error ? decErr.message : String(decErr);
|
|
@@ -7741,7 +7741,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
|
|
|
7741
7741
|
process.exit(1);
|
|
7742
7742
|
}
|
|
7743
7743
|
const limit = parseInt(options.limit ?? "50", 10);
|
|
7744
|
-
const { listPairs } = await import("./contradiction-review-
|
|
7744
|
+
const { listPairs } = await import("./contradiction-review-WRVLRWHS.js");
|
|
7745
7745
|
const result = listPairs(orchestrator.config.memoryDir, {
|
|
7746
7746
|
filter,
|
|
7747
7747
|
namespace: options.namespace,
|
|
@@ -7768,7 +7768,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
|
|
|
7768
7768
|
console.error("pairId is required");
|
|
7769
7769
|
process.exit(1);
|
|
7770
7770
|
}
|
|
7771
|
-
const { readPair } = await import("./contradiction-review-
|
|
7771
|
+
const { readPair } = await import("./contradiction-review-WRVLRWHS.js");
|
|
7772
7772
|
const pair = readPair(orchestrator.config.memoryDir, pairId);
|
|
7773
7773
|
if (!pair) {
|
|
7774
7774
|
console.error(`Pair ${pairId} not found.`);
|
|
@@ -7788,7 +7788,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
|
|
|
7788
7788
|
console.error("--verb is required. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context");
|
|
7789
7789
|
process.exit(1);
|
|
7790
7790
|
}
|
|
7791
|
-
const { isValidResolutionVerb, executeResolution } = await import("./resolution-
|
|
7791
|
+
const { isValidResolutionVerb, executeResolution } = await import("./resolution-4552BNRV.js");
|
|
7792
7792
|
if (!isValidResolutionVerb(verb)) {
|
|
7793
7793
|
console.error(`Invalid verb: ${verb}. Must be one of: keep-a, keep-b, merge, both-valid, needs-more-context`);
|
|
7794
7794
|
process.exit(1);
|
|
@@ -7820,7 +7820,7 @@ Semantic consolidation complete. clusters=${result.clustersFound}, consolidated=
|
|
|
7820
7820
|
});
|
|
7821
7821
|
reviewCmd.command("scan").description("Run an on-demand contradiction scan").option("--namespace <ns>", "Namespace to scan").action(async (...args) => {
|
|
7822
7822
|
const options = args[0] ?? {};
|
|
7823
|
-
const { runContradictionScan } = await import("./contradiction-scan-
|
|
7823
|
+
const { runContradictionScan } = await import("./contradiction-scan-AKUWPX5N.js");
|
|
7824
7824
|
console.log("Running contradiction scan...");
|
|
7825
7825
|
const result = await runContradictionScan({
|
|
7826
7826
|
storage: orchestrator.storage,
|
|
@@ -8553,4 +8553,4 @@ export {
|
|
|
8553
8553
|
listMemoryMarkdownFilePaths,
|
|
8554
8554
|
registerCli
|
|
8555
8555
|
};
|
|
8556
|
-
//# sourceMappingURL=chunk-
|
|
8556
|
+
//# sourceMappingURL=chunk-7QOO4LGC.js.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS,
|
|
3
|
+
isSubjectGuardMode
|
|
4
|
+
} from "./chunk-RIAM7DND.js";
|
|
5
|
+
import {
|
|
6
|
+
coerceBool,
|
|
7
|
+
coerceNumber
|
|
8
|
+
} from "./chunk-PQVCH2AE.js";
|
|
9
|
+
|
|
10
|
+
// src/subject-config.ts
|
|
11
|
+
function assertObjectBlock(value, key, shape) {
|
|
12
|
+
if (value === void 0) return;
|
|
13
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
`${key} must be an object (got ${JSON.stringify(value)}). Use ${shape} (issue #2372).`
|
|
16
|
+
);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
function parseSubjectRuntimeConfig(cfg) {
|
|
20
|
+
assertObjectBlock(cfg.subjectClassification, "subjectClassification", "subjectClassification: { enabled: true }");
|
|
21
|
+
const classification = cfg.subjectClassification ?? {};
|
|
22
|
+
const rawEnabled = classification.enabled;
|
|
23
|
+
const enabledCoerced = coerceBool(rawEnabled);
|
|
24
|
+
if (rawEnabled !== void 0 && enabledCoerced === void 0) {
|
|
25
|
+
throw new Error(
|
|
26
|
+
`subjectClassification.enabled must be a boolean or one of "true"/"false"/"1"/"0"/"yes"/"no"/"on"/"off" (got ${JSON.stringify(rawEnabled)}) \u2014 rejected, not defaulted (issue #2372).`
|
|
27
|
+
);
|
|
28
|
+
}
|
|
29
|
+
const rawGuard = cfg.subjectGuard;
|
|
30
|
+
if (rawGuard !== void 0 && !isSubjectGuardMode(rawGuard)) {
|
|
31
|
+
throw new Error(
|
|
32
|
+
`subjectGuard must be one of: off, warn, enforce (got ${JSON.stringify(rawGuard)}) \u2014 rejected, not defaulted (issue #2372; checklist \xA71/\xA739).`
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
assertObjectBlock(cfg.promotionCandidates, "promotionCandidates", "promotionCandidates: { minAccessCount: 3 }");
|
|
36
|
+
const candidates = cfg.promotionCandidates ?? {};
|
|
37
|
+
const minAccessRaw = coerceNumber(candidates.minAccessCount);
|
|
38
|
+
if (candidates.minAccessCount !== void 0 && (minAccessRaw === void 0 || !Number.isFinite(minAccessRaw) || minAccessRaw < 0)) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`promotionCandidates.minAccessCount must be a non-negative number (got ${JSON.stringify(candidates.minAccessCount)}) \u2014 rejected, not defaulted (issue #2372).`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
return {
|
|
44
|
+
subjectClassification: { enabled: rawEnabled === void 0 ? false : enabledCoerced === true },
|
|
45
|
+
subjectGuard: isSubjectGuardMode(rawGuard) ? rawGuard : "warn",
|
|
46
|
+
promotionCandidates: {
|
|
47
|
+
minAccessCount: minAccessRaw !== void 0 ? Math.floor(minAccessRaw) : PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS
|
|
48
|
+
}
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export {
|
|
53
|
+
parseSubjectRuntimeConfig
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-AAXJNINV.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/subject-config.ts"],"sourcesContent":["/**\n * Config parsing for the memory-subject runtime knobs (issue #2372).\n *\n * Extracted from config.ts (its structural-ratchet ceiling forbids growth);\n * `parseConfig` spreads `parseSubjectRuntimeConfig(cfg)` into the plugin\n * config literal.\n *\n * Validation posture (Review Prevention Checklist §1/§24/§39): invalid\n * values are REJECTED loudly, never silently reinterpreted — but an omitted\n * key takes the documented default. The deliberate asymmetry from the issue\n * stands: classification defaults OFF while the guard defaults \"warn\", so\n * enabling classification later immediately yields promotion warnings\n * without a second flag flip, and with classification off, unstamped\n * memories still only warn (never silently promote) at shared targets.\n */\n\nimport { coerceBool, coerceNumber } from \"./connectors/coerce.js\";\nimport {\n isSubjectGuardMode,\n PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS,\n} from \"./memory-subject.js\";\nimport type { SubjectGuardMode } from \"./types.js\";\n\nexport interface SubjectRuntimeConfig {\n subjectClassification: { enabled: boolean };\n subjectGuard: SubjectGuardMode;\n promotionCandidates: { minAccessCount: number };\n}\n\n/**\n * Reject a non-object block loudly (rule 51 / §1): a shorthand like\n * `subjectClassification: false` must never normalize silently to `{}`.\n * Returns void so callers read the block through a DIRECT `cfg.<key>`\n * member access — the config-contract parser walker derives nested key\n * paths from those accesses, and a helper return value hides them.\n */\nfunction assertObjectBlock(value: unknown, key: string, shape: string): void {\n if (value === undefined) return;\n if (typeof value !== \"object\" || value === null || Array.isArray(value)) {\n throw new Error(\n `${key} must be an object (got ${JSON.stringify(value)}). Use ${shape} (issue #2372).`,\n );\n }\n}\n\nexport function parseSubjectRuntimeConfig(cfg: Record<string, unknown>): SubjectRuntimeConfig {\n assertObjectBlock(cfg.subjectClassification, \"subjectClassification\", \"subjectClassification: { enabled: true }\");\n const classification = (cfg.subjectClassification ?? {}) as Record<string, unknown>;\n const rawEnabled = classification.enabled;\n const enabledCoerced = coerceBool(rawEnabled);\n if (rawEnabled !== undefined && enabledCoerced === undefined) {\n throw new Error(\n `subjectClassification.enabled must be a boolean or one of \"true\"/\"false\"/\"1\"/\"0\"/` +\n `\"yes\"/\"no\"/\"on\"/\"off\" (got ${JSON.stringify(rawEnabled)}) — rejected, not defaulted (issue #2372).`,\n );\n }\n const rawGuard = cfg.subjectGuard;\n if (rawGuard !== undefined && !isSubjectGuardMode(rawGuard)) {\n throw new Error(\n `subjectGuard must be one of: off, warn, enforce (got ${JSON.stringify(rawGuard)}) — ` +\n `rejected, not defaulted (issue #2372; checklist §1/§39).`,\n );\n }\n assertObjectBlock(cfg.promotionCandidates, \"promotionCandidates\", \"promotionCandidates: { minAccessCount: 3 }\");\n const candidates = (cfg.promotionCandidates ?? {}) as Record<string, unknown>;\n const minAccessRaw = coerceNumber(candidates.minAccessCount);\n if (candidates.minAccessCount !== undefined && (minAccessRaw === undefined || !Number.isFinite(minAccessRaw) || minAccessRaw < 0)) {\n throw new Error(\n `promotionCandidates.minAccessCount must be a non-negative number (got ${JSON.stringify(candidates.minAccessCount)}) — rejected, not defaulted (issue #2372).`,\n );\n }\n return {\n subjectClassification: { enabled: rawEnabled === undefined ? false : enabledCoerced === true },\n subjectGuard: isSubjectGuardMode(rawGuard) ? rawGuard : \"warn\",\n promotionCandidates: {\n minAccessCount:\n minAccessRaw !== undefined ? Math.floor(minAccessRaw) : PROMOTION_CANDIDATES_DEFAULT_MIN_ACCESS,\n },\n };\n}\n"],"mappings":";;;;;;;;;;AAoCA,SAAS,kBAAkB,OAAgB,KAAa,OAAqB;AAC3E,MAAI,UAAU,OAAW;AACzB,MAAI,OAAO,UAAU,YAAY,UAAU,QAAQ,MAAM,QAAQ,KAAK,GAAG;AACvE,UAAM,IAAI;AAAA,MACR,GAAG,GAAG,2BAA2B,KAAK,UAAU,KAAK,CAAC,UAAU,KAAK;AAAA,IACvE;AAAA,EACF;AACF;AAEO,SAAS,0BAA0B,KAAoD;AAC5F,oBAAkB,IAAI,uBAAuB,yBAAyB,0CAA0C;AAChH,QAAM,iBAAkB,IAAI,yBAAyB,CAAC;AACtD,QAAM,aAAa,eAAe;AAClC,QAAM,iBAAiB,WAAW,UAAU;AAC5C,MAAI,eAAe,UAAa,mBAAmB,QAAW;AAC5D,UAAM,IAAI;AAAA,MACR,+GACgC,KAAK,UAAU,UAAU,CAAC;AAAA,IAC5D;AAAA,EACF;AACA,QAAM,WAAW,IAAI;AACrB,MAAI,aAAa,UAAa,CAAC,mBAAmB,QAAQ,GAAG;AAC3D,UAAM,IAAI;AAAA,MACR,wDAAwD,KAAK,UAAU,QAAQ,CAAC;AAAA,IAElF;AAAA,EACF;AACA,oBAAkB,IAAI,qBAAqB,uBAAuB,4CAA4C;AAC9G,QAAM,aAAc,IAAI,uBAAuB,CAAC;AAChD,QAAM,eAAe,aAAa,WAAW,cAAc;AAC3D,MAAI,WAAW,mBAAmB,WAAc,iBAAiB,UAAa,CAAC,OAAO,SAAS,YAAY,KAAK,eAAe,IAAI;AACjI,UAAM,IAAI;AAAA,MACR,yEAAyE,KAAK,UAAU,WAAW,cAAc,CAAC;AAAA,IACpH;AAAA,EACF;AACA,SAAO;AAAA,IACL,uBAAuB,EAAE,SAAS,eAAe,SAAY,QAAQ,mBAAmB,KAAK;AAAA,IAC7F,cAAc,mBAAmB,QAAQ,IAAI,WAAW;AAAA,IACxD,qBAAqB;AAAA,MACnB,gBACE,iBAAiB,SAAY,KAAK,MAAM,YAAY,IAAI;AAAA,IAC5D;AAAA,EACF;AACF;","names":[]}
|
|
@@ -148,11 +148,40 @@ var MCP_ADMIN_OPS_TOOLS = [
|
|
|
148
148
|
},
|
|
149
149
|
additionalProperties: false
|
|
150
150
|
}
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
name: "engram.procedure_library_maintenance",
|
|
154
|
+
description: "Run procedure library health maintenance (issue #2370): merge near-duplicate active procedures, flag stale-tool procedures for repair, and retire failure-dominant or idle ones \u2014 from Memory Worth + trajectory telemetry. Shadow-first: default run writes nothing and returns a proposed-transition report. apply=true (and procedural.maintenance.enabled) executes transitions; dryRun=true forces shadow.",
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: "object",
|
|
157
|
+
properties: {
|
|
158
|
+
namespace: { type: "string" },
|
|
159
|
+
apply: { type: "boolean" },
|
|
160
|
+
dryRun: { type: "boolean" }
|
|
161
|
+
},
|
|
162
|
+
additionalProperties: false
|
|
163
|
+
}
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: "engram.preference_drift_scan",
|
|
167
|
+
description: "Run a preference drift scan (issue #2371): classify aging preference memories as corroborated / stale / drifted from recent same-namespace evidence. Shadow-first \u2014 the default run reports only. apply=true (and driftDetection.enabled) stamps lastCorroborated / driftState and opens one review item per drifted preference. Never auto-deletes and never auto-supersedes.",
|
|
168
|
+
inputSchema: {
|
|
169
|
+
type: "object",
|
|
170
|
+
properties: {
|
|
171
|
+
namespace: { type: "string" },
|
|
172
|
+
apply: { type: "boolean" }
|
|
173
|
+
},
|
|
174
|
+
additionalProperties: false
|
|
175
|
+
}
|
|
151
176
|
}
|
|
152
177
|
];
|
|
178
|
+
var MCP_ADMIN_OPS_MIGRATED_OPERATIONS = {
|
|
179
|
+
"engram.preference_drift_scan": "preference_drift_scan"
|
|
180
|
+
};
|
|
153
181
|
|
|
154
182
|
export {
|
|
155
183
|
MCP_GIT_CONTEXT_SCHEMA_PROPS_IGNORED,
|
|
156
|
-
MCP_ADMIN_OPS_TOOLS
|
|
184
|
+
MCP_ADMIN_OPS_TOOLS,
|
|
185
|
+
MCP_ADMIN_OPS_MIGRATED_OPERATIONS
|
|
157
186
|
};
|
|
158
|
-
//# sourceMappingURL=chunk-
|
|
187
|
+
//# sourceMappingURL=chunk-AB3A7EFH.js.map
|