@demind-inc/core 1.11.9 → 1.11.11
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/ScheduledPlan.d.ts +57 -0
- package/dist/models/ScheduledPlan.js +2 -0
- package/dist/models/User.d.ts +2 -0
- package/dist/models/index.d.ts +1 -0
- package/dist/models/index.js +1 -0
- package/lib/models/ScheduledPlan.ts +64 -0
- package/lib/models/User.ts +2 -0
- package/lib/models/index.ts +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
export interface TriggerCondition {
|
|
3
|
+
/** Natural-language condition forwarded to the AI as context.
|
|
4
|
+
* e.g. "if I slept poorly last night (sleep quality < 3)" */
|
|
5
|
+
description: string;
|
|
6
|
+
}
|
|
7
|
+
export interface TriggerContent {
|
|
8
|
+
/** Natural-language instruction for the AI describing what to produce or schedule.
|
|
9
|
+
* e.g. 'Schedule a 15-min "nap" event in the afternoon' */
|
|
10
|
+
instruction: string;
|
|
11
|
+
}
|
|
12
|
+
export interface TriggerSchedule {
|
|
13
|
+
userId: string;
|
|
14
|
+
scheduleId: string;
|
|
15
|
+
agentType: 'daily-plan';
|
|
16
|
+
timezone: string;
|
|
17
|
+
/** Wall-clock fire time in the user's timezone, e.g. "09:00" */
|
|
18
|
+
fireTimeLocal: string;
|
|
19
|
+
recurrenceRule: string;
|
|
20
|
+
status: 'active' | 'paused' | 'completed';
|
|
21
|
+
nextFireUtc: Timestamp;
|
|
22
|
+
lastRunAt: Timestamp | null;
|
|
23
|
+
lastError: string | null;
|
|
24
|
+
createdAt: Timestamp;
|
|
25
|
+
updatedAt: Timestamp;
|
|
26
|
+
/** Optional conditions forwarded to the AI to decide whether to act */
|
|
27
|
+
conditions?: TriggerCondition[];
|
|
28
|
+
/** What the AI should generate or schedule when this fires */
|
|
29
|
+
content?: TriggerContent;
|
|
30
|
+
/** Send a push notification when the job completes */
|
|
31
|
+
notifyOnComplete?: boolean;
|
|
32
|
+
/** Set to true by the backend when the job runs; cleared by the client after displaying */
|
|
33
|
+
hasUnviewedExecution?: boolean;
|
|
34
|
+
}
|
|
35
|
+
export interface DayPlanMeal {
|
|
36
|
+
time: string;
|
|
37
|
+
name: string;
|
|
38
|
+
notes: string;
|
|
39
|
+
}
|
|
40
|
+
export interface DayPlanSleep {
|
|
41
|
+
targetBedtime: string;
|
|
42
|
+
rationale: string;
|
|
43
|
+
}
|
|
44
|
+
export interface DayPlanContextSnapshot {
|
|
45
|
+
sleepQuality: number;
|
|
46
|
+
energyTrend: string;
|
|
47
|
+
calendarEventCount: number;
|
|
48
|
+
}
|
|
49
|
+
export interface DayPlan {
|
|
50
|
+
planId: string;
|
|
51
|
+
userId: string;
|
|
52
|
+
generatedAt: Timestamp;
|
|
53
|
+
triggeredBy: 'schedule' | 'webhook' | 'manual';
|
|
54
|
+
meals: DayPlanMeal[];
|
|
55
|
+
sleep: DayPlanSleep;
|
|
56
|
+
contextSnapshot: DayPlanContextSnapshot;
|
|
57
|
+
}
|
package/dist/models/User.d.ts
CHANGED
|
@@ -137,6 +137,8 @@ export interface Notifications {
|
|
|
137
137
|
calendar?: CalendarNotification;
|
|
138
138
|
satisfaction?: boolean;
|
|
139
139
|
peaksDipsDetails?: PeaksDipsDetails;
|
|
140
|
+
/** Notify the user when an auto-scheduled routine job completes */
|
|
141
|
+
scheduledPlanComplete?: boolean;
|
|
140
142
|
}
|
|
141
143
|
export interface CalendarNotification {
|
|
142
144
|
enabled: boolean;
|
package/dist/models/index.d.ts
CHANGED
package/dist/models/index.js
CHANGED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { Timestamp } from '@google-cloud/firestore';
|
|
2
|
+
|
|
3
|
+
export interface TriggerCondition {
|
|
4
|
+
/** Natural-language condition forwarded to the AI as context.
|
|
5
|
+
* e.g. "if I slept poorly last night (sleep quality < 3)" */
|
|
6
|
+
description: string;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export interface TriggerContent {
|
|
10
|
+
/** Natural-language instruction for the AI describing what to produce or schedule.
|
|
11
|
+
* e.g. 'Schedule a 15-min "nap" event in the afternoon' */
|
|
12
|
+
instruction: string;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
export interface TriggerSchedule {
|
|
16
|
+
userId: string;
|
|
17
|
+
scheduleId: string;
|
|
18
|
+
agentType: 'daily-plan';
|
|
19
|
+
timezone: string;
|
|
20
|
+
/** Wall-clock fire time in the user's timezone, e.g. "09:00" */
|
|
21
|
+
fireTimeLocal: string;
|
|
22
|
+
recurrenceRule: string;
|
|
23
|
+
status: 'active' | 'paused' | 'completed';
|
|
24
|
+
nextFireUtc: Timestamp;
|
|
25
|
+
lastRunAt: Timestamp | null;
|
|
26
|
+
lastError: string | null;
|
|
27
|
+
createdAt: Timestamp;
|
|
28
|
+
updatedAt: Timestamp;
|
|
29
|
+
/** Optional conditions forwarded to the AI to decide whether to act */
|
|
30
|
+
conditions?: TriggerCondition[];
|
|
31
|
+
/** What the AI should generate or schedule when this fires */
|
|
32
|
+
content?: TriggerContent;
|
|
33
|
+
/** Send a push notification when the job completes */
|
|
34
|
+
notifyOnComplete?: boolean;
|
|
35
|
+
/** Set to true by the backend when the job runs; cleared by the client after displaying */
|
|
36
|
+
hasUnviewedExecution?: boolean;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export interface DayPlanMeal {
|
|
40
|
+
time: string;
|
|
41
|
+
name: string;
|
|
42
|
+
notes: string;
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export interface DayPlanSleep {
|
|
46
|
+
targetBedtime: string;
|
|
47
|
+
rationale: string;
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
export interface DayPlanContextSnapshot {
|
|
51
|
+
sleepQuality: number;
|
|
52
|
+
energyTrend: string;
|
|
53
|
+
calendarEventCount: number;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
export interface DayPlan {
|
|
57
|
+
planId: string;
|
|
58
|
+
userId: string;
|
|
59
|
+
generatedAt: Timestamp;
|
|
60
|
+
triggeredBy: 'schedule' | 'webhook' | 'manual';
|
|
61
|
+
meals: DayPlanMeal[];
|
|
62
|
+
sleep: DayPlanSleep;
|
|
63
|
+
contextSnapshot: DayPlanContextSnapshot;
|
|
64
|
+
}
|
package/lib/models/User.ts
CHANGED
|
@@ -199,6 +199,8 @@ export interface Notifications {
|
|
|
199
199
|
calendar?: CalendarNotification;
|
|
200
200
|
satisfaction?: boolean;
|
|
201
201
|
peaksDipsDetails?: PeaksDipsDetails;
|
|
202
|
+
/** Notify the user when an auto-scheduled routine job completes */
|
|
203
|
+
scheduledPlanComplete?: boolean;
|
|
202
204
|
}
|
|
203
205
|
|
|
204
206
|
export interface CalendarNotification {
|
package/lib/models/index.ts
CHANGED