mcmodding-mcp 0.1.0 → 0.2.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/LICENSE +21 -21
- package/README.md +334 -324
- package/dist/cli/install.d.ts +2 -0
- package/dist/cli/install.d.ts.map +1 -0
- package/dist/cli/install.js +397 -0
- package/dist/cli/install.js.map +1 -0
- package/dist/db-versioning.js +2 -2
- package/dist/db-versioning.js.map +1 -1
- package/dist/index.js +146 -106
- package/dist/index.js.map +1 -1
- package/dist/services/mod-examples-service.d.ts +106 -0
- package/dist/services/mod-examples-service.d.ts.map +1 -0
- package/dist/services/mod-examples-service.js +370 -0
- package/dist/services/mod-examples-service.js.map +1 -0
- package/dist/tools/modExamples.d.ts +144 -0
- package/dist/tools/modExamples.d.ts.map +1 -0
- package/dist/tools/modExamples.js +402 -0
- package/dist/tools/modExamples.js.map +1 -0
- package/package.json +6 -4
- package/scripts/postinstall.js +7 -3
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
import { ModExamplesService } from '../services/mod-examples-service.js';
|
|
2
|
+
export const MOD_EXAMPLES_TOOLS = [
|
|
3
|
+
{
|
|
4
|
+
name: 'search_mod_examples',
|
|
5
|
+
description: 'Search through canonical code examples from popular open-source mods like Create, Botania, Applied Energistics 2. These are real-world, battle-tested implementations with AI-generated explanations. Use this when you need proven patterns from successful mods.',
|
|
6
|
+
inputSchema: {
|
|
7
|
+
type: 'object',
|
|
8
|
+
properties: {
|
|
9
|
+
query: {
|
|
10
|
+
type: 'string',
|
|
11
|
+
description: 'Search query (e.g., "block entity", "custom renderer", "networking", "registration"). Free-form text search.',
|
|
12
|
+
},
|
|
13
|
+
mod: {
|
|
14
|
+
type: 'string',
|
|
15
|
+
description: 'Filter by specific mod name (e.g., "Create", "Botania", "Applied Energistics 2", "Fabric API")',
|
|
16
|
+
},
|
|
17
|
+
category: {
|
|
18
|
+
type: 'string',
|
|
19
|
+
enum: [
|
|
20
|
+
'blocks',
|
|
21
|
+
'items',
|
|
22
|
+
'entities',
|
|
23
|
+
'tile-entities',
|
|
24
|
+
'rendering',
|
|
25
|
+
'gui',
|
|
26
|
+
'networking',
|
|
27
|
+
'worldgen',
|
|
28
|
+
'data-generation',
|
|
29
|
+
'recipes',
|
|
30
|
+
'events',
|
|
31
|
+
'registry',
|
|
32
|
+
'api-design',
|
|
33
|
+
'cross-platform',
|
|
34
|
+
'storage-systems',
|
|
35
|
+
'animation',
|
|
36
|
+
'particles',
|
|
37
|
+
'sounds',
|
|
38
|
+
'commands',
|
|
39
|
+
'config',
|
|
40
|
+
],
|
|
41
|
+
description: 'Filter by pattern category',
|
|
42
|
+
},
|
|
43
|
+
pattern_type: {
|
|
44
|
+
type: 'string',
|
|
45
|
+
description: 'Filter by pattern type (e.g., "block-registration", "event-handler", "renderer", "packet-handler")',
|
|
46
|
+
},
|
|
47
|
+
complexity: {
|
|
48
|
+
type: 'string',
|
|
49
|
+
enum: ['beginner', 'intermediate', 'advanced', 'expert'],
|
|
50
|
+
description: 'Filter by complexity level',
|
|
51
|
+
},
|
|
52
|
+
min_quality: {
|
|
53
|
+
type: 'number',
|
|
54
|
+
description: 'Minimum quality score (0.0-1.0). Higher = more curated examples. Default: 0.5',
|
|
55
|
+
minimum: 0,
|
|
56
|
+
maximum: 1,
|
|
57
|
+
},
|
|
58
|
+
featured_only: {
|
|
59
|
+
type: 'boolean',
|
|
60
|
+
description: 'Only return featured (highest quality) examples',
|
|
61
|
+
},
|
|
62
|
+
limit: {
|
|
63
|
+
type: 'number',
|
|
64
|
+
description: 'Maximum results (1-20). Default: 5',
|
|
65
|
+
minimum: 1,
|
|
66
|
+
maximum: 20,
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: 'get_mod_example',
|
|
73
|
+
description: 'Get detailed information about a specific mod example by ID. Returns full code, explanation, best practices, pitfalls, imports, and related examples. Use after searching to get complete details.',
|
|
74
|
+
inputSchema: {
|
|
75
|
+
type: 'object',
|
|
76
|
+
properties: {
|
|
77
|
+
id: {
|
|
78
|
+
type: 'number',
|
|
79
|
+
description: 'Example ID (from search results)',
|
|
80
|
+
},
|
|
81
|
+
include_related: {
|
|
82
|
+
type: 'boolean',
|
|
83
|
+
description: 'Include related examples (similar patterns, dependencies). Default: true',
|
|
84
|
+
},
|
|
85
|
+
},
|
|
86
|
+
required: ['id'],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
name: 'list_canonical_mods',
|
|
91
|
+
description: 'List all indexed canonical mods with their example counts and descriptions. Use this to discover what mods are available for examples.',
|
|
92
|
+
inputSchema: {
|
|
93
|
+
type: 'object',
|
|
94
|
+
properties: {
|
|
95
|
+
include_stats: {
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
description: 'Include database statistics. Default: false',
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
name: 'list_mod_categories',
|
|
104
|
+
description: 'List all available pattern categories with example counts. Use this to discover what types of examples are available.',
|
|
105
|
+
inputSchema: {
|
|
106
|
+
type: 'object',
|
|
107
|
+
properties: {},
|
|
108
|
+
},
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
name: 'get_mod_patterns',
|
|
112
|
+
description: 'Get all available pattern types with counts. Useful for discovering specific implementation patterns.',
|
|
113
|
+
inputSchema: {
|
|
114
|
+
type: 'object',
|
|
115
|
+
properties: {},
|
|
116
|
+
},
|
|
117
|
+
},
|
|
118
|
+
];
|
|
119
|
+
export function handleSearchModExamples(params) {
|
|
120
|
+
try {
|
|
121
|
+
if (!ModExamplesService.isAvailable()) {
|
|
122
|
+
return {
|
|
123
|
+
content: [
|
|
124
|
+
{
|
|
125
|
+
type: 'text',
|
|
126
|
+
text: 'Mod examples database is not available. This is an optional feature that provides examples from canonical open-source mods.\n\nThe standard documentation tools (search_fabric_docs, get_example) are still available.',
|
|
127
|
+
},
|
|
128
|
+
],
|
|
129
|
+
};
|
|
130
|
+
}
|
|
131
|
+
const service = new ModExamplesService();
|
|
132
|
+
try {
|
|
133
|
+
const examples = service.searchExamples({
|
|
134
|
+
query: params.query,
|
|
135
|
+
modName: params.mod,
|
|
136
|
+
category: params.category,
|
|
137
|
+
patternType: params.pattern_type,
|
|
138
|
+
complexity: params.complexity,
|
|
139
|
+
minQualityScore: params.min_quality ?? 0.5,
|
|
140
|
+
featured: params.featured_only,
|
|
141
|
+
limit: Math.min(Math.max(params.limit || 5, 1), 20),
|
|
142
|
+
});
|
|
143
|
+
let output = '';
|
|
144
|
+
if (examples.length === 0) {
|
|
145
|
+
output = 'No mod examples found matching your criteria.\n\n';
|
|
146
|
+
output += '**Suggestions:**\n';
|
|
147
|
+
output += '- Try broader search terms\n';
|
|
148
|
+
output += '- Remove category or complexity filters\n';
|
|
149
|
+
output += '- Use `list_canonical_mods` to see available mods\n';
|
|
150
|
+
output += '- Use `list_mod_categories` to see available categories\n';
|
|
151
|
+
}
|
|
152
|
+
else {
|
|
153
|
+
output = `Found ${examples.length} canonical mod example${examples.length > 1 ? 's' : ''}:\n\n`;
|
|
154
|
+
examples.forEach((ex, i) => {
|
|
155
|
+
output += `### ${i + 1}. ${ex.title}\n`;
|
|
156
|
+
output += `**ID:** ${ex.id} | **Mod:** ${ex.modName} | **Quality:** ${(ex.qualityScore * 100).toFixed(0)}%`;
|
|
157
|
+
if (ex.isFeatured)
|
|
158
|
+
output += ' | ⭐ Featured';
|
|
159
|
+
output += '\n';
|
|
160
|
+
output += `**Category:** ${ex.categoryName || ex.category} | **Pattern:** ${ex.patternType} | **Complexity:** ${ex.complexity}\n`;
|
|
161
|
+
output += `\n${ex.caption}\n\n`;
|
|
162
|
+
output += `\`\`\`${ex.language}\n${ex.code.slice(0, 500)}${ex.code.length > 500 ? '\n// ... (truncated, use get_mod_example for full code)' : ''}\n\`\`\`\n\n`;
|
|
163
|
+
output += `→ Use \`get_mod_example\` with ID ${ex.id} for full details\n\n---\n\n`;
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
return {
|
|
167
|
+
content: [{ type: 'text', text: output }],
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
finally {
|
|
171
|
+
service.close();
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
console.error('[search_mod_examples] Error:', error);
|
|
176
|
+
return {
|
|
177
|
+
content: [
|
|
178
|
+
{
|
|
179
|
+
type: 'text',
|
|
180
|
+
text: `Error searching mod examples: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
181
|
+
},
|
|
182
|
+
],
|
|
183
|
+
isError: true,
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
export function handleGetModExample(params) {
|
|
188
|
+
try {
|
|
189
|
+
if (!ModExamplesService.isAvailable()) {
|
|
190
|
+
return {
|
|
191
|
+
content: [
|
|
192
|
+
{
|
|
193
|
+
type: 'text',
|
|
194
|
+
text: 'Mod examples database is not available.',
|
|
195
|
+
},
|
|
196
|
+
],
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
const service = new ModExamplesService();
|
|
200
|
+
try {
|
|
201
|
+
const example = service.getExample(params.id);
|
|
202
|
+
if (!example) {
|
|
203
|
+
return {
|
|
204
|
+
content: [
|
|
205
|
+
{
|
|
206
|
+
type: 'text',
|
|
207
|
+
text: `Example with ID ${params.id} not found. Use search_mod_examples to find valid example IDs.`,
|
|
208
|
+
},
|
|
209
|
+
],
|
|
210
|
+
};
|
|
211
|
+
}
|
|
212
|
+
let output = service.formatExampleForAI(example);
|
|
213
|
+
if (params.include_related !== false) {
|
|
214
|
+
const relations = service.getRelatedExamples(params.id);
|
|
215
|
+
if (relations.length > 0) {
|
|
216
|
+
output += '\n---\n\n## Related Examples\n\n';
|
|
217
|
+
relations.forEach((rel) => {
|
|
218
|
+
const relationLabel = {
|
|
219
|
+
uses: '📦 Uses',
|
|
220
|
+
extends: '🔄 Extends',
|
|
221
|
+
similar_to: '🔗 Similar to',
|
|
222
|
+
alternative_to: '↔️ Alternative to',
|
|
223
|
+
requires: '⚠️ Requires',
|
|
224
|
+
complements: '✨ Complements',
|
|
225
|
+
}[rel.relationType] || rel.relationType;
|
|
226
|
+
output += `**${relationLabel}** (ID: ${rel.targetId}, strength: ${(rel.strength * 100).toFixed(0)}%)\n`;
|
|
227
|
+
output += `- ${rel.targetTitle}\n`;
|
|
228
|
+
output += `- ${rel.description}\n\n`;
|
|
229
|
+
});
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
return {
|
|
233
|
+
content: [{ type: 'text', text: output }],
|
|
234
|
+
};
|
|
235
|
+
}
|
|
236
|
+
finally {
|
|
237
|
+
service.close();
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
catch (error) {
|
|
241
|
+
console.error('[get_mod_example] Error:', error);
|
|
242
|
+
return {
|
|
243
|
+
content: [
|
|
244
|
+
{
|
|
245
|
+
type: 'text',
|
|
246
|
+
text: `Error retrieving example: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
247
|
+
},
|
|
248
|
+
],
|
|
249
|
+
isError: true,
|
|
250
|
+
};
|
|
251
|
+
}
|
|
252
|
+
}
|
|
253
|
+
export function handleListCanonicalMods(params) {
|
|
254
|
+
try {
|
|
255
|
+
if (!ModExamplesService.isAvailable()) {
|
|
256
|
+
return {
|
|
257
|
+
content: [
|
|
258
|
+
{
|
|
259
|
+
type: 'text',
|
|
260
|
+
text: 'Mod examples database is not available.',
|
|
261
|
+
},
|
|
262
|
+
],
|
|
263
|
+
};
|
|
264
|
+
}
|
|
265
|
+
const service = new ModExamplesService();
|
|
266
|
+
try {
|
|
267
|
+
const mods = service.listMods();
|
|
268
|
+
let output = '# Indexed Canonical Mods\n\n';
|
|
269
|
+
output += 'These are high-quality, open-source mods with AI-analyzed code examples:\n\n';
|
|
270
|
+
if (params.include_stats) {
|
|
271
|
+
const stats = service.getStats();
|
|
272
|
+
output += '## Database Statistics\n\n';
|
|
273
|
+
output += `| Metric | Value |\n`;
|
|
274
|
+
output += `|--------|-------|\n`;
|
|
275
|
+
output += `| Total Mods | ${stats.mods} |\n`;
|
|
276
|
+
output += `| Total Examples | ${stats.examples} |\n`;
|
|
277
|
+
output += `| Relationships | ${stats.relations} |\n`;
|
|
278
|
+
output += `| Featured Examples | ${stats.featuredExamples} |\n`;
|
|
279
|
+
output += `| Avg Quality Score | ${(stats.avgQualityScore * 100).toFixed(0)}% |\n\n`;
|
|
280
|
+
}
|
|
281
|
+
output += '## Available Mods\n\n';
|
|
282
|
+
mods.forEach((mod) => {
|
|
283
|
+
output += `### ${mod.name}\n`;
|
|
284
|
+
output += `**Repository:** [${mod.repo}](https://github.com/${mod.repo})\n`;
|
|
285
|
+
output += `**Loader:** ${mod.loader} | **Stars:** ${mod.starCount.toLocaleString()} | **Examples:** ${mod.exampleCount}\n`;
|
|
286
|
+
output += `**Versions:** ${mod.minecraftVersions.join(', ') || 'Various'}\n\n`;
|
|
287
|
+
output += `${mod.description}\n\n`;
|
|
288
|
+
if (mod.architectureNotes) {
|
|
289
|
+
output += `*Architecture:* ${mod.architectureNotes.slice(0, 200)}${mod.architectureNotes.length > 200 ? '...' : ''}\n\n`;
|
|
290
|
+
}
|
|
291
|
+
output += '---\n\n';
|
|
292
|
+
});
|
|
293
|
+
return {
|
|
294
|
+
content: [{ type: 'text', text: output }],
|
|
295
|
+
};
|
|
296
|
+
}
|
|
297
|
+
finally {
|
|
298
|
+
service.close();
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
catch (error) {
|
|
302
|
+
console.error('[list_canonical_mods] Error:', error);
|
|
303
|
+
return {
|
|
304
|
+
content: [
|
|
305
|
+
{
|
|
306
|
+
type: 'text',
|
|
307
|
+
text: `Error listing mods: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
308
|
+
},
|
|
309
|
+
],
|
|
310
|
+
isError: true,
|
|
311
|
+
};
|
|
312
|
+
}
|
|
313
|
+
}
|
|
314
|
+
export function handleListModCategories() {
|
|
315
|
+
try {
|
|
316
|
+
if (!ModExamplesService.isAvailable()) {
|
|
317
|
+
return {
|
|
318
|
+
content: [
|
|
319
|
+
{
|
|
320
|
+
type: 'text',
|
|
321
|
+
text: 'Mod examples database is not available.',
|
|
322
|
+
},
|
|
323
|
+
],
|
|
324
|
+
};
|
|
325
|
+
}
|
|
326
|
+
const service = new ModExamplesService();
|
|
327
|
+
try {
|
|
328
|
+
const categories = service.listCategories();
|
|
329
|
+
let output = '# Pattern Categories\n\n';
|
|
330
|
+
output += 'Available categories for filtering mod examples:\n\n';
|
|
331
|
+
output += '| Category | Name | Examples | Description |\n';
|
|
332
|
+
output += '|----------|------|----------|-------------|\n';
|
|
333
|
+
categories.forEach((cat) => {
|
|
334
|
+
output += `| ${cat.icon} \`${cat.slug}\` | ${cat.name} | ${cat.exampleCount} | ${cat.description} |\n`;
|
|
335
|
+
});
|
|
336
|
+
output += '\n**Usage:** `search_mod_examples` with `category` parameter\n';
|
|
337
|
+
return {
|
|
338
|
+
content: [{ type: 'text', text: output }],
|
|
339
|
+
};
|
|
340
|
+
}
|
|
341
|
+
finally {
|
|
342
|
+
service.close();
|
|
343
|
+
}
|
|
344
|
+
}
|
|
345
|
+
catch (error) {
|
|
346
|
+
console.error('[list_mod_categories] Error:', error);
|
|
347
|
+
return {
|
|
348
|
+
content: [
|
|
349
|
+
{
|
|
350
|
+
type: 'text',
|
|
351
|
+
text: `Error listing categories: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
352
|
+
},
|
|
353
|
+
],
|
|
354
|
+
isError: true,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
export function handleGetModPatterns() {
|
|
359
|
+
try {
|
|
360
|
+
if (!ModExamplesService.isAvailable()) {
|
|
361
|
+
return {
|
|
362
|
+
content: [
|
|
363
|
+
{
|
|
364
|
+
type: 'text',
|
|
365
|
+
text: 'Mod examples database is not available.',
|
|
366
|
+
},
|
|
367
|
+
],
|
|
368
|
+
};
|
|
369
|
+
}
|
|
370
|
+
const service = new ModExamplesService();
|
|
371
|
+
try {
|
|
372
|
+
const patterns = service.getPatternTypes();
|
|
373
|
+
let output = '# Pattern Types\n\n';
|
|
374
|
+
output += 'Specific implementation patterns found in indexed mods:\n\n';
|
|
375
|
+
output += '| Pattern Type | Example Count |\n';
|
|
376
|
+
output += '|--------------|---------------|\n';
|
|
377
|
+
patterns.forEach((p) => {
|
|
378
|
+
output += `| \`${p.type}\` | ${p.count} |\n`;
|
|
379
|
+
});
|
|
380
|
+
output += '\n**Usage:** `search_mod_examples` with `pattern_type` parameter\n';
|
|
381
|
+
return {
|
|
382
|
+
content: [{ type: 'text', text: output }],
|
|
383
|
+
};
|
|
384
|
+
}
|
|
385
|
+
finally {
|
|
386
|
+
service.close();
|
|
387
|
+
}
|
|
388
|
+
}
|
|
389
|
+
catch (error) {
|
|
390
|
+
console.error('[get_mod_patterns] Error:', error);
|
|
391
|
+
return {
|
|
392
|
+
content: [
|
|
393
|
+
{
|
|
394
|
+
type: 'text',
|
|
395
|
+
text: `Error getting patterns: ${error instanceof Error ? error.message : 'Unknown error'}`,
|
|
396
|
+
},
|
|
397
|
+
],
|
|
398
|
+
isError: true,
|
|
399
|
+
};
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
//# sourceMappingURL=modExamples.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"modExamples.js","sourceRoot":"","sources":["../../src/tools/modExamples.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAE,MAAM,qCAAqC,CAAC;AAOzE,MAAM,CAAC,MAAM,kBAAkB,GAAG;IAChC;QACE,IAAI,EAAE,qBAAqB;QAC3B,WAAW,EACT,oQAAoQ;QACtQ,WAAW,EAAE;YACX,IAAI,EAAE,QAAiB;YACvB,UAAU,EAAE;gBACV,KAAK,EAAE;oBACL,IAAI,EAAE,QAAQ;oB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,2BAA2B,EAAE,KAAK,CAAC,CAAC;QAClD,OAAO;YACL,OAAO,EAAE;gBACP;oBACE,IAAI,EAAE,MAAM;oBACZ,IAAI,EAAE,2BAA2B,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,EAAE;iBAC5F;aACF;YACD,OAAO,EAAE,IAAI;SACd,CAAC;IACJ,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mcmodding-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.2",
|
|
4
4
|
"description": "MCP server providing AI assistants with up-to-date Minecraft modding documentation for Fabric and NeoForge",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"build": "tsc",
|
|
16
|
-
"build:prod": "npm run
|
|
16
|
+
"build:prod": "npm run build",
|
|
17
17
|
"dev": "tsx watch src/index.ts",
|
|
18
18
|
"start": "node dist/index.js",
|
|
19
19
|
"test": "vitest",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"clean": "rimraf dist",
|
|
32
32
|
"clean:all": "rimraf dist data",
|
|
33
33
|
"prebuild": "npm run clean",
|
|
34
|
-
"prebuild:prod": "npm run clean
|
|
34
|
+
"prebuild:prod": "npm run clean",
|
|
35
35
|
"postinstall": "node scripts/postinstall.js",
|
|
36
36
|
"prepublishOnly": "",
|
|
37
37
|
"release:auto": "semantic-release",
|
|
@@ -68,6 +68,7 @@
|
|
|
68
68
|
"@commitlint/config-conventional": "^19.6.0",
|
|
69
69
|
"@eslint/js": "^9.15.0",
|
|
70
70
|
"@semantic-release/changelog": "^6.0.3",
|
|
71
|
+
"@semantic-release/exec": "^7.1.0",
|
|
71
72
|
"@semantic-release/git": "^10.0.1",
|
|
72
73
|
"@types/better-sqlite3": "^7.6.12",
|
|
73
74
|
"@types/jquery": "^3.5.33",
|
|
@@ -76,6 +77,7 @@
|
|
|
76
77
|
"@typescript-eslint/parser": "^8.15.0",
|
|
77
78
|
"@vitest/coverage-v8": "^4.0.15",
|
|
78
79
|
"@vitest/ui": "^4.0.15",
|
|
80
|
+
"conventional-changelog-conventionalcommits": "^9.1.0",
|
|
79
81
|
"eslint": "^9.15.0",
|
|
80
82
|
"eslint-config-prettier": "^9.1.0",
|
|
81
83
|
"eslint-plugin-prettier": "^5.2.1",
|
|
@@ -83,7 +85,7 @@
|
|
|
83
85
|
"lint-staged": "^15.2.11",
|
|
84
86
|
"prettier": "^3.3.3",
|
|
85
87
|
"rimraf": "^6.0.1",
|
|
86
|
-
"semantic-release": "^
|
|
88
|
+
"semantic-release": "^24.2.3",
|
|
87
89
|
"tsx": "^4.19.2",
|
|
88
90
|
"typescript": "^5.7.2",
|
|
89
91
|
"typescript-eslint": "^8.15.0",
|
package/scripts/postinstall.js
CHANGED
|
@@ -23,7 +23,7 @@ const CONFIG = {
|
|
|
23
23
|
repoUrl: 'https://api.github.com/repos/OGMatrix/mcmodding-mcp/releases/latest',
|
|
24
24
|
dataDir: path.join(__dirname, '..', 'data'),
|
|
25
25
|
dbFileName: 'mcmodding-docs.db',
|
|
26
|
-
manifestFileName: 'manifest.json',
|
|
26
|
+
manifestFileName: 'db-manifest.json',
|
|
27
27
|
userAgent: 'mcmodding-mcp-installer',
|
|
28
28
|
};
|
|
29
29
|
|
|
@@ -260,8 +260,9 @@ function printSectionFooter() {
|
|
|
260
260
|
}
|
|
261
261
|
|
|
262
262
|
function createProgressBar(progress, width = 40, showGradient = true) {
|
|
263
|
-
const
|
|
264
|
-
const
|
|
263
|
+
const clampedProgress = Math.min(Math.max(progress, 0), 1);
|
|
264
|
+
const filled = Math.round(clampedProgress * width);
|
|
265
|
+
const empty = Math.max(0, width - filled);
|
|
265
266
|
|
|
266
267
|
let bar = '';
|
|
267
268
|
if (showGradient && isColorSupported) {
|
|
@@ -577,6 +578,8 @@ async function downloadWithProgress(url, destPath, onProgress) {
|
|
|
577
578
|
return new Promise((resolve, reject) => {
|
|
578
579
|
const file = fs.createWriteStream(destPath);
|
|
579
580
|
|
|
581
|
+
console.log(` ${c.dim}${sym.arrow} Downloading from: ${url}${c.reset}`);
|
|
582
|
+
|
|
580
583
|
const makeRequest = (requestUrl) => {
|
|
581
584
|
const urlObj = new URL(requestUrl);
|
|
582
585
|
const options = {
|
|
@@ -772,6 +775,7 @@ async function main() {
|
|
|
772
775
|
});
|
|
773
776
|
progress.finish(true, 'Download complete!');
|
|
774
777
|
} catch (error) {
|
|
778
|
+
console.error(error);
|
|
775
779
|
progress.finish(false, `Download failed: ${error.message}`);
|
|
776
780
|
if (fs.existsSync(tempPath)) fs.unlinkSync(tempPath);
|
|
777
781
|
console.log();
|