@trainheroic-unofficial/core 1.1.0 → 1.1.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/README.md +9 -11
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,7 +1,7 @@
1
1
  # @trainheroic-unofficial/core
2
2
 
3
3
  The shared [MCP](https://modelcontextprotocol.io) (Model Context Protocol) tool layer for
4
- TrainHeroic. Each tool — a function an AI assistant can call — is defined once here and reused
4
+ TrainHeroic. Each tool (a function an AI assistant can call) is defined once here and reused
5
5
  by both servers: the local stdio server (`@trainheroic-unofficial/coach-mcp`) and the hosted
6
6
  Cloudflare worker (`@trainheroic-unofficial/cloudflare`). You only need this package if you
7
7
  are building your own MCP server; to _use_ the tools, run one of those servers.
@@ -20,8 +20,8 @@ A server builds a `ToolContext` and passes it, along with its MCP server instanc
20
20
  `registerXxxTools(server, ctx)` functions (the `register*` names below are the real exports;
21
21
  `registerXxxTools` is shorthand for all of them). `ToolContext` is `{ client, index }`: an
22
22
  authenticated `TrainHeroicClient` (from `@trainheroic-unofficial/js`) and anything implementing
23
- the `ExerciseIndex` interface — the in-memory `ExerciseLibrary` here, or the hosted worker's
24
- D1-backed store.
23
+ the `ExerciseIndex` interface (the in-memory `ExerciseLibrary` here, or the hosted worker's
24
+ D1-backed store).
25
25
 
26
26
  Install it alongside the MCP SDK and the `js` client (both peers you construct from):
27
27
 
@@ -66,26 +66,24 @@ Each `register*` function registers a group of tools, and the individual tool na
66
66
  sees are snake_case (e.g. `analytics_query`, `exercise_resolve`). The groups:
67
67
 
68
68
  - coach reads (profile, athletes, teams, programs, notifications, analytics catalog)
69
- - athlete management (`registerAthleteTools` — the coach's _roster_ view: invite, archive, restore)
69
+ - athlete management (`registerAthleteTools`, the coach's _roster_ view: invite, archive, restore)
70
70
  - team management (create, rename, delete, join codes)
71
71
  - analytics report pulls (`analytics_query`: readiness, 1RM (one-rep max) and working-max history, training summary, compliance, lift progress)
72
72
  - exercise library operations (resolve, search, get, sync, create, forget, stats)
73
73
  - the workout/session lifecycle (build a draft, read it back, publish, unpublish, copy, save as template, remove)
74
74
  - messaging (list, read, draft, send, delete)
75
75
 
76
- There is no raw-request escape hatch; every endpoint reaches the model through a typed tool.
76
+ Every endpoint reaches the model through a typed tool; the surface has no raw-request escape hatch.
77
77
  (`registerAthleteTools` here is the coach's roster view, distinct from the athlete's own
78
78
  training tools that the athlete server registers.)
79
79
 
80
80
  Tools return their result in-band. A failure comes back as an error result the model can read
81
- and correct, not a thrown exception. Reads are annotated read-only. Athlete-facing or
81
+ and self-correct from. Reads are annotated read-only. Athlete-facing or
82
82
  destructive actions (publish, unpublish, remove, send, delete, archive, team/code delete) pass
83
- through a confirmation gate: it asks the client to confirm via MCP elicitation, falls back to
84
- an explicit `confirm: true` argument when the client cannot prompt, and fails closed if neither
85
- is satisfied.
83
+ through a confirmation gate. The gate prefers MCP elicitation; when the client cannot elicit,
84
+ it accepts an explicit `confirm: true` argument. It fails closed if neither condition is met.
86
85
 
87
- The D1-backed warehouse sync tools are not here; they live in the `cloudflare` package
88
- because they depend on its storage.
86
+ The D1-backed warehouse sync tools live in the `cloudflare` package because they depend on its storage.
89
87
 
90
88
  ## Develop
91
89
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@trainheroic-unofficial/core",
3
- "version": "1.1.0",
3
+ "version": "1.1.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/sdk": "^1.29.0",
27
27
  "zod": "^4.4.3",
28
- "@trainheroic-unofficial/dto": "1.1.0",
29
- "@trainheroic-unofficial/js": "1.1.0"
28
+ "@trainheroic-unofficial/dto": "1.1.1",
29
+ "@trainheroic-unofficial/js": "1.1.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "@types/node": "^26.0.0",