@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.
- package/CHANGELOG.md +3 -3
- package/dist/adapters/providerImageAdapter.js +20 -0
- 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 +393 -393
- package/dist/cli/factories/commandFactory.d.ts +6 -0
- package/dist/cli/factories/commandFactory.js +6 -2
- package/dist/constants/contextWindows.d.ts +18 -4
- package/dist/constants/contextWindows.js +35 -4
- package/dist/core/baseProvider.js +5 -3
- package/dist/core/constants.js +59 -1
- 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/models/anthropicModels.d.ts +3 -6
- package/dist/models/anthropicModels.js +97 -123
- package/dist/models/manifestRegistry.d.ts +9 -0
- package/dist/models/manifestRegistry.js +23 -0
- package/dist/models/manifests/anthropic.js +5 -3
- package/dist/models/manifests/azure.js +6 -1
- package/dist/models/modelRegistry.d.ts +22 -2
- package/dist/models/modelRegistry.js +143 -8
- package/dist/music/index.d.ts +6 -3
- package/dist/music/index.js +22 -21
- package/dist/neurolink.js +12 -0
- package/dist/providers/amazonSagemaker.d.ts +1 -1
- package/dist/providers/sagemaker/language-model.d.ts +2 -2
- 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/utils/pricing.js +51 -0
- package/dist/voice/index.d.ts +7 -3
- package/dist/voice/index.js +50 -40
- package/package.json +2 -1
package/dist/voice/index.js
CHANGED
|
@@ -8,12 +8,17 @@
|
|
|
8
8
|
* Use STTProcessor (src/lib/utils/sttProcessor.ts) for STT.
|
|
9
9
|
* Use RealtimeProcessor for realtime voice sessions.
|
|
10
10
|
*
|
|
11
|
-
* Importing this module
|
|
12
|
-
*
|
|
13
|
-
*
|
|
11
|
+
* Importing this module does NOT register any handlers as a side effect.
|
|
12
|
+
* Call `registerDefaultTTSHandlers()` / `registerDefaultSTTHandlers()` /
|
|
13
|
+
* `registerDefaultRealtimeHandlers()` explicitly (or go through
|
|
14
|
+
* `ProviderRegistry.registerAllProviders()`, which every documented
|
|
15
|
+
* `NeuroLink` entry point already calls) to register every shipped handler
|
|
16
|
+
* whose backing API key is present in `process.env`. Registration is
|
|
17
|
+
* idempotent and silently skipped on failure.
|
|
14
18
|
*
|
|
15
19
|
* @module voice
|
|
16
20
|
*/
|
|
21
|
+
import { MEDIA_HANDLER_CATALOG } from "../factories/mediaHandlerCatalog.js";
|
|
17
22
|
import { logger } from "../utils/logger.js";
|
|
18
23
|
import { STTProcessor } from "../utils/sttProcessor.js";
|
|
19
24
|
import { TTSProcessor } from "../utils/ttsProcessor.js";
|
|
@@ -76,37 +81,48 @@ import { GoogleSTT } from "./providers/GoogleSTT.js";
|
|
|
76
81
|
import { OpenAISTT } from "./providers/OpenAISTT.js";
|
|
77
82
|
import { GeminiLive } from "./providers/GeminiLive.js";
|
|
78
83
|
import { OpenAIRealtime } from "./providers/OpenAIRealtime.js";
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
{ name:
|
|
109
|
-
|
|
84
|
+
// Provider names + aliases are the Task-8 catalog's job — only the factory
|
|
85
|
+
// (which needs the imported handler class) stays local to this module.
|
|
86
|
+
const TTS_HANDLER_FACTORIES = {
|
|
87
|
+
// Google TTS doubles as both the AI Studio and Vertex TTS handler.
|
|
88
|
+
"google-ai": () => new GoogleTTSHandler(),
|
|
89
|
+
"openai-tts": () => new OpenAITTS(),
|
|
90
|
+
elevenlabs: () => new ElevenLabsTTS(),
|
|
91
|
+
"azure-tts": () => new AzureTTS(),
|
|
92
|
+
"fish-audio": () => new FishAudioTTS(),
|
|
93
|
+
cartesia: () => new CartesiaTTS(),
|
|
94
|
+
};
|
|
95
|
+
const TTS_HANDLER_CANDIDATES = MEDIA_HANDLER_CATALOG.filter((entry) => entry.kind === "tts").map((entry) => {
|
|
96
|
+
const factory = TTS_HANDLER_FACTORIES[entry.name];
|
|
97
|
+
if (!factory) {
|
|
98
|
+
throw new Error(`[voice/tts] no handler factory for catalog entry "${entry.name}"`);
|
|
99
|
+
}
|
|
100
|
+
return { name: entry.name, aliases: entry.aliases, factory };
|
|
101
|
+
});
|
|
102
|
+
const STT_HANDLER_FACTORIES = {
|
|
103
|
+
whisper: () => new OpenAISTT(),
|
|
104
|
+
deepgram: () => new DeepgramSTT(),
|
|
105
|
+
"google-stt": () => new GoogleSTT(),
|
|
106
|
+
"azure-stt": () => new AzureSTT(),
|
|
107
|
+
};
|
|
108
|
+
const STT_HANDLER_CANDIDATES = MEDIA_HANDLER_CATALOG.filter((entry) => entry.kind === "stt").map((entry) => {
|
|
109
|
+
const factory = STT_HANDLER_FACTORIES[entry.name];
|
|
110
|
+
if (!factory) {
|
|
111
|
+
throw new Error(`[voice/stt] no handler factory for catalog entry "${entry.name}"`);
|
|
112
|
+
}
|
|
113
|
+
return { name: entry.name, aliases: entry.aliases, factory };
|
|
114
|
+
});
|
|
115
|
+
const REALTIME_HANDLER_FACTORIES = {
|
|
116
|
+
"openai-realtime": () => new OpenAIRealtime(),
|
|
117
|
+
"gemini-live": () => new GeminiLive(),
|
|
118
|
+
};
|
|
119
|
+
const REALTIME_HANDLER_CANDIDATES = MEDIA_HANDLER_CATALOG.filter((entry) => entry.kind === "realtime").map((entry) => {
|
|
120
|
+
const factory = REALTIME_HANDLER_FACTORIES[entry.name];
|
|
121
|
+
if (!factory) {
|
|
122
|
+
throw new Error(`[voice/realtime] no handler factory for catalog entry "${entry.name}"`);
|
|
123
|
+
}
|
|
124
|
+
return { name: entry.name, aliases: entry.aliases, factory };
|
|
125
|
+
});
|
|
110
126
|
function registerCandidates(candidates, supports, getRegistered, register, scope, requireConfigured) {
|
|
111
127
|
for (const { name, aliases, factory } of candidates) {
|
|
112
128
|
// Compute missingName / missingAliases separately so a manually-
|
|
@@ -168,9 +184,3 @@ export function registerDefaultSTTHandlers() {
|
|
|
168
184
|
export function registerDefaultRealtimeHandlers() {
|
|
169
185
|
registerCandidates(REALTIME_HANDLER_CANDIDATES, (name) => RealtimeProcessor.supports(name), (name) => RealtimeProcessor.getHandler(name), (name, handler) => RealtimeProcessor.registerHandler(name, handler), "voice/realtime", false);
|
|
170
186
|
}
|
|
171
|
-
// Run once at module import so consumers who follow the documented
|
|
172
|
-
// `nl.generate(...)` flow get every configured handler without manually
|
|
173
|
-
// calling `registerHandler`.
|
|
174
|
-
registerDefaultTTSHandlers();
|
|
175
|
-
registerDefaultSTTHandlers();
|
|
176
|
-
registerDefaultRealtimeHandlers();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "11.
|
|
3
|
+
"version": "11.28.0",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (connect any MCP server), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
|
|
6
6
|
"author": {
|
|
@@ -80,6 +80,7 @@
|
|
|
80
80
|
"test:mcp:cli": "pnpm exec tsx test/continuous-test-suite-mcp-cli.ts",
|
|
81
81
|
"test:mcp:full": "pnpm run test:mcp:infra && pnpm run test:mcp:spans && pnpm run test:mcp:sdk && pnpm run test:mcp:cli && pnpm run test:mcp:http",
|
|
82
82
|
"test:media": "pnpm exec tsx test/continuous-test-suite-media-gen.ts",
|
|
83
|
+
"test:media-registry-collisions": "pnpm exec tsx test/continuous-test-suite-media-registry-collisions.ts",
|
|
83
84
|
"test:memory": "pnpm exec tsx test/continuous-test-suite-memory.ts",
|
|
84
85
|
"test:openai-compat-streaming-retry": "pnpm exec tsx test/continuous-test-suite-openai-compat-streaming-retry.ts",
|
|
85
86
|
"test:anthropic-streaming-retry": "pnpm exec tsx test/continuous-test-suite-anthropic-streaming-retry.ts",
|