@juspay/neurolink 9.27.0 → 9.28.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 +12 -0
- package/README.md +78 -25
- package/dist/adapters/providerImageAdapter.js +9 -1
- 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/constants/contextWindows.js +18 -7
- package/dist/constants/enums.d.ts +36 -6
- package/dist/constants/enums.js +38 -5
- package/dist/constants/tokens.d.ts +4 -0
- package/dist/constants/tokens.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/adapters/providerImageAdapter.js +9 -1
- package/dist/lib/constants/contextWindows.js +18 -7
- package/dist/lib/constants/enums.d.ts +36 -6
- package/dist/lib/constants/enums.js +38 -5
- package/dist/lib/constants/tokens.d.ts +4 -0
- package/dist/lib/constants/tokens.js +4 -0
- 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/neurolink.d.ts +275 -2
- package/dist/lib/neurolink.js +596 -56
- package/dist/lib/providers/amazonBedrock.js +1 -1
- package/dist/lib/providers/anthropic.js +1 -1
- 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/generateTypes.d.ts +4 -0
- package/dist/lib/types/index.d.ts +1 -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/neurolink.d.ts +275 -2
- package/dist/neurolink.js +596 -56
- package/dist/providers/amazonBedrock.js +1 -1
- package/dist/providers/anthropic.js +1 -1
- 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/generateTypes.d.ts +4 -0
- package/dist/types/index.d.ts +1 -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 +1 -1
|
@@ -58,10 +58,15 @@ export declare enum BedrockModels {
|
|
|
58
58
|
CLAUDE_4_5_HAIKU = "anthropic.claude-haiku-4-5-20251001-v1:0",
|
|
59
59
|
CLAUDE_4_1_OPUS = "anthropic.claude-opus-4-1-20250805-v1:0",
|
|
60
60
|
CLAUDE_4_SONNET = "anthropic.claude-sonnet-4-20250514-v1:0",
|
|
61
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
61
62
|
CLAUDE_3_7_SONNET = "anthropic.claude-3-7-sonnet-20250219-v1:0",
|
|
63
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
62
64
|
CLAUDE_3_5_SONNET = "anthropic.claude-3-5-sonnet-20241022-v1:0",
|
|
65
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
63
66
|
CLAUDE_3_5_HAIKU = "anthropic.claude-3-5-haiku-20241022-v1:0",
|
|
67
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
64
68
|
CLAUDE_3_SONNET = "anthropic.claude-3-sonnet-20240229-v1:0",
|
|
69
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
65
70
|
CLAUDE_3_HAIKU = "anthropic.claude-3-haiku-20240307-v1:0",
|
|
66
71
|
NOVA_PREMIER = "amazon.nova-premier-v1:0",
|
|
67
72
|
NOVA_PRO = "amazon.nova-pro-v1:0",
|
|
@@ -144,6 +149,10 @@ export declare enum BedrockModels {
|
|
|
144
149
|
*/
|
|
145
150
|
export declare enum OpenAIModels {
|
|
146
151
|
GPT_5_3_CODEX = "gpt-5.3-codex",
|
|
152
|
+
GPT_5_4 = "gpt-5.4",
|
|
153
|
+
GPT_5_4_MINI = "gpt-5.4-mini",
|
|
154
|
+
GPT_5_4_NANO = "gpt-5.4-nano",
|
|
155
|
+
GPT_5_4_PRO = "gpt-5.4-pro",
|
|
147
156
|
GPT_5_2 = "gpt-5.2",
|
|
148
157
|
GPT_5_2_CHAT_LATEST = "gpt-5.2-chat-latest",
|
|
149
158
|
GPT_5_2_PRO = "gpt-5.2-pro",
|
|
@@ -171,7 +180,9 @@ export declare enum OpenAIModels {
|
|
|
171
180
|
O3_PRO = "o3-pro",
|
|
172
181
|
O4_MINI = "o4-mini",
|
|
173
182
|
O1 = "o1",
|
|
183
|
+
/** @deprecated Turned off Jul 14, 2025. Use GPT_4_1 or O3. */
|
|
174
184
|
O1_PREVIEW = "o1-preview",
|
|
185
|
+
/** @deprecated Replaced by o3-mini. */
|
|
175
186
|
O1_MINI = "o1-mini",
|
|
176
187
|
GPT_4 = "gpt-4",
|
|
177
188
|
GPT_4_TURBO = "gpt-4-turbo",
|
|
@@ -186,6 +197,9 @@ export declare enum AzureOpenAIModels {
|
|
|
186
197
|
GPT_5_2_CHAT = "gpt-5.2-chat",
|
|
187
198
|
GPT_5_2_PRO = "gpt-5.2-pro",
|
|
188
199
|
GPT_5_2_CODEX = "gpt-5.2-codex",
|
|
200
|
+
GPT_5_4 = "gpt-5.4",
|
|
201
|
+
GPT_5_4_MINI = "gpt-5.4-mini",
|
|
202
|
+
GPT_5_4_NANO = "gpt-5.4-nano",
|
|
189
203
|
GPT_5_1 = "gpt-5.1",
|
|
190
204
|
GPT_5_1_CHAT = "gpt-5.1-chat",
|
|
191
205
|
GPT_5_1_CODEX = "gpt-5.1-codex",
|
|
@@ -228,11 +242,17 @@ export declare enum VertexModels {
|
|
|
228
242
|
CLAUDE_4_5_HAIKU = "claude-haiku-4-5@20251001",
|
|
229
243
|
CLAUDE_4_0_SONNET = "claude-sonnet-4@20250514",
|
|
230
244
|
CLAUDE_4_0_OPUS = "claude-opus-4@20250514",
|
|
245
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
231
246
|
CLAUDE_3_7_SONNET = "claude-3-7-sonnet@20250219",
|
|
247
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
232
248
|
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
249
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
233
250
|
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
251
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
234
252
|
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
253
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
235
254
|
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
255
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
236
256
|
CLAUDE_3_HAIKU = "claude-3-haiku-20240307",
|
|
237
257
|
GEMINI_3_1_PRO = "gemini-3.1-pro",
|
|
238
258
|
GEMINI_3_1_PRO_PREVIEW = "gemini-3.1-pro-preview",
|
|
@@ -253,9 +273,9 @@ export declare enum VertexModels {
|
|
|
253
273
|
GEMINI_2_0_FLASH = "gemini-2.0-flash",
|
|
254
274
|
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
255
275
|
GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite",
|
|
256
|
-
/** @deprecated
|
|
276
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
257
277
|
GEMINI_1_5_PRO = "gemini-1.5-pro-002",
|
|
258
|
-
/** @deprecated
|
|
278
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
259
279
|
GEMINI_1_5_FLASH = "gemini-1.5-flash-002"
|
|
260
280
|
}
|
|
261
281
|
/**
|
|
@@ -277,16 +297,18 @@ export declare enum GoogleAIModels {
|
|
|
277
297
|
GEMINI_2_5_FLASH_IMAGE = "gemini-2.5-flash-image",
|
|
278
298
|
GEMINI_2_5_FLASH_PREVIEW_TTS = "gemini-2.5-flash-preview-tts",
|
|
279
299
|
GEMINI_2_5_PRO_PREVIEW_TTS = "gemini-2.5-pro-preview-tts",
|
|
300
|
+
/** @deprecated Retiring June 1, 2026. Use GEMINI_2_5_FLASH instead. */
|
|
280
301
|
GEMINI_2_0_FLASH = "gemini-2.0-flash",
|
|
281
302
|
GEMINI_2_0_FLASH_001 = "gemini-2.0-flash-001",
|
|
282
303
|
GEMINI_2_0_FLASH_LITE = "gemini-2.0-flash-lite",
|
|
283
304
|
GEMINI_2_0_FLASH_IMAGE = "gemini-2.0-flash-preview-image-generation",
|
|
284
|
-
/** @deprecated
|
|
305
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
285
306
|
GEMINI_1_5_PRO = "gemini-1.5-pro",
|
|
286
|
-
/** @deprecated
|
|
307
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
287
308
|
GEMINI_1_5_FLASH = "gemini-1.5-flash",
|
|
288
309
|
GEMINI_EMBEDDING = "gemini-embedding-001",
|
|
289
|
-
|
|
310
|
+
GEMINI_EMBEDDING_2_PREVIEW = "gemini-embedding-2-preview",
|
|
311
|
+
/** @deprecated SHUT DOWN Jan 14, 2026. Use GEMINI_EMBEDDING instead. */
|
|
290
312
|
TEXT_EMBEDDING_004 = "text-embedding-004"
|
|
291
313
|
}
|
|
292
314
|
/**
|
|
@@ -301,11 +323,17 @@ export declare enum AnthropicModels {
|
|
|
301
323
|
CLAUDE_OPUS_4_1 = "claude-opus-4-1-20250805",
|
|
302
324
|
CLAUDE_OPUS_4_0 = "claude-opus-4-20250514",
|
|
303
325
|
CLAUDE_SONNET_4_0 = "claude-sonnet-4-20250514",
|
|
326
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
304
327
|
CLAUDE_SONNET_3_7 = "claude-3-7-sonnet-20250219",
|
|
328
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
305
329
|
CLAUDE_3_5_SONNET = "claude-3-5-sonnet-20241022",
|
|
330
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
306
331
|
CLAUDE_3_5_HAIKU = "claude-3-5-haiku-20241022",
|
|
332
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
307
333
|
CLAUDE_3_SONNET = "claude-3-sonnet-20240229",
|
|
334
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
308
335
|
CLAUDE_3_OPUS = "claude-3-opus-20240229",
|
|
336
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
309
337
|
CLAUDE_3_HAIKU = "claude-3-haiku-20240307"
|
|
310
338
|
}
|
|
311
339
|
/**
|
|
@@ -341,7 +369,9 @@ export declare enum MistralModels {
|
|
|
341
369
|
MISTRAL_OCR_LATEST = "mistral-ocr-latest",
|
|
342
370
|
MISTRAL_NEMO = "mistral-nemo",
|
|
343
371
|
MISTRAL_EMBED = "mistral-embed",
|
|
344
|
-
MISTRAL_MODERATION_LATEST = "mistral-moderation-latest"
|
|
372
|
+
MISTRAL_MODERATION_LATEST = "mistral-moderation-latest",
|
|
373
|
+
MISTRAL_SMALL_4 = "mistral-small-2603",
|
|
374
|
+
MISTRAL_SMALL_CREATIVE = "mistral-small-creative"
|
|
345
375
|
}
|
|
346
376
|
/**
|
|
347
377
|
* Supported Models for Ollama (Local)
|
|
@@ -78,12 +78,17 @@ export var BedrockModels;
|
|
|
78
78
|
BedrockModels["CLAUDE_4_1_OPUS"] = "anthropic.claude-opus-4-1-20250805-v1:0";
|
|
79
79
|
BedrockModels["CLAUDE_4_SONNET"] = "anthropic.claude-sonnet-4-20250514-v1:0";
|
|
80
80
|
// Claude 3.7 Series
|
|
81
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
81
82
|
BedrockModels["CLAUDE_3_7_SONNET"] = "anthropic.claude-3-7-sonnet-20250219-v1:0";
|
|
82
83
|
// Claude 3.5 Series
|
|
84
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
83
85
|
BedrockModels["CLAUDE_3_5_SONNET"] = "anthropic.claude-3-5-sonnet-20241022-v1:0";
|
|
86
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
84
87
|
BedrockModels["CLAUDE_3_5_HAIKU"] = "anthropic.claude-3-5-haiku-20241022-v1:0";
|
|
85
88
|
// Claude 3 Series (Legacy support)
|
|
89
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
86
90
|
BedrockModels["CLAUDE_3_SONNET"] = "anthropic.claude-3-sonnet-20240229-v1:0";
|
|
91
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
87
92
|
BedrockModels["CLAUDE_3_HAIKU"] = "anthropic.claude-3-haiku-20240307-v1:0";
|
|
88
93
|
// ============================================================================
|
|
89
94
|
// AMAZON NOVA MODELS
|
|
@@ -216,6 +221,11 @@ export var OpenAIModels;
|
|
|
216
221
|
(function (OpenAIModels) {
|
|
217
222
|
// GPT-5.3 Series (Released February 2026) - Latest coding models
|
|
218
223
|
OpenAIModels["GPT_5_3_CODEX"] = "gpt-5.3-codex";
|
|
224
|
+
// GPT-5.4 Series (Released March 2026) - Latest flagship models
|
|
225
|
+
OpenAIModels["GPT_5_4"] = "gpt-5.4";
|
|
226
|
+
OpenAIModels["GPT_5_4_MINI"] = "gpt-5.4-mini";
|
|
227
|
+
OpenAIModels["GPT_5_4_NANO"] = "gpt-5.4-nano";
|
|
228
|
+
OpenAIModels["GPT_5_4_PRO"] = "gpt-5.4-pro";
|
|
219
229
|
// GPT-5.2 Series (Released December 11, 2025) - Flagship models
|
|
220
230
|
OpenAIModels["GPT_5_2"] = "gpt-5.2";
|
|
221
231
|
OpenAIModels["GPT_5_2_CHAT_LATEST"] = "gpt-5.2-chat-latest";
|
|
@@ -250,7 +260,9 @@ export var OpenAIModels;
|
|
|
250
260
|
OpenAIModels["O3_PRO"] = "o3-pro";
|
|
251
261
|
OpenAIModels["O4_MINI"] = "o4-mini";
|
|
252
262
|
OpenAIModels["O1"] = "o1";
|
|
263
|
+
/** @deprecated Turned off Jul 14, 2025. Use GPT_4_1 or O3. */
|
|
253
264
|
OpenAIModels["O1_PREVIEW"] = "o1-preview";
|
|
265
|
+
/** @deprecated Replaced by o3-mini. */
|
|
254
266
|
OpenAIModels["O1_MINI"] = "o1-mini";
|
|
255
267
|
// GPT-4 Series (Legacy)
|
|
256
268
|
OpenAIModels["GPT_4"] = "gpt-4";
|
|
@@ -269,6 +281,10 @@ export var AzureOpenAIModels;
|
|
|
269
281
|
AzureOpenAIModels["GPT_5_2_CHAT"] = "gpt-5.2-chat";
|
|
270
282
|
AzureOpenAIModels["GPT_5_2_PRO"] = "gpt-5.2-pro";
|
|
271
283
|
AzureOpenAIModels["GPT_5_2_CODEX"] = "gpt-5.2-codex";
|
|
284
|
+
// GPT-5.4 Series (March 2026)
|
|
285
|
+
AzureOpenAIModels["GPT_5_4"] = "gpt-5.4";
|
|
286
|
+
AzureOpenAIModels["GPT_5_4_MINI"] = "gpt-5.4-mini";
|
|
287
|
+
AzureOpenAIModels["GPT_5_4_NANO"] = "gpt-5.4-nano";
|
|
272
288
|
// GPT-5.1 Series (October 2025)
|
|
273
289
|
AzureOpenAIModels["GPT_5_1"] = "gpt-5.1";
|
|
274
290
|
AzureOpenAIModels["GPT_5_1_CHAT"] = "gpt-5.1-chat";
|
|
@@ -323,13 +339,19 @@ export var VertexModels;
|
|
|
323
339
|
VertexModels["CLAUDE_4_0_SONNET"] = "claude-sonnet-4@20250514";
|
|
324
340
|
VertexModels["CLAUDE_4_0_OPUS"] = "claude-opus-4@20250514";
|
|
325
341
|
// Claude 3.7 Series (February 2025)
|
|
342
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
326
343
|
VertexModels["CLAUDE_3_7_SONNET"] = "claude-3-7-sonnet@20250219";
|
|
327
344
|
// Claude 3.5 Series (Still supported)
|
|
345
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
328
346
|
VertexModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
347
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
329
348
|
VertexModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
330
349
|
// Claude 3 Series (Legacy support)
|
|
350
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
331
351
|
VertexModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
352
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
332
353
|
VertexModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
354
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_4_6_SONNET instead. */
|
|
333
355
|
VertexModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
334
356
|
// Gemini 3.1 Series (Released March 2026)
|
|
335
357
|
VertexModels["GEMINI_3_1_PRO"] = "gemini-3.1-pro";
|
|
@@ -355,9 +377,9 @@ export var VertexModels;
|
|
|
355
377
|
VertexModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
356
378
|
VertexModels["GEMINI_2_0_FLASH_LITE"] = "gemini-2.0-flash-lite";
|
|
357
379
|
// Gemini 1.5 Series (Retired - returns 404)
|
|
358
|
-
/** @deprecated
|
|
380
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
359
381
|
VertexModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro-002";
|
|
360
|
-
/** @deprecated
|
|
382
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
361
383
|
VertexModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash-002";
|
|
362
384
|
})(VertexModels || (VertexModels = {}));
|
|
363
385
|
/**
|
|
@@ -384,18 +406,20 @@ export var GoogleAIModels;
|
|
|
384
406
|
GoogleAIModels["GEMINI_2_5_FLASH_PREVIEW_TTS"] = "gemini-2.5-flash-preview-tts";
|
|
385
407
|
GoogleAIModels["GEMINI_2_5_PRO_PREVIEW_TTS"] = "gemini-2.5-pro-preview-tts";
|
|
386
408
|
// Gemini 2.0 Series (Deprecated - retiring Jun 2026)
|
|
409
|
+
/** @deprecated Retiring June 1, 2026. Use GEMINI_2_5_FLASH instead. */
|
|
387
410
|
GoogleAIModels["GEMINI_2_0_FLASH"] = "gemini-2.0-flash";
|
|
388
411
|
GoogleAIModels["GEMINI_2_0_FLASH_001"] = "gemini-2.0-flash-001";
|
|
389
412
|
GoogleAIModels["GEMINI_2_0_FLASH_LITE"] = "gemini-2.0-flash-lite";
|
|
390
413
|
GoogleAIModels["GEMINI_2_0_FLASH_IMAGE"] = "gemini-2.0-flash-preview-image-generation";
|
|
391
414
|
// Gemini 1.5 Series (Retired - returns 404)
|
|
392
|
-
/** @deprecated
|
|
415
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
393
416
|
GoogleAIModels["GEMINI_1_5_PRO"] = "gemini-1.5-pro";
|
|
394
|
-
/** @deprecated
|
|
417
|
+
/** @deprecated SHUT DOWN. Returns 404. Use GEMINI_2_5_FLASH or newer. */
|
|
395
418
|
GoogleAIModels["GEMINI_1_5_FLASH"] = "gemini-1.5-flash";
|
|
396
419
|
// Embedding Models
|
|
397
420
|
GoogleAIModels["GEMINI_EMBEDDING"] = "gemini-embedding-001";
|
|
398
|
-
|
|
421
|
+
GoogleAIModels["GEMINI_EMBEDDING_2_PREVIEW"] = "gemini-embedding-2-preview";
|
|
422
|
+
/** @deprecated SHUT DOWN Jan 14, 2026. Use GEMINI_EMBEDDING instead. */
|
|
399
423
|
GoogleAIModels["TEXT_EMBEDDING_004"] = "text-embedding-004";
|
|
400
424
|
})(GoogleAIModels || (GoogleAIModels = {}));
|
|
401
425
|
/**
|
|
@@ -416,13 +440,19 @@ export var AnthropicModels;
|
|
|
416
440
|
AnthropicModels["CLAUDE_OPUS_4_0"] = "claude-opus-4-20250514";
|
|
417
441
|
AnthropicModels["CLAUDE_SONNET_4_0"] = "claude-sonnet-4-20250514";
|
|
418
442
|
// Claude 3.7 Series (Legacy)
|
|
443
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
419
444
|
AnthropicModels["CLAUDE_SONNET_3_7"] = "claude-3-7-sonnet-20250219";
|
|
420
445
|
// Claude 3.5 Series (Legacy)
|
|
446
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
421
447
|
AnthropicModels["CLAUDE_3_5_SONNET"] = "claude-3-5-sonnet-20241022";
|
|
448
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
422
449
|
AnthropicModels["CLAUDE_3_5_HAIKU"] = "claude-3-5-haiku-20241022";
|
|
423
450
|
// Claude 3 Series (Legacy - Deprecated)
|
|
451
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
424
452
|
AnthropicModels["CLAUDE_3_SONNET"] = "claude-3-sonnet-20240229";
|
|
453
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
425
454
|
AnthropicModels["CLAUDE_3_OPUS"] = "claude-3-opus-20240229";
|
|
455
|
+
/** @deprecated Retired from Anthropic API. Use CLAUDE_SONNET_4_6 instead. */
|
|
426
456
|
AnthropicModels["CLAUDE_3_HAIKU"] = "claude-3-haiku-20240307";
|
|
427
457
|
})(AnthropicModels || (AnthropicModels = {}));
|
|
428
458
|
/**
|
|
@@ -474,6 +504,9 @@ export var MistralModels;
|
|
|
474
504
|
MistralModels["MISTRAL_NEMO"] = "mistral-nemo";
|
|
475
505
|
MistralModels["MISTRAL_EMBED"] = "mistral-embed";
|
|
476
506
|
MistralModels["MISTRAL_MODERATION_LATEST"] = "mistral-moderation-latest";
|
|
507
|
+
// Mistral Small 4 Series (June 2026)
|
|
508
|
+
MistralModels["MISTRAL_SMALL_4"] = "mistral-small-2603";
|
|
509
|
+
MistralModels["MISTRAL_SMALL_CREATIVE"] = "mistral-small-creative";
|
|
477
510
|
})(MistralModels || (MistralModels = {}));
|
|
478
511
|
/**
|
|
479
512
|
* Supported Models for Ollama (Local)
|
|
@@ -71,6 +71,10 @@ export declare const PROVIDER_TOKEN_LIMITS: {
|
|
|
71
71
|
};
|
|
72
72
|
/** OpenAI model limits */
|
|
73
73
|
readonly OPENAI: {
|
|
74
|
+
readonly "gpt-5.4": 128000;
|
|
75
|
+
readonly "gpt-5.4-mini": 128000;
|
|
76
|
+
readonly "gpt-5.4-nano": 128000;
|
|
77
|
+
readonly "gpt-5.4-pro": 128000;
|
|
74
78
|
readonly "gpt-4o": 16384;
|
|
75
79
|
readonly "gpt-4o-mini": 16384;
|
|
76
80
|
readonly "gpt-3.5-turbo": 4096;
|
|
@@ -74,6 +74,10 @@ export const PROVIDER_TOKEN_LIMITS = {
|
|
|
74
74
|
},
|
|
75
75
|
/** OpenAI model limits */
|
|
76
76
|
OPENAI: {
|
|
77
|
+
"gpt-5.4": 128_000,
|
|
78
|
+
"gpt-5.4-mini": 128_000,
|
|
79
|
+
"gpt-5.4-nano": 128_000,
|
|
80
|
+
"gpt-5.4-pro": 128_000,
|
|
77
81
|
"gpt-4o": 16384,
|
|
78
82
|
"gpt-4o-mini": 16384,
|
|
79
83
|
"gpt-3.5-turbo": 4096,
|
|
@@ -318,6 +318,32 @@ export class ToolsManager {
|
|
|
318
318
|
const startTime = Date.now();
|
|
319
319
|
let executionId;
|
|
320
320
|
try {
|
|
321
|
+
// Route through NeuroLink.executeTool() when available for MCP enhancement support
|
|
322
|
+
// (cache, middleware, annotations, circuit breaker, routing)
|
|
323
|
+
if (this.toolExecutor) {
|
|
324
|
+
const result = await this.toolExecutor(toolName, params);
|
|
325
|
+
const convertedResult = this.utilities?.convertToolResult
|
|
326
|
+
? await this.utilities.convertToolResult(result)
|
|
327
|
+
: result;
|
|
328
|
+
const endTime = Date.now();
|
|
329
|
+
customToolSpan.setAttribute("tool.duration_ms", endTime - startTime);
|
|
330
|
+
let errorResult = undefined;
|
|
331
|
+
if (convertedResult &&
|
|
332
|
+
typeof convertedResult === "object" &&
|
|
333
|
+
"isError" in convertedResult &&
|
|
334
|
+
convertedResult.isError) {
|
|
335
|
+
try {
|
|
336
|
+
errorResult = JSON.stringify(convertedResult);
|
|
337
|
+
}
|
|
338
|
+
catch (error) {
|
|
339
|
+
logger.error(`Failed to serialize error result for ${toolName}`, error);
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
customToolSpan.setAttribute("tool.result.status", errorResult ? "error" : "success");
|
|
343
|
+
customToolSpan.setStatus({ code: SpanStatusCode.OK });
|
|
344
|
+
return convertedResult;
|
|
345
|
+
}
|
|
346
|
+
// Fallback: direct execution (standalone usage without NeuroLink SDK)
|
|
321
347
|
if (this.neurolink?.emitToolStart) {
|
|
322
348
|
executionId = this.neurolink.emitToolStart(toolName, params, startTime);
|
|
323
349
|
}
|
|
@@ -350,8 +376,9 @@ export class ToolsManager {
|
|
|
350
376
|
catch (error) {
|
|
351
377
|
const endTime = Date.now();
|
|
352
378
|
const errorMsg = error instanceof Error ? error.message : String(error);
|
|
353
|
-
// Emit tool end event (error)
|
|
354
|
-
|
|
379
|
+
// Emit tool end event (error) — only for fallback path
|
|
380
|
+
// When toolExecutor is used, executeTool() handles event emission
|
|
381
|
+
if (!this.toolExecutor && this.neurolink?.emitToolEnd) {
|
|
355
382
|
this.neurolink.emitToolEnd(toolName, undefined, // no result
|
|
356
383
|
errorMsg, startTime, endTime, executionId);
|
|
357
384
|
logger.debug(`Custom tool error: ${toolName} (${endTime - startTime}ms)`, { error: errorMsg });
|
package/dist/lib/index.d.ts
CHANGED
|
@@ -200,7 +200,8 @@ export declare function createBestAIProvider(requestedProvider?: string, modelNa
|
|
|
200
200
|
* await writeFile('output.txt', 'Hello from MCP!');
|
|
201
201
|
* ```
|
|
202
202
|
*/
|
|
203
|
-
export { CircuitBreakerManager, calculateExpiresAt, createMCPServer, createOAuthProviderFromConfig, DEFAULT_HTTP_RETRY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, executeMCP, FileTokenStorage, getMCPStats, getServerInfo, globalCircuitBreakerManager, globalRateLimiterManager, HTTPRateLimiter, InMemoryTokenStorage, initializeMCPEcosystem, isRetryableHTTPError, isRetryableStatusCode, isTokenExpired, listMCPs, MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry, } from "./mcp/index.js";
|
|
203
|
+
export { CircuitBreakerManager, calculateExpiresAt, createMCPServer, createOAuthProviderFromConfig, DEFAULT_HTTP_RETRY_CONFIG, DEFAULT_RATE_LIMIT_CONFIG, executeMCP, FileTokenStorage, getMCPStats, getServerInfo, globalCircuitBreakerManager, globalRateLimiterManager, HTTPRateLimiter, InMemoryTokenStorage, initializeMCPEcosystem, isRetryableHTTPError, isRetryableStatusCode, isTokenExpired, listMCPs, MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry, MCPToolRegistry, ExternalServerManager, MCPClientFactory, ToolRouter, createToolRouter, DEFAULT_ROUTER_CONFIG, ToolCache, createToolCache, DEFAULT_CACHE_CONFIG, ToolResultCache, createToolResultCache, RequestBatcher, ToolCallBatcher, createRequestBatcher, createToolCallBatcher, DEFAULT_BATCH_CONFIG, inferAnnotations, createAnnotatedTool, validateAnnotations, filterToolsByAnnotations, mergeAnnotations, getAnnotationSummary, requiresConfirmation, isSafeToRetry, getToolSafetyLevel, ElicitationManager, globalElicitationManager, EnhancedToolDiscovery, MCPRegistryClient, globalMCPRegistryClient, getWellKnownServer, getAllWellKnownServers, MCPServerBase, MultiServerManager, globalMultiServerManager, AgentExposureManager, exposeAgentAsTool, exposeAgentsAsTools, exposeWorkflowAsTool, exposeWorkflowsAsTools, globalAgentExposureManager, ServerCapabilitiesManager, createTextResource, createJsonResource, createPrompt, neuroLinkToolToMCP, mcpToolToNeuroLink, batchConvertToMCP, batchConvertToNeuroLink, sanitizeToolName, validateToolName, createToolFromFunction, mcpProtocolToolToServerTool, serverToolToMCPProtocol, TOOL_COMPATIBILITY, ToolIntegrationManager, globalToolIntegrationManager, wrapToolWithElicitation, wrapToolsWithElicitation, createElicitationContext, confirmationMiddleware, validationMiddleware, loggingMiddleware, createRetryMiddleware, createTimeoutMiddleware, createToolMiddlewareChain, ElicitationProtocolAdapter, globalElicitationProtocol, isElicitationProtocolMessage, protocolMessageToElicitation, elicitationResponseToProtocol, createElicitationRequest, createElicitationResponse, createElicitationCancel, createTextInputRequest, createSelectRequest, createConfirmationRequest, createFormRequest, } from "./mcp/index.js";
|
|
204
|
+
export type { RoutingStrategy, ToolRouterConfig, RoutingDecision, MCPTool, ToolRouterEvents, AffinityRule, CategoryMapping, RouterServerWeight, CacheStrategy, CacheConfig as MCPCacheConfig, CacheStats, CacheEvents, BatchConfig, BatchResult, BatchExecutor, BatcherEvents, MCPToolAnnotations, MCPServerTool, ToolConverterOptions, MCPProtocolTool, NeuroLinkTool, ToolMiddleware, EnhancedExecutionContext, ToolWrapperOptions, ExposableAgent, ExposableWorkflow, ExposureOptions, ExposureResult, MCPResource, MCPPrompt, ServerCapabilitiesConfig, PromptGenerator, PromptMessage, PromptResult, RegisteredPrompt, RegisteredResource, ResourceContent, ResourceReader, ResourceSubscriptionCallback, RegistryEntry, RegistrySearchOptions, RegistrySearchResult, RegistrySourceType, RegistryConfig, MCPRegistryClientConfig, LoadBalancingStrategy, ServerGroup, UnifiedTool, MultiServerManagerConfig, ServerWeight, MCPServerBaseConfig, MCPServerEvents, EnhancedToolInfo, ToolSearchCriteria, ToolSearchResult, CompatibilityCheckResult, ElicitationType, Elicitation, ElicitationResponse, ElicitationHandler, ElicitationManagerConfig, ElicitationRequest, ElicitationContext, TextElicitation, SelectElicitation, SelectOption, MultiSelectElicitation, ConfirmationElicitation, FileElicitation, SecretElicitation, FormElicitation, FormField, ElicitationProtocolMessage, ElicitationProtocolMessageType, ElicitationProtocolPayload, ElicitationProtocolHandler, ElicitationProtocolAdapterConfig, ElicitationRequestMessage, ElicitationRequestParams, ElicitationResponseMessage, ElicitationResponseParams, ElicitationCancelMessage, ElicitationCancelParams, } from "./mcp/index.js";
|
|
204
205
|
export type { AuthorizationUrlResult, DiscoveredMcp, HTTPRetryConfig, MCPOAuthConfig, McpMetadata, OAuthClientInformation, OAuthTokens as McpOAuthTokens, RateLimitConfig, TokenExchangeRequest, TokenStorage, } from "./types/mcpTypes.js";
|
|
205
206
|
export type { ExecutionContext, ToolExecutionResult, ToolInfo, } from "./types/tools.js";
|
|
206
207
|
export type { LogLevel } from "./types/utilities.js";
|
package/dist/lib/index.js
CHANGED
|
@@ -237,7 +237,33 @@ InMemoryTokenStorage,
|
|
|
237
237
|
// Simplified MCP exports
|
|
238
238
|
initializeMCPEcosystem, isRetryableHTTPError, isRetryableStatusCode, isTokenExpired, listMCPs,
|
|
239
239
|
// Circuit Breaker
|
|
240
|
-
MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry,
|
|
240
|
+
MCPCircuitBreaker, mcpLogger, NeuroLinkOAuthProvider, RateLimiterManager, validateServerTools, validateTool as validateMCPTool, withHTTPRetry,
|
|
241
|
+
// Core MCP Components
|
|
242
|
+
MCPToolRegistry, ExternalServerManager, MCPClientFactory,
|
|
243
|
+
// MCP Enhancements - Routing, Caching, Batching
|
|
244
|
+
ToolRouter, createToolRouter, DEFAULT_ROUTER_CONFIG, ToolCache, createToolCache, DEFAULT_CACHE_CONFIG, ToolResultCache, createToolResultCache, RequestBatcher, ToolCallBatcher, createRequestBatcher, createToolCallBatcher, DEFAULT_BATCH_CONFIG,
|
|
245
|
+
// MCP Enhancements - Tool Annotations
|
|
246
|
+
inferAnnotations, createAnnotatedTool, validateAnnotations, filterToolsByAnnotations, mergeAnnotations, getAnnotationSummary, requiresConfirmation, isSafeToRetry, getToolSafetyLevel,
|
|
247
|
+
// MCP Enhancements - Elicitation
|
|
248
|
+
ElicitationManager, globalElicitationManager,
|
|
249
|
+
// MCP Enhancements - Enhanced Tool Discovery
|
|
250
|
+
EnhancedToolDiscovery,
|
|
251
|
+
// MCP Enhancements - Registry Client
|
|
252
|
+
MCPRegistryClient, globalMCPRegistryClient, getWellKnownServer, getAllWellKnownServers,
|
|
253
|
+
// MCP Enhancements - Server Base
|
|
254
|
+
MCPServerBase,
|
|
255
|
+
// MCP Enhancements - Multi-Server Manager
|
|
256
|
+
MultiServerManager, globalMultiServerManager,
|
|
257
|
+
// MCP Enhancements - Agent Exposure
|
|
258
|
+
AgentExposureManager, exposeAgentAsTool, exposeAgentsAsTools, exposeWorkflowAsTool, exposeWorkflowsAsTools, globalAgentExposureManager,
|
|
259
|
+
// MCP Enhancements - Server Capabilities
|
|
260
|
+
ServerCapabilitiesManager, createTextResource, createJsonResource, createPrompt,
|
|
261
|
+
// MCP Enhancements - Tool Converter
|
|
262
|
+
neuroLinkToolToMCP, mcpToolToNeuroLink, batchConvertToMCP, batchConvertToNeuroLink, sanitizeToolName, validateToolName, createToolFromFunction, mcpProtocolToolToServerTool, serverToolToMCPProtocol, TOOL_COMPATIBILITY,
|
|
263
|
+
// MCP Enhancements - Tool Integration
|
|
264
|
+
ToolIntegrationManager, globalToolIntegrationManager, wrapToolWithElicitation, wrapToolsWithElicitation, createElicitationContext, confirmationMiddleware, validationMiddleware, loggingMiddleware, createRetryMiddleware, createTimeoutMiddleware, createToolMiddlewareChain,
|
|
265
|
+
// MCP Enhancements - Elicitation Protocol
|
|
266
|
+
ElicitationProtocolAdapter, globalElicitationProtocol, isElicitationProtocolMessage, protocolMessageToElicitation, elicitationResponseToProtocol, createElicitationRequest, createElicitationResponse, createElicitationCancel, createTextInputRequest, createSelectRequest, createConfirmationRequest, createFormRequest, } from "./mcp/index.js";
|
|
241
267
|
export { logger } from "./utils/logger.js";
|
|
242
268
|
export { getPoolStats } from "./utils/redis.js";
|
|
243
269
|
// ============================================================================
|
|
@@ -0,0 +1,228 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agent and Workflow Exposure as MCP Tools
|
|
3
|
+
*
|
|
4
|
+
* Enables exposing NeuroLink agents and workflows as MCP tools,
|
|
5
|
+
* allowing external MCP clients to invoke complex AI operations
|
|
6
|
+
* through the standardized MCP protocol.
|
|
7
|
+
*
|
|
8
|
+
* @module mcp/agentExposure
|
|
9
|
+
* @since 8.39.0
|
|
10
|
+
*/
|
|
11
|
+
import type { JsonObject } from "../types/common.js";
|
|
12
|
+
import type { NeuroLinkExecutionContext } from "../types/mcpTypes.js";
|
|
13
|
+
import type { MCPServerTool, MCPToolAnnotations } from "./toolAnnotations.js";
|
|
14
|
+
/**
|
|
15
|
+
* Agent definition for MCP exposure
|
|
16
|
+
*/
|
|
17
|
+
export type ExposableAgent = {
|
|
18
|
+
/**
|
|
19
|
+
* Unique agent identifier
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
/**
|
|
23
|
+
* Human-readable agent name
|
|
24
|
+
*/
|
|
25
|
+
name: string;
|
|
26
|
+
/**
|
|
27
|
+
* Agent description for AI models
|
|
28
|
+
*/
|
|
29
|
+
description: string;
|
|
30
|
+
/**
|
|
31
|
+
* Input schema for the agent
|
|
32
|
+
*/
|
|
33
|
+
inputSchema?: JsonObject;
|
|
34
|
+
/**
|
|
35
|
+
* Output schema for the agent
|
|
36
|
+
*/
|
|
37
|
+
outputSchema?: JsonObject;
|
|
38
|
+
/**
|
|
39
|
+
* Agent execution function
|
|
40
|
+
*/
|
|
41
|
+
execute: (input: unknown, context?: NeuroLinkExecutionContext) => Promise<unknown>;
|
|
42
|
+
/**
|
|
43
|
+
* Additional agent metadata
|
|
44
|
+
*/
|
|
45
|
+
metadata?: {
|
|
46
|
+
version?: string;
|
|
47
|
+
author?: string;
|
|
48
|
+
category?: string;
|
|
49
|
+
tags?: string[];
|
|
50
|
+
estimatedDuration?: number;
|
|
51
|
+
costHint?: number;
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
/**
|
|
55
|
+
* Workflow definition for MCP exposure
|
|
56
|
+
*/
|
|
57
|
+
export type ExposableWorkflow = {
|
|
58
|
+
/**
|
|
59
|
+
* Unique workflow identifier
|
|
60
|
+
*/
|
|
61
|
+
id: string;
|
|
62
|
+
/**
|
|
63
|
+
* Human-readable workflow name
|
|
64
|
+
*/
|
|
65
|
+
name: string;
|
|
66
|
+
/**
|
|
67
|
+
* Workflow description
|
|
68
|
+
*/
|
|
69
|
+
description: string;
|
|
70
|
+
/**
|
|
71
|
+
* Workflow steps (for documentation)
|
|
72
|
+
*/
|
|
73
|
+
steps?: Array<{
|
|
74
|
+
id: string;
|
|
75
|
+
name: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
}>;
|
|
78
|
+
/**
|
|
79
|
+
* Input schema for the workflow
|
|
80
|
+
*/
|
|
81
|
+
inputSchema?: JsonObject;
|
|
82
|
+
/**
|
|
83
|
+
* Output schema for the workflow
|
|
84
|
+
*/
|
|
85
|
+
outputSchema?: JsonObject;
|
|
86
|
+
/**
|
|
87
|
+
* Workflow execution function
|
|
88
|
+
*/
|
|
89
|
+
execute: (input: unknown, context?: NeuroLinkExecutionContext) => Promise<unknown>;
|
|
90
|
+
/**
|
|
91
|
+
* Workflow metadata
|
|
92
|
+
*/
|
|
93
|
+
metadata?: {
|
|
94
|
+
version?: string;
|
|
95
|
+
author?: string;
|
|
96
|
+
category?: string;
|
|
97
|
+
tags?: string[];
|
|
98
|
+
estimatedDuration?: number;
|
|
99
|
+
retriable?: boolean;
|
|
100
|
+
idempotent?: boolean;
|
|
101
|
+
};
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* Options for exposing agents/workflows as MCP tools
|
|
105
|
+
*/
|
|
106
|
+
export type ExposureOptions = {
|
|
107
|
+
/**
|
|
108
|
+
* Prefix for tool names
|
|
109
|
+
*/
|
|
110
|
+
prefix?: string;
|
|
111
|
+
/**
|
|
112
|
+
* Default annotations for all exposed tools
|
|
113
|
+
*/
|
|
114
|
+
defaultAnnotations?: MCPToolAnnotations;
|
|
115
|
+
/**
|
|
116
|
+
* Whether to include metadata in tool description
|
|
117
|
+
*/
|
|
118
|
+
includeMetadataInDescription?: boolean;
|
|
119
|
+
/**
|
|
120
|
+
* Custom name transformer
|
|
121
|
+
*/
|
|
122
|
+
nameTransformer?: (name: string) => string;
|
|
123
|
+
/**
|
|
124
|
+
* Add execution context wrapper
|
|
125
|
+
*/
|
|
126
|
+
wrapWithContext?: boolean;
|
|
127
|
+
/**
|
|
128
|
+
* Timeout for agent/workflow execution (ms)
|
|
129
|
+
*/
|
|
130
|
+
executionTimeout?: number;
|
|
131
|
+
/**
|
|
132
|
+
* Enable execution logging
|
|
133
|
+
*/
|
|
134
|
+
enableLogging?: boolean;
|
|
135
|
+
};
|
|
136
|
+
/**
|
|
137
|
+
* Exposure result
|
|
138
|
+
*/
|
|
139
|
+
export type ExposureResult = {
|
|
140
|
+
/**
|
|
141
|
+
* Generated MCP tool
|
|
142
|
+
*/
|
|
143
|
+
tool: MCPServerTool;
|
|
144
|
+
/**
|
|
145
|
+
* Original source type
|
|
146
|
+
*/
|
|
147
|
+
sourceType: "agent" | "workflow";
|
|
148
|
+
/**
|
|
149
|
+
* Original source ID
|
|
150
|
+
*/
|
|
151
|
+
sourceId: string;
|
|
152
|
+
/**
|
|
153
|
+
* Generated tool name
|
|
154
|
+
*/
|
|
155
|
+
toolName: string;
|
|
156
|
+
};
|
|
157
|
+
/**
|
|
158
|
+
* Expose an agent as an MCP tool
|
|
159
|
+
*/
|
|
160
|
+
export declare function exposeAgentAsTool(agent: ExposableAgent, options?: ExposureOptions): ExposureResult;
|
|
161
|
+
/**
|
|
162
|
+
* Expose a workflow as an MCP tool
|
|
163
|
+
*/
|
|
164
|
+
export declare function exposeWorkflowAsTool(workflow: ExposableWorkflow, options?: ExposureOptions): ExposureResult;
|
|
165
|
+
/**
|
|
166
|
+
* Batch expose agents as MCP tools
|
|
167
|
+
*/
|
|
168
|
+
export declare function exposeAgentsAsTools(agents: ExposableAgent[], options?: ExposureOptions): ExposureResult[];
|
|
169
|
+
/**
|
|
170
|
+
* Batch expose workflows as MCP tools
|
|
171
|
+
*/
|
|
172
|
+
export declare function exposeWorkflowsAsTools(workflows: ExposableWorkflow[], options?: ExposureOptions): ExposureResult[];
|
|
173
|
+
/**
|
|
174
|
+
* Agent Exposure Manager
|
|
175
|
+
*
|
|
176
|
+
* Manages the lifecycle of exposed agents and workflows,
|
|
177
|
+
* providing registration, lookup, and invocation capabilities.
|
|
178
|
+
*/
|
|
179
|
+
export declare class AgentExposureManager {
|
|
180
|
+
private exposedTools;
|
|
181
|
+
private options;
|
|
182
|
+
constructor(options?: ExposureOptions);
|
|
183
|
+
/**
|
|
184
|
+
* Expose an agent and register it
|
|
185
|
+
*/
|
|
186
|
+
exposeAgent(agent: ExposableAgent): MCPServerTool;
|
|
187
|
+
/**
|
|
188
|
+
* Expose a workflow and register it
|
|
189
|
+
*/
|
|
190
|
+
exposeWorkflow(workflow: ExposableWorkflow): MCPServerTool;
|
|
191
|
+
/**
|
|
192
|
+
* Get all exposed tools
|
|
193
|
+
*/
|
|
194
|
+
getExposedTools(): MCPServerTool[];
|
|
195
|
+
/**
|
|
196
|
+
* Get exposed tool by name
|
|
197
|
+
*/
|
|
198
|
+
getExposedTool(toolName: string): MCPServerTool | undefined;
|
|
199
|
+
/**
|
|
200
|
+
* Get exposure result by tool name
|
|
201
|
+
*/
|
|
202
|
+
getExposureResult(toolName: string): ExposureResult | undefined;
|
|
203
|
+
/**
|
|
204
|
+
* Get tools by source type
|
|
205
|
+
*/
|
|
206
|
+
getToolsBySourceType(sourceType: "agent" | "workflow"): MCPServerTool[];
|
|
207
|
+
/**
|
|
208
|
+
* Remove exposed tool
|
|
209
|
+
*/
|
|
210
|
+
unexpose(toolName: string): boolean;
|
|
211
|
+
/**
|
|
212
|
+
* Clear all exposed tools
|
|
213
|
+
*/
|
|
214
|
+
clear(): void;
|
|
215
|
+
/**
|
|
216
|
+
* Get statistics
|
|
217
|
+
*/
|
|
218
|
+
getStatistics(): {
|
|
219
|
+
totalExposed: number;
|
|
220
|
+
exposedAgents: number;
|
|
221
|
+
exposedWorkflows: number;
|
|
222
|
+
toolNames: string[];
|
|
223
|
+
};
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* Global agent exposure manager instance
|
|
227
|
+
*/
|
|
228
|
+
export declare const globalAgentExposureManager: AgentExposureManager;
|