@aaronsb/google-workspace-mcp 3.0.0 → 4.0.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/LICENSE +201 -21
- package/LICENSE-MIT +21 -0
- package/NOTICE +24 -0
- package/README.md +71 -52
- package/build/accounts/auth.d.ts +1 -1
- package/build/accounts/auth.js +1 -1
- package/build/accounts/oauth.js +3 -3
- package/build/accounts/oauth.js.map +1 -1
- package/build/accounts/token-service.js +1 -1
- package/build/accounts/token-service.js.map +1 -1
- package/build/coverage/analyze.d.ts +1 -1
- package/build/coverage/analyze.js +6 -4
- package/build/coverage/analyze.js.map +1 -1
- package/build/coverage/baseline.js +37 -20
- package/build/coverage/baseline.js.map +1 -1
- package/build/coverage/compare.d.ts +1 -1
- package/build/coverage/compare.js +19 -10
- package/build/coverage/compare.js.map +1 -1
- package/build/coverage/discover.d.ts +5 -5
- package/build/coverage/discover.js +71 -155
- package/build/coverage/discover.js.map +1 -1
- package/build/coverage/report.js +3 -3
- package/build/coverage/report.js.map +1 -1
- package/build/coverage/types.d.ts +19 -4
- package/build/executor/index.d.ts +0 -3
- package/build/executor/index.js +1 -2
- package/build/executor/index.js.map +1 -1
- package/build/factory/defaults.js +30 -4
- package/build/factory/defaults.js.map +1 -1
- package/build/factory/generator.d.ts +10 -2
- package/build/factory/generator.js +54 -69
- package/build/factory/generator.js.map +1 -1
- package/build/factory/manifest/README.md +4 -3
- package/build/factory/manifest/calendar.yaml +1 -11
- package/build/factory/manifest/docs.yaml +15 -6
- package/build/factory/manifest/drive.yaml +1 -5
- package/build/factory/manifest/gmail.yaml +9 -24
- package/build/factory/manifest/meet.yaml +1 -1
- package/build/factory/manifest/sheets.yaml +2 -5
- package/build/factory/manifest/tasks.yaml +40 -2
- package/build/factory/patches.js +2 -0
- package/build/factory/patches.js.map +1 -1
- package/build/factory/safety.js +4 -4
- package/build/factory/safety.js.map +1 -1
- package/build/factory/types.d.ts +16 -15
- package/build/google/client.d.ts +45 -0
- package/build/google/client.js +232 -0
- package/build/google/client.js.map +1 -0
- package/build/google/descriptor.d.ts +40 -0
- package/build/google/descriptor.js +37 -0
- package/build/google/descriptor.js.map +1 -0
- package/build/google/descriptor.json +5271 -0
- package/build/google/errors.d.ts +45 -0
- package/build/google/errors.js +44 -0
- package/build/google/errors.js.map +1 -0
- package/build/google/methods.d.ts +37 -0
- package/build/google/methods.js +13 -0
- package/build/google/methods.js.map +1 -0
- package/build/index.js +3 -3
- package/build/index.js.map +1 -1
- package/build/node-floor.js +1 -1
- package/build/node-floor.js.map +1 -1
- package/build/server/formatting/markdown.d.ts +1 -1
- package/build/server/formatting/markdown.js +1 -1
- package/build/server/formatting/next-steps.js +1 -1
- package/build/server/formatting/next-steps.js.map +1 -1
- package/build/server/handlers/accounts.js +2 -2
- package/build/server/handlers/accounts.js.map +1 -1
- package/build/server/scratchpad/adapters/import-doc.js +15 -13
- package/build/server/scratchpad/adapters/import-doc.js.map +1 -1
- package/build/server/scratchpad/adapters/import-drive.js +16 -11
- package/build/server/scratchpad/adapters/import-drive.js.map +1 -1
- package/build/server/scratchpad/adapters/import-email.js +3 -15
- package/build/server/scratchpad/adapters/import-email.js.map +1 -1
- package/build/server/scratchpad/adapters/import-meet.js +5 -17
- package/build/server/scratchpad/adapters/import-meet.js.map +1 -1
- package/build/server/scratchpad/adapters/import-sheet.js +5 -6
- package/build/server/scratchpad/adapters/import-sheet.js.map +1 -1
- package/build/server/scratchpad/adapters/send-calendar.js +18 -13
- package/build/server/scratchpad/adapters/send-calendar.js.map +1 -1
- package/build/server/scratchpad/adapters/send-doc.js +22 -17
- package/build/server/scratchpad/adapters/send-doc.js.map +1 -1
- package/build/server/scratchpad/adapters/send-email-draft.d.ts +1 -1
- package/build/server/scratchpad/adapters/send-email-draft.js +17 -25
- package/build/server/scratchpad/adapters/send-email-draft.js.map +1 -1
- package/build/server/scratchpad/adapters/send-email.d.ts +2 -2
- package/build/server/scratchpad/adapters/send-email.js +21 -25
- package/build/server/scratchpad/adapters/send-email.js.map +1 -1
- package/build/server/scratchpad/adapters/send-sheet.js +10 -10
- package/build/server/scratchpad/adapters/send-sheet.js.map +1 -1
- package/build/server/scratchpad/adapters/send-task.js +9 -8
- package/build/server/scratchpad/adapters/send-task.js.map +1 -1
- package/build/server/scratchpad/handler.js +22 -28
- package/build/server/scratchpad/handler.js.map +1 -1
- package/build/server/scratchpad/manager.d.ts +1 -1
- package/build/server/server.js +13 -10
- package/build/server/server.js.map +1 -1
- package/build/server/session/tracker.js +21 -25
- package/build/server/session/tracker.js.map +1 -1
- package/build/server/tools.d.ts +1 -1
- package/build/server/tools.js +3 -3
- package/build/server/tools.js.map +1 -1
- package/build/services/calendar/patch.js +178 -68
- package/build/services/calendar/patch.js.map +1 -1
- package/build/services/docs/patch.d.ts +5 -3
- package/build/services/docs/patch.js +89 -19
- package/build/services/docs/patch.js.map +1 -1
- package/build/services/drive/patch.d.ts +1 -1
- package/build/services/drive/patch.js +115 -143
- package/build/services/drive/patch.js.map +1 -1
- package/build/services/gmail/attachments.js +10 -15
- package/build/services/gmail/attachments.js.map +1 -1
- package/build/services/gmail/mail.d.ts +34 -0
- package/build/services/gmail/mail.js +245 -0
- package/build/services/gmail/mail.js.map +1 -0
- package/build/services/gmail/mime.d.ts +45 -4
- package/build/services/gmail/mime.js +138 -4
- package/build/services/gmail/mime.js.map +1 -1
- package/build/services/gmail/patch.js +69 -83
- package/build/services/gmail/patch.js.map +1 -1
- package/build/services/meet/patch.js +24 -31
- package/build/services/meet/patch.js.map +1 -1
- package/build/services/sheets/patch.js +30 -35
- package/build/services/sheets/patch.js.map +1 -1
- package/build/services/tasks/patch.d.ts +18 -0
- package/build/services/tasks/patch.js +37 -0
- package/build/services/tasks/patch.js.map +1 -0
- package/build/version.d.ts +1 -1
- package/build/version.js +1 -1
- package/package.json +11 -6
- package/build/executor/errors.d.ts +0 -15
- package/build/executor/errors.js +0 -37
- package/build/executor/errors.js.map +0 -1
- package/build/executor/gws.d.ts +0 -26
- package/build/executor/gws.js +0 -197
- package/build/executor/gws.js.map +0 -1
- package/build/server/handlers/calendar.d.ts +0 -2
- package/build/server/handlers/calendar.js +0 -97
- package/build/server/handlers/calendar.js.map +0 -1
- package/build/server/handlers/drive.d.ts +0 -2
- package/build/server/handlers/drive.js +0 -58
- package/build/server/handlers/drive.js.map +0 -1
- package/build/server/handlers/email.d.ts +0 -2
- package/build/server/handlers/email.js +0 -119
- package/build/server/handlers/email.js.map +0 -1
|
@@ -1,4 +1 @@
|
|
|
1
|
-
export { execute, gwsVersion } from './gws.js';
|
|
2
|
-
export type { GwsResult, GwsOptions } from './gws.js';
|
|
3
|
-
export { GwsError, GwsExitCode, parseGwsError } from './errors.js';
|
|
4
1
|
export { configDir, dataDir, credentialsDir, credentialPath, accountsFilePath, emailToSlug } from './paths.js';
|
package/build/executor/index.js
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
export { GwsError, GwsExitCode, parseGwsError } from './errors.js';
|
|
1
|
+
// Local filesystem concerns: paths, and the workspace fence.
|
|
3
2
|
export { configDir, dataDir, credentialsDir, credentialPath, accountsFilePath, emailToSlug } from './paths.js';
|
|
4
3
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/executor/index.ts"],"names":[],"mappings":"AAAA,6DAA6D;AAC7D,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC"}
|
|
@@ -66,18 +66,44 @@ function formatDefaultDetail(data) {
|
|
|
66
66
|
refs: { id, ...extractScalarRefs(obj) },
|
|
67
67
|
};
|
|
68
68
|
}
|
|
69
|
-
/**
|
|
69
|
+
/**
|
|
70
|
+
* Generic action formatter — confirm, and say WHAT was acted on.
|
|
71
|
+
*
|
|
72
|
+
* Google does not agree with itself about what an identifier is called: Tasks returns
|
|
73
|
+
* `id`, Docs returns `documentId`, Sheets returns `spreadsheetId`. This used to print
|
|
74
|
+
* only a key named exactly `id`, so creating a document produced the entire response
|
|
75
|
+
* "Operation completed." — no id, no title, nothing an agent could act on. The id was
|
|
76
|
+
* in `refs` (so `$0.documentId` chaining worked), but anything reading the text was
|
|
77
|
+
* told only that *something* had happened.
|
|
78
|
+
*
|
|
79
|
+
* So name the thing: whichever identifier came back, plus whatever the resource calls
|
|
80
|
+
* itself. A confirmation you cannot act on is barely a confirmation.
|
|
81
|
+
*/
|
|
82
|
+
const ID_KEYS = ['id', 'documentId', 'spreadsheetId', 'fileId', 'eventId', 'threadId'];
|
|
83
|
+
const NAME_KEYS = ['title', 'name', 'summary'];
|
|
70
84
|
function formatDefaultAction(data) {
|
|
71
85
|
const obj = (data ?? {});
|
|
72
|
-
const
|
|
86
|
+
const idKey = ID_KEYS.find((k) => obj[k] !== undefined && obj[k] !== null);
|
|
87
|
+
const id = idKey ? String(obj[idKey]) : 'unknown';
|
|
88
|
+
const nameKey = NAME_KEYS.find((k) => typeof obj[k] === 'string' && obj[k] !== '');
|
|
73
89
|
const parts = ['Operation completed.'];
|
|
74
|
-
if (
|
|
75
|
-
parts.push(`\n
|
|
90
|
+
if (nameKey)
|
|
91
|
+
parts.push(`\n\n**${titleCase(nameKey)}:** ${String(obj[nameKey])}`);
|
|
92
|
+
if (idKey)
|
|
93
|
+
parts.push(`\n**${titleCase(idKey)}:** ${id}`);
|
|
76
94
|
return {
|
|
77
95
|
text: parts.join(''),
|
|
96
|
+
// `id` stays populated whatever Google called the field, so next-steps and
|
|
97
|
+
// queue_operations references keep resolving.
|
|
78
98
|
refs: { id, ...extractScalarRefs(obj) },
|
|
79
99
|
};
|
|
80
100
|
}
|
|
101
|
+
/** documentId -> "Document ID"; title -> "Title" */
|
|
102
|
+
function titleCase(key) {
|
|
103
|
+
return key
|
|
104
|
+
.replace(/Id$/, ' ID')
|
|
105
|
+
.replace(/^./, (c) => c.toUpperCase());
|
|
106
|
+
}
|
|
81
107
|
/** Find the first array in a response object (items, files, messages, etc). */
|
|
82
108
|
function findArray(obj) {
|
|
83
109
|
if (Array.isArray(obj))
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"defaults.js","sourceRoot":"","sources":["../../src/factory/defaults.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,0EAA0E;AAC1E,MAAM,UAAU,aAAa,CAAC,IAAa,EAAE,KAAmB;IAC9D,QAAQ,KAAK,CAAC,IAAI,EAAE,CAAC;QACnB,KAAK,MAAM;YACT,OAAO,iBAAiB,CAAC,IAAI,CAAC,CAAC;QACjC,KAAK,QAAQ;YACX,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACnC,KAAK,QAAQ;YACX,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;QACnC;YACE,OAAO,mBAAmB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;AACH,CAAC;AAED,2EAA2E;AAC3E,SAAS,iBAAiB,CAAC,IAAa;IACtC,MAAM,GAAG,GAAG,IAA+B,CAAC;IAC5C,+BAA+B;IAC/B,MAAM,KAAK,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;IAE7B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvB,OAAO,EAAE,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC;IAC3D,CAAC;IAED,MAAM,KAAK,GAAG,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,EAAE;QAC7B,MAAM,GAAG,GAAG,IAA+B,CAAC;QAC5C,MAAM,EAAE,GAAG,MAAM,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAChC,MAAM,KAAK,GAAG,CAAC,EAAE,CAAC,CAAC;QACnB,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AC,GAAG,CAAC;YAAE,OAAO,GAAG,CAAC;IACrC,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,kDAAkD;AAClD,SAAS,iBAAiB,CAAC,GAA4B;IACrD,MAAM,IAAI,GAA4B,EAAE,CAAC;IACzC,KAAK,MAAM,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC;QAC7C,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,QAAQ,IAAI,OAAO,GAAG,KAAK,SAAS,EAAE,CAAC;YACnF,IAAI,CAAC,GAAG,CAAC,GAAG,GAAG,CAAC;QAClB,CAAC;IACH,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
*
|
|
4
4
|
* For each service in the manifest, generates:
|
|
5
5
|
* 1. A JSON Schema tool definition (operation enum, typed params)
|
|
6
|
-
* 2. A handler function (maps operations to
|
|
6
|
+
* 2. A handler function (maps operations to Google API calls, applies formatting)
|
|
7
7
|
*
|
|
8
8
|
* Patches are optional per-service hooks that override default behavior.
|
|
9
9
|
*/
|
|
10
|
-
import type { Manifest, ServiceDef, ServicePatch, GeneratedTool, GeneratedToolSchema, GeneratedHandler } from './types.js';
|
|
10
|
+
import type { Manifest, ServiceDef, OperationDef, ServicePatch, GeneratedTool, GeneratedToolSchema, GeneratedHandler } from './types.js';
|
|
11
11
|
/**
|
|
12
12
|
* Load the manifest from `src/factory/manifest/` — one YAML file per service,
|
|
13
13
|
* each file's root being that service's definition; the filename (minus
|
|
@@ -27,3 +27,11 @@ export declare function generateTools(manifest: Manifest, patches?: Record<strin
|
|
|
27
27
|
export declare function generateSchema(service: ServiceDef): GeneratedToolSchema;
|
|
28
28
|
/** Generate a handler function for a service. */
|
|
29
29
|
export declare function generateHandler(service: ServiceDef, patch?: ServicePatch): GeneratedHandler;
|
|
30
|
+
/**
|
|
31
|
+
* Build the params a resource operation sends to Google.
|
|
32
|
+
*
|
|
33
|
+
* This is the manifest's mapping — declared params, `maps_to` renames, defaults,
|
|
34
|
+
* clamps. A resource operation never becomes a command line: the output here is
|
|
35
|
+
* the request params, handed straight to the client. See ADR-103.
|
|
36
|
+
*/
|
|
37
|
+
export declare function buildResourceParams(opDef: OperationDef, params: Record<string, unknown>): Record<string, unknown>;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* For each service in the manifest, generates:
|
|
5
5
|
* 1. A JSON Schema tool definition (operation enum, typed params)
|
|
6
|
-
* 2. A handler function (maps operations to
|
|
6
|
+
* 2. A handler function (maps operations to Google API calls, applies formatting)
|
|
7
7
|
*
|
|
8
8
|
* Patches are optional per-service hooks that override default behavior.
|
|
9
9
|
*/
|
|
@@ -11,7 +11,7 @@ import { readFileSync, readdirSync } from 'node:fs';
|
|
|
11
11
|
import { basename, dirname, resolve } from 'node:path';
|
|
12
12
|
import { fileURLToPath } from 'node:url';
|
|
13
13
|
import { parse as parseYaml } from '../factory/yaml.js';
|
|
14
|
-
import {
|
|
14
|
+
import { call as googleCall } from '../google/client.js';
|
|
15
15
|
import { requireEmail, clamp } from '../server/handlers/validate.js';
|
|
16
16
|
import { formatDefault } from './defaults.js';
|
|
17
17
|
import { nextSteps } from '../server/formatting/next-steps.js';
|
|
@@ -144,18 +144,18 @@ export function generateHandler(service, patch) {
|
|
|
144
144
|
manage_calendar: 'calendar',
|
|
145
145
|
manage_drive: 'drive',
|
|
146
146
|
};
|
|
147
|
-
const domain = domainMap[service.tool_name] ?? service.
|
|
147
|
+
const domain = domainMap[service.tool_name] ?? service.google_service;
|
|
148
148
|
return async (params) => {
|
|
149
149
|
const operation = params.operation;
|
|
150
150
|
const opDef = service.operations[operation];
|
|
151
151
|
if (!opDef) {
|
|
152
|
-
throw new Error(`Unknown ${service.
|
|
152
|
+
throw new Error(`Unknown ${service.google_service} operation: ${operation}`);
|
|
153
153
|
}
|
|
154
154
|
const account = service.requires_email ? requireEmail(params) : '';
|
|
155
155
|
const ctx = { operation, params, account };
|
|
156
156
|
// Safety policies — run before anything else, including custom handlers.
|
|
157
|
-
// A blocked operation never reaches the handler or
|
|
158
|
-
const policyResult = evaluatePolicies([], ctx, service.
|
|
157
|
+
// A blocked operation never reaches the handler or Google.
|
|
158
|
+
const policyResult = evaluatePolicies([], ctx, service.google_service);
|
|
159
159
|
if (policyResult.action === 'block') {
|
|
160
160
|
return {
|
|
161
161
|
text: `**Blocked by safety policy:** ${policyResult.reason}`,
|
|
@@ -183,18 +183,40 @@ export function generateHandler(service, patch) {
|
|
|
183
183
|
text: response.text + framingFooter(),
|
|
184
184
|
};
|
|
185
185
|
}
|
|
186
|
-
//
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
if (
|
|
192
|
-
|
|
186
|
+
// THE SEAM (ADR-103). Every operation goes to the Google API client we own, driven
|
|
187
|
+
// by the generated descriptor. There is no second path, and nothing shells out. An
|
|
188
|
+
// operation names a Google method, or a custom handler composes several, or it does
|
|
189
|
+
// not exist.
|
|
190
|
+
let data;
|
|
191
|
+
if (opDef.resource) {
|
|
192
|
+
let callParams = buildResourceParams(opDef, params);
|
|
193
|
+
// beforeExecute takes PARAMS. Hooks mutate the param object directly; there is
|
|
194
|
+
// no command line to do surgery on.
|
|
195
|
+
if (patch?.beforeExecute?.[operation]) {
|
|
196
|
+
callParams = await patch.beforeExecute[operation](callParams, ctx);
|
|
197
|
+
}
|
|
198
|
+
// The one place a cast is honest. Here the service and the resource path come
|
|
199
|
+
// from the MANIFEST — YAML, read at runtime — so no compile-time type can
|
|
200
|
+
// check them. That is fine, because this path has its own guard at a
|
|
201
|
+
// different stage:
|
|
202
|
+
//
|
|
203
|
+
// hand-written call sites -> COMPILE time (ServiceMethods[S]; see src/google/methods.ts)
|
|
204
|
+
// manifest-driven ops -> BUILD time (check-conformance: manifest ⊆ descriptor)
|
|
205
|
+
//
|
|
206
|
+
// Between them, every route to Google is checked before it can reach a user.
|
|
207
|
+
// The conformance check is probed and goes red on a bogus resource path, so
|
|
208
|
+
// a typo in the YAML fails the build rather than the call.
|
|
209
|
+
data = await googleCall(service.google_service, opDef.resource, callParams, { account });
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
// No resource, and no custom handler took it. There is nothing left to call.
|
|
213
|
+
// An operation is a Google method or a composition of them — there is no third
|
|
214
|
+
// kind. See ADR-103.
|
|
215
|
+
throw new Error(`${service.google_service}.${operation} declares no 'resource' and has no custom handler.`);
|
|
193
216
|
}
|
|
194
|
-
//
|
|
195
|
-
|
|
196
|
-
//
|
|
197
|
-
let data = result.data;
|
|
217
|
+
// afterExecute hook — takes DATA. This is the hook that turns raw Google into OUR
|
|
218
|
+
// shape (see gmailPatch.afterExecute.search, which walks payload.headers). It is
|
|
219
|
+
// the right place for interpretation.
|
|
198
220
|
if (patch?.afterExecute?.[operation]) {
|
|
199
221
|
data = await patch.afterExecute[operation](data, ctx);
|
|
200
222
|
}
|
|
@@ -218,72 +240,35 @@ export function generateHandler(service, patch) {
|
|
|
218
240
|
};
|
|
219
241
|
};
|
|
220
242
|
}
|
|
221
|
-
/**
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
}
|
|
231
|
-
throw new Error(`Operation must define either 'resource' or 'helper'`);
|
|
232
|
-
}
|
|
233
|
-
/** Build args for gws resource calls: `gws service resource method --params '{...}'` */
|
|
234
|
-
function buildResourceArgs(gwsService, opDef, params) {
|
|
235
|
-
const resourceParts = opDef.resource.split('.');
|
|
236
|
-
const args = [gwsService, ...resourceParts];
|
|
237
|
-
// Build the --params JSON object
|
|
238
|
-
const gwsParams = { ...opDef.defaults };
|
|
243
|
+
/**
|
|
244
|
+
* Build the params a resource operation sends to Google.
|
|
245
|
+
*
|
|
246
|
+
* This is the manifest's mapping — declared params, `maps_to` renames, defaults,
|
|
247
|
+
* clamps. A resource operation never becomes a command line: the output here is
|
|
248
|
+
* the request params, handed straight to the client. See ADR-103.
|
|
249
|
+
*/
|
|
250
|
+
export function buildResourceParams(opDef, params) {
|
|
251
|
+
const out = { ...opDef.defaults };
|
|
239
252
|
if (opDef.params) {
|
|
240
253
|
for (const [paramName, paramDef] of Object.entries(opDef.params)) {
|
|
241
254
|
if (paramDef.client_only)
|
|
242
|
-
continue; // formatter-only; never reaches
|
|
255
|
+
continue; // formatter-only; never reaches Google
|
|
243
256
|
const value = params[paramName];
|
|
244
257
|
const targetKey = paramDef.maps_to ?? paramName;
|
|
245
258
|
if (value !== undefined && value !== null) {
|
|
246
|
-
|
|
259
|
+
out[targetKey] = paramDef.max
|
|
247
260
|
? clamp(value, paramDef.default ?? 10, paramDef.max)
|
|
248
261
|
: value;
|
|
249
262
|
}
|
|
250
263
|
else if (paramDef.default !== undefined) {
|
|
251
|
-
|
|
264
|
+
out[targetKey] = paramDef.default;
|
|
252
265
|
}
|
|
253
266
|
}
|
|
254
267
|
}
|
|
255
|
-
|
|
256
|
-
for (const [key, val] of Object.entries(gwsParams)) {
|
|
268
|
+
for (const [key, val] of Object.entries(out)) {
|
|
257
269
|
if (val === undefined)
|
|
258
|
-
delete
|
|
259
|
-
}
|
|
260
|
-
if (Object.keys(gwsParams).length > 0) {
|
|
261
|
-
args.push('--params', JSON.stringify(gwsParams));
|
|
262
|
-
}
|
|
263
|
-
return args;
|
|
264
|
-
}
|
|
265
|
-
/** Build args for gws helper calls: `gws service +helper --flag value ...` */
|
|
266
|
-
function buildHelperArgs(gwsService, opDef, params) {
|
|
267
|
-
const args = [gwsService, opDef.helper];
|
|
268
|
-
// Some helpers take a positional arg (e.g. +reply messageId)
|
|
269
|
-
// Check for required params that aren't in cli_args — those are positional
|
|
270
|
-
if (opDef.params) {
|
|
271
|
-
for (const [paramName, paramDef] of Object.entries(opDef.params)) {
|
|
272
|
-
if (paramDef.client_only)
|
|
273
|
-
continue; // formatter-only; never reaches gws
|
|
274
|
-
const value = params[paramName];
|
|
275
|
-
if (value === undefined || value === null)
|
|
276
|
-
continue;
|
|
277
|
-
if (opDef.cli_args?.[paramName]) {
|
|
278
|
-
// Flag-style arg
|
|
279
|
-
args.push(opDef.cli_args[paramName], String(value));
|
|
280
|
-
}
|
|
281
|
-
else if (paramDef.required) {
|
|
282
|
-
// Positional arg
|
|
283
|
-
args.push(String(value));
|
|
284
|
-
}
|
|
285
|
-
}
|
|
270
|
+
delete out[key];
|
|
286
271
|
}
|
|
287
|
-
return
|
|
272
|
+
return out;
|
|
288
273
|
}
|
|
289
274
|
//# sourceMappingURL=generator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/factory/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generator.js","sourceRoot":"","sources":["../../src/factory/generator.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACpD,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACvD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAE,IAAI,IAAI,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EAAE,YAAY,EAAE,KAAK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AAI,GAAG,KAAK,SAAS;YAAE,OAAO,GAAG,CAAC,GAAG,CAAC,CAAC;IACzC,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
|
|
@@ -7,6 +7,7 @@ the `Manifest`.
|
|
|
7
7
|
|
|
8
8
|
## Notes
|
|
9
9
|
|
|
10
|
-
- People (contacts)
|
|
11
|
-
|
|
12
|
-
- Meet
|
|
10
|
+
- People (contacts) is excluded: the OAuth flow declares no contacts scope
|
|
11
|
+
(see `SERVICE_SCOPES` in `../../accounts/oauth.ts`).
|
|
12
|
+
- Meet is supported — authorize it by including `meet` in the services list
|
|
13
|
+
(`manage_accounts`, operation `scopes`).
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_calendar
|
|
2
2
|
description: "List events, view agenda, check availability, or manage calendar events."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: calendar
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
# --- Event viewing ---
|
|
@@ -37,7 +37,6 @@ operations:
|
|
|
37
37
|
agenda:
|
|
38
38
|
type: list
|
|
39
39
|
description: "today's schedule at a glance (all calendars). Returns calendarId per event for follow-up get calls."
|
|
40
|
-
helper: "+agenda"
|
|
41
40
|
params:
|
|
42
41
|
calendarId:
|
|
43
42
|
type: string
|
|
@@ -72,7 +71,6 @@ operations:
|
|
|
72
71
|
create:
|
|
73
72
|
type: action
|
|
74
73
|
description: "create a new calendar event"
|
|
75
|
-
helper: "+insert"
|
|
76
74
|
params:
|
|
77
75
|
calendarId:
|
|
78
76
|
type: string
|
|
@@ -101,14 +99,6 @@ operations:
|
|
|
101
99
|
meet:
|
|
102
100
|
type: boolean
|
|
103
101
|
description: "Add a Google Meet video conference link to the event"
|
|
104
|
-
cli_args:
|
|
105
|
-
calendarId: "--calendar"
|
|
106
|
-
summary: "--summary"
|
|
107
|
-
start: "--start"
|
|
108
|
-
end: "--end"
|
|
109
|
-
description: "--description"
|
|
110
|
-
location: "--location"
|
|
111
|
-
attendees: "--attendee"
|
|
112
102
|
|
|
113
103
|
quickAdd:
|
|
114
104
|
type: action
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_docs
|
|
2
2
|
description: "Read, write, insert, and find-replace text in Google Docs documents."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: docs
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
get:
|
|
@@ -14,15 +14,27 @@ operations:
|
|
|
14
14
|
description: "Document ID"
|
|
15
15
|
required: true
|
|
16
16
|
|
|
17
|
+
# `title` rides in the BODY — documents.create declares no parameters at all
|
|
18
|
+
# (Discovery: `"parameters": {}`), so everything goes into the Document resource.
|
|
19
|
+
# Without this the tool could only ever produce documents called "Untitled document",
|
|
20
|
+
# and a caller passing a title got no error — the argument was simply not in the
|
|
21
|
+
# schema, so it was dropped in silence. manage_sheets.create has always taken one.
|
|
17
22
|
create:
|
|
18
23
|
type: action
|
|
19
|
-
description: "create a new
|
|
24
|
+
description: "create a new document"
|
|
20
25
|
resource: documents.create
|
|
26
|
+
params:
|
|
27
|
+
title:
|
|
28
|
+
type: string
|
|
29
|
+
description: "Document title (default: 'Untitled document')"
|
|
21
30
|
|
|
31
|
+
# One documents.batchUpdate with a single insertText at endOfSegmentLocation —
|
|
32
|
+
# append to end of body. It needs a request body, so it is a custom handler
|
|
33
|
+
# rather than a bare resource op (docsPatch.write).
|
|
22
34
|
write:
|
|
23
35
|
type: action
|
|
24
36
|
description: "append text to the end of a document"
|
|
25
|
-
|
|
37
|
+
resource: documents.batchUpdate
|
|
26
38
|
params:
|
|
27
39
|
documentId:
|
|
28
40
|
type: string
|
|
@@ -32,9 +44,6 @@ operations:
|
|
|
32
44
|
type: string
|
|
33
45
|
description: "Text to append (plain text)"
|
|
34
46
|
required: true
|
|
35
|
-
cli_args:
|
|
36
|
-
documentId: "--document"
|
|
37
|
-
text: "--text"
|
|
38
47
|
|
|
39
48
|
insertText:
|
|
40
49
|
type: action
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_drive
|
|
2
2
|
description: "Search, upload, download, share, comment on, or manage files in Google Drive."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: drive
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
# --- File discovery ---
|
|
@@ -44,7 +44,6 @@ operations:
|
|
|
44
44
|
upload:
|
|
45
45
|
type: action
|
|
46
46
|
description: "upload a local file to Drive"
|
|
47
|
-
helper: "+upload"
|
|
48
47
|
params:
|
|
49
48
|
filePath:
|
|
50
49
|
type: string
|
|
@@ -56,9 +55,6 @@ operations:
|
|
|
56
55
|
parentFolderId:
|
|
57
56
|
type: string
|
|
58
57
|
description: "Destination folder ID"
|
|
59
|
-
cli_args:
|
|
60
|
-
name: "--name"
|
|
61
|
-
parentFolderId: "--parent"
|
|
62
58
|
|
|
63
59
|
viewImage:
|
|
64
60
|
type: detail
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_email
|
|
2
2
|
description: "Search, read, send, forward, or manage emails in a Google Workspace account. Supports Gmail search syntax."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: gmail
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
# --- Core message operations ---
|
|
@@ -49,7 +49,6 @@ operations:
|
|
|
49
49
|
send:
|
|
50
50
|
type: action
|
|
51
51
|
description: "compose and send a new email (creates draft when attachments present, 35MB attachment limit via upload endpoint)"
|
|
52
|
-
helper: "+send"
|
|
53
52
|
params:
|
|
54
53
|
to:
|
|
55
54
|
type: string
|
|
@@ -81,18 +80,10 @@ operations:
|
|
|
81
80
|
draft:
|
|
82
81
|
type: boolean
|
|
83
82
|
description: "Save as draft instead of sending (default: false, forced true when attachments present)"
|
|
84
|
-
cli_args:
|
|
85
|
-
to: "--to"
|
|
86
|
-
subject: "--subject"
|
|
87
|
-
body: "--body"
|
|
88
|
-
from: "--from"
|
|
89
|
-
cc: "--cc"
|
|
90
|
-
bcc: "--bcc"
|
|
91
83
|
|
|
92
84
|
reply:
|
|
93
85
|
type: action
|
|
94
86
|
description: "reply to a message (thread-aware, creates draft when attachments present)"
|
|
95
|
-
helper: "+reply"
|
|
96
87
|
params:
|
|
97
88
|
messageId:
|
|
98
89
|
type: string
|
|
@@ -111,14 +102,10 @@ operations:
|
|
|
111
102
|
draft:
|
|
112
103
|
type: boolean
|
|
113
104
|
description: "Save as draft instead of sending (default: false, forced true when attachments present)"
|
|
114
|
-
cli_args:
|
|
115
|
-
messageId: "--message-id"
|
|
116
|
-
body: "--body"
|
|
117
105
|
|
|
118
106
|
replyAll:
|
|
119
107
|
type: action
|
|
120
108
|
description: "reply-all to a message (thread-aware, includes all recipients, creates draft when attachments present)"
|
|
121
|
-
helper: "+reply-all"
|
|
122
109
|
params:
|
|
123
110
|
messageId:
|
|
124
111
|
type: string
|
|
@@ -140,15 +127,10 @@ operations:
|
|
|
140
127
|
draft:
|
|
141
128
|
type: boolean
|
|
142
129
|
description: "Save as draft instead of sending (default: false, forced true when attachments present)"
|
|
143
|
-
cli_args:
|
|
144
|
-
messageId: "--message-id"
|
|
145
|
-
body: "--body"
|
|
146
|
-
cc: "--cc"
|
|
147
130
|
|
|
148
131
|
forward:
|
|
149
132
|
type: action
|
|
150
133
|
description: "forward a message to new recipients (includes original attachments by default)"
|
|
151
|
-
helper: "+forward"
|
|
152
134
|
params:
|
|
153
135
|
messageId:
|
|
154
136
|
type: string
|
|
@@ -161,17 +143,20 @@ operations:
|
|
|
161
143
|
body:
|
|
162
144
|
type: string
|
|
163
145
|
description: "Optional note to prepend above forwarded message"
|
|
164
|
-
cli_args:
|
|
165
|
-
messageId: "--message-id"
|
|
166
|
-
to: "--to"
|
|
167
|
-
body: "--body"
|
|
168
146
|
|
|
169
147
|
# --- Inbox management ---
|
|
170
148
|
|
|
149
|
+
# triage is just a filtered list: messages.list with an unread query. The
|
|
150
|
+
# hydration walk (messages.get per id) is already done by gmailPatch.afterExecute,
|
|
151
|
+
# which also carries threadId and snippet.
|
|
171
152
|
triage:
|
|
172
153
|
type: list
|
|
173
154
|
description: "unread inbox summary (sender, subject, date)"
|
|
174
|
-
|
|
155
|
+
resource: users.messages.list
|
|
156
|
+
defaults:
|
|
157
|
+
userId: me
|
|
158
|
+
q: "is:unread in:inbox"
|
|
159
|
+
maxResults: 20
|
|
175
160
|
|
|
176
161
|
trash:
|
|
177
162
|
type: action
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_meet
|
|
2
2
|
description: "Browse past Google Meet conferences, participants, transcripts, recordings, and AI-generated smart notes. Requires Workspace Business Standard+ for transcripts/recordings."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: meet
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
# --- Conference records ---
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
tool_name: manage_sheets
|
|
2
2
|
description: "Read, write, and manage Google Sheets spreadsheets."
|
|
3
3
|
requires_email: true
|
|
4
|
-
|
|
4
|
+
google_service: sheets
|
|
5
5
|
operations:
|
|
6
6
|
|
|
7
7
|
get:
|
|
@@ -26,7 +26,7 @@ operations:
|
|
|
26
26
|
read:
|
|
27
27
|
type: detail
|
|
28
28
|
description: "read cell values from a range; rendered rows are prefixed with their sheet row number (e.g. 'R3: …') since blank rows are otherwise invisible"
|
|
29
|
-
|
|
29
|
+
resource: spreadsheets.values.get
|
|
30
30
|
params:
|
|
31
31
|
spreadsheetId:
|
|
32
32
|
type: string
|
|
@@ -36,9 +36,6 @@ operations:
|
|
|
36
36
|
type: string
|
|
37
37
|
description: "Range to read (e.g. 'Sheet1!A1:D10' or just 'Sheet1')"
|
|
38
38
|
required: true
|
|
39
|
-
cli_args:
|
|
40
|
-
spreadsheetId: "--spreadsheet"
|
|
41
|
-
range: "--range"
|
|
42
39
|
|
|
43
40
|
append:
|
|
44
41
|
type: action
|