@trainheroic-unofficial/coach-mcp 3.4.0 → 3.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/server.mjs +30 -3
- package/package.json +3 -3
package/dist/server.mjs
CHANGED
|
@@ -244,6 +244,10 @@ z.object({
|
|
|
244
244
|
notes: z.string().optional(),
|
|
245
245
|
rpe: z.number().int().min(1).max(10).optional()
|
|
246
246
|
}).refine((v) => v.notes !== void 0 || v.rpe !== void 0, { message: "Provide notes and/or rpe" });
|
|
247
|
+
z.object({
|
|
248
|
+
savedWorkoutSetExerciseId: idArgSchema,
|
|
249
|
+
notes: z.string()
|
|
250
|
+
});
|
|
247
251
|
const presentedNullNumber = z.number().nullable();
|
|
248
252
|
const presentedNullString = z.string().nullable();
|
|
249
253
|
/** Flattened exercise within a presented workout: prescriptions, logged results, units. */
|
|
@@ -251,6 +255,7 @@ const athleteWorkoutExerciseSchema = z.object({
|
|
|
251
255
|
exerciseId: presentedNullNumber,
|
|
252
256
|
title: z.string(),
|
|
253
257
|
instruction: presentedNullString,
|
|
258
|
+
notes: presentedNullString,
|
|
254
259
|
units: z.array(presentedNullString),
|
|
255
260
|
prescribed: z.array(z.string()),
|
|
256
261
|
performed: z.array(z.string())
|
|
@@ -359,6 +364,7 @@ const rosterActivityOutputSchema = z.array(rosterActivityRowSchema);
|
|
|
359
364
|
const presentedExerciseSessionSchema = z.object({
|
|
360
365
|
date: z.string(),
|
|
361
366
|
abr: presentedNullString,
|
|
367
|
+
notes: presentedNullString,
|
|
362
368
|
estimated1RM: presentedNullNumber,
|
|
363
369
|
sets: z.array(z.object({
|
|
364
370
|
setNumber: z.number(),
|
|
@@ -513,6 +519,7 @@ const logSetTargetOutputSchema = z.object({
|
|
|
513
519
|
savedWorkoutSetExerciseId: z.number(),
|
|
514
520
|
title: z.string(),
|
|
515
521
|
units: z.array(nullableString),
|
|
522
|
+
notes: nullableString,
|
|
516
523
|
prescribed: z.array(z.string()),
|
|
517
524
|
performed: z.array(z.string())
|
|
518
525
|
}))
|
|
@@ -587,6 +594,10 @@ z.object({
|
|
|
587
594
|
notes: z.string(),
|
|
588
595
|
rpe: nullableNumber
|
|
589
596
|
});
|
|
597
|
+
z.object({
|
|
598
|
+
savedWorkoutSetExerciseId: z.number(),
|
|
599
|
+
notes: z.string()
|
|
600
|
+
});
|
|
590
601
|
const workoutReadExerciseOutputSchema = z.object({
|
|
591
602
|
order: z.number(),
|
|
592
603
|
title: z.string(),
|
|
@@ -1529,6 +1540,16 @@ function performedSlotsByExerciseId(sets) {
|
|
|
1529
1540
|
}
|
|
1530
1541
|
return map;
|
|
1531
1542
|
}
|
|
1543
|
+
/** Per-exercise athlete notes keyed by the prescription template id (`workout_set_exercise_id`). */
|
|
1544
|
+
function notesByTemplateId(sets) {
|
|
1545
|
+
const map = /* @__PURE__ */ new Map();
|
|
1546
|
+
for (const { exercises } of sets) for (const ex of exercises) {
|
|
1547
|
+
const id = coerceInt(ex.workout_set_exercise_id);
|
|
1548
|
+
const notes = str$1(ex.notes);
|
|
1549
|
+
if (id !== null && notes !== null) map.set(id, notes);
|
|
1550
|
+
}
|
|
1551
|
+
return map;
|
|
1552
|
+
}
|
|
1532
1553
|
/** Align an exercise's prescribed slots with the slots the athlete logged, per set index. */
|
|
1533
1554
|
function mergeExercise(prescribed, performed, meta) {
|
|
1534
1555
|
const indices = [.../* @__PURE__ */ new Set([...prescribed.keys(), ...performed.keys()])].sort((a, b) => a - b);
|
|
@@ -1542,7 +1563,7 @@ function mergeExercise(prescribed, performed, meta) {
|
|
|
1542
1563
|
};
|
|
1543
1564
|
}
|
|
1544
1565
|
/** A prescription block, each exercise aligned with the slots the athlete logged against it. */
|
|
1545
|
-
function mergePrescriptionBlock(set, performedById) {
|
|
1566
|
+
function mergePrescriptionBlock(set, performedById, notesById) {
|
|
1546
1567
|
const exercises = Array.isArray(set.workoutSetExercises) ? set.workoutSetExercises : [];
|
|
1547
1568
|
return {
|
|
1548
1569
|
order: coerceInt(set.order) ?? 0,
|
|
@@ -1556,6 +1577,7 @@ function mergePrescriptionBlock(set, performedById) {
|
|
|
1556
1577
|
exerciseId: coerceInt(ex.exercise_id),
|
|
1557
1578
|
title: typeof ex.title === "string" ? ex.title : "",
|
|
1558
1579
|
instruction: str$1(ex.instruction),
|
|
1580
|
+
notes: id !== null ? notesById.get(id) ?? null : null,
|
|
1559
1581
|
units: exerciseUnits(ex.param_1_type, ex.param_2_type)
|
|
1560
1582
|
});
|
|
1561
1583
|
})
|
|
@@ -1572,6 +1594,7 @@ function mergeSavedBlock(set, exercises) {
|
|
|
1572
1594
|
exerciseId: coerceInt(ex.exercise_id),
|
|
1573
1595
|
title: typeof ex.exercise_title === "string" ? ex.exercise_title : "",
|
|
1574
1596
|
instruction: str$1(ex.instruction),
|
|
1597
|
+
notes: str$1(ex.notes),
|
|
1575
1598
|
units: exerciseUnits(ex.param_1_type, ex.param_2_type)
|
|
1576
1599
|
}))
|
|
1577
1600
|
};
|
|
@@ -1590,7 +1613,8 @@ function mergeAthleteWorkout(raw) {
|
|
|
1590
1613
|
const prescriptionSets = (Array.isArray(workout.workoutSets) ? workout.workoutSets : []).filter(isRecord);
|
|
1591
1614
|
const logged = savedSets(saved);
|
|
1592
1615
|
const performedById = performedSlotsByExerciseId(logged);
|
|
1593
|
-
const
|
|
1616
|
+
const notesById = notesByTemplateId(logged);
|
|
1617
|
+
const blocks = prescriptionSets.map((s) => mergePrescriptionBlock(s, performedById, notesById)).sort((a, b) => a.order - b.order);
|
|
1594
1618
|
const prescribedIds = /* @__PURE__ */ new Set();
|
|
1595
1619
|
for (const s of prescriptionSets) {
|
|
1596
1620
|
const exs = Array.isArray(s.workoutSetExercises) ? s.workoutSetExercises : [];
|
|
@@ -1636,6 +1660,7 @@ function toStringExercise(ex) {
|
|
|
1636
1660
|
exerciseId: ex.exerciseId,
|
|
1637
1661
|
title: ex.title,
|
|
1638
1662
|
instruction: ex.instruction,
|
|
1663
|
+
notes: ex.notes,
|
|
1639
1664
|
units: ex.units,
|
|
1640
1665
|
prescribed: sideStrings(ex.sets, (s) => s.prescribed),
|
|
1641
1666
|
performed: sideStrings(ex.sets, (s) => s.performed)
|
|
@@ -1730,6 +1755,7 @@ function presentLogTargets(list) {
|
|
|
1730
1755
|
savedWorkoutSetExerciseId: id,
|
|
1731
1756
|
title: exerciseTitle(ex),
|
|
1732
1757
|
units: exerciseUnits(ex.param_1_type, ex.param_2_type),
|
|
1758
|
+
notes: str$1(ex.notes),
|
|
1733
1759
|
prescribed: prescribedStrings(ex),
|
|
1734
1760
|
performed: performedStrings(ex)
|
|
1735
1761
|
};
|
|
@@ -1810,6 +1836,7 @@ function presentExerciseHistory(detail) {
|
|
|
1810
1836
|
sessions: (detail.history ?? []).map((h) => ({
|
|
1811
1837
|
date: h.dateCompleted,
|
|
1812
1838
|
abr: h.abr ?? null,
|
|
1839
|
+
notes: str$1(h.notes),
|
|
1813
1840
|
estimated1RM: h.bestEstimated1RM ?? null,
|
|
1814
1841
|
sets: (h.sets ?? []).map((s) => ({
|
|
1815
1842
|
setNumber: s.setNumber,
|
|
@@ -4724,7 +4751,7 @@ var JsonFileLibraryCache = class {
|
|
|
4724
4751
|
};
|
|
4725
4752
|
//#endregion
|
|
4726
4753
|
//#region package.json
|
|
4727
|
-
var version = "3.
|
|
4754
|
+
var version = "3.5.0";
|
|
4728
4755
|
//#endregion
|
|
4729
4756
|
//#region src/server.ts
|
|
4730
4757
|
function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trainheroic-unofficial/coach-mcp",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@modelcontextprotocol/server": "2.0.0",
|
|
23
23
|
"zod": "^4.4.3",
|
|
24
|
-
"@trainheroic-unofficial/core": "3.
|
|
25
|
-
"@trainheroic-unofficial/js": "3.
|
|
24
|
+
"@trainheroic-unofficial/core": "3.5.0",
|
|
25
|
+
"@trainheroic-unofficial/js": "3.5.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^26.3.0",
|