@hostwebhook/node-types 1.86.0 → 1.87.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.
Files changed (55) hide show
  1. package/dist/calendar-toolkit.d.ts +3 -0
  2. package/dist/calendar-toolkit.js +3 -2
  3. package/dist/clase-de-herramienta.d.ts +61 -0
  4. package/dist/clase-de-herramienta.js +153 -0
  5. package/dist/discord-toolkit.d.ts +2 -3
  6. package/dist/discord-toolkit.js +3 -6
  7. package/dist/docs-toolkit.d.ts +2 -1
  8. package/dist/docs-toolkit.js +3 -6
  9. package/dist/drive-toolkit.d.ts +9 -4
  10. package/dist/drive-toolkit.js +3 -4
  11. package/dist/esm/calendar-toolkit.d.ts +3 -0
  12. package/dist/esm/calendar-toolkit.js +3 -2
  13. package/dist/esm/clase-de-herramienta.d.ts +61 -0
  14. package/dist/esm/clase-de-herramienta.js +148 -0
  15. package/dist/esm/discord-toolkit.d.ts +2 -3
  16. package/dist/esm/discord-toolkit.js +3 -6
  17. package/dist/esm/docs-toolkit.d.ts +2 -1
  18. package/dist/esm/docs-toolkit.js +3 -6
  19. package/dist/esm/drive-toolkit.d.ts +9 -4
  20. package/dist/esm/drive-toolkit.js +3 -4
  21. package/dist/esm/gmail-operations.d.ts +2 -0
  22. package/dist/esm/gmail-operations.js +7 -6
  23. package/dist/esm/index.d.ts +8 -0
  24. package/dist/esm/index.js +5 -0
  25. package/dist/esm/mongo-toolkit.d.ts +47 -0
  26. package/dist/esm/mongo-toolkit.js +98 -0
  27. package/dist/esm/postgres-toolkit.d.ts +52 -0
  28. package/dist/esm/postgres-toolkit.js +85 -0
  29. package/dist/esm/registry.js +10 -0
  30. package/dist/esm/sheets-toolkit.d.ts +2 -1
  31. package/dist/esm/sheets-toolkit.js +3 -6
  32. package/dist/esm/slack-toolkit.d.ts +2 -3
  33. package/dist/esm/slack-toolkit.js +3 -4
  34. package/dist/esm/telegram-toolkit.d.ts +3 -0
  35. package/dist/esm/telegram-toolkit.js +3 -2
  36. package/dist/esm/toolkits.d.ts +47 -0
  37. package/dist/esm/toolkits.js +74 -0
  38. package/dist/gmail-operations.d.ts +2 -0
  39. package/dist/gmail-operations.js +11 -10
  40. package/dist/index.d.ts +8 -0
  41. package/dist/index.js +16 -1
  42. package/dist/mongo-toolkit.d.ts +47 -0
  43. package/dist/mongo-toolkit.js +101 -0
  44. package/dist/postgres-toolkit.d.ts +52 -0
  45. package/dist/postgres-toolkit.js +88 -0
  46. package/dist/registry.js +10 -0
  47. package/dist/sheets-toolkit.d.ts +2 -1
  48. package/dist/sheets-toolkit.js +3 -6
  49. package/dist/slack-toolkit.d.ts +2 -3
  50. package/dist/slack-toolkit.js +3 -4
  51. package/dist/telegram-toolkit.d.ts +3 -0
  52. package/dist/telegram-toolkit.js +3 -2
  53. package/dist/toolkits.d.ts +47 -0
  54. package/dist/toolkits.js +79 -0
  55. package/package.json +1 -1
package/dist/registry.js CHANGED
@@ -412,6 +412,11 @@ exports.NODE_REGISTRY = {
412
412
  allStateKey: "allMongoActions",
413
413
  color: "#34d399",
414
414
  testable: true,
415
+ /* Modo AI toolkit (2026-09-24): con `aiEnabled` el nodo sólo lo llama un
416
+ AI Node —como el resto de toolkits—, y una arista del lienzo no le
417
+ llevaría nada. Hasta que la api y el dashboard le den `aiEnabled`, el
418
+ campo no existe y esto devuelve `false`: no cambia nada. */
419
+ isToolOnly: (e) => e.aiEnabled === true,
415
420
  },
