@probelabs/probe 0.6.0-rc194 → 0.6.0-rc196

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.
@@ -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;
@@ -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') {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@probelabs/probe",
3
- "version": "0.6.0-rc194",
3
+ "version": "0.6.0-rc196",
4
4
  "description": "Node.js wrapper for the probe code search tool",
5
5
  "main": "src/index.js",
6
6
  "module": "src/index.js",
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') {