@parentspath/shared-constants 0.1.2 → 0.4.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/companion.d.ts +12 -0
- package/dist/companion.d.ts.map +1 -0
- package/dist/companion.js +15 -0
- package/dist/companion.js.map +1 -0
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +3 -1
- package/dist/constants.js.map +1 -1
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/lens.d.ts +26 -0
- package/dist/lens.d.ts.map +1 -0
- package/dist/lens.js +79 -0
- package/dist/lens.js.map +1 -0
- package/dist/sleep.d.ts +74 -0
- package/dist/sleep.d.ts.map +1 -0
- package/dist/sleep.js +146 -0
- package/dist/sleep.js.map +1 -0
- package/dist/validators/events.d.ts +30 -5
- package/dist/validators/events.d.ts.map +1 -1
- package/dist/validators/events.js +9 -1
- package/dist/validators/events.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Companion identity (GHI-03).
|
|
3
|
+
*
|
|
4
|
+
* The single canonical source for the companion's name and glyph. Every app
|
|
5
|
+
* surface imports from here and NEVER hardcodes the literal "Vera" in a
|
|
6
|
+
* component. The name is intentionally a knob: trademark / App-Store clearance
|
|
7
|
+
* is still open. Default = "Vera".
|
|
8
|
+
*/
|
|
9
|
+
export declare const COMPANION_NAME = "Vera";
|
|
10
|
+
/** Subtle in-app glyph for the companion (the ✦ in the wireframes). */
|
|
11
|
+
export declare const COMPANION_GLYPH = "\u2726";
|
|
12
|
+
//# sourceMappingURL=companion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companion.d.ts","sourceRoot":"","sources":["../src/companion.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,eAAO,MAAM,cAAc,SAAS,CAAC;AAErC,uEAAuE;AACvE,eAAO,MAAM,eAAe,WAAM,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.COMPANION_GLYPH = exports.COMPANION_NAME = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Companion identity (GHI-03).
|
|
6
|
+
*
|
|
7
|
+
* The single canonical source for the companion's name and glyph. Every app
|
|
8
|
+
* surface imports from here and NEVER hardcodes the literal "Vera" in a
|
|
9
|
+
* component. The name is intentionally a knob: trademark / App-Store clearance
|
|
10
|
+
* is still open. Default = "Vera".
|
|
11
|
+
*/
|
|
12
|
+
exports.COMPANION_NAME = 'Vera';
|
|
13
|
+
/** Subtle in-app glyph for the companion (the ✦ in the wireframes). */
|
|
14
|
+
exports.COMPANION_GLYPH = '✦';
|
|
15
|
+
//# sourceMappingURL=companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"companion.js","sourceRoot":"","sources":["../src/companion.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACU,QAAA,cAAc,GAAG,MAAM,CAAC;AAErC,uEAAuE;AAC1D,QAAA,eAAe,GAAG,GAAG,CAAC"}
|
package/dist/constants.d.ts
CHANGED
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAiBb,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;CAKT,CAAC;AAEX,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,eAAO,MAAM,eAAe;;
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;;CAiBb,CAAC;AAEX,eAAO,MAAM,MAAM;;;;;CAKT,CAAC;AAEX,eAAO,MAAM,aAAa;;;;CAIhB,CAAC;AAEX,eAAO,MAAM,YAAY;;;;;CAKf,CAAC;AAEX,eAAO,MAAM,cAAc;;;;CAIjB,CAAC;AAEX,eAAO,MAAM,qBAAqB;;;;;CAKxB,CAAC;AAEX,eAAO,MAAM,UAAU;;;;;CAKb,CAAC;AAEX,eAAO,MAAM,eAAe;;CAIlB,CAAC"}
|
package/dist/constants.js
CHANGED
|
@@ -54,6 +54,8 @@ exports.SYNC_STATE = {
|
|
|
54
54
|
ERROR: 'error',
|
|
55
55
|
};
|
|
56
56
|
exports.DATABASE_CONFIG = {
|
|
57
|
-
|
|
57
|
+
// Local-first SQLite store name (ADR 0001). Renamed off the legacy
|
|
58
|
+
// 'powersync.db' — PowerSync is superseded by local-first SQLite.
|
|
59
|
+
FILENAME: 'parentspath.db',
|
|
58
60
|
};
|
|
59
61
|
//# sourceMappingURL=constants.js.map
|
package/dist/constants.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../src/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,UAAU,GAAG;IACxB,aAAa,EAAE,eAAe;IAC9B,iBAAiB,EAAE,mBAAmB;IACtC,YAAY,EAAE,cAAc;IAC5B,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,SAAS;IAClB,cAAc,EAAE,gBAAgB;IAChC,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,MAAM,EAAE,QAAQ;IAChB,SAA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version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,qBAAqB,CAAC;AACpC,cAAc,SAAS,CAAC;AACxB,cAAc,aAAa,CAAC;AAC5B,cAAc,QAAQ,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -16,4 +16,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./constants"), exports);
|
|
18
18
|
__exportStar(require("./validators/events"), exports);
|
|
19
|
+
__exportStar(require("./sleep"), exports);
|
|
20
|
+
__exportStar(require("./companion"), exports);
|
|
21
|
+
__exportStar(require("./lens"), exports);
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAA4B;AAC5B,sDAAoC;AACpC,0CAAwB;AACxB,8CAA4B;AAC5B,yCAAuB"}
|
package/dist/lens.d.ts
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parenting-lens vocabulary + system-prompt helper (GHI-03).
|
|
3
|
+
*
|
|
4
|
+
* The single canonical source — components, onboarding, Settings, and the
|
|
5
|
+
* consult endpoint all import from here so the labels and ⓘ copy are
|
|
6
|
+
* byte-identical across surfaces. Do NOT inline lens copy in components.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LENS_KEYS: readonly ["gentle_attachment", "routine_structured", "balanced_flexible", "unsure"];
|
|
9
|
+
export type ParentingLens = (typeof LENS_KEYS)[number];
|
|
10
|
+
export interface LensMeta {
|
|
11
|
+
key: ParentingLens;
|
|
12
|
+
label: string;
|
|
13
|
+
emoji: string;
|
|
14
|
+
/** Plain-English ⓘ modal copy. Same string used in onboarding + Settings. */
|
|
15
|
+
infoPlain: string;
|
|
16
|
+
}
|
|
17
|
+
export declare const PARENTING_LENS: Record<ParentingLens, LensMeta>;
|
|
18
|
+
/**
|
|
19
|
+
* System-prompt fragment per lens. Injected into the consult prompt so the
|
|
20
|
+
* answer is shaped by the chosen philosophy.
|
|
21
|
+
*
|
|
22
|
+
* `unsure` returns a neutral/balanced fragment that **self-labels** as
|
|
23
|
+
* not-yet-set so the model never pretends to know the parent's stance.
|
|
24
|
+
*/
|
|
25
|
+
export declare function lensForPrompt(lens: ParentingLens): string;
|
|
26
|
+
//# sourceMappingURL=lens.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lens.d.ts","sourceRoot":"","sources":["../src/lens.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,eAAO,MAAM,SAAS,qFAKZ,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,SAAS,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,MAAM,WAAW,QAAQ;IACvB,GAAG,EAAE,aAAa,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;IACd,6EAA6E;IAC7E,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,aAAa,EAAE,QAAQ,CA6B1D,CAAC;AAEF;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,aAAa,GAAG,MAAM,CA2BzD"}
|
package/dist/lens.js
ADDED
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Parenting-lens vocabulary + system-prompt helper (GHI-03).
|
|
4
|
+
*
|
|
5
|
+
* The single canonical source — components, onboarding, Settings, and the
|
|
6
|
+
* consult endpoint all import from here so the labels and ⓘ copy are
|
|
7
|
+
* byte-identical across surfaces. Do NOT inline lens copy in components.
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.PARENTING_LENS = exports.LENS_KEYS = void 0;
|
|
11
|
+
exports.lensForPrompt = lensForPrompt;
|
|
12
|
+
exports.LENS_KEYS = [
|
|
13
|
+
'gentle_attachment',
|
|
14
|
+
'routine_structured',
|
|
15
|
+
'balanced_flexible',
|
|
16
|
+
'unsure',
|
|
17
|
+
];
|
|
18
|
+
exports.PARENTING_LENS = {
|
|
19
|
+
gentle_attachment: {
|
|
20
|
+
key: 'gentle_attachment',
|
|
21
|
+
label: 'Gentle / attachment',
|
|
22
|
+
emoji: '🤱',
|
|
23
|
+
infoPlain: 'Comfort-first. Respond quickly to crying, lots of contact, no cry-it-out. Trust that responsiveness builds security.',
|
|
24
|
+
},
|
|
25
|
+
routine_structured: {
|
|
26
|
+
key: 'routine_structured',
|
|
27
|
+
label: 'Routine / structured',
|
|
28
|
+
emoji: '🗓️',
|
|
29
|
+
infoPlain: 'Predictable schedules for sleep and feeds. Clear sleep training when needed. Confidence comes from rhythm.',
|
|
30
|
+
},
|
|
31
|
+
balanced_flexible: {
|
|
32
|
+
key: 'balanced_flexible',
|
|
33
|
+
label: 'Balanced / flexible',
|
|
34
|
+
emoji: '⚖️',
|
|
35
|
+
infoPlain: 'Mix of warmth and structure. Read the baby, adapt the plan. Use gentle methods first, escalate if needed.',
|
|
36
|
+
},
|
|
37
|
+
unsure: {
|
|
38
|
+
key: 'unsure',
|
|
39
|
+
label: "I'm not sure yet",
|
|
40
|
+
emoji: '🤷',
|
|
41
|
+
infoPlain: "You haven't picked a style yet — that's fine. You'll see neutral, balanced advice, and we'll flag when a choice would change the answer.",
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
/**
|
|
45
|
+
* System-prompt fragment per lens. Injected into the consult prompt so the
|
|
46
|
+
* answer is shaped by the chosen philosophy.
|
|
47
|
+
*
|
|
48
|
+
* `unsure` returns a neutral/balanced fragment that **self-labels** as
|
|
49
|
+
* not-yet-set so the model never pretends to know the parent's stance.
|
|
50
|
+
*/
|
|
51
|
+
function lensForPrompt(lens) {
|
|
52
|
+
switch (lens) {
|
|
53
|
+
case 'gentle_attachment':
|
|
54
|
+
return [
|
|
55
|
+
'Lens: gentle / attachment.',
|
|
56
|
+
'Prioritize comfort and responsiveness. Never suggest cry-it-out or extinction methods.',
|
|
57
|
+
'Frame sleep plans around presence, contact, and gradual withdrawal.',
|
|
58
|
+
].join(' ');
|
|
59
|
+
case 'routine_structured':
|
|
60
|
+
return [
|
|
61
|
+
'Lens: routine / structured.',
|
|
62
|
+
'Lean on predictable schedules, clear wake windows, and consistent bedtime cues.',
|
|
63
|
+
'Structured sleep-training methods (Ferber-style checks, controlled comforting) are acceptable when the parent asks.',
|
|
64
|
+
].join(' ');
|
|
65
|
+
case 'balanced_flexible':
|
|
66
|
+
return [
|
|
67
|
+
'Lens: balanced / flexible.',
|
|
68
|
+
'Combine warmth and structure. Start with gentle methods; if they aren\'t working after a fair trial,',
|
|
69
|
+
'name the structured option without pushing it.',
|
|
70
|
+
].join(' ');
|
|
71
|
+
case 'unsure':
|
|
72
|
+
return [
|
|
73
|
+
'Lens: not yet set.',
|
|
74
|
+
"Give a neutral, balanced answer and SAY SO — e.g. 'You haven't picked a parenting style yet, so here's a middle path…'.",
|
|
75
|
+
'Never assume a stance. Flag the one place where a stance would change the answer.',
|
|
76
|
+
].join(' ');
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
//# sourceMappingURL=lens.js.map
|
package/dist/lens.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lens.js","sourceRoot":"","sources":["../src/lens.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAyDH,sCA2BC;AAlFY,QAAA,SAAS,GAAG;IACvB,mBAAmB;IACnB,oBAAoB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/**
|
|
2
|
+
* Sleep disturbance filtering — the logic that turns a flood of raw sensor
|
|
3
|
+
* readings into the handful of human-meaningful stirs a parent (and the LLM)
|
|
4
|
+
* actually cares about.
|
|
5
|
+
*
|
|
6
|
+
* Producer: Sleepy Sounds ingestion calls `filterDisturbances()` on its raw
|
|
7
|
+
* candidates and emits only the survivors as `sleep_disturbance` events.
|
|
8
|
+
* Consumer: any app calls `summarizeSleepNight()` to render a session + its
|
|
9
|
+
* disturbances into one LLM-ready sentence.
|
|
10
|
+
*
|
|
11
|
+
* See parents-apps/docs/data-architecture/04-decisions.md
|
|
12
|
+
* § "sleep_disturbance — significance filtering and per-session cap".
|
|
13
|
+
*/
|
|
14
|
+
/** Audio peak this many dB over the night's noise floor → candidate. */
|
|
15
|
+
export declare const DISTURBANCE_AUDIO_OVER_FLOOR_DB = 15;
|
|
16
|
+
/** Normalized motion (0–1) at/above this → candidate. */
|
|
17
|
+
export declare const DISTURBANCE_MOTION_INDEX = 0.3;
|
|
18
|
+
/** A candidate must persist at least this long to count. */
|
|
19
|
+
export declare const DISTURBANCE_MIN_SUSTAIN_SEC = 30;
|
|
20
|
+
/** Candidates within this many minutes merge into one. */
|
|
21
|
+
export declare const DISTURBANCE_MERGE_WINDOW_MIN = 5;
|
|
22
|
+
/** Never emit more than this many disturbances per session. */
|
|
23
|
+
export declare const DISTURBANCE_PER_SESSION_CAP = 8;
|
|
24
|
+
/** Audio peak this many dB over floor → `significant` (vs `minor`). */
|
|
25
|
+
export declare const DISTURBANCE_SIGNIFICANT_OVER_FLOOR_DB = 25;
|
|
26
|
+
/** Duration (min) at/above which a disturbance is `significant`. */
|
|
27
|
+
export declare const DISTURBANCE_SIGNIFICANT_MIN = 2;
|
|
28
|
+
export type DisturbanceType = 'stir' | 'wake' | 'cry' | 'noise';
|
|
29
|
+
export type DisturbanceIntensity = 'minor' | 'significant';
|
|
30
|
+
/** Raw candidate as produced by the sensor ingestion (pre-filter). */
|
|
31
|
+
export interface RawDisturbanceCandidate {
|
|
32
|
+
offset_min: number;
|
|
33
|
+
type: DisturbanceType;
|
|
34
|
+
duration_sec: number;
|
|
35
|
+
audio_peak_db: number;
|
|
36
|
+
motion_index?: number;
|
|
37
|
+
ended_session?: boolean;
|
|
38
|
+
}
|
|
39
|
+
/** A filtered, classified disturbance ready to become a sleep_disturbance event. */
|
|
40
|
+
export interface ClassifiedDisturbance {
|
|
41
|
+
offset_min: number;
|
|
42
|
+
type: DisturbanceType;
|
|
43
|
+
duration_min: number;
|
|
44
|
+
intensity: DisturbanceIntensity;
|
|
45
|
+
audio_peak_db: number;
|
|
46
|
+
motion_index: number;
|
|
47
|
+
}
|
|
48
|
+
/** Does this raw candidate clear the candidate gate (loud OR moving enough, long enough)? */
|
|
49
|
+
export declare function isDisturbanceCandidate(c: RawDisturbanceCandidate, noiseFloorDb: number): boolean;
|
|
50
|
+
/** minor vs significant. */
|
|
51
|
+
export declare function classifyIntensity(c: RawDisturbanceCandidate, noiseFloorDb: number): DisturbanceIntensity;
|
|
52
|
+
/**
|
|
53
|
+
* The full pipeline: gate → merge bursts → cap → classify.
|
|
54
|
+
* Returns the disturbances worth persisting, in chronological order.
|
|
55
|
+
*/
|
|
56
|
+
export declare function filterDisturbances(candidates: RawDisturbanceCandidate[], noiseFloorDb: number): ClassifiedDisturbance[];
|
|
57
|
+
/** `sleep_session.wake_count` = emitted disturbances of type wake|cry. */
|
|
58
|
+
export declare function deriveWakeCount(disturbances: Pick<ClassifiedDisturbance, 'type'>[]): number;
|
|
59
|
+
export interface SleepNightSummaryInput {
|
|
60
|
+
started_at: string;
|
|
61
|
+
ended_at: string;
|
|
62
|
+
duration_min: number;
|
|
63
|
+
quality: string;
|
|
64
|
+
period?: string;
|
|
65
|
+
disturbances: Pick<ClassifiedDisturbance, 'offset_min' | 'type' | 'intensity' | 'audio_peak_db' | 'duration_min'>[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* One human sentence describing a sleep and its disturbances — the exact form
|
|
69
|
+
* injected into the LLM consult prompt.
|
|
70
|
+
* "Nap 14:00–15:30 (1h 30m, good) — significant stir at 0:23 (68dB, 2m),
|
|
71
|
+
* woke at 0:57."
|
|
72
|
+
*/
|
|
73
|
+
export declare function summarizeSleepNight(s: SleepNightSummaryInput): string;
|
|
74
|
+
//# sourceMappingURL=sleep.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.d.ts","sourceRoot":"","sources":["../src/sleep.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,wEAAwE;AACxE,eAAO,MAAM,+BAA+B,KAAK,CAAC;AAClD,yDAAyD;AACzD,eAAO,MAAM,wBAAwB,MAAO,CAAC;AAC7C,4DAA4D;AAC5D,eAAO,MAAM,2BAA2B,KAAK,CAAC;AAC9C,0DAA0D;AAC1D,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,+DAA+D;AAC/D,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAC7C,uEAAuE;AACvE,eAAO,MAAM,qCAAqC,KAAK,CAAC;AACxD,oEAAoE;AACpE,eAAO,MAAM,2BAA2B,IAAI,CAAC;AAE7C,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG,MAAM,GAAG,KAAK,GAAG,OAAO,CAAC;AAChE,MAAM,MAAM,oBAAoB,GAAG,OAAO,GAAG,aAAa,CAAC;AAE3D,sEAAsE;AACtE,MAAM,WAAW,uBAAuB;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AAED,oFAAoF;AACpF,MAAM,WAAW,qBAAqB;IACpC,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,eAAe,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,oBAAoB,CAAC;IAChC,aAAa,EAAE,MAAM,CAAC;IACtB,YAAY,EAAE,MAAM,CAAC;CACtB;AAED,6FAA6F;AAC7F,wBAAgB,sBAAsB,CAAC,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,GAAG,OAAO,CAKhG;AAED,4BAA4B;AAC5B,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,uBAAuB,EAAE,YAAY,EAAE,MAAM,GAAG,oBAAoB,CAMxG;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,UAAU,EAAE,uBAAuB,EAAE,EACrC,YAAY,EAAE,MAAM,GACnB,qBAAqB,EAAE,CA0CzB;AAED,0EAA0E;AAC1E,wBAAgB,eAAe,CAAC,YAAY,EAAE,IAAI,CAAC,qBAAqB,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAE3F;AAID,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;IACrB,OAAO,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,IAAI,CAAC,qBAAqB,EAAE,YAAY,GAAG,MAAM,GAAG,WAAW,GAAG,eAAe,GAAG,cAAc,CAAC,EAAE,CAAC;CACrH;AAkBD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,sBAAsB,GAAG,MAAM,CAoBrE"}
|
package/dist/sleep.js
ADDED
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Sleep disturbance filtering — the logic that turns a flood of raw sensor
|
|
4
|
+
* readings into the handful of human-meaningful stirs a parent (and the LLM)
|
|
5
|
+
* actually cares about.
|
|
6
|
+
*
|
|
7
|
+
* Producer: Sleepy Sounds ingestion calls `filterDisturbances()` on its raw
|
|
8
|
+
* candidates and emits only the survivors as `sleep_disturbance` events.
|
|
9
|
+
* Consumer: any app calls `summarizeSleepNight()` to render a session + its
|
|
10
|
+
* disturbances into one LLM-ready sentence.
|
|
11
|
+
*
|
|
12
|
+
* See parents-apps/docs/data-architecture/04-decisions.md
|
|
13
|
+
* § "sleep_disturbance — significance filtering and per-session cap".
|
|
14
|
+
*/
|
|
15
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
16
|
+
exports.DISTURBANCE_SIGNIFICANT_MIN = exports.DISTURBANCE_SIGNIFICANT_OVER_FLOOR_DB = exports.DISTURBANCE_PER_SESSION_CAP = exports.DISTURBANCE_MERGE_WINDOW_MIN = exports.DISTURBANCE_MIN_SUSTAIN_SEC = exports.DISTURBANCE_MOTION_INDEX = exports.DISTURBANCE_AUDIO_OVER_FLOOR_DB = void 0;
|
|
17
|
+
exports.isDisturbanceCandidate = isDisturbanceCandidate;
|
|
18
|
+
exports.classifyIntensity = classifyIntensity;
|
|
19
|
+
exports.filterDisturbances = filterDisturbances;
|
|
20
|
+
exports.deriveWakeCount = deriveWakeCount;
|
|
21
|
+
exports.summarizeSleepNight = summarizeSleepNight;
|
|
22
|
+
// ── Thresholds (tune against real sensor data) ──────────────────────────────────
|
|
23
|
+
/** Audio peak this many dB over the night's noise floor → candidate. */
|
|
24
|
+
exports.DISTURBANCE_AUDIO_OVER_FLOOR_DB = 15;
|
|
25
|
+
/** Normalized motion (0–1) at/above this → candidate. */
|
|
26
|
+
exports.DISTURBANCE_MOTION_INDEX = 0.30;
|
|
27
|
+
/** A candidate must persist at least this long to count. */
|
|
28
|
+
exports.DISTURBANCE_MIN_SUSTAIN_SEC = 30;
|
|
29
|
+
/** Candidates within this many minutes merge into one. */
|
|
30
|
+
exports.DISTURBANCE_MERGE_WINDOW_MIN = 5;
|
|
31
|
+
/** Never emit more than this many disturbances per session. */
|
|
32
|
+
exports.DISTURBANCE_PER_SESSION_CAP = 8;
|
|
33
|
+
/** Audio peak this many dB over floor → `significant` (vs `minor`). */
|
|
34
|
+
exports.DISTURBANCE_SIGNIFICANT_OVER_FLOOR_DB = 25;
|
|
35
|
+
/** Duration (min) at/above which a disturbance is `significant`. */
|
|
36
|
+
exports.DISTURBANCE_SIGNIFICANT_MIN = 2;
|
|
37
|
+
/** Does this raw candidate clear the candidate gate (loud OR moving enough, long enough)? */
|
|
38
|
+
function isDisturbanceCandidate(c, noiseFloorDb) {
|
|
39
|
+
if (c.duration_sec < exports.DISTURBANCE_MIN_SUSTAIN_SEC)
|
|
40
|
+
return false;
|
|
41
|
+
const loud = c.audio_peak_db >= noiseFloorDb + exports.DISTURBANCE_AUDIO_OVER_FLOOR_DB;
|
|
42
|
+
const moving = (c.motion_index ?? 0) >= exports.DISTURBANCE_MOTION_INDEX;
|
|
43
|
+
return loud || moving;
|
|
44
|
+
}
|
|
45
|
+
/** minor vs significant. */
|
|
46
|
+
function classifyIntensity(c, noiseFloorDb) {
|
|
47
|
+
const durationMin = c.duration_sec / 60;
|
|
48
|
+
const loudEnough = c.audio_peak_db >= noiseFloorDb + exports.DISTURBANCE_SIGNIFICANT_OVER_FLOOR_DB;
|
|
49
|
+
const longEnough = durationMin >= exports.DISTURBANCE_SIGNIFICANT_MIN;
|
|
50
|
+
if (loudEnough || longEnough || c.ended_session)
|
|
51
|
+
return 'significant';
|
|
52
|
+
return 'minor';
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* The full pipeline: gate → merge bursts → cap → classify.
|
|
56
|
+
* Returns the disturbances worth persisting, in chronological order.
|
|
57
|
+
*/
|
|
58
|
+
function filterDisturbances(candidates, noiseFloorDb) {
|
|
59
|
+
// 1. Gate.
|
|
60
|
+
const gated = candidates
|
|
61
|
+
.filter((c) => isDisturbanceCandidate(c, noiseFloorDb))
|
|
62
|
+
.sort((a, b) => a.offset_min - b.offset_min);
|
|
63
|
+
// 2. Merge bursts within the merge window (keep strongest peak, sum durations,
|
|
64
|
+
// keep the "loudest" type, OR-in ended_session).
|
|
65
|
+
const merged = [];
|
|
66
|
+
for (const c of gated) {
|
|
67
|
+
const prev = merged[merged.length - 1];
|
|
68
|
+
if (prev && c.offset_min - prev.offset_min <= exports.DISTURBANCE_MERGE_WINDOW_MIN) {
|
|
69
|
+
prev.duration_sec += c.duration_sec;
|
|
70
|
+
prev.audio_peak_db = Math.max(prev.audio_peak_db, c.audio_peak_db);
|
|
71
|
+
prev.motion_index = Math.max(prev.motion_index ?? 0, c.motion_index ?? 0);
|
|
72
|
+
prev.ended_session = prev.ended_session || c.ended_session;
|
|
73
|
+
// upgrade type toward the more serious one
|
|
74
|
+
const rank = { noise: 0, stir: 1, cry: 2, wake: 3 };
|
|
75
|
+
if (rank[c.type] > rank[prev.type])
|
|
76
|
+
prev.type = c.type;
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
merged.push({ ...c });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
// 3. Cap: keep the most intense N (by peak), then restore chronological order.
|
|
83
|
+
let capped = merged;
|
|
84
|
+
if (merged.length > exports.DISTURBANCE_PER_SESSION_CAP) {
|
|
85
|
+
capped = [...merged]
|
|
86
|
+
.sort((a, b) => b.audio_peak_db - a.audio_peak_db)
|
|
87
|
+
.slice(0, exports.DISTURBANCE_PER_SESSION_CAP)
|
|
88
|
+
.sort((a, b) => a.offset_min - b.offset_min);
|
|
89
|
+
}
|
|
90
|
+
// 4. Classify + shape.
|
|
91
|
+
return capped.map((c) => ({
|
|
92
|
+
offset_min: Math.round(c.offset_min),
|
|
93
|
+
type: c.type,
|
|
94
|
+
duration_min: Math.max(0, Math.round(c.duration_sec / 60)),
|
|
95
|
+
intensity: classifyIntensity(c, noiseFloorDb),
|
|
96
|
+
audio_peak_db: Math.round(c.audio_peak_db),
|
|
97
|
+
motion_index: Number((c.motion_index ?? 0).toFixed(2)),
|
|
98
|
+
}));
|
|
99
|
+
}
|
|
100
|
+
/** `sleep_session.wake_count` = emitted disturbances of type wake|cry. */
|
|
101
|
+
function deriveWakeCount(disturbances) {
|
|
102
|
+
return disturbances.filter((d) => d.type === 'wake' || d.type === 'cry').length;
|
|
103
|
+
}
|
|
104
|
+
function hm(iso) {
|
|
105
|
+
const d = new Date(iso);
|
|
106
|
+
return `${String(d.getHours()).padStart(2, '0')}:${String(d.getMinutes()).padStart(2, '0')}`;
|
|
107
|
+
}
|
|
108
|
+
function offsetClock(offsetMin) {
|
|
109
|
+
const h = Math.floor(offsetMin / 60);
|
|
110
|
+
const m = offsetMin % 60;
|
|
111
|
+
return `${h}:${String(m).padStart(2, '0')}`;
|
|
112
|
+
}
|
|
113
|
+
function durLabel(min) {
|
|
114
|
+
if (min < 60)
|
|
115
|
+
return `${min}m`;
|
|
116
|
+
const h = Math.floor(min / 60);
|
|
117
|
+
const m = min % 60;
|
|
118
|
+
return m === 0 ? `${h}h` : `${h}h ${m}m`;
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* One human sentence describing a sleep and its disturbances — the exact form
|
|
122
|
+
* injected into the LLM consult prompt.
|
|
123
|
+
* "Nap 14:00–15:30 (1h 30m, good) — significant stir at 0:23 (68dB, 2m),
|
|
124
|
+
* woke at 0:57."
|
|
125
|
+
*/
|
|
126
|
+
function summarizeSleepNight(s) {
|
|
127
|
+
const label = s.period === 'night' ? 'Night sleep' : 'Nap';
|
|
128
|
+
const head = `${label} ${hm(s.started_at)}–${hm(s.ended_at)} (${durLabel(s.duration_min)}, ${s.quality})`;
|
|
129
|
+
if (!s.disturbances || s.disturbances.length === 0) {
|
|
130
|
+
return `${head} — undisturbed.`;
|
|
131
|
+
}
|
|
132
|
+
const parts = s.disturbances
|
|
133
|
+
.slice()
|
|
134
|
+
.sort((a, b) => a.offset_min - b.offset_min)
|
|
135
|
+
.map((d) => {
|
|
136
|
+
const verb = d.type === 'wake' ? 'woke'
|
|
137
|
+
: d.type === 'cry' ? 'cried'
|
|
138
|
+
: d.type === 'noise' ? 'noise'
|
|
139
|
+
: 'stir';
|
|
140
|
+
const sig = d.intensity === 'significant' ? 'significant ' : '';
|
|
141
|
+
const detail = `${d.audio_peak_db}dB${d.duration_min ? `, ${d.duration_min}m` : ''}`;
|
|
142
|
+
return `${sig}${verb} at ${offsetClock(d.offset_min)} (${detail})`;
|
|
143
|
+
});
|
|
144
|
+
return `${head} — ${parts.join(', ')}.`;
|
|
145
|
+
}
|
|
146
|
+
//# sourceMappingURL=sleep.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sleep.js","sourceRoot":"","sources":["../src/sleep.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;GAYG;;;AA0CH,wDAKC;AAGD,8CAMC;AAMD,gDA6CC;AAGD,0CAEC;AAmCD,kDAoBC;AArKD,mFAAmF;AACnF,wEAAwE;AAC3D,QAAA,+BAA+B,GAAG,EAAE,CAAC;AAClD,yDAAyD;AAC5C,QAAA,wBAAwB,GAAG,IAAI,CAAC;AAC7C,4DAA4D;AAC/C,QAAA,2BAA2B,GAAG,EAAE,CAAC;AAC9C,0DAA0D;AAC7C,QAAA,4BAA4B,GAAG,CAAC,CAAC;AAC9C,+DAA+D;AAClD,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAC7C,uEAAuE;AAC1D,QAAA,qCAAqC,GAAG,EAAE,CAAC;AACxD,oEAAoE;AACvD,QAAA,2BAA2B,GAAG,CAAC,CAAC;AAyB7C,6FAA6F;AAC7F,SAAgB,sBAAsB,CAAC,CAA0B,EAAE,YAAoB;IACrF,IAAI,CAAC,CAAC,YAAY,GAAG,mCAA2B;QAAE,OAAO,KAAK,CAAC;IAC/D,MAAM,IAAI,GAAG,CAAC,CAAC,aAAa,IAAI,YAAY,GAAG,uCAA+B,CAAC;IAC/E,MAAM,MAAM,GAAG,CAAC,CAAC,CAAC,YAAY,IAAI,CAAC,CAAC,IAAI,gCAAwB,CAAC;IACjE,OAAO,IAAI,IAAI,MAAM,CAAC;AACxB,CAAC;AAED,4BAA4B;AAC5B,SAAgB,iBAAiB,CAAC,CAA0B,EAAE,YAAoB;IAChF,MA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QAChE,MAAM,MAAM,GAAG,GAAG,CAAC,CAAC,aAAa,KAAK,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC;QACrF,OAAO,GAAG,GAAG,GAAG,IAAI,OAAO,WAAW,CAAC,CAAC,CAAC,UAAU,CAAC,KAAK,MAAM,GAAG,CAAC;IACrE,CAAC,CAAC,CAAC;IACL,OAAO,GAAG,IAAI,MAAM,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC;AAC1C,CAAC"}
|
|
@@ -121,6 +121,7 @@ export declare const SleepSessionSchema: z.ZodObject<{
|
|
|
121
121
|
readonly RESTLESS: "restless";
|
|
122
122
|
readonly FRAGMENTED: "fragmented";
|
|
123
123
|
}>;
|
|
124
|
+
period: z.ZodEnum<["nap", "night"]>;
|
|
124
125
|
room_temp_c: z.ZodNullable<z.ZodNumber>;
|
|
125
126
|
noise_floor_db: z.ZodNullable<z.ZodNumber>;
|
|
126
127
|
wake_count: z.ZodNumber;
|
|
@@ -131,6 +132,7 @@ export declare const SleepSessionSchema: z.ZodObject<{
|
|
|
131
132
|
started_at: Date;
|
|
132
133
|
ended_at: Date;
|
|
133
134
|
quality: "good" | "restless" | "fragmented";
|
|
135
|
+
period: "nap" | "night";
|
|
134
136
|
room_temp_c: number | null;
|
|
135
137
|
noise_floor_db: number | null;
|
|
136
138
|
wake_count: number;
|
|
@@ -141,6 +143,7 @@ export declare const SleepSessionSchema: z.ZodObject<{
|
|
|
141
143
|
started_at: Date;
|
|
142
144
|
ended_at: Date;
|
|
143
145
|
quality: "good" | "restless" | "fragmented";
|
|
146
|
+
period: "nap" | "night";
|
|
144
147
|
room_temp_c: number | null;
|
|
145
148
|
noise_floor_db: number | null;
|
|
146
149
|
wake_count: number;
|
|
@@ -153,6 +156,7 @@ export declare const SleepSessionSchema: z.ZodObject<{
|
|
|
153
156
|
started_at: Date;
|
|
154
157
|
ended_at: Date;
|
|
155
158
|
quality: "good" | "restless" | "fragmented";
|
|
159
|
+
period: "nap" | "night";
|
|
156
160
|
room_temp_c: number | null;
|
|
157
161
|
noise_floor_db: number | null;
|
|
158
162
|
wake_count: number;
|
|
@@ -169,6 +173,7 @@ export declare const SleepSessionSchema: z.ZodObject<{
|
|
|
169
173
|
started_at: Date;
|
|
170
174
|
ended_at: Date;
|
|
171
175
|
quality: "good" | "restless" | "fragmented";
|
|
176
|
+
period: "nap" | "night";
|
|
172
177
|
room_temp_c: number | null;
|
|
173
178
|
noise_floor_db: number | null;
|
|
174
179
|
wake_count: number;
|
|
@@ -187,29 +192,45 @@ export declare const SleepDisturbanceSchema: z.ZodObject<{
|
|
|
187
192
|
event_type: z.ZodLiteral<"sleep_disturbance">;
|
|
188
193
|
data: z.ZodObject<{
|
|
189
194
|
v: z.ZodLiteral<1>;
|
|
190
|
-
|
|
195
|
+
session_id: z.ZodString;
|
|
196
|
+
offset_min: z.ZodNumber;
|
|
197
|
+
type: z.ZodEnum<["stir", "wake", "cry", "noise"]>;
|
|
191
198
|
duration_min: z.ZodNumber;
|
|
199
|
+
intensity: z.ZodEnum<["minor", "significant"]>;
|
|
192
200
|
audio_peak_db: z.ZodNumber;
|
|
201
|
+
motion_index: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
193
202
|
detected_by: z.ZodEnum<["passive", "manual"]>;
|
|
194
203
|
}, "strip", z.ZodTypeAny, {
|
|
195
204
|
v: 1;
|
|
196
|
-
type: "wake";
|
|
205
|
+
type: "stir" | "wake" | "cry" | "noise";
|
|
197
206
|
duration_min: number;
|
|
207
|
+
session_id: string;
|
|
208
|
+
offset_min: number;
|
|
209
|
+
intensity: "minor" | "significant";
|
|
198
210
|
audio_peak_db: number;
|
|
211
|
+
motion_index: number;
|
|
199
212
|
detected_by: "passive" | "manual";
|
|
200
213
|
}, {
|
|
201
214
|
v: 1;
|
|
202
|
-
type: "wake";
|
|
215
|
+
type: "stir" | "wake" | "cry" | "noise";
|
|
203
216
|
duration_min: number;
|
|
217
|
+
session_id: string;
|
|
218
|
+
offset_min: number;
|
|
219
|
+
intensity: "minor" | "significant";
|
|
204
220
|
audio_peak_db: number;
|
|
205
221
|
detected_by: "passive" | "manual";
|
|
222
|
+
motion_index?: number | undefined;
|
|
206
223
|
}>;
|
|
207
224
|
}, "strip", z.ZodTypeAny, {
|
|
208
225
|
data: {
|
|
209
226
|
v: 1;
|
|
210
|
-
type: "wake";
|
|
227
|
+
type: "stir" | "wake" | "cry" | "noise";
|
|
211
228
|
duration_min: number;
|
|
229
|
+
session_id: string;
|
|
230
|
+
offset_min: number;
|
|
231
|
+
intensity: "minor" | "significant";
|
|
212
232
|
audio_peak_db: number;
|
|
233
|
+
motion_index: number;
|
|
213
234
|
detected_by: "passive" | "manual";
|
|
214
235
|
};
|
|
215
236
|
v: number;
|
|
@@ -219,10 +240,14 @@ export declare const SleepDisturbanceSchema: z.ZodObject<{
|
|
|
219
240
|
}, {
|
|
220
241
|
data: {
|
|
221
242
|
v: 1;
|
|
222
|
-
type: "wake";
|
|
243
|
+
type: "stir" | "wake" | "cry" | "noise";
|
|
223
244
|
duration_min: number;
|
|
245
|
+
session_id: string;
|
|
246
|
+
offset_min: number;
|
|
247
|
+
intensity: "minor" | "significant";
|
|
224
248
|
audio_peak_db: number;
|
|
225
249
|
detected_by: "passive" | "manual";
|
|
250
|
+
motion_index?: number | undefined;
|
|
226
251
|
};
|
|
227
252
|
v: number;
|
|
228
253
|
event_type: "sleep_disturbance";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.d.ts","sourceRoot":"","sources":["../../src/validators/events.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAM1B,CAAC;AAEH,eAAO,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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M,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQvB,CAAC;AAEH,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQtB,CAAC;AAEH,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUzB,CAAC;AAEH,eAAO,MAAM,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAUvB,CAAC;AAEH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAW1B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAQ7B,CAAC;AAEH,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAS5B,CAAC"}
|
|
@@ -31,19 +31,27 @@ exports.SleepSessionSchema = exports.BaseEventSchema.extend({
|
|
|
31
31
|
started_at: zod_1.z.coerce.date(),
|
|
32
32
|
ended_at: zod_1.z.coerce.date(),
|
|
33
33
|
quality: zod_1.z.nativeEnum(constants_1.SLEEP_QUALITY),
|
|
34
|
+
period: zod_1.z.enum(['nap', 'night']),
|
|
34
35
|
room_temp_c: zod_1.z.number().nullable(),
|
|
35
36
|
noise_floor_db: zod_1.z.number().nullable(),
|
|
36
37
|
wake_count: zod_1.z.number().int().nonnegative(),
|
|
37
38
|
is_passive: zod_1.z.boolean(),
|
|
38
39
|
}),
|
|
39
40
|
});
|
|
41
|
+
// A meaningful stir/wake WITHIN a sleep session. Emitted only when it clears
|
|
42
|
+
// the significance filter (see classifyDisturbance in sleep.ts). offset_min and
|
|
43
|
+
// session_id nest it under its parent sleep_session for the LLM.
|
|
40
44
|
exports.SleepDisturbanceSchema = exports.BaseEventSchema.extend({
|
|
41
45
|
event_type: zod_1.z.literal(constants_1.EVENT_TYPE.SLEEP_DISTURBANCE),
|
|
42
46
|
data: zod_1.z.object({
|
|
43
47
|
v: zod_1.z.literal(1),
|
|
44
|
-
|
|
48
|
+
session_id: zod_1.z.string().uuid(),
|
|
49
|
+
offset_min: zod_1.z.number().int().nonnegative(),
|
|
50
|
+
type: zod_1.z.enum(['stir', 'wake', 'cry', 'noise']),
|
|
45
51
|
duration_min: zod_1.z.number().int().nonnegative(),
|
|
52
|
+
intensity: zod_1.z.enum(['minor', 'significant']),
|
|
46
53
|
audio_peak_db: zod_1.z.number(),
|
|
54
|
+
motion_index: zod_1.z.number().min(0).max(1).optional().default(0),
|
|
47
55
|
detected_by: zod_1.z.enum(['passive', 'manual']),
|
|
48
56
|
}),
|
|
49
57
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"events.js","sourceRoot":"","sources":["../../src/validators/events.ts"],"names":[],"mappings":";;;AAAA,6BAAwB;AACxB,4CAAuE;AAE1D,QAAA,eAAe,GAAG,OAAC,CAAC,MAAM,CAAC;IACtC,CAAC,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IAC9B,UAAU,EAAE,OAAC,CAAC,UAAU,CAAC,sBAAU,CAAC;IACpC,WAAW,EAAE,OAAC,CAAC,MAAM,CAAC,IAAI,EAAE;IAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IACzB,IAAI,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,OAAO,EAAE,CAAC;CAC5B,CAAC,CAAC;AAEU,QAAA,aAAa,GAAG,uBAAe,CAAC,MAAM,CAAC;IAClD,UAAU,EAAE,OAAC,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