@mind-your-now/myn 0.8.2 → 0.8.4

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 (40) hide show
  1. package/README.md +105 -6
  2. package/dist/index.js +1 -1
  3. package/dist/src/tools/debrief.js +2 -2
  4. package/dist/src/tools/debrief.js.map +1 -1
  5. package/dist/src/tools/habits.js +2 -2
  6. package/dist/src/tools/habits.js.map +1 -1
  7. package/dist/src/tools/household.js +3 -3
  8. package/dist/src/tools/household.js.map +1 -1
  9. package/dist/src/tools/lists.js +2 -2
  10. package/dist/src/tools/lists.js.map +1 -1
  11. package/dist/src/tools/memory.js +1 -1
  12. package/dist/src/tools/memory.js.map +1 -1
  13. package/dist/src/tools/planning.js +1 -1
  14. package/dist/src/tools/planning.js.map +1 -1
  15. package/dist/src/tools/projects.js +4 -4
  16. package/dist/src/tools/projects.js.map +1 -1
  17. package/dist/src/tools/tasks.js +2 -2
  18. package/dist/src/tools/tasks.js.map +1 -1
  19. package/dist/src/tools/timers.js +1 -1
  20. package/dist/src/tools/timers.js.map +1 -1
  21. package/dist/src/validation.d.ts.map +1 -1
  22. package/dist/src/validation.js +3 -2
  23. package/dist/src/validation.js.map +1 -1
  24. package/openclaw.plugin.json +1 -1
  25. package/package.json +2 -2
  26. package/skills/myn/SKILL.md +12 -10
  27. package/skills/myn/references/briefing-api.md +11 -183
  28. package/skills/myn/references/calendar-api.md +177 -55
  29. package/skills/myn/references/debrief-api.md +182 -0
  30. package/skills/myn/references/habits-api.md +37 -55
  31. package/skills/myn/references/household-api.md +37 -14
  32. package/skills/myn/references/lists-api.md +80 -46
  33. package/skills/myn/references/memory-api.md +66 -34
  34. package/skills/myn/references/planning-api.md +58 -155
  35. package/skills/myn/references/profile-api.md +54 -61
  36. package/skills/myn/references/projects-api.md +13 -11
  37. package/skills/myn/references/search-api.md +20 -48
  38. package/skills/myn/references/tasks-api.md +47 -40
  39. package/skills/myn/references/timers-api.md +113 -52
  40. package/skills/myn/references/ynab-api.md +323 -0
@@ -6,12 +6,16 @@ User information, goals, and preferences.
6
6
 
7
7
  `/api/v1/customers`
8
8
 
9
+ ## Actions
10
+
11
+ The `myn_profile` tool supports these actions: `get_info`, `get_goals`, `update_goals`, `preferences`.
12
+
9
13
  ## Endpoints
10
14
 
11
15
  ### Get User Info
12
16
 
13
17
  ```
14
- GET /api/v1/customers/me
18
+ GET /api/v1/customers
15
19
  ```
16
20
 
17
21
  **Response:**
@@ -40,7 +44,7 @@ GET /api/v1/customers/me
40
44
  ```
41
45
 
42
46
  ```bash
43
- curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/me"
47
+ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers"
44
48
  ```
45
49
 
46
50
  ### Get Goals
@@ -49,100 +53,89 @@ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/me"
49
53
  GET /api/v1/customers/goals
50
54
  ```
51
55
 
52
- **Response:** `{ goals[{ id, title, description?, targetDate?, priority, status, progress, createdAt, updatedAt, relatedTasks?[] }], activeCount, completedCount }`
56
+ **Response:** `{ goalsAndAmbitions: string | null, stateHash: string }`
53
57
 
54
- - `priority`: `low`, `medium`, `high`
55
- - `status`: `active`, `completed`, `paused`, `abandoned`
56
- - `progress`: 0–100
58
+ Goals are stored as a single markdown text field. The response includes a `stateHash` for use in the read-before-write protocol (MIN-740).
57
59
 
58
60
  ```bash
59
61
  curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/goals"
60
62
  ```
61
63
 
62
- ### Create Goals
64
+ ### Update Goals
63
65
 
