trainbud 0.5.0

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 (274) hide show
  1. package/.env.example +11 -0
  2. package/CHANGELOG.md +675 -0
  3. package/LICENSE +21 -0
  4. package/QUICKSTART.md +182 -0
  5. package/README.md +322 -0
  6. package/dist/appDb.d.ts +83 -0
  7. package/dist/appDb.d.ts.map +1 -0
  8. package/dist/appDb.js +239 -0
  9. package/dist/appDb.js.map +1 -0
  10. package/dist/check.d.ts +12 -0
  11. package/dist/check.d.ts.map +1 -0
  12. package/dist/check.js +230 -0
  13. package/dist/check.js.map +1 -0
  14. package/dist/cli.d.ts +3 -0
  15. package/dist/cli.d.ts.map +1 -0
  16. package/dist/cli.js +457 -0
  17. package/dist/cli.js.map +1 -0
  18. package/dist/config.d.ts +61 -0
  19. package/dist/config.d.ts.map +1 -0
  20. package/dist/config.js +241 -0
  21. package/dist/config.js.map +1 -0
  22. package/dist/dashboard.d.ts +8 -0
  23. package/dist/dashboard.d.ts.map +1 -0
  24. package/dist/dashboard.js +1004 -0
  25. package/dist/dashboard.js.map +1 -0
  26. package/dist/dashboardCharts.d.ts +99 -0
  27. package/dist/dashboardCharts.d.ts.map +1 -0
  28. package/dist/dashboardCharts.js +317 -0
  29. package/dist/dashboardCharts.js.map +1 -0
  30. package/dist/dashboardData.d.ts +89 -0
  31. package/dist/dashboardData.d.ts.map +1 -0
  32. package/dist/dashboardData.js +228 -0
  33. package/dist/dashboardData.js.map +1 -0
  34. package/dist/detect/baseline.d.ts +17 -0
  35. package/dist/detect/baseline.d.ts.map +1 -0
  36. package/dist/detect/baseline.js +62 -0
  37. package/dist/detect/baseline.js.map +1 -0
  38. package/dist/detect/countdown.d.ts +30 -0
  39. package/dist/detect/countdown.d.ts.map +1 -0
  40. package/dist/detect/countdown.js +79 -0
  41. package/dist/detect/countdown.js.map +1 -0
  42. package/dist/detect/detectors.d.ts +20 -0
  43. package/dist/detect/detectors.d.ts.map +1 -0
  44. package/dist/detect/detectors.js +291 -0
  45. package/dist/detect/detectors.js.map +1 -0
  46. package/dist/detect/findings.d.ts +29 -0
  47. package/dist/detect/findings.d.ts.map +1 -0
  48. package/dist/detect/findings.js +2 -0
  49. package/dist/detect/findings.js.map +1 -0
  50. package/dist/detect/forecast.d.ts +33 -0
  51. package/dist/detect/forecast.d.ts.map +1 -0
  52. package/dist/detect/forecast.js +122 -0
  53. package/dist/detect/forecast.js.map +1 -0
  54. package/dist/detect/index.d.ts +50 -0
  55. package/dist/detect/index.d.ts.map +1 -0
  56. package/dist/detect/index.js +114 -0
  57. package/dist/detect/index.js.map +1 -0
  58. package/dist/detect/sleepQuality.d.ts +21 -0
  59. package/dist/detect/sleepQuality.d.ts.map +1 -0
  60. package/dist/detect/sleepQuality.js +164 -0
  61. package/dist/detect/sleepQuality.js.map +1 -0
  62. package/dist/detect/trimp.d.ts +22 -0
  63. package/dist/detect/trimp.d.ts.map +1 -0
  64. package/dist/detect/trimp.js +77 -0
  65. package/dist/detect/trimp.js.map +1 -0
  66. package/dist/detect/week.d.ts +31 -0
  67. package/dist/detect/week.d.ts.map +1 -0
  68. package/dist/detect/week.js +184 -0
  69. package/dist/detect/week.js.map +1 -0
  70. package/dist/garmin/auth.d.ts +10 -0
  71. package/dist/garmin/auth.d.ts.map +1 -0
  72. package/dist/garmin/auth.js +81 -0
  73. package/dist/garmin/auth.js.map +1 -0
  74. package/dist/garmin/cache.d.ts +42 -0
  75. package/dist/garmin/cache.d.ts.map +1 -0
  76. package/dist/garmin/cache.js +141 -0
  77. package/dist/garmin/cache.js.map +1 -0
  78. package/dist/garmin/client.d.ts +22 -0
  79. package/dist/garmin/client.d.ts.map +1 -0
  80. package/dist/garmin/client.js +237 -0
  81. package/dist/garmin/client.js.map +1 -0
  82. package/dist/garmin/daily.d.ts +24 -0
  83. package/dist/garmin/daily.d.ts.map +1 -0
  84. package/dist/garmin/daily.js +96 -0
  85. package/dist/garmin/daily.js.map +1 -0
  86. package/dist/garmin/garminApiTypes.d.ts +70 -0
  87. package/dist/garmin/garminApiTypes.d.ts.map +1 -0
  88. package/dist/garmin/garminApiTypes.js +3 -0
  89. package/dist/garmin/garminApiTypes.js.map +1 -0
  90. package/dist/garmin/garminConnect.d.ts +17 -0
  91. package/dist/garmin/garminConnect.d.ts.map +1 -0
  92. package/dist/garmin/garminConnect.js +5 -0
  93. package/dist/garmin/garminConnect.js.map +1 -0
  94. package/dist/garmin/partial.d.ts +32 -0
  95. package/dist/garmin/partial.d.ts.map +1 -0
  96. package/dist/garmin/partial.js +38 -0
  97. package/dist/garmin/partial.js.map +1 -0
  98. package/dist/garmin/rawApi.d.ts +59 -0
  99. package/dist/garmin/rawApi.d.ts.map +1 -0
  100. package/dist/garmin/rawApi.js +113 -0
  101. package/dist/garmin/rawApi.js.map +1 -0
  102. package/dist/garmin/types.d.ts +85 -0
  103. package/dist/garmin/types.d.ts.map +1 -0
  104. package/dist/garmin/types.js +11 -0
  105. package/dist/garmin/types.js.map +1 -0
  106. package/dist/history/capture.d.ts +12 -0
  107. package/dist/history/capture.d.ts.map +1 -0
  108. package/dist/history/capture.js +63 -0
  109. package/dist/history/capture.js.map +1 -0
  110. package/dist/history/context.d.ts +51 -0
  111. package/dist/history/context.d.ts.map +1 -0
  112. package/dist/history/context.js +122 -0
  113. package/dist/history/context.js.map +1 -0
  114. package/dist/history/fallback.d.ts +72 -0
  115. package/dist/history/fallback.d.ts.map +1 -0
  116. package/dist/history/fallback.js +185 -0
  117. package/dist/history/fallback.js.map +1 -0
  118. package/dist/history/ingest.d.ts +44 -0
  119. package/dist/history/ingest.d.ts.map +1 -0
  120. package/dist/history/ingest.js +347 -0
  121. package/dist/history/ingest.js.map +1 -0
  122. package/dist/history/scheduler.d.ts +20 -0
  123. package/dist/history/scheduler.d.ts.map +1 -0
  124. package/dist/history/scheduler.js +54 -0
  125. package/dist/history/scheduler.js.map +1 -0
  126. package/dist/history/schema.d.ts +41 -0
  127. package/dist/history/schema.d.ts.map +1 -0
  128. package/dist/history/schema.js +91 -0
  129. package/dist/history/schema.js.map +1 -0
  130. package/dist/history/store.d.ts +112 -0
  131. package/dist/history/store.d.ts.map +1 -0
  132. package/dist/history/store.js +282 -0
  133. package/dist/history/store.js.map +1 -0
  134. package/dist/httpServer.d.ts +55 -0
  135. package/dist/httpServer.d.ts.map +1 -0
  136. package/dist/httpServer.js +1027 -0
  137. package/dist/httpServer.js.map +1 -0
  138. package/dist/index.d.ts +3 -0
  139. package/dist/index.d.ts.map +1 -0
  140. package/dist/index.js +11 -0
  141. package/dist/index.js.map +1 -0
  142. package/dist/mcpConfig.d.ts +56 -0
  143. package/dist/mcpConfig.d.ts.map +1 -0
  144. package/dist/mcpConfig.js +106 -0
  145. package/dist/mcpConfig.js.map +1 -0
  146. package/dist/pairApi.d.ts +14 -0
  147. package/dist/pairApi.d.ts.map +1 -0
  148. package/dist/pairApi.js +38 -0
  149. package/dist/pairApi.js.map +1 -0
  150. package/dist/paths.d.ts +45 -0
  151. package/dist/paths.d.ts.map +1 -0
  152. package/dist/paths.js +105 -0
  153. package/dist/paths.js.map +1 -0
  154. package/dist/profile.d.ts +123 -0
  155. package/dist/profile.d.ts.map +1 -0
  156. package/dist/profile.js +327 -0
  157. package/dist/profile.js.map +1 -0
  158. package/dist/promptApi.d.ts +43 -0
  159. package/dist/promptApi.d.ts.map +1 -0
  160. package/dist/promptApi.js +328 -0
  161. package/dist/promptApi.js.map +1 -0
  162. package/dist/promptSuggestions.d.ts +16 -0
  163. package/dist/promptSuggestions.d.ts.map +1 -0
  164. package/dist/promptSuggestions.js +141 -0
  165. package/dist/promptSuggestions.js.map +1 -0
  166. package/dist/selfTest.d.ts +53 -0
  167. package/dist/selfTest.d.ts.map +1 -0
  168. package/dist/selfTest.js +225 -0
  169. package/dist/selfTest.js.map +1 -0
  170. package/dist/server.d.ts +10 -0
  171. package/dist/server.d.ts.map +1 -0
  172. package/dist/server.js +67 -0
  173. package/dist/server.js.map +1 -0
  174. package/dist/setup.d.ts +2 -0
  175. package/dist/setup.d.ts.map +1 -0
  176. package/dist/setup.js +210 -0
  177. package/dist/setup.js.map +1 -0
  178. package/dist/toolErrors.d.ts +2 -0
  179. package/dist/toolErrors.d.ts.map +1 -0
  180. package/dist/toolErrors.js +18 -0
  181. package/dist/toolErrors.js.map +1 -0
  182. package/dist/tools/activities.d.ts +18 -0
  183. package/dist/tools/activities.d.ts.map +1 -0
  184. package/dist/tools/activities.js +182 -0
  185. package/dist/tools/activities.js.map +1 -0
  186. package/dist/tools/bodyComposition.d.ts +10 -0
  187. package/dist/tools/bodyComposition.d.ts.map +1 -0
  188. package/dist/tools/bodyComposition.js +139 -0
  189. package/dist/tools/bodyComposition.js.map +1 -0
  190. package/dist/tools/context.d.ts +8 -0
  191. package/dist/tools/context.d.ts.map +1 -0
  192. package/dist/tools/context.js +148 -0
  193. package/dist/tools/context.js.map +1 -0
  194. package/dist/tools/findings.d.ts +7 -0
  195. package/dist/tools/findings.d.ts.map +1 -0
  196. package/dist/tools/findings.js +51 -0
  197. package/dist/tools/findings.js.map +1 -0
  198. package/dist/tools/heartRate.d.ts +10 -0
  199. package/dist/tools/heartRate.d.ts.map +1 -0
  200. package/dist/tools/heartRate.js +105 -0
  201. package/dist/tools/heartRate.js.map +1 -0
  202. package/dist/tools/index.d.ts +66 -0
  203. package/dist/tools/index.d.ts.map +1 -0
  204. package/dist/tools/index.js +101 -0
  205. package/dist/tools/index.js.map +1 -0
  206. package/dist/tools/payloads.d.ts +148 -0
  207. package/dist/tools/payloads.d.ts.map +1 -0
  208. package/dist/tools/payloads.js +2 -0
  209. package/dist/tools/payloads.js.map +1 -0
  210. package/dist/tools/recovery.d.ts +31 -0
  211. package/dist/tools/recovery.d.ts.map +1 -0
  212. package/dist/tools/recovery.js +350 -0
  213. package/dist/tools/recovery.js.map +1 -0
  214. package/dist/tools/sleep.d.ts +10 -0
  215. package/dist/tools/sleep.d.ts.map +1 -0
  216. package/dist/tools/sleep.js +124 -0
  217. package/dist/tools/sleep.js.map +1 -0
  218. package/dist/tools/stress.d.ts +11 -0
  219. package/dist/tools/stress.d.ts.map +1 -0
  220. package/dist/tools/stress.js +108 -0
  221. package/dist/tools/stress.js.map +1 -0
  222. package/dist/tools/trainingInsights.d.ts +15 -0
  223. package/dist/tools/trainingInsights.d.ts.map +1 -0
  224. package/dist/tools/trainingInsights.js +79 -0
  225. package/dist/tools/trainingInsights.js.map +1 -0
  226. package/dist/tools/types.d.ts +12 -0
  227. package/dist/tools/types.d.ts.map +1 -0
  228. package/dist/tools/types.js +2 -0
  229. package/dist/tools/types.js.map +1 -0
  230. package/dist/tools/vo2Max.d.ts +11 -0
  231. package/dist/tools/vo2Max.d.ts.map +1 -0
  232. package/dist/tools/vo2Max.js +110 -0
  233. package/dist/tools/vo2Max.js.map +1 -0
  234. package/dist/tools/week.d.ts +12 -0
  235. package/dist/tools/week.d.ts.map +1 -0
  236. package/dist/tools/week.js +74 -0
  237. package/dist/tools/week.js.map +1 -0
  238. package/dist/usage.d.ts +104 -0
  239. package/dist/usage.d.ts.map +1 -0
  240. package/dist/usage.js +247 -0
  241. package/dist/usage.js.map +1 -0
  242. package/dist/utils/batch.d.ts +2 -0
  243. package/dist/utils/batch.d.ts.map +1 -0
  244. package/dist/utils/batch.js +18 -0
  245. package/dist/utils/batch.js.map +1 -0
  246. package/dist/utils/helpers.d.ts +32 -0
  247. package/dist/utils/helpers.d.ts.map +1 -0
  248. package/dist/utils/helpers.js +188 -0
  249. package/dist/utils/helpers.js.map +1 -0
  250. package/dist/utils/jsonFile.d.ts +19 -0
  251. package/dist/utils/jsonFile.d.ts.map +1 -0
  252. package/dist/utils/jsonFile.js +24 -0
  253. package/dist/utils/jsonFile.js.map +1 -0
  254. package/dist/utils/logger.d.ts +4 -0
  255. package/dist/utils/logger.d.ts.map +1 -0
  256. package/dist/utils/logger.js +97 -0
  257. package/dist/utils/logger.js.map +1 -0
  258. package/dist/utils/secretFile.d.ts +15 -0
  259. package/dist/utils/secretFile.d.ts.map +1 -0
  260. package/dist/utils/secretFile.js +47 -0
  261. package/dist/utils/secretFile.js.map +1 -0
  262. package/dist/utils/stdio.d.ts +10 -0
  263. package/dist/utils/stdio.d.ts.map +1 -0
  264. package/dist/utils/stdio.js +70 -0
  265. package/dist/utils/stdio.js.map +1 -0
  266. package/dist/version.d.ts +2 -0
  267. package/dist/version.d.ts.map +1 -0
  268. package/dist/version.js +7 -0
  269. package/dist/version.js.map +1 -0
  270. package/dist/watchApi.d.ts +264 -0
  271. package/dist/watchApi.d.ts.map +1 -0
  272. package/dist/watchApi.js +333 -0
  273. package/dist/watchApi.js.map +1 -0
  274. package/package.json +77 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zsadigzade
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.
package/QUICKSTART.md ADDED
@@ -0,0 +1,182 @@
1
+ # Quickstart
2
+
3
+ Get TrainBud running in about 5 minutes.
4
+
5
+ ## Prerequisites
6
+
7
+ - Node.js 20 or newer ([`.nvmrc`](./.nvmrc) included)
8
+ - A Garmin Connect account with synced device data
9
+ - Garmin Connect **MFA disabled** (the underlying library does not support MFA yet)
10
+
11
+ ## Recommended: one-command setup
12
+
13
+ ```bash
14
+ git clone https://github.com/Zsadigzade/trainbud.git
15
+ cd trainbud
16
+ npm install
17
+ npm run build
18
+ npm link # puts `trainbud` on your PATH
19
+ trainbud setup
20
+ ```
21
+
22
+ > `npm link` is what makes the bare `trainbud` command work. Without it every
23
+ > `trainbud ...` line below is "command not found", because TrainBud is not on
24
+ > the npm registry — so `trainbud` does **not** work either, and would run
25
+ > whatever gets published under that name in future. If you would rather not
26
+ > link, every command works as `node dist/index.js <command>` from the repo root.
27
+ > Undo with `npm unlink -g trainbud`.
28
+
29
+ The setup wizard will:
30
+
31
+ 1. Ask for your Garmin Connect email and password
32
+ 2. Save credentials to `.env`
33
+ 3. Authenticate with Garmin Connect
34
+ 4. Detect Cursor and Claude Desktop on your machine
35
+ 5. Offer to add TrainBud to your MCP client config automatically
36
+ 6. Optionally run a live API check against all 9 tools
37
+
38
+ After setup, **restart your MCP client completely** (Cursor or Claude Desktop), then ask:
39
+
40
+ - "What did I do today?"
41
+ - "How's my sleep been this week?"
42
+ - "Am I recovered enough to train hard?"
43
+
44
+ ### Claude Code: plugin or slash commands
45
+
46
+ **Plugin (recommended)** — skills + MCP in one install:
47
+
48
+ ```bash
49
+ /plugin marketplace add Zsadigzade/trainbud
50
+ /plugin install trainbud@trainbud
51
+ ```
52
+
53
+ Then `/trainbud:trainbud-setup` and `/trainbud:trainbud`.
54
+
55
+ **In-repo skills** — if you cloned the repo and run `claude` here:
56
+
57
+ 1. `/trainbud-setup` — guided install + MCP config + live check
58
+ 2. Restart MCP client
59
+ 3. `/trainbud` — ask any fitness question
60
+
61
+ See [`plugin/README.md`](./plugin/README.md) for plugin details.
62
+
63
+ ## Verify without an MCP client
64
+
65
+ After setup, you can confirm Garmin Connect access directly:
66
+
67
+ ```bash
68
+ trainbud check
69
+ ```
70
+
71
+ Example output:
72
+
73
+ ```text
74
+ TrainBud live check
75
+
76
+ get_latest_activity ✓ Activity: Morning Run, Distance: 5.2 km, Start: ...
77
+ get_activities_range ✓ 3 activities found
78
+ get_sleep_data ✓ 7 nights retrieved
79
+ get_heart_rate_trends ✓ 30-day trend loaded
80
+ get_recovery_status ✓ Score: 72 (Ready to train)
81
+ get_body_composition ✗ No body composition data found for the last 30 days.
82
+ get_stress_levels ✓ 7-day stress trend loaded
83
+ get_vo2_max_trends ✓ 30-day VO2 max trend loaded
84
+ get_training_insights ✓ Weekly summary generated
85
+
86
+ All 9 checks passed. TrainBud is ready to use.
87
+ ```
88
+
89
+ ## Manual setup (alternative)
90
+
91
+ If you prefer to configure files yourself:
92
+
93
+ ### 1. Install
94
+
95
+ ```bash
96
+ git clone https://github.com/Zsadigzade/trainbud.git
97
+ cd trainbud
98
+ npm install
99
+ ```
100
+
101
+ ### 2. Configure credentials
102
+
103
+ ```bash
104
+ cp .env.example .env
105
+ ```
106
+
107
+ Edit `.env`:
108
+
109
+ ```env
110
+ GARMIN_EMAIL=your@email.com
111
+ GARMIN_PASSWORD=yourpassword
112
+ ```
113
+
114
+ ### 3. Build and authenticate
115
+
116
+ ```bash
117
+ npm run build
118
+ trainbud auth
119
+ ```
120
+
121
+ You should see: `Garmin authentication successful. Session saved.`
122
+
123
+ ### 4. Connect to Cursor or Claude Desktop
124
+
125
+ **Cursor:** `%USERPROFILE%\.cursor\mcp.json` (Windows) or `~/.cursor/mcp.json` (macOS/Linux)
126
+
127
+ **Claude Desktop (Windows):** `%APPDATA%\Claude\claude_desktop_config.json`
128
+ **Claude Desktop (macOS):** `~/Library/Application Support/Claude/claude_desktop_config.json`
129
+
130
+ ```json
131
+ {
132
+ "mcpServers": {
133
+ "trainbud": {
134
+ "command": "node",
135
+ "args": ["C:/path/to/trainbud/dist/index.js", "start"],
136
+ "env": {
137
+ "GARMIN_EMAIL": "your@email.com",
138
+ "GARMIN_PASSWORD": "yourpassword"
139
+ }
140
+ }
141
+ }
142
+ }
143
+ ```
144
+
145
+ Restart your MCP client.
146
+
147
+ ## Web AI (claude.ai, ChatGPT)
148
+
149
+ For web AI platforms that require remote MCP connectors:
150
+
151
+ ```bash
152
+ trainbud serve
153
+ ```
154
+
155
+ Then expose via HTTPS tunnel and add to claude.ai Connectors. Full guide: [docs/WEB-MCP.md](./docs/WEB-MCP.md)
156
+
157
+ ## Useful commands
158
+
159
+ ```bash
160
+ trainbud setup # Interactive first-time setup (recommended)
161
+ trainbud serve # Remote HTTP MCP for web AI connectors
162
+ trainbud check # Live diagnostics against all tools
163
+ trainbud status # Check session + cache
164
+ trainbud cache clear # Force fresh data fetch
165
+ trainbud auth # Re-login if session expired
166
+ trainbud start # Start MCP server manually (stdio)
167
+ ```
168
+
169
+ ## Troubleshooting setup
170
+
171
+ | Issue | Fix |
172
+ |-------|-----|
173
+ | Authentication failed | Verify email/password; disable MFA at connect.garmin.com |
174
+ | MCP client doesn't see tools | Restart the client completely (not just reload window) |
175
+ | Stale data | Run `trainbud cache clear` |
176
+ | `dist/index.js` not found | Run `npm run build` |
177
+
178
+ ## Next steps
179
+
180
+ - [README.md](./README.md) — full reference
181
+ - [examples/prompts.md](./examples/prompts.md) — sample questions
182
+ - [docs/VAULT.md](./docs/VAULT.md) — architecture, branding, and design notes (Obsidian vault)
package/README.md ADDED
@@ -0,0 +1,322 @@
1
+ # TrainBud
2
+
3
+ **Talk to your training data.**
4
+
5
+ TrainBud is an open-source MCP server that connects your Garmin Connect fitness data to Claude, Cursor, and other AI assistants. Ask about workouts, sleep, heart rate, recovery, and body composition in plain English — privately, on your machine.
6
+
7
+ > **Disclaimer:** TrainBud is an unofficial community project. It is not affiliated with, endorsed by, or sponsored by Garmin Ltd. Garmin Connect is a trademark of Garmin Ltd.
8
+
9
+ [![CI](https://github.com/Zsadigzade/trainbud/actions/workflows/ci.yml/badge.svg)](https://github.com/Zsadigzade/trainbud/actions/workflows/ci.yml)
10
+ [![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](LICENSE)
11
+ [![Node 20+](https://img.shields.io/badge/node-%3E%3D20-brightgreen)](.nvmrc)
12
+
13
+ ## Try it
14
+
15
+ Once connected to your MCP client, ask things like:
16
+
17
+ - *"What did I do today?"*
18
+ - *"How's my sleep been this week?"*
19
+ - *"Am I recovered enough to train hard tomorrow?"*
20
+ - *"Is my resting heart rate trending down?"*
21
+
22
+ See [examples/prompts.md](./examples/prompts.md) for more ideas.
23
+
24
+ ## Why TrainBud
25
+
26
+ - **Private** — credentials stay in your local `.env`; data is cached on your machine
27
+ - **Local-first** — SQLite cache, session tokens in `.trainbud/`
28
+ - **Works everywhere** — Windows, macOS, Linux (Node.js 20+)
29
+ - **Any MCP client** — Claude Desktop, Cursor, and other stdio-compatible clients
30
+ - **Smart fetching** — batched API calls and automatic re-auth when sessions expire
31
+
32
+ ## Quick start
33
+
34
+ ```bash
35
+ npx trainbud setup
36
+ ```
37
+
38
+ The setup wizard walks you through credentials, authentication, and connecting Cursor or
39
+ Claude Desktop — no MCP config editing required. Then restart your MCP client and ask it
40
+ what you did today.
41
+
42
+ To keep `trainbud` on your PATH instead of typing `npx` every time:
43
+
44
+ ```bash
45
+ npm install -g trainbud
46
+ trainbud setup
47
+ ```
48
+
49
+ Needs Node 20+. Full walkthrough: [QUICKSTART.md](./QUICKSTART.md)
50
+
51
+ <details>
52
+ <summary><b>From source</b> (for contributors, or to run an unreleased commit)</summary>
53
+
54
+ ```bash
55
+ git clone https://github.com/Zsadigzade/trainbud.git
56
+ cd trainbud
57
+ npm install
58
+ npm run build
59
+ npm link # puts `trainbud` on your PATH; undo with `npm unlink -g trainbud`
60
+ trainbud setup
61
+ ```
62
+
63
+ Without `npm link`, every `trainbud <command>` in this README is
64
+ `node dist/index.js <command>` run from the repo root. If `dist/` does not exist yet,
65
+ run `npm run build` first.
66
+ </details>
67
+
68
+ ## Claude Code plugin (recommended)
69
+
70
+ Install as a [Claude Code plugin](https://code.claude.com/docs/en/plugins) — skills **and** MCP server in one step:
71
+
72
+ ```bash
73
+ /plugin marketplace add Zsadigzade/trainbud
74
+ /plugin install trainbud@trainbud
75
+ ```
76
+
77
+ Set credentials, then restart Claude Code:
78
+
79
+ ```bash
80
+ export GARMIN_EMAIL="your@email.com"
81
+ export GARMIN_PASSWORD="yourpassword"
82
+ ```
83
+
84
+ | Command | What it does |
85
+ |---------|----------------|
86
+ | `/trainbud:trainbud-setup` | First-time setup and diagnostics |
87
+ | `/trainbud:trainbud` | Ask about workouts, sleep, recovery, HR, stress, VO2 max |
88
+
89
+ Plugin files live in [`plugin/`](./plugin/). See [`plugin/README.md`](./plugin/README.md).
90
+
91
+ ## Claude Code skills (in-repo)
92
+
93
+ This repo also ships project skills in [`.claude/skills/`](./.claude/skills/) for development without installing the plugin:
94
+
95
+ | Command | What it does |
96
+ |---------|----------------|
97
+ | `/trainbud-setup` | Install, authenticate, configure MCP, run live check |
98
+ | `/trainbud` | Ask about workouts, sleep, recovery, HR, stress, VO2 max |
99
+
100
+ Open the repo in **Claude Code** (`claude` in this directory) — skills load automatically.
101
+
102
+ To use skills in **every** project without the plugin, copy them to `~/.claude/skills/`.
103
+
104
+ After setup, restart your MCP client and try `/trainbud` with *"What did I do today?"*
105
+
106
+ ## Dashboard
107
+
108
+ `trainbud serve` hosts a dashboard at `/dashboard`. It is phone-first, because the
109
+ pairing flow is: you are standing next to the watch holding a phone when you approve a
110
+ code.
111
+
112
+ It shows what stands out today against your own baselines, this week against last week,
113
+ and resting heart rate and sleep plotted against your own 30-day median — all read from
114
+ the local history store, so it paints instantly and works even when your Connect session
115
+ has expired. **A break in a line is a day with no measurement, not a zero.**
116
+
117
+ It is also where you tell TrainBud who it is talking to:
118
+
119
+ | Setting | What it changes |
120
+ |---|---|
121
+ | Name, units, primary sport, weekly goal | Every renderer, and what the AI is told about you |
122
+ | Thresholds | Where green becomes amber and amber becomes red — on the watch too |
123
+ | Watch cards | Which cards appear on the wrist and in what order, live on the next sync |
124
+ | AI model, tone, answer length | How the Ask card and the daily insight sound |
125
+ | Your own Ask questions | Up to five, 32 characters each. They lead the watch's Ask menu; the rest of the slots stay generated from what fired |
126
+ | Monthly spending cap | Optional. Refuses an Ask past the cap instead of spending past it |
127
+ | Privacy | Local feature counters, on by default, with a delete button |
128
+
129
+ **Usage.** TrainBud runs on your own AI provider key, so every question and every daily
130
+ insight is charged to you. The dashboard shows the tokens and cost per call, the month to
131
+ date, and a 30-day chart. A model this build has no published price for is recorded with
132
+ its cost left *unknown* rather than as zero — a call priced at zero would make a cap that
133
+ can never trip.
134
+
135
+ Nothing on this page leaves your machine. There is no endpoint to send it to.
136
+
137
+ ## Garmin watch widget (Connect IQ)
138
+
139
+ View recovery, sleep, activity, stress, and VO2 max on your Garmin watch via a Connect IQ widget in [`ciq/`](./ciq/).
140
+
141
+ **Requires:** `trainbud serve` running + HTTPS tunnel (same setup as web AI).
142
+
143
+ 1. Start the server and tunnel:
144
+ ```bash
145
+ trainbud serve
146
+ cloudflared tunnel --url http://127.0.0.1:3847
147
+ ```
148
+ 2. Build and sideload the widget — see [ciq/README.md](./ciq/README.md)
149
+ 3. In **Garmin Connect Mobile** → Connect IQ → TrainBud settings, set:
150
+ - **Server URL** — your tunnel URL (e.g. `https://abc.trycloudflare.com`)
151
+ 4. Open the widget on your watch — it shows a pairing code. Approve it in the dashboard (`/dashboard?token=YOUR_API_KEY`) to complete setup. The dashboard swaps that token for a session cookie and drops it from the URL, so the address bar is safe to screenshot afterwards.
152
+
153
+ The glance shows recovery and sleep from the last cached summary, so it renders without
154
+ waiting on the network. Open it and tap or swipe to cycle through the cards you left switched on in the dashboard. The watch
155
+ calls `GET /api/watch` — a compact JSON summary, not the full MCP protocol.
156
+
157
+ ## Connect to Claude Desktop
158
+
159
+ Edit `claude_desktop_config.json`:
160
+
161
+ **Windows:** `%APPDATA%\Claude\claude_desktop_config.json`
162
+ **macOS:** `~/Library/Application Support/Claude/claude_desktop_config.json`
163
+
164
+ ```json
165
+ {
166
+ "mcpServers": {
167
+ "trainbud": {
168
+ "command": "node",
169
+ "args": ["C:/path/to/trainbud/dist/index.js", "start"],
170
+ "env": {
171
+ "GARMIN_EMAIL": "your@email.com",
172
+ "GARMIN_PASSWORD": "yourpassword"
173
+ }
174
+ }
175
+ }
176
+ }
177
+ ```
178
+
179
+ With `trainbud` on your PATH (`npm install -g trainbud`, or `npm link` from a clone),
180
+ point the client at the command instead of a path:
181
+
182
+ ```json
183
+ {
184
+ "mcpServers": {
185
+ "trainbud": {
186
+ "command": "trainbud",
187
+ "args": ["start"]
188
+ }
189
+ }
190
+ }
191
+ ```
192
+
193
+ Restart your MCP client, then start asking questions.
194
+
195
+ ## Tools
196
+
197
+ | Tool | What it answers |
198
+ |------|-----------------|
199
+ | `get_latest_activity` | Your most recent workout — distance, pace, HR, elevation |
200
+ | `get_activities_range` | Activities between two dates |
201
+ | `get_sleep_data` | Sleep duration, stages, score, awakenings |
202
+ | `get_heart_rate_trends` | Resting, max, and average HR over time |
203
+ | `get_recovery_status` | Recovery score from HRV, sleep, stress, resting HR |
204
+ | `get_body_composition` | Weight, body fat, and muscle mass trends |
205
+ | `get_stress_levels` | Daily stress averages and trends |
206
+ | `get_vo2_max_trends` | VO2 max fitness trends over time |
207
+ | `get_training_insights` | Combined weekly summary (activities, sleep, recovery, stress) |
208
+ | `get_findings` | What stands out against **your own** 28-day baselines, not a population average |
209
+ | `get_week_review` | This week against last, the load forecast, sleep debt, and your next race |
210
+ | `remember_context` | Record a goal, a race and its date, an injury, or a note |
211
+ | `get_user_context` | What is on record about you, on any date |
212
+ | `log_subjective` | How a session actually felt — RPE, soreness, mood |
213
+
214
+ ## CLI
215
+
216
+ ```bash
217
+ trainbud setup # Interactive first-time setup (recommended)
218
+ trainbud serve # Remote HTTP MCP for web AI (claude.ai, ChatGPT)
219
+ trainbud check # Live diagnostics against all tools
220
+ trainbud doctor # What the watch would see: public URL, AI key, history depth
221
+ trainbud backfill # Pull Garmin history into the local store (resumable)
222
+ trainbud findings # What stands out against your own baselines
223
+ trainbud start # Start the MCP server (stdio)
224
+ trainbud auth # Force re-authentication
225
+ trainbud cache clear # Clear cached data
226
+ trainbud status # Show session and cache status
227
+ trainbud --version # Print version
228
+ ```
229
+
230
+ Every one of these also works as `npx trainbud <command>` without installing anything.
231
+
232
+ ### Troubleshooting: `trainbud: command not found`
233
+
234
+ Either use `npx trainbud <command>`, or install it globally with
235
+ `npm install -g trainbud`. Running from a clone instead? Run `npm link` once from the
236
+ repo root, or call the built entry point directly with `node dist/index.js doctor`
237
+ (after `npm run build`).
238
+
239
+ ## Configuration
240
+
241
+ | Variable | Default | Description |
242
+ |----------|---------|-------------|
243
+ | `GARMIN_EMAIL` | — | Garmin Connect email |
244
+ | `GARMIN_PASSWORD` | — | Garmin Connect password |
245
+ | `TRAINBUD_SESSION_PATH` | `.trainbud/session.json` | Session token storage |
246
+ | `TRAINBUD_LOG_PATH` | `.trainbud/mcp.log` | Log file path |
247
+ | `TRAINBUD_CACHE_PATH` | `.trainbud/cache.db` | SQLite cache database |
248
+ | `CACHE_TTL_ACTIVITIES` | `1800` | Activity cache TTL (seconds) |
249
+ | `CACHE_TTL_SLEEP` | `7200` | Sleep cache TTL (seconds) |
250
+ | `CACHE_TTL_STATS` | `3600` | Stats cache TTL (seconds) |
251
+ | `TRAINBUD_API_KEY` | auto-generated | Bearer token for HTTP MCP (`trainbud serve`) |
252
+ | `TRAINBUD_HOST` | `127.0.0.1` | Bind host for HTTP server |
253
+ | `TRAINBUD_PORT` | `3847` | Bind port for HTTP server |
254
+
255
+ ## Security & privacy
256
+
257
+ - Credentials live only in your local `.env` file — never sent to a third party
258
+ - Session tokens in `.trainbud/session.json` are as sensitive as a password
259
+ - Tool errors are sanitized before reaching the AI client
260
+ - Uses the unofficial [`garmin-connect`](https://www.npmjs.com/package/garmin-connect) npm package (not Garmin's enterprise OAuth API)
261
+ - **MFA is not supported** by the underlying library — disable MFA or use an app-specific password
262
+ - The server binds `127.0.0.1` by default. It is only reachable from the internet if
263
+ you point a tunnel at it, and every route except `/health` needs the API key
264
+ - The dashboard takes the key once, on `/dashboard?token=…`, then trades it for an
265
+ `HttpOnly` session cookie and redirects to a clean URL — so the key does not sit in
266
+ your address bar, your history, or a screenshot
267
+ - **A paired watch holds the API key itself**, not a scoped per-device token. Pairing
268
+ approval hands over the same key that opens the dashboard and `/mcp`. Revoke a watch
269
+ by changing `TRAINBUD_API_KEY` and pairing again. A narrower per-device token is
270
+ planned; until then, treat pairing as handing out a password
271
+
272
+ ### What TrainBud is not
273
+
274
+ - **Not a hosted service.** There is no TrainBud account and no TrainBud server. You run
275
+ it, on your machine, against your own Garmin credentials
276
+ - **Not an official Garmin integration.** It drives an unofficial library against the
277
+ Connect web API. Garmin can change that API without notice, and does
278
+ - **Not MFA-compatible.** If your Connect account has MFA on, this will not log in
279
+ - **Not free to ask.** The AI features run on your own Anthropic key and are billed to
280
+ you. The dashboard meters every call and can refuse past a cap you set
281
+
282
+ ## Troubleshooting
283
+
284
+ | Issue | Fix |
285
+ |-------|-----|
286
+ | Authentication failed | Verify `.env` credentials, run `trainbud auth` |
287
+ | MFA enabled on account | Disable MFA or use an app-specific password |
288
+ | Stale data | Run `trainbud cache clear` |
289
+ | Rate limited | Wait 60 seconds; cached responses are used when available |
290
+ | Watch shows "Not a TrainBud server" or error -400 | Your public URL is answering with something that is not TrainBud's JSON — usually a tunnel that is down. Run `trainbud doctor`; it says exactly what came back |
291
+ | Watch shows "Watch not authorised" | The API key changed since the watch paired. Pair it again from the dashboard |
292
+ | Watch shows "AI not set up" | AI is bring-your-own-key. Paste an Anthropic key into the dashboard |
293
+ | No sleep/HR data | Ensure your Garmin device has synced to Garmin Connect |
294
+ | Server won't start | Check that `GARMIN_EMAIL` and `GARMIN_PASSWORD` are set in `.env` |
295
+
296
+ ## Development
297
+
298
+ ```bash
299
+ npm install
300
+ npm run build
301
+ npm test # 551 tests via the Node test runner
302
+ npm run lint
303
+ npm run dev # Start with auto-reload
304
+ ```
305
+
306
+ Use `.nvmrc` with nvm/fnm for Node 20. If your project path contains `#`, use `npm test` instead of `npm run test:vitest`.
307
+
308
+ See [CONTRIBUTING.md](./CONTRIBUTING.md) and [docs/VAULT.md](./docs/VAULT.md) for architecture and design notes (Obsidian vault, outside this repo).
309
+
310
+ ## Roadmap
311
+
312
+ - [x] VO2 max trends
313
+ - [x] Stress levels
314
+ - [x] Training insights
315
+ - [ ] Workout comparison
316
+ - [ ] Docker image
317
+
318
+ ## License
319
+
320
+ MIT — see [LICENSE](./LICENSE).
321
+
322
+ Garmin Connect is a trademark of Garmin Ltd. This project is not affiliated with Garmin Ltd.
@@ -0,0 +1,83 @@
1
+ import Database from "better-sqlite3";
2
+ export interface PairToken {
3
+ code: string;
4
+ created_at: number;
5
+ expires_at: number;
6
+ approved_at: number | null;
7
+ }
8
+ export interface PromptJob {
9
+ id: string;
10
+ prompt: string;
11
+ status: "pending" | "running" | "done" | "error";
12
+ result: string | null;
13
+ error: string | null;
14
+ created_at: number;
15
+ completed_at: number | null;
16
+ }
17
+ export declare const APP_DB_SCHEMA = "\n CREATE TABLE IF NOT EXISTS settings (\n key TEXT PRIMARY KEY,\n value TEXT NOT NULL\n );\n CREATE TABLE IF NOT EXISTS pair_tokens (\n code TEXT PRIMARY KEY,\n created_at INTEGER NOT NULL,\n expires_at INTEGER NOT NULL,\n approved_at INTEGER\n );\n CREATE TABLE IF NOT EXISTS prompt_jobs (\n id TEXT PRIMARY KEY,\n prompt TEXT NOT NULL,\n status TEXT NOT NULL DEFAULT 'pending',\n result TEXT,\n error TEXT,\n created_at INTEGER NOT NULL,\n completed_at INTEGER\n );\n\n -- Usage. cost_usd is nullable ON PURPOSE: a model this build has no\n -- published price for records its tokens and leaves the cost unknown,\n -- because a call priced at zero is a monthly cap that can never trip.\n -- The schema lives here rather than in usage.ts so that opening the\n -- database does not have to import the module that writes to it.\n CREATE TABLE IF NOT EXISTS ai_usage (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n at INTEGER NOT NULL,\n kind TEXT NOT NULL,\n model TEXT NOT NULL,\n source TEXT NOT NULL,\n input_tokens INTEGER NOT NULL,\n output_tokens INTEGER NOT NULL,\n cache_read_tokens INTEGER NOT NULL DEFAULT 0,\n cache_write_tokens INTEGER NOT NULL DEFAULT 0,\n cost_usd REAL\n );\n CREATE INDEX IF NOT EXISTS ai_usage_at ON ai_usage(at);\n\n CREATE TABLE IF NOT EXISTS feature_usage (\n name TEXT NOT NULL,\n day TEXT NOT NULL,\n count INTEGER NOT NULL,\n PRIMARY KEY (name, day)\n );\n";
18
+ /**
19
+ * The open handle, for modules that own their own tables.
20
+ *
21
+ * `usage.ts` needs to read and write two tables of its own; routing that
22
+ * through a per-statement wrapper here would put its SQL in a file that has
23
+ * nothing to do with metering. The connection stays owned in one place -- this
24
+ * hands out the handle, not a second one.
25
+ */
26
+ export declare function getAppDb(): Database.Database;
27
+ export declare function getSetting(key: string): string | null;
28
+ export declare function setSetting(key: string, value: string): void;
29
+ export declare function deleteSetting(key: string): void;
30
+ /** Setting keys starting with `prefix`, used to prune dated cache entries. */
31
+ export declare function listSettingKeys(prefix: string): string[];
32
+ /**
33
+ * A pair code is a bearer credential in disguise: /api/pair is unauthenticated
34
+ * by design, and /api/pair/<code>/status hands out the API key as soon as that
35
+ * code is approved. Math.random() was the source here, which means an attacker
36
+ * who mints a handful of codes from the open endpoint can recover the PRNG
37
+ * state and predict the code the real watch is displaying. randomInt draws from
38
+ * the CSPRNG, uniformly and without modulo bias, and zero-padding keeps the
39
+ * full six-digit space (including 000042) in play.
40
+ */
41
+ export declare function generatePairCode(): string;
42
+ export declare function createPairToken(): PairToken;
43
+ export declare function getPairToken(code: string): PairToken | null;
44
+ export declare function approvePairToken(code: string): boolean;
45
+ export declare function deletePairToken(code: string): void;
46
+ export declare function listPendingPairTokens(): PairToken[];
47
+ /**
48
+ * How old an unfinished job has to be before it counts as wreckage.
49
+ *
50
+ * The watch polls a job id for about thirty seconds and then gives up, so
51
+ * anything younger than that is, or was until moments ago, an answer somebody
52
+ * is waiting for. Five minutes leaves room for a slow model call as well.
53
+ */
54
+ export declare const STALE_PROMPT_JOB_SECONDS: number;
55
+ /**
56
+ * A job the process died in the middle of is not still running.
57
+ *
58
+ * THIS USED TO RUN INSIDE `getDb()`, so the first time ANY process opened
59
+ * app.db it flipped every pending and running row to
60
+ * "The server stopped before this answer came back." -- including the rows
61
+ * belonging to a `serve` that was, at that moment, waiting on Anthropic. Every
62
+ * entry point opens this file, so asking a question on the watch and then
63
+ * running `trainbud doctor`, `status`, `findings` or a backfill killed the live
64
+ * answer from another process, and the watch drew "AI unavailable".
65
+ *
66
+ * Two changes, and both are needed. It is called once, from `serve` at startup,
67
+ * so a CLI command no longer writes to a server's table at all. And it will not
68
+ * touch a job younger than STALE_PROMPT_JOB_SECONDS, which is what protects a
69
+ * second server on the same box, and a restart racing an answer that is still
70
+ * in flight.
71
+ */
72
+ export declare function reconcileStalePromptJobs(db: Database.Database, now?: number): void;
73
+ /** Called once by `serve`, which is the only process that owns these jobs. */
74
+ export declare function reconcilePromptJobsOnStartup(): void;
75
+ export declare function createPromptJob(id: string, prompt: string): PromptJob;
76
+ export declare function getPromptJob(id: string): PromptJob | null;
77
+ export declare function updatePromptJob(id: string, update: {
78
+ status: PromptJob["status"];
79
+ result?: string;
80
+ error?: string;
81
+ }): void;
82
+ export declare function closeAppDb(): void;
83
+ //# sourceMappingURL=appDb.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"appDb.d.ts","sourceRoot":"","sources":["../src/appDb.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AActC,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CAC5B;AAED,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,MAAM,EAAE,MAAM,CAAC;IACf,MAAM,EAAE,SAAS,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;IACjD,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAC;CAC7B;AAID,eAAO,MAAM,aAAa,2pDA8CzB,CAAC;AAqBF;;;;;;;GAOG;AACH,wBAAgB,QAAQ,IAAI,QAAQ,CAAC,QAAQ,CAE5C;AAID,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAKrD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,IAAI,CAI3D;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAE/C;AAED,8EAA8E;AAC9E,wBAAgB,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAKxD;AAMD;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC;AAED,wBAAgB,eAAe,IAAI,SAAS,CAqB3C;AAED,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAK3D;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAStD;AAED,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAElD;AAED,wBAAgB,qBAAqB,IAAI,SAAS,EAAE,CAKnD;AAOD;;;;;;GAMG;AACH,eAAO,MAAM,wBAAwB,QAAS,CAAC;AAE/C;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,wBAAwB,CACtC,EAAE,EAAE,QAAQ,CAAC,QAAQ,EACrB,GAAG,SAAgC,GAClC,IAAI,CAWN;AAOD,8EAA8E;AAC9E,wBAAgB,4BAA4B,IAAI,IAAI,CAEnD;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,SAAS,CAarE;AAED,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAKzD;AAED,wBAAgB,eAAe,CAC7B,EAAE,EAAE,MAAM,EACV,MAAM,EAAE;IAAE,MAAM,EAAE,SAAS,CAAC,QAAQ,CAAC,CAAC;IAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IAAC,KAAK,CAAC,EAAE,MAAM,CAAA;CAAE,GACvE,IAAI,CAWN;AAED,wBAAgB,UAAU,IAAI,IAAI,CAKjC"}