@cookiemunch/mcp 0.7.1 → 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.",
@@ -577,8 +597,10 @@ function registerPlatformTools(tool, client) {
577
597
  revokeAtlasIdGrant: import_zod2.z.boolean().optional().describe("A preset param, when the preset's params list it: default false. True adds an optional step that revokes the person's app grant on erasure; a credential without the scope reports skipped: insufficient_scope."),
578
598
  label: import_zod2.z.string().optional().describe("Your name for the credential, shown beside keyPrefix."),
579
599
  system: import_zod2.z.string().optional().describe("The name this connection answers to in a plan, e.g. identity or crm. Required unless the preset has a default."),
580
- baseUrl: import_zod2.z.string().optional().describe("The system's public https origin. Required unless the preset sets it."),
581
- secretKey: import_zod2.z.string().describe("Its API key, with whatever scope that system needs to export and erase a user."),
600
+ baseUrl: import_zod2.z.string().optional().describe("The system's public https origin, or a base with a path (cm-standard-v1 v4 on: the path replaces /api/privacy; cm-standard-v2: the contract paths hang off it). Required unless the preset sets it."),
601
+ secretKey: import_zod2.z.string().optional().describe("Its API key, with whatever scope that system needs to export and erase a user. Send this or mintFrom."),
602
+ mintFrom: import_zod2.z.string().optional().describe("In place of secretKey: a partner id (one that registered an executorKeyUrl, e.g. chatly, forumulate, referalli) that mints the key for the site under its partner link. The connection is scoped to that site. With dryRun, the answer's mint says who would mint it; nothing is minted."),
603
+ externalId: import_zod2.z.string().optional().describe("With mintFrom: the partner account the key is minted for. Default: the one the site's live link for that partner names."),
582
604
  webhookSecret: import_zod2.z.string().optional().describe("Signing secret of its webhook endpoint. Optional: polling closes tasks without it."),
583
605
  auto: import_zod2.z.boolean().optional().describe("Open a sub-task automatically when a request reaches fulfilment. Default true."),
584
606
  orchestrator: import_zod2.z.union([import_zod2.z.literal(1), import_zod2.z.literal(2)]).optional().describe("How it takes part in cases. Default 2 (v2 headers on every call); 1 is the v1 adapter. The answer carries a completionSecret, shown once, that signs its completions."),
@@ -947,12 +969,12 @@ function registerKeyAndTagTools(tool, client) {
947
969
  const tagsSchema = import_zod4.z.object({
948
970
  type: import_zod4.z.enum(TAGGED),
949
971
  id: import_zod4.z.string(),
950
- metadata: import_zod4.z.record(import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean(), import_zod4.z.null()])).describe("Keys to set; null removes one. forgedeck_sandbox cannot be set here."),
972
+ metadata: import_zod4.z.record(import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean(), import_zod4.z.null()])).describe("Keys to set; null removes one. stack_sandbox cannot be set here."),
951
973
  dryRun: import_zod4.z.boolean().optional().describe("Answer with the diff, storing nothing. Do this first.")
952
974
  });
