vale-mcp 0.0.0-stage → 0.2.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/build/index.js ADDED
@@ -0,0 +1,539 @@
1
+ #!/usr/bin/env node
2
+ import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
3
+ import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
4
+ import { z } from "zod";
5
+ import { checkValeInstalled, checkFile, checkText, syncValeStyles, checkDirectory, isSupportedValeVersion } from "./vale-runner.js";
6
+ import { loadConfig, verifyConfigFile, resolveConfigPath, findValeIniInWorkingDir, } from "./config.js";
7
+ import * as path from "path";
8
+ import * as fs from "fs";
9
+ import { fileURLToPath } from "url";
10
+ // Get version from package.json
11
+ const __filename = fileURLToPath(import.meta.url);
12
+ const __dirname = path.dirname(__filename);
13
+ const packageJsonPath = path.join(__dirname, "..", "package.json");
14
+ const packageJson = JSON.parse(fs.readFileSync(packageJsonPath, "utf-8"));
15
+ const VERSION = packageJson.version;
16
+ // Parse command line arguments for debug mode
17
+ const args = process.argv.slice(2);
18
+ const DEBUG = args.includes("--debug") || args.includes("--verbose") || args.includes("-v");
19
+ // Show help and exit
20
+ if (args.includes("--help") || args.includes("-h")) {
21
+ console.log(`
22
+ Vale MCP Server v${VERSION}
23
+
24
+ A Model Context Protocol server for Vale prose linting.
25
+
26
+ Usage:
27
+ vale-cli [options]
28
+
29
+ Options:
30
+ --debug, --verbose, -v Enable debug logging
31
+ --help, -h Show this help message
32
+ --version Show version number
33
+
34
+ The server communicates via stdio for MCP protocol.
35
+
36
+ Configuration priority:
37
+ 1. Per-file: Config discovered from file's directory (check_file)
38
+ 2. Server-wide: VALE_CONFIG_PATH environment variable
39
+ 3. Working directory: .vale.ini in process.cwd()
40
+ 4. Vale defaults: Global config or built-in rules
41
+
42
+ Environment variables:
43
+ VALE_CONFIG_PATH Path to specific .vale.ini file (overrides auto-detection)
44
+ VALE_ALLOWED_ROOTS Directories (path-delimiter separated) that check_file and
45
+ config paths are restricted to. Unset means no restriction.
46
+
47
+ Example:
48
+ # Use specific config file
49
+ VALE_CONFIG_PATH=/path/to/.vale.ini vale-cli
50
+
51
+ # Enable debug logging
52
+ vale-cli --debug
53
+
54
+ Documentation: https://vale.sh/docs/
55
+ `);
56
+ process.exit(0);
57
+ }
58
+ // Show version and exit
59
+ if (args.includes("--version")) {
60
+ console.log(VERSION);
61
+ process.exit(0);
62
+ }
63
+ /**
64
+ * Debug logger - only logs if DEBUG is enabled
65
+ */
66
+ function debug(...args) {
67
+ if (DEBUG) {
68
+ console.error("[DEBUG]", new Date().toISOString(), ...args);
69
+ }
70
+ }
71
+ // Server configuration
72
+ const config = loadConfig();
73
+ let valeConfigPath;
74
+ /**
75
+ * Get platform-specific installation instructions for Vale
76
+ */
77
+ function getInstallationInstructions() {
78
+ const platform = process.platform;
79
+ const instructions = {
80
+ platform,
81
+ documentation: "https://vale.sh/docs/vale-cli/installation/",
82
+ methods: [],
83
+ };
84
+ switch (platform) {
85
+ case "darwin":
86
+ instructions.methods = [
87
+ {
88
+ name: "Homebrew (recommended)",
89
+ command: "brew install vale",
90
+ },
91
+ {
92
+ name: "Download binary",
93
+ command: "Download from GitHub releases",
94
+ url: "https://github.com/errata-ai/vale/releases",
95
+ },
96
+ ];
97
+ break;
98
+ case "linux":
99
+ instructions.methods = [
100
+ {
101
+ name: "Snap",
102
+ command: "sudo snap install vale",
103
+ },
104
+ {
105
+ name: "Download binary",
106
+ command: "Download from GitHub releases and add to PATH",
107
+ url: "https://github.com/errata-ai/vale/releases",
108
+ },
109
+ ];
110
+ break;
111
+ case "win32":
112
+ instructions.methods = [
113
+ {
114
+ name: "Chocolatey",
115
+ command: "choco install vale",
116
+ },
117
+ {
118
+ name: "Scoop",
119
+ command: "scoop install vale",
120
+ },
121
+ {
122
+ name: "Download binary",
123
+ command: "Download from GitHub releases",
124
+ url: "https://github.com/errata-ai/vale/releases",
125
+ },
126
+ ];
127
+ break;
128
+ default:
129
+ instructions.methods = [
130
+ {
131
+ name: "Download binary",
132
+ command: "Download from GitHub releases",
133
+ url: "https://github.com/errata-ai/vale/releases",
134
+ },
135
+ ];
136
+ }
137
+ return instructions;
138
+ }
139
+ /**
140
+ * Helper function to generate "Vale not installed" error response
141
+ */
142
+ function createValeNotInstalledResponse() {
143
+ return {
144
+ isError: true,
145
+ content: [
146
+ {
147
+ type: "text",
148
+ text: JSON.stringify({
149
+ error: "Vale is not installed or not found in PATH",
150
+ vale_required: true,
151
+ installation_instructions: getInstallationInstructions(),
152
+ message: "Please install Vale to use this feature. Vale is a command-line tool for prose linting.",
153
+ }, null, 2),
154
+ },
155
+ ],
156
+ };
157
+ }
158
+ /**
159
+ * Check if an error is an E201 missing styles / StylesPath error
160
+ */
161
+ function isStylesDirectoryError(errorMessage) {
162
+ // Vale reports a missing StylesPath or an unsynced style as E201, e.g.
163
+ // "Style 'Foo' isn't on the StylesPath" / "The StylesPath '...' doesn't exist".
164
+ // (E100 "path ... does not exist" is a missing config/input, which sync can't fix.)
165
+ return /E201.*StylesPath/i.test(errorMessage);
166
+ }
167
+ /**
168
+ * Builds the CallToolResult for a caught linting error, with dedicated
169
+ * guidance when it looks like Vale's styles directory hasn't been synced.
170
+ */
171
+ function handleValeLintError(error) {
172
+ const errorMessage = error instanceof Error ? error.message : "Unknown error";
173
+ const errorDetails = error instanceof Error ? error.stack : "No details available";
174
+ if (isStylesDirectoryError(errorMessage)) {
175
+ return {
176
+ isError: true,
177
+ content: [
178
+ {
179
+ type: "text",
180
+ text: `❌ **Vale configuration error**
181
+
182
+ ${errorMessage}
183
+
184
+ This error indicates that Vale's styles directory is missing or the configured packages haven't been downloaded yet.
185
+
186
+ **Solution:**
187
+ Run the \`vale_sync\` tool to download the required style packages:
188
+
189
+ \`\`\`
190
+ vale_sync
191
+ \`\`\`
192
+
193
+ This will:
194
+ 1. Read your .vale.ini configuration
195
+ 2. Download all configured style packages
196
+ 3. Create the necessary styles directory
197
+
198
+ After running \`vale_sync\`, you can try \`check_file\` again.
199
+
200
+ For more information, see: https://vale.sh/docs/topics/packages/`,
201
+ },
202
+ ],
203
+ };
204
+ }
205
+ return {
206
+ isError: true,
207
+ content: [
208
+ {
209
+ type: "text",
210
+ text: JSON.stringify({
211
+ error: errorMessage,
212
+ details: errorDetails,
213
+ }),
214
+ },
215
+ ],
216
+ };
217
+ }
218
+ // Result-filtering inputs shared by all check tools
219
+ const filterInputSchema = {
220
+ min_severity: z
221
+ .enum(["suggestion", "warning", "error"])
222
+ .optional()
223
+ .describe("Only report issues at or above this severity. Defaults to all."),
224
+ max_issues: z
225
+ .number()
226
+ .int()
227
+ .positive()
228
+ .optional()
229
+ .describe("Return at most this many issues (summary still counts all of them). Use to keep results small for large files."),
230
+ };
231
+ function toToolResult(result) {
232
+ return {
233
+ content: [{ type: "text", text: result.formatted }],
234
+ structuredContent: {
235
+ file: result.file,
236
+ issues: result.issues,
237
+ summary: result.summary,
238
+ truncated: result.truncated ?? false,
239
+ },
240
+ };
241
+ }
242
+ // Initialize the MCP server
243
+ const server = new McpServer({
244
+ name: "vale-mcp",
245
+ version: VERSION,
246
+ });
247
+ server.registerTool("vale_status", {
248
+ description: "Check if Vale (vale.sh) is installed and accessible. Use this first if other Vale tools fail. Returns installation status, version if available, and installation instructions for the current platform.",
249
+ annotations: {
250
+ readOnlyHint: true,
251
+ openWorldHint: false,
252
+ },
253
+ }, async () => {
254
+ debug("Checking Vale installation status...");
255
+ const valeCheck = await checkValeInstalled();
256
+ debug(`Vale installed: ${valeCheck.installed}, version: ${valeCheck.version}`);
257
+ return {
258
+ content: [
259
+ {
260
+ type: "text",
261
+ text: JSON.stringify({
262
+ installed: valeCheck.installed,
263
+ version: valeCheck.version,
264
+ platform: process.platform,
265
+ installation_instructions: valeCheck.installed
266
+ ? null
267
+ : getInstallationInstructions(),
268
+ message: valeCheck.installed
269
+ ? `Vale is installed and ready to use (${valeCheck.version})${isSupportedValeVersion(valeCheck.version)
270
+ ? ""
271
+ : ". Warning: this server requires Vale 3.0 or newer, so some features may not work"}`
272
+ : "Vale is not installed. Please install it to use Vale linting tools.",
273
+ }, null, 2),
274
+ },
275
+ ],
276
+ };
277
+ });
278
+ server.registerTool("vale_sync", {
279
+ description: "Download Vale styles and packages by running 'vale sync'. Use this when you see errors about missing styles directories (E201 errors like \"Style 'X' isn't on the StylesPath\"). This command reads the .vale.ini configuration and downloads the required style packages.",
280
+ inputSchema: {
281
+ config_path: z
282
+ .string()
283
+ .optional()
284
+ .describe("Optional path to .vale.ini file. If not provided, uses the server's configured path or searches in the current directory."),
285
+ },
286
+ annotations: {
287
+ readOnlyHint: false,
288
+ destructiveHint: false,
289
+ openWorldHint: true,
290
+ },
291
+ }, async ({ config_path }) => {
292
+ debug(`vale_sync called - config_path: ${config_path}`);
293
+ const valeCheck = await checkValeInstalled();
294
+ if (!valeCheck.installed) {
295
+ return createValeNotInstalledResponse();
296
+ }
297
+ const effectiveConfigPath = config_path || valeConfigPath;
298
+ const syncResult = await syncValeStyles(effectiveConfigPath);
299
+ debug(`vale_sync result - success: ${syncResult.success}`);
300
+ if (syncResult.success) {
301
+ return {
302
+ content: [
303
+ {
304
+ type: "text",
305
+ text: `✅ **Vale sync successful**
306
+
307
+ ${syncResult.message}
308
+
309
+ ${syncResult.output ? `**Output:**\n\`\`\`\n${syncResult.output}\n\`\`\`` : ""}
310
+
311
+ The styles have been downloaded and are ready to use. You can now run \`check_file\` again.`,
312
+ },
313
+ ],
314
+ };
315
+ }
316
+ return {
317
+ isError: true,
318
+ content: [
319
+ {
320
+ type: "text",
321
+ text: `❌ **Vale sync failed**
322
+
323
+ ${syncResult.message}
324
+
325
+ ${syncResult.error ? `**Error:**\n\`\`\`\n${syncResult.error}\n\`\`\`` : ""}
326
+
327
+ Please check your .vale.ini configuration and ensure:
328
+ 1. The StylesPath is correct
329
+ 2. Packages are properly defined
330
+ 3. You have internet connectivity to download packages
331
+
332
+ See Vale documentation: https://vale.sh/docs/topics/packages/`,
333
+ },
334
+ ],
335
+ };
336
+ });
337
+ server.registerTool("check_file", {
338
+ description: "Lint a file at a specific path against Vale style rules. Returns issues found with their locations and severity. If Vale is not installed, returns error with installation guidance.",
339
+ inputSchema: {
340
+ path: z.string().describe("Absolute or relative path to the file to check"),
341
+ config_path: z
342
+ .string()
343
+ .optional()
344
+ .describe("Optional path to .vale.ini file. If not provided, Vale will search for .vale.ini starting from the file's directory and moving upward through parent directories."),
345
+ ...filterInputSchema,
346
+ },
347
+ annotations: {
348
+ readOnlyHint: true,
349
+ openWorldHint: false,
350
+ },
351
+ }, async ({ path: filePath, config_path, min_severity, max_issues }) => {
352
+ debug(`check_file called - path: ${filePath}, config_path: ${config_path}`);
353
+ const valeCheck = await checkValeInstalled();
354
+ if (!valeCheck.installed) {
355
+ return createValeNotInstalledResponse();
356
+ }
357
+ try {
358
+ // Only pass config_path if explicitly provided by the user
359
+ // This allows Vale to use its natural upward search from the file's directory
360
+ const result = await checkFile(filePath, config_path, {
361
+ minSeverity: min_severity,
362
+ maxIssues: max_issues,
363
+ });
364
+ debug(`check_file result - file: ${result.file}, issues found: ${result.issues.length}, errors: ${result.summary.errors}, warnings: ${result.summary.warnings}, suggestions: ${result.summary.suggestions}`);
365
+ return toToolResult(result);
366
+ }
367
+ catch (error) {
368
+ return handleValeLintError(error);
369
+ }
370
+ });
371
+ server.registerTool("check_text", {
372
+ description: "Lint text content directly against Vale style rules without requiring a file. Useful for checking text snippets, clipboard content, or dynamically generated content. Returns issues found with their locations and severity.",
373
+ inputSchema: {
374
+ text: z.string().describe("The text content to check with Vale"),
375
+ text_file_ext: z
376
+ .string()
377
+ .optional()
378
+ .describe("Optional file extension for Vale to apply when checking the text (e.g., '.md', '.txt'). This can help Vale apply file format-specific rules if needed."),
379
+ config_path: z
380
+ .string()
381
+ .optional()
382
+ .describe("Optional path to .vale.ini file. If not provided, uses the server's configured path or searches in the current directory."),
383
+ ...filterInputSchema,
384
+ },
385
+ annotations: {
386
+ readOnlyHint: true,
387
+ openWorldHint: false,
388
+ },
389
+ }, async ({ text, text_file_ext, config_path, min_severity, max_issues }) => {
390
+ debug(`check_text called - text length: ${text?.length}, text_file_ext: ${text_file_ext}, config_path: ${config_path}`);
391
+ const valeCheck = await checkValeInstalled();
392
+ if (!valeCheck.installed) {
393
+ return createValeNotInstalledResponse();
394
+ }
395
+ try {
396
+ // Use the provided config_path if given, otherwise fall back to the
397
+ // server's configured path since there's no file directory to search from
398
+ const effectiveConfigPath = config_path !== undefined ? config_path : valeConfigPath;
399
+ const result = await checkText(text, text_file_ext, effectiveConfigPath, {
400
+ minSeverity: min_severity,
401
+ maxIssues: max_issues,
402
+ });
403
+ debug(`check_text result - issues found: ${result.issues.length}, errors: ${result.summary.errors}, warnings: ${result.summary.warnings}, suggestions: ${result.summary.suggestions}`);
404
+ return toToolResult(result);
405
+ }
406
+ catch (error) {
407
+ return handleValeLintError(error);
408
+ }
409
+ });
410
+ server.registerTool("check_directory", {
411
+ description: "Lint every file Vale supports in a directory (recursively) against Vale style rules. Returns issues with their file and line, plus a combined summary. Use min_severity and max_issues to keep results small.",
412
+ inputSchema: {
413
+ path: z.string().describe("Absolute or relative path to the directory to check"),
414
+ config_path: z
415
+ .string()
416
+ .optional()
417
+ .describe("Optional path to .vale.ini file. If not provided, Vale will search for .vale.ini starting from the directory and moving upward."),
418
+ ...filterInputSchema,
419
+ },
420
+ annotations: {
421
+ readOnlyHint: true,
422
+ openWorldHint: false,
423
+ },
424
+ }, async ({ path: dirPath, config_path, min_severity, max_issues }) => {
425
+ debug(`check_directory called - path: ${dirPath}, config_path: ${config_path}`);
426
+ const valeCheck = await checkValeInstalled();
427
+ if (!valeCheck.installed) {
428
+ return createValeNotInstalledResponse();
429
+ }
430
+ try {
431
+ const result = await checkDirectory(dirPath, config_path, {
432
+ minSeverity: min_severity,
433
+ maxIssues: max_issues,
434
+ });
435
+ debug(`check_directory result - issues found: ${result.summary.total}`);
436
+ return toToolResult(result);
437
+ }
438
+ catch (error) {
439
+ return handleValeLintError(error);
440
+ }
441
+ });
442
+ /**
443
+ * Initialize Vale configuration
444
+ */
445
+ async function initializeValeConfig() {
446
+ // Check if Vale is installed
447
+ const valeCheck = await checkValeInstalled();
448
+ if (!valeCheck.installed) {
449
+ console.error("WARNING: Vale is not installed or not in PATH");
450
+ console.error("The server will start, but linting tools will not work until Vale is installed.");
451
+ console.error("");
452
+ console.error("Installation instructions:");
453
+ const instructions = getInstallationInstructions();
454
+ instructions.methods.forEach((method) => {
455
+ console.error(` ${method.name}: ${method.command}`);
456
+ if (method.url) {
457
+ console.error(` ${method.url}`);
458
+ }
459
+ });
460
+ console.error("");
461
+ console.error(`Documentation: ${instructions.documentation}`);
462
+ console.error("");
463
+ console.error("Use the 'vale_status' tool to check installation status after installing.");
464
+ console.error("");
465
+ // Don't exit - allow server to start
466
+ return;
467
+ }
468
+ console.error(`Vale version: ${valeCheck.version}`);
469
+ // Priority 1: Check for VALE_CONFIG_PATH environment variable
470
+ if (config.configPath) {
471
+ const resolvedPath = resolveConfigPath(config.configPath);
472
+ if (await verifyConfigFile(resolvedPath)) {
473
+ valeConfigPath = resolvedPath;
474
+ console.error(`Using Vale config from VALE_CONFIG_PATH: ${valeConfigPath}`);
475
+ return;
476
+ }
477
+ else {
478
+ console.error(`WARNING: VALE_CONFIG_PATH points to non-existent file: ${config.configPath}`);
479
+ }
480
+ }
481
+ // Priority 2: Check for .vale.ini in the current working directory
482
+ const workingDirConfig = await findValeIniInWorkingDir();
483
+ if (workingDirConfig) {
484
+ // Use .vale.ini from working directory
485
+ valeConfigPath = workingDirConfig;
486
+ console.error(`Using .vale.ini from working directory: ${valeConfigPath}`);
487
+ }
488
+ else {
489
+ // No .vale.ini found - warn but continue
490
+ console.error("WARNING: No .vale.ini file found in the current working directory");
491
+ console.error(`Current working directory: ${process.cwd()}`);
492
+ console.error("");
493
+ console.error("Vale will use default settings or search parent directories.");
494
+ console.error("For best results, create a .vale.ini file in your project directory.");
495
+ console.error("");
496
+ console.error("Example .vale.ini:");
497
+ console.error(" StylesPath = styles");
498
+ console.error(" Packages = write-good, proselint");
499
+ console.error("");
500
+ console.error(" [*]");
501
+ console.error(" BasedOnStyles = write-good, proselint");
502
+ console.error("");
503
+ }
504
+ }
505
+ /**
506
+ * Main entry point
507
+ */
508
+ async function main() {
509
+ try {
510
+ // Show version and startup info
511
+ const title = `Vale MCP Server v${VERSION}`;
512
+ const boxWidth = Math.max(title.length + 4, 43); // At least 43 chars wide
513
+ const padding = ' '.repeat(Math.floor((boxWidth - title.length - 2) / 2));
514
+ const titleLine = `║${padding}${title}${padding}${title.length % 2 === 0 ? ' ' : ''}║`;
515
+ const border = '═'.repeat(boxWidth - 2);
516
+ console.error(`\n╔${border}╗`);
517
+ console.error(titleLine);
518
+ console.error(`╚${border}╝\n`);
519
+ if (DEBUG) {
520
+ console.error("🐛 Debug mode enabled\n");
521
+ }
522
+ // Initialize Vale configuration
523
+ await initializeValeConfig();
524
+ // Start the server
525
+ const transport = new StdioServerTransport();
526
+ await server.connect(transport);
527
+ console.error(`✓ Vale MCP Server v${VERSION} running on stdio`);
528
+ if (DEBUG) {
529
+ console.error("✓ Debug logging active - tool calls will be logged");
530
+ }
531
+ console.error("");
532
+ }
533
+ catch (error) {
534
+ console.error("Failed to start server:", error);
535
+ process.exit(1);
536
+ }
537
+ }
538
+ main();
539
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,SAAS,EAAE,MAAM,yCAAyC,CAAC;AACpE,OAAO,EAAE,oBAAoB,EAAE,MAAM,2CAA2C,CAAC;AAGjF,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,SAAS,EAAE,cAAc,EAAE,cAAc,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AACpI,OAAO,EACL,UAAU,EACV,gBA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AI,OAAO,GAAG,KAAK,GAAG,OAAO,GAAG,KAAK,CAAC,MAAM,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC;QACvF,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,QAAQ,GAAG,CAAC,CAAC,CAAC;QAExC,OAAO,CAAC,KAAK,CAAC,MAAM,MAAM,GAAG,CAAC,CAAC;QAC/B,OAAO,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;QACzB,OAAO,CAAC,KAAK,CAAC,IAAI,MAAM,KAAK,CAAC,CAAC;QAE/B,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,yBAAyB,CAAC,CAAC;QAC3C,CAAC;QAED,gCAAgC;QAChC,MAAM,oBAAoB,EAAE,CAAC;QAE7B,mBAAmB;QACnB,MAAM,SAAS,GAAG,IAAI,oBAAoB,EAAE,CAAC;QAC7C,MAAM,MAAM,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;QAEhC,OAAO,CAAC,KAAK,CAAC,sBAAsB,OAAO,mBAAmB,CAAC,CAAC;QAChE,IAAI,KAAK,EAAE,CAAC;YACV,OAAO,CAAC,KAAK,CAAC,oDAAoD,CAAC,CAAC;QACtE,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IACpB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,CAAC,KAAK,CAAC,yBAAyB,EAAE,KAAK,CAAC,CAAC;QAChD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
@@ -0,0 +1,88 @@
1
+ /**
2
+ * Vale issue severity levels
3
+ */
4
+ export type ValeSeverity = "error" | "warning" | "suggestion";
5
+ /**
6
+ * A single Vale linting issue
7
+ */
8
+ export interface ValeIssue {
9
+ Line: number;
10
+ Span: [number, number];
11
+ Check: string;
12
+ Message: string;
13
+ Severity: ValeSeverity;
14
+ Link?: string;
15
+ Match?: string;
16
+ Action?: {
17
+ Name: string;
18
+ Params: string[];
19
+ };
20
+ }
21
+ /**
22
+ * Vale's raw JSON output structure (uses file paths as keys)
23
+ */
24
+ export interface ValeRawOutput {
25
+ [filePath: string]: ValeIssue[];
26
+ }
27
+ /**
28
+ * Normalized Vale issue for MCP output
29
+ */
30
+ export interface NormalizedValeIssue {
31
+ line: number;
32
+ span: [number, number];
33
+ check: string;
34
+ message: string;
35
+ severity: ValeSeverity;
36
+ link?: string;
37
+ match?: string;
38
+ /** Vale's suggested fix, when the rule has one (e.g. name "replace", params are the candidates) */
39
+ action?: {
40
+ name: string;
41
+ params: string[];
42
+ };
43
+ /** Source file, set for directory checks */
44
+ file?: string;
45
+ }
46
+ /**
47
+ * Summary statistics for Vale results
48
+ */
49
+ export interface ValeSummary {
50
+ total: number;
51
+ errors: number;
52
+ warnings: number;
53
+ suggestions: number;
54
+ }
55
+ /**
56
+ * Optional result filtering shared by the check tools
57
+ */
58
+ export interface CheckOptions {
59
+ /** Drop issues below this severity */
60
+ minSeverity?: ValeSeverity;
61
+ /** Return at most this many issues (summary still counts all filtered issues) */
62
+ maxIssues?: number;
63
+ }
64
+ /**
65
+ * Result structure for check_file tool
66
+ */
67
+ export interface CheckFileResult {
68
+ formatted: string;
69
+ file: string;
70
+ issues: NormalizedValeIssue[];
71
+ summary: ValeSummary;
72
+ /** True when maxIssues cut off issues; summary.total is the untruncated count */
73
+ truncated?: boolean;
74
+ }
75
+ /**
76
+ * Server configuration options
77
+ */
78
+ export interface ValeServerConfig {
79
+ configPath?: string;
80
+ }
81
+ /**
82
+ * Error result structure
83
+ */
84
+ export interface ValeError {
85
+ error: string;
86
+ details?: string;
87
+ }
88
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH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E,YAAY,CAAC;IAC3B,iFAAiF;IACjF,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,mBAAmB,EAAE,CAAC;IAC9B,OAAO,EAAE,WAAW,CAAC;IACrB,iFAAiF;IACjF,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB"}
package/build/types.js ADDED
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":""}