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