@ganju/utils 0.0.10 → 0.0.12
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/dist/constants.d.ts +12 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +75 -0
- package/dist/index.d.ts +153 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +17 -0
- package/dist/schema.d.ts +67 -2
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +30 -4
- package/dist/syncableResource.d.ts +5 -0
- package/dist/syncableResource.d.ts.map +1 -1
- package/dist/syncableResource.js +13 -1
- package/dist/toolCatalog.d.ts +69 -0
- package/dist/toolCatalog.d.ts.map +1 -1
- package/dist/toolCatalog.js +150 -62
- package/dist/toolConfirmation.d.ts +58 -0
- package/dist/toolConfirmation.d.ts.map +1 -0
- package/dist/toolConfirmation.js +239 -0
- package/dist/toolLint.d.ts +35 -0
- package/dist/toolLint.d.ts.map +1 -0
- package/dist/toolLint.js +211 -0
- package/package.json +6 -1
- package/src/constants.ts +81 -0
- package/src/index.ts +58 -1
- package/src/schema.ts +41 -6
- package/src/syncableResource.ts +20 -0
- package/src/toolCatalog.ts +169 -62
- package/src/toolConfirmation.ts +291 -0
- package/src/toolLint.ts +277 -0
package/dist/toolCatalog.js
CHANGED
|
@@ -17,6 +17,31 @@
|
|
|
17
17
|
// same key. TypeScript fails the build until both exist.
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
19
|
exports.describeCatalogTool = exports.isToolKey = exports.findCatalogGroup = exports.findCatalogTool = exports.TOOL_KEYS = exports.TOOL_CATALOG = void 0;
|
|
20
|
+
const READ_ONLY = {
|
|
21
|
+
readOnlyHint: true,
|
|
22
|
+
destructiveHint: false,
|
|
23
|
+
openWorldHint: false
|
|
24
|
+
};
|
|
25
|
+
const WEB_READ = {
|
|
26
|
+
readOnlyHint: true,
|
|
27
|
+
destructiveHint: false,
|
|
28
|
+
openWorldHint: true
|
|
29
|
+
};
|
|
30
|
+
const WRITE = {
|
|
31
|
+
readOnlyHint: false,
|
|
32
|
+
destructiveHint: false,
|
|
33
|
+
openWorldHint: false
|
|
34
|
+
};
|
|
35
|
+
const REACHES_OTHERS = {
|
|
36
|
+
readOnlyHint: false,
|
|
37
|
+
destructiveHint: true,
|
|
38
|
+
openWorldHint: true
|
|
39
|
+
};
|
|
40
|
+
const DELETES = {
|
|
41
|
+
readOnlyHint: false,
|
|
42
|
+
destructiveHint: true,
|
|
43
|
+
openWorldHint: false
|
|
44
|
+
};
|
|
20
45
|
// Ordered deliberately: the query this replaced had no ORDER BY, so the cards
|
|
21
46
|
// rendered in whatever order Postgres returned them and could change between
|
|
22
47
|
// deploys. Integrations first, then the platform's own groups, then the three
|
|
@@ -33,109 +58,127 @@ exports.TOOL_CATALOG = [
|
|
|
33
58
|
key: 'gmail-batch-modify-labels',
|
|
34
59
|
title: 'Batch Modify Labels',
|
|
35
60
|
description: 'Add or remove labels on many emails at once (archive, mark read, etc.).',
|
|
36
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify'
|
|
61
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify',
|
|
62
|
+
annotations: WRITE
|
|
37
63
|
},
|
|
38
64
|
{
|
|
39
65
|
key: 'gmail-create-draft',
|
|
40
66
|
title: 'Create Draft',
|
|
41
67
|
description: 'Save a new draft in Gmail without sending it yet.',
|
|
42
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose'
|
|
68
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose',
|
|
69
|
+
annotations: WRITE
|
|
43
70
|
},
|
|
44
71
|
{
|
|
45
72
|
key: 'gmail-delete-draft',
|
|
46
73
|
title: 'Delete Draft',
|
|
47
74
|
description: 'Permanently delete a draft.',
|
|
48
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose'
|
|
75
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose',
|
|
76
|
+
annotations: DELETES
|
|
49
77
|
},
|
|
50
78
|
{
|
|
51
79
|
key: 'gmail-forward-email',
|
|
52
80
|
title: 'Forward Email',
|
|
53
81
|
description: 'Forward an email to a new recipient.',
|
|
54
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.send'
|
|
82
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.send',
|
|
83
|
+
annotations: REACHES_OTHERS
|
|
55
84
|
},
|
|
56
85
|
{
|
|
57
86
|
key: 'gmail-get-draft',
|
|
58
87
|
title: 'Get Draft',
|
|
59
88
|
description: 'Open a saved draft to review its contents.',
|
|
60
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose'
|
|
89
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose',
|
|
90
|
+
annotations: READ_ONLY
|
|
61
91
|
},
|
|
62
92
|
{
|
|
63
93
|
key: 'gmail-get-profile',
|
|
64
94
|
title: 'Get Profile',
|
|
65
95
|
description: 'Show the email address and inbox stats for the connected Gmail account.',
|
|
66
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly'
|
|
96
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly',
|
|
97
|
+
annotations: READ_ONLY
|
|
67
98
|
},
|
|
68
99
|
{
|
|
69
100
|
key: 'gmail-get-thread',
|
|
70
101
|
title: 'Get Thread',
|
|
71
102
|
description: 'See every message inside one conversation.',
|
|
72
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly'
|
|
103
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly',
|
|
104
|
+
annotations: READ_ONLY
|
|
73
105
|
},
|
|
74
106
|
{
|
|
75
107
|
key: 'gmail-list-drafts',
|
|
76
108
|
title: 'List Drafts',
|
|
77
109
|
description: 'Browse your saved drafts.',
|
|
78
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose'
|
|
110
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose',
|
|
111
|
+
annotations: READ_ONLY
|
|
79
112
|
},
|
|
80
113
|
{
|
|
81
114
|
key: 'gmail-list-emails',
|
|
82
115
|
title: 'List Emails',
|
|
83
116
|
description: 'Browse your Gmail inbox, with optional search filters.',
|
|
84
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly'
|
|
117
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly',
|
|
118
|
+
annotations: READ_ONLY
|
|
85
119
|
},
|
|
86
120
|
{
|
|
87
121
|
key: 'gmail-list-labels',
|
|
88
122
|
title: 'List Labels',
|
|
89
123
|
description: 'See all of your Gmail labels and folders.',
|
|
90
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.labels'
|
|
124
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.labels',
|
|
125
|
+
annotations: READ_ONLY
|
|
91
126
|
},
|
|
92
127
|
{
|
|
93
128
|
key: 'gmail-list-threads',
|
|
94
129
|
title: 'List Threads',
|
|
95
130
|
description: 'List your Gmail conversations.',
|
|
96
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly'
|
|
131
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly',
|
|
132
|
+
annotations: READ_ONLY
|
|
97
133
|
},
|
|
98
134
|
{
|
|
99
135
|
key: 'gmail-modify-labels',
|
|
100
136
|
title: 'Modify Labels',
|
|
101
137
|
description: 'Add or remove labels on a single email — archive it, mark it read, star it, and more.',
|
|
102
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify'
|
|
138
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify',
|
|
139
|
+
annotations: WRITE
|
|
103
140
|
},
|
|
104
141
|
{
|
|
105
142
|
key: 'gmail-read-email',
|
|
106
143
|
title: 'Read Email',
|
|
107
144
|
description: 'Open and read a specific email.',
|
|
108
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly'
|
|
145
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.readonly',
|
|
146
|
+
annotations: READ_ONLY
|
|
109
147
|
},
|
|
110
148
|
{
|
|
111
149
|
key: 'gmail-reply-email',
|
|
112
150
|
title: 'Reply Email',
|
|
113
151
|
description: 'Reply to an email so the response stays in the same conversation.',
|
|
114
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.send'
|
|
152
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.send',
|
|
153
|
+
annotations: REACHES_OTHERS
|
|
115
154
|
},
|
|
116
155
|
{
|
|
117
156
|
key: 'gmail-send-draft',
|
|
118
157
|
title: 'Send Draft',
|
|
119
158
|
description: "Send a draft you've already saved.",
|
|
120
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.send'
|
|
159
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.send',
|
|
160
|
+
annotations: REACHES_OTHERS
|
|
121
161
|
},
|
|
122
162
|
{
|
|
123
163
|
key: 'gmail-send-email',
|
|
124
164
|
title: 'Send Email',
|
|
125
165
|
description: 'Compose and send a new email from your connected Gmail account.',
|
|
126
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.send'
|
|
166
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.send',
|
|
167
|
+
annotations: REACHES_OTHERS
|
|
127
168
|
},
|
|
128
169
|
{
|
|
129
170
|
key: 'gmail-trash-email',
|
|
130
171
|
title: 'Move to Trash',
|
|
131
172
|
description: 'Move an email to Trash. It stays recoverable for 30 days.',
|
|
132
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify'
|
|
173
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.modify',
|
|
174
|
+
annotations: DELETES
|
|
133
175
|
},
|
|
134
176
|
{
|
|
135
177
|
key: 'gmail-update-draft',
|
|
136
178
|
title: 'Update Draft',
|
|
137
179
|
description: 'Edit the contents of a saved draft.',
|
|
138
|
-
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose'
|
|
180
|
+
requiredScopes: 'https://www.googleapis.com/auth/gmail.compose',
|
|
181
|
+
annotations: WRITE
|
|
139
182
|
}
|
|
140
183
|
]
|
|
141
184
|
},
|
|
@@ -150,109 +193,127 @@ exports.TOOL_CATALOG = [
|
|
|
150
193
|
key: 'outlook-batch-move-messages',
|
|
151
194
|
title: 'Batch Move Messages',
|
|
152
195
|
description: 'Move up to 20 messages to the same folder.',
|
|
153
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
196
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
197
|
+
annotations: WRITE
|
|
154
198
|
},
|
|
155
199
|
{
|
|
156
200
|
key: 'outlook-create-draft',
|
|
157
201
|
title: 'Create Draft',
|
|
158
202
|
description: 'Create a draft email saved in Drafts.',
|
|
159
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
203
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
204
|
+
annotations: WRITE
|
|
160
205
|
},
|
|
161
206
|
{
|
|
162
207
|
key: 'outlook-delete-draft',
|
|
163
208
|
title: 'Delete Draft',
|
|
164
209
|
description: 'Permanently delete a draft.',
|
|
165
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
210
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
211
|
+
annotations: DELETES
|
|
166
212
|
},
|
|
167
213
|
{
|
|
168
214
|
key: 'outlook-forward-email',
|
|
169
215
|
title: 'Forward',
|
|
170
216
|
description: 'Forward an existing message to a new recipient.',
|
|
171
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Send'
|
|
217
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Send',
|
|
218
|
+
annotations: REACHES_OTHERS
|
|
172
219
|
},
|
|
173
220
|
{
|
|
174
221
|
key: 'outlook-get-draft',
|
|
175
222
|
title: 'Get Draft',
|
|
176
223
|
description: 'Read the full contents of a draft.',
|
|
177
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
224
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
225
|
+
annotations: READ_ONLY
|
|
178
226
|
},
|
|
179
227
|
{
|
|
180
228
|
key: 'outlook-get-profile',
|
|
181
229
|
title: 'Get Profile',
|
|
182
230
|
description: "Get the connected account's profile and inbox totals.",
|
|
183
|
-
requiredScopes: 'https://graph.microsoft.com/User.Read'
|
|
231
|
+
requiredScopes: 'https://graph.microsoft.com/User.Read',
|
|
232
|
+
annotations: READ_ONLY
|
|
184
233
|
},
|
|
185
234
|
{
|
|
186
235
|
key: 'outlook-get-thread',
|
|
187
236
|
title: 'Get Thread',
|
|
188
237
|
description: 'Get summaries of every message in a conversation.',
|
|
189
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
238
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
239
|
+
annotations: READ_ONLY
|
|
190
240
|
},
|
|
191
241
|
{
|
|
192
242
|
key: 'outlook-list-drafts',
|
|
193
243
|
title: 'List Drafts',
|
|
194
244
|
description: 'List drafts in the Drafts folder.',
|
|
195
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
245
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
246
|
+
annotations: READ_ONLY
|
|
196
247
|
},
|
|
197
248
|
{
|
|
198
249
|
key: 'outlook-list-emails',
|
|
199
250
|
title: 'List Emails',
|
|
200
251
|
description: 'List inbox messages, optionally filtered by search.',
|
|
201
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
252
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
253
|
+
annotations: READ_ONLY
|
|
202
254
|
},
|
|
203
255
|
{
|
|
204
256
|
key: 'outlook-list-folders',
|
|
205
257
|
title: 'List Folders',
|
|
206
258
|
description: 'List every mail folder on the account.',
|
|
207
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
259
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
260
|
+
annotations: READ_ONLY
|
|
208
261
|
},
|
|
209
262
|
{
|
|
210
263
|
key: 'outlook-list-threads',
|
|
211
264
|
title: 'List Threads',
|
|
212
265
|
description: 'List inbox conversation threads.',
|
|
213
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
266
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
267
|
+
annotations: READ_ONLY
|
|
214
268
|
},
|
|
215
269
|
{
|
|
216
270
|
key: 'outlook-move-message',
|
|
217
271
|
title: 'Move Message',
|
|
218
272
|
description: 'Move a message to a different folder.',
|
|
219
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
273
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
274
|
+
annotations: WRITE
|
|
220
275
|
},
|
|
221
276
|
{
|
|
222
277
|
key: 'outlook-read-email',
|
|
223
278
|
title: 'Read Email',
|
|
224
279
|
description: 'Read the full contents of one message by ID.',
|
|
225
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Read'
|
|
280
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Read',
|
|
281
|
+
annotations: READ_ONLY
|
|
226
282
|
},
|
|
227
283
|
{
|
|
228
284
|
key: 'outlook-reply-email',
|
|
229
285
|
title: 'Reply',
|
|
230
286
|
description: 'Reply to an existing message, preserving the conversation.',
|
|
231
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Send'
|
|
287
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Send',
|
|
288
|
+
annotations: REACHES_OTHERS
|
|
232
289
|
},
|
|
233
290
|
{
|
|
234
291
|
key: 'outlook-send-draft',
|
|
235
292
|
title: 'Send Draft',
|
|
236
293
|
description: 'Send an existing draft as-is.',
|
|
237
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Send'
|
|
294
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Send',
|
|
295
|
+
annotations: REACHES_OTHERS
|
|
238
296
|
},
|
|
239
297
|
{
|
|
240
298
|
key: 'outlook-send-email',
|
|
241
299
|
title: 'Send Email',
|
|
242
300
|
description: 'Send a brand-new email from the connected account.',
|
|
243
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.Send'
|
|
301
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.Send',
|
|
302
|
+
annotations: REACHES_OTHERS
|
|
244
303
|
},
|
|
245
304
|
{
|
|
246
305
|
key: 'outlook-trash-email',
|
|
247
306
|
title: 'Move to Trash',
|
|
248
307
|
description: 'Move a message to the Deleted Items folder.',
|
|
249
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
308
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
309
|
+
annotations: DELETES
|
|
250
310
|
},
|
|
251
311
|
{
|
|
252
312
|
key: 'outlook-update-draft',
|
|
253
313
|
title: 'Update Draft',
|
|
254
314
|
description: 'Replace the contents of an existing draft.',
|
|
255
|
-
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite'
|
|
315
|
+
requiredScopes: 'https://graph.microsoft.com/Mail.ReadWrite',
|
|
316
|
+
annotations: WRITE
|
|
256
317
|
}
|
|
257
318
|
]
|
|
258
319
|
},
|
|
@@ -267,25 +328,29 @@ exports.TOOL_CATALOG = [
|
|
|
267
328
|
key: 'slack-get-user',
|
|
268
329
|
title: 'Get User',
|
|
269
330
|
description: 'Look up a Slack user by ID or email.',
|
|
270
|
-
requiredScopes: 'users:read,users:read.email'
|
|
331
|
+
requiredScopes: 'users:read,users:read.email',
|
|
332
|
+
annotations: READ_ONLY
|
|
271
333
|
},
|
|
272
334
|
{
|
|
273
335
|
key: 'slack-list-channels',
|
|
274
336
|
title: 'List Channels',
|
|
275
337
|
description: 'Browse the channels and DMs the agent can see.',
|
|
276
|
-
requiredScopes: 'channels:read,groups:read,mpim:read,im:read'
|
|
338
|
+
requiredScopes: 'channels:read,groups:read,mpim:read,im:read',
|
|
339
|
+
annotations: READ_ONLY
|
|
277
340
|
},
|
|
278
341
|
{
|
|
279
342
|
key: 'slack-send-message',
|
|
280
343
|
title: 'Send Message',
|
|
281
344
|
description: 'Post a message to a Slack channel, DM, or thread.',
|
|
282
|
-
requiredScopes: 'chat:write'
|
|
345
|
+
requiredScopes: 'chat:write',
|
|
346
|
+
annotations: REACHES_OTHERS
|
|
283
347
|
},
|
|
284
348
|
{
|
|
285
349
|
key: 'slack-upload-file',
|
|
286
350
|
title: 'Upload File',
|
|
287
351
|
description: 'Upload a stored resource into a Slack channel.',
|
|
288
|
-
requiredScopes: 'files:write,chat:write'
|
|
352
|
+
requiredScopes: 'files:write,chat:write',
|
|
353
|
+
annotations: REACHES_OTHERS
|
|
289
354
|
}
|
|
290
355
|
]
|
|
291
356
|
},
|
|
@@ -300,7 +365,8 @@ exports.TOOL_CATALOG = [
|
|
|
300
365
|
key: 'slack-search-messages',
|
|
301
366
|
title: 'Search Messages',
|
|
302
367
|
description: 'Search messages across the workspace. Requires a Slack user token (xoxp).',
|
|
303
|
-
requiredScopes: 'search:read'
|
|
368
|
+
requiredScopes: 'search:read',
|
|
369
|
+
annotations: READ_ONLY
|
|
304
370
|
}
|
|
305
371
|
]
|
|
306
372
|
},
|
|
@@ -315,37 +381,43 @@ exports.TOOL_CATALOG = [
|
|
|
315
381
|
key: 'calendar-create-event',
|
|
316
382
|
title: 'Create Event',
|
|
317
383
|
description: 'Add a new event to a calendar.',
|
|
318
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.events'
|
|
384
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.events',
|
|
385
|
+
annotations: REACHES_OTHERS
|
|
319
386
|
},
|
|
320
387
|
{
|
|
321
388
|
key: 'calendar-delete-event',
|
|
322
389
|
title: 'Delete Event',
|
|
323
390
|
description: 'Permanently remove an event from a calendar.',
|
|
324
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.events'
|
|
391
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.events',
|
|
392
|
+
annotations: REACHES_OTHERS
|
|
325
393
|
},
|
|
326
394
|
{
|
|
327
395
|
key: 'calendar-find-free-slots',
|
|
328
396
|
title: 'Find Free Slots',
|
|
329
397
|
description: 'Find open time gaps on a calendar.',
|
|
330
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly'
|
|
398
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly',
|
|
399
|
+
annotations: READ_ONLY
|
|
331
400
|
},
|
|
332
401
|
{
|
|
333
402
|
key: 'calendar-list-calendars',
|
|
334
403
|
title: 'List Calendars',
|
|
335
404
|
description: 'See all calendars on the connected Google account.',
|
|
336
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly'
|
|
405
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly',
|
|
406
|
+
annotations: READ_ONLY
|
|
337
407
|
},
|
|
338
408
|
{
|
|
339
409
|
key: 'calendar-list-events',
|
|
340
410
|
title: 'List Events',
|
|
341
411
|
description: 'Browse events on a calendar within a time range.',
|
|
342
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly'
|
|
412
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.readonly',
|
|
413
|
+
annotations: READ_ONLY
|
|
343
414
|
},
|
|
344
415
|
{
|
|
345
416
|
key: 'calendar-update-event',
|
|
346
417
|
title: 'Update Event',
|
|
347
418
|
description: 'Change the details of an existing event.',
|
|
348
|
-
requiredScopes: 'https://www.googleapis.com/auth/calendar.events'
|
|
419
|
+
requiredScopes: 'https://www.googleapis.com/auth/calendar.events',
|
|
420
|
+
annotations: REACHES_OTHERS
|
|
349
421
|
}
|
|
350
422
|
]
|
|
351
423
|
},
|
|
@@ -360,25 +432,29 @@ exports.TOOL_CATALOG = [
|
|
|
360
432
|
key: 'calcom-cancel-booking',
|
|
361
433
|
title: 'Cancel Booking',
|
|
362
434
|
description: 'Cancel an existing booking by its UID.',
|
|
363
|
-
requiredScopes: null
|
|
435
|
+
requiredScopes: null,
|
|
436
|
+
annotations: REACHES_OTHERS
|
|
364
437
|
},
|
|
365
438
|
{
|
|
366
439
|
key: 'calcom-create-booking',
|
|
367
440
|
title: 'Create Booking',
|
|
368
441
|
description: 'Book an available slot for an attendee.',
|
|
369
|
-
requiredScopes: null
|
|
442
|
+
requiredScopes: null,
|
|
443
|
+
annotations: REACHES_OTHERS
|
|
370
444
|
},
|
|
371
445
|
{
|
|
372
446
|
key: 'calcom-list-available-slots',
|
|
373
447
|
title: 'List Available Slots',
|
|
374
448
|
description: 'Find open booking times for an event type in a date range.',
|
|
375
|
-
requiredScopes: null
|
|
449
|
+
requiredScopes: null,
|
|
450
|
+
annotations: READ_ONLY
|
|
376
451
|
},
|
|
377
452
|
{
|
|
378
453
|
key: 'calcom-list-event-types',
|
|
379
454
|
title: 'List Event Types',
|
|
380
455
|
description: 'See the bookable meeting types on the connected Cal.com account.',
|
|
381
|
-
requiredScopes: null
|
|
456
|
+
requiredScopes: null,
|
|
457
|
+
annotations: READ_ONLY
|
|
382
458
|
}
|
|
383
459
|
]
|
|
384
460
|
},
|
|
@@ -393,13 +469,15 @@ exports.TOOL_CATALOG = [
|
|
|
393
469
|
key: 'web-extract',
|
|
394
470
|
title: 'Web Extract',
|
|
395
471
|
description: 'Fetch the full cleaned text of specific web pages by URL for in-depth reading.',
|
|
396
|
-
requiredScopes: null
|
|
472
|
+
requiredScopes: null,
|
|
473
|
+
annotations: WEB_READ
|
|
397
474
|
},
|
|
398
475
|
{
|
|
399
476
|
key: 'web-search',
|
|
400
477
|
title: 'Web Search',
|
|
401
478
|
description: 'Search the live web and return the top results plus a synthesized answer so the model can cite sources.',
|
|
402
|
-
requiredScopes: null
|
|
479
|
+
requiredScopes: null,
|
|
480
|
+
annotations: WEB_READ
|
|
403
481
|
}
|
|
404
482
|
]
|
|
405
483
|
},
|
|
@@ -414,31 +492,36 @@ exports.TOOL_CATALOG = [
|
|
|
414
492
|
key: 'list-prompts',
|
|
415
493
|
title: 'List Prompts',
|
|
416
494
|
description: 'List the prompts and commands this assistant exposes, and how to run them on the current channel.',
|
|
417
|
-
requiredScopes: null
|
|
495
|
+
requiredScopes: null,
|
|
496
|
+
annotations: READ_ONLY
|
|
418
497
|
},
|
|
419
498
|
{
|
|
420
499
|
key: 'list-resources',
|
|
421
500
|
title: 'List Resources',
|
|
422
501
|
description: 'List every resource available to this assistant.',
|
|
423
|
-
requiredScopes: null
|
|
502
|
+
requiredScopes: null,
|
|
503
|
+
annotations: READ_ONLY
|
|
424
504
|
},
|
|
425
505
|
{
|
|
426
506
|
key: 'read-resource',
|
|
427
507
|
title: 'Read Resource',
|
|
428
508
|
description: 'Read the contents of a stored resource.',
|
|
429
|
-
requiredScopes: null
|
|
509
|
+
requiredScopes: null,
|
|
510
|
+
annotations: READ_ONLY
|
|
430
511
|
},
|
|
431
512
|
{
|
|
432
513
|
key: 'search-resources',
|
|
433
514
|
title: 'Search Resources',
|
|
434
515
|
description: 'Find the resources most relevant to a question, by meaning and by exact keywords.',
|
|
435
|
-
requiredScopes: null
|
|
516
|
+
requiredScopes: null,
|
|
517
|
+
annotations: READ_ONLY
|
|
436
518
|
},
|
|
437
519
|
{
|
|
438
520
|
key: 'send-resource',
|
|
439
521
|
title: 'Send Resource',
|
|
440
522
|
description: 'Deliver a resource to the user as a chat attachment.',
|
|
441
|
-
requiredScopes: null
|
|
523
|
+
requiredScopes: null,
|
|
524
|
+
annotations: WRITE
|
|
442
525
|
}
|
|
443
526
|
]
|
|
444
527
|
},
|
|
@@ -453,7 +536,8 @@ exports.TOOL_CATALOG = [
|
|
|
453
536
|
key: 'greeting',
|
|
454
537
|
title: 'Greeting',
|
|
455
538
|
description: 'Reply with a friendly hello in English or Spanish (demo tool).',
|
|
456
|
-
requiredScopes: null
|
|
539
|
+
requiredScopes: null,
|
|
540
|
+
annotations: READ_ONLY
|
|
457
541
|
}
|
|
458
542
|
]
|
|
459
543
|
},
|
|
@@ -468,7 +552,8 @@ exports.TOOL_CATALOG = [
|
|
|
468
552
|
key: 'http-endpoint',
|
|
469
553
|
title: 'HTTP Endpoint',
|
|
470
554
|
description: 'A user-configured HTTP request exposed to the agent as its own named tool.',
|
|
471
|
-
requiredScopes: null
|
|
555
|
+
requiredScopes: null,
|
|
556
|
+
annotations: null
|
|
472
557
|
}
|
|
473
558
|
]
|
|
474
559
|
},
|
|
@@ -483,7 +568,8 @@ exports.TOOL_CATALOG = [
|
|
|
483
568
|
key: 'mcp-proxy',
|
|
484
569
|
title: 'MCP Server',
|
|
485
570
|
description: 'A connected remote MCP server. Each server you add exposes its tools to the agent under a vendor prefix.',
|
|
486
|
-
requiredScopes: null
|
|
571
|
+
requiredScopes: null,
|
|
572
|
+
annotations: null
|
|
487
573
|
}
|
|
488
574
|
]
|
|
489
575
|
},
|
|
@@ -498,7 +584,8 @@ exports.TOOL_CATALOG = [
|
|
|
498
584
|
key: 'custom-code',
|
|
499
585
|
title: 'Custom code',
|
|
500
586
|
description: 'Tools implemented by your own code. One script per artifact; names and schemas come from the published version.',
|
|
501
|
-
requiredScopes: null
|
|
587
|
+
requiredScopes: null,
|
|
588
|
+
annotations: null
|
|
502
589
|
}
|
|
503
590
|
]
|
|
504
591
|
}
|
|
@@ -540,6 +627,7 @@ const describeCatalogTool = (key) => {
|
|
|
540
627
|
title: tool.title,
|
|
541
628
|
description: tool.description,
|
|
542
629
|
requiredScopes: tool.requiredScopes,
|
|
630
|
+
annotations: tool.annotations,
|
|
543
631
|
group: {
|
|
544
632
|
key: group.key,
|
|
545
633
|
title: group.title,
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
export interface PendingToolConfirmation {
|
|
2
|
+
id: string;
|
|
3
|
+
participantId: string;
|
|
4
|
+
createdAt: string;
|
|
5
|
+
calls: Array<{
|
|
6
|
+
id: string;
|
|
7
|
+
name: string;
|
|
8
|
+
arguments: Record<string, unknown>;
|
|
9
|
+
}>;
|
|
10
|
+
}
|
|
11
|
+
export type PendingToolConfirmations = Record<string, PendingToolConfirmation>;
|
|
12
|
+
export declare const TOOL_EFFECTS: readonly ["read", "write", "sensitive"];
|
|
13
|
+
export type ToolEffect = (typeof TOOL_EFFECTS)[number];
|
|
14
|
+
export declare const annotationsForEffect: (effect: ToolEffect) => {
|
|
15
|
+
readOnlyHint: boolean;
|
|
16
|
+
destructiveHint: boolean;
|
|
17
|
+
};
|
|
18
|
+
export declare const languageFromPhoneNumber: (phone: string) => string | null;
|
|
19
|
+
export declare const confirmationButtonLabels: (locale?: string | null) => {
|
|
20
|
+
yes: string;
|
|
21
|
+
no: string;
|
|
22
|
+
};
|
|
23
|
+
export declare const confirmationButtonId: (answer: "yes" | "no", externalParticipantId: string) => string;
|
|
24
|
+
export declare const parseConfirmationButton: (id: string) => {
|
|
25
|
+
text: "yes" | "no";
|
|
26
|
+
externalParticipantId: string;
|
|
27
|
+
} | null;
|
|
28
|
+
/**
|
|
29
|
+
* Whether a reply confirms the pending action. Deliberately narrow: the whole
|
|
30
|
+
* message has to be a yes. "Yes, but send it to Ana instead" is not one — it
|
|
31
|
+
* asks for a different action, and running the original would do exactly
|
|
32
|
+
* what the person just said not to. Anything that isn't a clear yes cancels,
|
|
33
|
+
* so the worst a misread costs is asking again.
|
|
34
|
+
*/
|
|
35
|
+
export declare const isConfirmationReply: (text: string) => boolean;
|
|
36
|
+
/**
|
|
37
|
+
* What the held calls will do, written from the calls themselves and appended
|
|
38
|
+
* under the model's question. The model words the question, but a yes runs the
|
|
39
|
+
* stored calls — so the participant has to see those, not only the model's
|
|
40
|
+
* account of them, which a prompt injection earlier in the turn could have
|
|
41
|
+
* bent.
|
|
42
|
+
*/
|
|
43
|
+
export declare const formatConfirmationSummary: (calls: Array<{
|
|
44
|
+
name: string;
|
|
45
|
+
arguments: Record<string, unknown>;
|
|
46
|
+
}>, titleOf: (name: string) => string) => string;
|
|
47
|
+
/**
|
|
48
|
+
* Whether a tool needs a yes before it runs, by the MCP defaults: read-only
|
|
49
|
+
* only if it says so, and a tool that changes things is destructive unless it
|
|
50
|
+
* says it isn't. So an unannotated custom or proxied tool is confirmed — the
|
|
51
|
+
* safe reading for an organization that asked to be asked.
|
|
52
|
+
*/
|
|
53
|
+
export declare const isSensitiveTool: (annotations: {
|
|
54
|
+
readOnlyHint?: boolean;
|
|
55
|
+
destructiveHint?: boolean;
|
|
56
|
+
} | null | undefined) => boolean;
|
|
57
|
+
export declare const stableJson: (value: unknown) => string;
|
|
58
|
+
//# sourceMappingURL=toolConfirmation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"toolConfirmation.d.ts","sourceRoot":"","sources":["../src/toolConfirmation.ts"],"names":[],"mappings":"AAQA,MAAM,WAAW,uBAAuB;IAEtC,EAAE,EAAE,MAAM,CAAC;IAGX,aAAa,EAAE,MAAM,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE,KAAK,CAAC;QACX,EAAE,EAAE,MAAM,CAAC;QACX,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;KACpC,CAAC,CAAC;CACJ;AAKD,MAAM,MAAM,wBAAwB,GAAG,MAAM,CAAC,MAAM,EAAE,uBAAuB,CAAC,CAAC;AAO/E,eAAO,MAAM,YAAY,yCAA0C,CAAC;AAEpE,MAAM,MAAM,UAAU,GAAG,CAAC,OAAO,YAAY,CAAC,CAAC,MAAM,CAAC,CAAC;AAEvD,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,UAAU,KACjB;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAA;CAKE,CAAC;AAmHvD,eAAO,MAAM,uBAAuB,GAAI,OAAO,MAAM,KAAG,MAAM,GAAG,IAOhE,CAAC;AAEF,eAAO,MAAM,wBAAwB,GACnC,SAAS,MAAM,GAAG,IAAI,KACrB;IAAE,GAAG,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAA;CAG3B,CAAC;AAQF,eAAO,MAAM,oBAAoB,GAC/B,QAAQ,KAAK,GAAG,IAAI,EACpB,uBAAuB,MAAM,KAC5B,MAA4E,CAAC;AAEhF,eAAO,MAAM,uBAAuB,GAClC,IAAI,MAAM,KACT;IAAE,IAAI,EAAE,KAAK,GAAG,IAAI,CAAC;IAAC,qBAAqB,EAAE,MAAM,CAAA;CAAE,GAAG,IAQ1D,CAAC;AAWF;;;;;;GAMG;AACH,eAAO,MAAM,mBAAmB,GAAI,MAAM,MAAM,KAAG,OAIlD,CAAC;AAmBF;;;;;;GAMG;AACH,eAAO,MAAM,yBAAyB,GACpC,OAAO,KAAK,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;CAAE,CAAC,EAClE,SAAS,CAAC,IAAI,EAAE,MAAM,KAAK,MAAM,KAChC,MAcc,CAAC;AAElB;;;;;GAKG;AACH,eAAO,MAAM,eAAe,GAC1B,aACI;IAAE,YAAY,CAAC,EAAE,OAAO,CAAC;IAAC,eAAe,CAAC,EAAE,OAAO,CAAA;CAAE,GACrD,IAAI,GACJ,SAAS,KACZ,OAC2E,CAAC;AAI/E,eAAO,MAAM,UAAU,GAAI,OAAO,OAAO,KAAG,MAY3C,CAAC"}
|