@remnic/core 9.65.6 → 9.65.7
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 +111 -106
- 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 +13 -18
- package/dist/access-http.js +50 -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-output-schemas.js +1 -1
- package/dist/access-mcp.d.ts +11 -11
- package/dist/access-mcp.js +42 -40
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-D_6mo8ms.d.ts → access-namespace-preflight-8VYKmRX0.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 +12 -12
- package/dist/access-operations.js +39 -37
- 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-sbiNS5UB.d.ts → access-service-Crk__Git.d.ts} +8 -8
- 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 +43 -33
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-wearables-meetings-surface.d.ts +3 -3
- package/dist/action-confidence.d.ts +1 -1
- package/dist/active-memory-bridge.d.ts +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/bulk-import/index.d.ts +3 -3
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-GWVG7LGC.js → capsule-crypto-7FJQINUR.js} +2 -2
- package/dist/{catalog-DO_7zfkv.d.ts → catalog-DybwVNW3.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-OWHERGF2.js → chunk-2NLLXCJG.js} +2 -2
- package/dist/{chunk-NZPFCP5A.js → chunk-2PSX5BJU.js} +2 -2
- package/dist/chunk-3BCULS4U.js +1093 -0
- package/dist/chunk-3BCULS4U.js.map +1 -0
- package/dist/{chunk-W6J4POB6.js → chunk-3RI5Y7KU.js} +2 -2
- package/dist/{chunk-H7BZBSP6.js → chunk-52II7PB6.js} +4 -4
- package/dist/{chunk-IF4EY26E.js → chunk-5DH6PG4B.js} +2 -2
- package/dist/{chunk-M4AHBM72.js → chunk-5HERQ5FX.js} +10 -10
- package/dist/{chunk-IRXMJLTW.js → chunk-5HK3CJAR.js} +2 -2
- package/dist/{chunk-XAWIL7TC.js → chunk-5S4LQOPE.js} +2 -2
- package/dist/{chunk-IDQ6DKXC.js → chunk-5VPQSRQO.js} +3 -3
- package/dist/{chunk-ROEAEANL.js → chunk-6CPUQ5D6.js} +10 -10
- package/dist/{chunk-SR7JIRAR.js → chunk-7F27PCSN.js} +2 -2
- package/dist/{chunk-7OZSHBWK.js → chunk-7TCGNUVP.js} +2 -2
- package/dist/{chunk-KBOG7FJV.js → chunk-7WR462EM.js} +2 -2
- package/dist/{chunk-AYAZWXJI.js → chunk-A32YEQAM.js} +2 -2
- package/dist/{chunk-5GIZM4RX.js → chunk-ACOC27BB.js} +2 -2
- package/dist/{chunk-5W7MKXMU.js → chunk-AFR6AIM4.js} +144 -78
- package/dist/chunk-AFR6AIM4.js.map +1 -0
- package/dist/{chunk-OMZLBT4B.js → chunk-ANJXPFRS.js} +47 -26
- package/dist/chunk-ANJXPFRS.js.map +1 -0
- package/dist/{chunk-FC7TIRFS.js → chunk-AX7UXCHJ.js} +6 -1
- package/dist/chunk-AX7UXCHJ.js.map +1 -0
- package/dist/{chunk-6LS5OX3U.js → chunk-BJTHRFFC.js} +6 -6
- package/dist/chunk-BWGCOLEL.js +61 -0
- package/dist/chunk-BWGCOLEL.js.map +1 -0
- package/dist/{chunk-PGW64IFQ.js → chunk-CFGU52XJ.js} +2 -2
- package/dist/{chunk-DPNXADEI.js → chunk-D4QVPP3G.js} +2 -2
- package/dist/{chunk-2RXUZVPU.js → chunk-EOHKUWXW.js} +2 -2
- package/dist/{chunk-YNDLCWXS.js → chunk-EZ25VE3G.js} +4 -4
- package/dist/{chunk-ZK4BFABK.js → chunk-F635GAL7.js} +4 -4
- package/dist/{chunk-HWVNYNIV.js → chunk-F6QHHRWP.js} +2 -2
- package/dist/{chunk-YUTTMSC7.js → chunk-FMQ4MOQO.js} +89 -26
- package/dist/chunk-FMQ4MOQO.js.map +1 -0
- package/dist/{chunk-LDBFXD4F.js → chunk-FP7YTTVO.js} +3 -1
- package/dist/chunk-FP7YTTVO.js.map +1 -0
- package/dist/{chunk-O4BAGJDN.js → chunk-GEPACVWN.js} +2 -2
- package/dist/{chunk-XZBXINXZ.js → chunk-GIC6BASP.js} +4 -4
- package/dist/{chunk-PP7R754B.js → chunk-GPFZFCRN.js} +1 -1
- package/dist/{chunk-LSYD7GHZ.js → chunk-GTSVEEP3.js} +2 -2
- package/dist/{chunk-RQ2EQRRR.js → chunk-I4343FIA.js} +79 -6
- package/dist/chunk-I4343FIA.js.map +1 -0
- package/dist/{chunk-YWBOOBDP.js → chunk-I7EX6KSH.js} +58 -58
- package/dist/{chunk-3I22VWB3.js → chunk-IP4ZNT4U.js} +2 -2
- package/dist/{chunk-AXGFOFNY.js → chunk-IY7UXD3J.js} +2 -2
- package/dist/{chunk-6FUMA6AA.js → chunk-JAQXUGLN.js} +2 -2
- package/dist/{chunk-RKNJBZ55.js → chunk-JBPKEARU.js} +4 -4
- package/dist/chunk-JCCWJHOP.js +240 -0
- package/dist/chunk-JCCWJHOP.js.map +1 -0
- package/dist/{chunk-5W7CTZ2E.js → chunk-KQAFEZQX.js} +4 -4
- package/dist/{chunk-D2YNNDML.js → chunk-KWIGDKM2.js} +2 -2
- package/dist/{chunk-2JHRCWHT.js → chunk-LLQCM2U2.js} +85 -85
- package/dist/{chunk-OLBZ2WGG.js → chunk-LTBKKSCX.js} +2 -2
- package/dist/{chunk-RACZB5HT.js → chunk-N37X5RU7.js} +4 -4
- package/dist/{chunk-FEO2CDXR.js → chunk-NG3MBQV4.js} +2 -2
- package/dist/{chunk-AG46P24C.js → chunk-NNBZS3DY.js} +4 -4
- package/dist/{chunk-JGG5HVI2.js → chunk-OPGL46PX.js} +2 -2
- package/dist/{chunk-OUKBMQ2O.js → chunk-PD66CVSD.js} +2 -2
- package/dist/{chunk-7SSRXEZJ.js → chunk-PDDSFELN.js} +2 -2
- package/dist/{chunk-MVIYRRVJ.js → chunk-PMVPCZJZ.js} +5 -5
- package/dist/{chunk-D35XLYQ7.js → chunk-RGCF4XNH.js} +9 -9
- package/dist/{chunk-PNAGNVGK.js → chunk-RQE4TITU.js} +35 -30
- package/dist/chunk-RQE4TITU.js.map +1 -0
- package/dist/{chunk-X2DWBWOX.js → chunk-S3K2CIK5.js} +2 -2
- package/dist/{chunk-TWBQQ3FT.js → chunk-SEA6M7SS.js} +2 -2
- package/dist/{chunk-DYO24BNB.js → chunk-SVVIASVX.js} +2 -2
- package/dist/{chunk-7K5Q6COX.js → chunk-TVVEYCNW.js} +4 -4
- package/dist/{chunk-4K7IW3F7.js → chunk-UD7UNYRD.js} +34 -3
- package/dist/chunk-UD7UNYRD.js.map +1 -0
- package/dist/chunk-ULM7JCDH.js +154 -0
- package/dist/chunk-ULM7JCDH.js.map +1 -0
- package/dist/{chunk-NLUCDKLT.js → chunk-VKCAHCBI.js} +2 -2
- package/dist/{chunk-BXXOPKT5.js → chunk-VXVZ2GM3.js} +2 -2
- package/dist/chunk-W2UOAATB.js +521 -0
- package/dist/chunk-W2UOAATB.js.map +1 -0
- package/dist/{chunk-JFWZRUKP.js → chunk-WTOZBZNN.js} +3 -3
- package/dist/{chunk-UVYI6VIX.js → chunk-X7Y7WX73.js} +1 -1
- package/dist/{chunk-5TG4MU2U.js → chunk-YKWFK7XA.js} +5 -5
- package/dist/{chunk-BIJAWZYW.js → chunk-YMOPYG3K.js} +6 -6
- package/dist/{chunk-XUZ5CIEE.js → chunk-YRVAKONL.js} +1 -1
- package/dist/{chunk-53MZQEBD.js → chunk-YWSQD2IB.js} +2 -2
- package/dist/{chunk-US4IRASK.js → chunk-Z4U3UN56.js} +2 -2
- package/dist/{chunk-QMZY3GG6.js → chunk-ZAOHJDKH.js} +3 -3
- package/dist/{chunk-ZXUZ54Z5.js → chunk-ZIJDI4CP.js} +2 -2
- package/dist/{cli-Bfgo0n1L.d.ts → cli-B322UMvB.d.ts} +5 -5
- package/dist/cli.d.ts +13 -13
- package/dist/cli.js +75 -74
- 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/dashboard-runtime.js +2 -2
- 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-D23_x-s5.d.ts → dependency-propagation-delivery-BGcNairQ.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 +256 -0
- package/dist/eval-trajectory-contracts.js +56 -0
- package/dist/eval-trajectory-store.d.ts +39 -0
- package/dist/eval-trajectory-store.js +19 -0
- package/dist/eval-trajectory-store.js.map +1 -0
- package/dist/eval-trajectory.d.ts +67 -0
- package/dist/eval-trajectory.js +46 -0
- package/dist/eval-trajectory.js.map +1 -0
- package/dist/event-order-recall.js +2 -2
- 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.d.ts +1 -1
- package/dist/extraction.js +12 -12
- 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-FXGELBFA.js → graph-edge-decay-A4SDFMMS.js} +4 -4
- package/dist/graph-edge-decay-A4SDFMMS.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--QhGIXF2.d.ts → index-By2QUAMh.d.ts} +2 -2
- package/dist/index.d.ts +26 -23
- package/dist/index.js +184 -142
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/engine.js +4 -4
- package/dist/lcm/index.d.ts +1 -1
- package/dist/lcm/index.js +13 -13
- 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 +128 -1
- package/dist/location/index.js +60 -750
- package/dist/location/index.js.map +1 -1
- 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-PFvY1Pw_.d.ts → maintenance-Dm2McrIx.d.ts} +4 -3
- package/dist/mcp-memory-inspector-app.d.ts +11 -11
- package/dist/mcp-read-only-tools.js +1 -1
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-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 +47 -3
- package/dist/memory-worth-outcomes.js +5 -3
- 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 +7 -7
- 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 +18 -16
- package/dist/{orchestrator-4wzJrPVm.d.ts → orchestrator-Co1DyfuP.d.ts} +8 -8
- package/dist/orchestrator.d.ts +9 -9
- package/dist/orchestrator.js +111 -106
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CgXgdIrF.d.ts → pipeline-DotMnb6y.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-BP3VQDl5.d.ts → public-http-PJRtnSi-.d.ts} +1 -1
- package/dist/{qmd-BppGGxsi.d.ts → qmd-BP0n11fR.d.ts} +1 -1
- package/dist/qmd-preflight.d.ts +2 -2
- package/dist/qmd-recall-cache.d.ts +1 -1
- package/dist/qmd.d.ts +2 -2
- package/dist/recall-concurrency-config.d.ts +1 -1
- package/dist/recall-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.d.ts +1 -1
- package/dist/recall-memory-map.d.ts +1 -1
- package/dist/recall-planner-llm.d.ts +1 -1
- package/dist/recall-state.d.ts +1 -1
- package/dist/recall-tag-filter.d.ts +1 -1
- package/dist/recall-timings.d.ts +1 -1
- package/dist/recall-xray-cli.d.ts +1 -1
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray.d.ts +1 -1
- 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/{scope-profiles-ChZUtxDU.d.ts → scope-profiles-6ChZKTy-.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +10 -10
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +2 -2
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +2 -2
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +2 -2
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-mSPwQSmF.d.ts → semantic-consolidation-DziYcW5J.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-BICWLwSP.d.ts → service-C7rIBuK_.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 +10 -10
- package/dist/{storage-B7urx1K3.d.ts → storage-B1hEx8Xg.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/backup.js +2 -2
- package/dist/transfer/capsule-export.js +2 -2
- package/dist/transfer/capsule-import.js +2 -2
- package/dist/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-ETU5N6nB.d.ts → types-BHDNxGTT.d.ts} +1 -1
- package/dist/types.d.ts +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/access-boundary.ts +5 -0
- package/src/access-http.ts +15 -16
- package/src/access-mcp-output-schemas.ts +5 -0
- package/src/access-mcp.ts +6 -6
- package/src/access-operations.ts +2 -0
- package/src/access-surface-catalog.ts +10 -0
- package/src/eval-trajectory-contracts.ts +411 -0
- package/src/eval-trajectory-store.ts +306 -0
- package/src/eval-trajectory.test.ts +534 -0
- package/src/eval-trajectory.ts +773 -0
- package/src/index.ts +2 -0
- package/src/location/access-operations.ts +84 -0
- package/src/location/http-glue.test.ts +100 -0
- package/src/location/http-glue.ts +85 -0
- package/src/location/index.ts +3 -0
- package/src/location/mcp-tools.ts +82 -0
- package/src/location/provider-setup.test.ts +106 -0
- package/src/location/provider-setup.ts +103 -0
- package/src/location/scheduler.test.ts +113 -0
- package/src/location/scheduler.ts +98 -0
- package/src/location/surfaces.test.ts +241 -0
- package/src/location/surfaces.ts +329 -0
- package/src/maintenance/day-summary-cron.ts +45 -0
- package/src/mcp-read-only-tools.ts +2 -0
- package/src/memory-worth-outcomes.test.ts +53 -18
- package/src/memory-worth-outcomes.ts +91 -9
- package/src/orchestration/maintenance.ts +22 -30
- package/src/wearables/http-glue.ts +28 -0
- package/dist/chunk-4K7IW3F7.js.map +0 -1
- package/dist/chunk-5W7MKXMU.js.map +0 -1
- package/dist/chunk-FC7TIRFS.js.map +0 -1
- package/dist/chunk-LDBFXD4F.js.map +0 -1
- package/dist/chunk-OMZLBT4B.js.map +0 -1
- package/dist/chunk-PNAGNVGK.js.map +0 -1
- package/dist/chunk-RQ2EQRRR.js.map +0 -1
- package/dist/chunk-YUTTMSC7.js.map +0 -1
- /package/dist/{capsule-crypto-GWVG7LGC.js.map → capsule-crypto-7FJQINUR.js.map} +0 -0
- /package/dist/{chunk-OWHERGF2.js.map → chunk-2NLLXCJG.js.map} +0 -0
- /package/dist/{chunk-NZPFCP5A.js.map → chunk-2PSX5BJU.js.map} +0 -0
- /package/dist/{chunk-W6J4POB6.js.map → chunk-3RI5Y7KU.js.map} +0 -0
- /package/dist/{chunk-H7BZBSP6.js.map → chunk-52II7PB6.js.map} +0 -0
- /package/dist/{chunk-IF4EY26E.js.map → chunk-5DH6PG4B.js.map} +0 -0
- /package/dist/{chunk-M4AHBM72.js.map → chunk-5HERQ5FX.js.map} +0 -0
- /package/dist/{chunk-IRXMJLTW.js.map → chunk-5HK3CJAR.js.map} +0 -0
- /package/dist/{chunk-XAWIL7TC.js.map → chunk-5S4LQOPE.js.map} +0 -0
- /package/dist/{chunk-IDQ6DKXC.js.map → chunk-5VPQSRQO.js.map} +0 -0
- /package/dist/{chunk-ROEAEANL.js.map → chunk-6CPUQ5D6.js.map} +0 -0
- /package/dist/{chunk-SR7JIRAR.js.map → chunk-7F27PCSN.js.map} +0 -0
- /package/dist/{chunk-7OZSHBWK.js.map → chunk-7TCGNUVP.js.map} +0 -0
- /package/dist/{chunk-KBOG7FJV.js.map → chunk-7WR462EM.js.map} +0 -0
- /package/dist/{chunk-AYAZWXJI.js.map → chunk-A32YEQAM.js.map} +0 -0
- /package/dist/{chunk-5GIZM4RX.js.map → chunk-ACOC27BB.js.map} +0 -0
- /package/dist/{chunk-6LS5OX3U.js.map → chunk-BJTHRFFC.js.map} +0 -0
- /package/dist/{chunk-PGW64IFQ.js.map → chunk-CFGU52XJ.js.map} +0 -0
- /package/dist/{chunk-DPNXADEI.js.map → chunk-D4QVPP3G.js.map} +0 -0
- /package/dist/{chunk-2RXUZVPU.js.map → chunk-EOHKUWXW.js.map} +0 -0
- /package/dist/{chunk-YNDLCWXS.js.map → chunk-EZ25VE3G.js.map} +0 -0
- /package/dist/{chunk-ZK4BFABK.js.map → chunk-F635GAL7.js.map} +0 -0
- /package/dist/{chunk-HWVNYNIV.js.map → chunk-F6QHHRWP.js.map} +0 -0
- /package/dist/{chunk-O4BAGJDN.js.map → chunk-GEPACVWN.js.map} +0 -0
- /package/dist/{chunk-XZBXINXZ.js.map → chunk-GIC6BASP.js.map} +0 -0
- /package/dist/{chunk-PP7R754B.js.map → chunk-GPFZFCRN.js.map} +0 -0
- /package/dist/{chunk-LSYD7GHZ.js.map → chunk-GTSVEEP3.js.map} +0 -0
- /package/dist/{chunk-YWBOOBDP.js.map → chunk-I7EX6KSH.js.map} +0 -0
- /package/dist/{chunk-3I22VWB3.js.map → chunk-IP4ZNT4U.js.map} +0 -0
- /package/dist/{chunk-AXGFOFNY.js.map → chunk-IY7UXD3J.js.map} +0 -0
- /package/dist/{chunk-6FUMA6AA.js.map → chunk-JAQXUGLN.js.map} +0 -0
- /package/dist/{chunk-RKNJBZ55.js.map → chunk-JBPKEARU.js.map} +0 -0
- /package/dist/{chunk-5W7CTZ2E.js.map → chunk-KQAFEZQX.js.map} +0 -0
- /package/dist/{chunk-D2YNNDML.js.map → chunk-KWIGDKM2.js.map} +0 -0
- /package/dist/{chunk-2JHRCWHT.js.map → chunk-LLQCM2U2.js.map} +0 -0
- /package/dist/{chunk-OLBZ2WGG.js.map → chunk-LTBKKSCX.js.map} +0 -0
- /package/dist/{chunk-RACZB5HT.js.map → chunk-N37X5RU7.js.map} +0 -0
- /package/dist/{chunk-FEO2CDXR.js.map → chunk-NG3MBQV4.js.map} +0 -0
- /package/dist/{chunk-AG46P24C.js.map → chunk-NNBZS3DY.js.map} +0 -0
- /package/dist/{chunk-JGG5HVI2.js.map → chunk-OPGL46PX.js.map} +0 -0
- /package/dist/{chunk-OUKBMQ2O.js.map → chunk-PD66CVSD.js.map} +0 -0
- /package/dist/{chunk-7SSRXEZJ.js.map → chunk-PDDSFELN.js.map} +0 -0
- /package/dist/{chunk-MVIYRRVJ.js.map → chunk-PMVPCZJZ.js.map} +0 -0
- /package/dist/{chunk-D35XLYQ7.js.map → chunk-RGCF4XNH.js.map} +0 -0
- /package/dist/{chunk-X2DWBWOX.js.map → chunk-S3K2CIK5.js.map} +0 -0
- /package/dist/{chunk-TWBQQ3FT.js.map → chunk-SEA6M7SS.js.map} +0 -0
- /package/dist/{chunk-DYO24BNB.js.map → chunk-SVVIASVX.js.map} +0 -0
- /package/dist/{chunk-7K5Q6COX.js.map → chunk-TVVEYCNW.js.map} +0 -0
- /package/dist/{chunk-NLUCDKLT.js.map → chunk-VKCAHCBI.js.map} +0 -0
- /package/dist/{chunk-BXXOPKT5.js.map → chunk-VXVZ2GM3.js.map} +0 -0
- /package/dist/{chunk-JFWZRUKP.js.map → chunk-WTOZBZNN.js.map} +0 -0
- /package/dist/{chunk-UVYI6VIX.js.map → chunk-X7Y7WX73.js.map} +0 -0
- /package/dist/{chunk-5TG4MU2U.js.map → chunk-YKWFK7XA.js.map} +0 -0
- /package/dist/{chunk-BIJAWZYW.js.map → chunk-YMOPYG3K.js.map} +0 -0
- /package/dist/{chunk-XUZ5CIEE.js.map → chunk-YRVAKONL.js.map} +0 -0
- /package/dist/{chunk-53MZQEBD.js.map → chunk-YWSQD2IB.js.map} +0 -0
- /package/dist/{chunk-US4IRASK.js.map → chunk-Z4U3UN56.js.map} +0 -0
- /package/dist/{chunk-QMZY3GG6.js.map → chunk-ZAOHJDKH.js.map} +0 -0
- /package/dist/{chunk-ZXUZ54Z5.js.map → chunk-ZIJDI4CP.js.map} +0 -0
- /package/dist/{graph-edge-decay-FXGELBFA.js.map → eval-trajectory-contracts.js.map} +0 -0
|
@@ -0,0 +1,1093 @@
|
|
|
1
|
+
import {
|
|
2
|
+
activityDayWindow,
|
|
3
|
+
isValidActivityDate
|
|
4
|
+
} from "./chunk-M6L7HI7R.js";
|
|
5
|
+
import {
|
|
6
|
+
writeFileAtomically
|
|
7
|
+
} from "./chunk-AW4QUFQF.js";
|
|
8
|
+
import {
|
|
9
|
+
pathIsInside
|
|
10
|
+
} from "./chunk-GCASGYIO.js";
|
|
11
|
+
import {
|
|
12
|
+
readEnvVar
|
|
13
|
+
} from "./chunk-JUC24CTX.js";
|
|
14
|
+
import {
|
|
15
|
+
EngramAccessInputError
|
|
16
|
+
} from "./chunk-2Z24E5W2.js";
|
|
17
|
+
import {
|
|
18
|
+
log
|
|
19
|
+
} from "./chunk-3WCASNQZ.js";
|
|
20
|
+
|
|
21
|
+
// src/location/registry.ts
|
|
22
|
+
var PROVIDER_ID_PATTERN = /^[a-z0-9][a-z0-9-]*$/;
|
|
23
|
+
var providers = /* @__PURE__ */ new Map();
|
|
24
|
+
function assertValidProvider(provider) {
|
|
25
|
+
if (typeof provider !== "object" || provider === null) {
|
|
26
|
+
throw new TypeError("location provider must be an object");
|
|
27
|
+
}
|
|
28
|
+
if (typeof provider.id !== "string" || !PROVIDER_ID_PATTERN.test(provider.id)) {
|
|
29
|
+
throw new RangeError(
|
|
30
|
+
"location provider id must be a non-empty lowercase kebab string (a-z, 0-9, hyphens)"
|
|
31
|
+
);
|
|
32
|
+
}
|
|
33
|
+
if (typeof provider.displayName !== "string" || provider.displayName.trim().length === 0) {
|
|
34
|
+
throw new TypeError(`location provider '${provider.id}' must declare a non-empty displayName`);
|
|
35
|
+
}
|
|
36
|
+
if (typeof provider.verify !== "function" || typeof provider.fetchObservations !== "function") {
|
|
37
|
+
throw new TypeError(
|
|
38
|
+
`location provider '${provider.id}' must implement verify() and fetchObservations()`
|
|
39
|
+
);
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
function registerLocationProvider(provider) {
|
|
43
|
+
assertValidProvider(provider);
|
|
44
|
+
if (providers.has(provider.id)) {
|
|
45
|
+
throw new Error(`location provider '${provider.id}' is already registered`);
|
|
46
|
+
}
|
|
47
|
+
providers.set(provider.id, provider);
|
|
48
|
+
}
|
|
49
|
+
function getLocationProvider(id) {
|
|
50
|
+
return typeof id === "string" ? providers.get(id) : void 0;
|
|
51
|
+
}
|
|
52
|
+
function listLocationProviders() {
|
|
53
|
+
return [...providers.keys()].sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
54
|
+
}
|
|
55
|
+
function clearLocationProviders() {
|
|
56
|
+
providers.clear();
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
// src/location/intervals.ts
|
|
60
|
+
function isValidLocationDate(date) {
|
|
61
|
+
return isValidActivityDate(date);
|
|
62
|
+
}
|
|
63
|
+
function locationDayWindow(date, timezone) {
|
|
64
|
+
if (!isValidActivityDate(date)) {
|
|
65
|
+
throw new RangeError(`Invalid location date "${date}"; expected a real YYYY-MM-DD day.`);
|
|
66
|
+
}
|
|
67
|
+
return activityDayWindow(date, timezone);
|
|
68
|
+
}
|
|
69
|
+
function assertFiniteInstant(iso, what) {
|
|
70
|
+
const ms = Date.parse(iso);
|
|
71
|
+
if (typeof iso !== "string" || !Number.isFinite(ms)) {
|
|
72
|
+
throw new RangeError(`${what} must be a UTC ISO-8601 instant; got "${String(iso)}"`);
|
|
73
|
+
}
|
|
74
|
+
return ms;
|
|
75
|
+
}
|
|
76
|
+
function localDayKey(instantUtc, timezone) {
|
|
77
|
+
assertFiniteInstant(instantUtc, "instantUtc");
|
|
78
|
+
return new Intl.DateTimeFormat("en-CA", {
|
|
79
|
+
timeZone: timezone,
|
|
80
|
+
year: "numeric",
|
|
81
|
+
month: "2-digit",
|
|
82
|
+
day: "2-digit"
|
|
83
|
+
}).format(new Date(instantUtc));
|
|
84
|
+
}
|
|
85
|
+
function compareObservations(a, b) {
|
|
86
|
+
if (a.observedAtUtc !== b.observedAtUtc) {
|
|
87
|
+
return a.observedAtUtc < b.observedAtUtc ? -1 : 1;
|
|
88
|
+
}
|
|
89
|
+
if (a.place.id !== b.place.id) {
|
|
90
|
+
return a.place.id < b.place.id ? -1 : 1;
|
|
91
|
+
}
|
|
92
|
+
return 0;
|
|
93
|
+
}
|
|
94
|
+
function bucketObservationsByDay(observations, timezone) {
|
|
95
|
+
const buckets = /* @__PURE__ */ new Map();
|
|
96
|
+
for (const observation of observations) {
|
|
97
|
+
assertFiniteInstant(observation.observedAtUtc, "observation observedAtUtc");
|
|
98
|
+
const key = localDayKey(observation.observedAtUtc, timezone);
|
|
99
|
+
const bucket = buckets.get(key);
|
|
100
|
+
if (bucket === void 0) buckets.set(key, [observation]);
|
|
101
|
+
else bucket.push(observation);
|
|
102
|
+
}
|
|
103
|
+
for (const bucket of buckets.values()) bucket.sort(compareObservations);
|
|
104
|
+
return buckets;
|
|
105
|
+
}
|
|
106
|
+
function intervalOverlapMs(a, b) {
|
|
107
|
+
const overlap = Math.min(Date.parse(a.endUtc), Date.parse(b.endUtc)) - Math.max(Date.parse(a.startUtc), Date.parse(b.startUtc));
|
|
108
|
+
return Math.max(0, overlap);
|
|
109
|
+
}
|
|
110
|
+
function placeForSegment(place, retainCoordinates) {
|
|
111
|
+
if (retainCoordinates || place.latitude === void 0 || place.longitude === void 0) {
|
|
112
|
+
return place;
|
|
113
|
+
}
|
|
114
|
+
return {
|
|
115
|
+
id: place.id,
|
|
116
|
+
label: place.label,
|
|
117
|
+
...place.kind === void 0 ? {} : { kind: place.kind }
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
function observationSegments(observations, window, options) {
|
|
121
|
+
const startMs = assertFiniteInstant(window.startUtc, "window startUtc");
|
|
122
|
+
const endMs = assertFiniteInstant(window.endUtc, "window endUtc");
|
|
123
|
+
if (startMs >= endMs) {
|
|
124
|
+
throw new RangeError("location window must satisfy startUtc < endUtc");
|
|
125
|
+
}
|
|
126
|
+
const ordered = [...observations].sort(compareObservations);
|
|
127
|
+
const segments = [];
|
|
128
|
+
for (let index = 0; index < ordered.length; index += 1) {
|
|
129
|
+
const current = ordered[index];
|
|
130
|
+
const currentMs = Date.parse(current.observedAtUtc);
|
|
131
|
+
if (currentMs < startMs || currentMs >= endMs) {
|
|
132
|
+
throw new RangeError(
|
|
133
|
+
`location observation at "${current.observedAtUtc}" falls outside the requested [${window.startUtc}, ${window.endUtc}) window`
|
|
134
|
+
);
|
|
135
|
+
}
|
|
136
|
+
const nextMs = index + 1 < ordered.length ? Date.parse(ordered[index + 1].observedAtUtc) : endMs;
|
|
137
|
+
const segmentEndMs = Math.min(nextMs, endMs);
|
|
138
|
+
if (currentMs >= segmentEndMs) continue;
|
|
139
|
+
segments.push({
|
|
140
|
+
startUtc: new Date(currentMs).toISOString(),
|
|
141
|
+
endUtc: new Date(segmentEndMs).toISOString(),
|
|
142
|
+
place: placeForSegment(current.place, options.retainCoordinates)
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return segments;
|
|
146
|
+
}
|
|
147
|
+
function unionIntervalMs(segments) {
|
|
148
|
+
const bounds = segments.map((segment) => ({ start: Date.parse(segment.startUtc), end: Date.parse(segment.endUtc) })).sort((a, b) => a.start !== b.start ? a.start - b.start : a.end - b.end);
|
|
149
|
+
let total = 0;
|
|
150
|
+
let sweepStart = null;
|
|
151
|
+
let sweepEnd = 0;
|
|
152
|
+
for (const bound of bounds) {
|
|
153
|
+
if (sweepStart === null || bound.start > sweepEnd) {
|
|
154
|
+
if (sweepStart !== null) total += sweepEnd - sweepStart;
|
|
155
|
+
sweepStart = bound.start;
|
|
156
|
+
sweepEnd = bound.end;
|
|
157
|
+
} else if (bound.end > sweepEnd) {
|
|
158
|
+
sweepEnd = bound.end;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
if (sweepStart !== null) total += sweepEnd - sweepStart;
|
|
162
|
+
return total;
|
|
163
|
+
}
|
|
164
|
+
function placeDurations(segments) {
|
|
165
|
+
const byPlace = /* @__PURE__ */ new Map();
|
|
166
|
+
for (const segment of segments) {
|
|
167
|
+
const existing = byPlace.get(segment.place.id);
|
|
168
|
+
if (existing === void 0) {
|
|
169
|
+
byPlace.set(segment.place.id, { place: segment.place, segments: [segment], firstStartUtc: segment.startUtc });
|
|
170
|
+
continue;
|
|
171
|
+
}
|
|
172
|
+
existing.segments.push(segment);
|
|
173
|
+
if (segment.startUtc < existing.firstStartUtc) existing.firstStartUtc = segment.startUtc;
|
|
174
|
+
if (segment.place.label < existing.place.label) existing.place = segment.place;
|
|
175
|
+
}
|
|
176
|
+
const durations = [...byPlace.values()].map((entry) => ({
|
|
177
|
+
place: entry.place,
|
|
178
|
+
totalMs: unionIntervalMs(entry.segments),
|
|
179
|
+
firstStartUtc: entry.firstStartUtc
|
|
180
|
+
}));
|
|
181
|
+
durations.sort((a, b) => {
|
|
182
|
+
if (a.place.id !== b.place.id) return a.place.id < b.place.id ? -1 : 1;
|
|
183
|
+
return 0;
|
|
184
|
+
});
|
|
185
|
+
return durations;
|
|
186
|
+
}
|
|
187
|
+
function dominantPlace(segments) {
|
|
188
|
+
const durations = placeDurations(segments);
|
|
189
|
+
let best = null;
|
|
190
|
+
for (const duration of durations) {
|
|
191
|
+
if (best === null) {
|
|
192
|
+
best = duration;
|
|
193
|
+
continue;
|
|
194
|
+
}
|
|
195
|
+
if (duration.totalMs !== best.totalMs) {
|
|
196
|
+
if (duration.totalMs > best.totalMs) best = duration;
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
if (duration.firstStartUtc !== best.firstStartUtc) {
|
|
200
|
+
if (duration.firstStartUtc < best.firstStartUtc) best = duration;
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (duration.place.id < best.place.id) best = duration;
|
|
204
|
+
}
|
|
205
|
+
return best === null ? null : { place: best.place, totalMs: best.totalMs };
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
// src/location/store.ts
|
|
209
|
+
import { createHash } from "crypto";
|
|
210
|
+
import { lstat, mkdir, readFile, readdir, realpath } from "fs/promises";
|
|
211
|
+
import path from "path";
|
|
212
|
+
var LOCATIONS_DIR_NAME = "locations";
|
|
213
|
+
var LOCATION_DAY_KIND = "location-day";
|
|
214
|
+
var LOCATION_DAY_FORMAT_VERSION = 1;
|
|
215
|
+
var MAX_TRACKED_LOCATION_DAYS = 90;
|
|
216
|
+
var DAY_FILE_NAME_PATTERN = /^\d{4}-\d{2}-\d{2}\.md$/;
|
|
217
|
+
var stateLocks = /* @__PURE__ */ new Map();
|
|
218
|
+
function withStateLock(key, fn) {
|
|
219
|
+
const prior = stateLocks.get(key) ?? Promise.resolve();
|
|
220
|
+
const next = prior.then(fn, fn);
|
|
221
|
+
const tail = next.then(
|
|
222
|
+
() => void 0,
|
|
223
|
+
() => void 0
|
|
224
|
+
);
|
|
225
|
+
stateLocks.set(key, tail);
|
|
226
|
+
void tail.then(() => {
|
|
227
|
+
if (stateLocks.get(key) === tail) stateLocks.delete(key);
|
|
228
|
+
});
|
|
229
|
+
return next;
|
|
230
|
+
}
|
|
231
|
+
function locationDayFilePath(memoryDir, date) {
|
|
232
|
+
if (!isValidLocationDate(date)) {
|
|
233
|
+
throw new RangeError(`Invalid location date "${date}"; expected a real YYYY-MM-DD day.`);
|
|
234
|
+
}
|
|
235
|
+
return path.join(memoryDir, LOCATIONS_DIR_NAME, `${date}.md`);
|
|
236
|
+
}
|
|
237
|
+
function locationSyncStateFilePath(memoryDir) {
|
|
238
|
+
return path.join(memoryDir, "state", "locations", "sync.json");
|
|
239
|
+
}
|
|
240
|
+
function emptyLocationSyncState() {
|
|
241
|
+
return { version: 1, sources: {} };
|
|
242
|
+
}
|
|
243
|
+
async function loadLocationSyncState(memoryDir) {
|
|
244
|
+
let raw;
|
|
245
|
+
try {
|
|
246
|
+
raw = await readFile(locationSyncStateFilePath(memoryDir), "utf-8");
|
|
247
|
+
} catch (err) {
|
|
248
|
+
if (err.code === "ENOENT") return emptyLocationSyncState();
|
|
249
|
+
throw err;
|
|
250
|
+
}
|
|
251
|
+
let parsed;
|
|
252
|
+
try {
|
|
253
|
+
parsed = JSON.parse(raw);
|
|
254
|
+
} catch {
|
|
255
|
+
return emptyLocationSyncState();
|
|
256
|
+
}
|
|
257
|
+
if (typeof parsed !== "object" || parsed === null || Array.isArray(parsed) || typeof parsed.sources !== "object" || parsed.sources === null) {
|
|
258
|
+
return emptyLocationSyncState();
|
|
259
|
+
}
|
|
260
|
+
return { version: 1, sources: parsed.sources };
|
|
261
|
+
}
|
|
262
|
+
async function saveLocationSyncState(memoryDir, state) {
|
|
263
|
+
await mkdir(path.dirname(locationSyncStateFilePath(memoryDir)), { recursive: true, mode: 448 });
|
|
264
|
+
await writeFileAtomically(
|
|
265
|
+
locationSyncStateFilePath(memoryDir),
|
|
266
|
+
`${JSON.stringify(state, null, 2)}
|
|
267
|
+
`
|
|
268
|
+
);
|
|
269
|
+
}
|
|
270
|
+
function pruneSourceDays(source) {
|
|
271
|
+
const days = source.days;
|
|
272
|
+
if (days === void 0) return;
|
|
273
|
+
const keys = Object.keys(days).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
274
|
+
for (const key of keys.slice(0, Math.max(0, keys.length - MAX_TRACKED_LOCATION_DAYS))) {
|
|
275
|
+
delete days[key];
|
|
276
|
+
}
|
|
277
|
+
}
|
|
278
|
+
async function updateLocationSourceDay(memoryDir, sourceId, date, payload, completedAtUtc) {
|
|
279
|
+
if (!isValidLocationDate(date)) {
|
|
280
|
+
throw new RangeError(`Invalid location date "${date}"; expected a real YYYY-MM-DD day.`);
|
|
281
|
+
}
|
|
282
|
+
return withStateLock(locationSyncStateFilePath(memoryDir), async () => {
|
|
283
|
+
const state = await loadLocationSyncState(memoryDir);
|
|
284
|
+
const source = state.sources[sourceId] ?? {};
|
|
285
|
+
const days = source.days ?? {};
|
|
286
|
+
days[date] = payload;
|
|
287
|
+
source.days = days;
|
|
288
|
+
source.lastSyncedAtUtc = completedAtUtc;
|
|
289
|
+
state.sources[sourceId] = source;
|
|
290
|
+
for (const candidate of Object.values(state.sources)) pruneSourceDays(candidate);
|
|
291
|
+
await saveLocationSyncState(memoryDir, state);
|
|
292
|
+
return state;
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
function hashLocationBody(body) {
|
|
296
|
+
return createHash("sha256").update(body, "utf8").digest("hex");
|
|
297
|
+
}
|
|
298
|
+
function clockHhMm(iso, timezone) {
|
|
299
|
+
return new Intl.DateTimeFormat("en-GB", {
|
|
300
|
+
timeZone: timezone,
|
|
301
|
+
hour: "2-digit",
|
|
302
|
+
minute: "2-digit",
|
|
303
|
+
hour12: false
|
|
304
|
+
}).format(new Date(iso));
|
|
305
|
+
}
|
|
306
|
+
function formatDuration(ms) {
|
|
307
|
+
const totalMinutes = Math.round(ms / 6e4);
|
|
308
|
+
const hours = Math.floor(totalMinutes / 60);
|
|
309
|
+
const minutes = totalMinutes % 60;
|
|
310
|
+
if (hours <= 0) return `${minutes}m`;
|
|
311
|
+
return `${hours}h ${String(minutes).padStart(2, "0")}m`;
|
|
312
|
+
}
|
|
313
|
+
function safeLabel(label) {
|
|
314
|
+
return label.replace(/\s+/g, " ").replace(/[`*_]/g, "").trim();
|
|
315
|
+
}
|
|
316
|
+
function formatPlaceLabel(segment) {
|
|
317
|
+
const label = safeLabel(segment.place.label);
|
|
318
|
+
return segment.place.kind === void 0 ? label : `${label} (${segment.place.kind})`;
|
|
319
|
+
}
|
|
320
|
+
function formatCoordinates(segment) {
|
|
321
|
+
if (segment.place.latitude === void 0 || segment.place.longitude === void 0) return "";
|
|
322
|
+
return ` @ ${segment.place.latitude.toFixed(4)},${segment.place.longitude.toFixed(4)}`;
|
|
323
|
+
}
|
|
324
|
+
function composeLocationDayBody(date, timezone, sources) {
|
|
325
|
+
const lines = [`# Location day \u2014 ${date} (${timezone})`, ""];
|
|
326
|
+
const allSegments = [];
|
|
327
|
+
let observationCount = 0;
|
|
328
|
+
for (const entry of Object.values(sources)) {
|
|
329
|
+
allSegments.push(...entry.segments);
|
|
330
|
+
observationCount += entry.observationCount;
|
|
331
|
+
}
|
|
332
|
+
lines.push("## Summary", "");
|
|
333
|
+
if (observationCount === 0) {
|
|
334
|
+
lines.push("No location observations recorded.", "");
|
|
335
|
+
} else {
|
|
336
|
+
const durations = placeDurations(allSegments).sort((a, b) => b.totalMs - a.totalMs);
|
|
337
|
+
lines.push(
|
|
338
|
+
`- Places visited: ${durations.length}`,
|
|
339
|
+
...durations.map(
|
|
340
|
+
(duration) => `- ${safeLabel(duration.place.label)}: ${formatDuration(duration.totalMs)}`
|
|
341
|
+
),
|
|
342
|
+
""
|
|
343
|
+
);
|
|
344
|
+
}
|
|
345
|
+
const sourceIds = Object.keys(sources).sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
|
|
346
|
+
for (const sourceId of sourceIds) {
|
|
347
|
+
const entry = sources[sourceId];
|
|
348
|
+
lines.push(`## Timeline \u2014 ${safeLabel(entry.providerDisplayName ?? sourceId)}`, "");
|
|
349
|
+
if (entry.segments.length === 0) {
|
|
350
|
+
lines.push("No observations.", "");
|
|
351
|
+
continue;
|
|
352
|
+
}
|
|
353
|
+
for (const segment of entry.segments) {
|
|
354
|
+
lines.push(
|
|
355
|
+
`- ${clockHhMm(segment.startUtc, timezone)}\u2013${clockHhMm(segment.endUtc, timezone)} \u2014 ${formatPlaceLabel(segment)}${formatCoordinates(segment)}`
|
|
356
|
+
);
|
|
357
|
+
}
|
|
358
|
+
lines.push("");
|
|
359
|
+
}
|
|
360
|
+
return `${lines.join("\n").trimEnd()}
|
|
361
|
+
`;
|
|
362
|
+
}
|
|
363
|
+
function composeLocationDayMeta(date, timezone, sources, body) {
|
|
364
|
+
let observationCount = 0;
|
|
365
|
+
for (const entry of Object.values(sources)) observationCount += entry.observationCount;
|
|
366
|
+
return {
|
|
367
|
+
kind: LOCATION_DAY_KIND,
|
|
368
|
+
date,
|
|
369
|
+
timezone,
|
|
370
|
+
formatVersion: LOCATION_DAY_FORMAT_VERSION,
|
|
371
|
+
sources: Object.keys(sources).sort((a, b) => a < b ? -1 : a > b ? 1 : 0),
|
|
372
|
+
observationCount,
|
|
373
|
+
contentHash: hashLocationBody(body)
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
function frontmatterScalar(key, value) {
|
|
377
|
+
return `${key}: ${typeof value === "number" ? value : JSON.stringify(value)}`;
|
|
378
|
+
}
|
|
379
|
+
function frontmatterList(key, values) {
|
|
380
|
+
if (values.length === 0) return [`${key}: []`];
|
|
381
|
+
const lines = [`${key}:`];
|
|
382
|
+
for (const value of values) lines.push(` - ${JSON.stringify(value)}`);
|
|
383
|
+
return lines;
|
|
384
|
+
}
|
|
385
|
+
function serializeLocationDay(meta, body) {
|
|
386
|
+
const lines = ["---"];
|
|
387
|
+
lines.push(frontmatterScalar("kind", meta.kind));
|
|
388
|
+
lines.push(frontmatterScalar("date", meta.date));
|
|
389
|
+
lines.push(frontmatterScalar("timezone", meta.timezone));
|
|
390
|
+
lines.push(frontmatterScalar("formatVersion", meta.formatVersion));
|
|
391
|
+
lines.push(...frontmatterList("sources", meta.sources));
|
|
392
|
+
lines.push(frontmatterScalar("observationCount", meta.observationCount));
|
|
393
|
+
lines.push(frontmatterScalar("contentHash", meta.contentHash));
|
|
394
|
+
lines.push("---", "", body);
|
|
395
|
+
return lines.join("\n");
|
|
396
|
+
}
|
|
397
|
+
function parseScalar(raw) {
|
|
398
|
+
try {
|
|
399
|
+
const parsed = JSON.parse(raw);
|
|
400
|
+
return typeof parsed === "string" ? parsed : raw;
|
|
401
|
+
} catch {
|
|
402
|
+
return raw;
|
|
403
|
+
}
|
|
404
|
+
}
|
|
405
|
+
function parseLocationDaySummary(raw) {
|
|
406
|
+
if (!raw.startsWith("---\n")) return null;
|
|
407
|
+
const closeIndex = raw.indexOf("\n---\n", 4);
|
|
408
|
+
if (closeIndex === -1) return null;
|
|
409
|
+
const scalars = {};
|
|
410
|
+
const lists = {};
|
|
411
|
+
let currentList = null;
|
|
412
|
+
for (const line of raw.slice(4, closeIndex).split("\n")) {
|
|
413
|
+
const listItem = /^ {2}- (.*)$/.exec(line);
|
|
414
|
+
if (listItem !== null && currentList !== null) {
|
|
415
|
+
lists[currentList].push(parseScalar(listItem[1]));
|
|
416
|
+
continue;
|
|
417
|
+
}
|
|
418
|
+
currentList = null;
|
|
419
|
+
const separator = line.indexOf(":");
|
|
420
|
+
if (separator === -1) continue;
|
|
421
|
+
const key = line.slice(0, separator);
|
|
422
|
+
const value = line.slice(separator + 1).trim();
|
|
423
|
+
if (value === "" || value === "[]") {
|
|
424
|
+
lists[key] = [];
|
|
425
|
+
currentList = key;
|
|
426
|
+
continue;
|
|
427
|
+
}
|
|
428
|
+
if (value.startsWith("[")) {
|
|
429
|
+
lists[key] = [parseScalar(value)];
|
|
430
|
+
currentList = key;
|
|
431
|
+
continue;
|
|
432
|
+
}
|
|
433
|
+
scalars[key] = value;
|
|
434
|
+
}
|
|
435
|
+
if (scalars.kind === void 0 || parseScalar(scalars.kind) !== LOCATION_DAY_KIND) return null;
|
|
436
|
+
if (scalars.date === void 0 || scalars.contentHash === void 0) return null;
|
|
437
|
+
return {
|
|
438
|
+
date: parseScalar(scalars.date),
|
|
439
|
+
timezone: scalars.timezone === void 0 ? "UTC" : parseScalar(scalars.timezone),
|
|
440
|
+
sources: lists.sources ?? [],
|
|
441
|
+
observationCount: scalars.observationCount === void 0 ? 0 : Number(scalars.observationCount) || 0,
|
|
442
|
+
contentHash: parseScalar(scalars.contentHash)
|
|
443
|
+
};
|
|
444
|
+
}
|
|
445
|
+
function isErrnoCode(err, code) {
|
|
446
|
+
return err instanceof Error && err.code === code;
|
|
447
|
+
}
|
|
448
|
+
async function assertNotSymlink(target, kind) {
|
|
449
|
+
let stat;
|
|
450
|
+
try {
|
|
451
|
+
stat = await lstat(target);
|
|
452
|
+
} catch (err) {
|
|
453
|
+
if (isErrnoCode(err, "ENOENT")) return;
|
|
454
|
+
throw err;
|
|
455
|
+
}
|
|
456
|
+
if (stat.isSymbolicLink()) {
|
|
457
|
+
throw new Error(
|
|
458
|
+
`locations ${kind} '${path.basename(target)}' is a symbolic link \u2014 refusing to follow it even when it resolves inside the memory dir (AGENTS.md pattern #3)`
|
|
459
|
+
);
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
async function assertNoEscape(rootReal, candidate) {
|
|
463
|
+
let candidateReal;
|
|
464
|
+
try {
|
|
465
|
+
candidateReal = await realpath(candidate);
|
|
466
|
+
} catch {
|
|
467
|
+
return;
|
|
468
|
+
}
|
|
469
|
+
if (!pathIsInside(rootReal, candidateReal)) {
|
|
470
|
+
throw new Error(
|
|
471
|
+
"location day path resolves outside the memory dir \u2014 refusing to follow a symlink/traversal (AGENTS.md pattern #3)"
|
|
472
|
+
);
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
async function assertDayPathContained(memoryDir, targetPath) {
|
|
476
|
+
let rootReal;
|
|
477
|
+
try {
|
|
478
|
+
rootReal = await realpath(memoryDir);
|
|
479
|
+
} catch {
|
|
480
|
+
rootReal = path.resolve(memoryDir);
|
|
481
|
+
}
|
|
482
|
+
const locationsDir = path.join(memoryDir, LOCATIONS_DIR_NAME);
|
|
483
|
+
await assertNoEscape(rootReal, locationsDir);
|
|
484
|
+
await assertNoEscape(rootReal, targetPath);
|
|
485
|
+
await assertNotSymlink(locationsDir, "directory");
|
|
486
|
+
await assertNotSymlink(targetPath, "day file");
|
|
487
|
+
}
|
|
488
|
+
async function writeLocationDay(memoryDir, date, serialized) {
|
|
489
|
+
const target = locationDayFilePath(memoryDir, date);
|
|
490
|
+
await assertDayPathContained(memoryDir, target);
|
|
491
|
+
try {
|
|
492
|
+
if (await readFile(target, "utf-8") === serialized) return false;
|
|
493
|
+
} catch (err) {
|
|
494
|
+
if (!isErrnoCode(err, "ENOENT")) throw err;
|
|
495
|
+
}
|
|
496
|
+
await mkdir(path.dirname(target), { recursive: true, mode: 448 });
|
|
497
|
+
await writeFileAtomically(target, serialized);
|
|
498
|
+
return true;
|
|
499
|
+
}
|
|
500
|
+
async function readLocationDay(memoryDir, date) {
|
|
501
|
+
const target = locationDayFilePath(memoryDir, date);
|
|
502
|
+
await assertDayPathContained(memoryDir, target);
|
|
503
|
+
try {
|
|
504
|
+
return await readFile(target, "utf-8");
|
|
505
|
+
} catch (err) {
|
|
506
|
+
if (isErrnoCode(err, "ENOENT")) return null;
|
|
507
|
+
throw err;
|
|
508
|
+
}
|
|
509
|
+
}
|
|
510
|
+
async function listLocationDayDates(memoryDir) {
|
|
511
|
+
const locationsDir = path.join(memoryDir, LOCATIONS_DIR_NAME);
|
|
512
|
+
await assertDayPathContained(memoryDir, locationsDir);
|
|
513
|
+
let entries;
|
|
514
|
+
try {
|
|
515
|
+
entries = await readdir(locationsDir);
|
|
516
|
+
} catch (err) {
|
|
517
|
+
if (isErrnoCode(err, "ENOENT")) return [];
|
|
518
|
+
throw err;
|
|
519
|
+
}
|
|
520
|
+
const dates = entries.filter((entry) => DAY_FILE_NAME_PATTERN.test(entry)).map((entry) => entry.slice(0, -3));
|
|
521
|
+
dates.sort((a, b) => a > b ? -1 : a < b ? 1 : 0);
|
|
522
|
+
return dates;
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
// src/location/pipeline.ts
|
|
526
|
+
var MAX_SYNC_PAGES = 1e4;
|
|
527
|
+
function sanitizeProviderError(error) {
|
|
528
|
+
const raw = error instanceof Error ? error.message : String(error);
|
|
529
|
+
return raw.replace(/Bearer\s+[A-Za-z0-9._~+/=-]+/gi, "Bearer [redacted]").replace(/[?#][^ \t"']*/g, "[redacted]").replace(/[+-]?\d+\.\d{3,},\s?[+-]?\d+\.\d{3,}/g, "[coordinates]").slice(0, 300);
|
|
530
|
+
}
|
|
531
|
+
function assertValidObservation(observation) {
|
|
532
|
+
if (typeof observation !== "object" || observation === null) {
|
|
533
|
+
throw new TypeError("location provider returned a non-object observation");
|
|
534
|
+
}
|
|
535
|
+
if (typeof observation.observedAtUtc !== "string" || !Number.isFinite(Date.parse(observation.observedAtUtc))) {
|
|
536
|
+
throw new TypeError("location provider returned an observation with an invalid observedAtUtc");
|
|
537
|
+
}
|
|
538
|
+
const place = observation.place;
|
|
539
|
+
if (typeof place !== "object" || place === null || typeof place.id !== "string" || place.id.length === 0) {
|
|
540
|
+
throw new TypeError("location provider returned an observation without a valid place");
|
|
541
|
+
}
|
|
542
|
+
if (typeof place.label !== "string" || place.label.trim().length === 0) {
|
|
543
|
+
throw new TypeError(`location provider returned place '${place.id}' without a label`);
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
async function fetchWindow(provider, window, options) {
|
|
547
|
+
const maxPages = options.maxPages ?? MAX_SYNC_PAGES;
|
|
548
|
+
if (!Number.isInteger(maxPages) || maxPages < 1) {
|
|
549
|
+
throw new RangeError("location sync maxPages must be a positive integer");
|
|
550
|
+
}
|
|
551
|
+
const observations = [];
|
|
552
|
+
const seenCursors = /* @__PURE__ */ new Set();
|
|
553
|
+
let cursor = null;
|
|
554
|
+
let pages = 0;
|
|
555
|
+
let completed = false;
|
|
556
|
+
while (pages < maxPages) {
|
|
557
|
+
options.signal?.throwIfAborted();
|
|
558
|
+
const page = await provider.fetchObservations({
|
|
559
|
+
startUtc: window.startUtc,
|
|
560
|
+
endUtc: window.endUtc,
|
|
561
|
+
cursor,
|
|
562
|
+
signal: options.signal
|
|
563
|
+
});
|
|
564
|
+
pages += 1;
|
|
565
|
+
for (const observation of page.observations) assertValidObservation(observation);
|
|
566
|
+
observations.push(...page.observations);
|
|
567
|
+
if (page.nextCursor === null) {
|
|
568
|
+
completed = true;
|
|
569
|
+
break;
|
|
570
|
+
}
|
|
571
|
+
if (typeof page.nextCursor !== "string" || page.nextCursor.length === 0) {
|
|
572
|
+
throw new TypeError("location provider returned an invalid cursor");
|
|
573
|
+
}
|
|
574
|
+
if (seenCursors.has(page.nextCursor)) {
|
|
575
|
+
throw new Error("location provider returned a repeated cursor");
|
|
576
|
+
}
|
|
577
|
+
seenCursors.add(page.nextCursor);
|
|
578
|
+
cursor = page.nextCursor;
|
|
579
|
+
}
|
|
580
|
+
if (!completed) {
|
|
581
|
+
throw new Error(`location provider exceeded ${maxPages} pages`);
|
|
582
|
+
}
|
|
583
|
+
return observations;
|
|
584
|
+
}
|
|
585
|
+
async function syncLocationDay(options) {
|
|
586
|
+
if (!options.config.enabled) return [];
|
|
587
|
+
const window = locationDayWindow(options.date, options.config.timezone);
|
|
588
|
+
const now = options.now ?? (() => /* @__PURE__ */ new Date());
|
|
589
|
+
const resolveProvider = options.getProvider ?? getLocationProvider;
|
|
590
|
+
const results = [];
|
|
591
|
+
for (const source of options.config.sources) {
|
|
592
|
+
if (!source.enabled) {
|
|
593
|
+
results.push({
|
|
594
|
+
sourceId: source.id,
|
|
595
|
+
status: "skipped",
|
|
596
|
+
skipReason: "source-disabled",
|
|
597
|
+
fetched: 0,
|
|
598
|
+
dayWritten: false,
|
|
599
|
+
stateSaved: false
|
|
600
|
+
});
|
|
601
|
+
continue;
|
|
602
|
+
}
|
|
603
|
+
const provider = resolveProvider(source.id);
|
|
604
|
+
if (provider === void 0) {
|
|
605
|
+
results.push({
|
|
606
|
+
sourceId: source.id,
|
|
607
|
+
status: "skipped",
|
|
608
|
+
skipReason: "provider-not-registered",
|
|
609
|
+
fetched: 0,
|
|
610
|
+
dayWritten: false,
|
|
611
|
+
stateSaved: false
|
|
612
|
+
});
|
|
613
|
+
continue;
|
|
614
|
+
}
|
|
615
|
+
let observations;
|
|
616
|
+
try {
|
|
617
|
+
observations = await fetchWindow(provider, window, options);
|
|
618
|
+
} catch (error) {
|
|
619
|
+
results.push({
|
|
620
|
+
sourceId: source.id,
|
|
621
|
+
status: "failed",
|
|
622
|
+
fetched: 0,
|
|
623
|
+
dayWritten: false,
|
|
624
|
+
stateSaved: false,
|
|
625
|
+
...error instanceof Error && error.name === "AbortError" ? { error: "aborted" } : { error: sanitizeProviderError(error) }
|
|
626
|
+
});
|
|
627
|
+
continue;
|
|
628
|
+
}
|
|
629
|
+
try {
|
|
630
|
+
options.signal?.throwIfAborted();
|
|
631
|
+
const segments = observationSegments(observations, window, {
|
|
632
|
+
retainCoordinates: options.config.retainCoordinates
|
|
633
|
+
});
|
|
634
|
+
const payload = { observationCount: observations.length, segments, providerDisplayName: provider.displayName };
|
|
635
|
+
const merged = await mergeDaySources(options.memoryDir, source.id, options.date, payload);
|
|
636
|
+
let dayWritten = false;
|
|
637
|
+
if (Object.values(merged).some((entry) => entry.observationCount > 0)) {
|
|
638
|
+
const body = composeLocationDayBody(options.date, options.config.timezone, merged);
|
|
639
|
+
const meta = composeLocationDayMeta(options.date, options.config.timezone, merged, body);
|
|
640
|
+
dayWritten = await writeLocationDay(options.memoryDir, options.date, serializeLocationDay(meta, body));
|
|
641
|
+
}
|
|
642
|
+
await updateLocationSourceDay(
|
|
643
|
+
options.memoryDir,
|
|
644
|
+
source.id,
|
|
645
|
+
options.date,
|
|
646
|
+
payload,
|
|
647
|
+
now().toISOString()
|
|
648
|
+
);
|
|
649
|
+
results.push({
|
|
650
|
+
sourceId: source.id,
|
|
651
|
+
status: "synced",
|
|
652
|
+
fetched: observations.length,
|
|
653
|
+
dayWritten,
|
|
654
|
+
stateSaved: true
|
|
655
|
+
});
|
|
656
|
+
} catch (error) {
|
|
657
|
+
results.push({
|
|
658
|
+
sourceId: source.id,
|
|
659
|
+
status: "failed",
|
|
660
|
+
fetched: observations.length,
|
|
661
|
+
dayWritten: false,
|
|
662
|
+
stateSaved: false,
|
|
663
|
+
...error instanceof Error && error.name === "AbortError" ? { error: "aborted" } : { error: sanitizeProviderError(error) }
|
|
664
|
+
});
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
return results;
|
|
668
|
+
}
|
|
669
|
+
async function mergeDaySources(memoryDir, sourceId, date, payload) {
|
|
670
|
+
const state = await loadLocationSyncState(memoryDir);
|
|
671
|
+
const merged = {};
|
|
672
|
+
for (const [otherId, otherState] of Object.entries(state.sources)) {
|
|
673
|
+
if (otherId === sourceId) continue;
|
|
674
|
+
const day = otherState.days?.[date];
|
|
675
|
+
if (day === void 0) continue;
|
|
676
|
+
merged[otherId] = { ...day, segments: [...day.segments] };
|
|
677
|
+
}
|
|
678
|
+
merged[sourceId] = payload;
|
|
679
|
+
return merged;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
// src/location/cli.ts
|
|
683
|
+
async function locationStatus(config, memoryDir, options = {}) {
|
|
684
|
+
const resolveProvider = options.getProvider ?? getLocationProvider;
|
|
685
|
+
const state = await loadLocationSyncState(memoryDir);
|
|
686
|
+
const sources = config.sources.map((source) => {
|
|
687
|
+
const sourceState = state.sources[source.id];
|
|
688
|
+
return {
|
|
689
|
+
id: source.id,
|
|
690
|
+
enabled: source.enabled,
|
|
691
|
+
providerRegistered: resolveProvider(source.id) !== void 0,
|
|
692
|
+
...sourceState?.lastSyncedAtUtc === void 0 ? {} : { lastSyncedAtUtc: sourceState.lastSyncedAtUtc },
|
|
693
|
+
trackedDays: Object.keys(sourceState?.days ?? {}).length
|
|
694
|
+
};
|
|
695
|
+
});
|
|
696
|
+
const maxDays = options.maxDays ?? 7;
|
|
697
|
+
const recentDays = [];
|
|
698
|
+
for (const date of (await listLocationDayDates(memoryDir)).slice(0, Math.max(0, maxDays))) {
|
|
699
|
+
const raw = await readLocationDay(memoryDir, date);
|
|
700
|
+
const summary = raw === null ? null : parseLocationDaySummary(raw);
|
|
701
|
+
recentDays.push({
|
|
702
|
+
date,
|
|
703
|
+
sources: summary?.sources ?? [],
|
|
704
|
+
observationCount: summary?.observationCount ?? 0
|
|
705
|
+
});
|
|
706
|
+
}
|
|
707
|
+
return { enabled: config.enabled, timezone: config.timezone, sources, recentDays };
|
|
708
|
+
}
|
|
709
|
+
async function checkLocationSources(config, options = {}) {
|
|
710
|
+
if (!config.enabled) {
|
|
711
|
+
return config.sources.map((source) => ({ id: source.id, ok: false, skipped: "location-disabled" }));
|
|
712
|
+
}
|
|
713
|
+
const resolveProvider = options.getProvider ?? getLocationProvider;
|
|
714
|
+
const results = [];
|
|
715
|
+
for (const source of config.sources) {
|
|
716
|
+
if (!source.enabled) {
|
|
717
|
+
results.push({ id: source.id, ok: false, skipped: "source-disabled" });
|
|
718
|
+
continue;
|
|
719
|
+
}
|
|
720
|
+
const provider = resolveProvider(source.id);
|
|
721
|
+
if (provider === void 0) {
|
|
722
|
+
results.push({ id: source.id, ok: false, skipped: "provider-not-registered" });
|
|
723
|
+
continue;
|
|
724
|
+
}
|
|
725
|
+
try {
|
|
726
|
+
const check = await provider.verify(options.signal);
|
|
727
|
+
results.push({
|
|
728
|
+
id: source.id,
|
|
729
|
+
ok: check.ok,
|
|
730
|
+
...check.detail === void 0 || check.detail.length === 0 ? {} : { detail: check.detail }
|
|
731
|
+
});
|
|
732
|
+
} catch (error) {
|
|
733
|
+
results.push({ id: source.id, ok: false, detail: error instanceof Error ? error.name : "provider error" });
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
return results;
|
|
737
|
+
}
|
|
738
|
+
function shiftIsoDate(date, days) {
|
|
739
|
+
const parsed = /* @__PURE__ */ new Date(`${date}T00:00:00Z`);
|
|
740
|
+
parsed.setUTCDate(parsed.getUTCDate() + days);
|
|
741
|
+
return parsed.toISOString().slice(0, 10);
|
|
742
|
+
}
|
|
743
|
+
async function syncLocation(options) {
|
|
744
|
+
const { config, memoryDir, endDate, days, ...rest } = options;
|
|
745
|
+
if (endDate !== void 0 && !isValidLocationDate(endDate)) {
|
|
746
|
+
throw new RangeError(`Invalid location endDate "${endDate}"; expected a real YYYY-MM-DD day.`);
|
|
747
|
+
}
|
|
748
|
+
const now = rest.now ?? (() => /* @__PURE__ */ new Date());
|
|
749
|
+
const end = endDate ?? shiftIsoDate(localDayKey(now().toISOString(), config.timezone), -1);
|
|
750
|
+
const count = days ?? config.syncDays;
|
|
751
|
+
if (!Number.isInteger(count) || count < 1 || count > 90) {
|
|
752
|
+
throw new RangeError("location sync days must be an integer from 1 to 90");
|
|
753
|
+
}
|
|
754
|
+
const runs = [];
|
|
755
|
+
for (let offset = count; offset >= 1; offset -= 1) {
|
|
756
|
+
const date = shiftIsoDate(end, -(offset - 1));
|
|
757
|
+
runs.push({ date, results: await syncLocationDay({ ...rest, config, memoryDir, date, now }) });
|
|
758
|
+
}
|
|
759
|
+
return runs;
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
// src/location/provider-setup.ts
|
|
763
|
+
var loadFailuresWarned = /* @__PURE__ */ new Set();
|
|
764
|
+
function readReittiEnv() {
|
|
765
|
+
return {
|
|
766
|
+
baseUrl: readEnvVar("REITTI_BASE_URL"),
|
|
767
|
+
token: readEnvVar("REITTI_TOKEN"),
|
|
768
|
+
authMode: readEnvVar("REITTI_AUTH_MODE")
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
async function ensureConfiguredLocationProviders(config, deps = {}) {
|
|
772
|
+
const registered = [];
|
|
773
|
+
if (!config.enabled) return registered;
|
|
774
|
+
for (const source of config.sources) {
|
|
775
|
+
if (!source.enabled) continue;
|
|
776
|
+
if (getLocationProvider(source.id) !== void 0) continue;
|
|
777
|
+
if (source.id !== "reitti") continue;
|
|
778
|
+
const env = deps.env ?? readReittiEnv();
|
|
779
|
+
const baseUrl = env.baseUrl?.trim();
|
|
780
|
+
const token = env.token?.trim();
|
|
781
|
+
if (!baseUrl || !token) continue;
|
|
782
|
+
const authMode = env.authMode === "x-api-token" || env.authMode === "bearer" ? env.authMode : void 0;
|
|
783
|
+
const specifier = "@remnic/connector-reitti";
|
|
784
|
+
const load = deps.importModule ?? ((s) => import(s));
|
|
785
|
+
try {
|
|
786
|
+
const mod = await load(specifier);
|
|
787
|
+
if (mod.ensureReittiProviderRegistered({
|
|
788
|
+
baseUrl,
|
|
789
|
+
token,
|
|
790
|
+
timezone: config.timezone,
|
|
791
|
+
...authMode !== void 0 ? { authMode } : {}
|
|
792
|
+
})) {
|
|
793
|
+
registered.push("reitti");
|
|
794
|
+
}
|
|
795
|
+
} catch (err) {
|
|
796
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
797
|
+
if (!message.includes(specifier)) {
|
|
798
|
+
if (!loadFailuresWarned.has(specifier)) {
|
|
799
|
+
loadFailuresWarned.add(specifier);
|
|
800
|
+
log.warn(`location: failed to load optional provider package ${specifier}: ${message}`);
|
|
801
|
+
}
|
|
802
|
+
}
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
return registered;
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
// src/location/surfaces.ts
|
|
809
|
+
async function runLocationStatus(deps) {
|
|
810
|
+
await ensureConfiguredLocationProviders(deps.config);
|
|
811
|
+
return locationStatus(deps.config, deps.memoryDir);
|
|
812
|
+
}
|
|
813
|
+
async function runLocationCheck(deps, signal) {
|
|
814
|
+
await ensureConfiguredLocationProviders(deps.config);
|
|
815
|
+
return checkLocationSources(deps.config, signal !== void 0 ? { signal } : {});
|
|
816
|
+
}
|
|
817
|
+
async function runLocationSync(deps, request = {}) {
|
|
818
|
+
await ensureConfiguredLocationProviders(deps.config);
|
|
819
|
+
const runs = await syncLocation({ ...deps, ...validatedSyncWindow(request) });
|
|
820
|
+
return runs;
|
|
821
|
+
}
|
|
822
|
+
async function runLocationDay(memoryDir, rawDate) {
|
|
823
|
+
const date = requireLocationDate(rawDate, "date");
|
|
824
|
+
const body = await readLocationDay(memoryDir, date);
|
|
825
|
+
const summary = body === null ? null : parseLocationDaySummary(body);
|
|
826
|
+
return {
|
|
827
|
+
date,
|
|
828
|
+
found: body !== null,
|
|
829
|
+
sources: summary?.sources ?? [],
|
|
830
|
+
observationCount: summary?.observationCount ?? 0,
|
|
831
|
+
body
|
|
832
|
+
};
|
|
833
|
+
}
|
|
834
|
+
function requireLocationDate(raw, label) {
|
|
835
|
+
if (typeof raw !== "string" || !isValidLocationDate(raw)) {
|
|
836
|
+
throw new EngramAccessInputError(`location: ${label} is required (YYYY-MM-DD)`);
|
|
837
|
+
}
|
|
838
|
+
return raw;
|
|
839
|
+
}
|
|
840
|
+
function optionalLocationDays(raw) {
|
|
841
|
+
if (raw === void 0 || raw === null || raw === "") return void 0;
|
|
842
|
+
const parsed = typeof raw === "number" ? raw : Number(raw);
|
|
843
|
+
if (!Number.isInteger(parsed) || parsed < 1 || parsed > 90) {
|
|
844
|
+
throw new EngramAccessInputError("location: days expects an integer from 1 to 90");
|
|
845
|
+
}
|
|
846
|
+
return parsed;
|
|
847
|
+
}
|
|
848
|
+
function validatedSyncWindow(request) {
|
|
849
|
+
const days = optionalLocationDays(request.days);
|
|
850
|
+
const endDate = request.endDate === void 0 || request.endDate === null || request.endDate === "" ? void 0 : requireLocationDate(request.endDate, "date");
|
|
851
|
+
return { ...endDate !== void 0 ? { endDate } : {}, ...days !== void 0 ? { days } : {} };
|
|
852
|
+
}
|
|
853
|
+
function parseLocationBackfillRange(rawFrom, rawTo) {
|
|
854
|
+
const from = requireLocationDate(rawFrom, "from");
|
|
855
|
+
const to = requireLocationDate(rawTo, "to");
|
|
856
|
+
const fromMs = Date.parse(`${from}T00:00:00Z`);
|
|
857
|
+
const toMs = Date.parse(`${to}T00:00:00Z`);
|
|
858
|
+
if (toMs < fromMs) {
|
|
859
|
+
throw new EngramAccessInputError("location: backfill --from must not be after --to");
|
|
860
|
+
}
|
|
861
|
+
const days = Math.round((toMs - fromMs) / 864e5) + 1;
|
|
862
|
+
if (days > 90) {
|
|
863
|
+
throw new EngramAccessInputError("location: backfill range is capped at 90 days");
|
|
864
|
+
}
|
|
865
|
+
return { endDate: to, days };
|
|
866
|
+
}
|
|
867
|
+
var USAGE = `Usage: location <command> [options]
|
|
868
|
+
|
|
869
|
+
Commands:
|
|
870
|
+
status Configured sources, registration, last sync
|
|
871
|
+
check Probe every enabled provider (auth/connectivity)
|
|
872
|
+
sync [options] Sync recent local days (default: config.syncDays
|
|
873
|
+
ending yesterday)
|
|
874
|
+
--date <YYYY-MM-DD> End the window on this day (inclusive)
|
|
875
|
+
--days <n> Window size, 1..90 (default: location.syncDays)
|
|
876
|
+
backfill --from <date> --to <date>
|
|
877
|
+
Sync an explicit historical range (\u2264 90 days)
|
|
878
|
+
day <YYYY-MM-DD> Print one stored location day
|
|
879
|
+
|
|
880
|
+
Add --json to status/sync/backfill/day for machine-readable output.
|
|
881
|
+
Credentials for built-in providers come from the environment:
|
|
882
|
+
reitti: REITTI_BASE_URL, REITTI_TOKEN[, REITTI_AUTH_MODE=x-api-token|bearer]
|
|
883
|
+
`;
|
|
884
|
+
var VALUE_FLAGS = /* @__PURE__ */ new Set(["--date", "--days", "--from", "--to"]);
|
|
885
|
+
var BOOLEAN_FLAGS = /* @__PURE__ */ new Set(["--json"]);
|
|
886
|
+
function parseCliFlags(args) {
|
|
887
|
+
const flags = /* @__PURE__ */ new Map();
|
|
888
|
+
const positional = [];
|
|
889
|
+
for (let index = 0; index < args.length; index++) {
|
|
890
|
+
const arg = args[index];
|
|
891
|
+
if (!arg.startsWith("--")) {
|
|
892
|
+
positional.push(arg);
|
|
893
|
+
continue;
|
|
894
|
+
}
|
|
895
|
+
if (BOOLEAN_FLAGS.has(arg)) {
|
|
896
|
+
flags.set(arg, true);
|
|
897
|
+
continue;
|
|
898
|
+
}
|
|
899
|
+
if (VALUE_FLAGS.has(arg)) {
|
|
900
|
+
const value = args[index + 1];
|
|
901
|
+
if (value === void 0 || value.startsWith("--")) {
|
|
902
|
+
throw new EngramAccessInputError(`location: ${arg} requires a value`);
|
|
903
|
+
}
|
|
904
|
+
flags.set(arg, value);
|
|
905
|
+
index++;
|
|
906
|
+
continue;
|
|
907
|
+
}
|
|
908
|
+
throw new EngramAccessInputError(
|
|
909
|
+
`location: unknown flag '${arg}' \u2014 valid flags: ${[...VALUE_FLAGS, ...BOOLEAN_FLAGS].join(", ")}`
|
|
910
|
+
);
|
|
911
|
+
}
|
|
912
|
+
return { flags, positional };
|
|
913
|
+
}
|
|
914
|
+
function flagString(parsed, name) {
|
|
915
|
+
const value = parsed.flags.get(name);
|
|
916
|
+
return typeof value === "string" ? value : void 0;
|
|
917
|
+
}
|
|
918
|
+
function renderStatus(report) {
|
|
919
|
+
const lines = [
|
|
920
|
+
`Location: ${report.enabled ? "enabled" : "disabled"} (timezone ${report.timezone})`
|
|
921
|
+
];
|
|
922
|
+
if (report.sources.length === 0) {
|
|
923
|
+
lines.push("No sources configured. Add location.sources to the plugin config.");
|
|
924
|
+
return `${lines.join("\n")}
|
|
925
|
+
`;
|
|
926
|
+
}
|
|
927
|
+
for (const source of report.sources) {
|
|
928
|
+
lines.push(
|
|
929
|
+
` ${source.id}: ${source.enabled ? "enabled" : "disabled"}, provider ${source.providerRegistered ? "registered" : "not registered"}, ${source.trackedDays} tracked day${source.trackedDays === 1 ? "" : "s"}, last sync ${source.lastSyncedAtUtc ?? "never"}`
|
|
930
|
+
);
|
|
931
|
+
}
|
|
932
|
+
if (report.recentDays.length > 0) {
|
|
933
|
+
lines.push(" recent days:");
|
|
934
|
+
for (const day of report.recentDays) {
|
|
935
|
+
lines.push(
|
|
936
|
+
` ${day.date} ${day.observationCount} observation${day.observationCount === 1 ? "" : "s"} [${day.sources.join(", ")}]`
|
|
937
|
+
);
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
return `${lines.join("\n")}
|
|
941
|
+
`;
|
|
942
|
+
}
|
|
943
|
+
function anySourceFailed(runs) {
|
|
944
|
+
return runs.some((run) => run.results.some((result) => result.status === "failed"));
|
|
945
|
+
}
|
|
946
|
+
function renderRuns(io, runs) {
|
|
947
|
+
for (const run of runs) {
|
|
948
|
+
for (const result of run.results) {
|
|
949
|
+
io.stdout.write(
|
|
950
|
+
`${run.date} ${result.sourceId}: ${result.status}${result.error ? ` \u2014 ${result.error}` : ""} (${result.fetched} fetched)
|
|
951
|
+
`
|
|
952
|
+
);
|
|
953
|
+
}
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
async function runLocationCliCommand(deps, args, io) {
|
|
957
|
+
const [command, ...rest] = args;
|
|
958
|
+
try {
|
|
959
|
+
switch (command) {
|
|
960
|
+
case void 0:
|
|
961
|
+
case "help":
|
|
962
|
+
case "--help": {
|
|
963
|
+
io.stdout.write(USAGE);
|
|
964
|
+
return command === void 0 ? 1 : 0;
|
|
965
|
+
}
|
|
966
|
+
case "status": {
|
|
967
|
+
const parsed = parseCliFlags(rest);
|
|
968
|
+
const report = await runLocationStatus(deps);
|
|
969
|
+
if (parsed.flags.has("--json")) {
|
|
970
|
+
io.stdout.write(`${JSON.stringify(report, null, 2)}
|
|
971
|
+
`);
|
|
972
|
+
return 0;
|
|
973
|
+
}
|
|
974
|
+
io.stdout.write(renderStatus(report));
|
|
975
|
+
return 0;
|
|
976
|
+
}
|
|
977
|
+
case "check": {
|
|
978
|
+
const results = await runLocationCheck(deps);
|
|
979
|
+
for (const result of results) {
|
|
980
|
+
const skipped = result.skipped === void 0 ? "" : ` (skipped: ${result.skipped})`;
|
|
981
|
+
io.stdout.write(
|
|
982
|
+
`${result.id}: ${result.ok ? "OK" : "FAILED"}${skipped}${result.detail ? ` \u2014 ${result.detail}` : ""}
|
|
983
|
+
`
|
|
984
|
+
);
|
|
985
|
+
}
|
|
986
|
+
return results.every((result) => result.ok) ? 0 : 1;
|
|
987
|
+
}
|
|
988
|
+
case "sync": {
|
|
989
|
+
const parsed = parseCliFlags(rest);
|
|
990
|
+
if (parsed.positional.length > 0) {
|
|
991
|
+
throw new EngramAccessInputError(
|
|
992
|
+
`location: unexpected argument '${parsed.positional[0]}' \u2014 sync takes flags only`
|
|
993
|
+
);
|
|
994
|
+
}
|
|
995
|
+
const daysValue = flagString(parsed, "--days");
|
|
996
|
+
const runs = await runLocationSync(deps, {
|
|
997
|
+
endDate: flagString(parsed, "--date"),
|
|
998
|
+
...daysValue !== void 0 ? { days: Number(daysValue) } : {}
|
|
999
|
+
});
|
|
1000
|
+
if (parsed.flags.has("--json")) {
|
|
1001
|
+
io.stdout.write(`${JSON.stringify({ days: runs }, null, 2)}
|
|
1002
|
+
`);
|
|
1003
|
+
} else {
|
|
1004
|
+
renderRuns(io, runs);
|
|
1005
|
+
}
|
|
1006
|
+
return anySourceFailed(runs) ? 1 : 0;
|
|
1007
|
+
}
|
|
1008
|
+
case "backfill": {
|
|
1009
|
+
const parsed = parseCliFlags(rest);
|
|
1010
|
+
const range = parseLocationBackfillRange(flagString(parsed, "--from"), flagString(parsed, "--to"));
|
|
1011
|
+
const runs = await runLocationSync(deps, range);
|
|
1012
|
+
if (parsed.flags.has("--json")) {
|
|
1013
|
+
io.stdout.write(`${JSON.stringify({ days: runs }, null, 2)}
|
|
1014
|
+
`);
|
|
1015
|
+
} else {
|
|
1016
|
+
renderRuns(io, runs);
|
|
1017
|
+
}
|
|
1018
|
+
return anySourceFailed(runs) ? 1 : 0;
|
|
1019
|
+
}
|
|
1020
|
+
case "day": {
|
|
1021
|
+
const parsed = parseCliFlags(rest);
|
|
1022
|
+
const date = parsed.positional[0] ?? flagString(parsed, "--date");
|
|
1023
|
+
const view = await runLocationDay(deps.memoryDir, date);
|
|
1024
|
+
if (!view.found) {
|
|
1025
|
+
io.stderr.write(`No stored location day for ${view.date}.
|
|
1026
|
+
`);
|
|
1027
|
+
return 1;
|
|
1028
|
+
}
|
|
1029
|
+
if (parsed.flags.has("--json")) {
|
|
1030
|
+
io.stdout.write(`${JSON.stringify(view, null, 2)}
|
|
1031
|
+
`);
|
|
1032
|
+
return 0;
|
|
1033
|
+
}
|
|
1034
|
+
io.stdout.write(`${view.body}
|
|
1035
|
+
`);
|
|
1036
|
+
return 0;
|
|
1037
|
+
}
|
|
1038
|
+
default:
|
|
1039
|
+
io.stderr.write(`location: unknown command '${command}'
|
|
1040
|
+
${USAGE}`);
|
|
1041
|
+
return 1;
|
|
1042
|
+
}
|
|
1043
|
+
} catch (err) {
|
|
1044
|
+
io.stderr.write(`${err instanceof Error ? err.message : String(err)}
|
|
1045
|
+
`);
|
|
1046
|
+
return 1;
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
|
|
1050
|
+
export {
|
|
1051
|
+
registerLocationProvider,
|
|
1052
|
+
getLocationProvider,
|
|
1053
|
+
listLocationProviders,
|
|
1054
|
+
clearLocationProviders,
|
|
1055
|
+
isValidLocationDate,
|
|
1056
|
+
locationDayWindow,
|
|
1057
|
+
localDayKey,
|
|
1058
|
+
bucketObservationsByDay,
|
|
1059
|
+
intervalOverlapMs,
|
|
1060
|
+
observationSegments,
|
|
1061
|
+
placeDurations,
|
|
1062
|
+
dominantPlace,
|
|
1063
|
+
LOCATIONS_DIR_NAME,
|
|
1064
|
+
LOCATION_DAY_KIND,
|
|
1065
|
+
LOCATION_DAY_FORMAT_VERSION,
|
|
1066
|
+
locationDayFilePath,
|
|
1067
|
+
locationSyncStateFilePath,
|
|
1068
|
+
emptyLocationSyncState,
|
|
1069
|
+
loadLocationSyncState,
|
|
1070
|
+
saveLocationSyncState,
|
|
1071
|
+
updateLocationSourceDay,
|
|
1072
|
+
hashLocationBody,
|
|
1073
|
+
composeLocationDayBody,
|
|
1074
|
+
composeLocationDayMeta,
|
|
1075
|
+
serializeLocationDay,
|
|
1076
|
+
parseLocationDaySummary,
|
|
1077
|
+
writeLocationDay,
|
|
1078
|
+
readLocationDay,
|
|
1079
|
+
listLocationDayDates,
|
|
1080
|
+
sanitizeProviderError,
|
|
1081
|
+
syncLocationDay,
|
|
1082
|
+
locationStatus,
|
|
1083
|
+
checkLocationSources,
|
|
1084
|
+
syncLocation,
|
|
1085
|
+
ensureConfiguredLocationProviders,
|
|
1086
|
+
runLocationStatus,
|
|
1087
|
+
runLocationCheck,
|
|
1088
|
+
runLocationSync,
|
|
1089
|
+
runLocationDay,
|
|
1090
|
+
parseLocationBackfillRange,
|
|
1091
|
+
runLocationCliCommand
|
|
1092
|
+
};
|
|
1093
|
+
//# sourceMappingURL=chunk-3BCULS4U.js.map
|