review.build-pdf-hybrid
Generate PDF documents from Re:VIEW manuscripts using a JS to Ruby hybrid pipeline, with automatic validation and error correction to prevent common writing issues.
Instructions
JS→Ruby hybrid pipeline for PDF generation (PDF first priority)
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| config | No | ||
| cwd | Yes | ||
| skipPreprocess | No |
Implementation Reference
- src/commands/hybrid-pipeline.ts:46-101 (handler)Core handler function implementing the hybrid PDF build: optional JS preprocess followed by review-pdfmaker Ruby command.export async function buildPdfHybridCommand(options: BuildPdfOptions) { const { config = "config.yml", skipPreprocess = false, cwd } = options; const results: any[] = []; if (!skipPreprocess) { console.log("[build-pdf-hybrid] Running preprocessor..."); const preprocessResult = await preprocessCommand({ cwd }); results.push({ step: "preprocess", result: preprocessResult }); if (!preprocessResult.success) { return { success: false, error: "Preprocessing failed", results }; } } console.log("[build-pdf-hybrid] Building PDF with review-pdfmaker..."); try { const pdfResult = await runCommand("review-pdfmaker", ["-c", config], { cwd, useBundle: true }); results.push({ step: "pdf-build", result: { success: true, output: pdfResult.stdout }}); const pdfFiles = await findGeneratedPdf(cwd); return { success: true, results, artifacts: pdfFiles }; } catch (error: any) { results.push({ step: "pdf-build", result: { success: false, error: error.message, stderr: error.stderr }}); return { success: false, error: "PDF build failed", results }; } }
- src/index.ts:332-340 (schema)JSON schema defining input parameters: cwd (required), config (optional), skipPreprocess (optional).inputSchema: { type: "object", properties: { cwd: { type: "string" }, config: { type: "string" }, skipPreprocess: { type: "boolean" } }, required: ["cwd"] }
- src/index.ts:329-341 (registration)Tool registration in the MCP tools list, including name, description, and input schema.{ name: "review.build-pdf-hybrid", description: "JS→Ruby hybrid pipeline for PDF generation (PDF first priority)", inputSchema: { type: "object", properties: { cwd: { type: "string" }, config: { type: "string" }, skipPreprocess: { type: "boolean" } }, required: ["cwd"] } },
- src/index.ts:557-568 (registration)Handler dispatch in the main CallTool switch statement, delegating to hybridCommands.buildPdfHybrid.case "review.build-pdf-hybrid": { const result = await hybridCommands.buildPdfHybrid({ cwd: args.cwd as string, config: args.config as string | undefined, skipPreprocess: args.skipPreprocess as boolean | undefined }); return { content: [ { type: "text", text: JSON.stringify(result) } ] }; }
- TypeScript interface matching the tool's input schema for type safety.export interface BuildPdfOptions { config?: string; skipPreprocess?: boolean; cwd: string; }