@loomcycle/n8n-nodes-loomcycle 1.0.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/LICENSE +201 -0
- package/README.md +190 -0
- package/dist/credentials/LoomCycleApi.credentials.d.ts +21 -0
- package/dist/credentials/LoomCycleApi.credentials.js +81 -0
- package/dist/credentials/LoomCycleApi.credentials.js.map +1 -0
- package/dist/nodes/LoomCycle/LoomCycle.node.d.ts +22 -0
- package/dist/nodes/LoomCycle/LoomCycle.node.js +403 -0
- package/dist/nodes/LoomCycle/LoomCycle.node.js.map +1 -0
- package/dist/nodes/LoomCycle/LoomCycle.node.json +13 -0
- package/dist/nodes/LoomCycle/LoomCycle.svg +13 -0
- package/dist/nodes/LoomCycle/descriptions/agentdef.d.ts +21 -0
- package/dist/nodes/LoomCycle/descriptions/agentdef.js +155 -0
- package/dist/nodes/LoomCycle/descriptions/agentdef.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/channels.d.ts +19 -0
- package/dist/nodes/LoomCycle/descriptions/channels.js +164 -0
- package/dist/nodes/LoomCycle/descriptions/channels.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/index.d.ts +6 -0
- package/dist/nodes/LoomCycle/descriptions/index.js +16 -0
- package/dist/nodes/LoomCycle/descriptions/index.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/mcpserverdef.d.ts +29 -0
- package/dist/nodes/LoomCycle/descriptions/mcpserverdef.js +241 -0
- package/dist/nodes/LoomCycle/descriptions/mcpserverdef.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/memory.d.ts +20 -0
- package/dist/nodes/LoomCycle/descriptions/memory.js +119 -0
- package/dist/nodes/LoomCycle/descriptions/memory.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/runs.d.ts +17 -0
- package/dist/nodes/LoomCycle/descriptions/runs.js +226 -0
- package/dist/nodes/LoomCycle/descriptions/runs.js.map +1 -0
- package/dist/nodes/LoomCycle/descriptions/skilldef.d.ts +10 -0
- package/dist/nodes/LoomCycle/descriptions/skilldef.js +144 -0
- package/dist/nodes/LoomCycle/descriptions/skilldef.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/capability.d.ts +42 -0
- package/dist/nodes/LoomCycle/helpers/capability.js +54 -0
- package/dist/nodes/LoomCycle/helpers/capability.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/client.d.ts +15 -0
- package/dist/nodes/LoomCycle/helpers/client.js +30 -0
- package/dist/nodes/LoomCycle/helpers/client.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/envVarHints.d.ts +30 -0
- package/dist/nodes/LoomCycle/helpers/envVarHints.js +67 -0
- package/dist/nodes/LoomCycle/helpers/envVarHints.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/errors.d.ts +23 -0
- package/dist/nodes/LoomCycle/helpers/errors.js +189 -0
- package/dist/nodes/LoomCycle/helpers/errors.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/loadOptions.d.ts +24 -0
- package/dist/nodes/LoomCycle/helpers/loadOptions.js +89 -0
- package/dist/nodes/LoomCycle/helpers/loadOptions.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/segments.d.ts +13 -0
- package/dist/nodes/LoomCycle/helpers/segments.js +31 -0
- package/dist/nodes/LoomCycle/helpers/segments.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/staticData.d.ts +5 -0
- package/dist/nodes/LoomCycle/helpers/staticData.js +31 -0
- package/dist/nodes/LoomCycle/helpers/staticData.js.map +1 -0
- package/dist/nodes/LoomCycle/helpers/streaming.d.ts +31 -0
- package/dist/nodes/LoomCycle/helpers/streaming.js +48 -0
- package/dist/nodes/LoomCycle/helpers/streaming.js.map +1 -0
- package/dist/nodes/LoomCycleChannelMessage/LoomCycleChannelMessage.node.d.ts +24 -0
- package/dist/nodes/LoomCycleChannelMessage/LoomCycleChannelMessage.node.js +162 -0
- package/dist/nodes/LoomCycleChannelMessage/LoomCycleChannelMessage.node.js.map +1 -0
- package/dist/nodes/LoomCycleChannelMessage/LoomCycleChannelMessage.node.json +13 -0
- package/dist/nodes/LoomCycleChannelMessage/LoomCycleChannelMessage.svg +9 -0
- package/dist/nodes/LoomCycleChannelMessage/helpers/subscribe.d.ts +20 -0
- package/dist/nodes/LoomCycleChannelMessage/helpers/subscribe.js +106 -0
- package/dist/nodes/LoomCycleChannelMessage/helpers/subscribe.js.map +1 -0
- package/dist/nodes/LoomCycleChannelTool/LoomCycleChannelTool.node.d.ts +5 -0
- package/dist/nodes/LoomCycleChannelTool/LoomCycleChannelTool.node.js +114 -0
- package/dist/nodes/LoomCycleChannelTool/LoomCycleChannelTool.node.js.map +1 -0
- package/dist/nodes/LoomCycleChannelTool/LoomCycleChannelTool.node.json +13 -0
- package/dist/nodes/LoomCycleChannelTool/LoomCycleChannelTool.svg +13 -0
- package/dist/nodes/LoomCycleMcpServerTool/LoomCycleMcpServerTool.node.d.ts +5 -0
- package/dist/nodes/LoomCycleMcpServerTool/LoomCycleMcpServerTool.node.js +259 -0
- package/dist/nodes/LoomCycleMcpServerTool/LoomCycleMcpServerTool.node.js.map +1 -0
- package/dist/nodes/LoomCycleMcpServerTool/LoomCycleMcpServerTool.node.json +13 -0
- package/dist/nodes/LoomCycleMcpServerTool/LoomCycleMcpServerTool.svg +14 -0
- package/dist/nodes/LoomCycleMemoryTool/LoomCycleMemoryTool.node.d.ts +5 -0
- package/dist/nodes/LoomCycleMemoryTool/LoomCycleMemoryTool.node.js +108 -0
- package/dist/nodes/LoomCycleMemoryTool/LoomCycleMemoryTool.node.js.map +1 -0
- package/dist/nodes/LoomCycleMemoryTool/LoomCycleMemoryTool.node.json +13 -0
- package/dist/nodes/LoomCycleMemoryTool/LoomCycleMemoryTool.svg +11 -0
- package/dist/nodes/LoomCycleRunCompleted/LoomCycleRunCompleted.node.d.ts +18 -0
- package/dist/nodes/LoomCycleRunCompleted/LoomCycleRunCompleted.node.js +188 -0
- package/dist/nodes/LoomCycleRunCompleted/LoomCycleRunCompleted.node.js.map +1 -0
- package/dist/nodes/LoomCycleRunCompleted/LoomCycleRunCompleted.node.json +13 -0
- package/dist/nodes/LoomCycleRunCompleted/LoomCycleRunCompleted.svg +10 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/poll.d.ts +12 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/poll.js +69 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/poll.js.map +1 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/sse.d.ts +29 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/sse.js +61 -0
- package/dist/nodes/LoomCycleRunCompleted/helpers/sse.js.map +1 -0
- package/dist/nodes/LoomCycleSubAgentTool/LoomCycleSubAgentTool.node.d.ts +5 -0
- package/dist/nodes/LoomCycleSubAgentTool/LoomCycleSubAgentTool.node.js +131 -0
- package/dist/nodes/LoomCycleSubAgentTool/LoomCycleSubAgentTool.node.js.map +1 -0
- package/dist/nodes/LoomCycleSubAgentTool/LoomCycleSubAgentTool.node.json +13 -0
- package/dist/nodes/LoomCycleSubAgentTool/LoomCycleSubAgentTool.svg +12 -0
- package/dist/nodes/_shared/clusterTool.d.ts +19 -0
- package/dist/nodes/_shared/clusterTool.js +36 -0
- package/dist/nodes/_shared/clusterTool.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +86 -0
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Operation descriptions for the `run` resource of the LoomCycle umbrella
|
|
4
|
+
* node. Five ops:
|
|
5
|
+
* - Spawn → runStreaming (drained synchronously)
|
|
6
|
+
* - Get Status → getAgent
|
|
7
|
+
* - Wait → poll getAgent until terminal state
|
|
8
|
+
* - Cancel → cancelAgent (cascades via parent_agent_id)
|
|
9
|
+
* - List Agents → listUserAgents
|
|
10
|
+
*
|
|
11
|
+
* Long runs block the node's execute(); operators wanting async semantics
|
|
12
|
+
* should use the LoomCycle: Run Completed trigger (Sub-phase 2.3).
|
|
13
|
+
*
|
|
14
|
+
* Options arrays are alphabetised by name per the n8n-nodes-base
|
|
15
|
+
* convention (default values are selected by `value`, not array position).
|
|
16
|
+
*/
|
|
17
|
+
export declare const runOps: INodeProperties[];
|
|
@@ -0,0 +1,226 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.runOps = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Operation descriptions for the `run` resource of the LoomCycle umbrella
|
|
6
|
+
* node. Five ops:
|
|
7
|
+
* - Spawn → runStreaming (drained synchronously)
|
|
8
|
+
* - Get Status → getAgent
|
|
9
|
+
* - Wait → poll getAgent until terminal state
|
|
10
|
+
* - Cancel → cancelAgent (cascades via parent_agent_id)
|
|
11
|
+
* - List Agents → listUserAgents
|
|
12
|
+
*
|
|
13
|
+
* Long runs block the node's execute(); operators wanting async semantics
|
|
14
|
+
* should use the LoomCycle: Run Completed trigger (Sub-phase 2.3).
|
|
15
|
+
*
|
|
16
|
+
* Options arrays are alphabetised by name per the n8n-nodes-base
|
|
17
|
+
* convention (default values are selected by `value`, not array position).
|
|
18
|
+
*/
|
|
19
|
+
exports.runOps = [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'Operation',
|
|
22
|
+
name: 'operation',
|
|
23
|
+
type: 'options',
|
|
24
|
+
noDataExpression: true,
|
|
25
|
+
displayOptions: { show: { resource: ['run'] } },
|
|
26
|
+
options: [
|
|
27
|
+
{
|
|
28
|
+
name: 'Cancel',
|
|
29
|
+
value: 'cancel',
|
|
30
|
+
description: 'Cancel a running agent (cascades to children via parent_agent_id)',
|
|
31
|
+
action: 'Cancel a run',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
name: 'Get Status',
|
|
35
|
+
value: 'getStatus',
|
|
36
|
+
description: 'Fetch the current state of a running or completed agent',
|
|
37
|
+
action: 'Get run status',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'List Agents',
|
|
41
|
+
value: 'listAgents',
|
|
42
|
+
description: 'List recent / running agents for a user_id',
|
|
43
|
+
action: 'List agents for a user',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
name: 'Spawn',
|
|
47
|
+
value: 'spawn',
|
|
48
|
+
description: 'Spawn a new loomcycle agent run and wait synchronously for completion',
|
|
49
|
+
action: 'Spawn a run',
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: 'Wait for Completion',
|
|
53
|
+
value: 'wait',
|
|
54
|
+
description: 'Poll until the agent reaches a terminal state (completed/failed/cancelled)',
|
|
55
|
+
action: 'Wait for completion',
|
|
56
|
+
},
|
|
57
|
+
],
|
|
58
|
+
default: 'spawn',
|
|
59
|
+
},
|
|
60
|
+
// ---- Spawn parameters ----
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Agent Name or ID',
|
|
63
|
+
name: 'agent',
|
|
64
|
+
type: 'options',
|
|
65
|
+
typeOptions: { loadOptionsMethod: 'loadAgents' },
|
|
66
|
+
default: '',
|
|
67
|
+
required: true,
|
|
68
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
69
|
+
description: 'Choose from the list, or specify an ID using an <a href="https://docs.n8n.io/code/expressions/">expression</a>',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
displayName: 'Prompt',
|
|
73
|
+
name: 'prompt',
|
|
74
|
+
type: 'string',
|
|
75
|
+
typeOptions: { rows: 4 },
|
|
76
|
+
default: '',
|
|
77
|
+
required: true,
|
|
78
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
79
|
+
description: 'User prompt sent to the agent — wrapped as a trusted-text segment by default',
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
displayName: 'User ID',
|
|
83
|
+
name: 'userId',
|
|
84
|
+
type: 'string',
|
|
85
|
+
default: '',
|
|
86
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
87
|
+
description: 'Override the credential\'s Default User ID for this run. Leave empty to use the credential default.',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'User Tier',
|
|
91
|
+
name: 'userTier',
|
|
92
|
+
type: 'string',
|
|
93
|
+
default: '',
|
|
94
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
95
|
+
description: 'Override the credential\'s Default User Tier for this run. Leave empty to use the credential default.',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Treat Prompt as Untrusted',
|
|
99
|
+
name: 'treatPromptAsUntrusted',
|
|
100
|
+
type: 'boolean',
|
|
101
|
+
default: false,
|
|
102
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
103
|
+
description: 'Whether to wrap the prompt as an untrusted-block segment instead of trusted-text. Enable when the prompt contains end-user input (e.g. a Slack message body) that the agent should treat as data, not instruction.',
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
displayName: 'Additional Fields',
|
|
107
|
+
name: 'additionalFields',
|
|
108
|
+
type: 'collection',
|
|
109
|
+
placeholder: 'Add Field',
|
|
110
|
+
default: {},
|
|
111
|
+
displayOptions: { show: { resource: ['run'], operation: ['spawn'] } },
|
|
112
|
+
options: [
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Agent ID',
|
|
115
|
+
name: 'agentId',
|
|
116
|
+
type: 'string',
|
|
117
|
+
default: '',
|
|
118
|
+
description: 'Caller-supplied agent_id. Loomcycle generates one if empty.',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Allowed Hosts (Comma-Separated)',
|
|
122
|
+
name: 'allowedHosts',
|
|
123
|
+
type: 'string',
|
|
124
|
+
default: '',
|
|
125
|
+
description: 'Comma-separated host allowlist for the HTTP / WebFetch / WebSearch tools. Empty = use the operator floor.',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
displayName: 'Allowed Tools (Comma-Separated)',
|
|
129
|
+
name: 'allowedTools',
|
|
130
|
+
type: 'string',
|
|
131
|
+
default: '',
|
|
132
|
+
description: 'Comma-separated tool-name list to narrow the agent\'s allowed_tools beyond the operator floor. Empty = no narrowing.',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Session ID',
|
|
136
|
+
name: 'sessionId',
|
|
137
|
+
type: 'string',
|
|
138
|
+
default: '',
|
|
139
|
+
description: 'Existing session_id to continue. Leave empty to start a fresh session.',
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
displayName: 'User Bearer',
|
|
143
|
+
name: 'userBearer',
|
|
144
|
+
type: 'string',
|
|
145
|
+
typeOptions: { password: true },
|
|
146
|
+
default: '',
|
|
147
|
+
description: 'Per-end-user bearer token substituted into MCP server headers via the ${run.user_bearer} pattern (v0.8.14+)',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
displayName: 'Web Search Host Filter',
|
|
151
|
+
name: 'webSearchFilter',
|
|
152
|
+
type: 'options',
|
|
153
|
+
default: '',
|
|
154
|
+
options: [
|
|
155
|
+
{ name: 'Default (Off)', value: '' },
|
|
156
|
+
{ name: 'Drop — Filter Out Allowed-Hosts', value: 'drop' },
|
|
157
|
+
{ name: 'Keep — Filter In Allowed-Hosts', value: 'keep' },
|
|
158
|
+
],
|
|
159
|
+
description: 'Optional Brave-side host-filtering behaviour for the WebSearch tool. Only meaningful when Allowed Hosts is also set on this run.',
|
|
160
|
+
},
|
|
161
|
+
],
|
|
162
|
+
},
|
|
163
|
+
// ---- Get Status / Wait / Cancel: shared Agent ID ----
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Agent ID',
|
|
166
|
+
name: 'agentId',
|
|
167
|
+
type: 'string',
|
|
168
|
+
default: '',
|
|
169
|
+
required: true,
|
|
170
|
+
displayOptions: { show: { resource: ['run'], operation: ['getStatus', 'wait', 'cancel'] } },
|
|
171
|
+
description: 'The agent_id of the run to inspect / wait on / cancel',
|
|
172
|
+
},
|
|
173
|
+
// ---- Wait-specific ----
|
|
174
|
+
{
|
|
175
|
+
displayName: 'Poll Interval (Ms)',
|
|
176
|
+
name: 'pollIntervalMs',
|
|
177
|
+
type: 'number',
|
|
178
|
+
default: 1000,
|
|
179
|
+
typeOptions: { minValue: 250, maxValue: 60000 },
|
|
180
|
+
displayOptions: { show: { resource: ['run'], operation: ['wait'] } },
|
|
181
|
+
description: 'How frequently to poll getAgent while waiting. Lower values yield faster detection at the cost of more HTTP calls.',
|
|
182
|
+
},
|
|
183
|
+
{
|
|
184
|
+
displayName: 'Timeout (Seconds)',
|
|
185
|
+
name: 'timeoutSec',
|
|
186
|
+
type: 'number',
|
|
187
|
+
default: 300,
|
|
188
|
+
typeOptions: { minValue: 5, maxValue: 86400 },
|
|
189
|
+
displayOptions: { show: { resource: ['run'], operation: ['wait'] } },
|
|
190
|
+
description: 'Maximum seconds to wait before giving up. Exceeding this throws a workflow error.',
|
|
191
|
+
},
|
|
192
|
+
// ---- Cancel reason ----
|
|
193
|
+
{
|
|
194
|
+
displayName: 'Reason',
|
|
195
|
+
name: 'reason',
|
|
196
|
+
type: 'string',
|
|
197
|
+
default: '',
|
|
198
|
+
displayOptions: { show: { resource: ['run'], operation: ['cancel'] } },
|
|
199
|
+
description: 'Operator-visible reason recorded with the cancellation',
|
|
200
|
+
},
|
|
201
|
+
// ---- List Agents ----
|
|
202
|
+
{
|
|
203
|
+
displayName: 'User ID',
|
|
204
|
+
name: 'userId',
|
|
205
|
+
type: 'string',
|
|
206
|
+
default: '',
|
|
207
|
+
displayOptions: { show: { resource: ['run'], operation: ['listAgents'] } },
|
|
208
|
+
description: 'User_id to list agents for. Empty = use the credential\'s Default User ID.',
|
|
209
|
+
},
|
|
210
|
+
{
|
|
211
|
+
displayName: 'Status Filter',
|
|
212
|
+
name: 'statusFilter',
|
|
213
|
+
type: 'options',
|
|
214
|
+
default: '',
|
|
215
|
+
displayOptions: { show: { resource: ['run'], operation: ['listAgents'] } },
|
|
216
|
+
options: [
|
|
217
|
+
{ name: 'All', value: '' },
|
|
218
|
+
{ name: 'Cancelled', value: 'cancelled' },
|
|
219
|
+
{ name: 'Completed', value: 'completed' },
|
|
220
|
+
{ name: 'Failed', value: 'failed' },
|
|
221
|
+
{ name: 'Running', value: 'running' },
|
|
222
|
+
],
|
|
223
|
+
description: 'Filter the listing by run status',
|
|
224
|
+
},
|
|
225
|
+
];
|
|
226
|
+
//# sourceMappingURL=runs.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runs.js","sourceRoot":"","sources":["../../../../nodes/LoomCycle/descriptions/runs.ts"],"names":[],"mappings":";;;AAEA;;;;;;;;;;;;;;GAcG;AACU,QAAA,MAAM,GAAsB;IACxC;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE;QAC/C,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mEAAmE;gBAChF,MAAM,EAAE,cAAc;aACtB;YACD;gBACC,IAAI,EAAE,YAAY;gBAClB,KAAK,EAAE,WAAW;gBAClB,WAAW,EAAE,yDAAyD;gBACtE,MAAM,EAAE,gBAAgB;aACxB;YACD;gBACC,IAAI,EAAE,aAAa;gBACnB,KAAK,EAAE,YAAY;gBACnB,WAAW,EAAE,4CAA4C;gBACzD,MAAM,EAAE,wBAAwB;aAChC;YACD;gBACC,IAAI,EAAE,OAAO;gBACb,KAAK,EAAE,OAAO;gBACd,WAAW,EAAE,uEAAuE;gBACpF,MAAM,EAAE,aAAa;aACrB;YACD;gBACC,IAAI,EAAE,qBAAqB;gBAC3B,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,4EAA4E;gBACzF,MAAM,EAAE,qBAAqB;aAC7B;SAC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D,WAAW,EAAE,kCAAkC;KAC/C;CACD,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Operation descriptions for the `skillDef` resource — substrate-admin
|
|
4
|
+
* management of versioned skill definitions (v0.8.22+). 7 ops mapping
|
|
5
|
+
* to `client.skillDef({op})`. Mirrors agentDef exactly; skill-specific
|
|
6
|
+
* overlay fields (body, allowed_tools) live inside the overlay JSON.
|
|
7
|
+
*
|
|
8
|
+
* Op options array is alphabetised by name.
|
|
9
|
+
*/
|
|
10
|
+
export declare const skillDefOps: INodeProperties[];
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.skillDefOps = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Operation descriptions for the `skillDef` resource — substrate-admin
|
|
6
|
+
* management of versioned skill definitions (v0.8.22+). 7 ops mapping
|
|
7
|
+
* to `client.skillDef({op})`. Mirrors agentDef exactly; skill-specific
|
|
8
|
+
* overlay fields (body, allowed_tools) live inside the overlay JSON.
|
|
9
|
+
*
|
|
10
|
+
* Op options array is alphabetised by name.
|
|
11
|
+
*/
|
|
12
|
+
exports.skillDefOps = [
|
|
13
|
+
{
|
|
14
|
+
displayName: 'Operation',
|
|
15
|
+
name: 'operation',
|
|
16
|
+
type: 'options',
|
|
17
|
+
noDataExpression: true,
|
|
18
|
+
displayOptions: { show: { resource: ['skillDef'] } },
|
|
19
|
+
options: [
|
|
20
|
+
{
|
|
21
|
+
name: 'Create',
|
|
22
|
+
value: 'create',
|
|
23
|
+
description: 'Register a new skill definition (initial version)',
|
|
24
|
+
action: 'Create a skill definition',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
name: 'Fork',
|
|
28
|
+
value: 'fork',
|
|
29
|
+
description: 'Branch from an existing def_id with an overlay diff',
|
|
30
|
+
action: 'Fork a skill definition',
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
name: 'Get',
|
|
34
|
+
value: 'get',
|
|
35
|
+
description: 'Return the active row for a name',
|
|
36
|
+
action: 'Get a skill definition',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
name: 'List Versions',
|
|
40
|
+
value: 'list',
|
|
41
|
+
description: 'List all versions for a name (lineage tree)',
|
|
42
|
+
action: 'List skill definition versions',
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
name: 'Promote',
|
|
46
|
+
value: 'promote',
|
|
47
|
+
description: 'Make a specific def_id the active version',
|
|
48
|
+
action: 'Promote a skill definition',
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
name: 'Retire',
|
|
52
|
+
value: 'retire',
|
|
53
|
+
description: 'Mark a def_id (or active row for a name) as retired',
|
|
54
|
+
action: 'Retire a skill definition',
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
name: 'Verify',
|
|
58
|
+
value: 'verify',
|
|
59
|
+
description: 'Compare a content_sha256 against the deployed active row',
|
|
60
|
+
action: 'Verify a skill definition hash',
|
|
61
|
+
},
|
|
62
|
+
],
|
|
63
|
+
default: 'list',
|
|
64
|
+
},
|
|
65
|
+
// ---- Name (used by Get / List / Create / Retire / Verify) ----
|
|
66
|
+
{
|
|
67
|
+
displayName: 'Name',
|
|
68
|
+
name: 'name',
|
|
69
|
+
type: 'string',
|
|
70
|
+
default: '',
|
|
71
|
+
required: true,
|
|
72
|
+
displayOptions: {
|
|
73
|
+
show: { resource: ['skillDef'], operation: ['get', 'list', 'create', 'retire', 'verify'] },
|
|
74
|
+
},
|
|
75
|
+
description: 'Skill definition name (matches the skill\'s yaml frontmatter / .md filename stem)',
|
|
76
|
+
},
|
|
77
|
+
// ---- Def ID (Promote / Retire) ----
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Def ID',
|
|
80
|
+
name: 'defId',
|
|
81
|
+
type: 'string',
|
|
82
|
+
default: '',
|
|
83
|
+
required: true,
|
|
84
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['promote'] } },
|
|
85
|
+
description: 'Specific def_id to act on. Versions are returned by List Versions.',
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
displayName: 'Def ID (Optional)',
|
|
89
|
+
name: 'defId',
|
|
90
|
+
type: 'string',
|
|
91
|
+
default: '',
|
|
92
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['retire'] } },
|
|
93
|
+
description: 'Specific def_id to retire. Leave empty to retire the active version of the name above.',
|
|
94
|
+
},
|
|
95
|
+
// ---- Parent Def ID (Fork) ----
|
|
96
|
+
{
|
|
97
|
+
displayName: 'Parent Def ID',
|
|
98
|
+
name: 'parentDefId',
|
|
99
|
+
type: 'string',
|
|
100
|
+
default: '',
|
|
101
|
+
required: true,
|
|
102
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['fork'] } },
|
|
103
|
+
description: 'Def_id of the row to fork. The new row inherits all fields not present in the overlay.',
|
|
104
|
+
},
|
|
105
|
+
// ---- Description (Create / Fork) ----
|
|
106
|
+
{
|
|
107
|
+
displayName: 'Description',
|
|
108
|
+
name: 'defDescription',
|
|
109
|
+
type: 'string',
|
|
110
|
+
default: '',
|
|
111
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['create', 'fork'] } },
|
|
112
|
+
description: 'Operator-visible description of this version',
|
|
113
|
+
},
|
|
114
|
+
// ---- Overlay JSON (Create / Fork) ----
|
|
115
|
+
{
|
|
116
|
+
displayName: 'Overlay (JSON)',
|
|
117
|
+
name: 'overlay',
|
|
118
|
+
type: 'json',
|
|
119
|
+
default: '{}',
|
|
120
|
+
typeOptions: { rows: 6 },
|
|
121
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['create', 'fork'] } },
|
|
122
|
+
description: 'JSON object with the skill\'s content-bearing fields (body, allowed_tools, description, etc.). Merged onto parent for Fork; defines initial row for Create.',
|
|
123
|
+
},
|
|
124
|
+
// ---- Promote-After-Create (Create / Fork) ----
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Promote to Active',
|
|
127
|
+
name: 'promote',
|
|
128
|
+
type: 'boolean',
|
|
129
|
+
default: false,
|
|
130
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['create', 'fork'] } },
|
|
131
|
+
description: 'Whether to auto-promote the new version to active immediately',
|
|
132
|
+
},
|
|
133
|
+
// ---- Content SHA256 (Verify) ----
|
|
134
|
+
{
|
|
135
|
+
displayName: 'Content SHA256',
|
|
136
|
+
name: 'contentSha256',
|
|
137
|
+
type: 'string',
|
|
138
|
+
default: '',
|
|
139
|
+
required: true,
|
|
140
|
+
displayOptions: { show: { resource: ['skillDef'], operation: ['verify'] } },
|
|
141
|
+
description: 'Local content_sha256 (typically from `loomcycle hash skill <path>`) to compare against the deployed active row',
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
//# sourceMappingURL=skilldef.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"skilldef.js","sourceRoot":"","sources":["../../../../nodes/LoomCycle/descriptions/skilldef.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACU,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,EAAE;QACpD,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mDAAmD;gBAChE,MAAM,EAAE,2BAA2B;aACnC;YACD;gBACC,IAAI,EAAE,MAAM;gBACZ,KAAK,EAAE,MAAM;gBACb,WAAW,EAAE,qDAAqD;gBAClE,MAAM,EAAE,yBAAyB;aACjC;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW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Ac,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,EAAE,MAAM,CAAC,EAAE,EAAE;QACnF,WAAW,EAAE,+DAA+D;KAC5E;IAED,oCAAoC;IACpC;QACC,WAAW,EAAE,gBAAgB;QAC7B,IAAI,EAAE,eAAe;QACrB,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;QACd,cAAc,EAAE,EAAE,IAAI,EAAE,EAAE,QAAQ,EAAE,CAAC,UAAU,CAAC,EAAE,SAAS,EAAE,CAAC,QAAQ,CAAC,EAAE,EAAE;QAC3E,WAAW,EAAE,sHAAsH;KACnI;CACD,CAAC"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, ITriggerFunctions, ISupplyDataFunctions } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Loomcycle-version gating for ops that depend on a substrate-side
|
|
4
|
+
* feature shipped in a specific version.
|
|
5
|
+
*
|
|
6
|
+
* In 2.2 + 2.4 this is exercised by MCPServerDef (substrate landed in
|
|
7
|
+
* loomcycle v0.9.2 PR #177). The gate code path remains for
|
|
8
|
+
* forward-compat against future-feature additions and for the rare case
|
|
9
|
+
* of an operator running pre-v0.9.2 loomcycle. Surface a clean
|
|
10
|
+
* NodeOperationError("Requires loomcycle vX.Y") so the operator UI
|
|
11
|
+
* shows the right next-step.
|
|
12
|
+
*
|
|
13
|
+
* The gate calls health() (unauthenticated, cheap) and parses the
|
|
14
|
+
* returned `version` field. n8n re-enters the node's execute per item;
|
|
15
|
+
* the per-execution caller is expected to cache the result.
|
|
16
|
+
*/
|
|
17
|
+
export interface ParsedSemver {
|
|
18
|
+
major: number;
|
|
19
|
+
minor: number;
|
|
20
|
+
patch: number;
|
|
21
|
+
raw: string;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Parse a `v<major>.<minor>.<patch>` string, returning {0,0,0,raw}
|
|
25
|
+
* when parsing fails (so comparisons against a real minimum reject).
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseSemver(input: string | undefined): ParsedSemver;
|
|
28
|
+
/**
|
|
29
|
+
* Return true when `actual` is `>= minimum`. Component-wise comparison;
|
|
30
|
+
* all three fields must be parsed cleanly to count.
|
|
31
|
+
*/
|
|
32
|
+
export declare function semverGte(actual: ParsedSemver, minimum: ParsedSemver): boolean;
|
|
33
|
+
/**
|
|
34
|
+
* Throw NodeOperationError when the connected loomcycle is older than
|
|
35
|
+
* `minVersion` (e.g. "0.9.2"). Use sparingly — every call is a wire
|
|
36
|
+
* round-trip; cache the result across an execution.
|
|
37
|
+
*
|
|
38
|
+
* Empty / unparseable version strings are treated as "too old" so the
|
|
39
|
+
* gate fails closed. Operators running a build without `version`
|
|
40
|
+
* embedded should upgrade.
|
|
41
|
+
*/
|
|
42
|
+
export declare function requireLoomcycleVersion(ctx: IExecuteFunctions | ILoadOptionsFunctions | ITriggerFunctions | ISupplyDataFunctions, minVersion: string, featureLabel: string): Promise<void>;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseSemver = parseSemver;
|
|
4
|
+
exports.semverGte = semverGte;
|
|
5
|
+
exports.requireLoomcycleVersion = requireLoomcycleVersion;
|
|
6
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
7
|
+
const client_1 = require("./client");
|
|
8
|
+
/**
|
|
9
|
+
* Parse a `v<major>.<minor>.<patch>` string, returning {0,0,0,raw}
|
|
10
|
+
* when parsing fails (so comparisons against a real minimum reject).
|
|
11
|
+
*/
|
|
12
|
+
function parseSemver(input) {
|
|
13
|
+
const raw = (input ?? '').trim();
|
|
14
|
+
const match = raw.replace(/^v/, '').match(/^(\d+)\.(\d+)\.(\d+)/);
|
|
15
|
+
if (!match)
|
|
16
|
+
return { major: 0, minor: 0, patch: 0, raw };
|
|
17
|
+
return {
|
|
18
|
+
major: Number(match[1]),
|
|
19
|
+
minor: Number(match[2]),
|
|
20
|
+
patch: Number(match[3]),
|
|
21
|
+
raw,
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Return true when `actual` is `>= minimum`. Component-wise comparison;
|
|
26
|
+
* all three fields must be parsed cleanly to count.
|
|
27
|
+
*/
|
|
28
|
+
function semverGte(actual, minimum) {
|
|
29
|
+
if (actual.major !== minimum.major)
|
|
30
|
+
return actual.major > minimum.major;
|
|
31
|
+
if (actual.minor !== minimum.minor)
|
|
32
|
+
return actual.minor > minimum.minor;
|
|
33
|
+
return actual.patch >= minimum.patch;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Throw NodeOperationError when the connected loomcycle is older than
|
|
37
|
+
* `minVersion` (e.g. "0.9.2"). Use sparingly — every call is a wire
|
|
38
|
+
* round-trip; cache the result across an execution.
|
|
39
|
+
*
|
|
40
|
+
* Empty / unparseable version strings are treated as "too old" so the
|
|
41
|
+
* gate fails closed. Operators running a build without `version`
|
|
42
|
+
* embedded should upgrade.
|
|
43
|
+
*/
|
|
44
|
+
async function requireLoomcycleVersion(ctx, minVersion, featureLabel) {
|
|
45
|
+
const client = await (0, client_1.getClient)(ctx);
|
|
46
|
+
const health = await client.health();
|
|
47
|
+
const actual = parseSemver(health.version);
|
|
48
|
+
const minimum = parseSemver(minVersion);
|
|
49
|
+
if (!semverGte(actual, minimum)) {
|
|
50
|
+
const got = actual.raw || '(empty)';
|
|
51
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `${featureLabel} requires loomcycle ≥ v${minVersion}. The connected loomcycle reports version ${got}.`);
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
//# sourceMappingURL=capability.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"capability.js","sourceRoot":"","sources":["../../../../nodes/LoomCycle/help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M,MAAM,CAAC,MAAM,EAAE,CAAC;IACrC,MAAM,MAAM,GAAG,WAAW,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;IAC3C,MAAM,OAAO,GAAG,WAAW,CAAC,UAAU,CAAC,CAAC;IACxC,IAAI,CAAC,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAC;QACjC,MAAM,GAAG,GAAG,MAAM,CAAC,GAAG,IAAI,SAAS,CAAC;QACpC,MAAM,IAAI,iCAAkB,CAC1B,GAAyB,CAAC,OAAO,EAAE,EACpC,GAAG,YAAY,0BAA0B,UAAU,6CAA6C,GAAG,GAAG,CACtG,CAAC;IACH,CAAC;AACF,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IExecuteFunctions, ILoadOptionsFunctions, ITriggerFunctions, ISupplyDataFunctions } from 'n8n-workflow';
|
|
2
|
+
import { LoomcycleClient } from '@loomcycle/client';
|
|
3
|
+
/**
|
|
4
|
+
* Build a LoomcycleClient from the n8n credential. Treats the credential
|
|
5
|
+
* object as opaque — only the base URL + bearer leave this helper, and
|
|
6
|
+
* even those go through the typed adapter (never raw fetch).
|
|
7
|
+
*
|
|
8
|
+
* Every action / trigger / cluster node uses this to construct its client.
|
|
9
|
+
*/
|
|
10
|
+
export declare function getClient(ctx: IExecuteFunctions | ILoadOptionsFunctions | ITriggerFunctions | ISupplyDataFunctions): Promise<LoomcycleClient>;
|
|
11
|
+
/**
|
|
12
|
+
* Read a credential default safely. Used by action nodes to fall through
|
|
13
|
+
* credential `userId` / `userTier` when the per-node parameter is empty.
|
|
14
|
+
*/
|
|
15
|
+
export declare function getCredentialDefault(ctx: IExecuteFunctions | ILoadOptionsFunctions | ITriggerFunctions | ISupplyDataFunctions, field: 'userId' | 'userTier' | 'mcpUrl'): Promise<string>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getClient = getClient;
|
|
4
|
+
exports.getCredentialDefault = getCredentialDefault;
|
|
5
|
+
const client_1 = require("@loomcycle/client");
|
|
6
|
+
/**
|
|
7
|
+
* Build a LoomcycleClient from the n8n credential. Treats the credential
|
|
8
|
+
* object as opaque — only the base URL + bearer leave this helper, and
|
|
9
|
+
* even those go through the typed adapter (never raw fetch).
|
|
10
|
+
*
|
|
11
|
+
* Every action / trigger / cluster node uses this to construct its client.
|
|
12
|
+
*/
|
|
13
|
+
async function getClient(ctx) {
|
|
14
|
+
const creds = await ctx.getCredentials('loomCycleApi');
|
|
15
|
+
const baseUrl = String(creds.baseUrl ?? '').trim();
|
|
16
|
+
const authToken = String(creds.bearerToken ?? '').trim();
|
|
17
|
+
return new client_1.LoomcycleClient({
|
|
18
|
+
baseUrl: baseUrl || undefined,
|
|
19
|
+
authToken: authToken || undefined,
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Read a credential default safely. Used by action nodes to fall through
|
|
24
|
+
* credential `userId` / `userTier` when the per-node parameter is empty.
|
|
25
|
+
*/
|
|
26
|
+
async function getCredentialDefault(ctx, field) {
|
|
27
|
+
const creds = await ctx.getCredentials('loomCycleApi');
|
|
28
|
+
return String(creds[field] ?? '').trim();
|
|
29
|
+
}
|
|
30
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../../nodes/LoomCycle/helpers/client.ts"],"names":[],"mappings":";;AAeA,8BAWC;AAMD,oDAMC;AAhCD,8CAAoD;AAEpD;;;;;;GAMG;AACI,KAAK,UAAU,SAAS,CAC9B,GAAyF;IAEzF,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACvD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IACnD,MAAM,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC,WAAW,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;IAEzD,OAAO,IAAI,wBAAe,CAAC;QAC1B,OAAO,EAAE,OAAO,IAAI,SAAS;QAC7B,SAAS,EAAE,SAAS,IAAI,SAAS;KACjC,CAAC,CAAC;AACJ,CAAC;AAED;;;GAGG;AACI,KAAK,UAAU,oBAAoB,CACzC,GAAyF,EACzF,KAAuC;IAEvC,MAAM,KAAK,GAAG,MAAM,GAAG,CAAC,cAAc,CAAC,cAAc,CAAC,CAAC;IACvD,OAAO,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Helpers for the MCPServerDef Register UI's "Required env vars on
|
|
3
|
+
* loomcycle" hint. Loomcycle's wire path substitutes `${LOOMCYCLE_FOO}`
|
|
4
|
+
* tokens in header values at request time using its own env (operator-
|
|
5
|
+
* managed); the n8n node never transmits a plaintext credential, only
|
|
6
|
+
* the template string. This module extracts the token names from a
|
|
7
|
+
* header collection so the node UI can render a "set these on the
|
|
8
|
+
* loomcycle deployment" reminder.
|
|
9
|
+
*
|
|
10
|
+
* See doc-internal/mcp-server-def-cross-repo.md §"The env-var-mirror UX
|
|
11
|
+
* gap" for the full rationale.
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Extract unique `${LOOMCYCLE_*}` env-var names referenced from a string.
|
|
15
|
+
* Supports the default-fallback form `${LOOMCYCLE_FOO:-default}` per the
|
|
16
|
+
* loomcycle v0.8.14 substitution grammar; the default value itself is
|
|
17
|
+
* ignored (loomcycle uses it; the operator still has to set the env to
|
|
18
|
+
* override).
|
|
19
|
+
*/
|
|
20
|
+
export declare function extractEnvVarNames(text: string): string[];
|
|
21
|
+
/**
|
|
22
|
+
* Extract env-var names from the typical "headers" n8n fixedCollection
|
|
23
|
+
* shape (`{ header: [{ name, value }, ...] }`).
|
|
24
|
+
*/
|
|
25
|
+
export declare function extractEnvVarsFromHeaders(headers: unknown): string[];
|
|
26
|
+
/**
|
|
27
|
+
* Compose the human-readable hint string the node UI surfaces under
|
|
28
|
+
* the Headers field. Empty when no env-var tokens are referenced.
|
|
29
|
+
*/
|
|
30
|
+
export declare function formatEnvVarHint(names: string[]): string;
|