@juspay/neurolink 7.33.4 → 7.34.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 (93) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/README.md +37 -0
  3. package/dist/cli/errorHandler.d.ts +1 -0
  4. package/dist/cli/errorHandler.js +28 -0
  5. package/dist/cli/factories/commandFactory.d.ts +23 -0
  6. package/dist/cli/factories/commandFactory.js +375 -60
  7. package/dist/cli/factories/ollamaCommandFactory.js +7 -1
  8. package/dist/cli/index.d.ts +1 -1
  9. package/dist/cli/index.js +9 -164
  10. package/dist/cli/loop/optionsSchema.d.ts +15 -0
  11. package/dist/cli/loop/optionsSchema.js +59 -0
  12. package/dist/cli/loop/session.d.ts +15 -0
  13. package/dist/cli/loop/session.js +252 -0
  14. package/dist/cli/parser.d.ts +1 -0
  15. package/dist/cli/parser.js +158 -0
  16. package/dist/cli/utils/ollamaUtils.js +6 -0
  17. package/dist/config/{conversationMemoryConfig.d.ts → conversationMemory.d.ts} +1 -1
  18. package/dist/core/baseProvider.js +17 -3
  19. package/dist/core/conversationMemoryFactory.d.ts +23 -0
  20. package/dist/core/conversationMemoryFactory.js +144 -0
  21. package/dist/core/conversationMemoryInitializer.d.ts +14 -0
  22. package/dist/core/conversationMemoryInitializer.js +127 -0
  23. package/dist/core/conversationMemoryManager.d.ts +3 -2
  24. package/dist/core/conversationMemoryManager.js +4 -3
  25. package/dist/core/redisConversationMemoryManager.d.ts +73 -0
  26. package/dist/core/redisConversationMemoryManager.js +483 -0
  27. package/dist/core/types.d.ts +1 -1
  28. package/dist/lib/config/{conversationMemoryConfig.d.ts → conversationMemory.d.ts} +1 -1
  29. package/dist/lib/core/baseProvider.js +17 -3
  30. package/dist/lib/core/conversationMemoryFactory.d.ts +23 -0
  31. package/dist/lib/core/conversationMemoryFactory.js +144 -0
  32. package/dist/lib/core/conversationMemoryInitializer.d.ts +14 -0
  33. package/dist/lib/core/conversationMemoryInitializer.js +127 -0
  34. package/dist/lib/core/conversationMemoryManager.d.ts +3 -2
  35. package/dist/lib/core/conversationMemoryManager.js +4 -3
  36. package/dist/lib/core/redisConversationMemoryManager.d.ts +73 -0
  37. package/dist/lib/core/redisConversationMemoryManager.js +483 -0
  38. package/dist/lib/core/types.d.ts +1 -1
  39. package/dist/lib/neurolink.d.ts +15 -9
  40. package/dist/lib/neurolink.js +218 -67
  41. package/dist/lib/providers/amazonBedrock.d.ts +4 -4
  42. package/dist/lib/providers/anthropic.d.ts +4 -4
  43. package/dist/lib/providers/azureOpenai.d.ts +4 -4
  44. package/dist/lib/providers/googleAiStudio.d.ts +4 -4
  45. package/dist/lib/providers/googleAiStudio.js +1 -1
  46. package/dist/lib/providers/huggingFace.d.ts +4 -4
  47. package/dist/lib/providers/litellm.d.ts +1 -1
  48. package/dist/lib/providers/mistral.d.ts +4 -4
  49. package/dist/lib/providers/mistral.js +2 -2
  50. package/dist/lib/providers/openAI.d.ts +4 -4
  51. package/dist/lib/session/globalSessionState.d.ts +27 -0
  52. package/dist/lib/session/globalSessionState.js +77 -0
  53. package/dist/lib/types/{conversationTypes.d.ts → conversation.d.ts} +32 -0
  54. package/dist/lib/types/generateTypes.d.ts +1 -1
  55. package/dist/lib/types/streamTypes.d.ts +1 -1
  56. package/dist/lib/utils/conversationMemory.d.ts +22 -0
  57. package/dist/lib/utils/conversationMemory.js +121 -0
  58. package/dist/lib/utils/conversationMemoryUtils.d.ts +1 -1
  59. package/dist/lib/utils/conversationMemoryUtils.js +2 -2
  60. package/dist/lib/utils/messageBuilder.d.ts +1 -1
  61. package/dist/lib/utils/messageBuilder.js +1 -1
  62. package/dist/lib/utils/redis.d.ts +42 -0
  63. package/dist/lib/utils/redis.js +263 -0
  64. package/dist/neurolink.d.ts +15 -9
  65. package/dist/neurolink.js +218 -67
  66. package/dist/providers/amazonBedrock.d.ts +4 -4
  67. package/dist/providers/anthropic.d.ts +4 -4
  68. package/dist/providers/azureOpenai.d.ts +4 -4
  69. package/dist/providers/googleAiStudio.d.ts +4 -4
  70. package/dist/providers/googleAiStudio.js +1 -1
  71. package/dist/providers/huggingFace.d.ts +4 -4
  72. package/dist/providers/litellm.d.ts +1 -1
  73. package/dist/providers/mistral.d.ts +4 -4
  74. package/dist/providers/mistral.js +2 -2
  75. package/dist/providers/openAI.d.ts +4 -4
  76. package/dist/session/globalSessionState.d.ts +27 -0
  77. package/dist/session/globalSessionState.js +77 -0
  78. package/dist/types/{conversationTypes.d.ts → conversation.d.ts} +32 -0
  79. package/dist/types/generateTypes.d.ts +1 -1
  80. package/dist/types/streamTypes.d.ts +1 -1
  81. package/dist/utils/conversationMemory.d.ts +22 -0
  82. package/dist/utils/conversationMemory.js +121 -0
  83. package/dist/utils/conversationMemoryUtils.d.ts +1 -1
  84. package/dist/utils/conversationMemoryUtils.js +2 -2
  85. package/dist/utils/messageBuilder.d.ts +1 -1
  86. package/dist/utils/messageBuilder.js +1 -1
  87. package/dist/utils/redis.d.ts +42 -0
  88. package/dist/utils/redis.js +263 -0
  89. package/package.json +3 -1
  90. /package/dist/config/{conversationMemoryConfig.js → conversationMemory.js} +0 -0
  91. /package/dist/lib/config/{conversationMemoryConfig.js → conversationMemory.js} +0 -0
  92. /package/dist/lib/types/{conversationTypes.js → conversation.js} +0 -0
  93. /package/dist/types/{conversationTypes.js → conversation.js} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,12 @@
