@mind-your-now/myn 0.4.0

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.
Files changed (86) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +318 -0
  3. package/dist/index.d.ts +77 -0
  4. package/dist/index.d.ts.map +1 -0
  5. package/dist/index.js +147 -0
  6. package/dist/index.js.map +1 -0
  7. package/dist/src/client.d.ts +40 -0
  8. package/dist/src/client.d.ts.map +1 -0
  9. package/dist/src/client.js +95 -0
  10. package/dist/src/client.js.map +1 -0
  11. package/dist/src/tools/briefing.d.ts +44 -0
  12. package/dist/src/tools/briefing.d.ts.map +1 -0
  13. package/dist/src/tools/briefing.js +116 -0
  14. package/dist/src/tools/briefing.js.map +1 -0
  15. package/dist/src/tools/calendar.d.ts +56 -0
  16. package/dist/src/tools/calendar.d.ts.map +1 -0
  17. package/dist/src/tools/calendar.js +206 -0
  18. package/dist/src/tools/calendar.js.map +1 -0
  19. package/dist/src/tools/capabilityHash.d.ts +26 -0
  20. package/dist/src/tools/capabilityHash.d.ts.map +1 -0
  21. package/dist/src/tools/capabilityHash.js +48 -0
  22. package/dist/src/tools/capabilityHash.js.map +1 -0
  23. package/dist/src/tools/habits.d.ts +43 -0
  24. package/dist/src/tools/habits.d.ts.map +1 -0
  25. package/dist/src/tools/habits.js +123 -0
  26. package/dist/src/tools/habits.js.map +1 -0
  27. package/dist/src/tools/household.d.ts +44 -0
  28. package/dist/src/tools/household.d.ts.map +1 -0
  29. package/dist/src/tools/household.js +146 -0
  30. package/dist/src/tools/household.js.map +1 -0
  31. package/dist/src/tools/lists.d.ts +45 -0
  32. package/dist/src/tools/lists.d.ts.map +1 -0
  33. package/dist/src/tools/lists.js +167 -0
  34. package/dist/src/tools/lists.js.map +1 -0
  35. package/dist/src/tools/memory.d.ts +45 -0
  36. package/dist/src/tools/memory.d.ts.map +1 -0
  37. package/dist/src/tools/memory.js +131 -0
  38. package/dist/src/tools/memory.js.map +1 -0
  39. package/dist/src/tools/myn_a2a_pairing.d.ts +42 -0
  40. package/dist/src/tools/myn_a2a_pairing.d.ts.map +1 -0
  41. package/dist/src/tools/myn_a2a_pairing.js +166 -0
  42. package/dist/src/tools/myn_a2a_pairing.js.map +1 -0
  43. package/dist/src/tools/planning.d.ts +56 -0
  44. package/dist/src/tools/planning.d.ts.map +1 -0
  45. package/dist/src/tools/planning.js +94 -0
  46. package/dist/src/tools/planning.js.map +1 -0
  47. package/dist/src/tools/profile.d.ts +47 -0
  48. package/dist/src/tools/profile.d.ts.map +1 -0
  49. package/dist/src/tools/profile.js +125 -0
  50. package/dist/src/tools/profile.js.map +1 -0
  51. package/dist/src/tools/projects.d.ts +45 -0
  52. package/dist/src/tools/projects.d.ts.map +1 -0
  53. package/dist/src/tools/projects.js +106 -0
  54. package/dist/src/tools/projects.js.map +1 -0
  55. package/dist/src/tools/search.d.ts +46 -0
  56. package/dist/src/tools/search.d.ts.map +1 -0
  57. package/dist/src/tools/search.js +93 -0
  58. package/dist/src/tools/search.js.map +1 -0
  59. package/dist/src/tools/syncOnMismatch.d.ts +48 -0
  60. package/dist/src/tools/syncOnMismatch.d.ts.map +1 -0
  61. package/dist/src/tools/syncOnMismatch.js +94 -0
  62. package/dist/src/tools/syncOnMismatch.js.map +1 -0
  63. package/dist/src/tools/tasks.d.ts +52 -0
  64. package/dist/src/tools/tasks.d.ts.map +1 -0
  65. package/dist/src/tools/tasks.js +200 -0
  66. package/dist/src/tools/tasks.js.map +1 -0
  67. package/dist/src/tools/timers.d.ts +48 -0
  68. package/dist/src/tools/timers.d.ts.map +1 -0
  69. package/dist/src/tools/timers.js +138 -0
  70. package/dist/src/tools/timers.js.map +1 -0
  71. package/openclaw.plugin.json +30 -0
  72. package/package.json +74 -0
  73. package/skills/myn/SKILL.md +54 -0
  74. package/skills/myn/references/authentication.md +83 -0
  75. package/skills/myn/references/briefing-api.md +187 -0
  76. package/skills/myn/references/calendar-api.md +139 -0
  77. package/skills/myn/references/habits-api.md +257 -0
  78. package/skills/myn/references/household-api.md +175 -0
  79. package/skills/myn/references/lists-api.md +180 -0
  80. package/skills/myn/references/memory-api.md +95 -0
  81. package/skills/myn/references/planning-api.md +191 -0
  82. package/skills/myn/references/profile-api.md +148 -0
  83. package/skills/myn/references/projects-api.md +127 -0
  84. package/skills/myn/references/search-api.md +97 -0
  85. package/skills/myn/references/tasks-api.md +187 -0
  86. package/skills/myn/references/timers-api.md +171 -0
