n8n-mcp 2.13.0 → 2.13.2
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/README.md +3 -1
- package/data/nodes.db +0 -0
- package/dist/database/node-repository.d.ts +5 -0
- package/dist/database/node-repository.d.ts.map +1 -1
- package/dist/database/node-repository.js +90 -0
- package/dist/database/node-repository.js.map +1 -1
- package/dist/errors/validation-service-error.d.ts +10 -0
- package/dist/errors/validation-service-error.d.ts.map +1 -0
- package/dist/errors/validation-service-error.js +26 -0
- package/dist/errors/validation-service-error.js.map +1 -0
- package/dist/mcp/server.d.ts.map +1 -1
- package/dist/mcp/server.js +1 -0
- package/dist/mcp/server.js.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.d.ts.map +1 -1
- package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js +4 -6
- package/dist/mcp/tool-docs/workflow_management/n8n-update-partial-workflow.js.map +1 -1
- package/dist/mcp/tools-n8n-manager.js +1 -1
- package/dist/mcp/tools-n8n-manager.js.map +1 -1
- package/dist/services/enhanced-config-validator.d.ts +6 -0
- package/dist/services/enhanced-config-validator.d.ts.map +1 -1
- package/dist/services/enhanced-config-validator.js +127 -0
- package/dist/services/enhanced-config-validator.js.map +1 -1
- package/dist/services/operation-similarity-service.d.ts +32 -0
- package/dist/services/operation-similarity-service.d.ts.map +1 -0
- package/dist/services/operation-similarity-service.js +341 -0
- package/dist/services/operation-similarity-service.js.map +1 -0
- package/dist/services/resource-similarity-service.d.ts +33 -0
- package/dist/services/resource-similarity-service.d.ts.map +1 -0
- package/dist/services/resource-similarity-service.js +358 -0
- package/dist/services/resource-similarity-service.js.map +1 -0
- package/dist/services/workflow-diff-engine.d.ts.map +1 -1
- package/dist/services/workflow-diff-engine.js +0 -9
- package/dist/services/workflow-diff-engine.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,341 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.OperationSimilarityService = void 0;
|
|
4
|
+
const logger_1 = require("../utils/logger");
|
|
5
|
+
const validation_service_error_1 = require("../errors/validation-service-error");
|
|
6
|
+
class OperationSimilarityService {
|
|
7
|
+
constructor(repository) {
|
|
8
|
+
this.operationCache = new Map();
|
|
9
|
+
this.suggestionCache = new Map();
|
|
10
|
+
this.repository = repository;
|
|
11
|
+
this.commonPatterns = this.initializeCommonPatterns();
|
|
12
|
+
}
|
|
13
|
+
cleanupExpiredEntries() {
|
|
14
|
+
const now = Date.now();
|
|
15
|
+
for (const [key, value] of this.operationCache.entries()) {
|
|
16
|
+
if (now - value.timestamp >= OperationSimilarityService.CACHE_DURATION_MS) {
|
|
17
|
+
this.operationCache.delete(key);
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
if (this.suggestionCache.size > 100) {
|
|
21
|
+
const entries = Array.from(this.suggestionCache.entries());
|
|
22
|
+
this.suggestionCache.clear();
|
|
23
|
+
entries.slice(-50).forEach(([key, value]) => {
|
|
24
|
+
this.suggestionCache.set(key, value);
|
|
25
|
+
});
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
initializeCommonPatterns() {
|
|
29
|
+
const patterns = new Map();
|
|
30
|
+
patterns.set('googleDrive', [
|
|
31
|
+
{ pattern: 'listFiles', suggestion: 'search', confidence: 0.85, reason: 'Use "search" with resource: "fileFolder" to list files' },
|
|
32
|
+
{ pattern: 'uploadFile', suggestion: 'upload', confidence: 0.95, reason: 'Use "upload" instead of "uploadFile"' },
|
|
33
|
+
{ pattern: 'deleteFile', suggestion: 'deleteFile', confidence: 1.0, reason: 'Exact match' },
|
|
34
|
+
{ pattern: 'downloadFile', suggestion: 'download', confidence: 0.95, reason: 'Use "download" instead of "downloadFile"' },
|
|
35
|
+
{ pattern: 'getFile', suggestion: 'download', confidence: 0.8, reason: 'Use "download" to retrieve file content' },
|
|
36
|
+
{ pattern: 'listFolders', suggestion: 'search', confidence: 0.85, reason: 'Use "search" with resource: "fileFolder"' },
|
|
37
|
+
]);
|
|
38
|
+
patterns.set('slack', [
|
|
39
|
+
{ pattern: 'sendMessage', suggestion: 'send', confidence: 0.95, reason: 'Use "send" instead of "sendMessage"' },
|
|
40
|
+
{ pattern: 'getMessage', suggestion: 'get', confidence: 0.9, reason: 'Use "get" to retrieve messages' },
|
|
41
|
+
{ pattern: 'postMessage', suggestion: 'send', confidence: 0.9, reason: 'Use "send" to post messages' },
|
|
42
|
+
{ pattern: 'deleteMessage', suggestion: 'delete', confidence: 0.95, reason: 'Use "delete" instead of "deleteMessage"' },
|
|
43
|
+
{ pattern: 'createChannel', suggestion: 'create', confidence: 0.9, reason: 'Use "create" with resource: "channel"' },
|
|
44
|
+
]);
|
|
45
|
+
patterns.set('database', [
|
|
46
|
+
{ pattern: 'selectData', suggestion: 'select', confidence: 0.95, reason: 'Use "select" instead of "selectData"' },
|
|
47
|
+
{ pattern: 'insertData', suggestion: 'insert', confidence: 0.95, reason: 'Use "insert" instead of "insertData"' },
|
|
48
|
+
{ pattern: 'updateData', suggestion: 'update', confidence: 0.95, reason: 'Use "update" instead of "updateData"' },
|
|
49
|
+
{ pattern: 'deleteData', suggestion: 'delete', confidence: 0.95, reason: 'Use "delete" instead of "deleteData"' },
|
|
50
|
+
{ pattern: 'query', suggestion: 'select', confidence: 0.7, reason: 'Use "select" for queries' },
|
|
51
|
+
{ pattern: 'fetch', suggestion: 'select', confidence: 0.7, reason: 'Use "select" to fetch data' },
|
|
52
|
+
]);
|
|
53
|
+
patterns.set('httpRequest', [
|
|
54
|
+
{ pattern: 'fetch', suggestion: 'GET', confidence: 0.8, reason: 'Use "GET" method for fetching data' },
|
|
55
|
+
{ pattern: 'send', suggestion: 'POST', confidence: 0.7, reason: 'Use "POST" method for sending data' },
|
|
56
|
+
{ pattern: 'create', suggestion: 'POST', confidence: 0.8, reason: 'Use "POST" method for creating resources' },
|
|
57
|
+
{ pattern: 'update', suggestion: 'PUT', confidence: 0.8, reason: 'Use "PUT" method for updating resources' },
|
|
58
|
+
{ pattern: 'delete', suggestion: 'DELETE', confidence: 0.9, reason: 'Use "DELETE" method' },
|
|
59
|
+
]);
|
|
60
|
+
patterns.set('generic', [
|
|
61
|
+
{ pattern: 'list', suggestion: 'get', confidence: 0.6, reason: 'Consider using "get" or "search"' },
|
|
62
|
+
{ pattern: 'retrieve', suggestion: 'get', confidence: 0.8, reason: 'Use "get" to retrieve data' },
|
|
63
|
+
{ pattern: 'fetch', suggestion: 'get', confidence: 0.8, reason: 'Use "get" to fetch data' },
|
|
64
|
+
{ pattern: 'remove', suggestion: 'delete', confidence: 0.85, reason: 'Use "delete" to remove items' },
|
|
65
|
+
{ pattern: 'add', suggestion: 'create', confidence: 0.7, reason: 'Use "create" to add new items' },
|
|
66
|
+
]);
|
|
67
|
+
return patterns;
|
|
68
|
+
}
|
|
69
|
+
findSimilarOperations(nodeType, invalidOperation, resource, maxSuggestions = OperationSimilarityService.MAX_SUGGESTIONS) {
|
|
70
|
+
if (Math.random() < 0.1) {
|
|
71
|
+
this.cleanupExpiredEntries();
|
|
72
|
+
}
|
|
73
|
+
const cacheKey = `${nodeType}:${invalidOperation}:${resource || ''}`;
|
|
74
|
+
if (this.suggestionCache.has(cacheKey)) {
|
|
75
|
+
return this.suggestionCache.get(cacheKey);
|
|
76
|
+
}
|
|
77
|
+
const suggestions = [];
|
|
78
|
+
let nodeInfo;
|
|
79
|
+
try {
|
|
80
|
+
nodeInfo = this.repository.getNode(nodeType);
|
|
81
|
+
if (!nodeInfo) {
|
|
82
|
+
return [];
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
catch (error) {
|
|
86
|
+
logger_1.logger.warn(`Error getting node ${nodeType}:`, error);
|
|
87
|
+
return [];
|
|
88
|
+
}
|
|
89
|
+
const validOperations = this.getNodeOperations(nodeType, resource);
|
|
90
|
+
for (const op of validOperations) {
|
|
91
|
+
const opValue = this.getOperationValue(op);
|
|
92
|
+
if (opValue.toLowerCase() === invalidOperation.toLowerCase()) {
|
|
93
|
+
return [];
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
const nodePatterns = this.getNodePatterns(nodeType);
|
|
97
|
+
for (const pattern of nodePatterns) {
|
|
98
|
+
if (pattern.pattern.toLowerCase() === invalidOperation.toLowerCase()) {
|
|
99
|
+
const exists = validOperations.some(op => {
|
|
100
|
+
const opValue = this.getOperationValue(op);
|
|
101
|
+
return opValue === pattern.suggestion;
|
|
102
|
+
});
|
|
103
|
+
if (exists) {
|
|
104
|
+
suggestions.push({
|
|
105
|
+
value: pattern.suggestion,
|
|
106
|
+
confidence: pattern.confidence,
|
|
107
|
+
reason: pattern.reason,
|
|
108
|
+
resource
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
for (const op of validOperations) {
|
|
114
|
+
const opValue = this.getOperationValue(op);
|
|
115
|
+
const similarity = this.calculateSimilarity(invalidOperation, opValue);
|
|
116
|
+
if (similarity >= OperationSimilarityService.MIN_CONFIDENCE) {
|
|
117
|
+
if (!suggestions.some(s => s.value === opValue)) {
|
|
118
|
+
suggestions.push({
|
|
119
|
+
value: opValue,
|
|
120
|
+
confidence: similarity,
|
|
121
|
+
reason: this.getSimilarityReason(similarity, invalidOperation, opValue),
|
|
122
|
+
resource: typeof op === 'object' ? op.resource : undefined,
|
|
123
|
+
description: typeof op === 'object' ? (op.description || op.name) : undefined
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
suggestions.sort((a, b) => b.confidence - a.confidence);
|
|
129
|
+
const topSuggestions = suggestions.slice(0, maxSuggestions);
|
|
130
|
+
this.suggestionCache.set(cacheKey, topSuggestions);
|
|
131
|
+
return topSuggestions;
|
|
132
|
+
}
|
|
133
|
+
getOperationValue(op) {
|
|
134
|
+
if (typeof op === 'string') {
|
|
135
|
+
return op;
|
|
136
|
+
}
|
|
137
|
+
if (typeof op === 'object' && op !== null) {
|
|
138
|
+
return op.operation || op.value || '';
|
|
139
|
+
}
|
|
140
|
+
return '';
|
|
141
|
+
}
|
|
142
|
+
getResourceValue(resource) {
|
|
143
|
+
if (typeof resource === 'string') {
|
|
144
|
+
return resource;
|
|
145
|
+
}
|
|
146
|
+
if (typeof resource === 'object' && resource !== null) {
|
|
147
|
+
return resource.value || '';
|
|
148
|
+
}
|
|
149
|
+
return '';
|
|
150
|
+
}
|
|
151
|
+
getNodeOperations(nodeType, resource) {
|
|
152
|
+
if (Math.random() < 0.05) {
|
|
153
|
+
this.cleanupExpiredEntries();
|
|
154
|
+
}
|
|
155
|
+
const cacheKey = `${nodeType}:${resource || 'all'}`;
|
|
156
|
+
const cached = this.operationCache.get(cacheKey);
|
|
157
|
+
if (cached && Date.now() - cached.timestamp < OperationSimilarityService.CACHE_DURATION_MS) {
|
|
158
|
+
return cached.operations;
|
|
159
|
+
}
|
|
160
|
+
const nodeInfo = this.repository.getNode(nodeType);
|
|
161
|
+
if (!nodeInfo)
|
|
162
|
+
return [];
|
|
163
|
+
let operations = [];
|
|
164
|
+
try {
|
|
165
|
+
const opsData = nodeInfo.operations;
|
|
166
|
+
if (typeof opsData === 'string') {
|
|
167
|
+
try {
|
|
168
|
+
operations = JSON.parse(opsData);
|
|
169
|
+
}
|
|
170
|
+
catch (parseError) {
|
|
171
|
+
logger_1.logger.error(`JSON parse error for operations in ${nodeType}:`, parseError);
|
|
172
|
+
throw validation_service_error_1.ValidationServiceError.jsonParseError(nodeType, parseError);
|
|
173
|
+
}
|
|
174
|
+
}
|
|
175
|
+
else if (Array.isArray(opsData)) {
|
|
176
|
+
operations = opsData;
|
|
177
|
+
}
|
|
178
|
+
else if (opsData && typeof opsData === 'object') {
|
|
179
|
+
operations = Object.values(opsData).flat();
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
if (error instanceof validation_service_error_1.ValidationServiceError) {
|
|
184
|
+
throw error;
|
|
185
|
+
}
|
|
186
|
+
logger_1.logger.warn(`Failed to process operations for ${nodeType}:`, error);
|
|
187
|
+
}
|
|
188
|
+
try {
|
|
189
|
+
const properties = nodeInfo.properties || [];
|
|
190
|
+
for (const prop of properties) {
|
|
191
|
+
if (prop.name === 'operation' && prop.options) {
|
|
192
|
+
if (prop.displayOptions?.show?.resource) {
|
|
193
|
+
const allowedResources = Array.isArray(prop.displayOptions.show.resource)
|
|
194
|
+
? prop.displayOptions.show.resource
|
|
195
|
+
: [prop.displayOptions.show.resource];
|
|
196
|
+
if (resource && !allowedResources.includes(resource)) {
|
|
197
|
+
continue;
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
operations.push(...prop.options.map((opt) => ({
|
|
201
|
+
operation: opt.value,
|
|
202
|
+
name: opt.name,
|
|
203
|
+
description: opt.description,
|
|
204
|
+
resource
|
|
205
|
+
})));
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
catch (error) {
|
|
210
|
+
logger_1.logger.warn(`Failed to extract operations from properties for ${nodeType}:`, error);
|
|
211
|
+
}
|
|
212
|
+
this.operationCache.set(cacheKey, { operations, timestamp: Date.now() });
|
|
213
|
+
return operations;
|
|
214
|
+
}
|
|
215
|
+
getNodePatterns(nodeType) {
|
|
216
|
+
const patterns = [];
|
|
217
|
+
if (nodeType.includes('googleDrive')) {
|
|
218
|
+
patterns.push(...(this.commonPatterns.get('googleDrive') || []));
|
|
219
|
+
}
|
|
220
|
+
else if (nodeType.includes('slack')) {
|
|
221
|
+
patterns.push(...(this.commonPatterns.get('slack') || []));
|
|
222
|
+
}
|
|
223
|
+
else if (nodeType.includes('postgres') || nodeType.includes('mysql') || nodeType.includes('mongodb')) {
|
|
224
|
+
patterns.push(...(this.commonPatterns.get('database') || []));
|
|
225
|
+
}
|
|
226
|
+
else if (nodeType.includes('httpRequest')) {
|
|
227
|
+
patterns.push(...(this.commonPatterns.get('httpRequest') || []));
|
|
228
|
+
}
|
|
229
|
+
patterns.push(...(this.commonPatterns.get('generic') || []));
|
|
230
|
+
return patterns;
|
|
231
|
+
}
|
|
232
|
+
calculateSimilarity(str1, str2) {
|
|
233
|
+
const s1 = str1.toLowerCase();
|
|
234
|
+
const s2 = str2.toLowerCase();
|
|
235
|
+
if (s1 === s2)
|
|
236
|
+
return 1.0;
|
|
237
|
+
if (s1.includes(s2) || s2.includes(s1)) {
|
|
238
|
+
const ratio = Math.min(s1.length, s2.length) / Math.max(s1.length, s2.length);
|
|
239
|
+
return Math.max(OperationSimilarityService.CONFIDENCE_THRESHOLDS.MIN_SUBSTRING, ratio);
|
|
240
|
+
}
|
|
241
|
+
const distance = this.levenshteinDistance(s1, s2);
|
|
242
|
+
const maxLength = Math.max(s1.length, s2.length);
|
|
243
|
+
let similarity = 1 - (distance / maxLength);
|
|
244
|
+
if (distance === 1 && maxLength <= 5) {
|
|
245
|
+
similarity = Math.max(similarity, 0.75);
|
|
246
|
+
}
|
|
247
|
+
else if (distance === 2 && maxLength <= 5) {
|
|
248
|
+
similarity = Math.max(similarity, 0.72);
|
|
249
|
+
}
|
|
250
|
+
if (this.areCommonVariations(s1, s2)) {
|
|
251
|
+
return Math.min(1.0, similarity + 0.2);
|
|
252
|
+
}
|
|
253
|
+
return similarity;
|
|
254
|
+
}
|
|
255
|
+
levenshteinDistance(str1, str2) {
|
|
256
|
+
const m = str1.length;
|
|
257
|
+
const n = str2.length;
|
|
258
|
+
const dp = Array(m + 1).fill(null).map(() => Array(n + 1).fill(0));
|
|
259
|
+
for (let i = 0; i <= m; i++)
|
|
260
|
+
dp[i][0] = i;
|
|
261
|
+
for (let j = 0; j <= n; j++)
|
|
262
|
+
dp[0][j] = j;
|
|
263
|
+
for (let i = 1; i <= m; i++) {
|
|
264
|
+
for (let j = 1; j <= n; j++) {
|
|
265
|
+
if (str1[i - 1] === str2[j - 1]) {
|
|
266
|
+
dp[i][j] = dp[i - 1][j - 1];
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + 1);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
return dp[m][n];
|
|
274
|
+
}
|
|
275
|
+
areCommonVariations(str1, str2) {
|
|
276
|
+
if (str1 === '' || str2 === '' || str1 === str2) {
|
|
277
|
+
return false;
|
|
278
|
+
}
|
|
279
|
+
const commonPrefixes = ['get', 'set', 'create', 'delete', 'update', 'send', 'fetch'];
|
|
280
|
+
const commonSuffixes = ['data', 'item', 'record', 'message', 'file', 'folder'];
|
|
281
|
+
for (const prefix of commonPrefixes) {
|
|
282
|
+
if ((str1.startsWith(prefix) && !str2.startsWith(prefix)) ||
|
|
283
|
+
(!str1.startsWith(prefix) && str2.startsWith(prefix))) {
|
|
284
|
+
const s1Clean = str1.startsWith(prefix) ? str1.slice(prefix.length) : str1;
|
|
285
|
+
const s2Clean = str2.startsWith(prefix) ? str2.slice(prefix.length) : str2;
|
|
286
|
+
if ((str1.startsWith(prefix) && s1Clean !== str1) || (str2.startsWith(prefix) && s2Clean !== str2)) {
|
|
287
|
+
if (s1Clean === s2Clean || this.levenshteinDistance(s1Clean, s2Clean) <= 2) {
|
|
288
|
+
return true;
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
for (const suffix of commonSuffixes) {
|
|
294
|
+
if ((str1.endsWith(suffix) && !str2.endsWith(suffix)) ||
|
|
295
|
+
(!str1.endsWith(suffix) && str2.endsWith(suffix))) {
|
|
296
|
+
const s1Clean = str1.endsWith(suffix) ? str1.slice(0, -suffix.length) : str1;
|
|
297
|
+
const s2Clean = str2.endsWith(suffix) ? str2.slice(0, -suffix.length) : str2;
|
|
298
|
+
if ((str1.endsWith(suffix) && s1Clean !== str1) || (str2.endsWith(suffix) && s2Clean !== str2)) {
|
|
299
|
+
if (s1Clean === s2Clean || this.levenshteinDistance(s1Clean, s2Clean) <= 2) {
|
|
300
|
+
return true;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
return false;
|
|
306
|
+
}
|
|
307
|
+
getSimilarityReason(confidence, invalid, valid) {
|
|
308
|
+
const { VERY_HIGH, HIGH, MEDIUM } = OperationSimilarityService.CONFIDENCE_THRESHOLDS;
|
|
309
|
+
if (confidence >= VERY_HIGH) {
|
|
310
|
+
return 'Almost exact match - likely a typo';
|
|
311
|
+
}
|
|
312
|
+
else if (confidence >= HIGH) {
|
|
313
|
+
return 'Very similar - common variation';
|
|
314
|
+
}
|
|
315
|
+
else if (confidence >= MEDIUM) {
|
|
316
|
+
return 'Similar operation';
|
|
317
|
+
}
|
|
318
|
+
else if (invalid.includes(valid) || valid.includes(invalid)) {
|
|
319
|
+
return 'Partial match';
|
|
320
|
+
}
|
|
321
|
+
else {
|
|
322
|
+
return 'Possibly related operation';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
clearCache() {
|
|
326
|
+
this.operationCache.clear();
|
|
327
|
+
this.suggestionCache.clear();
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
exports.OperationSimilarityService = OperationSimilarityService;
|
|
331
|
+
OperationSimilarityService.CACHE_DURATION_MS = 5 * 60 * 1000;
|
|
332
|
+
OperationSimilarityService.MIN_CONFIDENCE = 0.3;
|
|
333
|
+
OperationSimilarityService.MAX_SUGGESTIONS = 5;
|
|
334
|
+
OperationSimilarityService.CONFIDENCE_THRESHOLDS = {
|
|
335
|
+
EXACT: 1.0,
|
|
336
|
+
VERY_HIGH: 0.95,
|
|
337
|
+
HIGH: 0.8,
|
|
338
|
+
MEDIUM: 0.6,
|
|
339
|
+
MIN_SUBSTRING: 0.7
|
|
340
|
+
};
|
|
341
|
+
//# sourceMappingURL=operation-similarity-service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"operation-similarity-service.js","sourceRoot":"","sources":["../../src/services/operation-similarity-service.ts"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AS,EAAE,IAAI,EAAE,MAAM,EAAE,GAAG,0BAA0B,CAAC,qBAAqB,CAAC;QAErF,IAAI,UAAU,IAAI,SAAS,EAAE,CAAC;YAC5B,OAAO,oCAAoC,CAAC;QAC9C,CAAC;aAAM,IAAI,UAAU,IAAI,IAAI,EAAE,CAAC;YAC9B,OAAO,iCAAiC,CAAC;QAC3C,CAAC;aAAM,IAAI,UAAU,IAAI,MAAM,EAAE,CAAC;YAChC,OAAO,mBAAmB,CAAC;QAC7B,CAAC;aAAM,IAAI,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,EAAE,CAAC;YAC9D,OAAO,eAAe,CAAC;QACzB,CAAC;aAAM,CAAC;YACN,OAAO,4BAA4B,CAAC;QACtC,CAAC;IACH,CAAC;IAKD,UAAU;QACR,IAAI,CAAC,cAAc,CAAC,KAAK,EAAE,CAAC;QAC5B,IAAI,CAAC,eAAe,CAAC,KAAK,EAAE,CAAC;IAC/B,CAAC;;AAjeH,gEAkeC;AAjeyB,4CAAiB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,AAAhB,CAAiB;AAClC,yCAAc,GAAG,GAAG,AAAN,CAAO;AACrB,0CAAe,GAAG,CAAC,AAAJ,CAAK;AAGpB,gDAAqB,GAAG;IAC9C,KAAK,EAAE,GAAG;IACV,SAAS,EAAE,IAAI;IACf,IAAI,EAAE,GAAG;IACT,MAAM,EAAE,GAAG;IACX,aAAa,EAAE,GAAG;CACV,AANmC,CAMlC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { NodeRepository } from '../database/node-repository';
|
|
2
|
+
export interface ResourceSuggestion {
|
|
3
|
+
value: string;
|
|
4
|
+
confidence: number;
|
|
5
|
+
reason: string;
|
|
6
|
+
availableOperations?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class ResourceSimilarityService {
|
|
9
|
+
private static readonly CACHE_DURATION_MS;
|
|
10
|
+
private static readonly MIN_CONFIDENCE;
|
|
11
|
+
private static readonly MAX_SUGGESTIONS;
|
|
12
|
+
private static readonly CONFIDENCE_THRESHOLDS;
|
|
13
|
+
private repository;
|
|
14
|
+
private resourceCache;
|
|
15
|
+
private suggestionCache;
|
|
16
|
+
private commonPatterns;
|
|
17
|
+
constructor(repository: NodeRepository);
|
|
18
|
+
private cleanupExpiredEntries;
|
|
19
|
+
private initializeCommonPatterns;
|
|
20
|
+
findSimilarResources(nodeType: string, invalidResource: string, maxSuggestions?: number): ResourceSuggestion[];
|
|
21
|
+
private getResourceValue;
|
|
22
|
+
private getNodeResources;
|
|
23
|
+
private extractImplicitResources;
|
|
24
|
+
private inferResourceFromOperations;
|
|
25
|
+
private getNodePatterns;
|
|
26
|
+
private toSingular;
|
|
27
|
+
private toPlural;
|
|
28
|
+
private calculateSimilarity;
|
|
29
|
+
private levenshteinDistance;
|
|
30
|
+
private getSimilarityReason;
|
|
31
|
+
clearCache(): void;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=resource-similarity-service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"resource-similarity-service.d.ts","sourceRoot":"","sources":["../../src/services/resource-similarity-service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAI7D,MAAM,WAAW,kBAAkB;IACjC,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,MAAM,EAAE,MAAM,CAAC;IACf,mBAAmB,CAAC,EAAE,MAAM,EAAE,CAAC;CAChC;AASD,qBAAa,yBAAyB;IACpC,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,iBAAiB,CAAiB;IAC1D,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,cAAc,CAAO;IAC7C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAK;IAG5C,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,qBAAqB,CAMlC;IAEX,OAAO,CAAC,UAAU,CAAiB;IACnC,OAAO,CAAC,aAAa,CAAmE;IACxF,OAAO,CAAC,eAAe,CAAgD;IACvE,OAAO,CAAC,cAAc,CAAiC;gBAE3C,UAAU,EAAE,cAAc;IAQtC,OAAO,CAAC,qBAAqB;IAwB7B,OAAO,CAAC,wBAAwB;IA2EhC,oBAAoB,CAClB,QAAQ,EAAE,MAAM,EAChB,eAAe,EAAE,MAAM,EACvB,cAAc,GAAE,MAAkD,GACjE,kBAAkB,EAAE;IA6FvB,OAAO,CAAC,gBAAgB;IAaxB,OAAO,CAAC,gBAAgB;IA0ExB,OAAO,CAAC,wBAAwB;IAwBhC,OAAO,CAAC,2BAA2B;IA2BnC,OAAO,CAAC,eAAe;IAyBvB,OAAO,CAAC,UAAU;IAclB,OAAO,CAAC,QAAQ;IAchB,OAAO,CAAC,mBAAmB;IAkC3B,OAAO,CAAC,mBAAmB;IAgC3B,OAAO,CAAC,mBAAmB;IAmB3B,UAAU,IAAI,IAAI;CAInB"}
|