1
+ ## [7.34.0](https://github.com/juspay/neurolink/compare/v7.33.4...v7.34.0) (2025-09-09)
2
+
3
+ ### Features
4
+
5
+ - **(cli):** expose memory commands to cli from sdk ([b9eb802](https://github.com/juspay/neurolink/commit/b9eb802c0ecfa521327e0423b5a9167119ac2fca))
6
+ - **(cli):** Implement interactive loop mode ([89b5012](https://github.com/juspay/neurolink/commit/89b5012ff44bac58e01846834d05ea50fe37cd35))
7
+ - **(memory):** Add Redis Support for conversation History ([28e2f86](https://github.com/juspay/neurolink/commit/28e2f86b4aa5b6e43d2bc71a86885cca40851e44))
8
+ - **(tool):** Optimize tool discovery and add conversation tutorial ([56c7a3f](https://github.com/juspay/neurolink/commit/56c7a3fac9713cdd17f3f719f793e41fce39259b))
9
+
1
10
  ## [7.33.4](https://github.com/juspay/neurolink/compare/v7.33.3...v7.33.4) (2025-09-04)
2
11
 
3
12
  ### Bug Fixes
package/README.md CHANGED
@@ -508,6 +508,43 @@ npx @juspay/neurolink generate "Complex analysis" --provider litellm --model "an
508
508
  npx @juspay/neurolink generate "Write code" # Automatically chooses optimal provider
509
509
  ```
510
510
 
511
+ ## ✨ Interactive Loop Mode
512
+
513
+ NeuroLink features a powerful **interactive loop mode** that transforms the CLI into a persistent, stateful session. This allows you to run multiple commands, set session-wide variables, and maintain conversation history without restarting.
514
+
515
+ ### Start the Loop
516
+
517
+ ```bash
518
+ npx @juspay/neurolink loop
519
+ ```
520
+
521
+ ### Example Session
522
+
523
+ ```bash
524
+ # Start the interactive session
525
+ $ npx @juspay/neurolink loop
526
+
527
+ neurolink » set provider google-ai
528
+ ✓ provider set to google-ai
529
+
530
+ neurolink » set temperature 0.8
531
+ ✓ temperature set to 0.8
532
+
533
+ neurolink » generate "Tell me a fun fact about space"
534
+ The quietest place on Earth is an anechoic chamber at Microsoft's headquarters in Redmond, Washington. The background noise is so low that it's measured in negative decibels, and you can hear your own heartbeat.
535
+
536
+ # Exit the session
537
+ neurolink » exit
538
+ ```
539
+
540
+ ### Conversation Memory in Loop Mode
541
+
542
+ Start the loop with conversation memory to have the AI remember the context of your previous commands.
543
+
544
+ ```bash
545
+ npx @juspay/neurolink loop --enable-conversation-memory
546
+ ```
547
+
511
548
  ## 💻 Essential Examples
512
549
 
513
550
  ### CLI Commands
@@ -0,0 +1 @@
1
+ export declare function handleError(_error: Error, context: string): void;
@@ -0,0 +1,28 @@
1
+ import chalk from "chalk";
2
+ import { logger } from "../lib/utils/logger.js";
3
+ import { AuthenticationError, AuthorizationError, NetworkError, RateLimitError, } from "../lib/types/errors.js";
4
+ import { globalSession } from "../lib/session/globalSessionState.js";
5
+ export function handleError(_error, context) {
6
+ logger.error(chalk.red(`❌ ${context} failed: ${_error.message}`));
7
+ if (_error instanceof AuthenticationError) {
8
+ logger.error(chalk.yellow("💡 Set Google AI Studio API key (RECOMMENDED): export GOOGLE_AI_API_KEY=AIza-..."));
9
+ logger.error(chalk.yellow("💡 Or set OpenAI API key: export OPENAI_API_KEY=sk-..."));
10
+ logger.error(chalk.yellow("💡 Or set AWS Bedrock credentials: export AWS_ACCESS_KEY_ID=... AWS_SECRET_ACCESS_KEY=... AWS_REGION=us-east-1"));
11
+ logger.error(chalk.yellow("💡 Or set Google Vertex AI credentials: export GOOGLE_APPLICATION_CREDENTIALS=/path/to/key.json"));
12
+ logger.error(chalk.yellow("💡 Or set Anthropic API key: export ANTHROPIC_API_KEY=sk-ant-..."));
13
+ logger.error(chalk.yellow("💡 Or set Azure OpenAI credentials: export AZURE_OPENAI_API_KEY=... AZURE_OPENAI_ENDPOINT=..."));
14
+ }
15
+ else if (_error instanceof RateLimitError) {
16
+ logger.error(chalk.yellow("💡 Try again in a few moments or use --provider vertex"));
17
+ }
18
+ else if (_error instanceof AuthorizationError) {
19
+ logger.error(chalk.yellow("💡 Check your account permissions for the selected model/service."));
20
+ logger.error(chalk.yellow("💡 For AWS Bedrock, ensure you have permissions for the specific model and consider using inference profile ARNs."));
21
+ }
22
+ else if (_error instanceof NetworkError) {
23
+ logger.error(chalk.yellow("💡 Check your internet connection and the provider's status page."));
24
+ }
25
+ if (!globalSession.getCurrentSessionId()) {
26
+ process.exit(1);
27
+ }
28
+ }
@@ -42,6 +42,10 @@ export declare class CLICommandFactory {
42
42
  * Create discover command
43
43
  */
44
44
  static createDiscoverCommand(): CommandModule;
45
+ /**
46
+ * Create memory commands
47
+ */
48
+ static createMemoryCommands(): CommandModule;
45
49
  /**
46
50
  * Create config commands
47
51
  */
@@ -62,6 +66,13 @@ export declare class CLICommandFactory {
62
66
  * Create SageMaker commands
63
67
  */
64
68
  static createSageMakerCommands(): CommandModule;
69
+ /**
70
+ * Create completion command
71
+ */
72
+ /**
73
+ * Create loop command
74
+ */
75
+ static createLoopCommand(): CommandModule;
65
76
  /**
66
77
  * Create completion command
67
78
  */
@@ -98,6 +109,18 @@ export declare class CLICommandFactory {
98
109
  * Execute get best provider command
99
110
  */
100
111
  private static executeGetBestProvider;
112
+ /**
113
+ * Execute memory stats command
114
+ */
115
+ private static executeMemoryStats;
116
+ /**
117
+ * Execute memory history command
118
+ */
119
+ private static executeMemoryHistory;
120
+ /**
121
+ * Execute memory clear command
122
+ */
123
+ private static executeMemoryClear;
101
124
  /**
102
125
  * Execute completion command
103
126
  */