@juspay/neurolink 11.26.2 → 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.
Files changed (39) hide show
  1. package/CHANGELOG.md +3 -3
  2. package/dist/adapters/providerImageAdapter.js +20 -0
  3. package/dist/adapters/video/index.d.ts +30 -0
  4. package/dist/adapters/video/index.js +74 -0
  5. package/dist/avatar/index.d.ts +6 -3
  6. package/dist/avatar/index.js +21 -16
  7. package/dist/browser/neurolink.min.js +393 -393
  8. package/dist/cli/factories/commandFactory.d.ts +6 -0
  9. package/dist/cli/factories/commandFactory.js +6 -2
  10. package/dist/constants/contextWindows.d.ts +18 -4
  11. package/dist/constants/contextWindows.js +35 -4
  12. package/dist/core/baseProvider.js +5 -3
  13. package/dist/core/constants.js +59 -1
  14. package/dist/factories/mediaHandlerCatalog.d.ts +18 -0
  15. package/dist/factories/mediaHandlerCatalog.js +65 -0
  16. package/dist/factories/providerRegistry.js +50 -207
  17. package/dist/index.d.ts +1 -4
  18. package/dist/index.js +2 -5
  19. package/dist/models/anthropicModels.d.ts +3 -6
  20. package/dist/models/anthropicModels.js +97 -123
  21. package/dist/models/manifestRegistry.d.ts +9 -0
  22. package/dist/models/manifestRegistry.js +23 -0
  23. package/dist/models/manifests/anthropic.js +5 -3
  24. package/dist/models/manifests/azure.js +6 -1
  25. package/dist/models/modelRegistry.d.ts +22 -2
  26. package/dist/models/modelRegistry.js +143 -8
  27. package/dist/music/index.d.ts +6 -3
  28. package/dist/music/index.js +22 -21
  29. package/dist/neurolink.js +12 -0
  30. package/dist/providers/amazonSagemaker.d.ts +1 -1
  31. package/dist/providers/sagemaker/language-model.d.ts +2 -2
  32. package/dist/types/index.d.ts +1 -0
  33. package/dist/types/index.js +1 -0
  34. package/dist/types/mediaCatalog.d.ts +12 -0
  35. package/dist/types/mediaCatalog.js +7 -0
  36. package/dist/utils/pricing.js +51 -0
  37. package/dist/voice/index.d.ts +7 -3
  38. package/dist/voice/index.js +50 -40
  39. package/package.json +2 -1
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## [11.26.2](https://github.com/juspay/neurolink/compare/v11.26.1...v11.26.2) (2026-08-25)
1
+ ## [11.28.0](https://github.com/juspay/neurolink/compare/v11.27.0...v11.28.0) (2026-08-25)
2
2
 
3
- ### Bug Fixes
3
+ ### Features
4
4
 
5
- - **(core):** format a provider failure once instead of five times ([cd83def](https://github.com/juspay/neurolink/commit/cd83defa09250f335e2ce95869fbbe01896d58e2))
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
 
@@ -4,6 +4,7 @@
4
4
  */
5
5
  import { ImageProcessor } from "../utils/imageProcessor.js";
6
6
  import { logger } from "../utils/logger.js";
7
+ import { resolveManifestEntryStrict } from "../models/manifestRegistry.js";
7
8
  /**
8
9
  * Simplified logger for essential error reporting only
9
10
  */
@@ -630,6 +631,25 @@ export class ProviderImageAdapter {
630
631
  process.env.ANTHROPIC_BASE_URL) {
631
632
  return true;
632
633
  }
634
+ // Manifest is the source of truth when it has an entry for this exact
635
+ // model or a declared alias ONLY — strict, no prefix fallback: a
636
+ // manifest "gpt-4" prefix hit must never shadow the legacy table's
637
+ // explicit "gpt-4-vision-preview" row, and a fabricated id must not
638
+ // borrow a real family's capabilities. Everything without a real
639
+ // manifest match falls through to the legacy tables below unchanged.
640
+ const manifestEntry = resolveManifestEntryStrict(normalizedProvider, model ?? "");
641
+ if (manifestEntry) {
642
+ if (!model) {
643
+ return true;
644
+ }
645
+ if (manifestEntry.vision) {
646
+ return true;
647
+ }
648
+ if (PROXY_PROVIDERS.has(normalizedProvider)) {
649
+ return true;
650
+ }
651
+ return false;
652
+ }
633
653
  const supportedModels = VISION_CAPABILITIES[normalizedProvider];
634
654
  if (!supportedModels) {
635
655
  return false;
@@ -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
+ }
@@ -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 also auto-registers every shipped avatar handler
11
- * whose backing API key is present in `process.env`. Registration is
12
- * idempotent and silently skipped if a provider is already registered or
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
@@ -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 also auto-registers every shipped avatar handler
11
- * whose backing API key is present in `process.env`. Registration is
12
- * idempotent and silently skipped if a provider is already registered or
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
- const AVATAR_HANDLER_CANDIDATES = [
33
- { name: "d-id", factory: () => new DIDAvatar() },
34
- { name: "heygen", factory: () => new HeyGenAvatar() },
35
- {
36
- name: "replicate",
37
- aliases: ["musetalk"],
38
- factory: () => new ReplicateAvatar(),
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();