@cookiemunch/mcp 0.5.0 → 0.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/bin.cjs CHANGED
@@ -9,7 +9,7 @@ var import_mcp = require("@modelcontextprotocol/sdk/server/mcp.js");
9
9
  var import_sdk = require("@cookiemunch/sdk");
10
10
 
11
11
  // src/tools.ts
12
- var import_zod5 = require("zod");
12
+ var import_zod6 = require("zod");
13
13
 
14
14
  // src/tools-config.ts
15
15
  var import_zod = require("zod");
@@ -540,6 +540,12 @@ function registerPlatformTools(tool, client) {
540
540
  {},
541
541
  () => client.fulfillment.executors()
542
542
  );
543
+ tool(
544
+ "get_dsar_executor",
545
+ "One connected system with its full profile (never its credentials). Read it before changing the profile: update_dsar_executor replaces the whole profile, so send back the complete one with your change made.",
546
+ { id: import_zod2.z.string().describe("The connection id.") },
547
+ (a) => client.fulfillment.executor(a.id)
548
+ );
543
549
  tool(
544
550
  "connect_dsar_executor",
545
551
  "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.",
@@ -547,12 +553,15 @@ function registerPlatformTools(tool, client) {
547
553
  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."),
548
554
  presetVersion: import_zod2.z.number().int().optional().describe("With preset: the version to build. Default the latest."),
549
555
  orgId: import_zod2.z.string().optional().describe("A preset param, when the preset's params list it."),
550
- 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."),
556
+ atlasIdAppId: import_zod2.z.string().optional().describe("A preset param, when the preset's params list it: the identity platform's app id, kept for revokeAtlasIdGrant."),
557
+ revokeAtlasIdGrant: import_zod2.z.boolean().optional().describe("A preset param, when the preset's params list it: default false. True adds an optional step that revokes the person's app grant on erasure; a credential without the scope reports skipped: insufficient_scope."),
558
+ label: import_zod2.z.string().optional().describe("Your name for the credential, shown beside keyPrefix."),
551
559
  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."),
552
560
  baseUrl: import_zod2.z.string().optional().describe("The system's public https origin. Required unless the preset sets it."),
553
561
  secretKey: import_zod2.z.string().describe("Its API key, with whatever scope that system needs to export and erase a user."),
554
562
  webhookSecret: import_zod2.z.string().optional().describe("Signing secret of its webhook endpoint. Optional: polling closes tasks without it."),
555
563
  auto: import_zod2.z.boolean().optional().describe("Open a sub-task automatically when a request reaches fulfilment. Default true."),
564
+ orchestrator: import_zod2.z.union([import_zod2.z.literal(1), import_zod2.z.literal(2)]).optional().describe("How it takes part in cases. Default 2 (v2 headers on every call); 1 is the v1 adapter. The answer carries a completionSecret, shown once, that signs its completions."),
556
565
  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."),
557
566
  dryRun: import_zod2.z.boolean().optional().describe("Validate everything and answer the connection that would be created, storing nothing.")
558
567
  },
@@ -561,6 +570,12 @@ function registerPlatformTools(tool, client) {
561
570
  return dryRun === true ? client.fulfillment.dryRunConnectExecutor(input) : client.fulfillment.connectExecutor(input);
562
571
  }
563
572
  );
