@juspay/neurolink 12.47.14 → 12.48.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.
- package/CHANGELOG.md +2 -2
- package/dist/auth/middleware/AuthMiddleware.d.ts +1 -1
- package/dist/browser/neurolink.min.js +578 -565
- package/dist/cli/factories/commandFactory.d.ts +7 -0
- package/dist/cli/factories/commandFactory.js +26 -0
- package/dist/cli/loop/optionsSchema.js +9 -0
- package/dist/context/budgetChecker.js +54 -2
- package/dist/context/contextDecision.js +2 -0
- package/dist/context/toolPairRepair.d.ts +12 -0
- package/dist/context/toolPairRepair.js +29 -3
- package/dist/core/baseProvider.d.ts +92 -3
- package/dist/core/baseProvider.js +254 -10
- package/dist/core/conversationMemoryManager.js +17 -2
- package/dist/core/loopEngine.js +1 -1
- package/dist/core/modules/MessageBuilder.js +11 -3
- package/dist/core/modules/TelemetryHandler.d.ts +2 -2
- package/dist/core/modules/ToolsManager.d.ts +35 -0
- package/dist/core/modules/ToolsManager.js +159 -55
- package/dist/core/nativeGenerateLoop.d.ts +58 -1
- package/dist/core/nativeGenerateLoop.js +277 -3
- package/dist/core/redisConversationMemoryManager.js +10 -3
- package/dist/core/resolveRequestKind.d.ts +24 -4
- package/dist/core/resolveRequestKind.js +31 -4
- package/dist/core/toolExecutionRecorder.d.ts +6 -0
- package/dist/core/toolExecutionRecorder.js +24 -2
- package/dist/core/toolRoutingDecision.js +1 -0
- package/dist/factories/mediaHandlerCatalog.js +5 -0
- package/dist/factories/providerDescriptors.js +15 -0
- package/dist/files/fileTools.d.ts +1 -1
- package/dist/index.d.ts +5 -2
- package/dist/index.js +9 -2
- package/dist/memory/condensationPrompt.d.ts +8 -0
- package/dist/memory/condensationPrompt.js +29 -0
- package/dist/memory/hippocampusInitializer.d.ts +14 -2
- package/dist/memory/hippocampusInitializer.js +64 -3
- package/dist/neurolink.d.ts +252 -3
- package/dist/neurolink.js +898 -43
- package/dist/providers/amazonBedrock/client.js +6 -0
- package/dist/providers/amazonSagemaker.js +14 -1
- package/dist/providers/anthropic/client.js +148 -19
- package/dist/providers/anthropic/loopAdapter.js +2 -2
- package/dist/providers/googleAiStudio/client.js +2 -1
- package/dist/providers/openaiChatCompletionsBase.js +103 -23
- package/dist/providers/systemOneDecision.d.ts +6 -0
- package/dist/providers/systemOneDecision.js +14 -63
- package/dist/providers/typesafe.d.ts +6 -0
- package/dist/providers/typesafe.js +6 -0
- package/dist/rag/retrieval/searchDecision.js +1 -0
- package/dist/routing/classifierRouter.js +6 -5
- package/dist/routing/classifierStrategies.js +8 -1
- package/dist/types/classifierRouter.d.ts +16 -3
- package/dist/types/common.d.ts +2 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/context.d.ts +8 -1
- package/dist/types/conversation.d.ts +87 -0
- package/dist/types/decision.d.ts +210 -1
- package/dist/types/decision.js +9 -1
- package/dist/types/dispatch.d.ts +11 -4
- package/dist/types/generate.d.ts +118 -54
- package/dist/types/loopEngine.d.ts +7 -2
- package/dist/types/memory.d.ts +177 -9
- package/dist/types/openaiCompatible.d.ts +11 -3
- package/dist/types/stream.d.ts +13 -16
- package/dist/types/stt.d.ts +58 -1
- package/dist/types/tools.d.ts +14 -0
- package/dist/types/tools.js +8 -0
- package/dist/types/tts.d.ts +108 -0
- package/dist/types/voice.d.ts +41 -4
- package/dist/utils/decisionAnswers.d.ts +31 -1
- package/dist/utils/decisionAnswers.js +114 -0
- package/dist/utils/decisionLimits.d.ts +39 -0
- package/dist/utils/decisionLimits.js +116 -0
- package/dist/utils/logger.d.ts +7 -0
- package/dist/utils/logger.js +9 -0
- package/dist/utils/messageBuilder.d.ts +45 -1
- package/dist/utils/messageBuilder.js +393 -16
- package/dist/utils/multimodalOptionsBuilder.d.ts +1 -0
- package/dist/utils/multimodalOptionsBuilder.js +1 -0
- package/dist/utils/speechText.d.ts +41 -0
- package/dist/utils/speechText.js +364 -0
- package/dist/utils/toolResultStatus.d.ts +26 -0
- package/dist/utils/toolResultStatus.js +73 -0
- package/dist/utils/ttsProcessor.d.ts +29 -0
- package/dist/utils/ttsProcessor.js +84 -2
- package/dist/voice/index.d.ts +1 -0
- package/dist/voice/index.js +3 -0
- package/dist/voice/providers/ElevenLabsSTT.d.ts +42 -0
- package/dist/voice/providers/ElevenLabsSTT.js +351 -0
- package/dist/voice/providers/ElevenLabsTTS.d.ts +81 -1
- package/dist/voice/providers/ElevenLabsTTS.js +415 -74
- package/docs-site/static/search-index.json +48 -33
- package/package.json +5 -2
- package/dist/utils/toolEndEmitter.d.ts +0 -25
- package/dist/utils/toolEndEmitter.js +0 -64
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "12.
|
|
3
|
+
"version": "12.48.1",
|
|
4
4
|
"packageManager": "pnpm@10.15.1",
|
|
5
5
|
"description": "The pipe layer of an AI nervous system: one interface connecting provider neurons to your application, across three inference types — generate, stream and decide. `decide` returns typed, calibrated judgements from a non-generative model (~400ms, ~$0.00002/call) for routing, tool selection and context budgeting. MCP-native (4 transports), voice TTS/STT/realtime, RAG, agents, memory, compaction, 9 observability exporters. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · TypeSafe Jev and more.",
|
|
6
6
|
"author": {
|
|
@@ -114,6 +114,9 @@
|
|
|
114
114
|
"test:middleware": "pnpm exec tsx test/continuous-test-suite-middleware.ts",
|
|
115
115
|
"test:stream-middleware": "pnpm exec tsx test/continuous-test-suite-stream-middleware.ts",
|
|
116
116
|
"test:stream-tool-telemetry": "pnpm exec tsx test/continuous-test-suite-stream-tool-telemetry.ts",
|
|
117
|
+
"test:tool-replay": "pnpm exec tsx test/continuous-test-suite-tool-replay.ts",
|
|
118
|
+
"test:memory:hippocampus": "pnpm exec tsx test/continuous-test-suite-memory-hippocampus.ts",
|
|
119
|
+
"test:security-check-filter": "pnpm exec tsx test/continuous-test-suite-security-check-filter.ts",
|
|
117
120
|
"test:stream-teardown-abort": "pnpm exec tsx test/continuous-test-suite-stream-teardown-abort.ts",
|
|
118
121
|
"test:observability": "pnpm exec tsx test/continuous-test-suite-observability.ts",
|
|
119
122
|
"test:ppt": "pnpm exec tsx test/continuous-test-suite-ppt.ts",
|
|
@@ -478,7 +481,7 @@
|
|
|
478
481
|
"zod-to-json-schema": "^3.25.1"
|
|
479
482
|
},
|
|
480
483
|
"peerDependencies": {
|
|
481
|
-
"@juspay/hippocampus": ">=0.1
|
|
484
|
+
"@juspay/hippocampus": ">=0.2.1",
|
|
482
485
|
"@opentelemetry/api": "^1.9.0",
|
|
483
486
|
"@opentelemetry/sdk-trace-node": "^2.6.0",
|
|
484
487
|
"react": ">=18.0.0",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* toolEndEmitter — shared helper for emitting `tool:end` events from
|
|
3
|
-
* AI-SDK `onStepFinish` callbacks.
|
|
4
|
-
*
|
|
5
|
-
* Pipeline B (metrics aggregator) listens for `tool:end` on the NeuroLink
|
|
6
|
-
* EventEmitter. When tools are executed by the AI SDK internally (via
|
|
7
|
-
* `generateText` / `streamText`) the SDK calls `onStepFinish` with the
|
|
8
|
-
* completed tool results. Without this helper those results are silently
|
|
9
|
-
* stored but never surfaced as `tool:end` events, leaving Pipeline B with
|
|
10
|
-
* zero tool spans for AI-SDK-driven tool calls (gaps G5 and S2).
|
|
11
|
-
*
|
|
12
|
-
* @module utils/toolEndEmitter
|
|
13
|
-
*/
|
|
14
|
-
import type { NeuroLinkEvents, StepToolResult, TypedEventEmitter } from "../types/index.js";
|
|
15
|
-
/**
|
|
16
|
-
* Emit a `tool:end` event for every completed tool result in an
|
|
17
|
-
* `onStepFinish` callback.
|
|
18
|
-
*
|
|
19
|
-
* @param emitter - The NeuroLink event emitter (obtained via
|
|
20
|
-
* `neurolink.getEventEmitter()`). When `undefined` the function is a
|
|
21
|
-
* no-op so callers need not guard every call site.
|
|
22
|
-
* @param toolResults - The `toolResults` array from `onStepFinish`. When
|
|
23
|
-
* `undefined` or empty the function is a no-op.
|
|
24
|
-
*/
|
|
25
|
-
export declare function emitToolEndFromStepFinish(emitter: TypedEventEmitter<NeuroLinkEvents> | undefined, toolResults: StepToolResult[] | undefined): void;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* toolEndEmitter — shared helper for emitting `tool:end` events from
|
|
3
|
-
* AI-SDK `onStepFinish` callbacks.
|
|
4
|
-
*
|
|
5
|
-
* Pipeline B (metrics aggregator) listens for `tool:end` on the NeuroLink
|
|
6
|
-
* EventEmitter. When tools are executed by the AI SDK internally (via
|
|
7
|
-
* `generateText` / `streamText`) the SDK calls `onStepFinish` with the
|
|
8
|
-
* completed tool results. Without this helper those results are silently
|
|
9
|
-
* stored but never surfaced as `tool:end` events, leaving Pipeline B with
|
|
10
|
-
* zero tool spans for AI-SDK-driven tool calls (gaps G5 and S2).
|
|
11
|
-
*
|
|
12
|
-
* @module utils/toolEndEmitter
|
|
13
|
-
*/
|
|
14
|
-
import { createToolEventPayload } from "../core/toolEvents.js";
|
|
15
|
-
/**
|
|
16
|
-
* Emit a `tool:end` event for every completed tool result in an
|
|
17
|
-
* `onStepFinish` callback.
|
|
18
|
-
*
|
|
19
|
-
* @param emitter - The NeuroLink event emitter (obtained via
|
|
20
|
-
* `neurolink.getEventEmitter()`). When `undefined` the function is a
|
|
21
|
-
* no-op so callers need not guard every call site.
|
|
22
|
-
* @param toolResults - The `toolResults` array from `onStepFinish`. When
|
|
23
|
-
* `undefined` or empty the function is a no-op.
|
|
24
|
-
*/
|
|
25
|
-
export function emitToolEndFromStepFinish(emitter, toolResults) {
|
|
26
|
-
if (!emitter || !toolResults || toolResults.length === 0) {
|
|
27
|
-
return;
|
|
28
|
-
}
|
|
29
|
-
for (const tr of toolResults) {
|
|
30
|
-
const output = tr.output ?? tr.result;
|
|
31
|
-
const isError = !!tr.error ||
|
|
32
|
-
(output !== null &&
|
|
33
|
-
output !== undefined &&
|
|
34
|
-
typeof output === "object" &&
|
|
35
|
-
"isError" in output &&
|
|
36
|
-
output.isError === true);
|
|
37
|
-
let errorMessage;
|
|
38
|
-
if (isError) {
|
|
39
|
-
if (tr.error) {
|
|
40
|
-
errorMessage = tr.error;
|
|
41
|
-
}
|
|
42
|
-
else if (output && typeof output === "object") {
|
|
43
|
-
const content = output.content;
|
|
44
|
-
if (Array.isArray(content)) {
|
|
45
|
-
const texts = content
|
|
46
|
-
.filter((c) => c.type === "text" && c.text)
|
|
47
|
-
.map((c) => c.text);
|
|
48
|
-
errorMessage =
|
|
49
|
-
texts.length > 0 ? texts.join(" ") : "Tool returned isError: true";
|
|
50
|
-
}
|
|
51
|
-
else {
|
|
52
|
-
errorMessage = "Tool returned isError: true";
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
emitter.emit("tool:end", createToolEventPayload(tr.toolName, {
|
|
57
|
-
responseTime: 0,
|
|
58
|
-
success: !isError,
|
|
59
|
-
timestamp: Date.now(),
|
|
60
|
-
result: output,
|
|
61
|
-
error: errorMessage,
|
|
62
|
-
}));
|
|
63
|
-
}
|
|
64
|
-
}
|