@dgpholdings/greatoak-shared 1.2.92 → 1.2.94
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/__mocks__/user.mock.js +1 -1
- package/dist/constants/index.d.ts +0 -1
- package/dist/constants/index.js +0 -1
- package/dist/types/TApiAiQuickStartWorkout.d.ts +7 -0
- package/dist/types/TApiAuth.d.ts +1 -3
- package/dist/types/TApiUser.d.ts +4 -2
- package/dist/types/TUserPreferences.d.ts +2 -3
- package/dist/types/goalFeature/TApiGoalContextRes.d.ts +64 -0
- package/dist/types/goalFeature/TApiGoalContextRes.js +2 -0
- package/dist/types/goalFeature/goalJourney.d.ts +111 -0
- package/dist/types/goalFeature/goalJourney.js +595 -0
- package/dist/types/goalFeature/index.d.ts +3 -0
- package/dist/types/goalFeature/index.js +19 -0
- package/dist/types/goalFeature/utilGoal.d.ts +22 -0
- package/dist/types/goalFeature/utilGoal.js +271 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +16 -0
- package/dist/utils/scoringWorkout/helpers.d.ts +6 -21
- package/dist/utils/scoringWorkout/helpers.js +2 -3
- package/dist/utils/scoringWorkout/index.js +0 -3
- package/dist/utils/scoringWorkout/types.d.ts +0 -2
- package/package.json +1 -1
|
@@ -0,0 +1,595 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GOAL_PHASE_HINTS = exports.DAYS_PER_WEEK_OPTIONS = exports.RECENCY_CREDIT = exports.PHASE_ENTRY_CREDIT = exports.GOAL_CATEGORY_DISPLAY = exports.GOAL_DISPLAY = exports.INTENT_DISPLAY = exports.PHASE_DISPLAY = exports.TRAINING_PHASES = exports.GOAL_TO_AI_FITNESS_GOAL = exports.GOAL_SESSION_INTENTS = exports.USER_FITNESS_GOALS = void 0;
|
|
4
|
+
exports.derivePhase = derivePhase;
|
|
5
|
+
exports.USER_FITNESS_GOALS = [
|
|
6
|
+
// Appearance
|
|
7
|
+
"lose_weight",
|
|
8
|
+
"build_muscle",
|
|
9
|
+
"lean_and_toned",
|
|
10
|
+
"glutes_and_legs",
|
|
11
|
+
// Performance
|
|
12
|
+
"get_stronger",
|
|
13
|
+
"boost_endurance",
|
|
14
|
+
"athletic_performance",
|
|
15
|
+
// Health
|
|
16
|
+
"general_fitness",
|
|
17
|
+
"posture_and_back",
|
|
18
|
+
"stress_relief",
|
|
19
|
+
"rehabilitation",
|
|
20
|
+
// Focused
|
|
21
|
+
"core_strength",
|
|
22
|
+
"mobility_flexibility",
|
|
23
|
+
];
|
|
24
|
+
// The canonical weekly template per goal (7 slots, Mon→Sun)
|
|
25
|
+
// Phase-aware structures live in the app layer, not shared
|
|
26
|
+
// This is the "default" / Phase 2-3 reference structure
|
|
27
|
+
exports.GOAL_SESSION_INTENTS = {
|
|
28
|
+
lose_weight: [
|
|
29
|
+
"cardio",
|
|
30
|
+
"full-body",
|
|
31
|
+
"rest",
|
|
32
|
+
"cardio",
|
|
33
|
+
"full-body",
|
|
34
|
+
"cardio",
|
|
35
|
+
"rest",
|
|
36
|
+
],
|
|
37
|
+
build_muscle: ["push", "pull", "legs", "rest", "upper", "lower", "rest"],
|
|
38
|
+
lean_and_toned: [
|
|
39
|
+
"full-body",
|
|
40
|
+
"cardio",
|
|
41
|
+
"full-body",
|
|
42
|
+
"rest",
|
|
43
|
+
"full-body",
|
|
44
|
+
"cardio",
|
|
45
|
+
"rest",
|
|
46
|
+
],
|
|
47
|
+
glutes_and_legs: ["legs", "upper", "legs", "rest", "legs", "cardio", "rest"],
|
|
48
|
+
get_stronger: ["push", "pull", "legs", "rest", "push", "pull", "rest"],
|
|
49
|
+
boost_endurance: [
|
|
50
|
+
"cardio",
|
|
51
|
+
"legs",
|
|
52
|
+
"cardio",
|
|
53
|
+
"upper",
|
|
54
|
+
"cardio",
|
|
55
|
+
"full-body",
|
|
56
|
+
"rest",
|
|
57
|
+
],
|
|
58
|
+
athletic_performance: [
|
|
59
|
+
"legs",
|
|
60
|
+
"upper",
|
|
61
|
+
"cardio",
|
|
62
|
+
"core",
|
|
63
|
+
"full-body",
|
|
64
|
+
"rest",
|
|
65
|
+
"rest",
|
|
66
|
+
],
|
|
67
|
+
general_fitness: [
|
|
68
|
+
"full-body",
|
|
69
|
+
"rest",
|
|
70
|
+
"full-body",
|
|
71
|
+
"cardio",
|
|
72
|
+
"full-body",
|
|
73
|
+
"rest",
|
|
74
|
+
"rest",
|
|
75
|
+
],
|
|
76
|
+
posture_and_back: [
|
|
77
|
+
"pull",
|
|
78
|
+
"core",
|
|
79
|
+
"mobility",
|
|
80
|
+
"pull",
|
|
81
|
+
"core",
|
|
82
|
+
"mobility",
|
|
83
|
+
"rest",
|
|
84
|
+
],
|
|
85
|
+
stress_relief: [
|
|
86
|
+
"cardio",
|
|
87
|
+
"mobility",
|
|
88
|
+
"full-body",
|
|
89
|
+
"rest",
|
|
90
|
+
"cardio",
|
|
91
|
+
"mobility",
|
|
92
|
+
"rest",
|
|
93
|
+
],
|
|
94
|
+
rehabilitation: [
|
|
95
|
+
"mobility",
|
|
96
|
+
"core",
|
|
97
|
+
"mobility",
|
|
98
|
+
"rest",
|
|
99
|
+
"mobility",
|
|
100
|
+
"core",
|
|
101
|
+
"rest",
|
|
102
|
+
],
|
|
103
|
+
core_strength: ["core", "pull", "legs", "core", "push", "rest", "rest"],
|
|
104
|
+
mobility_flexibility: [
|
|
105
|
+
"mobility",
|
|
106
|
+
"full-body",
|
|
107
|
+
"mobility",
|
|
108
|
+
"rest",
|
|
109
|
+
"mobility",
|
|
110
|
+
"full-body",
|
|
111
|
+
"rest",
|
|
112
|
+
],
|
|
113
|
+
};
|
|
114
|
+
exports.GOAL_TO_AI_FITNESS_GOAL = {
|
|
115
|
+
lose_weight: "fat_loss",
|
|
116
|
+
build_muscle: "hypertrophy",
|
|
117
|
+
lean_and_toned: "fat_loss",
|
|
118
|
+
glutes_and_legs: "hypertrophy",
|
|
119
|
+
get_stronger: "strength",
|
|
120
|
+
boost_endurance: "endurance",
|
|
121
|
+
athletic_performance: "sport_performance",
|
|
122
|
+
general_fitness: "general_fitness",
|
|
123
|
+
posture_and_back: "strength",
|
|
124
|
+
stress_relief: "general_fitness",
|
|
125
|
+
rehabilitation: "rehabilitation",
|
|
126
|
+
core_strength: "core_strength",
|
|
127
|
+
mobility_flexibility: "mobility",
|
|
128
|
+
};
|
|
129
|
+
// Foundation → Momentum → Push → Peak
|
|
130
|
+
exports.TRAINING_PHASES = [
|
|
131
|
+
"foundation",
|
|
132
|
+
"momentum",
|
|
133
|
+
"push",
|
|
134
|
+
"peak",
|
|
135
|
+
];
|
|
136
|
+
exports.PHASE_DISPLAY = {
|
|
137
|
+
foundation: {
|
|
138
|
+
nameKey: "goalPhase.foundation.name",
|
|
139
|
+
nameEn: "Foundation",
|
|
140
|
+
subtitleKey: "goalPhase.foundation.subtitle",
|
|
141
|
+
subtitleEn: "Build the base",
|
|
142
|
+
purposeKey: "goalPhase.foundation.purpose",
|
|
143
|
+
purposeEn: "Preparing your joints, learning movement patterns, and building the work capacity for what's ahead. Every great physique starts here — don't skip it.",
|
|
144
|
+
durationKey: "goalPhase.foundation.duration",
|
|
145
|
+
durationEn: "Weeks 1–2",
|
|
146
|
+
weekRange: [1, 2],
|
|
147
|
+
intensityPercent: 40,
|
|
148
|
+
},
|
|
149
|
+
momentum: {
|
|
150
|
+
nameKey: "goalPhase.momentum.name",
|
|
151
|
+
nameEn: "Momentum",
|
|
152
|
+
subtitleKey: "goalPhase.momentum.subtitle",
|
|
153
|
+
subtitleEn: "Volume builds here",
|
|
154
|
+
purposeKey: "goalPhase.momentum.purpose",
|
|
155
|
+
purposeEn: "Your body has adapted. Now we increase the work. Splits begin, sessions get more specific. This is where the habit locks in.",
|
|
156
|
+
durationKey: "goalPhase.momentum.duration",
|
|
157
|
+
durationEn: "Weeks 3–5",
|
|
158
|
+
weekRange: [3, 5],
|
|
159
|
+
intensityPercent: 60,
|
|
160
|
+
},
|
|
161
|
+
push: {
|
|
162
|
+
nameKey: "goalPhase.push.name",
|
|
163
|
+
nameEn: "Push",
|
|
164
|
+
subtitleKey: "goalPhase.push.subtitle",
|
|
165
|
+
subtitleEn: "This is where change happens",
|
|
166
|
+
purposeKey: "goalPhase.push.purpose",
|
|
167
|
+
purposeEn: "Goal-specific intensity. Your muscles are conditioned — now we challenge them. Expect to feel this one.",
|
|
168
|
+
durationKey: "goalPhase.push.duration",
|
|
169
|
+
durationEn: "Weeks 6–8",
|
|
170
|
+
weekRange: [6, 8],
|
|
171
|
+
intensityPercent: 80,
|
|
172
|
+
},
|
|
173
|
+
peak: {
|
|
174
|
+
nameKey: "goalPhase.peak.name",
|
|
175
|
+
nameEn: "Peak",
|
|
176
|
+
subtitleKey: "goalPhase.peak.subtitle",
|
|
177
|
+
subtitleEn: "Maximum output",
|
|
178
|
+
purposeKey: "goalPhase.peak.purpose",
|
|
179
|
+
purposeEn: "Highest specificity to your goal. You have earned this — now execute. A deload is built into the final week.",
|
|
180
|
+
durationKey: "goalPhase.peak.duration",
|
|
181
|
+
durationEn: "Weeks 9+",
|
|
182
|
+
weekRange: [9, 99],
|
|
183
|
+
intensityPercent: 95,
|
|
184
|
+
},
|
|
185
|
+
};
|
|
186
|
+
exports.INTENT_DISPLAY = {
|
|
187
|
+
push: {
|
|
188
|
+
labelKey: "sessionIntent.push.label",
|
|
189
|
+
labelEn: "Push Day",
|
|
190
|
+
shortLabelKey: "sessionIntent.push.shortLabel",
|
|
191
|
+
shortLabelEn: "Push",
|
|
192
|
+
emoji: "💪",
|
|
193
|
+
},
|
|
194
|
+
pull: {
|
|
195
|
+
labelKey: "sessionIntent.pull.label",
|
|
196
|
+
labelEn: "Pull Day",
|
|
197
|
+
shortLabelKey: "sessionIntent.pull.shortLabel",
|
|
198
|
+
shortLabelEn: "Pull",
|
|
199
|
+
emoji: "🔗",
|
|
200
|
+
},
|
|
201
|
+
legs: {
|
|
202
|
+
labelKey: "sessionIntent.legs.label",
|
|
203
|
+
labelEn: "Leg Day",
|
|
204
|
+
shortLabelKey: "sessionIntent.legs.shortLabel",
|
|
205
|
+
shortLabelEn: "Legs",
|
|
206
|
+
emoji: "🦵",
|
|
207
|
+
},
|
|
208
|
+
lower: {
|
|
209
|
+
labelKey: "sessionIntent.lower.label",
|
|
210
|
+
labelEn: "Lower Body",
|
|
211
|
+
shortLabelKey: "sessionIntent.lower.shortLabel",
|
|
212
|
+
shortLabelEn: "Lower",
|
|
213
|
+
emoji: "🦵",
|
|
214
|
+
},
|
|
215
|
+
upper: {
|
|
216
|
+
labelKey: "sessionIntent.upper.label",
|
|
217
|
+
labelEn: "Upper Body",
|
|
218
|
+
shortLabelKey: "sessionIntent.upper.shortLabel",
|
|
219
|
+
shortLabelEn: "Upper",
|
|
220
|
+
emoji: "💪",
|
|
221
|
+
},
|
|
222
|
+
core: {
|
|
223
|
+
labelKey: "sessionIntent.core.label",
|
|
224
|
+
labelEn: "Core & Abs",
|
|
225
|
+
shortLabelKey: "sessionIntent.core.shortLabel",
|
|
226
|
+
shortLabelEn: "Core",
|
|
227
|
+
emoji: "⚡",
|
|
228
|
+
},
|
|
229
|
+
cardio: {
|
|
230
|
+
labelKey: "sessionIntent.cardio.label",
|
|
231
|
+
labelEn: "Cardio",
|
|
232
|
+
shortLabelKey: "sessionIntent.cardio.shortLabel",
|
|
233
|
+
shortLabelEn: "Cardio",
|
|
234
|
+
emoji: "🏃",
|
|
235
|
+
},
|
|
236
|
+
strength: {
|
|
237
|
+
labelKey: "sessionIntent.strength.label",
|
|
238
|
+
labelEn: "Strength",
|
|
239
|
+
shortLabelKey: "sessionIntent.strength.shortLabel",
|
|
240
|
+
shortLabelEn: "Strength",
|
|
241
|
+
emoji: "🏋️",
|
|
242
|
+
},
|
|
243
|
+
fatburn: {
|
|
244
|
+
labelKey: "sessionIntent.fatburn.label",
|
|
245
|
+
labelEn: "Fat Burn",
|
|
246
|
+
shortLabelKey: "sessionIntent.fatburn.shortLabel",
|
|
247
|
+
shortLabelEn: "Burn",
|
|
248
|
+
emoji: "🔥",
|
|
249
|
+
},
|
|
250
|
+
mobility: {
|
|
251
|
+
labelKey: "sessionIntent.mobility.label",
|
|
252
|
+
labelEn: "Mobility",
|
|
253
|
+
shortLabelKey: "sessionIntent.mobility.shortLabel",
|
|
254
|
+
shortLabelEn: "Mobility",
|
|
255
|
+
emoji: "🧘",
|
|
256
|
+
},
|
|
257
|
+
"full-body": {
|
|
258
|
+
labelKey: "sessionIntent.fullBody.label",
|
|
259
|
+
labelEn: "Full Body",
|
|
260
|
+
shortLabelKey: "sessionIntent.fullBody.shortLabel",
|
|
261
|
+
shortLabelEn: "Full",
|
|
262
|
+
emoji: "⭐",
|
|
263
|
+
},
|
|
264
|
+
rest: {
|
|
265
|
+
labelKey: "sessionIntent.rest.label",
|
|
266
|
+
labelEn: "Rest Day",
|
|
267
|
+
shortLabelKey: "sessionIntent.rest.shortLabel",
|
|
268
|
+
shortLabelEn: "Rest",
|
|
269
|
+
emoji: "😴",
|
|
270
|
+
},
|
|
271
|
+
};
|
|
272
|
+
exports.GOAL_DISPLAY = {
|
|
273
|
+
// ── Appearance ────────────────────────────────────────────────────────────
|
|
274
|
+
lose_weight: {
|
|
275
|
+
nameKey: "userGoal.loseWeight.name",
|
|
276
|
+
nameEn: "Lose Weight",
|
|
277
|
+
descriptionKey: "userGoal.loseWeight.description",
|
|
278
|
+
descriptionEn: "Burn fat and drop weight through cardio and full-body training.",
|
|
279
|
+
taglineKey: "userGoal.loseWeight.tagline",
|
|
280
|
+
taglineEn: "Every session burns, every week counts.",
|
|
281
|
+
emoji: "🔥",
|
|
282
|
+
category: "appearance",
|
|
283
|
+
},
|
|
284
|
+
build_muscle: {
|
|
285
|
+
nameKey: "userGoal.buildMuscle.name",
|
|
286
|
+
nameEn: "Build Muscle",
|
|
287
|
+
descriptionKey: "userGoal.buildMuscle.description",
|
|
288
|
+
descriptionEn: "Add size and strength with structured push, pull, and leg splits.",
|
|
289
|
+
taglineKey: "userGoal.buildMuscle.tagline",
|
|
290
|
+
taglineEn: "Progressive overload. Every rep builds the next.",
|
|
291
|
+
emoji: "💪",
|
|
292
|
+
category: "appearance",
|
|
293
|
+
},
|
|
294
|
+
lean_and_toned: {
|
|
295
|
+
nameKey: "userGoal.leanAndToned.name",
|
|
296
|
+
nameEn: "Get Lean & Toned",
|
|
297
|
+
descriptionKey: "userGoal.leanAndToned.description",
|
|
298
|
+
descriptionEn: "Burn fat while preserving muscle for a lean, defined look.",
|
|
299
|
+
taglineKey: "userGoal.leanAndToned.tagline",
|
|
300
|
+
taglineEn: "Defined. Lean. Confident.",
|
|
301
|
+
emoji: "✨",
|
|
302
|
+
category: "appearance",
|
|
303
|
+
},
|
|
304
|
+
glutes_and_legs: {
|
|
305
|
+
nameKey: "userGoal.glutesAndLegs.name",
|
|
306
|
+
nameEn: "Grow Glutes & Legs",
|
|
307
|
+
descriptionKey: "userGoal.glutesAndLegs.description",
|
|
308
|
+
descriptionEn: "Build powerful glutes and legs with targeted lower-body training.",
|
|
309
|
+
taglineKey: "userGoal.glutesAndLegs.tagline",
|
|
310
|
+
taglineEn: "Strong legs carry everything.",
|
|
311
|
+
emoji: "🦵",
|
|
312
|
+
category: "appearance",
|
|
313
|
+
},
|
|
314
|
+
// ── Performance ───────────────────────────────────────────────────────────
|
|
315
|
+
get_stronger: {
|
|
316
|
+
nameKey: "userGoal.getStronger.name",
|
|
317
|
+
nameEn: "Get Stronger",
|
|
318
|
+
descriptionKey: "userGoal.getStronger.description",
|
|
319
|
+
descriptionEn: "Build real-world strength through compound lifts and progressive overload.",
|
|
320
|
+
taglineKey: "userGoal.getStronger.tagline",
|
|
321
|
+
taglineEn: "Lift more. Be more.",
|
|
322
|
+
emoji: "🏋️",
|
|
323
|
+
category: "performance",
|
|
324
|
+
},
|
|
325
|
+
boost_endurance: {
|
|
326
|
+
nameKey: "userGoal.boostEndurance.name",
|
|
327
|
+
nameEn: "Build Endurance",
|
|
328
|
+
descriptionKey: "userGoal.boostEndurance.description",
|
|
329
|
+
descriptionEn: "Increase stamina and cardiovascular capacity through progressive cardio and leg work.",
|
|
330
|
+
taglineKey: "userGoal.boostEndurance.tagline",
|
|
331
|
+
taglineEn: "Go further. Last longer.",
|
|
332
|
+
emoji: "🏃",
|
|
333
|
+
category: "performance",
|
|
334
|
+
},
|
|
335
|
+
athletic_performance: {
|
|
336
|
+
nameKey: "userGoal.athleticPerformance.name",
|
|
337
|
+
nameEn: "Athletic Performance",
|
|
338
|
+
descriptionKey: "userGoal.athleticPerformance.description",
|
|
339
|
+
descriptionEn: "Train like an athlete — explosive power, speed, agility, and conditioning.",
|
|
340
|
+
taglineKey: "userGoal.athleticPerformance.tagline",
|
|
341
|
+
taglineEn: "Train hard. Perform harder.",
|
|
342
|
+
emoji: "⚡",
|
|
343
|
+
category: "performance",
|
|
344
|
+
},
|
|
345
|
+
// ── Health ────────────────────────────────────────────────────────────────
|
|
346
|
+
general_fitness: {
|
|
347
|
+
nameKey: "userGoal.generalFitness.name",
|
|
348
|
+
nameEn: "Stay Active & Healthy",
|
|
349
|
+
descriptionKey: "userGoal.generalFitness.description",
|
|
350
|
+
descriptionEn: "A balanced mix of strength, cardio, and mobility for a healthy, active lifestyle.",
|
|
351
|
+
taglineKey: "userGoal.generalFitness.tagline",
|
|
352
|
+
taglineEn: "Move well. Feel well. Live well.",
|
|
353
|
+
emoji: "🌟",
|
|
354
|
+
category: "health",
|
|
355
|
+
},
|
|
356
|
+
posture_and_back: {
|
|
357
|
+
nameKey: "userGoal.postureAndBack.name",
|
|
358
|
+
nameEn: "Fix Posture & Back",
|
|
359
|
+
descriptionKey: "userGoal.postureAndBack.description",
|
|
360
|
+
descriptionEn: "Strengthen the posterior chain and core to fix posture and eliminate back pain.",
|
|
361
|
+
taglineKey: "userGoal.postureAndBack.tagline",
|
|
362
|
+
taglineEn: "Stand tall. Move pain-free.",
|
|
363
|
+
emoji: "🧍",
|
|
364
|
+
category: "health",
|
|
365
|
+
},
|
|
366
|
+
stress_relief: {
|
|
367
|
+
nameKey: "userGoal.stressRelief.name",
|
|
368
|
+
nameEn: "Reduce Stress",
|
|
369
|
+
descriptionKey: "userGoal.stressRelief.description",
|
|
370
|
+
descriptionEn: "Use movement to reset your mind — cardio endorphins and mobility to decompress.",
|
|
371
|
+
taglineKey: "userGoal.stressRelief.tagline",
|
|
372
|
+
taglineEn: "Move it out. Breathe it out.",
|
|
373
|
+
emoji: "🧘",
|
|
374
|
+
category: "health",
|
|
375
|
+
},
|
|
376
|
+
rehabilitation: {
|
|
377
|
+
nameKey: "userGoal.rehabilitation.name",
|
|
378
|
+
nameEn: "Recover from Injury",
|
|
379
|
+
descriptionKey: "userGoal.rehabilitation.description",
|
|
380
|
+
descriptionEn: "Gentle, progressive sessions to rebuild strength and movement after injury.",
|
|
381
|
+
taglineKey: "userGoal.rehabilitation.tagline",
|
|
382
|
+
taglineEn: "Slow and steady. Built to last.",
|
|
383
|
+
emoji: "🩹",
|
|
384
|
+
category: "health",
|
|
385
|
+
},
|
|
386
|
+
// ── Focused ───────────────────────────────────────────────────────────────
|
|
387
|
+
core_strength: {
|
|
388
|
+
nameKey: "userGoal.coreStrength.name",
|
|
389
|
+
nameEn: "Build a Strong Core",
|
|
390
|
+
descriptionKey: "userGoal.coreStrength.description",
|
|
391
|
+
descriptionEn: "Develop deep core stability and strength — the foundation of every movement.",
|
|
392
|
+
taglineKey: "userGoal.coreStrength.tagline",
|
|
393
|
+
taglineEn: "Strong core. Strong everything.",
|
|
394
|
+
emoji: "🎯",
|
|
395
|
+
category: "focused",
|
|
396
|
+
},
|
|
397
|
+
mobility_flexibility: {
|
|
398
|
+
nameKey: "userGoal.mobilityFlexibility.name",
|
|
399
|
+
nameEn: "Improve Flexibility",
|
|
400
|
+
descriptionKey: "userGoal.mobilityFlexibility.description",
|
|
401
|
+
descriptionEn: "Increase range of motion and joint health through consistent mobility work.",
|
|
402
|
+
taglineKey: "userGoal.mobilityFlexibility.tagline",
|
|
403
|
+
taglineEn: "Move freely. Age well.",
|
|
404
|
+
emoji: "🌀",
|
|
405
|
+
category: "focused",
|
|
406
|
+
},
|
|
407
|
+
};
|
|
408
|
+
exports.GOAL_CATEGORY_DISPLAY = {
|
|
409
|
+
appearance: {
|
|
410
|
+
labelKey: "goalCategory.appearance.label",
|
|
411
|
+
labelEn: "Appearance",
|
|
412
|
+
},
|
|
413
|
+
performance: {
|
|
414
|
+
labelKey: "goalCategory.performance.label",
|
|
415
|
+
labelEn: "Performance",
|
|
416
|
+
},
|
|
417
|
+
health: {
|
|
418
|
+
labelKey: "goalCategory.health.label",
|
|
419
|
+
labelEn: "Health & Wellbeing",
|
|
420
|
+
},
|
|
421
|
+
focused: {
|
|
422
|
+
labelKey: "goalCategory.focused.label",
|
|
423
|
+
labelEn: "Focused Training",
|
|
424
|
+
},
|
|
425
|
+
};
|
|
426
|
+
// ---------------------------------------------------------------------------
|
|
427
|
+
// derivePhase — pure helper
|
|
428
|
+
// Shared between Lambda and client — lives here so neither duplicates it
|
|
429
|
+
// ---------------------------------------------------------------------------
|
|
430
|
+
exports.PHASE_ENTRY_CREDIT = {
|
|
431
|
+
sedentary: 0,
|
|
432
|
+
"lightly-active": 0,
|
|
433
|
+
"moderately-active": 6, // enters Momentum directly
|
|
434
|
+
"very-active": 12, // enters Push directly
|
|
435
|
+
};
|
|
436
|
+
exports.RECENCY_CREDIT = {
|
|
437
|
+
sedentary: 0,
|
|
438
|
+
"lightly-active": 0,
|
|
439
|
+
"moderately-active": 4,
|
|
440
|
+
"very-active": 8,
|
|
441
|
+
};
|
|
442
|
+
/**
|
|
443
|
+
* Derive training phase from time + volume + recency.
|
|
444
|
+
* All three must pass — week count alone is NOT sufficient.
|
|
445
|
+
* A user doing 12 sessions over one year has not built a training base.
|
|
446
|
+
*
|
|
447
|
+
* On goal start day (no sessions yet), pass:
|
|
448
|
+
* totalSessions = PHASE_ENTRY_CREDIT[user.fitnessLevel]
|
|
449
|
+
* sessionsInLast4Weeks = RECENCY_CREDIT[user.fitnessLevel]
|
|
450
|
+
*/
|
|
451
|
+
function derivePhase(weekNumber, totalSessions, sessionsInLast4Weeks) {
|
|
452
|
+
// Foundation → needs minimum 2 weeks, 6 sessions, 1 session/week pace
|
|
453
|
+
if (weekNumber < 2 || totalSessions < 6 || sessionsInLast4Weeks < 4)
|
|
454
|
+
return "foundation";
|
|
455
|
+
// Momentum → needs 6 weeks, 12 sessions, ~1.5 sessions/week pace
|
|
456
|
+
if (weekNumber < 6 || totalSessions < 12 || sessionsInLast4Weeks < 6)
|
|
457
|
+
return "momentum";
|
|
458
|
+
// Push → needs 9 weeks, 20 sessions, ~2 sessions/week pace
|
|
459
|
+
if (weekNumber < 9 || totalSessions < 20 || sessionsInLast4Weeks < 8)
|
|
460
|
+
return "push";
|
|
461
|
+
return "peak";
|
|
462
|
+
}
|
|
463
|
+
exports.DAYS_PER_WEEK_OPTIONS = [2, 3, 4, 5];
|
|
464
|
+
exports.GOAL_PHASE_HINTS = {
|
|
465
|
+
lose_weight: {
|
|
466
|
+
// "Build the cardio habit"
|
|
467
|
+
foundation: "goalPhaseHint.loseWeight.foundation.buildCardioHabit",
|
|
468
|
+
// "Intensity picks up"
|
|
469
|
+
momentum: "goalPhaseHint.loseWeight.momentum.intensityPicksUp",
|
|
470
|
+
// "Fat burning at its best"
|
|
471
|
+
push: "goalPhaseHint.loseWeight.push.fatBurningAtBest",
|
|
472
|
+
// "Final push to your goal"
|
|
473
|
+
peak: "goalPhaseHint.loseWeight.peak.finalPushToGoal",
|
|
474
|
+
},
|
|
475
|
+
build_muscle: {
|
|
476
|
+
// "Learn the fundamental movements"
|
|
477
|
+
foundation: "goalPhaseHint.buildMuscle.foundation.learnFundamentalMovements",
|
|
478
|
+
// "Volume increases, splits begin"
|
|
479
|
+
momentum: "goalPhaseHint.buildMuscle.momentum.volumeIncreaseSplitsBegin",
|
|
480
|
+
// "Real muscle growth happens here"
|
|
481
|
+
push: "goalPhaseHint.buildMuscle.push.realMuscleGrowthHappensHere",
|
|
482
|
+
// "Push to your peak output"
|
|
483
|
+
peak: "goalPhaseHint.buildMuscle.peak.pushToPeakOutput",
|
|
484
|
+
},
|
|
485
|
+
lean_and_toned: {
|
|
486
|
+
// "Start moving consistently"
|
|
487
|
+
foundation: "goalPhaseHint.leanAndToned.foundation.startMovingConsistently",
|
|
488
|
+
// "Splits begin, cardio added"
|
|
489
|
+
momentum: "goalPhaseHint.leanAndToned.momentum.splitsBeginCardioAdded",
|
|
490
|
+
// "Definition starts to show"
|
|
491
|
+
push: "goalPhaseHint.leanAndToned.push.definitionStartsToShow",
|
|
492
|
+
// "Your best shape yet"
|
|
493
|
+
peak: "goalPhaseHint.leanAndToned.peak.yourBestShapeYet",
|
|
494
|
+
},
|
|
495
|
+
glutes_and_legs: {
|
|
496
|
+
// "Learn hip-hinge and squat patterns"
|
|
497
|
+
foundation: "goalPhaseHint.glutesAndLegs.foundation.learnHipHingeSquatPatterns",
|
|
498
|
+
// "Volume builds in lower body"
|
|
499
|
+
momentum: "goalPhaseHint.glutesAndLegs.momentum.volumeBuildsLowerBody",
|
|
500
|
+
// "Legs up to 3 times per week"
|
|
501
|
+
push: "goalPhaseHint.glutesAndLegs.push.legsThreeTimesPerWeek",
|
|
502
|
+
// "Maximum lower body output"
|
|
503
|
+
peak: "goalPhaseHint.glutesAndLegs.peak.maximumLowerBodyOutput",
|
|
504
|
+
},
|
|
505
|
+
get_stronger: {
|
|
506
|
+
// "Master the big compound lifts"
|
|
507
|
+
foundation: "goalPhaseHint.getStronger.foundation.masterBigCompoundLifts",
|
|
508
|
+
// "Load increases week on week"
|
|
509
|
+
momentum: "goalPhaseHint.getStronger.momentum.loadIncreasesWeekOnWeek",
|
|
510
|
+
// "Heavy compound focus"
|
|
511
|
+
push: "goalPhaseHint.getStronger.push.heavyCompoundFocus",
|
|
512
|
+
// "Strength peak — test your limits"
|
|
513
|
+
peak: "goalPhaseHint.getStronger.peak.strengthPeakTestYourLimits",
|
|
514
|
+
},
|
|
515
|
+
boost_endurance: {
|
|
516
|
+
// "Build base aerobic fitness"
|
|
517
|
+
foundation: "goalPhaseHint.boostEndurance.foundation.buildBaseAerobicFitness",
|
|
518
|
+
// "Duration and distance increase"
|
|
519
|
+
momentum: "goalPhaseHint.boostEndurance.momentum.durationDistanceIncrease",
|
|
520
|
+
// "High volume cardio sessions"
|
|
521
|
+
push: "goalPhaseHint.boostEndurance.push.highVolumeCardioSessions",
|
|
522
|
+
// "Peak cardiovascular output"
|
|
523
|
+
peak: "goalPhaseHint.boostEndurance.peak.peakCardiovascularOutput",
|
|
524
|
+
},
|
|
525
|
+
athletic_performance: {
|
|
526
|
+
// "Movement quality comes first"
|
|
527
|
+
foundation: "goalPhaseHint.athleticPerformance.foundation.movementQualityFirst",
|
|
528
|
+
// "Power and speed sessions begin"
|
|
529
|
+
momentum: "goalPhaseHint.athleticPerformance.momentum.powerSpeedSessionsBegin",
|
|
530
|
+
// "Sport specific intensity"
|
|
531
|
+
push: "goalPhaseHint.athleticPerformance.push.sportSpecificIntensity",
|
|
532
|
+
// "Peak athletic output"
|
|
533
|
+
peak: "goalPhaseHint.athleticPerformance.peak.peakAthleticOutput",
|
|
534
|
+
},
|
|
535
|
+
general_fitness: {
|
|
536
|
+
// "Build the habit"
|
|
537
|
+
foundation: "goalPhaseHint.generalFitness.foundation.buildTheHabit",
|
|
538
|
+
// "Add more variety"
|
|
539
|
+
momentum: "goalPhaseHint.generalFitness.momentum.addMoreVariety",
|
|
540
|
+
// "Consistent challenge"
|
|
541
|
+
push: "goalPhaseHint.generalFitness.push.consistentChallenge",
|
|
542
|
+
// "Sustained healthy output"
|
|
543
|
+
peak: "goalPhaseHint.generalFitness.peak.sustainedHealthyOutput",
|
|
544
|
+
},
|
|
545
|
+
posture_and_back: {
|
|
546
|
+
// "Activate neglected muscles"
|
|
547
|
+
foundation: "goalPhaseHint.postureAndBack.foundation.activateNeglectedMuscles",
|
|
548
|
+
// "Posterior chain strengthens"
|
|
549
|
+
momentum: "goalPhaseHint.postureAndBack.momentum.posteriorChainStrengthens",
|
|
550
|
+
// "Pull heavy split begins"
|
|
551
|
+
push: "goalPhaseHint.postureAndBack.push.pullHeavySplitBegins",
|
|
552
|
+
// "Posture transformation complete"
|
|
553
|
+
peak: "goalPhaseHint.postureAndBack.peak.postureTransformationComplete",
|
|
554
|
+
},
|
|
555
|
+
stress_relief: {
|
|
556
|
+
// "Low pressure movement"
|
|
557
|
+
foundation: "goalPhaseHint.stressRelief.foundation.lowPressureMovement",
|
|
558
|
+
// "Rhythm and routine develop"
|
|
559
|
+
momentum: "goalPhaseHint.stressRelief.momentum.rhythmAndRoutineDevelop",
|
|
560
|
+
// "Endorphin peak"
|
|
561
|
+
push: "goalPhaseHint.stressRelief.push.endorphinPeak",
|
|
562
|
+
// "Sustained stress release"
|
|
563
|
+
peak: "goalPhaseHint.stressRelief.peak.sustainedStressRelease",
|
|
564
|
+
},
|
|
565
|
+
rehabilitation: {
|
|
566
|
+
// "Safe mobility work only"
|
|
567
|
+
foundation: "goalPhaseHint.rehabilitation.foundation.safeMobilityWorkOnly",
|
|
568
|
+
// "Strength carefully reintroduced"
|
|
569
|
+
momentum: "goalPhaseHint.rehabilitation.momentum.strengthCarefullyReintroduced",
|
|
570
|
+
// "Full movement patterns restored"
|
|
571
|
+
push: "goalPhaseHint.rehabilitation.push.fullMovementPatternsRestored",
|
|
572
|
+
// "Back to full function"
|
|
573
|
+
peak: "goalPhaseHint.rehabilitation.peak.backToFullFunction",
|
|
574
|
+
},
|
|
575
|
+
core_strength: {
|
|
576
|
+
// "Core activation patterns"
|
|
577
|
+
foundation: "goalPhaseHint.coreStrength.foundation.coreActivationPatterns",
|
|
578
|
+
// "Volume and difficulty rise"
|
|
579
|
+
momentum: "goalPhaseHint.coreStrength.momentum.volumeAndDifficultyRise",
|
|
580
|
+
// "Heavy compound core work"
|
|
581
|
+
push: "goalPhaseHint.coreStrength.push.heavyCompoundCoreWork",
|
|
582
|
+
// "Maximum core output"
|
|
583
|
+
peak: "goalPhaseHint.coreStrength.peak.maximumCoreOutput",
|
|
584
|
+
},
|
|
585
|
+
mobility_flexibility: {
|
|
586
|
+
// "Daily mobility habit"
|
|
587
|
+
foundation: "goalPhaseHint.mobilityFlexibility.foundation.dailyMobilityHabit",
|
|
588
|
+
// "Range of motion grows"
|
|
589
|
+
momentum: "goalPhaseHint.mobilityFlexibility.momentum.rangeOfMotionGrows",
|
|
590
|
+
// "Full body flexibility"
|
|
591
|
+
push: "goalPhaseHint.mobilityFlexibility.push.fullBodyFlexibility",
|
|
592
|
+
// "Elite movement quality"
|
|
593
|
+
peak: "goalPhaseHint.mobilityFlexibility.peak.eliteMovementQuality",
|
|
594
|
+
},
|
|
595
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
// shared/src/types/goalFeature/index.ts
|
|
18
|
+
__exportStar(require("./goalJourney"), exports);
|
|
19
|
+
__exportStar(require("./utilGoal"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { TMuscleFatigueResult } from "../../utils";
|
|
2
|
+
import { TSessionIntent } from "./goalJourney";
|
|
3
|
+
import { TGoalContext, TGoalProfile, TIntentRecommendation } from "./TApiGoalContextRes";
|
|
4
|
+
export declare function resolveGoalContext(goalProfile: TGoalProfile, recentSessions: {
|
|
5
|
+
intentId: TSessionIntent | undefined;
|
|
6
|
+
createdAt: string;
|
|
7
|
+
}[], now?: Date): TGoalContext | null;
|
|
8
|
+
/**
|
|
9
|
+
* Recommend the next session intent.
|
|
10
|
+
*
|
|
11
|
+
* Decision pipeline (strict priority):
|
|
12
|
+
* 1. GLOBAL RECOVERY avgFatigue > 72 → "mobility"
|
|
13
|
+
* 2. RETURNING USER gap >= 7 days → first non-rest slot
|
|
14
|
+
* 3. GAP BRIDGE gap 3-7 days → most overdue slot
|
|
15
|
+
* 4. STRUCTURE FOLLOW gap < 3 days → next slot (circular)
|
|
16
|
+
* 5. MUSCLE OVERRIDE cluster fatigue > 65 → highest-readiness alt
|
|
17
|
+
*
|
|
18
|
+
* Output is always a valid TWorkoutIntent.
|
|
19
|
+
* Never outputs: "rest", "arms", "back", "unstructured".
|
|
20
|
+
* rationale is an i18n key — resolve via t() on the FE.
|
|
21
|
+
*/
|
|
22
|
+
export declare function recommendNextIntent(fatigue: TMuscleFatigueResult, goalContext: TGoalContext): TIntentRecommendation;
|