@trainheroic-unofficial/athlete-mcp 2.0.2 → 2.1.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 +22 -15
- package/package.json +3 -3
package/dist/server.mjs
CHANGED
|
@@ -787,7 +787,7 @@ async function getJson(client, path, label) {
|
|
|
787
787
|
if (!res.ok) throw new Error(`${label} failed (HTTP ${res.status}).`);
|
|
788
788
|
return res.data;
|
|
789
789
|
}
|
|
790
|
-
async function getArray(client, path, label) {
|
|
790
|
+
async function getArray$1(client, path, label) {
|
|
791
791
|
const res = await client.request("GET", path);
|
|
792
792
|
if (!res.ok || !Array.isArray(res.data)) throw new Error(`${label} failed (HTTP ${res.status}).`);
|
|
793
793
|
return res.data;
|
|
@@ -803,10 +803,10 @@ function fetchAthletePrefs(client) {
|
|
|
803
803
|
return getJson(client, "/1.0/athlete/prefs", "athlete prefs");
|
|
804
804
|
}
|
|
805
805
|
function fetchWorkingMaxes(client) {
|
|
806
|
-
return getArray(client, "/2.0/athlete/workingMax", "athlete working maxes");
|
|
806
|
+
return getArray$1(client, "/2.0/athlete/workingMax", "athlete working maxes");
|
|
807
807
|
}
|
|
808
808
|
function fetchExerciseHistoryList(client) {
|
|
809
|
-
return getArray(client, "/v5/users/exercises/history", "athlete exercise history list");
|
|
809
|
+
return getArray$1(client, "/v5/users/exercises/history", "athlete exercise history list");
|
|
810
810
|
}
|
|
811
811
|
/** Free-text search over the athlete's logged exercises (FTS replacement via rankSearch). */
|
|
812
812
|
async function searchExerciseHistory(client, query, limit = 20) {
|
|
@@ -816,7 +816,7 @@ function fetchExerciseHistoryDetail(client, exerciseId, userId) {
|
|
|
816
816
|
return getJson(client, `/v5/exercises/${exerciseId}/history?userId=${userId}`, "athlete exercise history");
|
|
817
817
|
}
|
|
818
818
|
function fetchPersonalRecords(client, exerciseId) {
|
|
819
|
-
return getArray(client, `/v5/exercises/${exerciseId}/personalRecords`, "athlete personal records");
|
|
819
|
+
return getArray$1(client, `/v5/exercises/${exerciseId}/personalRecords`, "athlete personal records");
|
|
820
820
|
}
|
|
821
821
|
/** Last performance + PR for an exercise. `date` (YYYY-MM-DD) is required by the API. */
|
|
822
822
|
function fetchExerciseStats(client, exerciseId, userId, date) {
|
|
@@ -824,16 +824,7 @@ function fetchExerciseStats(client, exerciseId, userId, date) {
|
|
|
824
824
|
}
|
|
825
825
|
/** Scheduled + completed workouts in an inclusive YYYY-MM-DD window. */
|
|
826
826
|
function fetchAthleteWorkouts(client, startDate, endDate) {
|
|
827
|
-
return getArray(client, `/3.0/athlete/programworkout/range?startDate=${startDate}&endDate=${endDate}`, "athlete workouts");
|
|
828
|
-
}
|
|
829
|
-
/**
|
|
830
|
-
* A coach's view of a roster athlete's scheduled + completed workouts in an inclusive
|
|
831
|
-
* YYYY-MM-DD window (`/3.0/coach/athlete/programworkout/range/{athleteId}`). Returns the same
|
|
832
|
-
* `ProgramWorkout[]` shape as `fetchAthleteWorkouts`, so the same presenters and
|
|
833
|
-
* `findSavedWorkoutSet` apply — it just reads another athlete's data through the coach surface.
|
|
834
|
-
*/
|
|
835
|
-
function fetchCoachAthleteWorkouts(client, athleteId, startDate, endDate) {
|
|
836
|
-
return getArray(client, `/3.0/coach/athlete/programworkout/range/${athleteId}?startDate=${startDate}&endDate=${endDate}`, "coach athlete workouts");
|
|
827
|
+
return getArray$1(client, `/3.0/athlete/programworkout/range?startDate=${startDate}&endDate=${endDate}`, "athlete workouts");
|
|
837
828
|
}
|
|
838
829
|
function fetchLeaderboard(client, workoutId, opts = {}) {
|
|
839
830
|
const qs = new URLSearchParams();
|
|
@@ -1186,6 +1177,22 @@ function presentExerciseHistory(detail) {
|
|
|
1186
1177
|
};
|
|
1187
1178
|
}
|
|
1188
1179
|
//#endregion
|
|
1180
|
+
//#region ../js/src/coach-athlete-calendar.ts
|
|
1181
|
+
async function getArray(client, path, label) {
|
|
1182
|
+
const res = await client.request("GET", path);
|
|
1183
|
+
if (!res.ok || !Array.isArray(res.data)) throw new Error(`${label} failed (HTTP ${res.status}).`);
|
|
1184
|
+
return res.data;
|
|
1185
|
+
}
|
|
1186
|
+
/**
|
|
1187
|
+
* A coach's view of a roster athlete's scheduled + completed workouts in an inclusive
|
|
1188
|
+
* YYYY-MM-DD window (`/3.0/coach/athlete/programworkout/range/{athleteId}`). Returns the same
|
|
1189
|
+
* `ProgramWorkout[]` shape as `fetchAthleteWorkouts`, so the same presenters and
|
|
1190
|
+
* `findSavedWorkoutSet` apply — it just reads another athlete's data through the coach surface.
|
|
1191
|
+
*/
|
|
1192
|
+
function fetchCoachAthleteWorkouts(client, athleteId, startDate, endDate) {
|
|
1193
|
+
return getArray(client, `/3.0/coach/athlete/programworkout/range/${athleteId}?startDate=${startDate}&endDate=${endDate}`, "coach athlete workouts");
|
|
1194
|
+
}
|
|
1195
|
+
//#endregion
|
|
1189
1196
|
//#region ../js/src/exercise-set-payload.ts
|
|
1190
1197
|
function slotData(exercise, key) {
|
|
1191
1198
|
const value = exercise?.[key];
|
|
@@ -2108,7 +2115,7 @@ function registerAthleteTrainingTools(server, ctx) {
|
|
|
2108
2115
|
}
|
|
2109
2116
|
//#endregion
|
|
2110
2117
|
//#region package.json
|
|
2111
|
-
var version = "2.0
|
|
2118
|
+
var version = "2.1.0";
|
|
2112
2119
|
//#endregion
|
|
2113
2120
|
//#region src/server.ts
|
|
2114
2121
|
function main() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trainheroic-unofficial/athlete-mcp",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.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": "2.0
|
|
25
|
-
"@trainheroic-unofficial/js": "2.0
|
|
24
|
+
"@trainheroic-unofficial/core": "2.1.0",
|
|
25
|
+
"@trainheroic-unofficial/js": "2.1.0"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@types/node": "^26.1.2",
|