@juspay/neurolink 7.48.0 → 7.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +15 -0
- package/README.md +177 -784
- package/dist/agent/directTools.d.ts +55 -0
- package/dist/agent/directTools.js +266 -0
- package/dist/cli/factories/commandFactory.d.ts +2 -0
- package/dist/cli/factories/commandFactory.js +130 -16
- package/dist/cli/index.js +0 -0
- package/dist/cli/loop/conversationSelector.d.ts +45 -0
- package/dist/cli/loop/conversationSelector.js +222 -0
- package/dist/cli/loop/optionsSchema.d.ts +1 -1
- package/dist/cli/loop/session.d.ts +36 -8
- package/dist/cli/loop/session.js +257 -61
- package/dist/core/baseProvider.js +9 -2
- package/dist/core/evaluation.js +5 -2
- package/dist/factories/providerRegistry.js +2 -2
- package/dist/lib/agent/directTools.d.ts +55 -0
- package/dist/lib/agent/directTools.js +266 -0
- package/dist/lib/core/baseProvider.js +9 -2
- package/dist/lib/core/evaluation.js +5 -2
- package/dist/lib/factories/providerRegistry.js +2 -2
- package/dist/lib/mcp/factory.d.ts +2 -157
- package/dist/lib/mcp/flexibleToolValidator.d.ts +1 -5
- package/dist/lib/mcp/index.d.ts +3 -2
- package/dist/lib/mcp/mcpCircuitBreaker.d.ts +1 -75
- package/dist/lib/mcp/mcpClientFactory.d.ts +1 -20
- package/dist/lib/mcp/mcpClientFactory.js +1 -0
- package/dist/lib/mcp/registry.d.ts +3 -10
- package/dist/lib/mcp/servers/agent/directToolsServer.d.ts +1 -1
- package/dist/lib/mcp/servers/aiProviders/aiCoreServer.d.ts +1 -1
- package/dist/lib/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/lib/mcp/toolDiscoveryService.d.ts +3 -84
- package/dist/lib/mcp/toolRegistry.d.ts +2 -24
- package/dist/lib/middleware/builtin/guardrails.d.ts +5 -16
- package/dist/lib/middleware/builtin/guardrails.js +44 -39
- package/dist/lib/middleware/utils/guardrailsUtils.d.ts +64 -0
- package/dist/lib/middleware/utils/guardrailsUtils.js +387 -0
- package/dist/lib/neurolink.d.ts +1 -1
- package/dist/lib/providers/anthropic.js +46 -3
- package/dist/lib/providers/azureOpenai.js +8 -2
- package/dist/lib/providers/googleAiStudio.js +8 -2
- package/dist/lib/providers/googleVertex.js +11 -2
- package/dist/lib/providers/huggingFace.js +1 -1
- package/dist/lib/providers/litellm.js +1 -1
- package/dist/lib/providers/mistral.js +1 -1
- package/dist/lib/providers/openAI.js +46 -3
- package/dist/lib/providers/sagemaker/adaptive-semaphore.d.ts +1 -13
- package/dist/lib/providers/sagemaker/client.d.ts +1 -1
- package/dist/lib/providers/sagemaker/config.d.ts +1 -1
- package/dist/lib/providers/sagemaker/detection.d.ts +1 -1
- package/dist/lib/providers/sagemaker/errors.d.ts +1 -1
- package/dist/lib/providers/sagemaker/index.d.ts +1 -1
- package/dist/lib/providers/sagemaker/language-model.d.ts +1 -1
- package/dist/lib/providers/sagemaker/parsers.d.ts +1 -1
- package/dist/lib/providers/sagemaker/streaming.d.ts +1 -1
- package/dist/lib/providers/sagemaker/structured-parser.d.ts +1 -1
- package/dist/lib/session/globalSessionState.d.ts +26 -0
- package/dist/lib/session/globalSessionState.js +49 -0
- package/dist/lib/types/cli.d.ts +28 -0
- package/dist/lib/types/content.d.ts +18 -5
- package/dist/lib/types/contextTypes.d.ts +1 -1
- package/dist/lib/types/conversation.d.ts +55 -4
- package/dist/lib/types/fileTypes.d.ts +65 -0
- package/dist/lib/types/fileTypes.js +4 -0
- package/dist/lib/types/generateTypes.d.ts +12 -0
- package/dist/lib/types/guardrails.d.ts +103 -0
- package/dist/lib/types/guardrails.js +1 -0
- package/dist/lib/types/index.d.ts +4 -2
- package/dist/lib/types/index.js +4 -0
- package/dist/lib/types/mcpTypes.d.ts +407 -14
- package/dist/lib/types/providers.d.ts +469 -0
- package/dist/lib/types/streamTypes.d.ts +7 -0
- package/dist/lib/types/tools.d.ts +132 -35
- package/dist/lib/utils/csvProcessor.d.ts +68 -0
- package/dist/lib/utils/csvProcessor.js +277 -0
- package/dist/lib/utils/fileDetector.d.ts +57 -0
- package/dist/lib/utils/fileDetector.js +457 -0
- package/dist/lib/utils/imageProcessor.d.ts +10 -0
- package/dist/lib/utils/imageProcessor.js +22 -0
- package/dist/lib/utils/loopUtils.d.ts +71 -0
- package/dist/lib/utils/loopUtils.js +262 -0
- package/dist/lib/utils/messageBuilder.d.ts +2 -1
- package/dist/lib/utils/messageBuilder.js +197 -2
- package/dist/lib/utils/optionsUtils.d.ts +1 -1
- package/dist/mcp/factory.d.ts +2 -157
- package/dist/mcp/flexibleToolValidator.d.ts +1 -5
- package/dist/mcp/index.d.ts +3 -2
- package/dist/mcp/mcpCircuitBreaker.d.ts +1 -75
- package/dist/mcp/mcpClientFactory.d.ts +1 -20
- package/dist/mcp/mcpClientFactory.js +1 -0
- package/dist/mcp/registry.d.ts +3 -10
- package/dist/mcp/servers/agent/directToolsServer.d.ts +1 -1
- package/dist/mcp/servers/aiProviders/aiCoreServer.d.ts +1 -1
- package/dist/mcp/servers/utilities/utilityServer.d.ts +1 -1
- package/dist/mcp/toolDiscoveryService.d.ts +3 -84
- package/dist/mcp/toolRegistry.d.ts +2 -24
- package/dist/middleware/builtin/guardrails.d.ts +5 -16
- package/dist/middleware/builtin/guardrails.js +44 -39
- package/dist/middleware/utils/guardrailsUtils.d.ts +64 -0
- package/dist/middleware/utils/guardrailsUtils.js +387 -0
- package/dist/neurolink.d.ts +1 -1
- package/dist/providers/anthropic.js +46 -3
- package/dist/providers/azureOpenai.js +8 -2
- package/dist/providers/googleAiStudio.js +8 -2
- package/dist/providers/googleVertex.js +11 -2
- package/dist/providers/huggingFace.js +1 -1
- package/dist/providers/litellm.js +1 -1
- package/dist/providers/mistral.js +1 -1
- package/dist/providers/openAI.js +46 -3
- package/dist/providers/sagemaker/adaptive-semaphore.d.ts +1 -13
- package/dist/providers/sagemaker/client.d.ts +1 -1
- package/dist/providers/sagemaker/config.d.ts +1 -1
- package/dist/providers/sagemaker/detection.d.ts +1 -1
- package/dist/providers/sagemaker/errors.d.ts +1 -1
- package/dist/providers/sagemaker/index.d.ts +1 -1
- package/dist/providers/sagemaker/language-model.d.ts +3 -3
- package/dist/providers/sagemaker/parsers.d.ts +1 -1
- package/dist/providers/sagemaker/streaming.d.ts +1 -1
- package/dist/providers/sagemaker/structured-parser.d.ts +1 -1
- package/dist/session/globalSessionState.d.ts +26 -0
- package/dist/session/globalSessionState.js +49 -0
- package/dist/types/cli.d.ts +28 -0
- package/dist/types/content.d.ts +18 -5
- package/dist/types/contextTypes.d.ts +1 -1
- package/dist/types/conversation.d.ts +55 -4
- package/dist/types/fileTypes.d.ts +65 -0
- package/dist/types/fileTypes.js +4 -0
- package/dist/types/generateTypes.d.ts +12 -0
- package/dist/types/guardrails.d.ts +103 -0
- package/dist/types/guardrails.js +1 -0
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.js +4 -0
- package/dist/types/mcpTypes.d.ts +407 -14
- package/dist/types/modelTypes.d.ts +6 -6
- package/dist/types/providers.d.ts +469 -0
- package/dist/types/streamTypes.d.ts +7 -0
- package/dist/types/tools.d.ts +132 -35
- package/dist/utils/csvProcessor.d.ts +68 -0
- package/dist/utils/csvProcessor.js +277 -0
- package/dist/utils/fileDetector.d.ts +57 -0
- package/dist/utils/fileDetector.js +457 -0
- package/dist/utils/imageProcessor.d.ts +10 -0
- package/dist/utils/imageProcessor.js +22 -0
- package/dist/utils/loopUtils.d.ts +71 -0
- package/dist/utils/loopUtils.js +262 -0
- package/dist/utils/messageBuilder.d.ts +2 -1
- package/dist/utils/messageBuilder.js +197 -2
- package/dist/utils/optionsUtils.d.ts +1 -1
- package/package.json +9 -3
- package/dist/lib/mcp/contracts/mcpContract.d.ts +0 -106
- package/dist/lib/mcp/contracts/mcpContract.js +0 -5
- package/dist/lib/providers/sagemaker/types.d.ts +0 -456
- package/dist/lib/providers/sagemaker/types.js +0 -7
- package/dist/mcp/contracts/mcpContract.d.ts +0 -106
- package/dist/mcp/contracts/mcpContract.js +0 -5
- package/dist/providers/sagemaker/types.d.ts +0 -456
- package/dist/providers/sagemaker/types.js +0 -7
|
@@ -0,0 +1,222 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Conversation Selector for Loop Mode
|
|
3
|
+
* Handles discovery and selection of stored conversations from Redis
|
|
4
|
+
*/
|
|
5
|
+
import inquirer from "inquirer";
|
|
6
|
+
import chalk from "chalk";
|
|
7
|
+
import { createRedisClient, scanKeys, deserializeConversation, getNormalizedConfig, } from "../../lib/utils/redis.js";
|
|
8
|
+
import { logger } from "../../lib/utils/logger.js";
|
|
9
|
+
import { LOOP_CACHE_CONFIG, LOOP_DISPLAY_LIMITS, generateConversationTitle, truncateText, formatTimeAgo, getContentIcon, } from "../../lib/utils/loopUtils.js";
|
|
10
|
+
export class ConversationSelector {
|
|
11
|
+
redisClient = null;
|
|
12
|
+
redisConfig;
|
|
13
|
+
conversationCache = null;
|
|
14
|
+
cacheTimestamp = 0;
|
|
15
|
+
constructor(redisConfig = {}) {
|
|
16
|
+
this.redisConfig = getNormalizedConfig(redisConfig);
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Initialize Redis connection
|
|
20
|
+
*/
|
|
21
|
+
async initializeRedis() {
|
|
22
|
+
if (!this.redisClient) {
|
|
23
|
+
this.redisClient = await createRedisClient(this.redisConfig);
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Get available conversations for a user
|
|
28
|
+
*/
|
|
29
|
+
async getAvailableConversations(userId) {
|
|
30
|
+
// Check if cached conversations are still valid (within TTL)
|
|
31
|
+
if (this.conversationCache &&
|
|
32
|
+
Date.now() - this.cacheTimestamp < LOOP_CACHE_CONFIG.TTL_MS) {
|
|
33
|
+
logger.debug("Using cached conversation list");
|
|
34
|
+
return this.filterConversationsByUser(this.conversationCache, userId);
|
|
35
|
+
}
|
|
36
|
+
try {
|
|
37
|
+
await this.initializeRedis();
|
|
38
|
+
if (!this.redisClient) {
|
|
39
|
+
throw new Error("Redis client not available");
|
|
40
|
+
}
|
|
41
|
+
const keys = await this.scanConversationKeys();
|
|
42
|
+
if (keys.length === 0) {
|
|
43
|
+
logger.debug("No conversations found in Redis");
|
|
44
|
+
return [];
|
|
45
|
+
}
|
|
46
|
+
const summaries = await this.processConversationKeys(keys);
|
|
47
|
+
const sortedSummaries = this.sortConversationsByDate(summaries);
|
|
48
|
+
this.updateCache(sortedSummaries);
|
|
49
|
+
return this.filterConversationsByUser(sortedSummaries, userId);
|
|
50
|
+
}
|
|
51
|
+
catch (error) {
|
|
52
|
+
return this.handleRetrievalError(error);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
/**
|
|
56
|
+
* Display conversation menu and get user selection
|
|
57
|
+
*/
|
|
58
|
+
async displayConversationMenu(userId) {
|
|
59
|
+
try {
|
|
60
|
+
const conversations = await this.getAvailableConversations(userId);
|
|
61
|
+
if (conversations.length === 0) {
|
|
62
|
+
logger.debug("No conversations available for selection");
|
|
63
|
+
return "NEW_CONVERSATION";
|
|
64
|
+
}
|
|
65
|
+
const choices = this.createMenuChoices(conversations);
|
|
66
|
+
return await this.showSelectionPrompt(choices);
|
|
67
|
+
}
|
|
68
|
+
catch (error) {
|
|
69
|
+
return this.handleMenuError(error);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* Check if there are any stored conversations
|
|
74
|
+
*/
|
|
75
|
+
async hasStoredConversations(userId) {
|
|
76
|
+
try {
|
|
77
|
+
const conversations = await this.getAvailableConversations(userId);
|
|
78
|
+
return conversations.length > 0;
|
|
79
|
+
}
|
|
80
|
+
catch (error) {
|
|
81
|
+
logger.debug("Failed to check for stored conversations:", error);
|
|
82
|
+
return false;
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Close Redis connection
|
|
87
|
+
*/
|
|
88
|
+
async close() {
|
|
89
|
+
if (this.redisClient) {
|
|
90
|
+
await this.redisClient.quit();
|
|
91
|
+
this.redisClient = null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
async scanConversationKeys() {
|
|
95
|
+
if (!this.redisClient) {
|
|
96
|
+
throw new Error("Redis client not initialized");
|
|
97
|
+
}
|
|
98
|
+
const pattern = `${this.redisConfig.keyPrefix}*`;
|
|
99
|
+
const keys = await scanKeys(this.redisClient, pattern);
|
|
100
|
+
logger.debug(`Found ${keys.length} conversation keys in Redis`);
|
|
101
|
+
return keys;
|
|
102
|
+
}
|
|
103
|
+
async processConversationKeys(keys) {
|
|
104
|
+
const summaries = [];
|
|
105
|
+
for (const key of keys) {
|
|
106
|
+
const summary = await this.processSingleConversationKey(key);
|
|
107
|
+
if (summary) {
|
|
108
|
+
summaries.push(summary);
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
return summaries;
|
|
112
|
+
}
|
|
113
|
+
async processSingleConversationKey(key) {
|
|
114
|
+
if (!this.redisClient) {
|
|
115
|
+
logger.warn(`Redis client not available for key ${key}`);
|
|
116
|
+
return null;
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
const conversationData = await this.redisClient.get(key);
|
|
120
|
+
const conversation = deserializeConversation(conversationData);
|
|
121
|
+
if (conversation &&
|
|
122
|
+
conversation.messages &&
|
|
123
|
+
conversation.messages.length > 0) {
|
|
124
|
+
return this.createConversationSummary(conversation);
|
|
125
|
+
}
|
|
126
|
+
return null;
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
logger.warn(`Failed to process conversation key ${key}:`, error);
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
sortConversationsByDate(summaries) {
|
|
134
|
+
return summaries.sort((a, b) => new Date(b.updatedAt).getTime() - new Date(a.updatedAt).getTime());
|
|
135
|
+
}
|
|
136
|
+
updateCache(summaries) {
|
|
137
|
+
this.conversationCache = summaries;
|
|
138
|
+
this.cacheTimestamp = Date.now();
|
|
139
|
+
logger.debug(`Retrieved ${summaries.length} valid conversations`);
|
|
140
|
+
}
|
|
141
|
+
filterConversationsByUser(summaries, userId) {
|
|
142
|
+
if (!userId) {
|
|
143
|
+
return summaries;
|
|
144
|
+
}
|
|
145
|
+
return summaries.filter((summary) => summary.userId === userId);
|
|
146
|
+
}
|
|
147
|
+
/*
|
|
148
|
+
* Create menu choices for inquirer prompt
|
|
149
|
+
*/
|
|
150
|
+
createMenuChoices(conversations) {
|
|
151
|
+
const choices = [
|
|
152
|
+
{
|
|
153
|
+
name: chalk.green("🆕 Start New Conversation"),
|
|
154
|
+
value: "NEW_CONVERSATION",
|
|
155
|
+
short: "New Conversation",
|
|
156
|
+
},
|
|
157
|
+
new inquirer.Separator(),
|
|
158
|
+
];
|
|
159
|
+
for (const conversation of conversations.slice(0, LOOP_DISPLAY_LIMITS.MAX_CONVERSATIONS)) {
|
|
160
|
+
const choice = this.formatConversationChoice(conversation);
|
|
161
|
+
choices.push(choice);
|
|
162
|
+
}
|
|
163
|
+
return choices;
|
|
164
|
+
}
|
|
165
|
+
async showSelectionPrompt(choices) {
|
|
166
|
+
const answer = await inquirer.prompt([
|
|
167
|
+
{
|
|
168
|
+
type: "list",
|
|
169
|
+
name: "selectedConversation",
|
|
170
|
+
message: "Select a conversation to continue:",
|
|
171
|
+
choices,
|
|
172
|
+
pageSize: LOOP_DISPLAY_LIMITS.PAGE_SIZE,
|
|
173
|
+
},
|
|
174
|
+
]);
|
|
175
|
+
return answer.selectedConversation;
|
|
176
|
+
}
|
|
177
|
+
handleRetrievalError(error) {
|
|
178
|
+
logger.error("Failed to retrieve conversations:", error);
|
|
179
|
+
return [];
|
|
180
|
+
}
|
|
181
|
+
handleMenuError(error) {
|
|
182
|
+
logger.error("Failed to display conversation menu:", error);
|
|
183
|
+
return "NEW_CONVERSATION";
|
|
184
|
+
}
|
|
185
|
+
createConversationSummary(conversation) {
|
|
186
|
+
const messages = conversation.messages;
|
|
187
|
+
const firstMessage = messages[0];
|
|
188
|
+
const lastMessage = messages[messages.length - 1];
|
|
189
|
+
return {
|
|
190
|
+
sessionId: conversation.sessionId,
|
|
191
|
+
id: conversation.id,
|
|
192
|
+
title: conversation.title || generateConversationTitle(firstMessage.content),
|
|
193
|
+
firstMessage: {
|
|
194
|
+
content: truncateText(firstMessage.content, LOOP_DISPLAY_LIMITS.CONTENT_LENGTH),
|
|
195
|
+
timestamp: firstMessage.timestamp || conversation.createdAt,
|
|
196
|
+
},
|
|
197
|
+
lastMessage: {
|
|
198
|
+
content: truncateText(lastMessage.content, LOOP_DISPLAY_LIMITS.CONTENT_LENGTH),
|
|
199
|
+
timestamp: lastMessage.timestamp || conversation.updatedAt,
|
|
200
|
+
},
|
|
201
|
+
messageCount: messages.length,
|
|
202
|
+
userId: conversation.userId,
|
|
203
|
+
duration: formatTimeAgo(conversation.updatedAt),
|
|
204
|
+
createdAt: conversation.createdAt,
|
|
205
|
+
updatedAt: conversation.updatedAt,
|
|
206
|
+
};
|
|
207
|
+
}
|
|
208
|
+
formatConversationChoice(summary) {
|
|
209
|
+
const icon = getContentIcon(summary.firstMessage.content);
|
|
210
|
+
const title = chalk.white(summary.title || "Untitled Conversation");
|
|
211
|
+
const duration = chalk.gray(`(${summary.duration})`);
|
|
212
|
+
const details = chalk.gray(` └ ${summary.messageCount} message${summary.messageCount !== 1 ? "s" : ""} | ` +
|
|
213
|
+
`Session: ${summary.sessionId.slice(0, LOOP_DISPLAY_LIMITS.SESSION_ID_DISPLAY)}... | ` +
|
|
214
|
+
`Updated: ${new Date(summary.updatedAt).toLocaleString()}`);
|
|
215
|
+
const name = `${icon} ${title} ${duration}\n${details}`;
|
|
216
|
+
return {
|
|
217
|
+
name,
|
|
218
|
+
value: summary.sessionId,
|
|
219
|
+
short: `${summary.title} (${summary.sessionId.slice(0, LOOP_DISPLAY_LIMITS.SESSION_ID_SHORT)}...)`,
|
|
220
|
+
};
|
|
221
|
+
}
|
|
222
|
+
}
|
|
@@ -12,4 +12,4 @@ export interface OptionSchema {
|
|
|
12
12
|
* This object provides metadata for validation and help text in the CLI loop.
|
|
13
13
|
* It is derived from the main TextGenerationOptions interface to ensure consistency.
|
|
14
14
|
*/
|
|
15
|
-
export declare const textGenerationOptionsSchema: Record<keyof Omit<TextGenerationOptions, "prompt" | "input" | "schema" | "tools" | "context" | "conversationHistory" | "conversationMessages" | "conversationMemoryConfig" | "originalPrompt" | "middleware" | "expectedOutcome" | "evaluationCriteria" | "region">, OptionSchema>;
|
|
15
|
+
export declare const textGenerationOptionsSchema: Record<keyof Omit<TextGenerationOptions, "prompt" | "input" | "schema" | "tools" | "context" | "conversationHistory" | "conversationMessages" | "conversationMemoryConfig" | "originalPrompt" | "middleware" | "expectedOutcome" | "evaluationCriteria" | "region" | "csvOptions">, OptionSchema>;
|
|
@@ -2,27 +2,55 @@ import type { Argv } from "yargs";
|
|
|
2
2
|
import type { ConversationMemoryConfig } from "../../lib/types/conversation.js";
|
|
3
3
|
export declare class LoopSession {
|
|
4
4
|
private conversationMemoryConfig?;
|
|
5
|
+
private options?;
|
|
5
6
|
private initializeCliParser;
|
|
6
7
|
private isRunning;
|
|
7
8
|
private sessionId?;
|
|
8
9
|
private commandHistory;
|
|
9
10
|
private sessionVariablesSchema;
|
|
10
|
-
constructor(initializeCliParser: () => Argv, conversationMemoryConfig?: ConversationMemoryConfig | undefined
|
|
11
|
+
constructor(initializeCliParser: () => Argv, conversationMemoryConfig?: ConversationMemoryConfig | undefined, options?: {
|
|
12
|
+
directResumeSessionId?: string;
|
|
13
|
+
forceNewSession?: boolean;
|
|
14
|
+
} | undefined);
|
|
11
15
|
start(): Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* Handle direct session resume from CLI option
|
|
18
|
+
*/
|
|
19
|
+
private handleDirectSessionResume;
|
|
20
|
+
/**
|
|
21
|
+
* Handle conversation selection logic when no direct resume is specified
|
|
22
|
+
*/
|
|
23
|
+
private handleConversationSelection;
|
|
24
|
+
/**
|
|
25
|
+
* Clean up session resources and connections
|
|
26
|
+
*/
|
|
27
|
+
private cleanup;
|
|
12
28
|
private handleSessionCommands;
|
|
13
|
-
private parseValue;
|
|
14
29
|
private showHelp;
|
|
15
30
|
private showSetHelp;
|
|
16
31
|
/**
|
|
17
|
-
*
|
|
32
|
+
* Get command input with history support using readline
|
|
33
|
+
*/
|
|
34
|
+
private getCommandWithHistory;
|
|
35
|
+
/**
|
|
36
|
+
* Restore a conversation session and set up the global session state
|
|
18
37
|
*/
|
|
19
|
-
private
|
|
38
|
+
private restoreSession;
|
|
20
39
|
/**
|
|
21
|
-
*
|
|
40
|
+
* Create NeuroLink instance and validate conversation in one step
|
|
41
|
+
* Eliminates redundant instance creation and initialization
|
|
22
42
|
*/
|
|
23
|
-
private
|
|
43
|
+
private createAndValidateNeurolinkInstance;
|
|
24
44
|
/**
|
|
25
|
-
*
|
|
45
|
+
* Configure tool execution context for the restored session
|
|
26
46
|
*/
|
|
27
|
-
private
|
|
47
|
+
private configureToolContext;
|
|
48
|
+
/**
|
|
49
|
+
* Verify that tools are available and working in the restored session
|
|
50
|
+
*/
|
|
51
|
+
private verifyToolAvailability;
|
|
52
|
+
/**
|
|
53
|
+
* Restore global session state and session variables
|
|
54
|
+
*/
|
|
55
|
+
private restoreGlobalSessionState;
|
|
28
56
|
}
|