64
66
  ```
65
- POST /api/v1/customers/goals
67
+ PUT /api/v1/customers/goals
66
68
  ```
67
69
 
68
- **Body:**
70
+ **Uses read-before-write guard** (MIN-740). Reads goals first to get `stateHash`, retries on 409.
71
+
72
+ The tool formats structured goal objects into markdown before sending:
73
+
74
+ **Tool Parameters (goals array):**
75
+
76
+ | Field | Type | Description |
77
+ |-------|------|-------------|
78
+ | `title` | string | **Required.** Goal title |
79
+ | `description` | string | Goal description |
80
+ | `targetDate` | date | Target date (YYYY-MM-DD) |
81
+ | `priority` | string | `low`, `medium`, `high` |
82
+ | `status` | string | `active`, `completed`, `paused`, `abandoned` |
83
+
84
+ **Request Body (sent to backend):**
69
85
 
70
86
  ```json
71
87
  {
72
- "goals": [
73
- {
74
- "title": "Run a marathon",
75
- "description": "Complete a full marathon by end of year",
76
- "targetDate": "2026-12-31",
77
- "priority": "high"
78
- }
79
- ]
88
+ "goalsAndAmbitions": "- **Run a marathon** [active] (high priority)\n Complete a full marathon by end of year\n Target: 2026-12-31"
80
89
  }
81
90
  ```
82
91
 
83
- **Response:** `{ created[{ goalId, title }] }`
92
+ **Response:** `{ status: "success", message: "Goals and ambitions updated successfully" }`
84
93
 
85
94
  ```bash
86
- curl -X POST "$MYN_API_URL/api/v1/customers/goals" \
95
+ HASH=$(curl -s -H "X-API-KEY: $MYN_API_KEY" \
96
+ "$MYN_API_URL/api/v1/customers/goals" | jq -r .stateHash)
97
+
98
+ curl -X PUT "$MYN_API_URL/api/v1/customers/goals" \
87
99
  -H "X-API-KEY: $MYN_API_KEY" \
100
+ -H "X-MYN-State-Hash: $HASH" \
88
101
  -H "Content-Type: application/json" \
89
- -d '{"goals": [{"title": "Read 24 books this year", "priority": "medium"}]}'
102
+ -d '{"goalsAndAmbitions": "- **Read 24 books this year** [active] (medium priority)"}'
90
103
  ```
91
104
 
92
- ### Update Goal
105
+ ### Preferences
93
106
 
94
- ```
95
- PUT /api/v1/customers/goals/{goalId}
96
- ```
97
-
98
- **Body:** `{ title?, description?, targetDate?, priority?, status? }`
107
+ Preferences are managed via dedicated endpoints, not a generic preferences store.
99
108
 
100
- **Response:** `{ goalId, updated }`
109
+ **Valid preference keys:**
101
110
 
102
- ```bash
103
- curl -X PUT "$MYN_API_URL/api/v1/customers/goals/aabb0000-0000-0000-0000-000000000001" \
104
- -H "X-API-KEY: $MYN_API_KEY" \
105
- -H "Content-Type: application/json" \
106
- -d '{"status": "completed"}'
107
- ```
111
+ | Key | Endpoint |
112
+ |-----|----------|
113
+ | `notification-preferences` | `GET/PUT /api/v1/customers/notification-preferences` |
114
+ | `coaching-intensity` | `GET/PUT /api/v1/customers/coaching-intensity` |
115
+ | `theme-preference` | `GET/PUT /api/v1/customers/theme-preference` |
108
116
 
109
- ### Get Preferences
117
+ **Tool Behavior:**
110
118
 
111
- ```
112
- GET /api/v1/customers/preferences
113
- GET /api/v1/customers/preferences/{key}
114
- ```
119
+ - With `preferenceKey` + `preferenceValue`: PUTs the value to the corresponding endpoint
120
+ - With `preferenceKey` only: GETs from the corresponding endpoint
121
+ - Without `preferenceKey`: GETs all preferences by fetching each endpoint
115
122
 
116
- **Query Parameters:**
123
+ **Tool Parameters:**
117
124
 
118
125
  | Parameter | Type | Description |
119
126
  |-----------|------|-------------|
