@dofek/scoring 0.1.0 → 0.1.1
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/README.md +24 -5
- package/dist/breathwork.d.ts +32 -0
- package/dist/breathwork.d.ts.map +1 -1
- package/dist/breathwork.js +67 -6
- package/dist/breathwork.js.map +1 -1
- package/dist/colors.d.ts +40 -0
- package/dist/colors.d.ts.map +1 -1
- package/dist/colors.js +40 -0
- package/dist/colors.js.map +1 -1
- package/dist/epistemic-status.d.ts +32 -0
- package/dist/epistemic-status.d.ts.map +1 -0
- package/dist/epistemic-status.js +18 -0
- package/dist/epistemic-status.js.map +1 -0
- package/dist/menstrual-cycle.d.ts +1 -0
- package/dist/menstrual-cycle.d.ts.map +1 -1
- package/dist/menstrual-cycle.js +1 -0
- package/dist/menstrual-cycle.js.map +1 -1
- package/dist/scoring.d.ts +14 -14
- package/dist/scoring.d.ts.map +1 -1
- package/dist/scoring.js +17 -52
- package/dist/scoring.js.map +1 -1
- package/dist/strain-target.d.ts +2 -3
- package/dist/strain-target.d.ts.map +1 -1
- package/dist/strain-target.js +4 -15
- package/dist/strain-target.js.map +1 -1
- package/dist/today-plan.d.ts +70 -0
- package/dist/today-plan.d.ts.map +1 -0
- package/dist/today-plan.js +144 -0
- package/dist/today-plan.js.map +1 -0
- package/package.json +11 -5
package/README.md
CHANGED
|
@@ -35,13 +35,15 @@ console.log({
|
|
|
35
35
|
|
|
36
36
|
| Subpath | Purpose |
|
|
37
37
|
| --- | --- |
|
|
38
|
-
| `@dofek/scoring/scoring` | Strain, recovery,
|
|
38
|
+
| `@dofek/scoring/scoring` | Strain, recovery, trend, score-zone, and presentation helpers |
|
|
39
39
|
| `@dofek/scoring/colors` | Semantic, chart, surface, text, sleep-stage, and activity colors |
|
|
40
40
|
| `@dofek/scoring/tokens` | Framework-neutral typography, spacing, radius, animation, and chart tokens |
|
|
41
41
|
| `@dofek/scoring/strain-target` | Daily strain-target calculation and result types |
|
|
42
|
+
| `@dofek/scoring/today-plan` | Deterministic ready/insufficient-data Today Plan result with a primary action, supporting facts, server-authored caveats, confidence, freshness, and shared presentation helpers |
|
|
43
|
+
| `@dofek/scoring/epistemic-status` | Shared Observed / Estimated / Associated / Suggested / Unavailable status vocabulary |
|
|
42
44
|
| `@dofek/scoring/sleep-performance` | Sleep-performance components, tiers, and recommended-bedtime calculation |
|
|
43
45
|
| `@dofek/scoring/healthspan-years` | Score-to-years mapping and formatting |
|
|
44
|
-
| `@dofek/scoring/menstrual-cycle` | Cycle-phase estimation
|
|
46
|
+
| `@dofek/scoring/menstrual-cycle` | Cycle-phase estimation, display metadata, and shared safety copy |
|
|
45
47
|
| `@dofek/scoring/breathwork` | Built-in breathing techniques and session-duration helpers |
|
|
46
48
|
| `@dofek/scoring/loading-policy` | Blocking-loading state policy |
|
|
47
49
|
| `@dofek/scoring/query-cache` | Shared query-cache age constant |
|
|
@@ -52,16 +54,33 @@ console.log({
|
|
|
52
54
|
to zero, and caps the result at 21.
|
|
53
55
|
- `zScoreToRecoveryScore` uses a Dofek-defined asymmetric sigmoid where a
|
|
54
56
|
z-score of zero maps to 62.
|
|
55
|
-
- Strain targets use Dofek-defined readiness bands
|
|
56
|
-
|
|
57
|
+
- Strain targets use Dofek-defined readiness bands.
|
|
58
|
+
- Today Plan keeps Push and Recovery recommendations actionable while presenting
|
|
59
|
+
the Maintain band as the neutral “No change needs attention” state
|
|
60
|
+
([rule builder](./src/today-plan.ts), [executable tests](./src/today-plan.test.ts)).
|
|
61
|
+
- Ready Today Plan results include server-authored supporting observations and
|
|
62
|
+
caveats for missing or stale inputs; clients render these values without
|
|
63
|
+
deriving their meaning.
|
|
57
64
|
- Sleep performance defaults to 70% sleep sufficiency and 30% efficiency. When
|
|
58
65
|
consistency or low-stress inputs are supplied, it averages all available
|
|
59
66
|
components equally.
|
|
60
67
|
- Healthspan display deltas map scores from 0–100 onto +3 to -2 years.
|
|
61
68
|
- Cycle phases estimate ovulation as `cycleLength - 14`; this is a display
|
|
62
|
-
estimate, not a clinical assessment.
|
|
69
|
+
estimate, not a clinical assessment. A primary evaluation found that
|
|
70
|
+
cycle-length-only calendar methods cannot accurately predict ovulation day
|
|
71
|
+
([Johnson et al., 2018](https://pubmed.ncbi.nlm.nih.gov/29749274/)). The
|
|
72
|
+
shared safety notice follows
|
|
73
|
+
[Apple's Cycle Tracking limitation](https://support.apple.com/en-au/120356)
|
|
74
|
+
that these estimates must not be used for birth control or diagnosis.
|
|
63
75
|
- The design-token modules contain values only; they do not install fonts or
|
|
64
76
|
render UI.
|
|
77
|
+
- `operationalStatusColors` is the light-theme presentation palette for generic
|
|
78
|
+
application states. Its foregrounds meet the
|
|
79
|
+
[WCAG 2.2 normal-text contrast requirement](https://www.w3.org/TR/WCAG22/#contrast-minimum)
|
|
80
|
+
on paired surfaces, and its borders/indicators meet
|
|
81
|
+
[WCAG 2.2 non-text contrast](https://www.w3.org/WAI/WCAG22/Understanding/non-text-contrast).
|
|
82
|
+
It does not classify health, nutrition, training, clinical, or scoring values;
|
|
83
|
+
those domain meanings remain with their owning models.
|
|
65
84
|
|
|
66
85
|
The package performs no network requests and needs no authentication or runtime
|
|
67
86
|
configuration. Validate untrusted input before calling the calculation
|
package/dist/breathwork.d.ts
CHANGED
|
@@ -7,7 +7,15 @@
|
|
|
7
7
|
export interface BreathworkTechnique {
|
|
8
8
|
id: string;
|
|
9
9
|
name: string;
|
|
10
|
+
/** Concise user-facing reason to choose this practice */
|
|
11
|
+
purpose: string;
|
|
10
12
|
description: string;
|
|
13
|
+
/** User-facing difficulty label */
|
|
14
|
+
difficulty: BreathworkDifficulty;
|
|
15
|
+
/** Possible benefit supported by technique-specific evidence, never a guarantee */
|
|
16
|
+
possibleBenefit?: string;
|
|
17
|
+
/** Material guidance that clients must show before a session starts */
|
|
18
|
+
safety: BreathworkSafetyGuidance;
|
|
11
19
|
/** Inhale duration in seconds */
|
|
12
20
|
inhaleSeconds: number;
|
|
13
21
|
/** Hold after inhale in seconds (optional) */
|
|
@@ -19,9 +27,33 @@ export interface BreathworkTechnique {
|
|
|
19
27
|
/** Default number of rounds */
|
|
20
28
|
defaultRounds: number;
|
|
21
29
|
}
|
|
30
|
+
export declare const BREATHWORK_DIFFICULTIES: readonly ["Beginner", "Intermediate", "Advanced"];
|
|
31
|
+
export type BreathworkDifficulty = (typeof BREATHWORK_DIFFICULTIES)[number];
|
|
32
|
+
export interface BreathworkTechniqueDetails extends BreathworkTechnique {
|
|
33
|
+
/** Server-computed duration for the default session */
|
|
34
|
+
durationSeconds: number;
|
|
35
|
+
}
|
|
36
|
+
export interface BreathworkSafetyGuidance {
|
|
37
|
+
position: string;
|
|
38
|
+
warnings: string[];
|
|
39
|
+
stopCriteria: string;
|
|
40
|
+
emergency: string;
|
|
41
|
+
}
|
|
42
|
+
export declare const PERCEIVED_BREATHWORK_EFFECTS: readonly ["better", "same", "worse"];
|
|
43
|
+
export type PerceivedBreathworkEffect = (typeof PERCEIVED_BREATHWORK_EFFECTS)[number];
|
|
44
|
+
export interface BreathworkOutcomeReport {
|
|
45
|
+
stressBefore: number | null;
|
|
46
|
+
stressAfter: number | null;
|
|
47
|
+
dizzinessAfter: boolean | null;
|
|
48
|
+
perceivedEffect: PerceivedBreathworkEffect | null;
|
|
49
|
+
}
|
|
22
50
|
export declare const TECHNIQUES: BreathworkTechnique[];
|
|
23
51
|
/** Look up a technique by its ID */
|
|
24
52
|
export declare function getTechniqueById(id: string): BreathworkTechnique | undefined;
|
|
53
|
+
/** Return a human-readable label without exposing a stored technique identifier. */
|
|
54
|
+
export declare function getBreathworkTechniqueLabel(techniqueId: string): string;
|
|
25
55
|
/** Compute total session duration in seconds for a given number of rounds */
|
|
26
56
|
export declare function totalSessionSeconds(technique: BreathworkTechnique, rounds: number): number;
|
|
57
|
+
/** Add the server-owned default-session duration to a technique definition. */
|
|
58
|
+
export declare function toBreathworkTechniqueDetails(technique: BreathworkTechnique): BreathworkTechniqueDetails;
|
|
27
59
|
//# sourceMappingURL=breathwork.d.ts.map
|
package/dist/breathwork.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breathwork.d.ts","sourceRoot":"","sources":["../src/breathwork.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;IACpB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,UAAU,EAAE,mBAAmB,
|
|
1
|
+
{"version":3,"file":"breathwork.d.ts","sourceRoot":"","sources":["../src/breathwork.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,yDAAyD;IACzD,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,MAAM,CAAC;IACpB,mCAAmC;IACnC,UAAU,EAAE,oBAAoB,CAAC;IACjC,mFAAmF;IACnF,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,uEAAuE;IACvE,MAAM,EAAE,wBAAwB,CAAC;IACjC,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iCAAiC;IACjC,aAAa,EAAE,MAAM,CAAC;IACtB,8CAA8C;IAC9C,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+BAA+B;IAC/B,aAAa,EAAE,MAAM,CAAC;CACvB;AAED,eAAO,MAAM,uBAAuB,mDAAoD,CAAC;AACzF,MAAM,MAAM,oBAAoB,GAAG,CAAC,OAAO,uBAAuB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE5E,MAAM,WAAW,0BAA2B,SAAQ,mBAAmB;IACrE,uDAAuD;IACvD,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,wBAAwB;IACvC,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,EAAE,CAAC;IACnB,YAAY,EAAE,MAAM,CAAC;IACrB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,eAAO,MAAM,4BAA4B,sCAAuC,CAAC;AACjF,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEtF,MAAM,WAAW,uBAAuB;IACtC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAC3B,cAAc,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/B,eAAe,EAAE,yBAAyB,GAAG,IAAI,CAAC;CACnD;AA6BD,eAAO,MAAM,UAAU,EAAE,mBAAmB,EAoE3C,CAAC;AAEF,oCAAoC;AACpC,wBAAgB,gBAAgB,CAAC,EAAE,EAAE,MAAM,GAAG,mBAAmB,GAAG,SAAS,CAE5E;AAMD,oFAAoF;AACpF,wBAAgB,2BAA2B,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAMvE;AAED,6EAA6E;AAC7E,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,mBAAmB,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAO1F;AAED,+EAA+E;AAC/E,wBAAgB,4BAA4B,CAC1C,SAAS,EAAE,mBAAmB,GAC7B,0BAA0B,CAK5B"}
|
package/dist/breathwork.js
CHANGED
|
@@ -4,11 +4,42 @@
|
|
|
4
4
|
* Each technique defines the breathing pattern (inhale/hold/exhale/hold durations)
|
|
5
5
|
* and default number of rounds.
|
|
6
6
|
*/
|
|
7
|
+
export const BREATHWORK_DIFFICULTIES = ["Beginner", "Intermediate", "Advanced"];
|
|
8
|
+
export const PERCEIVED_BREATHWORK_EFFECTS = ["better", "same", "worse"];
|
|
9
|
+
/**
|
|
10
|
+
* Safety wording follows NHS breathing/fainting guidance:
|
|
11
|
+
* https://www.asph.nhs.uk/nervous-system-regulation
|
|
12
|
+
* https://www.nhs.uk/symptoms/fainting/
|
|
13
|
+
*/
|
|
14
|
+
const STANDARD_SAFETY = {
|
|
15
|
+
position: "Practice seated or lying down in a comfortable, safe place.",
|
|
16
|
+
warnings: ["Do not force or strain your breath."],
|
|
17
|
+
stopCriteria: "Stop and return to normal breathing if you feel dizzy or lightheaded.",
|
|
18
|
+
emergency: "Call emergency services if someone faints and is not breathing, cannot be woken within 1 minute, or has not fully recovered.",
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Safety guidance for intense breathing rounds:
|
|
22
|
+
* https://www.wimhofmethod.com/breathing-exercises
|
|
23
|
+
*/
|
|
24
|
+
const POWER_BREATHING_SAFETY = {
|
|
25
|
+
position: "Practice only while seated or lying down in a safe place.",
|
|
26
|
+
warnings: [
|
|
27
|
+
"Intense rounds can, in rare cases, cause loss of consciousness.",
|
|
28
|
+
"Never practice in or near water, while driving, or anywhere fainting could cause injury.",
|
|
29
|
+
],
|
|
30
|
+
stopCriteria: STANDARD_SAFETY.stopCriteria,
|
|
31
|
+
emergency: STANDARD_SAFETY.emergency,
|
|
32
|
+
};
|
|
7
33
|
export const TECHNIQUES = [
|
|
8
34
|
{
|
|
9
35
|
id: "box-breathing",
|
|
10
36
|
name: "Box Breathing",
|
|
11
|
-
|
|
37
|
+
purpose: "Calm focus",
|
|
38
|
+
description: "Breathe in for 4 seconds, hold for 4 seconds, breathe out for 4 seconds, then hold for 4 seconds.",
|
|
39
|
+
difficulty: "Beginner",
|
|
40
|
+
// RCT evidence: https://doi.org/10.1016/j.xcrm.2022.100895
|
|
41
|
+
possibleBenefit: "Regular practice may support a more positive mood.",
|
|
42
|
+
safety: STANDARD_SAFETY,
|
|
12
43
|
inhaleSeconds: 4,
|
|
13
44
|
holdInSeconds: 4,
|
|
14
45
|
exhaleSeconds: 4,
|
|
@@ -18,7 +49,10 @@ export const TECHNIQUES = [
|
|
|
18
49
|
{
|
|
19
50
|
id: "4-7-8",
|
|
20
51
|
name: "4-7-8 Breathing",
|
|
21
|
-
|
|
52
|
+
purpose: "Wind down",
|
|
53
|
+
description: "Breathe in for 4 seconds, hold for 7 seconds, then breathe out slowly for 8 seconds.",
|
|
54
|
+
difficulty: "Intermediate",
|
|
55
|
+
safety: STANDARD_SAFETY,
|
|
22
56
|
inhaleSeconds: 4,
|
|
23
57
|
holdInSeconds: 7,
|
|
24
58
|
exhaleSeconds: 8,
|
|
@@ -27,7 +61,10 @@ export const TECHNIQUES = [
|
|
|
27
61
|
{
|
|
28
62
|
id: "coherent",
|
|
29
63
|
name: "Coherent Breathing",
|
|
30
|
-
|
|
64
|
+
purpose: "Steady calm",
|
|
65
|
+
description: "Breathe in for 6 seconds and out for 6 seconds, creating an even rhythm of about 5 breaths per minute.",
|
|
66
|
+
difficulty: "Beginner",
|
|
67
|
+
safety: STANDARD_SAFETY,
|
|
31
68
|
inhaleSeconds: 6,
|
|
32
69
|
exhaleSeconds: 6,
|
|
33
70
|
defaultRounds: 10,
|
|
@@ -35,7 +72,12 @@ export const TECHNIQUES = [
|
|
|
35
72
|
{
|
|
36
73
|
id: "physiological-sigh",
|
|
37
74
|
name: "Physiological Sigh",
|
|
38
|
-
|
|
75
|
+
purpose: "Quick reset",
|
|
76
|
+
description: "Take two small inhales through the nose, followed by one longer exhale.",
|
|
77
|
+
difficulty: "Beginner",
|
|
78
|
+
// RCT evidence: https://doi.org/10.1016/j.xcrm.2022.100895
|
|
79
|
+
possibleBenefit: "Regular practice may support a more positive mood and slower resting breathing.",
|
|
80
|
+
safety: STANDARD_SAFETY,
|
|
39
81
|
inhaleSeconds: 3,
|
|
40
82
|
holdInSeconds: 1,
|
|
41
83
|
exhaleSeconds: 6,
|
|
@@ -43,8 +85,11 @@ export const TECHNIQUES = [
|
|
|
43
85
|
},
|
|
44
86
|
{
|
|
45
87
|
id: "wim-hof",
|
|
46
|
-
name: "
|
|
47
|
-
|
|
88
|
+
name: "Power Breathing",
|
|
89
|
+
purpose: "Energizing practice",
|
|
90
|
+
description: "Take 30 rounds of active 2-second inhales followed by 2-second exhales.",
|
|
91
|
+
difficulty: "Advanced",
|
|
92
|
+
safety: POWER_BREATHING_SAFETY,
|
|
48
93
|
inhaleSeconds: 2,
|
|
49
94
|
exhaleSeconds: 2,
|
|
50
95
|
defaultRounds: 30,
|
|
@@ -54,6 +99,15 @@ export const TECHNIQUES = [
|
|
|
54
99
|
export function getTechniqueById(id) {
|
|
55
100
|
return TECHNIQUES.find((t) => t.id === id);
|
|
56
101
|
}
|
|
102
|
+
const LEGACY_TECHNIQUE_LABELS = {
|
|
103
|
+
resonance: "Resonant Breathing",
|
|
104
|
+
};
|
|
105
|
+
/** Return a human-readable label without exposing a stored technique identifier. */
|
|
106
|
+
export function getBreathworkTechniqueLabel(techniqueId) {
|
|
107
|
+
return (getTechniqueById(techniqueId)?.name ??
|
|
108
|
+
LEGACY_TECHNIQUE_LABELS[techniqueId] ??
|
|
109
|
+
"Breathwork session");
|
|
110
|
+
}
|
|
57
111
|
/** Compute total session duration in seconds for a given number of rounds */
|
|
58
112
|
export function totalSessionSeconds(technique, rounds) {
|
|
59
113
|
const roundSeconds = technique.inhaleSeconds +
|
|
@@ -62,4 +116,11 @@ export function totalSessionSeconds(technique, rounds) {
|
|
|
62
116
|
(technique.holdOutSeconds ?? 0);
|
|
63
117
|
return roundSeconds * rounds;
|
|
64
118
|
}
|
|
119
|
+
/** Add the server-owned default-session duration to a technique definition. */
|
|
120
|
+
export function toBreathworkTechniqueDetails(technique) {
|
|
121
|
+
return {
|
|
122
|
+
...technique,
|
|
123
|
+
durationSeconds: totalSessionSeconds(technique, technique.defaultRounds),
|
|
124
|
+
};
|
|
125
|
+
}
|
|
65
126
|
//# sourceMappingURL=breathwork.js.map
|
package/dist/breathwork.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"breathwork.js","sourceRoot":"","sources":["../src/breathwork.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"breathwork.js","sourceRoot":"","sources":["../src/breathwork.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA0BH,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,UAAU,CAAU,CAAC;AAezF,MAAM,CAAC,MAAM,4BAA4B,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAU,CAAC;AAUjF;;;;GAIG;AACH,MAAM,eAAe,GAA6B;IAChD,QAAQ,EAAE,6DAA6D;IACvE,QAAQ,EAAE,CAAC,qCAAqC,CAAC;IACjD,YAAY,EAAE,uEAAuE;IACrF,SAAS,EACP,8HAA8H;CACjI,CAAC;AAEF;;;GAGG;AACH,MAAM,sBAAsB,GAA6B;IACvD,QAAQ,EAAE,2DAA2D;IACrE,QAAQ,EAAE;QACR,iEAAiE;QACjE,0FAA0F;KAC3F;IACD,YAAY,EAAE,eAAe,CAAC,YAAY;IAC1C,SAAS,EAAE,eAAe,CAAC,SAAS;CACrC,CAAC;AAEF,MAAM,CAAC,MAAM,UAAU,GAA0B;IAC/C;QACE,EAAE,EAAE,eAAe;QACnB,IAAI,EAAE,eAAe;QACrB,OAAO,EAAE,YAAY;QACrB,WAAW,EACT,mGAAmG;QACrG,UAAU,EAAE,UAAU;QACtB,2DAA2D;QAC3D,eAAe,EAAE,oDAAoD;QACrE,MAAM,EAAE,eAAe;QACvB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,CAAC;QAChB,aAAa,EAAE,CAAC;QAChB,cAAc,EAAE,CAAC;QACjB,aAAa,EAAE,CAAC;KACjB;IACD;QACE,EAAE,E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E,oBAAoB;CAChC,CAAC;AAEF,oFAAoF;AACpF,MAAM,UAAU,2BAA2B,CAAC,WAAmB;IAC7D,OAAO,CACL,gBAAgB,CAAC,WAAW,CAAC,EAAE,IAAI;QACnC,uBAAuB,CAAC,WAAW,CAAC;QACpC,oBAAoB,CACrB,CAAC;AACJ,CAAC;AAED,6EAA6E;AAC7E,MAAM,UAAU,mBAAmB,CAAC,SAA8B,EAAE,MAAc;IAChF,MAAM,YAAY,GAChB,SAAS,CAAC,aAAa;QACvB,CAAC,SAAS,CAAC,aAAa,IAAI,CAAC,CAAC;QAC9B,SAAS,CAAC,aAAa;QACvB,CAAC,SAAS,CAAC,cAAc,IAAI,CAAC,CAAC,CAAC;IAClC,OAAO,YAAY,GAAG,MAAM,CAAC;AAC/B,CAAC;AAED,+EAA+E;AAC/E,MAAM,UAAU,4BAA4B,CAC1C,SAA8B;IAE9B,OAAO;QACL,GAAG,SAAS;QACZ,eAAe,EAAE,mBAAmB,CAAC,SAAS,EAAE,SAAS,CAAC,aAAa,CAAC;KACzE,CAAC;AACJ,CAAC"}
|
package/dist/colors.d.ts
CHANGED
|
@@ -5,6 +5,46 @@
|
|
|
5
5
|
* iOS components use these directly in React Native StyleSheets.
|
|
6
6
|
* Tailwind utility classes remain platform-specific (web only).
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Presentation colors for generic operational states on the light theme.
|
|
10
|
+
*
|
|
11
|
+
* These roles describe application state, not health or scoring meaning.
|
|
12
|
+
* Foregrounds meet WCAG 2.2 AA normal-text contrast on their paired surfaces,
|
|
13
|
+
* while borders and indicators meet the 3:1 non-text contrast target on both
|
|
14
|
+
* their paired surfaces and white cards.
|
|
15
|
+
*/
|
|
16
|
+
export declare const operationalStatusColors: {
|
|
17
|
+
readonly neutral: {
|
|
18
|
+
readonly foreground: "#334155";
|
|
19
|
+
readonly surface: "#f1f5f9";
|
|
20
|
+
readonly border: "#64748b";
|
|
21
|
+
readonly indicator: "#334155";
|
|
22
|
+
};
|
|
23
|
+
readonly info: {
|
|
24
|
+
readonly foreground: "#1e3a8a";
|
|
25
|
+
readonly surface: "#dbeafe";
|
|
26
|
+
readonly border: "#1d4ed8";
|
|
27
|
+
readonly indicator: "#1d4ed8";
|
|
28
|
+
};
|
|
29
|
+
readonly success: {
|
|
30
|
+
readonly foreground: "#14532d";
|
|
31
|
+
readonly surface: "#dcfce7";
|
|
32
|
+
readonly border: "#15803d";
|
|
33
|
+
readonly indicator: "#15803d";
|
|
34
|
+
};
|
|
35
|
+
readonly warning: {
|
|
36
|
+
readonly foreground: "#713f12";
|
|
37
|
+
readonly surface: "#fef3c7";
|
|
38
|
+
readonly border: "#a16207";
|
|
39
|
+
readonly indicator: "#a16207";
|
|
40
|
+
};
|
|
41
|
+
readonly danger: {
|
|
42
|
+
readonly foreground: "#7f1d1d";
|
|
43
|
+
readonly surface: "#fee2e2";
|
|
44
|
+
readonly border: "#b91c1c";
|
|
45
|
+
readonly indicator: "#b91c1c";
|
|
46
|
+
};
|
|
47
|
+
};
|
|
8
48
|
/** Status colors for scores, alerts, and thresholds.
|
|
9
49
|
* Darkened one shade vs originals for contrast on light sage background. */
|
|
10
50
|
export declare const statusColors: {
|
package/dist/colors.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;6EAC6E;AAC7E,eAAO,MAAM,YAAY;IACvB,0DAA0D;;IAE1D,gEAAgE;;IAEhE,oDAAoD;;IAEpD,qCAAqC;;IAErC,uDAAuD;;CAE/C,CAAC;AAEX;2DAC2D;AAC3D,eAAO,MAAM,WAAW;;;;;;;;;CASd,CAAC;AAEX,2CAA2C;AAC3C,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,4CAA4C;AAC5C,eAAO,MAAM,UAAU;;;;IAIrB,sDAAsD;;CAE9C,CAAC;AAEX;wEACwE;AACxE,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,gBAAgB;;;;;;;;CAQnB,CAAC"}
|
|
1
|
+
{"version":3,"file":"colors.d.ts","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;;;;;GAOG;AACH,eAAO,MAAM,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA+B1B,CAAC;AAEX;6EAC6E;AAC7E,eAAO,MAAM,YAAY;IACvB,0DAA0D;;IAE1D,gEAAgE;;IAEhE,oDAAoD;;IAEpD,qCAAqC;;IAErC,uDAAuD;;CAE/C,CAAC;AAEX;2DAC2D;AAC3D,eAAO,MAAM,WAAW;;;;;;;;;CASd,CAAC;AAEX,2CAA2C;AAC3C,eAAO,MAAM,aAAa;;;;;CAKhB,CAAC;AAEX,4CAA4C;AAC5C,eAAO,MAAM,UAAU;;;;IAIrB,sDAAsD;;CAE9C,CAAC;AAEX;wEACwE;AACxE,eAAO,MAAM,gBAAgB;;;;;CAKnB,CAAC;AAEX,oEAAoE;AACpE,eAAO,MAAM,oBAAoB;;;;;CAKvB,CAAC;AAEX,qEAAqE;AACrE,eAAO,MAAM,gBAAgB;;;;;;;;CAQnB,CAAC"}
|
package/dist/colors.js
CHANGED
|
@@ -5,6 +5,46 @@
|
|
|
5
5
|
* iOS components use these directly in React Native StyleSheets.
|
|
6
6
|
* Tailwind utility classes remain platform-specific (web only).
|
|
7
7
|
*/
|
|
8
|
+
/**
|
|
9
|
+
* Presentation colors for generic operational states on the light theme.
|
|
10
|
+
*
|
|
11
|
+
* These roles describe application state, not health or scoring meaning.
|
|
12
|
+
* Foregrounds meet WCAG 2.2 AA normal-text contrast on their paired surfaces,
|
|
13
|
+
* while borders and indicators meet the 3:1 non-text contrast target on both
|
|
14
|
+
* their paired surfaces and white cards.
|
|
15
|
+
*/
|
|
16
|
+
export const operationalStatusColors = {
|
|
17
|
+
neutral: {
|
|
18
|
+
foreground: "#334155",
|
|
19
|
+
surface: "#f1f5f9",
|
|
20
|
+
border: "#64748b",
|
|
21
|
+
indicator: "#334155",
|
|
22
|
+
},
|
|
23
|
+
info: {
|
|
24
|
+
foreground: "#1e3a8a",
|
|
25
|
+
surface: "#dbeafe",
|
|
26
|
+
border: "#1d4ed8",
|
|
27
|
+
indicator: "#1d4ed8",
|
|
28
|
+
},
|
|
29
|
+
success: {
|
|
30
|
+
foreground: "#14532d",
|
|
31
|
+
surface: "#dcfce7",
|
|
32
|
+
border: "#15803d",
|
|
33
|
+
indicator: "#15803d",
|
|
34
|
+
},
|
|
35
|
+
warning: {
|
|
36
|
+
foreground: "#713f12",
|
|
37
|
+
surface: "#fef3c7",
|
|
38
|
+
border: "#a16207",
|
|
39
|
+
indicator: "#a16207",
|
|
40
|
+
},
|
|
41
|
+
danger: {
|
|
42
|
+
foreground: "#7f1d1d",
|
|
43
|
+
surface: "#fee2e2",
|
|
44
|
+
border: "#b91c1c",
|
|
45
|
+
indicator: "#b91c1c",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
8
48
|
/** Status colors for scores, alerts, and thresholds.
|
|
9
49
|
* Darkened one shade vs originals for contrast on light sage background. */
|
|
10
50
|
export const statusColors = {
|
package/dist/colors.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"colors.js","sourceRoot":"","sources":["../src/colors.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;6EAC6E;AAC7E,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,0DAA0D;IAC1D,QAAQ,EAAE,SAAS;IACnB,gEAAgE;IAChE,OAAO,EAAE,SAAS;IAClB,oDAAoD;IACpD,MAAM,EAAE,SAAS;IACjB,qCAAqC;IACrC,IAAI,EAAE,SAAS;IACf,uDAAuD;IACvD,QAAQ,EAAE,SAAS;CACX,CAAC;AAEX;2DAC2D;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,EAAE,SAAS;IACrB,OAAO,EAAE,SAAS;IAClB,gBAAgB,EAAE,SAAS;IAC3B,MAAM,EAAE,SAAS;CACT,CAAC;AAEX,4CAA4C;AAC5C,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,OAAO,EAAE,SAAS;IAClB,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,SAAS;IACnB,sDAAsD;IACtD,OAAO,EAAE,SAAS;CACV,CAAC;AAEX;wEACwE;AACxE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,IAAI,EAAE,SAAS;IACf,GAAG,EAAE,SAAS;IACd,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;CACR,CAAC;AAEX,oEAAoE;AACpE,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAClC,SAAS,EAAE,SAAS;IACpB,KAAK,EAAE,SAAS;IAChB,KAAK,EAAE,SAAS;IAChB,OAAO,EAAE,SAAS;CACV,CAAC;AAEX,qEAAqE;AACrE,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,0BAA0B;IACpC,QAAQ,EAAE,0BAA0B;IACpC,SAAS,EAAE,SAAS;IACpB,iBAAiB,EAAE,SAAS;IAC5B,aAAa,EAAE,yBAAyB;IACxC,WAAW,EAAE,SAAS;IACtB,UAAU,EAAE,SAAS;CACb,CAAC"}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export declare const EPISTEMIC_STATUS_KINDS: readonly ["observed", "estimated", "associated", "suggested", "unavailable"];
|
|
2
|
+
export type EpistemicStatusKind = (typeof EPISTEMIC_STATUS_KINDS)[number];
|
|
3
|
+
export type EpistemicStatus = {
|
|
4
|
+
[K in EpistemicStatusKind]: {
|
|
5
|
+
kind: K;
|
|
6
|
+
label: Capitalize<K>;
|
|
7
|
+
};
|
|
8
|
+
}[EpistemicStatusKind];
|
|
9
|
+
export declare const EPISTEMIC_STATUS: {
|
|
10
|
+
readonly observed: {
|
|
11
|
+
readonly kind: "observed";
|
|
12
|
+
readonly label: "Observed";
|
|
13
|
+
};
|
|
14
|
+
readonly estimated: {
|
|
15
|
+
readonly kind: "estimated";
|
|
16
|
+
readonly label: "Estimated";
|
|
17
|
+
};
|
|
18
|
+
readonly associated: {
|
|
19
|
+
readonly kind: "associated";
|
|
20
|
+
readonly label: "Associated";
|
|
21
|
+
};
|
|
22
|
+
readonly suggested: {
|
|
23
|
+
readonly kind: "suggested";
|
|
24
|
+
readonly label: "Suggested";
|
|
25
|
+
};
|
|
26
|
+
readonly unavailable: {
|
|
27
|
+
readonly kind: "unavailable";
|
|
28
|
+
readonly label: "Unavailable";
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
export declare function getEpistemicStatus<K extends EpistemicStatusKind>(kind: K): (typeof EPISTEMIC_STATUS)[K];
|
|
32
|
+
//# sourceMappingURL=epistemic-status.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epistemic-status.d.ts","sourceRoot":"","sources":["../src/epistemic-status.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,sBAAsB,8EAMzB,CAAC;AAEX,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,sBAAsB,CAAC,CAAC,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,eAAe,GAAG;KAC3B,CAAC,IAAI,mBAAmB,GAAG;QAAE,IAAI,EAAE,CAAC,CAAC;QAAC,KAAK,EAAE,UAAU,CAAC,CAAC,CAAC,CAAA;KAAE;CAC9D,CAAC,mBAAmB,CAAC,CAAC;AAEvB,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;CAMoC,CAAC;AAElE,wBAAgB,kBAAkB,CAAC,CAAC,SAAS,mBAAmB,EAC9D,IAAI,EAAE,CAAC,GACN,CAAC,OAAO,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAE9B"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export const EPISTEMIC_STATUS_KINDS = [
|
|
2
|
+
"observed",
|
|
3
|
+
"estimated",
|
|
4
|
+
"associated",
|
|
5
|
+
"suggested",
|
|
6
|
+
"unavailable",
|
|
7
|
+
];
|
|
8
|
+
export const EPISTEMIC_STATUS = {
|
|
9
|
+
observed: { kind: "observed", label: "Observed" },
|
|
10
|
+
estimated: { kind: "estimated", label: "Estimated" },
|
|
11
|
+
associated: { kind: "associated", label: "Associated" },
|
|
12
|
+
suggested: { kind: "suggested", label: "Suggested" },
|
|
13
|
+
unavailable: { kind: "unavailable", label: "Unavailable" },
|
|
14
|
+
};
|
|
15
|
+
export function getEpistemicStatus(kind) {
|
|
16
|
+
return EPISTEMIC_STATUS[kind];
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=epistemic-status.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"epistemic-status.js","sourceRoot":"","sources":["../src/epistemic-status.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,sBAAsB,GAAG;IACpC,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,aAAa;CACL,CAAC;AAQX,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,QAAQ,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,KAAK,EAAE,UAAU,EAAE;IACjD,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACpD,UAAU,EAAE,EAAE,IAAI,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,EAAE;IACvD,SAAS,EAAE,EAAE,IAAI,EAAE,WAAW,EAAE,KAAK,EAAE,WAAW,EAAE;IACpD,WAAW,EAAE,EAAE,IAAI,EAAE,aAAa,EAAE,KAAK,EAAE,aAAa,EAAE;CACK,CAAC;AAElE,MAAM,UAAU,kBAAkB,CAChC,IAAO;IAEP,OAAO,gBAAgB,CAAC,IAAI,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -10,6 +10,7 @@
|
|
|
10
10
|
* Ovulation is estimated at cycleLength - 14 (luteal phase is ~14 days).
|
|
11
11
|
*/
|
|
12
12
|
export type CyclePhase = "menstrual" | "follicular" | "ovulatory" | "luteal";
|
|
13
|
+
export declare const CYCLE_TRACKING_SAFETY_NOTICE = "Tracking estimates only. Do not use for birth control or diagnosis.";
|
|
13
14
|
/**
|
|
14
15
|
* Compute the cycle phase for a given day within a cycle.
|
|
15
16
|
* @param dayOfCycle 1-based day number within the cycle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menstrual-cycle.d.ts","sourceRoot":"","sources":["../src/menstrual-cycle.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7E;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAqBhF;AAED,4CAA4C;AAC5C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAK9E,CAAC"}
|
|
1
|
+
{"version":3,"file":"menstrual-cycle.d.ts","sourceRoot":"","sources":["../src/menstrual-cycle.ts"],"names":[],"mappings":"AAEA;;;;;;;;;;GAUG;AAEH,MAAM,MAAM,UAAU,GAAG,WAAW,GAAG,YAAY,GAAG,WAAW,GAAG,QAAQ,CAAC;AAE7E,eAAO,MAAM,4BAA4B,wEAC8B,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,YAAY,CAAC,UAAU,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,UAAU,CAqBhF;AAED,4CAA4C;AAC5C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,UAAU,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAK9E,CAAC"}
|
package/dist/menstrual-cycle.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { chartColors, statusColors } from "./colors.js";
|
|
2
|
+
export const CYCLE_TRACKING_SAFETY_NOTICE = "Tracking estimates only. Do not use for birth control or diagnosis.";
|
|
2
3
|
/**
|
|
3
4
|
* Compute the cycle phase for a given day within a cycle.
|
|
4
5
|
* @param dayOfCycle 1-based day number within the cycle
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"menstrual-cycle.js","sourceRoot":"","sources":["../src/menstrual-cycle.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAgBxD;;;;GAIG;AACH,MAAM,UAAU,YAAY,CAAC,UAAkB,EAAE,WAAmB;IAClE,gCAAgC;IAChC,IAAI,UAAU,IAAI,CAAC,EAAE,CAAC;QACpB,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,wEAAwE;IACxE,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,WAAW,GAAG,EAAE,CAAC,CAAC;IAEnD,sCAAsC;IACtC,IAAI,UAAU,IAAI,YAAY,GAAG,CAAC,IAAI,UAAU,IAAI,YAAY,GAAG,CAAC,EAAE,CAAC;QACrE,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,8CAA8C;IAC9C,IAAI,UAAU,GAAG,YAAY,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,YAAY,CAAC;IACtB,CAAC;IAED,iCAAiC;IACjC,OAAO,QAAQ,CAAC;AAClB,CAAC;AAED,4CAA4C;AAC5C,MAAM,CAAC,MAAM,aAAa,GAAyD;IACjF,SAAS,EAAE,EAAE,KAAK,EAAE,WAAW,EAAE,KAAK,EAAE,YAAY,CAAC,MAAM,EAAE;IAC7D,UAAU,EAAE,EAAE,KAAK,EAAE,YAAY,EAAE,KAAK,EAAE,YAAY,CAAC,IAAI,EAAE;IAC7D,SAAS,EAAE,EAAE,KAAK,E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,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,WAAW,CAAC,KAAK,EAAE;CACtD,CAAC"}
|
package/dist/scoring.d.ts
CHANGED
|
@@ -33,20 +33,6 @@ export declare function scoreColor(score: number): string;
|
|
|
33
33
|
export declare function scoreLabel(score: number): string;
|
|
34
34
|
/** Get a contextual description for a recovery score explaining what it means */
|
|
35
35
|
export declare function scoreDescription(score: number): string;
|
|
36
|
-
/** Strain zone classification with display properties. */
|
|
37
|
-
export declare class StrainZone {
|
|
38
|
-
readonly zone: string;
|
|
39
|
-
constructor(zone: string);
|
|
40
|
-
get color(): string;
|
|
41
|
-
get label(): string;
|
|
42
|
-
}
|
|
43
|
-
/** Workload ratio (ACWR) with display classification. */
|
|
44
|
-
export declare class WorkloadRatio {
|
|
45
|
-
readonly value: number | null;
|
|
46
|
-
constructor(value: number | null);
|
|
47
|
-
get color(): string;
|
|
48
|
-
get hint(): string | null;
|
|
49
|
-
}
|
|
50
36
|
export interface WeekSummary {
|
|
51
37
|
week: string;
|
|
52
38
|
hours: number;
|
|
@@ -83,6 +69,20 @@ export declare function rampRateColor(rate: number): string;
|
|
|
83
69
|
* Uses separate scales for positive/negative z to handle the asymmetric center.
|
|
84
70
|
*/
|
|
85
71
|
export declare function zScoreToRecoveryScore(zScore: number): number;
|
|
72
|
+
export declare const DEFAULT_READINESS_COMPONENT_SCORE = 62;
|
|
73
|
+
export interface BaselineReadinessInputs {
|
|
74
|
+
hrvZScore: number | null;
|
|
75
|
+
respiratoryRateZScore: number | null;
|
|
76
|
+
restingHeartRateZScore: number | null;
|
|
77
|
+
sleepEfficiency: number | null;
|
|
78
|
+
}
|
|
79
|
+
export interface BaselineReadinessComponents {
|
|
80
|
+
hrvScore: number;
|
|
81
|
+
respiratoryRateScore: number;
|
|
82
|
+
restingHrScore: number;
|
|
83
|
+
sleepScore: number;
|
|
84
|
+
}
|
|
85
|
+
export declare function baselineReadinessComponents(inputs: BaselineReadinessInputs): BaselineReadinessComponents;
|
|
86
86
|
/** Get the color for a sleep performance tier */
|
|
87
87
|
export declare function sleepTierColor(tier: "Excellent" | "Good" | "Fair" | "Poor"): string;
|
|
88
88
|
/** Get a contextual description for a sleep performance tier */
|
package/dist/scoring.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoring.d.ts","sourceRoot":"","sources":["../src/scoring.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,qBAAa,WAAW;;IAKtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBACX,KAAK,EAAE,MAAM;IAIzB,IAAI,KAAK,IAAI,MAAM,CAKlB;IAED,IAAI,KAAK,IAAI,MAAM,CAKlB;IAED,IAAI,WAAW,IAAI,MAAM,CAKxB;IAED,MAAM,CAAC,WAAW,CAAC,OAAO,EAAE,MAAM,GAAG,WAAW;IAOhD,MAAM,CAAC,qBAAqB,CAAC,iBAAiB,EAAE,MAAM,GAAG,WAAW;IAIpE,MAAM,CAAC,aAAa,CAAC,SAAS,EAAE,MAAM,GAAG,WAAW;CAGrD;AAED,2DAA2D;AAC3D,eAAO,MAAM,uBAAuB,KAAK,CAAC;AAC1C,eAAO,MAAM,yBAAyB,KAAK,CAAC;AAE5C,MAAM,WAAW,SAAS;IACxB,8BAA8B;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,2CAA2C;IAC3C,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,EAAE,QAAQ,GAAG,SAAS,GAAG,UAAU,CAAC;CAC3C;AAED,sFAAsF;AACtF,eAAO,MAAM,WAAW,EAAE,SAAS,EAIlC,CAAC;AAEF,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,8DAA8D;AAC9D,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAIhD;AAED,iFAAiF;AACjF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAMtD;AAED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AE,MAAM,CAAC;IAC7B,cAAc,EAAE,MAAM,CAAC;IACvB,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,uBAAuB,GAC9B,2BAA2B,CAmB7B;AAED,iDAAiD;AACjD,wBAAgB,cAAc,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAKnF;AAED,gEAAgE;AAChE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAKzF;AAED,8CAA8C;AAC9C,wBAAgB,cAAc,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAItD;AAED,0EAA0E;AAC1E,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAIhE;AAED,oDAAoD;AACpD,eAAO,MAAM,oBAAoB,KAAK,CAAC;AACvC,eAAO,MAAM,eAAe,IAAI,CAAC;AACjC,eAAO,MAAM,cAAc,MAAM,CAAC;AAClC,eAAO,MAAM,iBAAiB,MAAM,CAAC;AAErC,sDAAsD;AACtD,eAAO,MAAM,gBAAgB;;;;;;CAMnB,CAAC;AAEX,kFAAkF;AAClF,qBAAa,QAAQ;IACnB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;gBACX,KAAK,EAAE,MAAM;IAIzB,IAAI,KAAK,IAAI,MAAM,CAMlB;IAED,IAAI,KAAK,IAAI,MAAM,CAMlB;CACF"}
|
package/dist/scoring.js
CHANGED
|
@@ -87,58 +87,6 @@ export function scoreDescription(score) {
|
|
|
87
87
|
return "Your body is at a moderate recovery level. Steady effort is recommended.";
|
|
88
88
|
return "Recovery is low. Focus on rest and keep today's effort light.";
|
|
89
89
|
}
|
|
90
|
-
/** Strain zone classification with display properties. */
|
|
91
|
-
export class StrainZone {
|
|
92
|
-
zone;
|
|
93
|
-
constructor(zone) {
|
|
94
|
-
this.zone = zone;
|
|
95
|
-
}
|
|
96
|
-
get color() {
|
|
97
|
-
if (this.zone === "optimal")
|
|
98
|
-
return statusColors.positive;
|
|
99
|
-
if (this.zone === "overreaching")
|
|
100
|
-
return statusColors.danger;
|
|
101
|
-
if (this.zone === "restoring")
|
|
102
|
-
return statusColors.info;
|
|
103
|
-
return textColors.secondary;
|
|
104
|
-
}
|
|
105
|
-
get label() {
|
|
106
|
-
if (this.zone === "optimal")
|
|
107
|
-
return "Optimal";
|
|
108
|
-
if (this.zone === "overreaching")
|
|
109
|
-
return "Overreaching";
|
|
110
|
-
if (this.zone === "restoring")
|
|
111
|
-
return "Restoring";
|
|
112
|
-
return this.zone;
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
/** Workload ratio (ACWR) with display classification. */
|
|
116
|
-
export class WorkloadRatio {
|
|
117
|
-
value;
|
|
118
|
-
constructor(value) {
|
|
119
|
-
this.value = value;
|
|
120
|
-
}
|
|
121
|
-
get color() {
|
|
122
|
-
if (this.value == null)
|
|
123
|
-
return textColors.secondary;
|
|
124
|
-
if (this.value >= 0.8 && this.value <= 1.3)
|
|
125
|
-
return statusColors.positive;
|
|
126
|
-
if (this.value >= 0.5 && this.value <= 1.5)
|
|
127
|
-
return statusColors.warning;
|
|
128
|
-
return statusColors.danger;
|
|
129
|
-
}
|
|
130
|
-
get hint() {
|
|
131
|
-
if (this.value == null)
|
|
132
|
-
return null;
|
|
133
|
-
if (this.value >= 0.8 && this.value <= 1.3)
|
|
134
|
-
return "Optimal training zone";
|
|
135
|
-
if (this.value < 0.8)
|
|
136
|
-
return "Detraining risk - increase load gradually";
|
|
137
|
-
if (this.value <= 1.5)
|
|
138
|
-
return "High load - monitor recovery closely";
|
|
139
|
-
return "Injury risk zone - consider rest";
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
90
|
/** Aggregate weekly volume rows into a summary with relative fractions */
|
|
143
91
|
export function aggregateWeeklyVolume(rows) {
|
|
144
92
|
const weekMap = new Map();
|
|
@@ -244,6 +192,23 @@ export function zScoreToRecoveryScore(zScore) {
|
|
|
244
192
|
: center - scaleDown * ((0.5 - sigmoid) / 0.5);
|
|
245
193
|
return Math.max(0, Math.min(100, Math.round(score)));
|
|
246
194
|
}
|
|
195
|
+
export const DEFAULT_READINESS_COMPONENT_SCORE = 62;
|
|
196
|
+
export function baselineReadinessComponents(inputs) {
|
|
197
|
+
return {
|
|
198
|
+
hrvScore: inputs.hrvZScore == null
|
|
199
|
+
? DEFAULT_READINESS_COMPONENT_SCORE
|
|
200
|
+
: zScoreToRecoveryScore(inputs.hrvZScore),
|
|
201
|
+
restingHrScore: inputs.restingHeartRateZScore == null
|
|
202
|
+
? DEFAULT_READINESS_COMPONENT_SCORE
|
|
203
|
+
: zScoreToRecoveryScore(-inputs.restingHeartRateZScore),
|
|
204
|
+
sleepScore: inputs.sleepEfficiency == null
|
|
205
|
+
? DEFAULT_READINESS_COMPONENT_SCORE
|
|
206
|
+
: Math.max(0, Math.min(100, Math.round(inputs.sleepEfficiency))),
|
|
207
|
+
respiratoryRateScore: inputs.respiratoryRateZScore == null
|
|
208
|
+
? DEFAULT_READINESS_COMPONENT_SCORE
|
|
209
|
+
: zScoreToRecoveryScore(-inputs.respiratoryRateZScore),
|
|
210
|
+
};
|
|
211
|
+
}
|
|
247
212
|
/** Get the color for a sleep performance tier */
|
|
248
213
|
export function sleepTierColor(tier) {
|
|
249
214
|
if (tier === "Excellent")
|
package/dist/scoring.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scoring.js","sourceRoot":"","sources":["../src/scoring.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IACtB,MAAM,CAAU,aAAa,GAAG,KAAK,CAAC;IACtC,MAAM,CAAU,IAAI,GAAG,EAAE,CAAC;IAC1B,MAAM,CAAU,gBAAgB,GAAG,CAAC,CAAC;IA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AAK,GAAG,cAAc;YAAE,OAAO,WAAW,CAAC;QACpD,IAAI,IAAI,CAAC,KAAK,GAAG,iBAAiB;YAAE,OAAO,SAAS,CAAC;QACrD,OAAO,WAAW,CAAC;IACrB,CAAC;CACF"}
|
package/dist/strain-target.d.ts
CHANGED
|
@@ -7,12 +7,11 @@ export interface StrainTargetResult {
|
|
|
7
7
|
explanation: string;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* Compute a daily strain target based on readiness
|
|
10
|
+
* Compute a daily strain target based on readiness.
|
|
11
11
|
*
|
|
12
12
|
* - High readiness (70+): target 14-18, Push zone
|
|
13
13
|
* - Moderate readiness (50-69): target 10-14, Maintain zone
|
|
14
14
|
* - Low readiness (<50): target 4-10, Recovery zone
|
|
15
|
-
* - If ACWR (acute/chronic) > 1.3, caps the target to prevent injury
|
|
16
15
|
*/
|
|
17
|
-
export declare function computeStrainTarget(readinessScore: number
|
|
16
|
+
export declare function computeStrainTarget(readinessScore: number): StrainTargetResult;
|
|
18
17
|
//# sourceMappingURL=strain-target.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strain-target.d.ts","sourceRoot":"","sources":["../src/strain-target.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACvC,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED
|
|
1
|
+
{"version":3,"file":"strain-target.d.ts","sourceRoot":"","sources":["../src/strain-target.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,kBAAkB;IACjC,yDAAyD;IACzD,YAAY,EAAE,MAAM,CAAC;IACrB,iBAAiB;IACjB,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;IACvC,iCAAiC;IACjC,WAAW,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,cAAc,EAAE,MAAM,GAAG,kBAAkB,CA0C9E"}
|
package/dist/strain-target.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Compute a daily strain target based on readiness
|
|
2
|
+
* Compute a daily strain target based on readiness.
|
|
3
3
|
*
|
|
4
4
|
* - High readiness (70+): target 14-18, Push zone
|
|
5
5
|
* - Moderate readiness (50-69): target 10-14, Maintain zone
|
|
6
6
|
* - Low readiness (<50): target 4-10, Recovery zone
|
|
7
|
-
* - If ACWR (acute/chronic) > 1.3, caps the target to prevent injury
|
|
8
7
|
*/
|
|
9
|
-
export function computeStrainTarget(readinessScore
|
|
8
|
+
export function computeStrainTarget(readinessScore) {
|
|
10
9
|
let zone;
|
|
11
10
|
let minStrain;
|
|
12
11
|
let maxStrain;
|
|
@@ -29,19 +28,9 @@ export function computeStrainTarget(readinessScore, chronicLoad, acuteLoad) {
|
|
|
29
28
|
const zoneReadinessMin = zone === "Push" ? 70 : zone === "Maintain" ? 50 : 0;
|
|
30
29
|
const zoneReadinessMax = zone === "Push" ? 100 : zone === "Maintain" ? 69 : 49;
|
|
31
30
|
const fraction = Math.min(1, Math.max(0, (readinessScore - zoneReadinessMin) / (zoneReadinessMax - zoneReadinessMin)));
|
|
32
|
-
|
|
33
|
-
// Cap if ACWR is too high (injury risk)
|
|
31
|
+
const targetStrain = minStrain + fraction * (maxStrain - minStrain);
|
|
34
32
|
let explanation;
|
|
35
|
-
|
|
36
|
-
if (acwr > 1.3 && chronicLoad > 0) {
|
|
37
|
-
const cappedTarget = Math.min(targetStrain, 12);
|
|
38
|
-
if (cappedTarget < targetStrain) {
|
|
39
|
-
targetStrain = cappedTarget;
|
|
40
|
-
zone = targetStrain < 10 ? "Recovery" : "Maintain";
|
|
41
|
-
}
|
|
42
|
-
explanation = `Your acute:chronic workload ratio (${acwr.toFixed(2)}) is elevated. Strain target capped to reduce injury risk.`;
|
|
43
|
-
}
|
|
44
|
-
else if (zone === "Push") {
|
|
33
|
+
if (zone === "Push") {
|
|
45
34
|
explanation = `Recovery is strong (${readinessScore}). Push for a high-strain day to build fitness.`;
|
|
46
35
|
}
|
|
47
36
|
else if (zone === "Maintain") {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"strain-target.js","sourceRoot":"","sources":["../src/strain-target.ts"],"names":[],"mappings":"AASA
|
|
1
|
+
{"version":3,"file":"strain-target.js","sourceRoot":"","sources":["../src/strain-target.ts"],"names":[],"mappings":"AASA;;;;;;GAMG;AACH,MAAM,UAAU,mBAAmB,CAAC,cAAsB;IACxD,IAAI,IAAgC,CAAC;IACrC,IAAI,SAAiB,CAAC;IACtB,IAAI,SAAiB,CAAC;IAEtB,IAAI,cAAc,IAAI,EAAE,EAAE,CAAC;QACzB,IAAI,GAAG,MAAM,CAAC;QACd,SAAS,GAAG,EAAE,CAAC;QACf,SAAS,GAAG,EAAE,CAAC;IACjB,CAAC;SAAM,IAAI,cAAc,IAAI,EAAE,EAAE,CAAC;QAChC,IAAI,GAAG,UAAU,CAAC;QAClB,SAAS,GAAG,EAAE,CAAC;QACf,SAAS,GAAG,EAAE,CAAC;IACjB,CAAC;SAAM,CAAC;QACN,IAAI,GAAG,UAAU,CAAC;QAClB,SAAS,GAAG,CAAC,CAAC;QACd,SAAS,GAAG,EAAE,CAAC;IACjB,CAAC;IAED,iDAAiD;IACjD,MAAM,gBAAgB,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC;IAC7E,MAAM,gBAAgB,GAAG,IAAI,KAAK,MAAM,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;IAC/E,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CACvB,CAAC,EACD,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,cAAc,GAAG,gBAAgB,CAAC,GAAG,CAAC,gBAAgB,GAAG,gBAAgB,CAAC,CAAC,CACzF,CAAC;IACF,MAAM,YAAY,GAAG,SAAS,GAAG,QAAQ,GAAG,CAAC,SAAS,GAAG,SAAS,CAAC,CAAC;IAEpE,IAAI,WAAmB,CAAC;IACxB,IAAI,IAAI,KAAK,MAAM,EAAE,CAAC;QACpB,WAAW,GAAG,uBAAuB,cAAc,iDAAiD,CAAC;IACvG,CAAC;SAAM,IAAI,IAAI,KAAK,UAAU,EAAE,CAAC;QAC/B,WAAW,GAAG,sBAAsB,cAAc,mCAAmC,CAAC;IACxF,CAAC;SAAM,CAAC;QACN,WAAW,GAAG,oBAAoB,cAAc,4CAA4C,CAAC;IAC/F,CAAC;IAED,OAAO;QACL,YAAY,EAAE,IAAI,CAAC,KAAK,CAAC,YAAY,GAAG,EAAE,CAAC,GAAG,EAAE;QAChD,IAAI;QACJ,WAAW;KACZ,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { type EpistemicStatus } from "./epistemic-status.ts";
|
|
2
|
+
export type TodayPlanConfidence = "high" | "moderate" | "low";
|
|
3
|
+
export type TodayPlanZone = "Push" | "Maintain" | "Recovery";
|
|
4
|
+
export type TodayPlanSleepTier = "Excellent" | "Good" | "Fair" | "Poor";
|
|
5
|
+
export interface TodayPlanSupportingFact {
|
|
6
|
+
label: string;
|
|
7
|
+
value: string;
|
|
8
|
+
}
|
|
9
|
+
export interface TodayPlanAction {
|
|
10
|
+
id: "strain_target";
|
|
11
|
+
title: string;
|
|
12
|
+
summary: string;
|
|
13
|
+
zone: TodayPlanZone;
|
|
14
|
+
}
|
|
15
|
+
export interface TodayPlanFreshness {
|
|
16
|
+
recoveryDate: string | null;
|
|
17
|
+
sleepDate: string | null;
|
|
18
|
+
}
|
|
19
|
+
export interface TodayPlanStrainTargetInput {
|
|
20
|
+
targetStrain: number;
|
|
21
|
+
zone: TodayPlanZone;
|
|
22
|
+
explanation: string;
|
|
23
|
+
readinessScore: number;
|
|
24
|
+
workloadRatio: number | null;
|
|
25
|
+
}
|
|
26
|
+
export interface BuildTodayPlanInput {
|
|
27
|
+
endDate: string;
|
|
28
|
+
strainTarget: TodayPlanStrainTargetInput | null;
|
|
29
|
+
sleepPerformanceScore: number | null;
|
|
30
|
+
sleepPerformanceTier: TodayPlanSleepTier | null;
|
|
31
|
+
recoveryDate: string | null;
|
|
32
|
+
sleepDate: string | null;
|
|
33
|
+
}
|
|
34
|
+
export type TodayPlanResult = {
|
|
35
|
+
status: "ready";
|
|
36
|
+
epistemicStatus: EpistemicStatus;
|
|
37
|
+
date: string;
|
|
38
|
+
action: TodayPlanAction;
|
|
39
|
+
supportingFacts: [TodayPlanSupportingFact, TodayPlanSupportingFact];
|
|
40
|
+
/** Server-authored limitations that qualify the action's observations. */
|
|
41
|
+
caveats: string[];
|
|
42
|
+
confidence: TodayPlanConfidence;
|
|
43
|
+
freshness: TodayPlanFreshness;
|
|
44
|
+
missingInputs: string[];
|
|
45
|
+
message?: undefined;
|
|
46
|
+
} | {
|
|
47
|
+
status: "insufficient_data";
|
|
48
|
+
epistemicStatus: EpistemicStatus;
|
|
49
|
+
date: string;
|
|
50
|
+
action: null;
|
|
51
|
+
supportingFacts: [];
|
|
52
|
+
confidence: "low";
|
|
53
|
+
freshness: TodayPlanFreshness;
|
|
54
|
+
missingInputs: string[];
|
|
55
|
+
message: string;
|
|
56
|
+
};
|
|
57
|
+
/**
|
|
58
|
+
* Build a deterministic Today Plan from already-computed recovery/strain inputs.
|
|
59
|
+
* Clients must render this payload and must not recompute health meaning.
|
|
60
|
+
*/
|
|
61
|
+
export declare function buildTodayPlan(input: BuildTodayPlanInput): TodayPlanResult;
|
|
62
|
+
/**
|
|
63
|
+
* Shared confidence wording for web and mobile Today Plan cards.
|
|
64
|
+
*/
|
|
65
|
+
export declare function formatTodayPlanConfidence(confidence: TodayPlanConfidence): string;
|
|
66
|
+
/**
|
|
67
|
+
* Shared freshness wording for web and mobile Today Plan cards.
|
|
68
|
+
*/
|
|
69
|
+
export declare function formatTodayPlanFreshness(freshness: TodayPlanFreshness): string | null;
|
|
70
|
+
//# sourceMappingURL=today-plan.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"today-plan.d.ts","sourceRoot":"","sources":["../src/today-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,uBAAuB,CAAC;AAEjF,MAAM,MAAM,mBAAmB,GAAG,MAAM,GAAG,UAAU,GAAG,KAAK,CAAC;AAC9D,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,UAAU,GAAG,UAAU,CAAC;AAC7D,MAAM,MAAM,kBAAkB,GAAG,WAAW,GAAG,MAAM,GAAG,MAAM,GAAG,MAAM,CAAC;AAExE,MAAM,WAAW,uBAAuB;IACtC,KAAK,EAAE,MAAM,CAAC;IACd,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,eAAe;IAC9B,EAAE,EAAE,eAAe,CAAC;IACpB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,EAAE,MAAM,CAAC;IAChB,IAAI,EAAE,aAAa,CAAC;CACrB;AAED,MAAM,WAAW,kBAAkB;IACjC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;IAC5B,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED,MAAM,WAAW,0BAA0B;IACzC,YAAY,EAAE,MAAM,CAAC;IACrB,IAAI,EAAE,aAAa,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,IAAI,CAAC;CAC9B;AAED,MAAM,WAAW,mBAAmB;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,YAAY,EAAE,0BAA0B,GAA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
function daysBetween(laterDate, earlierDate) {
|
|
3
|
+
return Math.floor((new Date(`${laterDate}T00:00:00Z`).getTime() -
|
|
4
|
+
new Date(`${earlierDate}T00:00:00Z`).getTime()) /
|
|
5
|
+
86400000);
|
|
6
|
+
}
|
|
7
|
+
function resolveConfidence(endDate, recoveryDate, sleepDate) {
|
|
8
|
+
if (recoveryDate == null)
|
|
9
|
+
return "low";
|
|
10
|
+
const recoveryAgeDays = daysBetween(endDate, recoveryDate);
|
|
11
|
+
if (recoveryAgeDays > 1)
|
|
12
|
+
return "low";
|
|
13
|
+
if (recoveryAgeDays === 0 && sleepDate != null && daysBetween(endDate, sleepDate) <= 1) {
|
|
14
|
+
return "high";
|
|
15
|
+
}
|
|
16
|
+
return "moderate";
|
|
17
|
+
}
|
|
18
|
+
function actionTitle(zone, targetStrain) {
|
|
19
|
+
if (zone === "Push")
|
|
20
|
+
return `Train hard today — aim for ${targetStrain} strain`;
|
|
21
|
+
if (zone === "Recovery")
|
|
22
|
+
return `Keep training light today — aim for ${targetStrain} strain`;
|
|
23
|
+
return `No change needs attention — aim for ${targetStrain} strain`;
|
|
24
|
+
}
|
|
25
|
+
function secondSupportingFact(input) {
|
|
26
|
+
if (input.sleepPerformanceScore != null && input.sleepPerformanceTier != null) {
|
|
27
|
+
return {
|
|
28
|
+
fact: {
|
|
29
|
+
label: "Sleep performance",
|
|
30
|
+
value: `${input.sleepPerformanceScore} (${input.sleepPerformanceTier})`,
|
|
31
|
+
},
|
|
32
|
+
missingSleep: false,
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
if (input.strainTarget?.workloadRatio != null) {
|
|
36
|
+
return {
|
|
37
|
+
fact: {
|
|
38
|
+
label: "Recent-to-baseline workload ratio",
|
|
39
|
+
value: String(input.strainTarget.workloadRatio),
|
|
40
|
+
},
|
|
41
|
+
missingSleep: true,
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
return {
|
|
45
|
+
fact: {
|
|
46
|
+
label: "Strain target",
|
|
47
|
+
value: String(input.strainTarget?.targetStrain ?? 0),
|
|
48
|
+
},
|
|
49
|
+
missingSleep: true,
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
function buildCaveats(input, missingSleep) {
|
|
53
|
+
const caveats = [];
|
|
54
|
+
if (missingSleep) {
|
|
55
|
+
if (input.strainTarget?.workloadRatio == null) {
|
|
56
|
+
caveats.push("Sleep and recent workload data were unavailable, so this plan uses recovery and the strain target.");
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
caveats.push("Sleep performance was unavailable, so this plan uses recovery and recent workload instead.");
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
if (input.recoveryDate == null) {
|
|
63
|
+
caveats.push("Recovery data has no date, so confidence is low.");
|
|
64
|
+
}
|
|
65
|
+
else if (daysBetween(input.endDate, input.recoveryDate) > 0) {
|
|
66
|
+
caveats.push(`Recovery data is from ${input.recoveryDate}, so this plan may be less current.`);
|
|
67
|
+
}
|
|
68
|
+
if (input.sleepDate != null && daysBetween(input.endDate, input.sleepDate) > 0) {
|
|
69
|
+
caveats.push(`Sleep data is from ${input.sleepDate}, so it may not reflect the latest night.`);
|
|
70
|
+
}
|
|
71
|
+
return caveats;
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Build a deterministic Today Plan from already-computed recovery/strain inputs.
|
|
75
|
+
* Clients must render this payload and must not recompute health meaning.
|
|
76
|
+
*/
|
|
77
|
+
export function buildTodayPlan(input) {
|
|
78
|
+
const freshness = {
|
|
79
|
+
recoveryDate: input.recoveryDate,
|
|
80
|
+
sleepDate: input.sleepDate,
|
|
81
|
+
};
|
|
82
|
+
if (input.strainTarget == null) {
|
|
83
|
+
return {
|
|
84
|
+
status: "insufficient_data",
|
|
85
|
+
epistemicStatus: getEpistemicStatus("unavailable"),
|
|
86
|
+
date: input.endDate,
|
|
87
|
+
action: null,
|
|
88
|
+
supportingFacts: [],
|
|
89
|
+
confidence: "low",
|
|
90
|
+
freshness,
|
|
91
|
+
missingInputs: ["recovery"],
|
|
92
|
+
message: "Connect a recovery source and wait for today's recovery score before a training plan can be generated.",
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
const { fact: secondFact, missingSleep } = secondSupportingFact(input);
|
|
96
|
+
const missingInputs = missingSleep ? ["sleep"] : [];
|
|
97
|
+
return {
|
|
98
|
+
status: "ready",
|
|
99
|
+
epistemicStatus: getEpistemicStatus("suggested"),
|
|
100
|
+
date: input.endDate,
|
|
101
|
+
action: {
|
|
102
|
+
id: "strain_target",
|
|
103
|
+
title: actionTitle(input.strainTarget.zone, input.strainTarget.targetStrain),
|
|
104
|
+
summary: input.strainTarget.explanation,
|
|
105
|
+
zone: input.strainTarget.zone,
|
|
106
|
+
},
|
|
107
|
+
supportingFacts: [
|
|
108
|
+
{
|
|
109
|
+
label: "Recovery",
|
|
110
|
+
value: `${input.strainTarget.readinessScore}/100`,
|
|
111
|
+
},
|
|
112
|
+
secondFact,
|
|
113
|
+
],
|
|
114
|
+
caveats: buildCaveats(input, missingSleep),
|
|
115
|
+
confidence: resolveConfidence(input.endDate, input.recoveryDate, input.sleepDate),
|
|
116
|
+
freshness,
|
|
117
|
+
missingInputs,
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
const confidenceLabels = {
|
|
121
|
+
high: "High confidence",
|
|
122
|
+
moderate: "Moderate confidence",
|
|
123
|
+
low: "Low confidence",
|
|
124
|
+
};
|
|
125
|
+
/**
|
|
126
|
+
* Shared confidence wording for web and mobile Today Plan cards.
|
|
127
|
+
*/
|
|
128
|
+
export function formatTodayPlanConfidence(confidence) {
|
|
129
|
+
return confidenceLabels[confidence];
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Shared freshness wording for web and mobile Today Plan cards.
|
|
133
|
+
*/
|
|
134
|
+
export function formatTodayPlanFreshness(freshness) {
|
|
135
|
+
const parts = [];
|
|
136
|
+
if (freshness.recoveryDate != null) {
|
|
137
|
+
parts.push(`Recovery data from ${freshness.recoveryDate}`);
|
|
138
|
+
}
|
|
139
|
+
if (freshness.sleepDate != null) {
|
|
140
|
+
parts.push(`Sleep data from ${freshness.sleepDate}`);
|
|
141
|
+
}
|
|
142
|
+
return parts.length > 0 ? parts.join(" · ") : null;
|
|
143
|
+
}
|
|
144
|
+
//# sourceMappingURL=today-plan.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"today-plan.js","sourceRoot":"","sources":["../src/today-plan.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAkEjF,SAAS,WAAW,CAAC,SAAiB,EAAE,WAAmB;IACzD,OAAO,IAAI,CAAC,KAAK,CACf,CAAC,IAAI,IAAI,CAAC,GAAG,SAAS,YAAY,CAAC,CAAC,OAAO,EAAE;QAC3C,IAAI,IAAI,CAAC,GAAG,WAAW,YAAY,CAAC,CAAC,OAAO,EAAE,CAAC;QAC/C,QAAQ,CACX,CAAC;AACJ,CAAC;AAED,SAAS,iBAAiB,CACxB,OAAe,EACf,YAA2B,EAC3B,SAAwB;IAExB,IAAI,YAAY,IAAI,IAAI;QAAE,OAAO,KAAK,CAAC;IACvC,MAAM,eAAe,GAAG,WAAW,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;IAC3D,IAAI,eAAe,GAAG,CAAC;QAAE,OAAO,KAAK,CAAC;IACtC,IAAI,eAAe,KAAK,CAAC,IAAI,SAAS,IAAI,IAAI,IAAI,WAAW,CAAC,OAAO,EAAE,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC;QACvF,OAAO,MAAM,CAAC;IAChB,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,SAAS,WAAW,CAAC,IAAmB,EAAE,YAAoB;IAC5D,IAAI,IAAI,KAAK,MAAM;QAAE,OAAO,8BAA8B,YAAY,SAAS,CAAC;IAChF,IAAI,IAAI,KAAK,UAAU;QAAE,OAAO,uCAAuC,YAAY,SAAS,CAAC;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,GAAG,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AACrD,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dofek/scoring",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Platform-agnostic health scoring models, labels, colors, and design tokens",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -45,6 +45,14 @@
|
|
|
45
45
|
"types": "./dist/strain-target.d.ts",
|
|
46
46
|
"import": "./dist/strain-target.js"
|
|
47
47
|
},
|
|
48
|
+
"./today-plan": {
|
|
49
|
+
"types": "./dist/today-plan.d.ts",
|
|
50
|
+
"import": "./dist/today-plan.js"
|
|
51
|
+
},
|
|
52
|
+
"./epistemic-status": {
|
|
53
|
+
"types": "./dist/epistemic-status.d.ts",
|
|
54
|
+
"import": "./dist/epistemic-status.js"
|
|
55
|
+
},
|
|
48
56
|
"./sleep-performance": {
|
|
49
57
|
"types": "./dist/sleep-performance.d.ts",
|
|
50
58
|
"import": "./dist/sleep-performance.js"
|
|
@@ -75,9 +83,7 @@
|
|
|
75
83
|
},
|
|
76
84
|
"scripts": {
|
|
77
85
|
"build": "tsc",
|
|
78
|
-
"prepack": "pnpm run build",
|
|
79
86
|
"test": "vitest run src",
|
|
80
87
|
"typecheck": "tsc --noEmit"
|
|
81
|
-
}
|
|
82
|
-
|
|
83
|
-
}
|
|
88
|
+
}
|
|
89
|
+
}
|