@juspay/neurolink 11.12.0 → 11.13.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.
Files changed (1921) hide show
  1. package/CHANGELOG.md +13 -3
  2. package/dist/browser/neurolink.min.js +681 -842
  3. package/dist/cli/commands/agent.js +2 -2
  4. package/dist/cli/commands/auth.d.ts +1 -1
  5. package/dist/cli/commands/auth.js +11 -11
  6. package/dist/cli/commands/authProviders.d.ts +1 -1
  7. package/dist/cli/commands/authProviders.js +2 -2
  8. package/dist/cli/commands/autoresearch.js +5 -5
  9. package/dist/cli/commands/config.d.ts +1 -1
  10. package/dist/cli/commands/config.js +4 -4
  11. package/dist/cli/commands/docs.d.ts +1 -1
  12. package/dist/cli/commands/evaluate.d.ts +1 -1
  13. package/dist/cli/commands/evaluate.js +4 -4
  14. package/dist/cli/commands/mcp.js +14 -14
  15. package/dist/cli/commands/models.js +3 -3
  16. package/dist/cli/commands/observability.d.ts +1 -1
  17. package/dist/cli/commands/observability.js +3 -3
  18. package/dist/cli/commands/ollama.js +1 -1
  19. package/dist/cli/commands/proxy.d.ts +2 -2
  20. package/dist/cli/commands/proxy.js +87 -45
  21. package/dist/cli/commands/proxyAnalyze.d.ts +1 -1
  22. package/dist/cli/commands/proxyAnalyze.js +12 -3
  23. package/dist/cli/commands/proxyReplay.d.ts +1 -1
  24. package/dist/cli/commands/proxyReplay.js +2 -2
  25. package/dist/cli/commands/rag.js +10 -10
  26. package/dist/cli/commands/serve.js +7 -7
  27. package/dist/cli/commands/server.js +6 -6
  28. package/dist/cli/commands/setup-anthropic.d.ts +1 -1
  29. package/dist/cli/commands/setup-anthropic.js +3 -3
  30. package/dist/cli/commands/setup-azure.d.ts +1 -1
  31. package/dist/cli/commands/setup-azure.js +3 -3
  32. package/dist/cli/commands/setup-bedrock.d.ts +1 -1
  33. package/dist/cli/commands/setup-bedrock.js +3 -3
  34. package/dist/cli/commands/setup-gcp.d.ts +1 -1
  35. package/dist/cli/commands/setup-gcp.js +1 -1
  36. package/dist/cli/commands/setup-google-ai.d.ts +1 -1
  37. package/dist/cli/commands/setup-google-ai.js +4 -4
  38. package/dist/cli/commands/setup-huggingface.d.ts +1 -1
  39. package/dist/cli/commands/setup-huggingface.js +1 -1
  40. package/dist/cli/commands/setup-mistral.d.ts +1 -1
  41. package/dist/cli/commands/setup-mistral.js +3 -3
  42. package/dist/cli/commands/setup-openai.d.ts +1 -1
  43. package/dist/cli/commands/setup-openai.js +3 -3
  44. package/dist/cli/commands/setup.d.ts +1 -1
  45. package/dist/cli/commands/setup.js +4 -4
  46. package/dist/cli/commands/task.js +4 -4
  47. package/dist/cli/commands/telemetry.d.ts +1 -1
  48. package/dist/cli/commands/telemetry.js +4 -4
  49. package/dist/cli/commands/voiceServer.d.ts +1 -1
  50. package/dist/cli/commands/voiceServer.js +6 -2
  51. package/dist/cli/commands/workflow.js +5 -5
  52. package/dist/cli/errorHandler.js +3 -3
  53. package/dist/cli/factories/commandFactory.js +13 -13
  54. package/dist/cli/factories/ollamaCommandFactory.js +3 -3
  55. package/dist/cli/factories/sagemakerCommandFactory.js +5 -5
  56. package/dist/cli/index.js +1 -1
  57. package/dist/cli/loop/conversationSelector.d.ts +1 -1
  58. package/dist/cli/loop/conversationSelector.js +3 -3
  59. package/dist/cli/loop/optionsSchema.d.ts +1 -1
  60. package/dist/cli/loop/optionsSchema.js +1 -1
  61. package/dist/cli/loop/session.d.ts +1 -1
  62. package/dist/cli/loop/session.js +6 -6
  63. package/dist/cli/parser.js +5 -2
  64. package/dist/cli/proxy-clients/claudeCode.d.ts +1 -1
  65. package/dist/cli/proxy-clients/claudeCode.js +43 -11
  66. package/dist/cli/proxy-clients/codex.d.ts +1 -1
  67. package/dist/cli/proxy-clients/codex.js +1 -1
  68. package/dist/cli/proxy-clients/copilot.d.ts +1 -1
  69. package/dist/cli/proxy-clients/copilot.js +1 -1
  70. package/dist/cli/proxy-clients/openCode.d.ts +1 -1
  71. package/dist/cli/proxy-clients/openCode.js +38 -16
  72. package/dist/cli/proxy-clients/qwenCode.d.ts +1 -1
  73. package/dist/cli/proxy-clients/qwenCode.js +34 -10
  74. package/dist/cli/proxy-clients/registry.d.ts +1 -1
  75. package/dist/cli/proxy-clients/registry.js +10 -2
  76. package/dist/cli/proxy-clients/snapshot.d.ts +52 -0
  77. package/dist/cli/proxy-clients/snapshot.js +98 -0
  78. package/dist/cli/utils/audioFileUtils.d.ts +1 -1
  79. package/dist/cli/utils/audioPlayer.d.ts +1 -1
  80. package/dist/cli/utils/classifierRouterFlags.d.ts +1 -1
  81. package/dist/cli/utils/classifierRouterFlags.js +1 -1
  82. package/dist/cli/utils/completeSetup.d.ts +1 -1
  83. package/dist/cli/utils/completeSetup.js +1 -1
  84. package/dist/cli/utils/envManager.d.ts +1 -1
  85. package/dist/cli/utils/envManager.js +1 -1
  86. package/dist/cli/utils/inputValidation.js +2 -2
  87. package/dist/cli/utils/interactiveSetup.d.ts +2 -2
  88. package/dist/cli/utils/interactiveSetup.js +3 -3
  89. package/dist/cli/utils/ollamaUtils.d.ts +1 -1
  90. package/dist/cli/utils/ollamaUtils.js +1 -1
  91. package/dist/cli/utils/skillsFlags.d.ts +1 -1
  92. package/dist/cli/utils/toolRoutingFlags.d.ts +1 -1
  93. package/dist/cli/utils/toolRoutingFlags.js +1 -1
  94. package/dist/cli/utils/videoFileUtils.d.ts +1 -1
  95. package/dist/processors/data/XmlProcessor.d.ts +14 -0
  96. package/dist/processors/data/XmlProcessor.js +14 -0
  97. package/dist/processors/document/PptxProcessor.d.ts +9 -0
  98. package/dist/processors/document/PptxProcessor.js +9 -0
  99. package/dist/processors/media/VideoProcessor.js +30 -2
  100. package/dist/providers/amazonBedrock/client.js +1 -2
  101. package/dist/providers/googleAiStudio/client.js +6 -3
  102. package/dist/providers/googleVertex/client.js +6 -3
  103. package/dist/providers/googleVertex/index.d.ts +0 -1
  104. package/dist/providers/googleVertex/index.js +0 -1
  105. package/dist/proxy/codexUsage.d.ts +68 -0
  106. package/dist/proxy/codexUsage.js +246 -0
  107. package/dist/proxy/proxyAnalysis.js +87 -3
  108. package/dist/proxy/proxyFetch.d.ts +1 -0
  109. package/dist/proxy/proxyFetch.js +29 -0
  110. package/dist/proxy/proxyTracer.d.ts +13 -2
  111. package/dist/proxy/proxyTracer.js +29 -7
  112. package/dist/proxy/proxyTranslationEngine.js +22 -5
  113. package/dist/rag/document/loaders.js +49 -21
  114. package/dist/server/abstract/baseServerAdapter.d.ts +13 -0
  115. package/dist/server/abstract/baseServerAdapter.js +39 -1
  116. package/dist/server/adapters/expressAdapter.js +15 -5
  117. package/dist/server/adapters/fastifyAdapter.js +15 -5
  118. package/dist/server/adapters/koaAdapter.js +16 -6
  119. package/dist/server/routes/codexProxyRoutes.js +29 -1
  120. package/dist/server/routes/openaiProxyRoutes.js +5 -0
  121. package/dist/types/generate.d.ts +7 -0
  122. package/dist/types/proxy.d.ts +65 -0
  123. package/dist/types/stream.d.ts +1 -1
  124. package/dist/utils/pricing.d.ts +9 -0
  125. package/dist/utils/pricing.js +136 -1
  126. package/docs-site/mcp-server/search.js +20 -12
  127. package/docs-site/mcp-server/types.d.ts +12 -5
  128. package/docs-site/static/search-index.json +1 -0
  129. package/package.json +5 -6
  130. package/dist/lib/action/actionExecutor.d.ts +0 -29
  131. package/dist/lib/action/actionExecutor.js +0 -291
  132. package/dist/lib/action/actionInputs.d.ts +0 -25
  133. package/dist/lib/action/actionInputs.js +0 -294
  134. package/dist/lib/action/githubIntegration.d.ts +0 -21
  135. package/dist/lib/action/githubIntegration.js +0 -188
  136. package/dist/lib/action/index.d.ts +0 -7
  137. package/dist/lib/action/index.js +0 -13
  138. package/dist/lib/adapters/audioFormatSupport.d.ts +0 -53
  139. package/dist/lib/adapters/audioFormatSupport.js +0 -201
  140. package/dist/lib/adapters/imageFormatSupport.d.ts +0 -75
  141. package/dist/lib/adapters/imageFormatSupport.js +0 -284
  142. package/dist/lib/adapters/providerImageAdapter.d.ts +0 -51
  143. package/dist/lib/adapters/providerImageAdapter.js +0 -704
  144. package/dist/lib/adapters/replicate/auth.d.ts +0 -19
  145. package/dist/lib/adapters/replicate/auth.js +0 -33
  146. package/dist/lib/adapters/replicate/predictionLifecycle.d.ts +0 -46
  147. package/dist/lib/adapters/replicate/predictionLifecycle.js +0 -289
  148. package/dist/lib/adapters/tts/cartesiaHandler.d.ts +0 -12
  149. package/dist/lib/adapters/tts/cartesiaHandler.js +0 -131
  150. package/dist/lib/adapters/tts/googleTTSHandler.d.ts +0 -97
  151. package/dist/lib/adapters/tts/googleTTSHandler.js +0 -353
  152. package/dist/lib/adapters/video/directorPipeline.d.ts +0 -31
  153. package/dist/lib/adapters/video/directorPipeline.js +0 -523
  154. package/dist/lib/adapters/video/ffmpegAdapter.d.ts +0 -84
  155. package/dist/lib/adapters/video/ffmpegAdapter.js +0 -207
  156. package/dist/lib/adapters/video/frameExtractor.d.ts +0 -28
  157. package/dist/lib/adapters/video/frameExtractor.js +0 -144
  158. package/dist/lib/adapters/video/klingVideoHandler.d.ts +0 -37
  159. package/dist/lib/adapters/video/klingVideoHandler.js +0 -306
  160. package/dist/lib/adapters/video/replicateVideoHandler.d.ts +0 -29
  161. package/dist/lib/adapters/video/replicateVideoHandler.js +0 -168
  162. package/dist/lib/adapters/video/runwayVideoHandler.d.ts +0 -32
  163. package/dist/lib/adapters/video/runwayVideoHandler.js +0 -317
  164. package/dist/lib/adapters/video/vertexVideoHandler.d.ts +0 -119
  165. package/dist/lib/adapters/video/vertexVideoHandler.js +0 -804
  166. package/dist/lib/adapters/video/videoAnalyzer.d.ts +0 -26
  167. package/dist/lib/adapters/video/videoAnalyzer.js +0 -239
  168. package/dist/lib/adapters/video/videoMerger.d.ts +0 -22
  169. package/dist/lib/adapters/video/videoMerger.js +0 -172
  170. package/dist/lib/agent/agent.d.ts +0 -104
  171. package/dist/lib/agent/agent.js +0 -433
  172. package/dist/lib/agent/agentNetwork.d.ts +0 -87
  173. package/dist/lib/agent/agentNetwork.js +0 -501
  174. package/dist/lib/agent/agentToolRegistrar.d.ts +0 -48
  175. package/dist/lib/agent/agentToolRegistrar.js +0 -337
  176. package/dist/lib/agent/communication/index.d.ts +0 -9
  177. package/dist/lib/agent/communication/index.js +0 -10
  178. package/dist/lib/agent/communication/message-bus.d.ts +0 -113
  179. package/dist/lib/agent/communication/message-bus.js +0 -407
  180. package/dist/lib/agent/coordination/coordinator.d.ts +0 -83
  181. package/dist/lib/agent/coordination/coordinator.js +0 -599
  182. package/dist/lib/agent/coordination/index.d.ts +0 -10
  183. package/dist/lib/agent/coordination/index.js +0 -11
  184. package/dist/lib/agent/coordination/task-distributor.d.ts +0 -113
  185. package/dist/lib/agent/coordination/task-distributor.js +0 -586
  186. package/dist/lib/agent/directTools.d.ts +0 -306
  187. package/dist/lib/agent/directTools.js +0 -907
  188. package/dist/lib/agent/index.d.ts +0 -41
  189. package/dist/lib/agent/index.js +0 -49
  190. package/dist/lib/agent/isolatedAgentRunner.d.ts +0 -73
  191. package/dist/lib/agent/isolatedAgentRunner.js +0 -947
  192. package/dist/lib/agent/orchestration/index.d.ts +0 -10
  193. package/dist/lib/agent/orchestration/index.js +0 -11
  194. package/dist/lib/agent/orchestration/orchestrator.d.ts +0 -114
  195. package/dist/lib/agent/orchestration/orchestrator.js +0 -479
  196. package/dist/lib/agent/orchestration/topology.d.ts +0 -164
  197. package/dist/lib/agent/orchestration/topology.js +0 -521
  198. package/dist/lib/agent/prompts/routingPrompts.d.ts +0 -63
  199. package/dist/lib/agent/prompts/routingPrompts.js +0 -202
  200. package/dist/lib/agent/structuredRecovery.d.ts +0 -30
  201. package/dist/lib/agent/structuredRecovery.js +0 -105
  202. package/dist/lib/analytics/index.d.ts +0 -7
  203. package/dist/lib/analytics/index.js +0 -8
  204. package/dist/lib/analytics/parseQualityScore.d.ts +0 -9
  205. package/dist/lib/analytics/parseQualityScore.js +0 -30
  206. package/dist/lib/analytics/pricing.d.ts +0 -27
  207. package/dist/lib/analytics/pricing.js +0 -42
  208. package/dist/lib/analytics/service.d.ts +0 -36
  209. package/dist/lib/analytics/service.js +0 -394
  210. package/dist/lib/analytics/storage.d.ts +0 -19
  211. package/dist/lib/analytics/storage.js +0 -33
  212. package/dist/lib/artifacts/artifactStore.d.ts +0 -55
  213. package/dist/lib/artifacts/artifactStore.js +0 -145
  214. package/dist/lib/auth/AuthProviderFactory.d.ts +0 -69
  215. package/dist/lib/auth/AuthProviderFactory.js +0 -112
  216. package/dist/lib/auth/AuthProviderRegistry.d.ts +0 -33
  217. package/dist/lib/auth/AuthProviderRegistry.js +0 -191
  218. package/dist/lib/auth/RequestContext.d.ts +0 -23
  219. package/dist/lib/auth/RequestContext.js +0 -79
  220. package/dist/lib/auth/accountPool.d.ts +0 -68
  221. package/dist/lib/auth/accountPool.js +0 -179
  222. package/dist/lib/auth/anthropicOAuth.d.ts +0 -400
  223. package/dist/lib/auth/anthropicOAuth.js +0 -1143
  224. package/dist/lib/auth/authContext.d.ts +0 -198
  225. package/dist/lib/auth/authContext.js +0 -315
  226. package/dist/lib/auth/codexOAuth.d.ts +0 -67
  227. package/dist/lib/auth/codexOAuth.js +0 -203
  228. package/dist/lib/auth/errors.d.ts +0 -63
  229. package/dist/lib/auth/errors.js +0 -40
  230. package/dist/lib/auth/index.d.ts +0 -41
  231. package/dist/lib/auth/index.js +0 -86
  232. package/dist/lib/auth/middleware/AuthMiddleware.d.ts +0 -127
  233. package/dist/lib/auth/middleware/AuthMiddleware.js +0 -523
  234. package/dist/lib/auth/middleware/rateLimitByUser.d.ts +0 -193
  235. package/dist/lib/auth/middleware/rateLimitByUser.js +0 -559
  236. package/dist/lib/auth/providers/BaseAuthProvider.d.ts +0 -259
  237. package/dist/lib/auth/providers/BaseAuthProvider.js +0 -724
  238. package/dist/lib/auth/providers/CognitoProvider.d.ts +0 -61
  239. package/dist/lib/auth/providers/CognitoProvider.js +0 -308
  240. package/dist/lib/auth/providers/KeycloakProvider.d.ts +0 -61
  241. package/dist/lib/auth/providers/KeycloakProvider.js +0 -396
  242. package/dist/lib/auth/providers/auth0.d.ts +0 -59
  243. package/dist/lib/auth/providers/auth0.js +0 -275
  244. package/dist/lib/auth/providers/betterAuth.d.ts +0 -51
  245. package/dist/lib/auth/providers/betterAuth.js +0 -183
  246. package/dist/lib/auth/providers/clerk.d.ts +0 -65
  247. package/dist/lib/auth/providers/clerk.js +0 -318
  248. package/dist/lib/auth/providers/custom.d.ts +0 -64
  249. package/dist/lib/auth/providers/custom.js +0 -113
  250. package/dist/lib/auth/providers/firebase.d.ts +0 -63
  251. package/dist/lib/auth/providers/firebase.js +0 -231
  252. package/dist/lib/auth/providers/jwt.d.ts +0 -68
  253. package/dist/lib/auth/providers/jwt.js +0 -217
  254. package/dist/lib/auth/providers/oauth2.d.ts +0 -73
  255. package/dist/lib/auth/providers/oauth2.js +0 -304
  256. package/dist/lib/auth/providers/supabase.d.ts +0 -63
  257. package/dist/lib/auth/providers/supabase.js +0 -260
  258. package/dist/lib/auth/providers/workos.d.ts +0 -61
  259. package/dist/lib/auth/providers/workos.js +0 -289
  260. package/dist/lib/auth/serverBridge.d.ts +0 -14
  261. package/dist/lib/auth/serverBridge.js +0 -26
  262. package/dist/lib/auth/sessionManager.d.ts +0 -118
  263. package/dist/lib/auth/sessionManager.js +0 -511
  264. package/dist/lib/auth/tokenStore.d.ts +0 -283
  265. package/dist/lib/auth/tokenStore.js +0 -929
  266. package/dist/lib/autoresearch/config.d.ts +0 -11
  267. package/dist/lib/autoresearch/config.js +0 -109
  268. package/dist/lib/autoresearch/errors.d.ts +0 -40
  269. package/dist/lib/autoresearch/errors.js +0 -21
  270. package/dist/lib/autoresearch/index.d.ts +0 -23
  271. package/dist/lib/autoresearch/index.js +0 -35
  272. package/dist/lib/autoresearch/phasePolicy.d.ts +0 -9
  273. package/dist/lib/autoresearch/phasePolicy.js +0 -70
  274. package/dist/lib/autoresearch/promptCompiler.d.ts +0 -15
  275. package/dist/lib/autoresearch/promptCompiler.js +0 -121
  276. package/dist/lib/autoresearch/repoPolicy.d.ts +0 -32
  277. package/dist/lib/autoresearch/repoPolicy.js +0 -129
  278. package/dist/lib/autoresearch/resultRecorder.d.ts +0 -20
  279. package/dist/lib/autoresearch/resultRecorder.js +0 -131
  280. package/dist/lib/autoresearch/runner.d.ts +0 -10
  281. package/dist/lib/autoresearch/runner.js +0 -109
  282. package/dist/lib/autoresearch/stateStore.d.ts +0 -12
  283. package/dist/lib/autoresearch/stateStore.js +0 -164
  284. package/dist/lib/autoresearch/summaryParser.d.ts +0 -16
  285. package/dist/lib/autoresearch/summaryParser.js +0 -95
  286. package/dist/lib/autoresearch/tools.d.ts +0 -27
  287. package/dist/lib/autoresearch/tools.js +0 -618
  288. package/dist/lib/autoresearch/worker.d.ts +0 -71
  289. package/dist/lib/autoresearch/worker.js +0 -418
  290. package/dist/lib/avatar/index.d.ts +0 -26
  291. package/dist/lib/avatar/index.js +0 -86
  292. package/dist/lib/avatar/providers/DIDAvatar.d.ts +0 -49
  293. package/dist/lib/avatar/providers/DIDAvatar.js +0 -502
  294. package/dist/lib/avatar/providers/HeyGenAvatar.d.ts +0 -30
  295. package/dist/lib/avatar/providers/HeyGenAvatar.js +0 -338
  296. package/dist/lib/avatar/providers/ReplicateAvatar.d.ts +0 -36
  297. package/dist/lib/avatar/providers/ReplicateAvatar.js +0 -268
  298. package/dist/lib/client/aiSdkAdapter.d.ts +0 -196
  299. package/dist/lib/client/aiSdkAdapter.js +0 -498
  300. package/dist/lib/client/auth.d.ts +0 -248
  301. package/dist/lib/client/auth.js +0 -469
  302. package/dist/lib/client/errors.d.ts +0 -298
  303. package/dist/lib/client/errors.js +0 -553
  304. package/dist/lib/client/httpClient.d.ts +0 -296
  305. package/dist/lib/client/httpClient.js +0 -851
  306. package/dist/lib/client/index.d.ts +0 -103
  307. package/dist/lib/client/index.js +0 -174
  308. package/dist/lib/client/interceptors.d.ts +0 -207
  309. package/dist/lib/client/interceptors.js +0 -620
  310. package/dist/lib/client/reactHooks.d.ts +0 -238
  311. package/dist/lib/client/reactHooks.js +0 -1168
  312. package/dist/lib/client/sseClient.d.ts +0 -115
  313. package/dist/lib/client/sseClient.js +0 -575
  314. package/dist/lib/client/streamingClient.d.ts +0 -255
  315. package/dist/lib/client/streamingClient.js +0 -963
  316. package/dist/lib/client/wsClient.d.ts +0 -127
  317. package/dist/lib/client/wsClient.js +0 -450
  318. package/dist/lib/config/configManager.d.ts +0 -60
  319. package/dist/lib/config/configManager.js +0 -304
  320. package/dist/lib/config/conversationMemory.d.ts +0 -51
  321. package/dist/lib/config/conversationMemory.js +0 -87
  322. package/dist/lib/config/modelSpecificPrompts.d.ts +0 -9
  323. package/dist/lib/config/modelSpecificPrompts.js +0 -39
  324. package/dist/lib/config/taskClassificationConfig.d.ts +0 -51
  325. package/dist/lib/config/taskClassificationConfig.js +0 -149
  326. package/dist/lib/constants/contextWindows.d.ts +0 -89
  327. package/dist/lib/constants/contextWindows.js +0 -568
  328. package/dist/lib/constants/enums.d.ts +0 -979
  329. package/dist/lib/constants/enums.js +0 -1247
  330. package/dist/lib/constants/index.d.ts +0 -184
  331. package/dist/lib/constants/index.js +0 -209
  332. package/dist/lib/constants/networkErrorCodes.d.ts +0 -14
  333. package/dist/lib/constants/networkErrorCodes.js +0 -22
  334. package/dist/lib/constants/performance.d.ts +0 -366
  335. package/dist/lib/constants/performance.js +0 -390
  336. package/dist/lib/constants/retry.d.ts +0 -224
  337. package/dist/lib/constants/retry.js +0 -267
  338. package/dist/lib/constants/timeouts.d.ts +0 -225
  339. package/dist/lib/constants/timeouts.js +0 -183
  340. package/dist/lib/constants/tokens.d.ts +0 -294
  341. package/dist/lib/constants/tokens.js +0 -381
  342. package/dist/lib/constants/videoErrors.d.ts +0 -49
  343. package/dist/lib/constants/videoErrors.js +0 -51
  344. package/dist/lib/context/anthropicLoopGuard.d.ts +0 -47
  345. package/dist/lib/context/anthropicLoopGuard.js +0 -186
  346. package/dist/lib/context/budgetChecker.d.ts +0 -33
  347. package/dist/lib/context/budgetChecker.js +0 -132
  348. package/dist/lib/context/contextCompactor.d.ts +0 -19
  349. package/dist/lib/context/contextCompactor.js +0 -258
  350. package/dist/lib/context/effectiveHistory.d.ts +0 -52
  351. package/dist/lib/context/effectiveHistory.js +0 -106
  352. package/dist/lib/context/emergencyTruncation.d.ts +0 -21
  353. package/dist/lib/context/emergencyTruncation.js +0 -89
  354. package/dist/lib/context/errorDetection.d.ts +0 -36
  355. package/dist/lib/context/errorDetection.js +0 -190
  356. package/dist/lib/context/errors.d.ts +0 -19
  357. package/dist/lib/context/errors.js +0 -22
  358. package/dist/lib/context/fileSummarizationService.d.ts +0 -45
  359. package/dist/lib/context/fileSummarizationService.js +0 -256
  360. package/dist/lib/context/fileSummarizer.d.ts +0 -55
  361. package/dist/lib/context/fileSummarizer.js +0 -146
  362. package/dist/lib/context/fileTokenBudget.d.ts +0 -52
  363. package/dist/lib/context/fileTokenBudget.js +0 -128
  364. package/dist/lib/context/geminiLoopGuard.d.ts +0 -54
  365. package/dist/lib/context/geminiLoopGuard.js +0 -141
  366. package/dist/lib/context/loopGuardCore.d.ts +0 -43
  367. package/dist/lib/context/loopGuardCore.js +0 -146
  368. package/dist/lib/context/openaiCompatLoopGuard.d.ts +0 -42
  369. package/dist/lib/context/openaiCompatLoopGuard.js +0 -173
  370. package/dist/lib/context/prompts/summarizationPrompt.d.ts +0 -16
  371. package/dist/lib/context/prompts/summarizationPrompt.js +0 -118
  372. package/dist/lib/context/stages/fileReadDeduplicator.d.ts +0 -8
  373. package/dist/lib/context/stages/fileReadDeduplicator.js +0 -67
  374. package/dist/lib/context/stages/slidingWindowTruncator.d.ts +0 -15
  375. package/dist/lib/context/stages/slidingWindowTruncator.js +0 -237
  376. package/dist/lib/context/stages/structuredSummarizer.d.ts +0 -8
  377. package/dist/lib/context/stages/structuredSummarizer.js +0 -123
  378. package/dist/lib/context/stages/toolOutputPruner.d.ts +0 -8
  379. package/dist/lib/context/stages/toolOutputPruner.js +0 -53
  380. package/dist/lib/context/stepBudgetGuard.d.ts +0 -61
  381. package/dist/lib/context/stepBudgetGuard.js +0 -358
  382. package/dist/lib/context/summarizationEngine.d.ts +0 -45
  383. package/dist/lib/context/summarizationEngine.js +0 -162
  384. package/dist/lib/context/toolOutputLimits.d.ts +0 -36
  385. package/dist/lib/context/toolOutputLimits.js +0 -95
  386. package/dist/lib/context/toolPairRepair.d.ts +0 -43
  387. package/dist/lib/context/toolPairRepair.js +0 -242
  388. package/dist/lib/core/analytics.d.ts +0 -11
  389. package/dist/lib/core/analytics.js +0 -117
  390. package/dist/lib/core/baseProvider.d.ts +0 -500
  391. package/dist/lib/core/baseProvider.js +0 -2081
  392. package/dist/lib/core/constants.d.ts +0 -146
  393. package/dist/lib/core/constants.js +0 -278
  394. package/dist/lib/core/conversationMemoryFactory.d.ts +0 -19
  395. package/dist/lib/core/conversationMemoryFactory.js +0 -147
  396. package/dist/lib/core/conversationMemoryInitializer.d.ts +0 -14
  397. package/dist/lib/core/conversationMemoryInitializer.js +0 -129
  398. package/dist/lib/core/conversationMemoryManager.d.ts +0 -110
  399. package/dist/lib/core/conversationMemoryManager.js +0 -471
  400. package/dist/lib/core/dynamicModels.d.ts +0 -89
  401. package/dist/lib/core/dynamicModels.js +0 -337
  402. package/dist/lib/core/evaluation.d.ts +0 -18
  403. package/dist/lib/core/evaluation.js +0 -310
  404. package/dist/lib/core/evaluationProviders.d.ts +0 -60
  405. package/dist/lib/core/evaluationProviders.js +0 -249
  406. package/dist/lib/core/factory.d.ts +0 -54
  407. package/dist/lib/core/factory.js +0 -364
  408. package/dist/lib/core/geminiLoopAdapter.d.ts +0 -20
  409. package/dist/lib/core/geminiLoopAdapter.js +0 -171
  410. package/dist/lib/core/handlerRegistry.d.ts +0 -29
  411. package/dist/lib/core/handlerRegistry.js +0 -62
  412. package/dist/lib/core/infrastructure/baseError.d.ts +0 -21
  413. package/dist/lib/core/infrastructure/baseError.js +0 -23
  414. package/dist/lib/core/infrastructure/baseFactory.d.ts +0 -16
  415. package/dist/lib/core/infrastructure/baseFactory.js +0 -55
  416. package/dist/lib/core/infrastructure/baseRegistry.d.ts +0 -19
  417. package/dist/lib/core/infrastructure/baseRegistry.js +0 -54
  418. package/dist/lib/core/infrastructure/index.d.ts +0 -5
  419. package/dist/lib/core/infrastructure/index.js +0 -6
  420. package/dist/lib/core/infrastructure/retry.d.ts +0 -2
  421. package/dist/lib/core/infrastructure/retry.js +0 -21
  422. package/dist/lib/core/infrastructure/typedEventEmitter.d.ts +0 -8
  423. package/dist/lib/core/infrastructure/typedEventEmitter.js +0 -24
  424. package/dist/lib/core/loopEngine.d.ts +0 -21
  425. package/dist/lib/core/loopEngine.js +0 -272
  426. package/dist/lib/core/modelConfiguration.d.ts +0 -179
  427. package/dist/lib/core/modelConfiguration.js +0 -549
  428. package/dist/lib/core/modules/GenerationHandler.d.ts +0 -135
  429. package/dist/lib/core/modules/GenerationHandler.js +0 -1028
  430. package/dist/lib/core/modules/MessageBuilder.d.ts +0 -24
  431. package/dist/lib/core/modules/MessageBuilder.js +0 -311
  432. package/dist/lib/core/modules/StreamHandler.d.ts +0 -70
  433. package/dist/lib/core/modules/StreamHandler.js +0 -229
  434. package/dist/lib/core/modules/TelemetryHandler.d.ts +0 -70
  435. package/dist/lib/core/modules/TelemetryHandler.js +0 -229
  436. package/dist/lib/core/modules/ToolsManager.d.ts +0 -105
  437. package/dist/lib/core/modules/ToolsManager.js +0 -737
  438. package/dist/lib/core/modules/Utilities.d.ts +0 -90
  439. package/dist/lib/core/modules/Utilities.js +0 -347
  440. package/dist/lib/core/modules/structuredOutputPolicy.d.ts +0 -91
  441. package/dist/lib/core/modules/structuredOutputPolicy.js +0 -136
  442. package/dist/lib/core/nativeToolFormat.d.ts +0 -33
  443. package/dist/lib/core/nativeToolFormat.js +0 -31
  444. package/dist/lib/core/redisConversationMemoryManager.d.ts +0 -235
  445. package/dist/lib/core/redisConversationMemoryManager.js +0 -1724
  446. package/dist/lib/core/serviceRegistry.d.ts +0 -40
  447. package/dist/lib/core/serviceRegistry.js +0 -113
  448. package/dist/lib/core/streamAnalytics.d.ts +0 -27
  449. package/dist/lib/core/streamAnalytics.js +0 -132
  450. package/dist/lib/core/streamChannel.d.ts +0 -10
  451. package/dist/lib/core/streamChannel.js +0 -77
  452. package/dist/lib/core/toolDedup.d.ts +0 -51
  453. package/dist/lib/core/toolDedup.js +0 -197
  454. package/dist/lib/core/toolEvents.d.ts +0 -2
  455. package/dist/lib/core/toolEvents.js +0 -8
  456. package/dist/lib/core/toolExecutionRecorder.d.ts +0 -76
  457. package/dist/lib/core/toolExecutionRecorder.js +0 -261
  458. package/dist/lib/core/toolRouting.d.ts +0 -68
  459. package/dist/lib/core/toolRouting.js +0 -496
  460. package/dist/lib/core/toolRoutingCache.d.ts +0 -64
  461. package/dist/lib/core/toolRoutingCache.js +0 -155
  462. package/dist/lib/core/toolRoutingEmbedding.d.ts +0 -112
  463. package/dist/lib/core/toolRoutingEmbedding.js +0 -323
  464. package/dist/lib/dynamic/dynamicResolver.d.ts +0 -282
  465. package/dist/lib/dynamic/dynamicResolver.js +0 -634
  466. package/dist/lib/dynamic/index.d.ts +0 -10
  467. package/dist/lib/dynamic/index.js +0 -13
  468. package/dist/lib/dynamic/resolution.d.ts +0 -17
  469. package/dist/lib/dynamic/resolution.js +0 -22
  470. package/dist/lib/evaluation/BatchEvaluator.d.ts +0 -65
  471. package/dist/lib/evaluation/BatchEvaluator.js +0 -271
  472. package/dist/lib/evaluation/EvaluationAggregator.d.ts +0 -156
  473. package/dist/lib/evaluation/EvaluationAggregator.js +0 -378
  474. package/dist/lib/evaluation/EvaluatorFactory.d.ts +0 -102
  475. package/dist/lib/evaluation/EvaluatorFactory.js +0 -281
  476. package/dist/lib/evaluation/EvaluatorRegistry.d.ts +0 -111
  477. package/dist/lib/evaluation/EvaluatorRegistry.js +0 -185
  478. package/dist/lib/evaluation/contextBuilder.d.ts +0 -44
  479. package/dist/lib/evaluation/contextBuilder.js +0 -132
  480. package/dist/lib/evaluation/errors/EvaluationError.d.ts +0 -161
  481. package/dist/lib/evaluation/errors/EvaluationError.js +0 -207
  482. package/dist/lib/evaluation/errors/index.d.ts +0 -4
  483. package/dist/lib/evaluation/errors/index.js +0 -5
  484. package/dist/lib/evaluation/hooks/index.d.ts +0 -6
  485. package/dist/lib/evaluation/hooks/index.js +0 -7
  486. package/dist/lib/evaluation/hooks/langfuseAdapter.d.ts +0 -62
  487. package/dist/lib/evaluation/hooks/langfuseAdapter.js +0 -173
  488. package/dist/lib/evaluation/hooks/observabilityHooks.d.ts +0 -77
  489. package/dist/lib/evaluation/hooks/observabilityHooks.js +0 -187
  490. package/dist/lib/evaluation/index.d.ts +0 -41
  491. package/dist/lib/evaluation/index.js +0 -78
  492. package/dist/lib/evaluation/pipeline/evaluationPipeline.d.ts +0 -83
  493. package/dist/lib/evaluation/pipeline/evaluationPipeline.js +0 -397
  494. package/dist/lib/evaluation/pipeline/index.d.ts +0 -8
  495. package/dist/lib/evaluation/pipeline/index.js +0 -9
  496. package/dist/lib/evaluation/pipeline/pipelineBuilder.d.ts +0 -126
  497. package/dist/lib/evaluation/pipeline/pipelineBuilder.js +0 -261
  498. package/dist/lib/evaluation/pipeline/presets.d.ts +0 -66
  499. package/dist/lib/evaluation/pipeline/presets.js +0 -225
  500. package/dist/lib/evaluation/pipeline/strategies/batchStrategy.d.ts +0 -46
  501. package/dist/lib/evaluation/pipeline/strategies/batchStrategy.js +0 -242
  502. package/dist/lib/evaluation/pipeline/strategies/index.d.ts +0 -6
  503. package/dist/lib/evaluation/pipeline/strategies/index.js +0 -7
  504. package/dist/lib/evaluation/pipeline/strategies/samplingStrategy.d.ts +0 -76
  505. package/dist/lib/evaluation/pipeline/strategies/samplingStrategy.js +0 -247
  506. package/dist/lib/evaluation/prompts.d.ts +0 -22
  507. package/dist/lib/evaluation/prompts.js +0 -74
  508. package/dist/lib/evaluation/ragasEvaluator.d.ts +0 -28
  509. package/dist/lib/evaluation/ragasEvaluator.js +0 -127
  510. package/dist/lib/evaluation/reporting/index.d.ts +0 -6
  511. package/dist/lib/evaluation/reporting/index.js +0 -7
  512. package/dist/lib/evaluation/reporting/metricsCollector.d.ts +0 -88
  513. package/dist/lib/evaluation/reporting/metricsCollector.js +0 -286
  514. package/dist/lib/evaluation/reporting/reportGenerator.d.ts +0 -57
  515. package/dist/lib/evaluation/reporting/reportGenerator.js +0 -375
  516. package/dist/lib/evaluation/retryManager.d.ts +0 -39
  517. package/dist/lib/evaluation/retryManager.js +0 -79
  518. package/dist/lib/evaluation/scorers/baseScorer.d.ts +0 -82
  519. package/dist/lib/evaluation/scorers/baseScorer.js +0 -233
  520. package/dist/lib/evaluation/scorers/customScorerUtils.d.ts +0 -86
  521. package/dist/lib/evaluation/scorers/customScorerUtils.js +0 -382
  522. package/dist/lib/evaluation/scorers/index.d.ts +0 -10
  523. package/dist/lib/evaluation/scorers/index.js +0 -17
  524. package/dist/lib/evaluation/scorers/llm/answerRelevancyScorer.d.ts +0 -12
  525. package/dist/lib/evaluation/scorers/llm/answerRelevancyScorer.js +0 -100
  526. package/dist/lib/evaluation/scorers/llm/baseLLMScorer.d.ts +0 -69
  527. package/dist/lib/evaluation/scorers/llm/baseLLMScorer.js +0 -282
  528. package/dist/lib/evaluation/scorers/llm/biasDetectionScorer.d.ts +0 -12
  529. package/dist/lib/evaluation/scorers/llm/biasDetectionScorer.js +0 -128
  530. package/dist/lib/evaluation/scorers/llm/contextPrecisionScorer.d.ts +0 -12
  531. package/dist/lib/evaluation/scorers/llm/contextPrecisionScorer.js +0 -93
  532. package/dist/lib/evaluation/scorers/llm/contextRelevancyScorer.d.ts +0 -12
  533. package/dist/lib/evaluation/scorers/llm/contextRelevancyScorer.js +0 -108
  534. package/dist/lib/evaluation/scorers/llm/faithfulnessScorer.d.ts +0 -12
  535. package/dist/lib/evaluation/scorers/llm/faithfulnessScorer.js +0 -122
  536. package/dist/lib/evaluation/scorers/llm/hallucinationScorer.d.ts +0 -12
  537. package/dist/lib/evaluation/scorers/llm/hallucinationScorer.js +0 -141
  538. package/dist/lib/evaluation/scorers/llm/index.d.ts +0 -15
  539. package/dist/lib/evaluation/scorers/llm/index.js +0 -17
  540. package/dist/lib/evaluation/scorers/llm/promptAlignmentScorer.d.ts +0 -12
  541. package/dist/lib/evaluation/scorers/llm/promptAlignmentScorer.js +0 -107
  542. package/dist/lib/evaluation/scorers/llm/summarizationScorer.d.ts +0 -12
  543. package/dist/lib/evaluation/scorers/llm/summarizationScorer.js +0 -115
  544. package/dist/lib/evaluation/scorers/llm/toneConsistencyScorer.d.ts +0 -12
  545. package/dist/lib/evaluation/scorers/llm/toneConsistencyScorer.js +0 -107
  546. package/dist/lib/evaluation/scorers/llm/toxicityScorer.d.ts +0 -12
  547. package/dist/lib/evaluation/scorers/llm/toxicityScorer.js +0 -122
  548. package/dist/lib/evaluation/scorers/rule/baseRuleScorer.d.ts +0 -77
  549. package/dist/lib/evaluation/scorers/rule/baseRuleScorer.js +0 -234
  550. package/dist/lib/evaluation/scorers/rule/contentSimilarityScorer.d.ts +0 -81
  551. package/dist/lib/evaluation/scorers/rule/contentSimilarityScorer.js +0 -353
  552. package/dist/lib/evaluation/scorers/rule/formatScorer.d.ts +0 -107
  553. package/dist/lib/evaluation/scorers/rule/formatScorer.js +0 -471
  554. package/dist/lib/evaluation/scorers/rule/index.d.ts +0 -9
  555. package/dist/lib/evaluation/scorers/rule/index.js +0 -11
  556. package/dist/lib/evaluation/scorers/rule/keywordCoverageScorer.d.ts +0 -66
  557. package/dist/lib/evaluation/scorers/rule/keywordCoverageScorer.js +0 -348
  558. package/dist/lib/evaluation/scorers/rule/lengthScorer.d.ts +0 -74
  559. package/dist/lib/evaluation/scorers/rule/lengthScorer.js +0 -352
  560. package/dist/lib/evaluation/scorers/scorerBuilder.d.ts +0 -160
  561. package/dist/lib/evaluation/scorers/scorerBuilder.js +0 -421
  562. package/dist/lib/evaluation/scorers/scorerRegistry.d.ts +0 -65
  563. package/dist/lib/evaluation/scorers/scorerRegistry.js +0 -540
  564. package/dist/lib/evaluation/scoring.d.ts +0 -15
  565. package/dist/lib/evaluation/scoring.js +0 -61
  566. package/dist/lib/factories/providerDescriptors.d.ts +0 -18
  567. package/dist/lib/factories/providerDescriptors.js +0 -547
  568. package/dist/lib/factories/providerFactory.d.ts +0 -87
  569. package/dist/lib/factories/providerFactory.js +0 -199
  570. package/dist/lib/factories/providerRegistry.d.ts +0 -58
  571. package/dist/lib/factories/providerRegistry.js +0 -549
  572. package/dist/lib/features/ppt/constants.d.ts +0 -121
  573. package/dist/lib/features/ppt/constants.js +0 -897
  574. package/dist/lib/features/ppt/contentPlanner.d.ts +0 -47
  575. package/dist/lib/features/ppt/contentPlanner.js +0 -558
  576. package/dist/lib/features/ppt/index.d.ts +0 -11
  577. package/dist/lib/features/ppt/index.js +0 -33
  578. package/dist/lib/features/ppt/pptError.d.ts +0 -38
  579. package/dist/lib/features/ppt/pptError.js +0 -54
  580. package/dist/lib/features/ppt/presentationOrchestrator.d.ts +0 -37
  581. package/dist/lib/features/ppt/presentationOrchestrator.js +0 -231
  582. package/dist/lib/features/ppt/slideGenerator.d.ts +0 -56
  583. package/dist/lib/features/ppt/slideGenerator.js +0 -542
  584. package/dist/lib/features/ppt/slideRenderers.d.ts +0 -347
  585. package/dist/lib/features/ppt/slideRenderers.js +0 -2384
  586. package/dist/lib/features/ppt/slideTypeInference.d.ts +0 -91
  587. package/dist/lib/features/ppt/slideTypeInference.js +0 -406
  588. package/dist/lib/features/ppt/utils.d.ts +0 -103
  589. package/dist/lib/features/ppt/utils.js +0 -446
  590. package/dist/lib/files/fileReferenceRegistry.d.ts +0 -275
  591. package/dist/lib/files/fileReferenceRegistry.js +0 -1559
  592. package/dist/lib/files/fileTools.d.ts +0 -176
  593. package/dist/lib/files/fileTools.js +0 -435
  594. package/dist/lib/files/index.d.ts +0 -13
  595. package/dist/lib/files/index.js +0 -14
  596. package/dist/lib/files/streamingReader.d.ts +0 -93
  597. package/dist/lib/files/streamingReader.js +0 -322
  598. package/dist/lib/hitl/hitlErrors.d.ts +0 -38
  599. package/dist/lib/hitl/hitlErrors.js +0 -55
  600. package/dist/lib/hitl/hitlManager.d.ts +0 -100
  601. package/dist/lib/hitl/hitlManager.js +0 -461
  602. package/dist/lib/hitl/index.d.ts +0 -7
  603. package/dist/lib/hitl/index.js +0 -10
  604. package/dist/lib/image-gen/ImageGenService.d.ts +0 -146
  605. package/dist/lib/image-gen/ImageGenService.js +0 -349
  606. package/dist/lib/image-gen/imageGenTools.d.ts +0 -109
  607. package/dist/lib/image-gen/imageGenTools.js +0 -305
  608. package/dist/lib/image-gen/index.d.ts +0 -45
  609. package/dist/lib/image-gen/index.js +0 -49
  610. package/dist/lib/index.d.ts +0 -447
  611. package/dist/lib/index.js +0 -748
  612. package/dist/lib/knowledge/context.d.ts +0 -18
  613. package/dist/lib/knowledge/context.js +0 -92
  614. package/dist/lib/knowledge/defaults.d.ts +0 -24
  615. package/dist/lib/knowledge/defaults.js +0 -30
  616. package/dist/lib/knowledge/engine.d.ts +0 -35
  617. package/dist/lib/knowledge/engine.js +0 -180
  618. package/dist/lib/knowledge/index.d.ts +0 -15
  619. package/dist/lib/knowledge/index.js +0 -16
  620. package/dist/lib/knowledge/indexCache.d.ts +0 -19
  621. package/dist/lib/knowledge/indexCache.js +0 -110
  622. package/dist/lib/knowledge/knowledgeIndex.d.ts +0 -41
  623. package/dist/lib/knowledge/knowledgeIndex.js +0 -205
  624. package/dist/lib/knowledge/normalize.d.ts +0 -32
  625. package/dist/lib/knowledge/normalize.js +0 -75
  626. package/dist/lib/knowledge/resolve.d.ts +0 -18
  627. package/dist/lib/knowledge/resolve.js +0 -157
  628. package/dist/lib/knowledge/retrieval.d.ts +0 -16
  629. package/dist/lib/knowledge/retrieval.js +0 -222
  630. package/dist/lib/mcp/agentExposure.d.ts +0 -83
  631. package/dist/lib/mcp/agentExposure.js +0 -357
  632. package/dist/lib/mcp/auth/index.d.ts +0 -6
  633. package/dist/lib/mcp/auth/index.js +0 -12
  634. package/dist/lib/mcp/auth/oauthClientProvider.d.ts +0 -93
  635. package/dist/lib/mcp/auth/oauthClientProvider.js +0 -331
  636. package/dist/lib/mcp/auth/tokenStorage.d.ts +0 -56
  637. package/dist/lib/mcp/auth/tokenStorage.js +0 -135
  638. package/dist/lib/mcp/batching/index.d.ts +0 -1
  639. package/dist/lib/mcp/batching/index.js +0 -2
  640. package/dist/lib/mcp/batching/requestBatcher.d.ts +0 -130
  641. package/dist/lib/mcp/batching/requestBatcher.js +0 -468
  642. package/dist/lib/mcp/caching/index.d.ts +0 -1
  643. package/dist/lib/mcp/caching/index.js +0 -2
  644. package/dist/lib/mcp/caching/toolCache.d.ts +0 -154
  645. package/dist/lib/mcp/caching/toolCache.js +0 -434
  646. package/dist/lib/mcp/elicitation/elicitationManager.d.ts +0 -169
  647. package/dist/lib/mcp/elicitation/elicitationManager.js +0 -377
  648. package/dist/lib/mcp/elicitation/index.d.ts +0 -1
  649. package/dist/lib/mcp/elicitation/index.js +0 -3
  650. package/dist/lib/mcp/elicitationProtocol.d.ts +0 -139
  651. package/dist/lib/mcp/elicitationProtocol.js +0 -376
  652. package/dist/lib/mcp/enhancedToolDiscovery.d.ts +0 -125
  653. package/dist/lib/mcp/enhancedToolDiscovery.js +0 -482
  654. package/dist/lib/mcp/externalServerManager.d.ts +0 -189
  655. package/dist/lib/mcp/externalServerManager.js +0 -1525
  656. package/dist/lib/mcp/factory.d.ts +0 -60
  657. package/dist/lib/mcp/factory.js +0 -162
  658. package/dist/lib/mcp/flexibleToolValidator.d.ts +0 -46
  659. package/dist/lib/mcp/flexibleToolValidator.js +0 -162
  660. package/dist/lib/mcp/httpRateLimiter.d.ts +0 -152
  661. package/dist/lib/mcp/httpRateLimiter.js +0 -386
  662. package/dist/lib/mcp/httpRetryHandler.d.ts +0 -62
  663. package/dist/lib/mcp/httpRetryHandler.js +0 -180
  664. package/dist/lib/mcp/index.d.ts +0 -60
  665. package/dist/lib/mcp/index.js +0 -82
  666. package/dist/lib/mcp/mcpCircuitBreaker.d.ts +0 -123
  667. package/dist/lib/mcp/mcpCircuitBreaker.js +0 -428
  668. package/dist/lib/mcp/mcpClientFactory.d.ts +0 -109
  669. package/dist/lib/mcp/mcpClientFactory.js +0 -714
  670. package/dist/lib/mcp/mcpOutputNormalizer.d.ts +0 -47
  671. package/dist/lib/mcp/mcpOutputNormalizer.js +0 -183
  672. package/dist/lib/mcp/mcpRegistryClient.d.ts +0 -129
  673. package/dist/lib/mcp/mcpRegistryClient.js +0 -489
  674. package/dist/lib/mcp/mcpServerBase.d.ts +0 -162
  675. package/dist/lib/mcp/mcpServerBase.js +0 -377
  676. package/dist/lib/mcp/multiServerManager.d.ts +0 -182
  677. package/dist/lib/mcp/multiServerManager.js +0 -580
  678. package/dist/lib/mcp/registry.d.ts +0 -94
  679. package/dist/lib/mcp/registry.js +0 -159
  680. package/dist/lib/mcp/routing/index.d.ts +0 -1
  681. package/dist/lib/mcp/routing/index.js +0 -2
  682. package/dist/lib/mcp/routing/toolRouter.d.ts +0 -110
  683. package/dist/lib/mcp/routing/toolRouter.js +0 -417
  684. package/dist/lib/mcp/serverCapabilities.d.ts +0 -175
  685. package/dist/lib/mcp/serverCapabilities.js +0 -503
  686. package/dist/lib/mcp/servers/agent/directToolsServer.d.ts +0 -8
  687. package/dist/lib/mcp/servers/agent/directToolsServer.js +0 -152
  688. package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.d.ts +0 -6
  689. package/dist/lib/mcp/servers/aiProviders/aiAnalysisTools.js +0 -364
  690. package/dist/lib/mcp/servers/aiProviders/aiCoreServer.d.ts +0 -10
  691. package/dist/lib/mcp/servers/aiProviders/aiCoreServer.js +0 -232
  692. package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.d.ts +0 -5
  693. package/dist/lib/mcp/servers/aiProviders/aiWorkflowTools.js +0 -584
  694. package/dist/lib/mcp/servers/utilities/utilityServer.d.ts +0 -8
  695. package/dist/lib/mcp/servers/utilities/utilityServer.js +0 -327
  696. package/dist/lib/mcp/toolAnnotations.d.ts +0 -57
  697. package/dist/lib/mcp/toolAnnotations.js +0 -240
  698. package/dist/lib/mcp/toolConverter.d.ts +0 -87
  699. package/dist/lib/mcp/toolConverter.js +0 -259
  700. package/dist/lib/mcp/toolDiscoveryService.d.ts +0 -144
  701. package/dist/lib/mcp/toolDiscoveryService.js +0 -978
  702. package/dist/lib/mcp/toolIntegration.d.ts +0 -92
  703. package/dist/lib/mcp/toolIntegration.js +0 -335
  704. package/dist/lib/mcp/toolRegistry.d.ts +0 -151
  705. package/dist/lib/mcp/toolRegistry.js +0 -755
  706. package/dist/lib/memory/hippocampusInitializer.d.ts +0 -2
  707. package/dist/lib/memory/hippocampusInitializer.js +0 -50
  708. package/dist/lib/memory/memoryRetrievalTools.d.ts +0 -13
  709. package/dist/lib/memory/memoryRetrievalTools.js +0 -267
  710. package/dist/lib/middleware/builtin/analytics.d.ts +0 -16
  711. package/dist/lib/middleware/builtin/analytics.js +0 -133
  712. package/dist/lib/middleware/builtin/autoEvaluation.d.ts +0 -11
  713. package/dist/lib/middleware/builtin/autoEvaluation.js +0 -201
  714. package/dist/lib/middleware/builtin/guardrails.d.ts +0 -7
  715. package/dist/lib/middleware/builtin/guardrails.js +0 -110
  716. package/dist/lib/middleware/builtin/lifecycle.d.ts +0 -2
  717. package/dist/lib/middleware/builtin/lifecycle.js +0 -161
  718. package/dist/lib/middleware/factory.d.ts +0 -69
  719. package/dist/lib/middleware/factory.js +0 -328
  720. package/dist/lib/middleware/index.d.ts +0 -11
  721. package/dist/lib/middleware/index.js +0 -17
  722. package/dist/lib/middleware/registry.d.ts +0 -76
  723. package/dist/lib/middleware/registry.js +0 -296
  724. package/dist/lib/middleware/utils/guardrailsUtils.d.ts +0 -50
  725. package/dist/lib/middleware/utils/guardrailsUtils.js +0 -397
  726. package/dist/lib/models/anthropicModels.d.ts +0 -261
  727. package/dist/lib/models/anthropicModels.js +0 -556
  728. package/dist/lib/models/manifestRegistry.d.ts +0 -33
  729. package/dist/lib/models/manifestRegistry.js +0 -174
  730. package/dist/lib/models/manifests/anthropic.d.ts +0 -9
  731. package/dist/lib/models/manifests/anthropic.js +0 -346
  732. package/dist/lib/models/manifests/azure.d.ts +0 -2
  733. package/dist/lib/models/manifests/azure.js +0 -87
  734. package/dist/lib/models/manifests/bedrock.d.ts +0 -2
  735. package/dist/lib/models/manifests/bedrock.js +0 -75
  736. package/dist/lib/models/manifests/cloudflare.d.ts +0 -8
  737. package/dist/lib/models/manifests/cloudflare.js +0 -19
  738. package/dist/lib/models/manifests/cohere.d.ts +0 -8
  739. package/dist/lib/models/manifests/cohere.js +0 -19
  740. package/dist/lib/models/manifests/deepseek.d.ts +0 -8
  741. package/dist/lib/models/manifests/deepseek.js +0 -19
  742. package/dist/lib/models/manifests/fireworks.d.ts +0 -8
  743. package/dist/lib/models/manifests/fireworks.js +0 -19
  744. package/dist/lib/models/manifests/google-ai.d.ts +0 -2
  745. package/dist/lib/models/manifests/google-ai.js +0 -28
  746. package/dist/lib/models/manifests/groq.d.ts +0 -8
  747. package/dist/lib/models/manifests/groq.js +0 -19
  748. package/dist/lib/models/manifests/huggingface.d.ts +0 -8
  749. package/dist/lib/models/manifests/huggingface.js +0 -19
  750. package/dist/lib/models/manifests/ideogram.d.ts +0 -8
  751. package/dist/lib/models/manifests/ideogram.js +0 -19
  752. package/dist/lib/models/manifests/jina.d.ts +0 -8
  753. package/dist/lib/models/manifests/jina.js +0 -19
  754. package/dist/lib/models/manifests/litellm.d.ts +0 -8
  755. package/dist/lib/models/manifests/litellm.js +0 -19
  756. package/dist/lib/models/manifests/llamacpp.d.ts +0 -8
  757. package/dist/lib/models/manifests/llamacpp.js +0 -19
  758. package/dist/lib/models/manifests/lm-studio.d.ts +0 -8
  759. package/dist/lib/models/manifests/lm-studio.js +0 -19
  760. package/dist/lib/models/manifests/mistral.d.ts +0 -2
  761. package/dist/lib/models/manifests/mistral.js +0 -50
  762. package/dist/lib/models/manifests/nvidia-nim.d.ts +0 -8
  763. package/dist/lib/models/manifests/nvidia-nim.js +0 -19
  764. package/dist/lib/models/manifests/ollama.d.ts +0 -2
  765. package/dist/lib/models/manifests/ollama.js +0 -72
  766. package/dist/lib/models/manifests/openai-compatible.d.ts +0 -8
  767. package/dist/lib/models/manifests/openai-compatible.js +0 -19
  768. package/dist/lib/models/manifests/openai.d.ts +0 -11
  769. package/dist/lib/models/manifests/openai.js +0 -560
  770. package/dist/lib/models/manifests/openrouter.d.ts +0 -8
  771. package/dist/lib/models/manifests/openrouter.js +0 -19
  772. package/dist/lib/models/manifests/perplexity.d.ts +0 -8
  773. package/dist/lib/models/manifests/perplexity.js +0 -19
  774. package/dist/lib/models/manifests/recraft.d.ts +0 -8
  775. package/dist/lib/models/manifests/recraft.js +0 -19
  776. package/dist/lib/models/manifests/replicate.d.ts +0 -8
  777. package/dist/lib/models/manifests/replicate.js +0 -19
  778. package/dist/lib/models/manifests/sagemaker.d.ts +0 -8
  779. package/dist/lib/models/manifests/sagemaker.js +0 -19
  780. package/dist/lib/models/manifests/stability.d.ts +0 -8
  781. package/dist/lib/models/manifests/stability.js +0 -19
  782. package/dist/lib/models/manifests/together-ai.d.ts +0 -8
  783. package/dist/lib/models/manifests/together-ai.js +0 -19
  784. package/dist/lib/models/manifests/vertex.d.ts +0 -8
  785. package/dist/lib/models/manifests/vertex.js +0 -19
  786. package/dist/lib/models/manifests/voyage.d.ts +0 -8
  787. package/dist/lib/models/manifests/voyage.js +0 -19
  788. package/dist/lib/models/manifests/xai.d.ts +0 -8
  789. package/dist/lib/models/manifests/xai.js +0 -19
  790. package/dist/lib/models/modelRegistry.d.ts +0 -74
  791. package/dist/lib/models/modelRegistry.js +0 -2695
  792. package/dist/lib/models/modelResolver.d.ts +0 -74
  793. package/dist/lib/models/modelResolver.js +0 -470
  794. package/dist/lib/music/index.d.ts +0 -27
  795. package/dist/lib/music/index.js +0 -94
  796. package/dist/lib/music/providers/BeatovenMusic.d.ts +0 -31
  797. package/dist/lib/music/providers/BeatovenMusic.js +0 -334
  798. package/dist/lib/music/providers/ElevenLabsMusic.d.ts +0 -30
  799. package/dist/lib/music/providers/ElevenLabsMusic.js +0 -169
  800. package/dist/lib/music/providers/LyriaMusic.d.ts +0 -29
  801. package/dist/lib/music/providers/LyriaMusic.js +0 -173
  802. package/dist/lib/music/providers/ReplicateMusic.d.ts +0 -31
  803. package/dist/lib/music/providers/ReplicateMusic.js +0 -262
  804. package/dist/lib/neurolink.d.ts +0 -2662
  805. package/dist/lib/neurolink.js +0 -12946
  806. package/dist/lib/observability/exporterRegistry.d.ts +0 -133
  807. package/dist/lib/observability/exporterRegistry.js +0 -414
  808. package/dist/lib/observability/exporters/arizeExporter.d.ts +0 -32
  809. package/dist/lib/observability/exporters/arizeExporter.js +0 -139
  810. package/dist/lib/observability/exporters/baseExporter.d.ts +0 -117
  811. package/dist/lib/observability/exporters/baseExporter.js +0 -191
  812. package/dist/lib/observability/exporters/braintrustExporter.d.ts +0 -30
  813. package/dist/lib/observability/exporters/braintrustExporter.js +0 -155
  814. package/dist/lib/observability/exporters/datadogExporter.d.ts +0 -37
  815. package/dist/lib/observability/exporters/datadogExporter.js +0 -197
  816. package/dist/lib/observability/exporters/index.d.ts +0 -13
  817. package/dist/lib/observability/exporters/index.js +0 -14
  818. package/dist/lib/observability/exporters/laminarExporter.d.ts +0 -48
  819. package/dist/lib/observability/exporters/laminarExporter.js +0 -304
  820. package/dist/lib/observability/exporters/langfuseExporter.d.ts +0 -48
  821. package/dist/lib/observability/exporters/langfuseExporter.js +0 -210
  822. package/dist/lib/observability/exporters/langsmithExporter.d.ts +0 -26
  823. package/dist/lib/observability/exporters/langsmithExporter.js +0 -144
  824. package/dist/lib/observability/exporters/otelExporter.d.ts +0 -39
  825. package/dist/lib/observability/exporters/otelExporter.js +0 -165
  826. package/dist/lib/observability/exporters/posthogExporter.d.ts +0 -48
  827. package/dist/lib/observability/exporters/posthogExporter.js +0 -289
  828. package/dist/lib/observability/exporters/sentryExporter.d.ts +0 -32
  829. package/dist/lib/observability/exporters/sentryExporter.js +0 -167
  830. package/dist/lib/observability/index.d.ts +0 -23
  831. package/dist/lib/observability/index.js +0 -32
  832. package/dist/lib/observability/metricsAggregator.d.ts +0 -126
  833. package/dist/lib/observability/metricsAggregator.js +0 -553
  834. package/dist/lib/observability/otelBridge.d.ts +0 -49
  835. package/dist/lib/observability/otelBridge.js +0 -141
  836. package/dist/lib/observability/retryPolicy.d.ts +0 -154
  837. package/dist/lib/observability/retryPolicy.js +0 -384
  838. package/dist/lib/observability/sampling/index.d.ts +0 -4
  839. package/dist/lib/observability/sampling/index.js +0 -5
  840. package/dist/lib/observability/sampling/samplers.d.ts +0 -104
  841. package/dist/lib/observability/sampling/samplers.js +0 -217
  842. package/dist/lib/observability/spanProcessor.d.ts +0 -115
  843. package/dist/lib/observability/spanProcessor.js +0 -304
  844. package/dist/lib/observability/tokenTracker.d.ts +0 -109
  845. package/dist/lib/observability/tokenTracker.js +0 -416
  846. package/dist/lib/observability/utils/index.d.ts +0 -4
  847. package/dist/lib/observability/utils/index.js +0 -5
  848. package/dist/lib/observability/utils/safeMetadata.d.ts +0 -10
  849. package/dist/lib/observability/utils/safeMetadata.js +0 -26
  850. package/dist/lib/observability/utils/spanSerializer.d.ts +0 -119
  851. package/dist/lib/observability/utils/spanSerializer.js +0 -314
  852. package/dist/lib/processors/archive/ArchiveProcessor.d.ts +0 -323
  853. package/dist/lib/processors/archive/ArchiveProcessor.js +0 -1662
  854. package/dist/lib/processors/archive/index.d.ts +0 -33
  855. package/dist/lib/processors/archive/index.js +0 -44
  856. package/dist/lib/processors/archive/zipEntryReader.d.ts +0 -51
  857. package/dist/lib/processors/archive/zipEntryReader.js +0 -81
  858. package/dist/lib/processors/base/BaseFileProcessor.d.ts +0 -309
  859. package/dist/lib/processors/base/BaseFileProcessor.js +0 -769
  860. package/dist/lib/processors/base/index.d.ts +0 -13
  861. package/dist/lib/processors/base/index.js +0 -23
  862. package/dist/lib/processors/cli/fileProcessorCli.d.ts +0 -124
  863. package/dist/lib/processors/cli/fileProcessorCli.js +0 -392
  864. package/dist/lib/processors/cli/index.d.ts +0 -36
  865. package/dist/lib/processors/cli/index.js +0 -53
  866. package/dist/lib/processors/code/ConfigProcessor.d.ts +0 -169
  867. package/dist/lib/processors/code/ConfigProcessor.js +0 -405
  868. package/dist/lib/processors/code/SourceCodeProcessor.d.ts +0 -172
  869. package/dist/lib/processors/code/SourceCodeProcessor.js +0 -309
  870. package/dist/lib/processors/code/index.d.ts +0 -44
  871. package/dist/lib/processors/code/index.js +0 -65
  872. package/dist/lib/processors/config/fileExtensions.d.ts +0 -280
  873. package/dist/lib/processors/config/fileExtensions.js +0 -485
  874. package/dist/lib/processors/config/fileTypeRegistry.d.ts +0 -106
  875. package/dist/lib/processors/config/fileTypeRegistry.js +0 -702
  876. package/dist/lib/processors/config/index.d.ts +0 -33
  877. package/dist/lib/processors/config/index.js +0 -104
  878. package/dist/lib/processors/config/languageMap.d.ts +0 -62
  879. package/dist/lib/processors/config/languageMap.js +0 -414
  880. package/dist/lib/processors/config/mimeConstants.d.ts +0 -373
  881. package/dist/lib/processors/config/mimeConstants.js +0 -348
  882. package/dist/lib/processors/config/sizeLimits.d.ts +0 -198
  883. package/dist/lib/processors/config/sizeLimits.js +0 -262
  884. package/dist/lib/processors/data/JsonProcessor.d.ts +0 -120
  885. package/dist/lib/processors/data/JsonProcessor.js +0 -206
  886. package/dist/lib/processors/data/XmlProcessor.d.ts +0 -158
  887. package/dist/lib/processors/data/XmlProcessor.js +0 -288
  888. package/dist/lib/processors/data/YamlProcessor.d.ts +0 -161
  889. package/dist/lib/processors/data/YamlProcessor.js +0 -297
  890. package/dist/lib/processors/data/index.d.ts +0 -49
  891. package/dist/lib/processors/data/index.js +0 -83
  892. package/dist/lib/processors/document/ExcelProcessor.d.ts +0 -250
  893. package/dist/lib/processors/document/ExcelProcessor.js +0 -615
  894. package/dist/lib/processors/document/OpenDocumentProcessor.d.ts +0 -67
  895. package/dist/lib/processors/document/OpenDocumentProcessor.js +0 -236
  896. package/dist/lib/processors/document/PptxProcessor.d.ts +0 -77
  897. package/dist/lib/processors/document/PptxProcessor.js +0 -262
  898. package/dist/lib/processors/document/RtfProcessor.d.ts +0 -150
  899. package/dist/lib/processors/document/RtfProcessor.js +0 -364
  900. package/dist/lib/processors/document/WordProcessor.d.ts +0 -166
  901. package/dist/lib/processors/document/WordProcessor.js +0 -365
  902. package/dist/lib/processors/document/index.d.ts +0 -55
  903. package/dist/lib/processors/document/index.js +0 -100
  904. package/dist/lib/processors/errors/FileErrorCode.d.ts +0 -86
  905. package/dist/lib/processors/errors/FileErrorCode.js +0 -256
  906. package/dist/lib/processors/errors/errorHelpers.d.ts +0 -121
  907. package/dist/lib/processors/errors/errorHelpers.js +0 -387
  908. package/dist/lib/processors/errors/errorSerializer.d.ts +0 -96
  909. package/dist/lib/processors/errors/errorSerializer.js +0 -508
  910. package/dist/lib/processors/errors/index.d.ts +0 -46
  911. package/dist/lib/processors/errors/index.js +0 -50
  912. package/dist/lib/processors/index.d.ts +0 -79
  913. package/dist/lib/processors/index.js +0 -133
  914. package/dist/lib/processors/integration/FileProcessorIntegration.d.ts +0 -176
  915. package/dist/lib/processors/integration/FileProcessorIntegration.js +0 -279
  916. package/dist/lib/processors/integration/index.d.ts +0 -41
  917. package/dist/lib/processors/integration/index.js +0 -48
  918. package/dist/lib/processors/markup/HtmlProcessor.d.ts +0 -167
  919. package/dist/lib/processors/markup/HtmlProcessor.js +0 -252
  920. package/dist/lib/processors/markup/MarkdownProcessor.d.ts +0 -163
  921. package/dist/lib/processors/markup/MarkdownProcessor.js +0 -249
  922. package/dist/lib/processors/markup/SvgProcessor.d.ts +0 -154
  923. package/dist/lib/processors/markup/SvgProcessor.js +0 -245
  924. package/dist/lib/processors/markup/TextProcessor.d.ts +0 -133
  925. package/dist/lib/processors/markup/TextProcessor.js +0 -191
  926. package/dist/lib/processors/markup/index.d.ts +0 -66
  927. package/dist/lib/processors/markup/index.js +0 -111
  928. package/dist/lib/processors/media/AudioProcessor.d.ts +0 -266
  929. package/dist/lib/processors/media/AudioProcessor.js +0 -712
  930. package/dist/lib/processors/media/VideoProcessor.d.ts +0 -337
  931. package/dist/lib/processors/media/VideoProcessor.js +0 -1154
  932. package/dist/lib/processors/media/index.d.ts +0 -26
  933. package/dist/lib/processors/media/index.js +0 -30
  934. package/dist/lib/processors/registry/ProcessorRegistry.d.ts +0 -347
  935. package/dist/lib/processors/registry/ProcessorRegistry.js +0 -715
  936. package/dist/lib/processors/registry/index.d.ts +0 -2
  937. package/dist/lib/processors/registry/index.js +0 -10
  938. package/dist/lib/providers/amazonBedrock/client.d.ts +0 -93
  939. package/dist/lib/providers/amazonBedrock/client.js +0 -1178
  940. package/dist/lib/providers/amazonBedrock/constants.d.ts +0 -1
  941. package/dist/lib/providers/amazonBedrock/constants.js +0 -3
  942. package/dist/lib/providers/amazonBedrock/index.d.ts +0 -3
  943. package/dist/lib/providers/amazonBedrock/index.js +0 -4
  944. package/dist/lib/providers/amazonBedrock/inferenceProfile.d.ts +0 -72
  945. package/dist/lib/providers/amazonBedrock/inferenceProfile.js +0 -186
  946. package/dist/lib/providers/amazonBedrock/loopAdapter.d.ts +0 -36
  947. package/dist/lib/providers/amazonBedrock/loopAdapter.js +0 -278
  948. package/dist/lib/providers/amazonBedrock/utils.d.ts +0 -1
  949. package/dist/lib/providers/amazonBedrock/utils.js +0 -4
  950. package/dist/lib/providers/amazonSagemaker.d.ts +0 -108
  951. package/dist/lib/providers/amazonSagemaker.js +0 -292
  952. package/dist/lib/providers/anthropic/cacheControl.d.ts +0 -12
  953. package/dist/lib/providers/anthropic/cacheControl.js +0 -15
  954. package/dist/lib/providers/anthropic/client.d.ts +0 -149
  955. package/dist/lib/providers/anthropic/client.js +0 -1862
  956. package/dist/lib/providers/anthropic/constants.d.ts +0 -3
  957. package/dist/lib/providers/anthropic/constants.js +0 -7
  958. package/dist/lib/providers/anthropic/index.d.ts +0 -2
  959. package/dist/lib/providers/anthropic/index.js +0 -3
  960. package/dist/lib/providers/anthropic/loopAdapter.d.ts +0 -26
  961. package/dist/lib/providers/anthropic/loopAdapter.js +0 -326
  962. package/dist/lib/providers/anthropic/rateLimitCapture.d.ts +0 -82
  963. package/dist/lib/providers/anthropic/rateLimitCapture.js +0 -375
  964. package/dist/lib/providers/anthropic/structuredOutput.d.ts +0 -58
  965. package/dist/lib/providers/anthropic/structuredOutput.js +0 -98
  966. package/dist/lib/providers/anthropic/toolOutput.d.ts +0 -9
  967. package/dist/lib/providers/anthropic/toolOutput.js +0 -39
  968. package/dist/lib/providers/anthropicImageBlocks.d.ts +0 -47
  969. package/dist/lib/providers/anthropicImageBlocks.js +0 -223
  970. package/dist/lib/providers/azureOpenai.d.ts +0 -67
  971. package/dist/lib/providers/azureOpenai.js +0 -230
  972. package/dist/lib/providers/cohere.d.ts +0 -54
  973. package/dist/lib/providers/cohere.js +0 -183
  974. package/dist/lib/providers/configuredOpenAICompat.d.ts +0 -24
  975. package/dist/lib/providers/configuredOpenAICompat.js +0 -67
  976. package/dist/lib/providers/deepseek.d.ts +0 -47
  977. package/dist/lib/providers/deepseek.js +0 -121
  978. package/dist/lib/providers/googleAiStudio/client.d.ts +0 -92
  979. package/dist/lib/providers/googleAiStudio/client.js +0 -1658
  980. package/dist/lib/providers/googleAiStudio/index.d.ts +0 -1
  981. package/dist/lib/providers/googleAiStudio/index.js +0 -2
  982. package/dist/lib/providers/googleNativeGemini3/index.d.ts +0 -1
  983. package/dist/lib/providers/googleNativeGemini3/index.js +0 -2
  984. package/dist/lib/providers/googleNativeGemini3/utils.d.ts +0 -482
  985. package/dist/lib/providers/googleNativeGemini3/utils.js +0 -1527
  986. package/dist/lib/providers/googleVertex/client.d.ts +0 -415
  987. package/dist/lib/providers/googleVertex/client.js +0 -7015
  988. package/dist/lib/providers/googleVertex/constants.d.ts +0 -5
  989. package/dist/lib/providers/googleVertex/constants.js +0 -27
  990. package/dist/lib/providers/googleVertex/index.d.ts +0 -3
  991. package/dist/lib/providers/googleVertex/index.js +0 -4
  992. package/dist/lib/providers/googleVertex/utils.d.ts +0 -12
  993. package/dist/lib/providers/googleVertex/utils.js +0 -287
  994. package/dist/lib/providers/huggingFace/client.d.ts +0 -31
  995. package/dist/lib/providers/huggingFace/client.js +0 -103
  996. package/dist/lib/providers/huggingFace/index.d.ts +0 -1
  997. package/dist/lib/providers/huggingFace/index.js +0 -2
  998. package/dist/lib/providers/ideogram.d.ts +0 -34
  999. package/dist/lib/providers/ideogram.js +0 -184
  1000. package/dist/lib/providers/jina.d.ts +0 -58
  1001. package/dist/lib/providers/jina.js +0 -217
  1002. package/dist/lib/providers/litellm/client.d.ts +0 -84
  1003. package/dist/lib/providers/litellm/client.js +0 -504
  1004. package/dist/lib/providers/litellm/index.d.ts +0 -1
  1005. package/dist/lib/providers/litellm/index.js +0 -2
  1006. package/dist/lib/providers/llamaCpp.d.ts +0 -24
  1007. package/dist/lib/providers/llamaCpp.js +0 -80
  1008. package/dist/lib/providers/lmStudio.d.ts +0 -29
  1009. package/dist/lib/providers/lmStudio.js +0 -88
  1010. package/dist/lib/providers/nvidiaNim/client.d.ts +0 -60
  1011. package/dist/lib/providers/nvidiaNim/client.js +0 -291
  1012. package/dist/lib/providers/nvidiaNim/constants.d.ts +0 -1
  1013. package/dist/lib/providers/nvidiaNim/constants.js +0 -2
  1014. package/dist/lib/providers/nvidiaNim/index.d.ts +0 -2
  1015. package/dist/lib/providers/nvidiaNim/index.js +0 -3
  1016. package/dist/lib/providers/ollama/client.d.ts +0 -71
  1017. package/dist/lib/providers/ollama/client.js +0 -283
  1018. package/dist/lib/providers/ollama/constants.d.ts +0 -4
  1019. package/dist/lib/providers/ollama/constants.js +0 -6
  1020. package/dist/lib/providers/ollama/index.d.ts +0 -2
  1021. package/dist/lib/providers/ollama/index.js +0 -3
  1022. package/dist/lib/providers/openAI/client.d.ts +0 -76
  1023. package/dist/lib/providers/openAI/client.js +0 -503
  1024. package/dist/lib/providers/openAI/index.d.ts +0 -1
  1025. package/dist/lib/providers/openAI/index.js +0 -2
  1026. package/dist/lib/providers/openRouter/client.d.ts +0 -75
  1027. package/dist/lib/providers/openRouter/client.js +0 -402
  1028. package/dist/lib/providers/openRouter/constants.d.ts +0 -1
  1029. package/dist/lib/providers/openRouter/constants.js +0 -2
  1030. package/dist/lib/providers/openRouter/index.d.ts +0 -3
  1031. package/dist/lib/providers/openRouter/index.js +0 -4
  1032. package/dist/lib/providers/openRouter/utils.d.ts +0 -1
  1033. package/dist/lib/providers/openRouter/utils.js +0 -6
  1034. package/dist/lib/providers/openaiChatCompletionsBase.d.ts +0 -212
  1035. package/dist/lib/providers/openaiChatCompletionsBase.js +0 -1154
  1036. package/dist/lib/providers/openaiChatCompletionsClient.d.ts +0 -70
  1037. package/dist/lib/providers/openaiChatCompletionsClient.js +0 -684
  1038. package/dist/lib/providers/openaiCompatCatalog.d.ts +0 -24
  1039. package/dist/lib/providers/openaiCompatCatalog.js +0 -270
  1040. package/dist/lib/providers/openaiCompatible/client.d.ts +0 -21
  1041. package/dist/lib/providers/openaiCompatible/client.js +0 -91
  1042. package/dist/lib/providers/openaiCompatible/constants.d.ts +0 -1
  1043. package/dist/lib/providers/openaiCompatible/constants.js +0 -2
  1044. package/dist/lib/providers/openaiCompatible/index.d.ts +0 -3
  1045. package/dist/lib/providers/openaiCompatible/index.js +0 -4
  1046. package/dist/lib/providers/openaiCompatible/utils.d.ts +0 -5
  1047. package/dist/lib/providers/openaiCompatible/utils.js +0 -17
  1048. package/dist/lib/providers/providerTypeUtils.d.ts +0 -23
  1049. package/dist/lib/providers/providerTypeUtils.js +0 -41
  1050. package/dist/lib/providers/recraft.d.ts +0 -34
  1051. package/dist/lib/providers/recraft.js +0 -197
  1052. package/dist/lib/providers/replicate.d.ts +0 -74
  1053. package/dist/lib/providers/replicate.js +0 -416
  1054. package/dist/lib/providers/sagemaker/adaptive-semaphore.d.ts +0 -74
  1055. package/dist/lib/providers/sagemaker/adaptive-semaphore.js +0 -216
  1056. package/dist/lib/providers/sagemaker/client.d.ts +0 -161
  1057. package/dist/lib/providers/sagemaker/client.js +0 -509
  1058. package/dist/lib/providers/sagemaker/config.d.ts +0 -87
  1059. package/dist/lib/providers/sagemaker/config.js +0 -355
  1060. package/dist/lib/providers/sagemaker/detection.d.ts +0 -121
  1061. package/dist/lib/providers/sagemaker/detection.js +0 -607
  1062. package/dist/lib/providers/sagemaker/diagnostics.d.ts +0 -14
  1063. package/dist/lib/providers/sagemaker/diagnostics.js +0 -138
  1064. package/dist/lib/providers/sagemaker/error-constants.d.ts +0 -78
  1065. package/dist/lib/providers/sagemaker/error-constants.js +0 -228
  1066. package/dist/lib/providers/sagemaker/errors.d.ts +0 -90
  1067. package/dist/lib/providers/sagemaker/errors.js +0 -301
  1068. package/dist/lib/providers/sagemaker/index.d.ts +0 -34
  1069. package/dist/lib/providers/sagemaker/index.js +0 -69
  1070. package/dist/lib/providers/sagemaker/language-model.d.ts +0 -207
  1071. package/dist/lib/providers/sagemaker/language-model.js +0 -805
  1072. package/dist/lib/providers/sagemaker/parsers.d.ts +0 -111
  1073. package/dist/lib/providers/sagemaker/parsers.js +0 -644
  1074. package/dist/lib/providers/sagemaker/streaming.d.ts +0 -48
  1075. package/dist/lib/providers/sagemaker/streaming.js +0 -390
  1076. package/dist/lib/providers/sagemaker/structured-parser.d.ts +0 -117
  1077. package/dist/lib/providers/sagemaker/structured-parser.js +0 -626
  1078. package/dist/lib/providers/stability.d.ts +0 -37
  1079. package/dist/lib/providers/stability.js +0 -191
  1080. package/dist/lib/providers/voyage.d.ts +0 -46
  1081. package/dist/lib/providers/voyage.js +0 -176
  1082. package/dist/lib/proxy/accountCooldown.d.ts +0 -5
  1083. package/dist/lib/proxy/accountCooldown.js +0 -121
  1084. package/dist/lib/proxy/accountQuota.d.ts +0 -84
  1085. package/dist/lib/proxy/accountQuota.js +0 -459
  1086. package/dist/lib/proxy/accountQuotaRefreshCoordinator.d.ts +0 -19
  1087. package/dist/lib/proxy/accountQuotaRefreshCoordinator.js +0 -105
  1088. package/dist/lib/proxy/accountSelection.d.ts +0 -8
  1089. package/dist/lib/proxy/accountSelection.js +0 -26
  1090. package/dist/lib/proxy/accountUsage.d.ts +0 -45
  1091. package/dist/lib/proxy/accountUsage.js +0 -302
  1092. package/dist/lib/proxy/awsProxyIntegration.d.ts +0 -23
  1093. package/dist/lib/proxy/awsProxyIntegration.js +0 -286
  1094. package/dist/lib/proxy/claudeFormat.d.ts +0 -129
  1095. package/dist/lib/proxy/claudeFormat.js +0 -600
  1096. package/dist/lib/proxy/cloaking/index.d.ts +0 -43
  1097. package/dist/lib/proxy/cloaking/index.js +0 -88
  1098. package/dist/lib/proxy/cloaking/plugins/headerScrubber.d.ts +0 -9
  1099. package/dist/lib/proxy/cloaking/plugins/headerScrubber.js +0 -87
  1100. package/dist/lib/proxy/cloaking/plugins/sessionIdentity.d.ts +0 -11
  1101. package/dist/lib/proxy/cloaking/plugins/sessionIdentity.js +0 -42
  1102. package/dist/lib/proxy/cloaking/plugins/systemPromptInjector.d.ts +0 -11
  1103. package/dist/lib/proxy/cloaking/plugins/systemPromptInjector.js +0 -84
  1104. package/dist/lib/proxy/cloaking/plugins/tlsFingerprint.d.ts +0 -14
  1105. package/dist/lib/proxy/cloaking/plugins/tlsFingerprint.js +0 -39
  1106. package/dist/lib/proxy/cloaking/plugins/wordObfuscator.d.ts +0 -9
  1107. package/dist/lib/proxy/cloaking/plugins/wordObfuscator.js +0 -122
  1108. package/dist/lib/proxy/codexAccountUsage.d.ts +0 -26
  1109. package/dist/lib/proxy/codexAccountUsage.js +0 -174
  1110. package/dist/lib/proxy/globalInstaller.d.ts +0 -19
  1111. package/dist/lib/proxy/globalInstaller.js +0 -242
  1112. package/dist/lib/proxy/logCleanupScheduler.d.ts +0 -12
  1113. package/dist/lib/proxy/logCleanupScheduler.js +0 -74
  1114. package/dist/lib/proxy/logCleanupWorkerEntry.d.ts +0 -1
  1115. package/dist/lib/proxy/logCleanupWorkerEntry.js +0 -15
  1116. package/dist/lib/proxy/modelRouter.d.ts +0 -34
  1117. package/dist/lib/proxy/modelRouter.js +0 -74
  1118. package/dist/lib/proxy/oauthFetch.d.ts +0 -36
  1119. package/dist/lib/proxy/oauthFetch.js +0 -353
  1120. package/dist/lib/proxy/openaiFormat.d.ts +0 -139
  1121. package/dist/lib/proxy/openaiFormat.js +0 -817
  1122. package/dist/lib/proxy/providerTransportCoordinator.d.ts +0 -17
  1123. package/dist/lib/proxy/providerTransportCoordinator.js +0 -156
  1124. package/dist/lib/proxy/proxyActivity.d.ts +0 -8
  1125. package/dist/lib/proxy/proxyActivity.js +0 -117
  1126. package/dist/lib/proxy/proxyAnalysis.d.ts +0 -3
  1127. package/dist/lib/proxy/proxyAnalysis.js +0 -901
  1128. package/dist/lib/proxy/proxyConfig.d.ts +0 -42
  1129. package/dist/lib/proxy/proxyConfig.js +0 -700
  1130. package/dist/lib/proxy/proxyDispatcher.d.ts +0 -5
  1131. package/dist/lib/proxy/proxyDispatcher.js +0 -61
  1132. package/dist/lib/proxy/proxyEnv.d.ts +0 -3
  1133. package/dist/lib/proxy/proxyEnv.js +0 -73
  1134. package/dist/lib/proxy/proxyFetch.d.ts +0 -49
  1135. package/dist/lib/proxy/proxyFetch.js +0 -700
  1136. package/dist/lib/proxy/proxyHealth.d.ts +0 -20
  1137. package/dist/lib/proxy/proxyHealth.js +0 -76
  1138. package/dist/lib/proxy/proxyLifecycle.d.ts +0 -13
  1139. package/dist/lib/proxy/proxyLifecycle.js +0 -383
  1140. package/dist/lib/proxy/proxyPaths.d.ts +0 -17
  1141. package/dist/lib/proxy/proxyPaths.js +0 -42
  1142. package/dist/lib/proxy/proxyReplay.d.ts +0 -10
  1143. package/dist/lib/proxy/proxyReplay.js +0 -765
  1144. package/dist/lib/proxy/proxyTracer.d.ts +0 -117
  1145. package/dist/lib/proxy/proxyTracer.js +0 -726
  1146. package/dist/lib/proxy/proxyTranslationEngine.d.ts +0 -125
  1147. package/dist/lib/proxy/proxyTranslationEngine.js +0 -723
  1148. package/dist/lib/proxy/quietDetector.d.ts +0 -17
  1149. package/dist/lib/proxy/quietDetector.js +0 -125
  1150. package/dist/lib/proxy/quotaHeaders.d.ts +0 -73
  1151. package/dist/lib/proxy/quotaHeaders.js +0 -189
  1152. package/dist/lib/proxy/rawStreamCapture.d.ts +0 -2
  1153. package/dist/lib/proxy/rawStreamCapture.js +0 -129
  1154. package/dist/lib/proxy/requestLogger.d.ts +0 -78
  1155. package/dist/lib/proxy/requestLogger.js +0 -770
  1156. package/dist/lib/proxy/rollingProxyServer.d.ts +0 -3
  1157. package/dist/lib/proxy/rollingProxyServer.js +0 -220
  1158. package/dist/lib/proxy/rollingWorkerProcess.d.ts +0 -2
  1159. package/dist/lib/proxy/rollingWorkerProcess.js +0 -199
  1160. package/dist/lib/proxy/rollingWorkerProtocol.d.ts +0 -5
  1161. package/dist/lib/proxy/rollingWorkerProtocol.js +0 -46
  1162. package/dist/lib/proxy/rollingWorkerSupervisor.d.ts +0 -44
  1163. package/dist/lib/proxy/rollingWorkerSupervisor.js +0 -530
  1164. package/dist/lib/proxy/routingEvidence.d.ts +0 -17
  1165. package/dist/lib/proxy/routingEvidence.js +0 -59
  1166. package/dist/lib/proxy/routingPolicy.d.ts +0 -19
  1167. package/dist/lib/proxy/routingPolicy.js +0 -75
  1168. package/dist/lib/proxy/runtimeConfig.d.ts +0 -27
  1169. package/dist/lib/proxy/runtimeConfig.js +0 -448
  1170. package/dist/lib/proxy/snapshotPersistence.d.ts +0 -2
  1171. package/dist/lib/proxy/snapshotPersistence.js +0 -41
  1172. package/dist/lib/proxy/socketWorkerRuntime.d.ts +0 -14
  1173. package/dist/lib/proxy/socketWorkerRuntime.js +0 -322
  1174. package/dist/lib/proxy/sseInterceptor.d.ts +0 -41
  1175. package/dist/lib/proxy/sseInterceptor.js +0 -496
  1176. package/dist/lib/proxy/streamOutcome.d.ts +0 -5
  1177. package/dist/lib/proxy/streamOutcome.js +0 -104
  1178. package/dist/lib/proxy/systemRelocation.d.ts +0 -21
  1179. package/dist/lib/proxy/systemRelocation.js +0 -51
  1180. package/dist/lib/proxy/tokenRefresh.d.ts +0 -18
  1181. package/dist/lib/proxy/tokenRefresh.js +0 -257
  1182. package/dist/lib/proxy/updateChecker.d.ts +0 -17
  1183. package/dist/lib/proxy/updateChecker.js +0 -98
  1184. package/dist/lib/proxy/updateCoordinator.d.ts +0 -7
  1185. package/dist/lib/proxy/updateCoordinator.js +0 -60
  1186. package/dist/lib/proxy/updateState.d.ts +0 -69
  1187. package/dist/lib/proxy/updateState.js +0 -309
  1188. package/dist/lib/proxy/updaterSupervisor.d.ts +0 -3
  1189. package/dist/lib/proxy/updaterSupervisor.js +0 -58
  1190. package/dist/lib/proxy/usageStats.d.ts +0 -91
  1191. package/dist/lib/proxy/usageStats.js +0 -1154
  1192. package/dist/lib/proxy/utils/noProxyUtils.d.ts +0 -39
  1193. package/dist/lib/proxy/utils/noProxyUtils.js +0 -150
  1194. package/dist/lib/proxy/workerLog.d.ts +0 -6
  1195. package/dist/lib/proxy/workerLog.js +0 -42
  1196. package/dist/lib/rag/ChunkerFactory.d.ts +0 -91
  1197. package/dist/lib/rag/ChunkerFactory.js +0 -321
  1198. package/dist/lib/rag/ChunkerRegistry.d.ts +0 -91
  1199. package/dist/lib/rag/ChunkerRegistry.js +0 -422
  1200. package/dist/lib/rag/chunkers/BaseChunker.d.ts +0 -53
  1201. package/dist/lib/rag/chunkers/BaseChunker.js +0 -158
  1202. package/dist/lib/rag/chunkers/CharacterChunker.d.ts +0 -18
  1203. package/dist/lib/rag/chunkers/CharacterChunker.js +0 -29
  1204. package/dist/lib/rag/chunkers/HTMLChunker.d.ts +0 -19
  1205. package/dist/lib/rag/chunkers/HTMLChunker.js +0 -39
  1206. package/dist/lib/rag/chunkers/JSONChunker.d.ts +0 -19
  1207. package/dist/lib/rag/chunkers/JSONChunker.js +0 -69
  1208. package/dist/lib/rag/chunkers/LaTeXChunker.d.ts +0 -15
  1209. package/dist/lib/rag/chunkers/LaTeXChunker.js +0 -64
  1210. package/dist/lib/rag/chunkers/MarkdownChunker.d.ts +0 -37
  1211. package/dist/lib/rag/chunkers/MarkdownChunker.js +0 -315
  1212. package/dist/lib/rag/chunkers/RecursiveChunker.d.ts +0 -27
  1213. package/dist/lib/rag/chunkers/RecursiveChunker.js +0 -140
  1214. package/dist/lib/rag/chunkers/SemanticMarkdownChunker.d.ts +0 -22
  1215. package/dist/lib/rag/chunkers/SemanticMarkdownChunker.js +0 -139
  1216. package/dist/lib/rag/chunkers/SentenceChunker.d.ts +0 -19
  1217. package/dist/lib/rag/chunkers/SentenceChunker.js +0 -67
  1218. package/dist/lib/rag/chunkers/TokenChunker.d.ts +0 -19
  1219. package/dist/lib/rag/chunkers/TokenChunker.js +0 -62
  1220. package/dist/lib/rag/chunkers/index.d.ts +0 -15
  1221. package/dist/lib/rag/chunkers/index.js +0 -16
  1222. package/dist/lib/rag/chunking/characterChunker.d.ts +0 -16
  1223. package/dist/lib/rag/chunking/characterChunker.js +0 -143
  1224. package/dist/lib/rag/chunking/chunkerRegistry.d.ts +0 -67
  1225. package/dist/lib/rag/chunking/chunkerRegistry.js +0 -195
  1226. package/dist/lib/rag/chunking/htmlChunker.d.ts +0 -34
  1227. package/dist/lib/rag/chunking/htmlChunker.js +0 -248
  1228. package/dist/lib/rag/chunking/index.d.ts +0 -15
  1229. package/dist/lib/rag/chunking/index.js +0 -18
  1230. package/dist/lib/rag/chunking/jsonChunker.d.ts +0 -20
  1231. package/dist/lib/rag/chunking/jsonChunker.js +0 -282
  1232. package/dist/lib/rag/chunking/latexChunker.d.ts +0 -26
  1233. package/dist/lib/rag/chunking/latexChunker.js +0 -252
  1234. package/dist/lib/rag/chunking/markdownChunker.d.ts +0 -35
  1235. package/dist/lib/rag/chunking/markdownChunker.js +0 -383
  1236. package/dist/lib/rag/chunking/recursiveChunker.d.ts +0 -19
  1237. package/dist/lib/rag/chunking/recursiveChunker.js +0 -149
  1238. package/dist/lib/rag/chunking/semanticChunker.d.ts +0 -41
  1239. package/dist/lib/rag/chunking/semanticChunker.js +0 -306
  1240. package/dist/lib/rag/chunking/sentenceChunker.d.ts +0 -25
  1241. package/dist/lib/rag/chunking/sentenceChunker.js +0 -231
  1242. package/dist/lib/rag/chunking/tokenChunker.d.ts +0 -36
  1243. package/dist/lib/rag/chunking/tokenChunker.js +0 -184
  1244. package/dist/lib/rag/document/MDocument.d.ts +0 -198
  1245. package/dist/lib/rag/document/MDocument.js +0 -392
  1246. package/dist/lib/rag/document/index.d.ts +0 -5
  1247. package/dist/lib/rag/document/index.js +0 -6
  1248. package/dist/lib/rag/document/loaders.d.ts +0 -142
  1249. package/dist/lib/rag/document/loaders.js +0 -544
  1250. package/dist/lib/rag/errors/RAGError.d.ts +0 -244
  1251. package/dist/lib/rag/errors/RAGError.js +0 -275
  1252. package/dist/lib/rag/errors/index.d.ts +0 -6
  1253. package/dist/lib/rag/errors/index.js +0 -7
  1254. package/dist/lib/rag/graphRag/graphRAG.d.ts +0 -115
  1255. package/dist/lib/rag/graphRag/graphRAG.js +0 -402
  1256. package/dist/lib/rag/graphRag/index.d.ts +0 -4
  1257. package/dist/lib/rag/graphRag/index.js +0 -5
  1258. package/dist/lib/rag/index.d.ts +0 -104
  1259. package/dist/lib/rag/index.js +0 -144
  1260. package/dist/lib/rag/metadata/MetadataExtractorFactory.d.ts +0 -103
  1261. package/dist/lib/rag/metadata/MetadataExtractorFactory.js +0 -419
  1262. package/dist/lib/rag/metadata/MetadataExtractorRegistry.d.ts +0 -99
  1263. package/dist/lib/rag/metadata/MetadataExtractorRegistry.js +0 -363
  1264. package/dist/lib/rag/metadata/index.d.ts +0 -6
  1265. package/dist/lib/rag/metadata/index.js +0 -10
  1266. package/dist/lib/rag/metadata/metadataExtractor.d.ts +0 -69
  1267. package/dist/lib/rag/metadata/metadataExtractor.js +0 -281
  1268. package/dist/lib/rag/pipeline/RAGPipeline.d.ts +0 -105
  1269. package/dist/lib/rag/pipeline/RAGPipeline.js +0 -436
  1270. package/dist/lib/rag/pipeline/contextAssembly.d.ts +0 -80
  1271. package/dist/lib/rag/pipeline/contextAssembly.js +0 -342
  1272. package/dist/lib/rag/pipeline/index.d.ts +0 -5
  1273. package/dist/lib/rag/pipeline/index.js +0 -6
  1274. package/dist/lib/rag/ragIntegration.d.ts +0 -30
  1275. package/dist/lib/rag/ragIntegration.js +0 -327
  1276. package/dist/lib/rag/reranker/RerankerFactory.d.ts +0 -124
  1277. package/dist/lib/rag/reranker/RerankerFactory.js +0 -431
  1278. package/dist/lib/rag/reranker/RerankerRegistry.d.ts +0 -119
  1279. package/dist/lib/rag/reranker/RerankerRegistry.js +0 -403
  1280. package/dist/lib/rag/reranker/index.d.ts +0 -6
  1281. package/dist/lib/rag/reranker/index.js +0 -10
  1282. package/dist/lib/rag/reranker/reranker.d.ts +0 -70
  1283. package/dist/lib/rag/reranker/reranker.js +0 -307
  1284. package/dist/lib/rag/resilience/CircuitBreaker.d.ts +0 -142
  1285. package/dist/lib/rag/resilience/CircuitBreaker.js +0 -432
  1286. package/dist/lib/rag/resilience/RetryHandler.d.ts +0 -95
  1287. package/dist/lib/rag/resilience/RetryHandler.js +0 -305
  1288. package/dist/lib/rag/resilience/index.d.ts +0 -7
  1289. package/dist/lib/rag/resilience/index.js +0 -8
  1290. package/dist/lib/rag/retrieval/hybridSearch.d.ts +0 -53
  1291. package/dist/lib/rag/retrieval/hybridSearch.js +0 -339
  1292. package/dist/lib/rag/retrieval/index.d.ts +0 -5
  1293. package/dist/lib/rag/retrieval/index.js +0 -6
  1294. package/dist/lib/rag/retrieval/vectorQueryTool.d.ts +0 -72
  1295. package/dist/lib/rag/retrieval/vectorQueryTool.js +0 -325
  1296. package/dist/lib/rag/stores/chroma.d.ts +0 -90
  1297. package/dist/lib/rag/stores/chroma.js +0 -281
  1298. package/dist/lib/rag/stores/index.d.ts +0 -21
  1299. package/dist/lib/rag/stores/index.js +0 -22
  1300. package/dist/lib/rag/stores/pgvector.d.ts +0 -95
  1301. package/dist/lib/rag/stores/pgvector.js +0 -400
  1302. package/dist/lib/rag/stores/pinecone.d.ts +0 -85
  1303. package/dist/lib/rag/stores/pinecone.js +0 -159
  1304. package/dist/lib/routing/classifierRouter.d.ts +0 -52
  1305. package/dist/lib/routing/classifierRouter.js +0 -269
  1306. package/dist/lib/routing/classifierStrategies.d.ts +0 -23
  1307. package/dist/lib/routing/classifierStrategies.js +0 -156
  1308. package/dist/lib/routing/index.d.ts +0 -9
  1309. package/dist/lib/routing/index.js +0 -10
  1310. package/dist/lib/routing/modelPool.d.ts +0 -83
  1311. package/dist/lib/routing/modelPool.js +0 -243
  1312. package/dist/lib/routing/requestRouter.d.ts +0 -30
  1313. package/dist/lib/routing/requestRouter.js +0 -81
  1314. package/dist/lib/sdk/toolRegistration.d.ts +0 -74
  1315. package/dist/lib/sdk/toolRegistration.js +0 -383
  1316. package/dist/lib/server/abstract/baseServerAdapter.d.ts +0 -171
  1317. package/dist/lib/server/abstract/baseServerAdapter.js +0 -575
  1318. package/dist/lib/server/adapters/expressAdapter.d.ts +0 -70
  1319. package/dist/lib/server/adapters/expressAdapter.js +0 -487
  1320. package/dist/lib/server/adapters/fastifyAdapter.d.ts +0 -70
  1321. package/dist/lib/server/adapters/fastifyAdapter.js +0 -473
  1322. package/dist/lib/server/adapters/honoAdapter.d.ts +0 -77
  1323. package/dist/lib/server/adapters/honoAdapter.js +0 -633
  1324. package/dist/lib/server/adapters/index.d.ts +0 -7
  1325. package/dist/lib/server/adapters/index.js +0 -8
  1326. package/dist/lib/server/adapters/koaAdapter.d.ts +0 -79
  1327. package/dist/lib/server/adapters/koaAdapter.js +0 -511
  1328. package/dist/lib/server/errors.d.ts +0 -193
  1329. package/dist/lib/server/errors.js +0 -487
  1330. package/dist/lib/server/factory/serverAdapterFactory.d.ts +0 -73
  1331. package/dist/lib/server/factory/serverAdapterFactory.js +0 -161
  1332. package/dist/lib/server/index.d.ts +0 -46
  1333. package/dist/lib/server/index.js +0 -122
  1334. package/dist/lib/server/middleware/abortSignal.d.ts +0 -52
  1335. package/dist/lib/server/middleware/abortSignal.js +0 -112
  1336. package/dist/lib/server/middleware/auth.d.ts +0 -166
  1337. package/dist/lib/server/middleware/auth.js +0 -404
  1338. package/dist/lib/server/middleware/cache.d.ts +0 -161
  1339. package/dist/lib/server/middleware/cache.js +0 -370
  1340. package/dist/lib/server/middleware/common.d.ts +0 -108
  1341. package/dist/lib/server/middleware/common.js +0 -297
  1342. package/dist/lib/server/middleware/deprecation.d.ts +0 -40
  1343. package/dist/lib/server/middleware/deprecation.js +0 -191
  1344. package/dist/lib/server/middleware/index.d.ts +0 -12
  1345. package/dist/lib/server/middleware/index.js +0 -13
  1346. package/dist/lib/server/middleware/mcpBodyAttachment.d.ts +0 -42
  1347. package/dist/lib/server/middleware/mcpBodyAttachment.js +0 -64
  1348. package/dist/lib/server/middleware/rateLimit.d.ts +0 -70
  1349. package/dist/lib/server/middleware/rateLimit.js +0 -224
  1350. package/dist/lib/server/middleware/validation.d.ts +0 -69
  1351. package/dist/lib/server/middleware/validation.js +0 -393
  1352. package/dist/lib/server/openapi/generator.d.ts +0 -61
  1353. package/dist/lib/server/openapi/generator.js +0 -399
  1354. package/dist/lib/server/openapi/index.d.ts +0 -7
  1355. package/dist/lib/server/openapi/index.js +0 -37
  1356. package/dist/lib/server/openapi/schemas.d.ts +0 -94
  1357. package/dist/lib/server/openapi/schemas.js +0 -696
  1358. package/dist/lib/server/openapi/templates.d.ts +0 -108
  1359. package/dist/lib/server/openapi/templates.js +0 -375
  1360. package/dist/lib/server/routes/agentRoutes.d.ts +0 -9
  1361. package/dist/lib/server/routes/agentRoutes.js +0 -423
  1362. package/dist/lib/server/routes/claudeProxyRoutes.d.ts +0 -491
  1363. package/dist/lib/server/routes/claudeProxyRoutes.js +0 -6455
  1364. package/dist/lib/server/routes/codexProxyRoutes.d.ts +0 -64
  1365. package/dist/lib/server/routes/codexProxyRoutes.js +0 -454
  1366. package/dist/lib/server/routes/healthRoutes.d.ts +0 -9
  1367. package/dist/lib/server/routes/healthRoutes.js +0 -234
  1368. package/dist/lib/server/routes/index.d.ts +0 -25
  1369. package/dist/lib/server/routes/index.js +0 -66
  1370. package/dist/lib/server/routes/mcpRoutes.d.ts +0 -9
  1371. package/dist/lib/server/routes/mcpRoutes.js +0 -376
  1372. package/dist/lib/server/routes/memoryRoutes.d.ts +0 -11
  1373. package/dist/lib/server/routes/memoryRoutes.js +0 -366
  1374. package/dist/lib/server/routes/openApiRoutes.d.ts +0 -34
  1375. package/dist/lib/server/routes/openApiRoutes.js +0 -151
  1376. package/dist/lib/server/routes/openaiProxyRoutes.d.ts +0 -38
  1377. package/dist/lib/server/routes/openaiProxyRoutes.js +0 -399
  1378. package/dist/lib/server/routes/toolRoutes.d.ts +0 -9
  1379. package/dist/lib/server/routes/toolRoutes.js +0 -272
  1380. package/dist/lib/server/streaming/dataStream.d.ts +0 -212
  1381. package/dist/lib/server/streaming/dataStream.js +0 -502
  1382. package/dist/lib/server/streaming/index.d.ts +0 -5
  1383. package/dist/lib/server/streaming/index.js +0 -17
  1384. package/dist/lib/server/utils/redaction.d.ts +0 -68
  1385. package/dist/lib/server/utils/redaction.js +0 -321
  1386. package/dist/lib/server/utils/validation.d.ts +0 -153
  1387. package/dist/lib/server/utils/validation.js +0 -265
  1388. package/dist/lib/server/voice/frameBus.d.ts +0 -8
  1389. package/dist/lib/server/voice/frameBus.js +0 -25
  1390. package/dist/lib/server/voice/tokenCompare.d.ts +0 -14
  1391. package/dist/lib/server/voice/tokenCompare.js +0 -23
  1392. package/dist/lib/server/voice/turnManager.d.ts +0 -15
  1393. package/dist/lib/server/voice/turnManager.js +0 -36
  1394. package/dist/lib/server/voice/voiceServerApp.d.ts +0 -1
  1395. package/dist/lib/server/voice/voiceServerApp.js +0 -177
  1396. package/dist/lib/server/voice/voiceWebSocketHandler.d.ts +0 -24
  1397. package/dist/lib/server/voice/voiceWebSocketHandler.js +0 -669
  1398. package/dist/lib/server/websocket/WebSocketHandler.d.ts +0 -107
  1399. package/dist/lib/server/websocket/WebSocketHandler.js +0 -384
  1400. package/dist/lib/server/websocket/index.d.ts +0 -4
  1401. package/dist/lib/server/websocket/index.js +0 -5
  1402. package/dist/lib/services/server/ai/observability/instrumentation.d.ts +0 -229
  1403. package/dist/lib/services/server/ai/observability/instrumentation.js +0 -1244
  1404. package/dist/lib/session/globalSessionState.d.ts +0 -71
  1405. package/dist/lib/session/globalSessionState.js +0 -235
  1406. package/dist/lib/skills/skillMatcher.d.ts +0 -55
  1407. package/dist/lib/skills/skillMatcher.js +0 -170
  1408. package/dist/lib/skills/skillSessionTracker.d.ts +0 -52
  1409. package/dist/lib/skills/skillSessionTracker.js +0 -150
  1410. package/dist/lib/skills/skillStoreRedis.d.ts +0 -30
  1411. package/dist/lib/skills/skillStoreRedis.js +0 -114
  1412. package/dist/lib/skills/skillStoreS3.d.ts +0 -56
  1413. package/dist/lib/skills/skillStoreS3.js +0 -305
  1414. package/dist/lib/skills/skillStores.d.ts +0 -58
  1415. package/dist/lib/skills/skillStores.js +0 -341
  1416. package/dist/lib/skills/skillTools.d.ts +0 -35
  1417. package/dist/lib/skills/skillTools.js +0 -451
  1418. package/dist/lib/skills/skillsManager.d.ts +0 -78
  1419. package/dist/lib/skills/skillsManager.js +0 -281
  1420. package/dist/lib/tasks/autoresearchTaskExecutor.d.ts +0 -31
  1421. package/dist/lib/tasks/autoresearchTaskExecutor.js +0 -304
  1422. package/dist/lib/tasks/backends/bullmqBackend.d.ts +0 -33
  1423. package/dist/lib/tasks/backends/bullmqBackend.js +0 -206
  1424. package/dist/lib/tasks/backends/nodeTimeoutBackend.d.ts +0 -27
  1425. package/dist/lib/tasks/backends/nodeTimeoutBackend.js +0 -141
  1426. package/dist/lib/tasks/backends/taskBackendRegistry.d.ts +0 -31
  1427. package/dist/lib/tasks/backends/taskBackendRegistry.js +0 -66
  1428. package/dist/lib/tasks/errors.d.ts +0 -33
  1429. package/dist/lib/tasks/errors.js +0 -19
  1430. package/dist/lib/tasks/store/fileTaskStore.d.ts +0 -43
  1431. package/dist/lib/tasks/store/fileTaskStore.js +0 -179
  1432. package/dist/lib/tasks/store/redisTaskStore.d.ts +0 -43
  1433. package/dist/lib/tasks/store/redisTaskStore.js +0 -222
  1434. package/dist/lib/tasks/taskExecutor.d.ts +0 -22
  1435. package/dist/lib/tasks/taskExecutor.js +0 -170
  1436. package/dist/lib/tasks/taskManager.d.ts +0 -65
  1437. package/dist/lib/tasks/taskManager.js +0 -545
  1438. package/dist/lib/tasks/tools/taskTools.d.ts +0 -20
  1439. package/dist/lib/tasks/tools/taskTools.js +0 -265
  1440. package/dist/lib/telemetry/attributes.d.ts +0 -136
  1441. package/dist/lib/telemetry/attributes.js +0 -165
  1442. package/dist/lib/telemetry/index.d.ts +0 -20
  1443. package/dist/lib/telemetry/index.js +0 -28
  1444. package/dist/lib/telemetry/telemetryService.d.ts +0 -58
  1445. package/dist/lib/telemetry/telemetryService.js +0 -387
  1446. package/dist/lib/telemetry/traceContext.d.ts +0 -9
  1447. package/dist/lib/telemetry/traceContext.js +0 -19
  1448. package/dist/lib/telemetry/tracers.d.ts +0 -38
  1449. package/dist/lib/telemetry/tracers.js +0 -40
  1450. package/dist/lib/telemetry/withSpan.d.ts +0 -39
  1451. package/dist/lib/telemetry/withSpan.js +0 -138
  1452. package/dist/lib/tools/toolDiscovery.d.ts +0 -70
  1453. package/dist/lib/tools/toolDiscovery.js +0 -303
  1454. package/dist/lib/tools/toolGate.d.ts +0 -16
  1455. package/dist/lib/tools/toolGate.js +0 -51
  1456. package/dist/lib/tools/toolPolicy.d.ts +0 -40
  1457. package/dist/lib/tools/toolPolicy.js +0 -194
  1458. package/dist/lib/types/action.d.ts +0 -207
  1459. package/dist/lib/types/action.js +0 -7
  1460. package/dist/lib/types/agentNetwork.d.ts +0 -1199
  1461. package/dist/lib/types/agentNetwork.js +0 -8
  1462. package/dist/lib/types/aliases.d.ts +0 -368
  1463. package/dist/lib/types/aliases.js +0 -50
  1464. package/dist/lib/types/analytics.d.ts +0 -215
  1465. package/dist/lib/types/analytics.js +0 -6
  1466. package/dist/lib/types/artifact.d.ts +0 -70
  1467. package/dist/lib/types/artifact.js +0 -11
  1468. package/dist/lib/types/auth.d.ts +0 -1140
  1469. package/dist/lib/types/auth.js +0 -10
  1470. package/dist/lib/types/autoresearch.d.ts +0 -206
  1471. package/dist/lib/types/autoresearch.js +0 -18
  1472. package/dist/lib/types/avatar.d.ts +0 -150
  1473. package/dist/lib/types/avatar.js +0 -20
  1474. package/dist/lib/types/circuitBreakerErrors.d.ts +0 -30
  1475. package/dist/lib/types/circuitBreakerErrors.js +0 -35
  1476. package/dist/lib/types/classifierRouter.d.ts +0 -194
  1477. package/dist/lib/types/classifierRouter.js +0 -17
  1478. package/dist/lib/types/cli.d.ts +0 -1734
  1479. package/dist/lib/types/cli.js +0 -22
  1480. package/dist/lib/types/client.d.ts +0 -1287
  1481. package/dist/lib/types/client.js +0 -11
  1482. package/dist/lib/types/codex.d.ts +0 -95
  1483. package/dist/lib/types/codex.js +0 -15
  1484. package/dist/lib/types/common.d.ts +0 -434
  1485. package/dist/lib/types/common.js +0 -52
  1486. package/dist/lib/types/config.d.ts +0 -506
  1487. package/dist/lib/types/config.js +0 -54
  1488. package/dist/lib/types/content.d.ts +0 -18
  1489. package/dist/lib/types/content.js +0 -20
  1490. package/dist/lib/types/context.d.ts +0 -587
  1491. package/dist/lib/types/context.js +0 -401
  1492. package/dist/lib/types/conversation.d.ts +0 -637
  1493. package/dist/lib/types/conversation.js +0 -48
  1494. package/dist/lib/types/conversationMemoryInterface.d.ts +0 -59
  1495. package/dist/lib/types/conversationMemoryInterface.js +0 -7
  1496. package/dist/lib/types/domain.d.ts +0 -62
  1497. package/dist/lib/types/domain.js +0 -6
  1498. package/dist/lib/types/dynamic.d.ts +0 -110
  1499. package/dist/lib/types/dynamic.js +0 -10
  1500. package/dist/lib/types/elicitation.d.ts +0 -278
  1501. package/dist/lib/types/elicitation.js +0 -11
  1502. package/dist/lib/types/enums.d.ts +0 -9
  1503. package/dist/lib/types/enums.js +0 -10
  1504. package/dist/lib/types/errors.d.ts +0 -188
  1505. package/dist/lib/types/errors.js +0 -262
  1506. package/dist/lib/types/evaluation.d.ts +0 -647
  1507. package/dist/lib/types/evaluation.js +0 -2
  1508. package/dist/lib/types/evaluationProviders.d.ts +0 -104
  1509. package/dist/lib/types/evaluationProviders.js +0 -6
  1510. package/dist/lib/types/exporter.d.ts +0 -257
  1511. package/dist/lib/types/exporter.js +0 -6
  1512. package/dist/lib/types/externalMcp.d.ts +0 -349
  1513. package/dist/lib/types/externalMcp.js +0 -7
  1514. package/dist/lib/types/file.d.ts +0 -616
  1515. package/dist/lib/types/file.js +0 -5
  1516. package/dist/lib/types/fileReference.d.ts +0 -243
  1517. package/dist/lib/types/fileReference.js +0 -22
  1518. package/dist/lib/types/generate.d.ts +0 -1520
  1519. package/dist/lib/types/generate.js +0 -2
  1520. package/dist/lib/types/grounding.d.ts +0 -231
  1521. package/dist/lib/types/grounding.js +0 -12
  1522. package/dist/lib/types/guardrails.d.ts +0 -116
  1523. package/dist/lib/types/guardrails.js +0 -2
  1524. package/dist/lib/types/hitl.d.ts +0 -237
  1525. package/dist/lib/types/hitl.js +0 -9
  1526. package/dist/lib/types/imageGen.d.ts +0 -255
  1527. package/dist/lib/types/imageGen.js +0 -25
  1528. package/dist/lib/types/index.d.ts +0 -86
  1529. package/dist/lib/types/index.js +0 -98
  1530. package/dist/lib/types/ioProcessor.d.ts +0 -119
  1531. package/dist/lib/types/ioProcessor.js +0 -10
  1532. package/dist/lib/types/isolatedAgent.d.ts +0 -365
  1533. package/dist/lib/types/isolatedAgent.js +0 -12
  1534. package/dist/lib/types/knowledge.d.ts +0 -342
  1535. package/dist/lib/types/knowledge.js +0 -30
  1536. package/dist/lib/types/livekit.d.ts +0 -512
  1537. package/dist/lib/types/livekit.js +0 -13
  1538. package/dist/lib/types/loopEngine.d.ts +0 -306
  1539. package/dist/lib/types/loopEngine.js +0 -2
  1540. package/dist/lib/types/mcp.d.ts +0 -2135
  1541. package/dist/lib/types/mcp.js +0 -6
  1542. package/dist/lib/types/mcpOutput.d.ts +0 -40
  1543. package/dist/lib/types/mcpOutput.js +0 -9
  1544. package/dist/lib/types/memory.d.ts +0 -96
  1545. package/dist/lib/types/memory.js +0 -23
  1546. package/dist/lib/types/middleware.d.ts +0 -435
  1547. package/dist/lib/types/middleware.js +0 -2
  1548. package/dist/lib/types/model.d.ts +0 -342
  1549. package/dist/lib/types/model.js +0 -32
  1550. package/dist/lib/types/modelPool.d.ts +0 -47
  1551. package/dist/lib/types/modelPool.js +0 -11
  1552. package/dist/lib/types/multimodal.d.ts +0 -614
  1553. package/dist/lib/types/multimodal.js +0 -144
  1554. package/dist/lib/types/music.d.ts +0 -172
  1555. package/dist/lib/types/music.js +0 -21
  1556. package/dist/lib/types/nativeTools.d.ts +0 -16
  1557. package/dist/lib/types/nativeTools.js +0 -2
  1558. package/dist/lib/types/noOutputSentinel.d.ts +0 -26
  1559. package/dist/lib/types/noOutputSentinel.js +0 -2
  1560. package/dist/lib/types/observability.d.ts +0 -502
  1561. package/dist/lib/types/observability.js +0 -7
  1562. package/dist/lib/types/openaiCompatible.d.ts +0 -287
  1563. package/dist/lib/types/openaiCompatible.js +0 -2
  1564. package/dist/lib/types/ppt.d.ts +0 -1093
  1565. package/dist/lib/types/ppt.js +0 -37
  1566. package/dist/lib/types/processor.d.ts +0 -993
  1567. package/dist/lib/types/processor.js +0 -91
  1568. package/dist/lib/types/providers.d.ts +0 -2155
  1569. package/dist/lib/types/providers.js +0 -112
  1570. package/dist/lib/types/proxy.d.ts +0 -2724
  1571. package/dist/lib/types/proxy.js +0 -17
  1572. package/dist/lib/types/proxyClient.d.ts +0 -54
  1573. package/dist/lib/types/proxyClient.js +0 -2
  1574. package/dist/lib/types/rag.d.ts +0 -1332
  1575. package/dist/lib/types/rag.js +0 -2
  1576. package/dist/lib/types/realtime.d.ts +0 -243
  1577. package/dist/lib/types/realtime.js +0 -70
  1578. package/dist/lib/types/replicate.d.ts +0 -67
  1579. package/dist/lib/types/replicate.js +0 -10
  1580. package/dist/lib/types/requestRouter.d.ts +0 -75
  1581. package/dist/lib/types/requestRouter.js +0 -16
  1582. package/dist/lib/types/safeFetch.d.ts +0 -24
  1583. package/dist/lib/types/safeFetch.js +0 -7
  1584. package/dist/lib/types/scorer.d.ts +0 -564
  1585. package/dist/lib/types/scorer.js +0 -6
  1586. package/dist/lib/types/sdk.d.ts +0 -23
  1587. package/dist/lib/types/sdk.js +0 -9
  1588. package/dist/lib/types/server.d.ts +0 -1192
  1589. package/dist/lib/types/server.js +0 -68
  1590. package/dist/lib/types/service.d.ts +0 -79
  1591. package/dist/lib/types/service.js +0 -6
  1592. package/dist/lib/types/skills.d.ts +0 -427
  1593. package/dist/lib/types/skills.js +0 -17
  1594. package/dist/lib/types/span.d.ts +0 -247
  1595. package/dist/lib/types/span.js +0 -96
  1596. package/dist/lib/types/stream.d.ts +0 -771
  1597. package/dist/lib/types/stream.js +0 -2
  1598. package/dist/lib/types/streamDedup.d.ts +0 -14
  1599. package/dist/lib/types/streamDedup.js +0 -2
  1600. package/dist/lib/types/streaming.d.ts +0 -15
  1601. package/dist/lib/types/streaming.js +0 -2
  1602. package/dist/lib/types/stt.d.ts +0 -585
  1603. package/dist/lib/types/stt.js +0 -90
  1604. package/dist/lib/types/subscription.d.ts +0 -1064
  1605. package/dist/lib/types/subscription.js +0 -10
  1606. package/dist/lib/types/task.d.ts +0 -313
  1607. package/dist/lib/types/task.js +0 -37
  1608. package/dist/lib/types/taskClassification.d.ts +0 -52
  1609. package/dist/lib/types/taskClassification.js +0 -6
  1610. package/dist/lib/types/toolDedup.d.ts +0 -45
  1611. package/dist/lib/types/toolDedup.js +0 -14
  1612. package/dist/lib/types/toolResolution.d.ts +0 -83
  1613. package/dist/lib/types/toolResolution.js +0 -11
  1614. package/dist/lib/types/toolRouting.d.ts +0 -350
  1615. package/dist/lib/types/toolRouting.js +0 -19
  1616. package/dist/lib/types/tools.d.ts +0 -531
  1617. package/dist/lib/types/tools.js +0 -26
  1618. package/dist/lib/types/tts.d.ts +0 -195
  1619. package/dist/lib/types/tts.js +0 -65
  1620. package/dist/lib/types/utilities.d.ts +0 -310
  1621. package/dist/lib/types/utilities.js +0 -5
  1622. package/dist/lib/types/vectorStoreChroma.d.ts +0 -67
  1623. package/dist/lib/types/vectorStoreChroma.js +0 -12
  1624. package/dist/lib/types/vectorStorePinecone.d.ts +0 -48
  1625. package/dist/lib/types/vectorStorePinecone.js +0 -12
  1626. package/dist/lib/types/video.d.ts +0 -89
  1627. package/dist/lib/types/video.js +0 -15
  1628. package/dist/lib/types/voice.d.ts +0 -272
  1629. package/dist/lib/types/voice.js +0 -137
  1630. package/dist/lib/types/workflow.d.ts +0 -598
  1631. package/dist/lib/types/workflow.js +0 -24
  1632. package/dist/lib/utils/analyticsUtils.d.ts +0 -37
  1633. package/dist/lib/utils/analyticsUtils.js +0 -110
  1634. package/dist/lib/utils/anthropicCacheBreakpoints.d.ts +0 -43
  1635. package/dist/lib/utils/anthropicCacheBreakpoints.js +0 -151
  1636. package/dist/lib/utils/anthropicTraceSanitizer.d.ts +0 -7
  1637. package/dist/lib/utils/anthropicTraceSanitizer.js +0 -26
  1638. package/dist/lib/utils/async/delay.d.ts +0 -40
  1639. package/dist/lib/utils/async/delay.js +0 -43
  1640. package/dist/lib/utils/async/index.d.ts +0 -23
  1641. package/dist/lib/utils/async/index.js +0 -24
  1642. package/dist/lib/utils/async/retry.d.ts +0 -107
  1643. package/dist/lib/utils/async/retry.js +0 -172
  1644. package/dist/lib/utils/async/withTimeout.d.ts +0 -85
  1645. package/dist/lib/utils/async/withTimeout.js +0 -144
  1646. package/dist/lib/utils/asyncMutex.d.ts +0 -14
  1647. package/dist/lib/utils/asyncMutex.js +0 -61
  1648. package/dist/lib/utils/audioFormatDetector.d.ts +0 -15
  1649. package/dist/lib/utils/audioFormatDetector.js +0 -34
  1650. package/dist/lib/utils/avatarProcessor.d.ts +0 -78
  1651. package/dist/lib/utils/avatarProcessor.js +0 -173
  1652. package/dist/lib/utils/cloneOptions.d.ts +0 -36
  1653. package/dist/lib/utils/cloneOptions.js +0 -62
  1654. package/dist/lib/utils/conversationMemory.d.ts +0 -80
  1655. package/dist/lib/utils/conversationMemory.js +0 -670
  1656. package/dist/lib/utils/csvProcessor.d.ts +0 -221
  1657. package/dist/lib/utils/csvProcessor.js +0 -1527
  1658. package/dist/lib/utils/csvUtils.d.ts +0 -26
  1659. package/dist/lib/utils/csvUtils.js +0 -85
  1660. package/dist/lib/utils/errorClassifier.d.ts +0 -30
  1661. package/dist/lib/utils/errorClassifier.js +0 -183
  1662. package/dist/lib/utils/errorHandling.d.ts +0 -398
  1663. package/dist/lib/utils/errorHandling.js +0 -1282
  1664. package/dist/lib/utils/evaluationUtils.d.ts +0 -27
  1665. package/dist/lib/utils/evaluationUtils.js +0 -132
  1666. package/dist/lib/utils/factoryProcessing.d.ts +0 -71
  1667. package/dist/lib/utils/factoryProcessing.js +0 -590
  1668. package/dist/lib/utils/fileDetector.d.ts +0 -198
  1669. package/dist/lib/utils/fileDetector.js +0 -2806
  1670. package/dist/lib/utils/generation.d.ts +0 -8
  1671. package/dist/lib/utils/generation.js +0 -9
  1672. package/dist/lib/utils/generationErrors.d.ts +0 -10
  1673. package/dist/lib/utils/generationErrors.js +0 -11
  1674. package/dist/lib/utils/imageCache.d.ts +0 -124
  1675. package/dist/lib/utils/imageCache.js +0 -437
  1676. package/dist/lib/utils/imageDetection.d.ts +0 -15
  1677. package/dist/lib/utils/imageDetection.js +0 -53
  1678. package/dist/lib/utils/imageProcessor.d.ts +0 -296
  1679. package/dist/lib/utils/imageProcessor.js +0 -1158
  1680. package/dist/lib/utils/isoBmff.d.ts +0 -24
  1681. package/dist/lib/utils/isoBmff.js +0 -83
  1682. package/dist/lib/utils/json/coerce.d.ts +0 -30
  1683. package/dist/lib/utils/json/coerce.js +0 -412
  1684. package/dist/lib/utils/json/extract.d.ts +0 -112
  1685. package/dist/lib/utils/json/extract.js +0 -299
  1686. package/dist/lib/utils/json/index.d.ts +0 -36
  1687. package/dist/lib/utils/json/index.js +0 -37
  1688. package/dist/lib/utils/json/safeParse.d.ts +0 -130
  1689. package/dist/lib/utils/json/safeParse.js +0 -191
  1690. package/dist/lib/utils/lifecycleCallbacks.d.ts +0 -56
  1691. package/dist/lib/utils/lifecycleCallbacks.js +0 -100
  1692. package/dist/lib/utils/lifecycleTimeout.d.ts +0 -25
  1693. package/dist/lib/utils/lifecycleTimeout.js +0 -39
  1694. package/dist/lib/utils/logSanitize.d.ts +0 -285
  1695. package/dist/lib/utils/logSanitize.js +0 -555
  1696. package/dist/lib/utils/logger.d.ts +0 -273
  1697. package/dist/lib/utils/logger.js +0 -516
  1698. package/dist/lib/utils/loggingFetch.d.ts +0 -29
  1699. package/dist/lib/utils/loggingFetch.js +0 -60
  1700. package/dist/lib/utils/loopUtils.d.ts +0 -70
  1701. package/dist/lib/utils/loopUtils.js +0 -263
  1702. package/dist/lib/utils/markupSniff.d.ts +0 -37
  1703. package/dist/lib/utils/markupSniff.js +0 -125
  1704. package/dist/lib/utils/mcpDefaults.d.ts +0 -54
  1705. package/dist/lib/utils/mcpDefaults.js +0 -135
  1706. package/dist/lib/utils/mcpErrorText.d.ts +0 -37
  1707. package/dist/lib/utils/mcpErrorText.js +0 -95
  1708. package/dist/lib/utils/mediaDuration.d.ts +0 -23
  1709. package/dist/lib/utils/mediaDuration.js +0 -45
  1710. package/dist/lib/utils/messageBuilder.d.ts +0 -59
  1711. package/dist/lib/utils/messageBuilder.js +0 -2716
  1712. package/dist/lib/utils/mimeTypeHints.d.ts +0 -40
  1713. package/dist/lib/utils/mimeTypeHints.js +0 -122
  1714. package/dist/lib/utils/modelAliasResolver.d.ts +0 -17
  1715. package/dist/lib/utils/modelAliasResolver.js +0 -55
  1716. package/dist/lib/utils/modelChoices.d.ts +0 -75
  1717. package/dist/lib/utils/modelChoices.js +0 -698
  1718. package/dist/lib/utils/modelDetection.d.ts +0 -37
  1719. package/dist/lib/utils/modelDetection.js +0 -131
  1720. package/dist/lib/utils/modelRouter.d.ts +0 -91
  1721. package/dist/lib/utils/modelRouter.js +0 -293
  1722. package/dist/lib/utils/multimodalOptionsBuilder.d.ts +0 -74
  1723. package/dist/lib/utils/multimodalOptionsBuilder.js +0 -74
  1724. package/dist/lib/utils/musicProcessor.d.ts +0 -77
  1725. package/dist/lib/utils/musicProcessor.js +0 -190
  1726. package/dist/lib/utils/noOutputSentinel.d.ts +0 -67
  1727. package/dist/lib/utils/noOutputSentinel.js +0 -180
  1728. package/dist/lib/utils/observabilityHelpers.d.ts +0 -27
  1729. package/dist/lib/utils/observabilityHelpers.js +0 -48
  1730. package/dist/lib/utils/optionsConversion.d.ts +0 -47
  1731. package/dist/lib/utils/optionsConversion.js +0 -128
  1732. package/dist/lib/utils/optionsUtils.d.ts +0 -175
  1733. package/dist/lib/utils/optionsUtils.js +0 -970
  1734. package/dist/lib/utils/parameterValidation.d.ts +0 -200
  1735. package/dist/lib/utils/parameterValidation.js +0 -981
  1736. package/dist/lib/utils/pdfProcessor.d.ts +0 -137
  1737. package/dist/lib/utils/pdfProcessor.js +0 -689
  1738. package/dist/lib/utils/performance.d.ts +0 -93
  1739. package/dist/lib/utils/performance.js +0 -223
  1740. package/dist/lib/utils/piiDetector.d.ts +0 -24
  1741. package/dist/lib/utils/piiDetector.js +0 -221
  1742. package/dist/lib/utils/pricing.d.ts +0 -17
  1743. package/dist/lib/utils/pricing.js +0 -755
  1744. package/dist/lib/utils/promptRedaction.d.ts +0 -22
  1745. package/dist/lib/utils/promptRedaction.js +0 -63
  1746. package/dist/lib/utils/providerConfig.d.ts +0 -393
  1747. package/dist/lib/utils/providerConfig.js +0 -1363
  1748. package/dist/lib/utils/providerErrorClassification.d.ts +0 -58
  1749. package/dist/lib/utils/providerErrorClassification.js +0 -149
  1750. package/dist/lib/utils/providerHealth.d.ts +0 -253
  1751. package/dist/lib/utils/providerHealth.js +0 -1479
  1752. package/dist/lib/utils/providerRetry.d.ts +0 -68
  1753. package/dist/lib/utils/providerRetry.js +0 -230
  1754. package/dist/lib/utils/providerSetupMessages.d.ts +0 -8
  1755. package/dist/lib/utils/providerSetupMessages.js +0 -122
  1756. package/dist/lib/utils/providerUtils.d.ts +0 -38
  1757. package/dist/lib/utils/providerUtils.js +0 -366
  1758. package/dist/lib/utils/rateLimiter.d.ts +0 -75
  1759. package/dist/lib/utils/rateLimiter.js +0 -201
  1760. package/dist/lib/utils/redis.d.ts +0 -119
  1761. package/dist/lib/utils/redis.js +0 -530
  1762. package/dist/lib/utils/responseValidator.d.ts +0 -21
  1763. package/dist/lib/utils/responseValidator.js +0 -354
  1764. package/dist/lib/utils/retryAfter.d.ts +0 -7
  1765. package/dist/lib/utils/retryAfter.js +0 -44
  1766. package/dist/lib/utils/retryHandler.d.ts +0 -82
  1767. package/dist/lib/utils/retryHandler.js +0 -270
  1768. package/dist/lib/utils/retryability.d.ts +0 -27
  1769. package/dist/lib/utils/retryability.js +0 -45
  1770. package/dist/lib/utils/safeFetch.d.ts +0 -26
  1771. package/dist/lib/utils/safeFetch.js +0 -121
  1772. package/dist/lib/utils/sanitizers/filename.d.ts +0 -116
  1773. package/dist/lib/utils/sanitizers/filename.js +0 -366
  1774. package/dist/lib/utils/sanitizers/html.d.ts +0 -170
  1775. package/dist/lib/utils/sanitizers/html.js +0 -326
  1776. package/dist/lib/utils/sanitizers/index.d.ts +0 -26
  1777. package/dist/lib/utils/sanitizers/index.js +0 -30
  1778. package/dist/lib/utils/sanitizers/svg.d.ts +0 -71
  1779. package/dist/lib/utils/sanitizers/svg.js +0 -482
  1780. package/dist/lib/utils/schemaConversion.d.ts +0 -56
  1781. package/dist/lib/utils/schemaConversion.js +0 -656
  1782. package/dist/lib/utils/sizeGuard.d.ts +0 -34
  1783. package/dist/lib/utils/sizeGuard.js +0 -45
  1784. package/dist/lib/utils/ssrfGuard.d.ts +0 -60
  1785. package/dist/lib/utils/ssrfGuard.js +0 -446
  1786. package/dist/lib/utils/sttProcessor.d.ts +0 -125
  1787. package/dist/lib/utils/sttProcessor.js +0 -301
  1788. package/dist/lib/utils/systemMessages.d.ts +0 -29
  1789. package/dist/lib/utils/systemMessages.js +0 -45
  1790. package/dist/lib/utils/taskClassificationUtils.d.ts +0 -55
  1791. package/dist/lib/utils/taskClassificationUtils.js +0 -150
  1792. package/dist/lib/utils/taskClassifier.d.ts +0 -23
  1793. package/dist/lib/utils/taskClassifier.js +0 -95
  1794. package/dist/lib/utils/textEncoding.d.ts +0 -25
  1795. package/dist/lib/utils/textEncoding.js +0 -141
  1796. package/dist/lib/utils/thinkingConfig.d.ts +0 -76
  1797. package/dist/lib/utils/thinkingConfig.js +0 -105
  1798. package/dist/lib/utils/timeout.d.ts +0 -158
  1799. package/dist/lib/utils/timeout.js +0 -427
  1800. package/dist/lib/utils/tokenEstimation.d.ts +0 -90
  1801. package/dist/lib/utils/tokenEstimation.js +0 -187
  1802. package/dist/lib/utils/tokenLimits.d.ts +0 -53
  1803. package/dist/lib/utils/tokenLimits.js +0 -236
  1804. package/dist/lib/utils/tokenUtils.d.ts +0 -101
  1805. package/dist/lib/utils/tokenUtils.js +0 -323
  1806. package/dist/lib/utils/tool.d.ts +0 -8
  1807. package/dist/lib/utils/tool.js +0 -9
  1808. package/dist/lib/utils/toolCallRepair.d.ts +0 -14
  1809. package/dist/lib/utils/toolCallRepair.js +0 -286
  1810. package/dist/lib/utils/toolChoice.d.ts +0 -4
  1811. package/dist/lib/utils/toolChoice.js +0 -7
  1812. package/dist/lib/utils/toolEndEmitter.d.ts +0 -25
  1813. package/dist/lib/utils/toolEndEmitter.js +0 -65
  1814. package/dist/lib/utils/toolUtils.d.ts +0 -40
  1815. package/dist/lib/utils/toolUtils.js +0 -76
  1816. package/dist/lib/utils/transformationUtils.d.ts +0 -218
  1817. package/dist/lib/utils/transformationUtils.js +0 -578
  1818. package/dist/lib/utils/tripwireEvaluator.d.ts +0 -73
  1819. package/dist/lib/utils/tripwireEvaluator.js +0 -285
  1820. package/dist/lib/utils/tryImport.d.ts +0 -35
  1821. package/dist/lib/utils/tryImport.js +0 -95
  1822. package/dist/lib/utils/ttsProcessor.d.ts +0 -159
  1823. package/dist/lib/utils/ttsProcessor.js +0 -293
  1824. package/dist/lib/utils/typeUtils.d.ts +0 -77
  1825. package/dist/lib/utils/typeUtils.js +0 -98
  1826. package/dist/lib/utils/videoAnalysisProcessor.d.ts +0 -24
  1827. package/dist/lib/utils/videoAnalysisProcessor.js +0 -61
  1828. package/dist/lib/utils/videoProcessor.d.ts +0 -64
  1829. package/dist/lib/utils/videoProcessor.js +0 -196
  1830. package/dist/lib/voice/RealtimeVoiceAPI.d.ts +0 -186
  1831. package/dist/lib/voice/RealtimeVoiceAPI.js +0 -431
  1832. package/dist/lib/voice/audio-utils.d.ts +0 -135
  1833. package/dist/lib/voice/audio-utils.js +0 -435
  1834. package/dist/lib/voice/errors.d.ts +0 -123
  1835. package/dist/lib/voice/errors.js +0 -386
  1836. package/dist/lib/voice/index.d.ts +0 -49
  1837. package/dist/lib/voice/index.js +0 -177
  1838. package/dist/lib/voice/livekit/brain.d.ts +0 -21
  1839. package/dist/lib/voice/livekit/brain.js +0 -75
  1840. package/dist/lib/voice/livekit/config.d.ts +0 -52
  1841. package/dist/lib/voice/livekit/config.js +0 -134
  1842. package/dist/lib/voice/livekit/eventBridge.d.ts +0 -27
  1843. package/dist/lib/voice/livekit/eventBridge.js +0 -360
  1844. package/dist/lib/voice/livekit/index.d.ts +0 -22
  1845. package/dist/lib/voice/livekit/index.js +0 -23
  1846. package/dist/lib/voice/livekit/realtimeEventBridge.d.ts +0 -14
  1847. package/dist/lib/voice/livekit/realtimeEventBridge.js +0 -161
  1848. package/dist/lib/voice/livekit/realtimeMcpTools.d.ts +0 -31
  1849. package/dist/lib/voice/livekit/realtimeMcpTools.js +0 -206
  1850. package/dist/lib/voice/livekit/realtimeVoiceAgent.d.ts +0 -26
  1851. package/dist/lib/voice/livekit/realtimeVoiceAgent.js +0 -365
  1852. package/dist/lib/voice/livekit/roomContext.d.ts +0 -23
  1853. package/dist/lib/voice/livekit/roomContext.js +0 -57
  1854. package/dist/lib/voice/livekit/roomDispatch.d.ts +0 -24
  1855. package/dist/lib/voice/livekit/roomDispatch.js +0 -31
  1856. package/dist/lib/voice/livekit/schemaSanitizer.d.ts +0 -26
  1857. package/dist/lib/voice/livekit/schemaSanitizer.js +0 -144
  1858. package/dist/lib/voice/livekit/tokens.d.ts +0 -19
  1859. package/dist/lib/voice/livekit/tokens.js +0 -51
  1860. package/dist/lib/voice/livekit/vertexAuth.d.ts +0 -30
  1861. package/dist/lib/voice/livekit/vertexAuth.js +0 -73
  1862. package/dist/lib/voice/livekit/voiceAgent.d.ts +0 -32
  1863. package/dist/lib/voice/livekit/voiceAgent.js +0 -425
  1864. package/dist/lib/voice/livekit/voiceAgentWorker.d.ts +0 -29
  1865. package/dist/lib/voice/livekit/voiceAgentWorker.js +0 -122
  1866. package/dist/lib/voice/providers/AzureSTT.d.ts +0 -47
  1867. package/dist/lib/voice/providers/AzureSTT.js +0 -345
  1868. package/dist/lib/voice/providers/AzureTTS.d.ts +0 -59
  1869. package/dist/lib/voice/providers/AzureTTS.js +0 -349
  1870. package/dist/lib/voice/providers/CartesiaTTS.d.ts +0 -31
  1871. package/dist/lib/voice/providers/CartesiaTTS.js +0 -189
  1872. package/dist/lib/voice/providers/DeepgramSTT.d.ts +0 -40
  1873. package/dist/lib/voice/providers/DeepgramSTT.js +0 -550
  1874. package/dist/lib/voice/providers/ElevenLabsTTS.d.ts +0 -53
  1875. package/dist/lib/voice/providers/ElevenLabsTTS.js +0 -311
  1876. package/dist/lib/voice/providers/FishAudioTTS.d.ts +0 -27
  1877. package/dist/lib/voice/providers/FishAudioTTS.js +0 -183
  1878. package/dist/lib/voice/providers/GeminiLive.d.ts +0 -52
  1879. package/dist/lib/voice/providers/GeminiLive.js +0 -372
  1880. package/dist/lib/voice/providers/GoogleSTT.d.ts +0 -60
  1881. package/dist/lib/voice/providers/GoogleSTT.js +0 -454
  1882. package/dist/lib/voice/providers/OpenAIRealtime.d.ts +0 -47
  1883. package/dist/lib/voice/providers/OpenAIRealtime.js +0 -412
  1884. package/dist/lib/voice/providers/OpenAISTT.d.ts +0 -41
  1885. package/dist/lib/voice/providers/OpenAISTT.js +0 -286
  1886. package/dist/lib/voice/providers/OpenAITTS.d.ts +0 -55
  1887. package/dist/lib/voice/providers/OpenAITTS.js +0 -285
  1888. package/dist/lib/voice/stream-handler.d.ts +0 -166
  1889. package/dist/lib/voice/stream-handler.js +0 -514
  1890. package/dist/lib/workflow/LAYER-EXAMPLES.d.ts +0 -13
  1891. package/dist/lib/workflow/LAYER-EXAMPLES.js +0 -312
  1892. package/dist/lib/workflow/PROMPT-EXAMPLES.d.ts +0 -117
  1893. package/dist/lib/workflow/PROMPT-EXAMPLES.js +0 -246
  1894. package/dist/lib/workflow/config.d.ts +0 -376
  1895. package/dist/lib/workflow/config.js +0 -399
  1896. package/dist/lib/workflow/core/ensembleExecutor.d.ts +0 -55
  1897. package/dist/lib/workflow/core/ensembleExecutor.js +0 -451
  1898. package/dist/lib/workflow/core/judgeScorer.d.ts +0 -25
  1899. package/dist/lib/workflow/core/judgeScorer.js +0 -568
  1900. package/dist/lib/workflow/core/responseConditioner.d.ts +0 -21
  1901. package/dist/lib/workflow/core/responseConditioner.js +0 -243
  1902. package/dist/lib/workflow/core/workflowRegistry.d.ts +0 -72
  1903. package/dist/lib/workflow/core/workflowRegistry.js +0 -305
  1904. package/dist/lib/workflow/core/workflowRunner.d.ts +0 -61
  1905. package/dist/lib/workflow/core/workflowRunner.js +0 -642
  1906. package/dist/lib/workflow/index.d.ts +0 -21
  1907. package/dist/lib/workflow/index.js +0 -46
  1908. package/dist/lib/workflow/utils/workflowMetrics.d.ts +0 -74
  1909. package/dist/lib/workflow/utils/workflowMetrics.js +0 -312
  1910. package/dist/lib/workflow/utils/workflowValidation.d.ts +0 -29
  1911. package/dist/lib/workflow/utils/workflowValidation.js +0 -421
  1912. package/dist/lib/workflow/workflows/adaptiveWorkflow.d.ts +0 -72
  1913. package/dist/lib/workflow/workflows/adaptiveWorkflow.js +0 -367
  1914. package/dist/lib/workflow/workflows/consensusWorkflow.d.ts +0 -69
  1915. package/dist/lib/workflow/workflows/consensusWorkflow.js +0 -193
  1916. package/dist/lib/workflow/workflows/fallbackWorkflow.d.ts +0 -49
  1917. package/dist/lib/workflow/workflows/fallbackWorkflow.js +0 -226
  1918. package/dist/lib/workflow/workflows/multiJudgeWorkflow.d.ts +0 -70
  1919. package/dist/lib/workflow/workflows/multiJudgeWorkflow.js +0 -352
  1920. package/dist/providers/googleVertex/utils.d.ts +0 -12
  1921. package/dist/providers/googleVertex/utils.js +0 -286