120
- | `category` | string | Filter: `notifications`, `display`, `ai`, `privacy`, `integrations` |
121
-
122
- **Response (all):** `{ preferences: { key: value, ... }, categories[] }`
123
- **Response (specific):** `{ key, value, category, updatedAt }`
127
+ | `preferenceKey` | string | One of: `notification-preferences`, `coaching-intensity`, `theme-preference` |
128
+ | `preferenceValue` | any | Value to set (triggers PUT) |
124
129
 
125
130
  ```bash
126
131
  # Get all preferences
127
- curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/preferences"
128
-
129
- # Get AI preferences only
130
- curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/preferences?category=ai"
131
- ```
132
-
133
- ### Set Preference
132
+ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/notification-preferences"
133
+ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/coaching-intensity"
134
+ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/v1/customers/theme-preference"
134
135
 
135
- ```
136
- PUT /api/v1/customers/preferences
137
- ```
138
-
139
- **Body:** `{ key, value, category? }`
140
-
141
- **Response:** `{ key, updated }`
142
-
143
- ```bash
144
- curl -X PUT "$MYN_API_URL/api/v1/customers/preferences" \
136
+ # Update theme
137
+ curl -X PUT "$MYN_API_URL/api/v1/customers/theme-preference" \
145
138
  -H "X-API-KEY: $MYN_API_KEY" \
146
139
  -H "Content-Type: application/json" \
147
- -d '{"key": "ai.tone", "value": "friendly", "category": "ai"}'
140
+ -d '{"theme": "dark"}'
148
141
  ```
@@ -6,12 +6,16 @@ Project and category management for organizing tasks.
6
6
 
7
7
  `/api/project`
8
8
 
9
+ ## Actions
10
+
11
+ The `myn_projects` tool supports these actions: `list`, `get`, `create`, `move_task`.
12
+
9
13
  ## Endpoints
10
14
 
11
15
  ### List Projects
12
16
 
13
17
  ```
14
- GET /api/project
18
+ GET /api/project/defaults
15
19
  ```
16
20
 
17
21
  **Query Parameters:**
@@ -45,7 +49,7 @@ GET /api/project
45
49
  ```
46
50
 
47
51
  ```bash
48
- curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/project?includeStats=true"
52
+ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/project/defaults?includeStats=true"
49
53
  ```
50
54
 
51
55
  ### Get Project
@@ -87,14 +91,14 @@ curl -H "X-API-KEY: $MYN_API_KEY" "$MYN_API_URL/api/project/PROJECT_ID"
87
91
  ### Create Project
88
92
 
89
93
  ```
90
- POST /api/project
94
+ POST /api/project/create
91
95
  ```
92
96
 
93
97
  **Body:**
94
98
 
95
99
  | Field | Type | Required | Description |
96
100
  |-------|------|----------|-------------|
97
- | `name` | string | Yes | Project name (1100 chars) |
101
+ | `name` | string | Yes | Project name (1-100 chars) |
98
102
  | `description` | string | No | Description (max 500 chars) |
99
103
  | `color` | string | No | Hex color (`#3B82F6`) |
100
104
  | `icon` | string | No | Icon identifier |
@@ -103,7 +107,7 @@ POST /api/project
103
107
  **Response:** `{ id, name, created }`
104
108
 
105
109
  ```bash
106
- curl -X POST "$MYN_API_URL/api/project" \
110
+ curl -X POST "$MYN_API_URL/api/project/create" \
107
111
  -H "X-API-KEY: $MYN_API_KEY" \
108
112
  -H "Content-Type: application/json" \
109
113
  -d '{"name": "Home Renovation", "color": "#10B981", "icon": "home"}'
@@ -112,16 +116,14 @@ curl -X POST "$MYN_API_URL/api/project" \
112
116
  ### Move Task to Project
113
117
 
114
118
  ```
115
- PUT /api/v2/unified-tasks/{taskId}/project
119
+ PUT /api/project/{targetProjectId}/moveTaskToProject/{taskId}
116
120
  ```
117
121
 
118
- **Body:** `{ projectId: "target-project-uuid" }`
122
+ Moves a task to a different project. No request body needed.
119
123
 
120
124
  **Response:** `{ taskId, previousProjectId?, newProjectId, moved }`
121
125
 
122
126
  ```bash
