@hostwebhook/node-types 1.65.0 → 1.66.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/dist/discord-toolkit.d.ts +47 -0
- package/dist/discord-toolkit.js +235 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +14 -2
- package/dist/slack-toolkit.d.ts +47 -0
- package/dist/slack-toolkit.js +218 -0
- package/package.json +1 -1
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Discord AI Toolkit — las herramientas que un discordAction expone cuando
|
|
3
|
+
* `aiEnabled` está encendido.
|
|
4
|
+
*
|
|
5
|
+
* **Se escribe una sola vez.** Antes vivía dos veces: una copia en
|
|
6
|
+
* `dashboard/components/discord-actions/discord-operations-schemas.ts` y otra en
|
|
7
|
+
* `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y en repos distintos,
|
|
8
|
+
* así que ningún test podía compararlas. Es la octava y novena mudanza de esta
|
|
9
|
+
* serie; de las siete anteriores, la de Contacts salió de que una copia
|
|
10
|
+
* anunciara 15 herramientas y expusiera una.
|
|
11
|
+
*
|
|
12
|
+
* Y sí había deriva, medida al mudar: la descripción de `addReaction` decía en
|
|
13
|
+
* el dashboard «URL-encoding is handled.» y en la api «URL-encoding is handled —
|
|
14
|
+
* pass the raw form.». Gana la de la api, que es la que el servidor MCP sirve
|
|
15
|
+
* hoy a clientes externos y la que dice qué hacer. Las 17 operaciones, sus
|
|
16
|
+
* nombres de herramienta y sus parámetros coincidían exactamente.
|
|
17
|
+
*
|
|
18
|
+
* Targets Discord API v10. Los parámetros snowflake son `string` porque los ids
|
|
19
|
+
* de Discord se pasan de la precisión de Number (17-20 dígitos).
|
|
20
|
+
*
|
|
21
|
+
* La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
|
|
22
|
+
* pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
|
|
23
|
+
* y quien mire la lista de herramientas del servidor MCP.
|
|
24
|
+
*/
|
|
25
|
+
import type { DiscordOperation } from './discord-operations';
|
|
26
|
+
export interface DiscordToolkitParameter {
|
|
27
|
+
name: string;
|
|
28
|
+
type: 'string' | 'number' | 'boolean';
|
|
29
|
+
description: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface DiscordToolkitSpec {
|
|
33
|
+
operation: DiscordOperation;
|
|
34
|
+
/** Etiqueta corta de la fila en la lista de herramientas. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Nombre con el que el LLM llama a la herramienta. */
|
|
37
|
+
toolName: string;
|
|
38
|
+
/** Descripción (más reglas de uso) que ve el LLM. */
|
|
39
|
+
description: string;
|
|
40
|
+
parameters: DiscordToolkitParameter[];
|
|
41
|
+
/** Operaciones irreversibles o que cambian privilegios. La capa MCP las
|
|
42
|
+
* bloquea cuando el nodo de IA lleva `requireConfirmationForDestructive`,
|
|
43
|
+
* salvo que la llamada traiga confirmación explícita. */
|
|
44
|
+
destructive?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const DISCORD_TOOLKIT_SPECS: DiscordToolkitSpec[];
|
|
47
|
+
export declare const DISCORD_TOOLKIT_BY_TOOL_NAME: Record<string, DiscordToolkitSpec>;
|
|
@@ -0,0 +1,235 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Discord AI Toolkit — las herramientas que un discordAction expone cuando
|
|
4
|
+
* `aiEnabled` está encendido.
|
|
5
|
+
*
|
|
6
|
+
* **Se escribe una sola vez.** Antes vivía dos veces: una copia en
|
|
7
|
+
* `dashboard/components/discord-actions/discord-operations-schemas.ts` y otra en
|
|
8
|
+
* `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y en repos distintos,
|
|
9
|
+
* así que ningún test podía compararlas. Es la octava y novena mudanza de esta
|
|
10
|
+
* serie; de las siete anteriores, la de Contacts salió de que una copia
|
|
11
|
+
* anunciara 15 herramientas y expusiera una.
|
|
12
|
+
*
|
|
13
|
+
* Y sí había deriva, medida al mudar: la descripción de `addReaction` decía en
|
|
14
|
+
* el dashboard «URL-encoding is handled.» y en la api «URL-encoding is handled —
|
|
15
|
+
* pass the raw form.». Gana la de la api, que es la que el servidor MCP sirve
|
|
16
|
+
* hoy a clientes externos y la que dice qué hacer. Las 17 operaciones, sus
|
|
17
|
+
* nombres de herramienta y sus parámetros coincidían exactamente.
|
|
18
|
+
*
|
|
19
|
+
* Targets Discord API v10. Los parámetros snowflake son `string` porque los ids
|
|
20
|
+
* de Discord se pasan de la precisión de Number (17-20 dígitos).
|
|
21
|
+
*
|
|
22
|
+
* La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
|
|
23
|
+
* pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
|
|
24
|
+
* y quien mire la lista de herramientas del servidor MCP.
|
|
25
|
+
*/
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.DISCORD_TOOLKIT_BY_TOOL_NAME = exports.DISCORD_TOOLKIT_SPECS = void 0;
|
|
28
|
+
const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
|
|
29
|
+
exports.DISCORD_TOOLKIT_SPECS = [
|
|
30
|
+
// ── Messages ───────────────────────────────────────────────────
|
|
31
|
+
{
|
|
32
|
+
operation: 'sendMessage',
|
|
33
|
+
label: 'Send message',
|
|
34
|
+
toolName: 'send_discord_message',
|
|
35
|
+
description: 'Post a message to a Discord channel or thread. ' +
|
|
36
|
+
'USAGE RULES: ' +
|
|
37
|
+
'(1) `channelId` is the snowflake of a channel the bot can see. Get it from the trigger payload, listChannels, or the user. Never invent one. ' +
|
|
38
|
+
'(2) For a quote-style reply pointing at a specific message, set `replyToMessageId`. ' +
|
|
39
|
+
"(3) To post INTO a thread instead of the parent channel, set `threadId` to the thread's snowflake. " +
|
|
40
|
+
'(4) Discord allows up to 2000 chars per message and supports markdown.',
|
|
41
|
+
parameters: [
|
|
42
|
+
p('channelId', 'Channel snowflake (or thread snowflake to post into a thread).'),
|
|
43
|
+
p('content', 'Message text. Markdown is supported. Max 2000 chars.'),
|
|
44
|
+
p('replyToMessageId', 'Snowflake of a message to quote-reply to.', false),
|
|
45
|
+
p('threadId', 'Thread snowflake to post into (overrides channelId for the actual destination).', false),
|
|
46
|
+
],
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
operation: 'editMessage',
|
|
50
|
+
label: 'Edit message',
|
|
51
|
+
toolName: 'edit_discord_message',
|
|
52
|
+
description: "Edit an existing Discord message. The bot can only edit messages it sent itself — editing someone else's message will fail with 403.",
|
|
53
|
+
parameters: [
|
|
54
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
55
|
+
p('messageId', 'Snowflake of the message to edit.'),
|
|
56
|
+
p('content', 'New message content. Markdown supported. Max 2000 chars.'),
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
operation: 'deleteMessage',
|
|
61
|
+
label: 'Delete message',
|
|
62
|
+
toolName: 'delete_discord_message',
|
|
63
|
+
description: "Permanently delete a Discord message. Irreversible. Deleting another user's message requires the bot to have Manage Messages permission. Always confirm with the user before calling this on user-authored messages.",
|
|
64
|
+
parameters: [
|
|
65
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
66
|
+
p('messageId', 'Snowflake of the message to delete.'),
|
|
67
|
+
],
|
|
68
|
+
destructive: true,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
operation: 'getMessage',
|
|
72
|
+
label: 'Get message',
|
|
73
|
+
toolName: 'get_discord_message',
|
|
74
|
+
description: 'Fetch a single Discord message with its content, author, embeds, attachments, reactions, and pinned state. Use BEFORE editing or reacting to verify the message still exists.',
|
|
75
|
+
parameters: [
|
|
76
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
77
|
+
p('messageId', 'Snowflake of the message to fetch.'),
|
|
78
|
+
],
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
operation: 'addReaction',
|
|
82
|
+
label: 'Add reaction',
|
|
83
|
+
toolName: 'add_discord_reaction',
|
|
84
|
+
description: 'React to a message as the bot. ' +
|
|
85
|
+
'EMOJI FORMAT: ' +
|
|
86
|
+
'(1) Unicode emoji — pass the character itself (e.g. `🔥`, `👍`). ' +
|
|
87
|
+
'(2) Custom server emoji — pass `name:id` (e.g. `partyparrot:123456789012345678`). ' +
|
|
88
|
+
'URL-encoding is handled — pass the raw form. The bot must be in the server and have Add Reactions permission.',
|
|
89
|
+
parameters: [
|
|
90
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
91
|
+
p('messageId', 'Snowflake of the message to react to.'),
|
|
92
|
+
p('emoji', 'Unicode emoji or `name:id` for custom emoji.'),
|
|
93
|
+
],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
operation: 'removeReaction',
|
|
97
|
+
label: 'Remove reaction',
|
|
98
|
+
toolName: 'remove_discord_reaction',
|
|
99
|
+
description: "Remove the bot's own reaction from a message. Same emoji format as add_discord_reaction. Cannot remove other users' reactions through this tool.",
|
|
100
|
+
parameters: [
|
|
101
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
102
|
+
p('messageId', 'Snowflake of the reacted message.'),
|
|
103
|
+
p('emoji', 'Unicode emoji or `name:id` for custom emoji.'),
|
|
104
|
+
],
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
operation: 'pinMessage',
|
|
108
|
+
label: 'Pin message',
|
|
109
|
+
toolName: 'pin_discord_message',
|
|
110
|
+
description: 'Pin a message in its channel. The bot must have Manage Messages permission. Each channel has a 50-pin limit; pinning a 51st message returns 403.',
|
|
111
|
+
parameters: [
|
|
112
|
+
p('channelId', 'Channel snowflake where the message lives.'),
|
|
113
|
+
p('messageId', 'Snowflake of the message to pin.'),
|
|
114
|
+
],
|
|
115
|
+
},
|
|
116
|
+
// ── Channels ───────────────────────────────────────────────────
|
|
117
|
+
{
|
|
118
|
+
operation: 'createChannel',
|
|
119
|
+
label: 'Create channel',
|
|
120
|
+
toolName: 'create_discord_channel',
|
|
121
|
+
description: 'Create a new channel in a Discord guild. The bot must have Manage Channels permission. ' +
|
|
122
|
+
'TYPES: `text` (default), `voice`, `forum`, `announcement`, `category`. ' +
|
|
123
|
+
"To put the new channel under a category, set `parentId` to the category's snowflake.",
|
|
124
|
+
parameters: [
|
|
125
|
+
p('guildId', 'Guild (server) snowflake.'),
|
|
126
|
+
p('name', 'Channel name. Lowercase / hyphens recommended for text channels.'),
|
|
127
|
+
p('type', 'Channel type: text, voice, forum, announcement, category.', false),
|
|
128
|
+
p('parentId', 'Snowflake of the parent category. Optional.', false),
|
|
129
|
+
p('topic', 'Channel description (text channels only).', false),
|
|
130
|
+
p('slowmode', 'Per-user message rate limit in seconds (0-21600).', false, 'number'),
|
|
131
|
+
p('nsfw', 'Mark channel as age-restricted.', false, 'boolean'),
|
|
132
|
+
],
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
operation: 'editChannel',
|
|
136
|
+
label: 'Edit channel',
|
|
137
|
+
toolName: 'edit_discord_channel',
|
|
138
|
+
description: 'Rename, change topic, slowmode, or move a channel under a different category. Pass only fields you want changed. Bot needs Manage Channels.',
|
|
139
|
+
parameters: [
|
|
140
|
+
p('channelId', 'Channel snowflake.'),
|
|
141
|
+
p('name', 'New channel name.', false),
|
|
142
|
+
p('topic', 'New channel description.', false),
|
|
143
|
+
p('slowmode', 'New slowmode in seconds (0-21600).', false, 'number'),
|
|
144
|
+
p('parentId', 'Move under a different category by snowflake.', false),
|
|
145
|
+
p('nsfw', 'Toggle age-restricted.', false, 'boolean'),
|
|
146
|
+
],
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
operation: 'deleteChannel',
|
|
150
|
+
label: 'Delete channel',
|
|
151
|
+
toolName: 'delete_discord_channel',
|
|
152
|
+
description: 'Permanently delete a Discord channel and ALL its messages. Irreversible. ALWAYS confirm with the user before calling — Discord does not provide a recovery window.',
|
|
153
|
+
parameters: [p('channelId', 'Channel snowflake to delete.')],
|
|
154
|
+
destructive: true,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
operation: 'getChannel',
|
|
158
|
+
label: 'Get channel',
|
|
159
|
+
toolName: 'get_discord_channel',
|
|
160
|
+
description: "Fetch a Discord channel's full configuration: name, type, topic, parentId, NSFW flag, slowmode. Use to inspect before editing.",
|
|
161
|
+
parameters: [p('channelId', 'Channel snowflake to fetch.')],
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
operation: 'listChannels',
|
|
165
|
+
label: 'List channels',
|
|
166
|
+
toolName: 'list_discord_channels',
|
|
167
|
+
description: 'List every channel in a guild — text, voice, categories, threads, forums. Returns an iterable array. Use this to FIND a channel by name before posting.',
|
|
168
|
+
parameters: [p('guildId', 'Guild snowflake.')],
|
|
169
|
+
},
|
|
170
|
+
// ── Threads ────────────────────────────────────────────────────
|
|
171
|
+
{
|
|
172
|
+
operation: 'createThread',
|
|
173
|
+
label: 'Create thread',
|
|
174
|
+
toolName: 'create_discord_thread',
|
|
175
|
+
description: 'Create a thread in a channel. ' +
|
|
176
|
+
'TWO MODES: ' +
|
|
177
|
+
'(1) With `messageId` — spawns the thread off that message. Inherits its visibility. ' +
|
|
178
|
+
'(2) Without `messageId` — standalone thread. Pass `type: public|private|announcement`. Private threads require Manage Threads permission.',
|
|
179
|
+
parameters: [
|
|
180
|
+
p('channelId', 'Parent channel snowflake.'),
|
|
181
|
+
p('name', 'Thread name.'),
|
|
182
|
+
p('messageId', 'Optional anchor message snowflake. When set, thread spawns off it.', false),
|
|
183
|
+
p('type', 'Thread type: public, private, announcement (ignored when messageId is set).', false),
|
|
184
|
+
p('autoArchiveMinutes', 'Auto-archive after N minutes of inactivity (60 / 1440 / 4320 / 10080).', false, 'number'),
|
|
185
|
+
],
|
|
186
|
+
},
|
|
187
|
+
// ── DMs ────────────────────────────────────────────────────────
|
|
188
|
+
{
|
|
189
|
+
operation: 'sendDM',
|
|
190
|
+
label: 'Send DM',
|
|
191
|
+
toolName: 'send_discord_dm',
|
|
192
|
+
description: "Direct-message a user. The user must share at least one server with the bot AND have DMs from server members enabled. Discord will silently drop the DM if the user has DMs disabled — that is the user's privacy choice. Do not retry.",
|
|
193
|
+
parameters: [
|
|
194
|
+
p('userId', 'User snowflake.'),
|
|
195
|
+
p('content', 'DM content. Markdown supported. Max 2000 chars.'),
|
|
196
|
+
],
|
|
197
|
+
},
|
|
198
|
+
// ── Roles & members ────────────────────────────────────────────
|
|
199
|
+
{
|
|
200
|
+
operation: 'addRole',
|
|
201
|
+
label: 'Add role to member',
|
|
202
|
+
toolName: 'add_discord_role',
|
|
203
|
+
description: 'Grant a role to a guild member. ' +
|
|
204
|
+
'CRITICAL: the bot\'s OWN role must be ABOVE the role being granted in the server\'s role hierarchy. A 403 with "Missing Permissions" almost always means the bot needs to be moved up — tell the user to drag the bot role above the target role in Server Settings → Roles.',
|
|
205
|
+
parameters: [
|
|
206
|
+
p('guildId', 'Guild snowflake.'),
|
|
207
|
+
p('userId', 'Member snowflake.'),
|
|
208
|
+
p('roleId', 'Role snowflake to grant.'),
|
|
209
|
+
],
|
|
210
|
+
destructive: true,
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
operation: 'removeRole',
|
|
214
|
+
label: 'Remove role from member',
|
|
215
|
+
toolName: 'remove_discord_role',
|
|
216
|
+
description: "Remove a role from a guild member. Same hierarchy rule as add_discord_role — bot's role must be above the target role. Cannot remove the @everyone role.",
|
|
217
|
+
parameters: [
|
|
218
|
+
p('guildId', 'Guild snowflake.'),
|
|
219
|
+
p('userId', 'Member snowflake.'),
|
|
220
|
+
p('roleId', 'Role snowflake to remove.'),
|
|
221
|
+
],
|
|
222
|
+
destructive: true,
|
|
223
|
+
},
|
|
224
|
+
{
|
|
225
|
+
operation: 'getMember',
|
|
226
|
+
label: 'Get member',
|
|
227
|
+
toolName: 'get_discord_member',
|
|
228
|
+
description: 'Fetch a guild member: their server nickname, role IDs, joined-at timestamp, and the underlying user object. Use BEFORE addRole / removeRole to inspect current roles.',
|
|
229
|
+
parameters: [
|
|
230
|
+
p('guildId', 'Guild snowflake.'),
|
|
231
|
+
p('userId', 'Member snowflake.'),
|
|
232
|
+
],
|
|
233
|
+
},
|
|
234
|
+
];
|
|
235
|
+
exports.DISCORD_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.DISCORD_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
|
package/dist/index.d.ts
CHANGED
|
@@ -24,6 +24,8 @@ export { WHATSAPP_OPERATIONS, isWhatsAppOperation, } from './whatsapp-operations
|
|
|
24
24
|
export type { WhatsAppOperation } from './whatsapp-operations';
|
|
25
25
|
export { DISCORD_OPERATIONS, DISCORD_OPERATION_SPECS, isDiscordOperation, } from './discord-operations';
|
|
26
26
|
export type { DiscordOperation, DiscordParamSpec, DiscordOperationSpec, } from './discord-operations';
|
|
27
|
+
export { DISCORD_TOOLKIT_SPECS, DISCORD_TOOLKIT_BY_TOOL_NAME, } from './discord-toolkit';
|
|
28
|
+
export type { DiscordToolkitSpec, DiscordToolkitParameter, } from './discord-toolkit';
|
|
27
29
|
export { MAILCHIMP_OPERATIONS, MAILCHIMP_OPERATION_SPECS, MAILCHIMP_CONTACT_STATUSES, isMailchimpOperation, } from './mailchimp-operations';
|
|
28
30
|
export type { MailchimpOperation, MailchimpContactStatus, MailchimpParamSpec, MailchimpOperationSpec, } from './mailchimp-operations';
|
|
29
31
|
export { SHOPIFY_OPERATIONS, SHOPIFY_OPERATION_SPECS, SHOPIFY_TAGGABLE_RESOURCES, SHOPIFY_SEARCHABLE_RESOURCES, isShopifyOperation, } from './shopify-operations';
|
|
@@ -34,6 +36,8 @@ export { JIRA_OPERATIONS, JIRA_OPERATION_SPECS, JIRA_DROPDOWN_OPERATIONS, JIRA_I
|
|
|
34
36
|
export type { JiraOperation, JiraParamType, JiraParamSpec, JiraOperationSpec, } from './jira-operations';
|
|
35
37
|
export { SLACK_OPERATIONS, SLACK_OPERATION_SPECS, isSlackOperation, } from './slack-operations';
|
|
36
38
|
export type { SlackOperation, SlackParamSpec, SlackOperationSpec, } from './slack-operations';
|
|
39
|
+
export { SLACK_TOOLKIT_SPECS, SLACK_TOOLKIT_BY_TOOL_NAME, } from './slack-toolkit';
|
|
40
|
+
export type { SlackToolkitSpec, SlackToolkitParameter, } from './slack-toolkit';
|
|
37
41
|
export { SHEETS_OPERATIONS, SHEETS_OPERATION_SPECS, isSheetsOperation, } from './sheets-operations';
|
|
38
42
|
export type { SheetsOperation, SheetsParamSpec, SheetsOperationSpec, } from './sheets-operations';
|
|
39
43
|
export { SHEETS_TOOLKIT_SPECS, SHEETS_TOOLKIT_BY_TOOL_NAME, SHEETS_TOOLKIT_DEFAULTABLE, } from './sheets-toolkit';
|
package/dist/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.DRIVE_OPERATION_SPECS = exports.DRIVE_OPERATIONS = exports.GOOGLE_CALENDAR_TOOLKIT_BY_TOOL_NAME = exports.GOOGLE_CALENDAR_TOOLKIT_SPECS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATION_SPECS = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.resolveGmailSendFields = exports.GMAIL_SEND_LEGACY_FIELDS = exports.NATIVE_EMAIL_TOOLKIT_BY_TOOL_NAME = exports.GMAIL_TOOLKIT_BY_TOOL_NAME = exports.NATIVE_EMAIL_TOOLKIT_SPECS = exports.GMAIL_SEND_AND_WAIT_TOOL_SPEC = exports.GMAIL_ALL_TOOLKIT_SPECS = exports.GMAIL_TOOLKIT_SPECS = exports.GMAIL_TOOLKIT_OPERATIONS = exports.GMAIL_DROPDOWN_OPERATIONS = exports.GMAIL_OPERATION_GROUPS = exports.GMAIL_OPERATION_SPECS = exports.GMAIL_OPERATIONS = exports.versionCatalogErrors = exports.fieldsLost = exports.fieldsLostBetween = exports.currentVersion = exports.versionSpec = exports.versionsOf = exports.isVersioned = exports.NODE_TYPE_TO_PREFIX = exports.PREFIX_TO_NODE_TYPE = exports.NODE_STATE_KEYS = exports.NODE_COLORS = exports.NODE_DETAIL_PATHS = exports.getNodeRegistryEntry = exports.NODE_REGISTRY = exports.getNodeDispatchConfig = exports.getAllNodeCollections = exports.NODE_DISPATCH = exports.resolveNodeId = exports.PREFIX_TO_TYPE = exports.NODE_UI = exports.ALL_NODE_TYPES = exports.isNodeType = exports.isTerminal = exports.canSendToNodes = exports.canReceiveFromNodes = exports.canReceiveFrom = exports.NODE_CONNECTIONS = exports.iterableMeta = exports.singleMeta = void 0;
|
|
4
|
-
exports.
|
|
5
|
-
exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.getModelLabel = exports.getDefaultModel = exports.getModelsFor = exports.MODEL_CONTEXT_WINDOWS = exports.LLM_MODELS = exports.LLM_PROVIDERS = exports.DOCS_TOOLKIT_DEFAULTABLE = exports.DOCS_TOOLKIT_BY_TOOL_NAME = exports.DOCS_TOOLKIT_SPECS = exports.isDocsOperation = exports.DOCS_OPERATION_SPECS = exports.DOCS_OPERATIONS = exports.isMongoOperation = exports.MONGO_OPERATION_SPECS = exports.MONGO_OPERATIONS = exports.isPostgresOperation = exports.POSTGRES_OPERATION_SPECS = exports.POSTGRES_MODES = exports.POSTGRES_OPERATIONS = exports.isNotionOperation = exports.NOTION_DROPDOWN_OPERATIONS = exports.NOTION_OPERATION_SPECS = exports.NOTION_OPERATIONS = exports.isGoogleAnalyticsOperation = exports.GOOGLE_ANALYTICS_DROPDOWN_OPERATIONS = void 0;
|
|
4
|
+
exports.GOOGLE_CONTACTS_OPERATION_GROUPS = exports.GOOGLE_CONTACTS_OPERATION_SPECS = exports.GOOGLE_CONTACTS_OPERATIONS_V2 = exports.GOOGLE_CONTACTS_OPERATIONS_V1 = exports.GOOGLE_CONTACTS_OPERATIONS = exports.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = exports.isSheetsOperation = exports.SHEETS_OPERATION_SPECS = exports.SHEETS_OPERATIONS = exports.SLACK_TOOLKIT_BY_TOOL_NAME = exports.SLACK_TOOLKIT_SPECS = exports.isSlackOperation = exports.SLACK_OPERATION_SPECS = exports.SLACK_OPERATIONS = exports.isJiraOperation = exports.JIRA_ITERABLE_OPERATIONS = exports.JIRA_DROPDOWN_OPERATIONS = exports.JIRA_OPERATION_SPECS = exports.JIRA_OPERATIONS = exports.isGithubOperation = exports.GITHUB_ITERABLE_OPERATIONS = exports.GITHUB_DROPDOWN_OPERATIONS = exports.GITHUB_OPERATION_SPECS = exports.GITHUB_OPERATIONS = exports.isShopifyOperation = exports.SHOPIFY_SEARCHABLE_RESOURCES = exports.SHOPIFY_TAGGABLE_RESOURCES = exports.SHOPIFY_OPERATION_SPECS = exports.SHOPIFY_OPERATIONS = exports.isMailchimpOperation = exports.MAILCHIMP_CONTACT_STATUSES = exports.MAILCHIMP_OPERATION_SPECS = exports.MAILCHIMP_OPERATIONS = exports.DISCORD_TOOLKIT_BY_TOOL_NAME = exports.DISCORD_TOOLKIT_SPECS = exports.isDiscordOperation = exports.DISCORD_OPERATION_SPECS = exports.DISCORD_OPERATIONS = exports.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.TELEGRAM_TOOLKIT_BY_TOOL_NAME = exports.TELEGRAM_TOOLKIT_SPECS = exports.isTelegramOperation = exports.TELEGRAM_OPERATION_SPECS = exports.TELEGRAM_OPERATIONS = exports.DRIVE_TOOLKIT_BY_TOOL_NAME = exports.DRIVE_TOOLKIT_SPECS = exports.isDriveOperation = void 0;
|
|
5
|
+
exports.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.getModelLabel = exports.getDefaultModel = exports.getModelsFor = exports.MODEL_CONTEXT_WINDOWS = exports.LLM_MODELS = exports.LLM_PROVIDERS = exports.DOCS_TOOLKIT_DEFAULTABLE = exports.DOCS_TOOLKIT_BY_TOOL_NAME = exports.DOCS_TOOLKIT_SPECS = exports.isDocsOperation = exports.DOCS_OPERATION_SPECS = exports.DOCS_OPERATIONS = exports.isMongoOperation = exports.MONGO_OPERATION_SPECS = exports.MONGO_OPERATIONS = exports.isPostgresOperation = exports.POSTGRES_OPERATION_SPECS = exports.POSTGRES_MODES = exports.POSTGRES_OPERATIONS = exports.isNotionOperation = exports.NOTION_DROPDOWN_OPERATIONS = exports.NOTION_OPERATION_SPECS = exports.NOTION_OPERATIONS = exports.isGoogleAnalyticsOperation = exports.GOOGLE_ANALYTICS_DROPDOWN_OPERATIONS = exports.GOOGLE_ANALYTICS_OPERATION_SPECS = exports.GOOGLE_ANALYTICS_OPERATIONS = exports.isGoogleContactsOperation = exports.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS = void 0;
|
|
6
6
|
var types_1 = require("./types");
|
|
7
7
|
Object.defineProperty(exports, "singleMeta", { enumerable: true, get: function () { return types_1.singleMeta; } });
|
|
8
8
|
Object.defineProperty(exports, "iterableMeta", { enumerable: true, get: function () { return types_1.iterableMeta; } });
|
|
@@ -87,6 +87,13 @@ var discord_operations_1 = require("./discord-operations");
|
|
|
87
87
|
Object.defineProperty(exports, "DISCORD_OPERATIONS", { enumerable: true, get: function () { return discord_operations_1.DISCORD_OPERATIONS; } });
|
|
88
88
|
Object.defineProperty(exports, "DISCORD_OPERATION_SPECS", { enumerable: true, get: function () { return discord_operations_1.DISCORD_OPERATION_SPECS; } });
|
|
89
89
|
Object.defineProperty(exports, "isDiscordOperation", { enumerable: true, get: function () { return discord_operations_1.isDiscordOperation; } });
|
|
90
|
+
/* Ojo con los dos nombres parecidos, que vienen de dos ficheros y NO son lo
|
|
91
|
+
mismo: `DiscordOperationSpec` (arriba) describe el FORMULARIO —qué control
|
|
92
|
+
pintar por campo— y `DiscordToolkitSpec` (abajo) describe la HERRAMIENTA que
|
|
93
|
+
ve el LLM. Es la misma pareja que ya tienen Telegram, Sheets y compañía. */
|
|
94
|
+
var discord_toolkit_1 = require("./discord-toolkit");
|
|
95
|
+
Object.defineProperty(exports, "DISCORD_TOOLKIT_SPECS", { enumerable: true, get: function () { return discord_toolkit_1.DISCORD_TOOLKIT_SPECS; } });
|
|
96
|
+
Object.defineProperty(exports, "DISCORD_TOOLKIT_BY_TOOL_NAME", { enumerable: true, get: function () { return discord_toolkit_1.DISCORD_TOOLKIT_BY_TOOL_NAME; } });
|
|
90
97
|
var mailchimp_operations_1 = require("./mailchimp-operations");
|
|
91
98
|
Object.defineProperty(exports, "MAILCHIMP_OPERATIONS", { enumerable: true, get: function () { return mailchimp_operations_1.MAILCHIMP_OPERATIONS; } });
|
|
92
99
|
Object.defineProperty(exports, "MAILCHIMP_OPERATION_SPECS", { enumerable: true, get: function () { return mailchimp_operations_1.MAILCHIMP_OPERATION_SPECS; } });
|
|
@@ -114,6 +121,11 @@ var slack_operations_1 = require("./slack-operations");
|
|
|
114
121
|
Object.defineProperty(exports, "SLACK_OPERATIONS", { enumerable: true, get: function () { return slack_operations_1.SLACK_OPERATIONS; } });
|
|
115
122
|
Object.defineProperty(exports, "SLACK_OPERATION_SPECS", { enumerable: true, get: function () { return slack_operations_1.SLACK_OPERATION_SPECS; } });
|
|
116
123
|
Object.defineProperty(exports, "isSlackOperation", { enumerable: true, get: function () { return slack_operations_1.isSlackOperation; } });
|
|
124
|
+
/* Misma pareja que en Discord: `SlackOperationSpec` es el formulario,
|
|
125
|
+
`SlackToolkitSpec` es la herramienta que ve el LLM. */
|
|
126
|
+
var slack_toolkit_1 = require("./slack-toolkit");
|
|
127
|
+
Object.defineProperty(exports, "SLACK_TOOLKIT_SPECS", { enumerable: true, get: function () { return slack_toolkit_1.SLACK_TOOLKIT_SPECS; } });
|
|
128
|
+
Object.defineProperty(exports, "SLACK_TOOLKIT_BY_TOOL_NAME", { enumerable: true, get: function () { return slack_toolkit_1.SLACK_TOOLKIT_BY_TOOL_NAME; } });
|
|
117
129
|
var sheets_operations_1 = require("./sheets-operations");
|
|
118
130
|
Object.defineProperty(exports, "SHEETS_OPERATIONS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATIONS; } });
|
|
119
131
|
Object.defineProperty(exports, "SHEETS_OPERATION_SPECS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATION_SPECS; } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Slack AI Toolkit — las herramientas que un slackAction expone cuando
|
|
3
|
+
* `aiEnabled` está encendido.
|
|
4
|
+
*
|
|
5
|
+
* **Se escribe una sola vez.** Antes vivía dos veces: una copia en
|
|
6
|
+
* `dashboard/components/slack-actions/slack-operations-schemas.ts` y otra en
|
|
7
|
+
* `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y en repos distintos,
|
|
8
|
+
* así que ningún test podía compararlas. Es la octava y novena mudanza de esta
|
|
9
|
+
* serie; de las siete anteriores, la de Contacts salió de que una copia
|
|
10
|
+
* anunciara 15 herramientas y expusiera una.
|
|
11
|
+
*
|
|
12
|
+
* La deriva aquí era gorda: **14 de las 16 descripciones** diferían. Gana la de
|
|
13
|
+
* la api en todas —es sistemáticamente la más completa y es la que sirve el MCP
|
|
14
|
+
* hoy—, y una no era cosmética: en `deleteMessage` la api nombra el permiso que
|
|
15
|
+
* hace falta (`chat:write.public` + admin) y el dashboard sólo decía «admin
|
|
16
|
+
* perms». Operaciones, nombres de herramienta y parámetros sí coincidían.
|
|
17
|
+
*
|
|
18
|
+
* Los nombres llevan `_slack_` para no chocar con los de Telegram y Discord
|
|
19
|
+
* cuando un mismo AI Node tiene varios toolkits encendidos.
|
|
20
|
+
*
|
|
21
|
+
* La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
|
|
22
|
+
* pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
|
|
23
|
+
* y quien mire la lista de herramientas del servidor MCP.
|
|
24
|
+
*/
|
|
25
|
+
import type { SlackOperation } from './slack-operations';
|
|
26
|
+
export interface SlackToolkitParameter {
|
|
27
|
+
name: string;
|
|
28
|
+
type: 'string' | 'number' | 'boolean';
|
|
29
|
+
description: string;
|
|
30
|
+
required: boolean;
|
|
31
|
+
}
|
|
32
|
+
export interface SlackToolkitSpec {
|
|
33
|
+
operation: SlackOperation;
|
|
34
|
+
/** Etiqueta corta de la fila en la lista de herramientas. */
|
|
35
|
+
label: string;
|
|
36
|
+
/** Nombre con el que el LLM llama a la herramienta. */
|
|
37
|
+
toolName: string;
|
|
38
|
+
/** Descripción (más reglas de uso) que ve el LLM. */
|
|
39
|
+
description: string;
|
|
40
|
+
parameters: SlackToolkitParameter[];
|
|
41
|
+
/** Operaciones irreversibles o que cambian privilegios. La capa MCP las
|
|
42
|
+
* bloquea cuando el nodo de IA lleva `requireConfirmationForDestructive`,
|
|
43
|
+
* salvo que la llamada traiga confirmación explícita. */
|
|
44
|
+
destructive?: boolean;
|
|
45
|
+
}
|
|
46
|
+
export declare const SLACK_TOOLKIT_SPECS: SlackToolkitSpec[];
|
|
47
|
+
export declare const SLACK_TOOLKIT_BY_TOOL_NAME: Record<string, SlackToolkitSpec>;
|
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Slack AI Toolkit — las herramientas que un slackAction expone cuando
|
|
4
|
+
* `aiEnabled` está encendido.
|
|
5
|
+
*
|
|
6
|
+
* **Se escribe una sola vez.** Antes vivía dos veces: una copia en
|
|
7
|
+
* `dashboard/components/slack-actions/slack-operations-schemas.ts` y otra en
|
|
8
|
+
* `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y en repos distintos,
|
|
9
|
+
* así que ningún test podía compararlas. Es la octava y novena mudanza de esta
|
|
10
|
+
* serie; de las siete anteriores, la de Contacts salió de que una copia
|
|
11
|
+
* anunciara 15 herramientas y expusiera una.
|
|
12
|
+
*
|
|
13
|
+
* La deriva aquí era gorda: **14 de las 16 descripciones** diferían. Gana la de
|
|
14
|
+
* la api en todas —es sistemáticamente la más completa y es la que sirve el MCP
|
|
15
|
+
* hoy—, y una no era cosmética: en `deleteMessage` la api nombra el permiso que
|
|
16
|
+
* hace falta (`chat:write.public` + admin) y el dashboard sólo decía «admin
|
|
17
|
+
* perms». Operaciones, nombres de herramienta y parámetros sí coincidían.
|
|
18
|
+
*
|
|
19
|
+
* Los nombres llevan `_slack_` para no chocar con los de Telegram y Discord
|
|
20
|
+
* cuando un mismo AI Node tiene varios toolkits encendidos.
|
|
21
|
+
*
|
|
22
|
+
* La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
|
|
23
|
+
* pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
|
|
24
|
+
* y quien mire la lista de herramientas del servidor MCP.
|
|
25
|
+
*/
|
|
26
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
+
exports.SLACK_TOOLKIT_BY_TOOL_NAME = exports.SLACK_TOOLKIT_SPECS = void 0;
|
|
28
|
+
const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
|
|
29
|
+
exports.SLACK_TOOLKIT_SPECS = [
|
|
30
|
+
// ── Messages ─────────────────────────────────────────────────────
|
|
31
|
+
{
|
|
32
|
+
operation: 'sendMessage',
|
|
33
|
+
label: 'Send message',
|
|
34
|
+
toolName: 'send_slack_message',
|
|
35
|
+
description: 'Post a message to a Slack channel, group, or DM. ' +
|
|
36
|
+
'USAGE RULES: ' +
|
|
37
|
+
'(1) `channel` is a Slack channel id (C…), group id (G…), or DM id (D…). Get it from the trigger payload, listChannels, or the user. Never invent one. ' +
|
|
38
|
+
'(2) For a thread reply, set `threadTs` to the parent message timestamp. ' +
|
|
39
|
+
'(3) Either `text` or `blocks` is required. Use blocks for rich layouts.',
|
|
40
|
+
parameters: [
|
|
41
|
+
p('channel', 'Channel/group/DM id where the message will be posted.'),
|
|
42
|
+
p('text', 'Message text. Slack mrkdwn supported. Required when blocks is empty.', false),
|
|
43
|
+
p('blocks', 'Block Kit JSON for rich layouts. Stringified JSON or JSON array.', false),
|
|
44
|
+
p('threadTs', 'Parent message timestamp to reply inside an existing thread.', false),
|
|
45
|
+
],
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
operation: 'updateMessage',
|
|
49
|
+
label: 'Update message',
|
|
50
|
+
toolName: 'update_slack_message',
|
|
51
|
+
description: 'Edit a message previously posted by the bot. The bot can only edit its own messages — editing another user/bot message returns cant_update_message.',
|
|
52
|
+
parameters: [
|
|
53
|
+
p('channel', 'Channel where the original message lives.'),
|
|
54
|
+
p('ts', 'Timestamp of the message to edit (returned by sendMessage).'),
|
|
55
|
+
p('text', 'New message text. Required when blocks is empty.', false),
|
|
56
|
+
p('blocks', 'New Block Kit JSON. Replaces the existing layout.', false),
|
|
57
|
+
],
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
operation: 'deleteMessage',
|
|
61
|
+
label: 'Delete message',
|
|
62
|
+
toolName: 'delete_slack_message',
|
|
63
|
+
description: "Delete a message the bot posted. Other users' messages need chat:write.public + admin perms — usually fails for AI-driven calls. Confirm before destructive use.",
|
|
64
|
+
parameters: [
|
|
65
|
+
p('channel', 'Channel where the message lives.'),
|
|
66
|
+
p('ts', 'Timestamp of the message to delete.'),
|
|
67
|
+
],
|
|
68
|
+
destructive: true,
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
operation: 'sendEphemeral',
|
|
72
|
+
label: 'Send ephemeral',
|
|
73
|
+
toolName: 'send_slack_ephemeral',
|
|
74
|
+
description: 'Post a message visible only to a specific user — the rest of the channel does not see it. Useful for per-user prompts, errors, or warnings.',
|
|
75
|
+
parameters: [
|
|
76
|
+
p('channel', 'Channel where the ephemeral message will appear.'),
|
|
77
|
+
p('user', 'User id (U…) — the only viewer of the message.'),
|
|
78
|
+
p('text', 'Message text. Required when blocks is empty.', false),
|
|
79
|
+
p('blocks', 'Block Kit JSON for rich layouts.', false),
|
|
80
|
+
],
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
operation: 'scheduleMessage',
|
|
84
|
+
label: 'Schedule message',
|
|
85
|
+
toolName: 'schedule_slack_message',
|
|
86
|
+
description: 'Schedule a Slack message to be posted at a future time. Returns a scheduled_message_id useful for cancellation later.',
|
|
87
|
+
parameters: [
|
|
88
|
+
p('channel', 'Channel where the message will be posted.'),
|
|
89
|
+
p('postAt', 'When to post — unix timestamp in SECONDS, not milliseconds.', true, 'number'),
|
|
90
|
+
p('text', 'Message text. Required when blocks is empty.', false),
|
|
91
|
+
p('blocks', 'Block Kit JSON for rich layouts.', false),
|
|
92
|
+
],
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
operation: 'getMessage',
|
|
96
|
+
label: 'Get message',
|
|
97
|
+
toolName: 'get_slack_message',
|
|
98
|
+
description: 'Fetch a single message by its timestamp. Returns the message text + author + reactions + attachments. Use BEFORE editing or reacting to verify state.',
|
|
99
|
+
parameters: [
|
|
100
|
+
p('channel', 'Channel where the message lives.'),
|
|
101
|
+
p('ts', 'Timestamp of the message to fetch.'),
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
// ── Channels ─────────────────────────────────────────────────────
|
|
105
|
+
{
|
|
106
|
+
operation: 'listChannels',
|
|
107
|
+
label: 'List channels',
|
|
108
|
+
toolName: 'list_slack_channels',
|
|
109
|
+
description: 'List public + private channels the bot can see in the workspace. Returns id, name, isMember, memberCount per channel. Pre-pick a channel before sendMessage.',
|
|
110
|
+
parameters: [
|
|
111
|
+
p('limit', 'Max channels to return (1-1000). Default 200.', false, 'number'),
|
|
112
|
+
p('excludeArchived', 'Hide archived channels. Default true.', false, 'boolean'),
|
|
113
|
+
],
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
operation: 'getChannelHistory',
|
|
117
|
+
label: 'Get channel history',
|
|
118
|
+
toolName: 'get_slack_channel_history',
|
|
119
|
+
description: 'Read recent messages from a Slack channel. Useful for summarization, context retrieval, or finding a message by content before editing/reacting.',
|
|
120
|
+
parameters: [
|
|
121
|
+
p('channel', 'Channel id to read from.'),
|
|
122
|
+
p('limit', 'Max messages to return (1-200). Default 50.', false, 'number'),
|
|
123
|
+
p('oldest', 'Only messages newer than this timestamp.', false),
|
|
124
|
+
p('latest', 'Only messages older than this timestamp.', false),
|
|
125
|
+
],
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
operation: 'getThreadReplies',
|
|
129
|
+
label: 'Get thread replies',
|
|
130
|
+
toolName: 'get_slack_thread_replies',
|
|
131
|
+
description: 'Fetch the replies inside a Slack thread, given the parent message timestamp. Use for summarizing or continuing a thread.',
|
|
132
|
+
parameters: [
|
|
133
|
+
p('channel', 'Channel where the thread lives.'),
|
|
134
|
+
p('ts', 'Timestamp of the thread parent message.'),
|
|
135
|
+
p('limit', 'Max replies to return (1-1000). Default 100.', false, 'number'),
|
|
136
|
+
],
|
|
137
|
+
},
|
|
138
|
+
{
|
|
139
|
+
operation: 'createChannel',
|
|
140
|
+
label: 'Create channel',
|
|
141
|
+
toolName: 'create_slack_channel',
|
|
142
|
+
description: 'Create a new public or private Slack channel. Names must be lowercase, no spaces, max 80 chars. Confirm with the user before creating channels — they are usually long-lived org artifacts.',
|
|
143
|
+
parameters: [
|
|
144
|
+
p('name', 'Channel name — lowercase, no spaces, max 80 chars.'),
|
|
145
|
+
p('isPrivate', 'Create a private channel instead of public. Default false.', false, 'boolean'),
|
|
146
|
+
],
|
|
147
|
+
destructive: true,
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
operation: 'inviteToChannel',
|
|
151
|
+
label: 'Invite to channel',
|
|
152
|
+
toolName: 'invite_to_slack_channel',
|
|
153
|
+
description: 'Invite one or more users to a Slack channel by user id. Comma-separated `users` argument.',
|
|
154
|
+
parameters: [
|
|
155
|
+
p('channel', 'Channel id to invite users to.'),
|
|
156
|
+
p('users', 'Comma-separated user ids (U…) to invite.'),
|
|
157
|
+
],
|
|
158
|
+
},
|
|
159
|
+
// ── Reactions ────────────────────────────────────────────────────
|
|
160
|
+
{
|
|
161
|
+
operation: 'addReaction',
|
|
162
|
+
label: 'Add reaction',
|
|
163
|
+
toolName: 'add_slack_reaction',
|
|
164
|
+
description: 'Add an emoji reaction to a Slack message as the bot. Use the emoji NAME without colons (e.g. `thumbsup`, `white_check_mark`, `eyes`).',
|
|
165
|
+
parameters: [
|
|
166
|
+
p('channel', 'Channel where the message lives.'),
|
|
167
|
+
p('ts', 'Timestamp of the message to react to.'),
|
|
168
|
+
p('name', 'Emoji name without colons.'),
|
|
169
|
+
],
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
operation: 'removeReaction',
|
|
173
|
+
label: 'Remove reaction',
|
|
174
|
+
toolName: 'remove_slack_reaction',
|
|
175
|
+
description: "Remove the bot's own emoji reaction from a Slack message. Cannot remove other users' reactions.",
|
|
176
|
+
parameters: [
|
|
177
|
+
p('channel', 'Channel where the message lives.'),
|
|
178
|
+
p('ts', 'Timestamp of the message.'),
|
|
179
|
+
p('name', 'Emoji name without colons.'),
|
|
180
|
+
],
|
|
181
|
+
},
|
|
182
|
+
// ── Users ────────────────────────────────────────────────────────
|
|
183
|
+
{
|
|
184
|
+
operation: 'listUsers',
|
|
185
|
+
label: 'List users',
|
|
186
|
+
toolName: 'list_slack_users',
|
|
187
|
+
description: 'List human members of the Slack workspace. Returns id, name, real_name, email, avatarUrl. Excludes deleted users + bots by default.',
|
|
188
|
+
parameters: [
|
|
189
|
+
p('limit', 'Max users to return (1-1000). Default 200.', false, 'number'),
|
|
190
|
+
p('includeDeleted', 'Include deactivated users. Default false.', false, 'boolean'),
|
|
191
|
+
p('includeBots', 'Include bot users + app users. Default false.', false, 'boolean'),
|
|
192
|
+
],
|
|
193
|
+
},
|
|
194
|
+
{
|
|
195
|
+
operation: 'getUserInfo',
|
|
196
|
+
label: 'Get user info',
|
|
197
|
+
toolName: 'get_slack_user_info',
|
|
198
|
+
description: 'Fetch a Slack user profile (real_name, email, timezone, status, avatar). Use BEFORE sendEphemeral to confirm the user id is valid.',
|
|
199
|
+
parameters: [p('user', 'User id (U…) to look up.')],
|
|
200
|
+
},
|
|
201
|
+
// ── Files ────────────────────────────────────────────────────────
|
|
202
|
+
{
|
|
203
|
+
operation: 'uploadFile',
|
|
204
|
+
label: 'Upload file',
|
|
205
|
+
toolName: 'upload_slack_file',
|
|
206
|
+
description: 'Upload a file to Slack and optionally share it in a channel. Provide either a public `url` to fetch or inline `contentBase64` for small payloads. Optionally attach to a thread via `threadTs`.',
|
|
207
|
+
parameters: [
|
|
208
|
+
p('url', 'Public URL or HW _file.downloadUrl that HW will fetch and re-upload.', false),
|
|
209
|
+
p('contentBase64', 'Inline base64 file content (alternative to url).', false),
|
|
210
|
+
p('filename', 'Display name in Slack. Auto-derived from URL when omitted.', false),
|
|
211
|
+
p('channel', 'Channel id to share the uploaded file in.', false),
|
|
212
|
+
p('title', 'Title shown above the file.', false),
|
|
213
|
+
p('initialComment', 'Message Slack posts together with the file.', false),
|
|
214
|
+
p('threadTs', 'Thread to attach the file to.', false),
|
|
215
|
+
],
|
|
216
|
+
},
|
|
217
|
+
];
|
|
218
|
+
exports.SLACK_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.SLACK_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
|
package/package.json
CHANGED