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