123
- curl -X PUT "$MYN_API_URL/api/v2/unified-tasks/TASK_ID/project" \
124
- -H "X-API-KEY: $MYN_API_KEY" \
125
- -H "Content-Type: application/json" \
126
- -d '{"projectId": "TARGET_PROJECT_ID"}'
127
+ curl -X PUT "$MYN_API_URL/api/project/TARGET_PROJECT_ID/moveTaskToProject/TASK_ID" \
128
+ -H "X-API-KEY: $MYN_API_KEY"
127
129
  ```
@@ -11,23 +11,22 @@ Unified search across all MYN entity types with filtering, pagination, and relev
11
11
  ### Search
12
12
 
13
13
  ```
14
- POST /api/v2/search
14
+ GET /api/v2/search
15
15
  ```
16
16
 
17
- Performs a full-text search across tasks, habits, chores, events, projects, notes, and memories.
17
+ Performs a full-text search across tasks, habits, chores, events, projects, notes, and memories using query parameters.
18
18
 
19
- **Body Parameters:**
19
+ **Query Parameters:**
20
20
 
21
- | Field | Type | Description |
22
- |-------|------|-------------|
23
- | `query` | string | **Required.** Search query text |
24
- | `types` | string[] | Entity types to search. Options: `task`, `habit`, `chore`, `event`, `project`, `note`, `memory`. Omit to search all types. |
25
- | `filters` | object | Optional filters to narrow results |
26
- | `filters.status` | string | Filter by status (e.g., `PENDING`, `COMPLETED`) |
27
- | `filters.priority` | string | Filter by priority (e.g., `CRITICAL`, `OPPORTUNITY_NOW`) |
28
- | `filters.projectId` | UUID | Filter by project |
29
- | `filters.dateFrom` | date | Results from this date onward (YYYY-MM-DD) |
30
- | `filters.dateTo` | date | Results up to this date (YYYY-MM-DD) |
21
+ | Parameter | Type | Description |
22
+ |-----------|------|-------------|
23
+ | `q` | string | **Required.** Search query text |
24
+ | `types` | string | Entity types to search (repeatable). Options: `task`, `habit`, `chore`, `event`, `project`, `note`, `memory`. Omit to search all types. |
25
+ | `status` | string | Filter by status (e.g., `PENDING`, `IN_PROGRESS`, `COMPLETED`, `ARCHIVED`) |
26
+ | `priority` | string | Filter by priority (e.g., `CRITICAL`, `OPPORTUNITY_NOW`, `OVER_THE_HORIZON`, `PARKING_LOT`) |
27
+ | `projectId` | UUID | Filter by project |
28
+ | `dateFrom` | date | Results from this date onward (YYYY-MM-DD) |
29
+ | `dateTo` | date | Results up to this date (YYYY-MM-DD) |
31
30
  | `limit` | number | Max results (default: 20, max: 100) |
32
31
  | `offset` | number | Pagination offset (default: 0) |
33
32
 
@@ -53,45 +52,18 @@ Performs a full-text search across tasks, habits, chores, events, projects, note
53
52
 
54
53
  ```bash
55
54
  # Basic search
56
- curl -X POST "$MYN_API_URL/api/v2/search" \
57
- -H "X-API-KEY: $MYN_API_KEY" \
58
- -H "Content-Type: application/json" \
59
- -d '{"query": "quarterly report"}'
55
+ curl -H "X-API-KEY: $MYN_API_KEY" \
56
+ "$MYN_API_URL/api/v2/search?q=quarterly+report"
60
57
 
61
58
  # Search only tasks and notes
62
- curl -X POST "$MYN_API_URL/api/v2/search" \
63
- -H "X-API-KEY: $MYN_API_KEY" \
64
- -H "Content-Type: application/json" \
65
- -d '{
66
- "query": "quarterly report",
67
- "types": ["task", "note"],
68
- "limit": 10
69
- }'
59
+ curl -H "X-API-KEY: $MYN_API_KEY" \
60
+ "$MYN_API_URL/api/v2/search?q=quarterly+report&types=task&types=note&limit=10"
70
61
 
