@remnic/core 9.45.5 → 9.46.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 +24 -24
- package/dist/access-authorization-probe.d.ts +10 -10
- package/dist/access-authorization-probe.js +25 -25
- package/dist/access-boundary.d.ts +10 -10
- package/dist/access-boundary.js +24 -24
- package/dist/access-cli.js +73 -71
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +10 -10
- package/dist/access-extraction-force-flush.js +24 -24
- 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-offline-stream.d.ts +10 -10
- package/dist/access-http-query.js +24 -24
- package/dist/access-http.d.ts +10 -10
- package/dist/access-http.js +31 -31
- package/dist/access-identity-continuity-surface.d.ts +8 -8
- package/dist/access-identity-continuity-surface.js +24 -24
- package/dist/access-lcm-surface.d.ts +10 -10
- package/dist/access-lcm-surface.js +24 -24
- package/dist/access-mcp.d.ts +10 -10
- package/dist/access-mcp.js +28 -28
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-CWUDwB4M.d.ts → access-namespace-preflight--H6HwN85.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +24 -24
- package/dist/access-observe-write-surface.d.ts +10 -10
- package/dist/access-observe-write-surface.js +24 -24
- package/dist/access-offline-manifest.d.ts +8 -8
- package/dist/access-operations-batch.js +25 -25
- package/dist/access-operations.d.ts +10 -10
- package/dist/access-operations.js +27 -27
- package/dist/access-recall-concurrency.d.ts +10 -10
- package/dist/access-recall-concurrency.js +24 -24
- package/dist/access-recall-response.d.ts +10 -10
- package/dist/access-recall-response.js +24 -24
- package/dist/access-recall-surface.d.ts +10 -10
- package/dist/access-recall-surface.js +24 -24
- package/dist/access-service-helpers.d.ts +10 -10
- package/dist/{access-service-CNN89xyn.d.ts → access-service-loJadYd7.d.ts} +7 -7
- package/dist/access-service.d.ts +10 -10
- package/dist/access-service.js +24 -24
- 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/ambient-provenance.d.ts +109 -0
- package/dist/ambient-provenance.js +22 -0
- package/dist/ambient-provenance.js.map +1 -0
- package/dist/{auto-sync-UPTUVE4X.js → auto-sync-7O6RP2RT.js} +3 -2
- package/dist/{auto-sync-UPTUVE4X.js.map → auto-sync-7O6RP2RT.js.map} +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 +5 -5
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer-turn-helpers.js +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/{catalog-bctMURhN.d.ts → catalog-Iwbk9h5E.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 +6 -6
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-LEPOP46W.js → chunk-227UFSEQ.js} +4 -4
- package/dist/{chunk-ER7W6H4T.js → chunk-2AD5SXO4.js} +5 -2
- package/dist/chunk-2AD5SXO4.js.map +1 -0
- package/dist/{chunk-CX4ZUMC6.js → chunk-2DSUT7DZ.js} +9 -9
- package/dist/{chunk-DZPFMQZ7.js → chunk-3S63QIFQ.js} +1 -1
- package/dist/chunk-3S63QIFQ.js.map +1 -0
- package/dist/{chunk-DAJPRXBR.js → chunk-47J4EDGR.js} +5 -5
- package/dist/{chunk-QVJPH7SH.js → chunk-5LRDM4R7.js} +40 -40
- package/dist/{chunk-XAGYS7X6.js → chunk-5R6S4DJZ.js} +7 -7
- package/dist/{chunk-QR6G5KF4.js → chunk-5VQPZ4GV.js} +3 -3
- package/dist/{chunk-E5XQIWAL.js → chunk-64BHFFKZ.js} +2 -2
- package/dist/{chunk-GRUYA45P.js → chunk-6H744ZBH.js} +3 -3
- package/dist/{chunk-6ISC4AVB.js → chunk-BDNL34CT.js} +2 -2
- package/dist/{chunk-GQL52GQ5.js → chunk-CDKHKZL5.js} +15 -12
- package/dist/chunk-CDKHKZL5.js.map +1 -0
- package/dist/{chunk-AC5OWJLV.js → chunk-E4FOAENZ.js} +4 -4
- package/dist/{chunk-UW66OZTD.js → chunk-FULKGK7P.js} +2 -2
- package/dist/{chunk-V2TNYF6Q.js → chunk-HJ3SVHUW.js} +3 -3
- package/dist/{chunk-A4IJCD2Z.js → chunk-HXXTXLKA.js} +2 -2
- package/dist/{chunk-FUCYDRE5.js → chunk-IDE5AR5W.js} +11 -11
- package/dist/{chunk-2FSTB6BJ.js → chunk-ILBLZ5Y5.js} +2 -2
- package/dist/chunk-J7T4MX7P.js +131 -0
- package/dist/chunk-J7T4MX7P.js.map +1 -0
- package/dist/{chunk-WZ3TOIDW.js → chunk-JFO5QZ7N.js} +2 -2
- package/dist/{chunk-FR27HBBA.js → chunk-KA47C7BF.js} +2 -2
- package/dist/{chunk-JZH4LWHB.js → chunk-KMWYZTIE.js} +2 -2
- package/dist/{chunk-LPYDOLSM.js → chunk-L7G72WY4.js} +2 -2
- package/dist/{chunk-AMAUBUKY.js → chunk-LI7OE7G6.js} +2 -2
- package/dist/{chunk-MO4HSXHZ.js → chunk-M2INOSTA.js} +2 -2
- package/dist/{chunk-GODSPTOT.js → chunk-M32URQXV.js} +652 -601
- package/dist/chunk-M32URQXV.js.map +1 -0
- package/dist/{chunk-HFPASSFV.js → chunk-P2OTGMTR.js} +2 -2
- package/dist/{chunk-W2V7UESE.js → chunk-PFJXPOD4.js} +2 -2
- package/dist/{chunk-R3KHKU7M.js → chunk-PKCLQ7KM.js} +43 -143
- package/dist/chunk-PKCLQ7KM.js.map +1 -0
- package/dist/chunk-QW27DOHG.js +84 -0
- package/dist/chunk-QW27DOHG.js.map +1 -0
- package/dist/{chunk-QUENPGWZ.js → chunk-RCU25Z66.js} +24 -24
- package/dist/{chunk-QUENPGWZ.js.map → chunk-RCU25Z66.js.map} +1 -1
- package/dist/{chunk-NEF7LR5J.js → chunk-RVPTS4U5.js} +2 -2
- package/dist/{chunk-W3IC7QOY.js → chunk-RVYVMQK4.js} +3 -3
- package/dist/{chunk-GUAL4PQH.js → chunk-ST5IEK3H.js} +2 -2
- package/dist/{chunk-O4KMGRXE.js → chunk-SXWHN7GC.js} +2 -2
- package/dist/{chunk-RNHVVMFN.js → chunk-T6JRMVOV.js} +2 -2
- package/dist/{chunk-5QJQHBLE.js → chunk-U6JGQ37L.js} +2 -2
- package/dist/{chunk-UV72DEZD.js → chunk-UYUYZ4WY.js} +36 -10
- package/dist/chunk-UYUYZ4WY.js.map +1 -0
- package/dist/{chunk-HC3PBX23.js → chunk-V5FE3UAI.js} +2 -2
- package/dist/{chunk-ERZ2R42X.js → chunk-W2ZSNIBP.js} +2 -2
- package/dist/{chunk-3COYXTGM.js → chunk-WHWDBTCJ.js} +2 -2
- package/dist/{chunk-FIK3CQNA.js → chunk-WOC6DXP5.js} +3 -3
- package/dist/{chunk-4FBVAGV3.js → chunk-XBMJ35IP.js} +2 -2
- package/dist/{chunk-GFCVUY6G.js → chunk-YWCOJOUI.js} +2 -2
- package/dist/{chunk-2X2T2UVE.js → chunk-ZDAYWJV6.js} +1 -1
- package/dist/chunk-ZDAYWJV6.js.map +1 -0
- package/dist/{cli-BHBswmUa.d.ts → cli-D_RcqXfZ.d.ts} +5 -5
- package/dist/cli.d.ts +12 -12
- package/dist/cli.js +50 -50
- package/dist/compat/checks.js +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +5 -5
- 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 +5 -5
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +5 -5
- 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/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +7 -7
- 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 +13 -13
- 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 +5 -5
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +8 -8
- package/dist/external-wiki-access.d.ts +10 -10
- package/dist/external-wiki-access.js +25 -25
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +10 -10
- 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-prompt.d.ts +36 -0
- package/dist/extraction-prompt.js +16 -0
- package/dist/extraction-prompt.js.map +1 -0
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction.d.ts +6 -14
- package/dist/extraction.js +9 -7
- 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 +23 -20
- package/dist/index.js +124 -122
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- 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 +5 -5
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +5 -5
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +6 -6
- package/dist/{maintenance-CoRikzIt.d.ts → maintenance-DQrL93Uu.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-snapshot.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 +12 -12
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +5 -5
- 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 +14 -14
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +18 -18
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +10 -10
- package/dist/{orchestrator-BJeq7Pw1.d.ts → orchestrator-LPGegii3.d.ts} +8 -8
- package/dist/orchestrator.d.ts +8 -8
- package/dist/orchestrator.js +73 -71
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CNjY4wk3.d.ts → pipeline-1h2GpiHP.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-C0UDZidt.d.ts → qmd-UdwoF71D.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/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- 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/{scope-profiles-BJzp2F5A.d.ts → scope-profiles-APjhSe-w.d.ts} +1 -1
- package/dist/sdk-compat.js.map +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +5 -5
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +9 -9
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-D4KAZO2G.d.ts → semantic-consolidation-CrySDbk3.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +6 -6
- package/dist/semantic-rule-promotion.js +5 -5
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +5 -5
- package/dist/{service-DWC4tq7p.d.ts → service-DJ0LDyuN.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 +4 -1
- package/dist/source-agent-qualifier.js +6 -6
- package/dist/{storage-DPGjB-8e.d.ts → storage-y340tYKb.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +4 -4
- 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/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-yX_FwERf.d.ts → types-D_Au9qJO.d.ts} +13 -2
- 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 +5 -5
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -12
- package/src/ambient-provenance.test.ts +510 -0
- package/src/ambient-provenance.ts +229 -0
- package/src/buffer-turn-helpers.ts +17 -1
- package/src/compat/checks.test.ts +45 -1
- package/src/compat/checks.ts +16 -16
- package/src/extraction-prompt.ts +142 -0
- package/src/extraction.ts +37 -148
- package/src/meetings/memory-gen.test.ts +51 -0
- package/src/meetings/memory-gen.ts +36 -8
- package/src/meetings/summary-extractor.ts +4 -2
- package/src/orchestration/recall-internal.ts +5 -148
- package/src/orchestration/recall-profile-storage.ts +194 -0
- package/src/orchestration/recall-search-pipeline.ts +13 -182
- package/src/orchestration/recall-search-prefilter.ts +254 -0
- package/src/orchestration/session-context.ts +1 -1
- package/src/orchestrator.ts +1 -1
- package/src/sdk-compat.ts +2 -4
- package/src/source-agent-qualifier.ts +3 -0
- package/src/testing/subjects/recall-profile-storage.test.ts +362 -0
- package/src/testing/subjects/recall-search-prefilter.test.ts +365 -0
- package/src/types.ts +2 -2
- package/src/wearables/memory-gen.test.ts +82 -0
- package/src/wearables/memory-gen.ts +54 -5
- package/src/wearables/trust.ts +19 -2
- package/dist/chunk-2X2T2UVE.js.map +0 -1
- package/dist/chunk-DZPFMQZ7.js.map +0 -1
- package/dist/chunk-ER7W6H4T.js.map +0 -1
- package/dist/chunk-GODSPTOT.js.map +0 -1
- package/dist/chunk-GQL52GQ5.js.map +0 -1
- package/dist/chunk-R3KHKU7M.js.map +0 -1
- package/dist/chunk-UV72DEZD.js.map +0 -1
- package/dist/legacy-hook-compat.d.ts +0 -3
- package/dist/legacy-hook-compat.js +0 -36
- package/dist/legacy-hook-compat.js.map +0 -1
- package/src/legacy-hook-compat.test.ts +0 -20
- package/src/legacy-hook-compat.ts +0 -45
- /package/dist/{chunk-LEPOP46W.js.map → chunk-227UFSEQ.js.map} +0 -0
- /package/dist/{chunk-CX4ZUMC6.js.map → chunk-2DSUT7DZ.js.map} +0 -0
- /package/dist/{chunk-DAJPRXBR.js.map → chunk-47J4EDGR.js.map} +0 -0
- /package/dist/{chunk-QVJPH7SH.js.map → chunk-5LRDM4R7.js.map} +0 -0
- /package/dist/{chunk-XAGYS7X6.js.map → chunk-5R6S4DJZ.js.map} +0 -0
- /package/dist/{chunk-QR6G5KF4.js.map → chunk-5VQPZ4GV.js.map} +0 -0
- /package/dist/{chunk-E5XQIWAL.js.map → chunk-64BHFFKZ.js.map} +0 -0
- /package/dist/{chunk-GRUYA45P.js.map → chunk-6H744ZBH.js.map} +0 -0
- /package/dist/{chunk-6ISC4AVB.js.map → chunk-BDNL34CT.js.map} +0 -0
- /package/dist/{chunk-AC5OWJLV.js.map → chunk-E4FOAENZ.js.map} +0 -0
- /package/dist/{chunk-UW66OZTD.js.map → chunk-FULKGK7P.js.map} +0 -0
- /package/dist/{chunk-V2TNYF6Q.js.map → chunk-HJ3SVHUW.js.map} +0 -0
- /package/dist/{chunk-A4IJCD2Z.js.map → chunk-HXXTXLKA.js.map} +0 -0
- /package/dist/{chunk-FUCYDRE5.js.map → chunk-IDE5AR5W.js.map} +0 -0
- /package/dist/{chunk-2FSTB6BJ.js.map → chunk-ILBLZ5Y5.js.map} +0 -0
- /package/dist/{chunk-WZ3TOIDW.js.map → chunk-JFO5QZ7N.js.map} +0 -0
- /package/dist/{chunk-FR27HBBA.js.map → chunk-KA47C7BF.js.map} +0 -0
- /package/dist/{chunk-JZH4LWHB.js.map → chunk-KMWYZTIE.js.map} +0 -0
- /package/dist/{chunk-LPYDOLSM.js.map → chunk-L7G72WY4.js.map} +0 -0
- /package/dist/{chunk-AMAUBUKY.js.map → chunk-LI7OE7G6.js.map} +0 -0
- /package/dist/{chunk-MO4HSXHZ.js.map → chunk-M2INOSTA.js.map} +0 -0
- /package/dist/{chunk-HFPASSFV.js.map → chunk-P2OTGMTR.js.map} +0 -0
- /package/dist/{chunk-W2V7UESE.js.map → chunk-PFJXPOD4.js.map} +0 -0
- /package/dist/{chunk-NEF7LR5J.js.map → chunk-RVPTS4U5.js.map} +0 -0
- /package/dist/{chunk-W3IC7QOY.js.map → chunk-RVYVMQK4.js.map} +0 -0
- /package/dist/{chunk-GUAL4PQH.js.map → chunk-ST5IEK3H.js.map} +0 -0
- /package/dist/{chunk-O4KMGRXE.js.map → chunk-SXWHN7GC.js.map} +0 -0
- /package/dist/{chunk-RNHVVMFN.js.map → chunk-T6JRMVOV.js.map} +0 -0
- /package/dist/{chunk-5QJQHBLE.js.map → chunk-U6JGQ37L.js.map} +0 -0
- /package/dist/{chunk-HC3PBX23.js.map → chunk-V5FE3UAI.js.map} +0 -0
- /package/dist/{chunk-ERZ2R42X.js.map → chunk-W2ZSNIBP.js.map} +0 -0
- /package/dist/{chunk-3COYXTGM.js.map → chunk-WHWDBTCJ.js.map} +0 -0
- /package/dist/{chunk-FIK3CQNA.js.map → chunk-WOC6DXP5.js.map} +0 -0
- /package/dist/{chunk-4FBVAGV3.js.map → chunk-XBMJ35IP.js.map} +0 -0
- /package/dist/{chunk-GFCVUY6G.js.map → chunk-YWCOJOUI.js.map} +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isRecallDisclosure
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-3S63QIFQ.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeRetrievedMemoryProvenance
|
|
6
6
|
} from "./chunk-I4WBNM3M.js";
|
|
@@ -297,4 +297,4 @@ export {
|
|
|
297
297
|
RecallXrayBuilder,
|
|
298
298
|
summarizeDisclosureTokens
|
|
299
299
|
};
|
|
300
|
-
//# sourceMappingURL=chunk-
|
|
300
|
+
//# sourceMappingURL=chunk-P2OTGMTR.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
listNamespaces
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5VQPZ4GV.js";
|
|
4
4
|
import {
|
|
5
5
|
capabilityAllowsNamespace
|
|
6
6
|
} from "./chunk-MZWSOLMT.js";
|
|
@@ -282,4 +282,4 @@ export {
|
|
|
282
282
|
computeServiceCorpusWatermarks,
|
|
283
283
|
computeServiceCorpusCensus
|
|
284
284
|
};
|
|
285
|
-
//# sourceMappingURL=chunk-
|
|
285
|
+
//# sourceMappingURL=chunk-PFJXPOD4.js.map
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
headerConnector,
|
|
7
7
|
renderExtractionConversation,
|
|
8
8
|
resolveSourceConnector
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ZDAYWJV6.js";
|
|
10
10
|
import {
|
|
11
11
|
ConsolidationResultSchema,
|
|
12
12
|
DaySummaryResultSchema,
|
|
@@ -28,6 +28,12 @@ import {
|
|
|
28
28
|
import {
|
|
29
29
|
LocalLlmClient
|
|
30
30
|
} from "./chunk-L6CQ7WIW.js";
|
|
31
|
+
import {
|
|
32
|
+
EXTRACTION_RESPONSE_PLACEHOLDERS,
|
|
33
|
+
EXTRACTION_RESPONSE_SHAPE,
|
|
34
|
+
buildExtractionInstructions,
|
|
35
|
+
eventTimePromptInstruction
|
|
36
|
+
} from "./chunk-J7T4MX7P.js";
|
|
31
37
|
import {
|
|
32
38
|
attachExtractionProvenance
|
|
33
39
|
} from "./chunk-NK5RGJ65.js";
|
|
@@ -43,6 +49,10 @@ import {
|
|
|
43
49
|
import {
|
|
44
50
|
delinearize
|
|
45
51
|
} from "./chunk-VEWZZM3H.js";
|
|
52
|
+
import {
|
|
53
|
+
AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT,
|
|
54
|
+
clampAmbientCaptureConfidence
|
|
55
|
+
} from "./chunk-QW27DOHG.js";
|
|
46
56
|
import {
|
|
47
57
|
applyWorkExtractionBoundary
|
|
48
58
|
} from "./chunk-EI6V5UXY.js";
|
|
@@ -83,41 +93,6 @@ import {
|
|
|
83
93
|
// src/extraction.ts
|
|
84
94
|
import OpenAI from "openai";
|
|
85
95
|
var PROACTIVE_MIN_CONFIDENCE = 0.8;
|
|
86
|
-
var EXTRACTION_RESPONSE_SHAPE = `{
|
|
87
|
-
"facts": [{
|
|
88
|
-
"category": "<category>",
|
|
89
|
-
"content": "<source-grounded statement>",
|
|
90
|
-
"confidence": 0.0,
|
|
91
|
-
"tags": ["<tag>"],
|
|
92
|
-
"entityRef": "<optional normalized-name>",
|
|
93
|
-
"promptedByQuestion": "<optional source-grounded question>",
|
|
94
|
-
"quote": "<optional exact contiguous source span>",
|
|
95
|
-
"scope": "<optional project-or-global>",
|
|
96
|
-
"structuredAttributes": {"<key>": "<value>"},
|
|
97
|
-
"procedureSteps": [{"order": 1, "intent": "<step>"}, {"order": 2, "intent": "<step>"}],
|
|
98
|
-
"reasoningTrace": {
|
|
99
|
-
"steps": [{"order": 1, "description": "<step>"}, {"order": 2, "description": "<step>"}],
|
|
100
|
-
"finalAnswer": "<answer>",
|
|
101
|
-
"observedOutcome": "<optional outcome>"
|
|
102
|
-
},
|
|
103
|
-
"eventTime": "<optional source temporal expression>"
|
|
104
|
-
}],
|
|
105
|
-
"entities": [{
|
|
106
|
-
"name": "<normalized-name>",
|
|
107
|
-
"type": "<entity-type>",
|
|
108
|
-
"facts": ["<source-grounded statement>"],
|
|
109
|
-
"promptedByQuestion": "<optional source-grounded question>",
|
|
110
|
-
"structuredSections": [{"key": "<section-key>", "title": "<section-title>", "facts": ["<source-grounded statement>"]}]
|
|
111
|
-
}],
|
|
112
|
-
"profileUpdates": ["<source-grounded profile update>"],
|
|
113
|
-
"questions": [{"question": "<source-grounded unresolved question>", "context": "<source-grounded context>", "priority": 0.0}],
|
|
114
|
-
"identityReflection": "<conversation-grounded agent reflection>",
|
|
115
|
-
"relationships": [{"source": "<normalized-name>", "target": "<normalized-name>", "label": "<source-grounded relationship>"}]
|
|
116
|
-
}`;
|
|
117
|
-
var EXTRACTION_RESPONSE_PLACEHOLDERS = {};
|
|
118
|
-
for (const placeholder of EXTRACTION_RESPONSE_SHAPE.match(/<[^<>\r\n]+>/g) ?? []) {
|
|
119
|
-
EXTRACTION_RESPONSE_PLACEHOLDERS[placeholder] = true;
|
|
120
|
-
}
|
|
121
96
|
var CONSOLIDATION_RESPONSE_SCHEMA = `{
|
|
122
97
|
"items": [
|
|
123
98
|
{
|
|
@@ -487,14 +462,16 @@ var ExtractionEngine = class {
|
|
|
487
462
|
const maxAdditional = Math.max(0, Math.floor(this.config.maxProactiveQuestionsPerExtraction));
|
|
488
463
|
if (!shouldRunProactivePass(this.config, maxAdditional, this.shouldUseLocalLlm, this.localLlm)) return base;
|
|
489
464
|
try {
|
|
490
|
-
const proactive = await this.generateProactiveQuestions(conversation, base, maxAdditional, signal);
|
|
465
|
+
const proactive = await this.generateProactiveQuestions(conversation, base, maxAdditional, ctx.ambientCapture === true, signal);
|
|
491
466
|
if (proactive.length === 0) return base;
|
|
467
|
+
const ambient = ctx.ambientCapture === true;
|
|
492
468
|
const proactiveAdditions = await this.answerProactiveQuestions(
|
|
493
469
|
conversation,
|
|
494
470
|
base,
|
|
495
471
|
proactive,
|
|
496
472
|
maxAdditional,
|
|
497
473
|
ctx.sourceConnector,
|
|
474
|
+
ambient,
|
|
498
475
|
signal
|
|
499
476
|
);
|
|
500
477
|
const sanitizedAdditions = this.sanitizeExtractionResult(proactiveAdditions, ctx.messageTimestamp);
|
|
@@ -531,7 +508,7 @@ var ExtractionEngine = class {
|
|
|
531
508
|
}
|
|
532
509
|
return null;
|
|
533
510
|
}
|
|
534
|
-
async generateProactiveQuestions(conversation, base, maxAdditional, signal) {
|
|
511
|
+
async generateProactiveQuestions(conversation, base, maxAdditional, ambientCapture, signal) {
|
|
535
512
|
const existingQuestionKeys = new Set(
|
|
536
513
|
(base.questions ?? []).map((q) => q.question.trim().toLowerCase()).filter((q) => q.length > 0)
|
|
537
514
|
);
|
|
@@ -539,7 +516,7 @@ var ExtractionEngine = class {
|
|
|
539
516
|
const existingQuestionsPreview = (base.questions ?? []).slice(0, 8).map((q) => `- ${q.question}`).join("\n");
|
|
540
517
|
const prompt = [
|
|
541
518
|
"You are doing a proactive second-pass memory extraction.",
|
|
542
|
-
`Generate up to ${maxAdditional} additional high-value follow-up questions not already covered
|
|
519
|
+
`Generate up to ${maxAdditional} additional high-value follow-up questions not already covered.${ambientCapture ? AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT : ""}`,
|
|
543
520
|
"Return only valid JSON with this shape:",
|
|
544
521
|
'{"questions":[{"question":"...","context":"...","priority":0.0}]}',
|
|
545
522
|
"",
|
|
@@ -609,7 +586,7 @@ var ExtractionEngine = class {
|
|
|
609
586
|
if (!fallbackResult?.questions) return [];
|
|
610
587
|
return fallbackResult.questions.map((q) => normalizeQuestion(q)).filter((q) => q.question.length > 0).filter((q) => !existingQuestionKeys.has(q.question.toLowerCase())).slice(0, maxAdditional);
|
|
611
588
|
}
|
|
612
|
-
async answerProactiveQuestions(conversation, base, proactiveQuestions, maxAdditional, sourceConnector, signal) {
|
|
589
|
+
async answerProactiveQuestions(conversation, base, proactiveQuestions, maxAdditional, sourceConnector, ambientCapture, signal) {
|
|
613
590
|
const factsPreview = base.facts.slice(0, 8).map((f) => `- (${f.category}) ${f.content}`).join("\n");
|
|
614
591
|
const entitiesPreview = base.entities.slice(0, 8).map((entity) => `- (${entity.type}) ${entity.name}: ${entity.facts.join("; ") || "(no facts)"}`).join("\n");
|
|
615
592
|
const proactivePreview = proactiveQuestions.slice(0, maxAdditional).map((question, index) => `${index + 1}. ${question.question}${question.context ? `
|
|
@@ -617,7 +594,7 @@ var ExtractionEngine = class {
|
|
|
617
594
|
const prompt = [
|
|
618
595
|
"You are answering proactive memory follow-up questions using only the provided buffered conversation.",
|
|
619
596
|
`Return at most ${maxAdditional} additional high-confidence memory candidates that were omitted from the base extraction.`,
|
|
620
|
-
|
|
597
|
+
`Only include information directly supported by the conversation. Do not speculate. Do not repeat the base extraction.${ambientCapture ? AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT : ""}`,
|
|
621
598
|
"Return only valid JSON with this shape:",
|
|
622
599
|
'{"facts":[{"category":"fact","content":"...","confidence":0.0,"tags":["..."],"entityRef":"optional","promptedByQuestion":"optional","quote":"optional verbatim span from a single turn"}],"profileUpdates":["..."],"entities":[{"name":"...","type":"person","facts":["..."],"structuredSections":[{"key":"beliefs","title":"Beliefs","facts":["..."]}],"promptedByQuestion":"optional"}],"relationships":[{"source":"...","target":"...","label":"...","promptedByQuestion":"optional"}]}',
|
|
623
600
|
this.config.provenance?.enabled ? '- Source quotes: For each fact, include a "quote" field with the EXACT verbatim words from the conversation that support the fact (a contiguous span from a single turn, not a paraphrase). Cap at ~300 chars.' : "",
|
|
@@ -625,7 +602,7 @@ var ExtractionEngine = class {
|
|
|
625
602
|
// paths so proactive-recovered facts also carry an optional eventTime
|
|
626
603
|
// (chatgpt-codex thread on extraction.ts:1607). Returns "" when the
|
|
627
604
|
// bi-temporal gate is off, keeping the prompt unchanged by default.
|
|
628
|
-
this.
|
|
605
|
+
eventTimePromptInstruction(this.config),
|
|
629
606
|
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.").` : "",
|
|
630
607
|
"",
|
|
631
608
|
"Base extracted facts (do not repeat):",
|
|
@@ -830,8 +807,14 @@ var ExtractionEngine = class {
|
|
|
830
807
|
}
|
|
831
808
|
return null;
|
|
832
809
|
}
|
|
833
|
-
|
|
834
|
-
|
|
810
|
+
/**
|
|
811
|
+
* The one funnel every successful extraction path returns through — local
|
|
812
|
+
* LLM, direct client, and gateway fallback alike. The ambient clamp lives
|
|
813
|
+
* here so a new path cannot bypass it (issue #2294).
|
|
814
|
+
*/
|
|
815
|
+
finalizeExtractionResult(result, turns, sourceConnector, ambientCapture = false) {
|
|
816
|
+
const clamped = ambientCapture ? clampAmbientCaptureConfidence(result) : result;
|
|
817
|
+
const provenanced = attachExtractionProvenance(clamped, turns, this.config.provenance);
|
|
835
818
|
return sourceConnector === void 0 ? provenanced : { ...provenanced, sourceConnector };
|
|
836
819
|
}
|
|
837
820
|
async extract(turns, existingEntities, signal) {
|
|
@@ -846,6 +829,9 @@ var ExtractionEngine = class {
|
|
|
846
829
|
content: turn.role === "assistant" ? applyWorkExtractionBoundary(turn.content) : turn.content
|
|
847
830
|
})).filter((turn) => turn.content.trim().length > 0);
|
|
848
831
|
const resolvedConnector = resolveSourceConnector(boundedTurns);
|
|
832
|
+
const ambientCapture = boundedTurns.some(
|
|
833
|
+
(turn) => turn.ambientCapture === true && turn.extractionContextOnly !== true
|
|
834
|
+
);
|
|
849
835
|
const sourceConnector = lifecycleCaps.extractionScopeClassification ? resolvedConnector : void 0;
|
|
850
836
|
const { conversation, renderedConversation } = renderExtractionConversation(boundedTurns, headerConnector(sourceConnector));
|
|
851
837
|
const groundingSource = boundedTurns.map((turn) => turn.content).join("\n\n");
|
|
@@ -882,6 +868,7 @@ var ExtractionEngine = class {
|
|
|
882
868
|
roleAssertionSources,
|
|
883
869
|
messageTimestamp,
|
|
884
870
|
sourceConnector,
|
|
871
|
+
ambientCapture,
|
|
885
872
|
scopeClassificationEnabled: lifecycleCaps.extractionScopeClassification
|
|
886
873
|
};
|
|
887
874
|
const traceId = crypto.randomUUID();
|
|
@@ -902,7 +889,7 @@ var ExtractionEngine = class {
|
|
|
902
889
|
this.profiler.startSpan("local-llm", extractionTraceId);
|
|
903
890
|
primaryExtractorAttempted = true;
|
|
904
891
|
try {
|
|
905
|
-
const localResult = await this.extractWithLocalLlm(conversation, existingEntities, signal);
|
|
892
|
+
const localResult = await this.extractWithLocalLlm(conversation, existingEntities, signal, ambientCapture);
|
|
906
893
|
throwIfExtractionAborted(signal);
|
|
907
894
|
if (localResult) {
|
|
908
895
|
const durationMs = Date.now() - startTime;
|
|
@@ -912,7 +899,7 @@ var ExtractionEngine = class {
|
|
|
912
899
|
const sanitized = this.sanitizeExtractionResult(localResult, messageTimestamp);
|
|
913
900
|
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
914
901
|
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
915
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
902
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector, ambientCapture);
|
|
916
903
|
}
|
|
917
904
|
if (!this.config.localLlmFallback) {
|
|
918
905
|
log.warn("extraction: local LLM failed and fallback disabled");
|
|
@@ -951,7 +938,7 @@ var ExtractionEngine = class {
|
|
|
951
938
|
this.profiler.startSpan("direct-client", extractionTraceId);
|
|
952
939
|
primaryExtractorAttempted = true;
|
|
953
940
|
try {
|
|
954
|
-
const directResult = await this.extractWithDirectClient(conversation, existingEntities, signal);
|
|
941
|
+
const directResult = await this.extractWithDirectClient(conversation, existingEntities, signal, ambientCapture);
|
|
955
942
|
if (directResult) {
|
|
956
943
|
const durationMs = Date.now() - startTime;
|
|
957
944
|
this.profiler.endSpan("direct-client", extractionTraceId);
|
|
@@ -960,7 +947,7 @@ var ExtractionEngine = class {
|
|
|
960
947
|
const sanitized = this.sanitizeExtractionResult(directResult, messageTimestamp);
|
|
961
948
|
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
962
949
|
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
963
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
950
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector, ambientCapture);
|
|
964
951
|
}
|
|
965
952
|
try {
|
|
966
953
|
this.emit({
|
|
@@ -1022,7 +1009,7 @@ var ExtractionEngine = class {
|
|
|
1022
1009
|
this.profiler.startSpan("gateway-fallback", extractionTraceId);
|
|
1023
1010
|
try {
|
|
1024
1011
|
const messages = [
|
|
1025
|
-
{ role: "system", content: this.
|
|
1012
|
+
{ role: "system", content: buildExtractionInstructions(this.config, existingEntities, ambientCapture) },
|
|
1026
1013
|
{ role: "user", content: conversation }
|
|
1027
1014
|
];
|
|
1028
1015
|
this.emit({ kind: "llm_start", traceId: fallbackTraceId, model: "fallback", operation: "extraction", input: conversation });
|
|
@@ -1054,7 +1041,7 @@ var ExtractionEngine = class {
|
|
|
1054
1041
|
const sanitized = this.sanitizeExtractionResult(normalized, messageTimestamp);
|
|
1055
1042
|
const grounded = applyGroundingWithConnector(this.config, sanitized, groundingContext);
|
|
1056
1043
|
const finalResult = await this.applyProactiveQuestionPass(conversation, grounded, groundingContext, signal);
|
|
1057
|
-
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector);
|
|
1044
|
+
return this.finalizeExtractionResult(finalResult, boundedTurns, resolvedConnector, ambientCapture);
|
|
1058
1045
|
}
|
|
1059
1046
|
this.emit({
|
|
1060
1047
|
kind: "llm_error",
|
|
@@ -1112,7 +1099,7 @@ var ExtractionEngine = class {
|
|
|
1112
1099
|
* Extract memories using local LLM with JSON mode.
|
|
1113
1100
|
* Uses a minimal prompt to fit within local model context limits (typically 4k-8k).
|
|
1114
1101
|
*/
|
|
1115
|
-
async extractWithLocalLlm(conversation, existingEntities, signal) {
|
|
1102
|
+
async extractWithLocalLlm(conversation, existingEntities, signal, ambientCapture = false) {
|
|
1116
1103
|
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
1117
1104
|
log.debug(
|
|
1118
1105
|
`extractWithLocalLlm: starting extraction, localLlmEnabled=${this.shouldUseLocalLlm}, model=${this.config.localLlmModel}`
|
|
@@ -1152,8 +1139,8 @@ Rules:
|
|
|
1152
1139
|
- Add structuredAttributes only for concrete values.
|
|
1153
1140
|
- Include at most five durable relationships.${this.config.provenance?.enabled ? `
|
|
1154
1141
|
- Each fact must include a quote copied verbatim from one contiguous conversation span.` : ""}${lifecycleCaps.extractionScopeClassification ? `
|
|
1155
|
-
- 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.` : ""}
|
|
1156
|
-
${this.
|
|
1142
|
+
- 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.` : ""}${ambientCapture ? AMBIENT_CAPTURE_PROMPT_SECTION_COMPACT : ""}
|
|
1143
|
+
${eventTimePromptInstruction(this.config)}
|
|
1157
1144
|
Return only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:
|
|
1158
1145
|
${EXTRACTION_RESPONSE_SHAPE}
|
|
1159
1146
|
|
|
@@ -1211,7 +1198,7 @@ ${truncatedConversation}`;
|
|
|
1211
1198
|
* Extract memories using direct OpenAI-compatible client (Chat Completions API).
|
|
1212
1199
|
* Works with Scryr, OpenRouter, and other OpenAI-compatible endpoints.
|
|
1213
1200
|
*/
|
|
1214
|
-
async extractWithDirectClient(conversation, existingEntities, signal) {
|
|
1201
|
+
async extractWithDirectClient(conversation, existingEntities, signal, ambientCapture = false) {
|
|
1215
1202
|
if (!this.client) return null;
|
|
1216
1203
|
const tokenParams = buildChatCompletionTokenLimit(this.config.model, this.config.extractionMaxOutputTokens, {
|
|
1217
1204
|
assumeOpenAI: this.directClientUsesOpenAiTokenSemantics()
|
|
@@ -1223,7 +1210,7 @@ ${truncatedConversation}`;
|
|
|
1223
1210
|
messages: [
|
|
1224
1211
|
{
|
|
1225
1212
|
role: "system",
|
|
1226
|
-
content: this.
|
|
1213
|
+
content: buildExtractionInstructions(this.config, existingEntities, ambientCapture) + `
|
|
1227
1214
|
|
|
1228
1215
|
Return only valid JSON matching this shape. Placeholder text describes field shape only and is never source evidence:
|
|
1229
1216
|
${EXTRACTION_RESPONSE_SHAPE}`
|
|
@@ -1286,93 +1273,6 @@ ${EXTRACTION_RESPONSE_SHAPE}`
|
|
|
1286
1273
|
}
|
|
1287
1274
|
return this.normalizeExtractionResultPayload({ facts, entities, profileUpdates: [], questions: [] });
|
|
1288
1275
|
}
|
|
1289
|
-
/**
|
|
1290
|
-
* Bi-temporal event-time extraction instruction (#1578 PR2). Emitted on
|
|
1291
|
-
* every extraction entry path when `temporal.biTemporal` is on so the LLM
|
|
1292
|
-
* emits an optional per-fact `eventTime` expression. The expression is
|
|
1293
|
-
* resolved against the source turn timestamp at write time — never
|
|
1294
|
-
* wall-clock — so replay/import of old transcripts anchors correctly.
|
|
1295
|
-
* Returns an empty string when the gate is off (byte-identical prompt).
|
|
1296
|
-
*/
|
|
1297
|
-
eventTimePromptInstruction() {
|
|
1298
|
-
if (!this.config.temporalBiTemporal) return "";
|
|
1299
|
-
return `
|
|
1300
|
-
When a fact states when it became or stopped being true, copy that explicit temporal expression verbatim into "eventTime". Omit "eventTime" when no such expression appears; never infer dates.`;
|
|
1301
|
-
}
|
|
1302
|
-
/**
|
|
1303
|
-
* Build extraction instructions shared between local and cloud LLM.
|
|
1304
|
-
*/
|
|
1305
|
-
buildExtractionInstructions(existingEntities) {
|
|
1306
|
-
const lifecycleCaps = resolveMemoryLifecycleCapabilities(this.config);
|
|
1307
|
-
return `You are a memory extraction system. Analyze the following conversation and extract durable, reusable memories.
|
|
1308
|
-
|
|
1309
|
-
Memory categories:
|
|
1310
|
-
- fact: Objective information about the world
|
|
1311
|
-
- preference: User likes, dislikes, or stylistic choices
|
|
1312
|
-
- correction: User correcting a mistake or misconception (highest priority)
|
|
1313
|
-
- entity: Information about a specific person, project, tool, or company
|
|
1314
|
-
- decision: A choice that was made with rationale
|
|
1315
|
-
- relationship: How two entities relate to each other (e.g., "Alice is Bob's manager", "Acme Corp uses Shopify")
|
|
1316
|
-
- principle: Durable rules, values, or operating beliefs (e.g., "never use Chat Completions API")
|
|
1317
|
-
- commitment: Promises, obligations, or deadlines (e.g., "deploy by Friday", "call accountant Monday")
|
|
1318
|
-
- moment: Emotionally significant events or milestones (e.g., "first successful deployment of engram")
|
|
1319
|
-
- skill: Capabilities the user or agent has demonstrated (e.g., "user is proficient with Kubernetes")${resolveRecallAuxiliaryCapabilities(this.config).causalRuleExtraction ? `
|
|
1320
|
-
- 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")` : ""}
|
|
1321
|
-
- 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\u2026", "Whenever you ship a release\u2026"). Add "procedureSteps": an array of at least two objects {"order": number, "intent": "concrete step description"} in execution order. Optional per-step "toolCall": {"kind": "\u2026", "signature": "\u2026"}, "expectedOutcome", "optional": true.
|
|
1322
|
-
- 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\u2026, then I\u2026, finally I\u2026"). 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"}, \u2026], "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 \u2014 not for ordinary decisions (use "decision") or reusable workflows (use "procedure").
|
|
1323
|
-
|
|
1324
|
-
Rules:
|
|
1325
|
-
- Only extract genuinely new information worth remembering across sessions.
|
|
1326
|
-
- Statements must be grounded in the conversation.
|
|
1327
|
-
- Do not treat instruction text, schema placeholders, or examples as conversation evidence.
|
|
1328
|
-
- 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.
|
|
1329
|
-
- Skip transient task details and operational noise, including routine scheduler, monitoring, or automation status.
|
|
1330
|
-
- Priority: corrections > principles${resolveRecallAuxiliaryCapabilities(this.config).causalRuleExtraction ? " > rules" : ""} > preferences > commitments > decisions > relationships > entities > moments > skills > facts
|
|
1331
|
-
- Corrections get highest confidence.
|
|
1332
|
-
- Each fact should be a standalone, self-contained statement.
|
|
1333
|
-
- Entity references should use normalized names (lowercase, hyphenated: "jane-doe", "acme-corp")
|
|
1334
|
-
- 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.
|
|
1335
|
-
- Avoid creating entities typed as "other" when a more specific type fits (company, project, tool, person, place)
|
|
1336
|
-
- 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.
|
|
1337
|
-
- Tags should be concise and reusable (e.g., "coding-style", "personal", "tools")
|
|
1338
|
-
- 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.
|
|
1339
|
-
- Set confidence using these tiers:
|
|
1340
|
-
* Explicit (0.95-1.0): Direct user statements \u2014 "I prefer X", "my name is Y"
|
|
1341
|
-
* Implied (0.70-0.94): Strong contextual inference \u2014 user consistently does X, clear from conversation flow
|
|
1342
|
-
* Inferred (0.40-0.69): Pattern recognition \u2014 reasonable guess from limited evidence
|
|
1343
|
-
* Speculative (0.00-0.39): Tentative hypothesis \u2014 weak signal, needs future confirmation. Speculative memories auto-expire after 30 days if not confirmed.${this.config.provenance?.enabled ? `
|
|
1344
|
-
- 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.` : ""}
|
|
1345
|
-
- For commitments: include any deadline or timeframe mentioned${lifecycleCaps.extractionScopeClassification ? `
|
|
1346
|
-
|
|
1347
|
-
Scope classification:
|
|
1348
|
-
For each fact, set "scope" to one of:
|
|
1349
|
-
- "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
|
|
1350
|
-
- "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".
|
|
1351
|
-
When in doubt, prefer "project" \u2014 it is safer to keep knowledge scoped narrowly.` : ""}
|
|
1352
|
-
Entity creation rules (STRICT):
|
|
1353
|
-
- Only create entities for DURABLE things: real people, companies, products, tools, ongoing projects
|
|
1354
|
-
- NEVER create entities for transient items: individual PRs, branches, Jira tickets, meetings, agent task IDs, log files, database tables, cron job runs, sessions
|
|
1355
|
-
- 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 \u2014 do NOT create an entity for the PR itself
|
|
1356
|
-
- 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"
|
|
1357
|
-
- The entity list should be SHORT \u2014 think "things that would have their own Wikipedia page" not "things mentioned in passing"
|
|
1358
|
-
|
|
1359
|
-
${existingEntities && existingEntities.length > 0 ? `
|
|
1360
|
-
KNOWN ENTITIES (use these exact names when referencing existing things):
|
|
1361
|
-
${existingEntities.join(", ")}
|
|
1362
|
-
|
|
1363
|
-
When you see something that matches a known entity, use THAT name exactly. Only create a NEW entity if nothing in this list represents it.
|
|
1364
|
-
` : ""}
|
|
1365
|
-
${this.eventTimePromptInstruction()}
|
|
1366
|
-
Also extract relationships between entities mentioned in the conversation.
|
|
1367
|
-
- Format: {source: "entity-name", target: "entity-name", label: "relationship description"}
|
|
1368
|
-
- Max 5 relationships per extraction
|
|
1369
|
-
- Only include clear, durable relationships (e.g., "works at", "created", "manages", "uses")
|
|
1370
|
-
- Use normalized entity names (e.g., "person-jane-doe", "company-acme-corp")
|
|
1371
|
-
|
|
1372
|
-
Questions are optional. Include only source-grounded unresolved questions that would be useful in future sessions; otherwise return an empty array.
|
|
1373
|
-
|
|
1374
|
-
Finally, write a brief identity reflection about the agent who had this conversation, based only on the conversation. Do not write about the extraction process.`;
|
|
1375
|
-
}
|
|
1376
1276
|
async consolidate(newMemories, existingMemories, currentProfile) {
|
|
1377
1277
|
const newList = newMemories.map(
|
|
1378
1278
|
(m) => `[${m.frontmatter.id}] (${m.frontmatter.category}) ${m.content}`
|
|
@@ -2442,4 +2342,4 @@ export {
|
|
|
2442
2342
|
shouldEnableLocalExtractionThinking,
|
|
2443
2343
|
ExtractionEngine
|
|
2444
2344
|
};
|
|
2445
|
-
//# sourceMappingURL=chunk-
|
|
2345
|
+
//# sourceMappingURL=chunk-PKCLQ7KM.js.map
|