@juspay/neurolink 9.55.6 → 9.55.8

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
  }
@@ -1,4 +1,6 @@
1
- import { BedrockClient, ListFoundationModelsCommand, } from "@aws-sdk/client-bedrock";
1
+ async function loadBedrockControl() {
2
+ return await import(/* @vite-ignore */ "@aws-sdk/client-bedrock");
3
+ }
2
4
  import { BedrockRuntimeClient, ConverseCommand, ConverseStreamCommand, ImageFormat, } from "@aws-sdk/client-bedrock-runtime";
3
5
  import path from "path";
4
6
  import { createAnalytics } from "../core/analytics.js";
@@ -62,6 +64,7 @@ export class AmazonBedrockProvider extends BaseProvider {
62
64
  * This prevents the health check failure we saw in production logs
63
65
  */
64
66
  async performInitialHealthCheck() {
67
+ const { BedrockClient, ListFoundationModelsCommand } = await loadBedrockControl();
65
68
  const bedrockClient = new BedrockClient({
66
69
  region: this.region,
67
70
  });
@@ -1550,6 +1553,7 @@ export class AmazonBedrockProvider extends BaseProvider {
1550
1553
  const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
1551
1554
  // Create a separate BedrockClient for health checks (not BedrockRuntimeClient)
1552
1555
  // Use simple configuration like working example - no custom proxy handler
1556
+ const { BedrockClient, ListFoundationModelsCommand } = await loadBedrockControl();
1553
1557
  const healthCheckClient = new BedrockClient({
1554
1558
  region: process.env.AWS_REGION || "us-east-1",
1555
1559
  });
@@ -1,4 +1,6 @@
1
- import { BedrockClient, ListFoundationModelsCommand, } from "@aws-sdk/client-bedrock";
1
+ async function loadBedrockControl() {
2
+ return await import(/* @vite-ignore */ "@aws-sdk/client-bedrock");
3
+ }
2
4
  import { BedrockRuntimeClient, ConverseCommand, ConverseStreamCommand, ImageFormat, } from "@aws-sdk/client-bedrock-runtime";
3
5
  import path from "path";
4
6
  import { createAnalytics } from "../core/analytics.js";
@@ -62,6 +64,7 @@ export class AmazonBedrockProvider extends BaseProvider {
62
64
  * This prevents the health check failure we saw in production logs
63
65
  */
64
66
  async performInitialHealthCheck() {
67
+ const { BedrockClient, ListFoundationModelsCommand } = await loadBedrockControl();
65
68
  const bedrockClient = new BedrockClient({
66
69
  region: this.region,
67
70
  });
@@ -1550,6 +1553,7 @@ export class AmazonBedrockProvider extends BaseProvider {
1550
1553
  const timeoutId = setTimeout(() => controller.abort(), 10000); // 10 second timeout
1551
1554
  // Create a separate BedrockClient for health checks (not BedrockRuntimeClient)
1552
1555
  // Use simple configuration like working example - no custom proxy handler
1556
+ const { BedrockClient, ListFoundationModelsCommand } = await loadBedrockControl();
1553
1557
  const healthCheckClient = new BedrockClient({
1554
1558
  region: process.env.AWS_REGION || "us-east-1",
1555
1559
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "9.55.6",
3
+ "version": "9.55.8",
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": {
@@ -243,7 +243,6 @@
243
243
  "open": "^11.0.0",
244
244
  "ora": "^9.3.0",
245
245
  "p-limit": "^7.3.0",
246
- "pptxgenjs": "^4.0.1",
247
246
  "redis": "^5.11.0",
248
247
  "tar-stream": "^3.1.8",
249
248
  "undici": ">=7.22.0",
@@ -273,6 +272,7 @@
273
272
  "bullmq": "^5.52.2",
274
273
  "exceljs": "^4.4.0",
275
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",