@remnic/core 9.32.0 → 9.33.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/access-admin-ops-surface.d.ts +10 -10
- package/dist/access-admin-ops-surface.js +31 -30
- package/dist/access-authorization-probe.d.ts +10 -10
- package/dist/access-authorization-probe.js +32 -31
- package/dist/access-boundary.d.ts +10 -10
- package/dist/access-boundary.js +31 -30
- package/dist/access-cli.js +67 -65
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.d.ts +10 -10
- package/dist/access-extraction-force-flush.js +31 -30
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +10 -10
- package/dist/access-http-lifecycle-flush.d.ts +10 -10
- package/dist/access-http.d.ts +10 -10
- package/dist/access-http.js +40 -39
- package/dist/access-identity-continuity-surface.d.ts +8 -8
- package/dist/access-identity-continuity-surface.js +31 -30
- package/dist/access-lcm-surface.d.ts +10 -10
- package/dist/access-lcm-surface.js +31 -30
- package/dist/access-mcp.d.ts +10 -10
- package/dist/access-mcp.js +36 -35
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-COhbXBqS.d.ts → access-namespace-preflight-CWyL4Zai.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +31 -30
- package/dist/access-observe-write-surface.d.ts +10 -10
- package/dist/access-observe-write-surface.js +31 -30
- package/dist/access-operations-batch.js +33 -32
- package/dist/access-operations.d.ts +10 -10
- package/dist/access-operations.js +35 -34
- package/dist/access-recall-concurrency.d.ts +10 -10
- package/dist/access-recall-concurrency.js +31 -30
- package/dist/access-recall-response.d.ts +10 -10
- package/dist/access-recall-response.js +31 -30
- package/dist/access-recall-surface.d.ts +10 -10
- package/dist/access-recall-surface.js +31 -30
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-BmBTtEKO.d.ts → access-service-D9zIBlpp.d.ts} +7 -7
- package/dist/access-service-helpers.d.ts +10 -10
- package/dist/access-service.d.ts +10 -10
- package/dist/access-service.js +31 -30
- package/dist/access-surface-catalog.d.ts +10 -10
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/auto-sync-UPTUVE4X.js +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +8 -8
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +7 -7
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +2 -2
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-7FJQINUR.js → capsule-crypto-YO5QJ6L3.js} +2 -2
- package/dist/{catalog-Dm-DvNBY.d.ts → catalog-Du4bpZWM.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +8 -8
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-AU7Q3LSC.js → chunk-2QSZNTDO.js} +4 -4
- package/dist/{chunk-FHBITMRY.js → chunk-4TGZCYHH.js} +15 -15
- package/dist/{chunk-2NTGBZLZ.js → chunk-6JE3HGS4.js} +6 -6
- package/dist/{chunk-MAXVH44E.js → chunk-6NNNURLK.js} +4 -4
- package/dist/{chunk-65ZPVYTA.js → chunk-6NPZ3FP2.js} +2 -2
- package/dist/{chunk-BLAKS3CP.js → chunk-77CNV7DY.js} +4 -4
- package/dist/{chunk-227UFSEQ.js → chunk-7RZJWZ46.js} +5 -5
- package/dist/{chunk-2QIMTVEJ.js → chunk-7TWUCYER.js} +3 -1
- package/dist/chunk-7TWUCYER.js.map +1 -0
- package/dist/{chunk-UORKJ34C.js → chunk-7ZHGPX56.js} +2 -2
- package/dist/{chunk-G2YQ57YO.js → chunk-AEPYA55F.js} +2 -2
- package/dist/{chunk-AQEJE3WO.js → chunk-ATUURSST.js} +3 -3
- package/dist/chunk-B6XHIBIB.js +111 -0
- package/dist/chunk-B6XHIBIB.js.map +1 -0
- package/dist/{chunk-AJL6NNX6.js → chunk-BIXWNHIL.js} +2 -2
- package/dist/{chunk-2NLLXCJG.js → chunk-BXLOS5AJ.js} +2 -2
- package/dist/{chunk-FMFLGS5Z.js → chunk-C4PEMCP4.js} +8 -8
- package/dist/{chunk-TGTTESJS.js → chunk-CMQZNEIF.js} +2 -2
- package/dist/chunk-CMQZNEIF.js.map +1 -0
- package/dist/{chunk-QDTZ2HF7.js → chunk-DMT2RGAZ.js} +3 -3
- package/dist/{chunk-QIHIHZYC.js → chunk-DP7ZV2II.js} +42 -89
- package/dist/chunk-DP7ZV2II.js.map +1 -0
- package/dist/{chunk-X7Y7WX73.js → chunk-DQEMWVMT.js} +1 -1
- package/dist/{chunk-CJDNT45S.js → chunk-EHNENZHZ.js} +6 -6
- package/dist/{chunk-5WZVQRHV.js → chunk-EO7X2LDK.js} +2 -2
- package/dist/{chunk-TL4TO3EA.js → chunk-F3BNEYX2.js} +2 -2
- package/dist/{chunk-VVDPPDDF.js → chunk-HXDWZFNP.js} +1 -1
- package/dist/chunk-HXDWZFNP.js.map +1 -0
- package/dist/{chunk-3F2LKUMU.js → chunk-I5DQ6KZK.js} +2 -2
- package/dist/{chunk-3EQ2XB3W.js → chunk-IZXTZ7BF.js} +5 -5
- package/dist/{chunk-ODGOP7P2.js → chunk-J6BYDVPL.js} +2 -2
- package/dist/{chunk-THCPRMRF.js → chunk-J6SLNQRO.js} +2 -2
- package/dist/{chunk-IGWFKW4B.js → chunk-KEWUNL7P.js} +2 -2
- package/dist/{chunk-OPBTPRGY.js → chunk-KWU6MAD4.js} +2 -2
- package/dist/{chunk-2Q4JJ3FZ.js → chunk-MPH263X2.js} +2 -2
- package/dist/{chunk-VMZ56EE3.js → chunk-MYXWPG5O.js} +2 -2
- package/dist/{chunk-27HHNYSQ.js → chunk-N2B56SIS.js} +3 -3
- package/dist/{chunk-YX5LN6JR.js → chunk-OPRP6Q4Z.js} +3 -3
- package/dist/{chunk-ES36HTSC.js → chunk-PTN6UAUA.js} +4 -4
- package/dist/{chunk-CE5355TT.js → chunk-QHYB4MJV.js} +2 -2
- package/dist/{chunk-S2BBISHU.js → chunk-RYHWZ52A.js} +4 -4
- package/dist/{chunk-YPC7W6GA.js → chunk-RYMPLSIT.js} +3 -2
- package/dist/{chunk-YPC7W6GA.js.map → chunk-RYMPLSIT.js.map} +1 -1
- package/dist/{chunk-J7WZUL2K.js → chunk-SFW2NABJ.js} +11 -11
- package/dist/{chunk-QMWFQBIL.js → chunk-SIKCTPRK.js} +3 -3
- package/dist/{chunk-LUQ443JP.js → chunk-SPPL77NI.js} +28 -28
- package/dist/chunk-T2TTP3KU.js +28 -0
- package/dist/chunk-T2TTP3KU.js.map +1 -0
- package/dist/{chunk-35IVNNRK.js → chunk-TCIWHK3N.js} +2 -2
- package/dist/{chunk-HFQQWAMS.js → chunk-TITQYVKD.js} +36 -36
- package/dist/{chunk-E6BMSH7U.js → chunk-V2MVDDJF.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-VDX2J7OX.js} +2 -2
- package/dist/{chunk-HKPJPOW7.js → chunk-XABS455Y.js} +2 -2
- package/dist/{chunk-U7QYBSQJ.js → chunk-XWDZQIYU.js} +2 -2
- package/dist/{chunk-Z7XKUWYS.js → chunk-Y2ZD2RVG.js} +2 -2
- package/dist/{chunk-AQWVJURR.js → chunk-Y6OWJ3V5.js} +2 -2
- package/dist/{chunk-J3ZGPYXB.js → chunk-YFQMW2TH.js} +28 -30
- package/dist/chunk-YFQMW2TH.js.map +1 -0
- package/dist/{chunk-6P7MTSU5.js → chunk-YJ7PWEWI.js} +2 -2
- package/dist/{cli-DRJLv1Xt.d.ts → cli-mFX-QQvx.d.ts} +5 -5
- package/dist/cli.d.ts +12 -12
- package/dist/cli.js +56 -55
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +7 -7
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +7 -7
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +4 -2
- package/dist/connectors/index.js +12 -8
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +18 -18
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +7 -7
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +8 -8
- package/dist/explicit-capture.js +3 -3
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction.d.ts +1 -2
- package/dist/extraction.js +63 -2
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +19 -19
- package/dist/index.js +95 -93
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +5 -5
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +7 -7
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +7 -7
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +8 -8
- package/dist/{maintenance-C6Pffz30.d.ts → maintenance-70Wq118b.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +10 -10
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +17 -17
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +9 -9
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +7 -7
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +19 -19
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +22 -22
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +12 -12
- package/dist/{orchestrator-eQlmasno.d.ts → orchestrator-BH8LT-NX.d.ts} +7 -7
- package/dist/orchestrator.d.ts +8 -8
- package/dist/orchestrator.js +67 -65
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CZGmAMQ2.d.ts → pipeline-DSLWFeHz.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-DBj4MF8T.d.ts → qmd-BSDGyr0H.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/{scope-profiles-S85lrsUn.d.ts → scope-profiles-C4zY-a2K.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +8 -8
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-DVzDcV6x.d.ts → semantic-consolidation-ChKRYpRO.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +8 -8
- package/dist/semantic-rule-promotion.js +7 -7
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +7 -7
- package/dist/{service-C2M-wD4W.d.ts → service-CrxXHz5T.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +24 -0
- package/dist/source-agent-qualifier.js +98 -0
- package/dist/source-agent-qualifier.js.map +1 -0
- package/dist/{storage-dyBC3Q84.d.ts → storage-CyWa1Jm6.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +6 -6
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -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/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-D63ZI--P.d.ts → types-5398p7Zm.d.ts} +7 -8
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +7 -7
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/connector-provenance-lifecycle.test.ts +86 -3
- package/src/connectors/index.ts +2 -2
- package/src/connectors/label.ts +18 -0
- package/src/extraction-scope-source-agent.test.ts +513 -0
- package/src/extraction.ts +45 -98
- package/src/orchestration/extraction-run.ts +1 -1
- package/src/orchestration/recall-result-formatter.ts +2 -1
- package/src/schemas.ts +1 -1
- package/src/source-agent-qualifier.ts +156 -0
- package/src/types.ts +7 -8
- package/dist/chunk-2QIMTVEJ.js.map +0 -1
- package/dist/chunk-J3ZGPYXB.js.map +0 -1
- package/dist/chunk-QIHIHZYC.js.map +0 -1
- package/dist/chunk-TGTTESJS.js.map +0 -1
- package/dist/chunk-VVDPPDDF.js.map +0 -1
- /package/dist/{capsule-crypto-7FJQINUR.js.map → capsule-crypto-YO5QJ6L3.js.map} +0 -0
- /package/dist/{chunk-AU7Q3LSC.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-FHBITMRY.js.map → chunk-4TGZCYHH.js.map} +0 -0
- /package/dist/{chunk-2NTGBZLZ.js.map → chunk-6JE3HGS4.js.map} +0 -0
- /package/dist/{chunk-MAXVH44E.js.map → chunk-6NNNURLK.js.map} +0 -0
- /package/dist/{chunk-65ZPVYTA.js.map → chunk-6NPZ3FP2.js.map} +0 -0
- /package/dist/{chunk-BLAKS3CP.js.map → chunk-77CNV7DY.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-7RZJWZ46.js.map} +0 -0
- /package/dist/{chunk-UORKJ34C.js.map → chunk-7ZHGPX56.js.map} +0 -0
- /package/dist/{chunk-G2YQ57YO.js.map → chunk-AEPYA55F.js.map} +0 -0
- /package/dist/{chunk-AQEJE3WO.js.map → chunk-ATUURSST.js.map} +0 -0
- /package/dist/{chunk-AJL6NNX6.js.map → chunk-BIXWNHIL.js.map} +0 -0
- /package/dist/{chunk-2NLLXCJG.js.map → chunk-BXLOS5AJ.js.map} +0 -0
- /package/dist/{chunk-FMFLGS5Z.js.map → chunk-C4PEMCP4.js.map} +0 -0
- /package/dist/{chunk-QDTZ2HF7.js.map → chunk-DMT2RGAZ.js.map} +0 -0
- /package/dist/{chunk-X7Y7WX73.js.map → chunk-DQEMWVMT.js.map} +0 -0
- /package/dist/{chunk-CJDNT45S.js.map → chunk-EHNENZHZ.js.map} +0 -0
- /package/dist/{chunk-5WZVQRHV.js.map → chunk-EO7X2LDK.js.map} +0 -0
- /package/dist/{chunk-TL4TO3EA.js.map → chunk-F3BNEYX2.js.map} +0 -0
- /package/dist/{chunk-3F2LKUMU.js.map → chunk-I5DQ6KZK.js.map} +0 -0
- /package/dist/{chunk-3EQ2XB3W.js.map → chunk-IZXTZ7BF.js.map} +0 -0
- /package/dist/{chunk-ODGOP7P2.js.map → chunk-J6BYDVPL.js.map} +0 -0
- /package/dist/{chunk-THCPRMRF.js.map → chunk-J6SLNQRO.js.map} +0 -0
- /package/dist/{chunk-IGWFKW4B.js.map → chunk-KEWUNL7P.js.map} +0 -0
- /package/dist/{chunk-OPBTPRGY.js.map → chunk-KWU6MAD4.js.map} +0 -0
- /package/dist/{chunk-2Q4JJ3FZ.js.map → chunk-MPH263X2.js.map} +0 -0
- /package/dist/{chunk-VMZ56EE3.js.map → chunk-MYXWPG5O.js.map} +0 -0
- /package/dist/{chunk-27HHNYSQ.js.map → chunk-N2B56SIS.js.map} +0 -0
- /package/dist/{chunk-YX5LN6JR.js.map → chunk-OPRP6Q4Z.js.map} +0 -0
- /package/dist/{chunk-ES36HTSC.js.map → chunk-PTN6UAUA.js.map} +0 -0
- /package/dist/{chunk-CE5355TT.js.map → chunk-QHYB4MJV.js.map} +0 -0
- /package/dist/{chunk-S2BBISHU.js.map → chunk-RYHWZ52A.js.map} +0 -0
- /package/dist/{chunk-J7WZUL2K.js.map → chunk-SFW2NABJ.js.map} +0 -0
- /package/dist/{chunk-QMWFQBIL.js.map → chunk-SIKCTPRK.js.map} +0 -0
- /package/dist/{chunk-LUQ443JP.js.map → chunk-SPPL77NI.js.map} +0 -0
- /package/dist/{chunk-35IVNNRK.js.map → chunk-TCIWHK3N.js.map} +0 -0
- /package/dist/{chunk-HFQQWAMS.js.map → chunk-TITQYVKD.js.map} +0 -0
- /package/dist/{chunk-E6BMSH7U.js.map → chunk-V2MVDDJF.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-VDX2J7OX.js.map} +0 -0
- /package/dist/{chunk-HKPJPOW7.js.map → chunk-XABS455Y.js.map} +0 -0
- /package/dist/{chunk-U7QYBSQJ.js.map → chunk-XWDZQIYU.js.map} +0 -0
- /package/dist/{chunk-Z7XKUWYS.js.map → chunk-Y2ZD2RVG.js.map} +0 -0
- /package/dist/{chunk-AQWVJURR.js.map → chunk-Y6OWJ3V5.js.map} +0 -0
- /package/dist/{chunk-6P7MTSU5.js.map → chunk-YJ7PWEWI.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4TGZCYHH.js";
|
|
4
4
|
import {
|
|
5
5
|
getCachedRuleMemories,
|
|
6
6
|
setCachedRuleMemories
|
|
@@ -119,4 +119,4 @@ export {
|
|
|
119
119
|
compareVerifiedSemanticRuleResults,
|
|
120
120
|
searchVerifiedSemanticRules
|
|
121
121
|
};
|
|
122
|
-
//# sourceMappingURL=chunk-
|
|
122
|
+
//# sourceMappingURL=chunk-7ZHGPX56.js.map
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-JLNBQWZ2.js";
|
|
6
6
|
import {
|
|
7
7
|
runPostConsolidationMaterialize
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-QHYB4MJV.js";
|
|
9
9
|
import {
|
|
10
10
|
isSemanticConsolidationLlmOperator
|
|
11
11
|
} from "./chunk-G7D6GZ5J.js";
|
|
@@ -220,4 +220,4 @@ export {
|
|
|
220
220
|
buildExtensionsBlockForConsolidation,
|
|
221
221
|
materializeAfterSemanticConsolidation
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-AEPYA55F.js.map
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
} from "./chunk-T4WDJPEZ.js";
|
|
13
13
|
import {
|
|
14
14
|
validateRequest
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I5DQ6KZK.js";
|
|
16
16
|
import {
|
|
17
17
|
MCP_ADMIN_OPS_TOOLS,
|
|
18
18
|
MCP_GIT_CONTEXT_SCHEMA_PROPS_IGNORED
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
} from "./chunk-WWUVONGW.js";
|
|
23
23
|
import {
|
|
24
24
|
getOperation
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-YFQMW2TH.js";
|
|
26
26
|
import {
|
|
27
27
|
assertOperationAllowed,
|
|
28
28
|
capabilityAllowsOp,
|
|
@@ -3754,4 +3754,4 @@ export {
|
|
|
3754
3754
|
MCP_SUPPORTED_PROTOCOL_VERSIONS,
|
|
3755
3755
|
EngramMcpServer
|
|
3756
3756
|
};
|
|
3757
|
-
//# sourceMappingURL=chunk-
|
|
3757
|
+
//# sourceMappingURL=chunk-ATUURSST.js.map
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import {
|
|
2
|
+
applyExtractionSourceGrounding
|
|
3
|
+
} from "./chunk-YIAA2X3D.js";
|
|
4
|
+
import {
|
|
5
|
+
CONNECTOR_LABEL_MAX_LENGTH,
|
|
6
|
+
knownConnectorIds
|
|
7
|
+
} from "./chunk-T2TTP3KU.js";
|
|
8
|
+
import {
|
|
9
|
+
isValidConnectorId
|
|
10
|
+
} from "./chunk-7TWUCYER.js";
|
|
11
|
+
import {
|
|
12
|
+
deriveSourceConnector
|
|
13
|
+
} from "./chunk-RYMPLSIT.js";
|
|
14
|
+
import {
|
|
15
|
+
resolvePipelineProcessingCapabilities
|
|
16
|
+
} from "./chunk-2XRE6FLM.js";
|
|
17
|
+
|
|
18
|
+
// src/source-agent-qualifier.ts
|
|
19
|
+
function resolveSourceConnector(turns) {
|
|
20
|
+
const contributing = turns.filter((turn) => turn.extractionContextOnly !== true);
|
|
21
|
+
const derived = deriveSourceConnector(contributing);
|
|
22
|
+
if (derived === void 0 || !isValidConnectorId(derived)) return void 0;
|
|
23
|
+
return /[\u0000-\u001F\u007F]/.test(derived) ? void 0 : derived;
|
|
24
|
+
}
|
|
25
|
+
function headerConnector(connector) {
|
|
26
|
+
return connector !== void 0 && connector.length <= CONNECTOR_LABEL_MAX_LENGTH ? connector : void 0;
|
|
27
|
+
}
|
|
28
|
+
function renderExtractionConversation(boundedTurns, sourceConnector) {
|
|
29
|
+
const renderedConversation = boundedTurns.map((t) => `[${t.extractionContextOnly === true ? `context ${t.role}` : t.role}] ${t.content}`).join("\n\n");
|
|
30
|
+
const conversation = sourceConnector === void 0 ? renderedConversation : `Source agent: ${sourceConnector}
|
|
31
|
+
|
|
32
|
+
Tool and command instructions in this conversation apply to the ${sourceConnector} agent unless they are clearly universal.
|
|
33
|
+
|
|
34
|
+
${renderedConversation}`;
|
|
35
|
+
return { conversation, renderedConversation };
|
|
36
|
+
}
|
|
37
|
+
function applyGroundingWithConnector(config, result, ctx) {
|
|
38
|
+
const caps = resolvePipelineProcessingCapabilities(config);
|
|
39
|
+
const options = { sourceGrounding: caps.sourceGrounding, anchorTemporalExpressions: caps.delinearize };
|
|
40
|
+
const known = buildKnownConnectors(ctx.sourceConnector);
|
|
41
|
+
const scoped = ctx.scopeClassificationEnabled === false ? result : forceProjectScopeOnAnyQualifier(result, known);
|
|
42
|
+
if (ctx.sourceConnector === void 0) {
|
|
43
|
+
return applyExtractionSourceGrounding(scoped, ctx.groundingSource, ctx.assertionSource, ctx.roleAssertionSources, ctx.messageTimestamp, options);
|
|
44
|
+
}
|
|
45
|
+
const prepared = prepareTrustedConnectorQualifier(scoped, ctx.sourceConnector, known);
|
|
46
|
+
const grounded = applyExtractionSourceGrounding(prepared.result, ctx.groundingSource, ctx.assertionSource, ctx.roleAssertionSources, ctx.messageTimestamp, options);
|
|
47
|
+
return restoreTrustedConnectorQualifier(grounded);
|
|
48
|
+
}
|
|
49
|
+
function buildKnownConnectors(trusted) {
|
|
50
|
+
const known = /* @__PURE__ */ new Set();
|
|
51
|
+
for (const id of knownConnectorIds()) known.add(id.toLowerCase());
|
|
52
|
+
if (trusted !== void 0) known.add(trusted.toLowerCase());
|
|
53
|
+
return known;
|
|
54
|
+
}
|
|
55
|
+
function parseLeadingQualifier(content, known) {
|
|
56
|
+
const lower = content.toLowerCase();
|
|
57
|
+
for (const lead of ["in ", "for "]) {
|
|
58
|
+
if (!lower.startsWith(lead)) continue;
|
|
59
|
+
const m = lower.slice(lead.length).match(/^([a-z0-9][a-z0-9._-]*)\s*,/u);
|
|
60
|
+
if (m && known.has(m[1])) {
|
|
61
|
+
const consumed = lead.length + m[0].length;
|
|
62
|
+
return { agent: m[1], rest: content.slice(consumed).replace(/^[\s,.;:]+/u, "") };
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const pm = lower.match(/^([a-z0-9][a-z0-9._-]*)'s(?![\p{L}\p{N}])/u);
|
|
66
|
+
if (pm && known.has(pm[1])) {
|
|
67
|
+
return { agent: pm[1], rest: content.slice(pm[0].length).replace(/^[\s,.;:]+/u, "") };
|
|
68
|
+
}
|
|
69
|
+
return void 0;
|
|
70
|
+
}
|
|
71
|
+
function forceProjectScopeOnAnyQualifier(result, known) {
|
|
72
|
+
let any = false;
|
|
73
|
+
const facts = result.facts.map((fact) => {
|
|
74
|
+
if (fact.scope === "project") return fact;
|
|
75
|
+
if (parseLeadingQualifier(fact.content, known) === void 0) return fact;
|
|
76
|
+
any = true;
|
|
77
|
+
return { ...fact, scope: "project" };
|
|
78
|
+
});
|
|
79
|
+
return any ? { ...result, facts } : result;
|
|
80
|
+
}
|
|
81
|
+
var RESTORE_KEY = "_qo";
|
|
82
|
+
function prepareTrustedConnectorQualifier(result, trustedConnector, known) {
|
|
83
|
+
const trusted = trustedConnector.toLowerCase();
|
|
84
|
+
const facts = result.facts.map((fact) => {
|
|
85
|
+
const parsed = parseLeadingQualifier(fact.content, known);
|
|
86
|
+
if (parsed === void 0 || parsed.agent !== trusted) return fact;
|
|
87
|
+
return { ...fact, content: parsed.rest, [RESTORE_KEY]: fact.content };
|
|
88
|
+
});
|
|
89
|
+
return { result: { ...result, facts } };
|
|
90
|
+
}
|
|
91
|
+
function restoreTrustedConnectorQualifier(grounded) {
|
|
92
|
+
let touched = false;
|
|
93
|
+
const facts = grounded.facts.map((fact) => {
|
|
94
|
+
const record = fact;
|
|
95
|
+
const original = record[RESTORE_KEY];
|
|
96
|
+
if (typeof original !== "string") return fact;
|
|
97
|
+
touched = true;
|
|
98
|
+
const rest = { ...record };
|
|
99
|
+
delete rest[RESTORE_KEY];
|
|
100
|
+
return { ...rest, content: original };
|
|
101
|
+
});
|
|
102
|
+
return touched ? { ...grounded, facts } : grounded;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export {
|
|
106
|
+
resolveSourceConnector,
|
|
107
|
+
headerConnector,
|
|
108
|
+
renderExtractionConversation,
|
|
109
|
+
applyGroundingWithConnector
|
|
110
|
+
};
|
|
111
|
+
//# sourceMappingURL=chunk-B6XHIBIB.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/source-agent-qualifier.ts"],"sourcesContent":["/**\n * Source-agent qualifier helpers for extraction (#2183).\n *\n * Pure leaf module: imports only types and sibling leaf/orchestration helpers,\n * never `extraction.ts`, so it introduces no cycle (extraction-run.ts only\n * type-imports extraction.ts).\n */\nimport { resolvePipelineProcessingCapabilities } from \"./capabilities.js\";\nimport { applyExtractionSourceGrounding } from \"./extraction-source-grounding.js\";\nimport type { ExtractionGroundingRoleSources } from \"./extraction-source-grounding.js\";\nimport { isValidConnectorId } from \"./connectors/index.js\";\nimport { CONNECTOR_LABEL_MAX_LENGTH, knownConnectorIds } from \"./connectors/label.js\";\nimport { deriveSourceConnector } from \"./orchestration/extraction-run.js\";\nimport type { BufferTurn, ExtractionResult, PluginConfig } from \"./types.js\";\n\n\nexport function resolveSourceConnector(turns: readonly BufferTurn[]): string | undefined {\n const contributing = turns.filter((turn) => turn.extractionContextOnly !== true);\n const derived = deriveSourceConnector(contributing);\n if (derived === undefined || !isValidConnectorId(derived)) return undefined;\n return /[\\u0000-\\u001F\\u007F]/.test(derived) ? undefined : derived;\n}\n\n// Same bound as the recall renderer (CONNECTOR_LABEL_MAX_LENGTH) but a DIFFERENT\n// policy: recall TRUNCATES past the bound (a truncated display label cannot\n// mislead), while the prompt SUPPRESSES (a truncated id could collide with a\n// different connector). Do not \"fix\" this inconsistency — it is deliberate.\nexport function headerConnector(connector: string | undefined): string | undefined {\n return connector !== undefined && connector.length <= CONNECTOR_LABEL_MAX_LENGTH ? connector : undefined;\n}\n\nexport function renderExtractionConversation(\n boundedTurns: readonly BufferTurn[],\n sourceConnector: string | undefined,\n): { conversation: string; renderedConversation: string } {\n const renderedConversation = boundedTurns\n .map((t) => `[${t.extractionContextOnly === true ? `context ${t.role}` : t.role}] ${t.content}`)\n .join(\"\\n\\n\");\n const conversation = sourceConnector === undefined\n ? renderedConversation\n : `Source agent: ${sourceConnector}\\n\\nTool and command instructions in this conversation apply to the ${sourceConnector} agent unless they are clearly universal.\\n\\n${renderedConversation}`;\n return { conversation, renderedConversation };\n}\n\nexport interface ExtractionGroundingContext {\n groundingSource: string;\n assertionSource: string;\n roleAssertionSources?: ExtractionGroundingRoleSources;\n messageTimestamp: Date | undefined;\n sourceConnector?: string;\n scopeClassificationEnabled?: boolean;\n}\n\nexport function applyGroundingWithConnector(\n config: PluginConfig,\n result: ExtractionResult,\n ctx: ExtractionGroundingContext,\n): ExtractionResult {\n const caps = resolvePipelineProcessingCapabilities(config);\n const options = { sourceGrounding: caps.sourceGrounding, anchorTemporalExpressions: caps.delinearize };\n const known = buildKnownConnectors(ctx.sourceConnector);\n // Scope-forcing is decoupled from strip/restore (runs without a trusted\n // connector) but gated on the capability: flag off = byte-identical pre-#2183.\n const scoped = ctx.scopeClassificationEnabled === false\n ? result\n : forceProjectScopeOnAnyQualifier(result, known);\n if (ctx.sourceConnector === undefined) {\n return applyExtractionSourceGrounding(scoped, ctx.groundingSource, ctx.assertionSource, ctx.roleAssertionSources, ctx.messageTimestamp, options);\n }\n const prepared = prepareTrustedConnectorQualifier(scoped, ctx.sourceConnector, known);\n const grounded = applyExtractionSourceGrounding(prepared.result, ctx.groundingSource, ctx.assertionSource, ctx.roleAssertionSources, ctx.messageTimestamp, options);\n return restoreTrustedConnectorQualifier(grounded);\n}\n\nfunction buildKnownConnectors(trusted: string | undefined): Set<string> {\n const known = new Set<string>();\n for (const id of knownConnectorIds()) known.add(id.toLowerCase());\n if (trusted !== undefined) known.add(trusted.toLowerCase());\n return known;\n}\n\n/**\n * Parse a leading agent qualifier from fact text. ONE parser, ONE boundary\n * rule, ONE case policy (case-insensitive), ONE definition of \"agent\" (the name\n * must be a known connector ID). Returns the matched agent and the remaining\n * text, or undefined. Both scope-forcing and strip/restore consume this single\n * result so they can never disagree (#2183 round-11).\n */\nfunction parseLeadingQualifier(content: string, known: ReadonlySet<string>): { agent: string; rest: string } | undefined {\n const lower = content.toLowerCase();\n for (const lead of [\"in \", \"for \"]) {\n if (!lower.startsWith(lead)) continue;\n const m = lower.slice(lead.length).match(/^([a-z0-9][a-z0-9._-]*)\\s*,/u);\n if (m && known.has(m[1])) {\n const consumed = lead.length + m[0].length;\n return { agent: m[1], rest: content.slice(consumed).replace(/^[\\s,.;:]+/u, \"\") };\n }\n }\n const pm = lower.match(/^([a-z0-9][a-z0-9._-]*)'s(?![\\p{L}\\p{N}])/u);\n if (pm && known.has(pm[1])) {\n return { agent: pm[1], rest: content.slice(pm[0].length).replace(/^[\\s,.;:]+/u, \"\") };\n }\n return undefined;\n}\n\n/**\n * Force \"project\" scope on any fact whose content starts with a recognised\n * agent qualifier (a known connector name). A qualifier is evidence the fact is\n * agent-tied; which connector it names does not matter.\n */\nfunction forceProjectScopeOnAnyQualifier(result: ExtractionResult, known: ReadonlySet<string>): ExtractionResult {\n let any = false;\n const facts = result.facts.map((fact) => {\n if (fact.scope === \"project\") return fact;\n if (parseLeadingQualifier(fact.content, known) === undefined) return fact;\n any = true;\n return { ...fact, scope: \"project\" as const };\n });\n return any ? { ...result, facts } : result;\n}\n\nconst RESTORE_KEY = \"_qo\";\n\n/**\n * Strip the TRUSTED connector's qualifier for the grounding pass. Uses the same\n * parseLeadingQualifier as scope-forcing, but only strips when the matched agent\n * IS the trusted connector. Each stripped fact carries its original content\n * positionally for collision-free restore.\n */\nfunction prepareTrustedConnectorQualifier(\n result: ExtractionResult,\n trustedConnector: string,\n known: ReadonlySet<string>,\n): { result: ExtractionResult } {\n const trusted = trustedConnector.toLowerCase();\n const facts = result.facts.map((fact) => {\n const parsed = parseLeadingQualifier(fact.content, known);\n if (parsed === undefined || parsed.agent !== trusted) return fact;\n return { ...fact, content: parsed.rest, [RESTORE_KEY]: fact.content };\n }) as ExtractionResult[\"facts\"];\n return { result: { ...result, facts } };\n}\n\nfunction restoreTrustedConnectorQualifier(grounded: ExtractionResult): ExtractionResult {\n let touched = false;\n const facts = grounded.facts.map((fact) => {\n const record = fact as unknown as Record<string, unknown>;\n const original = record[RESTORE_KEY];\n if (typeof original !== \"string\") return fact;\n touched = true;\n const rest = { ...record };\n delete rest[RESTORE_KEY];\n return { ...rest, content: original } as ExtractionResult[\"facts\"][number];\n });\n return touched ? { ...grounded, facts } : grounded;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAgBO,SAAS,uBAAuB,OAAkD;AACvF,QAAM,eAAe,MAAM,OAAO,CAAC,SAAS,KAAK,0BAA0B,IAAI;AAC/E,QAAM,UAAU,sBAAsB,YAAY;AAClD,MAAI,YAAY,UAAa,CAAC,mBAAmB,OAAO,EAAG,QAAO;AAClE,SAAO,wBAAwB,KAAK,OAAO,IAAI,SAAY;AAC7D;AAMO,SAAS,gBAAgB,WAAmD;AACjF,SAAO,cAAc,UAAa,UAAU,UAAU,6BAA6B,YAAY;AACjG;AAEO,SAAS,6BACd,cACA,iBACwD;AACxD,QAAM,uBAAuB,aAC1B,IAAI,CAAC,MAAM,IAAI,EAAE,0BAA0B,OAAO,WAAW,EAAE,IAAI,KAAK,EAAE,IAAI,KAAK,EAAE,OAAO,EAAE,EAC9F,KAAK,MAAM;AACd,QAAM,eAAe,oBAAoB,SACrC,uBACA,iBAAiB,eAAe;AAAA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,OAAO;AACzB,WAAO,KAAK,WAAW;AACvB,WAAO,EAAE,GAAG,MAAM,SAAS,SAAS;AAAA,EACtC,CAAC;AACD,SAAO,UAAU,EAAE,GAAG,UAAU,MAAM,IAAI;AAC5C;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
StorageManager
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4TGZCYHH.js";
|
|
4
4
|
import {
|
|
5
5
|
serializeMutations
|
|
6
6
|
} from "./chunk-FFAZ2XFU.js";
|
|
@@ -958,4 +958,4 @@ export {
|
|
|
958
958
|
resolveBriefingSaveDir,
|
|
959
959
|
briefingFilename
|
|
960
960
|
};
|
|
961
|
-
//# sourceMappingURL=chunk-
|
|
961
|
+
//# sourceMappingURL=chunk-BIXWNHIL.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-765K3SAT.js";
|
|
4
4
|
import {
|
|
5
5
|
encryptCapsuleFile
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-DQEMWVMT.js";
|
|
7
7
|
import {
|
|
8
8
|
computeTransferOutputRel,
|
|
9
9
|
isTransferPathExcluded
|
|
@@ -109,4 +109,4 @@ async function enforceRetention(outDirAbs, retentionDays) {
|
|
|
109
109
|
export {
|
|
110
110
|
backupMemoryDir
|
|
111
111
|
};
|
|
112
|
-
//# sourceMappingURL=chunk-
|
|
112
|
+
//# sourceMappingURL=chunk-BXLOS5AJ.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-V7IZKJI3.js";
|
|
4
4
|
import {
|
|
5
5
|
AdapterRegistry
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-2QSZNTDO.js";
|
|
7
7
|
import {
|
|
8
8
|
WriteRateLimiter
|
|
9
9
|
} from "./chunk-MKQBXQKU.js";
|
|
@@ -16,10 +16,10 @@ import {
|
|
|
16
16
|
processChatMessage,
|
|
17
17
|
sessionBelongsToPrincipal,
|
|
18
18
|
subscribeChatTranscript
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ATUURSST.js";
|
|
20
20
|
import {
|
|
21
21
|
RelayMissionStoreError
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-SIKCTPRK.js";
|
|
23
23
|
import {
|
|
24
24
|
executeResolution,
|
|
25
25
|
isValidResolutionVerb
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
} from "./chunk-35NN3ZFA.js";
|
|
32
32
|
import {
|
|
33
33
|
validateRequest
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-I5DQ6KZK.js";
|
|
35
35
|
import {
|
|
36
36
|
maybeHandleLifecycleFlush
|
|
37
37
|
} from "./chunk-5IVLTFOV.js";
|
|
@@ -41,12 +41,12 @@ import {
|
|
|
41
41
|
import {
|
|
42
42
|
authorizationProbeNamespaces,
|
|
43
43
|
probeOperationAuthorization
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-J6BYDVPL.js";
|
|
45
45
|
import {
|
|
46
46
|
CorrectionContractError,
|
|
47
47
|
getOperation,
|
|
48
48
|
resolveQueryNamespaceWritablePreflight
|
|
49
|
-
} from "./chunk-
|
|
49
|
+
} from "./chunk-YFQMW2TH.js";
|
|
50
50
|
import {
|
|
51
51
|
isTrustZoneName
|
|
52
52
|
} from "./chunk-JGSKJHF7.js";
|
|
@@ -58,7 +58,7 @@ import {
|
|
|
58
58
|
} from "./chunk-BUE5E2HL.js";
|
|
59
59
|
import {
|
|
60
60
|
isRecallDisclosure
|
|
61
|
-
} from "./chunk-
|
|
61
|
+
} from "./chunk-HXDWZFNP.js";
|
|
62
62
|
import {
|
|
63
63
|
assertOperationAllowed,
|
|
64
64
|
enforceNamespaceAllowList,
|
|
@@ -3218,4 +3218,4 @@ export {
|
|
|
3218
3218
|
MeetingsInputError,
|
|
3219
3219
|
EngramAccessHttpServer
|
|
3220
3220
|
};
|
|
3221
|
-
//# sourceMappingURL=chunk-
|
|
3221
|
+
//# sourceMappingURL=chunk-C4PEMCP4.js.map
|
|
@@ -61,7 +61,7 @@ var ExtractedFactSchema = z.object({
|
|
|
61
61
|
entityRef: z.string().optional().nullable().describe("If about an entity, its normalized name (e.g. person-jane-doe)"),
|
|
62
62
|
promptedByQuestion: z.string().optional().nullable().describe("Optional proactive follow-up question that surfaced this fact."),
|
|
63
63
|
scope: z.enum(["project", "global"]).optional().nullable().describe(
|
|
64
|
-
'Scope classification: "global" for cross-project knowledge (framework bugs, library behavior, API patterns, user preferences,
|
|
64
|
+
'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.'
|
|
65
65
|
),
|
|
66
66
|
quote: z.string().optional().nullable().describe(
|
|
67
67
|
"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)."
|
|
@@ -275,4 +275,4 @@ export {
|
|
|
275
275
|
BehaviorLoopAdjustmentSchema,
|
|
276
276
|
BehaviorLoopPolicyStateSchema
|
|
277
277
|
};
|
|
278
|
-
//# sourceMappingURL=chunk-
|
|
278
|
+
//# sourceMappingURL=chunk-CMQZNEIF.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 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 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\nexport const ExtractionResultSchema = z.object({\n facts: z\n .array(ExtractedFactSchema)\n .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: z\n .array(z.string())\n .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: z\n .array(EntityMentionSchema)\n .describe(\n \"Entities mentioned in the conversation with new facts about them.\",\n ),\n questions: z\n .array(ExtractedQuestionSchema)\n .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 relationships: z\n .array(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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EAAE,OAAO;AACtB,CAAC;","names":[]}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
parseXrayFormat
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MYXWPG5O.js";
|
|
4
4
|
import {
|
|
5
5
|
RECALL_DISCLOSURE_LEVELS,
|
|
6
6
|
isRecallDisclosure
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-HXDWZFNP.js";
|
|
8
8
|
|
|
9
9
|
// src/recall-xray-cli.ts
|
|
10
10
|
function parseXrayDisclosureFlag(value) {
|
|
@@ -50,4 +50,4 @@ export {
|
|
|
50
50
|
parseXrayBudgetFlag,
|
|
51
51
|
parseXrayCliOptions
|
|
52
52
|
};
|
|
53
|
-
//# sourceMappingURL=chunk-
|
|
53
|
+
//# sourceMappingURL=chunk-DMT2RGAZ.js.map
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
looksLikeMechanicalTelemetryTranscript
|
|
3
3
|
} from "./chunk-4RA3C3EV.js";
|
|
4
|
+
import {
|
|
5
|
+
applyGroundingWithConnector,
|
|
6
|
+
headerConnector,
|
|
7
|
+
renderExtractionConversation,
|
|
8
|
+
resolveSourceConnector
|
|
9
|
+
} from "./chunk-B6XHIBIB.js";
|
|
4
10
|
import {
|
|
5
11
|
ConsolidationResultSchema,
|
|
6
12
|
DaySummaryResultSchema,
|
|
@@ -9,7 +15,7 @@ import {
|
|
|
9
15
|
ProactiveExtractionResultSchema,
|
|
10
16
|
ProactiveQuestionsResultSchema,
|
|
11
17
|
buildProfileConsolidationResultSchema
|
|
12
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-CMQZNEIF.js";
|
|
13
19
|
import {
|
|
14
20
|
normalizeReasoningTrace
|
|
15
21
|
} from "./chunk-54V4BZWP.js";
|
|
@@ -23,7 +29,6 @@ import {
|
|
|
23
29
|
LocalLlmClient
|
|
24
30
|
} from "./chunk-ZCPP5OW6.js";
|
|
25
31
|
import {
|
|
26
|
-
applyExtractionSourceGrounding,
|
|
27
32
|
attachExtractionProvenance
|
|
28
33
|
} from "./chunk-YIAA2X3D.js";
|
|
29
34
|
import {
|
|
@@ -477,7 +482,7 @@ var ExtractionEngine = class {
|
|
|
477
482
|
const entityUpdates = (Array.isArray(result.entityUpdates) ? result.entityUpdates : []).map((entity) => this.normalizeEntityUpdate(entity)).filter((entity) => entity !== void 0 && entity.name.length > 0);
|
|
478
483
|
return { items, profileUpdates, entityUpdates };
|
|
479
484
|
}
|
|
480
|
-
async applyProactiveQuestionPass(conversation, base,
|
|
485
|
+
async applyProactiveQuestionPass(conversation, base, ctx, signal) {
|
|
481
486
|
if (!resolvePipelineProcessingCapabilities(this.config).proactiveExtraction) return base;
|
|
482
487
|
const maxAdditional = Math.max(0, Math.floor(this.config.maxProactiveQuestionsPerExtraction));
|
|
483
488
|
if (!shouldRunProactivePass(this.config, maxAdditional, this.shouldUseLocalLlm, this.localLlm)) return base;
|
|
@@ -489,16 +494,11 @@ var ExtractionEngine = class {
|
|
|
489
494
|
base,
|
|
490
495
|
proactive,
|
|
491
496
|
maxAdditional,
|
|
497
|
+
ctx.sourceConnector,
|
|
492
498
|
signal
|
|
493
499
|
);
|
|
494
|
-
const sanitizedAdditions = this.sanitizeExtractionResult(proactiveAdditions, messageTimestamp);
|
|
495
|
-
const groundedAdditions = this.
|
|
496
|
-
sanitizedAdditions,
|
|
497
|
-
groundingSource,
|
|
498
|
-
assertionSource,
|
|
499
|
-
roleAssertionSources,
|
|
500
|
-
messageTimestamp
|
|
501
|
-
);
|
|
500
|
+
const sanitizedAdditions = this.sanitizeExtractionResult(proactiveAdditions, ctx.messageTimestamp);
|
|
501
|
+
const groundedAdditions = applyGroundingWithConnector(this.config, sanitizedAdditions, ctx);
|
|
502
502
|
if (!this.hasExtractionOutputs(groundedAdditions)) return base;
|
|
503
503
|
return this.mergeProactiveExtractionPass(base, groundedAdditions, maxAdditional);
|
|
504
504
|
} catch (err) {
|
|
@@ -609,7 +609,7 @@ var ExtractionEngine = class {
|
|
|
609
609
|
if (!fallbackResult?.questions) return [];
|
|
610
610
|
return fallbackResult.questions.map((q) => normalizeQuestion(q)).filter((q) => q.question.length > 0).filter((q) => !existingQuestionKeys.has(q.question.toLowerCase())).slice(0, maxAdditional);
|
|
611
611
|
}
|
|
612
|
-
async answerProactiveQuestions(conversation, base, proactiveQuestions, maxAdditional, signal) {
|
|
612
|
+
async answerProactiveQuestions(conversation, base, proactiveQuestions, maxAdditional, sourceConnector, signal) {
|
|
613
613
|
const factsPreview = base.facts.slice(0, 8).map((f) => `- (${f.category}) ${f.content}`).join("\n");
|
|
614
614
|
const entitiesPreview = base.entities.slice(0, 8).map((entity) => `- (${entity.type}) ${entity.name}: ${entity.facts.join("; ") || "(no facts)"}`).join("\n");
|
|
615
615
|
const proactivePreview = proactiveQuestions.slice(0, maxAdditional).map((question, index) => `${index + 1}. ${question.question}${question.context ? `
|
|
@@ -626,6 +626,7 @@ var ExtractionEngine = class {
|
|
|
626
626
|
// (chatgpt-codex thread on extraction.ts:1607). Returns "" when the
|
|
627
627
|
// bi-temporal gate is off, keeping the prompt unchanged by default.
|
|
628
628
|
this.eventTimePromptInstruction(),
|
|
629
|
+
headerConnector(sourceConnector) !== void 0 && resolveMemoryLifecycleCapabilities(this.config).extractionScopeClassification ? `Tool, command, or CLI-flag instructions tied to the ${sourceConnector} agent are "project" scope; when you recover one, begin the fact with a leading "In ${sourceConnector}, " clause naming that agent (e.g. "In ${sourceConnector}, use the search tool with a repository path.").` : "",
|
|
629
630
|
"",
|
|
630
631
|
"Base extracted facts (do not repeat):",
|
|
631
632
|
factsPreview || "(none)",
|
|
@@ -829,22 +830,9 @@ var ExtractionEngine = class {
|
|
|
829
830
|
}
|
|
830
831
|
return null;
|
|
831
832
|
}
|
|
832
|
-
|
|
833
|
-
const
|
|
834
|
-
return
|
|
835
|
-
result,
|
|
836
|
-
sourceText,
|
|
837
|
-
assertionSourceText,
|
|
838
|
-
roleAssertionSources,
|
|
839
|
-
messageTimestamp,
|
|
840
|
-
{
|
|
841
|
-
sourceGrounding: capabilities.sourceGrounding,
|
|
842
|
-
anchorTemporalExpressions: capabilities.delinearize
|
|
843
|
-
}
|
|
844
|
-
);
|
|
845
|
-
}
|
|
846
|
-
finalizeExtractionResult(result, turns) {
|
|
847
|
-
return attachExtractionProvenance(result, turns, this.config.provenance);
|
|
833
|
+
finalizeExtractionResult(result, turns, sourceConnector) {
|
|
834
|
+
const provenanced = attachExtractionProvenance(result, turns, this.config.provenance);
|
|
835
|
+
return sourceConnector === void 0 ? provenanced : { ...provenanced, sourceConnector };
|
|
848
836
|
}
|
|
849
837
|
async extract(turns, existingEntities, signal) {
|
|
850
838
|
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
@@ -857,21 +845,20 @@ var ExtractionEngine = class {
|
|
|
857
845
|
...turn,
|
|
858
846
|
content: turn.role === "assistant" ? applyWorkExtractionBoundary(turn.content) : turn.content
|
|
859
847
|
})).filter((turn) => turn.content.trim().length > 0);
|
|
860
|
-
const
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
}).join("\n\n");
|
|
848
|
+
const resolvedConnector = resolveSourceConnector(boundedTurns);
|
|
849
|
+
const sourceConnector = lifecycleCaps.extractionScopeClassification ? resolvedConnector : void 0;
|
|
850
|
+
const { conversation, renderedConversation } = renderExtractionConversation(boundedTurns, headerConnector(sourceConnector));
|
|
864
851
|
const groundingSource = boundedTurns.map((turn) => turn.content).join("\n\n");
|
|
865
852
|
const assertionSource = boundedTurns.filter((turn) => turn.extractionContextOnly !== true).map((turn) => turn.content).join("\n\n");
|
|
866
853
|
const roleAssertionSources = {
|
|
867
854
|
profile: boundedTurns.filter((turn) => turn.role === "user" && turn.extractionContextOnly !== true).map((turn) => turn.content).join("\n\n"),
|
|
868
855
|
identity: boundedTurns.filter((turn) => turn.role === "assistant" && turn.extractionContextOnly !== true).map((turn) => turn.content).join("\n\n")
|
|
869
856
|
};
|
|
870
|
-
if (
|
|
857
|
+
if (renderedConversation.trim().length === 0) {
|
|
871
858
|
log.debug("extraction skipped \u2014 conversation only contained non-memory work-layer context");
|
|
872
859
|
return { facts: [], profileUpdates: [], entities: [], questions: [] };
|
|
873
860
|
}
|
|
874
|
-
if (lifecycleCaps.extractionTelemetryPrefilter && looksLikeMechanicalTelemetryTranscript(
|
|
861
|
+
if (lifecycleCaps.extractionTelemetryPrefilter && looksLikeMechanicalTelemetryTranscript(renderedConversation)) {
|
|
875
862
|
log.debug("extraction skipped \u2014 mechanical action/state telemetry without durable-memory cues");
|
|
876
863
|
return {
|
|
877
864
|
facts: [],
|
|
@@ -882,6 +869,14 @@ var ExtractionEngine = class {
|
|
|
882
869
|
}
|
|
883
870
|
const lastTurnTs = boundedTurns.length > 0 ? new Date(boundedTurns[boundedTurns.length - 1].timestamp) : void 0;
|
|
884
871
|
const messageTimestamp = lastTurnTs && !isNaN(lastTurnTs.getTime()) ? lastTurnTs : void 0;
|
|
872
|
+
const groundingContext = {
|
|
873
|
+
groundingSource,
|
|
874
|
+
assertionSource,
|
|
875
|
+
roleAssertionSources,
|
|
876
|
+
messageTimestamp,
|
|
877
|
+
sourceConnector,
|
|
878
|
+
scopeClassificationEnabled: lifecycleCaps.extractionScopeClassification
|
|
879
|
+
};
|
|
885
880
|
const traceId = crypto.randomUUID();
|
|
886
881
|
const emittedDirectStart = !!(this.shouldUseDirectClient || this.shouldUseLocalLlm);
|
|
887
882
|
if (emittedDirectStart) {
|
|
@@ -908,23 +903,9 @@ var ExtractionEngine = class {
|
|
|
908
903
|
this.emit({ kind: "llm_end", traceId, model: this.config.localLlmModel, operation: "extraction", durationMs });
|
|
909
904
|
log.debug(`extraction: used local LLM \u2014 ${localResult.facts.length} facts, ${localResult.entities.length} entities`);
|
|
910
905
|
const sanitized = this.sanitizeExtractionResult(localResult, messageTimestamp);
|
|
911
|
-
const grounded = this.
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
assertionSource,
|
|
915
|
-
roleAssertionSources,
|
|
916
|
-
messageTimestamp
|
|
917
|
-
);
|
|
918
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
919
|
-
conversation,
|
|
920
|
-
grounded,
|
|
921
|
-
groundingSource,
|
|
922
|
-
assertionSource,
|
|
923
|
-
messageTimestamp,
|
|
924
|
-
roleAssertionSources,
|
|
925
|
-
signal
|
|
926
|
-
);
|
|
927
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
906
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
907
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
908
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
928
909
|
}
|
|
929
910
|
if (!this.config.localLlmFallback) {
|
|
930
911
|
log.warn("extraction: local LLM failed and fallback disabled");
|
|
@@ -970,23 +951,9 @@ var ExtractionEngine = class {
|
|
|
970
951
|
this.emit({ kind: "llm_end", traceId, model: this.config.model, operation: "extraction", durationMs });
|
|
971
952
|
log.debug(`extraction: used direct client (${this.config.model}) \u2014 ${directResult.facts.length} facts, ${directResult.entities.length} entities`);
|
|
972
953
|
const sanitized = this.sanitizeExtractionResult(directResult, messageTimestamp);
|
|
973
|
-
const grounded = this.
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
assertionSource,
|
|
977
|
-
roleAssertionSources,
|
|
978
|
-
messageTimestamp
|
|
979
|
-
);
|
|
980
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
981
|
-
conversation,
|
|
982
|
-
grounded,
|
|
983
|
-
groundingSource,
|
|
984
|
-
assertionSource,
|
|
985
|
-
messageTimestamp,
|
|
986
|
-
roleAssertionSources,
|
|
987
|
-
signal
|
|
988
|
-
);
|
|
989
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
954
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
955
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
956
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
990
957
|
}
|
|
991
958
|
try {
|
|
992
959
|
this.emit({
|
|
@@ -1078,23 +1045,9 @@ var ExtractionEngine = class {
|
|
|
1078
1045
|
);
|
|
1079
1046
|
const normalized = this.normalizeExtractionResultPayload(result);
|
|
1080
1047
|
const sanitized = this.sanitizeExtractionResult(normalized, messageTimestamp);
|
|
1081
|
-
const grounded = this.
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
assertionSource,
|
|
1085
|
-
roleAssertionSources,
|
|
1086
|
-
messageTimestamp
|
|
1087
|
-
);
|
|
1088
|
-
const finalResult = await this.applyProactiveQuestionPass(
|
|
1089
|
-
conversation,
|
|
1090
|
-
grounded,
|
|
1091
|
-
groundingSource,
|
|
1092
|
-
assertionSource,
|
|
1093
|
-
messageTimestamp,
|
|
1094
|
-
roleAssertionSources,
|
|
1095
|
-
signal
|
|
1096
|
-
);
|
|
1097
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns);
|
|
1048
|
+
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
1049
|
+
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
1050
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
1098
1051
|
}
|
|
1099
1052
|
this.emit({
|
|
1100
1053
|
kind: "llm_error",
|
|
@@ -1192,7 +1145,7 @@ Rules:
|
|
|
1192
1145
|
- Add structuredAttributes only for concrete values.
|
|
1193
1146
|
- Include at most five durable relationships.${this.config.provenance?.enabled ? `
|
|
1194
1147
|
- Each fact must include a quote copied verbatim from one contiguous conversation span.` : ""}${lifecycleCaps.extractionScopeClassification ? `
|
|
1195
|
-
- Set each fact scope to "global" for cross-project knowledge or "project" for codebase-specific knowledge.` : ""}
|
|
1148
|
+
- Set each fact scope to "global" for cross-project knowledge or "project" for codebase-specific knowledge. Tool, command, or CLI-flag instructions tied to one agent are "project" (the same tool name can mean different things across agents); when keeping one, begin the fact with a leading "In <agent>," clause naming that agent.` : ""}
|
|
1196
1149
|
${this.eventTimePromptInstruction()}
|
|
1197
1150
|
Return only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:
|
|
1198
1151
|
${EXTRACTION_RESPONSE_SHAPE}
|
|
@@ -1386,8 +1339,8 @@ Rules:
|
|
|
1386
1339
|
|
|
1387
1340
|
Scope classification:
|
|
1388
1341
|
For each fact, set "scope" to one of:
|
|
1389
|
-
- "global" \u2014 knowledge that applies across projects: core framework/library bugs, API behavior patterns, user preferences (editor, language, style),
|
|
1390
|
-
- "project" \u2014 knowledge specific to one codebase: file paths, environment configs, deployment details, project-specific workarounds, team/stakeholder info tied to one project, repo-specific conventions
|
|
1342
|
+
- "global" \u2014 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
|
|
1343
|
+
- "project" \u2014 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 \u2014 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".
|
|
1391
1344
|
When in doubt, prefer "project" \u2014 it is safer to keep knowledge scoped narrowly.` : ""}
|
|
1392
1345
|
Entity creation rules (STRICT):
|
|
1393
1346
|
- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects
|
|
@@ -2482,4 +2435,4 @@ export {
|
|
|
2482
2435
|
shouldEnableLocalExtractionThinking,
|
|
2483
2436
|
ExtractionEngine
|
|
2484
2437
|
};
|
|
2485
|
-
//# sourceMappingURL=chunk-
|
|
2438
|
+
//# sourceMappingURL=chunk-DP7ZV2II.js.map
|