@@ -0,0 +1,83 @@
1
+ # Authentication
2
+
3
+ ## API Key Setup
4
+
5
+ MYN uses API key authentication for agent access. Generate a key in the MYN app:
6
+
7
+ 1. Go to **Settings > API Keys**
8
+ 2. Click **Create API Key**
9
+ 3. Select the `AGENT_FULL` scope (recommended for AI agents — grants access to all non-admin endpoints)
10
+ 4. Copy the key (format: `myn_xxxx_...`)
11
+
12
+ ## Making Requests
13
+
14
+ Include the API key in every request via the `X-API-KEY` header:
15
+
16
+ ```bash
17
+ curl -H "X-API-KEY: myn_xxxx_your_key_here" \
18
+ https://api.mindyournow.com/api/v2/unified-tasks
19
+ ```
20
+
21
+ Alternative: pass as query parameter `x-api-key` (less secure, avoid in production):
22
+
23
+ ```
24
+ https://api.mindyournow.com/api/v2/unified-tasks?x-api-key=myn_xxxx_your_key_here
25
+ ```
26
+
27
+ ## Environment Variables
28
+
29
+ Set these for the helper script and examples:
30
+
31
+ ```bash
32
+ export MYN_API_URL="https://api.mindyournow.com"
33
+ export MYN_API_KEY="myn_xxxx_your_key_here"
34
+ ```
35
+
36
+ ## Scopes
37
+
38
+ | Scope | Description |
39
+ |-------|------------|
40
+ | `AGENT_FULL` | Full access to all non-admin endpoints (recommended) |
41
+ | `TASKS_LIST` | List tasks only |
42
+ | `TASKS_VIEW` | View individual tasks |
43
+ | `TASKS_CREATE` | Create tasks |
44
+ | `TASKS_UPDATE` | Update tasks |
45
+ | `TASKS_DELETE` | Delete tasks |
46
+ | `TASKS_CALENDAR` | Calendar task operations |
47
+ | `SCHEDULES_*` | Schedule-related endpoints (5 scopes) |
48
+ | `PROJECTS_*` | Project-related endpoints (5 scopes) |
49
+ | `USER_READ` | Read user profile |
50
+ | `ADMIN_FULL` | Admin access (not for agents) |
51
+
52
+ For AI agents, always use `AGENT_FULL` — it covers all 17 non-admin scopes in a single selection.
53
+
54
+ ## Rate Limits
55
+
56
+ | Limit | Default |
57
+ |-------|---------|
58
+ | Per-minute | 60 requests |
59
+ | Per-hour | 1,000 requests |
60
+
61
+ Rate limits are per API key and configurable by the account owner. When rate-limited, the API returns HTTP 429 with a `Retry-After` header.
62
+
63
+ ## Key Format
64
+
65
+ - **Pattern**: `myn_<type>_<random>`
66
+ - **Storage**: BCrypt-hashed, prefix-indexed for fast lookup
67
+ - **Audit**: Every API key usage is logged (endpoint, method, status code, IP, response time)
68
+
69
+ ## Error Responses
70
+
71
+ | Status | Meaning |
72
+ |--------|---------|
73
+ | 401 | Missing or invalid API key |
74
+ | 403 | Valid key but insufficient scope |
75
+ | 429 | Rate limit exceeded |
76
+
77
+ ```json
78
+ {
79
+ "error": "Forbidden",
80
+ "message": "API key does not have required scope: TASKS_CREATE",
81
+ "status": 403
82
+ }
83
+ ```
@@ -0,0 +1,187 @@
1
+ # Briefing API
2
+
3
+ Compass briefing system for AI-generated daily planning sessions with corrections and completion tracking.
4
+
5
+ ## Base Path
6
+
7
+ `/api/v2/compass`
8
+
9
+ ## Endpoints
10
+
11
+ ### Get Session Status
12
+
13
+ ```
14
+ GET /api/v2/compass/status
15
+ ```
16
+
17
+ Returns the current briefing session state.
18
+
19
+ **Response Fields:**
20
+
21
+ | Field | Type | Description |
22
+ |-------|------|-------------|
23
+ | `hasActiveSession` | boolean | Whether a briefing session is currently active |
24
+ | `sessionId` | UUID | Current session ID (null if no active session) |
25
+ | `lastBriefingId` | UUID | ID of the most recent briefing |
26
+ | `lastBriefingTime` | datetime | Timestamp of the most recent briefing |
27
+ | `pendingCorrections` | number | Count of unprocessed corrections |
28
+
29
+ ```bash
30
+ curl -H "X-API-KEY: $MYN_API_KEY" \
31
+ "$MYN_API_URL/api/v2/compass/status"
32
+ ```
33
+
34
+ ### Generate Briefing
35
+
36
+ ```
37
+ POST /api/v2/compass/generate
38
+ ```
39
+
40
+ Generates a new Compass briefing with prioritized task lists and suggestions.
41
+
42
+ **Body Parameters:**
43
+
44
+ | Field | Type | Description |
45
+ |-------|------|-------------|
46
+ | `context` | string | Optional context to guide the briefing (e.g., "busy morning, meetings after 2pm") |
47
+ | `focusAreas` | string[] | Optional focus areas to emphasize (e.g., `["health", "work deadlines"]`) |
48
+
49
+ **Response Fields:**
50
+
51
+ | Field | Type | Description |
52
+ |-------|------|-------------|
53
+ | `briefingId` | UUID | Unique briefing identifier |
54
+ | `sessionId` | UUID | Session this briefing belongs to |
55
+ | `summary` | string | Natural language summary of the day |
56
+ | `criticalNow` | object[] | Tasks requiring immediate attention |
57
+ | `opportunityNow` | object[] | Tasks worth doing if time allows |
58
+ | `overTheHorizon` | object[] | Tasks to keep in mind for later |
59
+ | `upcomingMeetings` | object[] | Meetings and calendar events today |
60
+ | `habitsDue` | object[] | Habits scheduled for today |
61
+ | `suggestions` | string[] | AI-generated actionable suggestions |
62
+ | `createdAt` | datetime | Briefing generation timestamp |
63
+
64
+ ```bash
65
+ # Generate a basic briefing
66
+ curl -X POST "$MYN_API_URL/api/v2/compass/generate" \
67
+ -H "X-API-KEY: $MYN_API_KEY" \
68
+ -H "Content-Type: application/json" \
69
+ -d '{}'
70
+
71
+ # Generate with context and focus areas
72
+ curl -X POST "$MYN_API_URL/api/v2/compass/generate" \
73
+ -H "X-API-KEY: $MYN_API_KEY" \
74
+ -H "Content-Type: application/json" \
75
+ -d '{
76
+ "context": "Working from home today, low energy",
77
+ "focusAreas": ["health", "project deadlines"]
78
+ }'
79
+ ```
80
+
81
+ ### Get Latest Briefing
82
+
83
+ ```
84
+ GET /api/v2/compass/latest
85
+ ```
86
+
87
+ Returns the most recent briefing without generating a new one.
88
+
89
+ ```bash
90
+ curl -H "X-API-KEY: $MYN_API_KEY" \
91
+ "$MYN_API_URL/api/v2/compass/latest"
92
+ ```
93
+
94
+ ### Get Specific Briefing
95
+
96
+ ```
97
+ GET /api/v2/compass/briefings/{briefingId}
98
+ ```
99
+
100
+ ```bash
101
+ curl -H "X-API-KEY: $MYN_API_KEY" \
102
+ "$MYN_API_URL/api/v2/compass/briefings/550e8400-e29b-41d4-a716-446655440000"
103
+ ```
104
+
105
+ ### Submit Correction
106
+
107
+ ```
108
+ POST /api/v2/compass/corrections
109
+ ```
110
+
111
+ Submits a correction to update the active briefing session when reality diverges from the plan.
112
+
113
+ **Body Parameters:**
114
+
115
+ | Field | Type | Description |
116
+ |-------|------|-------------|
117
+ | `type` | string | **Required.** One of: `TASK_COMPLETED`, `TASK_MISSED`, `TASK_RESCHEDULED`, `TASK_ADDED`, `PRIORITY_CHANGED`, `OTHER` |
118
+ | `data` | object | Optional data relevant to the correction type (e.g., `{"taskId": "..."}`) |
119
+ | `reason` | string | Optional human-readable reason for the correction |
120
+
121
+ **Response Fields:**
122
+
123
+ | Field | Type | Description |
124
+ |-------|------|-------------|
125
+ | `correctionId` | UUID | Unique correction identifier |
126
+ | `appliedAt` | datetime | When the correction was applied |
127
+ | `briefingUpdated` | boolean | Whether the active briefing was re-ranked |
128
+
129
+ ```bash
130
+ # Mark a task as completed mid-session
131
+ curl -X POST "$MYN_API_URL/api/v2/compass/corrections" \
132
+ -H "X-API-KEY: $MYN_API_KEY" \
133
+ -H "Content-Type: application/json" \
134
+ -d '{
135
+ "type": "TASK_COMPLETED",
136
+ "data": {"taskId": "550e8400-e29b-41d4-a716-446655440000"},
137
+ "reason": "Finished the report early"
138
+ }'
139
+
140
+ # Report a priority change
141
+ curl -X POST "$MYN_API_URL/api/v2/compass/corrections" \
142
+ -H "X-API-KEY: $MYN_API_KEY" \
143
+ -H "Content-Type: application/json" \
144
+ -d '{
145
+ "type": "PRIORITY_CHANGED",
146
+ "data": {"taskId": "660e8400-e29b-41d4-a716-446655440001", "newPriority": "CRITICAL"},
147
+ "reason": "Client moved deadline up"
148
+ }'
149
+ ```
150
+
151
+ ### Complete Session
152
+
153
+ ```
154
+ POST /api/v2/compass/complete
155
+ ```
156
+
157
+ Ends the active briefing session with an optional summary and decisions record.
158
+
159
+ **Body Parameters:**
160
+
161
+ | Field | Type | Description |
162
+ |-------|------|-------------|
163
+ | `summary` | string | Optional end-of-session summary |
164
+ | `decisions` | string[] | Optional list of key decisions made during the session |
165
+
166
+ **Response Fields:**
167
+
168
+ | Field | Type | Description |
169
+ |-------|------|-------------|
170
+ | `sessionId` | UUID | The completed session ID |
171
+ | `completedAt` | datetime | Session completion timestamp |
172
+ | `nextSessionRecommended` | datetime | Suggested time for next briefing (nullable) |
173
+ | `followUps` | object[] | Auto-generated follow-up items |
174
+
175
+ ```bash
176
+ # Complete the session with a summary
177
+ curl -X POST "$MYN_API_URL/api/v2/compass/complete" \
178
+ -H "X-API-KEY: $MYN_API_KEY" \
179
+ -H "Content-Type: application/json" \
180
+ -d '{
181
+ "summary": "Productive morning, cleared all Critical Now items",
182
+ "decisions": [
183
+ "Postponed quarterly review to Friday",
184
+ "Delegated invoice follow-up to Sarah"
185
+ ]
186
+ }'
187
+ ```
@@ -0,0 +1,139 @@
1
+ # Calendar API
2
+
3
+ Calendar events and meetings management including creation, listing, and deletion.
4
+
5
+ ## Base Path
6
+
7
+ `/api/v2/calendar`
8
+
9
+ ## Endpoints
10
+
11
+ ### List Events
12
+
13
+ ```
14
+ GET /api/v2/calendar/events
15
+ ```
16
+
17
+ **Query Parameters:**
18
+
19
+ | Parameter | Type | Description |
20
+ |-----------|------|-------------|
21
+ | `start` | datetime | Filter events starting at or after this time (ISO 8601) |
22
+ | `end` | datetime | Filter events ending at or before this time (ISO 8601) |
23
+ | `calendarId` | string | Filter by specific calendar |
24
+ | `allDay` | boolean | Filter for all-day events only |
25
+ | `limit` | number | Max results (default: 50) |
26
+
27
+ ```bash
28
+ # List events for this week
29
+ curl -H "X-API-KEY: $MYN_API_KEY" \
30
+ "$MYN_API_URL/api/v2/calendar/events?start=2026-03-01T00:00:00Z&end=2026-03-07T23:59:59Z"
31
+
32
+ # List only all-day events
33
+ curl -H "X-API-KEY: $MYN_API_KEY" \
34
+ "$MYN_API_URL/api/v2/calendar/events?allDay=true&limit=10"
35
+ ```
36
+
37
+ ### Create Event
38
+
39
+ ```
40
+ POST /api/v2/calendar/events
41
+ ```
42
+
43
+ **Required Fields:**
44
+
45
+ | Field | Type | Description |
46
+ |-------|------|-------------|
47
+ | `title` | string | Event title |
48
+ | `startTime` | datetime | Start time (ISO 8601) |
49
+ | `endTime` | datetime | End time (ISO 8601, required for non-all-day events) |
50
+
51
+ **Optional Fields:**
52
+
53
+ | Field | Type | Description |
54
+ |-------|------|-------------|
55
+ | `isAllDay` | boolean | Whether this is an all-day event (default: false) |
56
+ | `description` | string | Event description |
57
+ | `location` | string | Event location |
58
+ | `calendarId` | string | Target calendar ID |
59
+ | `attendees` | string[] | List of attendee email addresses |
60
+ | `recurrence` | string | Recurrence rule (RRULE format, e.g., `FREQ=WEEKLY;BYDAY=MO,WE,FR`) |
61
+ | `reminders` | object[] | Reminders, each with `minutes` (number) and `method` (`popup` or `email`) |
62
+
63
+ ```bash
64
+ # Create a one-time meeting
65
+ curl -X POST "$MYN_API_URL/api/v2/calendar/events" \
66
+ -H "X-API-KEY: $MYN_API_KEY" \
67
+ -H "Content-Type: application/json" \
68
+ -d '{
69
+ "title": "Team standup",
70
+ "startTime": "2026-03-02T09:00:00Z",
71
+ "endTime": "2026-03-02T09:30:00Z",
72
+ "location": "Conference Room B",
73
+ "attendees": ["alice@example.com", "bob@example.com"],
74
+ "reminders": [{"minutes": 10, "method": "popup"}]
75
+ }'
76
+
77
+ # Create a recurring all-day event
78
+ curl -X POST "$MYN_API_URL/api/v2/calendar/events" \
79
+ -H "X-API-KEY: $MYN_API_KEY" \
80
+ -H "Content-Type: application/json" \
81
+ -d '{
82
+ "title": "Sprint review",
83
+ "startTime": "2026-03-06T00:00:00Z",
84
+ "isAllDay": true,
85
+ "recurrence": "FREQ=WEEKLY;INTERVAL=2;BYDAY=FR",
86
+ "description": "Bi-weekly sprint review"
87
+ }'
88
+ ```
89
+
90
+ ### Delete Event
91
+
92
+ ```
93
+ DELETE /api/v2/calendar/events/{eventId}
94
+ ```
95
+
96
+ ```bash
97
+ curl -X DELETE "$MYN_API_URL/api/v2/calendar/events/550e8400-e29b-41d4-a716-446655440000" \
98
+ -H "X-API-KEY: $MYN_API_KEY"
99
+ ```
100
+
101
+ ### List Meetings
102
+
103
+ ```
104
+ GET /api/v2/calendar/meetings
105
+ ```
106
+
107
+ Returns upcoming meetings with attendee information. This is a convenience view over calendar events filtered to multi-attendee meetings.
108
+
109
+ **Query Parameters:**
110
+
111
+ | Parameter | Type | Description |
112
+ |-----------|------|-------------|
113
+ | `includePast` | boolean | Include past meetings (default: false) |
114
+ | `daysAhead` | number | Number of days to look ahead (default: 7) |
115
+ | `limit` | number | Max results |
116
+
117
+ **Response Fields:**
118
+
119
+ | Field | Type | Description |
120
+ |-------|------|-------------|
121
+ | `meetings` | object[] | Array of meeting objects |
122
+ | `meetings[].id` | string | Meeting/event ID |
123
+ | `meetings[].title` | string | Meeting title |
124
+ | `meetings[].startTime` | datetime | Start time |
125
+ | `meetings[].endTime` | datetime | End time |
126
+ | `meetings[].attendees` | string[] | List of attendee emails |
127
+ | `meetings[].location` | string | Meeting location (nullable) |
128
+ | `meetings[].isRecurring` | boolean | Whether the meeting recurs |
129
+ | `total` | number | Total matching meetings |
130
+
131
+ ```bash
132
+ # Get meetings for the next 7 days
133
+ curl -H "X-API-KEY: $MYN_API_KEY" \
134
+ "$MYN_API_URL/api/v2/calendar/meetings"
135
+
136
+ # Get meetings for the next 14 days including past
137
+ curl -H "X-API-KEY: $MYN_API_KEY" \
138
+ "$MYN_API_URL/api/v2/calendar/meetings?daysAhead=14&includePast=true&limit=25"
139
+ ```
@@ -0,0 +1,257 @@
1
+ # Habits API
2
+
3
+ Habit streaks, habit chains, scheduling, and reminders.
4
+
5
+ ## Base Path
6
+
7
+ - Streaks and chains: `/api/v1/habit-chains`
8
+ - Reminders: `/api/habits/reminders`
9
+
10
+ ## Endpoints
11
+
12
+ ### List All Habit Streaks
13
+
14
+ ```
15
+ GET /api/v1/habit-chains/streaks
16
+ ```
17
+
18
+ Returns streak data for all habits.
19
+
20
+ **Response Fields:**
21
+
22
+ | Field | Type | Description |
23
+ |-------|------|-------------|
24
+ | `habits` | object[] | Array of habit streak objects |
25
+ | `habits[].habitId` | UUID | Habit identifier |
26
+ | `habits[].title` | string | Habit title |
27
+ | `habits[].currentStreak` | number | Current consecutive completions |
28
+ | `habits[].longestStreak` | number | All-time longest streak |
29
+ | `habits[].totalCompletions` | number | Total times completed |
30
+ | `habits[].lastCompletedAt` | datetime | Last completion timestamp |
31
+
32
+ ```bash
33
+ curl -H "X-API-KEY: $MYN_API_KEY" \
34
+ "$MYN_API_URL/api/v1/habit-chains/streaks"
35
+ ```
36
+
37
+ ### Get Specific Habit Streak
38
+
39
+ ```
40
+ GET /api/v1/habit-chains/{habitId}/streaks
41
+ ```
42
+
43
+ **Query Parameters:**
44
+
45
+ | Parameter | Type | Description |
46
+ |-----------|------|-------------|
47
+ | `includeHistory` | boolean | Include day-by-day streak history |
48
+
49
+ **Response Fields:**
50
+
51
+ | Field | Type | Description |
52
+ |-------|------|-------------|
53
+ | `habitId` | UUID | Habit identifier |
54
+ | `currentStreak` | number | Current consecutive completions |
55
+ | `longestStreak` | number | All-time longest streak |
56
+ | `totalCompletions` | number | Total times completed |
57
+ | `lastCompletedAt` | datetime | Last completion timestamp |
58
+ | `streakHistory` | object[] | Day-by-day history (only if `includeHistory=true`) |
59
+ | `streakHistory[].date` | date | Calendar date |
60
+ | `streakHistory[].completed` | boolean | Whether the habit was completed that day |
61
+
62
+ ```bash
63
+ # Basic streak info
64
+ curl -H "X-API-KEY: $MYN_API_KEY" \
65
+ "$MYN_API_URL/api/v1/habit-chains/660e8400-e29b-41d4-a716-446655440001/streaks"
66
+
67
+ # With full history
68
+ curl -H "X-API-KEY: $MYN_API_KEY" \
69
+ "$MYN_API_URL/api/v1/habit-chains/660e8400-e29b-41d4-a716-446655440001/streaks?includeHistory=true"
70
+ ```
71
+
72
+ ### Skip Habit (Preserve Streak)
73
+
74
+ ```
75
+ POST /api/v1/habit-chains/{habitId}/skip
76
+ ```
77
+
78
+ Marks a habit as skipped for a day without breaking the streak.
79
+
80
+ **Body Parameters:**
81
+
82
+ | Field | Type | Description |
83
+ |-------|------|-------------|
84
+ | `skipDate` | date | Date to skip (default: today, YYYY-MM-DD) |
85
+ | `reason` | string | Optional reason for skipping |
86
+
87
+ **Response Fields:**
88
+
89
+ | Field | Type | Description |
90
+ |-------|------|-------------|
91
+ | `habitId` | UUID | Habit identifier |
92
+ | `skippedDate` | date | The date that was skipped |
93
+ | `streakPreserved` | boolean | Whether the streak was preserved |
94
+ | `newStreakCount` | number | Updated streak count |
95
+
96
+ ```bash
97
+ curl -X POST "$MYN_API_URL/api/v1/habit-chains/660e8400-e29b-41d4-a716-446655440001/skip" \
98
+ -H "X-API-KEY: $MYN_API_KEY" \
99
+ -H "Content-Type: application/json" \
100
+ -d '{
101
+ "skipDate": "2026-03-01",
102
+ "reason": "Sick day"
103
+ }'
104
+ ```
105
+
106
+ ### List All Chains
107
+
108
+ ```
109
+ GET /api/v1/habit-chains
110
+ ```
111
+
112
+ Returns all habit chains (grouped sequences of habits).
113
+
114
+ **Response Fields:**
115
+
116
+ | Field | Type | Description |
117
+ |-------|------|-------------|
118
+ | `chains` | object[] | Array of chain objects |
119
+ | `chains[].chainId` | UUID | Chain identifier |
120
+ | `chains[].name` | string | Chain name |
121
+ | `chains[].habitCount` | number | Number of habits in the chain |
122
+ | `chains[].totalCompletions` | number | Total completions across all habits |
123
+ | `chains[].lastCompletedAt` | datetime | Last completion in this chain |
124
+
125
+ ```bash
126
+ curl -H "X-API-KEY: $MYN_API_KEY" \
127
+ "$MYN_API_URL/api/v1/habit-chains"
128
+ ```
129
+
130
+ ### Get Specific Chain
131
+
132
+ ```
133
+ GET /api/v1/habit-chains/{chainId}
134
+ ```
135
+
136
+ **Response Fields:**
137
+
138
+ | Field | Type | Description |
139
+ |-------|------|-------------|
140
+ | `chainId` | UUID | Chain identifier |
141
+ | `name` | string | Chain name |
142
+ | `habits` | object[] | Ordered list of habits in the chain |
143
+ | `habits[].habitId` | UUID | Habit identifier |
144
+ | `habits[].title` | string | Habit title |
145
+ | `habits[].order` | number | Position in the chain |
146
+ | `trigger` | string | What triggers the chain (nullable) |
147
+ | `location` | string | Where the chain is performed (nullable) |
148
+ | `totalCompletions` | number | Total completions across all habits |
149
+
150
+ ```bash
151
+ curl -H "X-API-KEY: $MYN_API_KEY" \
152
+ "$MYN_API_URL/api/v1/habit-chains/770e8400-e29b-41d4-a716-446655440002"
153
+ ```
154
+
155
+ ### Get Habit Schedule
156
+
157
+ ```
158
+ GET /api/v1/habit-chains/schedule
159
+ ```
160
+
161
+ Returns the habit schedule for the upcoming days.
162
+
163
+ **Query Parameters:**
164
+
165
+ | Parameter | Type | Description |
166
+ |-----------|------|-------------|
167
+ | `days` | number | Number of days to look ahead (default: 7) |
168
+
169
+ **Response Fields:**
170
+
171
+ | Field | Type | Description |
172
+ |-------|------|-------------|
173
+ | `schedule` | object[] | Array of daily schedules |
174
+ | `schedule[].date` | date | Calendar date |
175
+ | `schedule[].dayOfWeek` | string | Day name (e.g., `Monday`) |
176
+ | `schedule[].habits` | object[] | Habits due on that day |
177
+ | `schedule[].habits[].habitId` | UUID | Habit identifier |
178
+ | `schedule[].habits[].title` | string | Habit title |
179
+ | `schedule[].habits[].duration` | string | Expected duration (nullable) |
180
+ | `schedule[].habits[].completed` | boolean | Whether already completed |
181
+ | `schedule[].habits[].chainName` | string | Parent chain name (nullable) |
182
+ | `habitsDue` | number | Total habits due across the period |
183
+
184
+ ```bash
185
+ # Default 7-day schedule
186
+ curl -H "X-API-KEY: $MYN_API_KEY" \
187
+ "$MYN_API_URL/api/v1/habit-chains/schedule"
188
+
189
+ # 14-day schedule
190
+ curl -H "X-API-KEY: $MYN_API_KEY" \
191
+ "$MYN_API_URL/api/v1/habit-chains/schedule?days=14"
192
+ ```
193
+
194
+ ### List All Reminders
195
+
196
+ ```
197
+ GET /api/habits/reminders
198
+ ```
199
+
200
+ Returns reminder settings for all habits.
201
+
202
+ **Response Fields:**
203
+
204
+ | Field | Type | Description |
205
+ |-------|------|-------------|
206
+ | `reminders` | object[] | Array of reminder objects |
207
+ | `reminders[].habitId` | UUID | Habit identifier |
208
+ | `reminders[].title` | string | Habit title |
209
+ | `reminders[].enabled` | boolean | Whether the reminder is active |
210
+ | `reminders[].reminderTime` | time | Time of day for the reminder (nullable, HH:mm) |
211
+ | `reminders[].reminderDays` | string[] | Days the reminder fires (e.g., `["MON", "WED", "FRI"]`) |
212
+
213
+ ```bash
214
+ curl -H "X-API-KEY: $MYN_API_KEY" \
215
+ "$MYN_API_URL/api/habits/reminders"
216
+ ```
217
+
218
+ ### Get Specific Reminder
219
+
220
+ ```
221
+ GET /api/habits/reminders/{habitId}
222
+ ```
223
+
224
+ ```bash
225
+ curl -H "X-API-KEY: $MYN_API_KEY" \
226
+ "$MYN_API_URL/api/habits/reminders/660e8400-e29b-41d4-a716-446655440001"
227
+ ```
228
+
229
+ ### Update Reminder
230
+
231
+ ```
232
+ PUT /api/habits/reminders/{habitId}
233
+ ```
234
+
235
+ **Body Parameters:**
236
+
237
+ | Field | Type | Description |
238
+ |-------|------|-------------|
239
+ | `enabled` | boolean | Enable or disable the reminder |
240
+ | `time` | time | Time of day for the reminder (HH:mm) |
241
+
242
+ ```bash
243
+ # Enable a reminder at 7:30 AM
244
+ curl -X PUT "$MYN_API_URL/api/habits/reminders/660e8400-e29b-41d4-a716-446655440001" \
245
+ -H "X-API-KEY: $MYN_API_KEY" \
246
+ -H "Content-Type: application/json" \
247
+ -d '{
248
+ "enabled": true,
249
+ "time": "07:30"
250
+ }'
251
+
252
+ # Disable a reminder
253
+ curl -X PUT "$MYN_API_URL/api/habits/reminders/660e8400-e29b-41d4-a716-446655440001" \
254
+ -H "X-API-KEY: $MYN_API_KEY" \
255
+ -H "Content-Type: application/json" \
256
+ -d '{"enabled": false}'
257
+ ```