71
62
  # Search with filters
72
- curl -X POST "$MYN_API_URL/api/v2/search" \
73
- -H "X-API-KEY: $MYN_API_KEY" \
74
- -H "Content-Type: application/json" \
75
- -d '{
76
- "query": "budget",
77
- "types": ["task", "project"],
78
- "filters": {
79
- "status": "PENDING",
80
- "priority": "CRITICAL",
81
- "dateFrom": "2026-01-01",
82
- "dateTo": "2026-03-31"
83
- },
84
- "limit": 50,
85
- "offset": 0
86
- }'
63
+ curl -H "X-API-KEY: $MYN_API_KEY" \
64
+ "$MYN_API_URL/api/v2/search?q=budget&types=task&types=project&status=PENDING&priority=CRITICAL&dateFrom=2026-01-01&dateTo=2026-03-31&limit=50"
87
65
 
88
66
  # Paginated search
89
- curl -X POST "$MYN_API_URL/api/v2/search" \
90
- -H "X-API-KEY: $MYN_API_KEY" \
91
- -H "Content-Type: application/json" \
92
- -d '{
93
- "query": "meeting notes",
94
- "limit": 20,
95
- "offset": 20
96
- }'
67
+ curl -H "X-API-KEY: $MYN_API_KEY" \
68
+ "$MYN_API_URL/api/v2/search?q=meeting+notes&limit=20&offset=20"
97
69
  ```
@@ -6,6 +6,10 @@ Unified task management covering Tasks, Habits, and Chores.
6
6
 
7
7
  `/api/v2/unified-tasks`
8
8
 
9
+ ## Actions
10
+
11
+ The `myn_tasks` tool supports these actions: `list`, `get`, `create`, `update`, `complete`, `archive`, `search`.
12
+
9
13
  ## Endpoints
10
14
 
11
15
  ### List Tasks
@@ -18,8 +22,8 @@ GET /api/v2/unified-tasks
18
22
 
19
23
  | Parameter | Type | Description |
20
24
  |-----------|------|-------------|
21
- | `status` | string | Filter: `PENDING`, `IN_PROGRESS`, `COMPLETED`, `ARCHIVED` |
22
- | `priority` | string | Filter: `CRITICAL`, `OPPORTUNITY_NOW`, `OVER_THE_HORIZON`, `PARKING_LOT` |
25
+ | `status` | string | `PENDING`, `IN_PROGRESS`, `COMPLETED`, `ARCHIVED` |
26
+ | `priority` | string | `CRITICAL`, `OPPORTUNITY_NOW`, `OVER_THE_HORIZON`, `PARKING_LOT` |
23
27
  | `projectId` | UUID | Filter by project |
24
28
  | `startDate` | date | Filter by start date (YYYY-MM-DD) |
25
29
  | `endDate` | date | Filter by end date (YYYY-MM-DD) |
@@ -27,13 +31,11 @@ GET /api/v2/unified-tasks
27
31
  | `offset` | number | Pagination offset (default: 0) |
28
32
 
29
33
  ```bash
30
- # List Critical Now tasks
31
34
  curl -H "X-API-KEY: $MYN_API_KEY" \
32
- "$MYN_API_URL/api/v2/unified-tasks?priority=CRITICAL&status=PENDING"
35
+ "$MYN_API_URL/api/v2/unified-tasks"
33
36
 
34
- # List tasks for a date range
35
37
  curl -H "X-API-KEY: $MYN_API_KEY" \
36
- "$MYN_API_URL/api/v2/unified-tasks?startDate=2026-03-01&endDate=2026-03-07"
38
+ "$MYN_API_URL/api/v2/unified-tasks?priority=CRITICAL&status=PENDING"
37
39
  ```
38
40
 
39
41
  ### Get Task
@@ -42,9 +44,11 @@ curl -H "X-API-KEY: $MYN_API_KEY" \
42
44
  GET /api/v2/unified-tasks/{taskId}
43
45
  ```
44
46
 
47
+ The response includes a `stateHash` field for use in write operations (MIN-740 read-before-write guard).
48
+
45
49
  ```bash
46
50
  curl -H "X-API-KEY: $MYN_API_KEY" \
47
- "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-446655440000"
51
+ "$MYN_API_URL/api/v2/unified-tasks/TASK_ID"
48
52
  ```
