intervals-icu-mcp-server 0.1.5 → 0.1.6
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/dist/client.d.ts +39 -49
- package/dist/client.js +20 -21
- package/dist/format.js +16 -10
- package/dist/index.js +6 -12
- package/package.json +1 -1
package/dist/client.d.ts
CHANGED
|
@@ -7,17 +7,17 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
7
7
|
id: z.ZodString;
|
|
8
8
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
9
9
|
type: z.ZodOptional<z.ZodString>;
|
|
10
|
-
|
|
10
|
+
start_date_local: z.ZodOptional<z.ZodString>;
|
|
11
11
|
distance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
12
|
-
|
|
12
|
+
elapsed_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
13
13
|
moving_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
14
|
-
|
|
15
|
-
|
|
14
|
+
total_elevation_gain: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
15
|
+
icu_average_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
16
16
|
icu_weighted_avg_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
17
|
-
|
|
17
|
+
icu_training_load: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
18
18
|
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
19
19
|
icu_intensity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
20
|
-
|
|
20
|
+
average_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
21
21
|
max_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
22
22
|
average_cadence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
23
23
|
calories: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -27,6 +27,8 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
27
27
|
trimp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
28
28
|
average_temp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
29
29
|
perceived_exertion: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
|
+
icu_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
|
+
session_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
30
32
|
feel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
31
33
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
32
34
|
trainer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -34,17 +36,17 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
34
36
|
id: z.ZodString;
|
|
35
37
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
36
38
|
type: z.ZodOptional<z.ZodString>;
|
|
37
|
-
|
|
39
|
+
start_date_local: z.ZodOptional<z.ZodString>;
|
|
38
40
|
distance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
39
|
-
|
|
41
|
+
elapsed_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
40
42
|
moving_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
41
|
-
|
|
42
|
-
|
|
43
|
+
total_elevation_gain: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
44
|
+
icu_average_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
43
45
|
icu_weighted_avg_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
44
|
-
|
|
46
|
+
icu_training_load: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
45
47
|
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
46
48
|
icu_intensity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
47
|
-
|
|
49
|
+
average_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
48
50
|
max_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
49
51
|
average_cadence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
50
52
|
calories: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -54,6 +56,8 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
54
56
|
trimp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
55
57
|
average_temp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
56
58
|
perceived_exertion: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
59
|
+
icu_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
60
|
+
session_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
57
61
|
feel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
58
62
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
59
63
|
trainer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -61,17 +65,17 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
61
65
|
id: z.ZodString;
|
|
62
66
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
63
67
|
type: z.ZodOptional<z.ZodString>;
|
|
64
|
-
|
|
68
|
+
start_date_local: z.ZodOptional<z.ZodString>;
|
|
65
69
|
distance: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
66
|
-
|
|
70
|
+
elapsed_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
67
71
|
moving_time: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
total_elevation_gain: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
73
|
+
icu_average_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
70
74
|
icu_weighted_avg_watts: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
71
|
-
|
|
75
|
+
icu_training_load: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
76
|
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
73
77
|
icu_intensity: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
|
-
|
|
78
|
+
average_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
75
79
|
max_heartrate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
76
80
|
average_cadence: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
77
81
|
calories: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
@@ -81,6 +85,8 @@ export declare const ActivitySchema: z.ZodObject<{
|
|
|
81
85
|
trimp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
82
86
|
average_temp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
83
87
|
perceived_exertion: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
88
|
+
icu_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
89
|
+
session_rpe: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
84
90
|
feel: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
85
91
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
86
92
|
trainer: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
@@ -166,9 +172,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
166
172
|
show_as_note: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
167
173
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
168
174
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
-
|
|
170
|
-
workout: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
171
|
-
priority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
175
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
176
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
173
177
|
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
174
178
|
date: z.ZodOptional<z.ZodString>;
|
|
@@ -178,9 +182,7 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
178
182
|
show_as_note: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
179
183
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
180
184
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
-
|
|
182
|
-
workout: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
183
|
-
priority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
185
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
184
186
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
185
187
|
id: z.ZodUnion<[z.ZodString, z.ZodNumber]>;
|
|
186
188
|
date: z.ZodOptional<z.ZodString>;
|
|
@@ -190,20 +192,18 @@ export declare const EventSchema: z.ZodObject<{
|
|
|
190
192
|
show_as_note: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
191
193
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
192
194
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
193
|
-
|
|
194
|
-
workout: z.ZodOptional<z.ZodNullable<z.ZodUnknown>>;
|
|
195
|
-
priority: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
195
|
+
color: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
196
196
|
}, z.ZodTypeAny, "passthrough">>;
|
|
197
197
|
export type Event = z.infer<typeof EventSchema>;
|
|
198
198
|
export declare const IntervalSchema: z.ZodObject<{
|
|
199
|
-
icu_intervals: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
200
|
-
icu_groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
199
|
+
icu_intervals: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
200
|
+
icu_groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
201
201
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
202
|
-
icu_intervals: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
203
|
-
icu_groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
202
|
+
icu_intervals: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
203
|
+
icu_groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
204
204
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
205
|
-
icu_intervals: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
206
|
-
icu_groups: z.ZodOptional<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many"
|
|
205
|
+
icu_intervals: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
206
|
+
icu_groups: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodRecord<z.ZodString, z.ZodUnknown>, "many">>>;
|
|
207
207
|
}, z.ZodTypeAny, "passthrough">>;
|
|
208
208
|
export interface EventInput {
|
|
209
209
|
name?: string;
|
|
@@ -212,7 +212,6 @@ export interface EventInput {
|
|
|
212
212
|
end_date_local?: string;
|
|
213
213
|
category?: string;
|
|
214
214
|
type?: string;
|
|
215
|
-
race?: boolean;
|
|
216
215
|
distance?: number;
|
|
217
216
|
sub_type?: string;
|
|
218
217
|
workout_doc?: unknown;
|
|
@@ -223,42 +222,33 @@ export declare const AthleteSchema: z.ZodObject<{
|
|
|
223
222
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
223
|
sex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
225
224
|
weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
226
|
-
|
|
225
|
+
icu_date_of_birth: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
227
226
|
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
228
227
|
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
229
|
-
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
230
|
-
icu_lthr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
231
228
|
icu_resting_hr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
232
229
|
icu_weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
233
|
-
icu_vo2max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
234
230
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
235
231
|
id: z.ZodOptional<z.ZodString>;
|
|
236
232
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
237
233
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
238
234
|
sex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
239
235
|
weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
240
|
-
|
|
236
|
+
icu_date_of_birth: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
241
237
|
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
242
238
|
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
243
|
-
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
244
|
-
icu_lthr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
245
239
|
icu_resting_hr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
246
240
|
icu_weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
247
|
-
icu_vo2max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
248
241
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
249
242
|
id: z.ZodOptional<z.ZodString>;
|
|
250
243
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
251
244
|
email: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
252
245
|
sex: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
253
246
|
weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
254
|
-
|
|
247
|
+
icu_date_of_birth: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
255
248
|
city: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
256
249
|
country: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
-
icu_ftp: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
258
|
-
icu_lthr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
259
250
|
icu_resting_hr: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
260
251
|
icu_weight: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
261
|
-
icu_vo2max: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
262
252
|
}, z.ZodTypeAny, "passthrough">>;
|
|
263
253
|
export type Athlete = z.infer<typeof AthleteSchema>;
|
|
264
254
|
export declare const SportSettingsSchema: z.ZodObject<{
|
|
@@ -304,19 +294,19 @@ export declare const WorkoutSchema: z.ZodObject<{
|
|
|
304
294
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
305
295
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
306
296
|
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
307
|
-
|
|
297
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
308
298
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
309
299
|
id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
310
300
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
311
301
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
312
302
|
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
313
|
-
|
|
303
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
314
304
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
315
305
|
id: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodNumber]>>;
|
|
316
306
|
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
317
307
|
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
318
308
|
type: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
319
|
-
|
|
309
|
+
updated: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
320
310
|
}, z.ZodTypeAny, "passthrough">>;
|
|
321
311
|
export type Workout = z.infer<typeof WorkoutSchema>;
|
|
322
312
|
export interface WorkoutInput {
|
package/dist/client.js
CHANGED
|
@@ -28,17 +28,17 @@ export const ActivitySchema = z.object({
|
|
|
28
28
|
id: z.string(),
|
|
29
29
|
name: z.string().nullable().optional(),
|
|
30
30
|
type: z.string().optional(),
|
|
31
|
-
|
|
31
|
+
start_date_local: z.string().optional(),
|
|
32
32
|
distance: z.number().nullable().optional(),
|
|
33
|
-
|
|
33
|
+
elapsed_time: z.number().nullable().optional(),
|
|
34
34
|
moving_time: z.number().nullable().optional(),
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
total_elevation_gain: z.number().nullable().optional(),
|
|
36
|
+
icu_average_watts: z.number().nullable().optional(),
|
|
37
37
|
icu_weighted_avg_watts: z.number().nullable().optional(),
|
|
38
|
-
|
|
38
|
+
icu_training_load: z.number().nullable().optional(),
|
|
39
39
|
icu_ftp: z.number().nullable().optional(),
|
|
40
40
|
icu_intensity: z.number().nullable().optional(),
|
|
41
|
-
|
|
41
|
+
average_heartrate: z.number().nullable().optional(),
|
|
42
42
|
max_heartrate: z.number().nullable().optional(),
|
|
43
43
|
average_cadence: z.number().nullable().optional(),
|
|
44
44
|
calories: z.number().nullable().optional(),
|
|
@@ -48,6 +48,8 @@ export const ActivitySchema = z.object({
|
|
|
48
48
|
trimp: z.number().nullable().optional(),
|
|
49
49
|
average_temp: z.number().nullable().optional(),
|
|
50
50
|
perceived_exertion: z.number().nullable().optional(),
|
|
51
|
+
icu_rpe: z.number().nullable().optional(),
|
|
52
|
+
session_rpe: z.number().nullable().optional(),
|
|
51
53
|
feel: z.number().nullable().optional(),
|
|
52
54
|
description: z.string().nullable().optional(),
|
|
53
55
|
trainer: z.boolean().nullable().optional(),
|
|
@@ -85,13 +87,11 @@ export const EventSchema = z.object({
|
|
|
85
87
|
show_as_note: z.boolean().nullable().optional(),
|
|
86
88
|
name: z.string().nullable().optional(),
|
|
87
89
|
description: z.string().nullable().optional(),
|
|
88
|
-
|
|
89
|
-
workout: z.unknown().nullable().optional(),
|
|
90
|
-
priority: z.string().nullable().optional(),
|
|
90
|
+
color: z.string().nullable().optional(),
|
|
91
91
|
}).passthrough();
|
|
92
92
|
export const IntervalSchema = z.object({
|
|
93
|
-
icu_intervals: z.array(z.record(z.unknown())).optional(),
|
|
94
|
-
icu_groups: z.array(z.record(z.unknown())).optional(),
|
|
93
|
+
icu_intervals: z.array(z.record(z.unknown())).nullable().optional(),
|
|
94
|
+
icu_groups: z.array(z.record(z.unknown())).nullable().optional(),
|
|
95
95
|
}).passthrough();
|
|
96
96
|
export const AthleteSchema = z.object({
|
|
97
97
|
id: z.string().optional(),
|
|
@@ -99,14 +99,11 @@ export const AthleteSchema = z.object({
|
|
|
99
99
|
email: z.string().nullable().optional(),
|
|
100
100
|
sex: z.string().nullable().optional(),
|
|
101
101
|
weight: z.number().nullable().optional(),
|
|
102
|
-
|
|
102
|
+
icu_date_of_birth: z.string().nullable().optional(),
|
|
103
103
|
city: z.string().nullable().optional(),
|
|
104
104
|
country: z.string().nullable().optional(),
|
|
105
|
-
icu_ftp: z.number().nullable().optional(),
|
|
106
|
-
icu_lthr: z.number().nullable().optional(),
|
|
107
105
|
icu_resting_hr: z.number().nullable().optional(),
|
|
108
106
|
icu_weight: z.number().nullable().optional(),
|
|
109
|
-
icu_vo2max: z.number().nullable().optional(),
|
|
110
107
|
}).passthrough();
|
|
111
108
|
export const SportSettingsSchema = z.object({
|
|
112
109
|
types: z.array(z.string()).nullable().optional(),
|
|
@@ -126,7 +123,7 @@ export const WorkoutSchema = z.object({
|
|
|
126
123
|
name: z.string().nullable().optional(),
|
|
127
124
|
description: z.string().nullable().optional(),
|
|
128
125
|
type: z.string().nullable().optional(),
|
|
129
|
-
|
|
126
|
+
updated: z.string().nullable().optional(),
|
|
130
127
|
}).passthrough();
|
|
131
128
|
// ---- API methods ---- //
|
|
132
129
|
export async function getActivities(config, params) {
|
|
@@ -165,10 +162,7 @@ export async function getEventById(config, eventId) {
|
|
|
165
162
|
export async function getNotesByDate(config, date) {
|
|
166
163
|
const data = await request(`/athlete/${config.athleteId}/events`, config, { oldest: date, newest: date });
|
|
167
164
|
const events = z.array(EventSchema).parse(data);
|
|
168
|
-
return events.filter((e) =>
|
|
169
|
-
const raw = e;
|
|
170
|
-
return raw["category"] === "NOTE" || (!e.race && !e.workout);
|
|
171
|
-
});
|
|
165
|
+
return events.filter((e) => e.category === "NOTE" || e.show_as_note === true);
|
|
172
166
|
}
|
|
173
167
|
async function mutate(method, path, config, body) {
|
|
174
168
|
const url = `${BASE_URL}${path}`;
|
|
@@ -228,7 +222,12 @@ export async function getActivityStreams(config, activityId, types) {
|
|
|
228
222
|
if (types?.length)
|
|
229
223
|
params["types"] = types.join(",");
|
|
230
224
|
const data = await request(`/activity/${activityId}/streams.json`, config, params);
|
|
231
|
-
|
|
225
|
+
const result = {};
|
|
226
|
+
for (const stream of data) {
|
|
227
|
+
if (stream.type)
|
|
228
|
+
result[stream.type] = stream.data ?? [];
|
|
229
|
+
}
|
|
230
|
+
return result;
|
|
232
231
|
}
|
|
233
232
|
export async function getActivityPowerCurves(config, activityId) {
|
|
234
233
|
return request(`/activity/${activityId}/power-curves`, config);
|
package/dist/format.js
CHANGED
|
@@ -4,26 +4,26 @@ function n(v, unit = "") {
|
|
|
4
4
|
return `${v}${unit}`;
|
|
5
5
|
}
|
|
6
6
|
export function formatActivity(a) {
|
|
7
|
-
const startTime = a.
|
|
8
|
-
? new Date(a.
|
|
7
|
+
const startTime = a.start_date_local
|
|
8
|
+
? new Date(a.start_date_local).toLocaleString()
|
|
9
9
|
: "Unknown";
|
|
10
10
|
const lines = [
|
|
11
11
|
`**${a.name ?? "Unnamed"}** (${a.id})`,
|
|
12
12
|
`Type: ${n(a.type)} | Date: ${startTime}`,
|
|
13
|
-
`Distance: ${n(a.distance, " m")} | Duration: ${n(a.
|
|
14
|
-
`Elevation: ${n(a.
|
|
13
|
+
`Distance: ${n(a.distance, " m")} | Duration: ${n(a.elapsed_time, " s")} | Moving: ${n(a.moving_time, " s")}`,
|
|
14
|
+
`Elevation: ${n(a.total_elevation_gain, " m")}`,
|
|
15
15
|
"",
|
|
16
16
|
"Power:",
|
|
17
|
-
` Avg: ${n(a.
|
|
18
|
-
` Training Load: ${n(a.
|
|
17
|
+
` Avg: ${n(a.icu_average_watts, " W")} | Weighted Avg: ${n(a.icu_weighted_avg_watts, " W")} | FTP: ${n(a.icu_ftp, " W")}`,
|
|
18
|
+
` Training Load: ${n(a.icu_training_load)} | Intensity: ${n(a.icu_intensity)}`,
|
|
19
19
|
"",
|
|
20
20
|
"Heart Rate:",
|
|
21
|
-
` Avg: ${n(a.
|
|
21
|
+
` Avg: ${n(a.average_heartrate, " bpm")} | Max: ${n(a.max_heartrate, " bpm")}`,
|
|
22
22
|
"",
|
|
23
23
|
"Other:",
|
|
24
24
|
` Cadence: ${n(a.average_cadence, " rpm")} | Calories: ${n(a.calories)} | Speed: ${n(a.average_speed, " m/s")}`,
|
|
25
25
|
` Temp: ${n(a.average_temp, "°C")} | Trainer: ${a.trainer ? "Yes" : "No"}`,
|
|
26
|
-
` RPE: ${n(a.perceived_exertion)}/10 | Feel: ${n(a.feel)}/10`,
|
|
26
|
+
` RPE: ${n(a.icu_rpe ?? a.perceived_exertion)}/10 | Feel: ${n(a.feel)}/10`,
|
|
27
27
|
"",
|
|
28
28
|
"Fitness:",
|
|
29
29
|
` CTL: ${n(a.icu_ctl)} | ATL: ${n(a.icu_atl)} | TRIMP: ${n(a.trimp)}`,
|
|
@@ -62,7 +62,14 @@ export function formatWellness(date, w) {
|
|
|
62
62
|
.trimEnd();
|
|
63
63
|
}
|
|
64
64
|
export function formatEvent(e) {
|
|
65
|
-
const
|
|
65
|
+
const category = e.category ?? "";
|
|
66
|
+
const type = category.startsWith("RACE")
|
|
67
|
+
? "Race"
|
|
68
|
+
: category === "WORKOUT"
|
|
69
|
+
? "Workout"
|
|
70
|
+
: category === "NOTE" || e.show_as_note
|
|
71
|
+
? "Note"
|
|
72
|
+
: "Event";
|
|
66
73
|
const start = e.start_date_local ?? e.date ?? "Unknown";
|
|
67
74
|
const dateLabel = e.end_date_local && e.end_date_local !== e.start_date_local
|
|
68
75
|
? `${start} to ${e.end_date_local}`
|
|
@@ -72,7 +79,6 @@ export function formatEvent(e) {
|
|
|
72
79
|
`Type: ${type} | Date: ${dateLabel}`,
|
|
73
80
|
e.category ? `Category: ${e.category}` : "",
|
|
74
81
|
e.description ? `Description: ${e.description}` : "",
|
|
75
|
-
e.priority ? `Priority: ${e.priority}` : "",
|
|
76
82
|
]
|
|
77
83
|
.filter(Boolean)
|
|
78
84
|
.join("\n");
|
package/dist/index.js
CHANGED
|
@@ -122,9 +122,8 @@ const TOOLS = [
|
|
|
122
122
|
end_date_local: { type: "string", description: "End date in ISO 8601 format for a multi-day event (e.g. a NOTE, HOLIDAY, SICK, or INJURED entry spanning several days), e.g. 2024-06-05" },
|
|
123
123
|
name: { type: "string", description: "Event name" },
|
|
124
124
|
description: { type: "string", description: "Event description. To create a structured workout, write it in Intervals.icu's Workout Builder plain-text syntax — Intervals.icu parses this into the workout structure (steps, duration, zones) automatically. Syntax: each step is a line starting with '-', e.g. '-10m 50-60%' (duration as h/m/s combos like '1h20m', '3m30s', '20s'; intensity as a %FTP value/range, or a zone like 'z1'/'z4'). Append 'power=Ns' to set the power-smoothing window (power=10s for steady efforts, power=3s or power=1s for short hard efforts/sprints/kicks). HR-based targets: 'z4 90% hr'. Optional cadence suffix: '85-95rpm'. Repeats: put 'Nx' on its own line, then the repeated step lines, then a blank line before the next block. Example: \"- Warmup 10m 50%\\n\\n4x\\n- Hard 4m 105% power=10s\\n- Easy 2m 50%\\n\\n- Cooldown 5m 50%\\n\"" },
|
|
125
|
-
category: { type: "string", description: "Event category: WORKOUT, NOTE, RACE_A, RACE_B, RACE_C (race priority A/B/C), PLAN, HOLIDAY, SICK, INJURED, TARGET, and others" },
|
|
125
|
+
category: { type: "string", description: "Event category: WORKOUT, NOTE, RACE_A, RACE_B, RACE_C (race priority A/B/C — this is what makes it a race, there is no separate race flag), PLAN, HOLIDAY, SICK, INJURED, TARGET, and others" },
|
|
126
126
|
type: { type: "string", description: "Activity type: Ride, Run, Swim, WeightTraining, etc." },
|
|
127
|
-
race: { type: "boolean", description: "Mark as a race event (default: false)" },
|
|
128
127
|
distance: { type: "number", description: "Distance in meters (e.g. 100000 for 100km)" },
|
|
129
128
|
sub_type: { type: "string", description: "Race category/sub-type (e.g. A, B, C)" },
|
|
130
129
|
workout_doc: { type: "object", description: "Pre-computed Intervals.icu workout_doc (as returned by get_event_by_id/list_workouts on an existing structured workout) to copy verbatim onto this event. Hand-written partial docs won't render correctly — prefer setting `description` with the Workout Builder syntax and omitting this field so Intervals.icu computes it." },
|
|
@@ -147,7 +146,6 @@ const TOOLS = [
|
|
|
147
146
|
description: { type: "string", description: "New description. Use Intervals.icu's Workout Builder plain-text syntax to have Intervals.icu recompute the workout structure — steps as '-<duration> <intensity>' lines (duration as h/m/s combos, intensity as %FTP or a zone like 'z1'), optional 'power=Ns' smoothing suffix, 'Nx' repeat blocks, HR targets ('z4 90% hr'), cadence suffix ('85-95rpm'). Example: \"- Warmup 10m 50%\\n\\n4x\\n- Hard 4m 105% power=10s\\n- Easy 2m 50%\\n\\n- Cooldown 5m 50%\\n\"" },
|
|
148
147
|
category: { type: "string", description: "New category" },
|
|
149
148
|
type: { type: "string", description: "New activity type" },
|
|
150
|
-
race: { type: "boolean", description: "Toggle race flag" },
|
|
151
149
|
distance: { type: "number", description: "Distance in meters (e.g. 100000 for 100km)" },
|
|
152
150
|
sub_type: { type: "string", description: "Race category/sub-type (e.g. A, B, C)" },
|
|
153
151
|
workout_doc: { type: "object", description: "Pre-computed Intervals.icu workout_doc to copy verbatim. Hand-written partial docs won't render correctly — prefer updating `description` with Workout Builder syntax instead." },
|
|
@@ -171,7 +169,7 @@ const TOOLS = [
|
|
|
171
169
|
},
|
|
172
170
|
{
|
|
173
171
|
name: "get_athlete_profile",
|
|
174
|
-
description: "Get athlete profile
|
|
172
|
+
description: "Get athlete profile: name, sex, DOB, weight, resting HR, city/country. For FTP/LTHR/zones use get_athlete_zones.",
|
|
175
173
|
inputSchema: {
|
|
176
174
|
type: "object",
|
|
177
175
|
properties: {
|
|
@@ -347,7 +345,6 @@ const TOOLS = [
|
|
|
347
345
|
description: { type: "string", description: "Use Workout Builder plain-text syntax for a structured workout — '-<duration> <intensity>' step lines, 'Nx' repeat blocks, optional 'power=Ns' smoothing suffix, HR targets ('z4 90% hr'), cadence suffix ('85-95rpm'). Example: \"- Warmup 10m 50%\\n\\n4x\\n- Hard 4m 105% power=10s\\n- Easy 2m 50%\\n\\n- Cooldown 5m 50%\\n\"" },
|
|
348
346
|
category: { type: "string" },
|
|
349
347
|
type: { type: "string" },
|
|
350
|
-
race: { type: "boolean" },
|
|
351
348
|
workout_doc: { type: "object", description: "Pre-computed workout_doc to copy verbatim; prefer `description` with Workout Builder syntax instead" },
|
|
352
349
|
},
|
|
353
350
|
},
|
|
@@ -516,7 +513,6 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
516
513
|
end_date_local: args["end_date_local"],
|
|
517
514
|
category: args["category"],
|
|
518
515
|
type: args["type"],
|
|
519
|
-
race: args["race"],
|
|
520
516
|
distance: args["distance"],
|
|
521
517
|
sub_type: args["sub_type"],
|
|
522
518
|
workout_doc: args["workout_doc"],
|
|
@@ -527,7 +523,7 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
527
523
|
const eventId = z.string().parse(args["event_id"]);
|
|
528
524
|
const config = getConfig(args);
|
|
529
525
|
const input = {};
|
|
530
|
-
for (const key of ["name", "description", "start_date_local", "end_date_local", "category", "type", "
|
|
526
|
+
for (const key of ["name", "description", "start_date_local", "end_date_local", "category", "type", "distance", "sub_type", "workout_doc"]) {
|
|
531
527
|
if (args[key] !== undefined)
|
|
532
528
|
input[key] = args[key];
|
|
533
529
|
}
|
|
@@ -546,12 +542,10 @@ server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
|
546
542
|
const lines = [
|
|
547
543
|
`**${athlete.name ?? "Athlete"}** (${athlete.id ?? config.athleteId})`,
|
|
548
544
|
athlete.email ? `Email: ${athlete.email}` : "",
|
|
549
|
-
`Sex: ${athlete.sex ?? "N/A"} | DOB: ${athlete.
|
|
545
|
+
`Sex: ${athlete.sex ?? "N/A"} | DOB: ${athlete.icu_date_of_birth ?? "N/A"} | City: ${athlete.city ?? "N/A"}, ${athlete.country ?? "N/A"}`,
|
|
550
546
|
"",
|
|
551
|
-
"
|
|
552
|
-
|
|
553
|
-
` Weight: ${athlete.icu_weight ?? athlete.weight ?? "N/A"} kg | VO2max: ${athlete.icu_vo2max ?? "N/A"}`,
|
|
554
|
-
` Resting HR: ${athlete.icu_resting_hr ?? "N/A"} bpm`,
|
|
547
|
+
`Weight: ${athlete.icu_weight ?? athlete.weight ?? "N/A"} kg | Resting HR: ${athlete.icu_resting_hr ?? "N/A"} bpm`,
|
|
548
|
+
"(FTP/LTHR/zones are per-sport — use get_athlete_zones for those)",
|
|
555
549
|
].filter(Boolean).join("\n");
|
|
556
550
|
return { content: [{ type: "text", text: lines }] };
|
|
557
551
|
}
|