@davidwoods/skylight-mcp 1.8.4 → 1.8.6
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/LICENSE +22 -22
- package/README.md +637 -637
- package/THIRD_PARTY_NOTICES.md +38 -38
- package/dist/api/endpoints/meals.d.ts +48 -5
- package/dist/api/endpoints/meals.d.ts.map +1 -1
- package/dist/api/endpoints/meals.js +134 -15
- package/dist/api/endpoints/meals.js.map +1 -1
- package/dist/cli.js +5 -5
- package/dist/config.js +23 -23
- package/dist/tools/calendar.js +56 -56
- package/dist/tools/chores.js +66 -66
- package/dist/tools/family.js +17 -17
- package/dist/tools/lists.js +87 -87
- package/dist/tools/meals.d.ts.map +1 -1
- package/dist/tools/meals.js +214 -111
- package/dist/tools/meals.js.map +1 -1
- package/dist/tools/messages.js +32 -32
- package/dist/tools/misc.js +14 -14
- package/dist/tools/photos.js +6 -6
- package/dist/tools/planning.js +18 -18
- package/dist/tools/rewards.js +70 -70
- package/dist/tools/tasks.js +13 -13
- package/dist/utils/errors.js +16 -16
- package/package.json +78 -78
package/THIRD_PARTY_NOTICES.md
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
# Third-party notices
|
|
2
|
-
|
|
3
|
-
## TheEagleByte/skylight-mcp
|
|
4
|
-
|
|
5
|
-
This project is a fork of <https://github.com/TheEagleByte/skylight-mcp>, used
|
|
6
|
-
under the MIT License. See `LICENSE`.
|
|
7
|
-
|
|
8
|
-
## kamilio/skylight-calendar-agent
|
|
9
|
-
|
|
10
|
-
The browser-paste OAuth sign-in flow and the Keychain-backed encrypted
|
|
11
|
-
credential store in `src/api/oauth.ts` and `src/api/credential-store.ts` were
|
|
12
|
-
designed after the corresponding parts of
|
|
13
|
-
<https://github.com/kamilio/skylight-calendar-agent>. No code was copied
|
|
14
|
-
verbatim, but the approach is theirs. That project is licensed as follows:
|
|
15
|
-
|
|
16
|
-
```
|
|
17
|
-
MIT License
|
|
18
|
-
|
|
19
|
-
Copyright (c) 2026 Kamil Jopek
|
|
20
|
-
|
|
21
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
23
|
-
in the Software without restriction, including without limitation the rights
|
|
24
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
26
|
-
furnished to do so, subject to the following conditions:
|
|
27
|
-
|
|
28
|
-
The above copyright notice and this permission notice shall be included in all
|
|
29
|
-
copies or substantial portions of the Software.
|
|
30
|
-
|
|
31
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
|
-
SOFTWARE.
|
|
38
|
-
```
|
|
1
|
+
# Third-party notices
|
|
2
|
+
|
|
3
|
+
## TheEagleByte/skylight-mcp
|
|
4
|
+
|
|
5
|
+
This project is a fork of <https://github.com/TheEagleByte/skylight-mcp>, used
|
|
6
|
+
under the MIT License. See `LICENSE`.
|
|
7
|
+
|
|
8
|
+
## kamilio/skylight-calendar-agent
|
|
9
|
+
|
|
10
|
+
The browser-paste OAuth sign-in flow and the Keychain-backed encrypted
|
|
11
|
+
credential store in `src/api/oauth.ts` and `src/api/credential-store.ts` were
|
|
12
|
+
designed after the corresponding parts of
|
|
13
|
+
<https://github.com/kamilio/skylight-calendar-agent>. No code was copied
|
|
14
|
+
verbatim, but the approach is theirs. That project is licensed as follows:
|
|
15
|
+
|
|
16
|
+
```
|
|
17
|
+
MIT License
|
|
18
|
+
|
|
19
|
+
Copyright (c) 2026 Kamil Jopek
|
|
20
|
+
|
|
21
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
22
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
23
|
+
in the Software without restriction, including without limitation the rights
|
|
24
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
25
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
26
|
+
furnished to do so, subject to the following conditions:
|
|
27
|
+
|
|
28
|
+
The above copyright notice and this permission notice shall be included in all
|
|
29
|
+
copies or substantial portions of the Software.
|
|
30
|
+
|
|
31
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
32
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
33
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
34
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
35
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
36
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
37
|
+
SOFTWARE.
|
|
38
|
+
```
|
|
@@ -111,7 +111,13 @@ export interface CreateMealSittingOptions {
|
|
|
111
111
|
/** Free-text meal name. Either this or recipeId should be given. */
|
|
112
112
|
summary?: string;
|
|
113
113
|
recipeId?: string;
|
|
114
|
+
/** Repeat weekly on the weekday of `date`. Only this shape was captured. */
|
|
115
|
+
repeat?: "weekly";
|
|
114
116
|
}
|
|
117
|
+
/** Weekday code (SU..SA) of a YYYY-MM-DD date, independent of time zone. */
|
|
118
|
+
export declare function weekdayCode(date: string): string;
|
|
119
|
+
/** The rule the web app sends for "repeats every 1 week on <weekday>". */
|
|
120
|
+
export declare function weeklyRrule(date: string): string;
|
|
115
121
|
/**
|
|
116
122
|
* Create a meal sitting (schedule a meal)
|
|
117
123
|
*/
|
|
@@ -130,6 +136,28 @@ export declare function assertIsoDate(date: string): string;
|
|
|
130
136
|
* version so recurring/rrule fields are present for the one-off guard.
|
|
131
137
|
*/
|
|
132
138
|
export declare function findMealSitting(sittingId: string, date: string): Promise<MealSittingResource | null>;
|
|
139
|
+
export type MealKind = "one-off" | "series" | "detached";
|
|
140
|
+
/**
|
|
141
|
+
* one-off: not repeating. series: carries an rrule. detached: an occurrence
|
|
142
|
+
* that was edited on its own; it has no rrule but still reports
|
|
143
|
+
* `recurring: true` (captured 2026-11-01).
|
|
144
|
+
*/
|
|
145
|
+
export declare function mealKind(sitting: MealSittingResource): MealKind;
|
|
146
|
+
export type MealDeleteScope = "one" | "future" | "all";
|
|
147
|
+
export type MealEditScope = "one" | "future" | "all";
|
|
148
|
+
/** How far back the series start is searched for. A series older than this cannot be edited with scope "all". */
|
|
149
|
+
export declare const SERIES_START_WINDOW_DAYS = 1825;
|
|
150
|
+
/**
|
|
151
|
+
* Skylight does not expose a series' start date on the resource (captured live
|
|
152
|
+
* 2026-11-02: attributes are description, draft, instances, note, recurring,
|
|
153
|
+
* rrule, summary). An edit with apply_to=all moves the series start to the body
|
|
154
|
+
* date, silently dropping earlier occurrences, so the body must carry the real
|
|
155
|
+
* start. The earliest instance over a wide read window is that start, provided
|
|
156
|
+
* the window reaches back past it. If the earliest instance sits within two
|
|
157
|
+
* weeks of the window's edge the start may be earlier still, so return null and
|
|
158
|
+
* let the caller refuse rather than guess.
|
|
159
|
+
*/
|
|
160
|
+
export declare function findSeriesStart(sittingId: string, date: string): Promise<string | null>;
|
|
133
161
|
export interface UpdateMealSittingOptions {
|
|
134
162
|
existing: MealSittingResource;
|
|
135
163
|
/** The occurrence being edited (its current date). */
|
|
@@ -139,16 +167,31 @@ export interface UpdateMealSittingOptions {
|
|
|
139
167
|
summary?: string;
|
|
140
168
|
note?: string;
|
|
141
169
|
mealCategoryId?: string;
|
|
170
|
+
/** Required for a repeating meal: which occurrences the change applies to. */
|
|
171
|
+
scope?: MealEditScope;
|
|
172
|
+
/** For scope "all": the series' original start date, from findSeriesStart. */
|
|
173
|
+
seriesStart?: string;
|
|
174
|
+
}
|
|
175
|
+
export interface MealUpdateResult {
|
|
176
|
+
/**
|
|
177
|
+
* The sitting that now holds the edited occurrence. For a one-off or scope
|
|
178
|
+
* "all" it is the same id. For "one" (a detached copy) and "future" (a split)
|
|
179
|
+
* Skylight issues a new id; null if the response did not show it.
|
|
180
|
+
*/
|
|
181
|
+
sittingId: string | null;
|
|
142
182
|
}
|
|
143
183
|
/**
|
|
144
|
-
* Edit a
|
|
184
|
+
* Edit a sitting the way the web app does: PATCH the whole form to
|
|
145
185
|
* /meals/sittings/{id}/instances/{currentDate}. Fields not being changed are
|
|
146
186
|
* sent back as they are, because the API takes the full form.
|
|
147
187
|
*/
|
|
148
|
-
export declare function updateMealSitting(options: UpdateMealSittingOptions): Promise<
|
|
188
|
+
export declare function updateMealSitting(options: UpdateMealSittingOptions): Promise<MealUpdateResult>;
|
|
149
189
|
/**
|
|
150
|
-
* Delete a
|
|
151
|
-
*
|
|
190
|
+
* Delete a sitting: DELETE /meals/sittings/{id}/instances/{date}, no body.
|
|
191
|
+
* A one-off sends no scope. A repeating series sends `apply_to` (captured
|
|
192
|
+
* 2026-11-01): `one` excludes that date, `future` ends the series before it,
|
|
193
|
+
* `all` removes the whole series. A detached occurrence is refused.
|
|
194
|
+
* Returns whether Skylight's response confirms the removal.
|
|
152
195
|
*/
|
|
153
|
-
export declare function deleteMealSitting(existing: MealSittingResource, date: string): Promise<boolean>;
|
|
196
|
+
export declare function deleteMealSitting(existing: MealSittingResource, date: string, scope?: MealDeleteScope): Promise<boolean>;
|
|
154
197
|
//# sourceMappingUR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DAAsD;IACtD,IAAI,EAAE,MAAM,CAAC;IACb,kCAAkC;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,8EAA8E;IAC9E,KAAK,CAAC,EAAE,aAAa,CAAC;IACtB,8EAA8E;IAC9E,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,gBAAgB;IAC/B;;;;OAIG;IACH,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;CAC1B;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CAAC,OAAO,EAAE,wBAAwB,GAAG,OAAO,CAAC,gBAAgB,CAAC,CAgDpG;AAED;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,QAAQ,EAAE,mBAAmB,EAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,GAAE,eAAuB,GAC7B,OAAO,CAAC,OAAO,CAAC,CAoBlB"}
|
|
@@ -87,6 +87,17 @@ export async function getMealSittings(options = {}) {
|
|
|
87
87
|
const response = await client.get("/api/frames/{frameId}/meals/sittings", params);
|
|
88
88
|
return response.data;
|
|
89
89
|
}
|
|
90
|
+
const WEEKDAY_CODES = ["SU", "MO", "TU", "WE", "TH", "FR", "SA"];
|
|
91
|
+
/** Weekday code (SU..SA) of a YYYY-MM-DD date, independent of time zone. */
|
|
92
|
+
export function weekdayCode(date) {
|
|
93
|
+
assertIsoDate(date);
|
|
94
|
+
const [y, m, d] = date.split("-").map(Number);
|
|
95
|
+
return WEEKDAY_CODES[new Date(Date.UTC(y, m - 1, d)).getUTCDay()];
|
|
96
|
+
}
|
|
97
|
+
/** The rule the web app sends for "repeats every 1 week on <weekday>". */
|
|
98
|
+
export function weeklyRrule(date) {
|
|
99
|
+
return `FREQ=WEEKLY;INTERVAL=1;WKST=SU;BYDAY=${weekdayCode(date)}`;
|
|
100
|
+
}
|
|
90
101
|
/**
|
|
91
102
|
* Create a meal sitting (schedule a meal)
|
|
92
103
|
*/
|
|
@@ -102,6 +113,27 @@ export async function createMealSitting(options) {
|
|
|
102
113
|
if (options.recipeId) {
|
|
103
114
|
body.meal_recipe_id = options.recipeId;
|
|
104
115
|
}
|
|
116
|
+
if (options.repeat === "weekly") {
|
|
117
|
+
// A repeating create sends the web app's whole form (captured 2026-11-01).
|
|
118
|
+
// Not verified live from this code path: the body shape and API version.
|
|
119
|
+
const form = {
|
|
120
|
+
date: options.date,
|
|
121
|
+
summary: options.summary ?? "",
|
|
122
|
+
description: "",
|
|
123
|
+
note: "",
|
|
124
|
+
meal_category_id: options.mealCategoryId,
|
|
125
|
+
meal_recipe_id: options.recipeId ?? null,
|
|
126
|
+
profile_ids: [],
|
|
127
|
+
rrule: weeklyRrule(options.date),
|
|
128
|
+
add_to_grocery_list: false,
|
|
129
|
+
saveToRecipeBox: false,
|
|
130
|
+
};
|
|
131
|
+
const created = await client.request("/api/frames/{frameId}/meals/sittings", { method: "POST", body: form, apiVersion: MEAL_EDIT_API_VERSION });
|
|
132
|
+
const first = Array.isArray(created.data) ? created.data[0] : created.data;
|
|
133
|
+
if (!first)
|
|
134
|
+
throw new Error("Skylight returned an empty response when creating the repeating meal");
|
|
135
|
+
return first;
|
|
136
|
+
}
|
|
105
137
|
// The API answers a create with a list envelope (one element), unlike GET by id.
|
|
106
138
|
const response = await client.post("/api/frames/{frameId}/meals/sittings", body);
|
|
107
139
|
const data = Array.isArray(response.data) ? response.data[0] : response.data;
|
|
@@ -149,28 +181,93 @@ export async function findMealSitting(sittingId, date) {
|
|
|
149
181
|
});
|
|
150
182
|
return (response.data ?? []).find((s) => s.id === sittingId && s.attributes.instances?.includes(date)) ?? null;
|
|
151
183
|
}
|
|
152
|
-
/**
|
|
153
|
-
|
|
184
|
+
/**
|
|
185
|
+
* one-off: not repeating. series: carries an rrule. detached: an occurrence
|
|
186
|
+
* that was edited on its own; it has no rrule but still reports
|
|
187
|
+
* `recurring: true` (captured 2026-11-01).
|
|
188
|
+
*/
|
|
189
|
+
export function mealKind(sitting) {
|
|
154
190
|
const a = sitting.attributes;
|
|
155
|
-
if (a.
|
|
156
|
-
|
|
191
|
+
if (a.rrule)
|
|
192
|
+
return "series";
|
|
193
|
+
if (a.recurring === true)
|
|
194
|
+
return "detached";
|
|
195
|
+
return "one-off";
|
|
196
|
+
}
|
|
197
|
+
/** A one-off is the only kind that can be edited without a scope; detached occurrences are never edited here. */
|
|
198
|
+
function assertOneOff(sitting) {
|
|
199
|
+
const kind = mealKind(sitting);
|
|
200
|
+
if (kind === "detached") {
|
|
201
|
+
throw new Error("This occurrence was edited on its own and is now a standalone meal that Skylight still marks as repeating. It cannot be edited here; use the Skylight app.");
|
|
202
|
+
}
|
|
203
|
+
if (kind === "series") {
|
|
204
|
+
throw new Error("This meal repeats. Say which occurrences to change with scope: one, future or all.");
|
|
157
205
|
}
|
|
158
206
|
}
|
|
207
|
+
/** How far back the series start is searched for. A series older than this cannot be edited with scope "all". */
|
|
208
|
+
export const SERIES_START_WINDOW_DAYS = 1825;
|
|
159
209
|
/**
|
|
160
|
-
*
|
|
210
|
+
* Skylight does not expose a series' start date on the resource (captured live
|
|
211
|
+
* 2026-11-02: attributes are description, draft, instances, note, recurring,
|
|
212
|
+
* rrule, summary). An edit with apply_to=all moves the series start to the body
|
|
213
|
+
* date, silently dropping earlier occurrences, so the body must carry the real
|
|
214
|
+
* start. The earliest instance over a wide read window is that start, provided
|
|
215
|
+
* the window reaches back past it. If the earliest instance sits within two
|
|
216
|
+
* weeks of the window's edge the start may be earlier still, so return null and
|
|
217
|
+
* let the caller refuse rather than guess.
|
|
218
|
+
*/
|
|
219
|
+
export async function findSeriesStart(sittingId, date) {
|
|
220
|
+
assertSittingId(sittingId);
|
|
221
|
+
assertIsoDate(date);
|
|
222
|
+
const from = addDays(date, -SERIES_START_WINDOW_DAYS);
|
|
223
|
+
const response = await getClient().request("/api/frames/{frameId}/meals/sittings", {
|
|
224
|
+
method: "GET",
|
|
225
|
+
params: { date_min: from, date_max: addDays(date, 1), include: "meal_category,meal_recipe,profiles" },
|
|
226
|
+
apiVersion: MEAL_EDIT_API_VERSION,
|
|
227
|
+
});
|
|
228
|
+
const found = (response.data ?? []).find((x) => x.id === sittingId);
|
|
229
|
+
const first = [...(found?.attributes.instances ?? [])].sort()[0];
|
|
230
|
+
if (!first)
|
|
231
|
+
return null;
|
|
232
|
+
if (first < addDays(from, 14))
|
|
233
|
+
return null;
|
|
234
|
+
return first;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Edit a sitting the way the web app does: PATCH the whole form to
|
|
161
238
|
* /meals/sittings/{id}/instances/{currentDate}. Fields not being changed are
|
|
162
239
|
* sent back as they are, because the API takes the full form.
|
|
163
240
|
*/
|
|
164
241
|
export async function updateMealSitting(options) {
|
|
165
242
|
const { existing } = options;
|
|
166
|
-
|
|
243
|
+
const kind = mealKind(existing);
|
|
167
244
|
const date = assertIsoDate(options.date);
|
|
168
245
|
const target = assertIsoDate(options.newDate ?? date);
|
|
246
|
+
let scope;
|
|
247
|
+
let bodyDate = target;
|
|
248
|
+
if (kind === "series") {
|
|
249
|
+
scope = options.scope;
|
|
250
|
+
if (!scope)
|
|
251
|
+
assertOneOff(existing);
|
|
252
|
+
if (target !== date) {
|
|
253
|
+
throw new Error("Moving an occurrence of a repeating meal to another day is not supported here; use the Skylight app.");
|
|
254
|
+
}
|
|
255
|
+
if (scope === "all") {
|
|
256
|
+
// The body date becomes the series' start. Anything but the real start deletes history.
|
|
257
|
+
if (!options.seriesStart) {
|
|
258
|
+
throw new Error("Cannot edit the whole series: its start date could not be determined, and guessing would delete earlier occurrences.");
|
|
259
|
+
}
|
|
260
|
+
bodyDate = assertIsoDate(options.seriesStart);
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
assertOneOff(existing);
|
|
265
|
+
}
|
|
169
266
|
const a = existing.attributes;
|
|
170
267
|
const payload = {
|
|
171
|
-
date:
|
|
268
|
+
date: bodyDate,
|
|
172
269
|
note: options.note ?? (typeof a.note === "string" ? a.note : ""),
|
|
173
|
-
rrule: null,
|
|
270
|
+
rrule: kind === "series" ? a.rrule : null,
|
|
174
271
|
summary: options.summary ?? a.summary ?? "",
|
|
175
272
|
description: typeof a.description === "string" ? a.description : "",
|
|
176
273
|
meal_category_id: options.mealCategoryId ?? existing.relationships?.meal_category?.data?.id ?? null,
|
|
@@ -178,17 +275,39 @@ export async function updateMealSitting(options) {
|
|
|
178
275
|
profile_ids: (existing.relationships?.profiles?.data ?? []).map((p) => p.id),
|
|
179
276
|
saveToRecipeBox: false,
|
|
180
277
|
};
|
|
181
|
-
|
|
278
|
+
const params = instanceQuery(date);
|
|
279
|
+
if (scope)
|
|
280
|
+
params.apply_to = scope;
|
|
281
|
+
const response = await getClient().request(`/api/frames/{frameId}/meals/sittings/${assertSittingId(existing.id)}/instances/${date}`, { method: "PATCH", body: payload, params, apiVersion: MEAL_EDIT_API_VERSION });
|
|
282
|
+
if (scope === "one" || scope === "future") {
|
|
283
|
+
const moved = (response.data ?? []).find((x) => x.id !== existing.id && x.attributes.instances?.includes(date));
|
|
284
|
+
return { sittingId: moved?.id ?? null };
|
|
285
|
+
}
|
|
286
|
+
return { sittingId: existing.id };
|
|
182
287
|
}
|
|
183
288
|
/**
|
|
184
|
-
* Delete a
|
|
185
|
-
*
|
|
289
|
+
* Delete a sitting: DELETE /meals/sittings/{id}/instances/{date}, no body.
|
|
290
|
+
* A one-off sends no scope. A repeating series sends `apply_to` (captured
|
|
291
|
+
* 2026-11-01): `one` excludes that date, `future` ends the series before it,
|
|
292
|
+
* `all` removes the whole series. A detached occurrence is refused.
|
|
293
|
+
* Returns whether Skylight's response confirms the removal.
|
|
186
294
|
*/
|
|
187
|
-
export async function deleteMealSitting(existing, date) {
|
|
188
|
-
assertOneOff(existing);
|
|
295
|
+
export async function deleteMealSitting(existing, date, scope = "one") {
|
|
189
296
|
assertIsoDate(date);
|
|
190
297
|
const id = assertSittingId(existing.id);
|
|
191
|
-
const
|
|
192
|
-
|
|
298
|
+
const kind = mealKind(existing);
|
|
299
|
+
if (kind === "detached") {
|
|
300
|
+
throw new Error("This occurrence was edited on its own and is detached from its series. Deleting it is not supported here; use the Skylight app.");
|
|
301
|
+
}
|
|
302
|
+
const params = instanceQuery(date);
|
|
303
|
+
if (kind === "series")
|
|
304
|
+
params.apply_to = scope;
|
|
305
|
+
const response = await getClient().request(`/api/frames/{frameId}/meals/sittings/${id}/instances/${date}`, { method: "DELETE", params, apiVersion: MEAL_EDIT_API_VERSION });
|
|
306
|
+
const deleted = (response?.meta?.deleted_sitting_ids ?? []).map(String).includes(id);
|
|
307
|
+
if (kind === "one-off" || scope === "all")
|
|
308
|
+
return deleted;
|
|
309
|
+
// one / future leave the series in place: it is returned without the date.
|
|
310
|
+
const left = (response.data ?? []).find((s) => s.id === id);
|
|
311
|
+
return !!left && !(left.attributes.instances ?? []).includes(date);
|
|
193
312
|
}
|
|
194
313
|
//# sourceMappingURL=meals.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meals.js","sourceRoot":"","sources":["../../../src/api/endpoints/meals.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,MAAM,yBAAyB,CAAC;AAgBlD,qEAAqE;AACrE,MAAM,UAAU,gBAAgB,CAAC,QAA8B;IAC7D,OAAO,QAAQ,CAAC,UAAU,CAAC,KAAK,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,IAAI,SAAS,CAAC;AAC5E,CAAC;AA0DD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB;IACrC,MAAM,MAAM,GAAG,SAAS,EAAE,CAAC;IAC3B,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,GAAG,CAC/B,wCAAwC,CACzC,CAAC;IACF,OAAO,QAAQ,CAAC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+30,11 @@ function defaultDeps() {
|
|
|
30
30
|
now: () => Date.now(),
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
const USAGE = `Usage: skylight-mcp auth <command>
|
|
34
|
-
|
|
35
|
-
login Print a Skylight sign-in URL. Open it in your browser.
|
|
36
|
-
complete [url] After signing in, paste the final URL (https://ourskylight.com/welcome?...).
|
|
37
|
-
status Show whether you are signed in.
|
|
33
|
+
const USAGE = `Usage: skylight-mcp auth <command>
|
|
34
|
+
|
|
35
|
+
login Print a Skylight sign-in URL. Open it in your browser.
|
|
36
|
+
complete [url] After signing in, paste the final URL (https://ourskylight.com/welcome?...).
|
|
37
|
+
status Show whether you are signed in.
|
|
38
38
|
logout Remove the stored credential.`;
|
|
39
39
|
export async function runAuthCommand(args, overrides = {}) {
|
|
40
40
|
const deps = { ...defaultDeps(), ...overrides };
|
package/dist/config.js
CHANGED
|
@@ -29,29 +29,29 @@ export function loadConfig() {
|
|
|
29
29
|
});
|
|
30
30
|
if (!result.success) {
|
|
31
31
|
const errors = result.error.issues.map((e) => ` - ${e.message}`).join("\n");
|
|
32
|
-
console.error(`
|
|
33
|
-
Skylight MCP Server - Configuration Error
|
|
34
|
-
|
|
35
|
-
Missing or invalid configuration:
|
|
36
|
-
${errors}
|
|
37
|
-
|
|
38
|
-
Authentication (recommended): run "skylight-mcp auth login" once. You sign in
|
|
39
|
-
in your own browser; your password is never given to this program.
|
|
40
|
-
|
|
41
|
-
Deprecated alternatives:
|
|
42
|
-
SKYLIGHT_EMAIL / SKYLIGHT_PASSWORD - stores your password in the MCP config
|
|
43
|
-
SKYLIGHT_TOKEN / SKYLIGHT_AUTH_TYPE - a manually captured token
|
|
44
|
-
|
|
45
|
-
Required:
|
|
46
|
-
SKYLIGHT_FRAME_ID - Your frame/household ID
|
|
47
|
-
|
|
48
|
-
Optional:
|
|
49
|
-
SKYLIGHT_TIMEZONE - Timezone for dates (default: America/New_York)
|
|
50
|
-
|
|
51
|
-
To find your frame ID:
|
|
52
|
-
1. Log in to the Skylight app
|
|
53
|
-
2. Use a proxy tool to capture API traffic
|
|
54
|
-
3. Look for the frame ID in URLs like /api/frames/{frameId}/chores
|
|
32
|
+
console.error(`
|
|
33
|
+
Skylight MCP Server - Configuration Error
|
|
34
|
+
|
|
35
|
+
Missing or invalid configuration:
|
|
36
|
+
${errors}
|
|
37
|
+
|
|
38
|
+
Authentication (recommended): run "skylight-mcp auth login" once. You sign in
|
|
39
|
+
in your own browser; your password is never given to this program.
|
|
40
|
+
|
|
41
|
+
Deprecated alternatives:
|
|
42
|
+
SKYLIGHT_EMAIL / SKYLIGHT_PASSWORD - stores your password in the MCP config
|
|
43
|
+
SKYLIGHT_TOKEN / SKYLIGHT_AUTH_TYPE - a manually captured token
|
|
44
|
+
|
|
45
|
+
Required:
|
|
46
|
+
SKYLIGHT_FRAME_ID - Your frame/household ID
|
|
47
|
+
|
|
48
|
+
Optional:
|
|
49
|
+
SKYLIGHT_TIMEZONE - Timezone for dates (default: America/New_York)
|
|
50
|
+
|
|
51
|
+
To find your frame ID:
|
|
52
|
+
1. Log in to the Skylight app
|
|
53
|
+
2. Use a proxy tool to capture API traffic
|
|
54
|
+
3. Look for the frame ID in URLs like /api/frames/{frameId}/chores
|
|
55
55
|
`);
|
|
56
56
|
process.exit(1);
|
|
57
57
|
// process.exit never returns in Node; this satisfies runtimes whose types disagree.
|
package/dist/tools/calendar.js
CHANGED
|
@@ -46,13 +46,13 @@ export function formatEventForTool(event, labelById) {
|
|
|
46
46
|
}
|
|
47
47
|
export function registerCalendarTools(server) {
|
|
48
48
|
// get_calendar_events tool
|
|
49
|
-
server.tool("get_calendar_events", `Get calendar events from Skylight.
|
|
50
|
-
|
|
51
|
-
Use this to answer questions like:
|
|
52
|
-
- "What's on my calendar today?"
|
|
53
|
-
- "What do we have scheduled this weekend?"
|
|
54
|
-
- "Are there any events on Friday?"
|
|
55
|
-
|
|
49
|
+
server.tool("get_calendar_events", `Get calendar events from Skylight.
|
|
50
|
+
|
|
51
|
+
Use this to answer questions like:
|
|
52
|
+
- "What's on my calendar today?"
|
|
53
|
+
- "What do we have scheduled this weekend?"
|
|
54
|
+
- "Are there any events on Friday?"
|
|
55
|
+
|
|
56
56
|
Returns a list of events with their titles, times, and details.`, {
|
|
57
57
|
date: z
|
|
58
58
|
.string()
|
|
@@ -121,12 +121,12 @@ Returns a list of events with their titles, times, and details.`, {
|
|
|
121
121
|
}
|
|
122
122
|
});
|
|
123
123
|
// get_source_calendars tool
|
|
124
|
-
server.tool("get_source_calendars", `Get connected calendar sources synced to Skylight.
|
|
125
|
-
|
|
126
|
-
Use this to answer:
|
|
127
|
-
- "Which calendars are synced to Skylight?"
|
|
128
|
-
- "What calendar accounts are connected?"
|
|
129
|
-
|
|
124
|
+
server.tool("get_source_calendars", `Get connected calendar sources synced to Skylight.
|
|
125
|
+
|
|
126
|
+
Use this to answer:
|
|
127
|
+
- "Which calendars are synced to Skylight?"
|
|
128
|
+
- "What calendar accounts are connected?"
|
|
129
|
+
|
|
130
130
|
Returns a list of connected calendar sources (Google, iCloud, etc.).`, {}, async () => {
|
|
131
131
|
try {
|
|
132
132
|
const calendars = await getSourceCalendars();
|
|
@@ -175,24 +175,24 @@ Returns a list of connected calendar sources (Google, iCloud, etc.).`, {}, async
|
|
|
175
175
|
}
|
|
176
176
|
});
|
|
177
177
|
// create_calendar_event tool
|
|
178
|
-
server.tool("create_calendar_event", `Create a new calendar event in Skylight.
|
|
179
|
-
|
|
180
|
-
Use this when:
|
|
181
|
-
- Scheduling a new event: "Add a dentist appointment on Friday at 2pm"
|
|
182
|
-
- Creating family activities: "Schedule soccer practice every Saturday at 10am"
|
|
183
|
-
- Adding reminders: "Put Mom's birthday on the calendar"
|
|
184
|
-
|
|
185
|
-
Parameters:
|
|
186
|
-
- summary (required): Event title (e.g., "Dentist Appointment")
|
|
187
|
-
- startsAt (required): Start time in ISO format or natural language
|
|
188
|
-
- endsAt (required): End time in ISO format or natural language
|
|
189
|
-
- allDay: Set to true for all-day events
|
|
190
|
-
- description: Additional notes for the event
|
|
191
|
-
- location: Where the event takes place
|
|
192
|
-
- profiles: Profile names to assign (e.g. ["Alex"]); categoryIds is the ID fallback
|
|
193
|
-
|
|
194
|
-
Returns: The created event details.
|
|
195
|
-
|
|
178
|
+
server.tool("create_calendar_event", `Create a new calendar event in Skylight.
|
|
179
|
+
|
|
180
|
+
Use this when:
|
|
181
|
+
- Scheduling a new event: "Add a dentist appointment on Friday at 2pm"
|
|
182
|
+
- Creating family activities: "Schedule soccer practice every Saturday at 10am"
|
|
183
|
+
- Adding reminders: "Put Mom's birthday on the calendar"
|
|
184
|
+
|
|
185
|
+
Parameters:
|
|
186
|
+
- summary (required): Event title (e.g., "Dentist Appointment")
|
|
187
|
+
- startsAt (required): Start time in ISO format or natural language
|
|
188
|
+
- endsAt (required): End time in ISO format or natural language
|
|
189
|
+
- allDay: Set to true for all-day events
|
|
190
|
+
- description: Additional notes for the event
|
|
191
|
+
- location: Where the event takes place
|
|
192
|
+
- profiles: Profile names to assign (e.g. ["Alex"]); categoryIds is the ID fallback
|
|
193
|
+
|
|
194
|
+
Returns: The created event details.
|
|
195
|
+
|
|
196
196
|
Related: get_family_members lists the profile names and IDs.`, {
|
|
197
197
|
summary: z.string().describe("Event title (e.g., 'Dentist Appointment')"),
|
|
198
198
|
startsAt: z.string().describe("Start time (ISO format like '2025-01-15T14:00:00')"),
|
|
@@ -236,22 +236,22 @@ Related: get_family_members lists the profile names and IDs.`, {
|
|
|
236
236
|
}
|
|
237
237
|
});
|
|
238
238
|
// update_calendar_event tool
|
|
239
|
-
server.tool("update_calendar_event", `Update an existing calendar event.
|
|
240
|
-
|
|
241
|
-
Use this when:
|
|
242
|
-
- Changing event time: "Move the dentist appointment to 3pm"
|
|
243
|
-
- Updating event details: "Add location to the meeting"
|
|
244
|
-
- Renaming an event: "Change 'Doctor' to 'Dr. Smith checkup'"
|
|
245
|
-
|
|
246
|
-
Parameters:
|
|
247
|
-
- eventId (required): ID of the event to update (from get_calendar_events)
|
|
248
|
-
- summary: New title for the event
|
|
249
|
-
- startsAt: New start time (ISO format)
|
|
250
|
-
- endsAt: New end time (ISO format)
|
|
251
|
-
- description: Updated notes
|
|
252
|
-
- location: Updated location
|
|
253
|
-
- categoryIds: Updated family member assignments
|
|
254
|
-
|
|
239
|
+
server.tool("update_calendar_event", `Update an existing calendar event.
|
|
240
|
+
|
|
241
|
+
Use this when:
|
|
242
|
+
- Changing event time: "Move the dentist appointment to 3pm"
|
|
243
|
+
- Updating event details: "Add location to the meeting"
|
|
244
|
+
- Renaming an event: "Change 'Doctor' to 'Dr. Smith checkup'"
|
|
245
|
+
|
|
246
|
+
Parameters:
|
|
247
|
+
- eventId (required): ID of the event to update (from get_calendar_events)
|
|
248
|
+
- summary: New title for the event
|
|
249
|
+
- startsAt: New start time (ISO format)
|
|
250
|
+
- endsAt: New end time (ISO format)
|
|
251
|
+
- description: Updated notes
|
|
252
|
+
- location: Updated location
|
|
253
|
+
- categoryIds: Updated family member assignments
|
|
254
|
+
|
|
255
255
|
Returns: The updated event details.`, {
|
|
256
256
|
eventId: z.string().describe("ID of the event to update"),
|
|
257
257
|
summary: z.string().optional().describe("New event title"),
|
|
@@ -302,15 +302,15 @@ Returns: The updated event details.`, {
|
|
|
302
302
|
}
|
|
303
303
|
});
|
|
304
304
|
// delete_calendar_event tool
|
|
305
|
-
server.tool("delete_calendar_event", `Delete a calendar event from Skylight.
|
|
306
|
-
|
|
307
|
-
Use this when:
|
|
308
|
-
- Canceling an event: "Remove the dentist appointment"
|
|
309
|
-
- Deleting old events: "Delete the meeting from yesterday"
|
|
310
|
-
|
|
311
|
-
Parameters:
|
|
312
|
-
- eventId (required): ID of the event to delete (from get_calendar_events)
|
|
313
|
-
|
|
305
|
+
server.tool("delete_calendar_event", `Delete a calendar event from Skylight.
|
|
306
|
+
|
|
307
|
+
Use this when:
|
|
308
|
+
- Canceling an event: "Remove the dentist appointment"
|
|
309
|
+
- Deleting old events: "Delete the meeting from yesterday"
|
|
310
|
+
|
|
311
|
+
Parameters:
|
|
312
|
+
- eventId (required): ID of the event to delete (from get_calendar_events)
|
|
313
|
+
|
|
314
314
|
Note: This permanently removes the event. For recurring events, this may only delete one instance.`, {
|
|
315
315
|
eventId: z.string().describe("ID of the event to delete"),
|
|
316
316
|
}, async ({ eventId }) => {
|