@remnic/core 9.15.3 → 9.16.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 +8 -8
- package/dist/access-admin-ops-surface.js +7 -7
- package/dist/access-boundary.d.ts +8 -8
- package/dist/access-boundary.js +7 -7
- package/dist/access-cli.js +31 -30
- package/dist/access-cli.js.map +1 -1
- package/dist/access-http.d.ts +8 -8
- package/dist/access-http.js +11 -11
- package/dist/access-identity-continuity-surface.d.ts +6 -6
- package/dist/access-identity-continuity-surface.js +7 -7
- package/dist/access-lcm-surface.d.ts +8 -8
- package/dist/access-lcm-surface.js +7 -7
- package/dist/access-mcp.d.ts +8 -8
- package/dist/access-mcp.js +10 -10
- package/dist/access-memory-search-fanout.d.ts +2 -2
- package/dist/{access-namespace-preflight-B9e5GnyZ.d.ts → access-namespace-preflight-DwhEFYy3.d.ts} +1 -1
- package/dist/access-namespace-preflight.d.ts +3 -3
- package/dist/access-namespace-preflight.js +7 -7
- package/dist/access-observe-write-surface.d.ts +8 -8
- package/dist/access-observe-write-surface.js +7 -7
- package/dist/access-operations-batch.js +8 -8
- package/dist/access-operations.d.ts +8 -8
- package/dist/access-operations.js +9 -9
- package/dist/access-recall-concurrency.d.ts +8 -8
- package/dist/access-recall-concurrency.js +7 -7
- package/dist/access-recall-response.d.ts +8 -8
- package/dist/access-recall-response.js +7 -7
- package/dist/access-recall-surface.d.ts +8 -8
- package/dist/access-recall-surface.js +7 -7
- package/dist/{access-service-DgmJd_A-.d.ts → access-service-CSq1Wp2Z.d.ts} +6 -6
- package/dist/access-service.d.ts +8 -8
- package/dist/access-service.js +7 -7
- package/dist/access-surface-catalog.d.ts +8 -8
- 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 -1
- package/dist/active-recall.js.map +1 -1
- package/dist/behavior-learner.d.ts +1 -1
- package/dist/behavior-signals.d.ts +1 -1
- package/dist/bootstrap.d.ts +6 -6
- package/dist/briefing.d.ts +2 -2
- package/dist/briefing.js +3 -3
- package/dist/buffer-surprise-report.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/{catalog-g_dfT6oL.d.ts → catalog-B9uga4sG.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 +4 -4
- package/dist/causal-trajectory-graph.d.ts +1 -1
- package/dist/{chunk-IRX5UCGN.js → chunk-2OH3ZRYH.js} +3 -3
- package/dist/{chunk-YXTSUIXC.js → chunk-5EKOBRCA.js} +6 -1
- package/dist/chunk-5EKOBRCA.js.map +1 -0
- package/dist/{chunk-42DJZZUB.js → chunk-7LXSPIVG.js} +2 -2
- package/dist/{chunk-47WFEKT7.js → chunk-7PK4W4RN.js} +2 -2
- package/dist/{chunk-O7ACJAHR.js → chunk-7YJLCNPF.js} +2 -2
- package/dist/{chunk-6EJL2O3G.js → chunk-AFH7PIFU.js} +2 -2
- package/dist/{chunk-JN4N2TMQ.js → chunk-ANGUOE2N.js} +7 -7
- package/dist/{chunk-GQOKO77V.js → chunk-AWT7SCWQ.js} +2 -2
- package/dist/{chunk-PXJEL55X.js → chunk-BIRPR5N7.js} +2 -2
- package/dist/{chunk-NAY25BGS.js → chunk-BTK2PIFL.js} +6 -6
- package/dist/{chunk-SYCVU556.js → chunk-C2RMQRPN.js} +3 -3
- package/dist/{chunk-T4EAQPQQ.js → chunk-G2WCVFDC.js} +2 -2
- package/dist/{chunk-UJIBXOJA.js → chunk-GEDBTSYU.js} +5 -5
- package/dist/{chunk-CXFVZ3PK.js → chunk-GRJ5UOFO.js} +84 -658
- package/dist/chunk-GRJ5UOFO.js.map +1 -0
- package/dist/chunk-GSQASASV.js +429 -0
- package/dist/chunk-GSQASASV.js.map +1 -0
- package/dist/{chunk-WIKOHCQZ.js → chunk-I6ODVWQB.js} +2 -2
- package/dist/{chunk-H4MDUPER.js → chunk-IZHXSLO7.js} +2 -2
- package/dist/{chunk-RRS5CDB6.js → chunk-JOCXI2O5.js} +2 -2
- package/dist/{chunk-EEUZQQRJ.js → chunk-KGKYTCDO.js} +2 -2
- package/dist/{chunk-JTW4TGPV.js → chunk-L3HAUO7K.js} +2 -2
- package/dist/{chunk-P53HGVJS.js → chunk-LMVAIZR5.js} +2 -2
- package/dist/{chunk-KLXG4BBO.js → chunk-M6TZQDTX.js} +2 -2
- package/dist/{chunk-FJ5IQ3SI.js → chunk-N7DK67GZ.js} +1 -1
- package/dist/chunk-N7DK67GZ.js.map +1 -0
- package/dist/{chunk-U6QWUFSM.js → chunk-OXT5TQDS.js} +2 -2
- package/dist/{chunk-T4OTDMX4.js → chunk-QDTEH6BS.js} +2 -2
- package/dist/{chunk-5MDE5MIC.js → chunk-SESF64QR.js} +2 -2
- package/dist/{chunk-4E5H4FPC.js → chunk-TUNI4GB3.js} +3 -3
- package/dist/{chunk-XJT6LNLY.js → chunk-V6LYAXGW.js} +834 -25
- package/dist/chunk-V6LYAXGW.js.map +1 -0
- package/dist/{chunk-5HFIHWOF.js → chunk-VLIY55Q5.js} +17 -17
- package/dist/{chunk-BNH2VVWP.js → chunk-WIS5JTJR.js} +2 -2
- package/dist/{chunk-OOGGUXAG.js → chunk-WQ2I6ODB.js} +2 -2
- package/dist/{cli-BXCd2cgK.d.ts → cli-DYLGXxuu.d.ts} +5 -5
- package/dist/cli.d.ts +10 -10
- package/dist/cli.js +25 -24
- package/dist/compounding/engine.d.ts +2 -2
- package/dist/compounding/engine.js +3 -3
- 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 -1
- package/dist/connectors/codex-materialize-runner.d.ts +1 -1
- package/dist/connectors/codex-materialize-runner.js +3 -3
- package/dist/connectors/codex-materialize.d.ts +1 -1
- package/dist/connectors/index.d.ts +1 -1
- package/dist/connectors/index.js +3 -3
- 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 +3 -3
- package/dist/entity-schema.d.ts +1 -1
- package/dist/explicit-capture.d.ts +6 -6
- 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/importance.d.ts +1 -1
- package/dist/importers/index.d.ts +1 -1
- package/dist/in-flight-reads.d.ts +1 -1
- package/dist/index.d.ts +289 -99
- package/dist/index.js +70 -45
- 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 +3 -3
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.d.ts +2 -2
- package/dist/maintenance/rebuild-memory-lifecycle-ledger.js +3 -3
- package/dist/maintenance/rebuild-memory-projection.js +4 -4
- package/dist/mcp-memory-inspector-app.d.ts +8 -8
- 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 +4 -4
- package/dist/namespaces/principal.d.ts +1 -1
- package/dist/namespaces/search.d.ts +1 -1
- package/dist/namespaces/storage.d.ts +3 -3
- package/dist/namespaces/storage.js +3 -3
- package/dist/native-knowledge.d.ts +1 -1
- package/dist/offline-sync-impression-drain.d.ts +1 -1
- package/dist/operator-toolkit.d.ts +2 -2
- package/dist/operator-toolkit.js +9 -8
- package/dist/orchestration/compression-guideline-coordinator.d.ts +2 -2
- package/dist/orchestration/maintenance.d.ts +10 -7
- package/dist/orchestration/maintenance.js +7 -6
- package/dist/{orchestrator-BHfWtvEJ.d.ts → orchestrator-BHx-DWCa.d.ts} +7 -5
- package/dist/orchestrator.d.ts +6 -6
- package/dist/orchestrator.js +31 -30
- package/dist/patterns-cli.d.ts +1 -1
- package/dist/{pipeline-CBYcnmDC.d.ts → pipeline-DDHSE876.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/{qmd-BIq-jrV4.d.ts → qmd-C4WVh6BM.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-explain-renderer.js +3 -3
- 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-cli.js +4 -4
- package/dist/recall-xray-renderer.d.ts +1 -1
- package/dist/recall-xray-renderer.js +3 -3
- package/dist/recall-xray.d.ts +1 -1
- package/dist/recall-xray.js +2 -2
- package/dist/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/resolve-auth-token.d.ts +1 -1
- package/dist/resume-bundles.js +3 -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/salvage-envelope.d.ts +1 -1
- package/dist/{scope-profiles-DDno-uvy.d.ts → scope-profiles-EqMXwzCz.d.ts} +1 -1
- package/dist/search/embed-helper.d.ts +1 -1
- package/dist/search/factory.d.ts +1 -1
- package/dist/search/index.d.ts +1 -1
- package/dist/search/lancedb-backend.d.ts +1 -1
- package/dist/search/meilisearch-backend.d.ts +1 -1
- package/dist/search/noop-backend.d.ts +1 -1
- package/dist/search/orama-backend.d.ts +1 -1
- package/dist/search/port.d.ts +1 -1
- package/dist/search/remote-backend.d.ts +1 -1
- package/dist/{semantic-consolidation-7RIJFDwY.d.ts → semantic-consolidation-CYpvwmQc.d.ts} +1 -1
- package/dist/semantic-consolidation.d.ts +2 -2
- package/dist/semantic-consolidation.js +4 -4
- package/dist/semantic-rule-promotion.js +3 -3
- package/dist/semantic-rule-verifier.d.ts +1 -1
- package/dist/semantic-rule-verifier.js +3 -3
- 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-DkphZiOJ.d.ts → storage-Dxd7zVZH.d.ts} +1 -1
- package/dist/storage.d.ts +2 -2
- package/dist/storage.js +2 -2
- 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-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/trust-score-stage.d.ts +1 -1
- package/dist/trust-score.d.ts +1 -1
- package/dist/{types-2q_MRFcM.d.ts → types-OUCJALBK.d.ts} +98 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +1 -1
- package/dist/utility-runtime.d.ts +1 -1
- package/dist/verified-recall.js +3 -3
- package/dist/write-envelope.d.ts +1 -1
- package/package.json +2 -2
- package/src/activity/config.test.ts +113 -0
- package/src/activity/config.ts +111 -0
- package/src/activity/digest.ts +2 -2
- package/src/activity/index.ts +6 -0
- package/src/activity/pipeline.test.ts +379 -0
- package/src/activity/pipeline.ts +223 -0
- package/src/activity/reindex.test.ts +97 -0
- package/src/activity/reindex.ts +40 -0
- package/src/activity/runner.test.ts +452 -0
- package/src/activity/runner.ts +237 -0
- package/src/activity/scheduler.test.ts +303 -0
- package/src/activity/scheduler.ts +147 -0
- package/src/activity/source-client.test.ts +208 -0
- package/src/activity/source-client.ts +159 -0
- package/src/activity/sync-registration.test.ts +134 -0
- package/src/activity/sync-registration.ts +139 -0
- package/src/activity/types.ts +17 -0
- package/src/config.test.ts +19 -0
- package/src/config.ts +3 -0
- package/src/orchestration/maintenance.test.ts +42 -42
- package/src/orchestration/maintenance.ts +37 -5
- package/src/orchestration/orchestrator-helpers.ts +36 -1
- package/src/orchestration/recall-internal.ts +6 -6
- package/src/orchestration/recall-search-pipeline.ts +15 -7
- package/src/orchestrator-background-writes.test.ts +2 -2
- package/src/orchestrator.ts +3 -3
- package/src/types.ts +4 -1
- package/dist/chunk-CXFVZ3PK.js.map +0 -1
- package/dist/chunk-FJ5IQ3SI.js.map +0 -1
- package/dist/chunk-XJT6LNLY.js.map +0 -1
- package/dist/chunk-YXTSUIXC.js.map +0 -1
- /package/dist/{chunk-IRX5UCGN.js.map → chunk-2OH3ZRYH.js.map} +0 -0
- /package/dist/{chunk-42DJZZUB.js.map → chunk-7LXSPIVG.js.map} +0 -0
- /package/dist/{chunk-47WFEKT7.js.map → chunk-7PK4W4RN.js.map} +0 -0
- /package/dist/{chunk-O7ACJAHR.js.map → chunk-7YJLCNPF.js.map} +0 -0
- /package/dist/{chunk-6EJL2O3G.js.map → chunk-AFH7PIFU.js.map} +0 -0
- /package/dist/{chunk-JN4N2TMQ.js.map → chunk-ANGUOE2N.js.map} +0 -0
- /package/dist/{chunk-GQOKO77V.js.map → chunk-AWT7SCWQ.js.map} +0 -0
- /package/dist/{chunk-PXJEL55X.js.map → chunk-BIRPR5N7.js.map} +0 -0
- /package/dist/{chunk-NAY25BGS.js.map → chunk-BTK2PIFL.js.map} +0 -0
- /package/dist/{chunk-SYCVU556.js.map → chunk-C2RMQRPN.js.map} +0 -0
- /package/dist/{chunk-T4EAQPQQ.js.map → chunk-G2WCVFDC.js.map} +0 -0
- /package/dist/{chunk-UJIBXOJA.js.map → chunk-GEDBTSYU.js.map} +0 -0
- /package/dist/{chunk-WIKOHCQZ.js.map → chunk-I6ODVWQB.js.map} +0 -0
- /package/dist/{chunk-H4MDUPER.js.map → chunk-IZHXSLO7.js.map} +0 -0
- /package/dist/{chunk-RRS5CDB6.js.map → chunk-JOCXI2O5.js.map} +0 -0
- /package/dist/{chunk-EEUZQQRJ.js.map → chunk-KGKYTCDO.js.map} +0 -0
- /package/dist/{chunk-JTW4TGPV.js.map → chunk-L3HAUO7K.js.map} +0 -0
- /package/dist/{chunk-P53HGVJS.js.map → chunk-LMVAIZR5.js.map} +0 -0
- /package/dist/{chunk-KLXG4BBO.js.map → chunk-M6TZQDTX.js.map} +0 -0
- /package/dist/{chunk-U6QWUFSM.js.map → chunk-OXT5TQDS.js.map} +0 -0
- /package/dist/{chunk-T4OTDMX4.js.map → chunk-QDTEH6BS.js.map} +0 -0
- /package/dist/{chunk-5MDE5MIC.js.map → chunk-SESF64QR.js.map} +0 -0
- /package/dist/{chunk-4E5H4FPC.js.map → chunk-TUNI4GB3.js.map} +0 -0
- /package/dist/{chunk-5HFIHWOF.js.map → chunk-VLIY55Q5.js.map} +0 -0
- /package/dist/{chunk-BNH2VVWP.js.map → chunk-WIS5JTJR.js.map} +0 -0
- /package/dist/{chunk-OOGGUXAG.js.map → chunk-WQ2I6ODB.js.map} +0 -0
|
@@ -84,6 +84,102 @@ declare function isImportRole(value: unknown): value is ImportSourceRole;
|
|
|
84
84
|
declare function parseIsoTimestamp(value: string): number | null;
|
|
85
85
|
declare function validateImportTurn(turn: ImportTurn, index?: number): ImportTurnValidationIssue[];
|
|
86
86
|
|
|
87
|
+
/**
|
|
88
|
+
* Screen-activity subsystem — shared types (issue #1899).
|
|
89
|
+
*
|
|
90
|
+
* A third ingestion modality alongside wearables (conversations) and live
|
|
91
|
+
* connectors (documents). Screen text has no speakers and is high-volume, so it
|
|
92
|
+
* gets its own store and day-digest rather than being forced into the wearable
|
|
93
|
+
* conversation shape. Capture daemons live in the à-la-carte `@remnic/capture-screen`
|
|
94
|
+
* package; this core subsystem is host-agnostic and consumes snapshots over a
|
|
95
|
+
* loopback HTTP client.
|
|
96
|
+
*
|
|
97
|
+
* All timestamps are UTC ISO-8601; day bucketing is half-open [start, end).
|
|
98
|
+
*/
|
|
99
|
+
/** One captured on-screen text snapshot (a single window at a single instant). */
|
|
100
|
+
interface ActivitySnapshot {
|
|
101
|
+
/** Store row id (assigned on insert; absent before persistence). */
|
|
102
|
+
id?: number;
|
|
103
|
+
/** Capture-machine label (disambiguates multi-machine stores). */
|
|
104
|
+
machine: string;
|
|
105
|
+
/** UTC ISO-8601 capture instant. */
|
|
106
|
+
capturedAtUtc: string;
|
|
107
|
+
/** Frontmost application name. */
|
|
108
|
+
app: string;
|
|
109
|
+
/** Frontmost window title. */
|
|
110
|
+
windowTitle: string;
|
|
111
|
+
/** Browser tab URL, when the frontmost window is a known browser. */
|
|
112
|
+
browserUrl?: string;
|
|
113
|
+
/** Extracted visible text (accessibility tree or OCR). */
|
|
114
|
+
text: string;
|
|
115
|
+
/** Where the text came from. */
|
|
116
|
+
textSource: "ax" | "ocr";
|
|
117
|
+
/** SHA-256 of the normalized snapshot content (idempotency key). */
|
|
118
|
+
contentHash: string;
|
|
119
|
+
/** 64-bit SimHash (hex) for near-duplicate detection, when computed. */
|
|
120
|
+
simhash?: string;
|
|
121
|
+
}
|
|
122
|
+
/** Frontmatter persisted on a rendered day digest. */
|
|
123
|
+
interface ActivityDayMeta {
|
|
124
|
+
kind: "activity-digest";
|
|
125
|
+
/** Local day, YYYY-MM-DD. */
|
|
126
|
+
date: string;
|
|
127
|
+
/** Machines that contributed snapshots, sorted. */
|
|
128
|
+
machines: string[];
|
|
129
|
+
snapshotCount: number;
|
|
130
|
+
/** SHA-256 of the rendered body (rebuild-idempotency). */
|
|
131
|
+
contentHash: string;
|
|
132
|
+
formatVersion: number;
|
|
133
|
+
}
|
|
134
|
+
/** A parsed day digest (frontmatter + rendered body). */
|
|
135
|
+
interface ActivityDayDigest {
|
|
136
|
+
meta: ActivityDayMeta;
|
|
137
|
+
body: string;
|
|
138
|
+
}
|
|
139
|
+
/** Result of a capture-daemon auth/health probe. */
|
|
140
|
+
interface ActivitySourceCheck {
|
|
141
|
+
ok: boolean;
|
|
142
|
+
detail?: string;
|
|
143
|
+
}
|
|
144
|
+
/** One page of snapshots pulled from a capture daemon. */
|
|
145
|
+
interface ActivitySnapshotPage {
|
|
146
|
+
snapshots: ActivitySnapshot[];
|
|
147
|
+
nextCursor: string | null;
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* Client contract for a screen-capture daemon (one per capture machine).
|
|
151
|
+
* Implemented by a later slice (the HTTP source client); defined here so the
|
|
152
|
+
* store and pipeline can be built and tested against a fixture double first.
|
|
153
|
+
*/
|
|
154
|
+
interface ActivitySourceClient {
|
|
155
|
+
/** Stable capture-machine label. */
|
|
156
|
+
machineLabel: string;
|
|
157
|
+
/** Probe connectivity/auth without mutating anything. */
|
|
158
|
+
verify(signal?: AbortSignal): Promise<ActivitySourceCheck>;
|
|
159
|
+
/** Fetch one page of snapshots for a single local day. */
|
|
160
|
+
fetchSnapshots(opts: {
|
|
161
|
+
date: string;
|
|
162
|
+
timezone: string;
|
|
163
|
+
cursor?: string | null;
|
|
164
|
+
signal?: AbortSignal;
|
|
165
|
+
}): Promise<ActivitySnapshotPage>;
|
|
166
|
+
}
|
|
167
|
+
/** One trusted capture daemon that feeds this memory directory. */
|
|
168
|
+
interface ActivitySourceConfig {
|
|
169
|
+
machineLabel: string;
|
|
170
|
+
baseUrl: string;
|
|
171
|
+
token?: string;
|
|
172
|
+
}
|
|
173
|
+
/** Opt-in activity synchronization settings. */
|
|
174
|
+
interface ActivityConfig {
|
|
175
|
+
enabled: boolean;
|
|
176
|
+
timezone: string;
|
|
177
|
+
syncDays: number;
|
|
178
|
+
/** Periodic auto-sync cadence in minutes (default 15). */
|
|
179
|
+
autoSyncIntervalMinutes: number;
|
|
180
|
+
sources: ActivitySourceConfig[];
|
|
181
|
+
}
|
|
182
|
+
|
|
87
183
|
/**
|
|
88
184
|
* Wearable transcript subsystem — shared types (issue: wearable connectors).
|
|
89
185
|
*
|
|
@@ -1606,6 +1702,7 @@ interface PluginConfig extends BoundedJsonlStateConfig {
|
|
|
1606
1702
|
* Disabled by default; see docs/wearables.md.
|
|
1607
1703
|
*/
|
|
1608
1704
|
wearables: WearablesConfig;
|
|
1705
|
+
activity: ActivityConfig;
|
|
1609
1706
|
/**
|
|
1610
1707
|
* At-rest encryption configuration (issue #690 PR 3/4).
|
|
1611
1708
|
*
|
|
@@ -3930,4 +4027,4 @@ interface HourlySummary {
|
|
|
3930
4027
|
generatedAt: string;
|
|
3931
4028
|
}
|
|
3932
4029
|
|
|
3933
|
-
export { type BehaviorSignalEvent as $, type ActiveRecallChatType as A, type BriefingSections as B, type CalendarSource as C, type DreamsPhase as D, type EntityFile as E, type FaithfulnessFrontmatter as F, type GatewayConfig as G, type HourlySummary as H, type IdentityInjectionMode as I, type ExtractionResult as J, type ConsolidationResult as K, type LiveConnectorsConfig as L, type MemoryFile as M, type DaySummaryResult as N, type ExtractionFailureClass as O, type PluginConfig as P, type QmdSearchResult as Q, type RecallPlanMode as R, type SessionObserverBandConfig as S, type TranscriptEntry as T, type ProvenanceSource as U, type TrustWeights as V, type ConversationThread as W, type LifecycleState as X, type VerificationState as Y, type PolicyClass as Z, type ImportanceLevel as _, type DreamsRunResult as a, type
|
|
4030
|
+
export { type BehaviorSignalEvent as $, type ActiveRecallChatType as A, type BriefingSections as B, type CalendarSource as C, type DreamsPhase as D, type EntityFile as E, type FaithfulnessFrontmatter as F, type GatewayConfig as G, type HourlySummary as H, type IdentityInjectionMode as I, type ExtractionResult as J, type ConsolidationResult as K, type LiveConnectorsConfig as L, type MemoryFile as M, type DaySummaryResult as N, type ExtractionFailureClass as O, type PluginConfig as P, type QmdSearchResult as Q, type RecallPlanMode as R, type SessionObserverBandConfig as S, type TranscriptEntry as T, type ProvenanceSource as U, type TrustWeights as V, type ConversationThread as W, type LifecycleState as X, type VerificationState as Y, type PolicyClass as Z, type ImportanceLevel as _, type DreamsRunResult as a, type ActivitySourceClient as a$, type BufferSurpriseEvent as a0, type ImportTurn as a1, type BulkImportOptions as a2, type BulkImportSource as a3, type BulkImportResult as a4, type SecretRef as a5, type AgentAccessAuthToken as a6, type CompressionGuidelineOptimizerEventCounts as a7, type CompressionGuidelineOptimizerActionSummary as a8, type CompressionGuidelineOptimizerRuleUpdate as a9, type EntityActivityEntry as aA, type AccessTrackingEntry as aB, type MemorySummary as aC, type CodingContext as aD, type DreamsStatusResult as aE, type WearableConversation as aF, type WearableSourceSettings as aG, type WearableNativeMemory as aH, type WearableMemoryMode as aI, type WearableSourceConnector as aJ, type WearablesConfig as aK, type WearableSyncSummary as aL, type WearableSourceStatus as aM, type WearableDayTranscript as aN, type WearableCorrectionRule as aO, type RecallSectionConfig as aP, type BootstrapOptions as aQ, type BootstrapResult as aR, type ConsolidationObservation as aS, type CodingModeConfig as aT, type CodingKnowledgeConfig as aU, type WearableCleanupSettings as aV, type WearableFusionConfig as aW, type WearableDayTranscriptMeta as aX, type ActivitySnapshot as aY, type ActivityDayMeta as aZ, type ActivityDayDigest as a_, type MemoryActionType as aa, type MemoryActionEvent as ab, type CompressionGuidelineOptimizerState as ac, type EntityMention as ad, type EntitySchemaDefinition as ae, type EntitySchemaSectionDefinition as af, type EntityStructuredSection as ag, type ImportanceScore as ah, type MemoryIntent as ai, type MemoryActionEligibilityContext as aj, type MemoryActionPolicyResult as ak, type MemoryLifecycleEventType as al, type MemoryLifecycleStateSummary as am, type ModelProviderConfig as an, type NativeKnowledgeConfig as ao, type ProvenanceConfig as ap, type RetrievalTier as aq, type SignalScanResult as ar, type TopicScore as as, type QmdSearchExplain as at, type EntityTimelineEntry as au, type MemoryLink as av, type BufferState as aw, type MetaState as ax, type FileHygieneConfig as ay, type EntityRelationship as az, type RecallDisclosure as b, type GitHubLiveConnectorConfig as b$, type ActivitySourceCheck as b0, type ActivitySnapshotPage as b1, type ActivityConfig as b2, type ActivitySourceConfig as b3, type BriefingConfig as b4, type BriefingOpenCommitment as b5, type BriefingWindow as b6, type BulkImportError as b7, type BulkImportSourceAdapter as b8, type CodexCompatConfig as b9, type ChatConfig as bA, type CodexCliReasoningEffort as bB, type CodexCompactionFlushMode as bC, type CodexConnectorConfig as bD, type CodingGraphLspConfig as bE, type CompressionGuidelineActivationState as bF, type CompressionGuidelineOptimizerSourceWindow as bG, type ConfidenceTier as bH, type ConsolidationAction as bI, type ConsolidationItem as bJ, type ContradictionScanConfig as bK, type CronConversationRecallMode as bL, type CronRecallMode as bM, type DreamingConfig as bN, type DreamingNarrativePromptStyle as bO, type DreamsDeepSleepConfig as bP, type DreamsLightSleepConfig as bQ, type DreamsPhaseStatus as bR, type DreamsPhasesConfig as bS, type DreamsRemConfig as bT, type EngramTraceEvent as bU, type ExtractedProcedureStep as bV, type ExtractedQuestion as bW, type ExtractedReasoningTrace as bX, type ExtractedReasoningTraceStep as bY, type ExtractedRelationship as bZ, type ExtractionPassSource as b_, DEFAULT_RECALL_DISCLOSURE as ba, type ExtractedFact as bb, type ImportSourceRole as bc, type ImportTurnValidationIssue as bd, type MemoryActionEligibilitySource as be, type MemoryObservation as bf, type MemoryScope as bg, RECALL_DISCLOSURE_LEVELS as bh, type WearableAuthCheck as bi, type WearableFetchOptions as bj, type WearableFetchPage as bk, type WearableNativeMemoryPage as bl, type WearableTranscriptSegment as bm, isImportRole as bn, isRecallDisclosure as bo, parseIsoTimestamp as bp, validateImportTurn as bq, type AgentAccessHttpConfig as br, type AgentDefaultsConfig as bs, type AgentPersona as bt, type BehaviorLoopAdjustment as bu, type BehaviorSignalDirection as bv, type BehaviorSignalType as bw, type BriefingCalendarSourceError as bx, type BufferEntryState as by, type CaptureMode as bz, type ActiveRecallQueryMode as c, type GmailLiveConnectorConfig as c0, type GoogleDriveLiveConnectorConfig as c1, type HeartbeatConfig as c2, type HeartbeatDetectionMode as c3, type LlmTraceCallback as c4, type LlmTraceEvent as c5, type MemoryActionOutcome as c6, type MemoryActionPolicyDecision as c7, type MemoryActionStatus as c8, type MemoryLinkType as c9, type TriggerMode as cA, confidenceTier as cB, type MemoryOsPresetName as ca, type ModelApi as cb, type ModelDefinitionConfig as cc, type ModelProviderAuthMode as cd, type NamespacePolicy as ce, type NativeKnowledgeFolderRuleConfig as cf, type NativeKnowledgeObsidianVaultConfig as cg, type NativeKnowledgeOpenClawWorkspaceConfig as ch, type NotionLiveConnectorConfig as ci, type PrincipalFromSessionKeyMode as cj, type PrincipalRule as ck, type ProceduralConfig as cl, type QuestionEntry as cm, type ReasoningEffort as cn, type RecallPipelineConfig as co, type RecallTraceEvent as cp, type RelevanceFeedback as cq, SPECULATIVE_TTL_DAYS as cr, type ScopeProfileAutoPromoteConfig as cs, type ScopeProfileTeamProjectConfig as ct, type ScopeTeamConfig as cu, type ScoredEntity as cv, type SemanticChunkingConfigShape as cw, type SignalLevel as cx, type SlotBehaviorConfig as cy, type SlotMismatchMode as cz, type ActiveRecallPromptStyle as d, type ActiveRecallThinking as e, type ActiveRecallModelFallbackPolicy as f, type RecallTierExplain as g, type BriefingFollowup as h, type BriefingFocus as i, type CalendarEvent as j, type BriefingActiveThread as k, type BriefingResult as l, type BriefingRecentEntity as m, type BufferTurn as n, type MemoryFrontmatter as o, type Checkpoint as p, type AgentPersonaModelConfig as q, type SourceConnectorProvenance as r, type ScopeProfileConfig as s, type ScopeProfileLayerId as t, type ScopeProfilePromotionTarget as u, type BehaviorLoopPolicyState as v, type MemoryCategory as w, type MemoryStatus as x, type MemoryProjectionCurrentState as y, type MemoryLifecycleEvent as z };
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { aB as AccessTrackingEntry, A as ActiveRecallChatType, f as ActiveRecallModelFallbackPolicy, d as ActiveRecallPromptStyle, c as ActiveRecallQueryMode, e as ActiveRecallThinking, a6 as AgentAccessAuthToken,
|
|
1
|
+
export { aB as AccessTrackingEntry, A as ActiveRecallChatType, f as ActiveRecallModelFallbackPolicy, d as ActiveRecallPromptStyle, c as ActiveRecallQueryMode, e as ActiveRecallThinking, a6 as AgentAccessAuthToken, br as AgentAccessHttpConfig, bs as AgentDefaultsConfig, bt as AgentPersona, q as AgentPersonaModelConfig, bu as BehaviorLoopAdjustment, v as BehaviorLoopPolicyState, bv as BehaviorSignalDirection, $ as BehaviorSignalEvent, bw as BehaviorSignalType, aQ as BootstrapOptions, aR as BootstrapResult, k as BriefingActiveThread, bx as BriefingCalendarSourceError, b4 as BriefingConfig, i as BriefingFocus, h as BriefingFollowup, b5 as BriefingOpenCommitment, m as BriefingRecentEntity, l as BriefingResult, B as BriefingSections, b6 as BriefingWindow, by as BufferEntryState, aw as BufferState, a0 as BufferSurpriseEvent, n as BufferTurn, j as CalendarEvent, C as CalendarSource, bz as CaptureMode, bA as ChatConfig, p as Checkpoint, bB as CodexCliReasoningEffort, bC as CodexCompactionFlushMode, b9 as CodexCompatConfig, bD as CodexConnectorConfig, aD as CodingContext, bE as CodingGraphLspConfig, aU as CodingKnowledgeConfig, aT as CodingModeConfig, bF as CompressionGuidelineActivationState, a8 as CompressionGuidelineOptimizerActionSummary, a7 as CompressionGuidelineOptimizerEventCounts, a9 as CompressionGuidelineOptimizerRuleUpdate, bG as CompressionGuidelineOptimizerSourceWindow, ac as CompressionGuidelineOptimizerState, bH as ConfidenceTier, bI as ConsolidationAction, bJ as ConsolidationItem, aS as ConsolidationObservation, K as ConsolidationResult, bK as ContradictionScanConfig, W as ConversationThread, bL as CronConversationRecallMode, bM as CronRecallMode, ba as DEFAULT_RECALL_DISCLOSURE, N as DaySummaryResult, bN as DreamingConfig, bO as DreamingNarrativePromptStyle, bP as DreamsDeepSleepConfig, bQ as DreamsLightSleepConfig, D as DreamsPhase, bR as DreamsPhaseStatus, bS as DreamsPhasesConfig, bT as DreamsRemConfig, a as DreamsRunResult, aE as DreamsStatusResult, bU as EngramTraceEvent, aA as EntityActivityEntry, E as EntityFile, ad as EntityMention, az as EntityRelationship, ae as EntitySchemaDefinition, af as EntitySchemaSectionDefinition, ag as EntityStructuredSection, au as EntityTimelineEntry, bb as ExtractedFact, bV as ExtractedProcedureStep, bW as ExtractedQuestion, bX as ExtractedReasoningTrace, bY as ExtractedReasoningTraceStep, bZ as ExtractedRelationship, O as ExtractionFailureClass, b_ as ExtractionPassSource, J as ExtractionResult, F as FaithfulnessFrontmatter, ay as FileHygieneConfig, G as GatewayConfig, b$ as GitHubLiveConnectorConfig, c0 as GmailLiveConnectorConfig, c1 as GoogleDriveLiveConnectorConfig, c2 as HeartbeatConfig, c3 as HeartbeatDetectionMode, H as HourlySummary, I as IdentityInjectionMode, _ as ImportanceLevel, ah as ImportanceScore, X as LifecycleState, L as LiveConnectorsConfig, c4 as LlmTraceCallback, c5 as LlmTraceEvent, aj as MemoryActionEligibilityContext, be as MemoryActionEligibilitySource, ab as MemoryActionEvent, c6 as MemoryActionOutcome, c7 as MemoryActionPolicyDecision, ak as MemoryActionPolicyResult, c8 as MemoryActionStatus, aa as MemoryActionType, w as MemoryCategory, M as MemoryFile, o as MemoryFrontmatter, ai as MemoryIntent, z as MemoryLifecycleEvent, al as MemoryLifecycleEventType, am as MemoryLifecycleStateSummary, av as MemoryLink, c9 as MemoryLinkType, bf as MemoryObservation, ca as MemoryOsPresetName, y as MemoryProjectionCurrentState, bg as MemoryScope, x as MemoryStatus, aC as MemorySummary, ax as MetaState, cb as ModelApi, cc as ModelDefinitionConfig, cd as ModelProviderAuthMode, an as ModelProviderConfig, ce as NamespacePolicy, ao as NativeKnowledgeConfig, cf as NativeKnowledgeFolderRuleConfig, cg as NativeKnowledgeObsidianVaultConfig, ch as NativeKnowledgeOpenClawWorkspaceConfig, ci as NotionLiveConnectorConfig, P as PluginConfig, Z as PolicyClass, cj as PrincipalFromSessionKeyMode, ck as PrincipalRule, cl as ProceduralConfig, ap as ProvenanceConfig, U as ProvenanceSource, at as QmdSearchExplain, Q as QmdSearchResult, cm as QuestionEntry, bh as RECALL_DISCLOSURE_LEVELS, cn as ReasoningEffort, b as RecallDisclosure, co as RecallPipelineConfig, R as RecallPlanMode, aP as RecallSectionConfig, g as RecallTierExplain, cp as RecallTraceEvent, cq as RelevanceFeedback, aq as RetrievalTier, cr as SPECULATIVE_TTL_DAYS, cs as ScopeProfileAutoPromoteConfig, s as ScopeProfileConfig, t as ScopeProfileLayerId, u as ScopeProfilePromotionTarget, ct as ScopeProfileTeamProjectConfig, cu as ScopeTeamConfig, cv as ScoredEntity, a5 as SecretRef, cw as SemanticChunkingConfigShape, S as SessionObserverBandConfig, cx as SignalLevel, ar as SignalScanResult, cy as SlotBehaviorConfig, cz as SlotMismatchMode, r as SourceConnectorProvenance, as as TopicScore, T as TranscriptEntry, cA as TriggerMode, V as TrustWeights, Y as VerificationState, cB as confidenceTier, bo as isRecallDisclosure } from './types-OUCJALBK.js';
|
|
2
2
|
import './message-parts/index.js';
|
|
3
3
|
import './bounded-jsonl-state.js';
|
|
4
4
|
export { ContinuityImprovementLoop, ContinuityIncidentCloseInput, ContinuityIncidentOpenInput, ContinuityIncidentRecord, ContinuityIncidentState, ContinuityLoopCadence, ContinuityLoopReviewInput, ContinuityLoopStatus, ContinuityLoopUpsertInput } from './types-continuity.js';
|
package/dist/types.js
CHANGED
package/dist/verified-recall.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
compareVerifiedEpisodeResults,
|
|
3
3
|
searchVerifiedEpisodes
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-AFH7PIFU.js";
|
|
5
5
|
import "./chunk-B7RWBZXW.js";
|
|
6
|
-
import "./chunk-
|
|
6
|
+
import "./chunk-7YJLCNPF.js";
|
|
7
7
|
import "./chunk-B3ABVQ36.js";
|
|
8
8
|
import "./chunk-2QMKMVHH.js";
|
|
9
9
|
import "./chunk-DEBHXHJR.js";
|
|
@@ -11,7 +11,7 @@ import "./chunk-DNHVPZOD.js";
|
|
|
11
11
|
import "./chunk-6CIAGZ6X.js";
|
|
12
12
|
import "./chunk-J6A3CX5N.js";
|
|
13
13
|
import "./chunk-V57NLO5P.js";
|
|
14
|
-
import "./chunk-
|
|
14
|
+
import "./chunk-N7DK67GZ.js";
|
|
15
15
|
import "./chunk-XKGPIWGI.js";
|
|
16
16
|
import "./chunk-EGGE52UU.js";
|
|
17
17
|
import "./chunk-GCASGYIO.js";
|
package/dist/write-envelope.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@remnic/core",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.16.0",
|
|
4
4
|
"description": "Framework-agnostic Remnic memory engine — orchestrator, storage, extraction, search, trust zones",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -3045,7 +3045,7 @@
|
|
|
3045
3045
|
"core"
|
|
3046
3046
|
],
|
|
3047
3047
|
"peerDependencies": {
|
|
3048
|
-
"@remnic/coding-graph": "^9.
|
|
3048
|
+
"@remnic/coding-graph": "^9.16.0"
|
|
3049
3049
|
},
|
|
3050
3050
|
"peerDependenciesMeta": {
|
|
3051
3051
|
"@remnic/coding-graph": {
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import test from "node:test";
|
|
3
|
+
|
|
4
|
+
import { parseActivityConfig } from "./config.js";
|
|
5
|
+
|
|
6
|
+
test("parseActivityConfig defaults to an inert configuration", () => {
|
|
7
|
+
assert.deepEqual(parseActivityConfig(undefined), {
|
|
8
|
+
enabled: false,
|
|
9
|
+
timezone: "UTC",
|
|
10
|
+
syncDays: 1,
|
|
11
|
+
autoSyncIntervalMinutes: 15,
|
|
12
|
+
sources: [],
|
|
13
|
+
});
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
test("parseActivityConfig treats a string false gate as disabled", () => {
|
|
17
|
+
assert.equal(parseActivityConfig({ enabled: "false" }).enabled, false);
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
test("parseActivityConfig preserves explicit source settings", () => {
|
|
21
|
+
assert.deepEqual(
|
|
22
|
+
parseActivityConfig({
|
|
23
|
+
enabled: true,
|
|
24
|
+
timezone: "America/Chicago",
|
|
25
|
+
syncDays: 3,
|
|
26
|
+
sources: [{ machineLabel: "fixture-machine", baseUrl: "http://127.0.0.1:4319", token: "fixture-token" }],
|
|
27
|
+
}),
|
|
28
|
+
{
|
|
29
|
+
enabled: true,
|
|
30
|
+
timezone: "America/Chicago",
|
|
31
|
+
syncDays: 3,
|
|
32
|
+
autoSyncIntervalMinutes: 15,
|
|
33
|
+
sources: [{ machineLabel: "fixture-machine", baseUrl: "http://127.0.0.1:4319", token: "fixture-token" }],
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
test("parseActivityConfig rejects enabled configurations without valid source definitions", () => {
|
|
39
|
+
assert.throws(() => parseActivityConfig({ enabled: true, sources: [] }), /at least one source/);
|
|
40
|
+
assert.throws(
|
|
41
|
+
() => parseActivityConfig({ enabled: true, sources: [{ machineLabel: "fixture", baseUrl: "ftp://example.test" }] }),
|
|
42
|
+
/HTTP or HTTPS/,
|
|
43
|
+
);
|
|
44
|
+
assert.throws(() => parseActivityConfig({ syncDays: 0 }), /syncDays/);
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
test("parseActivityConfig enforces both ends of the syncDays range", () => {
|
|
48
|
+
assert.equal(parseActivityConfig({ syncDays: 90 }).syncDays, 90);
|
|
49
|
+
assert.equal(parseActivityConfig({ syncDays: 1 }).syncDays, 1);
|
|
50
|
+
assert.throws(() => parseActivityConfig({ syncDays: 91 }), /syncDays must be an integer from 1 to 90/);
|
|
51
|
+
assert.throws(() => parseActivityConfig({ syncDays: 0 }), /syncDays must be an integer from 1 to 90/);
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
test("parseActivityConfig rejects an invalid IANA timezone at parse time", () => {
|
|
55
|
+
assert.throws(() => parseActivityConfig({ timezone: "Not/AZone" }), /Invalid IANA timezone/);
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
test("parseActivityConfig rejects a whitespace-only machineLabel before any sync", () => {
|
|
59
|
+
assert.throws(
|
|
60
|
+
() => parseActivityConfig({ enabled: true, sources: [{ machineLabel: " ", baseUrl: "http://127.0.0.1:4319" }] }),
|
|
61
|
+
/machineLabel must not be blank/,
|
|
62
|
+
);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
test("parseActivityConfig rejects duplicate machine labels that would share a cursor", () => {
|
|
66
|
+
assert.throws(
|
|
67
|
+
() =>
|
|
68
|
+
parseActivityConfig({
|
|
69
|
+
enabled: true,
|
|
70
|
+
sources: [
|
|
71
|
+
{ machineLabel: "dup", baseUrl: "http://127.0.0.1:4319" },
|
|
72
|
+
{ machineLabel: "dup", baseUrl: "http://127.0.0.1:4320" },
|
|
73
|
+
],
|
|
74
|
+
}),
|
|
75
|
+
/machineLabel must be unique/,
|
|
76
|
+
);
|
|
77
|
+
});
|
|
78
|
+
|
|
79
|
+
test("parseActivityConfig reports a malformed baseUrl with a prefixed validation error", () => {
|
|
80
|
+
assert.throws(
|
|
81
|
+
() => parseActivityConfig({ enabled: true, sources: [{ machineLabel: "fixture", baseUrl: "not a url" }] }),
|
|
82
|
+
/activity source baseUrl must be a valid URL/,
|
|
83
|
+
);
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
test("parseActivityConfig rejects a non-loopback baseUrl that could exfiltrate the token", () => {
|
|
87
|
+
assert.throws(
|
|
88
|
+
() => parseActivityConfig({ enabled: true, sources: [{ machineLabel: "fixture", baseUrl: "https://example.test" }] }),
|
|
89
|
+
/must target a loopback host/,
|
|
90
|
+
);
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
test("parseActivityConfig accepts localhost and 127.x loopback hosts", () => {
|
|
94
|
+
assert.equal(
|
|
95
|
+
parseActivityConfig({ enabled: true, sources: [{ machineLabel: "a", baseUrl: "http://localhost:4319" }] }).sources
|
|
96
|
+
.length,
|
|
97
|
+
1,
|
|
98
|
+
);
|
|
99
|
+
assert.equal(
|
|
100
|
+
parseActivityConfig({ enabled: true, sources: [{ machineLabel: "b", baseUrl: "http://127.0.0.5:4319" }] }).sources
|
|
101
|
+
.length,
|
|
102
|
+
1,
|
|
103
|
+
);
|
|
104
|
+
});
|
|
105
|
+
|
|
106
|
+
test("parseActivityConfig parses and bounds autoSyncIntervalMinutes", () => {
|
|
107
|
+
assert.equal(parseActivityConfig(undefined).autoSyncIntervalMinutes, 15);
|
|
108
|
+
assert.equal(parseActivityConfig({ autoSyncIntervalMinutes: "30" }).autoSyncIntervalMinutes, 30);
|
|
109
|
+
assert.equal(parseActivityConfig({ autoSyncIntervalMinutes: 1 }).autoSyncIntervalMinutes, 1);
|
|
110
|
+
assert.equal(parseActivityConfig({ autoSyncIntervalMinutes: 1440 }).autoSyncIntervalMinutes, 1440);
|
|
111
|
+
assert.throws(() => parseActivityConfig({ autoSyncIntervalMinutes: 0 }), /autoSyncIntervalMinutes must be an integer from 1 to 1440/);
|
|
112
|
+
assert.throws(() => parseActivityConfig({ autoSyncIntervalMinutes: 1441 }), /autoSyncIntervalMinutes must be an integer from 1 to 1440/);
|
|
113
|
+
});
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { coerceBooleanLike, coerceNumber } from "../connectors/coerce.js";
|
|
2
|
+
import { assertValidTimezone } from "./digest.js";
|
|
3
|
+
import type { ActivityConfig, ActivitySourceConfig } from "./types.js";
|
|
4
|
+
|
|
5
|
+
function asRecord(value: unknown, name: string): Record<string, unknown> {
|
|
6
|
+
if (typeof value !== "object" || value === null || Array.isArray(value)) {
|
|
7
|
+
throw new TypeError(`${name} must be an object`);
|
|
8
|
+
}
|
|
9
|
+
return value as Record<string, unknown>;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function optionalString(value: unknown, name: string): string | undefined {
|
|
13
|
+
if (value === undefined) return undefined;
|
|
14
|
+
if (typeof value !== "string" || value.length === 0) throw new TypeError(`${name} must be a non-empty string`);
|
|
15
|
+
return value;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
const LOOPBACK_HOSTS: Record<string, true> = { localhost: true, "127.0.0.1": true, "::1": true };
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* Parse, protocol-check, and confine an activity source base URL to a local
|
|
22
|
+
* loopback host. Shared with ActivityHttpSourceClient so config-load and client
|
|
23
|
+
* construction reject the exact same shapes with the same prefixed message (a
|
|
24
|
+
* bare `new URL()` throws an opaque TypeError on malformed input). The bearer
|
|
25
|
+
* token travels in an Authorization header, so a non-loopback baseUrl would
|
|
26
|
+
* exfiltrate it; the subsystem contract is local capture daemons only.
|
|
27
|
+
*/
|
|
28
|
+
export function validateActivityBaseUrl(baseUrl: string): URL {
|
|
29
|
+
let parsed: URL;
|
|
30
|
+
try {
|
|
31
|
+
parsed = new URL(baseUrl);
|
|
32
|
+
} catch {
|
|
33
|
+
throw new RangeError(`activity source baseUrl must be a valid URL: ${baseUrl}`);
|
|
34
|
+
}
|
|
35
|
+
if (parsed.protocol !== "http:" && parsed.protocol !== "https:") {
|
|
36
|
+
throw new RangeError("activity source baseUrl must use HTTP or HTTPS");
|
|
37
|
+
}
|
|
38
|
+
// URL keeps IPv6 hosts bracketed (e.g. "[::1]"); normalize before the lookup.
|
|
39
|
+
const host = parsed.hostname.replace(/^\[|\]$/g, "");
|
|
40
|
+
if (LOOPBACK_HOSTS[host] !== true && !/^127\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(host)) {
|
|
41
|
+
throw new RangeError(`activity source baseUrl must target a loopback host (got ${parsed.hostname})`);
|
|
42
|
+
}
|
|
43
|
+
return parsed;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
function parseSource(value: unknown): ActivitySourceConfig {
|
|
47
|
+
const raw = asRecord(value, "activity source");
|
|
48
|
+
const machineLabel = optionalString(raw.machineLabel, "activity source machineLabel");
|
|
49
|
+
const baseUrl = optionalString(raw.baseUrl, "activity source baseUrl");
|
|
50
|
+
if (machineLabel === undefined || baseUrl === undefined) {
|
|
51
|
+
throw new TypeError("activity source requires machineLabel and baseUrl");
|
|
52
|
+
}
|
|
53
|
+
// Reject whitespace-only labels here so config-load fails loudly rather than
|
|
54
|
+
// parsing clean and then failing on the first sync (the client and pipeline
|
|
55
|
+
// both reject a blank label via trim()).
|
|
56
|
+
if (machineLabel.trim().length === 0) {
|
|
57
|
+
throw new RangeError("activity source machineLabel must not be blank");
|
|
58
|
+
}
|
|
59
|
+
validateActivityBaseUrl(baseUrl);
|
|
60
|
+
const token = optionalString(raw.token, "activity source token");
|
|
61
|
+
return { machineLabel, baseUrl, ...(token === undefined ? {} : { token }) };
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export function parseActivityConfig(raw: unknown): ActivityConfig {
|
|
65
|
+
if (raw === undefined || raw === null) {
|
|
66
|
+
return { enabled: false, timezone: "UTC", syncDays: 1, autoSyncIntervalMinutes: 15, sources: [] };
|
|
67
|
+
}
|
|
68
|
+
const config = asRecord(raw, "activity");
|
|
69
|
+
const enabledValue = coerceBooleanLike(config.enabled, "activity.enabled");
|
|
70
|
+
if (config.enabled !== undefined && enabledValue === undefined) {
|
|
71
|
+
throw new TypeError("activity.enabled must be a boolean");
|
|
72
|
+
}
|
|
73
|
+
const timezone = optionalString(config.timezone, "activity.timezone") ?? "UTC";
|
|
74
|
+
// Validate the IANA zone at parse so a typo fails before any daemon is
|
|
75
|
+
// contacted; otherwise activityDayWindow() throws mid-sync after snapshot
|
|
76
|
+
// pages may already be persisted, and every retry replays the same window.
|
|
77
|
+
assertValidTimezone(timezone);
|
|
78
|
+
const syncDaysValue = coerceNumber(config.syncDays, "activity.syncDays");
|
|
79
|
+
if (config.syncDays !== undefined && syncDaysValue === undefined) {
|
|
80
|
+
throw new TypeError("activity.syncDays must be a finite number");
|
|
81
|
+
}
|
|
82
|
+
const syncDays = syncDaysValue ?? 1;
|
|
83
|
+
if (!Number.isInteger(syncDays) || syncDays < 1 || syncDays > 90) {
|
|
84
|
+
throw new RangeError("activity.syncDays must be an integer from 1 to 90");
|
|
85
|
+
}
|
|
86
|
+
const intervalValue = coerceNumber(config.autoSyncIntervalMinutes, "activity.autoSyncIntervalMinutes");
|
|
87
|
+
if (config.autoSyncIntervalMinutes !== undefined && intervalValue === undefined) {
|
|
88
|
+
throw new TypeError("activity.autoSyncIntervalMinutes must be a finite number");
|
|
89
|
+
}
|
|
90
|
+
const autoSyncIntervalMinutes = intervalValue ?? 15;
|
|
91
|
+
if (!Number.isInteger(autoSyncIntervalMinutes) || autoSyncIntervalMinutes < 1 || autoSyncIntervalMinutes > 1440) {
|
|
92
|
+
throw new RangeError("activity.autoSyncIntervalMinutes must be an integer from 1 to 1440");
|
|
93
|
+
}
|
|
94
|
+
if (config.sources !== undefined && !Array.isArray(config.sources)) {
|
|
95
|
+
throw new TypeError("activity.sources must be an array");
|
|
96
|
+
}
|
|
97
|
+
const sources = (config.sources ?? []).map(parseSource);
|
|
98
|
+
// Cursors and row dedup are keyed on machineLabel alone; two sources sharing
|
|
99
|
+
// a label would share a cursor and dedup namespace, silently skipping or
|
|
100
|
+
// conflating snapshots. Reject the collision at parse.
|
|
101
|
+
const labels = new Set<string>();
|
|
102
|
+
for (const source of sources) {
|
|
103
|
+
if (labels.has(source.machineLabel)) {
|
|
104
|
+
throw new RangeError(`activity source machineLabel must be unique: ${source.machineLabel}`);
|
|
105
|
+
}
|
|
106
|
+
labels.add(source.machineLabel);
|
|
107
|
+
}
|
|
108
|
+
const enabled = enabledValue ?? false;
|
|
109
|
+
if (enabled && sources.length === 0) throw new RangeError("activity.enabled requires at least one source");
|
|
110
|
+
return { enabled, timezone, syncDays, autoSyncIntervalMinutes, sources };
|
|
111
|
+
}
|
package/src/activity/digest.ts
CHANGED
|
@@ -55,11 +55,11 @@ function timezoneOffsetIso(instant: Date, timezone: string): string {
|
|
|
55
55
|
return match?.[1] ?? "+00:00";
|
|
56
56
|
}
|
|
57
57
|
|
|
58
|
-
function assertValidTimezone(timezone: string): void {
|
|
58
|
+
export function assertValidTimezone(timezone: string): void {
|
|
59
59
|
try {
|
|
60
60
|
new Intl.DateTimeFormat("en-US", { timeZone: timezone });
|
|
61
61
|
} catch {
|
|
62
|
-
throw new RangeError(`Invalid IANA timezone "${timezone}"
|
|
62
|
+
throw new RangeError(`Invalid IANA timezone "${timezone}".`);
|
|
63
63
|
}
|
|
64
64
|
}
|
|
65
65
|
|
package/src/activity/index.ts
CHANGED
|
@@ -7,3 +7,9 @@
|
|
|
7
7
|
export * from "./types.js";
|
|
8
8
|
export * from "./store.js";
|
|
9
9
|
export * from "./digest.js";
|
|
10
|
+
export * from "./pipeline.js";
|
|
11
|
+
export * from "./source-client.js";
|
|
12
|
+
export * from "./runner.js";
|
|
13
|
+
export * from "./scheduler.js";
|
|
14
|
+
export * from "./config.js";
|
|
15
|
+
export * from "./reindex.js";
|