@cookiemunch/mcp 0.4.1 → 0.6.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/CHANGELOG.md +16 -0
- package/dist/bin.cjs +629 -228
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-WGUF6SJH.js → chunk-6NEWNBRL.js} +630 -229
- package/dist/chunk-6NEWNBRL.js.map +1 -0
- package/dist/index.cjs +629 -228
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-WGUF6SJH.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 z6 } from "zod";
|
|
7
7
|
|
|
8
8
|
// src/tools-config.ts
|
|
9
9
|
import { z } from "zod";
|
|
@@ -534,6 +534,12 @@ function registerPlatformTools(tool, client) {
|
|
|
534
534
|
{},
|
|
535
535
|
() => client.fulfillment.executors()
|
|
536
536
|
);
|
|
537
|
+
tool(
|
|
538
|
+
"get_dsar_executor",
|
|
539
|
+
"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.",
|
|
540
|
+
{ id: z2.string().describe("The connection id.") },
|
|
541
|
+
(a) => client.fulfillment.executor(a.id)
|
|
542
|
+
);
|
|
537
543
|
tool(
|
|
538
544
|
"connect_dsar_executor",
|
|
539
545
|
"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.",
|
|
@@ -541,12 +547,15 @@ function registerPlatformTools(tool, client) {
|
|
|
541
547
|
preset: z2.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."),
|
|
542
548
|
presetVersion: z2.number().int().optional().describe("With preset: the version to build. Default the latest."),
|
|
543
549
|
orgId: z2.string().optional().describe("A preset param, when the preset's params list it."),
|
|
544
|
-
atlasIdAppId: z2.string().optional().describe("A preset param, when the preset's params list it: the identity platform's app id,
|
|
550
|
+
atlasIdAppId: z2.string().optional().describe("A preset param, when the preset's params list it: the identity platform's app id, kept for revokeAtlasIdGrant."),
|
|
551
|
+
revokeAtlasIdGrant: z2.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."),
|
|
552
|
+
label: z2.string().optional().describe("Your name for the credential, shown beside keyPrefix."),
|
|
545
553
|
system: z2.string().optional().describe("The name this connection answers to in a plan, e.g. identity or crm. Required unless the preset has a default."),
|
|
546
554
|
baseUrl: z2.string().optional().describe("The system's public https origin. Required unless the preset sets it."),
|
|
547
555
|
secretKey: z2.string().describe("Its API key, with whatever scope that system needs to export and erase a user."),
|
|
548
556
|
webhookSecret: z2.string().optional().describe("Signing secret of its webhook endpoint. Optional: polling closes tasks without it."),
|
|
549
557
|
auto: z2.boolean().optional().describe("Open a sub-task automatically when a request reaches fulfilment. Default true."),
|
|
558
|
+
orchestrator: z2.union([z2.literal(1), z2.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."),
|
|
550
559
|
profile: z2.record(z2.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."),
|
|
551
560
|
dryRun: z2.boolean().optional().describe("Validate everything and answer the connection that would be created, storing nothing.")
|
|
552
561
|
},
|
|
@@ -555,6 +564,12 @@ function registerPlatformTools(tool, client) {
|
|
|
555
564
|
return dryRun === true ? client.fulfillment.dryRunConnectExecutor(input) : client.fulfillment.connectExecutor(input);
|
|
556
565
|
}
|
|
557
566
|
);
|
|
567
|
+
tool(
|
|
568
|
+
"get_category_registry",
|
|
569
|
+
"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.",
|
|
570
|
+
{},
|
|
571
|
+
() => client.consent.categoryRegistry()
|
|
572
|
+
);
|
|
558
573
|
tool(
|
|
559
574
|
"list_dsar_executor_presets",
|
|
560
575
|
"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.",
|
|
@@ -563,13 +578,15 @@ function registerPlatformTools(tool, client) {
|
|
|
563
578
|
);
|
|
564
579
|
tool(
|
|
565
580
|
"upgrade_dsar_executor_preset",
|
|
566
|
-
"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.
|
|
581
|
+
"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.",
|
|
567
582
|
{
|
|
568
583
|
id: z2.string().describe("The connection id."),
|
|
569
584
|
preset: z2.string().optional().describe("Only to adopt a preset on a connection that has none."),
|
|
570
585
|
presetVersion: z2.number().int().optional(),
|
|
571
586
|
orgId: z2.string().optional(),
|
|
572
587
|
atlasIdAppId: z2.string().optional(),
|
|
588
|
+
revokeAtlasIdGrant: z2.boolean().optional(),
|
|
589
|
+
acceptPreset: z2.array(z2.string()).optional().describe(`Overridden paths (profileOverrides) that take the preset's value again, e.g. ["profile.grantRevoke"]. Every other override is kept.`),
|
|
573
590
|
dryRun: z2.boolean().optional().describe("Answer the diff and change nothing.")
|
|
574
591
|
},
|
|
575
592
|
(a) => {
|
|
@@ -593,6 +610,18 @@ function registerPlatformTools(tool, client) {
|
|
|
593
610
|
{ id: z2.string().describe("The connection id.") },
|
|
594
611
|
(a) => client.fulfillment.executorWebhookDeliveries(a.id)
|
|
595
612
|
);
|
|
613
|
+
tool(
|
|
614
|
+
"recheck_dsar_executor",
|
|
615
|
+
"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.",
|
|
616
|
+
{ id: z2.string().describe("The connection id.") },
|
|
617
|
+
(a) => client.fulfillment.recheckExecutor(a.id)
|
|
618
|
+
);
|
|
619
|
+
tool(
|
|
620
|
+
"list_dsar_executor_health_history",
|
|
621
|
+
"A connected system's last health checks, newest first (each with ok, verdict and lastCheckedAt). Read-only.",
|
|
622
|
+
{ id: z2.string().describe("The connection id."), limit: z2.number().int().min(1).max(50).optional().describe("Default 50.") },
|
|
623
|
+
(a) => client.fulfillment.executorHealthHistory(a.id, typeof a.limit === "number" ? { limit: a.limit } : {})
|
|
624
|
+
);
|
|
596
625
|
tool(
|
|
597
626
|
"disconnect_dsar_executor",
|
|
598
627
|
"Disconnect a system. Its open sub-tasks stop being driven, and the stored credentials are deleted.",
|
|
@@ -625,6 +654,18 @@ function registerPlatformTools(tool, client) {
|
|
|
625
654
|
...typeof a.open === "boolean" ? { open: a.open } : {}
|
|
626
655
|
})
|
|
627
656
|
);
|
|
657
|
+
tool(
|
|
658
|
+
"run_executor_conformance",
|
|
659
|
+
"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.",
|
|
660
|
+
{ id: z2.string().describe("The connection id.") },
|
|
661
|
+
(a) => client.fulfillment.executorConformance(a.id)
|
|
662
|
+
);
|
|
663
|
+
tool(
|
|
664
|
+
"roll_executor_completion_secret",
|
|
665
|
+
"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.",
|
|
666
|
+
{ id: z2.string().describe("The connection id.") },
|
|
667
|
+
(a) => client.fulfillment.rollExecutorCompletionSecret(a.id)
|
|
668
|
+
);
|
|
628
669
|
tool(
|
|
629
670
|
"get_dsar_task_export",
|
|
630
671
|
"The export bundle a connected system produced for one sub-task, fetched from that system on demand. The platform keeps no copy.",
|
|
@@ -731,13 +772,44 @@ function registerIntegrationTools(tool, client) {
|
|
|
731
772
|
{ cbid: z3.string().optional().describe("Site identifier; optional when the org has one site.") },
|
|
732
773
|
(a) => client.integrationHealth(a.cbid)
|
|
733
774
|
);
|
|
775
|
+
tool(
|
|
776
|
+
"list_health_waivers",
|
|
777
|
+
"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.",
|
|
778
|
+
{ cbid: z3.string().optional().describe("Site identifier; optional when the org has one site.") },
|
|
779
|
+
(a) => client.healthWaivers.list(a.cbid)
|
|
780
|
+
);
|
|
781
|
+
const waiverSchema = z3.object({
|
|
782
|
+
cbid: z3.string().optional().describe("Site identifier; optional when the org has one site."),
|
|
783
|
+
check: z3.string().describe("A row\u2019s check or kind, e.g. atlas.cookie_consent."),
|
|
784
|
+
subject: z3.string().optional().describe("A row\u2019s subject; omitted: every subject of the check."),
|
|
785
|
+
reason: z3.string().describe("Why this is deliberate (shown on the row and in the audit log)."),
|
|
786
|
+
until: z3.union([z3.string(), z3.number()]).nullable().optional().describe("When the waiver ends (ISO date or epoch ms, within a year); omitted: never.")
|
|
787
|
+
});
|
|
788
|
+
tool(
|
|
789
|
+
"set_health_waiver",
|
|
790
|
+
"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.",
|
|
791
|
+
waiverSchema.shape,
|
|
792
|
+
(a) => client.healthWaivers.set(waiverSchema.parse(a))
|
|
793
|
+
);
|
|
794
|
+
tool(
|
|
795
|
+
"remove_health_waiver",
|
|
796
|
+
"Remove an integration-health waiver, so the check reports its real state again. Audited.",
|
|
797
|
+
{ check: z3.string(), cbid: z3.string().optional(), subject: z3.string().optional().describe("Default: every subject (*).") },
|
|
798
|
+
(a) => client.healthWaivers.remove(a.check, { ...a.cbid ? { cbid: a.cbid } : {}, ...a.subject ? { subject: a.subject } : {} })
|
|
799
|
+
);
|
|
800
|
+
tool(
|
|
801
|
+
"get_embed_manifest",
|
|
802
|
+
"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.",
|
|
803
|
+
{ cbid: z3.string() },
|
|
804
|
+
(a) => client.embedManifest(a.cbid)
|
|
805
|
+
);
|
|
734
806
|
const provisionSchema = z3.object({
|
|
735
807
|
product: z3.string().describe("A slug naming the product."),
|
|
736
808
|
domain: z3.string().describe("The product\u2019s domain (bare hostname)."),
|
|
737
809
|
name: z3.string().optional(),
|
|
738
810
|
aliases: z3.array(z3.string()).optional(),
|
|
739
811
|
cbid: z3.string().optional().describe("Update this site instead of matching by domain."),
|
|
740
|
-
atlas: z3.object({ secretKey: z3.string(), cookieConsent: z3.boolean().optional(), dsrWebhook: z3.boolean().optional(), frontendApiHost: z3.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."),
|
|
812
|
+
atlas: z3.object({ secretKey: z3.string(), cookieConsent: z3.boolean().optional(), dsrWebhook: z3.boolean().optional(), rightsIdentity: z3.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: z3.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."),
|
|
741
813
|
forumulate: z3.object({ token: z3.string(), orgId: z3.string(), consent: z3.boolean().optional(), executorKey: z3.boolean().optional(), label: z3.string().optional() }).optional().describe("Forumulate org token \u2014 used for this call only, never stored or returned."),
|
|
742
814
|
rightsApi: z3.object({ baseUrl: z3.string(), secretKey: z3.string(), profilePreset: z3.string().optional() }).optional(),
|
|
743
815
|
dryRun: z3.boolean().optional().describe("Report what each step would do; write nothing on any platform. Run this first.")
|
|
@@ -753,13 +825,13 @@ function registerIntegrationTools(tool, client) {
|
|
|
753
825
|
);
|
|
754
826
|
tool(
|
|
755
827
|
"list_site_partners",
|
|
756
|
-
"Which partner platforms
|
|
828
|
+
"Which partner platforms receive this site\u2019s consent events, each with its status, and which partners are on offer. Read-only.",
|
|
757
829
|
{ cbid: z3.string() },
|
|
758
830
|
(a) => client.sites.listPartners(a.cbid)
|
|
759
831
|
);
|
|
760
832
|
const linkSchema = z3.object({
|
|
761
833
|
cbid: z3.string(),
|
|
762
|
-
partner: z3.
|
|
834
|
+
partner: z3.string().describe("A partner this deployment knows: forumulate, atlas, chatly, referalli, or any other registered on it (list_site_partners shows them)."),
|
|
763
835
|
externalId: z3.string().describe("The partner\u2019s id for the receiving account, e.g. a Forumulate organisation id."),
|
|
764
836
|
label: z3.string().optional().describe('Shown with the partner name, e.g. "docs".'),
|
|
765
837
|
events: z3.array(z3.enum(["consent.recorded", "consent.withdrawn"])).optional(),
|
|
@@ -782,31 +854,120 @@ function registerIntegrationTools(tool, client) {
|
|
|
782
854
|
);
|
|
783
855
|
}
|
|
784
856
|
|
|
785
|
-
// src/tools-
|
|
857
|
+
// src/tools-keys-tags.ts
|
|
786
858
|
import { z as z4 } from "zod";
|
|
859
|
+
var TAGGED = ["org", "site", "webhook", "executor", "dsar", "partner_link"];
|
|
860
|
+
function registerKeyAndTagTools(tool, client) {
|
|
861
|
+
tool(
|
|
862
|
+
"get_own_key",
|
|
863
|
+
"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.",
|
|
864
|
+
{},
|
|
865
|
+
() => client.keys.self()
|
|
866
|
+
);
|
|
867
|
+
tool(
|
|
868
|
+
"list_api_keys_standard",
|
|
869
|
+
"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.",
|
|
870
|
+
{},
|
|
871
|
+
() => client.keys.listStandard()
|
|
872
|
+
);
|
|
873
|
+
const vendSchema = z4.object({
|
|
874
|
+
scopes: z4.array(z4.string()).min(1).describe("A subset of this key\u2019s own scopes."),
|
|
875
|
+
ttlSeconds: z4.number().int().min(60).max(43200).describe("How long the key works, at most 12 hours."),
|
|
876
|
+
cbids: z4.array(z4.string()).min(1).optional().describe("Lock it to these sites (within this key\u2019s own lock)."),
|
|
877
|
+
name: z4.string().max(100).optional()
|
|
878
|
+
});
|
|
879
|
+
tool(
|
|
880
|
+
"vend_api_key",
|
|
881
|
+
"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.",
|
|
882
|
+
vendSchema.shape,
|
|
883
|
+
(a) => client.keys.vend(vendSchema.parse(a))
|
|
884
|
+
);
|
|
885
|
+
tool(
|
|
886
|
+
"revoke_leaked_key",
|
|
887
|
+
"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.",
|
|
888
|
+
{ key: z4.string().describe("The leaked secret, whole."), source: z4.string().optional().describe("Where it was found (a URL).") },
|
|
889
|
+
(a) => client.keys.revokeLeaked({ key: a.key, ...a.source ? { source: a.source } : {} })
|
|
890
|
+
);
|
|
891
|
+
tool(
|
|
892
|
+
"get_resource_tags",
|
|
893
|
+
"A resource\u2019s tags (metadata), its externalRef and whether it is a sandbox. Read-only.",
|
|
894
|
+
{ type: z4.enum(TAGGED), id: z4.string() },
|
|
895
|
+
(a) => client.metadata.get(a.type, a.id)
|
|
896
|
+
);
|
|
897
|
+
const tagsSchema = z4.object({
|
|
898
|
+
type: z4.enum(TAGGED),
|
|
899
|
+
id: z4.string(),
|
|
900
|
+
metadata: z4.record(z4.union([z4.string(), z4.number(), z4.boolean(), z4.null()])).describe("Keys to set; null removes one. forgedeck_sandbox cannot be set here."),
|
|
901
|
+
dryRun: z4.boolean().optional().describe("Answer with the diff, storing nothing. Do this first.")
|
|
902
|
+
});
|
|
903
|
+
tool(
|
|
904
|
+
"update_resource_tags",
|
|
905
|
+
"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.",
|
|
906
|
+
tagsSchema.shape,
|
|
907
|
+
(a) => {
|
|
908
|
+
const { type, id, metadata, dryRun } = tagsSchema.parse(a);
|
|
909
|
+
return client.metadata.update(type, id, metadata, { dryRun });
|
|
910
|
+
}
|
|
911
|
+
);
|
|
912
|
+
tool(
|
|
913
|
+
"list_partner_links",
|
|
914
|
+
"Every partner link of the organisation (site and org links), with scopes, expiry, last use and calls in the last 30 days. Read-only.",
|
|
915
|
+
{ metadata: z4.record(z4.string()).optional().describe("Keep only links with these tags.") },
|
|
916
|
+
(a) => client.partnerLinks.list(a.metadata ? { metadata: a.metadata } : void 0)
|
|
917
|
+
);
|
|
918
|
+
const linkSchema = z4.object({
|
|
919
|
+
partner: z4.string().describe("A partner this deployment knows (built in or registered)."),
|
|
920
|
+
resource: z4.string().describe("site:<cbid> or org:<this org id>."),
|
|
921
|
+
scopes: z4.array(z4.enum(["consent:read", "receipt:read", "dsar:read", "dsar:write", "dsar:rights-links", "sites:read"])).min(1),
|
|
922
|
+
expires_at: z4.string().optional().describe("ISO 8601, in the future."),
|
|
923
|
+
externalId: z4.string().optional(),
|
|
924
|
+
label: z4.string().max(60).optional()
|
|
925
|
+
});
|
|
926
|
+
tool(
|
|
927
|
+
"create_partner_link",
|
|
928
|
+
"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.",
|
|
929
|
+
linkSchema.shape,
|
|
930
|
+
(a) => client.partnerLinks.create(linkSchema.parse(a))
|
|
931
|
+
);
|
|
932
|
+
tool(
|
|
933
|
+
"revoke_partner_link",
|
|
934
|
+
"Revoke a partner link: the partner\u2019s calls under it and its deliveries stop at once.",
|
|
935
|
+
{ id: z4.string() },
|
|
936
|
+
(a) => client.partnerLinks.revoke(a.id)
|
|
937
|
+
);
|
|
938
|
+
tool(
|
|
939
|
+
"get_provision_env",
|
|
940
|
+
"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.",
|
|
941
|
+
{ ref: z4.string() },
|
|
942
|
+
(a) => client.provisionEnv(a.ref)
|
|
943
|
+
);
|
|
944
|
+
}
|
|
945
|
+
|
|
946
|
+
// src/tools-rights-page.ts
|
|
947
|
+
import { z as z5 } from "zod";
|
|
787
948
|
function registerRightsTools(tool, client) {
|
|
788
|
-
const cbid = { cbid:
|
|
949
|
+
const cbid = { cbid: z5.string().describe("Site identifier (cbid). Must belong to your org.") };
|
|
789
950
|
const base = {
|
|
790
|
-
baseUpdatedAt:
|
|
951
|
+
baseUpdatedAt: z5.union([z5.number().int(), z5.string(), z5.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.")
|
|
791
952
|
};
|
|
792
953
|
const baseOpt = (a) => a.baseUpdatedAt !== void 0 ? { baseUpdatedAt: a.baseUpdatedAt } : {};
|
|
793
954
|
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));
|
|
794
955
|
tool(
|
|
795
956
|
"update_rights_page",
|
|
796
957
|
"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.",
|
|
797
|
-
{ ...cbid, page:
|
|
958
|
+
{ ...cbid, page: z5.record(z5.unknown()).describe("The whole RightsPage document (v: 1)."), ...base },
|
|
798
959
|
(a) => client.rightsPage.put(a.cbid, a.page, baseOpt(a))
|
|
799
960
|
);
|
|
800
961
|
tool(
|
|
801
962
|
"patch_rights_page",
|
|
802
963
|
"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).",
|
|
803
|
-
{ ...cbid, patch:
|
|
964
|
+
{ ...cbid, patch: z5.record(z5.unknown()), ...base },
|
|
804
965
|
(a) => client.rightsPage.patch(a.cbid, a.patch, baseOpt(a))
|
|
805
966
|
);
|
|
806
967
|
tool(
|
|
807
968
|
"preview_rights_page",
|
|
808
969
|
'Validate a rights-page write WITHOUT saving: returns the document as it would be stored and any publish warnings. mode "patch" (default) or "put".',
|
|
809
|
-
{ ...cbid, page:
|
|
970
|
+
{ ...cbid, page: z5.record(z5.unknown()), mode: z5.enum(["patch", "put"]).optional() },
|
|
810
971
|
(a) => client.rightsPage.dryRun(a.cbid, a.page, { mode: a.mode ?? "patch" })
|
|
811
972
|
);
|
|
812
973
|
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));
|
|
@@ -820,14 +981,14 @@ function registerRightsTools(tool, client) {
|
|
|
820
981
|
tool(
|
|
821
982
|
"rollback_rights_page",
|
|
822
983
|
"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.",
|
|
823
|
-
{ ...cbid, version:
|
|
984
|
+
{ ...cbid, version: z5.number().int().min(1), ...base },
|
|
824
985
|
(a) => client.rightsPage.rollback(a.cbid, a.version, baseOpt(a))
|
|
825
986
|
);
|
|
826
987
|
}
|
|
827
988
|
function registerRightsPageTools(tool, client) {
|
|
828
|
-
const site =
|
|
989
|
+
const site = z5.object({ cbid: z5.string().describe("Site identifier (cbid). Must belong to your org.") });
|
|
829
990
|
const host = site.extend({
|
|
830
|
-
hostname:
|
|
991
|
+
hostname: z5.string().describe("The custom hostname, e.g. privacy.example.com (unicode or punycode).")
|
|
831
992
|
});
|
|
832
993
|
tool(
|
|
833
994
|
"list_rights_page_domains",
|
|
@@ -967,10 +1128,10 @@ function registerTools(server, client) {
|
|
|
967
1128
|
}
|
|
968
1129
|
});
|
|
969
1130
|
};
|
|
970
|
-
const cbid = { cbid:
|
|
1131
|
+
const cbid = { cbid: z6.string().describe("Site identifier (cbid). Must belong to your org.") };
|
|
971
1132
|
const range = {
|
|
972
|
-
from:
|
|
973
|
-
to:
|
|
1133
|
+
from: z6.number().optional().describe("Epoch-ms lower bound."),
|
|
1134
|
+
to: z6.number().optional().describe("Epoch-ms upper bound.")
|
|
974
1135
|
};
|
|
975
1136
|
tool(
|
|
976
1137
|
"whoami",
|
|
@@ -988,19 +1149,19 @@ function registerTools(server, client) {
|
|
|
988
1149
|
tool(
|
|
989
1150
|
"get_site",
|
|
990
1151
|
"One site: its domain, cbid and verification status. Read-only.",
|
|
991
|
-
{ cbid:
|
|
1152
|
+
{ cbid: z6.string() },
|
|
992
1153
|
(a) => client.sites.get(a.cbid)
|
|
993
1154
|
);
|
|
994
1155
|
tool(
|
|
995
1156
|
"get_site_banner",
|
|
996
1157
|
"Which banner design a site uses, or bannerId null when none is assigned. Read-only.",
|
|
997
|
-
{ cbid:
|
|
1158
|
+
{ cbid: z6.string() },
|
|
998
1159
|
(a) => client.sites.banner(a.cbid)
|
|
999
1160
|
);
|
|
1000
1161
|
tool(
|
|
1001
1162
|
"get_privacy_policy",
|
|
1002
1163
|
"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.",
|
|
1003
|
-
{ cbid:
|
|
1164
|
+
{ cbid: z6.string(), contactEmail: z6.string().optional(), effectiveDate: z6.string().optional().describe("YYYY-MM-DD; defaults to today."), jurisdictions: z6.array(z6.string()).optional() },
|
|
1004
1165
|
(a) => client.sites.policy(a.cbid, {
|
|
1005
1166
|
...a.contactEmail ? { contactEmail: a.contactEmail } : {},
|
|
1006
1167
|
...a.effectiveDate ? { effectiveDate: a.effectiveDate } : {},
|
|
@@ -1010,7 +1171,7 @@ function registerTools(server, client) {
|
|
|
1010
1171
|
tool(
|
|
1011
1172
|
"set_ad_personalization",
|
|
1012
1173
|
"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.",
|
|
1013
|
-
{ cbid:
|
|
1174
|
+
{ cbid: z6.string(), enabled: z6.boolean(), default: z6.boolean().optional(), label: z6.string().optional() },
|
|
1014
1175
|
(a) => client.sites.setAdPersonalization(a.cbid, {
|
|
1015
1176
|
enabled: a.enabled,
|
|
1016
1177
|
...a.default !== void 0 ? { default: a.default } : {},
|
|
@@ -1021,11 +1182,11 @@ function registerTools(server, client) {
|
|
|
1021
1182
|
"analyze_session",
|
|
1022
1183
|
"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.",
|
|
1023
1184
|
{
|
|
1024
|
-
cbid:
|
|
1025
|
-
har:
|
|
1026
|
-
requests:
|
|
1027
|
-
consent:
|
|
1028
|
-
gpc:
|
|
1185
|
+
cbid: z6.string(),
|
|
1186
|
+
har: z6.unknown().optional().describe("A HAR export of the session."),
|
|
1187
|
+
requests: z6.array(z6.unknown()).optional().describe("Or the requests directly."),
|
|
1188
|
+
consent: z6.record(z6.string(), z6.boolean()).optional(),
|
|
1189
|
+
gpc: z6.boolean().optional()
|
|
1029
1190
|
},
|
|
1030
1191
|
(a) => client.sites.analyzeSession(a.cbid, {
|
|
1031
1192
|
...a.har !== void 0 ? { har: a.har } : {},
|
|
@@ -1037,14 +1198,14 @@ function registerTools(server, client) {
|
|
|
1037
1198
|
tool(
|
|
1038
1199
|
"create_site",
|
|
1039
1200
|
"Create a new site. The cbid is auto-generated if you omit it.",
|
|
1040
|
-
{ domain:
|
|
1201
|
+
{ domain: z6.string().describe("The site domain, e.g. example.com."), cbid: z6.string().optional().describe("Optional explicit cbid.") },
|
|
1041
1202
|
(a) => client.sites.create({ domain: a.domain, ...typeof a.cbid === "string" ? { cbid: a.cbid } : {} })
|
|
1042
1203
|
);
|
|
1043
1204
|
tool(
|
|
1044
1205
|
"create_sites_bulk",
|
|
1045
1206
|
"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.",
|
|
1046
1207
|
{
|
|
1047
|
-
sites:
|
|
1208
|
+
sites: z6.array(z6.object({ domain: z6.string(), cbid: z6.string().optional(), platform: z6.string().optional() })).min(1).max(100)
|
|
1048
1209
|
},
|
|
1049
1210
|
(a) => client.sites.createBulk(a.sites)
|
|
1050
1211
|
);
|
|
@@ -1054,15 +1215,15 @@ function registerTools(server, client) {
|
|
|
1054
1215
|
"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.",
|
|
1055
1216
|
{
|
|
1056
1217
|
...cbid,
|
|
1057
|
-
config:
|
|
1058
|
-
keepUnspecified:
|
|
1218
|
+
config: z6.record(z6.unknown()).describe("The full SiteConfig to write, not a patch. Without keepUnspecified, omitted top-level fields are NOT preserved from the current config."),
|
|
1219
|
+
keepUnspecified: z6.boolean().optional().describe("PUT ?keep=unspecified: keep the stored value of every top-level field `config` omits, instead of reverting it to its default.")
|
|
1059
1220
|
},
|
|
1060
1221
|
(a) => a.keepUnspecified === true ? client.sites.putConfig(a.cbid, a.config, { keep: "unspecified" }) : client.sites.putConfig(a.cbid, a.config)
|
|
1061
1222
|
);
|
|
1062
1223
|
tool(
|
|
1063
1224
|
"patch_site_config",
|
|
1064
1225
|
`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.`,
|
|
1065
|
-
{ ...cbid, config:
|
|
1226
|
+
{ ...cbid, config: z6.record(z6.unknown()).describe('The subset of SiteConfig to change, e.g. { "banner": { "showRightsLink": true } }. Everything else is preserved; null removes a field.') },
|
|
1066
1227
|
(a) => client.sites.patchConfig(a.cbid, a.config)
|
|
1067
1228
|
);
|
|
1068
1229
|
tool(
|
|
@@ -1070,9 +1231,9 @@ function registerTools(server, client) {
|
|
|
1070
1231
|
'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.',
|
|
1071
1232
|
{
|
|
1072
1233
|
...cbid,
|
|
1073
|
-
config:
|
|
1074
|
-
mode:
|
|
1075
|
-
keepUnspecified:
|
|
1234
|
+
config: z6.record(z6.unknown()).describe('The patch (or, with mode "put", the full config) to preview.'),
|
|
1235
|
+
mode: z6.enum(["patch", "put"]).optional().describe("patch (default) merges; put replaces."),
|
|
1236
|
+
keepUnspecified: z6.boolean().optional().describe('With mode "put": preview update_site_config with keepUnspecified (omitted top-level fields keep their stored value).')
|
|
1076
1237
|
},
|
|
1077
1238
|
(a) => client.sites.dryRunConfig(a.cbid, a.config, {
|
|
1078
1239
|
mode: a.mode ?? "patch",
|
|
@@ -1084,8 +1245,8 @@ function registerTools(server, client) {
|
|
|
1084
1245
|
'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.',
|
|
1085
1246
|
{
|
|
1086
1247
|
...cbid,
|
|
1087
|
-
config:
|
|
1088
|
-
replace:
|
|
1248
|
+
config: z6.record(z6.unknown()).describe("The proposed SiteConfig (or a partial one, or a v2 flow design)."),
|
|
1249
|
+
replace: z6.boolean().optional().describe("Check what update_site_config (a full replace) would store, instead of what patch_site_config (a merge) would.")
|
|
1089
1250
|
},
|
|
1090
1251
|
async (a) => {
|
|
1091
1252
|
const r = await client.sites.lintConfig(a.cbid, a.config, a.replace === true ? { replace: true } : {});
|
|
@@ -1106,10 +1267,16 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1106
1267
|
{ ...cbid, ...range },
|
|
1107
1268
|
(a) => client.consent.stats(a.cbid, { from: a.from, to: a.to })
|
|
1108
1269
|
);
|
|
1270
|
+
tool(
|
|
1271
|
+
"get_consent_insights",
|
|
1272
|
+
"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.",
|
|
1273
|
+
{ ...cbid, ...range },
|
|
1274
|
+
(a) => client.consent.insights(a.cbid, { from: a.from, to: a.to })
|
|
1275
|
+
);
|
|
1109
1276
|
tool(
|
|
1110
1277
|
"get_consent_log",
|
|
1111
1278
|
"Get recent anonymised consent records for a site.",
|
|
1112
|
-
{ ...cbid, ...range, limit:
|
|
1279
|
+
{ ...cbid, ...range, limit: z6.number().optional().describe("Max records to return (default 200).") },
|
|
1113
1280
|
(a) => client.consent.log(a.cbid, {
|
|
1114
1281
|
from: a.from,
|
|
1115
1282
|
to: a.to,
|
|
@@ -1119,54 +1286,54 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1119
1286
|
tool(
|
|
1120
1287
|
"get_subject_consent",
|
|
1121
1288
|
"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.",
|
|
1122
|
-
{ subjectId:
|
|
1289
|
+
{ subjectId: z6.string() },
|
|
1123
1290
|
(a) => client.subjects.consent(a.subjectId)
|
|
1124
1291
|
);
|
|
1125
1292
|
tool("list_dsar", "List all Data Subject Access Requests for your organization.", {}, () => client.dsar.list());
|
|
1126
1293
|
tool(
|
|
1127
1294
|
"update_dsar_executor",
|
|
1128
|
-
"Change a connected system in place \u2014 its profile, address, credential
|
|
1295
|
+
"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.",
|
|
1129
1296
|
{
|
|
1130
|
-
id:
|
|
1131
|
-
patch:
|
|
1132
|
-
dryRun:
|
|
1297
|
+
id: z6.string(),
|
|
1298
|
+
patch: z6.record(z6.unknown()),
|
|
1299
|
+
dryRun: z6.boolean().optional().describe("Validate and diff without saving.")
|
|
1133
1300
|
},
|
|
1134
1301
|
(a) => a.dryRun === true ? client.fulfillment.dryRunUpdateExecutor(a.id, a.patch) : client.fulfillment.updateExecutor(a.id, a.patch)
|
|
1135
1302
|
);
|
|
1136
1303
|
tool(
|
|
1137
1304
|
"get_dsar",
|
|
1138
1305
|
"One rights request by id, including its status and the deadline it must be answered by.",
|
|
1139
|
-
{ id:
|
|
1306
|
+
{ id: z6.string() },
|
|
1140
1307
|
(a) => client.dsar.get(a.id)
|
|
1141
1308
|
);
|
|
1142
1309
|
tool(
|
|
1143
1310
|
"erase_dsar_subject",
|
|
1144
1311
|
"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.",
|
|
1145
|
-
{ id:
|
|
1312
|
+
{ id: z6.string(), cbid: z6.string(), stamp: z6.string() },
|
|
1146
1313
|
(a) => client.dsar.erase(a.id, a.cbid, a.stamp)
|
|
1147
1314
|
);
|
|
1148
1315
|
tool(
|
|
1149
1316
|
"export_dsar_subject",
|
|
1150
1317
|
"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.",
|
|
1151
|
-
{ id:
|
|
1318
|
+
{ id: z6.string(), cbid: z6.string(), stamp: z6.string() },
|
|
1152
1319
|
(a) => client.dsar.export(a.id, a.cbid, a.stamp)
|
|
1153
1320
|
);
|
|
1154
1321
|
tool(
|
|
1155
1322
|
"get_dsar_response_notice",
|
|
1156
1323
|
"The subject-facing response notice for a request, as plain text \u2014 what to send the person. Read-only; nothing is sent.",
|
|
1157
|
-
{ id:
|
|
1324
|
+
{ id: z6.string() },
|
|
1158
1325
|
(a) => client.dsar.response(a.id)
|
|
1159
1326
|
);
|
|
1160
1327
|
tool(
|
|
1161
1328
|
"create_dsar",
|
|
1162
1329
|
"Open a new Data Subject Access Request.",
|
|
1163
1330
|
{
|
|
1164
|
-
type:
|
|
1165
|
-
subjectEmail:
|
|
1166
|
-
regulation:
|
|
1167
|
-
note:
|
|
1168
|
-
messageToSubject:
|
|
1169
|
-
test:
|
|
1331
|
+
type: z6.enum(["access", "deletion", "rectification", "portability", "opt-out"]).describe("DSAR right being exercised."),
|
|
1332
|
+
subjectEmail: z6.string().describe("The data subject\u2019s email."),
|
|
1333
|
+
regulation: z6.enum(["gdpr", "ccpa"]).describe("Governing regulation."),
|
|
1334
|
+
note: z6.string().optional().describe("Optional INTERNAL note; never shown to the data subject."),
|
|
1335
|
+
messageToSubject: z6.string().max(2e3).optional().describe("The line the data subject reads in the response notice. Never an API key."),
|
|
1336
|
+
test: z6.boolean().optional().describe("Mark it as a test request: kept off the SLA board and deletable afterwards with delete_test_dsar.")
|
|
1170
1337
|
},
|
|
1171
1338
|
(a) => client.dsar.create({
|
|
1172
1339
|
type: a.type,
|
|
@@ -1181,11 +1348,11 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1181
1348
|
"create_rights_link",
|
|
1182
1349
|
"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.",
|
|
1183
1350
|
{
|
|
1184
|
-
cbid:
|
|
1185
|
-
email:
|
|
1186
|
-
userId:
|
|
1187
|
-
rights:
|
|
1188
|
-
ttlSeconds:
|
|
1351
|
+
cbid: z6.string().describe("Site identifier (cbid). Must belong to your org."),
|
|
1352
|
+
email: z6.string().describe("The signed-in person\u2019s verified email address."),
|
|
1353
|
+
userId: z6.string().optional().describe("Your own account id for them; recorded on the request."),
|
|
1354
|
+
rights: z6.array(z6.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."),
|
|
1355
|
+
ttlSeconds: z6.number().int().min(60).max(3600).optional().describe("How long the link works, in seconds (default 900).")
|
|
1189
1356
|
},
|
|
1190
1357
|
(a) => client.rightsLinks.create(a.cbid, {
|
|
1191
1358
|
subject: { email: a.email, ...typeof a.userId === "string" ? { userId: a.userId } : {} },
|
|
@@ -1196,7 +1363,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1196
1363
|
tool(
|
|
1197
1364
|
"delete_test_dsar",
|
|
1198
1365
|
"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.",
|
|
1199
|
-
{ id:
|
|
1366
|
+
{ id: z6.string().describe("The test request id.") },
|
|
1200
1367
|
async (a) => {
|
|
1201
1368
|
await client.dsar.delete(a.id);
|
|
1202
1369
|
return { deleted: a.id };
|
|
@@ -1205,16 +1372,99 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1205
1372
|
tool(
|
|
1206
1373
|
"mark_dsar_test",
|
|
1207
1374
|
"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 }.",
|
|
1208
|
-
{ id:
|
|
1375
|
+
{ id: z6.string().describe("The closed request id.") },
|
|
1209
1376
|
(a) => client.dsar.markTest(a.id)
|
|
1210
1377
|
);
|
|
1378
|
+
tool(
|
|
1379
|
+
"open_dsar_case",
|
|
1380
|
+
"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.",
|
|
1381
|
+
{
|
|
1382
|
+
cbid: z6.string(),
|
|
1383
|
+
type: z6.string().describe("access | deletion | closure | restriction | rectification, or erasure / erase / export."),
|
|
1384
|
+
emails: z6.array(z6.string()).optional().describe("The person's addresses."),
|
|
1385
|
+
identity: z6.object({ iss: z6.string(), sub: z6.string(), ext: z6.string().optional(), principal: z6.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."),
|
|
1386
|
+
source: z6.enum(["product", "atlas", "admin"]).optional(),
|
|
1387
|
+
reason: z6.string().optional(),
|
|
1388
|
+
skipSystems: z6.array(z6.string()).optional().describe("System names, connection ids, or self."),
|
|
1389
|
+
fulfill: z6.boolean().optional(),
|
|
1390
|
+
test: z6.boolean().optional(),
|
|
1391
|
+
idempotencyKey: z6.string().optional(),
|
|
1392
|
+
trace: z6.string().optional().describe("An X-ForgeDeck-Trace to keep, from the caller.")
|
|
1393
|
+
},
|
|
1394
|
+
(a) => client.dsar.openCase(
|
|
1395
|
+
{
|
|
1396
|
+
cbid: a.cbid,
|
|
1397
|
+
type: a.type,
|
|
1398
|
+
subject: { emails: a.emails ?? [], ...a.identity ? { identity: a.identity } : {} },
|
|
1399
|
+
...a.source ? { source: a.source } : {},
|
|
1400
|
+
...typeof a.reason === "string" ? { reason: a.reason } : {},
|
|
1401
|
+
...Array.isArray(a.skipSystems) ? { skipSystems: a.skipSystems } : {},
|
|
1402
|
+
...typeof a.fulfill === "boolean" ? { fulfill: a.fulfill } : {},
|
|
1403
|
+
...a.test === true ? { test: true } : {}
|
|
1404
|
+
},
|
|
1405
|
+
{
|
|
1406
|
+
...typeof a.idempotencyKey === "string" ? { idempotencyKey: a.idempotencyKey } : {},
|
|
1407
|
+
...typeof a.trace === "string" ? { trace: a.trace } : {}
|
|
1408
|
+
}
|
|
1409
|
+
)
|
|
1410
|
+
);
|
|
1411
|
+
tool(
|
|
1412
|
+
"get_dsar_case",
|
|
1413
|
+
"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.",
|
|
1414
|
+
{ id: z6.string() },
|
|
1415
|
+
(a) => client.dsar.getCase(a.id)
|
|
1416
|
+
);
|
|
1417
|
+
tool(
|
|
1418
|
+
"cancel_dsar_case",
|
|
1419
|
+
"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.",
|
|
1420
|
+
{ id: z6.string() },
|
|
1421
|
+
(a) => client.dsar.cancelCase(a.id)
|
|
1422
|
+
);
|
|
1423
|
+
tool(
|
|
1424
|
+
"get_dsar_case_receipt",
|
|
1425
|
+
"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.",
|
|
1426
|
+
{ id: z6.string() },
|
|
1427
|
+
(a) => client.dsar.caseReceipt(a.id)
|
|
1428
|
+
);
|
|
1429
|
+
tool(
|
|
1430
|
+
"find_dsar_by_trace",
|
|
1431
|
+
"The rights request carrying one X-ForgeDeck-Trace id \u2014 to follow one event across products. Read-only.",
|
|
1432
|
+
{ trace: z6.string() },
|
|
1433
|
+
(a) => client.dsar.listByTrace(a.trace)
|
|
1434
|
+
);
|
|
1435
|
+
tool(
|
|
1436
|
+
"get_dsar_settings",
|
|
1437
|
+
"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.",
|
|
1438
|
+
{ cbid: z6.string() },
|
|
1439
|
+
(a) => client.dsarSettings.get(a.cbid)
|
|
1440
|
+
);
|
|
1441
|
+
tool(
|
|
1442
|
+
"set_dsar_settings",
|
|
1443
|
+
"Set a site's graceDays (0\u201330). Applies to cases opened afterwards. Audited.",
|
|
1444
|
+
{ cbid: z6.string(), graceDays: z6.number().int().min(0).max(30) },
|
|
1445
|
+
(a) => client.dsarSettings.set(a.cbid, { graceDays: a.graceDays })
|
|
1446
|
+
);
|
|
1447
|
+
tool(
|
|
1448
|
+
"get_subject_card",
|
|
1449
|
+
'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.',
|
|
1450
|
+
{
|
|
1451
|
+
app: z6.string().describe("The sidebar app asking, as a slug, e.g. chatly."),
|
|
1452
|
+
iss: z6.string().optional(),
|
|
1453
|
+
sub: z6.string().optional(),
|
|
1454
|
+
email: z6.string().optional()
|
|
1455
|
+
},
|
|
1456
|
+
(a) => client.integrations.subjectCard(
|
|
1457
|
+
a.app,
|
|
1458
|
+
typeof a.iss === "string" && typeof a.sub === "string" ? { iss: a.iss, sub: a.sub } : { email: String(a.email ?? "") }
|
|
1459
|
+
)
|
|
1460
|
+
);
|
|
1211
1461
|
tool(
|
|
1212
1462
|
"advance_dsar",
|
|
1213
1463
|
"Advance a DSAR to a new status (received \u2192 verifying \u2192 in_progress \u2192 completed, or rejected).",
|
|
1214
1464
|
{
|
|
1215
|
-
id:
|
|
1216
|
-
toStatus:
|
|
1217
|
-
messageToSubject:
|
|
1465
|
+
id: z6.string().describe("The DSAR id."),
|
|
1466
|
+
toStatus: z6.enum(["received", "verifying", "in_progress", "completed", "rejected"]).describe("Target status."),
|
|
1467
|
+
messageToSubject: z6.string().max(2e3).optional().describe("Replaces the line the data subject reads in the notice \u2014 for a rejection, why.")
|
|
1218
1468
|
},
|
|
1219
1469
|
(a) => typeof a.messageToSubject === "string" ? client.dsar.advance(a.id, a.toStatus, { messageToSubject: a.messageToSubject }) : client.dsar.advance(a.id, a.toStatus)
|
|
1220
1470
|
);
|
|
@@ -1227,7 +1477,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1227
1477
|
tool(
|
|
1228
1478
|
"get_receipt",
|
|
1229
1479
|
"Fetch the signed consent receipt for a single consent record (by stamp).",
|
|
1230
|
-
{ ...cbid, stamp:
|
|
1480
|
+
{ ...cbid, stamp: z6.string().describe("The consent record stamp/id.") },
|
|
1231
1481
|
(a) => client.consent.receipt(a.cbid, a.stamp)
|
|
1232
1482
|
);
|
|
1233
1483
|
tool("delete_site", "Delete a site (cbid) and its configuration from your org.", { ...cbid }, async (a) => {
|
|
@@ -1239,13 +1489,13 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1239
1489
|
"create_vendor",
|
|
1240
1490
|
"Register a vendor (processor) and compute its risk score.",
|
|
1241
1491
|
{
|
|
1242
|
-
name:
|
|
1243
|
-
category:
|
|
1244
|
-
dataShared:
|
|
1245
|
-
dpaSigned:
|
|
1246
|
-
subprocessors:
|
|
1247
|
-
certifications:
|
|
1248
|
-
region:
|
|
1492
|
+
name: z6.string().describe("Vendor name."),
|
|
1493
|
+
category: z6.string().describe("Vendor category, e.g. analytics."),
|
|
1494
|
+
dataShared: z6.array(z6.string()).describe("Categories of data shared with the vendor."),
|
|
1495
|
+
dpaSigned: z6.boolean().describe("Whether a Data Processing Agreement is signed."),
|
|
1496
|
+
subprocessors: z6.number().describe("Number of subprocessors."),
|
|
1497
|
+
certifications: z6.array(z6.string()).describe("Compliance certifications, e.g. ISO27001."),
|
|
1498
|
+
region: z6.string().describe("Primary processing region, e.g. EU.")
|
|
1249
1499
|
},
|
|
1250
1500
|
(a) => client.vendors.create({
|
|
1251
1501
|
name: a.name,
|
|
@@ -1263,13 +1513,13 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1263
1513
|
"create_ropa",
|
|
1264
1514
|
"Create a Record of Processing Activity (RoPA) entry.",
|
|
1265
1515
|
{
|
|
1266
|
-
name:
|
|
1267
|
-
purpose:
|
|
1268
|
-
legalBasis:
|
|
1269
|
-
dataCategories:
|
|
1270
|
-
recipients:
|
|
1271
|
-
retentionDays:
|
|
1272
|
-
crossBorderTransfer:
|
|
1516
|
+
name: z6.string().describe("Activity name."),
|
|
1517
|
+
purpose: z6.string().describe("Purpose of processing."),
|
|
1518
|
+
legalBasis: z6.enum(["consent", "contract", "legal-obligation", "vital-interests", "public-task", "legitimate-interests"]).describe("GDPR legal basis."),
|
|
1519
|
+
dataCategories: z6.array(z6.string()).describe("Categories of personal data."),
|
|
1520
|
+
recipients: z6.array(z6.string()).describe("Recipients of the data."),
|
|
1521
|
+
retentionDays: z6.number().describe("Retention period in days."),
|
|
1522
|
+
crossBorderTransfer: z6.boolean().describe("Whether data is transferred across borders.")
|
|
1273
1523
|
},
|
|
1274
1524
|
(a) => client.ropa.create({
|
|
1275
1525
|
name: a.name,
|
|
@@ -1290,7 +1540,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1290
1540
|
tool(
|
|
1291
1541
|
"scan_site",
|
|
1292
1542
|
"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.",
|
|
1293
|
-
{ ...cbid, wait:
|
|
1543
|
+
{ ...cbid, wait: z6.boolean().optional().describe("Wait for the scan to finish (up to 100 s) and return its outcome.") },
|
|
1294
1544
|
async (a) => {
|
|
1295
1545
|
let started;
|
|
1296
1546
|
try {
|
|
@@ -1303,8 +1553,8 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1303
1553
|
);
|
|
1304
1554
|
tool(
|
|
1305
1555
|
"get_scan_status",
|
|
1306
|
-
"Get a site\u2019s last cookie scan: state (queued, scanning, done, failed), scanId, durationMs, cookieCount, pagesVisited and error when it failed.",
|
|
1307
|
-
{ ...cbid, wait:
|
|
1556
|
+
"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.",
|
|
1557
|
+
{ ...cbid, wait: z6.number().min(0).max(60).optional().describe("Seconds (\u226460) to wait for a running scan to settle before answering.") },
|
|
1308
1558
|
(a) => a.wait !== void 0 ? client.sites.scanStatus(a.cbid, { wait: a.wait }) : client.sites.scanStatus(a.cbid)
|
|
1309
1559
|
);
|
|
1310
1560
|
tool(
|
|
@@ -1321,20 +1571,26 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1321
1571
|
"api_key_report",
|
|
1322
1572
|
"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.",
|
|
1323
1573
|
{
|
|
1324
|
-
unusedDays:
|
|
1325
|
-
expiringDays:
|
|
1574
|
+
unusedDays: z6.number().int().min(1).max(3650).optional().describe("Unused for at least this many days (default 90)."),
|
|
1575
|
+
expiringDays: z6.number().int().min(1).max(3650).optional().describe("Expiring within this many days (default 14).")
|
|
1326
1576
|
},
|
|
1327
1577
|
(a) => client.keys.report({ ...a.unusedDays !== void 0 ? { unusedDays: a.unusedDays } : {}, ...a.expiringDays !== void 0 ? { expiringDays: a.expiringDays } : {} })
|
|
1328
1578
|
);
|
|
1329
1579
|
tool("get_usage", "Get the current usage/quota summary for your organization.", {}, () => client.usage());
|
|
1580
|
+
tool(
|
|
1581
|
+
"get_entitlements",
|
|
1582
|
+
"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.",
|
|
1583
|
+
{},
|
|
1584
|
+
() => client.entitlements()
|
|
1585
|
+
);
|
|
1330
1586
|
tool("list_webhooks", "List webhook subscriptions for your organization.", {}, () => client.webhooks.list());
|
|
1331
1587
|
tool(
|
|
1332
1588
|
"create_webhook",
|
|
1333
1589
|
"Create a webhook subscription. The response includes the signing secret (shown once).",
|
|
1334
1590
|
{
|
|
1335
|
-
url:
|
|
1336
|
-
events:
|
|
1337
|
-
cbid:
|
|
1591
|
+
url: z6.string().describe("HTTPS endpoint to deliver events to."),
|
|
1592
|
+
events: z6.array(z6.string()).describe("Event names to subscribe to, e.g. consent.created."),
|
|
1593
|
+
cbid: z6.string().optional().describe("Optional site cbid to scope the subscription to.")
|
|
1338
1594
|
},
|
|
1339
1595
|
(a) => client.webhooks.create({
|
|
1340
1596
|
url: a.url,
|
|
@@ -1345,13 +1601,13 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1345
1601
|
tool(
|
|
1346
1602
|
"roll_webhook_secret",
|
|
1347
1603
|
"Rotate a webhook subscription\u2019s signing secret. The new secret is returned once; the receiving endpoint must be updated to verify with it.",
|
|
1348
|
-
{ id:
|
|
1604
|
+
{ id: z6.string() },
|
|
1349
1605
|
(a) => client.webhooks.rollSecret(a.id)
|
|
1350
1606
|
);
|
|
1351
1607
|
tool(
|
|
1352
1608
|
"test_webhook",
|
|
1353
1609
|
"Send a signed test event to a webhook subscription now, and report what the endpoint answered.",
|
|
1354
|
-
{ id:
|
|
1610
|
+
{ id: z6.string() },
|
|
1355
1611
|
(a) => client.webhooks.test(a.id)
|
|
1356
1612
|
);
|
|
1357
1613
|
tool(
|
|
@@ -1363,40 +1619,48 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1363
1619
|
tool(
|
|
1364
1620
|
"replay_webhook_dead_letter",
|
|
1365
1621
|
"Deliver a dead-lettered webhook event again, to the subscription as it is now.",
|
|
1366
|
-
{ id:
|
|
1622
|
+
{ id: z6.string() },
|
|
1367
1623
|
(a) => client.webhooks.replayDeadLetter(a.id)
|
|
1368
1624
|
);
|
|
1625
|
+
tool(
|
|
1626
|
+
"replay_webhook",
|
|
1627
|
+
"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).",
|
|
1628
|
+
{ id: z6.string(), since: z6.union([z6.number(), z6.string()]).describe("Epoch ms or ISO date."), limit: z6.number().int().min(1).max(500).optional() },
|
|
1629
|
+
(a) => client.webhooks.replay(a.id, a.since, a.limit ? { limit: a.limit } : void 0)
|
|
1630
|
+
);
|
|
1369
1631
|
tool(
|
|
1370
1632
|
"update_webhook",
|
|
1371
|
-
"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.",
|
|
1633
|
+
"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).",
|
|
1372
1634
|
{
|
|
1373
|
-
id:
|
|
1374
|
-
url:
|
|
1375
|
-
events:
|
|
1376
|
-
cbid:
|
|
1377
|
-
active:
|
|
1635
|
+
id: z6.string(),
|
|
1636
|
+
url: z6.string().optional(),
|
|
1637
|
+
events: z6.array(z6.string()).optional(),
|
|
1638
|
+
cbid: z6.string().nullable().optional(),
|
|
1639
|
+
active: z6.boolean().optional(),
|
|
1640
|
+
alertContacts: z6.array(z6.string()).nullable().optional()
|
|
1378
1641
|
},
|
|
1379
1642
|
(a) => client.webhooks.update(a.id, {
|
|
1380
1643
|
...a.url !== void 0 ? { url: a.url } : {},
|
|
1381
1644
|
...a.events !== void 0 ? { events: a.events } : {},
|
|
1382
1645
|
...a.cbid !== void 0 ? { cbid: a.cbid } : {},
|
|
1383
|
-
...a.active !== void 0 ? { active: a.active } : {}
|
|
1646
|
+
...a.active !== void 0 ? { active: a.active } : {},
|
|
1647
|
+
...a.alertContacts !== void 0 ? { alertContacts: a.alertContacts } : {}
|
|
1384
1648
|
})
|
|
1385
1649
|
);
|
|
1386
|
-
tool("delete_webhook", "Delete a webhook subscription by id.", { id:
|
|
1650
|
+
tool("delete_webhook", "Delete a webhook subscription by id.", { id: z6.string().describe("The webhook subscription id.") }, async (a) => {
|
|
1387
1651
|
await client.webhooks.delete(a.id);
|
|
1388
1652
|
return { ok: true };
|
|
1389
1653
|
});
|
|
1390
1654
|
tool(
|
|
1391
1655
|
"verify_site",
|
|
1392
1656
|
"Verify that your organization controls a domain by one of three challenge methods (dns / meta / file). Required to unlock consent export and signed receipts.",
|
|
1393
|
-
{ ...cbid, method:
|
|
1657
|
+
{ ...cbid, method: z6.enum(["dns", "meta", "file"]).describe("Challenge method: dns (TXT record), meta (HTML tag), or file (/.well-known/cookiemunch-verify.txt).") },
|
|
1394
1658
|
(a) => client.sites.verify(a.cbid, a.method)
|
|
1395
1659
|
);
|
|
1396
1660
|
tool(
|
|
1397
1661
|
"get_verification_challenge",
|
|
1398
1662
|
"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.",
|
|
1399
|
-
{ cbid:
|
|
1663
|
+
{ cbid: z6.string() },
|
|
1400
1664
|
(a) => client.sites.verifyChallenge(a.cbid)
|
|
1401
1665
|
);
|
|
1402
1666
|
tool(
|
|
@@ -1405,18 +1669,35 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1405
1669
|
{ ...cbid },
|
|
1406
1670
|
(a) => client.sites.brand(a.cbid)
|
|
1407
1671
|
);
|
|
1672
|
+
tool(
|
|
1673
|
+
"get_site_brand",
|
|
1674
|
+
"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).",
|
|
1675
|
+
{ cbid: z6.string() },
|
|
1676
|
+
(a) => client.sites.getBrand(a.cbid)
|
|
1677
|
+
);
|
|
1678
|
+
tool(
|
|
1679
|
+
"import_site_brand",
|
|
1680
|
+
"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.",
|
|
1681
|
+
{
|
|
1682
|
+
cbid: z6.string(),
|
|
1683
|
+
url: z6.string().optional().describe("https URL of the brand.json. Give this or document."),
|
|
1684
|
+
document: z6.record(z6.unknown()).optional().describe("The brand.json object itself. Give this or url."),
|
|
1685
|
+
dryRun: z6.boolean().optional()
|
|
1686
|
+
},
|
|
1687
|
+
(a) => client.sites.setBrand(a.cbid, typeof a.url === "string" ? { url: a.url } : a.document ?? {}, { dryRun: a.dryRun === true })
|
|
1688
|
+
);
|
|
1408
1689
|
tool(
|
|
1409
1690
|
"get_flow",
|
|
1410
1691
|
"Get the v2 banner flow config for a site, including current views, categories, and any lint issues.",
|
|
1411
|
-
{ cbid:
|
|
1692
|
+
{ cbid: z6.string().describe("Site identifier (cbid).") },
|
|
1412
1693
|
(a) => client.sites.getFlow(a.cbid)
|
|
1413
1694
|
);
|
|
1414
1695
|
tool(
|
|
1415
1696
|
"edit_flow",
|
|
1416
1697
|
"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.",
|
|
1417
1698
|
{
|
|
1418
|
-
cbid:
|
|
1419
|
-
operations:
|
|
1699
|
+
cbid: z6.string().describe("Site identifier (cbid)."),
|
|
1700
|
+
operations: z6.array(z6.record(z6.unknown())).describe(
|
|
1420
1701
|
'Ordered list of ops. Each must have an "op" field: addView | removeView | addElement | setButtonTransition | addCustomCategory.'
|
|
1421
1702
|
)
|
|
1422
1703
|
},
|
|
@@ -1426,22 +1707,23 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1426
1707
|
"set_flow",
|
|
1427
1708
|
"Wholesale replace a site's v2 banner flow with a complete config (e.g. from a template). Validated server-side before it is saved.",
|
|
1428
1709
|
{
|
|
1429
|
-
cbid:
|
|
1430
|
-
config:
|
|
1710
|
+
cbid: z6.string().describe("Site identifier (cbid)."),
|
|
1711
|
+
config: z6.record(z6.unknown()).describe("A full v2 FlowConfig object ({ v:2, flow, categories, ... }).")
|
|
1431
1712
|
},
|
|
1432
1713
|
(a) => client.sites.setFlow(a.cbid, a.config)
|
|
1433
1714
|
);
|
|
1434
1715
|
registerConfigTools(tool, client);
|
|
1435
1716
|
registerPlatformTools(tool, client);
|
|
1436
1717
|
registerIntegrationTools(tool, client);
|
|
1718
|
+
registerKeyAndTagTools(tool, client);
|
|
1437
1719
|
registerRightsTools(tool, client);
|
|
1438
1720
|
registerRightsPageTools(tool, client);
|
|
1439
1721
|
tool(
|
|
1440
1722
|
"invite_member",
|
|
1441
1723
|
"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.",
|
|
1442
1724
|
{
|
|
1443
|
-
email:
|
|
1444
|
-
role:
|
|
1725
|
+
email: z6.string().describe("Email address of the person to invite."),
|
|
1726
|
+
role: z6.enum(["admin", "member", "viewer"]).describe("Role to assign: admin, member, or viewer. owner is not assignable via API key.")
|
|
1445
1727
|
},
|
|
1446
1728
|
(a) => client.members.invite(a.email, a.role)
|
|
1447
1729
|
);
|
|
@@ -1449,8 +1731,8 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1449
1731
|
"set_member_role",
|
|
1450
1732
|
"Change the role of a member in your organization. The org owner's role cannot be changed.",
|
|
1451
1733
|
{
|
|
1452
|
-
userId:
|
|
1453
|
-
role:
|
|
1734
|
+
userId: z6.string().describe("The userId of the member whose role to change."),
|
|
1735
|
+
role: z6.enum(["admin", "member", "viewer"]).describe("New role: admin, member, or viewer.")
|
|
1454
1736
|
},
|
|
1455
1737
|
(a) => client.members.setRole(a.userId, a.role)
|
|
1456
1738
|
);
|
|
@@ -1458,7 +1740,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1458
1740
|
"remove_member",
|
|
1459
1741
|
"Remove a member from your organization. The org owner cannot be removed.",
|
|
1460
1742
|
{
|
|
1461
|
-
userId:
|
|
1743
|
+
userId: z6.string().describe("The userId of the member to remove.")
|
|
1462
1744
|
},
|
|
1463
1745
|
async (a) => {
|
|
1464
1746
|
await client.members.remove(a.userId);
|
|
@@ -1469,11 +1751,11 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1469
1751
|
"create_brand_kit",
|
|
1470
1752
|
"Create a reusable brand kit (colors, logo, typography) for your organization's consent banners.",
|
|
1471
1753
|
{
|
|
1472
|
-
name:
|
|
1473
|
-
theme:
|
|
1474
|
-
content:
|
|
1475
|
-
logoUrl:
|
|
1476
|
-
customCss:
|
|
1754
|
+
name: z6.string().describe("Display name for the brand kit."),
|
|
1755
|
+
theme: z6.record(z6.unknown()).describe("Theme tokens (colors, fonts, etc.) as a JSON object."),
|
|
1756
|
+
content: z6.record(z6.unknown()).optional().describe("Optional banner copy overrides."),
|
|
1757
|
+
logoUrl: z6.string().optional().describe("Optional URL for your org logo."),
|
|
1758
|
+
customCss: z6.string().optional().describe("Optional custom CSS string to inject into the banner.")
|
|
1477
1759
|
},
|
|
1478
1760
|
(a) => client.brandKits.create({
|
|
1479
1761
|
name: a.name,
|
|
@@ -1487,7 +1769,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1487
1769
|
"delete_brand_kit",
|
|
1488
1770
|
"Delete a brand kit by id. The kit must belong to your organization (cross-org deletes are rejected).",
|
|
1489
1771
|
{
|
|
1490
|
-
id:
|
|
1772
|
+
id: z6.string().describe("The brand kit id to delete.")
|
|
1491
1773
|
},
|
|
1492
1774
|
async (a) => {
|
|
1493
1775
|
await client.brandKits.delete(a.id);
|
|
@@ -1498,28 +1780,47 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1498
1780
|
"save_preference",
|
|
1499
1781
|
"Save or update the consent preferences for an end-user (by subjectId) within your organization. purposes is a map of purpose-name \u2192 boolean.",
|
|
1500
1782
|
{
|
|
1501
|
-
subjectId:
|
|
1502
|
-
purposes:
|
|
1783
|
+
subjectId: z6.string().describe("The end-user identifier (e.g. email or internal user id)."),
|
|
1784
|
+
purposes: z6.record(z6.boolean()).describe('Map of purpose names to consent values, e.g. { "newsletter": true, "analytics": false }.')
|
|
1503
1785
|
},
|
|
1504
1786
|
(a) => client.preferences.save(a.subjectId, a.purposes)
|
|
1505
1787
|
);
|
|
1506
1788
|
tool(
|
|
1507
1789
|
"get_preference",
|
|
1508
1790
|
"One end-user\u2019s saved preferences, by subjectId. Read-only.",
|
|
1509
|
-
{ subjectId:
|
|
1791
|
+
{ subjectId: z6.string() },
|
|
1510
1792
|
(a) => client.preferences.get(a.subjectId)
|
|
1511
1793
|
);
|
|
1794
|
+
tool(
|
|
1795
|
+
"mint_preference_center_token",
|
|
1796
|
+
"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.",
|
|
1797
|
+
{
|
|
1798
|
+
cbid: z6.string().describe("A site of your organisation."),
|
|
1799
|
+
email: z6.string().optional().describe("The visitor\u2019s address. Give this or subjectId, not both."),
|
|
1800
|
+
subjectId: z6.string().optional().describe("The subject id. Give this or email, not both."),
|
|
1801
|
+
ttlSeconds: z6.number().int().min(1).max(86400).optional()
|
|
1802
|
+
},
|
|
1803
|
+
(a) => client.preferenceCenter.mintToken({
|
|
1804
|
+
cbid: a.cbid,
|
|
1805
|
+
...a.email !== void 0 ? { email: a.email } : { subjectId: a.subjectId },
|
|
1806
|
+
...a.ttlSeconds !== void 0 ? { ttlSeconds: a.ttlSeconds } : {}
|
|
1807
|
+
})
|
|
1808
|
+
);
|
|
1512
1809
|
tool(
|
|
1513
1810
|
"issue_api_key",
|
|
1514
|
-
"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.",
|
|
1811
|
+
"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.",
|
|
1515
1812
|
{
|
|
1516
|
-
name:
|
|
1517
|
-
scopes:
|
|
1518
|
-
cbids:
|
|
1519
|
-
expiresInDays:
|
|
1520
|
-
expiresAt:
|
|
1813
|
+
name: z6.string().optional(),
|
|
1814
|
+
scopes: z6.array(z6.string()).optional(),
|
|
1815
|
+
cbids: z6.array(z6.string()).min(1).optional(),
|
|
1816
|
+
expiresInDays: z6.number().int().min(1).max(3650).optional(),
|
|
1817
|
+
expiresAt: z6.string().optional().describe("Or the exact expiry, an ISO date-time (not with expiresInDays)."),
|
|
1818
|
+
owner: z6.string().optional().describe("Who it belongs to: user:<id>, service:<name> or apikey:<prefix>. Default this key."),
|
|
1819
|
+
strictUnknownFields: z6.boolean().optional().describe("Writes with the new key refuse unknown body fields by default.")
|
|
1521
1820
|
},
|
|
1522
1821
|
(a) => client.keys.issue({
|
|
1822
|
+
...a.owner ? { owner: a.owner } : {},
|
|
1823
|
+
...a.strictUnknownFields !== void 0 ? { strictUnknownFields: a.strictUnknownFields } : {},
|
|
1523
1824
|
...a.expiresAt ? { expiresAt: a.expiresAt } : {},
|
|
1524
1825
|
...a.name ? { name: a.name } : {},
|
|
1525
1826
|
...a.scopes ? { scopes: a.scopes } : {},
|
|
@@ -1527,36 +1828,36 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1527
1828
|
...a.expiresInDays !== void 0 ? { expiresInDays: a.expiresInDays } : {}
|
|
1528
1829
|
})
|
|
1529
1830
|
);
|
|
1530
|
-
tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix:
|
|
1831
|
+
tool("revoke_api_key", "Revoke an API key by its prefix. Takes effect immediately; anything using that key stops working.", { prefix: z6.string() }, async (a) => {
|
|
1531
1832
|
await client.keys.revoke(a.prefix);
|
|
1532
1833
|
return { revoked: a.prefix };
|
|
1533
1834
|
});
|
|
1534
1835
|
tool(
|
|
1535
1836
|
"import_cookie_declaration",
|
|
1536
1837
|
"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.",
|
|
1537
|
-
{ cbid:
|
|
1838
|
+
{ cbid: z6.string(), data: z6.string().describe("The exported file, as text (CSV or JSON).") },
|
|
1538
1839
|
(a) => client.sites.importDeclaration(a.cbid, a.data)
|
|
1539
1840
|
);
|
|
1540
1841
|
tool(
|
|
1541
1842
|
"apply_cookie_import",
|
|
1542
1843
|
"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.",
|
|
1543
|
-
{ cbid:
|
|
1844
|
+
{ cbid: z6.string(), data: z6.string().describe("The exported file, as text (CSV or JSON)."), overwrite: z6.boolean().optional() },
|
|
1544
1845
|
(a) => client.sites.applyImport(a.cbid, a.data, a.overwrite ? { overwrite: true } : void 0)
|
|
1545
1846
|
);
|
|
1546
1847
|
const declarationShape = {
|
|
1547
|
-
category:
|
|
1548
|
-
purpose:
|
|
1549
|
-
purposes:
|
|
1550
|
-
provider:
|
|
1551
|
-
expiry:
|
|
1552
|
-
domain:
|
|
1553
|
-
pattern:
|
|
1848
|
+
category: z6.string().describe("necessary, preferences, statistics, marketing, or one of the site\u2019s categories.custom ids."),
|
|
1849
|
+
purpose: z6.string().describe("What the cookie does, as visitors will read it \u2014 and the fallback for any language purposes lacks."),
|
|
1850
|
+
purposes: z6.record(z6.string(), z6.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.'),
|
|
1851
|
+
provider: z6.string().optional(),
|
|
1852
|
+
expiry: z6.string().optional().describe('e.g. "Session", "30 days", "1 year" (the banner localises these forms).'),
|
|
1853
|
+
domain: z6.string().optional(),
|
|
1854
|
+
pattern: z6.boolean().optional().describe("Treat the name as a prefix wildcard (a trailing * does the same).")
|
|
1554
1855
|
};
|
|
1555
|
-
const dryRunArg =
|
|
1856
|
+
const dryRunArg = z6.boolean().optional().describe("Store nothing: answer with the would-be declarations and a diff (added / removed / changed) to check first.");
|
|
1556
1857
|
tool(
|
|
1557
1858
|
"declare_cookie",
|
|
1558
1859
|
'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.',
|
|
1559
|
-
{ cbid:
|
|
1860
|
+
{ cbid: z6.string(), name: z6.string(), ...declarationShape, dryRun: dryRunArg },
|
|
1560
1861
|
(a) => {
|
|
1561
1862
|
const { cbid: cbid2, name, dryRun, ...rest } = a;
|
|
1562
1863
|
return client.sites.declareCookie(cbid2, name, rest, dryRun ? { dryRun: true } : void 0);
|
|
@@ -1565,7 +1866,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1565
1866
|
tool(
|
|
1566
1867
|
"declare_cookies",
|
|
1567
1868
|
"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.",
|
|
1568
|
-
{ cbid:
|
|
1869
|
+
{ cbid: z6.string(), cookies: z6.array(z6.object({ name: z6.string(), ...declarationShape })).max(500), replace: z6.boolean().optional(), dryRun: dryRunArg },
|
|
1569
1870
|
(a) => {
|
|
1570
1871
|
const o = { ...a.replace ? { replace: true } : {}, ...a.dryRun ? { dryRun: true } : {} };
|
|
1571
1872
|
return client.sites.declareCookies(a.cbid, a.cookies, Object.keys(o).length ? o : void 0);
|
|
@@ -1574,7 +1875,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1574
1875
|
tool(
|
|
1575
1876
|
"undeclare_cookie",
|
|
1576
1877
|
"Remove a cookie declaration; the scanned/observed classification applies again.",
|
|
1577
|
-
{ cbid:
|
|
1878
|
+
{ cbid: z6.string(), name: z6.string(), dryRun: dryRunArg },
|
|
1578
1879
|
async (a) => {
|
|
1579
1880
|
if (a.dryRun) return client.sites.undeclareCookie(a.cbid, a.name, { dryRun: true });
|
|
1580
1881
|
await client.sites.undeclareCookie(a.cbid, a.name);
|
|
@@ -1585,11 +1886,11 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1585
1886
|
"retire_cookie",
|
|
1586
1887
|
'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.',
|
|
1587
1888
|
{
|
|
1588
|
-
cbid:
|
|
1589
|
-
name:
|
|
1590
|
-
renamedTo:
|
|
1591
|
-
note:
|
|
1592
|
-
dryRun:
|
|
1889
|
+
cbid: z6.string(),
|
|
1890
|
+
name: z6.string(),
|
|
1891
|
+
renamedTo: z6.string().max(256).optional().describe("The cookie\u2019s new name, if it was renamed."),
|
|
1892
|
+
note: z6.string().max(1e3).optional(),
|
|
1893
|
+
dryRun: z6.boolean().optional().describe("Store nothing: answer with the would-be retirement and list to check first.")
|
|
1593
1894
|
},
|
|
1594
1895
|
(a) => {
|
|
1595
1896
|
const input = { ...a.renamedTo ? { renamedTo: a.renamedTo } : {}, ...a.note ? { note: a.note } : {} };
|
|
@@ -1599,7 +1900,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1599
1900
|
tool(
|
|
1600
1901
|
"unretire_cookie",
|
|
1601
1902
|
"Un-retire a cookie: it is listed again everywhere.",
|
|
1602
|
-
{ cbid:
|
|
1903
|
+
{ cbid: z6.string(), name: z6.string(), dryRun: z6.boolean().optional().describe("Store nothing: answer with what the list would be.") },
|
|
1603
1904
|
async (a) => {
|
|
1604
1905
|
if (a.dryRun) return client.sites.unretireCookie(a.cbid, a.name, { dryRun: true });
|
|
1605
1906
|
await client.sites.unretireCookie(a.cbid, a.name);
|
|
@@ -1608,41 +1909,74 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1608
1909
|
);
|
|
1609
1910
|
tool(
|
|
1610
1911
|
"list_cookie_presets",
|
|
1611
|
-
"Declaration presets for the platforms a site is built on (atlas, forumulate, chatly, cookiemunch,
|
|
1612
|
-
{ cbid:
|
|
1912
|
+
"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.",
|
|
1913
|
+
{ cbid: z6.string() },
|
|
1613
1914
|
(a) => client.sites.cookiePresets(a.cbid)
|
|
1614
1915
|
);
|
|
1615
1916
|
tool(
|
|
1616
1917
|
"apply_cookie_preset",
|
|
1617
|
-
"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.",
|
|
1918
|
+
"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.",
|
|
1618
1919
|
{
|
|
1619
|
-
cbid:
|
|
1620
|
-
vendor:
|
|
1621
|
-
frontendApiHost:
|
|
1622
|
-
crossSubdomainCookies:
|
|
1623
|
-
publicId:
|
|
1624
|
-
dragging:
|
|
1625
|
-
category:
|
|
1626
|
-
cookieDomain:
|
|
1627
|
-
cookieDays:
|
|
1920
|
+
cbid: z6.string(),
|
|
1921
|
+
vendor: z6.enum(["atlas", "forumulate", "chatly", "cookiemunch", "referalli", "firstpromoter", "partnerstack", "tapfiliate", "impact", "referally"]).describe("referally is the deprecated old name of referalli."),
|
|
1922
|
+
frontendApiHost: z6.string().optional().describe("Atlas: your frontend API host, e.g. auth.example.com."),
|
|
1923
|
+
crossSubdomainCookies: z6.boolean().optional().describe("Atlas: default true \u2014 the cookies live on the parent domain."),
|
|
1924
|
+
publicId: z6.string().optional().describe("Chatly: the channel public id (ch_web_\u2026)."),
|
|
1925
|
+
dragging: z6.boolean().optional().describe("Chatly: the launcher can be dragged (adds the drag-position key)."),
|
|
1926
|
+
category: z6.string().optional().describe("Chatly: the category for its keys (default necessary). Referral and affiliate presets: default the site's referrals category, else marketing."),
|
|
1927
|
+
cookieDomain: z6.string().optional().describe("Referral and affiliate presets: the domain their script sets its cookies on, e.g. .example.com. Default the site domain."),
|
|
1928
|
+
cookieDays: z6.number().int().min(1).max(400).optional().describe("Referral and affiliate presets: your program's cookie window, 1 to 400 days."),
|
|
1929
|
+
legacyName: z6.boolean().optional().describe("referalli: default true, also declare referally_ctx (the pre-rename copy aff.js still writes)."),
|
|
1930
|
+
campaignId: z6.string().optional().describe("impact: your program id; declares IR_<campaignId> too."),
|
|
1628
1931
|
dryRun: dryRunArg
|
|
1629
1932
|
},
|
|
1630
1933
|
(a) => {
|
|
1631
1934
|
const params = {};
|
|
1632
|
-
for (const k of ["frontendApiHost", "crossSubdomainCookies", "publicId", "dragging", "category", "cookieDomain", "cookieDays"]) if (a[k] !== void 0) params[k] = a[k];
|
|
1935
|
+
for (const k of ["frontendApiHost", "crossSubdomainCookies", "publicId", "dragging", "category", "cookieDomain", "cookieDays", "legacyName", "campaignId"]) if (a[k] !== void 0) params[k] = a[k];
|
|
1633
1936
|
return client.sites.applyCookiePreset(a.cbid, a.vendor, params, a.dryRun ? { dryRun: true } : void 0);
|
|
1634
1937
|
}
|
|
1635
1938
|
);
|
|
1939
|
+
tool(
|
|
1940
|
+
"import_cookie_manifest",
|
|
1941
|
+
'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.',
|
|
1942
|
+
{
|
|
1943
|
+
cbid: z6.string(),
|
|
1944
|
+
url: z6.string().optional().describe("An https:// embed manifest URL."),
|
|
1945
|
+
manifest: z6.record(z6.unknown()).optional().describe("The manifest document itself, instead of a URL."),
|
|
1946
|
+
params: z6.record(z6.string()).optional().describe('Values for the manifest\u2019s {placeholders}, e.g. {"publicId": "ch_web_1"}.'),
|
|
1947
|
+
dryRun: dryRunArg
|
|
1948
|
+
},
|
|
1949
|
+
(a) => {
|
|
1950
|
+
const input = a.url !== void 0 ? { url: a.url } : { manifest: a.manifest };
|
|
1951
|
+
return client.sites.importCookieManifest(a.cbid, { ...input, ...a.params ? { params: a.params } : {} }, a.dryRun ? { dryRun: true } : void 0);
|
|
1952
|
+
}
|
|
1953
|
+
);
|
|
1954
|
+
tool(
|
|
1955
|
+
"list_cookie_suggestions",
|
|
1956
|
+
"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.",
|
|
1957
|
+
{ cbid: z6.string() },
|
|
1958
|
+
(a) => client.sites.cookieSuggestions(a.cbid)
|
|
1959
|
+
);
|
|
1960
|
+
tool(
|
|
1961
|
+
"declare_cookie_suggestions",
|
|
1962
|
+
"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.",
|
|
1963
|
+
{ cbid: z6.string(), names: z6.array(z6.string()).optional(), presets: z6.boolean().optional(), dryRun: dryRunArg },
|
|
1964
|
+
(a) => client.sites.declareCookieSuggestions(
|
|
1965
|
+
a.cbid,
|
|
1966
|
+
{ ...a.names ? { names: a.names } : {}, ...a.presets !== void 0 ? { presets: a.presets } : {} },
|
|
1967
|
+
a.dryRun ? { dryRun: true } : void 0
|
|
1968
|
+
)
|
|
1969
|
+
);
|
|
1636
1970
|
tool(
|
|
1637
1971
|
"remove_cookie_preset",
|
|
1638
|
-
"Remove every declaration a vendor preset made on this site.",
|
|
1639
|
-
{ cbid:
|
|
1972
|
+
"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.",
|
|
1973
|
+
{ cbid: z6.string(), vendor: z6.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 },
|
|
1640
1974
|
(a) => client.sites.removeCookiePreset(a.cbid, a.vendor, a.dryRun ? { dryRun: true } : void 0)
|
|
1641
1975
|
);
|
|
1642
1976
|
tool(
|
|
1643
1977
|
"delete_observed_cookie",
|
|
1644
1978
|
"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.",
|
|
1645
|
-
{ cbid:
|
|
1979
|
+
{ cbid: z6.string(), name: z6.string(), dryRun: dryRunArg },
|
|
1646
1980
|
async (a) => {
|
|
1647
1981
|
if (a.dryRun) return client.sites.deleteObservedCookie(a.cbid, a.name, { dryRun: true });
|
|
1648
1982
|
await client.sites.deleteObservedCookie(a.cbid, a.name);
|
|
@@ -1653,9 +1987,9 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1653
1987
|
"purge_observed_cookies",
|
|
1654
1988
|
"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.",
|
|
1655
1989
|
{
|
|
1656
|
-
cbid:
|
|
1657
|
-
since:
|
|
1658
|
-
until:
|
|
1990
|
+
cbid: z6.string(),
|
|
1991
|
+
since: z6.union([z6.string(), z6.number()]).describe("ISO-8601 time or epoch milliseconds."),
|
|
1992
|
+
until: z6.union([z6.string(), z6.number()]).optional().describe("Optional end of the window (exclusive)."),
|
|
1659
1993
|
dryRun: dryRunArg
|
|
1660
1994
|
},
|
|
1661
1995
|
(a) => client.sites.purgeObservedCookies(
|
|
@@ -1667,24 +2001,24 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1667
2001
|
tool(
|
|
1668
2002
|
"get_blocked_pages",
|
|
1669
2003
|
"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.",
|
|
1670
|
-
{ cbid:
|
|
2004
|
+
{ cbid: z6.string() },
|
|
1671
2005
|
(a) => client.sites.blocked(a.cbid)
|
|
1672
2006
|
);
|
|
1673
2007
|
tool(
|
|
1674
2008
|
"roll_api_key",
|
|
1675
2009
|
"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.",
|
|
1676
|
-
{ prefix:
|
|
2010
|
+
{ prefix: z6.string() },
|
|
1677
2011
|
(a) => client.keys.roll(a.prefix)
|
|
1678
2012
|
);
|
|
1679
2013
|
tool(
|
|
1680
2014
|
"update_api_key",
|
|
1681
2015
|
"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.",
|
|
1682
2016
|
{
|
|
1683
|
-
prefix:
|
|
1684
|
-
name:
|
|
1685
|
-
scopes:
|
|
1686
|
-
cbids:
|
|
1687
|
-
expiresAt:
|
|
2017
|
+
prefix: z6.string(),
|
|
2018
|
+
name: z6.string().optional(),
|
|
2019
|
+
scopes: z6.array(z6.string()).optional(),
|
|
2020
|
+
cbids: z6.array(z6.string()).min(1).optional(),
|
|
2021
|
+
expiresAt: z6.string().nullable().optional().describe("A new expiry (ISO date-time), or null to remove it.")
|
|
1688
2022
|
},
|
|
1689
2023
|
(a) => client.keys.update(a.prefix, {
|
|
1690
2024
|
...a.expiresAt !== void 0 ? { expiresAt: a.expiresAt } : {},
|
|
@@ -1697,7 +2031,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1697
2031
|
tool(
|
|
1698
2032
|
"update_org",
|
|
1699
2033
|
"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.",
|
|
1700
|
-
{ name:
|
|
2034
|
+
{ name: z6.string().min(1).optional(), logoUrl: z6.string().nullable().optional() },
|
|
1701
2035
|
(a) => client.org.update({
|
|
1702
2036
|
...a.name !== void 0 ? { name: a.name } : {},
|
|
1703
2037
|
...a.logoUrl !== void 0 ? { logoUrl: a.logoUrl } : {}
|
|
@@ -1713,20 +2047,20 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1713
2047
|
"set_mail_provider",
|
|
1714
2048
|
"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).",
|
|
1715
2049
|
{
|
|
1716
|
-
provider:
|
|
1717
|
-
fromEmail:
|
|
1718
|
-
fromName:
|
|
1719
|
-
replyTo:
|
|
1720
|
-
secret:
|
|
1721
|
-
ses:
|
|
1722
|
-
smtp:
|
|
2050
|
+
provider: z6.enum(["brevo", "sendgrid", "postmark", "resend", "ses", "smtp"]),
|
|
2051
|
+
fromEmail: z6.string().describe("An address on a domain your provider has verified."),
|
|
2052
|
+
fromName: z6.string().max(100).nullable().optional(),
|
|
2053
|
+
replyTo: z6.string().nullable().optional(),
|
|
2054
|
+
secret: z6.string().optional().describe("API key (Brevo, SendGrid, Resend), server token (Postmark), secret access key (SES) or SMTP password. Write-only."),
|
|
2055
|
+
ses: z6.object({ region: z6.string(), accessKeyId: z6.string() }).optional().describe("Required for ses."),
|
|
2056
|
+
smtp: z6.object({ host: z6.string(), port: z6.union([z6.literal(25), z6.literal(465), z6.literal(587), z6.literal(2525)]), security: z6.enum(["tls", "starttls"]), username: z6.string() }).optional().describe("Required for smtp. TLS is always required.")
|
|
1723
2057
|
},
|
|
1724
2058
|
(a) => client.org.mailProvider.set(a)
|
|
1725
2059
|
);
|
|
1726
2060
|
tool(
|
|
1727
2061
|
"test_mail_provider",
|
|
1728
2062
|
"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.",
|
|
1729
|
-
{ to:
|
|
2063
|
+
{ to: z6.string().optional().describe("Recipient. Default: the reply-to, else the from address.") },
|
|
1730
2064
|
(a) => client.org.mailProvider.test(a.to)
|
|
1731
2065
|
);
|
|
1732
2066
|
tool(
|
|
@@ -1738,13 +2072,44 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1738
2072
|
return { removed: true };
|
|
1739
2073
|
}
|
|
1740
2074
|
);
|
|
2075
|
+
tool(
|
|
2076
|
+
"get_org_controller",
|
|
2077
|
+
"The organisation\u2019s own data-controller identity: who every rights notice names, before any site config controller block. `set: false` when there is none. Read-only.",
|
|
2078
|
+
{},
|
|
2079
|
+
() => client.org.controller.get()
|
|
2080
|
+
);
|
|
2081
|
+
tool(
|
|
2082
|
+
"set_org_controller",
|
|
2083
|
+
"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.",
|
|
2084
|
+
{
|
|
2085
|
+
legalName: z6.string().describe("Required: the legal name of the data controller."),
|
|
2086
|
+
contactEmail: z6.string().optional().describe("Where people reach the controller about their data."),
|
|
2087
|
+
address: z6.string().optional(),
|
|
2088
|
+
dpoContact: z6.string().optional().describe("The Data Protection Officer: a name, an email address, or both.")
|
|
2089
|
+
},
|
|
2090
|
+
(a) => client.org.controller.set({
|
|
2091
|
+
legalName: a.legalName,
|
|
2092
|
+
...a.contactEmail !== void 0 ? { contactEmail: a.contactEmail } : {},
|
|
2093
|
+
...a.address !== void 0 ? { address: a.address } : {},
|
|
2094
|
+
...a.dpoContact !== void 0 ? { dpoContact: a.dpoContact } : {}
|
|
2095
|
+
})
|
|
2096
|
+
);
|
|
2097
|
+
tool(
|
|
2098
|
+
"remove_org_controller",
|
|
2099
|
+
"Remove the organisation\u2019s data-controller identity. Notices then name the request\u2019s site config controller block; a request without a cbid in an organisation with several sites gets no notice.",
|
|
2100
|
+
{},
|
|
2101
|
+
async () => {
|
|
2102
|
+
await client.org.controller.remove();
|
|
2103
|
+
return { removed: true };
|
|
2104
|
+
}
|
|
2105
|
+
);
|
|
1741
2106
|
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.";
|
|
1742
2107
|
const captchaInput = {
|
|
1743
|
-
mode:
|
|
1744
|
-
provider:
|
|
1745
|
-
siteKey:
|
|
1746
|
-
secret:
|
|
1747
|
-
minScore:
|
|
2108
|
+
mode: z6.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
|
|
2109
|
+
provider: z6.enum(["turnstile", "hcaptcha", "recaptcha_v2", "recaptcha_v3"]).optional().describe("Required for own."),
|
|
2110
|
+
siteKey: z6.string().optional().describe("Required for own: the public site key. List your rights-page hostnames on it at the provider."),
|
|
2111
|
+
secret: z6.string().optional().describe("The provider secret key. Write-only; never returned. Omit to keep the stored one (same provider)."),
|
|
2112
|
+
minScore: z6.number().min(0.1).max(0.9).optional().describe("reCAPTCHA v3 only. Default 0.5.")
|
|
1748
2113
|
};
|
|
1749
2114
|
const captchaBody = (a) => ({
|
|
1750
2115
|
mode: a.mode,
|
|
@@ -1753,22 +2118,40 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1753
2118
|
...a.secret !== void 0 ? { secret: a.secret } : {},
|
|
1754
2119
|
...a.minScore !== void 0 ? { minScore: a.minScore } : {}
|
|
1755
2120
|
});
|
|
2121
|
+
tool(
|
|
2122
|
+
"get_consent_sync_secret",
|
|
2123
|
+
"Whether hosted consent sync is set up for a site: `configured`, `secretLast4`, `createdAt`. Never returns the secret. Read-only.",
|
|
2124
|
+
{ cbid: z6.string() },
|
|
2125
|
+
(a) => client.consentSyncSecret.get(a.cbid)
|
|
2126
|
+
);
|
|
2127
|
+
tool(
|
|
2128
|
+
"rotate_consent_sync_secret",
|
|
2129
|
+
"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.",
|
|
2130
|
+
{ cbid: z6.string() },
|
|
2131
|
+
(a) => client.consentSyncSecret.rotate(a.cbid)
|
|
2132
|
+
);
|
|
2133
|
+
tool(
|
|
2134
|
+
"remove_consent_sync_secret",
|
|
2135
|
+
"Remove a site\u2019s consent-sync secret: hosted consent sync stops until a new one is minted. Needs sites:write and consent:write.",
|
|
2136
|
+
{ cbid: z6.string() },
|
|
2137
|
+
(a) => client.consentSyncSecret.remove(a.cbid)
|
|
2138
|
+
);
|
|
1756
2139
|
tool(
|
|
1757
2140
|
"get_rights_captcha",
|
|
1758
2141
|
"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.",
|
|
1759
|
-
{ cbid:
|
|
2142
|
+
{ cbid: z6.string() },
|
|
1760
2143
|
(a) => client.rightsCaptcha.get(a.cbid)
|
|
1761
2144
|
);
|
|
1762
2145
|
tool(
|
|
1763
2146
|
"set_rights_captcha",
|
|
1764
2147
|
`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.`,
|
|
1765
|
-
{ cbid:
|
|
2148
|
+
{ cbid: z6.string(), ...captchaInput },
|
|
1766
2149
|
(a) => client.rightsCaptcha.set(a.cbid, captchaBody(a))
|
|
1767
2150
|
);
|
|
1768
2151
|
tool(
|
|
1769
2152
|
"remove_rights_captcha",
|
|
1770
2153
|
"Remove a site\u2019s own captcha setting: it inherits the organisation default again (or off). Returns the setting now in force.",
|
|
1771
|
-
{ cbid:
|
|
2154
|
+
{ cbid: z6.string() },
|
|
1772
2155
|
(a) => client.rightsCaptcha.remove(a.cbid)
|
|
1773
2156
|
);
|
|
1774
2157
|
tool(
|
|
@@ -1791,15 +2174,15 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1791
2174
|
);
|
|
1792
2175
|
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.";
|
|
1793
2176
|
const identityInput = {
|
|
1794
|
-
type:
|
|
1795
|
-
issuer:
|
|
1796
|
-
jwksUrl:
|
|
1797
|
-
audience:
|
|
1798
|
-
authorizedParties:
|
|
1799
|
-
emailClaim:
|
|
1800
|
-
emailVerifiedClaim:
|
|
1801
|
-
sessionCookieName:
|
|
1802
|
-
trustEmailClaim:
|
|
2177
|
+
type: z6.enum(["clerk", "atlas", "oidc_jwt"]).describe("clerk, atlas (Clerk-shaped), or oidc_jwt (any issuer that signs session JWTs with a published JWKS)."),
|
|
2178
|
+
issuer: z6.string().describe("https URL exactly as in the token\u2019s iss (Clerk: your Frontend API URL)."),
|
|
2179
|
+
jwksUrl: z6.string().optional().describe("Required for oidc_jwt; clerk/atlas default to <issuer>/.well-known/jwks.json."),
|
|
2180
|
+
audience: z6.string().optional().describe("Expected aud. For oidc_jwt an audience or authorizedParties is required (a shared issuer mints tokens for every app)."),
|
|
2181
|
+
authorizedParties: z6.array(z6.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."),
|
|
2182
|
+
emailClaim: z6.string().optional().describe("Default email."),
|
|
2183
|
+
emailVerifiedClaim: z6.string().optional().describe("Default email_verified; must be exactly true."),
|
|
2184
|
+
sessionCookieName: z6.string().optional().describe("Default __session: the cookie the hosted page on your custom domain reads."),
|
|
2185
|
+
trustEmailClaim: z6.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.")
|
|
1803
2186
|
};
|
|
1804
2187
|
const identityBody = (a) => {
|
|
1805
2188
|
const out = { type: a.type, issuer: a.issuer };
|
|
@@ -1809,19 +2192,19 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1809
2192
|
tool(
|
|
1810
2193
|
"get_rights_identity",
|
|
1811
2194
|
"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.",
|
|
1812
|
-
{ cbid:
|
|
2195
|
+
{ cbid: z6.string() },
|
|
1813
2196
|
(a) => client.rightsIdentity.get(a.cbid)
|
|
1814
2197
|
);
|
|
1815
2198
|
tool(
|
|
1816
2199
|
"set_rights_identity",
|
|
1817
2200
|
`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.`,
|
|
1818
|
-
{ cbid:
|
|
2201
|
+
{ cbid: z6.string(), ...identityInput },
|
|
1819
2202
|
(a) => client.rightsIdentity.set(a.cbid, identityBody(a))
|
|
1820
2203
|
);
|
|
1821
2204
|
tool(
|
|
1822
2205
|
"remove_rights_identity",
|
|
1823
2206
|
"Remove a site\u2019s own sign-in provider: it inherits the organisation default again (or none). Returns the setting now in force.",
|
|
1824
|
-
{ cbid:
|
|
2207
|
+
{ cbid: z6.string() },
|
|
1825
2208
|
(a) => client.rightsIdentity.remove(a.cbid)
|
|
1826
2209
|
);
|
|
1827
2210
|
tool(
|
|
@@ -1845,22 +2228,40 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1845
2228
|
tool(
|
|
1846
2229
|
"get_audit_log",
|
|
1847
2230
|
"The organisation\u2019s audit log, newest first: administrative changes made in the dashboard or through the API, and who made them. Read-only.",
|
|
1848
|
-
{ limit:
|
|
1849
|
-
(a) => client.audit(a.limit)
|
|
2231
|
+
{ limit: z6.number().int().min(1).max(500).optional(), actor: z6.string().optional().describe('"self" for this key\u2019s own rows (allowed for scoped keys), or one actor id.') },
|
|
2232
|
+
(a) => client.audit(a.limit, a.actor ? { actor: a.actor } : void 0)
|
|
2233
|
+
);
|
|
2234
|
+
tool(
|
|
2235
|
+
"get_audit_sink",
|
|
2236
|
+
"Where the organisation\u2019s audit log is streamed (as CloudEvents) and how the last delivery went. Never the secret. Read-only.",
|
|
2237
|
+
{},
|
|
2238
|
+
() => client.auditSink.get()
|
|
2239
|
+
);
|
|
2240
|
+
tool(
|
|
2241
|
+
"set_audit_sink",
|
|
2242
|
+
"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.",
|
|
2243
|
+
{ type: z6.literal("webhook"), url: z6.string(), secret: z6.string().optional().describe("16\u2013256 characters; omitted: one is generated.") },
|
|
2244
|
+
(a) => client.auditSink.set({ type: "webhook", url: a.url, ...a.secret ? { secret: a.secret } : {} })
|
|
2245
|
+
);
|
|
2246
|
+
tool(
|
|
2247
|
+
"remove_audit_sink",
|
|
2248
|
+
"Stop streaming the audit log. Audited.",
|
|
2249
|
+
{},
|
|
2250
|
+
() => client.auditSink.remove()
|
|
1850
2251
|
);
|
|
1851
2252
|
tool(
|
|
1852
2253
|
"upload_asset",
|
|
1853
2254
|
"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.",
|
|
1854
2255
|
{
|
|
1855
|
-
data:
|
|
1856
|
-
contentType:
|
|
2256
|
+
data: z6.string(),
|
|
2257
|
+
contentType: z6.enum(["image/png", "image/jpeg", "image/webp", "image/gif", "image/svg+xml"])
|
|
1857
2258
|
},
|
|
1858
2259
|
(a) => client.assets.upload({ data: a.data, contentType: a.contentType })
|
|
1859
2260
|
);
|
|
1860
2261
|
tool(
|
|
1861
2262
|
"delete_asset",
|
|
1862
2263
|
"Delete a stored image by its URL (or file name). Only your own organisation\u2019s images can be named.",
|
|
1863
|
-
{ url:
|
|
2264
|
+
{ url: z6.string().describe("The URL upload_asset returned, or just its file name.") },
|
|
1864
2265
|
async (a) => {
|
|
1865
2266
|
await client.assets.delete(a.url);
|
|
1866
2267
|
return { deleted: a.url };
|
|
@@ -1875,18 +2276,18 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1875
2276
|
tool(
|
|
1876
2277
|
"get_customer",
|
|
1877
2278
|
"One child org: its controller details and usage. Read-only.",
|
|
1878
|
-
{ id:
|
|
2279
|
+
{ id: z6.string() },
|
|
1879
2280
|
(a) => client.reseller.get(a.id)
|
|
1880
2281
|
);
|
|
1881
2282
|
tool(
|
|
1882
2283
|
"provision_customer",
|
|
1883
2284
|
"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.",
|
|
1884
2285
|
{
|
|
1885
|
-
name:
|
|
1886
|
-
ownerEmail:
|
|
1887
|
-
delegatedAccess:
|
|
1888
|
-
mintKey:
|
|
1889
|
-
keyScopes:
|
|
2286
|
+
name: z6.string(),
|
|
2287
|
+
ownerEmail: z6.string().optional(),
|
|
2288
|
+
delegatedAccess: z6.boolean().optional().describe("Whether this reseller may act inside the child."),
|
|
2289
|
+
mintKey: z6.boolean().optional(),
|
|
2290
|
+
keyScopes: z6.array(z6.string()).optional()
|
|
1890
2291
|
},
|
|
1891
2292
|
(a) => client.reseller.create({
|
|
1892
2293
|
name: a.name,
|
|
@@ -1900,10 +2301,10 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1900
2301
|
"update_customer",
|
|
1901
2302
|
"Change a child org\u2019s status, delegated access or DSAR routing. `dsarRouting: null` clears the override.",
|
|
1902
2303
|
{
|
|
1903
|
-
id:
|
|
1904
|
-
status:
|
|
1905
|
-
delegatedAccess:
|
|
1906
|
-
dsarRouting:
|
|
2304
|
+
id: z6.string(),
|
|
2305
|
+
status: z6.enum(["active", "suspended"]).optional(),
|
|
2306
|
+
delegatedAccess: z6.boolean().optional(),
|
|
2307
|
+
dsarRouting: z6.enum(["reseller", "child"]).nullable().optional()
|
|
1907
2308
|
},
|
|
1908
2309
|
(a) => client.reseller.update(a.id, {
|
|
1909
2310
|
...a.status ? { status: a.status } : {},
|
|
@@ -1914,7 +2315,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1914
2315
|
tool(
|
|
1915
2316
|
"suspend_customer",
|
|
1916
2317
|
"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.)",
|
|
1917
|
-
{ id:
|
|
2318
|
+
{ id: z6.string() },
|
|
1918
2319
|
async (a) => {
|
|
1919
2320
|
await client.reseller.deprovision(a.id);
|
|
1920
2321
|
return { suspended: a.id };
|
|
@@ -1923,78 +2324,78 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1923
2324
|
tool(
|
|
1924
2325
|
"list_customer_keys",
|
|
1925
2326
|
"A child org's API key prefixes. Never the secrets. Read-only.",
|
|
1926
|
-
{ id:
|
|
2327
|
+
{ id: z6.string() },
|
|
1927
2328
|
(a) => client.reseller.listKeys(a.id)
|
|
1928
2329
|
);
|
|
1929
2330
|
tool(
|
|
1930
2331
|
"issue_customer_key",
|
|
1931
2332
|
"Mint an API key for a child org. The secret is returned once. Prefer scopes and a property lock over a full-access key.",
|
|
1932
|
-
{ id:
|
|
2333
|
+
{ id: z6.string(), name: z6.string().optional(), scopes: z6.array(z6.string()).optional(), cbids: z6.array(z6.string()).min(1).optional() },
|
|
1933
2334
|
(a) => client.reseller.mintKey(a.id, {
|
|
1934
2335
|
...a.name ? { name: a.name } : {},
|
|
1935
2336
|
...a.scopes ? { scopes: a.scopes } : {},
|
|
1936
2337
|
...a.cbids ? { cbids: a.cbids } : {}
|
|
1937
2338
|
})
|
|
1938
2339
|
);
|
|
1939
|
-
tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id:
|
|
2340
|
+
tool("revoke_customer_key", "Revoke a child org's API key by prefix. Takes effect immediately.", { id: z6.string(), prefix: z6.string() }, async (a) => {
|
|
1940
2341
|
await client.reseller.revokeKey(a.id, a.prefix);
|
|
1941
2342
|
return { revoked: a.prefix };
|
|
1942
2343
|
});
|
|
1943
2344
|
tool(
|
|
1944
2345
|
"erase_subject_data",
|
|
1945
2346
|
"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.",
|
|
1946
|
-
{ cbid:
|
|
2347
|
+
{ cbid: z6.string(), stamp: z6.string() },
|
|
1947
2348
|
(a) => client.consent.eraseSubject(a.cbid, a.stamp)
|
|
1948
2349
|
);
|
|
1949
2350
|
tool(
|
|
1950
2351
|
"export_subject_data",
|
|
1951
2352
|
"Export a data subject's consent records (GDPR access/portability).",
|
|
1952
|
-
{ cbid:
|
|
2353
|
+
{ cbid: z6.string(), stamp: z6.string() },
|
|
1953
2354
|
(a) => client.consent.exportSubject(a.cbid, a.stamp)
|
|
1954
2355
|
);
|
|
1955
2356
|
tool("list_banners", "List reusable banner designs in your org.", {}, () => client.banners.list());
|
|
1956
2357
|
tool(
|
|
1957
2358
|
"create_banner",
|
|
1958
2359
|
"Create a reusable banner design.",
|
|
1959
|
-
{ name:
|
|
2360
|
+
{ name: z6.string(), json: z6.record(z6.unknown()).describe("A v2 BannerConfig.") },
|
|
1960
2361
|
(a) => client.banners.create({ name: a.name, json: a.json })
|
|
1961
2362
|
);
|
|
1962
|
-
tool("get_banner", "Get a banner design by id.", { id:
|
|
2363
|
+
tool("get_banner", "Get a banner design by id.", { id: z6.string() }, (a) => client.banners.get(a.id));
|
|
1963
2364
|
tool(
|
|
1964
2365
|
"update_banner",
|
|
1965
2366
|
"Update a banner design (name and/or config).",
|
|
1966
|
-
{ id:
|
|
2367
|
+
{ id: z6.string(), name: z6.string().optional(), json: z6.record(z6.unknown()).optional() },
|
|
1967
2368
|
(a) => client.banners.update(a.id, {
|
|
1968
2369
|
...a.name !== void 0 ? { name: a.name } : {},
|
|
1969
2370
|
...a.json !== void 0 ? { json: a.json } : {}
|
|
1970
2371
|
})
|
|
1971
2372
|
);
|
|
1972
|
-
tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id:
|
|
2373
|
+
tool("delete_banner", "Delete a banner design (fails if assigned to sites).", { id: z6.string() }, async (a) => {
|
|
1973
2374
|
await client.banners.delete(a.id);
|
|
1974
2375
|
return { ok: true };
|
|
1975
2376
|
});
|
|
1976
2377
|
tool(
|
|
1977
2378
|
"get_banner_assignments",
|
|
1978
2379
|
"The sites (cbids) a banner design is currently assigned to. Read-only.",
|
|
1979
|
-
{ id:
|
|
2380
|
+
{ id: z6.string() },
|
|
1980
2381
|
(a) => client.banners.assignments(a.id)
|
|
1981
2382
|
);
|
|
1982
2383
|
tool(
|
|
1983
2384
|
"assign_banner",
|
|
1984
2385
|
"Set which sites (cbids) use a banner design.",
|
|
1985
|
-
{ id:
|
|
2386
|
+
{ id: z6.string(), cbids: z6.array(z6.string()) },
|
|
1986
2387
|
(a) => client.banners.setAssignments(a.id, a.cbids)
|
|
1987
2388
|
);
|
|
1988
2389
|
tool(
|
|
1989
2390
|
"publish_banner",
|
|
1990
2391
|
"Publish a design live to all its assigned sites.",
|
|
1991
|
-
{ id:
|
|
2392
|
+
{ id: z6.string() },
|
|
1992
2393
|
(a) => client.banners.publish(a.id)
|
|
1993
2394
|
);
|
|
1994
2395
|
}
|
|
1995
2396
|
|
|
1996
2397
|
// src/index.ts
|
|
1997
|
-
var MCP_VERSION = "0.
|
|
2398
|
+
var MCP_VERSION = "0.6.0";
|
|
1998
2399
|
function createCookieMunchMcp(opts) {
|
|
1999
2400
|
const client = opts.client ?? createCookieMunch({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
|
|
2000
2401
|
const server = new McpServer({ name: "cookiemunch", version: "1.0.0" });
|
|
@@ -2007,4 +2408,4 @@ export {
|
|
|
2007
2408
|
MCP_VERSION,
|
|
2008
2409
|
createCookieMunchMcp
|
|
2009
2410
|
};
|
|
2010
|
-
//# sourceMappingURL=chunk-
|
|
2411
|
+
//# sourceMappingURL=chunk-6NEWNBRL.js.map
|