@demind-inc/core 1.10.25 → 1.10.26
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/models/RichContext.d.ts +23 -17
- package/lib/models/RichContext.ts +58 -53
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type { MealType, MealFoodAmount, MetricMealDetailMacros, MetricMealDetailMicros } from
|
|
2
|
-
export type SignalSource =
|
|
1
|
+
import type { MealType, MealFoodAmount, MetricMealDetailMacros, MetricMealDetailMicros } from './Metrics';
|
|
2
|
+
export type SignalSource = 'location' | 'meal' | 'weather' | 'energy' | 'sleep' | 'screen_time' | 'commute' | 'menstrual_cycle' | 'steps' | 'medication' | (string & {});
|
|
3
3
|
export interface Location {
|
|
4
4
|
name: string;
|
|
5
5
|
lat: number;
|
|
@@ -15,7 +15,7 @@ export interface Location {
|
|
|
15
15
|
}
|
|
16
16
|
export interface Signal {
|
|
17
17
|
signal_source: SignalSource;
|
|
18
|
-
urgency:
|
|
18
|
+
urgency: 'now' | 'today' | 'info';
|
|
19
19
|
body: string;
|
|
20
20
|
expires_at: string | null;
|
|
21
21
|
data: SignalData | null;
|
|
@@ -58,7 +58,7 @@ export interface RichContextEnergyZone {
|
|
|
58
58
|
label: string;
|
|
59
59
|
start: string;
|
|
60
60
|
end: string;
|
|
61
|
-
level:
|
|
61
|
+
level: 'peak' | 'calm' | 'low' | 'recovering' | (string & {});
|
|
62
62
|
}
|
|
63
63
|
export type MealSignalData = MealSuggestionPayload;
|
|
64
64
|
export interface EnergySignalData {
|
|
@@ -106,7 +106,7 @@ export interface MedicationSignalData {
|
|
|
106
106
|
next_due_at?: string | null;
|
|
107
107
|
}
|
|
108
108
|
export type SignalData = MealSignalData | EnergySignalData | SleepSignalData | WeatherSignalData | ScreenTimeSignalData | CommuteSignalData | StepsSignalData | MenstrualCycleSignalData | MedicationSignalData;
|
|
109
|
-
export type ActionType =
|
|
109
|
+
export type ActionType = 'start_timer' | 'open_map' | 'open_url' | 'log_metric' | 'dismiss' | (string & {});
|
|
110
110
|
export type ActionPayload = {
|
|
111
111
|
duration_min: number;
|
|
112
112
|
session_title: string | null;
|
|
@@ -116,7 +116,7 @@ export type ActionPayload = {
|
|
|
116
116
|
lng: number;
|
|
117
117
|
} | {
|
|
118
118
|
url: string | null;
|
|
119
|
-
open_in:
|
|
119
|
+
open_in: 'webview' | 'browser';
|
|
120
120
|
} | {
|
|
121
121
|
metric_type: string;
|
|
122
122
|
value: number | null;
|
|
@@ -137,9 +137,9 @@ export interface MealSuggestionPayload {
|
|
|
137
137
|
start_time?: string;
|
|
138
138
|
end_time?: string;
|
|
139
139
|
}
|
|
140
|
-
export type ContentType =
|
|
141
|
-
export type WorkoutType =
|
|
142
|
-
export type DifficultyLevel =
|
|
140
|
+
export type ContentType = 'workout_plan' | 'checklist' | 'find_location' | 'meal_suggestion' | 'transit_route' | 'journal_prompts' | 'audio_player' | 'energy_summary' | 'sleep_summary' | 'metric_bar' | 'meal_plan_week' | 'workout_summary' | (string & {});
|
|
141
|
+
export type WorkoutType = 'gym' | 'running' | 'walking' | 'cycling' | 'swimming' | 'rowing' | 'hiking' | 'yoga' | 'other';
|
|
142
|
+
export type DifficultyLevel = 'beginner' | 'intermediate' | 'advanced';
|
|
143
143
|
export interface GymExercise {
|
|
144
144
|
name?: string;
|
|
145
145
|
sets?: number;
|
|
@@ -148,11 +148,11 @@ export interface GymExercise {
|
|
|
148
148
|
rest_sec?: number;
|
|
149
149
|
}
|
|
150
150
|
export interface NoteExerciseItem {
|
|
151
|
-
type:
|
|
151
|
+
type: 'note';
|
|
152
152
|
text: string;
|
|
153
153
|
}
|
|
154
154
|
export interface MetaExerciseItem {
|
|
155
|
-
type:
|
|
155
|
+
type: 'meta';
|
|
156
156
|
estimated_calories: number;
|
|
157
157
|
}
|
|
158
158
|
export interface CardioSegment {
|
|
@@ -163,7 +163,7 @@ export interface CardioSegment {
|
|
|
163
163
|
pace?: string;
|
|
164
164
|
}
|
|
165
165
|
export interface CardioPlanItem {
|
|
166
|
-
type:
|
|
166
|
+
type: 'cardio_plan';
|
|
167
167
|
description?: string;
|
|
168
168
|
segments?: CardioSegment[];
|
|
169
169
|
rounds?: number;
|
|
@@ -179,7 +179,7 @@ export interface WorkoutPlanPayload {
|
|
|
179
179
|
duration_min?: number;
|
|
180
180
|
exercises?: ExerciseItem[];
|
|
181
181
|
}
|
|
182
|
-
export type ContentPayload = WorkoutPlanPayload | {
|
|
182
|
+
export type ContentPayload = WorkoutPlanPayload | WorkoutSummary | {
|
|
183
183
|
label: string | null;
|
|
184
184
|
items: {
|
|
185
185
|
text: string;
|
|
@@ -194,11 +194,11 @@ export type ContentPayload = WorkoutPlanPayload | {
|
|
|
194
194
|
prompts: string[];
|
|
195
195
|
} | {
|
|
196
196
|
track_name: string;
|
|
197
|
-
category:
|
|
197
|
+
category: 'sleep' | 'focus' | 'meditation' | 'wind_down';
|
|
198
198
|
duration_min: number | null;
|
|
199
199
|
stream_url: string | null;
|
|
200
200
|
} | {
|
|
201
|
-
current_zone:
|
|
201
|
+
current_zone: 'peak' | 'calm' | 'low' | 'recovering';
|
|
202
202
|
zones: RichContextEnergyZone[];
|
|
203
203
|
} | SleepSummaryPayload | Location | {
|
|
204
204
|
label: string;
|
|
@@ -207,12 +207,12 @@ export type ContentPayload = WorkoutPlanPayload | {
|
|
|
207
207
|
min: number;
|
|
208
208
|
max: number;
|
|
209
209
|
baseline: number | null;
|
|
210
|
-
color_ramp:
|
|
210
|
+
color_ramp: 'red_to_green' | 'green_to_red' | 'neutral';
|
|
211
211
|
} | {
|
|
212
212
|
days: {
|
|
213
213
|
date: string;
|
|
214
214
|
meals: {
|
|
215
|
-
slot:
|
|
215
|
+
slot: 'breakfast' | 'lunch' | 'dinner' | 'snack';
|
|
216
216
|
dish: string;
|
|
217
217
|
kcal: number | null;
|
|
218
218
|
time: string | null;
|
|
@@ -223,6 +223,12 @@ export interface Content {
|
|
|
223
223
|
type: ContentType;
|
|
224
224
|
payload: ContentPayload;
|
|
225
225
|
}
|
|
226
|
+
export interface WorkoutSummary {
|
|
227
|
+
name?: string | null;
|
|
228
|
+
steps?: number | null;
|
|
229
|
+
calories?: number | null;
|
|
230
|
+
distanceMeters?: number | null;
|
|
231
|
+
}
|
|
226
232
|
export interface RichContext {
|
|
227
233
|
signals: Signal[];
|
|
228
234
|
location: Location | null;
|
|
@@ -3,19 +3,19 @@ import type {
|
|
|
3
3
|
MealFoodAmount,
|
|
4
4
|
MetricMealDetailMacros,
|
|
5
5
|
MetricMealDetailMicros,
|
|
6
|
-
} from
|
|
6
|
+
} from './Metrics';
|
|
7
7
|
|
|
8
8
|
export type SignalSource =
|
|
9
|
-
|
|
|
10
|
-
|
|
|
11
|
-
|
|
|
12
|
-
|
|
|
13
|
-
|
|
|
14
|
-
|
|
|
15
|
-
|
|
|
16
|
-
|
|
|
17
|
-
|
|
|
18
|
-
|
|
|
9
|
+
| 'location'
|
|
10
|
+
| 'meal'
|
|
11
|
+
| 'weather'
|
|
12
|
+
| 'energy'
|
|
13
|
+
| 'sleep'
|
|
14
|
+
| 'screen_time'
|
|
15
|
+
| 'commute'
|
|
16
|
+
| 'menstrual_cycle'
|
|
17
|
+
| 'steps'
|
|
18
|
+
| 'medication'
|
|
19
19
|
| (string & {});
|
|
20
20
|
|
|
21
21
|
export interface Location {
|
|
@@ -34,7 +34,7 @@ export interface Location {
|
|
|
34
34
|
|
|
35
35
|
export interface Signal {
|
|
36
36
|
signal_source: SignalSource;
|
|
37
|
-
urgency:
|
|
37
|
+
urgency: 'now' | 'today' | 'info';
|
|
38
38
|
// Must describe a concrete value (ex: "HRV 64"), not an opinion (ex: "energy is good").
|
|
39
39
|
body: string;
|
|
40
40
|
// ISO 8601
|
|
@@ -85,7 +85,7 @@ export interface RichContextEnergyZone {
|
|
|
85
85
|
label: string;
|
|
86
86
|
start: string;
|
|
87
87
|
end: string;
|
|
88
|
-
level:
|
|
88
|
+
level: 'peak' | 'calm' | 'low' | 'recovering' | (string & {});
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
export type MealSignalData = MealSuggestionPayload;
|
|
@@ -153,11 +153,11 @@ export type SignalData =
|
|
|
153
153
|
| MedicationSignalData;
|
|
154
154
|
|
|
155
155
|
export type ActionType =
|
|
156
|
-
|
|
|
157
|
-
|
|
|
158
|
-
|
|
|
159
|
-
|
|
|
160
|
-
|
|
|
156
|
+
| 'start_timer'
|
|
157
|
+
| 'open_map'
|
|
158
|
+
| 'open_url'
|
|
159
|
+
| 'log_metric'
|
|
160
|
+
| 'dismiss'
|
|
161
161
|
| (string & {});
|
|
162
162
|
|
|
163
163
|
export type ActionPayload =
|
|
@@ -175,7 +175,7 @@ export type ActionPayload =
|
|
|
175
175
|
| {
|
|
176
176
|
// open_url
|
|
177
177
|
url: string | null;
|
|
178
|
-
open_in:
|
|
178
|
+
open_in: 'webview' | 'browser';
|
|
179
179
|
}
|
|
180
180
|
| {
|
|
181
181
|
// log_metric
|
|
@@ -203,31 +203,32 @@ export interface MealSuggestionPayload {
|
|
|
203
203
|
}
|
|
204
204
|
|
|
205
205
|
export type ContentType =
|
|
206
|
-
|
|
|
207
|
-
|
|
|
208
|
-
|
|
|
209
|
-
|
|
|
210
|
-
|
|
|
211
|
-
|
|
|
212
|
-
|
|
|
213
|
-
|
|
|
214
|
-
|
|
|
215
|
-
|
|
|
216
|
-
|
|
|
206
|
+
| 'workout_plan'
|
|
207
|
+
| 'checklist'
|
|
208
|
+
| 'find_location'
|
|
209
|
+
| 'meal_suggestion'
|
|
210
|
+
| 'transit_route'
|
|
211
|
+
| 'journal_prompts'
|
|
212
|
+
| 'audio_player'
|
|
213
|
+
| 'energy_summary'
|
|
214
|
+
| 'sleep_summary'
|
|
215
|
+
| 'metric_bar'
|
|
216
|
+
| 'meal_plan_week'
|
|
217
|
+
| 'workout_summary'
|
|
217
218
|
| (string & {});
|
|
218
219
|
|
|
219
220
|
export type WorkoutType =
|
|
220
|
-
|
|
|
221
|
-
|
|
|
222
|
-
|
|
|
223
|
-
|
|
|
224
|
-
|
|
|
225
|
-
|
|
|
226
|
-
|
|
|
227
|
-
|
|
|
228
|
-
|
|
|
229
|
-
|
|
230
|
-
export type DifficultyLevel =
|
|
221
|
+
| 'gym'
|
|
222
|
+
| 'running'
|
|
223
|
+
| 'walking'
|
|
224
|
+
| 'cycling'
|
|
225
|
+
| 'swimming'
|
|
226
|
+
| 'rowing'
|
|
227
|
+
| 'hiking'
|
|
228
|
+
| 'yoga'
|
|
229
|
+
| 'other';
|
|
230
|
+
|
|
231
|
+
export type DifficultyLevel = 'beginner' | 'intermediate' | 'advanced';
|
|
231
232
|
|
|
232
233
|
// ── Workout plan (SSE payload types) ─────────────────────────────────────────
|
|
233
234
|
|
|
@@ -240,12 +241,12 @@ export interface GymExercise {
|
|
|
240
241
|
}
|
|
241
242
|
|
|
242
243
|
export interface NoteExerciseItem {
|
|
243
|
-
type:
|
|
244
|
+
type: 'note';
|
|
244
245
|
text: string;
|
|
245
246
|
}
|
|
246
247
|
|
|
247
248
|
export interface MetaExerciseItem {
|
|
248
|
-
type:
|
|
249
|
+
type: 'meta';
|
|
249
250
|
estimated_calories: number;
|
|
250
251
|
}
|
|
251
252
|
|
|
@@ -258,7 +259,7 @@ export interface CardioSegment {
|
|
|
258
259
|
}
|
|
259
260
|
|
|
260
261
|
export interface CardioPlanItem {
|
|
261
|
-
type:
|
|
262
|
+
type: 'cardio_plan';
|
|
262
263
|
description?: string;
|
|
263
264
|
segments?: CardioSegment[];
|
|
264
265
|
rounds?: number;
|
|
@@ -267,11 +268,7 @@ export interface CardioPlanItem {
|
|
|
267
268
|
notes?: string;
|
|
268
269
|
}
|
|
269
270
|
|
|
270
|
-
export type ExerciseItem =
|
|
271
|
-
| GymExercise
|
|
272
|
-
| NoteExerciseItem
|
|
273
|
-
| MetaExerciseItem
|
|
274
|
-
| CardioPlanItem;
|
|
271
|
+
export type ExerciseItem = GymExercise | NoteExerciseItem | MetaExerciseItem | CardioPlanItem;
|
|
275
272
|
|
|
276
273
|
export interface WorkoutPlanPayload {
|
|
277
274
|
plan_title?: string;
|
|
@@ -283,6 +280,7 @@ export interface WorkoutPlanPayload {
|
|
|
283
280
|
|
|
284
281
|
export type ContentPayload =
|
|
285
282
|
| WorkoutPlanPayload
|
|
283
|
+
| WorkoutSummary
|
|
286
284
|
| {
|
|
287
285
|
// checklist
|
|
288
286
|
label: string | null;
|
|
@@ -303,13 +301,13 @@ export type ContentPayload =
|
|
|
303
301
|
| {
|
|
304
302
|
// audio_player
|
|
305
303
|
track_name: string;
|
|
306
|
-
category:
|
|
304
|
+
category: 'sleep' | 'focus' | 'meditation' | 'wind_down';
|
|
307
305
|
duration_min: number | null;
|
|
308
306
|
stream_url: string | null;
|
|
309
307
|
}
|
|
310
308
|
| {
|
|
311
309
|
// energy_summary
|
|
312
|
-
current_zone:
|
|
310
|
+
current_zone: 'peak' | 'calm' | 'low' | 'recovering';
|
|
313
311
|
zones: RichContextEnergyZone[];
|
|
314
312
|
}
|
|
315
313
|
| SleepSummaryPayload
|
|
@@ -322,14 +320,14 @@ export type ContentPayload =
|
|
|
322
320
|
min: number;
|
|
323
321
|
max: number;
|
|
324
322
|
baseline: number | null;
|
|
325
|
-
color_ramp:
|
|
323
|
+
color_ramp: 'red_to_green' | 'green_to_red' | 'neutral';
|
|
326
324
|
}
|
|
327
325
|
| {
|
|
328
326
|
// meal_plan_week
|
|
329
327
|
days: {
|
|
330
328
|
date: string;
|
|
331
329
|
meals: {
|
|
332
|
-
slot:
|
|
330
|
+
slot: 'breakfast' | 'lunch' | 'dinner' | 'snack';
|
|
333
331
|
dish: string;
|
|
334
332
|
kcal: number | null;
|
|
335
333
|
time: string | null;
|
|
@@ -343,6 +341,13 @@ export interface Content {
|
|
|
343
341
|
payload: ContentPayload;
|
|
344
342
|
}
|
|
345
343
|
|
|
344
|
+
export interface WorkoutSummary {
|
|
345
|
+
name?: string | null;
|
|
346
|
+
steps?: number | null;
|
|
347
|
+
calories?: number | null;
|
|
348
|
+
distanceMeters?: number | null;
|
|
349
|
+
}
|
|
350
|
+
|
|
346
351
|
export interface RichContext {
|
|
347
352
|
signals: Signal[];
|
|
348
353
|
location: Location | null;
|