@remnic/core 9.69.32 → 9.69.34
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 +13 -11
- package/dist/access-admin-ops-surface.js +64 -59
- package/dist/access-authorization-probe.d.ts +13 -11
- package/dist/access-authorization-probe.js +65 -60
- package/dist/access-boundary.d.ts +13 -11
- package/dist/access-boundary.js +64 -59
- package/dist/access-cli.js +140 -136
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +2 -1
- package/dist/access-coding-context-resolution.js +3 -3
- package/dist/access-extraction-force-flush.d.ts +13 -11
- package/dist/access-extraction-force-flush.js +64 -59
- package/dist/access-health-types.d.ts +2 -1
- package/dist/access-http-briefing.d.ts +13 -11
- package/dist/access-http-briefing.js +65 -60
- package/dist/access-http-lcm-compaction.d.ts +13 -11
- package/dist/access-http-lifecycle-flush.d.ts +13 -11
- package/dist/access-http-offline-stream.d.ts +13 -11
- package/dist/access-http-query.d.ts +3 -2
- package/dist/access-http-query.js +66 -61
- package/dist/access-http.d.ts +14 -12
- package/dist/access-http.js +86 -82
- package/dist/access-identity-continuity-surface.d.ts +11 -9
- package/dist/access-identity-continuity-surface.js +64 -59
- package/dist/access-lcm-surface.d.ts +13 -11
- package/dist/access-lcm-surface.js +64 -59
- package/dist/access-mcp.d.ts +13 -11
- package/dist/access-mcp.js +73 -69
- package/dist/access-memory-search-fanout.d.ts +3 -2
- package/dist/{access-namespace-preflight-BsvmyENS.d.ts → access-namespace-preflight-kXG8MvYx.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +4 -3
- package/dist/access-namespace-preflight.js +64 -59
- package/dist/access-observe-transcript.d.ts +11 -9
- package/dist/access-observe-transcript.js +3 -3
- package/dist/access-observe-write-surface.d.ts +15 -13
- package/dist/access-observe-write-surface.js +64 -59
- package/dist/access-offline-manifest.d.ts +47 -11
- package/dist/access-offline-manifest.js +18 -16
- package/dist/access-operations-batch.js +67 -63
- package/dist/access-operations.d.ts +18 -16
- package/dist/access-operations.js +72 -68
- package/dist/access-recall-concurrency.d.ts +13 -11
- package/dist/access-recall-concurrency.js +64 -59
- package/dist/access-recall-response.d.ts +13 -11
- package/dist/access-recall-response.js +64 -59
- package/dist/access-recall-surface.d.ts +13 -11
- package/dist/access-recall-surface.js +64 -59
- package/dist/access-schema.d.ts +138 -96
- package/dist/access-schema.js +15 -1
- package/dist/{access-service-CCpOuS46.d.ts → access-service-WUm2LnXZ.d.ts} +110 -108
- package/dist/access-service-helpers.d.ts +13 -11
- package/dist/access-service.d.ts +13 -11
- package/dist/access-service.js +64 -59
- package/dist/access-surface-catalog.d.ts +13 -11
- package/dist/access-surface-catalog.js +66 -61
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +4 -3
- package/dist/action-confidence.d.ts +2 -1
- package/dist/active-memory-bridge.d.ts +2 -1
- package/dist/active-memory-bridge.js +2 -2
- package/dist/active-recall.d.ts +2 -1
- package/dist/active-recall.js +14 -12
- package/dist/active-recall.js.map +1 -1
- package/dist/activity/digest.d.ts +56 -0
- package/dist/activity/digest.js +32 -0
- package/dist/adapters/index.d.ts +46 -1
- package/dist/adapters/index.js +13 -9
- package/dist/adapters/registry.js +3 -3
- package/dist/ambient-provenance.d.ts +2 -1
- package/dist/artifact-search.d.ts +2 -1
- package/dist/{auto-sync-NSHLUAQI.js → auto-sync-4YFATLFQ.js} +10 -9
- package/dist/{auto-sync-NSHLUAQI.js.map → auto-sync-4YFATLFQ.js.map} +1 -1
- package/dist/behavior-learner.d.ts +2 -1
- package/dist/behavior-signals.d.ts +2 -1
- package/dist/bootstrap.d.ts +11 -9
- package/dist/briefing-window.d.ts +3 -2
- package/dist/briefing.d.ts +3 -2
- package/dist/briefing.js +28 -27
- package/dist/buffer-surprise-report.d.ts +2 -1
- package/dist/buffer-turn-helpers.d.ts +2 -1
- package/dist/buffer.d.ts +3 -2
- package/dist/buffer.js +12 -11
- package/dist/bulk-import/index.d.ts +4 -3
- package/dist/calibration.d.ts +2 -1
- package/dist/calibration.js +3 -2
- package/dist/calibration.js.map +1 -1
- package/dist/capabilities.d.ts +2 -1
- package/dist/{capsule-merge-IPG4IOFP.js → capsule-merge-ZCXUPLNJ.js} +2 -2
- package/dist/{catalog-CDZLyiXL.d.ts → catalog-BaCx29iv.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +2 -1
- package/dist/causal-consolidation.d.ts +2 -1
- package/dist/causal-consolidation.js +29 -28
- package/dist/causal-consolidation.js.map +1 -1
- package/dist/causal-trajectory-graph.d.ts +2 -1
- package/dist/{chunk-CDKHKZL5.js → chunk-2524MOWK.js} +2 -2
- package/dist/{chunk-HVAEXYPL.js → chunk-255PC37A.js} +47 -25
- package/dist/chunk-255PC37A.js.map +1 -0
- package/dist/{chunk-IY2FVXM6.js → chunk-2AU4D4HQ.js} +3 -3
- package/dist/{chunk-QDY6KYTN.js → chunk-2JCA2PQT.js} +3 -3
- package/dist/{chunk-RSVEP77Y.js → chunk-2UZ5ZH6W.js} +3 -3
- package/dist/{chunk-XQ2Q43XD.js → chunk-326KUXIR.js} +15 -648
- package/dist/chunk-326KUXIR.js.map +1 -0
- package/dist/{chunk-NWWXSJX5.js → chunk-34QW2LK2.js} +2 -2
- package/dist/{chunk-S7DPKM5W.js → chunk-353C5UNV.js} +1 -1
- package/dist/{chunk-GQOMZ3MK.js → chunk-36UBSLFN.js} +2 -2
- package/dist/{chunk-DBQWVT2H.js → chunk-3CBI2ZSA.js} +2 -2
- package/dist/{chunk-NZXEK3UF.js → chunk-3Q3N35W7.js} +2 -2
- package/dist/{chunk-YYGZJPOK.js → chunk-42DJ235G.js} +2 -2
- package/dist/{chunk-7VJXIDOC.js → chunk-4JVQRFZD.js} +9 -9
- package/dist/{chunk-22FVR2KE.js → chunk-4MIS4CQW.js} +6 -2
- package/dist/chunk-4MIS4CQW.js.map +1 -0
- package/dist/{chunk-WHBVXTUI.js → chunk-4PB2MBY6.js} +9 -9
- package/dist/{chunk-TEYN7ZYF.js → chunk-4WCNPQQ5.js} +4 -4
- package/dist/{chunk-Z4PCVRTN.js → chunk-5A7ZUOBA.js} +217 -396
- package/dist/chunk-5A7ZUOBA.js.map +1 -0
- package/dist/chunk-5HYUUFMQ.js +1280 -0
- package/dist/chunk-5HYUUFMQ.js.map +1 -0
- package/dist/{chunk-RBGREYVJ.js → chunk-5QBDLMGG.js} +2 -2
- package/dist/{chunk-RKBLRTNT.js → chunk-5SDSVX7N.js} +2 -2
- package/dist/{chunk-LPECRQO4.js → chunk-5THU7NFP.js} +3 -3
- package/dist/{chunk-N7RWREIQ.js → chunk-65RENJGB.js} +6 -1
- package/dist/chunk-65RENJGB.js.map +1 -0
- package/dist/{chunk-LWA7MDVO.js → chunk-6CCRSQWT.js} +2 -2
- package/dist/{chunk-TIT2C6WX.js → chunk-6XYC7NM4.js} +2 -2
- package/dist/{chunk-FHQSPTPZ.js → chunk-6YAIN5XJ.js} +2 -2
- package/dist/{chunk-PV36INNL.js → chunk-757NP436.js} +3 -3
- package/dist/{chunk-WJBZMNNS.js → chunk-7CAY3YKP.js} +742 -29
- package/dist/chunk-7CAY3YKP.js.map +1 -0
- package/dist/{chunk-6H5JYDOM.js → chunk-7J2CGXG3.js} +2 -2
- package/dist/{chunk-FBMYGNOC.js → chunk-A2YQL2FF.js} +6 -6
- package/dist/chunk-A5UQ52YQ.js +211 -0
- package/dist/chunk-A5UQ52YQ.js.map +1 -0
- package/dist/{chunk-X2NFFBTO.js → chunk-A7GQBJP5.js} +4 -4
- package/dist/{chunk-MPYD657E.js → chunk-A7WOWDZK.js} +2 -2
- package/dist/{chunk-C4OTC6WY.js → chunk-AIKTQVV3.js} +3 -3
- package/dist/{chunk-CGC5UQCF.js → chunk-AKE4GGQ3.js} +2 -2
- package/dist/{chunk-VP67GZ7T.js → chunk-APFKZVJS.js} +2 -2
- package/dist/{chunk-M75RYSHS.js → chunk-AQIRQUCP.js} +2 -2
- package/dist/{chunk-S7T2TY65.js → chunk-AXFR2NQ5.js} +3 -3
- package/dist/{chunk-PSPABFN2.js → chunk-BD7JTBYP.js} +4 -4
- package/dist/{chunk-FCSZ4K2X.js → chunk-BJJWRWER.js} +3 -3
- package/dist/{chunk-JT3EB7ZL.js → chunk-BNGHPYZU.js} +5 -5
- package/dist/chunk-BRZWWUCJ.js +13 -0
- package/dist/{chunk-FYDW33ZB.js.map → chunk-BRZWWUCJ.js.map} +1 -1
- package/dist/{chunk-MFJBANPX.js → chunk-C2BFTYD7.js} +2 -2
- package/dist/{chunk-3JVLGJCY.js → chunk-C6KRO3SU.js} +2 -2
- package/dist/{chunk-Q3O3VKRB.js → chunk-CRUFVJOX.js} +16 -15
- package/dist/chunk-CRUFVJOX.js.map +1 -0
- package/dist/{chunk-AOCP6JA7.js → chunk-D3IZCN5P.js} +4 -4
- package/dist/{chunk-ROKKIMON.js → chunk-EJIEQOPB.js} +5 -5
- package/dist/{chunk-ET356KSB.js → chunk-F4TWWUMP.js} +2 -2
- package/dist/{chunk-CLLPJ6QT.js → chunk-FQXJAC3T.js} +2 -2
- package/dist/{chunk-DD5JFCWM.js → chunk-GCBIXUPT.js} +2 -2
- package/dist/{chunk-ROGRI25A.js → chunk-I3H5LFOI.js} +2 -2
- package/dist/{chunk-S65WXHNK.js → chunk-IFFLUCCU.js} +2 -2
- package/dist/{chunk-MYMNC6O5.js → chunk-ISYZ5DUI.js} +64 -60
- package/dist/{chunk-MYMNC6O5.js.map → chunk-ISYZ5DUI.js.map} +1 -1
- package/dist/{chunk-D5LORF7A.js → chunk-JZDH2ZZK.js} +3 -3
- package/dist/{chunk-2GPE5UCR.js → chunk-K6IPSW5B.js} +2 -2
- package/dist/{chunk-HG6HXVHQ.js → chunk-KDJHLOZP.js} +10 -10
- package/dist/{chunk-I27RSQRR.js → chunk-KYGOQV37.js} +2 -2
- package/dist/{chunk-JEIXTYVG.js → chunk-L2QLDZJC.js} +46 -17
- package/dist/chunk-L2QLDZJC.js.map +1 -0
- package/dist/{chunk-A7XEPMQ6.js → chunk-LAVJC57X.js} +3 -3
- package/dist/chunk-LAVJC57X.js.map +1 -0
- package/dist/{chunk-VZWXFXLX.js → chunk-LMCD5W5B.js} +2 -2
- package/dist/{chunk-3QQTXYZ6.js → chunk-LSLCFCCQ.js} +2 -1
- package/dist/chunk-LSLCFCCQ.js.map +1 -0
- package/dist/{chunk-MKD3OMPS.js → chunk-M3MYMWXG.js} +2 -2
- package/dist/{chunk-DITMGZOL.js → chunk-MMG5K6XJ.js} +2 -2
- package/dist/{chunk-VGXM5B4H.js → chunk-MNIPH6LD.js} +2 -2
- package/dist/{chunk-CZYYJZB6.js → chunk-ND2O2PVN.js} +1014 -1318
- package/dist/chunk-ND2O2PVN.js.map +1 -0
- package/dist/chunk-NPNSKE76.js +220 -0
- package/dist/chunk-NPNSKE76.js.map +1 -0
- package/dist/{chunk-MKWKYHXJ.js → chunk-OB3XMWX5.js} +4 -4
- package/dist/{chunk-XU6OEECT.js → chunk-OQQXGYMX.js} +3 -3
- package/dist/{chunk-GTWHVXPA.js → chunk-OZUXKUPD.js} +6 -4
- package/dist/{chunk-GTWHVXPA.js.map → chunk-OZUXKUPD.js.map} +1 -1
- package/dist/chunk-PCEYGOSL.js +66 -0
- package/dist/chunk-PCEYGOSL.js.map +1 -0
- package/dist/{chunk-47DEYNMR.js → chunk-PEXW2JCK.js} +2 -2
- package/dist/{chunk-EEOUMG3J.js → chunk-PWPIERBM.js} +38 -6
- package/dist/chunk-PWPIERBM.js.map +1 -0
- package/dist/chunk-Q4AUIFUA.js +111 -0
- package/dist/chunk-Q4AUIFUA.js.map +1 -0
- package/dist/{chunk-SO7SV523.js → chunk-Q6LCCIZN.js} +1 -1
- package/dist/chunk-Q6LCCIZN.js.map +1 -0
- package/dist/{chunk-42SDNZCU.js → chunk-QF4J3KMV.js} +19 -19
- package/dist/{chunk-SB6PSOP7.js → chunk-QLJ6762U.js} +2 -2
- package/dist/{chunk-XOVKXJEP.js → chunk-R3TLVTWW.js} +3 -3
- package/dist/{chunk-PHNAB54Q.js → chunk-RQO3J4MR.js} +2 -2
- package/dist/{chunk-5N53UBH2.js → chunk-RR7G2X7C.js} +5 -5
- package/dist/{chunk-DCJ3YFIC.js → chunk-S2ULTQZR.js} +2 -2
- package/dist/{chunk-GY5WZBA6.js → chunk-S76KRJDG.js} +3 -3
- package/dist/{chunk-H272ZPQ3.js → chunk-SHEHQBCG.js} +124 -23
- package/dist/chunk-SHEHQBCG.js.map +1 -0
- package/dist/{chunk-EEC4PCG5.js → chunk-SZDLX763.js} +2 -2
- package/dist/{chunk-SQJ3SDIW.js → chunk-SZWEDG3H.js} +13 -7
- package/dist/chunk-SZWEDG3H.js.map +1 -0
- package/dist/{chunk-E2ZHGBAK.js → chunk-T2JSUEH6.js} +2 -2
- package/dist/{chunk-QMGXMJ2O.js → chunk-T2YFZ27G.js} +9 -9
- package/dist/{chunk-LEPOP46W.js → chunk-TFA6HPOA.js} +4 -4
- package/dist/{chunk-BA6WOZOT.js → chunk-TK4FHQRN.js} +4 -4
- package/dist/chunk-TLHNF6GA.js +647 -0
- package/dist/chunk-TLHNF6GA.js.map +1 -0
- package/dist/{chunk-ZNJSBIP4.js → chunk-TNSCIPBQ.js} +4 -4
- package/dist/{chunk-YUMDFDUA.js → chunk-TWYTGIBR.js} +4 -4
- package/dist/{chunk-FDLDOEO6.js → chunk-UBG4GAEP.js} +51 -6
- package/dist/chunk-UBG4GAEP.js.map +1 -0
- package/dist/{chunk-EZZV7OQL.js → chunk-UEZKN6VR.js} +2 -2
- package/dist/{chunk-HY55QQD7.js → chunk-UJX4I26O.js} +2 -2
- package/dist/{chunk-BLUYQFRH.js → chunk-VELCIWJZ.js} +15 -11
- package/dist/chunk-VELCIWJZ.js.map +1 -0
- package/dist/{chunk-CBCNKKZD.js → chunk-VIZR45AN.js} +2 -2
- package/dist/{chunk-ZG74PWRW.js → chunk-VZAKYDMJ.js} +2 -2
- package/dist/{chunk-ITPS5DDH.js → chunk-W5BLTZZJ.js} +8 -8
- package/dist/chunk-W6IJMWTZ.js +72 -0
- package/dist/chunk-W6IJMWTZ.js.map +1 -0
- package/dist/{chunk-H3TKENU4.js → chunk-WIKO4SCR.js} +5 -5
- package/dist/{chunk-YFLLGRXO.js → chunk-X2QPKLPL.js} +2 -2
- package/dist/{chunk-FGGYSN4P.js → chunk-X424T5JQ.js} +2 -2
- package/dist/{chunk-NAXDPKVM.js → chunk-XPJNT6PI.js} +4 -4
- package/dist/{chunk-2JVJ7UHC.js → chunk-XQU3CPF2.js} +4 -2
- package/dist/chunk-XQU3CPF2.js.map +1 -0
- package/dist/chunk-XW2T4QAW.js +1 -0
- package/dist/{chunk-VED2YHUD.js → chunk-YEDVOYL2.js} +2 -2
- package/dist/{chunk-TLPZ6MKZ.js → chunk-YEN4TREG.js} +541 -5
- package/dist/chunk-YEN4TREG.js.map +1 -0
- package/dist/{chunk-RC5DXXWC.js → chunk-YM7YN37H.js} +2 -2
- package/dist/{chunk-VLXBE57O.js → chunk-YVGXH72Y.js} +2 -2
- package/dist/{chunk-YQAXP5AC.js → chunk-YXLUTALO.js} +5 -5
- package/dist/{chunk-565C6ZFO.js → chunk-Z7YDVHDI.js} +2 -2
- package/dist/{chunk-O75CRYGF.js → chunk-ZEFVK7XC.js} +1 -1
- package/dist/chunk-ZEFVK7XC.js.map +1 -0
- package/dist/{chunk-XUE46UYW.js → chunk-ZLN7AROH.js} +6 -6
- package/dist/{chunk-GVG3JYBI.js → chunk-ZMKYCFJ7.js} +640 -199
- package/dist/chunk-ZMKYCFJ7.js.map +1 -0
- package/dist/{chunk-HK32G473.js → chunk-ZWEZXVYH.js} +2 -2
- package/dist/{cli-NEEdq5Rt.d.ts → cli-5mTYh1Tn.d.ts} +5 -5
- package/dist/cli-fallback.d.ts +11 -4
- package/dist/cli-fallback.js +5 -1
- package/dist/cli.d.ts +15 -13
- package/dist/cli.js +110 -106
- package/dist/coding/export-okf-codegraph.d.ts +2 -1
- package/dist/coding/export-okf-codegraph.js +34 -32
- package/dist/coding/export-okf-codegraph.js.map +1 -1
- package/dist/coding/pre-action-gate.d.ts +2 -1
- package/dist/compat/checks.js +2 -2
- package/dist/compat/codex-cli-fallback.d.ts +1 -1
- package/dist/compat/codex-cli-fallback.js +5 -1
- package/dist/compat/codex-cli-fallback.js.map +1 -1
- package/dist/compounding/engine.d.ts +3 -2
- package/dist/compounding/engine.js +29 -28
- package/dist/compounding/preference-consolidator.d.ts +2 -1
- package/dist/compression-optimizer.d.ts +2 -1
- package/dist/config.d.ts +2 -1
- package/dist/config.js +14 -12
- package/dist/connectors/codex-materialize-runner.d.ts +2 -1
- package/dist/connectors/codex-materialize-runner.js +28 -27
- package/dist/connectors/codex-materialize.d.ts +2 -1
- package/dist/connectors/index.d.ts +2 -1
- package/dist/connectors/index.js +30 -29
- package/dist/consolidation-provenance-check.d.ts +3 -2
- package/dist/consolidation-undo.d.ts +3 -2
- package/dist/contradiction/index.d.ts +4 -3
- package/dist/contradiction/index.js +5 -5
- package/dist/{contradiction-scan-NOYMFG66.js → contradiction-scan-GVD4JJ7B.js} +3 -3
- package/dist/converge-config.d.ts +2 -1
- package/dist/convergence-refresh.d.ts +3 -2
- package/dist/convergence-refresh.js +30 -29
- package/dist/conversation-index/backend.d.ts +2 -1
- package/dist/conversation-index/backend.js +3 -3
- package/dist/conversation-index/chunker.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.d.ts +2 -1
- package/dist/conversation-index/faiss-adapter.js +2 -2
- package/dist/conversation-index/indexer.d.ts +2 -1
- package/dist/conversation-index/search.d.ts +2 -1
- package/dist/corpus-watermark.d.ts +2 -1
- package/dist/corpus-watermark.js +31 -30
- package/dist/cross-lingual-recall.d.ts +2 -1
- package/dist/day-summary.d.ts +2 -1
- package/dist/deep-recall-http-glue.d.ts +13 -11
- package/dist/deep-recall-http-glue.js +12 -2
- package/dist/deep-recall-mcp-tools.d.ts +13 -11
- package/dist/deep-recall-policy-llm.d.ts +2 -1
- package/dist/deep-recall-policy-llm.js +4 -3
- package/dist/deep-recall-seeds.d.ts +2 -1
- package/dist/delinearize.d.ts +2 -1
- package/dist/dependency-propagation-config.d.ts +2 -1
- package/dist/{dependency-propagation-delivery-CQPCu0o5.d.ts → dependency-propagation-delivery-CDQCxNll.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +2 -1
- package/dist/direct-answer.d.ts +2 -1
- package/dist/embedding-fallback.d.ts +2 -1
- package/dist/enrichment/index.d.ts +2 -1
- package/dist/entity-origin-fields.d.ts +2 -1
- package/dist/entity-retrieval.d.ts +3 -2
- package/dist/entity-retrieval.js +28 -27
- package/dist/entity-schema.d.ts +2 -1
- package/dist/episodic-context.d.ts +2 -1
- package/dist/eval-trajectory-contracts.d.ts +2 -1
- package/dist/eval-trajectory-store.d.ts +2 -1
- package/dist/eval-trajectory.d.ts +2 -1
- package/dist/explicit-capture.d.ts +11 -9
- package/dist/explicit-capture.js +6 -6
- package/dist/external-wiki-access.d.ts +13 -11
- package/dist/external-wiki-access.js +65 -60
- package/dist/external-wiki-collection-registration.d.ts +2 -1
- package/dist/external-wiki-collection.d.ts +2 -1
- package/dist/external-wiki-mcp-tools.d.ts +13 -11
- package/dist/extraction-error-classification.d.ts +2 -1
- package/dist/extraction-faithfulness.d.ts +2 -1
- package/dist/extraction-faithfulness.js +4 -3
- package/dist/extraction-judge-telemetry.d.ts +2 -1
- package/dist/extraction-judge-training.d.ts +2 -1
- package/dist/extraction-judge.d.ts +2 -1
- package/dist/extraction-judge.js +5 -4
- package/dist/extraction-liveness.d.ts +2 -1
- package/dist/extraction-normalization.d.ts +2 -1
- package/dist/extraction-prompt.d.ts +2 -1
- package/dist/extraction-source-grounding-rules.d.ts +2 -1
- package/dist/extraction-source-grounding.d.ts +2 -1
- package/dist/extraction.d.ts +2 -1
- package/dist/extraction.js +40 -38
- package/dist/fallback-llm.d.ts +2 -1
- package/dist/fallback-llm.js +3 -2
- package/dist/{first-start-migration-RC345GPL.js → first-start-migration-L3UFX5CU.js} +3 -3
- package/dist/generic-recall-paths-CqAZyXKX.d.ts +23 -0
- package/dist/graph-append-error.d.ts +2 -1
- package/dist/graph-dashboard-diff.d.ts +2 -1
- package/dist/graph-dashboard-key.d.ts +2 -1
- package/dist/graph-dashboard-parser.d.ts +2 -1
- package/dist/graph-edge-reinforcement.d.ts +2 -1
- package/dist/graph-jsonl.d.ts +2 -1
- package/dist/graph-path-reconstruction.d.ts +2 -1
- package/dist/graph-path-scoring.d.ts +2 -1
- package/dist/graph-snapshot.d.ts +2 -1
- package/dist/graph.d.ts +2 -1
- package/dist/harmonic-retrieval.js +2 -2
- package/dist/importance.d.ts +2 -1
- package/dist/importers/index.d.ts +2 -1
- package/dist/importers/test-utils.d.ts +2 -1
- package/dist/in-flight-reads.d.ts +2 -1
- package/dist/{index-C9VXenR8.d.ts → index-BNluTxBp.d.ts} +2 -2
- package/dist/index.d.ts +963 -945
- package/dist/index.js +323 -221
- package/dist/intent.d.ts +2 -1
- package/dist/lcm/engine.d.ts +2 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +2 -1
- package/dist/lcm/index.js +7 -7
- package/dist/lcm/tools.d.ts +2 -1
- package/dist/lifecycle.d.ts +2 -1
- package/dist/live-connectors-runner.d.ts +2 -1
- package/dist/local-llm.d.ts +4 -1
- package/dist/local-llm.js +2 -2
- package/dist/local-model-endpoint.d.ts +2 -1
- package/dist/location/index.d.ts +4 -3
- package/dist/location/index.js +33 -32
- package/dist/maintenance/memory-governance.d.ts +2 -1
- package/dist/maintenance/memory-governance.js +28 -27
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +28 -27
- package/dist/maintenance/rebuild-memory-projection.d.ts +3 -2
- package/dist/maintenance/rebuild-memory-projection.js +29 -28
- package/dist/{maintenance-C14sorKa.d.ts → maintenance-8hmWOMY_.d.ts} +378 -4
- package/dist/mcp-memory-inspector-app.d.ts +13 -11
- package/dist/memory-action-policy.d.ts +2 -1
- package/dist/memory-cache.d.ts +2 -1
- package/dist/memory-controller.d.ts +2 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +2 -1
- package/dist/memory-projection-store.d.ts +2 -1
- package/dist/memory-provenance.d.ts +2 -1
- package/dist/memory-snapshot.d.ts +2 -1
- package/dist/memory-subject-cli.d.ts +13 -11
- package/dist/memory-subject.d.ts +13 -11
- package/dist/memory-worth-outcomes.d.ts +3 -2
- package/dist/migrate/from-engram.js +2 -2
- package/dist/models-json.d.ts +2 -1
- package/dist/namespaces/migrate.d.ts +4 -3
- package/dist/namespaces/migrate.js +29 -28
- package/dist/namespaces/principal.d.ts +2 -1
- package/dist/namespaces/search.d.ts +2 -1
- package/dist/namespaces/search.js +11 -11
- package/dist/namespaces/storage.d.ts +4 -3
- package/dist/namespaces/storage.js +28 -27
- package/dist/native-knowledge.d.ts +2 -1
- package/dist/network/tailscale.js +2 -2
- package/dist/offline-sync-impression-drain.d.ts +2 -1
- package/dist/offline-sync-impression-drain.js +6 -6
- package/dist/operator-doctor-corpus.d.ts +2 -1
- package/dist/operator-doctor-corpus.js +32 -31
- package/dist/operator-doctor-replica.d.ts +2 -1
- package/dist/operator-toolkit.d.ts +4 -3
- package/dist/operator-toolkit.js +48 -46
- package/dist/orchestration/compression-guideline-coordinator.d.ts +3 -2
- package/dist/orchestration/maintenance.d.ts +5 -4
- package/dist/orchestration/maintenance.js +47 -42
- package/dist/{orchestrator-kqSzGv7e.d.ts → orchestrator-BUd_3Q86.d.ts} +17 -29
- package/dist/orchestrator.d.ts +11 -9
- package/dist/orchestrator.js +144 -138
- package/dist/patterns-cli.d.ts +2 -1
- package/dist/{pipeline-DRUwHb1X.d.ts → pipeline-Dv1Bv0ma.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +2 -1
- package/dist/proactive-contention.d.ts +2 -1
- package/dist/provenance.d.ts +2 -1
- package/dist/{public-http-CW3l0g3P.d.ts → public-http-L-IymRBN.d.ts} +1 -1
- package/dist/{qmd-BVWlg1YS.d.ts → qmd-Mj508lHA.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +3 -2
- package/dist/qmd-recall-cache.d.ts +2 -1
- package/dist/qmd.d.ts +3 -2
- package/dist/qmd.js +2 -2
- package/dist/recall-concurrency-config.d.ts +2 -1
- package/dist/recall-disclosure-escalation.d.ts +2 -1
- package/dist/recall-explain-renderer.d.ts +2 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +2 -1
- package/dist/recall-navigate-access.d.ts +2 -1
- package/dist/recall-navigate-access.js +2 -2
- package/dist/recall-navigate-disclosure.d.ts +2 -1
- package/dist/recall-navigate-disclosure.js +1 -1
- package/dist/recall-navigate.d.ts +2 -1
- package/dist/recall-navigate.js +2 -2
- package/dist/recall-planner-llm.d.ts +2 -1
- package/dist/recall-planner-llm.js +3 -2
- package/dist/recall-planner-llm.js.map +1 -1
- package/dist/recall-state-view-admission.d.ts +56 -0
- package/dist/recall-state-view-admission.js +39 -0
- package/dist/recall-state-view-admission.js.map +1 -0
- package/dist/recall-state-view-inject.js +2 -2
- package/dist/recall-state-view-render.js +2 -2
- package/dist/recall-state-view-widen.d.ts +18 -1
- package/dist/recall-state-view-widen.js +2 -2
- package/dist/recall-state-view-wire.d.ts +1 -1
- package/dist/recall-state-view-wire.js +3 -3
- package/dist/recall-state-view.d.ts +1 -0
- package/dist/recall-state-view.js +1 -1
- package/dist/recall-state.d.ts +2 -1
- package/dist/recall-tag-filter.d.ts +2 -1
- package/dist/recall-timings.d.ts +2 -1
- package/dist/recall-xray-cli.d.ts +2 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +2 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +9 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +11 -2
- package/dist/reconcile/cursor.js +6 -4
- package/dist/reconcile/cursor.js.map +1 -1
- package/dist/reconcile/manifest.d.ts +37 -2
- package/dist/reconcile/manifest.js +15 -5
- package/dist/reconcile/plan.d.ts +2 -1
- package/dist/replay/normalizers/chatgpt.d.ts +2 -1
- package/dist/replay/normalizers/claude.d.ts +2 -1
- package/dist/replay/normalizers/openclaw.d.ts +2 -1
- package/dist/replay/normalizers/shared.d.ts +2 -1
- package/dist/replay/runner.d.ts +2 -1
- package/dist/replay/types.d.ts +2 -1
- package/dist/replica-divergence.d.ts +2 -1
- package/dist/replica-peers-config.d.ts +2 -1
- package/dist/{resolution-VKATP2HT.js → resolution-OHJZG45O.js} +6 -6
- package/dist/resolution-OHJZG45O.js.map +1 -0
- package/dist/resolve-auth-token.d.ts +2 -1
- package/dist/resume-bundles.js +15 -13
- package/dist/retrieval-agents.d.ts +3 -2
- package/dist/retrieval-tiers.d.ts +2 -1
- package/dist/routing/engine.d.ts +2 -1
- package/dist/routing/store.d.ts +2 -1
- package/dist/runtime/child-process.d.ts +1 -1
- package/dist/runtime/child-process.js +1 -1
- package/dist/salvage-envelope.d.ts +2 -1
- package/dist/salvage-envelope.js +2 -2
- package/dist/schemas.d.ts +176 -176
- package/dist/{scope-profiles-Vl00B1KU.d.ts → scope-profiles-B6BGVbxm.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +2 -1
- package/dist/search/factory.d.ts +2 -1
- package/dist/search/factory.js +10 -10
- package/dist/search/index.d.ts +2 -1
- package/dist/search/index.js +14 -14
- package/dist/search/lancedb-backend.d.ts +2 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +2 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +2 -1
- package/dist/search/orama-backend.d.ts +2 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +2 -1
- package/dist/search/remote-backend.d.ts +2 -1
- package/dist/{semantic-consolidation-BC9-GFuT.d.ts → semantic-consolidation-J-598F5M.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +3 -2
- package/dist/semantic-consolidation.js +29 -28
- package/dist/semantic-rule-promotion.js +28 -27
- package/dist/semantic-rule-verifier.d.ts +2 -1
- package/dist/semantic-rule-verifier.js +28 -27
- package/dist/{service-BOy6dHfc.d.ts → service-ZQkJ52cz.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +2 -1
- package/dist/session-observer-state.d.ts +2 -1
- package/dist/shared-context/manager.d.ts +8 -7
- package/dist/signal.d.ts +2 -1
- package/dist/source-agent-qualifier.d.ts +2 -1
- package/dist/source-agent-qualifier.js +38 -36
- package/dist/standup/build.js +29 -28
- package/dist/{storage-BLJRnFi6.d.ts → storage-CU_hZUgP.d.ts} +67 -6
- package/dist/storage.d.ts +4 -3
- package/dist/storage.js +27 -26
- package/dist/subject-config.d.ts +2 -1
- package/dist/subject-config.js +2 -2
- package/dist/summarizer.d.ts +2 -1
- package/dist/summarizer.js +5 -5
- package/dist/summary-snapshot.d.ts +2 -1
- package/dist/support-passport/index.d.ts +49 -15
- package/dist/support-passport/index.js +72 -63
- package/dist/temporal-supersession.d.ts +3 -2
- package/dist/temporal-timeline-recall.d.ts +2 -1
- package/dist/temporal-validity.d.ts +2 -1
- package/dist/threading.d.ts +2 -1
- package/dist/tier-migration.d.ts +3 -2
- package/dist/tier-routing.d.ts +2 -1
- package/dist/tier-routing.js +2 -2
- package/dist/{tier-stats-KA6OZX2C.js → tier-stats-VK5PCO2L.js} +3 -3
- package/dist/topics.d.ts +2 -1
- package/dist/transcript.d.ts +2 -1
- package/dist/transfer/capsule-import.js +1 -1
- package/dist/transfer/export-okf.d.ts +2 -1
- package/dist/transfer/export-okf.js +29 -28
- package/dist/transfer/types.d.ts +102 -102
- package/dist/trust-score-stage.d.ts +2 -1
- package/dist/trust-score.d.ts +2 -1
- package/dist/{types-YY-eKKU7.d.ts → types-BGxTvLBO.d.ts} +58 -13
- package/dist/types.d.ts +2 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +2 -1
- package/dist/verified-recall.js +28 -27
- package/dist/who-knows-cli.d.ts +13 -11
- package/dist/who-knows-cli.js +29 -28
- package/dist/who-knows.d.ts +13 -11
- package/dist/who-knows.js +28 -27
- package/dist/write-envelope.d.ts +4 -2
- package/dist/write-envelope.js +3 -1
- package/package.json +12 -2
- package/src/access-category-alias.test.ts +216 -0
- package/src/access-mcp.test.ts +73 -0
- package/src/access-mcp.ts +6 -6
- package/src/access-observe-write-surface.ts +19 -4
- package/src/access-offline-manifest.ts +297 -16
- package/src/access-recall-surface.ts +5 -5
- package/src/access-schema.ts +76 -7
- package/src/access-service.ts +11 -2
- package/src/activity/config.test.ts +124 -1
- package/src/activity/config.ts +150 -18
- package/src/activity/index.ts +3 -0
- package/src/activity/journal-extract-storage.test.ts +129 -0
- package/src/activity/journal-extract.test.ts +314 -0
- package/src/activity/journal-extract.ts +247 -0
- package/src/activity/journal-heading.test.ts +24 -1
- package/src/activity/journal-heading.ts +36 -0
- package/src/activity/journal-read.test.ts +242 -0
- package/src/activity/journal-read.ts +183 -0
- package/src/activity/journal-source.test.ts +15 -15
- package/src/activity/journal-source.ts +21 -14
- package/src/activity/journal-state.lock-worker.ts +30 -0
- package/src/activity/journal-state.test.ts +144 -0
- package/src/activity/journal-state.ts +107 -0
- package/src/activity/journal-strip.test.ts +106 -52
- package/src/activity/journal-strip.ts +35 -10
- package/src/activity/journal-vault-integration.test.ts +230 -0
- package/src/activity/journal-vault-provenance.test.ts +9 -7
- package/src/activity/journal-vault-provenance.ts +4 -10
- package/src/activity/journal-vault-read.test.ts +3 -2
- package/src/activity/journal-vault-read.ts +9 -139
- package/src/activity/journal.test.ts +74 -23
- package/src/activity/runner.test.ts +116 -1
- package/src/activity/runner.ts +25 -0
- package/src/activity/scheduler.ts +4 -0
- package/src/activity/store.test.ts +18 -0
- package/src/activity/store.ts +14 -0
- package/src/activity/sync-registration.ts +4 -0
- package/src/activity/timeline/analysis-metadata.ts +2 -0
- package/src/activity/timeline/analysis-provider.ts +140 -0
- package/src/activity/timeline/analysis-run.test.ts +419 -0
- package/src/activity/timeline/analysis-run.ts +106 -0
- package/src/activity/timeline/analysis.ts +66 -37
- package/src/activity/timeline/corrections.ts +9 -0
- package/src/activity/timeline/index.ts +3 -0
- package/src/activity/timeline/query.test.ts +71 -0
- package/src/activity/timeline/query.ts +57 -8
- package/src/activity/timeline/regenerate.test.ts +505 -0
- package/src/activity/timeline/regenerate.ts +373 -0
- package/src/activity/types.ts +40 -5
- package/src/adapters/grok-opencode.test.ts +146 -0
- package/src/adapters/grok.ts +53 -0
- package/src/adapters/index.ts +2 -0
- package/src/adapters/opencode.ts +52 -0
- package/src/adapters/registry.ts +4 -0
- package/src/cli-fallback.ts +13 -4
- package/src/config.test.ts +3 -1
- package/src/config.ts +4 -0
- package/src/dedup/merge.test.ts +732 -25
- package/src/fallback-llm.test.ts +53 -0
- package/src/fallback-llm.ts +12 -0
- package/src/index.ts +2 -0
- package/src/local-llm.ts +3 -1
- package/src/orchestration/dependency-propagation-recovery-replay.ts +1 -1
- package/src/orchestration/extraction-persist-deps.ts +9 -0
- package/src/orchestration/extraction-persist-promotion.test.ts +265 -6
- package/src/orchestration/extraction-persist-promotion.ts +42 -3
- package/src/orchestration/extraction-persist.ts +3 -3
- package/src/orchestration/harmonic-construction-persist.test.ts +115 -4
- package/src/orchestration/harmonic-construction-persist.ts +34 -6
- package/src/orchestration/maintenance.ts +1 -0
- package/src/orchestration/orchestrator-helpers.ts +6 -0
- package/src/orchestration/recall-entry.ts +16 -0
- package/src/orchestration/recall-internal-deps.ts +14 -0
- package/src/orchestration/recall-internal.ts +41 -58
- package/src/orchestration/recall-result-formatter.ts +11 -1
- package/src/orchestration/recall-search-pipeline.ts +121 -11
- package/src/orchestration/recall-state-view-pipeline.test.ts +211 -0
- package/src/orchestration/semantic-merge-commit-effects.ts +76 -17
- package/src/orchestration/semantic-merge-persist.ts +121 -16
- package/src/orchestration/semantic-merge-promotion-payload.ts +133 -54
- package/src/orchestrator.ts +7 -35
- package/src/providers/codex-subscription.test.ts +666 -0
- package/src/providers/codex-subscription.ts +743 -0
- package/src/recall-disclosure.test.ts +20 -0
- package/src/recall-state-view-admission.ts +114 -0
- package/src/recall-state-view-asof.test.ts +176 -0
- package/src/recall-state-view-call.test.ts +175 -0
- package/src/recall-state-view-config.test.ts +16 -0
- package/src/recall-state-view-widen.test.ts +70 -0
- package/src/recall-state-view-widen.ts +28 -7
- package/src/recall-state-view-wire.ts +3 -1
- package/src/recall-state-view-zero-diff.test.ts +20 -11
- package/src/recall-state-view.test.ts +142 -0
- package/src/recall-state-view.ts +72 -24
- package/src/recall-xray-renderer.test.ts +27 -0
- package/src/recall-xray-renderer.ts +4 -0
- package/src/recall-xray.ts +13 -0
- package/src/reconcile/cursor.ts +23 -33
- package/src/reconcile/manifest.ts +96 -11
- package/src/reconcile-identity-cache.test.ts +378 -0
- package/src/runtime/child-process.ts +1 -1
- package/src/storage/cas-revision-host.ts +75 -0
- package/src/storage/cas-revision-store.test.ts +459 -0
- package/src/storage/cas-revision-store.ts +661 -0
- package/src/storage/deletion-revision-store.ts +80 -6
- package/src/storage/tombstone-blocked-capture-index.ts +15 -0
- package/src/storage/tombstone-blocked-capture-mutation.ts +67 -7
- package/src/storage/tombstone-blocked-capture-sync.ts +55 -20
- package/src/storage-contract/failure-semantics.test.ts +1 -1
- package/src/storage-frontmatter-cas.test.ts +698 -1
- package/src/storage-replay.test.ts +166 -3
- package/src/storage.ts +41 -41
- package/src/support-passport/card-projection.ts +82 -33
- package/src/temporal-supersession.test.ts +10 -10
- package/src/types.ts +7 -7
- package/src/write-envelope.ts +1 -1
- package/dist/chunk-22FVR2KE.js.map +0 -1
- package/dist/chunk-2JVJ7UHC.js.map +0 -1
- package/dist/chunk-3QQTXYZ6.js.map +0 -1
- package/dist/chunk-4UDQUPT5.js +0 -560
- package/dist/chunk-4UDQUPT5.js.map +0 -1
- package/dist/chunk-A7XEPMQ6.js.map +0 -1
- package/dist/chunk-AU7Q3LSC.js +0 -56
- package/dist/chunk-AU7Q3LSC.js.map +0 -1
- package/dist/chunk-BLUYQFRH.js.map +0 -1
- package/dist/chunk-CZYYJZB6.js.map +0 -1
- package/dist/chunk-EEOUMG3J.js.map +0 -1
- package/dist/chunk-FDLDOEO6.js.map +0 -1
- package/dist/chunk-FYDW33ZB.js +0 -13
- package/dist/chunk-GVG3JYBI.js.map +0 -1
- package/dist/chunk-H272ZPQ3.js.map +0 -1
- package/dist/chunk-HVAEXYPL.js.map +0 -1
- package/dist/chunk-JEIXTYVG.js.map +0 -1
- package/dist/chunk-LRICZIGN.js +0 -52
- package/dist/chunk-LRICZIGN.js.map +0 -1
- package/dist/chunk-N7RWREIQ.js.map +0 -1
- package/dist/chunk-O75CRYGF.js.map +0 -1
- package/dist/chunk-Q3O3VKRB.js.map +0 -1
- package/dist/chunk-SEDEKFYQ.js +0 -1
- package/dist/chunk-SO7SV523.js.map +0 -1
- package/dist/chunk-SQJ3SDIW.js.map +0 -1
- package/dist/chunk-TLPZ6MKZ.js.map +0 -1
- package/dist/chunk-WJBZMNNS.js.map +0 -1
- package/dist/chunk-XQ2Q43XD.js.map +0 -1
- package/dist/chunk-Z4PCVRTN.js.map +0 -1
- package/src/activity/journal-mode.test.ts +0 -32
- package/src/activity/journal-mode.ts +0 -20
- /package/dist/{chunk-SEDEKFYQ.js.map → activity/digest.js.map} +0 -0
- /package/dist/{capsule-merge-IPG4IOFP.js.map → capsule-merge-ZCXUPLNJ.js.map} +0 -0
- /package/dist/{chunk-CDKHKZL5.js.map → chunk-2524MOWK.js.map} +0 -0
- /package/dist/{chunk-IY2FVXM6.js.map → chunk-2AU4D4HQ.js.map} +0 -0
- /package/dist/{chunk-QDY6KYTN.js.map → chunk-2JCA2PQT.js.map} +0 -0
- /package/dist/{chunk-RSVEP77Y.js.map → chunk-2UZ5ZH6W.js.map} +0 -0
- /package/dist/{chunk-NWWXSJX5.js.map → chunk-34QW2LK2.js.map} +0 -0
- /package/dist/{chunk-S7DPKM5W.js.map → chunk-353C5UNV.js.map} +0 -0
- /package/dist/{chunk-GQOMZ3MK.js.map → chunk-36UBSLFN.js.map} +0 -0
- /package/dist/{chunk-DBQWVT2H.js.map → chunk-3CBI2ZSA.js.map} +0 -0
- /package/dist/{chunk-NZXEK3UF.js.map → chunk-3Q3N35W7.js.map} +0 -0
- /package/dist/{chunk-YYGZJPOK.js.map → chunk-42DJ235G.js.map} +0 -0
- /package/dist/{chunk-7VJXIDOC.js.map → chunk-4JVQRFZD.js.map} +0 -0
- /package/dist/{chunk-WHBVXTUI.js.map → chunk-4PB2MBY6.js.map} +0 -0
- /package/dist/{chunk-TEYN7ZYF.js.map → chunk-4WCNPQQ5.js.map} +0 -0
- /package/dist/{chunk-RBGREYVJ.js.map → chunk-5QBDLMGG.js.map} +0 -0
- /package/dist/{chunk-RKBLRTNT.js.map → chunk-5SDSVX7N.js.map} +0 -0
- /package/dist/{chunk-LPECRQO4.js.map → chunk-5THU7NFP.js.map} +0 -0
- /package/dist/{chunk-LWA7MDVO.js.map → chunk-6CCRSQWT.js.map} +0 -0
- /package/dist/{chunk-TIT2C6WX.js.map → chunk-6XYC7NM4.js.map} +0 -0
- /package/dist/{chunk-FHQSPTPZ.js.map → chunk-6YAIN5XJ.js.map} +0 -0
- /package/dist/{chunk-PV36INNL.js.map → chunk-757NP436.js.map} +0 -0
- /package/dist/{chunk-6H5JYDOM.js.map → chunk-7J2CGXG3.js.map} +0 -0
- /package/dist/{chunk-FBMYGNOC.js.map → chunk-A2YQL2FF.js.map} +0 -0
- /package/dist/{chunk-X2NFFBTO.js.map → chunk-A7GQBJP5.js.map} +0 -0
- /package/dist/{chunk-MPYD657E.js.map → chunk-A7WOWDZK.js.map} +0 -0
- /package/dist/{chunk-C4OTC6WY.js.map → chunk-AIKTQVV3.js.map} +0 -0
- /package/dist/{chunk-CGC5UQCF.js.map → chunk-AKE4GGQ3.js.map} +0 -0
- /package/dist/{chunk-VP67GZ7T.js.map → chunk-APFKZVJS.js.map} +0 -0
- /package/dist/{chunk-M75RYSHS.js.map → chunk-AQIRQUCP.js.map} +0 -0
- /package/dist/{chunk-S7T2TY65.js.map → chunk-AXFR2NQ5.js.map} +0 -0
- /package/dist/{chunk-PSPABFN2.js.map → chunk-BD7JTBYP.js.map} +0 -0
- /package/dist/{chunk-FCSZ4K2X.js.map → chunk-BJJWRWER.js.map} +0 -0
- /package/dist/{chunk-JT3EB7ZL.js.map → chunk-BNGHPYZU.js.map} +0 -0
- /package/dist/{chunk-MFJBANPX.js.map → chunk-C2BFTYD7.js.map} +0 -0
- /package/dist/{chunk-3JVLGJCY.js.map → chunk-C6KRO3SU.js.map} +0 -0
- /package/dist/{chunk-AOCP6JA7.js.map → chunk-D3IZCN5P.js.map} +0 -0
- /package/dist/{chunk-ROKKIMON.js.map → chunk-EJIEQOPB.js.map} +0 -0
- /package/dist/{chunk-ET356KSB.js.map → chunk-F4TWWUMP.js.map} +0 -0
- /package/dist/{chunk-CLLPJ6QT.js.map → chunk-FQXJAC3T.js.map} +0 -0
- /package/dist/{chunk-DD5JFCWM.js.map → chunk-GCBIXUPT.js.map} +0 -0
- /package/dist/{chunk-ROGRI25A.js.map → chunk-I3H5LFOI.js.map} +0 -0
- /package/dist/{chunk-S65WXHNK.js.map → chunk-IFFLUCCU.js.map} +0 -0
- /package/dist/{chunk-D5LORF7A.js.map → chunk-JZDH2ZZK.js.map} +0 -0
- /package/dist/{chunk-2GPE5UCR.js.map → chunk-K6IPSW5B.js.map} +0 -0
- /package/dist/{chunk-HG6HXVHQ.js.map → chunk-KDJHLOZP.js.map} +0 -0
- /package/dist/{chunk-I27RSQRR.js.map → chunk-KYGOQV37.js.map} +0 -0
- /package/dist/{chunk-VZWXFXLX.js.map → chunk-LMCD5W5B.js.map} +0 -0
- /package/dist/{chunk-MKD3OMPS.js.map → chunk-M3MYMWXG.js.map} +0 -0
- /package/dist/{chunk-DITMGZOL.js.map → chunk-MMG5K6XJ.js.map} +0 -0
- /package/dist/{chunk-VGXM5B4H.js.map → chunk-MNIPH6LD.js.map} +0 -0
- /package/dist/{chunk-MKWKYHXJ.js.map → chunk-OB3XMWX5.js.map} +0 -0
- /package/dist/{chunk-XU6OEECT.js.map → chunk-OQQXGYMX.js.map} +0 -0
- /package/dist/{chunk-47DEYNMR.js.map → chunk-PEXW2JCK.js.map} +0 -0
- /package/dist/{chunk-42SDNZCU.js.map → chunk-QF4J3KMV.js.map} +0 -0
- /package/dist/{chunk-SB6PSOP7.js.map → chunk-QLJ6762U.js.map} +0 -0
- /package/dist/{chunk-XOVKXJEP.js.map → chunk-R3TLVTWW.js.map} +0 -0
- /package/dist/{chunk-PHNAB54Q.js.map → chunk-RQO3J4MR.js.map} +0 -0
- /package/dist/{chunk-5N53UBH2.js.map → chunk-RR7G2X7C.js.map} +0 -0
- /package/dist/{chunk-DCJ3YFIC.js.map → chunk-S2ULTQZR.js.map} +0 -0
- /package/dist/{chunk-GY5WZBA6.js.map → chunk-S76KRJDG.js.map} +0 -0
- /package/dist/{chunk-EEC4PCG5.js.map → chunk-SZDLX763.js.map} +0 -0
- /package/dist/{chunk-E2ZHGBAK.js.map → chunk-T2JSUEH6.js.map} +0 -0
- /package/dist/{chunk-QMGXMJ2O.js.map → chunk-T2YFZ27G.js.map} +0 -0
- /package/dist/{chunk-LEPOP46W.js.map → chunk-TFA6HPOA.js.map} +0 -0
- /package/dist/{chunk-BA6WOZOT.js.map → chunk-TK4FHQRN.js.map} +0 -0
- /package/dist/{chunk-ZNJSBIP4.js.map → chunk-TNSCIPBQ.js.map} +0 -0
- /package/dist/{chunk-YUMDFDUA.js.map → chunk-TWYTGIBR.js.map} +0 -0
- /package/dist/{chunk-EZZV7OQL.js.map → chunk-UEZKN6VR.js.map} +0 -0
- /package/dist/{chunk-HY55QQD7.js.map → chunk-UJX4I26O.js.map} +0 -0
- /package/dist/{chunk-CBCNKKZD.js.map → chunk-VIZR45AN.js.map} +0 -0
- /package/dist/{chunk-ZG74PWRW.js.map → chunk-VZAKYDMJ.js.map} +0 -0
- /package/dist/{chunk-ITPS5DDH.js.map → chunk-W5BLTZZJ.js.map} +0 -0
- /package/dist/{chunk-H3TKENU4.js.map → chunk-WIKO4SCR.js.map} +0 -0
- /package/dist/{chunk-YFLLGRXO.js.map → chunk-X2QPKLPL.js.map} +0 -0
- /package/dist/{chunk-FGGYSN4P.js.map → chunk-X424T5JQ.js.map} +0 -0
- /package/dist/{chunk-NAXDPKVM.js.map → chunk-XPJNT6PI.js.map} +0 -0
- /package/dist/{contradiction-scan-NOYMFG66.js.map → chunk-XW2T4QAW.js.map} +0 -0
- /package/dist/{chunk-VED2YHUD.js.map → chunk-YEDVOYL2.js.map} +0 -0
- /package/dist/{chunk-RC5DXXWC.js.map → chunk-YM7YN37H.js.map} +0 -0
- /package/dist/{chunk-VLXBE57O.js.map → chunk-YVGXH72Y.js.map} +0 -0
- /package/dist/{chunk-YQAXP5AC.js.map → chunk-YXLUTALO.js.map} +0 -0
- /package/dist/{chunk-565C6ZFO.js.map → chunk-Z7YDVHDI.js.map} +0 -0
- /package/dist/{chunk-XUE46UYW.js.map → chunk-ZLN7AROH.js.map} +0 -0
- /package/dist/{chunk-HK32G473.js.map → chunk-ZWEZXVYH.js.map} +0 -0
- /package/dist/{resolution-VKATP2HT.js.map → contradiction-scan-GVD4JJ7B.js.map} +0 -0
- /package/dist/{first-start-migration-RC345GPL.js.map → first-start-migration-L3UFX5CU.js.map} +0 -0
- /package/dist/{tier-stats-KA6OZX2C.js.map → tier-stats-VK5PCO2L.js.map} +0 -0
|
@@ -29,13 +29,13 @@ import {
|
|
|
29
29
|
parseDecisionRecord,
|
|
30
30
|
resolveCodegraphProjectId,
|
|
31
31
|
serializeDecisionRecord
|
|
32
|
-
} from "./chunk-
|
|
32
|
+
} from "./chunk-TK4FHQRN.js";
|
|
33
33
|
import {
|
|
34
34
|
WHO_KNOWS_DEFAULT_LIMIT,
|
|
35
35
|
computeWhoKnows,
|
|
36
36
|
loadWhoKnowsEntities,
|
|
37
37
|
validateWhoKnowsInput
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-UEZKN6VR.js";
|
|
39
39
|
import {
|
|
40
40
|
WriteQuarantineStore
|
|
41
41
|
} from "./chunk-PJSK6OJM.js";
|
|
@@ -56,22 +56,25 @@ import {
|
|
|
56
56
|
} from "./chunk-ROBHL3GL.js";
|
|
57
57
|
import {
|
|
58
58
|
summarizeHourlyStatus
|
|
59
|
-
} from "./chunk-
|
|
59
|
+
} from "./chunk-BJJWRWER.js";
|
|
60
60
|
import {
|
|
61
61
|
planSessionTranscriptMigration
|
|
62
62
|
} from "./chunk-P5FPO2BR.js";
|
|
63
|
+
import {
|
|
64
|
+
isSearchExcludedPath
|
|
65
|
+
} from "./chunk-A5UQ52YQ.js";
|
|
63
66
|
import {
|
|
64
67
|
decideDisclosureEscalation
|
|
65
68
|
} from "./chunk-H7XKCNR6.js";
|
|
66
69
|
import {
|
|
67
70
|
toRecallExplainJson
|
|
68
|
-
} from "./chunk-
|
|
71
|
+
} from "./chunk-4MIS4CQW.js";
|
|
69
72
|
import {
|
|
70
73
|
estimateRecallTokens
|
|
71
|
-
} from "./chunk-
|
|
74
|
+
} from "./chunk-XQU3CPF2.js";
|
|
72
75
|
import {
|
|
73
76
|
readAggregateExtractionWatermark
|
|
74
|
-
} from "./chunk-
|
|
77
|
+
} from "./chunk-RQO3J4MR.js";
|
|
75
78
|
import {
|
|
76
79
|
ReplicaDivergenceMonitor
|
|
77
80
|
} from "./chunk-CVILPI77.js";
|
|
@@ -92,22 +95,22 @@ import {
|
|
|
92
95
|
} from "./chunk-HWLIMQE2.js";
|
|
93
96
|
import {
|
|
94
97
|
readProjectedHarmonicGraph
|
|
95
|
-
} from "./chunk-
|
|
98
|
+
} from "./chunk-QLJ6762U.js";
|
|
96
99
|
import {
|
|
97
100
|
wrapWorkLayerContext
|
|
98
101
|
} from "./chunk-EI6V5UXY.js";
|
|
99
102
|
import {
|
|
100
103
|
CONNECTOR_LABEL_MAX_LENGTH
|
|
101
|
-
} from "./chunk-
|
|
104
|
+
} from "./chunk-ZWEZXVYH.js";
|
|
102
105
|
import {
|
|
103
106
|
isValidConnectorId
|
|
104
|
-
} from "./chunk-
|
|
107
|
+
} from "./chunk-FQXJAC3T.js";
|
|
105
108
|
import {
|
|
106
109
|
formatProfileTraceAscii
|
|
107
110
|
} from "./chunk-NLE6TSLG.js";
|
|
108
111
|
import {
|
|
109
112
|
LocalLlmClient
|
|
110
|
-
} from "./chunk-
|
|
113
|
+
} from "./chunk-LAVJC57X.js";
|
|
111
114
|
import {
|
|
112
115
|
REDACTION_RULES_SUBDIR
|
|
113
116
|
} from "./chunk-LTHVM4XN.js";
|
|
@@ -115,7 +118,7 @@ import {
|
|
|
115
118
|
persistExplicitCapture,
|
|
116
119
|
queueExplicitCaptureForReview,
|
|
117
120
|
validateExplicitCaptureInput
|
|
118
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-ZLN7AROH.js";
|
|
119
122
|
import {
|
|
120
123
|
lcmEvidenceIdentity
|
|
121
124
|
} from "./chunk-C37ZRXX7.js";
|
|
@@ -139,7 +142,7 @@ import {
|
|
|
139
142
|
} from "./chunk-UFGFMWAD.js";
|
|
140
143
|
import {
|
|
141
144
|
callDeepRecallPolicyLlm
|
|
142
|
-
} from "./chunk-
|
|
145
|
+
} from "./chunk-AKE4GGQ3.js";
|
|
143
146
|
import {
|
|
144
147
|
buildProposedActions,
|
|
145
148
|
buildQualityScore,
|
|
@@ -147,11 +150,11 @@ import {
|
|
|
147
150
|
listMemoryGovernanceRuns,
|
|
148
151
|
readMemoryGovernanceRunArtifact,
|
|
149
152
|
runMemoryGovernance
|
|
150
|
-
} from "./chunk-
|
|
153
|
+
} from "./chunk-S76KRJDG.js";
|
|
151
154
|
import {
|
|
152
155
|
CorpusWatermarkCache,
|
|
153
156
|
computeServiceCorpusCensus
|
|
154
|
-
} from "./chunk-
|
|
157
|
+
} from "./chunk-IFFLUCCU.js";
|
|
155
158
|
import {
|
|
156
159
|
defaultCapsulesDir
|
|
157
160
|
} from "./chunk-ZY2MNJR6.js";
|
|
@@ -161,22 +164,21 @@ import {
|
|
|
161
164
|
enqueuePassiveCorrectionNotification,
|
|
162
165
|
parseBriefingFocus,
|
|
163
166
|
parseBriefingWindow
|
|
164
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-RR7G2X7C.js";
|
|
165
168
|
import {
|
|
166
|
-
OKF_RESERVED_BASENAMES,
|
|
167
169
|
parseEntityFile,
|
|
168
170
|
parseFrontmatter,
|
|
169
171
|
qmdCollectionPathParts,
|
|
170
172
|
qmdResultPathCandidates,
|
|
171
173
|
selfDeps
|
|
172
|
-
} from "./chunk-
|
|
174
|
+
} from "./chunk-ZMKYCFJ7.js";
|
|
173
175
|
import {
|
|
174
176
|
namespaceCollectionName
|
|
175
|
-
} from "./chunk-
|
|
177
|
+
} from "./chunk-6YAIN5XJ.js";
|
|
176
178
|
import {
|
|
177
179
|
DEFAULT_RECALL_DISCLOSURE,
|
|
178
180
|
isRecallDisclosure
|
|
179
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-Q6LCCIZN.js";
|
|
180
182
|
import {
|
|
181
183
|
normalizeProjectionPreview,
|
|
182
184
|
normalizeProjectionTags
|
|
@@ -199,30 +201,11 @@ import {
|
|
|
199
201
|
supersessionKeysForFact
|
|
200
202
|
} from "./chunk-5WITETWU.js";
|
|
201
203
|
import {
|
|
202
|
-
ExtractionDeadlineError
|
|
203
|
-
|
|
204
|
-
isArtifactMemoryPath,
|
|
205
|
-
isLocationDayPath,
|
|
206
|
-
isMeetingRecordPath
|
|
207
|
-
} from "./chunk-XQ2Q43XD.js";
|
|
208
|
-
import {
|
|
209
|
-
STRUCTURED_ATTRIBUTE_LIMITS,
|
|
210
|
-
buildAccessWriteRequestFingerprint,
|
|
211
|
-
buildObserveRequestFingerprint,
|
|
212
|
-
composeMemoryEnvelope,
|
|
213
|
-
isMemoryCategory
|
|
214
|
-
} from "./chunk-3QQTXYZ6.js";
|
|
215
|
-
import {
|
|
216
|
-
applyTagFilter,
|
|
217
|
-
normalizeTags,
|
|
218
|
-
parseTagMatch
|
|
219
|
-
} from "./chunk-BT7NVCML.js";
|
|
204
|
+
ExtractionDeadlineError
|
|
205
|
+
} from "./chunk-326KUXIR.js";
|
|
220
206
|
import {
|
|
221
207
|
FallbackLlmClient
|
|
222
|
-
} from "./chunk-
|
|
223
|
-
import {
|
|
224
|
-
extractJsonCandidates
|
|
225
|
-
} from "./chunk-RGMVMVMF.js";
|
|
208
|
+
} from "./chunk-YEN4TREG.js";
|
|
226
209
|
import {
|
|
227
210
|
CORRECTION_TEXT_MAX,
|
|
228
211
|
CorrectionContractError,
|
|
@@ -235,13 +218,13 @@ import {
|
|
|
235
218
|
import {
|
|
236
219
|
isCodingKnowledgeFeatureEnabled
|
|
237
220
|
} from "./chunk-FEHIOYML.js";
|
|
221
|
+
import {
|
|
222
|
+
formatSupersededPrefix
|
|
223
|
+
} from "./chunk-255PC37A.js";
|
|
238
224
|
import {
|
|
239
225
|
ExtractionLivenessWarnThrottle,
|
|
240
226
|
computeExtractionLivenessStatus
|
|
241
227
|
} from "./chunk-3SG4FGDV.js";
|
|
242
|
-
import {
|
|
243
|
-
isExternalWikiCollectionName
|
|
244
|
-
} from "./chunk-JV3C2MNQ.js";
|
|
245
228
|
import {
|
|
246
229
|
buildProcedurePersistBody,
|
|
247
230
|
normalizeProcedureSteps,
|
|
@@ -252,11 +235,8 @@ import {
|
|
|
252
235
|
readCausalTrajectoryRecords
|
|
253
236
|
} from "./chunk-B3O3IRZN.js";
|
|
254
237
|
import {
|
|
255
|
-
|
|
256
|
-
} from "./chunk-
|
|
257
|
-
import {
|
|
258
|
-
computePromotionCandidates
|
|
259
|
-
} from "./chunk-VYCOJKSX.js";
|
|
238
|
+
extractJsonCandidates
|
|
239
|
+
} from "./chunk-RGMVMVMF.js";
|
|
260
240
|
import {
|
|
261
241
|
meetingsBuild,
|
|
262
242
|
meetingsGet,
|
|
@@ -269,15 +249,15 @@ import {
|
|
|
269
249
|
} from "./chunk-SYOIVK7K.js";
|
|
270
250
|
import {
|
|
271
251
|
createOfflineSyncManifestStream
|
|
272
|
-
} from "./chunk-
|
|
252
|
+
} from "./chunk-NPNSKE76.js";
|
|
273
253
|
import {
|
|
274
254
|
offlineSyncStorageForSnapshot
|
|
275
|
-
} from "./chunk-
|
|
255
|
+
} from "./chunk-C6KRO3SU.js";
|
|
276
256
|
import {
|
|
277
257
|
resolveScopePlan,
|
|
278
258
|
resolveScopedWritableNamespaceValue,
|
|
279
259
|
resolveWritableNamespaceValue
|
|
280
|
-
} from "./chunk-
|
|
260
|
+
} from "./chunk-OQQXGYMX.js";
|
|
281
261
|
import {
|
|
282
262
|
getMemoryProjectionPath
|
|
283
263
|
} from "./chunk-AL3UYZ5N.js";
|
|
@@ -287,7 +267,7 @@ import {
|
|
|
287
267
|
import {
|
|
288
268
|
expandScopeProfileReadNamespaces,
|
|
289
269
|
resolveScopeProfilePlan
|
|
290
|
-
} from "./chunk-
|
|
270
|
+
} from "./chunk-MNIPH6LD.js";
|
|
291
271
|
import {
|
|
292
272
|
writeFileAtomically
|
|
293
273
|
} from "./chunk-AW4QUFQF.js";
|
|
@@ -296,13 +276,6 @@ import {
|
|
|
296
276
|
isActiveMemoryStatus,
|
|
297
277
|
toMemoryPathRel
|
|
298
278
|
} from "./chunk-7RJUVTVF.js";
|
|
299
|
-
import {
|
|
300
|
-
computeContentHash
|
|
301
|
-
} from "./chunk-5FVVY2EB.js";
|
|
302
|
-
import {
|
|
303
|
-
serializeMutations,
|
|
304
|
-
withHeldFileLock
|
|
305
|
-
} from "./chunk-FFAZ2XFU.js";
|
|
306
279
|
import {
|
|
307
280
|
assertOperationAuthorizationAllowed,
|
|
308
281
|
capabilityAllowsOp,
|
|
@@ -332,20 +305,29 @@ import {
|
|
|
332
305
|
encodeSupportPassportNamespaceAttributes,
|
|
333
306
|
isSupportPassportPrivateMemory,
|
|
334
307
|
projectSupportPassportCard
|
|
335
|
-
} from "./chunk-
|
|
308
|
+
} from "./chunk-PWPIERBM.js";
|
|
336
309
|
import {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
sanitizeMemoryContent
|
|
341
|
-
} from "./chunk-5GKPFL3S.js";
|
|
342
|
-
import {
|
|
343
|
-
buildHandleIndexForResults,
|
|
344
|
-
isHandleToken
|
|
345
|
-
} from "./chunk-JAKIDQB2.js";
|
|
310
|
+
coerceProjectCategoryAlias,
|
|
311
|
+
reapplyCategoryCoercion
|
|
312
|
+
} from "./chunk-L2QLDZJC.js";
|
|
346
313
|
import {
|
|
347
314
|
exportCapsule
|
|
348
315
|
} from "./chunk-KQAFEZQX.js";
|
|
316
|
+
import {
|
|
317
|
+
STRUCTURED_ATTRIBUTE_LIMITS,
|
|
318
|
+
buildAccessWriteRequestFingerprint,
|
|
319
|
+
buildObserveRequestFingerprint,
|
|
320
|
+
composeMemoryEnvelope,
|
|
321
|
+
isMemoryCategory
|
|
322
|
+
} from "./chunk-LSLCFCCQ.js";
|
|
323
|
+
import {
|
|
324
|
+
applyTagFilter,
|
|
325
|
+
normalizeTags,
|
|
326
|
+
parseTagMatch
|
|
327
|
+
} from "./chunk-BT7NVCML.js";
|
|
328
|
+
import {
|
|
329
|
+
computePromotionCandidates
|
|
330
|
+
} from "./chunk-VYCOJKSX.js";
|
|
349
331
|
import {
|
|
350
332
|
evaluateActionConfidence
|
|
351
333
|
} from "./chunk-Z2YFLXHU.js";
|
|
@@ -365,6 +347,23 @@ import {
|
|
|
365
347
|
import {
|
|
366
348
|
validateArchiveRelativePath
|
|
367
349
|
} from "./chunk-GCGJW34D.js";
|
|
350
|
+
import {
|
|
351
|
+
computeContentHash
|
|
352
|
+
} from "./chunk-5FVVY2EB.js";
|
|
353
|
+
import {
|
|
354
|
+
serializeMutations,
|
|
355
|
+
withHeldFileLock
|
|
356
|
+
} from "./chunk-FFAZ2XFU.js";
|
|
357
|
+
import {
|
|
358
|
+
stripAttributesSuffix
|
|
359
|
+
} from "./chunk-JDSVLVCG.js";
|
|
360
|
+
import {
|
|
361
|
+
sanitizeMemoryContent
|
|
362
|
+
} from "./chunk-5GKPFL3S.js";
|
|
363
|
+
import {
|
|
364
|
+
buildHandleIndexForResults,
|
|
365
|
+
isHandleToken
|
|
366
|
+
} from "./chunk-JAKIDQB2.js";
|
|
368
367
|
import {
|
|
369
368
|
parseIsoOffsetTimestamp
|
|
370
369
|
} from "./chunk-P7FMDTKL.js";
|
|
@@ -412,14 +411,14 @@ import {
|
|
|
412
411
|
import {
|
|
413
412
|
ObserveTranscriptPersister,
|
|
414
413
|
observeTranscriptSessionKey
|
|
415
|
-
} from "./chunk-
|
|
414
|
+
} from "./chunk-T2JSUEH6.js";
|
|
416
415
|
import {
|
|
417
416
|
AccessIdempotencyStore,
|
|
418
417
|
hashAccessIdempotencyPayload
|
|
419
418
|
} from "./chunk-VFUEZZBS.js";
|
|
420
419
|
import {
|
|
421
420
|
resolveCodingContextFromOptions
|
|
422
|
-
} from "./chunk-
|
|
421
|
+
} from "./chunk-YVGXH72Y.js";
|
|
423
422
|
import {
|
|
424
423
|
combineNamespaces,
|
|
425
424
|
defaultGitInvokerSync,
|
|
@@ -428,7 +427,7 @@ import {
|
|
|
428
427
|
resolveCodingNamespaceOverlay,
|
|
429
428
|
resolveGitContext,
|
|
430
429
|
sanitizeFragment
|
|
431
|
-
} from "./chunk-
|
|
430
|
+
} from "./chunk-3Q3N35W7.js";
|
|
432
431
|
import {
|
|
433
432
|
expandTildePath
|
|
434
433
|
} from "./chunk-6KH5NLQS.js";
|
|
@@ -3263,191 +3262,10 @@ function buildNotificationSummary(plan) {
|
|
|
3263
3262
|
return `${plan.classification}: ${plan.request.text.slice(0, 60)}${plan.request.text.length > 60 ? "..." : ""} (${target})`;
|
|
3264
3263
|
}
|
|
3265
3264
|
|
|
3266
|
-
// src/orchestration/generic-recall-paths.ts
|
|
3267
|
-
import path5 from "path";
|
|
3268
|
-
|
|
3269
|
-
// src/activity/journal.ts
|
|
3270
|
-
import { mkdirSync, statSync, writeFileSync } from "fs";
|
|
3271
|
-
import path4 from "path";
|
|
3272
|
-
var JOURNAL_DIR_NAME = "journal";
|
|
3273
|
-
var JOURNAL_DAY_TOPLEVEL = /^journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
|
|
3274
|
-
var JOURNAL_DAY_ANYWHERE = /(?:^|[\\/])journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
|
|
3275
|
-
function journalPath(memoryDir, date) {
|
|
3276
|
-
if (!isValidActivityDate(date)) {
|
|
3277
|
-
throw new RangeError(`Invalid journal date "${date}"; expected YYYY-MM-DD.`);
|
|
3278
|
-
}
|
|
3279
|
-
return path4.join(memoryDir, JOURNAL_DIR_NAME, `${date}.md`);
|
|
3280
|
-
}
|
|
3281
|
-
function isJournalDayPath(filePath, memoryRoot) {
|
|
3282
|
-
if (memoryRoot !== void 0 && memoryRoot.length > 0) {
|
|
3283
|
-
const relative2 = path4.relative(memoryRoot, path4.resolve(memoryRoot, filePath));
|
|
3284
|
-
return JOURNAL_DAY_TOPLEVEL.test(relative2);
|
|
3285
|
-
}
|
|
3286
|
-
return JOURNAL_DAY_ANYWHERE.test(filePath);
|
|
3287
|
-
}
|
|
3288
|
-
function todayJournalDate(now = /* @__PURE__ */ new Date()) {
|
|
3289
|
-
const year = now.getFullYear();
|
|
3290
|
-
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
3291
|
-
const day = String(now.getDate()).padStart(2, "0");
|
|
3292
|
-
return `${year}-${month}-${day}`;
|
|
3293
|
-
}
|
|
3294
|
-
function formatCardDuration(card) {
|
|
3295
|
-
const start = Date.parse(card.startUtc);
|
|
3296
|
-
const end = Date.parse(card.endUtc);
|
|
3297
|
-
const minutes = Number.isFinite(start) && Number.isFinite(end) && end > start ? Math.round((end - start) / 6e4) : 0;
|
|
3298
|
-
return `${minutes}m`;
|
|
3299
|
-
}
|
|
3300
|
-
function renderJournalSeed(date, cards) {
|
|
3301
|
-
const ordered = [...cards].sort((left, right) => {
|
|
3302
|
-
const byStart = left.startUtc.localeCompare(right.startUtc);
|
|
3303
|
-
return byStart !== 0 ? byStart : left.title.localeCompare(right.title);
|
|
3304
|
-
});
|
|
3305
|
-
const glance = ordered.length === 0 ? ["_No cards._"] : ordered.map((card) => `- ${formatCardDuration(card)} ${card.title}`);
|
|
3306
|
-
return [`# Journal \u2014 ${date}`, "", "## Day at a glance", "", ...glance, "", "## Notes", "", ""].join(
|
|
3307
|
-
"\n"
|
|
3308
|
-
);
|
|
3309
|
-
}
|
|
3310
|
-
function writeJournalFile(filePath, content, force) {
|
|
3311
|
-
let exists = false;
|
|
3312
|
-
try {
|
|
3313
|
-
statSync(filePath);
|
|
3314
|
-
exists = true;
|
|
3315
|
-
} catch (err) {
|
|
3316
|
-
const code = err.code;
|
|
3317
|
-
if (code !== "ENOENT") throw err;
|
|
3318
|
-
}
|
|
3319
|
-
if (exists && !force) return false;
|
|
3320
|
-
mkdirSync(path4.dirname(filePath), { recursive: true });
|
|
3321
|
-
writeFileSync(filePath, content);
|
|
3322
|
-
return true;
|
|
3323
|
-
}
|
|
3324
|
-
function seedJournal(input) {
|
|
3325
|
-
const filePath = journalPath(input.memoryDir, input.date);
|
|
3326
|
-
const wrote = writeJournalFile(
|
|
3327
|
-
filePath,
|
|
3328
|
-
renderJournalSeed(input.date, input.cards ?? []),
|
|
3329
|
-
input.force === true
|
|
3330
|
-
);
|
|
3331
|
-
return { path: filePath, wrote };
|
|
3332
|
-
}
|
|
3333
|
-
|
|
3334
|
-
// src/orchestration/generic-recall-paths.ts
|
|
3335
|
-
var CATEGORY_MEMORY_ROOTS = Object.fromEntries(
|
|
3336
|
-
ALL_CATEGORY_DIRS.map((directory) => [directory, true])
|
|
3337
|
-
);
|
|
3338
|
-
var RESERVED_ARCHIVE_ROOTS = { archive: true, namespaces: true };
|
|
3339
|
-
function isQmdCollectionPrefix(prefix, collection, source) {
|
|
3340
|
-
if (typeof collection !== "string" || collection.length === 0) return false;
|
|
3341
|
-
if (prefix.startsWith(`${collection}--`)) return true;
|
|
3342
|
-
if (prefix !== collection) return false;
|
|
3343
|
-
if (source === "qmd") return true;
|
|
3344
|
-
return !Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) && !Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix);
|
|
3345
|
-
}
|
|
3346
|
-
function normalizeQmdUriPath(relativePath, source) {
|
|
3347
|
-
if (source !== "qmd" || !relativePath.startsWith("qmd://")) return relativePath;
|
|
3348
|
-
try {
|
|
3349
|
-
const parsed = new URL(relativePath);
|
|
3350
|
-
if (parsed.protocol !== "qmd:" || !parsed.hostname) return relativePath;
|
|
3351
|
-
const collection = decodeURIComponent(parsed.hostname);
|
|
3352
|
-
const pathname = decodeURIComponent(parsed.pathname.replace(/^\/+/, ""));
|
|
3353
|
-
return pathname ? `${collection}/${pathname}` : collection;
|
|
3354
|
-
} catch {
|
|
3355
|
-
return relativePath;
|
|
3356
|
-
}
|
|
3357
|
-
}
|
|
3358
|
-
function stripQmdCollectionPrefix(relativePath, policy, source) {
|
|
3359
|
-
const normalized = path5.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\/g, "/"));
|
|
3360
|
-
const slashIndex = normalized.indexOf("/");
|
|
3361
|
-
if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return normalized;
|
|
3362
|
-
const prefix = normalized.slice(0, slashIndex);
|
|
3363
|
-
const matchesHotCollection = isQmdCollectionPrefix(prefix, policy.qmdCollection, source);
|
|
3364
|
-
const matchesColdCollection = isQmdCollectionPrefix(prefix, policy.qmdColdCollection, source);
|
|
3365
|
-
return matchesHotCollection || matchesColdCollection ? normalized.slice(slashIndex + 1) : normalized;
|
|
3366
|
-
}
|
|
3367
|
-
function isTopLevelArchivePath(filePath, policy = {}, source = "filesystem") {
|
|
3368
|
-
const isAbsolutePath = path5.isAbsolute(filePath);
|
|
3369
|
-
const relative2 = policy.memoryDir && isAbsolutePath ? path5.relative(policy.memoryDir, path5.resolve(filePath)) : filePath;
|
|
3370
|
-
const normalized = !isAbsolutePath ? stripQmdCollectionPrefix(relative2, policy, source) : relative2;
|
|
3371
|
-
return /^(?:archive|namespaces[\\/][^\\/]+[\\/]archive)(?:[\\/]|$)/i.test(normalized);
|
|
3372
|
-
}
|
|
3373
|
-
function isExternalWikiQmdPath(filePath, source) {
|
|
3374
|
-
if (source !== "qmd") return false;
|
|
3375
|
-
const normalized = normalizeQmdUriPath(filePath, source).replace(/\\/g, "/");
|
|
3376
|
-
const slashIndex = normalized.indexOf("/");
|
|
3377
|
-
const collection = slashIndex === -1 ? normalized : normalized.slice(0, slashIndex);
|
|
3378
|
-
return isExternalWikiCollectionName(collection);
|
|
3379
|
-
}
|
|
3380
|
-
function isSearchExcludedPath(filePath, policy = {}, source = "filesystem") {
|
|
3381
|
-
if (isExternalWikiQmdPath(filePath, source)) return true;
|
|
3382
|
-
for (const candidate of collectionSpellings(filePath, policy, source)) {
|
|
3383
|
-
if (isArtifactMemoryPath(candidate) || isNamespacedActivityDigestPath(candidate, policy.memoryDir) || isNamespacedLocationDayPath(candidate, policy.memoryDir) || isNamespacedJournalDayPath(candidate, policy.memoryDir) || isMeetingRecordPath(candidate)) {
|
|
3384
|
-
return true;
|
|
3385
|
-
}
|
|
3386
|
-
}
|
|
3387
|
-
return false;
|
|
3388
|
-
}
|
|
3389
|
-
function isNamespacedActivityDigestPath(candidate, memoryDir) {
|
|
3390
|
-
if (isActivityDigestPath(candidate, memoryDir)) return true;
|
|
3391
|
-
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3392
|
-
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3393
|
-
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3394
|
-
if (namespaced === null) return false;
|
|
3395
|
-
return isActivityDigestPath(namespaced[2] ?? "", memoryDir);
|
|
3396
|
-
}
|
|
3397
|
-
function isNamespacedLocationDayPath(candidate, memoryDir) {
|
|
3398
|
-
if (isLocationDayPath(candidate, memoryDir)) return true;
|
|
3399
|
-
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3400
|
-
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3401
|
-
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3402
|
-
if (namespaced === null) return false;
|
|
3403
|
-
return isLocationDayPath(namespaced[2] ?? "", memoryDir);
|
|
3404
|
-
}
|
|
3405
|
-
function isNamespacedJournalDayPath(candidate, memoryDir) {
|
|
3406
|
-
if (isJournalDayPath(candidate, memoryDir)) return true;
|
|
3407
|
-
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3408
|
-
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3409
|
-
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3410
|
-
if (namespaced === null) return false;
|
|
3411
|
-
return isJournalDayPath(namespaced[2] ?? "", memoryDir);
|
|
3412
|
-
}
|
|
3413
|
-
function collectionSpellings(filePath, policy, source) {
|
|
3414
|
-
if (path5.isAbsolute(filePath)) return [filePath];
|
|
3415
|
-
if (source === "qmd" && filePath.startsWith("qmd://")) {
|
|
3416
|
-
const normalized2 = path5.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\/g, "/"));
|
|
3417
|
-
const slashIndex2 = normalized2.indexOf("/");
|
|
3418
|
-
return slashIndex2 <= 0 || slashIndex2 >= normalized2.length - 1 ? [normalized2] : [normalized2, normalized2.slice(slashIndex2 + 1)];
|
|
3419
|
-
}
|
|
3420
|
-
const normalized = path5.posix.normalize(
|
|
3421
|
-
normalizeQmdUriPath(filePath, source).replace(/\\/g, "/")
|
|
3422
|
-
);
|
|
3423
|
-
const stripped = stripQmdCollectionPrefix(filePath, policy, source);
|
|
3424
|
-
const spellings = [stripped];
|
|
3425
|
-
if (stripped !== normalized) return spellings;
|
|
3426
|
-
const slashIndex = stripped.indexOf("/");
|
|
3427
|
-
if (slashIndex <= 0 || slashIndex >= stripped.length - 1) return spellings;
|
|
3428
|
-
const prefix = stripped.slice(0, slashIndex);
|
|
3429
|
-
const requested = policy.requestedCollection;
|
|
3430
|
-
if (prefix !== requested && (Object.hasOwn(CATEGORY_MEMORY_ROOTS, prefix) || Object.hasOwn(RESERVED_ARCHIVE_ROOTS, prefix))) {
|
|
3431
|
-
return spellings;
|
|
3432
|
-
}
|
|
3433
|
-
spellings.push(stripped.slice(slashIndex + 1));
|
|
3434
|
-
return spellings;
|
|
3435
|
-
}
|
|
3436
|
-
function isGenericRecallExcludedPath(filePath, policy = {}, source = "filesystem") {
|
|
3437
|
-
return isSearchExcludedPath(filePath, policy, source) || isTopLevelArchivePath(filePath, policy, source) || OKF_RESERVED_BASENAMES[path5.basename(filePath)] === true;
|
|
3438
|
-
}
|
|
3439
|
-
function filterRecallCandidates(candidates, options) {
|
|
3440
|
-
const pathPolicy = options.pathPolicy ?? (options.memoryRoot === void 0 ? void 0 : { memoryDir: options.memoryRoot });
|
|
3441
|
-
const scopedByNamespace = options.namespacesEnabled ? candidates.filter(
|
|
3442
|
-
(r) => options.recallNamespaces.includes(r.namespace ?? options.resolveNamespace(r.path))
|
|
3443
|
-
) : candidates;
|
|
3444
|
-
return scopedByNamespace.filter((r) => !isGenericRecallExcludedPath(r.path, pathPolicy, "qmd")).slice(0, Math.max(0, options.limit));
|
|
3445
|
-
}
|
|
3446
|
-
|
|
3447
3265
|
// src/procedural/procedure-miner.ts
|
|
3448
3266
|
import { createHash as createHash2 } from "crypto";
|
|
3449
3267
|
import { mkdir as mkdir2, rm, stat } from "fs/promises";
|
|
3450
|
-
import
|
|
3268
|
+
import path4 from "path";
|
|
3451
3269
|
|
|
3452
3270
|
// src/procedural/reinforcement-core.ts
|
|
3453
3271
|
function clusterByKey(items, keyFn) {
|
|
@@ -3497,8 +3315,8 @@ function sleep(ms) {
|
|
|
3497
3315
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
3498
3316
|
}
|
|
3499
3317
|
async function acquireClusterWriteLock(memoryDir, clusterHash) {
|
|
3500
|
-
const lockRoot =
|
|
3501
|
-
const lockDir =
|
|
3318
|
+
const lockRoot = path4.join(path4.resolve(memoryDir), "state", "procedure-miner-locks");
|
|
3319
|
+
const lockDir = path4.join(lockRoot, `${clusterHash}.lock`);
|
|
3502
3320
|
await mkdir2(lockRoot, { recursive: true });
|
|
3503
3321
|
const startedAt = Date.now();
|
|
3504
3322
|
let attempts = 0;
|
|
@@ -3529,7 +3347,7 @@ async function acquireClusterWriteLock(memoryDir, clusterHash) {
|
|
|
3529
3347
|
}
|
|
3530
3348
|
}
|
|
3531
3349
|
async function withClusterWriteLock(memoryDir, clusterHash, fn) {
|
|
3532
|
-
const inProcessKey = `${
|
|
3350
|
+
const inProcessKey = `${path4.resolve(memoryDir)}:${clusterHash}`;
|
|
3533
3351
|
const previous = inProcessClusterWriteLocks.get(inProcessKey) ?? Promise.resolve();
|
|
3534
3352
|
let releaseInProcess;
|
|
3535
3353
|
const current = previous.catch(() => void 0).then(
|
|
@@ -3667,7 +3485,7 @@ async function runProcedureMining(options) {
|
|
|
3667
3485
|
}
|
|
3668
3486
|
|
|
3669
3487
|
// src/support-passport/offline-sync-guard.ts
|
|
3670
|
-
import
|
|
3488
|
+
import path5 from "path";
|
|
3671
3489
|
var MAX_SUPPORT_PASSPORT_FRONTMATTER_BYTES = 1048576;
|
|
3672
3490
|
var SUPPORT_PASSPORT_MARKER = "support-passport-";
|
|
3673
3491
|
var FRONTMATTER_PREFIXES = ["---\n", "---\r\n"];
|
|
@@ -3737,7 +3555,7 @@ function createSupportPassportOfflineSyncGuard(storage) {
|
|
|
3737
3555
|
return {
|
|
3738
3556
|
root: storage.dir,
|
|
3739
3557
|
path: normalizedPath,
|
|
3740
|
-
filePath:
|
|
3558
|
+
filePath: path5.resolve(storage.dir, ...normalizedPath.split("/"))
|
|
3741
3559
|
};
|
|
3742
3560
|
};
|
|
3743
3561
|
const assertTargetAllowed = async (target) => {
|
|
@@ -4070,10 +3888,10 @@ function formatZodIssues(error) {
|
|
|
4070
3888
|
const parts = [];
|
|
4071
3889
|
for (const issue of error.issues) {
|
|
4072
3890
|
const hasNumeric = issue.path.some((p) => typeof p === "number");
|
|
4073
|
-
const
|
|
3891
|
+
const path17 = hasNumeric ? issue.path.filter((p) => typeof p === "string").join(".") || "(root)" : issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
4074
3892
|
const options = enumOptionsFromIssue(issue);
|
|
4075
3893
|
const suffix = options ? `. Valid: ${options.join(", ")}` : "";
|
|
4076
|
-
parts.push(`${
|
|
3894
|
+
parts.push(`${path17}: ${issue.message}${suffix}`);
|
|
4077
3895
|
}
|
|
4078
3896
|
return parts.length > 0 ? `request validation failed: ${parts.join("; ")}` : "request validation failed";
|
|
4079
3897
|
}
|
|
@@ -4215,7 +4033,7 @@ function resolveQueryNamespaceWritablePreflight(caps, params, authenticatedPrinc
|
|
|
4215
4033
|
}
|
|
4216
4034
|
|
|
4217
4035
|
// src/admin/admin-surfaces.ts
|
|
4218
|
-
import
|
|
4036
|
+
import path6 from "path";
|
|
4219
4037
|
var REDACTED = "<redacted>";
|
|
4220
4038
|
var SENSITIVE_KEY_RE = /(token|secret|password|api[_-]?key|bearer|authorization|credential|private[_-]?key)/i;
|
|
4221
4039
|
var BEARER_VALUE_RE = /^(bearer|sk-|pk-|xox[bp]-|AKIA)/i;
|
|
@@ -4488,7 +4306,7 @@ async function auditTranscripts(memoryDir) {
|
|
|
4488
4306
|
movedEntries: file.groups.reduce((sum, group) => sum + group.entryCount, 0),
|
|
4489
4307
|
unmovableLines: file.unmovableLines
|
|
4490
4308
|
}));
|
|
4491
|
-
const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(
|
|
4309
|
+
const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path6.sep).includes("other"));
|
|
4492
4310
|
const summary = plan.movedEntries === 0 ? "No mixed-session transcript data detected; nothing to migrate." : `Found ${plan.movedEntries} entries across ${plan.distinctSessions} distinct sessions stranded in shared/legacy directories. Run the CLI migration command to re-home them.`;
|
|
4493
4311
|
return {
|
|
4494
4312
|
generatedAt: plan.generatedAt,
|
|
@@ -4627,11 +4445,11 @@ async function promoteMemory(options) {
|
|
|
4627
4445
|
}
|
|
4628
4446
|
|
|
4629
4447
|
// src/procedural/library-maintenance.ts
|
|
4630
|
-
import
|
|
4448
|
+
import path7 from "path";
|
|
4631
4449
|
var MAINTENANCE_ACTOR = "procedure-library-maintenance";
|
|
4632
4450
|
var MAINTENANCE_RULE_VERSION = "procedure-library-maintenance:1";
|
|
4633
4451
|
function maintenanceMarkerPath(memoryDir) {
|
|
4634
|
-
return
|
|
4452
|
+
return path7.join(memoryDir, "state", "procedure-maintenance.json");
|
|
4635
4453
|
}
|
|
4636
4454
|
async function readProcedureMaintenanceMarker(memoryDir) {
|
|
4637
4455
|
try {
|
|
@@ -7057,7 +6875,8 @@ var AccessObserveWriteSurface = class {
|
|
|
7057
6875
|
followupsUnavailableReason: result.followupsUnavailableReason
|
|
7058
6876
|
};
|
|
7059
6877
|
}
|
|
7060
|
-
async memoryStore(
|
|
6878
|
+
async memoryStore(rawRequest, hooks) {
|
|
6879
|
+
const { request, categoryCoercion } = coerceProjectCategoryAlias(rawRequest);
|
|
7061
6880
|
let namespace;
|
|
7062
6881
|
try {
|
|
7063
6882
|
namespace = await this.deps.resolveCodingScopedWriteNamespace(request);
|
|
@@ -7082,13 +6901,14 @@ var AccessObserveWriteSurface = class {
|
|
|
7082
6901
|
accepted: true,
|
|
7083
6902
|
queued: false,
|
|
7084
6903
|
status: "validated",
|
|
7085
|
-
idempotencyKey: request.idempotencyKey?.trim() || void 0
|
|
6904
|
+
idempotencyKey: request.idempotencyKey?.trim() || void 0,
|
|
6905
|
+
...categoryCoercion ? { categoryCoercion } : {}
|
|
7086
6906
|
};
|
|
7087
6907
|
}
|
|
7088
6908
|
const result = await persistExplicitCapture(this.deps.orchestrator, candidate, "memory_store");
|
|
7089
6909
|
await this.deps.attachCodingContextAfterScopedWrite(request);
|
|
7090
6910
|
const blocked = result.tombstoneBlocked === true && result.duplicateOf === void 0;
|
|
7091
|
-
const
|
|
6911
|
+
const response2 = {
|
|
7092
6912
|
schemaVersion: ENGRAM_ACCESS_WRITE_SCHEMA_VERSION,
|
|
7093
6913
|
operation: "memory_store",
|
|
7094
6914
|
namespace,
|
|
@@ -7098,14 +6918,15 @@ var AccessObserveWriteSurface = class {
|
|
|
7098
6918
|
status: blocked ? "queued_for_review" : result.duplicateOf ? "duplicate" : "stored",
|
|
7099
6919
|
memoryId: result.id,
|
|
7100
6920
|
duplicateOf: result.duplicateOf,
|
|
7101
|
-
idempotencyKey: request.idempotencyKey?.trim() || void 0
|
|
6921
|
+
idempotencyKey: request.idempotencyKey?.trim() || void 0,
|
|
6922
|
+
...categoryCoercion ? { categoryCoercion } : {}
|
|
7102
6923
|
};
|
|
7103
6924
|
log.info(
|
|
7104
|
-
`access-write op=memory_store namespace=${namespace} dryRun=false status=${
|
|
6925
|
+
`access-write op=memory_store namespace=${namespace} dryRun=false status=${response2.status} memoryId=${response2.memoryId ?? "-"} idempotency=${response2.idempotencyKey ? "yes" : "no"}`
|
|
7105
6926
|
);
|
|
7106
|
-
return
|
|
6927
|
+
return response2;
|
|
7107
6928
|
};
|
|
7108
|
-
|
|
6929
|
+
const response = await this.deps.handleIdempotentWrite({
|
|
7109
6930
|
operation: "memory_store",
|
|
7110
6931
|
idempotencyKey: request.idempotencyKey,
|
|
7111
6932
|
// Shared builder (issue #1989 PR3): byte-parity with the historical
|
|
@@ -7126,8 +6947,10 @@ var AccessObserveWriteSurface = class {
|
|
|
7126
6947
|
beforeExecute: hooks?.enforceWriteQuota,
|
|
7127
6948
|
execute
|
|
7128
6949
|
});
|
|
6950
|
+
return reapplyCategoryCoercion(response, categoryCoercion);
|
|
7129
6951
|
}
|
|
7130
|
-
async suggestionSubmit(
|
|
6952
|
+
async suggestionSubmit(rawRequest, hooks) {
|
|
6953
|
+
const { request, categoryCoercion } = coerceProjectCategoryAlias(rawRequest);
|
|
7131
6954
|
let namespace;
|
|
7132
6955
|
try {
|
|
7133
6956
|
namespace = await this.deps.resolveCodingScopedWriteNamespace(request);
|
|
@@ -7152,7 +6975,8 @@ var AccessObserveWriteSurface = class {
|
|
|
7152
6975
|
accepted: true,
|
|
7153
6976
|
queued: true,
|
|
7154
6977
|
status: "validated",
|
|
7155
|
-
idempotencyKey: request.idempotencyKey?.trim() || void 0
|
|
6978
|
+
idempotencyKey: request.idempotencyKey?.trim() || void 0,
|
|
6979
|
+
...categoryCoercion ? { categoryCoercion } : {}
|
|
7156
6980
|
};
|
|
7157
6981
|
}
|
|
7158
6982
|
const result = await queueExplicitCaptureForReview(
|
|
@@ -7172,14 +6996,15 @@ var AccessObserveWriteSurface = class {
|
|
|
7172
6996
|
status: "queued_for_review",
|
|
7173
6997
|
memoryId: result.id,
|
|
7174
6998
|
duplicateOf: result.duplicateOf,
|
|
7175
|
-
idempotencyKey: request.idempotencyKey?.trim() || void 0
|
|
6999
|
+
idempotencyKey: request.idempotencyKey?.trim() || void 0,
|
|
7000
|
+
...categoryCoercion ? { categoryCoercion } : {}
|
|
7176
7001
|
};
|
|
7177
7002
|
log.info(
|
|
7178
7003
|
`access-write op=suggestion_submit namespace=${namespace} dryRun=false status=${response.status} memoryId=${response.memoryId ?? "-"} idempotency=${response.idempotencyKey ? "yes" : "no"}`
|
|
7179
7004
|
);
|
|
7180
7005
|
return response;
|
|
7181
7006
|
};
|
|
7182
|
-
|
|
7007
|
+
const replayed = await this.deps.handleIdempotentWrite({
|
|
7183
7008
|
operation: "suggestion_submit",
|
|
7184
7009
|
idempotencyKey: request.idempotencyKey,
|
|
7185
7010
|
// Shared builder (issue #1989 PR3): byte-parity with the historical
|
|
@@ -7200,6 +7025,7 @@ var AccessObserveWriteSurface = class {
|
|
|
7200
7025
|
beforeExecute: hooks?.enforceWriteQuota,
|
|
7201
7026
|
execute
|
|
7202
7027
|
});
|
|
7028
|
+
return reapplyCategoryCoercion(replayed, categoryCoercion);
|
|
7203
7029
|
}
|
|
7204
7030
|
async runObserve(request) {
|
|
7205
7031
|
if (!request.sessionKey || typeof request.sessionKey !== "string" || request.sessionKey.trim().length === 0) {
|
|
@@ -7557,7 +7383,7 @@ import { createHash as createHash4 } from "crypto";
|
|
|
7557
7383
|
import * as nodePath2 from "path";
|
|
7558
7384
|
|
|
7559
7385
|
// src/orchestration/recall-result-formatter.ts
|
|
7560
|
-
import
|
|
7386
|
+
import path8 from "path";
|
|
7561
7387
|
function renderConnectorLabel(connector) {
|
|
7562
7388
|
if (!isValidConnectorId(connector)) return null;
|
|
7563
7389
|
return connector.length <= CONNECTOR_LABEL_MAX_LENGTH ? connector : `${connector.slice(0, CONNECTOR_LABEL_MAX_LENGTH - 1)}\u2026`;
|
|
@@ -7579,15 +7405,15 @@ function resolveEffectiveIdentityInjectionMode(options) {
|
|
|
7579
7405
|
return { mode: options.configuredMode, shouldInject: true };
|
|
7580
7406
|
}
|
|
7581
7407
|
function displayResultPath(resultPath, memoryDir, namespace) {
|
|
7582
|
-
if (!
|
|
7583
|
-
const root =
|
|
7584
|
-
const nsRoot =
|
|
7585
|
-
if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot +
|
|
7586
|
-
const afterNs =
|
|
7408
|
+
if (!path8.isAbsolute(resultPath)) return resultPath;
|
|
7409
|
+
const root = path8.resolve(memoryDir);
|
|
7410
|
+
const nsRoot = path8.join(root, "namespaces");
|
|
7411
|
+
if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot + path8.sep))) {
|
|
7412
|
+
const afterNs = path8.relative(nsRoot, resultPath).split(path8.sep).slice(1).join("/");
|
|
7587
7413
|
if (afterNs) return `${namespace}/${afterNs}`;
|
|
7588
7414
|
}
|
|
7589
|
-
const rel =
|
|
7590
|
-
return rel && !rel.startsWith("..") && !
|
|
7415
|
+
const rel = path8.relative(root, resultPath);
|
|
7416
|
+
return rel && !rel.startsWith("..") && !path8.isAbsolute(rel) ? rel.split(path8.sep).join("/") : resultPath;
|
|
7591
7417
|
}
|
|
7592
7418
|
function displaySafeRecallSnapshot(snapshot, memoryDir) {
|
|
7593
7419
|
const includedMemories = coerceIncludedMemories(snapshot).map((memory) => ({
|
|
@@ -7639,8 +7465,9 @@ var RecallResultFormatter = class {
|
|
|
7639
7465
|
const hedgeMap = renderHedge ? trustByPath : null;
|
|
7640
7466
|
const entries = results.map((r, i) => {
|
|
7641
7467
|
const snippetBody = r.snippet ? r.snippet.slice(0, 500).replace(/\n/g, " ") : "(no preview)";
|
|
7468
|
+
const statePrefix = (r.stateLabel === "historical" || r.stateLabel === "transition") && r.supersededAt && r.supersededBy ? `${formatSupersededPrefix(r.supersededAt, r.supersededBy)} ` : "";
|
|
7642
7469
|
const snippet = renderAuthorityBoundContent(
|
|
7643
|
-
snippetBody
|
|
7470
|
+
`${statePrefix}${snippetBody}`,
|
|
7644
7471
|
r.origin,
|
|
7645
7472
|
{
|
|
7646
7473
|
enabled: this.originAuthorityEnabled,
|
|
@@ -8579,6 +8406,7 @@ var AccessRecallSurface = class {
|
|
|
8579
8406
|
},
|
|
8580
8407
|
...authenticatedPrincipal ? { principalOverride: authenticatedPrincipal } : {},
|
|
8581
8408
|
...request.sourceConnector ? { sourceConnector: request.sourceConnector } : {},
|
|
8409
|
+
...request.stateView !== void 0 ? { stateView: request.stateView } : {},
|
|
8582
8410
|
...asOf !== void 0 ? { asOf } : {},
|
|
8583
8411
|
...request.includeLowConfidence === true ? { includeLowConfidence: true } : {},
|
|
8584
8412
|
...request.abortSignal ? { abortSignal: request.abortSignal } : {},
|
|
@@ -9052,14 +8880,14 @@ function parseCursorPayload(cursor) {
|
|
|
9052
8880
|
// src/review/review-deck-mutation.ts
|
|
9053
8881
|
import { createHash as createHash6, randomUUID } from "crypto";
|
|
9054
8882
|
import fs3 from "fs";
|
|
9055
|
-
import
|
|
8883
|
+
import path11 from "path";
|
|
9056
8884
|
|
|
9057
8885
|
// src/review/index.ts
|
|
9058
8886
|
import fs from "fs";
|
|
9059
|
-
import
|
|
8887
|
+
import path9 from "path";
|
|
9060
8888
|
var historicalIdCache = new HistoricalEntityCanonicalIdCache();
|
|
9061
8889
|
function writeReviewFileCanonicalized(memoryDir, filePath, content) {
|
|
9062
|
-
const stateDir =
|
|
8890
|
+
const stateDir = path9.join(memoryDir, "state");
|
|
9063
8891
|
const idsAtWrite = historicalIdCache.get(stateDir);
|
|
9064
8892
|
let originalBytes = null;
|
|
9065
8893
|
try {
|
|
@@ -9101,8 +8929,8 @@ function realMemoryRoot(memoryDir) {
|
|
|
9101
8929
|
}
|
|
9102
8930
|
}
|
|
9103
8931
|
function isPathInside(rootReal, candidateReal) {
|
|
9104
|
-
const relative2 =
|
|
9105
|
-
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !
|
|
8932
|
+
const relative2 = path9.relative(rootReal, candidateReal);
|
|
8933
|
+
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path9.isAbsolute(relative2);
|
|
9106
8934
|
}
|
|
9107
8935
|
function isSafeDirectory(rootReal, dir) {
|
|
9108
8936
|
try {
|
|
@@ -9145,7 +8973,7 @@ function listReviewItems(options) {
|
|
|
9145
8973
|
if (filterReason && item.reviewReason !== filterReason) return;
|
|
9146
8974
|
items.push(item);
|
|
9147
8975
|
};
|
|
9148
|
-
const suggestionsDir =
|
|
8976
|
+
const suggestionsDir = path9.join(memoryDir, "suggestions");
|
|
9149
8977
|
if (!isLimitReached() && fs.existsSync(suggestionsDir) && isSafeDirectory(rootReal, suggestionsDir)) {
|
|
9150
8978
|
walkMd(rootReal, suggestionsDir, (filePath, content) => {
|
|
9151
8979
|
if (isLimitReached()) return true;
|
|
@@ -9166,7 +8994,7 @@ function listReviewItems(options) {
|
|
|
9166
8994
|
return isLimitReached();
|
|
9167
8995
|
});
|
|
9168
8996
|
}
|
|
9169
|
-
const reviewDir =
|
|
8997
|
+
const reviewDir = path9.join(memoryDir, "review");
|
|
9170
8998
|
if (!isLimitReached() && fs.existsSync(reviewDir) && isSafeDirectory(rootReal, reviewDir)) {
|
|
9171
8999
|
walkMd(rootReal, reviewDir, (filePath, content) => {
|
|
9172
9000
|
if (isLimitReached()) return true;
|
|
@@ -9191,7 +9019,7 @@ function listReviewItems(options) {
|
|
|
9191
9019
|
const categories = ALL_CATEGORY_DIRS;
|
|
9192
9020
|
for (const category of categories) {
|
|
9193
9021
|
if (isLimitReached()) break;
|
|
9194
|
-
const dir =
|
|
9022
|
+
const dir = path9.join(memoryDir, category);
|
|
9195
9023
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9196
9024
|
walkMd(rootReal, dir, (filePath, content) => {
|
|
9197
9025
|
if (isLimitReached()) return true;
|
|
@@ -9273,9 +9101,9 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
9273
9101
|
const targetDir = getCategoryDir(memoryDir, category);
|
|
9274
9102
|
const dateDir = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
9275
9103
|
ensureSafeDirectory(rootReal, targetDir);
|
|
9276
|
-
const outputPath =
|
|
9277
|
-
ensureSafeDirectory(rootReal,
|
|
9278
|
-
const reviewStateDir =
|
|
9104
|
+
const outputPath = path9.join(targetDir, dateDir, path9.basename(found.filePath));
|
|
9105
|
+
ensureSafeDirectory(rootReal, path9.dirname(outputPath));
|
|
9106
|
+
const reviewStateDir = path9.join(memoryDir, "state");
|
|
9279
9107
|
const idsAtWrite = historicalIdCache.get(reviewStateDir);
|
|
9280
9108
|
const promotedWritten = canonicalizeEntityRefFrontmatter(updatedContent, idsAtWrite);
|
|
9281
9109
|
const promotedPath = writeFileWithoutClobber(outputPath, promotedWritten, itemId);
|
|
@@ -9352,13 +9180,13 @@ function findReviewFileById(memoryDir, id, options = {}) {
|
|
|
9352
9180
|
const rootReal = realMemoryRoot(memoryDir);
|
|
9353
9181
|
if (!rootReal) return null;
|
|
9354
9182
|
for (const loc of ["suggestions", "review"]) {
|
|
9355
|
-
const dir =
|
|
9183
|
+
const dir = path9.join(memoryDir, loc);
|
|
9356
9184
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9357
9185
|
const found = findFileById(rootReal, dir, id);
|
|
9358
9186
|
if (found) return { filePath: found, location: "queue" };
|
|
9359
9187
|
}
|
|
9360
9188
|
for (const category of ALL_CATEGORY_DIRS) {
|
|
9361
|
-
const dir =
|
|
9189
|
+
const dir = path9.join(memoryDir, category);
|
|
9362
9190
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9363
9191
|
const found = findFileById(rootReal, dir, id, (fm) => isLowConfidenceReviewCandidate(fm, options));
|
|
9364
9192
|
if (found) return { filePath: found, location: "category" };
|
|
@@ -9434,10 +9262,10 @@ function readFileSafe(filePath) {
|
|
|
9434
9262
|
}
|
|
9435
9263
|
}
|
|
9436
9264
|
function writeFileWithoutClobber(basePath, content, discriminator) {
|
|
9437
|
-
const parsed =
|
|
9265
|
+
const parsed = path9.parse(basePath);
|
|
9438
9266
|
const safeDiscriminator = sanitizeFilePart(discriminator);
|
|
9439
9267
|
for (let attempt = 0; attempt < 1e3; attempt++) {
|
|
9440
|
-
const candidate = attempt === 0 ? basePath :
|
|
9268
|
+
const candidate = attempt === 0 ? basePath : path9.join(
|
|
9441
9269
|
parsed.dir,
|
|
9442
9270
|
`${parsed.name}-${safeDiscriminator}${attempt === 1 ? "" : `-${attempt}`}${parsed.ext || ".md"}`
|
|
9443
9271
|
);
|
|
@@ -9493,7 +9321,7 @@ function extractBody(content) {
|
|
|
9493
9321
|
function walkMd(rootReal, dir, callback) {
|
|
9494
9322
|
if (!isSafeDirectory(rootReal, dir)) return false;
|
|
9495
9323
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
9496
|
-
const fullPath =
|
|
9324
|
+
const fullPath = path9.join(dir, entry.name);
|
|
9497
9325
|
if (entry.isSymbolicLink()) continue;
|
|
9498
9326
|
if (entry.isDirectory()) {
|
|
9499
9327
|
if (walkMd(rootReal, fullPath, callback)) return true;
|
|
@@ -9508,7 +9336,7 @@ function walkMdPaths(rootReal, dir) {
|
|
|
9508
9336
|
const results = [];
|
|
9509
9337
|
if (!isSafeDirectory(rootReal, dir)) return results;
|
|
9510
9338
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
9511
|
-
const fullPath =
|
|
9339
|
+
const fullPath = path9.join(dir, entry.name);
|
|
9512
9340
|
if (entry.isSymbolicLink()) continue;
|
|
9513
9341
|
if (entry.isDirectory()) {
|
|
9514
9342
|
results.push(...walkMdPaths(rootReal, fullPath));
|
|
@@ -9521,7 +9349,7 @@ function walkMdPaths(rootReal, dir) {
|
|
|
9521
9349
|
|
|
9522
9350
|
// src/review/review-deck-snapshot.ts
|
|
9523
9351
|
import fs2 from "fs";
|
|
9524
|
-
import
|
|
9352
|
+
import path10 from "path";
|
|
9525
9353
|
var QUEUE_DIRS = ["suggestions", "review"];
|
|
9526
9354
|
function readReviewDeckSnapshot(opts) {
|
|
9527
9355
|
const corpusVersion = readCorpusVersion(opts.memoryDir);
|
|
@@ -9529,7 +9357,7 @@ function readReviewDeckSnapshot(opts) {
|
|
|
9529
9357
|
if (!rootReal) return { corpusVersion, total: 0, rows: [] };
|
|
9530
9358
|
const rows = [];
|
|
9531
9359
|
for (const location of QUEUE_DIRS) {
|
|
9532
|
-
const dir =
|
|
9360
|
+
const dir = path10.join(opts.memoryDir, location);
|
|
9533
9361
|
if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
|
|
9534
9362
|
walkMd2(rootReal, dir, (filePath, content) => {
|
|
9535
9363
|
const row = rowFromQueueFile(filePath, content, location);
|
|
@@ -9542,7 +9370,7 @@ function readReviewDeckRow(opts) {
|
|
|
9542
9370
|
const rootReal = realMemoryRoot2(opts.memoryDir);
|
|
9543
9371
|
if (!rootReal) return null;
|
|
9544
9372
|
for (const location of QUEUE_DIRS) {
|
|
9545
|
-
const dir =
|
|
9373
|
+
const dir = path10.join(opts.memoryDir, location);
|
|
9546
9374
|
if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
|
|
9547
9375
|
let found = null;
|
|
9548
9376
|
walkMd2(rootReal, dir, (filePath, content) => {
|
|
@@ -9558,7 +9386,7 @@ function readReviewDeckRow(opts) {
|
|
|
9558
9386
|
}
|
|
9559
9387
|
function readCorpusVersion(memoryDir) {
|
|
9560
9388
|
try {
|
|
9561
|
-
return String(fs2.statSync(
|
|
9389
|
+
return String(fs2.statSync(path10.join(memoryDir, "state", MEMORY_CORPUS_VERSION_SENTINEL)).size);
|
|
9562
9390
|
} catch {
|
|
9563
9391
|
return "0";
|
|
9564
9392
|
}
|
|
@@ -9608,8 +9436,8 @@ function realMemoryRoot2(memoryDir) {
|
|
|
9608
9436
|
}
|
|
9609
9437
|
}
|
|
9610
9438
|
function isPathInside2(rootReal, candidateReal) {
|
|
9611
|
-
const relative2 =
|
|
9612
|
-
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !
|
|
9439
|
+
const relative2 = path10.relative(rootReal, candidateReal);
|
|
9440
|
+
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path10.isAbsolute(relative2);
|
|
9613
9441
|
}
|
|
9614
9442
|
function isSafeDirectory2(rootReal, dir) {
|
|
9615
9443
|
try {
|
|
@@ -9623,7 +9451,7 @@ function isSafeDirectory2(rootReal, dir) {
|
|
|
9623
9451
|
function walkMd2(rootReal, dir, callback) {
|
|
9624
9452
|
if (!isSafeDirectory2(rootReal, dir)) return false;
|
|
9625
9453
|
for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
|
|
9626
|
-
const fullPath =
|
|
9454
|
+
const fullPath = path10.join(dir, entry.name);
|
|
9627
9455
|
if (entry.isSymbolicLink()) continue;
|
|
9628
9456
|
if (entry.isDirectory()) {
|
|
9629
9457
|
if (walkMd2(rootReal, fullPath, callback)) return true;
|
|
@@ -9738,7 +9566,7 @@ function parseReviewLifecycleReceipt(value) {
|
|
|
9738
9566
|
if (!isReceiptAction(rec.action)) return null;
|
|
9739
9567
|
if (typeof rec.beforeRevision !== "string") return null;
|
|
9740
9568
|
if (typeof rec.afterRevision !== "string") return null;
|
|
9741
|
-
if (!isNonEmptyString(rec.sourcePath) ||
|
|
9569
|
+
if (!isNonEmptyString(rec.sourcePath) || path11.isAbsolute(rec.sourcePath)) return null;
|
|
9742
9570
|
if (rec.revisionArtifact !== void 0 && typeof rec.revisionArtifact !== "string") return null;
|
|
9743
9571
|
if (rec.undoOfReceiptId !== void 0 && typeof rec.undoOfReceiptId !== "string") return null;
|
|
9744
9572
|
const parsed = {
|
|
@@ -9770,11 +9598,11 @@ function findStoredReceipt(events, receiptId) {
|
|
|
9770
9598
|
return null;
|
|
9771
9599
|
}
|
|
9772
9600
|
function resolveInside(memoryDir, rel) {
|
|
9773
|
-
if (!rel ||
|
|
9774
|
-
const root =
|
|
9775
|
-
const abs =
|
|
9776
|
-
const next =
|
|
9777
|
-
if (next.startsWith("..") ||
|
|
9601
|
+
if (!rel || path11.isAbsolute(rel)) return null;
|
|
9602
|
+
const root = path11.resolve(memoryDir);
|
|
9603
|
+
const abs = path11.resolve(root, rel.split("/").join(path11.sep));
|
|
9604
|
+
const next = path11.relative(root, abs);
|
|
9605
|
+
if (next.startsWith("..") || path11.isAbsolute(next)) return null;
|
|
9778
9606
|
return abs;
|
|
9779
9607
|
}
|
|
9780
9608
|
function currentRevision(absPath) {
|
|
@@ -10437,14 +10265,14 @@ async function completeSupportPassportReplacementPrior(input) {
|
|
|
10437
10265
|
}
|
|
10438
10266
|
|
|
10439
10267
|
// src/support-passport/generated-batch.ts
|
|
10440
|
-
import
|
|
10268
|
+
import path13 from "path";
|
|
10441
10269
|
import { z as z2 } from "zod";
|
|
10442
10270
|
|
|
10443
10271
|
// src/support-passport/private-file.ts
|
|
10444
10272
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
10445
10273
|
import { constants as fsConstants } from "fs";
|
|
10446
10274
|
import { lstat as lstat2, mkdir as mkdir3, open, rename as rename2, rm as rm2, stat as stat2 } from "fs/promises";
|
|
10447
|
-
import
|
|
10275
|
+
import path12 from "path";
|
|
10448
10276
|
var UNSUPPORTED_DIRECTORY_SYNC_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOSYS", "ENOTSUP", "EOPNOTSUPP"]);
|
|
10449
10277
|
var NON_WRITABLE_ANCESTOR_SYNC_ERRORS = /* @__PURE__ */ new Set(["EROFS", "EPERM", "EACCES"]);
|
|
10450
10278
|
function assertStableDirectory(before, opened, after, errorMessage) {
|
|
@@ -10470,8 +10298,8 @@ function openFlags(...flags) {
|
|
|
10470
10298
|
return combined;
|
|
10471
10299
|
}
|
|
10472
10300
|
function assertContainedPath(trustedRoot, directory, errorMessage) {
|
|
10473
|
-
const relative2 =
|
|
10474
|
-
if (relative2 === ".." || relative2.startsWith(`..${
|
|
10301
|
+
const relative2 = path12.relative(path12.resolve(trustedRoot), path12.resolve(directory));
|
|
10302
|
+
if (relative2 === ".." || relative2.startsWith(`..${path12.sep}`) || path12.isAbsolute(relative2)) {
|
|
10475
10303
|
throw new Error(errorMessage);
|
|
10476
10304
|
}
|
|
10477
10305
|
}
|
|
@@ -10504,7 +10332,7 @@ async function syncDirectoryHandle(handle) {
|
|
|
10504
10332
|
}
|
|
10505
10333
|
async function resolvePrivateDirectoryPath(directory, handle, opened, errorMessage, platform = process.platform) {
|
|
10506
10334
|
const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10507
|
-
const pinnedPath =
|
|
10335
|
+
const pinnedPath = path12.join(descriptorRoot, String(handle.fd));
|
|
10508
10336
|
const metadata = await stat2(pinnedPath);
|
|
10509
10337
|
if (!metadata.isDirectory() || metadata.dev !== opened.dev || metadata.ino !== opened.ino) {
|
|
10510
10338
|
throw new Error(errorMessage);
|
|
@@ -10520,12 +10348,12 @@ function requirePrivateFileDescriptorRoot(platform, errorMessage) {
|
|
|
10520
10348
|
throw new Error(errorMessage);
|
|
10521
10349
|
}
|
|
10522
10350
|
async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform = process.platform) {
|
|
10523
|
-
const root =
|
|
10524
|
-
const target =
|
|
10351
|
+
const root = path12.resolve(trustedRoot);
|
|
10352
|
+
const target = path12.resolve(directory);
|
|
10525
10353
|
assertContainedPath(root, target, errorMessage);
|
|
10526
10354
|
requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10527
|
-
const relative2 =
|
|
10528
|
-
const components = relative2 === "" ? [] : relative2.split(
|
|
10355
|
+
const relative2 = path12.relative(root, target);
|
|
10356
|
+
const components = relative2 === "" ? [] : relative2.split(path12.sep);
|
|
10529
10357
|
const handles = [];
|
|
10530
10358
|
let currentPath = root;
|
|
10531
10359
|
try {
|
|
@@ -10533,10 +10361,10 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
|
|
|
10533
10361
|
handles.push(current.handle);
|
|
10534
10362
|
for (const component of components) {
|
|
10535
10363
|
const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
|
|
10536
|
-
const child = await openDirectoryNoFollow(
|
|
10364
|
+
const child = await openDirectoryNoFollow(path12.join(pinnedParent, component), errorMessage);
|
|
10537
10365
|
handles.push(child.handle);
|
|
10538
10366
|
assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
|
|
10539
|
-
currentPath =
|
|
10367
|
+
currentPath = path12.join(currentPath, component);
|
|
10540
10368
|
current = child;
|
|
10541
10369
|
}
|
|
10542
10370
|
assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
|
|
@@ -10557,12 +10385,12 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
|
|
|
10557
10385
|
}
|
|
10558
10386
|
}
|
|
10559
10387
|
async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, hardenExistingChildren = true, platform = process.platform) {
|
|
10560
|
-
const root =
|
|
10561
|
-
const target =
|
|
10388
|
+
const root = path12.resolve(trustedRoot);
|
|
10389
|
+
const target = path12.resolve(directory);
|
|
10562
10390
|
assertContainedPath(root, target, errorMessage);
|
|
10563
|
-
const relative2 =
|
|
10391
|
+
const relative2 = path12.relative(root, target);
|
|
10564
10392
|
requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10565
|
-
const components = relative2 === "" ? [] : relative2.split(
|
|
10393
|
+
const components = relative2 === "" ? [] : relative2.split(path12.sep);
|
|
10566
10394
|
const handles = [];
|
|
10567
10395
|
let currentPath = root;
|
|
10568
10396
|
try {
|
|
@@ -10570,7 +10398,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10570
10398
|
handles.push(current.handle);
|
|
10571
10399
|
for (const component of components) {
|
|
10572
10400
|
const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
|
|
10573
|
-
const childPath =
|
|
10401
|
+
const childPath = path12.join(pinnedParent, component);
|
|
10574
10402
|
let created = false;
|
|
10575
10403
|
try {
|
|
10576
10404
|
await mkdir3(childPath, { mode: 448 });
|
|
@@ -10585,7 +10413,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10585
10413
|
await child.handle.chmod(448);
|
|
10586
10414
|
}
|
|
10587
10415
|
assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
|
|
10588
|
-
currentPath =
|
|
10416
|
+
currentPath = path12.join(currentPath, component);
|
|
10589
10417
|
current = child;
|
|
10590
10418
|
}
|
|
10591
10419
|
assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
|
|
@@ -10594,8 +10422,8 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10594
10422
|
}
|
|
10595
10423
|
}
|
|
10596
10424
|
async function ensurePrivateDirectoryTreeNoFollow(directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, platform = process.platform) {
|
|
10597
|
-
const target =
|
|
10598
|
-
const filesystemRoot =
|
|
10425
|
+
const target = path12.resolve(directory);
|
|
10426
|
+
const filesystemRoot = path12.parse(target).root;
|
|
10599
10427
|
const rootMetadata = await stat2(filesystemRoot);
|
|
10600
10428
|
await ensurePrivateDirectoryNoFollow(
|
|
10601
10429
|
filesystemRoot,
|
|
@@ -10630,15 +10458,15 @@ async function withPrivateDirectoryNoFollow(trustedRoot, directory, errorMessage
|
|
|
10630
10458
|
}
|
|
10631
10459
|
}
|
|
10632
10460
|
async function readPrivateFileNoFollow(directory, filePath, errorMessage, trustedRoot = directory, platform = process.platform) {
|
|
10633
|
-
if (
|
|
10634
|
-
const targetName =
|
|
10461
|
+
if (path12.dirname(filePath) !== path12.resolve(directory)) throw new Error(errorMessage);
|
|
10462
|
+
const targetName = path12.basename(filePath);
|
|
10635
10463
|
let directoryHandles = [];
|
|
10636
10464
|
let fileHandle;
|
|
10637
10465
|
try {
|
|
10638
10466
|
const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
|
|
10639
10467
|
directoryHandles = stableDirectory.handles;
|
|
10640
10468
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10641
|
-
const targetPath =
|
|
10469
|
+
const targetPath = path12.join(pinnedDirectory, targetName);
|
|
10642
10470
|
const before = await lstat2(targetPath);
|
|
10643
10471
|
if (before.isSymbolicLink() || !before.isFile()) throw new Error(errorMessage);
|
|
10644
10472
|
try {
|
|
@@ -10657,10 +10485,10 @@ async function readPrivateFileNoFollow(directory, filePath, errorMessage, truste
|
|
|
10657
10485
|
}
|
|
10658
10486
|
}
|
|
10659
10487
|
async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, content, errorMessage, directoryHandle, openFile) {
|
|
10660
|
-
if (targetName.length === 0 || targetName === "." || targetName === ".." ||
|
|
10488
|
+
if (targetName.length === 0 || targetName === "." || targetName === ".." || path12.basename(targetName) !== targetName) {
|
|
10661
10489
|
throw new Error(errorMessage);
|
|
10662
10490
|
}
|
|
10663
|
-
const targetPath =
|
|
10491
|
+
const targetPath = path12.join(pinnedDirectory, targetName);
|
|
10664
10492
|
let fileHandle;
|
|
10665
10493
|
try {
|
|
10666
10494
|
try {
|
|
@@ -10696,8 +10524,8 @@ async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, c
|
|
|
10696
10524
|
}
|
|
10697
10525
|
async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, content, errorMessage, platform = process.platform) {
|
|
10698
10526
|
const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10699
|
-
const resolvedDirectory =
|
|
10700
|
-
const descriptor =
|
|
10527
|
+
const resolvedDirectory = path12.resolve(pinnedDirectory);
|
|
10528
|
+
const descriptor = path12.relative(descriptorRoot, resolvedDirectory);
|
|
10701
10529
|
if (!/^\d+$/.test(descriptor)) throw new Error(errorMessage);
|
|
10702
10530
|
const before = await stat2(resolvedDirectory);
|
|
10703
10531
|
if (!before.isDirectory()) throw new Error(errorMessage);
|
|
@@ -10713,8 +10541,8 @@ async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, con
|
|
|
10713
10541
|
}
|
|
10714
10542
|
}
|
|
10715
10543
|
async function writePrivateFileAtomicallyNoFollow(directory, filePath, content, errorMessage, trustedRoot = directory, platform = process.platform, syncVerifiedDirectory = syncDirectoryHandle) {
|
|
10716
|
-
if (
|
|
10717
|
-
const targetName =
|
|
10544
|
+
if (path12.dirname(filePath) !== path12.resolve(directory)) throw new Error(errorMessage);
|
|
10545
|
+
const targetName = path12.basename(filePath);
|
|
10718
10546
|
const tempName = `.${targetName}.${randomUUID2()}.tmp`;
|
|
10719
10547
|
let tempPath;
|
|
10720
10548
|
let directoryHandles = [];
|
|
@@ -10723,8 +10551,8 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
|
|
|
10723
10551
|
const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
|
|
10724
10552
|
directoryHandles = stableDirectory.handles;
|
|
10725
10553
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10726
|
-
tempPath =
|
|
10727
|
-
const targetPath =
|
|
10554
|
+
tempPath = path12.join(pinnedDirectory, tempName);
|
|
10555
|
+
const targetPath = path12.join(pinnedDirectory, targetName);
|
|
10728
10556
|
try {
|
|
10729
10557
|
fileHandle = await open(
|
|
10730
10558
|
tempPath,
|
|
@@ -10761,7 +10589,7 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
|
|
|
10761
10589
|
}
|
|
10762
10590
|
async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, trustedRoot = directory, platform = process.platform) {
|
|
10763
10591
|
if (fileNames.some(
|
|
10764
|
-
(fileName) => fileName.length === 0 || fileName === "." || fileName === ".." ||
|
|
10592
|
+
(fileName) => fileName.length === 0 || fileName === "." || fileName === ".." || path12.basename(fileName) !== fileName
|
|
10765
10593
|
)) {
|
|
10766
10594
|
throw new Error(errorMessage);
|
|
10767
10595
|
}
|
|
@@ -10771,7 +10599,7 @@ async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, tr
|
|
|
10771
10599
|
directoryHandles = stableDirectory.handles;
|
|
10772
10600
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10773
10601
|
for (const fileName of fileNames) {
|
|
10774
|
-
await rm2(
|
|
10602
|
+
await rm2(path12.join(pinnedDirectory, fileName), { force: true });
|
|
10775
10603
|
}
|
|
10776
10604
|
assertStableDirectory(stableDirectory.before, stableDirectory.opened, await lstat2(directory), errorMessage);
|
|
10777
10605
|
if (stableDirectory.handle) await syncDirectoryHandle(stableDirectory.handle);
|
|
@@ -10792,13 +10620,13 @@ var GeneratedBatchMarkerSchema = z2.object({
|
|
|
10792
10620
|
}).strict();
|
|
10793
10621
|
var BATCH_ERROR = "The generated draft batch state is not safe.";
|
|
10794
10622
|
function batchDirectory(storage) {
|
|
10795
|
-
return
|
|
10623
|
+
return path13.join(storage.dir, "state", "support-passport", "generated-batches");
|
|
10796
10624
|
}
|
|
10797
10625
|
function batchFileName(batchId) {
|
|
10798
10626
|
return `${BatchIdSchema.parse(batchId)}.json`;
|
|
10799
10627
|
}
|
|
10800
10628
|
function batchPath(storage, batchId) {
|
|
10801
|
-
return
|
|
10629
|
+
return path13.join(batchDirectory(storage), batchFileName(batchId));
|
|
10802
10630
|
}
|
|
10803
10631
|
function markerFor(context, batchId, size, complete) {
|
|
10804
10632
|
return GeneratedBatchMarkerSchema.parse({
|
|
@@ -11223,7 +11051,7 @@ var SupportPassportAnswerModelInputSchema = z4.object({
|
|
|
11223
11051
|
|
|
11224
11052
|
// src/support-passport/owner-lock.ts
|
|
11225
11053
|
import { createHash as createHash8 } from "crypto";
|
|
11226
|
-
import
|
|
11054
|
+
import path14 from "path";
|
|
11227
11055
|
var CARD_MUTATION_LOCK_STALE_MS = 6e4;
|
|
11228
11056
|
var CARD_MUTATION_LOCK_MAX_WAIT_MS = 3e4;
|
|
11229
11057
|
function computeSupportPassportOwnerLockKey(namespace, principal) {
|
|
@@ -11234,7 +11062,7 @@ function supportPassportOwnerLockPath(storage, scope) {
|
|
|
11234
11062
|
if (!/^[a-f0-9]{64}$/.test(ownerLockKey)) {
|
|
11235
11063
|
throw new SupportPassportError("card_data_invalid", "The support passport owner scope is invalid.", 500);
|
|
11236
11064
|
}
|
|
11237
|
-
return
|
|
11065
|
+
return path14.join(storage.dir, "state", `support-passport-cards-${ownerLockKey}.lock`);
|
|
11238
11066
|
}
|
|
11239
11067
|
async function withSupportPassportOwnerLock(storage, scope, task) {
|
|
11240
11068
|
const lockPath = supportPassportOwnerLockPath(storage, scope);
|
|
@@ -12132,7 +11960,7 @@ var SupportPassportCardService = class {
|
|
|
12132
11960
|
// src/support-passport/grant-store.ts
|
|
12133
11961
|
import { createHash as createHash9, randomBytes, randomUUID as randomUUID4, timingSafeEqual } from "crypto";
|
|
12134
11962
|
import { lstat as lstat3, open as open2, readdir as readdir3 } from "fs/promises";
|
|
12135
|
-
import
|
|
11963
|
+
import path15 from "path";
|
|
12136
11964
|
var GRANT_LOCK_STALE_MS = 3e4;
|
|
12137
11965
|
var GRANT_LOCK_WAIT_MS = 5e3;
|
|
12138
11966
|
var GRANT_LOCK_HEARTBEAT_MS = 1e4;
|
|
@@ -12224,9 +12052,9 @@ var SupportPassportGrantStore = class {
|
|
|
12224
12052
|
runWithHeldFileLock;
|
|
12225
12053
|
syncDirectory;
|
|
12226
12054
|
constructor(options) {
|
|
12227
|
-
this.memoryDir =
|
|
12228
|
-
this.grantsDir =
|
|
12229
|
-
this.ownerIndexesDir =
|
|
12055
|
+
this.memoryDir = path15.resolve(expandTildePath(options.memoryDir));
|
|
12056
|
+
this.grantsDir = path15.join(this.memoryDir, "state", "support-passport", "grants");
|
|
12057
|
+
this.ownerIndexesDir = path15.join(this.grantsDir, "owners");
|
|
12230
12058
|
this.now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
12231
12059
|
this.makeSecret = options.makeSecret ?? (() => randomBytes(32));
|
|
12232
12060
|
this.makeGrantId = options.makeGrantId ?? randomUUID4;
|
|
@@ -12439,11 +12267,11 @@ var SupportPassportGrantStore = class {
|
|
|
12439
12267
|
}
|
|
12440
12268
|
filePath(grantId) {
|
|
12441
12269
|
const normalizedGrantId = normalizeGrantId(grantId);
|
|
12442
|
-
return
|
|
12270
|
+
return path15.join(this.grantsDir, `${normalizedGrantId}.json`);
|
|
12443
12271
|
}
|
|
12444
12272
|
ownerIndexPath(ownerHash) {
|
|
12445
12273
|
if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
|
|
12446
|
-
return
|
|
12274
|
+
return path15.join(this.ownerIndexesDir, `${ownerHash}.json`);
|
|
12447
12275
|
}
|
|
12448
12276
|
ownerHash(namespace, principalHash) {
|
|
12449
12277
|
return sha256("support-passport-owner-index:v1", `${namespace}\0${principalHash}`);
|
|
@@ -12499,12 +12327,12 @@ var SupportPassportGrantStore = class {
|
|
|
12499
12327
|
this.grantsDir,
|
|
12500
12328
|
grantIds.map((grantId) => `${grantId}.json`),
|
|
12501
12329
|
"support passport grant files must be regular files in a stable directory",
|
|
12502
|
-
|
|
12330
|
+
path15.parse(this.memoryDir).root
|
|
12503
12331
|
);
|
|
12504
12332
|
}
|
|
12505
12333
|
ownerMembershipDirectory(ownerHash) {
|
|
12506
12334
|
if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
|
|
12507
|
-
return
|
|
12335
|
+
return path15.join(this.ownerIndexesDir, ownerHash);
|
|
12508
12336
|
}
|
|
12509
12337
|
async ensureOwnerMembershipDirectory(ownerHash) {
|
|
12510
12338
|
const directory = this.ownerMembershipDirectory(ownerHash);
|
|
@@ -12519,11 +12347,11 @@ var SupportPassportGrantStore = class {
|
|
|
12519
12347
|
const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
|
|
12520
12348
|
await writePrivateFileAtomicallyNoFollow(
|
|
12521
12349
|
directory,
|
|
12522
|
-
|
|
12350
|
+
path15.join(directory, `${state.grantId}.json`),
|
|
12523
12351
|
`${JSON.stringify({ schemaVersion: 1, grantId: state.grantId })}
|
|
12524
12352
|
`,
|
|
12525
12353
|
"support passport owner membership must be regular files in a stable directory",
|
|
12526
|
-
|
|
12354
|
+
path15.parse(this.memoryDir).root
|
|
12527
12355
|
);
|
|
12528
12356
|
}
|
|
12529
12357
|
async removeOwnerMembership(state) {
|
|
@@ -12533,7 +12361,7 @@ var SupportPassportGrantStore = class {
|
|
|
12533
12361
|
directory,
|
|
12534
12362
|
[`${state.grantId}.json`],
|
|
12535
12363
|
"support passport owner membership must be regular files in a stable directory",
|
|
12536
|
-
|
|
12364
|
+
path15.parse(this.memoryDir).root
|
|
12537
12365
|
);
|
|
12538
12366
|
}
|
|
12539
12367
|
async removeStoredGrant(state) {
|
|
@@ -12634,7 +12462,7 @@ var SupportPassportGrantStore = class {
|
|
|
12634
12462
|
const ownerHash = this.ownerHash(namespace, principalHash);
|
|
12635
12463
|
const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
|
|
12636
12464
|
const grantIds = await withPrivateDirectoryNoFollow(
|
|
12637
|
-
|
|
12465
|
+
path15.parse(this.memoryDir).root,
|
|
12638
12466
|
directory,
|
|
12639
12467
|
"support passport owner membership must be regular files in a stable directory",
|
|
12640
12468
|
async (pinnedDirectory) => {
|
|
@@ -12665,7 +12493,7 @@ var SupportPassportGrantStore = class {
|
|
|
12665
12493
|
this.ownerIndexesDir,
|
|
12666
12494
|
filePath,
|
|
12667
12495
|
"support passport owner indexes must be regular files in a stable directory",
|
|
12668
|
-
|
|
12496
|
+
path15.parse(this.memoryDir).root
|
|
12669
12497
|
);
|
|
12670
12498
|
} catch (error) {
|
|
12671
12499
|
if (error.code === "ENOENT") return [];
|
|
@@ -12705,7 +12533,7 @@ var SupportPassportGrantStore = class {
|
|
|
12705
12533
|
`${JSON.stringify({ schemaVersion: 1, ownerHash, grantIds }, null, 2)}
|
|
12706
12534
|
`,
|
|
12707
12535
|
"support passport owner indexes must be regular files in a stable directory",
|
|
12708
|
-
|
|
12536
|
+
path15.parse(this.memoryDir).root
|
|
12709
12537
|
);
|
|
12710
12538
|
}
|
|
12711
12539
|
async readState(grantId) {
|
|
@@ -12715,7 +12543,7 @@ var SupportPassportGrantStore = class {
|
|
|
12715
12543
|
this.grantsDir,
|
|
12716
12544
|
filePath,
|
|
12717
12545
|
"support passport grant files must be regular files in a stable directory",
|
|
12718
|
-
|
|
12546
|
+
path15.parse(this.memoryDir).root
|
|
12719
12547
|
);
|
|
12720
12548
|
try {
|
|
12721
12549
|
const state = SupportPassportGrantStateSchema.parse(JSON.parse(content));
|
|
@@ -12749,7 +12577,7 @@ var SupportPassportGrantStore = class {
|
|
|
12749
12577
|
`${JSON.stringify(state, null, 2)}
|
|
12750
12578
|
`,
|
|
12751
12579
|
"support passport grant files must be regular files in a stable directory",
|
|
12752
|
-
|
|
12580
|
+
path15.parse(this.memoryDir).root
|
|
12753
12581
|
);
|
|
12754
12582
|
}
|
|
12755
12583
|
async ensureSafeDirectories() {
|
|
@@ -12783,8 +12611,8 @@ var SupportPassportGrantStore = class {
|
|
|
12783
12611
|
void 0
|
|
12784
12612
|
);
|
|
12785
12613
|
this.memoryDir = configuredMemoryDir;
|
|
12786
|
-
this.grantsDir =
|
|
12787
|
-
this.ownerIndexesDir =
|
|
12614
|
+
this.grantsDir = path15.join(configuredMemoryDir, "state", "support-passport", "grants");
|
|
12615
|
+
this.ownerIndexesDir = path15.join(this.grantsDir, "owners");
|
|
12788
12616
|
})();
|
|
12789
12617
|
}
|
|
12790
12618
|
const currentAttempt = this.memoryRootReady;
|
|
@@ -12798,12 +12626,12 @@ var SupportPassportGrantStore = class {
|
|
|
12798
12626
|
async withMutationLock(task) {
|
|
12799
12627
|
await this.ensureSafeDirectories();
|
|
12800
12628
|
return await withPrivateDirectoryNoFollow(
|
|
12801
|
-
|
|
12629
|
+
path15.parse(this.memoryDir).root,
|
|
12802
12630
|
this.grantsDir,
|
|
12803
12631
|
"support passport grant lock directory must remain inside the memory directory",
|
|
12804
12632
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12805
12633
|
`support-passport-grants:${this.grantsDir}`,
|
|
12806
|
-
|
|
12634
|
+
path15.join(pinnedDirectory, ".grants.lock"),
|
|
12807
12635
|
task
|
|
12808
12636
|
)
|
|
12809
12637
|
);
|
|
@@ -12812,12 +12640,12 @@ var SupportPassportGrantStore = class {
|
|
|
12812
12640
|
const normalizedGrantId = normalizeGrantId(grantId);
|
|
12813
12641
|
await this.ensureSafeDirectories();
|
|
12814
12642
|
return await withPrivateDirectoryNoFollow(
|
|
12815
|
-
|
|
12643
|
+
path15.parse(this.memoryDir).root,
|
|
12816
12644
|
this.grantsDir,
|
|
12817
12645
|
"support passport grant lock directory must remain inside the memory directory",
|
|
12818
12646
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12819
12647
|
`support-passport-grant:${this.grantsDir}:${normalizedGrantId}`,
|
|
12820
|
-
|
|
12648
|
+
path15.join(pinnedDirectory, `.${normalizedGrantId}.lock`),
|
|
12821
12649
|
task
|
|
12822
12650
|
)
|
|
12823
12651
|
);
|
|
@@ -12825,12 +12653,12 @@ var SupportPassportGrantStore = class {
|
|
|
12825
12653
|
async withOwnerIndexLock(ownerHash, task) {
|
|
12826
12654
|
await this.ensureSafeDirectories();
|
|
12827
12655
|
return await withPrivateDirectoryNoFollow(
|
|
12828
|
-
|
|
12656
|
+
path15.parse(this.memoryDir).root,
|
|
12829
12657
|
this.ownerIndexesDir,
|
|
12830
12658
|
"support passport owner lock directory must remain inside the memory directory",
|
|
12831
12659
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12832
12660
|
`support-passport-owner:${this.ownerIndexesDir}:${ownerHash}`,
|
|
12833
|
-
|
|
12661
|
+
path15.join(pinnedDirectory, `.${ownerHash}.lock`),
|
|
12834
12662
|
task
|
|
12835
12663
|
)
|
|
12836
12664
|
);
|
|
@@ -13668,7 +13496,7 @@ var SupportPassportModelAdapter = class {
|
|
|
13668
13496
|
|
|
13669
13497
|
// src/support-passport/model-audit.ts
|
|
13670
13498
|
import { createHash as createHash10 } from "crypto";
|
|
13671
|
-
import
|
|
13499
|
+
import path16 from "path";
|
|
13672
13500
|
import { z as z5 } from "zod";
|
|
13673
13501
|
var HashSchema = z5.string().regex(/^[a-f0-9]{64}$/);
|
|
13674
13502
|
var SupportPassportModelAuditRecordSchema = z5.object({
|
|
@@ -13713,15 +13541,15 @@ var SupportPassportModelAuditStore = class {
|
|
|
13713
13541
|
memoryRootReady;
|
|
13714
13542
|
runWithHeldFileLock;
|
|
13715
13543
|
constructor(options) {
|
|
13716
|
-
this.memoryDir =
|
|
13717
|
-
this.auditDir =
|
|
13544
|
+
this.memoryDir = path16.resolve(expandTildePath(options.memoryDir));
|
|
13545
|
+
this.auditDir = path16.join(this.memoryDir, "state", "support-passport", "audit");
|
|
13718
13546
|
this.runWithHeldFileLock = options.withHeldFileLock ?? withHeldFileLock;
|
|
13719
13547
|
}
|
|
13720
13548
|
async record(input) {
|
|
13721
13549
|
const record = SupportPassportModelAuditRecordSchema.parse(input);
|
|
13722
13550
|
await this.ensureSafeDirectories();
|
|
13723
13551
|
const day = record.occurredAt.slice(0, 10);
|
|
13724
|
-
const filePath =
|
|
13552
|
+
const filePath = path16.join(this.auditDir, `${day}.jsonl`);
|
|
13725
13553
|
await serializeMutations(
|
|
13726
13554
|
`support-passport-audit:${filePath}`,
|
|
13727
13555
|
() => withPrivateDirectoryNoFollow(
|
|
@@ -13729,7 +13557,7 @@ var SupportPassportModelAuditStore = class {
|
|
|
13729
13557
|
this.auditDir,
|
|
13730
13558
|
"support passport audit directory must remain inside the memory directory",
|
|
13731
13559
|
async (pinnedDirectory) => await this.runWithHeldFileLock(
|
|
13732
|
-
|
|
13560
|
+
path16.join(pinnedDirectory, `.${day}.lock`),
|
|
13733
13561
|
{
|
|
13734
13562
|
staleMs: 3e4,
|
|
13735
13563
|
maxWaitMs: 5e3,
|
|
@@ -13766,7 +13594,7 @@ var SupportPassportModelAuditStore = class {
|
|
|
13766
13594
|
"support passport memory directory must be a stable directory"
|
|
13767
13595
|
);
|
|
13768
13596
|
this.memoryDir = configuredMemoryDir;
|
|
13769
|
-
this.auditDir =
|
|
13597
|
+
this.auditDir = path16.join(configuredMemoryDir, "state", "support-passport", "audit");
|
|
13770
13598
|
})();
|
|
13771
13599
|
}
|
|
13772
13600
|
const currentAttempt = this.memoryRootReady;
|
|
@@ -15610,7 +15438,8 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
15610
15438
|
async memoryStore(request, hooks) {
|
|
15611
15439
|
return this.accessObserveWriteSurface.memoryStore(request, hooks);
|
|
15612
15440
|
}
|
|
15613
|
-
async peekMemoryStoreIdempotency(
|
|
15441
|
+
async peekMemoryStoreIdempotency(rawRequest) {
|
|
15442
|
+
const { request } = coerceProjectCategoryAlias(rawRequest);
|
|
15614
15443
|
const namespace = await this.resolveCodingScopedWriteNamespace(request);
|
|
15615
15444
|
const schemaVersion = request.schemaVersion ?? ENGRAM_ACCESS_WRITE_SCHEMA_VERSION;
|
|
15616
15445
|
if (schemaVersion !== ENGRAM_ACCESS_WRITE_SCHEMA_VERSION) {
|
|
@@ -15639,7 +15468,8 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
15639
15468
|
async suggestionSubmit(request, hooks) {
|
|
15640
15469
|
return this.accessObserveWriteSurface.suggestionSubmit(request, hooks);
|
|
15641
15470
|
}
|
|
15642
|
-
async peekSuggestionSubmitIdempotency(
|
|
15471
|
+
async peekSuggestionSubmitIdempotency(rawRequest) {
|
|
15472
|
+
const { request } = coerceProjectCategoryAlias(rawRequest);
|
|
15643
15473
|
const namespace = await this.resolveCodingScopedWriteNamespace(request);
|
|
15644
15474
|
const schemaVersion = request.schemaVersion ?? ENGRAM_ACCESS_WRITE_SCHEMA_VERSION;
|
|
15645
15475
|
if (schemaVersion !== ENGRAM_ACCESS_WRITE_SCHEMA_VERSION) {
|
|
@@ -17414,7 +17244,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
17414
17244
|
const resolvedNamespace = this.resolveReadableNamespace(options.namespace, options.principal);
|
|
17415
17245
|
const storage = await offlineSyncStorageForSnapshot(this.orchestrator, resolvedNamespace);
|
|
17416
17246
|
const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
17417
|
-
const deletions = [...await storage.readDeletionRevisions()].map(([
|
|
17247
|
+
const deletions = [...await storage.readDeletionRevisions()].map(([path17, mtimeMs]) => ({ path: path17, mtimeMs }));
|
|
17418
17248
|
const snapshotBuilder = options.includeContent === false && options.baseFiles && options.baseFiles.length > 0 ? buildOfflineSyncSnapshotFromBase : buildOfflineSyncSnapshot;
|
|
17419
17249
|
const snapshot = await snapshotBuilder({
|
|
17420
17250
|
root: storage.dir,
|
|
@@ -17440,7 +17270,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
17440
17270
|
const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
17441
17271
|
const deletions = await filterOfflineSyncDeletionRevisions({
|
|
17442
17272
|
root: storage.dir,
|
|
17443
|
-
deletions: [...await storage.readDeletionRevisions()].map(([
|
|
17273
|
+
deletions: [...await storage.readDeletionRevisions()].map(([path17, mtimeMs]) => ({ path: path17, mtimeMs })),
|
|
17444
17274
|
includeTranscripts: options.includeTranscripts !== false,
|
|
17445
17275
|
userExcludeRegexps: this.offlineSyncUserExcludes
|
|
17446
17276
|
});
|
|
@@ -18061,15 +17891,6 @@ export {
|
|
|
18061
17891
|
DELTA_SUBCOMMANDS,
|
|
18062
17892
|
detectPassiveCorrections,
|
|
18063
17893
|
capturePassiveCorrections,
|
|
18064
|
-
JOURNAL_DIR_NAME,
|
|
18065
|
-
journalPath,
|
|
18066
|
-
isJournalDayPath,
|
|
18067
|
-
todayJournalDate,
|
|
18068
|
-
writeJournalFile,
|
|
18069
|
-
seedJournal,
|
|
18070
|
-
isTopLevelArchivePath,
|
|
18071
|
-
isGenericRecallExcludedPath,
|
|
18072
|
-
filterRecallCandidates,
|
|
18073
17894
|
clusterByKey,
|
|
18074
17895
|
OPERATION_NAMES,
|
|
18075
17896
|
coerceBooleanLike,
|
|
@@ -18158,4 +17979,4 @@ export {
|
|
|
18158
17979
|
EngramAccessService,
|
|
18159
17980
|
AccessAdminOpsSurface
|
|
18160
17981
|
};
|
|
18161
|
-
//# sourceMappingURL=chunk-
|
|
17982
|
+
//# sourceMappingURL=chunk-5A7ZUOBA.js.map
|