@juspay/neurolink 8.25.0 → 8.26.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,9 @@
1
+ ## [8.26.0](https://github.com/juspay/neurolink/compare/v8.25.0...v8.26.0) (2025-12-30)
2
+
3
+ ### Features
4
+
5
+ - **(types):** Add video output types (VIDEO-GEN-001) ([1b1b5c2](https://github.com/juspay/neurolink/commit/1b1b5c23d0bdacb9d3120797b1f7984d7e0cc48c))
6
+
1
7
  ## [8.25.0](https://github.com/juspay/neurolink/compare/v8.24.0...v8.25.0) (2025-12-30)
2
8
 
3
9
  ### Features
@@ -14,5 +14,5 @@
14
14
  * import type { MultimodalInput } from './types/multimodal.js';
15
15
  * ```
16
16
  */
17
- export type { TextContent, ImageContent, CSVContent, PDFContent, AudioContent, VideoContent, Content, ImageWithAltText, MultimodalInput, MultimodalMessage, VisionCapability, ProviderImageFormat, ProcessedImage, ProviderMultimodalPayload, } from "./multimodal.js";
17
+ export type { TextContent, ImageContent, CSVContent, PDFContent, AudioContent, VideoContent, VideoOutputOptions, VideoGenerationResult, Content, ImageWithAltText, MultimodalInput, MultimodalMessage, VisionCapability, ProviderImageFormat, ProcessedImage, ProviderMultimodalPayload, } from "./multimodal.js";
18
18
  export { isTextContent, isImageContent, isCSVContent, isPDFContent, isAudioContent, isVideoContent, isMultimodalInput, } from "./multimodal.js";
@@ -8,6 +8,7 @@ import type { MiddlewareFactoryOptions } from "./middlewareTypes.js";
8
8
  import type { JsonValue } from "./common.js";
9
9
  import type { Content, ImageWithAltText } from "./content.js";
10
10
  import type { TTSOptions, TTSResult } from "./ttsTypes.js";
11
+ import type { VideoOutputOptions, VideoGenerationResult } from "./multimodal.js";
11
12
  /**
12
13
  * Generate function options type - Primary method for content generation
13
14
  * Supports multimodal content while maintaining backward compatibility
@@ -39,8 +40,41 @@ export type GenerateOptions = {
39
40
  files?: Array<Buffer | string>;
40
41
  content?: Content[];
41
42
  };
43
+ /**
44
+ * Output configuration options
45
+ *
46
+ * @example Text output (default)
47
+ * ```typescript
48
+ * output: { format: "text" }
49
+ * ```
50
+ *
51
+ * @example Video generation with Veo 3.1
52
+ * ```typescript
53
+ * output: {
54
+ * mode: "video",
55
+ * video: {
56
+ * resolution: "1080p",
57
+ * length: 8,
58
+ * aspectRatio: "16:9",
59
+ * audio: true
60
+ * }
61
+ * }
62
+ * ```
63
+ */
42
64
  output?: {
65
+ /** Output format for text generation */
43
66
  format?: "text" | "structured" | "json";
67
+ /**
68
+ * Output mode - determines the type of content generated
69
+ * - "text": Standard text generation (default)
70
+ * - "video": Video generation using models like Veo 3.1
71
+ */
72
+ mode?: "text" | "video";
73
+ /**
74
+ * Video generation configuration (used when mode is "video")
75
+ * Requires an input image and text prompt
76
+ */
77
+ video?: VideoOutputOptions;
44
78
  };
45
79
  csvOptions?: {
46
80
  maxRows?: number;
@@ -207,6 +241,29 @@ export type GenerateResult = {
207
241
  * ```
208
242
  */
209
243
  audio?: TTSResult;
244
+ /**
245
+ * Video generation result
246
+ *
247
+ * Contains the generated video buffer and metadata when video mode is enabled.
248
+ * Present when `output.mode` is set to "video" in GenerateOptions.
249
+ *
250
+ * @example Accessing generated video
251
+ * ```typescript
252
+ * const result = await neurolink.generate({
253
+ * input: { text: "Product showcase", images: [imageBuffer] },
254
+ * provider: "vertex",
255
+ * model: "veo-3.1",
256
+ * output: { mode: "video", video: { resolution: "1080p" } }
257
+ * });
258
+ *
259
+ * if (result.video) {
260
+ * fs.writeFileSync('output.mp4', result.video.data);
261
+ * console.log(`Duration: ${result.video.metadata?.duration}s`);
262
+ * console.log(`Dimensions: ${result.video.metadata?.dimensions?.width}x${result.video.metadata?.dimensions?.height}`);
263
+ * }
264
+ * ```
265
+ */
266
+ video?: VideoGenerationResult;
210
267
  provider?: string;
211
268
  model?: string;
212
269
  usage?: TokenUsage;
@@ -33,7 +33,7 @@ export * from "./utilities.js";
33
33
  export * from "./middlewareTypes.js";
34
34
  // File detection and processing types
35
35
  export * from "./fileTypes.js";
36
- // Content types for multimodal support
36
+ // Content types for multimodal support (includes multimodal re-exports for backward compatibility)
37
37
  export * from "./content.js";
38
38
  // TTS (Text-to-Speech) types
39
39
  export * from "./ttsTypes.js";
@@ -124,6 +124,85 @@ export type AudioContent = {
124
124
  language?: string;
125
125
  };
126
126
  };
127
+ /**
128
+ * Video output configuration options for video generation
129
+ *
130
+ * Used with `output.video` in GenerateOptions when `output.mode` is "video".
131
+ * Controls resolution, duration, aspect ratio, and audio settings for generated videos.
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const videoOptions: VideoOutputOptions = {
136
+ * resolution: "1080p",
137
+ * length: 8,
138
+ * aspectRatio: "16:9",
139
+ * audio: true
140
+ * };
141
+ * ```
142
+ */
143
+ export type VideoOutputOptions = {
144
+ /** Output resolution - "720p" (1280x720) or "1080p" (1920x1080) */
145
+ resolution?: "720p" | "1080p";
146
+ /** Video duration in seconds (4, 6, or 8 seconds supported) */
147
+ length?: 4 | 6 | 8;
148
+ /** Aspect ratio - "9:16" for portrait or "16:9" for landscape */
149
+ aspectRatio?: "9:16" | "16:9";
150
+ /** Enable audio generation (default: true) */
151
+ audio?: boolean;
152
+ };
153
+ /**
154
+ * Result type for generated video content
155
+ *
156
+ * Returned in `GenerateResult.video` when video generation is successful.
157
+ * Contains the raw video buffer and associated metadata.
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * const result = await neurolink.generate({
162
+ * input: { text: "Product showcase", images: [imageBuffer] },
163
+ * provider: "vertex",
164
+ * model: "veo-3.1",
165
+ * output: { mode: "video" }
166
+ * });
167
+ *
168
+ * if (result.video) {
169
+ * writeFileSync("output.mp4", result.video.data);
170
+ * console.log(`Duration: ${result.video.metadata?.duration}s`);
171
+ * }
172
+ * ```
173
+ */
174
+ export type VideoGenerationResult = {
175
+ /** Raw video data as Buffer */
176
+ data: Buffer;
177
+ /** Video media type */
178
+ mediaType: "video/mp4" | "video/webm";
179
+ /** Video metadata */
180
+ metadata?: {
181
+ /** Original filename if applicable */
182
+ filename?: string;
183
+ /** Video duration in seconds */
184
+ duration?: number;
185
+ /** Video dimensions */
186
+ dimensions?: {
187
+ width: number;
188
+ height: number;
189
+ };
190
+ /** Frame rate in fps */
191
+ frameRate?: number;
192
+ /** Video codec used */
193
+ codec?: string;
194
+ /** Model used for generation */
195
+ model?: string;
196
+ /** Provider used for generation */
197
+ provider?: string;
198
+ /** Aspect ratio of the video */
199
+ aspectRatio?: string;
200
+ /** Whether audio was enabled during generation */
201
+ audioEnabled?: boolean;
202
+ /** Processing time in milliseconds */
203
+ processingTime?: number;
204
+ };
205
+ };
127
206
  /**
128
207
  * Video content type for multimodal messages
129
208
  *
@@ -14,5 +14,5 @@
14
14
  * import type { MultimodalInput } from './types/multimodal.js';
15
15
  * ```
16
16
  */
17
- export type { TextContent, ImageContent, CSVContent, PDFContent, AudioContent, VideoContent, Content, ImageWithAltText, MultimodalInput, MultimodalMessage, VisionCapability, ProviderImageFormat, ProcessedImage, ProviderMultimodalPayload, } from "./multimodal.js";
17
+ export type { TextContent, ImageContent, CSVContent, PDFContent, AudioContent, VideoContent, VideoOutputOptions, VideoGenerationResult, Content, ImageWithAltText, MultimodalInput, MultimodalMessage, VisionCapability, ProviderImageFormat, ProcessedImage, ProviderMultimodalPayload, } from "./multimodal.js";
18
18
  export { isTextContent, isImageContent, isCSVContent, isPDFContent, isAudioContent, isVideoContent, isMultimodalInput, } from "./multimodal.js";
@@ -8,6 +8,7 @@ import type { MiddlewareFactoryOptions } from "./middlewareTypes.js";
8
8
  import type { JsonValue } from "./common.js";
9
9
  import type { Content, ImageWithAltText } from "./content.js";
10
10
  import type { TTSOptions, TTSResult } from "./ttsTypes.js";
11
+ import type { VideoOutputOptions, VideoGenerationResult } from "./multimodal.js";
11
12
  /**
12
13
  * Generate function options type - Primary method for content generation
13
14
  * Supports multimodal content while maintaining backward compatibility
@@ -39,8 +40,41 @@ export type GenerateOptions = {
39
40
  files?: Array<Buffer | string>;
40
41
  content?: Content[];
41
42
  };
43
+ /**
44
+ * Output configuration options
45
+ *
46
+ * @example Text output (default)
47
+ * ```typescript
48
+ * output: { format: "text" }
49
+ * ```
50
+ *
51
+ * @example Video generation with Veo 3.1
52
+ * ```typescript
53
+ * output: {
54
+ * mode: "video",
55
+ * video: {
56
+ * resolution: "1080p",
57
+ * length: 8,
58
+ * aspectRatio: "16:9",
59
+ * audio: true
60
+ * }
61
+ * }
62
+ * ```
63
+ */
42
64
  output?: {
65
+ /** Output format for text generation */
43
66
  format?: "text" | "structured" | "json";
67
+ /**
68
+ * Output mode - determines the type of content generated
69
+ * - "text": Standard text generation (default)
70
+ * - "video": Video generation using models like Veo 3.1
71
+ */
72
+ mode?: "text" | "video";
73
+ /**
74
+ * Video generation configuration (used when mode is "video")
75
+ * Requires an input image and text prompt
76
+ */
77
+ video?: VideoOutputOptions;
44
78
  };
45
79
  csvOptions?: {
46
80
  maxRows?: number;
@@ -207,6 +241,29 @@ export type GenerateResult = {
207
241
  * ```
208
242
  */
209
243
  audio?: TTSResult;
244
+ /**
245
+ * Video generation result
246
+ *
247
+ * Contains the generated video buffer and metadata when video mode is enabled.
248
+ * Present when `output.mode` is set to "video" in GenerateOptions.
249
+ *
250
+ * @example Accessing generated video
251
+ * ```typescript
252
+ * const result = await neurolink.generate({
253
+ * input: { text: "Product showcase", images: [imageBuffer] },
254
+ * provider: "vertex",
255
+ * model: "veo-3.1",
256
+ * output: { mode: "video", video: { resolution: "1080p" } }
257
+ * });
258
+ *
259
+ * if (result.video) {
260
+ * fs.writeFileSync('output.mp4', result.video.data);
261
+ * console.log(`Duration: ${result.video.metadata?.duration}s`);
262
+ * console.log(`Dimensions: ${result.video.metadata?.dimensions?.width}x${result.video.metadata?.dimensions?.height}`);
263
+ * }
264
+ * ```
265
+ */
266
+ video?: VideoGenerationResult;
210
267
  provider?: string;
211
268
  model?: string;
212
269
  usage?: TokenUsage;
@@ -33,7 +33,7 @@ export * from "./utilities.js";
33
33
  export * from "./middlewareTypes.js";
34
34
  // File detection and processing types
35
35
  export * from "./fileTypes.js";
36
- // Content types for multimodal support
36
+ // Content types for multimodal support (includes multimodal re-exports for backward compatibility)
37
37
  export * from "./content.js";
38
38
  // TTS (Text-to-Speech) types
39
39
  export * from "./ttsTypes.js";
@@ -124,6 +124,85 @@ export type AudioContent = {
124
124
  language?: string;
125
125
  };
126
126
  };
127
+ /**
128
+ * Video output configuration options for video generation
129
+ *
130
+ * Used with `output.video` in GenerateOptions when `output.mode` is "video".
131
+ * Controls resolution, duration, aspect ratio, and audio settings for generated videos.
132
+ *
133
+ * @example
134
+ * ```typescript
135
+ * const videoOptions: VideoOutputOptions = {
136
+ * resolution: "1080p",
137
+ * length: 8,
138
+ * aspectRatio: "16:9",
139
+ * audio: true
140
+ * };
141
+ * ```
142
+ */
143
+ export type VideoOutputOptions = {
144
+ /** Output resolution - "720p" (1280x720) or "1080p" (1920x1080) */
145
+ resolution?: "720p" | "1080p";
146
+ /** Video duration in seconds (4, 6, or 8 seconds supported) */
147
+ length?: 4 | 6 | 8;
148
+ /** Aspect ratio - "9:16" for portrait or "16:9" for landscape */
149
+ aspectRatio?: "9:16" | "16:9";
150
+ /** Enable audio generation (default: true) */
151
+ audio?: boolean;
152
+ };
153
+ /**
154
+ * Result type for generated video content
155
+ *
156
+ * Returned in `GenerateResult.video` when video generation is successful.
157
+ * Contains the raw video buffer and associated metadata.
158
+ *
159
+ * @example
160
+ * ```typescript
161
+ * const result = await neurolink.generate({
162
+ * input: { text: "Product showcase", images: [imageBuffer] },
163
+ * provider: "vertex",
164
+ * model: "veo-3.1",
165
+ * output: { mode: "video" }
166
+ * });
167
+ *
168
+ * if (result.video) {
169
+ * writeFileSync("output.mp4", result.video.data);
170
+ * console.log(`Duration: ${result.video.metadata?.duration}s`);
171
+ * }
172
+ * ```
173
+ */
174
+ export type VideoGenerationResult = {
175
+ /** Raw video data as Buffer */
176
+ data: Buffer;
177
+ /** Video media type */
178
+ mediaType: "video/mp4" | "video/webm";
179
+ /** Video metadata */
180
+ metadata?: {
181
+ /** Original filename if applicable */
182
+ filename?: string;
183
+ /** Video duration in seconds */
184
+ duration?: number;
185
+ /** Video dimensions */
186
+ dimensions?: {
187
+ width: number;
188
+ height: number;
189
+ };
190
+ /** Frame rate in fps */
191
+ frameRate?: number;
192
+ /** Video codec used */
193
+ codec?: string;
194
+ /** Model used for generation */
195
+ model?: string;
196
+ /** Provider used for generation */
197
+ provider?: string;
198
+ /** Aspect ratio of the video */
199
+ aspectRatio?: string;
200
+ /** Whether audio was enabled during generation */
201
+ audioEnabled?: boolean;
202
+ /** Processing time in milliseconds */
203
+ processingTime?: number;
204
+ };
205
+ };
127
206
  /**
128
207
  * Video content type for multimodal messages
129
208
  *
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "8.25.0",
3
+ "version": "8.26.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 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
5
5
  "author": {
6
6
  "name": "Juspay Technologies",