@nahisaho/musubix-mcp-server 1.2.0 → 1.3.1
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/__tests__/ontology-tools.test.d.ts +6 -0
- package/dist/__tests__/ontology-tools.test.d.ts.map +1 -0
- package/dist/__tests__/ontology-tools.test.js +126 -0
- package/dist/__tests__/ontology-tools.test.js.map +1 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/tools/index.d.ts +2 -0
- package/dist/tools/index.d.ts.map +1 -1
- package/dist/tools/index.js +5 -1
- package/dist/tools/index.js.map +1 -1
- package/dist/tools/ontology-tools.d.ts +33 -0
- package/dist/tools/ontology-tools.d.ts.map +1 -0
- package/dist/tools/ontology-tools.js +485 -0
- package/dist/tools/ontology-tools.js.map +1 -0
- package/dist/tools/pattern-tools.d.ts +50 -0
- package/dist/tools/pattern-tools.d.ts.map +1 -0
- package/dist/tools/pattern-tools.js +478 -0
- package/dist/tools/pattern-tools.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,485 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP Ontology Tools - Consistency Validation
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
* @module tools/ontology-tools
|
|
6
|
+
* @traceability REQ-INT-003
|
|
7
|
+
*/
|
|
8
|
+
/**
|
|
9
|
+
* Consistency Validate Tool
|
|
10
|
+
*
|
|
11
|
+
* Validates knowledge graph consistency using OWL constraints.
|
|
12
|
+
*/
|
|
13
|
+
export const consistencyValidateTool = {
|
|
14
|
+
name: 'consistency_validate',
|
|
15
|
+
description: `Validate knowledge graph consistency using OWL constraints.
|
|
16
|
+
|
|
17
|
+
Checks for:
|
|
18
|
+
- Duplicate triples (exact and semantic)
|
|
19
|
+
- Circular dependencies
|
|
20
|
+
- Disjoint class violations
|
|
21
|
+
- Functional property violations
|
|
22
|
+
- Inverse functional property violations
|
|
23
|
+
- Asymmetric property violations
|
|
24
|
+
- Irreflexive property violations
|
|
25
|
+
|
|
26
|
+
Use this tool to ensure data quality before adding to knowledge graph.`,
|
|
27
|
+
inputSchema: {
|
|
28
|
+
type: 'object',
|
|
29
|
+
properties: {
|
|
30
|
+
triples: {
|
|
31
|
+
type: 'array',
|
|
32
|
+
description: 'Array of triples to validate. Each triple has subject, predicate, object.',
|
|
33
|
+
items: {
|
|
34
|
+
type: 'object',
|
|
35
|
+
properties: {
|
|
36
|
+
subject: { type: 'string', description: 'Subject URI or identifier' },
|
|
37
|
+
predicate: { type: 'string', description: 'Predicate URI or identifier' },
|
|
38
|
+
object: { type: 'string', description: 'Object URI, identifier, or literal value' },
|
|
39
|
+
},
|
|
40
|
+
required: ['subject', 'predicate', 'object'],
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
checkTypes: {
|
|
44
|
+
type: 'array',
|
|
45
|
+
description: 'Types of checks to perform. Default: all checks.',
|
|
46
|
+
items: {
|
|
47
|
+
type: 'string',
|
|
48
|
+
enum: ['duplicate', 'circular', 'disjoint', 'functional', 'inverse-functional', 'asymmetric', 'irreflexive'],
|
|
49
|
+
},
|
|
50
|
+
},
|
|
51
|
+
existingTriples: {
|
|
52
|
+
type: 'array',
|
|
53
|
+
description: 'Optional existing triples to check against.',
|
|
54
|
+
items: {
|
|
55
|
+
type: 'object',
|
|
56
|
+
properties: {
|
|
57
|
+
subject: { type: 'string' },
|
|
58
|
+
predicate: { type: 'string' },
|
|
59
|
+
object: { type: 'string' },
|
|
60
|
+
},
|
|
61
|
+
required: ['subject', 'predicate', 'object'],
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
required: ['triples'],
|
|
66
|
+
},
|
|
67
|
+
handler: async (args) => {
|
|
68
|
+
const { triples, checkTypes, existingTriples = [] } = args;
|
|
69
|
+
try {
|
|
70
|
+
// Perform validation
|
|
71
|
+
const result = validateConsistency(triples, existingTriples, checkTypes);
|
|
72
|
+
const content = {
|
|
73
|
+
type: 'text',
|
|
74
|
+
text: formatValidationResult(result),
|
|
75
|
+
};
|
|
76
|
+
return {
|
|
77
|
+
content: [content],
|
|
78
|
+
isError: false,
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
const content = {
|
|
83
|
+
type: 'text',
|
|
84
|
+
text: `Error during validation: ${error instanceof Error ? error.message : String(error)}`,
|
|
85
|
+
};
|
|
86
|
+
return {
|
|
87
|
+
content: [content],
|
|
88
|
+
isError: true,
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
};
|
|
93
|
+
/**
|
|
94
|
+
* Validate Triple Tool
|
|
95
|
+
*
|
|
96
|
+
* Validate a single triple before adding to knowledge graph.
|
|
97
|
+
*/
|
|
98
|
+
export const validateTripleTool = {
|
|
99
|
+
name: 'validate_triple',
|
|
100
|
+
description: `Validate a single triple before adding to knowledge graph.
|
|
101
|
+
|
|
102
|
+
Quick validation for individual data entries. Returns pass/fail with details.`,
|
|
103
|
+
inputSchema: {
|
|
104
|
+
type: 'object',
|
|
105
|
+
properties: {
|
|
106
|
+
subject: {
|
|
107
|
+
type: 'string',
|
|
108
|
+
description: 'Subject URI or identifier',
|
|
109
|
+
},
|
|
110
|
+
predicate: {
|
|
111
|
+
type: 'string',
|
|
112
|
+
description: 'Predicate URI or identifier',
|
|
113
|
+
},
|
|
114
|
+
object: {
|
|
115
|
+
type: 'string',
|
|
116
|
+
description: 'Object URI, identifier, or literal value',
|
|
117
|
+
},
|
|
118
|
+
context: {
|
|
119
|
+
type: 'array',
|
|
120
|
+
description: 'Optional context triples to check against',
|
|
121
|
+
items: {
|
|
122
|
+
type: 'object',
|
|
123
|
+
properties: {
|
|
124
|
+
subject: { type: 'string' },
|
|
125
|
+
predicate: { type: 'string' },
|
|
126
|
+
object: { type: 'string' },
|
|
127
|
+
},
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
required: ['subject', 'predicate', 'object'],
|
|
132
|
+
},
|
|
133
|
+
handler: async (args) => {
|
|
134
|
+
const { subject, predicate, object, context = [] } = args;
|
|
135
|
+
const triple = { subject, predicate, object };
|
|
136
|
+
const result = validateSingleTriple(triple, context);
|
|
137
|
+
const content = {
|
|
138
|
+
type: 'text',
|
|
139
|
+
text: formatSingleValidation(triple, result),
|
|
140
|
+
};
|
|
141
|
+
return {
|
|
142
|
+
content: [content],
|
|
143
|
+
isError: false,
|
|
144
|
+
};
|
|
145
|
+
},
|
|
146
|
+
};
|
|
147
|
+
/**
|
|
148
|
+
* Check Circular Dependencies Tool
|
|
149
|
+
*/
|
|
150
|
+
export const checkCircularTool = {
|
|
151
|
+
name: 'check_circular',
|
|
152
|
+
description: `Check for circular dependencies in relationships.
|
|
153
|
+
|
|
154
|
+
Detects cycles in dependency graphs that could cause infinite loops or inconsistencies.`,
|
|
155
|
+
inputSchema: {
|
|
156
|
+
type: 'object',
|
|
157
|
+
properties: {
|
|
158
|
+
relationships: {
|
|
159
|
+
type: 'array',
|
|
160
|
+
description: 'Array of relationships to check for cycles',
|
|
161
|
+
items: {
|
|
162
|
+
type: 'object',
|
|
163
|
+
properties: {
|
|
164
|
+
from: { type: 'string', description: 'Source node' },
|
|
165
|
+
to: { type: 'string', description: 'Target node' },
|
|
166
|
+
type: { type: 'string', description: 'Relationship type (optional)' },
|
|
167
|
+
},
|
|
168
|
+
required: ['from', 'to'],
|
|
169
|
+
},
|
|
170
|
+
},
|
|
171
|
+
},
|
|
172
|
+
required: ['relationships'],
|
|
173
|
+
},
|
|
174
|
+
handler: async (args) => {
|
|
175
|
+
const { relationships } = args;
|
|
176
|
+
const cycles = findCycles(relationships);
|
|
177
|
+
const content = {
|
|
178
|
+
type: 'text',
|
|
179
|
+
text: formatCycleResult(cycles),
|
|
180
|
+
};
|
|
181
|
+
return {
|
|
182
|
+
content: [content],
|
|
183
|
+
isError: false,
|
|
184
|
+
};
|
|
185
|
+
},
|
|
186
|
+
};
|
|
187
|
+
// ============= Helper Functions =============
|
|
188
|
+
/**
|
|
189
|
+
* Validate consistency of triples
|
|
190
|
+
*/
|
|
191
|
+
function validateConsistency(triples, existingTriples, checkTypes) {
|
|
192
|
+
const violations = [];
|
|
193
|
+
const allTriples = [...existingTriples, ...triples];
|
|
194
|
+
const checks = checkTypes || ['duplicate', 'circular', 'disjoint', 'functional', 'inverse-functional', 'asymmetric', 'irreflexive'];
|
|
195
|
+
// Check for duplicates
|
|
196
|
+
if (checks.includes('duplicate')) {
|
|
197
|
+
const duplicates = findDuplicates(triples, existingTriples);
|
|
198
|
+
violations.push(...duplicates);
|
|
199
|
+
}
|
|
200
|
+
// Check for circular dependencies
|
|
201
|
+
if (checks.includes('circular')) {
|
|
202
|
+
const circular = findCircularViolations(allTriples);
|
|
203
|
+
violations.push(...circular);
|
|
204
|
+
}
|
|
205
|
+
// Check functional properties
|
|
206
|
+
if (checks.includes('functional')) {
|
|
207
|
+
const functionalViolations = checkFunctionalProperties(allTriples);
|
|
208
|
+
violations.push(...functionalViolations);
|
|
209
|
+
}
|
|
210
|
+
// Count errors and warnings
|
|
211
|
+
const errors = violations.filter(v => v.severity === 'error').length;
|
|
212
|
+
const warnings = violations.filter(v => v.severity === 'warning').length;
|
|
213
|
+
return {
|
|
214
|
+
valid: errors === 0,
|
|
215
|
+
violations,
|
|
216
|
+
statistics: {
|
|
217
|
+
totalTriples: triples.length,
|
|
218
|
+
checkedConstraints: checks.length,
|
|
219
|
+
errors,
|
|
220
|
+
warnings,
|
|
221
|
+
},
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Validate a single triple
|
|
226
|
+
*/
|
|
227
|
+
function validateSingleTriple(triple, context) {
|
|
228
|
+
const issues = [];
|
|
229
|
+
// Check if duplicate
|
|
230
|
+
for (const existing of context) {
|
|
231
|
+
if (existing.subject === triple.subject &&
|
|
232
|
+
existing.predicate === triple.predicate &&
|
|
233
|
+
existing.object === triple.object) {
|
|
234
|
+
issues.push('Duplicate: Exact same triple already exists');
|
|
235
|
+
}
|
|
236
|
+
}
|
|
237
|
+
// Check for self-reference (simple irreflexive check)
|
|
238
|
+
if (triple.subject === triple.object && triple.predicate.includes('parent')) {
|
|
239
|
+
issues.push('Irreflexive violation: Entity cannot be its own parent');
|
|
240
|
+
}
|
|
241
|
+
return {
|
|
242
|
+
valid: issues.length === 0,
|
|
243
|
+
issues,
|
|
244
|
+
};
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Find duplicate triples
|
|
248
|
+
*/
|
|
249
|
+
function findDuplicates(newTriples, existingTriples) {
|
|
250
|
+
const violations = [];
|
|
251
|
+
const seen = new Set();
|
|
252
|
+
// Add existing triples to seen set
|
|
253
|
+
for (const t of existingTriples) {
|
|
254
|
+
seen.add(`${t.subject}|${t.predicate}|${t.object}`);
|
|
255
|
+
}
|
|
256
|
+
// Check new triples
|
|
257
|
+
for (const t of newTriples) {
|
|
258
|
+
const key = `${t.subject}|${t.predicate}|${t.object}`;
|
|
259
|
+
if (seen.has(key)) {
|
|
260
|
+
violations.push({
|
|
261
|
+
type: 'duplicate-triple',
|
|
262
|
+
severity: 'error',
|
|
263
|
+
message: `Duplicate triple detected`,
|
|
264
|
+
affectedTriples: [t],
|
|
265
|
+
suggestion: 'Remove or update the existing triple instead',
|
|
266
|
+
});
|
|
267
|
+
}
|
|
268
|
+
else {
|
|
269
|
+
seen.add(key);
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
return violations;
|
|
273
|
+
}
|
|
274
|
+
/**
|
|
275
|
+
* Find circular dependency violations
|
|
276
|
+
*/
|
|
277
|
+
function findCircularViolations(triples) {
|
|
278
|
+
const violations = [];
|
|
279
|
+
// Build adjacency graph
|
|
280
|
+
const graph = new Map();
|
|
281
|
+
for (const t of triples) {
|
|
282
|
+
if (!graph.has(t.subject)) {
|
|
283
|
+
graph.set(t.subject, []);
|
|
284
|
+
}
|
|
285
|
+
graph.get(t.subject).push(t.object);
|
|
286
|
+
}
|
|
287
|
+
// DFS for cycle detection
|
|
288
|
+
const visited = new Set();
|
|
289
|
+
const inStack = new Set();
|
|
290
|
+
function dfs(node, path) {
|
|
291
|
+
if (inStack.has(node)) {
|
|
292
|
+
return path;
|
|
293
|
+
}
|
|
294
|
+
if (visited.has(node)) {
|
|
295
|
+
return null;
|
|
296
|
+
}
|
|
297
|
+
visited.add(node);
|
|
298
|
+
inStack.add(node);
|
|
299
|
+
const neighbors = graph.get(node) || [];
|
|
300
|
+
for (const neighbor of neighbors) {
|
|
301
|
+
const cycle = dfs(neighbor, [...path, node]);
|
|
302
|
+
if (cycle) {
|
|
303
|
+
return cycle;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
inStack.delete(node);
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
for (const node of graph.keys()) {
|
|
310
|
+
if (!visited.has(node)) {
|
|
311
|
+
const cycle = dfs(node, []);
|
|
312
|
+
if (cycle) {
|
|
313
|
+
violations.push({
|
|
314
|
+
type: 'circular-dependency',
|
|
315
|
+
severity: 'error',
|
|
316
|
+
message: `Circular dependency detected: ${cycle.join(' → ')} → ${node}`,
|
|
317
|
+
affectedTriples: triples.filter(t => cycle.includes(t.subject) || cycle.includes(t.object)),
|
|
318
|
+
suggestion: 'Break the cycle by removing one of the relationships',
|
|
319
|
+
});
|
|
320
|
+
break; // Report one cycle at a time
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
}
|
|
324
|
+
return violations;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Check functional property violations (one value per subject+predicate)
|
|
328
|
+
*/
|
|
329
|
+
function checkFunctionalProperties(triples) {
|
|
330
|
+
const violations = [];
|
|
331
|
+
// Common functional properties
|
|
332
|
+
const functionalPredicates = ['hasId', 'hasParent', 'hasOwner', 'createdAt', 'modifiedAt'];
|
|
333
|
+
const subjectPredicateMap = new Map();
|
|
334
|
+
for (const t of triples) {
|
|
335
|
+
if (functionalPredicates.some(fp => t.predicate.includes(fp))) {
|
|
336
|
+
const key = `${t.subject}|${t.predicate}`;
|
|
337
|
+
if (!subjectPredicateMap.has(key)) {
|
|
338
|
+
subjectPredicateMap.set(key, []);
|
|
339
|
+
}
|
|
340
|
+
subjectPredicateMap.get(key).push(t);
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
for (const [_key, tripleList] of subjectPredicateMap) {
|
|
344
|
+
if (tripleList.length > 1) {
|
|
345
|
+
violations.push({
|
|
346
|
+
type: 'functional-property-violation',
|
|
347
|
+
severity: 'error',
|
|
348
|
+
message: `Functional property has multiple values`,
|
|
349
|
+
affectedTriples: tripleList,
|
|
350
|
+
suggestion: 'Functional properties should have exactly one value per subject',
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}
|
|
354
|
+
return violations;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Find cycles in relationships
|
|
358
|
+
*/
|
|
359
|
+
function findCycles(relationships) {
|
|
360
|
+
const cycles = [];
|
|
361
|
+
const graph = new Map();
|
|
362
|
+
for (const rel of relationships) {
|
|
363
|
+
if (!graph.has(rel.from)) {
|
|
364
|
+
graph.set(rel.from, []);
|
|
365
|
+
}
|
|
366
|
+
graph.get(rel.from).push(rel.to);
|
|
367
|
+
}
|
|
368
|
+
const visited = new Set();
|
|
369
|
+
const recursionStack = new Set();
|
|
370
|
+
function dfs(node, path) {
|
|
371
|
+
visited.add(node);
|
|
372
|
+
recursionStack.add(node);
|
|
373
|
+
const neighbors = graph.get(node) || [];
|
|
374
|
+
for (const neighbor of neighbors) {
|
|
375
|
+
if (!visited.has(neighbor)) {
|
|
376
|
+
dfs(neighbor, [...path, node]);
|
|
377
|
+
}
|
|
378
|
+
else if (recursionStack.has(neighbor)) {
|
|
379
|
+
// Found cycle
|
|
380
|
+
const cycleStart = path.indexOf(neighbor);
|
|
381
|
+
if (cycleStart !== -1) {
|
|
382
|
+
cycles.push([...path.slice(cycleStart), node, neighbor]);
|
|
383
|
+
}
|
|
384
|
+
else {
|
|
385
|
+
cycles.push([...path, node, neighbor]);
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
recursionStack.delete(node);
|
|
390
|
+
}
|
|
391
|
+
for (const node of graph.keys()) {
|
|
392
|
+
if (!visited.has(node)) {
|
|
393
|
+
dfs(node, []);
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
return cycles;
|
|
397
|
+
}
|
|
398
|
+
/**
|
|
399
|
+
* Format validation result as text
|
|
400
|
+
*/
|
|
401
|
+
function formatValidationResult(result) {
|
|
402
|
+
const lines = [];
|
|
403
|
+
lines.push('# Consistency Validation Report');
|
|
404
|
+
lines.push('');
|
|
405
|
+
lines.push(`**Status**: ${result.valid ? '✅ VALID' : '❌ INVALID'}`);
|
|
406
|
+
lines.push('');
|
|
407
|
+
lines.push('## Statistics');
|
|
408
|
+
lines.push(`- Total Triples: ${result.statistics.totalTriples}`);
|
|
409
|
+
lines.push(`- Checked Constraints: ${result.statistics.checkedConstraints}`);
|
|
410
|
+
lines.push(`- Errors: ${result.statistics.errors}`);
|
|
411
|
+
lines.push(`- Warnings: ${result.statistics.warnings}`);
|
|
412
|
+
if (result.violations.length > 0) {
|
|
413
|
+
lines.push('');
|
|
414
|
+
lines.push('## Violations');
|
|
415
|
+
for (const v of result.violations) {
|
|
416
|
+
const icon = v.severity === 'error' ? '❌' : v.severity === 'warning' ? '⚠️' : 'ℹ️';
|
|
417
|
+
lines.push(`### ${icon} ${v.type}`);
|
|
418
|
+
lines.push(`- ${v.message}`);
|
|
419
|
+
if (v.suggestion) {
|
|
420
|
+
lines.push(`- Suggestion: ${v.suggestion}`);
|
|
421
|
+
}
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
return lines.join('\n');
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* Format single triple validation result
|
|
428
|
+
*/
|
|
429
|
+
function formatSingleValidation(triple, result) {
|
|
430
|
+
const lines = [];
|
|
431
|
+
lines.push('# Triple Validation');
|
|
432
|
+
lines.push('');
|
|
433
|
+
lines.push('## Triple');
|
|
434
|
+
lines.push(`- Subject: \`${triple.subject}\``);
|
|
435
|
+
lines.push(`- Predicate: \`${triple.predicate}\``);
|
|
436
|
+
lines.push(`- Object: \`${triple.object}\``);
|
|
437
|
+
lines.push('');
|
|
438
|
+
lines.push(`**Status**: ${result.valid ? '✅ VALID' : '❌ INVALID'}`);
|
|
439
|
+
if (result.issues.length > 0) {
|
|
440
|
+
lines.push('');
|
|
441
|
+
lines.push('## Issues');
|
|
442
|
+
for (const issue of result.issues) {
|
|
443
|
+
lines.push(`- ❌ ${issue}`);
|
|
444
|
+
}
|
|
445
|
+
}
|
|
446
|
+
return lines.join('\n');
|
|
447
|
+
}
|
|
448
|
+
/**
|
|
449
|
+
* Format cycle detection result
|
|
450
|
+
*/
|
|
451
|
+
function formatCycleResult(cycles) {
|
|
452
|
+
const lines = [];
|
|
453
|
+
lines.push('# Circular Dependency Check');
|
|
454
|
+
lines.push('');
|
|
455
|
+
if (cycles.length === 0) {
|
|
456
|
+
lines.push('✅ No circular dependencies detected.');
|
|
457
|
+
}
|
|
458
|
+
else {
|
|
459
|
+
lines.push(`❌ Found ${cycles.length} cycle(s):`);
|
|
460
|
+
lines.push('');
|
|
461
|
+
for (let i = 0; i < cycles.length; i++) {
|
|
462
|
+
lines.push(`### Cycle ${i + 1}`);
|
|
463
|
+
lines.push(`\`${cycles[i].join(' → ')}\``);
|
|
464
|
+
lines.push('');
|
|
465
|
+
}
|
|
466
|
+
lines.push('## Recommendation');
|
|
467
|
+
lines.push('Remove one relationship from each cycle to break the circular dependency.');
|
|
468
|
+
}
|
|
469
|
+
return lines.join('\n');
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
* Array of all ontology tools
|
|
473
|
+
*/
|
|
474
|
+
export const ontologyTools = [
|
|
475
|
+
consistencyValidateTool,
|
|
476
|
+
validateTripleTool,
|
|
477
|
+
checkCircularTool,
|
|
478
|
+
];
|
|
479
|
+
/**
|
|
480
|
+
* Get all ontology tools
|
|
481
|
+
*/
|
|
482
|
+
export function getOntologyTools() {
|
|
483
|
+
return [...ontologyTools];
|
|
484
|
+
}
|
|
485
|
+
//# sourceMappingURL=ontology-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ontology-tools.js","sourceRoot":"","sources":["../../src/tools/ontology-tools.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AA8BH;;;;GAIG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAmB;IACrD,IAAI,EAAE,sBAAsB;IAC5B,WAAW,EAAE;;;;;;;;;;;uEAWwD;IACrE,WAAW,EAAE;QACX,IAAI,EAAE,QAAQ;QACd,UAAU,EAAE;YACV,OAAO,EAAE;gBACP,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,2EAA2E;gBACxF,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,UAAU,EAAE;wBACV,OAAO,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,2BAA2B,EAAE;wBACrE,SAAS,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,6BAA6B,EAAE;wBACzE,MAAM,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,WAAW,EAAE,0CAA0C,EAAE;qBACpF;oBACD,QAAQ,EAAE,CAAC,SAAS,EAAE,WAAW,EAAE,QAAQ,CAAC;iBAC7C;aACF;YACD,UAAU,EAAE;gBACV,IAAI,EAAE,OAAO;gBACb,WAAW,EAAE,kDAAkD;gBAC/D,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oBACd,IAAI,EAAE,CAAC,WAAW,EAAE,UAAU,EAAE,UAAU,EAAE,YAAY,EAAE,oBAAoB,EAAE,YAAY,EAAE,aAAa,CAAC;iBAC7G;aACF;YACD,eAAe,EAAE;gBACf,IAAI,EAAE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,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC1B,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,MAAM,aAAa,GAAqB;IAC7C,uBAAuB;IACvB,kBAAkB;IAClB,iBAAiB;CAClB,CAAC;AAEF;;GAEG;AACH,MAAM,UAAU,gBAAgB;IAC9B,OAAO,CAAC,GAAG,aAAa,CAAC,CAAC;AAC5B,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Pattern-Ontology Integration MCP Tools
|
|
3
|
+
* @traceability TSK-INT-002
|
|
4
|
+
*/
|
|
5
|
+
import type { Tool, CallToolResult } from '@modelcontextprotocol/sdk/types.js';
|
|
6
|
+
/**
|
|
7
|
+
* Tool: Learn from code observation
|
|
8
|
+
*/
|
|
9
|
+
export declare const learnPatternTool: Tool;
|
|
10
|
+
/**
|
|
11
|
+
* Tool: Consolidate learned patterns
|
|
12
|
+
*/
|
|
13
|
+
export declare const consolidatePatternsTool: Tool;
|
|
14
|
+
/**
|
|
15
|
+
* Tool: Query pattern relationships
|
|
16
|
+
*/
|
|
17
|
+
export declare const queryPatternRelationsTool: Tool;
|
|
18
|
+
/**
|
|
19
|
+
* Tool: Search patterns
|
|
20
|
+
*/
|
|
21
|
+
export declare const searchPatternsTool: Tool;
|
|
22
|
+
/**
|
|
23
|
+
* Tool: Get learning statistics
|
|
24
|
+
*/
|
|
25
|
+
export declare const getLearningStatsTool: Tool;
|
|
26
|
+
/**
|
|
27
|
+
* Tool: Import patterns to knowledge graph
|
|
28
|
+
*/
|
|
29
|
+
export declare const importToKnowledgeGraphTool: Tool;
|
|
30
|
+
/**
|
|
31
|
+
* Tool: Export knowledge graph
|
|
32
|
+
*/
|
|
33
|
+
export declare const exportKnowledgeGraphTool: Tool;
|
|
34
|
+
/**
|
|
35
|
+
* All pattern integration tools
|
|
36
|
+
*/
|
|
37
|
+
export declare const patternIntegrationTools: Tool[];
|
|
38
|
+
/**
|
|
39
|
+
* Get all pattern integration tools
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPatternIntegrationTools(): Tool[];
|
|
42
|
+
/**
|
|
43
|
+
* Handle pattern integration tool calls
|
|
44
|
+
*/
|
|
45
|
+
export declare function handlePatternIntegrationTool(name: string, args: Record<string, unknown>): Promise<CallToolResult>;
|
|
46
|
+
/**
|
|
47
|
+
* Reset instances (for testing)
|
|
48
|
+
*/
|
|
49
|
+
export declare function resetPatternIntegration(): void;
|
|
50
|
+
//# sourceMappingURL=pattern-tools.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pattern-tools.d.ts","sourceRoot":"","sources":["../../src/tools/pattern-tools.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,IAAI,EAAE,cAAc,EAAe,MAAM,oCAAoC,CAAC;AAwD5F;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,IA0B9B,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAcrC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,IAkBvC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,kBAAkB,EAAE,IAqBhC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,oBAAoB,EAAE,IAQlC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,0BAA0B,EAAE,IAcxC,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,wBAAwB,EAAE,IAQtC,CAAC;AAuQF;;GAEG;AACH,eAAO,MAAM,uBAAuB,EAAE,IAAI,EAQzC,CAAC;AAEF;;GAEG;AACH,wBAAgB,0BAA0B,IAAI,IAAI,EAAE,CAEnD;AAED;;GAEG;AACH,wBAAsB,4BAA4B,CAChD,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAC5B,OAAO,CAAC,cAAc,CAAC,CAyBzB;AAED;;GAEG;AACH,wBAAgB,uBAAuB,IAAI,IAAI,CAI9C"}
|