416
421
  postgresAction: {
417
422
  type: "postgresAction",
@@ -424,6 +429,11 @@ exports.NODE_REGISTRY = {
424
429
  allStateKey: "allPostgresActions",
425
430
  color: "#336791",
426
431
  testable: true,
432
+ /* Modo AI toolkit (2026-09-24): con `aiEnabled` el nodo sólo lo llama un
433
+ AI Node —como el resto de toolkits—, y una arista del lienzo no le
434
+ llevaría nada. Hasta que la api y el dashboard le den `aiEnabled`, el
435
+ campo no existe y esto devuelve `false`: no cambia nada. */
436
+ isToolOnly: (e) => e.aiEnabled === true,
427
437
  },
428
438
  notificationAction: {
429
439
  type: "notificationAction",
@@ -34,7 +34,8 @@ export interface SheetsToolkitSpec {
34
34
  toolName: string;
35
35
  description: string;
36
36
  parameters: SheetsToolkitParameter[];
37
- /** Escribe en la hoja del usuario. Lo usa la confirmación previa del AI Node. */
37
+ /** Pisa o borra. Lo pone `marcarDestructivas` leyendo el verbo del
38
+ * nombre (ver `clase-de-herramienta.ts`), no se escribe a mano. */
38
39
  destructive?: boolean;
39
40
  }
40
41
  export declare const SHEETS_TOOLKIT_SPECS: SheetsToolkitSpec[];
@@ -22,6 +22,7 @@
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = void 0;
25
+ const clase_de_herramienta_js_1 = require("./clase-de-herramienta.js");
25
26
  const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
26
27
  /*
27
28
  * La hoja y la pestaña del nodo van como **defecto**, y el modelo puede
@@ -44,14 +45,13 @@ const p = (name, description, required = true, type = 'string') => ({ name, type
44
45
  const hoja = () => p('spreadsheetId', "Id of the Google Sheets document — the long chunk of its URL, between /d/ and /edit.");
45
46
  const pestana = () => p('sheetName', 'Name of the tab inside the document, exactly as it reads on its tab strip.');
46
47
  const fila = (que) => p('row', `JSON object holding ${que}. Keys are the sheet's **header names**, spelled exactly as they appear in its title row: {"Name": "Ariel", "Email": "a@b.c"}. A key that is not a header makes the call fail, so when you do not know the headers, call get_rows first.`);
47
- exports.SHEETS_TOOLKIT_SPECS = [
48
+ exports.SHEETS_TOOLKIT_SPECS = (0, clase_de_herramienta_js_1.marcarDestructivas)([
48
49
  {
49
50
  operation: 'appendRow',
50
51
  label: 'Append row',
51
52
  toolName: 'append_row',
52
53
  description: 'Add a new row at the bottom of the tab. It does not check whether the row already exists — when it might, use append_or_update_row instead so you do not duplicate it.',
53
54
  parameters: [fila('the values of the new row'), hoja(), pestana()],
54
- destructive: true,
55
55
  },
56
56
  {
57
57
  operation: 'updateRow',
@@ -65,7 +65,6 @@ exports.SHEETS_TOOLKIT_SPECS = [
65
65
  hoja(),
66
66
  pestana(),
67
67
  ],
68
- destructive: true,
69
68
  },
70
69
  {
71
70
  operation: 'appendOrUpdateRow',
@@ -79,7 +78,6 @@ exports.SHEETS_TOOLKIT_SPECS = [
79
78
  hoja(),
80
79
  pestana(),
81
80
  ],
82
- destructive: true,
83
81
  },
84
82
  {
85
83
  operation: 'readRange',
@@ -116,9 +114,8 @@ exports.SHEETS_TOOLKIT_SPECS = [
116
114
  * en el nodo, y la api la aplica.
117
115
  */
118
116
  parameters: [p('title', 'Name of the new document.')],
119
- destructive: true,
120
117
  },
121
- ];
118
+ ]);
122
119
  /** Las herramientas por nombre, para despachar una llamada del modelo. */
123
120
  exports.SHEETS_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.SHEETS_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
124
121
  /**
@@ -38,9 +38,8 @@ export interface SlackToolkitSpec {
38
38
  /** Descripción (más reglas de uso) que ve el LLM. */
39
39
  description: string;
