@hostwebhook/node-types 1.52.8 → 1.52.10

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/index.d.ts CHANGED
@@ -21,6 +21,8 @@ export { SLACK_OPERATIONS, SLACK_OPERATION_SPECS, isSlackOperation, } from './sl
21
21
  export type { SlackOperation, SlackParamSpec, SlackOperationSpec, } from './slack-operations';
22
22
  export { SHEETS_OPERATIONS, SHEETS_OPERATION_SPECS, isSheetsOperation, } from './sheets-operations';
23
23
  export type { SheetsOperation, SheetsParamSpec, SheetsOperationSpec, } from './sheets-operations';
24
+ export { SHEETS_TOOLKIT_SPECS, SHEETS_TOOLKIT_BY_TOOL_NAME, SHEETS_TOOLKIT_DEFAULTABLE, } from './sheets-toolkit';
25
+ export type { SheetsToolkitSpec, SheetsToolkitParameter, } from './sheets-toolkit';
24
26
  export { GOOGLE_CONTACTS_OPERATIONS, GOOGLE_CONTACTS_OPERATIONS_V1, GOOGLE_CONTACTS_OPERATIONS_V2, GOOGLE_CONTACTS_OPERATION_SPECS, GOOGLE_CONTACTS_OPERATION_GROUPS, GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS, isGoogleContactsOperation, } from './google-contacts-operations';
25
27
  export type { GoogleContactsOperation, GoogleContactsParamSpec, GoogleContactsOperationSpec, GoogleContactsOperationGroup, } from './google-contacts-operations';
26
28
  export type { CredentialTypeRegistration, CredentialType } from './credentials';
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isGoogleContactsOperation = exports.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS = 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.isSheetsOperation = exports.SHEETS_OPERATION_SPECS = exports.SHEETS_OPERATIONS = exports.isSlackOperation = exports.SLACK_OPERATION_SPECS = exports.SLACK_OPERATIONS = exports.isDiscordOperation = exports.DISCORD_OPERATION_SPECS = exports.DISCORD_OPERATIONS = exports.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = 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.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = void 0;
3
+ exports.GOOGLE_CONTACTS_DEFAULT_PERSON_FIELDS = 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.isSlackOperation = exports.SLACK_OPERATION_SPECS = exports.SLACK_OPERATIONS = exports.isDiscordOperation = exports.DISCORD_OPERATION_SPECS = exports.DISCORD_OPERATIONS = exports.isWhatsAppOperation = exports.WHATSAPP_OPERATIONS = exports.isTelegramOperation = exports.TELEGRAM_OPERATIONS = exports.isDriveOperation = exports.DRIVE_OPERATIONS = exports.isGoogleCalendarOperation = exports.GOOGLE_CALENDAR_OPERATIONS = exports.isGmailOperation = exports.GMAIL_OPERATIONS = 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.isCredentialType = exports.getCredentialType = exports.credentialTypeValues = exports.CREDENTIAL_TYPE_VALUES = exports.CREDENTIAL_TYPES = exports.isGoogleContactsOperation = void 0;
5
5
  var types_1 = require("./types");
6
6
  Object.defineProperty(exports, "singleMeta", { enumerable: true, get: function () { return types_1.singleMeta; } });
7
7
  Object.defineProperty(exports, "iterableMeta", { enumerable: true, get: function () { return types_1.iterableMeta; } });