953
975
  tool(
954
976
  "update_resource_tags",
955
- "Change a resource\u2019s tags (merge). For adopting resources created before tags existed, e.g. forgedeck_product and forgedeck_env. A resource can never be made a sandbox after it was created.",
977
+ "Change a resource\u2019s tags (merge). For adopting resources created before tags existed, e.g. stack_product and stack_env. A resource can never be made a sandbox after it was created.",
956
978
  tagsSchema.shape,
957
979
  (a) => {
958
980
  const { type, id, metadata, dryRun } = tagsSchema.parse(a);
@@ -987,7 +1009,7 @@ function registerKeyAndTagTools(tool, client) {
987
1009
  );
988
1010
  tool(
989
1011
  "get_provision_env",
990
- "What `forgedeck env` writes for a product provisioned with this forgedeck ref: variable names, non-secret values (cbid, script URL, API base) and references for secrets, never a secret. Read-only.",
1012
+ "What `env` writes for a product provisioned with this stack ref: variable names, non-secret values (cbid, script URL, API base) and references for secrets, never a secret. Read-only.",
991
1013
  { ref: import_zod4.z.string() },
992
1014
  (a) => client.provisionEnv(a.ref)
993
1015
  );
@@ -1433,13 +1455,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1433
1455
  type: import_zod6.z.string().describe("access | deletion | closure | restriction | rectification, or erasure / erase / export."),
1434
1456
  emails: import_zod6.z.array(import_zod6.z.string()).optional().describe("The person's addresses."),
1435
1457
  identity: import_zod6.z.object({ iss: import_zod6.z.string(), sub: import_zod6.z.string(), ext: import_zod6.z.string().optional(), principal: import_zod6.z.string().optional() }).optional().describe("A signed-in identity from the site's sign-in issuer. People are never linked on email when it is present."),
1436
- source: import_zod6.z.enum(["product", "atlas", "admin"]).optional(),
1458
+ source: import_zod6.z.enum(["product", "identity", "admin"]).optional().describe("identity: the site's sign-in provider, whichever it is."),
1437
1459
  reason: import_zod6.z.string().optional(),
1438
1460
  skipSystems: import_zod6.z.array(import_zod6.z.string()).optional().describe("System names, connection ids, or self."),
1439
1461
  fulfill: import_zod6.z.boolean().optional(),
1440
1462
  test: import_zod6.z.boolean().optional(),
1441
1463
  idempotencyKey: import_zod6.z.string().optional(),
1442
- trace: import_zod6.z.string().optional().describe("An X-ForgeDeck-Trace to keep, from the caller.")
1464
+ trace: import_zod6.z.string().optional().describe("An X-Trace-Id to keep, from the caller.")
1443
1465
  },
1444
1466
  (a) => client.dsar.openCase(
1445
1467
  {
@@ -1478,7 +1500,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1478
1500
  );
1479
1501
  tool(
1480
1502
  "find_dsar_by_trace",
1481
- "The rights request carrying one X-ForgeDeck-Trace id \u2014 to follow one event across products. Read-only.",
1503
+ "The rights request carrying one X-Trace-Id id \u2014 to follow one event across products. Read-only.",
1482
1504
  { trace: import_zod6.z.string() },
1483
1505
  (a) => client.dsar.listByTrace(a.trace)
1484
1506
  );
@@ -1508,6 +1530,22 @@ ${JSON.stringify(r, null, 2)}` : r;
1508
1530
  typeof a.iss === "string" && typeof a.sub === "string" ? { iss: a.iss, sub: a.sub } : { email: String(a.email ?? "") }
1509
1531
  )
1510
1532
  );
1533
+ tool(
1534
+ "connect_identity_provider",
1535
+ "Connect an identity provider's privacy orchestrator in one call, so it opens a rights case here when a person deletes their account there. Mints a key holding only dsar:write, locked to the site (no keys:write needed), and hands it to the provider, authorised with the provider instance key. The minted key is never returned, only its prefix; connecting again replaces it. Built in: atlas. Any other provider: pass connector. Run with dryRun first: it mints and sends nothing.",
1536
+ {
1537
+ provider: import_zod6.z.string().describe("The provider id, e.g. atlas."),
1538
+ cbid: import_zod6.z.string().describe("The site the provider opens cases on."),
1539
+ providerKey: import_zod6.z.string().describe("The provider instance's secret key (Atlas: the instance secret key). Used for this one call, never stored."),
1540
+ connector: import_zod6.z.object({ url: import_zod6.z.string(), method: import_zod6.z.enum(["PUT", "POST"]).optional(), body: import_zod6.z.record(import_zod6.z.unknown()) }).optional().describe('Only for a provider with no built-in connector: its https orchestrator URL and JSON body; a body value "{apiKey}" becomes the minted key.'),
1541
+ dryRun: import_zod6.z.boolean().optional().describe("Show the key and the request that would be made, minting and sending nothing.")
1542
+ },
1543
+ (a) => client.integrations.connect(
1544
+ a.provider,
1545
+ { cbid: a.cbid, providerKey: a.providerKey, ...a.connector ? { connector: a.connector } : {} },
1546
+ { dryRun: a.dryRun === true }
1547
+ )
1548
+ );
1511
1549
  tool(
1512
1550
  "advance_dsar",
1513
1551
  "Advance a DSAR to a new status (received \u2192 verifying \u2192 in_progress \u2192 completed, or rejected).",
@@ -1895,7 +1933,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1895
1933
  (a) => client.sites.applyImport(a.cbid, a.data, a.overwrite ? { overwrite: true } : void 0)
1896
1934
  );
1897
1935
  const declarationShape = {
1898
- category: import_zod6.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1936
+ category: import_zod6.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.suite or categories.custom ids."),
1899
1937
  purpose: import_zod6.z.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1900
1938
  purposes: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().max(1e3)).nullable().optional().describe('The purpose in other languages, keyed by BCP-47 tag: {"es": "\u2026", "pt-BR": "\u2026"}. The banner, data-cc="declaration" and cookie-declaration.js draw the visitor\u2019s language. null clears.'),
1901
1939
  provider: import_zod6.z.string().optional(),
@@ -2445,7 +2483,7 @@ ${JSON.stringify(r, null, 2)}` : r;
2445
2483
  }
2446
2484
 
2447
2485
  // src/index.ts
2448
- var MCP_VERSION = "0.7.1";
2486
+ var MCP_VERSION = "0.9.0";
2449
2487
  function createCookieMunchMcp(opts) {
2450
2488
  const client = opts.client ?? (0, import_sdk.createCookieMunch)({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
2451
2489
  const server = new import_mcp.McpServer({ name: "cookiemunch", version: "1.0.0" });