hevy-shared 1.0.795 → 1.0.797

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.
@@ -21,8 +21,9 @@ export interface ExerciseSelectionContext {
21
21
  routineUsedExerciseIds?: Set<string>;
22
22
  excludedExerciseIds?: Set<string>;
23
23
  }
24
- export interface ExerciseSelectionParams {
25
- sortedExercises: Record<MuscleGroup, HevyTrainerLibraryExercise[]>;
24
+ export interface ExerciseSelectionParams<T extends HevyTrainerLibraryExercise> {
25
+ sortedExercises: Record<MuscleGroup, T[]>;
26
+ handPickedExercises?: T[];
26
27
  criteria: ExerciseSelectionCriteria;
27
28
  context: ExerciseSelectionContext;
28
29
  }
@@ -137,9 +138,7 @@ export declare const getPrioritySortedExercises: <T extends HevyTrainerLibraryEx
137
138
  /**
138
139
  * Selects the best exercise for a given prescription using a multi-pass strategy
139
140
  */
140
- export declare const pickExerciseForPrescription: <T extends HevyTrainerLibraryExercise>(params: ExerciseSelectionParams & {
141
- sortedExercises: Record<MuscleGroup, T[]>;
142
- }) => T | undefined;
141
+ export declare const pickExerciseForPrescription: <T extends HevyTrainerLibraryExercise>(params: ExerciseSelectionParams<T>) => T | undefined;
143
142
  export type HevyTrainerLibraryExercise = Pick<LibraryExercise, 'id' | 'title' | 'priority' | 'muscle_group' | 'other_muscles' | 'exercise_type' | 'equipment_category' | 'category' | 'level' | 'goal'>;
144
143
  export interface ExercisePrescriptionError {
145
144
  type: 'exercise_not_found';
@@ -219,8 +219,10 @@ const findAlternativeIsolationExercise = (exercises, criteria, context) => {
219
219
  * Selects the best exercise for a given prescription using a multi-pass strategy
220
220
  */
221
221
  const pickExerciseForPrescription = (params) => {
222
- const { sortedExercises, criteria, context } = params;
223
- const exercises = sortedExercises[criteria.muscleGroup];
222
+ const { sortedExercises, handPickedExercises, criteria, context } = params;
223
+ const exercises = handPickedExercises
224
+ ? [...handPickedExercises, ...sortedExercises[criteria.muscleGroup]]
225
+ : sortedExercises[criteria.muscleGroup];
224
226
  // Pass 1: Find exact match not used in program
225
227
  const programContext = {
226
228
  programUsedExerciseIds: context.programUsedExerciseIds,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "hevy-shared",
3
- "version": "1.0.795",
3
+ "version": "1.0.797",
4
4
  "description": "",
5
5
  "main": "built/index.js",
6
6
  "types": "built/index.d.ts",