@remnic/core 9.3.712 → 9.3.714
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-boundary.d.ts +6 -6
- package/dist/access-boundary.js +17 -16
- package/dist/access-cli.js +40 -39
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +5 -5
- package/dist/access-http.js +24 -23
- package/dist/access-mcp.d.ts +18 -5
- package/dist/access-mcp.js +21 -20
- package/dist/access-operations-batch.js +18 -17
- package/dist/access-operations.d.ts +6 -5
- package/dist/access-operations.js +20 -19
- package/dist/access-schema.d.ts +10 -0
- package/dist/access-schema.js +1 -1
- package/dist/{access-service-Dx2rSJjH.d.ts → access-service-lddjZoRh.d.ts} +20 -5
- package/dist/access-service.d.ts +5 -5
- package/dist/access-service.js +16 -15
- package/dist/access-surface-catalog.d.ts +5 -5
- package/dist/access-surface-catalog.js +6 -1
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +3 -1
- package/dist/active-memory-bridge.js +2 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -3
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +4 -4
- package/dist/briefing.d.ts +1 -1
- package/dist/briefing.js +8 -7
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +1 -1
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-CadPvH29.d.ts → catalog-CbR0CsUw.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 +9 -8
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/{chunk-OMSTU233.js → chunk-2KAYTPPT.js} +4 -4
- package/dist/{chunk-VYZNWH4J.js → chunk-2SXMCQEQ.js} +3 -3
- package/dist/{chunk-NXL5CVE7.js → chunk-2Y6LMOQQ.js} +2 -2
- package/dist/{chunk-AMXOCZHE.js → chunk-3VUPWDSE.js} +15 -3
- package/dist/{chunk-AMXOCZHE.js.map → chunk-3VUPWDSE.js.map} +1 -1
- package/dist/{chunk-FVQJYWH7.js → chunk-5GKPFL3S.js} +1 -1
- package/dist/{chunk-FVQJYWH7.js.map → chunk-5GKPFL3S.js.map} +1 -1
- package/dist/{chunk-LQ4J7ELC.js → chunk-67HG7KFE.js} +2 -2
- package/dist/{chunk-ZBG4K36I.js → chunk-6FUJ2VYY.js} +3 -3
- package/dist/{chunk-GMRNKPWO.js → chunk-6QUPUTT7.js} +2 -2
- package/dist/{chunk-Z56IHRVV.js → chunk-6UU43ZGD.js} +2 -2
- package/dist/{chunk-APJQ6UEA.js → chunk-AGNBY3VG.js} +4 -4
- package/dist/{chunk-OWOKOFXK.js → chunk-AJOIM6UR.js} +2 -2
- package/dist/{chunk-JBPKEARU.js → chunk-AU7Q3LSC.js} +4 -4
- package/dist/{chunk-YVWZW37D.js → chunk-BNOAB5HH.js} +62 -12
- package/dist/{chunk-YVWZW37D.js.map → chunk-BNOAB5HH.js.map} +1 -1
- package/dist/{chunk-A2R5NV6O.js → chunk-CTAHKIG6.js} +205 -29
- package/dist/chunk-CTAHKIG6.js.map +1 -0
- package/dist/{chunk-K22IJO4R.js → chunk-CTOQEZSN.js} +2 -2
- package/dist/{chunk-SINGJCUR.js → chunk-CX77GNMB.js} +14 -3
- package/dist/chunk-CX77GNMB.js.map +1 -0
- package/dist/{chunk-HSDJCT3V.js → chunk-DXGS5YOQ.js} +3 -3
- package/dist/{chunk-HV57RHMD.js → chunk-EH5ED3C6.js} +2 -2
- package/dist/{chunk-NUWZFSKC.js → chunk-FVZ2ISIX.js} +9 -1
- package/dist/chunk-FVZ2ISIX.js.map +1 -0
- package/dist/{chunk-GKPIY7EQ.js → chunk-FXZKXW7C.js} +117 -46
- package/dist/chunk-FXZKXW7C.js.map +1 -0
- package/dist/{chunk-7NDYFAJS.js → chunk-GM3BMWKR.js} +2 -2
- package/dist/{chunk-ZVDRL6SK.js → chunk-HHLWSWWF.js} +2 -2
- package/dist/chunk-HHLWSWWF.js.map +1 -0
- package/dist/{chunk-5QUS24F7.js → chunk-I56LKMF7.js} +2 -2
- package/dist/{chunk-Z3B2YW56.js → chunk-IHMT6XTY.js} +9 -5
- package/dist/chunk-IHMT6XTY.js.map +1 -0
- package/dist/chunk-JAKIDQB2.js +173 -0
- package/dist/chunk-JAKIDQB2.js.map +1 -0
- package/dist/{chunk-35YJ6KCV.js → chunk-JEIROMLX.js} +2 -2
- package/dist/{chunk-SKQCFAYU.js → chunk-JVEMUX6L.js} +2 -2
- package/dist/{chunk-CXMXAC5R.js → chunk-K44MIN6D.js} +3 -3
- package/dist/{chunk-5KQCOIPW.js → chunk-MECU6WSH.js} +188 -31
- package/dist/chunk-MECU6WSH.js.map +1 -0
- package/dist/{chunk-BQCFXAMN.js → chunk-MPHDVHIB.js} +2 -2
- package/dist/{chunk-BOGENF7P.js → chunk-MSVSP5VO.js} +1 -1
- package/dist/chunk-MSVSP5VO.js.map +1 -0
- package/dist/{chunk-QXNFQKWU.js → chunk-MTHNJCOJ.js} +2 -2
- package/dist/{chunk-3TCRU4JA.js → chunk-O62P2LFL.js} +2 -2
- package/dist/{chunk-JSDZMOT7.js → chunk-OC56UWV5.js} +11 -11
- package/dist/{chunk-7IBEWQLG.js → chunk-QOIONSOI.js} +2 -2
- package/dist/{chunk-4P5UAL3C.js → chunk-RBHANGVX.js} +6 -6
- package/dist/{chunk-SK2CR6MW.js → chunk-RVLB4E6N.js} +2 -2
- package/dist/{chunk-I3BT2IDW.js → chunk-SYDHFFAW.js} +1110 -28
- package/dist/chunk-SYDHFFAW.js.map +1 -0
- package/dist/{chunk-VILEUJXC.js → chunk-UC4YOAC2.js} +74 -2
- package/dist/{chunk-VILEUJXC.js.map → chunk-UC4YOAC2.js.map} +1 -1
- package/dist/{chunk-CNVIWMQI.js → chunk-UY4JMEAK.js} +2 -2
- package/dist/{chunk-S6FQLQGH.js → chunk-V7GDTQ6I.js} +2 -2
- package/dist/{chunk-JNOYYWCA.js → chunk-VO4UICII.js} +3 -3
- package/dist/{chunk-54TI5GLV.js → chunk-WI4QX7GH.js} +3 -3
- package/dist/{chunk-3XHD3XGK.js → chunk-XCTDHF7U.js} +30 -2
- package/dist/chunk-XCTDHF7U.js.map +1 -0
- package/dist/{chunk-XKU4YE6Z.js → chunk-XZTUMWKQ.js} +2 -2
- package/dist/{cli-DTWRoJEI.d.ts → cli-iAiVkbYJ.d.ts} +3 -3
- package/dist/cli.d.ts +6 -6
- package/dist/cli.js +43 -42
- package/dist/compounding/engine.d.ts +1 -1
- package/dist/compounding/engine.js +8 -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/config.js +4 -3
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +8 -7
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +9 -8
- package/dist/consolidation-provenance-check.d.ts +1 -1
- package/dist/consolidation-undo.d.ts +1 -1
- package/dist/contradiction/index.d.ts +1 -1
- package/dist/conversation-index/backend.d.ts +1 -1
- 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/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 +1 -1
- package/dist/entity-retrieval.js +8 -7
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +4 -4
- package/dist/explicit-capture.js +3 -2
- 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.d.ts +1 -1
- package/dist/extraction.js +4 -3
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +62 -61
- package/dist/index.js.map +1 -1
- 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/index.js +3 -3
- 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/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +8 -7
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +8 -7
- package/dist/maintenance/rebuild-memory-projection.js +9 -8
- package/dist/mcp-memory-inspector-app.d.ts +5 -5
- 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 +1 -1
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +2 -2
- package/dist/namespaces/migrate.js +12 -11
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +3 -3
- package/dist/namespaces/storage.d.ts +2 -2
- package/dist/namespaces/storage.js +8 -7
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +1 -1
- package/dist/operator-toolkit.js +17 -16
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +10 -9
- package/dist/{orchestrator-B1iVjEyc.d.ts → orchestrator-iVZWi8aW.d.ts} +21 -4
- package/dist/orchestrator.d.ts +4 -4
- package/dist/orchestrator.js +32 -31
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/provenance.js +3 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.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-handles.d.ts +228 -0
- package/dist/recall-handles.js +42 -0
- package/dist/recall-handles.js.map +1 -0
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +40 -2
- package/dist/recall-state.js +3 -1
- package/dist/recall-tag-filter.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/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +5 -4
- package/dist/retrieval-agents.d.ts +1 -1
- 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/sanitize.d.ts +2 -0
- package/dist/sanitize.js +6 -2
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +2 -2
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +4 -4
- 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-CY8uVRNJ.d.ts → semantic-consolidation-DSjMDZ1u.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +9 -8
- package/dist/semantic-rule-promotion.js +8 -7
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +8 -7
- 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 +3 -3
- package/dist/signal.d.ts +1 -1
- package/dist/storage.d.ts +1 -1
- package/dist/storage.js +7 -6
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.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 +1 -1
- 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/import-sqlite.js +2 -2
- package/dist/{types-Dr0Cw3L9.d.ts → types-D9dwzU_x.d.ts} +25 -1
- 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 +8 -7
- package/package.json +2 -2
- package/src/access-boundary.ts +4 -1
- package/src/access-http.ts +78 -20
- package/src/access-mcp.test.ts +29 -0
- package/src/access-mcp.ts +99 -17
- package/src/access-operations-batch.ts +14 -0
- package/src/access-operations.ts +5 -0
- package/src/access-schema.ts +8 -0
- package/src/access-service-observe-idempotency.test.ts +308 -0
- package/src/access-service.ts +106 -5
- package/src/access-surface-catalog.test.ts +4 -2
- package/src/access-surface-catalog.ts +5 -0
- package/src/active-memory-bridge.test.ts +72 -0
- package/src/active-memory-bridge.ts +21 -2
- package/src/chat/chat-cli.test.ts +142 -0
- package/src/chat/chat-cli.ts +206 -0
- package/src/chat/chat-config.ts +57 -0
- package/src/chat/chat-engine.test.ts +272 -0
- package/src/chat/chat-engine.ts +518 -0
- package/src/chat/chat-executor.ts +133 -0
- package/src/chat/chat-factory.ts +161 -0
- package/src/chat/chat-http.test.ts +197 -0
- package/src/chat/chat-http.ts +222 -0
- package/src/chat/chat-llm.ts +229 -0
- package/src/chat/chat-mcp.test.ts +135 -0
- package/src/chat/chat-security.test.ts +491 -0
- package/src/chat/chat-session.ts +296 -0
- package/src/chat/chat-system-prompt.ts +76 -0
- package/src/chat/chat-tools.ts +255 -0
- package/src/chat/chat-types.ts +167 -0
- package/src/cli.ts +20 -0
- package/src/config.ts +9 -0
- package/src/orchestrator.ts +106 -5
- package/src/recall-handles-wiring.test.ts +477 -0
- package/src/recall-handles.test.ts +283 -0
- package/src/recall-handles.ts +414 -0
- package/src/recall-state.ts +99 -0
- package/src/sanitize.ts +6 -0
- package/src/types.ts +29 -0
- package/dist/chunk-3XHD3XGK.js.map +0 -1
- package/dist/chunk-5KQCOIPW.js.map +0 -1
- package/dist/chunk-A2R5NV6O.js.map +0 -1
- package/dist/chunk-BOGENF7P.js.map +0 -1
- package/dist/chunk-GKPIY7EQ.js.map +0 -1
- package/dist/chunk-I3BT2IDW.js.map +0 -1
- package/dist/chunk-NUWZFSKC.js.map +0 -1
- package/dist/chunk-SINGJCUR.js.map +0 -1
- package/dist/chunk-Z3B2YW56.js.map +0 -1
- package/dist/chunk-ZVDRL6SK.js.map +0 -1
- /package/dist/{chunk-OMSTU233.js.map → chunk-2KAYTPPT.js.map} +0 -0
- /package/dist/{chunk-VYZNWH4J.js.map → chunk-2SXMCQEQ.js.map} +0 -0
- /package/dist/{chunk-NXL5CVE7.js.map → chunk-2Y6LMOQQ.js.map} +0 -0
- /package/dist/{chunk-LQ4J7ELC.js.map → chunk-67HG7KFE.js.map} +0 -0
- /package/dist/{chunk-ZBG4K36I.js.map → chunk-6FUJ2VYY.js.map} +0 -0
- /package/dist/{chunk-GMRNKPWO.js.map → chunk-6QUPUTT7.js.map} +0 -0
- /package/dist/{chunk-Z56IHRVV.js.map → chunk-6UU43ZGD.js.map} +0 -0
- /package/dist/{chunk-APJQ6UEA.js.map → chunk-AGNBY3VG.js.map} +0 -0
- /package/dist/{chunk-OWOKOFXK.js.map → chunk-AJOIM6UR.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-AU7Q3LSC.js.map} +0 -0
- /package/dist/{chunk-K22IJO4R.js.map → chunk-CTOQEZSN.js.map} +0 -0
- /package/dist/{chunk-HSDJCT3V.js.map → chunk-DXGS5YOQ.js.map} +0 -0
- /package/dist/{chunk-HV57RHMD.js.map → chunk-EH5ED3C6.js.map} +0 -0
- /package/dist/{chunk-7NDYFAJS.js.map → chunk-GM3BMWKR.js.map} +0 -0
- /package/dist/{chunk-5QUS24F7.js.map → chunk-I56LKMF7.js.map} +0 -0
- /package/dist/{chunk-35YJ6KCV.js.map → chunk-JEIROMLX.js.map} +0 -0
- /package/dist/{chunk-SKQCFAYU.js.map → chunk-JVEMUX6L.js.map} +0 -0
- /package/dist/{chunk-CXMXAC5R.js.map → chunk-K44MIN6D.js.map} +0 -0
- /package/dist/{chunk-BQCFXAMN.js.map → chunk-MPHDVHIB.js.map} +0 -0
- /package/dist/{chunk-QXNFQKWU.js.map → chunk-MTHNJCOJ.js.map} +0 -0
- /package/dist/{chunk-3TCRU4JA.js.map → chunk-O62P2LFL.js.map} +0 -0
- /package/dist/{chunk-JSDZMOT7.js.map → chunk-OC56UWV5.js.map} +0 -0
- /package/dist/{chunk-7IBEWQLG.js.map → chunk-QOIONSOI.js.map} +0 -0
- /package/dist/{chunk-4P5UAL3C.js.map → chunk-RBHANGVX.js.map} +0 -0
- /package/dist/{chunk-SK2CR6MW.js.map → chunk-RVLB4E6N.js.map} +0 -0
- /package/dist/{chunk-CNVIWMQI.js.map → chunk-UY4JMEAK.js.map} +0 -0
- /package/dist/{chunk-S6FQLQGH.js.map → chunk-V7GDTQ6I.js.map} +0 -0
- /package/dist/{chunk-JNOYYWCA.js.map → chunk-VO4UICII.js.map} +0 -0
- /package/dist/{chunk-54TI5GLV.js.map → chunk-WI4QX7GH.js.map} +0 -0
- /package/dist/{chunk-XKU4YE6Z.js.map → chunk-XZTUMWKQ.js.map} +0 -0
|
@@ -1,22 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
AdapterRegistry
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-AU7Q3LSC.js";
|
|
4
4
|
import {
|
|
5
5
|
WearablesInputError
|
|
6
6
|
} from "./chunk-7WV3F5DQ.js";
|
|
7
7
|
import {
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
ChatEngine,
|
|
9
|
+
EngramMcpServer,
|
|
10
|
+
appendTranscriptEntry,
|
|
11
|
+
createChatExecutor,
|
|
12
|
+
createChatSession,
|
|
13
|
+
createProductionChatLlmAdapter,
|
|
14
|
+
loadChatSession,
|
|
15
|
+
markPendingPlan,
|
|
16
|
+
markPendingPromotion,
|
|
17
|
+
markPlanResolved,
|
|
18
|
+
markPromotionResolved,
|
|
19
|
+
sessionBelongsToPrincipal
|
|
20
|
+
} from "./chunk-SYDHFFAW.js";
|
|
10
21
|
import {
|
|
11
22
|
validateRequest
|
|
12
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-FVZ2ISIX.js";
|
|
13
24
|
import {
|
|
14
25
|
getOperation
|
|
15
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-HHLWSWWF.js";
|
|
16
27
|
import {
|
|
17
28
|
CorrectionContractError,
|
|
18
29
|
EngramAccessInputError
|
|
19
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-BNOAB5HH.js";
|
|
20
31
|
import {
|
|
21
32
|
projectTagProjectId
|
|
22
33
|
} from "./chunk-SHRRWOVY.js";
|
|
@@ -28,7 +39,7 @@ import {
|
|
|
28
39
|
} from "./chunk-DEUNUKTD.js";
|
|
29
40
|
import {
|
|
30
41
|
isRecallDisclosure
|
|
31
|
-
} from "./chunk-
|
|
42
|
+
} from "./chunk-MSVSP5VO.js";
|
|
32
43
|
import {
|
|
33
44
|
OFFLINE_SYNC_APPLY_MAX_BODY_BYTES,
|
|
34
45
|
OFFLINE_SYNC_FILE_CONTENT_MAX_CHUNK_BYTES,
|
|
@@ -50,6 +61,130 @@ import { readFile } from "fs/promises";
|
|
|
50
61
|
import path from "path";
|
|
51
62
|
import { fileURLToPath, URL } from "url";
|
|
52
63
|
import { gunzipSync } from "zlib";
|
|
64
|
+
|
|
65
|
+
// src/chat/chat-http.ts
|
|
66
|
+
async function handleChatMessage(req, res, body, opts, principal) {
|
|
67
|
+
if (!opts.config?.enabled) {
|
|
68
|
+
respondJson(res, 404, { error: "chat_disabled", code: "chat_disabled" });
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const message = typeof body.message === "string" ? body.message : "";
|
|
72
|
+
if (!message) {
|
|
73
|
+
respondJson(res, 400, { error: "message is required", code: "input_error" });
|
|
74
|
+
return;
|
|
75
|
+
}
|
|
76
|
+
const llm = opts.service.fallbackLlmRef ?? opts.service.localLlmRef;
|
|
77
|
+
if (!llm) {
|
|
78
|
+
respondJson(res, 503, {
|
|
79
|
+
error: "No LLM model is available. Configure a local or cloud model.",
|
|
80
|
+
code: "no_llm"
|
|
81
|
+
});
|
|
82
|
+
return;
|
|
83
|
+
}
|
|
84
|
+
const adapter = createProductionChatLlmAdapter(llm);
|
|
85
|
+
const requestedSessionId = typeof body.chatSessionId === "string" ? body.chatSessionId : void 0;
|
|
86
|
+
let session;
|
|
87
|
+
if (requestedSessionId) {
|
|
88
|
+
session = await loadChatSession(opts.memoryDir, requestedSessionId);
|
|
89
|
+
if (!session) {
|
|
90
|
+
respondJson(res, 404, { error: "chat_session_not_found", code: "chat_session_not_found" });
|
|
91
|
+
return;
|
|
92
|
+
}
|
|
93
|
+
if (!sessionBelongsToPrincipal(session, principal)) {
|
|
94
|
+
respondJson(res, 403, { error: "access_denied", code: "access_denied" });
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
97
|
+
} else {
|
|
98
|
+
session = await createChatSession(opts.memoryDir, { principal });
|
|
99
|
+
}
|
|
100
|
+
const executor = createChatExecutor({
|
|
101
|
+
service: opts.service,
|
|
102
|
+
principal,
|
|
103
|
+
...session.namespace ? { namespace: session.namespace } : {},
|
|
104
|
+
...session.sessionKey ? { sessionKey: session.sessionKey } : {}
|
|
105
|
+
});
|
|
106
|
+
const engine = new ChatEngine({
|
|
107
|
+
llm: adapter,
|
|
108
|
+
executor,
|
|
109
|
+
maxToolCallsPerTurn: opts.config.maxToolCallsPerTurn,
|
|
110
|
+
...opts.config.model ? { model: opts.config.model } : {},
|
|
111
|
+
correctionAvailable: false,
|
|
112
|
+
scopeInspectAvailable: false
|
|
113
|
+
});
|
|
114
|
+
await appendTranscriptEntry(opts.memoryDir, session.id, {
|
|
115
|
+
role: "user",
|
|
116
|
+
content: message
|
|
117
|
+
});
|
|
118
|
+
const priorPendingPlanId = session.pendingPlanId;
|
|
119
|
+
const priorPendingPromotionId = session.pendingPromotionId;
|
|
120
|
+
const result = await engine.processMessage(message, session);
|
|
121
|
+
await appendTranscriptEntry(opts.memoryDir, session.id, {
|
|
122
|
+
role: "assistant",
|
|
123
|
+
content: result.reply
|
|
124
|
+
});
|
|
125
|
+
if (result.pendingPlan?.planId) {
|
|
126
|
+
await markPendingPlan(opts.memoryDir, session.id, result.pendingPlan.planId);
|
|
127
|
+
} else if (session.pendingPromotionId && !priorPendingPromotionId) {
|
|
128
|
+
await markPendingPromotion(opts.memoryDir, session.id, session.pendingPromotionId);
|
|
129
|
+
} else if (priorPendingPlanId && !session.pendingPlanId && !result.error) {
|
|
130
|
+
await markPlanResolved(opts.memoryDir, session.id, priorPendingPlanId);
|
|
131
|
+
} else if (priorPendingPromotionId && !session.pendingPromotionId && !result.error) {
|
|
132
|
+
await markPromotionResolved(opts.memoryDir, session.id, priorPendingPromotionId);
|
|
133
|
+
}
|
|
134
|
+
const wireResult = result.error ? { reply: result.reply, chatSessionId: result.chatSessionId, ...result.pendingPlan ? { pendingPlan: result.pendingPlan } : {} } : result;
|
|
135
|
+
respondJson(res, 200, wireResult);
|
|
136
|
+
}
|
|
137
|
+
async function handleChatEventsSSE(req, res, chatSessionId, opts, principal) {
|
|
138
|
+
if (!opts.config?.enabled) {
|
|
139
|
+
respondJson(res, 404, { error: "chat_disabled", code: "chat_disabled" });
|
|
140
|
+
return;
|
|
141
|
+
}
|
|
142
|
+
const session = await loadChatSession(opts.memoryDir, chatSessionId);
|
|
143
|
+
if (!session) {
|
|
144
|
+
respondJson(res, 404, { error: "chat_session_not_found", code: "chat_session_not_found" });
|
|
145
|
+
return;
|
|
146
|
+
}
|
|
147
|
+
if (!sessionBelongsToPrincipal(session, principal)) {
|
|
148
|
+
respondJson(res, 403, { error: "access_denied", code: "access_denied" });
|
|
149
|
+
return;
|
|
150
|
+
}
|
|
151
|
+
res.writeHead(200, {
|
|
152
|
+
"content-type": "text/event-stream",
|
|
153
|
+
"cache-control": "no-cache",
|
|
154
|
+
connection: "keep-alive"
|
|
155
|
+
});
|
|
156
|
+
for (const entry of session.transcript) {
|
|
157
|
+
res.write(`data: ${JSON.stringify(entry)}
|
|
158
|
+
|
|
159
|
+
`);
|
|
160
|
+
}
|
|
161
|
+
const heartbeat = setInterval(() => {
|
|
162
|
+
try {
|
|
163
|
+
res.write(`data: ${JSON.stringify({ type: "heartbeat" })}
|
|
164
|
+
|
|
165
|
+
`);
|
|
166
|
+
} catch {
|
|
167
|
+
}
|
|
168
|
+
}, 25e3);
|
|
169
|
+
heartbeat.unref();
|
|
170
|
+
req.on("close", () => {
|
|
171
|
+
clearInterval(heartbeat);
|
|
172
|
+
try {
|
|
173
|
+
res.end();
|
|
174
|
+
} catch {
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
function respondJson(res, status, body) {
|
|
179
|
+
const json = JSON.stringify(body);
|
|
180
|
+
res.writeHead(status, {
|
|
181
|
+
"content-type": "application/json; charset=utf-8",
|
|
182
|
+
"content-length": Buffer.byteLength(json, "utf8")
|
|
183
|
+
});
|
|
184
|
+
res.end(json);
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
// src/access-http.ts
|
|
53
188
|
function resolveDefaultAdminConsolePublicDir() {
|
|
54
189
|
const thisDir = path.dirname(fileURLToPath(import.meta.url));
|
|
55
190
|
const candidates = [
|
|
@@ -211,6 +346,7 @@ var EngramAccessHttpServer = class {
|
|
|
211
346
|
architectureCardVisible: this.service.architectureCardSurfaceVisible,
|
|
212
347
|
codegraphVisible: this.service.codegraphSurfaceVisible,
|
|
213
348
|
sessionDeltaVisible: this.service.sessionDeltaSurfaceVisible,
|
|
349
|
+
chatVisible: this.service.configRef?.chat?.enabled === true,
|
|
214
350
|
correctionVisible: this.service.correctionSurfaceVisible
|
|
215
351
|
});
|
|
216
352
|
}
|
|
@@ -913,24 +1049,37 @@ var EngramAccessHttpServer = class {
|
|
|
913
1049
|
if (req.method === "POST" && pathname === "/engram/v1/observe") {
|
|
914
1050
|
void getOperation("observe");
|
|
915
1051
|
const body = await this.readValidatedBody(req, "observe");
|
|
916
|
-
this.
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
1052
|
+
const response = await this.service.observe(
|
|
1053
|
+
{
|
|
1054
|
+
sessionKey: body.sessionKey,
|
|
1055
|
+
messages: body.messages.map((message) => ({
|
|
1056
|
+
role: message.role,
|
|
1057
|
+
content: message.content,
|
|
1058
|
+
sourceFormat: message.sourceFormat ?? void 0,
|
|
1059
|
+
rawContent: message.rawContent ?? void 0,
|
|
1060
|
+
parts: message.parts ?? void 0
|
|
1061
|
+
})),
|
|
1062
|
+
namespace: this.resolveNamespace(req, body.namespace),
|
|
1063
|
+
authenticatedPrincipal: this.resolveRequestPrincipal(req),
|
|
1064
|
+
skipExtraction: body.skipExtraction === true,
|
|
1065
|
+
// Issue #1649: optional server-side dedup key for retried POSTs.
|
|
1066
|
+
idempotencyKey: body.idempotencyKey,
|
|
1067
|
+
// Forward cwd/projectTag for auto git-context resolution (issue #569).
|
|
1068
|
+
cwd: body.cwd,
|
|
1069
|
+
projectTag: body.projectTag
|
|
1070
|
+
},
|
|
1071
|
+
// Enforce the write-quota INSIDE the service's idempotency lock
|
|
1072
|
+
// (beforeExecute, only on a real miss). A retried observe that hits the
|
|
1073
|
+
// replay path must NOT be rejected with 429 — that is exactly the
|
|
1074
|
+
// response-lost-after-process case the dedup exists for. The original
|
|
1075
|
+
// attempt may have consumed the last quota slot; the retry returns the
|
|
1076
|
+
// cached response without requiring another. Matches memory_store's
|
|
1077
|
+
// hook-in-the-lock pattern (#1434 invariant).
|
|
1078
|
+
{ enforceWriteQuota: () => this.ensureWriteRateLimitAvailable() }
|
|
1079
|
+
);
|
|
1080
|
+
if (this.shouldCountWriteRateLimit(response)) {
|
|
1081
|
+
this.recordWriteRateLimitHit();
|
|
1082
|
+
}
|
|
934
1083
|
this.respondJson(res, 202, response);
|
|
935
1084
|
return;
|
|
936
1085
|
}
|
|
@@ -1148,12 +1297,13 @@ var EngramAccessHttpServer = class {
|
|
|
1148
1297
|
if (req.method === "GET" && memoryMatch) {
|
|
1149
1298
|
const memoryId = decodeURIComponent(memoryMatch[1] ?? "");
|
|
1150
1299
|
const namespace = parsed.searchParams.get("namespace") ?? void 0;
|
|
1300
|
+
const sessionKey = this.resolveRequestIdentity(req).sessionKey ?? parsed.searchParams.get("session") ?? parsed.searchParams.get("sessionKey") ?? void 0;
|
|
1151
1301
|
const op = getOperation("memory_get");
|
|
1152
1302
|
if (!op) {
|
|
1153
1303
|
throw new EngramAccessInputError("access-boundary: operation not registered: memory_get");
|
|
1154
1304
|
}
|
|
1155
1305
|
const output = await op.run(
|
|
1156
|
-
{ memoryId, namespace: namespace ?? null },
|
|
1306
|
+
{ memoryId, namespace: namespace ?? null, sessionKey: sessionKey ?? null },
|
|
1157
1307
|
{ service: this.service, authenticatedPrincipal: this.resolveRequestPrincipal(req) }
|
|
1158
1308
|
);
|
|
1159
1309
|
const response = output.result;
|
|
@@ -1551,6 +1701,30 @@ var EngramAccessHttpServer = class {
|
|
|
1551
1701
|
await this.handleGraphEventsSSE(req, res);
|
|
1552
1702
|
return;
|
|
1553
1703
|
}
|
|
1704
|
+
if (req.method === "POST" && pathname === "/engram/v1/chat/message") {
|
|
1705
|
+
void getOperation("chat_message");
|
|
1706
|
+
const body = await this.readJsonBody(req);
|
|
1707
|
+
await handleChatMessage(
|
|
1708
|
+
req,
|
|
1709
|
+
res,
|
|
1710
|
+
body,
|
|
1711
|
+
{ service: this.service, config: this.service.configRef?.chat, memoryDir: this.service.memoryDir },
|
|
1712
|
+
this.resolveRequestPrincipal(req)
|
|
1713
|
+
);
|
|
1714
|
+
return;
|
|
1715
|
+
}
|
|
1716
|
+
const chatEventsMatch = /^\/engram\/v1\/chat\/events\/([^/]+)$/.exec(pathname);
|
|
1717
|
+
if (req.method === "GET" && chatEventsMatch) {
|
|
1718
|
+
void getOperation("chat_events");
|
|
1719
|
+
await handleChatEventsSSE(
|
|
1720
|
+
req,
|
|
1721
|
+
res,
|
|
1722
|
+
chatEventsMatch[1] ?? "",
|
|
1723
|
+
{ service: this.service, config: this.service.configRef?.chat, memoryDir: this.service.memoryDir },
|
|
1724
|
+
this.resolveRequestPrincipal(req)
|
|
1725
|
+
);
|
|
1726
|
+
return;
|
|
1727
|
+
}
|
|
1554
1728
|
if (req.method === "GET" && pathname === "/engram/v1/console/state") {
|
|
1555
1729
|
void getOperation("console_state");
|
|
1556
1730
|
const namespace = parsed.searchParams.get("namespace") ?? void 0;
|
|
@@ -1961,7 +2135,8 @@ var EngramAccessHttpServer = class {
|
|
|
1961
2135
|
const isCodegraphManageAdr = toolName === "engram.codegraph_manage_adr" || toolName === "remnic.codegraph_manage_adr";
|
|
1962
2136
|
const codegraphWrite = CODEGRAPH_WRITE_TOOLS.has(toolName) || isCodegraphManageAdr && (toolArgsSubcommand === "record" || toolArgsSubcommand === "supersede");
|
|
1963
2137
|
const isMcpWrite = request.method === "tools/call" && (toolName === "engram.memory_store" || toolName === "remnic.memory_store" || toolName === "engram.suggestion_submit" || toolName === "remnic.suggestion_submit" || toolName === "engram.observe" || toolName === "remnic.observe" || toolName === "engram.lcm_compaction_flush" || toolName === "remnic.lcm_compaction_flush" || toolName === "engram.lcm_compaction_record" || toolName === "remnic.lcm_compaction_record" || toolName === "engram.capsule_export" || toolName === "remnic.capsule_export" || toolName === "engram.capsule_import" || toolName === "remnic.capsule_import" || !dreamsRunDryRun && (toolName === "engram.dreams_run" || toolName === "remnic.dreams_run") || !memoryActionApplyDryRun && (toolName === "engram.memory_action_apply" || toolName === "remnic.memory_action_apply") || (toolName === "engram.memory_correct_apply" || toolName === "remnic.memory_correct_apply" || toolName === "engram.memory_correct_plan" || toolName === "remnic.memory_correct_plan") || codingDecisionWrite || codingArchitectureWrite || codegraphWrite);
|
|
1964
|
-
|
|
2138
|
+
const observeSelfEnforcesQuota = toolName === "engram.observe" || toolName === "remnic.observe";
|
|
2139
|
+
if (isMcpWrite && !observeSelfEnforcesQuota) {
|
|
1965
2140
|
this.ensureWriteRateLimitAvailable();
|
|
1966
2141
|
}
|
|
1967
2142
|
const sessionId = (() => {
|
|
@@ -1975,7 +2150,8 @@ var EngramAccessHttpServer = class {
|
|
|
1975
2150
|
namespaceOverride: requestIdentity.namespace,
|
|
1976
2151
|
sessionKeyOverride: requestIdentity.sessionKey,
|
|
1977
2152
|
sessionId,
|
|
1978
|
-
correlationId: mcpCorrelationId
|
|
2153
|
+
correlationId: mcpCorrelationId,
|
|
2154
|
+
enforceWriteQuota: observeSelfEnforcesQuota ? () => this.ensureWriteRateLimitAvailable() : void 0
|
|
1979
2155
|
});
|
|
1980
2156
|
if (isMcpWrite && response !== null) {
|
|
1981
2157
|
const result = response.result;
|
|
@@ -2350,4 +2526,4 @@ function positiveIntQueryParam(value, label) {
|
|
|
2350
2526
|
export {
|
|
2351
2527
|
EngramAccessHttpServer
|
|
2352
2528
|
};
|
|
2353
|
-
//# sourceMappingURL=chunk-
|
|
2529
|
+
//# sourceMappingURL=chunk-CTAHKIG6.js.map
|