573
+ tool(
574
+ "get_category_registry",
575
+ "The reserved consent categories any site can switch on with categories.suite (support_chat, referrals): each one\u2019s stance, the standard category to fall back on, the regulatory basis, its wording in every banner language, and known vendors. Public, read-only.",
576
+ {},
577
+ () => client.consent.categoryRegistry()
578
+ );
564
579
  tool(
565
580
  "list_dsar_executor_presets",
566
581
  "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.",
@@ -569,13 +584,15 @@ function registerPlatformTools(tool, client) {
569
584
  );
570
585
  tool(
571
586
  "upgrade_dsar_executor_preset",
572
- "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.",
587
+ "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. Your hand edits (profileOverrides) are kept and listed in the diff as kept or conflict; acceptPreset takes the preset's value for a path. A pinned connection (presetPinned) is refused. Use dryRun first: the answer shows exactly what would change and nothing is stored.",
573
588
  {
574
589
  id: import_zod2.z.string().describe("The connection id."),
575
590
  preset: import_zod2.z.string().optional().describe("Only to adopt a preset on a connection that has none."),
576
591
  presetVersion: import_zod2.z.number().int().optional(),
577
592
  orgId: import_zod2.z.string().optional(),
578
593
  atlasIdAppId: import_zod2.z.string().optional(),
594
+ revokeAtlasIdGrant: import_zod2.z.boolean().optional(),
595
+ acceptPreset: import_zod2.z.array(import_zod2.z.string()).optional().describe(`Overridden paths (profileOverrides) that take the preset's value again, e.g. ["profile.grantRevoke"]. Every other override is kept.`),
579
596
  dryRun: import_zod2.z.boolean().optional().describe("Answer the diff and change nothing.")
580
597
  },
581
598
  (a) => {
@@ -599,6 +616,18 @@ function registerPlatformTools(tool, client) {
599
616
  { id: import_zod2.z.string().describe("The connection id.") },
600
617
  (a) => client.fulfillment.executorWebhookDeliveries(a.id)
601
618
  );
619
+ tool(
620
+ "recheck_dsar_executor",
621
+ "Re-check a connected system now: a canary test (no real person) whose answer is recorded as the connection's health, so a stale failure clears at once. For after deploying that system's rights API.",
622
+ { id: import_zod2.z.string().describe("The connection id.") },
623
+ (a) => client.fulfillment.recheckExecutor(a.id)
624
+ );
625
+ tool(
626
+ "list_dsar_executor_health_history",
627
+ "A connected system's last health checks, newest first (each with ok, verdict and lastCheckedAt). Read-only.",
628
+ { id: import_zod2.z.string().describe("The connection id."), limit: import_zod2.z.number().int().min(1).max(50).optional().describe("Default 50.") },
629
+ (a) => client.fulfillment.executorHealthHistory(a.id, typeof a.limit === "number" ? { limit: a.limit } : {})
630
+ );
602
631
  tool(
603
632
  "disconnect_dsar_executor",
604
633
  "Disconnect a system. Its open sub-tasks stop being driven, and the stored credentials are deleted.",
@@ -631,6 +660,18 @@ function registerPlatformTools(tool, client) {
631
660
  ...typeof a.open === "boolean" ? { open: a.open } : {}
632
661
  })
633
662
  );
663
+ tool(
664
+ "run_executor_conformance",
665
+ "Run the cm-standard-v2 conformance kit against a connected system: every rule of the open executor contract (lookup by email and identity, no email match across identities, executeAfter honoured, idempotency, cancel keeps data, 404s, X-Version), on this org's canary subject only \u2014 no real person. Each rule passes, fails or is skipped by name. Only for a cm-standard-v2 connection.",
666
+ { id: import_zod2.z.string().describe("The connection id.") },
667
+ (a) => client.fulfillment.executorConformance(a.id)
668
+ );
669
+ tool(
670
+ "roll_executor_completion_secret",
671
+ "Mint a new completion secret for a connected system's signed completions. The new secret is in the answer, once \u2014 hand it to that system. The old one keeps verifying for 24 hours.",
672
+ { id: import_zod2.z.string().describe("The connection id.") },
673
+ (a) => client.fulfillment.rollExecutorCompletionSecret(a.id)
674
+ );
634
675
  tool(
635
676
  "get_dsar_task_export",
636
677
  "The export bundle a connected system produced for one sub-task, fetched from that system on demand. The platform keeps no copy.",
@@ -737,13 +778,44 @@ function registerIntegrationTools(tool, client) {
737
778
  { cbid: import_zod3.z.string().optional().describe("Site identifier; optional when the org has one site.") },
738
779
  (a) => client.integrationHealth(a.cbid)
739
780
  );
781
+ tool(
782
+ "list_health_waivers",
783
+ "The site\u2019s integration-health waivers: checks the organisation chose not to meet, each with its reason, who set it and until when. Read-only.",
784
+ { cbid: import_zod3.z.string().optional().describe("Site identifier; optional when the org has one site.") },
785
+ (a) => client.healthWaivers.list(a.cbid)
786
+ );
787
+ const waiverSchema = import_zod3.z.object({
788
+ cbid: import_zod3.z.string().optional().describe("Site identifier; optional when the org has one site."),
789
+ check: import_zod3.z.string().describe("A row\u2019s check or kind, e.g. atlas.cookie_consent."),
790
+ subject: import_zod3.z.string().optional().describe("A row\u2019s subject; omitted: every subject of the check."),
791
+ reason: import_zod3.z.string().describe("Why this is deliberate (shown on the row and in the audit log)."),
792
+ until: import_zod3.z.union([import_zod3.z.string(), import_zod3.z.number()]).nullable().optional().describe("When the waiver ends (ISO date or epoch ms, within a year); omitted: never.")
793
+ });
794
+ tool(
795
+ "set_health_waiver",
796
+ "Waive an integration-health check the organisation deliberately does not meet: the row then reports ok:null with waived {reason, by, until} instead of failing. Audited. Use only for real, deliberate choices; fix the rest.",
797
+ waiverSchema.shape,
798
+ (a) => client.healthWaivers.set(waiverSchema.parse(a))
799
+ );
800
+ tool(
801
+ "remove_health_waiver",
802
+ "Remove an integration-health waiver, so the check reports its real state again. Audited.",
803
+ { check: import_zod3.z.string(), cbid: import_zod3.z.string().optional(), subject: import_zod3.z.string().optional().describe("Default: every subject (*).") },
804
+ (a) => client.healthWaivers.remove(a.check, { ...a.cbid ? { cbid: a.cbid } : {}, ...a.subject ? { subject: a.subject } : {} })
805
+ );
806
+ tool(
807
+ "get_embed_manifest",
808
+ "A site\u2019s embed manifest (the tenant variant of /.well-known/forgedeck-embed.json): every origin the Cookie Munch embed touches on that site, by CSP directive (non-origin sources such as 'unsafe-inline' under requires), every cookie and browser-storage key it writes with category and lifetime, the checkers\u2019 User-Agent, and the hosts of the site\u2019s rights page and preference centre. Use it to build a Content-Security-Policy. Read-only.",
809
+ { cbid: import_zod3.z.string() },
810
+ (a) => client.embedManifest(a.cbid)
811
+ );
740
812
  const provisionSchema = import_zod3.z.object({
741
813
  product: import_zod3.z.string().describe("A slug naming the product."),
742
814
  domain: import_zod3.z.string().describe("The product\u2019s domain (bare hostname)."),
743
815
  name: import_zod3.z.string().optional(),
744
816
  aliases: import_zod3.z.array(import_zod3.z.string()).optional(),
745
817
  cbid: import_zod3.z.string().optional().describe("Update this site instead of matching by domain."),
746
- 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."),
818
+ atlas: import_zod3.z.object({ secretKey: import_zod3.z.string(), cookieConsent: import_zod3.z.boolean().optional(), dsrWebhook: import_zod3.z.boolean().optional(), rightsIdentity: import_zod3.z.boolean().optional().describe("Default true: make Atlas the site's rights sign-in, so signed-in requests are verified. A provider already in use is kept."), 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."),
747
819
  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."),
748
820
  rightsApi: import_zod3.z.object({ baseUrl: import_zod3.z.string(), secretKey: import_zod3.z.string(), profilePreset: import_zod3.z.string().optional() }).optional(),
749
821
  dryRun: import_zod3.z.boolean().optional().describe("Report what each step would do; write nothing on any platform. Run this first.")
@@ -759,13 +831,13 @@ function registerIntegrationTools(tool, client) {
759
831
  );
760
832
  tool(
761
833
  "list_site_partners",
762
- "Which partner platforms (Forumulate, Atlas) receive this site\u2019s consent events, each with its status, and which partners are on offer. Read-only.",
834
+ "Which partner platforms receive this site\u2019s consent events, each with its status, and which partners are on offer. Read-only.",
763
835
  { cbid: import_zod3.z.string() },
764
836
  (a) => client.sites.listPartners(a.cbid)
765
837
  );
766
838
  const linkSchema = import_zod3.z.object({
767
839
  cbid: import_zod3.z.string(),
768
- partner: import_zod3.z.enum(["forumulate", "atlas"]),
840
+ partner: import_zod3.z.string().describe("A partner this deployment knows: forumulate, atlas, chatly, referalli, or any other registered on it (list_site_partners shows them)."),
769
841
  externalId: import_zod3.z.string().describe("The partner\u2019s id for the receiving account, e.g. a Forumulate organisation id."),
770
842
  label: import_zod3.z.string().optional().describe('Shown with the partner name, e.g. "docs".'),
771
843
  events: import_zod3.z.array(import_zod3.z.enum(["consent.recorded", "consent.withdrawn"])).optional(),
@@ -788,31 +860,144 @@ function registerIntegrationTools(tool, client) {
788
860
  );
789
861
  }
790
862
 
791
- // src/tools-rights-page.ts
863
+ // src/tools-keys-tags.ts
792
864
  var import_zod4 = require("zod");
865
+ var TAGGED = ["org", "site", "webhook", "executor", "dsar", "partner_link"];
866
+ function registerKeyAndTagTools(tool, client) {
867
+ tool(
868
+ "get_own_key",
869
+ "The API key this server runs with: its prefix, name, scopes, properties, expiry, owner and last use. Works with any key, however narrow. Use it to check how long the key has left. Read-only.",
870
+ {},
871
+ () => client.keys.self()
872
+ );
873
+ tool(
874
+ "list_api_versions",
875
+ "The dated API versions, what each one changed, and the version the key this server runs with is pinned to (`yours`). Read-only.",
876
+ {},
877
+ () => client.versions()
878
+ );
879
+ tool(
880
+ "set_own_api_version",
881
+ "Re-pin the key this server runs with to another dated API version (from list_api_versions). It changes how the API behaves for this key (for example strict request bodies from 2026-10-24), never what the key may do.",
882
+ { apiVersion: import_zod4.z.string().describe("A version from list_api_versions, e.g. 2026-10-24.") },
883
+ (a) => client.keys.updateSelf({ apiVersion: a.apiVersion })
884
+ );
885
+ tool(
886
+ "get_sandbox",
887
+ "The organisation\u2019s sandbox (a separate test organisation with the same people and plan features, never billed), or null. Read-only.",
888
+ {},
889
+ () => client.sandbox.get()
890
+ );
891
+ tool(
892
+ "create_sandbox",
893
+ "Make a sandbox of the organisation, or return the one it has, with a new test-format key for it (shown once). Everything in a sandbox is test data: its keys are cookiemunch_test_ keys and every rights request filed there is a test. Needs a full-access key or orgs:create.",
894
+ { keyName: import_zod4.z.string().min(1).max(100).optional().describe('A name for the new key. Default "sandbox".') },
895
+ (a) => client.sandbox.create(a.keyName !== void 0 ? { keyName: a.keyName } : {})
896
+ );
897
+ tool(
898
+ "list_api_keys_standard",
899
+ "The organisation\u2019s keys in the suite-standard shape (id, owner, kind, env, scopes, resources, created_at, expires_at, last_used_at, last_used_ip, status). Needs a full-access key. Read-only.",
900
+ {},
901
+ () => client.keys.listStandard()
902
+ );
903
+ const vendSchema = import_zod4.z.object({
904
+ scopes: import_zod4.z.array(import_zod4.z.string()).min(1).describe("A subset of this key\u2019s own scopes."),
905
+ ttlSeconds: import_zod4.z.number().int().min(60).max(43200).describe("How long the key works, at most 12 hours."),
906
+ cbids: import_zod4.z.array(import_zod4.z.string()).min(1).optional().describe("Lock it to these sites (within this key\u2019s own lock)."),
907
+ name: import_zod4.z.string().max(100).optional()
908
+ });
909
+ tool(
910
+ "vend_api_key",
911
+ "Mint a short-lived key (at most 12 hours) for a sub-task, with a subset of this key\u2019s own scopes and properties; never a key that can vend. The secret is returned once. Needs keys:write or a full-access key.",
912
+ vendSchema.shape,
913
+ (a) => client.keys.vend(vendSchema.parse(a))
914
+ );
915
+ tool(
916
+ "revoke_leaked_key",
917
+ "Revoke an API key whose secret has been published (pasted in a chat, a gist, a log). Pass the whole secret. It only ever revokes, and always answers { received } whether or not the key was live. The owner is mailed.",
918
+ { key: import_zod4.z.string().describe("The leaked secret, whole."), source: import_zod4.z.string().optional().describe("Where it was found (a URL).") },
919
+ (a) => client.keys.revokeLeaked({ key: a.key, ...a.source ? { source: a.source } : {} })
920
+ );
921
+ tool(
922
+ "get_resource_tags",
923
+ "A resource\u2019s tags (metadata), its externalRef and whether it is a sandbox. Read-only.",
924
+ { type: import_zod4.z.enum(TAGGED), id: import_zod4.z.string() },
925
+ (a) => client.metadata.get(a.type, a.id)
926
+ );
927
+ const tagsSchema = import_zod4.z.object({
928
+ type: import_zod4.z.enum(TAGGED),
929
+ id: import_zod4.z.string(),
930
+ metadata: import_zod4.z.record(import_zod4.z.union([import_zod4.z.string(), import_zod4.z.number(), import_zod4.z.boolean(), import_zod4.z.null()])).describe("Keys to set; null removes one. forgedeck_sandbox cannot be set here."),
931
+ dryRun: import_zod4.z.boolean().optional().describe("Answer with the diff, storing nothing. Do this first.")
932
+ });
933
+ tool(
934
+ "update_resource_tags",
935
+ "Change a resource\u2019s tags (merge). For adopting resources created before tags existed, e.g. forgedeck_product and forgedeck_env. A resource can never be made a sandbox after it was created.",
936
+ tagsSchema.shape,
937
+ (a) => {
938
+ const { type, id, metadata, dryRun } = tagsSchema.parse(a);
939
+ return client.metadata.update(type, id, metadata, { dryRun });
940
+ }
941
+ );
942
+ tool(
943
+ "list_partner_links",
944
+ "Every partner link of the organisation (site and org links), with scopes, expiry, last use and calls in the last 30 days. Read-only.",
945
+ { metadata: import_zod4.z.record(import_zod4.z.string()).optional().describe("Keep only links with these tags.") },
946
+ (a) => client.partnerLinks.list(a.metadata ? { metadata: a.metadata } : void 0)
947
+ );
948
+ const linkSchema = import_zod4.z.object({
949
+ partner: import_zod4.z.string().describe("A partner this deployment knows (built in or registered)."),
950
+ resource: import_zod4.z.string().describe("site:<cbid> or org:<this org id>."),
951
+ scopes: import_zod4.z.array(import_zod4.z.enum(["consent:read", "receipt:read", "dsar:read", "dsar:write", "dsar:rights-links", "sites:read"])).min(1),
952
+ expires_at: import_zod4.z.string().optional().describe("ISO 8601, in the future."),
953
+ externalId: import_zod4.z.string().optional(),
954
+ label: import_zod4.z.string().max(60).optional()
955
+ });
956
+ tool(
957
+ "create_partner_link",
958
+ "Let a partner platform act on a site or on the organisation within these scopes (it calls the API with its own token and the link id), and, with consent:read on a site, receive that site\u2019s consent events. No secret is created. Never grants more than this key holds.",
959
+ linkSchema.shape,
960
+ (a) => client.partnerLinks.create(linkSchema.parse(a))
961
+ );
962
+ tool(
963
+ "revoke_partner_link",
964
+ "Revoke a partner link: the partner\u2019s calls under it and its deliveries stop at once.",
965
+ { id: import_zod4.z.string() },
966
+ (a) => client.partnerLinks.revoke(a.id)
967
+ );
968
+ tool(
969
+ "get_provision_env",
970
+ "What `forgedeck env` writes for a product provisioned with this forgedeck ref: variable names, non-secret values (cbid, script URL, API base) and references for secrets, never a secret. Read-only.",
971
+ { ref: import_zod4.z.string() },
972
+ (a) => client.provisionEnv(a.ref)
973
+ );
974
+ }
975
+
976
+ // src/tools-rights-page.ts
977
+ var import_zod5 = require("zod");
793
978
  function registerRightsTools(tool, client) {
794
- const cbid = { cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org.") };
979
+ const cbid = { cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org.") };
795
980
  const base = {
796
- 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.")
981
+ baseUpdatedAt: import_zod5.z.union([import_zod5.z.number().int(), import_zod5.z.string(), import_zod5.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.")
797
982
  };
798
983
  const baseOpt = (a) => a.baseUpdatedAt !== void 0 ? { baseUpdatedAt: a.baseUpdatedAt } : {};
799
984
  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));
800
985
  tool(
801
986
  "update_rights_page",
802
987
  "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.",
803
- { ...cbid, page: import_zod4.z.record(import_zod4.z.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
988
+ { ...cbid, page: import_zod5.z.record(import_zod5.z.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
804
989
  (a) => client.rightsPage.put(a.cbid, a.page, baseOpt(a))
805
990
  );
806
991
  tool(
807
992
  "patch_rights_page",
808
993
  "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).",
809
- { ...cbid, patch: import_zod4.z.record(import_zod4.z.unknown()), ...base },
994
+ { ...cbid, patch: import_zod5.z.record(import_zod5.z.unknown()), ...base },
810
995
  (a) => client.rightsPage.patch(a.cbid, a.patch, baseOpt(a))
811
996
  );
812
997
  tool(
813
998
  "preview_rights_page",
814
999
  'Validate a rights-page write WITHOUT saving: returns the document as it would be stored and any publish warnings. mode "patch" (default) or "put".',
815
- { ...cbid, page: import_zod4.z.record(import_zod4.z.unknown()), mode: import_zod4.z.enum(["patch", "put"]).optional() },
1000
+ { ...cbid, page: import_zod5.z.record(import_zod5.z.unknown()), mode: import_zod5.z.enum(["patch", "put"]).optional() },
816
1001
  (a) => client.rightsPage.dryRun(a.cbid, a.page, { mode: a.mode ?? "patch" })
817
1002
  );
818
1003
  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));
@@ -826,14 +1011,14 @@ function registerRightsTools(tool, client) {
826
1011
  tool(
827
1012
  "rollback_rights_page",
828
1013
  "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.",
829
- { ...cbid, version: import_zod4.z.number().int().min(1), ...base },
1014
+ { ...cbid, version: import_zod5.z.number().int().min(1), ...base },
830
1015
  (a) => client.rightsPage.rollback(a.cbid, a.version, baseOpt(a))
831
1016
  );
832
1017
  }
833
1018
  function registerRightsPageTools(tool, client) {
834
- const site = import_zod4.z.object({ cbid: import_zod4.z.string().describe("Site identifier (cbid). Must belong to your org.") });
1019
+ const site = import_zod5.z.object({ cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org.") });
835
1020
  const host = site.extend({
836
- hostname: import_zod4.z.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
1021
+ hostname: import_zod5.z.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
837
1022
  });
838
1023
  tool(
839
1024
  "list_rights_page_domains",
@@ -973,10 +1158,10 @@ function registerTools(server, client) {
973
1158
  }
974
1159
  });
975
1160
  };
976
- const cbid = { cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org.") };
1161
+ const cbid = { cbid: import_zod6.z.string().describe("Site identifier (cbid). Must belong to your org.") };
977
1162
  const range = {
978
- from: import_zod5.z.number().optional().describe("Epoch-ms lower bound."),
979
- to: import_zod5.z.number().optional().describe("Epoch-ms upper bound.")
1163
+ from: import_zod6.z.number().optional().describe("Epoch-ms lower bound."),
1164
+ to: import_zod6.z.number().optional().describe("Epoch-ms upper bound.")
980
1165
  };
981
1166
  tool(
982
1167
  "whoami",
@@ -994,19 +1179,19 @@ function registerTools(server, client) {
994
1179
  tool(
995
1180
  "get_site",
996
1181
  "One site: its domain, cbid and verification status. Read-only.",
997
- { cbid: import_zod5.z.string() },
1182
+ { cbid: import_zod6.z.string() },
998
1183
  (a) => client.sites.get(a.cbid)
999
1184
  );
1000
1185
  tool(
1001
1186
  "get_site_banner",
1002
1187
  "Which banner design a site uses, or bannerId null when none is assigned. Read-only.",
1003
- { cbid: import_zod5.z.string() },
1188
+ { cbid: import_zod6.z.string() },
1004
1189
  (a) => client.sites.banner(a.cbid)
1005
1190
  );
1006
1191
  tool(
1007
1192
  "get_privacy_policy",
1008
1193
  "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.",
1009
- { 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() },
1194
+ { cbid: import_zod6.z.string(), contactEmail: import_zod6.z.string().optional(), effectiveDate: import_zod6.z.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: import_zod6.z.array(import_zod6.z.string()).optional() },
1010
1195
  (a) => client.sites.policy(a.cbid, {
1011
1196
  ...a.contactEmail ? { contactEmail: a.contactEmail } : {},
1012
1197
  ...a.effectiveDate ? { effectiveDate: a.effectiveDate } : {},
@@ -1016,7 +1201,7 @@ function registerTools(server, client) {
1016
1201
  tool(
1017
1202
  "set_ad_personalization",
1018
1203
  "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.",
1019
- { cbid: import_zod5.z.string(), enabled: import_zod5.z.boolean(), default: import_zod5.z.boolean().optional(), label: import_zod5.z.string().optional() },
1204
+ { cbid: import_zod6.z.string(), enabled: import_zod6.z.boolean(), default: import_zod6.z.boolean().optional(), label: import_zod6.z.string().optional() },
1020
1205
  (a) => client.sites.setAdPersonalization(a.cbid, {
1021
1206
  enabled: a.enabled,
1022
1207
  ...a.default !== void 0 ? { default: a.default } : {},
@@ -1027,11 +1212,11 @@ function registerTools(server, client) {
1027
1212
  "analyze_session",
1028
1213
  "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.",
1029
1214
  {
1030
- cbid: import_zod5.z.string(),
1031
- har: import_zod5.z.unknown().optional().describe("A HAR export of the session."),
1032
- requests: import_zod5.z.array(import_zod5.z.unknown()).optional().describe("Or the requests directly."),
1033
- consent: import_zod5.z.record(import_zod5.z.string(), import_zod5.z.boolean()).optional(),
1034
- gpc: import_zod5.z.boolean().optional()
1215
+ cbid: import_zod6.z.string(),
1216
+ har: import_zod6.z.unknown().optional().describe("A HAR export of the session."),
1217
+ requests: import_zod6.z.array(import_zod6.z.unknown()).optional().describe("Or the requests directly."),
1218
+ consent: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.boolean()).optional(),
1219
+ gpc: import_zod6.z.boolean().optional()
1035
1220
  },
1036
1221
  (a) => client.sites.analyzeSession(a.cbid, {
1037
1222
  ...a.har !== void 0 ? { har: a.har } : {},
@@ -1043,14 +1228,14 @@ function registerTools(server, client) {
1043
1228
  tool(
1044
1229
  "create_site",
1045
1230
  "Create a new site. The cbid is auto-generated if you omit it.",
1046
- { domain: import_zod5.z.string().describe("The site domain, e.g. example.com."), cbid: import_zod5.z.string().optional().describe("Optional explicit cbid.") },
1231
+ { domain: import_zod6.z.string().describe("The site domain, e.g. example.com."), cbid: import_zod6.z.string().optional().describe("Optional explicit cbid.") },
1047
1232
  (a) => client.sites.create({ domain: a.domain, ...typeof a.cbid === "string" ? { cbid: a.cbid } : {} })
1048
1233
  );
1049
1234
  tool(
1050
1235
  "create_sites_bulk",
1051
1236
  "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.",
1052
1237
  {
1053
- 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)
1238
+ sites: import_zod6.z.array(import_zod6.z.object({ domain: import_zod6.z.string(), cbid: import_zod6.z.string().optional(), platform: import_zod6.z.string().optional() })).min(1).max(100)
1054
1239
  },
1055
1240
  (a) => client.sites.createBulk(a.sites)
1056
1241
  );
@@ -1060,15 +1245,15 @@ function registerTools(server, client) {
1060
1245
  "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.",
1061
1246
  {
1062
1247
  ...cbid,
1063
- 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."),
1064
- 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.")
1248
+ config: import_zod6.z.record(import_zod6.z.unknown()).describe("The full SiteConfig to write, not a patch. Without keepUnspecified, omitted top-level fields are NOT preserved from the current config."),
1249
+ keepUnspecified: import_zod6.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.")
1065
1250
  },
1066
1251
  (a) => a.keepUnspecified === true ? client.sites.putConfig(a.cbid, a.config, { keep: "unspecified" }) : client.sites.putConfig(a.cbid, a.config)
1067
1252
  );
1068
1253
  tool(
1069
1254
  "patch_site_config",
1070
1255
  `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.`,
1071
- { ...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.') },
1256
+ { ...cbid, config: import_zod6.z.record(import_zod6.z.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved; null removes a field.') },
1072
1257
  (a) => client.sites.patchConfig(a.cbid, a.config)
1073
1258
  );
1074
1259
  tool(
@@ -1076,9 +1261,9 @@ function registerTools(server, client) {
1076
1261
  '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.',
1077
1262
  {
1078
1263
  ...cbid,
1079
- config: import_zod5.z.record(import_zod5.z.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
1080
- mode: import_zod5.z.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
1081
- keepUnspecified: import_zod5.z.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
1264
+ config: import_zod6.z.record(import_zod6.z.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
1265
+ mode: import_zod6.z.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
1266
+ keepUnspecified: import_zod6.z.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
1082
1267
  },
1083
1268
  (a) => client.sites.dryRunConfig(a.cbid, a.config, {
1084
1269
  mode: a.mode ?? "patch",
@@ -1090,8 +1275,8 @@ function registerTools(server, client) {
1090
1275
  '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.',
1091
1276
  {
1092
1277
  ...cbid,
1093
- config: import_zod5.z.record(import_zod5.z.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
1094
- 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.")
1278
+ config: import_zod6.z.record(import_zod6.z.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
1279
+ replace: import_zod6.z.boolean().optional().describe("Check what update_site_config (a full replace) would store, instead of what patch_site_config (a merge) would.")
1095
1280
  },
1096
1281
  async (a) => {
1097
1282
  const r = await client.sites.lintConfig(a.cbid, a.config, a.replace === true ? { replace: true } : {});
@@ -1112,10 +1297,16 @@ ${JSON.stringify(r, null, 2)}` : r;
1112
1297
  { ...cbid, ...range },
1113
1298
  (a) => client.consent.stats(a.cbid, { from: a.from, to: a.to })
1114
1299
  );
1300
+ tool(
1301
+ "get_consent_insights",
1302
+ "Opt-in rates for a site: totals with the decision rate (decisions per banner impression), opt-in by region, and by A/B variant (all-time counters). Opt-in by language and time-to-decision are not recorded; those fields are null and notRecorded says why. Read-only.",
1303
+ { ...cbid, ...range },
1304
+ (a) => client.consent.insights(a.cbid, { from: a.from, to: a.to })
1305
+ );
1115
1306
  tool(
1116
1307
  "get_consent_log",
1117
1308
  "Get recent anonymised consent records for a site.",
1118
- { ...cbid, ...range, limit: import_zod5.z.number().optional().describe("Max records to return (default 200).") },
1309
+ { ...cbid, ...range, limit: import_zod6.z.number().optional().describe("Max records to return (default 200).") },
1119
1310
  (a) => client.consent.log(a.cbid, {
1120
1311
  from: a.from,
1121
1312
  to: a.to,
@@ -1125,54 +1316,54 @@ ${JSON.stringify(r, null, 2)}` : r;
1125
1316
  tool(
1126
1317
  "get_subject_consent",
1127
1318
  "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.",
1128
- { subjectId: import_zod5.z.string() },
1319
+ { subjectId: import_zod6.z.string() },
1129
1320
  (a) => client.subjects.consent(a.subjectId)
1130
1321
  );
1131
1322
  tool("list_dsar", "List all Data Subject Access Requests for your organization.", {}, () => client.dsar.list());
1132
1323
  tool(
1133
1324
  "update_dsar_executor",
1134
- "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.",
1325
+ "Change a connected system in place \u2014 its profile, address, credential, label (null removes it), auto flag or presetPinned (true stops preset upgrades). Only what you pass changes; the stored credential is kept unless you give a new one. A profile edit on a preset-built connection is recorded in profileOverrides, so an upgrade keeps it. With dryRun, answers the connection as it would be and a diff, and changes nothing.",
1135
1326
  {
1136
- id: import_zod5.z.string(),
1137
- patch: import_zod5.z.record(import_zod5.z.unknown()),
1138
- dryRun: import_zod5.z.boolean().optional().describe("Validate and diff without saving.")
1327
+ id: import_zod6.z.string(),
1328
+ patch: import_zod6.z.record(import_zod6.z.unknown()),
1329
+ dryRun: import_zod6.z.boolean().optional().describe("Validate and diff without saving.")
1139
1330
  },
1140
1331
  (a) => a.dryRun === true ? client.fulfillment.dryRunUpdateExecutor(a.id, a.patch) : client.fulfillment.updateExecutor(a.id, a.patch)
1141
1332
  );
1142
1333
  tool(
1143
1334
  "get_dsar",
1144
1335
  "One rights request by id, including its status and the deadline it must be answered by.",
1145
- { id: import_zod5.z.string() },
1336
+ { id: import_zod6.z.string() },
1146
1337
  (a) => client.dsar.get(a.id)
1147
1338
  );
1148
1339
  tool(
1149
1340
  "erase_dsar_subject",
1150
1341
  "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.",
1151
- { id: import_zod5.z.string(), cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1342
+ { id: import_zod6.z.string(), cbid: import_zod6.z.string(), stamp: import_zod6.z.string() },
1152
1343
  (a) => client.dsar.erase(a.id, a.cbid, a.stamp)
1153
1344
  );
1154
1345
  tool(
1155
1346
  "export_dsar_subject",
1156
1347
  "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.",
1157
- { id: import_zod5.z.string(), cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
1348
+ { id: import_zod6.z.string(), cbid: import_zod6.z.string(), stamp: import_zod6.z.string() },
1158
1349
  (a) => client.dsar.export(a.id, a.cbid, a.stamp)
1159
1350
  );
1160
1351
  tool(
1161
1352
  "get_dsar_response_notice",
1162
1353
  "The subject-facing response notice for a request, as plain text \u2014 what to send the person. Read-only; nothing is sent.",
1163
- { id: import_zod5.z.string() },
1354
+ { id: import_zod6.z.string() },
1164
1355
  (a) => client.dsar.response(a.id)
1165
1356
  );
1166
1357
  tool(
1167
1358
  "create_dsar",
1168
1359
  "Open a new Data Subject Access Request.",
1169
1360
  {
1170
- type: import_zod5.z.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
1171
- subjectEmail: import_zod5.z.string().describe("The data subject\u2019s email."),
1172
- regulation: import_zod5.z.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
1173
- note: import_zod5.z.string().optional().describe("Optional INTERNAL note; never shown to the data subject."),
1174
- messageToSubject: import_zod5.z.string().max(2e3).optional().describe("The line the data subject reads in the response notice. Never an API key."),
1175
- 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.")
1361
+ type: import_zod6.z.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
1362
+ subjectEmail: import_zod6.z.string().describe("The data subject\u2019s email."),
1363
+ regulation: import_zod6.z.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
1364
+ note: import_zod6.z.string().optional().describe("Optional INTERNAL note; never shown to the data subject."),
1365
+ messageToSubject: import_zod6.z.string().max(2e3).optional().describe("The line the data subject reads in the response notice. Never an API key."),
1366
+ test: import_zod6.z.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
1176
1367
  },
1177
1368
  (a) => client.dsar.create({
1178
1369
  type: a.type,
@@ -1187,11 +1378,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1187
1378
  "create_rights_link",
1188
1379
  "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.",
1189
1380
  {
1190
- cbid: import_zod5.z.string().describe("Site identifier (cbid). Must belong to your org."),
1191
- email: import_zod5.z.string().describe("The signed-in person\u2019s verified email address."),
1192
- userId: import_zod5.z.string().optional().describe("Your own account id for them; recorded on the request."),
1193
- 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."),
1194
- ttlSeconds: import_zod5.z.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
1381
+ cbid: import_zod6.z.string().describe("Site identifier (cbid). Must belong to your org."),
1382
+ email: import_zod6.z.string().describe("The signed-in person\u2019s verified email address."),
1383
+ userId: import_zod6.z.string().optional().describe("Your own account id for them; recorded on the request."),
1384
+ rights: import_zod6.z.array(import_zod6.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."),
1385
+ ttlSeconds: import_zod6.z.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
1195
1386
  },
1196
1387
  (a) => client.rightsLinks.create(a.cbid, {
1197
1388
  subject: { email: a.email, ...typeof a.userId === "string" ? { userId: a.userId } : {} },
@@ -1202,7 +1393,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1202
1393
  tool(
1203
1394
  "delete_test_dsar",
1204
1395
  "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.",
1205
- { id: import_zod5.z.string().describe("The test request id.") },
1396
+ { id: import_zod6.z.string().describe("The test request id.") },
1206
1397
  async (a) => {
1207
1398
  await client.dsar.delete(a.id);
1208
1399
  return { deleted: a.id };
@@ -1211,16 +1402,99 @@ ${JSON.stringify(r, null, 2)}` : r;
1211
1402
  tool(
1212
1403
  "mark_dsar_test",
1213
1404
  "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 }.",
1214
- { id: import_zod5.z.string().describe("The closed request id.") },
1405
+ { id: import_zod6.z.string().describe("The closed request id.") },
1215
1406
  (a) => client.dsar.markTest(a.id)
1216
1407
  );
1408
+ tool(
1409
+ "open_dsar_case",
1410
+ "Open a rights case fanned out to every connected system \u2014 an account closure from a product, an erasure, an export. type takes the canonical words (access, deletion, closure, restriction, rectification) or an alias (erasure, erase, export). For an erasure or closure, executeAfter = now + the site's graceDays is sent to every system and nothing is erased before it. source product or atlas attests the person (needs dsar:write; atlas needs subject.identity from the site's own sign-in issuer); admin files it received for verification. Pass idempotencyKey (16\u2013128 chars) so a retry answers the same case.",
1411
+ {
1412
+ cbid: import_zod6.z.string(),
1413
+ type: import_zod6.z.string().describe("access | deletion | closure | restriction | rectification, or erasure / erase / export."),
1414
+ emails: import_zod6.z.array(import_zod6.z.string()).optional().describe("The person's addresses."),
1415
+ identity: import_zod6.z.object({ iss: import_zod6.z.string(), sub: import_zod6.z.string(), ext: import_zod6.z.string().optional(), principal: import_zod6.z.string().optional() }).optional().describe("A signed-in identity from the site's sign-in issuer. People are never linked on email when it is present."),
1416
+ source: import_zod6.z.enum(["product", "atlas", "admin"]).optional(),
1417
+ reason: import_zod6.z.string().optional(),
1418
+ skipSystems: import_zod6.z.array(import_zod6.z.string()).optional().describe("System names, connection ids, or self."),
1419
+ fulfill: import_zod6.z.boolean().optional(),
1420
+ test: import_zod6.z.boolean().optional(),
1421
+ idempotencyKey: import_zod6.z.string().optional(),
1422
+ trace: import_zod6.z.string().optional().describe("An X-ForgeDeck-Trace to keep, from the caller.")
1423
+ },
1424
+ (a) => client.dsar.openCase(
1425
+ {
1426
+ cbid: a.cbid,
1427
+ type: a.type,
1428
+ subject: { emails: a.emails ?? [], ...a.identity ? { identity: a.identity } : {} },
1429
+ ...a.source ? { source: a.source } : {},
1430
+ ...typeof a.reason === "string" ? { reason: a.reason } : {},
1431
+ ...Array.isArray(a.skipSystems) ? { skipSystems: a.skipSystems } : {},
1432
+ ...typeof a.fulfill === "boolean" ? { fulfill: a.fulfill } : {},
1433
+ ...a.test === true ? { test: true } : {}
1434
+ },
1435
+ {
1436
+ ...typeof a.idempotencyKey === "string" ? { idempotencyKey: a.idempotencyKey } : {},
1437
+ ...typeof a.trace === "string" ? { trace: a.trace } : {}
1438
+ }
1439
+ )
1440
+ );
1441
+ tool(
1442
+ "get_dsar_case",
1443
+ "One case across every connected system: its status (pending, scheduled, processing, completed, completed_with_retention, rejected, cancelled), executeAfter, trace and one row per system with its status, eta and retention lines. Read-only.",
1444
+ { id: import_zod6.z.string() },
1445
+ (a) => client.dsar.getCase(a.id)
1446
+ );
1447
+ tool(
1448
+ "cancel_dsar_case",
1449
+ "Cancel a case before its executeAfter: work never sent is withdrawn, scheduled work is cancelled in each system, and every system's data stays intact. Refused once executeAfter has passed.",
1450
+ { id: import_zod6.z.string() },
1451
+ (a) => client.dsar.cancelCase(a.id)
1452
+ );
1453
+ tool(
1454
+ "get_dsar_case_receipt",
1455
+ "The signed receipt for a case: every system, its status and date, retention lines, the subject as hashes only. Ed25519, verifiable against GET /v1/partner/jwks.json. Read-only.",
1456
+ { id: import_zod6.z.string() },
1457
+ (a) => client.dsar.caseReceipt(a.id)
1458
+ );
1459
+ tool(
1460
+ "find_dsar_by_trace",
1461
+ "The rights request carrying one X-ForgeDeck-Trace id \u2014 to follow one event across products. Read-only.",
1462
+ { trace: import_zod6.z.string() },
1463
+ (a) => client.dsar.listByTrace(a.trace)
1464
+ );
1465
+ tool(
1466
+ "get_dsar_settings",
1467
+ "A site's rights-request settings: graceDays, how long an erasure or account closure waits before any system acts: 7 for a new site, 0 (opt-in) for one that existed before. Read-only.",
1468
+ { cbid: import_zod6.z.string() },
1469
+ (a) => client.dsarSettings.get(a.cbid)
1470
+ );
1471
+ tool(
1472
+ "set_dsar_settings",
1473
+ "Set a site's graceDays (0\u201330). Applies to cases opened afterwards. Audited.",
1474
+ { cbid: import_zod6.z.string(), graceDays: import_zod6.z.number().int().min(0).max(30) },
1475
+ (a) => client.dsarSettings.set(a.cbid, { graceDays: a.graceDays })
1476
+ );
1477
+ tool(
1478
+ "get_subject_card",
1479
+ 'Open rights requests for one person, as a support or CRM sidebar shows them \u2014 e.g. "erasure scheduled for 1 Nov: do not export this transcript". Name the person by iss and sub (preferred) or email. Read-only.',
1480
+ {
1481
+ app: import_zod6.z.string().describe("The sidebar app asking, as a slug, e.g. chatly."),
1482
+ iss: import_zod6.z.string().optional(),
1483
+ sub: import_zod6.z.string().optional(),
1484
+ email: import_zod6.z.string().optional()
1485
+ },
1486
+ (a) => client.integrations.subjectCard(
1487
+ a.app,
1488
+ typeof a.iss === "string" && typeof a.sub === "string" ? { iss: a.iss, sub: a.sub } : { email: String(a.email ?? "") }
1489
+ )
1490
+ );
1217
1491
  tool(
1218
1492
  "advance_dsar",
1219
1493
  "Advance a DSAR to a new status (received \u2192 verifying \u2192 in_progress \u2192 completed, or rejected).",
1220
1494
  {
1221
- id: import_zod5.z.string().describe("The DSAR id."),
1222
- toStatus: import_zod5.z.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status."),
1223
- messageToSubject: import_zod5.z.string().max(2e3).optional().describe("Replaces the line the data subject reads in the notice \u2014 for a rejection, why.")
1495
+ id: import_zod6.z.string().describe("The DSAR id."),
1496
+ toStatus: import_zod6.z.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status."),
1497
+ messageToSubject: import_zod6.z.string().max(2e3).optional().describe("Replaces the line the data subject reads in the notice \u2014 for a rejection, why.")
1224
1498
  },
1225
1499
  (a) => typeof a.messageToSubject === "string" ? client.dsar.advance(a.id, a.toStatus, { messageToSubject: a.messageToSubject }) : client.dsar.advance(a.id, a.toStatus)
1226
1500
  );
@@ -1233,7 +1507,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1233
1507
  tool(
1234
1508
  "get_receipt",
1235
1509
  "Fetch the signed consent receipt for a single consent record (by stamp).",
1236
- { ...cbid, stamp: import_zod5.z.string().describe("The consent record stamp/id.") },
1510
+ { ...cbid, stamp: import_zod6.z.string().describe("The consent record stamp/id.") },
1237
1511
  (a) => client.consent.receipt(a.cbid, a.stamp)
1238
1512
  );
1239
1513
  tool("delete_site", "Delete a site (cbid) and its configuration from your org.", { ...cbid }, async (a) => {
@@ -1245,13 +1519,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1245
1519
  "create_vendor",
1246
1520
  "Register a vendor (processor) and compute its risk score.",
1247
1521
  {
1248
- name: import_zod5.z.string().describe("Vendor name."),
1249
- category: import_zod5.z.string().describe("Vendor category, e.g. analytics."),
1250
- dataShared: import_zod5.z.array(import_zod5.z.string()).describe("Categories of data shared with the vendor."),
1251
- dpaSigned: import_zod5.z.boolean().describe("Whether a Data Processing Agreement is signed."),
1252
- subprocessors: import_zod5.z.number().describe("Number of subprocessors."),
1253
- certifications: import_zod5.z.array(import_zod5.z.string()).describe("Compliance certifications, e.g. ISO27001."),
1254
- region: import_zod5.z.string().describe("Primary processing region, e.g. EU.")
1522
+ name: import_zod6.z.string().describe("Vendor name."),
1523
+ category: import_zod6.z.string().describe("Vendor category, e.g. analytics."),
1524
+ dataShared: import_zod6.z.array(import_zod6.z.string()).describe("Categories of data shared with the vendor."),
1525
+ dpaSigned: import_zod6.z.boolean().describe("Whether a Data Processing Agreement is signed."),
1526
+ subprocessors: import_zod6.z.number().describe("Number of subprocessors."),
1527
+ certifications: import_zod6.z.array(import_zod6.z.string()).describe("Compliance certifications, e.g. ISO27001."),
1528
+ region: import_zod6.z.string().describe("Primary processing region, e.g. EU.")
1255
1529
  },
1256
1530
  (a) => client.vendors.create({
1257
1531
  name: a.name,
@@ -1269,13 +1543,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1269
1543
  "create_ropa",
1270
1544
  "Create a Record of Processing Activity (RoPA) entry.",
1271
1545
  {
1272
- name: import_zod5.z.string().describe("Activity name."),
1273
- purpose: import_zod5.z.string().describe("Purpose of processing."),
1274
- legalBasis: import_zod5.z.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
1275
- dataCategories: import_zod5.z.array(import_zod5.z.string()).describe("Categories of personal data."),
1276
- recipients: import_zod5.z.array(import_zod5.z.string()).describe("Recipients of the data."),
1277
- retentionDays: import_zod5.z.number().describe("Retention period in days."),
1278
- crossBorderTransfer: import_zod5.z.boolean().describe("Whether data is transferred across borders.")
1546
+ name: import_zod6.z.string().describe("Activity name."),
1547
+ purpose: import_zod6.z.string().describe("Purpose of processing."),
1548
+ legalBasis: import_zod6.z.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
1549
+ dataCategories: import_zod6.z.array(import_zod6.z.string()).describe("Categories of personal data."),
1550
+ recipients: import_zod6.z.array(import_zod6.z.string()).describe("Recipients of the data."),
1551
+ retentionDays: import_zod6.z.number().describe("Retention period in days."),
1552
+ crossBorderTransfer: import_zod6.z.boolean().describe("Whether data is transferred across borders.")
1279
1553
  },
1280
1554
  (a) => client.ropa.create({
1281
1555
  name: a.name,
@@ -1296,7 +1570,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1296
1570
  tool(
1297
1571
  "scan_site",
1298
1572
  "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.",
1299
- { ...cbid, wait: import_zod5.z.boolean().optional().describe("Wait for the scan to finish (up to 100 s) and return its outcome.") },
1573
+ { ...cbid, wait: import_zod6.z.boolean().optional().describe("Wait for the scan to finish (up to 100 s) and return its outcome.") },
1300
1574
  async (a) => {
1301
1575
  let started;
1302
1576
  try {
@@ -1309,8 +1583,8 @@ ${JSON.stringify(r, null, 2)}` : r;
1309
1583
  );
1310
1584
  tool(
1311
1585
  "get_scan_status",
1312
- "Get a site\u2019s last cookie scan: state (queued, scanning, done, failed), scanId, durationMs, cookieCount, pagesVisited and error when it failed.",
1313
- { ...cbid, wait: import_zod5.z.number().min(0).max(60).optional().describe("Seconds (\u226460) to wait for a running scan to settle before answering.") },
1586
+ "Get a site\u2019s last cookie scan: state (idle when never scanned, queued, scanning, done, failed), scanId, durationMs, cookieCount, pagesVisited and error when it failed.",
1587
+ { ...cbid, wait: import_zod6.z.number().min(0).max(60).optional().describe("Seconds (\u226460) to wait for a running scan to settle before answering.") },
1314
1588
  (a) => a.wait !== void 0 ? client.sites.scanStatus(a.cbid, { wait: a.wait }) : client.sites.scanStatus(a.cbid)
1315
1589
  );
1316
1590
  tool(
@@ -1327,20 +1601,26 @@ ${JSON.stringify(r, null, 2)}` : r;
1327
1601
  "api_key_report",
1328
1602
  "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.",
1329
1603
  {
1330
- unusedDays: import_zod5.z.number().int().min(1).max(3650).optional().describe("Unused for at least this many days (default 90)."),
1331
- expiringDays: import_zod5.z.number().int().min(1).max(3650).optional().describe("Expiring within this many days (default 14).")
1604
+ unusedDays: import_zod6.z.number().int().min(1).max(3650).optional().describe("Unused for at least this many days (default 90)."),
1605
+ expiringDays: import_zod6.z.number().int().min(1).max(3650).optional().describe("Expiring within this many days (default 14).")
1332
1606
  },
1333
1607
  (a) => client.keys.report({ ...a.unusedDays !== void 0 ? { unusedDays: a.unusedDays } : {}, ...a.expiringDays !== void 0 ? { expiringDays: a.expiringDays } : {} })
1334
1608
  );
1335
1609
  tool("get_usage", "Get the current usage/quota summary for your organization.", {}, () => client.usage());
1610
+ tool(
1611
+ "get_entitlements",
1612
+ "What your organization may use, from its plan: every feature (whiteLabel, tcf, sso, abTesting, \u2026) as {key, enabled} and every limit as limits.<name> with limit (null = unlimited) and used. Read-only.",
1613
+ {},
1614
+ () => client.entitlements()
1615
+ );
1336
1616
  tool("list_webhooks", "List webhook subscriptions for your organization.", {}, () => client.webhooks.list());
1337
1617
  tool(
1338
1618
  "create_webhook",
1339
1619
  "Create a webhook subscription. The response includes the signing secret (shown once).",
1340
1620
  {
1341
- url: import_zod5.z.string().describe("HTTPS endpoint to deliver events to."),
1342
- events: import_zod5.z.array(import_zod5.z.string()).describe("Event names to subscribe to, e.g. consent.created."),
1343
- cbid: import_zod5.z.string().optional().describe("Optional site cbid to scope the subscription to.")
1621
+ url: import_zod6.z.string().describe("HTTPS endpoint to deliver events to."),
1622
+ events: import_zod6.z.array(import_zod6.z.string()).describe("Event names to subscribe to, e.g. consent.created."),
1623
+ cbid: import_zod6.z.string().optional().describe("Optional site cbid to scope the subscription to.")
1344
1624
  },
1345
1625
  (a) => client.webhooks.create({
1346
1626
  url: a.url,
@@ -1351,13 +1631,13 @@ ${JSON.stringify(r, null, 2)}` : r;
1351
1631
  tool(
1352
1632
  "roll_webhook_secret",
1353
1633
  "Rotate a webhook subscription\u2019s signing secret. The new secret is returned once; the receiving endpoint must be updated to verify with it.",
1354
- { id: import_zod5.z.string() },
1634
+ { id: import_zod6.z.string() },
1355
1635
  (a) => client.webhooks.rollSecret(a.id)
1356
1636
  );
1357
1637
  tool(
1358
1638
  "test_webhook",
1359
1639
  "Send a signed test event to a webhook subscription now, and report what the endpoint answered.",
1360
- { id: import_zod5.z.string() },
1640
+ { id: import_zod6.z.string() },
1361
1641
  (a) => client.webhooks.test(a.id)
1362
1642
  );
1363
1643
  tool(
@@ -1369,40 +1649,48 @@ ${JSON.stringify(r, null, 2)}` : r;
1369
1649
  tool(
1370
1650
  "replay_webhook_dead_letter",
1371
1651
  "Deliver a dead-lettered webhook event again, to the subscription as it is now.",
1372
- { id: import_zod5.z.string() },
1652
+ { id: import_zod6.z.string() },
1373
1653
  (a) => client.webhooks.replayDeadLetter(a.id)
1374
1654
  );
1655
+ tool(
1656
+ "replay_webhook",
1657
+ "Send what a failing or disabled webhook endpoint missed: its held events since `since` (its failingSince), oldest first, one attempt each, stopping at the first failure. Re-enable the endpoint first (update_webhook active:true).",
1658
+ { id: import_zod6.z.string(), since: import_zod6.z.union([import_zod6.z.number(), import_zod6.z.string()]).describe("Epoch ms or ISO date."), limit: import_zod6.z.number().int().min(1).max(500).optional() },
1659
+ (a) => client.webhooks.replay(a.id, a.since, a.limit ? { limit: a.limit } : void 0)
1660
+ );
1375
1661
  tool(
1376
1662
  "update_webhook",
1377
- "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.",
1663
+ "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. active:true re-enables a disabled endpoint; the answer says how to replay what it missed. alertContacts: who is emailed when it fails (null: the org owners).",
1378
1664
  {
1379
- id: import_zod5.z.string(),
1380
- url: import_zod5.z.string().optional(),
1381
- events: import_zod5.z.array(import_zod5.z.string()).optional(),
1382
- cbid: import_zod5.z.string().nullable().optional(),
1383
- active: import_zod5.z.boolean().optional()
1665
+ id: import_zod6.z.string(),
1666
+ url: import_zod6.z.string().optional(),
1667
+ events: import_zod6.z.array(import_zod6.z.string()).optional(),
1668
+ cbid: import_zod6.z.string().nullable().optional(),
1669
+ active: import_zod6.z.boolean().optional(),
1670
+ alertContacts: import_zod6.z.array(import_zod6.z.string()).nullable().optional()
1384
1671
  },
1385
1672
  (a) => client.webhooks.update(a.id, {
1386
1673
  ...a.url !== void 0 ? { url: a.url } : {},
1387
1674
  ...a.events !== void 0 ? { events: a.events } : {},
1388
1675
  ...a.cbid !== void 0 ? { cbid: a.cbid } : {},
1389
- ...a.active !== void 0 ? { active: a.active } : {}
1676
+ ...a.active !== void 0 ? { active: a.active } : {},
1677
+ ...a.alertContacts !== void 0 ? { alertContacts: a.alertContacts } : {}
1390
1678
  })
1391
1679
  );
1392
- tool("delete_webhook", "Delete a webhook subscription by id.", { id: import_zod5.z.string().describe("The webhook subscription id.") }, async (a) => {
1680
+ tool("delete_webhook", "Delete a webhook subscription by id.", { id: import_zod6.z.string().describe("The webhook subscription id.") }, async (a) => {
1393
1681
  await client.webhooks.delete(a.id);
1394
1682
  return { ok: true };
1395
1683
  });
1396
1684
  tool(
1397
1685
  "verify_site",
1398
1686
  "Verify that your organization controls a domain by one of three challenge methods (dns / meta / file). Required to unlock consent export and signed receipts.",
1399
- { ...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).") },
1687
+ { ...cbid, method: import_zod6.z.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
1400
1688
  (a) => client.sites.verify(a.cbid, a.method)
1401
1689
  );
1402
1690
  tool(
1403
1691
  "get_verification_challenge",
1404
1692
  "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.",
1405
- { cbid: import_zod5.z.string() },
1693
+ { cbid: import_zod6.z.string() },
1406
1694
  (a) => client.sites.verifyChallenge(a.cbid)
1407
1695
  );
1408
1696
  tool(
@@ -1411,18 +1699,35 @@ ${JSON.stringify(r, null, 2)}` : r;
1411
1699
  { ...cbid },
1412
1700
  (a) => client.sites.brand(a.cbid)
1413
1701
  );
1702
+ tool(
1703
+ "get_site_brand",
1704
+ "Read back the brand.json last imported for a site: each role (color.accent, font.body, logo.light, \u2026), the theme token it sets, whether the value in force is brand.json's or the site's own (the site wins), variants that override it, plus ignored[] and warnings[] (e.g. a third-party font host).",
1705
+ { cbid: import_zod6.z.string() },
1706
+ (a) => client.sites.getBrand(a.cbid)
1707
+ );
1708
+ tool(
1709
+ "import_site_brand",
1710
+ "Import a DTCG brand.json into a site's banner theme (the hosted rights page uses it too). Pass url (https, fetched once) or document (the brand.json object). Values the site set itself are kept: brand.json < site banner theme < per-banner variant. dryRun answers the read-back and saves nothing.",
1711
+ {
1712
+ cbid: import_zod6.z.string(),
1713
+ url: import_zod6.z.string().optional().describe("https URL of the brand.json. Give this or document."),
1714
+ document: import_zod6.z.record(import_zod6.z.unknown()).optional().describe("The brand.json object itself. Give this or url."),
1715
+ dryRun: import_zod6.z.boolean().optional()
1716
+ },
1717
+ (a) => client.sites.setBrand(a.cbid, typeof a.url === "string" ? { url: a.url } : a.document ?? {}, { dryRun: a.dryRun === true })
1718
+ );
1414
1719
  tool(
1415
1720
  "get_flow",
1416
1721
  "Get the v2 banner flow config for a site, including current views, categories, and any lint issues.",
1417
- { cbid: import_zod5.z.string().describe("Site identifier (cbid).") },
1722
+ { cbid: import_zod6.z.string().describe("Site identifier (cbid).") },
1418
1723
  (a) => client.sites.getFlow(a.cbid)
1419
1724
  );
1420
1725
  tool(
1421
1726
  "edit_flow",
1422
1727
  "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.",
1423
1728
  {
1424
- cbid: import_zod5.z.string().describe("Site identifier (cbid)."),
1425
- operations: import_zod5.z.array(import_zod5.z.record(import_zod5.z.unknown())).describe(
1729
+ cbid: import_zod6.z.string().describe("Site identifier (cbid)."),
1730
+ operations: import_zod6.z.array(import_zod6.z.record(import_zod6.z.unknown())).describe(
1426
1731
  'Ordered list of ops. Each must have an "op" field: addView | removeView | addElement | setButtonTransition | addCustomCategory.'
1427
1732
  )
1428
1733
  },
@@ -1432,22 +1737,23 @@ ${JSON.stringify(r, null, 2)}` : r;
1432
1737
  "set_flow",
1433
1738
  "Wholesale replace a site's v2 banner flow with a complete config (e.g. from a template). Validated server-side before it is saved.",
1434
1739
  {
1435
- cbid: import_zod5.z.string().describe("Site identifier (cbid)."),
1436
- config: import_zod5.z.record(import_zod5.z.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1740
+ cbid: import_zod6.z.string().describe("Site identifier (cbid)."),
1741
+ config: import_zod6.z.record(import_zod6.z.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
1437
1742
  },
1438
1743
  (a) => client.sites.setFlow(a.cbid, a.config)
1439
1744
  );
1440
1745
  registerConfigTools(tool, client);
1441
1746
  registerPlatformTools(tool, client);
1442
1747
  registerIntegrationTools(tool, client);
1748
+ registerKeyAndTagTools(tool, client);
1443
1749
  registerRightsTools(tool, client);
1444
1750
  registerRightsPageTools(tool, client);
1445
1751
  tool(
1446
1752
  "invite_member",
1447
1753
  "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.",
1448
1754
  {
1449
- email: import_zod5.z.string().describe("Email address of the person to invite."),
1450
- role: import_zod5.z.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1755
+ email: import_zod6.z.string().describe("Email address of the person to invite."),
1756
+ role: import_zod6.z.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
1451
1757
  },
1452
1758
  (a) => client.members.invite(a.email, a.role)
1453
1759
  );
@@ -1455,8 +1761,8 @@ ${JSON.stringify(r, null, 2)}` : r;
1455
1761
  "set_member_role",
1456
1762
  "Change the role of a member in your organization. The org owner's role cannot be changed.",
1457
1763
  {
1458
- userId: import_zod5.z.string().describe("The userId of the member whose role to change."),
1459
- role: import_zod5.z.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1764
+ userId: import_zod6.z.string().describe("The userId of the member whose role to change."),
1765
+ role: import_zod6.z.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
1460
1766
  },
1461
1767
  (a) => client.members.setRole(a.userId, a.role)
1462
1768
  );
@@ -1464,7 +1770,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1464
1770
  "remove_member",
1465
1771
  "Remove a member from your organization. The org owner cannot be removed.",
1466
1772
  {
1467
- userId: import_zod5.z.string().describe("The userId of the member to remove.")
1773
+ userId: import_zod6.z.string().describe("The userId of the member to remove.")
1468
1774
  },
1469
1775
  async (a) => {
1470
1776
  await client.members.remove(a.userId);
@@ -1475,11 +1781,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1475
1781
  "create_brand_kit",
1476
1782
  "Create a reusable brand kit (colors, logo, typography) for your organization's consent banners.",
1477
1783
  {
1478
- name: import_zod5.z.string().describe("Display name for the brand kit."),
1479
- theme: import_zod5.z.record(import_zod5.z.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1480
- content: import_zod5.z.record(import_zod5.z.unknown()).optional().describe("Optional banner copy overrides."),
1481
- logoUrl: import_zod5.z.string().optional().describe("Optional URL for your org logo."),
1482
- customCss: import_zod5.z.string().optional().describe("Optional custom CSS string to inject into the banner.")
1784
+ name: import_zod6.z.string().describe("Display name for the brand kit."),
1785
+ theme: import_zod6.z.record(import_zod6.z.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
1786
+ content: import_zod6.z.record(import_zod6.z.unknown()).optional().describe("Optional banner copy overrides."),
1787
+ logoUrl: import_zod6.z.string().optional().describe("Optional URL for your org logo."),
1788
+ customCss: import_zod6.z.string().optional().describe("Optional custom CSS string to inject into the banner.")
1483
1789
  },
1484
1790
  (a) => client.brandKits.create({
1485
1791
  name: a.name,
@@ -1493,7 +1799,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1493
1799
  "delete_brand_kit",
1494
1800
  "Delete a brand kit by id. The kit must belong to your organization (cross-org deletes are rejected).",
1495
1801
  {
1496
- id: import_zod5.z.string().describe("The brand kit id to delete.")
1802
+ id: import_zod6.z.string().describe("The brand kit id to delete.")
1497
1803
  },
1498
1804
  async (a) => {
1499
1805
  await client.brandKits.delete(a.id);
@@ -1504,25 +1810,25 @@ ${JSON.stringify(r, null, 2)}` : r;
1504
1810
  "save_preference",
1505
1811
  "Save or update the consent preferences for an end-user (by subjectId) within your organization. purposes is a map of purpose-name \u2192 boolean.",
1506
1812
  {
1507
- subjectId: import_zod5.z.string().describe("The end-user identifier (e.g. email or internal user id)."),
1508
- purposes: import_zod5.z.record(import_zod5.z.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1813
+ subjectId: import_zod6.z.string().describe("The end-user identifier (e.g. email or internal user id)."),
1814
+ purposes: import_zod6.z.record(import_zod6.z.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
1509
1815
  },
1510
1816
  (a) => client.preferences.save(a.subjectId, a.purposes)
1511
1817
  );
1512
1818
  tool(
1513
1819
  "get_preference",
1514
1820
  "One end-user\u2019s saved preferences, by subjectId. Read-only.",
1515
- { subjectId: import_zod5.z.string() },
1821
+ { subjectId: import_zod6.z.string() },
1516
1822
  (a) => client.preferences.get(a.subjectId)
1517
1823
  );
1518
1824
  tool(
1519
1825
  "mint_preference_center_token",
1520
1826
  "Mint a hosted preference-centre token for one visitor (POST /v1/preference-center/tokens), for a page to pass to CookieMunch.setSubjectToken. Give exactly one of email (resolved as the emailed preference link resolves it; an unknown address is subject_not_found) or subjectId. The token is a credential that opens that person\u2019s subscriptions and profile until expiresAt: never paste it into a shared URL, a ticket or a log, and keep ttlSeconds short (default 3600, max 86400). Needs subscriptions:write and profile:write, plus identity:read by email.",
1521
1827
  {
1522
- cbid: import_zod5.z.string().describe("A site of your organisation."),
1523
- email: import_zod5.z.string().optional().describe("The visitor\u2019s address. Give this or subjectId, not both."),
1524
- subjectId: import_zod5.z.string().optional().describe("The subject id. Give this or email, not both."),
1525
- ttlSeconds: import_zod5.z.number().int().min(1).max(86400).optional()
1828
+ cbid: import_zod6.z.string().describe("A site of your organisation."),
1829
+ email: import_zod6.z.string().optional().describe("The visitor\u2019s address. Give this or subjectId, not both."),
1830
+ subjectId: import_zod6.z.string().optional().describe("The subject id. Give this or email, not both."),
1831
+ ttlSeconds: import_zod6.z.number().int().min(1).max(86400).optional()
1526
1832
  },
1527
1833
  (a) => client.preferenceCenter.mintToken({
1528
1834
  cbid: a.cbid,
@@ -1532,15 +1838,19 @@ ${JSON.stringify(r, null, 2)}` : r;
1532
1838
  );
1533
1839
  tool(
1534
1840
  "issue_api_key",
1535
- "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.",
1841
+ "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 (the answer warns about it). For a sub-task, vend_api_key mints a short-lived one instead.",
1536
1842
  {
1537
- name: import_zod5.z.string().optional(),
1538
- scopes: import_zod5.z.array(import_zod5.z.string()).optional(),
1539
- cbids: import_zod5.z.array(import_zod5.z.string()).min(1).optional(),
1540
- expiresInDays: import_zod5.z.number().int().min(1).max(3650).optional(),
1541
- expiresAt: import_zod5.z.string().optional().describe("Or the exact expiry, an ISO date-time (not with expiresInDays).")
1843
+ name: import_zod6.z.string().optional(),
1844
+ scopes: import_zod6.z.array(import_zod6.z.string()).optional(),
1845
+ cbids: import_zod6.z.array(import_zod6.z.string()).min(1).optional(),
1846
+ expiresInDays: import_zod6.z.number().int().min(1).max(3650).optional(),
1847
+ expiresAt: import_zod6.z.string().optional().describe("Or the exact expiry, an ISO date-time (not with expiresInDays)."),
1848
+ owner: import_zod6.z.string().optional().describe("Who it belongs to: user:<id>, service:<name> or apikey:<prefix>. Default this key."),
1849
+ strictUnknownFields: import_zod6.z.boolean().optional().describe("Writes with the new key refuse unknown body fields by default.")
1542
1850
  },
1543
1851
  (a) => client.keys.issue({
1852
+ ...a.owner ? { owner: a.owner } : {},
1853
+ ...a.strictUnknownFields !== void 0 ? { strictUnknownFields: a.strictUnknownFields } : {},
1544
1854
  ...a.expiresAt ? { expiresAt: a.expiresAt } : {},
1545
1855
  ...a.name ? { name: a.name } : {},
1546
1856
  ...a.scopes ? { scopes: a.scopes } : {},
@@ -1548,36 +1858,36 @@ ${JSON.stringify(r, null, 2)}` : r;
1548
1858
  ...a.expiresInDays !== void 0 ? { expiresInDays: a.expiresInDays } : {}
1549
1859
  })
1550
1860
  );
1551
- 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) => {
1861
+ tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: import_zod6.z.string() }, async (a) => {
1552
1862
  await client.keys.revoke(a.prefix);
1553
1863
  return { revoked: a.prefix };
1554
1864
  });
1555
1865
  tool(
1556
1866
  "import_cookie_declaration",
1557
1867
  "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.",
1558
- { cbid: import_zod5.z.string(), data: import_zod5.z.string().describe("The exported file, as text (CSV or JSON).") },
1868
+ { cbid: import_zod6.z.string(), data: import_zod6.z.string().describe("The exported file, as text (CSV or JSON).") },
1559
1869
  (a) => client.sites.importDeclaration(a.cbid, a.data)
1560
1870
  );
1561
1871
  tool(
1562
1872
  "apply_cookie_import",
1563
1873
  "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.",
1564
- { 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() },
1874
+ { cbid: import_zod6.z.string(), data: import_zod6.z.string().describe("The exported file, as text (CSV or JSON)."), overwrite: import_zod6.z.boolean().optional() },
1565
1875
  (a) => client.sites.applyImport(a.cbid, a.data, a.overwrite ? { overwrite: true } : void 0)
1566
1876
  );
1567
1877
  const declarationShape = {
1568
- category: import_zod5.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1569
- purpose: import_zod5.z.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1570
- 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.'),
1571
- provider: import_zod5.z.string().optional(),
1572
- expiry: import_zod5.z.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
1573
- domain: import_zod5.z.string().optional(),
1574
- pattern: import_zod5.z.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
1878
+ category: import_zod6.z.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
1879
+ purpose: import_zod6.z.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
1880
+ purposes: import_zod6.z.record(import_zod6.z.string(), import_zod6.z.string().max(1e3)).nullable().optional().describe('The purpose in other languages, keyed by BCP-47 tag: {"es": "\u2026", "pt-BR": "\u2026"}. The banner, data-cc="declaration" and cookie-declaration.js draw the visitor\u2019s language. null clears.'),
1881
+ provider: import_zod6.z.string().optional(),
1882
+ expiry: import_zod6.z.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
1883
+ domain: import_zod6.z.string().optional(),
1884
+ pattern: import_zod6.z.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
1575
1885
  };
1576
- 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.");
1886
+ const dryRunArg = import_zod6.z.boolean().optional().describe("Store nothing: answer with the would-be declarations and a diff (added / removed / changed) to check first.");
1577
1887
  tool(
1578
1888
  "declare_cookie",
1579
1889
  '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.',
1580
- { cbid: import_zod5.z.string(), name: import_zod5.z.string(), ...declarationShape, dryRun: dryRunArg },
1890
+ { cbid: import_zod6.z.string(), name: import_zod6.z.string(), ...declarationShape, dryRun: dryRunArg },
1581
1891
  (a) => {
1582
1892
  const { cbid: cbid2, name, dryRun, ...rest } = a;
1583
1893
  return client.sites.declareCookie(cbid2, name, rest, dryRun ? { dryRun: true } : void 0);
@@ -1586,7 +1896,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1586
1896
  tool(
1587
1897
  "declare_cookies",
1588
1898
  "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.",
1589
- { 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 },
1899
+ { cbid: import_zod6.z.string(), cookies: import_zod6.z.array(import_zod6.z.object({ name: import_zod6.z.string(), ...declarationShape })).max(500), replace: import_zod6.z.boolean().optional(), dryRun: dryRunArg },
1590
1900
  (a) => {
1591
1901
  const o = { ...a.replace ? { replace: true } : {}, ...a.dryRun ? { dryRun: true } : {} };
1592
1902
  return client.sites.declareCookies(a.cbid, a.cookies, Object.keys(o).length ? o : void 0);
@@ -1595,7 +1905,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1595
1905
  tool(
1596
1906
  "undeclare_cookie",
1597
1907
  "Remove a cookie declaration; the scanned/observed classification applies again.",
1598
- { cbid: import_zod5.z.string(), name: import_zod5.z.string(), dryRun: dryRunArg },
1908
+ { cbid: import_zod6.z.string(), name: import_zod6.z.string(), dryRun: dryRunArg },
1599
1909
  async (a) => {
1600
1910
  if (a.dryRun) return client.sites.undeclareCookie(a.cbid, a.name, { dryRun: true });
1601
1911
  await client.sites.undeclareCookie(a.cbid, a.name);
@@ -1606,11 +1916,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1606
1916
  "retire_cookie",
1607
1917
  '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.',
1608
1918
  {
1609
- cbid: import_zod5.z.string(),
1610
- name: import_zod5.z.string(),
1611
- renamedTo: import_zod5.z.string().max(256).optional().describe("The cookie\u2019s new name, if it was renamed."),
1612
- note: import_zod5.z.string().max(1e3).optional(),
1613
- dryRun: import_zod5.z.boolean().optional().describe("Store nothing: answer with the would-be retirement and list to check first.")
1919
+ cbid: import_zod6.z.string(),
1920
+ name: import_zod6.z.string(),
1921
+ renamedTo: import_zod6.z.string().max(256).optional().describe("The cookie\u2019s new name, if it was renamed."),
1922
+ note: import_zod6.z.string().max(1e3).optional(),
1923
+ dryRun: import_zod6.z.boolean().optional().describe("Store nothing: answer with the would-be retirement and list to check first.")
1614
1924
  },
1615
1925
  (a) => {
1616
1926
  const input = { ...a.renamedTo ? { renamedTo: a.renamedTo } : {}, ...a.note ? { note: a.note } : {} };
@@ -1620,7 +1930,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1620
1930
  tool(
1621
1931
  "unretire_cookie",
1622
1932
  "Un-retire a cookie: it is listed again everywhere.",
1623
- { 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.") },
1933
+ { cbid: import_zod6.z.string(), name: import_zod6.z.string(), dryRun: import_zod6.z.boolean().optional().describe("Store nothing: answer with what the list would be.") },
1624
1934
  async (a) => {
1625
1935
  if (a.dryRun) return client.sites.unretireCookie(a.cbid, a.name, { dryRun: true });
1626
1936
  await client.sites.unretireCookie(a.cbid, a.name);
@@ -1629,41 +1939,74 @@ ${JSON.stringify(r, null, 2)}` : r;
1629
1939
  );
1630
1940
  tool(
1631
1941
  "list_cookie_presets",
1632
- "Declaration presets for the platforms a site is built on (atlas, forumulate, chatly, cookiemunch, referally): each one\u2019s parameters, what it has declared on this site, and whether the vendor\u2019s live manifest can be imported yet. Read-only.",
1633
- { cbid: import_zod5.z.string() },
1942
+ "Declaration presets for the platforms a site is built on (atlas, forumulate, chatly, cookiemunch, referalli, firstpromoter, partnerstack, tapfiliate, impact): each one\u2019s parameters, what it has declared on this site, and whether the vendor\u2019s live manifest can be imported yet. Read-only.",
1943
+ { cbid: import_zod6.z.string() },
1634
1944
  (a) => client.sites.cookiePresets(a.cbid)
1635
1945
  );
1636
1946
  tool(
1637
1947
  "apply_cookie_preset",
1638
- "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.",
1948
+ "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. A row filed under a disabled category comes back in warnings with a suggestedConfigPatch.",
1639
1949
  {
1640
- cbid: import_zod5.z.string(),
1641
- vendor: import_zod5.z.enum(["atlas", "forumulate", "chatly", "cookiemunch", "referally"]),
1642
- frontendApiHost: import_zod5.z.string().optional().describe("Atlas: your frontend API host, e.g. auth.example.com."),
1643
- crossSubdomainCookies: import_zod5.z.boolean().optional().describe("Atlas: default true \u2014 the cookies live on the parent domain."),
1644
- publicId: import_zod5.z.string().optional().describe("Chatly: the channel public id (ch_web_\u2026)."),
1645
- dragging: import_zod5.z.boolean().optional().describe("Chatly: the launcher can be dragged (adds the drag-position key)."),
1646
- category: import_zod5.z.string().optional().describe("Chatly: the category for its keys (default necessary). Referally: default the site's referrals category, else marketing."),
1647
- cookieDomain: import_zod5.z.string().optional().describe("Referally: the domain aff.js sets referally_ctx on, e.g. .example.com. Default the site domain."),
1648
- cookieDays: import_zod5.z.number().int().min(1).max(400).optional().describe("Referally: how long the cookie lives, 1 to 400 days. Default 60."),
1950
+ cbid: import_zod6.z.string(),
1951
+ vendor: import_zod6.z.enum(["atlas", "forumulate", "chatly", "cookiemunch", "referalli", "firstpromoter", "partnerstack", "tapfiliate", "impact", "referally"]).describe("referally is the deprecated old name of referalli."),
1952
+ frontendApiHost: import_zod6.z.string().optional().describe("Atlas: your frontend API host, e.g. auth.example.com."),
1953
+ crossSubdomainCookies: import_zod6.z.boolean().optional().describe("Atlas: default true \u2014 the cookies live on the parent domain."),
1954
+ publicId: import_zod6.z.string().optional().describe("Chatly: the channel public id (ch_web_\u2026)."),
1955
+ dragging: import_zod6.z.boolean().optional().describe("Chatly: the launcher can be dragged (adds the drag-position key)."),
1956
+ category: import_zod6.z.string().optional().describe("Chatly: the category for its keys (default necessary). Referral and affiliate presets: default the site's referrals category, else marketing."),
1957
+ cookieDomain: import_zod6.z.string().optional().describe("Referral and affiliate presets: the domain their script sets its cookies on, e.g. .example.com. Default the site domain."),
1958
+ cookieDays: import_zod6.z.number().int().min(1).max(400).optional().describe("Referral and affiliate presets: your program's cookie window, 1 to 400 days."),
1959
+ legacyName: import_zod6.z.boolean().optional().describe("referalli: default true, also declare referally_ctx (the pre-rename copy aff.js still writes)."),
1960
+ campaignId: import_zod6.z.string().optional().describe("impact: your program id; declares IR_<campaignId> too."),
1649
1961
  dryRun: dryRunArg
1650
1962
  },
1651
1963
  (a) => {
1652
1964
  const params = {};
1653
- for (const k of ["frontendApiHost", "crossSubdomainCookies", "publicId", "dragging", "category", "cookieDomain", "cookieDays"]) if (a[k] !== void 0) params[k] = a[k];
1965
+ for (const k of ["frontendApiHost", "crossSubdomainCookies", "publicId", "dragging", "category", "cookieDomain", "cookieDays", "legacyName", "campaignId"]) if (a[k] !== void 0) params[k] = a[k];
1654
1966
  return client.sites.applyCookiePreset(a.cbid, a.vendor, params, a.dryRun ? { dryRun: true } : void 0);
1655
1967
  }
1656
1968
  );
1969
+ tool(
1970
+ "import_cookie_manifest",
1971
+ 'Declare ANY vendor\u2019s cookies and browser storage from its embed manifest (/.well-known/forgedeck-embed.json): give its https URL (re-read hourly afterwards) or the manifest document. The vendor id is the manifest\u2019s product; rows are marked source "manifest". An invalid manifest is refused with each broken rule named. Use dryRun first; remove it with remove_cookie_preset and the product id.',
1972
+ {
1973
+ cbid: import_zod6.z.string(),
1974
+ url: import_zod6.z.string().optional().describe("An https:// embed manifest URL."),
1975
+ manifest: import_zod6.z.record(import_zod6.z.unknown()).optional().describe("The manifest document itself, instead of a URL."),
1976
+ params: import_zod6.z.record(import_zod6.z.string()).optional().describe('Values for the manifest\u2019s {placeholders}, e.g. {"publicId": "ch_web_1"}.'),
1977
+ dryRun: dryRunArg
1978
+ },
1979
+ (a) => {
1980
+ const input = a.url !== void 0 ? { url: a.url } : { manifest: a.manifest };
1981
+ return client.sites.importCookieManifest(a.cbid, { ...input, ...a.params ? { params: a.params } : {} }, a.dryRun ? { dryRun: true } : void 0);
1982
+ }
1983
+ );
1984
+ tool(
1985
+ "list_cookie_suggestions",
1986
+ "What a site should declare: the vendors its crawls and visits show (by script URL, storage name or embed manifest), the preset for each, and one suggestion per undeclared cookie or storage key with a suggested category, confidence, and whether a crawl saw it before consent (consentStates). Read-only.",
1987
+ { cbid: import_zod6.z.string() },
1988
+ (a) => client.sites.cookieSuggestions(a.cbid)
1989
+ );
1990
+ tool(
1991
+ "declare_cookie_suggestions",
1992
+ "Declare a site\u2019s suggestions in one call: applies detected vendors\u2019 presets that need no parameters and declares every other suggestion that has a purpose. Run with dryRun first to see the diff. names limits it to those suggestions; presets: false declares rows one by one instead.",
1993
+ { cbid: import_zod6.z.string(), names: import_zod6.z.array(import_zod6.z.string()).optional(), presets: import_zod6.z.boolean().optional(), dryRun: dryRunArg },
1994
+ (a) => client.sites.declareCookieSuggestions(
1995
+ a.cbid,
1996
+ { ...a.names ? { names: a.names } : {}, ...a.presets !== void 0 ? { presets: a.presets } : {} },
1997
+ a.dryRun ? { dryRun: true } : void 0
1998
+ )
1999
+ );
1657
2000
  tool(
1658
2001
  "remove_cookie_preset",
1659
- "Remove every declaration a vendor preset made on this site.",
1660
- { cbid: import_zod5.z.string(), vendor: import_zod5.z.enum(["atlas", "forumulate", "chatly", "cookiemunch", "referally"]), dryRun: dryRunArg },
2002
+ "Remove every declaration a vendor preset made on this site: a first-class preset, or a custom one (import_cookie_manifest) by its product id.",
2003
+ { cbid: import_zod6.z.string(), vendor: import_zod6.z.string().describe("atlas, forumulate, chatly, cookiemunch, referalli, firstpromoter, partnerstack, tapfiliate, impact (referally is an alias of referalli), or a custom preset's product id."), dryRun: dryRunArg },
1661
2004
  (a) => client.sites.removeCookiePreset(a.cbid, a.vendor, a.dryRun ? { dryRun: true } : void 0)
1662
2005
  );
1663
2006
  tool(
1664
2007
  "delete_observed_cookie",
1665
2008
  "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.",
1666
- { cbid: import_zod5.z.string(), name: import_zod5.z.string(), dryRun: dryRunArg },
2009
+ { cbid: import_zod6.z.string(), name: import_zod6.z.string(), dryRun: dryRunArg },
1667
2010
  async (a) => {
1668
2011
  if (a.dryRun) return client.sites.deleteObservedCookie(a.cbid, a.name, { dryRun: true });
1669
2012
  await client.sites.deleteObservedCookie(a.cbid, a.name);
@@ -1674,9 +2017,9 @@ ${JSON.stringify(r, null, 2)}` : r;
1674
2017
  "purge_observed_cookies",
1675
2018
  "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.",
1676
2019
  {
1677
- cbid: import_zod5.z.string(),
1678
- since: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).describe("ISO-8601 time or epoch milliseconds."),
1679
- until: import_zod5.z.union([import_zod5.z.string(), import_zod5.z.number()]).optional().describe("Optional end of the window (exclusive)."),
2020
+ cbid: import_zod6.z.string(),
2021
+ since: import_zod6.z.union([import_zod6.z.string(), import_zod6.z.number()]).describe("ISO-8601 time or epoch milliseconds."),
2022
+ until: import_zod6.z.union([import_zod6.z.string(), import_zod6.z.number()]).optional().describe("Optional end of the window (exclusive)."),
1680
2023
  dryRun: dryRunArg
1681
2024
  },
1682
2025
  (a) => client.sites.purgeObservedCookies(
@@ -1688,24 +2031,24 @@ ${JSON.stringify(r, null, 2)}` : r;
1688
2031
  tool(
1689
2032
  "get_blocked_pages",
1690
2033
  "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.",
1691
- { cbid: import_zod5.z.string() },
2034
+ { cbid: import_zod6.z.string() },
1692
2035
  (a) => client.sites.blocked(a.cbid)
1693
2036
  );
1694
2037
  tool(
1695
2038
  "roll_api_key",
1696
2039
  "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.",
1697
- { prefix: import_zod5.z.string() },
2040
+ { prefix: import_zod6.z.string() },
1698
2041
  (a) => client.keys.roll(a.prefix)
1699
2042
  );
1700
2043
  tool(
1701
2044
  "update_api_key",
1702
2045
  "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.",
1703
2046
  {
1704
- prefix: import_zod5.z.string(),
1705
- name: import_zod5.z.string().optional(),
1706
- scopes: import_zod5.z.array(import_zod5.z.string()).optional(),
1707
- cbids: import_zod5.z.array(import_zod5.z.string()).min(1).optional(),
1708
- expiresAt: import_zod5.z.string().nullable().optional().describe("A new expiry (ISO date-time), or null to remove it.")
2047
+ prefix: import_zod6.z.string(),
2048
+ name: import_zod6.z.string().optional(),
2049
+ scopes: import_zod6.z.array(import_zod6.z.string()).optional(),
2050
+ cbids: import_zod6.z.array(import_zod6.z.string()).min(1).optional(),
2051
+ expiresAt: import_zod6.z.string().nullable().optional().describe("A new expiry (ISO date-time), or null to remove it.")
1709
2052
  },
1710
2053
  (a) => client.keys.update(a.prefix, {
1711
2054
  ...a.expiresAt !== void 0 ? { expiresAt: a.expiresAt } : {},
@@ -1718,7 +2061,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1718
2061
  tool(
1719
2062
  "update_org",
1720
2063
  "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.",
1721
- { name: import_zod5.z.string().min(1).optional(), logoUrl: import_zod5.z.string().nullable().optional() },
2064
+ { name: import_zod6.z.string().min(1).optional(), logoUrl: import_zod6.z.string().nullable().optional() },
1722
2065
  (a) => client.org.update({
1723
2066
  ...a.name !== void 0 ? { name: a.name } : {},
1724
2067
  ...a.logoUrl !== void 0 ? { logoUrl: a.logoUrl } : {}
@@ -1734,20 +2077,20 @@ ${JSON.stringify(r, null, 2)}` : r;
1734
2077
  "set_mail_provider",
1735
2078
  "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).",
1736
2079
  {
1737
- provider: import_zod5.z.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
1738
- fromEmail: import_zod5.z.string().describe("An address on a domain your provider has verified."),
1739
- fromName: import_zod5.z.string().max(100).nullable().optional(),
1740
- replyTo: import_zod5.z.string().nullable().optional(),
1741
- secret: import_zod5.z.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
1742
- ses: import_zod5.z.object({ region: import_zod5.z.string(), accessKeyId: import_zod5.z.string() }).optional().describe("Required for ses."),
1743
- 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.")
2080
+ provider: import_zod6.z.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
2081
+ fromEmail: import_zod6.z.string().describe("An address on a domain your provider has verified."),
2082
+ fromName: import_zod6.z.string().max(100).nullable().optional(),
2083
+ replyTo: import_zod6.z.string().nullable().optional(),
2084
+ secret: import_zod6.z.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
2085
+ ses: import_zod6.z.object({ region: import_zod6.z.string(), accessKeyId: import_zod6.z.string() }).optional().describe("Required for ses."),
2086
+ smtp: import_zod6.z.object({ host: import_zod6.z.string(), port: import_zod6.z.union([import_zod6.z.literal(25), import_zod6.z.literal(465), import_zod6.z.literal(587), import_zod6.z.literal(2525)]), security: import_zod6.z.enum(["tls", "starttls"]), username: import_zod6.z.string() }).optional().describe("Required for smtp. TLS is always required.")
1744
2087
  },
1745
2088
  (a) => client.org.mailProvider.set(a)
1746
2089
  );
1747
2090
  tool(
1748
2091
  "test_mail_provider",
1749
2092
  "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.",
1750
- { to: import_zod5.z.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
2093
+ { to: import_zod6.z.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
1751
2094
  (a) => client.org.mailProvider.test(a.to)
1752
2095
  );
1753
2096
  tool(
@@ -1769,10 +2112,10 @@ ${JSON.stringify(r, null, 2)}` : r;
1769
2112
  "set_org_controller",
1770
2113
  "Set the organisation\u2019s data-controller identity. Replaces it: a field left out is removed. Needed for a notice on a rights request filed without a cbid when the organisation has several sites. Needs an unscoped key or rights:write. Audited.",
1771
2114
  {
1772
- legalName: import_zod5.z.string().describe("Required: the legal name of the data controller."),
1773
- contactEmail: import_zod5.z.string().optional().describe("Where people reach the controller about their data."),
1774
- address: import_zod5.z.string().optional(),
1775
- dpoContact: import_zod5.z.string().optional().describe("The Data Protection Officer: a name, an email address, or both.")
2115
+ legalName: import_zod6.z.string().describe("Required: the legal name of the data controller."),
2116
+ contactEmail: import_zod6.z.string().optional().describe("Where people reach the controller about their data."),
2117
+ address: import_zod6.z.string().optional(),
2118
+ dpoContact: import_zod6.z.string().optional().describe("The Data Protection Officer: a name, an email address, or both.")
1776
2119
  },
1777
2120
  (a) => client.org.controller.set({
1778
2121
  legalName: a.legalName,
@@ -1792,11 +2135,11 @@ ${JSON.stringify(r, null, 2)}` : r;
1792
2135
  );
1793
2136
  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.";
1794
2137
  const captchaInput = {
1795
- mode: import_zod5.z.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
1796
- provider: import_zod5.z.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
1797
- siteKey: import_zod5.z.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
1798
- secret: import_zod5.z.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
1799
- minScore: import_zod5.z.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
2138
+ mode: import_zod6.z.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
2139
+ provider: import_zod6.z.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
2140
+ siteKey: import_zod6.z.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
2141
+ secret: import_zod6.z.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
2142
+ minScore: import_zod6.z.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
1800
2143
  };
1801
2144
  const captchaBody = (a) => ({
1802
2145
  mode: a.mode,
@@ -1808,37 +2151,37 @@ ${JSON.stringify(r, null, 2)}` : r;
1808
2151
  tool(
1809
2152
  "get_consent_sync_secret",
1810
2153
  "Whether hosted consent sync is set up for a site: `configured`, `secretLast4`, `createdAt`. Never returns the secret. Read-only.",
1811
- { cbid: import_zod5.z.string() },
2154
+ { cbid: import_zod6.z.string() },
1812
2155
  (a) => client.consentSyncSecret.get(a.cbid)
1813
2156
  );
1814
2157
  tool(
1815
2158
  "rotate_consent_sync_secret",
1816
2159
  "Mint a site\u2019s consent-sync signing secret, or rotate it. The answer carries `secret` this once; the site owner\u2019s server signs consent-sync tokens with it (mintConsentSyncToken in @cookiemunch/sdk). Rotating stops the old secret at once, so every page holding a token signed with it stops syncing until it gets a new token. Never put the secret in a page. Needs sites:write and consent:write.",
1817
- { cbid: import_zod5.z.string() },
2160
+ { cbid: import_zod6.z.string() },
1818
2161
  (a) => client.consentSyncSecret.rotate(a.cbid)
1819
2162
  );
1820
2163
  tool(
1821
2164
  "remove_consent_sync_secret",
1822
2165
  "Remove a site\u2019s consent-sync secret: hosted consent sync stops until a new one is minted. Needs sites:write and consent:write.",
1823
- { cbid: import_zod5.z.string() },
2166
+ { cbid: import_zod6.z.string() },
1824
2167
  (a) => client.consentSyncSecret.remove(a.cbid)
1825
2168
  );
1826
2169
  tool(
1827
2170
  "get_rights_captcha",
1828
2171
  "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.",
1829
- { cbid: import_zod5.z.string() },
2172
+ { cbid: import_zod6.z.string() },
1830
2173
  (a) => client.rightsCaptcha.get(a.cbid)
1831
2174
  );
1832
2175
  tool(
1833
2176
  "set_rights_captcha",
1834
2177
  `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.`,
1835
- { cbid: import_zod5.z.string(), ...captchaInput },
2178
+ { cbid: import_zod6.z.string(), ...captchaInput },
1836
2179
  (a) => client.rightsCaptcha.set(a.cbid, captchaBody(a))
1837
2180
  );
1838
2181
  tool(
1839
2182
  "remove_rights_captcha",
1840
2183
  "Remove a site\u2019s own captcha setting: it inherits the organisation default again (or off). Returns the setting now in force.",
1841
- { cbid: import_zod5.z.string() },
2184
+ { cbid: import_zod6.z.string() },
1842
2185
  (a) => client.rightsCaptcha.remove(a.cbid)
1843
2186
  );
1844
2187
  tool(
@@ -1861,15 +2204,15 @@ ${JSON.stringify(r, null, 2)}` : r;
1861
2204
  );
1862
2205
  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.";
1863
2206
  const identityInput = {
1864
- 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)."),
1865
- issuer: import_zod5.z.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
1866
- jwksUrl: import_zod5.z.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
1867
- 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)."),
1868
- 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."),
1869
- emailClaim: import_zod5.z.string().optional().describe("Default email."),
1870
- emailVerifiedClaim: import_zod5.z.string().optional().describe("Default email_verified; must be exactly true."),
1871
- sessionCookieName: import_zod5.z.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
1872
- 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.")
2207
+ type: import_zod6.z.enum(["clerk", "atlas", "oidc_jwt"]).describe("clerk, atlas (Clerk-shaped), or oidc_jwt (any issuer that signs session JWTs with a published JWKS)."),
2208
+ issuer: import_zod6.z.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
2209
+ jwksUrl: import_zod6.z.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
2210
+ audience: import_zod6.z.string().optional().describe("Expected aud. For oidc_jwt an audience or authorizedParties is required (a shared issuer mints tokens for every app)."),
2211
+ authorizedParties: import_zod6.z.array(import_zod6.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."),
2212
+ emailClaim: import_zod6.z.string().optional().describe("Default email."),
2213
+ emailVerifiedClaim: import_zod6.z.string().optional().describe("Default email_verified; must be exactly true."),
2214
+ sessionCookieName: import_zod6.z.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
2215
+ trustEmailClaim: import_zod6.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.")
1873
2216
  };
1874
2217
  const identityBody = (a) => {
1875
2218
  const out = { type: a.type, issuer: a.issuer };
@@ -1879,19 +2222,19 @@ ${JSON.stringify(r, null, 2)}` : r;
1879
2222
  tool(
1880
2223
  "get_rights_identity",
1881
2224
  "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.",
1882
- { cbid: import_zod5.z.string() },
2225
+ { cbid: import_zod6.z.string() },
1883
2226
  (a) => client.rightsIdentity.get(a.cbid)
1884
2227
  );
1885
2228
  tool(
1886
2229
  "set_rights_identity",
1887
2230
  `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.`,
1888
- { cbid: import_zod5.z.string(), ...identityInput },
2231
+ { cbid: import_zod6.z.string(), ...identityInput },
1889
2232
  (a) => client.rightsIdentity.set(a.cbid, identityBody(a))
1890
2233
  );
1891
2234
  tool(
1892
2235
  "remove_rights_identity",
1893
2236
  "Remove a site\u2019s own sign-in provider: it inherits the organisation default again (or none). Returns the setting now in force.",
1894
- { cbid: import_zod5.z.string() },
2237
+ { cbid: import_zod6.z.string() },
1895
2238
  (a) => client.rightsIdentity.remove(a.cbid)
1896
2239
  );
1897
2240
  tool(
@@ -1915,22 +2258,40 @@ ${JSON.stringify(r, null, 2)}` : r;
1915
2258
  tool(
1916
2259
  "get_audit_log",
1917
2260
  "The organisation\u2019s audit log, newest first: administrative changes made in the dashboard or through the API, and who made them. Read-only.",
1918
- { limit: import_zod5.z.number().int().min(1).max(500).optional() },
1919
- (a) => client.audit(a.limit)
2261
+ { limit: import_zod6.z.number().int().min(1).max(500).optional(), actor: import_zod6.z.string().optional().describe('"self" for this key\u2019s own rows (allowed for scoped keys), or one actor id.') },
2262
+ (a) => client.audit(a.limit, a.actor ? { actor: a.actor } : void 0)
2263
+ );
2264
+ tool(
2265
+ "get_audit_sink",
2266
+ "Where the organisation\u2019s audit log is streamed (as CloudEvents) and how the last delivery went. Never the secret. Read-only.",
2267
+ {},
2268
+ () => client.auditSink.get()
2269
+ );
2270
+ tool(
2271
+ "set_audit_sink",
2272
+ "Stream the organisation\u2019s audit log to an HTTPS endpoint as CloudEvents 1.0, signed like webhooks. Replaces any sink. A generated secret is returned once. Audited.",
2273
+ { type: import_zod6.z.literal("webhook"), url: import_zod6.z.string(), secret: import_zod6.z.string().optional().describe("16\u2013256 characters; omitted: one is generated.") },
2274
+ (a) => client.auditSink.set({ type: "webhook", url: a.url, ...a.secret ? { secret: a.secret } : {} })
2275
+ );
2276
+ tool(
2277
+ "remove_audit_sink",
2278
+ "Stop streaming the audit log. Audited.",
2279
+ {},
2280
+ () => client.auditSink.remove()
1920
2281
  );
1921
2282
  tool(
1922
2283
  "upload_asset",
1923
2284
  "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.",
1924
2285
  {
1925
- data: import_zod5.z.string(),
1926
- contentType: import_zod5.z.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
2286
+ data: import_zod6.z.string(),
2287
+ contentType: import_zod6.z.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
1927
2288
  },
1928
2289
  (a) => client.assets.upload({ data: a.data, contentType: a.contentType })
1929
2290
  );
1930
2291
  tool(
1931
2292
  "delete_asset",
1932
2293
  "Delete a stored image by its URL (or file name). Only your own organisation\u2019s images can be named.",
1933
- { url: import_zod5.z.string().describe("The URL upload_asset returned, or just its file name.") },
2294
+ { url: import_zod6.z.string().describe("The URL upload_asset returned, or just its file name.") },
1934
2295
  async (a) => {
1935
2296
  await client.assets.delete(a.url);
1936
2297
  return { deleted: a.url };
@@ -1945,18 +2306,18 @@ ${JSON.stringify(r, null, 2)}` : r;
1945
2306
  tool(
1946
2307
  "get_customer",
1947
2308
  "One child org: its controller details and usage. Read-only.",
1948
- { id: import_zod5.z.string() },
2309
+ { id: import_zod6.z.string() },
1949
2310
  (a) => client.reseller.get(a.id)
1950
2311
  );
1951
2312
  tool(
1952
2313
  "provision_customer",
1953
2314
  "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.",
1954
2315
  {
1955
- name: import_zod5.z.string(),
1956
- ownerEmail: import_zod5.z.string().optional(),
1957
- delegatedAccess: import_zod5.z.boolean().optional().describe("Whether this reseller may act inside the child."),
1958
- mintKey: import_zod5.z.boolean().optional(),
1959
- keyScopes: import_zod5.z.array(import_zod5.z.string()).optional()
2316
+ name: import_zod6.z.string(),
2317
+ ownerEmail: import_zod6.z.string().optional(),
2318
+ delegatedAccess: import_zod6.z.boolean().optional().describe("Whether this reseller may act inside the child."),
2319
+ mintKey: import_zod6.z.boolean().optional(),
2320
+ keyScopes: import_zod6.z.array(import_zod6.z.string()).optional()
1960
2321
  },
1961
2322
  (a) => client.reseller.create({
1962
2323
  name: a.name,
@@ -1970,10 +2331,10 @@ ${JSON.stringify(r, null, 2)}` : r;
1970
2331
  "update_customer",
1971
2332
  "Change a child org\u2019s status, delegated access or DSAR routing. `dsarRouting: null` clears the override.",
1972
2333
  {
1973
- id: import_zod5.z.string(),
1974
- status: import_zod5.z.enum(["active", "suspended"]).optional(),
1975
- delegatedAccess: import_zod5.z.boolean().optional(),
1976
- dsarRouting: import_zod5.z.enum(["reseller", "child"]).nullable().optional()
2334
+ id: import_zod6.z.string(),
2335
+ status: import_zod6.z.enum(["active", "suspended"]).optional(),
2336
+ delegatedAccess: import_zod6.z.boolean().optional(),
2337
+ dsarRouting: import_zod6.z.enum(["reseller", "child"]).nullable().optional()
1977
2338
  },
1978
2339
  (a) => client.reseller.update(a.id, {
1979
2340
  ...a.status ? { status: a.status } : {},
@@ -1984,7 +2345,7 @@ ${JSON.stringify(r, null, 2)}` : r;
1984
2345
  tool(
1985
2346
  "suspend_customer",
1986
2347
  "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.)",
1987
- { id: import_zod5.z.string() },
2348
+ { id: import_zod6.z.string() },
1988
2349
  async (a) => {
1989
2350
  await client.reseller.deprovision(a.id);
1990
2351
  return { suspended: a.id };
@@ -1993,78 +2354,78 @@ ${JSON.stringify(r, null, 2)}` : r;
1993
2354
  tool(
1994
2355
  "list_customer_keys",
1995
2356
  "A child org's API key prefixes. Never the secrets. Read-only.",
1996
- { id: import_zod5.z.string() },
2357
+ { id: import_zod6.z.string() },
1997
2358
  (a) => client.reseller.listKeys(a.id)
1998
2359
  );
1999
2360
  tool(
2000
2361
  "issue_customer_key",
2001
2362
  "Mint an API key for a child org. The secret is returned once. Prefer scopes and a property lock over a full-access key.",
2002
- { 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() },
2363
+ { id: import_zod6.z.string(), name: import_zod6.z.string().optional(), scopes: import_zod6.z.array(import_zod6.z.string()).optional(), cbids: import_zod6.z.array(import_zod6.z.string()).min(1).optional() },
2003
2364
  (a) => client.reseller.mintKey(a.id, {
2004
2365
  ...a.name ? { name: a.name } : {},
2005
2366
  ...a.scopes ? { scopes: a.scopes } : {},
2006
2367
  ...a.cbids ? { cbids: a.cbids } : {}
2007
2368
  })
2008
2369
  );
2009
- 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) => {
2370
+ tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: import_zod6.z.string(), prefix: import_zod6.z.string() }, async (a) => {
2010
2371
  await client.reseller.revokeKey(a.id, a.prefix);
2011
2372
  return { revoked: a.prefix };
2012
2373
  });
2013
2374
  tool(
2014
2375
  "erase_subject_data",
2015
2376
  "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.",
2016
- { cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
2377
+ { cbid: import_zod6.z.string(), stamp: import_zod6.z.string() },
2017
2378
  (a) => client.consent.eraseSubject(a.cbid, a.stamp)
2018
2379
  );
2019
2380
  tool(
2020
2381
  "export_subject_data",
2021
2382
  "Export a data subject's consent records (GDPR access/portability).",
2022
- { cbid: import_zod5.z.string(), stamp: import_zod5.z.string() },
2383
+ { cbid: import_zod6.z.string(), stamp: import_zod6.z.string() },
2023
2384
  (a) => client.consent.exportSubject(a.cbid, a.stamp)
2024
2385
  );
2025
2386
  tool("list_banners", "List reusable banner designs in your org.", {}, () => client.banners.list());
2026
2387
  tool(
2027
2388
  "create_banner",
2028
2389
  "Create a reusable banner design.",
2029
- { name: import_zod5.z.string(), json: import_zod5.z.record(import_zod5.z.unknown()).describe("A v2 BannerConfig.") },
2390
+ { name: import_zod6.z.string(), json: import_zod6.z.record(import_zod6.z.unknown()).describe("A v2 BannerConfig.") },
2030
2391
  (a) => client.banners.create({ name: a.name, json: a.json })
2031
2392
  );
2032
- tool("get_banner", "Get a banner design by id.", { id: import_zod5.z.string() }, (a) => client.banners.get(a.id));
2393
+ tool("get_banner", "Get a banner design by id.", { id: import_zod6.z.string() }, (a) => client.banners.get(a.id));
2033
2394
  tool(
2034
2395
  "update_banner",
2035
2396
  "Update a banner design (name and/or config).",
2036
- { id: import_zod5.z.string(), name: import_zod5.z.string().optional(), json: import_zod5.z.record(import_zod5.z.unknown()).optional() },
2397
+ { id: import_zod6.z.string(), name: import_zod6.z.string().optional(), json: import_zod6.z.record(import_zod6.z.unknown()).optional() },
2037
2398
  (a) => client.banners.update(a.id, {
2038
2399
  ...a.name !== void 0 ? { name: a.name } : {},
2039
2400
  ...a.json !== void 0 ? { json: a.json } : {}
2040
2401
  })
2041
2402
  );
2042
- tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: import_zod5.z.string() }, async (a) => {
2403
+ tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: import_zod6.z.string() }, async (a) => {
2043
2404
  await client.banners.delete(a.id);
2044
2405
  return { ok: true };
2045
2406
  });
2046
2407
  tool(
2047
2408
  "get_banner_assignments",
2048
2409
  "The sites (cbids) a banner design is currently assigned to. Read-only.",
2049
- { id: import_zod5.z.string() },
2410
+ { id: import_zod6.z.string() },
2050
2411
  (a) => client.banners.assignments(a.id)
2051
2412
  );
2052
2413
  tool(
2053
2414
  "assign_banner",
2054
2415
  "Set which sites (cbids) use a banner design.",
2055
- { id: import_zod5.z.string(), cbids: import_zod5.z.array(import_zod5.z.string()) },
2416
+ { id: import_zod6.z.string(), cbids: import_zod6.z.array(import_zod6.z.string()) },
2056
2417
  (a) => client.banners.setAssignments(a.id, a.cbids)
2057
2418
  );
2058
2419
  tool(
2059
2420
  "publish_banner",
2060
2421
  "Publish a design live to all its assigned sites.",
2061
- { id: import_zod5.z.string() },
2422
+ { id: import_zod6.z.string() },
2062
2423
  (a) => client.banners.publish(a.id)
2063
2424
  );
2064
2425
  }
2065
2426
 
2066
2427
  // src/index.ts
2067
- var MCP_VERSION = "0.5.0";
2428
+ var MCP_VERSION = "0.7.0";
2068
2429
  function createCookieMunchMcp(opts) {
2069
2430
  const client = opts.client ?? (0, import_sdk.createCookieMunch)({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
2070
2431
  const server = new import_mcp.McpServer({ name: "cookiemunch", version: "1.0.0" });