@@ -1,2662 +0,0 @@
1
- /**
2
- * NeuroLink - Unified AI Interface with Real MCP Tool Integration
3
- *
4
- * REDESIGNED FALLBACK CHAIN - NO CIRCULAR DEPENDENCIES
5
- * Enhanced AI provider system with natural MCP tool access.
6
- * Uses real MCP infrastructure for tool discovery and execution.
7
- */
8
- import type { AgentDefinition, AgentNetworkConfig, AgentRunOptions, AgentRunOutcome, AgentToolRegistrationOptions, IsolatedAgentDefinition, NetworkExecutionInput, NetworkExecutionOptions, NetworkExecutionResult, NetworkStreamChunk, WorkerInstanceOptions } from "./types/index.js";
9
- import type { CompactionConfig, CompactionResult, SpanData, ObservabilityConfig, MetricsSummary, MCPToolAnnotations, TraceView, AuthenticatedContext, AuthProvider, JsonObject, NeuroLinkEvents, TypedEventEmitter, MCPEnhancementsConfig, NeuroLinkAuthConfig, NeurolinkConstructorConfig, ChatMessage, ExternalMCPOperationResult, ExternalMCPServerInstance, ExternalMCPToolInfo, GenerateOptions, GenerateResult, ProviderStatus, TextGenerationOptions, TextGenerationResult, MCPExecutableTool, MCPServerInfo, MCPStatus, StreamOptions, StreamResult, ToolExecutionContext, ToolExecutionSummary, ToolInfo, ToolRegistrationOptions, BatchOperationResult, StreamGenerationEndContext, ToolRoutingServerDescriptor, ToolDedupConfig, ToolConfig, KnowledgeEngineStatus } from "./types/index.js";
10
- import { ConversationMemoryManager } from "./core/conversationMemoryManager.js";
11
- import type { RedisConversationMemoryManager } from "./core/redisConversationMemoryManager.js";
12
- import { ExternalServerManager } from "./mcp/externalServerManager.js";
13
- import { MCPToolRegistry } from "./mcp/toolRegistry.js";
14
- import type { DynamicOptions } from "./types/index.js";
15
- import { SkillsManager } from "./skills/skillsManager.js";
16
- import type { CostAnalysisOptions, CostAnalysisResult, ProviderMetricsOptions, ProviderMetricsResult, TeamAnalyticsOptions, TeamAnalyticsResult } from "./types/index.js";
17
- import { TaskManager } from "./tasks/taskManager.js";
18
- import type { SessionExport, SessionListItem } from "./types/index.js";
19
- /**
20
- * Curator P2-4 dedup (concurrency-safe): native providers emit
21
- * `generation:end` on the shared SDK emitter. We attach a fresh
22
- * mutable `dedupContext` object directly to the per-call
23
- * `StreamOptions` (under `_streamDedupContext`) so each stream gets
24
- * its own instance — concurrent streams have different option objects
25
- * and therefore different contexts, so they cannot interfere.
26
- *
27
- * Native provider emit sites read `options._streamDedupContext` and
28
- * flip `.providerEmitted = true` before emitting; the orchestration's
29
- * finally block reads the same closed-over reference and skips its
30
- * own emit when the flag is set.
31
- *
32
- * This avoids the AsyncLocalStorage approach which doesn't reliably
33
- * propagate through async-generator yield boundaries when iteration
34
- * happens from outside the original `run()` scope (e.g. when the
35
- * consumer drives `for await of result.stream` after `sdk.stream(...)`
36
- * returns).
37
- */
38
- export declare const STREAM_DEDUP_CONTEXT_KEY: "_streamDedupContext";
39
- /**
40
- * Native providers call this from their `generation:end` emit sites,
41
- * passing the same `options` object they received. Safe no-op when
42
- * the field isn't set.
43
- */
44
- export declare function markStreamProviderEmittedGenerationEnd(options: {
45
- _streamDedupContext?: StreamGenerationEndContext;
46
- } | undefined): void;
47
- /**
48
- * Symbol-based brand for cross-module identification without circular imports.
49
- *
50
- * Provider constructors receive `sdk?: unknown` (the factory layer's
51
- * contract). Rather than duck-typing via `"getInMemoryServers" in sdk`,
52
- * use `isNeuroLink(value)` from this module to do a brand check —
53
- * survives minification AND doesn't rely on method-name stability.
54
- */
55
- export declare const NEUROLINK_BRAND: unique symbol;
56
- /**
57
- * Type-guard for opaque values that should be a {@link NeuroLink} instance.
58
- *
59
- * Designed for the provider-factory boundary where TS can't carry the type
60
- * through `UnknownRecord` without forcing every caller into a circular
61
- * dependency. Cheap to call and unaffected by minification.
62
- */
63
- export declare function isNeuroLink(value: unknown): value is NeuroLink;
64
- export declare class NeuroLink {
65
- private mcpInitialized;
66
- private mcpSkipped;
67
- private mcpInitPromise;
68
- private emitter;
69
- private _taskManager?;
70
- private _taskManagerConfig?;
71
- private toolRegistry;
72
- private autoDiscoveredServerInfos;
73
- private externalServerManager;
74
- private toolCache;
75
- private readonly toolCacheDuration;
76
- private modelAliasConfig?;
77
- private lastCompactionMessageCount;
78
- /** Extract sessionId from options context for compaction watermark keying */
79
- private getCompactionSessionId;
80
- private mcpToolResultCache?;
81
- private mcpToolRouter?;
82
- private mcpToolBatcher?;
83
- private mcpEnhancedDiscovery?;
84
- private mcpToolMiddlewares;
85
- /** Artifact store for externalized MCP tool outputs (set when strategy=externalize). */
86
- private mcpArtifactStore?;
87
- private _disableToolCacheForCurrentRequest;
88
- private mcpEnhancementsConfig?;
89
- private toolCircuitBreakers;
90
- private toolExecutionMetrics;
91
- private currentStreamToolExecutions;
92
- private toolExecutionHistory;
93
- private activeToolExecutions;
94
- /**
95
- * Helper method to emit tool end event in a consistent way
96
- * Used by executeTool in both success and error paths
97
- * @param toolName - Name of the tool
98
- * @param startTime - Timestamp when tool execution started
99
- * @param success - Whether the tool execution was successful
100
- * @param result - The result of the tool execution (optional)
101
- * @param error - The error if execution failed (optional)
102
- */
103
- private emitToolEndEvent;
104
- conversationMemory?: ConversationMemoryManager | RedisConversationMemoryManager | null;
105
- private conversationMemoryNeedsInit;
106
- private conversationMemoryConfig?;
107
- private toolRoutingConfig?;
108
- private toolRoutingCacheInstance?;
109
- private toolRoutingVectorCache?;
110
- private knowledgeGroundingEngine?;
111
- private toolDedupConfig?;
112
- private toolsConfig?;
113
- /** Session-scoped pins of tools discovered via search_tools (tools.discovery mode). */
114
- private discoveryPins;
115
- private enableOrchestration;
116
- private authProvider?;
117
- private pendingAuthConfig?;
118
- private authInitPromise?;
119
- private credentials?;
120
- private readonly fallbackConfig;
121
- private readonly modelPool;
122
- private readonly requestRouter;
123
- private readonly classifierRouter;
124
- /**
125
- * Merge instance-level credentials with per-call credentials.
126
- *
127
- * Semantics: **deep merge at the provider level.** For each provider key
128
- * present in both `this.credentials` and `callCredentials`, the per-call
129
- * fields are merged ON TOP of the instance-level fields, so fields not
130
- * mentioned in the per-call slice are preserved.
131
- *
132
- * Example:
133
- * ```
134
- * instance: { openai: { apiKey: "key1", baseURL: "url1" } }
135
- * per-call: { openai: { apiKey: "key2" } }
136
- * merged: { openai: { apiKey: "key2", baseURL: "url1" } } // baseURL preserved
137
- * ```
138
- *
139
- * Providers present only in one source are carried through unchanged.
140
- * Unrelated providers (not overridden in callCredentials) are carried through
141
- * from instance credentials unchanged.
142
- */
143
- private resolveCredentials;
144
- private hitlManager?;
145
- private _sessionCostUsd;
146
- private fileRegistry;
147
- private cachedFileTools;
148
- private memoryInstance?;
149
- private memorySDKConfig?;
150
- private skillsManagerInstance?;
151
- private skillsConfig?;
152
- /**
153
- * Extract and set Langfuse context from options with proper async scoping
154
- */
155
- private setLangfuseContextFromOptions;
156
- private createMetricsTraceContext;
157
- private enforceSessionBudget;
158
- private assertInputText;
159
- private applyAuthenticatedRequestContext;
160
- private applyGenerateLifecycleMiddleware;
161
- private applyStreamLifecycleMiddleware;
162
- private initializeMemoryConfig;
163
- /**
164
- * Lazy initialization for memory — called during generate/stream.
165
- */
166
- private ensureMemoryReady;
167
- /**
168
- * Context storage for tool execution
169
- * This context will be merged with any runtime context passed by the AI model
170
- */
171
- private toolExecutionContext?;
172
- /**
173
- * Set when registerAgentTool() has registered at least one delegation
174
- * tool — gates the per-turn delegation scope in generate().
175
- */
176
- private hasAgentTools;
177
- /**
178
- * Creates a new NeuroLink instance for AI text generation with MCP tool integration.
179
- *
180
- * @param config - Optional configuration object
181
- * @param config.conversationMemory - Configuration for conversation memory features
182
- * @param config.conversationMemory.enabled - Whether to enable conversation memory (default: false)
183
- * @param config.conversationMemory.maxSessions - Maximum number of concurrent sessions (default: 100)
184
- * @param config.conversationMemory.maxTurnsPerSession - Maximum conversation turns per session (default: 50)
185
- * @param config.enableOrchestration - Whether to enable smart model orchestration (default: false)
186
- * @param config.hitl - Configuration for Human-in-the-Loop safety features
187
- * @param config.hitl.enabled - Whether to enable HITL tool confirmation (default: false)
188
- * @param config.hitl.dangerousActions - Keywords that trigger confirmation (default: ['delete', 'remove', 'drop'])
189
- * @param config.hitl.timeout - Confirmation timeout in milliseconds (default: 30000)
190
- * @param config.hitl.allowArgumentModification - Allow users to modify tool parameters (default: true)
191
- * @param config.toolRegistry - Optional tool registry instance for advanced use cases (default: new MCPToolRegistry())
192
- *
193
- * @example
194
- * ```typescript
195
- * // Basic usage
196
- * const neurolink = new NeuroLink();
197
- *
198
- * // With conversation memory
199
- * const neurolink = new NeuroLink({
200
- * conversationMemory: {
201
- * enabled: true,
202
- * maxSessions: 50,
203
- * maxTurnsPerSession: 20
204
- * }
205
- * });
206
- *
207
- * // With orchestration enabled
208
- * const neurolink = new NeuroLink({
209
- * enableOrchestration: true
210
- * });
211
- *
212
- * // With HITL safety features
213
- * const neurolink = new NeuroLink({
214
- * hitl: {
215
- * enabled: true,
216
- * dangerousActions: ['delete', 'remove', 'drop', 'truncate'],
217
- * timeout: 30000,
218
- * allowArgumentModification: true
219
- * }
220
- * });
221
- * ```
222
- *
223
- * @throws {Error} When provider registry setup fails
224
- * @throws {Error} When conversation memory initialization fails (if enabled)
225
- * @throws {Error} When external server manager initialization fails
226
- * @throws {Error} When HITL configuration is invalid (if enabled)
227
- */
228
- private observabilityConfig?;
229
- private metricsAggregator;
230
- private analyticsService;
231
- /**
232
- * Per-request metrics trace context backed by AsyncLocalStorage.
233
- * Safe for concurrent requests on the same SDK instance.
234
- * Context is set via metricsTraceContextStorage.run() in generate/stream.
235
- */
236
- private get _metricsTraceContext();
237
- constructor(config?: NeurolinkConstructorConfig);
238
- /**
239
- * TaskManager — scheduled and self-running tasks.
240
- * Lazy-initialized on first access. Configurable via constructor `tasks` option.
241
- * The actual async initialization (Redis connect, backend start) happens
242
- * lazily inside TaskManager on first operation.
243
- */
244
- get tasks(): TaskManager;
245
- /**
246
- * Initialize provider registry with security settings
247
- */
248
- private initializeProviderRegistry;
249
- /**
250
- * Initialize conversation memory if enabled
251
- */
252
- private initializeConversationMemory;
253
- /**
254
- * Initialize HITL (Human-in-the-Loop) if enabled
255
- */
256
- private initializeHITL;
257
- /**
258
- * Initialize MCP enhancement modules (cache, router, batcher, discovery).
259
- * Wires standalone MCP modules into the core SDK execution path.
260
- */
261
- private initializeMCPEnhancements;
262
- /**
263
- * Register file reference tools with the MCP tool registry.
264
- *
265
- * Creates file access tools (list_attached_files, read_file_section,
266
- * search_in_file, get_file_preview) bound to the FileReferenceRegistry
267
- * and registers them as direct tools so they're available to LLMs.
268
- */
269
- private registerFileTools;
270
- /**
271
- * Register task management tools bound to a TaskManager instance.
272
- * Follows the same factory + registry pattern as registerFileTools().
273
- * Called when TaskManager is created (eagerly or lazily via the `tasks` getter).
274
- */
275
- private registerTaskTools;
276
- /**
277
- * Register memory retrieval tools that allow the AI to access
278
- * conversation history, including full tool outputs.
279
- * Only registered when Redis conversation memory is active.
280
- */
281
- private registerMemoryRetrievalTools;
282
- /**
283
- * Lazy initialization for the skills subsystem — mirrors ensureMemoryReady().
284
- * Returns null (and stays null) when skills are not configured or the
285
- * store failed to initialize; read paths fail open on that null.
286
- */
287
- private ensureSkillsReady;
288
- /**
289
- * Register the built-in skill tools (list_skills, plus
290
- * mutation tools when allowMutations is set). Follows the
291
- * registerMemoryRetrievalTools() pattern: registered via registerTool()
292
- * so they land in the "user-defined" category that reaches the LLM tool
293
- * schema, with the manager resolved lazily at execution time.
294
- */
295
- private registerSkillTools;
296
- /**
297
- * Skills augmentation for one generate()/stream() call:
298
- * 1. Discovery — surface the skills listing per the resolved mode:
299
- * embedded in the use_skill tool description ("tool", default) or
300
- * appended to the system prompt ("system-prompt").
301
- * 2. Per-call tools — inject use_skill + read_skill_resource into
302
- * options.tools (the RAG-tool pattern; same-name entries shadow
303
- * registered tools) with the sessionId closure-bound so activations
304
- * pin to the session.
305
- * 3. Preload — activate host-requested skills up front, injecting their
306
- * instructions into this call's system prompt and pinning them.
307
- * Fails open: any error leaves the call untouched.
308
- */
309
- private applySkillsAugmentation;
310
- /** Session id for skill activation tracking, from the call context. */
311
- private resolveSkillSessionId;
312
- /** User id for skill-session hydration (Redis keys sessions by userId). */
313
- private resolveSkillUserId;
314
- /**
315
- * Activate host-requested skills before the model runs: instructions go
316
- * into this call's system prompt; when persisting, the activation is
317
- * pinned so later turns replay it from history instead. Unknown or
318
- * already-active names are skipped with a warn/debug log (fail-open).
319
- */
320
- private preloadSkills;
321
- /**
322
- * Pinned skill messages recorded during this turn, ready for
323
- * StoreConversationTurnOptions.skillMessages. Empty when skills are off
324
- * or nothing was activated.
325
- */
326
- private drainPendingSkillMessages;
327
- /**
328
- * Programmatic access to the skills subsystem (search/list/get/mutations).
329
- * Returns null when skills are not configured or failed to initialize.
330
- */
331
- getSkillsManager(): SkillsManager | null;
332
- /** Format memory context for prompt inclusion */
333
- private formatMemoryContext;
334
- /**
335
- * Format memory context from multiple users into a labeled block.
336
- */
337
- private formatMultiUserMemoryContext;
338
- /**
339
- * Determine whether memory should be read (retrieved) for this call.
340
- * Respects both the global memory SDK config and per-call overrides.
341
- */
342
- private shouldReadMemory;
343
- /**
344
- * Determine whether memory should be written (stored) for this call.
345
- * Respects both the global memory SDK config and per-call overrides.
346
- */
347
- private shouldWriteMemory;
348
- /**
349
- * Retrieve condensed memory for a user (and optionally additional users).
350
- * Returns the input text enhanced with memory context, or unchanged if no memory.
351
- */
352
- private retrieveMemory;
353
- /**
354
- * Store a conversation turn in memory (non-blocking).
355
- * Calls add(userId, content) which internally condenses old + new via LLM.
356
- * Supports additional users with per-user prompt and maxWords overrides.
357
- */
358
- private storeMemoryInBackground;
359
- /**
360
- * Set up HITL event forwarding to main emitter
361
- */
362
- private setupHITLEventForwarding;
363
- /**
364
- * Initialize external server manager with event handlers
365
- */
366
- private initializeExternalServerManager;
367
- /**
368
- * Setup event handlers for external server manager
369
- */
370
- private setupExternalServerEventHandlers;
371
- /**
372
- * Initialize Langfuse observability for AI operations tracking
373
- */
374
- private initializeLangfuse;
375
- /**
376
- * Log constructor completion with final state summary
377
- */
378
- private logConstructorComplete;
379
- /**
380
- * Initialize MCP registry with enhanced error handling and resource cleanup
381
- * Uses isolated async context to prevent hanging
382
- */
383
- private initializeMCP;
384
- /**
385
- * Actual one-shot MCP initialization logic. Called at most once per
386
- * NeuroLink instance lifetime (unless cleanup() resets the flag).
387
- */
388
- private performMCPInitializationOnce;
389
- /**
390
- * Import performance manager with error handling
391
- */
392
- private importPerformanceManager;
393
- /**
394
- * Perform main MCP initialization logic
395
- */
396
- private performMCPInitialization;
397
- /**
398
- * Initialize tool registry with timeout protection
399
- */
400
- private initializeToolRegistryInternal;
401
- /**
402
- * Initialize provider registry
403
- */
404
- private initializeProviderRegistryInternal;
405
- /**
406
- * Register direct tools server
407
- */
408
- private registerDirectToolsServerInternal;
409
- /**
410
- * Load MCP configuration from .mcp-config.json with parallel loading for improved performance
411
- */
412
- private loadMCPConfigurationInternal;
413
- /**
414
- * Log MCP initialization completion
415
- */
416
- private logMCPInitComplete;
417
- /**
418
- * Apply orchestration to determine optimal provider and model
419
- * @param options - Original GenerateOptions
420
- * @returns Modified options with orchestrated provider marked in context, or empty object if validation fails
421
- */
422
- private applyOrchestration;
423
- /**
424
- * Apply orchestration to determine optimal provider and model for streaming
425
- * @param options - Original StreamOptions
426
- * @returns Modified options with orchestrated provider marked in context, or empty object if validation fails
427
- */
428
- private applyStreamOrchestration;
429
- /**
430
- * MAIN ENTRY POINT: Enhanced generate method with new function signature
431
- * Replaces both generateText and legacy methods
432
- */
433
- /**
434
- * Extracts the original prompt text from the provided input.
435
- * If a string is provided, it returns the string directly.
436
- * If a GenerateOptions object is provided, it returns the input text from the object.
437
- * @param optionsOrPrompt The prompt input, either as a string or a GenerateOptions object.
438
- * @returns The original prompt text as a string.
439
- */
440
- private _extractOriginalPrompt;
441
- /**
442
- * Generate AI content using the best available provider with MCP tool integration.
443
- * This is the primary method for text generation with full feature support.
444
- *
445
- * @param optionsOrPrompt - Either a string prompt or a comprehensive GenerateOptions object
446
- * @param optionsOrPrompt.input - Input configuration object
447
- * @param optionsOrPrompt.input.text - The text prompt to send to the AI (required)
448
- * @param optionsOrPrompt.provider - AI provider to use ('auto', 'openai', 'anthropic', etc.)
449
- * @param optionsOrPrompt.model - Specific model to use (e.g., 'gpt-4', 'claude-3-opus')
450
- * @param optionsOrPrompt.temperature - Randomness in response (0.0 = deterministic, 2.0 = very random)
451
- * @param optionsOrPrompt.maxTokens - Maximum tokens in response
452
- * @param optionsOrPrompt.systemPrompt - System message to set AI behavior
453
- * @param optionsOrPrompt.disableTools - Whether to disable MCP tool usage
454
- * @param optionsOrPrompt.enableAnalytics - Whether to include usage analytics
455
- * @param optionsOrPrompt.enableEvaluation - Whether to include response quality evaluation
456
- * @param optionsOrPrompt.context - Additional context for the request
457
- * @param optionsOrPrompt.evaluationDomain - Domain for specialized evaluation
458
- * @param optionsOrPrompt.toolUsageContext - Context for tool usage decisions
459
- *
460
- * @returns Promise resolving to GenerateResult with content, usage data, and optional analytics
461
- *
462
- * @example
463
- * ```typescript
464
- * // Simple usage with string prompt
465
- * const result = await neurolink.generate("What is artificial intelligence?");
466
- * console.log(result.content);
467
- *
468
- * // Advanced usage with options
469
- * const result = await neurolink.generate({
470
- * input: { text: "Explain quantum computing" },
471
- * provider: "openai",
472
- * model: "gpt-4",
473
- * temperature: 0.7,
474
- * maxTokens: 500,
475
- * enableAnalytics: true,
476
- * enableEvaluation: true,
477
- * context: { domain: "science", level: "intermediate" }
478
- * });
479
- *
480
- * // Access analytics and evaluation data
481
- * console.log(result.analytics?.usage);
482
- * console.log(result.evaluation?.relevance);
483
- * ```
484
- *
485
- * @throws {Error} When input text is missing or invalid
486
- * @throws {Error} When all providers fail to generate content
487
- * @throws {Error} When conversation memory operations fail (if enabled)
488
- */
489
- /**
490
- * Get observability configuration
491
- */
492
- getObservabilityConfig(): ObservabilityConfig | undefined;
493
- /**
494
- * Check if Langfuse telemetry is enabled
495
- * Centralized utility to avoid duplication across providers
496
- */
497
- isTelemetryEnabled(): boolean;
498
- /**
499
- * Get comprehensive telemetry status including Langfuse, OTel, and exporter health
500
- */
501
- getTelemetryStatus(): {
502
- enabled: boolean;
503
- langfuse?: {
504
- enabled: boolean;
505
- baseUrl?: string;
506
- environment?: string;
507
- };
508
- openTelemetry?: {
509
- enabled: boolean;
510
- endpoint?: string;
511
- serviceName?: string;
512
- };
513
- exporters?: Array<{
514
- name: string;
515
- enabled: boolean;
516
- healthy: boolean;
517
- pendingSpans: number;
518
- lastExportTime?: string;
519
- latencyMs?: number;
520
- errors?: string[];
521
- }>;
522
- };
523
- /**
524
- * Get aggregated observability metrics (latency, tokens, cost, success rate)
525
- */
526
- getMetrics(): MetricsSummary;
527
- /**
528
- * Get all recorded spans
529
- */
530
- getSpans(): SpanData[];
531
- /**
532
- * Get traces (spans grouped by traceId with parent-child hierarchy)
533
- */
534
- getTraces(): TraceView[];
535
- /**
536
- * Reset all collected metrics and spans
537
- */
538
- resetMetrics(): void;
539
- /**
540
- * Record a span for metrics tracking
541
- */
542
- recordMetricsSpan(span: SpanData): void;
543
- /**
544
- * Get provider metrics analysis
545
- * Retrieves aggregated performance, token usage, latency, and success rates per provider.
546
- *
547
- * @param options - Filtering options
548
- * @returns Comprehensive provider metrics result
549
- */
550
- getProviderMetrics(options?: ProviderMetricsOptions): Promise<ProviderMetricsResult>;
551
- /**
552
- * Get cost analysis breakdown
553
- * Analyzes AI generation costs across requested groups and provides future projections.
554
- *
555
- * @param options - Cost configuration options
556
- * @returns Detailed cost analysis breakdown
557
- */
558
- getCostAnalysis(options?: CostAnalysisOptions): Promise<CostAnalysisResult>;
559
- /**
560
- * Get team-wide usage analytics
561
- * Retrieves request counts, unique active users, provider breakdown, and quality scoring.
562
- *
563
- * @param options - Team query options
564
- * @returns Comprehensive team analytics report
565
- */
566
- getTeamAnalytics(options?: TeamAnalyticsOptions): Promise<TeamAnalyticsResult>;
567
- /**
568
- * Record a memory operation span to both instance and global metrics aggregators.
569
- * This ensures memory spans are visible via sdk.getSpans() and getMetricsAggregator().getSpans().
570
- */
571
- private recordMemorySpan;
572
- /**
573
- * Public method to initialize Langfuse observability
574
- * This method can be called externally to ensure Langfuse is properly initialized
575
- */
576
- initializeLangfuseObservability(): Promise<void>;
577
- /**
578
- * Gracefully shutdown NeuroLink and all MCP connections
579
- */
580
- shutdown(): Promise<void>;
581
- /**
582
- * Fire-and-forget analytics tracking with rejection logging.
583
- */
584
- private enqueueAnalyticsTrackRequest;
585
- /**
586
- * Estimate cost using the canonical SDK pricing table (same source as
587
- * AnalyticsService.trackRequest) — avoids diverging TokenTracker rates.
588
- */
589
- private estimateCostFromUsage;
590
- /**
591
- * Handle generation:end for Pipeline B spans + advanced analytics.
592
- * When pipelineAHandled is set, skips Pipeline B spans but still tracks
593
- * analytics so successful AI-SDK generate/stream calls are recorded.
594
- * Stream analytics are owned here (not stream:complete) to avoid duplicates.
595
- */
596
- private handleGenerationEndMetrics;
597
- /**
598
- * Pipeline B span recording for stream:complete.
599
- * Advanced analytics are recorded from generation:end only (avoids duplicates
600
- * when both stream:complete and generation:end fire for the same request).
601
- */
602
- private handleStreamCompleteMetrics;
603
- private handleToolEndMetrics;
604
- /**
605
- * Pipeline B span recording for stream:error.
606
- * Analytics for failed streams come from generation:end (success: false).
607
- */
608
- private handleStreamErrorMetrics;
609
- /**
610
- * Initialize event listeners that feed span data to MetricsAggregator.
611
- * Listens to generation:end, stream:complete, and tool:end events.
612
- */
613
- private initializeMetricsListeners;
614
- /**
615
- * Generate AI response with comprehensive feature support.
616
- *
617
- * Primary method for AI generation with support for all NeuroLink features:
618
- * - Multi-provider support (14+ providers)
619
- * - MCP tool integration
620
- * - Structured JSON output with Zod schemas
621
- * - Conversation memory (Redis or in-memory)
622
- * - HITL security workflows
623
- * - Middleware execution
624
- * - Multimodal inputs (images, PDFs, CSV)
625
- *
626
- * @category Generation
627
- *
628
- * @param optionsOrPrompt - Generation options or simple text prompt
629
- * @param optionsOrPrompt.input - Input text and optional files
630
- * @param optionsOrPrompt.provider - AI provider name (e.g., 'vertex', 'openai', 'anthropic')
631
- * @param optionsOrPrompt.model - Model name to use
632
- * @param optionsOrPrompt.tools - MCP tools to enable for this generation
633
- * @param optionsOrPrompt.schema - Zod schema for structured output validation
634
- * @param optionsOrPrompt.temperature - Sampling temperature (0-2, default: 1.0)
635
- * @param optionsOrPrompt.maxTokens - Maximum tokens to generate
636
- * @param optionsOrPrompt.thinkingConfig - Extended thinking configuration (thinkingLevel: 'minimal'|'low'|'medium'|'high')
637
- * @param optionsOrPrompt.context - Context with conversationId and userId for memory
638
- * @param optionsOrPrompt.useKnowledgeGrounding - Whether to use the instance's configured knowledge for this call
639
- * @returns Promise resolving to generation result with content and metadata
640
- *
641
- * @example Basic text generation
642
- * ```typescript
643
- * const result = await neurolink.generate({
644
- * input: { text: 'Explain quantum computing' }
645
- * });
646
- * console.log(result.content);
647
- * ```
648
- *
649
- * @example With specific provider
650
- * ```typescript
651
- * const result = await neurolink.generate({
652
- * input: { text: 'Write a poem' },
653
- * provider: 'anthropic',
654
- * model: 'claude-3-opus'
655
- * });
656
- * ```
657
- *
658
- * @example With MCP tools
659
- * ```typescript
660
- * const result = await neurolink.generate({
661
- * input: { text: 'Read README.md and summarize it' },
662
- * tools: ['readFile']
663
- * });
664
- * ```
665
- *
666
- * @example With structured output
667
- * ```typescript
668
- * import { z } from 'zod';
669
- *
670
- * const schema = z.object({
671
- * name: z.string(),
672
- * age: z.number(),
673
- * city: z.string()
674
- * });
675
- *
676
- * const result = await neurolink.generate({
677
- * input: { text: 'Extract person info: John is 30 years old from NYC' },
678
- * schema: schema
679
- * });
680
- * // result.structuredData is type-safe!
681
- * ```
682
- *
683
- * @example With conversation memory
684
- * ```typescript
685
- * const result = await neurolink.generate({
686
- * input: { text: 'What did we discuss earlier?' },
687
- * context: {
688
- * conversationId: 'conv-123',
689
- * userId: 'user-456'
690
- * }
691
- * });
692
- * ```
693
- *
694
- * @example With multimodal input
695
- * ```typescript
696
- * const result = await neurolink.generate({
697
- * input: {
698
- * text: 'Describe this image',
699
- * images: ['/path/to/image.jpg']
700
- * },
701
- * provider: 'vertex'
702
- * });
703
- * ```
704
- *
705
- * @throws {Error} When input text is missing or invalid
706
- * @throws {Error} When all providers fail to generate content
707
- * @throws {Error} When structured output validation fails
708
- * @throws {Error} When HITL approval is denied
709
- *
710
- * @see {@link GenerateOptions} for all available options
711
- * @see {@link GenerateResult} for result structure
712
- * @see {@link stream} for streaming generation
713
- * @since 1.0.0
714
- */
715
- generate(optionsOrPrompt: GenerateOptions | DynamicOptions | string): Promise<GenerateResult>;
716
- private fireConsumerOnErrorIfNotFired;
717
- /**
718
- * Curator P2-3: wraps a generate/stream call with the fallback
719
- * orchestration (`providerFallback` callback + `modelChain` walker).
720
- *
721
- * On a qualifying error from the inner call:
722
- * 1. Resolve the effective callback (per-call > instance > synthesised
723
- * from modelChain) and the effective chain (per-call > instance).
724
- * 2. Walk attempts: invoke callback (or pop next chain entry) → emit
725
- * `model.fallback` event → re-call inner with the new {provider,
726
- * model}.
727
- * 3. Stop on first success, on a callback returning null, or after
728
- * exhausting the chain (throw the most recent error).
729
- *
730
- * What qualifies depends on how fallback was configured: an EXPLICIT
731
- * `providerFallback` callback is consulted for any error except client
732
- * aborts (the callback owns the decision — it receives the error
733
- * unmodified and can return null to bubble), while modelChain-only
734
- * configs keep the narrow model-access-denied gate.
735
- */
736
- private runWithFallbackOrchestration;
737
- private attemptInner;
738
- private executeGenerateWithMetricsContext;
739
- private executeGenerateRequest;
740
- private prepareGenerateRequest;
741
- private maybeHandleEarlyGenerateResult;
742
- private runStandardGenerateRequest;
743
- private maybeApplyGenerateOrchestration;
744
- /**
745
- * Applies the host-configured `requestRouter` to `options` in place.
746
- *
747
- * The router is skipped when:
748
- * - no `requestRouter` is configured on this instance, or
749
- * - the caller explicitly set both `options.provider` AND `options.model`
750
- * (we only skip the router if BOTH are set; a caller setting only one
751
- * still lets the router fill in the other field).
752
- *
753
- * Fails open: any router error is logged at WARN level and the call
754
- * continues with the original options unmodified.
755
- *
756
- * @param options — the mutable options object (generate or stream).
757
- * @param promptText — the text prompt used to build the RouterInputContext.
758
- * @param hasTools — true when at least one tool is available for this call.
759
- * @param requiresVision — true when the call includes image attachments.
760
- * @param thinkingLevel — optional thinking level string from the call options.
761
- */
762
- private applyRequestRouter;
763
- /**
764
- * Applies the host-configured `classifierRouter` to `options` in place.
765
- *
766
- * Classifies the request by difficulty and selects a provider/model from the
767
- * configured base pool (cheaper/faster for easy tasks, more capable for hard
768
- * ones), and optionally narrows the tool set via `toolFilter`/`excludeTools`.
769
- *
770
- * Skipped when: no router is configured; the inbound call is the classifier's
771
- * own generate() (marked `__classifierRouted`); the caller pinned BOTH
772
- * provider and model; or a ModelPool is configured (the pool owns selection).
773
- * Fails open — any error leaves options unchanged.
774
- */
775
- private applyClassifierRouting;
776
- private prepareGenerateAugmentations;
777
- private buildGenerateTextOptions;
778
- /**
779
- * Provider-agnostic JSON recovery for schema requests. Structured-output
780
- * enforcement makes valid JSON the overwhelming case; for every other
781
- * provider path — including generate() overrides (Vertex, Anthropic,
782
- * Bedrock, Google AI Studio) — object/array roots are recovered here via
783
- * balanced-scan + jsonrepair and scalar JSON roots via plain JSON.parse,
784
- * with the parsed value exposed as `structuredData`. If nothing JSON-shaped
785
- * is recoverable (pure prose), the raw text is returned, `structuredData`
786
- * stays undefined, and a WARN makes the case observable.
787
- *
788
- * Mutates `textResult` in place, and must run BEFORE the end-of-generation
789
- * emits so event consumers see the same content/structuredData the caller
790
- * receives.
791
- */
792
- private recoverStructuredData;
793
- private finalizeGenerateRequestResult;
794
- private emitGenerateErrorEvent;
795
- /**
796
- * Schedule non-blocking memory storage after generate completes.
797
- */
798
- private scheduleGenerateMemoryStorage;
799
- /**
800
- * Handle PPT generation mode
801
- */
802
- private generateWithPPT;
803
- /**
804
- * Dispatch a music-generation request to the registered music handler
805
- * for the provider named in `options.output.music.provider`.
806
- */
807
- private generateWithMusic;
808
- /**
809
- * Dispatch an avatar (lip-sync) request to the registered avatar handler
810
- * for the provider named in `options.output.avatar.provider`.
811
- */
812
- private generateWithAvatar;
813
- /**
814
- * Generate with workflow engine integration
815
- * Returns both original and processed responses for AB testing
816
- */
817
- private generateWithWorkflow;
818
- /**
819
- * Stream with workflow engine integration
820
- * Progressive streaming: yields preliminary response (first model) then final synthesis
821
- */
822
- private streamWithWorkflow;
823
- /**
824
- * BACKWARD COMPATIBILITY: Legacy generateText method
825
- * Internally calls generate() and converts result format
826
- */
827
- generateText(options: TextGenerationOptions): Promise<TextGenerationResult>;
828
- /**
829
- * REDESIGNED INTERNAL GENERATION - NO CIRCULAR DEPENDENCIES
830
- *
831
- * This method implements a clean fallback chain:
832
- * 1. Initialize conversation memory if enabled
833
- * 2. Inject conversation history into prompt
834
- * 3. Try MCP-enhanced generation if available
835
- * 4. Fall back to direct provider generation
836
- * 5. Store conversation turn for future context
837
- */
838
- private generateTextInternal;
839
- private executeGenerateTextInternalWithSpan;
840
- private initializeGenerateTextInternalContext;
841
- private runGenerateTextInternalFlow;
842
- private captureOriginalConversationMessagesForRecovery;
843
- private finalizeGenerateTextInternalResult;
844
- private handleGenerateTextInternalFailure;
845
- private tryRecoverGenerateTextOverflow;
846
- /**
847
- * Log generateTextInternal start with comprehensive analysis
848
- */
849
- private logGenerateTextInternalStart;
850
- /**
851
- * Emit generation start events
852
- */
853
- private emitGenerationStartEvents;
854
- /**
855
- * Initialize conversation memory for generation
856
- * Lazily initializes memory if needed from constructor flags
857
- */
858
- private initializeConversationMemoryForGeneration;
859
- /**
860
- * Attempt MCP generation with retry logic
861
- */
862
- private attemptMCPGeneration;
863
- /**
864
- * Non-retryable tool-error predicate shared by `performMCPGenerationRetries`
865
- * and `tryMCPGeneration`. Returns `true` when the error indicates the model
866
- * hallucinated a tool name or sent invalid arguments — retrying would
867
- * re-trigger the same deterministic failure with the same tool set.
868
- *
869
- * Belt-and-suspenders: prefers class-identity `.isInstance()` (stable across
870
- * Phase 5+ native substitution) but falls back to `error.name` and message
871
- * substring checks so cross-module-boundary errors (Jest, bundlers, wrapped
872
- * errors) are still caught. The name fallback covers both
873
- * `AI_InvalidToolInputError` (current v5/v6 SDK) and the legacy
874
- * `AI_InvalidToolArgumentsError` (v4).
875
- */
876
- private static isNonRetryableToolError;
877
- /**
878
- * Perform MCP generation with retry logic
879
- */
880
- private performMCPGenerationRetries;
881
- /**
882
- * Try MCP-enhanced generation (no fallback recursion)
883
- */
884
- private tryMCPGeneration;
885
- private prepareMCPGenerationContext;
886
- private logMCPConversationSummary;
887
- private ensureMCPGenerationBudget;
888
- private compactMCPConversationForBudget;
889
- private generateWithMCPProvider;
890
- /**
891
- * Direct provider generation (no MCP, no recursion)
892
- */
893
- private directProviderGeneration;
894
- /**
895
- * Create tool-aware system prompt that informs AI about available tools
896
- */
897
- /**
898
- * Apply per-call tool filtering (whitelist/blacklist) to a ToolInfo array.
899
- * Used to filter the tool list before building the system prompt.
900
- *
901
- * Resolves the SAME policy as the native gate (`BaseProvider`
902
- * `applyToolFiltering`) — per-call options plus the instance-level `tools`
903
- * config — so what the model is told about tools never diverges from the
904
- * tools it can actually call.
905
- */
906
- private applyToolInfoFiltering;
907
- private createToolAwareSystemPrompt;
908
- /**
909
- * Execute tools if available through centralized registry
910
- * Simplified approach without domain detection - relies on tool registry
911
- */
912
- private detectAndExecuteTools;
913
- /**
914
- * BACKWARD COMPATIBILITY: Legacy streamText method
915
- * Internally calls stream() and converts result format
916
- */
917
- streamText(prompt: string, options?: Partial<StreamOptions>): Promise<AsyncIterable<string>>;
918
- /**
919
- * Stream AI-generated content in real-time using the best available provider.
920
- * This method provides real-time streaming of AI responses with full MCP tool integration.
921
- *
922
- * @param options - Stream configuration options
923
- * @param options.input - Input configuration object
924
- * @param options.input.text - The text prompt to send to the AI (required)
925
- * @param options.provider - AI provider to use ('auto', 'openai', 'anthropic', etc.)
926
- * @param options.model - Specific model to use (e.g., 'gpt-4', 'claude-3-opus')
927
- * @param options.temperature - Randomness in response (0.0 = deterministic, 2.0 = very random)
928
- * @param options.maxTokens - Maximum tokens in response
929
- * @param options.systemPrompt - System message to set AI behavior
930
- * @param options.disableTools - Whether to disable MCP tool usage
931
- * @param options.enableAnalytics - Whether to include usage analytics
932
- * @param options.enableEvaluation - Whether to include response quality evaluation
933
- * @param options.context - Additional context for the request
934
- * @param options.evaluationDomain - Domain for specialized evaluation
935
- * @param options.useKnowledgeGrounding - Whether to use the instance's configured knowledge for this call
936
- *
937
- * @returns Promise resolving to StreamResult with an async iterable stream
938
- *
939
- * @example
940
- * ```typescript
941
- * // Basic streaming usage
942
- * const result = await neurolink.stream({
943
- * input: { text: "Tell me a story about space exploration" }
944
- * });
945
- *
946
- * // Consume the stream
947
- * for await (const chunk of result.stream) {
948
- * process.stdout.write(chunk.content);
949
- * }
950
- *
951
- * // Advanced streaming with options
952
- * const result = await neurolink.stream({
953
- * input: { text: "Explain machine learning" },
954
- * provider: "openai",
955
- * model: "gpt-4",
956
- * temperature: 0.7,
957
- * enableAnalytics: true,
958
- * context: { domain: "education", audience: "beginners" }
959
- * });
960
- *
961
- * // Access metadata and analytics
962
- * console.log(result.provider);
963
- * console.log(result.analytics?.usage);
964
- * ```
965
- *
966
- * @throws {Error} When input text is missing or invalid
967
- * @throws {Error} When all providers fail to generate content
968
- * @throws {Error} When conversation memory operations fail (if enabled)
969
- */
970
- stream(options: StreamOptions | DynamicOptions): Promise<StreamResult>;
971
- /**
972
- * Curator P2-3 / Reviewer Finding #2: stream-fallback that also covers
973
- * errors thrown during async iteration (e.g. LiteLLM throwing inside
974
- * `createLiteLLMTransformedStream`). The standard
975
- * `runWithFallbackOrchestration` only catches errors thrown while the
976
- * `StreamResult` is being created — once we hand the iterator back to
977
- * the caller, errors raised during consumption used to bypass
978
- * `providerFallback` / `modelChain`.
979
- *
980
- * This wrapper runs the orchestration to get an initial StreamResult,
981
- * then wraps `result.stream` so that:
982
- * - chunks are forwarded transparently while consumption succeeds
983
- * - if iteration throws a model-access-denied error AND no chunks
984
- * have been yielded yet, we resolve the next fallback target,
985
- * emit `model.fallback`, and recurse
986
- * - if chunks were already yielded, the error propagates (mid-stream
987
- * recovery isn't safe — the consumer has half a response)
988
- */
989
- private streamWithIterationFallback;
990
- private executeStreamRequest;
991
- /**
992
- * Pre-call tool routing for both stream() and generate() turns: runs the
993
- * router LLM once per turn and appends the unpicked servers' registered tool
994
- * names to `options.excludeTools` — the per-call denylist enforced by
995
- * `baseProvider.applyToolFiltering`. No-op unless `toolRouting.enabled` is
996
- * true and a non-empty server catalog has been supplied. Never throws (the
997
- * resolver fails open to an empty exclusion list). Accepts both StreamOptions
998
- * and GenerateOptions since both share the required fields.
999
- */
1000
- private applyToolRoutingExclusions;
1001
- /**
1002
- * Loads a bounded window of prior conversation turns for the router so a
1003
- * follow-up turn carries the context it needs to classify intent. Reads this
1004
- * turn's conversation memory (keyed by `context.sessionId`) with
1005
- * summarization disabled to keep the router cheap. Fails open to an empty
1006
- * list — routing then falls back to the current query alone (prior
1007
- * behaviour). On the first turn of a conversation memory may not be
1008
- * initialised yet; that also yields an empty list, which is fine since the
1009
- * opening message already carries its own context.
1010
- */
1011
- private fetchRecentRoutingHistory;
1012
- /**
1013
- * Supplies (or replaces) the pre-call tool routing server catalog.
1014
- *
1015
- * For hosts that only know their tool servers after constructing NeuroLink
1016
- * (e.g. tools are registered per session/conversation). Routing must still
1017
- * be enabled via the constructor's `toolRouting.enabled` — setting servers
1018
- * alone does not activate it.
1019
- */
1020
- setToolRoutingServers(servers: ToolRoutingServerDescriptor[]): void;
1021
- /** Knowledge-grounding engine health (null when it was not configured). */
1022
- getKnowledgeStatus(): KnowledgeEngineStatus | null;
1023
- private appendKnowledgeGroundingBlockToSystemPrompt;
1024
- /**
1025
- * Retrieve knowledge grounding for a public generate/stream call without
1026
- * mutating its options. The outer call boundary decides how to apply the
1027
- * returned context. Returns undefined when the call does not opt in,
1028
- * grounding is disabled/not applicable, or retrieval fails open.
1029
- */
1030
- private retrieveKnowledgeGrounding;
1031
- private validateStreamRequestOptions;
1032
- private maybeHandleWorkflowStreamRequest;
1033
- private runStandardStreamRequest;
1034
- /**
1035
- * TTS Mode 2 synthesis helper for the stream() pipeline.
1036
- *
1037
- * m5 — extracted from runStandardStreamRequest so the surrounding generator
1038
- * stays under the max-lines-per-function lint budget. Behaviour preserved
1039
- * exactly:
1040
- * - When Mode 2 is enabled (`tts.enabled && tts.useAiResponse`) AND the
1041
- * model produced non-empty content: synthesises one final audio buffer
1042
- * and returns it as an `audioChunk` for the caller to `yield`. Resolves
1043
- * `ttsResolver` with the `TTSResult`.
1044
- * - When Mode 2 is enabled but synthesis fails: logs a warning and resolves
1045
- * `ttsResolver` with `undefined`.
1046
- * - When Mode 2 is requested but skipped (empty content / wrong mode):
1047
- * resolves `ttsResolver` with `undefined` early so callers awaiting
1048
- * `result.audio` unblock before the surrounding `finally` cleanup
1049
- * completes (Issue 7 latency micro-opt — the finally block also resolves
1050
- * defensively, so this is a redundant early signal, not a coverage fix).
1051
- */
1052
- private synthesizeStreamModeTwo;
1053
- /**
1054
- * Prepare stream options: initialize memory, MCP, retrieval, orchestration,
1055
- * Ollama tool auto-disable, factory processing, and tool detection.
1056
- */
1057
- private prepareStreamOptions;
1058
- /**
1059
- * Auto-disable tools for Ollama models that don't support them (stream mode).
1060
- * Prevents overwhelming smaller models with massive tool descriptions in the system message.
1061
- */
1062
- private autoDisableOllamaStreamTools;
1063
- /**
1064
- * Set up event listeners for stream event capture (tool calls, HITL, UI components).
1065
- * Returns the shared event sequence array and a cleanup function to remove all listeners.
1066
- */
1067
- private setupStreamEventListeners;
1068
- /**
1069
- * Handle fallback when the primary stream returns 0 chunks.
1070
- * Yields chunks from a fallback provider and updates metadata accordingly.
1071
- */
1072
- private handleStreamFallback;
1073
- /**
1074
- * Store conversation memory after stream consumption is complete (called from finally block).
1075
- * Handles conversation memory storage in the background.
1076
- */
1077
- private storeStreamConversationMemory;
1078
- /**
1079
- * Validate stream input with comprehensive error reporting
1080
- */
1081
- private validateStreamInput;
1082
- /**
1083
- * Emit stream start events
1084
- */
1085
- private emitStreamStartEvents;
1086
- /**
1087
- * Create MCP stream
1088
- */
1089
- private createMCPStream;
1090
- /**
1091
- * Process stream result
1092
- */
1093
- private processStreamResult;
1094
- /**
1095
- * Emit stream end events
1096
- */
1097
- private emitStreamEndEvents;
1098
- /**
1099
- * Create stream response
1100
- */
1101
- private createStreamResponse;
1102
- /**
1103
- * Handle stream error with fallback
1104
- */
1105
- private handleStreamError;
1106
- /**
1107
- * Get the EventEmitter instance to listen to NeuroLink events for real-time monitoring and debugging.
1108
- * This method provides access to the internal event system that emits events during AI generation,
1109
- * tool execution, streaming, and other operations for comprehensive observability.
1110
- *
1111
- * @returns EventEmitter instance that emits various NeuroLink operation events
1112
- *
1113
- * @example
1114
- * ```typescript
1115
- * // Basic event listening setup
1116
- * const neurolink = new NeuroLink();
1117
- * const emitter = neurolink.getEventEmitter();
1118
- *
1119
- * // Listen to generation events
1120
- * emitter.on('generation:start', (event) => {
1121
- * console.log(`Generation started with provider: ${event.provider}`);
1122
- * console.log(`Started at: ${new Date(event.timestamp)}`);
1123
- * });
1124
- *
1125
- * emitter.on('generation:end', (event) => {
1126
- * console.log(`Generation completed in ${event.responseTime}ms`);
1127
- * console.log(`Tools used: ${event.toolsUsed?.length || 0}`);
1128
- * });
1129
- *
1130
- * // Listen to streaming events
1131
- * emitter.on('stream:start', (event) => {
1132
- * console.log(`Streaming started with provider: ${event.provider}`);
1133
- * });
1134
- *
1135
- * emitter.on('stream:end', (event) => {
1136
- * console.log(`Streaming completed in ${event.responseTime}ms`);
1137
- * if (event.fallback) console.log('Used fallback streaming');
1138
- * });
1139
- *
1140
- * // Listen to tool execution events
1141
- * emitter.on('tool:start', (event) => {
1142
- * console.log(`Tool execution started: ${event.toolName}`);
1143
- * });
1144
- *
1145
- * emitter.on('tool:end', (event) => {
1146
- * console.log(`Tool ${event.toolName} ${event.success ? 'succeeded' : 'failed'}`);
1147
- * console.log(`Execution time: ${event.responseTime}ms`);
1148
- * });
1149
- *
1150
- * // Listen to tool registration events
1151
- * emitter.on('tools-register:start', (event) => {
1152
- * console.log(`Registering tool: ${event.toolName}`);
1153
- * });
1154
- *
1155
- * emitter.on('tools-register:end', (event) => {
1156
- * console.log(`Tool registration ${event.success ? 'succeeded' : 'failed'}: ${event.toolName}`);
1157
- * });
1158
- *
1159
- * // Listen to external MCP server events
1160
- * emitter.on('externalMCP:serverConnected', (event) => {
1161
- * console.log(`External MCP server connected: ${event.serverId}`);
1162
- * console.log(`Tools available: ${event.toolCount || 0}`);
1163
- * });
1164
- *
1165
- * emitter.on('externalMCP:serverDisconnected', (event) => {
1166
- * console.log(`External MCP server disconnected: ${event.serverId}`);
1167
- * console.log(`Reason: ${event.reason || 'Unknown'}`);
1168
- * });
1169
- *
1170
- * emitter.on('externalMCP:toolDiscovered', (event) => {
1171
- * console.log(`New tool discovered: ${event.toolName} from ${event.serverId}`);
1172
- * });
1173
- *
1174
- * // Advanced usage with error handling
1175
- * emitter.on('error', (error) => {
1176
- * console.error('NeuroLink error:', error);
1177
- * });
1178
- *
1179
- * // Clean up event listeners when done
1180
- * function cleanup() {
1181
- * emitter.removeAllListeners();
1182
- * }
1183
- *
1184
- * process.on('SIGINT', cleanup);
1185
- * process.on('SIGTERM', cleanup);
1186
- * ```
1187
- *
1188
- * @example
1189
- * ```typescript
1190
- * // Advanced monitoring with metrics collection
1191
- * const neurolink = new NeuroLink();
1192
- * const emitter = neurolink.getEventEmitter();
1193
- * const metrics = {
1194
- * generations: 0,
1195
- * totalResponseTime: 0,
1196
- * toolExecutions: 0,
1197
- * failures: 0
1198
- * };
1199
- *
1200
- * // Collect performance metrics
1201
- * emitter.on('generation:end', (event) => {
1202
- * metrics.generations++;
1203
- * metrics.totalResponseTime += event.responseTime;
1204
- * metrics.toolExecutions += event.toolsUsed?.length || 0;
1205
- * });
1206
- *
1207
- * emitter.on('tool:end', (event) => {
1208
- * if (!event.success) {
1209
- * metrics.failures++;
1210
- * }
1211
- * });
1212
- *
1213
- * // Log metrics every 10 seconds
1214
- * setInterval(() => {
1215
- * const avgResponseTime = metrics.generations > 0
1216
- * ? metrics.totalResponseTime / metrics.generations
1217
- * : 0;
1218
- *
1219
- * console.log('NeuroLink Metrics:', {
1220
- * totalGenerations: metrics.generations,
1221
- * averageResponseTime: `${avgResponseTime.toFixed(2)}ms`,
1222
- * totalToolExecutions: metrics.toolExecutions,
1223
- * failureRate: `${((metrics.failures / (metrics.toolExecutions || 1)) * 100).toFixed(2)}%`
1224
- * });
1225
- * }, 10000);
1226
- * ```
1227
- *
1228
- * **Available Events:**
1229
- *
1230
- * **Generation Events:**
1231
- * - `generation:start` - Fired when text generation begins
1232
- * - `{ provider: string, timestamp: number }`
1233
- * - `generation:end` - Fired when text generation completes (or fails / is aborted)
1234
- * - `{ provider: string, responseTime: number, toolsUsed?: string[], timestamp: number, success?: boolean, aborted?: boolean, error?: string }`
1235
- * - `success` is `false` for both failures and client aborts; `aborted: true`
1236
- * distinguishes the latter so consumers can route cancellations
1237
- * differently from real errors. Pipeline B's metrics span maps
1238
- * `aborted: true` events to `SpanStatus.WARNING` (not ERROR).
1239
- *
1240
- * **Streaming Events:**
1241
- * - `stream:start` - Fired when streaming begins
1242
- * - `{ provider: string, timestamp: number }`
1243
- * - `stream:end` - Fired when streaming completes
1244
- * - `{ provider: string, responseTime: number, fallback?: boolean }`
1245
- *
1246
- * **Tool Events:**
1247
- * - `tool:start` - Fired when tool execution begins
1248
- * - `{ toolName: string, timestamp: number }`
1249
- * - `tool:end` - Fired when tool execution completes
1250
- * - `{ toolName: string, responseTime: number, success: boolean, timestamp: number }`
1251
- * - `tools-register:start` - Fired when tool registration begins
1252
- * - `{ toolName: string, timestamp: number }`
1253
- * - `tools-register:end` - Fired when tool registration completes
1254
- * - `{ toolName: string, success: boolean, timestamp: number }`
1255
- *
1256
- * **External MCP Events:**
1257
- * - `externalMCP:serverConnected` - Fired when external MCP server connects
1258
- * - `{ serverId: string, toolCount?: number, timestamp: number }`
1259
- * - `externalMCP:serverDisconnected` - Fired when external MCP server disconnects
1260
- * - `{ serverId: string, reason?: string, timestamp: number }`
1261
- * - `externalMCP:serverFailed` - Fired when external MCP server fails
1262
- * - `{ serverId: string, error: string, timestamp: number }`
1263
- * - `externalMCP:toolDiscovered` - Fired when external MCP tool is discovered
1264
- * - `{ toolName: string, serverId: string, timestamp: number }`
1265
- * - `externalMCP:toolRemoved` - Fired when external MCP tool is removed
1266
- * - `{ toolName: string, serverId: string, timestamp: number }`
1267
- * - `externalMCP:serverAdded` - Fired when external MCP server is added
1268
- * - `{ serverId: string, config: MCPServerInfo, toolCount: number, timestamp: number }`
1269
- * - `externalMCP:serverRemoved` - Fired when external MCP server is removed
1270
- * - `{ serverId: string, timestamp: number }`
1271
- *
1272
- * **Error Events:**
1273
- * - `error` - Fired when an error occurs
1274
- * - `{ error: Error, context?: object }`
1275
- *
1276
- * @throws {Error} This method does not throw errors as it returns the internal EventEmitter
1277
- *
1278
- * @since 1.0.0
1279
- * @see {@link https://nodejs.org/api/events.html} Node.js EventEmitter documentation
1280
- * @see {@link NeuroLink.generate} for events related to text generation
1281
- * @see {@link NeuroLink.stream} for events related to streaming
1282
- * @see {@link NeuroLink.executeTool} for events related to tool execution
1283
- */
1284
- getEventEmitter(): TypedEventEmitter<NeuroLinkEvents>;
1285
- /**
1286
- * Returns the instance-level tool-dedup configuration, or `undefined` when
1287
- * toolDedup was not provided at construction time.
1288
- *
1289
- * The stored object is returned as-is whenever `toolDedup` was supplied,
1290
- * including when `enabled: false` — only the complete absence of a `toolDedup`
1291
- * option results in `undefined`.
1292
- *
1293
- * Called by `BaseProvider.applyToolFiltering` so the dedup pass uses the
1294
- * same config for every generate/stream call without threading an extra
1295
- * parameter through the full call stack.
1296
- */
1297
- getToolDedupConfig(): ToolDedupConfig | undefined;
1298
- /**
1299
- * Returns the instance-level `tools` config (master switch, include/exclude
1300
- * lists, discovery mode), or `undefined` when not provided at construction.
1301
- *
1302
- * Called by `BaseProvider.applyToolFiltering` so the tool gate composes the
1303
- * instance policy with per-call options on every generate/stream call.
1304
- */
1305
- getToolsConfig(): ToolConfig | undefined;
1306
- /**
1307
- * Tools discovered via `search_tools` for a session (`tools.discovery`
1308
- * mode). Pinned tools are sent in full on every subsequent call of that
1309
- * session instead of being deferred — discovery cost is paid once.
1310
- * Reading refreshes the session's recency (LRU), so active conversations
1311
- * are never the ones evicted at the session cap.
1312
- */
1313
- getDiscoveryPins(sessionKey: string): ReadonlySet<string>;
1314
- /**
1315
- * Pin discovered tools to a session (called by the `search_tools`
1316
- * meta-tool on hydration). Append-only within a session; the map is
1317
- * bounded by evicting the least-recently-used session past 1000 sessions.
1318
- */
1319
- pinDiscoveredTools(sessionKey: string, toolNames: string[]): void;
1320
- /**
1321
- * Curator P1-1: synchronous credential health check for a single provider.
1322
- *
1323
- * Drives a tiny real call against the provider (1-token completion or
1324
- * `/models` listing depending on provider) to confirm the configured
1325
- * credentials are valid. Useful at startup so a service can refuse to
1326
- * boot if its primary provider's credentials are broken instead of
1327
- * discovering the problem on first user request.
1328
- *
1329
- * @example
1330
- * ```ts
1331
- * const health = await neurolink.checkCredentials({ provider: "litellm" });
1332
- * if (health.status !== "ok") {
1333
- * throw new Error(`provider not ready: ${health.detail}`);
1334
- * }
1335
- * ```
1336
- *
1337
- * @param input - the provider to check
1338
- * @returns `{ provider, status, detail }`. Possible status values:
1339
- * - `"ok"` — credentials valid and provider reachable
1340
- * - `"missing"` — required env / credentials not configured
1341
- * - `"expired"` — credentials present but rejected (401/403)
1342
- * - `"denied"` — credentials valid but team not whitelisted for any model
1343
- * - `"network"` — provider unreachable (timeout, ECONNREFUSED, DNS)
1344
- * - `"unknown"` — other error; consult `detail`
1345
- */
1346
- checkCredentials(input: {
1347
- provider: string;
1348
- model?: string;
1349
- }): Promise<{
1350
- provider: string;
1351
- status: "ok" | "missing" | "expired" | "denied" | "network" | "unknown";
1352
- detail: string;
1353
- }>;
1354
- /**
1355
- * Emit tool start event with execution tracking
1356
- * @param toolName - Name of the tool being executed
1357
- * @param input - Input parameters for the tool
1358
- * @param startTime - Timestamp when execution started
1359
- * @returns executionId for tracking this specific execution
1360
- */
1361
- emitToolStart(toolName: string, input: unknown, startTime?: number): string;
1362
- /**
1363
- * Emit tool end event with execution summary
1364
- * @param toolName - Name of the tool that finished
1365
- * @param result - Result from the tool execution
1366
- * @param error - Error message if execution failed
1367
- * @param startTime - When execution started
1368
- * @param endTime - When execution finished
1369
- * @param executionId - Optional execution ID for tracking
1370
- */
1371
- emitToolEnd(toolName: string, result?: unknown, error?: string, startTime?: number, endTime?: number, executionId?: string): void;
1372
- /**
1373
- * Get current tool execution contexts for stream metadata
1374
- */
1375
- getCurrentToolExecutions(): ToolExecutionContext[];
1376
- /**
1377
- * Get tool execution history
1378
- */
1379
- getToolExecutionHistory(): ToolExecutionSummary[];
1380
- /**
1381
- * Clear current stream tool executions (called at stream start)
1382
- */
1383
- clearCurrentStreamExecutions(): void;
1384
- /**
1385
- * Register a custom tool that will be available to all AI providers
1386
- * @param name - Unique name for the tool
1387
- * @param tool - Tool in MCPExecutableTool format (unified MCP protocol type)
1388
- */
1389
- registerTool(name: string, tool: MCPExecutableTool, options?: ToolRegistrationOptions): void;
1390
- /**
1391
- * Set the context that will be passed to tools during execution
1392
- * This context will be merged with any runtime context passed by the AI model
1393
- * @param context - Context object containing session info, tokens, shop data, etc.
1394
- */
1395
- setToolContext(context: Record<string, unknown>): void;
1396
- /**
1397
- * Get the current tool execution context
1398
- * @returns Current context or undefined if not set
1399
- */
1400
- getToolContext(): Record<string, unknown> | undefined;
1401
- /**
1402
- * Clear the tool execution context
1403
- */
1404
- clearToolContext(): void;
1405
- /**
1406
- * Register multiple tools at once - Supports both object and array formats
1407
- * @param tools - Object mapping tool names to MCPExecutableTool format OR Array of tools with names
1408
- *
1409
- * Object format (existing): { toolName: MCPExecutableTool, ... }
1410
- * Array format (Lighthouse compatible): [{ name: string, tool: MCPExecutableTool }, ...]
1411
- */
1412
- registerTools(tools: Record<string, MCPExecutableTool> | Array<{
1413
- name: string;
1414
- tool: MCPExecutableTool;
1415
- }>): void;
1416
- /**
1417
- * Unregister a custom tool
1418
- * @param name - Name of the tool to remove
1419
- * @returns true if the tool was removed, false if it didn't exist
1420
- */
1421
- unregisterTool(name: string): boolean;
1422
- /**
1423
- * Register a global tool middleware that runs on every tool execution.
1424
- * Middleware receives the tool, params, context, and a next() function.
1425
- * @param middleware - The middleware function to register
1426
- * @returns this (for chaining)
1427
- */
1428
- useToolMiddleware(middleware: import("./types/index.js").ToolMiddleware): this;
1429
- /**
1430
- * Get all registered tool middlewares
1431
- */
1432
- getToolMiddlewares(): import("./types/index.js").ToolMiddleware[];
1433
- /**
1434
- * Flush any pending batched tool calls immediately
1435
- */
1436
- flushToolBatch(): Promise<void>;
1437
- /**
1438
- * Get the current MCP enhancements configuration
1439
- */
1440
- getMCPEnhancementsConfig(): MCPEnhancementsConfig | undefined;
1441
- /**
1442
- * Update agentic loop report metadata for a conversation session.
1443
- * Upserts a report entry by reportId — updates existing or adds new.
1444
- * Only supported when using Redis conversation memory.
1445
- *
1446
- * @param sessionId The session identifier
1447
- * @param report The agentic loop report metadata to upsert
1448
- * @param userId Optional user identifier
1449
- * @throws Error if conversation memory is not initialized or is not Redis-backed
1450
- *
1451
- * @example
1452
- * ```typescript
1453
- * await neurolink.updateAgenticLoopReport("session-123", {
1454
- * reportId: "report-abc",
1455
- * reportType: "META",
1456
- * reportStatus: "INPROGRESS",
1457
- * });
1458
- * ```
1459
- */
1460
- updateAgenticLoopReport(sessionId: string, report: import("./types/index.js").AgenticLoopReportMetadata, userId?: string): Promise<void>;
1461
- /**
1462
- * Get all registered custom tools
1463
- * @returns Map of tool names to MCPExecutableTool format
1464
- */
1465
- getCustomTools(): Map<string, MCPExecutableTool>;
1466
- /**
1467
- * Add an in-memory MCP server (from git diff)
1468
- * Allows registration of pre-instantiated server objects
1469
- * @param serverId - Unique identifier for the server
1470
- * @param serverInfo - Server configuration
1471
- */
1472
- addInMemoryMCPServer(serverId: string, serverInfo: MCPServerInfo): Promise<void>;
1473
- /**
1474
- * Get all registered in-memory servers as a Map for ID-based lookup.
1475
- *
1476
- * This method is primarily used when you need O(1) lookup by server ID,
1477
- * such as in `testMCPServer()` for checking if a specific server exists.
1478
- *
1479
- * @returns Map of server IDs to MCPServerInfo
1480
- * @see {@link getInMemoryServerInfos} for array-based access (useful for iteration/spreading)
1481
- */
1482
- getInMemoryServers(): Map<string, MCPServerInfo>;
1483
- /**
1484
- * Get in-memory servers as an array of MCPServerInfo.
1485
- *
1486
- * This method is the canonical source for in-memory server filtering.
1487
- * It fetches from the centralized tool registry and filters servers
1488
- * with the "in-memory" category.
1489
- *
1490
- * Use this method when you need to:
1491
- * - Iterate over all in-memory servers
1492
- * - Spread servers into another array (e.g., in `listMCPServers()`)
1493
- * - Get a count of in-memory servers
1494
- *
1495
- * @returns Array of MCPServerInfo for in-memory servers
1496
- * @see {@link getInMemoryServers} for Map-based access (useful for ID lookups)
1497
- */
1498
- getInMemoryServerInfos(): MCPServerInfo[];
1499
- /**
1500
- * Get auto-discovered servers as MCPServerInfo - ZERO conversion needed
1501
- * @returns Array of MCPServerInfo
1502
- */
1503
- getAutoDiscoveredServerInfos(): MCPServerInfo[];
1504
- /**
1505
- * Execute a specific tool by name with robust error handling
1506
- * Supports both custom tools and MCP server tools with timeout, retry, and circuit breaker patterns
1507
- * @param toolName - Name of the tool to execute
1508
- * @param params - Parameters to pass to the tool
1509
- * @param options - Execution options including optional authentication context
1510
- * @returns Tool execution result
1511
- */
1512
- executeTool<T = unknown>(toolName: string, params?: unknown, options?: {
1513
- timeout?: number;
1514
- maxRetries?: number;
1515
- retryDelayMs?: number;
1516
- /** Disable tool result caching for this call */
1517
- disableToolCache?: boolean;
1518
- /** Bypass the request batcher for this call */
1519
- bypassBatcher?: boolean;
1520
- authContext?: {
1521
- userId?: string;
1522
- sessionId?: string;
1523
- user?: Record<string, unknown>;
1524
- [key: string]: unknown;
1525
- };
1526
- }): Promise<T>;
1527
- private createToolExecutionContext;
1528
- private executeToolWithSpan;
1529
- private prepareToolExecutionState;
1530
- private runPreparedToolExecution;
1531
- private handleSuccessfulToolExecution;
1532
- private handleFailedToolExecution;
1533
- /**
1534
- * Internal tool execution method with MCP enhancements wired in:
1535
- * - ToolCache: check/store cached results for non-destructive tools
1536
- * - ToolRouter: route to best server when same tool exists on multiple servers
1537
- * - Annotations: skip cache for destructive tools, retry safe tools on failure
1538
- * - Middleware: apply global middleware chain before execution
1539
- */
1540
- private executeToolInternal;
1541
- /**
1542
- * Get tool annotations for execution decisions (cache, retry).
1543
- * Checks cached tool list first, falls back to inference from tool name.
1544
- */
1545
- private getToolAnnotationsForExecution;
1546
- /**
1547
- * Get all available tools including custom and in-memory ones
1548
- * @returns Array of available tools with metadata
1549
- */
1550
- private invalidateToolCache;
1551
- getAllAvailableTools(): Promise<ToolInfo[]>;
1552
- /**
1553
- * Get comprehensive status of all AI providers
1554
- * Primary method for provider health checking and diagnostics
1555
- */
1556
- getProviderStatus(options?: {
1557
- quiet?: boolean;
1558
- }): Promise<ProviderStatus[]>;
1559
- /**
1560
- * Test a specific AI provider's connectivity and authentication
1561
- * @param providerName - Name of the provider to test
1562
- * @returns Promise resolving to true if provider is working
1563
- */
1564
- testProvider(providerName: string): Promise<boolean>;
1565
- /**
1566
- * Internal method to test provider connection with minimal generation call
1567
- */
1568
- private testProviderConnection;
1569
- /**
1570
- * Get the best available AI provider based on configuration and availability
1571
- * @param requestedProvider - Optional preferred provider name
1572
- * @returns Promise resolving to the best provider name
1573
- */
1574
- getBestProvider(requestedProvider?: string): Promise<string>;
1575
- /**
1576
- * Get list of all available AI provider names
1577
- * @returns Array of supported provider names
1578
- */
1579
- getAvailableProviders(): Promise<string[]>;
1580
- /**
1581
- * Validate if a provider name is supported
1582
- * @param providerName - Provider name to validate
1583
- * @returns True if provider name is valid
1584
- */
1585
- isValidProvider(providerName: string): Promise<boolean>;
1586
- /**
1587
- * Get comprehensive MCP (Model Context Protocol) status information
1588
- * @returns Promise resolving to MCP status details
1589
- */
1590
- getMCPStatus(): Promise<MCPStatus>;
1591
- /**
1592
- * List all configured MCP servers with their status
1593
- * @returns Promise resolving to array of MCP server information
1594
- */
1595
- listMCPServers(): Promise<MCPServerInfo[]>;
1596
- /**
1597
- * Test connectivity to a specific MCP server
1598
- * @param serverId - ID of the MCP server to test
1599
- * @returns Promise resolving to true if server is reachable
1600
- */
1601
- testMCPServer(serverId: string): Promise<boolean>;
1602
- /**
1603
- * Check if a provider has the required environment variables configured
1604
- * @param providerName - Name of the provider to check
1605
- * @returns Promise resolving to true if provider has required env vars
1606
- */
1607
- hasProviderEnvVars(providerName: string): Promise<boolean>;
1608
- /**
1609
- * Perform comprehensive health check on a specific provider
1610
- * @param providerName - Name of the provider to check
1611
- * @param options - Health check options
1612
- * @returns Promise resolving to detailed health status
1613
- */
1614
- checkProviderHealth(providerName: string, options?: {
1615
- timeout?: number;
1616
- includeConnectivityTest?: boolean;
1617
- includeModelValidation?: boolean;
1618
- cacheResults?: boolean;
1619
- }): Promise<{
1620
- provider: string;
1621
- isHealthy: boolean;
1622
- isConfigured: boolean;
1623
- hasApiKey: boolean;
1624
- lastChecked: Date;
1625
- error?: string;
1626
- warning?: string;
1627
- responseTime?: number;
1628
- configurationIssues: string[];
1629
- recommendations: string[];
1630
- }>;
1631
- /**
1632
- * Check health of all supported providers
1633
- * @param options - Health check options
1634
- * @returns Promise resolving to array of health statuses for all providers
1635
- */
1636
- checkAllProvidersHealth(options?: {
1637
- timeout?: number;
1638
- includeConnectivityTest?: boolean;
1639
- includeModelValidation?: boolean;
1640
- cacheResults?: boolean;
1641
- }): Promise<Array<{
1642
- provider: string;
1643
- isHealthy: boolean;
1644
- isConfigured: boolean;
1645
- hasApiKey: boolean;
1646
- lastChecked: Date;
1647
- error?: string;
1648
- warning?: string;
1649
- responseTime?: number;
1650
- configurationIssues: string[];
1651
- recommendations: string[];
1652
- }>>;
1653
- /**
1654
- * Get a summary of provider health across all supported providers
1655
- * @returns Promise resolving to health summary statistics
1656
- */
1657
- getProviderHealthSummary(): Promise<{
1658
- total: number;
1659
- healthy: number;
1660
- configured: number;
1661
- hasIssues: number;
1662
- healthyProviders: string[];
1663
- unhealthyProviders: string[];
1664
- recommendations: string[];
1665
- }>;
1666
- /**
1667
- * Clear provider health cache (useful for re-testing after configuration changes)
1668
- * @param providerName - Optional specific provider to clear cache for
1669
- */
1670
- clearProviderHealthCache(providerName?: string): Promise<void>;
1671
- /**
1672
- * Get execution metrics for all tools
1673
- * @returns Object with execution metrics for each tool
1674
- */
1675
- getToolExecutionMetrics(): Record<string, {
1676
- totalExecutions: number;
1677
- successfulExecutions: number;
1678
- failedExecutions: number;
1679
- successRate: number;
1680
- averageExecutionTime: number;
1681
- lastExecutionTime: number;
1682
- errorCategories: Record<string, number>;
1683
- }>;
1684
- /**
1685
- * NL-004: Set model alias/deprecation configuration.
1686
- * Models in the alias map will be warned, redirected, or blocked based on their action.
1687
- * @param config - Model alias configuration with aliases map
1688
- */
1689
- setModelAliasConfig(config: import("./types/index.js").ModelAliasConfig): void;
1690
- /**
1691
- * Get circuit breaker status for all tools
1692
- * @returns Object with circuit breaker status for each tool
1693
- */
1694
- getToolCircuitBreakerStatus(): Record<string, {
1695
- state: "closed" | "open" | "half-open";
1696
- failureCount: number;
1697
- isHealthy: boolean;
1698
- }>;
1699
- /**
1700
- * Reset circuit breaker for a specific tool
1701
- * @param toolName - Name of the tool to reset circuit breaker for
1702
- */
1703
- resetToolCircuitBreaker(toolName: string): void;
1704
- /**
1705
- * Clear all tool execution metrics
1706
- */
1707
- clearToolExecutionMetrics(): void;
1708
- /**
1709
- * Get comprehensive tool health report
1710
- * @returns Detailed health report for all tools
1711
- */
1712
- getToolHealthReport(): Promise<{
1713
- totalTools: number;
1714
- healthyTools: number;
1715
- unhealthyTools: number;
1716
- tools: Record<string, {
1717
- name: string;
1718
- isHealthy: boolean;
1719
- metrics: {
1720
- totalExecutions: number;
1721
- successRate: number;
1722
- averageExecutionTime: number;
1723
- lastExecutionTime: number;
1724
- errorCategories: Record<string, number>;
1725
- };
1726
- circuitBreaker: {
1727
- state: "closed" | "open" | "half-open";
1728
- failureCount: number;
1729
- };
1730
- issues: string[];
1731
- recommendations: string[];
1732
- }>;
1733
- }>;
1734
- /**
1735
- * Initialize conversation memory if enabled (public method for explicit initialization)
1736
- * This is useful for testing or when you want to ensure conversation memory is ready
1737
- * @returns Promise resolving to true if initialization was successful, false otherwise
1738
- */
1739
- ensureConversationMemoryInitialized(): Promise<boolean>;
1740
- /**
1741
- * Get conversation memory statistics (public API)
1742
- */
1743
- getConversationStats(): Promise<import("./types/conversation.js").ConversationMemoryStats>;
1744
- /**
1745
- * Get complete conversation history for a specific session (public API)
1746
- * @param sessionId - The session ID to retrieve history for
1747
- * @returns Array of ChatMessage objects in chronological order, or empty array if session doesn't exist
1748
- */
1749
- getConversationHistory(sessionId: string): Promise<ChatMessage[]>;
1750
- /**
1751
- * Clear conversation history for a specific session (public API)
1752
- */
1753
- clearConversationSession(sessionId: string): Promise<boolean>;
1754
- /**
1755
- * Clear all conversation history (public API)
1756
- */
1757
- clearAllConversations(): Promise<void>;
1758
- /**
1759
- * List all conversation sessions with metadata (public API)
1760
- * @param userId - Optional user ID to filter sessions (required for Redis storage)
1761
- * @returns Array of session list items with metadata
1762
- */
1763
- listSessions(userId?: string): Promise<SessionListItem[]>;
1764
- /**
1765
- * Export a single session with full history and metadata (public API)
1766
- * @param sessionId - The session ID to export
1767
- * @param options - Export options
1768
- * @returns Session export object with full history
1769
- */
1770
- exportSession(sessionId: string, options?: {
1771
- includeMetadata?: boolean;
1772
- format?: "json" | "csv";
1773
- }): Promise<SessionExport | null>;
1774
- /**
1775
- * Export all sessions for a user (public API)
1776
- * @param userId - Optional user ID (required for Redis storage)
1777
- * @param options - Export options
1778
- * @returns Array of session exports
1779
- */
1780
- exportAllSessions(userId?: string, options?: {
1781
- includeMetadata?: boolean;
1782
- format?: "json" | "csv";
1783
- }): Promise<SessionExport[]>;
1784
- /**
1785
- * Store tool executions in conversation memory if enabled and Redis is configured
1786
- * @param sessionId - Session identifier
1787
- * @param userId - User identifier (optional)
1788
- * @param toolCalls - Array of tool calls
1789
- * @param toolResults - Array of tool results
1790
- * @param currentTime - Date when the tool execution occurred (optional)
1791
- * @returns Promise resolving when storage is complete
1792
- */
1793
- storeToolExecutions(sessionId: string, userId: string | undefined, toolCalls: Array<{
1794
- toolCallId?: string;
1795
- toolName?: string;
1796
- args?: Record<string, unknown>;
1797
- [key: string]: unknown;
1798
- }>, toolResults: Array<{
1799
- toolCallId?: string;
1800
- result?: unknown;
1801
- error?: string;
1802
- [key: string]: unknown;
1803
- }>, currentTime?: Date): Promise<void>;
1804
- /**
1805
- * Check if tool execution storage is available.
1806
- *
1807
- * Now capability-based rather than Redis-specific: any configured memory
1808
- * backend implementing `storeToolExecution` qualifies. The old check
1809
- * required `STORAGE_TYPE === "redis"` AND a Redis manager by class name, so
1810
- * in-memory sessions reported false and silently skipped tool persistence.
1811
- *
1812
- * @returns whether the active memory backend can persist tool executions
1813
- */
1814
- isToolExecutionStorageAvailable(): boolean;
1815
- /**
1816
- * Get the raw messages array for a session.
1817
- * Returns the full messages list without context filtering or summarization.
1818
- * @param sessionId - The session ID to retrieve messages for
1819
- * @returns Array of ChatMessage objects, or empty array if session doesn't exist
1820
- */
1821
- getSessionMessages(sessionId: string, userId?: string): Promise<ChatMessage[]>;
1822
- /**
1823
- * Replace the entire messages array for a session.
1824
- * @param sessionId - The session ID to update
1825
- * @param messages - The new messages array
1826
- * @param userId - Optional user ID for scoped Redis key lookup
1827
- */
1828
- setSessionMessages(sessionId: string, messages: ChatMessage[], userId?: string): Promise<void>;
1829
- /**
1830
- * Modify the last assistant message in a session using a transformer function.
1831
- * Convenience wrapper around getSessionMessages/setSessionMessages.
1832
- * @param sessionId - The session ID to modify
1833
- * @param transformer - Function that receives the last assistant message content and returns the modified content
1834
- * @param userId - Optional user ID for scoped Redis key lookup
1835
- * @returns true if a message was modified, false if no assistant message was found
1836
- */
1837
- modifyLastAssistantMessage(sessionId: string, transformer: (content: string) => string, userId?: string): Promise<boolean>;
1838
- /**
1839
- * Add an external MCP server
1840
- * Automatically discovers and registers tools from the server
1841
- * @param serverId - Unique identifier for the server
1842
- * @param config - External MCP server configuration
1843
- * @returns Operation result with server instance
1844
- */
1845
- addExternalMCPServer(serverId: string, config: MCPServerInfo): Promise<ExternalMCPOperationResult<ExternalMCPServerInstance>>;
1846
- /**
1847
- * Remove an external MCP server
1848
- * Stops the server and removes all its tools
1849
- * @param serverId - ID of the server to remove
1850
- * @returns Operation result
1851
- */
1852
- removeExternalMCPServer(serverId: string): Promise<ExternalMCPOperationResult<void>>;
1853
- /**
1854
- * List all external MCP servers
1855
- * @returns Array of server health information
1856
- */
1857
- listExternalMCPServers(): Array<{
1858
- serverId: string;
1859
- status: string;
1860
- toolCount: number;
1861
- uptime: number;
1862
- isHealthy: boolean;
1863
- config: MCPServerInfo;
1864
- }>;
1865
- /**
1866
- * Get external MCP server status
1867
- * @param serverId - ID of the server
1868
- * @returns Server instance or undefined if not found
1869
- */
1870
- getExternalMCPServer(serverId: string): ExternalMCPServerInstance | undefined;
1871
- /**
1872
- * Execute a tool from an external MCP server
1873
- * @param serverId - ID of the server
1874
- * @param toolName - Name of the tool
1875
- * @param parameters - Tool parameters
1876
- * @param options - Execution options
1877
- * @returns Tool execution result
1878
- */
1879
- executeExternalMCPTool(serverId: string, toolName: string, parameters: JsonObject, options?: {
1880
- timeout?: number;
1881
- }): Promise<unknown>;
1882
- /**
1883
- * Get all tools from external MCP servers
1884
- * @returns Array of external tool information
1885
- */
1886
- getExternalMCPTools(): ExternalMCPToolInfo[];
1887
- /**
1888
- * Get tools from a specific external MCP server
1889
- * @param serverId - ID of the server
1890
- * @returns Array of tool information for the server
1891
- */
1892
- getExternalMCPServerTools(serverId: string): ExternalMCPToolInfo[];
1893
- /**
1894
- * Test connection to an external MCP server
1895
- * @param config - Server configuration to test
1896
- * @returns Test result with connection status
1897
- */
1898
- testExternalMCPConnection(config: MCPServerInfo): Promise<BatchOperationResult>;
1899
- /**
1900
- * Get external MCP server manager statistics
1901
- * @returns Statistics about external servers and tools
1902
- */
1903
- getExternalMCPStatistics(): {
1904
- totalServers: number;
1905
- connectedServers: number;
1906
- failedServers: number;
1907
- totalTools: number;
1908
- totalConnections: number;
1909
- totalErrors: number;
1910
- };
1911
- /**
1912
- * Shutdown all external MCP servers
1913
- * Called automatically on process exit
1914
- */
1915
- shutdownExternalMCPServers(): Promise<void>;
1916
- /**
1917
- * Get the global elicitation manager for interactive tool input
1918
- * Elicitation allows tools to request additional information from users during execution
1919
- * @returns The global ElicitationManager instance
1920
- * @example
1921
- * ```typescript
1922
- * const elicitationManager = neurolink.getElicitationManager();
1923
- *
1924
- * // Register a handler for confirmations
1925
- * elicitationManager.registerHandler(async (request) => {
1926
- * if (request.type === 'confirmation') {
1927
- * const answer = await askUser(request.message);
1928
- * return { confirmed: answer === 'yes' };
1929
- * }
1930
- * });
1931
- * ```
1932
- */
1933
- getElicitationManager(): Promise<any>;
1934
- /**
1935
- * Register an elicitation handler for interactive tool input
1936
- * Handlers are called when tools need user input during execution
1937
- * @param handler - Function to handle elicitation requests
1938
- * @example
1939
- * ```typescript
1940
- * neurolink.registerElicitationHandler(async (request) => {
1941
- * switch (request.type) {
1942
- * case 'confirmation':
1943
- * return { confirmed: await confirmWithUser(request.message) };
1944
- * case 'text':
1945
- * return { value: await promptUser(request.message) };
1946
- * case 'select':
1947
- * return { value: await selectFromOptions(request.options) };
1948
- * }
1949
- * });
1950
- * ```
1951
- */
1952
- registerElicitationHandler(handler: (request: unknown) => Promise<unknown>): Promise<void>;
1953
- /**
1954
- * Get the multi-server manager for load balancing and coordination
1955
- * Allows managing multiple MCP servers with failover and load balancing
1956
- * @returns The global MultiServerManager instance
1957
- * @example
1958
- * ```typescript
1959
- * const multiServer = neurolink.getMultiServerManager();
1960
- *
1961
- * // Create a server group with load balancing
1962
- * await multiServer.createServerGroup('ai-tools', {
1963
- * servers: ['openai-server', 'anthropic-server'],
1964
- * strategy: 'round-robin'
1965
- * });
1966
- * ```
1967
- */
1968
- getMultiServerManager(): Promise<any>;
1969
- /**
1970
- * Get the enhanced tool discovery service
1971
- * Provides advanced search, filtering, and compatibility checking for tools
1972
- * @returns EnhancedToolDiscovery instance
1973
- * @example
1974
- * ```typescript
1975
- * const discovery = neurolink.getEnhancedToolDiscovery();
1976
- *
1977
- * // Search for tools by criteria
1978
- * const results = await discovery.searchTools({
1979
- * category: 'data-processing',
1980
- * capabilities: ['streaming', 'batch'],
1981
- * minReliability: 0.9
1982
- * });
1983
- * ```
1984
- */
1985
- getEnhancedToolDiscovery(): Promise<any>;
1986
- /**
1987
- * Get the MCP registry client for discovering servers from registries
1988
- * Supports multiple registry sources (official, community, custom)
1989
- * @returns The global MCPRegistryClient instance
1990
- * @example
1991
- * ```typescript
1992
- * const registryClient = neurolink.getMCPRegistryClient();
1993
- *
1994
- * // Search for servers
1995
- * const servers = await registryClient.searchServers({
1996
- * query: 'database',
1997
- * categories: ['data', 'storage']
1998
- * });
1999
- *
2000
- * // Get a well-known server config
2001
- * const githubServer = registryClient.getWellKnownServer('github');
2002
- * ```
2003
- */
2004
- getMCPRegistryClient(): Promise<any>;
2005
- /**
2006
- * Expose a NeuroLink agent as an MCP tool
2007
- * This allows agents to be called by other systems via MCP
2008
- * @param agent - The agent to expose (must include id, name, description, and execute)
2009
- * @param options - Exposure configuration options (prefix, defaultAnnotations, etc.)
2010
- * @returns The exposed tool definition
2011
- * @example
2012
- * ```typescript
2013
- * const agent = {
2014
- * id: 'my-agent',
2015
- * name: 'My Agent',
2016
- * description: 'An agent that processes data',
2017
- * execute: async (params) => { ... }
2018
- * };
2019
- * const tool = await neurolink.exposeAgentAsTool(agent, {
2020
- * prefix: 'agent_'
2021
- * });
2022
- * ```
2023
- */
2024
- exposeAgentAsTool(agent: {
2025
- id: string;
2026
- name: string;
2027
- description: string;
2028
- execute: (params: unknown, context?: unknown) => Promise<unknown>;
2029
- }, options?: {
2030
- prefix?: string;
2031
- includeMetadataInDescription?: boolean;
2032
- wrapWithContext?: boolean;
2033
- executionTimeout?: number;
2034
- enableLogging?: boolean;
2035
- }): Promise<import("./types/mcp.js").ExposureResult>;
2036
- /**
2037
- * Expose a workflow as an MCP tool
2038
- * This allows workflows to be called by other systems via MCP
2039
- * @param workflow - The workflow to expose (must include id, name, description, and execute)
2040
- * @param options - Exposure configuration options (prefix, defaultAnnotations, etc.)
2041
- * @returns The exposed tool definition
2042
- * @example
2043
- * ```typescript
2044
- * const workflow = {
2045
- * id: 'data-pipeline',
2046
- * name: 'Data Pipeline',
2047
- * description: 'Runs the data processing pipeline',
2048
- * execute: async (params) => { ... }
2049
- * };
2050
- * const tool = await neurolink.exposeWorkflowAsTool(workflow, {
2051
- * prefix: 'workflow_'
2052
- * });
2053
- * ```
2054
- */
2055
- exposeWorkflowAsTool(workflow: {
2056
- id: string;
2057
- name: string;
2058
- description: string;
2059
- execute: (params: unknown, context?: unknown) => Promise<unknown>;
2060
- steps?: Array<{
2061
- id: string;
2062
- name: string;
2063
- description?: string;
2064
- }>;
2065
- }, options?: {
2066
- prefix?: string;
2067
- includeMetadataInDescription?: boolean;
2068
- wrapWithContext?: boolean;
2069
- executionTimeout?: number;
2070
- enableLogging?: boolean;
2071
- }): Promise<import("./types/mcp.js").ExposureResult>;
2072
- /**
2073
- * Get the tool integration manager for middleware and elicitation
2074
- * Provides advanced tool wrapping with confirmation, timeout, retry, etc.
2075
- * @returns The global ToolIntegrationManager instance
2076
- * @example
2077
- * ```typescript
2078
- * const integration = neurolink.getToolIntegrationManager();
2079
- *
2080
- * // Register a tool with middleware
2081
- * integration.registerTool(myTool, {
2082
- * timeout: 30000,
2083
- * retries: 3,
2084
- * requireConfirmation: true
2085
- * });
2086
- * ```
2087
- */
2088
- getToolIntegrationManager(): Promise<any>;
2089
- /**
2090
- * Convert NeuroLink tools to MCP format
2091
- * Useful for exposing local tools to external MCP clients
2092
- * @param tools - Array of NeuroLink tool definitions
2093
- * @param options - Conversion options
2094
- * @returns Array of MCP-formatted tools
2095
- * @example
2096
- * ```typescript
2097
- * const mcpTools = neurolink.convertToolsToMCPFormat([
2098
- * { name: 'myTool', description: 'Does something', execute: async () => {} }
2099
- * ]);
2100
- * ```
2101
- */
2102
- convertToolsToMCPFormat(tools: Array<{
2103
- name: string;
2104
- description: string;
2105
- execute?: (params: unknown) => unknown;
2106
- }>, options?: {
2107
- namespacePrefix?: string;
2108
- }): Promise<any>;
2109
- /**
2110
- * Convert MCP tools to NeuroLink format
2111
- * Useful for importing tools from external MCP servers
2112
- * @param tools - Array of MCP tool definitions
2113
- * @param options - Conversion options
2114
- * @returns Array of NeuroLink-formatted tools
2115
- * @example
2116
- * ```typescript
2117
- * const neurolinkTools = neurolink.convertToolsFromMCPFormat(externalTools, {
2118
- * removeNamespacePrefix: 'external_'
2119
- * });
2120
- * ```
2121
- */
2122
- convertToolsFromMCPFormat(tools: Array<{
2123
- name: string;
2124
- description: string;
2125
- inputSchema?: unknown;
2126
- }>, options?: {
2127
- removeNamespacePrefix?: string;
2128
- }): Promise<any>;
2129
- /**
2130
- * Get tool annotations and safety information
2131
- * Provides insights about tool behavior, safety levels, and retry-ability
2132
- * @param toolName - Name of the tool to analyze
2133
- * @returns Tool annotation summary
2134
- * @example
2135
- * ```typescript
2136
- * const annotations = await neurolink.getToolAnnotations('deleteFile');
2137
- * // Returns: { destructive: true, requiresConfirmation: true, safeToRetry: false }
2138
- * ```
2139
- */
2140
- getToolAnnotations(toolName: string): Promise<{
2141
- annotations: MCPToolAnnotations;
2142
- summary: string;
2143
- } | null>;
2144
- /**
2145
- * Convert external MCP tools to Vercel AI SDK tool format
2146
- * This allows AI providers to use external tools directly
2147
- */
2148
- private convertExternalMCPToolsToAISDKFormat;
2149
- /**
2150
- * Convert JSON Schema to AI SDK compatible format
2151
- * For now, we'll skip schema validation and let the AI SDK handle parameters dynamically
2152
- */
2153
- private convertJSONSchemaToAISDKFormat;
2154
- /**
2155
- * Unregister external MCP tools from a specific server
2156
- */
2157
- private unregisterExternalMCPToolsFromRegistry;
2158
- /**
2159
- * Unregister a specific external MCP tool from the main registry
2160
- */
2161
- private unregisterExternalMCPToolFromRegistry;
2162
- /**
2163
- * Lazily initialize conversation memory when needed
2164
- * This is called the first time a generate or stream operation is performed
2165
- */
2166
- private lazyInitializeConversationMemory;
2167
- /**
2168
- * Unregister all external MCP tools from the main registry
2169
- */
2170
- private unregisterAllExternalMCPToolsFromRegistry;
2171
- /**
2172
- * Create an evaluation pipeline with the specified configuration or preset.
2173
- * Pipelines orchestrate multiple scorers to evaluate AI responses comprehensively.
2174
- *
2175
- * @param configOrPreset - Pipeline configuration object or preset name
2176
- * @returns Initialized evaluation pipeline
2177
- *
2178
- * @example Using a preset
2179
- * ```typescript
2180
- * const neurolink = new NeuroLink();
2181
- * const pipeline = await neurolink.createEvaluationPipeline('rag');
2182
- * const result = await pipeline.execute({
2183
- * query: 'What is the capital of France?',
2184
- * response: 'Paris is the capital of France.',
2185
- * context: ['France is a country in Europe. Paris is its capital.']
2186
- * });
2187
- * console.log(result.overallScore, result.passed);
2188
- * ```
2189
- *
2190
- * @example Using custom configuration
2191
- * ```typescript
2192
- * const pipeline = await neurolink.createEvaluationPipeline({
2193
- * name: 'custom-quality',
2194
- * scorers: [
2195
- * { id: 'toxicity', config: { threshold: 0.9 } },
2196
- * { id: 'hallucination', config: { weight: 1.5 } },
2197
- * { id: 'answer-relevancy' }
2198
- * ],
2199
- * aggregation: { method: 'weighted' },
2200
- * passThreshold: 0.8
2201
- * });
2202
- * ```
2203
- */
2204
- createEvaluationPipeline(configOrPreset: import("./types/index.js").PipelineConfig | "safety" | "rag" | "quality" | "comprehensive" | "minimal" | "summarization" | "customerSupport" | "codeGeneration"): Promise<import("./evaluation/pipeline/evaluationPipeline.js").EvaluationPipeline>;
2205
- /**
2206
- * Evaluate an AI response using the specified pipeline or scorers.
2207
- * This is a convenience method that creates a pipeline and executes it in one call.
2208
- *
2209
- * @param input - Scorer input containing query, response, and optional context
2210
- * @param options - Evaluation options including pipeline preset or custom scorers
2211
- * @returns Evaluation pipeline result with scores and pass/fail status
2212
- *
2213
- * @example Using a preset
2214
- * ```typescript
2215
- * const neurolink = new NeuroLink();
2216
- * const result = await neurolink.evaluate(
2217
- * {
2218
- * query: 'Explain quantum computing',
2219
- * response: 'Quantum computing uses qubits...'
2220
- * },
2221
- * { pipeline: 'quality' }
2222
- * );
2223
- * console.log(`Score: ${result.overallScore}, Passed: ${result.passed}`);
2224
- * ```
2225
- *
2226
- * @example Using specific scorers
2227
- * ```typescript
2228
- * const result = await neurolink.evaluate(
2229
- * {
2230
- * query: 'What causes rain?',
2231
- * response: 'Rain is caused by water vapor...',
2232
- * context: ['The water cycle involves evaporation...']
2233
- * },
2234
- * { scorers: ['hallucination', 'faithfulness', 'answer-relevancy'] }
2235
- * );
2236
- * ```
2237
- *
2238
- * @example Full RAG evaluation
2239
- * ```typescript
2240
- * const result = await neurolink.evaluate(
2241
- * {
2242
- * query: 'Who wrote Hamlet?',
2243
- * response: 'Shakespeare wrote Hamlet in 1600.',
2244
- * context: ['William Shakespeare wrote Hamlet around 1600-1601.'],
2245
- * groundTruth: 'William Shakespeare'
2246
- * },
2247
- * { pipeline: 'rag' }
2248
- * );
2249
- * ```
2250
- */
2251
- evaluate(input: import("./types/index.js").ScorerInput, options?: {
2252
- /** Pipeline preset to use */
2253
- pipeline?: "safety" | "rag" | "quality" | "comprehensive" | "minimal" | "summarization" | "customerSupport" | "codeGeneration";
2254
- /** Specific scorers to use (alternative to pipeline) */
2255
- scorers?: string[];
2256
- /** Pass threshold override (0-1) */
2257
- passThreshold?: number;
2258
- /** Execution mode */
2259
- executionMode?: "parallel" | "sequential";
2260
- /** Correlation ID for tracing */
2261
- correlationId?: string;
2262
- /** Overall evaluation timeout in milliseconds */
2263
- timeoutMs?: number;
2264
- }): Promise<import("./types/index.js").PipelineResult>;
2265
- /**
2266
- * Score a response using a single scorer.
2267
- * Useful for quick, targeted evaluations without the overhead of a full pipeline.
2268
- *
2269
- * @param scorerId - The ID of the scorer to use (e.g., 'toxicity', 'hallucination')
2270
- * @param input - Scorer input containing query, response, and optional context
2271
- * @param config - Optional scorer configuration overrides
2272
- * @returns Score result with value, reasoning, and pass/fail status
2273
- *
2274
- * @example Basic scoring
2275
- * ```typescript
2276
- * const neurolink = new NeuroLink();
2277
- * const result = await neurolink.score('toxicity', {
2278
- * query: '',
2279
- * response: 'This is a helpful response about cooking recipes.'
2280
- * });
2281
- * console.log(`Toxicity Score: ${result.score}/10, Passed: ${result.passed}`);
2282
- * ```
2283
- *
2284
- * @example Hallucination detection
2285
- * ```typescript
2286
- * const result = await neurolink.score('hallucination', {
2287
- * query: 'What year was the Eiffel Tower built?',
2288
- * response: 'The Eiffel Tower was built in 1889.',
2289
- * context: ['The Eiffel Tower was constructed from 1887-1889.']
2290
- * });
2291
- * console.log(`Score: ${result.score}, Reasoning: ${result.reasoning}`);
2292
- * ```
2293
- *
2294
- * @example With custom threshold
2295
- * ```typescript
2296
- * const result = await neurolink.score(
2297
- * 'faithfulness',
2298
- * {
2299
- * query: 'Summarize the article',
2300
- * response: 'The article discusses...',
2301
- * context: ['Article content here...']
2302
- * },
2303
- * { threshold: 0.85, weight: 1.5 }
2304
- * );
2305
- * ```
2306
- */
2307
- score(scorerId: string, input: import("./types/index.js").ScorerInput, config?: import("./types/index.js").ScorerConfig): Promise<import("./types/index.js").ScoreResult>;
2308
- /**
2309
- * Get a list of all available scorers and their metadata.
2310
- * Useful for discovering what evaluation capabilities are available.
2311
- *
2312
- * @param options - Filter options
2313
- * @returns Array of scorer metadata
2314
- *
2315
- * @example List all scorers
2316
- * ```typescript
2317
- * const neurolink = new NeuroLink();
2318
- * const scorers = await neurolink.getAvailableScorers();
2319
- * for (const scorer of scorers) {
2320
- * console.log(`${scorer.id}: ${scorer.description} (${scorer.type})`);
2321
- * }
2322
- * ```
2323
- *
2324
- * @example Filter by category
2325
- * ```typescript
2326
- * const safetyScorers = await neurolink.getAvailableScorers({
2327
- * category: 'safety'
2328
- * });
2329
- * console.log('Safety scorers:', safetyScorers.map(s => s.id));
2330
- * ```
2331
- *
2332
- * @example Filter by type
2333
- * ```typescript
2334
- * const ruleBasedScorers = await neurolink.getAvailableScorers({
2335
- * type: 'rule'
2336
- * });
2337
- * ```
2338
- */
2339
- getAvailableScorers(options?: {
2340
- /** Filter by category */
2341
- category?: import("./types/index.js").ScorerCategory;
2342
- /** Filter by type */
2343
- type?: import("./types/index.js").ScorerType;
2344
- }): Promise<import("./types/index.js").ScorerMetadata[]>;
2345
- /**
2346
- * Get a list of available evaluation pipeline presets.
2347
- * Presets are pre-configured pipelines for common evaluation scenarios.
2348
- *
2349
- * @returns Array of preset names
2350
- *
2351
- * @example
2352
- * ```typescript
2353
- * const neurolink = new NeuroLink();
2354
- * const presets = await neurolink.getEvaluationPresets();
2355
- * console.log('Available presets:', presets);
2356
- * // Output: ['safety', 'rag', 'quality', 'comprehensive', 'minimal', ...]
2357
- * ```
2358
- */
2359
- getEvaluationPresets(): Promise<string[]>;
2360
- /**
2361
- * Get details of a specific evaluation preset.
2362
- *
2363
- * @param presetName - Name of the preset
2364
- * @returns Pipeline configuration for the preset
2365
- *
2366
- * @example
2367
- * ```typescript
2368
- * const neurolink = new NeuroLink();
2369
- * const ragPreset = await neurolink.getEvaluationPreset('rag');
2370
- * console.log('RAG preset scorers:', ragPreset.scorers.map(s => s.id));
2371
- * console.log('Pass threshold:', ragPreset.passThreshold);
2372
- * ```
2373
- */
2374
- getEvaluationPreset(presetName: "safety" | "rag" | "quality" | "comprehensive" | "minimal" | "summarization" | "customerSupport" | "codeGeneration"): Promise<import("./types/index.js").PipelineConfig>;
2375
- /**
2376
- * Create an Agent instance for multi-agent orchestration.
2377
- *
2378
- * Agents are specialized AI entities with defined instructions, tools, and behavior.
2379
- * They can be composed into networks for complex task orchestration.
2380
- *
2381
- * @param definition - Agent definition specifying behavior and capabilities
2382
- * @returns A new Agent instance
2383
- *
2384
- * @example
2385
- * ```typescript
2386
- * const researcher = neurolink.createAgent({
2387
- * id: 'researcher',
2388
- * name: 'Research Agent',
2389
- * description: 'Searches and analyzes information from various sources',
2390
- * instructions: 'You are a research assistant. Search thoroughly and cite sources.',
2391
- * tools: ['websearchGrounding', 'readFile'],
2392
- * model: 'gpt-4o'
2393
- * });
2394
- *
2395
- * const result = await researcher.execute('Find recent AI breakthroughs');
2396
- * ```
2397
- *
2398
- * @see {@link AgentDefinition} for definition options
2399
- * @see {@link Agent} for agent methods
2400
- * @since 8.38.0
2401
- */
2402
- createAgent(definition: AgentDefinition): Promise<import("./agent/agent.js").Agent>;
2403
- /**
2404
- * Create an AgentNetwork for multi-agent orchestration.
2405
- *
2406
- * Networks coordinate multiple agents, workflows, and tools with intelligent
2407
- * LLM-powered routing. The router agent analyzes tasks and delegates to
2408
- * the most appropriate primitive.
2409
- *
2410
- * @param config - Network configuration with agents, workflows, and routing settings
2411
- * @returns A new AgentNetwork instance
2412
- *
2413
- * @example
2414
- * ```typescript
2415
- * const network = neurolink.createNetwork({
2416
- * name: 'Content Team',
2417
- * description: 'Collaborative content creation pipeline',
2418
- * agents: [
2419
- * {
2420
- * id: 'researcher',
2421
- * name: 'Researcher',
2422
- * description: 'Finds and verifies information',
2423
- * instructions: 'Research topics thoroughly...',
2424
- * },
2425
- * {
2426
- * id: 'writer',
2427
- * name: 'Writer',
2428
- * description: 'Creates engaging content',
2429
- * instructions: 'Write clear, engaging content...',
2430
- * },
2431
- * {
2432
- * id: 'editor',
2433
- * name: 'Editor',
2434
- * description: 'Reviews and improves content',
2435
- * instructions: 'Review for clarity and accuracy...',
2436
- * }
2437
- * ],
2438
- * router: {
2439
- * model: 'gpt-4o',
2440
- * confidenceThreshold: 0.7
2441
- * }
2442
- * });
2443
- *
2444
- * const result = await network.execute({
2445
- * message: 'Write an article about quantum computing'
2446
- * });
2447
- * ```
2448
- *
2449
- * @see {@link AgentNetworkConfig} for configuration options
2450
- * @see {@link AgentNetwork} for network methods
2451
- * @since 8.38.0
2452
- */
2453
- createNetwork(config: AgentNetworkConfig): Promise<import("./agent/agentNetwork.js").AgentNetwork>;
2454
- /**
2455
- * Create a worker-mode NeuroLink instance for sub-agent execution.
2456
- *
2457
- * Worker mode is the framework-provided version of the config block every
2458
- * consumer used to copy by hand: conversation memory OFF, orchestration
2459
- * OFF, observability inherited from this instance with
2460
- * `autoDetectExternalProvider: true` + `skipLangfuseSpanProcessor: true`
2461
- * (worker spans join the host's tracer without duplicate Langfuse
2462
- * exports), credentials inherited, the host's tool registry shared (so
2463
- * worker tool calls reuse the host's connections), and an internal log
2464
- * bridge attached with a caller-supplied tag.
2465
- *
2466
- * Dispose the worker (`worker.dispose()`) when done — `runIsolatedAgent`
2467
- * does this automatically in a `finally`.
2468
- *
2469
- * @param options - Worker options (log tag/sink, registry sharing, config)
2470
- * @returns A new worker-mode NeuroLink instance
2471
- * @see {@link WorkerInstanceOptions}
2472
- */
2473
- createWorkerInstance(options?: WorkerInstanceOptions): NeuroLink;
2474
- /**
2475
- * Run an isolated sub-agent: a worker instance (see
2476
- * {@link createWorkerInstance}) executes a tool-using research pass under
2477
- * the turn budget (wrap-up nudge, stall watchdog, honest `stopReason`),
2478
- * then an extraction pass ALWAYS runs tools-off on its own timeout with a
2479
- * structured-recovery ladder and corrective re-asks. A non-empty execution
2480
- * record never produces an empty result (mechanical digest fallback), a
2481
- * parent `abortSignal` stops everything cleanly, and `options.leg` enables
2482
- * leashed mode with TTL'd resume handles ({@link continueAgent} /
2483
- * {@link stopAgent}).
2484
- *
2485
- * @param definition - Agent definition (+ optional structured extraction)
2486
- * @param input - Task input: string or structured object
2487
- * @param options - Run options (abort, overrides, tool context, events, leg)
2488
- * @returns The run outcome
2489
- * @see {@link IsolatedAgentDefinition}
2490
- * @see {@link AgentRunOptions}
2491
- * @see {@link AgentRunOutcome}
2492
- */
2493
- runIsolatedAgent(definition: IsolatedAgentDefinition, input: string | Record<string, unknown>, options?: AgentRunOptions): Promise<AgentRunOutcome>;
2494
- /**
2495
- * Resume a leashed isolated-agent run by handle. `guidance`, when given,
2496
- * is appended as a user turn before the next leg — the supervisor's
2497
- * re-steering channel. An expired handle returns its tombstoned final
2498
- * outcome exactly once.
2499
- *
2500
- * @param handle - Handle from an `in_progress` {@link AgentRunOutcome}
2501
- * @param guidance - Optional supervisor guidance for the next leg
2502
- * @returns The next leg's outcome (or the final outcome)
2503
- */
2504
- continueAgent(handle: string, guidance?: string): Promise<AgentRunOutcome>;
2505
- /**
2506
- * Stop a leashed isolated-agent run: dispose its worker and return the
2507
- * final outcome (mechanical digest over everything gathered so far).
2508
- *
2509
- * @param handle - Handle from an `in_progress` {@link AgentRunOutcome}
2510
- * @returns The final outcome
2511
- */
2512
- stopAgent(handle: string): Promise<AgentRunOutcome>;
2513
- /**
2514
- * Register an isolated agent as a delegation tool on THIS instance, so
2515
- * its existing generate() loop can delegate — no second router generate.
2516
- * Framework policy (per-turn caps, depth withholding, a process-wide
2517
- * concurrency pool with queue timeout) is enforced in the loop itself,
2518
- * and every refusal carries its recovery instruction in the error text.
2519
- *
2520
- * @param definition - Agent definition (+ optional structured extraction)
2521
- * @param options - Registration options (name, caps, depth, pool, leg)
2522
- * @returns The registered tool name
2523
- * @see {@link AgentToolRegistrationOptions}
2524
- */
2525
- registerAgentTool(definition: IsolatedAgentDefinition, options?: AgentToolRegistrationOptions): Promise<{
2526
- name: string;
2527
- }>;
2528
- /**
2529
- * Execute an agent network with the given input.
2530
- *
2531
- * @param network - The agent network to execute
2532
- * @param input - Execution input (message and context)
2533
- * @param options - Optional execution options
2534
- * @returns Network execution result with content, trace, and usage
2535
- *
2536
- * @see {@link NetworkExecutionInput} for input options
2537
- * @see {@link NetworkExecutionResult} for result structure
2538
- * @since 8.38.0
2539
- */
2540
- executeNetwork(network: import("./agent/agentNetwork.js").AgentNetwork, input: NetworkExecutionInput, options?: NetworkExecutionOptions): Promise<NetworkExecutionResult>;
2541
- /**
2542
- * Stream agent network execution with real-time events.
2543
- *
2544
- * @param network - The agent network to stream
2545
- * @param input - Execution input (message and context)
2546
- * @param options - Optional execution options
2547
- * @returns Async iterable of network stream chunks
2548
- *
2549
- * @see {@link NetworkStreamChunk} for chunk types
2550
- * @since 8.38.0
2551
- */
2552
- streamNetwork(network: import("./agent/agentNetwork.js").AgentNetwork, input: NetworkExecutionInput, options?: NetworkExecutionOptions): AsyncIterable<NetworkStreamChunk>;
2553
- /**
2554
- * Create a NetworkOrchestrator for managing multiple agent networks.
2555
- *
2556
- * @param config - Orchestrator configuration options
2557
- * @returns A new NetworkOrchestrator instance
2558
- * @since 8.38.0
2559
- */
2560
- createOrchestrator(config?: import("./types/index.js").OrchestratorConfig): Promise<import("./agent/orchestration/index.js").NetworkOrchestrator>;
2561
- /**
2562
- * Create an AgentCoordinator for managing agent coordination strategies.
2563
- *
2564
- * @param config - Coordinator configuration options
2565
- * @returns A new AgentCoordinator instance
2566
- * @since 8.38.0
2567
- */
2568
- createCoordinator(config?: import("./types/index.js").CoordinatorConfig): Promise<import("./agent/coordination/index.js").AgentCoordinator>;
2569
- /**
2570
- * Create a MessageBus for inter-agent communication.
2571
- *
2572
- * @param config - Message bus configuration options
2573
- * @returns A new MessageBus instance
2574
- * @since 8.38.0
2575
- */
2576
- createMessageBus(config?: import("./types/index.js").MessageBusConfig): Promise<import("./agent/communication/index.js").MessageBus>;
2577
- /**
2578
- * Dispose of all resources and cleanup connections
2579
- * Call this method when done using the NeuroLink instance to prevent resource leaks
2580
- * Especially important in test environments where multiple instances are created
2581
- */
2582
- dispose(): Promise<void>;
2583
- /**
2584
- * Get the tool registry instance
2585
- * Used internally by server adapters for tool management
2586
- * @returns The MCPToolRegistry instance
2587
- */
2588
- getToolRegistry(): MCPToolRegistry;
2589
- /**
2590
- * Manually trigger context compaction for a session.
2591
- * Runs the full 4-stage compaction pipeline.
2592
- */
2593
- compactSession(sessionId: string, config?: CompactionConfig): Promise<CompactionResult | null>;
2594
- /**
2595
- * Get context usage statistics for a session.
2596
- * Returns token counts, usage ratio, and breakdown by category.
2597
- */
2598
- getContextStats(sessionId: string, provider?: string, model?: string): Promise<{
2599
- estimatedInputTokens: number;
2600
- availableInputTokens: number;
2601
- usageRatio: number;
2602
- shouldCompact: boolean;
2603
- messageCount: number;
2604
- } | null>;
2605
- /**
2606
- * Check if a session needs compaction.
2607
- */
2608
- needsCompaction(sessionId: string, provider?: string, model?: string): boolean;
2609
- /**
2610
- * Set the authentication provider for the NeuroLink instance
2611
- *
2612
- * @param config - Auth provider or configuration to create one
2613
- */
2614
- setAuthProvider(config: NeuroLinkAuthConfig): Promise<void>;
2615
- private initializeAuthProviderFromConfig;
2616
- /**
2617
- * Get the currently configured authentication provider
2618
- */
2619
- getAuthProvider(): AuthProvider | undefined;
2620
- /**
2621
- * Lazily initialize the auth provider from pendingAuthConfig.
2622
- * Called on first use (generate/stream with auth token) to avoid
2623
- * async work in the synchronous constructor.
2624
- */
2625
- private ensureAuthProvider;
2626
- /**
2627
- * Set the current authentication context for request handling.
2628
- *
2629
- * Delegates to the global AuthContextHolder so that auth state is NOT
2630
- * stored as an instance field (which would leak between concurrent requests
2631
- * sharing the same NeuroLink singleton). Prefer `runWithAuthContext()` from
2632
- * `authContext.ts` for proper request-scoped context via AsyncLocalStorage.
2633
- *
2634
- * @param context - The authenticated user context
2635
- */
2636
- setAuthContext(context: AuthenticatedContext): Promise<void>;
2637
- /**
2638
- * Get the current authentication context.
2639
- *
2640
- * Checks AsyncLocalStorage first, then falls back to the global holder.
2641
- */
2642
- getAuthContext(): Promise<AuthenticatedContext | undefined>;
2643
- /**
2644
- * Clear the current authentication context
2645
- */
2646
- clearAuthContext(): Promise<void>;
2647
- /**
2648
- * Get the external server manager instance
2649
- * Used internally by server adapters for external MCP server management
2650
- * @returns The ExternalServerManager instance
2651
- */
2652
- getExternalServerManager(): ExternalServerManager;
2653
- private buildResolutionContext;
2654
- /**
2655
- * Resolve dynamic arguments in GenerateOptions, mutating the options in place.
2656
- * Only resolves fields that are functions; static values pass through unchanged.
2657
- */
2658
- private resolveDynamicOptions;
2659
- private resolveDynamicFields;
2660
- }
2661
- export declare const neurolink: NeuroLink;
2662
- export default neurolink;