@juspay/neurolink 8.26.1 → 8.28.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,15 @@
1
+ ## [8.28.0](https://github.com/juspay/neurolink/compare/v8.27.0...v8.28.0) (2026-01-02)
2
+
3
+ ### Features
4
+
5
+ - **(video-provider):** Add video generation provider (VIDEO-GEN-003) ([e8a6eb2](https://github.com/juspay/neurolink/commit/e8a6eb2c46cf69fc341a703d7032ac381bebac23))
6
+
7
+ ## [8.27.0](https://github.com/juspay/neurolink/compare/v8.26.1...v8.27.0) (2026-01-01)
8
+
9
+ ### Features
10
+
11
+ - **(validation):** Video generation input validation (VIDEO-GEN-002) ([b58a532](https://github.com/juspay/neurolink/commit/b58a532fa822b365ab26a145b20719982377b73a))
12
+
1
13
  ## [8.26.1](https://github.com/juspay/neurolink/compare/v8.26.0...v8.26.1) (2025-12-31)
2
14
 
3
15
  ### Bug Fixes
@@ -0,0 +1,91 @@
1
+ /**
2
+ * Vertex AI Video Generation Handler
3
+ *
4
+ * Standalone module for Veo 3.1 video generation via Vertex AI.
5
+ * Generates videos from an input image and text prompt.
6
+ *
7
+ * Based on Vertex AI Veo 3.1 video generation API
8
+ *
9
+ * @module adapters/video/vertexVideoHandler
10
+ * @see https://cloud.google.com/vertex-ai/generative-ai/docs/video/generate-videos
11
+ */
12
+ import { ErrorCategory, ErrorSeverity } from "../../constants/enums.js";
13
+ import type { VideoGenerationResult, VideoOutputOptions } from "../../types/multimodal.js";
14
+ import { NeuroLinkError } from "../../utils/errorHandling.js";
15
+ /**
16
+ * Video generation runtime error codes
17
+ *
18
+ * These are for runtime/execution errors during video generation.
19
+ * Input validation errors (missing image, invalid options, etc.) are handled
20
+ * by parameterValidation.ts using ERROR_CODES from errorHandling.ts.
21
+ *
22
+ * Following TTS pattern (TTS_ERROR_CODES + TTSError in ttsProcessor.ts)
23
+ */
24
+ export declare const VIDEO_ERROR_CODES: {
25
+ /** Video generation API call failed */
26
+ readonly GENERATION_FAILED: "VIDEO_GENERATION_FAILED";
27
+ /** Provider (Vertex AI) not properly configured */
28
+ readonly PROVIDER_NOT_CONFIGURED: "VIDEO_PROVIDER_NOT_CONFIGURED";
29
+ /** Polling for video completion timed out */
30
+ readonly POLL_TIMEOUT: "VIDEO_POLL_TIMEOUT";
31
+ };
32
+ /**
33
+ * Video generation error class
34
+ * Extends NeuroLinkError for consistent error handling across the SDK
35
+ */
36
+ export declare class VideoError extends NeuroLinkError {
37
+ constructor(options: {
38
+ code: string;
39
+ message: string;
40
+ category?: ErrorCategory;
41
+ severity?: ErrorSeverity;
42
+ retriable?: boolean;
43
+ context?: Record<string, unknown>;
44
+ originalError?: Error;
45
+ });
46
+ }
47
+ /**
48
+ * Check if Vertex AI is configured for video generation
49
+ *
50
+ * @returns True if Google Cloud credentials are available
51
+ *
52
+ * @example
53
+ * ```typescript
54
+ * if (!isVertexVideoConfigured()) {
55
+ * console.error("Set GOOGLE_APPLICATION_CREDENTIALS to enable video generation");
56
+ * }
57
+ * ```
58
+ */
59
+ export declare function isVertexVideoConfigured(): boolean;
60
+ /**
61
+ * Generate video using Vertex AI Veo 3.1
62
+ *
63
+ * Creates a video from an input image and text prompt using Google's Veo 3.1 model.
64
+ * The video is generated with optional audio and can be customized for resolution,
65
+ * duration, and aspect ratio.
66
+ *
67
+ * @param image - Input image buffer (JPEG, PNG, or WebP)
68
+ * @param prompt - Text prompt describing desired video motion/content (max 500 chars)
69
+ * @param options - Video output options (resolution, length, aspect ratio, audio)
70
+ * @returns VideoGenerationResult with video buffer and metadata
71
+ *
72
+ * @throws {VideoError} When credentials are not configured (PROVIDER_NOT_CONFIGURED)
73
+ * @throws {VideoError} When API returns an error (GENERATION_FAILED)
74
+ * @throws {VideoError} When polling times out (POLL_TIMEOUT)
75
+ *
76
+ * @example
77
+ * ```typescript
78
+ * import { generateVideoWithVertex } from "@juspay/neurolink/adapters/video/vertexVideoHandler";
79
+ * import { readFileSync, writeFileSync } from "fs";
80
+ *
81
+ * const image = readFileSync("./input.png");
82
+ * const result = await generateVideoWithVertex(
83
+ * image,
84
+ * "Smooth cinematic camera movement with dramatic lighting",
85
+ * { resolution: "720p", length: 6, aspectRatio: "16:9", audio: true }
86
+ * );
87
+ *
88
+ * writeFileSync("output.mp4", result.data);
89
+ * ```
90
+ */
91
+ export declare function generateVideoWithVertex(image: Buffer, prompt: string, options?: VideoOutputOptions): Promise<VideoGenerationResult>;