review.preprocess
Normalizes Re:VIEW manuscript files by preprocessing JavaScript input, adding metadata, and preparing files for validation to prevent common writing errors.
Instructions
JS preprocessor only - normalizes input and adds metadata
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | Yes | ||
| pattern | No | ||
| output | No | ||
| stats | No |
Implementation Reference
- src/commands/hybrid-pipeline.ts:27-44 (handler)Core implementation of the review.preprocess tool. Handles options, logs skip message, and returns a success response with stats (currently skips actual preprocessing).export async function preprocessCommand(options: PreprocessOptions) { const { pattern = "articles/**/*.re", output = ".out", stats = true, cwd } = options; // Skip preprocessing for now since review-macro-shims is not available // In production, this would call the actual preprocessor console.log("[preprocess] Skipping JS preprocessing (using standard Re:VIEW)"); return { success: true, output: "Preprocessing skipped - using standard Re:VIEW", stats: stats ? { filesProcessed: 0, macrosExpanded: 0, warnings: [] } : null }; }
- src/index.ts:314-327 (schema)Tool definition including name, description, and input schema registered in the tools list for ListToolsRequest.{ name: "review.preprocess", description: "JS preprocessor only - normalizes input and adds metadata", inputSchema: { type: "object", properties: { cwd: { type: "string" }, pattern: { type: "string" }, output: { type: "string" }, stats: { type: "boolean" } }, required: ["cwd"] } },
- src/index.ts:543-555 (registration)Switch case in CallToolRequestSchema handler that dispatches to hybridCommands.preprocess and returns the result.case "review.preprocess": { const result = await hybridCommands.preprocess({ cwd: args.cwd as string, pattern: args.pattern as string | undefined, output: args.output as string | undefined, stats: args.stats as boolean | undefined }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; }
- src/commands/hybrid-pipeline.ts:9-14 (schema)TypeScript interface defining the input parameters for the preprocessCommand function.export interface PreprocessOptions { pattern?: string; output?: string; stats?: boolean; cwd: string; }
- src/commands/hybrid-pipeline.ts:208-213 (registration)Exports the preprocessCommand as hybridCommands.preprocess for use in index.ts.export const hybridCommands = { preprocess: preprocessCommand, buildPdfHybrid: buildPdfHybridCommand, checkRubyExtensions: checkRubyExtensionsCommand, testMapfile: testMapfileCommand };