@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,178 @@
|
|
|
1
|
+
import { MemgraphToolRepository } from '@toolpilot/graph';
|
|
2
|
+
import { enqueueIndexJob } from '@toolpilot/queue';
|
|
3
|
+
import pino from 'pino';
|
|
4
|
+
import { errResult, okResult } from '../utils.js';
|
|
5
|
+
const logger = pino({ name: '@toolpilot/mcp-server:compare-tools' });
|
|
6
|
+
const repo = new MemgraphToolRepository();
|
|
7
|
+
// Relationship types that indicate good/bad compatibility
|
|
8
|
+
const POSITIVE_EDGE_TYPES = new Set(['COMPATIBLE_WITH', 'INTEGRATES_WITH', 'POPULAR_WITH']);
|
|
9
|
+
const NEGATIVE_EDGE_TYPES = new Set(['CONFLICTS_WITH', 'BREAKS_FROM']);
|
|
10
|
+
const SUPERCESSION_TYPES = new Set(['REPLACES']);
|
|
11
|
+
function buildComparison(tool, useCase) {
|
|
12
|
+
return {
|
|
13
|
+
name: tool.name,
|
|
14
|
+
display_name: tool.display_name,
|
|
15
|
+
description: tool.description,
|
|
16
|
+
github_url: tool.github_url,
|
|
17
|
+
health: {
|
|
18
|
+
stars: tool.health.stars,
|
|
19
|
+
maintenance_score: Math.round(tool.health.maintenance_score * 100) / 100,
|
|
20
|
+
last_commit_date: tool.health.last_commit_date,
|
|
21
|
+
open_issues: tool.health.open_issues,
|
|
22
|
+
contributor_count: tool.health.contributor_count,
|
|
23
|
+
},
|
|
24
|
+
fit_score: useCase ? Math.round(tool.health.maintenance_score * 100) / 100 : undefined,
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function computeRecommendation(toolA, toolB, edgeTypes) {
|
|
28
|
+
// If one replaces the other, prefer the replacement
|
|
29
|
+
const aReplacesB = edgeTypes.some((e) => e === 'REPLACES');
|
|
30
|
+
if (aReplacesB)
|
|
31
|
+
return 'tool_b'; // b is the newer one being recommended
|
|
32
|
+
const scoreDiff = toolA.health.maintenance_score - toolB.health.maintenance_score;
|
|
33
|
+
const starsDiff = toolA.health.stars - toolB.health.stars;
|
|
34
|
+
if (Math.abs(scoreDiff) < 0.1 && Math.abs(starsDiff) < 5000)
|
|
35
|
+
return 'either';
|
|
36
|
+
if (scoreDiff > 0)
|
|
37
|
+
return 'tool_a';
|
|
38
|
+
if (scoreDiff < 0)
|
|
39
|
+
return 'tool_b';
|
|
40
|
+
return starsDiff >= 0 ? 'tool_a' : 'tool_b';
|
|
41
|
+
}
|
|
42
|
+
export async function handleCompareTools(args) {
|
|
43
|
+
try {
|
|
44
|
+
logger.info({ tool_a: args.tool_a, tool_b: args.tool_b }, 'compare_tools called');
|
|
45
|
+
const [resultA, resultB] = await Promise.all([
|
|
46
|
+
repo.findByName(args.tool_a),
|
|
47
|
+
repo.findByName(args.tool_b),
|
|
48
|
+
]);
|
|
49
|
+
const toolAFound = resultA.ok && resultA.data != null;
|
|
50
|
+
const toolBFound = resultB.ok && resultB.data != null;
|
|
51
|
+
// Neither indexed — trigger indexing for both
|
|
52
|
+
if (!toolAFound && !toolBFound) {
|
|
53
|
+
await Promise.allSettled([enqueueIndexJob(args.tool_a, 2), enqueueIndexJob(args.tool_b, 2)]);
|
|
54
|
+
return okResult({
|
|
55
|
+
status: 'not_indexed',
|
|
56
|
+
tool_a: args.tool_a,
|
|
57
|
+
tool_b: args.tool_b,
|
|
58
|
+
async_index_triggered: true,
|
|
59
|
+
agent_instructions: [
|
|
60
|
+
`Neither "${args.tool_a}" nor "${args.tool_b}" is in the ToolPilot index.`,
|
|
61
|
+
'Indexing has been triggered for both — results will be available in ~2 minutes.',
|
|
62
|
+
'In the meantime, search GitHub for both tools to gather basic information for comparison.',
|
|
63
|
+
'Use search_tools to find alternatives if these tools are not found.',
|
|
64
|
+
].join(' '),
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
// One not indexed — trigger indexing for the missing one
|
|
68
|
+
if (!toolAFound || !toolBFound) {
|
|
69
|
+
const missingName = !toolAFound ? args.tool_a : args.tool_b;
|
|
70
|
+
const indexedData = toolAFound
|
|
71
|
+
? resultA.ok
|
|
72
|
+
? resultA.data
|
|
73
|
+
: null
|
|
74
|
+
: resultB.ok
|
|
75
|
+
? resultB.data
|
|
76
|
+
: null;
|
|
77
|
+
const indexedTool = indexedData;
|
|
78
|
+
await enqueueIndexJob(missingName, 2);
|
|
79
|
+
return okResult({
|
|
80
|
+
status: 'partial',
|
|
81
|
+
indexed_tool: buildComparison(indexedTool, args.use_case),
|
|
82
|
+
unindexed_tool: {
|
|
83
|
+
name: missingName,
|
|
84
|
+
status: 'not_in_index',
|
|
85
|
+
message: `"${missingName}" is not in the ToolPilot index yet.`,
|
|
86
|
+
},
|
|
87
|
+
async_index_triggered: true,
|
|
88
|
+
agent_instructions: [
|
|
89
|
+
`"${missingName}" is not indexed. Indexing has been triggered — retry compare_tools in ~2 minutes.`,
|
|
90
|
+
`Meanwhile, "${indexedTool.name}" data is available above.`,
|
|
91
|
+
`Search GitHub for "${missingName}" to gather basic health information for a manual comparison.`,
|
|
92
|
+
].join(' '),
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
// Both indexed — full comparison
|
|
96
|
+
const toolA = resultA.data;
|
|
97
|
+
const toolB = resultB.data;
|
|
98
|
+
const edgesResult = await repo.getDirectEdges(args.tool_a, args.tool_b);
|
|
99
|
+
const edges = edgesResult.ok ? edgesResult.data : [];
|
|
100
|
+
const compatibilitySignal = edges.some((e) => POSITIVE_EDGE_TYPES.has(e.edgeType))
|
|
101
|
+
? 'compatible'
|
|
102
|
+
: edges.some((e) => NEGATIVE_EDGE_TYPES.has(e.edgeType))
|
|
103
|
+
? 'conflicts'
|
|
104
|
+
: edges.some((e) => SUPERCESSION_TYPES.has(e.edgeType))
|
|
105
|
+
? 'one_replaces_other'
|
|
106
|
+
: 'unknown';
|
|
107
|
+
const recommendation = computeRecommendation(toolA, toolB, edges.map((e) => e.edgeType));
|
|
108
|
+
const comparisonDimensions = [
|
|
109
|
+
{
|
|
110
|
+
dimension: 'Maintenance',
|
|
111
|
+
tool_a: toolA.health.maintenance_score,
|
|
112
|
+
tool_b: toolB.health.maintenance_score,
|
|
113
|
+
winner: toolA.health.maintenance_score >= toolB.health.maintenance_score
|
|
114
|
+
? args.tool_a
|
|
115
|
+
: args.tool_b,
|
|
116
|
+
note: 'Composite score across commits, stars velocity, issue resolution, PR response',
|
|
117
|
+
},
|
|
118
|
+
{
|
|
119
|
+
dimension: 'Community',
|
|
120
|
+
tool_a: toolA.health.stars,
|
|
121
|
+
tool_b: toolB.health.stars,
|
|
122
|
+
winner: toolA.health.stars >= toolB.health.stars ? args.tool_a : args.tool_b,
|
|
123
|
+
note: 'GitHub stars',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
dimension: 'Activity',
|
|
127
|
+
tool_a: toolA.health.commit_velocity_30d ?? 0,
|
|
128
|
+
tool_b: toolB.health.commit_velocity_30d ?? 0,
|
|
129
|
+
winner: (toolA.health.commit_velocity_30d ?? 0) >= (toolB.health.commit_velocity_30d ?? 0)
|
|
130
|
+
? args.tool_a
|
|
131
|
+
: args.tool_b,
|
|
132
|
+
note: 'Commits in last 30 days',
|
|
133
|
+
},
|
|
134
|
+
{
|
|
135
|
+
dimension: 'Contributors',
|
|
136
|
+
tool_a: toolA.health.contributor_count,
|
|
137
|
+
tool_b: toolB.health.contributor_count,
|
|
138
|
+
winner: toolA.health.contributor_count >= toolB.health.contributor_count
|
|
139
|
+
? args.tool_a
|
|
140
|
+
: args.tool_b,
|
|
141
|
+
note: 'Total contributor count',
|
|
142
|
+
},
|
|
143
|
+
];
|
|
144
|
+
const winnerCounts = comparisonDimensions.reduce((acc, d) => {
|
|
145
|
+
acc[d.winner] = (acc[d.winner] ?? 0) + 1;
|
|
146
|
+
return acc;
|
|
147
|
+
}, {});
|
|
148
|
+
const dominantWinner = Object.entries(winnerCounts).sort((a, b) => b[1] - a[1])[0]?.[0] ?? 'either';
|
|
149
|
+
return okResult({
|
|
150
|
+
status: 'complete',
|
|
151
|
+
tool_a: buildComparison(toolA, args.use_case),
|
|
152
|
+
tool_b: buildComparison(toolB, args.use_case),
|
|
153
|
+
graph_relationship: {
|
|
154
|
+
edges: edges.map((e) => ({
|
|
155
|
+
type: e.edgeType,
|
|
156
|
+
direction: e.direction,
|
|
157
|
+
confidence: Math.round(e.confidence * 100) / 100,
|
|
158
|
+
effective_weight: Math.round(e.effective_weight * 100) / 100,
|
|
159
|
+
})),
|
|
160
|
+
compatibility_signal: compatibilitySignal,
|
|
161
|
+
},
|
|
162
|
+
dimensions: comparisonDimensions,
|
|
163
|
+
recommendation,
|
|
164
|
+
dominant_winner: dominantWinner,
|
|
165
|
+
confidence: edges.length > 0 ? 0.9 : 0.7,
|
|
166
|
+
decision_guide: {
|
|
167
|
+
accept_recommendation: `Call update_project_config with action: "add_tool", tool_name: "${recommendation === 'tool_a' ? args.tool_a : args.tool_b}"`,
|
|
168
|
+
override_recommendation: `Call update_project_config with action: "add_tool", tool_name: "<user_choice>" to persist the override`,
|
|
169
|
+
add_both_to_consider: `Call update_project_config with action: "add_evaluation" for each to track in pending_evaluation`,
|
|
170
|
+
},
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
catch (e) {
|
|
174
|
+
logger.error({ err: e }, 'compare_tools failed');
|
|
175
|
+
return errResult('compare_error', e instanceof Error ? e.message : String(e));
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
//# sourceMappingURL=compare-tools.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compare-tools.js","sourceRoot":"","sources":["../../src/tools/compare-tools.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAElD,MAAM,MAAM,GAAG,IAAI,CAAC,EAAE,IAAI,EAAE,qCAAqC,EAAE,CAAC,CAAC;AACrE,MAAM,IAAI,GAAG,IAAI,sBAAsB,EAAE,CAAC;AAE1C,0DAA0D;AAC1D,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,iBAAiB,EAAE,iBAAiB,EAAE,cAAc,CAAC,CAAC,CAAC;AAC5F,MAAM,mBAAmB,GAAG,IAAI,GAAG,CAAC,CAAC,gBAAgB,EAAE,aAAa,CAAC,CAAC,CAAC;AACvE,MAAM,kBAAkB,GAAG,IAAI,GAAG,CAAC,CAAC,UAAU,CAAC,CAAC,CAAC;AAiBjD,SAAS,eAAe,CAAC,IAAc,EAAE,OAAgB;IACvD,OAAO;QACL,IAAI,EAAE,IAAI,CAAC,IAAI;QACf,YAAY,EAAE,IAAI,CAAC,YAAY;QAC/B,WAAW,EAAE,IAAI,CAAC,WAAW;QAC7B,UAAU,EAAE,IAAI,CAAC,UAAU;QAC3B,MAAM,EAAE;YACN,KAAK,EAAE,IAAI,CAAC,MAAM,CAAC,KAAK;YACxB,iBAAiB,EAAE,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,GAAG,CAAC,GAAG,GAAG;YACxE,gBAAgB,EAAE,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AAC,CAAC,CAAC,CAAC,CAAC;IAChF,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { ToolNode } from '@toolpilot/core';
|
|
2
|
+
export interface FormattedResult {
|
|
3
|
+
type: 'stable' | 'emerging';
|
|
4
|
+
tool: string;
|
|
5
|
+
display_name: string;
|
|
6
|
+
description: string;
|
|
7
|
+
fit_score: number;
|
|
8
|
+
reason: string;
|
|
9
|
+
github_url: string;
|
|
10
|
+
docs: {
|
|
11
|
+
readme: string | null;
|
|
12
|
+
official: string | null;
|
|
13
|
+
api: string | null;
|
|
14
|
+
changelog: string | null;
|
|
15
|
+
};
|
|
16
|
+
trust_hierarchy: string[];
|
|
17
|
+
prompt_hint: string;
|
|
18
|
+
health: {
|
|
19
|
+
stars: number;
|
|
20
|
+
maintenance_score: number;
|
|
21
|
+
last_commit_date: string;
|
|
22
|
+
};
|
|
23
|
+
deprecation_warning: string | null;
|
|
24
|
+
}
|
|
25
|
+
export declare function formatResults(results: Array<{
|
|
26
|
+
tool: ToolNode;
|
|
27
|
+
score: number;
|
|
28
|
+
}>, isTwoOption: boolean): FormattedResult[];
|
|
29
|
+
export interface NonIndexedGuidance {
|
|
30
|
+
message: string;
|
|
31
|
+
agent_instructions: string;
|
|
32
|
+
suggest_manual_add: boolean;
|
|
33
|
+
proprietary_prone: boolean;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Build non-indexed guidance when results are empty or low-confidence.
|
|
37
|
+
* Returns null when results are confident and complete.
|
|
38
|
+
*/
|
|
39
|
+
export declare function buildNonIndexedGuidance(results: FormattedResult[], query: string): NonIndexedGuidance | null;
|
|
40
|
+
/**
|
|
41
|
+
* Check if any results have very low star counts (credibility check).
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildLowCredibilityWarning(results: FormattedResult[]): string | null;
|
|
44
|
+
//# sourceMappingURL=format-results.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"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,GACZ,kBAAkB,GAAG,IAAI,CAuC3B;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,eAAe,EAAE,GAAG,MAAM,GAAG,IAAI,CAIpF"}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
// Shared result formatter for search_tools and search_tools_respond.
|
|
2
|
+
// Adds deprecation warnings, non-OSS guidance, and health signals.
|
|
3
|
+
const MAINTENANCE_SCORE_DEPRECATED = 0.2;
|
|
4
|
+
const LAST_COMMIT_STALE_DAYS = 180;
|
|
5
|
+
const STARS_MINIMUM_CREDIBLE = 100;
|
|
6
|
+
// Categories where proprietary alternatives are common
|
|
7
|
+
const PROPRIETARY_PRONE_CATEGORIES = new Set(['monitoring', 'devops', 'auth']);
|
|
8
|
+
function daysSince(isoDate) {
|
|
9
|
+
if (!isoDate)
|
|
10
|
+
return 0;
|
|
11
|
+
return (Date.now() - new Date(isoDate).getTime()) / (1000 * 60 * 60 * 24);
|
|
12
|
+
}
|
|
13
|
+
function buildDeprecationWarning(tool) {
|
|
14
|
+
const reasons = [];
|
|
15
|
+
if (tool.health.maintenance_score < MAINTENANCE_SCORE_DEPRECATED) {
|
|
16
|
+
reasons.push(`maintenance score is very low (${Math.round(tool.health.maintenance_score * 100)}%)`);
|
|
17
|
+
}
|
|
18
|
+
const daysSinceCommit = daysSince(tool.health.last_commit_date);
|
|
19
|
+
if (daysSinceCommit > LAST_COMMIT_STALE_DAYS) {
|
|
20
|
+
reasons.push(`last commit was ${Math.round(daysSinceCommit / 30)} months ago`);
|
|
21
|
+
}
|
|
22
|
+
if (reasons.length === 0)
|
|
23
|
+
return null;
|
|
24
|
+
return `⚠ This tool may be unmaintained: ${reasons.join(' and ')}. Consider checking for active alternatives via search_tools.`;
|
|
25
|
+
}
|
|
26
|
+
export function formatResults(results, isTwoOption) {
|
|
27
|
+
return results.map((r, idx) => {
|
|
28
|
+
const type = isTwoOption && idx === 1 ? 'emerging' : 'stable';
|
|
29
|
+
const parts = [];
|
|
30
|
+
if (r.tool.license)
|
|
31
|
+
parts.push(`${r.tool.license} license`);
|
|
32
|
+
if (r.tool.language)
|
|
33
|
+
parts.push(`${r.tool.language}`);
|
|
34
|
+
if (r.tool.health.maintenance_score > 0.7)
|
|
35
|
+
parts.push('actively maintained');
|
|
36
|
+
if (r.tool.health.stars > 10_000)
|
|
37
|
+
parts.push(`${Math.round(r.tool.health.stars / 1000)}k stars`);
|
|
38
|
+
const reason = parts.join(', ') || 'Best match for your query';
|
|
39
|
+
const docsUrl = r.tool.docs.docs_url ?? r.tool.docs.readme_url ?? r.tool.github_url;
|
|
40
|
+
const deprecationWarning = buildDeprecationWarning(r.tool);
|
|
41
|
+
return {
|
|
42
|
+
type,
|
|
43
|
+
tool: r.tool.name,
|
|
44
|
+
display_name: r.tool.display_name,
|
|
45
|
+
description: r.tool.description,
|
|
46
|
+
fit_score: Math.round(r.score * 100) / 100,
|
|
47
|
+
reason,
|
|
48
|
+
github_url: r.tool.github_url,
|
|
49
|
+
docs: {
|
|
50
|
+
readme: r.tool.docs.readme_url ?? null,
|
|
51
|
+
official: r.tool.docs.docs_url ?? null,
|
|
52
|
+
api: r.tool.docs.api_url ?? null,
|
|
53
|
+
changelog: r.tool.docs.changelog_url ?? null,
|
|
54
|
+
},
|
|
55
|
+
trust_hierarchy: ['official_docs', 'changelog', 'readme', 'training_data'],
|
|
56
|
+
prompt_hint: `Refer to ${docsUrl} for current API. Check changelog for breaking changes. Prefer official docs over training data.`,
|
|
57
|
+
health: {
|
|
58
|
+
stars: r.tool.health.stars,
|
|
59
|
+
maintenance_score: Math.round(r.tool.health.maintenance_score * 100) / 100,
|
|
60
|
+
last_commit_date: r.tool.health.last_commit_date,
|
|
61
|
+
},
|
|
62
|
+
deprecation_warning: deprecationWarning,
|
|
63
|
+
};
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Build non-indexed guidance when results are empty or low-confidence.
|
|
68
|
+
* Returns null when results are confident and complete.
|
|
69
|
+
*/
|
|
70
|
+
export function buildNonIndexedGuidance(results, query) {
|
|
71
|
+
// No results — something is definitely missing
|
|
72
|
+
if (results.length === 0) {
|
|
73
|
+
return {
|
|
74
|
+
message: 'No tools found for this query in the ToolPilot index. The tool you need may be proprietary, niche, or recently released.',
|
|
75
|
+
agent_instructions: [
|
|
76
|
+
'Search GitHub directly for the tool category described in the query.',
|
|
77
|
+
'If you find a relevant tool, add it to .toolpilot/config.json with source: "non_oss" or source: "manual".',
|
|
78
|
+
'Optionally call suggest_graph_update with suggestion_type: "new_tool" to add it to the ToolPilot index.',
|
|
79
|
+
].join(' '),
|
|
80
|
+
suggest_manual_add: true,
|
|
81
|
+
proprietary_prone: false,
|
|
82
|
+
};
|
|
83
|
+
}
|
|
84
|
+
// Low max score — results exist but confidence is low
|
|
85
|
+
const maxScore = Math.max(...results.map((r) => r.fit_score));
|
|
86
|
+
if (maxScore < 0.4) {
|
|
87
|
+
const queryLower = query.toLowerCase();
|
|
88
|
+
const isProprietaryProne = Array.from(PROPRIETARY_PRONE_CATEGORIES).some((cat) => queryLower.includes(cat));
|
|
89
|
+
return {
|
|
90
|
+
message: `Results found but with low confidence (best match: ${Math.round(maxScore * 100)}%). There may be better proprietary or niche alternatives not in the index.`,
|
|
91
|
+
agent_instructions: [
|
|
92
|
+
'Review the results above critically.',
|
|
93
|
+
isProprietaryProne
|
|
94
|
+
? 'This category often has proprietary options (e.g., Auth0, Datadog, Sentry) — consider asking the user if a paid option is acceptable.'
|
|
95
|
+
: 'Consider searching GitHub for additional options.',
|
|
96
|
+
'Add any chosen tool to .toolpilot/config.json with update_project_config.',
|
|
97
|
+
].join(' '),
|
|
98
|
+
suggest_manual_add: true,
|
|
99
|
+
proprietary_prone: isProprietaryProne,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Results are confident — no guidance needed
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
/**
|
|
106
|
+
* Check if any results have very low star counts (credibility check).
|
|
107
|
+
*/
|
|
108
|
+
export function buildLowCredibilityWarning(results) {
|
|
109
|
+
const lowCred = results.filter((r) => r.health.stars < STARS_MINIMUM_CREDIBLE);
|
|
110
|
+
if (lowCred.length === 0)
|
|
111
|
+
return null;
|
|
112
|
+
return `Note: ${lowCred.map((r) => r.tool).join(', ')} ${lowCred.length === 1 ? 'has' : 'have'} fewer than ${STARS_MINIMUM_CREDIBLE} stars — verify these are production-ready before recommending.`;
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=format-results.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"format-results.js","sourceRoot":"","sources":["../../src/tools/format-results.ts"],"names":[],"mappings":"AAAA,qEAAqE;AACrE,mEAAmE;AAInE,MAAM,4BAA4B,GAAG,GAAG,CAAC;AACzC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AACnC,MAAM,sBAAsB,GAAG,GAAG,CAAC;AAEnC,uDAAuD;AACvD,MAAM,4BAA4B,GAAG,IAAI,GAAG,CAAC,CAAC,YAAY,EAAE,QAAQ,EAAE,MAAM,CAAC,CAAC,CAAC;AAE/E,SAAS,SAAS,CAAC,OAAe;IAChC,IAAI,CAAC,OAAO;QAAE,OAAO,CAAC,CAAC;IACvB,OAAO,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,IAAI,IAAI,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC;AAC5E,CAAC;AAED,SAAS,uBAAuB,CAAC,IAAc;IAC7C,MAAM,OAAO,GAAa,EAAE,CAAC;IAE7B,IAAI,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,4BAA4B,EAAE,CAAC;QACjE,OAAO,CAAC,IAAI,CACV,kCAAkC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,GAAG,GAAG,CAAC,IAAI,CACtF,CAAC;IACJ,C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ACX,kBAAkB,EAAE,IAAI;YACxB,iBAAiB,EAAE,kBAAkB;SACtC,CAAC;IACJ,CAAC;IAED,6CAA6C;IAC7C,OAAO,IAAI,CAAC;AACd,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,0BAA0B,CAAC,OAA0B;IACnE,MAAM,OAAO,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,GAAG,sBAAsB,CAAC,CAAC;IAC/E,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACtC,OAAO,SAAS,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,MAAM,eAAe,sBAAsB,iEAAiE,CAAC;AACvM,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Generate the standalone tracker.html content.
|
|
3
|
+
* Called by toolpilot_init to produce the HTML file content.
|
|
4
|
+
* The agent writes the returned content to .toolpilot/tracker.html
|
|
5
|
+
*/
|
|
6
|
+
export declare function generateTrackerHtml(eventsPath: string): string;
|
|
7
|
+
//# sourceMappingURL=generate-tracker.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generate-tracker.d.ts","sourceRoot":"","sources":["../../src/tools/generate-tracker.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,GAAG,MAAM,CAiZ9D"}
|