@juspay/neurolink 9.55.5 → 9.55.7

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.
@@ -5,7 +5,7 @@ export { renderColumnSlide, renderTwoColumnSlide, renderThreeColumnSlide, render
5
5
  export { inferFromTitle, inferBulletStyleFromContent, getBulletStyleForSlideType, normalizeSlideWithInference, applyBulletStyleToContent, SLIDE_TYPE_GUIDANCE, getSlideTypeGuidanceForAI, } from "./slideTypeInference.js";
6
6
  export { THEMES, getTheme, SLIDE_TYPE_TO_LAYOUT, SLIDE_TYPE_CATEGORIES, getLayoutForType, DIAGRAM_SLIDE_TYPES, IMAGE_SLIDE_TYPES, isDiagramSlideType, isImageSlideType, AUDIENCE_GUIDELINES, TONE_GUIDELINES, CONTENT_PLANNING_SYSTEM_PROMPT, buildContentPlanningPrompt, enhanceImagePrompt, MIN_PAGES, MAX_PAGES, MIN_TOPIC_LENGTH, MAX_TOPIC_LENGTH, VALID_THEMES, VALID_AUDIENCES, VALID_TONES, VALID_ASPECT_RATIOS, CONTENT_PLANNING_TIMEOUT_MS, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_GENERATIONS, PPT_GENERATION_TIMEOUT_MS, } from "./constants.js";
7
7
  export { generateContentPlan, ensureTitleSlide, ensureThankYouSlide, postProcessPlan, } from "./contentPlanner.js";
8
- export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, PptxGenJS, } from "./slideGenerator.js";
8
+ export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, loadPptxGenJS, } from "./slideGenerator.js";
9
9
  export { generatePresentation } from "./presentationOrchestrator.js";
10
10
  export { validatePPTGenerationInput, validatePPTOutputOptions, validatePPTProvider, } from "../../utils/parameterValidation.js";
11
11
  export { PPT_VALID_PROVIDERS, getEffectivePPTProvider, generateOutputPath, ensureOutputDirectory, normalizeLogoConfig, getLayoutName, getFailureStage, toError, isObject, isLogoConfig, validateImageBuffer, } from "./utils.js";
@@ -21,7 +21,7 @@ CONTENT_PLANNING_TIMEOUT_MS, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_G
21
21
  // Content Planner
22
22
  export { generateContentPlan, ensureTitleSlide, ensureThankYouSlide, postProcessPlan, } from "./contentPlanner.js";
23
23
  // Slide Generator
24
- export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, PptxGenJS, } from "./slideGenerator.js";
24
+ export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, loadPptxGenJS, } from "./slideGenerator.js";
25
25
  // Presentation Orchestrator (Stage 4)
26
26
  export { generatePresentation } from "./presentationOrchestrator.js";
27
27
  // Validation (re-export from parameterValidation for convenience)
@@ -11,13 +11,7 @@
11
11
  *
12
12
  * @module presentation/presentationOrchestrator
13
13
  */
14
- // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export under tsx/esbuild
15
- import PptxGenJSImport from "pptxgenjs";
16
- const PptxGenJSResolved = typeof PptxGenJSImport === "function"
17
- ? PptxGenJSImport
18
- : PptxGenJSImport
19
- .default;
20
- const PptxGenJS = PptxGenJSResolved;
14
+ import { loadPptxGenJS } from "./slideGenerator.js";
21
15
  import * as fs from "fs/promises";
22
16
  import { PPTError, PPT_ERROR_CODES } from "./pptError.js";
23
17
  import { generateContentPlan, postProcessPlan } from "./contentPlanner.js";
