@trainheroic-unofficial/core 3.3.0 → 3.3.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.
Files changed (2) hide show
  1. package/dist/index.mjs +19 -9
  2. package/package.json +3 -3
package/dist/index.mjs CHANGED
@@ -1170,16 +1170,20 @@ function registerTeamTools(server, ctx) {
1170
1170
  }, ({ title }) => apiCall(ctx, "POST", "/1.0/coach/team/createWithTitleAndCode", { body: { title } }));
1171
1171
  server.registerTool("team_update", {
1172
1172
  title: "Update a team",
1173
- description: "Update a team's title and/or reassign its calendar (PUT /v5/teams/{teamId}). Pass groupProgram (a program/calendar id — typically another team's group_program from list_teams, or get_team) to point this team at an existing parent program. At least one of title or groupProgram is required; when only groupProgram is set the current title is preserved.",
1173
+ description: "Update a team's title and/or reassign its calendar (PUT /v5/teams/{teamId}). Pass groupProgram (a program/calendar id — typically another team's group_program from list_teams, or get_team) to point this team at an existing parent program. At least one of title or groupProgram is required; when only groupProgram is set the current title is preserved. Requires confirmation (elicitation, or confirm:true).",
1174
1174
  inputSchema: {
1175
1175
  teamId: idParam,
1176
1176
  title: z.string().min(1).optional(),
1177
- groupProgram: idParam.optional()
1177
+ groupProgram: idParam.optional(),
1178
+ confirm: z.boolean().optional()
1178
1179
  },
1179
1180
  outputSchema: opaqueOutputSchema,
1180
- annotations: ADDITIVE
1181
- }, ({ teamId, title, groupProgram }) => attempt(async () => {
1182
- const args = { teamId: toId(teamId) };
1181
+ annotations: DESTRUCTIVE
1182
+ }, ({ teamId, title, groupProgram, confirm }, extra) => attempt(async () => {
1183
+ const id = toId(teamId);
1184
+ const blocked = confirmGate(extra, `Update team ${id}? This overwrites its live title and/or calendar assignment.`, confirm);
1185
+ if (blocked) return blocked;
1186
+ const args = { teamId: id };
1183
1187
  if (title !== void 0) args.title = title;
1184
1188
  if (groupProgram !== void 0) args.groupProgram = toId(groupProgram);
1185
1189
  return jsonResult(await updateTeam(ctx.client, args));
@@ -1326,14 +1330,20 @@ function registerAnalyticsTools(server, ctx) {
1326
1330
  function registerExerciseUpdate(server, index) {
1327
1331
  server.registerTool("exercise_update", {
1328
1332
  title: "Update custom exercise",
1329
- description: "Update a custom exercise (POST /2.0/coach/exercise/update/{id}) and write it through to the mirror. Same body as exercise_create. Only works for exercises with can_edit:1.",
1333
+ description: "Update a custom exercise (POST /2.0/coach/exercise/update/{id}) and write it through to the mirror. Same body as exercise_create. Only works for exercises with can_edit:1. Requires confirmation (elicitation, or confirm:true).",
1330
1334
  inputSchema: {
1331
1335
  id: idParam,
1332
- exercise: exerciseCreateSchema
1336
+ exercise: exerciseCreateSchema,
1337
+ confirm: z.boolean().optional()
1333
1338
  },
1334
1339
  outputSchema: toolOutputSchema(exerciseCreatedOutputSchema),
1335
- annotations: ADDITIVE
1336
- }, ({ id, exercise }) => attempt(async () => jsonResult(await index.update(toId(id), exercise))));
1340
+ annotations: DESTRUCTIVE
1341
+ }, ({ id, exercise, confirm }, extra) => attempt(async () => {
1342
+ const exerciseId = toId(id);
1343
+ const blocked = confirmGate(extra, `Update custom exercise ${exerciseId}? This overwrites its live TrainHeroic definition.`, confirm);
1344
+ if (blocked) return blocked;
1345
+ return jsonResult(await index.update(exerciseId, exercise));
1346
+ }));
1337
1347
  }
1338
1348
  function registerExerciseDelete(server, index) {
1339
1349
  server.registerTool("exercise_delete", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trainheroic-unofficial/core",
3
- "version": "3.3.0",
3
+ "version": "3.3.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.3.0",
29
- "@trainheroic-unofficial/js": "3.3.0"
28
+ "@trainheroic-unofficial/dto": "3.3.1",
29
+ "@trainheroic-unofficial/js": "3.3.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^26.2.0",