@pulsarinteractive/geniusfitness 0.1.0-beta.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 +9 -0
- package/CONTRIBUTING.md +72 -0
- package/LICENSE +21 -0
- package/LICENSES/Apache-2.0.txt +202 -0
- package/README.md +57 -0
- package/SECURITY.md +14 -0
- package/THIRD_PARTY_NOTICES.md +15 -0
- package/bin/geniusfitness.mjs +6 -0
- package/docs/AUTHENTICATION.md +40 -0
- package/docs/CLI.md +50 -0
- package/docs/INTEGRATIONS.md +50 -0
- package/docs/LIMITS.md +56 -0
- package/docs/RELEASING.md +23 -0
- package/docs/TRAINING.md +84 -0
- package/examples/codex.toml +3 -0
- package/examples/mcp.json +8 -0
- package/mcp.json +10 -0
- package/package.json +73 -0
- package/plugin.json +24 -0
- package/skills/geniusfitness/SKILL.md +30 -0
- package/skills/geniusfitness/agents/openai.yaml +4 -0
- package/skills/geniusfitness/references/training.md +84 -0
- package/skills/geniusfitness-coaching/SKILL.md +25 -0
- package/skills/geniusfitness-coaching/agents/openai.yaml +4 -0
- package/skills/geniusfitness-progress/SKILL.md +28 -0
- package/skills/geniusfitness-progress/agents/openai.yaml +4 -0
- package/src/changes.mjs +139 -0
- package/src/cli.mjs +359 -0
- package/src/client.mjs +260 -0
- package/src/command-catalog.mjs +1621 -0
- package/src/commands.mjs +271 -0
- package/src/errors.mjs +65 -0
- package/src/fitness.mjs +267 -0
- package/src/login.mjs +258 -0
- package/src/mcp.mjs +198 -0
- package/src/profiles.mjs +154 -0
- package/src/read-cache.mjs +111 -0
- package/src/store.mjs +141 -0
- package/src/transport.mjs +201 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Browser PKCE and device login using the GeniusFitness account and explicit consent.
|
|
6
|
+
- Bounded programs, exercise catalogue, planning, results and private health reads.
|
|
7
|
+
- Journaled program, workout, exercise, schedule, goal and activity commands.
|
|
8
|
+
- Current Coach subscription and athlete-access boundaries.
|
|
9
|
+
- Conditional read cache, incremental changes, narrowed profiles and workflow skills.
|
package/CONTRIBUTING.md
ADDED
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Thanks for helping improve GeniusFitness's agent integrations. This repository
|
|
4
|
+
contains the CLI, local MCP server, skills and integration documentation.
|
|
5
|
+
|
|
6
|
+
## Development setup
|
|
7
|
+
|
|
8
|
+
Use Node.js 22.13 or newer and npm:
|
|
9
|
+
|
|
10
|
+
```sh
|
|
11
|
+
npm ci
|
|
12
|
+
npm run verify
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Local tests need no GeniusFitness account. They use temporary files, synthetic
|
|
16
|
+
identities, loopback servers and the official MCP client SDK.
|
|
17
|
+
|
|
18
|
+
## Code conventions
|
|
19
|
+
|
|
20
|
+
- Use ECMAScript modules and explicit `node:` imports for Node built-ins.
|
|
21
|
+
- Format with `npm run format`; ESLint enforces recommended checks, strict
|
|
22
|
+
equality, unused-variable detection and braces on control statements.
|
|
23
|
+
- Choose names that explain the operation. Keep parsing, authentication, HTTP
|
|
24
|
+
transport, persistence and MCP presentation in their respective modules.
|
|
25
|
+
- Document exported entry points and invariants. Explain why a failure needs
|
|
26
|
+
special treatment; comments should not repeat the next line of code.
|
|
27
|
+
- Inject clocks, network calls and cancellation signals where behavior needs
|
|
28
|
+
deterministic tests. Avoid new global state, background daemons or polling.
|
|
29
|
+
- Prefer a focused helper when it clarifies responsibility. Avoid abstraction
|
|
30
|
+
that hides credential ownership, lock lifetime or retry decisions.
|
|
31
|
+
|
|
32
|
+
The [architecture guide](docs/ARCHITECTURE.md) describes module responsibilities
|
|
33
|
+
and the authentication, write and change-feed lifecycles.
|
|
34
|
+
|
|
35
|
+
## Behavioral compatibility
|
|
36
|
+
|
|
37
|
+
CLI JSON output, exit codes, MCP tool names and command envelopes are public
|
|
38
|
+
interfaces. Changes must preserve existing callers or be documented as a breaking
|
|
39
|
+
change. Keep stdout reserved for protocol output; diagnostics belong on stderr.
|
|
40
|
+
|
|
41
|
+
Validate input at the boundary. Surface errors through `AgentError` with a stable
|
|
42
|
+
code and useful remediation. Never relay raw provider exceptions or credentials.
|
|
43
|
+
A command must preserve origin, account, profile and operation identity. An
|
|
44
|
+
uncertain write may only retry its saved immutable request; a revision conflict
|
|
45
|
+
requires rereading the resource. Access and quotas remain server-enforced.
|
|
46
|
+
|
|
47
|
+
`src/command-catalog.mjs` is a generated interface snapshot. Submit contract
|
|
48
|
+
updates with their generation provenance and review the client-facing diff;
|
|
49
|
+
do not hand-edit generated schemas. Third-party schemas also remain unchanged.
|
|
50
|
+
|
|
51
|
+
## Tests and documentation
|
|
52
|
+
|
|
53
|
+
Add regression coverage for observable changes, including relevant failures and
|
|
54
|
+
cancellation. Use synthetic data; live account exports do not belong in fixtures.
|
|
55
|
+
Read [Testing](docs/TESTING.md) for the suite boundaries and focused commands.
|
|
56
|
+
|
|
57
|
+
Update command help, examples, skills and relevant guides when behavior changes.
|
|
58
|
+
Examples must run against documented capabilities, with placeholders for resource
|
|
59
|
+
IDs and without access tokens. Keep program permissions, Coach access and personal health consent independent.
|
|
60
|
+
|
|
61
|
+
## Pull requests
|
|
62
|
+
|
|
63
|
+
Describe the user-visible problem, the behavior after the change and the checks
|
|
64
|
+
performed. Keep unrelated changes separate. Run `npm run verify` and review the
|
|
65
|
+
archive inventory before proposing distribution changes. Security reports belong
|
|
66
|
+
in the repository's private reporting channel, as described in [Security](SECURITY.md).
|
|
67
|
+
|
|
68
|
+
## Licensing
|
|
69
|
+
|
|
70
|
+
Contributions to the client, skills and documentation are accepted under the
|
|
71
|
+
[MIT license](LICENSE). Third-party material retains its original license and
|
|
72
|
+
must have clear provenance and notices. See [Third-party notices](THIRD_PARTY_NOTICES.md).
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pulsar Interactive
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
# GeniusFitness CLI & MCP
|
|
2
|
+
|
|
3
|
+
Manage your training plans, exercises and progress with your own AI tools.
|
|
4
|
+
GeniusFitness keeps your programs and permissions in one place; your agent uses
|
|
5
|
+
its own model and credentials.
|
|
6
|
+
|
|
7
|
+
## Install and connect
|
|
8
|
+
|
|
9
|
+
Requires Node.js 22.13 or newer.
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
npm install --global @pulsarinteractive/geniusfitness@beta
|
|
13
|
+
geniusfitness auth login
|
|
14
|
+
geniusfitness whoami --json
|
|
15
|
+
geniusfitness programs list --json
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Login opens your browser. Sign in to GeniusFitness, select programs and
|
|
19
|
+
permissions, then approve. There is no token to copy into your terminal.
|
|
20
|
+
|
|
21
|
+
## What you can do
|
|
22
|
+
|
|
23
|
+
| Feature | CLI | MCP |
|
|
24
|
+
| ---------------------------------- | ------------------------------------- | ----------------------------------- |
|
|
25
|
+
| Find your programs | `programs list` | `fitness_programs` |
|
|
26
|
+
| Search exercises | `catalog search --query squat` | `fitness_catalog` |
|
|
27
|
+
| Read workouts, planning or results | `resources list` | `fitness_resources` |
|
|
28
|
+
| Summarize activity | `metrics summary` | `fitness_metrics` |
|
|
29
|
+
| Create or edit a plan | `commands prepare` / `commands retry` | Journaled command tools |
|
|
30
|
+
| Follow changes | `changes list` / `changes watch` | `fitness_changes` / `fitness_watch` |
|
|
31
|
+
|
|
32
|
+
Choose from the exercise catalogue before creating a custom exercise. Private
|
|
33
|
+
health measurements require separate permission. Managing another athlete’s
|
|
34
|
+
shared program also requires a Coach subscription and that athlete’s access grant.
|
|
35
|
+
|
|
36
|
+
## Connect your agent
|
|
37
|
+
|
|
38
|
+
Authenticate once with the CLI, then configure your MCP client to run:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
geniusfitness mcp --context default
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
[Setup examples](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/docs/INTEGRATIONS.md)
|
|
45
|
+
· [Training workflow](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/docs/TRAINING.md)
|
|
46
|
+
· [Permissions and limits](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/docs/LIMITS.md)
|
|
47
|
+
· [Agent skills](https://github.com/PulsarInteractive/geniusfitness-agent-tools/tree/main/skills)
|
|
48
|
+
|
|
49
|
+
## Documentation
|
|
50
|
+
|
|
51
|
+
- [CLI reference](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/docs/CLI.md)
|
|
52
|
+
- [Authentication and account safety](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/docs/AUTHENTICATION.md)
|
|
53
|
+
- [Contributing](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/CONTRIBUTING.md)
|
|
54
|
+
- [Security reports](https://github.com/PulsarInteractive/geniusfitness-agent-tools/blob/main/SECURITY.md)
|
|
55
|
+
|
|
56
|
+
MIT © Pulsar Interactive. This repository contains the public agent client and
|
|
57
|
+
skills; the GeniusFitness application and service implementation are separate.
|
package/SECURITY.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Security
|
|
2
|
+
|
|
3
|
+
Report suspected vulnerabilities privately through GitHub's security advisory
|
|
4
|
+
reporting for this repository. Do not put tokens, private project content or
|
|
5
|
+
account exports in public issues. For ordinary bugs, use synthetic reproduction
|
|
6
|
+
steps and redact identifiers that are not needed.
|
|
7
|
+
|
|
8
|
+
The client uses the official service, explicit browser consent, bounded grants
|
|
9
|
+
and private credential files. Revocation is separate from uninstalling npm or a
|
|
10
|
+
plugin. The beta uses development admission; package installation grants nothing.
|
|
11
|
+
|
|
12
|
+
Public changes are checked against a file allowlist and credential/private-path
|
|
13
|
+
patterns, then reviewed before publishing. Automated scans supplement review;
|
|
14
|
+
they cannot guarantee that arbitrary new content is safe to disclose.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## Agent Plugins JSON schemas
|
|
4
|
+
|
|
5
|
+
`tools/schemas/plugin.schema.json` and `tools/schemas/mcp.schema.json` are
|
|
6
|
+
unmodified Agent Plugins 1.0.0 JSON schemas, used for development validation.
|
|
7
|
+
|
|
8
|
+
- Project: [Agent Plugins specification](https://github.com/agentplugins/agent-plugins-spec)
|
|
9
|
+
- Source: [version 1.0.0 schemas](https://github.com/agentplugins/agent-plugins-spec/tree/main/schemas/1.0.0)
|
|
10
|
+
- License: Apache-2.0, as stated in the [upstream licensing notice](https://github.com/agentplugins/agent-plugins-spec/blob/main/LICENSE.md)
|
|
11
|
+
- Full license: [LICENSES/Apache-2.0.txt](LICENSES/Apache-2.0.txt)
|
|
12
|
+
|
|
13
|
+
These schemas retain their original license. The MIT license for GeniusFitness's
|
|
14
|
+
client does not replace their terms. npm dependencies retain the licenses
|
|
15
|
+
included in their respective packages.
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { main } from '../src/cli.mjs';
|
|
3
|
+
const cancellation = new AbortController();
|
|
4
|
+
process.once('SIGINT', () => cancellation.abort());
|
|
5
|
+
process.once('SIGTERM', () => cancellation.abort());
|
|
6
|
+
process.exitCode = await main(process.argv.slice(2), { signal: cancellation.signal });
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Authentication
|
|
2
|
+
|
|
3
|
+
`geniusfitness auth login` opens the GeniusFitness consent page in your browser.
|
|
4
|
+
Sign in using the same Firebase-backed account as the app, select accessible
|
|
5
|
+
programs and permissions, then approve. The browser returns a single-use code to
|
|
6
|
+
a loopback listener; PKCE binds it to the terminal that started the request.
|
|
7
|
+
|
|
8
|
+
The terminal stores the resulting delegated session in a private context. It
|
|
9
|
+
never receives your password. Your account and program permissions remain the
|
|
10
|
+
ceiling on all agent activity.
|
|
11
|
+
|
|
12
|
+
Use `--browser chrome` to select Chrome, or `--no-browser` to print the consent
|
|
13
|
+
link. For a remote shell without a loopback callback, use `--flow device` and
|
|
14
|
+
approve its short-lived request in your browser. Neither flow grants access
|
|
15
|
+
merely by opening the page.
|
|
16
|
+
|
|
17
|
+
## Health and Coach permissions
|
|
18
|
+
|
|
19
|
+
Health measurements are never preselected. Read access to programs does not
|
|
20
|
+
include personal health data. Coach writes need separate `coaching:write` consent,
|
|
21
|
+
a current Coach subscription and the normal permissions on the shared program.
|
|
22
|
+
A downgrade or revoked membership is checked on later operations, including a
|
|
23
|
+
prepared write that has not committed yet.
|
|
24
|
+
|
|
25
|
+
## Renewal and revocation
|
|
26
|
+
|
|
27
|
+
Refresh tokens rotate. An uncertain refresh response requires reconnecting;
|
|
28
|
+
replaying an old refresh token can revoke its session family. Logging out
|
|
29
|
+
revokes the presented terminal session before erasing the local credential.
|
|
30
|
+
Revoking a connection invalidates its profiles and sessions.
|
|
31
|
+
|
|
32
|
+
Use a different `--context` for another account. Never copy credential files into
|
|
33
|
+
a repository or share them with a collaborator. An agent’s command journal may
|
|
34
|
+
contain personal training details; treat it as private local data as well.
|
|
35
|
+
|
|
36
|
+
## Errors
|
|
37
|
+
|
|
38
|
+
Expired or already-consumed consent links require a new `auth login`. Broader
|
|
39
|
+
permissions require a new human decision; a tool cannot grant them to itself.
|
|
40
|
+
After a network error, inspect the operation before trying a write with a new ID.
|
package/docs/CLI.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# CLI reference
|
|
2
|
+
|
|
3
|
+
`geniusfitness help --json` lists commands and options. `--json` emits one
|
|
4
|
+
versioned result on stdout; progress and errors use stderr. MCP reserves stdout
|
|
5
|
+
for protocol messages.
|
|
6
|
+
|
|
7
|
+
| Command | Purpose |
|
|
8
|
+
| -------------------------------------- | ---------------------------------------------------------------- |
|
|
9
|
+
| `auth login` | Browser consent with PKCE; `--flow device` for a remote terminal |
|
|
10
|
+
| `auth status`, `whoami` | Current identity, profile and permission ceiling |
|
|
11
|
+
| `auth logout` | Revoke the terminal session, then erase local credentials |
|
|
12
|
+
| `capabilities` | Server collections, commands and current limits |
|
|
13
|
+
| `programs list` | Bounded list of accessible programs |
|
|
14
|
+
| `catalog search` | Find catalogue exercises by query, key, equipment or muscle |
|
|
15
|
+
| `resources list` | One collection or exact record |
|
|
16
|
+
| `metrics summary` | Daily program totals within a date range |
|
|
17
|
+
| `changes list`, `changes watch` | Bounded incremental follow-up |
|
|
18
|
+
| `commands describe` | Local command catalogue and envelope schemas |
|
|
19
|
+
| `commands prepare` | Persist a draft with one immutable operation ID |
|
|
20
|
+
| `commands execute` | Send a complete journaled operation once |
|
|
21
|
+
| `commands retry` | Replay the exact saved operation |
|
|
22
|
+
| `commands inspect` | Inspect local operation evidence without a server call |
|
|
23
|
+
| `profiles list/create/restrict/select` | Manage narrower profiles |
|
|
24
|
+
| `doctor` | Inspect local setup without revealing credentials |
|
|
25
|
+
| `mcp` | Run the local MCP server |
|
|
26
|
+
|
|
27
|
+
```bash
|
|
28
|
+
geniusfitness resources list --scope project:PROGRAM_ID --collection workouts --json
|
|
29
|
+
geniusfitness catalog search --query squat --json
|
|
30
|
+
geniusfitness metrics summary --scope project:PROGRAM_ID --from 2026-09-01 --until 2026-09-30 --json
|
|
31
|
+
geniusfitness commands prepare --file workout-draft.json --json
|
|
32
|
+
geniusfitness commands retry --operation OPERATION_ID --json
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
`--context` separates accounts or sessions. The initial beta defaults to the
|
|
36
|
+
development environment; access requires an admitted GeniusFitness account.
|
|
37
|
+
Choose `--environment production` explicitly for that environment. Environments
|
|
38
|
+
never share credentials. Arbitrary public API origins are refused; loopback
|
|
39
|
+
origins are available only with an explicit local-testing option.
|
|
40
|
+
|
|
41
|
+
| Exit code | Meaning |
|
|
42
|
+
| --------- | --------------------------------- |
|
|
43
|
+
| 0 | Success |
|
|
44
|
+
| 1 | Other failure |
|
|
45
|
+
| 2 | Invalid command or input |
|
|
46
|
+
| 3 | Authentication required |
|
|
47
|
+
| 4 | Permission denied |
|
|
48
|
+
| 5 | Conflict requiring reconciliation |
|
|
49
|
+
| 6 | Rate or usage limit |
|
|
50
|
+
| 7 | Transient failure |
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Agent integrations
|
|
2
|
+
|
|
3
|
+
First authenticate with the CLI in a terminal:
|
|
4
|
+
|
|
5
|
+
```bash
|
|
6
|
+
geniusfitness auth login --context training
|
|
7
|
+
```
|
|
8
|
+
|
|
9
|
+
The MCP process uses that context and never starts an interactive login itself.
|
|
10
|
+
No token belongs in an MCP configuration, command line or shared project file.
|
|
11
|
+
|
|
12
|
+
## MCP clients
|
|
13
|
+
|
|
14
|
+
Install the CLI globally, then use:
|
|
15
|
+
|
|
16
|
+
```json
|
|
17
|
+
{
|
|
18
|
+
"mcpServers": {
|
|
19
|
+
"geniusfitness": {
|
|
20
|
+
"command": "geniusfitness",
|
|
21
|
+
"args": ["mcp", "--context", "training"]
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Version-pinned `npx` examples are in `examples/`. Use the same context and
|
|
28
|
+
environment for login and MCP. Different accounts need different contexts.
|
|
29
|
+
|
|
30
|
+
## Skills
|
|
31
|
+
|
|
32
|
+
The `skills/` directory contains portable workflow instructions:
|
|
33
|
+
|
|
34
|
+
| Skill | Purpose |
|
|
35
|
+
| ------------------------ | ----------------------------------------------------------------------- |
|
|
36
|
+
| `geniusfitness` | Find programs, reuse catalogue exercises and maintain training plans |
|
|
37
|
+
| `geniusfitness-coaching` | Work on an athlete’s shared program with current Coach rights |
|
|
38
|
+
| `geniusfitness-progress` | Read reliable progress and manage authorized activity or health records |
|
|
39
|
+
|
|
40
|
+
Install them through your agent client’s supported skill mechanism. The plugin
|
|
41
|
+
manifest combines the skills with a local stdio MCP configuration. It does not
|
|
42
|
+
claim approval in a hosted integration directory or provide a remote MCP URL.
|
|
43
|
+
|
|
44
|
+
## Independent sessions
|
|
45
|
+
|
|
46
|
+
Profiles can narrow the access available to a connection. Selecting a narrower
|
|
47
|
+
profile rotates credentials and cannot regain broader access. Use separate named
|
|
48
|
+
contexts for independently authorized terminals. Saved operations belong to the
|
|
49
|
+
account, connection and profile that prepared them; another profile cannot adopt
|
|
50
|
+
their pending writes.
|
package/docs/LIMITS.md
ADDED
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# Permissions and limits
|
|
2
|
+
|
|
3
|
+
The connection grant, selected profile, current subscription and ordinary
|
|
4
|
+
program permissions all apply. Narrowing a grant takes effect on subsequent
|
|
5
|
+
requests; retaining a cached record does not preserve revoked rights.
|
|
6
|
+
|
|
7
|
+
## API limits
|
|
8
|
+
|
|
9
|
+
These are the initial configurable limits. Read `whoami` or `capabilities` for
|
|
10
|
+
the active server values. Every terminal and profile on one account shares them.
|
|
11
|
+
|
|
12
|
+
| Limit | Free | Premium | Coach |
|
|
13
|
+
| ------------------------- | ----: | ----------------: | ----------------: |
|
|
14
|
+
| Requests per minute | 30 | 60 | 180 |
|
|
15
|
+
| Write requests per minute | 5 | 10 | 30 |
|
|
16
|
+
| Monthly request credits | 5,000 | No monthly cutoff | No monthly cutoff |
|
|
17
|
+
| Monthly write requests | 500 | No monthly cutoff | No monthly cutoff |
|
|
18
|
+
|
|
19
|
+
A read uses one Free credit; a write uses five and also counts toward the write
|
|
20
|
+
limit. Paid accounts remain bounded by their minute limits. Respect `Retry-After`
|
|
21
|
+
and retain the same operation when a write’s outcome is uncertain. Do not open
|
|
22
|
+
extra contexts to work around a limit.
|
|
23
|
+
|
|
24
|
+
## Data capacity
|
|
25
|
+
|
|
26
|
+
| Personal data | Free | Premium | Coach |
|
|
27
|
+
| --------------------------------- | -----: | ------: | ------: |
|
|
28
|
+
| Custom or imported exercises | 200 | 5,000 | 20,000 |
|
|
29
|
+
| Health measurements | 2,000 | 20,000 | 100,000 |
|
|
30
|
+
| Combined live personal-data bytes | 10 MiB | 50 MiB | 100 MiB |
|
|
31
|
+
|
|
32
|
+
These limits apply to both app and agent writes. They are separate from shared
|
|
33
|
+
program and media allowances. After a downgrade, existing data remains readable;
|
|
34
|
+
you can delete data or reduce its size. Growth beyond the current capacity is
|
|
35
|
+
refused. Business-plan values can change before launch.
|
|
36
|
+
|
|
37
|
+
## Permission groups
|
|
38
|
+
|
|
39
|
+
| Permission | Data or action |
|
|
40
|
+
| ------------------------------------ | ------------------------------------------------------------ |
|
|
41
|
+
| `programs:read` / `programs:write` | Programs, workout templates, exercise slots and instructions |
|
|
42
|
+
| `exercises:read` / `exercises:write` | Catalogue metadata and the account’s exercise library |
|
|
43
|
+
| `planning:read` / `planning:write` | Planning entries, recurring schedules and goals |
|
|
44
|
+
| `metrics:read` / `metrics:write` | Completed workouts, runs and progress summaries |
|
|
45
|
+
| `health:read` / `health:write` | The account’s private health measurements |
|
|
46
|
+
| `coaching:write` | Additional approval for writes concerning another athlete |
|
|
47
|
+
|
|
48
|
+
Health permissions and all writes require deliberate selection on the consent
|
|
49
|
+
page. Coach permission requires an active Coach subscription when used and never
|
|
50
|
+
replaces program membership or grants another person’s private health data.
|
|
51
|
+
|
|
52
|
+
## Bounded reads
|
|
53
|
+
|
|
54
|
+
Resource and catalogue pages contain at most 25 items. Read one selected program
|
|
55
|
+
at a time. Metrics summaries cover at most 366 inclusive UTC days. A filtered
|
|
56
|
+
empty page with a continuation is not the end of the list.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Releasing the agent tools
|
|
2
|
+
|
|
3
|
+
Releases contain the standalone client, public command metadata, skills and
|
|
4
|
+
user guides. Server and application implementations are not part of this package.
|
|
5
|
+
|
|
6
|
+
1. Update the version in `package.json`, its lockfile, MCP server identification,
|
|
7
|
+
plugin manifests and pinned installation examples. Record user-facing changes
|
|
8
|
+
in `CHANGELOG.md`.
|
|
9
|
+
2. Run `npm ci` and `npm run verify`. CI repeats the verification on Linux and
|
|
10
|
+
macOS. Review the package file list, license, public links and dependency audit.
|
|
11
|
+
3. Test browser login, one authorized read and one reversible command against
|
|
12
|
+
the intended environment using a dedicated test account. Check revocation and
|
|
13
|
+
confirm the deployed service supports the published command metadata.
|
|
14
|
+
4. Create a matching Git tag only for the reviewed commit. Publish the inspected
|
|
15
|
+
package with `npm publish --access public --tag beta` while it is a prerelease.
|
|
16
|
+
Publication may require the maintainer's npm authentication.
|
|
17
|
+
5. Check the registry version, MIT license, repository URL and distribution tags.
|
|
18
|
+
Install the registry artifact in a fresh directory and verify `--help`, MCP
|
|
19
|
+
startup and the included skills. Do not assume an upload updated every tag.
|
|
20
|
+
|
|
21
|
+
Keep experimental client changes unpublished until their server capabilities are
|
|
22
|
+
available. A public source commit, an npm release and a service rollout are
|
|
23
|
+
separate events and should be reported separately.
|