@juspay/neurolink 11.27.0 → 11.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 +2 -2
- package/dist/adapters/video/index.d.ts +30 -0
- package/dist/adapters/video/index.js +74 -0
- package/dist/avatar/index.d.ts +6 -3
- package/dist/avatar/index.js +21 -16
- package/dist/browser/neurolink.min.js +392 -392
- package/dist/cli/factories/commandFactory.d.ts +6 -0
- package/dist/cli/factories/commandFactory.js +6 -2
- package/dist/core/baseProvider.js +5 -3
- package/dist/factories/mediaHandlerCatalog.d.ts +18 -0
- package/dist/factories/mediaHandlerCatalog.js +65 -0
- package/dist/factories/providerRegistry.js +50 -207
- package/dist/index.d.ts +1 -4
- package/dist/index.js +2 -5
- package/dist/music/index.d.ts +6 -3
- package/dist/music/index.js +22 -21
- package/dist/neurolink.js +12 -0
- package/dist/types/index.d.ts +1 -0
- package/dist/types/index.js +1 -0
- package/dist/types/mediaCatalog.d.ts +12 -0
- package/dist/types/mediaCatalog.js +7 -0
- package/dist/voice/index.d.ts +7 -3
- package/dist/voice/index.js +50 -40
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
## [11.
|
|
1
|
+
## [11.28.0](https://github.com/juspay/neurolink/compare/v11.27.0...v11.28.0) (2026-08-25)
|
|
2
2
|
|
|
3
3
|
### Features
|
|
4
4
|
|
|
5
|
-
- **(
|
|
5
|
+
- **(media):** one catalog, one registration path, catalog-derived choices ([a185e4b](https://github.com/juspay/neurolink/commit/a185e4b4aaf3d9697f756fb8e3882b98b480ef85))
|
|
6
6
|
|
|
7
7
|
## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
|
|
8
8
|
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Adapter Module — Image-to-Video Generation Integration for NeuroLink
|
|
3
|
+
*
|
|
4
|
+
* Provides video-generation capability across providers (Vertex Veo, Kling,
|
|
5
|
+
* Runway, Replicate-hosted video models).
|
|
6
|
+
*
|
|
7
|
+
* Use `VideoProcessor.generate(provider, image, prompt, options)` to
|
|
8
|
+
* dispatch to the registered handler for `provider`.
|
|
9
|
+
*
|
|
10
|
+
* Importing this module does NOT register any handlers as a side effect.
|
|
11
|
+
* Call `registerDefaultVideoHandlers()` explicitly (or go through
|
|
12
|
+
* `ProviderRegistry.registerAllProviders()`, which every documented
|
|
13
|
+
* `NeuroLink` entry point already calls) to register every shipped video
|
|
14
|
+
* handler whose backing API key is present in `process.env`. Registration
|
|
15
|
+
* is idempotent and silently skipped if a provider is already registered or
|
|
16
|
+
* its constructor throws.
|
|
17
|
+
*
|
|
18
|
+
* @module adapters/video
|
|
19
|
+
*/
|
|
20
|
+
export { VIDEO_ERROR_CODES, VideoError, VideoProcessor, } from "../../utils/videoProcessor.js";
|
|
21
|
+
export { KlingVideoHandler } from "./klingVideoHandler.js";
|
|
22
|
+
export { ReplicateVideoHandler } from "./replicateVideoHandler.js";
|
|
23
|
+
export { RunwayVideoHandler } from "./runwayVideoHandler.js";
|
|
24
|
+
export { isVertexVideoConfigured, VertexVideoHandler, } from "./vertexVideoHandler.js";
|
|
25
|
+
/**
|
|
26
|
+
* Register every shipped video handler whose backing credentials are
|
|
27
|
+
* present in the environment. Safe to call multiple times — existing
|
|
28
|
+
* registrations are preserved.
|
|
29
|
+
*/
|
|
30
|
+
export declare function registerDefaultVideoHandlers(): void;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Video Adapter Module — Image-to-Video Generation Integration for NeuroLink
|
|
3
|
+
*
|
|
4
|
+
* Provides video-generation capability across providers (Vertex Veo, Kling,
|
|
5
|
+
* Runway, Replicate-hosted video models).
|
|
6
|
+
*
|
|
7
|
+
* Use `VideoProcessor.generate(provider, image, prompt, options)` to
|
|
8
|
+
* dispatch to the registered handler for `provider`.
|
|
9
|
+
*
|
|
10
|
+
* Importing this module does NOT register any handlers as a side effect.
|
|
11
|
+
* Call `registerDefaultVideoHandlers()` explicitly (or go through
|
|
12
|
+
* `ProviderRegistry.registerAllProviders()`, which every documented
|
|
13
|
+
* `NeuroLink` entry point already calls) to register every shipped video
|
|
14
|
+
* handler whose backing API key is present in `process.env`. Registration
|
|
15
|
+
* is idempotent and silently skipped if a provider is already registered or
|
|
16
|
+
* its constructor throws.
|
|
17
|
+
*
|
|
18
|
+
* @module adapters/video
|
|
19
|
+
*/
|
|
20
|
+
import { MEDIA_HANDLER_CATALOG } from "../../factories/mediaHandlerCatalog.js";
|
|
21
|
+
import { logger } from "../../utils/logger.js";
|
|
22
|
+
import { VideoProcessor } from "../../utils/videoProcessor.js";
|
|
23
|
+
export { VIDEO_ERROR_CODES, VideoError, VideoProcessor, } from "../../utils/videoProcessor.js";
|
|
24
|
+
// ============================================================================
|
|
25
|
+
// HANDLER CLASSES
|
|
26
|
+
// ============================================================================
|
|
27
|
+
export { KlingVideoHandler } from "./klingVideoHandler.js";
|
|
28
|
+
export { ReplicateVideoHandler } from "./replicateVideoHandler.js";
|
|
29
|
+
export { RunwayVideoHandler } from "./runwayVideoHandler.js";
|
|
30
|
+
export { isVertexVideoConfigured, VertexVideoHandler, } from "./vertexVideoHandler.js";
|
|
31
|
+
// ============================================================================
|
|
32
|
+
// AUTO-REGISTRATION
|
|
33
|
+
// ============================================================================
|
|
34
|
+
import { KlingVideoHandler } from "./klingVideoHandler.js";
|
|
35
|
+
import { ReplicateVideoHandler } from "./replicateVideoHandler.js";
|
|
36
|
+
import { RunwayVideoHandler } from "./runwayVideoHandler.js";
|
|
37
|
+
import { VertexVideoHandler } from "./vertexVideoHandler.js";
|
|
38
|
+
// Provider names are the Task-8 catalog's job — only the factory (which
|
|
39
|
+
// needs the imported handler class) stays local to this module.
|
|
40
|
+
const VIDEO_HANDLER_FACTORIES = {
|
|
41
|
+
vertex: () => new VertexVideoHandler(),
|
|
42
|
+
kling: () => new KlingVideoHandler(),
|
|
43
|
+
runway: () => new RunwayVideoHandler(),
|
|
44
|
+
replicate: () => new ReplicateVideoHandler(),
|
|
45
|
+
};
|
|
46
|
+
const VIDEO_HANDLER_CANDIDATES = MEDIA_HANDLER_CATALOG.filter((entry) => entry.kind === "video").map((entry) => {
|
|
47
|
+
const factory = VIDEO_HANDLER_FACTORIES[entry.name];
|
|
48
|
+
if (!factory) {
|
|
49
|
+
throw new Error(`[video] no handler factory for catalog entry "${entry.name}"`);
|
|
50
|
+
}
|
|
51
|
+
return { name: entry.name, factory };
|
|
52
|
+
});
|
|
53
|
+
/**
|
|
54
|
+
* Register every shipped video handler whose backing credentials are
|
|
55
|
+
* present in the environment. Safe to call multiple times — existing
|
|
56
|
+
* registrations are preserved.
|
|
57
|
+
*/
|
|
58
|
+
export function registerDefaultVideoHandlers() {
|
|
59
|
+
for (const { name, factory } of VIDEO_HANDLER_CANDIDATES) {
|
|
60
|
+
if (VideoProcessor.supports(name)) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
try {
|
|
64
|
+
const handler = factory();
|
|
65
|
+
if (!handler.isConfigured()) {
|
|
66
|
+
continue;
|
|
67
|
+
}
|
|
68
|
+
VideoProcessor.registerHandler(name, handler);
|
|
69
|
+
}
|
|
70
|
+
catch (err) {
|
|
71
|
+
logger.debug(`[video] ${name} auto-registration skipped: ${err instanceof Error ? err.message : String(err)}`);
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
}
|
package/dist/avatar/index.d.ts
CHANGED
|
@@ -7,9 +7,12 @@
|
|
|
7
7
|
* Use `AvatarProcessor.generate(provider, options)` to dispatch to the
|
|
8
8
|
* registered handler for `provider`.
|
|
9
9
|
*
|
|
10
|
-
* Importing this module
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Importing this module does NOT register any handlers as a side effect.
|
|
11
|
+
* Call `registerDefaultAvatarHandlers()` explicitly (or go through
|
|
12
|
+
* `ProviderRegistry.registerAllProviders()`, which every documented
|
|
13
|
+
* `NeuroLink` entry point already calls) to register every shipped avatar
|
|
14
|
+
* handler whose backing API key is present in `process.env`. Registration
|
|
15
|
+
* is idempotent and silently skipped if a provider is already registered or
|
|
13
16
|
* its constructor throws.
|
|
14
17
|
*
|
|
15
18
|
* @module avatar
|
package/dist/avatar/index.js
CHANGED
|
@@ -7,13 +7,17 @@
|
|
|
7
7
|
* Use `AvatarProcessor.generate(provider, options)` to dispatch to the
|
|
8
8
|
* registered handler for `provider`.
|
|
9
9
|
*
|
|
10
|
-
* Importing this module
|
|
11
|
-
*
|
|
12
|
-
*
|
|
10
|
+
* Importing this module does NOT register any handlers as a side effect.
|
|
11
|
+
* Call `registerDefaultAvatarHandlers()` explicitly (or go through
|
|
12
|
+
* `ProviderRegistry.registerAllProviders()`, which every documented
|
|
13
|
+
* `NeuroLink` entry point already calls) to register every shipped avatar
|
|
14
|
+
* handler whose backing API key is present in `process.env`. Registration
|
|
15
|
+
* is idempotent and silently skipped if a provider is already registered or
|
|
13
16
|
* its constructor throws.
|
|
14
17
|
*
|
|
15
18
|
* @module avatar
|
|
16
19
|
*/
|
|
20
|
+
import { MEDIA_HANDLER_CATALOG } from "../factories/mediaHandlerCatalog.js";
|
|
17
21
|
import { logger } from "../utils/logger.js";
|
|
18
22
|
import { AvatarProcessor } from "../utils/avatarProcessor.js";
|
|
19
23
|
export { AVATAR_ERROR_CODES, AvatarError, AvatarProcessor, } from "../utils/avatarProcessor.js";
|
|
@@ -29,15 +33,20 @@ export { ReplicateAvatar, ReplicateAvatar as ReplicateAvatarHandler, } from "./p
|
|
|
29
33
|
import { DIDAvatar } from "./providers/DIDAvatar.js";
|
|
30
34
|
import { HeyGenAvatar } from "./providers/HeyGenAvatar.js";
|
|
31
35
|
import { ReplicateAvatar } from "./providers/ReplicateAvatar.js";
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
];
|
|
36
|
+
// Provider names + aliases are the Task-8 catalog's job — only the factory
|
|
37
|
+
// (which needs the imported handler class) stays local to this module.
|
|
38
|
+
const AVATAR_HANDLER_FACTORIES = {
|
|
39
|
+
"d-id": () => new DIDAvatar(),
|
|
40
|
+
heygen: () => new HeyGenAvatar(),
|
|
41
|
+
replicate: () => new ReplicateAvatar(),
|
|
42
|
+
};
|
|
43
|
+
const AVATAR_HANDLER_CANDIDATES = MEDIA_HANDLER_CATALOG.filter((entry) => entry.kind === "avatar").map((entry) => {
|
|
44
|
+
const factory = AVATAR_HANDLER_FACTORIES[entry.name];
|
|
45
|
+
if (!factory) {
|
|
46
|
+
throw new Error(`[avatar] no handler factory for catalog entry "${entry.name}"`);
|
|
47
|
+
}
|
|
48
|
+
return { name: entry.name, aliases: entry.aliases, factory };
|
|
49
|
+
});
|
|
41
50
|
/**
|
|
42
51
|
* Register every shipped avatar handler whose backing credentials are
|
|
43
52
|
* present in the environment. Safe to call multiple times — existing
|
|
@@ -79,7 +88,3 @@ export function registerDefaultAvatarHandlers() {
|
|
|
79
88
|
}
|
|
80
89
|
}
|
|
81
90
|
}
|
|
82
|
-
// Run once at module import so consumers who follow the documented
|
|
83
|
-
// `nl.generate(...)` flow get every configured handler without manually
|
|
84
|
-
// calling `registerHandler`.
|
|
85
|
-
registerDefaultAvatarHandlers();
|