@cookiemunch/mcp 0.8.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Every published release, newest first. Dates are the day the version was cut. Each release tracks the same-numbered `@cookiemunch/sdk`.
4
4
 
5
+ ## 0.9.0 (2026-10-30)
6
+
7
+ - Added: `get_site_upcoming_regulations`. Built on `@cookiemunch/sdk` 0.9.0.
8
+
5
9
  ## 0.8.0 (2026-10-30)
6
10
 
7
11
  - Added: `connect_dsar_executor` takes `mintFrom` and `externalId`; `secretKey` is optional. Built on `@cookiemunch/sdk` 0.8.0.
package/dist/bin.cjs CHANGED
@@ -17,7 +17,7 @@ function registerConfigTools(tool, client) {
17
17
  const blockingModeEnum = import_zod.z.enum(["auto", "manual"]);
18
18
  const bannerModeEnum = import_zod.z.enum(["opt-in", "opt-out", "off"]);
19
19
  const bannerTypeEnum = import_zod.z.enum(["multilevel", "inline", "accept-decline", "accept-only", "do-not-sell"]);
20
- const bannerLayoutEnum = import_zod.z.enum(["top", "bottom", "push-down", "popup", "overlay"]);
20
+ const bannerLayoutEnum = import_zod.z.enum(["top", "bottom", "push-down", "popup", "overlay", "sidebar"]);
21
21
  const consentModeModeEnum = import_zod.z.enum(["basic", "advanced"]);
22
22
  const geoRuleSchema = import_zod.z.object({
23
23
  match: import_zod.z.object({
@@ -193,9 +193,14 @@ function registerConfigTools(tool, client) {
193
193
  const setBannerBasicsSchema = import_zod.z.object({
194
194
  cbid: import_zod.z.string().describe("Site identifier (cbid)."),
195
195
  type: bannerTypeEnum.optional().describe("Banner type. multilevel | inline | accept-decline | accept-only | do-not-sell."),
196
- layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay."),
196
+ layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay | sidebar."),
197
197
  preset: import_zod.z.enum(["bar", "box", "full"]).optional().describe("Named shape that sets type/secondLayer (and layout for box): bar = slim one-row bar + categories in a modal; box = centred card + modal; full = every category in the first layer."),
198
- secondLayer: import_zod.z.enum(["expand", "popup", "modal"]).optional().describe("Where the categories open from an inline banner."),
198
+ secondLayer: import_zod.z.enum(["expand", "popup", "modal", "sidebar"]).optional().describe("Where the categories open from an inline banner."),
199
+ sidebar: import_zod.z.object({
200
+ side: import_zod.z.enum(["left", "right"]).optional(),
201
+ width: import_zod.z.number().min(280).max(640).optional(),
202
+ backdrop: import_zod.z.boolean().optional()
203
+ }).optional().describe("The drawer of a sidebar layout or second layer: side (default right, mirrored for RTL), width in px 280\u2013640 (default 400), backdrop (default true). Merged onto the stored value."),
199
204
  density: import_zod.z.enum(["comfortable", "compact"]).optional().describe("compact = one-row bar from 760px wide."),
200
205
  theme: import_zod.z.record(import_zod.z.unknown()).optional().describe("Partial ThemeTokens \u2014 deep-merged onto the existing banner theme. Includes `scrollbar`: { style: themed|thin|native|hidden, thumb?, thumbHover?, track?, width? 4\u201316, radius? 0\u2013999 }."),
201
206
  content: import_zod.z.record(import_zod.z.unknown()).optional().describe("Partial BannerContent \u2014 banner copy overrides (title, body, button labels, policyUrl, etc.).")
@@ -205,7 +210,7 @@ function registerConfigTools(tool, client) {
205
210
  "Configure v1 banner appearance for a site: preset, type, layout, second layer, density, theme tokens, and copy (content.preferencesTitle titles the preferences dialog). Fetches the current config, patches only those banner fields, and PUTs. Setting type or secondLayer (or layout under the box preset) without a preset removes the stored preset, which would otherwise re-derive them.",
206
211
  setBannerBasicsSchema.shape,
207
212
  async (a) => {
208
- const { cbid: siteId, type, layout, preset, secondLayer, density, theme, content } = setBannerBasicsSchema.parse(a);
213
+ const { cbid: siteId, type, layout, preset, secondLayer, sidebar, density, theme, content } = setBannerBasicsSchema.parse(a);
209
214
  const cfg = await client.sites.getConfig(siteId);
210
215
  const existingBanner = cfg["banner"] ?? {};
211
216
  const existingTheme = existingBanner["theme"] ?? {};
@@ -215,12 +220,14 @@ function registerConfigTools(tool, client) {
215
220
  ...type !== void 0 ? { type } : {},
216
221
  ...layout !== void 0 ? { layout } : {},
217
222
  ...secondLayer !== void 0 ? { secondLayer } : {},
223
+ ...sidebar !== void 0 ? { sidebar: { ...existingBanner["sidebar"], ...sidebar } } : {},
218
224
  ...density !== void 0 ? { density } : {},
219
225
  ...preset !== void 0 ? { preset } : {},
220
226
  ...theme !== void 0 ? { theme: { ...existingTheme, ...theme } } : {},
221
227
  ...content !== void 0 ? { content: { ...existingContent, ...content } } : {}
222
228
  };
223
- const owned = type !== void 0 || secondLayer !== void 0 || layout !== void 0 && banner["preset"] === "box";
229
+ const ownedLayout = layout !== void 0 && (banner["preset"] === "box" || banner["preset"] === "bar" && !["top", "bottom", "push-down"].includes(layout));
230
+ const owned = type !== void 0 || secondLayer !== void 0 || ownedLayout;
224
231
  if (preset === void 0 && owned) delete banner["preset"];
225
232
  return client.sites.putConfig(siteId, { ...cfg, banner });
226
233
  }
@@ -514,6 +521,19 @@ function registerPlatformTools(tool, client) {
514
521
  { days: import_zod2.z.number().int().positive().optional() },
515
522
  (a) => client.regulatory.upcoming(a.days)
516
523
  );
524
+ tool(
525
+ "get_site_upcoming_regulations",
526
+ "Privacy laws taking effect soon (default 90 days) where a site\u2019s visitors are: those whose jurisdiction holds at least minShare (default 0.01) of the site\u2019s last 30 days of consent decisions. Each has daysUntil, trafficShare and, for a US state law, what changes (GPC duty, sensitive-data opt-in, minors rule). A shipped dataset with a review date, not legal advice.",
527
+ {
528
+ cbid: import_zod2.z.string().describe("The site id."),
529
+ days: import_zod2.z.number().int().positive().optional(),
530
+ minShare: import_zod2.z.number().min(0).max(1).optional()
531
+ },
532
+ (a) => client.regulatory.upcomingForSite(a.cbid, {
533
+ ...a.days !== void 0 ? { days: a.days } : {},
534
+ ...a.minShare !== void 0 ? { minShare: a.minShare } : {}
535
+ })
536
+ );
517
537
  tool(
518
538
  "get_dsr_sla",
519
539
  "The rights queue at a glance: how many requests are overdue, due today, due soon or on track, plus the overdue ids.",
@@ -2443,7 +2463,7 @@ ${JSON.stringify(r, null, 2)}` : r;
2443
2463
  }
2444
2464
 
2445
2465
  // src/index.ts
2446
- var MCP_VERSION = "0.8.0";
2466
+ var MCP_VERSION = "0.9.0";
2447
2467
  function createCookieMunchMcp(opts) {
2448
2468
  const client = opts.client ?? (0, import_sdk.createCookieMunch)({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
2449
2469
  const server = new import_mcp.McpServer({ name: "cookiemunch", version: "1.0.0" });