@juspay/neurolink 8.6.0 → 8.7.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.
@@ -1,6 +1,6 @@
1
1
  import { logger } from "./logger.js";
2
- import * as pdfjs from "pdfjs-dist/legacy/build/pdf.mjs";
3
- import { createCanvas } from "canvas";
2
+ // Lazy-load pdfjs-dist to avoid DOMMatrix errors in Node.js server environment
3
+ // import * as pdfjs from "pdfjs-dist/legacy/build/pdf.mjs";
4
4
  const PDF_PROVIDER_CONFIGS = {
5
5
  anthropic: {
6
6
  maxSizeMB: 5,
@@ -196,6 +196,28 @@ export class PDFProcessor {
196
196
  }
197
197
  }
198
198
  static async convertPDFToImages(pdfBuffer, options) {
199
+ // Dynamic import canvas - only load when actually needed
200
+ let createCanvas;
201
+ try {
202
+ const canvasModule = await import("canvas");
203
+ createCanvas = canvasModule.createCanvas;
204
+ }
205
+ catch {
206
+ throw new Error("Canvas dependency not available. " +
207
+ "PDF-to-image conversion requires the 'canvas' package with native bindings. " +
208
+ "Install with: pnpm install canvas\n" +
209
+ "Note: This requires native build tools (Python, C++ compiler).");
210
+ }
211
+ // Dynamic import pdfjs - only load when actually needed to avoid DOMMatrix errors
212
+ let pdfjs;
213
+ try {
214
+ pdfjs = await import("pdfjs-dist/legacy/build/pdf.mjs");
215
+ }
216
+ catch {
217
+ throw new Error("pdfjs-dist dependency not available. " +
218
+ "PDF processing requires the 'pdfjs-dist' package. " +
219
+ "Install with: pnpm install pdfjs-dist");
220
+ }
199
221
  const maxPages = options?.maxPages || 10;
200
222
  const scale = options?.scale || 2.0;
201
223
  const format = options?.format || "png";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "8.6.0",
3
+ "version": "8.7.0",
4
4
  "description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 9 major providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
5
5
  "author": {
6
6
  "name": "Juspay Technologies",
@@ -179,7 +179,6 @@
179
179
  "@opentelemetry/sdk-trace-node": "^2.1.0",
180
180
  "@opentelemetry/semantic-conventions": "^1.30.1",
181
181
  "ai": "4.3.16",
182
- "canvas": "^3.2.0",
183
182
  "chalk": "^5.6.2",
184
183
  "csv-parser": "^3.2.0",
185
184
  "dotenv": "^16.6.1",
@@ -201,6 +200,9 @@
201
200
  "zod": "^3.22.0",
202
201
  "zod-to-json-schema": "^3.24.6"
203
202
  },
203
+ "optionalDependencies": {
204
+ "canvas": "^3.2.0"
205
+ },
204
206
  "devDependencies": {
205
207
  "@biomejs/biome": "^2.2.4",
206
208
  "@changesets/changelog-github": "^0.5.1",
@@ -210,7 +212,7 @@
210
212
  "@semantic-release/commit-analyzer": "^13.0.1",
211
213
  "@semantic-release/git": "^10.0.1",
212
214
  "@semantic-release/github": "^11.0.6",
213
- "@semantic-release/npm": "^12.0.2",
215
+ "@semantic-release/npm": "^13.1.2",
214
216
  "@semantic-release/release-notes-generator": "^14.1.0",
215
217
  "@smithy/types": "^4.5.0",
216
218
  "@sveltejs/adapter-auto": "^6.1.0",
@@ -297,7 +299,8 @@
297
299
  "@eslint/plugin-kit@<0.3.4": ">=0.3.4",
298
300
  "tmp@<=0.2.3": ">=0.2.4",
299
301
  "axios@<1.8.2": ">=1.8.2",
300
- "glob@>=10.3.7 <=11.0.3": ">=11.1.0"
302
+ "glob@>=10.3.7 <=11.0.3": ">=11.1.0",
303
+ "@semantic-release/npm": "^13.1.2"
301
304
  }
302
305
  },
303
306
  "os": [