@@ -134,6 +128,7 @@ export async function generatePresentation(options) {
134
128
  logger.info("[PresentationOrchestrator] Step 3: Assembling PPTX...");
135
129
  // Create presentation instance
136
130
  // Use pptxgenjs directly - the SlideGenerator.renderSlide handles type conversion internally
131
+ const PptxGenJS = await loadPptxGenJS();
137
132
  const pptxInstance = new PptxGenJS();
138
133
  // Set presentation metadata using pptxgenjs API directly
139
134
  pptxInstance.title = state.contentPlan.title;
@@ -12,9 +12,8 @@
12
12
  *
13
13
  * @module presentation/slideGenerator
14
14
  */
15
- import PptxGenJSImport from "pptxgenjs";
16
- declare const PptxGenJS: typeof PptxGenJSImport;
17
15
  import type { SlideSchema, CompleteSlide, PptxPresentation, PptxSlide, SlideGeneratorConfig, SlideGenerationBatchResult } from "../../types/index.js";
16
+ export declare function loadPptxGenJS(): Promise<new () => PptxPresentation>;
18
17
  /**
19
18
  * Generates individual slides with content, images, and proper layouts
20
19
  */
@@ -53,6 +52,5 @@ export declare class SlideGenerator {
53
52
  private addLogo;
54
53
  private addSlideNumber;
55
54
  }
56
- export { PptxGenJS };
57
55
  export declare function createSlideGenerator(config: SlideGeneratorConfig): SlideGenerator;
58
56
  export declare function generateSlidesFromPlan(schemas: SlideSchema[], config: SlideGeneratorConfig): Promise<SlideGenerationBatchResult>;
@@ -12,16 +12,33 @@
12
12
  *
13
13
  * @module presentation/slideGenerator
14
14
  */
15
- import PptxGenJSImport from "pptxgenjs";
16
- // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export under tsx/esbuild
17
- const PptxGenJS = typeof PptxGenJSImport === "function"
18
- ? PptxGenJSImport
19
- : PptxGenJSImport
20
- .default;
21
15
  import pLimit from "p-limit";
22
16
  import * as fs from "fs";
23
17
  import { SLIDE_DIMENSIONS } from "../../types/index.js";
24
18
  import { getTheme, isImageSlideType, enhanceImagePrompt, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_GENERATIONS, } from "./constants.js";
19
+ let _pptxGenJS = null;
20
+ export async function loadPptxGenJS() {
21
+ if (_pptxGenJS) {
22
+ return _pptxGenJS;
23
+ }
24
+ try {
25
+ const mod = await import(/* @vite-ignore */ "pptxgenjs");
26
+ // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export
27
+ const Ctor = typeof mod.default === "function"
28
+ ? mod.default
29
+ : mod.default
30
+ .default;
31
+ _pptxGenJS = Ctor;
32
+ return _pptxGenJS;
33
+ }
34
+ catch (err) {
35
+ const e = err instanceof Error ? err : null;
36
+ if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("pptxgenjs")) {
37
+ throw new Error('PPT generation requires the "pptxgenjs" package. Install it with:\n pnpm add pptxgenjs', { cause: err });
38
+ }
39
+ throw err;
40
+ }
41
+ }
25
42
  import { logger } from "../../utils/logger.js";
26
43
  import { withTimeout, ErrorFactory, NeuroLinkError, } from "../../utils/errorHandling.js";
27
44
  import { SpanSerializer, SpanType, SpanStatus, getMetricsAggregator, } from "../../observability/index.js";
@@ -521,7 +538,6 @@ export class SlideGenerator {
521
538
  // ============================================================================
522
539
  // FACTORY FUNCTIONS
523
540
  // ============================================================================
524
- export { PptxGenJS };
525
541
  export function createSlideGenerator(config) {
526
542
  return new SlideGenerator(config);
527
543
  }
@@ -5,7 +5,7 @@ export { renderColumnSlide, renderTwoColumnSlide, renderThreeColumnSlide, render
5
5
  export { inferFromTitle, inferBulletStyleFromContent, getBulletStyleForSlideType, normalizeSlideWithInference, applyBulletStyleToContent, SLIDE_TYPE_GUIDANCE, getSlideTypeGuidanceForAI, } from "./slideTypeInference.js";
6
6
  export { THEMES, getTheme, SLIDE_TYPE_TO_LAYOUT, SLIDE_TYPE_CATEGORIES, getLayoutForType, DIAGRAM_SLIDE_TYPES, IMAGE_SLIDE_TYPES, isDiagramSlideType, isImageSlideType, AUDIENCE_GUIDELINES, TONE_GUIDELINES, CONTENT_PLANNING_SYSTEM_PROMPT, buildContentPlanningPrompt, enhanceImagePrompt, MIN_PAGES, MAX_PAGES, MIN_TOPIC_LENGTH, MAX_TOPIC_LENGTH, VALID_THEMES, VALID_AUDIENCES, VALID_TONES, VALID_ASPECT_RATIOS, CONTENT_PLANNING_TIMEOUT_MS, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_GENERATIONS, PPT_GENERATION_TIMEOUT_MS, } from "./constants.js";
7
7
  export { generateContentPlan, ensureTitleSlide, ensureThankYouSlide, postProcessPlan, } from "./contentPlanner.js";
8
- export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, PptxGenJS, } from "./slideGenerator.js";
8
+ export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, loadPptxGenJS, } from "./slideGenerator.js";
9
9
  export { generatePresentation } from "./presentationOrchestrator.js";
10
10
  export { validatePPTGenerationInput, validatePPTOutputOptions, validatePPTProvider, } from "../../utils/parameterValidation.js";
11
11
  export { PPT_VALID_PROVIDERS, getEffectivePPTProvider, generateOutputPath, ensureOutputDirectory, normalizeLogoConfig, getLayoutName, getFailureStage, toError, isObject, isLogoConfig, validateImageBuffer, } from "./utils.js";
@@ -21,7 +21,7 @@ CONTENT_PLANNING_TIMEOUT_MS, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_G
21
21
  // Content Planner
22
22
  export { generateContentPlan, ensureTitleSlide, ensureThankYouSlide, postProcessPlan, } from "./contentPlanner.js";
23
23
  // Slide Generator
24
- export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, PptxGenJS, } from "./slideGenerator.js";
24
+ export { SlideGenerator, createSlideGenerator, generateSlidesFromPlan, loadPptxGenJS, } from "./slideGenerator.js";
25
25
  // Presentation Orchestrator (Stage 4)
26
26
  export { generatePresentation } from "./presentationOrchestrator.js";
27
27
  // Validation (re-export from parameterValidation for convenience)
@@ -11,13 +11,7 @@
11
11
  *
12
12
  * @module presentation/presentationOrchestrator
13
13
  */
14
- // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export under tsx/esbuild
15
- import PptxGenJSImport from "pptxgenjs";
16
- const PptxGenJSResolved = typeof PptxGenJSImport === "function"
17
- ? PptxGenJSImport
18
- : PptxGenJSImport
19
- .default;
20
- const PptxGenJS = PptxGenJSResolved;
14
+ import { loadPptxGenJS } from "./slideGenerator.js";
21
15
  import * as fs from "fs/promises";
22
16
  import { PPTError, PPT_ERROR_CODES } from "./pptError.js";
23
17
  import { generateContentPlan, postProcessPlan } from "./contentPlanner.js";
