@juspay/neurolink 12.27.2 → 12.28.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (42) hide show
  1. package/CHANGELOG.md +2 -2
  2. package/dist/agent/directTools.d.ts +118 -94
  3. package/dist/agent/directTools.js +578 -446
  4. package/dist/agent/index.d.ts +1 -0
  5. package/dist/agent/index.js +1 -0
  6. package/dist/agent/prompts/terminalAgentPrompt.d.ts +13 -0
  7. package/dist/agent/prompts/terminalAgentPrompt.js +59 -0
  8. package/dist/browser/neurolink.min.js +384 -378
  9. package/dist/cli/factories/commandFactory.d.ts +25 -0
  10. package/dist/cli/factories/commandFactory.js +78 -8
  11. package/dist/cli/loop/optionsSchema.d.ts +1 -1
  12. package/dist/core/baseProvider.d.ts +17 -1
  13. package/dist/core/baseProvider.js +48 -1
  14. package/dist/core/modules/ToolsManager.d.ts +7 -1
  15. package/dist/core/modules/ToolsManager.js +8 -0
  16. package/dist/index.d.ts +1 -0
  17. package/dist/index.js +1 -0
  18. package/dist/mcp/toolRegistry.d.ts +12 -1
  19. package/dist/mcp/toolRegistry.js +26 -2
  20. package/dist/neurolink.d.ts +13 -0
  21. package/dist/neurolink.js +97 -10
  22. package/dist/session/globalSessionState.d.ts +8 -0
  23. package/dist/session/globalSessionState.js +17 -0
  24. package/dist/types/agentMode.d.ts +9 -0
  25. package/dist/types/agentMode.js +1 -0
  26. package/dist/types/cli.d.ts +6 -0
  27. package/dist/types/config.d.ts +9 -0
  28. package/dist/types/fileToolRoots.d.ts +17 -0
  29. package/dist/types/fileToolRoots.js +7 -0
  30. package/dist/types/generate.d.ts +17 -0
  31. package/dist/types/index.d.ts +2 -0
  32. package/dist/types/index.js +2 -0
  33. package/dist/types/providers.d.ts +6 -0
  34. package/dist/types/stream.d.ts +7 -0
  35. package/dist/types/tools.d.ts +7 -0
  36. package/dist/utils/fileToolRoots.d.ts +34 -0
  37. package/dist/utils/fileToolRoots.js +111 -0
  38. package/dist/utils/messageBuilder.js +32 -1
  39. package/dist/utils/pathSandbox.d.ts +9 -6
  40. package/dist/utils/pathSandbox.js +35 -9
  41. package/docs-site/static/search-index.json +6 -5
  42. package/package.json +6 -2
package/CHANGELOG.md CHANGED
@@ -1,8 +1,8 @@
1
- ## [12.27.2](https://github.com/juspay/neurolink/compare/v12.27.1...v12.27.2) (2026-09-26)
1
+ ## [12.28.1](https://github.com/juspay/neurolink/compare/v12.28.0...v12.28.1) (2026-09-26)
2
2
 
3
3
  ### Bug Fixes
4
4
 
