@demind-inc/core 1.11.9 → 1.11.10

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.
@@ -0,0 +1,53 @@
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
+ }
31
+ export interface DayPlanMeal {
32
+ time: string;
33
+ name: string;
34
+ notes: string;
35
+ }
36
+ export interface DayPlanSleep {
37
+ targetBedtime: string;
38
+ rationale: string;
39
+ }
40
+ export interface DayPlanContextSnapshot {
41
+ sleepQuality: number;
42
+ energyTrend: string;
43
+ calendarEventCount: number;
44
+ }
45
+ export interface DayPlan {
46
+ planId: string;
47
+ userId: string;
48
+ generatedAt: Timestamp;
49
+ triggeredBy: 'schedule' | 'webhook' | 'manual';
50
+ meals: DayPlanMeal[];
51
+ sleep: DayPlanSleep;
52
+ contextSnapshot: DayPlanContextSnapshot;
53
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -17,3 +17,4 @@ export * from "./Chat";
17
17
  export * from "./SharedAccess";
18
18
  export * from "./RichContext";
19
19
  export * from "./Team";
20
+ export * from "./ScheduledPlan";
@@ -33,3 +33,4 @@ __exportStar(require("./Chat"), exports);
33
33
  __exportStar(require("./SharedAccess"), exports);
34
34
  __exportStar(require("./RichContext"), exports);
35
35
  __exportStar(require("./Team"), exports);
36
+ __exportStar(require("./ScheduledPlan"), exports);
@@ -0,0 +1,60 @@
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
+ }
34
+
35
+ export interface DayPlanMeal {
36
+ time: string;
37
+ name: string;
38
+ notes: string;
39
+ }
40
+
41
+ export interface DayPlanSleep {
42
+ targetBedtime: string;
43
+ rationale: string;
44
+ }
45
+
46
+ export interface DayPlanContextSnapshot {
47
+ sleepQuality: number;
48
+ energyTrend: string;
49
+ calendarEventCount: number;
50
+ }
51
+
52
+ export interface DayPlan {
53
+ planId: string;
54
+ userId: string;
55
+ generatedAt: Timestamp;
56
+ triggeredBy: 'schedule' | 'webhook' | 'manual';
57
+ meals: DayPlanMeal[];
58
+ sleep: DayPlanSleep;
59
+ contextSnapshot: DayPlanContextSnapshot;
60
+ }
@@ -17,3 +17,4 @@ export * from "./Chat";
17
17
  export * from "./SharedAccess";
18
18
  export * from "./RichContext";
19
19
  export * from "./Team";
20
+ export * from "./ScheduledPlan";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@demind-inc/core",
3
- "version": "1.11.9",
3
+ "version": "1.11.10",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {