@remnic/core 9.4.2 → 9.6.0
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 +6 -6
- package/dist/access-admin-ops-surface.js +28 -28
- package/dist/access-boundary.d.ts +27 -8
- package/dist/access-boundary.js +33 -29
- package/dist/access-cli.js +83 -81
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +52 -6
- package/dist/access-http.js +40 -38
- package/dist/access-identity-continuity-surface.d.ts +5 -5
- package/dist/access-identity-continuity-surface.js +28 -28
- package/dist/access-lcm-surface.d.ts +6 -6
- package/dist/access-lcm-surface.js +28 -28
- package/dist/access-mcp.d.ts +16 -6
- package/dist/access-mcp.js +37 -35
- package/dist/access-observe-write-surface.d.ts +6 -6
- package/dist/access-observe-write-surface.js +28 -28
- package/dist/access-operations-batch.js +33 -32
- package/dist/access-operations.d.ts +9 -9
- package/dist/access-operations.js +35 -34
- package/dist/access-recall-surface.d.ts +6 -6
- package/dist/access-recall-surface.js +28 -28
- package/dist/access-schema.d.ts +4 -4
- package/dist/access-schema.js +4 -4
- package/dist/{access-service-m-2VO_Ig.d.ts → access-service-CXJaql3A.d.ts} +4 -4
- package/dist/access-service.d.ts +6 -6
- package/dist/access-service.js +28 -28
- package/dist/access-surface-catalog.d.ts +6 -6
- package/dist/access-surface-catalog.js +1 -0
- package/dist/access-surface-catalog.js.map +1 -1
- package/dist/access-token-capabilities.d.ts +174 -0
- package/dist/access-token-capabilities.js +33 -0
- 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 +2 -2
- package/dist/adapters/index.js +4 -4
- package/dist/adapters/registry.js +2 -2
- package/dist/{auto-sync-HMHQHUAG.js → auto-sync-4A5YBWYO.js} +4 -4
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +5 -5
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +9 -9
- package/dist/buffer-surprise-report.d.ts +1 -1
- package/dist/buffer.d.ts +2 -2
- package/dist/calibration.d.ts +1 -1
- package/dist/capabilities.d.ts +1 -1
- package/dist/{capsule-crypto-CZJSLEFG.js → capsule-crypto-RAARDY3M.js} +2 -2
- package/dist/capsule-crypto-RAARDY3M.js.map +1 -0
- package/dist/{catalog-BxWokdC2.d.ts → catalog-C9cu67Ig.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-behavior.js +5 -5
- package/dist/causal-chain.js +3 -3
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +13 -13
- package/dist/causal-retrieval.js +3 -3
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/causal-trajectory.js +1 -1
- package/dist/{chunk-6ZIETXZ2.js → chunk-23JFRB73.js} +2 -2
- package/dist/{chunk-IC6QX5TC.js → chunk-3XIY7MDQ.js} +6 -6
- package/dist/{chunk-FZGGZAAU.js → chunk-4GNEDXDI.js} +146 -2
- package/dist/chunk-4GNEDXDI.js.map +1 -0
- package/dist/{chunk-LOR6ZM5R.js → chunk-4LV23CHK.js} +2 -2
- package/dist/{chunk-E2SPGGUI.js → chunk-4OKLXWDZ.js} +13 -6
- package/dist/chunk-4OKLXWDZ.js.map +1 -0
- package/dist/{chunk-AER6MT24.js → chunk-6SXVCD7W.js} +2 -2
- package/dist/{chunk-OHDJ34CC.js → chunk-72WG5QKN.js} +2 -2
- package/dist/{chunk-CZAZX7JP.js → chunk-7MW3CVLD.js} +4 -4
- package/dist/{chunk-CXLNZXG5.js → chunk-7XGSIUP5.js} +1 -1
- package/dist/{chunk-CZAA5N5S.js → chunk-AYZJID4S.js} +2 -2
- package/dist/{chunk-M7XQSUBB.js → chunk-B3ABVQ36.js} +116 -9
- package/dist/chunk-B3ABVQ36.js.map +1 -0
- package/dist/{chunk-6BISDEN6.js → chunk-BEM4D2QG.js} +14 -14
- package/dist/{chunk-ZPOROUTX.js → chunk-CYWA2CXR.js} +5 -5
- package/dist/{chunk-M5QKGHCR.js → chunk-CYWCKFCL.js} +5 -5
- package/dist/chunk-D7FOKIY5.js +173 -0
- package/dist/chunk-D7FOKIY5.js.map +1 -0
- package/dist/{chunk-4BFRBP45.js → chunk-DEG5ULFJ.js} +2 -2
- package/dist/{chunk-JLR3JSTL.js → chunk-DS7MM2ES.js} +3 -3
- package/dist/{chunk-2BFLDH5F.js → chunk-EEIROWEG.js} +2 -2
- package/dist/{chunk-5QZDMSSN.js → chunk-FKCRGLRD.js} +237 -82
- package/dist/{chunk-5QZDMSSN.js.map → chunk-FKCRGLRD.js.map} +1 -1
- package/dist/{chunk-X4A62ET7.js → chunk-H2DXDQCQ.js} +17 -17
- package/dist/{chunk-27FLVMDC.js → chunk-HLN7RROI.js} +7 -7
- package/dist/chunk-IC2TCZJ2.js +54 -0
- package/dist/chunk-IC2TCZJ2.js.map +1 -0
- package/dist/{chunk-2U2A5HF4.js → chunk-J3XHPFEU.js} +6 -6
- package/dist/{chunk-AKUCU7CI.js → chunk-JI5AVXYO.js} +5 -5
- package/dist/{chunk-KCJ5H6XQ.js → chunk-JSNVWNGX.js} +2 -2
- package/dist/{chunk-7Z2DZNWN.js → chunk-KL4UAXUY.js} +43 -2
- package/dist/{chunk-7Z2DZNWN.js.map → chunk-KL4UAXUY.js.map} +1 -1
- package/dist/{chunk-FLVL4L3L.js → chunk-KTULX4YO.js} +4 -4
- package/dist/{chunk-ILFJ7AVS.js → chunk-LADFWYHY.js} +35 -21
- package/dist/chunk-LADFWYHY.js.map +1 -0
- package/dist/{chunk-437S3G37.js → chunk-LNQUAJNC.js} +1 -1
- package/dist/{chunk-EPGWWCZF.js → chunk-LR5DZ56F.js} +6 -6
- package/dist/{chunk-YDSWRD33.js → chunk-N3JDIRBW.js} +4 -4
- package/dist/{chunk-OUMTBFSQ.js → chunk-NKCPUHCI.js} +5 -5
- package/dist/{chunk-7QWMTOIF.js → chunk-P454KXD6.js} +112 -34
- package/dist/chunk-P454KXD6.js.map +1 -0
- package/dist/{chunk-DR6PEJU3.js → chunk-PCLIWBGD.js} +44 -59
- package/dist/chunk-PCLIWBGD.js.map +1 -0
- package/dist/{chunk-BGTAL46Y.js → chunk-PNLFN2PZ.js} +2 -2
- package/dist/{chunk-P6SYWE4G.js → chunk-PVUJ6WVV.js} +10 -10
- package/dist/{chunk-YPEMNNNY.js → chunk-RGK27ELN.js} +6 -6
- package/dist/{chunk-2QSZNTDO.js → chunk-RKNJBZ55.js} +4 -4
- package/dist/{chunk-66FLU5BT.js → chunk-SIRPLF54.js} +6 -6
- package/dist/{chunk-M7GGMGMZ.js → chunk-SVOHGUMI.js} +1202 -126
- package/dist/chunk-SVOHGUMI.js.map +1 -0
- package/dist/{chunk-HRCACVHL.js → chunk-TLUDFPZL.js} +2 -2
- package/dist/{chunk-2FOD2YY3.js → chunk-UFUKHGZD.js} +236 -103
- package/dist/chunk-UFUKHGZD.js.map +1 -0
- package/dist/{chunk-2MR3MFQB.js → chunk-UPSAT4PY.js} +2 -2
- package/dist/{chunk-4P4626RY.js → chunk-UTRJFDP2.js} +4 -4
- package/dist/{chunk-CGS7UKWM.js → chunk-VCW74PNH.js} +2 -2
- package/dist/{chunk-5GPPACXK.js → chunk-VSMRDBFT.js} +2 -1
- package/dist/{chunk-NG7YBCJO.js → chunk-XCL57M6Q.js} +4 -4
- package/dist/{chunk-CLX5VDNY.js → chunk-Y4RKAQZ7.js} +4 -4
- package/dist/{chunk-DGYCWCQ7.js → chunk-Y7UNNAZD.js} +2 -2
- package/dist/{chunk-EZ25VE3G.js → chunk-YNDLCWXS.js} +4 -4
- package/dist/{chunk-XN3TUUX2.js → chunk-YQB32INI.js} +2 -2
- package/dist/{cli-EiBBOt3r.d.ts → cli-CqdPA6z9.d.ts} +3 -3
- package/dist/cli.d.ts +7 -7
- package/dist/cli.js +61 -59
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +9 -9
- 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 +2 -2
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +9 -9
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +13 -11
- package/dist/consolidation-provenance-check.d.ts +2 -2
- package/dist/consolidation-undo.d.ts +2 -2
- package/dist/contradiction/index.d.ts +2 -2
- package/dist/contradiction/index.js +4 -4
- package/dist/conversation-index/backend.d.ts +1 -1
- package/dist/conversation-index/backend.js +2 -2
- package/dist/conversation-index/chunker.d.ts +1 -1
- package/dist/conversation-index/faiss-adapter.d.ts +1 -1
- package/dist/conversation-index/indexer.d.ts +1 -1
- package/dist/conversation-index/search.d.ts +1 -1
- package/dist/dashboard-runtime.js +2 -2
- package/dist/day-summary.d.ts +1 -1
- package/dist/delinearize.d.ts +1 -1
- package/dist/direct-answer-wiring.d.ts +1 -1
- package/dist/direct-answer.d.ts +1 -1
- package/dist/embedding-fallback.d.ts +1 -1
- package/dist/enrichment/index.d.ts +1 -1
- package/dist/entity-retrieval.d.ts +2 -2
- package/dist/entity-retrieval.js +9 -9
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +5 -5
- 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.d.ts +1 -1
- package/dist/fallback-llm.d.ts +1 -1
- package/dist/{first-start-migration-DY6YCRC2.js → first-start-migration-VBJQL6OI.js} +5 -5
- package/dist/graph-dashboard-diff.d.ts +1 -1
- package/dist/graph-dashboard-key.d.ts +1 -1
- package/dist/graph-dashboard-parser.d.ts +1 -1
- package/dist/graph-edge-reinforcement.d.ts +1 -1
- package/dist/graph-snapshot.d.ts +1 -1
- package/dist/graph.d.ts +1 -1
- package/dist/identity-continuity.d.ts +1 -1
- package/dist/importance.d.ts +1 -1
- package/dist/index.d.ts +271 -17
- package/dist/index.js +163 -99
- 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 +2 -2
- 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/maintenance/memory-governance.d.ts +1 -1
- package/dist/maintenance/memory-governance.js +10 -10
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +9 -9
- package/dist/maintenance/rebuild-memory-projection.js +11 -11
- package/dist/mcp-memory-inspector-app.d.ts +6 -6
- package/dist/mcp-read-only-tools.d.ts +16 -0
- package/dist/mcp-read-only-tools.js +8 -0
- package/dist/mcp-read-only-tools.js.map +1 -0
- package/dist/memory-action-policy.d.ts +1 -1
- package/dist/memory-cache.d.ts +1 -1
- package/dist/memory-lifecycle-ledger-utils.d.ts +1 -1
- package/dist/memory-projection-store.d.ts +1 -1
- package/dist/memory-provenance.d.ts +1 -1
- package/dist/memory-worth-outcomes.d.ts +2 -2
- package/dist/models-json.d.ts +1 -1
- package/dist/namespaces/migrate.d.ts +3 -3
- package/dist/namespaces/migrate.js +19 -19
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/search.js +10 -10
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +9 -9
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +2 -2
- package/dist/operator-toolkit.js +25 -25
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +11 -11
- package/dist/{orchestrator-B2Y28Z9t.d.ts → orchestrator-CWFrT8AF.d.ts} +91 -60
- package/dist/orchestrator.d.ts +5 -5
- package/dist/orchestrator.js +85 -83
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/policy-runtime.d.ts +1 -1
- package/dist/provenance.d.ts +1 -1
- package/dist/{qmd-Db9mOkzB.d.ts → qmd--fnPMK60.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-disclosure-escalation.d.ts +1 -1
- package/dist/recall-explain-renderer.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/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +4 -4
- 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/schemas.d.ts +22 -22
- package/dist/search/document-scanner.js +2 -2
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/factory.js +9 -9
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +13 -13
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/lancedb-backend.js +3 -3
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.js +3 -3
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/orama-backend.js +3 -3
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-BDVIbLRw.d.ts → semantic-consolidation-O5lMZ4LG.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 +9 -9
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +10 -10
- 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/storage-C1maCNbc.d.ts +1591 -0
- package/dist/storage.d.ts +5 -1239
- package/dist/storage.js +8 -8
- package/dist/summarizer.d.ts +1 -1
- package/dist/summary-snapshot.d.ts +1 -1
- package/dist/temporal-supersession.d.ts +2 -2
- 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/{tier-stats-TG6GUZ6N.js → tier-stats-5XF4UBRQ.js} +4 -4
- package/dist/tokens.d.ts +17 -2
- package/dist/tokens.js +3 -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 +3 -3
- package/dist/transfer/capsule-import.js +3 -3
- 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-ljkd82rn.d.ts → types-CGgcNWCG.d.ts} +31 -1
- package/dist/types.d.ts +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +10 -10
- package/package.json +2 -2
- package/src/access-boundary.test.ts +62 -0
- package/src/access-boundary.ts +165 -126
- package/src/access-http.test.ts +781 -0
- package/src/access-http.ts +334 -108
- package/src/access-mcp.test.ts +264 -0
- package/src/access-mcp.ts +45 -70
- package/src/access-operations-batch.ts +35 -12
- package/src/access-surface-catalog.test.ts +22 -14
- package/src/access-surface-catalog.ts +6 -3
- package/src/access-token-capabilities.test.ts +844 -0
- package/src/access-token-capabilities.ts +391 -0
- package/src/chat/chat-mcp.test.ts +232 -0
- package/src/chat/chat-session.ts +34 -0
- package/src/cli-wearables-fuse.test.ts +197 -0
- package/src/cli.ts +25 -0
- package/src/index.ts +14 -0
- package/src/mcp-read-only-tools.ts +61 -0
- package/src/storage.ts +16 -0
- package/src/tokens.ts +32 -3
- package/src/wearables/cli.test.ts +102 -0
- package/src/wearables/cli.ts +65 -0
- package/src/wearables/config.test.ts +32 -0
- package/src/wearables/config.ts +52 -0
- package/src/wearables/day-store.test.ts +246 -0
- package/src/wearables/day-store.ts +272 -3
- package/src/wearables/fusion/cluster.ts +230 -0
- package/src/wearables/fusion/fuse.ts +218 -0
- package/src/wearables/fusion/fusion.test.ts +2575 -0
- package/src/wearables/fusion/index.ts +50 -0
- package/src/wearables/fusion/reconcile.ts +831 -0
- package/src/wearables/fusion/reconstruct.ts +251 -0
- package/src/wearables/fusion/store.ts +480 -0
- package/src/wearables/fusion/types.ts +228 -0
- package/src/wearables/index.ts +41 -0
- package/src/wearables/service.test.ts +1030 -2
- package/src/wearables/service.ts +258 -16
- package/src/wearables/speakers.test.ts +128 -0
- package/src/wearables/speakers.ts +58 -4
- package/src/wearables/storage-io.test.ts +146 -0
- package/src/wearables/types.ts +31 -0
- package/dist/chunk-2FOD2YY3.js.map +0 -1
- package/dist/chunk-7QWMTOIF.js.map +0 -1
- package/dist/chunk-DR6PEJU3.js.map +0 -1
- package/dist/chunk-E2SPGGUI.js.map +0 -1
- package/dist/chunk-FZGGZAAU.js.map +0 -1
- package/dist/chunk-ILFJ7AVS.js.map +0 -1
- package/dist/chunk-M7GGMGMZ.js.map +0 -1
- package/dist/chunk-M7XQSUBB.js.map +0 -1
- /package/dist/{capsule-crypto-CZJSLEFG.js.map → access-token-capabilities.js.map} +0 -0
- /package/dist/{auto-sync-HMHQHUAG.js.map → auto-sync-4A5YBWYO.js.map} +0 -0
- /package/dist/{chunk-6ZIETXZ2.js.map → chunk-23JFRB73.js.map} +0 -0
- /package/dist/{chunk-IC6QX5TC.js.map → chunk-3XIY7MDQ.js.map} +0 -0
- /package/dist/{chunk-LOR6ZM5R.js.map → chunk-4LV23CHK.js.map} +0 -0
- /package/dist/{chunk-AER6MT24.js.map → chunk-6SXVCD7W.js.map} +0 -0
- /package/dist/{chunk-OHDJ34CC.js.map → chunk-72WG5QKN.js.map} +0 -0
- /package/dist/{chunk-CZAZX7JP.js.map → chunk-7MW3CVLD.js.map} +0 -0
- /package/dist/{chunk-CXLNZXG5.js.map → chunk-7XGSIUP5.js.map} +0 -0
- /package/dist/{chunk-CZAA5N5S.js.map → chunk-AYZJID4S.js.map} +0 -0
- /package/dist/{chunk-6BISDEN6.js.map → chunk-BEM4D2QG.js.map} +0 -0
- /package/dist/{chunk-ZPOROUTX.js.map → chunk-CYWA2CXR.js.map} +0 -0
- /package/dist/{chunk-M5QKGHCR.js.map → chunk-CYWCKFCL.js.map} +0 -0
- /package/dist/{chunk-4BFRBP45.js.map → chunk-DEG5ULFJ.js.map} +0 -0
- /package/dist/{chunk-JLR3JSTL.js.map → chunk-DS7MM2ES.js.map} +0 -0
- /package/dist/{chunk-2BFLDH5F.js.map → chunk-EEIROWEG.js.map} +0 -0
- /package/dist/{chunk-X4A62ET7.js.map → chunk-H2DXDQCQ.js.map} +0 -0
- /package/dist/{chunk-27FLVMDC.js.map → chunk-HLN7RROI.js.map} +0 -0
- /package/dist/{chunk-2U2A5HF4.js.map → chunk-J3XHPFEU.js.map} +0 -0
- /package/dist/{chunk-AKUCU7CI.js.map → chunk-JI5AVXYO.js.map} +0 -0
- /package/dist/{chunk-KCJ5H6XQ.js.map → chunk-JSNVWNGX.js.map} +0 -0
- /package/dist/{chunk-FLVL4L3L.js.map → chunk-KTULX4YO.js.map} +0 -0
- /package/dist/{chunk-437S3G37.js.map → chunk-LNQUAJNC.js.map} +0 -0
- /package/dist/{chunk-EPGWWCZF.js.map → chunk-LR5DZ56F.js.map} +0 -0
- /package/dist/{chunk-YDSWRD33.js.map → chunk-N3JDIRBW.js.map} +0 -0
- /package/dist/{chunk-OUMTBFSQ.js.map → chunk-NKCPUHCI.js.map} +0 -0
- /package/dist/{chunk-BGTAL46Y.js.map → chunk-PNLFN2PZ.js.map} +0 -0
- /package/dist/{chunk-P6SYWE4G.js.map → chunk-PVUJ6WVV.js.map} +0 -0
- /package/dist/{chunk-YPEMNNNY.js.map → chunk-RGK27ELN.js.map} +0 -0
- /package/dist/{chunk-2QSZNTDO.js.map → chunk-RKNJBZ55.js.map} +0 -0
- /package/dist/{chunk-66FLU5BT.js.map → chunk-SIRPLF54.js.map} +0 -0
- /package/dist/{chunk-HRCACVHL.js.map → chunk-TLUDFPZL.js.map} +0 -0
- /package/dist/{chunk-2MR3MFQB.js.map → chunk-UPSAT4PY.js.map} +0 -0
- /package/dist/{chunk-4P4626RY.js.map → chunk-UTRJFDP2.js.map} +0 -0
- /package/dist/{chunk-CGS7UKWM.js.map → chunk-VCW74PNH.js.map} +0 -0
- /package/dist/{chunk-5GPPACXK.js.map → chunk-VSMRDBFT.js.map} +0 -0
- /package/dist/{chunk-NG7YBCJO.js.map → chunk-XCL57M6Q.js.map} +0 -0
- /package/dist/{chunk-CLX5VDNY.js.map → chunk-Y4RKAQZ7.js.map} +0 -0
- /package/dist/{chunk-DGYCWCQ7.js.map → chunk-Y7UNNAZD.js.map} +0 -0
- /package/dist/{chunk-EZ25VE3G.js.map → chunk-YNDLCWXS.js.map} +0 -0
- /package/dist/{chunk-XN3TUUX2.js.map → chunk-YQB32INI.js.map} +0 -0
- /package/dist/{first-start-migration-DY6YCRC2.js.map → first-start-migration-VBJQL6OI.js.map} +0 -0
- /package/dist/{tier-stats-TG6GUZ6N.js.map → tier-stats-5XF4UBRQ.js.map} +0 -0
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wearable cross-source fusion — reconstruct inputs from stored transcripts.
|
|
3
|
+
*
|
|
4
|
+
* The on-demand service path fuses from already-synced day transcripts
|
|
5
|
+
* (offline, no connector calls). Those files store a human-readable
|
|
6
|
+
* markdown body, so this module parses it back into the normalized
|
|
7
|
+
* `FusionConversationInput[]` shape the fusion engine consumes.
|
|
8
|
+
*
|
|
9
|
+
* Precision caveat (documented, accepted for this foundational PR):
|
|
10
|
+
* the rendered body carries minute-precision clock times in the
|
|
11
|
+
* configured timezone. We reconstruct them as `${date}T${HH}:${MM}:00Z`
|
|
12
|
+
* — every source for a given day is rendered in the SAME timezone, so
|
|
13
|
+
* relative within-day comparisons and time-window alignment stay
|
|
14
|
+
* correct even though the absolute ISO is timezone-normalized. Full
|
|
15
|
+
* segment-level alignment with sub-minute precision is a deferred
|
|
16
|
+
* follow-up (see PR body).
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import {
|
|
20
|
+
isValidTranscriptDate,
|
|
21
|
+
parseTranscriptSegmentLine,
|
|
22
|
+
unescapeSegmentText,
|
|
23
|
+
unescapeSpeakerLabel,
|
|
24
|
+
} from "../day-store.js";
|
|
25
|
+
import { hasSelfMarker } from "../speakers.js";
|
|
26
|
+
import type {
|
|
27
|
+
FusionConversationInput,
|
|
28
|
+
FusionSegmentInput,
|
|
29
|
+
} from "./types.js";
|
|
30
|
+
|
|
31
|
+
const CONVERSATION_HEADING =
|
|
32
|
+
/^## (.+?)\u2013(.+?)(?:\s\u00b7\s(.*))?\s\(conversation (.+)\)$/;
|
|
33
|
+
const LOCATION_LINE = /^\*Location: (.+)\*$/;
|
|
34
|
+
const CLOCK_PATTERN = /^(\d{2}):(\d{2})$/;
|
|
35
|
+
|
|
36
|
+
/** Minutes in a 24-hour day. */
|
|
37
|
+
const MINUTES_PER_DAY = 24 * 60;
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* Upper bound on a plausible single-conversation duration, used to decide
|
|
41
|
+
* whether an earlier heading end clock (or segment clock) is a genuine
|
|
42
|
+
* midnight wrap (start -> midnight -> end/segment within this bound)
|
|
43
|
+
* versus a malformed/ordinary earlier clock that should stay on the same
|
|
44
|
+
* date and be clamped downstream. Generous enough that any legitimate
|
|
45
|
+
* overnight wrap a wearable source would emit still rolls forward; tight
|
|
46
|
+
* enough that a near-24h implied span (e.g. 14:00 -> 13:00) is treated as
|
|
47
|
+
* the error it almost certainly is instead of producing a day-spanning
|
|
48
|
+
* window that broadly clusters unrelated neighbors (#1849).
|
|
49
|
+
*/
|
|
50
|
+
const MAX_PLAUSIBLE_WRAP_MINUTES = 12 * 60;
|
|
51
|
+
|
|
52
|
+
/** Rendered clock ("HH:MM") -> timezone-normalized ISO; "--:--" -> undefined. */
|
|
53
|
+
function clockToIso(clock: string, date: string): string | undefined {
|
|
54
|
+
const match = CLOCK_PATTERN.exec(clock.trim());
|
|
55
|
+
if (match === null) return undefined;
|
|
56
|
+
// en-US hour12:false renders the first wall-clock hour (00:xx) as 24:xx
|
|
57
|
+
// on some ICU builds. CLOCK_PATTERN matches "24", which would build an
|
|
58
|
+
// invalid ISO (24:01-24:59 => NaN) or a next-day instant (24:00 => start
|
|
59
|
+
// of next day). Normalize to 00:xx on the SAME rendered date; cross-
|
|
60
|
+
// midnight conversation windows are rolled forward by the caller.
|
|
61
|
+
const hour = match[1] === "24" ? "00" : match[1];
|
|
62
|
+
return `${date}T${hour}:${match[2]}:00.000Z`;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Minutes-of-day for a rendered clock (24:xx normalized to 0), or
|
|
67
|
+
* undefined when the clock is not parseable (e.g. "--:--"). Used to
|
|
68
|
+
* detect conversations that wrap past midnight.
|
|
69
|
+
*/
|
|
70
|
+
function clockMinutesOfDay(clock: string): number | undefined {
|
|
71
|
+
const match = CLOCK_PATTERN.exec(clock.trim());
|
|
72
|
+
if (match === null) return undefined;
|
|
73
|
+
const hour = match[1] === "24" ? 0 : Number.parseInt(match[1], 10);
|
|
74
|
+
return hour * 60 + Number.parseInt(match[2], 10);
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
/** Increment a YYYY-MM-DD date string by one calendar day (UTC arithmetic). */
|
|
78
|
+
function nextCalendarDay(date: string): string {
|
|
79
|
+
const [y, m, d] = date.split("-").map((part) => Number.parseInt(part, 10));
|
|
80
|
+
const dt = new Date(Date.UTC(y, m - 1, d));
|
|
81
|
+
dt.setUTCDate(dt.getUTCDate() + 1);
|
|
82
|
+
const yy = dt.getUTCFullYear();
|
|
83
|
+
const mm = String(dt.getUTCMonth() + 1).padStart(2, "0");
|
|
84
|
+
const dd = String(dt.getUTCDate()).padStart(2, "0");
|
|
85
|
+
return `${yy}-${mm}-${dd}`;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Reconstruct fusion inputs for a day from one or more sources' stored
|
|
90
|
+
* transcript bodies. Each body is the markdown produced by
|
|
91
|
+
* `composeDayTranscriptBody` (frontmatter already stripped by the
|
|
92
|
+
* caller via `parseDayTranscript`).
|
|
93
|
+
*/
|
|
94
|
+
export function reconstructFusionInputs(
|
|
95
|
+
date: string,
|
|
96
|
+
dayTranscripts: ReadonlyArray<{
|
|
97
|
+
source: string;
|
|
98
|
+
body: string;
|
|
99
|
+
/**
|
|
100
|
+
* Whether the body was written by the escape-aware serializer
|
|
101
|
+
* (`bodyIsEscaped(meta)`). When falsy (legacy) the segment text and
|
|
102
|
+
* speaker label are used verbatim — no escape decoding — so a legacy
|
|
103
|
+
* transcript's literal two-character `\n`/`\r` is never altered
|
|
104
|
+
* (issue #1849).
|
|
105
|
+
*/
|
|
106
|
+
escaped?: boolean;
|
|
107
|
+
}>,
|
|
108
|
+
): FusionConversationInput[] {
|
|
109
|
+
if (!isValidTranscriptDate(date)) return [];
|
|
110
|
+
const inputs: FusionConversationInput[] = [];
|
|
111
|
+
|
|
112
|
+
for (const { source, body, escaped } of dayTranscripts) {
|
|
113
|
+
let current: {
|
|
114
|
+
conversationId: string;
|
|
115
|
+
title?: string;
|
|
116
|
+
startIso?: string;
|
|
117
|
+
endIso?: string;
|
|
118
|
+
segments: FusionSegmentInput[];
|
|
119
|
+
/** True when the heading end clock precedes the start clock (the
|
|
120
|
+
* conversation window wrapped past midnight); rolls `endIso` forward.
|
|
121
|
+
* Post-midnight SEGMENTS roll independently via `wrapStartMin`. */
|
|
122
|
+
wrapped: boolean;
|
|
123
|
+
wrapStartMin?: number;
|
|
124
|
+
} | null = null;
|
|
125
|
+
|
|
126
|
+
const flushCurrent = () => {
|
|
127
|
+
if (current === null) return;
|
|
128
|
+
const startIso =
|
|
129
|
+
current.startIso ??
|
|
130
|
+
current.segments.find((segment) => segment.startIso !== undefined)?.startIso ??
|
|
131
|
+
`${date}T00:00:00.000Z`;
|
|
132
|
+
const input: FusionConversationInput = {
|
|
133
|
+
source,
|
|
134
|
+
conversationId: current.conversationId,
|
|
135
|
+
startIso,
|
|
136
|
+
segments: current.segments,
|
|
137
|
+
};
|
|
138
|
+
if (current.endIso !== undefined) input.endIso = current.endIso;
|
|
139
|
+
if (current.title !== undefined) input.title = current.title;
|
|
140
|
+
inputs.push(input);
|
|
141
|
+
current = null;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
for (const rawLine of body.split("\n")) {
|
|
145
|
+
const line = rawLine.trimEnd();
|
|
146
|
+
if (line.length === 0) continue;
|
|
147
|
+
|
|
148
|
+
const heading = CONVERSATION_HEADING.exec(line);
|
|
149
|
+
if (heading !== null) {
|
|
150
|
+
flushCurrent();
|
|
151
|
+
const [, startClock, endClock, title, id] = heading;
|
|
152
|
+
const startMin = clockMinutesOfDay(startClock);
|
|
153
|
+
const endMin = clockMinutesOfDay(endClock);
|
|
154
|
+
// A conversation whose end clock reads EARLIER than its start
|
|
155
|
+
// clock MAY have wrapped past midnight. Roll its end to the next
|
|
156
|
+
// calendar day ONLY when the implied wrap duration (start ->
|
|
157
|
+
// midnight -> end) is within a plausible single-conversation
|
|
158
|
+
// bound; a near-24h implied span (e.g. start 14:00, end 13:00)
|
|
159
|
+
// is almost certainly a malformed/ordinary earlier clock, not a
|
|
160
|
+
// midnight crossing. Leaving that end on the SAME date keeps
|
|
161
|
+
// endIso < startIso so the downstream cluster clamp collapses it
|
|
162
|
+
// to the start instead of stretching the window across most of
|
|
163
|
+
// the day and broadly clustering unrelated neighbors (#1849).
|
|
164
|
+
// Post-midnight SEGMENTS roll independently below under the SAME
|
|
165
|
+
// plausibility bound: a segment whose clock precedes the start
|
|
166
|
+
// clock is rolled only when the implied wrap is plausible.
|
|
167
|
+
const wrapped =
|
|
168
|
+
startMin !== undefined && endMin !== undefined && endMin < startMin;
|
|
169
|
+
const wrapDuration =
|
|
170
|
+
startMin !== undefined && endMin !== undefined
|
|
171
|
+
? MINUTES_PER_DAY - startMin + endMin
|
|
172
|
+
: undefined;
|
|
173
|
+
const plausibleWrap =
|
|
174
|
+
wrapped &&
|
|
175
|
+
wrapDuration !== undefined &&
|
|
176
|
+
wrapDuration <= MAX_PLAUSIBLE_WRAP_MINUTES;
|
|
177
|
+
const startIso = clockToIso(startClock, date);
|
|
178
|
+
const endIso = plausibleWrap
|
|
179
|
+
? clockToIso(endClock, nextCalendarDay(date))
|
|
180
|
+
: clockToIso(endClock, date);
|
|
181
|
+
current = {
|
|
182
|
+
conversationId: id,
|
|
183
|
+
segments: [],
|
|
184
|
+
wrapped,
|
|
185
|
+
...(startMin !== undefined ? { wrapStartMin: startMin } : {}),
|
|
186
|
+
...(startIso !== undefined ? { startIso } : {}),
|
|
187
|
+
...(endIso !== undefined ? { endIso } : {}),
|
|
188
|
+
...(title !== undefined && title.length > 0 ? { title } : {}),
|
|
189
|
+
};
|
|
190
|
+
continue;
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
if (LOCATION_LINE.exec(line) !== null) continue;
|
|
194
|
+
|
|
195
|
+
const segmentMatch = parseTranscriptSegmentLine(line);
|
|
196
|
+
if (segmentMatch !== null) {
|
|
197
|
+
if (current === null) continue; // segment outside any conversation
|
|
198
|
+
const { label, clock, text: rawText } = segmentMatch;
|
|
199
|
+
const text = escaped ? unescapeSegmentText(rawText) : rawText;
|
|
200
|
+
const segMin = clockMinutesOfDay(clock);
|
|
201
|
+
// A segment clock EARLIER than the conversation start clock MAY
|
|
202
|
+
// have crossed midnight. Roll it to the next calendar day ONLY
|
|
203
|
+
// when the implied wrap duration (start -> midnight -> segment)
|
|
204
|
+
// is within the SAME plausible single-conversation bound as the
|
|
205
|
+
// heading end; a near-24h implied span (e.g. start 14:00,
|
|
206
|
+
// segment 13:00) is almost certainly a malformed/provider-skew
|
|
207
|
+
// earlier clock, not a midnight crossing. Leaving it on the SAME
|
|
208
|
+
// date keeps segIso < startIso so the downstream cluster clamp
|
|
209
|
+
// collapses it instead of stretching the interval across most of
|
|
210
|
+
// the day and broadly clustering unrelated neighbors (#1849).
|
|
211
|
+
// Driven by the segment-vs-start comparison directly — NOT gated
|
|
212
|
+
// on `wrapped` — so a heading whose end is missing/unparseable
|
|
213
|
+
// (e.g. `## 23:55–--:--`) still rolls a plausible `[00:05]`
|
|
214
|
+
// segment forward.
|
|
215
|
+
const segWrapDuration =
|
|
216
|
+
current.wrapStartMin !== undefined && segMin !== undefined
|
|
217
|
+
? MINUTES_PER_DAY - current.wrapStartMin + segMin
|
|
218
|
+
: undefined;
|
|
219
|
+
const plausibleSegWrap =
|
|
220
|
+
current.wrapStartMin !== undefined &&
|
|
221
|
+
segMin !== undefined &&
|
|
222
|
+
segMin < current.wrapStartMin &&
|
|
223
|
+
segWrapDuration !== undefined &&
|
|
224
|
+
segWrapDuration <= MAX_PLAUSIBLE_WRAP_MINUTES;
|
|
225
|
+
const segDate = plausibleSegWrap ? nextCalendarDay(date) : date;
|
|
226
|
+
const startIso = clockToIso(clock, segDate);
|
|
227
|
+
// Decode the safely-serialized speaker label back to its original
|
|
228
|
+
// form ONLY when the body is escape-aware; legacy raw labels are
|
|
229
|
+
// used verbatim so their literal characters are never altered
|
|
230
|
+
// (#1849).
|
|
231
|
+
const speaker = escaped
|
|
232
|
+
? unescapeSpeakerLabel(label.trim())
|
|
233
|
+
: label.trim();
|
|
234
|
+
const segment: FusionSegmentInput = {
|
|
235
|
+
speaker,
|
|
236
|
+
// Self status is read from the RESERVED `(you)` marker, which the
|
|
237
|
+
// renderer guarantees can only appear on the wearer's label -
|
|
238
|
+
// never on a non-self display name (issue #1849).
|
|
239
|
+
isSelf: hasSelfMarker(speaker),
|
|
240
|
+
text,
|
|
241
|
+
...(startIso !== undefined ? { startIso } : {}),
|
|
242
|
+
};
|
|
243
|
+
current.segments.push(segment);
|
|
244
|
+
}
|
|
245
|
+
// Unrecognized lines (e.g. the H1 source header) are ignored.
|
|
246
|
+
}
|
|
247
|
+
flushCurrent();
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
return inputs;
|
|
251
|
+
}
|