@neurynae/toolcairn-mcp 0.1.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/bin/toolpilot-mcp.js +5 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +45 -0
- package/dist/index.js.map +1 -0
- package/dist/middleware/event-logger.d.ts +19 -0
- package/dist/middleware/event-logger.d.ts.map +1 -0
- package/dist/middleware/event-logger.js +138 -0
- package/dist/middleware/event-logger.js.map +1 -0
- package/dist/schemas.d.ts +2 -0
- package/dist/schemas.d.ts.map +1 -0
- package/dist/schemas.js +3 -0
- package/dist/schemas.js.map +1 -0
- package/dist/server.d.ts +3 -0
- package/dist/server.d.ts.map +1 -0
- package/dist/server.js +116 -0
- package/dist/server.js.map +1 -0
- package/dist/server.prod.d.ts +14 -0
- package/dist/server.prod.d.ts.map +1 -0
- package/dist/server.prod.js +127 -0
- package/dist/server.prod.js.map +1 -0
- package/dist/templates/agent-instructions.d.ts +22 -0
- package/dist/templates/agent-instructions.d.ts.map +1 -0
- package/dist/templates/agent-instructions.js +155 -0
- package/dist/templates/agent-instructions.js.map +1 -0
- package/dist/tools/check-compatibility.d.ts +100 -0
- package/dist/tools/check-compatibility.d.ts.map +1 -0
- package/dist/tools/check-compatibility.js +103 -0
- package/dist/tools/check-compatibility.js.map +1 -0
- package/dist/tools/check-issue.d.ts +126 -0
- package/dist/tools/check-issue.d.ts.map +1 -0
- package/dist/tools/check-issue.js +248 -0
- package/dist/tools/check-issue.js.map +1 -0
- package/dist/tools/classify-prompt.d.ts +101 -0
- package/dist/tools/classify-prompt.d.ts.map +1 -0
- package/dist/tools/classify-prompt.js +64 -0
- package/dist/tools/classify-prompt.js.map +1 -0
- package/dist/tools/compare-tools.d.ts +102 -0
- package/dist/tools/compare-tools.d.ts.map +1 -0
- package/dist/tools/compare-tools.js +178 -0
- package/dist/tools/compare-tools.js.map +1 -0
- package/dist/tools/format-results.d.ts +44 -0
- package/dist/tools/format-results.d.ts.map +1 -0
- package/dist/tools/format-results.js +114 -0
- package/dist/tools/format-results.js.map +1 -0
- package/dist/tools/generate-tracker.d.ts +7 -0
- package/dist/tools/generate-tracker.d.ts.map +1 -0
- package/dist/tools/generate-tracker.js +408 -0
- package/dist/tools/generate-tracker.js.map +1 -0
- package/dist/tools/get-stack.d.ts +105 -0
- package/dist/tools/get-stack.d.ts.map +1 -0
- package/dist/tools/get-stack.js +156 -0
- package/dist/tools/get-stack.js.map +1 -0
- package/dist/tools/init-project-config.d.ts +107 -0
- package/dist/tools/init-project-config.d.ts.map +1 -0
- package/dist/tools/init-project-config.js +52 -0
- package/dist/tools/init-project-config.js.map +1 -0
- package/dist/tools/read-project-config.d.ts +99 -0
- package/dist/tools/read-project-config.d.ts.map +1 -0
- package/dist/tools/read-project-config.js +78 -0
- package/dist/tools/read-project-config.js.map +1 -0
- package/dist/tools/refine-requirement.d.ts +105 -0
- package/dist/tools/refine-requirement.d.ts.map +1 -0
- package/dist/tools/refine-requirement.js +77 -0
- package/dist/tools/refine-requirement.js.map +1 -0
- package/dist/tools/report-outcome.d.ts +104 -0
- package/dist/tools/report-outcome.d.ts.map +1 -0
- package/dist/tools/report-outcome.js +108 -0
- package/dist/tools/report-outcome.js.map +1 -0
- package/dist/tools/search-tools-respond.d.ts +103 -0
- package/dist/tools/search-tools-respond.d.ts.map +1 -0
- package/dist/tools/search-tools-respond.js +91 -0
- package/dist/tools/search-tools-respond.js.map +1 -0
- package/dist/tools/search-tools.d.ts +104 -0
- package/dist/tools/search-tools.d.ts.map +1 -0
- package/dist/tools/search-tools.js +77 -0
- package/dist/tools/search-tools.js.map +1 -0
- package/dist/tools/suggest-graph-update.d.ts +117 -0
- package/dist/tools/suggest-graph-update.d.ts.map +1 -0
- package/dist/tools/suggest-graph-update.js +177 -0
- package/dist/tools/suggest-graph-update.js.map +1 -0
- package/dist/tools/toolpilot-init.d.ts +103 -0
- package/dist/tools/toolpilot-init.d.ts.map +1 -0
- package/dist/tools/toolpilot-init.js +115 -0
- package/dist/tools/toolpilot-init.js.map +1 -0
- package/dist/tools/update-project-config.d.ts +104 -0
- package/dist/tools/update-project-config.d.ts.map +1 -0
- package/dist/tools/update-project-config.js +117 -0
- package/dist/tools/update-project-config.js.map +1 -0
- package/dist/tools/verify-suggestion.d.ts +113 -0
- package/dist/tools/verify-suggestion.d.ts.map +1 -0
- package/dist/tools/verify-suggestion.js +223 -0
- package/dist/tools/verify-suggestion.js.map +1 -0
- package/dist/transport.d.ts +5 -0
- package/dist/transport.d.ts.map +1 -0
- package/dist/transport.js +13 -0
- package/dist/transport.js.map +1 -0
- package/dist/utils.d.ts +4 -0
- package/dist/utils.d.ts.map +1 -0
- package/dist/utils.js +12 -0
- package/dist/utils.js.map +1 -0
- package/package.json +54 -0
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verify_suggestion — Validates agent-suggested tools against the ToolPilot graph.
|
|
3
|
+
*
|
|
4
|
+
* Called when search_tools returns no results or low-confidence results and the
|
|
5
|
+
* calling agent (Claude, Cursor, etc.) has suggestions from its training data.
|
|
6
|
+
*
|
|
7
|
+
* For each suggestion:
|
|
8
|
+
* 1. FOUND in graph → diagnose why search missed it (category mismatch, low health,
|
|
9
|
+
* Stage 2 filter, not in Qdrant yet) and return corrected data from our index.
|
|
10
|
+
* 2. NOT in graph → enqueue at P0 (highest priority), search GitHub for alternatives
|
|
11
|
+
* matching the query, compare agent's suggestion vs what GitHub returns, and return
|
|
12
|
+
* a verdict on which is correct with reasoning.
|
|
13
|
+
*/
|
|
14
|
+
export declare function handleVerifySuggestion(args: {
|
|
15
|
+
query: string;
|
|
16
|
+
agent_suggestions: string[];
|
|
17
|
+
}): Promise<{
|
|
18
|
+
[x: string]: unknown;
|
|
19
|
+
content: ({
|
|
20
|
+
type: "text";
|
|
21
|
+
text: string;
|
|
22
|
+
annotations?: {
|
|
23
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
24
|
+
priority?: number | undefined;
|
|
25
|
+
lastModified?: string | undefined;
|
|
26
|
+
} | undefined;
|
|
27
|
+
_meta?: {
|
|
28
|
+
[x: string]: unknown;
|
|
29
|
+
} | undefined;
|
|
30
|
+
} | {
|
|
31
|
+
type: "image";
|
|
32
|
+
data: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
annotations?: {
|
|
35
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
36
|
+
priority?: number | undefined;
|
|
37
|
+
lastModified?: string | undefined;
|
|
38
|
+
} | undefined;
|
|
39
|
+
_meta?: {
|
|
40
|
+
[x: string]: unknown;
|
|
41
|
+
} | undefined;
|
|
42
|
+
} | {
|
|
43
|
+
type: "audio";
|
|
44
|
+
data: string;
|
|
45
|
+
mimeType: string;
|
|
46
|
+
annotations?: {
|
|
47
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
48
|
+
priority?: number | undefined;
|
|
49
|
+
lastModified?: string | undefined;
|
|
50
|
+
} | undefined;
|
|
51
|
+
_meta?: {
|
|
52
|
+
[x: string]: unknown;
|
|
53
|
+
} | undefined;
|
|
54
|
+
} | {
|
|
55
|
+
uri: string;
|
|
56
|
+
name: string;
|
|
57
|
+
type: "resource_link";
|
|
58
|
+
description?: string | undefined;
|
|
59
|
+
mimeType?: string | undefined;
|
|
60
|
+
annotations?: {
|
|
61
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
62
|
+
priority?: number | undefined;
|
|
63
|
+
lastModified?: string | undefined;
|
|
64
|
+
} | undefined;
|
|
65
|
+
_meta?: {
|
|
66
|
+
[x: string]: unknown;
|
|
67
|
+
} | undefined;
|
|
68
|
+
icons?: {
|
|
69
|
+
src: string;
|
|
70
|
+
mimeType?: string | undefined;
|
|
71
|
+
sizes?: string[] | undefined;
|
|
72
|
+
theme?: "light" | "dark" | undefined;
|
|
73
|
+
}[] | undefined;
|
|
74
|
+
title?: string | undefined;
|
|
75
|
+
} | {
|
|
76
|
+
type: "resource";
|
|
77
|
+
resource: {
|
|
78
|
+
uri: string;
|
|
79
|
+
text: string;
|
|
80
|
+
mimeType?: string | undefined;
|
|
81
|
+
_meta?: {
|
|
82
|
+
[x: string]: unknown;
|
|
83
|
+
} | undefined;
|
|
84
|
+
} | {
|
|
85
|
+
uri: string;
|
|
86
|
+
blob: string;
|
|
87
|
+
mimeType?: string | undefined;
|
|
88
|
+
_meta?: {
|
|
89
|
+
[x: string]: unknown;
|
|
90
|
+
} | undefined;
|
|
91
|
+
};
|
|
92
|
+
annotations?: {
|
|
93
|
+
audience?: ("user" | "assistant")[] | undefined;
|
|
94
|
+
priority?: number | undefined;
|
|
95
|
+
lastModified?: string | undefined;
|
|
96
|
+
} | undefined;
|
|
97
|
+
_meta?: {
|
|
98
|
+
[x: string]: unknown;
|
|
99
|
+
} | undefined;
|
|
100
|
+
})[];
|
|
101
|
+
_meta?: {
|
|
102
|
+
[x: string]: unknown;
|
|
103
|
+
progressToken?: string | number | undefined;
|
|
104
|
+
"io.modelcontextprotocol/related-task"?: {
|
|
105
|
+
taskId: string;
|
|
106
|
+
} | undefined;
|
|
107
|
+
} | undefined;
|
|
108
|
+
structuredContent?: {
|
|
109
|
+
[x: string]: unknown;
|
|
110
|
+
} | undefined;
|
|
111
|
+
isError?: boolean | undefined;
|
|
112
|
+
}>;
|
|
113
|
+
//# sourceMappingURL=verify-suggestion.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-suggestion.d.ts","sourceRoot":"","sources":["../../src/tools/verify-suggestion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA0KH,wBAAsB,sBAAsB,CAAC,IAAI,EAAE;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,iBAAiB,EAAE,MAAM,EAAE,CAAC;CAC7B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+GA"}
|
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* verify_suggestion — Validates agent-suggested tools against the ToolPilot graph.
|
|
3
|
+
*
|
|
4
|
+
* Called when search_tools returns no results or low-confidence results and the
|
|
5
|
+
* calling agent (Claude, Cursor, etc.) has suggestions from its training data.
|
|
6
|
+
*
|
|
7
|
+
* For each suggestion:
|
|
8
|
+
* 1. FOUND in graph → diagnose why search missed it (category mismatch, low health,
|
|
9
|
+
* Stage 2 filter, not in Qdrant yet) and return corrected data from our index.
|
|
10
|
+
* 2. NOT in graph → enqueue at P0 (highest priority), search GitHub for alternatives
|
|
11
|
+
* matching the query, compare agent's suggestion vs what GitHub returns, and return
|
|
12
|
+
* a verdict on which is correct with reasoning.
|
|
13
|
+
*/
|
|
14
|
+
import { MemgraphToolRepository, MemgraphUseCaseRepository } from '@toolpilot/graph';
|
|
15
|
+
import { enqueueIndexJob } from '@toolpilot/queue';
|
|
16
|
+
import { COLLECTION_NAME, embedText, qdrantClient } from '@toolpilot/vector';
|
|
17
|
+
import pino from 'pino';
|
|
18
|
+
import { errResult, okResult } from '../utils.js';
|
|
19
|
+
import { config } from '@toolpilot/config';
|
|
20
|
+
const logger = pino({ name: '@toolpilot/mcp-server:verify-suggestion' });
|
|
21
|
+
const toolRepo = new MemgraphToolRepository();
|
|
22
|
+
const usecaseRepo = new MemgraphUseCaseRepository();
|
|
23
|
+
// Priority 2 = highest urgency in the indexer queue (compare: 0=background, 1=normal, 2=urgent)
|
|
24
|
+
const P0_PRIORITY = 2;
|
|
25
|
+
/**
|
|
26
|
+
* Resolve a bare tool name (e.g. "yjs") to a full GitHub URL.
|
|
27
|
+
* Uses GitHub Search API (via fetch) to find the most-starred repo matching the name.
|
|
28
|
+
* If name already contains "/" or "github.com", returns it as-is.
|
|
29
|
+
*/
|
|
30
|
+
async function resolveToGitHubUrl(nameOrUrl) {
|
|
31
|
+
// Already a full URL or owner/repo format — indexer handles these directly
|
|
32
|
+
if (nameOrUrl.includes('github.com') || nameOrUrl.includes('/')) {
|
|
33
|
+
return nameOrUrl;
|
|
34
|
+
}
|
|
35
|
+
// Bare name — search GitHub Search API for the most-starred match
|
|
36
|
+
try {
|
|
37
|
+
const token = config.GITHUB_TOKEN;
|
|
38
|
+
const headers = { Accept: 'application/vnd.github+json' };
|
|
39
|
+
if (token)
|
|
40
|
+
headers.Authorization = `Bearer ${token}`;
|
|
41
|
+
const res = await fetch(`https://api.github.com/search/repositories?q=${encodeURIComponent(nameOrUrl)}+in:name&sort=stars&order=desc&per_page=1`, { headers });
|
|
42
|
+
if (res.ok) {
|
|
43
|
+
const data = (await res.json());
|
|
44
|
+
const url = data.items?.[0]?.html_url;
|
|
45
|
+
if (url)
|
|
46
|
+
return url;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch {
|
|
50
|
+
// fall through
|
|
51
|
+
}
|
|
52
|
+
return nameOrUrl; // let the indexer try its best
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Check if a tool is present in Qdrant with a non-zero vector.
|
|
56
|
+
* If missing from Qdrant, that's likely why search missed it.
|
|
57
|
+
*/
|
|
58
|
+
async function checkQdrantPresence(toolName) {
|
|
59
|
+
try {
|
|
60
|
+
const { points } = await qdrantClient().scroll(COLLECTION_NAME, {
|
|
61
|
+
filter: { must: [{ key: 'name', match: { value: toolName } }] },
|
|
62
|
+
limit: 1,
|
|
63
|
+
with_payload: true,
|
|
64
|
+
with_vector: false,
|
|
65
|
+
});
|
|
66
|
+
const p = points[0];
|
|
67
|
+
if (!p?.payload)
|
|
68
|
+
return { present: false, hasVector: false, hasTopics: false };
|
|
69
|
+
return {
|
|
70
|
+
present: true,
|
|
71
|
+
hasVector: true, // we can't check vector without fetching it, assume present if payload exists
|
|
72
|
+
hasTopics: Array.isArray(p.payload.topics) && p.payload.topics.length > 0,
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
catch {
|
|
76
|
+
return { present: false, hasVector: false, hasTopics: false };
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Diagnose why a tool that IS in the graph didn't appear in search results.
|
|
81
|
+
*/
|
|
82
|
+
async function diagnoseSearchMiss(tool) {
|
|
83
|
+
const reasons = [];
|
|
84
|
+
// 1. Not in Qdrant → Stage 1 vector search can't find it
|
|
85
|
+
const qdrantStatus = await checkQdrantPresence(tool.name);
|
|
86
|
+
if (!qdrantStatus.present) {
|
|
87
|
+
reasons.push('not present in Qdrant vector store — tool exists in Memgraph but was never embedded');
|
|
88
|
+
}
|
|
89
|
+
else if (!qdrantStatus.hasTopics) {
|
|
90
|
+
reasons.push('in Qdrant but topics field is empty — embedding may use stale schema without topic-aware text, reducing semantic match quality');
|
|
91
|
+
}
|
|
92
|
+
// 2. Health score too low → Stage 4 might filter it
|
|
93
|
+
if (tool.health.maintenance_score < 0.3) {
|
|
94
|
+
reasons.push(`very low health score (${Math.round(tool.health.maintenance_score * 100)}%) — may be deprioritized in Stage 3 graph reranking`);
|
|
95
|
+
}
|
|
96
|
+
// 3. Category is "other" → clarification filter might exclude it
|
|
97
|
+
if (tool.category === 'other') {
|
|
98
|
+
reasons.push('category is "other" — tool has no specific category, so topic-based clarification filters won\'t surface it unless the user skips topic selection');
|
|
99
|
+
}
|
|
100
|
+
// 4. Category mismatch → wrong UseCase nodes
|
|
101
|
+
const usecases = await usecaseRepo.findToolsByUseCases([tool.category], 5);
|
|
102
|
+
if (!usecases.ok || usecases.data.length === 0) {
|
|
103
|
+
reasons.push(`category "${tool.category}" has no matching UseCase node — tool won't be found via graph traversal in get_stack or Stage 3`);
|
|
104
|
+
}
|
|
105
|
+
return reasons.length > 0
|
|
106
|
+
? reasons.join('; ')
|
|
107
|
+
: 'unclear — tool appears correctly indexed. May have been filtered by Stage 2 language/license constraints or ranked below threshold in Stage 4.';
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Use semantic search to find the closest tools to the query in the current index.
|
|
111
|
+
* Returns top matches as "what ToolPilot would recommend" for comparison.
|
|
112
|
+
*/
|
|
113
|
+
async function semanticSearch(query, limit = 3) {
|
|
114
|
+
try {
|
|
115
|
+
const vec = await embedText(query, 'search_query');
|
|
116
|
+
const results = await qdrantClient().search(COLLECTION_NAME, {
|
|
117
|
+
vector: vec,
|
|
118
|
+
limit,
|
|
119
|
+
with_payload: true,
|
|
120
|
+
});
|
|
121
|
+
return results
|
|
122
|
+
.filter((r) => r.payload)
|
|
123
|
+
.map((r) => ({
|
|
124
|
+
name: String(r.payload?.name ?? ''),
|
|
125
|
+
score: Math.round(r.score * 100) / 100,
|
|
126
|
+
}));
|
|
127
|
+
}
|
|
128
|
+
catch {
|
|
129
|
+
return [];
|
|
130
|
+
}
|
|
131
|
+
}
|
|
132
|
+
// ─── Handler ─────────────────────────────────────────────────────────────────
|
|
133
|
+
export async function handleVerifySuggestion(args) {
|
|
134
|
+
try {
|
|
135
|
+
logger.info({ query: args.query, suggestions: args.agent_suggestions }, 'verify_suggestion called');
|
|
136
|
+
const results = [];
|
|
137
|
+
const toIndex = [];
|
|
138
|
+
// ── Phase 1: check each suggestion against the graph ─────────────────────
|
|
139
|
+
for (const toolName of args.agent_suggestions) {
|
|
140
|
+
const found = await toolRepo.findByName(toolName);
|
|
141
|
+
if (found.ok && found.data) {
|
|
142
|
+
const tool = found.data;
|
|
143
|
+
const qdrantStatus = await checkQdrantPresence(toolName);
|
|
144
|
+
// Tool is in graph — check if search should have returned it
|
|
145
|
+
const missReason = qdrantStatus.present
|
|
146
|
+
? await diagnoseSearchMiss(tool)
|
|
147
|
+
: 'not present in Qdrant — tool was in Memgraph but never embedded into the vector store';
|
|
148
|
+
const isCorrectlyIndexed = qdrantStatus.present && qdrantStatus.hasTopics && tool.category !== 'other';
|
|
149
|
+
results.push({
|
|
150
|
+
tool_name: toolName,
|
|
151
|
+
status: isCorrectlyIndexed ? 'found_and_correct' : 'found_search_missed',
|
|
152
|
+
in_graph: true,
|
|
153
|
+
tool_data: {
|
|
154
|
+
description: tool.description,
|
|
155
|
+
github_url: tool.github_url,
|
|
156
|
+
stars: tool.health.stars,
|
|
157
|
+
maintenance_score: Math.round(tool.health.maintenance_score * 100) / 100,
|
|
158
|
+
last_commit: tool.health.last_commit_date,
|
|
159
|
+
category: tool.category,
|
|
160
|
+
topics: tool.topics ?? [],
|
|
161
|
+
},
|
|
162
|
+
qdrant_present: qdrantStatus.present,
|
|
163
|
+
search_miss_reason: isCorrectlyIndexed ? undefined : missReason,
|
|
164
|
+
verdict: isCorrectlyIndexed
|
|
165
|
+
? `"${toolName}" is correctly indexed. Agent suggestion matches ToolPilot data. Use this tool.`
|
|
166
|
+
: `"${toolName}" is in the graph but search missed it: ${missReason}. Agent suggestion is valid — triggering re-embed.`,
|
|
167
|
+
});
|
|
168
|
+
// If not properly in Qdrant, re-index at P0 to fix it
|
|
169
|
+
if (!qdrantStatus.present || !qdrantStatus.hasTopics) {
|
|
170
|
+
toIndex.push(tool.github_url);
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
else {
|
|
174
|
+
// Not in graph at all — resolve name to GitHub URL, then queue at P0
|
|
175
|
+
const githubUrl = await resolveToGitHubUrl(toolName);
|
|
176
|
+
toIndex.push(githubUrl);
|
|
177
|
+
results.push({
|
|
178
|
+
tool_name: toolName,
|
|
179
|
+
status: 'not_indexed_queued',
|
|
180
|
+
in_graph: false,
|
|
181
|
+
indexing_eta_seconds: 120,
|
|
182
|
+
verdict: `"${toolName}" is not in the ToolPilot index. Resolved to ${githubUrl !== toolName ? githubUrl : 'GitHub'} and indexing triggered at P0 priority (~2 min). Call verify_suggestion again after indexing completes.`,
|
|
183
|
+
});
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
// ── Phase 2: enqueue missing/broken tools at P0 ───────────────────────────
|
|
187
|
+
const enqueueResults = await Promise.allSettled(toIndex.map((id) => enqueueIndexJob(id, P0_PRIORITY)));
|
|
188
|
+
const enqueued = enqueueResults.filter((r) => r.status === 'fulfilled').length;
|
|
189
|
+
// ── Phase 3: semantic comparison — what ToolPilot would recommend ─────────
|
|
190
|
+
const ourRecommendations = await semanticSearch(args.query, 3);
|
|
191
|
+
const foundInGraph = results.filter((r) => r.in_graph).map((r) => r.tool_name);
|
|
192
|
+
const notInGraph = results.filter((r) => !r.in_graph).map((r) => r.tool_name);
|
|
193
|
+
// Cross-reference: are our semantic recommendations different from agent suggestions?
|
|
194
|
+
const agentSet = new Set(args.agent_suggestions.map((s) => s.toLowerCase()));
|
|
195
|
+
const _ourSet = new Set(ourRecommendations.map((r) => r.name.toLowerCase()));
|
|
196
|
+
const agreement = ourRecommendations.filter((r) => agentSet.has(r.name.toLowerCase()));
|
|
197
|
+
const disagreement = ourRecommendations.filter((r) => !agentSet.has(r.name.toLowerCase()));
|
|
198
|
+
logger.info({ enqueued, foundInGraph: foundInGraph.length, notInGraph: notInGraph.length }, 'verify_suggestion complete');
|
|
199
|
+
return okResult({
|
|
200
|
+
suggestions: results,
|
|
201
|
+
enqueued_for_indexing: toIndex,
|
|
202
|
+
indexing_priority: 'P0 (urgent)',
|
|
203
|
+
our_semantic_recommendations: ourRecommendations,
|
|
204
|
+
agreement_analysis: {
|
|
205
|
+
agreed_tools: agreement.map((r) => r.name),
|
|
206
|
+
our_alternatives: disagreement.map((r) => r.name),
|
|
207
|
+
verdict: agreement.length > 0
|
|
208
|
+
? `ToolPilot agrees with agent on: ${agreement.map((r) => r.name).join(', ')}. Both signal high confidence.`
|
|
209
|
+
: disagreement.length > 0
|
|
210
|
+
? `ToolPilot recommends different tools: ${disagreement.map((r) => r.name).join(', ')}. Agent suggestions may be from older training data or niche tools not yet indexed.`
|
|
211
|
+
: 'Unable to compare — index query returned no results. Agent suggestions are the best available signal.',
|
|
212
|
+
},
|
|
213
|
+
next_steps: toIndex.length > 0
|
|
214
|
+
? `${toIndex.length} tool(s) queued for indexing at P0. Call verify_suggestion again in ~2 minutes for full comparison.`
|
|
215
|
+
: 'All tools verified. Use the verdict fields above to guide tool selection.',
|
|
216
|
+
});
|
|
217
|
+
}
|
|
218
|
+
catch (e) {
|
|
219
|
+
logger.error({ err: e }, 'verify_suggestion failed');
|
|
220
|
+
return errResult('verify_error', e instanceof Error ? e.message : String(e));
|
|
221
|
+
}
|
|
222
|
+
}
|
|
223
|
+
//# sourceMappingURL=verify-suggestion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"verify-suggestion.js","sourceRoot":"","sources":["../../src/tools/verify-suggestion.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAGH,OAAO,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,MAAM,kBAAkB,CAAC;AACrF,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAC7E,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,yCAAyC,EAAE,CAAC,CAAC;AACzE,MAAM,QAAQ,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAC9C,MAAM,WAAW,GAAG,IAAI,yBAAyB,EAAE,CAAC;AAEpD,gGAAgG;AAChG,MAAM,WAAW,GAAG,CAAC,CAAC;AAEtB;;;;GAIG;AACH,KAAK,UAAU,kBAAkB,CAAC,SAAiB;IACjD,2EAA2E;IAC3E,IAAI,SAAS,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,SAAS,CAAC,QAAQ,CAAC,GAAG,CAAC,EAAE,CAAC;QAChE,OAAO,SAAS,CAAC;IACnB,CAAC;IACD,kEAAkE;IAClE,IAAI,CAAC;QACH,MAAM,KAAK,GAAG,MAAM,CAAC,YAAY,CAAC;QAClC,MAAM,OAAO,GAA2B,EA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@@
|
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,+CAA+C,CAAC;AAC/E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,wBAAgB,eAAe,IAAI,SAAS,CAO3C;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';
|
|
2
|
+
import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';
|
|
3
|
+
import { config } from '@toolpilot/config';
|
|
4
|
+
export function createTransport() {
|
|
5
|
+
if (process.env.MCP_TRANSPORT === 'http') {
|
|
6
|
+
return new StreamableHTTPServerTransport({
|
|
7
|
+
sessionIdGenerator: () => crypto.randomUUID(),
|
|
8
|
+
});
|
|
9
|
+
}
|
|
10
|
+
return new StdioServerTransport();
|
|
11
|
+
}
|
|
12
|
+
export { config };
|
|
13
|
+
//# sourceMappingURL=transport.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../src/transport.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AACjF,OAAO,EAAE,6BAA6B,EAAE,MAAM,oDAAoD,CAAC;AAEnG,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C,MAAM,UAAU,eAAe;IAC7B,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,EAAE,CAAC;QACzC,OAAO,IAAI,6BAA6B,CAAC;YACvC,kBAAkB,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,UAAU,EAAE;SAC9C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,IAAI,oBAAoB,EAAE,CAAC;AACpC,CAAC;AAED,OAAO,EAAE,MAAM,EAAE,CAAC"}
|
package/dist/utils.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,oCAAoC,CAAC;AAEzE,wBAAgB,QAAQ,CAAC,IAAI,EAAE,OAAO,GAAG,cAAc,CAItD;AAED,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,cAAc,CAKxE"}
|
package/dist/utils.js
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export function okResult(data) {
|
|
2
|
+
return {
|
|
3
|
+
content: [{ type: 'text', text: JSON.stringify({ ok: true, data }) }],
|
|
4
|
+
};
|
|
5
|
+
}
|
|
6
|
+
export function errResult(error, message) {
|
|
7
|
+
return {
|
|
8
|
+
content: [{ type: 'text', text: JSON.stringify({ ok: false, error, message }) }],
|
|
9
|
+
isError: true,
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAEA,MAAM,UAAU,QAAQ,CAAC,IAAa;IACpC,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,EAAE,CAAC;KACtE,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,KAAa,EAAE,OAAe;IACtD,OAAO;QACL,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,EAAE,CAAC;QAChF,OAAO,EAAE,IAAI;KACd,CAAC;AACJ,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@neurynae/toolcairn-mcp",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"private": false,
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"description": "ToolCairn MCP — graph-powered tool intelligence for AI agents",
|
|
8
|
+
"homepage": "https://neurynae.com",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/NEURYNAE/ToolCairn"
|
|
12
|
+
},
|
|
13
|
+
"keywords": ["mcp", "ai", "tools", "graph", "developer-tools", "toolcairn", "neurynae", "tool-intelligence"],
|
|
14
|
+
"bin": {
|
|
15
|
+
"toolcairn-mcp": "./bin/toolpilot-mcp.js"
|
|
16
|
+
},
|
|
17
|
+
"files": ["dist/", "bin/", "data/"],
|
|
18
|
+
"engines": {
|
|
19
|
+
"node": ">=22.0.0"
|
|
20
|
+
},
|
|
21
|
+
"main": "./dist/index.js",
|
|
22
|
+
"scripts": {
|
|
23
|
+
"build": "tsc",
|
|
24
|
+
"build:publish": "tsup",
|
|
25
|
+
"dev": "tsx watch src/index.ts",
|
|
26
|
+
"start": "node dist/index.js",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"test:unit": "vitest run",
|
|
29
|
+
"clean": "rimraf dist"
|
|
30
|
+
},
|
|
31
|
+
"dependencies": {
|
|
32
|
+
"@modelcontextprotocol/sdk": "^1.7.0",
|
|
33
|
+
"pino": "^9.6.0",
|
|
34
|
+
"zod": "^3.24.1"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@toolpilot/config": "workspace:*",
|
|
38
|
+
"@toolpilot/core": "workspace:*",
|
|
39
|
+
"@toolpilot/db": "workspace:*",
|
|
40
|
+
"@toolpilot/graph": "workspace:*",
|
|
41
|
+
"@toolpilot/queue": "workspace:*",
|
|
42
|
+
"@toolpilot/remote": "workspace:*",
|
|
43
|
+
"@toolpilot/search": "workspace:*",
|
|
44
|
+
"@toolpilot/tools": "workspace:*",
|
|
45
|
+
"@toolpilot/tsconfig": "workspace:*",
|
|
46
|
+
"@toolpilot/vector": "workspace:*",
|
|
47
|
+
"@types/node": "^22.10.7",
|
|
48
|
+
"rimraf": "^6.0.1",
|
|
49
|
+
"tsup": "^8.5.1",
|
|
50
|
+
"tsx": "^4.19.2",
|
|
51
|
+
"typescript": "^5.7.2",
|
|
52
|
+
"vitest": "^3.0.4"
|
|
53
|
+
}
|
|
54
|
+
}
|