@trainheroic-unofficial/core 1.4.0 → 1.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/index.mjs +3 -12
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -637,7 +637,7 @@ function registerLogTool(server, ctx) {
|
|
|
637
637
|
}));
|
|
638
638
|
server.registerTool("athlete_log_set", {
|
|
639
639
|
title: "Log completed set results",
|
|
640
|
-
description: "Athlete-facing write: record entered results (reps/weight per set) for a saved workout set on a given day
|
|
640
|
+
description: "Athlete-facing write: record entered results (reps/weight per set) for a saved workout set on a given day. Writes to the athlete's (coach-visible) training log and shows in exercise history. Each set fills the next position in order; give a set a 1-based `slot` to place it at a specific position — e.g. log three top singles into positions 4-6 of an 8,5,3,1,1,1 ramp. A partial log records only the positions you send (plus any logged in an earlier call) and leaves the rest unlogged, so it does not mark untouched sets as performed. In a superset/circuit the block is marked done only once every exercise in it has logged results, so logging one exercise leaves its siblings untouched (the response's `setCompleted` reports whether the block was completed). Get savedWorkoutSetId + savedWorkoutSetExerciseId from athlete_workouts (raw:true). Requires confirmation (elicitation or confirm:true).",
|
|
641
641
|
inputSchema: {
|
|
642
642
|
...logSetArgsSchema.shape,
|
|
643
643
|
confirm: z.boolean().optional()
|
|
@@ -645,19 +645,10 @@ function registerLogTool(server, ctx) {
|
|
|
645
645
|
annotations: DESTRUCTIVE
|
|
646
646
|
}, ({ date, savedWorkoutSetId, results, confirm }, extra) => attempt(async () => {
|
|
647
647
|
if (!await confirmGate(server, extra.requestId, `Log results to saved workout set ${toId(savedWorkoutSetId)} on ${date}? This writes to your coach-visible training log.`, confirm)) return errorResult(NOT_CONFIRMED);
|
|
648
|
-
const mapped = results.map((r) => ({
|
|
649
|
-
savedWorkoutSetExerciseId: toId(r.savedWorkoutSetExerciseId),
|
|
650
|
-
sets: r.sets.map((s) => {
|
|
651
|
-
const slot = {};
|
|
652
|
-
if (s.param1 !== void 0) slot.param1 = s.param1;
|
|
653
|
-
if (s.param2 !== void 0) slot.param2 = s.param2;
|
|
654
|
-
return slot;
|
|
655
|
-
})
|
|
656
|
-
}));
|
|
657
648
|
return jsonResult(await logAthleteSet(ctx.client, {
|
|
658
649
|
date,
|
|
659
650
|
savedWorkoutSetId: toId(savedWorkoutSetId),
|
|
660
|
-
results:
|
|
651
|
+
results: toSetResults(results)
|
|
661
652
|
}));
|
|
662
653
|
}));
|
|
663
654
|
}
|
|
@@ -787,7 +778,7 @@ function registerAthleteLogTools(server, ctx) {
|
|
|
787
778
|
registerAthleteSavedWorkouts(server, ctx);
|
|
788
779
|
server.registerTool("log_athlete_set", {
|
|
789
780
|
title: "Log set results for a roster athlete",
|
|
790
|
-
description: "Coach-facing write: record entered results (reps/weight per set) for one of a roster athlete's saved workout sets on a given day
|
|
781
|
+
description: "Coach-facing write: record entered results (reps/weight per set) for one of a roster athlete's saved workout sets on a given day — the API equivalent of the app's \"Log for Athlete\". Writes to that athlete's training log and shows in their history. Each set fills the next position in order; give a set a 1-based `slot` to place it at a specific position. A partial log records only the positions you send (plus any logged earlier) and leaves the rest unlogged. In a superset/circuit the block is marked done only once every exercise in it has logged results (the response's `setCompleted` reports whether it was). Get athleteId from list_athletes; get savedWorkoutSetId + savedWorkoutSetExerciseId from athlete_saved_workouts for that athlete/day (its default view carries both — pass programId there if the athlete is on several programs). Seeded demo athletes are read-only and will fail; use a real (invited) athlete. Requires confirmation (elicitation or confirm:true).",
|
|
791
782
|
inputSchema: {
|
|
792
783
|
...coachLogSetArgsSchema.shape,
|
|
793
784
|
confirm: z.boolean().optional()
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trainheroic-unofficial/core",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.5.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -25,8 +25,8 @@
|
|
|
25
25
|
"@cfworker/json-schema": "^4.1.1",
|
|
26
26
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
27
27
|
"zod": "^4.4.3",
|
|
28
|
-
"@trainheroic-unofficial/dto": "1.
|
|
29
|
-
"@trainheroic-unofficial/js": "1.
|
|
28
|
+
"@trainheroic-unofficial/dto": "1.5.0",
|
|
29
|
+
"@trainheroic-unofficial/js": "1.5.0"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^26.0.0",
|