@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
|
@@ -8,7 +8,26 @@ import { startAddAccount } from '../auth/add-account.js';
|
|
|
8
8
|
import { getAuth, getState, resetState, resolveCredentialState } from '../auth/credential-state.js';
|
|
9
9
|
import { currentSubject } from '../auth/subject-context.js';
|
|
10
10
|
import { WorkspaceMCPError, withErrorHandling } from './helpers/errors.js';
|
|
11
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Every action this tool accepts, in the order the schema advertises them.
|
|
13
|
+
* The input type, the error message and the MCP `action` enum
|
|
14
|
+
* (tools/registry.ts) are all derived from this one list, so adding an action
|
|
15
|
+
* cannot leave one of the three behind -- and the CLI's `config-tool` spec
|
|
16
|
+
* reads the same enum (cli/tools.ts).
|
|
17
|
+
*/
|
|
18
|
+
export const CONFIG_ACTIONS = [
|
|
19
|
+
'status',
|
|
20
|
+
'setup_start',
|
|
21
|
+
'setup_reset',
|
|
22
|
+
'setup_complete',
|
|
23
|
+
'set',
|
|
24
|
+
'cache_clear',
|
|
25
|
+
'account_add',
|
|
26
|
+
'account_list',
|
|
27
|
+
'account_remove',
|
|
28
|
+
'account_set_default'
|
|
29
|
+
];
|
|
30
|
+
const VALID_ACTIONS = CONFIG_ACTIONS.join(', ');
|
|
12
31
|
async function statusJson() {
|
|
13
32
|
const state = getState();
|
|
14
33
|
const { accounts, primary } = await getAuth().listAccounts();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/tools/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EAAE,iBAAiB,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/tools/config.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,OAAO,EAAE,OAAO,EAAE,QAAQ,EAAE,UAAU,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAA;AACnG,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAC3D,OAAO,EA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ts).
|
|
4
|
+
*
|
|
5
|
+
* The dispatch used to live inline in registry.ts, which meant a CLI could only
|
|
6
|
+
* reach it through an MCP server object. Extracting it here is what lets
|
|
7
|
+
* `workspace <tool> <action>` run the EXACT handler the server registers --
|
|
8
|
+
* credential gate, domain validation, error wrapping and all -- instead of a
|
|
9
|
+
* second implementation that would drift.
|
|
10
|
+
*/
|
|
11
|
+
import type { CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
12
|
+
export declare const DOCS_DIR: string;
|
|
13
|
+
export declare const HELP_TOPICS: string[];
|
|
14
|
+
export declare const VALID_HELP_TOPICS_STRING: string;
|
|
15
|
+
/** Every tool name this server registers: the domains plus config and help. */
|
|
16
|
+
export declare const TOOL_NAMES: string[];
|
|
17
|
+
/**
|
|
18
|
+
* Run one tool call and return the MCP CallTool result shape. Never throws:
|
|
19
|
+
* every failure comes back as `isError: true` with an AI-readable message, so
|
|
20
|
+
* both callers (stdio/http server and the CLI) report it the same way.
|
|
21
|
+
*/
|
|
22
|
+
export declare function dispatchTool(name: string, args: Record<string, unknown> | undefined, { allowLocalFilesystem }?: {
|
|
23
|
+
allowLocalFilesystem?: boolean;
|
|
24
|
+
}): Promise<CallToolResult>;
|
|
25
|
+
//# sourceMappingURL=dispatch.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.d.ts","sourceRoot":"","sources":["../../../src/tools/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAKH,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAA;AAexE,eAAO,MAAM,QAAQ,QAEY,CAAA;AAEjC,eAAO,MAAM,WAAW,UAAwD,CAAA;AAEhF,eAAO,MAAM,wBAAwB,QAAyB,CAAA;AAI9D,+EAA+E;AAC/E,eAAO,MAAM,UAAU,EAAE,MAAM,EAAsD,CAAA;AAgCrF;;;;GAIG;AACH,wBAAsB,YAAY,CAChC,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,SAAS,EACzC,EAAE,oBAA2B,EAAE,GAAE;IAAE,oBAAoB,CAAC,EAAE,OAAO,CAAA;CAAO,GACvE,OAAO,CAAC,cAAc,CAAC,CA+EzB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool dispatch core, shared by the MCP `tools/call` handler (registry.ts) and
|
|
3
|
+
* the CLI tool subcommands (cli/tools.ts).
|
|
4
|
+
*
|
|
5
|
+
* The dispatch used to live inline in registry.ts, which meant a CLI could only
|
|
6
|
+
* reach it through an MCP server object. Extracting it here is what lets
|
|
7
|
+
* `workspace <tool> <action>` run the EXACT handler the server registers --
|
|
8
|
+
* credential gate, domain validation, error wrapping and all -- instead of a
|
|
9
|
+
* second implementation that would drift.
|
|
10
|
+
*/
|
|
11
|
+
import { readFile } from 'node:fs/promises';
|
|
12
|
+
import { basename, dirname, isAbsolute, join, relative, sep } from 'node:path';
|
|
13
|
+
import { fileURLToPath } from 'node:url';
|
|
14
|
+
import { getState, resolveCredentialState } from '../auth/credential-state.js';
|
|
15
|
+
import { config } from './config.js';
|
|
16
|
+
import { DOMAINS } from './domains/index.js';
|
|
17
|
+
import { aiReadableMessage, findClosestMatch, WorkspaceMCPError } from './helpers/errors.js';
|
|
18
|
+
// Tools that work without a configured Google account.
|
|
19
|
+
// 'time' is a no-auth domain (local date/time helpers) — exempt from the credential gate.
|
|
20
|
+
const TOKEN_FREE_TOOLS = { config: true, help: true, time: true };
|
|
21
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
22
|
+
const __dirname = dirname(__filename);
|
|
23
|
+
// For bundled CLI: __dirname = /bin/, docs at /build/src/docs/
|
|
24
|
+
// For unbundled: __dirname = /build/src/tools/, docs at /build/src/docs/
|
|
25
|
+
export const DOCS_DIR = __dirname.endsWith('bin')
|
|
26
|
+
? join(__dirname, '..', 'build', 'src', 'docs')
|
|
27
|
+
: join(__dirname, '..', 'docs');
|
|
28
|
+
export const HELP_TOPICS = [...DOMAINS.map((d) => d.name), 'config', 'overview'];
|
|
29
|
+
const VALID_HELP_TOPICS = Object.fromEntries(HELP_TOPICS.map((topic) => [topic, true]));
|
|
30
|
+
export const VALID_HELP_TOPICS_STRING = HELP_TOPICS.join(', ');
|
|
31
|
+
const DOMAIN_MAP = new Map(DOMAINS.map((domain) => [domain.name, domain]));
|
|
32
|
+
/** Every tool name this server registers: the domains plus config and help. */
|
|
33
|
+
export const TOOL_NAMES = [...DOMAINS.map((d) => d.name), 'config', 'help'];
|
|
34
|
+
function errorResult(text) {
|
|
35
|
+
return { content: [{ type: 'text', text }], isError: true };
|
|
36
|
+
}
|
|
37
|
+
async function helpTopic(topic) {
|
|
38
|
+
// Security: validate topic against allowlist to prevent path traversal
|
|
39
|
+
if (VALID_HELP_TOPICS[topic] !== true) {
|
|
40
|
+
throw new WorkspaceMCPError(`Invalid topic: ${topic}`, 'VALIDATION_ERROR', `Valid topics: ${VALID_HELP_TOPICS_STRING}`);
|
|
41
|
+
}
|
|
42
|
+
// Security: basename() ensures we only look for files directly inside
|
|
43
|
+
// DOCS_DIR, even if the allowlist check above were bypassed.
|
|
44
|
+
const docFile = `${basename(topic)}.md`;
|
|
45
|
+
const fullPath = join(DOCS_DIR, docFile);
|
|
46
|
+
const rel = relative(DOCS_DIR, fullPath);
|
|
47
|
+
if (rel === '..' || rel.startsWith(`..${sep}`) || isAbsolute(rel)) {
|
|
48
|
+
throw new WorkspaceMCPError('Path traversal attempt detected', 'SECURITY_ERROR', 'Invalid topic');
|
|
49
|
+
}
|
|
50
|
+
try {
|
|
51
|
+
const content = await readFile(fullPath, 'utf-8');
|
|
52
|
+
return { content: [{ type: 'text', text: content }] };
|
|
53
|
+
}
|
|
54
|
+
catch {
|
|
55
|
+
throw new WorkspaceMCPError(`Documentation not found for: ${topic}`, 'DOC_NOT_FOUND', 'Check topic');
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/**
|
|
59
|
+
* Run one tool call and return the MCP CallTool result shape. Never throws:
|
|
60
|
+
* every failure comes back as `isError: true` with an AI-readable message, so
|
|
61
|
+
* both callers (stdio/http server and the CLI) report it the same way.
|
|
62
|
+
*/
|
|
63
|
+
export async function dispatchTool(name, args, { allowLocalFilesystem = true } = {}) {
|
|
64
|
+
if (!args) {
|
|
65
|
+
return errorResult('Error: No arguments provided');
|
|
66
|
+
}
|
|
67
|
+
// Credential guard. config and help work without a configured Google
|
|
68
|
+
// account; every domain tool requires the OAuth flow to have completed at
|
|
69
|
+
// least once. The state map is per process and per bucket. A fresh process
|
|
70
|
+
// (or a new HTTP user) starts empty, so re-resolve from the store before
|
|
71
|
+
// refusing. resolveCredentialState fails closed: a store read error leaves
|
|
72
|
+
// the state at 'awaiting_setup'.
|
|
73
|
+
if (TOKEN_FREE_TOOLS[name] !== true && getState() !== 'configured') {
|
|
74
|
+
await resolveCredentialState();
|
|
75
|
+
}
|
|
76
|
+
if (TOKEN_FREE_TOOLS[name] !== true && getState() !== 'configured') {
|
|
77
|
+
return errorResult('Google account not configured. Run `workspace auth` on the host to complete the Google consent, or call config(action="setup_start") for instructions.');
|
|
78
|
+
}
|
|
79
|
+
try {
|
|
80
|
+
const domain = DOMAIN_MAP.get(name);
|
|
81
|
+
if (domain) {
|
|
82
|
+
const action = args.action;
|
|
83
|
+
if (!allowLocalFilesystem && typeof action === 'string' && domain.localOnlyActions?.includes(action) === true) {
|
|
84
|
+
if (name === 'drive' && action === 'downloadFile') {
|
|
85
|
+
throw new WorkspaceMCPError('downloadFile is only available in local stdio mode.', 'VALIDATION_ERROR', 'Use a local stdio server to download a Drive file to the local filesystem.');
|
|
86
|
+
}
|
|
87
|
+
throw new WorkspaceMCPError(`Action not available in this transport: ${action}`, 'VALIDATION_ERROR', 'Use an action listed in the tool schema.');
|
|
88
|
+
}
|
|
89
|
+
// `args` arrives as `unknown` values from JSON-RPC / argv; the domain's
|
|
90
|
+
// factory validates `action` against its own list before dispatching.
|
|
91
|
+
return await domain.run(args);
|
|
92
|
+
}
|
|
93
|
+
switch (name) {
|
|
94
|
+
case 'config':
|
|
95
|
+
// `config()` validates each action itself; the cast only restores the
|
|
96
|
+
// call shape the JSON-RPC/argv payload lost.
|
|
97
|
+
return await config(args);
|
|
98
|
+
case 'help': {
|
|
99
|
+
const topic = args.topic;
|
|
100
|
+
if (typeof topic !== 'string') {
|
|
101
|
+
throw new WorkspaceMCPError('help requires a topic', 'VALIDATION_ERROR', `Valid topics: ${VALID_HELP_TOPICS_STRING}`);
|
|
102
|
+
}
|
|
103
|
+
return await helpTopic(topic);
|
|
104
|
+
}
|
|
105
|
+
default: {
|
|
106
|
+
const closest = findClosestMatch(name, TOOL_NAMES);
|
|
107
|
+
const suggestion = closest ? ` Did you mean '${closest}'?` : '';
|
|
108
|
+
throw new WorkspaceMCPError(`Unknown tool: ${name}.${suggestion}`, 'UNKNOWN_TOOL', `Available tools: ${TOOL_NAMES.join(', ')}`);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
catch (error) {
|
|
113
|
+
const enhancedError = error instanceof WorkspaceMCPError
|
|
114
|
+
? error
|
|
115
|
+
: new WorkspaceMCPError(error.message, 'TOOL_ERROR', 'Check the error details and try again');
|
|
116
|
+
return errorResult(aiReadableMessage(enhancedError));
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=dispatch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dispatch.js","sourceRoot":"","sources":["../../../src/tools/dispatch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAA;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,QAAQ,EAAE,GAAG,EAAE,MAAM,WAAW,CAAA;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAA;AAExC,OAAO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AAe,CAAC,OAAO,EAAE,YAAY,EAAE,uCAAuC,CAAC,CAAA;QAE5G,OAAO,WAAW,CAAC,iBAAiB,CAAC,aAAa,CAAC,CAAC,CAAA;IACtD,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds-e2e.test.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/bounds-e2e.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,166 @@
|
|
|
1
|
+
import { beforeEach, describe, expect, it, vi } from 'vitest';
|
|
2
|
+
/**
|
|
3
|
+
* End-to-end bounds: a real vendored service, a real domain run, a mocked
|
|
4
|
+
* Google API. These prove the bound is applied on the path a caller actually
|
|
5
|
+
* uses, not only in the helper's own unit tests.
|
|
6
|
+
*/
|
|
7
|
+
const { messagesGet, presentationsGet, spacesList, commentsList, eventsList } = vi.hoisted(() => ({
|
|
8
|
+
messagesGet: vi.fn(),
|
|
9
|
+
presentationsGet: vi.fn(),
|
|
10
|
+
spacesList: vi.fn(),
|
|
11
|
+
commentsList: vi.fn(),
|
|
12
|
+
eventsList: vi.fn()
|
|
13
|
+
}));
|
|
14
|
+
vi.mock('../../auth/credential-state.js', () => ({
|
|
15
|
+
getAuth: () => ({ getAuthenticatedClient: async () => ({}) })
|
|
16
|
+
}));
|
|
17
|
+
vi.mock('googleapis', () => ({
|
|
18
|
+
google: {
|
|
19
|
+
gmail: () => ({ users: { messages: { get: messagesGet } } }),
|
|
20
|
+
slides: () => ({ presentations: { get: presentationsGet } }),
|
|
21
|
+
chat: () => ({ spaces: { list: spacesList } }),
|
|
22
|
+
drive: () => ({ comments: { list: commentsList } }),
|
|
23
|
+
calendar: () => ({
|
|
24
|
+
events: { list: eventsList },
|
|
25
|
+
calendarList: { list: vi.fn() },
|
|
26
|
+
calendars: { get: vi.fn() }
|
|
27
|
+
})
|
|
28
|
+
}
|
|
29
|
+
}));
|
|
30
|
+
import { calendar } from './calendar.js';
|
|
31
|
+
import { chat } from './chat.js';
|
|
32
|
+
import { drive } from './drive.js';
|
|
33
|
+
import { gmail } from './gmail.js';
|
|
34
|
+
import { slides } from './slides.js';
|
|
35
|
+
beforeEach(() => {
|
|
36
|
+
vi.clearAllMocks();
|
|
37
|
+
});
|
|
38
|
+
function textOf(result) {
|
|
39
|
+
const item = result.content[0];
|
|
40
|
+
if (item.type !== 'text' || typeof item.text !== 'string')
|
|
41
|
+
throw new Error('expected text result');
|
|
42
|
+
return item.text;
|
|
43
|
+
}
|
|
44
|
+
const MESSAGE = {
|
|
45
|
+
id: 'm1',
|
|
46
|
+
threadId: 't1',
|
|
47
|
+
labelIds: ['INBOX'],
|
|
48
|
+
snippet: 'snippet',
|
|
49
|
+
payload: {
|
|
50
|
+
headers: [
|
|
51
|
+
{ name: 'Subject', value: 'Big message' },
|
|
52
|
+
{ name: 'From', value: 'a@example.com' },
|
|
53
|
+
{ name: 'To', value: 'b@example.com' },
|
|
54
|
+
{ name: 'Date', value: '2026-01-01' }
|
|
55
|
+
],
|
|
56
|
+
body: { data: Buffer.from('x'.repeat(40_000), 'utf8').toString('base64') },
|
|
57
|
+
mimeType: 'text/plain'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
describe('gmail.get bounds', () => {
|
|
61
|
+
it('caps a long message body by default and names the true size', async () => {
|
|
62
|
+
messagesGet.mockResolvedValue({ data: MESSAGE });
|
|
63
|
+
const text = textOf(await gmail({ action: 'get', messageId: 'm1' }));
|
|
64
|
+
const parsed = JSON.parse(text);
|
|
65
|
+
expect(text.length).toBeLessThanOrEqual(20_000);
|
|
66
|
+
expect(parsed.id).toBe('m1');
|
|
67
|
+
expect(parsed.subject).toBe('Big message');
|
|
68
|
+
expect(parsed._truncation.truncated).toBe(true);
|
|
69
|
+
expect(parsed._truncation.note).toMatch(/\[Content truncated: showing \d+ of \d+ characters \(\d+ omitted\)\./);
|
|
70
|
+
expect(parsed._truncation.note).toContain('Pass full: true');
|
|
71
|
+
});
|
|
72
|
+
it('returns the whole body with full true', async () => {
|
|
73
|
+
messagesGet.mockResolvedValue({ data: MESSAGE });
|
|
74
|
+
const parsed = JSON.parse(textOf(await gmail({ action: 'get', messageId: 'm1', full: true })));
|
|
75
|
+
expect(parsed._truncation).toBeUndefined();
|
|
76
|
+
expect(parsed.body).toContain('x'.repeat(40_000));
|
|
77
|
+
});
|
|
78
|
+
it('raises the budget with max_chars', async () => {
|
|
79
|
+
messagesGet.mockResolvedValue({ data: MESSAGE });
|
|
80
|
+
const text = textOf(await gmail({ action: 'get', messageId: 'm1', max_chars: 60_000 }));
|
|
81
|
+
expect(text).not.toContain('[Content truncated:');
|
|
82
|
+
expect(text).toContain('x'.repeat(40_000));
|
|
83
|
+
});
|
|
84
|
+
it('rejects a bad max_chars without calling Gmail', async () => {
|
|
85
|
+
messagesGet.mockResolvedValue({ data: MESSAGE });
|
|
86
|
+
await expect(gmail({ action: 'get', messageId: 'm1', max_chars: 0 })).rejects.toThrow(/max_chars must be an integer between 1 and 100000/);
|
|
87
|
+
expect(messagesGet).not.toHaveBeenCalled();
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
describe('slides.getText bounds', () => {
|
|
91
|
+
it('caps a long deck by default and marks the cut', async () => {
|
|
92
|
+
const textRun = { textElements: [{ textRun: { content: 'slide text '.repeat(2_000) } }] };
|
|
93
|
+
presentationsGet.mockResolvedValue({
|
|
94
|
+
data: { title: 'Deck', slides: [{ pageElements: [{ shape: { text: textRun } }] }] }
|
|
95
|
+
});
|
|
96
|
+
const text = textOf(await slides({ action: 'getText', presentationId: 'p1' }));
|
|
97
|
+
expect(text.length).toBeLessThanOrEqual(21_000);
|
|
98
|
+
expect(text).toContain('[Content truncated: showing 20000 of');
|
|
99
|
+
expect(text).toContain('Pass full: true');
|
|
100
|
+
});
|
|
101
|
+
it('returns the whole deck with full true', async () => {
|
|
102
|
+
const textRun = { textElements: [{ textRun: { content: 'slide text '.repeat(2_000) } }] };
|
|
103
|
+
presentationsGet.mockResolvedValue({
|
|
104
|
+
data: { title: 'Deck', slides: [{ pageElements: [{ shape: { text: textRun } }] }] }
|
|
105
|
+
});
|
|
106
|
+
const text = textOf(await slides({ action: 'getText', presentationId: 'p1', full: true }));
|
|
107
|
+
expect(text).not.toContain('[Content truncated:');
|
|
108
|
+
expect(text.length).toBeGreaterThan(20_000);
|
|
109
|
+
});
|
|
110
|
+
it('caps an unpaged image listing by item count', async () => {
|
|
111
|
+
const images = Array.from({ length: 120 }, (_, index) => ({
|
|
112
|
+
objectId: `img${index}`,
|
|
113
|
+
image: { sourceUrl: `https://example.com/${index}.png` }
|
|
114
|
+
}));
|
|
115
|
+
presentationsGet.mockResolvedValue({ data: { slides: [{ objectId: 's1', pageElements: images }] } });
|
|
116
|
+
const parsed = JSON.parse(textOf(await slides({ action: 'getImages', presentationId: 'p1', localPath: '/tmp' })));
|
|
117
|
+
expect(parsed.images).toHaveLength(100);
|
|
118
|
+
expect(parsed._truncation.omitted_items[0]).toEqual({ path: '$.images', returned: 100, total: 120 });
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
describe('paged listings keep their cursor', () => {
|
|
122
|
+
it('chat.listSpaces forwards the page and returns nextPageToken', async () => {
|
|
123
|
+
spacesList.mockResolvedValue({
|
|
124
|
+
data: {
|
|
125
|
+
spaces: Array.from({ length: 20 }, (_, i) => ({ name: `spaces/${i}`, displayName: 'd'.repeat(2_000) })),
|
|
126
|
+
nextPageToken: 'spaces-page-2'
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
const parsed = JSON.parse(textOf(await chat({ action: 'listSpaces', pageSize: 20, pageToken: 'p1' })));
|
|
130
|
+
expect(spacesList).toHaveBeenCalledWith({ pageSize: 20, pageToken: 'p1' });
|
|
131
|
+
expect(parsed._truncation.truncated).toBe(true);
|
|
132
|
+
expect(parsed.nextPageToken).toBe('spaces-page-2');
|
|
133
|
+
expect(parsed.spaces).toHaveLength(20);
|
|
134
|
+
});
|
|
135
|
+
it('drive.getComments forwards the page and returns nextPageToken', async () => {
|
|
136
|
+
commentsList.mockResolvedValue({
|
|
137
|
+
data: {
|
|
138
|
+
comments: Array.from({ length: 20 }, (_, i) => ({ id: `c${i}`, content: 'c'.repeat(2_000) })),
|
|
139
|
+
nextPageToken: 'comments-page-2'
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const parsed = JSON.parse(textOf(await drive({ action: 'getComments', fileId: 'f1', pageSize: 20 })));
|
|
143
|
+
expect(commentsList).toHaveBeenCalledWith(expect.objectContaining({ fileId: 'f1', pageSize: 20 }));
|
|
144
|
+
expect(parsed.nextPageToken).toBe('comments-page-2');
|
|
145
|
+
expect(parsed._truncation.truncated).toBe(true);
|
|
146
|
+
});
|
|
147
|
+
it('calendar.listEvents forwards maxResults and returns nextPageToken', async () => {
|
|
148
|
+
eventsList.mockResolvedValue({
|
|
149
|
+
data: {
|
|
150
|
+
items: Array.from({ length: 20 }, (_, i) => ({
|
|
151
|
+
id: `e${i}`,
|
|
152
|
+
summary: `Event ${i}`,
|
|
153
|
+
description: 'd'.repeat(2_000),
|
|
154
|
+
start: { dateTime: '2026-01-01T10:00:00Z' },
|
|
155
|
+
end: { dateTime: '2026-01-01T11:00:00Z' }
|
|
156
|
+
})),
|
|
157
|
+
nextPageToken: 'events-page-2'
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
const parsed = JSON.parse(textOf(await calendar({ action: 'listEvents', calendarId: 'primary', maxResults: 20 })));
|
|
161
|
+
expect(eventsList).toHaveBeenCalledWith(expect.objectContaining({ maxResults: 20 }));
|
|
162
|
+
expect(parsed.nextPageToken).toBe('events-page-2');
|
|
163
|
+
expect(parsed._truncation.truncated).toBe(true);
|
|
164
|
+
});
|
|
165
|
+
});
|
|
166
|
+
//# sourceMappingURL=bounds-e2e.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds-e2e.test.js","sourceRoot":"","sources":["../../../../src/tools/domains/bounds-e2e.test.ts"],"names":[],"mappings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AM,CAAC,KAAK,CAAC;oBAC9B,KAAK,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE;oBAC3C,GAAG,EAAE,EAAE,QAAQ,EAAE,sBAAsB,EAAE;iBAC1C,CAAC,CAAC;gBACH,aAAa,EAAE,eAAe;aAC/B;SACF,CAAC,CAAA;QAEF,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,QAAQ,CAAC,EAAE,MAAM,EAAE,YAAY,EAAE,UAAU,EAAE,SAAS,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,CAAC,CAAA;QAElH,MAAM,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,MAAM,CAAC,gBAAgB,CAAC,EAAE,UAAU,EAAE,EAAE,EAAE,CAAC,CAAC,CAAA;QACpF,MAAM,CAAC,MAAM,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,CAAA;QAClD,MAAM,CAAC,MAAM,CAAC,WAAW,CAAC,SAAS,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACjD,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Per-action response bounds for every Google read whose payload can grow.
|
|
3
|
+
*
|
|
4
|
+
* Each entry names how much of a response the tool keeps by default. The
|
|
5
|
+
* dispatch factory (`factory.ts`) applies them: the caller raises the
|
|
6
|
+
* character budget with `max_chars` (1-100,000), removes both budgets with
|
|
7
|
+
* `full: true`, and a truncated payload always carries a marker naming its
|
|
8
|
+
* true size and the way to fetch the rest.
|
|
9
|
+
*
|
|
10
|
+
* Two shapes of bounded payload:
|
|
11
|
+
*
|
|
12
|
+
* - `textRead` -- a body of text or one large object (a document, a message, a
|
|
13
|
+
* presentation's text). Only characters are capped, because there is no list
|
|
14
|
+
* to page through.
|
|
15
|
+
* - `listRead` -- a listing array with no pagination cursor (slide and notes
|
|
16
|
+
* arrays, calendars, labels, folder matches, a person's relations, free/busy
|
|
17
|
+
* slots). Characters and item count are both capped, and `full: true` is the
|
|
18
|
+
* only way to see every item.
|
|
19
|
+
*
|
|
20
|
+
* Listings that DO take a page token are not item-capped: `pageSize` already
|
|
21
|
+
* bounds them (default 20, max 100) and the cursor lets the caller continue.
|
|
22
|
+
* Their entry is only a character backstop for long message bodies.
|
|
23
|
+
*/
|
|
24
|
+
import type { ActionBound } from './factory.js';
|
|
25
|
+
/** How to fetch the rest when a body of text was cut. */
|
|
26
|
+
export declare const TEXT_HINT = "Pass full: true for the complete payload, or raise max_chars up to 100000.";
|
|
27
|
+
/** How to fetch the rest when an unpaged listing was cut. */
|
|
28
|
+
export declare const LIST_HINT = "Pass full: true for every item, or narrow the request; this listing returns one response with no cursor.";
|
|
29
|
+
/** How to fetch the rest when a paged listing hit the character backstop. */
|
|
30
|
+
export declare const PAGE_HINT = "Request another page with pageToken, or raise max_chars up to 100000.";
|
|
31
|
+
/**
|
|
32
|
+
* docs: `getText` is bounded inside the service by `limit`/`preview`, so the
|
|
33
|
+
* tool-layer bound is only needed for `getSuggestions`, which returns one entry
|
|
34
|
+
* per suggested edit -- a heavily commented document yields thousands.
|
|
35
|
+
*/
|
|
36
|
+
export declare const DOCS_BOUNDS: Record<string, ActionBound>;
|
|
37
|
+
/** slides: deck text, notes, and image lists are whole-presentation reads. */
|
|
38
|
+
export declare const SLIDES_BOUNDS: Record<string, ActionBound>;
|
|
39
|
+
/** gmail: message bodies and threads; listings page, but bodies are long. */
|
|
40
|
+
export declare const GMAIL_BOUNDS: Record<string, ActionBound>;
|
|
41
|
+
/** drive: search and comment threads page; findFolder is an exact-name lookup. */
|
|
42
|
+
export declare const DRIVE_BOUNDS: Record<string, ActionBound>;
|
|
43
|
+
/** chat: spaces, messages and threads page; findSpaceByName scans locally. */
|
|
44
|
+
export declare const CHAT_BOUNDS: Record<string, ActionBound>;
|
|
45
|
+
/** calendar: event lists, single events with descriptions, free/busy slots. */
|
|
46
|
+
export declare const CALENDAR_BOUNDS: Record<string, ActionBound>;
|
|
47
|
+
/** tasks: paged listings with long notes. */
|
|
48
|
+
export declare const TASKS_BOUNDS: Record<string, ActionBound>;
|
|
49
|
+
/** people: profiles and relations arrays. */
|
|
50
|
+
export declare const PEOPLE_BOUNDS: Record<string, ActionBound>;
|
|
51
|
+
/** forms: the definition, its items, and response payloads. */
|
|
52
|
+
export declare const FORMS_BOUNDS: Record<string, ActionBound>;
|
|
53
|
+
//# sourceMappingURL=bounds.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bounds.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/bounds.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,cAAc,CAAA;AAE/C,yDAAyD;AACzD,eAAO,MAAM,SAAS,+EAA+E,CAAA;AAErG,6DAA6D;AAC7D,eAAO,MAAM,SAAS,6GACsF,CAAA;AAE5G,6EAA6E;AAC7E,eAAO,MAAM,SAAS,0EAA0E,CAAA;AAMhG;;;;GAIG;AACH,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAEnD,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAOrD,CAAA;AAED,6EAA6E;AAC7E,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAMpD,CAAA;AAED,kFAAkF;AAClF,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAIpD,CAAA;AAED,8EAA8E;AAC9E,eAAO,MAAM,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAKnD,CAAA;AAED,+EAA+E;AAC/E,eAAO,MAAM,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAKvD,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAGpD,CAAA;AAED,6CAA6C;AAC7C,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAIrD,CAAA;AAED,+DAA+D;AAC/D,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,WAAW,CAIpD,CAAA"}
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
/** How to fetch the rest when a body of text was cut. */
|
|
2
|
+
export const TEXT_HINT = 'Pass full: true for the complete payload, or raise max_chars up to 100000.';
|
|
3
|
+
/** How to fetch the rest when an unpaged listing was cut. */
|
|
4
|
+
export const LIST_HINT = 'Pass full: true for every item, or narrow the request; this listing returns one response with no cursor.';
|
|
5
|
+
/** How to fetch the rest when a paged listing hit the character backstop. */
|
|
6
|
+
export const PAGE_HINT = 'Request another page with pageToken, or raise max_chars up to 100000.';
|
|
7
|
+
const textRead = () => ({ hint: TEXT_HINT });
|
|
8
|
+
const listRead = (items) => ({ items, hint: LIST_HINT });
|
|
9
|
+
const pagedRead = () => ({ hint: PAGE_HINT });
|
|
10
|
+
/**
|
|
11
|
+
* docs: `getText` is bounded inside the service by `limit`/`preview`, so the
|
|
12
|
+
* tool-layer bound is only needed for `getSuggestions`, which returns one entry
|
|
13
|
+
* per suggested edit -- a heavily commented document yields thousands.
|
|
14
|
+
*/
|
|
15
|
+
export const DOCS_BOUNDS = {
|
|
16
|
+
getSuggestions: listRead(100)
|
|
17
|
+
};
|
|
18
|
+
/** slides: deck text, notes, and image lists are whole-presentation reads. */
|
|
19
|
+
export const SLIDES_BOUNDS = {
|
|
20
|
+
getText: textRead(),
|
|
21
|
+
getMetadata: listRead(100),
|
|
22
|
+
getImages: listRead(100),
|
|
23
|
+
getSpeakerNotes: listRead(100)
|
|
24
|
+
// getSlideThumbnail is left whole on purpose: its payload is one base64 image,
|
|
25
|
+
// so a character cap would return a corrupt image rather than a shorter list.
|
|
26
|
+
};
|
|
27
|
+
/** gmail: message bodies and threads; listings page, but bodies are long. */
|
|
28
|
+
export const GMAIL_BOUNDS = {
|
|
29
|
+
get: textRead(),
|
|
30
|
+
search: pagedRead(),
|
|
31
|
+
listLabels: listRead(100),
|
|
32
|
+
modify: textRead(),
|
|
33
|
+
modifyThread: textRead()
|
|
34
|
+
};
|
|
35
|
+
/** drive: search and comment threads page; findFolder is an exact-name lookup. */
|
|
36
|
+
export const DRIVE_BOUNDS = {
|
|
37
|
+
search: pagedRead(),
|
|
38
|
+
getComments: pagedRead(),
|
|
39
|
+
findFolder: listRead(50)
|
|
40
|
+
};
|
|
41
|
+
/** chat: spaces, messages and threads page; findSpaceByName scans locally. */
|
|
42
|
+
export const CHAT_BOUNDS = {
|
|
43
|
+
listSpaces: pagedRead(),
|
|
44
|
+
findSpaceByName: listRead(50),
|
|
45
|
+
getMessages: pagedRead(),
|
|
46
|
+
listThreads: pagedRead()
|
|
47
|
+
};
|
|
48
|
+
/** calendar: event lists, single events with descriptions, free/busy slots. */
|
|
49
|
+
export const CALENDAR_BOUNDS = {
|
|
50
|
+
listCalendars: listRead(100),
|
|
51
|
+
listEvents: pagedRead(),
|
|
52
|
+
getEvent: textRead(),
|
|
53
|
+
findFreeTime: listRead(50)
|
|
54
|
+
};
|
|
55
|
+
/** tasks: paged listings with long notes. */
|
|
56
|
+
export const TASKS_BOUNDS = {
|
|
57
|
+
listTaskLists: pagedRead(),
|
|
58
|
+
listTasks: pagedRead()
|
|
59
|
+
};
|
|
60
|
+
/** people: profiles and relations arrays. */
|
|
61
|
+
export const PEOPLE_BOUNDS = {
|
|
62
|
+
getUserProfile: textRead(),
|
|
63
|
+
getMe: textRead(),
|
|
64
|
+
getUserRelations: listRead(50)
|
|
65
|
+
};
|
|
66
|
+
/** forms: the definition, its items, and response payloads. */
|
|
67
|
+
export const FORMS_BOUNDS = {
|
|
68
|
+
get: textRead(),
|
|
69
|
+
listResponses: pagedRead(),
|
|
70
|
+
getResponse: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EAAE,QAAQ,EAAE;CACzB,CAAA;AAED,kFAAkF;AAClF,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,MAAM,EAAE,SAAS,EAAE;IACnB,WAAW,EAAE,SAAS,EAAE;IACxB,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC;CACzB,CAAA;AAED,8EAA8E;AAC9E,MAAM,CAAC,MAAM,WAAW,GAAgC;IACtD,UAAU,EAAE,SAAS,EAAE;IACvB,eAAe,EAAE,QAAQ,CAAC,EAAE,CAAC;IAC7B,WAAW,EAAE,SAAS,EAAE;IACxB,WAAW,EAAE,SAAS,EAAE;CACzB,CAAA;AAED,+EAA+E;AAC/E,MAAM,CAAC,MAAM,eAAe,GAAgC;IAC1D,aAAa,EAAE,QAAQ,CAAC,GAAG,CAAC;IAC5B,UAAU,EAAE,SAAS,EAAE;IACvB,QAAQ,EAAE,QAAQ,EAAE;IACpB,YAAY,EAAE,QAAQ,CAAC,EAAE,CAAC;CAC3B,CAAA;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,aAAa,EAAE,SAAS,EAAE;IAC1B,SAAS,EAAE,SAAS,EAAE;CACvB,CAAA;AAED,6CAA6C;AAC7C,MAAM,CAAC,MAAM,aAAa,GAAgC;IACxD,cAAc,EAAE,QAAQ,EAAE;IAC1B,KAAK,EAAE,QAAQ,EAAE;IACjB,gBAAgB,EAAE,QAAQ,CAAC,EAAE,CAAC;CAC/B,CAAA;AAED,+DAA+D;AAC/D,MAAM,CAAC,MAAM,YAAY,GAAgC;IACvD,GAAG,EAAE,QAAQ,EAAE;IACf,aAAa,EAAE,SAAS,EAAE;IAC1B,WAAW,EAAE,QAAQ,EAAE;CACxB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/calendar.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"calendar.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/calendar.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,gBAAgB,qIASnB,CAAA;AACV,eAAO,MAAM,QAAQ,qHAGnB,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CalendarService } from '../../vendored/services/CalendarService.js';
|
|
2
|
+
import { CALENDAR_BOUNDS } from './bounds.js';
|
|
2
3
|
import { makeDomainRun } from './factory.js';
|
|
3
4
|
export const CALENDAR_ACTIONS = [
|
|
4
5
|
'listCalendars',
|
|
@@ -10,5 +11,8 @@ export const CALENDAR_ACTIONS = [
|
|
|
10
11
|
'respondToEvent',
|
|
11
12
|
'findFreeTime'
|
|
12
13
|
];
|
|
13
|
-
export const calendar = makeDomainRun(CalendarService, CALENDAR_ACTIONS
|
|
14
|
+
export const calendar = makeDomainRun(CalendarService, CALENDAR_ACTIONS, {
|
|
15
|
+
pagination: { listEvents: 'maxResults' },
|
|
16
|
+
bounds: CALENDAR_BOUNDS
|
|
17
|
+
});
|
|
14
18
|
//# sourceMappingURL=calendar.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../src/tools/domains/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAC5E,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe;IACf,aAAa;IACb,YAAY;IACZ,UAAU;IACV,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,cAAc;CACN,CAAA;AACV,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../../src/tools/domains/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,4CAA4C,CAAA;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,gBAAgB,GAAG;IAC9B,eAAe;IACf,aAAa;IACb,YAAY;IACZ,UAAU;IACV,aAAa;IACb,aAAa;IACb,gBAAgB;IAChB,cAAc;CACN,CAAA;AACV,MAAM,CAAC,MAAM,QAAQ,GAAG,aAAa,CAAC,eAAe,EAAE,gBAAgB,EAAE;IACvE,UAAU,EAAE,EAAE,UAAU,EAAE,YAAY,EAAE;IACxC,MAAM,EAAE,eAAe;CACxB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/chat.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"chat.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/chat.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,YAAY,kIASf,CAAA;AACV,eAAO,MAAM,IAAI,qHAGf,CAAA"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ChatService } from '../../vendored/services/ChatService.js';
|
|
2
|
+
import { CHAT_BOUNDS } from './bounds.js';
|
|
2
3
|
import { makeDomainRun } from './factory.js';
|
|
3
4
|
export const CHAT_ACTIONS = [
|
|
4
5
|
'listSpaces',
|
|
@@ -11,6 +12,7 @@ export const CHAT_ACTIONS = [
|
|
|
11
12
|
'setUpSpace'
|
|
12
13
|
];
|
|
13
14
|
export const chat = makeDomainRun(ChatService, CHAT_ACTIONS, {
|
|
14
|
-
pagination: { listSpaces: 'pageSize', getMessages: 'pageSize', listThreads: 'pageSize' }
|
|
15
|
+
pagination: { listSpaces: 'pageSize', getMessages: 'pageSize', listThreads: 'pageSize' },
|
|
16
|
+
bounds: CHAT_BOUNDS
|
|
15
17
|
});
|
|
16
18
|
//# sourceMappingURL=chat.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../src/tools/domains/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR,eAAe;IACf,aAAa;IACb,YAAY;CACJ,CAAA;AACV,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE;IAC3D,UAAU,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE;
|
|
1
|
+
{"version":3,"file":"chat.js","sourceRoot":"","sources":["../../../../src/tools/domains/chat.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,YAAY;IACZ,aAAa;IACb,iBAAiB;IACjB,aAAa;IACb,QAAQ;IACR,eAAe;IACf,aAAa;IACb,YAAY;CACJ,CAAA;AACV,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE;IAC3D,UAAU,EAAE,EAAE,UAAU,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE,WAAW,EAAE,UAAU,EAAE;IACxF,MAAM,EAAE,WAAW;CACpB,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;
|
|
1
|
+
{"version":3,"file":"docs.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH,eAAO,MAAM,YAAY,4FAA6F,CAAA;AAEtH,eAAO,MAAM,IAAI,qHAAoE,CAAA"}
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
* to the vendored DocsService via the generic domain factory.
|
|
5
5
|
*/
|
|
6
6
|
import { DocsService } from '../../vendored/services/DocsService.js';
|
|
7
|
+
import { DOCS_BOUNDS } from './bounds.js';
|
|
7
8
|
import { makeDomainRun } from './factory.js';
|
|
8
9
|
// Action name = DocsService method name (verbatim).
|
|
9
10
|
export const DOCS_ACTIONS = ['getText', 'create', 'writeText', 'getSuggestions', 'replaceText', 'formatText'];
|
|
10
|
-
export const docs = makeDomainRun(DocsService, DOCS_ACTIONS);
|
|
11
|
+
export const docs = makeDomainRun(DocsService, DOCS_ACTIONS, { bounds: DOCS_BOUNDS });
|
|
11
12
|
//# sourceMappingURL=docs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../../src/tools/domains/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAU,CAAA;AAEtH,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,CAAC,CAAA"}
|
|
1
|
+
{"version":3,"file":"docs.js","sourceRoot":"","sources":["../../../../src/tools/domains/docs.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAE,WAAW,EAAE,MAAM,wCAAwC,CAAA;AACpE,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAA;AACzC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAA;AAE5C,oDAAoD;AACpD,MAAM,CAAC,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,QAAQ,EAAE,WAAW,EAAE,gBAAgB,EAAE,aAAa,EAAE,YAAY,CAAU,CAAA;AAEtH,MAAM,CAAC,MAAM,IAAI,GAAG,aAAa,CAAC,WAAW,EAAE,YAAY,EAAE,EAAE,MAAM,EAAE,WAAW,EAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/drive.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"drive.d.ts","sourceRoot":"","sources":["../../../../src/tools/domains/drive.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,aAAa,yHAShB,CAAA;AACV,eAAO,MAAM,KAAK,qHAGhB,CAAA"}
|