@remnic/core 10.0.6 → 10.0.8
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.js +66 -64
- package/dist/access-authorization-probe.js +67 -65
- package/dist/access-boundary.js +66 -64
- package/dist/access-cli.js +133 -131
- package/dist/access-cli.js.map +1 -1
- package/dist/access-extraction-force-flush.js +66 -64
- package/dist/access-http-briefing.js +67 -65
- package/dist/access-http-query.js +68 -66
- package/dist/access-http.js +90 -88
- package/dist/access-idempotency.d.ts.map +1 -1
- package/dist/access-idempotency.js +2 -1
- package/dist/access-identity-continuity-surface.js +66 -64
- package/dist/access-lcm-surface.js +66 -64
- package/dist/access-mcp.js +79 -77
- package/dist/access-namespace-preflight.js +66 -64
- package/dist/access-observe-write-category.js +15 -14
- package/dist/access-observe-write-surface.js +66 -64
- package/dist/access-offline-manifest.js +12 -11
- package/dist/access-operations-batch.js +70 -68
- package/dist/access-operations.js +77 -75
- package/dist/access-recall-concurrency.js +66 -64
- package/dist/access-recall-response.js +66 -64
- package/dist/access-recall-surface.js +66 -64
- package/dist/access-schema.js +10 -9
- package/dist/access-service.js +66 -64
- package/dist/access-surface-catalog.js +68 -66
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/active-recall.js +28 -27
- package/dist/active-recall.js.map +1 -1
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-FN7E3OTO.js → auto-sync-WSJAOLOP.js} +8 -7
- package/dist/{auto-sync-FN7E3OTO.js.map → auto-sync-WSJAOLOP.js.map} +1 -1
- package/dist/briefing.js +20 -19
- package/dist/buffer.js +13 -12
- package/dist/{capsule-merge-42GJGDUC.js → capsule-merge-M4HETD27.js} +5 -4
- package/dist/{capsule-merge-42GJGDUC.js.map → capsule-merge-M4HETD27.js.map} +1 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.js +23 -22
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.js +4 -3
- package/dist/causal-trajectory-graph.js.map +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-OZABSIOV.js → chunk-2AFHZTPI.js} +2 -2
- package/dist/{chunk-UK5EH7AI.js → chunk-2CXQZXWM.js} +3 -3
- package/dist/{chunk-D6M3VKMY.js → chunk-2K7D6EFT.js} +3 -3
- package/dist/{chunk-RIEGCK2W.js → chunk-2KRNPFPK.js} +2 -2
- package/dist/{chunk-N7QV3CMX.js → chunk-2NCBDGND.js} +2 -2
- package/dist/{chunk-XQSJXNWC.js → chunk-3ENX2RB4.js} +2 -2
- package/dist/{chunk-CLCMDKTB.js → chunk-3I3U6FFT.js} +2 -2
- package/dist/{chunk-WWLAKRMX.js → chunk-3NFN4Y4P.js} +5 -5
- package/dist/{chunk-I56MTWE7.js → chunk-3R6SLDTH.js} +2 -2
- package/dist/{chunk-QEPL7KIZ.js → chunk-3VTNNO2B.js} +6 -6
- package/dist/{chunk-QWUJWBZ5.js → chunk-4G4B3Z2B.js} +2 -2
- package/dist/{chunk-R7QY5ZVB.js → chunk-4NDWE44P.js} +2 -2
- package/dist/{chunk-KCCZFDJD.js → chunk-4OKPH6FG.js} +2 -2
- package/dist/{chunk-I25RQA65.js → chunk-55ZVZBX4.js} +2 -2
- package/dist/{chunk-ENNC3RZ6.js → chunk-5EOV7ANU.js} +2 -2
- package/dist/{chunk-ANZXWOYD.js → chunk-5FNVK7MW.js} +2 -2
- package/dist/{chunk-VFUEZZBS.js → chunk-5JMI26Q7.js} +5 -4
- package/dist/chunk-5JMI26Q7.js.map +1 -0
- package/dist/{chunk-KSUOM3YU.js → chunk-5NOPZYNI.js} +11 -11
- package/dist/{chunk-7LYRFI5A.js → chunk-5Q4NQNW7.js} +2 -2
- package/dist/chunk-5VC7J76U.js +134 -0
- package/dist/chunk-5VC7J76U.js.map +1 -0
- package/dist/{chunk-L3PWXD73.js → chunk-6PHB45IU.js} +2 -2
- package/dist/{chunk-CHDGJJV6.js → chunk-6VAHJ2F6.js} +2 -2
- package/dist/{chunk-KQT4DRKF.js → chunk-76KHEHT2.js} +2 -2
- package/dist/chunk-7LEQREP2.js +9 -0
- package/dist/chunk-7LEQREP2.js.map +1 -0
- package/dist/{chunk-SWRN6U7Q.js → chunk-7O252IE6.js} +2 -2
- package/dist/{chunk-U6HWKOGD.js → chunk-7OAIOE5P.js} +2 -2
- package/dist/{chunk-RSMIRLKM.js → chunk-7UX44C4N.js} +2 -2
- package/dist/{chunk-DJMVSUPK.js → chunk-A6G7K273.js} +4 -4
- package/dist/{chunk-VC4J4UTI.js → chunk-AAM66QCP.js} +5 -5
- package/dist/{chunk-TZQOCQXB.js → chunk-AL6EHLB5.js} +2 -2
- package/dist/{chunk-IJ4FEGZR.js → chunk-AMFCRZYB.js} +2 -2
- package/dist/{chunk-4K2H4KTR.js → chunk-AV46CT77.js} +3 -3
- package/dist/{chunk-7PZHH4KC.js → chunk-AZEZSQ5R.js} +23 -2
- package/dist/chunk-AZEZSQ5R.js.map +1 -0
- package/dist/{chunk-VZBW6CDG.js → chunk-BOOFTFFE.js} +1 -1
- package/dist/{chunk-2UF42WXV.js → chunk-BPY4RRTF.js} +16 -16
- package/dist/{chunk-2U3R3DDH.js → chunk-BTJ6CAIA.js} +2 -2
- package/dist/{chunk-GF4H3B3R.js → chunk-C3WJNRGR.js} +3 -3
- package/dist/{chunk-SIYZDT2V.js → chunk-CBP4HWCL.js} +3 -3
- package/dist/{chunk-GEGUBU3D.js → chunk-CSUAHUOH.js} +3 -3
- package/dist/{chunk-AJ6ORARY.js → chunk-DGRMWDQY.js} +12 -12
- package/dist/chunk-DGRMWDQY.js.map +1 -0
- package/dist/{chunk-BNMI3JBV.js → chunk-DXHVD4DS.js} +3 -3
- package/dist/{chunk-GE6HETIF.js → chunk-E5274WUC.js} +2 -2
- package/dist/{chunk-2COXDQ6C.js → chunk-E6KXJSMA.js} +2 -2
- package/dist/{chunk-FFAZ2XFU.js → chunk-EHRE7ZG3.js} +5 -6
- package/dist/chunk-EHRE7ZG3.js.map +1 -0
- package/dist/{chunk-CCMXCZLT.js → chunk-FBVLTTVV.js} +7 -7
- package/dist/{chunk-XVC7JU2N.js → chunk-FQD2KPQH.js} +2 -2
- package/dist/{chunk-SNXBXYUE.js → chunk-GDI64ITR.js} +3 -3
- package/dist/{chunk-MH2DXDN6.js → chunk-GSAZBZMA.js} +2 -2
- package/dist/{chunk-MULNBSPP.js → chunk-HT2C4EXO.js} +2 -2
- package/dist/{chunk-EMVJU7WC.js → chunk-HZVYDWUP.js} +2 -2
- package/dist/{chunk-XPRAOTJY.js → chunk-IJWEXCWF.js} +2 -2
- package/dist/{chunk-L2VS27PZ.js → chunk-IOM5QSNR.js} +4 -4
- package/dist/{chunk-KQAFEZQX.js → chunk-IPLYGWQF.js} +5 -5
- package/dist/{chunk-TDMNADPI.js → chunk-JK3DYMOC.js} +2 -2
- package/dist/{chunk-SZXPKUMN.js → chunk-JSIQSZXI.js} +4 -4
- package/dist/{chunk-KQI2PKYP.js → chunk-JTUKDLAD.js} +2 -2
- package/dist/{chunk-TL4PM7PC.js → chunk-K3DZ3G5I.js} +2 -2
- package/dist/{chunk-WG4TMZJ2.js → chunk-KDYQYMJZ.js} +2 -2
- package/dist/{chunk-N4PYB235.js → chunk-KI6UOSNR.js} +2 -2
- package/dist/{chunk-FC6RCOIU.js → chunk-KRIEQCKE.js} +2 -2
- package/dist/{chunk-EQUD7FP4.js → chunk-KYY4EACB.js} +2 -2
- package/dist/{chunk-QMFKW4OU.js → chunk-L3Z4NXDO.js} +3 -3
- package/dist/{chunk-KE5PWLI6.js → chunk-LOFVW6JA.js} +3 -3
- package/dist/{chunk-46WM6JX2.js → chunk-LZKOVXMX.js} +2 -2
- package/dist/{chunk-JMF5Q4JY.js → chunk-MAJ2OKE4.js} +9 -9
- package/dist/{chunk-U6OXJQEH.js → chunk-MB5EJ2CT.js} +5 -5
- package/dist/{chunk-VUEG3TZ4.js → chunk-MVRIW6MI.js} +2 -2
- package/dist/{chunk-TGF43K66.js → chunk-MZBWIJJN.js} +9 -9
- package/dist/{chunk-QGLEM46C.js → chunk-N44GZ73R.js} +8 -8
- package/dist/{chunk-63UNVGZW.js → chunk-N6UMXWBA.js} +4 -4
- package/dist/{chunk-FLV7M7CT.js → chunk-NAHUBSUF.js} +2 -2
- package/dist/{chunk-S5TGRZWY.js → chunk-NXLQQ6WI.js} +3 -3
- package/dist/{chunk-DTXN4NVD.js → chunk-NYVKLB2I.js} +46 -46
- package/dist/chunk-NYVKLB2I.js.map +1 -0
- package/dist/{chunk-YJAOYEWI.js → chunk-OC6JYPZX.js} +21 -44
- package/dist/chunk-OC6JYPZX.js.map +1 -0
- package/dist/{chunk-5AYUHSAU.js → chunk-OFCHT2TN.js} +2 -2
- package/dist/{chunk-HRZZJ4XB.js → chunk-P2S6P7X6.js} +2 -2
- package/dist/{chunk-OGVJXIHX.js → chunk-PBVNVKYN.js} +2 -2
- package/dist/{chunk-2CP577K6.js → chunk-PPIASWWR.js} +2 -2
- package/dist/{chunk-6C76FZRM.js → chunk-QFIPSKPC.js} +2 -2
- package/dist/{chunk-Q562GF7J.js → chunk-QN77HA6P.js} +2 -2
- package/dist/{chunk-MFZACYZ6.js → chunk-QUNDYIYZ.js} +3 -3
- package/dist/{chunk-L34W4W4I.js → chunk-QW7G7PWN.js} +2 -2
- package/dist/{chunk-W5XWHTDO.js → chunk-QZZPUREO.js} +3 -3
- package/dist/{chunk-JA72X46J.js → chunk-R2AWYR4Q.js} +2 -2
- package/dist/{chunk-YRULQW5J.js → chunk-RBJQYMMT.js} +4 -4
- package/dist/{chunk-6KHF6PAB.js → chunk-RH6QEGCT.js} +3 -3
- package/dist/{chunk-QRZMJ2WN.js → chunk-RNPJ4GQA.js} +2 -2
- package/dist/{chunk-TRBLJU6Y.js → chunk-S4GUMZRB.js} +40 -40
- package/dist/{chunk-MQNOIH2C.js → chunk-SQ2O52SU.js} +3 -3
- package/dist/{chunk-EP5WXE2G.js → chunk-TCYLCPC6.js} +2 -2
- package/dist/{chunk-7CZIKCJR.js → chunk-V4WSQYO6.js} +82 -82
- package/dist/{chunk-7CZIKCJR.js.map → chunk-V4WSQYO6.js.map} +1 -1
- package/dist/{chunk-PO7NXNGC.js → chunk-VFTK5WKI.js} +2 -2
- package/dist/{chunk-JA54KIYD.js → chunk-VSHRMIJH.js} +2 -2
- package/dist/{chunk-5BPXMAUP.js → chunk-VUQDJ3JB.js} +4 -4
- package/dist/{chunk-7CXL25AA.js → chunk-W4RLOZOG.js} +3 -3
- package/dist/{chunk-LHRQBMJN.js → chunk-WADSXS4K.js} +2 -2
- package/dist/{chunk-Y7427SL7.js → chunk-WCGJK4NQ.js} +4 -4
- package/dist/{chunk-37HCPM56.js → chunk-WJLGUY27.js} +18 -18
- package/dist/{chunk-YGPXV546.js → chunk-WPFSZZ35.js} +2 -2
- package/dist/{chunk-IM2GO42H.js → chunk-WVHRNAXL.js} +4 -4
- package/dist/chunk-WVHRNAXL.js.map +1 -0
- package/dist/{chunk-UXIZ5XN5.js → chunk-XLIK2VDE.js} +3 -3
- package/dist/{chunk-64S6X4IU.js → chunk-XTN54NML.js} +4 -4
- package/dist/{chunk-2UPTRDGM.js → chunk-Y6DZ33PA.js} +4 -4
- package/dist/{chunk-4JNTGPBR.js → chunk-YAF3NRNC.js} +2 -2
- package/dist/{chunk-IFCKHPY4.js → chunk-YDH2FSDI.js} +2 -2
- package/dist/{chunk-L6GNS5GB.js → chunk-YS7SA4HD.js} +2 -2
- package/dist/{chunk-EIFYYHAF.js → chunk-YYO447A7.js} +4 -4
- package/dist/{chunk-75PT4N7Q.js → chunk-ZI7LMSNI.js} +2 -2
- package/dist/{chunk-EUT2WCWS.js → chunk-ZQ3WU6JO.js} +2 -2
- package/dist/{chunk-YJEUHGZZ.js → chunk-ZQYAE2C5.js} +2 -2
- package/dist/{chunk-JYG2334B.js → chunk-ZSJGYC3C.js} +2 -2
- package/dist/cli.js +108 -106
- package/dist/coding/export-okf-codegraph.js +20 -19
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.js +21 -20
- package/dist/config.js +28 -27
- package/dist/connectors/codex-materialize-runner.js +20 -19
- package/dist/connectors/index.js +20 -19
- package/dist/consolidation-provenance-check.js +5 -4
- package/dist/consolidation-undo.js +4 -3
- package/dist/consolidation-undo.js.map +1 -1
- package/dist/contradiction/index.js +6 -5
- package/dist/convergence-refresh.js +22 -21
- package/dist/corpus-watermark.js +22 -21
- package/dist/deep-recall-http-glue.js +11 -10
- package/dist/deep-recall.js +2 -2
- package/dist/embedding-fallback.js +4 -3
- package/dist/embedding-generation-lock.js +3 -2
- package/dist/entity-retrieval.js +20 -19
- package/dist/explicit-capture.js +8 -7
- package/dist/external-wiki-access.js +67 -65
- package/dist/extraction.js +25 -24
- package/dist/{forget-SZ2BXDGF.js → forget-OHAJ6PSU.js} +4 -3
- package/dist/{forget-SZ2BXDGF.js.map → forget-OHAJ6PSU.js.map} +1 -1
- package/dist/{graph-edge-decay-PVKDKLQK.js → graph-edge-decay-CZ3SYLM4.js} +7 -6
- package/dist/graph-jsonl.js +5 -4
- package/dist/graph-snapshot.js +5 -4
- package/dist/graph-write-lock.js +3 -2
- package/dist/graph.js +4 -3
- package/dist/harmonic-retrieval.d.ts.map +1 -1
- package/dist/harmonic-retrieval.js +22 -20
- package/dist/harmonic-source-lookup.d.ts +14 -0
- package/dist/harmonic-source-lookup.d.ts.map +1 -0
- package/dist/harmonic-source-lookup.js +22 -0
- package/dist/http-retry.d.ts.map +1 -1
- package/dist/http-retry.js +6 -8
- package/dist/http-retry.js.map +1 -1
- package/dist/index.js +144 -142
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.js +4 -4
- package/dist/location/index.js +23 -22
- package/dist/maintenance/memory-governance.js +20 -19
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +20 -19
- package/dist/maintenance/rebuild-memory-projection-runner.js +22 -21
- package/dist/maintenance/rebuild-memory-projection.js +21 -20
- package/dist/memory-browse-operations.js +67 -65
- package/dist/memory-browse.js +8 -7
- package/dist/memory-projection-batch.d.ts +2 -0
- package/dist/memory-projection-batch.d.ts.map +1 -1
- package/dist/memory-projection-batch.js +4 -1
- package/dist/memory-subject.js +4 -3
- package/dist/namespaces/migrate.js +21 -20
- package/dist/namespaces/search.js +8 -7
- package/dist/namespaces/storage.js +20 -19
- package/dist/offline-sync-changeset-generations.js +6 -5
- package/dist/offline-sync-embedding-generation.js +5 -4
- package/dist/offline-sync-impression-drain.js +4 -3
- package/dist/offline-sync-snapshot-stream.js +8 -7
- package/dist/offline-sync.js +9 -8
- package/dist/operator-doctor-corpus.js +23 -22
- package/dist/operator-toolkit.js +40 -39
- package/dist/orchestration/maintenance.js +30 -29
- package/dist/orchestrator.js +133 -131
- package/dist/page-versioning.js +4 -3
- package/dist/procedural/procedure-miner.d.ts.map +1 -1
- package/dist/qmd-daemon-session.d.ts.map +1 -1
- package/dist/qmd-daemon-session.js +2 -1
- package/dist/qmd.d.ts.map +1 -1
- package/dist/qmd.js +7 -6
- package/dist/recall-navigation-operations.js +67 -65
- package/dist/recall-navigation.js +66 -64
- package/dist/recall-state-view-admission.js +8 -7
- package/dist/recall-state.js +3 -2
- package/dist/recall-why-service.js +8 -7
- package/dist/reconcile/manifest.js +4 -3
- package/dist/{resolution-TV3F7ZTH.js → resolution-E4GLHLY6.js} +7 -6
- package/dist/resolution-E4GLHLY6.js.map +1 -0
- package/dist/resume-bundles.js +29 -28
- package/dist/salvage-envelope.js +6 -5
- package/dist/search/factory.js +7 -6
- package/dist/search/index.js +9 -8
- package/dist/semantic-consolidation.js +21 -20
- package/dist/semantic-rule-promotion.js +20 -19
- package/dist/semantic-rule-verifier.js +20 -19
- package/dist/source-agent-qualifier.js +24 -23
- package/dist/standup/build.js +20 -19
- package/dist/storage.js +19 -18
- package/dist/subject-config.js +5 -4
- package/dist/summarizer.js +4 -3
- package/dist/summary-snapshot.js +3 -2
- package/dist/support-passport/index.js +69 -67
- package/dist/testing/orchestrator-lite.d.ts +1 -2
- package/dist/testing/orchestrator-lite.d.ts.map +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/capsule-import.js +5 -4
- package/dist/transfer/export-okf.js +20 -19
- package/dist/utils/serialize-mutations.d.ts.map +1 -1
- package/dist/utils/serialize-mutations.js +2 -1
- package/dist/utils/sleep.d.ts +3 -0
- package/dist/utils/sleep.d.ts.map +1 -0
- package/dist/verified-recall.js +20 -19
- package/dist/who-knows-cli.js +21 -20
- package/dist/who-knows.js +20 -19
- package/dist/write-envelope.js +5 -4
- package/package.json +2 -2
- package/src/access-idempotency.ts +1 -4
- package/src/harmonic-retrieval.ts +12 -64
- package/src/harmonic-source-lookup.test.ts +178 -0
- package/src/harmonic-source-lookup.ts +142 -0
- package/src/http-retry.ts +2 -6
- package/src/memory-projection-batch.test.ts +55 -0
- package/src/memory-projection-batch.ts +20 -0
- package/src/offline-sync-digest-cache.test.ts +45 -0
- package/src/orchestration/recall-internal.ts +12 -12
- package/src/procedural/procedure-miner.ts +1 -4
- package/src/qmd-daemon-session.ts +1 -4
- package/src/qmd.ts +0 -4
- package/src/recall-harmonic-qmd-ordering.test.ts +304 -0
- package/src/testing/orchestrator-lite.ts +2 -7
- package/src/utils/serialize-mutations.ts +1 -13
- package/src/utils/sleep.test.ts +32 -0
- package/src/utils/sleep.ts +5 -0
- package/dist/chunk-7PZHH4KC.js.map +0 -1
- package/dist/chunk-AJ6ORARY.js.map +0 -1
- package/dist/chunk-DTXN4NVD.js.map +0 -1
- package/dist/chunk-FFAZ2XFU.js.map +0 -1
- package/dist/chunk-IM2GO42H.js.map +0 -1
- package/dist/chunk-VFUEZZBS.js.map +0 -1
- package/dist/chunk-YJAOYEWI.js.map +0 -1
- /package/dist/{chunk-OZABSIOV.js.map → chunk-2AFHZTPI.js.map} +0 -0
- /package/dist/{chunk-UK5EH7AI.js.map → chunk-2CXQZXWM.js.map} +0 -0
- /package/dist/{chunk-D6M3VKMY.js.map → chunk-2K7D6EFT.js.map} +0 -0
- /package/dist/{chunk-RIEGCK2W.js.map → chunk-2KRNPFPK.js.map} +0 -0
- /package/dist/{chunk-N7QV3CMX.js.map → chunk-2NCBDGND.js.map} +0 -0
- /package/dist/{chunk-XQSJXNWC.js.map → chunk-3ENX2RB4.js.map} +0 -0
- /package/dist/{chunk-CLCMDKTB.js.map → chunk-3I3U6FFT.js.map} +0 -0
- /package/dist/{chunk-WWLAKRMX.js.map → chunk-3NFN4Y4P.js.map} +0 -0
- /package/dist/{chunk-I56MTWE7.js.map → chunk-3R6SLDTH.js.map} +0 -0
- /package/dist/{chunk-QEPL7KIZ.js.map → chunk-3VTNNO2B.js.map} +0 -0
- /package/dist/{chunk-QWUJWBZ5.js.map → chunk-4G4B3Z2B.js.map} +0 -0
- /package/dist/{chunk-R7QY5ZVB.js.map → chunk-4NDWE44P.js.map} +0 -0
- /package/dist/{chunk-KCCZFDJD.js.map → chunk-4OKPH6FG.js.map} +0 -0
- /package/dist/{chunk-I25RQA65.js.map → chunk-55ZVZBX4.js.map} +0 -0
- /package/dist/{chunk-ENNC3RZ6.js.map → chunk-5EOV7ANU.js.map} +0 -0
- /package/dist/{chunk-ANZXWOYD.js.map → chunk-5FNVK7MW.js.map} +0 -0
- /package/dist/{chunk-KSUOM3YU.js.map → chunk-5NOPZYNI.js.map} +0 -0
- /package/dist/{chunk-7LYRFI5A.js.map → chunk-5Q4NQNW7.js.map} +0 -0
- /package/dist/{chunk-L3PWXD73.js.map → chunk-6PHB45IU.js.map} +0 -0
- /package/dist/{chunk-CHDGJJV6.js.map → chunk-6VAHJ2F6.js.map} +0 -0
- /package/dist/{chunk-KQT4DRKF.js.map → chunk-76KHEHT2.js.map} +0 -0
- /package/dist/{chunk-SWRN6U7Q.js.map → chunk-7O252IE6.js.map} +0 -0
- /package/dist/{chunk-U6HWKOGD.js.map → chunk-7OAIOE5P.js.map} +0 -0
- /package/dist/{chunk-RSMIRLKM.js.map → chunk-7UX44C4N.js.map} +0 -0
- /package/dist/{chunk-DJMVSUPK.js.map → chunk-A6G7K273.js.map} +0 -0
- /package/dist/{chunk-VC4J4UTI.js.map → chunk-AAM66QCP.js.map} +0 -0
- /package/dist/{chunk-TZQOCQXB.js.map → chunk-AL6EHLB5.js.map} +0 -0
- /package/dist/{chunk-IJ4FEGZR.js.map → chunk-AMFCRZYB.js.map} +0 -0
- /package/dist/{chunk-4K2H4KTR.js.map → chunk-AV46CT77.js.map} +0 -0
- /package/dist/{chunk-VZBW6CDG.js.map → chunk-BOOFTFFE.js.map} +0 -0
- /package/dist/{chunk-2UF42WXV.js.map → chunk-BPY4RRTF.js.map} +0 -0
- /package/dist/{chunk-2U3R3DDH.js.map → chunk-BTJ6CAIA.js.map} +0 -0
- /package/dist/{chunk-GF4H3B3R.js.map → chunk-C3WJNRGR.js.map} +0 -0
- /package/dist/{chunk-SIYZDT2V.js.map → chunk-CBP4HWCL.js.map} +0 -0
- /package/dist/{chunk-GEGUBU3D.js.map → chunk-CSUAHUOH.js.map} +0 -0
- /package/dist/{chunk-BNMI3JBV.js.map → chunk-DXHVD4DS.js.map} +0 -0
- /package/dist/{chunk-GE6HETIF.js.map → chunk-E5274WUC.js.map} +0 -0
- /package/dist/{chunk-2COXDQ6C.js.map → chunk-E6KXJSMA.js.map} +0 -0
- /package/dist/{chunk-CCMXCZLT.js.map → chunk-FBVLTTVV.js.map} +0 -0
- /package/dist/{chunk-XVC7JU2N.js.map → chunk-FQD2KPQH.js.map} +0 -0
- /package/dist/{chunk-SNXBXYUE.js.map → chunk-GDI64ITR.js.map} +0 -0
- /package/dist/{chunk-MH2DXDN6.js.map → chunk-GSAZBZMA.js.map} +0 -0
- /package/dist/{chunk-MULNBSPP.js.map → chunk-HT2C4EXO.js.map} +0 -0
- /package/dist/{chunk-EMVJU7WC.js.map → chunk-HZVYDWUP.js.map} +0 -0
- /package/dist/{chunk-XPRAOTJY.js.map → chunk-IJWEXCWF.js.map} +0 -0
- /package/dist/{chunk-L2VS27PZ.js.map → chunk-IOM5QSNR.js.map} +0 -0
- /package/dist/{chunk-KQAFEZQX.js.map → chunk-IPLYGWQF.js.map} +0 -0
- /package/dist/{chunk-TDMNADPI.js.map → chunk-JK3DYMOC.js.map} +0 -0
- /package/dist/{chunk-SZXPKUMN.js.map → chunk-JSIQSZXI.js.map} +0 -0
- /package/dist/{chunk-KQI2PKYP.js.map → chunk-JTUKDLAD.js.map} +0 -0
- /package/dist/{chunk-TL4PM7PC.js.map → chunk-K3DZ3G5I.js.map} +0 -0
- /package/dist/{chunk-WG4TMZJ2.js.map → chunk-KDYQYMJZ.js.map} +0 -0
- /package/dist/{chunk-N4PYB235.js.map → chunk-KI6UOSNR.js.map} +0 -0
- /package/dist/{chunk-FC6RCOIU.js.map → chunk-KRIEQCKE.js.map} +0 -0
- /package/dist/{chunk-EQUD7FP4.js.map → chunk-KYY4EACB.js.map} +0 -0
- /package/dist/{chunk-QMFKW4OU.js.map → chunk-L3Z4NXDO.js.map} +0 -0
- /package/dist/{chunk-KE5PWLI6.js.map → chunk-LOFVW6JA.js.map} +0 -0
- /package/dist/{chunk-46WM6JX2.js.map → chunk-LZKOVXMX.js.map} +0 -0
- /package/dist/{chunk-JMF5Q4JY.js.map → chunk-MAJ2OKE4.js.map} +0 -0
- /package/dist/{chunk-U6OXJQEH.js.map → chunk-MB5EJ2CT.js.map} +0 -0
- /package/dist/{chunk-VUEG3TZ4.js.map → chunk-MVRIW6MI.js.map} +0 -0
- /package/dist/{chunk-TGF43K66.js.map → chunk-MZBWIJJN.js.map} +0 -0
- /package/dist/{chunk-QGLEM46C.js.map → chunk-N44GZ73R.js.map} +0 -0
- /package/dist/{chunk-63UNVGZW.js.map → chunk-N6UMXWBA.js.map} +0 -0
- /package/dist/{chunk-FLV7M7CT.js.map → chunk-NAHUBSUF.js.map} +0 -0
- /package/dist/{chunk-S5TGRZWY.js.map → chunk-NXLQQ6WI.js.map} +0 -0
- /package/dist/{chunk-5AYUHSAU.js.map → chunk-OFCHT2TN.js.map} +0 -0
- /package/dist/{chunk-HRZZJ4XB.js.map → chunk-P2S6P7X6.js.map} +0 -0
- /package/dist/{chunk-OGVJXIHX.js.map → chunk-PBVNVKYN.js.map} +0 -0
- /package/dist/{chunk-2CP577K6.js.map → chunk-PPIASWWR.js.map} +0 -0
- /package/dist/{chunk-6C76FZRM.js.map → chunk-QFIPSKPC.js.map} +0 -0
- /package/dist/{chunk-Q562GF7J.js.map → chunk-QN77HA6P.js.map} +0 -0
- /package/dist/{chunk-MFZACYZ6.js.map → chunk-QUNDYIYZ.js.map} +0 -0
- /package/dist/{chunk-L34W4W4I.js.map → chunk-QW7G7PWN.js.map} +0 -0
- /package/dist/{chunk-W5XWHTDO.js.map → chunk-QZZPUREO.js.map} +0 -0
- /package/dist/{chunk-JA72X46J.js.map → chunk-R2AWYR4Q.js.map} +0 -0
- /package/dist/{chunk-YRULQW5J.js.map → chunk-RBJQYMMT.js.map} +0 -0
- /package/dist/{chunk-6KHF6PAB.js.map → chunk-RH6QEGCT.js.map} +0 -0
- /package/dist/{chunk-QRZMJ2WN.js.map → chunk-RNPJ4GQA.js.map} +0 -0
- /package/dist/{chunk-TRBLJU6Y.js.map → chunk-S4GUMZRB.js.map} +0 -0
- /package/dist/{chunk-MQNOIH2C.js.map → chunk-SQ2O52SU.js.map} +0 -0
- /package/dist/{chunk-EP5WXE2G.js.map → chunk-TCYLCPC6.js.map} +0 -0
- /package/dist/{chunk-PO7NXNGC.js.map → chunk-VFTK5WKI.js.map} +0 -0
- /package/dist/{chunk-JA54KIYD.js.map → chunk-VSHRMIJH.js.map} +0 -0
- /package/dist/{chunk-5BPXMAUP.js.map → chunk-VUQDJ3JB.js.map} +0 -0
- /package/dist/{chunk-7CXL25AA.js.map → chunk-W4RLOZOG.js.map} +0 -0
- /package/dist/{chunk-LHRQBMJN.js.map → chunk-WADSXS4K.js.map} +0 -0
- /package/dist/{chunk-Y7427SL7.js.map → chunk-WCGJK4NQ.js.map} +0 -0
- /package/dist/{chunk-37HCPM56.js.map → chunk-WJLGUY27.js.map} +0 -0
- /package/dist/{chunk-YGPXV546.js.map → chunk-WPFSZZ35.js.map} +0 -0
- /package/dist/{chunk-UXIZ5XN5.js.map → chunk-XLIK2VDE.js.map} +0 -0
- /package/dist/{chunk-64S6X4IU.js.map → chunk-XTN54NML.js.map} +0 -0
- /package/dist/{chunk-2UPTRDGM.js.map → chunk-Y6DZ33PA.js.map} +0 -0
- /package/dist/{chunk-4JNTGPBR.js.map → chunk-YAF3NRNC.js.map} +0 -0
- /package/dist/{chunk-IFCKHPY4.js.map → chunk-YDH2FSDI.js.map} +0 -0
- /package/dist/{chunk-L6GNS5GB.js.map → chunk-YS7SA4HD.js.map} +0 -0
- /package/dist/{chunk-EIFYYHAF.js.map → chunk-YYO447A7.js.map} +0 -0
- /package/dist/{chunk-75PT4N7Q.js.map → chunk-ZI7LMSNI.js.map} +0 -0
- /package/dist/{chunk-EUT2WCWS.js.map → chunk-ZQ3WU6JO.js.map} +0 -0
- /package/dist/{chunk-YJEUHGZZ.js.map → chunk-ZQYAE2C5.js.map} +0 -0
- /package/dist/{chunk-JYG2334B.js.map → chunk-ZSJGYC3C.js.map} +0 -0
- /package/dist/{graph-edge-decay-PVKDKLQK.js.map → graph-edge-decay-CZ3SYLM4.js.map} +0 -0
- /package/dist/{resolution-TV3F7ZTH.js.map → harmonic-source-lookup.js.map} +0 -0
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
import {
|
|
2
|
+
sleep
|
|
3
|
+
} from "./chunk-7LEQREP2.js";
|
|
4
|
+
|
|
1
5
|
// src/access-idempotency.ts
|
|
2
6
|
import { mkdir, open, readFile, rename, stat, unlink, utimes, writeFile } from "fs/promises";
|
|
3
7
|
import path from "path";
|
|
@@ -299,13 +303,10 @@ async function unlinkStaleLockIfStillOwned(options) {
|
|
|
299
303
|
await unlink(options.lockPath);
|
|
300
304
|
return true;
|
|
301
305
|
}
|
|
302
|
-
function sleep(ms) {
|
|
303
|
-
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
304
|
-
}
|
|
305
306
|
|
|
306
307
|
export {
|
|
307
308
|
hashAccessIdempotencyPayload,
|
|
308
309
|
setAccessIdempotencyTestHooks,
|
|
309
310
|
AccessIdempotencyStore
|
|
310
311
|
};
|
|
311
|
-
//# sourceMappingURL=chunk-
|
|
312
|
+
//# sourceMappingURL=chunk-5JMI26Q7.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/access-idempotency.ts"],"sourcesContent":["import { mkdir, open, readFile, rename, stat, unlink, utimes, writeFile } from \"node:fs/promises\";\nimport path from \"node:path\";\nimport { createHash, randomUUID } from \"node:crypto\";\nimport { sleep } from \"./utils/sleep.js\";\n\ntype AccessIdempotencyEntry = {\n recordedAt: string;\n requestHash: string;\n response: unknown;\n};\n\ntype AccessIdempotencyTestHooks = {\n beforeFlushWrite?: () => Promise<void> | void;\n lockTimeoutMs?: number;\n staleLockMs?: number;\n lockHeartbeatMs?: number;\n beforeLockOwnerWrite?: (lockPath: string, ownerToken: string) => Promise<void> | void;\n beforeStaleLockUnlink?: () => Promise<void> | void;\n};\n\nlet testHooks: AccessIdempotencyTestHooks | null = null;\n\nfunction stableStringify(value: unknown): string {\n return JSON.stringify(value, (_key, candidate) => {\n if (!candidate || typeof candidate !== \"object\" || Array.isArray(candidate)) {\n return candidate;\n }\n return Object.keys(candidate)\n .sort()\n .reduce<Record<string, unknown>>((acc, key) => {\n acc[key] = (candidate as Record<string, unknown>)[key];\n return acc;\n }, {});\n });\n}\n\nexport function hashAccessIdempotencyPayload(payload: unknown): string {\n return createHash(\"sha256\").update(stableStringify(payload)).digest(\"hex\");\n}\n\nexport function setAccessIdempotencyTestHooks(hooks: AccessIdempotencyTestHooks | null): void {\n testHooks = hooks;\n}\n\nexport class AccessIdempotencyStore {\n private readonly statePath: string;\n private readonly lockPath: string;\n private readonly keyLockDir: string;\n private loadedMtimeMs = 0;\n private state: Record<string, AccessIdempotencyEntry> = {};\n private writeQueue: Promise<void> = Promise.resolve();\n\n constructor(memoryDir: string) {\n this.statePath = path.join(memoryDir, \"state\", \"access-idempotency.json\");\n this.lockPath = `${this.statePath}.lock`;\n this.keyLockDir = path.join(memoryDir, \"state\", \"access-idempotency-locks\");\n }\n\n async get(key: string, requestHash: string): Promise<{ response?: unknown; conflict: boolean }> {\n await this.writeQueue.catch(() => {});\n await this.reload({ forceRefresh: true });\n const entry = this.state[key];\n if (!entry) return { conflict: false };\n if (entry.requestHash !== requestHash) {\n return { conflict: true };\n }\n return {\n conflict: false,\n response: JSON.parse(JSON.stringify(entry.response)),\n };\n }\n\n async put(key: string, requestHash: string, response: unknown): Promise<void> {\n await this.withWriteQueue(async () => {\n await this.reload({ forceRefresh: true });\n this.state[key] = {\n recordedAt: new Date().toISOString(),\n requestHash,\n response: JSON.parse(JSON.stringify(response)),\n };\n await this.prune();\n await this.flush();\n });\n }\n\n async withKeyLock<T>(key: string, callback: () => Promise<T>): Promise<T> {\n const keyHash = createHash(\"sha256\").update(key).digest(\"hex\");\n const keyLockPath = path.join(this.keyLockDir, `${keyHash}.lock`);\n return this.withExclusiveFileLock(keyLockPath, callback);\n }\n\n private async reload(options: { forceRefresh?: boolean } = {}): Promise<void> {\n if (options.forceRefresh === true) {\n try {\n const fileStat = await stat(this.statePath);\n if (fileStat.mtimeMs < this.loadedMtimeMs) {\n return;\n }\n } catch {\n this.state = {};\n this.loadedMtimeMs = 0;\n return;\n }\n }\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw) as Record<string, AccessIdempotencyEntry>;\n if (parsed && typeof parsed === \"object\") {\n this.state = parsed;\n this.loadedMtimeMs = await this.readMtimeMs();\n return;\n }\n } catch {\n // Missing or malformed state should fail open to an empty store.\n }\n this.state = {};\n this.loadedMtimeMs = 0;\n }\n\n private async prune(): Promise<void> {\n const entries = Object.entries(this.state);\n if (entries.length <= 512) return;\n entries\n .sort((left, right) => right[1].recordedAt.localeCompare(left[1].recordedAt))\n .slice(512)\n .forEach(([key]) => {\n delete this.state[key];\n });\n }\n\n private async flush(): Promise<void> {\n await mkdir(path.dirname(this.statePath), { recursive: true });\n await this.withExclusiveFileLock(this.lockPath, async () => {\n try {\n const raw = await readFile(this.statePath, \"utf-8\");\n const parsed = JSON.parse(raw) as Record<string, AccessIdempotencyEntry>;\n if (parsed && typeof parsed === \"object\") {\n this.state = {\n ...parsed,\n ...this.state,\n };\n await this.prune();\n }\n } catch {\n // Fail open when there is no pre-existing shared state to merge.\n }\n\n await testHooks?.beforeFlushWrite?.();\n\n const tempPath = `${this.statePath}.${process.pid}.${Date.now()}.${Math.random().toString(16).slice(2)}.tmp`;\n try {\n await writeFile(tempPath, JSON.stringify(this.state, null, 2), \"utf-8\");\n await rename(tempPath, this.statePath);\n } finally {\n await unlink(tempPath).catch(() => undefined);\n }\n this.loadedMtimeMs = await this.readMtimeMs();\n });\n }\n\n private async readMtimeMs(): Promise<number> {\n try {\n return (await stat(this.statePath)).mtimeMs;\n } catch {\n return 0;\n }\n }\n\n private async withExclusiveFileLock<T>(lockPath: string, callback: () => Promise<T>): Promise<T> {\n await mkdir(path.dirname(lockPath), { recursive: true });\n const timeoutMs = testHooks?.lockTimeoutMs ?? 5_000;\n const staleLockMs = testHooks?.staleLockMs ?? 30_000;\n const lockHeartbeatMs = testHooks?.lockHeartbeatMs ?? Math.max(1_000, Math.floor(staleLockMs / 3));\n const startedAt = Date.now();\n\n while (true) {\n const ownerToken = `${process.pid}:${randomUUID()}`;\n try {\n const handle = await open(lockPath, \"wx\");\n try {\n await testHooks?.beforeLockOwnerWrite?.(lockPath, ownerToken);\n await handle.writeFile(ownerToken, \"utf-8\");\n } catch (error) {\n await handle.close().catch(() => undefined);\n await unlink(lockPath).catch(() => undefined);\n throw error;\n }\n let heartbeat: NodeJS.Timeout | null = null;\n if (lockHeartbeatMs > 0) {\n heartbeat = setInterval(() => {\n void utimes(lockPath, new Date(), new Date()).catch(() => undefined);\n }, lockHeartbeatMs);\n heartbeat.unref?.();\n }\n try {\n return await callback();\n } finally {\n if (heartbeat) {\n clearInterval(heartbeat);\n }\n await handle.close().catch(() => undefined);\n await unlinkLockIfOwner(lockPath, ownerToken, staleLockMs);\n }\n } catch (error) {\n if (!isAlreadyExistsError(error)) throw error;\n try {\n const lockStat = await stat(lockPath);\n const lockOwner = await readLockOwner(lockPath);\n if (Date.now() - lockStat.mtimeMs > staleLockMs) {\n await testHooks?.beforeStaleLockUnlink?.();\n const removed = await unlinkStaleLockIfUnchanged({\n lockPath,\n observedOwner: lockOwner,\n observedMtimeMs: lockStat.mtimeMs,\n staleLockMs,\n });\n if (!removed) {\n await sleep(10);\n }\n continue;\n }\n } catch {\n continue;\n }\n if (Date.now() - startedAt > timeoutMs) {\n throw new Error(\"timed out acquiring access idempotency lock\");\n }\n await sleep(10);\n }\n }\n }\n\n private async withWriteQueue<T>(callback: () => Promise<T>): Promise<T> {\n const previous = this.writeQueue;\n let release!: () => void;\n this.writeQueue = new Promise<void>((resolve) => {\n release = resolve;\n });\n await previous.catch(() => {});\n try {\n return await callback();\n } finally {\n release();\n }\n }\n}\n\nfunction isAlreadyExistsError(error: unknown): boolean {\n return typeof error === \"object\" && error !== null && \"code\" in error && error.code === \"EEXIST\";\n}\n\nasync function readLockOwner(lockPath: string): Promise<string | null> {\n try {\n return await readFile(lockPath, \"utf-8\");\n } catch {\n return null;\n }\n}\n\nasync function unlinkLockIfOwner(lockPath: string, ownerToken: string, staleLockMs: number): Promise<void> {\n const reclaimHandle = await openStaleReclaimLock(`${lockPath}.reclaim`, staleLockMs);\n if (!reclaimHandle) return;\n try {\n await reclaimHandle.writeFile(`${process.pid}:${Date.now()}`, \"utf-8\");\n await unlinkLockIfOwnerWhileReclaimHeld(lockPath, ownerToken);\n } finally {\n await reclaimHandle.close().catch(() => undefined);\n await unlink(`${lockPath}.reclaim`).catch(() => undefined);\n }\n}\n\nasync function unlinkLockIfOwnerWhileReclaimHeld(lockPath: string, ownerToken: string): Promise<void> {\n let handle: Awaited<ReturnType<typeof open>>;\n try {\n handle = await open(lockPath, \"r\");\n } catch {\n return;\n }\n try {\n const openedStat = await handle.stat();\n const currentOwner = await handle.readFile(\"utf-8\");\n if (currentOwner !== ownerToken) return;\n let currentStat: Awaited<ReturnType<typeof stat>>;\n try {\n currentStat = await stat(lockPath);\n } catch {\n return;\n }\n if (!isSameFileIdentity(openedStat, currentStat)) return;\n } finally {\n await handle.close().catch(() => undefined);\n }\n await unlink(lockPath).catch(() => undefined);\n}\n\nfunction isSameFileIdentity(left: Awaited<ReturnType<typeof stat>>, right: Awaited<ReturnType<typeof stat>>): boolean {\n return left.dev === right.dev && left.ino === right.ino;\n}\n\nasync function unlinkStaleLockIfUnchanged(options: {\n lockPath: string;\n observedOwner: string | null;\n observedMtimeMs: number;\n staleLockMs: number;\n}): Promise<boolean> {\n const reclaimPath = `${options.lockPath}.reclaim`;\n const reclaimHandle = await openStaleReclaimLock(reclaimPath, options.staleLockMs);\n if (!reclaimHandle) return false;\n try {\n await reclaimHandle.writeFile(`${process.pid}:${Date.now()}`, \"utf-8\");\n return await unlinkStaleLockIfStillOwned(options);\n } finally {\n await reclaimHandle.close().catch(() => undefined);\n await unlink(reclaimPath).catch(() => undefined);\n }\n}\n\nasync function openStaleReclaimLock(\n reclaimPath: string,\n staleLockMs: number,\n): Promise<Awaited<ReturnType<typeof open>> | null> {\n try {\n return await open(reclaimPath, \"wx\");\n } catch (error) {\n if (!isAlreadyExistsError(error)) throw error;\n }\n\n try {\n const reclaimStat = await stat(reclaimPath);\n if (Date.now() - reclaimStat.mtimeMs <= staleLockMs) return null;\n await unlink(reclaimPath);\n } catch {\n return null;\n }\n\n try {\n return await open(reclaimPath, \"wx\");\n } catch (error) {\n if (isAlreadyExistsError(error)) return null;\n throw error;\n }\n}\n\nasync function unlinkStaleLockIfStillOwned(options: {\n lockPath: string;\n observedOwner: string | null;\n observedMtimeMs: number;\n staleLockMs: number;\n}): Promise<boolean> {\n let currentStat: Awaited<ReturnType<typeof stat>>;\n try {\n currentStat = await stat(options.lockPath);\n } catch {\n return true;\n }\n if (currentStat.mtimeMs !== options.observedMtimeMs) return false;\n if (Date.now() - currentStat.mtimeMs <= options.staleLockMs) return false;\n const currentOwner = await readLockOwner(options.lockPath);\n if (currentOwner !== options.observedOwner) return false;\n await unlink(options.lockPath);\n return true;\n}\n"],"mappings":";;;;;AAAA,SAAS,OAAO,MAAM,UAAU,QAAQ,MAAM,QAAQ,QAAQ,iBAAiB;AAC/E,OAAO,UAAU;AACjB,SAAS,YAAY,kBAAkB;AAkBvC,IAAI,YAA+C;AAEnD,SAAS,gBAAgB,OAAwB;AAC/C,SAAO,KAAK,UAAU,OAAO,CAAC,MAAM,cAAc;AAChD,QAAI,CAAC,aAAa,OAAO,cAAc,YAAY,MAAM,QAAQ,SAAS,GAAG;AAC3E,aAAO;AAAA,IACT;AACA,WAAO,OAAO,KAAK,SAAS,EACzB,KAAK,EACL,OAAgC,CAAC,KAAK,QAAQ;AAC7C,UAAI,GAAG,IAAK,UAAsC,GAAG;AACrD,aAAO;AAAA,IACT,GAAG,CAAC,CAAC;AAAA,EACT,CAAC;AACH;AAEO,SAAS,6BAA6B,SAA0B;AACrE,SAAO,WAAW,QAAQ,EAAE,OAAO,gBAAgB,OAAO,CAAC,EAAE,OAAO,KAAK;AAC3E;AAEO,SAAS,8BAA8B,OAAgD;AAC5F,cAAY;AACd;AAEO,IAAM,yBAAN,MAA6B;AAAA,EACjB;AAAA,EACA;AAAA,EACA;AAAA,EACT,gBAAgB;AAAA,EAChB,QAAgD,CAAC;AAAA,EACjD,aAA4B,QAAQ,QAAQ;AAAA,EAEpD,YAAY,WAAmB;AAC7B,SAAK,YAAY,KAAK,KAAK,WAAW,SAAS,yBAAyB;AACxE,SAAK,WAAW,GAAG,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espaceMaintenanceLastRanStatuses,
|
|
4
4
|
readNamespaceMaintenanceStatuses,
|
|
5
5
|
runNamespaceMaintenancePlan
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-L3Z4NXDO.js";
|
|
7
7
|
import {
|
|
8
8
|
analyzeSessionIntegrity,
|
|
9
9
|
applySessionRepair,
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
} from "./chunk-CMTINOFS.js";
|
|
15
15
|
import {
|
|
16
16
|
summarizeCorpusAndReplica
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-JTUKDLAD.js";
|
|
18
18
|
import {
|
|
19
19
|
readJudgeVerdictStats
|
|
20
20
|
} from "./chunk-OZKOPQCM.js";
|
|
@@ -32,32 +32,32 @@ import {
|
|
|
32
32
|
} from "./chunk-2DQ2XREU.js";
|
|
33
33
|
import {
|
|
34
34
|
runConsolidationProvenanceCheck
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-HT2C4EXO.js";
|
|
36
36
|
import {
|
|
37
37
|
reportBufferSurpriseDistribution
|
|
38
38
|
} from "./chunk-YBPYIAA5.js";
|
|
39
39
|
import {
|
|
40
40
|
parseConfig
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-VUQDJ3JB.js";
|
|
42
42
|
import {
|
|
43
43
|
readAggregateExtractionWatermark
|
|
44
|
-
} from "./chunk-
|
|
44
|
+
} from "./chunk-5Q4NQNW7.js";
|
|
45
45
|
import {
|
|
46
46
|
listMemoryGovernanceRuns,
|
|
47
47
|
readMemoryGovernanceRunArtifact
|
|
48
|
-
} from "./chunk-
|
|
48
|
+
} from "./chunk-AV46CT77.js";
|
|
49
49
|
import {
|
|
50
50
|
listNamespaces
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-GDI64ITR.js";
|
|
52
52
|
import {
|
|
53
53
|
analyzeGraphHealth
|
|
54
|
-
} from "./chunk-
|
|
54
|
+
} from "./chunk-BTJ6CAIA.js";
|
|
55
55
|
import {
|
|
56
56
|
summarizeExtractionLiveness
|
|
57
57
|
} from "./chunk-AWD36R4D.js";
|
|
58
58
|
import {
|
|
59
59
|
StorageManager
|
|
60
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-WJLGUY27.js";
|
|
61
61
|
import {
|
|
62
62
|
lintWorkspaceFiles
|
|
63
63
|
} from "./chunk-DM2T26WE.js";
|
|
@@ -1069,7 +1069,7 @@ async function summarizeBufferSurpriseDistribution(storage, config) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
}
|
|
1071
1071
|
async function summarizeGraphEdgeDecayStatus(config) {
|
|
1072
|
-
const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-
|
|
1072
|
+
const { readGraphEdgeDecayStatus } = await import("./graph-edge-decay-CZ3SYLM4.js");
|
|
1073
1073
|
const { graphEdgeDecayEnabled } = config;
|
|
1074
1074
|
const enabled = graphEdgeDecayEnabled === true;
|
|
1075
1075
|
if (!enabled) {
|
|
@@ -1683,4 +1683,4 @@ export {
|
|
|
1683
1683
|
runBenchmarkRecall,
|
|
1684
1684
|
runOperatorRepair
|
|
1685
1685
|
};
|
|
1686
|
-
//# sourceMappingURL=chunk-
|
|
1686
|
+
//# sourceMappingURL=chunk-5NOPZYNI.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveCorpusNamespaceRoots
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-5FNVK7MW.js";
|
|
4
4
|
import {
|
|
5
5
|
capabilityAllowsNamespace
|
|
6
6
|
} from "./chunk-IG747LRN.js";
|
|
@@ -200,4 +200,4 @@ async function readAggregateExtractionWatermark(options) {
|
|
|
200
200
|
export {
|
|
201
201
|
readAggregateExtractionWatermark
|
|
202
202
|
};
|
|
203
|
-
//# sourceMappingURL=chunk-
|
|
203
|
+
//# sourceMappingURL=chunk-5Q4NQNW7.js.map
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
import {
|
|
2
|
+
readProjectedMemoryPaths
|
|
3
|
+
} from "./chunk-AZEZSQ5R.js";
|
|
4
|
+
import {
|
|
5
|
+
throwIfAborted
|
|
6
|
+
} from "./chunk-BTTPKDIL.js";
|
|
7
|
+
import {
|
|
8
|
+
isRecord
|
|
9
|
+
} from "./chunk-A2IYSXDQ.js";
|
|
10
|
+
import {
|
|
11
|
+
readJsonFile,
|
|
12
|
+
writeJsonFileAtomic
|
|
13
|
+
} from "./chunk-B6O2YLUR.js";
|
|
14
|
+
import {
|
|
15
|
+
isPathInsideStorageRoot,
|
|
16
|
+
isSafeLegacyPathSegment
|
|
17
|
+
} from "./chunk-LDPPTPO5.js";
|
|
18
|
+
import {
|
|
19
|
+
SecureStoreLockedError
|
|
20
|
+
} from "./chunk-MAAL6OZV.js";
|
|
21
|
+
import {
|
|
22
|
+
RECALL_FALLBACK_DIRS
|
|
23
|
+
} from "./chunk-VS2IYZRU.js";
|
|
24
|
+
|
|
25
|
+
// src/harmonic-source-lookup.ts
|
|
26
|
+
import path from "path";
|
|
27
|
+
import { existsSync } from "fs";
|
|
28
|
+
import { mkdir, realpath } from "fs/promises";
|
|
29
|
+
var LOOKUP_TTL_MS = 10 * 6e4;
|
|
30
|
+
var MAX_CACHE_ENTRIES = 4096;
|
|
31
|
+
async function readHarmonicSourceMemory(storage, rootReal, filePath, abortSignal) {
|
|
32
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
33
|
+
if (!existsSync(filePath)) return null;
|
|
34
|
+
try {
|
|
35
|
+
if (!isPathInsideStorageRoot(rootReal, await realpath(filePath))) return null;
|
|
36
|
+
return await storage.readMemoryByPath(filePath);
|
|
37
|
+
} catch (err) {
|
|
38
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
39
|
+
if (err instanceof SecureStoreLockedError) throw err;
|
|
40
|
+
return null;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
function isCorpusPath(memoryDir, filePath) {
|
|
44
|
+
if (!isPathInsideStorageRoot(memoryDir, filePath)) return false;
|
|
45
|
+
const [dir] = path.relative(memoryDir, filePath).split(path.sep);
|
|
46
|
+
return dir === "cold" || RECALL_FALLBACK_DIRS.includes(dir);
|
|
47
|
+
}
|
|
48
|
+
async function readPathCache(filePath, rebuiltAt, corpusVersion, nowMs) {
|
|
49
|
+
try {
|
|
50
|
+
const raw = await readJsonFile(filePath);
|
|
51
|
+
if (!isRecord(raw) || raw.rebuiltAt !== rebuiltAt || raw.corpusVersion !== corpusVersion || !Array.isArray(raw.entries)) return /* @__PURE__ */ new Map();
|
|
52
|
+
const entries = /* @__PURE__ */ new Map();
|
|
53
|
+
for (const row of raw.entries) {
|
|
54
|
+
if (!Array.isArray(row) || row.length !== 3) continue;
|
|
55
|
+
const [id, storedPath, expiresAt] = row;
|
|
56
|
+
if (typeof id !== "string" || storedPath !== null && typeof storedPath !== "string") continue;
|
|
57
|
+
if (typeof expiresAt !== "number" || !Number.isFinite(expiresAt) || expiresAt <= nowMs || expiresAt > nowMs + LOOKUP_TTL_MS) continue;
|
|
58
|
+
entries.set(id, { path: storedPath, expiresAt });
|
|
59
|
+
}
|
|
60
|
+
return entries;
|
|
61
|
+
} catch {
|
|
62
|
+
return /* @__PURE__ */ new Map();
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
async function readUnresolvedHarmonicSources(options) {
|
|
66
|
+
const { storage, rootReal, rebuiltAt, nowMs, abortSignal } = options;
|
|
67
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
68
|
+
const corpusVersion = storage.getCorpusScanVersion();
|
|
69
|
+
const stateDir = path.join(storage.dir, "state");
|
|
70
|
+
const cachePath = path.join(stateDir, "harmonic-source-paths.json");
|
|
71
|
+
const stateReal = await realpath(stateDir).catch(() => null);
|
|
72
|
+
const safeCache = stateReal !== null && isPathInsideStorageRoot(rootReal, stateReal);
|
|
73
|
+
const cache = safeCache ? await readPathCache(cachePath, rebuiltAt, corpusVersion, nowMs) : /* @__PURE__ */ new Map();
|
|
74
|
+
const found = /* @__PURE__ */ new Map();
|
|
75
|
+
const pending = /* @__PURE__ */ new Set();
|
|
76
|
+
for (const id of options.sourceMemoryIds) {
|
|
77
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
78
|
+
const entry = cache.get(id);
|
|
79
|
+
if (entry?.path === null) continue;
|
|
80
|
+
if (entry?.path) {
|
|
81
|
+
const candidate = path.resolve(storage.dir, entry.path);
|
|
82
|
+
const memory = isCorpusPath(storage.dir, candidate) ? await readHarmonicSourceMemory(storage, rootReal, candidate, abortSignal) : null;
|
|
83
|
+
if (memory?.frontmatter.id === id) {
|
|
84
|
+
found.set(id, memory);
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
pending.add(id);
|
|
89
|
+
}
|
|
90
|
+
if (pending.size === 0) return found;
|
|
91
|
+
const inspectProjected = [...pending].some((id) => !isSafeLegacyPathSegment(id));
|
|
92
|
+
const projectedPaths = readProjectedMemoryPaths(storage.dir);
|
|
93
|
+
const walked = [
|
|
94
|
+
...await storage.collectActiveMemoryPaths({ abortSignal, propagateReadErrors: true }),
|
|
95
|
+
...await storage.collectColdMemoryPaths({ abortSignal, propagateReadErrors: true })
|
|
96
|
+
];
|
|
97
|
+
for (const filePath of walked) {
|
|
98
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
99
|
+
if (!inspectProjected && !pending.has(path.basename(filePath, ".md")) && projectedPaths?.has(filePath)) continue;
|
|
100
|
+
const memory = await readHarmonicSourceMemory(storage, rootReal, filePath, abortSignal);
|
|
101
|
+
if (!memory) continue;
|
|
102
|
+
const id = memory.frontmatter.id;
|
|
103
|
+
if (pending.has(id)) {
|
|
104
|
+
found.set(id, memory);
|
|
105
|
+
cache.set(id, { path: path.relative(storage.dir, filePath), expiresAt: nowMs + LOOKUP_TTL_MS });
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
for (const id of pending) {
|
|
109
|
+
if (!found.has(id)) cache.set(id, { path: null, expiresAt: nowMs + LOOKUP_TTL_MS });
|
|
110
|
+
}
|
|
111
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
112
|
+
if (storage.getCorpusScanVersion() === corpusVersion) {
|
|
113
|
+
try {
|
|
114
|
+
await mkdir(stateDir, { recursive: true });
|
|
115
|
+
if (isPathInsideStorageRoot(rootReal, await realpath(stateDir))) {
|
|
116
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
117
|
+
await writeJsonFileAtomic(cachePath, {
|
|
118
|
+
rebuiltAt,
|
|
119
|
+
corpusVersion,
|
|
120
|
+
entries: [...cache].slice(-MAX_CACHE_ENTRIES).map(([id, entry]) => [id, entry.path, entry.expiresAt])
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
} catch {
|
|
124
|
+
throwIfAborted(abortSignal, "harmonic retrieval aborted");
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return found;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export {
|
|
131
|
+
readHarmonicSourceMemory,
|
|
132
|
+
readUnresolvedHarmonicSources
|
|
133
|
+
};
|
|
134
|
+
//# sourceMappingURL=chunk-5VC7J76U.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/harmonic-source-lookup.ts"],"sourcesContent":["import path from \"node:path\";\nimport { existsSync } from \"node:fs\";\nimport { mkdir, realpath } from \"node:fs/promises\";\nimport { throwIfAborted } from \"./abort-error.js\";\nimport { readJsonFile, writeJsonFileAtomic } from \"./json-store.js\";\nimport { readProjectedMemoryPaths } from \"./memory-projection-batch.js\";\nimport { SecureStoreLockedError } from \"./secure-store/secure-fs.js\";\nimport { isPathInsideStorageRoot, isSafeLegacyPathSegment } from \"./storage-paths.js\";\nimport { isRecord } from \"./store-contract.js\";\nimport type { StorageManager } from \"./storage.js\";\nimport type { MemoryFile } from \"./types.js\";\nimport { RECALL_FALLBACK_DIRS } from \"./utils/category-dir.js\";\n\nconst LOOKUP_TTL_MS = 10 * 60_000;\nconst MAX_CACHE_ENTRIES = 4096;\ntype PathEntry = { path: string | null; expiresAt: number };\n\n/** Direct and cached probes must retain the walk's realpath containment check. */\nexport async function readHarmonicSourceMemory(\n storage: StorageManager,\n rootReal: string,\n filePath: string,\n abortSignal?: AbortSignal,\n): Promise<MemoryFile | null> {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n if (!existsSync(filePath)) return null;\n try {\n if (!isPathInsideStorageRoot(rootReal, await realpath(filePath))) return null;\n return await storage.readMemoryByPath(filePath);\n } catch (err) {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n if (err instanceof SecureStoreLockedError) throw err;\n return null;\n }\n}\n\nfunction isCorpusPath(memoryDir: string, filePath: string): boolean {\n if (!isPathInsideStorageRoot(memoryDir, filePath)) return false;\n const [dir] = path.relative(memoryDir, filePath).split(path.sep);\n return dir === \"cold\" || RECALL_FALLBACK_DIRS.includes(dir);\n}\n\n/** A cache miss is not authoritative: unreadable/invalid cache state keeps the walk. */\nasync function readPathCache(\n filePath: string, rebuiltAt: string, corpusVersion: string, nowMs: number,\n): Promise<Map<string, PathEntry>> {\n try {\n const raw = await readJsonFile(filePath);\n if (!isRecord(raw) || raw.rebuiltAt !== rebuiltAt || raw.corpusVersion !== corpusVersion || !Array.isArray(raw.entries)) return new Map();\n const entries = new Map<string, PathEntry>();\n for (const row of raw.entries) {\n if (!Array.isArray(row) || row.length !== 3) continue;\n const [id, storedPath, expiresAt] = row;\n if (typeof id !== \"string\" || (storedPath !== null && typeof storedPath !== \"string\")) continue;\n if (typeof expiresAt !== \"number\" || !Number.isFinite(expiresAt) || expiresAt <= nowMs || expiresAt > nowMs + LOOKUP_TTL_MS) continue;\n entries.set(id, { path: storedPath, expiresAt });\n }\n return entries;\n } catch {\n return new Map();\n }\n}\n\n/** Resolve only unresolved ids; persist paths/absence, never memory content. */\nexport async function readUnresolvedHarmonicSources(options: {\n storage: StorageManager;\n rootReal: string;\n rebuiltAt: string;\n sourceMemoryIds: string[];\n nowMs: number;\n abortSignal?: AbortSignal;\n}): Promise<Map<string, MemoryFile>> {\n const { storage, rootReal, rebuiltAt, nowMs, abortSignal } = options;\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n const corpusVersion = storage.getCorpusScanVersion();\n const stateDir = path.join(storage.dir, \"state\");\n const cachePath = path.join(stateDir, \"harmonic-source-paths.json\");\n const stateReal = await realpath(stateDir).catch(() => null);\n const safeCache = stateReal !== null && isPathInsideStorageRoot(rootReal, stateReal);\n const cache = safeCache ? await readPathCache(cachePath, rebuiltAt, corpusVersion, nowMs) : new Map<string, PathEntry>();\n const found = new Map<string, MemoryFile>();\n const pending = new Set<string>();\n for (const id of options.sourceMemoryIds) {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n const entry = cache.get(id);\n if (entry?.path === null) continue;\n if (entry?.path) {\n const candidate = path.resolve(storage.dir, entry.path);\n const memory = isCorpusPath(storage.dir, candidate)\n ? await readHarmonicSourceMemory(storage, rootReal, candidate, abortSignal) : null;\n if (memory?.frontmatter.id === id) {\n found.set(id, memory);\n continue;\n }\n }\n pending.add(id);\n }\n if (pending.size === 0) return found;\n\n // Opaque legacy ids previously used the full scan, including edited projected files.\n const inspectProjected = [...pending].some((id) => !isSafeLegacyPathSegment(id));\n const projectedPaths = readProjectedMemoryPaths(storage.dir);\n const walked = [\n ...(await storage.collectActiveMemoryPaths({ abortSignal, propagateReadErrors: true })),\n ...(await storage.collectColdMemoryPaths({ abortSignal, propagateReadErrors: true })),\n ];\n for (const filePath of walked) {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n // Existing projected files need no parse unless their filename names a wanted id.\n // New/imported files must be keyed by frontmatter id, not their basename (#3188).\n if (!inspectProjected && !pending.has(path.basename(filePath, \".md\")) && projectedPaths?.has(filePath)) continue;\n const memory = await readHarmonicSourceMemory(storage, rootReal, filePath, abortSignal);\n if (!memory) continue;\n const id = memory.frontmatter.id;\n if (pending.has(id)) {\n found.set(id, memory);\n cache.set(id, { path: path.relative(storage.dir, filePath), expiresAt: nowMs + LOOKUP_TTL_MS });\n }\n }\n for (const id of pending) {\n if (!found.has(id)) cache.set(id, { path: null, expiresAt: nowMs + LOOKUP_TTL_MS });\n }\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n // A concurrent mutation must not publish absence for a different corpus epoch.\n if (storage.getCorpusScanVersion() === corpusVersion) {\n try {\n await mkdir(stateDir, { recursive: true });\n if (isPathInsideStorageRoot(rootReal, await realpath(stateDir))) {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n // ponytail: atomic last-writer-wins cache; contention can repeat a walk, not lose sources.\n await writeJsonFileAtomic(cachePath, {\n rebuiltAt, corpusVersion,\n entries: [...cache].slice(-MAX_CACHE_ENTRIES).map(([id, entry]) => [id, entry.path, entry.expiresAt]),\n });\n }\n } catch {\n throwIfAborted(abortSignal, \"harmonic retrieval aborted\");\n // Cache publication is optional; resolved memories remain usable on a read-only store.\n }\n }\n return found;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAAA,OAAO,UAAU;AACjB,SAAS,kBAAkB;AAC3B,SAAS,OAAO,gBAAgB;AAWhC,IAAM,gBAAgB,KAAK;AAC3B,IAAM,oBAAoB;AAI1B,eAAsB,yBACpB,SACA,UACA,UACA,aAC4B;AAC5B,iBAAe,aAAa,4BAA4B;AACxD,MAAI,CAAC,WAAW,QAAQ,EAAG,QAAO;AAClC,MAAI;AACF,QAAI,CAAC,wBAAwB,UAAU,MAAM,SAAS,QAAQ,CAAC,EAAG,QAAO;AACzE,WAAO,MAAM,QAAQ,iBAAiB,QAAQ;AAAA,EAChD,SAAS,KAAK;AACZ,mBAAe,aAAa,4BAA4B;AACxD,QAAI,eAAe,uBAAwB,OAAM;AACjD,WAAO;AAAA,EACT;AACF;AAEA,SAAS,aAAa,WAAmB,UAA2B;AAClE,MAAI,CAAC,wBAAwB,WAAW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,MAAM;AACpB,YAAM,IAAI,IAAI,EAAE,MAAM,KAAK,SAAS,QAAQ,KAAK,QAAQ,GAAG,WAAW,QAAQ,cAAc,CAAC;AAAA,IAChG;AAAA,EACF;AACA,aAAW,MAAM,SAAS;AACxB,QAAI,CAAC,MAAM,IAAI,EAAE,EAAG,OAAM,IAAI,IAAI,EAAE,MAAM,MAAM,WAAW,QAAQ,cAAc,CAAC;AAAA,EACpF;AACA,iBAAe,aAAa,4BAA4B;AAExD,MAAI,QAAQ,qBAAqB,MAAM,eAAe;AACpD,QAAI;AACF,YAAM,MAAM,UAAU,EAAE,WAAW,KAAK,CAAC;AACzC,UAAI,wBAAwB,UAAU,MAAM,SAAS,QAAQ,CAAC,GAAG;AAC/D,uBAAe,aAAa,4BAA4B;AAExD,cAAM,oBAAoB,WAAW;AAAA,UACnC;AAAA,UAAW;AAAA,UACX,SAAS,CAAC,GAAG,KAAK,EAAE,MAAM,CAAC,iBAAiB,EAAE,IAAI,CAAC,CAAC,IAAI,KAAK,MAAM,CAAC,IAAI,MAAM,MAAM,MAAM,SAAS,CAAC;AAAA,QACtG,CAAC;AAAA,MACH;AAAA,IACF,QAAQ;AACN,qBAAe,aAAa,4BAA4B;AAAA,IAE1D;AAAA,EACF;AACA,SAAO;AACT;","names":[]}
|
|
@@ -5,7 +5,7 @@ import {
|
|
|
5
5
|
} from "./chunk-5JMAGU26.js";
|
|
6
6
|
import {
|
|
7
7
|
runPostConsolidationMaterialize
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-ZQYAE2C5.js";
|
|
9
9
|
import {
|
|
10
10
|
isSemanticConsolidationLlmOperator
|
|
11
11
|
} from "./chunk-G7D6GZ5J.js";
|
|
@@ -220,4 +220,4 @@ export {
|
|
|
220
220
|
buildExtensionsBlockForConsolidation,
|
|
221
221
|
materializeAfterSemanticConsolidation
|
|
222
222
|
};
|
|
223
|
-
//# sourceMappingURL=chunk-
|
|
223
|
+
//# sourceMappingURL=chunk-6PHB45IU.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
readAllEdges
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-BTJ6CAIA.js";
|
|
4
4
|
import {
|
|
5
5
|
readEdgeConfidence
|
|
6
6
|
} from "./chunk-2LSZVONP.js";
|
|
@@ -162,4 +162,4 @@ export {
|
|
|
162
162
|
parseGraphSnapshotSince,
|
|
163
163
|
buildGraphSnapshot
|
|
164
164
|
};
|
|
165
|
-
//# sourceMappingURL=chunk-
|
|
165
|
+
//# sourceMappingURL=chunk-6VAHJ2F6.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-7T4TOGMS.js";
|
|
4
4
|
import {
|
|
5
5
|
defineOperation
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-NYVKLB2I.js";
|
|
7
7
|
|
|
8
8
|
// src/external-wiki-access.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -26,4 +26,4 @@ var externalWikiSearchOperation = defineOperation({
|
|
|
26
26
|
export {
|
|
27
27
|
externalWikiSearchOperation
|
|
28
28
|
};
|
|
29
|
-
//# sourceMappingURL=chunk-
|
|
29
|
+
//# sourceMappingURL=chunk-76KHEHT2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/sleep.ts"],"sourcesContent":["/** Wait without cancellation; keep the timer referenced so awaited polling can finish. */\nexport function sleep(ms: number): Promise<void> {\n // Constructor form keeps this reachable utility compatible with ES2022 adapter type graphs.\n return new Promise((resolve) => setTimeout(resolve, ms));\n}\n"],"mappings":";AACO,SAAS,MAAM,IAA2B;AAE/C,SAAO,IAAI,QAAQ,CAAC,YAAY,WAAW,SAAS,EAAE,CAAC;AACzD;","names":[]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
runLocationSync
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-A6G7K273.js";
|
|
4
4
|
import {
|
|
5
5
|
log
|
|
6
6
|
} from "./chunk-3WCASNQZ.js";
|
|
@@ -58,4 +58,4 @@ export {
|
|
|
58
58
|
LOCATION_SYNC_DEFAULT_INTERVAL_MS,
|
|
59
59
|
startLocationAutoSync
|
|
60
60
|
};
|
|
61
|
-
//# sourceMappingURL=chunk-
|
|
61
|
+
//# sourceMappingURL=chunk-7O252IE6.js.map
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-A7AISUJI.js";
|
|
4
4
|
import {
|
|
5
5
|
deepRecallRequestSchema
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CBP4HWCL.js";
|
|
7
7
|
import {
|
|
8
8
|
EngramAccessInputError
|
|
9
9
|
} from "./chunk-3MUKQQ7A.js";
|
|
@@ -40,4 +40,4 @@ async function respondDeepRecall(req, res, respondJson, readJsonBody, service, s
|
|
|
40
40
|
export {
|
|
41
41
|
respondDeepRecall
|
|
42
42
|
};
|
|
43
|
-
//# sourceMappingURL=chunk-
|
|
43
|
+
//# sourceMappingURL=chunk-7OAIOE5P.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createSearchBackend
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-MB5EJ2CT.js";
|
|
4
4
|
import {
|
|
5
5
|
namespaceIdentityToken,
|
|
6
6
|
normalizeNamespaceIdentity
|
|
@@ -508,4 +508,4 @@ export {
|
|
|
508
508
|
NamespaceSearchRouter,
|
|
509
509
|
normalizeQmdResultPath
|
|
510
510
|
};
|
|
511
|
-
//# sourceMappingURL=chunk-
|
|
511
|
+
//# sourceMappingURL=chunk-7UX44C4N.js.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
resolveDefaultNamespaceRoot
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-RH6QEGCT.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WJLGUY27.js";
|
|
7
7
|
import {
|
|
8
8
|
composeLocationDayBody,
|
|
9
9
|
composeLocationDayMeta,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
serializeLocationDay,
|
|
24
24
|
updateLocationSourceDay,
|
|
25
25
|
writeLocationDay
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-3I3U6FFT.js";
|
|
27
27
|
import {
|
|
28
28
|
resolveNamespaceCapabilities
|
|
29
29
|
} from "./chunk-2EMROIXS.js";
|
|
@@ -728,4 +728,4 @@ export {
|
|
|
728
728
|
runLocationBackfill,
|
|
729
729
|
runLocationCliCommand
|
|
730
730
|
};
|
|
731
|
-
//# sourceMappingURL=chunk-
|
|
731
|
+
//# sourceMappingURL=chunk-A6G7K273.js.map
|
|
@@ -5,13 +5,13 @@ import {
|
|
|
5
5
|
embeddingGenerationMembership,
|
|
6
6
|
embeddingShardDirOf,
|
|
7
7
|
isEmbeddingGenerationDirPath
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import {
|
|
10
|
-
resolveSafeArchiveTarget
|
|
11
|
-
} from "./chunk-GCGJW34D.js";
|
|
8
|
+
} from "./chunk-3NFN4Y4P.js";
|
|
12
9
|
import {
|
|
13
10
|
EMBEDDING_SHARD_FILE_PATTERN
|
|
14
11
|
} from "./chunk-TYT4TEQV.js";
|
|
12
|
+
import {
|
|
13
|
+
resolveSafeArchiveTarget
|
|
14
|
+
} from "./chunk-GCGJW34D.js";
|
|
15
15
|
import {
|
|
16
16
|
EmbeddingIndexStorageError
|
|
17
17
|
} from "./chunk-Y57GJDG5.js";
|
|
@@ -369,4 +369,4 @@ export {
|
|
|
369
369
|
applyChangesetEmbeddingGenerations,
|
|
370
370
|
buildChangesetGenerationManifest
|
|
371
371
|
};
|
|
372
|
-
//# sourceMappingURL=chunk-
|
|
372
|
+
//# sourceMappingURL=chunk-AAM66QCP.js.map
|
|
@@ -10,7 +10,7 @@ import {
|
|
|
10
10
|
} from "./chunk-BTNNL7ZW.js";
|
|
11
11
|
import {
|
|
12
12
|
withHeldFileLock
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-EHRE7ZG3.js";
|
|
14
14
|
import {
|
|
15
15
|
isErrnoCode
|
|
16
16
|
} from "./chunk-KNA3BXXL.js";
|
|
@@ -689,4 +689,4 @@ export {
|
|
|
689
689
|
TierMigrationStatusStore,
|
|
690
690
|
RecallHandleHistoryStore
|
|
691
691
|
};
|
|
692
|
-
//# sourceMappingURL=chunk-
|
|
692
|
+
//# sourceMappingURL=chunk-AL6EHLB5.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isGenericRecallExcludedPath
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-E5274WUC.js";
|
|
4
4
|
import {
|
|
5
5
|
normalizeProjectionPreview
|
|
6
6
|
} from "./chunk-SCU65EZI.js";
|
|
@@ -209,4 +209,4 @@ export {
|
|
|
209
209
|
browsePatternMatches,
|
|
210
210
|
runMemoryBrowse
|
|
211
211
|
};
|
|
212
|
-
//# sourceMappingURL=chunk-
|
|
212
|
+
//# sourceMappingURL=chunk-AMFCRZYB.js.map
|
|
@@ -3,13 +3,13 @@ import {
|
|
|
3
3
|
} from "./chunk-TBBDFYXW.js";
|
|
4
4
|
import {
|
|
5
5
|
StorageManager
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-WJLGUY27.js";
|
|
7
7
|
import {
|
|
8
8
|
bumpMemoryCorpusVersionForDir
|
|
9
9
|
} from "./chunk-M5GVCJSJ.js";
|
|
10
10
|
import {
|
|
11
11
|
requestEntityCanonicalIdReconcile
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-4NDWE44P.js";
|
|
13
13
|
import {
|
|
14
14
|
excludeSupportPassportPrivateMemories
|
|
15
15
|
} from "./chunk-PWPIERBM.js";
|
|
@@ -765,4 +765,4 @@ export {
|
|
|
765
765
|
listMemoryGovernanceRuns,
|
|
766
766
|
readMemoryGovernanceRunArtifact
|
|
767
767
|
};
|
|
768
|
-
//# sourceMappingURL=chunk-
|
|
768
|
+
//# sourceMappingURL=chunk-AV46CT77.js.map
|
|
@@ -3,8 +3,12 @@ import {
|
|
|
3
3
|
openProjectionReadonly,
|
|
4
4
|
parseCurrentRow
|
|
5
5
|
} from "./chunk-AL3UYZ5N.js";
|
|
6
|
+
import {
|
|
7
|
+
isRecord
|
|
8
|
+
} from "./chunk-A2IYSXDQ.js";
|
|
6
9
|
|
|
7
10
|
// src/memory-projection-batch.ts
|
|
11
|
+
import path from "path";
|
|
8
12
|
function readProjectedMemoryStates(memoryDir, memoryIds) {
|
|
9
13
|
const db = openProjectionReadonly(memoryDir);
|
|
10
14
|
if (!db) return null;
|
|
@@ -56,8 +60,25 @@ function readProjectedMemoryStates(memoryDir, memoryIds) {
|
|
|
56
60
|
db.close();
|
|
57
61
|
}
|
|
58
62
|
}
|
|
63
|
+
function readProjectedMemoryPaths(memoryDir) {
|
|
64
|
+
const db = openProjectionReadonly(memoryDir);
|
|
65
|
+
if (!db) return null;
|
|
66
|
+
try {
|
|
67
|
+
const paths = /* @__PURE__ */ new Set();
|
|
68
|
+
for (const row of db.prepare("SELECT path_rel FROM memory_current").iterate()) {
|
|
69
|
+
const relative = isRecord(row) ? row.path_rel : void 0;
|
|
70
|
+
if (typeof relative === "string") paths.add(path.resolve(memoryDir, relative));
|
|
71
|
+
}
|
|
72
|
+
return paths;
|
|
73
|
+
} catch {
|
|
74
|
+
return null;
|
|
75
|
+
} finally {
|
|
76
|
+
db.close();
|
|
77
|
+
}
|
|
78
|
+
}
|
|
59
79
|
|
|
60
80
|
export {
|
|
61
|
-
readProjectedMemoryStates
|
|
81
|
+
readProjectedMemoryStates,
|
|
82
|
+
readProjectedMemoryPaths
|
|
62
83
|
};
|
|
63
|
-
//# sourceMappingURL=chunk-
|
|
84
|
+
//# sourceMappingURL=chunk-AZEZSQ5R.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/memory-projection-batch.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { MemoryProjectionCurrentState } from \"./types.js\";\nimport { isRecord } from \"./store-contract.js\";\nimport {\n memoryCurrentSelectExpressions,\n openProjectionReadonly,\n parseCurrentRow,\n} from \"./memory-projection-store.js\";\n\nexport interface ProjectedMemoryStateBatch {\n states: Map<string, MemoryProjectionCurrentState>;\n /** Meta `rebuiltAt`; null when the projection never recorded one. */\n rebuiltAt: string | null;\n /**\n * True only when the writer recorded that `memory_current` covers every active\n * memory (an unscoped rebuild). Projections written before this flag existed,\n * and scoped rebuilds, read as false.\n */\n complete: boolean;\n}\n\n/**\n * Read many current-state rows over ONE readonly connection, plus the meta the\n * recall path needs to decide whether the index can be trusted. Ids absent from\n * `memory_current` are simply missing from the map. Null means the projection\n * could not be opened or read.\n */\nexport function readProjectedMemoryStates(\n memoryDir: string,\n memoryIds: Iterable<string>,\n): ProjectedMemoryStateBatch | null {\n const db = openProjectionReadonly(memoryDir);\n if (!db) return null;\n try {\n const currentSelect = memoryCurrentSelectExpressions(db);\n const select = db.prepare(\n `\n SELECT\n memory_id,\n category,\n status,\n lifecycle_state,\n path_rel,\n created_at,\n updated_at,\n archived_at,\n superseded_at,\n entity_ref,\n source,\n confidence,\n confidence_tier,\n memory_kind,\n access_count,\n last_accessed,\n ${currentSelect.tagsJson},\n ${currentSelect.previewText},\n ${currentSelect.privateRecord}\n FROM memory_current\n WHERE memory_id = ?\n `,\n );\n const states = new Map<string, MemoryProjectionCurrentState>();\n for (const memoryId of memoryIds) {\n const state = parseCurrentRow(memoryDir, select.get(memoryId) as Record<string, unknown> | undefined);\n if (state) states.set(memoryId, state);\n }\n const meta = new Map<string, unknown>(\n (db.prepare(\"SELECT key, value FROM meta WHERE key IN ('rebuiltAt', 'complete')\").all() as Array<{\n key: string;\n value: unknown;\n }>).map((row) => [row.key, row.value]),\n );\n const rebuiltAt = meta.get(\"rebuiltAt\");\n return {\n states,\n rebuiltAt: typeof rebuiltAt === \"string\" ? rebuiltAt : null,\n complete: meta.get(\"complete\") === \"true\",\n };\n } catch {\n return null;\n } finally {\n db.close();\n }\n}\n\n/** Path-only census used to avoid parsing already-projected files during a fallback lookup. */\nexport function readProjectedMemoryPaths(memoryDir: string): Set<string> | null {\n const db = openProjectionReadonly(memoryDir);\n if (!db) return null;\n try {\n const paths = new Set<string>();\n for (const row of db.prepare(\"SELECT path_rel FROM memory_current\").iterate()) {\n const relative = isRecord(row) ? row.path_rel : undefined;\n if (typeof relative === \"string\") paths.add(path.resolve(memoryDir, relative));\n }\n return paths;\n } catch {\n return null;\n } finally {\n db.close();\n }\n}\n"],"mappings":";;;;;;;;;;AAAA,OAAO,UAAU;AA2BV,SAAS,0BACd,WACA,WACkC;AAClC,QAAM,KAAK,uBAAuB,SAAS;AAC3C,MAAI,CAAC,GAAI,QAAO;AAChB,MAAI;AACF,UAAM,gBAAgB,+BAA+B,EAAE;AACvD,UAAM,SAAS,GAAG;AAAA,MAChB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,YAkBM,cAAc,QAAQ;AAAA,YACtB,cAAc,WAAW;AAAA,YACzB,cAAc,aAAa;AAAA;AAAA;AAAA;AAAA,IAInC;AACA,UAAM,SAAS,oBAAI,IAA0C;AAC7D,eAAW,YAAY,WAAW;AAChC,YAAM,QAAQ,gBAAgB,WAAW,OAAO,IAAI,QAAQ,CAAwC;AACpG,UAAI,MAAO,QAAO,IAAI,UAAU,KAAK;AAAA,IACvC;AACA,UAAM,OAAO,IAAI;AAAA,MACd,GAAG,QAAQ,oEAAoE,EAAE,IAAI,EAGlF,IAAI,CAAC,QAAQ,CAAC,IAAI,KAAK,IAAI,KAAK,CAAC;AAAA,IACvC;AACA,UAAM,YAAY,KAAK,IAAI,WAAW;AACt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