40
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. */
41
+ /** Pisa o borra. Lo pone `marcarDestructivas` leyendo el verbo del
42
+ * nombre (ver `clase-de-herramienta.ts`), no se escribe a mano. */
44
43
  destructive?: boolean;
45
44
  }
46
45
  export declare const SLACK_TOOLKIT_SPECS: SlackToolkitSpec[];
@@ -27,8 +27,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
27
27
  exports.SLACK_TOOLKIT_BY_TOOL_NAME = exports.SLACK_TOOLKIT_SPECS = void 0;
28
28
  exports.herramientasDeSlackPara = herramientasDeSlackPara;
29
29
  const slack_operations_js_1 = require("./slack-operations.js");
30
+ const clase_de_herramienta_js_1 = require("./clase-de-herramienta.js");
30
31
  const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
31
- exports.SLACK_TOOLKIT_SPECS = [
32
+ exports.SLACK_TOOLKIT_SPECS = (0, clase_de_herramienta_js_1.marcarDestructivas)([
32
33
  // ── Messages ─────────────────────────────────────────────────────
33
34
  {
34
35
  operation: 'sendMessage',
@@ -67,7 +68,6 @@ exports.SLACK_TOOLKIT_SPECS = [
67
68
  p('channel', 'Channel where the message lives.'),
68
69
  p('ts', 'Timestamp of the message to delete.'),
69
70
  ],
70
- destructive: true,
71
71
  },
72
72
  {
73
73
  operation: 'sendEphemeral',
@@ -146,7 +146,6 @@ exports.SLACK_TOOLKIT_SPECS = [
146
146
  p('name', 'Channel name — lowercase, no spaces, max 80 chars.'),
147
147
  p('isPrivate', 'Create a private channel instead of public. Default false.', false, 'boolean'),
148
148
  ],
149
- destructive: true,
150
149
  },
151
150
  {
152
151
  operation: 'inviteToChannel',
@@ -216,7 +215,7 @@ exports.SLACK_TOOLKIT_SPECS = [
216
215
  p('threadTs', 'Thread to attach the file to.', false),
217
216
  ],
218
217
  },
219
- ];
218
+ ]);
220
219
  exports.SLACK_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.SLACK_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
221
220
  /**
222
221
  * Las herramientas que ofrecerle al modelo con ESTA credencial.
@@ -39,6 +39,9 @@ export interface TelegramToolkitSpec {
39
39
  /** Descripción (más reglas de uso) que ve el LLM. */
40
40
  description: string;
41
41
  parameters: TelegramToolkitParameter[];
42
+ /** Pisa o borra. Lo pone `marcarDestructivas` leyendo el verbo del
43
+ * nombre (ver `clase-de-herramienta.ts`), no se escribe a mano. */
44
+ destructive?: boolean;
42
45
  /**
43
46
  * Encabezado de grupo para la lista de la página de detalle. Las filas
44
47
  * consecutivas que comparten grupo se pintan bajo un único título, así que el
@@ -22,6 +22,7 @@
22
22
  */
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
24
  exports.TELEGRAM_TOOLKIT_BY_TOOL_NAME = exports.TELEGRAM_TOOLKIT_SPECS = void 0;
25
+ const clase_de_herramienta_js_1 = require("./clase-de-herramienta.js");
25
26
  const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
26
27
  /*
27
28
  * `sendAndWaitForResponse` NO está aquí, y es una decisión, no un olvido: la op
@@ -36,7 +37,7 @@ const p = (name, description, required = true, type = 'string') => ({ name, type
36
37
  * campo en ninguna de las dos capas, y añadirlo cambiaría cuándo el AI Node pide
37
38
  * confirmación. Eso es otra decisión, no parte de mudar el esquema de sitio.
38
39
  */
39
- exports.TELEGRAM_TOOLKIT_SPECS = [
40
+ exports.TELEGRAM_TOOLKIT_SPECS = (0, clase_de_herramienta_js_1.marcarDestructivas)([
40
41
  {
41
42
  operation: 'sendMessage',
42
43
  label: 'Send message',
@@ -181,6 +182,6 @@ exports.TELEGRAM_TOOLKIT_SPECS = [
181
182
  p('showAlert', 'Optional. true = modal alert; false (default) = toast notification.', false, 'boolean'),
182
183
  ],
183
184
  },
184
- ];
185
+ ]);
185
186
  /** Las herramientas por nombre, para despachar una llamada del modelo. */