49
53
 
50
54
  ### Create Task
@@ -57,8 +61,7 @@ POST /api/v2/unified-tasks
57
61
 
58
62
  | Field | Type | Description |
59
63
  |-------|------|-------------|
60
- | `id` | UUID | Client-generated UUID |
61
- | `title` | string | Task title (1–200 chars) |
64
+ | `title` | string | Task title (1-200 chars) |
62
65
  | `taskType` | string | `TASK`, `HABIT`, or `CHORE` |
63
66
  | `priority` | string | `CRITICAL`, `OPPORTUNITY_NOW`, `OVER_THE_HORIZON`, `PARKING_LOT` |
64
67
  | `startDate` | date | Start date (YYYY-MM-DD) |
@@ -67,10 +70,15 @@ POST /api/v2/unified-tasks
67
70
 
68
71
  | Field | Type | Description |
69
72
  |-------|------|-------------|
73
+ | `id` | UUID | Optional (auto-generated if omitted). Do NOT fabricate UUIDs. |
70
74
  | `description` | string | Description (max 2000 chars) |
71
- | `duration` | string | Duration: `"30m"`, `"1h"`, `"1h30m"` (NOT ISO PT prefix) |
75
+ | `duration` | string | Duration: `"30m"`, `"1h"`, `"1h30m"` |
72
76
  | `projectId` | UUID | Assign to project |
73
77
  | `recurrenceRule` | string | RRULE for HABIT/CHORE types (**required** for HABIT and CHORE) |
78
+ | `isAutoScheduled` | boolean | Enable auto-scheduling (default: true). Only set false if user explicitly opts out. |
79
+ | `calendarId` | string | Calendar ID to link task to (e.g. "primary") |
80
+ | `calendarName` | string | Calendar name to resolve (e.g. "Family", "Work"). Used instead of calendarId. |
81
+ | `scheduleNames` | string[] | Schedule names to assign (e.g. `["Morning"]`, `["Weekday Evening", "Weekend Morning"]`). Resolved to IDs automatically. |
74
82
 
75
83
  **Type-Specific Rules:**
76
84
 
@@ -84,13 +92,14 @@ curl -X POST "$MYN_API_URL/api/v2/unified-tasks" \
84
92
  -H "X-API-KEY: $MYN_API_KEY" \
85
93
  -H "Content-Type: application/json" \
86
94
  -d '{
87
- "id": "550e8400-e29b-41d4-a716-446655440000",
88
95
  "title": "Prepare quarterly report",
89
96
  "taskType": "TASK",
90
97
  "priority": "CRITICAL",
91
98
  "startDate": "2026-03-01",
92
99
  "duration": "2h",
93
- "description": "Q1 financials and projections"
100
+ "description": "Q1 financials and projections",
101
+ "isAutoScheduled": true,
102
+ "scheduleNames": ["Morning"]
94
103
  }'
95
104
 
96
105
  # Create a habit
@@ -98,7 +107,6 @@ curl -X POST "$MYN_API_URL/api/v2/unified-tasks" \
98
107
  -H "X-API-KEY: $MYN_API_KEY" \
99
108
  -H "Content-Type: application/json" \
100
109
  -d '{
101
- "id": "660e8400-e29b-41d4-a716-446655440001",
102
110
  "title": "Morning meditation",
103
111
  "taskType": "HABIT",
104
112
  "priority": "OPPORTUNITY_NOW",
@@ -114,11 +122,17 @@ curl -X POST "$MYN_API_URL/api/v2/unified-tasks" \
114
122
  PATCH /api/v2/unified-tasks/{taskId}
115
123
  ```
116
124
 
117
- Send only the fields to update:
125
+ **Uses read-before-write guard** (MIN-740). Reads task first to get `stateHash`, retries on 409.
126
+
127
+ Send only the fields to update via the `updates` object. Allowed fields: `title`, `description`, `priority`, `status`, `startDate`, `endDate`, `duration`, `projectId`, `recurrenceRule`, `isAutoScheduled`, `calendarId`, `location`, `notes`, `tags`, `estimatedMinutes`, `actualMinutes`, `completedAt`, `archivedAt`, `taskType`, `assignedTo`, `scheduledAt`, `dueDate`.
118
128
 
119
129
  ```bash
