@juspay/neurolink 9.26.2 → 9.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 +12 -0
- package/README.md +59 -9
- package/dist/cli/commands/config.d.ts +4 -4
- package/dist/cli/commands/mcp.d.ts +87 -0
- package/dist/cli/commands/mcp.js +1524 -0
- package/dist/cli/loop/optionsSchema.js +4 -0
- package/dist/core/modules/ToolsManager.js +29 -2
- package/dist/index.d.ts +2 -1
- package/dist/index.js +27 -1
- package/dist/lib/core/modules/ToolsManager.js +29 -2
- package/dist/lib/index.d.ts +2 -1
- package/dist/lib/index.js +27 -1
- package/dist/lib/mcp/agentExposure.d.ts +228 -0
- package/dist/lib/mcp/agentExposure.js +357 -0
- package/dist/lib/mcp/batching/index.d.ts +11 -0
- package/dist/lib/mcp/batching/index.js +11 -0
- package/dist/lib/mcp/batching/requestBatcher.d.ts +202 -0
- package/dist/lib/mcp/batching/requestBatcher.js +442 -0
- package/dist/lib/mcp/caching/index.d.ts +11 -0
- package/dist/lib/mcp/caching/index.js +11 -0
- package/dist/lib/mcp/caching/toolCache.d.ts +221 -0
- package/dist/lib/mcp/caching/toolCache.js +434 -0
- package/dist/lib/mcp/elicitation/elicitationManager.d.ts +169 -0
- package/dist/lib/mcp/elicitation/elicitationManager.js +377 -0
- package/dist/lib/mcp/elicitation/index.d.ts +11 -0
- package/dist/lib/mcp/elicitation/index.js +12 -0
- package/dist/lib/mcp/elicitation/types.d.ts +278 -0
- package/dist/lib/mcp/elicitation/types.js +11 -0
- package/dist/lib/mcp/elicitationProtocol.d.ts +228 -0
- package/dist/lib/mcp/elicitationProtocol.js +376 -0
- package/dist/lib/mcp/enhancedToolDiscovery.d.ts +205 -0
- package/dist/lib/mcp/enhancedToolDiscovery.js +482 -0
- package/dist/lib/mcp/index.d.ts +38 -1
- package/dist/lib/mcp/index.js +36 -3
- package/dist/lib/mcp/mcpRegistryClient.d.ts +332 -0
- package/dist/lib/mcp/mcpRegistryClient.js +489 -0
- package/dist/lib/mcp/mcpServerBase.d.ts +227 -0
- package/dist/lib/mcp/mcpServerBase.js +374 -0
- package/dist/lib/mcp/multiServerManager.d.ts +310 -0
- package/dist/lib/mcp/multiServerManager.js +580 -0
- package/dist/lib/mcp/routing/index.d.ts +11 -0
- package/dist/lib/mcp/routing/index.js +11 -0
- package/dist/lib/mcp/routing/toolRouter.d.ts +219 -0
- package/dist/lib/mcp/routing/toolRouter.js +417 -0
- package/dist/lib/mcp/serverCapabilities.d.ts +341 -0
- package/dist/lib/mcp/serverCapabilities.js +503 -0
- package/dist/lib/mcp/toolAnnotations.d.ts +154 -0
- package/dist/lib/mcp/toolAnnotations.js +240 -0
- package/dist/lib/mcp/toolConverter.d.ts +178 -0
- package/dist/lib/mcp/toolConverter.js +259 -0
- package/dist/lib/mcp/toolIntegration.d.ts +136 -0
- package/dist/lib/mcp/toolIntegration.js +335 -0
- package/dist/lib/memory/hippocampusInitializer.d.ts +2 -2
- package/dist/lib/memory/hippocampusInitializer.js +1 -1
- package/dist/lib/neurolink.d.ts +275 -2
- package/dist/lib/neurolink.js +596 -56
- package/dist/lib/providers/litellm.d.ts +10 -0
- package/dist/lib/providers/litellm.js +104 -2
- package/dist/lib/types/configTypes.d.ts +56 -0
- package/dist/lib/types/conversation.d.ts +2 -2
- package/dist/lib/types/generateTypes.d.ts +4 -0
- package/dist/lib/types/index.d.ts +2 -1
- package/dist/lib/types/modelTypes.d.ts +6 -6
- package/dist/lib/types/streamTypes.d.ts +2 -0
- package/dist/lib/types/tools.d.ts +2 -0
- package/dist/lib/utils/pricing.js +177 -17
- package/dist/lib/utils/schemaConversion.d.ts +6 -1
- package/dist/lib/utils/schemaConversion.js +50 -28
- package/dist/lib/workflow/config.d.ts +16 -16
- package/dist/mcp/agentExposure.d.ts +228 -0
- package/dist/mcp/agentExposure.js +356 -0
- package/dist/mcp/batching/index.d.ts +11 -0
- package/dist/mcp/batching/index.js +10 -0
- package/dist/mcp/batching/requestBatcher.d.ts +202 -0
- package/dist/mcp/batching/requestBatcher.js +441 -0
- package/dist/mcp/caching/index.d.ts +11 -0
- package/dist/mcp/caching/index.js +10 -0
- package/dist/mcp/caching/toolCache.d.ts +221 -0
- package/dist/mcp/caching/toolCache.js +433 -0
- package/dist/mcp/elicitation/elicitationManager.d.ts +169 -0
- package/dist/mcp/elicitation/elicitationManager.js +376 -0
- package/dist/mcp/elicitation/index.d.ts +11 -0
- package/dist/mcp/elicitation/index.js +11 -0
- package/dist/mcp/elicitation/types.d.ts +278 -0
- package/dist/mcp/elicitation/types.js +10 -0
- package/dist/mcp/elicitationProtocol.d.ts +228 -0
- package/dist/mcp/elicitationProtocol.js +375 -0
- package/dist/mcp/enhancedToolDiscovery.d.ts +205 -0
- package/dist/mcp/enhancedToolDiscovery.js +481 -0
- package/dist/mcp/index.d.ts +38 -1
- package/dist/mcp/index.js +36 -3
- package/dist/mcp/mcpRegistryClient.d.ts +332 -0
- package/dist/mcp/mcpRegistryClient.js +488 -0
- package/dist/mcp/mcpServerBase.d.ts +227 -0
- package/dist/mcp/mcpServerBase.js +373 -0
- package/dist/mcp/multiServerManager.d.ts +310 -0
- package/dist/mcp/multiServerManager.js +579 -0
- package/dist/mcp/routing/index.d.ts +11 -0
- package/dist/mcp/routing/index.js +10 -0
- package/dist/mcp/routing/toolRouter.d.ts +219 -0
- package/dist/mcp/routing/toolRouter.js +416 -0
- package/dist/mcp/serverCapabilities.d.ts +341 -0
- package/dist/mcp/serverCapabilities.js +502 -0
- package/dist/mcp/toolAnnotations.d.ts +154 -0
- package/dist/mcp/toolAnnotations.js +239 -0
- package/dist/mcp/toolConverter.d.ts +178 -0
- package/dist/mcp/toolConverter.js +258 -0
- package/dist/mcp/toolIntegration.d.ts +136 -0
- package/dist/mcp/toolIntegration.js +334 -0
- package/dist/memory/hippocampusInitializer.d.ts +2 -2
- package/dist/memory/hippocampusInitializer.js +1 -1
- package/dist/neurolink.d.ts +275 -2
- package/dist/neurolink.js +596 -56
- package/dist/providers/litellm.d.ts +10 -0
- package/dist/providers/litellm.js +104 -2
- package/dist/types/configTypes.d.ts +56 -0
- package/dist/types/conversation.d.ts +2 -2
- package/dist/types/generateTypes.d.ts +4 -0
- package/dist/types/index.d.ts +2 -1
- package/dist/types/streamTypes.d.ts +2 -0
- package/dist/types/tools.d.ts +2 -0
- package/dist/utils/pricing.js +177 -17
- package/dist/utils/schemaConversion.d.ts +6 -1
- package/dist/utils/schemaConversion.js +50 -28
- package/package.json +2 -2
|
@@ -93,50 +93,72 @@ export function inlineJsonSchema(schema, definitions, visited = new Set()) {
|
|
|
93
93
|
return result;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
* Convert Zod schema to JSON Schema format for
|
|
96
|
+
* Convert Zod schema to JSON Schema format for provider APIs.
|
|
97
|
+
*
|
|
98
|
+
* Handles three input types:
|
|
99
|
+
* 1. Zod schemas (have `_def.typeName`) — converted via zod-to-json-schema
|
|
100
|
+
* 2. AI SDK `jsonSchema()` wrappers (have `.jsonSchema` property) — extracted directly
|
|
101
|
+
* 3. Plain JSON Schema objects (have `type`/`properties` but no `_def`) — returned as-is
|
|
97
102
|
*/
|
|
98
103
|
export function convertZodToJsonSchema(zodSchema) {
|
|
104
|
+
const schema = zodSchema;
|
|
105
|
+
if (!schema || typeof schema !== "object") {
|
|
106
|
+
return { type: "object", properties: {} };
|
|
107
|
+
}
|
|
108
|
+
// AI SDK jsonSchema() wrapper — extract the inner JSON Schema directly
|
|
109
|
+
if ("jsonSchema" in schema &&
|
|
110
|
+
schema.jsonSchema !== null &&
|
|
111
|
+
typeof schema.jsonSchema === "object") {
|
|
112
|
+
const extracted = schema.jsonSchema;
|
|
113
|
+
return ensureTypeField(extracted);
|
|
114
|
+
}
|
|
115
|
+
// Plain JSON Schema object (from external MCP tools) — no Zod internals
|
|
116
|
+
if (!isZodSchema(schema)) {
|
|
117
|
+
return ensureTypeField(schema);
|
|
118
|
+
}
|
|
119
|
+
// Actual Zod schema — convert via zod-to-json-schema
|
|
99
120
|
try {
|
|
100
|
-
// Use a type assertion that bypasses the infinite recursion check
|
|
101
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
102
121
|
const jsonSchema = zodToJsonSchema(zodSchema, {
|
|
103
122
|
name: "ToolParameters",
|
|
104
123
|
target: "jsonSchema7",
|
|
105
124
|
errorMessages: true,
|
|
106
125
|
});
|
|
107
|
-
//
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
// If no properties, ensure it's at least an empty object schema
|
|
112
|
-
if (!jsonSchema.properties) {
|
|
113
|
-
jsonSchema.properties = {};
|
|
114
|
-
}
|
|
115
|
-
logger.info(`[SCHEMA-TYPE-FIX] Added missing type field to JSON Schema`, {
|
|
116
|
-
originalType: undefined,
|
|
117
|
-
fixedType: jsonSchema.type,
|
|
118
|
-
hasProperties: !!jsonSchema.properties,
|
|
119
|
-
addedEmptyProperties: !jsonSchema.properties,
|
|
120
|
-
});
|
|
121
|
-
}
|
|
122
|
-
logger.debug("Converted Zod schema to JSON Schema", {
|
|
123
|
-
hasProperties: !!jsonSchema.properties,
|
|
124
|
-
propertiesCount: Object.keys(jsonSchema.properties || {}).length,
|
|
125
|
-
schemaType: jsonSchema.type,
|
|
126
|
-
hasTypeField: !!jsonSchema.type,
|
|
127
|
-
});
|
|
128
|
-
return jsonSchema;
|
|
126
|
+
// zodToJsonSchema with 'name' produces { $ref: "#/definitions/ToolParameters", definitions: {...} }
|
|
127
|
+
// Inline the $ref to produce a flat schema before passing to ensureTypeField
|
|
128
|
+
const inlined = inlineJsonSchema(jsonSchema);
|
|
129
|
+
return ensureTypeField(inlined);
|
|
129
130
|
}
|
|
130
131
|
catch (error) {
|
|
131
132
|
logger.warn("Failed to convert Zod schema to JSON Schema", {
|
|
132
133
|
error: error instanceof Error ? error.message : String(error),
|
|
133
134
|
});
|
|
134
|
-
|
|
135
|
-
|
|
135
|
+
return { type: "object", properties: {} };
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Ensure a JSON Schema object has a `type` field (required by Vertex/Gemini).
|
|
140
|
+
*/
|
|
141
|
+
function ensureTypeField(schema) {
|
|
142
|
+
if (!schema.type) {
|
|
143
|
+
// Schemas using composition keywords (anyOf/oneOf/allOf) deliberately omit type
|
|
144
|
+
if (schema.anyOf || schema.oneOf || schema.allOf) {
|
|
145
|
+
return schema;
|
|
146
|
+
}
|
|
147
|
+
const hadProperties = !!schema.properties;
|
|
148
|
+
const result = {
|
|
149
|
+
...schema,
|
|
136
150
|
type: "object",
|
|
137
|
-
properties: {},
|
|
138
151
|
};
|
|
152
|
+
if (!result.properties) {
|
|
153
|
+
result.properties = {};
|
|
154
|
+
}
|
|
155
|
+
logger.debug("[SCHEMA-TYPE-FIX] Added missing type field to JSON Schema", {
|
|
156
|
+
fixedType: "object",
|
|
157
|
+
addedProperties: !hadProperties,
|
|
158
|
+
});
|
|
159
|
+
return result;
|
|
139
160
|
}
|
|
161
|
+
return schema;
|
|
140
162
|
}
|
|
141
163
|
/**
|
|
142
164
|
* Check if a value is a Zod schema
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@juspay/neurolink",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.28.0",
|
|
4
4
|
"description": "Universal AI Development Platform with working MCP integration, multi-provider support, and professional CLI. Built-in tools operational, 58+ external MCP servers discoverable. Connect to filesystem, GitHub, database operations, and more. Build, test, and deploy AI applications with 13 providers: OpenAI, Anthropic, Google AI, AWS Bedrock, Azure, Hugging Face, Ollama, and Mistral AI.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Juspay Technologies",
|
|
@@ -186,7 +186,7 @@
|
|
|
186
186
|
"@google/genai": "^1.34.0",
|
|
187
187
|
"@google/generative-ai": "^0.24.1",
|
|
188
188
|
"@huggingface/inference": "^2.8.1",
|
|
189
|
-
"@juspay/hippocampus": "^0.1.
|
|
189
|
+
"@juspay/hippocampus": "^0.1.3",
|
|
190
190
|
"@langfuse/otel": "^4.2.0",
|
|
191
191
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
192
192
|
"@openrouter/ai-sdk-provider": "^0.7.5",
|