@thebriangao/totem 1.4.4 → 2.0.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.
- package/.dev.vars.example +5 -0
- package/.dockerignore +5 -0
- package/.env.example +29 -20
- package/CHANGELOG.md +99 -1
- package/CONTRIBUTING.md +48 -116
- package/Dockerfile +46 -12
- package/README.md +172 -498
- package/SECURITY.md +36 -59
- package/TOOLS.md +448 -311
- package/WHOOP.md +497 -2659
- package/assets/brand/SOURCES.md +38 -0
- package/assets/brand/totem.png +0 -0
- package/assets/brand/totem.svg +13 -0
- package/assets/fonts/Manrope-OFL.txt +93 -0
- package/assets/fonts/manrope-latin.woff2 +0 -0
- package/dist/build_info.js +5 -0
- package/dist/build_info.js.map +1 -0
- package/dist/cli/app.js +675 -0
- package/dist/cli/app.js.map +1 -0
- package/dist/cli/auth.js +297 -0
- package/dist/cli/auth.js.map +1 -0
- package/dist/cli/auth_flow.js +268 -0
- package/dist/cli/auth_flow.js.map +1 -0
- package/dist/cli/browser_login.js +368 -0
- package/dist/cli/browser_login.js.map +1 -0
- package/dist/cli/clients.js +403 -0
- package/dist/cli/clients.js.map +1 -0
- package/dist/cli/deploy_record.js +96 -0
- package/dist/cli/deploy_record.js.map +1 -0
- package/dist/cli/index.js +39 -575
- package/dist/cli/index.js.map +1 -1
- package/dist/cli/links.js +28 -0
- package/dist/cli/links.js.map +1 -0
- package/dist/cli/logo.js +63 -0
- package/dist/cli/logo.js.map +1 -0
- package/dist/cli/setup.js +1157 -1017
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/spawn.js +80 -0
- package/dist/cli/spawn.js.map +1 -0
- package/dist/cli/sys.js +219 -0
- package/dist/cli/sys.js.map +1 -0
- package/dist/cli/ui.js +712 -463
- package/dist/cli/ui.js.map +1 -1
- package/dist/cli/update.js +425 -282
- package/dist/cli/update.js.map +1 -1
- package/dist/cloudflare/token_store.js +48 -0
- package/dist/cloudflare/token_store.js.map +1 -0
- package/dist/cloudflare/worker.js +155 -0
- package/dist/cloudflare/worker.js.map +1 -0
- package/dist/data/behaviors.js +2733 -617
- package/dist/data/behaviors.js.map +1 -1
- package/dist/data/endpoint_catalog.js +2681 -0
- package/dist/data/endpoint_catalog.js.map +1 -0
- package/dist/data/exercises.js +373 -4859
- package/dist/data/exercises.js.map +1 -1
- package/dist/data/garments.js +19 -0
- package/dist/data/garments.js.map +1 -0
- package/dist/data/sports.js +219 -208
- package/dist/data/sports.js.map +1 -1
- package/dist/lib/activity_list.js +123 -0
- package/dist/lib/activity_list.js.map +1 -0
- package/dist/lib/activity_records.js +195 -0
- package/dist/lib/activity_records.js.map +1 -0
- package/dist/lib/activity_results.js +44 -0
- package/dist/lib/activity_results.js.map +1 -0
- package/dist/lib/activity_types.js +164 -0
- package/dist/lib/activity_types.js.map +1 -0
- package/dist/lib/brand.js +63 -0
- package/dist/lib/brand.js.map +1 -0
- package/dist/lib/clock.js +24 -0
- package/dist/lib/clock.js.map +1 -0
- package/dist/lib/coach_session.js +345 -0
- package/dist/lib/coach_session.js.map +1 -0
- package/dist/lib/concurrency.js.map +1 -1
- package/dist/lib/dates.js +19 -0
- package/dist/lib/dates.js.map +1 -1
- package/dist/lib/env_file.js +195 -0
- package/dist/lib/env_file.js.map +1 -0
- package/dist/lib/health_plans_write.js +44 -0
- package/dist/lib/health_plans_write.js.map +1 -0
- package/dist/lib/heart_rate.js +34 -0
- package/dist/lib/heart_rate.js.map +1 -0
- package/dist/lib/highlight.js +81 -0
- package/dist/lib/highlight.js.map +1 -0
- package/dist/lib/install_links.js +47 -0
- package/dist/lib/install_links.js.map +1 -0
- package/dist/lib/instant.js +50 -0
- package/dist/lib/instant.js.map +1 -0
- package/dist/lib/journal_behaviors.js +382 -0
- package/dist/lib/journal_behaviors.js.map +1 -0
- package/dist/lib/lift_catalog.js +218 -0
- package/dist/lib/lift_catalog.js.map +1 -0
- package/dist/lib/lift_history.js +66 -0
- package/dist/lib/lift_history.js.map +1 -0
- package/dist/lib/lift_sets.js +146 -0
- package/dist/lib/lift_sets.js.map +1 -0
- package/dist/lib/lift_tool.js +20 -0
- package/dist/lib/lift_tool.js.map +1 -0
- package/dist/lib/profile_settings.js +101 -0
- package/dist/lib/profile_settings.js.map +1 -0
- package/dist/lib/screen_content.js +44 -0
- package/dist/lib/screen_content.js.map +1 -0
- package/dist/lib/timezone.js +48 -6
- package/dist/lib/timezone.js.map +1 -1
- package/dist/lib/walk.js +6 -1
- package/dist/lib/walk.js.map +1 -1
- package/dist/lib/weight_readings.js +61 -0
- package/dist/lib/weight_readings.js.map +1 -0
- package/dist/projections/activities.js +193 -0
- package/dist/projections/activities.js.map +1 -0
- package/dist/projections/alarm_schedule.js +102 -0
- package/dist/projections/alarm_schedule.js.map +1 -0
- package/dist/projections/coach.js +203 -0
- package/dist/projections/coach.js.map +1 -0
- package/dist/projections/community.js +165 -0
- package/dist/projections/community.js.map +1 -0
- package/dist/projections/health_features.js +167 -0
- package/dist/projections/health_features.js.map +1 -0
- package/dist/projections/hormonal_insights.js +239 -0
- package/dist/projections/hormonal_insights.js.map +1 -0
- package/dist/projections/journal_v2.js +157 -0
- package/dist/projections/journal_v2.js.map +1 -0
- package/dist/projections/lift_cards.js +115 -0
- package/dist/projections/lift_cards.js.map +1 -0
- package/dist/projections/lift_exercise_v2.js +131 -0
- package/dist/projections/lift_exercise_v2.js.map +1 -0
- package/dist/projections/lift_library_v2.js +67 -0
- package/dist/projections/lift_library_v2.js.map +1 -0
- package/dist/projections/lift_sessions.js +211 -0
- package/dist/projections/lift_sessions.js.map +1 -0
- package/dist/projections/memory.js +95 -0
- package/dist/projections/memory.js.map +1 -0
- package/dist/projections/milestones.js +119 -0
- package/dist/projections/milestones.js.map +1 -0
- package/dist/projections/profile_v2.js +150 -0
- package/dist/projections/profile_v2.js.map +1 -0
- package/dist/projections/settings_v2.js +153 -0
- package/dist/projections/settings_v2.js.map +1 -0
- package/dist/projections/sleep.js +4 -21
- package/dist/projections/sleep.js.map +1 -1
- package/dist/projections/v2/calendar.js +43 -0
- package/dist/projections/v2/calendar.js.map +1 -0
- package/dist/projections/v2/core_common.js +86 -0
- package/dist/projections/v2/core_common.js.map +1 -0
- package/dist/projections/v2/core_home.js +136 -0
- package/dist/projections/v2/core_home.js.map +1 -0
- package/dist/projections/v2/core_sleep_need.js +23 -0
- package/dist/projections/v2/core_sleep_need.js.map +1 -0
- package/dist/projections/v2/day.js +92 -0
- package/dist/projections/v2/day.js.map +1 -0
- package/dist/projections/v2/heart_rate.js +54 -0
- package/dist/projections/v2/heart_rate.js.map +1 -0
- package/dist/projections/v2/history.js +140 -0
- package/dist/projections/v2/history.js.map +1 -0
- package/dist/projections/v2/now.js +39 -0
- package/dist/projections/v2/now.js.map +1 -0
- package/dist/projections/v2/recovery.js +77 -0
- package/dist/projections/v2/recovery.js.map +1 -0
- package/dist/projections/v2/sleep.js +218 -0
- package/dist/projections/v2/sleep.js.map +1 -0
- package/dist/projections/v2/strain.js +39 -0
- package/dist/projections/v2/strain.js.map +1 -0
- package/dist/projections/v2/stress.js +92 -0
- package/dist/projections/v2/stress.js.map +1 -0
- package/dist/projections/v2/trend.js +205 -0
- package/dist/projections/v2/trend.js.map +1 -0
- package/dist/projections/weekly_plan.js +66 -0
- package/dist/projections/weekly_plan.js.map +1 -0
- package/dist/projections/weight_readings.js +57 -0
- package/dist/projections/weight_readings.js.map +1 -0
- package/dist/projections/workout.js +37 -15
- package/dist/projections/workout.js.map +1 -1
- package/dist/schemas/activities.js +123 -0
- package/dist/schemas/activities.js.map +1 -0
- package/dist/schemas/alarm_schedule.js +62 -0
- package/dist/schemas/alarm_schedule.js.map +1 -0
- package/dist/schemas/coach.js +76 -8
- package/dist/schemas/coach.js.map +1 -1
- package/dist/schemas/community.js +70 -0
- package/dist/schemas/community.js.map +1 -0
- package/dist/schemas/health.js +36 -0
- package/dist/schemas/health.js.map +1 -0
- package/dist/schemas/hormonal_insights.js +90 -0
- package/dist/schemas/hormonal_insights.js.map +1 -0
- package/dist/schemas/journal.js +4 -0
- package/dist/schemas/journal.js.map +1 -1
- package/dist/schemas/journal_v2.js +106 -0
- package/dist/schemas/journal_v2.js.map +1 -0
- package/dist/schemas/memory.js +42 -0
- package/dist/schemas/memory.js.map +1 -0
- package/dist/schemas/milestones.js +39 -0
- package/dist/schemas/milestones.js.map +1 -0
- package/dist/schemas/profile_v2.js +60 -0
- package/dist/schemas/profile_v2.js.map +1 -0
- package/dist/schemas/settings_v2.js +56 -0
- package/dist/schemas/settings_v2.js.map +1 -0
- package/dist/schemas/sleep.js +8 -1
- package/dist/schemas/sleep.js.map +1 -1
- package/dist/schemas/strength.js +10 -1
- package/dist/schemas/strength.js.map +1 -1
- package/dist/schemas/strength_v2.js +190 -0
- package/dist/schemas/strength_v2.js.map +1 -0
- package/dist/schemas/v2/calendar.js +8 -0
- package/dist/schemas/v2/calendar.js.map +1 -0
- package/dist/schemas/v2/core_common.js +42 -0
- package/dist/schemas/v2/core_common.js.map +1 -0
- package/dist/schemas/v2/day.js +73 -0
- package/dist/schemas/v2/day.js.map +1 -0
- package/dist/schemas/v2/now.js +25 -0
- package/dist/schemas/v2/now.js.map +1 -0
- package/dist/schemas/v2/recovery.js +35 -0
- package/dist/schemas/v2/recovery.js.map +1 -0
- package/dist/schemas/v2/sleep.js +44 -0
- package/dist/schemas/v2/sleep.js.map +1 -0
- package/dist/schemas/v2/strain.js +16 -0
- package/dist/schemas/v2/strain.js.map +1 -0
- package/dist/schemas/v2/stress.js +20 -0
- package/dist/schemas/v2/stress.js.map +1 -0
- package/dist/schemas/v2/trend.js +42 -0
- package/dist/schemas/v2/trend.js.map +1 -0
- package/dist/schemas/weekly_plan.js +31 -0
- package/dist/schemas/weekly_plan.js.map +1 -0
- package/dist/schemas/weight.js +28 -0
- package/dist/schemas/weight.js.map +1 -0
- package/dist/scripts/build_behaviors.js +114 -0
- package/dist/scripts/build_behaviors.js.map +1 -0
- package/dist/scripts/cognito_bootstrap.js +9 -277
- package/dist/scripts/cognito_bootstrap.js.map +1 -1
- package/dist/scripts/gen_activity_catalogs.js +104 -0
- package/dist/scripts/gen_activity_catalogs.js.map +1 -0
- package/dist/server-admin.js +156 -0
- package/dist/server-admin.js.map +1 -0
- package/dist/server-http.js +270 -48
- package/dist/server-http.js.map +1 -1
- package/dist/server.js +136 -23
- package/dist/server.js.map +1 -1
- package/dist/tools/annotations.js +15 -0
- package/dist/tools/annotations.js.map +1 -0
- package/dist/tools/define.js +31 -0
- package/dist/tools/define.js.map +1 -0
- package/dist/tools/register.js +59 -94
- package/dist/tools/register.js.map +1 -1
- package/dist/tools/resources.js +70 -0
- package/dist/tools/resources.js.map +1 -0
- package/dist/tools/slim_schema.js +90 -0
- package/dist/tools/slim_schema.js.map +1 -0
- package/dist/tools/v2/activity_delete.js +63 -17
- package/dist/tools/v2/activity_delete.js.map +1 -1
- package/dist/tools/v2/activity_edit.js +396 -0
- package/dist/tools/v2/activity_edit.js.map +1 -0
- package/dist/tools/v2/activity_log.js +152 -0
- package/dist/tools/v2/activity_log.js.map +1 -0
- package/dist/tools/v2/calendar.js +19 -21
- package/dist/tools/v2/calendar.js.map +1 -1
- package/dist/tools/v2/coach_ask.js +74 -110
- package/dist/tools/v2/coach_ask.js.map +1 -1
- package/dist/tools/v2/coach_history.js +120 -0
- package/dist/tools/v2/coach_history.js.map +1 -0
- package/dist/tools/v2/community.js +124 -0
- package/dist/tools/v2/community.js.map +1 -0
- package/dist/tools/v2/cycle.js +63 -15
- package/dist/tools/v2/cycle.js.map +1 -1
- package/dist/tools/v2/cycle_log.js +289 -32
- package/dist/tools/v2/cycle_log.js.map +1 -1
- package/dist/tools/v2/day.js +126 -24
- package/dist/tools/v2/day.js.map +1 -1
- package/dist/tools/v2/health.js +116 -0
- package/dist/tools/v2/health.js.map +1 -0
- package/dist/tools/v2/hr_zones_set.js +134 -34
- package/dist/tools/v2/hr_zones_set.js.map +1 -1
- package/dist/tools/v2/journal.js +75 -17
- package/dist/tools/v2/journal.js.map +1 -1
- package/dist/tools/v2/journal_log.js +306 -65
- package/dist/tools/v2/journal_log.js.map +1 -1
- package/dist/tools/v2/lift_exercise.js +125 -22
- package/dist/tools/v2/lift_exercise.js.map +1 -1
- package/dist/tools/v2/lift_exercise_set.js +291 -0
- package/dist/tools/v2/lift_exercise_set.js.map +1 -0
- package/dist/tools/v2/lift_library.js +51 -12
- package/dist/tools/v2/lift_library.js.map +1 -1
- package/dist/tools/v2/lift_log.js +309 -72
- package/dist/tools/v2/lift_log.js.map +1 -1
- package/dist/tools/v2/lift_sessions.js +248 -0
- package/dist/tools/v2/lift_sessions.js.map +1 -0
- package/dist/tools/v2/lift_template.js +232 -0
- package/dist/tools/v2/lift_template.js.map +1 -0
- package/dist/tools/v2/memory.js +45 -0
- package/dist/tools/v2/memory.js.map +1 -0
- package/dist/tools/v2/memory_set.js +107 -0
- package/dist/tools/v2/memory_set.js.map +1 -0
- package/dist/tools/v2/milestones.js +50 -0
- package/dist/tools/v2/milestones.js.map +1 -0
- package/dist/tools/v2/now.js +49 -0
- package/dist/tools/v2/now.js.map +1 -0
- package/dist/tools/v2/preferences.js +51 -0
- package/dist/tools/v2/preferences.js.map +1 -0
- package/dist/tools/v2/preferences_set.js +388 -0
- package/dist/tools/v2/preferences_set.js.map +1 -0
- package/dist/tools/v2/profile.js +54 -22
- package/dist/tools/v2/profile.js.map +1 -1
- package/dist/tools/v2/profile_update.js +167 -55
- package/dist/tools/v2/profile_update.js.map +1 -1
- package/dist/tools/v2/raw.js +91 -34
- package/dist/tools/v2/raw.js.map +1 -1
- package/dist/tools/v2/recovery.js +37 -23
- package/dist/tools/v2/recovery.js.map +1 -1
- package/dist/tools/v2/sleep.js +52 -16
- package/dist/tools/v2/sleep.js.map +1 -1
- package/dist/tools/v2/smart_alarm.js +54 -20
- package/dist/tools/v2/smart_alarm.js.map +1 -1
- package/dist/tools/v2/smart_alarm_set.js +264 -86
- package/dist/tools/v2/smart_alarm_set.js.map +1 -1
- package/dist/tools/v2/strain.js +15 -15
- package/dist/tools/v2/strain.js.map +1 -1
- package/dist/tools/v2/stress.js +17 -15
- package/dist/tools/v2/stress.js.map +1 -1
- package/dist/tools/v2/trend.js +56 -20
- package/dist/tools/v2/trend.js.map +1 -1
- package/dist/tools/v2/weekly_plan.js +30 -0
- package/dist/tools/v2/weekly_plan.js.map +1 -0
- package/dist/tools/v2/weekly_plan_set.js +134 -0
- package/dist/tools/v2/weekly_plan_set.js.map +1 -0
- package/dist/tools/v2/weight.js +56 -0
- package/dist/tools/v2/weight.js.map +1 -0
- package/dist/tools/v2/weight_log.js +188 -0
- package/dist/tools/v2/weight_log.js.map +1 -0
- package/dist/tools/v2/workouts.js +159 -25
- package/dist/tools/v2/workouts.js.map +1 -1
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- package/dist/whoop/bff.js +94 -0
- package/dist/whoop/bff.js.map +1 -0
- package/dist/whoop/client.js +392 -18
- package/dist/whoop/client.js.map +1 -1
- package/dist/whoop/cognito.js +106 -79
- package/dist/whoop/cognito.js.map +1 -1
- package/dist/whoop/connect_page.js +165 -0
- package/dist/whoop/connect_page.js.map +1 -0
- package/dist/whoop/consent_font.js +287 -0
- package/dist/whoop/consent_font.js.map +1 -0
- package/dist/whoop/consent_logos.js +22 -0
- package/dist/whoop/consent_logos.js.map +1 -0
- package/dist/whoop/consent_page.js +291 -0
- package/dist/whoop/consent_page.js.map +1 -0
- package/dist/whoop/constants.js +5 -1
- package/dist/whoop/constants.js.map +1 -1
- package/dist/whoop/device.js +4 -4
- package/dist/whoop/device.js.map +1 -1
- package/dist/whoop/errors.js +85 -4
- package/dist/whoop/errors.js.map +1 -1
- package/dist/whoop/init_timezone.js +57 -17
- package/dist/whoop/init_timezone.js.map +1 -1
- package/dist/whoop/installation.js +15 -10
- package/dist/whoop/installation.js.map +1 -1
- package/dist/whoop/json_out.js +52 -6
- package/dist/whoop/json_out.js.map +1 -1
- package/dist/whoop/oauth_provider.js +81 -78
- package/dist/whoop/oauth_provider.js.map +1 -1
- package/dist/whoop/token_lock.js +331 -0
- package/dist/whoop/token_lock.js.map +1 -0
- package/dist/whoop/token_manager.js +536 -42
- package/dist/whoop/token_manager.js.map +1 -1
- package/dist/whoop/token_store.js +303 -36
- package/dist/whoop/token_store.js.map +1 -1
- package/dist/whoop/units.js +28 -0
- package/dist/whoop/units.js.map +1 -0
- package/package.json +29 -13
- package/scripts/build-mcpb.mjs +72 -0
- package/scripts/embed-consent-font.mjs +34 -0
- package/scripts/readme-media.ts +195 -0
- package/scripts/tools-md.ts +89 -0
- package/scripts/whoop-md.ts +119 -0
- package/src/build_info.ts +4 -0
- package/src/cli/app.ts +696 -0
- package/src/cli/auth.ts +350 -0
- package/src/cli/auth_flow.ts +356 -0
- package/src/cli/browser_login.ts +402 -0
- package/src/cli/clients.ts +467 -0
- package/src/cli/deploy_record.ts +100 -0
- package/src/cli/index.ts +41 -583
- package/src/cli/links.ts +43 -0
- package/src/cli/logo.ts +64 -0
- package/src/cli/setup.ts +1147 -979
- package/src/cli/spawn.ts +88 -0
- package/src/cli/sys.ts +267 -0
- package/src/cli/ui.ts +778 -436
- package/src/cli/update.ts +436 -274
- package/src/cloudflare/runtime.d.ts +27 -0
- package/src/cloudflare/token_store.ts +57 -0
- package/src/cloudflare/worker.ts +174 -0
- package/src/data/behaviors.ts +2760 -622
- package/src/data/endpoint_catalog.ts +2695 -0
- package/src/data/exercises.ts +379 -4861
- package/src/data/garments.ts +28 -0
- package/src/data/sports.ts +239 -211
- package/src/lib/activity_list.ts +150 -0
- package/src/lib/activity_records.ts +213 -0
- package/src/lib/activity_results.ts +51 -0
- package/src/lib/activity_types.ts +176 -0
- package/src/lib/brand.ts +71 -0
- package/src/lib/clock.ts +16 -0
- package/src/lib/coach_session.ts +434 -0
- package/src/lib/dates.ts +18 -0
- package/src/lib/env_file.ts +191 -0
- package/src/lib/health_plans_write.ts +53 -0
- package/src/lib/heart_rate.ts +42 -0
- package/src/lib/highlight.ts +71 -0
- package/src/lib/install_links.ts +61 -0
- package/src/lib/instant.ts +54 -0
- package/src/lib/journal_behaviors.ts +453 -0
- package/src/lib/lift_catalog.ts +258 -0
- package/src/lib/lift_history.ts +75 -0
- package/src/lib/lift_sets.ts +164 -0
- package/src/lib/lift_tool.ts +25 -0
- package/src/lib/profile_settings.ts +102 -0
- package/src/lib/screen_content.ts +40 -0
- package/src/lib/timezone.ts +44 -8
- package/src/lib/walk.ts +4 -1
- package/src/lib/weight_readings.ts +82 -0
- package/src/projections/activities.ts +199 -0
- package/src/projections/alarm_schedule.ts +98 -0
- package/src/projections/coach.ts +218 -0
- package/src/projections/community.ts +187 -0
- package/src/projections/health_features.ts +191 -0
- package/src/projections/hormonal_insights.ts +277 -0
- package/src/projections/journal_v2.ts +173 -0
- package/src/projections/lift_cards.ts +131 -0
- package/src/projections/lift_exercise_v2.ts +147 -0
- package/src/projections/lift_library_v2.ts +77 -0
- package/src/projections/lift_sessions.ts +250 -0
- package/src/projections/memory.ts +100 -0
- package/src/projections/milestones.ts +133 -0
- package/src/projections/profile_v2.ts +166 -0
- package/src/projections/settings_v2.ts +179 -0
- package/src/projections/sleep.ts +7 -21
- package/src/projections/v2/calendar.ts +48 -0
- package/src/projections/v2/core_common.ts +95 -0
- package/src/projections/v2/core_home.ts +177 -0
- package/src/projections/v2/core_sleep_need.ts +37 -0
- package/src/projections/v2/day.ts +162 -0
- package/src/projections/v2/heart_rate.ts +73 -0
- package/src/projections/v2/history.ts +153 -0
- package/src/projections/v2/now.ts +59 -0
- package/src/projections/v2/recovery.ts +120 -0
- package/src/projections/v2/sleep.ts +281 -0
- package/src/projections/v2/strain.ts +63 -0
- package/src/projections/v2/stress.ts +111 -0
- package/src/projections/v2/trend.ts +242 -0
- package/src/projections/weekly_plan.ts +79 -0
- package/src/projections/weight_readings.ts +57 -0
- package/src/projections/workout.ts +36 -17
- package/src/schemas/activities.ts +136 -0
- package/src/schemas/alarm_schedule.ts +70 -0
- package/src/schemas/coach.ts +98 -8
- package/src/schemas/community.ts +77 -0
- package/src/schemas/health.ts +36 -0
- package/src/schemas/hormonal_insights.ts +108 -0
- package/src/schemas/journal.ts +4 -0
- package/src/schemas/journal_v2.ts +112 -0
- package/src/schemas/memory.ts +48 -0
- package/src/schemas/milestones.ts +48 -0
- package/src/schemas/profile_v2.ts +63 -0
- package/src/schemas/settings_v2.ts +63 -0
- package/src/schemas/sleep.ts +9 -1
- package/src/schemas/strength.ts +10 -1
- package/src/schemas/strength_v2.ts +210 -0
- package/src/schemas/v2/calendar.ts +8 -0
- package/src/schemas/v2/core_common.ts +50 -0
- package/src/schemas/v2/day.ts +79 -0
- package/src/schemas/v2/now.ts +25 -0
- package/src/schemas/v2/recovery.ts +38 -0
- package/src/schemas/v2/sleep.ts +46 -0
- package/src/schemas/v2/strain.ts +16 -0
- package/src/schemas/v2/stress.ts +20 -0
- package/src/schemas/v2/trend.ts +45 -0
- package/src/schemas/weekly_plan.ts +36 -0
- package/src/schemas/weight.ts +53 -0
- package/src/scripts/build_behaviors.ts +116 -0
- package/src/scripts/cognito_bootstrap.ts +10 -249
- package/src/scripts/gen_activity_catalogs.ts +121 -0
- package/src/server-admin.ts +171 -0
- package/src/server-http.ts +290 -53
- package/src/server.ts +130 -26
- package/src/tools/annotations.ts +25 -0
- package/src/tools/define.ts +53 -0
- package/src/tools/register.ts +64 -94
- package/src/tools/resources.ts +92 -0
- package/src/tools/slim_schema.ts +102 -0
- package/src/tools/v2/activity_delete.ts +61 -23
- package/src/tools/v2/activity_edit.ts +378 -0
- package/src/tools/v2/activity_log.ts +154 -0
- package/src/tools/v2/calendar.ts +22 -21
- package/src/tools/v2/coach_ask.ts +83 -119
- package/src/tools/v2/coach_history.ts +140 -0
- package/src/tools/v2/community.ts +137 -0
- package/src/tools/v2/cycle.ts +78 -20
- package/src/tools/v2/cycle_log.ts +291 -40
- package/src/tools/v2/day.ts +126 -25
- package/src/tools/v2/health.ts +114 -0
- package/src/tools/v2/hr_zones_set.ts +132 -45
- package/src/tools/v2/journal.ts +78 -23
- package/src/tools/v2/journal_log.ts +321 -69
- package/src/tools/v2/lift_exercise.ts +135 -27
- package/src/tools/v2/lift_exercise_set.ts +272 -0
- package/src/tools/v2/lift_library.ts +57 -21
- package/src/tools/v2/lift_log.ts +325 -83
- package/src/tools/v2/lift_sessions.ts +255 -0
- package/src/tools/v2/lift_template.ts +229 -0
- package/src/tools/v2/memory.ts +54 -0
- package/src/tools/v2/memory_set.ts +110 -0
- package/src/tools/v2/milestones.ts +59 -0
- package/src/tools/v2/now.ts +61 -0
- package/src/tools/v2/preferences.ts +61 -0
- package/src/tools/v2/preferences_set.ts +403 -0
- package/src/tools/v2/profile.ts +56 -26
- package/src/tools/v2/profile_update.ts +151 -60
- package/src/tools/v2/raw.ts +89 -36
- package/src/tools/v2/recovery.ts +44 -25
- package/src/tools/v2/sleep.ts +57 -18
- package/src/tools/v2/smart_alarm.ts +62 -24
- package/src/tools/v2/smart_alarm_set.ts +240 -90
- package/src/tools/v2/strain.ts +19 -16
- package/src/tools/v2/stress.ts +22 -17
- package/src/tools/v2/trend.ts +58 -20
- package/src/tools/v2/weekly_plan.ts +38 -0
- package/src/tools/v2/weekly_plan_set.ts +132 -0
- package/src/tools/v2/weight.ts +61 -0
- package/src/tools/v2/weight_log.ts +193 -0
- package/src/tools/v2/workouts.ts +156 -26
- package/src/version.ts +5 -0
- package/src/whoop/bff.ts +84 -0
- package/src/whoop/client.ts +448 -18
- package/src/whoop/cognito.ts +110 -99
- package/src/whoop/connect_page.ts +183 -0
- package/src/whoop/consent_font.ts +289 -0
- package/src/whoop/consent_logos.ts +24 -0
- package/src/whoop/consent_page.ts +326 -0
- package/src/whoop/constants.ts +5 -1
- package/src/whoop/device.ts +4 -4
- package/src/whoop/errors.ts +89 -4
- package/src/whoop/init_timezone.ts +57 -16
- package/src/whoop/installation.ts +16 -7
- package/src/whoop/json_out.ts +51 -6
- package/src/whoop/oauth_provider.ts +84 -91
- package/src/whoop/token_lock.ts +345 -0
- package/src/whoop/token_manager.ts +580 -53
- package/src/whoop/token_store.ts +341 -32
- package/src/whoop/units.ts +35 -0
- package/wrangler.jsonc +17 -0
- package/assets/banner.svg +0 -38
- package/dist/data/endpoints.js +0 -320
- package/dist/data/endpoints.js.map +0 -1
- package/dist/lib/format.js +0 -22
- package/dist/lib/format.js.map +0 -1
- package/dist/lib/stats.js +0 -32
- package/dist/lib/stats.js.map +0 -1
- package/dist/projections/calendar.js +0 -33
- package/dist/projections/calendar.js.map +0 -1
- package/dist/projections/communities.js +0 -105
- package/dist/projections/communities.js.map +0 -1
- package/dist/projections/cycle.js +0 -81
- package/dist/projections/cycle.js.map +0 -1
- package/dist/projections/hr_zones.js +0 -35
- package/dist/projections/hr_zones.js.map +0 -1
- package/dist/projections/journal.js +0 -56
- package/dist/projections/journal.js.map +0 -1
- package/dist/projections/leaderboard.js +0 -37
- package/dist/projections/leaderboard.js.map +0 -1
- package/dist/projections/lift_exercise.js +0 -22
- package/dist/projections/lift_exercise.js.map +0 -1
- package/dist/projections/lift_history.js +0 -133
- package/dist/projections/lift_history.js.map +0 -1
- package/dist/projections/lift_library.js +0 -71
- package/dist/projections/lift_library.js.map +0 -1
- package/dist/projections/lift_progression.js +0 -138
- package/dist/projections/lift_progression.js.map +0 -1
- package/dist/projections/lift_prs.js +0 -20
- package/dist/projections/lift_prs.js.map +0 -1
- package/dist/projections/live_hr.js +0 -19
- package/dist/projections/live_hr.js.map +0 -1
- package/dist/projections/live_state.js +0 -23
- package/dist/projections/live_state.js.map +0 -1
- package/dist/projections/live_stress.js +0 -11
- package/dist/projections/live_stress.js.map +0 -1
- package/dist/projections/performance_assessment.js +0 -15
- package/dist/projections/performance_assessment.js.map +0 -1
- package/dist/projections/profile.js +0 -59
- package/dist/projections/profile.js.map +0 -1
- package/dist/projections/recovery.js +0 -131
- package/dist/projections/recovery.js.map +0 -1
- package/dist/projections/sleep_need.js +0 -32
- package/dist/projections/sleep_need.js.map +0 -1
- package/dist/projections/smart_alarm.js +0 -45
- package/dist/projections/smart_alarm.js.map +0 -1
- package/dist/projections/strain.js +0 -128
- package/dist/projections/strain.js.map +0 -1
- package/dist/projections/stress.js +0 -86
- package/dist/projections/stress.js.map +0 -1
- package/dist/projections/today.js +0 -129
- package/dist/projections/today.js.map +0 -1
- package/dist/projections/trend.js +0 -149
- package/dist/projections/trend.js.map +0 -1
- package/dist/projections/workouts.js +0 -37
- package/dist/projections/workouts.js.map +0 -1
- package/dist/schemas/calendar.js +0 -12
- package/dist/schemas/calendar.js.map +0 -1
- package/dist/schemas/communities.js +0 -51
- package/dist/schemas/communities.js.map +0 -1
- package/dist/schemas/compare.js +0 -15
- package/dist/schemas/compare.js.map +0 -1
- package/dist/schemas/leaderboard.js +0 -25
- package/dist/schemas/leaderboard.js.map +0 -1
- package/dist/schemas/live.js +0 -26
- package/dist/schemas/live.js.map +0 -1
- package/dist/schemas/performance.js +0 -12
- package/dist/schemas/performance.js.map +0 -1
- package/dist/schemas/profile.js +0 -39
- package/dist/schemas/profile.js.map +0 -1
- package/dist/schemas/recovery.js +0 -27
- package/dist/schemas/recovery.js.map +0 -1
- package/dist/schemas/settings.js +0 -26
- package/dist/schemas/settings.js.map +0 -1
- package/dist/schemas/sleep_need.js +0 -15
- package/dist/schemas/sleep_need.js.map +0 -1
- package/dist/schemas/smart_alarm.js +0 -36
- package/dist/schemas/smart_alarm.js.map +0 -1
- package/dist/schemas/strain.js +0 -24
- package/dist/schemas/strain.js.map +0 -1
- package/dist/schemas/stress.js +0 -16
- package/dist/schemas/stress.js.map +0 -1
- package/dist/schemas/today.js +0 -38
- package/dist/schemas/today.js.map +0 -1
- package/dist/schemas/trend.js +0 -50
- package/dist/schemas/trend.js.map +0 -1
- package/dist/schemas/womens_health.js +0 -23
- package/dist/schemas/womens_health.js.map +0 -1
- package/dist/tools/v2/activity_create.js +0 -64
- package/dist/tools/v2/activity_create.js.map +0 -1
- package/dist/tools/v2/behavior_impact.js +0 -36
- package/dist/tools/v2/behavior_impact.js.map +0 -1
- package/dist/tools/v2/communities.js +0 -60
- package/dist/tools/v2/communities.js.map +0 -1
- package/dist/tools/v2/compare.js +0 -67
- package/dist/tools/v2/compare.js.map +0 -1
- package/dist/tools/v2/endpoints.js +0 -28
- package/dist/tools/v2/endpoints.js.map +0 -1
- package/dist/tools/v2/hidden_metric.js +0 -28
- package/dist/tools/v2/hidden_metric.js.map +0 -1
- package/dist/tools/v2/hr_zones.js +0 -24
- package/dist/tools/v2/hr_zones.js.map +0 -1
- package/dist/tools/v2/journal_autopop.js +0 -19
- package/dist/tools/v2/journal_autopop.js.map +0 -1
- package/dist/tools/v2/journal_catalog.js +0 -44
- package/dist/tools/v2/journal_catalog.js.map +0 -1
- package/dist/tools/v2/leaderboard.js +0 -79
- package/dist/tools/v2/leaderboard.js.map +0 -1
- package/dist/tools/v2/lift_catalog.js +0 -47
- package/dist/tools/v2/lift_catalog.js.map +0 -1
- package/dist/tools/v2/lift_custom_exercise.js +0 -108
- package/dist/tools/v2/lift_custom_exercise.js.map +0 -1
- package/dist/tools/v2/lift_history.js +0 -39
- package/dist/tools/v2/lift_history.js.map +0 -1
- package/dist/tools/v2/lift_progression.js +0 -30
- package/dist/tools/v2/lift_progression.js.map +0 -1
- package/dist/tools/v2/lift_prs.js +0 -21
- package/dist/tools/v2/lift_prs.js.map +0 -1
- package/dist/tools/v2/lift_template_save.js +0 -83
- package/dist/tools/v2/lift_template_save.js.map +0 -1
- package/dist/tools/v2/live_hr.js +0 -21
- package/dist/tools/v2/live_hr.js.map +0 -1
- package/dist/tools/v2/live_state.js +0 -21
- package/dist/tools/v2/live_state.js.map +0 -1
- package/dist/tools/v2/live_stress.js +0 -22
- package/dist/tools/v2/live_stress.js.map +0 -1
- package/dist/tools/v2/performance_assessment.js +0 -38
- package/dist/tools/v2/performance_assessment.js.map +0 -1
- package/dist/tools/v2/sleep_need.js +0 -21
- package/dist/tools/v2/sleep_need.js.map +0 -1
- package/dist/tools/v2/sports_catalog.js +0 -26
- package/dist/tools/v2/sports_catalog.js.map +0 -1
- package/dist/tools/v2/symptom_log.js +0 -72
- package/dist/tools/v2/symptom_log.js.map +0 -1
- package/dist/tools/v2/today.js +0 -30
- package/dist/tools/v2/today.js.map +0 -1
- package/dist/tools/v2/workout.js +0 -23
- package/dist/tools/v2/workout.js.map +0 -1
- package/dist/whoop/build_lift_body.js +0 -67
- package/dist/whoop/build_lift_body.js.map +0 -1
- package/dist/whoop/session_state.js +0 -34
- package/dist/whoop/session_state.js.map +0 -1
- package/dist/whoop/types.js +0 -82
- package/dist/whoop/types.js.map +0 -1
- package/src/data/endpoints.ts +0 -319
- package/src/lib/format.ts +0 -27
- package/src/lib/stats.ts +0 -35
- package/src/projections/calendar.ts +0 -46
- package/src/projections/communities.ts +0 -135
- package/src/projections/cycle.ts +0 -85
- package/src/projections/hr_zones.ts +0 -43
- package/src/projections/journal.ts +0 -55
- package/src/projections/leaderboard.ts +0 -49
- package/src/projections/lift_exercise.ts +0 -29
- package/src/projections/lift_history.ts +0 -140
- package/src/projections/lift_library.ts +0 -70
- package/src/projections/lift_progression.ts +0 -138
- package/src/projections/lift_prs.ts +0 -23
- package/src/projections/live_hr.ts +0 -21
- package/src/projections/live_state.ts +0 -28
- package/src/projections/live_stress.ts +0 -13
- package/src/projections/performance_assessment.ts +0 -19
- package/src/projections/profile.ts +0 -71
- package/src/projections/recovery.ts +0 -133
- package/src/projections/sleep_need.ts +0 -36
- package/src/projections/smart_alarm.ts +0 -70
- package/src/projections/strain.ts +0 -131
- package/src/projections/stress.ts +0 -95
- package/src/projections/today.ts +0 -166
- package/src/projections/trend.ts +0 -149
- package/src/projections/workouts.ts +0 -36
- package/src/schemas/calendar.ts +0 -13
- package/src/schemas/communities.ts +0 -56
- package/src/schemas/compare.ts +0 -17
- package/src/schemas/leaderboard.ts +0 -26
- package/src/schemas/live.ts +0 -31
- package/src/schemas/performance.ts +0 -13
- package/src/schemas/profile.ts +0 -40
- package/src/schemas/recovery.ts +0 -28
- package/src/schemas/settings.ts +0 -30
- package/src/schemas/sleep_need.ts +0 -16
- package/src/schemas/smart_alarm.ts +0 -40
- package/src/schemas/strain.ts +0 -25
- package/src/schemas/stress.ts +0 -17
- package/src/schemas/today.ts +0 -39
- package/src/schemas/trend.ts +0 -53
- package/src/schemas/womens_health.ts +0 -26
- package/src/tools/v2/activity_create.ts +0 -74
- package/src/tools/v2/behavior_impact.ts +0 -39
- package/src/tools/v2/communities.ts +0 -65
- package/src/tools/v2/compare.ts +0 -83
- package/src/tools/v2/endpoints.ts +0 -32
- package/src/tools/v2/hidden_metric.ts +0 -33
- package/src/tools/v2/hr_zones.ts +0 -29
- package/src/tools/v2/journal_autopop.ts +0 -26
- package/src/tools/v2/journal_catalog.ts +0 -48
- package/src/tools/v2/leaderboard.ts +0 -92
- package/src/tools/v2/lift_catalog.ts +0 -48
- package/src/tools/v2/lift_custom_exercise.ts +0 -117
- package/src/tools/v2/lift_history.ts +0 -52
- package/src/tools/v2/lift_progression.ts +0 -34
- package/src/tools/v2/lift_prs.ts +0 -26
- package/src/tools/v2/lift_template_save.ts +0 -89
- package/src/tools/v2/live_hr.ts +0 -26
- package/src/tools/v2/live_state.ts +0 -26
- package/src/tools/v2/live_stress.ts +0 -27
- package/src/tools/v2/performance_assessment.ts +0 -44
- package/src/tools/v2/sleep_need.ts +0 -26
- package/src/tools/v2/sports_catalog.ts +0 -32
- package/src/tools/v2/symptom_log.ts +0 -78
- package/src/tools/v2/today.ts +0 -35
- package/src/tools/v2/workout.ts +0 -28
- package/src/whoop/build_lift_body.ts +0 -84
- package/src/whoop/session_state.ts +0 -41
- package/src/whoop/types.ts +0 -89
package/README.md
CHANGED
|
@@ -1,587 +1,261 @@
|
|
|
1
|
-
<p align="center">
|
|
2
|
-
<img src="assets/banner.svg" alt="totem — 48 tools, 47 microservices, 311 endpoints" width="820">
|
|
3
|
-
</p>
|
|
1
|
+
<p align="center"><img src="assets/brand/totem.svg" width="80" alt="totem"></p>
|
|
4
2
|
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
3
|
+
<h1 align="center">totem</h1>
|
|
4
|
+
|
|
5
|
+
<p align="center"><b>Your WHOOP data in Claude, ChatGPT and the AI apps you already use.</b><br>
|
|
6
|
+
An open-source MCP server you run yourself. One command sets it up.</p>
|
|
8
7
|
|
|
9
8
|
<p align="center">
|
|
10
|
-
<a href="
|
|
11
|
-
<a href="
|
|
12
|
-
<img src="https://img.shields.io/badge/
|
|
13
|
-
<img src="https://img.shields.io/badge/
|
|
14
|
-
<img src="https://img.shields.io/badge/
|
|
15
|
-
<img src="https://img.shields.io/badge/Any_MCP_1.x_Client-262626?style=for-the-badge" alt="any MCP 1.x client">
|
|
9
|
+
<a href="https://www.npmjs.com/package/@thebriangao/totem"><img src="https://img.shields.io/npm/v/%40thebriangao%2Ftotem?style=flat-square&labelColor=141414&color=7A9CC6" alt="npm version"></a>
|
|
10
|
+
<a href="https://github.com/thebriangao/totem/actions/workflows/ci.yml"><img src="https://img.shields.io/github/actions/workflow/status/thebriangao/totem/ci.yml?branch=main&style=flat-square&labelColor=141414&label=tests" alt="tests"></a>
|
|
11
|
+
<a href="TOOLS.md"><img src="https://img.shields.io/badge/MCP-41%20tools-7A9CC6?style=flat-square&labelColor=141414" alt="41 MCP tools"></a>
|
|
12
|
+
<img src="https://img.shields.io/badge/node-%E2%89%A5%2024-7A9CC6?style=flat-square&labelColor=141414" alt="Node 24 or newer">
|
|
13
|
+
<a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-7A9CC6?style=flat-square&labelColor=141414" alt="MIT license"></a>
|
|
16
14
|
</p>
|
|
17
15
|
|
|
18
16
|
<p align="center">
|
|
19
|
-
<
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
<
|
|
17
|
+
<a href="#quick-start">Quick start</a> ·
|
|
18
|
+
<a href="#what-you-can-ask">What you can ask</a> ·
|
|
19
|
+
<a href="#connect-your-apps">Connect your apps</a> ·
|
|
20
|
+
<a href="#hosting">Hosting</a> ·
|
|
21
|
+
<a href="TOOLS.md">Tools</a> ·
|
|
22
|
+
<a href="#faq">FAQ</a>
|
|
24
23
|
</p>
|
|
25
24
|
|
|
26
25
|
<p align="center">
|
|
27
|
-
|
|
26
|
+
English ·
|
|
27
|
+
<a href="docs/i18n/README.zh-CN.md">简体中文</a> ·
|
|
28
|
+
<a href="docs/i18n/README.ja.md">日本語</a> ·
|
|
29
|
+
<a href="docs/i18n/README.ko.md">한국어</a> ·
|
|
30
|
+
<a href="docs/i18n/README.es.md">Español</a> ·
|
|
31
|
+
<a href="docs/i18n/README.pt-BR.md">Português</a> ·
|
|
32
|
+
<a href="docs/i18n/README.fr.md">Français</a> ·
|
|
33
|
+
<a href="docs/i18n/README.de.md">Deutsch</a>
|
|
28
34
|
</p>
|
|
35
|
+
|
|
29
36
|
<p align="center">
|
|
30
|
-
<
|
|
37
|
+
<picture>
|
|
38
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/media/totem-local-dark.svg">
|
|
39
|
+
<img src="docs/media/totem-local-light.svg" width="668" alt="A terminal running totem local: it checks Node.js, logs in to WHOOP in a browser window, then adds totem to Claude Desktop, Claude Code, ChatGPT, OpenCode and Antigravity.">
|
|
40
|
+
</picture>
|
|
31
41
|
</p>
|
|
32
42
|
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
> **Totem is becoming a universal wearables bridge.** Whoop is the first adapter — every metric, fully wired. Fitbit, Apple Watch, and Garmin are in progress ([contributors welcome](CONTRIBUTING.md)). The MCP + projection layer is device-agnostic; an adapter just maps its source into the same shared schemas, so everything below applies to whatever you wear.
|
|
36
|
-
|
|
37
|
-
> *Note: this works through Whoop's private iOS API rather than the public OAuth API. That isn't what Whoop's terms allow — see the [FAQ](#faq) if you want the full picture before installing.*
|
|
38
|
-
|
|
39
|
-
---
|
|
43
|
+
totem connects your WHOOP account to your AI apps. Ask about last night's sleep, why your recovery is low, or how your HRV has moved this quarter. Have the app log a workout or fill in your journal.
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
It is a small server that speaks [MCP](https://modelcontextprotocol.io) to your apps and talks to WHOOP the way the WHOOP app does. You run it on your own computer or on a cloud server you own.
|
|
42
46
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
5. [The 48 tools](#the-48-tools)
|
|
48
|
-
6. [Authentication](#authentication)
|
|
49
|
-
7. [Write-safety harness](#write-safety-harness)
|
|
50
|
-
8. [Bundled catalogs](#bundled-catalogs)
|
|
51
|
-
9. [Configuration](#configuration)
|
|
52
|
-
10. [Remote hosting](#remote-hosting)
|
|
53
|
-
- [Deploying to Hugging Face Spaces (free hosting)](#deploying-to-hugging-face-spaces-free-hosting)
|
|
54
|
-
11. [The `totem` CLI](#the-totem-cli)
|
|
55
|
-
12. [Privacy + security](#privacy--security)
|
|
56
|
-
13. [Troubleshooting](#troubleshooting)
|
|
57
|
-
14. [Comparison to alternatives](#comparison-to-alternatives)
|
|
58
|
-
15. [FAQ](#faq)
|
|
59
|
-
16. [Disclaimers](#disclaimers)
|
|
60
|
-
17. [Acknowledgments](#acknowledgments)
|
|
47
|
+
- **41 tools.** Recovery, sleep, strain, stress, heart rate, trends, workouts, Strength Trainer, journal, WHOOP Coach, weight, cycle tracking, Smart Alarm, profile and settings. [See them all](TOOLS.md).
|
|
48
|
+
- **Nothing changes without a yes.** Every tool that writes shows a preview first and waits for you to confirm.
|
|
49
|
+
- **Light on context.** A default answer is about 1.5 KB, so the tools leave room for the conversation.
|
|
50
|
+
- **One command.** `totem local` or `totem cloud` logs you in to WHOOP and adds totem to the AI apps it finds.
|
|
61
51
|
|
|
62
|
-
|
|
52
|
+
> [!NOTE]
|
|
53
|
+
> totem uses WHOOP's private app API, not the public developer API, and isn't affiliated with WHOOP. Read the [FAQ](#faq) before you install it.
|
|
63
54
|
|
|
64
|
-
|
|
55
|
+
## Quick start
|
|
65
56
|
|
|
66
|
-
|
|
57
|
+
You need [Node.js 24](https://nodejs.org) or newer and a WHOOP account.
|
|
67
58
|
|
|
68
|
-
**
|
|
59
|
+
**1. Install it.**
|
|
69
60
|
|
|
70
61
|
```bash
|
|
71
|
-
|
|
72
|
-
cd totem && npm install && npx tsc && npm link
|
|
62
|
+
npm install -g @thebriangao/totem
|
|
73
63
|
```
|
|
74
64
|
|
|
75
|
-
|
|
65
|
+
**2. Pick where it runs.**
|
|
76
66
|
|
|
77
|
-
|
|
67
|
+
| | On this computer | In the cloud |
|
|
68
|
+
|---|---|---|
|
|
69
|
+
| Command | `totem local` | `totem cloud` |
|
|
70
|
+
| Works with | Desktop and terminal apps: Claude Desktop, Claude Code, ChatGPT desktop and Codex, Cursor, VS Code, OpenCode, Antigravity | All of those, plus claude.ai, chatgpt.com and Claude on your phone |
|
|
71
|
+
| Cost | Free | Free on Cloudflare, about $4 a month on Fly.io |
|
|
72
|
+
| Available | While your computer is on | Always |
|
|
78
73
|
|
|
79
|
-
|
|
74
|
+
Either command opens a browser window on WHOOP's own site for you to log in. totem never sees your password. It then finds the AI apps on your computer and offers to add itself to each one.
|
|
80
75
|
|
|
81
|
-
|
|
82
|
-
2. **Pick a host** — Fly (automated + tested), Railway, Google Cloud Run, or your own server (guided Docker steps).
|
|
83
|
-
3. **Secrets** — generates `MCP_AUTH_TOKEN` and asks you to choose a connector password.
|
|
84
|
-
4. **Deploy + verify** — sets env, deploys, confirms `/health` and the OAuth endpoints are live.
|
|
85
|
-
5. **Connect** — prints ready-to-paste setup for **claude.ai, ChatGPT, Claude Code (remote), and Cursor / Windsurf / any HTTP MCP client** (URL + password for the OAuth connectors, a bearer-token block for the rest), and opens claude.ai's connector page.
|
|
76
|
+
**3. Ask something.**
|
|
86
77
|
|
|
87
|
-
|
|
88
|
-
totem cloud
|
|
89
|
-
```
|
|
78
|
+
Open your app and try *"How did I sleep last night?"*
|
|
90
79
|
|
|
91
|
-
|
|
80
|
+
Run `totem` on its own any time to see where things stand.
|
|
92
81
|
|
|
93
|
-
|
|
82
|
+
### Prefer a button?
|
|
94
83
|
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
```
|
|
84
|
+
[](https://deploy.workers.cloudflare.com/?url=https://github.com/thebriangao/totem)
|
|
85
|
+
[](https://railway.com/deploy/Z6CMWF)
|
|
98
86
|
|
|
99
|
-
|
|
87
|
+
- **Cloudflare** asks for two values: `MCP_AUTH_TOKEN` (64 random characters, for example from `openssl rand -hex 32`) and `AUTH_PASSWORD` (the password you'll type when an app connects). It runs on the free Workers plan.
|
|
88
|
+
- **Railway** generates both for you (they're under the service's Variables). It needs Railway's paid plan.
|
|
100
89
|
|
|
101
|
-
|
|
90
|
+
Then log in to WHOOP and send the login to your server:
|
|
102
91
|
|
|
103
92
|
```bash
|
|
104
|
-
totem auth
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
Silent if your account has no SMS MFA; prompts for the code if it does. Pushes fresh tokens to your deployment automatically.
|
|
108
|
-
|
|
109
|
-
### Check it works
|
|
110
|
-
|
|
111
|
-
Ask Claude: *"how am I doing today on whoop?"* — you should get structured recovery / sleep / strain back.
|
|
112
|
-
|
|
113
|
-
> Prefer to wire everything up by hand? The guided commands just automate the steps documented in [The `totem` CLI](#the-totem-cli), [Remote hosting](#remote-hosting), and [Configuration](#configuration). Stuck? See [Troubleshooting](#troubleshooting).
|
|
114
|
-
|
|
115
|
-
---
|
|
116
|
-
|
|
117
|
-
## Why this exists
|
|
118
|
-
|
|
119
|
-
Whoop ships two APIs:
|
|
120
|
-
|
|
121
|
-
- The **public developer API** at [`developer.whoop.com`](https://developer.whoop.com/api/) is OAuth2, read-only, and exposes **13 endpoints** under 6 scopes. You get recovery score, sleep stage totals, workout strain, body measurements (3 fields), and HRV/RHR per cycle. No journal, no Strength Trainer, no Whoop Coach, no hypnogram, no stress monitor, no trends, no writes, nothing else. Numeric `sport_id` was removed 2025-09-01.
|
|
122
|
-
- The **private iOS API** is what the actual Whoop app uses — `api.prod.whoop.com` behind AWS Cognito. **311 distinct operations across 47 microservices**, including everything missing from above.
|
|
123
|
-
|
|
124
|
-
This MCP wraps the iOS surface.
|
|
125
|
-
|
|
126
|
-
### What the iOS API has that the public OAuth doesn't
|
|
127
|
-
|
|
128
|
-
| Capability | Tool |
|
|
129
|
-
|---|---|
|
|
130
|
-
| HRV / RHR / respiratory / VO2 / weight time-series (25 metrics × up to 4 windows) | `whoop_trend` |
|
|
131
|
-
| Hypnogram (per-stage sleep timeline) + full stage breakdown (ms + %) + in-sleep HR | `whoop_sleep` |
|
|
132
|
-
| Strength Trainer — every set, every workout, full 372-exercise catalog, PRs | `whoop_lift_*` (8 tools) |
|
|
133
|
-
| 308-behavior Journal + behavior impact analysis | `whoop_journal*` (5 tools) |
|
|
134
|
-
| Stress monitor (intraday timeline) | `whoop_stress, whoop_live_stress` |
|
|
135
|
-
| Whoop Coach AI chat | `whoop_coach_ask` |
|
|
136
|
-
| Smart Alarm (read + 4 write modes) | `whoop_smart_alarm*` |
|
|
137
|
-
| HR zones (read + configure max HR / 5 custom zones) | `whoop_hr_zones*` |
|
|
138
|
-
| Compare-windows, sleep coach, calendar grid, performance assessment | `whoop_compare`, `whoop_sleep_need`, `whoop_calendar`, `whoop_performance_assessment` |
|
|
139
|
-
| Live HR / activity state / live stress | `whoop_live_*` (3 tools) |
|
|
140
|
-
| Community leaderboards, hidden metrics, women's health (cycle / symptoms / MCI) | `whoop_leaderboard`, `whoop_hidden_metric`, `whoop_cycle*` |
|
|
141
|
-
| **14 write tools** — log workouts, journal entries, profile edits, smart-alarm config | various |
|
|
142
|
-
|
|
143
|
-
If recovery + sleep totals + workout list is enough for you, use the public OAuth API. If anything in the table is interesting, you need this. The iOS API was discovered via mitmproxy — full methodology in [`WHOOP.md`](WHOOP.md).
|
|
144
|
-
|
|
145
|
-
---
|
|
146
|
-
|
|
147
|
-
## What it does
|
|
148
|
-
|
|
149
|
-
The MCP runs as a local Node process. It speaks **Model Context Protocol** over stdio (or HTTP for remote deployments), registers 48 tools at startup, and waits for tool calls from a connected MCP client.
|
|
150
|
-
|
|
151
|
-
When a tool is called:
|
|
152
|
-
|
|
153
|
-
1. Authenticates via the cached Cognito access token (auto-refreshes if expired)
|
|
154
|
-
2. Issues HTTP requests to `api.prod.whoop.com`
|
|
155
|
-
3. Walks the response to extract a flat domain object (the **projection** step)
|
|
156
|
-
4. Validates the projected object against a zod schema (catches Whoop API drift)
|
|
157
|
-
5. Returns the structured JSON to the MCP client
|
|
158
|
-
|
|
159
|
-
Writes follow the same path plus a **preview gate**: every write tool defaults `confirm: false`, returning a preview of what would be sent. Claude must explicitly re-call with `confirm: true` to fire.
|
|
160
|
-
|
|
161
|
-
See [The 48 tools](#the-48-tools) for the full per-tool reference.
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## Architecture
|
|
166
|
-
|
|
93
|
+
npx @thebriangao/totem auth --url https://your-server-address
|
|
167
94
|
```
|
|
168
|
-
Claude Desktop / Code ──stdio──▶ src/server.ts ──▶ 48 tool handlers
|
|
169
|
-
│
|
|
170
|
-
┌──────────────────┼──────────────────┐
|
|
171
|
-
▼ ▼ ▼
|
|
172
|
-
schemas (zod) projections (raw→flat) whoop/client
|
|
173
|
-
│
|
|
174
|
-
▼ HTTPS
|
|
175
|
-
api.prod.whoop.com
|
|
176
|
-
```
|
|
177
|
-
|
|
178
|
-
### Three layers per tool
|
|
179
|
-
|
|
180
|
-
Every tool is a schema + projection + handler:
|
|
181
|
-
|
|
182
|
-
- **`src/schemas/<tool>.ts`** — zod schema. The contract Claude sees. Used at runtime to validate the projection's output before returning.
|
|
183
|
-
- **`src/projections/<tool>.ts`** — pure function turning Whoop's raw BFF response into a flat object. All the "Whoop puts this data over there, not where you'd expect" knowledge lives here. Tested against captured fixtures.
|
|
184
|
-
- **`src/tools/v2/<tool>.ts`** — ~25-100 lines. Registers the tool, parses input args, calls the client, runs the projection, validates with zod, returns.
|
|
185
|
-
|
|
186
|
-
Almost no logic in the tool file. That's all in the projection — which makes the codebase highly testable (projections are pure transformations, tested against `tests/fixtures/*.json` without hitting the network).
|
|
187
|
-
|
|
188
|
-
### Shape drift handling
|
|
189
95
|
|
|
190
|
-
|
|
96
|
+
**Only use Claude Desktop?** Download [totem.mcpb](https://github.com/thebriangao/totem/releases/latest/download/totem.mcpb), double-click it, and log in once with `npx @thebriangao/totem auth --local`.
|
|
191
97
|
|
|
192
|
-
|
|
98
|
+
## What you can ask
|
|
193
99
|
|
|
100
|
+
<p align="center">
|
|
101
|
+
<picture>
|
|
102
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/media/chat-answer-dark.png">
|
|
103
|
+
<img src="docs/media/chat-answer-light.png" width="820" alt="Claude answering “How’s my day looking?” with totem: a table of today’s recovery, sleep, strain, stress, steps and calories, then notes on last night’s sleep, today’s training and tonight’s sleep need.">
|
|
104
|
+
</picture>
|
|
105
|
+
</p>
|
|
194
106
|
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
107
|
+
- "How did I sleep last night, and how does it compare to my month?"
|
|
108
|
+
- "Why is my recovery low today?"
|
|
109
|
+
- "Show my HRV and resting heart rate for the last 90 days."
|
|
110
|
+
- "What was my heart rate during this morning's run?"
|
|
111
|
+
- "Log a 30-minute walk at 6 pm."
|
|
112
|
+
- "I had caffeine and alcohol yesterday. Add that to my journal."
|
|
113
|
+
- "Log today's lift: bench press 3×5 at 80 kg, squat 3×5 at 100 kg."
|
|
114
|
+
- "Set a Smart Alarm for 7:30 on weekdays."
|
|
200
115
|
|
|
201
|
-
|
|
202
|
-
|---|---|
|
|
203
|
-
| **Snapshots & profile** (4) | `whoop_today` · `whoop_day` · `whoop_profile` · `whoop_calendar` |
|
|
204
|
-
| **Deep dives** (3) | `whoop_recovery` · `whoop_sleep` · `whoop_strain` |
|
|
205
|
-
| **Trends** (2) | `whoop_trend` · `whoop_compare` |
|
|
206
|
-
| **Stress + sleep coach** (2) | `whoop_stress` · `whoop_sleep_need` |
|
|
207
|
-
| **Live** (3) | `whoop_live_hr` · `whoop_live_state` · `whoop_live_stress` |
|
|
208
|
-
| **Activities** (5) | `whoop_workouts` · `whoop_workout` · `whoop_sports_catalog` · `whoop_activity_create` ⚠️🔒 · `whoop_activity_delete` ⚠️ |
|
|
209
|
-
| **Strength reads** (6) | `whoop_lift_prs` · `whoop_lift_exercise` 🔒 · `whoop_lift_progression` 🔒 · `whoop_lift_history` · `whoop_lift_library` · `whoop_lift_catalog` |
|
|
210
|
-
| **Strength writes** (3) | `whoop_lift_log` ⚠️🔒 · `whoop_lift_template_save` ⚠️🔒 · `whoop_lift_custom_exercise` ⚠️🔒 |
|
|
211
|
-
| **Journal** (5) | `whoop_journal` · `whoop_journal_catalog` · `whoop_behavior_impact` · `whoop_journal_log` ⚠️🔒 · `whoop_journal_autopop` ⚠️ |
|
|
212
|
-
| **Women's health** (3) | `whoop_cycle` · `whoop_cycle_log` ⚠️ · `whoop_symptom_log` ⚠️🔒 |
|
|
213
|
-
| **Coach + performance** (2) | `whoop_coach_ask` ⚠️ · `whoop_performance_assessment` |
|
|
214
|
-
| **Smart alarm** (2) | `whoop_smart_alarm` · `whoop_smart_alarm_set` ⚠️ |
|
|
215
|
-
| **Social** (2) | `whoop_leaderboard` · `whoop_communities` |
|
|
216
|
-
| **Settings** (4) | `whoop_hr_zones` · `whoop_hr_zones_set` ⚠️ · `whoop_profile_update` ⚠️ · `whoop_hidden_metric` ⚠️ |
|
|
217
|
-
| **Escape hatch** (2) | `whoop_raw` · `whoop_endpoints` |
|
|
116
|
+
Anything that writes comes back as a preview first. Your app shows you what will change and asks before it happens.
|
|
218
117
|
|
|
219
|
-
|
|
118
|
+
## Connect your apps
|
|
220
119
|
|
|
221
|
-
|
|
120
|
+
`totem connect` sets up the apps on your computer. A cloud server also has a Connect page at `https://your-server/connect`, with a button or a copy-ready step for each app, already filled in with your server's address.
|
|
222
121
|
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
122
|
+
<p align="center">
|
|
123
|
+
<picture>
|
|
124
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/media/connect-page-dark.png">
|
|
125
|
+
<img src="docs/media/connect-page-light.png" width="49%" alt="The Connect page: the server's address and a card for each app, with a button or a command to copy.">
|
|
126
|
+
</picture>
|
|
127
|
+
<picture>
|
|
128
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/media/consent-page-dark.png">
|
|
129
|
+
<img src="docs/media/consent-page-light.png" width="49%" alt="The sign-in page: which app is asking, where access will be sent, the permissions, and the connector password.">
|
|
130
|
+
</picture>
|
|
131
|
+
</p>
|
|
226
132
|
|
|
227
|
-
|
|
133
|
+
With a cloud server, each app sends you to totem's sign-in page once. It names the app that's asking, shows where access will go, and asks for your connector password.
|
|
228
134
|
|
|
229
|
-
|
|
135
|
+
<details>
|
|
136
|
+
<summary><b>Every app, step by step</b></summary>
|
|
230
137
|
|
|
231
|
-
|
|
138
|
+
<br>
|
|
232
139
|
|
|
233
|
-
|
|
|
140
|
+
| App | On this computer | With a cloud server |
|
|
234
141
|
|---|---|---|
|
|
235
|
-
|
|
|
236
|
-
| `
|
|
237
|
-
| `
|
|
238
|
-
|
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
## Write-safety harness
|
|
245
|
-
|
|
246
|
-
Every write tool defaults `confirm: false`. The first call returns a **preview** of what would execute. Claude must explicitly re-call with `confirm: true` to fire the actual request. Without the gate, a hallucinated "log my workout" could create garbage activities on your account.
|
|
247
|
-
|
|
248
|
-
The preview shape (lives in `src/whoop/write_safety.ts`):
|
|
249
|
-
|
|
250
|
-
```json
|
|
251
|
-
{
|
|
252
|
-
"preview": true,
|
|
253
|
-
"will_execute": {
|
|
254
|
-
"method": "POST",
|
|
255
|
-
"path": "/weightlifting-service/v2/weightlifting-workout/activity",
|
|
256
|
-
"body_summary": {
|
|
257
|
-
"exercise_count": 3, "set_count": 12,
|
|
258
|
-
"exercise_list": [{"name": "BENCHPRESS_BARBELL", "set_count": 5}, ...]
|
|
259
|
-
}
|
|
260
|
-
},
|
|
261
|
-
"set_confirm_true_to_run": true
|
|
262
|
-
}
|
|
263
|
-
```
|
|
142
|
+
| claude.ai, Claude Desktop, Claude mobile | Claude Desktop's config file | A link that opens claude.ai's "Add custom connector" filled in. It then shows up in Desktop and on your phone too |
|
|
143
|
+
| Claude Code | `claude mcp add` | `claude mcp add --transport http`, then `/mcp` to sign in |
|
|
144
|
+
| ChatGPT desktop and Codex | `codex mcp add` (they share one config) | `codex mcp add --url`, which opens the sign-in itself |
|
|
145
|
+
| chatgpt.com | Needs a cloud server | Plugins → Add → Add custom MCP server |
|
|
146
|
+
| Cursor | `~/.cursor/mcp.json` | An "Add to Cursor" link |
|
|
147
|
+
| VS Code (Copilot) | `~/.copilot/mcp-config.json` | An "Add to VS Code" link |
|
|
148
|
+
| OpenCode (1 and 2) | `opencode.json` | `opencode.json`, then `opencode mcp auth whoop` |
|
|
149
|
+
| Antigravity | `~/.gemini/config/mcp_config.json` | The same file, with the server's address |
|
|
264
150
|
|
|
265
|
-
|
|
151
|
+
`totem connect <app>` sets up one app, and `totem connect --print` shows what it would add without touching anything.
|
|
266
152
|
|
|
267
|
-
|
|
153
|
+
</details>
|
|
268
154
|
|
|
269
|
-
##
|
|
155
|
+
## Hosting
|
|
270
156
|
|
|
271
|
-
|
|
157
|
+
`totem cloud` deploys to any of these, then checks that the server answers.
|
|
272
158
|
|
|
273
|
-
|
|
|
274
|
-
|---|---:|---|---|
|
|
275
|
-
| `behaviors.ts` | 308 | `whoop_journal_catalog` | Journal behavior validation |
|
|
276
|
-
| `exercises.ts` | 372 | `whoop_lift_catalog` | Strength Trainer exercises |
|
|
277
|
-
| `sports.ts` | 203 | `whoop_sports_catalog` | `sport_id` ↔ name |
|
|
278
|
-
| `endpoints.ts` | 311 | `whoop_endpoints` | API path search |
|
|
279
|
-
|
|
280
|
-
**Session-scoped gate**: tools that take IDs from sports/exercises/behaviors refuse to run until the corresponding catalog tool has been called once per session. Keeps ~14k tokens out of the system prompt. AI calling e.g. `whoop_activity_create` first gets `{error: "Must call whoop_sports_catalog first…"}`.
|
|
281
|
-
|
|
282
|
-
---
|
|
283
|
-
|
|
284
|
-
## Configuration
|
|
285
|
-
|
|
286
|
-
### Environment variables
|
|
287
|
-
|
|
288
|
-
| Variable | Required | Description |
|
|
159
|
+
| Host | Cost | Good to know |
|
|
289
160
|
|---|---|---|
|
|
290
|
-
|
|
|
291
|
-
|
|
|
292
|
-
|
|
|
293
|
-
|
|
|
294
|
-
| `WHOOP_USER_ID` | no | Your Whoop user ID — used by `whoop_profile`, `whoop_leaderboard`. Avoids one bootstrap call per session. |
|
|
295
|
-
| `WHOOP_TIMEZONE` | no | IANA timezone (e.g., `America/Los_Angeles`). If unset, auto-detected from your Whoop profile and refreshed hourly. Set explicitly to override. |
|
|
296
|
-
| `WHOOP_INSTALLATION_ID` | no (auto) | The per-install device identifier sent as `x-whoop-installation-identifier`. Generated once and written to `.env` on first run — don't set it by hand. |
|
|
297
|
-
| `WHOOP_TOKEN_STORE` | no | `envfile` (default — persists refreshed tokens back to `.env`) or `memory` (for read-only filesystems; re-bootstrap every ~30 days). |
|
|
298
|
-
|
|
299
|
-
### Claude Desktop config
|
|
300
|
-
|
|
301
|
-
```json
|
|
302
|
-
{
|
|
303
|
-
"mcpServers": {
|
|
304
|
-
"whoop": {
|
|
305
|
-
"command": "/opt/homebrew/bin/node",
|
|
306
|
-
"args": ["/absolute/path/to/totem/dist/server.js"]
|
|
307
|
-
}
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
```
|
|
311
|
-
|
|
312
|
-
The MCP loads `.env` from the repo root (relative to `server.js`). Use absolute paths — Claude Desktop doesn't inherit shell `PATH`.
|
|
313
|
-
|
|
314
|
-
---
|
|
315
|
-
|
|
316
|
-
## Remote hosting
|
|
317
|
-
|
|
318
|
-
The MCP also speaks HTTP — deploy once, use from multiple devices. Same 48 tools, same auto-refresh, behind a bearer-token gate at a URL.
|
|
319
|
-
|
|
320
|
-
```bash
|
|
321
|
-
# 1. Local bootstrap (Cognito needs an interactive MFA prompt)
|
|
322
|
-
totem auth
|
|
323
|
-
|
|
324
|
-
# 2. Build + deploy via the shipped Dockerfile (Fly/Railway/Render/VPS — all work)
|
|
325
|
-
docker build -t totem .
|
|
326
|
-
|
|
327
|
-
# 3. Run with env: WHOOP_EMAIL, WHOOP_IOS_BEARER_TOKEN, WHOOP_COGNITO_REFRESH_TOKEN,
|
|
328
|
-
# MCP_TRANSPORT=http, MCP_AUTH_TOKEN=$(openssl rand -hex 32)
|
|
329
|
-
```
|
|
330
|
-
|
|
331
|
-
### Deploying to Hugging Face Spaces (free hosting)
|
|
332
|
-
|
|
333
|
-
[Hugging Face Spaces](https://huggingface.co/spaces) provides **free Docker hosting** — a zero-cost alternative to Fly or Railway. Connecting to **claude.ai web and Claude mobile** as a custom connector requires a **Claude Pro plan**, but the server itself runs for free on HuggingFace.
|
|
161
|
+
| **Cloudflare Workers** (recommended) | Free plan, 100,000 requests a day | No machine to look after. The login lives in a Durable Object. |
|
|
162
|
+
| **Fly.io** | About $4 a month for one 512 MB machine in Virginia and a 1 GB volume | Always on. At the time of writing, Fly doesn't bill personal accounts for less than $5 a month. |
|
|
163
|
+
| **Railway** | Railway's paid plan | A dashboard and logs in the browser. |
|
|
164
|
+
| **Your own server** | Yours | Any Docker host. totem writes the settings and prints the commands, or use the image `ghcr.io/thebriangao/totem`. Mount a volume at `/data`. |
|
|
334
165
|
|
|
335
|
-
|
|
166
|
+
Afterwards, `totem status` checks the server and its WHOOP login, `totem logs` shows its logs, and `totem deploy` sends it a new version.
|
|
336
167
|
|
|
337
|
-
|
|
168
|
+
## How it works
|
|
338
169
|
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
-
|
|
342
|
-
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
**2. Add your secrets via the Space Settings UI**
|
|
346
|
-
|
|
347
|
-
In your Space → **Settings → Variables and Secrets**, add the following. The token values go in as **Secrets** (hidden, never shown in logs); `PORT` and `PUBLIC_URL` aren't sensitive, so they can be plain **Variables**:
|
|
348
|
-
|
|
349
|
-
| Secret name | Where to find the value |
|
|
350
|
-
|---|---|
|
|
351
|
-
| `WHOOP_EMAIL` | Your Whoop account email |
|
|
352
|
-
| `WHOOP_IOS_BEARER_TOKEN` | From `totem auth` on your local machine (written to `.env`) |
|
|
353
|
-
| `WHOOP_COGNITO_REFRESH_TOKEN` | From `totem auth` on your local machine (written to `.env`) |
|
|
354
|
-
| `WHOOP_USER_ID` | From `.env` after running `totem auth` |
|
|
355
|
-
| `MCP_AUTH_TOKEN` | Generate one with `openssl rand -hex 32` (or reuse the value from `.env.deploy` if you ran a deploy flow) |
|
|
356
|
-
| `AUTH_PASSWORD` | A password you'll type once when adding the Claude connector |
|
|
357
|
-
| `PUBLIC_URL` | Your Space's public URL — e.g. `https://<your-hf-username>-<your-space-name>.hf.space` |
|
|
358
|
-
| `PORT` | `7860` — HuggingFace's required port. Without this the container listens on 3000 and is unreachable. |
|
|
359
|
-
|
|
360
|
-
> **Tip:** The `WHOOP_*` token values come from your local `.env` after running `totem auth`. `MCP_AUTH_TOKEN` you generate yourself (`openssl rand -hex 32`).
|
|
361
|
-
|
|
362
|
-
**3. Push your code to the Space**
|
|
363
|
-
|
|
364
|
-
Clone this repo and add your HuggingFace Space as a remote, then push:
|
|
365
|
-
|
|
366
|
-
```bash
|
|
367
|
-
git clone https://github.com/thebriangao/totem
|
|
368
|
-
cd totem
|
|
369
|
-
|
|
370
|
-
# Add your HuggingFace Space as a remote
|
|
371
|
-
git remote add hf https://huggingface.co/spaces/<your-hf-username>/<your-space-name>
|
|
372
|
-
|
|
373
|
-
# Push the main branch
|
|
374
|
-
git push hf main
|
|
375
|
-
```
|
|
376
|
-
|
|
377
|
-
HuggingFace will automatically build and run the Docker container. Watch the **Logs** tab in your Space to confirm it starts up and `/health` returns 200.
|
|
378
|
-
|
|
379
|
-
**4. Connect to Claude**
|
|
380
|
-
|
|
381
|
-
Once the Space is running, go to **claude.ai → Settings → Connectors → Add custom connector**:
|
|
382
|
-
|
|
383
|
-
- **MCP Server URL:** `https://<your-hf-username>-<your-space-name>.hf.space/mcp`
|
|
384
|
-
- Claude will open an OAuth flow — enter the `AUTH_PASSWORD` you set in your Space secrets
|
|
385
|
-
|
|
386
|
-
> `MCP_AUTH_TOKEN` is used internally as the bearer token + JWT signing secret. You do **not** type it into Claude's connector UI — that field uses the OAuth `AUTH_PASSWORD` flow instead.
|
|
387
|
-
|
|
388
|
-
**5. Re-authenticate when tokens expire (~30 days)**
|
|
389
|
-
|
|
390
|
-
Whoop's Cognito tokens expire roughly every 30 days. Re-run `totem auth` on your local machine, then update `WHOOP_IOS_BEARER_TOKEN` and `WHOOP_COGNITO_REFRESH_TOKEN` in your Space's Secrets UI. The Space will restart automatically and pick up the new tokens.
|
|
391
|
-
|
|
392
|
-
**Claude Desktop** doesn't natively speak remote MCP — bridge through stdio with [`mcp-remote`](https://www.npmjs.com/package/mcp-remote):
|
|
393
|
-
|
|
394
|
-
```json
|
|
395
|
-
{ "mcpServers": { "whoop": {
|
|
396
|
-
"command": "npx",
|
|
397
|
-
"args": ["-y", "mcp-remote", "https://your-app.fly.dev/mcp",
|
|
398
|
-
"--header", "Authorization:Bearer your-mcp-auth-token"]
|
|
399
|
-
}}}
|
|
400
|
-
```
|
|
401
|
-
|
|
402
|
-
**Claude Code** speaks remote MCP natively: `claude mcp add whoop --url ... --header ...`.
|
|
403
|
-
|
|
404
|
-
**claude.ai web + Claude mobile app** can't use a bearer token — their custom-connector UI only supports OAuth. The server includes an OAuth 2.1 + PKCE authorization server for exactly this. Enable it by setting two extra env vars:
|
|
405
|
-
|
|
406
|
-
```bash
|
|
407
|
-
AUTH_PASSWORD=<a password you'll type once when adding the connector>
|
|
408
|
-
PUBLIC_URL=https://your-app.fly.dev # your server's public origin (the OAuth issuer)
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
Then in Claude: **Settings → Connectors → Add custom connector**, paste `https://your-app.fly.dev/mcp`, and Claude walks the OAuth flow. It pops a small password page (served by your server) — enter `AUTH_PASSWORD`, approve, done. The connector then syncs across every device logged into your Claude account (web, desktop, mobile). The password gate means a stranger who finds your URL still can't connect without it. `MCP_AUTH_TOKEN` doubles as the JWT signing secret; leave `AUTH_PASSWORD` unset to disable this path.
|
|
412
|
-
|
|
413
|
-
All of the above is what `totem cloud` automates for you — the manual steps here are for reference or hand-rolling.
|
|
170
|
+
<p align="center">
|
|
171
|
+
<picture>
|
|
172
|
+
<source media="(prefers-color-scheme: dark)" srcset="docs/media/how-it-works-dark.svg">
|
|
173
|
+
<img src="docs/media/how-it-works-light.svg" width="820" alt="WHOOP talks to your totem server over WHOOP's app API. Your AI apps talk to your totem server over MCP. totem runs on your computer or your own cloud server.">
|
|
174
|
+
</picture>
|
|
175
|
+
</p>
|
|
414
176
|
|
|
415
|
-
|
|
177
|
+
Your data goes from WHOOP to your totem to the app you asked, and nowhere else. There is no totem company in the middle, no shared server and no analytics.
|
|
416
178
|
|
|
417
|
-
|
|
179
|
+
### The WHOOP login
|
|
418
180
|
|
|
419
|
-
|
|
181
|
+
1. `totem auth`, which `local` and `cloud` run for you, opens a fresh browser window on app.whoop.com. You log in on WHOOP's own page, two-factor check included.
|
|
182
|
+
2. totem reads only WHOOP's session cookies from that window, then closes it and deletes the temporary profile.
|
|
183
|
+
3. The login is kept in one file that only you can read (`~/.config/totem/tokens.json`), or on your server: on its volume, or in Cloudflare Durable Object storage.
|
|
184
|
+
4. WHOOP replaces the refresh token every time it's used, so exactly one place owns a login. totem refreshes it on its own, every 12 hours and before it expires, and saves the new one first.
|
|
420
185
|
|
|
421
|
-
|
|
186
|
+
To log in again, run `totem auth`.
|
|
422
187
|
|
|
423
|
-
|
|
188
|
+
### Security
|
|
424
189
|
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
190
|
+
- **Your server, your keys.** A cloud server has two secrets of its own: `MCP_AUTH_TOKEN`, the server's key, kept in `~/.config/totem/deploy.json` on your computer, and the connector password you type when an app connects.
|
|
191
|
+
- **The sign-in page names the destination.** It shows the real address access goes to (claude.ai, chatgpt.com, an app on your own computer), never just the name an app claims.
|
|
192
|
+
- **The server talks to WHOOP and your apps, nothing else.** No telemetry, no analytics.
|
|
193
|
+
- **Writes need confirmation,** and `whoop_raw` writes also need `allow_write`.
|
|
428
194
|
|
|
429
|
-
|
|
430
|
-
```
|
|
195
|
+
More in [SECURITY.md](SECURITY.md).
|
|
431
196
|
|
|
432
|
-
Commands
|
|
197
|
+
## Commands
|
|
433
198
|
|
|
434
|
-
|
|
|
199
|
+
| Command | What it does |
|
|
435
200
|
|---|---|
|
|
436
|
-
|
|
|
437
|
-
|
|
|
438
|
-
|
|
|
439
|
-
|
|
|
440
|
-
|
|
|
441
|
-
|
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
After a successful update to the latest it offers **auto-update**. Turn it on and a background job (launchd on macOS, cron on Linux) checks for new releases every 6 hours and applies them the same way — pull, build, redeploy, health-check — logging to `.totem-autoupdate.log`. There's no push channel to your machine, so it's a scheduled poll, not instant. Toggle it directly anytime:
|
|
448
|
-
|
|
449
|
-
```bash
|
|
450
|
-
totem update # interactive: pick a version, then optionally enable auto-update
|
|
451
|
-
totem update --auto on # turn auto-update on (and pull the newest now)
|
|
452
|
-
totem update --auto off # turn it off
|
|
453
|
-
totem update --check # non-interactive: print installed-vs-latest + auto state
|
|
454
|
-
```
|
|
455
|
-
|
|
456
|
-
Versions are sourced from the places that already host them — git tags + GitHub Releases for git installs, the npm registry for global installs — so there's nothing extra to maintain. Auto-update is opt-in and only ever moves you to **released** versions (every release is CI-gated), never bleeding-edge `main`.
|
|
457
|
-
|
|
458
|
-
---
|
|
459
|
-
|
|
460
|
-
## Privacy + security
|
|
461
|
-
|
|
462
|
-
- **Credentials live in `.env` on your machine.** Email, password, access token, refresh token — never leave your filesystem. Claude can't read them (it doesn't have filesystem access unless you wire in a filesystem MCP).
|
|
463
|
-
- **The only outbound traffic is HTTPS to `api.prod.whoop.com`.** No telemetry, no analytics, no third-party servers. The MCP is open source — every line that touches your data is auditable.
|
|
464
|
-
- **Write safety**: every write tool defaults to `confirm: false`. The preview shape includes what would be sent. You see it in chat before any mutation. To go further, remove specific writes from `src/tools/register.ts` or use Claude Desktop's "always require approval" setting.
|
|
465
|
-
- **Hardened in 1.2.3**: token files are written `0600`, your account password is wiped from `.env` after login, OAuth tokens are audience-bound and signed with a key derived from `MCP_AUTH_TOKEN`, the HTTP server sends anti-clickjacking + CSP headers, the connector-password gate has a global brute-force ceiling, and deploy secrets are pushed over stdin (not argv). Full detail in [`SECURITY.md`](SECURITY.md) and [`CHANGELOG.md`](CHANGELOG.md).
|
|
466
|
-
|
|
467
|
-
---
|
|
201
|
+
| `totem` | Show where this install stands and what to run next |
|
|
202
|
+
| `totem local` | Run on this computer: log in, then set up your AI apps |
|
|
203
|
+
| `totem cloud` | Deploy your own server, log it in, connect your apps |
|
|
204
|
+
| `totem connect [app]` | Set up your apps again, or just one |
|
|
205
|
+
| `totem auth` | Log in to WHOOP (`--local`, `--url URL`, `--paste`, `--status`) |
|
|
206
|
+
| `totem status` / `ping` / `logs` | Check the server and its login |
|
|
207
|
+
| `totem deploy` | Deploy this version to your server |
|
|
208
|
+
| `totem update` | Update totem (`--check`, `--auto on`) |
|
|
209
|
+
| `totem tools` | List the 41 tools |
|
|
210
|
+
|
|
211
|
+
`totem <command> --help` explains each one.
|
|
468
212
|
|
|
469
213
|
## Troubleshooting
|
|
470
214
|
|
|
471
|
-
**
|
|
472
|
-
> Wrong email or password. Double-check `.env`.
|
|
473
|
-
|
|
474
|
-
**"AUTH FAIL: Cognito MFA challenge missing Session token"**
|
|
475
|
-
> The InitiateAuth response was malformed (unusual). Re-run `totem auth` — Cognito occasionally drops sessions.
|
|
476
|
-
|
|
477
|
-
**"MFA verification did not return tokens"**
|
|
478
|
-
> You entered the wrong SMS code (or it timed out). Codes expire after ~3 minutes.
|
|
479
|
-
|
|
480
|
-
**"WhoopAuthExpiredError" after every call**
|
|
481
|
-
> Your refresh token has expired (>30 days since last login). Re-run `totem auth` — it logs you back in, saves the tokens locally, and (if you deployed) auto-detects your host and pushes the new tokens to it in one step. If your account has MFA you'll get a fresh SMS code on your phone to type in the terminal.
|
|
482
|
-
|
|
483
|
-
**"WhoopServerError: 502" / "503" / "504"**
|
|
484
|
-
> Whoop's servers are having issues. Retry in 30 seconds.
|
|
485
|
-
|
|
486
|
-
**Claude says it doesn't see any whoop tools**
|
|
487
|
-
> Check `claude_desktop_config.json` paths are absolute. Restart Claude Desktop fully (quit, then reopen).
|
|
488
|
-
> Check the MCP server runs without errors: `totem dev` — it should start silently and wait on stdin.
|
|
489
|
-
|
|
490
|
-
**"WhoopApiError: 422 on /profile-service/v1/profile"**
|
|
491
|
-
> Your `whoop_profile_update` body is too partial. Send most fields (gender from {MALE,FEMALE,NON_BINARY} only, birthday as YYYY-MM-DD or ISO datetime, country ISO-2). If `country=US`, also send `state` — Whoop returns 400 `"AdminDivision (state) must be set for US"` otherwise.
|
|
492
|
-
|
|
493
|
-
**"Whoop API error 409 on /weightlifting-service/v2/weightlifting-workout/activity"**
|
|
494
|
-
> Time window conflicts with an existing workout. Use a different range.
|
|
495
|
-
|
|
496
|
-
**"WhoopProjectionError for whoop_X"**
|
|
497
|
-
> Whoop changed a response shape. Capture the new response (e.g. via `whoop_raw`), inspect, update the projection.
|
|
215
|
+
**The app doesn't show any WHOOP tools.** Restart it fully. For a local setup, run `totem status`. For a server, run `totem ping`.
|
|
498
216
|
|
|
499
|
-
**
|
|
500
|
-
> Pull may have updated captured fixtures. Run `totem test` again to see what changed. If projections need updating, that's the work.
|
|
217
|
+
**"No WHOOP login on this server."** Run `totem auth`. It sends the login to your server when one is set up, or saves it on this computer.
|
|
501
218
|
|
|
502
|
-
|
|
503
|
-
> You're using an old Node. Upgrade to Node 24+.
|
|
219
|
+
**No browser was found for the login.** totem uses Chrome, Chromium, Edge or Brave. Point it at another one with `TOTEM_BROWSER=/path/to/browser`, or run `totem auth --paste` and paste the `whoop-auth-refresh-token` cookie from a browser that's logged in to app.whoop.com.
|
|
504
220
|
|
|
505
|
-
**
|
|
506
|
-
> Create `.env` at the repo root (or wherever `dist/server.js` is being run from — the MCP loads `.env` relative to the entry).
|
|
221
|
+
**OpenCode or another app's config has comments.** totem doesn't rewrite files it can't read exactly. For OpenCode it lets OpenCode add the server itself. For others it prints the entry to add.
|
|
507
222
|
|
|
508
|
-
**
|
|
509
|
-
> Run `npm install`.
|
|
510
|
-
|
|
511
|
-
**"AbortError: This operation was aborted"**
|
|
512
|
-
> A request to Whoop's API took longer than 30s. Either Whoop is slow or your network is slow. Retry.
|
|
513
|
-
|
|
514
|
-
---
|
|
515
|
-
|
|
516
|
-
## Comparison to alternatives
|
|
517
|
-
|
|
518
|
-
| Approach | Pros | Cons |
|
|
519
|
-
|---|---|---|
|
|
520
|
-
| **This MCP** | Full iOS API surface (48 total: 32 reads + 14 writes + 2 escape hatches), writes supported, structured outputs, auto-refresh, write-safety, session-scoped catalog gate | Unsupported by Whoop (see [FAQ](#faq) for what that means); reverse-engineered (Whoop could break it at any time); local install required |
|
|
521
|
-
| Whoop's public OAuth API | Official, supported, 6 webhook events, scoped permissions | Only 13 endpoints; read-only; no journal/strength/stress/coach/smart-alarm/trends/hypnogram; numeric `sport_id` removed 2025-09-01; 429s exist |
|
|
522
|
-
| HealthKit-based scraper | Bypass Whoop entirely; uses Apple's data sync | Loses Whoop-specific data (recovery score, journal, coach); requires iOS device involvement |
|
|
523
|
-
| Direct mitmproxy capture | See everything | Manual, not programmable, doesn't scale |
|
|
524
|
-
| Whoop iOS app + screenshots → Claude | Works without code | Painful, slow, no writes |
|
|
525
|
-
|
|
526
|
-
This MCP is the only option for **programmatic write access** to your Whoop data right now.
|
|
527
|
-
|
|
528
|
-
---
|
|
223
|
+
**WHOOP answers 5xx.** WHOOP is having trouble. Try again in a minute.
|
|
529
224
|
|
|
530
225
|
## FAQ
|
|
531
226
|
|
|
532
|
-
**
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
**Q: Why not use Whoop's public OAuth API instead?**
|
|
536
|
-
A: It's 13 endpoints, all read-only, no journal, no strength, no stress, no coach, no smart alarm, no trends beyond a single recovery score per day. Whoop also pulled numeric `sport_id` past 2025-09-01 (now `sport_name` strings only). If you only need recovery score + sleep stage totals + workout list, the OAuth API is the right answer.
|
|
537
|
-
|
|
538
|
-
**Q: Will this work with the Whoop 4.0 vs 5.0 strap?**
|
|
539
|
-
A: Yes — the API doesn't care which strap you have. It cares about your account.
|
|
227
|
+
**Is this supported by WHOOP?**
|
|
228
|
+
No. totem uses WHOOP's private app API, which WHOOP doesn't offer to third parties, and WHOOP's terms let them act against accounts that use unsupported tools. totem's requests look like the app's and stay at a person's pace, but there is no guarantee. If losing your WHOOP account would be a problem, don't use it.
|
|
540
229
|
|
|
541
|
-
**
|
|
542
|
-
|
|
230
|
+
**Why not WHOOP's public API?**
|
|
231
|
+
It's read-only and covers a small part of the data: no journal, Strength Trainer, stress, Coach, Smart Alarm, hypnogram or trends, and no writes. If recovery, sleep totals and a workout list are enough for you, use it instead.
|
|
543
232
|
|
|
544
|
-
**
|
|
545
|
-
|
|
233
|
+
**Can I share my server with a friend?**
|
|
234
|
+
No. Each person needs their own server and their own WHOOP login. A login can't be shared, because WHOOP replaces the refresh token on every use.
|
|
546
235
|
|
|
547
|
-
**
|
|
548
|
-
|
|
236
|
+
**Does it work with WHOOP 4.0 and 5.0/MG?**
|
|
237
|
+
Yes. The API depends on your account, not your strap.
|
|
549
238
|
|
|
550
|
-
**
|
|
551
|
-
|
|
239
|
+
**Where does my data go?**
|
|
240
|
+
From WHOOP to your server to the app you asked. totem keeps no copy, only an in-memory cache of recent reads.
|
|
552
241
|
|
|
553
|
-
|
|
554
|
-
A: It's MCP-compatible — anything that speaks MCP can talk to it.
|
|
242
|
+
## Contributing
|
|
555
243
|
|
|
556
|
-
|
|
557
|
-
A: The MCP SDK is most mature in TypeScript. Also Whoop's API responses are heavily nested — zod is genuinely the best validation library for that shape work.
|
|
244
|
+
Issues and pull requests are welcome. To work on totem:
|
|
558
245
|
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
**Q: Will you maintain this?**
|
|
566
|
-
A: Best-effort. PRs welcome.
|
|
567
|
-
|
|
568
|
-
---
|
|
569
|
-
|
|
570
|
-
## Disclaimers
|
|
571
|
-
|
|
572
|
-
- **Not affiliated with Whoop.** "WHOOP" is a trademark of WHOOP, Inc. Community-built tool that interacts with surfaces Whoop has not published. See the [FAQ](#faq) for the practical implications.
|
|
573
|
-
- **No warranty, use at your own discretion.** The API surface is reverse-engineered — Whoop can change response shapes at any time. The zod schemas surface drift as `WhoopProjectionError` instead of silent corruption.
|
|
574
|
-
- **Respect rate limits.** Single-digit RPS in normal use. Don't be the person who triggers a backend alert that gets every user of this MCP banned.
|
|
575
|
-
- **Don't share tokens.** Your `.env` is yours. Don't commit it, don't paste it anywhere.
|
|
246
|
+
```bash
|
|
247
|
+
git clone https://github.com/thebriangao/totem && cd totem
|
|
248
|
+
npm install
|
|
249
|
+
npx tsc && npm link # builds once and puts `totem` on your PATH
|
|
250
|
+
totem test
|
|
251
|
+
```
|
|
576
252
|
|
|
577
|
-
|
|
253
|
+
[CONTRIBUTING.md](CONTRIBUTING.md) explains how the project is laid out, and [WHOOP.md](WHOOP.md) documents what is known about WHOOP's API.
|
|
578
254
|
|
|
579
255
|
## Acknowledgments
|
|
580
256
|
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
- **The TypeScript + zod community** for making strict validation pleasant
|
|
585
|
-
- The various API consumers + bloggers who documented bits of Whoop's private API over the years
|
|
257
|
+
Thanks to everyone who opened issues and pull requests for v1 and v2, to [Anthropic](https://anthropic.com) for MCP, and to the people who documented pieces of WHOOP's API over the years.
|
|
258
|
+
|
|
259
|
+
## License
|
|
586
260
|
|
|
587
|
-
|
|
261
|
+
[MIT](LICENSE). "WHOOP" is a trademark of WHOOP, Inc. totem is an independent project and is not affiliated with, endorsed by or connected to WHOOP.
|