120
- curl -X PATCH "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-446655440000" \
130
+ HASH=$(curl -s -H "X-API-KEY: $MYN_API_KEY" \
131
+ "$MYN_API_URL/api/v2/unified-tasks/TASK_ID" | jq -r .stateHash)
132
+
133
+ curl -X PATCH "$MYN_API_URL/api/v2/unified-tasks/TASK_ID" \
121
134
  -H "X-API-KEY: $MYN_API_KEY" \
135
+ -H "X-MYN-State-Hash: $HASH" \
122
136
  -H "Content-Type: application/json" \
123
137
  -d '{"priority": "OPPORTUNITY_NOW", "startDate": "2026-03-05"}'
124
138
  ```
@@ -129,9 +143,15 @@ curl -X PATCH "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-4466554
129
143
  POST /api/v2/unified-tasks/{taskId}/complete
130
144
  ```
131
145
 
146
+ **Uses read-before-write guard** (MIN-740).
147
+
132
148
  ```bash
133
- curl -X POST "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-446655440000/complete" \
149
+ HASH=$(curl -s -H "X-API-KEY: $MYN_API_KEY" \
150
+ "$MYN_API_URL/api/v2/unified-tasks/TASK_ID" | jq -r .stateHash)
151
+
152
+ curl -X POST "$MYN_API_URL/api/v2/unified-tasks/TASK_ID/complete" \
134
153
  -H "X-API-KEY: $MYN_API_KEY" \
154
+ -H "X-MYN-State-Hash: $HASH" \
135
155
  -H "Content-Type: application/json" \
136
156
  -d '{}'
137
157
  ```
@@ -142,8 +162,10 @@ curl -X POST "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-44665544
142
162
  POST /api/v2/unified-tasks/{taskId}/archive
143
163
  ```
144
164
 
165
+ **Uses read-before-write guard** (MIN-740).
166
+
145
167
  ```bash
146
- curl -X POST "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-446655440000/archive" \
168
+ curl -X POST "$MYN_API_URL/api/v2/unified-tasks/TASK_ID/archive" \
147
169
  -H "X-API-KEY: $MYN_API_KEY" \
148
170
  -H "Content-Type: application/json" \
149
171
  -d '{}'
@@ -157,31 +179,16 @@ GET /api/v2/search
157
179
 
158
180
  See [search-api.md](search-api.md) for full search documentation.
159
181
 
160
- ```bash
161
- curl -H "X-API-KEY: $MYN_API_KEY" \
162
- "$MYN_API_URL/api/v2/search?q=quarterly+report&limit=10"
163
- ```
164
-
165
- ### Get Habit Streak
182
+ **Query Parameters:**
166
183
 
167
- ```
168
- GET /api/v2/unified-tasks/{taskId}/streak
169
- ```
184
+ | Parameter | Type | Description |
185
+ |-----------|------|-------------|
186
+ | `q` | string | Search query |
187
+ | `includeArchived` | boolean | Include archived results (default: false) |
188
+ | `limit` | number | Max results (default: 20) |
189
+ | `offset` | number | Pagination offset (default: 0) |
170
190
 
171
191
  ```bash
172
192
  curl -H "X-API-KEY: $MYN_API_KEY" \
173
- "$MYN_API_URL/api/v2/unified-tasks/660e8400-e29b-41d4-a716-446655440001/streak"
174
- ```
175
-
176
- ### Move Task to Project
177
-
178
- ```
179
- PUT /api/v2/unified-tasks/{taskId}/project
180
- ```
181
-
182
- ```bash
183
- curl -X PUT "$MYN_API_URL/api/v2/unified-tasks/550e8400-e29b-41d4-a716-446655440000/project" \
184
- -H "X-API-KEY: $MYN_API_KEY" \
185
- -H "Content-Type: application/json" \
186
- -d '{"projectId": "770e8400-e29b-41d4-a716-446655440002"}'
193
+ "$MYN_API_URL/api/v2/search?q=quarterly+report&limit=10"
187
194
  ```