@cookiemunch/mcp 0.2.0 → 0.4.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
@@ -28,7 +28,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
28
28
  var import_sdk = require("@cookiemunch/sdk");
29
29
 
30
30
  // src/tools.ts
31
- var import_zod4 = require("zod");
31
+ var import_zod5 = require("zod");
32
32
 
33
33
  // src/tools-config.ts
34
34
  var import_zod = require("zod");
@@ -115,7 +115,7 @@ function registerConfigTools(tool, client) {
115
115
  const setLanguagesSchema = import_zod.z.object({
116
116
  cbid: import_zod.z.string().describe("Site identifier (cbid)."),
117
117
  defaultCulture: import_zod.z.string().optional().describe('Default locale/culture code, e.g. "en", "fr". Stored in i18n.defaultCulture.'),
118
- autoDetect: import_zod.z.boolean().optional().describe("Auto-detect visitor language from browser locale. Stored in i18n.autoDetect."),
118
+ autoDetect: import_zod.z.union([import_zod.z.boolean(), import_zod.z.literal("page")]).optional().describe(`true: follow the visitor's browser language; false: defaultCulture for everyone; "page": follow the page's <html lang>, then the browser. Stored in i18n.autoDetect.`),
119
119
  translations: import_zod.z.record(import_zod.z.record(import_zod.z.unknown())).optional().describe("Per-locale banner copy overrides. Merged onto banner.i18n (locale keys preserved)."),
120
120
  overrides: import_zod.z.record(import_zod.z.object({ banner: import_zod.z.record(import_zod.z.string()).optional(), categories: import_zod.z.record(import_zod.z.object({ label: import_zod.z.string().optional(), description: import_zod.z.string().optional() })).optional() })).optional().describe("The site's own copy per language, keyed by tag (de, pt-BR): { banner: { title, body, \u2026 }, categories: { <id>: { label, description } } }. Each language given replaces its entry in i18n.overrides; other languages are kept. Strings the site wrote are shown as written in any language without an override \u2014 stock translations never replace them.")
121
121
  });
@@ -216,7 +216,7 @@ function registerConfigTools(tool, client) {
216
216
  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."),
217
217
  secondLayer: import_zod.z.enum(["expand", "popup", "modal"]).optional().describe("Where the categories open from an inline banner."),
218
218
  density: import_zod.z.enum(["comfortable", "compact"]).optional().describe("compact = one-row bar from 760px wide."),
219
- theme: import_zod.z.record(import_zod.z.unknown()).optional().describe("Partial ThemeTokens \u2014 deep-merged onto the existing banner theme."),
219
+ 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 }."),
220
220
  content: import_zod.z.record(import_zod.z.unknown()).optional().describe("Partial BannerContent \u2014 banner copy overrides (title, body, button labels, policyUrl, etc.).")
221
221
  });
