@n24q02m/workspace 0.6.0 → 0.7.0-beta.1
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/NOTICE +9 -2
- package/README.md +101 -10
- package/bin/cli.mjs +78 -51
- package/build/src/auth/workspace-auth.test.js +3 -3
- package/build/src/auth/workspace-auth.test.js.map +1 -1
- package/build/src/cli/tools.d.ts +64 -0
- package/build/src/cli/tools.d.ts.map +1 -0
- package/build/src/cli/tools.integration.test.d.ts +2 -0
- package/build/src/cli/tools.integration.test.d.ts.map +1 -0
- package/build/src/cli/tools.integration.test.js +46 -0
- package/build/src/cli/tools.integration.test.js.map +1 -0
- package/build/src/cli/tools.js +411 -0
- package/build/src/cli/tools.js.map +1 -0
- package/build/src/cli/tools.test.d.ts +2 -0
- package/build/src/cli/tools.test.d.ts.map +1 -0
- package/build/src/cli/tools.test.js +365 -0
- package/build/src/cli/tools.test.js.map +1 -0
- package/build/src/constants.d.ts +2 -1
- package/build/src/constants.d.ts.map +1 -1
- package/build/src/constants.js +8 -5
- package/build/src/constants.js.map +1 -1
- package/build/src/data-dir-migration.d.ts +72 -0
- package/build/src/data-dir-migration.d.ts.map +1 -0
- package/build/src/data-dir-migration.js +181 -0
- package/build/src/data-dir-migration.js.map +1 -0
- package/build/src/data-dir-migration.test.d.ts +2 -0
- package/build/src/data-dir-migration.test.d.ts.map +1 -0
- package/build/src/data-dir-migration.test.js +148 -0
- package/build/src/data-dir-migration.test.js.map +1 -0
- package/build/src/data-dir.d.ts +59 -0
- package/build/src/data-dir.d.ts.map +1 -0
- package/build/src/data-dir.js +94 -0
- package/build/src/data-dir.js.map +1 -0
- package/build/src/data-dir.test.d.ts +2 -0
- package/build/src/data-dir.test.d.ts.map +1 -0
- package/build/src/data-dir.test.js +73 -0
- package/build/src/data-dir.test.js.map +1 -0
- package/build/src/docs/calendar.md +27 -0
- package/build/src/docs/chat.md +34 -0
- package/build/src/docs/config.md +17 -0
- package/build/src/docs/docs.md +1 -1
- package/build/src/docs/drive.md +29 -0
- package/build/src/docs/forms.md +19 -0
- package/build/src/docs/gmail.md +37 -0
- package/build/src/docs/overview.md +24 -0
- package/build/src/docs/people.md +23 -0
- package/build/src/docs/sheets.md +27 -0
- package/build/src/docs/slides.md +31 -0
- package/build/src/docs/tasks.md +18 -0
- package/build/src/main.d.ts +2 -0
- package/build/src/main.d.ts.map +1 -1
- package/build/src/main.js +25 -5
- package/build/src/main.js.map +1 -1
- package/build/src/main.test.js +42 -1
- package/build/src/main.test.js.map +1 -1
- package/build/src/tools/config.d.ts +10 -1
- package/build/src/tools/config.d.ts.map +1 -1
- package/build/src/tools/config.js +20 -1
- package/build/src/tools/config.js.map +1 -1
- package/build/src/tools/dispatch.d.ts +25 -0
- package/build/src/tools/dispatch.d.ts.map +1 -0
- package/build/src/tools/dispatch.js +119 -0
- package/build/src/tools/dispatch.js.map +1 -0
- package/build/src/tools/domains/bounds-e2e.test.d.ts +2 -0
- package/build/src/tools/domains/bounds-e2e.test.d.ts.map +1 -0
- package/build/src/tools/domains/bounds-e2e.test.js +166 -0
- package/build/src/tools/domains/bounds-e2e.test.js.map +1 -0
- package/build/src/tools/domains/bounds.d.ts +53 -0
- package/build/src/tools/domains/bounds.d.ts.map +1 -0
- package/build/src/tools/domains/bounds.js +72 -0
- package/build/src/tools/domains/bounds.js.map +1 -0
- package/build/src/tools/domains/calendar.d.ts.map +1 -1
- package/build/src/tools/domains/calendar.js +5 -1
- package/build/src/tools/domains/calendar.js.map +1 -1
- package/build/src/tools/domains/chat.d.ts.map +1 -1
- package/build/src/tools/domains/chat.js +3 -1
- package/build/src/tools/domains/chat.js.map +1 -1
- package/build/src/tools/domains/docs.d.ts.map +1 -1
- package/build/src/tools/domains/docs.js +2 -1
- package/build/src/tools/domains/docs.js.map +1 -1
- package/build/src/tools/domains/drive.d.ts.map +1 -1
- package/build/src/tools/domains/drive.js +5 -1
- package/build/src/tools/domains/drive.js.map +1 -1
- package/build/src/tools/domains/factory-bounds.test.d.ts +2 -0
- package/build/src/tools/domains/factory-bounds.test.d.ts.map +1 -0
- package/build/src/tools/domains/factory-bounds.test.js +169 -0
- package/build/src/tools/domains/factory-bounds.test.js.map +1 -0
- package/build/src/tools/domains/factory.d.ts +15 -0
- package/build/src/tools/domains/factory.d.ts.map +1 -1
- package/build/src/tools/domains/factory.js +18 -1
- package/build/src/tools/domains/factory.js.map +1 -1
- package/build/src/tools/domains/forms.d.ts.map +1 -1
- package/build/src/tools/domains/forms.js +5 -1
- package/build/src/tools/domains/forms.js.map +1 -1
- package/build/src/tools/domains/gmail.d.ts.map +1 -1
- package/build/src/tools/domains/gmail.js +5 -1
- package/build/src/tools/domains/gmail.js.map +1 -1
- package/build/src/tools/domains/index.d.ts.map +1 -1
- package/build/src/tools/domains/index.js +94 -12
- package/build/src/tools/domains/index.js.map +1 -1
- package/build/src/tools/domains/people.d.ts.map +1 -1
- package/build/src/tools/domains/people.js +2 -1
- package/build/src/tools/domains/people.js.map +1 -1
- package/build/src/tools/domains/slides.d.ts.map +1 -1
- package/build/src/tools/domains/slides.js +2 -1
- package/build/src/tools/domains/slides.js.map +1 -1
- package/build/src/tools/domains/tasks.d.ts.map +1 -1
- package/build/src/tools/domains/tasks.js +3 -1
- package/build/src/tools/domains/tasks.js.map +1 -1
- package/build/src/tools/helpers/bounds.d.ts +72 -0
- package/build/src/tools/helpers/bounds.d.ts.map +1 -0
- package/build/src/tools/helpers/bounds.js +234 -0
- package/build/src/tools/helpers/bounds.js.map +1 -0
- package/build/src/tools/helpers/bounds.test.d.ts +2 -0
- package/build/src/tools/helpers/bounds.test.d.ts.map +1 -0
- package/build/src/tools/helpers/bounds.test.js +239 -0
- package/build/src/tools/helpers/bounds.test.js.map +1 -0
- package/build/src/tools/registry.d.ts +28 -0
- package/build/src/tools/registry.d.ts.map +1 -1
- package/build/src/tools/registry.js +15 -120
- package/build/src/tools/registry.js.map +1 -1
- package/build/src/tools/registry.test.js +7 -1
- package/build/src/tools/registry.test.js.map +1 -1
- package/build/src/vendored/services/CalendarService.d.ts +2 -0
- package/build/src/vendored/services/CalendarService.d.ts.map +1 -1
- package/build/src/vendored/services/CalendarService.js +13 -2
- package/build/src/vendored/services/CalendarService.js.map +1 -1
- package/build/src/vendored/services/ChatService.d.ts +4 -1
- package/build/src/vendored/services/ChatService.d.ts.map +1 -1
- package/build/src/vendored/services/ChatService.js +11 -3
- package/build/src/vendored/services/ChatService.js.map +1 -1
- package/build/src/vendored/services/DocsService.d.ts.map +1 -1
- package/build/src/vendored/services/DocsService.js +6 -1
- package/build/src/vendored/services/DocsService.js.map +1 -1
- package/build/src/vendored/services/DocsService.test.js +2 -2
- package/build/src/vendored/services/DocsService.test.js.map +1 -1
- package/build/src/vendored/services/DriveService.d.ts +3 -1
- package/build/src/vendored/services/DriveService.d.ts.map +1 -1
- package/build/src/vendored/services/DriveService.js +10 -3
- package/build/src/vendored/services/DriveService.js.map +1 -1
- package/build/src/vendored/services/SheetsService.d.ts +6 -2
- package/build/src/vendored/services/SheetsService.d.ts.map +1 -1
- package/build/src/vendored/services/SheetsService.js +67 -6
- package/build/src/vendored/services/SheetsService.js.map +1 -1
- package/build/src/vendored/services/SheetsService.test.js +67 -0
- package/build/src/vendored/services/SheetsService.test.js.map +1 -1
- package/build/src/vendored/utils/textBounds.d.ts +40 -0
- package/build/src/vendored/utils/textBounds.d.ts.map +1 -0
- package/build/src/vendored/utils/textBounds.js +115 -0
- package/build/src/vendored/utils/textBounds.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { DriveService } from '../../vendored/services/DriveService.js';
|
|
2
|
+
import { DRIVE_BOUNDS } from './bounds.js';
|
|
2
3
|
import { makeDomainRun } from './factory.js';
|
|
3
4
|
export const DRIVE_ACTIONS = [
|
|
4
5
|
'findFolder',
|
|
@@ -10,5 +11,8 @@ export const DRIVE_ACTIONS = [
|
|
|
10
11
|
'moveFile',
|
|
11
12
|
'downloadFile'
|
|
12
13
|
];
|
|
13
|
-
export const drive = makeDomainRun(DriveService, DRIVE_ACTIONS, {
|
|
14
|
+
export const drive = makeDomainRun(DriveService, DRIVE_ACTIONS, {
|
|
15
|
+
pagination: { search: 'pageSize', getComments: 'pageSize' },
|
|
16
|
+
bounds: DRIVE_BOUNDS
|
|
17
|
+
});
|
|
14
18
|
//# sourceMappingURL=drive.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.js","sourceRoot":"","sources":["../../../../src/tools/domains/drive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,aAAa;IACb,UAAU;IACV,cAAc;CACN,CAAA;AACV,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"drive.js","sourceRoot":"","sources":["../../../../src/tools/domains/drive.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,YAAY;IACZ,cAAc;IACd,QAAQ;IACR,WAAW;IACX,YAAY;IACZ,aAAa;IACb,UAAU;IACV,cAAc;CACN,CAAA;AACV,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE;IAC9D,UAAU,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE;IAC3D,MAAM,EAAE,YAAY;CACrB,CAAC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-bounds.test.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/factory-bounds.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
import { describe, expect, it, vi } from 'vitest';
|
|
2
|
+
import { CALENDAR_BOUNDS, CHAT_BOUNDS, DOCS_BOUNDS, DRIVE_BOUNDS, FORMS_BOUNDS, GMAIL_BOUNDS, LIST_HINT, PAGE_HINT, PEOPLE_BOUNDS, SLIDES_BOUNDS, TASKS_BOUNDS, TEXT_HINT } from './bounds.js';
|
|
3
|
+
import { makeDomainRun } from './factory.js';
|
|
4
|
+
/**
|
|
5
|
+
* A service that echoes one canned payload from every action it is asked for,
|
|
6
|
+
* so a bound sees a payload of a known size whichever action name it is tested
|
|
7
|
+
* under. `methods` records the params each call received.
|
|
8
|
+
*/
|
|
9
|
+
function captureService(payload, action = 'capture') {
|
|
10
|
+
var _a;
|
|
11
|
+
const methods = {
|
|
12
|
+
call: vi.fn(async (_params) => ({
|
|
13
|
+
content: [{ type: 'text', text: typeof payload === 'string' ? payload : JSON.stringify(payload) }]
|
|
14
|
+
}))
|
|
15
|
+
};
|
|
16
|
+
class CaptureService {
|
|
17
|
+
constructor(auth) {
|
|
18
|
+
this[_a] = methods.call;
|
|
19
|
+
void auth;
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
_a = action;
|
|
23
|
+
return { CaptureService, methods };
|
|
24
|
+
}
|
|
25
|
+
function textOf(result) {
|
|
26
|
+
const item = result.content[0];
|
|
27
|
+
if (item.type !== 'text')
|
|
28
|
+
throw new Error('expected text result');
|
|
29
|
+
return item.text;
|
|
30
|
+
}
|
|
31
|
+
const BIG = { body: 'b'.repeat(30_000), nextPageToken: 'page-2' };
|
|
32
|
+
describe('domain factory response bounds', () => {
|
|
33
|
+
it('caps a bounded action at 20000 characters by default', async () => {
|
|
34
|
+
const { CaptureService, methods } = captureService(BIG);
|
|
35
|
+
const run = makeDomainRun(CaptureService, ['capture'], { bounds: { capture: { hint: TEXT_HINT } } });
|
|
36
|
+
const text = textOf(await run({ action: 'capture' }));
|
|
37
|
+
expect(text.length).toBeLessThanOrEqual(20_000);
|
|
38
|
+
expect(JSON.parse(text)._truncation.truncated).toBe(true);
|
|
39
|
+
expect(JSON.parse(text)._truncation.note).toContain('[Content truncated: showing');
|
|
40
|
+
expect(methods.call).toHaveBeenCalledOnce();
|
|
41
|
+
});
|
|
42
|
+
it('raises the cap with max_chars and removes it with full', async () => {
|
|
43
|
+
const { CaptureService } = captureService(BIG);
|
|
44
|
+
const run = makeDomainRun(CaptureService, ['capture'], { bounds: { capture: {} } });
|
|
45
|
+
const raised = JSON.parse(textOf(await run({ action: 'capture', max_chars: 100_000 })));
|
|
46
|
+
expect(raised._truncation).toBeUndefined();
|
|
47
|
+
expect(raised.body.length).toBe(30_000);
|
|
48
|
+
const full = JSON.parse(textOf(await run({ action: 'capture', full: true })));
|
|
49
|
+
expect(full).toEqual(BIG);
|
|
50
|
+
});
|
|
51
|
+
it('rejects a bad max_chars before calling the service', async () => {
|
|
52
|
+
const { CaptureService, methods } = captureService(BIG);
|
|
53
|
+
const run = makeDomainRun(CaptureService, ['capture'], { bounds: { capture: {} } });
|
|
54
|
+
await expect(run({ action: 'capture', max_chars: 2_000_000 })).rejects.toThrow(/max_chars must be an integer/);
|
|
55
|
+
expect(methods.call).not.toHaveBeenCalled();
|
|
56
|
+
});
|
|
57
|
+
it('never forwards the bound knobs to the service method', async () => {
|
|
58
|
+
const { CaptureService, methods } = captureService({ ok: true });
|
|
59
|
+
const run = makeDomainRun(CaptureService, ['capture'], { bounds: { capture: {} } });
|
|
60
|
+
await run({ action: 'capture', max_chars: 500, full: false, fileId: 'f1' });
|
|
61
|
+
expect(methods.call).toHaveBeenCalledWith({ fileId: 'f1' });
|
|
62
|
+
});
|
|
63
|
+
it('leaves an unbounded action on the same tool untouched, knob included', async () => {
|
|
64
|
+
const { CaptureService, methods } = captureService(BIG, 'other');
|
|
65
|
+
const run = makeDomainRun(CaptureService, ['capture', 'other'], { bounds: { capture: {} } });
|
|
66
|
+
const text = textOf(await run({ action: 'other', max_chars: 500 }));
|
|
67
|
+
expect(text).toBe(JSON.stringify(BIG));
|
|
68
|
+
// The tool advertises the knobs, so an unbounded action must still not pass
|
|
69
|
+
// them to a service that has no idea what they mean.
|
|
70
|
+
expect(methods.call).toHaveBeenCalledWith({});
|
|
71
|
+
});
|
|
72
|
+
it('has no bound at all when the tool declares none', async () => {
|
|
73
|
+
const { CaptureService } = captureService(BIG);
|
|
74
|
+
const run = makeDomainRun(CaptureService, ['capture']);
|
|
75
|
+
expect(textOf(await run({ action: 'capture', max_chars: 10 }))).toBe(JSON.stringify(BIG));
|
|
76
|
+
});
|
|
77
|
+
it('keeps a cursor in a truncated listing', async () => {
|
|
78
|
+
const page = {
|
|
79
|
+
events: Array.from({ length: 20 }, (_, index) => ({ id: `e${index}`, description: 'd'.repeat(2_000) })),
|
|
80
|
+
nextPageToken: 'event-page-3'
|
|
81
|
+
};
|
|
82
|
+
const { CaptureService } = captureService(page);
|
|
83
|
+
const run = makeDomainRun(CaptureService, ['capture'], {
|
|
84
|
+
bounds: { capture: CALENDAR_BOUNDS.listEvents }
|
|
85
|
+
});
|
|
86
|
+
const parsed = JSON.parse(textOf(await run({ action: 'capture' })));
|
|
87
|
+
expect(parsed._truncation.truncated).toBe(true);
|
|
88
|
+
expect(parsed.nextPageToken).toBe('event-page-3');
|
|
89
|
+
});
|
|
90
|
+
});
|
|
91
|
+
/**
|
|
92
|
+
* One row per real bounded action: the default cap, the marker, and the escape
|
|
93
|
+
* hatch are properties of the shipped policy, not of a hand-made fixture.
|
|
94
|
+
*/
|
|
95
|
+
const BOUNDED_ACTIONS = [
|
|
96
|
+
['docs', 'getSuggestions', DOCS_BOUNDS],
|
|
97
|
+
['slides', 'getText', SLIDES_BOUNDS],
|
|
98
|
+
['slides', 'getMetadata', SLIDES_BOUNDS],
|
|
99
|
+
['slides', 'getImages', SLIDES_BOUNDS],
|
|
100
|
+
['slides', 'getSpeakerNotes', SLIDES_BOUNDS],
|
|
101
|
+
['gmail', 'get', GMAIL_BOUNDS],
|
|
102
|
+
['gmail', 'search', GMAIL_BOUNDS],
|
|
103
|
+
['gmail', 'listLabels', GMAIL_BOUNDS],
|
|
104
|
+
['gmail', 'modify', GMAIL_BOUNDS],
|
|
105
|
+
['gmail', 'modifyThread', GMAIL_BOUNDS],
|
|
106
|
+
['drive', 'search', DRIVE_BOUNDS],
|
|
107
|
+
['drive', 'getComments', DRIVE_BOUNDS],
|
|
108
|
+
['drive', 'findFolder', DRIVE_BOUNDS],
|
|
109
|
+
['chat', 'listSpaces', CHAT_BOUNDS],
|
|
110
|
+
['chat', 'findSpaceByName', CHAT_BOUNDS],
|
|
111
|
+
['chat', 'getMessages', CHAT_BOUNDS],
|
|
112
|
+
['chat', 'listThreads', CHAT_BOUNDS],
|
|
113
|
+
['calendar', 'listCalendars', CALENDAR_BOUNDS],
|
|
114
|
+
['calendar', 'listEvents', CALENDAR_BOUNDS],
|
|
115
|
+
['calendar', 'getEvent', CALENDAR_BOUNDS],
|
|
116
|
+
['calendar', 'findFreeTime', CALENDAR_BOUNDS],
|
|
117
|
+
['tasks', 'listTaskLists', TASKS_BOUNDS],
|
|
118
|
+
['tasks', 'listTasks', TASKS_BOUNDS],
|
|
119
|
+
['people', 'getUserProfile', PEOPLE_BOUNDS],
|
|
120
|
+
['people', 'getMe', PEOPLE_BOUNDS],
|
|
121
|
+
['people', 'getUserRelations', PEOPLE_BOUNDS],
|
|
122
|
+
['forms', 'get', FORMS_BOUNDS],
|
|
123
|
+
['forms', 'listResponses', FORMS_BOUNDS],
|
|
124
|
+
['forms', 'getResponse', FORMS_BOUNDS]
|
|
125
|
+
];
|
|
126
|
+
describe('shipped bound policy', () => {
|
|
127
|
+
it.each(BOUNDED_ACTIONS)('%s.%s caps by default, marks truncation and honours full', async (_tool, action, bounds) => {
|
|
128
|
+
const items = bounds[action].items ?? 500;
|
|
129
|
+
const oversized = items === 500
|
|
130
|
+
? { body: 'b'.repeat(25_000) }
|
|
131
|
+
: { items: Array.from({ length: items + 5 }, (_, index) => ({ id: `i${index}` })) };
|
|
132
|
+
const { CaptureService } = captureService(oversized, action);
|
|
133
|
+
const run = makeDomainRun(CaptureService, [action], { bounds });
|
|
134
|
+
const bounded = JSON.parse(textOf(await run({ action })));
|
|
135
|
+
expect(textOf(await run({ action })).length).toBeLessThanOrEqual(20_000);
|
|
136
|
+
expect(bounded._truncation.truncated).toBe(true);
|
|
137
|
+
expect(bounded._truncation.note).toMatch(/^\[Content truncated: showing (\d+) of (\d+) characters \((\d+) omitted\)\. /);
|
|
138
|
+
if (items !== 500) {
|
|
139
|
+
expect(bounded._truncation.omitted_items[0].total).toBe(items + 5);
|
|
140
|
+
expect(bounded._truncation.omitted_items[0].returned).toBe(items);
|
|
141
|
+
}
|
|
142
|
+
const full = JSON.parse(textOf(await run({ action, full: true })));
|
|
143
|
+
expect(full).toEqual(oversized);
|
|
144
|
+
});
|
|
145
|
+
it('gives every paged action a pageToken hint and every unpaged one a full hint', () => {
|
|
146
|
+
const paged = [
|
|
147
|
+
'search',
|
|
148
|
+
'listResponses',
|
|
149
|
+
'getMessages',
|
|
150
|
+
'listThreads',
|
|
151
|
+
'listEvents',
|
|
152
|
+
'listTasks',
|
|
153
|
+
'listTaskLists',
|
|
154
|
+
'getComments',
|
|
155
|
+
'listSpaces'
|
|
156
|
+
];
|
|
157
|
+
for (const bounds of [GMAIL_BOUNDS, FORMS_BOUNDS, CHAT_BOUNDS, CALENDAR_BOUNDS, TASKS_BOUNDS, DRIVE_BOUNDS]) {
|
|
158
|
+
for (const [action, bound] of Object.entries(bounds)) {
|
|
159
|
+
if (!paged.includes(action))
|
|
160
|
+
continue;
|
|
161
|
+
expect(bound.hint).toBe(PAGE_HINT);
|
|
162
|
+
expect(bound.items).toBeUndefined();
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
expect(SLIDES_BOUNDS.getImages.hint).toBe(LIST_HINT);
|
|
166
|
+
expect(SLIDES_BOUNDS.getText.hint).toBe(TEXT_HINT);
|
|
167
|
+
});
|
|
168
|
+
});
|
|
169
|
+
//# sourceMappingURL=factory-bounds.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"factory-bounds.test.js","sourceRoot":"","sources":["../../../../src/tools/domains/factory-bounds.test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAA;AACjD,OAAO,EACL,eAAe,EACf,WAAW,EACX,WAAW,EACX,YAAY,EACZ,YAAY,EACZ,YAAY,EACZ,SAAS,EACT,SAAS,EACT,aAAa,EACb,aAAa,EACb,YAAY,EACZ,SAAS,EACV,MAAM,aAAa,CAAA;AACpB,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C;;;;GAIG;AACH,SAAS,cAAc,CAAC,OAAgB,EAAE,MAAM,GAAG,SAAS;;IAC1D,MAAM,OAAO,GAAG;QACd,IAAI,EAAE,EAAE,CAAC,EAAE,CACT,KAAK,EAAE,OAAgB,EAA2B,EAAE,CAAC,CAAC;YACpD,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC;SACnG,CAAC,CACH;KACF,CAAA;IACD,MAAM,cAAc;QAClB,YAAY,IAAa;YAGzB,QAAQ,GAAG,OAAO,CAAC,IAAI,CAAA;YAFrB,KAAK,IAAI,CAAA;QACX,CAAC;KAEF;SADE,MAAM;IAET,OAAO,EAAE,cAAc,EAAE,OAAO,EAAE,CAAA;AACpC,CAAC;AAED,SAAS,MAAM,CAAC,MAAsB;IACpC,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KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC;gBACrD,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC;oBAAE,SAAQ;gBACrC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;gBAClC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,aAAa,EAAE,CAAA;YACrC,CAAC;QACH,CAAC;QACD,MAAM,CAAC,aAAa,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QACpD,MAAM,CAAC,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;IACpD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -10,6 +10,20 @@ type ServiceCtor = new (auth: AuthManager) => object;
|
|
|
10
10
|
type ServiceCtorNoAuth = new () => object;
|
|
11
11
|
export declare const DEFAULT_PAGE_SIZE = 20;
|
|
12
12
|
export declare const MAX_PAGE_SIZE = 100;
|
|
13
|
+
/**
|
|
14
|
+
* A response bound for one action. `chars` is the character budget (default
|
|
15
|
+
* 20,000), `items` caps a listing array that has no pagination cursor, and
|
|
16
|
+
* `hint` is appended to the truncation marker to say how to fetch the rest.
|
|
17
|
+
* Callers raise the character budget with `max_chars` and remove both bounds
|
|
18
|
+
* with `full: true`.
|
|
19
|
+
*/
|
|
20
|
+
export interface ActionBound {
|
|
21
|
+
chars?: number;
|
|
22
|
+
items?: number;
|
|
23
|
+
hint?: string;
|
|
24
|
+
}
|
|
25
|
+
/** The escape hatch every bounded action advertises in its marker. */
|
|
26
|
+
export declare const DEFAULT_BOUND_HINT = "Pass full: true for the complete payload, or raise max_chars up to 100000.";
|
|
13
27
|
export declare function normalizePageSize(value: unknown, field: 'pageSize' | 'maxResults'): number;
|
|
14
28
|
export interface DomainRunInput {
|
|
15
29
|
action: string;
|
|
@@ -19,6 +33,7 @@ export interface DomainRunInput {
|
|
|
19
33
|
export declare function makeDomainRun(ServiceClass: ServiceCtor | ServiceCtorNoAuth, actions: readonly string[], opts?: {
|
|
20
34
|
noAuth?: boolean;
|
|
21
35
|
pagination?: Record<string, 'pageSize' | 'maxResults'>;
|
|
36
|
+
bounds?: Record<string, ActionBound>;
|
|
22
37
|
}): (input: DomainRunInput) => Promise<CallToolResult>;
|
|
23
38
|
export {};
|
|
24
39
|
//# sourceMappingURL=factory.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/factory.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAUhE,KAAK,WAAW,GAAG,KAAK,IAAI,EAAE,WAAW,KAAK,MAAM,CAAA;AACpD,KAAK,iBAAiB,GAAG,UAAU,MAAM,CAAA;AAGzC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,eAAO,MAAM,aAAa,MAAM,CAAA;AAEhC;;;;;;GAMG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,IAAI,CAAC,EAAE,MAAM,CAAA;CACd;AAED,sEAAsE;AACtE,eAAO,MAAM,kBAAkB,+EAA+E,CAAA;AAK9G,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,UAAU,GAAG,YAAY,GAAG,MAAM,CAU1F;AAcD,MAAM,WAAW,cAAc;IAC7B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,CAAC,EAAE,MAAM,CAAA;IAChB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;CACvB;AAED,wBAAgB,aAAa,CAC3B,YAAY,EAAE,WAAW,GAAG,iBAAiB,EAC7C,OAAO,EAAE,SAAS,MAAM,EAAE,EAC1B,IAAI,GAAE;IACJ,MAAM,CAAC,EAAE,OAAO,CAAA;IAChB,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,UAAU,GAAG,YAAY,CAAC,CAAA;IACtD,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAAA;CAChC,GACL,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAkCpD"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
import { runWithAccount } from '../../auth/account-context.js';
|
|
2
2
|
import { BASE_SCOPES } from '../../constants.js';
|
|
3
3
|
import { AuthManager } from '../../vendored/auth/AuthManager.js';
|
|
4
|
+
import { boundToolResult, resolveResponseBudget } from '../helpers/bounds.js';
|
|
4
5
|
import { WorkspaceMCPError, withErrorHandling } from '../helpers/errors.js';
|
|
5
6
|
export const DEFAULT_PAGE_SIZE = 20;
|
|
6
7
|
export const MAX_PAGE_SIZE = 100;
|
|
8
|
+
/** The escape hatch every bounded action advertises in its marker. */
|
|
9
|
+
export const DEFAULT_BOUND_HINT = `Pass full: true for the complete payload, or raise max_chars up to 100000.`;
|
|
10
|
+
/** Tool-level knobs consumed here, never forwarded to a vendored service. */
|
|
11
|
+
const BOUND_KNOBS = ['max_chars', 'full'];
|
|
7
12
|
export function normalizePageSize(value, field) {
|
|
8
13
|
if (value === undefined)
|
|
9
14
|
return DEFAULT_PAGE_SIZE;
|
|
@@ -31,12 +36,24 @@ export function makeDomainRun(ServiceClass, actions, opts = {}) {
|
|
|
31
36
|
throw new WorkspaceMCPError(`Unknown action: ${action}`, 'VALIDATION_ERROR', `Valid actions: ${actions.join(', ')}`);
|
|
32
37
|
}
|
|
33
38
|
const params = normalizeBoundedParams(action, rawParams, opts.pagination);
|
|
39
|
+
// The bound knobs are this layer's contract, not a service parameter:
|
|
40
|
+
// drop them so a vendored method never sees an option it cannot honor.
|
|
41
|
+
const bound = opts.bounds?.[action];
|
|
42
|
+
if (opts.bounds) {
|
|
43
|
+
for (const knob of BOUND_KNOBS)
|
|
44
|
+
delete params[knob];
|
|
45
|
+
}
|
|
46
|
+
// Validate the budget before the API call, so a bad max_chars costs no quota.
|
|
47
|
+
const budget = bound ? resolveResponseBudget(rawParams, bound) : undefined;
|
|
34
48
|
const method = svc[action];
|
|
35
49
|
// The vendored service is a singleton built at module load, and upstream's
|
|
36
50
|
// getAuthenticatedClient() takes no arguments, so the account cannot ride
|
|
37
51
|
// down as a parameter without editing vendored code. It travels in
|
|
38
52
|
// AsyncLocalStorage instead; the AuthManager shim reads it back out.
|
|
39
|
-
|
|
53
|
+
const result = await runWithAccount(account, () => method(params));
|
|
54
|
+
if (!bound || !budget)
|
|
55
|
+
return result;
|
|
56
|
+
return boundToolResult(result, budget, bound.hint ?? DEFAULT_BOUND_HINT);
|
|
40
57
|
})();
|
|
41
58
|
};
|
|
42
59
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["../../../../src/tools/domains/factory.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAC9D,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAA;AAChD,OAAO,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAA;AAChE,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAA;AAY3E,MAAM,CAAC,MAAM,iBAAiB,GAAG,EAAE,CAAA;AACnC,MAAM,CAAC,M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M,GAAG,KAAK,CAAC,CAAC,CAAC,qBAAqB,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;YAC1E,MAAM,MAAM,GAAI,GAAgD,CAAC,MAAM,CAAC,CAAA;YACxE,2EAA2E;YAC3E,0EAA0E;YAC1E,mEAAmE;YACnE,qEAAqE;YACrE,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,OAAO,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAA;YAClE,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM;gBAAE,OAAO,MAAM,CAAA;YACpC,OAAO,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,CAAC,IAAI,IAAI,kBAAkB,CAAC,CAAA;QAC1E,CAAC,CAAC,EAAE,CAAA;IACN,CAAC,CAAA;AACH,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/forms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;
|
|
1
|
+
{"version":3,"file":"forms.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/forms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAOH,eAAO,MAAM,aAAa,2EAA4E,CAAA;AAEtG,eAAO,MAAM,KAAK,qHAGhB,CAAA"}
|
|
@@ -5,8 +5,12 @@
|
|
|
5
5
|
* (src/services/, not src/vendored/) because upstream has no Forms coverage.
|
|
6
6
|
*/
|
|
7
7
|
import { FormsService } from '../../services/FormsService.js';
|
|
8
|
+
import { FORMS_BOUNDS } from './bounds.js';
|
|
8
9
|
import { makeDomainRun } from './factory.js';
|
|
9
10
|
// Action name = FormsService method name (verbatim).
|
|
10
11
|
export const FORMS_ACTIONS = ['create', 'get', 'batchUpdate', 'listResponses', 'getResponse'];
|
|
11
|
-
export const forms = makeDomainRun(FormsService, FORMS_ACTIONS, {
|
|
12
|
+
export const forms = makeDomainRun(FormsService, FORMS_ACTIONS, {
|
|
13
|
+
pagination: { listResponses: 'pageSize' },
|
|
14
|
+
bounds: FORMS_BOUNDS
|
|
15
|
+
});
|
|
12
16
|
//# sourceMappingURL=forms.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../../src/tools/domains/forms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAU,CAAA;AAEtG,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"forms.js","sourceRoot":"","sources":["../../../../src/tools/domains/forms.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAA;AAC7D,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,qDAAqD;AACrD,MAAM,CAAC,MAAM,aAAa,GAAG,CAAC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,eAAe,EAAE,aAAa,CAAU,CAAA;AAEtG,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE;IAC9D,UAAU,EAAE,EAAE,aAAa,EAAE,UAAU,EAAE;IACzC,MAAM,EAAE,YAAY;CACrB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/gmail.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"gmail.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/gmail.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,4JAYhB,CAAA;AACV,eAAO,MAAM,KAAK,qHAGhB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { GmailService } from '../../vendored/services/GmailService.js';
|
|
2
|
+
import { GMAIL_BOUNDS } from './bounds.js';
|
|
2
3
|
import { makeDomainRun } from './factory.js';
|
|
3
4
|
export const GMAIL_ACTIONS = [
|
|
4
5
|
'search',
|
|
@@ -13,5 +14,8 @@ export const GMAIL_ACTIONS = [
|
|
|
13
14
|
'listLabels',
|
|
14
15
|
'createLabel'
|
|
15
16
|
];
|
|
16
|
-
export const gmail = makeDomainRun(GmailService, GMAIL_ACTIONS, {
|
|
17
|
+
export const gmail = makeDomainRun(GmailService, GMAIL_ACTIONS, {
|
|
18
|
+
pagination: { search: 'maxResults' },
|
|
19
|
+
bounds: GMAIL_BOUNDS
|
|
20
|
+
});
|
|
17
21
|
//# sourceMappingURL=gmail.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gmail.js","sourceRoot":"","sources":["../../../../src/tools/domains/gmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,KAAK;IACL,oBAAoB;IACpB,QAAQ;IACR,aAAa;IACb,cAAc;IACd,MAAM;IACN,aAAa;IACb,WAAW;IACX,YAAY;IACZ,aAAa;CACL,CAAA;AACV,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE,
|
|
1
|
+
{"version":3,"file":"gmail.js","sourceRoot":"","sources":["../../../../src/tools/domains/gmail.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,yCAAyC,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,aAAa,GAAG;IAC3B,QAAQ;IACR,KAAK;IACL,oBAAoB;IACpB,QAAQ;IACR,aAAa;IACb,cAAc;IACd,MAAM;IACN,aAAa;IACb,WAAW;IACX,YAAY;IACZ,aAAa;CACL,CAAA;AACV,MAAM,CAAC,MAAM,KAAK,GAAG,aAAa,CAAC,YAAY,EAAE,aAAa,EAAE;IAC9D,UAAU,EAAE,EAAE,MAAM,EAAE,YAAY,EAAE;IACpC,MAAM,EAAE,YAAY;CACrB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAKxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AASlD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,GAAG,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CACxD;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/index.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAKxE,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AASlD,MAAM,WAAW,SAAS;IACxB,IAAI,EAAE,MAAM,CAAA;IACZ,WAAW,EAAE,MAAM,CAAA;IACnB,OAAO,EAAE,SAAS,MAAM,EAAE,CAAA;IAC1B,UAAU,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IACnC,gBAAgB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACpC,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,CAAA;IACvC,GAAG,EAAE,CAAC,KAAK,EAAE,cAAc,KAAK,OAAO,CAAC,cAAc,CAAC,CAAA;CACxD;AAED,eAAO,MAAM,OAAO,EAAE,SAAS,EAgT9B,CAAA"}
|
|
@@ -19,7 +19,7 @@ import { TIME_ACTIONS, time } from './time.js';
|
|
|
19
19
|
export const DOMAINS = [
|
|
20
20
|
{
|
|
21
21
|
name: 'docs',
|
|
22
|
-
description: 'Google Docs operations.\n\nActions (required params -> optional):\n- getText (documentId -> tabId, limit, preview)\n- create (title -> content)\n- writeText (documentId, text -> position, tabId)\n- getSuggestions (documentId)\n- replaceText (documentId, findText, replaceText -> tabId)\n- formatText (documentId, formats -> tabId)\n\ngetText defaults to 20,000 characters, accepts limit 1-100,000, and marks truncated output explicitly. preview defaults to 2,000 characters unless limit is provided. These bounds limit response size without changing document authorization.\n\naccount = email of the Google account to use (default: primary).',
|
|
22
|
+
description: 'Google Docs operations.\n\nActions (required params -> optional):\n- getText (documentId -> tabId, limit, preview)\n- create (title -> content)\n- writeText (documentId, text -> position, tabId)\n- getSuggestions (documentId)\n- replaceText (documentId, findText, replaceText -> tabId)\n- formatText (documentId, formats -> tabId)\n\ngetText defaults to 20,000 characters, accepts limit 1-100,000, and marks truncated output explicitly. preview defaults to 2,000 characters unless limit is provided. getSuggestions is bounded separately: 20,000 characters and 100 suggestions by default (max_chars 1-100,000, full:true for every entry). These bounds limit response size without changing document authorization.\n\naccount = email of the Google account to use (default: primary).',
|
|
23
23
|
actions: DOCS_ACTIONS,
|
|
24
24
|
inputProps: {
|
|
25
25
|
documentId: { type: 'string', description: 'Google Doc ID or URL' },
|
|
@@ -33,6 +33,14 @@ export const DOMAINS = [
|
|
|
33
33
|
tabId: { type: 'string', description: 'Tab ID to target (optional, for multi-tab documents)' },
|
|
34
34
|
limit: { type: 'number', description: 'Maximum Docs text characters for getText (1-100000; default 20000)' },
|
|
35
35
|
preview: { type: 'boolean', description: 'Use a 2000-character getText preview unless limit is provided' },
|
|
36
|
+
max_chars: {
|
|
37
|
+
type: 'number',
|
|
38
|
+
description: 'Maximum characters returned by getSuggestions (1-100000; default 20000)'
|
|
39
|
+
},
|
|
40
|
+
full: {
|
|
41
|
+
type: 'boolean',
|
|
42
|
+
description: 'Return every getSuggestions entry, bypassing the default 20000-character and 100-item bounds'
|
|
43
|
+
},
|
|
36
44
|
replaceText: { type: 'string', description: 'Replacement text (for replaceText)' },
|
|
37
45
|
formats: {
|
|
38
46
|
type: 'array',
|
|
@@ -60,7 +68,7 @@ export const DOMAINS = [
|
|
|
60
68
|
},
|
|
61
69
|
{
|
|
62
70
|
name: 'drive',
|
|
63
|
-
description: 'Drive operations. See the action enum for operations available in this transport. account = email of the Google account to use (default: primary).',
|
|
71
|
+
description: 'Drive operations. See the action enum for operations available in this transport.\n\nsearch, getComments and findFolder are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload). search and getComments page with pageSize and pageToken; findFolder caps at 50 name matches. Truncated output names its true size and how to fetch the rest. account = email of the Google account to use (default: primary).',
|
|
64
72
|
actions: DRIVE_ACTIONS,
|
|
65
73
|
localOnlyActions: ['downloadFile'],
|
|
66
74
|
localOnlyInputProps: ['localPath'],
|
|
@@ -77,6 +85,14 @@ export const DOMAINS = [
|
|
|
77
85
|
pageToken: { type: 'string', description: 'Continuation token from a previous search page' },
|
|
78
86
|
corpus: { type: 'string', enum: ['user', 'domain'], description: 'Drive search corpus' },
|
|
79
87
|
unreadOnly: { type: 'boolean', description: 'Restrict search to unread files where supported' },
|
|
88
|
+
max_chars: {
|
|
89
|
+
type: 'number',
|
|
90
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
91
|
+
},
|
|
92
|
+
full: {
|
|
93
|
+
type: 'boolean',
|
|
94
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
95
|
+
},
|
|
80
96
|
localPath: {
|
|
81
97
|
type: 'string',
|
|
82
98
|
description: 'Local destination path for downloadFile. This action is available only over local stdio transport.'
|
|
@@ -88,7 +104,7 @@ export const DOMAINS = [
|
|
|
88
104
|
name: 'calendar',
|
|
89
105
|
description: 'Calendar operations. Actions: ' +
|
|
90
106
|
CALENDAR_ACTIONS.join(', ') +
|
|
91
|
-
'. account = email of the Google account to use (default: primary).',
|
|
107
|
+
'.\n\nlistEvents, getEvent, listCalendars and findFreeTime are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload); listEvents pages with maxResults and pageToken and always returns its nextPageToken. Truncated output names its true size and how to fetch the rest. account = email of the Google account to use (default: primary).',
|
|
92
108
|
actions: CALENDAR_ACTIONS,
|
|
93
109
|
inputProps: {
|
|
94
110
|
calendarId: { type: 'string' },
|
|
@@ -97,7 +113,17 @@ export const DOMAINS = [
|
|
|
97
113
|
description: { type: 'string' },
|
|
98
114
|
start: { type: 'string' },
|
|
99
115
|
end: { type: 'string' },
|
|
100
|
-
attendees: { type: 'array' }
|
|
116
|
+
attendees: { type: 'array' },
|
|
117
|
+
maxResults: { type: 'number', description: 'Maximum events per page (for listEvents; default 20)' },
|
|
118
|
+
pageToken: { type: 'string', description: 'Continuation token from a previous listEvents page' },
|
|
119
|
+
max_chars: {
|
|
120
|
+
type: 'number',
|
|
121
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
122
|
+
},
|
|
123
|
+
full: {
|
|
124
|
+
type: 'boolean',
|
|
125
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
126
|
+
}
|
|
101
127
|
},
|
|
102
128
|
run: calendar
|
|
103
129
|
},
|
|
@@ -105,7 +131,7 @@ export const DOMAINS = [
|
|
|
105
131
|
name: 'chat',
|
|
106
132
|
description: 'Chat operations. Actions: ' +
|
|
107
133
|
CHAT_ACTIONS.join(', ') +
|
|
108
|
-
'. account = email of the Google account to use (default: primary).',
|
|
134
|
+
'.\n\nlistSpaces, getMessages, listThreads and findSpaceByName are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload). All three listings page with pageSize and pageToken and always return their nextPageToken; findSpaceByName caps at 50 matches. account = email of the Google account to use (default: primary).',
|
|
109
135
|
actions: CHAT_ACTIONS,
|
|
110
136
|
inputProps: {
|
|
111
137
|
spaceId: { type: 'string' },
|
|
@@ -116,6 +142,14 @@ export const DOMAINS = [
|
|
|
116
142
|
pageSize: { type: 'number', description: 'Maximum spaces, messages, or threads per page' },
|
|
117
143
|
pageToken: { type: 'string', description: 'Continuation token from a previous page' },
|
|
118
144
|
unreadOnly: { type: 'boolean', description: 'Return only unread messages' },
|
|
145
|
+
max_chars: {
|
|
146
|
+
type: 'number',
|
|
147
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
148
|
+
},
|
|
149
|
+
full: {
|
|
150
|
+
type: 'boolean',
|
|
151
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
152
|
+
},
|
|
119
153
|
orderBy: { type: 'string', description: 'Message ordering expression' },
|
|
120
154
|
filter: { type: 'string', description: 'Chat message filter' }
|
|
121
155
|
},
|
|
@@ -125,7 +159,7 @@ export const DOMAINS = [
|
|
|
125
159
|
name: 'gmail',
|
|
126
160
|
description: 'Gmail operations. Actions: ' +
|
|
127
161
|
GMAIL_ACTIONS.join(', ') +
|
|
128
|
-
'. account = email of the Google account to use (default: primary).',
|
|
162
|
+
'.\n\nget, modify, modifyThread, search and listLabels are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload), so a long message body is cut with an explicit marker instead of flooding the response. search pages with maxResults and pageToken. account = email of the Google account to use (default: primary).',
|
|
129
163
|
actions: GMAIL_ACTIONS,
|
|
130
164
|
inputProps: {
|
|
131
165
|
query: { type: 'string' },
|
|
@@ -139,6 +173,14 @@ export const DOMAINS = [
|
|
|
139
173
|
maxResults: { type: 'number', description: 'Maximum messages returned per page (bounded by Gmail)' },
|
|
140
174
|
pageToken: { type: 'string', description: 'Continuation token from a previous search page' },
|
|
141
175
|
includeSpamTrash: { type: 'boolean', description: 'Include spam and trash in search results' },
|
|
176
|
+
max_chars: {
|
|
177
|
+
type: 'number',
|
|
178
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
179
|
+
},
|
|
180
|
+
full: {
|
|
181
|
+
type: 'boolean',
|
|
182
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
183
|
+
},
|
|
142
184
|
format: { type: 'string', enum: ['minimal', 'full', 'raw', 'metadata'], description: 'Message payload detail' }
|
|
143
185
|
},
|
|
144
186
|
run: gmail
|
|
@@ -147,11 +189,19 @@ export const DOMAINS = [
|
|
|
147
189
|
name: 'slides',
|
|
148
190
|
description: 'Slides operations. Actions: ' +
|
|
149
191
|
SLIDES_ACTIONS.join(', ') +
|
|
150
|
-
'. account = email of the Google account to use (default: primary).',
|
|
192
|
+
'.\n\ngetText, getMetadata, getImages and getSpeakerNotes are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload) and at most 100 slide or image entries. getSlideThumbnail returns one base64 image and is never cut. Truncated output names its true size and how to fetch the rest. account = email of the Google account to use (default: primary).',
|
|
151
193
|
actions: SLIDES_ACTIONS,
|
|
152
194
|
inputProps: {
|
|
153
195
|
presentationId: { type: 'string' },
|
|
154
196
|
title: { type: 'string' },
|
|
197
|
+
max_chars: {
|
|
198
|
+
type: 'number',
|
|
199
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
200
|
+
},
|
|
201
|
+
full: {
|
|
202
|
+
type: 'boolean',
|
|
203
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
204
|
+
},
|
|
155
205
|
slideId: { type: 'string' },
|
|
156
206
|
text: { type: 'string' }
|
|
157
207
|
},
|
|
@@ -161,11 +211,19 @@ export const DOMAINS = [
|
|
|
161
211
|
name: 'sheets',
|
|
162
212
|
description: 'Sheets operations. Actions: ' +
|
|
163
213
|
SHEETS_ACTIONS.join(', ') +
|
|
164
|
-
'. account = email of the Google account to use (default: primary).',
|
|
214
|
+
'.\n\ngetText and getRange return at most 20,000 characters by default (max_chars 1-100,000) and mark truncated output explicitly with the true size and omitted count; pass full:true for the complete payload. account = email of the Google account to use (default: primary).',
|
|
165
215
|
actions: SHEETS_ACTIONS,
|
|
166
216
|
inputProps: {
|
|
167
217
|
spreadsheetId: { type: 'string' },
|
|
168
|
-
range: { type: 'string' }
|
|
218
|
+
range: { type: 'string' },
|
|
219
|
+
max_chars: {
|
|
220
|
+
type: 'number',
|
|
221
|
+
description: 'Maximum characters returned by getText/getRange (1-100000; default 20000)'
|
|
222
|
+
},
|
|
223
|
+
full: {
|
|
224
|
+
type: 'boolean',
|
|
225
|
+
description: 'Return the complete getText/getRange payload, bypassing the default 20000-character bound'
|
|
226
|
+
}
|
|
169
227
|
},
|
|
170
228
|
run: sheets
|
|
171
229
|
},
|
|
@@ -173,7 +231,7 @@ export const DOMAINS = [
|
|
|
173
231
|
name: 'tasks',
|
|
174
232
|
description: 'Tasks operations. Actions: ' +
|
|
175
233
|
TASKS_ACTIONS.join(', ') +
|
|
176
|
-
'. account = email of the Google account to use (default: primary).',
|
|
234
|
+
'.\n\nlistTasks and listTaskLists are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload) and page with maxResults and pageToken. Truncated output names its true size and how to fetch the rest. account = email of the Google account to use (default: primary).',
|
|
177
235
|
actions: TASKS_ACTIONS,
|
|
178
236
|
inputProps: {
|
|
179
237
|
taskListId: { type: 'string' },
|
|
@@ -181,6 +239,14 @@ export const DOMAINS = [
|
|
|
181
239
|
title: { type: 'string' },
|
|
182
240
|
notes: { type: 'string' },
|
|
183
241
|
due: { type: 'string' },
|
|
242
|
+
max_chars: {
|
|
243
|
+
type: 'number',
|
|
244
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
245
|
+
},
|
|
246
|
+
full: {
|
|
247
|
+
type: 'boolean',
|
|
248
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
249
|
+
},
|
|
184
250
|
maxResults: { type: 'number', description: 'Maximum task lists or tasks per page' },
|
|
185
251
|
pageToken: { type: 'string', description: 'Continuation token from a previous page' }
|
|
186
252
|
},
|
|
@@ -190,16 +256,24 @@ export const DOMAINS = [
|
|
|
190
256
|
name: 'people',
|
|
191
257
|
description: 'People operations. Actions: ' +
|
|
192
258
|
PEOPLE_ACTIONS.join(', ') +
|
|
193
|
-
'. account = email of the Google account to use (default: primary).',
|
|
259
|
+
'.\n\nAll three actions are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload), and getUserRelations keeps at most 50 relations. Truncated output names its true size and how to fetch the rest. account = email of the Google account to use (default: primary).',
|
|
194
260
|
actions: PEOPLE_ACTIONS,
|
|
195
261
|
inputProps: {
|
|
262
|
+
max_chars: {
|
|
263
|
+
type: 'number',
|
|
264
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
265
|
+
},
|
|
266
|
+
full: {
|
|
267
|
+
type: 'boolean',
|
|
268
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
269
|
+
},
|
|
196
270
|
resourceName: { type: 'string' }
|
|
197
271
|
},
|
|
198
272
|
run: people
|
|
199
273
|
},
|
|
200
274
|
{
|
|
201
275
|
name: 'forms',
|
|
202
|
-
description: 'Google Forms operations.\n\nActions (required params -> optional):\n- create (title -> documentTitle)\n- get (formId)\n- batchUpdate (formId, requests)\n- listResponses (formId -> pageSize, pageToken, filter)\n- getResponse (formId, responseId)\n\nQuestions are added with batchUpdate, not create. Responses are read-only (the Forms API cannot write one), and listing or deleting forms goes through the drive tool.\n\naccount = email of the Google account to use (default: primary).',
|
|
276
|
+
description: 'Google Forms operations.\n\nActions (required params -> optional):\n- create (title -> documentTitle)\n- get (formId)\n- batchUpdate (formId, requests)\n- listResponses (formId -> pageSize, pageToken, filter)\n- getResponse (formId, responseId)\n\nQuestions are added with batchUpdate, not create. Responses are read-only (the Forms API cannot write one), and listing or deleting forms goes through the drive tool.\n\nget, getResponse and listResponses are bounded: 20,000 characters by default (max_chars 1-100,000, full:true for the complete payload); listResponses pages with pageSize and pageToken.\n\naccount = email of the Google account to use (default: primary).',
|
|
203
277
|
actions: FORMS_ACTIONS,
|
|
204
278
|
inputProps: {
|
|
205
279
|
formId: {
|
|
@@ -219,6 +293,14 @@ export const DOMAINS = [
|
|
|
219
293
|
responseId: { type: 'string', description: 'Response ID (for getResponse)' },
|
|
220
294
|
pageSize: { type: 'number', description: 'Maximum responses to return (for listResponses)' },
|
|
221
295
|
pageToken: { type: 'string', description: 'Page token from a previous listResponses call' },
|
|
296
|
+
max_chars: {
|
|
297
|
+
type: 'number',
|
|
298
|
+
description: 'Maximum characters returned by a bounded read action (1-100000; default 20000)'
|
|
299
|
+
},
|
|
300
|
+
full: {
|
|
301
|
+
type: 'boolean',
|
|
302
|
+
description: 'Return the complete payload, bypassing the default 20000-character and item bounds'
|
|
303
|
+
},
|
|
222
304
|
filter: {
|
|
223
305
|
type: 'string',
|
|
224
306
|
description: 'Response filter, e.g. timestamp > 2026-01-01T00:00:00Z (for listResponses)'
|