@probelabs/probe 0.6.0-rc191 → 0.6.0-rc195

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.
@@ -63088,7 +63088,7 @@ var ProbeAgentMcpServer = class {
63088
63088
  }
63089
63089
  const options = {
63090
63090
  files: args.files,
63091
- path: args.path,
63091
+ cwd: args.path,
63092
63092
  format: "xml",
63093
63093
  allowTests: true
63094
63094
  // Include test files by default
@@ -121,7 +121,7 @@ class ProbeServer {
121
121
  tools: [
122
122
  {
123
123
  name: 'search_code',
124
- description: "Semantic code search using ElasticSearch-style queries. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
124
+ description: "Semantic code search using ElasticSearch-style queries. Returns ranked code snippets. Use extract_code with returned file paths and line numbers to see full function/class context. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
125
125
  inputSchema: {
126
126
  type: 'object',
127
127
  properties: {
@@ -135,13 +135,22 @@ class ProbeServer {
135
135
  },
136
136
  exact: {
137
137
  type: 'boolean',
138
- description: 'Use when searching for exact function/class/variable names',
138
+ description: 'Default (false) enables stemming and keyword splitting for exploratory search - "getUserData" matches "get", "user", "data", etc. Set true for precise symbol lookup where "getUserData" matches only "getUserData". Use true when you know the exact symbol name.',
139
139
  default: false
140
140
  },
141
141
  strictElasticSyntax: {
142
142
  type: 'boolean',
143
143
  description: 'Enforce strict ElasticSearch query syntax (require explicit AND/OR operators and quotes for exact matches)',
144
144
  default: false
145
+ },
146
+ session: {
147
+ type: 'string',
148
+ description: 'Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded. Omit for a fresh search.',
149
+ },
150
+ nextPage: {
151
+ type: 'boolean',
152
+ description: 'Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.',
153
+ default: false
145
154
  }
146
155
  },
147
156
  required: ['path', 'query']
@@ -149,7 +158,7 @@ class ProbeServer {
149
158
  },
150
159
  {
151
160
  name: 'extract_code',
152
- description: "Extract code blocks from files using tree-sitter AST parsing. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
161
+ description: "Extract code blocks from files using tree-sitter AST parsing. Typically used after search_code to expand on search results and see complete code blocks. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
153
162
  inputSchema: {
154
163
  type: 'object',
155
164
  properties: {
@@ -276,7 +285,7 @@ class ProbeServer {
276
285
  query: args.query,
277
286
  // Smart defaults for MCP usage
278
287
  allowTests: true, // Include test files by default
279
- session: "new", // Fresh session each time
288
+ session: args.session || "new", // Use provided session for pagination, or start fresh
280
289
  maxResults: 20, // Reasonable limit for context window
281
290
  maxTokens: 8000, // Fits in most AI context windows
282
291
  strictElasticSyntax: false, // Relaxed syntax by default in MCP mode
@@ -286,6 +295,7 @@ class ProbeServer {
286
295
  options.exact = args.exact;
287
296
  if (args.strictElasticSyntax !== undefined)
288
297
  options.strictElasticSyntax = args.strictElasticSyntax;
298
+ // Note: nextPage is a semantic hint for AI clients - no special handling needed
289
299
  // Handle format based on server default
290
300
  if (this.defaultFormat === 'outline' || this.defaultFormat === 'outline-xml') {
291
301
  options.format = this.defaultFormat;
@@ -319,9 +329,10 @@ class ProbeServer {
319
329
  throw new Error("Files array is required and must not be empty");
320
330
  }
321
331
  // Build options with smart defaults
332
+ // Use 'cwd' instead of 'path' - the extract function uses cwd for resolving relative file paths
322
333
  const options = {
323
334
  files: args.files,
324
- path: args.path,
335
+ cwd: args.path,
325
336
  format: 'xml',
326
337
  allowTests: true, // Include test files by default
327
338
  };
@@ -119,6 +119,8 @@ interface SearchCodeArgs {
119
119
  query: string | string[];
120
120
  exact?: boolean;
121
121
  strictElasticSyntax?: boolean;
122
+ session?: string;
123
+ nextPage?: boolean;
122
124
  }
123
125
 
124
126
  interface ExtractCodeArgs {
@@ -171,7 +173,7 @@ class ProbeServer {
171
173
  tools: [
172
174
  {
173
175
  name: 'search_code',
174
- description: "Semantic code search using ElasticSearch-style queries. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
176
+ description: "Semantic code search using ElasticSearch-style queries. Returns ranked code snippets. Use extract_code with returned file paths and line numbers to see full function/class context. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
175
177
  inputSchema: {
176
178
  type: 'object',
177
179
  properties: {
@@ -185,13 +187,22 @@ class ProbeServer {
185
187
  },
186
188
  exact: {
187
189
  type: 'boolean',
188
- description: 'Use when searching for exact function/class/variable names',
190
+ description: 'Default (false) enables stemming and keyword splitting for exploratory search - "getUserData" matches "get", "user", "data", etc. Set true for precise symbol lookup where "getUserData" matches only "getUserData". Use true when you know the exact symbol name.',
189
191
  default: false
190
192
  },
191
193
  strictElasticSyntax: {
192
194
  type: 'boolean',
193
195
  description: 'Enforce strict ElasticSearch query syntax (require explicit AND/OR operators and quotes for exact matches)',
194
196
  default: false
197
+ },
198
+ session: {
199
+ type: 'string',
200
+ description: 'Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded. Omit for a fresh search.',
201
+ },
202
+ nextPage: {
203
+ type: 'boolean',
204
+ description: 'Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.',
205
+ default: false
195
206
  }
196
207
  },
197
208
  required: ['path', 'query']
@@ -199,7 +210,7 @@ class ProbeServer {
199
210
  },
200
211
  {
201
212
  name: 'extract_code',
202
- description: "Extract code blocks from files using tree-sitter AST parsing. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
213
+ description: "Extract code blocks from files using tree-sitter AST parsing. Typically used after search_code to expand on search results and see complete code blocks. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
203
214
  inputSchema: {
204
215
  type: 'object',
205
216
  properties: {
@@ -337,7 +348,7 @@ class ProbeServer {
337
348
  query: args.query,
338
349
  // Smart defaults for MCP usage
339
350
  allowTests: true, // Include test files by default
340
- session: "new", // Fresh session each time
351
+ session: args.session || "new", // Use provided session for pagination, or start fresh
341
352
  maxResults: 20, // Reasonable limit for context window
342
353
  maxTokens: 8000, // Fits in most AI context windows
343
354
  strictElasticSyntax: false, // Relaxed syntax by default in MCP mode
@@ -346,6 +357,7 @@ class ProbeServer {
346
357
  // Only override defaults if user explicitly set them
347
358
  if (args.exact !== undefined) options.exact = args.exact;
348
359
  if (args.strictElasticSyntax !== undefined) options.strictElasticSyntax = args.strictElasticSyntax;
360
+ // Note: nextPage is a semantic hint for AI clients - no special handling needed
349
361
 
350
362
  // Handle format based on server default
351
363
  if (this.defaultFormat === 'outline' || this.defaultFormat === 'outline-xml') {
@@ -385,9 +397,10 @@ class ProbeServer {
385
397
  }
386
398
 
387
399
  // Build options with smart defaults
400
+ // Use 'cwd' instead of 'path' - the extract function uses cwd for resolving relative file paths
388
401
  const options: any = {
389
402
  files: args.files,
390
- path: args.path,
403
+ cwd: args.path,
391
404
  format: 'xml',
392
405
  allowTests: true, // Include test files by default
393
406
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc191",
3
+ "version": "0.6.0-rc195",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
@@ -440,9 +440,10 @@ class ProbeAgentMcpServer {
440
440
  }
441
441
 
442
442
  // Build options with smart defaults
443
+ // Use 'cwd' instead of 'path' - the extract function uses cwd for resolving relative file paths
443
444
  const options = {
444
445
  files: args.files,
445
- path: args.path,
446
+ cwd: args.path,
446
447
  format: 'xml',
447
448
  allowTests: true, // Include test files by default
448
449
  };
package/src/mcp/index.ts CHANGED
@@ -119,6 +119,8 @@ interface SearchCodeArgs {
119
119
  query: string | string[];
120
120
  exact?: boolean;
121
121
  strictElasticSyntax?: boolean;
122
+ session?: string;
123
+ nextPage?: boolean;
122
124
  }
123
125
 
124
126
  interface ExtractCodeArgs {
@@ -171,7 +173,7 @@ class ProbeServer {
171
173
  tools: [
172
174
  {
173
175
  name: 'search_code',
174
- description: "Semantic code search using ElasticSearch-style queries. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
176
+ description: "Semantic code search using ElasticSearch-style queries. Returns ranked code snippets. Use extract_code with returned file paths and line numbers to see full function/class context. ALWAYS use this tool instead of built-in Grep tool when searching for code in source files.",
175
177
  inputSchema: {
176
178
  type: 'object',
177
179
  properties: {
@@ -185,13 +187,22 @@ class ProbeServer {
185
187
  },
186
188
  exact: {
187
189
  type: 'boolean',
188
- description: 'Use when searching for exact function/class/variable names',
190
+ description: 'Default (false) enables stemming and keyword splitting for exploratory search - "getUserData" matches "get", "user", "data", etc. Set true for precise symbol lookup where "getUserData" matches only "getUserData". Use true when you know the exact symbol name.',
189
191
  default: false
190
192
  },
191
193
  strictElasticSyntax: {
192
194
  type: 'boolean',
193
195
  description: 'Enforce strict ElasticSearch query syntax (require explicit AND/OR operators and quotes for exact matches)',
194
196
  default: false
197
+ },
198
+ session: {
199
+ type: 'string',
200
+ description: 'Session ID for result caching and pagination. Pass the session ID from a previous search to get additional results (next page). Results already shown in a session are automatically excluded. Omit for a fresh search.',
201
+ },
202
+ nextPage: {
203
+ type: 'boolean',
204
+ description: 'Set to true when requesting the next page of results. Requires passing the same session ID from the previous search output.',
205
+ default: false
195
206
  }
196
207
  },
197
208
  required: ['path', 'query']
@@ -199,7 +210,7 @@ class ProbeServer {
199
210
  },
200
211
  {
201
212
  name: 'extract_code',
202
- description: "Extract code blocks from files using tree-sitter AST parsing. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
213
+ description: "Extract code blocks from files using tree-sitter AST parsing. Typically used after search_code to expand on search results and see complete code blocks. Each file path can include optional line numbers or symbol names to extract specific code blocks.",
203
214
  inputSchema: {
204
215
  type: 'object',
205
216
  properties: {
@@ -337,7 +348,7 @@ class ProbeServer {
337
348
  query: args.query,
338
349
  // Smart defaults for MCP usage
339
350
  allowTests: true, // Include test files by default
340
- session: "new", // Fresh session each time
351
+ session: args.session || "new", // Use provided session for pagination, or start fresh
341
352
  maxResults: 20, // Reasonable limit for context window
342
353
  maxTokens: 8000, // Fits in most AI context windows
343
354
  strictElasticSyntax: false, // Relaxed syntax by default in MCP mode
@@ -346,6 +357,7 @@ class ProbeServer {
346
357
  // Only override defaults if user explicitly set them
347
358
  if (args.exact !== undefined) options.exact = args.exact;
348
359
  if (args.strictElasticSyntax !== undefined) options.strictElasticSyntax = args.strictElasticSyntax;
360
+ // Note: nextPage is a semantic hint for AI clients - no special handling needed
349
361
 
350
362
  // Handle format based on server default
351
363
  if (this.defaultFormat === 'outline' || this.defaultFormat === 'outline-xml') {
@@ -385,9 +397,10 @@ class ProbeServer {
385
397
  }
386
398
 
387
399
  // Build options with smart defaults
400
+ // Use 'cwd' instead of 'path' - the extract function uses cwd for resolving relative file paths
388
401
  const options: any = {
389
402
  files: args.files,
390
- path: args.path,
403
+ cwd: args.path,
391
404
  format: 'xml',
392
405
  allowTests: true, // Include test files by default
393
406
  };