@trainheroic-unofficial/core 3.5.0 → 3.5.1
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 +12 -5
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { athleteExerciseCatalogOutputSchema, athleteExerciseNoteArgsSchema, athleteExerciseNoteOutputSchema, athleteInviteOutputSchema, athleteMainLiftPrsOutputSchema, athletePrefsSchema, athletePrescribeSetArgsSchema, athleteProfileOutputSchema, athleteSessionRemoveArgsSchema, athleteSessionRemovedOutputSchema, athleteWorkingMaxListSchema, athleteWorkoutNoteArgsSchema, athleteWorkoutNoteObject, athleteWorkoutNoteOutputSchema, athleteWorkoutsOutputSchema, blockSpecSchema, coachAthleteTrainingOutputSchema, coachLogSessionArgsSchema, coachLogSetArgsSchema, coachPrescribeSetArgsSchema, commentDraftSchema, dateString, exerciseCreateSchema, exerciseCreatedOutputSchema, exerciseDeletedOutputSchema, exerciseForgottenOutputSchema, exerciseGetOutputSchema, exerciseHistoryOutputSchema, exerciseResolveOutputSchema, exerciseStatsSchema, exerciseSwapOutputSchema, exerciseViewSchema, idArgSchema, logSessionArgsSchema, logSetArgsSchema, logTargetsOutputSchema, messageDeletedOutputSchema, messageDraftOutputSchema, messageSentOutputSchema, opaqueOutputSchema, parseWorkoutDate, personalRecordListSchema, personalWorkoutCreatedOutputSchema, programCreatedOutputSchema, programDeletedOutputSchema, removedSessionOutputSchema, rosterActivityOutputSchema, sessionLogOutputSchema, sessionTemplateCreateSchema, sessionTemplateCreatedOutputSchema, setLogOutputSchema, setPrescriptionOutputSchema, swapAthleteExerciseArgsSchema, teamPublishPatchObject, teamPublishPatchSchema, teamVolumeOutputSchema, toolOutputSchema, userSimpleSchema, workoutBuildOutputSchema, workoutPublishOutputSchema, workoutReadOutputSchema } from "@trainheroic-unofficial/dto";
|
|
2
2
|
import { acceptedContent, inputRequired, inputResponse } from "@modelcontextprotocol/server";
|
|
3
3
|
import { z } from "zod";
|
|
4
|
-
import { ANALYTICS_METRIC_KEYS, PROGRAM_KINDS, SESSION_TEMPLATES_LIST_PATH, addExercisesToWorkout, buildCommentPayload, buildSession, coerceInt, collectAdvisories, copySession, createPersonalWorkout, createProgram, createSessionTemplate, definedProps, deleteComment, deleteProgram, exerciseUnits, fetchAthleteCircuits, fetchAthleteMainLiftPRs, fetchAthletePrefs, fetchAthleteProfileSummary, fetchAthleteProgrammingPrograms, fetchAthleteUser, fetchAthleteWorkouts, fetchCoachAthleteCalendarSummary, fetchCoachAthleteWorkouts, fetchExerciseHistoryDetail, fetchExerciseHistoryList, fetchExerciseStats, fetchLeaderboard, fetchPersonalRecords, fetchRecentExercises, fetchRosterActivity, fetchRosterMainLiftPRs, fetchStreams, fetchTeamAthleteIds, fetchWorkingMaxes, inviteAthletes, isRecord, logAdHocSession, logAthleteSet, logForAthlete, logSessionForAthlete, prescribeAthleteSet, prescribeForAthlete, presentAthleteWorkouts, presentCoachAthleteTraining, presentExerciseHistory, presentLogTargets, publishSession, queryAnalytics, readLive, readSession, removePersonalWorkout, removeSession, resolveBuildProgramId, searchExerciseHistory, selectWorkouts, selectWorkoutsByProgram, sendComment, setAthleteExerciseNote, setAthleteWorkoutNote, summarizeAthleteWorkouts, swapAthleteExercise, teamPublishTarget, teamVolume, toSetResults, updateTeam, updateTeamPublishSettings } from "@trainheroic-unofficial/js";
|
|
4
|
+
import { ANALYTICS_METRIC_KEYS, PROGRAM_KINDS, SESSION_TEMPLATES_LIST_PATH, addExercisesToWorkout, buildCommentPayload, buildSession, coerceInt, collectAdvisories, copySession, createPersonalWorkout, createProgram, createSessionTemplate, definedProps, deleteComment, deleteProgram, exerciseUnits, fetchAthleteCircuits, fetchAthleteMainLiftPRs, fetchAthletePrefs, fetchAthleteProfileSummary, fetchAthleteProgrammingPrograms, fetchAthleteUser, fetchAthleteWorkouts, fetchCoachAthleteCalendarSummary, fetchCoachAthleteWorkouts, fetchExerciseHistoryDetail, fetchExerciseHistoryList, fetchExerciseStats, fetchLeaderboard, fetchPersonalRecords, fetchRecentExercises, fetchRosterActivity, fetchRosterMainLiftPRs, fetchStreams, fetchTeamAthleteIds, fetchWorkingMaxes, inviteAthletes, isRecord, logAdHocSession, logAthleteSet, logForAthlete, logSessionForAthlete, prescribeAthleteSet, prescribeForAthlete, presentAthleteWorkouts, presentCoachAthleteTraining, presentExerciseHistory, presentLogTargets, publishSession, queryAnalytics, readLive, readSession, removePersonalWorkout, removeSession, resolveBuildProgramId, searchExerciseHistory, selectWorkouts, selectWorkoutsByProgram, sendComment, setAthleteExerciseNote, setAthleteWorkoutNote, setSplitSummary, summarizeAthleteWorkouts, swapAthleteExercise, teamPublishTarget, teamVolume, toSetResults, updateTeam, updateTeamPublishSettings } from "@trainheroic-unofficial/js";
|
|
5
5
|
//#region src/context.ts
|
|
6
6
|
/** A tool argument that accepts a numeric id as a number or a string of digits. */
|
|
7
7
|
const idParam = idArgSchema;
|
|
@@ -1498,30 +1498,37 @@ function registerExerciseTools(server, ctx) {
|
|
|
1498
1498
|
function registerBuild(server, ctx) {
|
|
1499
1499
|
server.registerTool("workout_build", {
|
|
1500
1500
|
title: "Build a workout session (draft)",
|
|
1501
|
-
description: "Build an UNPUBLISHED session from a spec (program -> session -> blocks -> exercises). Pass programId for a team/group calendar (list_teams → group_program), or athleteId to write on that roster athlete's coach calendar (resolved via /v5/calendars/athletes/{id} — the same calendar the coach web app opens from My Athletes). athleteId requires date. Two exercises in one block become a superset. A block with empty exercises and a non-empty block instruction is a text-only Circuit / Conditioning block (type 1). Add a block 'leaderboard' for a Red-Zone score, or a top-level 'instruction' for the session note (Coach Instructions). Returns the draft ids, a read-back, and unit advisories. Review, then workout_publish.",
|
|
1501
|
+
description: "Build an UNPUBLISHED session from a spec (program -> session -> blocks -> exercises). Pass programId for a team/group calendar (list_teams → group_program), or athleteId to write on that roster athlete's coach calendar (resolved via /v5/calendars/athletes/{id} — the same calendar the coach web app opens from My Athletes). athleteId requires date. Two exercises in one block become a superset. A block with empty exercises and a non-empty block instruction is a text-only Circuit / Conditioning block (type 1). Add a block 'leaderboard' for a Red-Zone score, or a top-level 'instruction' for the session note (Coach Instructions). Returns the draft ids, a read-back, and unit advisories. Exercises above 10 sets are split into consecutive same-titled blocks and require confirmation (elicitation, or confirm:true). Review, then workout_publish.",
|
|
1502
1502
|
inputSchema: {
|
|
1503
1503
|
programId: z.number().optional(),
|
|
1504
1504
|
athleteId: idParam.optional(),
|
|
1505
1505
|
date: z.string().optional(),
|
|
1506
1506
|
timelineDay: z.number().optional(),
|
|
1507
1507
|
blocks: z.array(blockSpecSchema),
|
|
1508
|
-
instruction: z.string().optional()
|
|
1508
|
+
instruction: z.string().optional(),
|
|
1509
|
+
confirm: z.boolean().optional()
|
|
1509
1510
|
},
|
|
1510
1511
|
outputSchema: toolOutputSchema(workoutBuildOutputSchema),
|
|
1511
1512
|
annotations: ADDITIVE
|
|
1512
|
-
}, ({ programId, athleteId, date, timelineDay, blocks, instruction }) => attempt(async () => {
|
|
1513
|
+
}, ({ programId, athleteId, date, timelineDay, blocks, instruction, confirm }, extra) => attempt(async () => {
|
|
1513
1514
|
if (date === void 0 && timelineDay === void 0) return errorResult("Provide either date (YYYY-M-D) or timelineDay.");
|
|
1515
|
+
const typed = blocks;
|
|
1516
|
+
const splitSummary = setSplitSummary(typed);
|
|
1517
|
+
if (splitSummary !== null) {
|
|
1518
|
+
const blocked = confirmGate(extra, `${splitSummary} Continue?`, confirm);
|
|
1519
|
+
if (blocked) return blocked;
|
|
1520
|
+
}
|
|
1514
1521
|
const resolveArgs = {};
|
|
1515
1522
|
if (programId !== void 0) resolveArgs.programId = programId;
|
|
1516
1523
|
if (athleteId !== void 0) resolveArgs.athleteId = toId(athleteId);
|
|
1517
1524
|
if (date !== void 0) resolveArgs.date = date;
|
|
1518
1525
|
const resolved = await resolveBuildProgramId(ctx.client, resolveArgs);
|
|
1519
|
-
const typed = blocks;
|
|
1520
1526
|
const opts = {
|
|
1521
1527
|
programId: resolved,
|
|
1522
1528
|
blocks: typed,
|
|
1523
1529
|
publish: false
|
|
1524
1530
|
};
|
|
1531
|
+
if (splitSummary !== null) opts.confirmSetSplit = true;
|
|
1525
1532
|
if (date !== void 0) opts.date = parseWorkoutDate(date);
|
|
1526
1533
|
if (timelineDay !== void 0) opts.timelineDay = timelineDay;
|
|
1527
1534
|
if (instruction !== void 0) opts.instruction = instruction;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trainheroic-unofficial/core",
|
|
3
|
-
"version": "3.5.
|
|
3
|
+
"version": "3.5.1",
|
|
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/server": "2.0.0",
|
|
27
27
|
"zod": "^4.4.3",
|
|
28
|
-
"@trainheroic-unofficial/dto": "3.5.
|
|
29
|
-
"@trainheroic-unofficial/js": "3.5.
|
|
28
|
+
"@trainheroic-unofficial/dto": "3.5.1",
|
|
29
|
+
"@trainheroic-unofficial/js": "3.5.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"@types/node": "^26.3.0",
|