mcp-google-multi 6.0.0-beta.2 → 6.0.0-beta.4
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 +5 -5
- package/dist/accounts.d.ts +20 -4
- package/dist/accounts.js +68 -44
- package/dist/api-probe.d.ts +5 -0
- package/dist/api-probe.js +20 -15
- package/dist/arg-normalize.js +19 -38
- package/dist/arg-strict.d.ts +7 -0
- package/dist/arg-strict.js +38 -28
- package/dist/auth.d.ts +5 -4
- package/dist/auth.js +16 -23
- package/dist/boot-gates.d.ts +26 -0
- package/dist/boot-gates.js +36 -0
- package/dist/cimd-cache.d.ts +38 -0
- package/dist/cimd-cache.js +111 -0
- package/dist/client-config.d.ts +2 -2
- package/dist/client-config.js +8 -14
- package/dist/client.d.ts +32 -2
- package/dist/client.js +0 -0
- package/dist/compose.d.ts +18 -0
- package/dist/compose.js +109 -0
- package/dist/config-file.d.ts +13 -0
- package/dist/config-file.js +41 -10
- package/dist/discover.js +7 -10
- package/dist/discovery-client.d.ts +3 -0
- package/dist/discovery-client.js +36 -32
- package/dist/doctor.d.ts +9 -5
- package/dist/doctor.js +119 -29
- package/dist/env-load.js +2 -5
- package/dist/executor.d.ts +3 -0
- package/dist/executor.js +6 -6
- package/dist/fanout.d.ts +9 -1
- package/dist/fanout.js +47 -22
- package/dist/fs-atomic.d.ts +8 -0
- package/dist/fs-atomic.js +216 -29
- package/dist/hint-provider.d.ts +129 -0
- package/dist/hint-provider.js +58 -0
- package/dist/http-config.d.ts +2 -2
- package/dist/http-config.js +3 -7
- package/dist/http-transport.d.ts +67 -9
- package/dist/http-transport.js +318 -52
- package/dist/identity.d.ts +6 -3
- package/dist/identity.js +24 -8
- package/dist/index.js +76 -160
- package/dist/master-key.d.ts +3 -3
- package/dist/master-key.js +16 -19
- package/dist/mcp-token.d.ts +126 -19
- package/dist/mcp-token.js +557 -76
- package/dist/metrics-cli.d.ts +1 -1
- package/dist/metrics-cli.js +1 -1
- package/dist/metrics-tap.js +2 -5
- package/dist/migrate-config.d.ts +1 -2
- package/dist/migrate-config.js +5 -7
- package/dist/net-tuning.js +2 -4
- package/dist/oauth-as.d.ts +104 -4
- package/dist/oauth-as.js +368 -114
- package/dist/oauth-consent.d.ts +10 -0
- package/dist/oauth-consent.js +20 -10
- package/dist/outbound-allowlist.js +9 -11
- package/dist/reauth-hint.d.ts +1 -1
- package/dist/reauth-hint.js +11 -10
- package/dist/registry-transfer.d.ts +5 -0
- package/dist/registry-transfer.js +63 -11
- package/dist/registry.d.ts +13 -4
- package/dist/registry.js +100 -72
- package/dist/scope-catalog.d.ts +16 -0
- package/dist/scope-catalog.js +40 -13
- package/dist/scope-observability.d.ts +10 -9
- package/dist/scope-observability.js +34 -24
- package/dist/services.d.ts +18 -10
- package/dist/services.js +61 -22
- package/dist/ssrf-guard.d.ts +23 -9
- package/dist/ssrf-guard.js +106 -78
- package/dist/tenant-purge.d.ts +26 -0
- package/dist/tenant-purge.js +65 -0
- package/dist/token-store.d.ts +20 -2
- package/dist/token-store.js +0 -0
- package/dist/tools/_coerce.d.ts +4 -4
- package/dist/tools/_errors.d.ts +3 -0
- package/dist/tools/_errors.js +72 -60
- package/dist/tools/_local-files.d.ts +9 -0
- package/dist/tools/_local-files.js +22 -8
- package/dist/tools/account-wizard.d.ts +13 -3
- package/dist/tools/account-wizard.js +107 -56
- package/dist/tools/accounts-tool.d.ts +8 -1
- package/dist/tools/accounts-tool.js +35 -19
- package/dist/tools/admin.d.ts +10 -1
- package/dist/tools/admin.js +14 -11
- package/dist/tools/analytics.d.ts +10 -1
- package/dist/tools/analytics.js +14 -10
- package/dist/tools/calendar.d.ts +2 -1
- package/dist/tools/calendar.js +19 -18
- package/dist/tools/chat.d.ts +10 -1
- package/dist/tools/chat.js +12 -8
- package/dist/tools/contacts.d.ts +2 -1
- package/dist/tools/contacts.js +22 -19
- package/dist/tools/docs.d.ts +2 -1
- package/dist/tools/docs.js +35 -36
- package/dist/tools/drive.d.ts +2 -1
- package/dist/tools/drive.js +80 -74
- package/dist/tools/forms.d.ts +10 -1
- package/dist/tools/forms.js +18 -12
- package/dist/tools/generated/_shared.d.ts +2 -1
- package/dist/tools/generated/_shared.js +7 -3
- package/dist/tools/generated/admin.d.ts +2 -1
- package/dist/tools/generated/admin.js +265 -265
- package/dist/tools/generated/analytics.d.ts +2 -1
- package/dist/tools/generated/analytics.js +125 -125
- package/dist/tools/generated/appsmarket.d.ts +2 -1
- package/dist/tools/generated/appsmarket.js +5 -5
- package/dist/tools/generated/calendar.d.ts +2 -1
- package/dist/tools/generated/calendar.js +55 -55
- package/dist/tools/generated/chat.d.ts +2 -1
- package/dist/tools/generated/chat.js +95 -95
- package/dist/tools/generated/classroom.d.ts +2 -1
- package/dist/tools/generated/classroom.js +209 -209
- package/dist/tools/generated/cloudidentity.d.ts +2 -1
- package/dist/tools/generated/cloudidentity.js +133 -133
- package/dist/tools/generated/cloudsearch.d.ts +2 -1
- package/dist/tools/generated/cloudsearch.js +99 -99
- package/dist/tools/generated/contacts.d.ts +2 -1
- package/dist/tools/generated/contacts.js +29 -29
- package/dist/tools/generated/drive.d.ts +2 -1
- package/dist/tools/generated/drive.js +71 -71
- package/dist/tools/generated/driveactivity.d.ts +2 -1
- package/dist/tools/generated/driveactivity.js +3 -3
- package/dist/tools/generated/drivelabels.d.ts +2 -1
- package/dist/tools/generated/drivelabels.js +53 -53
- package/dist/tools/generated/forms.d.ts +2 -1
- package/dist/tools/generated/forms.js +7 -7
- package/dist/tools/generated/gmail.d.ts +2 -1
- package/dist/tools/generated/gmail.js +117 -117
- package/dist/tools/generated/groupsmigration.d.ts +2 -1
- package/dist/tools/generated/groupsmigration.js +3 -3
- package/dist/tools/generated/groupssettings.d.ts +2 -1
- package/dist/tools/generated/groupssettings.js +7 -7
- package/dist/tools/generated/index.d.ts +2 -1
- package/dist/tools/generated/keep.d.ts +2 -1
- package/dist/tools/generated/keep.js +15 -15
- package/dist/tools/generated/licensing.d.ts +2 -1
- package/dist/tools/generated/licensing.js +15 -15
- package/dist/tools/generated/meet.d.ts +2 -1
- package/dist/tools/generated/meet.js +27 -27
- package/dist/tools/generated/postmaster.d.ts +2 -1
- package/dist/tools/generated/postmaster.js +9 -9
- package/dist/tools/generated/reseller.d.ts +2 -1
- package/dist/tools/generated/reseller.js +35 -35
- package/dist/tools/generated/script.d.ts +2 -1
- package/dist/tools/generated/script.js +33 -33
- package/dist/tools/generated/searchconsole.d.ts +2 -1
- package/dist/tools/generated/searchconsole.js +3 -3
- package/dist/tools/generated/sheets.d.ts +2 -1
- package/dist/tools/generated/sheets.js +15 -15
- package/dist/tools/generated/tasks.d.ts +2 -1
- package/dist/tools/generated/tasks.js +5 -5
- package/dist/tools/generated/vault.d.ts +2 -1
- package/dist/tools/generated/vault.js +67 -67
- package/dist/tools/generated/workspaceevents.d.ts +2 -1
- package/dist/tools/generated/workspaceevents.js +31 -31
- package/dist/tools/gmail-mime.d.ts +1 -1
- package/dist/tools/gmail-mime.js +7 -12
- package/dist/tools/gmail.d.ts +4 -3
- package/dist/tools/gmail.js +67 -69
- package/dist/tools/google-api.d.ts +2 -3
- package/dist/tools/google-api.js +34 -22
- package/dist/tools/meet.d.ts +10 -1
- package/dist/tools/meet.js +12 -9
- package/dist/tools/searchconsole.d.ts +2 -1
- package/dist/tools/searchconsole.js +16 -13
- package/dist/tools/sheets.d.ts +2 -1
- package/dist/tools/sheets.js +35 -32
- package/dist/tools/slides.d.ts +10 -1
- package/dist/tools/slides.js +16 -10
- package/dist/tools/tasks.d.ts +2 -1
- package/dist/tools/tasks.js +18 -15
- package/dist/trim.d.ts +5 -0
- package/dist/trim.js +19 -0
- package/dist/usage-metrics.d.ts +23 -0
- package/dist/usage-metrics.js +67 -56
- package/dist/write-control.d.ts +4 -8
- package/dist/write-control.js +13 -6
- package/package.json +47 -21
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { z } from 'zod';
|
|
3
3
|
import { coerceBoolean, coerceJson } from '../_coerce.js';
|
|
4
4
|
import { accountField, registerGeneratedTool } from './_shared.js';
|
|
5
|
-
export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
5
|
+
export function registerWorkspaceeventsGeneratedTools(registry, deps = {}) {
|
|
6
6
|
// Interned method scope sets (shared across tools; see scope-observability).
|
|
7
7
|
const S_workspaceevents_v1 = [
|
|
8
8
|
["https://www.googleapis.com/auth/chat.bot", "https://www.googleapis.com/auth/chat.memberships", "https://www.googleapis.com/auth/chat.memberships.readonly", "https://www.googleapis.com/auth/chat.messages", "https://www.googleapis.com/auth/chat.messages.reactions", "https://www.googleapis.com/auth/chat.messages.reactions.readonly", "https://www.googleapis.com/auth/chat.messages.readonly", "https://www.googleapis.com/auth/chat.spaces", "https://www.googleapis.com/auth/chat.spaces.readonly", "https://www.googleapis.com/auth/chat.users.availability", "https://www.googleapis.com/auth/chat.users.availability.readonly", "https://www.googleapis.com/auth/chat.users.readstate", "https://www.googleapis.com/auth/chat.users.readstate.readonly", "https://www.googleapis.com/auth/drive", "https://www.googleapis.com/auth/drive.file", "https://www.googleapis.com/auth/drive.metadata", "https://www.googleapis.com/auth/drive.metadata.readonly", "https://www.googleapis.com/auth/drive.readonly", "https://www.googleapis.com/auth/meetings.space.created", "https://www.googleapis.com/auth/meetings.space.readonly"],
|
|
@@ -16,11 +16,11 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
16
16
|
params: [{ "field": "fields", "api": "fields", "location": "query" }],
|
|
17
17
|
hasBody: true,
|
|
18
18
|
shape: {
|
|
19
|
-
account: accountField(),
|
|
19
|
+
account: accountField(() => registry.accountAliases()),
|
|
20
20
|
body: coerceJson(z.record(z.string(), z.unknown())).describe("SendMessageRequest JSON request body. Top-level fields: configuration, message, metadata, tenant."),
|
|
21
21
|
fields: z.string().optional().describe('Response field mask.'),
|
|
22
22
|
},
|
|
23
|
-
});
|
|
23
|
+
}, deps);
|
|
24
24
|
registerGeneratedTool(registry, {
|
|
25
25
|
name: "workspaceevents_operations_get",
|
|
26
26
|
cud: "read",
|
|
@@ -29,11 +29,11 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
29
29
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
30
30
|
hasBody: false,
|
|
31
31
|
shape: {
|
|
32
|
-
account: accountField(),
|
|
32
|
+
account: accountField(() => registry.accountAliases()),
|
|
33
33
|
name: z.string().min(1).describe("The name of the operation resource."),
|
|
34
34
|
fields: z.string().optional().describe('Response field mask.'),
|
|
35
35
|
},
|
|
36
|
-
});
|
|
36
|
+
}, deps);
|
|
37
37
|
registerGeneratedTool(registry, {
|
|
38
38
|
name: "workspaceevents_subscriptions_create",
|
|
39
39
|
cud: "create",
|
|
@@ -42,12 +42,12 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
42
42
|
params: [{ "field": "validateOnly", "api": "validateOnly", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
43
43
|
hasBody: true,
|
|
44
44
|
shape: {
|
|
45
|
-
account: accountField(),
|
|
45
|
+
account: accountField(() => registry.accountAliases()),
|
|
46
46
|
validateOnly: coerceBoolean.describe("Optional. If set to `true`, validates and previews the request, but doesn't create the subscription.").optional(),
|
|
47
47
|
body: coerceJson(z.record(z.string(), z.unknown())).describe("Subscription JSON request body. Top-level fields: authority, createTime, driveOptions, etag, eventTypes, expireTime, name, notificationEndpoint, payloadOptions, reconciling, serviceAccountAuthority, state, +6 more."),
|
|
48
48
|
fields: z.string().optional().describe('Response field mask.'),
|
|
49
49
|
},
|
|
50
|
-
});
|
|
50
|
+
}, deps);
|
|
51
51
|
registerGeneratedTool(registry, {
|
|
52
52
|
name: "workspaceevents_subscriptions_delete",
|
|
53
53
|
cud: "delete",
|
|
@@ -56,14 +56,14 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
56
56
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "allowMissing", "api": "allowMissing", "location": "query" }, { "field": "etag", "api": "etag", "location": "query" }, { "field": "validateOnly", "api": "validateOnly", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
57
57
|
hasBody: false,
|
|
58
58
|
shape: {
|
|
59
|
-
account: accountField(),
|
|
59
|
+
account: accountField(() => registry.accountAliases()),
|
|
60
60
|
name: z.string().min(1).describe("Required. Resource name of the subscription to delete. Format: `subscriptions/{subscription}`"),
|
|
61
61
|
allowMissing: coerceBoolean.describe("Optional. If set to `true` and the subscription isn't found, the request succeeds but doesn't delete the subscription.").optional(),
|
|
62
62
|
etag: z.string().describe("Optional. Etag of the subscription. If present, it must match with the server's etag. Otherwise, request fails with the status `ABORTED`.").optional(),
|
|
63
63
|
validateOnly: coerceBoolean.describe("Optional. If set to `true`, validates and previews the request, but doesn't delete the subscription.").optional(),
|
|
64
64
|
fields: z.string().optional().describe('Response field mask.'),
|
|
65
65
|
},
|
|
66
|
-
});
|
|
66
|
+
}, deps);
|
|
67
67
|
registerGeneratedTool(registry, {
|
|
68
68
|
name: "workspaceevents_subscriptions_get",
|
|
69
69
|
cud: "read",
|
|
@@ -72,11 +72,11 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
72
72
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
73
73
|
hasBody: false,
|
|
74
74
|
shape: {
|
|
75
|
-
account: accountField(),
|
|
75
|
+
account: accountField(() => registry.accountAliases()),
|
|
76
76
|
name: z.string().min(1).describe("Required. Resource name of the subscription. Format: `subscriptions/{subscription}`"),
|
|
77
77
|
fields: z.string().optional().describe('Response field mask.'),
|
|
78
78
|
},
|
|
79
|
-
});
|
|
79
|
+
}, deps);
|
|
80
80
|
registerGeneratedTool(registry, {
|
|
81
81
|
name: "workspaceevents_subscriptions_list",
|
|
82
82
|
cud: "read",
|
|
@@ -85,13 +85,13 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
85
85
|
params: [{ "field": "filter", "api": "filter", "location": "query" }, { "field": "pageSize", "api": "pageSize", "location": "query" }, { "field": "pageToken", "api": "pageToken", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
86
86
|
hasBody: false,
|
|
87
87
|
shape: {
|
|
88
|
-
account: accountField(),
|
|
88
|
+
account: accountField(() => registry.accountAliases()),
|
|
89
89
|
filter: z.string().describe("Required. A query filter. You can filter subscriptions by event type (`event_types`) and target resource (`target_resource`). You must specify at least one event type in your query. To filter for mult").optional(),
|
|
90
90
|
pageSize: z.number().describe("Optional. The maximum number of subscriptions to return. The service might return fewer than this value. If unspecified or set to `0`, up to 50 subscriptions are returned. The maximum value is 100. If").optional(),
|
|
91
91
|
pageToken: z.string().describe("Optional. A page token, received from a previous list subscriptions call. Provide this parameter to retrieve the subsequent page. When paginating, the filter value should match the call that provided ").optional(),
|
|
92
92
|
fields: z.string().optional().describe('Response field mask.'),
|
|
93
93
|
},
|
|
94
|
-
});
|
|
94
|
+
}, deps);
|
|
95
95
|
registerGeneratedTool(registry, {
|
|
96
96
|
name: "workspaceevents_subscriptions_patch",
|
|
97
97
|
cud: "update",
|
|
@@ -100,14 +100,14 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
100
100
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "updateMask", "api": "updateMask", "location": "query" }, { "field": "validateOnly", "api": "validateOnly", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
101
101
|
hasBody: true,
|
|
102
102
|
shape: {
|
|
103
|
-
account: accountField(),
|
|
103
|
+
account: accountField(() => registry.accountAliases()),
|
|
104
104
|
name: z.string().min(1).describe("Identifier. Resource name of the subscription. Format: `subscriptions/{subscription}`"),
|
|
105
105
|
updateMask: z.string().describe("Optional. The field to update. If omitted, updates any fields included in the request. You can update one of the following fields in a subscription: * `expire_time`: The timestamp when the subscriptio").optional(),
|
|
106
106
|
validateOnly: coerceBoolean.describe("Optional. If set to `true`, validates and previews the request, but doesn't update the subscription.").optional(),
|
|
107
107
|
body: coerceJson(z.record(z.string(), z.unknown())).describe("Subscription JSON request body. Top-level fields: authority, createTime, driveOptions, etag, eventTypes, expireTime, name, notificationEndpoint, payloadOptions, reconciling, serviceAccountAuthority, state, +6 more."),
|
|
108
108
|
fields: z.string().optional().describe('Response field mask.'),
|
|
109
109
|
},
|
|
110
|
-
});
|
|
110
|
+
}, deps);
|
|
111
111
|
registerGeneratedTool(registry, {
|
|
112
112
|
name: "workspaceevents_subscriptions_reactivate",
|
|
113
113
|
cud: "update",
|
|
@@ -117,11 +117,11 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
117
117
|
hasBody: true,
|
|
118
118
|
bodyParams: [],
|
|
119
119
|
shape: {
|
|
120
|
-
account: accountField(),
|
|
120
|
+
account: accountField(() => registry.accountAliases()),
|
|
121
121
|
name: z.string().min(1).describe("Required. Resource name of the subscription. Format: `subscriptions/{subscription}`"),
|
|
122
122
|
fields: z.string().optional().describe('Response field mask.'),
|
|
123
123
|
},
|
|
124
|
-
});
|
|
124
|
+
}, deps);
|
|
125
125
|
registerGeneratedTool(registry, {
|
|
126
126
|
name: "workspaceevents_tasks_cancel",
|
|
127
127
|
cud: "delete",
|
|
@@ -131,12 +131,12 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
131
131
|
hasBody: true,
|
|
132
132
|
bodyParams: [{ "field": "tenant", "api": "tenant" }],
|
|
133
133
|
shape: {
|
|
134
|
-
account: accountField(),
|
|
134
|
+
account: accountField(() => registry.accountAliases()),
|
|
135
135
|
name: z.string().min(1).describe("The resource name of the task to cancel. Format: tasks/{task_id}"),
|
|
136
136
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
137
137
|
fields: z.string().optional().describe('Response field mask.'),
|
|
138
138
|
},
|
|
139
|
-
});
|
|
139
|
+
}, deps);
|
|
140
140
|
registerGeneratedTool(registry, {
|
|
141
141
|
name: "workspaceevents_tasks_get",
|
|
142
142
|
cud: "read",
|
|
@@ -145,13 +145,13 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
145
145
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "historyLength", "api": "historyLength", "location": "query" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
146
146
|
hasBody: false,
|
|
147
147
|
shape: {
|
|
148
|
-
account: accountField(),
|
|
148
|
+
account: accountField(() => registry.accountAliases()),
|
|
149
149
|
name: z.string().min(1).describe("Required. The resource name of the task. Format: tasks/{task_id}"),
|
|
150
150
|
historyLength: z.number().describe("The number of most recent messages from the task's history to retrieve.").optional(),
|
|
151
151
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
152
152
|
fields: z.string().optional().describe('Response field mask.'),
|
|
153
153
|
},
|
|
154
|
-
});
|
|
154
|
+
}, deps);
|
|
155
155
|
registerGeneratedTool(registry, {
|
|
156
156
|
name: "workspaceevents_tasks_push_notification_configs_create",
|
|
157
157
|
cud: "create",
|
|
@@ -160,14 +160,14 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
160
160
|
params: [{ "field": "parent", "api": "parent", "location": "path" }, { "field": "configId", "api": "configId", "location": "query" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
161
161
|
hasBody: true,
|
|
162
162
|
shape: {
|
|
163
|
-
account: accountField(),
|
|
163
|
+
account: accountField(() => registry.accountAliases()),
|
|
164
164
|
parent: z.string().min(1).describe("Required. The parent task resource for this config. Format: tasks/{task_id}"),
|
|
165
165
|
configId: z.string().describe("Required. The ID for the new config.").optional(),
|
|
166
166
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
167
167
|
body: coerceJson(z.record(z.string(), z.unknown())).describe("TaskPushNotificationConfig JSON request body. Top-level fields: name, pushNotificationConfig."),
|
|
168
168
|
fields: z.string().optional().describe('Response field mask.'),
|
|
169
169
|
},
|
|
170
|
-
});
|
|
170
|
+
}, deps);
|
|
171
171
|
registerGeneratedTool(registry, {
|
|
172
172
|
name: "workspaceevents_tasks_push_notification_configs_delete",
|
|
173
173
|
cud: "delete",
|
|
@@ -176,12 +176,12 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
176
176
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
177
177
|
hasBody: false,
|
|
178
178
|
shape: {
|
|
179
|
-
account: accountField(),
|
|
179
|
+
account: accountField(() => registry.accountAliases()),
|
|
180
180
|
name: z.string().min(1).describe("The resource name of the config to delete. Format: tasks/{task_id}/pushNotificationConfigs/{config_id}"),
|
|
181
181
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
182
182
|
fields: z.string().optional().describe('Response field mask.'),
|
|
183
183
|
},
|
|
184
|
-
});
|
|
184
|
+
}, deps);
|
|
185
185
|
registerGeneratedTool(registry, {
|
|
186
186
|
name: "workspaceevents_tasks_push_notification_configs_get",
|
|
187
187
|
cud: "read",
|
|
@@ -190,12 +190,12 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
190
190
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
191
191
|
hasBody: false,
|
|
192
192
|
shape: {
|
|
193
|
-
account: accountField(),
|
|
193
|
+
account: accountField(() => registry.accountAliases()),
|
|
194
194
|
name: z.string().min(1).describe("The resource name of the config to retrieve. Format: tasks/{task_id}/pushNotificationConfigs/{config_id}"),
|
|
195
195
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
196
196
|
fields: z.string().optional().describe('Response field mask.'),
|
|
197
197
|
},
|
|
198
|
-
});
|
|
198
|
+
}, deps);
|
|
199
199
|
registerGeneratedTool(registry, {
|
|
200
200
|
name: "workspaceevents_tasks_push_notification_configs_list",
|
|
201
201
|
cud: "read",
|
|
@@ -204,14 +204,14 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
204
204
|
params: [{ "field": "parent", "api": "parent", "location": "path" }, { "field": "pageSize", "api": "pageSize", "location": "query" }, { "field": "pageToken", "api": "pageToken", "location": "query" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
205
205
|
hasBody: false,
|
|
206
206
|
shape: {
|
|
207
|
-
account: accountField(),
|
|
207
|
+
account: accountField(() => registry.accountAliases()),
|
|
208
208
|
parent: z.string().min(1).describe("The parent task resource. Format: tasks/{task_id}"),
|
|
209
209
|
pageSize: z.number().describe("For AIP-158 these fields are present. Usually not used/needed. The maximum number of configurations to return. If unspecified, all configs will be returned.").optional(),
|
|
210
210
|
pageToken: z.string().describe("A page token received from a previous ListTaskPushNotificationConfigRequest call. Provide this to retrieve the subsequent page. When paginating, all other parameters provided to `ListTaskPushNotificat").optional(),
|
|
211
211
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
212
212
|
fields: z.string().optional().describe('Response field mask.'),
|
|
213
213
|
},
|
|
214
|
-
});
|
|
214
|
+
}, deps);
|
|
215
215
|
registerGeneratedTool(registry, {
|
|
216
216
|
name: "workspaceevents_tasks_subscribe",
|
|
217
217
|
cud: "read",
|
|
@@ -220,10 +220,10 @@ export function registerWorkspaceeventsGeneratedTools(registry) {
|
|
|
220
220
|
params: [{ "field": "name", "api": "name", "location": "path" }, { "field": "tenant", "api": "tenant", "location": "query" }, { "field": "fields", "api": "fields", "location": "query" }],
|
|
221
221
|
hasBody: false,
|
|
222
222
|
shape: {
|
|
223
|
-
account: accountField(),
|
|
223
|
+
account: accountField(() => registry.accountAliases()),
|
|
224
224
|
name: z.string().min(1).describe("The resource name of the task to subscribe to. Format: tasks/{task_id}"),
|
|
225
225
|
tenant: z.string().describe("Optional tenant, provided as a path parameter. Experimental, might still change for 1.0 release.").optional(),
|
|
226
226
|
fields: z.string().optional().describe('Response field mask.'),
|
|
227
227
|
},
|
|
228
|
-
});
|
|
228
|
+
}, deps);
|
|
229
229
|
}
|
|
@@ -37,7 +37,7 @@ export declare class HeaderInjectionError extends Error {
|
|
|
37
37
|
constructor(field: string);
|
|
38
38
|
}
|
|
39
39
|
/**
|
|
40
|
-
* The single MIME-assembly seam for gmail_send and gmail_create_draft
|
|
40
|
+
* The single MIME-assembly seam for gmail_send and gmail_create_draft.
|
|
41
41
|
* MailComposer owns header/RFC-2047/address encoding and boundary generation,
|
|
42
42
|
* which closes the CRLF header-injection hole in the old hand-rolled encoders.
|
|
43
43
|
* A deterministic pre-check rejects CR/LF in address/subject headers with a
|
package/dist/tools/gmail-mime.js
CHANGED
|
@@ -3,10 +3,8 @@ import MarkdownIt from 'markdown-it';
|
|
|
3
3
|
import TurndownService from 'turndown';
|
|
4
4
|
// @ts-expect-error turndown-plugin-gfm ships no type declarations
|
|
5
5
|
import { gfm } from 'turndown-plugin-gfm';
|
|
6
|
-
//
|
|
7
|
-
//
|
|
8
|
-
// the body (the XSS-safe default); allowRawHtml swaps to the html:true
|
|
9
|
-
// instance so an audited caller can pass literal HTML (e.g. inline color).
|
|
6
|
+
// Send: body is Markdown; text/plain is the source, text/html is this render.
|
|
7
|
+
// html:false escapes raw HTML in the body (XSS-safe default); allowRawHtml opts into html:true for an audited caller.
|
|
10
8
|
const mdSafe = new MarkdownIt({ html: false, linkify: true });
|
|
11
9
|
const mdRaw = new MarkdownIt({ html: true, linkify: true });
|
|
12
10
|
export function renderMarkdown(body, allowRawHtml = false) {
|
|
@@ -87,10 +85,8 @@ export function htmlToText(html) {
|
|
|
87
85
|
.replace(/\n{3,}/g, '\n\n')
|
|
88
86
|
.trim();
|
|
89
87
|
}
|
|
90
|
-
//
|
|
91
|
-
//
|
|
92
|
-
// bundled @mixmark-io/domino fork does NOT execute scripts; remove() drops
|
|
93
|
-
// script/style/head entirely (turndown otherwise leaks their text content).
|
|
88
|
+
// HTML-only bodies convert to Markdown so the model reads structure, not a flat
|
|
89
|
+
// text dump; turndown's bundled domino fork doesn't execute scripts, and remove() drops script/style/head (which otherwise leak text).
|
|
94
90
|
const turndownService = new TurndownService({ headingStyle: 'atx', codeBlockStyle: 'fenced', bulletListMarker: '-' });
|
|
95
91
|
turndownService.use(gfm);
|
|
96
92
|
turndownService.remove(['script', 'style', 'head']);
|
|
@@ -125,7 +121,7 @@ export class HeaderInjectionError extends Error {
|
|
|
125
121
|
}
|
|
126
122
|
}
|
|
127
123
|
/**
|
|
128
|
-
* The single MIME-assembly seam for gmail_send and gmail_create_draft
|
|
124
|
+
* The single MIME-assembly seam for gmail_send and gmail_create_draft.
|
|
129
125
|
* MailComposer owns header/RFC-2047/address encoding and boundary generation,
|
|
130
126
|
* which closes the CRLF header-injection hole in the old hand-rolled encoders.
|
|
131
127
|
* A deterministic pre-check rejects CR/LF in address/subject headers with a
|
|
@@ -152,9 +148,8 @@ export async function composeRaw(input) {
|
|
|
152
148
|
attachments: input.attachments,
|
|
153
149
|
newline: '\r\n',
|
|
154
150
|
textEncoding: 'base64',
|
|
155
|
-
// This server reads
|
|
156
|
-
//
|
|
157
|
-
// file-read defense-in-depth).
|
|
151
|
+
// This server reads attachment files itself and passes a Buffer; MailComposer
|
|
152
|
+
// must never touch the filesystem or network (SSRF / local file-read defense-in-depth).
|
|
158
153
|
disableFileAccess: true,
|
|
159
154
|
disableUrlAccess: true,
|
|
160
155
|
};
|
package/dist/tools/gmail.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
2
|
import type { Account } from '../accounts.js';
|
|
3
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
4
|
import { type ComposeAttachment } from './gmail-mime.js';
|
|
4
5
|
import type { GmailMessageHeader, GmailMessageFull } from '../types.js';
|
|
5
6
|
/** Re: prefix unless the subject already carries one (case-insensitive, after
|
|
@@ -15,7 +16,7 @@ interface ReplyDerivation {
|
|
|
15
16
|
}
|
|
16
17
|
/** Fetch the reply source once and derive threading headers plus (auto-fill)
|
|
17
18
|
* to/cc/subject. On any fetch failure, degrade to the API id for threading and
|
|
18
|
-
* report sourceFound:false so the caller can decide
|
|
19
|
+
* report sourceFound:false so the caller can decide. */
|
|
19
20
|
export declare function resolveReply(gmail: any, account: string, primaryEmail: string, replyToMessageId: string, replyAll: boolean): Promise<ReplyDerivation>;
|
|
20
21
|
export declare function readAttachments(raw: Array<{
|
|
21
22
|
path: string;
|
|
@@ -26,7 +27,7 @@ export declare function parseMessage(msg: any, bodyCap?: number, opts?: {
|
|
|
26
27
|
rawHtml?: boolean;
|
|
27
28
|
}): GmailMessageFull;
|
|
28
29
|
/**
|
|
29
|
-
*
|
|
30
|
+
* gmail_read_batch core: fetch N ids with bounded parallelism, parse each,
|
|
30
31
|
* and bound the aggregate output. Order is preserved by input index. A per-id
|
|
31
32
|
* failure becomes a `{ id, error }` entry; an account-wide auth/scope failure
|
|
32
33
|
* is rethrown so the caller maps it to a whole-call isError. Returns the
|
|
@@ -42,5 +43,5 @@ export declare function compactMessageRow(m: GmailMessageHeader): {
|
|
|
42
43
|
date: string;
|
|
43
44
|
snippet: string;
|
|
44
45
|
};
|
|
45
|
-
export declare function registerGmailTools(server: ToolRegistry): void;
|
|
46
|
+
export declare function registerGmailTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
|
46
47
|
export {};
|