@transcend-io/mcp-server-consent 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -0
- package/dist/cli.d.mts +1 -0
- package/dist/cli.mjs +13 -0
- package/dist/cli.mjs.map +1 -0
- package/dist/index.d.mts +183 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +2 -0
- package/dist/tools-D9t5xmGi.mjs +497 -0
- package/dist/tools-D9t5xmGi.mjs.map +1 -0
- package/package.json +57 -0
package/README.md
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
# @transcend-io/mcp-server-consent
|
|
2
|
+
|
|
3
|
+
> **Alpha** — this package is under active development and has not yet been published to npm. APIs may change without notice.
|
|
4
|
+
|
|
5
|
+
Transcend MCP Server for consent management. Provides tools for managing consent preferences, cookie triage, data flow management, and consent regime configuration.
|
|
6
|
+
|
|
7
|
+
Requires **Node.js ≥ 22.12** (see `engines` in `package.json`).
|
|
8
|
+
|
|
9
|
+
For local runs from this repository, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** at the repo root (gitignored) and set your API key (see **Run from the monorepo**).
|
|
10
|
+
|
|
11
|
+
## Install
|
|
12
|
+
|
|
13
|
+
When the package is available on npm, install the CLI globally:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install -g @transcend-io/mcp-server-consent
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Until then, run from a checkout of this repository (see **Run from the monorepo** below).
|
|
20
|
+
|
|
21
|
+
## Usage
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
# With TRANSCEND_API_KEY in the environment; from the monorepo use secret.env (see Run from the monorepo)
|
|
25
|
+
TRANSCEND_API_KEY=your-api-key transcend-mcp-consent
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
The process speaks MCP over **stdio** and is meant to be launched by an MCP client (for example Cursor or Claude Desktop), not used as an interactive shell.
|
|
29
|
+
|
|
30
|
+
### MCP client configuration
|
|
31
|
+
|
|
32
|
+
`npx` runs the package’s `transcend-mcp-consent` binary (see `bin` in `package.json`).
|
|
33
|
+
|
|
34
|
+
```json
|
|
35
|
+
{
|
|
36
|
+
"mcpServers": {
|
|
37
|
+
"transcend-consent": {
|
|
38
|
+
"command": "npx",
|
|
39
|
+
"args": ["-y", "@transcend-io/mcp-server-consent"],
|
|
40
|
+
"env": {
|
|
41
|
+
"TRANSCEND_API_KEY": "your-api-key"
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
When developing in this repository, reuse the same variable names from root **`secret.env`** in the `env` block, or use your client’s env-file support if it has one.
|
|
49
|
+
|
|
50
|
+
### Run from the monorepo
|
|
51
|
+
|
|
52
|
+
1. **Credentials** — From the repository root, copy [`secret.env.example`](../../../secret.env.example) to **`secret.env`** and set `TRANSCEND_API_KEY` (and optional URL overrides).
|
|
53
|
+
|
|
54
|
+
2. **Build and run** — `node ./dist/cli.mjs` matches the `transcend-mcp-consent` `bin` (use `node` because `pnpm exec transcend-mcp-consent` may not resolve this package’s own binary in a pnpm workspace):
|
|
55
|
+
|
|
56
|
+
```bash
|
|
57
|
+
# from the repository root — builds this package and its dependencies (e.g. mcp-server-core)
|
|
58
|
+
pnpm exec turbo run build --filter="@transcend-io/mcp-server-consent..."
|
|
59
|
+
set -a && source ./secret.env && set +a
|
|
60
|
+
pnpm -F @transcend-io/mcp-server-consent exec node ./dist/cli.mjs
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
**Alternative:** `./scripts/mcp-run.sh ./packages/mcp/mcp-server-consent/dist/cli.mjs` (sources `secret.env` when present; run after build).
|
|
64
|
+
|
|
65
|
+
See [CONTRIBUTING.md](../../../CONTRIBUTING.md#mcp-servers) for workspace layout and `pnpm --filter` workflows.
|
|
66
|
+
|
|
67
|
+
### Environment variables
|
|
68
|
+
|
|
69
|
+
| Variable | Required | Default | Description |
|
|
70
|
+
| ----------------------- | -------- | ------------------------------------------ | ----------------- |
|
|
71
|
+
| `TRANSCEND_API_KEY` | Yes | — | Transcend API key |
|
|
72
|
+
| `TRANSCEND_API_URL` | No | `https://multi-tenant.sombra.transcend.io` | Sombra API URL |
|
|
73
|
+
| `TRANSCEND_GRAPHQL_URL` | No | `https://api.transcend.io` | GraphQL API URL |
|
|
74
|
+
|
|
75
|
+
**Monorepo:** keep these in root **`secret.env`** (from [`secret.env.example`](../../../secret.env.example)); see **Run from the monorepo**.
|
|
76
|
+
|
|
77
|
+
## Tools
|
|
78
|
+
|
|
79
|
+
- `consent_get_preferences` — Get consent preferences for a user
|
|
80
|
+
- `consent_set_preferences` — Set consent preferences
|
|
81
|
+
- `consent_list_purposes` — List tracking purposes
|
|
82
|
+
- `consent_list_data_flows` — List data flows
|
|
83
|
+
- `consent_list_airgap_bundles` — List Airgap bundles
|
|
84
|
+
- `consent_list_regimes` — List consent regimes
|
|
85
|
+
- `consent_list_triage_cookies` — List cookies for triage
|
|
86
|
+
- `consent_list_triage_data_flows` — List data flows for triage
|
|
87
|
+
- `consent_get_triage_stats` — Get cookie/data flow triage statistics
|
|
88
|
+
- `consent_update_cookies` — Update cookies (approve, junk, assign purposes)
|
|
89
|
+
- `consent_update_data_flows` — Update data flows
|
|
90
|
+
- `consent_bulk_triage` — Bulk approve or junk cookies and data flows
|
|
91
|
+
|
|
92
|
+
## Related packages
|
|
93
|
+
|
|
94
|
+
Also available as part of the unified [`@transcend-io/mcp-server`](../mcp-server/README.md) which includes all domains. See the [root README](../../../README.md#mcp-servers) for the full list.
|
package/dist/cli.d.mts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
package/dist/cli.mjs
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { t as getConsentTools } from "./tools-D9t5xmGi.mjs";
|
|
3
|
+
import { createMCPServer } from "@transcend-io/mcp-server-core";
|
|
4
|
+
//#region src/cli.ts
|
|
5
|
+
createMCPServer({
|
|
6
|
+
name: "transcend-mcp-consent",
|
|
7
|
+
version: "1.0.0",
|
|
8
|
+
getTools: getConsentTools
|
|
9
|
+
});
|
|
10
|
+
//#endregion
|
|
11
|
+
export {};
|
|
12
|
+
|
|
13
|
+
//# sourceMappingURL=cli.mjs.map
|
package/dist/cli.mjs.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.mjs","names":[],"sources":["../src/cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport { createMCPServer } from '@transcend-io/mcp-server-core';\n\nimport { getConsentTools } from './tools/index.js';\n\ncreateMCPServer({\n name: 'transcend-mcp-consent',\n version: '1.0.0',\n getTools: getConsentTools,\n});\n"],"mappings":";;;;AAKA,gBAAgB;CACd,MAAM;CACN,SAAS;CACT,UAAU;CACX,CAAC"}
|
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,183 @@
|
|
|
1
|
+
import { ToolClients, ToolDefinition, TranscendGraphQLBase, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
import { ConsentTrackerStatus } from "@transcend-io/privacy-types";
|
|
3
|
+
import * as zod_v4_core0 from "zod/v4/core";
|
|
4
|
+
import * as zod from "zod";
|
|
5
|
+
|
|
6
|
+
//#region src/tools/index.d.ts
|
|
7
|
+
declare function getConsentTools(clients: ToolClients): ToolDefinition[];
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/resolveAirgapBundleId.d.ts
|
|
10
|
+
/**
|
|
11
|
+
* Lazily resolve the airgap bundle ID from the API key.
|
|
12
|
+
* Caches the result per GraphQL client instance so subsequent
|
|
13
|
+
* calls return instantly without an extra network request.
|
|
14
|
+
*/
|
|
15
|
+
declare function resolveAirgapBundleId(graphql: TranscendGraphQLBase): Promise<string>;
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/tools/consent_get_preferences.d.ts
|
|
18
|
+
declare const GetPreferencesSchema: z.ZodObject<{
|
|
19
|
+
identifier: z.ZodString;
|
|
20
|
+
partition: z.ZodOptional<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>;
|
|
22
|
+
type GetPreferencesInput = z.infer<typeof GetPreferencesSchema>;
|
|
23
|
+
//#endregion
|
|
24
|
+
//#region src/tools/consent_set_preferences.d.ts
|
|
25
|
+
declare const PurposeConsentSchema: z.ZodObject<{
|
|
26
|
+
purpose: z.ZodString;
|
|
27
|
+
enabled: z.ZodBoolean;
|
|
28
|
+
}, z.core.$strip>;
|
|
29
|
+
type PurposeConsentInput = z.infer<typeof PurposeConsentSchema>;
|
|
30
|
+
declare const SetPreferencesSchema: z.ZodObject<{
|
|
31
|
+
identifier: z.ZodOptional<z.ZodString>;
|
|
32
|
+
partition: z.ZodString;
|
|
33
|
+
purposes: z.ZodArray<z.ZodObject<{
|
|
34
|
+
purpose: z.ZodString;
|
|
35
|
+
enabled: z.ZodBoolean;
|
|
36
|
+
}, z.core.$strip>>;
|
|
37
|
+
confirmed: z.ZodOptional<z.ZodBoolean>;
|
|
38
|
+
}, z.core.$strip>;
|
|
39
|
+
type SetPreferencesInput = z.infer<typeof SetPreferencesSchema>;
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/tools/consent_list_airgap_bundles.d.ts
|
|
42
|
+
declare const ListAirgapBundlesSchema: zod.ZodObject<{}, zod_v4_core0.$strip>;
|
|
43
|
+
type ListAirgapBundlesInput = Record<string, never>;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/tools/consent_list_cookies.d.ts
|
|
46
|
+
declare const ListCookiesSchema: z.ZodObject<{
|
|
47
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
48
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
49
|
+
status: z.ZodEnum<typeof ConsentTrackerStatus>;
|
|
50
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
show_zero_activity: z.ZodOptional<z.ZodBoolean>;
|
|
52
|
+
text: z.ZodOptional<z.ZodString>;
|
|
53
|
+
service: z.ZodOptional<z.ZodString>;
|
|
54
|
+
order_field: z.ZodOptional<z.ZodEnum<{
|
|
55
|
+
Name: "name";
|
|
56
|
+
CreatedAt: "createdAt";
|
|
57
|
+
UpdatedAt: "updatedAt";
|
|
58
|
+
}>>;
|
|
59
|
+
order_direction: z.ZodOptional<z.ZodEnum<{
|
|
60
|
+
Asc: "ASC";
|
|
61
|
+
Desc: "DESC";
|
|
62
|
+
}>>;
|
|
63
|
+
}, z.core.$strip>;
|
|
64
|
+
type ListCookiesInput = z.infer<typeof ListCookiesSchema>;
|
|
65
|
+
//#endregion
|
|
66
|
+
//#region src/tools/consent_list_data_flows.d.ts
|
|
67
|
+
declare const ListDataFlowsSchema: z.ZodObject<{
|
|
68
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
69
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodNumber>>;
|
|
70
|
+
status: z.ZodEnum<typeof ConsentTrackerStatus>;
|
|
71
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
72
|
+
show_zero_activity: z.ZodOptional<z.ZodBoolean>;
|
|
73
|
+
text: z.ZodOptional<z.ZodString>;
|
|
74
|
+
service: z.ZodOptional<z.ZodString>;
|
|
75
|
+
order_field: z.ZodOptional<z.ZodEnum<{
|
|
76
|
+
Value: "value";
|
|
77
|
+
CreatedAt: "createdAt";
|
|
78
|
+
UpdatedAt: "updatedAt";
|
|
79
|
+
Occurrences: "occurrences";
|
|
80
|
+
Service: "service";
|
|
81
|
+
}>>;
|
|
82
|
+
order_direction: z.ZodOptional<z.ZodEnum<{
|
|
83
|
+
Asc: "ASC";
|
|
84
|
+
Desc: "DESC";
|
|
85
|
+
}>>;
|
|
86
|
+
}, z.core.$strip>;
|
|
87
|
+
type ListDataFlowsInput = z.infer<typeof ListDataFlowsSchema>;
|
|
88
|
+
//#endregion
|
|
89
|
+
//#region src/tools/consent_list_purposes.d.ts
|
|
90
|
+
declare const ListPurposesSchema: z.ZodObject<{
|
|
91
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
92
|
+
}, z.core.$strip>;
|
|
93
|
+
type ListPurposesInput = z.infer<typeof ListPurposesSchema>;
|
|
94
|
+
//#endregion
|
|
95
|
+
//#region src/tools/consent_list_regimes.d.ts
|
|
96
|
+
declare const ListRegimesSchema: z.ZodObject<{
|
|
97
|
+
limit: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
98
|
+
offset: z.ZodDefault<z.ZodOptional<z.ZodCoercedNumber<unknown>>>;
|
|
99
|
+
}, z.core.$strip>;
|
|
100
|
+
type ListRegimesInput = z.infer<typeof ListRegimesSchema>;
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/tools/consent_get_triage_stats.d.ts
|
|
103
|
+
declare const GetCookieStatsSchema: z.ZodObject<{}, z.core.$strip>;
|
|
104
|
+
type GetCookieStatsInput = z.infer<typeof GetCookieStatsSchema>;
|
|
105
|
+
//#endregion
|
|
106
|
+
//#region src/tools/consent_update_cookies.d.ts
|
|
107
|
+
declare const UpdateCookieItemSchema: z.ZodObject<{
|
|
108
|
+
name: z.ZodString;
|
|
109
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
110
|
+
description: z.ZodOptional<z.ZodString>;
|
|
111
|
+
service: z.ZodOptional<z.ZodString>;
|
|
112
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
113
|
+
status: z.ZodOptional<z.ZodEnum<typeof ConsentTrackerStatus>>;
|
|
114
|
+
}, z.core.$strip>;
|
|
115
|
+
type UpdateCookieItemInput = z.infer<typeof UpdateCookieItemSchema>;
|
|
116
|
+
declare const UpdateCookiesSchema: z.ZodObject<{
|
|
117
|
+
cookies: z.ZodArray<z.ZodObject<{
|
|
118
|
+
name: z.ZodString;
|
|
119
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
120
|
+
description: z.ZodOptional<z.ZodString>;
|
|
121
|
+
service: z.ZodOptional<z.ZodString>;
|
|
122
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
123
|
+
status: z.ZodOptional<z.ZodEnum<typeof ConsentTrackerStatus>>;
|
|
124
|
+
}, z.core.$strip>>;
|
|
125
|
+
}, z.core.$strip>;
|
|
126
|
+
type UpdateCookiesInput = z.infer<typeof UpdateCookiesSchema>;
|
|
127
|
+
//#endregion
|
|
128
|
+
//#region src/tools/consent_update_data_flows.d.ts
|
|
129
|
+
declare const UpdateDataFlowItemSchema: z.ZodObject<{
|
|
130
|
+
id: z.ZodString;
|
|
131
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
132
|
+
description: z.ZodOptional<z.ZodString>;
|
|
133
|
+
service: z.ZodOptional<z.ZodString>;
|
|
134
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
135
|
+
status: z.ZodOptional<z.ZodEnum<typeof ConsentTrackerStatus>>;
|
|
136
|
+
}, z.core.$strip>;
|
|
137
|
+
type UpdateDataFlowItemInput = z.infer<typeof UpdateDataFlowItemSchema>;
|
|
138
|
+
declare const UpdateDataFlowsSchema: z.ZodObject<{
|
|
139
|
+
data_flows: z.ZodArray<z.ZodObject<{
|
|
140
|
+
id: z.ZodString;
|
|
141
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
142
|
+
description: z.ZodOptional<z.ZodString>;
|
|
143
|
+
service: z.ZodOptional<z.ZodString>;
|
|
144
|
+
is_junk: z.ZodOptional<z.ZodBoolean>;
|
|
145
|
+
status: z.ZodOptional<z.ZodEnum<typeof ConsentTrackerStatus>>;
|
|
146
|
+
}, z.core.$strip>>;
|
|
147
|
+
}, z.core.$strip>;
|
|
148
|
+
type UpdateDataFlowsInput = z.infer<typeof UpdateDataFlowsSchema>;
|
|
149
|
+
//#endregion
|
|
150
|
+
//#region src/tools/consent_bulk_triage.d.ts
|
|
151
|
+
declare const BulkTriageItemSchema: z.ZodObject<{
|
|
152
|
+
type: z.ZodEnum<{
|
|
153
|
+
Cookie: "cookie";
|
|
154
|
+
DataFlow: "data_flow";
|
|
155
|
+
}>;
|
|
156
|
+
id: z.ZodString;
|
|
157
|
+
action: z.ZodEnum<{
|
|
158
|
+
Approve: "APPROVE";
|
|
159
|
+
Junk: "JUNK";
|
|
160
|
+
}>;
|
|
161
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
162
|
+
service: z.ZodOptional<z.ZodString>;
|
|
163
|
+
}, z.core.$strip>;
|
|
164
|
+
type BulkTriageItemInput = z.infer<typeof BulkTriageItemSchema>;
|
|
165
|
+
declare const BulkTriageSchema: z.ZodObject<{
|
|
166
|
+
items: z.ZodArray<z.ZodObject<{
|
|
167
|
+
type: z.ZodEnum<{
|
|
168
|
+
Cookie: "cookie";
|
|
169
|
+
DataFlow: "data_flow";
|
|
170
|
+
}>;
|
|
171
|
+
id: z.ZodString;
|
|
172
|
+
action: z.ZodEnum<{
|
|
173
|
+
Approve: "APPROVE";
|
|
174
|
+
Junk: "JUNK";
|
|
175
|
+
}>;
|
|
176
|
+
tracking_purposes: z.ZodOptional<z.ZodArray<z.ZodString>>;
|
|
177
|
+
service: z.ZodOptional<z.ZodString>;
|
|
178
|
+
}, z.core.$strip>>;
|
|
179
|
+
}, z.core.$strip>;
|
|
180
|
+
type BulkTriageInput = z.infer<typeof BulkTriageSchema>;
|
|
181
|
+
//#endregion
|
|
182
|
+
export { type BulkTriageInput, type BulkTriageItemInput, BulkTriageItemSchema, BulkTriageSchema, type GetCookieStatsInput, GetCookieStatsSchema, type GetPreferencesInput, GetPreferencesSchema, type ListAirgapBundlesInput, ListAirgapBundlesSchema, type ListCookiesInput, ListCookiesSchema, type ListDataFlowsInput, ListDataFlowsSchema, type ListPurposesInput, ListPurposesSchema, type ListRegimesInput, ListRegimesSchema, type PurposeConsentInput, PurposeConsentSchema, type SetPreferencesInput, SetPreferencesSchema, type UpdateCookieItemInput, UpdateCookieItemSchema, type UpdateCookiesInput, UpdateCookiesSchema, type UpdateDataFlowItemInput, UpdateDataFlowItemSchema, type UpdateDataFlowsInput, UpdateDataFlowsSchema, getConsentTools, resolveAirgapBundleId };
|
|
183
|
+
//# sourceMappingURL=index.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/tools/index.ts","../src/resolveAirgapBundleId.ts","../src/tools/consent_get_preferences.ts","../src/tools/consent_set_preferences.ts","../src/tools/consent_list_airgap_bundles.ts","../src/tools/consent_list_cookies.ts","../src/tools/consent_list_data_flows.ts","../src/tools/consent_list_purposes.ts","../src/tools/consent_list_regimes.ts","../src/tools/consent_get_triage_stats.ts","../src/tools/consent_update_cookies.ts","../src/tools/consent_update_data_flows.ts","../src/tools/consent_bulk_triage.ts"],"mappings":";;;;;;iBAcgB,eAAA,CAAgB,OAAA,EAAS,WAAA,GAAc,cAAA;;;;;;;;iBCDjC,qBAAA,CAAsB,OAAA,EAAS,oBAAA,GAAuB,OAAA;;;cCX/D,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;KAIrB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;;;cCJpC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;KAIrB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;AAAA,cAEpC,oBAAA,EAAoB,CAAA,CAAA,SAAA;;;;;;;;;KAMrB,mBAAA,GAAsB,CAAA,CAAE,KAAA,QAAa,oBAAA;;;cCHpC,uBAAA,EAAuB,GAAA,CAAA,SAAA,KAAc,YAAA,CAAd,MAAA;AAAA,KACxB,sBAAA,GAAyB,MAAA;;;cCFxB,iBAAA,EAAiB,CAAA,CAAA,SAAA;;;;;;;;;;;;;;;;;;KAalB,gBAAA,GAAmB,CAAA,CAAE,KAAA,QAAa,iBAAA;;;cCbjC,mBAAA,EAAmB,CAAA,C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ulkTriageItemSchema, i as UpdateCookieItemSchema, l as ListPurposesSchema, m as GetPreferencesSchema, n as UpdateDataFlowItemSchema, o as PurposeConsentSchema, p as GetCookieStatsSchema, r as UpdateDataFlowsSchema, s as SetPreferencesSchema, t as getConsentTools, u as ListDataFlowsSchema } from "./tools-D9t5xmGi.mjs";
|
|
2
|
+
export { BulkTriageItemSchema, BulkTriageSchema, GetCookieStatsSchema, GetPreferencesSchema, ListAirgapBundlesSchema, ListCookiesSchema, ListDataFlowsSchema, ListPurposesSchema, ListRegimesSchema, PurposeConsentSchema, SetPreferencesSchema, UpdateCookieItemSchema, UpdateCookiesSchema, UpdateDataFlowItemSchema, UpdateDataFlowsSchema, getConsentTools, resolveAirgapBundleId };
|
|
@@ -0,0 +1,497 @@
|
|
|
1
|
+
import { EmptySchema, createListResult, createToolResult, defineTool, z } from "@transcend-io/mcp-server-core";
|
|
2
|
+
import { ConsentTrackerStatus, ConsentTrackerType, CookieOrderField, DataFlowOrderField, OrderDirection, TriageAction } from "@transcend-io/privacy-types";
|
|
3
|
+
import { COOKIES, COOKIE_STATS, DATA_FLOWS, DATA_FLOW_STATS, EXPERIENCES, FETCH_CONSENT_MANAGER, FETCH_CONSENT_MANAGER_ID, PURPOSES, UPDATE_DATA_FLOWS, UPDATE_OR_CREATE_COOKIES } from "@transcend-io/sdk";
|
|
4
|
+
//#region src/resolveAirgapBundleId.ts
|
|
5
|
+
const bundleIdCache = /* @__PURE__ */ new WeakMap();
|
|
6
|
+
/**
|
|
7
|
+
* Lazily resolve the airgap bundle ID from the API key.
|
|
8
|
+
* Caches the result per GraphQL client instance so subsequent
|
|
9
|
+
* calls return instantly without an extra network request.
|
|
10
|
+
*/
|
|
11
|
+
async function resolveAirgapBundleId(graphql) {
|
|
12
|
+
const cached = bundleIdCache.get(graphql);
|
|
13
|
+
if (cached) return cached;
|
|
14
|
+
const id = (await graphql.makeRequest(FETCH_CONSENT_MANAGER_ID, {})).consentManager.consentManager.id;
|
|
15
|
+
bundleIdCache.set(graphql, id);
|
|
16
|
+
return id;
|
|
17
|
+
}
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/tools/consent_bulk_triage.ts
|
|
20
|
+
const BulkTriageItemSchema = z.object({
|
|
21
|
+
type: z.nativeEnum(ConsentTrackerType).describe("Item type"),
|
|
22
|
+
id: z.string().describe("Item ID (for data flows) or cookie name (for cookies)"),
|
|
23
|
+
action: z.nativeEnum(TriageAction).describe("Action to take: APPROVE or JUNK"),
|
|
24
|
+
tracking_purposes: z.array(z.string()).optional().describe("Tracking purposes to assign (required when approving)"),
|
|
25
|
+
service: z.string().optional().describe("Service name to assign")
|
|
26
|
+
});
|
|
27
|
+
const BulkTriageSchema = z.object({ items: z.array(BulkTriageItemSchema).min(1).describe("Items to triage") });
|
|
28
|
+
function createConsentBulkTriageTool(clients) {
|
|
29
|
+
return defineTool({
|
|
30
|
+
name: "consent_bulk_triage",
|
|
31
|
+
description: "Bulk triage action: approve or junk multiple cookies and data flows in a single call. For cookies, APPROVE sets status=LIVE; JUNK sets isJunk=true. For data flows, same behavior. Optionally assign tracking purposes and service when approving.",
|
|
32
|
+
category: "Consent Management",
|
|
33
|
+
readOnly: false,
|
|
34
|
+
confirmationHint: "Bulk approves or junks cookies and data flows",
|
|
35
|
+
annotations: {
|
|
36
|
+
readOnlyHint: false,
|
|
37
|
+
destructiveHint: true,
|
|
38
|
+
idempotentHint: false
|
|
39
|
+
},
|
|
40
|
+
zodSchema: BulkTriageSchema,
|
|
41
|
+
handler: async ({ items }) => {
|
|
42
|
+
const airgapBundleId = await resolveAirgapBundleId(clients.graphql);
|
|
43
|
+
const cookieItems = items.filter((i) => i.type === "cookie");
|
|
44
|
+
const dfItems = items.filter((i) => i.type === "data_flow");
|
|
45
|
+
const results = {
|
|
46
|
+
cookies: [],
|
|
47
|
+
dataFlows: []
|
|
48
|
+
};
|
|
49
|
+
if (cookieItems.length > 0) {
|
|
50
|
+
const cookieInputs = cookieItems.map((item) => ({
|
|
51
|
+
name: item.id,
|
|
52
|
+
...item.action === "APPROVE" ? {
|
|
53
|
+
status: ConsentTrackerStatus.Live,
|
|
54
|
+
isJunk: false
|
|
55
|
+
} : {
|
|
56
|
+
status: ConsentTrackerStatus.Live,
|
|
57
|
+
isJunk: true
|
|
58
|
+
},
|
|
59
|
+
...item.tracking_purposes ? { trackingPurposes: item.tracking_purposes } : {},
|
|
60
|
+
...item.service ? { service: item.service } : {}
|
|
61
|
+
}));
|
|
62
|
+
await clients.graphql.makeRequest(UPDATE_OR_CREATE_COOKIES, {
|
|
63
|
+
airgapBundleId,
|
|
64
|
+
cookies: cookieInputs
|
|
65
|
+
});
|
|
66
|
+
results.cookies = cookieInputs.map((c) => ({
|
|
67
|
+
name: c.name,
|
|
68
|
+
action: c.isJunk ? "JUNKED" : "APPROVED",
|
|
69
|
+
status: c.status || "LIVE"
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
72
|
+
if (dfItems.length > 0) {
|
|
73
|
+
const dfInputs = dfItems.map((item) => ({
|
|
74
|
+
id: item.id,
|
|
75
|
+
...item.action === "APPROVE" ? {
|
|
76
|
+
status: ConsentTrackerStatus.Live,
|
|
77
|
+
isJunk: false
|
|
78
|
+
} : {
|
|
79
|
+
status: ConsentTrackerStatus.Live,
|
|
80
|
+
isJunk: true
|
|
81
|
+
},
|
|
82
|
+
...item.tracking_purposes ? { purposeIds: item.tracking_purposes } : {},
|
|
83
|
+
...item.service ? { service: item.service } : {}
|
|
84
|
+
}));
|
|
85
|
+
results.dataFlows = (await clients.graphql.makeRequest(UPDATE_DATA_FLOWS, {
|
|
86
|
+
airgapBundleId,
|
|
87
|
+
dataFlows: dfInputs
|
|
88
|
+
})).updateDataFlows.dataFlows.map((df) => ({
|
|
89
|
+
id: df.id,
|
|
90
|
+
action: df.isJunk ? "JUNKED" : "APPROVED",
|
|
91
|
+
status: df.status
|
|
92
|
+
}));
|
|
93
|
+
}
|
|
94
|
+
return createToolResult(true, {
|
|
95
|
+
totalProcessed: cookieItems.length + dfItems.length,
|
|
96
|
+
...results
|
|
97
|
+
});
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
//#endregion
|
|
102
|
+
//#region src/tools/consent_get_preferences.ts
|
|
103
|
+
const GetPreferencesSchema = z.object({
|
|
104
|
+
identifier: z.string().describe("User identifier (e.g., email, user ID)"),
|
|
105
|
+
partition: z.string().optional().describe("Partition/organization context (optional)")
|
|
106
|
+
});
|
|
107
|
+
function createConsentGetPreferencesTool(clients) {
|
|
108
|
+
const { rest } = clients;
|
|
109
|
+
return defineTool({
|
|
110
|
+
name: "consent_get_preferences",
|
|
111
|
+
description: "Get consent preferences for a specific user/identifier",
|
|
112
|
+
category: "Consent Management",
|
|
113
|
+
readOnly: true,
|
|
114
|
+
annotations: {
|
|
115
|
+
readOnlyHint: true,
|
|
116
|
+
destructiveHint: false,
|
|
117
|
+
idempotentHint: true
|
|
118
|
+
},
|
|
119
|
+
zodSchema: GetPreferencesSchema,
|
|
120
|
+
handler: async ({ identifier, partition }) => {
|
|
121
|
+
const result = await rest.getConsentPreferences(identifier, partition);
|
|
122
|
+
if (!result) return createToolResult(true, {
|
|
123
|
+
found: false,
|
|
124
|
+
message: "No consent preferences found for this identifier"
|
|
125
|
+
});
|
|
126
|
+
return createToolResult(true, {
|
|
127
|
+
found: true,
|
|
128
|
+
preferences: result
|
|
129
|
+
});
|
|
130
|
+
}
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
//#endregion
|
|
134
|
+
//#region src/tools/consent_get_triage_stats.ts
|
|
135
|
+
const GetCookieStatsSchema = z.object({});
|
|
136
|
+
function createConsentGetTriageStatsTool(clients) {
|
|
137
|
+
return defineTool({
|
|
138
|
+
name: "consent_get_triage_stats",
|
|
139
|
+
description: "Get statistics on cookies and data flows: live (approved), needs review (triage), and junk counts.",
|
|
140
|
+
category: "Consent Management",
|
|
141
|
+
readOnly: true,
|
|
142
|
+
annotations: {
|
|
143
|
+
readOnlyHint: true,
|
|
144
|
+
destructiveHint: false,
|
|
145
|
+
idempotentHint: true
|
|
146
|
+
},
|
|
147
|
+
zodSchema: GetCookieStatsSchema,
|
|
148
|
+
handler: async () => {
|
|
149
|
+
const variables = { input: { airgapBundleId: await resolveAirgapBundleId(clients.graphql) } };
|
|
150
|
+
const [cookieData, dfData] = await Promise.all([clients.graphql.makeRequest(COOKIE_STATS, variables), clients.graphql.makeRequest(DATA_FLOW_STATS, variables)]);
|
|
151
|
+
return createToolResult(true, {
|
|
152
|
+
cookies: cookieData.cookieStats,
|
|
153
|
+
dataFlows: dfData.dataFlowStats
|
|
154
|
+
});
|
|
155
|
+
}
|
|
156
|
+
});
|
|
157
|
+
}
|
|
158
|
+
//#endregion
|
|
159
|
+
//#region src/tools/consent_list_airgap_bundles.ts
|
|
160
|
+
const ListAirgapBundlesSchema = EmptySchema;
|
|
161
|
+
function createConsentListAirgapBundlesTool(clients) {
|
|
162
|
+
return defineTool({
|
|
163
|
+
name: "consent_list_airgap_bundles",
|
|
164
|
+
description: "Get the consent manager (airgap bundle) configured for your organization. Returns the bundle ID, URLs, configuration, and domains.",
|
|
165
|
+
category: "Consent Management",
|
|
166
|
+
readOnly: true,
|
|
167
|
+
annotations: {
|
|
168
|
+
readOnlyHint: true,
|
|
169
|
+
destructiveHint: false,
|
|
170
|
+
idempotentHint: true
|
|
171
|
+
},
|
|
172
|
+
zodSchema: ListAirgapBundlesSchema,
|
|
173
|
+
handler: async (_args) => {
|
|
174
|
+
return createToolResult(true, (await clients.graphql.makeRequest(FETCH_CONSENT_MANAGER, {})).consentManager.consentManager);
|
|
175
|
+
}
|
|
176
|
+
});
|
|
177
|
+
}
|
|
178
|
+
//#endregion
|
|
179
|
+
//#region src/tools/consent_list_cookies.ts
|
|
180
|
+
const ListCookiesSchema = z.object({
|
|
181
|
+
limit: z.number().min(1).max(200).optional().default(50),
|
|
182
|
+
offset: z.number().min(0).optional().default(0),
|
|
183
|
+
status: z.nativeEnum(ConsentTrackerStatus).describe("Filter by status: NEEDS_REVIEW (triage) or LIVE (approved)"),
|
|
184
|
+
is_junk: z.boolean().optional().describe("Filter by junk status"),
|
|
185
|
+
show_zero_activity: z.boolean().optional().describe("Include items with zero activity"),
|
|
186
|
+
text: z.string().optional().describe("Search text filter"),
|
|
187
|
+
service: z.string().optional().describe("Filter by service name"),
|
|
188
|
+
order_field: z.nativeEnum(CookieOrderField).optional().describe("Field to sort by"),
|
|
189
|
+
order_direction: z.nativeEnum(OrderDirection).optional().describe("Sort direction: ASC or DESC")
|
|
190
|
+
});
|
|
191
|
+
function createConsentListCookiesTool(clients) {
|
|
192
|
+
return defineTool({
|
|
193
|
+
name: "consent_list_cookies",
|
|
194
|
+
description: "List cookies in your consent manager. Requires a status filter: NEEDS_REVIEW for triage backlog, LIVE for approved cookies. Returns name, service, tracking purposes, activity (occurrences), junk status, and more.",
|
|
195
|
+
category: "Consent Management",
|
|
196
|
+
readOnly: true,
|
|
197
|
+
annotations: {
|
|
198
|
+
readOnlyHint: true,
|
|
199
|
+
destructiveHint: false,
|
|
200
|
+
idempotentHint: true
|
|
201
|
+
},
|
|
202
|
+
zodSchema: ListCookiesSchema,
|
|
203
|
+
handler: async ({ limit, offset, status, is_junk, show_zero_activity, text, service, order_field, order_direction }) => {
|
|
204
|
+
const airgapBundleId = await resolveAirgapBundleId(clients.graphql);
|
|
205
|
+
const { nodes, totalCount } = (await clients.graphql.makeRequest(COOKIES, {
|
|
206
|
+
input: { airgapBundleId },
|
|
207
|
+
first: limit,
|
|
208
|
+
offset,
|
|
209
|
+
filterBy: {
|
|
210
|
+
status,
|
|
211
|
+
...is_junk !== void 0 ? { isJunk: is_junk } : {},
|
|
212
|
+
...show_zero_activity !== void 0 ? { showZeroActivity: show_zero_activity } : {},
|
|
213
|
+
...text ? { text } : {},
|
|
214
|
+
...service ? { service } : {}
|
|
215
|
+
},
|
|
216
|
+
...order_field && order_direction ? { orderBy: [{
|
|
217
|
+
field: order_field,
|
|
218
|
+
direction: order_direction
|
|
219
|
+
}] } : {}
|
|
220
|
+
})).cookies;
|
|
221
|
+
return createListResult(nodes, {
|
|
222
|
+
totalCount,
|
|
223
|
+
hasNextPage: offset + nodes.length < totalCount
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/tools/consent_list_data_flows.ts
|
|
230
|
+
const ListDataFlowsSchema = z.object({
|
|
231
|
+
limit: z.number().min(1).max(200).optional().default(50),
|
|
232
|
+
offset: z.number().min(0).optional().default(0),
|
|
233
|
+
status: z.nativeEnum(ConsentTrackerStatus).describe("Filter by status: NEEDS_REVIEW (triage) or LIVE (approved)"),
|
|
234
|
+
is_junk: z.boolean().optional().describe("Filter by junk status"),
|
|
235
|
+
show_zero_activity: z.boolean().optional().describe("Include items with zero activity"),
|
|
236
|
+
text: z.string().optional().describe("Search text filter"),
|
|
237
|
+
service: z.string().optional().describe("Filter by service name"),
|
|
238
|
+
order_field: z.nativeEnum(DataFlowOrderField).optional().describe("Field to sort by"),
|
|
239
|
+
order_direction: z.nativeEnum(OrderDirection).optional().describe("Sort direction: ASC or DESC")
|
|
240
|
+
});
|
|
241
|
+
function createConsentListDataFlowsTool(clients) {
|
|
242
|
+
return defineTool({
|
|
243
|
+
name: "consent_list_data_flows",
|
|
244
|
+
description: "List data flows (network requests) in your consent manager. Requires a status filter: NEEDS_REVIEW for triage backlog, LIVE for approved flows. Returns value (URL/host), service, tracking purposes, activity (occurrences), and more.",
|
|
245
|
+
category: "Consent Management",
|
|
246
|
+
readOnly: true,
|
|
247
|
+
annotations: {
|
|
248
|
+
readOnlyHint: true,
|
|
249
|
+
destructiveHint: false,
|
|
250
|
+
idempotentHint: true
|
|
251
|
+
},
|
|
252
|
+
zodSchema: ListDataFlowsSchema,
|
|
253
|
+
handler: async ({ limit, offset, status, is_junk, show_zero_activity, text, service, order_field, order_direction }) => {
|
|
254
|
+
const airgapBundleId = await resolveAirgapBundleId(clients.graphql);
|
|
255
|
+
const { nodes, totalCount } = (await clients.graphql.makeRequest(DATA_FLOWS, {
|
|
256
|
+
input: { airgapBundleId },
|
|
257
|
+
first: limit,
|
|
258
|
+
offset,
|
|
259
|
+
filterBy: {
|
|
260
|
+
status,
|
|
261
|
+
...is_junk !== void 0 ? { isJunk: is_junk } : {},
|
|
262
|
+
...show_zero_activity !== void 0 ? { showZeroActivity: show_zero_activity } : {},
|
|
263
|
+
...text ? { text } : {},
|
|
264
|
+
...service ? { service } : {}
|
|
265
|
+
},
|
|
266
|
+
...order_field && order_direction ? { orderBy: [{
|
|
267
|
+
field: order_field,
|
|
268
|
+
direction: order_direction
|
|
269
|
+
}] } : {}
|
|
270
|
+
})).dataFlows;
|
|
271
|
+
return createListResult(nodes, {
|
|
272
|
+
totalCount,
|
|
273
|
+
hasNextPage: offset + nodes.length < totalCount
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
});
|
|
277
|
+
}
|
|
278
|
+
//#endregion
|
|
279
|
+
//#region src/tools/consent_list_purposes.ts
|
|
280
|
+
const ListPurposesSchema = z.object({ limit: z.coerce.number().min(1).max(100).optional().default(50) });
|
|
281
|
+
function createConsentListPurposesTool(clients) {
|
|
282
|
+
return defineTool({
|
|
283
|
+
name: "consent_list_purposes",
|
|
284
|
+
description: "List all tracking purposes configured for consent management (max ~100 results).",
|
|
285
|
+
category: "Consent Management",
|
|
286
|
+
readOnly: true,
|
|
287
|
+
annotations: {
|
|
288
|
+
readOnlyHint: true,
|
|
289
|
+
destructiveHint: false,
|
|
290
|
+
idempotentHint: true
|
|
291
|
+
},
|
|
292
|
+
zodSchema: ListPurposesSchema,
|
|
293
|
+
handler: async ({ limit }) => {
|
|
294
|
+
const { nodes, totalCount } = (await clients.graphql.makeRequest(PURPOSES, { first: Math.min(limit, 100) })).purposes;
|
|
295
|
+
return createListResult(nodes, {
|
|
296
|
+
totalCount,
|
|
297
|
+
hasNextPage: nodes.length < totalCount
|
|
298
|
+
});
|
|
299
|
+
}
|
|
300
|
+
});
|
|
301
|
+
}
|
|
302
|
+
//#endregion
|
|
303
|
+
//#region src/tools/consent_list_regimes.ts
|
|
304
|
+
const ListRegimesSchema = z.object({
|
|
305
|
+
limit: z.coerce.number().min(1).max(100).optional().default(50),
|
|
306
|
+
offset: z.coerce.number().min(0).optional().default(0)
|
|
307
|
+
});
|
|
308
|
+
function createConsentListRegimesTool(clients) {
|
|
309
|
+
return defineTool({
|
|
310
|
+
name: "consent_list_regimes",
|
|
311
|
+
description: "List all consent experiences (regional regimes) configured for your organization. Returns experience name, regions, purposes, opted-out purposes, and view state.",
|
|
312
|
+
category: "Consent Management",
|
|
313
|
+
readOnly: true,
|
|
314
|
+
annotations: {
|
|
315
|
+
readOnlyHint: true,
|
|
316
|
+
destructiveHint: false,
|
|
317
|
+
idempotentHint: true
|
|
318
|
+
},
|
|
319
|
+
zodSchema: ListRegimesSchema,
|
|
320
|
+
handler: async ({ limit, offset }) => {
|
|
321
|
+
const { totalCount, nodes } = (await clients.graphql.makeRequest(EXPERIENCES, {
|
|
322
|
+
first: limit,
|
|
323
|
+
offset
|
|
324
|
+
})).experiences;
|
|
325
|
+
return createListResult(nodes, {
|
|
326
|
+
totalCount,
|
|
327
|
+
hasNextPage: offset + nodes.length < totalCount
|
|
328
|
+
});
|
|
329
|
+
}
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
//#endregion
|
|
333
|
+
//#region src/tools/consent_set_preferences.ts
|
|
334
|
+
const PurposeConsentSchema = z.object({
|
|
335
|
+
purpose: z.string().describe("Purpose slug"),
|
|
336
|
+
enabled: z.boolean().describe("Whether consent is granted")
|
|
337
|
+
});
|
|
338
|
+
const SetPreferencesSchema = z.object({
|
|
339
|
+
identifier: z.string().optional().describe("User identifier"),
|
|
340
|
+
partition: z.string().describe("Partition/organization context"),
|
|
341
|
+
purposes: z.array(PurposeConsentSchema).describe("Array of purpose consent settings"),
|
|
342
|
+
confirmed: z.boolean().optional().describe("Whether consent was explicitly confirmed")
|
|
343
|
+
});
|
|
344
|
+
function createConsentSetPreferencesTool(clients) {
|
|
345
|
+
const { rest } = clients;
|
|
346
|
+
return defineTool({
|
|
347
|
+
name: "consent_set_preferences",
|
|
348
|
+
description: "Set consent preferences for a user (client-side sync)",
|
|
349
|
+
category: "Consent Management",
|
|
350
|
+
readOnly: false,
|
|
351
|
+
confirmationHint: "Updates consent preferences for the user",
|
|
352
|
+
annotations: {
|
|
353
|
+
readOnlyHint: false,
|
|
354
|
+
destructiveHint: false,
|
|
355
|
+
idempotentHint: true
|
|
356
|
+
},
|
|
357
|
+
zodSchema: SetPreferencesSchema,
|
|
358
|
+
handler: async ({ partition, identifier, purposes, confirmed }) => {
|
|
359
|
+
return createToolResult(true, {
|
|
360
|
+
...await rest.syncConsent({
|
|
361
|
+
partition,
|
|
362
|
+
identifier,
|
|
363
|
+
purposes: purposes.map((p) => ({
|
|
364
|
+
purpose: p.purpose,
|
|
365
|
+
enabled: p.enabled
|
|
366
|
+
})),
|
|
367
|
+
confirmed
|
|
368
|
+
}),
|
|
369
|
+
message: "Consent preferences synced successfully"
|
|
370
|
+
});
|
|
371
|
+
}
|
|
372
|
+
});
|
|
373
|
+
}
|
|
374
|
+
//#endregion
|
|
375
|
+
//#region src/tools/consent_update_cookies.ts
|
|
376
|
+
const UpdateCookieItemSchema = z.object({
|
|
377
|
+
name: z.string().describe("Cookie name (used as the identifier for upsert)"),
|
|
378
|
+
tracking_purposes: z.array(z.string()).optional().describe("Tracking purpose slugs (e.g., \"Advertising\", \"Analytics\")"),
|
|
379
|
+
description: z.string().optional().describe("Cookie description"),
|
|
380
|
+
service: z.string().optional().describe("Service/integration name"),
|
|
381
|
+
is_junk: z.boolean().optional().describe("Mark as junk"),
|
|
382
|
+
status: z.nativeEnum(ConsentTrackerStatus).optional().describe("Set status to LIVE (approve) or NEEDS_REVIEW")
|
|
383
|
+
});
|
|
384
|
+
const UpdateCookiesSchema = z.object({ cookies: z.array(UpdateCookieItemSchema).min(1).describe("Cookies to update") });
|
|
385
|
+
function createConsentUpdateCookiesTool(clients) {
|
|
386
|
+
return defineTool({
|
|
387
|
+
name: "consent_update_cookies",
|
|
388
|
+
description: "Update one or more cookies. Use to approve (status=LIVE), junk (is_junk=true), assign tracking purposes, or set a service. The cookie \"name\" field is the identifier for upsert — existing cookies with matching names will be updated.",
|
|
389
|
+
category: "Consent Management",
|
|
390
|
+
readOnly: false,
|
|
391
|
+
confirmationHint: "Updates cookies in the consent manager",
|
|
392
|
+
annotations: {
|
|
393
|
+
readOnlyHint: false,
|
|
394
|
+
destructiveHint: true,
|
|
395
|
+
idempotentHint: true
|
|
396
|
+
},
|
|
397
|
+
zodSchema: UpdateCookiesSchema,
|
|
398
|
+
handler: async ({ cookies }) => {
|
|
399
|
+
const airgapBundleId = await resolveAirgapBundleId(clients.graphql);
|
|
400
|
+
const cookieInputs = cookies.map((c) => ({
|
|
401
|
+
name: c.name,
|
|
402
|
+
...c.tracking_purposes ? { trackingPurposes: c.tracking_purposes } : {},
|
|
403
|
+
...c.description !== void 0 ? { description: c.description } : {},
|
|
404
|
+
...c.service !== void 0 ? { service: c.service } : {},
|
|
405
|
+
...c.is_junk !== void 0 ? { isJunk: c.is_junk } : {},
|
|
406
|
+
...c.status !== void 0 ? { status: c.status } : {}
|
|
407
|
+
}));
|
|
408
|
+
await clients.graphql.makeRequest(UPDATE_OR_CREATE_COOKIES, {
|
|
409
|
+
airgapBundleId,
|
|
410
|
+
cookies: cookieInputs
|
|
411
|
+
});
|
|
412
|
+
return createToolResult(true, {
|
|
413
|
+
updated: cookieInputs.length,
|
|
414
|
+
cookies: cookieInputs.map((c) => ({
|
|
415
|
+
name: c.name,
|
|
416
|
+
status: c.status,
|
|
417
|
+
isJunk: c.isJunk,
|
|
418
|
+
trackingPurposes: c.trackingPurposes,
|
|
419
|
+
service: c.service
|
|
420
|
+
}))
|
|
421
|
+
});
|
|
422
|
+
}
|
|
423
|
+
});
|
|
424
|
+
}
|
|
425
|
+
//#endregion
|
|
426
|
+
//#region src/tools/consent_update_data_flows.ts
|
|
427
|
+
const UpdateDataFlowItemSchema = z.object({
|
|
428
|
+
id: z.string().describe("Data flow ID"),
|
|
429
|
+
tracking_purposes: z.array(z.string()).optional().describe("Tracking purpose slugs"),
|
|
430
|
+
description: z.string().optional().describe("Data flow description"),
|
|
431
|
+
service: z.string().optional().describe("Service/integration name"),
|
|
432
|
+
is_junk: z.boolean().optional().describe("Mark as junk"),
|
|
433
|
+
status: z.nativeEnum(ConsentTrackerStatus).optional().describe("Set status to LIVE (approve) or NEEDS_REVIEW")
|
|
434
|
+
});
|
|
435
|
+
const UpdateDataFlowsSchema = z.object({ data_flows: z.array(UpdateDataFlowItemSchema).min(1).describe("Data flows to update") });
|
|
436
|
+
function createConsentUpdateDataFlowsTool(clients) {
|
|
437
|
+
return defineTool({
|
|
438
|
+
name: "consent_update_data_flows",
|
|
439
|
+
description: "Update one or more data flows. Use to approve (status=LIVE), junk (is_junk=true), assign tracking purposes, or set a service.",
|
|
440
|
+
category: "Consent Management",
|
|
441
|
+
readOnly: false,
|
|
442
|
+
confirmationHint: "Updates data flows in the consent manager",
|
|
443
|
+
annotations: {
|
|
444
|
+
readOnlyHint: false,
|
|
445
|
+
destructiveHint: true,
|
|
446
|
+
idempotentHint: true
|
|
447
|
+
},
|
|
448
|
+
zodSchema: UpdateDataFlowsSchema,
|
|
449
|
+
handler: async ({ data_flows }) => {
|
|
450
|
+
const airgapBundleId = await resolveAirgapBundleId(clients.graphql);
|
|
451
|
+
const dfInputs = data_flows.map((df) => ({
|
|
452
|
+
id: df.id,
|
|
453
|
+
...df.tracking_purposes ? { purposeIds: df.tracking_purposes } : {},
|
|
454
|
+
...df.description !== void 0 ? { description: df.description } : {},
|
|
455
|
+
...df.service !== void 0 ? { service: df.service } : {},
|
|
456
|
+
...df.is_junk !== void 0 ? { isJunk: df.is_junk } : {},
|
|
457
|
+
...df.status !== void 0 ? { status: df.status } : {}
|
|
458
|
+
}));
|
|
459
|
+
const data = await clients.graphql.makeRequest(UPDATE_DATA_FLOWS, {
|
|
460
|
+
airgapBundleId,
|
|
461
|
+
dataFlows: dfInputs
|
|
462
|
+
});
|
|
463
|
+
return createToolResult(true, {
|
|
464
|
+
updated: data.updateDataFlows.dataFlows.length,
|
|
465
|
+
dataFlows: data.updateDataFlows.dataFlows.map((df) => ({
|
|
466
|
+
id: df.id,
|
|
467
|
+
value: df.value,
|
|
468
|
+
status: df.status,
|
|
469
|
+
isJunk: df.isJunk,
|
|
470
|
+
purposes: df.purposes.map((p) => p.name),
|
|
471
|
+
service: df.service?.title
|
|
472
|
+
}))
|
|
473
|
+
});
|
|
474
|
+
}
|
|
475
|
+
});
|
|
476
|
+
}
|
|
477
|
+
//#endregion
|
|
478
|
+
//#region src/tools/index.ts
|
|
479
|
+
function getConsentTools(clients) {
|
|
480
|
+
return [
|
|
481
|
+
createConsentGetPreferencesTool(clients),
|
|
482
|
+
createConsentSetPreferencesTool(clients),
|
|
483
|
+
createConsentListPurposesTool(clients),
|
|
484
|
+
createConsentListDataFlowsTool(clients),
|
|
485
|
+
createConsentListCookiesTool(clients),
|
|
486
|
+
createConsentListAirgapBundlesTool(clients),
|
|
487
|
+
createConsentListRegimesTool(clients),
|
|
488
|
+
createConsentGetTriageStatsTool(clients),
|
|
489
|
+
createConsentUpdateCookiesTool(clients),
|
|
490
|
+
createConsentUpdateDataFlowsTool(clients),
|
|
491
|
+
createConsentBulkTriageTool(clients)
|
|
492
|
+
];
|
|
493
|
+
}
|
|
494
|
+
//#endregion
|
|
495
|
+
export { resolveAirgapBundleId as _, UpdateCookiesSchema as a, ListRegimesSchema as c, ListCookiesSchema as d, ListAirgapBundlesSchema as f, BulkTriageSchema as g, BulkTriageItemSchema as h, UpdateCookieItemSchema as i, ListPurposesSchema as l, GetPreferencesSchema as m, UpdateDataFlowItemSchema as n, PurposeConsentSchema as o, GetCookieStatsSchema as p, UpdateDataFlowsSchema as r, SetPreferencesSchema as s, getConsentTools as t, ListDataFlowsSchema as u };
|
|
496
|
+
|
|
497
|
+
//# sourceMappingURL=tools-D9t5xmGi.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"tools-D9t5xmGi.mjs","names":[],"sources":["../src/resolveAirgapBundleId.ts","../src/tools/consent_bulk_triage.ts","../src/tools/consent_get_preferences.ts","../src/tools/consent_get_triage_stats.ts","../src/tools/consent_list_airgap_bundles.ts","../src/tools/consent_list_cookies.ts","../src/tools/consent_list_data_flows.ts","../src/tools/consent_list_purposes.ts","../src/tools/consent_list_regimes.ts","../src/tools/consent_set_preferences.ts","../src/tools/consent_update_cookies.ts","../src/tools/consent_update_data_flows.ts","../src/tools/index.ts"],"sourcesContent":["import type { TranscendGraphQLBase } from '@transcend-io/mcp-server-core';\nimport {\n FETCH_CONSENT_MANAGER_ID,\n type TranscendCliFetchConsentManagerIdResponse,\n} from '@transcend-io/sdk';\n\nconst bundleIdCache = new WeakMap<TranscendGraphQLBase, string>();\n\n/**\n * Lazily resolve the airgap bundle ID from the API key.\n * Caches the result per GraphQL client instance so subsequent\n * calls return instantly without an extra network request.\n */\nexport async function resolveAirgapBundleId(graphql: TranscendGraphQLBase): Promise<string> {\n const cached = bundleIdCache.get(graphql);\n if (cached) return cached;\n\n const data = await graphql.makeRequest<TranscendCliFetchConsentManagerIdResponse>(\n FETCH_CONSENT_MANAGER_ID,\n {},\n );\n\n const id = data.consentManager.consentManager.id;\n bundleIdCache.set(graphql, id);\n return id;\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport {\n ConsentTrackerStatus,\n ConsentTrackerType,\n TriageAction,\n} from '@transcend-io/privacy-types';\nimport {\n UPDATE_OR_CREATE_COOKIES,\n UPDATE_DATA_FLOWS,\n type TranscendUpdateCookieInputGql,\n type TranscendUpdateDataFlowInputGql,\n type TranscendCliUpdateOrCreateCookiesResponse,\n type TranscendCliUpdateDataFlowsResponse,\n} from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const BulkTriageItemSchema = z.object({\n type: z.nativeEnum(ConsentTrackerType).describe('Item type'),\n id: z.string().describe('Item ID (for data flows) or cookie name (for cookies)'),\n action: z.nativeEnum(TriageAction).describe('Action to take: APPROVE or JUNK'),\n tracking_purposes: z\n .array(z.string())\n .optional()\n .describe('Tracking purposes to assign (required when approving)'),\n service: z.string().optional().describe('Service name to assign'),\n});\nexport type BulkTriageItemInput = z.infer<typeof BulkTriageItemSchema>;\n\nexport const BulkTriageSchema = z.object({\n items: z.array(BulkTriageItemSchema).min(1).describe('Items to triage'),\n});\nexport type BulkTriageInput = z.infer<typeof BulkTriageSchema>;\n\nexport function createConsentBulkTriageTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_bulk_triage',\n description:\n 'Bulk triage action: approve or junk multiple cookies and data flows in a single call. ' +\n 'For cookies, APPROVE sets status=LIVE; JUNK sets isJunk=true. ' +\n 'For data flows, same behavior. Optionally assign tracking purposes and service when approving.',\n category: 'Consent Management',\n readOnly: false,\n confirmationHint: 'Bulk approves or junks cookies and data flows',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: false },\n zodSchema: BulkTriageSchema,\n handler: async ({ items }) => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const cookieItems = items.filter((i) => i.type === 'cookie');\n const dfItems = items.filter((i) => i.type === 'data_flow');\n\n const results: {\n /** Updated cookies */\n cookies: { name: string; action: string; status: string }[];\n /** Updated data flows */\n dataFlows: { id: string; action: string; status: string }[];\n } = { cookies: [], dataFlows: [] };\n\n if (cookieItems.length > 0) {\n const cookieInputs: TranscendUpdateCookieInputGql[] = cookieItems.map((item) => ({\n name: item.id,\n ...(item.action === 'APPROVE'\n ? { status: ConsentTrackerStatus.Live, isJunk: false }\n : { status: ConsentTrackerStatus.Live, isJunk: true }),\n ...(item.tracking_purposes ? { trackingPurposes: item.tracking_purposes } : {}),\n ...(item.service ? { service: item.service } : {}),\n }));\n await clients.graphql.makeRequest<TranscendCliUpdateOrCreateCookiesResponse>(\n UPDATE_OR_CREATE_COOKIES,\n {\n airgapBundleId,\n cookies: cookieInputs,\n },\n );\n results.cookies = cookieInputs.map((c) => ({\n name: c.name,\n action: c.isJunk ? 'JUNKED' : 'APPROVED',\n status: c.status || 'LIVE',\n }));\n }\n\n if (dfItems.length > 0) {\n const dfInputs: TranscendUpdateDataFlowInputGql[] = dfItems.map((item) => ({\n id: item.id,\n ...(item.action === 'APPROVE'\n ? { status: ConsentTrackerStatus.Live, isJunk: false }\n : { status: ConsentTrackerStatus.Live, isJunk: true }),\n ...(item.tracking_purposes ? { purposeIds: item.tracking_purposes } : {}),\n ...(item.service ? { service: item.service } : {}),\n }));\n const dfResult = await clients.graphql.makeRequest<TranscendCliUpdateDataFlowsResponse>(\n UPDATE_DATA_FLOWS,\n {\n airgapBundleId,\n dataFlows: dfInputs,\n },\n );\n results.dataFlows = dfResult.updateDataFlows.dataFlows.map((df) => ({\n id: df.id,\n action: df.isJunk ? 'JUNKED' : 'APPROVED',\n status: df.status,\n }));\n }\n\n return createToolResult(true, {\n totalProcessed: cookieItems.length + dfItems.length,\n ...results,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\n\nexport const GetPreferencesSchema = z.object({\n identifier: z.string().describe('User identifier (e.g., email, user ID)'),\n partition: z.string().optional().describe('Partition/organization context (optional)'),\n});\nexport type GetPreferencesInput = z.infer<typeof GetPreferencesSchema>;\n\nexport function createConsentGetPreferencesTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'consent_get_preferences',\n description: 'Get consent preferences for a specific user/identifier',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: GetPreferencesSchema,\n handler: async ({ identifier, partition }) => {\n const result = await rest.getConsentPreferences(identifier, partition);\n if (!result) {\n return createToolResult(true, {\n found: false,\n message: 'No consent preferences found for this identifier',\n });\n }\n return createToolResult(true, {\n found: true,\n preferences: result,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport {\n COOKIE_STATS,\n DATA_FLOW_STATS,\n type TranscendCliCookieStatsResponse,\n type TranscendCliDataFlowStatsResponse,\n} from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const GetCookieStatsSchema = z.object({});\nexport type GetCookieStatsInput = z.infer<typeof GetCookieStatsSchema>;\n\nexport function createConsentGetTriageStatsTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_get_triage_stats',\n description:\n 'Get statistics on cookies and data flows: live (approved), needs review (triage), ' +\n 'and junk counts.',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: GetCookieStatsSchema,\n handler: async () => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const variables = { input: { airgapBundleId } };\n const [cookieData, dfData] = await Promise.all([\n clients.graphql.makeRequest<TranscendCliCookieStatsResponse>(COOKIE_STATS, variables),\n clients.graphql.makeRequest<TranscendCliDataFlowStatsResponse>(DATA_FLOW_STATS, variables),\n ]);\n return createToolResult(true, {\n cookies: cookieData.cookieStats,\n dataFlows: dfData.dataFlowStats,\n });\n },\n });\n}\n","import {\n createToolResult,\n defineTool,\n EmptySchema,\n type ToolClients,\n} from '@transcend-io/mcp-server-core';\nimport {\n FETCH_CONSENT_MANAGER,\n type TranscendCliFetchConsentManagerResponse,\n} from '@transcend-io/sdk';\n\nexport const ListAirgapBundlesSchema = EmptySchema;\nexport type ListAirgapBundlesInput = Record<string, never>;\n\nexport function createConsentListAirgapBundlesTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_list_airgap_bundles',\n description:\n 'Get the consent manager (airgap bundle) configured for your organization. ' +\n 'Returns the bundle ID, URLs, configuration, and domains.',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListAirgapBundlesSchema,\n handler: async (_args) => {\n const data = await clients.graphql.makeRequest<TranscendCliFetchConsentManagerResponse>(\n FETCH_CONSENT_MANAGER,\n {},\n );\n return createToolResult(true, data.consentManager.consentManager);\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport {\n ConsentTrackerStatus,\n CookieOrderField,\n OrderDirection,\n} from '@transcend-io/privacy-types';\nimport { COOKIES, type TranscendCliCookiesResponse } from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const ListCookiesSchema = z.object({\n limit: z.number().min(1).max(200).optional().default(50),\n offset: z.number().min(0).optional().default(0),\n status: z\n .nativeEnum(ConsentTrackerStatus)\n .describe('Filter by status: NEEDS_REVIEW (triage) or LIVE (approved)'),\n is_junk: z.boolean().optional().describe('Filter by junk status'),\n show_zero_activity: z.boolean().optional().describe('Include items with zero activity'),\n text: z.string().optional().describe('Search text filter'),\n service: z.string().optional().describe('Filter by service name'),\n order_field: z.nativeEnum(CookieOrderField).optional().describe('Field to sort by'),\n order_direction: z.nativeEnum(OrderDirection).optional().describe('Sort direction: ASC or DESC'),\n});\nexport type ListCookiesInput = z.infer<typeof ListCookiesSchema>;\n\nexport function createConsentListCookiesTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_list_cookies',\n description:\n 'List cookies in your consent manager. ' +\n 'Requires a status filter: NEEDS_REVIEW for triage backlog, LIVE for approved cookies. ' +\n 'Returns name, service, tracking purposes, activity (occurrences), junk status, and more.',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListCookiesSchema,\n handler: async ({\n limit,\n offset,\n status,\n is_junk,\n show_zero_activity,\n text,\n service,\n order_field,\n order_direction,\n }) => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const data = await clients.graphql.makeRequest<TranscendCliCookiesResponse>(COOKIES, {\n input: { airgapBundleId },\n first: limit,\n offset,\n filterBy: {\n status,\n ...(is_junk !== undefined ? { isJunk: is_junk } : {}),\n ...(show_zero_activity !== undefined ? { showZeroActivity: show_zero_activity } : {}),\n ...(text ? { text } : {}),\n ...(service ? { service } : {}),\n },\n ...(order_field && order_direction\n ? { orderBy: [{ field: order_field, direction: order_direction }] }\n : {}),\n });\n const { nodes, totalCount } = data.cookies;\n return createListResult(nodes, {\n totalCount,\n hasNextPage: offset + nodes.length < totalCount,\n });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport {\n ConsentTrackerStatus,\n DataFlowOrderField,\n OrderDirection,\n} from '@transcend-io/privacy-types';\nimport { DATA_FLOWS, type TranscendCliDataFlowsResponse } from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const ListDataFlowsSchema = z.object({\n limit: z.number().min(1).max(200).optional().default(50),\n offset: z.number().min(0).optional().default(0),\n status: z\n .nativeEnum(ConsentTrackerStatus)\n .describe('Filter by status: NEEDS_REVIEW (triage) or LIVE (approved)'),\n is_junk: z.boolean().optional().describe('Filter by junk status'),\n show_zero_activity: z.boolean().optional().describe('Include items with zero activity'),\n text: z.string().optional().describe('Search text filter'),\n service: z.string().optional().describe('Filter by service name'),\n order_field: z.nativeEnum(DataFlowOrderField).optional().describe('Field to sort by'),\n order_direction: z.nativeEnum(OrderDirection).optional().describe('Sort direction: ASC or DESC'),\n});\nexport type ListDataFlowsInput = z.infer<typeof ListDataFlowsSchema>;\n\nexport function createConsentListDataFlowsTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_list_data_flows',\n description:\n 'List data flows (network requests) in your consent manager. ' +\n 'Requires a status filter: NEEDS_REVIEW for triage backlog, LIVE for approved flows. ' +\n 'Returns value (URL/host), service, tracking purposes, activity (occurrences), and more.',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListDataFlowsSchema,\n handler: async ({\n limit,\n offset,\n status,\n is_junk,\n show_zero_activity,\n text,\n service,\n order_field,\n order_direction,\n }) => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const data = await clients.graphql.makeRequest<TranscendCliDataFlowsResponse>(DATA_FLOWS, {\n input: { airgapBundleId },\n first: limit,\n offset,\n filterBy: {\n status,\n ...(is_junk !== undefined ? { isJunk: is_junk } : {}),\n ...(show_zero_activity !== undefined ? { showZeroActivity: show_zero_activity } : {}),\n ...(text ? { text } : {}),\n ...(service ? { service } : {}),\n },\n ...(order_field && order_direction\n ? { orderBy: [{ field: order_field, direction: order_direction }] }\n : {}),\n });\n const { nodes, totalCount } = data.dataFlows;\n return createListResult(nodes, {\n totalCount,\n hasNextPage: offset + nodes.length < totalCount,\n });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport { PURPOSES, type TranscendCliPurposesResponse } from '@transcend-io/sdk';\n\nexport const ListPurposesSchema = z.object({\n limit: z.coerce.number().min(1).max(100).optional().default(50),\n});\nexport type ListPurposesInput = z.infer<typeof ListPurposesSchema>;\n\nexport function createConsentListPurposesTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_list_purposes',\n description: 'List all tracking purposes configured for consent management (max ~100 results).',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListPurposesSchema,\n handler: async ({ limit }) => {\n const data = await clients.graphql.makeRequest<TranscendCliPurposesResponse>(PURPOSES, {\n first: Math.min(limit, 100),\n });\n const { nodes, totalCount } = data.purposes;\n return createListResult(nodes, {\n totalCount,\n hasNextPage: nodes.length < totalCount,\n });\n },\n });\n}\n","import { createListResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport { EXPERIENCES, type TranscendCliExperiencesResponse } from '@transcend-io/sdk';\n\nexport const ListRegimesSchema = z.object({\n limit: z.coerce.number().min(1).max(100).optional().default(50),\n offset: z.coerce.number().min(0).optional().default(0),\n});\nexport type ListRegimesInput = z.infer<typeof ListRegimesSchema>;\n\nexport function createConsentListRegimesTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_list_regimes',\n description:\n 'List all consent experiences (regional regimes) configured for your organization. ' +\n 'Returns experience name, regions, purposes, opted-out purposes, and view state.',\n category: 'Consent Management',\n readOnly: true,\n annotations: { readOnlyHint: true, destructiveHint: false, idempotentHint: true },\n zodSchema: ListRegimesSchema,\n handler: async ({ limit, offset }) => {\n const data = await clients.graphql.makeRequest<TranscendCliExperiencesResponse>(EXPERIENCES, {\n first: limit,\n offset,\n });\n const { totalCount, nodes } = data.experiences;\n return createListResult(nodes, {\n totalCount,\n hasNextPage: offset + nodes.length < totalCount,\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\n\nexport const PurposeConsentSchema = z.object({\n purpose: z.string().describe('Purpose slug'),\n enabled: z.boolean().describe('Whether consent is granted'),\n});\nexport type PurposeConsentInput = z.infer<typeof PurposeConsentSchema>;\n\nexport const SetPreferencesSchema = z.object({\n identifier: z.string().optional().describe('User identifier'),\n partition: z.string().describe('Partition/organization context'),\n purposes: z.array(PurposeConsentSchema).describe('Array of purpose consent settings'),\n confirmed: z.boolean().optional().describe('Whether consent was explicitly confirmed'),\n});\nexport type SetPreferencesInput = z.infer<typeof SetPreferencesSchema>;\n\nexport function createConsentSetPreferencesTool(clients: ToolClients) {\n const { rest } = clients;\n return defineTool({\n name: 'consent_set_preferences',\n description: 'Set consent preferences for a user (client-side sync)',\n category: 'Consent Management',\n readOnly: false,\n confirmationHint: 'Updates consent preferences for the user',\n annotations: { readOnlyHint: false, destructiveHint: false, idempotentHint: true },\n zodSchema: SetPreferencesSchema,\n handler: async ({ partition, identifier, purposes, confirmed }) => {\n const result = await rest.syncConsent({\n partition,\n identifier,\n purposes: purposes.map((p) => ({\n purpose: p.purpose,\n enabled: p.enabled,\n })),\n confirmed,\n });\n return createToolResult(true, {\n ...result,\n message: 'Consent preferences synced successfully',\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport {\n UPDATE_OR_CREATE_COOKIES,\n type TranscendUpdateCookieInputGql,\n type TranscendCliUpdateOrCreateCookiesResponse,\n} from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const UpdateCookieItemSchema = z.object({\n name: z.string().describe('Cookie name (used as the identifier for upsert)'),\n tracking_purposes: z\n .array(z.string())\n .optional()\n .describe('Tracking purpose slugs (e.g., \"Advertising\", \"Analytics\")'),\n description: z.string().optional().describe('Cookie description'),\n service: z.string().optional().describe('Service/integration name'),\n is_junk: z.boolean().optional().describe('Mark as junk'),\n status: z\n .nativeEnum(ConsentTrackerStatus)\n .optional()\n .describe('Set status to LIVE (approve) or NEEDS_REVIEW'),\n});\nexport type UpdateCookieItemInput = z.infer<typeof UpdateCookieItemSchema>;\n\nexport const UpdateCookiesSchema = z.object({\n cookies: z.array(UpdateCookieItemSchema).min(1).describe('Cookies to update'),\n});\nexport type UpdateCookiesInput = z.infer<typeof UpdateCookiesSchema>;\n\nexport function createConsentUpdateCookiesTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_update_cookies',\n description:\n 'Update one or more cookies. Use to approve (status=LIVE), junk (is_junk=true), ' +\n 'assign tracking purposes, or set a service. The cookie \"name\" field is the identifier ' +\n 'for upsert — existing cookies with matching names will be updated.',\n category: 'Consent Management',\n readOnly: false,\n confirmationHint: 'Updates cookies in the consent manager',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },\n zodSchema: UpdateCookiesSchema,\n handler: async ({ cookies }) => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const cookieInputs: TranscendUpdateCookieInputGql[] = cookies.map((c) => ({\n name: c.name,\n ...(c.tracking_purposes ? { trackingPurposes: c.tracking_purposes } : {}),\n ...(c.description !== undefined ? { description: c.description } : {}),\n ...(c.service !== undefined ? { service: c.service } : {}),\n ...(c.is_junk !== undefined ? { isJunk: c.is_junk } : {}),\n ...(c.status !== undefined ? { status: c.status } : {}),\n }));\n await clients.graphql.makeRequest<TranscendCliUpdateOrCreateCookiesResponse>(\n UPDATE_OR_CREATE_COOKIES,\n {\n airgapBundleId,\n cookies: cookieInputs,\n },\n );\n return createToolResult(true, {\n updated: cookieInputs.length,\n cookies: cookieInputs.map((c) => ({\n name: c.name,\n status: c.status,\n isJunk: c.isJunk,\n trackingPurposes: c.trackingPurposes,\n service: c.service,\n })),\n });\n },\n });\n}\n","import { createToolResult, defineTool, z, type ToolClients } from '@transcend-io/mcp-server-core';\nimport { ConsentTrackerStatus } from '@transcend-io/privacy-types';\nimport {\n UPDATE_DATA_FLOWS,\n type TranscendUpdateDataFlowInputGql,\n type TranscendCliUpdateDataFlowsResponse,\n} from '@transcend-io/sdk';\n\nimport { resolveAirgapBundleId } from '../resolveAirgapBundleId.js';\n\nexport const UpdateDataFlowItemSchema = z.object({\n id: z.string().describe('Data flow ID'),\n tracking_purposes: z.array(z.string()).optional().describe('Tracking purpose slugs'),\n description: z.string().optional().describe('Data flow description'),\n service: z.string().optional().describe('Service/integration name'),\n is_junk: z.boolean().optional().describe('Mark as junk'),\n status: z\n .nativeEnum(ConsentTrackerStatus)\n .optional()\n .describe('Set status to LIVE (approve) or NEEDS_REVIEW'),\n});\nexport type UpdateDataFlowItemInput = z.infer<typeof UpdateDataFlowItemSchema>;\n\nexport const UpdateDataFlowsSchema = z.object({\n data_flows: z.array(UpdateDataFlowItemSchema).min(1).describe('Data flows to update'),\n});\nexport type UpdateDataFlowsInput = z.infer<typeof UpdateDataFlowsSchema>;\n\nexport function createConsentUpdateDataFlowsTool(clients: ToolClients) {\n return defineTool({\n name: 'consent_update_data_flows',\n description:\n 'Update one or more data flows. Use to approve (status=LIVE), junk (is_junk=true), ' +\n 'assign tracking purposes, or set a service.',\n category: 'Consent Management',\n readOnly: false,\n confirmationHint: 'Updates data flows in the consent manager',\n annotations: { readOnlyHint: false, destructiveHint: true, idempotentHint: true },\n zodSchema: UpdateDataFlowsSchema,\n handler: async ({ data_flows }) => {\n const airgapBundleId = await resolveAirgapBundleId(clients.graphql);\n const dfInputs: TranscendUpdateDataFlowInputGql[] = data_flows.map((df) => ({\n id: df.id,\n ...(df.tracking_purposes ? { purposeIds: df.tracking_purposes } : {}),\n ...(df.description !== undefined ? { description: df.description } : {}),\n ...(df.service !== undefined ? { service: df.service } : {}),\n ...(df.is_junk !== undefined ? { isJunk: df.is_junk } : {}),\n ...(df.status !== undefined ? { status: df.status } : {}),\n }));\n const data = await clients.graphql.makeRequest<TranscendCliUpdateDataFlowsResponse>(\n UPDATE_DATA_FLOWS,\n {\n airgapBundleId,\n dataFlows: dfInputs,\n },\n );\n return createToolResult(true, {\n updated: data.updateDataFlows.dataFlows.length,\n dataFlows: data.updateDataFlows.dataFlows.map((df) => ({\n id: df.id,\n value: df.value,\n status: df.status,\n isJunk: df.isJunk,\n purposes: df.purposes.map((p) => p.name),\n service: df.service?.title,\n })),\n });\n },\n });\n}\n","import type { ToolDefinition, ToolClients } from '@transcend-io/mcp-server-core';\n\nimport { createConsentBulkTriageTool } from './consent_bulk_triage.js';\nimport { createConsentGetPreferencesTool } from './consent_get_preferences.js';\nimport { createConsentGetTriageStatsTool } from './consent_get_triage_stats.js';\nimport { createConsentListAirgapBundlesTool } from './consent_list_airgap_bundles.js';\nimport { createConsentListCookiesTool } from './consent_list_cookies.js';\nimport { createConsentListDataFlowsTool } from './consent_list_data_flows.js';\nimport { createConsentListPurposesTool } from './consent_list_purposes.js';\nimport { createConsentListRegimesTool } from './consent_list_regimes.js';\nimport { createConsentSetPreferencesTool } from './consent_set_preferences.js';\nimport { createConsentUpdateCookiesTool } from './consent_update_cookies.js';\nimport { createConsentUpdateDataFlowsTool } from './consent_update_data_flows.js';\n\nexport function getConsentTools(clients: ToolClients): ToolDefinition[] {\n return [\n createConsentGetPreferencesTool(clients),\n createConsentSetPreferencesTool(clients),\n createConsentListPurposesTool(clients),\n createConsentListDataFlowsTool(clients),\n createConsentListCookiesTool(clients),\n createConsentListAirgapBundlesTool(clients),\n createConsentListRegimesTool(clients),\n createConsentGetTriageStatsTool(clients),\n createConsentUpdateCookiesTool(clients),\n createConsentUpdateDataFlowsTool(clients),\n createConsentBulkTriageTool(clients),\n ];\n}\n"],"mappings":";;;;AAMA,MAAM,gCAAgB,IAAI,SAAuC;;;;;;AAOjE,eAAsB,sBAAsB,SAAgD;CAC1F,MAAM,SAAS,cAAc,IAAI,QAAQ;AACzC,KAAI,OAAQ,QAAO;CAOnB,MAAM,MALO,MAAM,QAAQ,YACzB,0BACA,EAAE,CACH,EAEe,eAAe,eAAe;AAC9C,eAAc,IAAI,SAAS,GAAG;AAC9B,QAAO;;;;ACPT,MAAa,uBAAuB,EAAE,OAAO;CAC3C,MAAM,EAAE,WAAW,mBAAmB,CAAC,SAAS,YAAY;CAC5D,IAAI,EAAE,QAAQ,CAAC,SAAS,wDAAwD;CAChF,QAAQ,EAAE,WAAW,aAAa,CAAC,SAAS,kCAAkC;CAC9E,mBAAmB,EAChB,MAAM,EAAE,QAAQ,CAAC,CACjB,UAAU,CACV,SAAS,wDAAwD;CACpE,SAAS,EAAE,QAAQ,CAAC,UAAU,CAAC,SAAS,yBAAyB;CAClE,CAAC;AAGF,MAAa,mBAAmB,EAAE,OAAO,EACvC,OAAO,EAAE,MAAM,qBAAqB,CAAC,IAAI,EAAE,CAAC,SAAS,kBAAkB,EACxE,CAAC;AAGF,SAAgB,4BAA4B,SAAsB;AAChE,QAAO,WAAW;EAChB,MAAM;EACN,aACE;EAGF,UAAU;EACV,UAAU;EACV,kBAAkB;EAClB,aAAa;GAAE,cAAc;GAAO,iBAAiB;GAAM,gBAAgB;GAAO;EAClF,WAAW;EACX,SAAS,OAAO,EAAE,YAAY;GAC5B,MAAM,iBAAiB,MAAM,sBAAs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ADDED
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@transcend-io/mcp-server-consent",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Transcend MCP Server — Consent Management tools.",
|
|
5
|
+
"homepage": "https://github.com/transcend-io/tools/tree/main/packages/mcp/mcp-server-consent",
|
|
6
|
+
"license": "Apache-2.0",
|
|
7
|
+
"author": "Transcend Inc.",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "https://github.com/transcend-io/tools.git",
|
|
11
|
+
"directory": "packages/mcp/mcp-server-consent"
|
|
12
|
+
},
|
|
13
|
+
"bin": {
|
|
14
|
+
"transcend-mcp-consent": "./dist/cli.mjs"
|
|
15
|
+
},
|
|
16
|
+
"files": [
|
|
17
|
+
"dist"
|
|
18
|
+
],
|
|
19
|
+
"type": "module",
|
|
20
|
+
"sideEffects": false,
|
|
21
|
+
"types": "./dist/index.d.mts",
|
|
22
|
+
"exports": {
|
|
23
|
+
".": {
|
|
24
|
+
"@transcend-io/source": "./src/index.ts",
|
|
25
|
+
"types": "./dist/index.d.mts",
|
|
26
|
+
"default": "./dist/index.mjs"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"publishConfig": {
|
|
30
|
+
"access": "public"
|
|
31
|
+
},
|
|
32
|
+
"scripts": {
|
|
33
|
+
"build": "tsdown",
|
|
34
|
+
"test": "vitest run",
|
|
35
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
36
|
+
"check:exports": "attw --pack . --ignore-rules cjs-resolves-to-esm",
|
|
37
|
+
"check:publint": "publint --level warning --strict --pack pnpm"
|
|
38
|
+
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@modelcontextprotocol/sdk": "catalog:",
|
|
41
|
+
"@transcend-io/mcp-server-core": "workspace:*",
|
|
42
|
+
"@transcend-io/privacy-types": "workspace:*",
|
|
43
|
+
"@transcend-io/sdk": "workspace:*",
|
|
44
|
+
"zod": "catalog:"
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@arethetypeswrong/cli": "catalog:",
|
|
48
|
+
"@types/node": "catalog:",
|
|
49
|
+
"publint": "catalog:",
|
|
50
|
+
"tsdown": "catalog:",
|
|
51
|
+
"typescript": "catalog:",
|
|
52
|
+
"vitest": "catalog:"
|
|
53
|
+
},
|
|
54
|
+
"engines": {
|
|
55
|
+
"node": ">=22.12.0"
|
|
56
|
+
}
|
|
57
|
+
}
|