mcp-google-multi 6.0.0-alpha.50 → 6.0.0-alpha.52
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/dist/tools/admin.d.ts +2 -1
- package/dist/tools/admin.js +13 -9
- package/dist/tools/analytics.d.ts +2 -1
- package/dist/tools/analytics.js +11 -7
- package/dist/tools/chat.d.ts +2 -1
- package/dist/tools/chat.js +11 -7
- package/dist/tools/docs.d.ts +2 -1
- package/dist/tools/docs.js +34 -30
- package/dist/tools/drive.d.ts +2 -1
- package/dist/tools/drive.js +45 -41
- package/dist/tools/forms.d.ts +2 -1
- package/dist/tools/forms.js +14 -10
- package/dist/tools/gmail.d.ts +2 -1
- package/dist/tools/gmail.js +29 -25
- package/dist/tools/google-api.js +3 -2
- package/dist/tools/sheets.d.ts +2 -1
- package/dist/tools/sheets.js +36 -32
- package/dist/tools/slides.d.ts +2 -1
- package/dist/tools/slides.js +12 -8
- package/package.json +3 -1
package/dist/tools/admin.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerAdminTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/admin.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { coerceBoolean } from './_coerce.js';
|
|
3
3
|
import { admin as adminClient } from '@googleapis/admin';
|
|
4
|
-
import {
|
|
4
|
+
import { accountArgLive } from '../accounts.js';
|
|
5
5
|
import { getClient } from '../client.js';
|
|
6
6
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
7
|
-
const accountEnum = accountAliasSchema.optional();
|
|
8
7
|
// Admin SDK requires Workspace super-admin (or delegated admin) on the account — personal @gmail.com accounts 403 on every endpoint.
|
|
9
|
-
export function registerAdminTools(server) {
|
|
8
|
+
export function registerAdminTools(server, deps = {}) {
|
|
9
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
10
|
+
// schema follows the registry's account view at parse time, and the
|
|
11
|
+
// custody path is the context's, not the process global.
|
|
12
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
13
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
10
14
|
// ─── Reports / audit log ───────────────────────────────────────────────
|
|
11
15
|
server.registerTool('reports_activities_list', {
|
|
12
16
|
description: 'List Admin Activity audit log entries. Filter by application (login, drive, gmail, admin, token, etc.), user, date range, event. The single most useful admin endpoint for SMB visibility.',
|
|
@@ -34,7 +38,7 @@ export function registerAdminTools(server) {
|
|
|
34
38
|
},
|
|
35
39
|
}, async ({ account, applicationName, userKey, startTime, endTime, eventName, actorIpAddress, filters, orgUnitID, groupIdFilter, customerId, maxResults, pageToken }) => {
|
|
36
40
|
try {
|
|
37
|
-
const auth = await
|
|
41
|
+
const auth = await getClientFn(account);
|
|
38
42
|
const reports = adminClient({ version: 'reports_v1', auth });
|
|
39
43
|
const res = await reports.activities.list({
|
|
40
44
|
applicationName,
|
|
@@ -74,7 +78,7 @@ export function registerAdminTools(server) {
|
|
|
74
78
|
},
|
|
75
79
|
}, async ({ account, customer, domain, query, maxResults, pageToken, orderBy, showDeleted, projection }) => {
|
|
76
80
|
try {
|
|
77
|
-
const auth = await
|
|
81
|
+
const auth = await getClientFn(account);
|
|
78
82
|
const directory = adminClient({ version: 'directory_v1', auth });
|
|
79
83
|
const res = await directory.users.list({
|
|
80
84
|
customer: customer ?? 'my_customer',
|
|
@@ -103,7 +107,7 @@ export function registerAdminTools(server) {
|
|
|
103
107
|
},
|
|
104
108
|
}, async ({ account, userKey, projection }) => {
|
|
105
109
|
try {
|
|
106
|
-
const auth = await
|
|
110
|
+
const auth = await getClientFn(account);
|
|
107
111
|
const directory = adminClient({ version: 'directory_v1', auth });
|
|
108
112
|
const res = await directory.users.get({
|
|
109
113
|
userKey,
|
|
@@ -131,7 +135,7 @@ export function registerAdminTools(server) {
|
|
|
131
135
|
},
|
|
132
136
|
}, async ({ account, userKey, givenName, familyName, suspended, password, changePasswordAtNextLogin, orgUnitPath }) => {
|
|
133
137
|
try {
|
|
134
|
-
const auth = await
|
|
138
|
+
const auth = await getClientFn(account);
|
|
135
139
|
const directory = adminClient({ version: 'directory_v1', auth });
|
|
136
140
|
const requestBody = {};
|
|
137
141
|
if (givenName !== undefined || familyName !== undefined) {
|
|
@@ -175,7 +179,7 @@ export function registerAdminTools(server) {
|
|
|
175
179
|
},
|
|
176
180
|
}, async ({ account, customer, domain, userKey, query, maxResults, pageToken }) => {
|
|
177
181
|
try {
|
|
178
|
-
const auth = await
|
|
182
|
+
const auth = await getClientFn(account);
|
|
179
183
|
const directory = adminClient({ version: 'directory_v1', auth });
|
|
180
184
|
const res = await directory.groups.list({
|
|
181
185
|
customer: customer ?? 'my_customer',
|
|
@@ -205,7 +209,7 @@ export function registerAdminTools(server) {
|
|
|
205
209
|
},
|
|
206
210
|
}, async ({ account, groupKey, roles, includeDerivedMembership, maxResults, pageToken }) => {
|
|
207
211
|
try {
|
|
208
|
-
const auth = await
|
|
212
|
+
const auth = await getClientFn(account);
|
|
209
213
|
const directory = adminClient({ version: 'directory_v1', auth });
|
|
210
214
|
const res = await directory.members.list({
|
|
211
215
|
groupKey,
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
2
3
|
/** Accepts "213025502" or "properties/213025502"; rejects the identifiers
|
|
3
4
|
* people paste by mistake (G-… measurement IDs, UA-… properties) with a
|
|
4
5
|
* pointer to the right one. */
|
|
@@ -15,4 +16,4 @@ export declare function shapeAccountSummaries(data: any): Record<string, unknown
|
|
|
15
16
|
/** Full metadata descriptions run to paragraphs; the first ~160 chars carry
|
|
16
17
|
* the disambiguation the model needs without bloating a ~300-entry list. */
|
|
17
18
|
export declare function shapeMetadata(data: any): Record<string, unknown>;
|
|
18
|
-
export declare function registerAnalyticsTools(server: ToolRegistry): void;
|
|
19
|
+
export declare function registerAnalyticsTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/analytics.js
CHANGED
|
@@ -2,10 +2,9 @@ import { z } from 'zod';
|
|
|
2
2
|
import { coerceArray, coerceBoolean, coerceJson } from './_coerce.js';
|
|
3
3
|
import { analyticsdata as analyticsdataClient } from '@googleapis/analyticsdata';
|
|
4
4
|
import { analyticsadmin as analyticsadminClient } from '@googleapis/analyticsadmin';
|
|
5
|
-
import {
|
|
5
|
+
import { accountArgLive } from '../accounts.js';
|
|
6
6
|
import { getClient } from '../client.js';
|
|
7
7
|
import { handleGoogleApiError } from './_errors.js';
|
|
8
|
-
const accountEnum = accountAliasSchema.optional();
|
|
9
8
|
/** Accepts "213025502" or "properties/213025502"; rejects the identifiers
|
|
10
9
|
* people paste by mistake (G-… measurement IDs, UA-… properties) with a
|
|
11
10
|
* pointer to the right one. */
|
|
@@ -105,7 +104,12 @@ export function shapeMetadata(data) {
|
|
|
105
104
|
const propertySchema = z
|
|
106
105
|
.string()
|
|
107
106
|
.describe('GA4 property: numeric ID like "213025502" or "properties/213025502" — NOT a "G-..." measurement ID and not "UA-...". Find yours with analytics_account_summaries.');
|
|
108
|
-
export function registerAnalyticsTools(server) {
|
|
107
|
+
export function registerAnalyticsTools(server, deps = {}) {
|
|
108
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
109
|
+
// schema follows the registry's account view at parse time, and the
|
|
110
|
+
// custody path is the context's, not the process global.
|
|
111
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
112
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
109
113
|
server.registerTool('analytics_account_summaries', {
|
|
110
114
|
description: 'List every Google Analytics (GA4) account and property this Google account can access, with their numeric property IDs. The starting point for any Analytics question ("what properties do I have?").',
|
|
111
115
|
inputSchema: {
|
|
@@ -115,7 +119,7 @@ export function registerAnalyticsTools(server) {
|
|
|
115
119
|
},
|
|
116
120
|
}, async ({ account, pageSize, pageToken }) => {
|
|
117
121
|
try {
|
|
118
|
-
const auth = await
|
|
122
|
+
const auth = await getClientFn(account);
|
|
119
123
|
const admin = analyticsadminClient({ version: 'v1beta', auth });
|
|
120
124
|
const res = await admin.accountSummaries.list({ pageSize, pageToken });
|
|
121
125
|
return {
|
|
@@ -159,7 +163,7 @@ export function registerAnalyticsTools(server) {
|
|
|
159
163
|
if ('hint' in prop)
|
|
160
164
|
return invalidProperty(prop.hint, account);
|
|
161
165
|
try {
|
|
162
|
-
const auth = await
|
|
166
|
+
const auth = await getClientFn(account);
|
|
163
167
|
const dataApi = analyticsdataClient({ version: 'v1beta', auth });
|
|
164
168
|
const requestBody = {
|
|
165
169
|
dateRanges: [{ startDate, endDate }],
|
|
@@ -216,7 +220,7 @@ export function registerAnalyticsTools(server) {
|
|
|
216
220
|
if ('hint' in prop)
|
|
217
221
|
return invalidProperty(prop.hint, account);
|
|
218
222
|
try {
|
|
219
|
-
const auth = await
|
|
223
|
+
const auth = await getClientFn(account);
|
|
220
224
|
const dataApi = analyticsdataClient({ version: 'v1beta', auth });
|
|
221
225
|
const requestBody = { metrics: metrics.map((name) => ({ name })) };
|
|
222
226
|
if (dimensions?.length)
|
|
@@ -251,7 +255,7 @@ export function registerAnalyticsTools(server) {
|
|
|
251
255
|
if ('hint' in prop)
|
|
252
256
|
return invalidProperty(prop.hint, account);
|
|
253
257
|
try {
|
|
254
|
-
const auth = await
|
|
258
|
+
const auth = await getClientFn(account);
|
|
255
259
|
const dataApi = analyticsdataClient({ version: 'v1beta', auth });
|
|
256
260
|
const res = await dataApi.properties.getMetadata({ name: `${prop.name}/metadata` });
|
|
257
261
|
return {
|
package/dist/tools/chat.d.ts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
-
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
3
|
+
export declare function registerChatTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
package/dist/tools/chat.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { coerceJson } from './_coerce.js';
|
|
3
3
|
import { chat as chatClient } from '@googleapis/chat';
|
|
4
|
-
import {
|
|
4
|
+
import { accountArgLive } from '../accounts.js';
|
|
5
5
|
import { getClient } from '../client.js';
|
|
6
6
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
export function registerChatTools(server, deps = {}) {
|
|
8
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
9
|
+
// schema follows the registry's account view at parse time, and the
|
|
10
|
+
// custody path is the context's, not the process global.
|
|
11
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
12
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
9
13
|
server.registerTool('chat_spaces_list', {
|
|
10
14
|
description: 'List Google Chat spaces the user is a member of',
|
|
11
15
|
inputSchema: {
|
|
@@ -16,7 +20,7 @@ export function registerChatTools(server) {
|
|
|
16
20
|
},
|
|
17
21
|
}, async ({ account, pageSize, pageToken, filter }) => {
|
|
18
22
|
try {
|
|
19
|
-
const auth = await
|
|
23
|
+
const auth = await getClientFn(account);
|
|
20
24
|
const chat = chatClient({ version: 'v1', auth });
|
|
21
25
|
const res = await chat.spaces.list({
|
|
22
26
|
pageSize: pageSize ?? 100,
|
|
@@ -39,7 +43,7 @@ export function registerChatTools(server) {
|
|
|
39
43
|
},
|
|
40
44
|
}, async ({ account, name }) => {
|
|
41
45
|
try {
|
|
42
|
-
const auth = await
|
|
46
|
+
const auth = await getClientFn(account);
|
|
43
47
|
const chat = chatClient({ version: 'v1', auth });
|
|
44
48
|
const res = await chat.spaces.get({ name });
|
|
45
49
|
return {
|
|
@@ -65,7 +69,7 @@ export function registerChatTools(server) {
|
|
|
65
69
|
if (!text && (!cardsV2 || cardsV2.length === 0)) {
|
|
66
70
|
return invalidParams(account, 'A message needs content: neither text nor cardsV2 was supplied.', 'Pass text for a plain message, or cardsV2 for a Card v2 payload. Both may be sent together.');
|
|
67
71
|
}
|
|
68
|
-
const auth = await
|
|
72
|
+
const auth = await getClientFn(account);
|
|
69
73
|
const chat = chatClient({ version: 'v1', auth });
|
|
70
74
|
const requestBody = {};
|
|
71
75
|
if (text)
|
|
@@ -99,7 +103,7 @@ export function registerChatTools(server) {
|
|
|
99
103
|
},
|
|
100
104
|
}, async ({ account, parent, pageSize, pageToken, filter, orderBy }) => {
|
|
101
105
|
try {
|
|
102
|
-
const auth = await
|
|
106
|
+
const auth = await getClientFn(account);
|
|
103
107
|
const chat = chatClient({ version: 'v1', auth });
|
|
104
108
|
const res = await chat.spaces.messages.list({
|
|
105
109
|
parent,
|
package/dist/tools/docs.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
2
3
|
export declare const DOCS_INSERT_CHUNK = 5000;
|
|
3
4
|
export declare function splitInsertText(text: string, maxLen?: number): string[];
|
|
4
5
|
export declare function buildInsertRequests(text: string, index?: number): any[];
|
|
@@ -24,7 +25,7 @@ export declare function listTabs(tabs: any[] | undefined): {
|
|
|
24
25
|
tabId: string;
|
|
25
26
|
title: string;
|
|
26
27
|
}[];
|
|
27
|
-
export declare function registerDocsTools(server: ToolRegistry): void;
|
|
28
|
+
export declare function registerDocsTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
|
28
29
|
export declare function buildParagraphStyle(input: {
|
|
29
30
|
namedStyleType?: string;
|
|
30
31
|
alignment?: string;
|
package/dist/tools/docs.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { coerceBoolean, coerceJson } from './_coerce.js';
|
|
3
3
|
import { docs as docsClient } from '@googleapis/docs';
|
|
4
|
-
import {
|
|
4
|
+
import { accountArgLive } from '../accounts.js';
|
|
5
5
|
import { getClient } from '../client.js';
|
|
6
6
|
import { handleGoogleApiError, invalidParams } from './_errors.js';
|
|
7
7
|
import { capText } from '../trim.js';
|
|
8
|
-
const accountEnum = accountAliasSchema.optional();
|
|
9
8
|
// A single very large insertText has been observed to apply only partially while
|
|
10
9
|
// the request still returns success, silently dropping the tail. Split a large
|
|
11
10
|
// insert into bounded pieces sent as sequential insertText requests in one atomic
|
|
@@ -170,7 +169,12 @@ export function listTabs(tabs) {
|
|
|
170
169
|
}
|
|
171
170
|
return out;
|
|
172
171
|
}
|
|
173
|
-
export function registerDocsTools(server) {
|
|
172
|
+
export function registerDocsTools(server, deps = {}) {
|
|
173
|
+
// Per-registry, LIVE account enum + injectable client (S1.10): the
|
|
174
|
+
// schema follows the registry's account view at parse time, and the
|
|
175
|
+
// custody path is the context's, not the process global.
|
|
176
|
+
const accountEnum = accountArgLive(() => server.accountAliases()).optional();
|
|
177
|
+
const getClientFn = deps.getClientFn ?? getClient;
|
|
174
178
|
server.registerTool('docs_create', {
|
|
175
179
|
description: 'Create a new Google Docs document',
|
|
176
180
|
inputSchema: {
|
|
@@ -179,7 +183,7 @@ export function registerDocsTools(server) {
|
|
|
179
183
|
},
|
|
180
184
|
}, async ({ account, title }) => {
|
|
181
185
|
try {
|
|
182
|
-
const auth = await
|
|
186
|
+
const auth = await getClientFn(account);
|
|
183
187
|
const docs = docsClient({ version: 'v1', auth });
|
|
184
188
|
const res = await docs.documents.create({
|
|
185
189
|
requestBody: { title },
|
|
@@ -211,7 +215,7 @@ export function registerDocsTools(server) {
|
|
|
211
215
|
},
|
|
212
216
|
}, async ({ account, documentId, includeTabsContent, suggestionsViewMode }) => {
|
|
213
217
|
try {
|
|
214
|
-
const auth = await
|
|
218
|
+
const auth = await getClientFn(account);
|
|
215
219
|
const docs = docsClient({ version: 'v1', auth });
|
|
216
220
|
const res = await docs.documents.get({
|
|
217
221
|
documentId,
|
|
@@ -253,7 +257,7 @@ export function registerDocsTools(server) {
|
|
|
253
257
|
if (heading !== undefined && headingIndex !== undefined) {
|
|
254
258
|
return invalidParams(account, 'Both heading and headingIndex were supplied, and they address different sections.', 'Pass heading to look a section up by its text, or headingIndex to address one by position. Not both.');
|
|
255
259
|
}
|
|
256
|
-
const auth = await
|
|
260
|
+
const auth = await getClientFn(account);
|
|
257
261
|
const docs = docsClient({ version: 'v1', auth });
|
|
258
262
|
const res = await docs.documents.get({
|
|
259
263
|
documentId,
|
|
@@ -352,7 +356,7 @@ export function registerDocsTools(server) {
|
|
|
352
356
|
},
|
|
353
357
|
}, async ({ account, documentId, text, index }) => {
|
|
354
358
|
try {
|
|
355
|
-
const auth = await
|
|
359
|
+
const auth = await getClientFn(account);
|
|
356
360
|
const docs = docsClient({ version: 'v1', auth });
|
|
357
361
|
const requests = buildInsertRequests(text, index);
|
|
358
362
|
if (requests.length === 0) {
|
|
@@ -392,7 +396,7 @@ export function registerDocsTools(server) {
|
|
|
392
396
|
},
|
|
393
397
|
}, async ({ account, documentId, findText, replaceText, matchCase }) => {
|
|
394
398
|
try {
|
|
395
|
-
const auth = await
|
|
399
|
+
const auth = await getClientFn(account);
|
|
396
400
|
const docs = docsClient({ version: 'v1', auth });
|
|
397
401
|
const res = await docs.documents.batchUpdate({
|
|
398
402
|
documentId,
|
|
@@ -427,7 +431,7 @@ export function registerDocsTools(server) {
|
|
|
427
431
|
},
|
|
428
432
|
}, async ({ account, documentId, startIndex, endIndex }) => {
|
|
429
433
|
try {
|
|
430
|
-
const auth = await
|
|
434
|
+
const auth = await getClientFn(account);
|
|
431
435
|
const docs = docsClient({ version: 'v1', auth });
|
|
432
436
|
const res = await docs.documents.batchUpdate({
|
|
433
437
|
documentId,
|
|
@@ -465,7 +469,7 @@ export function registerDocsTools(server) {
|
|
|
465
469
|
},
|
|
466
470
|
}, async ({ account, documentId, startIndex, endIndex, bold, italic, underline, fontSize, fontFamily }) => {
|
|
467
471
|
try {
|
|
468
|
-
const auth = await
|
|
472
|
+
const auth = await getClientFn(account);
|
|
469
473
|
const docs = docsClient({ version: 'v1', auth });
|
|
470
474
|
const textStyle = {};
|
|
471
475
|
const fields = [];
|
|
@@ -528,7 +532,7 @@ export function registerDocsTools(server) {
|
|
|
528
532
|
},
|
|
529
533
|
}, async ({ account, documentId, rows, columns, index }) => {
|
|
530
534
|
try {
|
|
531
|
-
const auth = await
|
|
535
|
+
const auth = await getClientFn(account);
|
|
532
536
|
const docs = docsClient({ version: 'v1', auth });
|
|
533
537
|
const request = { insertTable: { rows, columns } };
|
|
534
538
|
if (index !== undefined) {
|
|
@@ -564,7 +568,7 @@ export function registerDocsTools(server) {
|
|
|
564
568
|
},
|
|
565
569
|
}, async ({ account, documentId, name, startIndex, endIndex }) => {
|
|
566
570
|
try {
|
|
567
|
-
const auth = await
|
|
571
|
+
const auth = await getClientFn(account);
|
|
568
572
|
const docs = docsClient({ version: 'v1', auth });
|
|
569
573
|
const res = await docs.documents.batchUpdate({
|
|
570
574
|
documentId,
|
|
@@ -599,7 +603,7 @@ export function registerDocsTools(server) {
|
|
|
599
603
|
if (!namedRangeId && !name) {
|
|
600
604
|
return invalidParams(account, 'Neither namedRangeId nor name was supplied, so no named range is addressed.', 'Pass namedRangeId to delete one specific range, or name to delete every range carrying that name.');
|
|
601
605
|
}
|
|
602
|
-
const auth = await
|
|
606
|
+
const auth = await getClientFn(account);
|
|
603
607
|
const docs = docsClient({ version: 'v1', auth });
|
|
604
608
|
const req = {};
|
|
605
609
|
if (namedRangeId)
|
|
@@ -632,7 +636,7 @@ export function registerDocsTools(server) {
|
|
|
632
636
|
if (!namedRangeId && !namedRangeName) {
|
|
633
637
|
return invalidParams(account, 'Neither namedRangeId nor namedRangeName was supplied, so no named range is addressed.', 'Pass namedRangeId to replace one specific range, or namedRangeName to replace every range carrying that name.');
|
|
634
638
|
}
|
|
635
|
-
const auth = await
|
|
639
|
+
const auth = await getClientFn(account);
|
|
636
640
|
const docs = docsClient({ version: 'v1', auth });
|
|
637
641
|
const req = { text };
|
|
638
642
|
if (namedRangeId)
|
|
@@ -677,7 +681,7 @@ export function registerDocsTools(server) {
|
|
|
677
681
|
},
|
|
678
682
|
}, async ({ account, documentId, startIndex, endIndex, ...style }) => {
|
|
679
683
|
try {
|
|
680
|
-
const auth = await
|
|
684
|
+
const auth = await getClientFn(account);
|
|
681
685
|
const docs = docsClient({ version: 'v1', auth });
|
|
682
686
|
const built = buildParagraphStyle(style);
|
|
683
687
|
if (built.fields.length === 0) {
|
|
@@ -723,7 +727,7 @@ export function registerDocsTools(server) {
|
|
|
723
727
|
},
|
|
724
728
|
}, async ({ account, documentId, ...style }) => {
|
|
725
729
|
try {
|
|
726
|
-
const auth = await
|
|
730
|
+
const auth = await getClientFn(account);
|
|
727
731
|
const docs = docsClient({ version: 'v1', auth });
|
|
728
732
|
const built = buildDocumentStyle(style);
|
|
729
733
|
if (built.fields.length === 0) {
|
|
@@ -776,7 +780,7 @@ export function registerDocsTools(server) {
|
|
|
776
780
|
},
|
|
777
781
|
}, async ({ account, documentId, startIndex, endIndex, bulletPreset }) => {
|
|
778
782
|
try {
|
|
779
|
-
const auth = await
|
|
783
|
+
const auth = await getClientFn(account);
|
|
780
784
|
const docs = docsClient({ version: 'v1', auth });
|
|
781
785
|
await docs.documents.batchUpdate({
|
|
782
786
|
documentId,
|
|
@@ -807,7 +811,7 @@ export function registerDocsTools(server) {
|
|
|
807
811
|
},
|
|
808
812
|
}, async ({ account, documentId, startIndex, endIndex }) => {
|
|
809
813
|
try {
|
|
810
|
-
const auth = await
|
|
814
|
+
const auth = await getClientFn(account);
|
|
811
815
|
const docs = docsClient({ version: 'v1', auth });
|
|
812
816
|
await docs.documents.batchUpdate({
|
|
813
817
|
documentId,
|
|
@@ -840,7 +844,7 @@ export function registerDocsTools(server) {
|
|
|
840
844
|
},
|
|
841
845
|
}, async ({ account, documentId, uri, index, width, height }) => {
|
|
842
846
|
try {
|
|
843
|
-
const auth = await
|
|
847
|
+
const auth = await getClientFn(account);
|
|
844
848
|
const docs = docsClient({ version: 'v1', auth });
|
|
845
849
|
const request = { uri };
|
|
846
850
|
if (index !== undefined)
|
|
@@ -876,7 +880,7 @@ export function registerDocsTools(server) {
|
|
|
876
880
|
},
|
|
877
881
|
}, async ({ account, documentId, index }) => {
|
|
878
882
|
try {
|
|
879
|
-
const auth = await
|
|
883
|
+
const auth = await getClientFn(account);
|
|
880
884
|
const docs = docsClient({ version: 'v1', auth });
|
|
881
885
|
const request = {};
|
|
882
886
|
if (index !== undefined)
|
|
@@ -905,7 +909,7 @@ export function registerDocsTools(server) {
|
|
|
905
909
|
},
|
|
906
910
|
}, async ({ account, documentId, index, sectionType }) => {
|
|
907
911
|
try {
|
|
908
|
-
const auth = await
|
|
912
|
+
const auth = await getClientFn(account);
|
|
909
913
|
const docs = docsClient({ version: 'v1', auth });
|
|
910
914
|
const request = { sectionType: sectionType ?? 'NEXT_PAGE' };
|
|
911
915
|
if (index !== undefined)
|
|
@@ -934,7 +938,7 @@ export function registerDocsTools(server) {
|
|
|
934
938
|
},
|
|
935
939
|
}, async ({ account, documentId, sectionBreakIndex }) => {
|
|
936
940
|
try {
|
|
937
|
-
const auth = await
|
|
941
|
+
const auth = await getClientFn(account);
|
|
938
942
|
const docs = docsClient({ version: 'v1', auth });
|
|
939
943
|
const request = { type: 'DEFAULT' };
|
|
940
944
|
if (sectionBreakIndex !== undefined)
|
|
@@ -961,7 +965,7 @@ export function registerDocsTools(server) {
|
|
|
961
965
|
},
|
|
962
966
|
}, async ({ account, documentId, headerId }) => {
|
|
963
967
|
try {
|
|
964
|
-
const auth = await
|
|
968
|
+
const auth = await getClientFn(account);
|
|
965
969
|
const docs = docsClient({ version: 'v1', auth });
|
|
966
970
|
await docs.documents.batchUpdate({
|
|
967
971
|
documentId,
|
|
@@ -984,7 +988,7 @@ export function registerDocsTools(server) {
|
|
|
984
988
|
},
|
|
985
989
|
}, async ({ account, documentId, sectionBreakIndex }) => {
|
|
986
990
|
try {
|
|
987
|
-
const auth = await
|
|
991
|
+
const auth = await getClientFn(account);
|
|
988
992
|
const docs = docsClient({ version: 'v1', auth });
|
|
989
993
|
const request = { type: 'DEFAULT' };
|
|
990
994
|
if (sectionBreakIndex !== undefined)
|
|
@@ -1011,7 +1015,7 @@ export function registerDocsTools(server) {
|
|
|
1011
1015
|
},
|
|
1012
1016
|
}, async ({ account, documentId, footerId }) => {
|
|
1013
1017
|
try {
|
|
1014
|
-
const auth = await
|
|
1018
|
+
const auth = await getClientFn(account);
|
|
1015
1019
|
const docs = docsClient({ version: 'v1', auth });
|
|
1016
1020
|
await docs.documents.batchUpdate({
|
|
1017
1021
|
documentId,
|
|
@@ -1044,7 +1048,7 @@ export function registerDocsTools(server) {
|
|
|
1044
1048
|
},
|
|
1045
1049
|
}, async ({ account, documentId, operation, tableStartIndex, rowIndex, columnIndex, insertBelow, insertRight, rowSpan, columnSpan }) => {
|
|
1046
1050
|
try {
|
|
1047
|
-
const auth = await
|
|
1051
|
+
const auth = await getClientFn(account);
|
|
1048
1052
|
const docs = docsClient({ version: 'v1', auth });
|
|
1049
1053
|
const cellLoc = {
|
|
1050
1054
|
tableStartLocation: { index: tableStartIndex },
|
|
@@ -1112,7 +1116,7 @@ export function registerDocsTools(server) {
|
|
|
1112
1116
|
},
|
|
1113
1117
|
}, async ({ account, documentId, title, parentTabId, index }) => {
|
|
1114
1118
|
try {
|
|
1115
|
-
const auth = await
|
|
1119
|
+
const auth = await getClientFn(account);
|
|
1116
1120
|
const docs = docsClient({ version: 'v1', auth });
|
|
1117
1121
|
const tabProperties = { title };
|
|
1118
1122
|
if (parentTabId)
|
|
@@ -1141,7 +1145,7 @@ export function registerDocsTools(server) {
|
|
|
1141
1145
|
},
|
|
1142
1146
|
}, async ({ account, documentId, tabId }) => {
|
|
1143
1147
|
try {
|
|
1144
|
-
const auth = await
|
|
1148
|
+
const auth = await getClientFn(account);
|
|
1145
1149
|
const docs = docsClient({ version: 'v1', auth });
|
|
1146
1150
|
await docs.documents.batchUpdate({
|
|
1147
1151
|
documentId,
|
|
@@ -1167,7 +1171,7 @@ export function registerDocsTools(server) {
|
|
|
1167
1171
|
},
|
|
1168
1172
|
}, async ({ account, documentId, tabId, title, index, parentTabId }) => {
|
|
1169
1173
|
try {
|
|
1170
|
-
const auth = await
|
|
1174
|
+
const auth = await getClientFn(account);
|
|
1171
1175
|
const docs = docsClient({ version: 'v1', auth });
|
|
1172
1176
|
const tabProperties = { tabId };
|
|
1173
1177
|
const fields = [];
|
|
@@ -1221,7 +1225,7 @@ export function registerDocsTools(server) {
|
|
|
1221
1225
|
},
|
|
1222
1226
|
}, async ({ account, documentId, requests, writeControl }) => {
|
|
1223
1227
|
try {
|
|
1224
|
-
const auth = await
|
|
1228
|
+
const auth = await getClientFn(account);
|
|
1225
1229
|
const docs = docsClient({ version: 'v1', auth });
|
|
1226
1230
|
const res = await docs.documents.batchUpdate({
|
|
1227
1231
|
documentId,
|
package/dist/tools/drive.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ToolRegistry } from '../registry.js';
|
|
2
|
+
import { type CuratedToolDeps } from '../client.js';
|
|
2
3
|
export declare function isTextualMime(mimeType: string): boolean;
|
|
3
4
|
export declare function resolveConvertTarget(convertTo: string | undefined): string | undefined;
|
|
4
5
|
export declare const DRIVE_QUERY_HINT: string;
|
|
@@ -10,7 +11,7 @@ export declare function resolveShareNotification(opts: {
|
|
|
10
11
|
transferOwnership?: boolean;
|
|
11
12
|
sendNotification?: boolean;
|
|
12
13
|
}): boolean | undefined;
|
|
13
|
-
export declare function registerDriveTools(server: ToolRegistry): void;
|
|
14
|
+
export declare function registerDriveTools(server: ToolRegistry, deps?: CuratedToolDeps): void;
|
|
14
15
|
export type TransferPlan = {
|
|
15
16
|
kind: 'binary';
|
|
16
17
|
} | {
|