@juspay/neurolink 9.87.3 → 9.88.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (47) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/dist/browser/neurolink.min.js +381 -381
  3. package/dist/cli/commands/proxy.d.ts +16 -1
  4. package/dist/cli/commands/proxy.js +275 -238
  5. package/dist/cli/factories/commandFactory.d.ts +39 -0
  6. package/dist/cli/factories/commandFactory.js +484 -3
  7. package/dist/core/conversationMemoryManager.d.ts +11 -1
  8. package/dist/core/conversationMemoryManager.js +44 -0
  9. package/dist/core/redisConversationMemoryManager.d.ts +12 -1
  10. package/dist/core/redisConversationMemoryManager.js +80 -0
  11. package/dist/lib/core/conversationMemoryManager.d.ts +11 -1
  12. package/dist/lib/core/conversationMemoryManager.js +44 -0
  13. package/dist/lib/core/redisConversationMemoryManager.d.ts +12 -1
  14. package/dist/lib/core/redisConversationMemoryManager.js +80 -0
  15. package/dist/lib/neurolink.d.ts +27 -0
  16. package/dist/lib/neurolink.js +133 -0
  17. package/dist/lib/proxy/globalInstaller.d.ts +5 -0
  18. package/dist/lib/proxy/globalInstaller.js +156 -0
  19. package/dist/lib/proxy/openaiFormat.d.ts +3 -1
  20. package/dist/lib/proxy/openaiFormat.js +19 -4
  21. package/dist/lib/proxy/proxyActivity.d.ts +8 -0
  22. package/dist/lib/proxy/proxyActivity.js +77 -0
  23. package/dist/lib/server/routes/claudeProxyRoutes.d.ts +56 -6
  24. package/dist/lib/server/routes/claudeProxyRoutes.js +208 -50
  25. package/dist/lib/server/routes/openaiProxyRoutes.js +47 -6
  26. package/dist/lib/types/cli.d.ts +4 -0
  27. package/dist/lib/types/conversation.d.ts +36 -0
  28. package/dist/lib/types/conversationMemoryInterface.d.ts +5 -1
  29. package/dist/lib/types/proxy.d.ts +49 -0
  30. package/dist/lib/utils/fileDetector.js +34 -10
  31. package/dist/neurolink.d.ts +27 -0
  32. package/dist/neurolink.js +133 -0
  33. package/dist/proxy/globalInstaller.d.ts +5 -0
  34. package/dist/proxy/globalInstaller.js +155 -0
  35. package/dist/proxy/openaiFormat.d.ts +3 -1
  36. package/dist/proxy/openaiFormat.js +19 -4
  37. package/dist/proxy/proxyActivity.d.ts +8 -0
  38. package/dist/proxy/proxyActivity.js +76 -0
  39. package/dist/server/routes/claudeProxyRoutes.d.ts +56 -6
  40. package/dist/server/routes/claudeProxyRoutes.js +208 -50
  41. package/dist/server/routes/openaiProxyRoutes.js +47 -6
  42. package/dist/types/cli.d.ts +4 -0
  43. package/dist/types/conversation.d.ts +36 -0
  44. package/dist/types/conversationMemoryInterface.d.ts +5 -1
  45. package/dist/types/proxy.d.ts +49 -0
  46. package/dist/utils/fileDetector.js +34 -10
  47. package/package.json +3 -2
@@ -1823,23 +1823,47 @@ class ExtensionStrategy {
1823
1823
  };
1824
1824
  }