@@ -134,6 +128,7 @@ export async function generatePresentation(options) {
134
128
  logger.info("[PresentationOrchestrator] Step 3: Assembling PPTX...");
135
129
  // Create presentation instance
136
130
  // Use pptxgenjs directly - the SlideGenerator.renderSlide handles type conversion internally
131
+ const PptxGenJS = await loadPptxGenJS();
137
132
  const pptxInstance = new PptxGenJS();
138
133
  // Set presentation metadata using pptxgenjs API directly
139
134
  pptxInstance.title = state.contentPlan.title;
@@ -12,9 +12,8 @@
12
12
  *
13
13
  * @module presentation/slideGenerator
14
14
  */
15
- import PptxGenJSImport from "pptxgenjs";
16
- declare const PptxGenJS: typeof PptxGenJSImport;
17
15
  import type { SlideSchema, CompleteSlide, PptxPresentation, PptxSlide, SlideGeneratorConfig, SlideGenerationBatchResult } from "../../types/index.js";
16
+ export declare function loadPptxGenJS(): Promise<new () => PptxPresentation>;
18
17
  /**
19
18
  * Generates individual slides with content, images, and proper layouts
20
19
  */
@@ -53,6 +52,5 @@ export declare class SlideGenerator {
53
52
  private addLogo;
54
53
  private addSlideNumber;
55
54
  }
56
- export { PptxGenJS };
57
55
  export declare function createSlideGenerator(config: SlideGeneratorConfig): SlideGenerator;
58
56
  export declare function generateSlidesFromPlan(schemas: SlideSchema[], config: SlideGeneratorConfig): Promise<SlideGenerationBatchResult>;
@@ -12,16 +12,33 @@
12
12
  *
13
13
  * @module presentation/slideGenerator
14
14
  */
15
- import PptxGenJSImport from "pptxgenjs";
16
- // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export under tsx/esbuild
17
- const PptxGenJS = typeof PptxGenJSImport === "function"
18
- ? PptxGenJSImport
19
- : PptxGenJSImport
20
- .default;
21
15
  import pLimit from "p-limit";
22
16
  import * as fs from "fs";
23
17
  import { SLIDE_DIMENSIONS } from "../../types/index.js";
24
18
  import { getTheme, isImageSlideType, enhanceImagePrompt, IMAGE_GENERATION_TIMEOUT_MS, MAX_CONCURRENT_IMAGE_GENERATIONS, } from "./constants.js";
19
+ let _pptxGenJS = null;
20
+ export async function loadPptxGenJS() {
21
+ if (_pptxGenJS) {
22
+ return _pptxGenJS;
23
+ }
24
+ try {
25
+ const mod = await import(/* @vite-ignore */ "pptxgenjs");
26
+ // ESM/CJS interop: pptxgenjs v4 may double-wrap the default export
27
+ const Ctor = typeof mod.default === "function"
28
+ ? mod.default
29
+ : mod.default
30
+ .default;
31
+ _pptxGenJS = Ctor;
32
+ return _pptxGenJS;
33
+ }
34
+ catch (err) {
35
+ const e = err instanceof Error ? err : null;
36
+ if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("pptxgenjs")) {
37
+ throw new Error('PPT generation requires the "pptxgenjs" package. Install it with:\n pnpm add pptxgenjs', { cause: err });
38
+ }
39
+ throw err;
40
+ }
41
+ }
25
42
  import { logger } from "../../utils/logger.js";
26
43
  import { withTimeout, ErrorFactory, NeuroLinkError, } from "../../utils/errorHandling.js";
27
44
  import { SpanSerializer, SpanType, SpanStatus, getMetricsAggregator, } from "../../observability/index.js";
@@ -522,7 +539,6 @@ export class SlideGenerator {
522
539
  // ============================================================================
523
540
  // FACTORY FUNCTIONS
524
541
  // ============================================================================
525
- export { PptxGenJS };
526
542
  export function createSlideGenerator(config) {
527
543
  return new SlideGenerator(config);
528
544
  }
@@ -31,10 +31,26 @@
31
31
  * }
