@remnic/core 9.5.0 → 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 +12 -12
- package/dist/access-boundary.d.ts +6 -6
- package/dist/access-boundary.js +13 -13
- package/dist/access-cli.js +36 -36
- package/dist/access-http.d.ts +6 -6
- package/dist/access-http.js +17 -17
- package/dist/access-identity-continuity-surface.d.ts +5 -5
- package/dist/access-identity-continuity-surface.js +12 -12
- package/dist/access-lcm-surface.d.ts +6 -6
- package/dist/access-lcm-surface.js +12 -12
- package/dist/access-mcp.d.ts +6 -6
- package/dist/access-mcp.js +16 -16
- package/dist/access-observe-write-surface.d.ts +6 -6
- package/dist/access-observe-write-surface.js +12 -12
- package/dist/access-operations-batch.js +14 -14
- package/dist/access-operations.d.ts +7 -7
- package/dist/access-operations.js +15 -15
- package/dist/access-recall-surface.d.ts +6 -6
- package/dist/access-recall-surface.js +12 -12
- package/dist/access-schema.d.ts +4 -4
- package/dist/{access-service-DZX0sYAv.d.ts → access-service-CXJaql3A.d.ts} +4 -4
- package/dist/access-service.d.ts +6 -6
- package/dist/access-service.js +12 -12
- package/dist/access-surface-catalog.d.ts +6 -6
- 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 +1 -1
- package/dist/{auto-sync-G6IU7L6C.js → auto-sync-4A5YBWYO.js} +3 -3
- 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 +4 -4
- 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/{catalog-DoH2b0OR.d.ts → catalog-C9cu67Ig.d.ts} +1 -1
- package/dist/causal-behavior.d.ts +1 -1
- package/dist/causal-consolidation.d.ts +1 -1
- package/dist/causal-consolidation.js +5 -5
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-H5PFR5ZT.js → chunk-23JFRB73.js} +2 -2
- package/dist/{chunk-BGMSRN6I.js → chunk-3XIY7MDQ.js} +3 -3
- package/dist/{chunk-L2QJQSHL.js → chunk-4GNEDXDI.js} +2 -2
- package/dist/{chunk-MFDJ63U5.js → chunk-4LV23CHK.js} +2 -2
- package/dist/{chunk-AER6MT24.js → chunk-6SXVCD7W.js} +2 -2
- package/dist/{chunk-2SFEFR5I.js → chunk-72WG5QKN.js} +2 -2
- package/dist/{chunk-7BAJAXGB.js → chunk-7MW3CVLD.js} +2 -2
- package/dist/{chunk-SNNIUDRS.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-LNHJ32NK.js → chunk-BEM4D2QG.js} +3 -3
- package/dist/{chunk-AOYJVCFN.js → chunk-CYWA2CXR.js} +2 -2
- package/dist/{chunk-2JFDHI2K.js → chunk-DEG5ULFJ.js} +2 -2
- package/dist/{chunk-L6V3WJ55.js → chunk-DS7MM2ES.js} +3 -3
- package/dist/{chunk-CXEL3Y22.js → chunk-FKCRGLRD.js} +184 -29
- package/dist/{chunk-CXEL3Y22.js.map → chunk-FKCRGLRD.js.map} +1 -1
- package/dist/{chunk-TI7IHDBQ.js → chunk-H2DXDQCQ.js} +5 -5
- package/dist/{chunk-KMF67QDQ.js → chunk-HLN7RROI.js} +4 -4
- package/dist/{chunk-D2XYYU5Q.js → chunk-J3XHPFEU.js} +2 -2
- package/dist/{chunk-ODSYJXDU.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-4WNLSSHL.js → chunk-LADFWYHY.js} +4 -4
- package/dist/{chunk-UBGAOYBP.js → chunk-LR5DZ56F.js} +2 -2
- package/dist/{chunk-5K5VEDFY.js → chunk-N3JDIRBW.js} +2 -2
- package/dist/{chunk-2B7DP7AP.js → chunk-P454KXD6.js} +93 -15
- package/dist/chunk-P454KXD6.js.map +1 -0
- package/dist/{chunk-VWEWK2BM.js → chunk-PCLIWBGD.js} +3 -3
- package/dist/{chunk-TV7C3HCB.js → chunk-PNLFN2PZ.js} +2 -2
- package/dist/{chunk-STCCFQU5.js → chunk-PVUJ6WVV.js} +6 -6
- package/dist/{chunk-ITWTKT2R.js → chunk-RGK27ELN.js} +2 -2
- package/dist/{chunk-II6WHCCW.js → chunk-SIRPLF54.js} +2 -2
- package/dist/{chunk-UDCDGP6A.js → chunk-SVOHGUMI.js} +1188 -112
- package/dist/chunk-SVOHGUMI.js.map +1 -0
- package/dist/{chunk-NFTABV56.js → chunk-TLUDFPZL.js} +2 -2
- package/dist/{chunk-I74ZEBMA.js → chunk-UFUKHGZD.js} +4 -4
- package/dist/{chunk-L4UZBJNM.js → chunk-UTRJFDP2.js} +2 -2
- package/dist/{chunk-5GPPACXK.js → chunk-VSMRDBFT.js} +2 -1
- package/dist/{chunk-SNBEVJBX.js → chunk-XCL57M6Q.js} +3 -3
- package/dist/{chunk-DZSAXE3T.js → chunk-Y7UNNAZD.js} +2 -2
- package/dist/{chunk-XN3TUUX2.js → chunk-YQB32INI.js} +2 -2
- package/dist/{cli-1dghPCO2.d.ts → cli-CqdPA6z9.d.ts} +3 -3
- package/dist/cli.d.ts +7 -7
- package/dist/cli.js +29 -29
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +4 -4
- 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 +1 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +4 -4
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +4 -4
- 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/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/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 +4 -4
- 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/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 +268 -17
- package/dist/index.js +80 -38
- package/dist/intent.d.ts +1 -1
- package/dist/lcm/engine.d.ts +1 -1
- package/dist/lcm/index.d.ts +1 -1
- 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 +4 -4
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +4 -4
- package/dist/maintenance/rebuild-memory-projection.js +5 -5
- package/dist/mcp-memory-inspector-app.d.ts +6 -6
- 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 +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 +4 -4
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +2 -2
- package/dist/operator-toolkit.js +15 -15
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +2 -2
- package/dist/orchestration/maintenance.js +6 -6
- package/dist/{orchestrator-Dh3WSW_O.d.ts → orchestrator-CWFrT8AF.d.ts} +91 -60
- package/dist/orchestrator.d.ts +5 -5
- package/dist/orchestrator.js +36 -36
- 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-DoUVxqND.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 +2 -2
- 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 +6 -6
- package/dist/search/index.d.ts +1 -1
- package/dist/search/index.js +6 -6
- 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-Dof1865o.d.ts → semantic-consolidation-O5lMZ4LG.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +5 -5
- package/dist/semantic-rule-promotion.js +4 -4
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +4 -4
- 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 +3 -3
- 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/topics.d.ts +1 -1
- package/dist/transcript.d.ts +1 -1
- 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-C7HUgOuA.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 +4 -4
- package/package.json +2 -2
- package/src/cli-wearables-fuse.test.ts +197 -0
- package/src/cli.ts +25 -0
- package/src/storage.ts +16 -0
- 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-2B7DP7AP.js.map +0 -1
- package/dist/chunk-M7XQSUBB.js.map +0 -1
- package/dist/chunk-UDCDGP6A.js.map +0 -1
- /package/dist/{auto-sync-G6IU7L6C.js.map → auto-sync-4A5YBWYO.js.map} +0 -0
- /package/dist/{chunk-H5PFR5ZT.js.map → chunk-23JFRB73.js.map} +0 -0
- /package/dist/{chunk-BGMSRN6I.js.map → chunk-3XIY7MDQ.js.map} +0 -0
- /package/dist/{chunk-L2QJQSHL.js.map → chunk-4GNEDXDI.js.map} +0 -0
- /package/dist/{chunk-MFDJ63U5.js.map → chunk-4LV23CHK.js.map} +0 -0
- /package/dist/{chunk-AER6MT24.js.map → chunk-6SXVCD7W.js.map} +0 -0
- /package/dist/{chunk-2SFEFR5I.js.map → chunk-72WG5QKN.js.map} +0 -0
- /package/dist/{chunk-7BAJAXGB.js.map → chunk-7MW3CVLD.js.map} +0 -0
- /package/dist/{chunk-SNNIUDRS.js.map → chunk-AYZJID4S.js.map} +0 -0
- /package/dist/{chunk-LNHJ32NK.js.map → chunk-BEM4D2QG.js.map} +0 -0
- /package/dist/{chunk-AOYJVCFN.js.map → chunk-CYWA2CXR.js.map} +0 -0
- /package/dist/{chunk-2JFDHI2K.js.map → chunk-DEG5ULFJ.js.map} +0 -0
- /package/dist/{chunk-L6V3WJ55.js.map → chunk-DS7MM2ES.js.map} +0 -0
- /package/dist/{chunk-TI7IHDBQ.js.map → chunk-H2DXDQCQ.js.map} +0 -0
- /package/dist/{chunk-KMF67QDQ.js.map → chunk-HLN7RROI.js.map} +0 -0
- /package/dist/{chunk-D2XYYU5Q.js.map → chunk-J3XHPFEU.js.map} +0 -0
- /package/dist/{chunk-ODSYJXDU.js.map → chunk-JSNVWNGX.js.map} +0 -0
- /package/dist/{chunk-4WNLSSHL.js.map → chunk-LADFWYHY.js.map} +0 -0
- /package/dist/{chunk-UBGAOYBP.js.map → chunk-LR5DZ56F.js.map} +0 -0
- /package/dist/{chunk-5K5VEDFY.js.map → chunk-N3JDIRBW.js.map} +0 -0
- /package/dist/{chunk-VWEWK2BM.js.map → chunk-PCLIWBGD.js.map} +0 -0
- /package/dist/{chunk-TV7C3HCB.js.map → chunk-PNLFN2PZ.js.map} +0 -0
- /package/dist/{chunk-STCCFQU5.js.map → chunk-PVUJ6WVV.js.map} +0 -0
- /package/dist/{chunk-ITWTKT2R.js.map → chunk-RGK27ELN.js.map} +0 -0
- /package/dist/{chunk-II6WHCCW.js.map → chunk-SIRPLF54.js.map} +0 -0
- /package/dist/{chunk-NFTABV56.js.map → chunk-TLUDFPZL.js.map} +0 -0
- /package/dist/{chunk-I74ZEBMA.js.map → chunk-UFUKHGZD.js.map} +0 -0
- /package/dist/{chunk-L4UZBJNM.js.map → chunk-UTRJFDP2.js.map} +0 -0
- /package/dist/{chunk-5GPPACXK.js.map → chunk-VSMRDBFT.js.map} +0 -0
- /package/dist/{chunk-SNBEVJBX.js.map → chunk-XCL57M6Q.js.map} +0 -0
- /package/dist/{chunk-DZSAXE3T.js.map → chunk-Y7UNNAZD.js.map} +0 -0
- /package/dist/{chunk-XN3TUUX2.js.map → chunk-YQB32INI.js.map} +0 -0
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wearable cross-source fusion — shared types (issue #1810).
|
|
3
|
+
*
|
|
4
|
+
* Fusion merges same-day conversations from multiple enabled wearable
|
|
5
|
+
* sources into `FusedWearableConversation` artifacts: one reconciled
|
|
6
|
+
* timeline per real-world conversation, with per-segment source
|
|
7
|
+
* provenance and unresolved conflicts surfaced as `disagreements[]`.
|
|
8
|
+
*
|
|
9
|
+
* Everything in this module is DETERMINISTIC — no LLM calls. LLM-assisted
|
|
10
|
+
* reconciliation, memory-extraction over fused artifacts, and full
|
|
11
|
+
* segment-level alignment are deferred follow-ups (see PR body).
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* One normalized segment fed into fusion. Speaker labels are already
|
|
16
|
+
* resolved through the speaker registry (`resolveSpeaker`), and text is
|
|
17
|
+
* post-cleanup + post-redaction — fusion consumes the same material day
|
|
18
|
+
* transcripts store, never raw provider output.
|
|
19
|
+
*/
|
|
20
|
+
export interface FusionSegmentInput {
|
|
21
|
+
/** Resolved speaker label (e.g. "Jane", "Me (you)", "Speaker 0"). */
|
|
22
|
+
speaker: string;
|
|
23
|
+
/** Whether this speaker is the wearer. */
|
|
24
|
+
isSelf: boolean;
|
|
25
|
+
/** Utterance text. */
|
|
26
|
+
text: string;
|
|
27
|
+
/** ISO 8601 start, when known. */
|
|
28
|
+
startIso?: string;
|
|
29
|
+
/** ISO 8601 end, when known. */
|
|
30
|
+
endIso?: string;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
/** One normalized conversation fed into fusion. */
|
|
34
|
+
export interface FusionConversationInput {
|
|
35
|
+
/** Source id this conversation came from. */
|
|
36
|
+
source: string;
|
|
37
|
+
/** Provider-stable conversation id within that source. */
|
|
38
|
+
conversationId: string;
|
|
39
|
+
/** Provider title, when available. */
|
|
40
|
+
title?: string;
|
|
41
|
+
/** Provider summary, when available. */
|
|
42
|
+
summary?: string;
|
|
43
|
+
/** ISO 8601 conversation start. */
|
|
44
|
+
startIso: string;
|
|
45
|
+
/** ISO 8601 conversation end, when known. */
|
|
46
|
+
endIso?: string;
|
|
47
|
+
/** Ordered normalized segments. */
|
|
48
|
+
segments: FusionSegmentInput[];
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** Why a particular source's text was chosen for a fused segment. */
|
|
52
|
+
export type SegmentPickReason =
|
|
53
|
+
| "only-source"
|
|
54
|
+
| "higher-trust"
|
|
55
|
+
| "more-complete"
|
|
56
|
+
| "tie-break";
|
|
57
|
+
|
|
58
|
+
/** Kind of unresolved conflict surfaced during reconciliation. */
|
|
59
|
+
export type DisagreementKind = "asr-text" | "speaker" | "timestamp";
|
|
60
|
+
|
|
61
|
+
/** Per-segment record of where the chosen text came from and what else was considered. */
|
|
62
|
+
export interface FusedSegmentProvenance {
|
|
63
|
+
/** Source id the chosen text came from. */
|
|
64
|
+
source: string;
|
|
65
|
+
/** Conversation id within that source. */
|
|
66
|
+
conversationId: string;
|
|
67
|
+
/** Trust weight of the chosen source at reconciliation time (0..1). */
|
|
68
|
+
sourceTrust: number;
|
|
69
|
+
/** Why this source won the pick. */
|
|
70
|
+
reason: SegmentPickReason;
|
|
71
|
+
/** Other sources that offered a candidate text for this window/speaker. */
|
|
72
|
+
alternatives: Array<{ source: string; text: string }>;
|
|
73
|
+
/** The chosen source's ORIGINAL start time (ISO), when known. The fused
|
|
74
|
+
* segment is emitted on the group/window ANCHOR timeline position so
|
|
75
|
+
* pre-sorted chronology stays valid even when the higher-trust source's
|
|
76
|
+
* clock is later than the anchor; this preserves WHERE the chosen text
|
|
77
|
+
* was actually recorded for provenance/traceability. */
|
|
78
|
+
sourceStartIso?: string;
|
|
79
|
+
/** The chosen source's ORIGINAL end time (ISO), when known (see sourceStartIso). */
|
|
80
|
+
sourceEndIso?: string;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/** One reconciled utterance in a fused conversation. */
|
|
84
|
+
export interface FusedSegment {
|
|
85
|
+
/** Reconciled speaker label. */
|
|
86
|
+
speaker: string;
|
|
87
|
+
/** Whether this speaker is the wearer. */
|
|
88
|
+
isSelf: boolean;
|
|
89
|
+
/** Reconciled utterance text. */
|
|
90
|
+
text: string;
|
|
91
|
+
/** Window start (ISO), when known. */
|
|
92
|
+
startIso?: string;
|
|
93
|
+
/** Window end (ISO), when known. */
|
|
94
|
+
endIso?: string;
|
|
95
|
+
/** 0..1 confidence in this segment's text + attribution. */
|
|
96
|
+
confidence: number;
|
|
97
|
+
provenance: FusedSegmentProvenance;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
/** An unresolved conflict that reconciliation could not settle deterministically. */
|
|
101
|
+
export interface FusedDisagreement {
|
|
102
|
+
kind: DisagreementKind;
|
|
103
|
+
/**
|
|
104
|
+
* What the disagreement concerns — an ISO window anchor, a speaker
|
|
105
|
+
* label, or "(no timestamp)" for un-timestamped windows.
|
|
106
|
+
*/
|
|
107
|
+
subject: string;
|
|
108
|
+
/** The conflicting candidates that could not be auto-resolved. */
|
|
109
|
+
candidates: Array<{ source: string; value: string }>;
|
|
110
|
+
/** Best-effort provisional winner; marked uncertain, NOT authoritative. */
|
|
111
|
+
provisional?: { source: string; value: string };
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
/** A reconciled speaker that appears in the fused conversation. */
|
|
115
|
+
export interface FusedSpeaker {
|
|
116
|
+
/** Display label. */
|
|
117
|
+
label: string;
|
|
118
|
+
/** Whether this speaker is the wearer. */
|
|
119
|
+
isSelf: boolean;
|
|
120
|
+
/**
|
|
121
|
+
* 0..1 — lowered when a speaker could not be confidently matched
|
|
122
|
+
* across sources (e.g. a generic diarization label seen in one
|
|
123
|
+
* source only).
|
|
124
|
+
*/
|
|
125
|
+
confidence: number;
|
|
126
|
+
/** Source ids that produced this speaker. */
|
|
127
|
+
sources: string[];
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Record of one source conversation that fed a fused conversation. */
|
|
131
|
+
export interface FusedContribution {
|
|
132
|
+
source: string;
|
|
133
|
+
conversationId: string;
|
|
134
|
+
startIso: string;
|
|
135
|
+
endIso?: string;
|
|
136
|
+
segmentCount: number;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
/** How a fused conversation was assembled. */
|
|
140
|
+
export interface FusedConversationProvenance {
|
|
141
|
+
/** Source conversations that fed this cluster. */
|
|
142
|
+
contributions: FusedContribution[];
|
|
143
|
+
/** Max gap (ms) two conversations could span and still merge. */
|
|
144
|
+
proximityGapMs: number;
|
|
145
|
+
/** Max drift (ms) for two segments to align across sources. */
|
|
146
|
+
windowToleranceMs: number;
|
|
147
|
+
/** Clustering method (deterministic, time-proximity based). */
|
|
148
|
+
method: "time-proximity";
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/**
|
|
152
|
+
* A real-world conversation reconstructed from one or more wearable
|
|
153
|
+
* sources recording at the same time. The fused artifact.
|
|
154
|
+
*/
|
|
155
|
+
export interface FusedWearableConversation {
|
|
156
|
+
/** Stable content-hash id (deterministic from inputs; idempotent). */
|
|
157
|
+
id: string;
|
|
158
|
+
/** YYYY-MM-DD the conversation was recorded. */
|
|
159
|
+
date: string;
|
|
160
|
+
/** Earliest start across contributing sources. */
|
|
161
|
+
startIso: string;
|
|
162
|
+
/** Latest end across contributing sources, when known. */
|
|
163
|
+
endIso?: string;
|
|
164
|
+
/** Source ids that contributed at least one conversation. */
|
|
165
|
+
sources: string[];
|
|
166
|
+
/** Reconciled speakers (deduped across sources). */
|
|
167
|
+
speakers: FusedSpeaker[];
|
|
168
|
+
/** Provider title, when any source supplied one. */
|
|
169
|
+
title?: string;
|
|
170
|
+
/** Provider summary, when any source supplied one. */
|
|
171
|
+
summary?: string;
|
|
172
|
+
/** Aligned, reconciled segments in chronological order. */
|
|
173
|
+
segments: FusedSegment[];
|
|
174
|
+
/** Unresolved conflicts surfaced during reconciliation. */
|
|
175
|
+
disagreements: FusedDisagreement[];
|
|
176
|
+
provenance: FusedConversationProvenance;
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/** Options for a fusion pass. */
|
|
180
|
+
export interface FusionOptions {
|
|
181
|
+
/** Max gap (ms) between conversations to merge into one cluster. */
|
|
182
|
+
proximityGapMs?: number;
|
|
183
|
+
/** Max drift (ms) for two segments to align across sources. */
|
|
184
|
+
windowToleranceMs?: number;
|
|
185
|
+
/** Per-source trust weights (unknown sources default to 0.8). */
|
|
186
|
+
sourceTrust?: Record<string, number>;
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
/** Result of fusing one day across all sources. */
|
|
190
|
+
export interface FusionDayResult {
|
|
191
|
+
date: string;
|
|
192
|
+
conversations: FusedWearableConversation[];
|
|
193
|
+
/** Distinct source ids that contributed any conversation. */
|
|
194
|
+
sources: string[];
|
|
195
|
+
/** SHA-256 over the canonical input serialization + effective fusion config (idempotency key). */
|
|
196
|
+
contentHash: string;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/** Frontmatter persisted on a fused-day derived file. */
|
|
200
|
+
export interface FusedDayMeta {
|
|
201
|
+
kind: "wearable-fusion";
|
|
202
|
+
date: string;
|
|
203
|
+
sourceCount: number;
|
|
204
|
+
conversationCount: number;
|
|
205
|
+
contentHash: string;
|
|
206
|
+
/**
|
|
207
|
+
* SHA-256 over the canonical serialized body (`hashFusionBody`). Stored
|
|
208
|
+
* so the skip-unchanged path can detect a body whose bytes drifted from
|
|
209
|
+
* the recomputed artifact even when `contentHash` + conversation count
|
|
210
|
+
* still match — forcing a self-repair rewrite on body-level corruption.
|
|
211
|
+
*/
|
|
212
|
+
bodyHash: string;
|
|
213
|
+
fusedAt: string;
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
/** A parsed fused-day derived file. */
|
|
217
|
+
export interface FusedDayFile {
|
|
218
|
+
meta: FusedDayMeta;
|
|
219
|
+
conversations: FusedWearableConversation[];
|
|
220
|
+
/**
|
|
221
|
+
* False when the JSON body failed to parse (truncated/corrupt). A
|
|
222
|
+
* legitimately empty (`[]`) body parses fine — parseOk stays true — so
|
|
223
|
+
* callers can distinguish "nothing to fuse" from a broken file and force
|
|
224
|
+
* a self-repair rewrite even when the frontmatter hash matches and the
|
|
225
|
+
* parsed conversation count is also zero.
|
|
226
|
+
*/
|
|
227
|
+
parseOk: boolean;
|
|
228
|
+
}
|
package/src/wearables/index.ts
CHANGED
|
@@ -9,6 +9,7 @@ export * from "./types.js";
|
|
|
9
9
|
export { describeErrorForOperator, WearablesInputError } from "./errors.js";
|
|
10
10
|
export {
|
|
11
11
|
defaultWearableCleanupSettings,
|
|
12
|
+
defaultWearableFusionConfig,
|
|
12
13
|
defaultWearableSourceSettings,
|
|
13
14
|
defaultWearablesConfig,
|
|
14
15
|
KNOWN_WEARABLE_SOURCE_IDS,
|
|
@@ -60,13 +61,21 @@ export {
|
|
|
60
61
|
type SpeakerRegistry,
|
|
61
62
|
} from "./speakers.js";
|
|
62
63
|
export {
|
|
64
|
+
bodyIsEscaped,
|
|
63
65
|
composeDayTranscriptBody,
|
|
64
66
|
composeDayTranscriptMeta,
|
|
67
|
+
decodeTranscriptBody,
|
|
68
|
+
escapeSegmentText,
|
|
65
69
|
hashTranscriptBody,
|
|
66
70
|
isValidTranscriptDate,
|
|
67
71
|
parseDayTranscript,
|
|
72
|
+
parseTranscriptSegmentLine,
|
|
68
73
|
serializeDayTranscript,
|
|
74
|
+
TRANSCRIPT_FORMAT_VERSION,
|
|
75
|
+
unescapeSegmentText,
|
|
76
|
+
unescapeSpeakerLabel,
|
|
69
77
|
WEARABLES_DIR_NAME,
|
|
78
|
+
type TranscriptSegmentMatch,
|
|
70
79
|
} from "./day-store.js";
|
|
71
80
|
export {
|
|
72
81
|
emptySyncState,
|
|
@@ -112,3 +121,35 @@ export {
|
|
|
112
121
|
type WearableTranscriptSearchResult,
|
|
113
122
|
type WearablesServiceDeps,
|
|
114
123
|
} from "./service.js";
|
|
124
|
+
|
|
125
|
+
export {
|
|
126
|
+
clusterConversations,
|
|
127
|
+
composeFusionDayMeta,
|
|
128
|
+
DEFAULT_PROXIMITY_GAP_MS,
|
|
129
|
+
DEFAULT_SOURCE_TRUST,
|
|
130
|
+
DEFAULT_WINDOW_TOLERANCE_MS,
|
|
131
|
+
FUSION_KIND,
|
|
132
|
+
fuseCluster,
|
|
133
|
+
fuseDay,
|
|
134
|
+
fusionInputsFromConversations,
|
|
135
|
+
hashFusionBody,
|
|
136
|
+
parseFusionDay,
|
|
137
|
+
reconstructFusionInputs,
|
|
138
|
+
serializeFusionDay,
|
|
139
|
+
type FuseClusterResult,
|
|
140
|
+
type DisagreementKind,
|
|
141
|
+
type FusionConversationInput,
|
|
142
|
+
type FusionDayResult,
|
|
143
|
+
type FusionOptions,
|
|
144
|
+
type FusionSegmentInput,
|
|
145
|
+
type FusedConversationProvenance,
|
|
146
|
+
type FusedContribution,
|
|
147
|
+
type FusedDayFile,
|
|
148
|
+
type FusedDayMeta,
|
|
149
|
+
type FusedDisagreement,
|
|
150
|
+
type FusedSegment,
|
|
151
|
+
type FusedSegmentProvenance,
|
|
152
|
+
type FusedSpeaker,
|
|
153
|
+
type FusedWearableConversation,
|
|
154
|
+
type SegmentPickReason,
|
|
155
|
+
} from "./fusion/index.js";
|