@dgpholdings/greatoak-shared 1.2.68 → 1.2.70
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.
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export declare const AI_FITNESS_GOALS: readonly ["strength", "hypertrophy", "fat_loss", "endurance", "mobility", "rehabilitation", "sport_performance", "general_fitness", "core_strength"];
|
|
2
2
|
export type TAiFitnessGoal = (typeof AI_FITNESS_GOALS)[number];
|
|
3
|
-
export declare const AI_FITNESS_GOAL_LABELS: Record<TAiFitnessGoal, string>;
|
|
4
3
|
export declare const AI_EQUIPMENT_TYPES: readonly ["none", "dumbbell", "barbell", "resistance_band", "cable_machine", "standard_machine", "suspension_trainer", "pull_up_bar", "bench", "kettlebell", "niche_machine", "exercise_ball", "ez_bar", "cardio_machine", "smith_machine", "weight_plate", "jump_rope", "battle_ropes", "medicine_ball", "ab_wheel", "plyo_box", "parallel_bars"];
|
|
5
4
|
export type TAiEquipmentType = (typeof AI_EQUIPMENT_TYPES)[number];
|
|
6
5
|
export declare const AI_HOME_EQUIPMENT: TAiEquipmentType[];
|
|
@@ -13,7 +12,7 @@ export declare const AI_CORE_PATTERNS: TAiMovementPattern[];
|
|
|
13
12
|
export declare const AI_WORKOUT_PLACEMENTS: readonly ["primary_compound", "secondary_compound", "accessory", "finisher", "warmup", "cooldown"];
|
|
14
13
|
export type TAiWorkoutPlacement = (typeof AI_WORKOUT_PLACEMENTS)[number];
|
|
15
14
|
export declare const AI_SESSION_ORDER: TAiWorkoutPlacement[];
|
|
16
|
-
|
|
15
|
+
declare const AI_DIFFICULTY_LEVELS: readonly ["beginner", "intermediate", "advanced", "expert"];
|
|
17
16
|
export type TAiDifficultyLevel = (typeof AI_DIFFICULTY_LEVELS)[number];
|
|
18
17
|
export declare const AI_FITNESS_LEVELS: readonly ["beginner", "intermediate", "advanced"];
|
|
19
18
|
export type TAiFitnessLevel = (typeof AI_FITNESS_LEVELS)[number];
|
|
@@ -28,14 +27,11 @@ export declare const AI_MET_THRESHOLDS: {
|
|
|
28
27
|
};
|
|
29
28
|
export declare const AI_BODY_AREAS: readonly ["lower back", "upper back", "shoulders", "neck", "elbows", "wrists", "hips", "hip flexors", "knees", "ankles", "hamstrings", "achilles tendon", "forearms", "groin", "calf muscles", "chest", "core"];
|
|
30
29
|
export type TAiBodyArea = (typeof AI_BODY_AREAS)[number];
|
|
31
|
-
export declare const AI_BODY_AREA_LABELS: Record<TAiBodyArea, string>;
|
|
32
30
|
export declare const AI_BODY_ISSUE_TYPES: readonly ["general_soreness", "joint_pain", "old_injury", "diagnosed_condition"];
|
|
33
31
|
export type TAiBodyIssueType = (typeof AI_BODY_ISSUE_TYPES)[number];
|
|
34
|
-
export declare const AI_BODY_ISSUE_LABELS: Record<TAiBodyIssueType, string>;
|
|
35
32
|
export declare const AI_POPULAR_THRESHOLD = 75;
|
|
36
33
|
export declare const AI_INJURY_SEVERITY: readonly ["mild", "moderate", "severe", "acute_broken"];
|
|
37
34
|
export type TAiInjurySeverity = (typeof AI_INJURY_SEVERITY)[number];
|
|
38
|
-
export declare const AI_INJURY_SEVERITY_LABELS: Record<TAiInjurySeverity, string>;
|
|
39
35
|
export declare const AI_INJURY_DURATION: readonly ["1_5_days", "1_4_weeks", "1_3_months", "3_6_months", "6_plus_months"];
|
|
40
36
|
export type TAiInjuryDuration = (typeof AI_INJURY_DURATION)[number];
|
|
41
37
|
export declare const AI_INJURY_DURATION_LABELS: Record<TAiInjuryDuration, string>;
|
|
@@ -61,8 +57,8 @@ export interface TAiUserProfile {
|
|
|
61
57
|
onboardingCompletedAt: string;
|
|
62
58
|
onboardingVersion: string;
|
|
63
59
|
}
|
|
64
|
-
export declare const
|
|
65
|
-
export type
|
|
66
|
-
export declare const AI_SLEEP_QUALITY_LABELS: Record<TAiSleepQuality, string>;
|
|
60
|
+
export declare const AI_ENERGY_LEVEL_OPTIONS: readonly ["fresh", "normal", "tired", "exhausted"];
|
|
61
|
+
export type TAiEnergyLevel = (typeof AI_ENERGY_LEVEL_OPTIONS)[number];
|
|
67
62
|
export declare const AI_INTENT_CHIPS: readonly ["leg-day", "upper-body", "full-body", "push-day", "pull-day", "cardio-focused", "back-and-biceps", "chest-and-triceps", "legs-and-glutes", "core-and-abs", "mobility-and-flexibility", "Surprise me"];
|
|
68
63
|
export type TAiIntentChip = (typeof AI_INTENT_CHIPS)[number];
|
|
64
|
+
export {};
|
|
@@ -7,8 +7,7 @@
|
|
|
7
7
|
// Verified against 701 active exercises from exercises-v2_3_PURE.json
|
|
8
8
|
// Do not add values here without also ensuring they exist in the data.
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.AI_INTENT_CHIPS = exports.
|
|
11
|
-
// ── FITNESS GOALS ────────────────────────────────────────────────────────────
|
|
10
|
+
exports.AI_INTENT_CHIPS = exports.AI_ENERGY_LEVEL_OPTIONS = exports.AI_INJURY_DURATION_LABELS = exports.AI_INJURY_DURATION = exports.AI_INJURY_SEVERITY = exports.AI_POPULAR_THRESHOLD = exports.AI_BODY_ISSUE_TYPES = exports.AI_BODY_AREAS = exports.AI_MET_THRESHOLDS = exports.AI_SLEEP_TO_MAX_CNS = exports.AI_INTENSITY_LEVELS = exports.AI_DIFFICULTY_FILTER = exports.AI_FITNESS_LEVELS = exports.AI_SESSION_ORDER = exports.AI_WORKOUT_PLACEMENTS = exports.AI_CORE_PATTERNS = exports.AI_LEG_PATTERNS = exports.AI_PULL_PATTERNS = exports.AI_PUSH_PATTERNS = exports.AI_MOVEMENT_PATTERNS = exports.AI_HOME_EQUIPMENT = exports.AI_EQUIPMENT_TYPES = exports.AI_FITNESS_GOALS = void 0;
|
|
12
11
|
exports.AI_FITNESS_GOALS = [
|
|
13
12
|
"strength",
|
|
14
13
|
"hypertrophy",
|
|
@@ -20,18 +19,6 @@ exports.AI_FITNESS_GOALS = [
|
|
|
20
19
|
"general_fitness",
|
|
21
20
|
"core_strength",
|
|
22
21
|
];
|
|
23
|
-
exports.AI_FITNESS_GOAL_LABELS = {
|
|
24
|
-
strength: "Get stronger",
|
|
25
|
-
hypertrophy: "Build muscle",
|
|
26
|
-
fat_loss: "Lose fat",
|
|
27
|
-
endurance: "Improve endurance",
|
|
28
|
-
mobility: "Improve flexibility & mobility",
|
|
29
|
-
rehabilitation: "Recover from injury",
|
|
30
|
-
sport_performance: "Sport performance",
|
|
31
|
-
general_fitness: "General fitness",
|
|
32
|
-
core_strength: "Build core strength",
|
|
33
|
-
};
|
|
34
|
-
// ── EQUIPMENT TYPES ──────────────────────────────────────────────────────────
|
|
35
22
|
exports.AI_EQUIPMENT_TYPES = [
|
|
36
23
|
"none",
|
|
37
24
|
"dumbbell",
|
|
@@ -66,7 +53,6 @@ exports.AI_HOME_EQUIPMENT = [
|
|
|
66
53
|
"exercise_ball",
|
|
67
54
|
"jump_rope",
|
|
68
55
|
];
|
|
69
|
-
// ── MOVEMENT PATTERNS ────────────────────────────────────────────────────────
|
|
70
56
|
exports.AI_MOVEMENT_PATTERNS = [
|
|
71
57
|
"push_horizontal",
|
|
72
58
|
"push_vertical",
|
|
@@ -101,7 +87,6 @@ exports.AI_CORE_PATTERNS = [
|
|
|
101
87
|
"core_stability",
|
|
102
88
|
"rotation",
|
|
103
89
|
];
|
|
104
|
-
// ── WORKOUT PLACEMENT ────────────────────────────────────────────────────────
|
|
105
90
|
exports.AI_WORKOUT_PLACEMENTS = [
|
|
106
91
|
"primary_compound",
|
|
107
92
|
"secondary_compound",
|
|
@@ -118,8 +103,7 @@ exports.AI_SESSION_ORDER = [
|
|
|
118
103
|
"finisher",
|
|
119
104
|
"cooldown",
|
|
120
105
|
];
|
|
121
|
-
|
|
122
|
-
exports.AI_DIFFICULTY_LEVELS = [
|
|
106
|
+
const AI_DIFFICULTY_LEVELS = [
|
|
123
107
|
"beginner",
|
|
124
108
|
"intermediate",
|
|
125
109
|
"advanced",
|
|
@@ -135,20 +119,17 @@ exports.AI_DIFFICULTY_FILTER = {
|
|
|
135
119
|
intermediate: ["beginner", "intermediate"],
|
|
136
120
|
advanced: ["beginner", "intermediate", "advanced", "expert"],
|
|
137
121
|
};
|
|
138
|
-
// ── INTENSITY LEVELS ─────────────────────────────────────────────────────────
|
|
139
122
|
exports.AI_INTENSITY_LEVELS = ["low", "moderate", "high"];
|
|
140
123
|
exports.AI_SLEEP_TO_MAX_CNS = {
|
|
141
124
|
good: "high",
|
|
142
125
|
disturbed: "moderate",
|
|
143
126
|
poor: "low",
|
|
144
127
|
};
|
|
145
|
-
// ── MET VALUES ───────────────────────────────────────────────────────────────
|
|
146
128
|
exports.AI_MET_THRESHOLDS = {
|
|
147
129
|
low: 3,
|
|
148
130
|
moderate: 6,
|
|
149
131
|
high: 6,
|
|
150
132
|
};
|
|
151
|
-
// ── BODY AREAS ───────────────────────────────────────────────────────────────
|
|
152
133
|
exports.AI_BODY_AREAS = [
|
|
153
134
|
"lower back",
|
|
154
135
|
"upper back",
|
|
@@ -168,54 +149,19 @@ exports.AI_BODY_AREAS = [
|
|
|
168
149
|
"chest",
|
|
169
150
|
"core",
|
|
170
151
|
];
|
|
171
|
-
exports.AI_BODY_AREA_LABELS = {
|
|
172
|
-
"lower back": "Lower back",
|
|
173
|
-
"upper back": "Upper back",
|
|
174
|
-
shoulders: "Shoulder",
|
|
175
|
-
neck: "Neck",
|
|
176
|
-
elbows: "Elbow",
|
|
177
|
-
wrists: "Wrist",
|
|
178
|
-
hips: "Hip",
|
|
179
|
-
"hip flexors": "Hip flexor",
|
|
180
|
-
knees: "Knee",
|
|
181
|
-
ankles: "Ankle",
|
|
182
|
-
hamstrings: "Hamstring",
|
|
183
|
-
"achilles tendon": "Achilles / calf",
|
|
184
|
-
forearms: "Forearm",
|
|
185
|
-
groin: "Groin",
|
|
186
|
-
"calf muscles": "Calf",
|
|
187
|
-
chest: "Chest",
|
|
188
|
-
core: "Core / abdomen",
|
|
189
|
-
};
|
|
190
|
-
// ── BODY ISSUE TYPES ─────────────────────────────────────────────────────────
|
|
191
152
|
exports.AI_BODY_ISSUE_TYPES = [
|
|
192
153
|
"general_soreness",
|
|
193
154
|
"joint_pain",
|
|
194
155
|
"old_injury",
|
|
195
156
|
"diagnosed_condition",
|
|
196
157
|
];
|
|
197
|
-
exports.AI_BODY_ISSUE_LABELS = {
|
|
198
|
-
general_soreness: "General soreness or tightness",
|
|
199
|
-
joint_pain: "Joint pain or clicking",
|
|
200
|
-
old_injury: "Old / healed injury (just to note)",
|
|
201
|
-
diagnosed_condition: "Doctor-diagnosed condition",
|
|
202
|
-
};
|
|
203
|
-
// ── POPULARITY ───────────────────────────────────────────────────────────────
|
|
204
158
|
exports.AI_POPULAR_THRESHOLD = 75;
|
|
205
|
-
// ── INJURY SEVERITY / INTENSITY ────────────────────────────────────────────────
|
|
206
159
|
exports.AI_INJURY_SEVERITY = [
|
|
207
160
|
"mild",
|
|
208
161
|
"moderate",
|
|
209
162
|
"severe",
|
|
210
163
|
"acute_broken",
|
|
211
164
|
];
|
|
212
|
-
exports.AI_INJURY_SEVERITY_LABELS = {
|
|
213
|
-
mild: "Mild (Discomfort / Tightness)",
|
|
214
|
-
moderate: "Moderate (Painful but manageable)",
|
|
215
|
-
severe: "Severe (Sharp pain / Limited mobility)",
|
|
216
|
-
acute_broken: "Acute / Broken (Recent trauma or surgery)",
|
|
217
|
-
};
|
|
218
|
-
// ── INJURY DURATION / AGE ────────────────────────────────────────────────────
|
|
219
165
|
exports.AI_INJURY_DURATION = [
|
|
220
166
|
"1_5_days",
|
|
221
167
|
"1_4_weeks",
|
|
@@ -230,14 +176,12 @@ exports.AI_INJURY_DURATION_LABELS = {
|
|
|
230
176
|
"3_6_months": "3-6 months",
|
|
231
177
|
"6_plus_months": "6+ months (Chronic / Permanent)",
|
|
232
178
|
};
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
};
|
|
240
|
-
// ── USER INTENT CHIPS ────────────────────────────────────────────────────────
|
|
179
|
+
exports.AI_ENERGY_LEVEL_OPTIONS = [
|
|
180
|
+
"fresh",
|
|
181
|
+
"normal",
|
|
182
|
+
"tired",
|
|
183
|
+
"exhausted",
|
|
184
|
+
];
|
|
241
185
|
exports.AI_INTENT_CHIPS = [
|
|
242
186
|
"leg-day",
|
|
243
187
|
"upper-body",
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TAiEnergyLevel, TAiUserInjury } from "../constants/AiExerciseVocabulary";
|
|
2
2
|
import { TTemplate } from "./TApiTemplateData";
|
|
3
3
|
export type TApiAiQuickStartWorkoutReq = {
|
|
4
4
|
/**
|
|
5
5
|
* What the user wants to focus on today.
|
|
6
|
-
* e.g., "Leg day", "Upper body", "
|
|
6
|
+
* e.g., "Leg day", "Upper body", "I want 80% back 20% bicep" or "אני רוצה ליבה חזקה"
|
|
7
7
|
*/
|
|
8
|
-
|
|
8
|
+
intentText: string;
|
|
9
9
|
/**
|
|
10
|
-
* How the user
|
|
10
|
+
* How the user feels right now. Used by the AI to modulate volume and intensity.
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
energyLevel: TAiEnergyLevel;
|
|
13
13
|
/**
|
|
14
14
|
* Optional: How much time the user has for the workout.
|
|
15
15
|
* Helps the AI determine the number of exercises and sets.
|
|
@@ -20,7 +20,31 @@ export type TApiAiQuickStartWorkoutReq = {
|
|
|
20
20
|
* Crucial for correctly fetching "yesterday's" workout history from DynamoDB.
|
|
21
21
|
*/
|
|
22
22
|
timezone: string;
|
|
23
|
-
|
|
23
|
+
/**
|
|
24
|
+
* Whether the user intends to work out at home or at the gym today.
|
|
25
|
+
*/
|
|
26
|
+
workoutLocation: "home" | "gym";
|
|
27
|
+
/**
|
|
28
|
+
* The general time of day the user is working out.
|
|
29
|
+
* Can influence warm-up duration and intensity (e.g., morning stiffness vs. evening fatigue, Afternoon: (Peak Performance)).
|
|
30
|
+
*/
|
|
31
|
+
workoutTime: "morning" | "afternoon" | "evening" | "night";
|
|
32
|
+
};
|
|
33
|
+
export type TAiEnrichedContext = {
|
|
34
|
+
qdrantFilters: {
|
|
35
|
+
must: Record<string, any>[];
|
|
36
|
+
mustNot: Record<string, any>[];
|
|
37
|
+
};
|
|
38
|
+
aiContext: {
|
|
39
|
+
age: number;
|
|
40
|
+
gender: string;
|
|
41
|
+
fitnessLevel: string;
|
|
42
|
+
energyLevel: string;
|
|
43
|
+
fatigueMap: Record<string, any>;
|
|
44
|
+
activeInjuries: TAiUserInjury[];
|
|
45
|
+
avoidedAreas: string[];
|
|
46
|
+
yesterdaysExercises: string[];
|
|
47
|
+
};
|
|
24
48
|
};
|
|
25
49
|
export type TApiAiQuickStartWorkoutRes = {
|
|
26
50
|
status: 200;
|
|
@@ -32,6 +56,11 @@ export type TApiAiQuickStartWorkoutRes = {
|
|
|
32
56
|
plan: Extract<TTemplate, {
|
|
33
57
|
type: "ai-generated";
|
|
34
58
|
}>;
|
|
59
|
+
/**
|
|
60
|
+
* Debug / Transparency information indicating exactly what filters
|
|
61
|
+
* and context variables the backend fed into the semantic search and LLM.
|
|
62
|
+
*/
|
|
63
|
+
enrichedContext: TAiEnrichedContext;
|
|
35
64
|
} | {
|
|
36
65
|
status: 400 | 403 | 500;
|
|
37
66
|
state: "failed" | "unauthorized";
|
package/dist/types/TApiAuth.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { TAiFitnessGoal } from "../constants/AiExerciseVocabulary";
|
|
2
|
-
import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType, TActivityLevel } from "./TApiUser";
|
|
1
|
+
import type { TAiFitnessGoal, TAiBodyArea } from "../constants/AiExerciseVocabulary";
|
|
2
|
+
import { TAuthType, TGender, TProfessionalCategory, TUserMetric, TUserType, TActivityLevel, TInjuryInfo } from "./TApiUser";
|
|
3
3
|
export type TOnboardingData = {
|
|
4
4
|
userWeightKg: number;
|
|
5
5
|
dob: Date;
|
|
@@ -9,7 +9,9 @@ export type TOnboardingData = {
|
|
|
9
9
|
bodyFatPercentage: number;
|
|
10
10
|
fitnessGoals: TAiFitnessGoal[];
|
|
11
11
|
fitnessLevel: TActivityLevel;
|
|
12
|
-
|
|
12
|
+
avoidBodyAreas?: TAiBodyArea[];
|
|
13
|
+
injuryInfo?: TInjuryInfo;
|
|
14
|
+
gdprEssential?: boolean;
|
|
13
15
|
gdprAnalytics: boolean;
|
|
14
16
|
gdprMarketing: boolean;
|
|
15
17
|
userCode: string;
|