@@ -60,6 +60,10 @@ var sheets_operations_1 = require("./sheets-operations");
60
60
  Object.defineProperty(exports, "SHEETS_OPERATIONS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATIONS; } });
61
61
  Object.defineProperty(exports, "SHEETS_OPERATION_SPECS", { enumerable: true, get: function () { return sheets_operations_1.SHEETS_OPERATION_SPECS; } });
62
62
  Object.defineProperty(exports, "isSheetsOperation", { enumerable: true, get: function () { return sheets_operations_1.isSheetsOperation; } });
63
+ var sheets_toolkit_1 = require("./sheets-toolkit");
64
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_SPECS", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_SPECS; } });
65
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_BY_TOOL_NAME", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_BY_TOOL_NAME; } });
66
+ Object.defineProperty(exports, "SHEETS_TOOLKIT_DEFAULTABLE", { enumerable: true, get: function () { return sheets_toolkit_1.SHEETS_TOOLKIT_DEFAULTABLE; } });
63
67
  var google_contacts_operations_1 = require("./google-contacts-operations");
64
68
  Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATIONS", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_OPERATIONS; } });
65
69
  Object.defineProperty(exports, "GOOGLE_CONTACTS_OPERATIONS_V1", { enumerable: true, get: function () { return google_contacts_operations_1.GOOGLE_CONTACTS_OPERATIONS_V1; } });
@@ -0,0 +1,42 @@
1
+ /**
2
+ * Google Sheets AI Toolkit — las herramientas que un sheetsAction expone
3
+ * cuando `aiEnabled` está encendido.
4
+ *
5
+ * **Se escribe una sola vez.** Las especificaciones de toolkit de los demás
6
+ * nodos viven dos veces —una copia en el dashboard y otra en
7
+ * `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y sin nada que las
8
+ * ate— y de ahí salió que Contacts anunciara 15 herramientas y expusiera una.
9
+ * Sheets empieza por el otro lado: aquí, y las dos capas la importan.
10
+ *
11
+ * La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
12
+ * pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
13
+ * y quien mire la lista de herramientas del servidor MCP.
14
+ */
15
+ import type { SheetsOperation } from './sheets-operations';
16
+ export interface SheetsToolkitParameter {
17
+ name: string;
18
+ /** El esquema MCP sólo admite estos tres; lo estructurado viaja como JSON
19
+ * en un `string`, igual que el `contacts` del toolkit de Contacts. */
20
+ type: 'string' | 'number' | 'boolean';
21
+ description: string;
22
+ required: boolean;
23
+ }
24
+ export interface SheetsToolkitSpec {
25
+ operation: SheetsOperation;
26
+ label: string;
27
+ toolName: string;
28
+ description: string;
29
+ parameters: SheetsToolkitParameter[];
30
+ /** Escribe en la hoja del usuario. Lo usa la confirmación previa del AI Node. */
31
+ destructive?: boolean;
32
+ }
33
+ export declare const SHEETS_TOOLKIT_SPECS: SheetsToolkitSpec[];
34
+ /** Las herramientas por nombre, para despachar una llamada del modelo. */
35
+ export declare const SHEETS_TOOLKIT_BY_TOOL_NAME: Record<string, SheetsToolkitSpec>;
36
+ /**
37
+ * Los dos parámetros que el nodo puede rellenar por defecto. Se exporta para
38
+ * que la api y el dashboard no vuelvan a escribir la lista a mano —
39
+ * `create_spreadsheet` no declara ninguno de los dos y por eso se queda fuera
40
+ * de la inyección sin necesidad de excepciones.
41
+ */
42
+ export declare const SHEETS_TOOLKIT_DEFAULTABLE: readonly ["spreadsheetId", "sheetName"];
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ /**
3
+ * Google Sheets AI Toolkit — las herramientas que un sheetsAction expone
4
+ * cuando `aiEnabled` está encendido.
5
+ *
6
+ * **Se escribe una sola vez.** Las especificaciones de toolkit de los demás
7
+ * nodos viven dos veces —una copia en el dashboard y otra en
8
+ * `api/src/mcp-servers/toolkit-specs.ts`, las dos a mano y sin nada que las
9
+ * ate— y de ahí salió que Contacts anunciara 15 herramientas y expusiera una.
10
+ * Sheets empieza por el otro lado: aquí, y las dos capas la importan.
11
+ *
12
+ * La forma es la que ya consume `toolkitSpecToMcpTool` en la api, para que
13
+ * pueda usarse sin adaptador. Los textos van en inglés porque los lee el modelo
14
+ * y quien mire la lista de herramientas del servidor MCP.
15
+ */
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.SHEETS_TOOLKIT_DEFAULTABLE = exports.SHEETS_TOOLKIT_BY_TOOL_NAME = exports.SHEETS_TOOLKIT_SPECS = void 0;
18
+ const p = (name, description, required = true, type = 'string') => ({ name, type, description, required });
19
+ /*
20
+ * La hoja y la pestaña del nodo van como **defecto**, y el modelo puede
21
+ * cambiarlas — la misma decisión que el canal por defecto de Slack, y la misma
22
+ * maquinaria: `toolkitSpecToMcpTool(spec, nombre, { spreadsheetId, sheetName })`
23
+ * saca esos dos de `required` **y le cuenta el valor al modelo** en la
24
+ * descripción. Las dos cosas o ninguna: mientras el esquema diga `required`, el
25
+ * LLM siempre los rellena, nunca los omite, y el valor configurado no se usaría
26
+ * jamás.
27
+ *
28
+ * Por eso aquí se declaran `required: true`: lo son para la API de Google, y es
29
+ * el defecto del nodo quien los vuelve opcionales, nodo por nodo.
30
+ *
31
+ * `create_spreadsheet` es el único que NO los declara —no hay documento todavía
32
+ * al que apuntar— y su título se llama `title`, no `sheetName`. Si se llamara
33
+ * `sheetName`, la inyección de defectos vería que la operación declara ese
34
+ * parámetro y le pasaría como título el nombre de la pestaña del nodo: el
35
+ * documento nuevo nacería llamándose «Sheet1».
36
+ */
37
+ const hoja = () => p('spreadsheetId', "Id of the Google Sheets document — the long chunk of its URL, between /d/ and /edit.");
38
+ const pestana = () => p('sheetName', 'Name of the tab inside the document, exactly as it reads on its tab strip.');
39
+ 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.`);
40
+ exports.SHEETS_TOOLKIT_SPECS = [
41
+ {
42
+ operation: 'appendRow',
43
+ label: 'Append row',
44
+ toolName: 'append_row',
45
+ 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.',
46
+ parameters: [fila('the values of the new row'), hoja(), pestana()],
47
+ destructive: true,
48
+ },
49
+ {
50
+ operation: 'updateRow',
51
+ label: 'Update row',
52
+ toolName: 'update_row',
53
+ description: 'Find a row by the value of one column and overwrite the cells you pass. When no row matches it writes nothing — it does not create one.',
54
+ parameters: [
55
+ p('matchColumn', 'Header of the column to search in, e.g. "Email".'),
56
+ p('matchValue', 'Value to look for inside that column. The whole cell is compared, not a fragment.'),
57
+ fila('the cells to overwrite; the ones you leave out keep their value'),
58
+ hoja(),
59
+ pestana(),
60
+ ],
61
+ destructive: true,
62
+ },
63
+ {
64
+ operation: 'appendOrUpdateRow',
65
+ label: 'Append or update row',
66
+ toolName: 'append_or_update_row',
67
+ description: 'Find a row by the value of one column: update it when it exists, append it at the bottom when it does not. This is the one to use to keep a sheet in sync without duplicating rows.',
68
+ parameters: [
69
+ p('matchColumn', 'Header of the column that identifies the row, e.g. "Email".'),
70
+ p('matchValue', 'Value to look for in that column. When it is not there, the row is appended.'),
71
+ fila('the values of the row, used both to update and to append'),
72
+ hoja(),
73
+ pestana(),
74
+ ],
75
+ destructive: true,
76
+ },
77
+ {
78
+ operation: 'readRange',
79
+ label: 'Read range',
80
+ toolName: 'read_range',
81
+ description: 'Read the cells of an A1-notation range and return them as rows of text, without reading headers. To read data with its column names, get_rows is more useful.',
82
+ parameters: [
83
+ p('range', 'A1-notation range relative to the tab, e.g. "A2:D100". Do not prefix it with the tab name.'),
84
+ hoja(),
85
+ pestana(),
86
+ ],
87
+ },
88
+ {
89
+ operation: 'getRows',
90
+ label: 'Get rows',
91
+ toolName: 'get_rows',
92
+ description: "Read every row of the tab and return them as objects keyed by the sheet's headers. This is how you find out which columns a sheet has before writing to it.",
93
+ parameters: [hoja(), pestana()],
94
+ },
95
+ {
96
+ operation: 'createSpreadsheet',
97
+ label: 'Create spreadsheet',
98
+ toolName: 'create_spreadsheet',
99
+ description: "Create a new, empty Google Sheets document and return its id and URL. It writes no data: to fill it, call append_row afterwards with the id it returns. It lands wherever the node's Save Location says — you do not choose that.",
100
+ /*
101
+ * Sin `folderId` a propósito, y esta es la excepción a «defecto del nodo que
102
+ * el modelo puede cambiar».
103
+ *
104
+ * La hoja sí se le ofrece porque el modelo tiene de dónde sacar un id: se lo
105
+ * dice quien escribe, o lo devuelve un get_rows. Un id de carpeta de Drive
106
+ * no: no hay ninguna herramienta aquí que las liste, así que sólo podría
107
+ * inventárselo, y un id inventado falla mientras uno real acertado por
108
+ * casualidad escribe en la carpeta de otro. La carpeta la elige la persona
109
+ * en el nodo, y la api la aplica.
110
+ */
111
+ parameters: [p('title', 'Name of the new document.')],
112
+ destructive: true,
113
+ },
114
+ ];
115
+ /** Las herramientas por nombre, para despachar una llamada del modelo. */
116
+ exports.SHEETS_TOOLKIT_BY_TOOL_NAME = Object.fromEntries(exports.SHEETS_TOOLKIT_SPECS.map((s) => [s.toolName, s]));
117
+ /**
118
+ * Los dos parámetros que el nodo puede rellenar por defecto. Se exporta para
119
+ * que la api y el dashboard no vuelvan a escribir la lista a mano —
120
+ * `create_spreadsheet` no declara ninguno de los dos y por eso se queda fuera
121
+ * de la inyección sin necesidad de excepciones.
122
+ */
123
+ exports.SHEETS_TOOLKIT_DEFAULTABLE = ['spreadsheetId', 'sheetName'];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hostwebhook/node-types",
3
- "version": "1.52.8",
3
+ "version": "1.52.10",
4
4
  "description": "Shared node type definitions, connection rules, and dispatch config for HostWebhook",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",