@demind-inc/core 1.8.0 → 1.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/models/RichContext.d.ts +54 -49
- package/lib/models/RichContext.ts +72 -65
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { MealType, MealFoodAmount, MetricMealDetailMacros, MetricMealDetailMicros } from "./Metrics";
|
|
2
|
-
export type SignalSource = "location" | "weather" | "energy" | "sleep" | "screen_time" | "commute" | "menstrual_cycle" | "steps" | "medication" | (string & {});
|
|
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;
|
|
@@ -55,46 +55,58 @@ export interface SleepSummaryPayload {
|
|
|
55
55
|
ideal_sleep_time_tonight?: string;
|
|
56
56
|
heart_rate_summary?: HeartRateSummary;
|
|
57
57
|
}
|
|
58
|
-
export
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
}
|
|
58
|
+
export interface RichContextEnergyZone {
|
|
59
|
+
label: string;
|
|
60
|
+
start: string;
|
|
61
|
+
end: string;
|
|
62
|
+
level: "peak" | "calm" | "low" | "recovering" | (string & {});
|
|
63
|
+
}
|
|
64
|
+
export type MealSignalData = MealSuggestionPayload;
|
|
65
|
+
export interface EnergySignalData {
|
|
66
|
+
zone?: string | null;
|
|
67
|
+
zones?: RichContextEnergyZone[];
|
|
68
|
+
hrv?: number | null;
|
|
69
|
+
sleep_score?: number | null;
|
|
70
|
+
readiness_score?: number | null;
|
|
71
|
+
}
|
|
72
|
+
export interface SleepSignalData extends SleepSummaryPayload {
|
|
73
|
+
}
|
|
74
|
+
export interface WeatherSignalData {
|
|
75
|
+
condition?: string | null;
|
|
76
|
+
temp_c?: number | null;
|
|
77
|
+
feels_like_c?: number | null;
|
|
78
|
+
uv_index?: number | null;
|
|
79
|
+
rain_probability?: number | null;
|
|
80
|
+
timeline?: Array<Record<string, unknown>>;
|
|
81
|
+
}
|
|
82
|
+
export interface ScreenTimeSignalData {
|
|
83
|
+
total_min?: number | null;
|
|
84
|
+
last_2h_min?: number | null;
|
|
85
|
+
top_app?: string | null;
|
|
86
|
+
}
|
|
87
|
+
export interface CommuteSignalData {
|
|
88
|
+
duration_min?: number | null;
|
|
89
|
+
mode?: string | null;
|
|
90
|
+
origin?: string | null;
|
|
91
|
+
destination?: string | null;
|
|
92
|
+
}
|
|
93
|
+
export interface StepsSignalData {
|
|
94
|
+
today?: number | null;
|
|
95
|
+
goal?: number | null;
|
|
96
|
+
percent_complete?: number | null;
|
|
97
|
+
}
|
|
98
|
+
export interface MenstrualCycleSignalData {
|
|
99
|
+
phase?: string | null;
|
|
100
|
+
day_in_cycle?: number | null;
|
|
101
|
+
energy_modifier?: number | null;
|
|
102
|
+
}
|
|
103
|
+
export interface MedicationSignalData {
|
|
104
|
+
name?: string | null;
|
|
105
|
+
dose?: string | null;
|
|
106
|
+
taken_today?: boolean | null;
|
|
107
|
+
next_due_at?: string | null;
|
|
108
|
+
}
|
|
109
|
+
export type SignalData = MealSignalData | EnergySignalData | SleepSignalData | WeatherSignalData | ScreenTimeSignalData | CommuteSignalData | StepsSignalData | MenstrualCycleSignalData | MedicationSignalData;
|
|
98
110
|
export type ActionType = "start_timer" | "open_map" | "open_url" | "log_metric" | "dismiss" | (string & {});
|
|
99
111
|
export type ActionPayload = {
|
|
100
112
|
duration_min: number;
|
|
@@ -156,12 +168,7 @@ export type ContentPayload = {
|
|
|
156
168
|
stream_url: string | null;
|
|
157
169
|
} | {
|
|
158
170
|
current_zone: "peak" | "calm" | "low" | "recovering";
|
|
159
|
-
zones:
|
|
160
|
-
label: string;
|
|
161
|
-
start: string;
|
|
162
|
-
end: string;
|
|
163
|
-
level: "peak" | "calm" | "low";
|
|
164
|
-
}[];
|
|
171
|
+
zones: RichContextEnergyZone[];
|
|
165
172
|
} | SleepSummaryPayload | Location | {
|
|
166
173
|
label: string;
|
|
167
174
|
value: number;
|
|
@@ -188,8 +195,6 @@ export interface Content {
|
|
|
188
195
|
export interface RichContext {
|
|
189
196
|
signals: Signal[];
|
|
190
197
|
location: Location | null;
|
|
191
|
-
reminder_min: number | null;
|
|
192
198
|
action: Action | null;
|
|
193
199
|
content: Content | Content[] | null;
|
|
194
|
-
mealContent?: MealSuggestionPayload;
|
|
195
200
|
}
|
|
@@ -7,6 +7,7 @@ import type {
|
|
|
7
7
|
|
|
8
8
|
export type SignalSource =
|
|
9
9
|
| "location"
|
|
10
|
+
| "meal"
|
|
10
11
|
| "weather"
|
|
11
12
|
| "energy"
|
|
12
13
|
| "sleep"
|
|
@@ -81,63 +82,76 @@ export interface SleepSummaryPayload {
|
|
|
81
82
|
heart_rate_summary?: HeartRateSummary;
|
|
82
83
|
}
|
|
83
84
|
|
|
85
|
+
export interface RichContextEnergyZone {
|
|
86
|
+
label: string;
|
|
87
|
+
start: string;
|
|
88
|
+
end: string;
|
|
89
|
+
level: "peak" | "calm" | "low" | "recovering" | (string & {});
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export type MealSignalData = MealSuggestionPayload;
|
|
93
|
+
|
|
94
|
+
export interface EnergySignalData {
|
|
95
|
+
zone?: string | null;
|
|
96
|
+
zones?: RichContextEnergyZone[];
|
|
97
|
+
hrv?: number | null;
|
|
98
|
+
sleep_score?: number | null;
|
|
99
|
+
readiness_score?: number | null;
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
export interface SleepSignalData extends SleepSummaryPayload {}
|
|
103
|
+
|
|
104
|
+
export interface WeatherSignalData {
|
|
105
|
+
condition?: string | null;
|
|
106
|
+
temp_c?: number | null;
|
|
107
|
+
feels_like_c?: number | null;
|
|
108
|
+
uv_index?: number | null;
|
|
109
|
+
rain_probability?: number | null;
|
|
110
|
+
timeline?: Array<Record<string, unknown>>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface ScreenTimeSignalData {
|
|
114
|
+
total_min?: number | null;
|
|
115
|
+
last_2h_min?: number | null;
|
|
116
|
+
top_app?: string | null;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export interface CommuteSignalData {
|
|
120
|
+
duration_min?: number | null;
|
|
121
|
+
mode?: string | null;
|
|
122
|
+
origin?: string | null;
|
|
123
|
+
destination?: string | null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
export interface StepsSignalData {
|
|
127
|
+
today?: number | null;
|
|
128
|
+
goal?: number | null;
|
|
129
|
+
percent_complete?: number | null;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export interface MenstrualCycleSignalData {
|
|
133
|
+
phase?: string | null;
|
|
134
|
+
day_in_cycle?: number | null;
|
|
135
|
+
energy_modifier?: number | null;
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
export interface MedicationSignalData {
|
|
139
|
+
name?: string | null;
|
|
140
|
+
dose?: string | null;
|
|
141
|
+
taken_today?: boolean | null;
|
|
142
|
+
next_due_at?: string | null;
|
|
143
|
+
}
|
|
144
|
+
|
|
84
145
|
export type SignalData =
|
|
85
|
-
|
|
|
86
|
-
|
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
timestamp: string;
|
|
95
|
-
temperature_f?: number;
|
|
96
|
-
temperature_c?: number;
|
|
97
|
-
summary?: string;
|
|
98
|
-
}>;
|
|
99
|
-
}
|
|
100
|
-
| {
|
|
101
|
-
// energy
|
|
102
|
-
zone: "peak" | "calm" | "low" | "recovering";
|
|
103
|
-
hrv: number | null;
|
|
104
|
-
sleep_score: number | null;
|
|
105
|
-
readiness_score: number | null;
|
|
106
|
-
}
|
|
107
|
-
| SleepSummaryPayload
|
|
108
|
-
| {
|
|
109
|
-
// screen_time
|
|
110
|
-
total_min: number;
|
|
111
|
-
last_2h_min: number | null;
|
|
112
|
-
top_app: string | null;
|
|
113
|
-
}
|
|
114
|
-
| {
|
|
115
|
-
// commute
|
|
116
|
-
duration_min: number;
|
|
117
|
-
mode: "transit" | "driving" | "walking" | "cycling";
|
|
118
|
-
origin: string | null;
|
|
119
|
-
destination: string | null;
|
|
120
|
-
}
|
|
121
|
-
| {
|
|
122
|
-
// menstrual_cycle
|
|
123
|
-
phase: "menstrual" | "follicular" | "ovulatory" | "luteal";
|
|
124
|
-
day_in_cycle: number;
|
|
125
|
-
energy_modifier: number;
|
|
126
|
-
}
|
|
127
|
-
| {
|
|
128
|
-
// steps
|
|
129
|
-
today: number;
|
|
130
|
-
goal: number;
|
|
131
|
-
percent_complete: number;
|
|
132
|
-
}
|
|
133
|
-
| {
|
|
134
|
-
// medication
|
|
135
|
-
name: string;
|
|
136
|
-
dose: string | null;
|
|
137
|
-
taken_today: boolean;
|
|
138
|
-
next_due_at: string | null;
|
|
139
|
-
}
|
|
140
|
-
| Record<string, unknown>;
|
|
146
|
+
| MealSignalData
|
|
147
|
+
| EnergySignalData
|
|
148
|
+
| SleepSignalData
|
|
149
|
+
| WeatherSignalData
|
|
150
|
+
| ScreenTimeSignalData
|
|
151
|
+
| CommuteSignalData
|
|
152
|
+
| StepsSignalData
|
|
153
|
+
| MenstrualCycleSignalData
|
|
154
|
+
| MedicationSignalData;
|
|
141
155
|
|
|
142
156
|
export type ActionType =
|
|
143
157
|
| "start_timer"
|
|
@@ -242,12 +256,7 @@ export type ContentPayload =
|
|
|
242
256
|
| {
|
|
243
257
|
// energy_summary
|
|
244
258
|
current_zone: "peak" | "calm" | "low" | "recovering";
|
|
245
|
-
zones:
|
|
246
|
-
label: string;
|
|
247
|
-
start: string;
|
|
248
|
-
end: string;
|
|
249
|
-
level: "peak" | "calm" | "low";
|
|
250
|
-
}[];
|
|
259
|
+
zones: RichContextEnergyZone[];
|
|
251
260
|
}
|
|
252
261
|
| SleepSummaryPayload
|
|
253
262
|
| Location
|
|
@@ -281,10 +290,8 @@ export interface Content {
|
|
|
281
290
|
}
|
|
282
291
|
|
|
283
292
|
export interface RichContext {
|
|
284
|
-
signals: Signal[];
|
|
293
|
+
signals: Signal[];
|
|
285
294
|
location: Location | null;
|
|
286
|
-
reminder_min: number | null;
|
|
287
295
|
action: Action | null;
|
|
288
296
|
content: Content | Content[] | null;
|
|
289
|
-
mealContent?: MealSuggestionPayload;
|
|
290
297
|
}
|