@wattsonclub/wattson-cli 0.0.0-stage → 0.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.
package/CHANGELOG.md ADDED
@@ -0,0 +1,19 @@
1
+ # Changelog
2
+
3
+ ## 0.1.1 — 2026-11-12
4
+
5
+ - Complete current MCP action/research parity, including sharing, all course sources, discovery and onboarding.
6
+ - Add `tool list`, `tool schema` and MCP-name invocation, with registration/behavior parity tests.
7
+ - Expand public workout authoring reference with exact primitives, constraints, revision behavior and verified composition examples.
8
+ - Harden OAuth/API redirects and diagnostics; restrict packaged files to reviewed executable, notices and guides.
9
+
10
+ - Align CLI with the offline-first saved-workout library: list, schedule, unschedule and retire.
11
+ - Add signed-in Strava route and starred-segment discovery plus route/segment course import.
12
+ - Remove retired Today/current-plan and remote ride-control commands from CLI help and dispatch.
13
+
14
+ ## 0.1.0
15
+
16
+ - Standalone bundled `wattson` executable for Node.js 22+.
17
+ - Browser OAuth and remote device authorization with automatic token refresh.
18
+ - Production API defaults, structured JSON output, legacy command compatibility.
19
+ - Bundled self-contained agent skill and third-party notices.
package/README.md CHANGED
@@ -1,3 +1,159 @@
1
- # Temporary Holding Version
1
+ # Wattson CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Training-planner commands for people and agents. Requires Node.js 22 or newer.
4
+
5
+ ```sh
6
+ npm install -g @wattsonclub/wattson-cli
7
+ wattson auth login
8
+ wattson --json athlete profile
9
+ ```
10
+
11
+ ## Remote login (SSH, servers, containers)
12
+
13
+ ```sh
14
+ wattson auth login --remote
15
+ ```
16
+
17
+ Open the verification URL on your phone or laptop, check the displayed code,
18
+ sign in, and explicitly approve access. No callback port or SSH forwarding is
19
+ needed. The command waits up to 300 seconds; use `--timeout <seconds>` to change
20
+ that. Never share a verification code or approval URL publicly.
21
+
22
+ `wattson auth status` checks saved login state; `wattson auth logout` removes local
23
+ credentials. Tokens refresh automatically. Signed-out status exits with code 1.
24
+
25
+ ## Documentation
26
+
27
+ Public guide: https://wattson.club/cli
28
+
29
+ Agent discovery: https://wattson.club/llms.txt
30
+
31
+ ## Agents
32
+
33
+ Use `--json` for machine-readable output. Remote login instructions go to stderr;
34
+ final JSON goes to stdout without tokens. The bundled `skill/SKILL.md` and
35
+ `skill/references/` explain workflows and command coverage. The public skill is
36
+ hosted at https://wattson.club/skills/wattson/SKILL.md after deployment.
37
+
38
+ Manage the offline-first app's saved workout library with `wattson workout list`,
39
+ `wattson workout schedule <id> --date YYYY-MM-DD`,
40
+ `wattson workout unschedule <id>`, and `wattson workout retire <id>`. Scheduling does not start a ride.
41
+ Signed-in Strava discovery and course import are available through `strava`
42
+ and `course` commands. The app itself executes and uploads rides.
43
+
44
+ Use `wattson --help` for commands. The production API is the default. Override it
45
+ with `--base-url`, `WATTSON_API_BASE_URL`, or legacy `PLANNER_API_BASE_URL` (in that
46
+ order). `WATTSON_AUTH_FILE` selects a credential file; existing trainer-planner
47
+ credentials remain compatible. The `trainer-planner` command alias is retained.
48
+
49
+ ## Distribution
50
+
51
+ Project code is UNLICENSED (all rights reserved); public distribution does not
52
+ grant an open-source license. Bundled dependency licenses are included in
53
+ `dist/THIRD-PARTY-NOTICES.txt`.
54
+
55
+ ## Complete MCP capability parity
56
+
57
+ Every current default/authenticated MCP tool has a human CLI command, plus the
58
+ research surface's search and fetch. `tool list` is the canonical discovery list.
59
+ `tool schema NAME` describes all fields, defaults, nested structures, unions,
60
+ bounds and enums for the current authentication surface. Contract refinements
61
+ (such as exactly one GPX source) are enforced during invocation.
62
+
63
+ ```sh
64
+ wattson --json tool list
65
+ wattson --json tool schema validate_workout
66
+ wattson --json tool validate_workout --input-file workout-validation.json
67
+ wattson course lookup "Mont Ventoux" --effort-pct-ftp 0.8
68
+ wattson course import-gpx --gpx-file ride.gpx --name "My ride"
69
+ wattson course import-gpx --gpx-url https://example.org/ride.gpx
70
+ wattson course generate-terrain --distance-m 12000 --average-grade-pct 6 --shape hairpins
71
+ wattson course build-road --start.place "Bédoin" --end.place "Mont Ventoux"
72
+ wattson course history --course-id ventoux --limit 20
73
+ wattson strava explore --place Girona --radius-km 15
74
+ wattson strava favourite-climbs --limit 3 --recent-rides 6
75
+ wattson recommend first --answers.ideal-minutes 45 --answers.max-minutes 60 --use-strava false
76
+ wattson share create WORKOUT_ID --workout-version 1
77
+ wattson share preview SHARE_UUID
78
+ wattson share import SHARE_UUID
79
+ wattson research search "climbing"
80
+ wattson research fetch profile:ATHLETE_ID
81
+ ```
82
+
83
+ The new course/Strava/sharing/onboarding commands accept every contract field as
84
+ `--kebab-case`; nested fields use dots (e.g. `--start.latitude 44.17`). Arrays accept
85
+ JSON or repeated flags (`--climb-course-ids first --climb-course-ids second`).
86
+ Booleans take explicit `true` or `false`. Complex payloads can use
87
+ `--input-json '{...}'` or `--input-file path.json`, exclusively: do not mix these
88
+ with field flags or positional arguments. `tool NAME` uses the exact MCP input
89
+ object and supports the same field flags for **all** tools. Numbers, defaults,
90
+ enums and input refinements use the shared API contract schemas.
91
+
92
+ Signed-in commands select the `/me` client routes, with the same ownership checks
93
+ as authenticated MCP. Generic/new commands reject an explicit `athleteId` where
94
+ the authenticated schema does not accept it; they never switch to an internal
95
+ route because of an input field. Signed-out internal course commands may accept
96
+ `--athlete-id` for estimates/history. Strava, sharing, onboarding and research
97
+ require login. Research uses the same shared corpus, ranking, eight-result limit,
98
+ partial-source handling and document IDs as MCP.
99
+
100
+ `WATTSON_STRAVA_LIMITED_ACCESS=true` (or the legacy
101
+ `PLANNER_MCP_STRAVA_LIMITED_ACCESS`) hides and rejects the same seven restricted
102
+ Strava read operations as MCP. Segment-name lookup and segment import remain
103
+ available. The server remains the enforcing authority for account ownership and
104
+ Strava access; disabling a local flag cannot grant server access.
105
+
106
+ Sharing is a separate, explicit action: create exposes a sanitized template;
107
+ preview does not import; import saves a separate workout. No command starts or
108
+ controls a device ride remotely. `recommend daily` remains an additional CLI
109
+ convenience, not a current MCP registration.
110
+
111
+ ### MCP → CLI mapping
112
+
113
+ The source-of-truth map is `src/parity.ts`, with research entries in
114
+ `src/tool-command.ts`. Tests compare actual registrations on public/internal,
115
+ full/limited and research surfaces, their complete schema shapes, and method
116
+ routing/payloads for the added operations.
117
+
118
+ | MCP tool | CLI command |
119
+ | --- | --- |
120
+ | `list_saved_workouts` | `workout list` |
121
+ | `health` | `health` |
122
+ | `get_athlete_profile` | `athlete profile` |
123
+ | `get_readiness_snapshot` | `athlete readiness latest` |
124
+ | `get_recent_sessions` | `athlete sessions` |
125
+ | `get_saved_workout` | `workout get` |
126
+ | `get_workout_runtime_plan` | `workout runtime-plan` |
127
+ | `list_saved_workout_revisions` | `workout revisions` |
128
+ | `summarize_session` | `session summary` |
129
+ | `get_session_telemetry` | `session telemetry` |
130
+ | `get_session_artifacts` | `session artifacts` |
131
+ | `get_session_fit_export` | `session fit` |
132
+ | `lookup_climb` | `course lookup` |
133
+ | `find_my_strava_segments` | `strava find-segments` |
134
+ | `import_strava_segment` | `course import-strava-segment` |
135
+ | `import_gpx_course` | `course import-gpx` |
136
+ | `generate_terrain_course` | `course generate-terrain` |
137
+ | `import_strava_activity_course` | `course import-strava-activity` |
138
+ | `build_road_course` | `course build-road` |
139
+ | `import_climb_page` | `course import-climb-page` |
140
+ | `get_my_climb_history` | `course history` |
141
+ | `explore_strava_segments` | `strava explore` |
142
+ | `get_my_strava_segment_efforts` | `strava segment-efforts` |
143
+ | `list_my_strava_starred_segments` | `strava starred-segments` |
144
+ | `list_my_favourite_strava_climbs` | `strava favourite-climbs` |
145
+ | `recommend_first_workout` | `recommend first` |
146
+ | `list_my_strava_routes` | `strava routes` |
147
+ | `import_strava_route` | `course import-strava-route` |
148
+ | `draft_workout` | `workout draft` |
149
+ | `revise_workout` | `workout revise` |
150
+ | `validate_workout` | `workout validate` |
151
+ | `save_workout` | `workout save` |
152
+ | `schedule_saved_workout` | `workout schedule` |
153
+ | `retire_saved_workout` | `workout retire` |
154
+ | `trigger_session_strava_sync` | `session strava-sync` |
155
+ | `create_workout_share` | `share create` |
156
+ | `preview_workout_share` | `share preview` |
157
+ | `import_workout_share` | `share import` |
158
+ | `search` | `research search` |
159
+ | `fetch` | `research fetch` |
@@ -0,0 +1,23 @@
1
+ Zod (MIT)
2
+
3
+ MIT License
4
+
5
+ Copyright (c) 2025 Colin McDonnell
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in all
15
+ copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
23
+ SOFTWARE.