1825
1825
  getExtension(input) {
1826
- if (this.isURL(input)) {
1827
- const url = new URL(input);
1828
- const match = url.pathname.match(/\.([^.]+)$/);
1829
- return match ? match[1] : null;
1826
+ const normalizedInput = input.trim();
1827
+ let extensionSource = normalizedInput;
1828
+ if (this.isURL(normalizedInput)) {
1829
+ try {
1830
+ const url = new URL(normalizedInput);
1831
+ extensionSource = url.pathname;
1832
+ try {
1833
+ extensionSource = decodeURIComponent(extensionSource);
1834
+ }
1835
+ catch {
1836
+ // Keep the original pathname if the URL contains malformed escapes.
1837
+ }
1838
+ }
1839
+ catch {
1840
+ extensionSource = normalizedInput;
1841
+ }
1830
1842
  }
1831
- const match = input.match(/\.([^.]+)$/);
1832
- return match ? match[1] : null;
1843
+ const match = extensionSource.trim().match(/\.([^.]+)$/);
1844
+ if (!match) {
1845
+ return null;
1846
+ }
1847
+ const ext = match[1].split(/[?#]/)[0].toLowerCase();
1848
+ return /^[a-z0-9]+$/.test(ext) ? ext : null;
1833
1849
  }
1834
1850
  isURL(str) {
1835
- return str.startsWith("http://") || str.startsWith("https://");
1851
+ const normalized = str.trim();
1852
+ return (normalized.startsWith("http://") || normalized.startsWith("https://"));
1836
1853
  }
1837
1854
  detectSource(input) {
1838
- if (input.startsWith("data:")) {
1855
+ const normalized = input.trim();
1856
+ if (normalized.startsWith("data:")) {
1839
1857
  return "datauri";
1840
1858
  }
1841
- if (this.isURL(input)) {
1842
- return "url";
1859
+ if (this.isURL(normalized)) {
1860
+ try {
1861
+ new URL(normalized);
1862
+ return "url";
1863
+ }
1864
+ catch {
1865
+ return "path";
1866
+ }
1843
1867
  }
1844
1868
  return "path";
1845
1869
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@juspay/neurolink",
3
- "version": "9.87.3",
3
+ "version": "9.88.0",
4
4
  "packageManager": "pnpm@10.15.1",
5
5
  "description": "TypeScript AI SDK with 24+ LLM providers behind one consistent API. MCP-native (58+ servers), voice TTS/STT/realtime, RAG, agents, memory, context compaction. OpenAI · Anthropic · Gemini · Bedrock · Azure · Ollama · DeepSeek · NVIDIA NIM and more.",
6
6
  "author": {
@@ -114,6 +114,7 @@
114
114
  "test:dynamic": "npx tsx test/continuous-test-suite-dynamic.ts",
115
115
  "test:proxy": "npx tsx test/continuous-test-suite-proxy.ts",
116
116
  "test:bugfixes": "npx tsx test/continuous-test-suite-bugfixes.ts",
117
+ "test:file-detector-extension": "npx tsx test/continuous-test-suite-file-detector-extension.ts",
117
118
  "test:json": "npx tsx test/continuous-test-suite-json.ts",
118
119
  "test:json-e2e": "npx tsx test/continuous-test-suite-json-e2e.ts",
119
120
  "test:workflow": "npx tsx test/continuous-test-suite-workflow.ts",
@@ -140,7 +141,7 @@
140
141
  "test:system-messages:vitest": "pnpm exec vitest run test/systemMessages.test.ts",
141
142
  "test:tool-routing-semantic:vitest": "pnpm exec vitest run test/toolRoutingSemantic.test.ts",
142
143
  "test:tool-routing-semantic": "pnpm run test:tool-routing-semantic:vitest && npx tsx test/continuous-test-suite-tool-routing-semantic.ts",
143
- "test:unit": "pnpm run test:envguard && pnpm run test:bugfixes && pnpm run test:mcp:infra && pnpm run test:mcp:bash && pnpm run test:mcp:limits && pnpm run test:mcp:spans && pnpm run test:autoresearch:redis && pnpm run test:unit:vitest && pnpm run test:tool-routing-cli:vitest && pnpm run test:tool-dedup:vitest && pnpm run test:model-pool:vitest && pnpm run test:system-messages:vitest && pnpm run test:tool-routing-semantic:vitest && pnpm run test:anthropic-tools-policy && pnpm run test:anthropic-multimodal && pnpm run test:excel-interop",
144
+ "test:unit": "pnpm run test:envguard && pnpm run test:bugfixes && pnpm run test:file-detector-extension && pnpm run test:mcp:infra && pnpm run test:mcp:bash && pnpm run test:mcp:limits && pnpm run test:mcp:spans && pnpm run test:autoresearch:redis && pnpm run test:unit:vitest && pnpm run test:tool-routing-cli:vitest && pnpm run test:tool-dedup:vitest && pnpm run test:model-pool:vitest && pnpm run test:system-messages:vitest && pnpm run test:tool-routing-semantic:vitest && pnpm run test:anthropic-tools-policy && pnpm run test:anthropic-multimodal && pnpm run test:excel-interop",
144
145
  "// CI tier — live providers, runs only when API keys are present (test:credentials and test:dynamic make real provider calls when keys are set, so they live here, not in test:unit)": "",
145
146
  "test:live": "pnpm run test:providers && pnpm run test:mcp:http && pnpm run test:mcp:sdk && pnpm run test:mcp:cli && pnpm run test:observability && pnpm run test:context && pnpm run test:memory && pnpm run test:tool-reliability && pnpm run test:evaluation && pnpm run test:autoresearch && pnpm run test:credentials && pnpm run test:dynamic",
146
147
  "// CI tier — product output (image/video/TTS/PPT) — costs $$ per run": "",