@cookiemunch/mcp 0.1.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.
@@ -3,7 +3,7 @@ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
3
  import { createCookieMunch } from "@cookiemunch/sdk";
4
4
 
5
5
  // src/tools.ts
6
- import { z as z3 } from "zod";
6
+ import { z as z4 } from "zod";
7
7
 
8
8
  // src/tools-config.ts
9
9
  import { z } from "zod";
@@ -543,9 +543,29 @@ function registerPlatformTools(tool, client) {
543
543
  secretKey: z2.string().describe("Its API key, with whatever scope that system needs to export and erase a user."),
544
544
  webhookSecret: z2.string().optional().describe("Signing secret of its webhook endpoint. Optional: polling closes tasks without it."),
545
545
  auto: z2.boolean().optional().describe("Open a sub-task automatically when a request reaches fulfilment. Default true."),
546
- profile: z2.record(z2.unknown()).describe("How to drive that system: { open, poll, statuses } required, plus optional subjectLookup, auth, idempotencyHeader and webhook. See the connected-systems docs for the shape.")
546
+ profile: z2.record(z2.unknown()).describe("How to drive that system: { open, poll, statuses } required, plus optional subjectLookup, auth, idempotencyHeader and webhook. See the connected-systems docs for the shape."),
547
+ dryRun: z2.boolean().optional().describe("Validate everything and answer the connection that would be created, storing nothing.")
547
548
  },
548
- (a) => client.fulfillment.connectExecutor(a)
549
+ (a) => {
550
+ const { dryRun, ...input } = a;
551
+ return dryRun === true ? client.fulfillment.dryRunConnectExecutor(input) : client.fulfillment.connectExecutor(input);
552
+ }
553
+ );
554
+ tool(
555
+ "test_dsar_executor_webhook",
556
+ "Would this webhook delivery from a connected system verify? Runs the receiver's exact check (headers, timestamp tolerance, prefix, HMAC) on headers and a raw body you supply, acts on nothing, and returns { verified, stage, reason } naming the stage that failed. `body` must be the raw request body string, byte for byte. Read-only.",
557
+ {
558
+ id: z2.string().describe("The connection id."),
559
+ headers: z2.record(z2.string()).describe("The delivery headers, e.g. its id, timestamp and signature headers."),
560
+ body: z2.string().describe("The raw body exactly as it was signed.")
561
+ },
562
+ (a) => client.fulfillment.testExecutorWebhook(a.id, { headers: a.headers, body: a.body })
563
+ );
564
+ tool(
565
+ "list_dsar_executor_webhook_deliveries",
566
+ "The last 50 deliveries to a connected system's webhook, newest first, each with whether it verified and, if not, the stage and reason. Never includes the secret, the signature or the body (only a short hash and size). Read-only.",
567
+ { id: z2.string().describe("The connection id.") },
568
+ (a) => client.fulfillment.executorWebhookDeliveries(a.id)
549
569
  );
550
570
  tool(
551
571
  "disconnect_dsar_executor",
@@ -658,10 +678,176 @@ function registerPlatformTools(tool, client) {
658
678
  );
659
679
  }
660
680
 
