@juspay/neurolink 10.4.1 → 10.4.3
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 +12 -0
- package/dist/browser/neurolink.min.js +386 -389
- package/dist/cli/commands/proxy.d.ts +1 -1
- package/dist/cli/commands/proxy.js +124 -56
- package/dist/cli/commands/proxyAnalyze.js +10 -1
- package/dist/lib/providers/anthropic.js +18 -1
- package/dist/lib/providers/googleAiStudio.js +18 -1
- package/dist/lib/providers/googleNativeGemini3.d.ts +19 -1
- package/dist/lib/providers/googleNativeGemini3.js +61 -4
- package/dist/lib/providers/googleVertex.d.ts +48 -0
- package/dist/lib/providers/googleVertex.js +204 -108
- package/dist/lib/providers/openaiChatCompletionsBase.js +34 -2
- package/dist/lib/providers/openaiChatCompletionsClient.d.ts +11 -5
- package/dist/lib/providers/openaiChatCompletionsClient.js +14 -8
- package/dist/lib/proxy/proxyAnalysis.js +136 -12
- package/dist/lib/proxy/requestLogger.d.ts +2 -0
- package/dist/lib/proxy/requestLogger.js +72 -13
- package/dist/lib/proxy/rollingProxyServer.js +79 -8
- package/dist/lib/proxy/rollingWorkerProcess.js +20 -15
- package/dist/lib/proxy/rollingWorkerProtocol.js +3 -0
- package/dist/lib/proxy/rollingWorkerSupervisor.d.ts +1 -0
- package/dist/lib/proxy/rollingWorkerSupervisor.js +31 -11
- package/dist/lib/proxy/runtimeConfig.d.ts +1 -0
- package/dist/lib/proxy/runtimeConfig.js +20 -5
- package/dist/lib/proxy/socketWorkerRuntime.js +41 -13
- package/dist/lib/server/routes/claudeProxyRoutes.js +63 -75
- package/dist/lib/tools/toolDiscovery.d.ts +25 -3
- package/dist/lib/tools/toolDiscovery.js +76 -4
- package/dist/lib/types/proxy.d.ts +31 -1
- package/dist/lib/types/toolResolution.d.ts +10 -0
- package/dist/providers/anthropic.js +18 -1
- package/dist/providers/googleAiStudio.js +18 -1
- package/dist/providers/googleNativeGemini3.d.ts +19 -1
- package/dist/providers/googleNativeGemini3.js +61 -4
- package/dist/providers/googleVertex.d.ts +48 -0
- package/dist/providers/googleVertex.js +204 -108
- package/dist/providers/openaiChatCompletionsBase.js +34 -2
- package/dist/providers/openaiChatCompletionsClient.d.ts +11 -5
- package/dist/providers/openaiChatCompletionsClient.js +14 -8
- package/dist/proxy/proxyAnalysis.js +136 -12
- package/dist/proxy/requestLogger.d.ts +2 -0
- package/dist/proxy/requestLogger.js +72 -13
- package/dist/proxy/rollingProxyServer.js +79 -8
- package/dist/proxy/rollingWorkerProcess.js +20 -15
- package/dist/proxy/rollingWorkerProtocol.js +3 -0
- package/dist/proxy/rollingWorkerSupervisor.d.ts +1 -0
- package/dist/proxy/rollingWorkerSupervisor.js +31 -11
- package/dist/proxy/runtimeConfig.d.ts +1 -0
- package/dist/proxy/runtimeConfig.js +20 -5
- package/dist/proxy/socketWorkerRuntime.js +41 -13
- package/dist/server/routes/claudeProxyRoutes.js +63 -75
- package/dist/tools/toolDiscovery.d.ts +25 -3
- package/dist/tools/toolDiscovery.js +76 -4
- package/dist/types/proxy.d.ts +31 -1
- package/dist/types/toolResolution.d.ts +10 -0
- package/package.json +1 -1
package/dist/types/proxy.d.ts
CHANGED
|
@@ -1121,6 +1121,7 @@ export type ProxyAnalysisAccount = {
|
|
|
1121
1121
|
unclassifiedRateLimits: number;
|
|
1122
1122
|
};
|
|
1123
1123
|
/** Offline report generated from proxy request, attempt, and lifecycle logs. */
|
|
1124
|
+
export type ProxyAnalysisStreamName = "lifecycle" | "requests" | "attempts" | "debug";
|
|
1124
1125
|
export type ProxyAnalysisReport = {
|
|
1125
1126
|
generatedAt: string;
|
|
1126
1127
|
since: string;
|
|
@@ -1129,6 +1130,7 @@ export type ProxyAnalysisReport = {
|
|
|
1129
1130
|
lifecycle: number;
|
|
1130
1131
|
requests: number;
|
|
1131
1132
|
attempts: number;
|
|
1133
|
+
debug: number;
|
|
1132
1134
|
};
|
|
1133
1135
|
coverage: {
|
|
1134
1136
|
lifecycle: boolean;
|
|
@@ -1143,6 +1145,20 @@ export type ProxyAnalysisReport = {
|
|
|
1143
1145
|
unsupportedLifecycleLines: number;
|
|
1144
1146
|
lifecycleSequenceGaps: number;
|
|
1145
1147
|
lifecycleSequenceDuplicates: number;
|
|
1148
|
+
streams: Record<ProxyAnalysisStreamName, {
|
|
1149
|
+
observedFrom: string | null;
|
|
1150
|
+
observedTo: string | null;
|
|
1151
|
+
startsAtOrBeforeRequestedWindow: boolean;
|
|
1152
|
+
}>;
|
|
1153
|
+
bodyArtifacts: {
|
|
1154
|
+
capturesIndexed: number;
|
|
1155
|
+
artifactsReferenced: number;
|
|
1156
|
+
artifactsPresent: number;
|
|
1157
|
+
artifactsMissing: number;
|
|
1158
|
+
invalidPaths: number;
|
|
1159
|
+
writeFailures: number;
|
|
1160
|
+
truncatedCaptures: number;
|
|
1161
|
+
};
|
|
1146
1162
|
};
|
|
1147
1163
|
lifecycle: {
|
|
1148
1164
|
accepted: number;
|
|
@@ -1392,6 +1408,7 @@ export type StoredBodyArtifact = {
|
|
|
1392
1408
|
storedFileBytes?: number;
|
|
1393
1409
|
redactedBody?: string;
|
|
1394
1410
|
bodyTruncated?: boolean;
|
|
1411
|
+
bodyWriteFailed?: boolean;
|
|
1395
1412
|
};
|
|
1396
1413
|
/** File the proxy logger tracks for rotation and cleanup. */
|
|
1397
1414
|
export type ManagedLogFile = {
|
|
@@ -1653,6 +1670,11 @@ export type ProxyWorkerStatusMessage = {
|
|
|
1653
1670
|
generation: number;
|
|
1654
1671
|
pid: number;
|
|
1655
1672
|
socketId: string;
|
|
1673
|
+
} | {
|
|
1674
|
+
type: "proxy-worker:replacement-requested";
|
|
1675
|
+
generation: number;
|
|
1676
|
+
pid: number;
|
|
1677
|
+
reason: "environment";
|
|
1656
1678
|
};
|
|
1657
1679
|
export type ProxyWorkerSocketMessage = {
|
|
1658
1680
|
type: "proxy-worker:socket";
|
|
@@ -1661,6 +1683,8 @@ export type ProxyWorkerSocketMessage = {
|
|
|
1661
1683
|
};
|
|
1662
1684
|
export type ProxyWorkerIpcMessage = ProxyWorkerControlMessage | ProxyWorkerStatusMessage | ProxyWorkerSocketMessage;
|
|
1663
1685
|
export type TransferableProxySocket = Pick<import("node:net").Socket, "destroy" | "end" | "pause" | "resume" | "once">;
|
|
1686
|
+
/** A transferred socket whose temporary handoff listeners can be detached. */
|
|
1687
|
+
export type DetachableTransferableProxySocket = TransferableProxySocket & Pick<import("node:net").Socket, "off">;
|
|
1664
1688
|
export type RollingWorkerHandle = {
|
|
1665
1689
|
pid: number;
|
|
1666
1690
|
sendControl: (message: ProxyWorkerControlMessage) => void;
|
|
@@ -1714,6 +1738,11 @@ export type RollingWorkerSupervisorOptions = {
|
|
|
1714
1738
|
socketQueueTimeoutMs?: number;
|
|
1715
1739
|
shutdownTimeoutMs?: number;
|
|
1716
1740
|
onStateChange?: (snapshot: RollingWorkerSupervisorSnapshot) => void;
|
|
1741
|
+
onReplacementRequested?: (request: {
|
|
1742
|
+
generation: number;
|
|
1743
|
+
pid: number;
|
|
1744
|
+
reason: "environment";
|
|
1745
|
+
}) => void;
|
|
1717
1746
|
log?: (message: string) => void;
|
|
1718
1747
|
};
|
|
1719
1748
|
export type RollingProxyServerOptions = {
|
|
@@ -1854,6 +1883,7 @@ export type ProxyRuntimeConfigReloadResult = {
|
|
|
1854
1883
|
applied: boolean;
|
|
1855
1884
|
changed: boolean;
|
|
1856
1885
|
generation: number;
|
|
1886
|
+
environmentChanged?: boolean;
|
|
1857
1887
|
error?: string;
|
|
1858
1888
|
};
|
|
1859
1889
|
/** Safe runtime configuration diagnostics exposed through proxy status. */
|
|
@@ -1933,7 +1963,7 @@ export type StatusStats = {
|
|
|
1933
1963
|
transientRateLimits?: number;
|
|
1934
1964
|
quotaRateLimits?: number;
|
|
1935
1965
|
cooling: boolean;
|
|
1936
|
-
status?: "active" | "cooling" | "disabled" | "excluded" | "removed";
|
|
1966
|
+
status?: "active" | "cooling" | "disabled" | "excluded" | "removed" | "unattributed";
|
|
1937
1967
|
}[];
|
|
1938
1968
|
persistence?: ProxyStatsPersistenceStatus;
|
|
1939
1969
|
};
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* `BaseProvider` that every generate/stream path passes through.
|
|
9
9
|
*/
|
|
10
10
|
import type { ToolConfig } from "./config.js";
|
|
11
|
+
import type { Tool } from "./tools.js";
|
|
11
12
|
/**
|
|
12
13
|
* The resolved, merged tool policy for one request. Produced by
|
|
13
14
|
* `resolveToolPolicy()` (src/lib/tools/toolPolicy.ts) and consumed by
|
|
@@ -71,3 +72,12 @@ export type DeferredToolIndexEntry = {
|
|
|
71
72
|
/** Originating MCP server id, when known. */
|
|
72
73
|
serverId?: string;
|
|
73
74
|
};
|
|
75
|
+
/**
|
|
76
|
+
* Resolver attached (under a symbol key, invisible to enumeration) to the
|
|
77
|
+
* hot tool record by `partitionToolsForDiscovery`. Given a deferred tool's
|
|
78
|
+
* name it hydrates that tool into the record, persists the session pin, and
|
|
79
|
+
* returns it — `undefined` when the name is not in the deferred catalog.
|
|
80
|
+
* Native agent loops call it on a dispatch miss so a model that calls a
|
|
81
|
+
* cataloged tool directly (without `search_tools` first) still succeeds.
|
|
82
|
+
*/
|
|
83
|
+
export type DeferredToolResolver = (name: string) => Tool | undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "10.4.
|
|
3
|
+
"version": "10.4.3",
|
|
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": {
|