@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/dist/bin.js CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  createCookieMunchMcp
4
- } from "./chunk-E2YZUVQY.js";
4
+ } from "./chunk-FI6MOPOJ.js";
5
5
 
6
6
  // src/bin.ts
7
7
  import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
@@ -11,7 +11,7 @@ function registerConfigTools(tool, client) {
11
11
  const blockingModeEnum = z.enum(["auto", "manual"]);
12
12
  const bannerModeEnum = z.enum(["opt-in", "opt-out", "off"]);
13
13
  const bannerTypeEnum = z.enum(["multilevel", "inline", "accept-decline", "accept-only", "do-not-sell"]);
14
- const bannerLayoutEnum = z.enum(["top", "bottom", "push-down", "popup", "overlay"]);
14
+ const bannerLayoutEnum = z.enum(["top", "bottom", "push-down", "popup", "overlay", "sidebar"]);
15
15
  const consentModeModeEnum = z.enum(["basic", "advanced"]);
16
16
  const geoRuleSchema = z.object({
17
17
  match: z.object({
@@ -187,9 +187,14 @@ function registerConfigTools(tool, client) {
187
187
  const setBannerBasicsSchema = z.object({
188
188
  cbid: z.string().describe("Site identifier (cbid)."),
189
189
  type: bannerTypeEnum.optional().describe("Banner type. multilevel | inline | accept-decline | accept-only | do-not-sell."),
190
- layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay."),
190
+ layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay | sidebar."),
191
191
  preset: 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."),
192
- secondLayer: z.enum(["expand", "popup", "modal"]).optional().describe("Where the categories open from an inline banner."),
192
+ secondLayer: z.enum(["expand", "popup", "modal", "sidebar"]).optional().describe("Where the categories open from an inline banner."),
193
+ sidebar: z.object({
194
+ side: z.enum(["left", "right"]).optional(),
195
+ width: z.number().min(280).max(640).optional(),
196
+ backdrop: z.boolean().optional()
197
+ }).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."),
193
198
  density: z.enum(["comfortable", "compact"]).optional().describe("compact = one-row bar from 760px wide."),
194
199
  theme: z.record(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 }."),
195
200
  content: z.record(z.unknown()).optional().describe("Partial BannerContent \u2014 banner copy overrides (title, body, button labels, policyUrl, etc.).")
@@ -199,7 +204,7 @@ function registerConfigTools(tool, client) {
199
204
  "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.",
200
205
  setBannerBasicsSchema.shape,
201
206
  async (a) => {
202
- const { cbid: siteId, type, layout, preset, secondLayer, density, theme, content } = setBannerBasicsSchema.parse(a);
207
+ const { cbid: siteId, type, layout, preset, secondLayer, sidebar, density, theme, content } = setBannerBasicsSchema.parse(a);
203
208
  const cfg = await client.sites.getConfig(siteId);
204
209
  const existingBanner = cfg["banner"] ?? {};
205
210
  const existingTheme = existingBanner["theme"] ?? {};
@@ -209,12 +214,14 @@ function registerConfigTools(tool, client) {
209
214
  ...type !== void 0 ? { type } : {},
210
215
  ...layout !== void 0 ? { layout } : {},
211
216
  ...secondLayer !== void 0 ? { secondLayer } : {},
217
+ ...sidebar !== void 0 ? { sidebar: { ...existingBanner["sidebar"], ...sidebar } } : {},
212
218
  ...density !== void 0 ? { density } : {},
213
219
  ...preset !== void 0 ? { preset } : {},
214
220
  ...theme !== void 0 ? { theme: { ...existingTheme, ...theme } } : {},
215
221
  ...content !== void 0 ? { content: { ...existingContent, ...content } } : {}
216
222
  };
217
- const owned = type !== void 0 || secondLayer !== void 0 || layout !== void 0 && banner["preset"] === "box";
223
+ const ownedLayout = layout !== void 0 && (banner["preset"] === "box" || banner["preset"] === "bar" && !["top", "bottom", "push-down"].includes(layout));
224
+ const owned = type !== void 0 || secondLayer !== void 0 || ownedLayout;
218
225
  if (preset === void 0 && owned) delete banner["preset"];
219
226
  return client.sites.putConfig(siteId, { ...cfg, banner });
220
227
  }
@@ -508,6 +515,19 @@ function registerPlatformTools(tool, client) {
508
515
  { days: z2.number().int().positive().optional() },
509
516
  (a) => client.regulatory.upcoming(a.days)
510
517
  );
518
+ tool(
519
+ "get_site_upcoming_regulations",
520
+ "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.",
521
+ {
522
+ cbid: z2.string().describe("The site id."),
523
+ days: z2.number().int().positive().optional(),
524
+ minShare: z2.number().min(0).max(1).optional()
525
+ },
526
+ (a) => client.regulatory.upcomingForSite(a.cbid, {
527
+ ...a.days !== void 0 ? { days: a.days } : {},
528
+ ...a.minShare !== void 0 ? { minShare: a.minShare } : {}
529
+ })
530
+ );
511
531
  tool(
512
532
  "get_dsr_sla",
513
533
  "The rights queue at a glance: how many requests are overdue, due today, due soon or on track, plus the overdue ids.",
@@ -2437,7 +2457,7 @@ ${JSON.stringify(r, null, 2)}` : r;
2437
2457
  }
2438
2458
 
2439
2459
  // src/index.ts
2440
- var MCP_VERSION = "0.8.0";
2460
+ var MCP_VERSION = "0.9.0";
2441
2461
  function createCookieMunchMcp(opts) {
2442
2462
  const client = opts.client ?? createCookieMunch({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
2443
2463
  const server = new McpServer({ name: "cookiemunch", version: "1.0.0" });
@@ -2450,4 +2470,4 @@ export {
2450
2470
  MCP_VERSION,
2451
2471
  createCookieMunchMcp
2452
2472
  };
2453
- //# sourceMappingURL=chunk-E2YZUVQY.js.map
2473
+ //# sourceMappingURL=chunk-FI6MOPOJ.js.map