5
- - **(mcp):** let the process exit and SIGTERM terminate it ([86c4f3f](https://github.com/juspay/neurolink/commit/86c4f3f00edacf0035d625e8822e112615c5b6d1))
5
+ - **(multimodal):** keep input.content text items on the text-only path ([a341481](https://github.com/juspay/neurolink/commit/a341481619c536ce97a2773ecb3f8155d0ff69aa)), closes [#289](https://github.com/juspay/neurolink/issues/289)
6
6
 
7
7
  ## [11.2.3](https://github.com/juspay/neurolink/compare/v11.2.2...v11.2.3) (2026-08-19)
8
8
 
@@ -1,4 +1,4 @@
1
- import type { AllToolsMap, BasicToolsMap, FilesystemToolsMap, Tool, UtilityToolsMap } from "../types/index.js";
1
+ import type { AllToolsMap, FileToolRootPolicy, BasicToolsMap, FilesystemToolsMap, Tool, UtilityToolsMap } from "../types/index.js";
2
2
  /**
3
3
  * Vertex location for the websearchGrounding tool:
4
4
  * NEUROLINK_WEBSEARCH_LOCATION, else `global`.
@@ -65,10 +65,13 @@ export declare function buildWebsearchResults(groundingMetadata: {
65
65
  domain: string;
66
66
  }[];
67
67
  /**
68
- * Direct tool definitions that work immediately with Gemini/AI SDK
69
- * These bypass MCP complexity and provide reliable agent functionality
68
+ * Direct tool definitions that work immediately with Gemini/AI SDK.
69
+ * These bypass MCP complexity and provide reliable agent functionality.
70
+ *
71
+ * `createDirectAgentTools` builds a fresh set bound to `policy`; the shared
72
+ * `directAgentTools` below keeps the working-directory default.
70
73
  */
71
- export declare const directAgentTools: {
74
+ export declare function createDirectAgentTools(policy: FileToolRootPolicy): {
72
75
  getCurrentTime: Tool<{
73
76
  timezone?: string | undefined;
74
77
  }, {
@@ -93,57 +96,136 @@ export declare const directAgentTools: {
93
96
  iso?: undefined;
94
97
  timestamp?: undefined;
95
98
  }>;
96
- readFile: Tool<{
97
- path: string;
99
+ readFile: Tool;
100
+ listDirectory: Tool;
101
+ calculateMath: Tool<{
102
+ expression: string;
103
+ precision: number;
98
104
  }, {
99
105
  success: boolean;
100
106
  error: string;
101
- content?: undefined;
102
- size?: undefined;
103
- path?: undefined;
104
- lastModified?: undefined;
107
+ expression?: undefined;
108
+ result?: undefined;
109
+ type?: undefined;
105
110
  } | {
106
111
  success: boolean;
107
- content: string;
108
- size: number;
109
- path: string;
110
- lastModified: string;
112
+ expression: string;
113
+ result: any;
114
+ type: "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
111
115
  error?: undefined;
112
116
  } | {
113
117
  success: boolean;
114
118
  error: string;
115
- path: string;
116
- content?: undefined;
117
- size?: undefined;
118
- lastModified?: undefined;
119
+ expression: string;
120
+ result?: undefined;
121
+ type?: undefined;
119
122
  }>;
120
- listDirectory: Tool<{
121
- path: string;
122
- includeHidden: boolean;
123
+ writeFile: Tool;
124
+ analyzeCSV: Tool;
125
+ websearchGrounding: Tool<{
126
+ query: string;
127
+ maxResults: number;
128
+ maxWords: number;
123
129
  }, {
124
130
  success: boolean;
125
131
  error: string;
126
- path?: undefined;
127
- items?: undefined;
128
- count?: undefined;
132
+ requiredEnvVars: string[];
133
+ query?: undefined;
134
+ searchResults?: undefined;
135
+ rawContent?: undefined;
136
+ totalResults?: undefined;
137
+ provider?: undefined;
138
+ model?: undefined;
139
+ responseTime?: undefined;
140
+ timestamp?: undefined;
141
+ grounded?: undefined;
129
142
  } | {
130
143
  success: boolean;
131
- path: string;
132
- items: {
133
- name: string;
134
- type: string;
135
- size: number | undefined;
136
- lastModified: string;
144
+ error: string;
145
+ query: string;
146
+ requiredEnvVars?: undefined;
147
+ searchResults?: undefined;
148
+ rawContent?: undefined;
149
+ totalResults?: undefined;
150
+ provider?: undefined;
151
+ model?: undefined;
152
+ responseTime?: undefined;
153
+ timestamp?: undefined;
154
+ grounded?: undefined;
155
+ } | {
156
+ success: boolean;
157
+ query: string;
158
+ searchResults: {
159
+ title: string;
160
+ url: string;
161
+ snippet: string;
162
+ domain: string;
137
163
  }[];
138
- count: number;
164
+ rawContent: string;
165
+ totalResults: number;
166
+ provider: string;
167
+ model: string;
168
+ responseTime: number;
169
+ timestamp: number;
170
+ grounded: boolean;
171
+ error?: undefined;
172
+ requiredEnvVars?: undefined;
173
+ } | {
174
+ success: boolean;
175
+ error: string;
176
+ query: string;
177
+ provider: string;
178
+ requiredEnvVars?: undefined;
179
+ searchResults?: undefined;
180
+ rawContent?: undefined;
181
+ totalResults?: undefined;
182
+ model?: undefined;
183
+ responseTime?: undefined;
184
+ timestamp?: undefined;
185
+ grounded?: undefined;
186
+ }>;
187
+ };
188
+ /**
189
+ * Bash command execution tool - exported separately for opt-in use.
190
+ *
191
+ * SECURITY: This tool is NOT included in directAgentTools by default.
192
+ * It must be explicitly enabled via:
193
+ * - Environment variable: NEUROLINK_ENABLE_BASH_TOOL=true
194
+ * - Config: toolConfig.enableBashTool = true
195
+ *
196
+ * Import this directly when you need bash execution capabilities:
197
+ * import { bashTool } from '../agent/directTools.js';
198
+ */
199
+ export declare function createBashTool(policy: FileToolRootPolicy): Tool;
200
+ /** The opt-in bash tool with the working-directory default. */
201
+ export declare const bashTool: Tool;
202
+ export declare const directAgentTools: {
203
+ getCurrentTime: Tool<{
204
+ timezone?: string | undefined;
205
+ }, {
206
+ success: boolean;
207
+ time: string;
208
+ timezone: string;
209
+ iso: string;
210
+ timestamp?: undefined;
211
+ error?: undefined;
212
+ } | {
213
+ success: boolean;
214
+ time: string;
215
+ iso: string;
216
+ timestamp: number;
217
+ timezone?: undefined;
139
218
  error?: undefined;
140
219
  } | {
141
220
  success: boolean;
142
221
  error: string;
143
- path: string;
144
- items?: undefined;
145
- count?: undefined;
222
+ time?: undefined;
223
+ timezone?: undefined;
224
+ iso?: undefined;
225
+ timestamp?: undefined;
146
226
  }>;
227
+ readFile: Tool;
228
+ listDirectory: Tool;
147
229
  calculateMath: Tool<{
148
230
  expression: string;
149
231
  precision: number;
@@ -166,54 +248,8 @@ export declare const directAgentTools: {
166
248
  result?: undefined;
167
249
  type?: undefined;
168
250
  }>;
169
- writeFile: Tool<{
170
- path: string;
171
- content: string;
172
- mode: "create" | "append" | "overwrite";
173
- }, {
174
- success: boolean;
175
- error: string;
176
- path?: undefined;
177
- mode?: undefined;
178
- size?: undefined;
179
- written?: undefined;
180
- } | {
181
- success: boolean;
182
- path: string;
183
- mode: "create" | "append" | "overwrite";
184
- size: number;
185
- written: number;
186
- error?: undefined;
187
- } | {
188
- success: boolean;
189
- error: string;
190
- path: string;
191
- mode?: undefined;
192
- size?: undefined;
193
- written?: undefined;
194
- }>;
195
- analyzeCSV: Tool<{
196
- filePath: string;
197
- operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
198
- column: string;
199
- maxRows: number;
200
- }, {
201
- success: boolean;
202
- operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
203
- column: string;
204
- result: string;
205
- rowCount: number;
206
- } | {
207
- success: boolean;
208
- error: string;
209
- operation?: undefined;
210
- column?: undefined;
211
- } | {
212
- success: boolean;
213
- error: string;
214
- operation: "count_by_column" | "sum_by_column" | "average_by_column" | "min_max_by_column" | "describe";
215
- column: string;
216
- }>;
251
+ writeFile: Tool;
252
+ analyzeCSV: Tool;
217
253
  websearchGrounding: Tool<{
218
254
  query: string;
219
255
  maxResults: number;
@@ -277,18 +313,6 @@ export declare const directAgentTools: {
277
313
  grounded?: undefined;
278
314
  }>;
279
315
  };
280
- /**
281
- * Bash command execution tool - exported separately for opt-in use.
282
- *
283
- * SECURITY: This tool is NOT included in directAgentTools by default.
284
- * It must be explicitly enabled via:
285
- * - Environment variable: NEUROLINK_ENABLE_BASH_TOOL=true
286
- * - Config: toolConfig.enableBashTool = true
287
- *
288
- * Import this directly when you need bash execution capabilities:
289
- * import { bashTool } from '../agent/directTools.js';
290
- */
291
- export declare const bashTool: Tool;
292
316
  /**
293
317
  * Get a subset of tools for specific use cases with improved type safety
294
318
  */