@remnic/core 9.66.0 → 9.66.2
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 +11 -11
- package/dist/access-admin-ops-surface.js +31 -31
- package/dist/access-audit.js +2 -2
- package/dist/access-authorization-probe.d.ts +11 -11
- package/dist/access-authorization-probe.js +32 -32
- package/dist/access-boundary.d.ts +11 -11
- package/dist/access-boundary.js +31 -31
- package/dist/access-cli.js +105 -101
- package/dist/access-cli.js.map +1 -1
- package/dist/access-coding-context-resolution.d.ts +1 -1
- package/dist/access-extraction-force-flush.d.ts +11 -11
- package/dist/access-extraction-force-flush.js +31 -31
- package/dist/access-health-types.d.ts +1 -1
- package/dist/access-http-lcm-compaction.d.ts +11 -11
- package/dist/access-http-lifecycle-flush.d.ts +11 -11
- package/dist/access-http-offline-stream.d.ts +11 -11
- package/dist/access-http-query.d.ts +2 -2
- package/dist/access-http-query.js +33 -33
- package/dist/access-http.d.ts +12 -12
- package/dist/access-http.js +48 -48
- package/dist/access-identity-continuity-surface.d.ts +9 -9
- package/dist/access-identity-continuity-surface.js +31 -31
- package/dist/access-lcm-surface.d.ts +11 -11
- package/dist/access-lcm-surface.js +31 -31
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +39 -39
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-CLWUoMyW.d.ts → access-namespace-preflight-50VIkPhB.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +31 -31
- package/dist/access-observe-write-surface.d.ts +11 -11
- package/dist/access-observe-write-surface.js +31 -31
- package/dist/access-offline-manifest.d.ts +9 -9
- package/dist/access-operations-batch.js +34 -34
- package/dist/access-operations.d.ts +11 -11
- package/dist/access-operations.js +38 -38
- package/dist/access-recall-concurrency.d.ts +11 -11
- package/dist/access-recall-concurrency.js +31 -31
- package/dist/access-recall-response.d.ts +11 -11
- package/dist/access-recall-response.js +31 -31
- package/dist/access-recall-surface.d.ts +11 -11
- package/dist/access-recall-surface.js +31 -31
- package/dist/access-schema.js +3 -3
- package/dist/{access-service-CEUE1Isj.d.ts → access-service-Dz6I9AZ-.d.ts} +13 -13
- package/dist/access-service-helpers.d.ts +11 -11
- package/dist/access-service.d.ts +11 -11
- package/dist/access-service.js +31 -31
- package/dist/access-surface-catalog.d.ts +11 -11
- package/dist/access-surface-catalog.js +33 -33
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +1 -1
- package/dist/active-recall.d.ts +1 -1
- package/dist/active-recall.js +4 -4
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/ambient-provenance.d.ts +1 -1
- package/dist/artifact-search.d.ts +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +9 -9
- package/dist/briefing-window.d.ts +2 -2
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +10 -10
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer-turn-helpers.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/buffer.js +4 -4
- package/dist/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{catalog-D1HgugTA.d.ts → catalog-C2jA-gLm.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-behavior.js +2 -2
- package/dist/causal-chain.js +2 -2
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +13 -13
- package/dist/causal-retrieval.js +2 -2
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory-graph.js +2 -2
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-EZSCW4EM.js → chunk-25OLNWYG.js} +2 -2
- package/dist/{chunk-2LBAFHOQ.js → chunk-2QSGJTDG.js} +10 -10
- package/dist/{chunk-7UTDHQZ5.js → chunk-2VZHB5US.js} +2 -2
- package/dist/{chunk-VQNRICAQ.js → chunk-36HJ36FK.js} +3 -3
- package/dist/{chunk-XKNHFDTT.js → chunk-3A2Z4OOS.js} +2 -2
- package/dist/{chunk-KODXCHXJ.js → chunk-46XR5FNZ.js} +39 -3
- package/dist/chunk-46XR5FNZ.js.map +1 -0
- package/dist/{chunk-56IV4J5W.js → chunk-47WWTCJY.js} +1384 -99
- package/dist/chunk-47WWTCJY.js.map +1 -0
- package/dist/{chunk-RDGKVH6T.js → chunk-4NKIGSJM.js} +2 -2
- package/dist/{chunk-EFQCDJZ2.js → chunk-4PG2CKI6.js} +2 -2
- package/dist/{chunk-HJXA6ZM7.js → chunk-6545JDIM.js} +2 -2
- package/dist/{chunk-J3OND5QT.js → chunk-65HXVEVG.js} +2 -2
- package/dist/{chunk-HNPE66LB.js → chunk-6BYJQ3L2.js} +8 -8
- package/dist/{chunk-ZW4VXELZ.js → chunk-6PUF7LUO.js} +2 -2
- package/dist/{chunk-TVVEYCNW.js → chunk-7K5Q6COX.js} +4 -4
- package/dist/{chunk-MN5NOOI7.js → chunk-AI5M4FVQ.js} +2 -2
- package/dist/{chunk-IHGMRDEE.js → chunk-B4B3QDV3.js} +235 -151
- package/dist/chunk-B4B3QDV3.js.map +1 -0
- package/dist/{chunk-YMOPYG3K.js → chunk-BIJAWZYW.js} +6 -6
- package/dist/{chunk-I5VB44ZK.js → chunk-BLHKR4GJ.js} +2 -2
- package/dist/chunk-BLUYQFRH.js +36 -0
- package/dist/chunk-BLUYQFRH.js.map +1 -0
- package/dist/{chunk-CEH2AFXG.js → chunk-C24UZSFW.js} +6 -6
- package/dist/{chunk-MJRGVXPQ.js → chunk-C3ZYZKDJ.js} +2 -2
- package/dist/{chunk-QCRJMU5V.js → chunk-CDLPF3PX.js} +2 -2
- package/dist/{chunk-23CVL7HS.js → chunk-CQ6IWZDI.js} +2 -2
- package/dist/{chunk-KWIGDKM2.js → chunk-D2YNNDML.js} +2 -2
- package/dist/{chunk-FTTJRVB7.js → chunk-D3DUA64S.js} +2 -2
- package/dist/{chunk-7XOG75AU.js → chunk-D6Q5EPOV.js} +2 -2
- package/dist/{chunk-GEJKYA7D.js → chunk-DSEHPUID.js} +6 -6
- package/dist/chunk-E4X2YX2F.js +22 -0
- package/dist/chunk-E4X2YX2F.js.map +1 -0
- package/dist/{chunk-PEBH5DCK.js → chunk-EH7BNIUN.js} +101 -19
- package/dist/chunk-EH7BNIUN.js.map +1 -0
- package/dist/{chunk-OAJMQKQR.js → chunk-EQRD4NMH.js} +2 -2
- package/dist/{chunk-H7VDIF2V.js → chunk-ER2UPUMG.js} +2 -2
- package/dist/{chunk-4FHRZD5T.js → chunk-F2JXJABQ.js} +2 -2
- package/dist/{chunk-FKKGCGYL.js → chunk-F4W5HTED.js} +2 -2
- package/dist/{chunk-DMEHOEC7.js → chunk-FFWONAAW.js} +3 -3
- package/dist/chunk-FYDW33ZB.js +13 -0
- package/dist/chunk-FYDW33ZB.js.map +1 -0
- package/dist/{chunk-TNGH4ZYI.js → chunk-GNWLTCKC.js} +2 -2
- package/dist/{chunk-CFVTRUR3.js → chunk-H6RSANGQ.js} +2 -2
- package/dist/chunk-HVAEXYPL.js +98 -0
- package/dist/chunk-HVAEXYPL.js.map +1 -0
- package/dist/{chunk-CTCGHNWN.js → chunk-J2R275FN.js} +4 -4
- package/dist/{chunk-IVIAHQBR.js → chunk-JJ6ZEFXC.js} +2 -2
- package/dist/{chunk-KXIXO76C.js → chunk-JMXHVJ2V.js} +14 -14
- package/dist/{chunk-7LCGFUMB.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-NACLNNFQ.js → chunk-KSZKQTZS.js} +2 -2
- package/dist/{chunk-NPIBN2VL.js → chunk-LK4TOYPU.js} +2 -2
- package/dist/{chunk-K66OY4EI.js → chunk-LSR5LQXN.js} +2 -2
- package/dist/chunk-MAG6M3B6.js +51 -0
- package/dist/chunk-MAG6M3B6.js.map +1 -0
- package/dist/{chunk-6CEGSTBD.js → chunk-NTFXBILO.js} +5 -5
- package/dist/{chunk-2PSX5BJU.js → chunk-NZPFCP5A.js} +2 -2
- package/dist/{chunk-FYWLSFFS.js → chunk-OERZXNSK.js} +2 -2
- package/dist/{chunk-ZJPM7GZ3.js → chunk-OIDICRH7.js} +2 -2
- package/dist/{chunk-LTBKKSCX.js → chunk-OLBZ2WGG.js} +2 -2
- package/dist/{chunk-PD66CVSD.js → chunk-OUKBMQ2O.js} +2 -2
- package/dist/{chunk-GPFZFCRN.js → chunk-PP7R754B.js} +1 -1
- package/dist/{chunk-GX6FTSYH.js → chunk-PRRUK2ZH.js} +2 -2
- package/dist/{chunk-MAH64N55.js → chunk-PW3GKWH3.js} +4 -4
- package/dist/chunk-Q3SHEAXR.js +80 -0
- package/dist/chunk-Q3SHEAXR.js.map +1 -0
- package/dist/{chunk-33MFRY25.js → chunk-R2Q6FTOX.js} +2 -2
- package/dist/{chunk-VCKWULAK.js → chunk-RCPKBW7K.js} +5 -5
- package/dist/{chunk-CN4VKV3S.js → chunk-RH3XLQG4.js} +2 -2
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-YXFCALVT.js → chunk-U4HZEW2B.js} +8 -8
- package/dist/{chunk-RZ3IZIJG.js → chunk-UHQE37NI.js} +2 -2
- package/dist/{chunk-Z3YEGSR4.js → chunk-UMZUKOJU.js} +4 -4
- package/dist/{chunk-72OIT7KS.js → chunk-UVYL5G7A.js} +3 -3
- package/dist/{chunk-4STAANV7.js → chunk-VKDBDJIX.js} +3 -3
- package/dist/{chunk-WKJFIMVN.js → chunk-VSMSYDIH.js} +2 -2
- package/dist/{chunk-GSKINLAK.js → chunk-W5IYHQA5.js} +3 -3
- package/dist/{chunk-FESUGFIL.js → chunk-WKWY7YF3.js} +2 -2
- package/dist/{chunk-UNUMFURP.js → chunk-X5PIDJ3L.js} +3 -3
- package/dist/{chunk-MINHJ55X.js → chunk-XXW32OL7.js} +1 -1
- package/dist/{chunk-MINHJ55X.js.map → chunk-XXW32OL7.js.map} +1 -1
- package/dist/{chunk-6RUHELWR.js → chunk-Y2YM4C75.js} +2 -2
- package/dist/{chunk-L4X4PJYK.js → chunk-YZ5VC2JJ.js} +2 -2
- package/dist/{chunk-VQ4AMTGZ.js → chunk-ZBIEX4XN.js} +1 -1
- package/dist/{chunk-O57GM3FR.js → chunk-ZMVW2HJJ.js} +2 -2
- package/dist/{chunk-6QDXA26G.js → chunk-ZXROBS53.js} +68 -68
- package/dist/{cli-BEkm2MEf.d.ts → cli-BOuEb4Ia.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +76 -76
- package/dist/coding/export-okf-codegraph.d.ts +1 -1
- package/dist/coding/export-okf-codegraph.js +10 -10
- package/dist/coding/pre-action-gate.d.ts +1 -1
- package/dist/coding/pre-action-gate.js +2 -2
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +10 -10
- package/dist/compounding/preference-consolidator.d.ts +1 -1
- package/dist/compression-optimizer.d.ts +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.js +4 -4
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +10 -10
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +10 -10
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +3 -3
- package/dist/converge-config.d.ts +1 -1
- package/dist/convergence-refresh.d.ts +2 -2
- package/dist/convergence-refresh.js +12 -12
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/corpus-watermark.d.ts +1 -1
- package/dist/corpus-watermark.js +12 -12
- package/dist/cross-lingual-recall.d.ts +1 -1
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/dependency-propagation-config.d.ts +1 -1
- package/dist/{dependency-propagation-delivery-BCpeo14F.d.ts → dependency-propagation-delivery-D4WMbOwA.d.ts} +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-origin-fields.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +10 -10
- package/dist/entity-schema.d.ts +1 -1
- package/dist/episodic-context.d.ts +1 -1
- package/dist/eval-trajectory-contracts.d.ts +1 -1
- package/dist/eval-trajectory-store.d.ts +1 -1
- package/dist/eval-trajectory.d.ts +1 -1
- package/dist/explicit-capture.d.ts +9 -9
- package/dist/external-wiki-access.d.ts +11 -11
- package/dist/external-wiki-access.js +32 -32
- package/dist/external-wiki-collection-registration.d.ts +1 -1
- package/dist/external-wiki-collection.d.ts +1 -1
- package/dist/external-wiki-mcp-tools.d.ts +11 -11
- package/dist/extraction-error-classification.d.ts +1 -1
- package/dist/extraction-faithfulness.d.ts +1 -1
- package/dist/extraction-judge-telemetry.d.ts +1 -1
- package/dist/extraction-judge-training.d.ts +1 -1
- package/dist/extraction-judge.d.ts +1 -1
- package/dist/extraction-liveness.d.ts +1 -1
- package/dist/extraction-normalization.d.ts +1 -1
- package/dist/extraction-prompt.d.ts +1 -1
- package/dist/extraction-source-grounding-rules.d.ts +1 -1
- package/dist/extraction-source-grounding.d.ts +1 -1
- package/dist/extraction-span-wire.d.ts +17 -0
- package/dist/extraction-span-wire.js +13 -0
- package/dist/extraction-span-wire.js.map +1 -0
- package/dist/extraction-span.d.ts +17 -0
- package/dist/extraction-span.js +8 -0
- package/dist/extraction.d.ts +1 -1
- package/dist/extraction.js +13 -13
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/{graph-edge-decay-A4SDFMMS.js → graph-edge-decay-FXGELBFA.js} +4 -4
- package/dist/graph-edge-decay-FXGELBFA.js.map +1 -0
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-path-reconstruction.d.ts +1 -1
- package/dist/graph-path-scoring.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph-snapshot.js +3 -3
- package/dist/graph.d.ts +1 -1
- package/dist/graph.js +3 -3
- package/dist/harmonic-retrieval.js +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/{index-D_pyMUaP.d.ts → index-DuJnzwHv.d.ts} +2 -2
- package/dist/index.d.ts +341 -26
- package/dist/index.js +195 -114
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +2 -2
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +7 -7
- package/dist/lcm/tools.d.ts +1 -1
- package/dist/lifecycle.d.ts +1 -1
- package/dist/live-connectors-runner.d.ts +1 -1
- package/dist/local-llm.d.ts +1 -1
- package/dist/local-model-endpoint.d.ts +1 -1
- package/dist/location/index.d.ts +3 -3
- package/dist/location/index.js +12 -12
- package/dist/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +10 -10
- package/dist/maintenance/rebuild-memory-projection.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/{maintenance-DDUX9d6D.d.ts → maintenance-BBeaeYRR.d.ts} +3 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -11
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-controller.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-snapshot.d.ts +1 -1
- package/dist/memory-subject-cli.d.ts +11 -11
- package/dist/memory-subject.d.ts +11 -11
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +11 -11
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +6 -6
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +10 -10
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-doctor-corpus.d.ts +1 -1
- package/dist/operator-doctor-corpus.js +13 -13
- package/dist/operator-doctor-replica.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +3 -3
- package/dist/operator-toolkit.js +24 -24
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +4 -4
- package/dist/orchestration/maintenance.js +19 -19
- package/dist/{orchestrator-3F4jihCo.d.ts → orchestrator-CaqnwNwM.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +105 -101
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CB1dj6Uh.d.ts → pipeline-CrxVjlJr.d.ts} +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/proactive-contention.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{public-http-34-JIAGQ.d.ts → public-http-CmQRjQCD.d.ts} +1 -1
- package/dist/{qmd-edLLZXc5.d.ts → qmd-BZgbJm0g.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/qmd.js +4 -4
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-deep-access.d.ts +30 -0
- package/dist/recall-deep-access.js +50 -0
- package/dist/recall-deep-access.js.map +1 -0
- package/dist/recall-deep-render.d.ts +11 -0
- package/dist/recall-deep-render.js +28 -0
- package/dist/recall-deep-render.js.map +1 -0
- package/dist/recall-deep.d.ts +37 -0
- package/dist/recall-deep.js +14 -0
- package/dist/recall-deep.js.map +1 -0
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-explain-renderer.js +3 -3
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-navigate.d.ts +70 -0
- package/dist/recall-navigate.js +15 -0
- package/dist/recall-navigate.js.map +1 -0
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state-view-render.d.ts +18 -0
- package/dist/recall-state-view-render.js +22 -0
- package/dist/recall-state-view-render.js.map +1 -0
- package/dist/recall-state-view-widen.d.ts +13 -0
- package/dist/recall-state-view-widen.js +11 -0
- package/dist/recall-state-view-widen.js.map +1 -0
- package/dist/recall-state-view-wire.d.ts +13 -0
- package/dist/recall-state-view-wire.js +12 -0
- package/dist/recall-state-view-wire.js.map +1 -0
- package/dist/recall-state-view.d.ts +25 -0
- package/dist/recall-state-view.js +22 -0
- package/dist/recall-state-view.js.map +1 -0
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/reconcile/cursor.d.ts +1 -1
- package/dist/reconcile/manifest.d.ts +1 -1
- package/dist/reconcile/plan.d.ts +1 -1
- package/dist/replay/normalizers/chatgpt.d.ts +1 -1
- package/dist/replay/normalizers/claude.d.ts +1 -1
- package/dist/replay/normalizers/openclaw.d.ts +1 -1
- package/dist/replay/normalizers/shared.d.ts +1 -1
- package/dist/replay/runner.d.ts +1 -1
- package/dist/replay/types.d.ts +1 -1
- package/dist/replica-divergence.d.ts +1 -1
- package/dist/replica-peers-config.d.ts +1 -1
- package/dist/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +5 -5
- package/dist/retrieval-agents.d.ts +2 -2
- package/dist/retrieval-tiers.d.ts +1 -1
- package/dist/routing/engine.d.ts +1 -1
- package/dist/routing/store.d.ts +1 -1
- package/dist/salvage-envelope.d.ts +1 -1
- package/dist/schemas.d.ts +42 -42
- package/dist/{scope-profiles-BF2lu81V.d.ts → scope-profiles-DFaojvoP.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +5 -5
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +9 -9
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-5OuWXBRt.d.ts → semantic-consolidation-BiX68wZA.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +11 -11
- package/dist/semantic-rule-promotion.js +10 -10
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -10
- package/dist/{service-CrqEhLXD.d.ts → service-D5h2zZ0M.d.ts} +2 -2
- package/dist/session-observer-bands.d.ts +1 -1
- package/dist/session-observer-state.d.ts +1 -1
- package/dist/shared-context/manager.d.ts +1 -1
- package/dist/signal.d.ts +1 -1
- package/dist/source-agent-qualifier.d.ts +1 -1
- package/dist/source-agent-qualifier.js +12 -12
- package/dist/{storage-BQn-xnxm.d.ts → storage-CtsaojWD.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +9 -9
- package/dist/subject-config.d.ts +1 -1
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/support-passport/index.d.ts +14 -14
- package/dist/support-passport/index.js +34 -34
- package/dist/temporal-supersession.d.ts +2 -2
- package/dist/temporal-timeline-recall.d.ts +1 -1
- package/dist/temporal-validity.d.ts +1 -1
- package/dist/threading.d.ts +1 -1
- package/dist/tier-migration.d.ts +2 -2
- package/dist/tier-routing.d.ts +1 -1
- package/dist/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/transfer/export-okf.d.ts +1 -1
- package/dist/transfer/export-okf.js +11 -11
- package/dist/transfer/types.d.ts +12 -12
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-BRpcNjHZ.d.ts → types-CIpfYz1I.d.ts} +16 -11
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +10 -10
- package/dist/who-knows-cli.d.ts +11 -11
- package/dist/who-knows-cli.js +11 -11
- package/dist/who-knows.d.ts +11 -11
- package/dist/who-knows.js +10 -10
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/activity/config.test.ts +1 -1
- package/src/activity/config.ts +48 -3
- package/src/activity/index.ts +5 -0
- package/src/activity/journal-vault-read.test.ts +153 -0
- package/src/activity/journal-vault-read.ts +214 -0
- package/src/activity/journal.test.ts +97 -0
- package/src/activity/journal.ts +113 -0
- package/src/activity/privacy.test.ts +53 -0
- package/src/activity/privacy.ts +80 -0
- package/src/activity/timeline/analysis-batch.test.ts +56 -0
- package/src/activity/timeline/analysis-batch.ts +45 -0
- package/src/activity/timeline/analysis.test.ts +413 -0
- package/src/activity/timeline/analysis.ts +362 -0
- package/src/activity/timeline/index.ts +7 -0
- package/src/activity/timeline/journal-recap-persist.test.ts +148 -0
- package/src/activity/timeline/journal-recap-persist.ts +37 -0
- package/src/activity/timeline/journal-recap.test.ts +113 -0
- package/src/activity/timeline/journal-recap.ts +130 -0
- package/src/activity/timeline/query.test.ts +198 -0
- package/src/activity/timeline/query.ts +313 -0
- package/src/activity/timeline/weekly-persist.test.ts +121 -0
- package/src/activity/timeline/weekly-persist.ts +103 -0
- package/src/activity/timeline/weekly.test.ts +215 -0
- package/src/activity/timeline/weekly.ts +234 -0
- package/src/activity/types.ts +14 -0
- package/src/activity/vault-path.test.ts +38 -0
- package/src/activity/vault-path.ts +59 -0
- package/src/activity/vault-publish.test.ts +268 -0
- package/src/activity/vault-publish.ts +180 -0
- package/src/config.test.ts +1 -1
- package/src/config.ts +2 -22
- package/src/dedup/merge-on-write-wire.test.ts +101 -0
- package/src/dedup/merge-on-write-wire.ts +34 -0
- package/src/dedup/merge-on-write.test.ts +91 -0
- package/src/dedup/merge-on-write.ts +75 -0
- package/src/dedup/novelty-gate.test.ts +143 -0
- package/src/dedup/novelty-gate.ts +163 -0
- package/src/extraction-span-wire.test.ts +20 -0
- package/src/extraction-span-wire.ts +17 -0
- package/src/extraction-span.test.ts +59 -0
- package/src/extraction-span.ts +39 -0
- package/src/index.ts +1 -0
- package/src/location/recall-exclusion.test.ts +1 -0
- package/src/orchestration/extraction-persist.ts +22 -23
- package/src/orchestration/generic-recall-paths.ts +11 -0
- package/src/orchestration/recall-entry.ts +8 -3
- package/src/recall-deep-access.test.ts +58 -0
- package/src/recall-deep-access.ts +71 -0
- package/src/recall-deep-render.test.ts +68 -0
- package/src/recall-deep-render.ts +32 -0
- package/src/recall-deep.test.ts +72 -0
- package/src/recall-deep.ts +113 -0
- package/src/recall-navigate.test.ts +84 -0
- package/src/recall-navigate.ts +100 -0
- package/src/recall-state-view-render.test.ts +94 -0
- package/src/recall-state-view-render.ts +24 -0
- package/src/recall-state-view-widen.test.ts +66 -0
- package/src/recall-state-view-widen.ts +49 -0
- package/src/recall-state-view-wire.test.ts +35 -0
- package/src/recall-state-view-wire.ts +18 -0
- package/src/recall-state-view.test.ts +131 -0
- package/src/recall-state-view.ts +138 -0
- package/src/shared-context/governance.test.ts +53 -0
- package/src/shared-context/governance.ts +86 -0
- package/src/shared-context/staleness.test.ts +36 -0
- package/src/shared-context/staleness.ts +38 -0
- package/src/shared-context/trajectories.test.ts +77 -0
- package/src/shared-context/trajectories.ts +49 -0
- package/src/types.ts +3 -10
- package/dist/chunk-56IV4J5W.js.map +0 -1
- package/dist/chunk-IHGMRDEE.js.map +0 -1
- package/dist/chunk-KODXCHXJ.js.map +0 -1
- package/dist/chunk-PEBH5DCK.js.map +0 -1
- /package/dist/{chunk-EZSCW4EM.js.map → chunk-25OLNWYG.js.map} +0 -0
- /package/dist/{chunk-2LBAFHOQ.js.map → chunk-2QSGJTDG.js.map} +0 -0
- /package/dist/{chunk-7UTDHQZ5.js.map → chunk-2VZHB5US.js.map} +0 -0
- /package/dist/{chunk-VQNRICAQ.js.map → chunk-36HJ36FK.js.map} +0 -0
- /package/dist/{chunk-XKNHFDTT.js.map → chunk-3A2Z4OOS.js.map} +0 -0
- /package/dist/{chunk-RDGKVH6T.js.map → chunk-4NKIGSJM.js.map} +0 -0
- /package/dist/{chunk-EFQCDJZ2.js.map → chunk-4PG2CKI6.js.map} +0 -0
- /package/dist/{chunk-HJXA6ZM7.js.map → chunk-6545JDIM.js.map} +0 -0
- /package/dist/{chunk-J3OND5QT.js.map → chunk-65HXVEVG.js.map} +0 -0
- /package/dist/{chunk-HNPE66LB.js.map → chunk-6BYJQ3L2.js.map} +0 -0
- /package/dist/{chunk-ZW4VXELZ.js.map → chunk-6PUF7LUO.js.map} +0 -0
- /package/dist/{chunk-TVVEYCNW.js.map → chunk-7K5Q6COX.js.map} +0 -0
- /package/dist/{chunk-MN5NOOI7.js.map → chunk-AI5M4FVQ.js.map} +0 -0
- /package/dist/{chunk-YMOPYG3K.js.map → chunk-BIJAWZYW.js.map} +0 -0
- /package/dist/{chunk-I5VB44ZK.js.map → chunk-BLHKR4GJ.js.map} +0 -0
- /package/dist/{chunk-CEH2AFXG.js.map → chunk-C24UZSFW.js.map} +0 -0
- /package/dist/{chunk-MJRGVXPQ.js.map → chunk-C3ZYZKDJ.js.map} +0 -0
- /package/dist/{chunk-QCRJMU5V.js.map → chunk-CDLPF3PX.js.map} +0 -0
- /package/dist/{chunk-23CVL7HS.js.map → chunk-CQ6IWZDI.js.map} +0 -0
- /package/dist/{chunk-KWIGDKM2.js.map → chunk-D2YNNDML.js.map} +0 -0
- /package/dist/{chunk-FTTJRVB7.js.map → chunk-D3DUA64S.js.map} +0 -0
- /package/dist/{chunk-7XOG75AU.js.map → chunk-D6Q5EPOV.js.map} +0 -0
- /package/dist/{chunk-GEJKYA7D.js.map → chunk-DSEHPUID.js.map} +0 -0
- /package/dist/{chunk-OAJMQKQR.js.map → chunk-EQRD4NMH.js.map} +0 -0
- /package/dist/{chunk-H7VDIF2V.js.map → chunk-ER2UPUMG.js.map} +0 -0
- /package/dist/{chunk-4FHRZD5T.js.map → chunk-F2JXJABQ.js.map} +0 -0
- /package/dist/{chunk-FKKGCGYL.js.map → chunk-F4W5HTED.js.map} +0 -0
- /package/dist/{chunk-DMEHOEC7.js.map → chunk-FFWONAAW.js.map} +0 -0
- /package/dist/{chunk-TNGH4ZYI.js.map → chunk-GNWLTCKC.js.map} +0 -0
- /package/dist/{chunk-CFVTRUR3.js.map → chunk-H6RSANGQ.js.map} +0 -0
- /package/dist/{chunk-CTCGHNWN.js.map → chunk-J2R275FN.js.map} +0 -0
- /package/dist/{chunk-IVIAHQBR.js.map → chunk-JJ6ZEFXC.js.map} +0 -0
- /package/dist/{chunk-KXIXO76C.js.map → chunk-JMXHVJ2V.js.map} +0 -0
- /package/dist/{chunk-7LCGFUMB.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-NACLNNFQ.js.map → chunk-KSZKQTZS.js.map} +0 -0
- /package/dist/{chunk-NPIBN2VL.js.map → chunk-LK4TOYPU.js.map} +0 -0
- /package/dist/{chunk-K66OY4EI.js.map → chunk-LSR5LQXN.js.map} +0 -0
- /package/dist/{chunk-6CEGSTBD.js.map → chunk-NTFXBILO.js.map} +0 -0
- /package/dist/{chunk-2PSX5BJU.js.map → chunk-NZPFCP5A.js.map} +0 -0
- /package/dist/{chunk-FYWLSFFS.js.map → chunk-OERZXNSK.js.map} +0 -0
- /package/dist/{chunk-ZJPM7GZ3.js.map → chunk-OIDICRH7.js.map} +0 -0
- /package/dist/{chunk-LTBKKSCX.js.map → chunk-OLBZ2WGG.js.map} +0 -0
- /package/dist/{chunk-PD66CVSD.js.map → chunk-OUKBMQ2O.js.map} +0 -0
- /package/dist/{chunk-GPFZFCRN.js.map → chunk-PP7R754B.js.map} +0 -0
- /package/dist/{chunk-GX6FTSYH.js.map → chunk-PRRUK2ZH.js.map} +0 -0
- /package/dist/{chunk-MAH64N55.js.map → chunk-PW3GKWH3.js.map} +0 -0
- /package/dist/{chunk-33MFRY25.js.map → chunk-R2Q6FTOX.js.map} +0 -0
- /package/dist/{chunk-VCKWULAK.js.map → chunk-RCPKBW7K.js.map} +0 -0
- /package/dist/{chunk-CN4VKV3S.js.map → chunk-RH3XLQG4.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-YXFCALVT.js.map → chunk-U4HZEW2B.js.map} +0 -0
- /package/dist/{chunk-RZ3IZIJG.js.map → chunk-UHQE37NI.js.map} +0 -0
- /package/dist/{chunk-Z3YEGSR4.js.map → chunk-UMZUKOJU.js.map} +0 -0
- /package/dist/{chunk-72OIT7KS.js.map → chunk-UVYL5G7A.js.map} +0 -0
- /package/dist/{chunk-4STAANV7.js.map → chunk-VKDBDJIX.js.map} +0 -0
- /package/dist/{chunk-WKJFIMVN.js.map → chunk-VSMSYDIH.js.map} +0 -0
- /package/dist/{chunk-GSKINLAK.js.map → chunk-W5IYHQA5.js.map} +0 -0
- /package/dist/{chunk-FESUGFIL.js.map → chunk-WKWY7YF3.js.map} +0 -0
- /package/dist/{chunk-UNUMFURP.js.map → chunk-X5PIDJ3L.js.map} +0 -0
- /package/dist/{chunk-6RUHELWR.js.map → chunk-Y2YM4C75.js.map} +0 -0
- /package/dist/{chunk-L4X4PJYK.js.map → chunk-YZ5VC2JJ.js.map} +0 -0
- /package/dist/{chunk-VQ4AMTGZ.js.map → chunk-ZBIEX4XN.js.map} +0 -0
- /package/dist/{chunk-O57GM3FR.js.map → chunk-ZMVW2HJJ.js.map} +0 -0
- /package/dist/{chunk-6QDXA26G.js.map → chunk-ZXROBS53.js.map} +0 -0
- /package/dist/{graph-edge-decay-A4SDFMMS.js.map → extraction-span.js.map} +0 -0
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from "./chunk-GDB4J2H3.js";
|
|
9
9
|
import {
|
|
10
10
|
importCapsule
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-J2R275FN.js";
|
|
12
12
|
import {
|
|
13
13
|
ACTIVE_DECISION_STATUSES,
|
|
14
14
|
CodegraphRuntimeError,
|
|
@@ -32,16 +32,10 @@ import {
|
|
|
32
32
|
computeWhoKnows,
|
|
33
33
|
loadWhoKnowsEntities,
|
|
34
34
|
validateWhoKnowsInput
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-VSMSYDIH.js";
|
|
36
36
|
import {
|
|
37
37
|
WriteQuarantineStore
|
|
38
38
|
} from "./chunk-PJSK6OJM.js";
|
|
39
|
-
import {
|
|
40
|
-
trustResultFor
|
|
41
|
-
} from "./chunk-GNVZQ5JN.js";
|
|
42
|
-
import {
|
|
43
|
-
renderEpistemicHedge
|
|
44
|
-
} from "./chunk-YN2UN7N3.js";
|
|
45
39
|
import {
|
|
46
40
|
getTrustZoneStoreStatus,
|
|
47
41
|
isTrustZoneName,
|
|
@@ -51,6 +45,12 @@ import {
|
|
|
51
45
|
seedTrustZoneDemoDataset,
|
|
52
46
|
summarizeTrustZonePromotionReadiness
|
|
53
47
|
} from "./chunk-5QZR2RA3.js";
|
|
48
|
+
import {
|
|
49
|
+
trustResultFor
|
|
50
|
+
} from "./chunk-GNVZQ5JN.js";
|
|
51
|
+
import {
|
|
52
|
+
renderEpistemicHedge
|
|
53
|
+
} from "./chunk-YN2UN7N3.js";
|
|
54
54
|
import {
|
|
55
55
|
planSessionTranscriptMigration
|
|
56
56
|
} from "./chunk-P5FPO2BR.js";
|
|
@@ -59,13 +59,13 @@ import {
|
|
|
59
59
|
} from "./chunk-H7XKCNR6.js";
|
|
60
60
|
import {
|
|
61
61
|
toRecallExplainJson
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-H6RSANGQ.js";
|
|
63
63
|
import {
|
|
64
64
|
estimateRecallTokens
|
|
65
|
-
} from "./chunk-
|
|
65
|
+
} from "./chunk-LK4TOYPU.js";
|
|
66
66
|
import {
|
|
67
67
|
readAggregateExtractionWatermark
|
|
68
|
-
} from "./chunk-
|
|
68
|
+
} from "./chunk-6PUF7LUO.js";
|
|
69
69
|
import {
|
|
70
70
|
ReplicaDivergenceMonitor
|
|
71
71
|
} from "./chunk-CVILPI77.js";
|
|
@@ -83,7 +83,7 @@ import {
|
|
|
83
83
|
} from "./chunk-2YA5N2BY.js";
|
|
84
84
|
import {
|
|
85
85
|
buildGraphSnapshot
|
|
86
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-OUKBMQ2O.js";
|
|
87
87
|
import {
|
|
88
88
|
REDACTION_RULES_SUBDIR
|
|
89
89
|
} from "./chunk-LTHVM4XN.js";
|
|
@@ -118,7 +118,7 @@ import {
|
|
|
118
118
|
import {
|
|
119
119
|
CorpusWatermarkCache,
|
|
120
120
|
computeServiceCorpusCensus
|
|
121
|
-
} from "./chunk-
|
|
121
|
+
} from "./chunk-F2JXJABQ.js";
|
|
122
122
|
import {
|
|
123
123
|
CrossNamespaceBudget,
|
|
124
124
|
toBudgetWarning
|
|
@@ -130,14 +130,14 @@ import {
|
|
|
130
130
|
listMemoryGovernanceRuns,
|
|
131
131
|
readMemoryGovernanceRunArtifact,
|
|
132
132
|
runMemoryGovernance
|
|
133
|
-
} from "./chunk-
|
|
133
|
+
} from "./chunk-4PG2CKI6.js";
|
|
134
134
|
import {
|
|
135
135
|
ExtractionDeadlineError,
|
|
136
136
|
isActivityDigestPath,
|
|
137
137
|
isArtifactMemoryPath,
|
|
138
138
|
isLocationDayPath,
|
|
139
139
|
isMeetingRecordPath
|
|
140
|
-
} from "./chunk-
|
|
140
|
+
} from "./chunk-4NKIGSJM.js";
|
|
141
141
|
import {
|
|
142
142
|
defaultCapsulesDir
|
|
143
143
|
} from "./chunk-ZY2MNJR6.js";
|
|
@@ -147,7 +147,7 @@ import {
|
|
|
147
147
|
enqueuePassiveCorrectionNotification,
|
|
148
148
|
parseBriefingFocus,
|
|
149
149
|
parseBriefingWindow
|
|
150
|
-
} from "./chunk-
|
|
150
|
+
} from "./chunk-WKWY7YF3.js";
|
|
151
151
|
import {
|
|
152
152
|
OKF_RESERVED_BASENAMES,
|
|
153
153
|
parseEntityFile,
|
|
@@ -155,14 +155,14 @@ import {
|
|
|
155
155
|
qmdCollectionPathParts,
|
|
156
156
|
qmdResultPathCandidates,
|
|
157
157
|
selfDeps
|
|
158
|
-
} from "./chunk-
|
|
158
|
+
} from "./chunk-DSEHPUID.js";
|
|
159
159
|
import {
|
|
160
160
|
namespaceCollectionName
|
|
161
|
-
} from "./chunk-
|
|
161
|
+
} from "./chunk-OERZXNSK.js";
|
|
162
162
|
import {
|
|
163
163
|
DEFAULT_RECALL_DISCLOSURE,
|
|
164
164
|
isRecallDisclosure
|
|
165
|
-
} from "./chunk-
|
|
165
|
+
} from "./chunk-XXW32OL7.js";
|
|
166
166
|
import {
|
|
167
167
|
normalizeProjectionPreview,
|
|
168
168
|
normalizeProjectionTags
|
|
@@ -217,16 +217,19 @@ import {
|
|
|
217
217
|
normalizeProcedureSteps,
|
|
218
218
|
parseProcedureStepsFromBody
|
|
219
219
|
} from "./chunk-QDW3E4RD.js";
|
|
220
|
+
import {
|
|
221
|
+
isValidActivityDate
|
|
222
|
+
} from "./chunk-M6L7HI7R.js";
|
|
220
223
|
import {
|
|
221
224
|
filterTrajectoriesByLookbackDays,
|
|
222
225
|
readCausalTrajectoryRecords
|
|
223
|
-
} from "./chunk-
|
|
226
|
+
} from "./chunk-PP7R754B.js";
|
|
224
227
|
import {
|
|
225
228
|
computePromotionCandidates
|
|
226
229
|
} from "./chunk-ME35HVDJ.js";
|
|
227
230
|
import {
|
|
228
231
|
exportCapsule
|
|
229
|
-
} from "./chunk-
|
|
232
|
+
} from "./chunk-KQAFEZQX.js";
|
|
230
233
|
import {
|
|
231
234
|
evaluateActionConfidence
|
|
232
235
|
} from "./chunk-Z2YFLXHU.js";
|
|
@@ -411,7 +414,7 @@ import {
|
|
|
411
414
|
} from "./chunk-P77QX3ID.js";
|
|
412
415
|
import {
|
|
413
416
|
AccessAuditAdapter
|
|
414
|
-
} from "./chunk-
|
|
417
|
+
} from "./chunk-7K5Q6COX.js";
|
|
415
418
|
import {
|
|
416
419
|
decodeCitationNamespace
|
|
417
420
|
} from "./chunk-DJORULH3.js";
|
|
@@ -3454,7 +3457,74 @@ function buildNotificationSummary(plan) {
|
|
|
3454
3457
|
}
|
|
3455
3458
|
|
|
3456
3459
|
// src/orchestration/generic-recall-paths.ts
|
|
3460
|
+
import path5 from "path";
|
|
3461
|
+
|
|
3462
|
+
// src/activity/journal.ts
|
|
3463
|
+
import { mkdirSync, statSync, writeFileSync } from "fs";
|
|
3457
3464
|
import path4 from "path";
|
|
3465
|
+
var JOURNAL_DIR_NAME = "journal";
|
|
3466
|
+
var JOURNAL_DAY_TOPLEVEL = /^journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
|
|
3467
|
+
var JOURNAL_DAY_ANYWHERE = /(?:^|[\\/])journal[\\/]\d{4}-\d{2}-\d{2}\.md$/i;
|
|
3468
|
+
function journalPath(memoryDir, date) {
|
|
3469
|
+
if (!isValidActivityDate(date)) {
|
|
3470
|
+
throw new RangeError(`Invalid journal date "${date}"; expected YYYY-MM-DD.`);
|
|
3471
|
+
}
|
|
3472
|
+
return path4.join(memoryDir, JOURNAL_DIR_NAME, `${date}.md`);
|
|
3473
|
+
}
|
|
3474
|
+
function isJournalDayPath(filePath, memoryRoot) {
|
|
3475
|
+
if (memoryRoot !== void 0 && memoryRoot.length > 0) {
|
|
3476
|
+
const relative2 = path4.relative(memoryRoot, path4.resolve(memoryRoot, filePath));
|
|
3477
|
+
return JOURNAL_DAY_TOPLEVEL.test(relative2);
|
|
3478
|
+
}
|
|
3479
|
+
return JOURNAL_DAY_ANYWHERE.test(filePath);
|
|
3480
|
+
}
|
|
3481
|
+
function todayJournalDate(now = /* @__PURE__ */ new Date()) {
|
|
3482
|
+
const year = now.getFullYear();
|
|
3483
|
+
const month = String(now.getMonth() + 1).padStart(2, "0");
|
|
3484
|
+
const day = String(now.getDate()).padStart(2, "0");
|
|
3485
|
+
return `${year}-${month}-${day}`;
|
|
3486
|
+
}
|
|
3487
|
+
function formatCardDuration(card) {
|
|
3488
|
+
const start = Date.parse(card.startUtc);
|
|
3489
|
+
const end = Date.parse(card.endUtc);
|
|
3490
|
+
const minutes = Number.isFinite(start) && Number.isFinite(end) && end > start ? Math.round((end - start) / 6e4) : 0;
|
|
3491
|
+
return `${minutes}m`;
|
|
3492
|
+
}
|
|
3493
|
+
function renderJournalSeed(date, cards) {
|
|
3494
|
+
const ordered = [...cards].sort((left, right) => {
|
|
3495
|
+
const byStart = left.startUtc.localeCompare(right.startUtc);
|
|
3496
|
+
return byStart !== 0 ? byStart : left.title.localeCompare(right.title);
|
|
3497
|
+
});
|
|
3498
|
+
const glance = ordered.length === 0 ? ["_No cards._"] : ordered.map((card) => `- ${formatCardDuration(card)} ${card.title}`);
|
|
3499
|
+
return [`# Journal \u2014 ${date}`, "", "## Day at a glance", "", ...glance, "", "## Notes", "", ""].join(
|
|
3500
|
+
"\n"
|
|
3501
|
+
);
|
|
3502
|
+
}
|
|
3503
|
+
function writeJournalFile(filePath, content, force) {
|
|
3504
|
+
let exists = false;
|
|
3505
|
+
try {
|
|
3506
|
+
statSync(filePath);
|
|
3507
|
+
exists = true;
|
|
3508
|
+
} catch (err) {
|
|
3509
|
+
const code = err.code;
|
|
3510
|
+
if (code !== "ENOENT") throw err;
|
|
3511
|
+
}
|
|
3512
|
+
if (exists && !force) return false;
|
|
3513
|
+
mkdirSync(path4.dirname(filePath), { recursive: true });
|
|
3514
|
+
writeFileSync(filePath, content);
|
|
3515
|
+
return true;
|
|
3516
|
+
}
|
|
3517
|
+
function seedJournal(input) {
|
|
3518
|
+
const filePath = journalPath(input.memoryDir, input.date);
|
|
3519
|
+
const wrote = writeJournalFile(
|
|
3520
|
+
filePath,
|
|
3521
|
+
renderJournalSeed(input.date, input.cards ?? []),
|
|
3522
|
+
input.force === true
|
|
3523
|
+
);
|
|
3524
|
+
return { path: filePath, wrote };
|
|
3525
|
+
}
|
|
3526
|
+
|
|
3527
|
+
// src/orchestration/generic-recall-paths.ts
|
|
3458
3528
|
var CATEGORY_MEMORY_ROOTS = Object.fromEntries(
|
|
3459
3529
|
ALL_CATEGORY_DIRS.map((directory) => [directory, true])
|
|
3460
3530
|
);
|
|
@@ -3479,7 +3549,7 @@ function normalizeQmdUriPath(relativePath, source) {
|
|
|
3479
3549
|
}
|
|
3480
3550
|
}
|
|
3481
3551
|
function stripQmdCollectionPrefix(relativePath, policy, source) {
|
|
3482
|
-
const normalized =
|
|
3552
|
+
const normalized = path5.posix.normalize(normalizeQmdUriPath(relativePath, source).replace(/\\/g, "/"));
|
|
3483
3553
|
const slashIndex = normalized.indexOf("/");
|
|
3484
3554
|
if (slashIndex <= 0 || slashIndex >= normalized.length - 1) return normalized;
|
|
3485
3555
|
const prefix = normalized.slice(0, slashIndex);
|
|
@@ -3488,8 +3558,8 @@ function stripQmdCollectionPrefix(relativePath, policy, source) {
|
|
|
3488
3558
|
return matchesHotCollection || matchesColdCollection ? normalized.slice(slashIndex + 1) : normalized;
|
|
3489
3559
|
}
|
|
3490
3560
|
function isTopLevelArchivePath(filePath, policy = {}, source = "filesystem") {
|
|
3491
|
-
const isAbsolutePath =
|
|
3492
|
-
const relative2 = policy.memoryDir && isAbsolutePath ?
|
|
3561
|
+
const isAbsolutePath = path5.isAbsolute(filePath);
|
|
3562
|
+
const relative2 = policy.memoryDir && isAbsolutePath ? path5.relative(policy.memoryDir, path5.resolve(filePath)) : filePath;
|
|
3493
3563
|
const normalized = !isAbsolutePath ? stripQmdCollectionPrefix(relative2, policy, source) : relative2;
|
|
3494
3564
|
return /^(?:archive|namespaces[\\/][^\\/]+[\\/]archive)(?:[\\/]|$)/i.test(normalized);
|
|
3495
3565
|
}
|
|
@@ -3503,7 +3573,7 @@ function isExternalWikiQmdPath(filePath, source) {
|
|
|
3503
3573
|
function isSearchExcludedPath(filePath, policy = {}, source = "filesystem") {
|
|
3504
3574
|
if (isExternalWikiQmdPath(filePath, source)) return true;
|
|
3505
3575
|
for (const candidate of collectionSpellings(filePath, policy, source)) {
|
|
3506
|
-
if (isArtifactMemoryPath(candidate) || isNamespacedActivityDigestPath(candidate, policy.memoryDir) || isNamespacedLocationDayPath(candidate, policy.memoryDir) || isMeetingRecordPath(candidate)) {
|
|
3576
|
+
if (isArtifactMemoryPath(candidate) || isNamespacedActivityDigestPath(candidate, policy.memoryDir) || isNamespacedLocationDayPath(candidate, policy.memoryDir) || isNamespacedJournalDayPath(candidate, policy.memoryDir) || isMeetingRecordPath(candidate)) {
|
|
3507
3577
|
return true;
|
|
3508
3578
|
}
|
|
3509
3579
|
}
|
|
@@ -3512,7 +3582,7 @@ function isSearchExcludedPath(filePath, policy = {}, source = "filesystem") {
|
|
|
3512
3582
|
function isNamespacedActivityDigestPath(candidate, memoryDir) {
|
|
3513
3583
|
if (isActivityDigestPath(candidate, memoryDir)) return true;
|
|
3514
3584
|
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3515
|
-
const relative2 =
|
|
3585
|
+
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3516
3586
|
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3517
3587
|
if (namespaced === null) return false;
|
|
3518
3588
|
return isActivityDigestPath(namespaced[2] ?? "", memoryDir);
|
|
@@ -3520,19 +3590,27 @@ function isNamespacedActivityDigestPath(candidate, memoryDir) {
|
|
|
3520
3590
|
function isNamespacedLocationDayPath(candidate, memoryDir) {
|
|
3521
3591
|
if (isLocationDayPath(candidate, memoryDir)) return true;
|
|
3522
3592
|
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3523
|
-
const relative2 =
|
|
3593
|
+
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3524
3594
|
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3525
3595
|
if (namespaced === null) return false;
|
|
3526
3596
|
return isLocationDayPath(namespaced[2] ?? "", memoryDir);
|
|
3527
3597
|
}
|
|
3598
|
+
function isNamespacedJournalDayPath(candidate, memoryDir) {
|
|
3599
|
+
if (isJournalDayPath(candidate, memoryDir)) return true;
|
|
3600
|
+
if (memoryDir === void 0 || memoryDir.length === 0) return false;
|
|
3601
|
+
const relative2 = path5.relative(memoryDir, path5.resolve(memoryDir, candidate));
|
|
3602
|
+
const namespaced = /^namespaces[\\/]([^\\/]+)[\\/](.*)$/.exec(relative2);
|
|
3603
|
+
if (namespaced === null) return false;
|
|
3604
|
+
return isJournalDayPath(namespaced[2] ?? "", memoryDir);
|
|
3605
|
+
}
|
|
3528
3606
|
function collectionSpellings(filePath, policy, source) {
|
|
3529
|
-
if (
|
|
3607
|
+
if (path5.isAbsolute(filePath)) return [filePath];
|
|
3530
3608
|
if (source === "qmd" && filePath.startsWith("qmd://")) {
|
|
3531
|
-
const normalized2 =
|
|
3609
|
+
const normalized2 = path5.posix.normalize(normalizeQmdUriPath(filePath, source).replace(/\\/g, "/"));
|
|
3532
3610
|
const slashIndex2 = normalized2.indexOf("/");
|
|
3533
3611
|
return slashIndex2 <= 0 || slashIndex2 >= normalized2.length - 1 ? [normalized2] : [normalized2, normalized2.slice(slashIndex2 + 1)];
|
|
3534
3612
|
}
|
|
3535
|
-
const normalized =
|
|
3613
|
+
const normalized = path5.posix.normalize(
|
|
3536
3614
|
normalizeQmdUriPath(filePath, source).replace(/\\/g, "/")
|
|
3537
3615
|
);
|
|
3538
3616
|
const stripped = stripQmdCollectionPrefix(filePath, policy, source);
|
|
@@ -3549,7 +3627,7 @@ function collectionSpellings(filePath, policy, source) {
|
|
|
3549
3627
|
return spellings;
|
|
3550
3628
|
}
|
|
3551
3629
|
function isGenericRecallExcludedPath(filePath, policy = {}, source = "filesystem") {
|
|
3552
|
-
return isSearchExcludedPath(filePath, policy, source) || isTopLevelArchivePath(filePath, policy, source) || OKF_RESERVED_BASENAMES[
|
|
3630
|
+
return isSearchExcludedPath(filePath, policy, source) || isTopLevelArchivePath(filePath, policy, source) || OKF_RESERVED_BASENAMES[path5.basename(filePath)] === true;
|
|
3553
3631
|
}
|
|
3554
3632
|
function filterRecallCandidates(candidates, options) {
|
|
3555
3633
|
const pathPolicy = options.pathPolicy ?? (options.memoryRoot === void 0 ? void 0 : { memoryDir: options.memoryRoot });
|
|
@@ -3562,7 +3640,7 @@ function filterRecallCandidates(candidates, options) {
|
|
|
3562
3640
|
// src/procedural/procedure-miner.ts
|
|
3563
3641
|
import { createHash as createHash2 } from "crypto";
|
|
3564
3642
|
import { mkdir as mkdir2, rm, stat } from "fs/promises";
|
|
3565
|
-
import
|
|
3643
|
+
import path6 from "path";
|
|
3566
3644
|
|
|
3567
3645
|
// src/procedural/reinforcement-core.ts
|
|
3568
3646
|
function clusterByKey(items, keyFn) {
|
|
@@ -3615,8 +3693,8 @@ function sleep(ms) {
|
|
|
3615
3693
|
return new Promise((resolve4) => setTimeout(resolve4, ms));
|
|
3616
3694
|
}
|
|
3617
3695
|
async function acquireClusterWriteLock(memoryDir, clusterHash) {
|
|
3618
|
-
const lockRoot =
|
|
3619
|
-
const lockDir =
|
|
3696
|
+
const lockRoot = path6.join(path6.resolve(memoryDir), "state", "procedure-miner-locks");
|
|
3697
|
+
const lockDir = path6.join(lockRoot, `${clusterHash}.lock`);
|
|
3620
3698
|
await mkdir2(lockRoot, { recursive: true });
|
|
3621
3699
|
const startedAt = Date.now();
|
|
3622
3700
|
let attempts = 0;
|
|
@@ -3647,7 +3725,7 @@ async function acquireClusterWriteLock(memoryDir, clusterHash) {
|
|
|
3647
3725
|
}
|
|
3648
3726
|
}
|
|
3649
3727
|
async function withClusterWriteLock(memoryDir, clusterHash, fn) {
|
|
3650
|
-
const inProcessKey = `${
|
|
3728
|
+
const inProcessKey = `${path6.resolve(memoryDir)}:${clusterHash}`;
|
|
3651
3729
|
const previous = inProcessClusterWriteLocks.get(inProcessKey) ?? Promise.resolve();
|
|
3652
3730
|
let releaseInProcess;
|
|
3653
3731
|
const current = previous.catch(() => void 0).then(
|
|
@@ -3785,7 +3863,7 @@ async function runProcedureMining(options) {
|
|
|
3785
3863
|
}
|
|
3786
3864
|
|
|
3787
3865
|
// src/support-passport/offline-sync-guard.ts
|
|
3788
|
-
import
|
|
3866
|
+
import path7 from "path";
|
|
3789
3867
|
var MAX_SUPPORT_PASSPORT_FRONTMATTER_BYTES = 1048576;
|
|
3790
3868
|
var SUPPORT_PASSPORT_MARKER = "support-passport-";
|
|
3791
3869
|
var FRONTMATTER_PREFIXES = ["---\n", "---\r\n"];
|
|
@@ -3855,7 +3933,7 @@ function createSupportPassportOfflineSyncGuard(storage) {
|
|
|
3855
3933
|
return {
|
|
3856
3934
|
root: storage.dir,
|
|
3857
3935
|
path: normalizedPath,
|
|
3858
|
-
filePath:
|
|
3936
|
+
filePath: path7.resolve(storage.dir, ...normalizedPath.split("/"))
|
|
3859
3937
|
};
|
|
3860
3938
|
};
|
|
3861
3939
|
const assertTargetAllowed = async (target) => {
|
|
@@ -4187,10 +4265,10 @@ function formatZodIssues(error) {
|
|
|
4187
4265
|
const parts = [];
|
|
4188
4266
|
for (const issue of error.issues) {
|
|
4189
4267
|
const hasNumeric = issue.path.some((p) => typeof p === "number");
|
|
4190
|
-
const
|
|
4268
|
+
const path19 = hasNumeric ? issue.path.filter((p) => typeof p === "string").join(".") || "(root)" : issue.path.length > 0 ? issue.path.join(".") : "(root)";
|
|
4191
4269
|
const options = enumOptionsFromIssue(issue);
|
|
4192
4270
|
const suffix = options ? `. Valid: ${options.join(", ")}` : "";
|
|
4193
|
-
parts.push(`${
|
|
4271
|
+
parts.push(`${path19}: ${issue.message}${suffix}`);
|
|
4194
4272
|
}
|
|
4195
4273
|
return parts.length > 0 ? `request validation failed: ${parts.join("; ")}` : "request validation failed";
|
|
4196
4274
|
}
|
|
@@ -4332,7 +4410,7 @@ function resolveQueryNamespaceWritablePreflight(caps, params, authenticatedPrinc
|
|
|
4332
4410
|
}
|
|
4333
4411
|
|
|
4334
4412
|
// src/admin/admin-surfaces.ts
|
|
4335
|
-
import
|
|
4413
|
+
import path8 from "path";
|
|
4336
4414
|
var REDACTED = "<redacted>";
|
|
4337
4415
|
var SENSITIVE_KEY_RE = /(token|secret|password|api[_-]?key|bearer|authorization|credential|private[_-]?key)/i;
|
|
4338
4416
|
var BEARER_VALUE_RE = /^(bearer|sk-|pk-|xox[bp]-|AKIA)/i;
|
|
@@ -4605,7 +4683,7 @@ async function auditTranscripts(memoryDir) {
|
|
|
4605
4683
|
movedEntries: file.groups.reduce((sum, group) => sum + group.entryCount, 0),
|
|
4606
4684
|
unmovableLines: file.unmovableLines
|
|
4607
4685
|
}));
|
|
4608
|
-
const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(
|
|
4686
|
+
const mixedOtherDefault = files.some((file) => file.sourceRelPath.split(path8.sep).includes("other"));
|
|
4609
4687
|
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.`;
|
|
4610
4688
|
return {
|
|
4611
4689
|
generatedAt: plan.generatedAt,
|
|
@@ -4744,11 +4822,11 @@ async function promoteMemory(options) {
|
|
|
4744
4822
|
}
|
|
4745
4823
|
|
|
4746
4824
|
// src/procedural/library-maintenance.ts
|
|
4747
|
-
import
|
|
4825
|
+
import path9 from "path";
|
|
4748
4826
|
var MAINTENANCE_ACTOR = "procedure-library-maintenance";
|
|
4749
4827
|
var MAINTENANCE_RULE_VERSION = "procedure-library-maintenance:1";
|
|
4750
4828
|
function maintenanceMarkerPath(memoryDir) {
|
|
4751
|
-
return
|
|
4829
|
+
return path9.join(memoryDir, "state", "procedure-maintenance.json");
|
|
4752
4830
|
}
|
|
4753
4831
|
async function readProcedureMaintenanceMarker(memoryDir) {
|
|
4754
4832
|
try {
|
|
@@ -7668,7 +7746,7 @@ import { createHash as createHash4 } from "crypto";
|
|
|
7668
7746
|
import * as nodePath2 from "path";
|
|
7669
7747
|
|
|
7670
7748
|
// src/orchestration/recall-result-formatter.ts
|
|
7671
|
-
import
|
|
7749
|
+
import path10 from "path";
|
|
7672
7750
|
function renderConnectorLabel(connector) {
|
|
7673
7751
|
if (!isValidConnectorId(connector)) return null;
|
|
7674
7752
|
return connector.length <= CONNECTOR_LABEL_MAX_LENGTH ? connector : `${connector.slice(0, CONNECTOR_LABEL_MAX_LENGTH - 1)}\u2026`;
|
|
@@ -7690,15 +7768,15 @@ function resolveEffectiveIdentityInjectionMode(options) {
|
|
|
7690
7768
|
return { mode: options.configuredMode, shouldInject: true };
|
|
7691
7769
|
}
|
|
7692
7770
|
function displayResultPath(resultPath, memoryDir, namespace) {
|
|
7693
|
-
if (!
|
|
7694
|
-
const root =
|
|
7695
|
-
const nsRoot =
|
|
7696
|
-
if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot +
|
|
7697
|
-
const afterNs =
|
|
7771
|
+
if (!path10.isAbsolute(resultPath)) return resultPath;
|
|
7772
|
+
const root = path10.resolve(memoryDir);
|
|
7773
|
+
const nsRoot = path10.join(root, "namespaces");
|
|
7774
|
+
if (namespace && (resultPath === nsRoot || resultPath.startsWith(nsRoot + path10.sep))) {
|
|
7775
|
+
const afterNs = path10.relative(nsRoot, resultPath).split(path10.sep).slice(1).join("/");
|
|
7698
7776
|
if (afterNs) return `${namespace}/${afterNs}`;
|
|
7699
7777
|
}
|
|
7700
|
-
const rel =
|
|
7701
|
-
return rel && !rel.startsWith("..") && !
|
|
7778
|
+
const rel = path10.relative(root, resultPath);
|
|
7779
|
+
return rel && !rel.startsWith("..") && !path10.isAbsolute(rel) ? rel.split(path10.sep).join("/") : resultPath;
|
|
7702
7780
|
}
|
|
7703
7781
|
function displaySafeRecallSnapshot(snapshot, memoryDir) {
|
|
7704
7782
|
const includedMemories = coerceIncludedMemories(snapshot).map((memory) => ({
|
|
@@ -9163,14 +9241,14 @@ function parseCursorPayload(cursor) {
|
|
|
9163
9241
|
// src/review/review-deck-mutation.ts
|
|
9164
9242
|
import { createHash as createHash6, randomUUID } from "crypto";
|
|
9165
9243
|
import fs3 from "fs";
|
|
9166
|
-
import
|
|
9244
|
+
import path13 from "path";
|
|
9167
9245
|
|
|
9168
9246
|
// src/review/index.ts
|
|
9169
9247
|
import fs from "fs";
|
|
9170
|
-
import
|
|
9248
|
+
import path11 from "path";
|
|
9171
9249
|
var historicalIdCache = new HistoricalEntityCanonicalIdCache();
|
|
9172
9250
|
function writeReviewFileCanonicalized(memoryDir, filePath, content) {
|
|
9173
|
-
const stateDir =
|
|
9251
|
+
const stateDir = path11.join(memoryDir, "state");
|
|
9174
9252
|
const idsAtWrite = historicalIdCache.get(stateDir);
|
|
9175
9253
|
let originalBytes = null;
|
|
9176
9254
|
try {
|
|
@@ -9212,8 +9290,8 @@ function realMemoryRoot(memoryDir) {
|
|
|
9212
9290
|
}
|
|
9213
9291
|
}
|
|
9214
9292
|
function isPathInside(rootReal, candidateReal) {
|
|
9215
|
-
const relative2 =
|
|
9216
|
-
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !
|
|
9293
|
+
const relative2 = path11.relative(rootReal, candidateReal);
|
|
9294
|
+
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path11.isAbsolute(relative2);
|
|
9217
9295
|
}
|
|
9218
9296
|
function isSafeDirectory(rootReal, dir) {
|
|
9219
9297
|
try {
|
|
@@ -9256,7 +9334,7 @@ function listReviewItems(options) {
|
|
|
9256
9334
|
if (filterReason && item.reviewReason !== filterReason) return;
|
|
9257
9335
|
items.push(item);
|
|
9258
9336
|
};
|
|
9259
|
-
const suggestionsDir =
|
|
9337
|
+
const suggestionsDir = path11.join(memoryDir, "suggestions");
|
|
9260
9338
|
if (!isLimitReached() && fs.existsSync(suggestionsDir) && isSafeDirectory(rootReal, suggestionsDir)) {
|
|
9261
9339
|
walkMd(rootReal, suggestionsDir, (filePath, content) => {
|
|
9262
9340
|
if (isLimitReached()) return true;
|
|
@@ -9277,7 +9355,7 @@ function listReviewItems(options) {
|
|
|
9277
9355
|
return isLimitReached();
|
|
9278
9356
|
});
|
|
9279
9357
|
}
|
|
9280
|
-
const reviewDir =
|
|
9358
|
+
const reviewDir = path11.join(memoryDir, "review");
|
|
9281
9359
|
if (!isLimitReached() && fs.existsSync(reviewDir) && isSafeDirectory(rootReal, reviewDir)) {
|
|
9282
9360
|
walkMd(rootReal, reviewDir, (filePath, content) => {
|
|
9283
9361
|
if (isLimitReached()) return true;
|
|
@@ -9302,7 +9380,7 @@ function listReviewItems(options) {
|
|
|
9302
9380
|
const categories = ALL_CATEGORY_DIRS;
|
|
9303
9381
|
for (const category of categories) {
|
|
9304
9382
|
if (isLimitReached()) break;
|
|
9305
|
-
const dir =
|
|
9383
|
+
const dir = path11.join(memoryDir, category);
|
|
9306
9384
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9307
9385
|
walkMd(rootReal, dir, (filePath, content) => {
|
|
9308
9386
|
if (isLimitReached()) return true;
|
|
@@ -9384,9 +9462,9 @@ function approveItem(memoryDir, itemId, options) {
|
|
|
9384
9462
|
const targetDir = getCategoryDir(memoryDir, category);
|
|
9385
9463
|
const dateDir = (/* @__PURE__ */ new Date()).toISOString().split("T")[0];
|
|
9386
9464
|
ensureSafeDirectory(rootReal, targetDir);
|
|
9387
|
-
const outputPath =
|
|
9388
|
-
ensureSafeDirectory(rootReal,
|
|
9389
|
-
const reviewStateDir =
|
|
9465
|
+
const outputPath = path11.join(targetDir, dateDir, path11.basename(found.filePath));
|
|
9466
|
+
ensureSafeDirectory(rootReal, path11.dirname(outputPath));
|
|
9467
|
+
const reviewStateDir = path11.join(memoryDir, "state");
|
|
9390
9468
|
const idsAtWrite = historicalIdCache.get(reviewStateDir);
|
|
9391
9469
|
const promotedWritten = canonicalizeEntityRefFrontmatter(updatedContent, idsAtWrite);
|
|
9392
9470
|
const promotedPath = writeFileWithoutClobber(outputPath, promotedWritten, itemId);
|
|
@@ -9463,13 +9541,13 @@ function findReviewFileById(memoryDir, id, options = {}) {
|
|
|
9463
9541
|
const rootReal = realMemoryRoot(memoryDir);
|
|
9464
9542
|
if (!rootReal) return null;
|
|
9465
9543
|
for (const loc of ["suggestions", "review"]) {
|
|
9466
|
-
const dir =
|
|
9544
|
+
const dir = path11.join(memoryDir, loc);
|
|
9467
9545
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9468
9546
|
const found = findFileById(rootReal, dir, id);
|
|
9469
9547
|
if (found) return { filePath: found, location: "queue" };
|
|
9470
9548
|
}
|
|
9471
9549
|
for (const category of ALL_CATEGORY_DIRS) {
|
|
9472
|
-
const dir =
|
|
9550
|
+
const dir = path11.join(memoryDir, category);
|
|
9473
9551
|
if (!fs.existsSync(dir) || !isSafeDirectory(rootReal, dir)) continue;
|
|
9474
9552
|
const found = findFileById(rootReal, dir, id, (fm) => isLowConfidenceReviewCandidate(fm, options));
|
|
9475
9553
|
if (found) return { filePath: found, location: "category" };
|
|
@@ -9545,10 +9623,10 @@ function readFileSafe(filePath) {
|
|
|
9545
9623
|
}
|
|
9546
9624
|
}
|
|
9547
9625
|
function writeFileWithoutClobber(basePath, content, discriminator) {
|
|
9548
|
-
const parsed =
|
|
9626
|
+
const parsed = path11.parse(basePath);
|
|
9549
9627
|
const safeDiscriminator = sanitizeFilePart(discriminator);
|
|
9550
9628
|
for (let attempt = 0; attempt < 1e3; attempt++) {
|
|
9551
|
-
const candidate = attempt === 0 ? basePath :
|
|
9629
|
+
const candidate = attempt === 0 ? basePath : path11.join(
|
|
9552
9630
|
parsed.dir,
|
|
9553
9631
|
`${parsed.name}-${safeDiscriminator}${attempt === 1 ? "" : `-${attempt}`}${parsed.ext || ".md"}`
|
|
9554
9632
|
);
|
|
@@ -9604,7 +9682,7 @@ function extractBody(content) {
|
|
|
9604
9682
|
function walkMd(rootReal, dir, callback) {
|
|
9605
9683
|
if (!isSafeDirectory(rootReal, dir)) return false;
|
|
9606
9684
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
9607
|
-
const fullPath =
|
|
9685
|
+
const fullPath = path11.join(dir, entry.name);
|
|
9608
9686
|
if (entry.isSymbolicLink()) continue;
|
|
9609
9687
|
if (entry.isDirectory()) {
|
|
9610
9688
|
if (walkMd(rootReal, fullPath, callback)) return true;
|
|
@@ -9619,7 +9697,7 @@ function walkMdPaths(rootReal, dir) {
|
|
|
9619
9697
|
const results = [];
|
|
9620
9698
|
if (!isSafeDirectory(rootReal, dir)) return results;
|
|
9621
9699
|
for (const entry of fs.readdirSync(dir, { withFileTypes: true })) {
|
|
9622
|
-
const fullPath =
|
|
9700
|
+
const fullPath = path11.join(dir, entry.name);
|
|
9623
9701
|
if (entry.isSymbolicLink()) continue;
|
|
9624
9702
|
if (entry.isDirectory()) {
|
|
9625
9703
|
results.push(...walkMdPaths(rootReal, fullPath));
|
|
@@ -9632,7 +9710,7 @@ function walkMdPaths(rootReal, dir) {
|
|
|
9632
9710
|
|
|
9633
9711
|
// src/review/review-deck-snapshot.ts
|
|
9634
9712
|
import fs2 from "fs";
|
|
9635
|
-
import
|
|
9713
|
+
import path12 from "path";
|
|
9636
9714
|
var QUEUE_DIRS = ["suggestions", "review"];
|
|
9637
9715
|
function readReviewDeckSnapshot(opts) {
|
|
9638
9716
|
const corpusVersion = readCorpusVersion(opts.memoryDir);
|
|
@@ -9640,7 +9718,7 @@ function readReviewDeckSnapshot(opts) {
|
|
|
9640
9718
|
if (!rootReal) return { corpusVersion, total: 0, rows: [] };
|
|
9641
9719
|
const rows = [];
|
|
9642
9720
|
for (const location of QUEUE_DIRS) {
|
|
9643
|
-
const dir =
|
|
9721
|
+
const dir = path12.join(opts.memoryDir, location);
|
|
9644
9722
|
if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
|
|
9645
9723
|
walkMd2(rootReal, dir, (filePath, content) => {
|
|
9646
9724
|
const row = rowFromQueueFile(filePath, content, location);
|
|
@@ -9653,7 +9731,7 @@ function readReviewDeckRow(opts) {
|
|
|
9653
9731
|
const rootReal = realMemoryRoot2(opts.memoryDir);
|
|
9654
9732
|
if (!rootReal) return null;
|
|
9655
9733
|
for (const location of QUEUE_DIRS) {
|
|
9656
|
-
const dir =
|
|
9734
|
+
const dir = path12.join(opts.memoryDir, location);
|
|
9657
9735
|
if (!fs2.existsSync(dir) || !isSafeDirectory2(rootReal, dir)) continue;
|
|
9658
9736
|
let found = null;
|
|
9659
9737
|
walkMd2(rootReal, dir, (filePath, content) => {
|
|
@@ -9669,7 +9747,7 @@ function readReviewDeckRow(opts) {
|
|
|
9669
9747
|
}
|
|
9670
9748
|
function readCorpusVersion(memoryDir) {
|
|
9671
9749
|
try {
|
|
9672
|
-
return String(fs2.statSync(
|
|
9750
|
+
return String(fs2.statSync(path12.join(memoryDir, "state", MEMORY_CORPUS_VERSION_SENTINEL)).size);
|
|
9673
9751
|
} catch {
|
|
9674
9752
|
return "0";
|
|
9675
9753
|
}
|
|
@@ -9719,8 +9797,8 @@ function realMemoryRoot2(memoryDir) {
|
|
|
9719
9797
|
}
|
|
9720
9798
|
}
|
|
9721
9799
|
function isPathInside2(rootReal, candidateReal) {
|
|
9722
|
-
const relative2 =
|
|
9723
|
-
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !
|
|
9800
|
+
const relative2 = path12.relative(rootReal, candidateReal);
|
|
9801
|
+
return relative2 === "" || !!relative2 && !relative2.startsWith("..") && !path12.isAbsolute(relative2);
|
|
9724
9802
|
}
|
|
9725
9803
|
function isSafeDirectory2(rootReal, dir) {
|
|
9726
9804
|
try {
|
|
@@ -9734,7 +9812,7 @@ function isSafeDirectory2(rootReal, dir) {
|
|
|
9734
9812
|
function walkMd2(rootReal, dir, callback) {
|
|
9735
9813
|
if (!isSafeDirectory2(rootReal, dir)) return false;
|
|
9736
9814
|
for (const entry of fs2.readdirSync(dir, { withFileTypes: true })) {
|
|
9737
|
-
const fullPath =
|
|
9815
|
+
const fullPath = path12.join(dir, entry.name);
|
|
9738
9816
|
if (entry.isSymbolicLink()) continue;
|
|
9739
9817
|
if (entry.isDirectory()) {
|
|
9740
9818
|
if (walkMd2(rootReal, fullPath, callback)) return true;
|
|
@@ -9849,7 +9927,7 @@ function parseReviewLifecycleReceipt(value) {
|
|
|
9849
9927
|
if (!isReceiptAction(rec.action)) return null;
|
|
9850
9928
|
if (typeof rec.beforeRevision !== "string") return null;
|
|
9851
9929
|
if (typeof rec.afterRevision !== "string") return null;
|
|
9852
|
-
if (!isNonEmptyString(rec.sourcePath) ||
|
|
9930
|
+
if (!isNonEmptyString(rec.sourcePath) || path13.isAbsolute(rec.sourcePath)) return null;
|
|
9853
9931
|
if (rec.revisionArtifact !== void 0 && typeof rec.revisionArtifact !== "string") return null;
|
|
9854
9932
|
if (rec.undoOfReceiptId !== void 0 && typeof rec.undoOfReceiptId !== "string") return null;
|
|
9855
9933
|
const parsed = {
|
|
@@ -9881,11 +9959,11 @@ function findStoredReceipt(events, receiptId) {
|
|
|
9881
9959
|
return null;
|
|
9882
9960
|
}
|
|
9883
9961
|
function resolveInside(memoryDir, rel) {
|
|
9884
|
-
if (!rel ||
|
|
9885
|
-
const root =
|
|
9886
|
-
const abs =
|
|
9887
|
-
const next =
|
|
9888
|
-
if (next.startsWith("..") ||
|
|
9962
|
+
if (!rel || path13.isAbsolute(rel)) return null;
|
|
9963
|
+
const root = path13.resolve(memoryDir);
|
|
9964
|
+
const abs = path13.resolve(root, rel.split("/").join(path13.sep));
|
|
9965
|
+
const next = path13.relative(root, abs);
|
|
9966
|
+
if (next.startsWith("..") || path13.isAbsolute(next)) return null;
|
|
9889
9967
|
return abs;
|
|
9890
9968
|
}
|
|
9891
9969
|
function currentRevision(absPath) {
|
|
@@ -10548,14 +10626,14 @@ async function completeSupportPassportReplacementPrior(input) {
|
|
|
10548
10626
|
}
|
|
10549
10627
|
|
|
10550
10628
|
// src/support-passport/generated-batch.ts
|
|
10551
|
-
import
|
|
10629
|
+
import path15 from "path";
|
|
10552
10630
|
import { z as z2 } from "zod";
|
|
10553
10631
|
|
|
10554
10632
|
// src/support-passport/private-file.ts
|
|
10555
10633
|
import { randomUUID as randomUUID2 } from "crypto";
|
|
10556
10634
|
import { constants as fsConstants } from "fs";
|
|
10557
10635
|
import { lstat as lstat2, mkdir as mkdir3, open, rename as rename2, rm as rm2, stat as stat2 } from "fs/promises";
|
|
10558
|
-
import
|
|
10636
|
+
import path14 from "path";
|
|
10559
10637
|
var UNSUPPORTED_DIRECTORY_SYNC_ERRORS = /* @__PURE__ */ new Set(["EINVAL", "ENOSYS", "ENOTSUP", "EOPNOTSUPP"]);
|
|
10560
10638
|
var NON_WRITABLE_ANCESTOR_SYNC_ERRORS = /* @__PURE__ */ new Set(["EROFS", "EPERM", "EACCES"]);
|
|
10561
10639
|
function assertStableDirectory(before, opened, after, errorMessage) {
|
|
@@ -10581,8 +10659,8 @@ function openFlags(...flags) {
|
|
|
10581
10659
|
return combined;
|
|
10582
10660
|
}
|
|
10583
10661
|
function assertContainedPath(trustedRoot, directory, errorMessage) {
|
|
10584
|
-
const relative2 =
|
|
10585
|
-
if (relative2 === ".." || relative2.startsWith(`..${
|
|
10662
|
+
const relative2 = path14.relative(path14.resolve(trustedRoot), path14.resolve(directory));
|
|
10663
|
+
if (relative2 === ".." || relative2.startsWith(`..${path14.sep}`) || path14.isAbsolute(relative2)) {
|
|
10586
10664
|
throw new Error(errorMessage);
|
|
10587
10665
|
}
|
|
10588
10666
|
}
|
|
@@ -10615,7 +10693,7 @@ async function syncDirectoryHandle(handle) {
|
|
|
10615
10693
|
}
|
|
10616
10694
|
async function resolvePrivateDirectoryPath(directory, handle, opened, errorMessage, platform = process.platform) {
|
|
10617
10695
|
const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10618
|
-
const pinnedPath =
|
|
10696
|
+
const pinnedPath = path14.join(descriptorRoot, String(handle.fd));
|
|
10619
10697
|
const metadata = await stat2(pinnedPath);
|
|
10620
10698
|
if (!metadata.isDirectory() || metadata.dev !== opened.dev || metadata.ino !== opened.ino) {
|
|
10621
10699
|
throw new Error(errorMessage);
|
|
@@ -10631,12 +10709,12 @@ function requirePrivateFileDescriptorRoot(platform, errorMessage) {
|
|
|
10631
10709
|
throw new Error(errorMessage);
|
|
10632
10710
|
}
|
|
10633
10711
|
async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform = process.platform) {
|
|
10634
|
-
const root =
|
|
10635
|
-
const target =
|
|
10712
|
+
const root = path14.resolve(trustedRoot);
|
|
10713
|
+
const target = path14.resolve(directory);
|
|
10636
10714
|
assertContainedPath(root, target, errorMessage);
|
|
10637
10715
|
requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10638
|
-
const relative2 =
|
|
10639
|
-
const components = relative2 === "" ? [] : relative2.split(
|
|
10716
|
+
const relative2 = path14.relative(root, target);
|
|
10717
|
+
const components = relative2 === "" ? [] : relative2.split(path14.sep);
|
|
10640
10718
|
const handles = [];
|
|
10641
10719
|
let currentPath = root;
|
|
10642
10720
|
try {
|
|
@@ -10644,10 +10722,10 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
|
|
|
10644
10722
|
handles.push(current.handle);
|
|
10645
10723
|
for (const component of components) {
|
|
10646
10724
|
const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
|
|
10647
|
-
const child = await openDirectoryNoFollow(
|
|
10725
|
+
const child = await openDirectoryNoFollow(path14.join(pinnedParent, component), errorMessage);
|
|
10648
10726
|
handles.push(child.handle);
|
|
10649
10727
|
assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
|
|
10650
|
-
currentPath =
|
|
10728
|
+
currentPath = path14.join(currentPath, component);
|
|
10651
10729
|
current = child;
|
|
10652
10730
|
}
|
|
10653
10731
|
assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
|
|
@@ -10668,12 +10746,12 @@ async function openStableDirectoryFromRoot(trustedRoot, directory, errorMessage,
|
|
|
10668
10746
|
}
|
|
10669
10747
|
}
|
|
10670
10748
|
async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, hardenExistingChildren = true, platform = process.platform) {
|
|
10671
|
-
const root =
|
|
10672
|
-
const target =
|
|
10749
|
+
const root = path14.resolve(trustedRoot);
|
|
10750
|
+
const target = path14.resolve(directory);
|
|
10673
10751
|
assertContainedPath(root, target, errorMessage);
|
|
10674
|
-
const relative2 =
|
|
10752
|
+
const relative2 = path14.relative(root, target);
|
|
10675
10753
|
requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10676
|
-
const components = relative2 === "" ? [] : relative2.split(
|
|
10754
|
+
const components = relative2 === "" ? [] : relative2.split(path14.sep);
|
|
10677
10755
|
const handles = [];
|
|
10678
10756
|
let currentPath = root;
|
|
10679
10757
|
try {
|
|
@@ -10681,7 +10759,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10681
10759
|
handles.push(current.handle);
|
|
10682
10760
|
for (const component of components) {
|
|
10683
10761
|
const pinnedParent = await resolvePrivateDirectoryPath(currentPath, current.handle, current.opened, errorMessage);
|
|
10684
|
-
const childPath =
|
|
10762
|
+
const childPath = path14.join(pinnedParent, component);
|
|
10685
10763
|
let created = false;
|
|
10686
10764
|
try {
|
|
10687
10765
|
await mkdir3(childPath, { mode: 448 });
|
|
@@ -10696,7 +10774,7 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10696
10774
|
await child.handle.chmod(448);
|
|
10697
10775
|
}
|
|
10698
10776
|
assertStableDirectory(current.before, current.opened, await lstat2(currentPath), errorMessage);
|
|
10699
|
-
currentPath =
|
|
10777
|
+
currentPath = path14.join(currentPath, component);
|
|
10700
10778
|
current = child;
|
|
10701
10779
|
}
|
|
10702
10780
|
assertStableDirectory(current.before, current.opened, await lstat2(target), errorMessage);
|
|
@@ -10705,8 +10783,8 @@ async function ensurePrivateDirectoryNoFollow(trustedRoot, directory, errorMessa
|
|
|
10705
10783
|
}
|
|
10706
10784
|
}
|
|
10707
10785
|
async function ensurePrivateDirectoryTreeNoFollow(directory, errorMessage, syncVerifiedParent = syncDirectoryHandle, platform = process.platform) {
|
|
10708
|
-
const target =
|
|
10709
|
-
const filesystemRoot =
|
|
10786
|
+
const target = path14.resolve(directory);
|
|
10787
|
+
const filesystemRoot = path14.parse(target).root;
|
|
10710
10788
|
const rootMetadata = await stat2(filesystemRoot);
|
|
10711
10789
|
await ensurePrivateDirectoryNoFollow(
|
|
10712
10790
|
filesystemRoot,
|
|
@@ -10741,15 +10819,15 @@ async function withPrivateDirectoryNoFollow(trustedRoot, directory, errorMessage
|
|
|
10741
10819
|
}
|
|
10742
10820
|
}
|
|
10743
10821
|
async function readPrivateFileNoFollow(directory, filePath, errorMessage, trustedRoot = directory, platform = process.platform) {
|
|
10744
|
-
if (
|
|
10745
|
-
const targetName =
|
|
10822
|
+
if (path14.dirname(filePath) !== path14.resolve(directory)) throw new Error(errorMessage);
|
|
10823
|
+
const targetName = path14.basename(filePath);
|
|
10746
10824
|
let directoryHandles = [];
|
|
10747
10825
|
let fileHandle;
|
|
10748
10826
|
try {
|
|
10749
10827
|
const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
|
|
10750
10828
|
directoryHandles = stableDirectory.handles;
|
|
10751
10829
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10752
|
-
const targetPath =
|
|
10830
|
+
const targetPath = path14.join(pinnedDirectory, targetName);
|
|
10753
10831
|
const before = await lstat2(targetPath);
|
|
10754
10832
|
if (before.isSymbolicLink() || !before.isFile()) throw new Error(errorMessage);
|
|
10755
10833
|
try {
|
|
@@ -10768,10 +10846,10 @@ async function readPrivateFileNoFollow(directory, filePath, errorMessage, truste
|
|
|
10768
10846
|
}
|
|
10769
10847
|
}
|
|
10770
10848
|
async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, content, errorMessage, directoryHandle, openFile) {
|
|
10771
|
-
if (targetName.length === 0 || targetName === "." || targetName === ".." ||
|
|
10849
|
+
if (targetName.length === 0 || targetName === "." || targetName === ".." || path14.basename(targetName) !== targetName) {
|
|
10772
10850
|
throw new Error(errorMessage);
|
|
10773
10851
|
}
|
|
10774
|
-
const targetPath =
|
|
10852
|
+
const targetPath = path14.join(pinnedDirectory, targetName);
|
|
10775
10853
|
let fileHandle;
|
|
10776
10854
|
try {
|
|
10777
10855
|
try {
|
|
@@ -10807,8 +10885,8 @@ async function appendPrivateFileAtPinnedDirectory(pinnedDirectory, targetName, c
|
|
|
10807
10885
|
}
|
|
10808
10886
|
async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, content, errorMessage, platform = process.platform) {
|
|
10809
10887
|
const descriptorRoot = requirePrivateFileDescriptorRoot(platform, errorMessage);
|
|
10810
|
-
const resolvedDirectory =
|
|
10811
|
-
const descriptor =
|
|
10888
|
+
const resolvedDirectory = path14.resolve(pinnedDirectory);
|
|
10889
|
+
const descriptor = path14.relative(descriptorRoot, resolvedDirectory);
|
|
10812
10890
|
if (!/^\d+$/.test(descriptor)) throw new Error(errorMessage);
|
|
10813
10891
|
const before = await stat2(resolvedDirectory);
|
|
10814
10892
|
if (!before.isDirectory()) throw new Error(errorMessage);
|
|
@@ -10824,8 +10902,8 @@ async function appendPrivateFileInPinnedDirectory(pinnedDirectory, fileName, con
|
|
|
10824
10902
|
}
|
|
10825
10903
|
}
|
|
10826
10904
|
async function writePrivateFileAtomicallyNoFollow(directory, filePath, content, errorMessage, trustedRoot = directory, platform = process.platform, syncVerifiedDirectory = syncDirectoryHandle) {
|
|
10827
|
-
if (
|
|
10828
|
-
const targetName =
|
|
10905
|
+
if (path14.dirname(filePath) !== path14.resolve(directory)) throw new Error(errorMessage);
|
|
10906
|
+
const targetName = path14.basename(filePath);
|
|
10829
10907
|
const tempName = `.${targetName}.${randomUUID2()}.tmp`;
|
|
10830
10908
|
let tempPath;
|
|
10831
10909
|
let directoryHandles = [];
|
|
@@ -10834,8 +10912,8 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
|
|
|
10834
10912
|
const stableDirectory = await openStableDirectoryFromRoot(trustedRoot, directory, errorMessage, platform);
|
|
10835
10913
|
directoryHandles = stableDirectory.handles;
|
|
10836
10914
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10837
|
-
tempPath =
|
|
10838
|
-
const targetPath =
|
|
10915
|
+
tempPath = path14.join(pinnedDirectory, tempName);
|
|
10916
|
+
const targetPath = path14.join(pinnedDirectory, targetName);
|
|
10839
10917
|
try {
|
|
10840
10918
|
fileHandle = await open(
|
|
10841
10919
|
tempPath,
|
|
@@ -10872,7 +10950,7 @@ async function writePrivateFileAtomicallyNoFollow(directory, filePath, content,
|
|
|
10872
10950
|
}
|
|
10873
10951
|
async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, trustedRoot = directory, platform = process.platform) {
|
|
10874
10952
|
if (fileNames.some(
|
|
10875
|
-
(fileName) => fileName.length === 0 || fileName === "." || fileName === ".." ||
|
|
10953
|
+
(fileName) => fileName.length === 0 || fileName === "." || fileName === ".." || path14.basename(fileName) !== fileName
|
|
10876
10954
|
)) {
|
|
10877
10955
|
throw new Error(errorMessage);
|
|
10878
10956
|
}
|
|
@@ -10882,7 +10960,7 @@ async function removePrivateFilesNoFollow(directory, fileNames, errorMessage, tr
|
|
|
10882
10960
|
directoryHandles = stableDirectory.handles;
|
|
10883
10961
|
const pinnedDirectory = stableDirectory.pinnedDirectory;
|
|
10884
10962
|
for (const fileName of fileNames) {
|
|
10885
|
-
await rm2(
|
|
10963
|
+
await rm2(path14.join(pinnedDirectory, fileName), { force: true });
|
|
10886
10964
|
}
|
|
10887
10965
|
assertStableDirectory(stableDirectory.before, stableDirectory.opened, await lstat2(directory), errorMessage);
|
|
10888
10966
|
if (stableDirectory.handle) await syncDirectoryHandle(stableDirectory.handle);
|
|
@@ -10903,13 +10981,13 @@ var GeneratedBatchMarkerSchema = z2.object({
|
|
|
10903
10981
|
}).strict();
|
|
10904
10982
|
var BATCH_ERROR = "The generated draft batch state is not safe.";
|
|
10905
10983
|
function batchDirectory(storage) {
|
|
10906
|
-
return
|
|
10984
|
+
return path15.join(storage.dir, "state", "support-passport", "generated-batches");
|
|
10907
10985
|
}
|
|
10908
10986
|
function batchFileName(batchId) {
|
|
10909
10987
|
return `${BatchIdSchema.parse(batchId)}.json`;
|
|
10910
10988
|
}
|
|
10911
10989
|
function batchPath(storage, batchId) {
|
|
10912
|
-
return
|
|
10990
|
+
return path15.join(batchDirectory(storage), batchFileName(batchId));
|
|
10913
10991
|
}
|
|
10914
10992
|
function markerFor(context, batchId, size, complete) {
|
|
10915
10993
|
return GeneratedBatchMarkerSchema.parse({
|
|
@@ -11334,7 +11412,7 @@ var SupportPassportAnswerModelInputSchema = z4.object({
|
|
|
11334
11412
|
|
|
11335
11413
|
// src/support-passport/owner-lock.ts
|
|
11336
11414
|
import { createHash as createHash8 } from "crypto";
|
|
11337
|
-
import
|
|
11415
|
+
import path16 from "path";
|
|
11338
11416
|
var CARD_MUTATION_LOCK_STALE_MS = 6e4;
|
|
11339
11417
|
var CARD_MUTATION_LOCK_MAX_WAIT_MS = 3e4;
|
|
11340
11418
|
function computeSupportPassportOwnerLockKey(namespace, principal) {
|
|
@@ -11345,7 +11423,7 @@ function supportPassportOwnerLockPath(storage, scope) {
|
|
|
11345
11423
|
if (!/^[a-f0-9]{64}$/.test(ownerLockKey)) {
|
|
11346
11424
|
throw new SupportPassportError("card_data_invalid", "The support passport owner scope is invalid.", 500);
|
|
11347
11425
|
}
|
|
11348
|
-
return
|
|
11426
|
+
return path16.join(storage.dir, "state", `support-passport-cards-${ownerLockKey}.lock`);
|
|
11349
11427
|
}
|
|
11350
11428
|
async function withSupportPassportOwnerLock(storage, scope, task) {
|
|
11351
11429
|
const lockPath = supportPassportOwnerLockPath(storage, scope);
|
|
@@ -12243,7 +12321,7 @@ var SupportPassportCardService = class {
|
|
|
12243
12321
|
// src/support-passport/grant-store.ts
|
|
12244
12322
|
import { createHash as createHash9, randomBytes, randomUUID as randomUUID4, timingSafeEqual } from "crypto";
|
|
12245
12323
|
import { lstat as lstat3, open as open2, readdir as readdir3 } from "fs/promises";
|
|
12246
|
-
import
|
|
12324
|
+
import path17 from "path";
|
|
12247
12325
|
var GRANT_LOCK_STALE_MS = 3e4;
|
|
12248
12326
|
var GRANT_LOCK_WAIT_MS = 5e3;
|
|
12249
12327
|
var GRANT_LOCK_HEARTBEAT_MS = 1e4;
|
|
@@ -12335,9 +12413,9 @@ var SupportPassportGrantStore = class {
|
|
|
12335
12413
|
runWithHeldFileLock;
|
|
12336
12414
|
syncDirectory;
|
|
12337
12415
|
constructor(options) {
|
|
12338
|
-
this.memoryDir =
|
|
12339
|
-
this.grantsDir =
|
|
12340
|
-
this.ownerIndexesDir =
|
|
12416
|
+
this.memoryDir = path17.resolve(expandTildePath(options.memoryDir));
|
|
12417
|
+
this.grantsDir = path17.join(this.memoryDir, "state", "support-passport", "grants");
|
|
12418
|
+
this.ownerIndexesDir = path17.join(this.grantsDir, "owners");
|
|
12341
12419
|
this.now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
12342
12420
|
this.makeSecret = options.makeSecret ?? (() => randomBytes(32));
|
|
12343
12421
|
this.makeGrantId = options.makeGrantId ?? randomUUID4;
|
|
@@ -12550,11 +12628,11 @@ var SupportPassportGrantStore = class {
|
|
|
12550
12628
|
}
|
|
12551
12629
|
filePath(grantId) {
|
|
12552
12630
|
const normalizedGrantId = normalizeGrantId(grantId);
|
|
12553
|
-
return
|
|
12631
|
+
return path17.join(this.grantsDir, `${normalizedGrantId}.json`);
|
|
12554
12632
|
}
|
|
12555
12633
|
ownerIndexPath(ownerHash) {
|
|
12556
12634
|
if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
|
|
12557
|
-
return
|
|
12635
|
+
return path17.join(this.ownerIndexesDir, `${ownerHash}.json`);
|
|
12558
12636
|
}
|
|
12559
12637
|
ownerHash(namespace, principalHash) {
|
|
12560
12638
|
return sha256("support-passport-owner-index:v1", `${namespace}\0${principalHash}`);
|
|
@@ -12610,12 +12688,12 @@ var SupportPassportGrantStore = class {
|
|
|
12610
12688
|
this.grantsDir,
|
|
12611
12689
|
grantIds.map((grantId) => `${grantId}.json`),
|
|
12612
12690
|
"support passport grant files must be regular files in a stable directory",
|
|
12613
|
-
|
|
12691
|
+
path17.parse(this.memoryDir).root
|
|
12614
12692
|
);
|
|
12615
12693
|
}
|
|
12616
12694
|
ownerMembershipDirectory(ownerHash) {
|
|
12617
12695
|
if (!SAFE_OWNER_INDEX_HASH.test(ownerHash)) throw new Error("support passport owner index hash is invalid");
|
|
12618
|
-
return
|
|
12696
|
+
return path17.join(this.ownerIndexesDir, ownerHash);
|
|
12619
12697
|
}
|
|
12620
12698
|
async ensureOwnerMembershipDirectory(ownerHash) {
|
|
12621
12699
|
const directory = this.ownerMembershipDirectory(ownerHash);
|
|
@@ -12630,11 +12708,11 @@ var SupportPassportGrantStore = class {
|
|
|
12630
12708
|
const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
|
|
12631
12709
|
await writePrivateFileAtomicallyNoFollow(
|
|
12632
12710
|
directory,
|
|
12633
|
-
|
|
12711
|
+
path17.join(directory, `${state.grantId}.json`),
|
|
12634
12712
|
`${JSON.stringify({ schemaVersion: 1, grantId: state.grantId })}
|
|
12635
12713
|
`,
|
|
12636
12714
|
"support passport owner membership must be regular files in a stable directory",
|
|
12637
|
-
|
|
12715
|
+
path17.parse(this.memoryDir).root
|
|
12638
12716
|
);
|
|
12639
12717
|
}
|
|
12640
12718
|
async removeOwnerMembership(state) {
|
|
@@ -12644,7 +12722,7 @@ var SupportPassportGrantStore = class {
|
|
|
12644
12722
|
directory,
|
|
12645
12723
|
[`${state.grantId}.json`],
|
|
12646
12724
|
"support passport owner membership must be regular files in a stable directory",
|
|
12647
|
-
|
|
12725
|
+
path17.parse(this.memoryDir).root
|
|
12648
12726
|
);
|
|
12649
12727
|
}
|
|
12650
12728
|
async removeStoredGrant(state) {
|
|
@@ -12745,7 +12823,7 @@ var SupportPassportGrantStore = class {
|
|
|
12745
12823
|
const ownerHash = this.ownerHash(namespace, principalHash);
|
|
12746
12824
|
const directory = await this.ensureOwnerMembershipDirectory(ownerHash);
|
|
12747
12825
|
const grantIds = await withPrivateDirectoryNoFollow(
|
|
12748
|
-
|
|
12826
|
+
path17.parse(this.memoryDir).root,
|
|
12749
12827
|
directory,
|
|
12750
12828
|
"support passport owner membership must be regular files in a stable directory",
|
|
12751
12829
|
async (pinnedDirectory) => {
|
|
@@ -12776,7 +12854,7 @@ var SupportPassportGrantStore = class {
|
|
|
12776
12854
|
this.ownerIndexesDir,
|
|
12777
12855
|
filePath,
|
|
12778
12856
|
"support passport owner indexes must be regular files in a stable directory",
|
|
12779
|
-
|
|
12857
|
+
path17.parse(this.memoryDir).root
|
|
12780
12858
|
);
|
|
12781
12859
|
} catch (error) {
|
|
12782
12860
|
if (error.code === "ENOENT") return [];
|
|
@@ -12816,7 +12894,7 @@ var SupportPassportGrantStore = class {
|
|
|
12816
12894
|
`${JSON.stringify({ schemaVersion: 1, ownerHash, grantIds }, null, 2)}
|
|
12817
12895
|
`,
|
|
12818
12896
|
"support passport owner indexes must be regular files in a stable directory",
|
|
12819
|
-
|
|
12897
|
+
path17.parse(this.memoryDir).root
|
|
12820
12898
|
);
|
|
12821
12899
|
}
|
|
12822
12900
|
async readState(grantId) {
|
|
@@ -12826,7 +12904,7 @@ var SupportPassportGrantStore = class {
|
|
|
12826
12904
|
this.grantsDir,
|
|
12827
12905
|
filePath,
|
|
12828
12906
|
"support passport grant files must be regular files in a stable directory",
|
|
12829
|
-
|
|
12907
|
+
path17.parse(this.memoryDir).root
|
|
12830
12908
|
);
|
|
12831
12909
|
try {
|
|
12832
12910
|
const state = SupportPassportGrantStateSchema.parse(JSON.parse(content));
|
|
@@ -12860,7 +12938,7 @@ var SupportPassportGrantStore = class {
|
|
|
12860
12938
|
`${JSON.stringify(state, null, 2)}
|
|
12861
12939
|
`,
|
|
12862
12940
|
"support passport grant files must be regular files in a stable directory",
|
|
12863
|
-
|
|
12941
|
+
path17.parse(this.memoryDir).root
|
|
12864
12942
|
);
|
|
12865
12943
|
}
|
|
12866
12944
|
async ensureSafeDirectories() {
|
|
@@ -12894,8 +12972,8 @@ var SupportPassportGrantStore = class {
|
|
|
12894
12972
|
void 0
|
|
12895
12973
|
);
|
|
12896
12974
|
this.memoryDir = configuredMemoryDir;
|
|
12897
|
-
this.grantsDir =
|
|
12898
|
-
this.ownerIndexesDir =
|
|
12975
|
+
this.grantsDir = path17.join(configuredMemoryDir, "state", "support-passport", "grants");
|
|
12976
|
+
this.ownerIndexesDir = path17.join(this.grantsDir, "owners");
|
|
12899
12977
|
})();
|
|
12900
12978
|
}
|
|
12901
12979
|
const currentAttempt = this.memoryRootReady;
|
|
@@ -12909,12 +12987,12 @@ var SupportPassportGrantStore = class {
|
|
|
12909
12987
|
async withMutationLock(task) {
|
|
12910
12988
|
await this.ensureSafeDirectories();
|
|
12911
12989
|
return await withPrivateDirectoryNoFollow(
|
|
12912
|
-
|
|
12990
|
+
path17.parse(this.memoryDir).root,
|
|
12913
12991
|
this.grantsDir,
|
|
12914
12992
|
"support passport grant lock directory must remain inside the memory directory",
|
|
12915
12993
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12916
12994
|
`support-passport-grants:${this.grantsDir}`,
|
|
12917
|
-
|
|
12995
|
+
path17.join(pinnedDirectory, ".grants.lock"),
|
|
12918
12996
|
task
|
|
12919
12997
|
)
|
|
12920
12998
|
);
|
|
@@ -12923,12 +13001,12 @@ var SupportPassportGrantStore = class {
|
|
|
12923
13001
|
const normalizedGrantId = normalizeGrantId(grantId);
|
|
12924
13002
|
await this.ensureSafeDirectories();
|
|
12925
13003
|
return await withPrivateDirectoryNoFollow(
|
|
12926
|
-
|
|
13004
|
+
path17.parse(this.memoryDir).root,
|
|
12927
13005
|
this.grantsDir,
|
|
12928
13006
|
"support passport grant lock directory must remain inside the memory directory",
|
|
12929
13007
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12930
13008
|
`support-passport-grant:${this.grantsDir}:${normalizedGrantId}`,
|
|
12931
|
-
|
|
13009
|
+
path17.join(pinnedDirectory, `.${normalizedGrantId}.lock`),
|
|
12932
13010
|
task
|
|
12933
13011
|
)
|
|
12934
13012
|
);
|
|
@@ -12936,12 +13014,12 @@ var SupportPassportGrantStore = class {
|
|
|
12936
13014
|
async withOwnerIndexLock(ownerHash, task) {
|
|
12937
13015
|
await this.ensureSafeDirectories();
|
|
12938
13016
|
return await withPrivateDirectoryNoFollow(
|
|
12939
|
-
|
|
13017
|
+
path17.parse(this.memoryDir).root,
|
|
12940
13018
|
this.ownerIndexesDir,
|
|
12941
13019
|
"support passport owner lock directory must remain inside the memory directory",
|
|
12942
13020
|
async (pinnedDirectory) => await this.withExclusiveLock(
|
|
12943
13021
|
`support-passport-owner:${this.ownerIndexesDir}:${ownerHash}`,
|
|
12944
|
-
|
|
13022
|
+
path17.join(pinnedDirectory, `.${ownerHash}.lock`),
|
|
12945
13023
|
task
|
|
12946
13024
|
)
|
|
12947
13025
|
);
|
|
@@ -13779,7 +13857,7 @@ var SupportPassportModelAdapter = class {
|
|
|
13779
13857
|
|
|
13780
13858
|
// src/support-passport/model-audit.ts
|
|
13781
13859
|
import { createHash as createHash10 } from "crypto";
|
|
13782
|
-
import
|
|
13860
|
+
import path18 from "path";
|
|
13783
13861
|
import { z as z5 } from "zod";
|
|
13784
13862
|
var HashSchema = z5.string().regex(/^[a-f0-9]{64}$/);
|
|
13785
13863
|
var SupportPassportModelAuditRecordSchema = z5.object({
|
|
@@ -13824,15 +13902,15 @@ var SupportPassportModelAuditStore = class {
|
|
|
13824
13902
|
memoryRootReady;
|
|
13825
13903
|
runWithHeldFileLock;
|
|
13826
13904
|
constructor(options) {
|
|
13827
|
-
this.memoryDir =
|
|
13828
|
-
this.auditDir =
|
|
13905
|
+
this.memoryDir = path18.resolve(expandTildePath(options.memoryDir));
|
|
13906
|
+
this.auditDir = path18.join(this.memoryDir, "state", "support-passport", "audit");
|
|
13829
13907
|
this.runWithHeldFileLock = options.withHeldFileLock ?? withHeldFileLock;
|
|
13830
13908
|
}
|
|
13831
13909
|
async record(input) {
|
|
13832
13910
|
const record = SupportPassportModelAuditRecordSchema.parse(input);
|
|
13833
13911
|
await this.ensureSafeDirectories();
|
|
13834
13912
|
const day = record.occurredAt.slice(0, 10);
|
|
13835
|
-
const filePath =
|
|
13913
|
+
const filePath = path18.join(this.auditDir, `${day}.jsonl`);
|
|
13836
13914
|
await serializeMutations(
|
|
13837
13915
|
`support-passport-audit:${filePath}`,
|
|
13838
13916
|
() => withPrivateDirectoryNoFollow(
|
|
@@ -13840,7 +13918,7 @@ var SupportPassportModelAuditStore = class {
|
|
|
13840
13918
|
this.auditDir,
|
|
13841
13919
|
"support passport audit directory must remain inside the memory directory",
|
|
13842
13920
|
async (pinnedDirectory) => await this.runWithHeldFileLock(
|
|
13843
|
-
|
|
13921
|
+
path18.join(pinnedDirectory, `.${day}.lock`),
|
|
13844
13922
|
{
|
|
13845
13923
|
staleMs: 3e4,
|
|
13846
13924
|
maxWaitMs: 5e3,
|
|
@@ -13877,7 +13955,7 @@ var SupportPassportModelAuditStore = class {
|
|
|
13877
13955
|
"support passport memory directory must be a stable directory"
|
|
13878
13956
|
);
|
|
13879
13957
|
this.memoryDir = configuredMemoryDir;
|
|
13880
|
-
this.auditDir =
|
|
13958
|
+
this.auditDir = path18.join(configuredMemoryDir, "state", "support-passport", "audit");
|
|
13881
13959
|
})();
|
|
13882
13960
|
}
|
|
13883
13961
|
const currentAttempt = this.memoryRootReady;
|
|
@@ -17425,7 +17503,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
17425
17503
|
const resolvedNamespace = this.resolveReadableNamespace(options.namespace, options.principal);
|
|
17426
17504
|
const storage = await offlineSyncStorageForSnapshot(this.orchestrator, resolvedNamespace);
|
|
17427
17505
|
const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
17428
|
-
const deletions = [...await storage.readDeletionRevisions()].map(([
|
|
17506
|
+
const deletions = [...await storage.readDeletionRevisions()].map(([path19, mtimeMs]) => ({ path: path19, mtimeMs }));
|
|
17429
17507
|
const snapshotBuilder = options.includeContent === false && options.baseFiles && options.baseFiles.length > 0 ? buildOfflineSyncSnapshotFromBase : buildOfflineSyncSnapshot;
|
|
17430
17508
|
const snapshot = await snapshotBuilder({
|
|
17431
17509
|
root: storage.dir,
|
|
@@ -17451,7 +17529,7 @@ var EngramAccessService = class extends SupportPassportAccessServiceBase {
|
|
|
17451
17529
|
const storageHash = createHash12("sha256").update(storage.dir).digest("hex").slice(0, 16);
|
|
17452
17530
|
const deletions = await filterOfflineSyncDeletionRevisions({
|
|
17453
17531
|
root: storage.dir,
|
|
17454
|
-
deletions: [...await storage.readDeletionRevisions()].map(([
|
|
17532
|
+
deletions: [...await storage.readDeletionRevisions()].map(([path19, mtimeMs]) => ({ path: path19, mtimeMs })),
|
|
17455
17533
|
includeTranscripts: options.includeTranscripts !== false,
|
|
17456
17534
|
userExcludeRegexps: this.offlineSyncUserExcludes
|
|
17457
17535
|
});
|
|
@@ -18073,6 +18151,12 @@ export {
|
|
|
18073
18151
|
CorrectionContractError,
|
|
18074
18152
|
detectPassiveCorrections,
|
|
18075
18153
|
capturePassiveCorrections,
|
|
18154
|
+
JOURNAL_DIR_NAME,
|
|
18155
|
+
journalPath,
|
|
18156
|
+
isJournalDayPath,
|
|
18157
|
+
todayJournalDate,
|
|
18158
|
+
writeJournalFile,
|
|
18159
|
+
seedJournal,
|
|
18076
18160
|
isTopLevelArchivePath,
|
|
18077
18161
|
isGenericRecallExcludedPath,
|
|
18078
18162
|
filterRecallCandidates,
|
|
@@ -18164,4 +18248,4 @@ export {
|
|
|
18164
18248
|
EngramAccessService,
|
|
18165
18249
|
AccessAdminOpsSurface
|
|
18166
18250
|
};
|
|
18167
|
-
//# sourceMappingURL=chunk-
|
|
18251
|
+
//# sourceMappingURL=chunk-B4B3QDV3.js.map
|