@juspay/neurolink 9.66.0 → 9.67.1

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 (74) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/README.md +12 -12
  3. package/dist/avatar/index.d.ts +13 -0
  4. package/dist/avatar/index.js +72 -0
  5. package/dist/browser/neurolink.min.js +389 -383
  6. package/dist/core/baseProvider.js +49 -8
  7. package/dist/factories/providerRegistry.js +23 -0
  8. package/dist/index.d.ts +10 -1
  9. package/dist/index.js +36 -1
  10. package/dist/lib/avatar/index.d.ts +13 -0
  11. package/dist/lib/avatar/index.js +72 -0
  12. package/dist/lib/core/baseProvider.js +49 -8
  13. package/dist/lib/factories/providerRegistry.js +23 -0
  14. package/dist/lib/files/fileTools.d.ts +1 -1
  15. package/dist/lib/index.d.ts +10 -1
  16. package/dist/lib/index.js +36 -1
  17. package/dist/lib/music/index.d.ts +14 -0
  18. package/dist/lib/music/index.js +80 -0
  19. package/dist/lib/providers/openaiCompatible.d.ts +46 -19
  20. package/dist/lib/providers/openaiCompatible.js +1069 -171
  21. package/dist/lib/types/avatar.d.ts +8 -1
  22. package/dist/lib/types/index.d.ts +1 -0
  23. package/dist/lib/types/index.js +1 -0
  24. package/dist/lib/types/middleware.d.ts +1 -1
  25. package/dist/lib/types/multimodal.d.ts +20 -7
  26. package/dist/lib/types/music.d.ts +8 -1
  27. package/dist/lib/types/openaiCompatible.d.ts +250 -0
  28. package/dist/lib/types/openaiCompatible.js +2 -0
  29. package/dist/lib/types/tts.d.ts +9 -1
  30. package/dist/lib/utils/avatarProcessor.d.ts +7 -1
  31. package/dist/lib/utils/avatarProcessor.js +6 -0
  32. package/dist/lib/utils/musicProcessor.d.ts +7 -1
  33. package/dist/lib/utils/musicProcessor.js +6 -0
  34. package/dist/lib/utils/parameterValidation.js +5 -1
  35. package/dist/lib/utils/sttProcessor.d.ts +5 -3
  36. package/dist/lib/utils/sttProcessor.js +4 -2
  37. package/dist/lib/utils/ttsProcessor.d.ts +6 -3
  38. package/dist/lib/utils/ttsProcessor.js +5 -2
  39. package/dist/lib/voice/RealtimeVoiceAPI.d.ts +5 -2
  40. package/dist/lib/voice/RealtimeVoiceAPI.js +4 -1
  41. package/dist/lib/voice/index.d.ts +23 -0
  42. package/dist/lib/voice/index.js +124 -2
  43. package/dist/lib/voice/providers/CartesiaTTS.d.ts +31 -0
  44. package/dist/lib/voice/providers/CartesiaTTS.js +189 -0
  45. package/dist/lib/workflow/config.d.ts +3 -3
  46. package/dist/music/index.d.ts +14 -0
  47. package/dist/music/index.js +80 -0
  48. package/dist/providers/openaiCompatible.d.ts +46 -19
  49. package/dist/providers/openaiCompatible.js +1069 -171
  50. package/dist/types/avatar.d.ts +8 -1
  51. package/dist/types/index.d.ts +1 -0
  52. package/dist/types/index.js +1 -0
  53. package/dist/types/middleware.d.ts +1 -1
  54. package/dist/types/multimodal.d.ts +20 -7
  55. package/dist/types/music.d.ts +8 -1
  56. package/dist/types/openaiCompatible.d.ts +250 -0
  57. package/dist/types/openaiCompatible.js +1 -0
  58. package/dist/types/tts.d.ts +9 -1
  59. package/dist/utils/avatarProcessor.d.ts +7 -1
  60. package/dist/utils/avatarProcessor.js +6 -0
  61. package/dist/utils/musicProcessor.d.ts +7 -1
  62. package/dist/utils/musicProcessor.js +6 -0
  63. package/dist/utils/parameterValidation.js +5 -1
  64. package/dist/utils/sttProcessor.d.ts +5 -3
  65. package/dist/utils/sttProcessor.js +4 -2
  66. package/dist/utils/ttsProcessor.d.ts +6 -3
  67. package/dist/utils/ttsProcessor.js +5 -2
  68. package/dist/voice/RealtimeVoiceAPI.d.ts +5 -2
  69. package/dist/voice/RealtimeVoiceAPI.js +4 -1
  70. package/dist/voice/index.d.ts +23 -0
  71. package/dist/voice/index.js +124 -2
  72. package/dist/voice/providers/CartesiaTTS.d.ts +31 -0
  73. package/dist/voice/providers/CartesiaTTS.js +188 -0
  74. package/package.json +66 -2
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [9.67.1](https://github.com/juspay/neurolink/compare/v9.67.0...v9.67.1) (2026-05-26)
2
+
3
+ ## [9.67.0](https://github.com/juspay/neurolink/compare/v9.66.0...v9.67.0) (2026-05-26)
4
+
5
+ ### Features
6
+
7
+ - **(providers):** wire missing media handlers + fix video routing + add CartesiaTTS ([269cae6](https://github.com/juspay/neurolink/commit/269cae623591d874866de81875f9280eae42d0ca))
8
+
1
9
  ## [9.66.0](https://github.com/juspay/neurolink/compare/v9.65.2...v9.66.0) (2026-05-24)
2
10
 
3
11
  ### Features
package/README.md CHANGED
@@ -43,7 +43,7 @@ Extracted from production systems at Juspay and battle-tested at enterprise scal
43
43
  | Feature | Version | Description | Guide |
44
44
  | -------------------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------------------------------------------------------------- |
45
45
  | **Avatar / Music Modalities + 12 Providers** | next | New `output: { mode: "avatar" \| "music" }` dispatch with handlers for D-ID, HeyGen, Replicate-MuseTalk (avatar) and Beatoven, ElevenLabs Music, Lyria, Replicate-MusicGen (music). Plus Fish Audio TTS, Kling/Runway/Replicate video, xAI/Groq/Cohere/Together/Fireworks/Perplexity/Cloudflare LLMs, Voyage/Jina embeddings, Stability/Ideogram/Recraft/Replicate image-gen. | [Provider Integration](docs/provider-integration/) |
46
- | **Multi-Provider Voice (TTS/STT)** | v9.62.0 | 4 TTS providers (OpenAI TTS, ElevenLabs, Google TTS, Azure TTS) + 4 STT providers (Whisper, Deepgram, Azure STT, Google STT) + 2 realtime APIs (OpenAI Realtime, Gemini Live). | [TTS Guide](docs/features/tts.md) \| [STT Guide](docs/features/audio-input.md) \| [Realtime Guide](docs/features/real-time-services.md) |
46
+ | **Multi-Provider Voice (TTS/STT)** | v9.62.0 | 6 TTS providers (OpenAI TTS, ElevenLabs, Google TTS, Azure TTS, Fish Audio, Cartesia) + 4 STT providers (Whisper, Deepgram, Azure STT, Google STT) + 2 realtime APIs (OpenAI Realtime, Gemini Live). | [TTS Guide](docs/features/tts.md) \| [STT Guide](docs/features/audio-input.md) \| [Realtime Guide](docs/features/real-time-services.md) |
47
47
  | **4 New Providers** | v9.60.0 | DeepSeek (V3/R1), NVIDIA NIM (400+ catalog), LM Studio (local), llama.cpp (GGUF local). | [Provider Setup](docs/getting-started/provider-setup.md) |
48
48
  | **ModelAccessDeniedError** | v9.59.0 | Typed `ModelAccessDeniedError` + `sdk.checkCredentials()` API for proactive credential validation before first call. | [Error Reference](docs/reference/troubleshooting.md) |
49
49
  | **Provider Fallback Policy** | v9.58.0 | `providerFallback` callback + `modelChain` config for centralized multi-provider fallback logic. | [Advanced Guide](docs/advanced/index.md) |
@@ -71,7 +71,7 @@ const result = await neurolink.generate({
71
71
  voice: "en-US-Neural2-C",
72
72
  format: "mp3",
73
73
  output: "./output.mp3", // optional: save to disk
74
- provider: "elevenlabs", // optional override: openai-tts | elevenlabs | google-ai | vertex | azure-tts
74
+ provider: "elevenlabs", // optional override: openai-tts | elevenlabs | google-ai | vertex | azure-tts | fish-audio | cartesia
75
75
  },
76
76
  });
77
77
  // result.audio: { buffer: Buffer, format: "mp3", ... }
@@ -955,16 +955,16 @@ Full command and API breakdown lives in [`docs/cli/commands.md`](docs/cli/comman
955
955
 
956
956
  ## Platform Capabilities at a Glance
957
957
 
958
- | Capability | Highlights |
959
- | ------------------------ | ------------------------------------------------------------------------------------------------------------------------ |
960
- | **Provider unification** | 21+ providers with automatic fallback, cost-aware routing, `providerFallback` policy, `modelChain` config. |
961
- | **Multimodal pipeline** | Stream images + CSV data + PDF documents across providers with local/remote assets. Auto-detection for mixed file types. |
962
- | **Voice pipeline** | TTS (4 providers) + STT (4 providers) + realtime voice APIs (OpenAI Realtime, Gemini Live). |
963
- | **Quality & governance** | Auto-evaluation engine (14 scorers), guardrails middleware, HITL workflows, audit logging. |
964
- | **Memory & context** | Per-user condensed memory (S3/Redis/SQLite), Redis session export, 4-stage context compaction. |
965
- | **CLI tooling** | Loop sessions, setup wizard, config validation, Redis auto-detect, JSON output, TTS/STT flags. |
966
- | **Enterprise ops** | Claude proxy, OTLP observability, OpenObserve dashboard, regional routing, credential management. |
967
- | **Tool ecosystem** | MCP auto discovery, HTTP/stdio/SSE/WebSocket transports, LiteLLM hub access, SageMaker custom deployment, web search. |
958
+ | Capability | Highlights |
959
+ | ------------------------ | ---------------------------------------------------------------------------------------------------------------------------------------------------- |
960
+ | **Provider unification** | 21+ providers with automatic fallback, cost-aware routing, `providerFallback` policy, `modelChain` config. |
961
+ | **Multimodal pipeline** | Stream images + CSV data + PDF documents across providers with local/remote assets. Auto-detection for mixed file types. |
962
+ | **Voice pipeline** | TTS (6 providers: Google, OpenAI, ElevenLabs, Azure, Fish Audio, Cartesia) + STT (4 providers) + realtime voice APIs (OpenAI Realtime, Gemini Live). |
963
+ | **Quality & governance** | Auto-evaluation engine (14 scorers), guardrails middleware, HITL workflows, audit logging. |
964
+ | **Memory & context** | Per-user condensed memory (S3/Redis/SQLite), Redis session export, 4-stage context compaction. |
965
+ | **CLI tooling** | Loop sessions, setup wizard, config validation, Redis auto-detect, JSON output, TTS/STT flags. |
966
+ | **Enterprise ops** | Claude proxy, OTLP observability, OpenObserve dashboard, regional routing, credential management. |
967
+ | **Tool ecosystem** | MCP auto discovery, HTTP/stdio/SSE/WebSocket transports, LiteLLM hub access, SageMaker custom deployment, web search. |
968
968
 
969
969
  ## Documentation Map
970
970
 
@@ -7,7 +7,20 @@
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
13
+ * its constructor throws.
14
+ *
10
15
  * @module avatar
11
16
  */
12
17
  export { AVATAR_ERROR_CODES, AvatarError, AvatarProcessor, } from "../utils/avatarProcessor.js";
13
18
  export { DIDAvatar, DIDAvatar as DIDAvatarHandler, } from "./providers/DIDAvatar.js";
19
+ export { HeyGenAvatar, HeyGenAvatar as HeyGenAvatarHandler, } from "./providers/HeyGenAvatar.js";
20
+ export { ReplicateAvatar, ReplicateAvatar as ReplicateAvatarHandler, } from "./providers/ReplicateAvatar.js";
21
+ /**
22
+ * Register every shipped avatar handler whose backing credentials are
23
+ * present in the environment. Safe to call multiple times — existing
24
+ * registrations are preserved.
25
+ */
26
+ export declare function registerDefaultAvatarHandlers(): void;
@@ -7,7 +7,79 @@
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
13
+ * its constructor throws.
14
+ *
10
15
  * @module avatar
11
16
  */
17
+ import { logger } from "../utils/logger.js";
18
+ import { AvatarProcessor } from "../utils/avatarProcessor.js";
12
19
  export { AVATAR_ERROR_CODES, AvatarError, AvatarProcessor, } from "../utils/avatarProcessor.js";
20
+ // ============================================================================
21
+ // HANDLER CLASSES
22
+ // ============================================================================
13
23
  export { DIDAvatar, DIDAvatar as DIDAvatarHandler, } from "./providers/DIDAvatar.js";
24
+ export { HeyGenAvatar, HeyGenAvatar as HeyGenAvatarHandler, } from "./providers/HeyGenAvatar.js";
25
+ export { ReplicateAvatar, ReplicateAvatar as ReplicateAvatarHandler, } from "./providers/ReplicateAvatar.js";
26
+ // ============================================================================
27
+ // AUTO-REGISTRATION
28
+ // ============================================================================
29
+ import { DIDAvatar } from "./providers/DIDAvatar.js";
30
+ import { HeyGenAvatar } from "./providers/HeyGenAvatar.js";
31
+ 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
+ ];
41
+ /**
42
+ * Register every shipped avatar handler whose backing credentials are
43
+ * present in the environment. Safe to call multiple times — existing
44
+ * registrations are preserved.
45
+ */
46
+ export function registerDefaultAvatarHandlers() {
47
+ for (const { name, aliases, factory } of AVATAR_HANDLER_CANDIDATES) {
48
+ // Compute missingName / missingAliases separately so a pre-registered
49
+ // primary doesn't block alias backfill — keeps "musetalk" reachable
50
+ // when only "replicate" was wired up via another path.
51
+ const missingName = !AvatarProcessor.supports(name);
52
+ const missingAliases = (aliases ?? []).filter((alias) => !AvatarProcessor.supports(alias));
53
+ if (!missingName && missingAliases.length === 0) {
54
+ continue;
55
+ }
56
+ try {
57
+ // Reuse the already-registered primary's handler for alias backfill
58
+ // when one exists — wiring an alias to a factory-fresh instance
59
+ // would silently diverge from the canonical primary's config.
60
+ let handler;
61
+ if (!missingName) {
62
+ handler = AvatarProcessor.getHandler(name);
63
+ }
64
+ if (!handler) {
65
+ handler = factory();
66
+ if (!handler.isConfigured()) {
67
+ continue;
68
+ }
69
+ }
70
+ if (missingName) {
71
+ AvatarProcessor.registerHandler(name, handler);
72
+ }
73
+ for (const alias of missingAliases) {
74
+ AvatarProcessor.registerHandler(alias, handler);
75
+ }
76
+ }
77
+ catch (err) {
78
+ logger.debug(`[avatar] ${name} auto-registration skipped: ${err instanceof Error ? err.message : String(err)}`);
79
+ }
80
+ }
81
+ }
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();