32
32
  * ```
33
33
  */
34
- import * as mammoth from "mammoth";
35
34
  import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
36
35
  import { SIZE_LIMITS } from "../config/index.js";
37
36
  import { FileErrorCode } from "../errors/index.js";
37
+ let _mammoth = null;
38
+ async function loadMammoth() {
39
+ if (_mammoth) {
40
+ return _mammoth;
41
+ }
42
+ try {
43
+ _mammoth = await import(/* @vite-ignore */ "mammoth");
44
+ return _mammoth;
45
+ }
46
+ catch (err) {
47
+ const e = err instanceof Error ? err : null;
48
+ if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("mammoth")) {
49
+ throw new Error('Word document processing requires the "mammoth" package. Install it with:\n pnpm add mammoth', { cause: err });
50
+ }
51
+ throw err;
52
+ }
53
+ }
38
54
  // Re-export for consumers who import from this module
39
55
  // Import for local use
40
56
  // =============================================================================
@@ -223,6 +239,7 @@ export class WordProcessor extends BaseFileProcessor {
223
239
  let htmlContent = "";
224
240
  const warnings = [];
225
241
  try {
242
+ const mammoth = await loadMammoth();
226
243
  // Extract plain text
227
244
  const textResult = await mammoth.extractRawText({ buffer });
228
245
  textContent = textResult.value;
@@ -31,10 +31,26 @@
31
31
  * }
32
32
  * ```
33
33
  */
34
- import * as mammoth from "mammoth";
35
34
  import { BaseFileProcessor } from "../base/BaseFileProcessor.js";
36
35
  import { SIZE_LIMITS } from "../config/index.js";
37
36
  import { FileErrorCode } from "../errors/index.js";
37
+ let _mammoth = null;
38
+ async function loadMammoth() {
39
+ if (_mammoth) {
40
+ return _mammoth;
41
+ }
42
+ try {
43
+ _mammoth = await import(/* @vite-ignore */ "mammoth");
44
+ return _mammoth;
45
+ }
46
+ catch (err) {
47
+ const e = err instanceof Error ? err : null;
48
+ if (e?.code === "ERR_MODULE_NOT_FOUND" && e.message.includes("mammoth")) {
49
+ throw new Error('Word document processing requires the "mammoth" package. Install it with:\n pnpm add mammoth', { cause: err });
50
+ }
51
+ throw err;
52
+ }
53
+ }
38
54
  // Re-export for consumers who import from this module
39
55
  // Import for local use
40
56
  // =============================================================================
@@ -223,6 +239,7 @@ export class WordProcessor extends BaseFileProcessor {
223
239
  let htmlContent = "";
224
240
  const warnings = [];
225
241
  try {
242
+ const mammoth = await loadMammoth();
226
243
  // Extract plain text
227
244
  const textResult = await mammoth.extractRawText({ buffer });
228
245
  textContent = textResult.value;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "9.55.5",
3
+ "version": "9.55.7",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "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 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
6
6
  "author": {
@@ -236,7 +236,6 @@
236
236
  "inquirer": "^13.3.0",
237
237
  "jose": "^6.1.3",
238
238
  "json-schema-to-zod": "^2.7.0",
239
- "mammoth": "^1.11.0",
240
239
  "mediabunny": "^1.40.1",
241
240
  "music-metadata": "^11.11.2",
242
241
  "nanoid": "^5.1.5",
@@ -244,7 +243,6 @@
244
243
  "open": "^11.0.0",
245
244
  "ora": "^9.3.0",
246
245
  "p-limit": "^7.3.0",
247
- "pptxgenjs": "^4.0.1",
248
246
  "redis": "^5.11.0",
249
247
  "tar-stream": "^3.1.8",
250
248
  "undici": ">=7.22.0",
@@ -273,6 +271,8 @@
273
271
  "@picovoice/cobra-node": "^3.0.2",
274
272
  "bullmq": "^5.52.2",
275
273
  "exceljs": "^4.4.0",
274
+ "mammoth": "^1.11.0",
275
+ "pptxgenjs": "^4.0.1",
276
276
  "pdf-parse": "^2.4.5",
277
277
  "pdf-to-img": "^5.0.0",
278
278
  "@fastify/cors": "^11.2.0",