@mindstone/mcp-server-google-workspace 0.2.0 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -8
- package/dist/modules/chat/index.d.ts +12 -0
- package/dist/modules/chat/index.js +18 -0
- package/dist/modules/chat/scopes.d.ts +14 -0
- package/dist/modules/chat/scopes.js +32 -0
- package/dist/modules/chat/types.d.ts +88 -0
- package/dist/modules/chat/types.js +14 -0
- package/dist/modules/comments/service.js +21 -1
- package/dist/modules/contacts/scopes.d.ts +1 -0
- package/dist/modules/contacts/scopes.js +2 -2
- package/dist/modules/contacts/types.d.ts +34 -0
- package/dist/modules/docs/service.js +29 -1
- package/dist/modules/drive/activity-service.d.ts +45 -0
- package/dist/modules/drive/activity-service.js +114 -0
- package/dist/modules/drive/index.d.ts +4 -0
- package/dist/modules/drive/index.js +12 -0
- package/dist/modules/drive/scopes.d.ts +1 -0
- package/dist/modules/drive/scopes.js +3 -0
- package/dist/modules/forms/service.js +13 -1
- package/dist/modules/gmail/services/base.d.ts +5 -1
- package/dist/modules/gmail/services/base.js +8 -0
- package/dist/modules/gmail/services/settings.d.ts +14 -1
- package/dist/modules/gmail/services/settings.js +94 -0
- package/dist/modules/gmail/types.d.ts +36 -0
- package/dist/modules/meet/index.d.ts +12 -0
- package/dist/modules/meet/index.js +18 -0
- package/dist/modules/meet/scopes.d.ts +9 -0
- package/dist/modules/meet/scopes.js +25 -0
- package/dist/modules/meet/types.d.ts +97 -0
- package/dist/modules/meet/types.js +14 -0
- package/dist/modules/sheets/service.js +49 -0
- package/dist/modules/slides/service.js +25 -1
- package/dist/modules/tasks/service.js +25 -1
- package/dist/services/base/BaseGoogleService.d.ts +9 -1
- package/dist/services/base/BaseGoogleService.js +26 -1
- package/dist/services/chat/index.d.ts +34 -0
- package/dist/services/chat/index.js +120 -0
- package/dist/services/contacts/index.d.ts +19 -1
- package/dist/services/contacts/index.js +124 -0
- package/dist/services/meet/index.d.ts +35 -0
- package/dist/services/meet/index.js +116 -0
- package/dist/tools/chat-handlers.d.ts +14 -0
- package/dist/tools/chat-handlers.js +126 -0
- package/dist/tools/contacts-handlers.d.ts +31 -0
- package/dist/tools/contacts-handlers.js +88 -0
- package/dist/tools/definitions/chat.d.ts +3 -0
- package/dist/tools/definitions/chat.js +137 -0
- package/dist/tools/definitions/contacts.js +82 -0
- package/dist/tools/definitions/destructive-overrides.json +11 -0
- package/dist/tools/definitions/drive.js +48 -0
- package/dist/tools/definitions/gmail.js +94 -0
- package/dist/tools/definitions/index.d.ts +2 -0
- package/dist/tools/definitions/index.js +6 -0
- package/dist/tools/definitions/meet.d.ts +3 -0
- package/dist/tools/definitions/meet.js +149 -0
- package/dist/tools/definitions/open-world-overrides.json +11 -0
- package/dist/tools/drive-handlers.d.ts +17 -0
- package/dist/tools/drive-handlers.js +49 -1
- package/dist/tools/gmail-handlers.d.ts +24 -0
- package/dist/tools/gmail-handlers.js +129 -11
- package/dist/tools/meet-handlers.d.ts +42 -0
- package/dist/tools/meet-handlers.js +144 -0
- package/dist/tools/server.js +53 -3
- package/dist/utils/apiError.js +5 -2
- package/dist/utils/scope-hierarchy.js +10 -0
- package/dist/utils/service-initializer.js +9 -0
- package/dist/utils/untrusted-content.d.ts +37 -1
- package/dist/utils/untrusted-content.js +61 -6
- package/package.json +1 -1
|
@@ -1,10 +1,59 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
/**
|
|
2
|
+
* AGENTS.md security invariant #6 — content fetched from an external system
|
|
3
|
+
* MUST be wrapped in an `<untrusted-content source="…">…</untrusted-content>`
|
|
4
|
+
* envelope (with close-tag breakout escaping) before it is returned to the
|
|
5
|
+
* LLM, so the model treats third-party / attacker-controllable text as DATA,
|
|
6
|
+
* not as instructions.
|
|
7
|
+
*
|
|
8
|
+
* This is the canonical implementation a new connector ships with. It is a
|
|
9
|
+
* VENDORED copy of the shared reference in `test-harness/src/untrusted-content.ts`
|
|
10
|
+
* — connectors cannot `import` the test-harness at runtime (it is a
|
|
11
|
+
* test/dev-only `file:` dependency that is never published into a connector's
|
|
12
|
+
* `dist/`), so the helper lives in the connector's own runtime source. Keep
|
|
13
|
+
* this byte-for-byte in sync with the shared reference; do NOT weaken the
|
|
14
|
+
* escaping back to a simple `replaceAll` (that family misses whitespace / case
|
|
15
|
+
* close-tag variants like `</untrusted-content >` / `</UNTRUSTED-CONTENT>`).
|
|
16
|
+
*
|
|
17
|
+
* `scripts/check-untrusted-coverage.mjs` greps for a reference to
|
|
18
|
+
* `untrusted-content` in any connector that talks to an external system; this
|
|
19
|
+
* file (and the call sites that import from it) is what satisfies that gate.
|
|
20
|
+
*/
|
|
21
|
+
const UNTRUSTED_CLOSE_TAG_VARIANT = /<\/untrusted-content\s*>/gi;
|
|
22
|
+
const ESCAPED_UNTRUSTED_CLOSE_TAG = '<\\/untrusted-content>';
|
|
23
|
+
function escapeAttr(s) {
|
|
24
|
+
return s.replaceAll('&', '&').replaceAll('"', '"').replaceAll('<', '<').replaceAll('>', '>');
|
|
4
25
|
}
|
|
26
|
+
function escapeCloseTagSentinels(s) {
|
|
27
|
+
return s.replace(UNTRUSTED_CLOSE_TAG_VARIANT, ESCAPED_UNTRUSTED_CLOSE_TAG);
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Wrap a single untrusted string in an `<untrusted-content source="…">`
|
|
31
|
+
* envelope, escaping any embedded close-tag variant so the envelope cannot be
|
|
32
|
+
* broken out of. `undefined` passes through untouched. Idempotent for the same
|
|
33
|
+
* `source`.
|
|
34
|
+
*/
|
|
35
|
+
export function wrapUntrusted(text, source) {
|
|
36
|
+
if (text === undefined)
|
|
37
|
+
return undefined;
|
|
38
|
+
const open = `<untrusted-content source="${escapeAttr(source)}">`;
|
|
39
|
+
const close = '</untrusted-content>';
|
|
40
|
+
if (text.startsWith(open) && text.endsWith(close) && text.length >= open.length + close.length) {
|
|
41
|
+
const inner = text.slice(open.length, text.length - close.length);
|
|
42
|
+
if (!UNTRUSTED_CLOSE_TAG_VARIANT.test(inner)) {
|
|
43
|
+
UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0;
|
|
44
|
+
return text;
|
|
45
|
+
}
|
|
46
|
+
UNTRUSTED_CLOSE_TAG_VARIANT.lastIndex = 0;
|
|
47
|
+
}
|
|
48
|
+
return `${open}${escapeCloseTagSentinels(text)}${close}`;
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Recursively wrap every string value reachable inside `value`. Object keys are
|
|
52
|
+
* structural and NOT wrapped; non-string leaves pass through unchanged.
|
|
53
|
+
*/
|
|
5
54
|
export function wrapUntrustedJsonStrings(value, source) {
|
|
6
55
|
if (typeof value === 'string') {
|
|
7
|
-
return
|
|
56
|
+
return wrapUntrusted(value, source);
|
|
8
57
|
}
|
|
9
58
|
if (Array.isArray(value)) {
|
|
10
59
|
return value.map((item) => wrapUntrustedJsonStrings(item, source));
|
|
@@ -14,7 +63,13 @@ export function wrapUntrustedJsonStrings(value, source) {
|
|
|
14
63
|
}
|
|
15
64
|
return value;
|
|
16
65
|
}
|
|
17
|
-
|
|
18
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Connector-local alias for `wrapUntrusted` under the name the existing call
|
|
68
|
+
* sites were written against. `content` is required (never `undefined`), so
|
|
69
|
+
* the result is always a string.
|
|
70
|
+
*/
|
|
71
|
+
export function wrapUntrustedContent(content, source) {
|
|
72
|
+
// wrapUntrusted returns undefined only for undefined input.
|
|
73
|
+
return wrapUntrusted(content, source);
|
|
19
74
|
}
|
|
20
75
|
//# sourceMappingURL=untrusted-content.js.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mindstone/mcp-server-google-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.3.0",
|
|
4
4
|
"mcpName": "io.github.mindstone/mcp-server-google-workspace",
|
|
5
5
|
"description": "Google Workspace MCP server for Gmail, Calendar, Drive, Docs, Sheets, Slides, Contacts, Tasks, and Forms",
|
|
6
6
|
"license": "FSL-1.1-MIT",
|