@remnic/core 9.54.4 → 9.54.6
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 +24 -23
- package/dist/access-admin-ops-surface.js +55 -50
- package/dist/access-authorization-probe.d.ts +25 -22
- package/dist/access-authorization-probe.js +58 -51
- package/dist/access-boundary.d.ts +26 -23
- package/dist/access-boundary.js +59 -52
- package/dist/access-cli.js +115 -107
- 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 +19 -18
- package/dist/access-extraction-force-flush.js +55 -50
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +22 -21
- package/dist/access-http-lifecycle-flush.d.ts +22 -21
- package/dist/access-http-offline-stream.d.ts +19 -18
- package/dist/access-http-query.js +55 -50
- package/dist/access-http.d.ts +55 -36
- package/dist/access-http.js +76 -65
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +55 -50
- package/dist/access-lcm-surface.d.ts +21 -20
- package/dist/access-lcm-surface.js +55 -50
- package/dist/access-mcp.d.ts +22 -21
- package/dist/access-mcp.js +63 -57
- package/dist/access-memory-search-fanout.d.ts +22 -2
- package/dist/access-memory-search-fanout.js +1 -1
- package/dist/{access-namespace-preflight-C7n4tgWC.d.ts → access-namespace-preflight-CCNn_6NE.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +55 -50
- package/dist/access-observe-write-surface.d.ts +22 -21
- package/dist/access-observe-write-surface.js +55 -50
- package/dist/access-offline-manifest.d.ts +10 -9
- package/dist/access-offline-manifest.js +12 -10
- package/dist/access-operations-batch.js +57 -52
- package/dist/access-operations.d.ts +23 -22
- package/dist/access-operations.js +61 -55
- package/dist/access-recall-concurrency.d.ts +21 -20
- package/dist/access-recall-concurrency.js +55 -50
- package/dist/access-recall-response.d.ts +19 -18
- package/dist/access-recall-response.js +55 -50
- package/dist/access-recall-surface.d.ts +19 -18
- package/dist/access-recall-surface.js +55 -50
- package/dist/access-schema.d.ts +2 -2
- package/dist/access-schema.js +5 -4
- package/dist/{access-service-CXvbxLK-.d.ts → access-service-DkSdXK4S.d.ts} +1314 -83
- package/dist/access-service-helpers.d.ts +22 -21
- package/dist/access-service.d.ts +31 -30
- package/dist/access-service.js +55 -50
- package/dist/access-surface-catalog.d.ts +22 -21
- package/dist/access-surface-catalog.js +209 -2
- package/dist/access-surface-catalog.js.map +1 -1
- 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 +14 -1
- package/dist/active-memory-bridge.js +6 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -2
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +7 -7
- package/dist/adapters/registry.js +3 -3
- package/dist/admin-console/public/what-helps-me/app.js +1594 -0
- package/dist/admin-console/public/what-helps-me/index.html +339 -0
- package/dist/admin-console/public/what-helps-me/model.js +685 -0
- package/dist/admin-console/public/what-helps-me/what-helps-me.css +1296 -0
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/{auto-sync-TDHLZPVP.js → auto-sync-NR3GPCOA.js} +4 -4
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +33 -12
- 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 +3 -3
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/calibration.js +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-BOOxl-I2.d.ts → catalog-DGFf8mD9.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 +34 -13
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-ZYLC7NFO.js → chunk-26ZXBTYN.js} +4 -4
- package/dist/chunk-26ZXBTYN.js.map +1 -0
- package/dist/{chunk-LLJMAULE.js → chunk-2FKEIPIT.js} +5 -5
- package/dist/{chunk-3CSX3ETE.js → chunk-2LWQSV6A.js} +23 -11
- package/dist/chunk-2LWQSV6A.js.map +1 -0
- package/dist/{chunk-JBPKEARU.js → chunk-2QSZNTDO.js} +7 -7
- package/dist/chunk-37DZZFFM.js +502 -0
- package/dist/chunk-37DZZFFM.js.map +1 -0
- package/dist/chunk-3HSRWJTC.js +9 -0
- package/dist/chunk-3HSRWJTC.js.map +1 -0
- package/dist/{chunk-XUAMCLY4.js → chunk-3TIZPSJC.js} +17 -13
- package/dist/chunk-3TIZPSJC.js.map +1 -0
- package/dist/{chunk-PDDTI7IC.js → chunk-43SEBY2M.js} +1 -1
- package/dist/{chunk-HWRD23DW.js → chunk-46SZBVDS.js} +3 -3
- package/dist/{chunk-6HPHEFXT.js → chunk-5FD7JMTX.js} +2 -2
- package/dist/{chunk-7BZOBA5J.js → chunk-5NB726GV.js} +70 -16
- package/dist/chunk-5NB726GV.js.map +1 -0
- package/dist/chunk-62OKGIJA.js +39 -0
- package/dist/chunk-62OKGIJA.js.map +1 -0
- package/dist/{chunk-IBKR2TFR.js → chunk-6CYHUWCO.js} +2 -2
- package/dist/{chunk-YN6ASZUG.js → chunk-6QPI2ITJ.js} +5 -5
- package/dist/{chunk-UU3G6GUP.js → chunk-76JJSXK7.js} +1 -1
- package/dist/chunk-76JJSXK7.js.map +1 -0
- package/dist/{chunk-PX2LSHYM.js → chunk-7BD6O7ZV.js} +189 -4
- package/dist/chunk-7BD6O7ZV.js.map +1 -0
- package/dist/chunk-7TBXNYLO.js +346 -0
- package/dist/chunk-7TBXNYLO.js.map +1 -0
- package/dist/{chunk-NH5IR2WM.js → chunk-BRR5EUTF.js} +6 -2
- package/dist/chunk-BRR5EUTF.js.map +1 -0
- package/dist/{chunk-NIS256NW.js → chunk-CIAI24TQ.js} +3 -3
- package/dist/{chunk-T2JHZWH6.js → chunk-D3LBIUWV.js} +11703 -7573
- package/dist/chunk-D3LBIUWV.js.map +1 -0
- package/dist/{chunk-7FGL6CGA.js → chunk-DVYRD4HY.js} +2 -2
- package/dist/{chunk-G7Z6EENO.js → chunk-EKTP7MNS.js} +4 -4
- package/dist/{chunk-S75M5ZRK.js → chunk-F2JRDPON.js} +16 -1
- package/dist/chunk-F2JRDPON.js.map +1 -0
- package/dist/{chunk-RZ4XGKOJ.js → chunk-FFRTNF3L.js} +8 -8
- package/dist/{chunk-VKXWK44Q.js → chunk-FONWBCVY.js} +3 -3
- package/dist/{chunk-DZD576ZU.js → chunk-FPLM2TKD.js} +2 -2
- package/dist/{chunk-ZPJ4QSGP.js → chunk-FTPONF6B.js} +2 -2
- package/dist/{chunk-LJS7KUPV.js → chunk-FWX7W5PM.js} +2 -2
- package/dist/{chunk-UTRO5UJU.js → chunk-G6DFSS6A.js} +5 -1
- package/dist/chunk-G6DFSS6A.js.map +1 -0
- package/dist/{chunk-6LAPLZOS.js → chunk-GJ776BC2.js} +8 -3
- package/dist/chunk-GJ776BC2.js.map +1 -0
- package/dist/{chunk-G4T7L557.js → chunk-GN3WRFJY.js} +6 -6
- package/dist/{chunk-QT2FRYI4.js → chunk-H7NAZ3UB.js} +2 -2
- package/dist/{chunk-APPFNGX6.js → chunk-HBUFQRIM.js} +2 -2
- package/dist/{chunk-UU7TRFNE.js → chunk-HGJ6NJ4E.js} +2 -2
- package/dist/{chunk-WB7JSQCP.js → chunk-HIEWDJ2O.js} +5 -2
- package/dist/{chunk-WB7JSQCP.js.map → chunk-HIEWDJ2O.js.map} +1 -1
- package/dist/{chunk-UES4BHA2.js → chunk-I3MSGFGD.js} +17 -6
- package/dist/chunk-I3MSGFGD.js.map +1 -0
- package/dist/{chunk-C4ZNGVK3.js → chunk-IKP5OYQQ.js} +2 -2
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-RDJRFDJY.js → chunk-IQ4NVWEF.js} +2 -2
- package/dist/{chunk-CGVHPCP2.js → chunk-JYG4OLWH.js} +2 -2
- package/dist/{chunk-WOPA3SGI.js → chunk-K26NWEOC.js} +8 -8
- package/dist/{chunk-K4QS7LXU.js → chunk-K2UGPTYY.js} +485 -44
- package/dist/chunk-K2UGPTYY.js.map +1 -0
- package/dist/{chunk-L6CQ7WIW.js → chunk-KFBOPMF6.js} +11 -11
- package/dist/chunk-KFBOPMF6.js.map +1 -0
- package/dist/{chunk-G7A5HLUS.js → chunk-KJH6W2I7.js} +2 -2
- package/dist/{chunk-IXEBUYO4.js → chunk-KM55SMLG.js} +11 -2
- package/dist/{chunk-IXEBUYO4.js.map → chunk-KM55SMLG.js.map} +1 -1
- package/dist/{chunk-HOIRB77A.js → chunk-L6Z5OAS4.js} +2 -2
- package/dist/chunk-LC2BDILZ.js +57 -0
- package/dist/chunk-LC2BDILZ.js.map +1 -0
- package/dist/{chunk-227UFSEQ.js → chunk-LEPOP46W.js} +4 -4
- package/dist/{chunk-6R4G7N4S.js → chunk-M4YHAODQ.js} +388 -748
- package/dist/chunk-M4YHAODQ.js.map +1 -0
- package/dist/{chunk-3JLPGJ43.js → chunk-MIH3CJPN.js} +5 -5
- package/dist/{chunk-QHFV6VNU.js → chunk-MK5VEWCR.js} +2 -2
- package/dist/chunk-NISZQW72.js +140 -0
- package/dist/chunk-NISZQW72.js.map +1 -0
- package/dist/{chunk-GUKBW4HL.js → chunk-NQMSEB5D.js} +6 -6
- package/dist/{chunk-G2LUMAUF.js → chunk-OCIP6YMD.js} +12 -5
- package/dist/chunk-OCIP6YMD.js.map +1 -0
- package/dist/{chunk-47P3RYZP.js → chunk-PG4QBPVG.js} +21 -11
- package/dist/chunk-PG4QBPVG.js.map +1 -0
- package/dist/{chunk-WRJVB3C2.js → chunk-PO7NXBG2.js} +2 -2
- package/dist/{chunk-QWGE2PUH.js → chunk-PT54WISF.js} +190 -56
- package/dist/chunk-PT54WISF.js.map +1 -0
- package/dist/{chunk-AZM4CCAC.js → chunk-QZLDRQ4I.js} +8 -8
- package/dist/{chunk-THPPCISA.js → chunk-RBII7637.js} +5 -5
- package/dist/{chunk-JDZPNCMA.js → chunk-RUNORG2P.js} +6 -3
- package/dist/chunk-RUNORG2P.js.map +1 -0
- package/dist/{chunk-JV5YUBIZ.js → chunk-RZQ6W2W4.js} +50 -44
- package/dist/chunk-RZQ6W2W4.js.map +1 -0
- package/dist/{chunk-RUMNY5DT.js → chunk-SMNYAMJD.js} +6 -2
- package/dist/chunk-SMNYAMJD.js.map +1 -0
- package/dist/{chunk-MKQBXQKU.js → chunk-TB6CBZ5V.js} +22 -15
- package/dist/chunk-TB6CBZ5V.js.map +1 -0
- package/dist/{chunk-VMMQDEN5.js → chunk-TO7ZTWJW.js} +2 -2
- package/dist/{chunk-K2TDK7GG.js → chunk-TWTUGCTY.js} +2 -2
- package/dist/{chunk-HLYR2TQL.js → chunk-UCTS3DDH.js} +2 -2
- package/dist/{chunk-JYIJNNN3.js → chunk-UG6VXIOK.js} +2 -2
- package/dist/{chunk-WM65LU67.js → chunk-UKYS3NU5.js} +2 -2
- package/dist/{chunk-WDBX6VER.js → chunk-UPLZNJKN.js} +5 -5
- package/dist/{chunk-C23BYTJV.js → chunk-UW5NPZJ2.js} +40 -12
- package/dist/chunk-UW5NPZJ2.js.map +1 -0
- package/dist/{chunk-2GFK22OZ.js → chunk-V6ERBR7U.js} +2 -2
- package/dist/{chunk-CYF6WVE7.js → chunk-W5ZKPI34.js} +139 -158
- package/dist/chunk-W5ZKPI34.js.map +1 -0
- package/dist/chunk-XX4HPFFM.js +370 -0
- package/dist/chunk-XX4HPFFM.js.map +1 -0
- package/dist/{chunk-ZMYDYNI4.js → chunk-XZHE2DEN.js} +4 -4
- package/dist/chunk-YXQEKCZM.js +223 -0
- package/dist/chunk-YXQEKCZM.js.map +1 -0
- package/dist/{chunk-GYPQL6XN.js → chunk-Z4N7SVVF.js} +35 -47
- package/dist/chunk-Z4N7SVVF.js.map +1 -0
- package/dist/{chunk-MAXVH44E.js → chunk-Z54EM5YZ.js} +7 -7
- package/dist/{chunk-YGLY6QFV.js → chunk-ZRZVLB7O.js} +2 -2
- package/dist/{chunk-4IIFL7GC.js → chunk-ZUKIUXHQ.js} +10 -10
- package/dist/{cli-DVUFIa5E.d.ts → cli-Bze8S0Qs.d.ts} +5 -5
- package/dist/cli.d.ts +22 -21
- package/dist/cli.js +90 -80
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +33 -12
- 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 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +33 -12
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +32 -12
- 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/contradiction/index.js +3 -1
- package/dist/contradiction-scan-JDTBXRGW.js +20 -0
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +35 -14
- 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 +25 -24
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-XzF76C9n.d.ts → dependency-propagation-delivery-CzEfB31P.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 +33 -12
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/explicit-capture.js +7 -4
- package/dist/external-wiki-access.d.ts +22 -21
- package/dist/external-wiki-access.js +56 -51
- 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 +22 -21
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-faithfulness.js +2 -2
- 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-judge.js +2 -2
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.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 -1
- package/dist/extraction.js +35 -19
- package/dist/fallback-llm.d.ts +14 -1
- package/dist/fallback-llm.js +1 -1
- package/dist/{first-start-migration-626C5554.js → first-start-migration-CRZCZAJN.js} +11 -3
- package/dist/first-start-migration-CRZCZAJN.js.map +1 -0
- 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-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/harmonic-retrieval.js +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 +314 -308
- package/dist/index.js +304 -133
- package/dist/inline-script.d.ts +3 -0
- package/dist/inline-script.js +8 -0
- package/dist/inline-script.js.map +1 -0
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +3 -3
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +6 -6
- 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 +2 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +33 -12
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +33 -12
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +34 -13
- package/dist/{maintenance-BJzNIKBE.d.ts → maintenance-C8aRWfhq.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +22 -21
- package/dist/mcp-read-only-tools.js +1 -1
- 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-mutations.js +2 -2
- package/dist/memory-projection-store.d.ts +6 -2
- package/dist/memory-projection-store.js +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 +24 -23
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +8 -8
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +33 -12
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-file-io.d.ts +20 -0
- package/dist/offline-sync-file-io.js +18 -0
- package/dist/offline-sync-file-io.js.map +1 -0
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/offline-sync-impression-drain.js +5 -5
- package/dist/offline-sync.d.ts +8 -6
- package/dist/offline-sync.js +2 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +26 -25
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +39 -36
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +38 -18
- package/dist/{orchestrator-BiXgBJBQ.d.ts → orchestrator-D85CzDDY.d.ts} +11 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +117 -109
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-sz_dcuLg.d.ts → pipeline-DPcUifCO.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/public-http-D-SyWNj6.d.ts +25 -0
- package/dist/{purge-533FZLS4.js → purge-GB7PZHT2.js} +2 -2
- package/dist/{qmd-eAWObK4M.d.ts → qmd-dFCHp1r0.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-planner-llm.js +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 +2 -1
- package/dist/reconcile/manifest.d.ts +2 -1
- package/dist/reconcile/manifest.js +6 -5
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/reconcile/plan.js +3 -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/resume-bundles.js +5 -3
- 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.d.ts +38 -38
- package/dist/{scope-profiles-BBQsXuyj.d.ts → scope-profiles-DICK7GtN.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 +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +12 -12
- 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-HD8RkzVA.d.ts → semantic-consolidation-BP7NAX0N.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +34 -13
- package/dist/semantic-rule-promotion.js +33 -12
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +33 -12
- package/dist/{service-DIrtHHEg.d.ts → service-DT-pJyda.d.ts} +660 -660
- 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 +1 -1
- package/dist/source-agent-qualifier.js +31 -15
- package/dist/{storage-DqCzXi56.d.ts → storage-qOnaJ1Lw.d.ts} +49 -13
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +33 -12
- package/dist/summarizer.d.ts +1 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +518 -0
- package/dist/support-passport/index.js +357 -0
- package/dist/support-passport/index.js.map +1 -0
- 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 +2 -2
- package/dist/tier-routing.js +7 -1
- package/dist/{tier-stats-2JCZYEF7.js → tier-stats-EXYSKSVN.js} +8 -2
- package/dist/{tier-stats-2JCZYEF7.js.map → tier-stats-EXYSKSVN.js.map} +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/autodetect.js +1 -1
- package/dist/transfer/backup.js +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/types.d.ts +36 -36
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-d_j4vC6N.d.ts → types-ed-SvS2t.d.ts} +8 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -2
- package/dist/verified-recall.js +33 -12
- package/dist/write-envelope.d.ts +1 -1
- package/dist/write-rate-limiter.d.ts +11 -5
- package/dist/write-rate-limiter.js +1 -1
- package/package.json +12 -2
- package/scripts/build-with-heap.mjs +11 -1
- package/src/access-authorization-probe.ts +20 -2
- package/src/access-boundary.ts +32 -0
- package/src/access-http.test.ts +1971 -643
- package/src/access-http.ts +81 -74
- package/src/access-mcp.ts +3 -1
- package/src/access-memory-search-fanout.ts +24 -1
- package/src/access-offline-manifest.ts +5 -0
- package/src/access-operations.ts +2 -0
- package/src/access-service-namespace.test.ts +14 -0
- package/src/access-service-observe-scope.test.ts +2 -0
- package/src/access-service-offline-file-content.test.ts +211 -0
- package/src/access-service.ts +628 -884
- package/src/access-surface-catalog.test.ts +40 -10
- package/src/access-surface-catalog.ts +15 -0
- package/src/active-memory-bridge.test.ts +151 -0
- package/src/active-memory-bridge.ts +95 -21
- package/src/briefing.test.ts +38 -0
- package/src/briefing.ts +3 -3
- package/src/cli.ts +6 -1
- package/src/config.ts +18 -9
- package/src/connectors/codex-materialize-runner.ts +2 -0
- package/src/contradiction/contradiction-scan.ts +2 -0
- package/src/contradiction/contradiction.test.ts +42 -0
- package/src/correction/correction-access-wiring.ts +8 -2
- package/src/correction/correction-storage-integration.test.ts +7 -0
- package/src/explicit-capture.test.ts +24 -0
- package/src/explicit-capture.ts +2 -0
- package/src/fallback-llm.test.ts +54 -0
- package/src/fallback-llm.ts +54 -9
- package/src/index.ts +3 -0
- package/src/inline-script.ts +6 -0
- package/src/local-llm-headers-timeout.test.ts +42 -0
- package/src/local-llm.ts +8 -8
- package/src/maintenance/first-start-migration.ts +2 -1
- package/src/maintenance/memory-governance.test.ts +25 -0
- package/src/maintenance/memory-governance.ts +4 -1
- package/src/maintenance/pattern-reinforcement.test.ts +20 -0
- package/src/maintenance/pattern-reinforcement.ts +2 -1
- package/src/maintenance/rebuild-memory-projection.ts +8 -8
- package/src/mcp-read-only-tools.ts +3 -0
- package/src/memory-projection-store.ts +25 -27
- package/src/offline-sync-file-io.ts +68 -0
- package/src/offline-sync.ts +43 -57
- package/src/orchestration/consolidation-run.ts +5 -4
- package/src/orchestration/contradiction-linking-coordinator.ts +7 -0
- package/src/orchestration/contradiction-localization.integration.test.ts +115 -0
- package/src/orchestration/lifecycle-policy-coordinator.ts +2 -1
- package/src/orchestration/qmd-result-resolver.test.ts +215 -14
- package/src/orchestration/qmd-result-resolver.ts +142 -82
- package/src/orchestration/recall-search-pipeline.test.ts +41 -0
- package/src/orchestration/recall-search-pipeline.ts +12 -0
- package/src/orchestration/semantic-consolidation-coordinator.ts +2 -1
- package/src/orchestration/tier-migration-coordinator.ts +23 -56
- package/src/orchestration/workspace-ops.test.ts +37 -0
- package/src/orchestration/workspace-ops.ts +5 -29
- package/src/orchestrator.ts +7 -8
- package/src/relay/mission-access.test.ts +11 -11
- package/src/relay/mission-ui.test.ts +3 -1
- package/src/storage/supersession-audit.ts +7 -1
- package/src/storage/supersession-side-effects.ts +17 -5
- package/src/storage/tombstone-blocked-capture-sync.ts +31 -0
- package/src/storage-contract/failure-semantics.test.ts +102 -0
- package/src/storage.ts +18 -19
- package/src/support-passport/access-http-base.ts +143 -0
- package/src/support-passport/access-http.ts +172 -0
- package/src/support-passport/access-operations.ts +272 -0
- package/src/support-passport/access-service-base.test.ts +193 -0
- package/src/support-passport/access-service-base.ts +176 -0
- package/src/support-passport/access-surface.test.ts +283 -0
- package/src/support-passport/access-surface.ts +286 -0
- package/src/support-passport/card-projection.test.ts +137 -0
- package/src/support-passport/card-projection.ts +348 -0
- package/src/support-passport/card-replacement.ts +126 -0
- package/src/support-passport/card-service-commit-forwarding.test.ts +160 -0
- package/src/support-passport/card-service.test.ts +2964 -0
- package/src/support-passport/card-service.ts +1184 -0
- package/src/support-passport/card-state.ts +158 -0
- package/src/support-passport/config-model-routing.test.ts +37 -0
- package/src/support-passport/config.test.ts +34 -0
- package/src/support-passport/config.ts +41 -0
- package/src/support-passport/contracts.test.ts +156 -0
- package/src/support-passport/contracts.ts +149 -0
- package/src/support-passport/errors.ts +30 -0
- package/src/support-passport/generated-batch.test.ts +185 -0
- package/src/support-passport/generated-batch.ts +338 -0
- package/src/support-passport/grant-contracts.ts +183 -0
- package/src/support-passport/grant-generated-batch-scope.test.ts +201 -0
- package/src/support-passport/grant-service-cache.test.ts +148 -0
- package/src/support-passport/grant-service-cancellation.test.ts +83 -0
- package/src/support-passport/grant-service-marker-cache.test.ts +62 -0
- package/src/support-passport/grant-service.test.ts +3496 -0
- package/src/support-passport/grant-service.ts +513 -0
- package/src/support-passport/grant-store-commit-hook.test.ts +123 -0
- package/src/support-passport/grant-store-order.test.ts +60 -0
- package/src/support-passport/grant-store-path-safety.test.ts +30 -0
- package/src/support-passport/grant-store-recovery.test.ts +448 -0
- package/src/support-passport/grant-store.ts +906 -0
- package/src/support-passport/index.ts +17 -0
- package/src/support-passport/mcp-tools.test.ts +222 -0
- package/src/support-passport/mcp-tools.ts +187 -0
- package/src/support-passport/model-adapter.test.ts +840 -0
- package/src/support-passport/model-adapter.ts +602 -0
- package/src/support-passport/model-audit-pinned-write.test.ts +59 -0
- package/src/support-passport/model-audit.ts +152 -0
- package/src/support-passport/model-bridge.test.ts +456 -0
- package/src/support-passport/model-bridge.ts +439 -0
- package/src/support-passport/model-contracts.ts +124 -0
- package/src/support-passport/model-service.test.ts +1731 -0
- package/src/support-passport/model-service.ts +399 -0
- package/src/support-passport/offline-sync-guard.ts +230 -0
- package/src/support-passport/owner-http.test.ts +671 -0
- package/src/support-passport/owner-lock.ts +70 -0
- package/src/support-passport/private-file.test.ts +99 -0
- package/src/support-passport/private-file.ts +498 -0
- package/src/support-passport/public-http.test.ts +476 -0
- package/src/support-passport/public-http.ts +601 -0
- package/src/support-passport/ui.test.ts +181 -0
- package/src/tier-routing.ts +28 -17
- package/src/training-export/converter.test.ts +24 -0
- package/src/training-export/converter.ts +2 -0
- package/src/types.ts +8 -1
- package/src/wearables/service.test.ts +13 -0
- package/src/wearables/service.ts +2 -0
- package/src/write-rate-limiter.test.ts +30 -6
- package/src/write-rate-limiter.ts +29 -18
- package/dist/chunk-3CSX3ETE.js.map +0 -1
- package/dist/chunk-47P3RYZP.js.map +0 -1
- package/dist/chunk-6LAPLZOS.js.map +0 -1
- package/dist/chunk-6R4G7N4S.js.map +0 -1
- package/dist/chunk-7BZOBA5J.js.map +0 -1
- package/dist/chunk-C23BYTJV.js.map +0 -1
- package/dist/chunk-CYF6WVE7.js.map +0 -1
- package/dist/chunk-G2LUMAUF.js.map +0 -1
- package/dist/chunk-GYPQL6XN.js.map +0 -1
- package/dist/chunk-JDZPNCMA.js.map +0 -1
- package/dist/chunk-JV5YUBIZ.js.map +0 -1
- package/dist/chunk-K4QS7LXU.js.map +0 -1
- package/dist/chunk-L6CQ7WIW.js.map +0 -1
- package/dist/chunk-MKQBXQKU.js.map +0 -1
- package/dist/chunk-NH5IR2WM.js.map +0 -1
- package/dist/chunk-PX2LSHYM.js.map +0 -1
- package/dist/chunk-QWGE2PUH.js.map +0 -1
- package/dist/chunk-RUMNY5DT.js.map +0 -1
- package/dist/chunk-S75M5ZRK.js.map +0 -1
- package/dist/chunk-T2JHZWH6.js.map +0 -1
- package/dist/chunk-UES4BHA2.js.map +0 -1
- package/dist/chunk-UTRO5UJU.js.map +0 -1
- package/dist/chunk-UU3G6GUP.js.map +0 -1
- package/dist/chunk-XUAMCLY4.js.map +0 -1
- package/dist/chunk-ZYLC7NFO.js.map +0 -1
- package/dist/contradiction-scan-HYLIRMJ2.js +0 -14
- package/dist/first-start-migration-626C5554.js.map +0 -1
- /package/dist/{auto-sync-TDHLZPVP.js.map → auto-sync-NR3GPCOA.js.map} +0 -0
- /package/dist/{chunk-LLJMAULE.js.map → chunk-2FKEIPIT.js.map} +0 -0
- /package/dist/{chunk-JBPKEARU.js.map → chunk-2QSZNTDO.js.map} +0 -0
- /package/dist/{chunk-PDDTI7IC.js.map → chunk-43SEBY2M.js.map} +0 -0
- /package/dist/{chunk-HWRD23DW.js.map → chunk-46SZBVDS.js.map} +0 -0
- /package/dist/{chunk-6HPHEFXT.js.map → chunk-5FD7JMTX.js.map} +0 -0
- /package/dist/{chunk-IBKR2TFR.js.map → chunk-6CYHUWCO.js.map} +0 -0
- /package/dist/{chunk-YN6ASZUG.js.map → chunk-6QPI2ITJ.js.map} +0 -0
- /package/dist/{chunk-NIS256NW.js.map → chunk-CIAI24TQ.js.map} +0 -0
- /package/dist/{chunk-7FGL6CGA.js.map → chunk-DVYRD4HY.js.map} +0 -0
- /package/dist/{chunk-G7Z6EENO.js.map → chunk-EKTP7MNS.js.map} +0 -0
- /package/dist/{chunk-RZ4XGKOJ.js.map → chunk-FFRTNF3L.js.map} +0 -0
- /package/dist/{chunk-VKXWK44Q.js.map → chunk-FONWBCVY.js.map} +0 -0
- /package/dist/{chunk-DZD576ZU.js.map → chunk-FPLM2TKD.js.map} +0 -0
- /package/dist/{chunk-ZPJ4QSGP.js.map → chunk-FTPONF6B.js.map} +0 -0
- /package/dist/{chunk-LJS7KUPV.js.map → chunk-FWX7W5PM.js.map} +0 -0
- /package/dist/{chunk-G4T7L557.js.map → chunk-GN3WRFJY.js.map} +0 -0
- /package/dist/{chunk-QT2FRYI4.js.map → chunk-H7NAZ3UB.js.map} +0 -0
- /package/dist/{chunk-APPFNGX6.js.map → chunk-HBUFQRIM.js.map} +0 -0
- /package/dist/{chunk-UU7TRFNE.js.map → chunk-HGJ6NJ4E.js.map} +0 -0
- /package/dist/{chunk-C4ZNGVK3.js.map → chunk-IKP5OYQQ.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-RDJRFDJY.js.map → chunk-IQ4NVWEF.js.map} +0 -0
- /package/dist/{chunk-CGVHPCP2.js.map → chunk-JYG4OLWH.js.map} +0 -0
- /package/dist/{chunk-WOPA3SGI.js.map → chunk-K26NWEOC.js.map} +0 -0
- /package/dist/{chunk-G7A5HLUS.js.map → chunk-KJH6W2I7.js.map} +0 -0
- /package/dist/{chunk-HOIRB77A.js.map → chunk-L6Z5OAS4.js.map} +0 -0
- /package/dist/{chunk-227UFSEQ.js.map → chunk-LEPOP46W.js.map} +0 -0
- /package/dist/{chunk-3JLPGJ43.js.map → chunk-MIH3CJPN.js.map} +0 -0
- /package/dist/{chunk-QHFV6VNU.js.map → chunk-MK5VEWCR.js.map} +0 -0
- /package/dist/{chunk-GUKBW4HL.js.map → chunk-NQMSEB5D.js.map} +0 -0
- /package/dist/{chunk-WRJVB3C2.js.map → chunk-PO7NXBG2.js.map} +0 -0
- /package/dist/{chunk-AZM4CCAC.js.map → chunk-QZLDRQ4I.js.map} +0 -0
- /package/dist/{chunk-THPPCISA.js.map → chunk-RBII7637.js.map} +0 -0
- /package/dist/{chunk-VMMQDEN5.js.map → chunk-TO7ZTWJW.js.map} +0 -0
- /package/dist/{chunk-K2TDK7GG.js.map → chunk-TWTUGCTY.js.map} +0 -0
- /package/dist/{chunk-HLYR2TQL.js.map → chunk-UCTS3DDH.js.map} +0 -0
- /package/dist/{chunk-JYIJNNN3.js.map → chunk-UG6VXIOK.js.map} +0 -0
- /package/dist/{chunk-WM65LU67.js.map → chunk-UKYS3NU5.js.map} +0 -0
- /package/dist/{chunk-WDBX6VER.js.map → chunk-UPLZNJKN.js.map} +0 -0
- /package/dist/{chunk-2GFK22OZ.js.map → chunk-V6ERBR7U.js.map} +0 -0
- /package/dist/{chunk-ZMYDYNI4.js.map → chunk-XZHE2DEN.js.map} +0 -0
- /package/dist/{chunk-MAXVH44E.js.map → chunk-Z54EM5YZ.js.map} +0 -0
- /package/dist/{chunk-YGLY6QFV.js.map → chunk-ZRZVLB7O.js.map} +0 -0
- /package/dist/{chunk-4IIFL7GC.js.map → chunk-ZUKIUXHQ.js.map} +0 -0
- /package/dist/{contradiction-scan-HYLIRMJ2.js.map → contradiction-scan-JDTBXRGW.js.map} +0 -0
- /package/dist/{purge-533FZLS4.js.map → purge-GB7PZHT2.js.map} +0 -0
package/src/access-http.ts
CHANGED
|
@@ -7,7 +7,7 @@ import path from "node:path";
|
|
|
7
7
|
import { fileURLToPath, URL } from "node:url";
|
|
8
8
|
import { gunzipSync } from "node:zlib";
|
|
9
9
|
import { log } from "./logger.js";
|
|
10
|
-
import { WriteRateLimiter } from "./write-rate-limiter.js";
|
|
10
|
+
import { WriteRateLimiter, type WriteRateLimitReservation } from "./write-rate-limiter.js";
|
|
11
11
|
import { abortError, isAbortError } from "./abort-error.js";
|
|
12
12
|
import { EngramAccessForbiddenError } from "./access-errors.js";
|
|
13
13
|
import {
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
import { expandTildePath } from "./utils/path.js";
|
|
45
45
|
import { projectTagProjectId } from "./coding/coding-namespace.js";
|
|
46
46
|
import { getOperation, type OperationName } from "./access-boundary.js";
|
|
47
|
-
import { authorizationProbeNamespaces, probeOperationAuthorization } from "./access-authorization-probe.js";
|
|
47
|
+
import { authorizationProbeNamespaces, authorizationProbeRequiresPrincipalNamespace, probeOperationAuthorization } from "./access-authorization-probe.js";
|
|
48
48
|
import { resolveQueryNamespaceWritablePreflight } from "./access-namespace-preflight.js";
|
|
49
49
|
import { respondAccessCapabilitiesHttp } from "./access-http-lcm-compaction.js";
|
|
50
50
|
import {
|
|
@@ -66,7 +66,9 @@ import { cleanupExpiredChatSessions, enforceChatSessionNamespace } from "./chat/
|
|
|
66
66
|
import { isDefaultReviewNamespace, listPairs, readPair } from "./contradiction/contradiction-review.js";
|
|
67
67
|
import { isValidResolutionVerb, executeResolution } from "./contradiction/resolution.js";
|
|
68
68
|
import { RelayMissionStoreError } from "./relay/mission.js";
|
|
69
|
-
|
|
69
|
+
import { SupportPassportAccessHttpBase } from "./support-passport/access-http-base.js";
|
|
70
|
+
import { serializeInlineScriptValue } from "./inline-script.js";
|
|
71
|
+
import type { SupportPassportExternalRequestHandler } from "./support-passport/public-http.js";
|
|
70
72
|
export interface AccessHttpReadinessState {
|
|
71
73
|
ready: boolean;
|
|
72
74
|
warmupAttempts: number;
|
|
@@ -78,7 +80,6 @@ export interface AccessHttpReadinessState {
|
|
|
78
80
|
*/
|
|
79
81
|
degraded?: boolean;
|
|
80
82
|
}
|
|
81
|
-
|
|
82
83
|
export interface EngramAccessHttpServerOptions {
|
|
83
84
|
service: EngramAccessService;
|
|
84
85
|
host?: string;
|
|
@@ -151,11 +152,7 @@ export interface EngramAccessHttpServerOptions {
|
|
|
151
152
|
* operator-only endpoints without owning token validation.
|
|
152
153
|
* Errors thrown by the handler flow into the existing error handling.
|
|
153
154
|
*/
|
|
154
|
-
externalRequestHandler?:
|
|
155
|
-
req: IncomingMessage,
|
|
156
|
-
res: ServerResponse,
|
|
157
|
-
ctx: { authorized: boolean },
|
|
158
|
-
) => Promise<boolean>;
|
|
155
|
+
externalRequestHandler?: SupportPassportExternalRequestHandler;
|
|
159
156
|
}
|
|
160
157
|
|
|
161
158
|
export interface EngramAccessHttpServerStatus {
|
|
@@ -216,14 +213,12 @@ export interface RemnicAdminControls {
|
|
|
216
213
|
update?: (patch: RemnicAdminConfigPatch) => Promise<RemnicAdminDashboardStatus>;
|
|
217
214
|
}
|
|
218
215
|
|
|
219
|
-
function resolveDefaultAdminConsolePublicDir(): string {
|
|
220
|
-
const thisDir = path.dirname(fileURLToPath(
|
|
216
|
+
export function resolveDefaultAdminConsolePublicDir(sourceUrl = import.meta.url): string {
|
|
217
|
+
const thisDir = path.dirname(fileURLToPath(sourceUrl));
|
|
221
218
|
const candidates = [
|
|
222
|
-
|
|
223
|
-
path.resolve(thisDir, "../admin-console/public"),
|
|
224
|
-
// Bundled: admin-console inside dist/ alongside the bundle
|
|
219
|
+
path.resolve(thisDir, "../../../admin-console/public"),
|
|
220
|
+
path.resolve(thisDir, "../dist/admin-console/public"),
|
|
225
221
|
path.resolve(thisDir, "./admin-console/public"),
|
|
226
|
-
// Package root: walk up from dist/ to the package root
|
|
227
222
|
path.resolve(thisDir, "../../admin-console/public"),
|
|
228
223
|
];
|
|
229
224
|
return candidates.find((candidate) => existsSync(candidate)) ?? candidates[0];
|
|
@@ -389,8 +384,8 @@ function codingContextFromProjectTag(projectTag: string): {
|
|
|
389
384
|
};
|
|
390
385
|
}
|
|
391
386
|
|
|
392
|
-
export class EngramAccessHttpServer {
|
|
393
|
-
|
|
387
|
+
export class EngramAccessHttpServer extends SupportPassportAccessHttpBase {
|
|
388
|
+
protected readonly service: EngramAccessService;
|
|
394
389
|
private readonly host: string;
|
|
395
390
|
private readonly requestedPort: number;
|
|
396
391
|
private readonly authToken?: string;
|
|
@@ -401,18 +396,14 @@ export class EngramAccessHttpServer {
|
|
|
401
396
|
private readonly authenticatedPrincipal?: string;
|
|
402
397
|
private readonly maxBodyBytes: number;
|
|
403
398
|
private readonly adminConsoleEnabled: boolean;
|
|
404
|
-
|
|
399
|
+
protected readonly adminConsolePublicDir: string;
|
|
405
400
|
private readonly adminConsolePrefillToken?: string;
|
|
406
401
|
private readonly adminControls?: RemnicAdminControls;
|
|
407
402
|
private readonly trustPrincipalHeader: boolean;
|
|
408
403
|
private readonly adapterRegistry: AdapterRegistry | null;
|
|
409
404
|
private readonly readiness: () => AccessHttpReadinessState;
|
|
410
405
|
private readonly resourceMetadataUrl?: string;
|
|
411
|
-
private readonly externalRequestHandler?:
|
|
412
|
-
req: IncomingMessage,
|
|
413
|
-
res: ServerResponse,
|
|
414
|
-
ctx: { authorized: boolean },
|
|
415
|
-
) => Promise<boolean>;
|
|
406
|
+
private readonly externalRequestHandler?: SupportPassportExternalRequestHandler;
|
|
416
407
|
private readonly writeLimiter: WriteRateLimiter;
|
|
417
408
|
private readonly mcpServer: EngramMcpServer;
|
|
418
409
|
private server: Server | null = null;
|
|
@@ -438,6 +429,7 @@ export class EngramAccessHttpServer {
|
|
|
438
429
|
private chatTtlTimer: NodeJS.Timeout | null = null;
|
|
439
430
|
|
|
440
431
|
constructor(options: EngramAccessHttpServerOptions) {
|
|
432
|
+
super();
|
|
441
433
|
this.service = options.service;
|
|
442
434
|
this.host = options.host?.trim() || "127.0.0.1";
|
|
443
435
|
this.requestedPort = parseHttpServerPort(options.port);
|
|
@@ -722,7 +714,7 @@ export class EngramAccessHttpServer {
|
|
|
722
714
|
return result;
|
|
723
715
|
}
|
|
724
716
|
|
|
725
|
-
|
|
717
|
+
protected resolveRequestPrincipal(req: IncomingMessage): string | undefined {
|
|
726
718
|
return this.resolveRequestIdentity(req).principal;
|
|
727
719
|
}
|
|
728
720
|
|
|
@@ -821,10 +813,9 @@ export class EngramAccessHttpServer {
|
|
|
821
813
|
): Promise<void> {
|
|
822
814
|
const parsed = new URL(req.url ?? "/", `http://${hostToUrlAuthority(this.host)}`);
|
|
823
815
|
const pathname = parsed.pathname;
|
|
816
|
+
if (await this.handleSupportPassportUi(req, res, pathname)) return;
|
|
824
817
|
|
|
825
|
-
if (this.adminConsoleEnabled && await this.handleAdminConsole(req, res, pathname))
|
|
826
|
-
return;
|
|
827
|
-
}
|
|
818
|
+
if (this.adminConsoleEnabled && await this.handleAdminConsole(req, res, pathname)) return;
|
|
828
819
|
|
|
829
820
|
if (req.method === "GET" && (pathname === "/engram/v1/live" || pathname === "/engram/v1/health")) {
|
|
830
821
|
const { ready, warmupAttempts, lastError } = this.readiness();
|
|
@@ -836,8 +827,8 @@ export class EngramAccessHttpServer {
|
|
|
836
827
|
}
|
|
837
828
|
}
|
|
838
829
|
|
|
839
|
-
|
|
840
|
-
//
|
|
830
|
+
if (await this.handleSupportPassportPublicRequest(req, res)) return;
|
|
831
|
+
// Run any host-supplied pre-auth request handler after public UI assets and before the
|
|
841
832
|
// operator bearer gate. The handler decides whether it has fully
|
|
842
833
|
// owned the response (return true) or wants the request to fall
|
|
843
834
|
// through to the normal pipeline. `ctx.authorized` is computed
|
|
@@ -847,11 +838,13 @@ export class EngramAccessHttpServer {
|
|
|
847
838
|
// Operator-only endpoints (OAuth pending/approve/deny) must only pass
|
|
848
839
|
// for unrestricted tokens — a scoped (least-privileged) token must NOT
|
|
849
840
|
// reach operator surfaces (issue #1837).
|
|
850
|
-
const
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
841
|
+
const tokenAuthorized = this.isAuthorized(req, pathname);
|
|
842
|
+
const capabilities = this.resolveTokenCapabilities(req, pathname);
|
|
843
|
+
const authorized = tokenAuthorized && !isCapabilityRestricted(capabilities);
|
|
844
|
+
if (await this.externalRequestHandler(req, res, {
|
|
845
|
+
authorized,
|
|
846
|
+
tokenAuthorized,
|
|
847
|
+
})) return;
|
|
855
848
|
}
|
|
856
849
|
|
|
857
850
|
if (!this.isAuthorized(req, pathname)) {
|
|
@@ -903,10 +896,9 @@ export class EngramAccessHttpServer {
|
|
|
903
896
|
return;
|
|
904
897
|
}
|
|
905
898
|
|
|
906
|
-
if (req.method === "POST" && pathname === "/mcp")
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
}
|
|
899
|
+
if (req.method === "POST" && pathname === "/mcp") return this.handleMcpRequest(req, res, abortSignal);
|
|
900
|
+
|
|
901
|
+
if (await this.handleSupportPassportOwnerRequest(req, res, pathname, parsed.search.length > 0, abortSignal)) return;
|
|
910
902
|
|
|
911
903
|
if (req.method === "GET" && pathname === "/engram/v1/live") return this.respondJson(res, 200, { ok: true, ready: true });
|
|
912
904
|
if (req.method === "GET" && pathname === "/engram/v1/health") {
|
|
@@ -921,9 +913,10 @@ export class EngramAccessHttpServer {
|
|
|
921
913
|
if (req.method === "GET" && pathname === "/engram/v1/authorization") {
|
|
922
914
|
res.setHeader("cache-control", "no-store");
|
|
923
915
|
const probe = probeOperationAuthorization(tokenCapabilityStore.getStore(), parsed.searchParams.getAll("op"));
|
|
924
|
-
const
|
|
925
|
-
for (const namespace of authorizationProbeNamespaces(probe.operations, namespaceParam))
|
|
916
|
+
for (const namespace of authorizationProbeNamespaces(probe.operations, parsed.searchParams.get("namespace") ?? undefined))
|
|
926
917
|
this.resolveNamespace(req, namespace);
|
|
918
|
+
if (authorizationProbeRequiresPrincipalNamespace(probe.operations))
|
|
919
|
+
await this.enforceSupportPassportAuthorizationProbe(req);
|
|
927
920
|
this.respondJson(res, 200, probe);
|
|
928
921
|
return;
|
|
929
922
|
}
|
|
@@ -1854,7 +1847,7 @@ export class EngramAccessHttpServer {
|
|
|
1854
1847
|
if (!op) {
|
|
1855
1848
|
throw new Error("access-boundary: operation not registered: relay_mission_append");
|
|
1856
1849
|
}
|
|
1857
|
-
let
|
|
1850
|
+
let writeQuota: WriteRateLimitReservation | undefined;
|
|
1858
1851
|
try {
|
|
1859
1852
|
const output = (await op.run(
|
|
1860
1853
|
{ missionId, namespace, event: body.event },
|
|
@@ -1863,22 +1856,18 @@ export class EngramAccessHttpServer {
|
|
|
1863
1856
|
authenticatedPrincipal: this.resolveRequestPrincipal(req),
|
|
1864
1857
|
hooks: {
|
|
1865
1858
|
enforceWriteQuota: () => {
|
|
1866
|
-
|
|
1859
|
+
writeQuota ??= this.reserveWriteRateLimitSlot(req);
|
|
1867
1860
|
},
|
|
1868
1861
|
},
|
|
1869
1862
|
},
|
|
1870
1863
|
)) as { result: { appended: boolean; replayed: boolean; event: unknown } };
|
|
1871
1864
|
if (output.result.appended) {
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
releaseWriteQuota = undefined;
|
|
1865
|
+
writeQuota?.commit();
|
|
1866
|
+
writeQuota = undefined;
|
|
1875
1867
|
}
|
|
1876
1868
|
this.respondJson(res, output.result.appended ? 201 : 200, output.result);
|
|
1877
1869
|
} finally {
|
|
1878
|
-
|
|
1879
|
-
// does not append, or persistence throws after reservation, return the
|
|
1880
|
-
// slot so a failed write cannot exhaust the rolling window.
|
|
1881
|
-
releaseWriteQuota?.();
|
|
1870
|
+
writeQuota?.release();
|
|
1882
1871
|
}
|
|
1883
1872
|
return;
|
|
1884
1873
|
}
|
|
@@ -3271,10 +3260,6 @@ export class EngramAccessHttpServer {
|
|
|
3271
3260
|
params?: Record<string, unknown>;
|
|
3272
3261
|
};
|
|
3273
3262
|
|
|
3274
|
-
// Enforce write rate limiting for MCP tool calls that mutate state,
|
|
3275
|
-
// matching the same protection applied to the REST write endpoints.
|
|
3276
|
-
// Pre-check ensures capacity; post-check skips counting dry runs and
|
|
3277
|
-
// idempotency replays, consistent with the REST handlers.
|
|
3278
3263
|
const toolName = typeof request.params?.name === "string" ? request.params.name : "";
|
|
3279
3264
|
const toolArgs = request.params?.arguments;
|
|
3280
3265
|
const dreamsRunDryRun =
|
|
@@ -3313,6 +3298,7 @@ export class EngramAccessHttpServer {
|
|
|
3313
3298
|
const codegraphWrite =
|
|
3314
3299
|
CODEGRAPH_WRITE_TOOLS.has(toolName) ||
|
|
3315
3300
|
(isCodegraphManageAdr && (toolArgsSubcommand === "record" || toolArgsSubcommand === "supersede"));
|
|
3301
|
+
const supportPassportQuotaLimitedWrite = this.isSupportPassportQuotaLimitedWriteTool(toolName);
|
|
3316
3302
|
const isMcpWrite =
|
|
3317
3303
|
request.method === "tools/call" &&
|
|
3318
3304
|
(
|
|
@@ -3352,28 +3338,32 @@ export class EngramAccessHttpServer {
|
|
|
3352
3338
|
) ||
|
|
3353
3339
|
codingDecisionWrite ||
|
|
3354
3340
|
codingArchitectureWrite ||
|
|
3355
|
-
codegraphWrite
|
|
3341
|
+
codegraphWrite ||
|
|
3342
|
+
supportPassportQuotaLimitedWrite
|
|
3356
3343
|
);
|
|
3357
|
-
// observe self-enforces quota INSIDE its idempotency lock via the
|
|
3358
|
-
// enforceWriteQuota hook (issue #1649) — mirroring the direct
|
|
3359
|
-
// /engram/v1/observe route — so it must NOT be pre-checked here: a
|
|
3360
|
-
// pre-check would 429 a response-lost replay. It still counts as a write
|
|
3361
|
-
// for post-recording (the replay guard in shouldCountWriteRateLimit skips
|
|
3362
|
-
// the record). Other write tools keep the coarse pre-check.
|
|
3363
3344
|
const observeSelfEnforcesQuota =
|
|
3364
3345
|
toolName === "engram.observe" || toolName === "remnic.observe";
|
|
3365
3346
|
const extractionForceFlushWrite =
|
|
3366
3347
|
toolName === "engram.extraction_force_flush" || toolName === "remnic.extraction_force_flush";
|
|
3367
3348
|
let writeRateLimitRecorded = false;
|
|
3349
|
+
let supportPassportQuota: WriteRateLimitReservation | undefined;
|
|
3368
3350
|
const recordCommittedMcpWrite = extractionForceFlushWrite
|
|
3369
3351
|
? () => {
|
|
3370
3352
|
if (writeRateLimitRecorded) return;
|
|
3371
3353
|
writeRateLimitRecorded = true;
|
|
3372
3354
|
this.recordWriteRateLimitHit(req);
|
|
3373
3355
|
}
|
|
3356
|
+
: supportPassportQuotaLimitedWrite
|
|
3357
|
+
? () => {
|
|
3358
|
+
if (writeRateLimitRecorded) return;
|
|
3359
|
+
writeRateLimitRecorded = true;
|
|
3360
|
+
supportPassportQuota?.commit();
|
|
3361
|
+
supportPassportQuota = undefined;
|
|
3362
|
+
}
|
|
3374
3363
|
: undefined;
|
|
3375
3364
|
if (isMcpWrite && !observeSelfEnforcesQuota) {
|
|
3376
|
-
this.
|
|
3365
|
+
if (supportPassportQuotaLimitedWrite) supportPassportQuota = this.reserveWriteRateLimitSlot(req);
|
|
3366
|
+
else this.ensureWriteRateLimitAvailable(req);
|
|
3377
3367
|
}
|
|
3378
3368
|
|
|
3379
3369
|
const sessionId = (() => {
|
|
@@ -3417,6 +3407,9 @@ export class EngramAccessHttpServer {
|
|
|
3417
3407
|
recordWriteCommit: recordCommittedMcpWrite,
|
|
3418
3408
|
sourceConnector: this.resolveConnector(req),
|
|
3419
3409
|
abortSignal,
|
|
3410
|
+
}).catch((error) => {
|
|
3411
|
+
supportPassportQuota?.release();
|
|
3412
|
+
throw error;
|
|
3420
3413
|
});
|
|
3421
3414
|
|
|
3422
3415
|
if (isMcpWrite && response !== null) {
|
|
@@ -3437,10 +3430,16 @@ export class EngramAccessHttpServer {
|
|
|
3437
3430
|
// dryRun/idempotencyReplay guards.
|
|
3438
3431
|
const counts = structured ? this.shouldCountWriteRateLimit(structured) : true;
|
|
3439
3432
|
if (!writeRateLimitRecorded && !isError && !isRejectedCodegraph && counts) {
|
|
3440
|
-
|
|
3433
|
+
if (supportPassportQuota) {
|
|
3434
|
+
supportPassportQuota.commit();
|
|
3435
|
+
supportPassportQuota = undefined;
|
|
3436
|
+
} else {
|
|
3437
|
+
this.recordWriteRateLimitHit(req);
|
|
3438
|
+
}
|
|
3441
3439
|
writeRateLimitRecorded = true;
|
|
3442
3440
|
}
|
|
3443
3441
|
}
|
|
3442
|
+
supportPassportQuota?.release();
|
|
3444
3443
|
// A mutating tool may have committed just before the client disconnected.
|
|
3445
3444
|
// Record that side effect above, then honor cancellation before emitting
|
|
3446
3445
|
// any response. Read-only calls reach this guard without accounting.
|
|
@@ -3463,7 +3462,7 @@ export class EngramAccessHttpServer {
|
|
|
3463
3462
|
this.respondJson(res, 200, response);
|
|
3464
3463
|
}
|
|
3465
3464
|
|
|
3466
|
-
|
|
3465
|
+
protected respondJson(res: ServerResponse, status: number, payload: unknown): void {
|
|
3467
3466
|
const body = JSON.stringify(payload, null, 2);
|
|
3468
3467
|
res.statusCode = status;
|
|
3469
3468
|
res.setHeader("content-type", "application/json; charset=utf-8");
|
|
@@ -3536,17 +3535,25 @@ export class EngramAccessHttpServer {
|
|
|
3536
3535
|
return false;
|
|
3537
3536
|
}
|
|
3538
3537
|
|
|
3539
|
-
|
|
3538
|
+
protected async respondAdminConsoleShell(
|
|
3540
3539
|
req: IncomingMessage,
|
|
3541
3540
|
res: ServerResponse,
|
|
3542
3541
|
pathname: string,
|
|
3543
3542
|
relativePath = "index.html",
|
|
3543
|
+
allowPrefill = true,
|
|
3544
3544
|
): Promise<void> {
|
|
3545
3545
|
try {
|
|
3546
3546
|
let body = await readFile(path.join(this.adminConsolePublicDir, relativePath), "utf-8");
|
|
3547
|
-
const
|
|
3547
|
+
const matched = this.resolveAuthorizedEntry(req, pathname);
|
|
3548
|
+
const canPrefillToken =
|
|
3549
|
+
allowPrefill &&
|
|
3550
|
+
this.adminConsolePrefillToken &&
|
|
3551
|
+
matched !== null &&
|
|
3552
|
+
matched.capabilities === undefined &&
|
|
3553
|
+
this.timingSafeStringEqual(matched.token, this.adminConsolePrefillToken);
|
|
3548
3554
|
if (canPrefillToken) {
|
|
3549
|
-
const
|
|
3555
|
+
const serializedToken = serializeInlineScriptValue(this.adminConsolePrefillToken);
|
|
3556
|
+
const script = `<script>(function(token,script){const key="__REMNIC_ADMIN_CONSOLE_PREFILL_TOKEN__";const clear=function(){token="";try{delete window[key]}catch{window[key]=""}};window.addEventListener("pagehide",clear,{once:true});window.addEventListener("beforeunload",clear,{once:true});try{if(new URLSearchParams(location.hash.slice(1)).has("secret")){clear();return}Object.defineProperty(window,key,{configurable:true,get:function(){const value=token;clear();return value}})}finally{if(script){script.textContent="";script.remove()}}})(${serializedToken},document.currentScript);</script>`;
|
|
3550
3557
|
body = body.includes("</head>")
|
|
3551
3558
|
? body.replace("</head>", `${script}</head>`)
|
|
3552
3559
|
: `${script}${body}`;
|
|
@@ -3562,7 +3569,7 @@ export class EngramAccessHttpServer {
|
|
|
3562
3569
|
}
|
|
3563
3570
|
}
|
|
3564
3571
|
|
|
3565
|
-
|
|
3572
|
+
protected async respondStatic(res: ServerResponse, filePath: string, contentType: string): Promise<void> {
|
|
3566
3573
|
try {
|
|
3567
3574
|
const body = await readFile(filePath, "utf-8");
|
|
3568
3575
|
res.statusCode = 200;
|
|
@@ -3574,7 +3581,7 @@ export class EngramAccessHttpServer {
|
|
|
3574
3581
|
}
|
|
3575
3582
|
}
|
|
3576
3583
|
|
|
3577
|
-
|
|
3584
|
+
protected async readJsonBody(
|
|
3578
3585
|
req: IncomingMessage,
|
|
3579
3586
|
maxBodyBytes = this.maxBodyBytes,
|
|
3580
3587
|
): Promise<Record<string, unknown>> {
|
|
@@ -3961,22 +3968,22 @@ export class EngramAccessHttpServer {
|
|
|
3961
3968
|
return 200;
|
|
3962
3969
|
}
|
|
3963
3970
|
|
|
3964
|
-
|
|
3971
|
+
protected ensureWriteRateLimitAvailable(req?: IncomingMessage): void {
|
|
3965
3972
|
if (!this.writeLimiter.hasCapacity(this.principalForRateLimit(req))) {
|
|
3966
3973
|
throw new HttpError(429, "write_rate_limited", "write_rate_limited");
|
|
3967
3974
|
}
|
|
3968
3975
|
}
|
|
3969
3976
|
|
|
3970
|
-
|
|
3977
|
+
protected recordWriteRateLimitHit(req?: IncomingMessage): void {
|
|
3971
3978
|
this.writeLimiter.record(this.principalForRateLimit(req));
|
|
3972
3979
|
}
|
|
3973
3980
|
|
|
3974
|
-
|
|
3975
|
-
const
|
|
3976
|
-
if (!
|
|
3981
|
+
protected reserveWriteRateLimitSlot(req?: IncomingMessage): WriteRateLimitReservation {
|
|
3982
|
+
const reservation = this.writeLimiter.reserve(this.principalForRateLimit(req));
|
|
3983
|
+
if (!reservation) {
|
|
3977
3984
|
throw new HttpError(429, "write_rate_limited", "write_rate_limited");
|
|
3978
3985
|
}
|
|
3979
|
-
return
|
|
3986
|
+
return reservation;
|
|
3980
3987
|
}
|
|
3981
3988
|
|
|
3982
3989
|
private principalForRateLimit(req?: IncomingMessage): string | undefined {
|
package/src/access-mcp.ts
CHANGED
|
@@ -41,13 +41,13 @@ import { resolvePrincipal } from "./namespaces/principal.js";
|
|
|
41
41
|
import { readEnvVar } from "./runtime/env.js";
|
|
42
42
|
import type { RecallDisclosure, RecallPlanMode } from "./types.js";
|
|
43
43
|
import { expandTildePath } from "./utils/path.js";
|
|
44
|
-
|
|
45
44
|
import { applyToolOutputSchemas } from "./access-mcp-output-schemas.js";
|
|
46
45
|
import { MCP_READ_ONLY_TOOL_SUFFIXES } from "./mcp-read-only-tools.js";
|
|
47
46
|
import { MEETINGS_MCP_TOOLS } from "./meetings/mcp-tools.js";
|
|
48
47
|
import { WEARABLES_MCP_TOOLS } from "./wearables/mcp-tools.js";
|
|
49
48
|
import { EXTERNAL_WIKI_MCP_TOOLS } from "./external-wiki-mcp-tools.js";
|
|
50
49
|
import { abortError, isAbortError } from "./abort-error.js";
|
|
50
|
+
import { SUPPORT_PASSPORT_MCP_MIGRATED_OPERATIONS, SUPPORT_PASSPORT_MCP_TOOLS } from "./support-passport/mcp-tools.js";
|
|
51
51
|
type JsonRpcId = string | number | null;
|
|
52
52
|
|
|
53
53
|
type JsonRpcRequest = {
|
|
@@ -264,6 +264,7 @@ const MCP_MIGRATED_OPERATIONS: Readonly<Record<string, OperationName>> = {
|
|
|
264
264
|
"engram.console_state": "console_state",
|
|
265
265
|
"engram.dreams_status": "dreams_status",
|
|
266
266
|
"engram.dreams_run": "dreams_run",
|
|
267
|
+
...SUPPORT_PASSPORT_MCP_MIGRATED_OPERATIONS,
|
|
267
268
|
"engram.memory_chat": "chat_message",
|
|
268
269
|
};
|
|
269
270
|
|
|
@@ -687,6 +688,7 @@ export class EngramMcpServer {
|
|
|
687
688
|
},
|
|
688
689
|
},
|
|
689
690
|
...WEARABLES_MCP_TOOLS, ...MEETINGS_MCP_TOOLS,
|
|
691
|
+
...(service.supportPassportEnabled ? SUPPORT_PASSPORT_MCP_TOOLS : []),
|
|
690
692
|
{
|
|
691
693
|
name: "engram.action_confidence",
|
|
692
694
|
description:
|
|
@@ -299,6 +299,7 @@ export async function searchWithGenericExclusion<TResult extends { path: string
|
|
|
299
299
|
*/
|
|
300
300
|
sendInitialLimit: boolean;
|
|
301
301
|
search(limit: number | undefined): Promise<TResult[]>;
|
|
302
|
+
filterPrivate(results: TResult[]): Promise<TResult[]>;
|
|
302
303
|
isExcluded(memoryPath: string): boolean;
|
|
303
304
|
}): Promise<TResult[]> {
|
|
304
305
|
const { budget } = options;
|
|
@@ -313,7 +314,8 @@ export async function searchWithGenericExclusion<TResult extends { path: string
|
|
|
313
314
|
let firstPage = true;
|
|
314
315
|
for (;;) {
|
|
315
316
|
const raw = await options.search(limit);
|
|
316
|
-
|
|
317
|
+
const eligible = raw.filter((hit) => !options.isExcluded(hit.path));
|
|
318
|
+
results = await options.filterPrivate(eligible);
|
|
317
319
|
if (firstPage) {
|
|
318
320
|
firstPage = false;
|
|
319
321
|
if (!options.sendInitialLimit) target = Math.min(budget, raw.length);
|
|
@@ -358,6 +360,9 @@ export async function runScopedMemorySearch(options: {
|
|
|
358
360
|
mode?: "search" | "hybrid" | "bm25" | "vector";
|
|
359
361
|
namespacesEnabled: boolean;
|
|
360
362
|
isExcluded(memoryPath: string): boolean;
|
|
363
|
+
filterPrivate(
|
|
364
|
+
results: Array<{ path: string; score: number; snippet?: string }>,
|
|
365
|
+
): Promise<Array<{ path: string; score: number; snippet?: string }>>;
|
|
361
366
|
flatCorpus(
|
|
362
367
|
limit: number | undefined,
|
|
363
368
|
): Promise<Array<{ path: string; score: number; snippet?: string }>>;
|
|
@@ -370,6 +375,7 @@ export async function runScopedMemorySearch(options: {
|
|
|
370
375
|
budget: options.budget,
|
|
371
376
|
sendInitialLimit: options.sendInitialLimit,
|
|
372
377
|
isExcluded: options.isExcluded,
|
|
378
|
+
filterPrivate: options.filterPrivate,
|
|
373
379
|
search: (limit) =>
|
|
374
380
|
options.namespacesEnabled ? options.namespaced(limit) : options.flatCorpus(limit),
|
|
375
381
|
});
|
|
@@ -384,7 +390,14 @@ export async function runScopedMemorySearch(options: {
|
|
|
384
390
|
export interface ScopedMemorySearchDeps {
|
|
385
391
|
namespacesEnabled: boolean;
|
|
386
392
|
defaultBudget: number;
|
|
393
|
+
memoryCollections: readonly string[];
|
|
387
394
|
isExcluded(memoryPath: string): boolean;
|
|
395
|
+
filterPrivate(
|
|
396
|
+
results: Array<{ path: string; score: number; snippet?: string }>,
|
|
397
|
+
namespaces: readonly string[],
|
|
398
|
+
preserveUnresolved?: boolean,
|
|
399
|
+
visibilityCache?: Map<string, boolean>,
|
|
400
|
+
): Promise<Array<{ path: string; score: number; snippet?: string }>>;
|
|
388
401
|
/** Flat-corpus authorization; throws when the namespace is unreadable. */
|
|
389
402
|
authorizeFlatCorpus(namespace: string | undefined, principal: string | undefined): void;
|
|
390
403
|
/** Namespace-aware authorization; throws, else returns the search fan-out. */
|
|
@@ -437,10 +450,20 @@ export async function memorySearchThroughScope(
|
|
|
437
450
|
throw new EngramAccessInputError("collection must be a non-empty string");
|
|
438
451
|
}
|
|
439
452
|
let searchNamespaces: string[] = [];
|
|
453
|
+
const privateVisibilityCache = new Map<string, boolean>();
|
|
440
454
|
const results = await runScopedMemorySearch({
|
|
441
455
|
query, collection, mode,
|
|
442
456
|
namespacesEnabled: deps.namespacesEnabled,
|
|
443
457
|
isExcluded: deps.isExcluded,
|
|
458
|
+
filterPrivate: (results) => deps.filterPrivate(
|
|
459
|
+
results,
|
|
460
|
+
searchNamespaces,
|
|
461
|
+
!deps.namespacesEnabled &&
|
|
462
|
+
collection !== undefined &&
|
|
463
|
+
collection !== "global" &&
|
|
464
|
+
!deps.memoryCollections.includes(collection),
|
|
465
|
+
privateVisibilityCache,
|
|
466
|
+
),
|
|
444
467
|
budget: maxResults ?? deps.defaultBudget,
|
|
445
468
|
sendInitialLimit: maxResults !== undefined,
|
|
446
469
|
authorizeScope: async () => {
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
type ReconcileManifestFile,
|
|
11
11
|
type ReconcileMemoryParser,
|
|
12
12
|
} from "./reconcile/manifest.js";
|
|
13
|
+
import { isSupportPassportPrivateMemory } from "./support-passport/card-projection.js";
|
|
13
14
|
|
|
14
15
|
export interface OfflineSyncManifestRequest {
|
|
15
16
|
includeTranscripts?: boolean;
|
|
@@ -36,6 +37,10 @@ export async function createOfflineSyncManifestStream(
|
|
|
36
37
|
readFileDigest: async ({ filePath }) => storage.digestOfflineSyncFile(filePath),
|
|
37
38
|
signal: options.signal,
|
|
38
39
|
userExcludeRegexps,
|
|
40
|
+
excludeFile: async ({ filePath }) => {
|
|
41
|
+
const memory = await storage.readMemoryByPath(filePath);
|
|
42
|
+
return memory ? isSupportPassportPrivateMemory(memory) : false;
|
|
43
|
+
},
|
|
39
44
|
});
|
|
40
45
|
return {
|
|
41
46
|
namespace,
|
package/src/access-operations.ts
CHANGED
|
@@ -689,6 +689,8 @@ export const codegraphIngestTracesOperation = defineOperation<
|
|
|
689
689
|
// Batch-migrated operations (issue #1525): registers all remaining
|
|
690
690
|
// handlers through the boundary as a side effect of importing this module.
|
|
691
691
|
import "./access-operations-batch.js";
|
|
692
|
+
// Owner-controlled support passport operations (issue #2355).
|
|
693
|
+
import "./support-passport/access-operations.js";
|
|
692
694
|
// Remnic Relay mission evidence operations (issue #1966).
|
|
693
695
|
import "./relay/mission-access.js";
|
|
694
696
|
|
|
@@ -71,6 +71,9 @@ function makeService(): {
|
|
|
71
71
|
maxResults?: number;
|
|
72
72
|
mode?: string;
|
|
73
73
|
}): Promise<unknown[]>;
|
|
74
|
+
filterPrivateSearchResults(
|
|
75
|
+
results: Array<{ path: string; score: number; snippet?: string }>,
|
|
76
|
+
): Promise<Array<{ path: string; score: number; snippet?: string }>>;
|
|
74
77
|
};
|
|
75
78
|
}).orchestrator = {
|
|
76
79
|
config: makeConfig(),
|
|
@@ -92,6 +95,9 @@ function makeService(): {
|
|
|
92
95
|
async searchAcrossNamespaces() {
|
|
93
96
|
return [];
|
|
94
97
|
},
|
|
98
|
+
async filterPrivateSearchResults(results) {
|
|
99
|
+
return results;
|
|
100
|
+
},
|
|
95
101
|
};
|
|
96
102
|
|
|
97
103
|
return { service, storage, getStorageCalls };
|
|
@@ -1343,6 +1349,9 @@ test("offlineSyncSnapshot does not trust client base capture time for server fas
|
|
|
1343
1349
|
async readDeletionRevisions() {
|
|
1344
1350
|
return new Map<string, number>();
|
|
1345
1351
|
},
|
|
1352
|
+
async readMemoryByPath() {
|
|
1353
|
+
return null;
|
|
1354
|
+
},
|
|
1346
1355
|
async readOfflineSyncFile(targetPath: string) {
|
|
1347
1356
|
return readFile(targetPath);
|
|
1348
1357
|
},
|
|
@@ -1410,6 +1419,9 @@ test("offlineSyncSnapshot drains pending recall-impression spills so a recorded
|
|
|
1410
1419
|
async readDeletionRevisions() {
|
|
1411
1420
|
return new Map<string, number>();
|
|
1412
1421
|
},
|
|
1422
|
+
async readMemoryByPath() {
|
|
1423
|
+
return null;
|
|
1424
|
+
},
|
|
1413
1425
|
async readOfflineSyncFile(targetPath: string) {
|
|
1414
1426
|
return readFile(targetPath);
|
|
1415
1427
|
},
|
|
@@ -1688,6 +1700,7 @@ function makeServiceWithConfig(config: PluginConfig): {
|
|
|
1688
1700
|
mode?: string;
|
|
1689
1701
|
execution?: unknown;
|
|
1690
1702
|
}): Promise<unknown[]>;
|
|
1703
|
+
filterPrivateSearchResults(results: unknown[]): Promise<unknown[]>;
|
|
1691
1704
|
};
|
|
1692
1705
|
const orchestrator: OrchLike = {
|
|
1693
1706
|
config,
|
|
@@ -1701,6 +1714,7 @@ function makeServiceWithConfig(config: PluginConfig): {
|
|
|
1701
1714
|
captured.execution = params.execution;
|
|
1702
1715
|
return [];
|
|
1703
1716
|
},
|
|
1717
|
+
async filterPrivateSearchResults(results) { return results; },
|
|
1704
1718
|
};
|
|
1705
1719
|
(service as unknown as { orchestrator: OrchLike }).orchestrator = orchestrator;
|
|
1706
1720
|
return { service, captured };
|
|
@@ -1140,6 +1140,7 @@ test("#1501 implicit memorySearch honors active scope profile readOrder", async
|
|
|
1140
1140
|
config,
|
|
1141
1141
|
qmd: { isAvailable: () => true },
|
|
1142
1142
|
getStorage: async () => ({ dir: config.memoryDir } as StorageManager),
|
|
1143
|
+
filterPrivateSearchResults: async (results: unknown[]) => results,
|
|
1143
1144
|
searchAcrossNamespaces: async (options: { namespaces: string[] }) => {
|
|
1144
1145
|
searchedNamespaces = options.namespaces;
|
|
1145
1146
|
return [];
|
|
@@ -1193,6 +1194,7 @@ test("#1501 memorySearch collection names stay constrained to active scope profi
|
|
|
1193
1194
|
config,
|
|
1194
1195
|
qmd: { isAvailable: () => true },
|
|
1195
1196
|
getStorage: async () => ({ dir: config.memoryDir } as StorageManager),
|
|
1197
|
+
filterPrivateSearchResults: async (results: unknown[]) => results,
|
|
1196
1198
|
searchAcrossNamespaces: async (options: { namespaces: string[] }) => {
|
|
1197
1199
|
searchedNamespaces = options.namespaces;
|
|
1198
1200
|
return [];
|