@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/index.cjs CHANGED
@@ -37,7 +37,7 @@ function registerConfigTools(tool, client) {
37
37
  const blockingModeEnum = import_zod.z.enum(["auto", "manual"]);
38
38
  const bannerModeEnum = import_zod.z.enum(["opt-in", "opt-out", "off"]);
39
39
  const bannerTypeEnum = import_zod.z.enum(["multilevel", "inline", "accept-decline", "accept-only", "do-not-sell"]);
40
- const bannerLayoutEnum = import_zod.z.enum(["top", "bottom", "push-down", "popup", "overlay"]);
40
+ const bannerLayoutEnum = import_zod.z.enum(["top", "bottom", "push-down", "popup", "overlay", "sidebar"]);
41
41
  const consentModeModeEnum = import_zod.z.enum(["basic", "advanced"]);
42
42
  const geoRuleSchema = import_zod.z.object({
43
43
  match: import_zod.z.object({
@@ -213,9 +213,14 @@ function registerConfigTools(tool, client) {
213
213
  const setBannerBasicsSchema = import_zod.z.object({
214
214
  cbid: import_zod.z.string().describe("Site identifier (cbid)."),
215
215
  type: bannerTypeEnum.optional().describe("Banner type. multilevel | inline | accept-decline | accept-only | do-not-sell."),
216
- layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay."),
216
+ layout: bannerLayoutEnum.optional().describe("Banner layout. top | bottom | push-down | popup | overlay | sidebar."),
217
217
  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."),
218
- secondLayer: import_zod.z.enum(["expand", "popup", "modal"]).optional().describe("Where the categories open from an inline banner."),
218
+ secondLayer: import_zod.z.enum(["expand", "popup", "modal", "sidebar"]).optional().describe("Where the categories open from an inline banner."),
219
+ sidebar: import_zod.z.object({
220
+ side: import_zod.z.enum(["left", "right"]).optional(),
221
+ width: import_zod.z.number().min(280).max(640).optional(),
222
+ backdrop: import_zod.z.boolean().optional()
223
+ }).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."),
219
224
  density: import_zod.z.enum(["comfortable", "compact"]).optional().describe("compact = one-row bar from 760px wide."),
220
225
  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 }."),
221
226
  content: import_zod.z.record(import_zod.z.unknown()).optional().describe("Partial BannerContent \u2014 banner copy overrides (title, body, button labels, policyUrl, etc.).")
@@ -225,7 +230,7 @@ function registerConfigTools(tool, client) {
225
230
  "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.",
226
231
  setBannerBasicsSchema.shape,
227
232
  async (a) => {
228
- const { cbid: siteId, type, layout, preset, secondLayer, density, theme, content } = setBannerBasicsSchema.parse(a);
233
+ const { cbid: siteId, type, layout, preset, secondLayer, sidebar, density, theme, content } = setBannerBasicsSchema.parse(a);
229
234
  const cfg = await client.sites.getConfig(siteId);
230
235
  const existingBanner = cfg["banner"] ?? {};
231
236
  const existingTheme = existingBanner["theme"] ?? {};
@@ -235,12 +240,14 @@ function registerConfigTools(tool, client) {
235
240
  ...type !== void 0 ? { type } : {},
236
241
  ...layout !== void 0 ? { layout } : {},
237
242
  ...secondLayer !== void 0 ? { secondLayer } : {},
243
+ ...sidebar !== void 0 ? { sidebar: { ...existingBanner["sidebar"], ...sidebar } } : {},
238
244
  ...density !== void 0 ? { density } : {},
239
245
  ...preset !== void 0 ? { preset } : {},
240
246
  ...theme !== void 0 ? { theme: { ...existingTheme, ...theme } } : {},
241
247
  ...content !== void 0 ? { content: { ...existingContent, ...content } } : {}
242
248
  };
243
- const owned = type !== void 0 || secondLayer !== void 0 || layout !== void 0 && banner["preset"] === "box";
249
+ const ownedLayout = layout !== void 0 && (banner["preset"] === "box" || banner["preset"] === "bar" && !["top", "bottom", "push-down"].includes(layout));
250
+ const owned = type !== void 0 || secondLayer !== void 0 || ownedLayout;
244
251
  if (preset === void 0 && owned) delete banner["preset"];
245
252
  return client.sites.putConfig(siteId, { ...cfg, banner });
246
253
  }
@@ -534,6 +541,19 @@ function registerPlatformTools(tool, client) {
534
541
  { days: import_zod2.z.number().int().positive().optional() },
535
542
  (a) => client.regulatory.upcoming(a.days)
536
543
  );
544
+ tool(
545
+ "get_site_upcoming_regulations",
546
+ "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.",
547
+ {
548
+ cbid: import_zod2.z.string().describe("The site id."),
549
+ days: import_zod2.z.number().int().positive().optional(),
550
+ minShare: import_zod2.z.number().min(0).max(1).optional()
551
+ },
552
+ (a) => client.regulatory.upcomingForSite(a.cbid, {
553
+ ...a.days !== void 0 ? { days: a.days } : {},
554
+ ...a.minShare !== void 0 ? { minShare: a.minShare } : {}
555
+ })
556
+ );
537
557
  tool(
538
558
  "get_dsr_sla",
539
559
  "The rights queue at a glance: how many requests are overdue, due today, due soon or on track, plus the overdue ids.",
@@ -2463,7 +2483,7 @@ ${JSON.stringify(r, null, 2)}` : r;
2463
2483
  }
2464
2484
 
2465
2485
  // src/index.ts
2466
- var MCP_VERSION = "0.8.0";
2486
+ var MCP_VERSION = "0.9.0";
2467
2487
  function createCookieMunchMcp(opts) {
2468
2488
  const client = opts.client ?? (0, import_sdk.createCookieMunch)({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
2469
2489
  const server = new import_mcp.McpServer({ name: "cookiemunch", version: "1.0.0" });