681
+ // src/tools-rights-page.ts
682
+ import { z as z3 } from "zod";
683
+ function registerRightsTools(tool, client) {
684
+ const cbid = { cbid: z3.string().describe("Site identifier (cbid). Must belong to your org.") };
685
+ const base = {
686
+ baseUpdatedAt: z3.union([z3.number().int(), z3.string(), z3.null()]).optional().describe("The draft\u2019s updatedAt from your last read (null if it had none). If someone saved since, the write is refused with 409 draft_conflict and the current draft; omit to overwrite regardless.")
687
+ };
688
+ const baseOpt = (a) => a.baseUpdatedAt !== void 0 ? { baseUpdatedAt: a.baseUpdatedAt } : {};
689
+ tool("get_rights_page", "Read the site\u2019s rights page DRAFT (the default page until first saved), with warnings that would block publishing.", cbid, (a) => client.rightsPage.get(a.cbid));
690
+ tool(
691
+ "update_rights_page",
692
+ "Replace the rights page draft with a full document (theme, sections, form, i18n, seo, customCss). Nothing goes live until publish_rights_page. Prefer patch_rights_page for small changes and preview_rights_page when unsure. Pass baseUpdatedAt (from get_rights_page) to avoid overwriting someone else\u2019s save: a mismatch is 409 draft_conflict with the current draft.",
693
+ { ...cbid, page: z3.record(z3.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
694
+ (a) => client.rightsPage.put(a.cbid, a.page, baseOpt(a))
695
+ );
696
+ tool(
697
+ "patch_rights_page",
698
+ "Change part of the rights page draft: objects merge, arrays (sections, request types, fields) replace whole, null removes a field. baseUpdatedAt works as on update_rights_page (409 draft_conflict).",
699
+ { ...cbid, patch: z3.record(z3.unknown()), ...base },
700
+ (a) => client.rightsPage.patch(a.cbid, a.patch, baseOpt(a))
701
+ );
702
+ tool(
703
+ "preview_rights_page",
704
+ 'Validate a rights-page write WITHOUT saving: returns the document as it would be stored and any publish warnings. mode "patch" (default) or "put".',
705
+ { ...cbid, page: z3.record(z3.unknown()), mode: z3.enum(["patch", "put"]).optional() },
706
+ (a) => client.rightsPage.dryRun(a.cbid, a.page, { mode: a.mode ?? "patch" })
707
+ );
708
+ tool("get_published_rights_page", "Read the LIVE rights page document (404 not_published while the site shows the default page).", cbid, (a) => client.rightsPage.getPublished(a.cbid));
709
+ tool(
710
+ "publish_rights_page",
711
+ "Publish the draft as the next version: it goes live at once, to every visitor. Refused unless the page has exactly one form section and an enabled request type. Pass baseUpdatedAt (from get_rights_page) so only the draft you read goes live; without it, whatever the draft holds now is published, including someone else\u2019s later edits. A mismatch is 409 draft_conflict with the current draft.",
712
+ { ...cbid, ...base },
713
+ (a) => client.rightsPage.publish(a.cbid, baseOpt(a))
714
+ );
715
+ tool("list_rights_page_versions", "Published versions of the rights page, newest first, each with publishedBy, publishedByEmail (null for an API key) and publishedVia.", cbid, (a) => client.rightsPage.versions(a.cbid));
716
+ tool(
717
+ "rollback_rights_page",
718
+ "Publish an earlier version of the rights page again (as a new version): it goes live at once and REPLACES the current draft, so unpublished edits are lost and cannot be recovered (versions hold only published documents). Pass baseUpdatedAt (from get_rights_page) to refuse with 409 draft_conflict if anyone saved the draft since you read it.",
719
+ { ...cbid, version: z3.number().int().min(1), ...base },
720
+ (a) => client.rightsPage.rollback(a.cbid, a.version, baseOpt(a))
721
+ );
722
+ }
723
+ function registerRightsPageTools(tool, client) {
724
+ const site = z3.object({ cbid: z3.string().describe("Site identifier (cbid). Must belong to your org.") });
725
+ const host = site.extend({
726
+ hostname: z3.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
727
+ });
728
+ tool(
729
+ "list_rights_page_domains",
730
+ "List the custom hostnames serving a site's rights page, each with its status (pending_dns, verifying, issuing, active, error), the exact DNS records to create, and the plan's allowance.",
731
+ site.shape,
732
+ (a) => client.rightsPage.listDomains(site.parse(a).cbid)
733
+ );
734
+ tool(
735
+ "add_rights_page_domain",
736
+ "Add a custom hostname for a site's rights page (e.g. privacy.example.com). Returns the DNS records the owner must create: a CNAME to this domain's own <token>.cname.cookiemunch.net (a CNAME to anything else never verifies it), or for an apex / flattened / proxied record the _cookiemunch TXT. Then call verify_rights_page_domain. Plans include Free 0, Starter 1, Pro 5, Scale unlimited.",
737
+ host.shape,
738
+ (a) => {
739
+ const { cbid, hostname } = host.parse(a);
740
+ return client.rightsPage.addDomain(cbid, hostname);
741
+ }
742
+ );
743
+ tool(
744
+ "verify_rights_page_domain",
745
+ "Check a custom hostname now: DNS while it is pending or in error, the HTTPS answer once it is routed. Returns the domain as it now stands; lastError and dnsSeen say what is missing.",
746
+ host.shape,
747
+ (a) => {
748
+ const { cbid, hostname } = host.parse(a);
749
+ return client.rightsPage.verifyDomain(cbid, hostname);
750
+ }
751
+ );
752
+ tool(
753
+ "remove_rights_page_domain",
754
+ "Remove a custom hostname from a site's rights page. It stops being served at once and its certificate is no longer renewed.",
755
+ host.shape,
756
+ async (a) => {
757
+ const { cbid, hostname } = host.parse(a);
758
+ await client.rightsPage.removeDomain(cbid, hostname);
759
+ return { removed: hostname };
760
+ }
761
+ );
762
+ }
763
+
764
+ // src/design-warnings.ts
765
+ function whereText(f) {
766
+ const w = f.where ?? {};
767
+ const bits = [
768
+ f.layer === "banner" ? "first layer" : `${f.layer} layer`,
769
+ w.view ? `view "${w.view}"` : "",
770
+ w.variant && w.variant !== "base" ? `variant ${w.variant}` : "",
771
+ w.theme === "dark" ? "dark theme" : "",
772
+ w.breakpoint === "mobile" ? "mobile" : "",
773
+ w.language ? `language ${w.language}` : "",
774
+ w.url ? w.url : ""
775
+ ].filter(Boolean);
776
+ return bits.join(", ");
777
+ }
778
+ function styleText(s) {
779
+ const parts = [
780
+ s.background ? `background ${s.background}` : "",
781
+ s.color ? `text ${s.color}` : "",
782
+ s.borderColor ? `border ${s.borderWidth ?? 1}px ${s.borderColor}` : "",
783
+ s.fontSize ? `font ${s.fontSize}px` : "",
784
+ s.fontWeight ? `weight ${s.fontWeight}` : "",
785
+ s.width && s.height ? `${Math.round(s.width)}\xD7${Math.round(s.height)}px` : ""
786
+ ].filter(Boolean);
787
+ return parts.join(", ");
788
+ }
789
+ var CONTEXT_TEXT = {
790
+ saved: "The config was saved as sent; this is a warning, not an error.",
791
+ preview: "Nothing was saved: this is a preview of the write.",
792
+ lint: "Nothing was saved: this is a lint of a proposed config.",
793
+ read: "This describes the config as it is stored now; nothing was changed.",
794
+ scan: "This was measured on the live site by the last cookie scan; fix the banner, then scan again."
795
+ };
796
+ function designContext(tool, value) {
797
+ const v = value && typeof value === "object" ? value : {};
798
+ if (tool === "lint_banner_config") return "lint";
799
+ if (v.dryRun === true || tool.startsWith("preview_")) return "preview";
800
+ if (v.buttonParity && typeof v.buttonParity === "object") return "scan";
801
+ if (/^(update|patch|set|edit|create|assign|apply)_/.test(tool)) return "saved";
802
+ return "read";
803
+ }
804
+ function designWarningText(findings, suggested, context = "read") {
805
+ if (!Array.isArray(findings) || findings.length === 0) return "";
806
+ const warnings = findings.filter((f) => f.severity === "warning");
807
+ const notices = findings.filter((f) => f.severity !== "warning");
808
+ const lines = [];
809
+ if (warnings.length) {
810
+ lines.push(
811
+ `Design warning: the Accept button is more prominent than Reject (${warnings.length} issue${warnings.length === 1 ? "" : "s"}). Regulators treat this as a dark pattern (EDPB Guidelines 03/2022, the EDPB cookie banner taskforce, CNIL). Make both buttons the same style. ${CONTEXT_TEXT[context]}`
812
+ );
813
+ for (const f of warnings) lines.push(`- [${f.code}] (${whereText(f)}) ${f.detail} Fix: ${f.fix}`);
814
+ }
815
+ if (notices.length) {
816
+ lines.push(
817
+ `Design notice: ${notices.length} thing${notices.length === 1 ? "" : "s"} to check about how Reject compares with Accept.` + (warnings.length ? "" : ` ${CONTEXT_TEXT[context]}`)
818
+ );
819
+ for (const f of notices) lines.push(`- [${f.code}] (${whereText(f)}) ${f.detail} Fix: ${f.fix}`);
820
+ }
821
+ const fixes = suggested && suggested.length ? suggested : findings.filter((f) => f.accept && f.reject).slice(0, 1).map((f) => ({ ...f.accept, layer: f.layer, view: f.where?.view }));
822
+ for (const s of fixes) {
823
+ const style = styleText(s);
824
+ if (style) {
825
+ lines.push(
826
+ `Suggested fix: style Reject all${s.view ? ` in view "${s.view}"` : ""} with ${style} \u2014 the same as Accept all. In a flow design, give the Reject button the same \`variant\` and size as the Accept button.`
827
+ );
828
+ }
829
+ }
830
+ return lines.join("\n");
831
+ }
832
+ function withDesignWarnings(value, body, tool = "") {
833
+ if (!value || typeof value !== "object") return body;
834
+ const nested = value.buttonParity;
835
+ const v = nested && typeof nested === "object" ? nested : value;
836
+ if (!Array.isArray(v.designWarnings) || v.designWarnings.length === 0) return body;
837
+ const head = designWarningText(
838
+ v.designWarnings,
839
+ Array.isArray(v.suggestedReject) ? v.suggestedReject : void 0,
840
+ designContext(tool, value)
841
+ );
842
+ return head ? `${head}
843
+
844
+ ${body}` : body;
845
+ }
846
+
661
847
  // src/tools.ts
662
- function text(value) {
848
+ function text(value, tool = "") {
663
849
  const body = typeof value === "string" ? value : JSON.stringify(value, null, 2);
664
- return { content: [{ type: "text", text: body }] };
850
+ return { content: [{ type: "text", text: withDesignWarnings(value, body, tool) }] };
665
851
  }
666
852
  function fail(err) {
667
853
  const message = err instanceof Error ? err.message : String(err);
@@ -671,16 +857,16 @@ function registerTools(server, client) {
671
857
  const tool = (name, description, inputSchema, run) => {
672
858
  server.registerTool(name, { description, inputSchema }, async (args) => {
673
859
  try {
674
- return text(await run(args));
860
+ return text(await run(args), name);
675
861
  } catch (err) {
676
862
  return fail(err);
677
863
  }
678
864
  });
679
865
  };
680
- const cbid = { cbid: z3.string().describe("Site identifier (cbid). Must belong to your org.") };
866
+ const cbid = { cbid: z4.string().describe("Site identifier (cbid). Must belong to your org.") };
681
867
  const range = {
682
- from: z3.number().optional().describe("Epoch-ms lower bound."),
683
- to: z3.number().optional().describe("Epoch-ms upper bound.")
868
+ from: z4.number().optional().describe("Epoch-ms lower bound."),
869
+ to: z4.number().optional().describe("Epoch-ms upper bound.")
684
870
  };
685
871
  tool(
686
872
  "whoami",
@@ -698,19 +884,19 @@ function registerTools(server, client) {
698
884
  tool(
699
885
  "get_site",
700
886
  "One site: its domain, cbid and verification status. Read-only.",
701
- { cbid: z3.string() },
887
+ { cbid: z4.string() },
702
888
  (a) => client.sites.get(a.cbid)
703
889
  );
704
890
  tool(
705
891
  "get_site_banner",
706
892
  "Which banner design a site uses, or bannerId null when none is assigned. Read-only.",
707
- { cbid: z3.string() },
893
+ { cbid: z4.string() },
708
894
  (a) => client.sites.banner(a.cbid)
709
895
  );
710
896
  tool(
711
897
  "get_privacy_policy",
712
898
  "Generate the site's privacy and cookie policy as Markdown, naming the org's data controller. Needs a contact email: the one given, else the org controller's, else the owner's. Read-only \u2014 nothing is published.",
713
- { cbid: z3.string(), contactEmail: z3.string().optional(), effectiveDate: z3.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: z3.array(z3.string()).optional() },
899
+ { cbid: z4.string(), contactEmail: z4.string().optional(), effectiveDate: z4.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: z4.array(z4.string()).optional() },
714
900
  (a) => client.sites.policy(a.cbid, {
715
901
  ...a.contactEmail ? { contactEmail: a.contactEmail } : {},
716
902
  ...a.effectiveDate ? { effectiveDate: a.effectiveDate } : {},
@@ -720,7 +906,7 @@ function registerTools(server, client) {
720
906
  tool(
721
907
  "set_ad_personalization",
722
908
  "Add or remove the separate 'personalised ads' choice on the site's live banner. With it on, accepting marketing no longer implies personalised ads unless `default` is true.",
723
- { cbid: z3.string(), enabled: z3.boolean(), default: z3.boolean().optional(), label: z3.string().optional() },
909
+ { cbid: z4.string(), enabled: z4.boolean(), default: z4.boolean().optional(), label: z4.string().optional() },
724
910
  (a) => client.sites.setAdPersonalization(a.cbid, {
725
911
  enabled: a.enabled,
726
912
  ...a.default !== void 0 ? { default: a.default } : {},
@@ -731,11 +917,11 @@ function registerTools(server, client) {
731
917
  "analyze_session",
732
918
  "Analyse a captured browsing session against the consent it ran under: which trackers fired after the visitor opted out, and what personal data left the page. Read-only.",
733
919
  {
734
- cbid: z3.string(),
735
- har: z3.unknown().optional().describe("A HAR export of the session."),
736
- requests: z3.array(z3.unknown()).optional().describe("Or the requests directly."),
737
- consent: z3.record(z3.string(), z3.boolean()).optional(),
738
- gpc: z3.boolean().optional()
920
+ cbid: z4.string(),
921
+ har: z4.unknown().optional().describe("A HAR export of the session."),
922
+ requests: z4.array(z4.unknown()).optional().describe("Or the requests directly."),
923
+ consent: z4.record(z4.string(), z4.boolean()).optional(),
924
+ gpc: z4.boolean().optional()
739
925
  },
740
926
  (a) => client.sites.analyzeSession(a.cbid, {
741
927
  ...a.har !== void 0 ? { har: a.har } : {},
@@ -747,39 +933,62 @@ function registerTools(server, client) {
747
933
  tool(
748
934
  "create_site",
749
935
  "Create a new site. The cbid is auto-generated if you omit it.",
750
- { domain: z3.string().describe("The site domain, e.g. example.com."), cbid: z3.string().optional().describe("Optional explicit cbid.") },
936
+ { domain: z4.string().describe("The site domain, e.g. example.com."), cbid: z4.string().optional().describe("Optional explicit cbid.") },
751
937
  (a) => client.sites.create({ domain: a.domain, ...typeof a.cbid === "string" ? { cbid: a.cbid } : {} })
752
938
  );
753
939
  tool(
754
940
  "create_sites_bulk",
755
941
  "Create up to 100 sites in one call. Partial success: each item reports ok or its own error, and a bad or duplicate item fails only itself.",
756
942
  {
757
- sites: z3.array(z3.object({ domain: z3.string(), cbid: z3.string().optional(), platform: z3.string().optional() })).min(1).max(100)
943
+ sites: z4.array(z4.object({ domain: z4.string(), cbid: z4.string().optional(), platform: z4.string().optional() })).min(1).max(100)
758
944
  },
759
945
  (a) => client.sites.createBulk(a.sites)
760
946
  );
761
947
  tool("get_site_config", "Get the banner/consent configuration for a site.", { ...cbid }, (a) => client.sites.getConfig(a.cbid));
762
948
  tool(
763
949
  "update_site_config",
764
- "Replace (overwrite) the banner/consent configuration for a site via PUT. This is destructive, not a merge: any top-level SiteConfig field you omit from `config` reverts to its default rather than keeping its current value. To change one setting, use patch_site_config instead \u2014 it merges server-side. Prefer the narrower set_* tools (set_blocking, set_banner_basics, etc.) when they cover your change.",
765
- { ...cbid, config: z3.record(z3.unknown()).describe("The full SiteConfig to write, not a patch. Omitted top-level fields are NOT preserved from the current config \u2014 fetch get_site_config first and merge client-side.") },
766
- (a) => client.sites.putConfig(a.cbid, a.config)
950
+ "Replace (overwrite) the banner/consent configuration for a site via PUT. This is destructive, not a merge: any top-level SiteConfig field you omit from `config` reverts to its default rather than keeping its current value \u2014 unless keepUnspecified is true, in which case omitted top-level fields keep their stored value and only the fields you send are replaced (each whole). A top-level field sent as null reverts to its default. To change one setting, use patch_site_config instead \u2014 it merges server-side. Prefer the narrower set_* tools (set_blocking, set_banner_basics, etc.) when they cover your change.",
951
+ {
952
+ ...cbid,
953
+ config: z4.record(z4.unknown()).describe("The full SiteConfig to write, not a patch. Without keepUnspecified, omitted top-level fields are NOT preserved from the current config."),
954
+ keepUnspecified: z4.boolean().optional().describe("PUT ?keep=unspecified: keep the stored value of every top-level field `config` omits, instead of reverting it to its default.")
955
+ },
956
+ (a) => a.keepUnspecified === true ? client.sites.putConfig(a.cbid, a.config, { keep: "unspecified" }) : client.sites.putConfig(a.cbid, a.config)
767
957
  );
768
958
  tool(
769
959
  "patch_site_config",
770
- "Change part of a site's banner/consent configuration. The patch is deep-merged over the stored config server-side, so any field you omit keeps its current value \u2014 this is the safe way to flip one setting, and it needs no read-modify-write. Use update_site_config only when you genuinely mean to replace the whole document.",
771
- { ...cbid, config: z3.record(z3.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved.') },
960
+ `Change part of a site's banner/consent configuration. The patch is a JSON Merge Patch (RFC 7386) over the stored config server-side: any field you omit keeps its current value, and a field set to null is REMOVED (it falls back to its default) \u2014 e.g. { "banner": { "i18n": { "es": null } } } drops the Spanish override. This is the safe way to flip one setting, and it needs no read-modify-write. Use update_site_config only when you genuinely mean to replace the whole document.`,
961
+ { ...cbid, config: z4.record(z4.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved; null removes a field.') },
772
962
  (a) => client.sites.patchConfig(a.cbid, a.config)
773
963
  );
774
964
  tool(
775
965
  "preview_site_config",
776
- 'Preview a config change WITHOUT saving it: returns the config as it would be saved, a diff of every field that would change, and any warnings (plan-gated or unrecognised fields). mode "patch" (default) previews patch_site_config; mode "put" previews update_site_config, and its diff lists everything a replace would revert to its default. Use it before any write you are not sure of.',
966
+ 'Preview a config change WITHOUT saving it: returns the config as it would be saved, a diff of every field that would change, and any warnings (plan-gated or unrecognised fields). mode "patch" (default) previews patch_site_config; mode "put" previews update_site_config, and its diff lists everything a replace would revert to its default (unless keepUnspecified is true). Use it before any write you are not sure of.',
967
+ {
968
+ ...cbid,
969
+ config: z4.record(z4.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
970
+ mode: z4.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
971
+ keepUnspecified: z4.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
972
+ },
973
+ (a) => client.sites.dryRunConfig(a.cbid, a.config, {
974
+ mode: a.mode ?? "patch",
975
+ ...a.keepUnspecified === true ? { keep: "unspecified" } : {}
976
+ })
977
+ );
978
+ tool(
979
+ "lint_banner_config",
980
+ 'Check a banner config for consent-button parity WITHOUT saving it: is "Accept all" more prominent than "Reject all" anywhere \u2014 a brighter or more saturated colour, a bigger or bolder button, Reject styled as a link, hidden, below the fold, set apart, missing from the first layer, or worded to guilt-trip? Regulators (EDPB, CNIL) treat that as a dark pattern. Returns findings, a 0\u2013100 score and the reject style that would match Accept. It checks exactly what the write would store: merged over the stored config as patch_site_config would, or with replace: true replaced as update_site_config would. Run it before writing any banner design.',
777
981
  {
778
982
  ...cbid,
779
- config: z3.record(z3.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
780
- mode: z3.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces.")
983
+ config: z4.record(z4.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
984
+ replace: z4.boolean().optional().describe("Check what update_site_config (a full replace) would store, instead of what patch_site_config (a merge) would.")
781
985
  },
782
- (a) => client.sites.dryRunConfig(a.cbid, a.config, { mode: a.mode ?? "patch" })
986
+ async (a) => {
987
+ const r = await client.sites.lintConfig(a.cbid, a.config, a.replace === true ? { replace: true } : {});
988
+ return r.designWarnings.length === 0 ? `No design warnings: Accept all and Reject all have equal weight on every surface checked (score ${r.score}). Nothing was saved.
989
+
990
+ ${JSON.stringify(r, null, 2)}` : r;
991
+ }
783
992
  );
784
993
  tool(
785
994
  "verify_consent_log",
@@ -796,7 +1005,7 @@ function registerTools(server, client) {
796
1005
  tool(
797
1006
  "get_consent_log",
798
1007
  "Get recent anonymised consent records for a site.",
799
- { ...cbid, ...range, limit: z3.number().optional().describe("Max records to return (default 200).") },
1008
+ { ...cbid, ...range, limit: z4.number().optional().describe("Max records to return (default 200).") },
800
1009
  (a) => client.consent.log(a.cbid, {
801
1010
  from: a.from,
802
1011
  to: a.to,
@@ -806,49 +1015,53 @@ function registerTools(server, client) {
806
1015
  tool(
807
1016
  "get_subject_consent",
808
1017
  "One person's consent records across every site in the org \u2014 web, mobile and desktop \u2014 by the subjectId your apps attach. Consent data: needs the consent:read scope. Read-only.",
809
- { subjectId: z3.string() },
1018
+ { subjectId: z4.string() },
810
1019
  (a) => client.subjects.consent(a.subjectId)
811
1020
  );
812
1021
  tool("list_dsar", "List all Data Subject Access Requests for your organization.", {}, () => client.dsar.list());
813
1022
  tool(
814
1023
  "update_dsar_executor",
815
- "Change a connected system in place \u2014 its profile, address, credential or auto flag. Only what you pass changes; the stored credential is kept unless you give a new one.",
816
- { id: z3.string(), patch: z3.record(z3.unknown()) },
817
- (a) => client.fulfillment.updateExecutor(a.id, a.patch)
1024
+ "Change a connected system in place \u2014 its profile, address, credential or auto flag. Only what you pass changes; the stored credential is kept unless you give a new one. With dryRun, answers the connection as it would be and a diff, and changes nothing.",
1025
+ {
1026
+ id: z4.string(),
1027
+ patch: z4.record(z4.unknown()),
1028
+ dryRun: z4.boolean().optional().describe("Validate and diff without saving.")
1029
+ },
1030
+ (a) => a.dryRun === true ? client.fulfillment.dryRunUpdateExecutor(a.id, a.patch) : client.fulfillment.updateExecutor(a.id, a.patch)
818
1031
  );
819
1032
  tool(
820
1033
  "get_dsar",
821
1034
  "One rights request by id, including its status and the deadline it must be answered by.",
822
- { id: z3.string() },
1035
+ { id: z4.string() },
823
1036
  (a) => client.dsar.get(a.id)
824
1037
  );
825
1038
  tool(
826
1039
  "erase_dsar_subject",
827
1040
  "For a deletion request that is past identity verification: erase the person\u2019s consent records on one site, identified by their consent stamp. Irreversible. The erasure is noted on the request. If the response carries a warning, nothing was cryptographically erased \u2014 tell the user.",
828
- { id: z3.string(), cbid: z3.string(), stamp: z3.string() },
1041
+ { id: z4.string(), cbid: z4.string(), stamp: z4.string() },
829
1042
  (a) => client.dsar.erase(a.id, a.cbid, a.stamp)
830
1043
  );
831
1044
  tool(
832
1045
  "export_dsar_subject",
833
1046
  "For an access or portability request that is past identity verification: the person\u2019s consent records on one site, identified by their consent stamp. The export is noted on the request.",
834
- { id: z3.string(), cbid: z3.string(), stamp: z3.string() },
1047
+ { id: z4.string(), cbid: z4.string(), stamp: z4.string() },
835
1048
  (a) => client.dsar.export(a.id, a.cbid, a.stamp)
836
1049
  );
837
1050
  tool(
838
1051
  "get_dsar_response_notice",
839
1052
  "The subject-facing response notice for a request, as plain text \u2014 what to send the person. Read-only; nothing is sent.",
840
- { id: z3.string() },
1053
+ { id: z4.string() },
841
1054
  (a) => client.dsar.response(a.id)
842
1055
  );
843
1056
  tool(
844
1057
  "create_dsar",
845
1058
  "Open a new Data Subject Access Request.",
846
1059
  {
847
- type: z3.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
848
- subjectEmail: z3.string().describe("The data subject\u2019s email."),
849
- regulation: z3.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
850
- note: z3.string().optional().describe("Optional free-text note."),
851
- test: z3.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
1060
+ type: z4.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
1061
+ subjectEmail: z4.string().describe("The data subject\u2019s email."),
1062
+ regulation: z4.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
1063
+ note: z4.string().optional().describe("Optional free-text note."),
1064
+ test: z4.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
852
1065
  },
853
1066
  (a) => client.dsar.create({
854
1067
  type: a.type,
@@ -858,21 +1071,43 @@ function registerTools(server, client) {
858
1071
  ...a.test === true ? { test: true } : {}
859
1072
  })
860
1073
  );
1074
+ tool(
1075
+ "create_rights_link",
1076
+ "Mint a signed, single-use link to a site\u2019s hosted rights page for a person you know is signed in to that site. On the page their email is filled in and locked and the email-code step is skipped; the filed request is recorded as verified by their account. Give the link only to that person. Expires in 15 minutes by default (max 1 hour). Needs dsar:write.",
1077
+ {
1078
+ cbid: z4.string().describe("Site identifier (cbid). Must belong to your org."),
1079
+ email: z4.string().describe("The signed-in person\u2019s verified email address."),
1080
+ userId: z4.string().optional().describe("Your own account id for them; recorded on the request."),
1081
+ rights: z4.array(z4.enum(["access", "erasure", "rectification", "portability", "restriction", "objection", "opt_out_sale", "opt_out_targeted", "limit_sensitive"])).min(1).optional().describe("Limit the link to these rights. Default: every right the page offers."),
1082
+ ttlSeconds: z4.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
1083
+ },
1084
+ (a) => client.rightsLinks.create(a.cbid, {
1085
+ subject: { email: a.email, ...typeof a.userId === "string" ? { userId: a.userId } : {} },
1086
+ ...Array.isArray(a.rights) ? { rights: a.rights } : {},
1087
+ ...typeof a.ttlSeconds === "number" ? { ttlSeconds: a.ttlSeconds } : {}
1088
+ })
1089
+ );
861
1090
  tool(
862
1091
  "delete_test_dsar",
863
1092
  "Delete a TEST rights request (one created with test: true), with its tasks and their upstream log. Real requests cannot be deleted and are refused. The deletion is recorded in the audit log.",
864
- { id: z3.string().describe("The test request id.") },
1093
+ { id: z4.string().describe("The test request id.") },
865
1094
  async (a) => {
866
1095
  await client.dsar.delete(a.id);
867
1096
  return { deleted: a.id };
868
1097
  }
869
1098
  );
1099
+ tool(
1100
+ "mark_dsar_test",
1101
+ "Mark a CLOSED rights request (completed or rejected) as a test request, after the fact \u2014 for trial requests filed before test: true existed. An open request is refused (request_not_closed), so a live obligation can never be relabelled. Recorded in the audit log; afterwards delete_test_dsar can remove it. Returns { request, changed }.",
1102
+ { id: z4.string().describe("The closed request id.") },
1103
+ (a) => client.dsar.markTest(a.id)
1104
+ );
870
1105
  tool(
871
1106
  "advance_dsar",
872
1107
  "Advance a DSAR to a new status (received \u2192 verifying \u2192 in_progress \u2192 completed, or rejected).",
873
1108
  {
874
- id: z3.string().describe("The DSAR id."),
875
- toStatus: z3.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status.")
1109
+ id: z4.string().describe("The DSAR id."),
1110
+ toStatus: z4.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status.")
876
1111
  },
877
1112
  (a) => client.dsar.advance(a.id, a.toStatus)
878
1113
  );
@@ -885,7 +1120,7 @@ function registerTools(server, client) {
885
1120
  tool(
886
1121
  "get_receipt",
887
1122
  "Fetch the signed consent receipt for a single consent record (by stamp).",
888
- { ...cbid, stamp: z3.string().describe("The consent record stamp/id.") },
1123
+ { ...cbid, stamp: z4.string().describe("The consent record stamp/id.") },
889
1124
  (a) => client.consent.receipt(a.cbid, a.stamp)
890
1125
  );
891
1126
  tool("delete_site", "Delete a site (cbid) and its configuration from your org.", { ...cbid }, async (a) => {
@@ -897,13 +1132,13 @@ function registerTools(server, client) {
897
1132
  "create_vendor",
898
1133
  "Register a vendor (processor) and compute its risk score.",
899
1134
  {
900
- name: z3.string().describe("Vendor name."),
901
- category: z3.string().describe("Vendor category, e.g. analytics."),
902
- dataShared: z3.array(z3.string()).describe("Categories of data shared with the vendor."),
903
- dpaSigned: z3.boolean().describe("Whether a Data Processing Agreement is signed."),
904
- subprocessors: z3.number().describe("Number of subprocessors."),
905
- certifications: z3.array(z3.string()).describe("Compliance certifications, e.g. ISO27001."),
906
- region: z3.string().describe("Primary processing region, e.g. EU.")
1135
+ name: z4.string().describe("Vendor name."),
1136
+ category: z4.string().describe("Vendor category, e.g. analytics."),
1137
+ dataShared: z4.array(z4.string()).describe("Categories of data shared with the vendor."),
1138
+ dpaSigned: z4.boolean().describe("Whether a Data Processing Agreement is signed."),
1139
+ subprocessors: z4.number().describe("Number of subprocessors."),
1140
+ certifications: z4.array(z4.string()).describe("Compliance certifications, e.g. ISO27001."),
1141
+ region: z4.string().describe("Primary processing region, e.g. EU.")
907
1142
  },
908
1143
  (a) => client.vendors.create({
909
1144
  name: a.name,
@@ -921,13 +1156,13 @@ function registerTools(server, client) {
921
1156
  "create_ropa",
922
1157
  "Create a Record of Processing Activity (RoPA) entry.",
923
1158
  {
924
- name: z3.string().describe("Activity name."),
925
- purpose: z3.string().describe("Purpose of processing."),
926
- legalBasis: z3.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
927
- dataCategories: z3.array(z3.string()).describe("Categories of personal data."),
928
- recipients: z3.array(z3.string()).describe("Recipients of the data."),
929
- retentionDays: z3.number().describe("Retention period in days."),
930
- crossBorderTransfer: z3.boolean().describe("Whether data is transferred across borders.")
1159
+ name: z4.string().describe("Activity name."),
1160
+ purpose: z4.string().describe("Purpose of processing."),
1161
+ legalBasis: z4.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
1162
+ dataCategories: z4.array(z4.string()).describe("Categories of personal data."),
1163
+ recipients: z4.array(z4.string()).describe("Recipients of the data."),
1164
+ retentionDays: z4.number().describe("Retention period in days."),
1165
+ crossBorderTransfer: z4.boolean().describe("Whether data is transferred across borders.")
931
1166
  },
932
1167
  (a) => client.ropa.create({
933
1168
  name: a.name,
@@ -973,9 +1208,9 @@ function registerTools(server, client) {
973
1208
  "create_webhook",
974
1209
  "Create a webhook subscription. The response includes the signing secret (shown once).",
975
1210
  {
976
- url: z3.string().describe("HTTPS endpoint to deliver events to."),
977
- events: z3.array(z3.string()).describe("Event names to subscribe to, e.g. consent.created."),
978
- cbid: z3.string().optional().describe("Optional site cbid to scope the subscription to.")
1211
+ url: z4.string().describe("HTTPS endpoint to deliver events to."),
1212
+ events: z4.array(z4.string()).describe("Event names to subscribe to, e.g. consent.created."),
1213
+ cbid: z4.string().optional().describe("Optional site cbid to scope the subscription to.")
979
1214
  },
980
1215
  (a) => client.webhooks.create({
981
1216
  url: a.url,
@@ -986,13 +1221,13 @@ function registerTools(server, client) {
986
1221
  tool(
987
1222
  "roll_webhook_secret",
988
1223
  "Rotate a webhook subscription\u2019s signing secret. The new secret is returned once; the receiving endpoint must be updated to verify with it.",
989
- { id: z3.string() },
1224
+ { id: z4.string() },
990
1225
  (a) => client.webhooks.rollSecret(a.id)
991
1226
  );
992
1227
  tool(
993
1228
  "test_webhook",
994
1229
  "Send a signed test event to a webhook subscription now, and report what the endpoint answered.",
995
- { id: z3.string() },
1230
+ { id: z4.string() },
996
1231
  (a) => client.webhooks.test(a.id)
997
1232
  );
998
1233
  tool(
@@ -1004,18 +1239,18 @@ function registerTools(server, client) {
1004
1239
  tool(
1005
1240
  "replay_webhook_dead_letter",
1006
1241
  "Deliver a dead-lettered webhook event again, to the subscription as it is now.",
1007
- { id: z3.string() },
1242
+ { id: z4.string() },
1008
1243
  (a) => client.webhooks.replayDeadLetter(a.id)
1009
1244
  );
1010
1245
  tool(
1011
1246
  "update_webhook",
1012
1247
  "Change a webhook subscription, or pause it with active:false (delivery stops; the subscription is kept). Only the fields given change. cbid: null widens it to every property in the org.",
1013
1248
  {
1014
- id: z3.string(),
1015
- url: z3.string().optional(),
1016
- events: z3.array(z3.string()).optional(),
1017
- cbid: z3.string().nullable().optional(),
1018
- active: z3.boolean().optional()
1249
+ id: z4.string(),
1250
+ url: z4.string().optional(),
1251
+ events: z4.array(z4.string()).optional(),
1252
+ cbid: z4.string().nullable().optional(),
1253
+ active: z4.boolean().optional()
1019
1254
  },
1020
1255
  (a) => client.webhooks.update(a.id, {
1021
1256
  ...a.url !== void 0 ? { url: a.url } : {},
@@ -1024,20 +1259,20 @@ function registerTools(server, client) {
1024
1259
  ...a.active !== void 0 ? { active: a.active } : {}
1025
1260
  })
1026
1261
  );
1027
- tool("delete_webhook", "Delete a webhook subscription by id.", { id: z3.string().describe("The webhook subscription id.") }, async (a) => {
1262
+ tool("delete_webhook", "Delete a webhook subscription by id.", { id: z4.string().describe("The webhook subscription id.") }, async (a) => {
1028
1263
  await client.webhooks.delete(a.id);
1029
1264
  return { ok: true };
1030
1265
  });
1031
1266
  tool(
1032
1267
  "verify_site",
1033
1268
  "Verify that your organization controls a domain by one of three challenge methods (dns / meta / file). Required to unlock consent export and signed receipts.",
1034
- { ...cbid, method: z3.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
1269
+ { ...cbid, method: z4.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
1035
1270
  (a) => client.sites.verify(a.cbid, a.method)
1036
1271
  );
1037
1272
  tool(
1038
1273
  "get_verification_challenge",
1039
1274
  "Exactly what to publish to prove control of a site\u2019s domain: the DNS TXT record, the meta tag, the file, or installing the embed. Read-only \u2014 publish one, then call verify_site.",
1040
- { cbid: z3.string() },
1275
+ { cbid: z4.string() },
1041
1276
  (a) => client.sites.verifyChallenge(a.cbid)
1042
1277
  );
1043
1278
  tool(
@@ -1049,15 +1284,15 @@ function registerTools(server, client) {
1049
1284
  tool(
1050
1285
  "get_flow",
1051
1286
  "Get the v2 banner flow config for a site, including current views, categories, and any lint issues.",
1052
- { cbid: z3.string().describe("Site identifier (cbid).") },
1287
+ { cbid: z4.string().describe("Site identifier (cbid).") },
1053
1288
  (a) => client.sites.getFlow(a.cbid)
1054
1289
  );
1055
1290
  tool(
1056
1291
  "edit_flow",
1057
1292
  "Apply a batch of structured edit operations to a site's v2 banner flow. All ops are validated server-side and the final config must be lint-clean before it is saved.",
1058
1293
  {
1059
- cbid: z3.string().describe("Site identifier (cbid)."),
1060
- operations: z3.array(z3.record(z3.unknown())).describe(
1294
+ cbid: z4.string().describe("Site identifier (cbid)."),
1295
+ operations: z4.array(z4.record(z4.unknown())).describe(
1061
1296
  'Ordered list of ops. Each must have an "op" field: addView | removeView | addElement | setButtonTransition | addCustomCategory.'
1062
1297
  )
1063
1298
  },
@@ -1067,19 +1302,21 @@ function registerTools(server, client) {
1067
1302
  "set_flow",
1068
1303
  "Wholesale replace a site's v2 banner flow with a complete config (e.g. from a template). Validated server-side before it is saved.",
1069
1304
  {
1070
- cbid: z3.string().describe("Site identifier (cbid)."),
1071
- config: z3.record(z3.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1305
+ cbid: z4.string().describe("Site identifier (cbid)."),
1306
+ config: z4.record(z4.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1072
1307
  },
1073
1308
  (a) => client.sites.setFlow(a.cbid, a.config)
1074
1309
  );
1075
1310
  registerConfigTools(tool, client);
1076
1311
  registerPlatformTools(tool, client);
1312
+ registerRightsTools(tool, client);
1313
+ registerRightsPageTools(tool, client);
1077
1314
  tool(
1078
1315
  "invite_member",
1079
1316
  "Invite a person to your organization by email. role must be admin, member, or viewer. The org is derived from the API key \u2014 you cannot invite into a different org.",
1080
1317
  {
1081
- email: z3.string().describe("Email address of the person to invite."),
1082
- role: z3.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1318
+ email: z4.string().describe("Email address of the person to invite."),
1319
+ role: z4.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1083
1320
  },
1084
1321
  (a) => client.members.invite(a.email, a.role)
1085
1322
  );
@@ -1087,8 +1324,8 @@ function registerTools(server, client) {
1087
1324
  "set_member_role",
1088
1325
  "Change the role of a member in your organization. The org owner's role cannot be changed.",
1089
1326
  {
1090
- userId: z3.string().describe("The userId of the member whose role to change."),
1091
- role: z3.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1327
+ userId: z4.string().describe("The userId of the member whose role to change."),
1328
+ role: z4.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1092
1329
  },
1093
1330
  (a) => client.members.setRole(a.userId, a.role)
1094
1331
  );
@@ -1096,7 +1333,7 @@ function registerTools(server, client) {
1096
1333
  "remove_member",
1097
1334
  "Remove a member from your organization. The org owner cannot be removed.",
1098
1335
  {
1099
- userId: z3.string().describe("The userId of the member to remove.")
1336
+ userId: z4.string().describe("The userId of the member to remove.")
1100
1337
  },
1101
1338
  async (a) => {
1102
1339
  await client.members.remove(a.userId);
@@ -1107,11 +1344,11 @@ function registerTools(server, client) {
1107
1344
  "create_brand_kit",
1108
1345
  "Create a reusable brand kit (colors, logo, typography) for your organization's consent banners.",
1109
1346
  {
1110
- name: z3.string().describe("Display name for the brand kit."),
1111
- theme: z3.record(z3.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1112
- content: z3.record(z3.unknown()).optional().describe("Optional banner copy overrides."),
1113
- logoUrl: z3.string().optional().describe("Optional URL for your org logo."),
1114
- customCss: z3.string().optional().describe("Optional custom CSS string to inject into the banner.")
1347
+ name: z4.string().describe("Display name for the brand kit."),
1348
+ theme: z4.record(z4.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1349
+ content: z4.record(z4.unknown()).optional().describe("Optional banner copy overrides."),
1350
+ logoUrl: z4.string().optional().describe("Optional URL for your org logo."),
1351
+ customCss: z4.string().optional().describe("Optional custom CSS string to inject into the banner.")
1115
1352
  },
1116
1353
  (a) => client.brandKits.create({
1117
1354
  name: a.name,
@@ -1125,7 +1362,7 @@ function registerTools(server, client) {
1125
1362
  "delete_brand_kit",
1126
1363
  "Delete a brand kit by id. The kit must belong to your organization (cross-org deletes are rejected).",
1127
1364
  {
1128
- id: z3.string().describe("The brand kit id to delete.")
1365
+ id: z4.string().describe("The brand kit id to delete.")
1129
1366
  },
1130
1367
  async (a) => {
1131
1368
  await client.brandKits.delete(a.id);
@@ -1136,25 +1373,25 @@ function registerTools(server, client) {
1136
1373
  "save_preference",
1137
1374
  "Save or update the consent preferences for an end-user (by subjectId) within your organization. purposes is a map of purpose-name \u2192 boolean.",
1138
1375
  {
1139
- subjectId: z3.string().describe("The end-user identifier (e.g. email or internal user id)."),
1140
- purposes: z3.record(z3.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1376
+ subjectId: z4.string().describe("The end-user identifier (e.g. email or internal user id)."),
1377
+ purposes: z4.record(z4.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1141
1378
  },
1142
1379
  (a) => client.preferences.save(a.subjectId, a.purposes)
1143
1380
  );
1144
1381
  tool(
1145
1382
  "get_preference",
1146
1383
  "One end-user\u2019s saved preferences, by subjectId. Read-only.",
1147
- { subjectId: z3.string() },
1384
+ { subjectId: z4.string() },
1148
1385
  (a) => client.preferences.get(a.subjectId)
1149
1386
  );
1150
1387
  tool(
1151
1388
  "issue_api_key",
1152
1389
  "Issue a new API key. The secret is returned once and never again. Prefer the least privilege the job needs: `scopes` limits what it can do, `cbids` locks it to specific sites (it then cannot reach anything org-wide), `expiresInDays` retires it. Omitting all three mints a full-access, org-wide, non-expiring key.",
1153
1390
  {
1154
- name: z3.string().optional(),
1155
- scopes: z3.array(z3.string()).optional(),
1156
- cbids: z3.array(z3.string()).min(1).optional(),
1157
- expiresInDays: z3.number().int().min(1).max(3650).optional()
1391
+ name: z4.string().optional(),
1392
+ scopes: z4.array(z4.string()).optional(),
1393
+ cbids: z4.array(z4.string()).min(1).optional(),
1394
+ expiresInDays: z4.number().int().min(1).max(3650).optional()
1158
1395
  },
1159
1396
  (a) => client.keys.issue({
1160
1397
  ...a.name ? { name: a.name } : {},
@@ -1163,36 +1400,80 @@ function registerTools(server, client) {
1163
1400
  ...a.expiresInDays !== void 0 ? { expiresInDays: a.expiresInDays } : {}
1164
1401
  })
1165
1402
  );
1166
- tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: z3.string() }, async (a) => {
1403
+ tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: z4.string() }, async (a) => {
1167
1404
  await client.keys.revoke(a.prefix);
1168
1405
  return { revoked: a.prefix };
1169
1406
  });
1170
1407
  tool(
1171
1408
  "import_cookie_declaration",
1172
1409
  "Read a cookie declaration exported from another CMP (OneTrust, Cookiebot, CookieYes, or any CSV/JSON with the same columns) and translate its categories into ours. Nothing is applied \u2014 it comes back for review, with the rows whose category could not be placed listed separately.",
1173
- { cbid: z3.string(), data: z3.string().describe("The exported file, as text (CSV or JSON).") },
1410
+ { cbid: z4.string(), data: z4.string().describe("The exported file, as text (CSV or JSON).") },
1174
1411
  (a) => client.sites.importDeclaration(a.cbid, a.data)
1175
1412
  );
1413
+ tool(
1414
+ "apply_cookie_import",
1415
+ "Import a cookie declaration exported from another CMP AND declare it: every row whose category mapped to ours and that has a purpose becomes a site declaration; the rest come back in `skipped` with the reason. Cookies the site already declared are kept unless overwrite is true. Prefer import_cookie_declaration first to review.",
1416
+ { cbid: z4.string(), data: z4.string().describe("The exported file, as text (CSV or JSON)."), overwrite: z4.boolean().optional() },
1417
+ (a) => client.sites.applyImport(a.cbid, a.data, a.overwrite ? { overwrite: true } : void 0)
1418
+ );
1419
+ const declarationShape = {
1420
+ category: z4.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1421
+ purpose: z4.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1422
+ purposes: z4.record(z4.string(), z4.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.'),
1423
+ provider: z4.string().optional(),
1424
+ expiry: z4.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
1425
+ domain: z4.string().optional(),
1426
+ pattern: z4.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
1427
+ };
1428
+ const dryRunArg = z4.boolean().optional().describe("Store nothing: answer with the would-be declarations and a diff (added / removed / changed) to check first.");
1429
+ tool(
1430
+ "declare_cookie",
1431
+ 'Declare what one of the site\u2019s cookies is. Overrides the scanner, observed visits and the cookie database everywhere the declaration is shown (API, preference modal, data-cc="declaration"). Use for the site\u2019s own cookies the database cannot know. A name ending in * covers every cookie with that prefix.',
1432
+ { cbid: z4.string(), name: z4.string(), ...declarationShape, dryRun: dryRunArg },
1433
+ (a) => {
1434
+ const { cbid: cbid2, name, dryRun, ...rest } = a;
1435
+ return client.sites.declareCookie(cbid2, name, rest, dryRun ? { dryRun: true } : void 0);
1436
+ }
1437
+ );
1438
+ tool(
1439
+ "declare_cookies",
1440
+ "Declare many cookies at once. All-or-nothing: one invalid item refuses the whole request and nothing is saved. replace: true also removes every declaration the list does not name.",
1441
+ { cbid: z4.string(), cookies: z4.array(z4.object({ name: z4.string(), ...declarationShape })).max(500), replace: z4.boolean().optional(), dryRun: dryRunArg },
1442
+ (a) => {
1443
+ const o = { ...a.replace ? { replace: true } : {}, ...a.dryRun ? { dryRun: true } : {} };
1444
+ return client.sites.declareCookies(a.cbid, a.cookies, Object.keys(o).length ? o : void 0);
1445
+ }
1446
+ );
1447
+ tool(
1448
+ "undeclare_cookie",
1449
+ "Remove a cookie declaration; the scanned/observed classification applies again.",
1450
+ { cbid: z4.string(), name: z4.string(), dryRun: dryRunArg },
1451
+ async (a) => {
1452
+ if (a.dryRun) return client.sites.undeclareCookie(a.cbid, a.name, { dryRun: true });
1453
+ await client.sites.undeclareCookie(a.cbid, a.name);
1454
+ return { undeclared: a.name };
1455
+ }
1456
+ );
1176
1457
  tool(
1177
1458
  "get_blocked_pages",
1178
1459
  "Pages where the embed could not load its banner renderer \u2014 the page\u2019s Content Security Policy or Trusted Types policy refused it, so nobody there can be asked for consent. An empty list is healthy. Read-only.",
1179
- { cbid: z3.string() },
1460
+ { cbid: z4.string() },
1180
1461
  (a) => client.sites.blocked(a.cbid)
1181
1462
  );
1182
1463
  tool(
1183
1464
  "roll_api_key",
1184
1465
  "Rotate an API key: returns a new secret once, with the same name, scopes, property lock and expiry. The old secret stops working immediately \u2014 if it is the key this server runs with, this server stops working too until it is reconfigured.",
1185
- { prefix: z3.string() },
1466
+ { prefix: z4.string() },
1186
1467
  (a) => client.keys.roll(a.prefix)
1187
1468
  );
1188
1469
  tool(
1189
1470
  "update_api_key",
1190
1471
  "Rename an API key, or replace its scopes or the properties it is locked to. Only the fields given change; the secret does not.",
1191
1472
  {
1192
- prefix: z3.string(),
1193
- name: z3.string().optional(),
1194
- scopes: z3.array(z3.string()).optional(),
1195
- cbids: z3.array(z3.string()).min(1).optional()
1473
+ prefix: z4.string(),
1474
+ name: z4.string().optional(),
1475
+ scopes: z4.array(z4.string()).optional(),
1476
+ cbids: z4.array(z4.string()).min(1).optional()
1196
1477
  },
1197
1478
  (a) => client.keys.update(a.prefix, {
1198
1479
  ...a.name !== void 0 ? { name: a.name } : {},
@@ -1204,31 +1485,170 @@ function registerTools(server, client) {
1204
1485
  tool(
1205
1486
  "update_org",
1206
1487
  "Rename your organisation or set its logo. logoUrl: null removes the logo; upload an image with upload_asset to get a URL. Deleting the organisation is not possible here.",
1207
- { name: z3.string().min(1).optional(), logoUrl: z3.string().nullable().optional() },
1488
+ { name: z4.string().min(1).optional(), logoUrl: z4.string().nullable().optional() },
1208
1489
  (a) => client.org.update({
1209
1490
  ...a.name !== void 0 ? { name: a.name } : {},
1210
1491
  ...a.logoUrl !== void 0 ? { logoUrl: a.logoUrl } : {}
1211
1492
  })
1212
1493
  );
1494
+ tool(
1495
+ "get_mail_provider",
1496
+ "Your own mail provider for rights-request mail (verification codes and other privacy-request mail), if any. Never returns the credential, only its last four characters. `sender` says whether verification codes are mailed through it now (own) or not at all (none) \u2014 there is no shared sender. Read-only.",
1497
+ {},
1498
+ () => client.org.mailProvider.get()
1499
+ );
1500
+ tool(
1501
+ "set_mail_provider",
1502
+ "Connect your own mail provider for rights-request mail \u2014 recommended, so codes come from your own domain. Replaces the stored one. It carries mail only after test_mail_provider succeeds; every save clears that. Omit secret to keep the stored one (same provider only).",
1503
+ {
1504
+ provider: z4.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
1505
+ fromEmail: z4.string().describe("An address on a domain your provider has verified."),
1506
+ fromName: z4.string().max(100).nullable().optional(),
1507
+ replyTo: z4.string().nullable().optional(),
1508
+ secret: z4.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
1509
+ ses: z4.object({ region: z4.string(), accessKeyId: z4.string() }).optional().describe("Required for ses."),
1510
+ smtp: z4.object({ host: z4.string(), port: z4.union([z4.literal(25), z4.literal(465), z4.literal(587), z4.literal(2525)]), security: z4.enum(["tls", "starttls"]), username: z4.string() }).optional().describe("Required for smtp. TLS is always required.")
1511
+ },
1512
+ (a) => client.org.mailProvider.set(a)
1513
+ );
1514
+ tool(
1515
+ "test_mail_provider",
1516
+ "Send a test message through your own mail provider (never Cookie Munch\u2019s) and report what it answered. Success marks the configuration verified, after which it carries all rights mail.",
1517
+ { to: z4.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
1518
+ (a) => client.org.mailProvider.test(a.to)
1519
+ );
1520
+ tool(
1521
+ "remove_mail_provider",
1522
+ "Remove your own mail provider. Rights mail goes back to Cookie Munch\u2019s shared sender, labelled as sending on your site\u2019s behalf.",
1523
+ {},
1524
+ async () => {
1525
+ await client.org.mailProvider.remove();
1526
+ return { removed: true };
1527
+ }
1528
+ );
1529
+ const CAPTCHA_OFF = "Off removes spam protection beyond the hidden spam-trap field, the rate limits and the email code: expect more spam requests. Own keys are recommended.";
1530
+ const captchaInput = {
1531
+ mode: z4.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
1532
+ provider: z4.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
1533
+ siteKey: z4.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
1534
+ secret: z4.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
1535
+ minScore: z4.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
1536
+ };
1537
+ const captchaBody = (a) => ({
1538
+ mode: a.mode,
1539
+ ...a.provider !== void 0 ? { provider: a.provider } : {},
1540
+ ...a.siteKey !== void 0 ? { siteKey: a.siteKey } : {},
1541
+ ...a.secret !== void 0 ? { secret: a.secret } : {},
1542
+ ...a.minScore !== void 0 ? { minScore: a.minScore } : {}
1543
+ });
1544
+ tool(
1545
+ "get_rights_captcha",
1546
+ "The captcha on a site\u2019s hosted rights page: its own setting, else the organisation default, else off (`source` says which). Never returns the secret. Read-only.",
1547
+ { cbid: z4.string() },
1548
+ (a) => client.rightsCaptcha.get(a.cbid)
1549
+ );
1550
+ tool(
1551
+ "set_rights_captcha",
1552
+ `Set a site\u2019s rights-page captcha: your own Turnstile, hCaptcha or reCAPTCHA keys (recommended; the provider must accept the secret before it is saved), or off. ${CAPTCHA_OFF} Audited with the old and new mode.`,
1553
+ { cbid: z4.string(), ...captchaInput },
1554
+ (a) => client.rightsCaptcha.set(a.cbid, captchaBody(a))
1555
+ );
1556
+ tool(
1557
+ "remove_rights_captcha",
1558
+ "Remove a site\u2019s own captcha setting: it inherits the organisation default again (or off). Returns the setting now in force.",
1559
+ { cbid: z4.string() },
1560
+ (a) => client.rightsCaptcha.remove(a.cbid)
1561
+ );
1562
+ tool(
1563
+ "get_rights_captcha_default",
1564
+ "The organisation default captcha for its rights pages, used by every site without its own setting. Never returns the secret. Read-only.",
1565
+ {},
1566
+ () => client.org.rightsCaptcha.get()
1567
+ );
1568
+ tool(
1569
+ "set_rights_captcha_default",
1570
+ `Set the organisation default captcha for its rights pages: your own keys (recommended) or off. ${CAPTCHA_OFF}`,
1571
+ captchaInput,
1572
+ (a) => client.org.rightsCaptcha.set(captchaBody(a))
1573
+ );
1574
+ tool(
1575
+ "remove_rights_captcha_default",
1576
+ "Remove the organisation default: sites without their own setting then have no captcha. Returns the setting now in force.",
1577
+ {},
1578
+ () => client.org.rightsCaptcha.remove()
1579
+ );
1580
+ const IDENTITY_NOTE = "The JWKS is fetched and checked before anything is saved. The session token must carry the email and a verified-email claim (default email_verified) set to true (Clerk: add email: {{user.primary_email_address}} to the session token; Clerk documents no claim for whether that address is verified, so either add your own or set trustEmailClaim). oidc_jwt needs an audience or authorizedParties.";
1581
+ const identityInput = {
1582
+ type: z4.enum(["clerk", "atlas", "oidc_jwt"]).describe("clerk, atlas (Clerk-shaped), or oidc_jwt (any issuer that signs session JWTs with a published JWKS)."),
1583
+ issuer: z4.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
1584
+ jwksUrl: z4.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
1585
+ audience: z4.string().optional().describe("Expected aud. For oidc_jwt an audience or authorizedParties is required (a shared issuer mints tokens for every app)."),
1586
+ authorizedParties: z4.array(z4.string()).optional().describe("Your own origins (https://www.example.com) the token\u2019s azp must be one of. Required for clerk and atlas; for oidc_jwt when there is no audience."),
1587
+ emailClaim: z4.string().optional().describe("Default email."),
1588
+ emailVerifiedClaim: z4.string().optional().describe("Default email_verified; must be exactly true."),
1589
+ sessionCookieName: z4.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
1590
+ trustEmailClaim: z4.boolean().optional().describe("clerk/atlas only, default false. True: a token without the verified claim is accepted, its email claim taken as verified. Set only if every address your provider puts in that claim is verified.")
1591
+ };
1592
+ const identityBody = (a) => {
1593
+ const out = { type: a.type, issuer: a.issuer };
1594
+ for (const k of ["jwksUrl", "audience", "authorizedParties", "emailClaim", "emailVerifiedClaim", "sessionCookieName", "trustEmailClaim"]) if (a[k] !== void 0) out[k] = a[k];
1595
+ return out;
1596
+ };
1597
+ tool(
1598
+ "get_rights_identity",
1599
+ "The sign-in provider a site\u2019s rights requests are verified with: its own setting, else the organisation default, else none (`source` says which). Read-only.",
1600
+ { cbid: z4.string() },
1601
+ (a) => client.rightsIdentity.get(a.cbid)
1602
+ );
1603
+ tool(
1604
+ "set_rights_identity",
1605
+ `Connect a site\u2019s sign-in provider so a visitor signed in to the site is verified by their session, with no code mail. ${IDENTITY_NOTE} Audited.`,
1606
+ { cbid: z4.string(), ...identityInput },
1607
+ (a) => client.rightsIdentity.set(a.cbid, identityBody(a))
1608
+ );
1609
+ tool(
1610
+ "remove_rights_identity",
1611
+ "Remove a site\u2019s own sign-in provider: it inherits the organisation default again (or none). Returns the setting now in force.",
1612
+ { cbid: z4.string() },
1613
+ (a) => client.rightsIdentity.remove(a.cbid)
1614
+ );
1615
+ tool(
1616
+ "get_rights_identity_default",
1617
+ "The organisation default sign-in provider for its rights requests, used by every site without its own. Read-only.",
1618
+ {},
1619
+ () => client.org.rightsIdentity.get()
1620
+ );
1621
+ tool(
1622
+ "set_rights_identity_default",
1623
+ `Set the organisation default sign-in provider for its rights requests. ${IDENTITY_NOTE}`,
1624
+ identityInput,
1625
+ (a) => client.org.rightsIdentity.set(identityBody(a))
1626
+ );
1627
+ tool(
1628
+ "remove_rights_identity_default",
1629
+ "Remove the organisation default sign-in provider. Returns the setting now in force.",
1630
+ {},
1631
+ () => client.org.rightsIdentity.remove()
1632
+ );
1213
1633
  tool(
1214
1634
  "get_audit_log",
1215
1635
  "The organisation\u2019s audit log, newest first: administrative changes made in the dashboard or through the API, and who made them. Read-only.",
1216
- { limit: z3.number().int().min(1).max(500).optional() },
1636
+ { limit: z4.number().int().min(1).max(500).optional() },
1217
1637
  (a) => client.audit(a.limit)
1218
1638
  );
1219
1639
  tool(
1220
1640
  "upload_asset",
1221
1641
  "Upload an image \u2014 a banner logo \u2014 and get its public URL. data is base64 (a data: URL also works); PNG, JPEG, WebP, GIF or SVG, up to 1,000,000 bytes.",
1222
1642
  {
1223
- data: z3.string(),
1224
- contentType: z3.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
1643
+ data: z4.string(),
1644
+ contentType: z4.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
1225
1645
  },
1226
1646
  (a) => client.assets.upload({ data: a.data, contentType: a.contentType })
1227
1647
  );
1228
1648
  tool(
1229
1649
  "delete_asset",
1230
1650
  "Delete a stored image by its URL (or file name). Only your own organisation\u2019s images can be named.",
1231
- { url: z3.string().describe("The URL upload_asset returned, or just its file name.") },
1651
+ { url: z4.string().describe("The URL upload_asset returned, or just its file name.") },
1232
1652
  async (a) => {
1233
1653
  await client.assets.delete(a.url);
1234
1654
  return { deleted: a.url };
@@ -1243,18 +1663,18 @@ function registerTools(server, client) {
1243
1663
  tool(
1244
1664
  "get_customer",
1245
1665
  "One child org: its controller details and usage. Read-only.",
1246
- { id: z3.string() },
1666
+ { id: z4.string() },
1247
1667
  (a) => client.reseller.get(a.id)
1248
1668
  );
1249
1669
  tool(
1250
1670
  "provision_customer",
1251
1671
  "Create a new child org under this reseller. With `mintKey`, its first API key is returned once. Counts toward the reseller plan\u2019s pooled limits.",
1252
1672
  {
1253
- name: z3.string(),
1254
- ownerEmail: z3.string().optional(),
1255
- delegatedAccess: z3.boolean().optional().describe("Whether this reseller may act inside the child."),
1256
- mintKey: z3.boolean().optional(),
1257
- keyScopes: z3.array(z3.string()).optional()
1673
+ name: z4.string(),
1674
+ ownerEmail: z4.string().optional(),
1675
+ delegatedAccess: z4.boolean().optional().describe("Whether this reseller may act inside the child."),
1676
+ mintKey: z4.boolean().optional(),
1677
+ keyScopes: z4.array(z4.string()).optional()
1258
1678
  },
1259
1679
  (a) => client.reseller.create({
1260
1680
  name: a.name,
@@ -1268,10 +1688,10 @@ function registerTools(server, client) {
1268
1688
  "update_customer",
1269
1689
  "Change a child org\u2019s status, delegated access or DSAR routing. `dsarRouting: null` clears the override.",
1270
1690
  {
1271
- id: z3.string(),
1272
- status: z3.enum(["active", "suspended"]).optional(),
1273
- delegatedAccess: z3.boolean().optional(),
1274
- dsarRouting: z3.enum(["reseller", "child"]).nullable().optional()
1691
+ id: z4.string(),
1692
+ status: z4.enum(["active", "suspended"]).optional(),
1693
+ delegatedAccess: z4.boolean().optional(),
1694
+ dsarRouting: z4.enum(["reseller", "child"]).nullable().optional()
1275
1695
  },
1276
1696
  (a) => client.reseller.update(a.id, {
1277
1697
  ...a.status ? { status: a.status } : {},
@@ -1282,7 +1702,7 @@ function registerTools(server, client) {
1282
1702
  tool(
1283
1703
  "suspend_customer",
1284
1704
  "Suspend a child org: it stops ingesting consent and its keys stop working, and it can be reactivated with update_customer. Its data is kept. (Permanent deletion is deliberately not available here.)",
1285
- { id: z3.string() },
1705
+ { id: z4.string() },
1286
1706
  async (a) => {
1287
1707
  await client.reseller.deprovision(a.id);
1288
1708
  return { suspended: a.id };
@@ -1291,72 +1711,72 @@ function registerTools(server, client) {
1291
1711
  tool(
1292
1712
  "list_customer_keys",
1293
1713
  "A child org's API key prefixes. Never the secrets. Read-only.",
1294
- { id: z3.string() },
1714
+ { id: z4.string() },
1295
1715
  (a) => client.reseller.listKeys(a.id)
1296
1716
  );
1297
1717
  tool(
1298
1718
  "issue_customer_key",
1299
1719
  "Mint an API key for a child org. The secret is returned once. Prefer scopes and a property lock over a full-access key.",
1300
- { id: z3.string(), name: z3.string().optional(), scopes: z3.array(z3.string()).optional(), cbids: z3.array(z3.string()).min(1).optional() },
1720
+ { id: z4.string(), name: z4.string().optional(), scopes: z4.array(z4.string()).optional(), cbids: z4.array(z4.string()).min(1).optional() },
1301
1721
  (a) => client.reseller.mintKey(a.id, {
1302
1722
  ...a.name ? { name: a.name } : {},
1303
1723
  ...a.scopes ? { scopes: a.scopes } : {},
1304
1724
  ...a.cbids ? { cbids: a.cbids } : {}
1305
1725
  })
1306
1726
  );
1307
- tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: z3.string(), prefix: z3.string() }, async (a) => {
1727
+ tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: z4.string(), prefix: z4.string() }, async (a) => {
1308
1728
  await client.reseller.revokeKey(a.id, a.prefix);
1309
1729
  return { revoked: a.prefix };
1310
1730
  });
1311
1731
  tool(
1312
1732
  "erase_subject_data",
1313
1733
  "IRREVERSIBLY crypto-erase a data subject's consent records by their consent-receipt stamp (GDPR/CCPA deletion). Destroys the encryption key; the tamper-evident chain stays intact.",
1314
- { cbid: z3.string(), stamp: z3.string() },
1734
+ { cbid: z4.string(), stamp: z4.string() },
1315
1735
  (a) => client.consent.eraseSubject(a.cbid, a.stamp)
1316
1736
  );
1317
1737
  tool(
1318
1738
  "export_subject_data",
1319
1739
  "Export a data subject's consent records (GDPR access/portability).",
1320
- { cbid: z3.string(), stamp: z3.string() },
1740
+ { cbid: z4.string(), stamp: z4.string() },
1321
1741
  (a) => client.consent.exportSubject(a.cbid, a.stamp)
1322
1742
  );
1323
1743
  tool("list_banners", "List reusable banner designs in your org.", {}, () => client.banners.list());
1324
1744
  tool(
1325
1745
  "create_banner",
1326
1746
  "Create a reusable banner design.",
1327
- { name: z3.string(), json: z3.record(z3.unknown()).describe("A v2 BannerConfig.") },
1747
+ { name: z4.string(), json: z4.record(z4.unknown()).describe("A v2 BannerConfig.") },
1328
1748
  (a) => client.banners.create({ name: a.name, json: a.json })
1329
1749
  );
1330
- tool("get_banner", "Get a banner design by id.", { id: z3.string() }, (a) => client.banners.get(a.id));
1750
+ tool("get_banner", "Get a banner design by id.", { id: z4.string() }, (a) => client.banners.get(a.id));
1331
1751
  tool(
1332
1752
  "update_banner",
1333
1753
  "Update a banner design (name and/or config).",
1334
- { id: z3.string(), name: z3.string().optional(), json: z3.record(z3.unknown()).optional() },
1754
+ { id: z4.string(), name: z4.string().optional(), json: z4.record(z4.unknown()).optional() },
1335
1755
  (a) => client.banners.update(a.id, {
1336
1756
  ...a.name !== void 0 ? { name: a.name } : {},
1337
1757
  ...a.json !== void 0 ? { json: a.json } : {}
1338
1758
  })
1339
1759
  );
1340
- tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: z3.string() }, async (a) => {
1760
+ tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: z4.string() }, async (a) => {
1341
1761
  await client.banners.delete(a.id);
1342
1762
  return { ok: true };
1343
1763
  });
1344
1764
  tool(
1345
1765
  "get_banner_assignments",
1346
1766
  "The sites (cbids) a banner design is currently assigned to. Read-only.",
1347
- { id: z3.string() },
1767
+ { id: z4.string() },
1348
1768
  (a) => client.banners.assignments(a.id)
1349
1769
  );
1350
1770
  tool(
1351
1771
  "assign_banner",
1352
1772
  "Set which sites (cbids) use a banner design.",
1353
- { id: z3.string(), cbids: z3.array(z3.string()) },
1773
+ { id: z4.string(), cbids: z4.array(z4.string()) },
1354
1774
  (a) => client.banners.setAssignments(a.id, a.cbids)
1355
1775
  );
1356
1776
  tool(
1357
1777
  "publish_banner",
1358
1778
  "Publish a design live to all its assigned sites.",
1359
- { id: z3.string() },
1779
+ { id: z4.string() },
1360
1780
  (a) => client.banners.publish(a.id)
1361
1781
  );
1362
1782
  }
@@ -1373,4 +1793,4 @@ export {
1373
1793
  registerTools,
1374
1794
  createCookieMunchMcp
1375
1795
  };
1376
- //# sourceMappingURL=chunk-G5TN4KJA.js.map
1796
+ //# sourceMappingURL=chunk-PLBLLTYO.js.map