@aaronsb/google-workspace-mcp 2.2.0 → 2.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/__tests__/server/handlers/drive.test.js +2 -15
- package/build/__tests__/server/handlers/drive.test.js.map +1 -1
- package/build/__tests__/server/session/context.test.d.ts +1 -0
- package/build/__tests__/server/session/context.test.js +101 -0
- package/build/__tests__/server/session/context.test.js.map +1 -0
- package/build/__tests__/server/session/tracker.test.d.ts +1 -0
- package/build/__tests__/server/session/tracker.test.js +146 -0
- package/build/__tests__/server/session/tracker.test.js.map +1 -0
- package/build/__tests__/services/gmail/mime.test.js +1 -161
- package/build/__tests__/services/gmail/mime.test.js.map +1 -1
- package/build/accounts/oauth.js +17 -8
- package/build/accounts/oauth.js.map +1 -1
- package/build/coverage/analyze.d.ts +13 -0
- package/build/coverage/analyze.js +49 -0
- package/build/coverage/analyze.js.map +1 -0
- package/build/coverage/baseline.d.ts +8 -0
- package/build/coverage/baseline.js +91 -0
- package/build/coverage/baseline.js.map +1 -0
- package/build/coverage/compare.d.ts +6 -0
- package/build/coverage/compare.js +129 -0
- package/build/coverage/compare.js.map +1 -0
- package/build/coverage/discover.d.ts +7 -0
- package/build/coverage/discover.js +168 -0
- package/build/coverage/discover.js.map +1 -0
- package/build/coverage/report.d.ts +6 -0
- package/build/coverage/report.js +93 -0
- package/build/coverage/report.js.map +1 -0
- package/build/coverage/types.d.ts +70 -0
- package/build/coverage/types.js +14 -0
- package/build/coverage/types.js.map +1 -0
- package/build/executor/gws.d.ts +2 -0
- package/build/executor/gws.js +2 -2
- package/build/executor/gws.js.map +1 -1
- package/build/factory/manifest.yaml +183 -6
- package/build/factory/patches.js +2 -0
- package/build/factory/patches.js.map +1 -1
- package/build/server/handler.js +36 -3
- package/build/server/handler.js.map +1 -1
- package/build/server/handlers/calendar.js +8 -4
- package/build/server/handlers/calendar.js.map +1 -1
- package/build/server/handlers/drive.js +0 -16
- package/build/server/handlers/drive.js.map +1 -1
- package/build/server/handlers/workspace.js +63 -0
- package/build/server/handlers/workspace.js.map +1 -1
- package/build/server/scratchpad/adapters/send-email-draft.d.ts +1 -0
- package/build/server/scratchpad/adapters/send-email-draft.js +29 -20
- package/build/server/scratchpad/adapters/send-email-draft.js.map +1 -1
- package/build/server/scratchpad/adapters/send-email.d.ts +2 -1
- package/build/server/scratchpad/adapters/send-email.js +31 -37
- package/build/server/scratchpad/adapters/send-email.js.map +1 -1
- package/build/server/session/context.d.ts +7 -0
- package/build/server/session/context.js +56 -0
- package/build/server/session/context.js.map +1 -0
- package/build/server/session/index.d.ts +9 -0
- package/build/server/session/index.js +14 -0
- package/build/server/session/index.js.map +1 -0
- package/build/server/session/tracker.d.ts +36 -0
- package/build/server/session/tracker.js +135 -0
- package/build/server/session/tracker.js.map +1 -0
- package/build/server/tools.js +4 -4
- package/build/server/tools.js.map +1 -1
- package/build/services/calendar/patch.js +4 -2
- package/build/services/calendar/patch.js.map +1 -1
- package/build/services/docs/patch.d.ts +8 -0
- package/build/services/docs/patch.js +72 -0
- package/build/services/docs/patch.js.map +1 -0
- package/build/services/drive/patch.js +165 -10
- package/build/services/drive/patch.js.map +1 -1
- package/build/services/gmail/mime.d.ts +4 -24
- package/build/services/gmail/mime.js +4 -93
- package/build/services/gmail/mime.js.map +1 -1
- package/build/services/gmail/patch.js +35 -38
- package/build/services/gmail/patch.js.map +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the build-time coverage analysis tool (ADR-100).
|
|
3
|
+
*/
|
|
4
|
+
/** Services eligible for the factory model. */
|
|
5
|
+
export declare const ELIGIBLE_SERVICES: readonly ["drive", "sheets", "gmail", "calendar", "docs", "slides", "tasks", "people", "chat", "keep", "meet", "events"];
|
|
6
|
+
/** Internal/path params to skip when comparing parameters. */
|
|
7
|
+
export declare const SKIP_PARAMS: Set<string>;
|
|
8
|
+
export interface DiscoveredParam {
|
|
9
|
+
type: string;
|
|
10
|
+
description: string;
|
|
11
|
+
required: boolean;
|
|
12
|
+
default?: unknown;
|
|
13
|
+
enum?: string[];
|
|
14
|
+
deprecated?: boolean;
|
|
15
|
+
}
|
|
16
|
+
export interface DiscoveredOperation {
|
|
17
|
+
resourcePath: string;
|
|
18
|
+
description: string;
|
|
19
|
+
httpMethod?: string;
|
|
20
|
+
params: Record<string, DiscoveredParam>;
|
|
21
|
+
}
|
|
22
|
+
export interface DiscoveredHelper {
|
|
23
|
+
name: string;
|
|
24
|
+
description: string;
|
|
25
|
+
}
|
|
26
|
+
export interface DiscoveredService {
|
|
27
|
+
operations: Record<string, DiscoveredOperation>;
|
|
28
|
+
helpers: Record<string, DiscoveredHelper>;
|
|
29
|
+
}
|
|
30
|
+
export interface DiscoveredSurface {
|
|
31
|
+
gwsVersion: string;
|
|
32
|
+
services: Record<string, DiscoveredService>;
|
|
33
|
+
}
|
|
34
|
+
export type BaselineStatus = 'covered' | 'gap' | 'excluded';
|
|
35
|
+
export interface BaselineEntry {
|
|
36
|
+
status: BaselineStatus;
|
|
37
|
+
reason?: string;
|
|
38
|
+
params?: Record<string, 'covered' | 'gap'>;
|
|
39
|
+
}
|
|
40
|
+
export interface CoverageBaseline {
|
|
41
|
+
gwsVersion: string;
|
|
42
|
+
generatedAt: string;
|
|
43
|
+
services: Record<string, {
|
|
44
|
+
operations: Record<string, BaselineEntry>;
|
|
45
|
+
}>;
|
|
46
|
+
}
|
|
47
|
+
export interface ParamGap {
|
|
48
|
+
paramName: string;
|
|
49
|
+
inGws: boolean;
|
|
50
|
+
inManifest: boolean;
|
|
51
|
+
details?: string;
|
|
52
|
+
}
|
|
53
|
+
export interface ServiceCoverage {
|
|
54
|
+
service: string;
|
|
55
|
+
totalOps: number;
|
|
56
|
+
coveredOps: number;
|
|
57
|
+
excludedOps: number;
|
|
58
|
+
gapOps: number;
|
|
59
|
+
newOps: string[];
|
|
60
|
+
removedOps: string[];
|
|
61
|
+
paramGaps: Record<string, ParamGap[]>;
|
|
62
|
+
}
|
|
63
|
+
export interface CoverageReport {
|
|
64
|
+
gwsVersion: string;
|
|
65
|
+
timestamp: string;
|
|
66
|
+
totalOps: number;
|
|
67
|
+
coveredOps: number;
|
|
68
|
+
coveragePercent: number;
|
|
69
|
+
services: ServiceCoverage[];
|
|
70
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Types for the build-time coverage analysis tool (ADR-100).
|
|
3
|
+
*/
|
|
4
|
+
/** Services eligible for the factory model. */
|
|
5
|
+
export const ELIGIBLE_SERVICES = [
|
|
6
|
+
'drive', 'sheets', 'gmail', 'calendar', 'docs',
|
|
7
|
+
'slides', 'tasks', 'people', 'chat', 'keep', 'meet', 'events',
|
|
8
|
+
];
|
|
9
|
+
/** Internal/path params to skip when comparing parameters. */
|
|
10
|
+
export const SKIP_PARAMS = new Set([
|
|
11
|
+
'userId', 'key', 'oauth_token', 'prettyPrint', 'quotaUser', 'alt',
|
|
12
|
+
'uploadType', 'upload_protocol', 'fields', 'callback', 'access_token',
|
|
13
|
+
]);
|
|
14
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/coverage/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,+CAA+C;AAC/C,MAAM,CAAC,MAAM,iBAAiB,GAAG;IAC/B,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,UAAU,EAAE,MAAM;IAC9C,QAAQ,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,QAAQ;CACrD,CAAC;AAEX,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC;IACjC,QAAQ,EAAE,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,WAAW,EAAE,KAAK;IACjE,YAAY,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,EAAE,cAAc;CACtE,CAAC,CAAC"}
|
package/build/executor/gws.d.ts
CHANGED
package/build/executor/gws.js
CHANGED
|
@@ -74,7 +74,7 @@ function filterStderr(stderr) {
|
|
|
74
74
|
.trim();
|
|
75
75
|
}
|
|
76
76
|
export async function execute(args, options = {}) {
|
|
77
|
-
const { account, timeout = DEFAULT_TIMEOUT, format = 'json' } = options;
|
|
77
|
+
const { account, timeout = DEFAULT_TIMEOUT, format = 'json', cwd } = options;
|
|
78
78
|
const env = { ...process.env };
|
|
79
79
|
if (account) {
|
|
80
80
|
const accessToken = await getAccessToken(account);
|
|
@@ -95,7 +95,7 @@ export async function execute(args, options = {}) {
|
|
|
95
95
|
settled = true;
|
|
96
96
|
fn();
|
|
97
97
|
} };
|
|
98
|
-
const proc = spawn(gwsBinary, fullArgs, { env, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
98
|
+
const proc = spawn(gwsBinary, fullArgs, { env, cwd, stdio: ['ignore', 'pipe', 'pipe'] });
|
|
99
99
|
let stdout = '';
|
|
100
100
|
let stderr = '';
|
|
101
101
|
// Activity-based stall detection: kill if process goes silent
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gws.js","sourceRoot":"","sources":["../../src/executor/gws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AACnE,OAAO,EAAE,cAAc,EAAE,MAAM,8BAA8B,CAAC;
|
|
1
|
+
{"version":3,"file":"gws.js","sourceRoot":"","sources":["../../src/executor/gws.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACzD,OAAO,KAAK,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O,CAAC,CAAC,WAAW,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;IACjE,OAAO,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACpC,CAAC"}
|
|
@@ -53,7 +53,7 @@ services:
|
|
|
53
53
|
|
|
54
54
|
send:
|
|
55
55
|
type: action
|
|
56
|
-
description: "compose and send a new email"
|
|
56
|
+
description: "compose and send a new email (creates draft when attachments present, 35MB attachment limit via upload endpoint)"
|
|
57
57
|
helper: "+send"
|
|
58
58
|
params:
|
|
59
59
|
to:
|
|
@@ -76,10 +76,13 @@ services:
|
|
|
76
76
|
description: "BCC email(s), comma-separated"
|
|
77
77
|
attachments:
|
|
78
78
|
type: string
|
|
79
|
-
description: "Workspace filenames to attach, comma-separated (files must exist in workspace via manage_workspace)"
|
|
79
|
+
description: "Workspace filenames to attach, comma-separated (files must exist in workspace via manage_workspace). Creates draft when present."
|
|
80
80
|
html:
|
|
81
81
|
type: boolean
|
|
82
82
|
description: "Treat body as HTML content (default: plain text)"
|
|
83
|
+
draft:
|
|
84
|
+
type: boolean
|
|
85
|
+
description: "Save as draft instead of sending (default: false, forced true when attachments present)"
|
|
83
86
|
cli_args:
|
|
84
87
|
to: "--to"
|
|
85
88
|
subject: "--subject"
|
|
@@ -127,7 +130,7 @@ services:
|
|
|
127
130
|
|
|
128
131
|
forward:
|
|
129
132
|
type: action
|
|
130
|
-
description: "forward a message to new recipients"
|
|
133
|
+
description: "forward a message to new recipients (includes original attachments by default)"
|
|
131
134
|
helper: "+forward"
|
|
132
135
|
params:
|
|
133
136
|
messageId:
|
|
@@ -284,9 +287,12 @@ services:
|
|
|
284
287
|
|
|
285
288
|
list:
|
|
286
289
|
type: list
|
|
287
|
-
description: "upcoming events
|
|
290
|
+
description: "upcoming events — defaults to primary calendar, use calendarId to target a specific calendar (use 'calendars' operation to discover IDs)"
|
|
288
291
|
resource: events.list
|
|
289
292
|
params:
|
|
293
|
+
calendarId:
|
|
294
|
+
type: string
|
|
295
|
+
description: "Calendar ID to query (default: 'primary'). Use 'calendars' operation to list available IDs."
|
|
290
296
|
timeMin:
|
|
291
297
|
type: string
|
|
292
298
|
description: "Start of range (ISO 8601) — defaults to today"
|
|
@@ -317,6 +323,9 @@ services:
|
|
|
317
323
|
description: "full event details by ID"
|
|
318
324
|
resource: events.get
|
|
319
325
|
params:
|
|
326
|
+
calendarId:
|
|
327
|
+
type: string
|
|
328
|
+
description: "Calendar ID (default: 'primary')"
|
|
320
329
|
eventId:
|
|
321
330
|
type: string
|
|
322
331
|
description: "Event ID"
|
|
@@ -331,6 +340,9 @@ services:
|
|
|
331
340
|
description: "create a new calendar event"
|
|
332
341
|
helper: "+insert"
|
|
333
342
|
params:
|
|
343
|
+
calendarId:
|
|
344
|
+
type: string
|
|
345
|
+
description: "Calendar ID (default: 'primary')"
|
|
334
346
|
summary:
|
|
335
347
|
type: string
|
|
336
348
|
description: "Event title"
|
|
@@ -353,6 +365,7 @@ services:
|
|
|
353
365
|
type: string
|
|
354
366
|
description: "Comma-separated attendee emails"
|
|
355
367
|
cli_args:
|
|
368
|
+
calendarId: "--calendar"
|
|
356
369
|
summary: "--summary"
|
|
357
370
|
start: "--start"
|
|
358
371
|
end: "--end"
|
|
@@ -365,6 +378,9 @@ services:
|
|
|
365
378
|
description: "create event from natural language (e.g. 'Lunch with Alice tomorrow at noon')"
|
|
366
379
|
resource: events.quickAdd
|
|
367
380
|
params:
|
|
381
|
+
calendarId:
|
|
382
|
+
type: string
|
|
383
|
+
description: "Calendar ID (default: 'primary')"
|
|
368
384
|
text:
|
|
369
385
|
type: string
|
|
370
386
|
description: "Natural language event description"
|
|
@@ -377,6 +393,9 @@ services:
|
|
|
377
393
|
description: "update an existing event (patch semantics — only changed fields needed)"
|
|
378
394
|
resource: events.patch
|
|
379
395
|
params:
|
|
396
|
+
calendarId:
|
|
397
|
+
type: string
|
|
398
|
+
description: "Calendar ID (default: 'primary')"
|
|
380
399
|
eventId:
|
|
381
400
|
type: string
|
|
382
401
|
description: "Event ID to update"
|
|
@@ -404,6 +423,9 @@ services:
|
|
|
404
423
|
description: "delete an event"
|
|
405
424
|
resource: events.delete
|
|
406
425
|
params:
|
|
426
|
+
calendarId:
|
|
427
|
+
type: string
|
|
428
|
+
description: "Calendar ID (default: 'primary')"
|
|
407
429
|
eventId:
|
|
408
430
|
type: string
|
|
409
431
|
description: "Event ID to delete"
|
|
@@ -434,7 +456,7 @@ services:
|
|
|
434
456
|
|
|
435
457
|
drive:
|
|
436
458
|
tool_name: manage_drive
|
|
437
|
-
description: "Search, upload, download, share, or manage files in Google Drive."
|
|
459
|
+
description: "Search, upload, download, share, comment on, or manage files in Google Drive."
|
|
438
460
|
requires_email: true
|
|
439
461
|
gws_service: drive
|
|
440
462
|
operations:
|
|
@@ -458,6 +480,8 @@ services:
|
|
|
458
480
|
maps_to: pageSize
|
|
459
481
|
defaults:
|
|
460
482
|
fields: "files(id, name, mimeType, modifiedTime, size, webViewLink)"
|
|
483
|
+
supportsAllDrives: true
|
|
484
|
+
includeItemsFromAllDrives: true
|
|
461
485
|
|
|
462
486
|
get:
|
|
463
487
|
type: detail
|
|
@@ -470,6 +494,7 @@ services:
|
|
|
470
494
|
required: true
|
|
471
495
|
defaults:
|
|
472
496
|
fields: "id, name, mimeType, modifiedTime, size, webViewLink, owners, shared, parents"
|
|
497
|
+
supportsAllDrives: true
|
|
473
498
|
|
|
474
499
|
# --- File operations ---
|
|
475
500
|
|
|
@@ -501,6 +526,8 @@ services:
|
|
|
501
526
|
type: string
|
|
502
527
|
description: "File ID of the image to view"
|
|
503
528
|
required: true
|
|
529
|
+
defaults:
|
|
530
|
+
supportsAllDrives: true
|
|
504
531
|
|
|
505
532
|
download:
|
|
506
533
|
type: detail
|
|
@@ -516,6 +543,7 @@ services:
|
|
|
516
543
|
description: "Local path to save the file"
|
|
517
544
|
defaults:
|
|
518
545
|
alt: media
|
|
546
|
+
supportsAllDrives: true
|
|
519
547
|
|
|
520
548
|
copy:
|
|
521
549
|
type: action
|
|
@@ -529,6 +557,8 @@ services:
|
|
|
529
557
|
name:
|
|
530
558
|
type: string
|
|
531
559
|
description: "Name for the copy"
|
|
560
|
+
defaults:
|
|
561
|
+
supportsAllDrives: true
|
|
532
562
|
|
|
533
563
|
delete:
|
|
534
564
|
type: action
|
|
@@ -539,6 +569,8 @@ services:
|
|
|
539
569
|
type: string
|
|
540
570
|
description: "File ID to delete"
|
|
541
571
|
required: true
|
|
572
|
+
defaults:
|
|
573
|
+
supportsAllDrives: true
|
|
542
574
|
|
|
543
575
|
export:
|
|
544
576
|
type: action
|
|
@@ -556,6 +588,8 @@ services:
|
|
|
556
588
|
outputPath:
|
|
557
589
|
type: string
|
|
558
590
|
description: "Local path to save exported file"
|
|
591
|
+
defaults:
|
|
592
|
+
supportsAllDrives: true
|
|
559
593
|
|
|
560
594
|
# --- Sharing ---
|
|
561
595
|
|
|
@@ -568,6 +602,8 @@ services:
|
|
|
568
602
|
type: string
|
|
569
603
|
description: "File ID"
|
|
570
604
|
required: true
|
|
605
|
+
defaults:
|
|
606
|
+
supportsAllDrives: true
|
|
571
607
|
|
|
572
608
|
share:
|
|
573
609
|
type: action
|
|
@@ -587,6 +623,8 @@ services:
|
|
|
587
623
|
description: "Permission level"
|
|
588
624
|
enum: [reader, commenter, writer, organizer]
|
|
589
625
|
default: reader
|
|
626
|
+
defaults:
|
|
627
|
+
supportsAllDrives: true
|
|
590
628
|
|
|
591
629
|
unshare:
|
|
592
630
|
type: action
|
|
@@ -601,6 +639,105 @@ services:
|
|
|
601
639
|
type: string
|
|
602
640
|
description: "Permission ID to remove (from listPermissions)"
|
|
603
641
|
required: true
|
|
642
|
+
defaults:
|
|
643
|
+
supportsAllDrives: true
|
|
644
|
+
|
|
645
|
+
# --- Comments ---
|
|
646
|
+
|
|
647
|
+
listComments:
|
|
648
|
+
type: list
|
|
649
|
+
description: "list comments on a file"
|
|
650
|
+
resource: comments.list
|
|
651
|
+
params:
|
|
652
|
+
fileId:
|
|
653
|
+
type: string
|
|
654
|
+
description: "File ID"
|
|
655
|
+
required: true
|
|
656
|
+
includeDeleted:
|
|
657
|
+
type: boolean
|
|
658
|
+
description: "Include deleted comments (default: false)"
|
|
659
|
+
defaults:
|
|
660
|
+
fields: "comments(id, content, htmlContent, author(displayName, emailAddress), createdTime, modifiedTime, resolved, quotedFileContent, replies(id, content, htmlContent, author(displayName), createdTime)), nextPageToken"
|
|
661
|
+
supportsAllDrives: true
|
|
662
|
+
|
|
663
|
+
getComment:
|
|
664
|
+
type: detail
|
|
665
|
+
description: "get a specific comment by ID"
|
|
666
|
+
resource: comments.get
|
|
667
|
+
params:
|
|
668
|
+
fileId:
|
|
669
|
+
type: string
|
|
670
|
+
description: "File ID"
|
|
671
|
+
required: true
|
|
672
|
+
commentId:
|
|
673
|
+
type: string
|
|
674
|
+
description: "Comment ID"
|
|
675
|
+
required: true
|
|
676
|
+
defaults:
|
|
677
|
+
fields: "id, content, htmlContent, author(displayName, emailAddress), createdTime, modifiedTime, resolved, quotedFileContent, replies(id, content, htmlContent, author(displayName), createdTime)"
|
|
678
|
+
supportsAllDrives: true
|
|
679
|
+
|
|
680
|
+
addComment:
|
|
681
|
+
type: action
|
|
682
|
+
description: "add a comment to a file (optionally anchored to quoted text)"
|
|
683
|
+
resource: comments.create
|
|
684
|
+
params:
|
|
685
|
+
fileId:
|
|
686
|
+
type: string
|
|
687
|
+
description: "File ID"
|
|
688
|
+
required: true
|
|
689
|
+
content:
|
|
690
|
+
type: string
|
|
691
|
+
description: "Comment text"
|
|
692
|
+
required: true
|
|
693
|
+
quotedText:
|
|
694
|
+
type: string
|
|
695
|
+
description: "Text to anchor the comment to (optional — if provided, comment is anchored to first occurrence)"
|
|
696
|
+
defaults:
|
|
697
|
+
fields: "id, content, htmlContent, author(displayName), createdTime, quotedFileContent"
|
|
698
|
+
supportsAllDrives: true
|
|
699
|
+
|
|
700
|
+
resolveComment:
|
|
701
|
+
type: action
|
|
702
|
+
description: "resolve or reopen a comment"
|
|
703
|
+
resource: comments.update
|
|
704
|
+
params:
|
|
705
|
+
fileId:
|
|
706
|
+
type: string
|
|
707
|
+
description: "File ID"
|
|
708
|
+
required: true
|
|
709
|
+
commentId:
|
|
710
|
+
type: string
|
|
711
|
+
description: "Comment ID"
|
|
712
|
+
required: true
|
|
713
|
+
resolved:
|
|
714
|
+
type: boolean
|
|
715
|
+
description: "true to resolve, false to reopen"
|
|
716
|
+
required: true
|
|
717
|
+
defaults:
|
|
718
|
+
fields: "id, content, resolved"
|
|
719
|
+
supportsAllDrives: true
|
|
720
|
+
|
|
721
|
+
replyToComment:
|
|
722
|
+
type: action
|
|
723
|
+
description: "reply to an existing comment"
|
|
724
|
+
resource: replies.create
|
|
725
|
+
params:
|
|
726
|
+
fileId:
|
|
727
|
+
type: string
|
|
728
|
+
description: "File ID"
|
|
729
|
+
required: true
|
|
730
|
+
commentId:
|
|
731
|
+
type: string
|
|
732
|
+
description: "Comment ID to reply to"
|
|
733
|
+
required: true
|
|
734
|
+
content:
|
|
735
|
+
type: string
|
|
736
|
+
description: "Reply text"
|
|
737
|
+
required: true
|
|
738
|
+
defaults:
|
|
739
|
+
fields: "id, content, htmlContent, author(displayName), createdTime"
|
|
740
|
+
supportsAllDrives: true
|
|
604
741
|
|
|
605
742
|
# ========================================================================
|
|
606
743
|
# Sheets
|
|
@@ -699,7 +836,7 @@ services:
|
|
|
699
836
|
|
|
700
837
|
docs:
|
|
701
838
|
tool_name: manage_docs
|
|
702
|
-
description: "Read and
|
|
839
|
+
description: "Read, write, insert, and find-replace text in Google Docs documents."
|
|
703
840
|
requires_email: true
|
|
704
841
|
gws_service: docs
|
|
705
842
|
operations:
|
|
@@ -736,6 +873,46 @@ services:
|
|
|
736
873
|
documentId: "--document"
|
|
737
874
|
text: "--text"
|
|
738
875
|
|
|
876
|
+
insertText:
|
|
877
|
+
type: action
|
|
878
|
+
description: "insert text at a specific position in a document"
|
|
879
|
+
resource: documents.batchUpdate
|
|
880
|
+
params:
|
|
881
|
+
documentId:
|
|
882
|
+
type: string
|
|
883
|
+
description: "Document ID"
|
|
884
|
+
required: true
|
|
885
|
+
text:
|
|
886
|
+
type: string
|
|
887
|
+
description: "Text to insert"
|
|
888
|
+
required: true
|
|
889
|
+
index:
|
|
890
|
+
type: number
|
|
891
|
+
description: "Character index to insert at (1 = start of document body)"
|
|
892
|
+
required: true
|
|
893
|
+
|
|
894
|
+
replaceText:
|
|
895
|
+
type: action
|
|
896
|
+
description: "find and replace text in a document"
|
|
897
|
+
resource: documents.batchUpdate
|
|
898
|
+
params:
|
|
899
|
+
documentId:
|
|
900
|
+
type: string
|
|
901
|
+
description: "Document ID"
|
|
902
|
+
required: true
|
|
903
|
+
findText:
|
|
904
|
+
type: string
|
|
905
|
+
description: "Text to find"
|
|
906
|
+
required: true
|
|
907
|
+
replaceWith:
|
|
908
|
+
type: string
|
|
909
|
+
description: "Replacement text"
|
|
910
|
+
required: true
|
|
911
|
+
matchCase:
|
|
912
|
+
type: boolean
|
|
913
|
+
description: "Case-sensitive match (default: true)"
|
|
914
|
+
default: true
|
|
915
|
+
|
|
739
916
|
# ========================================================================
|
|
740
917
|
# Tasks
|
|
741
918
|
# ========================================================================
|
package/build/factory/patches.js
CHANGED
|
@@ -5,11 +5,13 @@
|
|
|
5
5
|
import { gmailPatch } from '../services/gmail/patch.js';
|
|
6
6
|
import { calendarPatch } from '../services/calendar/patch.js';
|
|
7
7
|
import { drivePatch } from '../services/drive/patch.js';
|
|
8
|
+
import { docsPatch } from '../services/docs/patch.js';
|
|
8
9
|
import { meetPatch } from '../services/meet/patch.js';
|
|
9
10
|
export const patches = {
|
|
10
11
|
gmail: gmailPatch,
|
|
11
12
|
calendar: calendarPatch,
|
|
12
13
|
drive: drivePatch,
|
|
14
|
+
docs: docsPatch,
|
|
13
15
|
meet: meetPatch,
|
|
14
16
|
};
|
|
15
17
|
//# sourceMappingURL=patches.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"patches.js","sourceRoot":"","sources":["../../src/factory/patches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,MAAM,CAAC,MAAM,OAAO,GAAiC;IACnD,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,SAAS;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"patches.js","sourceRoot":"","sources":["../../src/factory/patches.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACxD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AACtD,OAAO,EAAE,SAAS,EAAE,MAAM,2BAA2B,CAAC;AAGtD,MAAM,CAAC,MAAM,OAAO,GAAiC;IACnD,KAAK,EAAE,UAAU;IACjB,QAAQ,EAAE,aAAa;IACvB,KAAK,EAAE,UAAU;IACjB,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;CAChB,CAAC"}
|
package/build/server/handler.js
CHANGED
|
@@ -3,6 +3,7 @@ import { handleWorkspace } from './handlers/workspace.js';
|
|
|
3
3
|
import { handleScratchpad } from './scratchpad/handler.js';
|
|
4
4
|
import { handleQueue } from './queue.js';
|
|
5
5
|
import { generatedTools } from '../factory/registry.js';
|
|
6
|
+
import { getSessionTracker, sessionContext } from './session/index.js';
|
|
6
7
|
// ── Epoch counter ─────────────────────────────────────────
|
|
7
8
|
// Server-wide monotonic counter incremented on every tool call.
|
|
8
9
|
// Used by ScratchpadManager for activity-based garbage collection.
|
|
@@ -26,15 +27,47 @@ for (const tool of generatedTools) {
|
|
|
26
27
|
domainHandlers[tool.schema.name] = tool.handler;
|
|
27
28
|
}
|
|
28
29
|
export async function handleToolCall(toolName, params) {
|
|
29
|
-
advanceEpoch();
|
|
30
|
+
const currentEpoch = advanceEpoch();
|
|
31
|
+
const tracker = getSessionTracker();
|
|
30
32
|
// Queue wraps the domain handlers (each queued op also advances the epoch)
|
|
31
33
|
if (toolName === 'queue_operations') {
|
|
32
|
-
|
|
34
|
+
const result = await handleQueue(params, domainHandlers);
|
|
35
|
+
const queueEmail = extractEmailFromQueue(params);
|
|
36
|
+
if (queueEmail) {
|
|
37
|
+
await tracker.ensureBaseline(queueEmail, currentEpoch);
|
|
38
|
+
tracker.refresh(queueEmail, currentEpoch);
|
|
39
|
+
const ctx = sessionContext(toolName, queueEmail, tracker);
|
|
40
|
+
if (ctx)
|
|
41
|
+
result.text += ctx;
|
|
42
|
+
}
|
|
43
|
+
return result;
|
|
33
44
|
}
|
|
34
45
|
const handler = domainHandlers[toolName];
|
|
35
46
|
if (!handler) {
|
|
36
47
|
throw new Error(`Unknown tool: ${toolName}`);
|
|
37
48
|
}
|
|
38
|
-
|
|
49
|
+
const email = typeof params.email === 'string' ? params.email : undefined;
|
|
50
|
+
if (email) {
|
|
51
|
+
await tracker.ensureBaseline(email, currentEpoch);
|
|
52
|
+
}
|
|
53
|
+
const result = await handler(params);
|
|
54
|
+
if (email) {
|
|
55
|
+
tracker.refresh(email, currentEpoch);
|
|
56
|
+
const ctx = sessionContext(toolName, email, tracker);
|
|
57
|
+
if (ctx)
|
|
58
|
+
result.text += ctx;
|
|
59
|
+
}
|
|
60
|
+
return result;
|
|
61
|
+
}
|
|
62
|
+
/** Extract email from the first queue operation that has one. */
|
|
63
|
+
function extractEmailFromQueue(params) {
|
|
64
|
+
const operations = params.operations;
|
|
65
|
+
if (!Array.isArray(operations))
|
|
66
|
+
return undefined;
|
|
67
|
+
for (const op of operations) {
|
|
68
|
+
if (typeof op.args?.email === 'string')
|
|
69
|
+
return op.args.email;
|
|
70
|
+
}
|
|
71
|
+
return undefined;
|
|
39
72
|
}
|
|
40
73
|
//# sourceMappingURL=handler.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/server/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"handler.js","sourceRoot":"","sources":["../../src/server/handler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAC1D,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAOvE,6DAA6D;AAC7D,gEAAgE;AAChE,mEAAmE;AAEnE,IAAI,KAAK,GAAG,CAAC,CAAC;AAEd,2BAA2B;AAC3B,MAAM,UAAU,QAAQ;IACtB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,yEAAyE;AACzE,MAAM,UAAU,YAAY;IAC1B,OAAO,EAAE,KAAK,CAAC;AACjB,CAAC;AAED,6DAA6D;AAE7D,MAAM,cAAc,GAAgC;IAClD,eAAe,EAAE,c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AAE,CAAC;QACV,MAAM,OAAO,CAAC,cAAc,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;IACpD,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,CAAC;IAErC,IAAI,KAAK,EAAE,CAAC;QACV,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,YAAY,CAAC,CAAC;QACrC,MAAM,GAAG,GAAG,cAAc,CAAC,QAAQ,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;QACrD,IAAI,GAAG;YAAE,MAAM,CAAC,IAAI,IAAI,GAAG,CAAC;IAC9B,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,iEAAiE;AACjE,SAAS,qBAAqB,CAAC,MAA+B;IAC5D,MAAM,UAAU,GAAG,MAAM,CAAC,UAAmE,CAAC;IAC9F,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC;QAAE,OAAO,SAAS,CAAC;IACjD,KAAK,MAAM,EAAE,IAAI,UAAU,EAAE,CAAC;QAC5B,IAAI,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC;IAC/D,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -9,10 +9,11 @@ export async function handleCalendar(params) {
|
|
|
9
9
|
case 'list': {
|
|
10
10
|
const now = new Date();
|
|
11
11
|
const todayStart = new Date(now.getFullYear(), now.getMonth(), now.getDate()).toISOString();
|
|
12
|
+
const calendarId = params.calendarId || 'primary';
|
|
12
13
|
const result = await execute([
|
|
13
14
|
'calendar', 'events', 'list',
|
|
14
15
|
'--params', JSON.stringify({
|
|
15
|
-
calendarId
|
|
16
|
+
calendarId,
|
|
16
17
|
timeMin: params.timeMin || todayStart,
|
|
17
18
|
timeMax: params.timeMax || undefined,
|
|
18
19
|
maxResults: clamp(params.maxResults, 10, 50),
|
|
@@ -45,7 +46,8 @@ export async function handleCalendar(params) {
|
|
|
45
46
|
const summary = requireString(params, 'summary');
|
|
46
47
|
const start = requireString(params, 'start');
|
|
47
48
|
const end = requireString(params, 'end');
|
|
48
|
-
const
|
|
49
|
+
const calendarId = params.calendarId || 'primary';
|
|
50
|
+
const args = ['calendar', '+insert', '--calendar', calendarId, '--summary', summary, '--start', start, '--end', end];
|
|
49
51
|
if (params.description)
|
|
50
52
|
args.push('--description', String(params.description));
|
|
51
53
|
if (params.location)
|
|
@@ -65,9 +67,10 @@ export async function handleCalendar(params) {
|
|
|
65
67
|
}
|
|
66
68
|
case 'get': {
|
|
67
69
|
const eventId = requireString(params, 'eventId');
|
|
70
|
+
const calendarId = params.calendarId || 'primary';
|
|
68
71
|
const result = await execute([
|
|
69
72
|
'calendar', 'events', 'get',
|
|
70
|
-
'--params', JSON.stringify({ calendarId
|
|
73
|
+
'--params', JSON.stringify({ calendarId, eventId }),
|
|
71
74
|
], { account: email });
|
|
72
75
|
const formatted = formatEventDetail(result.data);
|
|
73
76
|
return {
|
|
@@ -77,9 +80,10 @@ export async function handleCalendar(params) {
|
|
|
77
80
|
}
|
|
78
81
|
case 'delete': {
|
|
79
82
|
const eventId = requireString(params, 'eventId');
|
|
83
|
+
const calendarId = params.calendarId || 'primary';
|
|
80
84
|
await execute([
|
|
81
85
|
'calendar', 'events', 'delete',
|
|
82
|
-
'--params', JSON.stringify({ calendarId
|
|
86
|
+
'--params', JSON.stringify({ calendarId, eventId }),
|
|
83
87
|
], { account: email });
|
|
84
88
|
return {
|
|
85
89
|
text: `Event deleted: ${eventId}` + nextSteps('calendar', 'delete', { email }),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"calendar.js","sourceRoot":"","sources":["../../../src/server/handlers/calendar.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,uBAAuB,CAAC;AAChD,OAAO,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,2BAA2B,CAAC;AAC/E,O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