186
187
  exports.TELEGRAM_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.TELEGRAM_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
@@ -0,0 +1,47 @@
1
+ /**
2
+ * Los toolkits por tipo de nodo: qué herramientas expone cada nodo en modo
3
+ * AI toolkit, en un solo sitio.
4
+ *
5
+ * ## Para qué (2026-09-24)
6
+ *
7
+ * Para que el gate «Block destructive tool calls» del AI Node pueda preguntar
8
+ * por la OPERACIÓN y no sólo por el nombre. Hasta hoy sólo miraba el nombre
9
+ * contra unos patrones (`delete_*`, `drop_*`…), así que `update_row` de Sheets
10
+ * —que pisa una fila— pasaba con el gate encendido. Con esto, la herramienta
11
+ * que el AI Node guardó al conectar (`nodeRefType` + `operationOverride`) se
12
+ * resuelve aquí a su operación, y su `destructive` —que sale del verbo, ver
13
+ * `clase-de-herramienta.ts`— decide.
14
+ *
15
+ * ## Lo que falta aquí, a propósito
16
+ *
17
+ * WhatsApp y Contacts siguen con sus specs escritos a mano en la api y en el
18
+ * dashboard, no en este paquete. Hasta que se muden, quien consulte este
19
+ * registro tiene que componerlos por su lado — {@link esOperacionDestructiva}
20
+ * devuelve `null` para ellos, que significa «no lo sé», no «no es
21
+ * destructiva».
22
+ */
23
+ /** Lo mínimo de una herramienta de toolkit que hace falta para decidir. */
24
+ export interface OperacionDeToolkit {
25
+ operation: string;
26
+ toolName: string;
27
+ label: string;
28
+ destructive?: boolean;
29
+ }
30
+ export declare const TOOLKITS_POR_TIPO: Readonly<Record<string, readonly OperacionDeToolkit[]>>;
31
+ /**
32
+ * La operación de un toolkit, buscada por su nombre interno (`updateRow`) O
33
+ * por el nombre de su herramienta (`update_row`).
34
+ *
35
+ * Las dos formas porque las dos llegan: el AI Node guarda `operationOverride`
36
+ * con el nombre interno, y el servidor MCP recibe el nombre de la herramienta.
37
+ */
38
+ export declare function operacionDeToolkit(nodeType: string | undefined | null, operacionONombre: string | undefined | null): OperacionDeToolkit | null;
39
+ /**
40
+ * ¿Es destructiva esta operación de toolkit?
41
+ *
42
+ * `null` cuando no se sabe —el tipo no es un toolkit de este paquete, o la
43
+ * operación no existe en él—. Quien llama decide qué hace con el «no sé»; el
44
+ * gate del AI Node lo combina con los patrones de nombre, que siguen ahí para
45
+ * las herramientas que no son de toolkit (MCP, HTTP…).
46
+ */
47
+ export declare function esOperacionDestructiva(nodeType: string | undefined | null, operacionONombre: string | undefined | null): boolean | null;
@@ -0,0 +1,79 @@
1
+ "use strict";
2
+ /**
3
+ * Los toolkits por tipo de nodo: qué herramientas expone cada nodo en modo
4
+ * AI toolkit, en un solo sitio.
5
+ *
6
+ * ## Para qué (2026-09-24)
7
+ *
8
+ * Para que el gate «Block destructive tool calls» del AI Node pueda preguntar
9
+ * por la OPERACIÓN y no sólo por el nombre. Hasta hoy sólo miraba el nombre
10
+ * contra unos patrones (`delete_*`, `drop_*`…), así que `update_row` de Sheets
11
+ * —que pisa una fila— pasaba con el gate encendido. Con esto, la herramienta
12
+ * que el AI Node guardó al conectar (`nodeRefType` + `operationOverride`) se
13
+ * resuelve aquí a su operación, y su `destructive` —que sale del verbo, ver
14
+ * `clase-de-herramienta.ts`— decide.
15
+ *
16
+ * ## Lo que falta aquí, a propósito
17
+ *
18
+ * WhatsApp y Contacts siguen con sus specs escritos a mano en la api y en el
19
+ * dashboard, no en este paquete. Hasta que se muden, quien consulte este
20
+ * registro tiene que componerlos por su lado — {@link esOperacionDestructiva}
21
+ * devuelve `null` para ellos, que significa «no lo sé», no «no es
22
+ * destructiva».
23
+ */
24
+ Object.defineProperty(exports, "__esModule", { value: true });
25
+ exports.TOOLKITS_POR_TIPO = void 0;
26
+ exports.operacionDeToolkit = operacionDeToolkit;
27
+ exports.esOperacionDestructiva = esOperacionDestructiva;
28
+ const gmail_operations_js_1 = require("./gmail-operations.js");
29
+ const calendar_toolkit_js_1 = require("./calendar-toolkit.js");
30
+ const drive_toolkit_js_1 = require("./drive-toolkit.js");
31
+ const telegram_toolkit_js_1 = require("./telegram-toolkit.js");
32
+ const discord_toolkit_js_1 = require("./discord-toolkit.js");
33
+ const slack_toolkit_js_1 = require("./slack-toolkit.js");
34
+ const sheets_toolkit_js_1 = require("./sheets-toolkit.js");
35
+ const docs_toolkit_js_1 = require("./docs-toolkit.js");
36
+ const mongo_toolkit_js_1 = require("./mongo-toolkit.js");
37
+ const postgres_toolkit_js_1 = require("./postgres-toolkit.js");
38
+ exports.TOOLKITS_POR_TIPO = Object.freeze({
39
+ gmailAction: gmail_operations_js_1.GMAIL_ALL_TOOLKIT_SPECS,
40
+ emailAction: gmail_operations_js_1.NATIVE_EMAIL_TOOLKIT_SPECS,
41
+ calendarAction: calendar_toolkit_js_1.GOOGLE_CALENDAR_TOOLKIT_SPECS,
42
+ driveAction: drive_toolkit_js_1.DRIVE_TOOLKIT_SPECS,
43
+ telegramAction: telegram_toolkit_js_1.TELEGRAM_TOOLKIT_SPECS,
44
+ discordAction: discord_toolkit_js_1.DISCORD_TOOLKIT_SPECS,
45
+ slackAction: slack_toolkit_js_1.SLACK_TOOLKIT_SPECS,
46
+ sheetsAction: sheets_toolkit_js_1.SHEETS_TOOLKIT_SPECS,
47
+ docsAction: docs_toolkit_js_1.DOCS_TOOLKIT_SPECS,
48
+ mongoAction: mongo_toolkit_js_1.MONGO_TOOLKIT_SPECS,
49
+ postgresAction: postgres_toolkit_js_1.POSTGRES_TOOLKIT_SPECS,
50
+ });
51
+ /**
52
+ * La operación de un toolkit, buscada por su nombre interno (`updateRow`) O
53
+ * por el nombre de su herramienta (`update_row`).
54
+ *
55
+ * Las dos formas porque las dos llegan: el AI Node guarda `operationOverride`
56
+ * con el nombre interno, y el servidor MCP recibe el nombre de la herramienta.
57
+ */
58
+ function operacionDeToolkit(nodeType, operacionONombre) {
59
+ if (!nodeType || !operacionONombre)
60
+ return null;
61
+ const toolkit = exports.TOOLKITS_POR_TIPO[nodeType];
62
+ if (!toolkit)
63
+ return null;
64
+ return (toolkit.find((s) => s.operation === operacionONombre) ??
65
+ toolkit.find((s) => s.toolName === operacionONombre) ??
66
+ null);
67
+ }
68
+ /**
69
+ * ¿Es destructiva esta operación de toolkit?
70
+ *
71
+ * `null` cuando no se sabe —el tipo no es un toolkit de este paquete, o la
72
+ * operación no existe en él—. Quien llama decide qué hace con el «no sé»; el
73
+ * gate del AI Node lo combina con los patrones de nombre, que siguen ahí para
74
+ * las herramientas que no son de toolkit (MCP, HTTP…).
75
+ */
76
+ function esOperacionDestructiva(nodeType, operacionONombre) {
77
+ const op = operacionDeToolkit(nodeType, operacionONombre);
78
+ return op ? op.destructive === true : null;
79
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/node-types",
3
- "version": "1.86.0",
3
+ "version": "1.87.0",
4
4
  "description": "Shared node type definitions, connection rules, and dispatch config for HostWebhook",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/esm/index.js",