222
222
  tool(
@@ -563,12 +563,16 @@ function registerPlatformTools(tool, client) {
563
563
  "connect_dsar_executor",
564
564
  "Connect a system that runs part of a rights request \u2014 an identity platform, a CRM, anything with a rights API. Cookie Munch is not specific to any platform: the `profile` describes that system's API (paths, the words it uses for export/erase, its status vocabulary, how it signs webhooks), so connecting a new one needs no code. The secret key is stored encrypted and never returned; the response carries the webhook URL to configure in that system. Sub-tasks open automatically once a request reaches fulfilment (after identity verification), and completions are picked up by webhook or by polling.",
565
565
  {
566
- system: import_zod2.z.string().describe("The name this connection answers to in a plan, e.g. identity or crm."),
567
- baseUrl: import_zod2.z.string().describe("The system's public https origin."),
566
+ preset: import_zod2.z.string().optional().describe("Build profile (and, unless the preset takes baseUrl as a param, baseUrl) from a versioned preset instead of sending profile. list_dsar_executor_presets names them, what each needs, and which wait on another platform."),
567
+ presetVersion: import_zod2.z.number().int().optional().describe("With preset: the version to build. Default the latest."),
568
+ orgId: import_zod2.z.string().optional().describe("A preset param, when the preset's params list it."),
569
+ atlasIdAppId: import_zod2.z.string().optional().describe("A preset param, when the preset's params list it: the identity platform's app id, so an erasure also revokes the app's grant."),
570
+ 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."),
571
+ baseUrl: import_zod2.z.string().optional().describe("The system's public https origin. Required unless the preset sets it."),
568
572
  secretKey: import_zod2.z.string().describe("Its API key, with whatever scope that system needs to export and erase a user."),
569
573
  webhookSecret: import_zod2.z.string().optional().describe("Signing secret of its webhook endpoint. Optional: polling closes tasks without it."),
570
574
  auto: import_zod2.z.boolean().optional().describe("Open a sub-task automatically when a request reaches fulfilment. Default true."),
571
- profile: import_zod2.z.record(import_zod2.z.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."),
575
+ profile: import_zod2.z.record(import_zod2.z.unknown()).optional().describe("How to drive that system: { open, poll, statuses } required, plus optional subjectLookup, auth, idempotencyHeader, grantRevoke and webhook. Omit it when using preset."),
572
576
  dryRun: import_zod2.z.boolean().optional().describe("Validate everything and answer the connection that would be created, storing nothing.")
573
577
  },
574
578
  (a) => {
@@ -576,6 +580,28 @@ function registerPlatformTools(tool, client) {
576
580
  return dryRun === true ? client.fulfillment.dryRunConnectExecutor(input) : client.fulfillment.connectExecutor(input);
577
581
  }
578
582
  );
583
+ tool(
584
+ "list_dsar_executor_presets",
585
+ "The versioned executor presets: each one's name, params, latest version, and whether it is usable now or waits on another platform's API (waitingOn names the platform and its spec items). Also this org's canary address for connection tests. Read-only.",
586
+ {},
587
+ () => client.fulfillment.executorPresets()
588
+ );
589
+ tool(
590
+ "upgrade_dsar_executor_preset",
591
+ "Rebuild a connection's profile and address from its preset's latest version (or presetVersion), keeping its id, credentials, system and scope \u2014 or adopt a preset on a hand-written connection by naming it. Answers with a diff. Use dryRun first: the answer shows exactly what would change and nothing is stored.",
592
+ {
593
+ id: import_zod2.z.string().describe("The connection id."),
594
+ preset: import_zod2.z.string().optional().describe("Only to adopt a preset on a connection that has none."),
595
+ presetVersion: import_zod2.z.number().int().optional(),
596
+ orgId: import_zod2.z.string().optional(),
597
+ atlasIdAppId: import_zod2.z.string().optional(),
598
+ dryRun: import_zod2.z.boolean().optional().describe("Answer the diff and change nothing.")
599
+ },
600
+ (a) => {
601
+ const { id, dryRun, ...input } = a;
602
+ return dryRun === true ? client.fulfillment.dryRunUpgradeExecutorPreset(id, input) : client.fulfillment.upgradeExecutorPreset(id, input);
603
+ }
604
+ );
579
605
  tool(
580
606
  "test_dsar_executor_webhook",
581
607
  "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.",
@@ -609,15 +635,17 @@ function registerPlatformTools(tool, client) {
609
635
  );
610
636
  tool(
611
637
  "test_dsar_executor",
612
- "Try a connected system against one email WITHOUT filing a rights request. Runs its subject lookup and returns the raw upstream answers (credentials removed) and a one-line verdict. The open step is rendered but not sent, unless open is true on an export, which opens and polls a real export once. An erasure is never sent by a test.",
638
+ "Try a connected system against one email (or the org canary, canary: true) WITHOUT filing a rights request. Runs its subject lookup and returns the raw upstream answers (credentials removed) and a one-line verdict; code base_url_redirects means its baseUrl redirects and the verdict names where. The open step is rendered but not sent, unless open is true on an export, which opens and polls a real export once. An erasure is never sent by a test.",
613
639
  {
614
640
  id: import_zod2.z.string().describe("The connection id."),
615
- email: import_zod2.z.string().describe("The address to look up."),
641
+ email: import_zod2.z.string().optional().describe("The address to look up. Omit it with canary."),
642
+ canary: import_zod2.z.boolean().optional().describe("Use this org's canary address \u2014 no real person involved. A canary locate also updates the connection's health."),
616
643
  operation: import_zod2.z.enum(["locate", "export", "erase"]).optional().describe("Default locate."),
617
644
  open: import_zod2.z.boolean().optional().describe("For export only: open a real export and poll it once.")
618
645
  },
619
646
  (a) => client.fulfillment.testExecutor(a.id, {
620
- email: a.email,
647
+ ...typeof a.email === "string" ? { email: a.email } : {},
648
+ ...a.canary === true ? { canary: true } : {},
621
649
  ...a.operation ? { operation: a.operation } : {},
622
650
  ...typeof a.open === "boolean" ? { open: a.open } : {}
623
651
  })
@@ -703,31 +731,107 @@ function registerPlatformTools(tool, client) {
703
731
  );
704
732
  }
705
733
 
706
- // src/tools-rights-page.ts
734
+ // src/tools-integrations.ts
707
735
  var import_zod3 = require("zod");
736
+ function registerIntegrationTools(tool, client) {
737
+ const updateSiteSchema = import_zod3.z.object({
738
+ cbid: import_zod3.z.string().describe("Site identifier (cbid)."),
739
+ domain: import_zod3.z.string().optional().describe("New domain, a bare hostname. A move clears verification: verify the new domain afterwards."),
740
+ name: import_zod3.z.string().nullable().optional().describe("Display name data subjects see on the rights page and in notices; null clears it."),
741
+ aliases: import_zod3.z.array(import_zod3.z.string()).optional().describe("Other hosts serving the site (replaces the list; [] clears it). Accepted consent origins, never verified claims."),
742
+ dryRun: import_zod3.z.boolean().optional().describe("Answer with the diff and its effects, storing nothing.")
743
+ });
744
+ tool(
745
+ "update_site",
746
+ "Rename or move a site: its domain, display name and aliases. The cbid and the consent ledger stay. Moving the domain clears verification; the scanner and preview links follow the new domain. Use dryRun first to see the diff and every effect.",
747
+ updateSiteSchema.shape,
748
+ (a) => {
749
+ const { cbid, dryRun, ...patch } = updateSiteSchema.parse(a);
750
+ return client.sites.update(cbid, patch, { dryRun });
751
+ }
752
+ );
753
+ tool(
754
+ "integration_health",
755
+ "Check every link a site\u2019s privacy wiring depends on: the domain, the snippet and CSP on the live page, connected systems (base URL redirects, a test lookup), webhooks, partner links, Atlas cookie_consent, cookies needing review, the rights page, the mail provider and the request SLA. Each row has ok (null = could not check) and a fix hint. Read-only.",
756
+ { cbid: import_zod3.z.string().optional().describe("Site identifier; optional when the org has one site.") },
757
+ (a) => client.integrationHealth(a.cbid)
758
+ );
759
+ const provisionSchema = import_zod3.z.object({
760
+ product: import_zod3.z.string().describe("A slug naming the product."),
761
+ domain: import_zod3.z.string().describe("The product\u2019s domain (bare hostname)."),
762
+ name: import_zod3.z.string().optional(),
763
+ aliases: import_zod3.z.array(import_zod3.z.string()).optional(),
764
+ cbid: import_zod3.z.string().optional().describe("Update this site instead of matching by domain."),
765
+ atlas: import_zod3.z.object({ secretKey: import_zod3.z.string(), cookieConsent: import_zod3.z.boolean().optional(), dsrWebhook: import_zod3.z.boolean().optional(), frontendApiHost: import_zod3.z.string().optional().describe("Your Atlas frontend API host (auth.example.com): declares the Atlas sign-in cookies on the site.") }).optional().describe("Atlas secret key (sk_\u2026) \u2014 used for this call only, never stored or returned."),
766
+ forumulate: import_zod3.z.object({ token: import_zod3.z.string(), orgId: import_zod3.z.string(), consent: import_zod3.z.boolean().optional(), executorKey: import_zod3.z.boolean().optional(), label: import_zod3.z.string().optional() }).optional().describe("Forumulate org token \u2014 used for this call only, never stored or returned."),
767
+ rightsApi: import_zod3.z.object({ baseUrl: import_zod3.z.string(), secretKey: import_zod3.z.string(), profilePreset: import_zod3.z.string().optional() }).optional(),
768
+ dryRun: import_zod3.z.boolean().optional().describe("Report what each step would do; write nothing on any platform. Run this first.")
769
+ });
770
+ tool(
771
+ "provision_product",
772
+ "Wire a product\u2019s privacy in one call: create or update the site, connected systems, the Atlas request-completion webhook and hosted-page consent banner, and Forumulate consent and executor key. Writes across three platforms; run with dryRun first. Idempotent: a re-run answers every step unchanged. No secret appears in the result.",
773
+ provisionSchema.shape,
774
+ (a) => {
775
+ const { dryRun, ...input } = provisionSchema.parse(a);
776
+ return client.provision(input, { dryRun });
777
+ }
778
+ );
779
+ tool(
780
+ "list_site_partners",
781
+ "Which partner platforms (Forumulate, Atlas) receive this site\u2019s consent events, each with its status, and which partners are on offer. Read-only.",
782
+ { cbid: import_zod3.z.string() },
783
+ (a) => client.sites.listPartners(a.cbid)
784
+ );
785
+ const linkSchema = import_zod3.z.object({
786
+ cbid: import_zod3.z.string(),
787
+ partner: import_zod3.z.enum(["forumulate", "atlas"]),
788
+ externalId: import_zod3.z.string().describe("The partner\u2019s id for the receiving account, e.g. a Forumulate organisation id."),
789
+ label: import_zod3.z.string().optional().describe('Shown with the partner name, e.g. "docs".'),
790
+ events: import_zod3.z.array(import_zod3.z.enum(["consent.recorded", "consent.withdrawn"])).optional(),
791
+ dryRun: import_zod3.z.boolean().optional()
792
+ });
793
+ tool(
794
+ "link_site_partner",
795
+ "Grant a partner platform this site\u2019s consent events (they start flowing out to it). No secret is created: deliveries are signed with Cookie Munch\u2019s own key. Idempotent.",
796
+ linkSchema.shape,
797
+ (a) => {
798
+ const { cbid, dryRun, ...input } = linkSchema.parse(a);
799
+ return client.sites.linkPartner(cbid, input, { dryRun });
800
+ }
801
+ );
802
+ tool(
803
+ "unlink_site_partner",
804
+ "Revoke a partner link: no further consent events go to that partner.",
805
+ { cbid: import_zod3.z.string(), linkId: import_zod3.z.string() },
806
+ (a) => client.sites.unlinkPartner(a.cbid, a.linkId)
807
+ );
808
+ }
809
+
810
+ // src/tools-rights-page.ts
811
+ var import_zod4 = require("zod");
708
812
  function registerRightsTools(tool, client) {
709
- const cbid = { cbid: import_zod3.z.string().describe("Site identifier (cbid). Must belong to your org.") };
813
+ const cbid = { cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org.") };
710
814
  const base = {
711
- baseUpdatedAt: import_zod3.z.union([import_zod3.z.number().int(), import_zod3.z.string(), import_zod3.z.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.")
815
+ baseUpdatedAt: import_zod4.z.union([import_zod4.z.number().int(), import_zod4.z.string(), import_zod4.z.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.")
712
816
  };
713
817
  const baseOpt = (a) => a.baseUpdatedAt !== void 0 ? { baseUpdatedAt: a.baseUpdatedAt } : {};
714
818
  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));
715
819
  tool(
716
820
  "update_rights_page",
717
821
  "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.",
718
- { ...cbid, page: import_zod3.z.record(import_zod3.z.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
822
+ { ...cbid, page: import_zod4.z.record(import_zod4.z.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
719
823
  (a) => client.rightsPage.put(a.cbid, a.page, baseOpt(a))
720
824
  );
721
825
  tool(
722
826
  "patch_rights_page",
723
827
  "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).",
724
- { ...cbid, patch: import_zod3.z.record(import_zod3.z.unknown()), ...base },
828
+ { ...cbid, patch: import_zod4.z.record(import_zod4.z.unknown()), ...base },
725
829
  (a) => client.rightsPage.patch(a.cbid, a.patch, baseOpt(a))
726
830
  );
727
831
  tool(
728
832
  "preview_rights_page",
729
833
  'Validate a rights-page write WITHOUT saving: returns the document as it would be stored and any publish warnings. mode "patch" (default) or "put".',
730
- { ...cbid, page: import_zod3.z.record(import_zod3.z.unknown()), mode: import_zod3.z.enum(["patch", "put"]).optional() },
834
+ { ...cbid, page: import_zod4.z.record(import_zod4.z.unknown()), mode: import_zod4.z.enum(["patch", "put"]).optional() },
731
835
  (a) => client.rightsPage.dryRun(a.cbid, a.page, { mode: a.mode ?? "patch" })
732
836
  );
733
837
  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));
@@ -741,14 +845,14 @@ function registerRightsTools(tool, client) {
741
845
  tool(
742
846
  "rollback_rights_page",
743
847
  "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.",
744
- { ...cbid, version: import_zod3.z.number().int().min(1), ...base },
848
+ { ...cbid, version: import_zod4.z.number().int().min(1), ...base },
745
849
  (a) => client.rightsPage.rollback(a.cbid, a.version, baseOpt(a))
746
850
  );
747
851
  }
748
852
  function registerRightsPageTools(tool, client) {
749
- const site = import_zod3.z.object({ cbid: import_zod3.z.string().describe("Site identifier (cbid). Must belong to your org.") });
853
+ const site = import_zod4.z.object({ cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org.") });
750
854
  const host = site.extend({
751
- hostname: import_zod3.z.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
855
+ hostname: import_zod4.z.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
752
856
  });
753
857
  tool(
754
858
  "list_rights_page_domains",
@@ -888,10 +992,10 @@ function registerTools(server, client) {
888
992
  }
889
993
  });
890
994
  };
891
- const cbid = { cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org.") };
995
+ const cbid = { cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org.") };
892
996
  const range = {
893
- from: import_zod4.z.number().optional().describe("Epoch-ms lower bound."),
894
- to: import_zod4.z.number().optional().describe("Epoch-ms upper bound.")
997
+ from: import_zod5.z.number().optional().describe("Epoch-ms lower bound."),
998
+ to: import_zod5.z.number().optional().describe("Epoch-ms upper bound.")
895
999
  };
896
1000
  tool(
897
1001
  "whoami",
@@ -909,19 +1013,19 @@ function registerTools(server, client) {
909
1013
  tool(
910
1014
  "get_site",
911
1015
  "One site: its domain, cbid and verification status. Read-only.",
912
- { cbid: import_zod4.z.string() },
1016
+ { cbid: import_zod5.z.string() },
913
1017
  (a) => client.sites.get(a.cbid)
914
1018
  );
915
1019
  tool(
916
1020
  "get_site_banner",
917
1021
  "Which banner design a site uses, or bannerId null when none is assigned. Read-only.",
918
- { cbid: import_zod4.z.string() },
1022
+ { cbid: import_zod5.z.string() },
919
1023
  (a) => client.sites.banner(a.cbid)
920
1024
  );
921
1025
  tool(
922
1026
  "get_privacy_policy",
923
1027
  "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.",
924
- { cbid: import_zod4.z.string(), contactEmail: import_zod4.z.string().optional(), effectiveDate: import_zod4.z.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: import_zod4.z.array(import_zod4.z.string()).optional() },
1028
+ { cbid: import_zod5.z.string(), contactEmail: import_zod5.z.string().optional(), effectiveDate: import_zod5.z.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: import_zod5.z.array(import_zod5.z.string()).optional() },
925
1029
  (a) => client.sites.policy(a.cbid, {
926
1030
  ...a.contactEmail ? { contactEmail: a.contactEmail } : {},
927
1031
  ...a.effectiveDate ? { effectiveDate: a.effectiveDate } : {},
@@ -931,7 +1035,7 @@ function registerTools(server, client) {
931
1035
  tool(
932
1036
  "set_ad_personalization",
933
1037
  "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.",
934
- { cbid: import_zod4.z.string(), enabled: import_zod4.z.boolean(), default: import_zod4.z.boolean().optional(), label: import_zod4.z.string().optional() },
1038
+ { cbid: import_zod5.z.string(), enabled: import_zod5.z.boolean(), default: import_zod5.z.boolean().optional(), label: import_zod5.z.string().optional() },
935
1039
  (a) => client.sites.setAdPersonalization(a.cbid, {
936
1040
  enabled: a.enabled,
937
1041
  ...a.default !== void 0 ? { default: a.default } : {},
@@ -942,11 +1046,11 @@ function registerTools(server, client) {
942
1046
  "analyze_session",
943
1047
  "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.",
944
1048
  {
945
- cbid: import_zod4.z.string(),
946
- har: import_zod4.z.unknown().optional().describe("A HAR export of the session."),
947
- requests: import_zod4.z.array(import_zod4.z.unknown()).optional().describe("Or the requests directly."),
948
- consent: import_zod4.z.record(import_zod4.z.string(), import_zod4.z.boolean()).optional(),
949
- gpc: import_zod4.z.boolean().optional()
1049
+ cbid: import_zod5.z.string(),
1050
+ har: import_zod5.z.unknown().optional().describe("A HAR export of the session."),
1051
+ requests: import_zod5.z.array(import_zod5.z.unknown()).optional().describe("Or the requests directly."),
1052
+ consent: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.boolean()).optional(),
1053
+ gpc: import_zod5.z.boolean().optional()
950
1054
  },
951
1055
  (a) => client.sites.analyzeSession(a.cbid, {
952
1056
  ...a.har !== void 0 ? { har: a.har } : {},
@@ -958,14 +1062,14 @@ function registerTools(server, client) {
958
1062
  tool(
959
1063
  "create_site",
960
1064
  "Create a new site. The cbid is auto-generated if you omit it.",
961
- { domain: import_zod4.z.string().describe("The site domain, e.g. example.com."), cbid: import_zod4.z.string().optional().describe("Optional explicit cbid.") },
1065
+ { domain: import_zod5.z.string().describe("The site domain, e.g. example.com."), cbid: import_zod5.z.string().optional().describe("Optional explicit cbid.") },
962
1066
  (a) => client.sites.create({ domain: a.domain, ...typeof a.cbid === "string" ? { cbid: a.cbid } : {} })
963
1067
  );
964
1068
  tool(
965
1069
  "create_sites_bulk",
966
1070
  "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.",
967
1071
  {
968
- sites: import_zod4.z.array(import_zod4.z.object({ domain: import_zod4.z.string(), cbid: import_zod4.z.string().optional(), platform: import_zod4.z.string().optional() })).min(1).max(100)
1072
+ sites: import_zod5.z.array(import_zod5.z.object({ domain: import_zod5.z.string(), cbid: import_zod5.z.string().optional(), platform: import_zod5.z.string().optional() })).min(1).max(100)
969
1073
  },
970
1074
  (a) => client.sites.createBulk(a.sites)
971
1075
  );
@@ -975,15 +1079,15 @@ function registerTools(server, client) {
975
1079
  "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.",
976
1080
  {
977
1081
  ...cbid,
978
- config: import_zod4.z.record(import_zod4.z.unknown()).describe("The full SiteConfig to write, not a patch. Without keepUnspecified, omitted top-level fields are NOT preserved from the current config."),
979
- keepUnspecified: import_zod4.z.boolean().optional().describe("PUT ?keep=unspecified: keep the stored value of every top-level field `config` omits, instead of reverting it to its default.")
1082
+ config: import_zod5.z.record(import_zod5.z.unknown()).describe("The full SiteConfig to write, not a patch. Without keepUnspecified, omitted top-level fields are NOT preserved from the current config."),
1083
+ keepUnspecified: import_zod5.z.boolean().optional().describe("PUT ?keep=unspecified: keep the stored value of every top-level field `config` omits, instead of reverting it to its default.")
980
1084
  },
981
1085
  (a) => a.keepUnspecified === true ? client.sites.putConfig(a.cbid, a.config, { keep: "unspecified" }) : client.sites.putConfig(a.cbid, a.config)
982
1086
  );
983
1087
  tool(
984
1088
  "patch_site_config",
985
1089
  `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.`,
986
- { ...cbid, config: import_zod4.z.record(import_zod4.z.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved; null removes a field.') },
1090
+ { ...cbid, config: import_zod5.z.record(import_zod5.z.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved; null removes a field.') },
987
1091
  (a) => client.sites.patchConfig(a.cbid, a.config)
988
1092
  );
989
1093
  tool(
@@ -991,9 +1095,9 @@ function registerTools(server, client) {
991
1095
  '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.',
992
1096
  {
993
1097
  ...cbid,
994
- config: import_zod4.z.record(import_zod4.z.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
995
- mode: import_zod4.z.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
996
- keepUnspecified: import_zod4.z.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
1098
+ config: import_zod5.z.record(import_zod5.z.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
1099
+ mode: import_zod5.z.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
1100
+ keepUnspecified: import_zod5.z.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
997
1101
  },
998
1102
  (a) => client.sites.dryRunConfig(a.cbid, a.config, {
999
1103
  mode: a.mode ?? "patch",
@@ -1005,8 +1109,8 @@ function registerTools(server, client) {
1005
1109
  '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.',
1006
1110
  {
1007
1111
  ...cbid,
1008
- config: import_zod4.z.record(import_zod4.z.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
1009
- replace: import_zod4.z.boolean().optional().describe("Check what update_site_config (a full replace) would store, instead of what patch_site_config (a merge) would.")
1112
+ config: import_zod5.z.record(import_zod5.z.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
1113
+ replace: import_zod5.z.boolean().optional().describe("Check what update_site_config (a full replace) would store, instead of what patch_site_config (a merge) would.")
1010
1114
  },
1011
1115
  async (a) => {
1012
1116
  const r = await client.sites.lintConfig(a.cbid, a.config, a.replace === true ? { replace: true } : {});
@@ -1030,7 +1134,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1030
1134
  tool(
1031
1135
  "get_consent_log",
1032
1136
  "Get recent anonymised consent records for a site.",
1033
- { ...cbid, ...range, limit: import_zod4.z.number().optional().describe("Max records to return (default 200).") },
1137
+ { ...cbid, ...range, limit: import_zod5.z.number().optional().describe("Max records to return (default 200).") },
1034
1138
  (a) => client.consent.log(a.cbid, {
1035
1139
  from: a.from,
1036
1140
  to: a.to,
@@ -1040,7 +1144,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1040
1144
  tool(
1041
1145
  "get_subject_consent",
1042
1146
  "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.",
1043
- { subjectId: import_zod4.z.string() },
1147
+ { subjectId: import_zod5.z.string() },
1044
1148
  (a) => client.subjects.consent(a.subjectId)
1045
1149
  );
1046
1150
  tool("list_dsar", "List all Data Subject Access Requests for your organization.", {}, () => client.dsar.list());
@@ -1048,51 +1152,53 @@ ${JSON.stringify(r, null, 2)}` : r;
1048
1152
  "update_dsar_executor",
1049
1153
  "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.",
1050
1154
  {
1051
- id: import_zod4.z.string(),
1052
- patch: import_zod4.z.record(import_zod4.z.unknown()),
1053
- dryRun: import_zod4.z.boolean().optional().describe("Validate and diff without saving.")
1155
+ id: import_zod5.z.string(),
1156
+ patch: import_zod5.z.record(import_zod5.z.unknown()),
1157
+ dryRun: import_zod5.z.boolean().optional().describe("Validate and diff without saving.")
1054
1158
  },
1055
1159
  (a) => a.dryRun === true ? client.fulfillment.dryRunUpdateExecutor(a.id, a.patch) : client.fulfillment.updateExecutor(a.id, a.patch)
1056
1160
  );
1057
1161
  tool(
1058
1162
  "get_dsar",
1059
1163
  "One rights request by id, including its status and the deadline it must be answered by.",
1060
- { id: import_zod4.z.string() },
1164
+ { id: import_zod5.z.string() },
1061
1165
  (a) => client.dsar.get(a.id)
1062
1166
  );
1063
1167
  tool(
1064
1168
  "erase_dsar_subject",
1065
1169
  "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.",
1066
- { id: import_zod4.z.string(), cbid: import_zod4.z.string(), stamp: import_zod4.z.string() },
1170
+ { id: import_zod5.z.string(), cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1067
1171
  (a) => client.dsar.erase(a.id, a.cbid, a.stamp)
1068
1172
  );
1069
1173
  tool(
1070
1174
  "export_dsar_subject",
1071
1175
  "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.",
1072
- { id: import_zod4.z.string(), cbid: import_zod4.z.string(), stamp: import_zod4.z.string() },
1176
+ { id: import_zod5.z.string(), cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1073
1177
  (a) => client.dsar.export(a.id, a.cbid, a.stamp)
1074
1178
  );
1075
1179
  tool(
1076
1180
  "get_dsar_response_notice",
1077
1181
  "The subject-facing response notice for a request, as plain text \u2014 what to send the person. Read-only; nothing is sent.",
1078
- { id: import_zod4.z.string() },
1182
+ { id: import_zod5.z.string() },
1079
1183
  (a) => client.dsar.response(a.id)
1080
1184
  );
1081
1185
  tool(
1082
1186
  "create_dsar",
1083
1187
  "Open a new Data Subject Access Request.",
1084
1188
  {
1085
- type: import_zod4.z.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
1086
- subjectEmail: import_zod4.z.string().describe("The data subject\u2019s email."),
1087
- regulation: import_zod4.z.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
1088
- note: import_zod4.z.string().optional().describe("Optional free-text note."),
1089
- test: import_zod4.z.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
1189
+ type: import_zod5.z.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
1190
+ subjectEmail: import_zod5.z.string().describe("The data subject\u2019s email."),
1191
+ regulation: import_zod5.z.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
1192
+ note: import_zod5.z.string().optional().describe("Optional INTERNAL note; never shown to the data subject."),
1193
+ messageToSubject: import_zod5.z.string().max(2e3).optional().describe("The line the data subject reads in the response notice. Never an API key."),
1194
+ test: import_zod5.z.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
1090
1195
  },
1091
1196
  (a) => client.dsar.create({
1092
1197
  type: a.type,
1093
1198
  subjectEmail: a.subjectEmail,
1094
1199
  regulation: a.regulation,
1095
1200
  ...typeof a.note === "string" ? { note: a.note } : {},
1201
+ ...typeof a.messageToSubject === "string" ? { messageToSubject: a.messageToSubject } : {},
1096
1202
  ...a.test === true ? { test: true } : {}
1097
1203
  })
1098
1204
  );
@@ -1100,11 +1206,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1100
1206
  "create_rights_link",
1101
1207
  "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.",
1102
1208
  {
1103
- cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org."),
1104
- email: import_zod4.z.string().describe("The signed-in person\u2019s verified email address."),
1105
- userId: import_zod4.z.string().optional().describe("Your own account id for them; recorded on the request."),
1106
- rights: import_zod4.z.array(import_zod4.z.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."),
1107
- ttlSeconds: import_zod4.z.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
1209
+ cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org."),
1210
+ email: import_zod5.z.string().describe("The signed-in person\u2019s verified email address."),
1211
+ userId: import_zod5.z.string().optional().describe("Your own account id for them; recorded on the request."),
1212
+ rights: import_zod5.z.array(import_zod5.z.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."),
1213
+ ttlSeconds: import_zod5.z.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
1108
1214
  },
1109
1215
  (a) => client.rightsLinks.create(a.cbid, {
1110
1216
  subject: { email: a.email, ...typeof a.userId === "string" ? { userId: a.userId } : {} },
@@ -1115,7 +1221,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1115
1221
  tool(
1116
1222
  "delete_test_dsar",
1117
1223
  "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.",
1118
- { id: import_zod4.z.string().describe("The test request id.") },
1224
+ { id: import_zod5.z.string().describe("The test request id.") },
1119
1225
  async (a) => {
1120
1226
  await client.dsar.delete(a.id);
1121
1227
  return { deleted: a.id };
@@ -1124,17 +1230,18 @@ ${JSON.stringify(r, null, 2)}` : r;
1124
1230
  tool(
1125
1231
  "mark_dsar_test",
1126
1232
  "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 }.",
1127
- { id: import_zod4.z.string().describe("The closed request id.") },
1233
+ { id: import_zod5.z.string().describe("The closed request id.") },
1128
1234
  (a) => client.dsar.markTest(a.id)
1129
1235
  );
1130
1236
  tool(
1131
1237
  "advance_dsar",
1132
1238
  "Advance a DSAR to a new status (received \u2192 verifying \u2192 in_progress \u2192 completed, or rejected).",
1133
1239
  {
1134
- id: import_zod4.z.string().describe("The DSAR id."),
1135
- toStatus: import_zod4.z.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status.")
1240
+ id: import_zod5.z.string().describe("The DSAR id."),
1241
+ toStatus: import_zod5.z.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status."),
1242
+ messageToSubject: import_zod5.z.string().max(2e3).optional().describe("Replaces the line the data subject reads in the notice \u2014 for a rejection, why.")
1136
1243
  },
1137
- (a) => client.dsar.advance(a.id, a.toStatus)
1244
+ (a) => typeof a.messageToSubject === "string" ? client.dsar.advance(a.id, a.toStatus, { messageToSubject: a.messageToSubject }) : client.dsar.advance(a.id, a.toStatus)
1138
1245
  );
1139
1246
  tool(
1140
1247
  "export_consent",
@@ -1145,7 +1252,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1145
1252
  tool(
1146
1253
  "get_receipt",
1147
1254
  "Fetch the signed consent receipt for a single consent record (by stamp).",
1148
- { ...cbid, stamp: import_zod4.z.string().describe("The consent record stamp/id.") },
1255
+ { ...cbid, stamp: import_zod5.z.string().describe("The consent record stamp/id.") },
1149
1256
  (a) => client.consent.receipt(a.cbid, a.stamp)
1150
1257
  );
1151
1258
  tool("delete_site", "Delete a site (cbid) and its configuration from your org.", { ...cbid }, async (a) => {
@@ -1157,13 +1264,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1157
1264
  "create_vendor",
1158
1265
  "Register a vendor (processor) and compute its risk score.",
1159
1266
  {
1160
- name: import_zod4.z.string().describe("Vendor name."),
1161
- category: import_zod4.z.string().describe("Vendor category, e.g. analytics."),
1162
- dataShared: import_zod4.z.array(import_zod4.z.string()).describe("Categories of data shared with the vendor."),
1163
- dpaSigned: import_zod4.z.boolean().describe("Whether a Data Processing Agreement is signed."),
1164
- subprocessors: import_zod4.z.number().describe("Number of subprocessors."),
1165
- certifications: import_zod4.z.array(import_zod4.z.string()).describe("Compliance certifications, e.g. ISO27001."),
1166
- region: import_zod4.z.string().describe("Primary processing region, e.g. EU.")
1267
+ name: import_zod5.z.string().describe("Vendor name."),
1268
+ category: import_zod5.z.string().describe("Vendor category, e.g. analytics."),
1269
+ dataShared: import_zod5.z.array(import_zod5.z.string()).describe("Categories of data shared with the vendor."),
1270
+ dpaSigned: import_zod5.z.boolean().describe("Whether a Data Processing Agreement is signed."),
1271
+ subprocessors: import_zod5.z.number().describe("Number of subprocessors."),
1272
+ certifications: import_zod5.z.array(import_zod5.z.string()).describe("Compliance certifications, e.g. ISO27001."),
1273
+ region: import_zod5.z.string().describe("Primary processing region, e.g. EU.")
1167
1274
  },
1168
1275
  (a) => client.vendors.create({
1169
1276
  name: a.name,
@@ -1181,13 +1288,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1181
1288
  "create_ropa",
1182
1289
  "Create a Record of Processing Activity (RoPA) entry.",
1183
1290
  {
1184
- name: import_zod4.z.string().describe("Activity name."),
1185
- purpose: import_zod4.z.string().describe("Purpose of processing."),
1186
- legalBasis: import_zod4.z.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
1187
- dataCategories: import_zod4.z.array(import_zod4.z.string()).describe("Categories of personal data."),
1188
- recipients: import_zod4.z.array(import_zod4.z.string()).describe("Recipients of the data."),
1189
- retentionDays: import_zod4.z.number().describe("Retention period in days."),
1190
- crossBorderTransfer: import_zod4.z.boolean().describe("Whether data is transferred across borders.")
1291
+ name: import_zod5.z.string().describe("Activity name."),
1292
+ purpose: import_zod5.z.string().describe("Purpose of processing."),
1293
+ legalBasis: import_zod5.z.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
1294
+ dataCategories: import_zod5.z.array(import_zod5.z.string()).describe("Categories of personal data."),
1295
+ recipients: import_zod5.z.array(import_zod5.z.string()).describe("Recipients of the data."),
1296
+ retentionDays: import_zod5.z.number().describe("Retention period in days."),
1297
+ crossBorderTransfer: import_zod5.z.boolean().describe("Whether data is transferred across borders.")
1191
1298
  },
1192
1299
  (a) => client.ropa.create({
1193
1300
  name: a.name,
@@ -1207,15 +1314,23 @@ ${JSON.stringify(r, null, 2)}` : r;
1207
1314
  );
1208
1315
  tool(
1209
1316
  "scan_site",
1210
- "Trigger a cookie scan for a site. Returns the scan job state.",
1211
- { ...cbid },
1212
- (a) => client.sites.scan(a.cbid)
1317
+ "Trigger a cookie crawl of a site (at most 90 s). Returns its scanId and state (queued). With wait: true, returns once it is done or failed \u2014 state, cookieCount, pagesVisited, durationMs, error. The stored list keeps cookies earlier crawls and real visits found; retire one the site no longer sets.",
1318
+ { ...cbid, wait: import_zod5.z.boolean().optional().describe("Wait for the scan to finish (up to 100 s) and return its outcome.") },
1319
+ async (a) => {
1320
+ let started;
1321
+ try {
1322
+ started = await client.sites.scan(a.cbid);
1323
+ } catch (err) {
1324
+ if (!a.wait || err.status !== 409) throw err;
1325
+ }
1326
+ return a.wait ? client.sites.waitForScan(a.cbid, { timeoutMs: 1e5 }) : started;
1327
+ }
1213
1328
  );
1214
1329
  tool(
1215
1330
  "get_scan_status",
1216
- "Get the status/result of a site\u2019s most recent cookie scan.",
1217
- { ...cbid },
1218
- (a) => client.sites.scanStatus(a.cbid)
1331
+ "Get a site\u2019s last cookie scan: state (queued, scanning, done, failed), scanId, durationMs, cookieCount, pagesVisited and error when it failed.",
1332
+ { ...cbid, wait: import_zod5.z.number().min(0).max(60).optional().describe("Seconds (\u226460) to wait for a running scan to settle before answering.") },
1333
+ (a) => a.wait !== void 0 ? client.sites.scanStatus(a.cbid, { wait: a.wait }) : client.sites.scanStatus(a.cbid)
1219
1334
  );
1220
1335
  tool(
1221
1336
  "get_ab_results",
@@ -1226,16 +1341,25 @@ ${JSON.stringify(r, null, 2)}` : r;
1226
1341
  tool("list_brand_kits", "List reusable brand kits (colors/logo/typography) for your org.", {}, () => client.brandKits.list());
1227
1342
  tool("list_preferences", "List configurable consent preferences/purposes for your org.", {}, () => client.preferences.list());
1228
1343
  tool("list_members", "List the members of your organization.", {}, () => client.members.list());
1229
- tool("list_api_keys", "List the API keys for your organization (secrets are not returned).", {}, () => client.keys.list());
1344
+ tool("list_api_keys", "List the API keys for your organization (secrets are not returned), with each key\u2019s scopes, expiry and when it was last used.", {}, () => client.keys.list());
1345
+ tool(
1346
+ "api_key_report",
1347
+ "Key hygiene: keys not used for a while, keys with broad (full or wide write) access, and keys expiring soon, each with the reason. Read-only.",
1348
+ {
1349
+ unusedDays: import_zod5.z.number().int().min(1).max(3650).optional().describe("Unused for at least this many days (default 90)."),
1350
+ expiringDays: import_zod5.z.number().int().min(1).max(3650).optional().describe("Expiring within this many days (default 14).")
1351
+ },
1352
+ (a) => client.keys.report({ ...a.unusedDays !== void 0 ? { unusedDays: a.unusedDays } : {}, ...a.expiringDays !== void 0 ? { expiringDays: a.expiringDays } : {} })
1353
+ );
1230
1354
  tool("get_usage", "Get the current usage/quota summary for your organization.", {}, () => client.usage());
1231
1355
  tool("list_webhooks", "List webhook subscriptions for your organization.", {}, () => client.webhooks.list());
1232
1356
  tool(
1233
1357
  "create_webhook",
1234
1358
  "Create a webhook subscription. The response includes the signing secret (shown once).",
1235
1359
  {
1236
- url: import_zod4.z.string().describe("HTTPS endpoint to deliver events to."),
1237
- events: import_zod4.z.array(import_zod4.z.string()).describe("Event names to subscribe to, e.g. consent.created."),
1238
- cbid: import_zod4.z.string().optional().describe("Optional site cbid to scope the subscription to.")
1360
+ url: import_zod5.z.string().describe("HTTPS endpoint to deliver events to."),
1361
+ events: import_zod5.z.array(import_zod5.z.string()).describe("Event names to subscribe to, e.g. consent.created."),
1362
+ cbid: import_zod5.z.string().optional().describe("Optional site cbid to scope the subscription to.")
1239
1363
  },
1240
1364
  (a) => client.webhooks.create({
1241
1365
  url: a.url,
@@ -1246,13 +1370,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1246
1370
  tool(
1247
1371
  "roll_webhook_secret",
1248
1372
  "Rotate a webhook subscription\u2019s signing secret. The new secret is returned once; the receiving endpoint must be updated to verify with it.",
1249
- { id: import_zod4.z.string() },
1373
+ { id: import_zod5.z.string() },
1250
1374
  (a) => client.webhooks.rollSecret(a.id)
1251
1375
  );
1252
1376
  tool(
1253
1377
  "test_webhook",
1254
1378
  "Send a signed test event to a webhook subscription now, and report what the endpoint answered.",
1255
- { id: import_zod4.z.string() },
1379
+ { id: import_zod5.z.string() },
1256
1380
  (a) => client.webhooks.test(a.id)
1257
1381
  );
1258
1382
  tool(
@@ -1264,18 +1388,18 @@ ${JSON.stringify(r, null, 2)}` : r;
1264
1388
  tool(
1265
1389
  "replay_webhook_dead_letter",
1266
1390
  "Deliver a dead-lettered webhook event again, to the subscription as it is now.",
1267
- { id: import_zod4.z.string() },
1391
+ { id: import_zod5.z.string() },
1268
1392
  (a) => client.webhooks.replayDeadLetter(a.id)
1269
1393
  );
1270
1394
  tool(
1271
1395
  "update_webhook",
1272
1396
  "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.",
1273
1397
  {
1274
- id: import_zod4.z.string(),
1275
- url: import_zod4.z.string().optional(),
1276
- events: import_zod4.z.array(import_zod4.z.string()).optional(),
1277
- cbid: import_zod4.z.string().nullable().optional(),
1278
- active: import_zod4.z.boolean().optional()
1398
+ id: import_zod5.z.string(),
1399
+ url: import_zod5.z.string().optional(),
1400
+ events: import_zod5.z.array(import_zod5.z.string()).optional(),
1401
+ cbid: import_zod5.z.string().nullable().optional(),
1402
+ active: import_zod5.z.boolean().optional()
1279
1403
  },
1280
1404
  (a) => client.webhooks.update(a.id, {
1281
1405
  ...a.url !== void 0 ? { url: a.url } : {},
@@ -1284,20 +1408,20 @@ ${JSON.stringify(r, null, 2)}` : r;
1284
1408
  ...a.active !== void 0 ? { active: a.active } : {}
1285
1409
  })
1286
1410
  );
1287
- tool("delete_webhook", "Delete a webhook subscription by id.", { id: import_zod4.z.string().describe("The webhook subscription id.") }, async (a) => {
1411
+ tool("delete_webhook", "Delete a webhook subscription by id.", { id: import_zod5.z.string().describe("The webhook subscription id.") }, async (a) => {
1288
1412
  await client.webhooks.delete(a.id);
1289
1413
  return { ok: true };
1290
1414
  });
1291
1415
  tool(
1292
1416
  "verify_site",
1293
1417
  "Verify that your organization controls a domain by one of three challenge methods (dns / meta / file). Required to unlock consent export and signed receipts.",
1294
- { ...cbid, method: import_zod4.z.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
1418
+ { ...cbid, method: import_zod5.z.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
1295
1419
  (a) => client.sites.verify(a.cbid, a.method)
1296
1420
  );
1297
1421
  tool(
1298
1422
  "get_verification_challenge",
1299
1423
  "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.",
1300
- { cbid: import_zod4.z.string() },
1424
+ { cbid: import_zod5.z.string() },
1301
1425
  (a) => client.sites.verifyChallenge(a.cbid)
1302
1426
  );
1303
1427
  tool(
@@ -1309,15 +1433,15 @@ ${JSON.stringify(r, null, 2)}` : r;
1309
1433
  tool(
1310
1434
  "get_flow",
1311
1435
  "Get the v2 banner flow config for a site, including current views, categories, and any lint issues.",
1312
- { cbid: import_zod4.z.string().describe("Site identifier (cbid).") },
1436
+ { cbid: import_zod5.z.string().describe("Site identifier (cbid).") },
1313
1437
  (a) => client.sites.getFlow(a.cbid)
1314
1438
  );
1315
1439
  tool(
1316
1440
  "edit_flow",
1317
1441
  "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.",
1318
1442
  {
1319
- cbid: import_zod4.z.string().describe("Site identifier (cbid)."),
1320
- operations: import_zod4.z.array(import_zod4.z.record(import_zod4.z.unknown())).describe(
1443
+ cbid: import_zod5.z.string().describe("Site identifier (cbid)."),
1444
+ operations: import_zod5.z.array(import_zod5.z.record(import_zod5.z.unknown())).describe(
1321
1445
  'Ordered list of ops. Each must have an "op" field: addView | removeView | addElement | setButtonTransition | addCustomCategory.'
1322
1446
  )
1323
1447
  },
@@ -1327,21 +1451,22 @@ ${JSON.stringify(r, null, 2)}` : r;
1327
1451
  "set_flow",
1328
1452
  "Wholesale replace a site's v2 banner flow with a complete config (e.g. from a template). Validated server-side before it is saved.",
1329
1453
  {
1330
- cbid: import_zod4.z.string().describe("Site identifier (cbid)."),
1331
- config: import_zod4.z.record(import_zod4.z.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1454
+ cbid: import_zod5.z.string().describe("Site identifier (cbid)."),
1455
+ config: import_zod5.z.record(import_zod5.z.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1332
1456
  },
1333
1457
  (a) => client.sites.setFlow(a.cbid, a.config)
1334
1458
  );
1335
1459
  registerConfigTools(tool, client);
1336
1460
  registerPlatformTools(tool, client);
1461
+ registerIntegrationTools(tool, client);
1337
1462
  registerRightsTools(tool, client);
1338
1463
  registerRightsPageTools(tool, client);
1339
1464
  tool(
1340
1465
  "invite_member",
1341
1466
  "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.",
1342
1467
  {
1343
- email: import_zod4.z.string().describe("Email address of the person to invite."),
1344
- role: import_zod4.z.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1468
+ email: import_zod5.z.string().describe("Email address of the person to invite."),
1469
+ role: import_zod5.z.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1345
1470
  },
1346
1471
  (a) => client.members.invite(a.email, a.role)
1347
1472
  );
@@ -1349,8 +1474,8 @@ ${JSON.stringify(r, null, 2)}` : r;
1349
1474
  "set_member_role",
1350
1475
  "Change the role of a member in your organization. The org owner's role cannot be changed.",
1351
1476
  {
1352
- userId: import_zod4.z.string().describe("The userId of the member whose role to change."),
1353
- role: import_zod4.z.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1477
+ userId: import_zod5.z.string().describe("The userId of the member whose role to change."),
1478
+ role: import_zod5.z.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1354
1479
  },
1355
1480
  (a) => client.members.setRole(a.userId, a.role)
1356
1481
  );
@@ -1358,7 +1483,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1358
1483
  "remove_member",
1359
1484
  "Remove a member from your organization. The org owner cannot be removed.",
1360
1485
  {
1361
- userId: import_zod4.z.string().describe("The userId of the member to remove.")
1486
+ userId: import_zod5.z.string().describe("The userId of the member to remove.")
1362
1487
  },
1363
1488
  async (a) => {
1364
1489
  await client.members.remove(a.userId);
@@ -1369,11 +1494,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1369
1494
  "create_brand_kit",
1370
1495
  "Create a reusable brand kit (colors, logo, typography) for your organization's consent banners.",
1371
1496
  {
1372
- name: import_zod4.z.string().describe("Display name for the brand kit."),
1373
- theme: import_zod4.z.record(import_zod4.z.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1374
- content: import_zod4.z.record(import_zod4.z.unknown()).optional().describe("Optional banner copy overrides."),
1375
- logoUrl: import_zod4.z.string().optional().describe("Optional URL for your org logo."),
1376
- customCss: import_zod4.z.string().optional().describe("Optional custom CSS string to inject into the banner.")
1497
+ name: import_zod5.z.string().describe("Display name for the brand kit."),
1498
+ theme: import_zod5.z.record(import_zod5.z.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1499
+ content: import_zod5.z.record(import_zod5.z.unknown()).optional().describe("Optional banner copy overrides."),
1500
+ logoUrl: import_zod5.z.string().optional().describe("Optional URL for your org logo."),
1501
+ customCss: import_zod5.z.string().optional().describe("Optional custom CSS string to inject into the banner.")
1377
1502
  },
1378
1503
  (a) => client.brandKits.create({
1379
1504
  name: a.name,
@@ -1387,7 +1512,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1387
1512
  "delete_brand_kit",
1388
1513
  "Delete a brand kit by id. The kit must belong to your organization (cross-org deletes are rejected).",
1389
1514
  {
1390
- id: import_zod4.z.string().describe("The brand kit id to delete.")
1515
+ id: import_zod5.z.string().describe("The brand kit id to delete.")
1391
1516
  },
1392
1517
  async (a) => {
1393
1518
  await client.brandKits.delete(a.id);
@@ -1398,63 +1523,65 @@ ${JSON.stringify(r, null, 2)}` : r;
1398
1523
  "save_preference",
1399
1524
  "Save or update the consent preferences for an end-user (by subjectId) within your organization. purposes is a map of purpose-name \u2192 boolean.",
1400
1525
  {
1401
- subjectId: import_zod4.z.string().describe("The end-user identifier (e.g. email or internal user id)."),
1402
- purposes: import_zod4.z.record(import_zod4.z.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1526
+ subjectId: import_zod5.z.string().describe("The end-user identifier (e.g. email or internal user id)."),
1527
+ purposes: import_zod5.z.record(import_zod5.z.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1403
1528
  },
1404
1529
  (a) => client.preferences.save(a.subjectId, a.purposes)
1405
1530
  );
1406
1531
  tool(
1407
1532
  "get_preference",
1408
1533
  "One end-user\u2019s saved preferences, by subjectId. Read-only.",
1409
- { subjectId: import_zod4.z.string() },
1534
+ { subjectId: import_zod5.z.string() },
1410
1535
  (a) => client.preferences.get(a.subjectId)
1411
1536
  );
1412
1537
  tool(
1413
1538
  "issue_api_key",
1414
1539
  "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.",
1415
1540
  {
1416
- name: import_zod4.z.string().optional(),
1417
- scopes: import_zod4.z.array(import_zod4.z.string()).optional(),
1418
- cbids: import_zod4.z.array(import_zod4.z.string()).min(1).optional(),
1419
- expiresInDays: import_zod4.z.number().int().min(1).max(3650).optional()
1541
+ name: import_zod5.z.string().optional(),
1542
+ scopes: import_zod5.z.array(import_zod5.z.string()).optional(),
1543
+ cbids: import_zod5.z.array(import_zod5.z.string()).min(1).optional(),
1544
+ expiresInDays: import_zod5.z.number().int().min(1).max(3650).optional(),
1545
+ expiresAt: import_zod5.z.string().optional().describe("Or the exact expiry, an ISO date-time (not with expiresInDays).")
1420
1546
  },
1421
1547
  (a) => client.keys.issue({
1548
+ ...a.expiresAt ? { expiresAt: a.expiresAt } : {},
1422
1549
  ...a.name ? { name: a.name } : {},
1423
1550
  ...a.scopes ? { scopes: a.scopes } : {},
1424
1551
  ...a.cbids ? { cbids: a.cbids } : {},
1425
1552
  ...a.expiresInDays !== void 0 ? { expiresInDays: a.expiresInDays } : {}
1426
1553
  })
1427
1554
  );
1428
- tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: import_zod4.z.string() }, async (a) => {
1555
+ tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: import_zod5.z.string() }, async (a) => {
1429
1556
  await client.keys.revoke(a.prefix);
1430
1557
  return { revoked: a.prefix };
1431
1558
  });
1432
1559
  tool(
1433
1560
  "import_cookie_declaration",
1434
1561
  "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.",
1435
- { cbid: import_zod4.z.string(), data: import_zod4.z.string().describe("The exported file, as text (CSV or JSON).") },
1562
+ { cbid: import_zod5.z.string(), data: import_zod5.z.string().describe("The exported file, as text (CSV or JSON).") },
1436
1563
  (a) => client.sites.importDeclaration(a.cbid, a.data)
1437
1564
  );
1438
1565
  tool(
1439
1566
  "apply_cookie_import",
1440
1567
  "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.",
1441
- { cbid: import_zod4.z.string(), data: import_zod4.z.string().describe("The exported file, as text (CSV or JSON)."), overwrite: import_zod4.z.boolean().optional() },
1568
+ { cbid: import_zod5.z.string(), data: import_zod5.z.string().describe("The exported file, as text (CSV or JSON)."), overwrite: import_zod5.z.boolean().optional() },
1442
1569
  (a) => client.sites.applyImport(a.cbid, a.data, a.overwrite ? { overwrite: true } : void 0)
1443
1570
  );
1444
1571
  const declarationShape = {
1445
- category: import_zod4.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1446
- purpose: import_zod4.z.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1447
- purposes: import_zod4.z.record(import_zod4.z.string(), import_zod4.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.'),
1448
- provider: import_zod4.z.string().optional(),
1449
- expiry: import_zod4.z.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
1450
- domain: import_zod4.z.string().optional(),
1451
- pattern: import_zod4.z.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
1572
+ category: import_zod5.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1573
+ purpose: import_zod5.z.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1574
+ purposes: import_zod5.z.record(import_zod5.z.string(), import_zod5.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.'),
1575
+ provider: import_zod5.z.string().optional(),
1576
+ expiry: import_zod5.z.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
1577
+ domain: import_zod5.z.string().optional(),
1578
+ pattern: import_zod5.z.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
1452
1579
  };
1453
- const dryRunArg = import_zod4.z.boolean().optional().describe("Store nothing: answer with the would-be declarations and a diff (added / removed / changed) to check first.");
1580
+ const dryRunArg = import_zod5.z.boolean().optional().describe("Store nothing: answer with the would-be declarations and a diff (added / removed / changed) to check first.");
1454
1581
  tool(
1455
1582
  "declare_cookie",
1456
1583
  '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.',
1457
- { cbid: import_zod4.z.string(), name: import_zod4.z.string(), ...declarationShape, dryRun: dryRunArg },
1584
+ { cbid: import_zod5.z.string(), name: import_zod5.z.string(), ...declarationShape, dryRun: dryRunArg },
1458
1585
  (a) => {
1459
1586
  const { cbid: cbid2, name, dryRun, ...rest } = a;
1460
1587
  return client.sites.declareCookie(cbid2, name, rest, dryRun ? { dryRun: true } : void 0);
@@ -1463,7 +1590,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1463
1590
  tool(
1464
1591
  "declare_cookies",
1465
1592
  "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.",
1466
- { cbid: import_zod4.z.string(), cookies: import_zod4.z.array(import_zod4.z.object({ name: import_zod4.z.string(), ...declarationShape })).max(500), replace: import_zod4.z.boolean().optional(), dryRun: dryRunArg },
1593
+ { cbid: import_zod5.z.string(), cookies: import_zod5.z.array(import_zod5.z.object({ name: import_zod5.z.string(), ...declarationShape })).max(500), replace: import_zod5.z.boolean().optional(), dryRun: dryRunArg },
1467
1594
  (a) => {
1468
1595
  const o = { ...a.replace ? { replace: true } : {}, ...a.dryRun ? { dryRun: true } : {} };
1469
1596
  return client.sites.declareCookies(a.cbid, a.cookies, Object.keys(o).length ? o : void 0);
@@ -1472,35 +1599,118 @@ ${JSON.stringify(r, null, 2)}` : r;
1472
1599
  tool(
1473
1600
  "undeclare_cookie",
1474
1601
  "Remove a cookie declaration; the scanned/observed classification applies again.",
1475
- { cbid: import_zod4.z.string(), name: import_zod4.z.string(), dryRun: dryRunArg },
1602
+ { cbid: import_zod5.z.string(), name: import_zod5.z.string(), dryRun: dryRunArg },
1476
1603
  async (a) => {
1477
1604
  if (a.dryRun) return client.sites.undeclareCookie(a.cbid, a.name, { dryRun: true });
1478
1605
  await client.sites.undeclareCookie(a.cbid, a.name);
1479
1606
  return { undeclared: a.name };
1480
1607
  }
1481
1608
  );
1609
+ tool(
1610
+ "retire_cookie",
1611
+ 'Retire a cookie the site renamed or stopped setting: it leaves the banner\u2019s cookie list, data-cc="declaration" and the public feed, and stays listed for the owner with retired. A name ending in * retires every cookie with that prefix; the name must match a scanned, observed or declared cookie. If a crawl or a real visit sees it again afterwards, it is listed again with review: retired_but_seen.',
1612
+ {
1613
+ cbid: import_zod5.z.string(),
1614
+ name: import_zod5.z.string(),
1615
+ renamedTo: import_zod5.z.string().max(256).optional().describe("The cookie\u2019s new name, if it was renamed."),
1616
+ note: import_zod5.z.string().max(1e3).optional(),
1617
+ dryRun: import_zod5.z.boolean().optional().describe("Store nothing: answer with the would-be retirement and list to check first.")
1618
+ },
1619
+ (a) => {
1620
+ const input = { ...a.renamedTo ? { renamedTo: a.renamedTo } : {}, ...a.note ? { note: a.note } : {} };
1621
+ return client.sites.retireCookie(a.cbid, a.name, input, a.dryRun ? { dryRun: true } : void 0);
1622
+ }
1623
+ );
1624
+ tool(
1625
+ "unretire_cookie",
1626
+ "Un-retire a cookie: it is listed again everywhere.",
1627
+ { cbid: import_zod5.z.string(), name: import_zod5.z.string(), dryRun: import_zod5.z.boolean().optional().describe("Store nothing: answer with what the list would be.") },
1628
+ async (a) => {
1629
+ if (a.dryRun) return client.sites.unretireCookie(a.cbid, a.name, { dryRun: true });
1630
+ await client.sites.unretireCookie(a.cbid, a.name);
1631
+ return { unretired: a.name };
1632
+ }
1633
+ );
1634
+ tool(
1635
+ "list_cookie_presets",
1636
+ "Declaration presets for the platforms a site is built on (atlas, forumulate, chatly, cookiemunch): each one\u2019s parameters, what it has declared on this site, and whether the vendor\u2019s live manifest can be imported yet. Read-only.",
1637
+ { cbid: import_zod5.z.string() },
1638
+ (a) => client.sites.cookiePresets(a.cbid)
1639
+ );
1640
+ tool(
1641
+ "apply_cookie_preset",
1642
+ "Apply (or re-sync) a vendor preset: declares exactly what that platform writes \u2014 cookies and browser storage, with domain and lifetime \u2014 marked as declared by that vendor. Re-applying removes keys the vendor no longer writes. Names the owner declared are kept (skipped). Atlas needs frontendApiHost (and crossSubdomainCookies, default true); Chatly needs publicId.",
1643
+ {
1644
+ cbid: import_zod5.z.string(),
1645
+ vendor: import_zod5.z.enum(["atlas", "forumulate", "chatly", "cookiemunch"]),
1646
+ frontendApiHost: import_zod5.z.string().optional().describe("Atlas: your frontend API host, e.g. auth.example.com."),
1647
+ crossSubdomainCookies: import_zod5.z.boolean().optional().describe("Atlas: default true \u2014 the cookies live on the parent domain."),
1648
+ publicId: import_zod5.z.string().optional().describe("Chatly: the channel public id (ch_web_\u2026)."),
1649
+ dragging: import_zod5.z.boolean().optional().describe("Chatly: the launcher can be dragged (adds the drag-position key)."),
1650
+ category: import_zod5.z.string().optional().describe("Chatly: the category for its keys. Default necessary."),
1651
+ dryRun: dryRunArg
1652
+ },
1653
+ (a) => {
1654
+ const params = {};
1655
+ for (const k of ["frontendApiHost", "crossSubdomainCookies", "publicId", "dragging", "category"]) if (a[k] !== void 0) params[k] = a[k];
1656
+ return client.sites.applyCookiePreset(a.cbid, a.vendor, params, a.dryRun ? { dryRun: true } : void 0);
1657
+ }
1658
+ );
1659
+ tool(
1660
+ "remove_cookie_preset",
1661
+ "Remove every declaration a vendor preset made on this site.",
1662
+ { cbid: import_zod5.z.string(), vendor: import_zod5.z.enum(["atlas", "forumulate", "chatly", "cookiemunch"]), dryRun: dryRunArg },
1663
+ (a) => client.sites.removeCookiePreset(a.cbid, a.vendor, a.dryRun ? { dryRun: true } : void 0)
1664
+ );
1665
+ tool(
1666
+ "delete_observed_cookie",
1667
+ "Remove every stored row of this name that crawls or real visits put in the site\u2019s cookie list (e.g. a name someone reported that the site never sets). A declaration of it stays. If real visits keep reporting it, it comes back quarantined.",
1668
+ { cbid: import_zod5.z.string(), name: import_zod5.z.string(), dryRun: dryRunArg },
1669
+ async (a) => {
1670
+ if (a.dryRun) return client.sites.deleteObservedCookie(a.cbid, a.name, { dryRun: true });
1671
+ await client.sites.deleteObservedCookie(a.cbid, a.name);
1672
+ return { deleted: a.name };
1673
+ }
1674
+ );
1675
+ tool(
1676
+ "purge_observed_cookies",
1677
+ "Purge observed since T: remove every row a real visit first reported at or after `since` (and before `until`). Crawled rows and declarations stay. Rows from before provenance was recorded use their last-seen time, so run with dryRun first.",
1678
+ {
1679
+ cbid: import_zod5.z.string(),
1680
+ since: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).describe("ISO-8601 time or epoch milliseconds."),
1681
+ until: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).optional().describe("Optional end of the window (exclusive)."),
1682
+ dryRun: dryRunArg
1683
+ },
1684
+ (a) => client.sites.purgeObservedCookies(
1685
+ a.cbid,
1686
+ { since: a.since, ...a.until !== void 0 ? { until: a.until } : {} },
1687
+ a.dryRun ? { dryRun: true } : void 0
1688
+ )
1689
+ );
1482
1690
  tool(
1483
1691
  "get_blocked_pages",
1484
1692
  "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.",
1485
- { cbid: import_zod4.z.string() },
1693
+ { cbid: import_zod5.z.string() },
1486
1694
  (a) => client.sites.blocked(a.cbid)
1487
1695
  );
1488
1696
  tool(
1489
1697
  "roll_api_key",
1490
1698
  "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.",
1491
- { prefix: import_zod4.z.string() },
1699
+ { prefix: import_zod5.z.string() },
1492
1700
  (a) => client.keys.roll(a.prefix)
1493
1701
  );
1494
1702
  tool(
1495
1703
  "update_api_key",
1496
- "Rename an API key, or replace its scopes or the properties it is locked to. Only the fields given change; the secret does not.",
1704
+ "Rename an API key, replace its scopes or the properties it is locked to, or set or remove its expiry. Only the fields given change; the secret does not.",
1497
1705
  {
1498
- prefix: import_zod4.z.string(),
1499
- name: import_zod4.z.string().optional(),
1500
- scopes: import_zod4.z.array(import_zod4.z.string()).optional(),
1501
- cbids: import_zod4.z.array(import_zod4.z.string()).min(1).optional()
1706
+ prefix: import_zod5.z.string(),
1707
+ name: import_zod5.z.string().optional(),
1708
+ scopes: import_zod5.z.array(import_zod5.z.string()).optional(),
1709
+ cbids: import_zod5.z.array(import_zod5.z.string()).min(1).optional(),
1710
+ expiresAt: import_zod5.z.string().nullable().optional().describe("A new expiry (ISO date-time), or null to remove it.")
1502
1711
  },
1503
1712
  (a) => client.keys.update(a.prefix, {
1713
+ ...a.expiresAt !== void 0 ? { expiresAt: a.expiresAt } : {},
1504
1714
  ...a.name !== void 0 ? { name: a.name } : {},
1505
1715
  ...a.scopes ? { scopes: a.scopes } : {},
1506
1716
  ...a.cbids ? { cbids: a.cbids } : {}
@@ -1510,7 +1720,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1510
1720
  tool(
1511
1721
  "update_org",
1512
1722
  "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.",
1513
- { name: import_zod4.z.string().min(1).optional(), logoUrl: import_zod4.z.string().nullable().optional() },
1723
+ { name: import_zod5.z.string().min(1).optional(), logoUrl: import_zod5.z.string().nullable().optional() },
1514
1724
  (a) => client.org.update({
1515
1725
  ...a.name !== void 0 ? { name: a.name } : {},
1516
1726
  ...a.logoUrl !== void 0 ? { logoUrl: a.logoUrl } : {}
@@ -1526,20 +1736,20 @@ ${JSON.stringify(r, null, 2)}` : r;
1526
1736
  "set_mail_provider",
1527
1737
  "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).",
1528
1738
  {
1529
- provider: import_zod4.z.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
1530
- fromEmail: import_zod4.z.string().describe("An address on a domain your provider has verified."),
1531
- fromName: import_zod4.z.string().max(100).nullable().optional(),
1532
- replyTo: import_zod4.z.string().nullable().optional(),
1533
- secret: import_zod4.z.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
1534
- ses: import_zod4.z.object({ region: import_zod4.z.string(), accessKeyId: import_zod4.z.string() }).optional().describe("Required for ses."),
1535
- smtp: import_zod4.z.object({ host: import_zod4.z.string(), port: import_zod4.z.union([import_zod4.z.literal(25), import_zod4.z.literal(465), import_zod4.z.literal(587), import_zod4.z.literal(2525)]), security: import_zod4.z.enum(["tls", "starttls"]), username: import_zod4.z.string() }).optional().describe("Required for smtp. TLS is always required.")
1739
+ provider: import_zod5.z.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
1740
+ fromEmail: import_zod5.z.string().describe("An address on a domain your provider has verified."),
1741
+ fromName: import_zod5.z.string().max(100).nullable().optional(),
1742
+ replyTo: import_zod5.z.string().nullable().optional(),
1743
+ secret: import_zod5.z.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
1744
+ ses: import_zod5.z.object({ region: import_zod5.z.string(), accessKeyId: import_zod5.z.string() }).optional().describe("Required for ses."),
1745
+ smtp: import_zod5.z.object({ host: import_zod5.z.string(), port: import_zod5.z.union([import_zod5.z.literal(25), import_zod5.z.literal(465), import_zod5.z.literal(587), import_zod5.z.literal(2525)]), security: import_zod5.z.enum(["tls", "starttls"]), username: import_zod5.z.string() }).optional().describe("Required for smtp. TLS is always required.")
1536
1746
  },
1537
1747
  (a) => client.org.mailProvider.set(a)
1538
1748
  );
1539
1749
  tool(
1540
1750
  "test_mail_provider",
1541
1751
  "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.",
1542
- { to: import_zod4.z.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
1752
+ { to: import_zod5.z.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
1543
1753
  (a) => client.org.mailProvider.test(a.to)
1544
1754
  );
1545
1755
  tool(
@@ -1553,11 +1763,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1553
1763
  );
1554
1764
  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.";
1555
1765
  const captchaInput = {
1556
- mode: import_zod4.z.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
1557
- provider: import_zod4.z.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
1558
- siteKey: import_zod4.z.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
1559
- secret: import_zod4.z.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
1560
- minScore: import_zod4.z.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
1766
+ mode: import_zod5.z.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
1767
+ provider: import_zod5.z.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
1768
+ siteKey: import_zod5.z.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
1769
+ secret: import_zod5.z.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
1770
+ minScore: import_zod5.z.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
1561
1771
  };
1562
1772
  const captchaBody = (a) => ({
1563
1773
  mode: a.mode,
@@ -1569,19 +1779,19 @@ ${JSON.stringify(r, null, 2)}` : r;
1569
1779
  tool(
1570
1780
  "get_rights_captcha",
1571
1781
  "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.",
1572
- { cbid: import_zod4.z.string() },
1782
+ { cbid: import_zod5.z.string() },
1573
1783
  (a) => client.rightsCaptcha.get(a.cbid)
1574
1784
  );
1575
1785
  tool(
1576
1786
  "set_rights_captcha",
1577
1787
  `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.`,
1578
- { cbid: import_zod4.z.string(), ...captchaInput },
1788
+ { cbid: import_zod5.z.string(), ...captchaInput },
1579
1789
  (a) => client.rightsCaptcha.set(a.cbid, captchaBody(a))
1580
1790
  );
1581
1791
  tool(
1582
1792
  "remove_rights_captcha",
1583
1793
  "Remove a site\u2019s own captcha setting: it inherits the organisation default again (or off). Returns the setting now in force.",
1584
- { cbid: import_zod4.z.string() },
1794
+ { cbid: import_zod5.z.string() },
1585
1795
  (a) => client.rightsCaptcha.remove(a.cbid)
1586
1796
  );
1587
1797
  tool(
@@ -1604,15 +1814,15 @@ ${JSON.stringify(r, null, 2)}` : r;
1604
1814
  );
1605
1815
  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.";
1606
1816
  const identityInput = {
1607
- type: import_zod4.z.enum(["clerk", "atlas", "oidc_jwt"]).describe("clerk, atlas (Clerk-shaped), or oidc_jwt (any issuer that signs session JWTs with a published JWKS)."),
1608
- issuer: import_zod4.z.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
1609
- jwksUrl: import_zod4.z.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
1610
- audience: import_zod4.z.string().optional().describe("Expected aud. For oidc_jwt an audience or authorizedParties is required (a shared issuer mints tokens for every app)."),
1611
- authorizedParties: import_zod4.z.array(import_zod4.z.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."),
1612
- emailClaim: import_zod4.z.string().optional().describe("Default email."),
1613
- emailVerifiedClaim: import_zod4.z.string().optional().describe("Default email_verified; must be exactly true."),
1614
- sessionCookieName: import_zod4.z.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
1615
- trustEmailClaim: import_zod4.z.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.")
1817
+ type: import_zod5.z.enum(["clerk", "atlas", "oidc_jwt"]).describe("clerk, atlas (Clerk-shaped), or oidc_jwt (any issuer that signs session JWTs with a published JWKS)."),
1818
+ issuer: import_zod5.z.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
1819
+ jwksUrl: import_zod5.z.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
1820
+ audience: import_zod5.z.string().optional().describe("Expected aud. For oidc_jwt an audience or authorizedParties is required (a shared issuer mints tokens for every app)."),
1821
+ authorizedParties: import_zod5.z.array(import_zod5.z.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."),
1822
+ emailClaim: import_zod5.z.string().optional().describe("Default email."),
1823
+ emailVerifiedClaim: import_zod5.z.string().optional().describe("Default email_verified; must be exactly true."),
1824
+ sessionCookieName: import_zod5.z.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
1825
+ trustEmailClaim: import_zod5.z.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.")
1616
1826
  };
1617
1827
  const identityBody = (a) => {
1618
1828
  const out = { type: a.type, issuer: a.issuer };
@@ -1622,19 +1832,19 @@ ${JSON.stringify(r, null, 2)}` : r;
1622
1832
  tool(
1623
1833
  "get_rights_identity",
1624
1834
  "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.",
1625
- { cbid: import_zod4.z.string() },
1835
+ { cbid: import_zod5.z.string() },
1626
1836
  (a) => client.rightsIdentity.get(a.cbid)
1627
1837
  );
1628
1838
  tool(
1629
1839
  "set_rights_identity",
1630
1840
  `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.`,
1631
- { cbid: import_zod4.z.string(), ...identityInput },
1841
+ { cbid: import_zod5.z.string(), ...identityInput },
1632
1842
  (a) => client.rightsIdentity.set(a.cbid, identityBody(a))
1633
1843
  );
1634
1844
  tool(
1635
1845
  "remove_rights_identity",
1636
1846
  "Remove a site\u2019s own sign-in provider: it inherits the organisation default again (or none). Returns the setting now in force.",
1637
- { cbid: import_zod4.z.string() },
1847
+ { cbid: import_zod5.z.string() },
1638
1848
  (a) => client.rightsIdentity.remove(a.cbid)
1639
1849
  );
1640
1850
  tool(
@@ -1658,22 +1868,22 @@ ${JSON.stringify(r, null, 2)}` : r;
1658
1868
  tool(
1659
1869
  "get_audit_log",
1660
1870
  "The organisation\u2019s audit log, newest first: administrative changes made in the dashboard or through the API, and who made them. Read-only.",
1661
- { limit: import_zod4.z.number().int().min(1).max(500).optional() },
1871
+ { limit: import_zod5.z.number().int().min(1).max(500).optional() },
1662
1872
  (a) => client.audit(a.limit)
1663
1873
  );
1664
1874
  tool(
1665
1875
  "upload_asset",
1666
1876
  "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.",
1667
1877
  {
1668
- data: import_zod4.z.string(),
1669
- contentType: import_zod4.z.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
1878
+ data: import_zod5.z.string(),
1879
+ contentType: import_zod5.z.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
1670
1880
  },
1671
1881
  (a) => client.assets.upload({ data: a.data, contentType: a.contentType })
1672
1882
  );
1673
1883
  tool(
1674
1884
  "delete_asset",
1675
1885
  "Delete a stored image by its URL (or file name). Only your own organisation\u2019s images can be named.",
1676
- { url: import_zod4.z.string().describe("The URL upload_asset returned, or just its file name.") },
1886
+ { url: import_zod5.z.string().describe("The URL upload_asset returned, or just its file name.") },
1677
1887
  async (a) => {
1678
1888
  await client.assets.delete(a.url);
1679
1889
  return { deleted: a.url };
@@ -1688,18 +1898,18 @@ ${JSON.stringify(r, null, 2)}` : r;
1688
1898
  tool(
1689
1899
  "get_customer",
1690
1900
  "One child org: its controller details and usage. Read-only.",
1691
- { id: import_zod4.z.string() },
1901
+ { id: import_zod5.z.string() },
1692
1902
  (a) => client.reseller.get(a.id)
1693
1903
  );
1694
1904
  tool(
1695
1905
  "provision_customer",
1696
1906
  "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.",
1697
1907
  {
1698
- name: import_zod4.z.string(),
1699
- ownerEmail: import_zod4.z.string().optional(),
1700
- delegatedAccess: import_zod4.z.boolean().optional().describe("Whether this reseller may act inside the child."),
1701
- mintKey: import_zod4.z.boolean().optional(),
1702
- keyScopes: import_zod4.z.array(import_zod4.z.string()).optional()
1908
+ name: import_zod5.z.string(),
1909
+ ownerEmail: import_zod5.z.string().optional(),
1910
+ delegatedAccess: import_zod5.z.boolean().optional().describe("Whether this reseller may act inside the child."),
1911
+ mintKey: import_zod5.z.boolean().optional(),
1912
+ keyScopes: import_zod5.z.array(import_zod5.z.string()).optional()
1703
1913
  },
1704
1914
  (a) => client.reseller.create({
1705
1915
  name: a.name,
@@ -1713,10 +1923,10 @@ ${JSON.stringify(r, null, 2)}` : r;
1713
1923
  "update_customer",
1714
1924
  "Change a child org\u2019s status, delegated access or DSAR routing. `dsarRouting: null` clears the override.",
1715
1925
  {
1716
- id: import_zod4.z.string(),
1717
- status: import_zod4.z.enum(["active", "suspended"]).optional(),
1718
- delegatedAccess: import_zod4.z.boolean().optional(),
1719
- dsarRouting: import_zod4.z.enum(["reseller", "child"]).nullable().optional()
1926
+ id: import_zod5.z.string(),
1927
+ status: import_zod5.z.enum(["active", "suspended"]).optional(),
1928
+ delegatedAccess: import_zod5.z.boolean().optional(),
1929
+ dsarRouting: import_zod5.z.enum(["reseller", "child"]).nullable().optional()
1720
1930
  },
1721
1931
  (a) => client.reseller.update(a.id, {
1722
1932
  ...a.status ? { status: a.status } : {},
@@ -1727,7 +1937,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1727
1937
  tool(
1728
1938
  "suspend_customer",
1729
1939
  "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.)",
1730
- { id: import_zod4.z.string() },
1940
+ { id: import_zod5.z.string() },
1731
1941
  async (a) => {
1732
1942
  await client.reseller.deprovision(a.id);
1733
1943
  return { suspended: a.id };
@@ -1736,72 +1946,72 @@ ${JSON.stringify(r, null, 2)}` : r;
1736
1946
  tool(
1737
1947
  "list_customer_keys",
1738
1948
  "A child org's API key prefixes. Never the secrets. Read-only.",
1739
- { id: import_zod4.z.string() },
1949
+ { id: import_zod5.z.string() },
1740
1950
  (a) => client.reseller.listKeys(a.id)
1741
1951
  );
1742
1952
  tool(
1743
1953
  "issue_customer_key",
1744
1954
  "Mint an API key for a child org. The secret is returned once. Prefer scopes and a property lock over a full-access key.",
1745
- { id: import_zod4.z.string(), name: import_zod4.z.string().optional(), scopes: import_zod4.z.array(import_zod4.z.string()).optional(), cbids: import_zod4.z.array(import_zod4.z.string()).min(1).optional() },
1955
+ { id: import_zod5.z.string(), name: import_zod5.z.string().optional(), scopes: import_zod5.z.array(import_zod5.z.string()).optional(), cbids: import_zod5.z.array(import_zod5.z.string()).min(1).optional() },
1746
1956
  (a) => client.reseller.mintKey(a.id, {
1747
1957
  ...a.name ? { name: a.name } : {},
1748
1958
  ...a.scopes ? { scopes: a.scopes } : {},
1749
1959
  ...a.cbids ? { cbids: a.cbids } : {}
1750
1960
  })
1751
1961
  );
1752
- tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: import_zod4.z.string(), prefix: import_zod4.z.string() }, async (a) => {
1962
+ tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: import_zod5.z.string(), prefix: import_zod5.z.string() }, async (a) => {
1753
1963
  await client.reseller.revokeKey(a.id, a.prefix);
1754
1964
  return { revoked: a.prefix };
1755
1965
  });
1756
1966
  tool(
1757
1967
  "erase_subject_data",
1758
1968
  "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.",
1759
- { cbid: import_zod4.z.string(), stamp: import_zod4.z.string() },
1969
+ { cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1760
1970
  (a) => client.consent.eraseSubject(a.cbid, a.stamp)
1761
1971
  );
1762
1972
  tool(
1763
1973
  "export_subject_data",
1764
1974
  "Export a data subject's consent records (GDPR access/portability).",
1765
- { cbid: import_zod4.z.string(), stamp: import_zod4.z.string() },
1975
+ { cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1766
1976
  (a) => client.consent.exportSubject(a.cbid, a.stamp)
1767
1977
  );
1768
1978
  tool("list_banners", "List reusable banner designs in your org.", {}, () => client.banners.list());
1769
1979
  tool(
1770
1980
  "create_banner",
1771
1981
  "Create a reusable banner design.",
1772
- { name: import_zod4.z.string(), json: import_zod4.z.record(import_zod4.z.unknown()).describe("A v2 BannerConfig.") },
1982
+ { name: import_zod5.z.string(), json: import_zod5.z.record(import_zod5.z.unknown()).describe("A v2 BannerConfig.") },
1773
1983
  (a) => client.banners.create({ name: a.name, json: a.json })
1774
1984
  );
1775
- tool("get_banner", "Get a banner design by id.", { id: import_zod4.z.string() }, (a) => client.banners.get(a.id));
1985
+ tool("get_banner", "Get a banner design by id.", { id: import_zod5.z.string() }, (a) => client.banners.get(a.id));
1776
1986
  tool(
1777
1987
  "update_banner",
1778
1988
  "Update a banner design (name and/or config).",
1779
- { id: import_zod4.z.string(), name: import_zod4.z.string().optional(), json: import_zod4.z.record(import_zod4.z.unknown()).optional() },
1989
+ { id: import_zod5.z.string(), name: import_zod5.z.string().optional(), json: import_zod5.z.record(import_zod5.z.unknown()).optional() },
1780
1990
  (a) => client.banners.update(a.id, {
1781
1991
  ...a.name !== void 0 ? { name: a.name } : {},
1782
1992
  ...a.json !== void 0 ? { json: a.json } : {}
1783
1993
  })
1784
1994
  );
1785
- tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: import_zod4.z.string() }, async (a) => {
1995
+ tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: import_zod5.z.string() }, async (a) => {
1786
1996
  await client.banners.delete(a.id);
1787
1997
  return { ok: true };
1788
1998
  });
1789
1999
  tool(
1790
2000
  "get_banner_assignments",
1791
2001
  "The sites (cbids) a banner design is currently assigned to. Read-only.",
1792
- { id: import_zod4.z.string() },
2002
+ { id: import_zod5.z.string() },
1793
2003
  (a) => client.banners.assignments(a.id)
1794
2004
  );
1795
2005
  tool(
1796
2006
  "assign_banner",
1797
2007
  "Set which sites (cbids) use a banner design.",
1798
- { id: import_zod4.z.string(), cbids: import_zod4.z.array(import_zod4.z.string()) },
2008
+ { id: import_zod5.z.string(), cbids: import_zod5.z.array(import_zod5.z.string()) },
1799
2009
  (a) => client.banners.setAssignments(a.id, a.cbids)
1800
2010
  );
1801
2011
  tool(
1802
2012
  "publish_banner",
1803
2013
  "Publish a design live to all its assigned sites.",
1804
- { id: import_zod4.z.string() },
2014
+ { id: import_zod5.z.string() },
1805
2015
  (a) => client.banners.publish(a.id)
1806
2016
  );
1807
2017
  }