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