@chrischall/hellofresh-mcp 0.0.0 → 0.2.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.
- package/.claude-plugin/marketplace.json +2 -2
- package/.claude-plugin/plugin.json +1 -1
- package/README.md +19 -9
- package/dist/bundle.js +1754 -713
- package/dist/client.js +123 -1
- package/dist/cooking.js +123 -0
- package/dist/index.js +5 -4
- package/dist/normalize.js +32 -0
- package/dist/planner.js +71 -16
- package/dist/session.js +47 -3
- package/dist/tools/cooking.js +150 -0
- package/dist/tools/favorites.js +164 -0
- package/dist/tools/index.js +7 -1
- package/dist/tools/planner.js +276 -83
- package/dist/tools/promo.js +108 -0
- package/dist/tools/reads.js +71 -40
- package/dist/tools/shared.js +210 -24
- package/dist/tools/writes/index.js +9 -0
- package/dist/tools/writes/plan.js +177 -0
- package/dist/tools/writes/shared.js +137 -0
- package/dist/tools/{writes.js → writes/week.js} +8 -290
- package/dist/transport.js +13 -1
- package/dist/version.js +1 -1
- package/manifest.json +43 -4
- package/mint.yaml +6 -0
- package/package.json +1 -1
- package/server.json +8 -2
- package/skills/hellofresh/SKILL.md +49 -12
- package/skills/hellofresh-fpx/SKILL.md +13 -5
- package/skills/hellofresh-fpx/references/requests.md +30 -10
|
@@ -0,0 +1,177 @@
|
|
|
1
|
+
// The permanent plan writes: hf_change_plan_size and hf_change_delivery_schedule.
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { McpToolError } from '@chrischall/mcp-utils';
|
|
4
|
+
import { planDeliveryDetailsRequest, planProductRequest } from '../../client.js';
|
|
5
|
+
import { projectDelivery } from '../../normalize.js';
|
|
6
|
+
import { attempt, customerPlanIdOf, isUnresizableFirstBox, loadAccount } from '../shared.js';
|
|
7
|
+
import { CHANGE, SLOT, mealsCountParam, peopleParam, registerGated, requireOfferedSku, sendAndVerify, shown, skuOf, } from './shared.js';
|
|
8
|
+
export function registerPlanWrites(server, deps) {
|
|
9
|
+
const { client } = deps;
|
|
10
|
+
const now = deps.now ?? Date.now;
|
|
11
|
+
/** Upcoming running weeks still open for changes whose size differs from the plan's: week-only overrides. */
|
|
12
|
+
const overridesOf = (deliveries, planSku, at, subscription) => deliveries.flatMap((d) => d.status === 'running' &&
|
|
13
|
+
!(d.week && isUnresizableFirstBox(subscription, d.week)) &&
|
|
14
|
+
d.week &&
|
|
15
|
+
d.sku &&
|
|
16
|
+
d.sku !== planSku &&
|
|
17
|
+
!(d.cutoffDate && Date.parse(d.cutoffDate) <= at)
|
|
18
|
+
? [{ week: d.week, sku: d.sku }]
|
|
19
|
+
: []);
|
|
20
|
+
/** Which overrides (all at a size other than `sku`) the plan change reverted to `sku` (re-read best effort). */
|
|
21
|
+
const overrideReport = async (overrides, sku) => {
|
|
22
|
+
if (overrides.length === 0)
|
|
23
|
+
return {};
|
|
24
|
+
const read = await attempt(async () => ((await client.listDeliveries()).items ?? []).map(projectDelivery));
|
|
25
|
+
if (!read.ok)
|
|
26
|
+
return { overridesError: read.reason, overridesNote: overridesNote(overrides) };
|
|
27
|
+
const skuNow = new Map(read.value.map((d) => [d.week, d.sku]));
|
|
28
|
+
const reverted = overrides.filter((o) => skuNow.get(o.week) === sku).map((o) => ({ week: o.week, from: o.sku, to: sku }));
|
|
29
|
+
const kept = overrides
|
|
30
|
+
.filter((o) => skuNow.has(o.week) && skuNow.get(o.week) !== sku)
|
|
31
|
+
.map((o) => ({ week: o.week, sku: skuNow.get(o.week) }));
|
|
32
|
+
const unread = overrides.filter((o) => !skuNow.has(o.week)).map((o) => o.week);
|
|
33
|
+
return {
|
|
34
|
+
...(reverted.length > 0 ? { overridesReverted: reverted } : {}),
|
|
35
|
+
...(kept.length > 0 ? { overridesKept: kept } : {}),
|
|
36
|
+
...(unread.length > 0 ? { overridesUnread: unread } : {}),
|
|
37
|
+
overridesNote: overridesNote(overrides),
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
const overridesNote = (overrides) => 'A plan size change resets one-week sizes. To keep one, re-apply it with hf_set_week_size ' +
|
|
41
|
+
`(the weeks were: ${overrides.map((o) => `${o.week} ${o.sku}`).join(', ')}).`;
|
|
42
|
+
registerGated(server, {
|
|
43
|
+
name: 'hf_change_plan_size',
|
|
44
|
+
title: 'HelloFresh: change the plan’s box size',
|
|
45
|
+
description: 'Permanently change the HelloFresh plan’s box size (meals per week × people) for every future week. Warning: ' +
|
|
46
|
+
'this RESETS every one-week size set with hf_set_week_size — those weeks revert to the new plan size. The ' +
|
|
47
|
+
'preview lists them, and the result says which reverted so they can be re-applied with hf_set_week_size. ' +
|
|
48
|
+
'Re-reads the plan to verify.',
|
|
49
|
+
destructive: true,
|
|
50
|
+
meta: CHANGE(['hellofresh plan size', 'change hellofresh plan', 'permanent box size']),
|
|
51
|
+
input: { meals: mealsCountParam('on the plan'), people: peopleParam },
|
|
52
|
+
async plan({ meals, people }) {
|
|
53
|
+
const account = await loadAccount(client);
|
|
54
|
+
const planId = await customerPlanIdOf(client, account);
|
|
55
|
+
const plans = await client.listPlans();
|
|
56
|
+
const current = plans.find((p) => p.id === planId)?.planItems?.[0]?.productHandle ?? account.subscription.product?.sku;
|
|
57
|
+
const sku = skuOf(meals, people);
|
|
58
|
+
if (sku === current)
|
|
59
|
+
throw new McpToolError(`The plan is already ${meals} meals for ${people} people (${sku}).`);
|
|
60
|
+
await requireOfferedSku(client, account, sku);
|
|
61
|
+
const size = current ? /-(\d+)-(\d+)-\d+$/.exec(current) : null;
|
|
62
|
+
const upcoming = await attempt(async () => ((await client.listDeliveries()).items ?? []).map(projectDelivery));
|
|
63
|
+
const all = upcoming.ok ? overridesOf(upcoming.value, current, now(), account.subscription) : [];
|
|
64
|
+
// A one-week size already equal to the new plan size has nothing to revert to: listed apart, never as reverting.
|
|
65
|
+
const overrides = all.filter((o) => o.sku !== sku);
|
|
66
|
+
const atNewSize = all.filter((o) => o.sku === sku);
|
|
67
|
+
return {
|
|
68
|
+
gate: {
|
|
69
|
+
action: 'hellofresh.plan.size',
|
|
70
|
+
summary: `Permanently change the plan to ${meals} meals for ${people} people (${sku})`,
|
|
71
|
+
account: account.subscriptionId,
|
|
72
|
+
target: planId,
|
|
73
|
+
request: shown(planProductRequest(planId, sku)),
|
|
74
|
+
preview: {
|
|
75
|
+
from: { sku: current, ...(size ? { meals: Number(size[1]), people: Number(size[2]) } : {}) },
|
|
76
|
+
to: { sku, meals, people },
|
|
77
|
+
note: 'Permanent: applies to every future week, and resets any one-week size (hf_set_week_size) to the new plan size.',
|
|
78
|
+
...(overrides.length > 0
|
|
79
|
+
? {
|
|
80
|
+
overriddenWeeks: overrides.map((o) => ({ ...o, revertsTo: sku })),
|
|
81
|
+
warning: `${overrides.map((o) => `${o.week} (now ${o.sku})`).join(', ')} will revert to ${sku}: a plan size change ` +
|
|
82
|
+
'resets one-week sizes. Re-apply any you want to keep with hf_set_week_size afterwards.',
|
|
83
|
+
}
|
|
84
|
+
: {}),
|
|
85
|
+
...(atNewSize.length > 0
|
|
86
|
+
? {
|
|
87
|
+
alreadyAtNewSize: atNewSize,
|
|
88
|
+
alreadyAtNewSizeNote: `${atNewSize.map((o) => o.week).join(', ')} already has a one-week size of ${sku}, the new plan size, ` +
|
|
89
|
+
'so it stays unchanged: nothing to revert or re-apply.',
|
|
90
|
+
}
|
|
91
|
+
: {}),
|
|
92
|
+
...(upcoming.ok
|
|
93
|
+
? {}
|
|
94
|
+
: { overridesUnknown: `Could not read the upcoming weeks (${upcoming.reason}), so one-week sizes that would revert are not listed.` }),
|
|
95
|
+
},
|
|
96
|
+
},
|
|
97
|
+
state: { planId, sku, before: { sku: current }, overrides },
|
|
98
|
+
};
|
|
99
|
+
},
|
|
100
|
+
execute: (s) => sendAndVerify({
|
|
101
|
+
send: () => client.setPlanProduct(s.planId, s.sku),
|
|
102
|
+
before: s.before,
|
|
103
|
+
checkWith: 'hf_get_subscription',
|
|
104
|
+
mismatch: 'HelloFresh accepted the request, but the re-read plan does not show the new box size.',
|
|
105
|
+
verify: async () => {
|
|
106
|
+
const sku = (await client.listPlans()).find((p) => p.id === s.planId)?.planItems?.[0]?.productHandle;
|
|
107
|
+
return { ok: sku === s.sku, after: { sku }, extra: await overrideReport(s.overrides, s.sku) };
|
|
108
|
+
},
|
|
109
|
+
}),
|
|
110
|
+
});
|
|
111
|
+
registerGated(server, {
|
|
112
|
+
name: 'hf_change_delivery_schedule',
|
|
113
|
+
title: 'HelloFresh: change the delivery schedule',
|
|
114
|
+
description: 'Permanently change the HelloFresh plan’s regular delivery slot (day + time window) and/or frequency (every 1–4 ' +
|
|
115
|
+
'weeks). Give either or both; the other keeps its current value. Re-reads the subscription to verify.',
|
|
116
|
+
destructive: true,
|
|
117
|
+
meta: CHANGE(['hellofresh delivery schedule', 'delivery frequency', 'every other week']),
|
|
118
|
+
input: {
|
|
119
|
+
delivery_option: z
|
|
120
|
+
.string()
|
|
121
|
+
.trim()
|
|
122
|
+
.regex(SLOT, 'a slot handle like US-1-0800-2000')
|
|
123
|
+
.optional()
|
|
124
|
+
.describe('The regular slot handle, e.g. US-1-0800-2000 = Mondays 8AM–8PM (weekday 1=Mon…7=Sun, then from/to HHMM).'),
|
|
125
|
+
interval_weeks: z.number().int().min(1).max(4).optional().describe('Deliver every N weeks (1–4).'),
|
|
126
|
+
},
|
|
127
|
+
async plan({ delivery_option, interval_weeks }) {
|
|
128
|
+
if (delivery_option === undefined && interval_weeks === undefined) {
|
|
129
|
+
throw new McpToolError('Give delivery_option or interval_weeks (or both).');
|
|
130
|
+
}
|
|
131
|
+
const account = await loadAccount(client);
|
|
132
|
+
const sub = account.subscription;
|
|
133
|
+
const currentOption = sub.deliveryOption?.handle ?? sub.deliveryTime;
|
|
134
|
+
const currentInterval = sub.deliveryInterval;
|
|
135
|
+
if (!currentOption)
|
|
136
|
+
throw new McpToolError('HelloFresh returned no current delivery slot, which must be sent with the change.');
|
|
137
|
+
if (currentInterval === undefined) {
|
|
138
|
+
throw new McpToolError('HelloFresh returned no current delivery frequency, which must be sent with the change.');
|
|
139
|
+
}
|
|
140
|
+
const details = { deliveryOption: delivery_option ?? currentOption, deliveryInterval: interval_weeks ?? currentInterval };
|
|
141
|
+
const before = { deliveryOption: currentOption, deliveryInterval: currentInterval };
|
|
142
|
+
if (details.deliveryOption === currentOption && details.deliveryInterval === currentInterval) {
|
|
143
|
+
throw new McpToolError(`The schedule is already slot ${currentOption}, every ${currentInterval} week(s).`);
|
|
144
|
+
}
|
|
145
|
+
const planId = await customerPlanIdOf(client, account);
|
|
146
|
+
let caveat;
|
|
147
|
+
if (details.deliveryOption !== currentOption) {
|
|
148
|
+
const seen = ((await client.listDeliveries()).items ?? []).flatMap((d) => (d.availableOneOffOptions ?? []).map((o) => o.handle));
|
|
149
|
+
if (!seen.includes(details.deliveryOption)) {
|
|
150
|
+
caveat = `${details.deliveryOption} is not one this account has been offered (not among the upcoming weeks’ alternative slots); HelloFresh may refuse it.`;
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
return {
|
|
154
|
+
gate: {
|
|
155
|
+
action: 'hellofresh.plan.schedule',
|
|
156
|
+
summary: `Permanently deliver in slot ${details.deliveryOption}, every ${details.deliveryInterval} week(s)`,
|
|
157
|
+
account: account.subscriptionId,
|
|
158
|
+
target: planId,
|
|
159
|
+
request: shown(planDeliveryDetailsRequest(planId, details)),
|
|
160
|
+
preview: { from: before, to: details, ...(caveat ? { caveat } : {}) },
|
|
161
|
+
},
|
|
162
|
+
state: { account, planId, details, before },
|
|
163
|
+
};
|
|
164
|
+
},
|
|
165
|
+
execute: (s) => sendAndVerify({
|
|
166
|
+
send: () => client.changePlanDeliveryDetails(s.planId, s.details),
|
|
167
|
+
before: s.before,
|
|
168
|
+
checkWith: 'hf_get_subscription',
|
|
169
|
+
mismatch: 'HelloFresh accepted the request, but the re-read subscription does not show the new schedule.',
|
|
170
|
+
verify: async () => {
|
|
171
|
+
const sub = await client.getSubscription(s.account.subscriptionId);
|
|
172
|
+
const after = { deliveryOption: sub.deliveryOption?.handle ?? sub.deliveryTime, deliveryInterval: sub.deliveryInterval };
|
|
173
|
+
return { ok: after.deliveryOption === s.details.deliveryOption && after.deliveryInterval === s.details.deliveryInterval, after };
|
|
174
|
+
},
|
|
175
|
+
}),
|
|
176
|
+
});
|
|
177
|
+
}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
// The write tools (docs/HELLOFRESH-API.md "Writes" 1–5), each confirm-gated:
|
|
2
|
+
//
|
|
3
|
+
// plan — validate the arguments against a FRESH read (status, cutoff,
|
|
4
|
+
// allowed actions, menu indexes, offered sizes/slots) and build the
|
|
5
|
+
// exact request with the client's own builder, so the preview IS
|
|
6
|
+
// what is sent;
|
|
7
|
+
// gate — `confirmWrite` (elicitation, or a phase-1 preview + confirmToken);
|
|
8
|
+
// execute — send it, then RE-READ and compare, answering
|
|
9
|
+
// `{status: 'verified' | 'unverified', before, after}` honestly.
|
|
10
|
+
//
|
|
11
|
+
// A write that was sent and then timed out / dropped / got a 5xx answers
|
|
12
|
+
// `status: 'unknown'` (not an error), so the model checks before repeating it.
|
|
13
|
+
// Cancelling the subscription and the meal-preference preset are deliberately
|
|
14
|
+
// not exposed (see the API doc).
|
|
15
|
+
//
|
|
16
|
+
// `registerWrite` from mcp-utils cannot carry `_meta`, which the context-group
|
|
17
|
+
// hints need, so `registerGated` below is the same plan → confirmWrite →
|
|
18
|
+
// execute flow with `_meta`.
|
|
19
|
+
//
|
|
20
|
+
// This file holds the shared gate (`registerGated`), the send → re-read
|
|
21
|
+
// helper and the week/plan checks; `week.ts` and `plan.ts` register the tools.
|
|
22
|
+
import { z } from 'zod';
|
|
23
|
+
import { CONFIRM_FLOW_SENTENCE, CONFIRM_INJECTION_RULE, McpToolError, confirmTokenParam, confirmWrite, minifiedResult, toolAnnotations, writeOrUnknown, } from '@chrischall/mcp-utils';
|
|
24
|
+
import { projectDelivery } from '../../normalize.js';
|
|
25
|
+
import { foodMeta } from '../hints.js';
|
|
26
|
+
import { attempt, dateOf } from '../shared.js';
|
|
27
|
+
export function registerGated(server, def) {
|
|
28
|
+
server.registerTool(def.name, {
|
|
29
|
+
description: `${def.description} ${CONFIRM_FLOW_SENTENCE} ${CONFIRM_INJECTION_RULE}`,
|
|
30
|
+
annotations: toolAnnotations({ title: def.title, readOnly: false, destructive: def.destructive, idempotent: true, openWorld: true }),
|
|
31
|
+
_meta: def.meta,
|
|
32
|
+
inputSchema: z.object({ ...def.input, confirmToken: confirmTokenParam }),
|
|
33
|
+
}, async (input, ctx) => {
|
|
34
|
+
const { confirmToken, ...args } = input;
|
|
35
|
+
const { gate, state } = await def.plan(args);
|
|
36
|
+
const blocked = await confirmWrite(ctx, { ...gate, tool: def.name, confirmToken, args });
|
|
37
|
+
if (blocked)
|
|
38
|
+
return blocked;
|
|
39
|
+
return def.execute(state);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
/** A write as `confirmWrite` previews and binds it: the path as sent on www.hellofresh.com. */
|
|
43
|
+
export const shown = (w) => ({ method: w.method, path: `/gw${w.path}`, query: w.query, body: w.body });
|
|
44
|
+
export const CHANGE = (aliases) => foodMeta('change', { aliases });
|
|
45
|
+
/**
|
|
46
|
+
* Send `send`, then re-read with `verify`. A send whose outcome is unknown
|
|
47
|
+
* answers `status: 'unknown'`; a re-read that fails answers `unverified` with
|
|
48
|
+
* the reason.
|
|
49
|
+
*/
|
|
50
|
+
export async function sendAndVerify(opts) {
|
|
51
|
+
const sent = await writeOrUnknown(opts.send, (_err, reason) => minifiedResult({
|
|
52
|
+
status: 'unknown',
|
|
53
|
+
before: opts.before,
|
|
54
|
+
warning: `HelloFresh did not confirm this change (${reason}), so it may already have happened. ` +
|
|
55
|
+
`Check with ${opts.checkWith} before repeating it; do not repeat it blindly.`,
|
|
56
|
+
}));
|
|
57
|
+
if (!sent.ok)
|
|
58
|
+
return sent.result;
|
|
59
|
+
const extra = opts.extra?.(sent.value) ?? {};
|
|
60
|
+
const check = await attempt(opts.verify);
|
|
61
|
+
if (!check.ok) {
|
|
62
|
+
return minifiedResult({
|
|
63
|
+
status: 'unverified',
|
|
64
|
+
before: opts.before,
|
|
65
|
+
...extra,
|
|
66
|
+
verifyError: check.reason,
|
|
67
|
+
warning: `HelloFresh accepted the request, but re-reading it failed. Check with ${opts.checkWith}.`,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
return minifiedResult({
|
|
71
|
+
status: check.value.ok ? 'verified' : 'unverified',
|
|
72
|
+
before: opts.before,
|
|
73
|
+
after: check.value.after,
|
|
74
|
+
...extra,
|
|
75
|
+
...check.value.extra,
|
|
76
|
+
...(check.value.ok ? {} : { warning: `${opts.mismatch} Check with ${opts.checkWith} before trying again.` }),
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
/** The week, refused when its cutoff has passed. */
|
|
80
|
+
export async function openWeek(client, account, week, now) {
|
|
81
|
+
const raw = await client.getDelivery(account.subscriptionId, week);
|
|
82
|
+
const delivery = projectDelivery(raw);
|
|
83
|
+
if (delivery.cutoffDate && Date.parse(delivery.cutoffDate) <= now) {
|
|
84
|
+
throw new McpToolError(`The cutoff for ${week} passed at ${delivery.cutoffDate}; HelloFresh no longer accepts changes to it.`);
|
|
85
|
+
}
|
|
86
|
+
return { raw, delivery };
|
|
87
|
+
}
|
|
88
|
+
/** Refuse a change HelloFresh marks as not allowed for the week. */
|
|
89
|
+
export function requireAllowed(raw, week, action) {
|
|
90
|
+
if (raw.allowedActions?.[action] === false) {
|
|
91
|
+
throw new McpToolError(`HelloFresh does not allow this change for ${week} (${action} is not allowed for it).`);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
/** Refuse a week that is not running (skipped → unskip first). */
|
|
95
|
+
export function requireRunning(delivery, week, what) {
|
|
96
|
+
if (delivery.status === 'skipped') {
|
|
97
|
+
throw new McpToolError(`${week} is skipped, so you cannot ${what}. Unskip it first with hf_unskip_week.`);
|
|
98
|
+
}
|
|
99
|
+
if (delivery.status !== 'running')
|
|
100
|
+
throw new McpToolError(`${week} is ${delivery.status}, so you cannot ${what}.`);
|
|
101
|
+
}
|
|
102
|
+
/** The SKUs this subscription can switch to; refuses one not among them. */
|
|
103
|
+
export async function requireOfferedSku(client, account, sku) {
|
|
104
|
+
const options = await client.getProductOptions(account.subscriptionId);
|
|
105
|
+
const offered = (options.items ?? []).flatMap((g) => (g.products ?? []).flatMap((p) => (p.handle ? [p.handle] : [])));
|
|
106
|
+
if (!offered.includes(sku)) {
|
|
107
|
+
throw new McpToolError(`This subscription cannot switch to ${sku}. Sizes offered: ${offered.join(', ')}.`, {
|
|
108
|
+
hint: 'hf_list_box_sizes lists them as meals × people.',
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
/** Re-reads after a one-week size change before calling it unverified, and the wait between them. */
|
|
113
|
+
export const SIZE_VERIFY_READS = 3;
|
|
114
|
+
export const SIZE_VERIFY_DELAY_MS = 1500;
|
|
115
|
+
export const skuOf = (meals, people) => `US-CBU-${meals}-${people}-0`;
|
|
116
|
+
export const boxOf = (d) => ({
|
|
117
|
+
sku: d.sku,
|
|
118
|
+
meals: d.meals,
|
|
119
|
+
people: d.servings,
|
|
120
|
+
deliveryOption: d.deliveryOption,
|
|
121
|
+
});
|
|
122
|
+
export const peopleParam = z
|
|
123
|
+
.union([z.literal(2), z.literal(3), z.literal(4), z.literal(6)])
|
|
124
|
+
.describe('People (servings per meal): 2, 3, 4 or 6.');
|
|
125
|
+
export const mealsCountParam = (what) => z.number().int().min(1).max(6).describe(`Meals per week ${what}.`);
|
|
126
|
+
export const SLOT = /^US-[1-7]-\d{4}-\d{4}$/;
|
|
127
|
+
/** Every index on the menu (base courses and their protein swaps) → its name. */
|
|
128
|
+
export function namesOf(menu) {
|
|
129
|
+
const names = new Map();
|
|
130
|
+
for (const m of menu.meals) {
|
|
131
|
+
names.set(m.index, m.name);
|
|
132
|
+
for (const v of m.variants)
|
|
133
|
+
names.set(v.index, v.name ?? v.title);
|
|
134
|
+
}
|
|
135
|
+
return names;
|
|
136
|
+
}
|
|
137
|
+
export const slotOf = (d) => ({ deliveryOption: d.deliveryOption, deliveryDate: dateOf(d.deliveryDate), sku: d.sku });
|
|
@@ -1,129 +1,12 @@
|
|
|
1
|
-
// The
|
|
2
|
-
//
|
|
3
|
-
// plan — validate the arguments against a FRESH read (status, cutoff,
|
|
4
|
-
// allowed actions, menu indexes, offered sizes/slots) and build the
|
|
5
|
-
// exact request with the client's own builder, so the preview IS
|
|
6
|
-
// what is sent;
|
|
7
|
-
// gate — `confirmWrite` (elicitation, or a phase-1 preview + confirmToken);
|
|
8
|
-
// execute — send it, then RE-READ and compare, answering
|
|
9
|
-
// `{status: 'verified' | 'unverified', before, after}` honestly.
|
|
10
|
-
//
|
|
11
|
-
// A write that was sent and then timed out / dropped / got a 5xx answers
|
|
12
|
-
// `status: 'unknown'` (not an error), so the model checks before repeating it.
|
|
13
|
-
// Cancelling the subscription and the meal-preference preset are deliberately
|
|
14
|
-
// not exposed (see the API doc).
|
|
15
|
-
//
|
|
16
|
-
// `registerWrite` from mcp-utils cannot carry `_meta`, which the context-group
|
|
17
|
-
// hints need, so `registerGated` below is the same plan → confirmWrite →
|
|
18
|
-
// execute flow with `_meta`.
|
|
1
|
+
// The one-week writes: hf_select_meals, hf_set_week_size,
|
|
2
|
+
// hf_set_week_delivery_day, hf_skip_week and hf_unskip_week.
|
|
19
3
|
import { z } from 'zod';
|
|
20
|
-
import {
|
|
21
|
-
import { deliveryStatusRequest, oneOffRequest,
|
|
22
|
-
import { projectDelivery } from '
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
function
|
|
26
|
-
server.registerTool(def.name, {
|
|
27
|
-
description: `${def.description} ${CONFIRM_FLOW_SENTENCE} ${CONFIRM_INJECTION_RULE}`,
|
|
28
|
-
annotations: toolAnnotations({ title: def.title, readOnly: false, destructive: def.destructive, idempotent: true, openWorld: true }),
|
|
29
|
-
_meta: def.meta,
|
|
30
|
-
inputSchema: z.object({ ...def.input, confirmToken: confirmTokenParam }),
|
|
31
|
-
}, async (input, ctx) => {
|
|
32
|
-
const { confirmToken, ...args } = input;
|
|
33
|
-
const { gate, state } = await def.plan(args);
|
|
34
|
-
const blocked = await confirmWrite(ctx, { ...gate, tool: def.name, confirmToken, args });
|
|
35
|
-
if (blocked)
|
|
36
|
-
return blocked;
|
|
37
|
-
return def.execute(state);
|
|
38
|
-
});
|
|
39
|
-
}
|
|
40
|
-
/** A write as `confirmWrite` previews and binds it: the path as sent on www.hellofresh.com. */
|
|
41
|
-
const shown = (w) => ({ method: w.method, path: `/gw${w.path}`, query: w.query, body: w.body });
|
|
42
|
-
const CHANGE = (aliases) => foodMeta('change', { aliases });
|
|
43
|
-
/**
|
|
44
|
-
* Send `send`, then re-read with `verify`. A send whose outcome is unknown
|
|
45
|
-
* answers `status: 'unknown'`; a re-read that fails answers `unverified` with
|
|
46
|
-
* the reason.
|
|
47
|
-
*/
|
|
48
|
-
async function sendAndVerify(opts) {
|
|
49
|
-
const sent = await writeOrUnknown(opts.send, (_err, reason) => minifiedResult({
|
|
50
|
-
status: 'unknown',
|
|
51
|
-
before: opts.before,
|
|
52
|
-
warning: `HelloFresh did not confirm this change (${reason}), so it may already have happened. ` +
|
|
53
|
-
`Check with ${opts.checkWith} before repeating it; do not repeat it blindly.`,
|
|
54
|
-
}));
|
|
55
|
-
if (!sent.ok)
|
|
56
|
-
return sent.result;
|
|
57
|
-
const extra = opts.extra?.(sent.value) ?? {};
|
|
58
|
-
const check = await attempt(opts.verify);
|
|
59
|
-
if (!check.ok) {
|
|
60
|
-
return minifiedResult({
|
|
61
|
-
status: 'unverified',
|
|
62
|
-
before: opts.before,
|
|
63
|
-
...extra,
|
|
64
|
-
verifyError: check.reason,
|
|
65
|
-
warning: `HelloFresh accepted the request, but re-reading it failed. Check with ${opts.checkWith}.`,
|
|
66
|
-
});
|
|
67
|
-
}
|
|
68
|
-
return minifiedResult({
|
|
69
|
-
status: check.value.ok ? 'verified' : 'unverified',
|
|
70
|
-
before: opts.before,
|
|
71
|
-
after: check.value.after,
|
|
72
|
-
...extra,
|
|
73
|
-
...check.value.extra,
|
|
74
|
-
...(check.value.ok ? {} : { warning: `${opts.mismatch} Check with ${opts.checkWith} before trying again.` }),
|
|
75
|
-
});
|
|
76
|
-
}
|
|
77
|
-
/** The week, refused when its cutoff has passed. */
|
|
78
|
-
async function openWeek(client, account, week, now) {
|
|
79
|
-
const raw = await client.getDelivery(account.subscriptionId, week);
|
|
80
|
-
const delivery = projectDelivery(raw);
|
|
81
|
-
if (delivery.cutoffDate && Date.parse(delivery.cutoffDate) <= now) {
|
|
82
|
-
throw new McpToolError(`The cutoff for ${week} passed at ${delivery.cutoffDate}; HelloFresh no longer accepts changes to it.`);
|
|
83
|
-
}
|
|
84
|
-
return { raw, delivery };
|
|
85
|
-
}
|
|
86
|
-
/** Refuse a change HelloFresh marks as not allowed for the week. */
|
|
87
|
-
function requireAllowed(raw, week, action) {
|
|
88
|
-
if (raw.allowedActions?.[action] === false) {
|
|
89
|
-
throw new McpToolError(`HelloFresh does not allow this change for ${week} (${action} is not allowed for it).`);
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
/** Refuse a week that is not running (skipped → unskip first). */
|
|
93
|
-
function requireRunning(delivery, week, what) {
|
|
94
|
-
if (delivery.status === 'skipped') {
|
|
95
|
-
throw new McpToolError(`${week} is skipped, so you cannot ${what}. Unskip it first with hf_unskip_week.`);
|
|
96
|
-
}
|
|
97
|
-
if (delivery.status !== 'running')
|
|
98
|
-
throw new McpToolError(`${week} is ${delivery.status}, so you cannot ${what}.`);
|
|
99
|
-
}
|
|
100
|
-
/** The SKUs this subscription can switch to; refuses one not among them. */
|
|
101
|
-
async function requireOfferedSku(client, account, sku) {
|
|
102
|
-
const options = await client.getProductOptions(account.subscriptionId);
|
|
103
|
-
const offered = (options.items ?? []).flatMap((g) => (g.products ?? []).flatMap((p) => (p.handle ? [p.handle] : [])));
|
|
104
|
-
if (!offered.includes(sku)) {
|
|
105
|
-
throw new McpToolError(`This subscription cannot switch to ${sku}. Sizes offered: ${offered.join(', ')}.`, {
|
|
106
|
-
hint: 'hf_list_box_sizes lists them as meals × people.',
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
/** Re-reads after a one-week size change before calling it unverified, and the wait between them. */
|
|
111
|
-
export const SIZE_VERIFY_READS = 3;
|
|
112
|
-
export const SIZE_VERIFY_DELAY_MS = 1500;
|
|
113
|
-
const skuOf = (meals, people) => `US-CBU-${meals}-${people}-0`;
|
|
114
|
-
const boxOf = (d) => ({
|
|
115
|
-
sku: d.sku,
|
|
116
|
-
meals: d.meals,
|
|
117
|
-
people: d.servings,
|
|
118
|
-
deliveryOption: d.deliveryOption,
|
|
119
|
-
});
|
|
120
|
-
const peopleParam = z
|
|
121
|
-
.union([z.literal(2), z.literal(3), z.literal(4), z.literal(6)])
|
|
122
|
-
.describe('People (servings per meal): 2, 3, 4 or 6.');
|
|
123
|
-
const mealsCountParam = (what) => z.number().int().min(1).max(6).describe(`Meals per week ${what}.`);
|
|
124
|
-
const SLOT = /^US-[1-7]-\d{4}-\d{4}$/;
|
|
125
|
-
// ---- registration ---------------------------------------------------------------------
|
|
126
|
-
export function registerWriteTools(server, deps) {
|
|
4
|
+
import { McpToolError } from '@chrischall/mcp-utils';
|
|
5
|
+
import { deliveryStatusRequest, oneOffRequest, selectMealsRequest, weekSizeRequest, } from '../../client.js';
|
|
6
|
+
import { projectDelivery } from '../../normalize.js';
|
|
7
|
+
import { attempt, compactSelection, dateOf, isUnresizableFirstBox, loadAccount, readMenu, sleepMs, weekParam } from '../shared.js';
|
|
8
|
+
import { CHANGE, SIZE_VERIFY_DELAY_MS, SIZE_VERIFY_READS, SLOT, boxOf, mealsCountParam, namesOf, openWeek, peopleParam, registerGated, requireAllowed, requireOfferedSku, requireRunning, sendAndVerify, shown, skuOf, slotOf, } from './shared.js';
|
|
9
|
+
export function registerWeekWrites(server, deps) {
|
|
127
10
|
const { client } = deps;
|
|
128
11
|
const now = deps.now ?? Date.now;
|
|
129
12
|
const sleep = deps.sleep ?? sleepMs;
|
|
@@ -404,169 +287,4 @@ export function registerWriteTools(server, deps) {
|
|
|
404
287
|
};
|
|
405
288
|
statusWrite(true);
|
|
406
289
|
statusWrite(false);
|
|
407
|
-
/** Upcoming running weeks still open for changes whose size differs from the plan's: week-only overrides. */
|
|
408
|
-
const overridesOf = (deliveries, planSku, at, subscription) => deliveries.flatMap((d) => d.status === 'running' &&
|
|
409
|
-
!(d.week && isUnresizableFirstBox(subscription, d.week)) &&
|
|
410
|
-
d.week &&
|
|
411
|
-
d.sku &&
|
|
412
|
-
d.sku !== planSku &&
|
|
413
|
-
!(d.cutoffDate && Date.parse(d.cutoffDate) <= at)
|
|
414
|
-
? [{ week: d.week, sku: d.sku }]
|
|
415
|
-
: []);
|
|
416
|
-
/** Which overrides the plan change reverted to `sku` (re-read best effort). */
|
|
417
|
-
const overrideReport = async (overrides, sku) => {
|
|
418
|
-
if (overrides.length === 0)
|
|
419
|
-
return {};
|
|
420
|
-
const read = await attempt(async () => ((await client.listDeliveries()).items ?? []).map(projectDelivery));
|
|
421
|
-
if (!read.ok)
|
|
422
|
-
return { overridesError: read.reason, overridesNote: overridesNote(overrides) };
|
|
423
|
-
const now = new Map(read.value.map((d) => [d.week, d.sku]));
|
|
424
|
-
const reverted = overrides.filter((o) => now.get(o.week) === sku && o.sku !== sku).map((o) => ({ week: o.week, from: o.sku, to: sku }));
|
|
425
|
-
const kept = overrides.filter((o) => now.has(o.week) && now.get(o.week) !== sku).map((o) => ({ week: o.week, sku: now.get(o.week) }));
|
|
426
|
-
const unread = overrides.filter((o) => !now.has(o.week)).map((o) => o.week);
|
|
427
|
-
return {
|
|
428
|
-
...(reverted.length > 0 ? { overridesReverted: reverted } : {}),
|
|
429
|
-
...(kept.length > 0 ? { overridesKept: kept } : {}),
|
|
430
|
-
...(unread.length > 0 ? { overridesUnread: unread } : {}),
|
|
431
|
-
overridesNote: overridesNote(overrides),
|
|
432
|
-
};
|
|
433
|
-
};
|
|
434
|
-
const overridesNote = (overrides) => 'A plan size change resets one-week sizes. To keep one, re-apply it with hf_set_week_size ' +
|
|
435
|
-
`(the weeks were: ${overrides.map((o) => `${o.week} ${o.sku}`).join(', ')}).`;
|
|
436
|
-
registerGated(server, {
|
|
437
|
-
name: 'hf_change_plan_size',
|
|
438
|
-
title: 'HelloFresh: change the plan’s box size',
|
|
439
|
-
description: 'Permanently change the HelloFresh plan’s box size (meals per week × people) for every future week. Warning: ' +
|
|
440
|
-
'this RESETS every one-week size set with hf_set_week_size — those weeks revert to the new plan size. The ' +
|
|
441
|
-
'preview lists them, and the result says which reverted so they can be re-applied with hf_set_week_size. ' +
|
|
442
|
-
'Re-reads the plan to verify.',
|
|
443
|
-
destructive: true,
|
|
444
|
-
meta: CHANGE(['hellofresh plan size', 'change hellofresh plan', 'permanent box size']),
|
|
445
|
-
input: { meals: mealsCountParam('on the plan'), people: peopleParam },
|
|
446
|
-
async plan({ meals, people }) {
|
|
447
|
-
const account = await loadAccount(client);
|
|
448
|
-
const planId = await customerPlanIdOf(client, account);
|
|
449
|
-
const plans = await client.listPlans();
|
|
450
|
-
const current = plans.find((p) => p.id === planId)?.planItems?.[0]?.productHandle ?? account.subscription.product?.sku;
|
|
451
|
-
const sku = skuOf(meals, people);
|
|
452
|
-
if (sku === current)
|
|
453
|
-
throw new McpToolError(`The plan is already ${meals} meals for ${people} people (${sku}).`);
|
|
454
|
-
await requireOfferedSku(client, account, sku);
|
|
455
|
-
const size = current ? /-(\d+)-(\d+)-\d+$/.exec(current) : null;
|
|
456
|
-
const upcoming = await attempt(async () => ((await client.listDeliveries()).items ?? []).map(projectDelivery));
|
|
457
|
-
const overrides = upcoming.ok ? overridesOf(upcoming.value, current, now(), account.subscription) : [];
|
|
458
|
-
return {
|
|
459
|
-
gate: {
|
|
460
|
-
action: 'hellofresh.plan.size',
|
|
461
|
-
summary: `Permanently change the plan to ${meals} meals for ${people} people (${sku})`,
|
|
462
|
-
account: account.subscriptionId,
|
|
463
|
-
target: planId,
|
|
464
|
-
request: shown(planProductRequest(planId, sku)),
|
|
465
|
-
preview: {
|
|
466
|
-
from: { sku: current, ...(size ? { meals: Number(size[1]), people: Number(size[2]) } : {}) },
|
|
467
|
-
to: { sku, meals, people },
|
|
468
|
-
note: 'Permanent: applies to every future week, and resets any one-week size (hf_set_week_size) to the new plan size.',
|
|
469
|
-
...(overrides.length > 0
|
|
470
|
-
? {
|
|
471
|
-
overriddenWeeks: overrides.map((o) => ({ ...o, revertsTo: sku })),
|
|
472
|
-
warning: `${overrides.map((o) => `${o.week} (now ${o.sku})`).join(', ')} will revert to ${sku}: a plan size change ` +
|
|
473
|
-
'resets one-week sizes. Re-apply any you want to keep with hf_set_week_size afterwards.',
|
|
474
|
-
}
|
|
475
|
-
: {}),
|
|
476
|
-
...(upcoming.ok
|
|
477
|
-
? {}
|
|
478
|
-
: { overridesUnknown: `Could not read the upcoming weeks (${upcoming.reason}), so one-week sizes that would revert are not listed.` }),
|
|
479
|
-
},
|
|
480
|
-
},
|
|
481
|
-
state: { planId, sku, before: { sku: current }, overrides },
|
|
482
|
-
};
|
|
483
|
-
},
|
|
484
|
-
execute: (s) => sendAndVerify({
|
|
485
|
-
send: () => client.setPlanProduct(s.planId, s.sku),
|
|
486
|
-
before: s.before,
|
|
487
|
-
checkWith: 'hf_get_subscription',
|
|
488
|
-
mismatch: 'HelloFresh accepted the request, but the re-read plan does not show the new box size.',
|
|
489
|
-
verify: async () => {
|
|
490
|
-
const sku = (await client.listPlans()).find((p) => p.id === s.planId)?.planItems?.[0]?.productHandle;
|
|
491
|
-
return { ok: sku === s.sku, after: { sku }, extra: await overrideReport(s.overrides, s.sku) };
|
|
492
|
-
},
|
|
493
|
-
}),
|
|
494
|
-
});
|
|
495
|
-
registerGated(server, {
|
|
496
|
-
name: 'hf_change_delivery_schedule',
|
|
497
|
-
title: 'HelloFresh: change the delivery schedule',
|
|
498
|
-
description: 'Permanently change the HelloFresh plan’s regular delivery slot (day + time window) and/or frequency (every 1–4 ' +
|
|
499
|
-
'weeks). Give either or both; the other keeps its current value. Re-reads the subscription to verify.',
|
|
500
|
-
destructive: true,
|
|
501
|
-
meta: CHANGE(['hellofresh delivery schedule', 'delivery frequency', 'every other week']),
|
|
502
|
-
input: {
|
|
503
|
-
delivery_option: z
|
|
504
|
-
.string()
|
|
505
|
-
.trim()
|
|
506
|
-
.regex(SLOT, 'a slot handle like US-1-0800-2000')
|
|
507
|
-
.optional()
|
|
508
|
-
.describe('The regular slot handle, e.g. US-1-0800-2000 = Mondays 8AM–8PM (weekday 1=Mon…7=Sun, then from/to HHMM).'),
|
|
509
|
-
interval_weeks: z.number().int().min(1).max(4).optional().describe('Deliver every N weeks (1–4).'),
|
|
510
|
-
},
|
|
511
|
-
async plan({ delivery_option, interval_weeks }) {
|
|
512
|
-
if (delivery_option === undefined && interval_weeks === undefined) {
|
|
513
|
-
throw new McpToolError('Give delivery_option or interval_weeks (or both).');
|
|
514
|
-
}
|
|
515
|
-
const account = await loadAccount(client);
|
|
516
|
-
const sub = account.subscription;
|
|
517
|
-
const currentOption = sub.deliveryOption?.handle ?? sub.deliveryTime;
|
|
518
|
-
const currentInterval = sub.deliveryInterval;
|
|
519
|
-
if (!currentOption)
|
|
520
|
-
throw new McpToolError('HelloFresh returned no current delivery slot, which must be sent with the change.');
|
|
521
|
-
if (currentInterval === undefined) {
|
|
522
|
-
throw new McpToolError('HelloFresh returned no current delivery frequency, which must be sent with the change.');
|
|
523
|
-
}
|
|
524
|
-
const details = { deliveryOption: delivery_option ?? currentOption, deliveryInterval: interval_weeks ?? currentInterval };
|
|
525
|
-
const before = { deliveryOption: currentOption, deliveryInterval: currentInterval };
|
|
526
|
-
if (details.deliveryOption === currentOption && details.deliveryInterval === currentInterval) {
|
|
527
|
-
throw new McpToolError(`The schedule is already slot ${currentOption}, every ${currentInterval} week(s).`);
|
|
528
|
-
}
|
|
529
|
-
const planId = await customerPlanIdOf(client, account);
|
|
530
|
-
let caveat;
|
|
531
|
-
if (details.deliveryOption !== currentOption) {
|
|
532
|
-
const seen = ((await client.listDeliveries()).items ?? []).flatMap((d) => (d.availableOneOffOptions ?? []).map((o) => o.handle));
|
|
533
|
-
if (!seen.includes(details.deliveryOption)) {
|
|
534
|
-
caveat = `${details.deliveryOption} is not one this account has been offered (not among the upcoming weeks’ alternative slots); HelloFresh may refuse it.`;
|
|
535
|
-
}
|
|
536
|
-
}
|
|
537
|
-
return {
|
|
538
|
-
gate: {
|
|
539
|
-
action: 'hellofresh.plan.schedule',
|
|
540
|
-
summary: `Permanently deliver in slot ${details.deliveryOption}, every ${details.deliveryInterval} week(s)`,
|
|
541
|
-
account: account.subscriptionId,
|
|
542
|
-
target: planId,
|
|
543
|
-
request: shown(planDeliveryDetailsRequest(planId, details)),
|
|
544
|
-
preview: { from: before, to: details, ...(caveat ? { caveat } : {}) },
|
|
545
|
-
},
|
|
546
|
-
state: { account, planId, details, before },
|
|
547
|
-
};
|
|
548
|
-
},
|
|
549
|
-
execute: (s) => sendAndVerify({
|
|
550
|
-
send: () => client.changePlanDeliveryDetails(s.planId, s.details),
|
|
551
|
-
before: s.before,
|
|
552
|
-
checkWith: 'hf_get_subscription',
|
|
553
|
-
mismatch: 'HelloFresh accepted the request, but the re-read subscription does not show the new schedule.',
|
|
554
|
-
verify: async () => {
|
|
555
|
-
const sub = await client.getSubscription(s.account.subscriptionId);
|
|
556
|
-
const after = { deliveryOption: sub.deliveryOption?.handle ?? sub.deliveryTime, deliveryInterval: sub.deliveryInterval };
|
|
557
|
-
return { ok: after.deliveryOption === s.details.deliveryOption && after.deliveryInterval === s.details.deliveryInterval, after };
|
|
558
|
-
},
|
|
559
|
-
}),
|
|
560
|
-
});
|
|
561
|
-
}
|
|
562
|
-
/** Every index on the menu (base courses and their protein swaps) → its name. */
|
|
563
|
-
function namesOf(menu) {
|
|
564
|
-
const names = new Map();
|
|
565
|
-
for (const m of menu.meals) {
|
|
566
|
-
names.set(m.index, m.name);
|
|
567
|
-
for (const v of m.variants)
|
|
568
|
-
names.set(v.index, v.name ?? v.title);
|
|
569
|
-
}
|
|
570
|
-
return names;
|
|
571
290
|
}
|
|
572
|
-
const slotOf = (d) => ({ deliveryOption: d.deliveryOption, deliveryDate: dateOf(d.deliveryDate), sku: d.sku });
|
package/dist/transport.js
CHANGED
|
@@ -3,7 +3,10 @@
|
|
|
3
3
|
// signed-in www.hellofresh.com tab, and writes a refreshed token set back to
|
|
4
4
|
// it (HelloFresh ROTATES the refresh token on every refresh and sets no cookie,
|
|
5
5
|
// so without the write-back the browser keeps a spent refresh token and is
|
|
6
|
-
// signed out). Every API call is a plain Node fetch with a Bearer token
|
|
6
|
+
// signed out). Every API call is a plain Node fetch with a Bearer token —
|
|
7
|
+
// except the few Cloudflare's WAF refuses from Node (`POST /gw/calculate`),
|
|
8
|
+
// which run as an in-tab fetch (`fetchInTab`) over the `fetch` capability the
|
|
9
|
+
// bootstrap declaration already carries (no new pairing scope).
|
|
7
10
|
//
|
|
8
11
|
// `@chrischall/mcp-utils/fetchproxy` eagerly imports `@fetchproxy/server`, so it
|
|
9
12
|
// is imported lazily here (type imports are erased): nothing on the boot path
|
|
@@ -65,6 +68,15 @@ export function createHelloFreshBridge(opts) {
|
|
|
65
68
|
throw new Error(`the browser did not confirm writing the ${AUTH_COOKIE} cookie`);
|
|
66
69
|
}
|
|
67
70
|
},
|
|
71
|
+
async fetchInTab(req) {
|
|
72
|
+
const transport = await ensureStarted();
|
|
73
|
+
const res = await transport.server.request(req.method, req.url, {
|
|
74
|
+
headers: req.headers,
|
|
75
|
+
...(req.body !== undefined ? { body: req.body } : {}),
|
|
76
|
+
...(req.retryOnTimeout !== undefined ? { retryOnTimeout: req.retryOnTimeout } : {}),
|
|
77
|
+
});
|
|
78
|
+
return { status: res.status, body: res.body };
|
|
79
|
+
},
|
|
68
80
|
async healthTransport() {
|
|
69
81
|
return (await lazyTransport()).transport();
|
|
70
82
|
},
|
package/dist/version.js
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
// literal below on release; every manifest that carries a version is listed in
|
|
3
3
|
// release-please-config.json's extra-files and kept in lockstep by
|
|
4
4
|
// tests/version-sync.test.ts. Keep the release marker on the export line only.
|
|
5
|
-
export const VERSION = '0.
|
|
5
|
+
export const VERSION = '0.2.0'; // x-release-please-version
|